diff options
author | Miodrag Milanovic <mmicko@gmail.com> | 2013-02-11 07:44:56 +0000 |
---|---|---|
committer | Miodrag Milanovic <mmicko@gmail.com> | 2013-02-11 07:44:56 +0000 |
commit | a440a8e0200a36491ae540f6f00beae59c148549 (patch) | |
tree | b4c31ebadaa2857396c37178674086420bf1658f /src/mess/machine | |
parent | 4b0b4e6b2fa7eb5105859f561354662d479f53be (diff) |
Cleanups and version bumpmame0148u1
Diffstat (limited to 'src/mess/machine')
67 files changed, 971 insertions, 993 deletions
diff --git a/src/mess/machine/a2eauxslot.h b/src/mess/machine/a2eauxslot.h index 290e85ba0ec..7e4c16c7c4d 100644 --- a/src/mess/machine/a2eauxslot.h +++ b/src/mess/machine/a2eauxslot.h @@ -120,7 +120,7 @@ public: virtual ~device_a2eauxslot_card_interface(); virtual UINT8 read_auxram(UINT16 offset) { printf("a2eauxslot: unhandled auxram read @ %04x\n", offset); return 0xff; } - virtual void write_auxram(UINT16 offset, UINT8 data) { printf("a2eauxslot: unhandled auxram write %02x @ %04x\n", data, offset); } + virtual void write_auxram(UINT16 offset, UINT8 data) { printf("a2eauxslot: unhandled auxram write %02x @ %04x\n", data, offset); } virtual void write_c07x(address_space &space, UINT8 offset, UINT8 data) {} virtual UINT8 *get_vram_ptr() = 0; virtual bool allow_dhr() { return true; } diff --git a/src/mess/machine/a2eext80col.c b/src/mess/machine/a2eext80col.c index e13057f8910..fa7df626aa3 100644 --- a/src/mess/machine/a2eext80col.c +++ b/src/mess/machine/a2eext80col.c @@ -67,4 +67,3 @@ UINT8 *a2eaux_ext80col_device::get_vram_ptr() { return &m_ram[0]; } - diff --git a/src/mess/machine/a2eext80col.h b/src/mess/machine/a2eext80col.h index 5fef744c60a..491e63b7040 100644 --- a/src/mess/machine/a2eext80col.h +++ b/src/mess/machine/a2eext80col.h @@ -42,4 +42,3 @@ private: extern const device_type A2EAUX_EXT80COL; #endif /* __A2EAUX_EXT80COL__ */ - diff --git a/src/mess/machine/a2eramworks3.c b/src/mess/machine/a2eramworks3.c index 04023bf7153..228050f4aba 100644 --- a/src/mess/machine/a2eramworks3.c +++ b/src/mess/machine/a2eramworks3.c @@ -3,7 +3,7 @@ a2eramworks3.c Applied Engineering RamWorks III - + *********************************************************************/ @@ -73,14 +73,14 @@ UINT8 *a2eaux_ramworks3_device::get_vram_ptr() /* These cards are split into 64k logical banks. - + On a RW3: Banks 00-0F is the first MB Banks 10-17 are the next 512K Banks 30-37 are the next 512K Banks 50-57 are the next 512K Banks 70-77 are the next 512K - + However, the software will recognize and correctly use a configuration in which all of banks 00-7F are populated for a total of 8 megabytes. So that's what we do. */ @@ -92,4 +92,3 @@ void a2eaux_ramworks3_device::write_c07x(address_space &space, UINT8 offset, UIN m_bank = 0x10000 * (data & 0x7f); } } - diff --git a/src/mess/machine/a2eramworks3.h b/src/mess/machine/a2eramworks3.h index ef5c0857743..82ab022b9cc 100644 --- a/src/mess/machine/a2eramworks3.h +++ b/src/mess/machine/a2eramworks3.h @@ -44,4 +44,3 @@ private: extern const device_type A2EAUX_RAMWORKS3; #endif /* __A2EAUX_RAMWORKS3__ */ - diff --git a/src/mess/machine/a2estd80col.c b/src/mess/machine/a2estd80col.c index 92b6d90b4e9..dd09fa332e6 100644 --- a/src/mess/machine/a2estd80col.c +++ b/src/mess/machine/a2estd80col.c @@ -75,4 +75,3 @@ UINT8 *a2eaux_std80col_device::get_vram_ptr() { return &m_ram[0]; } - diff --git a/src/mess/machine/a2estd80col.h b/src/mess/machine/a2estd80col.h index dbc7f1bfe96..0e718567a7d 100644 --- a/src/mess/machine/a2estd80col.h +++ b/src/mess/machine/a2estd80col.h @@ -32,7 +32,7 @@ protected: virtual UINT8 read_auxram(UINT16 offset); virtual void write_auxram(UINT16 offset, UINT8 data); virtual UINT8 *get_vram_ptr(); - virtual bool allow_dhr() { return false; } // we don't allow DHR + virtual bool allow_dhr() { return false; } // we don't allow DHR private: UINT8 m_ram[2*1024]; @@ -42,4 +42,3 @@ private: extern const device_type A2EAUX_STD80COL; #endif /* __A2EAUX_STD80COL__ */ - diff --git a/src/mess/machine/a2midi.c b/src/mess/machine/a2midi.c index 23980d6d914..aa4777e8c88 100644 --- a/src/mess/machine/a2midi.c +++ b/src/mess/machine/a2midi.c @@ -21,7 +21,7 @@ const device_type A2BUS_MIDI = &device_creator<a2bus_midi_device>; -#define MIDI_PTM_TAG "midi_ptm" +#define MIDI_PTM_TAG "midi_ptm" #define MIDI_ACIA_TAG "midi_acia" static struct ptm6840_interface ptm_interface = @@ -34,13 +34,13 @@ static struct ptm6840_interface ptm_interface = static struct acia6850_interface acia_interface = { - 31250*16, // tx clock - 0, // rx clock (we manually clock rx) - DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, a2bus_midi_device, rx_in), // rx in - DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, a2bus_midi_device, tx_out), // tx out - DEVCB_NULL, // cts in - DEVCB_NULL, // rts out - DEVCB_NULL, // dcd in + 31250*16, // tx clock + 0, // rx clock (we manually clock rx) + DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, a2bus_midi_device, rx_in), // rx in + DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, a2bus_midi_device, tx_out), // tx out + DEVCB_NULL, // cts in + DEVCB_NULL, // rts out + DEVCB_NULL, // dcd in DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, a2bus_midi_device, acia_irq_w) }; @@ -59,7 +59,7 @@ SLOT_INTERFACE_END static const serial_port_interface midiout_intf = { - DEVCB_NULL // midi out ports don't transmit inward + DEVCB_NULL // midi out ports don't transmit inward }; MACHINE_CONFIG_FRAGMENT( midi ) @@ -160,7 +160,7 @@ void a2bus_midi_device::write_c0nx(address_space &space, UINT8 offset, UINT8 dat // This works on h/w pretty much by accident; we'll make it right here. if ((data & 0x1c) == 0x10) { - data |= 0x04; // change wordbits from 0x10 to 0x14 + data |= 0x04; // change wordbits from 0x10 to 0x14 } m_acia->control_write(space, 0, data); @@ -202,7 +202,7 @@ WRITE_LINE_MEMBER( a2bus_midi_device::ptm_irq_w ) WRITE_LINE_MEMBER( a2bus_midi_device::midi_rx_w ) { m_rx_state = state; - for (int i = 0; i < 16; i++) // divider is set to 16 + for (int i = 0; i < 16; i++) // divider is set to 16 { m_acia->rx_clock_in(); } @@ -217,4 +217,3 @@ WRITE_LINE_MEMBER( a2bus_midi_device::tx_out ) { m_mdout->tx(state); } - diff --git a/src/mess/machine/a2ssc.c b/src/mess/machine/a2ssc.c index 9104e3c549e..71aec382106 100644 --- a/src/mess/machine/a2ssc.c +++ b/src/mess/machine/a2ssc.c @@ -230,4 +230,3 @@ WRITE_LINE_MEMBER( a2bus_ssc_device::acia_irq_w ) } } } - diff --git a/src/mess/machine/a2videoterm.c b/src/mess/machine/a2videoterm.c index ce4352d4cb3..5ff45fd745f 100644 --- a/src/mess/machine/a2videoterm.c +++ b/src/mess/machine/a2videoterm.c @@ -51,7 +51,7 @@ static MC6845_UPDATE_ROW( videoterm_update_row ); static MC6845_INTERFACE( mc6845_mda_intf ) { VIDEOTERM_SCREEN_NAME, /* screen number */ - false, /* show border area */ + false, /* show border area */ 8, /* number of pixels per video memory address */ NULL, /* begin_update */ videoterm_update_row, /* update_row */ diff --git a/src/mess/machine/a2vulcan.c b/src/mess/machine/a2vulcan.c index 5590525da7b..83ff2c4c4b3 100644 --- a/src/mess/machine/a2vulcan.c +++ b/src/mess/machine/a2vulcan.c @@ -1,54 +1,54 @@ /********************************************************************* - - a2vulcan.c - - Applied Engineering Vulcan IDE controller - - Our copy of ROM version 1.4 will refuse any drive > 40 megs (top 2 bytes of # blocks >= 0x15b). - Protection against field upgrades? - - Vulcan Gold ROMs omit this protection but don't work with the version of the partitioner program - we have. - - Recognized drives by IDE features parameters: - (# of cylinders is never checked, just heads, sectors, and the vendor specific at 0x0A) - - H S Vendor specific #5 - 8, 33 + 0x69 0x31d blocks (400K?!) - 2, 33 + 0x69 0xa208 blocks (20 megs, 21237760 bytes) - 4, 26 + 0x69 0x14500 blocks (40 megs, 42598400 bytes) - 5, 29 + (any) 0x25c5b blocks (80 megs, 79214080 bytes) (chs = 1067,5,29) - 7, 29 + 0x44 0x34e19 blocks (100 megs, 110899712 bytes) - 9, 29 + (any) 0x44068 blocks (140 megs, 142659584 bytes) (chs = 1068,9,29) - 9, 36 + 0x44 0x54888 blocks (180 megs, 177278976 bytes) - 9, 36 + 0xff 0x645a8 blocks (200 megs, 210456576 bytes) - 7, 34 + (any) 0x32252 blocks (100 megs, 105161728 bytes) (chs = 863,7,34) - 4, 17 + 0x55 0xa218 blocks (20 megs, 21245952 bytes) - 4, 26 + 0x55 0xa218 blocks (20 megs, 21245952 bytes) - 5, 17 + 0x55 0x15234 blocks (40 megs, 44328960 bytes) - 6, 26 + 0x55 0x15234 blocks (40 megs, 44328960 bytes) - 2, 28 + 0x36 0xa250 blocks (20 megs, 21274624 bytes) - 4, 28 + 0x36 0x143c0 blocks (40 megs, 42434450 bytes) - 4, 28 + 0x67 0x143c0 blocks (40 megs, 42434450 bytes) - 4, 27 + 0x43 0x147cc blocks (40 megs, 42964992 bytes) - 5, 17 + 0x26 0x13ec0 blocks (40 megs, 41779200 bytes) (chs = 960,5,17) - 15, 32 + 0x43 0x5f6e0 blocks (200 megs, 200130560 bytes) - 16, 38 + 0x94 0x6540c blocks (200 megs, 212342784 bytes) - 10, 17 + (any) 0x2792f blocks (80 megs, 82992640 bytes) (chs = 954,10,17) - - Partition block: - +0000: 0xAE 0xAE signature - +0002: bytesum of remaining 508 bytes of partition block - +0005: total # of blocks (3 bytes) - +000E: boot partition # (0 based) - +0100: partition records - - Partition record: - +02: partition number (seems to be only valud for non-CLEAR partitions) - +03: little-endian unsigned word: # of 512 byte blocks - +06: bit 6 set for ON, bits 0-2 = 0 CLEAR, 1 PRODOS, 2 DOS 3.3, 3 PASCAL, 4 CP/M - +07: Partition name (Apple high-ASCII, zero terminated unless full 10 chars) - + + a2vulcan.c + + Applied Engineering Vulcan IDE controller + + Our copy of ROM version 1.4 will refuse any drive > 40 megs (top 2 bytes of # blocks >= 0x15b). + Protection against field upgrades? + + Vulcan Gold ROMs omit this protection but don't work with the version of the partitioner program + we have. + + Recognized drives by IDE features parameters: + (# of cylinders is never checked, just heads, sectors, and the vendor specific at 0x0A) + + H S Vendor specific #5 + 8, 33 + 0x69 0x31d blocks (400K?!) + 2, 33 + 0x69 0xa208 blocks (20 megs, 21237760 bytes) + 4, 26 + 0x69 0x14500 blocks (40 megs, 42598400 bytes) + 5, 29 + (any) 0x25c5b blocks (80 megs, 79214080 bytes) (chs = 1067,5,29) + 7, 29 + 0x44 0x34e19 blocks (100 megs, 110899712 bytes) + 9, 29 + (any) 0x44068 blocks (140 megs, 142659584 bytes) (chs = 1068,9,29) + 9, 36 + 0x44 0x54888 blocks (180 megs, 177278976 bytes) + 9, 36 + 0xff 0x645a8 blocks (200 megs, 210456576 bytes) + 7, 34 + (any) 0x32252 blocks (100 megs, 105161728 bytes) (chs = 863,7,34) + 4, 17 + 0x55 0xa218 blocks (20 megs, 21245952 bytes) + 4, 26 + 0x55 0xa218 blocks (20 megs, 21245952 bytes) + 5, 17 + 0x55 0x15234 blocks (40 megs, 44328960 bytes) + 6, 26 + 0x55 0x15234 blocks (40 megs, 44328960 bytes) + 2, 28 + 0x36 0xa250 blocks (20 megs, 21274624 bytes) + 4, 28 + 0x36 0x143c0 blocks (40 megs, 42434450 bytes) + 4, 28 + 0x67 0x143c0 blocks (40 megs, 42434450 bytes) + 4, 27 + 0x43 0x147cc blocks (40 megs, 42964992 bytes) + 5, 17 + 0x26 0x13ec0 blocks (40 megs, 41779200 bytes) (chs = 960,5,17) + 15, 32 + 0x43 0x5f6e0 blocks (200 megs, 200130560 bytes) + 16, 38 + 0x94 0x6540c blocks (200 megs, 212342784 bytes) + 10, 17 + (any) 0x2792f blocks (80 megs, 82992640 bytes) (chs = 954,10,17) + + Partition block: + +0000: 0xAE 0xAE signature + +0002: bytesum of remaining 508 bytes of partition block + +0005: total # of blocks (3 bytes) + +000E: boot partition # (0 based) + +0100: partition records + + Partition record: + +02: partition number (seems to be only valud for non-CLEAR partitions) + +03: little-endian unsigned word: # of 512 byte blocks + +06: bit 6 set for ON, bits 0-2 = 0 CLEAR, 1 PRODOS, 2 DOS 3.3, 3 PASCAL, 4 CP/M + +07: Partition name (Apple high-ASCII, zero terminated unless full 10 chars) + *********************************************************************/ #include "a2vulcan.h" @@ -153,7 +153,7 @@ UINT8 a2bus_vulcanbase_device::read_c0nx(address_space &space, UINT8 offset) { case 0: m_lastdata = ide_controller_r(m_ide, 0x1f0+offset, 2); -// printf("IDE: read %04x\n", m_lastdata); +// printf("IDE: read %04x\n", m_lastdata); m_last_read_was_0 = true; return m_lastdata&0xff; @@ -178,7 +178,7 @@ UINT8 a2bus_vulcanbase_device::read_c0nx(address_space &space, UINT8 offset) return ide_controller_r(m_ide, 0x1f0+offset, 1); default: -// printf("Read @ C0n%x\n", offset); +// printf("Read @ C0n%x\n", offset); break; } @@ -195,18 +195,18 @@ void a2bus_vulcanbase_device::write_c0nx(address_space &space, UINT8 offset, UIN { switch (offset) { - case 0: + case 0: m_lastdata = data; m_last_read_was_0 = true; break; - + case 1: if (m_last_read_was_0) { m_last_read_was_0 = false; m_lastdata &= 0x00ff; m_lastdata |= (data << 8); -// printf("IDE: write %04x\n", m_lastdata); +// printf("IDE: write %04x\n", m_lastdata); ide_controller_w(m_ide, 0x1f0, 2, m_lastdata); } else @@ -221,17 +221,17 @@ void a2bus_vulcanbase_device::write_c0nx(address_space &space, UINT8 offset, UIN case 5: case 6: case 7: -// printf("%02x to IDE controller @ %x\n", data, offset); +// printf("%02x to IDE controller @ %x\n", data, offset); ide_controller_w(m_ide, 0x1f0+offset, 1, data); break; - case 9: // ROM bank -// printf("%x (%x) to ROM bank\n", data, (data & 0xf) * 0x400); + case 9: // ROM bank +// printf("%x (%x) to ROM bank\n", data, (data & 0xf) * 0x400); m_rombank = (data & 0xf) * 0x400; break; case 0xa: // RAM bank -// printf("%x to RAM bank\n", data); +// printf("%x to RAM bank\n", data); m_rambank = (data & 7) * 0x400; break; @@ -260,9 +260,9 @@ UINT8 a2bus_vulcanbase_device::read_cnxx(address_space &space, UINT8 offset) UINT8 a2bus_vulcanbase_device::read_c800(address_space &space, UINT16 offset) { offset &= 0x7ff; - if (offset < 0x400) // c800-cbff is banked RAM window, cc00-cfff is banked ROM window + if (offset < 0x400) // c800-cbff is banked RAM window, cc00-cfff is banked ROM window { -// printf("read RAM @ %x (bank %x)\n", offset, m_rambank); +// printf("read RAM @ %x (bank %x)\n", offset, m_rambank); return m_ram[offset + m_rambank]; } @@ -275,7 +275,7 @@ void a2bus_vulcanbase_device::write_c800(address_space &space, UINT16 offset, UI offset &= 0x7ff; if (offset < 0x400) { -// printf("%02x to RAM @ %x (bank %x)\n", data, offset, m_rambank); +// printf("%02x to RAM @ %x (bank %x)\n", data, offset, m_rambank); m_ram[offset + m_rambank] = data; } } diff --git a/src/mess/machine/amstrad.c b/src/mess/machine/amstrad.c index 226a7bc020f..613b33755af 100644 --- a/src/mess/machine/amstrad.c +++ b/src/mess/machine/amstrad.c @@ -1072,7 +1072,7 @@ UINT32 amstrad_state::screen_update_amstrad(screen_device &screen, bitmap_ind16 MC6845_INTERFACE( amstrad_mc6845_intf ) { NULL, /* screen name */ - false, /* show border area */ + false, /* show border area */ 16, /* number of pixels per video memory address */ NULL, /* begin_update */ NULL, /* update_row */ @@ -1088,7 +1088,7 @@ MC6845_INTERFACE( amstrad_mc6845_intf ) MC6845_INTERFACE( amstrad_plus_mc6845_intf ) { NULL, /* screen name */ - false, /* show border area */ + false, /* show border area */ 16, /* number of pixels per video memory address */ NULL, /* begin_update */ NULL, /* update_row */ diff --git a/src/mess/machine/apollo.c b/src/mess/machine/apollo.c index 157e0ad1236..fceec7fc7b1 100644 --- a/src/mess/machine/apollo.c +++ b/src/mess/machine/apollo.c @@ -675,7 +675,7 @@ static void apollo_pic_set_irq_line(device_t *device, int irq, int state) { } } -IRQ_CALLBACK_MEMBER(apollo_state::apollo_pic_acknowledge) +IRQ_CALLBACK_MEMBER(apollo_state::apollo_pic_acknowledge) { UINT32 vector = pic8259_acknowledge(get_pic8259_master(&device)); if ((vector & 0x0f) == APOLLO_IRQ_PIC_SLAVE) { diff --git a/src/mess/machine/apple2.c b/src/mess/machine/apple2.c index 33d96d120cc..4e02a320424 100644 --- a/src/mess/machine/apple2.c +++ b/src/mess/machine/apple2.c @@ -736,7 +736,7 @@ static void apple2_mem_2000(running_machine &machine, offs_t begin, offs_t end, static void apple2_mem_4000(running_machine &machine, offs_t begin, offs_t end, apple2_meminfo *meminfo) { apple2_state *state = machine.driver_data<apple2_state>(); - meminfo->read_handler = (state->m_flags & VAR_RAMRD) ? &state->read_delegates_4000[0] : &state->read_delegates_4000[1]; + meminfo->read_handler = (state->m_flags & VAR_RAMRD) ? &state->read_delegates_4000[0] : &state->read_delegates_4000[1]; meminfo->write_handler = (state->m_flags & VAR_RAMWRT) ? &state->write_delegates_4000[0] : &state->write_delegates_4000[1]; } @@ -911,7 +911,7 @@ static void apple2_mem_E000(running_machine &machine, offs_t begin, offs_t end, if (state->m_flags & VAR_LCWRITE) { - meminfo->write_handler = (state->m_flags & VAR_ALTZP) ? &state->write_delegates_e000[0] : &state->write_delegates_e000[1]; + meminfo->write_handler = (state->m_flags & VAR_ALTZP) ? &state->write_delegates_e000[0] : &state->write_delegates_e000[1]; } else { diff --git a/src/mess/machine/apple2gs.c b/src/mess/machine/apple2gs.c index 4aaa86e1f14..b72657df22c 100644 --- a/src/mess/machine/apple2gs.c +++ b/src/mess/machine/apple2gs.c @@ -513,7 +513,7 @@ static void adb_write_datareg(running_machine &machine, UINT8 data) state->m_adb_command_length = 0; state->m_adb_command_pos = 0; -// printf("ADB command %02x\n", data); +// printf("ADB command %02x\n", data); switch(data) { case 0x00: /* ??? */ @@ -536,9 +536,9 @@ static void adb_write_datareg(running_machine &machine, UINT8 data) case 0x07: /* synchronize */ if (state->m_is_rom3) - state->m_adb_command_length = 8; // ROM 3 has 8 bytes: mode byte, 3 config bytes, kbd/mouse params, disk eject options + state->m_adb_command_length = 8; // ROM 3 has 8 bytes: mode byte, 3 config bytes, kbd/mouse params, disk eject options else - state->m_adb_command_length = 4; // ROM 0/1 has 4 bytes sync + state->m_adb_command_length = 4; // ROM 0/1 has 4 bytes sync break; case 0x08: /* write memory */ @@ -604,7 +604,7 @@ static void adb_write_datareg(running_machine &machine, UINT8 data) case ADBSTATE_INCOMMAND: assert(state->m_adb_command_pos < ARRAY_LENGTH(state->m_adb_command_bytes)); -// printf("ADB param %02x\n", data); +// printf("ADB param %02x\n", data); state->m_adb_command_bytes[state->m_adb_command_pos++] = data; break; @@ -907,18 +907,18 @@ static int apple2gs_get_vpos(running_machine &machine) READ8_MEMBER( apple2gs_state::apple2gs_c0xx_r ) { - UINT8 result; - scc8530_t *scc; + UINT8 result; + scc8530_t *scc; - if(space.debugger_access()) - { - return 0; - } + if(space.debugger_access()) + { + return 0; + } - offset &= 0xFF; + offset &= 0xFF; - switch(offset) - { + switch(offset) + { #if RUN_ADB_MICRO case 0x00: /* C000 - KEYDATA */ result = keyglu_816_read(GLU_C000); @@ -942,7 +942,7 @@ READ8_MEMBER( apple2gs_state::apple2gs_c0xx_r ) break; case 0x24: /* C024 - MOUSEDATA */ - #if RUN_ADB_MICRO + #if RUN_ADB_MICRO result = keyglu_816_read(GLU_MOUSEX); #else result = adb_read_mousedata(space.machine()); @@ -950,7 +950,7 @@ READ8_MEMBER( apple2gs_state::apple2gs_c0xx_r ) break; case 0x25: /* C025 - KEYMODREG */ - #if RUN_ADB_MICRO + #if RUN_ADB_MICRO result = keyglu_816_read(GLU_KEYMOD); #else result = AY3600_keymod_r(space.machine()); @@ -958,7 +958,7 @@ READ8_MEMBER( apple2gs_state::apple2gs_c0xx_r ) break; case 0x26: /* C026 - DATAREG */ - #if RUN_ADB_MICRO + #if RUN_ADB_MICRO result = keyglu_816_read(GLU_DATA); #else result = adb_read_datareg(); @@ -966,7 +966,7 @@ READ8_MEMBER( apple2gs_state::apple2gs_c0xx_r ) break; case 0x27: /* C027 - KMSTATUS */ - #if RUN_ADB_MICRO + #if RUN_ADB_MICRO result = keyglu_816_read(GLU_SYSSTAT); #else result = adb_read_kmstatus(); @@ -1093,10 +1093,10 @@ READ8_MEMBER( apple2gs_state::apple2gs_c0xx_r ) break; } - if (LOG_C0XX) - logerror("apple2gs_c0xx_r(): offset=0x%02x result=0x%02x\n", offset, result); + if (LOG_C0XX) + logerror("apple2gs_c0xx_r(): offset=0x%02x result=0x%02x\n", offset, result); - return result; + return result; } @@ -1228,14 +1228,14 @@ WRITE8_MEMBER( apple2gs_state::apple2gs_c0xx_w ) case 0x68: /* C068 - STATEREG */ apple2_setvar(space.machine(), - ((data & 0x80) ? VAR_ALTZP : 0) | - ((data & 0x40) ? VAR_PAGE2 : 0) | - ((data & 0x20) ? VAR_RAMRD : 0) | - ((data & 0x10) ? VAR_RAMWRT : 0) | - ((data & 0x08) ? 0 : VAR_LCRAM) | - ((data & 0x04) ? VAR_LCRAM2 : 0) | - ((data & 0x01) ? VAR_INTCXROM : 0), - VAR_ALTZP | VAR_PAGE2 | VAR_RAMRD | VAR_RAMWRT | VAR_LCRAM | VAR_LCRAM2 | VAR_INTCXROM); + ((data & 0x80) ? VAR_ALTZP : 0) | + ((data & 0x40) ? VAR_PAGE2 : 0) | + ((data & 0x20) ? VAR_RAMRD : 0) | + ((data & 0x10) ? VAR_RAMWRT : 0) | + ((data & 0x08) ? 0 : VAR_LCRAM) | + ((data & 0x04) ? VAR_LCRAM2 : 0) | + ((data & 0x01) ? VAR_INTCXROM : 0), + VAR_ALTZP | VAR_PAGE2 | VAR_RAMRD | VAR_RAMWRT | VAR_LCRAM | VAR_LCRAM2 | VAR_INTCXROM); break; // slot 6 registers should go to applefdc if slot 6 not "Your Card" @@ -1261,7 +1261,7 @@ WRITE8_MEMBER( apple2gs_state::apple2gs_c0xx_w ) apple2_c080_w(space, offset, data, 0); } break; - } + } } @@ -2104,7 +2104,7 @@ void apple2gs_state::keyglu_mcu_write(UINT8 offset, UINT8 data) case GLU_MOUSEX: case GLU_MOUSEY: m_glu_regs[GLU_KG_STATUS] |= KGS_MOUSEX_FULL; - m_glu_mouse_read_stat = false; // signal next read will be mouse X + m_glu_mouse_read_stat = false; // signal next read will be mouse X break; case GLU_ANY_KEY_DOWN: @@ -2121,120 +2121,120 @@ void apple2gs_state::keyglu_mcu_write(UINT8 offset, UINT8 data) /* Keym_glu registers map as follows on the 816: - + C000 = key data + any key down, clears strobe C010 = clears keystrobe - + C024 MOUSEDATA = reads GLU mouseX and mouseY C025 KEYMODREG = reads GLU keymod register C026 DATAREG = writes from the 816 go to COMMAND, reads from DATA C027 KMSTATUS = GLU system status register - + */ UINT8 apple2gs_state::keyglu_816_read(UINT8 offset) { - switch (offset) - { - case GLU_C000: - { - UINT8 rv; - rv = m_glu_regs[GLU_KEY_DATA] & 0x7f; - if (m_glu_regs[GLU_KG_STATUS] & KGS_KEYSTROBE) - { - rv |= 0x80; - } - return rv; - } - break; - - case GLU_C010: - { - UINT8 rv; - rv = m_glu_regs[GLU_KEY_DATA] & 0x7f; - if (m_glu_regs[GLU_KG_STATUS] & KGS_KEYSTROBE) - { - rv |= 0x80; - } - m_glu_regs[GLU_KG_STATUS] &= ~KGS_KEYSTROBE; - return rv; - } - break; - - case GLU_MOUSEX: - case GLU_MOUSEY: - if (!m_glu_mouse_read_stat) - { - m_glu_mouse_read_stat = 1; - return m_glu_regs[GLU_MOUSEY]; - } - return m_glu_regs[GLU_MOUSEX]; - - case GLU_SYSSTAT: - // regenerate sysstat bits - m_glu_sysstat &= ~0xab; // mask off read/write bits - if (m_glu_regs[GLU_KG_STATUS] & KGS_COMMAND_FULL) - { - m_glu_sysstat |= 1; - } - if (m_glu_regs[GLU_KG_STATUS] & m_glu_mouse_read_stat) - { - m_glu_sysstat |= 2; - } - if (m_glu_regs[GLU_KG_STATUS] & KGS_KEYSTROBE) - { - m_glu_sysstat |= 8; - } - if (m_glu_regs[GLU_KG_STATUS] & KGS_DATA_FULL) - { - m_glu_sysstat |= 0x20; - } - if (m_glu_regs[GLU_KG_STATUS] & KGS_MOUSEX_FULL) - { - m_glu_sysstat |= 0x80; - } - m_glu_816_read_dstat = true; -// printf("816 gets %02x in sysstat (data avail %02x)\n", m_glu_sysstat, m_glu_sysstat & 0x20); - return m_glu_sysstat; - - case GLU_DATA: - if (m_glu_816_read_dstat) - { - m_glu_816_read_dstat = false; - m_glu_regs[GLU_KG_STATUS] &= ~KGS_DATA_FULL; - printf("816 reads %02x from DATA\n", m_glu_regs[GLU_DATA]); - } - return m_glu_regs[GLU_DATA]; - - default: - return m_glu_regs[offset]; - break; - } - - return 0xff; + switch (offset) + { + case GLU_C000: + { + UINT8 rv; + rv = m_glu_regs[GLU_KEY_DATA] & 0x7f; + if (m_glu_regs[GLU_KG_STATUS] & KGS_KEYSTROBE) + { + rv |= 0x80; + } + return rv; + } + break; + + case GLU_C010: + { + UINT8 rv; + rv = m_glu_regs[GLU_KEY_DATA] & 0x7f; + if (m_glu_regs[GLU_KG_STATUS] & KGS_KEYSTROBE) + { + rv |= 0x80; + } + m_glu_regs[GLU_KG_STATUS] &= ~KGS_KEYSTROBE; + return rv; + } + break; + + case GLU_MOUSEX: + case GLU_MOUSEY: + if (!m_glu_mouse_read_stat) + { + m_glu_mouse_read_stat = 1; + return m_glu_regs[GLU_MOUSEY]; + } + return m_glu_regs[GLU_MOUSEX]; + + case GLU_SYSSTAT: + // regenerate sysstat bits + m_glu_sysstat &= ~0xab; // mask off read/write bits + if (m_glu_regs[GLU_KG_STATUS] & KGS_COMMAND_FULL) + { + m_glu_sysstat |= 1; + } + if (m_glu_regs[GLU_KG_STATUS] & m_glu_mouse_read_stat) + { + m_glu_sysstat |= 2; + } + if (m_glu_regs[GLU_KG_STATUS] & KGS_KEYSTROBE) + { + m_glu_sysstat |= 8; + } + if (m_glu_regs[GLU_KG_STATUS] & KGS_DATA_FULL) + { + m_glu_sysstat |= 0x20; + } + if (m_glu_regs[GLU_KG_STATUS] & KGS_MOUSEX_FULL) + { + m_glu_sysstat |= 0x80; + } + m_glu_816_read_dstat = true; +// printf("816 gets %02x in sysstat (data avail %02x)\n", m_glu_sysstat, m_glu_sysstat & 0x20); + return m_glu_sysstat; + + case GLU_DATA: + if (m_glu_816_read_dstat) + { + m_glu_816_read_dstat = false; + m_glu_regs[GLU_KG_STATUS] &= ~KGS_DATA_FULL; + printf("816 reads %02x from DATA\n", m_glu_regs[GLU_DATA]); + } + return m_glu_regs[GLU_DATA]; + + default: + return m_glu_regs[offset]; + break; + } + + return 0xff; } void apple2gs_state::keyglu_816_write(UINT8 offset, UINT8 data) { - if (offset < GLU_C000) - { - m_glu_regs[offset&7] = data; - } - - switch (offset) - { - case GLU_C010: - m_glu_regs[GLU_KG_STATUS] &= ~KGS_KEYSTROBE; - break; - - case GLU_COMMAND: - printf("816 sets COMMAND to %02x (raise command full)\n", data); - m_glu_regs[GLU_KG_STATUS] |= KGS_COMMAND_FULL; - break; - - case GLU_SYSSTAT: - m_glu_sysstat &= 0xab; // clear the non-read-only fields - m_glu_sysstat |= (data & ~0xab); - break; - } + if (offset < GLU_C000) + { + m_glu_regs[offset&7] = data; + } + + switch (offset) + { + case GLU_C010: + m_glu_regs[GLU_KG_STATUS] &= ~KGS_KEYSTROBE; + break; + + case GLU_COMMAND: + printf("816 sets COMMAND to %02x (raise command full)\n", data); + m_glu_regs[GLU_KG_STATUS] |= KGS_COMMAND_FULL; + break; + + case GLU_SYSSTAT: + m_glu_sysstat &= 0xab; // clear the non-read-only fields + m_glu_sysstat |= (data & ~0xab); + break; + } } #endif diff --git a/src/mess/machine/ataricrt.c b/src/mess/machine/ataricrt.c index f151100f767..a7f3bee0e8d 100644 --- a/src/mess/machine/ataricrt.c +++ b/src/mess/machine/ataricrt.c @@ -54,5 +54,3 @@ static READ8_HANDLER( bbsb_bankh_r ) return &mem[0x4000 + bbsb_bankh * 0x1000]; } #endif - - diff --git a/src/mess/machine/ay3600.c b/src/mess/machine/ay3600.c index 24eab6de999..77451c6537d 100644 --- a/src/mess/machine/ay3600.c +++ b/src/mess/machine/ay3600.c @@ -356,8 +356,8 @@ static TIMER_CALLBACK(AY3600_poll) int caps_lock = 0; int curkey; int curkey_unmodified; - ioport_port *portnames[] = { state->m_kb0, state->m_kb1, state->m_kb2, state->m_kb3, state->m_kb4, state->m_kb5, state->m_kb6, - state->m_kpad1, state->m_kpad2 }; + ioport_port *portnames[] = { state->m_kb0, state->m_kb1, state->m_kb2, state->m_kb3, state->m_kb4, state->m_kb5, state->m_kb6, + state->m_kpad1, state->m_kpad2 }; /* check for these special cases because they affect the emulated key codes */ diff --git a/src/mess/machine/c1581.c b/src/mess/machine/c1581.c index 6c313f6c585..ee639e9bb58 100644 --- a/src/mess/machine/c1581.c +++ b/src/mess/machine/c1581.c @@ -11,8 +11,8 @@ TODO: - - drive not ready if ready_r() is connected to CIA - - format fails (seeks to directory track and reports BAD DISK error) + - drive not ready if ready_r() is connected to CIA + - format fails (seeks to directory track and reports BAD DISK error) - save fails (no error message, but no file added to directory either) */ diff --git a/src/mess/machine/c64_fcc.c b/src/mess/machine/c64_fcc.c index 4b5d0be5733..59b954b5394 100644 --- a/src/mess/machine/c64_fcc.c +++ b/src/mess/machine/c64_fcc.c @@ -9,16 +9,16 @@ /* - TODO: + TODO: - 629D ldx #$00 - 629F stx $0e - 62A1 sta $df00 - 62A4 inc $d020 - 62A7 dec $d020 - 62AA cpx $0e - 62AC beq $62a4 <-- eternal loop here - 62AE rts + 629D ldx #$00 + 629F stx $0e + 62A1 sta $df00 + 62A4 inc $d020 + 62A7 dec $d020 + 62AA cpx $0e + 62AC beq $62a4 <-- eternal loop here + 62AE rts */ @@ -205,38 +205,38 @@ void c64_final_chesscard_device::c64_cd_w(address_space &space, offs_t offset, U else if (!io1) { /* - + bit description - + 0 ? - 1 - 2 - 3 - 4 - 5 - 6 - 7 - + 1 + 2 + 3 + 4 + 5 + 6 + 7 + */ printf("IO1 %04x %02x\n", offset, data); m_bank = BIT(data, 0); } - else if (!io2) + else if (!io2) { /* - + bit description - + 0 ? - 1 - 2 - 3 - 4 - 5 - 6 + 1 + 2 + 3 + 4 + 5 + 6 7 ? - + */ printf("IO2 %04x %02x\n", offset, data); diff --git a/src/mess/machine/c64_magic_voice.c b/src/mess/machine/c64_magic_voice.c index b8629be4f5a..0a21852a7c3 100644 --- a/src/mess/machine/c64_magic_voice.c +++ b/src/mess/machine/c64_magic_voice.c @@ -15,8 +15,8 @@ // MACROS / CONSTANTS //************************************************************************** -#define T6721A_TAG "u5" -#define MOS6525_TAG "u2" +#define T6721A_TAG "u5" +#define MOS6525_TAG "u2" diff --git a/src/mess/machine/c64_magic_voice.h b/src/mess/machine/c64_magic_voice.h index 03bfaf44e84..6eb2d1a4d46 100644 --- a/src/mess/machine/c64_magic_voice.h +++ b/src/mess/machine/c64_magic_voice.h @@ -27,7 +27,7 @@ // ======================> c64_magic_voice_cartridge_device class c64_magic_voice_cartridge_device : public device_t, - public device_c64_expansion_card_interface + public device_c64_expansion_card_interface { public: // construction/destruction diff --git a/src/mess/machine/c64_sw8k.c b/src/mess/machine/c64_sw8k.c index ed1e2c893a5..0f554f3e93f 100644 --- a/src/mess/machine/c64_sw8k.c +++ b/src/mess/machine/c64_sw8k.c @@ -75,7 +75,7 @@ ioport_constructor c64_switchable_8k_cartridge_device::device_input_ports() cons c64_switchable_8k_cartridge_device::c64_switchable_8k_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, C64_SW8K, "C64 Switchable 8K cartridge", tag, owner, clock), device_c64_expansion_card_interface(mconfig, *this), - m_sw(*this, "SW") + m_sw(*this, "SW") { } diff --git a/src/mess/machine/c64_sw8k.h b/src/mess/machine/c64_sw8k.h index 9ccb75b36be..86bb4c98fdb 100644 --- a/src/mess/machine/c64_sw8k.h +++ b/src/mess/machine/c64_sw8k.h @@ -45,7 +45,7 @@ protected: private: required_ioport m_sw; - + int m_bank; }; diff --git a/src/mess/machine/c64_swiftlink.c b/src/mess/machine/c64_swiftlink.c index 3c79e213bed..536181f1fd4 100644 --- a/src/mess/machine/c64_swiftlink.c +++ b/src/mess/machine/c64_swiftlink.c @@ -9,7 +9,7 @@ /* - http://mclauchlan.site.net.au/scott/C=Hacking/C-Hacking10/C-Hacking10-swiftlink.html + http://mclauchlan.site.net.au/scott/C=Hacking/C-Hacking10/C-Hacking10-swiftlink.html */ @@ -21,8 +21,8 @@ // MACROS/CONSTANTS //************************************************************************** -#define MOS6551_TAG "mos6551" -#define RS232_TAG "rs232" +#define MOS6551_TAG "mos6551" +#define RS232_TAG "rs232" diff --git a/src/mess/machine/c64_turbo232.c b/src/mess/machine/c64_turbo232.c index 85d9488d7ca..6b8e9fd2c60 100644 --- a/src/mess/machine/c64_turbo232.c +++ b/src/mess/machine/c64_turbo232.c @@ -9,7 +9,7 @@ /* - http://ar.c64.org/wiki/Turbo232_Programming.txt + http://ar.c64.org/wiki/Turbo232_Programming.txt */ @@ -21,8 +21,8 @@ // MACROS/CONSTANTS //************************************************************************** -#define MOS6551_TAG "mos6551" -#define RS232_TAG "rs232" +#define MOS6551_TAG "mos6551" +#define RS232_TAG "rs232" diff --git a/src/mess/machine/c64_vizastar.c b/src/mess/machine/c64_vizastar.c index b90eeb81db1..947b5db9cc1 100644 --- a/src/mess/machine/c64_vizastar.c +++ b/src/mess/machine/c64_vizastar.c @@ -11,7 +11,7 @@ PCB Layout ---------- - RB84 (C) MICROPORT + RB84 (C) MICROPORT |===========================| |=| | |=| | diff --git a/src/mess/machine/comxpl80.h b/src/mess/machine/comxpl80.h index e4e4ff1eaf1..ed828887dd9 100644 --- a/src/mess/machine/comxpl80.h +++ b/src/mess/machine/comxpl80.h @@ -52,7 +52,7 @@ private: required_memory_region m_plotter; required_ioport m_font; required_ioport m_sw; - + // PL-80 plotter state UINT16 m_font_addr; // font ROM pack address latch UINT8 m_x_motor_phase; // X motor phase diff --git a/src/mess/machine/ecb_grip.c b/src/mess/machine/ecb_grip.c index 7a8e9a5280f..5486ab26f09 100644 --- a/src/mess/machine/ecb_grip.c +++ b/src/mess/machine/ecb_grip.c @@ -301,7 +301,7 @@ static MC6845_INTERFACE( crtc_intf ) static MC6845_INTERFACE( grip5_crtc_intf ) { SCREEN_TAG, - false, + false, 8, NULL, grip5_update_row, diff --git a/src/mess/machine/gb.c b/src/mess/machine/gb.c index 2160cacaa53..60f97ddfb6e 100644 --- a/src/mess/machine/gb.c +++ b/src/mess/machine/gb.c @@ -1057,7 +1057,7 @@ MACHINE_RESET_MEMBER(megaduck_state,megaduck) { /* We may have to add some more stuff here, if not then it can be merged back into gb */ gb_init(); - + m_bios_disable = TRUE; gb_video_reset( GB_VIDEO_DMG ); @@ -1168,4 +1168,3 @@ READ8_MEMBER(megaduck_state::megaduck_sound_r2) { return gb_sound_r(machine().device("custom"), space, 0x10 + megaduck_sound_offsets[offset]); } - diff --git a/src/mess/machine/gb_mbc.c b/src/mess/machine/gb_mbc.c index 1ffd2808774..c643e118699 100644 --- a/src/mess/machine/gb_mbc.c +++ b/src/mess/machine/gb_mbc.c @@ -1,8 +1,8 @@ /*********************************************************************************************************** - + Game Boy carts with MBC (Memory Bank Controller) - - + + TODO: add proper RTC and Rumble support ***********************************************************************************************************/ @@ -94,7 +94,7 @@ void gb_rom_mbc1_device::device_start() { has_timer = FALSE; has_rumble = FALSE; - + m_latch_bank = 0; m_latch_bank2 = 1; m_ram_bank = 0; @@ -111,7 +111,7 @@ void gb_rom_mbc1k_device::device_start() { has_timer = FALSE; has_rumble = FALSE; - + m_latch_bank = 0; m_latch_bank2 = 1; m_ram_bank = 0; @@ -128,7 +128,7 @@ void gb_rom_mbc2_device::device_start() { has_timer = FALSE; has_rumble = FALSE; - + m_latch_bank = 0; m_latch_bank2 = 1; m_ram_bank = 0; @@ -164,7 +164,7 @@ void gb_rom_mbc5_device::device_start() { has_timer = FALSE; has_rumble = FALSE; - + m_latch_bank = 0; m_latch_bank2 = 1; m_ram_bank = 0; @@ -181,14 +181,14 @@ void gb_rom_mbc6_device::device_start() { has_timer = FALSE; has_rumble = FALSE; - - m_bank_4000 = 2; // correct default? - m_bank_6000 = 3; // correct default? - m_latch1 = 0; // correct default? - m_latch2 = 0; // correct default? - - m_latch_bank = 2; // correct default? - m_latch_bank2 = 3; // correct default? + + m_bank_4000 = 2; // correct default? + m_bank_6000 = 3; // correct default? + m_latch1 = 0; // correct default? + m_latch2 = 0; // correct default? + + m_latch_bank = 2; // correct default? + m_latch_bank2 = 3; // correct default? m_ram_bank = 0; m_ram_enable = 0; m_mode = 0; @@ -208,7 +208,7 @@ void gb_rom_mbc7_device::device_start() { has_timer = FALSE; has_rumble = TRUE; - + m_latch_bank = 0; m_latch_bank2 = 1; m_ram_bank = 0; @@ -223,7 +223,7 @@ void gb_rom_mmm01_device::device_start() { has_timer = FALSE; has_rumble = TRUE; - + m_latch_bank = 0x200 - 2; m_latch_bank2 = 0x200 - 1; m_ram_bank = 0; @@ -285,7 +285,7 @@ WRITE8_MEMBER(gb_rom_mbc1_device::write_bank) // bank = 0 => bank = 1 if (data == 0) data = 1; - + m_latch_bank2 = (m_latch_bank2 & 0x01e0) | data; } else if (offset < 0x6000) @@ -340,7 +340,7 @@ WRITE8_MEMBER(gb_rom_mbc1k_device::write_bank) // bank = 0 => bank = 1 if (data == 0) data = 1; - + m_latch_bank2 = (m_latch_bank2 & 0x01f0) | data; } else if (offset < 0x6000) @@ -390,13 +390,13 @@ WRITE8_MEMBER(gb_rom_mbc2_device::write_bank) if (offset < 0x2000) m_ram_enable = ((data & 0x0f) == 0x0a) ? 1 : 0; else if (offset < 0x4000) - { + { // 4bits only data &= 0x0f; // bank = 0 => bank = 1 if (data == 0) data = 1; - + // The least significant bit of the upper address byte must be 1 if (offset & 0x0100) m_latch_bank2 = (m_latch_bank2 & 0x100) | data; @@ -440,7 +440,7 @@ WRITE8_MEMBER(gb_rom_mbc3_device::write_bank) /* Selecting bank 0 == selecting bank 1 */ if (data == 0) data = 1; - + m_latch_bank2 = data; } else if (offset < 0x6000) @@ -464,14 +464,14 @@ WRITE8_MEMBER(gb_rom_mbc3_device::write_bank) READ8_MEMBER(gb_rom_mbc3_device::read_ram) { if (m_ram_bank < 4 && m_ram_enable) - { // RAM + { // RAM if (m_ram) - return m_ram[ram_bank_map[m_ram_bank] * 0x2000 + (offset & 0x1fff)]; + return m_ram[ram_bank_map[m_ram_bank] * 0x2000 + (offset & 0x1fff)]; } if (m_ram_bank >= 0x8 && m_ram_bank <= 0xc) - { // RAM + { // RAM if (has_timer) - return m_rtc_map[m_ram_bank - 8]; + return m_rtc_map[m_ram_bank - 8]; } return 0xff; } @@ -479,12 +479,12 @@ READ8_MEMBER(gb_rom_mbc3_device::read_ram) WRITE8_MEMBER(gb_rom_mbc3_device::write_ram) { if (m_ram_bank < 4 && m_ram_enable) - { // RAM + { // RAM if (m_ram) m_ram[ram_bank_map[m_ram_bank] * 0x2000 + (offset & 0x1fff)] = data; } if (m_ram_bank >= 0x8 && m_ram_bank <= 0xc) - { // RAM + { // RAM if (has_timer) { // what to do here? @@ -689,4 +689,3 @@ WRITE8_MEMBER(gb_rom_mmm01_device::write_bank) } } } - diff --git a/src/mess/machine/gb_mbc.h b/src/mess/machine/gb_mbc.h index faa5b5640d4..c29c558495f 100644 --- a/src/mess/machine/gb_mbc.h +++ b/src/mess/machine/gb_mbc.h @@ -7,12 +7,12 @@ // ======================> gb_rom_mbc_device class gb_rom_mbc_device : public device_t, - public device_gb_cart_interface + public device_gb_cart_interface { public: // construction/destruction gb_rom_mbc_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_config_complete() { m_shortname = "gb_rom_mbc_base"; } @@ -21,7 +21,7 @@ public: virtual DECLARE_READ8_MEMBER(read_rom); virtual DECLARE_READ8_MEMBER(read_ram); virtual DECLARE_WRITE8_MEMBER(write_ram); - + UINT8 m_ram_enable; UINT8 m_mode; }; @@ -33,7 +33,7 @@ class gb_rom_mbc1_device : public gb_rom_mbc_device public: // construction/destruction gb_rom_mbc1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_config_complete() { m_shortname = "gb_rom_mbc1"; } @@ -51,11 +51,11 @@ class gb_rom_mbc1k_device : public gb_rom_mbc_device public: // construction/destruction gb_rom_mbc1k_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_config_complete() { m_shortname = "gb_rom_mbc1k"; } - + virtual DECLARE_READ8_MEMBER(read_rom); virtual DECLARE_WRITE8_MEMBER(write_bank); virtual DECLARE_READ8_MEMBER(read_ram); @@ -69,11 +69,11 @@ class gb_rom_mbc2_device : public gb_rom_mbc_device public: // construction/destruction gb_rom_mbc2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_config_complete() { m_shortname = "gb_rom_mbc2"; } - + virtual DECLARE_READ8_MEMBER(read_rom); virtual DECLARE_WRITE8_MEMBER(write_bank); virtual DECLARE_READ8_MEMBER(read_ram); @@ -87,11 +87,11 @@ class gb_rom_mbc3_device : public gb_rom_mbc_device public: // construction/destruction gb_rom_mbc3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_config_complete() { m_shortname = "gb_rom_mbc3"; } - + virtual DECLARE_READ8_MEMBER(read_rom); virtual DECLARE_WRITE8_MEMBER(write_bank); virtual DECLARE_READ8_MEMBER(read_ram); @@ -106,11 +106,11 @@ class gb_rom_mbc5_device : public gb_rom_mbc_device public: // construction/destruction gb_rom_mbc5_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_config_complete() { m_shortname = "gb_rom_mbc5"; } - + virtual DECLARE_READ8_MEMBER(read_rom); virtual DECLARE_WRITE8_MEMBER(write_bank); virtual DECLARE_READ8_MEMBER(read_ram); @@ -124,11 +124,11 @@ class gb_rom_mbc6_device : public gb_rom_mbc_device public: // construction/destruction gb_rom_mbc6_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_config_complete() { m_shortname = "gb_rom_mbc6"; } - + virtual DECLARE_READ8_MEMBER(read_rom); virtual DECLARE_WRITE8_MEMBER(write_bank); virtual DECLARE_READ8_MEMBER(read_ram); @@ -144,11 +144,11 @@ class gb_rom_mbc7_device : public gb_rom_mbc_device public: // construction/destruction gb_rom_mbc7_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_config_complete() { m_shortname = "gb_rom_mbc7"; } - + virtual DECLARE_READ8_MEMBER(read_rom); virtual DECLARE_WRITE8_MEMBER(write_bank); virtual DECLARE_READ8_MEMBER(read_ram); @@ -161,11 +161,11 @@ class gb_rom_mmm01_device : public gb_rom_mbc_device public: // construction/destruction gb_rom_mmm01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_config_complete() { m_shortname = "gb_rom_mmm01"; } - + // reading and writing virtual DECLARE_READ8_MEMBER(read_rom); virtual DECLARE_WRITE8_MEMBER(write_bank); diff --git a/src/mess/machine/gb_rom.c b/src/mess/machine/gb_rom.c index 1f6de921f7e..d7fca7581fb 100644 --- a/src/mess/machine/gb_rom.c +++ b/src/mess/machine/gb_rom.c @@ -1,11 +1,11 @@ /*********************************************************************************************************** Game Boy cart emulation - - + + Here we emulate carts with no RAM and simple bankswitch - - + + ***********************************************************************************************************/ @@ -96,7 +96,7 @@ void megaduck_rom_device::device_start() void gb_rom_tama5_device::device_start() { m_tama5_data = 0; - m_tama5_addr= 0; + m_tama5_addr= 0; m_tama5_cmd = 0; memset(m_regs, 0xff, sizeof(m_regs)); m_rtc_reg = 0xff; @@ -366,4 +366,3 @@ WRITE8_MEMBER(megaduck_rom_device::write_ram) m_latch_bank = data * 2; m_latch_bank2 = data * 2 + 1; } - diff --git a/src/mess/machine/gb_rom.h b/src/mess/machine/gb_rom.h index 0a538effd55..805df3bd2df 100644 --- a/src/mess/machine/gb_rom.h +++ b/src/mess/machine/gb_rom.h @@ -7,13 +7,13 @@ // ======================> gb_rom_device class gb_rom_device : public device_t, - public device_gb_cart_interface + public device_gb_cart_interface { public: // construction/destruction gb_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); gb_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_config_complete() { m_shortname = "gb_rom"; } @@ -30,11 +30,11 @@ class gb_rom_tama5_device : public gb_rom_device public: // construction/destruction gb_rom_tama5_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_config_complete() { m_shortname = "gb_rom_tama5"; } - + // reading and writing virtual DECLARE_READ8_MEMBER(read_rom); virtual DECLARE_READ8_MEMBER(read_ram); @@ -50,11 +50,11 @@ class gb_rom_wisdom_device : public gb_rom_device public: // construction/destruction gb_rom_wisdom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_config_complete() { m_shortname = "gb_rom_wisdom"; } - + // reading and writing virtual DECLARE_READ8_MEMBER(read_rom); virtual DECLARE_WRITE8_MEMBER(write_bank); @@ -66,11 +66,11 @@ class gb_rom_yong_device : public gb_rom_device public: // construction/destruction gb_rom_yong_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_config_complete() { m_shortname = "gb_rom_yong"; } - + // reading and writing virtual DECLARE_READ8_MEMBER(read_rom); virtual DECLARE_WRITE8_MEMBER(write_bank); @@ -82,11 +82,11 @@ class gb_rom_atvrac_device : public gb_rom_device public: // construction/destruction gb_rom_atvrac_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_config_complete() { m_shortname = "gb_rom_atvrac"; } - + // reading and writing virtual DECLARE_READ8_MEMBER(read_rom); virtual DECLARE_WRITE8_MEMBER(write_bank); @@ -98,11 +98,11 @@ class gb_rom_lasama_device : public gb_rom_device public: // construction/destruction gb_rom_lasama_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_config_complete() { m_shortname = "gb_rom_lasama"; } - + // reading and writing virtual DECLARE_READ8_MEMBER(read_rom); virtual DECLARE_WRITE8_MEMBER(write_bank); @@ -119,11 +119,11 @@ public: // construction/destruction megaduck_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); megaduck_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_config_complete() { m_shortname = "megaduck_rom"; } - + // reading and writing virtual DECLARE_READ8_MEMBER(read_rom); virtual DECLARE_WRITE8_MEMBER(write_bank); diff --git a/src/mess/machine/gb_slot.c b/src/mess/machine/gb_slot.c index d469e4103f3..810d2cdb319 100644 --- a/src/mess/machine/gb_slot.c +++ b/src/mess/machine/gb_slot.c @@ -1,18 +1,18 @@ /*********************************************************************************************************** - + Game Boy cart emulation (through slot devices) - + The driver exposes address ranges 0x0000-0x7fff to read_rom/write_bank 0xa000-0xbfff to read_ram/write_ram (typically RAM/NVRAM accesses, but megaduck uses the write for bankswitch) - + currently available slot devices: gb_rom: standard carts + TAMA5 mapper + pirate carts with protection & bankswitch gb_mbc: MBC1-MBC7 carts (more complex bankswitch + RAM + possibly RTC/Rumble/etc.) - + ***********************************************************************************************************/ @@ -81,17 +81,17 @@ void device_gb_cart_interface::ram_alloc(running_machine &machine, UINT32 size) //------------------------------------------------- -// rom_map_setup - setup map of rom banks in 16K +// rom_map_setup - setup map of rom banks in 16K // blocks, so to simplify ROM access //------------------------------------------------- void device_gb_cart_interface::rom_map_setup(UINT32 size) { int i; - // setup the rom_bank_map array to faster ROM read + // setup the rom_bank_map array to faster ROM read for (i = 0; i < size / 0x4000; i++) rom_bank_map[i] = i; - + // fill up remaining blocks with mirrors while (i % 512) { @@ -105,26 +105,26 @@ void device_gb_cart_interface::rom_map_setup(UINT32 size) } // check bank map! -// for (i = 0; i < 256; i++) -// { -// printf("bank %3d = %3d\t", i, rom_bank_map[i]); -// if ((i%8) == 7) -// printf("\n"); -// } +// for (i = 0; i < 256; i++) +// { +// printf("bank %3d = %3d\t", i, rom_bank_map[i]); +// if ((i%8) == 7) +// printf("\n"); +// } } //------------------------------------------------- -// ram_map_setup - setup map of ram banks in 16K +// ram_map_setup - setup map of ram banks in 16K // blocks, so to simplify ROM access //------------------------------------------------- void device_gb_cart_interface::ram_map_setup(UINT8 banks) { int mask = banks - 1; - + for (int i = 0; i < banks; i++) ram_bank_map[i] = i; - + // Set up rest of the (mirrored) RAM pages for (int i = banks; i < 256; i++) ram_bank_map[i] = i & mask; @@ -208,8 +208,8 @@ static const gb_slot slot_list[] = { GB_MBC_MBC7, "rom_mbc7" }, { GB_MBC_TAMA5, "rom_tama5" }, { GB_MBC_MMM01, "rom_mmm01" }, - { GB_MBC_MBC3, "rom_huc1" }, // for now treat this as alias for MBC3 - { GB_MBC_MBC3, "rom_huc3" }, // for now treat this as alias for MBC3 + { GB_MBC_MBC3, "rom_huc1" }, // for now treat this as alias for MBC3 + { GB_MBC_MBC3, "rom_huc3" }, // for now treat this as alias for MBC3 { GB_MBC_WISDOM, "rom_wisdom" }, { GB_MBC_YONGYONG, "rom_yong" }, { GB_MBC_LASAMA, "rom_lasama" }, @@ -224,7 +224,7 @@ static int gb_get_pcb_id(const char *slot) if (!mame_stricmp(slot_list[i].slot_option, slot)) return slot_list[i].pcb_id; } - + return 0; } @@ -235,7 +235,7 @@ static const char *gb_get_slot(int type) if (slot_list[i].pcb_id == type) return slot_list[i].slot_option; } - + return "rom"; } @@ -263,7 +263,7 @@ bool base_gb_cart_slot_device::call_load() offset = 512; len -= offset; fseek(offset, SEEK_SET); - } + } /* Verify that the file contains 16kb blocks */ if ((len == 0) || ((len % 0x4000) != 0)) { @@ -271,7 +271,7 @@ bool base_gb_cart_slot_device::call_load() return IMAGE_INIT_FAIL; } } - + m_cart->rom_alloc(machine(), len); ROM = m_cart->get_rom_base(); @@ -310,7 +310,7 @@ bool base_gb_cart_slot_device::call_load() if (!mame_stricmp(get_feature("rumble"), "yes")) m_cart->set_has_rumble(TRUE); } - + if (get_feature("rtc")) { if (!mame_stricmp(get_feature("rtc"), "yes")) @@ -330,17 +330,17 @@ bool base_gb_cart_slot_device::call_load() m_cart->set_has_battery(TRUE); m_cart->set_has_timer(TRUE); break; - + case 0x1c: case 0x1d: m_cart->set_has_rumble(TRUE); break; - + case 0x1e: m_cart->set_has_battery(TRUE); m_cart->set_has_rumble(TRUE); break; } - + switch (ROM[0x0149 + offset] & 0x07) { case 0x00: case 0x06: case 0x07: @@ -360,7 +360,7 @@ bool base_gb_cart_slot_device::call_load() rambanks = 8; break; } - + if (type == GB_MBC_MBC2 || type == GB_MBC_MBC7) rambanks = 1; } @@ -373,14 +373,14 @@ bool base_gb_cart_slot_device::call_load() if (m_cart->get_ram_size() && m_cart->get_has_battery()) battery_load(m_cart->get_ram_base(), m_cart->get_ram_size(), 0xff); - + //printf("Type: %s\n", gb_get_slot(type)); internal_header_logging(ROM + offset, len); return IMAGE_INIT_PASS; } - + return IMAGE_INIT_PASS; } @@ -393,7 +393,7 @@ bool megaduck_cart_slot_device::call_load() m_cart->rom_alloc(machine(), len); ROM = m_cart->get_rom_base(); - + if (software_entry() == NULL) fread(ROM, len); else @@ -401,10 +401,10 @@ bool megaduck_cart_slot_device::call_load() // setup rom bank map based on real length, not header value m_cart->rom_map_setup(len); - + return IMAGE_INIT_PASS; } - + return IMAGE_INIT_PASS; } @@ -455,7 +455,7 @@ bool base_gb_cart_slot_device::get_mmm01_candidate(UINT8 *ROM, UINT32 len) if (ROM[(len - 0x8000) + 0x104 + i] == nintendo_logo[i]) bytes_matched++; } - + if (bytes_matched == 0x18 && ROM[(len - 0x8000) + 0x147] >= 0x0b && ROM[(len - 0x8000) + 0x147] <= 0x0d) return TRUE; else @@ -465,13 +465,13 @@ bool base_gb_cart_slot_device::get_mmm01_candidate(UINT8 *ROM, UINT32 len) int base_gb_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len) { int type = GB_MBC_NONE; - + if (len < 0x014c) fatalerror("Checking header of a corrupted image!\n"); switch(ROM[0x0147]) { - case 0x00: type = GB_MBC_NONE; break; + case 0x00: type = GB_MBC_NONE; break; case 0x01: type = GB_MBC_MBC1; break; case 0x02: type = GB_MBC_MBC1; break; case 0x03: type = GB_MBC_MBC1; break; @@ -519,14 +519,14 @@ int base_gb_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len) type = GB_MBC_WISDOM; } } - + /* Check if we're dealing with a Korean variant of the MBC1 mapper */ if (type == GB_MBC_MBC1) { if (ROM[0x13f] == 0x42 && ROM[0x140] == 0x32 && ROM[0x141] == 0x43 && ROM[0x142] == 0x4B) type = GB_MBC_MBC1_KOR; } - + return type; } /*------------------------------------------------- @@ -535,16 +535,15 @@ int base_gb_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len) const char * base_gb_cart_slot_device::get_default_card_software(const machine_config &config, emu_options &options) { - if (open_image_file(options)) { const char *slot_string = "rom"; UINT32 len = core_fsize(m_file), offset = 0; UINT8 *ROM = global_alloc_array(UINT8, len); int type; - + core_fread(m_file, ROM, len); - + if ((len % 0x4000) == 512) offset = 512; @@ -557,7 +556,7 @@ const char * base_gb_cart_slot_device::get_default_card_software(const machine_c //printf("type: %s\n", slot_string); global_free(ROM); clear(); - + return slot_string; } @@ -612,19 +611,19 @@ void base_gb_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len) { static const char *const cart_types[] = { - "ROM ONLY", "ROM+MBC1", "ROM+MBC1+RAM", - "ROM+MBC1+RAM+BATTERY", "UNKNOWN", "ROM+MBC2", - "ROM+MBC2+BATTERY", "UNKNOWN", "ROM+RAM", - "ROM+RAM+BATTERY", "UNKNOWN", "ROM+MMM01", - "ROM+MMM01+SRAM", "ROM+MMM01+SRAM+BATTERY", "UNKNOWN", - "ROM+MBC3+TIMER+BATTERY", "ROM+MBC3+TIMER+RAM+BATTERY", "ROM+MBC3", - "ROM+MBC3+RAM", "ROM+MBC3+RAM+BATTERY", "UNKNOWN", - "UNKNOWN", "UNKNOWN", "UNKNOWN", - "UNKNOWN", "ROM+MBC5", "ROM+MBC5+RAM", - "ROM+MBC5+RAM+BATTERY", "ROM+MBC5+RUMBLE", "ROM+MBC5+RUMBLE+SRAM", - "ROM+MBC5+RUMBLE+SRAM+BATTERY", "Pocket Camera", "Bandai TAMA5", + "ROM ONLY", "ROM+MBC1", "ROM+MBC1+RAM", + "ROM+MBC1+RAM+BATTERY", "UNKNOWN", "ROM+MBC2", + "ROM+MBC2+BATTERY", "UNKNOWN", "ROM+RAM", + "ROM+RAM+BATTERY", "UNKNOWN", "ROM+MMM01", + "ROM+MMM01+SRAM", "ROM+MMM01+SRAM+BATTERY", "UNKNOWN", + "ROM+MBC3+TIMER+BATTERY", "ROM+MBC3+TIMER+RAM+BATTERY", "ROM+MBC3", + "ROM+MBC3+RAM", "ROM+MBC3+RAM+BATTERY", "UNKNOWN", + "UNKNOWN", "UNKNOWN", "UNKNOWN", + "UNKNOWN", "ROM+MBC5", "ROM+MBC5+RAM", + "ROM+MBC5+RAM+BATTERY", "ROM+MBC5+RUMBLE", "ROM+MBC5+RUMBLE+SRAM", + "ROM+MBC5+RUMBLE+SRAM+BATTERY", "Pocket Camera", "Bandai TAMA5", /* Need heaps of unknowns here */ - "Hudson HuC-3", "Hudson HuC-1" + "Hudson HuC-3", "Hudson HuC-1" }; // some company codes @@ -718,7 +717,7 @@ void base_gb_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len) UINT32 tmp = 0; int csum = 0, i = 0; int rom_banks; - + switch (ROM[0x0148]) { case 0x52: @@ -768,15 +767,15 @@ void base_gb_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len) if ((len / 0x4000) != rom_banks) logerror("\nWarning loading cartridge: Filesize (0x%x) and reported ROM banks (0x%x) don't match.\n", - len, rom_banks * 0x4000); + len, rom_banks * 0x4000); /* Calculate and check checksum */ tmp = (ROM[0x014e] << 8) + ROM[0x014f]; for (int i = 0; i < len; i++) csum += ROM[i]; csum -= (ROM[0x014e] + ROM[0x014f]); csum &= 0xffff; - + if (csum != tmp) logerror("\nWarning loading cartridge: Checksum is wrong (Actual %X vs Internal %X)\n", csum, tmp); -}
\ No newline at end of file +} diff --git a/src/mess/machine/gb_slot.h b/src/mess/machine/gb_slot.h index 46f2c01be67..154e8c03d5f 100644 --- a/src/mess/machine/gb_slot.h +++ b/src/mess/machine/gb_slot.h @@ -63,7 +63,7 @@ public: virtual void rom_map_setup(UINT32 size); virtual void ram_map_setup(UINT8 banks); - + virtual void set_has_timer(bool val) { has_timer = val; } virtual void set_has_rumble(bool val) { has_rumble = val; } virtual void set_has_battery(bool val) { has_battery = val; } @@ -82,8 +82,8 @@ public: // 0x4000-0x7fff = rom_bank_map[m_latch_bank2] (generally defaults to m_latch_bank2 = 1) // 0xa000-0xbfff = ram_bank_map[m_ram_bank] (generally defaults to m_ram_bank = 0) // suitable writes to 0x0000-0x7fff can then modify m_latch_bank/m_latch_bank2 - UINT8 rom_bank_map[512]; // 16K chunks of ROM - UINT8 ram_bank_map[256]; // 16K chunks of RAM + UINT8 rom_bank_map[512]; // 16K chunks of ROM + UINT8 ram_bank_map[256]; // 16K chunks of RAM UINT8 m_ram_bank; UINT16 m_latch_bank, m_latch_bank2; @@ -102,11 +102,11 @@ public: // construction/destruction base_gb_cart_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); virtual ~base_gb_cart_slot_device(); - + // device-level overrides virtual void device_start(); virtual void device_config_complete(); - + // image-level overrides virtual bool call_load(); virtual void call_unload(); @@ -128,10 +128,10 @@ public: virtual const option_guide *create_option_guide() const { return NULL; } virtual const char *image_interface() const { return "gameboy_cart"; } virtual const char *file_extensions() const { return "bin,gb,gbc"; } - + // slot interface overrides virtual const char * get_default_card_software(const machine_config &config, emu_options &options); - + // reading and writing virtual DECLARE_READ8_MEMBER(read_rom); virtual DECLARE_WRITE8_MEMBER(write_bank); @@ -142,8 +142,8 @@ public: // this should be private, but then there is some problem installing delegates in the driver... //private: - device_gb_cart_interface* m_cart; - + device_gb_cart_interface* m_cart; + int m_type; }; diff --git a/src/mess/machine/isa_gus.c b/src/mess/machine/isa_gus.c index 95daedabd57..7cd97eb6569 100644 --- a/src/mess/machine/isa_gus.c +++ b/src/mess/machine/isa_gus.c @@ -1205,8 +1205,8 @@ static const acia6850_interface gus_midi_interface = 31250 * 16, 0, - DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, isa16_gus_device, rx_in), // rx in - DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, isa16_gus_device, tx_out), // tx out + DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, isa16_gus_device, rx_in), // rx in + DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, isa16_gus_device, tx_out), // tx out DEVCB_NULL, DEVCB_NULL, @@ -1230,7 +1230,7 @@ SLOT_INTERFACE_END static const serial_port_interface midiout_intf = { - DEVCB_NULL // midi out ports don't transmit inward + DEVCB_NULL // midi out ports don't transmit inward }; static const gf1_interface gus_gf1_config = @@ -1721,7 +1721,7 @@ WRITE_LINE_MEMBER( isa16_gus_device::midi_irq ) WRITE_LINE_MEMBER( isa16_gus_device::midi_rx_w ) { m_rx_state = state; - for (int i = 0; i < 16; i++) // divider is set to 16 + for (int i = 0; i < 16; i++) // divider is set to 16 { m_midi->rx_clock_in(); } diff --git a/src/mess/machine/isa_sblaster.c b/src/mess/machine/isa_sblaster.c index fb57be4d1e9..485721275ed 100644 --- a/src/mess/machine/isa_sblaster.c +++ b/src/mess/machine/isa_sblaster.c @@ -44,7 +44,7 @@ static const int m_cmd_fifo_length[256] = -1, -1, -1, -1, 1, 3, -1, -1, -1, -1, -1, -1, -1, -1, 2, 1, /* 0x */ 2, -1, -1, -1, 3, -1, 3, 3, -1, -1, -1, -1, 1, -1, -1, 1, /* 1x */ -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 2x */ - 1, 1, -1, -1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, /* 3x */ + 1, 1, -1, -1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1, /* 3x */ 2, 3, 3, -1, -1, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1, /* 4x */ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 5x */ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 6x */ @@ -86,7 +86,7 @@ SLOT_INTERFACE_END static const serial_port_interface midiout_intf = { - DEVCB_NULL // midi out ports don't transmit inward + DEVCB_NULL // midi out ports don't transmit inward }; static MACHINE_CONFIG_FRAGMENT( sblaster1_0_config ) @@ -336,7 +336,7 @@ READ8_MEMBER(sb_device::dsp_rbuf_status_r) // printf("Clear IRQ5\n"); irq_w(0, IRQ_DMA8); // reading this port ACKs the card's IRQ, 8-bit dma only? - // in either SB-MIDI mode, bit 7 indicates if a character is available + // in either SB-MIDI mode, bit 7 indicates if a character is available // to read. if (m_uart_midi || m_onebyte_midi) { @@ -364,7 +364,7 @@ READ8_MEMBER(sb_device::dsp_wbuf_status_r) { if (m_tx_waiting >= MIDI_RING_SIZE) { - return 0x80; + return 0x80; } return 0x00; @@ -453,11 +453,11 @@ void sb_device::process_fifo(UINT8 cmd) break; case 0x36: - case 0x37: // Enter UART mode + case 0x37: // Enter UART mode printf("timestamp MIDI mode not supported, contact MESSDEV!\n"); break; - case 0x38: // single-byte MIDI send + case 0x38: // single-byte MIDI send m_onebyte_midi = true; break; @@ -707,7 +707,7 @@ void sb_device::process_fifo(UINT8 cmd) WRITE8_MEMBER(sb_device::dsp_cmd_w) { -// printf("%02x to DSP command @ %x\n", data, offset); +// printf("%02x to DSP command @ %x\n", data, offset); if(offset) return; @@ -715,7 +715,7 @@ WRITE8_MEMBER(sb_device::dsp_cmd_w) if (m_uart_midi || m_onebyte_midi) { xmit_char(data); - m_onebyte_midi = false; // clear onebyte (if this is uart, that's harmless) + m_onebyte_midi = false; // clear onebyte (if this is uart, that's harmless) return; } @@ -802,7 +802,7 @@ READ8_MEMBER( sb16_device::mpu401_r ) } if (m_rx_waiting == 0) { - res |= 0x80; // rx empty + res |= 0x80; // rx empty } } @@ -1604,7 +1604,7 @@ void sb_device::rcv_complete() // Rx completed receiving byte } if (m_uart_irq) { - irq_w(1, IRQ_DMA8); + irq_w(1, IRQ_DMA8); } } } @@ -1630,7 +1630,7 @@ void sb16_device::rcv_complete() // Rx completed receiving byte if (m_uart_irq) { - irq_w(1, IRQ_DMA8); + irq_w(1, IRQ_DMA8); } if (m_mpu_midi) @@ -1642,7 +1642,7 @@ void sb16_device::rcv_complete() // Rx completed receiving byte void sb_device::tra_complete() // Tx completed sending byte { -// printf("Tx complete\n"); +// printf("Tx complete\n"); // is there more waiting to send? if (m_tx_waiting) { @@ -1662,12 +1662,12 @@ void sb_device::tra_complete() // Tx completed sending byte void sb_device::tra_callback() // Tx send bit { int bit = transmit_register_get_data_bit(); - m_mdout->tx(bit); + m_mdout->tx(bit); } void sb_device::xmit_char(UINT8 data) { -// printf("SB: xmit %02x\n", data); +// printf("SB: xmit %02x\n", data); // if tx is busy it'll pick this up automatically when it completes if (!m_tx_busy) @@ -1686,4 +1686,3 @@ void sb_device::xmit_char(UINT8 data) m_tx_waiting++; } } - diff --git a/src/mess/machine/kb_msnat.h b/src/mess/machine/kb_msnat.h index 09a9b855671..bde7db35ef2 100644 --- a/src/mess/machine/kb_msnat.h +++ b/src/mess/machine/kb_msnat.h @@ -51,7 +51,7 @@ protected: required_ioport m_p1_1; required_ioport m_p1_2; required_ioport m_p1_3; - required_ioport m_p1_4; + required_ioport m_p1_4; required_ioport m_p1_5; required_ioport m_p1_6; required_ioport m_p1_7; diff --git a/src/mess/machine/lisa.c b/src/mess/machine/lisa.c index bbce3f267ed..60ff74824f0 100644 --- a/src/mess/machine/lisa.c +++ b/src/mess/machine/lisa.c @@ -277,7 +277,7 @@ void lisa_state::scan_keyboard() { int i, j; UINT8 keycode; - UINT8 keybuf[8] = { m_io_line0->read(), m_io_line1->read(), m_io_line2->read(), m_io_line3->read(), + UINT8 keybuf[8] = { m_io_line0->read(), m_io_line1->read(), m_io_line2->read(), m_io_line3->read(), m_io_line4->read(), m_io_line5->read(), m_io_line6->read(), m_io_line7->read() }; if (! m_COPS_force_unplug) diff --git a/src/mess/machine/mac.c b/src/mess/machine/mac.c index 3184b632474..a8a26cef0d9 100644 --- a/src/mess/machine/mac.c +++ b/src/mess/machine/mac.c @@ -562,7 +562,7 @@ static int scan_keyboard(running_machine &machine) int keybuf = 0; int keycode; mac_state *mac = machine.driver_data<mac_state>(); - ioport_port *ports[7] = { mac->m_key0, mac->m_key1, mac->m_key2, mac->m_key3, mac->m_key4, mac->m_key5, mac->m_key6 }; + ioport_port *ports[7] = { mac->m_key0, mac->m_key1, mac->m_key2, mac->m_key3, mac->m_key4, mac->m_key5, mac->m_key6 }; if (mac->m_keycode_buf_index) { diff --git a/src/mess/machine/macadb.c b/src/mess/machine/macadb.c index 84cdc6557e9..7602c67389f 100644 --- a/src/mess/machine/macadb.c +++ b/src/mess/machine/macadb.c @@ -76,7 +76,7 @@ static const char *const adb_statenames[4] = { "NEW", "EVEN", "ODD", "IDLE" }; int mac_state::adb_pollkbd(int update) { int i, j, keybuf, report, codes[2], result; - ioport_port *ports[6] = { m_key0, m_key1, m_key2, m_key3, m_key4, m_key5 }; + ioport_port *ports[6] = { m_key0, m_key1, m_key2, m_key3, m_key4, m_key5 }; codes[0] = codes[1] = 0xff; // key up report = result = 0; diff --git a/src/mess/machine/md_eeprom.c b/src/mess/machine/md_eeprom.c index f1f72500143..6905e0e1df3 100644 --- a/src/mess/machine/md_eeprom.c +++ b/src/mess/machine/md_eeprom.c @@ -1,14 +1,14 @@ /*********************************************************************************************************** - - + + MegaDrive / Genesis cart+EEPROM emulation - - + + TODO: proper EEPROM emulation, still not worked on (just hooked up the I2C device) - + i2c games mapping table: - + game name | SDA_IN | SDA_OUT | SCL | SIZE_MASK | PAGE_MASK | ----------------------------------|------------|------------|------------|----------------|-----------| NBA Jam | 0x200001-0 | 0x200001-0 | 0x200001-1 | 0x00ff (24C02) | 0x03 | xx @@ -30,7 +30,7 @@ Micro Machines 96 | 0x380001-7 | 0x300000-0*| 0x300000-1*| 0x07ff (24C16) | 0x0f | Brian Lara Cricket 96 | 0x380001-7 | 0x300000-0*| 0x300000-1*| 0x1fff (24C64) | 0x??* | ----------------------------------|------------|------------|------------|----------------|-----------| - + * Notes: check these ** original Rockman Mega World (J) set uses normal backup RAM @@ -213,12 +213,12 @@ READ16_MEMBER(md_std_eeprom_device::read) { if (offset == 0x200000/2) { -// m_i2c_mem = i2cmem_sda_read(m_i2cmem); +// m_i2c_mem = i2cmem_sda_read(m_i2cmem); return ~m_i2c_mem & 1; } - if (offset < 0x400000/2) - return m_rom[MD_ADDR(offset)]; - else + if (offset < 0x400000/2) + return m_rom[MD_ADDR(offset)]; + else return 0xffff; } @@ -237,12 +237,12 @@ READ16_MEMBER(md_eeprom_nbajam_device::read) { if (offset == 0x200000/2) { -// m_i2c_mem = i2cmem_sda_read(m_i2cmem); +// m_i2c_mem = i2cmem_sda_read(m_i2cmem); return m_i2c_mem & 1; } - if (offset < 0x400000/2) - return m_rom[MD_ADDR(offset)]; - else + if (offset < 0x400000/2) + return m_rom[MD_ADDR(offset)]; + else return 0xffff; } @@ -261,12 +261,12 @@ READ16_MEMBER(md_eeprom_nbajamte_device::read) { if (offset == 0x200000/2) { -// m_i2c_mem = i2cmem_sda_read(m_i2cmem); +// m_i2c_mem = i2cmem_sda_read(m_i2cmem); return m_i2c_mem & 1; } - if (offset < 0x400000/2) - return m_rom[MD_ADDR(offset)]; - else + if (offset < 0x400000/2) + return m_rom[MD_ADDR(offset)]; + else return 0xffff; } @@ -286,12 +286,12 @@ READ16_MEMBER(md_eeprom_cslam_device::read) { if (offset == 0x200000/2) { -// m_i2c_mem = i2cmem_sda_read(m_i2cmem); +// m_i2c_mem = i2cmem_sda_read(m_i2cmem); return m_i2c_mem & 1; } - if (offset < 0x400000/2) - return m_rom[MD_ADDR(offset)]; - else + if (offset < 0x400000/2) + return m_rom[MD_ADDR(offset)]; + else return 0xffff; } @@ -311,12 +311,12 @@ READ16_MEMBER(md_eeprom_nflqb_device::read) { if (offset == 0x200000/2) { -// m_i2c_mem = i2cmem_sda_read(m_i2cmem); +// m_i2c_mem = i2cmem_sda_read(m_i2cmem); return m_i2c_mem & 1; } - if (offset < 0x400000/2) - return m_rom[MD_ADDR(offset)]; - else + if (offset < 0x400000/2) + return m_rom[MD_ADDR(offset)]; + else return 0xffff; } @@ -335,12 +335,12 @@ READ16_MEMBER(md_eeprom_nhlpa_device::read) { if (offset == 0x200000/2) { -// m_i2c_mem = i2cmem_sda_read(m_i2cmem); +// m_i2c_mem = i2cmem_sda_read(m_i2cmem); return (m_i2c_mem & 1) << 7; } - if (offset < 0x400000/2) - return m_rom[MD_ADDR(offset)]; - else + if (offset < 0x400000/2) + return m_rom[MD_ADDR(offset)]; + else return 0xffff; } @@ -359,12 +359,12 @@ READ16_MEMBER(md_eeprom_blara_device::read) { if (offset == 0x380000/2) { -// m_i2c_mem = i2cmem_sda_read(m_i2cmem); +// m_i2c_mem = i2cmem_sda_read(m_i2cmem); return (m_i2c_mem & 1) << 7; } - if (offset < 0x400000/2) - return m_rom[MD_ADDR(offset)]; - else + if (offset < 0x400000/2) + return m_rom[MD_ADDR(offset)]; + else return 0xffff; } @@ -378,4 +378,3 @@ WRITE16_MEMBER(md_eeprom_blara_device::write) i2cmem_sda_write(m_i2cmem, m_i2c_mem); } } - diff --git a/src/mess/machine/md_eeprom.h b/src/mess/machine/md_eeprom.h index 421932742f1..1f3de3221ae 100644 --- a/src/mess/machine/md_eeprom.h +++ b/src/mess/machine/md_eeprom.h @@ -12,18 +12,18 @@ // ======================> md_std_eeprom_device class md_std_eeprom_device : public device_t, - public device_md_cart_interface + public device_md_cart_interface { public: // construction/destruction md_std_eeprom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); md_std_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_config_complete() { m_shortname = "md_std_eeprom"; } virtual machine_config_constructor device_mconfig_additions() const; - + // reading and writing virtual DECLARE_READ16_MEMBER(read); virtual DECLARE_WRITE16_MEMBER(write); @@ -39,11 +39,11 @@ class md_eeprom_nbajam_device : public md_std_eeprom_device public: // construction/destruction md_eeprom_nbajam_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_config_complete() { m_shortname = "md_eeprom_nbajam"; } virtual machine_config_constructor device_mconfig_additions() const; - + // reading and writing virtual DECLARE_READ16_MEMBER(read); virtual DECLARE_WRITE16_MEMBER(write); @@ -56,11 +56,11 @@ class md_eeprom_nbajamte_device : public md_std_eeprom_device public: // construction/destruction md_eeprom_nbajamte_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_config_complete() { m_shortname = "md_eeprom_nbajamte"; } virtual machine_config_constructor device_mconfig_additions() const; - + // reading and writing virtual DECLARE_READ16_MEMBER(read); virtual DECLARE_WRITE16_MEMBER(write); @@ -73,11 +73,11 @@ class md_eeprom_cslam_device : public md_std_eeprom_device public: // construction/destruction md_eeprom_cslam_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_config_complete() { m_shortname = "md_eeprom_cslam"; } virtual machine_config_constructor device_mconfig_additions() const; - + // reading and writing virtual DECLARE_READ16_MEMBER(read); virtual DECLARE_WRITE16_MEMBER(write); @@ -90,11 +90,11 @@ class md_eeprom_nflqb_device : public md_std_eeprom_device public: // construction/destruction md_eeprom_nflqb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_config_complete() { m_shortname = "md_eeprom_nflqb"; } virtual machine_config_constructor device_mconfig_additions() const; - + // reading and writing virtual DECLARE_READ16_MEMBER(read); virtual DECLARE_WRITE16_MEMBER(write); @@ -107,11 +107,11 @@ class md_eeprom_nhlpa_device : public md_std_eeprom_device public: // construction/destruction md_eeprom_nhlpa_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_config_complete() { m_shortname = "md_eeprom_nhlpa"; } virtual machine_config_constructor device_mconfig_additions() const; - + // reading and writing virtual DECLARE_READ16_MEMBER(read); virtual DECLARE_WRITE16_MEMBER(write); @@ -124,11 +124,11 @@ class md_eeprom_blara_device : public md_std_eeprom_device public: // construction/destruction md_eeprom_blara_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_config_complete() { m_shortname = "md_eeprom_blara"; } virtual machine_config_constructor device_mconfig_additions() const; - + // reading and writing virtual DECLARE_READ16_MEMBER(read); virtual DECLARE_WRITE16_MEMBER(write); diff --git a/src/mess/machine/md_jcart.c b/src/mess/machine/md_jcart.c index 5aadc882a25..fc2d5171908 100644 --- a/src/mess/machine/md_jcart.c +++ b/src/mess/machine/md_jcart.c @@ -1,23 +1,23 @@ /*********************************************************************************************************** - - + + MegaDrive / Genesis J-Cart (+SEPROM) emulation - - + + i2c games mapping table: - + game name | SDA_IN | SDA_OUT | SCL | SIZE_MASK | PAGE_MASK | ----------------------------------|------------|------------|------------|----------------|-----------| Micro Machines 2 | 0x380001-7 | 0x300000-0*| 0x300000-1*| 0x03ff (24C08) | 0x0f | Micro Machines Military | 0x380001-7 | 0x300000-0*| 0x300000-1*| 0x03ff (24C08) | 0x0f | Micro Machines 96 | 0x380001-7 | 0x300000-0*| 0x300000-1*| 0x07ff (24C16) | 0x0f | ----------------------------------|------------|------------|------------|----------------|-----------| - + * Notes: check these TODO: proper SEPROM emulation, still not worked on (just hooked up the I2C device) - + ***********************************************************************************************************/ @@ -174,7 +174,7 @@ READ16_MEMBER(md_jcart_device::read) if (offset == 0x38fffe/2) { UINT8 joy[2]; - + if (m_jcart_io_data[0] & 0x40) { joy[0] = m_jcart3->read_safe(0); @@ -188,9 +188,9 @@ READ16_MEMBER(md_jcart_device::read) return (m_jcart_io_data[0] & 0x40) | joy[0] | (joy[1] << 8); } } - if (offset < 0x400000/2) - return m_rom[MD_ADDR(offset)]; - else + if (offset < 0x400000/2) + return m_rom[MD_ADDR(offset)]; + else return 0xffff; } @@ -217,7 +217,7 @@ READ16_MEMBER(md_seprom_codemast_device::read) if (offset == 0x38fffe/2) { UINT8 joy[2]; - + if (m_jcart_io_data[0] & 0x40) { joy[0] = m_jcart3->read_safe(0); @@ -231,9 +231,9 @@ READ16_MEMBER(md_seprom_codemast_device::read) return (m_jcart_io_data[0] & 0x40) | joy[0] | (joy[1] << 8); } } - if (offset < 0x400000/2) - return m_rom[MD_ADDR(offset)]; - else + if (offset < 0x400000/2) + return m_rom[MD_ADDR(offset)]; + else return 0xffff; } @@ -252,4 +252,3 @@ WRITE16_MEMBER(md_seprom_codemast_device::write) m_jcart_io_data[1] = (data & 1) << 6; } } - diff --git a/src/mess/machine/md_jcart.h b/src/mess/machine/md_jcart.h index bf7b3e7dd9b..d1534c60c27 100644 --- a/src/mess/machine/md_jcart.h +++ b/src/mess/machine/md_jcart.h @@ -18,7 +18,7 @@ public: // construction/destruction md_jcart_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); md_jcart_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_config_complete() { m_shortname = "md_jcart"; } @@ -43,12 +43,12 @@ public: // construction/destruction md_seprom_codemast_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); md_seprom_codemast_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_config_complete() { m_shortname = "md_seprom_codemast"; } virtual machine_config_constructor device_mconfig_additions() const; - + // reading and writing virtual DECLARE_READ16_MEMBER(read); virtual DECLARE_WRITE16_MEMBER(write); @@ -56,7 +56,7 @@ public: required_device<i2cmem_device> m_i2cmem; private: - UINT8 m_jcart_io_data[2]; + UINT8 m_jcart_io_data[2]; UINT8 m_i2c_mem, m_i2c_clk; }; @@ -67,7 +67,7 @@ class md_seprom_mm96_device : public md_seprom_codemast_device public: // construction/destruction md_seprom_mm96_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_config_complete() { m_shortname = "md_seprom_mm96"; } virtual machine_config_constructor device_mconfig_additions() const; diff --git a/src/mess/machine/md_rom.c b/src/mess/machine/md_rom.c index 91e767b8921..243d3f19b83 100644 --- a/src/mess/machine/md_rom.c +++ b/src/mess/machine/md_rom.c @@ -1,9 +1,9 @@ /*********************************************************************************************************** - - + + MegaDrive / Genesis cart emulation - - + + Here we emulate bankswitch / protection / NVRAM found on generic carts with no additional hardware @@ -244,7 +244,7 @@ void md_rom_pokestad_device::device_start() void md_rom_realtec_device::device_start() { - m_bank_addr = 0; + m_bank_addr = 0; m_bank_size = 0; m_old_bank_addr = -1; save_item(NAME(m_bank_addr)); @@ -289,9 +289,9 @@ READ16_MEMBER(md_rom_sram_device::read) if (offset >= m_nvram_start/2 && offset < m_nvram_end/2 && m_nvram_active) return m_nvram[offset - m_nvram_start/2]; } - if (offset < 0x400000/2) - return m_rom[MD_ADDR(offset)]; - else + if (offset < 0x400000/2) + return m_rom[MD_ADDR(offset)]; + else return 0xffff; } @@ -329,9 +329,9 @@ READ16_MEMBER(md_rom_fram_device::read) { if (offset >= m_nvram_start/2 && offset < m_nvram_end/2 && m_nvram_active) return m_nvram[offset - m_nvram_start/2]; - if (offset < 0x400000/2) - return m_rom[MD_ADDR(offset)]; - else + if (offset < 0x400000/2) + return m_rom[MD_ADDR(offset)]; + else return 0xffff; } @@ -372,7 +372,7 @@ WRITE16_MEMBER(md_rom_ssf2_device::write_a13) { m_lastoff = offset; m_lastdata = data; - if (offset) // bank 0 is not modified + if (offset) // bank 0 is not modified { UINT16 *ROM = get_rom_base(); m_bank[offset] = data & 0xf; @@ -430,7 +430,7 @@ READ16_MEMBER(md_rom_chinf3_device::read) else return m_rom[(offset & 0xffff/2) + (m_bank * 0x10000)/2]; } - + // PROTECTION in 0x400000 - 0x4fffff /* not 100% correct, there may be some relationship between the reads here and the writes made at the start of the game.. */ @@ -485,7 +485,7 @@ READ16_MEMBER(md_rom_chinf3_device::read) } return 0; } - + return m_rom[offset & 0x1fffff/2]; } @@ -512,12 +512,12 @@ WRITE16_MEMBER(md_rom_chinf3_device::write) READ16_MEMBER(md_rom_elfwor_device::read) { - /* It returns (0x55 @ 0x400000 OR 0xc9 @ 0x400004) AND (0x0f @ 0x400002 OR 0x18 @ 0x400006). + /* It returns (0x55 @ 0x400000 OR 0xc9 @ 0x400004) AND (0x0f @ 0x400002 OR 0x18 @ 0x400006). It is probably best to add handlers for all 4 addresses. */ - if (offset == 0x400000/2) return 0x5500; - if (offset == 0x400002/2) return 0x0f00; - if (offset == 0x400004/2) return 0xc900; - if (offset == 0x400006/2) return 0x1800; + if (offset == 0x400000/2) return 0x5500; + if (offset == 0x400002/2) return 0x0f00; + if (offset == 0x400004/2) return 0xc900; + if (offset == 0x400006/2) return 0x1800; return m_rom[MD_ADDR(offset)]; } @@ -527,10 +527,10 @@ READ16_MEMBER(md_rom_elfwor_device::read) READ16_MEMBER(md_rom_smouse_device::read) { - if (offset == 0x400000/2) return 0x5500; - if (offset == 0x400002/2) return 0x0f00; - if (offset == 0x400004/2) return 0xaa00; - if (offset == 0x400006/2) return 0xf000; + if (offset == 0x400000/2) return 0x5500; + if (offset == 0x400002/2) return 0x0f00; + if (offset == 0x400004/2) return 0xaa00; + if (offset == 0x400006/2) return 0xf000; return m_rom[MD_ADDR(offset)]; } @@ -540,10 +540,10 @@ READ16_MEMBER(md_rom_smouse_device::read) READ16_MEMBER(md_rom_yasech_device::read) { - if (offset == 0x400000/2) return 0x6300; - if (offset == 0x400002/2) return 0x9800; - if (offset == 0x400004/2) return 0xc900; - if (offset == 0x400006/2) return 0x1800; + if (offset == 0x400000/2) return 0x6300; + if (offset == 0x400002/2) return 0x9800; + if (offset == 0x400004/2) return 0xc900; + if (offset == 0x400006/2) return 0x1800; return m_rom[MD_ADDR(offset)]; } @@ -553,12 +553,12 @@ READ16_MEMBER(md_rom_yasech_device::read) READ16_MEMBER(md_rom_kof98_device::read) { - if (offset == 0x480000/2) return 0xaa00; - if (offset == 0x4800e0/2) return 0xaa00; - if (offset == 0x4824a0/2) return 0xaa00; - if (offset == 0x488880/2) return 0xaa00; - if (offset == 0x4a8820/2) return 0x0a00; - if (offset == 0x4f8820/2) return 0x0000; + if (offset == 0x480000/2) return 0xaa00; + if (offset == 0x4800e0/2) return 0xaa00; + if (offset == 0x4824a0/2) return 0xaa00; + if (offset == 0x488880/2) return 0xaa00; + if (offset == 0x4a8820/2) return 0x0a00; + if (offset == 0x4f8820/2) return 0x0000; return m_rom[MD_ADDR(offset)]; } @@ -568,10 +568,10 @@ READ16_MEMBER(md_rom_kof98_device::read) // gfx glitch with the new code... uninitialized ram somewhere? READ16_MEMBER(md_rom_kof99_device::read_a13) { - if (offset == 0x00/2) return 0x00; // startup protection check, chinese message if != 0 - if (offset == 0x02/2) return 0x01; // write 02 to a13002.. shift right 1? - if (offset == 0x3e/2) return 0x1f; // write 3e to a1303e.. shift right 1? - else return 0xffff; + if (offset == 0x00/2) return 0x00; // startup protection check, chinese message if != 0 + if (offset == 0x02/2) return 0x01; // write 02 to a13002.. shift right 1? + if (offset == 0x3e/2) return 0x1f; // write 3e to a1303e.. shift right 1? + else return 0xffff; } /*------------------------------------------------- @@ -580,15 +580,15 @@ READ16_MEMBER(md_rom_kof99_device::read_a13) READ16_MEMBER(md_rom_lion2_device::read) { - if (offset == 0x400002/2) return m_prot1_data; - if (offset == 0x400006/2) return m_prot2_data; + if (offset == 0x400002/2) return m_prot1_data; + if (offset == 0x400006/2) return m_prot2_data; return m_rom[MD_ADDR(offset)]; } WRITE16_MEMBER(md_rom_lion2_device::write) { - if (offset == 0x400000/2) m_prot1_data = data; - if (offset == 0x400004/2) m_prot2_data = data; + if (offset == 0x400000/2) m_prot1_data = data; + if (offset == 0x400004/2) m_prot2_data = data; } /*------------------------------------------------- @@ -600,7 +600,7 @@ READ16_MEMBER(md_rom_lion3_device::read) if (offset < 0x8000/2) return m_rom[offset + (m_bank * 0x8000)/2]; else if (offset >= 0x600000/2 && offset < 0x700000/2) - { + { UINT16 retdata = 0; switch (offset & 0x7) { @@ -627,14 +627,14 @@ READ16_MEMBER(md_rom_lion3_device::read) retdata |= (BIT(m_prot_data, 0) << 7); } break; - + default: logerror("protection read, unknown offset %x\n", offset & 0x7); break; } return retdata; } - + return m_rom[offset]; } @@ -675,8 +675,8 @@ WRITE16_MEMBER(md_rom_lion3_device::write) READ16_MEMBER(md_rom_mjlov_device::read) { - if (offset == 0x400000/2) return 0x9000; - if (offset == 0x401000/2) return 0xd300; + if (offset == 0x400000/2) return 0x9000; + if (offset == 0x401000/2) return 0xd300; return m_rom[MD_ADDR(offset)]; } @@ -687,8 +687,8 @@ READ16_MEMBER(md_rom_mjlov_device::read) READ16_MEMBER(md_rom_sbubl_device::read) { - if (offset == 0x400000/2) return 0x5500; - if (offset == 0x400002/2) return 0x0f00; + if (offset == 0x400000/2) return 0x5500; + if (offset == 0x400002/2) return 0x0f00; return m_rom[MD_ADDR(offset)]; } @@ -698,9 +698,9 @@ READ16_MEMBER(md_rom_sbubl_device::read) READ16_MEMBER(md_rom_soulb_device::read) { - if (offset == 0x400002/2) return 0x9800; - if (offset == 0x400004/2) return 0xc900; - if (offset == 0x400006/2) return 0xf000; + if (offset == 0x400002/2) return 0x9800; + if (offset == 0x400004/2) return 0xc900; + if (offset == 0x400006/2) return 0xf000; return m_rom[MD_ADDR(offset)]; } @@ -727,9 +727,9 @@ WRITE16_MEMBER(md_rom_pokestad_device::write) READ16_MEMBER(md_rom_realtec_device::read) { - if (offset < (m_bank_size * 0x20000)) // two banks of same (variable) size at the bottom of the rom + if (offset < (m_bank_size * 0x20000)) // two banks of same (variable) size at the bottom of the rom return m_rom[offset + (m_bank_addr * 0x20000)/2]; - return m_rom[(offset & 0x1fff/2) + 0x7e000/2]; // otherwise it accesses the final 8k of the image + return m_rom[(offset & 0x1fff/2) + 0x7e000/2]; // otherwise it accesses the final 8k of the image } WRITE16_MEMBER(md_rom_realtec_device::write) @@ -757,8 +757,8 @@ WRITE16_MEMBER(md_rom_realtec_device::write) READ16_MEMBER(md_rom_redcl_device::read) { - if (offset == 0x400000/2) return 0x55 << 8; - if (offset == 0x400004/2) return -0x56 << 8; + if (offset == 0x400000/2) return 0x55 << 8; + if (offset == 0x400004/2) return -0x56 << 8; return m_rom[MD_ADDR(offset)]; } @@ -827,7 +827,7 @@ READ16_MEMBER(md_rom_topf_device::read) //cpu #0 (PC=0004DE00): unmapped program memory word write to 00689B80 = 004A & 00FF //cpu #0 (PC=0004DE08): unmapped program memory word write to 00 = 00B5 & 00FF //cpu #0 (PC=0004DE0C): unmapped program memory word read from 00645B44 & 00FF - + return 0x9f;//0x25; } if (offset == 0x6bd294/2) @@ -837,7 +837,7 @@ READ16_MEMBER(md_rom_topf_device::read) cpu #0 (PC=0017719A): unmapped program memory word write to 006BD2D2 = 0098 & 00FF cpu #0 (PC=001771A2): unmapped program memory word read from 006BD294 & 00FF */ - + if (space.device().safe_pc()==0x1771a2) return 0x50; else { @@ -875,9 +875,9 @@ WRITE16_MEMBER(md_rom_topf_device::write) if (offset >= 0x700000/2 && offset < 0x800000/2) { if (data == 0x002a) - m_bank[2] = 1; // == 0x2e*0x8000?! + m_bank[2] = 1; // == 0x2e*0x8000?! else if (data==0x0035) // characters ingame - m_bank[0] = 1; // == 0x35*0x8000 + m_bank[0] = 1; // == 0x35*0x8000 else if (data==0x000f) // special moves m_bank[1] = 1; // == 0xf*0x8000 else if (data==0x0000) diff --git a/src/mess/machine/md_rom.h b/src/mess/machine/md_rom.h index fd7b03d0901..acc1bff2827 100644 --- a/src/mess/machine/md_rom.h +++ b/src/mess/machine/md_rom.h @@ -10,17 +10,17 @@ // ======================> md_std_rom_device class md_std_rom_device : public device_t, - public device_md_cart_interface + public device_md_cart_interface { public: // construction/destruction md_std_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); md_std_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start() {}; virtual void device_config_complete() { m_shortname = "md_std_rom"; } - + // reading and writing virtual DECLARE_READ16_MEMBER(read) { if (offset < 0x400000/2) return m_rom[MD_ADDR(offset)]; else return 0xffff; }; virtual DECLARE_WRITE16_MEMBER(write) { }; @@ -33,10 +33,10 @@ class md_rom_sram_device : public md_std_rom_device public: // construction/destruction md_rom_sram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_config_complete() { m_shortname = "md_rom_sram"; } - + // reading and writing virtual DECLARE_READ16_MEMBER(read); virtual DECLARE_WRITE16_MEMBER(write); @@ -50,10 +50,10 @@ class md_rom_fram_device : public md_std_rom_device public: // construction/destruction md_rom_fram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_config_complete() { m_shortname = "md_rom_fram"; } - + // reading and writing virtual DECLARE_READ16_MEMBER(read); virtual DECLARE_READ16_MEMBER(read_a13); @@ -67,18 +67,18 @@ class md_rom_ssf2_device : public md_std_rom_device public: // construction/destruction md_rom_ssf2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_config_complete() { m_shortname = "md_rom_ssf2"; } - + // reading and writing virtual DECLARE_READ16_MEMBER(read); virtual DECLARE_WRITE16_MEMBER(write_a13); private: UINT8 m_bank[16]; - int m_lastoff, m_lastdata; + int m_lastoff, m_lastdata; }; // ======================> md_rom_mcpirate_device @@ -88,15 +88,15 @@ class md_rom_mcpirate_device : public md_std_rom_device public: // construction/destruction md_rom_mcpirate_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_config_complete() { m_shortname = "md_rom_mcpirate"; } - + // reading and writing virtual DECLARE_READ16_MEMBER(read); virtual DECLARE_WRITE16_MEMBER(write_a13); - + private: UINT8 m_bank; }; @@ -109,10 +109,10 @@ class md_rom_bugslife_device : public md_std_rom_device public: // construction/destruction md_rom_bugslife_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_config_complete() { m_shortname = "md_rom_bugslife"; } - + // reading and writing virtual DECLARE_READ16_MEMBER(read_a13); }; @@ -124,15 +124,15 @@ class md_rom_chinf3_device : public md_std_rom_device public: // construction/destruction md_rom_chinf3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_config_complete() { m_shortname = "md_rom_chinf3"; } - + // reading and writing virtual DECLARE_READ16_MEMBER(read); virtual DECLARE_WRITE16_MEMBER(write); - + private: int m_bank; }; @@ -144,10 +144,10 @@ class md_rom_elfwor_device : public md_std_rom_device public: // construction/destruction md_rom_elfwor_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_config_complete() { m_shortname = "md_rom_elfwor"; } - + // reading and writing virtual DECLARE_READ16_MEMBER(read); }; @@ -159,10 +159,10 @@ class md_rom_yasech_device : public md_std_rom_device public: // construction/destruction md_rom_yasech_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_config_complete() { m_shortname = "md_rom_yasech"; } - + // reading and writing virtual DECLARE_READ16_MEMBER(read); }; @@ -174,10 +174,10 @@ class md_rom_kof98_device : public md_std_rom_device public: // construction/destruction md_rom_kof98_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_config_complete() { m_shortname = "md_rom_kof98"; } - + // reading and writing virtual DECLARE_READ16_MEMBER(read); }; @@ -189,10 +189,10 @@ class md_rom_kof99_device : public md_std_rom_device public: // construction/destruction md_rom_kof99_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_config_complete() { m_shortname = "md_rom_kof99"; } - + // reading and writing virtual DECLARE_READ16_MEMBER(read_a13); }; @@ -204,15 +204,15 @@ class md_rom_lion2_device : public md_std_rom_device public: // construction/destruction md_rom_lion2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_config_complete() { m_shortname = "md_rom_lion2"; } - + // reading and writing virtual DECLARE_READ16_MEMBER(read); virtual DECLARE_WRITE16_MEMBER(write); - + private: UINT16 m_prot1_data, m_prot2_data; }; @@ -224,17 +224,17 @@ class md_rom_lion3_device : public md_std_rom_device public: // construction/destruction md_rom_lion3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_config_complete() { m_shortname = "md_rom_lion3"; } - + // reading and writing virtual DECLARE_READ16_MEMBER(read); virtual DECLARE_WRITE16_MEMBER(write); - + private: - UINT8 m_prot_data, m_prot_cmd; + UINT8 m_prot_data, m_prot_cmd; UINT16 m_bank; }; @@ -245,10 +245,10 @@ class md_rom_mjlov_device : public md_std_rom_device public: // construction/destruction md_rom_mjlov_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_config_complete() { m_shortname = "md_rom_mjlov"; } - + // reading and writing virtual DECLARE_READ16_MEMBER(read); }; @@ -260,15 +260,15 @@ class md_rom_pokestad_device : public md_std_rom_device public: // construction/destruction md_rom_pokestad_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_config_complete() { m_shortname = "md_rom_pokestad"; } - + // reading and writing virtual DECLARE_READ16_MEMBER(read); virtual DECLARE_WRITE16_MEMBER(write); - + private: UINT8 m_bank; }; @@ -280,15 +280,15 @@ class md_rom_realtec_device : public md_std_rom_device public: // construction/destruction md_rom_realtec_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_config_complete() { m_shortname = "md_rom_realtec"; } - + // reading and writing virtual DECLARE_READ16_MEMBER(read); virtual DECLARE_WRITE16_MEMBER(write); - + private: UINT16 m_bank_addr, m_bank_size, m_old_bank_addr; }; @@ -300,10 +300,10 @@ class md_rom_redcl_device : public md_std_rom_device public: // construction/destruction md_rom_redcl_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_config_complete() { m_shortname = "md_rom_redcl"; } - + // reading and writing virtual DECLARE_READ16_MEMBER(read); }; @@ -315,10 +315,10 @@ class md_rom_rx3_device : public md_std_rom_device public: // construction/destruction md_rom_rx3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_config_complete() { m_shortname = "md_rom_rx3"; } - + // reading and writing virtual DECLARE_READ16_MEMBER(read_a13); }; @@ -330,10 +330,10 @@ class md_rom_sbubl_device : public md_std_rom_device public: // construction/destruction md_rom_sbubl_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_config_complete() { m_shortname = "md_rom_sbubl"; } - + // reading and writing virtual DECLARE_READ16_MEMBER(read); }; @@ -345,10 +345,10 @@ class md_rom_smb_device : public md_std_rom_device public: // construction/destruction md_rom_smb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_config_complete() { m_shortname = "md_rom_smb"; } - + // reading and writing virtual DECLARE_READ16_MEMBER(read_a13); }; @@ -360,10 +360,10 @@ class md_rom_smb2_device : public md_std_rom_device public: // construction/destruction md_rom_smb2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_config_complete() { m_shortname = "md_rom_smb2"; } - + // reading and writing virtual DECLARE_READ16_MEMBER(read_a13); }; @@ -375,10 +375,10 @@ class md_rom_smouse_device : public md_std_rom_device public: // construction/destruction md_rom_smouse_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_config_complete() { m_shortname = "md_rom_smouse"; } - + // reading and writing virtual DECLARE_READ16_MEMBER(read); }; @@ -391,10 +391,10 @@ class md_rom_soulb_device : public md_std_rom_device public: // construction/destruction md_rom_soulb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_config_complete() { m_shortname = "md_rom_soulb"; } - + // reading and writing virtual DECLARE_READ16_MEMBER(read); }; @@ -406,17 +406,17 @@ class md_rom_squir_device : public md_std_rom_device public: // construction/destruction md_rom_squir_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_config_complete() { m_shortname = "md_rom_squir"; } - + // reading and writing virtual DECLARE_READ16_MEMBER(read); virtual DECLARE_WRITE16_MEMBER(write); - + private: - UINT16 m_latch; + UINT16 m_latch; }; // ======================> md_rom_topf_device @@ -426,18 +426,18 @@ class md_rom_topf_device : public md_std_rom_device public: // construction/destruction md_rom_topf_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_config_complete() { m_shortname = "md_rom_topf"; } - + // reading and writing virtual DECLARE_READ16_MEMBER(read); virtual DECLARE_WRITE16_MEMBER(write); - + private: - UINT16 m_latch; - UINT8 m_bank[3]; + UINT16 m_latch; + UINT8 m_bank[3]; }; // ======================> md_rom_radica_device @@ -447,17 +447,17 @@ class md_rom_radica_device : public md_std_rom_device public: // construction/destruction md_rom_radica_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_config_complete() { m_shortname = "md_rom_radica"; } - + // reading and writing virtual DECLARE_READ16_MEMBER(read); virtual DECLARE_READ16_MEMBER(read_a13); - + private: - UINT8 m_bank; + UINT8 m_bank; }; diff --git a/src/mess/machine/md_sk.c b/src/mess/machine/md_sk.c index e2b38b7da47..f5377207d91 100644 --- a/src/mess/machine/md_sk.c +++ b/src/mess/machine/md_sk.c @@ -1,13 +1,13 @@ /*********************************************************************************************************** - - + + Sonic & Knuckles pass-thorugh cart emulation - + TODO: currently we only support loading of base carts with no bankswitch or protection... shall we support other as well? - - + + ***********************************************************************************************************/ @@ -52,9 +52,9 @@ READ16_MEMBER(md_rom_sk_device::read) { if (m_exp->m_cart != NULL && m_exp->m_cart->get_rom_base() != NULL && offset >= 0x200000/2 && offset < (0x200000 + m_exp->m_cart->get_rom_size())/2) return m_exp->m_cart->m_rom[offset - 0x200000/2]; - if (offset < 0x400000/2) - return m_rom[MD_ADDR(offset)]; - else + if (offset < 0x400000/2) + return m_rom[MD_ADDR(offset)]; + else return 0xffff; } @@ -90,4 +90,3 @@ machine_config_constructor md_rom_sk_device::device_mconfig_additions() const { return MACHINE_CONFIG_NAME( sk_slot ); } - diff --git a/src/mess/machine/md_sk.h b/src/mess/machine/md_sk.h index 6a765a2b920..58427fa9442 100644 --- a/src/mess/machine/md_sk.h +++ b/src/mess/machine/md_sk.h @@ -7,18 +7,18 @@ // ======================> md_rom_sk_device class md_rom_sk_device : public device_t, - public device_md_cart_interface + public device_md_cart_interface { public: // construction/destruction md_rom_sk_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); md_rom_sk_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_config_complete() { m_shortname = "md_rom_sk"; } virtual machine_config_constructor device_mconfig_additions() const; - + // reading and writing virtual DECLARE_READ16_MEMBER(read); virtual DECLARE_WRITE16_MEMBER(write); diff --git a/src/mess/machine/md_slot.c b/src/mess/machine/md_slot.c index 2ab615dddd5..27a59038426 100644 --- a/src/mess/machine/md_slot.c +++ b/src/mess/machine/md_slot.c @@ -1,43 +1,43 @@ /*********************************************************************************************************** - + MegaDrive cart emulation (through slot devices) The driver exposes address ranges - 0x000000-0x7fffff to read/write (typically cart data, possibly banked, and some protection) - 0x130000-0x1300ff to read_a13/write_a13 (typically SRAM toggling or protection) - 0x150000-0x1500ff to read_a15/write_a15 (for SVP registers, not converted yet to slots) - + 0x000000-0x7fffff to read/write (typically cart data, possibly banked, and some protection) + 0x130000-0x1300ff to read_a13/write_a13 (typically SRAM toggling or protection) + 0x150000-0x1500ff to read_a15/write_a15 (for SVP registers, not converted yet to slots) + currently available slot devices: md_rom: standard carts + carts with NVRAM (SRAM/FRAM) + pirate carts with protection & bankswitch md_eeprom: carts + I2C EEPROM (EEPROM device hooked up only, support to be completed) - md_jcart: Codemasters J-Cart & J-Cart+SEPROM (again, EEPROM device hooked up only, support to be completed) - md_sk: Sonic & Knuckles pass-thorugh cart (enables a second slot to mount any other cart) - md_stm95: cart + STM95 EEPROM (e.g. Pier Solar) - - - Cart Mirroring (based Eke's research) - - MD Cartridge area is mapped to $000000-$3fffff: when accessing ROM, 68k address lines A1 to A21 can be - used by the internal cartridge hardware to decode full 4MB address range. - Depending on ROM total size and additional decoding hardware, some address lines might be ignored, - resulting in ROM mirroring. - - Cartridges typically use either 8-bits (x2) or 16-bits (x1, x2) Mask ROM chips, each chip size is a - factor of 2 bytes. - When one chip ROM1 of size 2^N is present, it is generally mirrored each 2^N bytes so that read access - to cart area sees the sequence ROM1,ROM1,ROM1,... (up to 4MB) - When two chips ROM1 & ROM2 are present and the whole size is 2^N, then the block ROM1+ROM2 is mirrored - in the cart area, and reads see the sequence ROM1+ROM2,ROM1+ROM2,... (up to 4MB) - When two chips ROM1 & ROM2 are present and the whole size is not 2^N (e.g. because ROM1 and ROM2 have - different sizes), then the area between the end of ROM2 and next power 2^N is generally ignored, and - reads see the sequence ROM1,ROM2,XXXX,ROM1,ROM2,XXXX... (up to 4MB) - - At loading time we first compute first power 2^N larger than cart size (see get_padded_size function), - we allocate such a size for ROM and we fill of 0xff the area between end of dump and 2^N. - Then we handle mirroring by creating a rom_bank_map[] (see rom_map_setup function) which points each - access in 0x000000-0x400000 to the correct 64K ROM bank. + md_jcart: Codemasters J-Cart & J-Cart+SEPROM (again, EEPROM device hooked up only, support to be completed) + md_sk: Sonic & Knuckles pass-thorugh cart (enables a second slot to mount any other cart) + md_stm95: cart + STM95 EEPROM (e.g. Pier Solar) + + + Cart Mirroring (based Eke's research) + + MD Cartridge area is mapped to $000000-$3fffff: when accessing ROM, 68k address lines A1 to A21 can be + used by the internal cartridge hardware to decode full 4MB address range. + Depending on ROM total size and additional decoding hardware, some address lines might be ignored, + resulting in ROM mirroring. + + Cartridges typically use either 8-bits (x2) or 16-bits (x1, x2) Mask ROM chips, each chip size is a + factor of 2 bytes. + When one chip ROM1 of size 2^N is present, it is generally mirrored each 2^N bytes so that read access + to cart area sees the sequence ROM1,ROM1,ROM1,... (up to 4MB) + When two chips ROM1 & ROM2 are present and the whole size is 2^N, then the block ROM1+ROM2 is mirrored + in the cart area, and reads see the sequence ROM1+ROM2,ROM1+ROM2,... (up to 4MB) + When two chips ROM1 & ROM2 are present and the whole size is not 2^N (e.g. because ROM1 and ROM2 have + different sizes), then the area between the end of ROM2 and next power 2^N is generally ignored, and + reads see the sequence ROM1,ROM2,XXXX,ROM1,ROM2,XXXX... (up to 4MB) + + At loading time we first compute first power 2^N larger than cart size (see get_padded_size function), + we allocate such a size for ROM and we fill of 0xff the area between end of dump and 2^N. + Then we handle mirroring by creating a rom_bank_map[] (see rom_map_setup function) which points each + access in 0x000000-0x400000 to the correct 64K ROM bank. ***********************************************************************************************************/ @@ -108,17 +108,17 @@ void device_md_cart_interface::nvram_alloc(running_machine &machine, size_t size } //------------------------------------------------- -// rom_map_setup - setup map of rom banks in 64K +// rom_map_setup - setup map of rom banks in 64K // blocks, so to simplify ROM mirroring //------------------------------------------------- void device_md_cart_interface::rom_map_setup(UINT32 size) { int i; - // setup the rom_bank_map array to faster ROM read + // setup the rom_bank_map array to faster ROM read for (i = 0; i < size / 0x10000; i++) rom_bank_map[i] = i; - + // fill up remaining blocks with mirrors while (i % 64) { @@ -130,19 +130,19 @@ void device_md_cart_interface::rom_map_setup(UINT32 size) rom_bank_map[i + k] = rom_bank_map[i + k - repeat_banks]; i += repeat_banks; } - + // check bank map! -// for (i = 0; i < 64; i++) -// { -// printf("bank %3d = %3d\t", i, rom_bank_map[i]); -// if ((i%8) == 7) -// printf("\n"); -// } +// for (i = 0; i < 64; i++) +// { +// printf("bank %3d = %3d\t", i, rom_bank_map[i]); +// if ((i%8) == 7) +// printf("\n"); +// } } //------------------------------------------------- -// -// +// +// //------------------------------------------------- UINT32 device_md_cart_interface::get_padded_size(UINT32 size) @@ -235,13 +235,13 @@ static const md_slot slot_list[] = { { SEGA_SK, "rom_sk" }, { SEGA_STD, "rom_svp"}, -// { SEGA_SVP, "rom_svp"}, // not ready yet... +// { SEGA_SVP, "rom_svp"}, // not ready yet... { SEGA_SRAM, "rom_sram" }, { SEGA_FRAM, "rom_fram" }, { HARDBALL95, "rom_hardbl95" }, { BEGGAR, "rom_beggar"}, - + { SEGA_EEPROM, "rom_eeprom" }, { NBA_JAM, "rom_nbajam" }, { NBA_JAM_TE, "rom_nbajamte" }, @@ -249,17 +249,17 @@ static const md_slot slot_list[] = { C_SLAM, "rom_cslam" }, { EA_NHLPA, "rom_nhlpa" }, { BRIAN_LARA, "rom_blara" }, - + { CM_JCART, "rom_jcart" }, { CODE_MASTERS, "rom_codemast" }, { CM_MM96, "rom_mm96" }, { PSOLAR, "rom_stm95"}, - + { SSF2, "rom_ssf2" }, { RADICA, "rom_radica" }, -// { GAME_KANDUME, "rom_gkand" }, // what's needed by this? - +// { GAME_KANDUME, "rom_gkand" }, // what's needed by this? + { BUGSLIFE, "rom_bugs" }, { CHINFIGHT3, "rom_chinf3" }, { ELFWOR, "rom_elfwor" }, @@ -296,7 +296,7 @@ static int md_get_pcb_id(const char *slot) if (!mame_stricmp(slot_list[i].slot_option, slot)) return slot_list[i].pcb_id; } - + return SEGA_STD; } @@ -307,7 +307,7 @@ static const char *md_get_slot(int type) if (slot_list[i].pcb_id == type) return slot_list[i].slot_option; } - + return "rom"; } @@ -327,7 +327,7 @@ bool base_md_cart_slot_device::call_load() { m_type = SEGA_STD; int res; - + // STEP 1: load the file image and keep a copy for later banking // STEP 2: identify the cart type // The two steps are carried out differently if we are loading from a list or not @@ -335,14 +335,14 @@ bool base_md_cart_slot_device::call_load() res = load_nonlist(); else res = load_list(); - + //printf("cart type: %d\n", m_type); - + if (res == IMAGE_INIT_PASS) { // STEP 3: install memory handlers for this type of cart setup_custom_mappers(); - + // STEP 4: take care of SRAM. setup_nvram(); @@ -353,7 +353,7 @@ bool base_md_cart_slot_device::call_load() return res; } - + return IMAGE_INIT_PASS; } @@ -374,7 +374,7 @@ int base_md_cart_slot_device::load_list() // if we allocated a ROM larger that the file (e.g. due to uneven cart size), set remaining space to 0xff if (length > get_software_region_length("rom")) memset(ROM + get_software_region_length("rom")/2, 0xffff, (length - get_software_region_length("rom"))/2); - + if ((slot_name = get_feature("slot")) == NULL) m_type = SEGA_STD; else @@ -401,57 +401,57 @@ static int genesis_is_SMD(unsigned char *buf,unsigned int len) /* aq quiz */ if (!strncmp("UZ(-01 ", (const char *) &buf[0xf0], 8)) return 1; - + /* Phelios USA redump */ /* target earth */ /* klax (namcot) */ if (buf[0x2080] == ' ' && buf[0x0080] == 'S' && buf[0x2081] == 'E' && buf[0x0081] == 'G') return 1; - + /* jap baseball 94 */ if (!strncmp("OL R-AEAL", (const char *) &buf[0xf0], 9)) return 1; - + /* devilish Mahjong Tower */ if (!strncmp("optrEtranet", (const char *) &buf[0xf3], 11)) return 1; - + /* golden axe 2 beta */ if (buf[0x0100] == 0x3c && buf[0x0101] == 0 && buf[0x0102] == 0 && buf[0x0103] == 0x3c) return 1; - + /* omega race */ if (!strncmp("OEARC ", (const char *) &buf[0x90], 8)) return 1; - + /* budokan beta */ if ((len >= 0x6708 + 8) && !strncmp(" NTEBDKN", (const char *) &buf[0x6708], 8)) return 1; - + /* cdx pro 1.8 bios */ if (!strncmp("so fCXP", (const char *) &buf[0x2c0], 7)) return 1; - + /* ishido (hacked) */ if (!strncmp("sio-Wyo ", (const char *) &buf[0x0090], 8)) return 1; - + /* onslaught */ if (!strncmp("SS CAL ", (const char *) &buf[0x0088], 8)) return 1; - + /* tram terror pirate */ if ((len >= 0x3648 + 8) && !strncmp("SG NEPIE", (const char *) &buf[0x3648], 8)) return 1; - + /* breath of fire 3 chinese */ if (buf[0x0007] == 0x1c && buf[0x0008] == 0x0a && buf[0x0009] == 0xb8 && buf[0x000a] == 0x0a) return 1; - + /*tetris pirate */ if ((len >= 0x1cbe + 5) && !strncmp("@TTI>", (const char *) &buf[0x1cbe], 5)) return 1; - + return 0; } @@ -463,14 +463,14 @@ static int genesis_is_SMD(unsigned char *buf,unsigned int len) int base_md_cart_slot_device::load_nonlist() { unsigned char *ROM, *tmpROM; - UINT32 len = m_cart->get_padded_size(length()); // if cart size is not (2^n * 64K), the system will see anyway that size so we need to alloc a bit more space + UINT32 len = m_cart->get_padded_size(length()); // if cart size is not (2^n * 64K), the system will see anyway that size so we need to alloc a bit more space // this contains an hack for SSF2: its current bankswitch code needs larger rom space to work m_cart->rom_alloc(machine(), (len == 0x500000) ? 0x900000 : len); ROM = (unsigned char *)m_cart->get_rom_base(); tmpROM = global_alloc_array(unsigned char, len); - + // STEP 1: determine the file type (SMD? MD? BIN?) fread(tmpROM, len); @@ -478,7 +478,7 @@ int base_md_cart_slot_device::load_nonlist() if (genesis_is_SMD(&tmpROM[0x200], len)) { mame_printf_debug("SMD!\n"); - + for (int ptr = 0; ptr < (len - 0x200) / 0x2000; ptr += 2) { for (int x = 0; x < 0x2000; x++) @@ -487,14 +487,14 @@ int base_md_cart_slot_device::load_nonlist() *ROM++ = *(tmpROM + 0x200 + ((ptr + 0) * 0x2000) + x); } } - + len -= 0x200; } /* is this a MD file? */ else if ((tmpROM[0x80] == 'E') && (tmpROM[0x81] == 'A') && (tmpROM[0x82] == 'M' || tmpROM[0x82] == 'G')) { mame_printf_debug("MD!\n"); - + for (int ptr = 0; ptr < len; ptr += 2) { ROM[ptr] = tmpROM[(len >> 1) + (ptr >> 1)]; @@ -509,18 +509,18 @@ int base_md_cart_slot_device::load_nonlist() } global_free(tmpROM); - + // if we allocated a ROM larger that the file (e.g. due to uneven cart size), set remaining space to 0xff if (len > length()) memset(m_cart->get_rom_base() + length()/2, 0xffff, (len - length())/2); - + // STEP 2: determine the cart type (to deal with pirate mappers & eeprom) m_type = get_cart_type(ROM, length()); // handle mirroring of ROM, unless it's SSF2 or Pier Solar if (m_type != SSF2 && m_type != PSOLAR) m_cart->rom_map_setup(len); - + #ifdef LSB_FIRST unsigned char fliptemp; // is this really needed nowadays? @@ -530,7 +530,7 @@ int base_md_cart_slot_device::load_nonlist() ROM[ptr] = ROM[ptr+1]; ROM[ptr+1] = fliptemp; } -#endif +#endif return IMAGE_INIT_PASS; } @@ -588,7 +588,7 @@ void base_md_cart_slot_device::setup_custom_mappers() 006036:e000 002540:6026 001ed0:6026 - 002476:6022 + 002476:6022 */ ROM16[0x06036/2] = 0xe000; ROM16[0x02540/2] = 0x6026; @@ -605,7 +605,7 @@ void base_md_cart_slot_device::setup_custom_mappers() // ROM16[0x02540/2] = 0xe000; ROM16[0x06036/2] = 0xe000; break; - } + } } void base_md_cart_slot_device::setup_nvram() @@ -623,21 +623,21 @@ void base_md_cart_slot_device::setup_nvram() m_cart->m_nvram_start = (ROM[0x1b5] << 24 | ROM[0x1b4] << 16 | ROM[0x1b7] << 8 | ROM[0x1b6]); m_cart->m_nvram_end = (ROM[0x1b9] << 24 | ROM[0x1b8] << 16 | ROM[0x1bb] << 8 | ROM[0x1ba]); logerror("SRAM detected from header: starting location %X - SRAM Length %X\n", m_cart->m_nvram_start, m_cart->m_nvram_end - m_cart->m_nvram_start + 1); - + // We assume at most 64k of SRAM. is this correct? - if ((m_cart->m_nvram_start > m_cart->m_nvram_end) || ((m_cart->m_nvram_end - m_cart->m_nvram_start) >= 0x10000)) + if ((m_cart->m_nvram_start > m_cart->m_nvram_end) || ((m_cart->m_nvram_end - m_cart->m_nvram_start) >= 0x10000)) m_cart->m_nvram_end = m_cart->m_nvram_start + 0xffff; - + if (m_cart->m_nvram_start & 1) m_cart->m_nvram_start -= 1; - + if (!(m_cart->m_nvram_end & 1)) m_cart->m_nvram_end += 1; - + m_cart->nvram_alloc(machine(), m_cart->m_nvram_end - m_cart->m_nvram_start + 1); if (m_cart->m_rom_size <= m_cart->m_nvram_start) m_cart->m_nvram_active = 1; - m_cart->m_nvram_handlers_installed = 1; + m_cart->m_nvram_handlers_installed = 1; // don't trust too much header? m_cart->m_nvram_start &= 0x3fffff; m_cart->m_nvram_end &= 0x3fffff; @@ -649,7 +649,7 @@ void base_md_cart_slot_device::setup_nvram() if (m_cart->m_rom_size <= m_cart->m_nvram_start) m_cart->m_nvram_active = 1; break; - + // These types only come from softlist loading case SEGA_SRAM: m_cart->m_nvram_start = 0x200000; @@ -666,7 +666,7 @@ void base_md_cart_slot_device::setup_nvram() m_cart->m_nvram_active = 1; m_cart->m_nvram_handlers_installed = 1; break; - + // These types might come from both (pending proper id routines) case HARDBALL95: m_cart->m_nvram_start = 0x300000; @@ -724,151 +724,151 @@ int base_md_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len) soulb_sig[] = { 0x33, 0xfc, 0x00, 0x0c, 0x00, 0xff }, // move.w #$C,($FF020A).l (what happens if check fails) s19in1_sig[] = { 0x13, 0xc0, 0x00, 0xa1, 0x30, 0x38 }, rockman_sig[] = { 0xea, 0x80 }; - + switch (len) - { + { case 0x80000: if (!memcmp(&ROM[0x08c8], smouse_sig, sizeof(smouse_sig))) type = SMOUSE; - + if (!memcmp((char *)&ROM[0x7e30e], "SEGA", 4) || !memcmp((char *)&ROM[0x7e100], "SEGA", 4) || !memcmp((char *)&ROM[0x7e1e6], "SEGA", 4)) type = REALTEC; - + if (!memcmp((char *)&ROM[0x0180], "GM T-50396", 10)) // NHLPA Hockey 93 type = EA_NHLPA; - + if (!memcmp((char *)&ROM[0x0180], "GM MK-1215", 10)) // Evander Holyfield type = SEGA_EEPROM; break; - + case 0xc0000: - + if (!memcmp((char *)&ROM[0x0180], "GM G-4060 ", 8)) // Wonder Boy V type = SEGA_EEPROM; break; - + case 0x100000: if (!memcmp(&ROM[0x01b24], mjlover_sig, sizeof(mjlover_sig))) type = MJLOVER; - + if (!memcmp(&ROM[0x03b4], squir_sig, sizeof(squir_sig))) type = SQUIRRELK; - + if (!memcmp(&ROM[0xee0d0], bugsl_sig, sizeof(bugsl_sig))) type = BUGSLIFE; - + if (!memcmp((char *)&ROM[0x0172], "GAME : ELF WOR", 14)) type = ELFWOR; - + if (!memcmp(&ROM[0x123e4], sbub_sig, sizeof(sbub_sig))) type = SBUBBOB; - + if (!memcmp((char *)&ROM[0x0180], "GM T-50176", 10)) // Rings of Power type = EA_NHLPA; - + if (!memcmp((char *)&ROM[0x0180], "MK 00001211-00", 14)) // Sports Talk Baseball type = SEGA_EEPROM; - + if (!memcmp((char *)&ROM[0x0180], "GM T-120096-", 12)) // Micro Machines 2 type = CODE_MASTERS; - + if (!memcmp((char *)&ROM[0x0180], "GM T-120146-", 12)) // Brian Lara Cricket 96 / Shane Wayne Cricket 96 type = BRIAN_LARA; - + if (!memcmp((char *)&ROM[0x0190], "OJKRPTBVFCA ", 0x10)) // Micro Machines '96 / Military TODO: better way to recognize these? type = CODE_MASTERS; break; - + case 0x200000: if (!memcmp(&ROM[0x18c6], lk3_sig, sizeof(lk3_sig))) type = LIONK3; - + if (!memcmp(&ROM[0x220], sdk_sig, sizeof(sdk_sig))) type = LIONK3; - + if (!memcmp(&ROM[0xce560], redcliff_sig, sizeof(redcliff_sig))) type = REDCLIFF; - + if (!memcmp(&ROM[0xc8cb0], smb_sig, sizeof(smb_sig))) type = SMB; - + if (!memcmp(&ROM[0xf24d6], smb2_sig, sizeof(smb2_sig))) type = SMB2; - + if (!memcmp(&ROM[0x674e], kaiju_sig, sizeof(kaiju_sig))) type = KAIJU; - + if (!memcmp(&ROM[0x1780], chifi3_sig, sizeof(chifi3_sig))) type = CHINFIGHT3; - + if (!memcmp(&ROM[0x03c2], lionk2_sig, sizeof(lionk2_sig))) type = LIONK2; - + if (!memcmp(&ROM[0xc8b90], rx3_sig, sizeof(rx3_sig))) type = ROCKMANX3; - + if (!memcmp(&ROM[0x56ae2], kof98_sig, sizeof(kof98_sig))) type = KOF98; - + if (!memcmp(&ROM[0x17bb2], s15in1_sig, sizeof(s15in1_sig))) type = MC_PIRATE; - + if (!memcmp((char *)&ROM[0x0180], "GM T-081326 ", 12)) // NBA Jam type = NBA_JAM; - + if (!memcmp((char *)&ROM[0x0180], "GM MK-1228", 10)) // Greatest Heavyweight of the Ring type = SEGA_EEPROM; - + if ((!memcmp((char *)&ROM[0x0180], "GM T-12046", 10)) || // Mega Man (!memcmp((char *)&ROM[0x0180], "GM T-12053", 10) && !memcmp(&ROM[0x18e], rockman_sig, sizeof(rockman_sig)))) // / Rock Man (EEPROM version) type = SEGA_EEPROM; - + break; - + case 0x200005: if (!memcmp(&ROM[0xce564], redcl_en_sig, sizeof(redcliff_sig))) type = REDCL_EN; break; - + case 0x300000: if (!memcmp(&ROM[0x220], sdk_sig, sizeof(sdk_sig))) type = LIONK3; - + if (!memcmp(&ROM[0x1fd0d2], kof99_sig, sizeof(kof99_sig))) type = KOF99; - + if (!memcmp((char *)&ROM[0x0180], "GM T-81406", 10)) // NBA Jam TE type = NBA_JAM_TE; - + if (!memcmp((char *)&ROM[0x0180], "GM T-081276 ", 12)) // NFL Quarterback Club type = NBA_JAM_TE; - + break; - + case 0x400000: if (!memcmp(&ROM[0x3c031c], radica_sig, sizeof(radica_sig)) || !memcmp(&ROM[0x3f031c], radica_sig, sizeof(radica_sig))) // ssf+gng + radica vol1 type = RADICA; - + if (!memcmp(&ROM[0x028460], soulb_sig, sizeof(soulb_sig))) type = SOULBLAD; - + if (!memcmp(&ROM[0x1e700], s19in1_sig, sizeof(s19in1_sig))) type = MC_PIRATE; - + if (!memcmp((char *)&ROM[0x0180], "GM T-081586-", 12)) // NFL Quarterback Club 96 type = NFL_QB_96; - + if (!memcmp((char *)&ROM[0x0180], "GM T-081576 ", 12)) // College Slam type = C_SLAM; - + if (!memcmp((char *)&ROM[0x0180], "GM T-81476", 10)) // Big Hurt Baseball type = C_SLAM; - + break; - + case 0x500000: if (!memcmp((char *)&ROM[0x0120], "SUPER STREET FIGHTER2 ", 22)) type = SSF2; @@ -886,15 +886,15 @@ int base_md_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len) //check for SRAM among the general carts if (type == SEGA_STD) { - // If the cart is not of a special type, we check the header for SRAM. + // If the cart is not of a special type, we check the header for SRAM. if (ROM[0x1b1] == 'R' && ROM[0x1b0] == 'A') { UINT32 start, end; start = (ROM[0x1b5] << 24 | ROM[0x1b4] << 16 | ROM[0x1b7] << 8 | ROM[0x1b6]); end = (ROM[0x1b9] << 24 | ROM[0x1b8] << 16 | ROM[0x1bb] << 8 | ROM[0x1ba]); logerror("SRAM detected from header: starting location %X - SRAM Length %X\n", start, end - start + 1); - - // For some games using serial EEPROM, difference between SRAM end to start is 0 or 1. + + // For some games using serial EEPROM, difference between SRAM end to start is 0 or 1. // Carts with EEPROM should have been already detected above, but better safe than sorry if (end - start < 2) type = SEGA_EEPROM; @@ -904,12 +904,12 @@ int base_md_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len) else { // Unfortunately, there are ROMs without correct info in the header, - // Hence, when loading from fullpath we do the SRAM mapping anyway... + // Hence, when loading from fullpath we do the SRAM mapping anyway... // but treat it in a custom way type = SEGA_SRAM_FALLBACK; } } - + return type; } /*------------------------------------------------- @@ -925,15 +925,15 @@ const char * base_md_cart_slot_device::get_default_card_software(const machine_c UINT32 len = core_fsize(m_file); UINT8 *ROM = global_alloc_array(UINT8, len); int type; - + core_fread(m_file, ROM, len); - + type = get_cart_type(ROM, len); slot_string = md_get_slot(type); - + global_free(ROM); clear(); - + return slot_string; } else @@ -992,4 +992,3 @@ WRITE16_MEMBER(base_md_cart_slot_device::write_a15) if (m_cart) m_cart->write_a15(space, offset, data); } - diff --git a/src/mess/machine/md_slot.h b/src/mess/machine/md_slot.h index 71aa50d5167..884c175a707 100644 --- a/src/mess/machine/md_slot.h +++ b/src/mess/machine/md_slot.h @@ -22,7 +22,7 @@ enum SEGA_SRAM, SEGA_FRAM, HARDBALL95, /* Hardball 95 uses different sram start address */ BEGGAR, /* Xin Qigai Wangzi uses different sram start address and has no valid header */ - + // EEPROM SEGA_EEPROM, /* Wonder Boy V / Evander Holyfield's Boxing / Greatest Heavyweights of the Ring / Sports Talk Baseball / Megaman */ NBA_JAM, /* NBA Jam */ @@ -37,12 +37,12 @@ enum CM_JCART, /* Pete Sampras Tennis */ CODE_MASTERS, /* Micro Machines 2 / Military (J-Cart + SEPROM) */ CM_MM96, /* Micro Machines 96 (J-Cart + SEPROM, diff I2C model) */ - + // Various SSF2, /* Super Street Fighter 2 */ GAME_KANDUME, /* Game no Kandume Otokuyou */ RADICA, /* Radica TV games.. these probably should be a separate driver since they are a separate 'console' */ - + BUGSLIFE, /* A Bug's Life */ CHINFIGHT3, /* Chinese Fighters 3 */ ELFWOR, /* Linghuan Daoshi Super Magician */ @@ -107,13 +107,13 @@ public: virtual UINT16* get_nvram_base() { return m_nvram; }; virtual UINT32 get_rom_size() { return m_rom_size; }; virtual UINT32 get_nvram_size() { return m_nvram_size; }; - - virtual void rom_map_setup(UINT32 size); + + virtual void rom_map_setup(UINT32 size); virtual UINT32 get_padded_size(UINT32 size); - + int m_nvram_start, m_nvram_end; int m_nvram_active, m_nvram_readonly; - + // when loading from fullpath, we create NVRAM even if not set in the header // however in this case we access it only if the game turn it on // the variable below is basically needed to track this... @@ -124,8 +124,8 @@ public: UINT16 *m_nvram; UINT32 m_rom_size; UINT32 m_nvram_size; - - UINT8 rom_bank_map[128]; // 64K chunks of rom + + UINT8 rom_bank_map[128]; // 64K chunks of rom }; @@ -140,11 +140,11 @@ public: // construction/destruction base_md_cart_slot_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); virtual ~base_md_cart_slot_device(); - + // device-level overrides virtual void device_start(); virtual void device_config_complete(); - + // image-level overrides virtual bool call_load(); virtual void call_unload(); @@ -165,10 +165,10 @@ public: virtual bool must_be_loaded() const { return 1; } virtual bool is_reset_on_load() const { return 0; } virtual const option_guide *create_option_guide() const { return NULL; } - + // slot interface overrides virtual const char * get_default_card_software(const machine_config &config, emu_options &options); - + // reading and writing virtual DECLARE_READ16_MEMBER(read); virtual DECLARE_WRITE16_MEMBER(write); @@ -181,8 +181,8 @@ public: // this should be private, but then there is some problem installing delegates in the driver... //private: - device_md_cart_interface* m_cart; - + device_md_cart_interface* m_cart; + int m_type; }; @@ -225,7 +225,7 @@ public: // device type definition extern const device_type MD_CART_SLOT; -extern const device_type MD_SUBCART_SLOT; // needed to allow S&K pass-through to have non-mandatory cart +extern const device_type MD_SUBCART_SLOT; // needed to allow S&K pass-through to have non-mandatory cart extern const device_type PICO_CART_SLOT; diff --git a/src/mess/machine/md_stm95.c b/src/mess/machine/md_stm95.c index 997cf1fdbda..36f6b87ab47 100644 --- a/src/mess/machine/md_stm95.c +++ b/src/mess/machine/md_stm95.c @@ -1,12 +1,12 @@ /*************************************************************************** - MegaDrive / Genesis Cart + STM95 EEPROM device + MegaDrive / Genesis Cart + STM95 EEPROM device + - Emulation by MetalliC, converted to slot by Fabio Priuli - + TO DO: split STM95 to a separate device... ***************************************************************************/ @@ -197,18 +197,18 @@ READ16_MEMBER(md_eeprom_stm95_device::read) UINT16 res; offset -= 0x0015e6/2; logerror("read 0x15e6 %d\n", m_rdcnt); - if (m_rdcnt < 6) + if (m_rdcnt < 6) { m_rdcnt++; res = offset ? 0x10 : 0; - } + } else res = offset ? 0x8010 : 0x0001; return res; } if (offset < 0x280000/2) return m_rom[offset]; - else // last 0x180000 are bankswitched + else // last 0x180000 are bankswitched { UINT8 bank = (offset - 0x280000/2) >> 18; return m_rom[(offset & 0x7ffff/2) + (m_bank[bank] * 0x80000)/2]; @@ -242,4 +242,3 @@ WRITE16_MEMBER(md_eeprom_stm95_device::write_a13) m_stm95.set_cs_line(BIT(data, 3)); } } - diff --git a/src/mess/machine/md_stm95.h b/src/mess/machine/md_stm95.h index 77bbad98e73..96b520ccb22 100644 --- a/src/mess/machine/md_stm95.h +++ b/src/mess/machine/md_stm95.h @@ -26,11 +26,11 @@ enum STMSTATE class stm95_eeprom_device { public: - stm95_eeprom_device() : - stm_state(IDLE), - stream_pos(0) + stm95_eeprom_device() : + stm_state(IDLE), + stream_pos(0) {}; - + UINT8 *eeprom_data; void set_cs_line(int); void set_halt_line(int state) {}; // not implemented @@ -43,7 +43,7 @@ protected: int reset_line; int sck_line; int WEL; - + STMSTATE stm_state; int stream_pos; int stream_data; @@ -54,17 +54,17 @@ protected: // ======================> md_eeprom_stm95_device class md_eeprom_stm95_device : public device_t, - public device_md_cart_interface + public device_md_cart_interface { public: // construction/destruction md_eeprom_stm95_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); md_eeprom_stm95_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - + // device-level overrides virtual void device_start(); virtual void device_config_complete() { m_shortname = "md_eeprom_stm95"; } - + // reading and writing virtual DECLARE_READ16_MEMBER(read); virtual DECLARE_READ16_MEMBER(read_a13); diff --git a/src/mess/machine/megasvp.c b/src/mess/machine/megasvp.c index bbe7e3c3827..2ce487dde99 100644 --- a/src/mess/machine/megasvp.c +++ b/src/mess/machine/megasvp.c @@ -60,12 +60,12 @@ static UINT32 pm_io(address_space &space, int reg, int write, UINT32 d) state->m_emu_status &= ~SSP_PMC_SET; return 0; } - + // just in case if (state->m_emu_status & SSP_PMC_HAVE_ADDR) { state->m_emu_status &= ~SSP_PMC_HAVE_ADDR; } - + if (reg == 4 || (space.device().state().state_int(SSP_ST) & 0x60)) { #define CADDR ((((mode<<16)&0x7f0000)|addr)<<1) @@ -98,7 +98,7 @@ static UINT32 pm_io(address_space &space, int reg, int write, UINT32 d) else { logerror("ssp FIXME: PM%i unhandled write mode %04x, [%06x] %04x\n", - reg, mode, CADDR, d); + reg, mode, CADDR, d); } } else @@ -120,17 +120,17 @@ static UINT32 pm_io(address_space &space, int reg, int write, UINT32 d) else { logerror("ssp FIXME: PM%i unhandled read mode %04x, [%06x]\n", - reg, mode, CADDR); + reg, mode, CADDR); d = 0; } } - + // PMC value corresponds to last PMR accessed (not sure). state->m_pmc.d = state->m_pmac_read[write ? reg + 6 : reg]; - + return d; } - + return (UINT32)-1; } @@ -187,7 +187,7 @@ static READ16_HANDLER( read_XST ) mdsvp_state *state = space.machine().driver_data<mdsvp_state>(); UINT32 d = pm_io(space, 3, 0, 0); if (d != (UINT32)-1) return d; - + return state->m_XST; } @@ -196,7 +196,7 @@ static WRITE16_HANDLER( write_XST ) mdsvp_state *state = space.machine().driver_data<mdsvp_state>(); UINT32 r = pm_io(space, 3, 1, data); if (r != (UINT32)-1) return; - + state->m_XST2 |= 1; state->m_XST = data; } @@ -326,7 +326,7 @@ void svp_init(running_machine &machine) { mdsvp_state *state = machine.driver_data<mdsvp_state>(); UINT8 *ROM = state->memregion("maincpu")->base(); - + memset(state->m_pmac_read, 0, ARRAY_LENGTH(state->m_pmac_read)); memset(state->m_pmac_write, 0, ARRAY_LENGTH(state->m_pmac_write)); state->m_pmc.d = 0; @@ -335,7 +335,7 @@ void svp_init(running_machine &machine) state->m_emu_status = 0; state->m_XST = 0; state->m_XST2 = 0; - + /* SVP stuff */ state->m_dram = auto_alloc_array(machine, UINT8, 0x20000); machine.device("maincpu")->memory().space(AS_PROGRAM).install_ram(0x300000, 0x31ffff, state->m_dram); @@ -343,7 +343,7 @@ void svp_init(running_machine &machine) // "cell arrange" 1 and 2 machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x390000, 0x39ffff, FUNC(svp_68k_cell1_r)); machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x3a0000, 0x3affff, FUNC(svp_68k_cell2_r)); - + machine.device("svp")->memory().space(AS_PROGRAM).install_legacy_read_handler(0x438, 0x438, FUNC(svp_speedup_r)); if (state->m_slotcart->m_cart->get_rom_base() != NULL) diff --git a/src/mess/machine/nes_mmc.c b/src/mess/machine/nes_mmc.c index 8323435fb75..df07e70f848 100644 --- a/src/mess/machine/nes_mmc.c +++ b/src/mess/machine/nes_mmc.c @@ -562,7 +562,7 @@ void nes_carts_state::set_nt_mirroring(int mirroring) #ifdef _MSC_VER #pragma optimize("", off) -#endif +#endif /************************************************************* diff --git a/src/mess/machine/psxanalog.c b/src/mess/machine/psxanalog.c index 108ff366455..f1b63f7d7a4 100644 --- a/src/mess/machine/psxanalog.c +++ b/src/mess/machine/psxanalog.c @@ -260,4 +260,3 @@ INPUT_CHANGED_MEMBER(psx_analog_controller_device::change_mode) if(!m_analoglock) m_analogmode = newval; } - diff --git a/src/mess/machine/psxanalog.h b/src/mess/machine/psxanalog.h index 808d6e9b1a4..e530e239c6b 100644 --- a/src/mess/machine/psxanalog.h +++ b/src/mess/machine/psxanalog.h @@ -6,7 +6,7 @@ extern const device_type PSX_DUALSHOCK; extern const device_type PSX_ANALOG_JOYSTICK; -class psx_analog_controller_device : public device_t, +class psx_analog_controller_device : public device_t, public device_psx_controller_interface { public: diff --git a/src/mess/machine/psxcard.c b/src/mess/machine/psxcard.c index 76091c2549a..95f15125da5 100644 --- a/src/mess/machine/psxcard.c +++ b/src/mess/machine/psxcard.c @@ -341,4 +341,3 @@ void psxcard_device::sel_w(bool state) reset(); m_sel = state; } - diff --git a/src/mess/machine/psxcard.h b/src/mess/machine/psxcard.h index 0c4f670910b..06613914a3d 100644 --- a/src/mess/machine/psxcard.h +++ b/src/mess/machine/psxcard.h @@ -10,7 +10,7 @@ class psx_controller_port_device; #define MCFG_PSXCARD_ADD(_tag) \ MCFG_DEVICE_ADD(_tag, PSXCARD, 0) -class psxcard_device : public device_t, +class psxcard_device : public device_t, public device_image_interface { public: diff --git a/src/mess/machine/psxcd.c b/src/mess/machine/psxcd.c index a268c4c42d1..6c1a02ae4cb 100644 --- a/src/mess/machine/psxcd.c +++ b/src/mess/machine/psxcd.c @@ -254,7 +254,7 @@ WRITE8_MEMBER( psxcd_device::write ) { case 0: //if(data & 2) - // popmessage("cmdmode = %02x, contact MESSdev",data); + // popmessage("cmdmode = %02x, contact MESSdev",data); cmdmode=data&1; if (cmdmode==0) @@ -334,7 +334,7 @@ WRITE8_MEMBER( psxcd_device::write ) */ case 3: //if(data & 0x78) - // popmessage("IRQ flag = %02x, contact MESSdev",data); + // popmessage("IRQ flag = %02x, contact MESSdev",data); if (data==0x07) { @@ -1682,7 +1682,7 @@ void psxcd_device::add_system_event(event *ev) // ev->t is in maincpu clock cycles UINT32 hz = m_sysclock / ev->t; -// printf("add_system_event: event type %d for %d hz (using timer %d)\n", ev->type, hz, tnum); +// printf("add_system_event: event type %d for %d hz (using timer %d)\n", ev->type, hz, tnum); timer->adjust(attotime::from_hz(hz), tnum, attotime::never); // back-reference the timer from the event diff --git a/src/mess/machine/psxcport.h b/src/mess/machine/psxcport.h index f3b3a3ed474..847168708c7 100644 --- a/src/mess/machine/psxcport.h +++ b/src/mess/machine/psxcport.h @@ -60,7 +60,7 @@ private: psx_controller_port_device *m_owner; }; -class psx_standard_controller_device : public device_t, +class psx_standard_controller_device : public device_t, public device_psx_controller_interface { public: @@ -94,7 +94,7 @@ private: psx_controller_port_device *m_port1; }; -class psx_controller_port_device : public device_t, +class psx_controller_port_device : public device_t, public device_slot_interface { public: diff --git a/src/mess/machine/southbridge.c b/src/mess/machine/southbridge.c index bccd53e7686..ba1fbd3b6c8 100644 --- a/src/mess/machine/southbridge.c +++ b/src/mess/machine/southbridge.c @@ -183,7 +183,7 @@ southbridge_device::southbridge_device(const machine_config &mconfig, device_typ IRQ_CALLBACK_MEMBER(southbridge_device::at_irq_callback) { - return m_pic8259_master->inta_r(); + return m_pic8259_master->inta_r(); } //------------------------------------------------- diff --git a/src/mess/machine/superpet.c b/src/mess/machine/superpet.c index 99dac336444..3cf8ae3b08a 100644 --- a/src/mess/machine/superpet.c +++ b/src/mess/machine/superpet.c @@ -15,9 +15,9 @@ // MACROS/CONSTANTS //************************************************************************** -#define M6809_TAG "u4" -#define M6551_TAG "u23" -#define MOS6702_TAG "u2" +#define M6809_TAG "u4" +#define M6551_TAG "u23" +#define MOS6702_TAG "u2" @@ -92,7 +92,7 @@ machine_config_constructor superpet_device::device_mconfig_additions() const static INPUT_PORTS_START( superpet ) PORT_START("SW1") - + PORT_START("SW2") INPUT_PORTS_END @@ -300,18 +300,18 @@ void superpet_device::pet_bd_w(address_space &space, offs_t offset, UINT8 data, if (BIT(m_bank, 7)) { /* - + bit description - + 0 SW2 CPU (0=6809, 1=6502) 1 SW1 RAM (0=read only, 1=read/write) - 2 + 2 3 DIAG - 4 - 5 - 6 - 7 - + 4 + 5 + 6 + 7 + */ m_system = data; @@ -323,9 +323,9 @@ void superpet_device::pet_bd_w(address_space &space, offs_t offset, UINT8 data, case 0xeffc: case 0xeffd: /* - + bit description - + 0 A0 1 A1 2 A2 @@ -334,7 +334,7 @@ void superpet_device::pet_bd_w(address_space &space, offs_t offset, UINT8 data, 5 SEL B 6 J1 pin 39 7 BIT 7 - + */ m_bank = data; diff --git a/src/mess/machine/terminal.c b/src/mess/machine/terminal.c index 343ca7a0e1c..f9f01593d77 100644 --- a/src/mess/machine/terminal.c +++ b/src/mess/machine/terminal.c @@ -138,15 +138,15 @@ static const UINT8 terminal_font[256*16] = generic_terminal_device::generic_terminal_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, type, name, tag, owner, clock), - m_io_term_frame(*this, "TERM_FRAME"), - m_io_term_conf(*this, "TERM_CONF") + m_io_term_frame(*this, "TERM_FRAME"), + m_io_term_conf(*this, "TERM_CONF") { } generic_terminal_device::generic_terminal_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, GENERIC_TERMINAL, "Generic Terminal", tag, owner, clock), - m_io_term_frame(*this, "TERM_FRAME"), - m_io_term_conf(*this, "TERM_CONF") + m_io_term_frame(*this, "TERM_FRAME"), + m_io_term_conf(*this, "TERM_CONF") { } diff --git a/src/mess/machine/trs80m2kb.c b/src/mess/machine/trs80m2kb.c index 9c583b1c3a4..59bdcbdd5c3 100644 --- a/src/mess/machine/trs80m2kb.c +++ b/src/mess/machine/trs80m2kb.c @@ -93,125 +93,125 @@ machine_config_constructor trs80m2_keyboard_device::device_mconfig_additions() c //------------------------------------------------- INPUT_PORTS_START( trs80m2_keyboard ) - PORT_START("Y0") - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 0") PORT_CODE(KEYCODE_0_PAD) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("Y1") - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_DOWN) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("Y2") - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("REPEAT") - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Right SHIFT") PORT_CODE(KEYCODE_RSHIFT) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CAPS") PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Left SHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LOCK") - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL)) - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("Y3") - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("cannot read label") - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')') - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(') - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad .") PORT_CODE(KEYCODE_DEL_PAD) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 3") PORT_CODE(KEYCODE_3_PAD) - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_LEFT) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) - - PORT_START("Y4") - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("BACKSPACE") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F2") PORT_CODE(KEYCODE_F2) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 5") PORT_CODE(KEYCODE_5_PAD) - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_RIGHT) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) - - PORT_START("Y5") - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("HOLD") - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}') - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('^') - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F1") PORT_CODE(KEYCODE_F1) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 2") PORT_CODE(KEYCODE_2_PAD) - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_UP) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) - - PORT_START("Y6") - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("ENTER") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+') - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@') - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad ENTER") PORT_CODE(KEYCODE_ENTER_PAD) PORT_CHAR(13) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 9") PORT_CODE(KEYCODE_9_PAD) - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 7") PORT_CODE(KEYCODE_7_PAD) - - PORT_START("Y7") - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('"') - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*') - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 6") PORT_CODE(KEYCODE_6_PAD) - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 4") PORT_CODE(KEYCODE_4_PAD) - - PORT_START("Y8") - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_') - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 8") PORT_CODE(KEYCODE_8_PAD) - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 1") PORT_CODE(KEYCODE_1_PAD) - - PORT_START("Y9") - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{') - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("YA") - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':') - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&') - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("ESC") PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC)) - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) - - PORT_START("YB") - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("TAB") PORT_CODE(KEYCODE_TAB) PORT_CHAR('\t') - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_START("Y0") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 0") PORT_CODE(KEYCODE_0_PAD) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("Y1") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_DOWN) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("Y2") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("REPEAT") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Right SHIFT") PORT_CODE(KEYCODE_RSHIFT) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CAPS") PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Left SHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LOCK") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL)) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("Y3") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("cannot read label") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')') + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(') + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad .") PORT_CODE(KEYCODE_DEL_PAD) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 3") PORT_CODE(KEYCODE_3_PAD) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_LEFT) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) + + PORT_START("Y4") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("BACKSPACE") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F2") PORT_CODE(KEYCODE_F2) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 5") PORT_CODE(KEYCODE_5_PAD) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_RIGHT) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) + + PORT_START("Y5") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("HOLD") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}') + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('^') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F1") PORT_CODE(KEYCODE_F1) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 2") PORT_CODE(KEYCODE_2_PAD) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_UP) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) + + PORT_START("Y6") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("ENTER") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+') + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad ENTER") PORT_CODE(KEYCODE_ENTER_PAD) PORT_CHAR(13) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 9") PORT_CODE(KEYCODE_9_PAD) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 7") PORT_CODE(KEYCODE_7_PAD) + + PORT_START("Y7") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('"') + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*') + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 6") PORT_CODE(KEYCODE_6_PAD) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 4") PORT_CODE(KEYCODE_4_PAD) + + PORT_START("Y8") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_') + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 8") PORT_CODE(KEYCODE_8_PAD) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 1") PORT_CODE(KEYCODE_1_PAD) + + PORT_START("Y9") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{') + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("YA") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':') + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&') + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("ESC") PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC)) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("YB") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("TAB") PORT_CODE(KEYCODE_TAB) PORT_CHAR('\t') + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) INPUT_PORTS_END @@ -321,18 +321,18 @@ READ8_MEMBER( trs80m2_keyboard_device::kb_p0_r ) switch (m_y) { - case 0: data &= m_y0->read(); break; - case 1: data &= m_y1->read(); break; - case 2: data &= m_y2->read(); break; - case 3: data &= m_y3->read(); break; - case 4: data &= m_y4->read(); break; - case 5: data &= m_y5->read(); break; - case 6: data &= m_y6->read(); break; - case 7: data &= m_y7->read(); break; - case 8: data &= m_y8->read(); break; - case 9: data &= m_y9->read(); break; - case 0xa: data &= m_ya->read(); break; - case 0xb: data &= m_yb->read(); break; + case 0: data &= m_y0->read(); break; + case 1: data &= m_y1->read(); break; + case 2: data &= m_y2->read(); break; + case 3: data &= m_y3->read(); break; + case 4: data &= m_y4->read(); break; + case 5: data &= m_y5->read(); break; + case 6: data &= m_y6->read(); break; + case 7: data &= m_y7->read(); break; + case 8: data &= m_y8->read(); break; + case 9: data &= m_y9->read(); break; + case 0xa: data &= m_ya->read(); break; + case 0xb: data &= m_yb->read(); break; } return data; diff --git a/src/mess/machine/vcs_joybooster.h b/src/mess/machine/vcs_joybooster.h index ae914b36617..3fdf660f8ca 100644 --- a/src/mess/machine/vcs_joybooster.h +++ b/src/mess/machine/vcs_joybooster.h @@ -47,7 +47,7 @@ protected: virtual bool has_pot_x() { return true; } virtual bool has_pot_y() { return true; } - + private: required_ioport m_joy; required_ioport m_potx; diff --git a/src/mess/machine/vcs_keypad.h b/src/mess/machine/vcs_keypad.h index 8643386133b..db41f450484 100644 --- a/src/mess/machine/vcs_keypad.h +++ b/src/mess/machine/vcs_keypad.h @@ -25,7 +25,7 @@ // ======================> vcs_keypad_device class vcs_keypad_device : public device_t, - public device_vcs_control_port_interface + public device_vcs_control_port_interface { public: // construction/destruction |