SMPC: added crude repeat key support in keyboard handling, makes typing more comfortable [Angelo Salese]

This commit is contained in:
Angelo Salese 2014-12-14 20:38:27 +01:00
parent fe833dbdf9
commit 01c02ac4b8
4 changed files with 23 additions and 6 deletions

View File

@ -699,7 +699,8 @@ READ32_MEMBER( sh2_device::sh2_internal_r )
case 0x00:
break;
case 0x01:
return m_m[1] | 0; // bit31 is TDRE: Trasmit Data Register Empty. Forcing it to be '1' breaks Saturn.
return m_m[1] | 0; // bit31 is TDRE: Trasmit Data Register Empty. Forcing it to be '1' breaks Saturn ...
// return m_m[1] | (0x84 << 24); // ... but this is actually needed to make EGWord on SS to boot?
case 0x04: // TIER, FTCSR, FRC
if ( mem_mask == 0x00ff0000 )

View File

@ -171,7 +171,7 @@ void saturn_state::stv_select_game(int gameno)
if (m_cart_reg[gameno] && m_cart_reg[gameno]->base())
memcpy(memregion("abus")->base(), m_cart_reg[gameno]->base(), 0x3000000);
else
memset(memregion("abus")->base(), 0x00, 0x3000000);
memset(memregion("abus")->base(), 0x00, 0x3000000); // TODO: 1-filled?
m_prev_bankswitch = gameno;
}
@ -415,6 +415,8 @@ void saturn_state::smpc_keyboard(UINT8 pad_num, UINT8 offset)
m_smpc.OREG[2+pad_num*offset] = game_key>>8; // game buttons, TODO
m_smpc.OREG[3+pad_num*offset] = game_key & 0xff;
/*
Keyboard Status hook-up
TODO: how shift key actually works? EGWord uses it in order to switch between hiragana and katakana modes.
x--- ---- 0
-x-- ---- caps lock
--x- ---- num lock
@ -425,7 +427,19 @@ void saturn_state::smpc_keyboard(UINT8 pad_num, UINT8 offset)
---- ---x Break key
*/
m_smpc.OREG[4+pad_num*offset] = m_keyb.status | 6;
if(m_keyb.prev_data != m_keyb.data)
{
m_smpc.OREG[5+pad_num*offset] = m_keyb.data;
m_keyb.repeat_count = 0;
m_keyb.prev_data = m_keyb.data;
}
else
{
/* Very crude repeat support */
m_keyb.repeat_count ++;
m_keyb.repeat_count = m_keyb.repeat_count > 32 ? 32 : m_keyb.repeat_count;
m_smpc.OREG[5+pad_num*offset] = (m_keyb.repeat_count == 32) ? m_keyb.data : 0;
}
}
void saturn_state::smpc_mouse(UINT8 pad_num, UINT8 offset, UINT8 id)

View File

@ -142,6 +142,8 @@ public:
struct {
UINT8 status;
UINT8 data;
UINT8 prev_data;
UINT16 repeat_count;
}m_keyb;
/* Saturn specific*/

View File

@ -13,7 +13,7 @@
do some tight synch between the master CPU and a code simulation,but I think
it's not worth the effort...
- Identify and hook-up the FDC device, apparently PC-6001 and PC-6601 doesn't even use the same thing;
- PC-6601: mon r-0 type games doesn't seem to work at all on this version?
- PC-6601: mon r-0 type games doesn't seem to work at all on this system?
- PC-6001SR: get it to boot, also implement MK-2 compatibility mode (it changes the memory map to behave like the older versions)
- Currently rewriting the video part without the MC6847 for two reasons:
A) the later models have a custom video chip in the place of the MC6847,
@ -29,7 +29,7 @@
nothing is shown on screen, other emus behaves the same, bad dump?
- Dawn Patrol (cart): presumably too slow;
(Mk2 mode 5 games)
- 3D Golf Simulation Super Version: gameplay / inputs looks broken
- 3D Golf Simulation Super Version: gameplay / inputs seems broken
- American Truck: Screen is offset at the loading screen, loading bug?
- Castle Excellent: copyright text drawing is quite bogus, scans text in vertical instead of horizontal?
- Dezeni Land (ALL versions) / Hurry Fox 1/2: asks you to "load something", can't do it with current cassette kludge, also, for Dezeni Land(s) keyboard irqs