diff options
author | angelosa <salese_corp_ltd@email.it> | 2016-06-15 22:58:15 +0200 |
---|---|---|
committer | angelosa <salese_corp_ltd@email.it> | 2016-06-15 22:59:05 +0200 |
commit | 48cc7ac30455ba23d08bb9b5d9063ccc73a3bfca (patch) | |
tree | 48a7abf630563c26d68df82f4c04916dfbb156a9 /src/mame | |
parent | 9f214108eb78991227595a5b3e9080b90a16ac09 (diff) |
raiden2cop.cpp: Fixed BCD overflow score bug in Godzilla [Angelo Salese]
(marked as working until otherwise proven, nw)
Diffstat (limited to 'src/mame')
-rw-r--r-- | src/mame/drivers/esh.cpp | 4 | ||||
-rw-r--r-- | src/mame/drivers/legionna.cpp | 2 | ||||
-rw-r--r-- | src/mame/machine/raiden2cop.cpp | 31 | ||||
-rw-r--r-- | src/mame/machine/raiden2cop.h | 7 |
4 files changed, 26 insertions, 18 deletions
diff --git a/src/mame/drivers/esh.cpp b/src/mame/drivers/esh.cpp index 85159e99d16..d19f055ed02 100644 --- a/src/mame/drivers/esh.cpp +++ b/src/mame/drivers/esh.cpp @@ -441,7 +441,7 @@ ROM_START( esha ) ROM_LOAD( "v.c6", 0x300, 0x100, CRC(7157ba22) SHA1(07355f30efe46196d216356eda48a59fc622e43f) ) DISK_REGION( "laserdisc" ) - DISK_IMAGE_READONLY( "esh", 0, NO_DUMP ) + DISK_IMAGE_READONLY( "esh_ver2_en", 0, SHA1(c04709d95fd92259f013ec1cd28e3e36a163abe1) ) ROM_END ROM_START( eshb ) @@ -465,7 +465,7 @@ ROM_START( eshb ) ROM_LOAD( "v.c6", 0x300, 0x100, CRC(7157ba22) SHA1(07355f30efe46196d216356eda48a59fc622e43f) ) DISK_REGION( "laserdisc" ) - DISK_IMAGE_READONLY( "esh", 0, NO_DUMP ) + DISK_IMAGE_READONLY( "esh_ver2_en", 0, SHA1(c04709d95fd92259f013ec1cd28e3e36a163abe1) ) ROM_END diff --git a/src/mame/drivers/legionna.cpp b/src/mame/drivers/legionna.cpp index e83b0aebfc1..7b695977d9a 100644 --- a/src/mame/drivers/legionna.cpp +++ b/src/mame/drivers/legionna.cpp @@ -2769,7 +2769,7 @@ GAME( 1992, heatbrlo, heatbrl, heatbrl, heatbrl, driver_device, 0, RO GAME( 1992, heatbrlu, heatbrl, heatbrl, heatbrl, driver_device, 0, ROT0, "TAD Corporation", "Heated Barrel (US)", MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING ) GAME( 1992, heatbrle, heatbrl, heatbrl, heatbrl, driver_device, 0, ROT0, "TAD Corporation (Electronic Devices license)", "Heated Barrel (Electronic Devices license)", MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING ) -GAME( 1993, godzilla, 0, godzilla, godzilla, driver_device, 0, ROT0, "Banpresto", "Godzilla (Japan)", MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING ) +GAME( 1993, godzilla, 0, godzilla, godzilla, driver_device, 0, ROT0, "Banpresto", "Godzilla (Japan)", MACHINE_IMPERFECT_GRAPHICS ) GAME( 1993, grainbow, 0, grainbow, grainbow, driver_device, 0, ROT0, "Banpresto", "SD Gundam Sangokushi Rainbow Tairiku Senki", MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING ) GAME( 1993, denjinmk, 0, denjinmk, denjinmk, legionna_state,denjinmk, ROT0, "Winkysoft (Banpresto license)", "Denjin Makai", MACHINE_IMPERFECT_GRAPHICS ) diff --git a/src/mame/machine/raiden2cop.cpp b/src/mame/machine/raiden2cop.cpp index cba8ff2ece8..002d1c2c32b 100644 --- a/src/mame/machine/raiden2cop.cpp +++ b/src/mame/machine/raiden2cop.cpp @@ -185,30 +185,28 @@ void raiden2cop_device::device_start() save_item(NAME(m_LEGACY_r1)); m_videoramout_cb.resolve_safe(); + m_byte_endian_val = m_cpu_is_68k ? 3 : 0; + m_word_endian_val = m_cpu_is_68k ? 2 : 0; } UINT16 raiden2cop_device::cop_read_word(address_space &space, int address) { - if (m_cpu_is_68k) return space.read_word(address ^ 2); - else return space.read_word(address); + return space.read_word(address ^ m_word_endian_val); } UINT8 raiden2cop_device::cop_read_byte(address_space &space, int address) { - if (m_cpu_is_68k) return space.read_byte(address ^ 3); - else return space.read_byte(address); + return space.read_byte(address ^ m_byte_endian_val); } void raiden2cop_device::cop_write_word(address_space &space, int address, UINT16 data) { - if (m_cpu_is_68k) space.write_word(address ^ 2, data); - else space.write_word(address, data); + space.write_word(address ^ m_word_endian_val, data); } void raiden2cop_device::cop_write_byte(address_space &space, int address, UINT8 data) { - if (m_cpu_is_68k) space.write_byte(address ^ 3, data); - else space.write_byte(address, data); + space.write_byte(address ^ m_byte_endian_val, data); } @@ -887,12 +885,9 @@ WRITE16_MEMBER(raiden2cop_device::cop_dma_trigger_w) } /* Number Conversion */ - -WRITE16_MEMBER(raiden2cop_device::cop_itoa_low_w) +void raiden2cop_device::bcd_update() { - cop_itoa = (cop_itoa & ~UINT32(mem_mask)) | (data & mem_mask); - - //int digits = 1 << cop_itoa_mode*2; + //int digits = 1 << cop_itoa_mode*2; UINT32 val = cop_itoa; //if(digits > 9) @@ -918,9 +913,19 @@ WRITE16_MEMBER(raiden2cop_device::cop_itoa_low_w) cop_itoa_digits[9] = 0; } +WRITE16_MEMBER(raiden2cop_device::cop_itoa_low_w) +{ + cop_itoa = (cop_itoa & ~UINT32(mem_mask)) | (data & mem_mask); + + bcd_update(); +} + WRITE16_MEMBER(raiden2cop_device::cop_itoa_high_w) { cop_itoa = (cop_itoa & ~(mem_mask << 16)) | ((data & mem_mask) << 16); + + // Godzilla cares, otherwise you get 2p score overflow in 1p vs 2p, TODO: might actually be HW endianness dependant? + bcd_update(); } WRITE16_MEMBER(raiden2cop_device::cop_itoa_mode_w) diff --git a/src/mame/machine/raiden2cop.h b/src/mame/machine/raiden2cop.h index 3fc2240aa76..4a38924fba3 100644 --- a/src/mame/machine/raiden2cop.h +++ b/src/mame/machine/raiden2cop.h @@ -240,10 +240,13 @@ public: DECLARE_WRITE16_MEMBER(LEGACY_cop_cmd_w); - void cop_collision_update_hitbox(address_space &space, UINT16 data, int slot, UINT32 hitadr); - + void cop_collision_update_hitbox(address_space &space, UINT16 data, int slot, UINT32 hitadr); + void bcd_update(); + // endian stuff? int m_cpu_is_68k; + UINT8 m_byte_endian_val; + UINT8 m_word_endian_val; static void set_cpu_is_68k(device_t &device, int value) { downcast<raiden2cop_device &>(device).m_cpu_is_68k = value; } UINT16 cop_read_word(address_space &space, int address); UINT8 cop_read_byte(address_space &space, int address); |