1
0
mirror of https://github.com/rcornwell/sims.git synced 2026-03-28 02:33:22 +00:00

KA10: Update DKB for multiple keyboards.

The keyboard scanner supports 64 keyboards lines which correspond to
the video switch channels.  Lines 0 to 5 are for the six III displays,
but the emulator only supports one of those for now; it's hardcoded to
keyboard 0.  Data Disc keyboards are 6 to 63.
This commit is contained in:
Lars Brinkhoff
2021-02-24 20:42:00 +01:00
parent f0a496a574
commit 913aa2e3f1
3 changed files with 26 additions and 3 deletions

View File

@@ -399,13 +399,27 @@ int dkb_keys (SIM_KEY_EVENT *kev, UNIT *uptr)
}
}
uint32 dkb_line (SIM_KEY_EVENT *kev)
{
#if NUM_DEVS_III
if (kev->dev == &iii_dev)
return iii_keyboard_line ((void *)kev->vptr);
#endif
#if NUM_DEVS_DD
if (kev->dev == &dd_dev)
return dd_keyboard_line ((void *)kev->vptr);
#endif
return ~0U;
}
int dkb_keyboard (SIM_KEY_EVENT *kev)
{
sim_debug(DEBUG_DETAIL, &dkb_dev, "DKB key %d %o\n", kev->key, kev->state);
if (dkb_modifiers (kev))
return 0;
if (dkb_keys (kev, &dkb_unit[0])) {
dkb_unit[0].LINE = dkb_line (kev);
if (dkb_unit[0].LINE != ~0U && dkb_keys (kev, &dkb_unit[0])) {
dkb_unit[0].DATA |= VALID;
dkb_unit[0].STATUS |= DONE;
set_interrupt(DKB_DEVNUM, dkb_unit[0].PIA);
@@ -427,12 +441,12 @@ t_stat dkb_reset( DEVICE *dptr)
t_stat dkb_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, const char *cptr)
{
fprintf (stderr, "This is the keyboard input for the Stanford III display\n");
fprintf (stderr, "Keyboard input for the Stanford III and Data Disc displays\n");
return SCPE_OK;
}
const char *dkb_description (DEVICE *dptr)
{
return "Keyboard scanner for III display devices";
return "Keyboard scanner for III and DD display devices";
}
#endif

View File

@@ -635,6 +635,12 @@ skip_up:
return SCPE_OK;
}
uint32 iii_keyboard_line (void *p)
{
/* III keyboards are 0 to 5, but only one is supported now. */
return 0;
}
t_stat iii_reset (DEVICE *dptr)
{
if (dptr->flags & DEV_DIS) {

View File

@@ -846,6 +846,9 @@ extern UNIT auxcpu_unit[];
//int slave_write (t_addr addr, uint64);
//extern UNIT slave_unit[];
#endif
#if NUM_DEVS_III
extern uint32 iii_keyboard_line (void *);
#endif
#if NUM_DEVS_DD
extern uint32 dd_keyboard_line (void *);
#endif