mirror of
https://github.com/holub/mame
synced 2025-07-05 09:57:47 +03:00
apollo.cpp updates [Hans Ostermeyer]
- use custom name 'disk' instead of 'harddisk' to preserve previous-MAME compatibility - fix: function keys didn't work with Num Lock on for SDL2 OSD
This commit is contained in:
parent
80ee9f3d1a
commit
be9fea28e4
@ -64,6 +64,8 @@ public:
|
||||
virtual bool is_reset_on_load() const override { return 0; }
|
||||
virtual bool support_command_line_image_creation() const override { return 1; }
|
||||
virtual const char *file_extensions() const override { return "awd"; }
|
||||
virtual const char *custom_instance_name() const override { return "winchester"; }
|
||||
virtual const char *custom_brief_instance_name() const override { return "disk"; }
|
||||
|
||||
virtual image_init_result call_create(int format_type, util::option_resolution *format_options) override;
|
||||
protected:
|
||||
|
@ -1316,7 +1316,8 @@ void apollo_stdio_device::device_reset()
|
||||
void apollo_stdio_device::device_timer(emu_timer &timer, device_timer_id id,
|
||||
int param, void *ptr)
|
||||
{
|
||||
device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
// FIXME?
|
||||
// device_serial_interface::device_timer(timer, id, param, ptr);
|
||||
}
|
||||
|
||||
void apollo_stdio_device::rcv_complete() // Rx completed receiving byte
|
||||
|
@ -112,6 +112,7 @@ void apollo_kbd_device::device_reset()
|
||||
m_delay = 500;
|
||||
m_repeat = 33;
|
||||
m_last_pressed = 0;
|
||||
m_numlock_state = 0;
|
||||
memset(m_keytime, 0, sizeof(m_keytime));
|
||||
memset(m_keyon, 0, sizeof(m_keyon));
|
||||
|
||||
@ -522,7 +523,15 @@ int apollo_kbd_device::push_scancode(uint8_t code, uint8_t repeat)
|
||||
}
|
||||
|
||||
#if MAP_APOLLO_KEYS
|
||||
if (numlock)
|
||||
|
||||
// FIXME: numlock was ok for MAME with SDL1.2 but never worked for MAME with SDL2
|
||||
// nasty hack: we toggle the numlock state from the numlock Key Up transition (starting with 0 for numlock off)
|
||||
if (code == 0xe6)
|
||||
m_numlock_state = !m_numlock_state;
|
||||
|
||||
LOG1(("scan_code = 0x%02x numlock = %d numlock_state = %d", code, numlock, m_numlock_state));
|
||||
|
||||
if (m_numlock_state)
|
||||
{
|
||||
// don't map function keys to Apollo left keypad
|
||||
switch (code)
|
||||
|
@ -147,6 +147,7 @@ private:
|
||||
uint16_t m_delay; // key press delay after initial press
|
||||
uint16_t m_repeat; // key press repeat rate
|
||||
uint16_t m_last_pressed; // last key pressed, for repeat key handling
|
||||
uint16_t m_numlock_state; // current num lock state
|
||||
int m_keytime[0x80]; // time until next key press (1 ms)
|
||||
uint8_t m_keyon[0x80]; // is 1 if key is pressed
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user