diff options
86 files changed, 4849 insertions, 4310 deletions
diff --git a/hash/apple2_flop_clcracked.xml b/hash/apple2_flop_clcracked.xml index aabbbe60b60..cd4befc0e60 100644 --- a/hash/apple2_flop_clcracked.xml +++ b/hash/apple2_flop_clcracked.xml @@ -48002,4 +48002,21 @@ license:CC0 </part> </software> + <software name="drugefct"> + <description>Drugs: Their Effects on You (cleanly cracked)</description> + <year>1987</year> + <publisher>Marshware</publisher> + <info name="release" value="2022-04-23"/> + <!--"Drugs: Their Effects on You" is a 1987 educational program developed by EduSystems, illustrated by Morse Software Illustrations, with consultants Donna L. Osness and James M. Schaefer, and distributed by Marshware. It is preserved here for the first time.--> + <!-- Be sure to read the story of actually obtaining and dumping this disk at + https://archive.org/details/PreservingDrugsTheirEffectsOnYou + It might leave you taped to your seat. --> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="143360"> + <rom name="drugs- their effects on you (4am crack).dsk" size="143360" crc="6540b35f" sha1="b8965f31c71c09e5b72f465ba2783377a7b9ec93"/> + </dataarea> + </part> + </software> + </softwarelist> diff --git a/hash/apple2_flop_orig.xml b/hash/apple2_flop_orig.xml index d28a392df59..0d983610e8f 100644 --- a/hash/apple2_flop_orig.xml +++ b/hash/apple2_flop_orig.xml @@ -22550,4 +22550,22 @@ license:CC0 </part> </software> + <software name="drugefct"> + <description>Drugs: Their Effects on You</description> + <year>1987</year> + <publisher>Marshware</publisher> + <info name="release" value="2022-04-23"/> + <!--"Drugs: Their Effects on You" is a 1987 educational program developed by EduSystems, illustrated by Morse Software Illustrations, with consultants Donna L. Osness and James M. Schaefer, and distributed by Marshware. It is preserved here for the first time.--> + <!-- Be sure to read the story of actually obtaining and dumping this disk at + https://archive.org/details/PreservingDrugsTheirEffectsOnYou + It might leave you taped to your seat. --> + <!-- Side B is not Apple-format. --> + + <part name="flop1" interface="floppy_5_25"> + <dataarea name="flop" size="241629"> + <rom name="drugs- their effects on you - disk 1, side a.woz" size="241629" crc="fd63a817" sha1="4f30cd771a60b6fed20973a86df5355d491ead8f" /> + </dataarea> + </part> + </software> + </softwarelist> diff --git a/hash/neogeo.xml b/hash/neogeo.xml index ff69e0d1762..2b10ddc1883 100644 --- a/hash/neogeo.xml +++ b/hash/neogeo.xml @@ -8259,7 +8259,7 @@ license:CC0 <description>Garou - Mark of the Wolves (NGH-2530)</description> <year>1999</year> <publisher>SNK</publisher> - <info name="serial" value="NGM-2530"/> + <info name="serial" value="NGH-2530"/> <info name="release" value="19991126"/> <info name="alt_title" value="餓狼"/> <sharedfeat name="release" value="AES" /> diff --git a/hash/nes.xml b/hash/nes.xml index 540bdfe01ab..bd6425b707b 100644 --- a/hash/nes.xml +++ b/hash/nes.xml @@ -25479,8 +25479,8 @@ license:CC0 <dataarea name="chr" size="131072"> <rom name="0.chr" size="131072" crc="7375d251" sha1="c240631e734fec873f546f20edaa81e0d31b4e27" offset="00000" /> </dataarea> - <dataarea name="adpcm" size="262144"> - <rom name="upd7756c" size="262144" status="nodump" offset="00000" /> + <dataarea name="adpcm" size="32768"> + <rom name="d7756c" size="32768" status="nodump" offset="00000" /> </dataarea> </part> </software> @@ -25501,8 +25501,8 @@ license:CC0 <dataarea name="chr" size="131072"> <rom name="0.chr" size="131072" crc="221f85cf" sha1="9379b8b4d440f039993a2f156e67667b38668094" offset="00000" /> </dataarea> - <dataarea name="adpcm" size="262144"> - <rom name="upd7756c" size="262144" status="nodump" offset="00000" /> + <dataarea name="adpcm" size="32768"> + <rom name="d7756c" size="32768" status="nodump" offset="00000" /> </dataarea> </part> </software> @@ -25526,8 +25526,8 @@ license:CC0 </part> </software> - <software name="moejudo" supported="partial"> - <description>Moero!! Juudou Warriors (Jpn)</description> + <software name="moejudo" supported="no"> + <description>Moero!! Juudou Warriors (Japan)</description> <year>1990</year> <publisher>Jaleco</publisher> <info name="serial" value="JF-28"/> @@ -25563,8 +25563,8 @@ license:CC0 <dataarea name="chr" size="131072"> <rom name="jf-17 chr" size="131072" crc="43e86efa" sha1="5aaba33768eaf8bc66090f28a2aecb89e496b135" offset="00000" /> </dataarea> - <dataarea name="adpcm" size="262144"> - <rom name="upd7756c" size="262144" status="nodump" offset="00000" /> + <dataarea name="adpcm" size="32768"> + <rom name="d7756c" size="32768" status="nodump" offset="00000" /> </dataarea> </part> </software> @@ -25586,8 +25586,8 @@ license:CC0 <dataarea name="chr" size="65536"> <rom name="chr" size="65536" crc="26a94526" sha1="c06ef1f446c4e66ce5efc4e8b282e5f7b9eb3baa" offset="00000" /> </dataarea> - <dataarea name="adpcm" size="262144"> - <rom name="upd7756c" size="262144" status="nodump" offset="00000" /> + <dataarea name="adpcm" size="32768"> + <rom name="d7756c" size="32768" status="nodump" offset="00000" /> </dataarea> </part> </software> @@ -25609,8 +25609,8 @@ license:CC0 <dataarea name="chr" size="65536"> <rom name="chr" size="65536" crc="26a94526" sha1="c06ef1f446c4e66ce5efc4e8b282e5f7b9eb3baa" offset="00000" /> </dataarea> - <dataarea name="adpcm" size="262144"> - <rom name="upd7756c" size="262144" status="nodump" offset="00000" /> + <dataarea name="adpcm" size="32768"> + <rom name="d7756c" size="32768" status="nodump" offset="00000" /> </dataarea> </part> </software> @@ -25632,8 +25632,8 @@ license:CC0 <dataarea name="chr" size="65536"> <rom name="chr" size="65536" crc="26a94526" sha1="c06ef1f446c4e66ce5efc4e8b282e5f7b9eb3baa" offset="00000" /> </dataarea> - <dataarea name="adpcm" size="262144"> - <rom name="upd7756c" size="262144" status="nodump" offset="00000" /> + <dataarea name="adpcm" size="32768"> + <rom name="d7756c" size="32768" status="nodump" offset="00000" /> </dataarea> </part> </software> @@ -25655,8 +25655,8 @@ license:CC0 <dataarea name="chr" size="65536"> <rom name="chr" size="65536" crc="26a94526" sha1="c06ef1f446c4e66ce5efc4e8b282e5f7b9eb3baa" offset="00000" /> </dataarea> - <dataarea name="adpcm" size="262144"> - <rom name="upd7756c" size="262144" status="nodump" offset="00000" /> + <dataarea name="adpcm" size="32768"> + <rom name="d7756c" size="32768" status="nodump" offset="00000" /> </dataarea> </part> </software> @@ -25678,8 +25678,8 @@ license:CC0 <dataarea name="chr" size="131072"> <rom name="0.chr" size="131072" crc="f20e819f" sha1="93c693f222586e51836fd41ef369fac9af2356e5" offset="00000" /> </dataarea> - <dataarea name="adpcm" size="262144"> - <rom name="upd7756c" size="262144" status="nodump" offset="00000" /> + <dataarea name="adpcm" size="32768"> + <rom name="d7756c" size="32768" status="nodump" offset="00000" /> </dataarea> </part> </software> @@ -33867,8 +33867,8 @@ license:CC0 <dataarea name="chr" size="131072"> <rom name="jf-23 chr" size="131072" crc="81bf8283" sha1="ac024e7bfe2fef7300c5d21702a03b5ca8117529" offset="00000" /> </dataarea> - <dataarea name="adpcm" size="262144"> - <rom name="upd7756c" size="262144" status="nodump" offset="00000" /> + <dataarea name="adpcm" size="32768"> + <rom name="d7756c" size="32768" status="nodump" offset="00000" /> </dataarea> </part> </software> @@ -39118,8 +39118,8 @@ license:CC0 <dataarea name="chr" size="131072"> <rom name="0.chr" size="131072" crc="a7c1010e" sha1="afd6fb56d97f35ee19a4b297845c995b47bc3ade" offset="00000" /> </dataarea> - <dataarea name="adpcm" size="262144"> - <rom name="upd7755c" size="262144" status="nodump" offset="00000" /> + <dataarea name="adpcm" size="12288"> + <rom name="d7755c" size="12288" status="nodump" offset="00000" /> </dataarea> </part> </software> @@ -49135,8 +49135,8 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx <rom name="chr" size="65536" crc="26a94526" sha1="c06ef1f446c4e66ce5efc4e8b282e5f7b9eb3baa" offset="00000" /> </dataarea> <!-- was this present on the proto board? --> - <dataarea name="adpcm" size="262144"> - <rom name="upd7756c" size="262144" status="nodump" offset="00000" /> + <dataarea name="adpcm" size="32768"> + <rom name="d7756c" size="32768" status="nodump" offset="00000" /> </dataarea> </part> </software> @@ -64614,7 +64614,7 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx </software> <!-- nointro --> - <software name="decathln"> + <software name="decathln" supported="partial"> <!-- major graphics glitches in javelin and 1500m --> <description>Decathlon (Tw)</description> <year>1992</year> <publisher>Computer & Entertainment</publisher> @@ -69425,10 +69425,11 @@ Also notice that VRAM & WRAM are probably incorrect for some of these sets, at t <software name="fuunsfds"> <description>Fuuun Shaolin Kyo (Asia, FDS conversion)</description> <year>19??</year> - <publisher>Kaiser</publisher> + <publisher>Whirlwind Manu</publisher> <part name="cart" interface="nes_cart"> <feature name="slot" value="unl_lh10" /> <feature name="pcb" value="UNL-LH10" /> + <feature name="mirroring" value="vertical" /> <dataarea name="prg" size="131072"> <rom name="fuuun shaolin kyo (fds conversion) (unl).prg" size="131072" crc="120d5a6c" sha1="4c499a857087e6c121522435786792a2e4105ac1" offset="00000" status="baddump" /> </dataarea> @@ -80579,10 +80580,11 @@ be better to redump them properly. --> <publisher>5Seven Records</publisher> <part name="cart" interface="nes_cart"> <feature name="slot" value="uxrom" /> + <feature name="pcb_model" value="INL-XO-ROM" /> <dataarea name="prg" size="2097152"> <rom name="polygondwanaland.prg" size="2097152" crc="2e86704d" sha1="bd934d2981fa00ca44d5af0023b14c60c7b4b0c4" /> </dataarea> - <!-- 8k VRAM on cartridge --> + <!-- 8k VRAM on cartridge (really 32k?) --> <dataarea name="vram" size="8192"> </dataarea> </part> @@ -86629,19 +86631,21 @@ that the real dumps might surface --> </part> </software> -<!-- This dump was made in a hex editor from the hacked clone. It matches the known MD5 hash of the unreleased dump. --> +<!-- This dump was made in a hex editor from the hacked clone. It matches the known MD5 hash of the unreleased dump and individual chip 16-bit checksums. --> <software name="tysonipp"> <description>Mike Tyson's Intergalactic Power Punch (USA, prototype)</description> <year>1991</year> <publisher>Nintendo</publisher> <part name="cart" interface="nes_cart"> <feature name="slot" value="txrom" /> - <feature name="pcb" value="NES-TLROM" /> + <feature name="pcb_model" value="NES-TKEPROM-01" /> + <feature name="mmc3_type" value="MMC3B" /> <dataarea name="prg" size="131072"> - <rom name="mike tyson's intergalactic power punch (june 1991 ces prototype).prg" size="131072" crc="fe9239d6" sha1="88cf22111bedd0583d8e49f70730d802e7851e5b" /> + <rom name="16b prg0 05-31 5a14.u1" size="131072" crc="fe9239d6" sha1="88cf22111bedd0583d8e49f70730d802e7851e5b" /> </dataarea> <dataarea name="chr" size="262144"> - <rom name="mike tyson's intergalactic power punch (june 1991 ces prototype).chr" size="262144" crc="65f969e2" sha1="fe84a134e37790571542325665806b8064de6de6" /> + <rom name="16b chr0 05-31 5a6b.u5" size="131072" crc="9542b8c1" sha1="eeabdc82563460d78bea23adb41b03e046cb72a7" offset="0x00000" /> + <rom name="16b chr1 05-31 a29f.u6" size="131072" crc="892b575f" sha1="4d728c2fa57061cf575219c1307de514da738d93" offset="0x20000" /> </dataarea> </part> </software> diff --git a/hash/spectrum_cass.xml b/hash/spectrum_cass.xml index 1d6997e50bb..524952bfa0a 100644 --- a/hash/spectrum_cass.xml +++ b/hash/spectrum_cass.xml @@ -13082,6 +13082,17 @@ license:CC0 </part> </software> + <software name="ingadget"> + <description>Inspector Gadget and the Circus of Fear</description> + <year>1987</year> + <publisher>Erbe Software</publisher> + <part name="cass" interface="spectrum_cass"> + <dataarea name="cass" size="44940"> + <rom name="inspector gadget.tzx" size="44940" crc="e6bc07c3" sha1="5fa9fe2c59909b74c75d3b5f2fad3bff33532658"/> + </dataarea> + </part> + </software> + <software name="ik"> <description>International Karate (set 1)</description> <year>1985</year> @@ -15644,7 +15655,17 @@ license:CC0 </part> </software> - + <!-- NC128 --> + <software name="lsdmd"> + <description>LSD Megademo</description> + <year>1992</year> + <publisher>Pentagram</publisher> + <part name="cass" interface="spectrum_cass"> + <dataarea name="cass" size="253071"> + <rom name="lsd.tap" size="253071" crc="6bbaf78d" sha1="64cf725fc8fe47a2917d3a4832de437698f5b69b"/> + </dataarea> + </part> + </software> <software name="lumascii"> <description>LumASCII</description> @@ -21417,6 +21438,17 @@ license:CC0 </part> </software> + <software name="stimpysl"> + <description>The Ren and Stimpy Slideshow</description> + <year>1994</year> + <publisher>Extacy-3</publisher> + <part name="cass" interface="spectrum_cass"> + <dataarea name="cass" size="39209"> + <rom name="renstimp.tap" size="39209" crc="daa54264" sha1="bc556f82d9fe4bba3cfbc0580a8fa86c7ebde620"/> + </dataarea> + </part> + </software> + <software name="rockhams"> <description>Rock Star Ate My Hamster</description> <year>1989</year> diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua index 1b0fac67d74..0ccff7cb770 100644 --- a/scripts/target/mame/arcade.lua +++ b/scripts/target/mame/arcade.lua @@ -1556,8 +1556,6 @@ files { MAME_DIR .. "src/mame/includes/fcrash.h", MAME_DIR .. "src/mame/drivers/gng.cpp", MAME_DIR .. "src/mame/drivers/gunsmoke.cpp", - MAME_DIR .. "src/mame/includes/gunsmoke.h", - MAME_DIR .. "src/mame/video/gunsmoke.cpp", MAME_DIR .. "src/mame/drivers/higemaru.cpp", MAME_DIR .. "src/mame/includes/higemaru.h", MAME_DIR .. "src/mame/video/higemaru.cpp", @@ -1692,8 +1690,6 @@ files { MAME_DIR .. "src/mame/includes/boogwing.h", MAME_DIR .. "src/mame/video/boogwing.cpp", MAME_DIR .. "src/mame/drivers/brkthru.cpp", - MAME_DIR .. "src/mame/includes/brkthru.h", - MAME_DIR .. "src/mame/video/brkthru.cpp", MAME_DIR .. "src/mame/drivers/btime.cpp", MAME_DIR .. "src/mame/includes/btime.h", MAME_DIR .. "src/mame/machine/btime.cpp", @@ -3397,8 +3393,6 @@ files { createMAMEProjects(_target, _subtarget, "sanritsu") files { MAME_DIR .. "src/mame/drivers/appoooh.cpp", - MAME_DIR .. "src/mame/includes/appoooh.h", - MAME_DIR .. "src/mame/video/appoooh.cpp", MAME_DIR .. "src/mame/drivers/bankp.cpp", MAME_DIR .. "src/mame/includes/bankp.h", MAME_DIR .. "src/mame/video/bankp.cpp", diff --git a/src/devices/bus/multibus/cpuap.cpp b/src/devices/bus/multibus/cpuap.cpp index f74ba79f1e6..7e271be8114 100644 --- a/src/devices/bus/multibus/cpuap.cpp +++ b/src/devices/bus/multibus/cpuap.cpp @@ -85,35 +85,35 @@ static INPUT_PORTS_START(cpuap) // Offen: Ausgabe des Urladers über Diagnose-Stecker, keine SERAD/G Baugruppe gesteckt // Open: boot loader output via diagnostic plug, no SERAD/G module plugged in - PORT_DIPNAME(0x80, 0x00, "Diagnostic") PORT_DIPLOCATION("S7:7") + PORT_DIPNAME(0x80, 0x00, "Diagnostic") PORT_DIPLOCATION("S7:8") PORT_DIPSETTING(0x00, DEF_STR(Off)) PORT_DIPSETTING(0x80, DEF_STR(On)) // Offen: Monitor-Programm nach Testende // Open: enter monitor after test - PORT_DIPNAME(0x40, 0x00, "Boot Option") PORT_DIPLOCATION("S7:6") + PORT_DIPNAME(0x40, 0x00, "Boot Option") PORT_DIPLOCATION("S7:7") PORT_DIPSETTING(0x00, "Disk") PORT_DIPSETTING(0x40, "Monitor") - PORT_DIPNAME(0x20, 0x00, "S7:5") PORT_DIPLOCATION("S7:5") + PORT_DIPNAME(0x20, 0x00, "S7:5") PORT_DIPLOCATION("S7:6") PORT_DIPSETTING(0x00, DEF_STR(Off)) PORT_DIPSETTING(0x20, DEF_STR(On)) - PORT_DIPNAME(0x10, 0x00, "S7:4") PORT_DIPLOCATION("S7:4") + PORT_DIPNAME(0x10, 0x00, "S7:4") PORT_DIPLOCATION("S7:5") PORT_DIPSETTING(0x00, DEF_STR(Off)) PORT_DIPSETTING(0x10, DEF_STR(On)) - PORT_DIPNAME(0x08, 0x00, "S7:3") PORT_DIPLOCATION("S7:3") + PORT_DIPNAME(0x08, 0x00, "S7:3") PORT_DIPLOCATION("S7:4") PORT_DIPSETTING(0x00, DEF_STR(Off)) PORT_DIPSETTING(0x08, DEF_STR(On)) - PORT_DIPNAME(0x04, 0x00, "S7:2") PORT_DIPLOCATION("S7:2") + PORT_DIPNAME(0x04, 0x00, "S7:2") PORT_DIPLOCATION("S7:3") PORT_DIPSETTING(0x00, DEF_STR(Off)) PORT_DIPSETTING(0x04, DEF_STR(On)) - PORT_DIPNAME(0x02, 0x00, "S7:1") PORT_DIPLOCATION("S7:1") + PORT_DIPNAME(0x02, 0x00, "S7:1") PORT_DIPLOCATION("S7:2") PORT_DIPSETTING(0x00, DEF_STR(Off)) PORT_DIPSETTING(0x02, DEF_STR(On)) // Offen: kein Reboot nach Systemabsturz // Open: no reboot after system crash - PORT_DIPNAME(0x01, 0x00, "S7:0") PORT_DIPLOCATION("S7:0") + PORT_DIPNAME(0x01, 0x00, "S7:0") PORT_DIPLOCATION("S7:1") // S7:0 not allowed, causes crash in the dips menu PORT_DIPSETTING(0x00, DEF_STR(Off)) PORT_DIPSETTING(0x01, DEF_STR(On)) diff --git a/src/devices/bus/nes/bootleg.cpp b/src/devices/bus/nes/bootleg.cpp index f02f91c04e4..2801b17118d 100644 --- a/src/devices/bus/nes/bootleg.cpp +++ b/src/devices/bus/nes/bootleg.cpp @@ -197,7 +197,7 @@ nes_lg25_device::nes_lg25_device(const machine_config &mconfig, const char *tag, { } -nes_lh10_device::nes_lh10_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_lh10_device::nes_lh10_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_LH10, tag, owner, clock), m_latch(0) { } @@ -558,7 +558,6 @@ void nes_lh42_device::pcb_reset() { prg16_89ab(0); prg16_cdef(m_prg_chunks - 1); // Last 16K is fixed - chr8(0, CHRRAM); m_latch = 0; } @@ -573,7 +572,6 @@ void nes_lg25_device::pcb_reset() { prg16_89ab(0); prg16_cdef(m_prg_chunks - 1); // Last 16K is fixed - chr8(0, CHRRAM); m_latch = 0; } @@ -582,7 +580,6 @@ void nes_lh10_device::device_start() { common_start(); save_item(NAME(m_latch)); - save_item(NAME(m_reg)); } void nes_lh10_device::pcb_reset() @@ -591,17 +588,13 @@ void nes_lh10_device::pcb_reset() prg8_ab(0); // 0xc000-0xdfff reads/writes WRAM prg8_ef((m_prg_chunks << 1) - 1); - chr8(0, CHRRAM); - set_nt_mirroring(PPU_MIRROR_VERT); m_latch = 0; - std::fill(std::begin(m_reg), std::end(m_reg), 0x00); } void nes_lh51_device::pcb_reset() { prg32((m_prg_chunks >> 1) - 1); // first 8K is switchable, the rest fixed - chr8(0, CHRRAM); } void nes_lh53_device::device_start() @@ -1707,10 +1700,7 @@ void nes_lh32_device::write_h(offs_t offset, uint8_t data) NES 2.0: mapper 418 - In MAME: Preliminary supported. - - TODO: Investigate garbage tiles on bottom half of - course map screens. This should be car dashboard? + In MAME: Supported. -------------------------------------------------*/ @@ -1718,21 +1708,24 @@ void nes_lh42_device::write_h(offs_t offset, u8 data) { LOG_MMC(("lh42 write_h, offset: %04x, data: %02x\n", offset, data)); - if (BIT(offset, 0)) + switch (offset & 0x6001) { - switch (m_latch) - { - case 1: - set_nt_mirroring(BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); - break; - case 2: - case 3: - prg8_x(m_latch & 1, data & 0x0f); - break; - } + case 0x0000: + m_latch = data & 0x07; + break; + case 0x0001: + switch (m_latch) + { + case 5: + set_nt_mirroring(BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); + break; + case 6: + case 7: + prg8_x(m_latch & 1, data & 0x0f); + break; + } + break; } - else - m_latch = data & 0x03; } /*------------------------------------------------- @@ -1754,21 +1747,24 @@ void nes_lg25_device::write_h(offs_t offset, u8 data) { LOG_MMC(("lg25 write_h, offset: %04x, data: %02x\n", offset, data)); - if (BIT(offset, 0)) + switch (offset & 0x6001) { - switch (m_latch) - { - case 1: - set_nt_mirroring(BIT(data, 2) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ); - break; - case 2: - case 3: - prg8_x(m_latch & 1, data & 0x0f); - break; - } + case 0x0000: + m_latch = data & 0x07; + break; + case 0x0001: + switch (m_latch) + { + case 5: + set_nt_mirroring(BIT(data, 5) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); + break; + case 6: + case 7: + prg8_x(m_latch & 1, data & 0x0f); + break; + } + break; } - else - m_latch = data & 0x03; } /*------------------------------------------------- @@ -1786,19 +1782,13 @@ void nes_lg25_device::write_h(offs_t offset, u8 data) -------------------------------------------------*/ -void nes_lh10_device::update_prg() -{ - prg8_89(m_reg[6]); - prg8_ab(m_reg[7]); -} - -uint8_t nes_lh10_device::read_m(offs_t offset) +u8 nes_lh10_device::read_m(offs_t offset) { LOG_MMC(("lh10 read_m, offset: %04x\n", offset)); - return m_prg[(0x0e * 0x2000) + (offset & 0x1fff)]; + return m_prg[(0x0e * 0x2000 + offset) & (m_prg_size - 1)]; } -uint8_t nes_lh10_device::read_h(offs_t offset) +u8 nes_lh10_device::read_h(offs_t offset) { // LOG_MMC(("lh10 read_h, offset: %04x\n", offset)); @@ -1808,24 +1798,28 @@ uint8_t nes_lh10_device::read_h(offs_t offset) return hi_access_rom(offset); } -void nes_lh10_device::write_h(offs_t offset, uint8_t data) +void nes_lh10_device::write_h(offs_t offset, u8 data) { LOG_MMC(("lh10 write_h, offset: %04x, data: %02x\n", offset, data)); - if (offset >= 0x4000 && offset < 0x6000) - m_prgram[offset & 0x1fff] = data; - else + switch (offset & 0x6001) { - switch (offset & 0x6001) - { - case 0x0000: - m_latch = data & 7; - break; - case 0x0001: - m_reg[m_latch] = data; - update_prg(); - break; - } + case 0x0000: + m_latch = data & 7; + break; + case 0x0001: + switch (m_latch) + { + case 6: + case 7: + prg8_x(m_latch & 1, data & 0x0f); + break; + } + break; + case 0x4000: + case 0x4001: + m_prgram[offset & 0x1fff] = data; + break; } } @@ -1853,11 +1847,9 @@ void nes_lh51_device::write_h(offs_t offset, u8 data) switch (offset & 0x6000) { case 0x0000: - case 0x1000: prg8_89(data & 0x0f); break; case 0x6000: - case 0x7000: set_nt_mirroring(BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT); break; } diff --git a/src/devices/bus/nes/bootleg.h b/src/devices/bus/nes/bootleg.h index c3f959145db..2f97f94444e 100644 --- a/src/devices/bus/nes/bootleg.h +++ b/src/devices/bus/nes/bootleg.h @@ -534,11 +534,11 @@ class nes_lh10_device : public nes_nrom_device { public: // construction/destruction - nes_lh10_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_lh10_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual uint8_t read_h(offs_t offset) override; - virtual uint8_t read_m(offs_t offset) override; - virtual void write_h(offs_t offset, uint8_t data) override; + virtual u8 read_h(offs_t offset) override; + virtual u8 read_m(offs_t offset) override; + virtual void write_h(offs_t offset, u8 data) override; virtual void pcb_reset() override; @@ -547,9 +547,7 @@ protected: virtual void device_start() override; private: - void update_prg(); - uint8_t m_latch; - uint8_t m_reg[8]; + u8 m_latch; }; diff --git a/src/devices/bus/nes/discrete.cpp b/src/devices/bus/nes/discrete.cpp index 507e6bfd030..5b047a2daad 100644 --- a/src/devices/bus/nes/discrete.cpp +++ b/src/devices/bus/nes/discrete.cpp @@ -38,22 +38,22 @@ DEFINE_DEVICE_TYPE(NES_74X377, nes_74x377_device, "nes_74x377", DEFINE_DEVICE_TYPE(NES_74X161X138, nes_74x161x138_device, "nes_bitcorp_dis", "NES Cart Discrete Logic (74*161/138) PCB") -nes_74x161x161x32_device::nes_74x161x161x32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_74x161x161x32_device::nes_74x161x161x32_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_74X161X161X32, tag, owner, clock) { } -nes_74x139x74_device::nes_74x139x74_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_74x139x74_device::nes_74x139x74_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_74X139X74, tag, owner, clock) { } -nes_74x377_device::nes_74x377_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_74x377_device::nes_74x377_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_74X377, tag, owner, clock) { } -nes_74x161x138_device::nes_74x161x138_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_74x161x138_device::nes_74x161x138_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_74X161X138, tag, owner, clock) { } @@ -63,18 +63,11 @@ nes_74x161x138_device::nes_74x161x138_device(const machine_config &mconfig, cons void nes_74x161x161x32_device::pcb_reset() { - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - prg16_89ab(0); - prg16_cdef(m_prg_chunks - 1); - chr8(0, m_chr_source); -} - -void nes_74x139x74_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; prg16_89ab(0); prg16_cdef(m_prg_chunks - 1); chr8(0, m_chr_source); + if (m_pcb_ctrl_mirror) + set_nt_mirroring(PPU_MIRROR_LOW); } @@ -97,7 +90,7 @@ void nes_74x139x74_device::pcb_reset() -------------------------------------------------*/ // there are two 'variants' depending on hardwired or mapper ctrl mirroring -void nes_74x161x161x32_device::write_h(offs_t offset, uint8_t data) +void nes_74x161x161x32_device::write_h(offs_t offset, u8 data) { LOG_MMC(("74x161x161x32 write_h, offset: %04x, data: %02x\n", offset, data)); @@ -118,7 +111,7 @@ void nes_74x161x161x32_device::write_h(offs_t offset, uint8_t data) -------------------------------------------------*/ -void nes_74x139x74_device::write_m(offs_t offset, uint8_t data) +void nes_74x139x74_device::write_m(offs_t offset, u8 data) { LOG_MMC(("74x139x74 write_m, offset: %04x, data: %02x\n", offset, data)); @@ -133,7 +126,7 @@ void nes_74x139x74_device::write_m(offs_t offset, uint8_t data) iNES: mapper 11 - In MESS: Supported + In MAME: Supported Note: bit2 & bit3 are actually related to CIC lockout defeating, and real Color Dreams titles use only @@ -142,7 +135,7 @@ void nes_74x139x74_device::write_m(offs_t offset, uint8_t data) -------------------------------------------------*/ -void nes_74x377_device::write_h(offs_t offset, uint8_t data) +void nes_74x377_device::write_h(offs_t offset, u8 data) { LOG_MMC(("74x377 write_h, offset: %04x, data: %02x\n", offset, data)); @@ -163,7 +156,7 @@ void nes_74x377_device::write_h(offs_t offset, uint8_t data) -------------------------------------------------*/ -void nes_74x161x138_device::write_m(offs_t offset, uint8_t data) +void nes_74x161x138_device::write_m(offs_t offset, u8 data) { LOG_MMC(("74x161x138 write_m, offset: %04x, data: %02x\n", offset, data)); diff --git a/src/devices/bus/nes/discrete.h b/src/devices/bus/nes/discrete.h index 0f8f308aa96..ec3ad88d824 100644 --- a/src/devices/bus/nes/discrete.h +++ b/src/devices/bus/nes/discrete.h @@ -14,9 +14,9 @@ class nes_74x161x161x32_device : public nes_nrom_device { public: // construction/destruction - nes_74x161x161x32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_74x161x161x32_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual void write_h(offs_t offset, uint8_t data) override; + virtual void write_h(offs_t offset, u8 data) override; virtual void pcb_reset() override; }; @@ -28,11 +28,9 @@ class nes_74x139x74_device : public nes_nrom_device { public: // construction/destruction - nes_74x139x74_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_74x139x74_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual void write_m(offs_t offset, uint8_t data) override; - - virtual void pcb_reset() override; + virtual void write_m(offs_t offset, u8 data) override; }; @@ -42,9 +40,9 @@ class nes_74x377_device : public nes_nrom_device { public: // construction/destruction - nes_74x377_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_74x377_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual void write_h(offs_t offset, uint8_t data) override; + virtual void write_h(offs_t offset, u8 data) override; }; @@ -54,9 +52,9 @@ class nes_74x161x138_device : public nes_nrom_device { public: // construction/destruction - nes_74x161x138_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_74x161x138_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual void write_m(offs_t offset, uint8_t data) override; + virtual void write_m(offs_t offset, u8 data) override; }; diff --git a/src/devices/bus/nes/jaleco.cpp b/src/devices/bus/nes/jaleco.cpp index 44c6a0209a7..e88af117c12 100644 --- a/src/devices/bus/nes/jaleco.cpp +++ b/src/devices/bus/nes/jaleco.cpp @@ -51,90 +51,84 @@ DEFINE_DEVICE_TYPE(NES_JF29, nes_jf29_device, "nes_jf29", "NES C DEFINE_DEVICE_TYPE(NES_JF33, nes_jf33_device, "nes_jf33", "NES Cart Jaleco JF-33 (Moe Pro! Saikyou-hen) PCB") -nes_jf11_device::nes_jf11_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_jf11_device::nes_jf11_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_JF11, tag, owner, clock) { } -nes_jf13_device::nes_jf13_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_jf13_device::nes_jf13_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_JF13, tag, owner, clock) , m_samples(*this, "samples") { } -nes_jf16_device::nes_jf16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_jf16_device::nes_jf16_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_nrom_device(mconfig, NES_JF16, tag, owner, clock) { } -nes_jf17_device::nes_jf17_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) - : nes_nrom_device(mconfig, type, tag, owner, clock), m_latch(0) +nes_jf17_device::nes_jf17_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, bool prg_flip) + : nes_nrom_device(mconfig, type, tag, owner, clock) + , m_samples(*this, "samples") + , m_latch(0) + , m_prg_flip(prg_flip) { } -nes_jf17_device::nes_jf17_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : nes_jf17_device(mconfig, NES_JF17, tag, owner, clock) +nes_jf17_device::nes_jf17_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_jf17_device(mconfig, NES_JF17, tag, owner, clock, false) { } -nes_jf17_adpcm_device::nes_jf17_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : nes_jf17_device(mconfig, NES_JF17_ADPCM, tag, owner, clock) - , m_samples(*this, "samples") +nes_jf17_adpcm_device::nes_jf17_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_jf17_device(mconfig, NES_JF17_ADPCM, tag, owner, clock, false) { } -nes_jf19_device::nes_jf19_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) - : nes_nrom_device(mconfig, type, tag, owner, clock) +nes_jf19_device::nes_jf19_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_jf17_device(mconfig, NES_JF19, tag, owner, clock, true) { } -nes_jf19_device::nes_jf19_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : nes_jf19_device(mconfig, NES_JF19, tag, owner, clock) +nes_jf19_adpcm_device::nes_jf19_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_jf17_device(mconfig, NES_JF19_ADPCM, tag, owner, clock, true) { } -nes_jf19_adpcm_device::nes_jf19_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : nes_jf19_device(mconfig, NES_JF19_ADPCM, tag, owner, clock) +nes_ss88006_device::nes_ss88006_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) + : nes_nrom_device(mconfig, type, tag, owner, clock) , m_samples(*this, "samples") + , m_irq_count(0) + , m_irq_count_latch(0) + , m_irq_mode(0) + , m_irq_enable(0) + , irq_timer(nullptr) + , m_wram_protect(0) { } -nes_ss88006_device::nes_ss88006_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) - : nes_nrom_device(mconfig, type, tag, owner, clock), m_irq_count(0), m_irq_count_latch(0), m_irq_mode(0), m_irq_enable(0), irq_timer(nullptr), m_latch(0) -{ -} - -nes_ss88006_device::nes_ss88006_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +nes_ss88006_device::nes_ss88006_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : nes_ss88006_device(mconfig, NES_SS88006, tag, owner, clock) { } -nes_ss88006_adpcm_device::nes_ss88006_adpcm_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) - : nes_ss88006_device(mconfig, type, tag, owner, clock) +nes_jf23_device::nes_jf23_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_ss88006_device(mconfig, NES_JF23, tag, owner, clock) { } -nes_jf23_device::nes_jf23_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : nes_ss88006_adpcm_device(mconfig, NES_JF23, tag, owner, clock) - , m_samples(*this, "samples") +nes_jf24_device::nes_jf24_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_ss88006_device(mconfig, NES_JF24, tag, owner, clock) { } -nes_jf24_device::nes_jf24_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : nes_ss88006_adpcm_device(mconfig, NES_JF24, tag, owner, clock) - , m_samples(*this, "samples") +nes_jf29_device::nes_jf29_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_ss88006_device(mconfig, NES_JF29, tag, owner, clock) { } -nes_jf29_device::nes_jf29_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : nes_ss88006_adpcm_device(mconfig, NES_JF29, tag, owner, clock) - , m_samples(*this, "samples") -{ -} - -nes_jf33_device::nes_jf33_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : nes_ss88006_adpcm_device(mconfig, NES_JF33, tag, owner, clock) - , m_samples(*this, "samples") +nes_jf33_device::nes_jf33_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : nes_ss88006_device(mconfig, NES_JF33, tag, owner, clock) { } @@ -142,10 +136,10 @@ nes_jf33_device::nes_jf33_device(const machine_config &mconfig, const char *tag, void nes_jf16_device::pcb_reset() { - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; prg16_89ab(0); prg16_cdef(m_prg_chunks - 1); chr8(0, m_chr_source); + set_nt_mirroring(PPU_MIRROR_LOW); } void nes_jf17_device::device_start() @@ -156,9 +150,8 @@ void nes_jf17_device::device_start() void nes_jf17_device::pcb_reset() { - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; prg16_89ab(0); - prg16_cdef(m_prg_chunks - 1); + prg16_cdef(m_prg_flip ? 0 : m_prg_chunks - 1); chr8(0, m_chr_source); m_latch = 0; } @@ -175,23 +168,22 @@ void nes_ss88006_device::device_start() save_item(NAME(m_irq_count)); save_item(NAME(m_irq_count_latch)); save_item(NAME(m_irq_mode)); - save_item(NAME(m_latch)); + save_item(NAME(m_wram_protect)); } void nes_ss88006_device::pcb_reset() { - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; prg16_89ab(0); prg16_cdef(m_prg_chunks - 1); chr8(0, m_chr_source); - memset(m_mmc_prg_bank, 0, sizeof(m_mmc_prg_bank)); - memset(m_mmc_vrom_bank, 0, sizeof(m_mmc_vrom_bank)); + std::fill(std::begin(m_mmc_prg_bank), std::end(m_mmc_prg_bank), 0x00); + std::fill(std::begin(m_mmc_vrom_bank), std::end(m_mmc_vrom_bank), 0x00); m_irq_enable = 0; m_irq_mode = 0; m_irq_count = 0; m_irq_count_latch = 0; - m_latch = 0; + m_wram_protect = 0; } @@ -203,15 +195,16 @@ void nes_ss88006_device::pcb_reset() Jaleco JF-11, JF-12 & JF-14 boards emulation - Games: Bio Senshi Dan, Mississippi Satsujin Jiken + Games: Bio Senshi Dan, Mississippi Satsujin Jiken, + Yousai Club iNES: mapper 140 - In MESS: Supported. + In MAME: Supported. -------------------------------------------------*/ -void nes_jf11_device::write_m(offs_t offset, uint8_t data) +void nes_jf11_device::write_m(offs_t offset, u8 data) { LOG_MMC(("jf11 write_m, offset: %04x, data: %02x\n", offset, data)); chr8(data, CHRROM); @@ -228,11 +221,11 @@ void nes_jf11_device::write_m(offs_t offset, uint8_t data) iNES: mapper 86 - In MESS: Supported. + In MAME: Supported. -------------------------------------------------*/ -void nes_jf13_device::write_m(offs_t offset, uint8_t data) +void nes_jf13_device::write_m(offs_t offset, u8 data) { LOG_MMC(("jf13 write_m, offset: %04x, data: %02x\n", offset, data)); @@ -241,25 +234,21 @@ void nes_jf13_device::write_m(offs_t offset, uint8_t data) prg32(BIT(data, 4, 2)); chr8(bitswap<3>(data, 6, 1, 0), CHRROM); } - else - { -// printf("sample write: offset: %04x, data: %02x\n", offset, data); - if (data & 0x20) - m_samples->start(data & 0x0f, data & 0x0f); - else - m_samples->stop_all(); - } + else if ((data & 0x30) == 0x20) + m_samples->start(data & 0x0f, data & 0x0f); } /*------------------------------------------------- Jaleco JF-16 board emulation + Games: Uchuusen Cosmo Carrier + iNES: mapper 78 (shared with a diff Irem board) -------------------------------------------------*/ -void nes_jf16_device::write_h(offs_t offset, uint8_t data) +void nes_jf16_device::write_h(offs_t offset, u8 data) { LOG_MMC(("jf16 write_h, offset: %04x, data: %02x\n", offset, data)); @@ -274,98 +263,42 @@ void nes_jf16_device::write_h(offs_t offset, uint8_t data) /*------------------------------------------------- - Jaleco JF-17 boards emulation + Jaleco JF-17 & JF-19 boards emulation Note: we don't emulate the additional sound hardware for Moero!! Pro Tennis Games: Moero!! Juudou Warriors, Moero!! Pro Tennis, Pinball - Quest Jpn + Quest Jpn, Moero Pro Soccer, Moero Pro Yakyuu '88 - iNES: mapper 72 + iNES: mapper 72 & 92 - In MESS: Supported, see below for the Moero Pro Tennis + In MAME: Supported, see below for the games with samples -------------------------------------------------*/ -void nes_jf17_device::write_h(offs_t offset, uint8_t data) +void nes_jf17_device::write_h(offs_t offset, u8 data) { LOG_MMC(("jf17 write_h, offset: %04x, data: %02x\n", offset, data)); // this pcb is subject to bus conflict data = account_bus_conflict(offset, data); - if (BIT(m_latch, 7) && !BIT(data, 7)) - prg16_89ab(m_latch & 0x07); - if (BIT(m_latch, 6) && !BIT(data, 6)) - chr8(m_latch & 0x0f, CHRROM); - - m_latch = data; -} - -void nes_jf17_adpcm_device::write_h(offs_t offset, uint8_t data) -{ - LOG_MMC(("jf17 + ADPCM write_h, offset: %04x, data: %02x\n", offset, data)); - - // this pcb is subject to bus conflict - data = account_bus_conflict(offset, data); - - if (BIT(m_latch, 7) && !BIT(data, 7)) - prg16_89ab(m_latch & 0x07); - if (BIT(m_latch, 6) && !BIT(data, 6)) - chr8(m_latch & 0x0f, CHRROM); - if (BIT(data, 5) && !BIT(data,4)) + if (BIT(data, 7) && !BIT(m_latch, 7)) // 74174 clocks on 0 -> 1 { -// printf("sample write: offset: %04x, data: %02x\n", offset, data); - m_samples->start(offset & 0x1f, offset & 0x1f); + if (m_prg_flip) + prg16_cdef(data & 0x0f); + else + prg16_89ab(data & 0x07); } - - m_latch = data; -} - -/*------------------------------------------------- - - Jaleco JF-19 boards emulation - - Note: we don't emulate the additional sound hardware. - - Games: Moero Pro Soccer, Moero Pro Yakyuu '88 - - iNES: mapper 92 - - In MESS: Supported, see below for the Moero Pro Yakyuu '88 - - -------------------------------------------------*/ - -void nes_jf19_device::write_h(offs_t offset, uint8_t data) -{ - LOG_MMC(("jf19 write_h, offset: %04x, data: %02x\n", offset, data)); - - // this pcb is subject to bus conflict - data = account_bus_conflict(offset, data); - - if (BIT(data, 7)) - prg16_cdef(data & 0x0f); - if (BIT(data, 6)) + if (BIT(data, 6) && !BIT(m_latch, 6)) // 74174 clocks on 0 -> 1 chr8(data & 0x0f, CHRROM); -} - -void nes_jf19_adpcm_device::write_h(offs_t offset, uint8_t data) -{ - LOG_MMC(("jf19 + ADPCM write_h, offset: %04x, data: %02x\n", offset, data)); - // this pcb is subject to bus conflict - data = account_bus_conflict(offset, data); + m_latch = data; - if (BIT(data, 7)) - prg16_cdef(data & 0x0f); - if (BIT(data, 6)) - chr8(data & 0x0f, CHRROM); - if (BIT(data, 5) && !BIT(data,4)) - { -// printf("sample write: offset: %04x, data: %02x\n", offset, data); - m_samples->start(offset & 0x1f, offset & 0x1f); - } + if (m_samples) + if ((data & 0x30) == 0x20) + m_samples->start(offset & 0x1f, offset & 0x1f); } /*------------------------------------------------- @@ -378,7 +311,7 @@ void nes_jf19_adpcm_device::write_h(offs_t offset, uint8_t data) iNES: mapper 18 - In MESS: Supported, see below for the games with samples + In MAME: Supported, see below for the games with samples -------------------------------------------------*/ @@ -388,110 +321,86 @@ void nes_ss88006_device::device_timer(emu_timer &timer, device_timer_id id, int { if (m_irq_enable) { - if (m_irq_mode & 0x08) // 4bits counter - { - if (!(m_irq_count & 0x000f)) - { - set_irq_line(ASSERT_LINE); - m_irq_count = (m_irq_count & 0xfff0) | 0x000f; - } - else - m_irq_count = (m_irq_count & 0xfff0) | ((m_irq_count & 0x000f) - 1); - } - else if (m_irq_mode & 0x04) // 8bits counter - { - if (!(m_irq_count & 0x00ff)) - { - set_irq_line(ASSERT_LINE); - m_irq_count = (m_irq_count & 0xff00) | 0x00ff; - } - else - m_irq_count = (m_irq_count & 0xff00) | ((m_irq_count & 0x00ff) - 1); - } - else if (m_irq_mode & 0x02) // 12bits counter - { - if (!(m_irq_count & 0x0fff)) - { - set_irq_line(ASSERT_LINE); - m_irq_count = (m_irq_count & 0xf000) | 0x0fff; - } - else - m_irq_count = (m_irq_count & 0xf000) | ((m_irq_count & 0x0fff) - 1); - } - else // 16bits counter - { - if (!m_irq_count) - { - set_irq_line(ASSERT_LINE); - m_irq_count = 0xffff; - } - else - m_irq_count = m_irq_count - 1; - } + u16 mask = 0xffff; // 16-bit counter (default) + + if (BIT(m_irq_mode, 3)) // 4-bit counter + mask = 0x000f; + else if (BIT(m_irq_mode, 2)) // 8-bit counter + mask = 0x00ff; + else if (BIT(m_irq_mode, 1)) // 12-bit counter + mask = 0x0fff; + + m_irq_count = (m_irq_count & ~mask) | ((m_irq_count - 1) & mask); + + if ((m_irq_count & mask) == mask) + set_irq_line(ASSERT_LINE); } } } -void nes_ss88006_device::ss88006_write(offs_t offset, uint8_t data) +u8 nes_ss88006_device::read_m(offs_t offset) +{ + LOG_MMC(("ss88006 read_m, offset: %04x\n", offset)); + + if (m_wram_protect & 1) // RAM enabled + return device_nes_cart_interface::read_m(offset); + + return get_open_bus(); +} + +void nes_ss88006_device::write_m(offs_t offset, u8 data) +{ + LOG_MMC(("ss88006 write_m, offset: %04x, data: %02x\n", offset, data)); + + if (m_wram_protect == 0x03) // RAM enabled and writable + device_nes_cart_interface::write_m(offset, data); +} + +void nes_ss88006_device::write_h(offs_t offset, u8 data) { - uint8_t bank; LOG_MMC(("ss88006 write_h, offset: %04x, data: %02x\n", offset, data)); + int bank, shift; + switch (offset & 0x7003) { case 0x0000: - m_mmc_prg_bank[0] = (m_mmc_prg_bank[0] & 0xf0) | (data & 0x0f); - prg8_89(m_mmc_prg_bank[0]); - break; case 0x0001: - m_mmc_prg_bank[0] = (m_mmc_prg_bank[0] & 0x0f) | (data << 4); - prg8_89(m_mmc_prg_bank[0]); - break; case 0x0002: - m_mmc_prg_bank[1] = (m_mmc_prg_bank[1] & 0xf0) | (data & 0x0f); - prg8_ab(m_mmc_prg_bank[1]); - break; case 0x0003: - m_mmc_prg_bank[1] = (m_mmc_prg_bank[1] & 0x0f) | (data << 4); - prg8_ab(m_mmc_prg_bank[1]); - break; case 0x1000: - m_mmc_prg_bank[2] = (m_mmc_prg_bank[2] & 0xf0) | (data & 0x0f); - prg8_cd(m_mmc_prg_bank[2]); - break; case 0x1001: - m_mmc_prg_bank[2] = (m_mmc_prg_bank[2] & 0x0f) | (data << 4); - prg8_cd(m_mmc_prg_bank[2]); + bank = bitswap<2>(offset, 12, 1); + shift = (offset & 1) << 2; + m_mmc_prg_bank[bank] &= ~(0x0f << shift); + m_mmc_prg_bank[bank] |= (data & 0x0f) << shift; + prg8_x(bank, m_mmc_prg_bank[bank]); break; - /* $9002, 3 (1002, 3) uncaught = Jaleco Baseball writes 0 */ - /* believe it's related to battery-backed ram enable/disable */ + case 0x1002: + m_wram_protect = data & 0x03; + break; case 0x2000: case 0x2001: case 0x2002: case 0x2003: case 0x3000: case 0x3001: case 0x3002: case 0x3003: case 0x4000: case 0x4001: case 0x4002: case 0x4003: case 0x5000: case 0x5001: case 0x5002: case 0x5003: bank = 2 * (BIT(offset, 12, 3) - 2) + BIT(offset, 1); - if (offset & 0x0001) - m_mmc_vrom_bank[bank] = (m_mmc_vrom_bank[bank] & 0x0f) | ((data & 0x0f) << 4); - else - m_mmc_vrom_bank[bank] = (m_mmc_vrom_bank[bank] & 0xf0) | (data & 0x0f); - + shift = (offset & 1) << 2; + m_mmc_vrom_bank[bank] &= ~(0x0f << shift); + m_mmc_vrom_bank[bank] |= (data & 0x0f) << shift; chr1_x(bank, m_mmc_vrom_bank[bank], CHRROM); break; case 0x6000: - m_irq_count_latch = (m_irq_count_latch & 0xfff0) | (data & 0x0f); - break; case 0x6001: - m_irq_count_latch = (m_irq_count_latch & 0xff0f) | ((data & 0x0f) << 4); - break; case 0x6002: - m_irq_count_latch = (m_irq_count_latch & 0xf0ff) | ((data & 0x0f) << 8); - break; case 0x6003: - m_irq_count_latch = (m_irq_count_latch & 0x0fff) | ((data & 0x0f) << 12); + shift = 4 * (offset & 0x03); + m_irq_count_latch &= ~(0x000f << shift); + m_irq_count_latch |= (data & 0x0f) << shift; break; + case 0x7000: m_irq_count = m_irq_count_latch; set_irq_line(CLEAR_LINE); @@ -512,34 +421,14 @@ void nes_ss88006_device::ss88006_write(offs_t offset, uint8_t data) } break; - default: - logerror("Jaleco SS88006 uncaught write, addr: %04x, value: %02x\n", offset + 0x8000, data); - break; - } -} - - -// bits2-bits6 are sample number, bit1 is setup/enable/disable -// program first write sample # + bit1 set to 'init' the sample -// then it writes sample # + bit1 clear to 'start' the sample -void nes_ss88006_adpcm_device::ss88006_adpcm_write(offs_t offset, uint8_t data, samples_device &dev) -{ - LOG_MMC(("ss88006 write_h, offset: %04x, data: %02x\n", offset, data)); - - switch (offset & 0x7003) - { case 0x7003: - if ((m_latch & 0x7c) == (data & 0x7c)) - { -// printf("sample write: data: %02x\n", data); - if ((m_latch & 2) && !(data & 2)) - dev.start(BIT(data, 2, 5), BIT(data, 2, 5)); - } - m_latch = data; + if (m_samples) + if ((data & 0x03) == 0x02) + m_samples->start(BIT(data, 2, 5), BIT(data, 2, 5)); break; default: - ss88006_write(offset, data); + logerror("Jaleco SS88006 uncaught write, addr: %04x, value: %02x\n", offset + 0x8000, data); break; } } @@ -570,13 +459,13 @@ static const char *const jf13_sample_names[] = "04", // safe "05", // foul "06", // (catcher obtains the ball) - "07", // you're out + "07", // batter out "08", // play ball "09", // ball four "10", // home run "11", // new pitcher "12", // ouch (pitcher hits batter) - "13", // ?? + "13", // aho (idiot) "14", // (bat hits the ball) "15", // (crowd) nullptr diff --git a/src/devices/bus/nes/jaleco.h b/src/devices/bus/nes/jaleco.h index 5529142ae01..55c3161126c 100644 --- a/src/devices/bus/nes/jaleco.h +++ b/src/devices/bus/nes/jaleco.h @@ -15,9 +15,9 @@ class nes_jf11_device : public nes_nrom_device { public: // construction/destruction - nes_jf11_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_jf11_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual void write_m(offs_t offset, uint8_t data) override; + virtual void write_m(offs_t offset, u8 data) override; }; @@ -27,9 +27,9 @@ class nes_jf13_device : public nes_nrom_device { public: // construction/destruction - nes_jf13_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_jf13_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual void write_m(offs_t offset, uint8_t data) override; + virtual void write_m(offs_t offset, u8 data) override; protected: // device-level overrides @@ -46,9 +46,9 @@ class nes_jf16_device : public nes_nrom_device { public: // construction/destruction - nes_jf16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_jf16_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual void write_h(offs_t offset, uint8_t data) override; + virtual void write_h(offs_t offset, u8 data) override; virtual void pcb_reset() override; }; @@ -60,19 +60,23 @@ class nes_jf17_device : public nes_nrom_device { public: // construction/destruction - nes_jf17_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_jf17_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - virtual void write_h(offs_t offset, uint8_t data) override; + virtual void write_h(offs_t offset, u8 data) override; virtual void pcb_reset() override; protected: - nes_jf17_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + nes_jf17_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, bool m_prg_flip); // device-level overrides virtual void device_start() override; - uint8_t m_latch; + optional_device<samples_device> m_samples; + +private: + u8 m_latch; + bool m_prg_flip; }; @@ -82,48 +86,33 @@ class nes_jf17_adpcm_device : public nes_jf17_device { public: // construction/destruction - nes_jf17_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - - virtual void write_h(offs_t offset, uint8_t data) override; + nes_jf17_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); protected: virtual void device_add_mconfig(machine_config &config) override; - -private: - required_device<samples_device> m_samples; }; // ======================> nes_jf19_device -class nes_jf19_device : public nes_nrom_device +class nes_jf19_device : public nes_jf17_device { public: // construction/destruction - nes_jf19_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - - virtual void write_h(offs_t offset, uint8_t data) override; - -protected: - nes_jf19_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + nes_jf19_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); }; // ======================> nes_jf19_adpcm_device -class nes_jf19_adpcm_device : public nes_jf19_device +class nes_jf19_adpcm_device : public nes_jf17_device { public: // construction/destruction - nes_jf19_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - - virtual void write_h(offs_t offset, uint8_t data) override; + nes_jf19_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); protected: virtual void device_add_mconfig(machine_config &config) override; - -private: - required_device<samples_device> m_samples; }; @@ -133,115 +122,86 @@ class nes_ss88006_device : public nes_nrom_device { public: // construction/destruction - nes_ss88006_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_ss88006_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); - void ss88006_write(offs_t offset, uint8_t data); - virtual void write_h(offs_t offset, uint8_t data) override { ss88006_write(offset, data); } + virtual u8 read_m(offs_t offset) override; + virtual void write_m(offs_t offset, u8 data) override; + virtual void write_h(offs_t offset, u8 data) override; virtual void pcb_reset() override; protected: - nes_ss88006_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + nes_ss88006_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); // device-level overrides virtual void device_start() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param) override; - uint16_t m_irq_count, m_irq_count_latch; - uint8_t m_irq_mode; - int m_irq_enable; - - static const device_timer_id TIMER_IRQ = 0; - emu_timer *irq_timer; - - uint8_t m_mmc_prg_bank[3]; - uint8_t m_mmc_vrom_bank[8]; - - uint8_t m_latch; // used for samples, in derived classes -}; + optional_device<samples_device> m_samples; +private: + u16 m_irq_count, m_irq_count_latch; + u8 m_irq_mode; + u8 m_irq_enable; -// ======================> nes_ss88006_adpcm_device - -class nes_ss88006_adpcm_device : public nes_ss88006_device -{ -protected: - // construction/destruction - nes_ss88006_adpcm_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + static constexpr device_timer_id TIMER_IRQ = 0; + emu_timer *irq_timer; - void ss88006_adpcm_write(offs_t offset, uint8_t data, samples_device &dev); + u8 m_mmc_prg_bank[3]; + u8 m_mmc_vrom_bank[8]; + u8 m_wram_protect; }; // ======================> nes_jf23_device -class nes_jf23_device : public nes_ss88006_adpcm_device +class nes_jf23_device : public nes_ss88006_device { public: // construction/destruction - nes_jf23_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_jf23_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); protected: virtual void device_add_mconfig(machine_config &config) override; - -private: - virtual void write_h(offs_t offset, uint8_t data) override { ss88006_adpcm_write(offset, data, *m_samples); } - - required_device<samples_device> m_samples; }; // ======================> nes_jf24_device -class nes_jf24_device : public nes_ss88006_adpcm_device +class nes_jf24_device : public nes_ss88006_device { public: // construction/destruction - nes_jf24_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_jf24_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); protected: virtual void device_add_mconfig(machine_config &config) override; - -private: - virtual void write_h(offs_t offset, uint8_t data) override { ss88006_adpcm_write(offset, data, *m_samples); } - - required_device<samples_device> m_samples; }; // ======================> nes_jf29_device -class nes_jf29_device : public nes_ss88006_adpcm_device +class nes_jf29_device : public nes_ss88006_device { public: // construction/destruction - nes_jf29_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_jf29_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); protected: virtual void device_add_mconfig(machine_config &config) override; - -private: - virtual void write_h(offs_t offset, uint8_t data) override { ss88006_adpcm_write(offset, data, *m_samples); } - - required_device<samples_device> m_samples; }; // ======================> nes_jf33_device -class nes_jf33_device : public nes_ss88006_adpcm_device +class nes_jf33_device : public nes_ss88006_device { public: // construction/destruction - nes_jf33_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + nes_jf33_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); protected: virtual void device_add_mconfig(machine_config &config) override; - -private: - virtual void write_h(offs_t offset, uint8_t data) override { ss88006_adpcm_write(offset, data, *m_samples); } - - required_device<samples_device> m_samples; }; diff --git a/src/devices/cpu/z80/z80.cpp b/src/devices/cpu/z80/z80.cpp index df1bd7befbc..557fb3b595c 100644 --- a/src/devices/cpu/z80/z80.cpp +++ b/src/devices/cpu/z80/z80.cpp @@ -22,6 +22,18 @@ * behaviour on NEC Z80 is still unknown. * This Z80 emulator assumes a ZiLOG NMOS model. * + * Changes in 0.243: + * Fundation for M cycles emulation. Currently we preserve cc_* tables with total timings. + * execute_run() behavior (simplified) ... + * Before: + * + fetch opcode + * + call EXEC() + * + adjust icount base on cc_* (all T are used after M1 == wrong) + * + execute instruction + * Now: + * + fetch opcode + * + call EXEC() + + execute instruction adjusting icount per each Read (arg(), recursive rop()) and Write * Changes in 3.9: * - Fixed cycle counts for LD IYL/IXL/IYH/IXH,n [Marshmellow] * - Fixed X/Y flags in CCF/SCF/BIT, ZEXALL is happy now [hap] @@ -206,87 +218,87 @@ static const uint8_t cc_op[0x100] = { 4, 4, 4, 4, 4, 4, 7, 4, 4, 4, 4, 4, 4, 4, 7, 4, 4, 4, 4, 4, 4, 4, 7, 4, 4, 4, 4, 4, 4, 4, 7, 4, 4, 4, 4, 4, 4, 4, 7, 4, 4, 4, 4, 4, 4, 4, 7, 4, - 5,10,10,10,10,11, 7,11, 5,10,10, 0,10,17, 7,11, /* cb -> cc_cb */ - 5,10,10,11,10,11, 7,11, 5, 4,10,11,10, 0, 7,11, /* dd -> cc_xy */ - 5,10,10,19,10,11, 7,11, 5, 4,10, 4,10, 0, 7,11, /* ed -> cc_ed */ - 5,10,10, 4,10,11, 7,11, 5, 6,10, 4,10, 0, 7,11 /* fd -> cc_xy */ + 5,10,10,10,10,11, 7,11, 5,10,10, 4,10,17, 7,11, /* cb -> cc_cb */ + 5,10,10,11,10,11, 7,11, 5, 4,10,11,10, 4, 7,11, /* dd -> cc_xy */ + 5,10,10,19,10,11, 7,11, 5, 4,10, 4,10, 4, 7,11, /* ed -> cc_ed */ + 5,10,10, 4,10,11, 7,11, 5, 6,10, 4,10, 4, 7,11 /* fd -> cc_xy */ }; -static const uint8_t cc_cb[0x100] = { - 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, - 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, - 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, - 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, - 8, 8, 8, 8, 8, 8,12, 8, 8, 8, 8, 8, 8, 8,12, 8, - 8, 8, 8, 8, 8, 8,12, 8, 8, 8, 8, 8, 8, 8,12, 8, - 8, 8, 8, 8, 8, 8,12, 8, 8, 8, 8, 8, 8, 8,12, 8, - 8, 8, 8, 8, 8, 8,12, 8, 8, 8, 8, 8, 8, 8,12, 8, - 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, - 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, - 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, - 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, - 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, - 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, - 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8, - 8, 8, 8, 8, 8, 8,15, 8, 8, 8, 8, 8, 8, 8,15, 8 +static const u8 cc_cb[0x100] = { + 4, 4, 4, 4, 4, 4,11, 4, 4, 4, 4, 4, 4, 4,11, 4, + 4, 4, 4, 4, 4, 4,11, 4, 4, 4, 4, 4, 4, 4,11, 4, + 4, 4, 4, 4, 4, 4,11, 4, 4, 4, 4, 4, 4, 4,11, 4, + 4, 4, 4, 4, 4, 4,11, 4, 4, 4, 4, 4, 4, 4,11, 4, + 4, 4, 4, 4, 4, 4, 8, 4, 4, 4, 4, 4, 4, 4, 8, 4, + 4, 4, 4, 4, 4, 4, 8, 4, 4, 4, 4, 4, 4, 4, 8, 4, + 4, 4, 4, 4, 4, 4, 8, 4, 4, 4, 4, 4, 4, 4, 8, 4, + 4, 4, 4, 4, 4, 4, 8, 4, 4, 4, 4, 4, 4, 4, 8, 4, + 4, 4, 4, 4, 4, 4,11, 4, 4, 4, 4, 4, 4, 4,11, 4, + 4, 4, 4, 4, 4, 4,11, 4, 4, 4, 4, 4, 4, 4,11, 4, + 4, 4, 4, 4, 4, 4,11, 4, 4, 4, 4, 4, 4, 4,11, 4, + 4, 4, 4, 4, 4, 4,11, 4, 4, 4, 4, 4, 4, 4,11, 4, + 4, 4, 4, 4, 4, 4,11, 4, 4, 4, 4, 4, 4, 4,11, 4, + 4, 4, 4, 4, 4, 4,11, 4, 4, 4, 4, 4, 4, 4,11, 4, + 4, 4, 4, 4, 4, 4,11, 4, 4, 4, 4, 4, 4, 4,11, 4, + 4, 4, 4, 4, 4, 4,11, 4, 4, 4, 4, 4, 4, 4,11, 4 }; static const uint8_t cc_ed[0x100] = { - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 12,12,15,20,8,14, 8, 9,12,12,15,20, 8,14, 8, 9, - 12,12,15,20,8,14, 8, 9,12,12,15,20, 8,14, 8, 9, - 12,12,15,20,8,14, 8,18,12,12,15,20, 8,14, 8,18, - 12,12,15,20,8,14, 8, 8,12,12,15,20, 8,14, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 16,16,16,16,8, 8, 8, 8,16,16,16,16, 8, 8, 8, 8, - 16,16,16,16,8, 8, 8, 8,16,16,16,16, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 8, 8,11,16, 4,10, 4, 5, 8, 8,11,16, 4,10, 4, 5, + 8, 8,11,16, 4,10, 4, 5, 8, 8,11,16, 4,10, 4, 5, + 8, 8,11,16, 4,10, 4,14, 8, 8,11,16, 4,10, 4,14, + 8, 8,11,16, 4,10, 4, 4, 8, 8,11,16, 4,10, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 12,12,12,12,4, 4, 4, 4,12,12,12,12, 4, 4, 4, 4, + 12,12,12,12,4, 4, 4, 4,12,12,12,12, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }; -/* ix/iy: with the exception of (i+offset) opcodes, t-states are main_opcode_table + 4 */ +/* ix/iy: with the exception of (i+offset) opcodes, for total add t-states from main_opcode_table[DD/FD] == 4 */ static const uint8_t cc_xy[0x100] = { - 4+4,10+4, 7+4, 6+4, 4+4, 4+4, 7+4, 4+4, 4+4,11+4, 7+4, 6+4, 4+4, 4+4, 7+4, 4+4, - 8+4,10+4, 7+4, 6+4, 4+4, 4+4, 7+4, 4+4,12+4,11+4, 7+4, 6+4, 4+4, 4+4, 7+4, 4+4, - 7+4,10+4,16+4, 6+4, 4+4, 4+4, 7+4, 4+4, 7+4,11+4,16+4, 6+4, 4+4, 4+4, 7+4, 4+4, - 7+4,10+4,13+4, 6+4,23 ,23 ,19 , 4+4, 7+4,11+4,13+4, 6+4, 4+4, 4+4, 7+4, 4+4, - 4+4, 4+4, 4+4, 4+4, 4+4, 4+4,19 , 4+4, 4+4, 4+4, 4+4, 4+4, 4+4, 4+4,19 , 4+4, - 4+4, 4+4, 4+4, 4+4, 4+4, 4+4,19 , 4+4, 4+4, 4+4, 4+4, 4+4, 4+4, 4+4,19 , 4+4, - 4+4, 4+4, 4+4, 4+4, 4+4, 4+4,19 , 4+4, 4+4, 4+4, 4+4, 4+4, 4+4, 4+4,19 , 4+4, - 19 ,19 ,19 ,19 ,19 ,19 , 4+4,19 , 4+4, 4+4, 4+4, 4+4, 4+4, 4+4,19 , 4+4, - 4+4, 4+4, 4+4, 4+4, 4+4, 4+4,19 , 4+4, 4+4, 4+4, 4+4, 4+4, 4+4, 4+4,19 , 4+4, - 4+4, 4+4, 4+4, 4+4, 4+4, 4+4,19 , 4+4, 4+4, 4+4, 4+4, 4+4, 4+4, 4+4,19 , 4+4, - 4+4, 4+4, 4+4, 4+4, 4+4, 4+4,19 , 4+4, 4+4, 4+4, 4+4, 4+4, 4+4, 4+4,19 , 4+4, - 4+4, 4+4, 4+4, 4+4, 4+4, 4+4,19 , 4+4, 4+4, 4+4, 4+4, 4+4, 4+4, 4+4,19 , 4+4, - 5+4,10+4,10+4,10+4,10+4,11+4, 7+4,11+4, 5+4,10+4,10+4, 0 ,10+4,17+4, 7+4,11+4, /* cb -> cc_xycb */ - 5+4,10+4,10+4,11+4,10+4,11+4, 7+4,11+4, 5+4, 4+4,10+4,11+4,10+4, 4 , 7+4,11+4, /* dd -> cc_xy again */ - 5+4,10+4,10+4,19+4,10+4,11+4, 7+4,11+4, 5+4, 4+4,10+4, 4+4,10+4, 4 , 7+4,11+4, /* ed -> cc_ed */ - 5+4,10+4,10+4, 4+4,10+4,11+4, 7+4,11+4, 5+4, 6+4,10+4, 4+4,10+4, 4 , 7+4,11+4 /* fd -> cc_xy again */ + 4,10, 7, 6, 4, 4, 7, 4, 4,11, 7, 6, 4, 4, 7, 4, + 8,10, 7, 6, 4, 4, 7, 4,12,11, 7, 6, 4, 4, 7, 4, + 7,10,16, 6, 4, 4, 7, 4, 7,11,16, 6, 4, 4, 7, 4, + 7,10,13, 6,19,19,15, 4, 7,11,13, 6, 4, 4, 7, 4, + 4, 4, 4, 4, 4, 4,15, 4, 4, 4, 4, 4, 4, 4,15, 4, + 4, 4, 4, 4, 4, 4,15, 4, 4, 4, 4, 4, 4, 4,15, 4, + 4, 4, 4, 4, 4, 4,15, 4, 4, 4, 4, 4, 4, 4,15, 4, + 15,15,15,15,15,15, 4,15, 4, 4, 4, 4, 4, 4,15, 4, + 4, 4, 4, 4, 4, 4,15, 4, 4, 4, 4, 4, 4, 4,15, 4, + 4, 4, 4, 4, 4, 4,15, 4, 4, 4, 4, 4, 4, 4,15, 4, + 4, 4, 4, 4, 4, 4,15, 4, 4, 4, 4, 4, 4, 4,15, 4, + 4, 4, 4, 4, 4, 4,15, 4, 4, 4, 4, 4, 4, 4,15, 4, + 5,10,10,10,10,11, 7,11, 5,10,10, 7,10,17, 7,11, /* cb -> cc_xycb */ + 5,10,10,11,10,11, 7,11, 5, 4,10,11,10, 4, 7,11, /* dd -> cc_xy again */ + 5,10,10,19,10,11, 7,11, 5, 4,10, 4,10, 4, 7,11, /* ed -> cc_ed */ + 5,10,10, 4,10,11, 7,11, 5, 6,10, 4,10, 4, 7,11 /* fd -> cc_xy again */ }; static const uint8_t cc_xycb[0x100] = { - 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, - 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, - 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, - 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, - 20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20, - 20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20, - 20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20, - 20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20, - 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, - 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, - 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, - 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, - 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, - 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, - 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23, - 23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23 + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12 }; /* extra cycles if jr/jp/call taken and 'interrupt latency' on rst 0-7 */ @@ -320,7 +332,15 @@ static const uint8_t cc_ex[0x100] = { /*************************************************************** * adjust cycle count by n T-states ***************************************************************/ -#define CC(prefix,opcode) do { m_icount -= m_cc_##prefix[opcode]; } while (0) +#define CC(prefix,opcode) do { m_icount_executing += m_cc_##prefix == nullptr ? 0 : m_cc_##prefix[opcode]; } while (0) + +#define T(icount) do { \ + m_icount -= icount; \ + m_icount_executing -= icount; \ +} while (0) + +// T Memory Address +#define MTM ((m_cc_op == nullptr ? 4 : m_cc_op[0])-1) #define EXEC(prefix,opcode) do { \ unsigned op = opcode; \ @@ -392,6 +412,7 @@ static const uint8_t cc_ex[0x100] = { case 0xf8:prefix##_##f8();break; case 0xf9:prefix##_##f9();break; case 0xfa:prefix##_##fa();break; case 0xfb:prefix##_##fb();break; \ case 0xfc:prefix##_##fc();break; case 0xfd:prefix##_##fd();break; case 0xfe:prefix##_##fe();break; case 0xff:prefix##_##ff();break; \ } \ + if(m_icount_executing > 0) T(m_icount_executing); else m_icount_executing = 0; \ } while (0) /*************************************************************** @@ -423,7 +444,9 @@ inline void z80_device::leave_halt() ***************************************************************/ inline uint8_t z80_device::in(uint16_t port) { - return m_io.read_byte(port); + u8 res = m_io.read_byte(port); + T(4); + return res; } /*************************************************************** @@ -432,6 +455,7 @@ inline uint8_t z80_device::in(uint16_t port) inline void z80_device::out(uint16_t port, uint8_t value) { m_io.write_byte(port, value); + T(4); } /*************************************************************** @@ -439,7 +463,16 @@ inline void z80_device::out(uint16_t port, uint8_t value) ***************************************************************/ uint8_t z80_device::rm(uint16_t addr) { - return m_data.read_byte(addr); + u8 res = m_data.read_byte(addr); + T(MTM); + return res; +} + +uint8_t z80_device::rm_reg(uint16_t addr) +{ + u8 res = rm(addr); + nomreq_addr(addr, 1); + return res; } /*************************************************************** @@ -448,7 +481,7 @@ uint8_t z80_device::rm(uint16_t addr) inline void z80_device::rm16(uint16_t addr, PAIR &r) { r.b.l = rm(addr); - r.b.h = rm((addr+1)); + r.b.h = rm(addr+1); } /*************************************************************** @@ -456,7 +489,10 @@ inline void z80_device::rm16(uint16_t addr, PAIR &r) ***************************************************************/ void z80_device::wm(uint16_t addr, uint8_t value) { + // As we don't count changes between read and write, simply adjust to the end of requested. + if(m_icount_executing != MTM) T(m_icount_executing - MTM); m_data.write_byte(addr, value); + T(MTM); } /*************************************************************** @@ -464,8 +500,23 @@ void z80_device::wm(uint16_t addr, uint8_t value) ***************************************************************/ inline void z80_device::wm16(uint16_t addr, PAIR &r) { + m_icount_executing -= MTM; wm(addr, r.b.l); - wm((addr+1), r.b.h); + m_icount_executing += MTM; + wm(addr+1, r.b.h); +} + +/*************************************************************** + * Write a word to (SP) + ***************************************************************/ +inline void z80_device::wm16_sp(PAIR &r) +{ + SP--; + m_icount_executing -= MTM; + wm(SPD, r.b.h); + m_icount_executing += MTM; + SP--; + wm(SPD, r.b.l); } /*************************************************************** @@ -475,12 +526,15 @@ inline void z80_device::wm16(uint16_t addr, PAIR &r) ***************************************************************/ uint8_t z80_device::rop() { - unsigned pc = PCD; + // Use leftovers from previous instruction. Mainly to support recursive EXEC(.., rop()) + if(m_icount_executing) T(m_icount_executing); + uint8_t res = m_opcodes.read_byte(PCD); + T(execute_min_cycles()); + m_refresh_cb((m_i << 8) | (m_r2 & 0x80) | (m_r & 0x7f), 0x00, 0xff); + T(execute_min_cycles()); PC++; - uint8_t res = m_opcodes.read_byte(pc); - m_icount -= 2; - m_refresh_cb((m_i << 8) | (m_r2 & 0x80) | ((m_r-1) & 0x7f), 0x00, 0xff); - m_icount += 2; + m_r++; + return res; } @@ -492,16 +546,16 @@ uint8_t z80_device::rop() ***************************************************************/ uint8_t z80_device::arg() { - unsigned pc = PCD; + u8 res = m_args.read_byte(PCD); + T(MTM); PC++; - return m_args.read_byte(pc); + + return res; } uint16_t z80_device::arg16() { - unsigned pc = PCD; - PC += 2; - return m_args.read_word(pc); + return arg() | (arg() << 8); } /*************************************************************** @@ -534,8 +588,8 @@ inline void z80_device::pop(PAIR &r) ***************************************************************/ inline void z80_device::push(PAIR &r) { - SP -= 2; - wm16(SPD, r); + nomreq_ir(1); + wm16_sp(r); } /*************************************************************** @@ -558,9 +612,7 @@ inline void z80_device::jp_cond(bool cond) WZ = PCD; } else - { WZ = arg16(); /* implicit do PC += 2 */ - } } /*************************************************************** @@ -569,6 +621,7 @@ inline void z80_device::jp_cond(bool cond) inline void z80_device::jr() { int8_t a = (int8_t)arg(); /* arg() also increments PC */ + nomreq_addr(PCD-1, 5); PC += a; /* so don't do PC += arg() */ WZ = PC; } @@ -580,11 +633,15 @@ inline void z80_device::jr_cond(bool cond, uint8_t opcode) { if (cond) { - jr(); CC(ex, opcode); + jr(); } else - PC++; + { + WZ = arg(); + //nomreq_addr(PCD, 3); + //PC++; + } } /*************************************************************** @@ -593,8 +650,9 @@ inline void z80_device::jr_cond(bool cond, uint8_t opcode) inline void z80_device::call() { m_ea = arg16(); + nomreq_addr(PCD-1, 1); WZ = m_ea; - push(m_pc); + wm16_sp(m_pc); PCD = m_ea; } @@ -605,16 +663,15 @@ inline void z80_device::call_cond(bool cond, uint8_t opcode) { if (cond) { + CC(ex, opcode); m_ea = arg16(); + nomreq_addr(PCD-1, 1); WZ = m_ea; - push(m_pc); + wm16_sp(m_pc); PCD = m_ea; - CC(ex, opcode); } else - { WZ = arg16(); /* implicit call PC+=2; */ - } } /*************************************************************** @@ -622,11 +679,12 @@ inline void z80_device::call_cond(bool cond, uint8_t opcode) ***************************************************************/ inline void z80_device::ret_cond(bool cond, uint8_t opcode) { + nomreq_ir(1); if (cond) { + CC(ex, opcode); pop(m_pc); WZ = PC; - CC(ex, opcode); } } @@ -635,8 +693,7 @@ inline void z80_device::ret_cond(bool cond, uint8_t opcode) ***************************************************************/ inline void z80_device::retn() { - LOG(("Z80 RETN m_iff1:%d m_iff2:%d\n", - m_iff1, m_iff2)); + LOG(("Z80 RETN m_iff1:%d m_iff2:%d\n", m_iff1, m_iff2)); pop(m_pc); WZ = PC; m_iff1 = m_iff2; @@ -658,6 +715,7 @@ inline void z80_device::reti() ***************************************************************/ inline void z80_device::ld_r_a() { + nomreq_ir(1); m_r = A; m_r2 = A & 0x80; /* keep bit 7 of r */ } @@ -667,6 +725,7 @@ inline void z80_device::ld_r_a() ***************************************************************/ inline void z80_device::ld_a_r() { + nomreq_ir(1); A = (m_r & 0x7f) | m_r2; F = (F & CF) | SZ[A] | (m_iff2 << 2); m_after_ldair = true; @@ -677,6 +736,7 @@ inline void z80_device::ld_a_r() ***************************************************************/ inline void z80_device::ld_i_a() { + nomreq_ir(1); m_i = A; } @@ -685,6 +745,7 @@ inline void z80_device::ld_i_a() ***************************************************************/ inline void z80_device::ld_a_i() { + nomreq_ir(1); A = m_i; F = (F & CF) | SZ[A] | (m_iff2 << 2); m_after_ldair = true; @@ -695,6 +756,7 @@ inline void z80_device::ld_a_i() ***************************************************************/ inline void z80_device::rst(uint16_t addr) { + //nomreq_ir(1); push(m_pc); PCD = addr; WZ = PC; @@ -768,6 +830,7 @@ inline void z80_device::rrd() { uint8_t n = rm(HL); WZ = HL+1; + nomreq_addr(HL, 4); wm(HL, (n >> 4) | (A << 4)); A = (A & 0xf0) | (n & 0x0f); F = (F & CF) | SZP[A]; @@ -780,6 +843,7 @@ inline void z80_device::rld() { uint8_t n = rm(HL); WZ = HL+1; + nomreq_addr(HL, 4); wm(HL, (n << 4) | (A & 0x0f)); A = (A & 0xf0) | (n >> 4); F = (F & CF) | SZP[A]; @@ -845,11 +909,13 @@ inline void z80_device::neg() inline void z80_device::daa() { uint8_t a = A; - if (F & NF) { + if (F & NF) + { if ((F&HF) | ((A&0xf)>9)) a-=6; if ((F&CF) | (A>0x99)) a-=0x60; } - else { + else + { if ((F&HF) | ((A&0xf)>9)) a+=6; if ((F&CF) | (A>0x99)) a+=0x60; } @@ -932,8 +998,12 @@ inline void z80_device::exx() inline void z80_device::ex_sp(PAIR &r) { PAIR tmp = { { 0, 0, 0, 0 } }; - rm16(SPD, tmp); - wm16(SPD, r); + pop(tmp); + nomreq_addr(SPD - 1, 1); + m_icount_executing -= 2; + wm16_sp(r); + m_icount_executing += 2; + nomreq_addr(SPD, 2); r = tmp; WZ = r.d; } @@ -943,6 +1013,7 @@ inline void z80_device::ex_sp(PAIR &r) ***************************************************************/ inline void z80_device::add16(PAIR &dr, PAIR &sr) { + nomreq_ir(7); uint32_t res = dr.d + sr.d; WZ = dr.d + 1; F = (F & (SF | ZF | VF)) | @@ -956,6 +1027,7 @@ inline void z80_device::add16(PAIR &dr, PAIR &sr) ***************************************************************/ inline void z80_device::adc_hl(PAIR &r) { + nomreq_ir(7); uint32_t res = HLD + r.d + (F & CF); WZ = HL + 1; F = (((HLD ^ res ^ r.d) >> 8) & HF) | @@ -971,6 +1043,7 @@ inline void z80_device::adc_hl(PAIR &r) ***************************************************************/ inline void z80_device::sbc_hl(PAIR &r) { + nomreq_ir(7); uint32_t res = HLD - r.d - (F & CF); WZ = HL + 1; F = (((HLD ^ res ^ r.d) >> 8) & HF) | NF | @@ -1123,7 +1196,10 @@ inline uint8_t z80_device::set(int bit, uint8_t value) inline void z80_device::ldi() { uint8_t io = rm(HL); + m_icount_executing -= 2; wm(DE, io); + m_icount_executing += 2; + nomreq_addr(DE, 2); F &= SF | ZF | CF; if ((A + io) & 0x02) F |= YF; /* bit 1 -> flag 5 */ if ((A + io) & 0x08) F |= XF; /* bit 3 -> flag 3 */ @@ -1137,6 +1213,7 @@ inline void z80_device::ldi() inline void z80_device::cpi() { uint8_t val = rm(HL); + nomreq_addr(HL, 5); uint8_t res = A - val; WZ++; HL++; BC--; @@ -1152,6 +1229,7 @@ inline void z80_device::cpi() ***************************************************************/ inline void z80_device::ini() { + nomreq_ir(1); unsigned t; uint8_t io = in(BC); WZ = BC + 1; @@ -1170,6 +1248,7 @@ inline void z80_device::ini() ***************************************************************/ inline void z80_device::outi() { + nomreq_ir(1); unsigned t; uint8_t io = rm(HL); B--; @@ -1189,7 +1268,10 @@ inline void z80_device::outi() inline void z80_device::ldd() { uint8_t io = rm(HL); + m_icount_executing -= 2; wm(DE, io); + m_icount_executing += 2; + nomreq_addr(DE, 2); F &= SF | ZF | CF; if ((A + io) & 0x02) F |= YF; /* bit 1 -> flag 5 */ if ((A + io) & 0x08) F |= XF; /* bit 3 -> flag 3 */ @@ -1203,6 +1285,7 @@ inline void z80_device::ldd() inline void z80_device::cpd() { uint8_t val = rm(HL); + nomreq_addr(HL, 5); uint8_t res = A - val; WZ--; HL--; BC--; @@ -1218,6 +1301,7 @@ inline void z80_device::cpd() ***************************************************************/ inline void z80_device::ind() { + nomreq_ir(1); unsigned t; uint8_t io = in(BC); WZ = BC - 1; @@ -1236,6 +1320,7 @@ inline void z80_device::ind() ***************************************************************/ inline void z80_device::outd() { + nomreq_ir(1); unsigned t; uint8_t io = rm(HL); B--; @@ -1257,9 +1342,10 @@ inline void z80_device::ldir() ldi(); if (BC != 0) { + CC(ex, 0xb0); + nomreq_addr(DE, 5); PC -= 2; WZ = PC + 1; - CC(ex, 0xb0); } } @@ -1271,9 +1357,10 @@ inline void z80_device::cpir() cpi(); if (BC != 0 && !(F & ZF)) { + CC(ex, 0xb1); + nomreq_addr(HL, 5); PC -= 2; WZ = PC + 1; - CC(ex, 0xb1); } } @@ -1285,8 +1372,9 @@ inline void z80_device::inir() ini(); if (B != 0) { - PC -= 2; CC(ex, 0xb2); + nomreq_addr(HL, 5); + PC -= 2; } } @@ -1298,8 +1386,9 @@ inline void z80_device::otir() outi(); if (B != 0) { - PC -= 2; CC(ex, 0xb3); + nomreq_addr(BC, 5); + PC -= 2; } } @@ -1311,9 +1400,10 @@ inline void z80_device::lddr() ldd(); if (BC != 0) { + CC(ex, 0xb8); + nomreq_addr(DE, 5); PC -= 2; WZ = PC + 1; - CC(ex, 0xb8); } } @@ -1325,9 +1415,10 @@ inline void z80_device::cpdr() cpd(); if (BC != 0 && !(F & ZF)) { + CC(ex, 0xb9); + nomreq_addr(HL, 5); PC -= 2; WZ = PC + 1; - CC(ex, 0xb9); } } @@ -1339,8 +1430,9 @@ inline void z80_device::indr() ind(); if (B != 0) { - PC -= 2; CC(ex, 0xba); + nomreq_addr(HL, 5); + PC -= 2; } } @@ -1352,8 +1444,9 @@ inline void z80_device::otdr() outd(); if (B != 0) { - PC -= 2; CC(ex, 0xbb); + nomreq_addr(BC, 5); + PC -= 2; } } @@ -1376,7 +1469,7 @@ OP(cb,02) { D = rlc(D); } /* RLC D */ OP(cb,03) { E = rlc(E); } /* RLC E */ OP(cb,04) { H = rlc(H); } /* RLC H */ OP(cb,05) { L = rlc(L); } /* RLC L */ -OP(cb,06) { wm(HL, rlc(rm(HL))); } /* RLC (HL) */ +OP(cb,06) { wm(HL, rlc(rm_reg(HL)));} /* RLC (HL) */ OP(cb,07) { A = rlc(A); } /* RLC A */ OP(cb,08) { B = rrc(B); } /* RRC B */ @@ -1385,7 +1478,7 @@ OP(cb,0a) { D = rrc(D); } /* RRC D */ OP(cb,0b) { E = rrc(E); } /* RRC E */ OP(cb,0c) { H = rrc(H); } /* RRC H */ OP(cb,0d) { L = rrc(L); } /* RRC L */ -OP(cb,0e) { wm(HL, rrc(rm(HL))); } /* RRC (HL) */ +OP(cb,0e) { wm(HL, rrc(rm_reg(HL)));} /* RRC (HL) */ OP(cb,0f) { A = rrc(A); } /* RRC A */ OP(cb,10) { B = rl(B); } /* RL B */ @@ -1394,7 +1487,7 @@ OP(cb,12) { D = rl(D); } /* RL D */ OP(cb,13) { E = rl(E); } /* RL E */ OP(cb,14) { H = rl(H); } /* RL H */ OP(cb,15) { L = rl(L); } /* RL L */ -OP(cb,16) { wm(HL, rl(rm(HL))); } /* RL (HL) */ +OP(cb,16) { wm(HL, rl(rm_reg(HL))); } /* RL (HL) */ OP(cb,17) { A = rl(A); } /* RL A */ OP(cb,18) { B = rr(B); } /* RR B */ @@ -1403,7 +1496,7 @@ OP(cb,1a) { D = rr(D); } /* RR D */ OP(cb,1b) { E = rr(E); } /* RR E */ OP(cb,1c) { H = rr(H); } /* RR H */ OP(cb,1d) { L = rr(L); } /* RR L */ -OP(cb,1e) { wm(HL, rr(rm(HL))); } /* RR (HL) */ +OP(cb,1e) { wm(HL, rr(rm_reg(HL))); } /* RR (HL) */ OP(cb,1f) { A = rr(A); } /* RR A */ OP(cb,20) { B = sla(B); } /* SLA B */ @@ -1412,7 +1505,7 @@ OP(cb,22) { D = sla(D); } /* SLA D */ OP(cb,23) { E = sla(E); } /* SLA E */ OP(cb,24) { H = sla(H); } /* SLA H */ OP(cb,25) { L = sla(L); } /* SLA L */ -OP(cb,26) { wm(HL, sla(rm(HL))); } /* SLA (HL) */ +OP(cb,26) { wm(HL, sla(rm_reg(HL)));} /* SLA (HL) */ OP(cb,27) { A = sla(A); } /* SLA A */ OP(cb,28) { B = sra(B); } /* SRA B */ @@ -1421,7 +1514,7 @@ OP(cb,2a) { D = sra(D); } /* SRA D */ OP(cb,2b) { E = sra(E); } /* SRA E */ OP(cb,2c) { H = sra(H); } /* SRA H */ OP(cb,2d) { L = sra(L); } /* SRA L */ -OP(cb,2e) { wm(HL, sra(rm(HL))); } /* SRA (HL) */ +OP(cb,2e) { wm(HL, sra(rm_reg(HL)));} /* SRA (HL) */ OP(cb,2f) { A = sra(A); } /* SRA A */ OP(cb,30) { B = sll(B); } /* SLL B */ @@ -1430,7 +1523,7 @@ OP(cb,32) { D = sll(D); } /* SLL D */ OP(cb,33) { E = sll(E); } /* SLL E */ OP(cb,34) { H = sll(H); } /* SLL H */ OP(cb,35) { L = sll(L); } /* SLL L */ -OP(cb,36) { wm(HL, sll(rm(HL))); } /* SLL (HL) */ +OP(cb,36) { wm(HL, sll(rm_reg(HL)));} /* SLL (HL) */ OP(cb,37) { A = sll(A); } /* SLL A */ OP(cb,38) { B = srl(B); } /* SRL B */ @@ -1439,7 +1532,7 @@ OP(cb,3a) { D = srl(D); } /* SRL D */ OP(cb,3b) { E = srl(E); } /* SRL E */ OP(cb,3c) { H = srl(H); } /* SRL H */ OP(cb,3d) { L = srl(L); } /* SRL L */ -OP(cb,3e) { wm(HL, srl(rm(HL))); } /* SRL (HL) */ +OP(cb,3e) { wm(HL, srl(rm_reg(HL)));} /* SRL (HL) */ OP(cb,3f) { A = srl(A); } /* SRL A */ OP(cb,40) { bit(0, B); } /* BIT 0,B */ @@ -1448,7 +1541,7 @@ OP(cb,42) { bit(0, D); } /* BIT 0,D */ OP(cb,43) { bit(0, E); } /* BIT 0,E */ OP(cb,44) { bit(0, H); } /* BIT 0,H */ OP(cb,45) { bit(0, L); } /* BIT 0,L */ -OP(cb,46) { bit_hl(0, rm(HL)); } /* BIT 0,(HL) */ +OP(cb,46) { bit_hl(0, rm_reg(HL)); } /* BIT 0,(HL) */ OP(cb,47) { bit(0, A); } /* BIT 0,A */ OP(cb,48) { bit(1, B); } /* BIT 1,B */ @@ -1457,7 +1550,7 @@ OP(cb,4a) { bit(1, D); } /* BIT 1,D */ OP(cb,4b) { bit(1, E); } /* BIT 1,E */ OP(cb,4c) { bit(1, H); } /* BIT 1,H */ OP(cb,4d) { bit(1, L); } /* BIT 1,L */ -OP(cb,4e) { bit_hl(1, rm(HL)); } /* BIT 1,(HL) */ +OP(cb,4e) { bit_hl(1, rm_reg(HL)); } /* BIT 1,(HL) */ OP(cb,4f) { bit(1, A); } /* BIT 1,A */ OP(cb,50) { bit(2, B); } /* BIT 2,B */ @@ -1466,7 +1559,7 @@ OP(cb,52) { bit(2, D); } /* BIT 2,D */ OP(cb,53) { bit(2, E); } /* BIT 2,E */ OP(cb,54) { bit(2, H); } /* BIT 2,H */ OP(cb,55) { bit(2, L); } /* BIT 2,L */ -OP(cb,56) { bit_hl(2, rm(HL)); } /* BIT 2,(HL) */ +OP(cb,56) { bit_hl(2, rm_reg(HL)); } /* BIT 2,(HL) */ OP(cb,57) { bit(2, A); } /* BIT 2,A */ OP(cb,58) { bit(3, B); } /* BIT 3,B */ @@ -1475,7 +1568,7 @@ OP(cb,5a) { bit(3, D); } /* BIT 3,D */ OP(cb,5b) { bit(3, E); } /* BIT 3,E */ OP(cb,5c) { bit(3, H); } /* BIT 3,H */ OP(cb,5d) { bit(3, L); } /* BIT 3,L */ -OP(cb,5e) { bit_hl(3, rm(HL)); } /* BIT 3,(HL) */ +OP(cb,5e) { bit_hl(3, rm_reg(HL)); } /* BIT 3,(HL) */ OP(cb,5f) { bit(3, A); } /* BIT 3,A */ OP(cb,60) { bit(4, B); } /* BIT 4,B */ @@ -1484,7 +1577,7 @@ OP(cb,62) { bit(4, D); } /* BIT 4,D */ OP(cb,63) { bit(4, E); } /* BIT 4,E */ OP(cb,64) { bit(4, H); } /* BIT 4,H */ OP(cb,65) { bit(4, L); } /* BIT 4,L */ -OP(cb,66) { bit_hl(4, rm(HL)); } /* BIT 4,(HL) */ +OP(cb,66) { bit_hl(4, rm_reg(HL)); } /* BIT 4,(HL) */ OP(cb,67) { bit(4, A); } /* BIT 4,A */ OP(cb,68) { bit(5, B); } /* BIT 5,B */ @@ -1493,7 +1586,7 @@ OP(cb,6a) { bit(5, D); } /* BIT 5,D */ OP(cb,6b) { bit(5, E); } /* BIT 5,E */ OP(cb,6c) { bit(5, H); } /* BIT 5,H */ OP(cb,6d) { bit(5, L); } /* BIT 5,L */ -OP(cb,6e) { bit_hl(5, rm(HL)); } /* BIT 5,(HL) */ +OP(cb,6e) { bit_hl(5, rm_reg(HL)); } /* BIT 5,(HL) */ OP(cb,6f) { bit(5, A); } /* BIT 5,A */ OP(cb,70) { bit(6, B); } /* BIT 6,B */ @@ -1502,7 +1595,7 @@ OP(cb,72) { bit(6, D); } /* BIT 6,D */ OP(cb,73) { bit(6, E); } /* BIT 6,E */ OP(cb,74) { bit(6, H); } /* BIT 6,H */ OP(cb,75) { bit(6, L); } /* BIT 6,L */ -OP(cb,76) { bit_hl(6, rm(HL)); } /* BIT 6,(HL) */ +OP(cb,76) { bit_hl(6, rm_reg(HL)); } /* BIT 6,(HL) */ OP(cb,77) { bit(6, A); } /* BIT 6,A */ OP(cb,78) { bit(7, B); } /* BIT 7,B */ @@ -1511,7 +1604,7 @@ OP(cb,7a) { bit(7, D); } /* BIT 7,D */ OP(cb,7b) { bit(7, E); } /* BIT 7,E */ OP(cb,7c) { bit(7, H); } /* BIT 7,H */ OP(cb,7d) { bit(7, L); } /* BIT 7,L */ -OP(cb,7e) { bit_hl(7, rm(HL)); } /* BIT 7,(HL) */ +OP(cb,7e) { bit_hl(7, rm_reg(HL)); } /* BIT 7,(HL) */ OP(cb,7f) { bit(7, A); } /* BIT 7,A */ OP(cb,80) { B = res(0, B); } /* RES 0,B */ @@ -1520,7 +1613,7 @@ OP(cb,82) { D = res(0, D); } /* RES 0,D */ OP(cb,83) { E = res(0, E); } /* RES 0,E */ OP(cb,84) { H = res(0, H); } /* RES 0,H */ OP(cb,85) { L = res(0, L); } /* RES 0,L */ -OP(cb,86) { wm(HL, res(0, rm(HL))); } /* RES 0,(HL) */ +OP(cb,86) { wm(HL, res(0, rm_reg(HL))); } /* RES 0,(HL) */ OP(cb,87) { A = res(0, A); } /* RES 0,A */ OP(cb,88) { B = res(1, B); } /* RES 1,B */ @@ -1529,7 +1622,7 @@ OP(cb,8a) { D = res(1, D); } /* RES 1,D */ OP(cb,8b) { E = res(1, E); } /* RES 1,E */ OP(cb,8c) { H = res(1, H); } /* RES 1,H */ OP(cb,8d) { L = res(1, L); } /* RES 1,L */ -OP(cb,8e) { wm(HL, res(1, rm(HL))); } /* RES 1,(HL) */ +OP(cb,8e) { wm(HL, res(1, rm_reg(HL))); } /* RES 1,(HL) */ OP(cb,8f) { A = res(1, A); } /* RES 1,A */ OP(cb,90) { B = res(2, B); } /* RES 2,B */ @@ -1538,7 +1631,7 @@ OP(cb,92) { D = res(2, D); } /* RES 2,D */ OP(cb,93) { E = res(2, E); } /* RES 2,E */ OP(cb,94) { H = res(2, H); } /* RES 2,H */ OP(cb,95) { L = res(2, L); } /* RES 2,L */ -OP(cb,96) { wm(HL, res(2, rm(HL))); } /* RES 2,(HL) */ +OP(cb,96) { wm(HL, res(2, rm_reg(HL))); } /* RES 2,(HL) */ OP(cb,97) { A = res(2, A); } /* RES 2,A */ OP(cb,98) { B = res(3, B); } /* RES 3,B */ @@ -1547,7 +1640,7 @@ OP(cb,9a) { D = res(3, D); } /* RES 3,D */ OP(cb,9b) { E = res(3, E); } /* RES 3,E */ OP(cb,9c) { H = res(3, H); } /* RES 3,H */ OP(cb,9d) { L = res(3, L); } /* RES 3,L */ -OP(cb,9e) { wm(HL, res(3, rm(HL))); } /* RES 3,(HL) */ +OP(cb,9e) { wm(HL, res(3, rm_reg(HL))); } /* RES 3,(HL) */ OP(cb,9f) { A = res(3, A); } /* RES 3,A */ OP(cb,a0) { B = res(4, B); } /* RES 4,B */ @@ -1556,7 +1649,7 @@ OP(cb,a2) { D = res(4, D); } /* RES 4,D */ OP(cb,a3) { E = res(4, E); } /* RES 4,E */ OP(cb,a4) { H = res(4, H); } /* RES 4,H */ OP(cb,a5) { L = res(4, L); } /* RES 4,L */ -OP(cb,a6) { wm(HL, res(4, rm(HL))); } /* RES 4,(HL) */ +OP(cb,a6) {wm(HL, res(4, rm_reg(HL))); } /* RES 4,(HL) */ OP(cb,a7) { A = res(4, A); } /* RES 4,A */ OP(cb,a8) { B = res(5, B); } /* RES 5,B */ @@ -1565,7 +1658,7 @@ OP(cb,aa) { D = res(5, D); } /* RES 5,D */ OP(cb,ab) { E = res(5, E); } /* RES 5,E */ OP(cb,ac) { H = res(5, H); } /* RES 5,H */ OP(cb,ad) { L = res(5, L); } /* RES 5,L */ -OP(cb,ae) { wm(HL, res(5, rm(HL))); } /* RES 5,(HL) */ +OP(cb,ae) { wm(HL, res(5, rm_reg(HL))); } /* RES 5,(HL) */ OP(cb,af) { A = res(5, A); } /* RES 5,A */ OP(cb,b0) { B = res(6, B); } /* RES 6,B */ @@ -1574,7 +1667,7 @@ OP(cb,b2) { D = res(6, D); } /* RES 6,D */ OP(cb,b3) { E = res(6, E); } /* RES 6,E */ OP(cb,b4) { H = res(6, H); } /* RES 6,H */ OP(cb,b5) { L = res(6, L); } /* RES 6,L */ -OP(cb,b6) { wm(HL, res(6, rm(HL))); } /* RES 6,(HL) */ +OP(cb,b6) { wm(HL, res(6, rm_reg(HL))); } /* RES 6,(HL) */ OP(cb,b7) { A = res(6, A); } /* RES 6,A */ OP(cb,b8) { B = res(7, B); } /* RES 7,B */ @@ -1583,7 +1676,7 @@ OP(cb,ba) { D = res(7, D); } /* RES 7,D */ OP(cb,bb) { E = res(7, E); } /* RES 7,E */ OP(cb,bc) { H = res(7, H); } /* RES 7,H */ OP(cb,bd) { L = res(7, L); } /* RES 7,L */ -OP(cb,be) { wm(HL, res(7, rm(HL))); } /* RES 7,(HL) */ +OP(cb,be) { wm(HL, res(7, rm_reg(HL))); } /* RES 7,(HL) */ OP(cb,bf) { A = res(7, A); } /* RES 7,A */ OP(cb,c0) { B = set(0, B); } /* SET 0,B */ @@ -1592,7 +1685,7 @@ OP(cb,c2) { D = set(0, D); } /* SET 0,D */ OP(cb,c3) { E = set(0, E); } /* SET 0,E */ OP(cb,c4) { H = set(0, H); } /* SET 0,H */ OP(cb,c5) { L = set(0, L); } /* SET 0,L */ -OP(cb,c6) { wm(HL, set(0, rm(HL))); } /* SET 0,(HL) */ +OP(cb,c6) { wm(HL, set(0, rm_reg(HL))); } /* SET 0,(HL) */ OP(cb,c7) { A = set(0, A); } /* SET 0,A */ OP(cb,c8) { B = set(1, B); } /* SET 1,B */ @@ -1601,7 +1694,7 @@ OP(cb,ca) { D = set(1, D); } /* SET 1,D */ OP(cb,cb) { E = set(1, E); } /* SET 1,E */ OP(cb,cc) { H = set(1, H); } /* SET 1,H */ OP(cb,cd) { L = set(1, L); } /* SET 1,L */ -OP(cb,ce) { wm(HL, set(1, rm(HL))); } /* SET 1,(HL) */ +OP(cb,ce) { wm(HL, set(1, rm_reg(HL))); } /* SET 1,(HL) */ OP(cb,cf) { A = set(1, A); } /* SET 1,A */ OP(cb,d0) { B = set(2, B); } /* SET 2,B */ @@ -1610,7 +1703,7 @@ OP(cb,d2) { D = set(2, D); } /* SET 2,D */ OP(cb,d3) { E = set(2, E); } /* SET 2,E */ OP(cb,d4) { H = set(2, H); } /* SET 2,H */ OP(cb,d5) { L = set(2, L); } /* SET 2,L */ -OP(cb,d6) { wm(HL, set(2, rm(HL))); } /* SET 2,(HL) */ +OP(cb,d6) { wm(HL, set(2, rm_reg(HL))); } /* SET 2,(HL) */ OP(cb,d7) { A = set(2, A); } /* SET 2,A */ OP(cb,d8) { B = set(3, B); } /* SET 3,B */ @@ -1619,7 +1712,7 @@ OP(cb,da) { D = set(3, D); } /* SET 3,D */ OP(cb,db) { E = set(3, E); } /* SET 3,E */ OP(cb,dc) { H = set(3, H); } /* SET 3,H */ OP(cb,dd) { L = set(3, L); } /* SET 3,L */ -OP(cb,de) { wm(HL, set(3, rm(HL))); } /* SET 3,(HL) */ +OP(cb,de) { wm(HL, set(3, rm_reg(HL))); } /* SET 3,(HL) */ OP(cb,df) { A = set(3, A); } /* SET 3,A */ OP(cb,e0) { B = set(4, B); } /* SET 4,B */ @@ -1628,7 +1721,7 @@ OP(cb,e2) { D = set(4, D); } /* SET 4,D */ OP(cb,e3) { E = set(4, E); } /* SET 4,E */ OP(cb,e4) { H = set(4, H); } /* SET 4,H */ OP(cb,e5) { L = set(4, L); } /* SET 4,L */ -OP(cb,e6) { wm(HL, set(4, rm(HL))); } /* SET 4,(HL) */ +OP(cb,e6) { wm(HL, set(4, rm_reg(HL))); } /* SET 4,(HL) */ OP(cb,e7) { A = set(4, A); } /* SET 4,A */ OP(cb,e8) { B = set(5, B); } /* SET 5,B */ @@ -1637,7 +1730,7 @@ OP(cb,ea) { D = set(5, D); } /* SET 5,D */ OP(cb,eb) { E = set(5, E); } /* SET 5,E */ OP(cb,ec) { H = set(5, H); } /* SET 5,H */ OP(cb,ed) { L = set(5, L); } /* SET 5,L */ -OP(cb,ee) { wm(HL, set(5, rm(HL))); } /* SET 5,(HL) */ +OP(cb,ee) { wm(HL, set(5, rm_reg(HL))); } /* SET 5,(HL) */ OP(cb,ef) { A = set(5, A); } /* SET 5,A */ OP(cb,f0) { B = set(6, B); } /* SET 6,B */ @@ -1646,7 +1739,7 @@ OP(cb,f2) { D = set(6, D); } /* SET 6,D */ OP(cb,f3) { E = set(6, E); } /* SET 6,E */ OP(cb,f4) { H = set(6, H); } /* SET 6,H */ OP(cb,f5) { L = set(6, L); } /* SET 6,L */ -OP(cb,f6) { wm(HL, set(6, rm(HL))); } /* SET 6,(HL) */ +OP(cb,f6) { wm(HL, set(6, rm_reg(HL))); } /* SET 6,(HL) */ OP(cb,f7) { A = set(6, A); } /* SET 6,A */ OP(cb,f8) { B = set(7, B); } /* SET 7,B */ @@ -1655,7 +1748,7 @@ OP(cb,fa) { D = set(7, D); } /* SET 7,D */ OP(cb,fb) { E = set(7, E); } /* SET 7,E */ OP(cb,fc) { H = set(7, H); } /* SET 7,H */ OP(cb,fd) { L = set(7, L); } /* SET 7,L */ -OP(cb,fe) { wm(HL, set(7, rm(HL))); } /* SET 7,(HL) */ +OP(cb,fe) { wm(HL, set(7, rm_reg(HL))); } /* SET 7,(HL) */ OP(cb,ff) { A = set(7, A); } /* SET 7,A */ @@ -1663,77 +1756,77 @@ OP(cb,ff) { A = set(7, A); } /* SET 7,A */ * opcodes with DD/FD CB prefix * rotate, shift and bit operations with (IX+o) **********************************************************/ -OP(xycb,00) { B = rlc(rm(m_ea)); wm(m_ea, B); } /* RLC B=(XY+o) */ -OP(xycb,01) { C = rlc(rm(m_ea)); wm(m_ea, C); } /* RLC C=(XY+o) */ -OP(xycb,02) { D = rlc(rm(m_ea)); wm(m_ea, D); } /* RLC D=(XY+o) */ -OP(xycb,03) { E = rlc(rm(m_ea)); wm(m_ea, E); } /* RLC E=(XY+o) */ -OP(xycb,04) { H = rlc(rm(m_ea)); wm(m_ea, H); } /* RLC H=(XY+o) */ -OP(xycb,05) { L = rlc(rm(m_ea)); wm(m_ea, L); } /* RLC L=(XY+o) */ -OP(xycb,06) { wm(m_ea, rlc(rm(m_ea))); } /* RLC (XY+o) */ -OP(xycb,07) { A = rlc(rm(m_ea)); wm(m_ea, A); } /* RLC A=(XY+o) */ - -OP(xycb,08) { B = rrc(rm(m_ea)); wm(m_ea, B); } /* RRC B=(XY+o) */ -OP(xycb,09) { C = rrc(rm(m_ea)); wm(m_ea, C); } /* RRC C=(XY+o) */ -OP(xycb,0a) { D = rrc(rm(m_ea)); wm(m_ea, D); } /* RRC D=(XY+o) */ -OP(xycb,0b) { E = rrc(rm(m_ea)); wm(m_ea, E); } /* RRC E=(XY+o) */ -OP(xycb,0c) { H = rrc(rm(m_ea)); wm(m_ea, H); } /* RRC H=(XY+o) */ -OP(xycb,0d) { L = rrc(rm(m_ea)); wm(m_ea, L); } /* RRC L=(XY+o) */ -OP(xycb,0e) { wm(m_ea,rrc(rm(m_ea))); } /* RRC (XY+o) */ -OP(xycb,0f) { A = rrc(rm(m_ea)); wm(m_ea, A); } /* RRC A=(XY+o) */ - -OP(xycb,10) { B = rl(rm(m_ea)); wm(m_ea, B); } /* RL B=(XY+o) */ -OP(xycb,11) { C = rl(rm(m_ea)); wm(m_ea, C); } /* RL C=(XY+o) */ -OP(xycb,12) { D = rl(rm(m_ea)); wm(m_ea, D); } /* RL D=(XY+o) */ -OP(xycb,13) { E = rl(rm(m_ea)); wm(m_ea, E); } /* RL E=(XY+o) */ -OP(xycb,14) { H = rl(rm(m_ea)); wm(m_ea, H); } /* RL H=(XY+o) */ -OP(xycb,15) { L = rl(rm(m_ea)); wm(m_ea, L); } /* RL L=(XY+o) */ -OP(xycb,16) { wm(m_ea,rl(rm(m_ea))); } /* RL (XY+o) */ -OP(xycb,17) { A = rl(rm(m_ea)); wm(m_ea, A); } /* RL A=(XY+o) */ - -OP(xycb,18) { B = rr(rm(m_ea)); wm(m_ea, B); } /* RR B=(XY+o) */ -OP(xycb,19) { C = rr(rm(m_ea)); wm(m_ea, C); } /* RR C=(XY+o) */ -OP(xycb,1a) { D = rr(rm(m_ea)); wm(m_ea, D); } /* RR D=(XY+o) */ -OP(xycb,1b) { E = rr(rm(m_ea)); wm(m_ea, E); } /* RR E=(XY+o) */ -OP(xycb,1c) { H = rr(rm(m_ea)); wm(m_ea, H); } /* RR H=(XY+o) */ -OP(xycb,1d) { L = rr(rm(m_ea)); wm(m_ea, L); } /* RR L=(XY+o) */ -OP(xycb,1e) { wm(m_ea, rr(rm(m_ea))); } /* RR (XY+o) */ -OP(xycb,1f) { A = rr(rm(m_ea)); wm(m_ea, A); } /* RR A=(XY+o) */ - -OP(xycb,20) { B = sla(rm(m_ea)); wm(m_ea, B); } /* SLA B=(XY+o) */ -OP(xycb,21) { C = sla(rm(m_ea)); wm(m_ea, C); } /* SLA C=(XY+o) */ -OP(xycb,22) { D = sla(rm(m_ea)); wm(m_ea, D); } /* SLA D=(XY+o) */ -OP(xycb,23) { E = sla(rm(m_ea)); wm(m_ea, E); } /* SLA E=(XY+o) */ -OP(xycb,24) { H = sla(rm(m_ea)); wm(m_ea, H); } /* SLA H=(XY+o) */ -OP(xycb,25) { L = sla(rm(m_ea)); wm(m_ea, L); } /* SLA L=(XY+o) */ -OP(xycb,26) { wm(m_ea, sla(rm(m_ea))); } /* SLA (XY+o) */ -OP(xycb,27) { A = sla(rm(m_ea)); wm(m_ea, A); } /* SLA A=(XY+o) */ - -OP(xycb,28) { B = sra(rm(m_ea)); wm(m_ea, B); } /* SRA B=(XY+o) */ -OP(xycb,29) { C = sra(rm(m_ea)); wm(m_ea, C); } /* SRA C=(XY+o) */ -OP(xycb,2a) { D = sra(rm(m_ea)); wm(m_ea, D); } /* SRA D=(XY+o) */ -OP(xycb,2b) { E = sra(rm(m_ea)); wm(m_ea, E); } /* SRA E=(XY+o) */ -OP(xycb,2c) { H = sra(rm(m_ea)); wm(m_ea, H); } /* SRA H=(XY+o) */ -OP(xycb,2d) { L = sra(rm(m_ea)); wm(m_ea, L); } /* SRA L=(XY+o) */ -OP(xycb,2e) { wm(m_ea, sra(rm(m_ea))); } /* SRA (XY+o) */ -OP(xycb,2f) { A = sra(rm(m_ea)); wm(m_ea, A); } /* SRA A=(XY+o) */ - -OP(xycb,30) { B = sll(rm(m_ea)); wm(m_ea, B); } /* SLL B=(XY+o) */ -OP(xycb,31) { C = sll(rm(m_ea)); wm(m_ea, C); } /* SLL C=(XY+o) */ -OP(xycb,32) { D = sll(rm(m_ea)); wm(m_ea, D); } /* SLL D=(XY+o) */ -OP(xycb,33) { E = sll(rm(m_ea)); wm(m_ea, E); } /* SLL E=(XY+o) */ -OP(xycb,34) { H = sll(rm(m_ea)); wm(m_ea, H); } /* SLL H=(XY+o) */ -OP(xycb,35) { L = sll(rm(m_ea)); wm(m_ea, L); } /* SLL L=(XY+o) */ -OP(xycb,36) { wm(m_ea, sll(rm(m_ea))); } /* SLL (XY+o) */ -OP(xycb,37) { A = sll(rm(m_ea)); wm(m_ea, A); } /* SLL A=(XY+o) */ - -OP(xycb,38) { B = srl(rm(m_ea)); wm(m_ea, B); } /* SRL B=(XY+o) */ -OP(xycb,39) { C = srl(rm(m_ea)); wm(m_ea, C); } /* SRL C=(XY+o) */ -OP(xycb,3a) { D = srl(rm(m_ea)); wm(m_ea, D); } /* SRL D=(XY+o) */ -OP(xycb,3b) { E = srl(rm(m_ea)); wm(m_ea, E); } /* SRL E=(XY+o) */ -OP(xycb,3c) { H = srl(rm(m_ea)); wm(m_ea, H); } /* SRL H=(XY+o) */ -OP(xycb,3d) { L = srl(rm(m_ea)); wm(m_ea, L); } /* SRL L=(XY+o) */ -OP(xycb,3e) { wm(m_ea, srl(rm(m_ea))); } /* SRL (XY+o) */ -OP(xycb,3f) { A = srl(rm(m_ea)); wm(m_ea, A); } /* SRL A=(XY+o) */ +OP(xycb,00) { B = rlc(rm_reg(m_ea)); wm(m_ea, B); } /* RLC B=(XY+o) */ +OP(xycb,01) { C = rlc(rm_reg(m_ea)); wm(m_ea, C); } /* RLC C=(XY+o) */ +OP(xycb,02) { D = rlc(rm_reg(m_ea)); wm(m_ea, D); } /* RLC D=(XY+o) */ +OP(xycb,03) { E = rlc(rm_reg(m_ea)); wm(m_ea, E); } /* RLC E=(XY+o) */ +OP(xycb,04) { H = rlc(rm_reg(m_ea)); wm(m_ea, H); } /* RLC H=(XY+o) */ +OP(xycb,05) { L = rlc(rm_reg(m_ea)); wm(m_ea, L); } /* RLC L=(XY+o) */ +OP(xycb,06) { wm(m_ea, rlc(rm_reg(m_ea))); } /* RLC (XY+o) */ +OP(xycb,07) { A = rlc(rm_reg(m_ea)); wm(m_ea, A); } /* RLC A=(XY+o) */ + +OP(xycb,08) { B = rrc(rm_reg(m_ea)); wm(m_ea, B); } /* RRC B=(XY+o) */ +OP(xycb,09) { C = rrc(rm_reg(m_ea)); wm(m_ea, C); } /* RRC C=(XY+o) */ +OP(xycb,0a) { D = rrc(rm_reg(m_ea)); wm(m_ea, D); } /* RRC D=(XY+o) */ +OP(xycb,0b) { E = rrc(rm_reg(m_ea)); wm(m_ea, E); } /* RRC E=(XY+o) */ +OP(xycb,0c) { H = rrc(rm_reg(m_ea)); wm(m_ea, H); } /* RRC H=(XY+o) */ +OP(xycb,0d) { L = rrc(rm_reg(m_ea)); wm(m_ea, L); } /* RRC L=(XY+o) */ +OP(xycb,0e) { wm(m_ea,rrc(rm_reg(m_ea))); } /* RRC (XY+o) */ +OP(xycb,0f) { A = rrc(rm_reg(m_ea)); wm(m_ea, A); } /* RRC A=(XY+o) */ + +OP(xycb,10) { B = rl(rm_reg(m_ea)); wm(m_ea, B); } /* RL B=(XY+o) */ +OP(xycb,11) { C = rl(rm_reg(m_ea)); wm(m_ea, C); } /* RL C=(XY+o) */ +OP(xycb,12) { D = rl(rm_reg(m_ea)); wm(m_ea, D); } /* RL D=(XY+o) */ +OP(xycb,13) { E = rl(rm_reg(m_ea)); wm(m_ea, E); } /* RL E=(XY+o) */ +OP(xycb,14) { H = rl(rm_reg(m_ea)); wm(m_ea, H); } /* RL H=(XY+o) */ +OP(xycb,15) { L = rl(rm_reg(m_ea)); wm(m_ea, L); } /* RL L=(XY+o) */ +OP(xycb,16) { wm(m_ea,rl(rm_reg(m_ea))); } /* RL (XY+o) */ +OP(xycb,17) { A = rl(rm_reg(m_ea)); wm(m_ea, A); } /* RL A=(XY+o) */ + +OP(xycb,18) { B = rr(rm_reg(m_ea)); wm(m_ea, B); } /* RR B=(XY+o) */ +OP(xycb,19) { C = rr(rm_reg(m_ea)); wm(m_ea, C); } /* RR C=(XY+o) */ +OP(xycb,1a) { D = rr(rm_reg(m_ea)); wm(m_ea, D); } /* RR D=(XY+o) */ +OP(xycb,1b) { E = rr(rm_reg(m_ea)); wm(m_ea, E); } /* RR E=(XY+o) */ +OP(xycb,1c) { H = rr(rm_reg(m_ea)); wm(m_ea, H); } /* RR H=(XY+o) */ +OP(xycb,1d) { L = rr(rm_reg(m_ea)); wm(m_ea, L); } /* RR L=(XY+o) */ +OP(xycb,1e) { wm(m_ea, rr(rm_reg(m_ea))); } /* RR (XY+o) */ +OP(xycb,1f) { A = rr(rm_reg(m_ea)); wm(m_ea, A); } /* RR A=(XY+o) */ + +OP(xycb,20) { B = sla(rm_reg(m_ea)); wm(m_ea, B); } /* SLA B=(XY+o) */ +OP(xycb,21) { C = sla(rm_reg(m_ea)); wm(m_ea, C); } /* SLA C=(XY+o) */ +OP(xycb,22) { D = sla(rm_reg(m_ea)); wm(m_ea, D); } /* SLA D=(XY+o) */ +OP(xycb,23) { E = sla(rm_reg(m_ea)); wm(m_ea, E); } /* SLA E=(XY+o) */ +OP(xycb,24) { H = sla(rm_reg(m_ea)); wm(m_ea, H); } /* SLA H=(XY+o) */ +OP(xycb,25) { L = sla(rm_reg(m_ea)); wm(m_ea, L); } /* SLA L=(XY+o) */ +OP(xycb,26) { wm(m_ea, sla(rm_reg(m_ea))); } /* SLA (XY+o) */ +OP(xycb,27) { A = sla(rm_reg(m_ea)); wm(m_ea, A); } /* SLA A=(XY+o) */ + +OP(xycb,28) { B = sra(rm_reg(m_ea)); wm(m_ea, B); } /* SRA B=(XY+o) */ +OP(xycb,29) { C = sra(rm_reg(m_ea)); wm(m_ea, C); } /* SRA C=(XY+o) */ +OP(xycb,2a) { D = sra(rm_reg(m_ea)); wm(m_ea, D); } /* SRA D=(XY+o) */ +OP(xycb,2b) { E = sra(rm_reg(m_ea)); wm(m_ea, E); } /* SRA E=(XY+o) */ +OP(xycb,2c) { H = sra(rm_reg(m_ea)); wm(m_ea, H); } /* SRA H=(XY+o) */ +OP(xycb,2d) { L = sra(rm_reg(m_ea)); wm(m_ea, L); } /* SRA L=(XY+o) */ +OP(xycb,2e) { wm(m_ea, sra(rm_reg(m_ea))); } /* SRA (XY+o) */ +OP(xycb,2f) { A = sra(rm_reg(m_ea)); wm(m_ea, A); } /* SRA A=(XY+o) */ + +OP(xycb,30) { B = sll(rm_reg(m_ea)); wm(m_ea, B); } /* SLL B=(XY+o) */ +OP(xycb,31) { C = sll(rm_reg(m_ea)); wm(m_ea, C); } /* SLL C=(XY+o) */ +OP(xycb,32) { D = sll(rm_reg(m_ea)); wm(m_ea, D); } /* SLL D=(XY+o) */ +OP(xycb,33) { E = sll(rm_reg(m_ea)); wm(m_ea, E); } /* SLL E=(XY+o) */ +OP(xycb,34) { H = sll(rm_reg(m_ea)); wm(m_ea, H); } /* SLL H=(XY+o) */ +OP(xycb,35) { L = sll(rm_reg(m_ea)); wm(m_ea, L); } /* SLL L=(XY+o) */ +OP(xycb,36) { wm(m_ea, sll(rm_reg(m_ea))); } /* SLL (XY+o) */ +OP(xycb,37) { A = sll(rm_reg(m_ea)); wm(m_ea, A); } /* SLL A=(XY+o) */ + +OP(xycb,38) { B = srl(rm_reg(m_ea)); wm(m_ea, B); } /* SRL B=(XY+o) */ +OP(xycb,39) { C = srl(rm_reg(m_ea)); wm(m_ea, C); } /* SRL C=(XY+o) */ +OP(xycb,3a) { D = srl(rm_reg(m_ea)); wm(m_ea, D); } /* SRL D=(XY+o) */ +OP(xycb,3b) { E = srl(rm_reg(m_ea)); wm(m_ea, E); } /* SRL E=(XY+o) */ +OP(xycb,3c) { H = srl(rm_reg(m_ea)); wm(m_ea, H); } /* SRL H=(XY+o) */ +OP(xycb,3d) { L = srl(rm_reg(m_ea)); wm(m_ea, L); } /* SRL L=(XY+o) */ +OP(xycb,3e) { wm(m_ea, srl(rm_reg(m_ea))); } /* SRL (XY+o) */ +OP(xycb,3f) { A = srl(rm_reg(m_ea)); wm(m_ea, A); } /* SRL A=(XY+o) */ OP(xycb,40) { xycb_46(); } /* BIT 0,(XY+o) */ OP(xycb,41) { xycb_46(); } /* BIT 0,(XY+o) */ @@ -1741,7 +1834,7 @@ OP(xycb,42) { xycb_46(); } /* BIT 0,(XY+o) */ OP(xycb,43) { xycb_46(); } /* BIT 0,(XY+o) */ OP(xycb,44) { xycb_46(); } /* BIT 0,(XY+o) */ OP(xycb,45) { xycb_46(); } /* BIT 0,(XY+o) */ -OP(xycb,46) { bit_xy(0, rm(m_ea)); } /* BIT 0,(XY+o) */ +OP(xycb,46) { bit_xy(0, rm_reg(m_ea)); } /* BIT 0,(XY+o) */ OP(xycb,47) { xycb_46(); } /* BIT 0,(XY+o) */ OP(xycb,48) { xycb_4e(); } /* BIT 1,(XY+o) */ @@ -1750,7 +1843,7 @@ OP(xycb,4a) { xycb_4e(); } /* BIT 1,(XY+o) */ OP(xycb,4b) { xycb_4e(); } /* BIT 1,(XY+o) */ OP(xycb,4c) { xycb_4e(); } /* BIT 1,(XY+o) */ OP(xycb,4d) { xycb_4e(); } /* BIT 1,(XY+o) */ -OP(xycb,4e) { bit_xy(1, rm(m_ea)); } /* BIT 1,(XY+o) */ +OP(xycb,4e) { bit_xy(1, rm_reg(m_ea)); } /* BIT 1,(XY+o) */ OP(xycb,4f) { xycb_4e(); } /* BIT 1,(XY+o) */ OP(xycb,50) { xycb_56(); } /* BIT 2,(XY+o) */ @@ -1759,7 +1852,7 @@ OP(xycb,52) { xycb_56(); } /* BIT 2,(XY+o) */ OP(xycb,53) { xycb_56(); } /* BIT 2,(XY+o) */ OP(xycb,54) { xycb_56(); } /* BIT 2,(XY+o) */ OP(xycb,55) { xycb_56(); } /* BIT 2,(XY+o) */ -OP(xycb,56) { bit_xy(2, rm(m_ea)); } /* BIT 2,(XY+o) */ +OP(xycb,56) { bit_xy(2, rm_reg(m_ea)); } /* BIT 2,(XY+o) */ OP(xycb,57) { xycb_56(); } /* BIT 2,(XY+o) */ OP(xycb,58) { xycb_5e(); } /* BIT 3,(XY+o) */ @@ -1768,7 +1861,7 @@ OP(xycb,5a) { xycb_5e(); } /* BIT 3,(XY+o) */ OP(xycb,5b) { xycb_5e(); } /* BIT 3,(XY+o) */ OP(xycb,5c) { xycb_5e(); } /* BIT 3,(XY+o) */ OP(xycb,5d) { xycb_5e(); } /* BIT 3,(XY+o) */ -OP(xycb,5e) { bit_xy(3, rm(m_ea)); } /* BIT 3,(XY+o) */ +OP(xycb,5e) { bit_xy(3, rm_reg(m_ea)); } /* BIT 3,(XY+o) */ OP(xycb,5f) { xycb_5e(); } /* BIT 3,(XY+o) */ OP(xycb,60) { xycb_66(); } /* BIT 4,(XY+o) */ @@ -1777,7 +1870,7 @@ OP(xycb,62) { xycb_66(); } /* BIT 4,(XY+o) */ OP(xycb,63) { xycb_66(); } /* BIT 4,(XY+o) */ OP(xycb,64) { xycb_66(); } /* BIT 4,(XY+o) */ OP(xycb,65) { xycb_66(); } /* BIT 4,(XY+o) */ -OP(xycb,66) { bit_xy(4, rm(m_ea)); } /* BIT 4,(XY+o) */ +OP(xycb,66) { bit_xy(4, rm_reg(m_ea)); } /* BIT 4,(XY+o) */ OP(xycb,67) { xycb_66(); } /* BIT 4,(XY+o) */ OP(xycb,68) { xycb_6e(); } /* BIT 5,(XY+o) */ @@ -1786,7 +1879,7 @@ OP(xycb,6a) { xycb_6e(); } /* BIT 5,(XY+o) */ OP(xycb,6b) { xycb_6e(); } /* BIT 5,(XY+o) */ OP(xycb,6c) { xycb_6e(); } /* BIT 5,(XY+o) */ OP(xycb,6d) { xycb_6e(); } /* BIT 5,(XY+o) */ -OP(xycb,6e) { bit_xy(5, rm(m_ea)); } /* BIT 5,(XY+o) */ +OP(xycb,6e) { bit_xy(5, rm_reg(m_ea)); } /* BIT 5,(XY+o) */ OP(xycb,6f) { xycb_6e(); } /* BIT 5,(XY+o) */ OP(xycb,70) { xycb_76(); } /* BIT 6,(XY+o) */ @@ -1795,7 +1888,7 @@ OP(xycb,72) { xycb_76(); } /* BIT 6,(XY+o) */ OP(xycb,73) { xycb_76(); } /* BIT 6,(XY+o) */ OP(xycb,74) { xycb_76(); } /* BIT 6,(XY+o) */ OP(xycb,75) { xycb_76(); } /* BIT 6,(XY+o) */ -OP(xycb,76) { bit_xy(6, rm(m_ea)); } /* BIT 6,(XY+o) */ +OP(xycb,76) { bit_xy(6, rm_reg(m_ea)); } /* BIT 6,(XY+o) */ OP(xycb,77) { xycb_76(); } /* BIT 6,(XY+o) */ OP(xycb,78) { xycb_7e(); } /* BIT 7,(XY+o) */ @@ -1804,152 +1897,152 @@ OP(xycb,7a) { xycb_7e(); } /* BIT 7,(XY+o) */ OP(xycb,7b) { xycb_7e(); } /* BIT 7,(XY+o) */ OP(xycb,7c) { xycb_7e(); } /* BIT 7,(XY+o) */ OP(xycb,7d) { xycb_7e(); } /* BIT 7,(XY+o) */ -OP(xycb,7e) { bit_xy(7, rm(m_ea)); } /* BIT 7,(XY+o) */ +OP(xycb,7e) { bit_xy(7, rm_reg(m_ea)); } /* BIT 7,(XY+o) */ OP(xycb,7f) { xycb_7e(); } /* BIT 7,(XY+o) */ -OP(xycb,80) { B = res(0, rm(m_ea)); wm(m_ea, B); } /* RES 0,B=(XY+o) */ -OP(xycb,81) { C = res(0, rm(m_ea)); wm(m_ea, C); } /* RES 0,C=(XY+o) */ -OP(xycb,82) { D = res(0, rm(m_ea)); wm(m_ea, D); } /* RES 0,D=(XY+o) */ -OP(xycb,83) { E = res(0, rm(m_ea)); wm(m_ea, E); } /* RES 0,E=(XY+o) */ -OP(xycb,84) { H = res(0, rm(m_ea)); wm(m_ea, H); } /* RES 0,H=(XY+o) */ -OP(xycb,85) { L = res(0, rm(m_ea)); wm(m_ea, L); } /* RES 0,L=(XY+o) */ -OP(xycb,86) { wm(m_ea, res(0, rm(m_ea))); } /* RES 0,(XY+o) */ -OP(xycb,87) { A = res(0, rm(m_ea)); wm(m_ea, A); } /* RES 0,A=(XY+o) */ - -OP(xycb,88) { B = res(1, rm(m_ea)); wm(m_ea, B); } /* RES 1,B=(XY+o) */ -OP(xycb,89) { C = res(1, rm(m_ea)); wm(m_ea, C); } /* RES 1,C=(XY+o) */ -OP(xycb,8a) { D = res(1, rm(m_ea)); wm(m_ea, D); } /* RES 1,D=(XY+o) */ -OP(xycb,8b) { E = res(1, rm(m_ea)); wm(m_ea, E); } /* RES 1,E=(XY+o) */ -OP(xycb,8c) { H = res(1, rm(m_ea)); wm(m_ea, H); } /* RES 1,H=(XY+o) */ -OP(xycb,8d) { L = res(1, rm(m_ea)); wm(m_ea, L); } /* RES 1,L=(XY+o) */ -OP(xycb,8e) { wm(m_ea, res(1, rm(m_ea))); } /* RES 1,(XY+o) */ -OP(xycb,8f) { A = res(1, rm(m_ea)); wm(m_ea, A); } /* RES 1,A=(XY+o) */ - -OP(xycb,90) { B = res(2, rm(m_ea)); wm(m_ea, B); } /* RES 2,B=(XY+o) */ -OP(xycb,91) { C = res(2, rm(m_ea)); wm(m_ea, C); } /* RES 2,C=(XY+o) */ -OP(xycb,92) { D = res(2, rm(m_ea)); wm(m_ea, D); } /* RES 2,D=(XY+o) */ -OP(xycb,93) { E = res(2, rm(m_ea)); wm(m_ea, E); } /* RES 2,E=(XY+o) */ -OP(xycb,94) { H = res(2, rm(m_ea)); wm(m_ea, H); } /* RES 2,H=(XY+o) */ -OP(xycb,95) { L = res(2, rm(m_ea)); wm(m_ea, L); } /* RES 2,L=(XY+o) */ -OP(xycb,96) { wm(m_ea, res(2, rm(m_ea))); } /* RES 2,(XY+o) */ -OP(xycb,97) { A = res(2, rm(m_ea)); wm(m_ea, A); } /* RES 2,A=(XY+o) */ - -OP(xycb,98) { B = res(3, rm(m_ea)); wm(m_ea, B); } /* RES 3,B=(XY+o) */ -OP(xycb,99) { C = res(3, rm(m_ea)); wm(m_ea, C); } /* RES 3,C=(XY+o) */ -OP(xycb,9a) { D = res(3, rm(m_ea)); wm(m_ea, D); } /* RES 3,D=(XY+o) */ -OP(xycb,9b) { E = res(3, rm(m_ea)); wm(m_ea, E); } /* RES 3,E=(XY+o) */ -OP(xycb,9c) { H = res(3, rm(m_ea)); wm(m_ea, H); } /* RES 3,H=(XY+o) */ -OP(xycb,9d) { L = res(3, rm(m_ea)); wm(m_ea, L); } /* RES 3,L=(XY+o) */ -OP(xycb,9e) { wm(m_ea, res(3, rm(m_ea))); } /* RES 3,(XY+o) */ -OP(xycb,9f) { A = res(3, rm(m_ea)); wm(m_ea, A); } /* RES 3,A=(XY+o) */ - -OP(xycb,a0) { B = res(4, rm(m_ea)); wm(m_ea, B); } /* RES 4,B=(XY+o) */ -OP(xycb,a1) { C = res(4, rm(m_ea)); wm(m_ea, C); } /* RES 4,C=(XY+o) */ -OP(xycb,a2) { D = res(4, rm(m_ea)); wm(m_ea, D); } /* RES 4,D=(XY+o) */ -OP(xycb,a3) { E = res(4, rm(m_ea)); wm(m_ea, E); } /* RES 4,E=(XY+o) */ -OP(xycb,a4) { H = res(4, rm(m_ea)); wm(m_ea, H); } /* RES 4,H=(XY+o) */ -OP(xycb,a5) { L = res(4, rm(m_ea)); wm(m_ea, L); } /* RES 4,L=(XY+o) */ -OP(xycb,a6) { wm(m_ea, res(4, rm(m_ea))); } /* RES 4,(XY+o) */ -OP(xycb,a7) { A = res(4, rm(m_ea)); wm(m_ea, A); } /* RES 4,A=(XY+o) */ - -OP(xycb,a8) { B = res(5, rm(m_ea)); wm(m_ea, B); } /* RES 5,B=(XY+o) */ -OP(xycb,a9) { C = res(5, rm(m_ea)); wm(m_ea, C); } /* RES 5,C=(XY+o) */ -OP(xycb,aa) { D = res(5, rm(m_ea)); wm(m_ea, D); } /* RES 5,D=(XY+o) */ -OP(xycb,ab) { E = res(5, rm(m_ea)); wm(m_ea, E); } /* RES 5,E=(XY+o) */ -OP(xycb,ac) { H = res(5, rm(m_ea)); wm(m_ea, H); } /* RES 5,H=(XY+o) */ -OP(xycb,ad) { L = res(5, rm(m_ea)); wm(m_ea, L); } /* RES 5,L=(XY+o) */ -OP(xycb,ae) { wm(m_ea, res(5, rm(m_ea))); } /* RES 5,(XY+o) */ -OP(xycb,af) { A = res(5, rm(m_ea)); wm(m_ea, A); } /* RES 5,A=(XY+o) */ - -OP(xycb,b0) { B = res(6, rm(m_ea)); wm(m_ea, B); } /* RES 6,B=(XY+o) */ -OP(xycb,b1) { C = res(6, rm(m_ea)); wm(m_ea, C); } /* RES 6,C=(XY+o) */ -OP(xycb,b2) { D = res(6, rm(m_ea)); wm(m_ea, D); } /* RES 6,D=(XY+o) */ -OP(xycb,b3) { E = res(6, rm(m_ea)); wm(m_ea, E); } /* RES 6,E=(XY+o) */ -OP(xycb,b4) { H = res(6, rm(m_ea)); wm(m_ea, H); } /* RES 6,H=(XY+o) */ -OP(xycb,b5) { L = res(6, rm(m_ea)); wm(m_ea, L); } /* RES 6,L=(XY+o) */ -OP(xycb,b6) { wm(m_ea, res(6, rm(m_ea))); } /* RES 6,(XY+o) */ -OP(xycb,b7) { A = res(6, rm(m_ea)); wm(m_ea, A); } /* RES 6,A=(XY+o) */ - -OP(xycb,b8) { B = res(7, rm(m_ea)); wm(m_ea, B); } /* RES 7,B=(XY+o) */ -OP(xycb,b9) { C = res(7, rm(m_ea)); wm(m_ea, C); } /* RES 7,C=(XY+o) */ -OP(xycb,ba) { D = res(7, rm(m_ea)); wm(m_ea, D); } /* RES 7,D=(XY+o) */ -OP(xycb,bb) { E = res(7, rm(m_ea)); wm(m_ea, E); } /* RES 7,E=(XY+o) */ -OP(xycb,bc) { H = res(7, rm(m_ea)); wm(m_ea, H); } /* RES 7,H=(XY+o) */ -OP(xycb,bd) { L = res(7, rm(m_ea)); wm(m_ea, L); } /* RES 7,L=(XY+o) */ -OP(xycb,be) { wm(m_ea, res(7, rm(m_ea))); } /* RES 7,(XY+o) */ -OP(xycb,bf) { A = res(7, rm(m_ea)); wm(m_ea, A); } /* RES 7,A=(XY+o) */ - -OP(xycb,c0) { B = set(0, rm(m_ea)); wm(m_ea, B); } /* SET 0,B=(XY+o) */ -OP(xycb,c1) { C = set(0, rm(m_ea)); wm(m_ea, C); } /* SET 0,C=(XY+o) */ -OP(xycb,c2) { D = set(0, rm(m_ea)); wm(m_ea, D); } /* SET 0,D=(XY+o) */ -OP(xycb,c3) { E = set(0, rm(m_ea)); wm(m_ea, E); } /* SET 0,E=(XY+o) */ -OP(xycb,c4) { H = set(0, rm(m_ea)); wm(m_ea, H); } /* SET 0,H=(XY+o) */ -OP(xycb,c5) { L = set(0, rm(m_ea)); wm(m_ea, L); } /* SET 0,L=(XY+o) */ -OP(xycb,c6) { wm(m_ea, set(0, rm(m_ea))); } /* SET 0,(XY+o) */ -OP(xycb,c7) { A = set(0, rm(m_ea)); wm(m_ea, A); } /* SET 0,A=(XY+o) */ - -OP(xycb,c8) { B = set(1, rm(m_ea)); wm(m_ea, B); } /* SET 1,B=(XY+o) */ -OP(xycb,c9) { C = set(1, rm(m_ea)); wm(m_ea, C); } /* SET 1,C=(XY+o) */ -OP(xycb,ca) { D = set(1, rm(m_ea)); wm(m_ea, D); } /* SET 1,D=(XY+o) */ -OP(xycb,cb) { E = set(1, rm(m_ea)); wm(m_ea, E); } /* SET 1,E=(XY+o) */ -OP(xycb,cc) { H = set(1, rm(m_ea)); wm(m_ea, H); } /* SET 1,H=(XY+o) */ -OP(xycb,cd) { L = set(1, rm(m_ea)); wm(m_ea, L); } /* SET 1,L=(XY+o) */ -OP(xycb,ce) { wm(m_ea, set(1, rm(m_ea))); } /* SET 1,(XY+o) */ -OP(xycb,cf) { A = set(1, rm(m_ea)); wm(m_ea, A); } /* SET 1,A=(XY+o) */ - -OP(xycb,d0) { B = set(2, rm(m_ea)); wm(m_ea, B); } /* SET 2,B=(XY+o) */ -OP(xycb,d1) { C = set(2, rm(m_ea)); wm(m_ea, C); } /* SET 2,C=(XY+o) */ -OP(xycb,d2) { D = set(2, rm(m_ea)); wm(m_ea, D); } /* SET 2,D=(XY+o) */ -OP(xycb,d3) { E = set(2, rm(m_ea)); wm(m_ea, E); } /* SET 2,E=(XY+o) */ -OP(xycb,d4) { H = set(2, rm(m_ea)); wm(m_ea, H); } /* SET 2,H=(XY+o) */ -OP(xycb,d5) { L = set(2, rm(m_ea)); wm(m_ea, L); } /* SET 2,L=(XY+o) */ -OP(xycb,d6) { wm(m_ea, set(2, rm(m_ea))); } /* SET 2,(XY+o) */ -OP(xycb,d7) { A = set(2, rm(m_ea)); wm(m_ea, A); } /* SET 2,A=(XY+o) */ - -OP(xycb,d8) { B = set(3, rm(m_ea)); wm(m_ea, B); } /* SET 3,B=(XY+o) */ -OP(xycb,d9) { C = set(3, rm(m_ea)); wm(m_ea, C); } /* SET 3,C=(XY+o) */ -OP(xycb,da) { D = set(3, rm(m_ea)); wm(m_ea, D); } /* SET 3,D=(XY+o) */ -OP(xycb,db) { E = set(3, rm(m_ea)); wm(m_ea, E); } /* SET 3,E=(XY+o) */ -OP(xycb,dc) { H = set(3, rm(m_ea)); wm(m_ea, H); } /* SET 3,H=(XY+o) */ -OP(xycb,dd) { L = set(3, rm(m_ea)); wm(m_ea, L); } /* SET 3,L=(XY+o) */ -OP(xycb,de) { wm(m_ea, set(3, rm(m_ea))); } /* SET 3,(XY+o) */ -OP(xycb,df) { A = set(3, rm(m_ea)); wm(m_ea, A); } /* SET 3,A=(XY+o) */ - -OP(xycb,e0) { B = set(4, rm(m_ea)); wm(m_ea, B); } /* SET 4,B=(XY+o) */ -OP(xycb,e1) { C = set(4, rm(m_ea)); wm(m_ea, C); } /* SET 4,C=(XY+o) */ -OP(xycb,e2) { D = set(4, rm(m_ea)); wm(m_ea, D); } /* SET 4,D=(XY+o) */ -OP(xycb,e3) { E = set(4, rm(m_ea)); wm(m_ea, E); } /* SET 4,E=(XY+o) */ -OP(xycb,e4) { H = set(4, rm(m_ea)); wm(m_ea, H); } /* SET 4,H=(XY+o) */ -OP(xycb,e5) { L = set(4, rm(m_ea)); wm(m_ea, L); } /* SET 4,L=(XY+o) */ -OP(xycb,e6) { wm(m_ea, set(4, rm(m_ea))); } /* SET 4,(XY+o) */ -OP(xycb,e7) { A = set(4, rm(m_ea)); wm(m_ea, A); } /* SET 4,A=(XY+o) */ - -OP(xycb,e8) { B = set(5, rm(m_ea)); wm(m_ea, B); } /* SET 5,B=(XY+o) */ -OP(xycb,e9) { C = set(5, rm(m_ea)); wm(m_ea, C); } /* SET 5,C=(XY+o) */ -OP(xycb,ea) { D = set(5, rm(m_ea)); wm(m_ea, D); } /* SET 5,D=(XY+o) */ -OP(xycb,eb) { E = set(5, rm(m_ea)); wm(m_ea, E); } /* SET 5,E=(XY+o) */ -OP(xycb,ec) { H = set(5, rm(m_ea)); wm(m_ea, H); } /* SET 5,H=(XY+o) */ -OP(xycb,ed) { L = set(5, rm(m_ea)); wm(m_ea, L); } /* SET 5,L=(XY+o) */ -OP(xycb,ee) { wm(m_ea, set(5, rm(m_ea))); } /* SET 5,(XY+o) */ -OP(xycb,ef) { A = set(5, rm(m_ea)); wm(m_ea, A); } /* SET 5,A=(XY+o) */ - -OP(xycb,f0) { B = set(6, rm(m_ea)); wm(m_ea, B); } /* SET 6,B=(XY+o) */ -OP(xycb,f1) { C = set(6, rm(m_ea)); wm(m_ea, C); } /* SET 6,C=(XY+o) */ -OP(xycb,f2) { D = set(6, rm(m_ea)); wm(m_ea, D); } /* SET 6,D=(XY+o) */ -OP(xycb,f3) { E = set(6, rm(m_ea)); wm(m_ea, E); } /* SET 6,E=(XY+o) */ -OP(xycb,f4) { H = set(6, rm(m_ea)); wm(m_ea, H); } /* SET 6,H=(XY+o) */ -OP(xycb,f5) { L = set(6, rm(m_ea)); wm(m_ea, L); } /* SET 6,L=(XY+o) */ -OP(xycb,f6) { wm(m_ea, set(6, rm(m_ea))); } /* SET 6,(XY+o) */ -OP(xycb,f7) { A = set(6, rm(m_ea)); wm(m_ea, A); } /* SET 6,A=(XY+o) */ - -OP(xycb,f8) { B = set(7, rm(m_ea)); wm(m_ea, B); } /* SET 7,B=(XY+o) */ -OP(xycb,f9) { C = set(7, rm(m_ea)); wm(m_ea, C); } /* SET 7,C=(XY+o) */ -OP(xycb,fa) { D = set(7, rm(m_ea)); wm(m_ea, D); } /* SET 7,D=(XY+o) */ -OP(xycb,fb) { E = set(7, rm(m_ea)); wm(m_ea, E); } /* SET 7,E=(XY+o) */ -OP(xycb,fc) { H = set(7, rm(m_ea)); wm(m_ea, H); } /* SET 7,H=(XY+o) */ -OP(xycb,fd) { L = set(7, rm(m_ea)); wm(m_ea, L); } /* SET 7,L=(XY+o) */ -OP(xycb,fe) { wm(m_ea, set(7, rm(m_ea))); } /* SET 7,(XY+o) */ -OP(xycb,ff) { A = set(7, rm(m_ea)); wm(m_ea, A); } /* SET 7,A=(XY+o) */ +OP(xycb,80) { B = res(0, rm_reg(m_ea)); wm(m_ea, B); } /* RES 0,B=(XY+o) */ +OP(xycb,81) { C = res(0, rm_reg(m_ea)); wm(m_ea, C); } /* RES 0,C=(XY+o) */ +OP(xycb,82) { D = res(0, rm_reg(m_ea)); wm(m_ea, D); } /* RES 0,D=(XY+o) */ +OP(xycb,83) { E = res(0, rm_reg(m_ea)); wm(m_ea, E); } /* RES 0,E=(XY+o) */ +OP(xycb,84) { H = res(0, rm_reg(m_ea)); wm(m_ea, H); } /* RES 0,H=(XY+o) */ +OP(xycb,85) { L = res(0, rm_reg(m_ea)); wm(m_ea, L); } /* RES 0,L=(XY+o) */ +OP(xycb,86) { wm(m_ea, res(0, rm_reg(m_ea))); } /* RES 0,(XY+o) */ +OP(xycb,87) { A = res(0, rm_reg(m_ea)); wm(m_ea, A); } /* RES 0,A=(XY+o) */ + +OP(xycb,88) { B = res(1, rm_reg(m_ea)); wm(m_ea, B); } /* RES 1,B=(XY+o) */ +OP(xycb,89) { C = res(1, rm_reg(m_ea)); wm(m_ea, C); } /* RES 1,C=(XY+o) */ +OP(xycb,8a) { D = res(1, rm_reg(m_ea)); wm(m_ea, D); } /* RES 1,D=(XY+o) */ +OP(xycb,8b) { E = res(1, rm_reg(m_ea)); wm(m_ea, E); } /* RES 1,E=(XY+o) */ +OP(xycb,8c) { H = res(1, rm_reg(m_ea)); wm(m_ea, H); } /* RES 1,H=(XY+o) */ +OP(xycb,8d) { L = res(1, rm_reg(m_ea)); wm(m_ea, L); } /* RES 1,L=(XY+o) */ +OP(xycb,8e) { wm(m_ea, res(1, rm_reg(m_ea))); } /* RES 1,(XY+o) */ +OP(xycb,8f) { A = res(1, rm_reg(m_ea)); wm(m_ea, A); } /* RES 1,A=(XY+o) */ + +OP(xycb,90) { B = res(2, rm_reg(m_ea)); wm(m_ea, B); } /* RES 2,B=(XY+o) */ +OP(xycb,91) { C = res(2, rm_reg(m_ea)); wm(m_ea, C); } /* RES 2,C=(XY+o) */ +OP(xycb,92) { D = res(2, rm_reg(m_ea)); wm(m_ea, D); } /* RES 2,D=(XY+o) */ +OP(xycb,93) { E = res(2, rm_reg(m_ea)); wm(m_ea, E); } /* RES 2,E=(XY+o) */ +OP(xycb,94) { H = res(2, rm_reg(m_ea)); wm(m_ea, H); } /* RES 2,H=(XY+o) */ +OP(xycb,95) { L = res(2, rm_reg(m_ea)); wm(m_ea, L); } /* RES 2,L=(XY+o) */ +OP(xycb,96) { wm(m_ea, res(2, rm_reg(m_ea))); } /* RES 2,(XY+o) */ +OP(xycb,97) { A = res(2, rm_reg(m_ea)); wm(m_ea, A); } /* RES 2,A=(XY+o) */ + +OP(xycb,98) { B = res(3, rm_reg(m_ea)); wm(m_ea, B); } /* RES 3,B=(XY+o) */ +OP(xycb,99) { C = res(3, rm_reg(m_ea)); wm(m_ea, C); } /* RES 3,C=(XY+o) */ +OP(xycb,9a) { D = res(3, rm_reg(m_ea)); wm(m_ea, D); } /* RES 3,D=(XY+o) */ +OP(xycb,9b) { E = res(3, rm_reg(m_ea)); wm(m_ea, E); } /* RES 3,E=(XY+o) */ +OP(xycb,9c) { H = res(3, rm_reg(m_ea)); wm(m_ea, H); } /* RES 3,H=(XY+o) */ +OP(xycb,9d) { L = res(3, rm_reg(m_ea)); wm(m_ea, L); } /* RES 3,L=(XY+o) */ +OP(xycb,9e) { wm(m_ea, res(3, rm_reg(m_ea))); } /* RES 3,(XY+o) */ +OP(xycb,9f) { A = res(3, rm_reg(m_ea)); wm(m_ea, A); } /* RES 3,A=(XY+o) */ + +OP(xycb,a0) { B = res(4, rm_reg(m_ea)); wm(m_ea, B); } /* RES 4,B=(XY+o) */ +OP(xycb,a1) { C = res(4, rm_reg(m_ea)); wm(m_ea, C); } /* RES 4,C=(XY+o) */ +OP(xycb,a2) { D = res(4, rm_reg(m_ea)); wm(m_ea, D); } /* RES 4,D=(XY+o) */ +OP(xycb,a3) { E = res(4, rm_reg(m_ea)); wm(m_ea, E); } /* RES 4,E=(XY+o) */ +OP(xycb,a4) { H = res(4, rm_reg(m_ea)); wm(m_ea, H); } /* RES 4,H=(XY+o) */ +OP(xycb,a5) { L = res(4, rm_reg(m_ea)); wm(m_ea, L); } /* RES 4,L=(XY+o) */ +OP(xycb,a6) { wm(m_ea, res(4, rm_reg(m_ea))); } /* RES 4,(XY+o) */ +OP(xycb,a7) { A = res(4, rm_reg(m_ea)); wm(m_ea, A); } /* RES 4,A=(XY+o) */ + +OP(xycb,a8) { B = res(5, rm_reg(m_ea)); wm(m_ea, B); } /* RES 5,B=(XY+o) */ +OP(xycb,a9) { C = res(5, rm_reg(m_ea)); wm(m_ea, C); } /* RES 5,C=(XY+o) */ +OP(xycb,aa) { D = res(5, rm_reg(m_ea)); wm(m_ea, D); } /* RES 5,D=(XY+o) */ +OP(xycb,ab) { E = res(5, rm_reg(m_ea)); wm(m_ea, E); } /* RES 5,E=(XY+o) */ +OP(xycb,ac) { H = res(5, rm_reg(m_ea)); wm(m_ea, H); } /* RES 5,H=(XY+o) */ +OP(xycb,ad) { L = res(5, rm_reg(m_ea)); wm(m_ea, L); } /* RES 5,L=(XY+o) */ +OP(xycb,ae) { wm(m_ea, res(5, rm_reg(m_ea))); } /* RES 5,(XY+o) */ +OP(xycb,af) { A = res(5, rm_reg(m_ea)); wm(m_ea, A); } /* RES 5,A=(XY+o) */ + +OP(xycb,b0) { B = res(6, rm_reg(m_ea)); wm(m_ea, B); } /* RES 6,B=(XY+o) */ +OP(xycb,b1) { C = res(6, rm_reg(m_ea)); wm(m_ea, C); } /* RES 6,C=(XY+o) */ +OP(xycb,b2) { D = res(6, rm_reg(m_ea)); wm(m_ea, D); } /* RES 6,D=(XY+o) */ +OP(xycb,b3) { E = res(6, rm_reg(m_ea)); wm(m_ea, E); } /* RES 6,E=(XY+o) */ +OP(xycb,b4) { H = res(6, rm_reg(m_ea)); wm(m_ea, H); } /* RES 6,H=(XY+o) */ +OP(xycb,b5) { L = res(6, rm_reg(m_ea)); wm(m_ea, L); } /* RES 6,L=(XY+o) */ +OP(xycb,b6) { wm(m_ea, res(6, rm_reg(m_ea))); } /* RES 6,(XY+o) */ +OP(xycb,b7) { A = res(6, rm_reg(m_ea)); wm(m_ea, A); } /* RES 6,A=(XY+o) */ + +OP(xycb,b8) { B = res(7, rm_reg(m_ea)); wm(m_ea, B); } /* RES 7,B=(XY+o) */ +OP(xycb,b9) { C = res(7, rm_reg(m_ea)); wm(m_ea, C); } /* RES 7,C=(XY+o) */ +OP(xycb,ba) { D = res(7, rm_reg(m_ea)); wm(m_ea, D); } /* RES 7,D=(XY+o) */ +OP(xycb,bb) { E = res(7, rm_reg(m_ea)); wm(m_ea, E); } /* RES 7,E=(XY+o) */ +OP(xycb,bc) { H = res(7, rm_reg(m_ea)); wm(m_ea, H); } /* RES 7,H=(XY+o) */ +OP(xycb,bd) { L = res(7, rm_reg(m_ea)); wm(m_ea, L); } /* RES 7,L=(XY+o) */ +OP(xycb,be) { wm(m_ea, res(7, rm_reg(m_ea))); } /* RES 7,(XY+o) */ +OP(xycb,bf) { A = res(7, rm_reg(m_ea)); wm(m_ea, A); } /* RES 7,A=(XY+o) */ + +OP(xycb,c0) { B = set(0, rm_reg(m_ea)); wm(m_ea, B); } /* SET 0,B=(XY+o) */ +OP(xycb,c1) { C = set(0, rm_reg(m_ea)); wm(m_ea, C); } /* SET 0,C=(XY+o) */ +OP(xycb,c2) { D = set(0, rm_reg(m_ea)); wm(m_ea, D); } /* SET 0,D=(XY+o) */ +OP(xycb,c3) { E = set(0, rm_reg(m_ea)); wm(m_ea, E); } /* SET 0,E=(XY+o) */ +OP(xycb,c4) { H = set(0, rm_reg(m_ea)); wm(m_ea, H); } /* SET 0,H=(XY+o) */ +OP(xycb,c5) { L = set(0, rm_reg(m_ea)); wm(m_ea, L); } /* SET 0,L=(XY+o) */ +OP(xycb,c6) { wm(m_ea, set(0, rm_reg(m_ea))); } /* SET 0,(XY+o) */ +OP(xycb,c7) { A = set(0, rm_reg(m_ea)); wm(m_ea, A); } /* SET 0,A=(XY+o) */ + +OP(xycb,c8) { B = set(1, rm_reg(m_ea)); wm(m_ea, B); } /* SET 1,B=(XY+o) */ +OP(xycb,c9) { C = set(1, rm_reg(m_ea)); wm(m_ea, C); } /* SET 1,C=(XY+o) */ +OP(xycb,ca) { D = set(1, rm_reg(m_ea)); wm(m_ea, D); } /* SET 1,D=(XY+o) */ +OP(xycb,cb) { E = set(1, rm_reg(m_ea)); wm(m_ea, E); } /* SET 1,E=(XY+o) */ +OP(xycb,cc) { H = set(1, rm_reg(m_ea)); wm(m_ea, H); } /* SET 1,H=(XY+o) */ +OP(xycb,cd) { L = set(1, rm_reg(m_ea)); wm(m_ea, L); } /* SET 1,L=(XY+o) */ +OP(xycb,ce) { wm(m_ea, set(1, rm_reg(m_ea))); } /* SET 1,(XY+o) */ +OP(xycb,cf) { A = set(1, rm_reg(m_ea)); wm(m_ea, A); } /* SET 1,A=(XY+o) */ + +OP(xycb,d0) { B = set(2, rm_reg(m_ea)); wm(m_ea, B); } /* SET 2,B=(XY+o) */ +OP(xycb,d1) { C = set(2, rm_reg(m_ea)); wm(m_ea, C); } /* SET 2,C=(XY+o) */ +OP(xycb,d2) { D = set(2, rm_reg(m_ea)); wm(m_ea, D); } /* SET 2,D=(XY+o) */ +OP(xycb,d3) { E = set(2, rm_reg(m_ea)); wm(m_ea, E); } /* SET 2,E=(XY+o) */ +OP(xycb,d4) { H = set(2, rm_reg(m_ea)); wm(m_ea, H); } /* SET 2,H=(XY+o) */ +OP(xycb,d5) { L = set(2, rm_reg(m_ea)); wm(m_ea, L); } /* SET 2,L=(XY+o) */ +OP(xycb,d6) { wm(m_ea, set(2, rm_reg(m_ea))); } /* SET 2,(XY+o) */ +OP(xycb,d7) { A = set(2, rm_reg(m_ea)); wm(m_ea, A); } /* SET 2,A=(XY+o) */ + +OP(xycb,d8) { B = set(3, rm_reg(m_ea)); wm(m_ea, B); } /* SET 3,B=(XY+o) */ +OP(xycb,d9) { C = set(3, rm_reg(m_ea)); wm(m_ea, C); } /* SET 3,C=(XY+o) */ +OP(xycb,da) { D = set(3, rm_reg(m_ea)); wm(m_ea, D); } /* SET 3,D=(XY+o) */ +OP(xycb,db) { E = set(3, rm_reg(m_ea)); wm(m_ea, E); } /* SET 3,E=(XY+o) */ +OP(xycb,dc) { H = set(3, rm_reg(m_ea)); wm(m_ea, H); } /* SET 3,H=(XY+o) */ +OP(xycb,dd) { L = set(3, rm_reg(m_ea)); wm(m_ea, L); } /* SET 3,L=(XY+o) */ +OP(xycb,de) { wm(m_ea, set(3, rm_reg(m_ea))); } /* SET 3,(XY+o) */ +OP(xycb,df) { A = set(3, rm_reg(m_ea)); wm(m_ea, A); } /* SET 3,A=(XY+o) */ + +OP(xycb,e0) { B = set(4, rm_reg(m_ea)); wm(m_ea, B); } /* SET 4,B=(XY+o) */ +OP(xycb,e1) { C = set(4, rm_reg(m_ea)); wm(m_ea, C); } /* SET 4,C=(XY+o) */ +OP(xycb,e2) { D = set(4, rm_reg(m_ea)); wm(m_ea, D); } /* SET 4,D=(XY+o) */ +OP(xycb,e3) { E = set(4, rm_reg(m_ea)); wm(m_ea, E); } /* SET 4,E=(XY+o) */ +OP(xycb,e4) { H = set(4, rm_reg(m_ea)); wm(m_ea, H); } /* SET 4,H=(XY+o) */ +OP(xycb,e5) { L = set(4, rm_reg(m_ea)); wm(m_ea, L); } /* SET 4,L=(XY+o) */ +OP(xycb,e6) { wm(m_ea, set(4, rm_reg(m_ea))); } /* SET 4,(XY+o) */ +OP(xycb,e7) { A = set(4, rm_reg(m_ea)); wm(m_ea, A); } /* SET 4,A=(XY+o) */ + +OP(xycb,e8) { B = set(5, rm_reg(m_ea)); wm(m_ea, B); } /* SET 5,B=(XY+o) */ +OP(xycb,e9) { C = set(5, rm_reg(m_ea)); wm(m_ea, C); } /* SET 5,C=(XY+o) */ +OP(xycb,ea) { D = set(5, rm_reg(m_ea)); wm(m_ea, D); } /* SET 5,D=(XY+o) */ +OP(xycb,eb) { E = set(5, rm_reg(m_ea)); wm(m_ea, E); } /* SET 5,E=(XY+o) */ +OP(xycb,ec) { H = set(5, rm_reg(m_ea)); wm(m_ea, H); } /* SET 5,H=(XY+o) */ +OP(xycb,ed) { L = set(5, rm_reg(m_ea)); wm(m_ea, L); } /* SET 5,L=(XY+o) */ +OP(xycb,ee) { wm(m_ea, set(5, rm_reg(m_ea))); } /* SET 5,(XY+o) */ +OP(xycb,ef) { A = set(5, rm_reg(m_ea)); wm(m_ea, A); } /* SET 5,A=(XY+o) */ + +OP(xycb,f0) { B = set(6, rm_reg(m_ea)); wm(m_ea, B); } /* SET 6,B=(XY+o) */ +OP(xycb,f1) { C = set(6, rm_reg(m_ea)); wm(m_ea, C); } /* SET 6,C=(XY+o) */ +OP(xycb,f2) { D = set(6, rm_reg(m_ea)); wm(m_ea, D); } /* SET 6,D=(XY+o) */ +OP(xycb,f3) { E = set(6, rm_reg(m_ea)); wm(m_ea, E); } /* SET 6,E=(XY+o) */ +OP(xycb,f4) { H = set(6, rm_reg(m_ea)); wm(m_ea, H); } /* SET 6,H=(XY+o) */ +OP(xycb,f5) { L = set(6, rm_reg(m_ea)); wm(m_ea, L); } /* SET 6,L=(XY+o) */ +OP(xycb,f6) { wm(m_ea, set(6, rm_reg(m_ea))); } /* SET 6,(XY+o) */ +OP(xycb,f7) { A = set(6, rm_reg(m_ea)); wm(m_ea, A); } /* SET 6,A=(XY+o) */ + +OP(xycb,f8) { B = set(7, rm_reg(m_ea)); wm(m_ea, B); } /* SET 7,B=(XY+o) */ +OP(xycb,f9) { C = set(7, rm_reg(m_ea)); wm(m_ea, C); } /* SET 7,C=(XY+o) */ +OP(xycb,fa) { D = set(7, rm_reg(m_ea)); wm(m_ea, D); } /* SET 7,D=(XY+o) */ +OP(xycb,fb) { E = set(7, rm_reg(m_ea)); wm(m_ea, E); } /* SET 7,E=(XY+o) */ +OP(xycb,fc) { H = set(7, rm_reg(m_ea)); wm(m_ea, H); } /* SET 7,H=(XY+o) */ +OP(xycb,fd) { L = set(7, rm_reg(m_ea)); wm(m_ea, L); } /* SET 7,L=(XY+o) */ +OP(xycb,fe) { wm(m_ea, set(7, rm_reg(m_ea))); } /* SET 7,(XY+o) */ +OP(xycb,ff) { A = set(7, rm_reg(m_ea)); wm(m_ea, A); } /* SET 7,A=(XY+o) */ OP(illegal,1) { logerror("Z80 ill. opcode $%02x $%02x ($%04x)\n", @@ -1998,7 +2091,7 @@ OP(dd,1f) { illegal_1(); op_1f(); } /* DB DD OP(dd,20) { illegal_1(); op_20(); } /* DB DD */ OP(dd,21) { IX = arg16(); } /* LD IX,w */ OP(dd,22) { m_ea = arg16(); wm16(m_ea, m_ix); WZ = m_ea + 1; } /* LD (w),IX */ -OP(dd,23) { IX++; } /* INC IX */ +OP(dd,23) { nomreq_ir(2); IX++; } /* INC IX */ OP(dd,24) { HX = inc(HX); } /* INC HX */ OP(dd,25) { HX = dec(HX); } /* DEC HX */ OP(dd,26) { HX = arg(); } /* LD HX,n */ @@ -2007,7 +2100,7 @@ OP(dd,27) { illegal_1(); op_27(); } /* DB DD OP(dd,28) { illegal_1(); op_28(); } /* DB DD */ OP(dd,29) { add16(m_ix, m_ix); } /* ADD IX,IX */ OP(dd,2a) { m_ea = arg16(); rm16(m_ea, m_ix); WZ = m_ea + 1; } /* LD IX,(w) */ -OP(dd,2b) { IX--; } /* DEC IX */ +OP(dd,2b) { nomreq_ir(2); IX--; } /* DEC IX */ OP(dd,2c) { LX = inc(LX); } /* INC LX */ OP(dd,2d) { LX = dec(LX); } /* DEC LX */ OP(dd,2e) { LX = arg(); } /* LD LX,n */ @@ -2017,9 +2110,9 @@ OP(dd,30) { illegal_1(); op_30(); } /* DB DD OP(dd,31) { illegal_1(); op_31(); } /* DB DD */ OP(dd,32) { illegal_1(); op_32(); } /* DB DD */ OP(dd,33) { illegal_1(); op_33(); } /* DB DD */ -OP(dd,34) { eax(); wm(m_ea, inc(rm(m_ea))); } /* INC (IX+o) */ -OP(dd,35) { eax(); wm(m_ea, dec(rm(m_ea))); } /* DEC (IX+o) */ -OP(dd,36) { eax(); wm(m_ea, arg()); } /* LD (IX+o),n */ +OP(dd,34) { eax(); nomreq_addr(PCD-1, 5); wm(m_ea, inc(rm_reg(m_ea))); } /* INC (IX+o) */ +OP(dd,35) { eax(); nomreq_addr(PCD-1, 5); wm(m_ea, dec(rm_reg(m_ea))); } /* DEC (IX+o) */ +OP(dd,36) { eax(); u8 a = arg(); nomreq_addr(PCD-1, 2); wm(m_ea, a); } /* LD (IX+o),n */ OP(dd,37) { illegal_1(); op_37(); } /* DB DD */ OP(dd,38) { illegal_1(); op_38(); } /* DB DD */ @@ -2037,7 +2130,7 @@ OP(dd,42) { illegal_1(); op_42(); } /* DB DD OP(dd,43) { illegal_1(); op_43(); } /* DB DD */ OP(dd,44) { B = HX; } /* LD B,HX */ OP(dd,45) { B = LX; } /* LD B,LX */ -OP(dd,46) { eax(); B = rm(m_ea); } /* LD B,(IX+o) */ +OP(dd,46) { eax(); nomreq_addr(PCD-1, 5); B = rm(m_ea); } /* LD B,(IX+o) */ OP(dd,47) { illegal_1(); op_47(); } /* DB DD */ OP(dd,48) { illegal_1(); op_48(); } /* DB DD */ @@ -2046,7 +2139,7 @@ OP(dd,4a) { illegal_1(); op_4a(); } /* DB DD OP(dd,4b) { illegal_1(); op_4b(); } /* DB DD */ OP(dd,4c) { C = HX; } /* LD C,HX */ OP(dd,4d) { C = LX; } /* LD C,LX */ -OP(dd,4e) { eax(); C = rm(m_ea); } /* LD C,(IX+o) */ +OP(dd,4e) { eax(); nomreq_addr(PCD-1, 5); C = rm(m_ea); } /* LD C,(IX+o) */ OP(dd,4f) { illegal_1(); op_4f(); } /* DB DD */ OP(dd,50) { illegal_1(); op_50(); } /* DB DD */ @@ -2055,7 +2148,7 @@ OP(dd,52) { illegal_1(); op_52(); } /* DB DD OP(dd,53) { illegal_1(); op_53(); } /* DB DD */ OP(dd,54) { D = HX; } /* LD D,HX */ OP(dd,55) { D = LX; } /* LD D,LX */ -OP(dd,56) { eax(); D = rm(m_ea); } /* LD D,(IX+o) */ +OP(dd,56) { eax(); nomreq_addr(PCD-1, 5); D = rm(m_ea); } /* LD D,(IX+o) */ OP(dd,57) { illegal_1(); op_57(); } /* DB DD */ OP(dd,58) { illegal_1(); op_58(); } /* DB DD */ @@ -2064,7 +2157,7 @@ OP(dd,5a) { illegal_1(); op_5a(); } /* DB DD OP(dd,5b) { illegal_1(); op_5b(); } /* DB DD */ OP(dd,5c) { E = HX; } /* LD E,HX */ OP(dd,5d) { E = LX; } /* LD E,LX */ -OP(dd,5e) { eax(); E = rm(m_ea); } /* LD E,(IX+o) */ +OP(dd,5e) { eax(); nomreq_addr(PCD-1, 5); E = rm(m_ea); } /* LD E,(IX+o) */ OP(dd,5f) { illegal_1(); op_5f(); } /* DB DD */ OP(dd,60) { HX = B; } /* LD HX,B */ @@ -2073,7 +2166,7 @@ OP(dd,62) { HX = D; } /* LD HX,D OP(dd,63) { HX = E; } /* LD HX,E */ OP(dd,64) { } /* LD HX,HX */ OP(dd,65) { HX = LX; } /* LD HX,LX */ -OP(dd,66) { eax(); H = rm(m_ea); } /* LD H,(IX+o) */ +OP(dd,66) { eax(); nomreq_addr(PCD-1, 5); H = rm(m_ea); } /* LD H,(IX+o) */ OP(dd,67) { HX = A; } /* LD HX,A */ OP(dd,68) { LX = B; } /* LD LX,B */ @@ -2082,17 +2175,17 @@ OP(dd,6a) { LX = D; } /* LD LX,D OP(dd,6b) { LX = E; } /* LD LX,E */ OP(dd,6c) { LX = HX; } /* LD LX,HX */ OP(dd,6d) { } /* LD LX,LX */ -OP(dd,6e) { eax(); L = rm(m_ea); } /* LD L,(IX+o) */ +OP(dd,6e) { eax(); nomreq_addr(PCD-1, 5); L = rm(m_ea); } /* LD L,(IX+o) */ OP(dd,6f) { LX = A; } /* LD LX,A */ -OP(dd,70) { eax(); wm(m_ea, B); } /* LD (IX+o),B */ -OP(dd,71) { eax(); wm(m_ea, C); } /* LD (IX+o),C */ -OP(dd,72) { eax(); wm(m_ea, D); } /* LD (IX+o),D */ -OP(dd,73) { eax(); wm(m_ea, E); } /* LD (IX+o),E */ -OP(dd,74) { eax(); wm(m_ea, H); } /* LD (IX+o),H */ -OP(dd,75) { eax(); wm(m_ea, L); } /* LD (IX+o),L */ +OP(dd,70) { eax(); nomreq_addr(PCD-1, 5); wm(m_ea, B); } /* LD (IX+o),B */ +OP(dd,71) { eax(); nomreq_addr(PCD-1, 5); wm(m_ea, C); } /* LD (IX+o),C */ +OP(dd,72) { eax(); nomreq_addr(PCD-1, 5); wm(m_ea, D); } /* LD (IX+o),D */ +OP(dd,73) { eax(); nomreq_addr(PCD-1, 5); wm(m_ea, E); } /* LD (IX+o),E */ +OP(dd,74) { eax(); nomreq_addr(PCD-1, 5); wm(m_ea, H); } /* LD (IX+o),H */ +OP(dd,75) { eax(); nomreq_addr(PCD-1, 5); wm(m_ea, L); } /* LD (IX+o),L */ OP(dd,76) { illegal_1(); op_76(); } /* DB DD */ -OP(dd,77) { eax(); wm(m_ea, A); } /* LD (IX+o),A */ +OP(dd,77) { eax(); nomreq_addr(PCD-1, 5); wm(m_ea, A); } /* LD (IX+o),A */ OP(dd,78) { illegal_1(); op_78(); } /* DB DD */ OP(dd,79) { illegal_1(); op_79(); } /* DB DD */ @@ -2100,7 +2193,7 @@ OP(dd,7a) { illegal_1(); op_7a(); } /* DB DD OP(dd,7b) { illegal_1(); op_7b(); } /* DB DD */ OP(dd,7c) { A = HX; } /* LD A,HX */ OP(dd,7d) { A = LX; } /* LD A,LX */ -OP(dd,7e) { eax(); A = rm(m_ea); } /* LD A,(IX+o) */ +OP(dd,7e) { eax(); nomreq_addr(PCD-1, 5); A = rm(m_ea); } /* LD A,(IX+o) */ OP(dd,7f) { illegal_1(); op_7f(); } /* DB DD */ OP(dd,80) { illegal_1(); op_80(); } /* DB DD */ @@ -2109,7 +2202,7 @@ OP(dd,82) { illegal_1(); op_82(); } /* DB DD OP(dd,83) { illegal_1(); op_83(); } /* DB DD */ OP(dd,84) { add_a(HX); } /* ADD A,HX */ OP(dd,85) { add_a(LX); } /* ADD A,LX */ -OP(dd,86) { eax(); add_a(rm(m_ea)); } /* ADD A,(IX+o) */ +OP(dd,86) { eax(); nomreq_addr(PCD-1, 5); add_a(rm(m_ea)); } /* ADD A,(IX+o) */ OP(dd,87) { illegal_1(); op_87(); } /* DB DD */ OP(dd,88) { illegal_1(); op_88(); } /* DB DD */ @@ -2118,7 +2211,7 @@ OP(dd,8a) { illegal_1(); op_8a(); } /* DB DD OP(dd,8b) { illegal_1(); op_8b(); } /* DB DD */ OP(dd,8c) { adc_a(HX); } /* ADC A,HX */ OP(dd,8d) { adc_a(LX); } /* ADC A,LX */ -OP(dd,8e) { eax(); adc_a(rm(m_ea)); } /* ADC A,(IX+o) */ +OP(dd,8e) { eax(); nomreq_addr(PCD-1, 5); adc_a(rm(m_ea)); } /* ADC A,(IX+o) */ OP(dd,8f) { illegal_1(); op_8f(); } /* DB DD */ OP(dd,90) { illegal_1(); op_90(); } /* DB DD */ @@ -2127,7 +2220,7 @@ OP(dd,92) { illegal_1(); op_92(); } /* DB DD OP(dd,93) { illegal_1(); op_93(); } /* DB DD */ OP(dd,94) { sub(HX); } /* SUB HX */ OP(dd,95) { sub(LX); } /* SUB LX */ -OP(dd,96) { eax(); sub(rm(m_ea)); } /* SUB (IX+o) */ +OP(dd,96) { eax(); nomreq_addr(PCD-1, 5); sub(rm(m_ea)); } /* SUB (IX+o) */ OP(dd,97) { illegal_1(); op_97(); } /* DB DD */ OP(dd,98) { illegal_1(); op_98(); } /* DB DD */ @@ -2136,7 +2229,7 @@ OP(dd,9a) { illegal_1(); op_9a(); } /* DB DD OP(dd,9b) { illegal_1(); op_9b(); } /* DB DD */ OP(dd,9c) { sbc_a(HX); } /* SBC A,HX */ OP(dd,9d) { sbc_a(LX); } /* SBC A,LX */ -OP(dd,9e) { eax(); sbc_a(rm(m_ea)); } /* SBC A,(IX+o) */ +OP(dd,9e) { eax(); nomreq_addr(PCD-1, 5); sbc_a(rm(m_ea)); } /* SBC A,(IX+o) */ OP(dd,9f) { illegal_1(); op_9f(); } /* DB DD */ OP(dd,a0) { illegal_1(); op_a0(); } /* DB DD */ @@ -2145,7 +2238,7 @@ OP(dd,a2) { illegal_1(); op_a2(); } /* DB DD OP(dd,a3) { illegal_1(); op_a3(); } /* DB DD */ OP(dd,a4) { and_a(HX); } /* AND HX */ OP(dd,a5) { and_a(LX); } /* AND LX */ -OP(dd,a6) { eax(); and_a(rm(m_ea)); } /* AND (IX+o) */ +OP(dd,a6) { eax(); nomreq_addr(PCD-1, 5); and_a(rm(m_ea)); } /* AND (IX+o) */ OP(dd,a7) { illegal_1(); op_a7(); } /* DB DD */ OP(dd,a8) { illegal_1(); op_a8(); } /* DB DD */ @@ -2154,7 +2247,7 @@ OP(dd,aa) { illegal_1(); op_aa(); } /* DB DD OP(dd,ab) { illegal_1(); op_ab(); } /* DB DD */ OP(dd,ac) { xor_a(HX); } /* XOR HX */ OP(dd,ad) { xor_a(LX); } /* XOR LX */ -OP(dd,ae) { eax(); xor_a(rm(m_ea)); } /* XOR (IX+o) */ +OP(dd,ae) { eax(); nomreq_addr(PCD-1, 5); xor_a(rm(m_ea)); } /* XOR (IX+o) */ OP(dd,af) { illegal_1(); op_af(); } /* DB DD */ OP(dd,b0) { illegal_1(); op_b0(); } /* DB DD */ @@ -2163,7 +2256,7 @@ OP(dd,b2) { illegal_1(); op_b2(); } /* DB DD OP(dd,b3) { illegal_1(); op_b3(); } /* DB DD */ OP(dd,b4) { or_a(HX); } /* OR HX */ OP(dd,b5) { or_a(LX); } /* OR LX */ -OP(dd,b6) { eax(); or_a(rm(m_ea)); } /* OR (IX+o) */ +OP(dd,b6) { eax(); nomreq_addr(PCD-1, 5); or_a(rm(m_ea)); } /* OR (IX+o) */ OP(dd,b7) { illegal_1(); op_b7(); } /* DB DD */ OP(dd,b8) { illegal_1(); op_b8(); } /* DB DD */ @@ -2172,7 +2265,7 @@ OP(dd,ba) { illegal_1(); op_ba(); } /* DB DD OP(dd,bb) { illegal_1(); op_bb(); } /* DB DD */ OP(dd,bc) { cp(HX); } /* CP HX */ OP(dd,bd) { cp(LX); } /* CP LX */ -OP(dd,be) { eax(); cp(rm(m_ea)); } /* CP (IX+o) */ +OP(dd,be) { eax(); nomreq_addr(PCD-1, 5); cp(rm(m_ea)); } /* CP (IX+o) */ OP(dd,bf) { illegal_1(); op_bf(); } /* DB DD */ OP(dd,c0) { illegal_1(); op_c0(); } /* DB DD */ @@ -2187,7 +2280,7 @@ OP(dd,c7) { illegal_1(); op_c7(); } /* DB DD OP(dd,c8) { illegal_1(); op_c8(); } /* DB DD */ OP(dd,c9) { illegal_1(); op_c9(); } /* DB DD */ OP(dd,ca) { illegal_1(); op_ca(); } /* DB DD */ -OP(dd,cb) { eax(); EXEC(xycb,arg()); } /* ** DD CB xx */ +OP(dd,cb) { eax(); u8 a = arg(); nomreq_addr(PCD-1, 2); EXEC(xycb, a); } /* ** DD CB xx */ OP(dd,cc) { illegal_1(); op_cc(); } /* DB DD */ OP(dd,cd) { illegal_1(); op_cd(); } /* DB DD */ OP(dd,ce) { illegal_1(); op_ce(); } /* DB DD */ @@ -2239,7 +2332,7 @@ OP(dd,f6) { illegal_1(); op_f6(); } /* DB DD OP(dd,f7) { illegal_1(); op_f7(); } /* DB DD */ OP(dd,f8) { illegal_1(); op_f8(); } /* DB DD */ -OP(dd,f9) { SP = IX; } /* LD SP,IX */ +OP(dd,f9) { nomreq_ir(2); SP = IX; } /* LD SP,IX */ OP(dd,fa) { illegal_1(); op_fa(); } /* DB DD */ OP(dd,fb) { illegal_1(); op_fb(); } /* DB DD */ OP(dd,fc) { illegal_1(); op_fc(); } /* DB DD */ @@ -2289,7 +2382,7 @@ OP(fd,1f) { illegal_1(); op_1f(); } /* DB FD OP(fd,20) { illegal_1(); op_20(); } /* DB FD */ OP(fd,21) { IY = arg16(); } /* LD IY,w */ OP(fd,22) { m_ea = arg16(); wm16(m_ea, m_iy); WZ = m_ea + 1; } /* LD (w),IY */ -OP(fd,23) { IY++; } /* INC IY */ +OP(fd,23) { nomreq_ir(2); IY++; } /* INC IY */ OP(fd,24) { HY = inc(HY); } /* INC HY */ OP(fd,25) { HY = dec(HY); } /* DEC HY */ OP(fd,26) { HY = arg(); } /* LD HY,n */ @@ -2298,7 +2391,7 @@ OP(fd,27) { illegal_1(); op_27(); } /* DB FD OP(fd,28) { illegal_1(); op_28(); } /* DB FD */ OP(fd,29) { add16(m_iy, m_iy); } /* ADD IY,IY */ OP(fd,2a) { m_ea = arg16(); rm16(m_ea, m_iy); WZ = m_ea + 1; } /* LD IY,(w) */ -OP(fd,2b) { IY--; } /* DEC IY */ +OP(fd,2b) { nomreq_ir(2); IY--; } /* DEC IY */ OP(fd,2c) { LY = inc(LY); } /* INC LY */ OP(fd,2d) { LY = dec(LY); } /* DEC LY */ OP(fd,2e) { LY = arg(); } /* LD LY,n */ @@ -2308,9 +2401,9 @@ OP(fd,30) { illegal_1(); op_30(); } /* DB FD OP(fd,31) { illegal_1(); op_31(); } /* DB FD */ OP(fd,32) { illegal_1(); op_32(); } /* DB FD */ OP(fd,33) { illegal_1(); op_33(); } /* DB FD */ -OP(fd,34) { eay(); wm(m_ea, inc(rm(m_ea))); } /* INC (IY+o) */ -OP(fd,35) { eay(); wm(m_ea, dec(rm(m_ea))); } /* DEC (IY+o) */ -OP(fd,36) { eay(); wm(m_ea, arg()); } /* LD (IY+o),n */ +OP(fd,34) { eay(); nomreq_addr(PCD-1, 5); wm(m_ea, inc(rm_reg(m_ea))); } /* INC (IY+o) */ +OP(fd,35) { eay(); nomreq_addr(PCD-1, 5); wm(m_ea, dec(rm_reg(m_ea))); } /* DEC (IY+o) */ +OP(fd,36) { eay(); u8 a = arg(); nomreq_addr(PCD-1, 2); wm(m_ea, a); } /* LD (IY+o),n */ OP(fd,37) { illegal_1(); op_37(); } /* DB FD */ OP(fd,38) { illegal_1(); op_38(); } /* DB FD */ @@ -2328,7 +2421,7 @@ OP(fd,42) { illegal_1(); op_42(); } /* DB FD OP(fd,43) { illegal_1(); op_43(); } /* DB FD */ OP(fd,44) { B = HY; } /* LD B,HY */ OP(fd,45) { B = LY; } /* LD B,LY */ -OP(fd,46) { eay(); B = rm(m_ea); } /* LD B,(IY+o) */ +OP(fd,46) { eay(); nomreq_addr(PCD-1, 5); B = rm(m_ea); } /* LD B,(IY+o) */ OP(fd,47) { illegal_1(); op_47(); } /* DB FD */ OP(fd,48) { illegal_1(); op_48(); } /* DB FD */ @@ -2337,7 +2430,7 @@ OP(fd,4a) { illegal_1(); op_4a(); } /* DB FD OP(fd,4b) { illegal_1(); op_4b(); } /* DB FD */ OP(fd,4c) { C = HY; } /* LD C,HY */ OP(fd,4d) { C = LY; } /* LD C,LY */ -OP(fd,4e) { eay(); C = rm(m_ea); } /* LD C,(IY+o) */ +OP(fd,4e) { eay(); nomreq_addr(PCD-1, 5); C = rm(m_ea); } /* LD C,(IY+o) */ OP(fd,4f) { illegal_1(); op_4f(); } /* DB FD */ OP(fd,50) { illegal_1(); op_50(); } /* DB FD */ @@ -2346,7 +2439,7 @@ OP(fd,52) { illegal_1(); op_52(); } /* DB FD OP(fd,53) { illegal_1(); op_53(); } /* DB FD */ OP(fd,54) { D = HY; } /* LD D,HY */ OP(fd,55) { D = LY; } /* LD D,LY */ -OP(fd,56) { eay(); D = rm(m_ea); } /* LD D,(IY+o) */ +OP(fd,56) { eay(); nomreq_addr(PCD-1, 5); D = rm(m_ea); } /* LD D,(IY+o) */ OP(fd,57) { illegal_1(); op_57(); } /* DB FD */ OP(fd,58) { illegal_1(); op_58(); } /* DB FD */ @@ -2355,7 +2448,7 @@ OP(fd,5a) { illegal_1(); op_5a(); } /* DB FD OP(fd,5b) { illegal_1(); op_5b(); } /* DB FD */ OP(fd,5c) { E = HY; } /* LD E,HY */ OP(fd,5d) { E = LY; } /* LD E,LY */ -OP(fd,5e) { eay(); E = rm(m_ea); } /* LD E,(IY+o) */ +OP(fd,5e) { eay(); nomreq_addr(PCD-1, 5); E = rm(m_ea); } /* LD E,(IY+o) */ OP(fd,5f) { illegal_1(); op_5f(); } /* DB FD */ OP(fd,60) { HY = B; } /* LD HY,B */ @@ -2364,7 +2457,7 @@ OP(fd,62) { HY = D; } /* LD HY,D OP(fd,63) { HY = E; } /* LD HY,E */ OP(fd,64) { } /* LD HY,HY */ OP(fd,65) { HY = LY; } /* LD HY,LY */ -OP(fd,66) { eay(); H = rm(m_ea); } /* LD H,(IY+o) */ +OP(fd,66) { eay(); nomreq_addr(PCD-1, 5); H = rm(m_ea); } /* LD H,(IY+o) */ OP(fd,67) { HY = A; } /* LD HY,A */ OP(fd,68) { LY = B; } /* LD LY,B */ @@ -2373,17 +2466,17 @@ OP(fd,6a) { LY = D; } /* LD LY,D OP(fd,6b) { LY = E; } /* LD LY,E */ OP(fd,6c) { LY = HY; } /* LD LY,HY */ OP(fd,6d) { } /* LD LY,LY */ -OP(fd,6e) { eay(); L = rm(m_ea); } /* LD L,(IY+o) */ +OP(fd,6e) { eay(); nomreq_addr(PCD-1, 5); L = rm(m_ea); } /* LD L,(IY+o) */ OP(fd,6f) { LY = A; } /* LD LY,A */ -OP(fd,70) { eay(); wm(m_ea, B); } /* LD (IY+o),B */ -OP(fd,71) { eay(); wm(m_ea, C); } /* LD (IY+o),C */ -OP(fd,72) { eay(); wm(m_ea, D); } /* LD (IY+o),D */ -OP(fd,73) { eay(); wm(m_ea, E); } /* LD (IY+o),E */ -OP(fd,74) { eay(); wm(m_ea, H); } /* LD (IY+o),H */ -OP(fd,75) { eay(); wm(m_ea, L); } /* LD (IY+o),L */ +OP(fd,70) { eay(); nomreq_addr(PCD-1, 5); wm(m_ea, B); } /* LD (IY+o),B */ +OP(fd,71) { eay(); nomreq_addr(PCD-1, 5); wm(m_ea, C); } /* LD (IY+o),C */ +OP(fd,72) { eay(); nomreq_addr(PCD-1, 5); wm(m_ea, D); } /* LD (IY+o),D */ +OP(fd,73) { eay(); nomreq_addr(PCD-1, 5); wm(m_ea, E); } /* LD (IY+o),E */ +OP(fd,74) { eay(); nomreq_addr(PCD-1, 5); wm(m_ea, H); } /* LD (IY+o),H */ +OP(fd,75) { eay(); nomreq_addr(PCD-1, 5); wm(m_ea, L); } /* LD (IY+o),L */ OP(fd,76) { illegal_1(); op_76(); } /* DB FD */ -OP(fd,77) { eay(); wm(m_ea, A); } /* LD (IY+o),A */ +OP(fd,77) { eay(); nomreq_addr(PCD-1, 5); wm(m_ea, A); } /* LD (IY+o),A */ OP(fd,78) { illegal_1(); op_78(); } /* DB FD */ OP(fd,79) { illegal_1(); op_79(); } /* DB FD */ @@ -2391,7 +2484,7 @@ OP(fd,7a) { illegal_1(); op_7a(); } /* DB FD OP(fd,7b) { illegal_1(); op_7b(); } /* DB FD */ OP(fd,7c) { A = HY; } /* LD A,HY */ OP(fd,7d) { A = LY; } /* LD A,LY */ -OP(fd,7e) { eay(); A = rm(m_ea); } /* LD A,(IY+o) */ +OP(fd,7e) { eay(); nomreq_addr(PCD-1, 5); A = rm(m_ea); } /* LD A,(IY+o) */ OP(fd,7f) { illegal_1(); op_7f(); } /* DB FD */ OP(fd,80) { illegal_1(); op_80(); } /* DB FD */ @@ -2400,7 +2493,7 @@ OP(fd,82) { illegal_1(); op_82(); } /* DB FD OP(fd,83) { illegal_1(); op_83(); } /* DB FD */ OP(fd,84) { add_a(HY); } /* ADD A,HY */ OP(fd,85) { add_a(LY); } /* ADD A,LY */ -OP(fd,86) { eay(); add_a(rm(m_ea)); } /* ADD A,(IY+o) */ +OP(fd,86) { eay(); nomreq_addr(PCD-1, 5); add_a(rm(m_ea)); } /* ADD A,(IY+o) */ OP(fd,87) { illegal_1(); op_87(); } /* DB FD */ OP(fd,88) { illegal_1(); op_88(); } /* DB FD */ @@ -2409,7 +2502,7 @@ OP(fd,8a) { illegal_1(); op_8a(); } /* DB FD OP(fd,8b) { illegal_1(); op_8b(); } /* DB FD */ OP(fd,8c) { adc_a(HY); } /* ADC A,HY */ OP(fd,8d) { adc_a(LY); } /* ADC A,LY */ -OP(fd,8e) { eay(); adc_a(rm(m_ea)); } /* ADC A,(IY+o) */ +OP(fd,8e) { eay(); nomreq_addr(PCD-1, 5); adc_a(rm(m_ea)); } /* ADC A,(IY+o) */ OP(fd,8f) { illegal_1(); op_8f(); } /* DB FD */ OP(fd,90) { illegal_1(); op_90(); } /* DB FD */ @@ -2418,7 +2511,7 @@ OP(fd,92) { illegal_1(); op_92(); } /* DB FD OP(fd,93) { illegal_1(); op_93(); } /* DB FD */ OP(fd,94) { sub(HY); } /* SUB HY */ OP(fd,95) { sub(LY); } /* SUB LY */ -OP(fd,96) { eay(); sub(rm(m_ea)); } /* SUB (IY+o) */ +OP(fd,96) { eay(); nomreq_addr(PCD-1, 5); sub(rm(m_ea)); } /* SUB (IY+o) */ OP(fd,97) { illegal_1(); op_97(); } /* DB FD */ OP(fd,98) { illegal_1(); op_98(); } /* DB FD */ @@ -2427,7 +2520,7 @@ OP(fd,9a) { illegal_1(); op_9a(); } /* DB FD OP(fd,9b) { illegal_1(); op_9b(); } /* DB FD */ OP(fd,9c) { sbc_a(HY); } /* SBC A,HY */ OP(fd,9d) { sbc_a(LY); } /* SBC A,LY */ -OP(fd,9e) { eay(); sbc_a(rm(m_ea)); } /* SBC A,(IY+o) */ +OP(fd,9e) { eay(); nomreq_addr(PCD-1, 5); sbc_a(rm(m_ea)); } /* SBC A,(IY+o) */ OP(fd,9f) { illegal_1(); op_9f(); } /* DB FD */ OP(fd,a0) { illegal_1(); op_a0(); } /* DB FD */ @@ -2436,7 +2529,7 @@ OP(fd,a2) { illegal_1(); op_a2(); } /* DB FD OP(fd,a3) { illegal_1(); op_a3(); } /* DB FD */ OP(fd,a4) { and_a(HY); } /* AND HY */ OP(fd,a5) { and_a(LY); } /* AND LY */ -OP(fd,a6) { eay(); and_a(rm(m_ea)); } /* AND (IY+o) */ +OP(fd,a6) { eay(); nomreq_addr(PCD-1, 5); and_a(rm(m_ea)); } /* AND (IY+o) */ OP(fd,a7) { illegal_1(); op_a7(); } /* DB FD */ OP(fd,a8) { illegal_1(); op_a8(); } /* DB FD */ @@ -2445,7 +2538,7 @@ OP(fd,aa) { illegal_1(); op_aa(); } /* DB FD OP(fd,ab) { illegal_1(); op_ab(); } /* DB FD */ OP(fd,ac) { xor_a(HY); } /* XOR HY */ OP(fd,ad) { xor_a(LY); } /* XOR LY */ -OP(fd,ae) { eay(); xor_a(rm(m_ea)); } /* XOR (IY+o) */ +OP(fd,ae) { eay(); nomreq_addr(PCD-1, 5); xor_a(rm(m_ea)); } /* XOR (IY+o) */ OP(fd,af) { illegal_1(); op_af(); } /* DB FD */ OP(fd,b0) { illegal_1(); op_b0(); } /* DB FD */ @@ -2454,7 +2547,7 @@ OP(fd,b2) { illegal_1(); op_b2(); } /* DB FD OP(fd,b3) { illegal_1(); op_b3(); } /* DB FD */ OP(fd,b4) { or_a(HY); } /* OR HY */ OP(fd,b5) { or_a(LY); } /* OR LY */ -OP(fd,b6) { eay(); or_a(rm(m_ea)); } /* OR (IY+o) */ +OP(fd,b6) { eay(); nomreq_addr(PCD-1, 5); or_a(rm(m_ea)); } /* OR (IY+o) */ OP(fd,b7) { illegal_1(); op_b7(); } /* DB FD */ OP(fd,b8) { illegal_1(); op_b8(); } /* DB FD */ @@ -2463,7 +2556,7 @@ OP(fd,ba) { illegal_1(); op_ba(); } /* DB FD OP(fd,bb) { illegal_1(); op_bb(); } /* DB FD */ OP(fd,bc) { cp(HY); } /* CP HY */ OP(fd,bd) { cp(LY); } /* CP LY */ -OP(fd,be) { eay(); cp(rm(m_ea)); } /* CP (IY+o) */ +OP(fd,be) { eay(); nomreq_addr(PCD-1, 5); cp(rm(m_ea)); } /* CP (IY+o) */ OP(fd,bf) { illegal_1(); op_bf(); } /* DB FD */ OP(fd,c0) { illegal_1(); op_c0(); } /* DB FD */ @@ -2478,7 +2571,7 @@ OP(fd,c7) { illegal_1(); op_c7(); } /* DB FD OP(fd,c8) { illegal_1(); op_c8(); } /* DB FD */ OP(fd,c9) { illegal_1(); op_c9(); } /* DB FD */ OP(fd,ca) { illegal_1(); op_ca(); } /* DB FD */ -OP(fd,cb) { eay(); EXEC(xycb,arg()); } /* ** FD CB xx */ +OP(fd,cb) { eay(); u8 a = arg(); nomreq_addr(PCD-1, 2); EXEC(xycb, a); } /* ** FD CB xx */ OP(fd,cc) { illegal_1(); op_cc(); } /* DB FD */ OP(fd,cd) { illegal_1(); op_cd(); } /* DB FD */ OP(fd,ce) { illegal_1(); op_ce(); } /* DB FD */ @@ -2530,7 +2623,7 @@ OP(fd,f6) { illegal_1(); op_f6(); } /* DB FD OP(fd,f7) { illegal_1(); op_f7(); } /* DB FD */ OP(fd,f8) { illegal_1(); op_f8(); } /* DB FD */ -OP(fd,f9) { SP = IY; } /* LD SP,IY */ +OP(fd,f9) { nomreq_ir(2); SP = IY; } /* LD SP,IY */ OP(fd,fa) { illegal_1(); op_fa(); } /* DB FD */ OP(fd,fb) { illegal_1(); op_fb(); } /* DB FD */ OP(fd,fc) { illegal_1(); op_fc(); } /* DB FD */ @@ -2673,7 +2766,7 @@ OP(ed,6d) { reti(); } /* RETI OP(ed,6e) { m_im = 0; } /* IM 0 */ OP(ed,6f) { rld(); } /* RLD (HL) */ -OP(ed,70) { uint8_t res = in(BC); F = (F & CF) | SZP[res]; } /* IN 0,(C) */ +OP(ed,70) { uint8_t res = in(BC); F = (F & CF) | SZP[res]; } /* IN 0,(C) */ OP(ed,71) { out(BC, 0); } /* OUT (C),0 */ OP(ed,72) { sbc_hl(m_sp); } /* SBC HL,SP */ OP(ed,73) { m_ea = arg16(); wm16(m_ea, m_sp); WZ = m_ea + 1; } /* LD (w),SP */ @@ -2842,34 +2935,34 @@ OP(ed,ff) { illegal_2(); } /* DB ED OP(op,00) { } /* NOP */ OP(op,01) { BC = arg16(); } /* LD BC,w */ OP(op,02) { wm(BC,A); WZ_L = (BC + 1) & 0xFF; WZ_H = A; } /* LD (BC),A */ -OP(op,03) { BC++; } /* INC BC */ +OP(op,03) { nomreq_ir(2); BC++; } /* INC BC */ OP(op,04) { B = inc(B); } /* INC B */ OP(op,05) { B = dec(B); } /* DEC B */ OP(op,06) { B = arg(); } /* LD B,n */ OP(op,07) { rlca(); } /* RLCA */ OP(op,08) { ex_af(); } /* EX AF,AF' */ -OP(op,09) { add16(m_hl, m_bc); } /* ADD HL,BC */ +OP(op,09) { add16(m_hl, m_bc); } /* ADD HL,BC */ OP(op,0a) { A = rm(BC); WZ=BC+1; } /* LD A,(BC) */ -OP(op,0b) { BC--; } /* DEC BC */ +OP(op,0b) { nomreq_ir(2); BC--; } /* DEC BC */ OP(op,0c) { C = inc(C); } /* INC C */ OP(op,0d) { C = dec(C); } /* DEC C */ OP(op,0e) { C = arg(); } /* LD C,n */ OP(op,0f) { rrca(); } /* RRCA */ -OP(op,10) { B--; jr_cond(B, 0x10); } /* DJNZ o */ +OP(op,10) { nomreq_ir(1); B--; jr_cond(B, 0x10); } /* DJNZ o */ OP(op,11) { DE = arg16(); } /* LD DE,w */ OP(op,12) { wm(DE,A); WZ_L = (DE + 1) & 0xFF; WZ_H = A; } /* LD (DE),A */ -OP(op,13) { DE++; } /* INC DE */ +OP(op,13) { nomreq_ir(2); DE++; } /* INC DE */ OP(op,14) { D = inc(D); } /* INC D */ OP(op,15) { D = dec(D); } /* DEC D */ OP(op,16) { D = arg(); } /* LD D,n */ OP(op,17) { rla(); } /* RLA */ OP(op,18) { jr(); } /* JR o */ -OP(op,19) { add16(m_hl, m_de); } /* ADD HL,DE */ +OP(op,19) { add16(m_hl, m_de); } /* ADD HL,DE */ OP(op,1a) { A = rm(DE); WZ = DE + 1; } /* LD A,(DE) */ -OP(op,1b) { DE--; } /* DEC DE */ +OP(op,1b) { nomreq_ir(2); DE--; } /* DEC DE */ OP(op,1c) { E = inc(E); } /* INC E */ OP(op,1d) { E = dec(E); } /* DEC E */ OP(op,1e) { E = arg(); } /* LD E,n */ @@ -2878,16 +2971,16 @@ OP(op,1f) { rra(); OP(op,20) { jr_cond(!(F & ZF), 0x20); } /* JR NZ,o */ OP(op,21) { HL = arg16(); } /* LD HL,w */ OP(op,22) { m_ea = arg16(); wm16(m_ea, m_hl); WZ = m_ea + 1; } /* LD (w),HL */ -OP(op,23) { HL++; } /* INC HL */ +OP(op,23) { nomreq_ir(2); HL++; } /* INC HL */ OP(op,24) { H = inc(H); } /* INC H */ OP(op,25) { H = dec(H); } /* DEC H */ OP(op,26) { H = arg(); } /* LD H,n */ OP(op,27) { daa(); } /* DAA */ OP(op,28) { jr_cond(F & ZF, 0x28); } /* JR Z,o */ -OP(op,29) { add16(m_hl, m_hl); } /* ADD HL,HL */ -OP(op,2a) { m_ea = arg16(); rm16(m_ea, m_hl); WZ = m_ea+1; } /* LD HL,(w) */ -OP(op,2b) { HL--; } /* DEC HL */ +OP(op,29) { add16(m_hl, m_hl); } /* ADD HL,HL */ +OP(op,2a) { m_ea = arg16(); rm16(m_ea, m_hl); WZ = m_ea + 1; } /* LD HL,(w) */ +OP(op,2b) { nomreq_ir(2); HL--; } /* DEC HL */ OP(op,2c) { L = inc(L); } /* INC L */ OP(op,2d) { L = dec(L); } /* DEC L */ OP(op,2e) { L = arg(); } /* LD L,n */ @@ -2896,16 +2989,16 @@ OP(op,2f) { A ^= 0xff; F = (F & (SF | ZF | PF | CF)) | HF | NF | (A & (YF | XF)) OP(op,30) { jr_cond(!(F & CF), 0x30); } /* JR NC,o */ OP(op,31) { SP = arg16(); } /* LD SP,w */ OP(op,32) { m_ea = arg16(); wm(m_ea, A); WZ_L = (m_ea + 1) & 0xFF; WZ_H = A; } /* LD (w),A */ -OP(op,33) { SP++; } /* INC SP */ -OP(op,34) { wm(HL, inc(rm(HL))); } /* INC (HL) */ -OP(op,35) { wm(HL, dec(rm(HL))); } /* DEC (HL) */ +OP(op,33) { nomreq_ir(2); SP++; } /* INC SP */ +OP(op,34) { wm(HL, inc(rm_reg(HL))); } /* INC (HL) */ +OP(op,35) { wm(HL, dec(rm_reg(HL))); } /* DEC (HL) */ OP(op,36) { wm(HL, arg()); } /* LD (HL),n */ OP(op,37) { F = (F & (SF | ZF | YF | XF | PF)) | CF | (A & (YF | XF)); } /* SCF */ OP(op,38) { jr_cond(F & CF, 0x38); } /* JR C,o */ OP(op,39) { add16(m_hl, m_sp); } /* ADD HL,SP */ OP(op,3a) { m_ea = arg16(); A = rm(m_ea); WZ = m_ea + 1; } /* LD A,(w) */ -OP(op,3b) { SP--; } /* DEC SP */ +OP(op,3b) { nomreq_ir(2); SP--; } /* DEC SP */ OP(op,3c) { A = inc(A); } /* INC A */ OP(op,3d) { A = dec(A); } /* DEC A */ OP(op,3e) { A = arg(); } /* LD A,n */ @@ -3067,7 +3160,7 @@ OP(op,c7) { rst(0x00); OP(op,c8) { ret_cond(F & ZF, 0xc8); } /* RET Z */ OP(op,c9) { pop(m_pc); WZ = PCD; } /* RET */ OP(op,ca) { jp_cond(F & ZF); } /* JP Z,a */ -OP(op,cb) { m_r++; EXEC(cb,rop()); } /* **** CB xx */ +OP(op,cb) { EXEC(cb, rop()); } /* **** CB xx */ OP(op,cc) { call_cond(F & ZF, 0xcc); } /* CALL Z,a */ OP(op,cd) { call(); } /* CALL a */ OP(op,ce) { adc_a(arg()); } /* ADC A,n */ @@ -3087,7 +3180,7 @@ OP(op,d9) { exx(); OP(op,da) { jp_cond(F & CF); } /* JP C,a */ OP(op,db) { unsigned n = arg() | (A << 8); A = in(n); WZ = n + 1; } /* IN A,(n) */ OP(op,dc) { call_cond(F & CF, 0xdc); } /* CALL C,a */ -OP(op,dd) { m_r++; EXEC(dd,rop()); } /* **** DD xx */ +OP(op,dd) { EXEC(dd, rop()); } /* **** DD xx */ OP(op,de) { sbc_a(arg()); } /* SBC A,n */ OP(op,df) { rst(0x18); } /* RST 3 */ @@ -3105,7 +3198,7 @@ OP(op,e9) { PC = HL; OP(op,ea) { jp_cond(F & PF); } /* JP PE,a */ OP(op,eb) { ex_de_hl(); } /* EX DE,HL */ OP(op,ec) { call_cond(F & PF, 0xec); } /* CALL PE,a */ -OP(op,ed) { m_r++; EXEC(ed,rop()); } /* **** ED xx */ +OP(op,ed) { EXEC(ed, rop()); } /* **** ED xx */ OP(op,ee) { xor_a(arg()); } /* XOR n */ OP(op,ef) { rst(0x28); } /* RST 5 */ @@ -3119,11 +3212,11 @@ OP(op,f6) { or_a(arg()); OP(op,f7) { rst(0x30); } /* RST 6 */ OP(op,f8) { ret_cond(F & SF, 0xf8); } /* RET M */ -OP(op,f9) { SP = HL; } /* LD SP,HL */ +OP(op,f9) { nomreq_ir(2); SP = HL; } /* LD SP,HL */ OP(op,fa) { jp_cond(F & SF); } /* JP M,a */ OP(op,fb) { ei(); } /* EI */ OP(op,fc) { call_cond(F & SF, 0xfc); } /* CALL M,a */ -OP(op,fd) { m_r++; EXEC(fd,rop()); } /* **** FD xx */ +OP(op,fd) { EXEC(fd, rop()); } /* **** FD xx */ OP(op,fe) { cp(arg()); } /* CP n */ OP(op,ff) { rst(0x38); } /* RST 7 */ @@ -3139,10 +3232,13 @@ void z80_device::take_nmi() #endif m_iff1 = 0; - push(m_pc); + m_r++; + + m_icount_executing = 11; + T(m_icount_executing - MTM * 2); + wm16_sp(m_pc); PCD = 0x0066; WZ=PCD; - m_icount -= 11; m_nmi_pending = false; } @@ -3155,35 +3251,46 @@ void z80_device::take_interrupt() m_iff1 = m_iff2 = 0; // say hi + // Not precise in all cases. z80 must finish current instruction (NOP) to reach this state - in such case frame timings are shifter from cb event if calulated based on it. m_irqack_cb(true); + m_r++; // fetch the IRQ vector device_z80daisy_interface *intf = daisy_get_irq_device(); int irq_vector = (intf != nullptr) ? intf->z80daisy_irq_ack() : standard_irq_callback_member(*this, 0); LOG(("Z80 single int. irq_vector $%02x\n", irq_vector)); + /* 'interrupt latency' cycles */ + m_icount_executing = 0; + CC(ex, 0xff); // 2 + T(m_icount_executing); + /* Interrupt mode 2. Call [i:databyte] */ if( m_im == 2 ) { // Zilog's datasheet claims that "the least-significant bit must be a zero." // However, experiments have confirmed that IM 2 vectors do not have to be // even, and all 8 bits will be used; even $FF is handled normally. + /* CALL opcode timing */ + CC(op, 0xcd); // 17+2=19 + T(m_icount_executing - MTM * 4); + m_icount_executing -= MTM * 2; // save for rm16 + wm16_sp(m_pc); + m_icount_executing += MTM * 2; irq_vector = (irq_vector & 0xff) | (m_i << 8); - push(m_pc); rm16(irq_vector, m_pc); LOG(("Z80 IM2 [$%04x] = $%04x\n", irq_vector, PCD)); - /* CALL opcode timing + 'interrupt latency' cycles */ - m_icount -= m_cc_op[0xcd] + m_cc_ex[0xff]; } else /* Interrupt mode 1. RST 38h */ if( m_im == 1 ) { LOG(("Z80 '%s' IM1 $0038\n", tag())); - push(m_pc); + /* RST $38 */ + CC(op, 0xff); // 11+2=13 + T(m_icount_executing - MTM * 2); + wm16_sp(m_pc); PCD = 0x0038; - /* RST $38 + 'interrupt latency' cycles */ - m_icount -= m_cc_op[0xff] + cc_ex[0xff]; } else { @@ -3198,27 +3305,27 @@ void z80_device::take_interrupt() switch (irq_vector & 0xff0000) { case 0xcd0000: /* call */ - push(m_pc); + /* CALL $xxxx cycles */ + CC(op, 0xcd); + T(m_icount_executing - MTM * 2); + wm16_sp(m_pc); PCD = irq_vector & 0xffff; - /* CALL $xxxx cycles */ - m_icount -= m_cc_op[0xcd]; break; case 0xc30000: /* jump */ - PCD = irq_vector & 0xffff; /* JP $xxxx cycles */ - m_icount -= m_cc_op[0xc3]; + CC(op, 0xc3); + T(m_icount_executing); + PCD = irq_vector & 0xffff; break; default: /* rst (or other opcodes?) */ - push(m_pc); - PCD = irq_vector & 0x0038; /* RST $xx cycles */ - m_icount -= m_cc_op[0xff]; + CC(op, 0xff); + T(m_icount_executing - MTM * 2); + wm16_sp(m_pc); + PCD = irq_vector & 0x0038; break; } } - - /* 'interrupt latency' cycles */ - m_icount -= m_cc_ex[0xff]; } WZ=PCD; @@ -3228,6 +3335,20 @@ void z80_device::take_interrupt() #endif } +void z80_device::nomreq_ir(s8 cycles) +{ + nomreq_addr((m_i << 8) | (m_r2 & 0x80) | (m_r & 0x7f), cycles); +} + +void z80_device::nomreq_addr(u16 addr, s8 cycles) +{ + for (; cycles; cycles--) + { + m_nomreq_cb(addr, 0x00, 0xff); + T(1); + } +} + void nsc800_device::take_interrupt_nsc800() { /* Check if processor was halted */ @@ -3236,24 +3357,28 @@ void nsc800_device::take_interrupt_nsc800() /* Clear both interrupt flip flops */ m_iff1 = m_iff2 = 0; + /* 'interrupt latency' cycles */ + m_icount_executing = 0; + CC(op, 0xff); + CC(ex, 0xff); //2 + + T(m_icount_executing - MTM * 2); if (m_nsc800_irq_state[NSC800_RSTA]) { - push(m_pc); + wm16_sp(m_pc); PCD = 0x003c; } else if (m_nsc800_irq_state[NSC800_RSTB]) { - push(m_pc); + wm16_sp(m_pc); PCD = 0x0034; } else if (m_nsc800_irq_state[NSC800_RSTC]) { - push(m_pc); + wm16_sp(m_pc); PCD = 0x002c; } - - /* 'interrupt latency' cycles */ - m_icount -= m_cc_op[0xff] + cc_ex[0xff]; + T(m_icount_executing); WZ=PCD; @@ -3443,6 +3568,7 @@ void z80_device::device_start() // set our instruction counter set_icountptr(m_icount); + m_icount_executing = 0; /* setup cycle tables */ m_cc_op = cc_op; @@ -3454,6 +3580,7 @@ void z80_device::device_start() m_irqack_cb.resolve_safe(); m_refresh_cb.resolve_safe(); + m_nomreq_cb.resolve_safe(); m_halt_cb.resolve_safe(); } @@ -3506,6 +3633,7 @@ void z80_device::execute_run() // check for interrupts before each instruction check_interrupts(); + m_icount_executing = 0; m_after_ei = false; m_after_ldair = false; @@ -3513,7 +3641,6 @@ void z80_device::execute_run() PRVPC = PCD; debugger_instruction_hook(PCD); - m_r++; uint8_t opcode = rop(); // when in HALT state, the fetched opcode is not dispatched (aka a NOP) @@ -3550,6 +3677,7 @@ void z80_device::execute_set_input(int inputnum, int state) break; case INPUT_LINE_IRQ0: + if(state && !m_irq_state) m_irq_at = total_cycles() + m_icount; /* update the IRQ state via the daisy chain */ m_irq_state = state; if (daisy_chain_present()) @@ -3698,6 +3826,7 @@ z80_device::z80_device(const machine_config &mconfig, device_type type, const ch m_io_config("io", ENDIANNESS_LITTLE, 8, 16, 0), m_irqack_cb(*this), m_refresh_cb(*this), + m_nomreq_cb(*this), m_halt_cb(*this) { } diff --git a/src/devices/cpu/z80/z80.h b/src/devices/cpu/z80/z80.h index 8e82ccd3353..43aaf8a6d36 100644 --- a/src/devices/cpu/z80/z80.h +++ b/src/devices/cpu/z80/z80.h @@ -32,12 +32,14 @@ class z80_device : public cpu_device, public z80_daisy_chain_interface public: z80_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + int cycles_from_irq() { return total_cycles() - m_irq_at; } void z80_set_cycle_tables(const uint8_t *op, const uint8_t *cb, const uint8_t *ed, const uint8_t *xy, const uint8_t *xycb, const uint8_t *ex); template <typename... T> void set_memory_map(T &&... args) { set_addrmap(AS_PROGRAM, std::forward<T>(args)...); } template <typename... T> void set_m1_map(T &&... args) { set_addrmap(AS_OPCODES, std::forward<T>(args)...); } template <typename... T> void set_io_map(T &&... args) { set_addrmap(AS_IO, std::forward<T>(args)...); } auto irqack_cb() { return m_irqack_cb.bind(); } auto refresh_cb() { return m_refresh_cb.bind(); } + auto nomreq_cb() { return m_nomreq_cb.bind(); } auto halt_cb() { return m_halt_cb.bind(); } protected: @@ -149,9 +151,11 @@ protected: uint8_t in(uint16_t port); void out(uint16_t port, uint8_t value); virtual uint8_t rm(uint16_t addr); + uint8_t rm_reg(uint16_t addr); void rm16(uint16_t addr, PAIR &r); virtual void wm(uint16_t addr, uint8_t value); void wm16(uint16_t addr, PAIR &r); + void wm16_sp(PAIR &r); virtual uint8_t rop(); virtual uint8_t arg(); virtual uint16_t arg16(); @@ -232,6 +236,8 @@ protected: virtual void check_interrupts(); void take_interrupt(); void take_nmi(); + void nomreq_ir(s8 cycles); + void nomreq_addr(u16 addr, s8 cycles); // address spaces const address_space_config m_program_config; @@ -244,22 +250,23 @@ protected: devcb_write_line m_irqack_cb; devcb_write8 m_refresh_cb; + devcb_write8 m_nomreq_cb; devcb_write_line m_halt_cb; - PAIR m_prvpc; - PAIR m_pc; - PAIR m_sp; - PAIR m_af; - PAIR m_bc; - PAIR m_de; - PAIR m_hl; - PAIR m_ix; - PAIR m_iy; - PAIR m_wz; - PAIR m_af2; - PAIR m_bc2; - PAIR m_de2; - PAIR m_hl2; + PAIR m_prvpc; + PAIR m_pc; + PAIR m_sp; + PAIR m_af; + PAIR m_bc; + PAIR m_de; + PAIR m_hl; + PAIR m_ix; + PAIR m_iy; + PAIR m_wz; + PAIR m_af2; + PAIR m_bc2; + PAIR m_de2; + PAIR m_hl2; uint8_t m_r; uint8_t m_r2; uint8_t m_iff1; @@ -270,13 +277,15 @@ protected: uint8_t m_nmi_state; /* nmi line state */ uint8_t m_nmi_pending; /* nmi pending */ uint8_t m_irq_state; /* irq line state */ - int m_wait_state; // wait line state - int m_busrq_state; // bus request line state + int m_wait_state; // wait line state + int m_busrq_state; // bus request line state uint8_t m_after_ei; /* are we in the EI shadow? */ uint8_t m_after_ldair; /* same, but for LD A,I or LD A,R */ uint32_t m_ea; - int m_icount; + int m_irq_at; + int m_icount; + int m_icount_executing; uint8_t m_rtemp; const uint8_t * m_cc_op; const uint8_t * m_cc_cb; diff --git a/src/devices/imagedev/floppy.cpp b/src/devices/imagedev/floppy.cpp index c1782e3c021..a550a1e8f1b 100644 --- a/src/devices/imagedev/floppy.cpp +++ b/src/devices/imagedev/floppy.cpp @@ -530,7 +530,7 @@ void floppy_image_device::device_timer(emu_timer &timer, device_timer_id id, int index_resync(); } -const floppy_image_format_t *floppy_image_device::identify(std::string filename) +const floppy_image_format_t *floppy_image_device::identify(std::string_view filename) { util::core_file::ptr fd; std::string revised_path; diff --git a/src/devices/imagedev/floppy.h b/src/devices/imagedev/floppy.h index de755fba4ec..b9ff120e200 100644 --- a/src/devices/imagedev/floppy.h +++ b/src/devices/imagedev/floppy.h @@ -82,7 +82,7 @@ public: const std::vector<const floppy_image_format_t *> &get_formats() const; const std::vector<fs_info> &get_fs() const { return m_fs; } const floppy_image_format_t *get_load_format() const; - const floppy_image_format_t *identify(std::string filename); + const floppy_image_format_t *identify(std::string_view filename); void set_rpm(float rpm); void init_fs(const fs_info *fs, const fs::meta_data &meta); diff --git a/src/devices/machine/acorn_bmu.cpp b/src/devices/machine/acorn_bmu.cpp index 3ff529525ff..96e0759f200 100644 --- a/src/devices/machine/acorn_bmu.cpp +++ b/src/devices/machine/acorn_bmu.cpp @@ -96,57 +96,60 @@ WRITE_LINE_MEMBER(acorn_bmu_device::scl_w) { if (m_scl) { - switch (m_state) + m_bits++; + } + else + { + if (m_bits == 8) { - case STATE_DEVSEL: - m_devsel = m_shift; - - if ((m_devsel & 0xfe) != m_slave_address) + switch (m_state) { - LOGMASKED(LOG_DATA, "devsel %02x: not this device\n", m_devsel); - m_state = STATE_IDLE; - } - else if ((m_devsel & 1) == 0) - { - LOGMASKED(LOG_DATA, "devsel %02x: write\n", m_devsel); - m_state = STATE_REGISTER; - } - else - { - LOGMASKED(LOG_DATA, "devsel %02x: read\n", m_devsel); - m_state = STATE_DATAOUT; - } - break; + case STATE_DEVSEL: + m_devsel = m_shift; + + if ((m_devsel & 0xfe) != m_slave_address) + { + LOGMASKED(LOG_DATA, "devsel %02x: not this device\n", m_devsel); + m_state = STATE_IDLE; + } + else if ((m_devsel & 1) == 0) + { + LOGMASKED(LOG_DATA, "devsel %02x: write\n", m_devsel); + m_state = STATE_REGISTER; + } + else + { + LOGMASKED(LOG_DATA, "devsel %02x: read\n", m_devsel); + m_state = STATE_READSELACK; + } + break; - case STATE_REGISTER: - m_register = m_shift; + case STATE_REGISTER: + m_register = m_shift; - LOGMASKED(LOG_DATA, "register %02x\n", m_register); + LOGMASKED(LOG_DATA, "register %02x\n", m_register); - m_state = STATE_DATAIN; - break; + m_state = STATE_DATAIN; + break; - case STATE_DATAIN: - LOGMASKED(LOG_DATA, "register[ %02x ] <- %02x\n", m_register, m_shift); + case STATE_DATAIN: + LOGMASKED(LOG_DATA, "register[ %02x ] <- %02x\n", m_register, m_shift); - switch (m_register) - { - case BMU_CHARGE_ESTIMATE: - m_estimate = m_shift; + switch (m_register) + { + case BMU_CHARGE_ESTIMATE: + m_estimate = m_shift; + break; + } + + m_register++; break; } - - m_register++; - break; - } - - m_bits++; - } - else - { - if (m_bits == 8) - { - m_sdar = 0; + + if( m_state != STATE_IDLE ) + { + m_sdar = 0 ; + } } else { @@ -157,11 +160,20 @@ WRITE_LINE_MEMBER(acorn_bmu_device::scl_w) } break; + case STATE_READSELACK: + m_bits = 0; + m_state = STATE_DATAOUT; + break; + case STATE_DATAOUT: if (m_bits < 8) { if (m_scl) { + m_bits++; + } + else + { if (m_bits == 0) { switch (m_register) @@ -194,7 +206,6 @@ WRITE_LINE_MEMBER(acorn_bmu_device::scl_w) m_sdar = (m_shift >> 7) & 1; m_shift = (m_shift << 1) & 0xff; - m_bits++; } } else @@ -207,18 +218,11 @@ WRITE_LINE_MEMBER(acorn_bmu_device::scl_w) m_state = STATE_IDLE; } - m_bits++; + m_bits = 0; } else { - if (m_bits == 8) - { - m_sdar = 1; - } - else - { - m_bits = 0; - } + m_sdar = 1; } } break; diff --git a/src/devices/machine/acorn_bmu.h b/src/devices/machine/acorn_bmu.h index 56c6c32a3df..52ff13db040 100644 --- a/src/devices/machine/acorn_bmu.h +++ b/src/devices/machine/acorn_bmu.h @@ -45,7 +45,7 @@ private: int m_devsel; int m_register; - enum { STATE_IDLE, STATE_DEVSEL, STATE_REGISTER, STATE_DATAIN, STATE_DATAOUT }; + enum { STATE_IDLE, STATE_DEVSEL, STATE_REGISTER, STATE_DATAIN, STATE_DATAOUT, STATE_READSELACK }; // registers enum diff --git a/src/devices/machine/i2cmem.cpp b/src/devices/machine/i2cmem.cpp index e21d8c6b6ee..8b6358eceac 100644 --- a/src/devices/machine/i2cmem.cpp +++ b/src/devices/machine/i2cmem.cpp @@ -30,8 +30,9 @@ constexpr int STATE_DEVSEL(1); constexpr int STATE_ADDRESSHIGH(2); constexpr int STATE_ADDRESSLOW(3); constexpr int STATE_DATAIN(4); -constexpr int STATE_DATAOUT(5); -constexpr int STATE_RESET(6); +constexpr int STATE_READSELACK(5); +constexpr int STATE_DATAOUT(6); +constexpr int STATE_RESET(7); constexpr int DEVSEL_RW(1); constexpr int DEVSEL_ADDRESS(0xfe); @@ -368,110 +369,112 @@ WRITE_LINE_MEMBER( i2cmem_device::write_scl ) { if( m_scl ) { - switch( m_state ) + m_bits++; + } + else + { + if( m_bits == 8 ) { - case STATE_DEVSEL: - m_devsel = m_shift; - - if( m_devsel == 0 && !m_devsel_address_low ) - { - // TODO: Atmel datasheets document 2-wire software reset, but doesn't mention it will lower sda only that it will release it. - // ltv_naru however requires it to be lowered, but we don't currently know the manufacturer of the chip used. - verboselog( this, 1, "software reset\n" ); - m_state = STATE_RESET; - m_sdar = 0; - } - else if( !select_device() ) + switch( m_state ) { - verboselog( this, 1, "devsel %02x: not this device\n", m_devsel ); - m_state = STATE_IDLE; - } - else if( ( m_devsel & DEVSEL_RW ) == 0 ) - { - if (m_devsel_address_low) + case STATE_DEVSEL: + m_devsel = m_shift; + + if( m_devsel == 0 && !m_devsel_address_low ) { - verboselog( this, 1, "devsel %02x: write (Xicor special, address %02x)\n", m_devsel, m_devsel >> 1); - m_byteaddr = (m_devsel & DEVSEL_ADDRESS) >> 1; - m_page_offset = 0; - m_page_written_size = 0; - m_state = STATE_DATAIN; + // TODO: Atmel datasheets document 2-wire software reset, but doesn't mention it will lower sda only that it will release it. + // ltv_naru however requires it to be lowered, but we don't currently know the manufacturer of the chip used. + verboselog( this, 1, "software reset\n" ); + m_state = STATE_RESET; } - else + else if( !select_device() ) { - verboselog( this, 1, "devsel %02x: write\n", m_devsel ); - m_state = skip_addresshigh() ? STATE_ADDRESSLOW : STATE_ADDRESSHIGH; + verboselog( this, 1, "devsel %02x: not this device\n", m_devsel ); + m_state = STATE_IDLE; } - } - else - { - if (m_devsel_address_low) + else if( ( m_devsel & DEVSEL_RW ) == 0 ) { - verboselog( this, 1, "devsel %02x: read (Xicor special, address %02x)\n", m_devsel, m_devsel >> 1); - m_byteaddr = (m_devsel & DEVSEL_ADDRESS) >> 1; + if (m_devsel_address_low) + { + verboselog( this, 1, "devsel %02x: write (Xicor special, address %02x)\n", m_devsel, m_devsel >> 1); + m_byteaddr = (m_devsel & DEVSEL_ADDRESS) >> 1; + m_page_offset = 0; + m_page_written_size = 0; + m_state = STATE_DATAIN; + } + else + { + verboselog( this, 1, "devsel %02x: write\n", m_devsel ); + m_state = skip_addresshigh() ? STATE_ADDRESSLOW : STATE_ADDRESSHIGH; + } } else { - verboselog( this, 1, "devsel %02x: read\n", m_devsel ); + if (m_devsel_address_low) + { + verboselog( this, 1, "devsel %02x: read (Xicor special, address %02x)\n", m_devsel, m_devsel >> 1); + m_byteaddr = (m_devsel & DEVSEL_ADDRESS) >> 1; + } + else + { + verboselog( this, 1, "devsel %02x: read\n", m_devsel ); + } + m_state = STATE_READSELACK; } - m_state = STATE_DATAOUT; - } - break; + break; - case STATE_ADDRESSHIGH: - m_addresshigh = m_shift; + case STATE_ADDRESSHIGH: + m_addresshigh = m_shift; - verboselog(this, 1, "addresshigh %02x\n", m_addresshigh); + verboselog(this, 1, "addresshigh %02x\n", m_addresshigh); - m_state = STATE_ADDRESSLOW; - break; + m_state = STATE_ADDRESSLOW; + break; - case STATE_ADDRESSLOW: - m_byteaddr = m_shift | (skip_addresshigh() ? ((m_devsel & DEVSEL_ADDRESS) << 7) & address_mask() : m_addresshigh << 8); - m_page_offset = 0; - m_page_written_size = 0; + case STATE_ADDRESSLOW: + m_byteaddr = m_shift | (skip_addresshigh() ? ((m_devsel & DEVSEL_ADDRESS) << 7) & address_mask() : m_addresshigh << 8); + m_page_offset = 0; + m_page_written_size = 0; - verboselog( this, 1, "addresslow %02x (byteaddr %04x)\n", m_shift, m_byteaddr ); + verboselog( this, 1, "addresslow %02x (byteaddr %04x)\n", m_shift, m_byteaddr ); - m_state = STATE_DATAIN; - break; + m_state = STATE_DATAIN; + break; - case STATE_DATAIN: - if( m_wc ) - { - verboselog( this, 0, "write not enabled\n" ); - m_state = STATE_IDLE; - } - else if( m_write_page_size > 0 ) - { - m_page[ m_page_offset ] = m_shift; - verboselog( this, 1, "page[ %04x ] <- %02x\n", m_page_offset, m_page[ m_page_offset ] ); - - m_page_offset++; - if( m_page_offset == m_write_page_size ) - m_page_offset = 0; - m_page_written_size++; - if( m_page_written_size > m_write_page_size) - m_page_written_size = m_write_page_size; - } - else - { - int offset = data_offset(); + case STATE_DATAIN: + if( m_wc ) + { + verboselog( this, 0, "write not enabled\n" ); + m_state = STATE_IDLE; + } + else if( m_write_page_size > 0 ) + { + m_page[ m_page_offset ] = m_shift; + verboselog( this, 1, "page[ %04x ] <- %02x\n", m_page_offset, m_page[ m_page_offset ] ); + + m_page_offset++; + if( m_page_offset == m_write_page_size ) + m_page_offset = 0; + m_page_written_size++; + if( m_page_written_size > m_write_page_size) + m_page_written_size = m_write_page_size; + } + else + { + int offset = data_offset(); - verboselog( this, 1, "data[ %04x ] <- %02x\n", offset, m_shift ); - m_data[ offset ] = m_shift; + verboselog( this, 1, "data[ %04x ] <- %02x\n", offset, m_shift ); + m_data[ offset ] = m_shift; - m_byteaddr++; + m_byteaddr++; + } + break; + } + + if( m_state != STATE_IDLE ) + { + m_sdar = 0 ; } - break; - } - - m_bits++; - } - else - { - if( m_bits == 8 ) - { - m_sdar = 0; } else { @@ -482,11 +485,20 @@ WRITE_LINE_MEMBER( i2cmem_device::write_scl ) } break; + case STATE_READSELACK: + m_bits = 0; + m_state = STATE_DATAOUT; + break; + case STATE_DATAOUT: if( m_bits < 8 ) { if( m_scl ) { + m_bits++; + } + else + { if( m_bits == 0 ) { int offset = data_offset(); @@ -499,7 +511,6 @@ WRITE_LINE_MEMBER( i2cmem_device::write_scl ) m_sdar = ( m_shift >> 7 ) & 1; m_shift = ( m_shift << 1 ) & 0xff; - m_bits++; } } else @@ -512,18 +523,11 @@ WRITE_LINE_MEMBER( i2cmem_device::write_scl ) m_state = STATE_IDLE; } - m_bits++; + m_bits = 0; } else { - if( m_bits == 8 ) - { - m_sdar = 1; - } - else - { - m_bits = 0; - } + m_sdar = 1; } } break; @@ -531,9 +535,13 @@ WRITE_LINE_MEMBER( i2cmem_device::write_scl ) case STATE_RESET: if( m_scl ) { - verboselog(this, 1, "software reset ack\n"); - m_state = STATE_IDLE; - m_sdar = 1; + if( m_bits > 8 ) + { + verboselog(this, 1, "software reset ack\n"); + m_state = STATE_IDLE; + m_sdar = 1; + } + m_bits++; } break; } @@ -555,7 +563,6 @@ WRITE_LINE_MEMBER( i2cmem_device::write_wc ) READ_LINE_MEMBER( i2cmem_device::read_sda ) { int res = m_sdar & 1; - verboselog( this, 2, "read sda %d\n", res ); return res; diff --git a/src/devices/machine/pcf8573.cpp b/src/devices/machine/pcf8573.cpp index e7b8d514373..133fa5a5d7b 100644 --- a/src/devices/machine/pcf8573.cpp +++ b/src/devices/machine/pcf8573.cpp @@ -167,91 +167,94 @@ WRITE_LINE_MEMBER(pcf8573_device::scl_w) { if (m_scl) { - switch (m_state) + m_bits++; + } + else + { + if (m_bits == 8) { - case STATE_ADDRESS: - m_devsel = m_shift; - - if ((m_devsel & 0xfe) != m_slave_address) - { - LOGMASKED(LOG_DATA, "address %02x: not this device\n", m_devsel); - m_state = STATE_IDLE; - } - else if ((m_devsel & 1) == 0) + switch (m_state) { - LOGMASKED(LOG_DATA, "address %02x: write\n", m_devsel); - m_state = STATE_MODE; - } - else - { - LOGMASKED(LOG_DATA, "address %02x: read\n", m_devsel); - m_state = STATE_DATAOUT; - } - break; + case STATE_ADDRESS: + m_devsel = m_shift; - case STATE_MODE: - m_mode_pointer = m_shift; + if ((m_devsel & 0xfe) != m_slave_address) + { + LOGMASKED(LOG_DATA, "address %02x: not this device\n", m_devsel); + m_state = STATE_IDLE; + } + else if ((m_devsel & 1) == 0) + { + LOGMASKED(LOG_DATA, "address %02x: write\n", m_devsel); + m_state = STATE_MODE; + } + else + { + LOGMASKED(LOG_DATA, "address %02x: read\n", m_devsel); + m_state = STATE_READSELACK; + } + break; - LOGMASKED(LOG_DATA, "mode pointer %02x\n", m_shift); + case STATE_MODE: + m_mode_pointer = m_shift; - switch (m_mode_pointer & 0x70) - { - case 0x00: // execute address - m_address = m_mode_pointer & 0x07; - break; - case 0x10: // read control/status flags - break; - case 0x20: // reset prescaler - set_clock_register(RTC_SECOND, 0); - adjust_seconds(); - break; - case 0x30: // time adjust - adjust_seconds(); - break; - case 0x40: // reset NODA flag - m_status &= ~(1 << 2); - break; - case 0x50: // set NODA flag - m_status |= 1 << 2; - break; - case 0x60: // reset COMP flag - m_status &= ~(1 << 1); - m_comp_cb(0); + LOGMASKED(LOG_DATA, "mode pointer %02x\n", m_shift); + + switch (m_mode_pointer & 0x70) + { + case 0x00: // execute address + m_address = m_mode_pointer & 0x07; + break; + case 0x10: // read control/status flags + break; + case 0x20: // reset prescaler + set_clock_register(RTC_SECOND, 0); + adjust_seconds(); + break; + case 0x30: // time adjust + adjust_seconds(); + break; + case 0x40: // reset NODA flag + m_status &= ~(1 << 2); + break; + case 0x50: // set NODA flag + m_status |= 1 << 2; + break; + case 0x60: // reset COMP flag + m_status &= ~(1 << 1); + m_comp_cb(0); + break; + } + + m_state = STATE_DATAIN; break; - } - m_state = STATE_DATAIN; - break; + case STATE_DATAIN: + switch (m_mode_pointer & 0x70) + { + case 0x00: // execute address + m_data[m_address] = m_shift; - case STATE_DATAIN: - switch (m_mode_pointer & 0x70) - { - case 0x00: // execute address - m_data[m_address] = m_shift; + LOGMASKED(LOG_DATA, "data[ %02x ] <- %02x\n", m_address, m_shift); - LOGMASKED(LOG_DATA, "data[ %02x ] <- %02x\n", m_address, m_shift); + switch (m_address) + { + case REG_HOURS: set_clock_register(RTC_HOUR, bcd_to_integer(m_data[REG_HOURS])); break; + case REG_MINUTES: set_clock_register(RTC_MINUTE, bcd_to_integer(m_data[REG_MINUTES])); break; + case REG_DAYS: set_clock_register(RTC_DAY, bcd_to_integer(m_data[REG_DAYS])); break; + case REG_MONTHS: set_clock_register(RTC_MONTH, bcd_to_integer(m_data[REG_MONTHS])); break; + } - switch (m_address) - { - case REG_HOURS: set_clock_register(RTC_HOUR, bcd_to_integer(m_data[REG_HOURS])); break; - case REG_MINUTES: set_clock_register(RTC_MINUTE, bcd_to_integer(m_data[REG_MINUTES])); break; - case REG_DAYS: set_clock_register(RTC_DAY, bcd_to_integer(m_data[REG_DAYS])); break; - case REG_MONTHS: set_clock_register(RTC_MONTH, bcd_to_integer(m_data[REG_MONTHS])); break; + m_address = (m_address & 0x04) | ((m_address + 1) & 0x03); + break; } - - m_address = (m_address & 0x04) | ((m_address + 1) & 0x03); break; } - break; - } - - m_bits++; - } - else - { - if (m_bits == 8) - { - m_sdar = 0; + + if( m_state != STATE_IDLE ) + { + m_sdar = 0 ; + } } else { @@ -262,11 +265,20 @@ WRITE_LINE_MEMBER(pcf8573_device::scl_w) } break; + case STATE_READSELACK: + m_bits = 0; + m_state = STATE_DATAOUT; + break; + case STATE_DATAOUT: if (m_bits < 8) { if (m_scl) { + m_bits++; + } + else + { if (m_bits == 0) { switch (m_mode_pointer & 0x70) @@ -287,7 +299,6 @@ WRITE_LINE_MEMBER(pcf8573_device::scl_w) m_sdar = (m_shift >> 7) & 1; m_shift = (m_shift << 1) & 0xff; - m_bits++; } } else @@ -300,18 +311,11 @@ WRITE_LINE_MEMBER(pcf8573_device::scl_w) m_state = STATE_IDLE; } - m_bits++; + m_bits = 0; } else { - if (m_bits == 8) - { - m_sdar = 1; - } - else - { - m_bits = 0; - } + m_sdar = 1; } } break; diff --git a/src/devices/machine/pcf8573.h b/src/devices/machine/pcf8573.h index 63d0da0502e..d5b3bc5283e 100644 --- a/src/devices/machine/pcf8573.h +++ b/src/devices/machine/pcf8573.h @@ -117,7 +117,7 @@ private: int m_address; int m_status; - enum { STATE_IDLE, STATE_ADDRESS, STATE_MODE, STATE_DATAIN, STATE_DATAOUT }; + enum { STATE_IDLE, STATE_ADDRESS, STATE_MODE, STATE_DATAIN, STATE_DATAOUT, STATE_READSELACK }; }; // device type definition diff --git a/src/devices/machine/pcf8583.cpp b/src/devices/machine/pcf8583.cpp index ebad0d9e90e..4e5a81085d3 100644 --- a/src/devices/machine/pcf8583.cpp +++ b/src/devices/machine/pcf8583.cpp @@ -242,80 +242,83 @@ WRITE_LINE_MEMBER(pcf8583_device::scl_w) { if (m_scl) { - switch (m_state) + m_bits++; + } + else + { + if( m_bits == 8 ) { - case STATE_DEVSEL: - m_devsel = m_shift; - - if ((m_devsel & 0xfe) != m_slave_address) - { - LOGMASKED(LOG_DATA, "devsel %02x: not this device\n", m_devsel); - m_state = STATE_IDLE; - } - else if ((m_devsel & 1) == 0) - { - LOGMASKED(LOG_DATA, "devsel %02x: write\n", m_devsel); - m_state = STATE_REGISTER; - } - else + switch (m_state) { - LOGMASKED(LOG_DATA, "devsel %02x: read\n", m_devsel); - m_state = STATE_DATAOUT; - } - break; - - case STATE_REGISTER: - m_register = m_shift; - - LOGMASKED(LOG_DATA, "register %02x\n", m_register); - - m_state = STATE_DATAIN; - break; + case STATE_DEVSEL: + m_devsel = m_shift; + + if ((m_devsel & 0xfe) != m_slave_address) + { + LOGMASKED(LOG_DATA, "devsel %02x: not this device\n", m_devsel); + m_state = STATE_IDLE; + } + else if ((m_devsel & 1) == 0) + { + LOGMASKED(LOG_DATA, "devsel %02x: write\n", m_devsel); + m_state = STATE_REGISTER; + } + else + { + LOGMASKED(LOG_DATA, "devsel %02x: read\n", m_devsel); + m_state = STATE_READSELACK; + } + break; - case STATE_DATAIN: - LOGMASKED(LOG_DATA, "data[ %02x ] <- %02x\n", m_register, m_shift); + case STATE_REGISTER: + m_register = m_shift; - m_data[m_register] = m_shift; + LOGMASKED(LOG_DATA, "register %02x\n", m_register); - switch (m_register) - { - case REG_CONTROL: - if ((m_shift & 0x24) == 0x04) - logerror("Timer not implemented"); - break; - case REG_SECONDS: - set_clock_register(RTC_SECOND, bcd_to_integer(m_data[REG_SECONDS])); - break; - case REG_MINUTES: - set_clock_register(RTC_MINUTE, bcd_to_integer(m_data[REG_MINUTES])); + m_state = STATE_DATAIN; break; - case REG_HOURS: - set_clock_register(RTC_HOUR, bcd_to_integer(m_data[REG_HOURS])); - break; - case REG_YEAR_DATE: - set_clock_register(RTC_DAY, bcd_to_integer(m_data[REG_YEAR_DATE] & 0x3f)); - set_clock_register(RTC_YEAR, bcd_to_integer(m_data[REG_YEAR_DATE] >> 6)); - break; - case REG_MONTH_DAY: - set_clock_register(RTC_MONTH, bcd_to_integer(m_data[REG_MONTH_DAY] & 0x1f)); - set_clock_register(RTC_DAY_OF_WEEK, bcd_to_integer((m_data[REG_MONTH_DAY] >> 5) + 1)); - break; - case REG_ALARM_CONTROL: - m_irq_cb(m_data[REG_ALARM_CONTROL] & 0x88 ? 1 : 0); + + case STATE_DATAIN: + LOGMASKED(LOG_DATA, "data[ %02x ] <- %02x\n", m_register, m_shift); + + m_data[m_register] = m_shift; + + switch (m_register) + { + case REG_CONTROL: + if ((m_shift & 0x24) == 0x04) + logerror("Timer not implemented"); + break; + case REG_SECONDS: + set_clock_register(RTC_SECOND, bcd_to_integer(m_data[REG_SECONDS])); + break; + case REG_MINUTES: + set_clock_register(RTC_MINUTE, bcd_to_integer(m_data[REG_MINUTES])); + break; + case REG_HOURS: + set_clock_register(RTC_HOUR, bcd_to_integer(m_data[REG_HOURS])); + break; + case REG_YEAR_DATE: + set_clock_register(RTC_DAY, bcd_to_integer(m_data[REG_YEAR_DATE] & 0x3f)); + set_clock_register(RTC_YEAR, bcd_to_integer(m_data[REG_YEAR_DATE] >> 6)); + break; + case REG_MONTH_DAY: + set_clock_register(RTC_MONTH, bcd_to_integer(m_data[REG_MONTH_DAY] & 0x1f)); + set_clock_register(RTC_DAY_OF_WEEK, bcd_to_integer((m_data[REG_MONTH_DAY] >> 5) + 1)); + break; + case REG_ALARM_CONTROL: + m_irq_cb(m_data[REG_ALARM_CONTROL] & 0x88 ? 1 : 0); + break; + } + + m_register++; break; } - - m_register++; - break; - } - - m_bits++; - } - else - { - if (m_bits == 8) - { - m_sdar = 0; + + if (m_state != STATE_IDLE) + { + m_sdar = 0 ; + } } else { @@ -326,11 +329,20 @@ WRITE_LINE_MEMBER(pcf8583_device::scl_w) } break; + case STATE_READSELACK: + m_bits = 0; + m_state = STATE_DATAOUT; + break; + case STATE_DATAOUT: if (m_bits < 8) { if (m_scl) { + m_bits++; + } + else + { if (m_bits == 0) { m_shift = m_data[m_register]; @@ -354,7 +366,6 @@ WRITE_LINE_MEMBER(pcf8583_device::scl_w) m_sdar = (m_shift >> 7) & 1; m_shift = (m_shift << 1) & 0xff; - m_bits++; } } else @@ -367,18 +378,11 @@ WRITE_LINE_MEMBER(pcf8583_device::scl_w) m_state = STATE_IDLE; } - m_bits++; + m_bits = 0; } else { - if (m_bits == 8) - { - m_sdar = 1; - } - else - { - m_bits = 0; - } + m_sdar = 1; } } break; diff --git a/src/devices/machine/pcf8583.h b/src/devices/machine/pcf8583.h index 0a2b45696b7..900ea145c10 100644 --- a/src/devices/machine/pcf8583.h +++ b/src/devices/machine/pcf8583.h @@ -166,7 +166,7 @@ private: bool m_irq; emu_timer * m_timer; - enum { STATE_IDLE, STATE_DEVSEL, STATE_REGISTER, STATE_DATAIN, STATE_DATAOUT }; + enum { STATE_IDLE, STATE_DEVSEL, STATE_REGISTER, STATE_DATAIN, STATE_DATAOUT, STATE_READSELACK }; }; // device type definition diff --git a/src/devices/machine/swtpc8212.cpp b/src/devices/machine/swtpc8212.cpp index 68d433e1186..92a084b2880 100644 --- a/src/devices/machine/swtpc8212.cpp +++ b/src/devices/machine/swtpc8212.cpp @@ -456,7 +456,7 @@ INPUT_PORTS_START(swtpc8212) PORT_BIT(0x8000U, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("+ / CR") PORT_CHANGED_MEMBER(DEVICE_SELF, swtpc8212_device, keypad_changed, 0) PORT_START("DIP_SWITCHES") - PORT_DIPNAME(0x1f, 0x19, "Baud Rate") PORT_DIPLOCATION("DIP:4,3,2,1,0") + PORT_DIPNAME(0x1f, 0x19, "Baud Rate") PORT_DIPLOCATION("DIP:5,4,3,2,1") PORT_DIPSETTING(0x04, "110") PORT_DIPSETTING(0x0a, "300") PORT_DIPSETTING(0x0d, "600") @@ -467,13 +467,13 @@ INPUT_PORTS_START(swtpc8212) PORT_DIPSETTING(0x19, "9600") PORT_DIPSETTING(0x1c, "19200") PORT_DIPSETTING(0x1f, "38400") - PORT_DIPNAME(0x20, 0x00, "Mode switch") PORT_DIPLOCATION("DIP:5") + PORT_DIPNAME(0x20, 0x00, "Mode switch") PORT_DIPLOCATION("DIP:6") PORT_DIPSETTING(0x00, "Conversational") PORT_DIPSETTING(0x20, "Page edit") - PORT_DIPNAME(0x40, 0x00, "No Parity") PORT_DIPLOCATION("DIP:6") + PORT_DIPNAME(0x40, 0x00, "No Parity") PORT_DIPLOCATION("DIP:7") PORT_DIPSETTING(0x00, "No Parity") PORT_DIPSETTING(0x40, "Parity") - PORT_DIPNAME(0x80, 0x00, "Parity Select") PORT_DIPLOCATION("DIP:7") + PORT_DIPNAME(0x80, 0x00, "Parity Select") PORT_DIPLOCATION("DIP:8") PORT_DIPSETTING(0x00, "Odd or Mark") PORT_DIPSETTING(0x80, "Even or Space") diff --git a/src/devices/sound/upd7759.cpp b/src/devices/sound/upd7759.cpp index cbd6bca0f83..1e9a98b8a3d 100644 --- a/src/devices/sound/upd7759.cpp +++ b/src/devices/sound/upd7759.cpp @@ -126,9 +126,14 @@ #include "upd7759.h" -#define DEBUG_STATES (0) +#define MASK_LOG_STATE (1U << 1) +#define MASK_LOG_DRQ (1U << 2) +//#define VERBOSE (MASK_LOG_STATE|MASK_LOG_DRQ) +#include "logmacro.h" +#define LOG_STATE(...) LOGMASKED(MASK_LOG_STATE, __VA_ARGS__) +#define LOG_DRQ(...) LOGMASKED(MASK_LOG_DRQ, __VA_ARGS__) /************************************************************ @@ -136,7 +141,7 @@ *************************************************************/ -/* step value fractional bits */ +// step value fractional bits #define FRAC_BITS 20 #define FRAC_ONE (1 << FRAC_BITS) #define FRAC_MASK (FRAC_ONE - 1) @@ -168,6 +173,7 @@ upd775x_device::upd775x_device(const machine_config &mconfig, device_type type, , m_offset(0) , m_repeat_offset(0) , m_start_delay(0) + , m_mode(MODE_STAND_ALONE) , m_adpcm_state(0) , m_adpcm_data(0) , m_sample(0) @@ -209,13 +215,10 @@ upd7756_device::upd7756_device(const machine_config &mconfig, device_type type, void upd775x_device::device_start() { - // allocate a stream channel m_channel = stream_alloc(0, 1, clock()/4); - // compute the stepping rate based on the chip's clock speed m_step = 4 * FRAC_ONE; - // compute the clock period m_clock_period = clock() ? attotime::from_hz(clock()) : attotime::zero; save_item(NAME(m_pos)); @@ -243,6 +246,8 @@ void upd775x_device::device_start() save_item(NAME(m_adpcm_state)); save_item(NAME(m_adpcm_data)); save_item(NAME(m_sample)); + save_item(NAME(m_mode)); + save_item(NAME(m_md)); } void upd775x_device::device_clock_changed() @@ -261,14 +266,12 @@ void upd7759_device::device_start() { upd775x_device::device_start(); - // chip configuration m_sample_offset_shift = 1; m_timer = timer_alloc(TID_SLAVE_UPDATE); m_drqcallback.resolve_safe(); - // toggle the reset line to finish the reset device_reset(); } @@ -277,7 +280,6 @@ void upd7756_device::device_start() { upd775x_device::device_start(); - // toggle the reset line to finish the reset device_reset(); } @@ -288,7 +290,7 @@ void upd7756_device::device_start() void upd775x_device::device_reset() { m_pos = 0; - //m_fifo_in = 0; // this seems keeping state when /RESET line asserted (test case: konmedal.cpp games) + //m_fifo_in = 0; // this seems to keep state when /RESET line asserted (test case: konmedal.cpp games) m_state = STATE_IDLE; m_clocks_left = 0; m_nibbles_left = 0; @@ -305,13 +307,13 @@ void upd775x_device::device_reset() m_adpcm_state = 0; m_adpcm_data = 0; m_sample = 0; + m_mode = MODE_STAND_ALONE; } void upd7759_device::device_reset() { upd775x_device::device_reset(); - // turn off any timer m_timer->adjust(attotime::never); if (m_drq) @@ -365,11 +367,9 @@ static const int upd775x_state_table[16] = { -1, -1, 0, 0, 1, 2, 2, 3, -1, -1, 0 void upd775x_device::update_adpcm(int data) { - /* update the sample and the state */ m_sample += upd775x_step[m_adpcm_state][data]; m_adpcm_state += upd775x_state_table[data]; - /* clamp the state to 0..15 */ if (m_adpcm_state < 0) m_adpcm_state = 0; else if (m_adpcm_state > 15) @@ -388,12 +388,14 @@ void upd775x_device::advance_state() { switch (m_state) { - /* Idle state: we stick around here while there's nothing to do */ + // Idle state: we stick around here while there's nothing to do case STATE_IDLE: + // If we have dropped back to idle state we always switch back to stand alone mode + m_mode = MODE_STAND_ALONE; m_clocks_left = 4; break; - /* drop DRQ state: update to the intended state */ + // drop DRQ state: update to the intended state case STATE_DROP_DRQ: m_drq = 0; @@ -401,10 +403,10 @@ void upd775x_device::advance_state() m_state = m_post_drq_state; break; - /* Start state: we begin here as soon as a sample is triggered */ + // Start state: we begin here as soon as a sample is triggered case STATE_START: - m_req_sample = m_md ? m_fifo_in : 0x10; - if (DEBUG_STATES) logerror("req_sample = %02X\n", m_req_sample); + m_req_sample = (m_mode == MODE_STAND_ALONE) ? m_fifo_in : 0x10; + LOG_STATE("req_sample = %02X\n", m_req_sample); /* 35+ cycles after we get here, the /DRQ goes low * (first byte (number of samples in ROM) should be sent in response) @@ -413,17 +415,16 @@ void upd775x_device::advance_state() * Depending on the state the chip was in just before the /MD was set to 0 (reset, standby * or just-finished-playing-previous-sample) this number can range from 35 up to ~24000). * It also varies slightly from test to test, but not much - a few cycles at most.) */ - m_clocks_left = 70 + m_start_delay; /* 35 - breaks cotton */ + m_clocks_left = 70 + m_start_delay; m_state = STATE_FIRST_REQ; break; /* First request state: issue a request for the first byte */ /* The expected response will be the index of the last sample */ case STATE_FIRST_REQ: - if (DEBUG_STATES) logerror("first data request\n"); + LOG_STATE("first data request\n"); m_drq = 1; - /* 44 cycles later, we will latch this value and request another byte */ m_clocks_left = 44; m_state = STATE_LAST_SAMPLE; break; @@ -431,22 +432,20 @@ void upd775x_device::advance_state() /* Last sample state: latch the last sample value and issue a request for the second byte */ /* The second byte read will be just a dummy */ case STATE_LAST_SAMPLE: - m_last_sample = m_md ? read_byte(0) : m_fifo_in; - if (DEBUG_STATES) logerror("last_sample = %02X, requesting dummy 1\n", m_last_sample); + m_last_sample = (m_mode == MODE_STAND_ALONE) ? read_byte(0) : m_fifo_in; + LOG_STATE("last_sample = %02X, requesting dummy 1\n", m_last_sample); m_drq = 1; - /* 28 cycles later, we will latch this value and request another byte */ - m_clocks_left = 28; /* 28 - breaks cotton */ + m_clocks_left = 28; m_state = (m_req_sample > m_last_sample) ? STATE_IDLE : STATE_DUMMY1; break; /* First dummy state: ignore any data here and issue a request for the third byte */ /* The expected response will be the MSB of the sample address */ case STATE_DUMMY1: - if (DEBUG_STATES) logerror("dummy1, requesting offset_hi\n"); + LOG_STATE("dummy1, requesting offset_hi\n"); m_drq = 1; - /* 32 cycles later, we will latch this value and request another byte */ m_clocks_left = 32; m_state = STATE_ADDR_MSB; break; @@ -454,11 +453,10 @@ void upd775x_device::advance_state() /* Address MSB state: latch the MSB of the sample address and issue a request for the fourth byte */ /* The expected response will be the LSB of the sample address */ case STATE_ADDR_MSB: - m_offset = (m_md ? read_byte(m_req_sample * 2 + 5) : m_fifo_in) << (8 + m_sample_offset_shift); - if (DEBUG_STATES) logerror("offset_hi = %02X, requesting offset_lo\n", m_offset >> (8 + m_sample_offset_shift)); + m_offset = ((m_mode == MODE_STAND_ALONE) ? read_byte(m_req_sample * 2 + 5) : m_fifo_in) << (8 + m_sample_offset_shift); + LOG_STATE("offset_hi = %02X, requesting offset_lo\n", m_offset >> (8 + m_sample_offset_shift)); m_drq = 1; - /* 44 cycles later, we will latch this value and request another byte */ m_clocks_left = 44; m_state = STATE_ADDR_LSB; break; @@ -466,11 +464,10 @@ void upd775x_device::advance_state() /* Address LSB state: latch the LSB of the sample address and issue a request for the fifth byte */ /* The expected response will be just a dummy */ case STATE_ADDR_LSB: - m_offset |= (m_md ? read_byte(m_req_sample * 2 + 6) : m_fifo_in) << m_sample_offset_shift; - if (DEBUG_STATES) logerror("offset_lo = %02X, requesting dummy 2\n", (m_offset >> m_sample_offset_shift) & 0xff); + m_offset |= ((m_mode == MODE_STAND_ALONE) ? read_byte(m_req_sample * 2 + 6) : m_fifo_in) << m_sample_offset_shift; + LOG_STATE("offset_lo = %02X, requesting dummy 2\n", (m_offset >> m_sample_offset_shift) & 0xff); m_drq = 1; - /* 36 cycles later, we will latch this value and request another byte */ m_clocks_left = 36; m_state = STATE_DUMMY2; break; @@ -480,59 +477,55 @@ void upd775x_device::advance_state() case STATE_DUMMY2: m_offset++; m_first_valid_header = 0; - if (DEBUG_STATES) logerror("dummy2, requesting block header\n"); + LOG_STATE("dummy2, requesting block header\n"); m_drq = 1; - /* 36?? cycles later, we will latch this value and request another byte */ m_clocks_left = 36; m_state = STATE_BLOCK_HEADER; break; - /* Block header state: latch the header and issue a request for the first byte afterwards */ + // Block header state: latch the header and issue a request for the first byte afterwards case STATE_BLOCK_HEADER: - /* if we're in a repeat loop, reset the offset to the repeat point and decrement the count */ if (m_repeat_count) { m_repeat_count--; m_offset = m_repeat_offset; } - m_block_header = m_md ? read_byte(m_offset++) : m_fifo_in; - if (DEBUG_STATES) logerror("header (@%05X) = %02X, requesting next byte\n", m_offset, m_block_header); + m_block_header = (m_mode == MODE_STAND_ALONE) ? read_byte(m_offset++) : m_fifo_in; + LOG_STATE("header (@%05X) = %02X, requesting next byte\n", m_offset, m_block_header); m_drq = 1; - /* our next step depends on the top two bits */ switch (m_block_header & 0xc0) { - case 0x00: /* silence */ + case 0x00: // silence m_clocks_left = 1024 * ((m_block_header & 0x3f) + 1); m_state = (m_block_header == 0 && m_first_valid_header) ? STATE_IDLE : STATE_BLOCK_HEADER; m_sample = 0; m_adpcm_state = 0; break; - case 0x40: /* 256 nibbles */ + case 0x40: // 256 nibbles m_sample_rate = (m_block_header & 0x3f) + 1; m_nibbles_left = 256; - m_clocks_left = 36; /* just a guess */ + m_clocks_left = 36; // just a guess m_state = STATE_NIBBLE_MSN; break; - case 0x80: /* n nibbles */ + case 0x80: // n nibbles m_sample_rate = (m_block_header & 0x3f) + 1; - m_clocks_left = 36; /* just a guess */ + m_clocks_left = 36; // just a guess m_state = STATE_NIBBLE_COUNT; break; - case 0xc0: /* repeat loop */ + case 0xc0: // repeat loop m_repeat_count = (m_block_header & 7) + 1; m_repeat_offset = m_offset; - m_clocks_left = 36; /* just a guess */ + m_clocks_left = 36; // just a guess m_state = STATE_BLOCK_HEADER; break; } - /* set a flag when we get the first non-zero header */ if (m_block_header != 0) m_first_valid_header = 1; break; @@ -540,23 +533,21 @@ void upd775x_device::advance_state() /* Nibble count state: latch the number of nibbles to play and request another byte */ /* The expected response will be the first data byte */ case STATE_NIBBLE_COUNT: - m_nibbles_left = (m_md ? read_byte(m_offset++) : m_fifo_in) + 1; - if (DEBUG_STATES) logerror("nibble_count = %u, requesting next byte\n", (unsigned)m_nibbles_left); + m_nibbles_left = ((m_mode == MODE_STAND_ALONE) ? read_byte(m_offset++) : m_fifo_in) + 1; + LOG_STATE("nibble_count = %u, requesting next byte\n", (unsigned)m_nibbles_left); m_drq = 1; - /* 36?? cycles later, we will latch this value and request another byte */ - m_clocks_left = 36; /* just a guess */ + m_clocks_left = 36; // just a guess m_state = STATE_NIBBLE_MSN; break; /* MSN state: latch the data for this pair of samples and request another byte */ /* The expected response will be the next sample data or another header */ case STATE_NIBBLE_MSN: - m_adpcm_data = m_md ? read_byte(m_offset++) : m_fifo_in; + m_adpcm_data = (m_mode == MODE_STAND_ALONE) ? read_byte(m_offset++) : m_fifo_in; update_adpcm(m_adpcm_data >> 4); m_drq = 1; - /* we stay in this state until the time for this sample is complete */ m_clocks_left = m_sample_rate * 4; if (--m_nibbles_left == 0) m_state = STATE_BLOCK_HEADER; @@ -564,11 +555,10 @@ void upd775x_device::advance_state() m_state = STATE_NIBBLE_LSN; break; - /* LSN state: process the lower nibble */ + // LSN state: process the lower nibble case STATE_NIBBLE_LSN: update_adpcm(m_adpcm_data & 15); - /* we stay in this state until the time for this sample is complete */ m_clocks_left = m_sample_rate * 4; if (--m_nibbles_left == 0) m_state = STATE_BLOCK_HEADER; @@ -577,7 +567,6 @@ void upd775x_device::advance_state() break; } - /* if there's a DRQ, fudge the state */ if (m_drq) { m_post_drq_state = m_state; @@ -596,6 +585,7 @@ void upd775x_device::advance_state() void upd7759_device::device_timer(emu_timer &timer, device_timer_id id, int param) { uint8_t olddrq = m_drq; + int old_state = m_state; switch (id) { @@ -611,21 +601,23 @@ void upd7759_device::device_timer(emu_timer &timer, device_timer_id id, int para internal_start_w(param); break; + case TID_MD_WRITE: + internal_md_w(param); + break; + case TID_SLAVE_UPDATE: - /* update the stream */ m_channel->update(); - /* advance the state */ advance_state(); - /* if the DRQ changed, update it */ - if (DEBUG_STATES) - logerror("upd7759_slave_update: DRQ %d->%d\n", olddrq, m_drq); + LOG_STATE("upd7759_slave_update: DRQ %d->%d\n", olddrq, m_drq); if (olddrq != m_drq) + { + LOG_DRQ("DRQ changed %d->%d\n", olddrq, m_drq); m_drqcallback(m_drq); + } - /* set a timer to go off when that is done */ - if (m_state != STATE_IDLE) + if (m_state != STATE_IDLE || old_state != STATE_IDLE) m_timer->adjust(m_clock_period * m_clocks_left); break; @@ -647,18 +639,31 @@ WRITE_LINE_MEMBER( upd775x_device::reset_w ) void upd775x_device::internal_reset_w(int state) { - /* update the reset value */ uint8_t oldreset = m_reset; m_reset = (state != 0); - /* update the stream first */ m_channel->update(); - /* on the falling edge, reset everything */ if (oldreset && !m_reset) device_reset(); } +void upd7759_device::internal_reset_w(int state) +{ + uint8_t oldreset = m_reset; + upd775x_device::internal_reset_w(state); + + if (!oldreset && m_reset) + { + if (!m_md) + { + m_mode = MODE_SLAVE; + m_state = STATE_START; + m_timer->adjust(attotime::zero); + } + } +} + WRITE_LINE_MEMBER( upd775x_device::start_w ) { synchronize(TID_START_WRITE, state); @@ -666,23 +671,18 @@ WRITE_LINE_MEMBER( upd775x_device::start_w ) void upd7759_device::internal_start_w(int state) { - /* update the start value */ uint8_t oldstart = m_start; m_start = (state != 0); - if (DEBUG_STATES) - logerror("upd7759_start_w: %d->%d\n", oldstart, m_start); + LOG_STATE("upd7759_start_w: %d->%d\n", oldstart, m_start); - /* update the stream first */ m_channel->update(); - /* on the rising edge, if we're idle, start going, but not if we're held in reset */ - if (m_state == STATE_IDLE && !oldstart && m_start && m_reset) + if (m_state == STATE_IDLE && oldstart && !m_start && m_reset) { m_state = STATE_START; - /* for slave mode, start the timer going */ - if (!m_md) + if (m_mode == MODE_SLAVE) m_timer->adjust(attotime::zero); } } @@ -690,37 +690,61 @@ void upd7759_device::internal_start_w(int state) void upd7756_device::internal_start_w(int state) { - /* update the start value */ uint8_t oldstart = m_start; m_start = (state != 0); - if (DEBUG_STATES) - logerror("upd7759_start_w: %d->%d\n", oldstart, m_start); + LOG_STATE("upd7759_start_w: %d->%d\n", oldstart, m_start); + + m_channel->update(); + + if (m_state == STATE_IDLE && oldstart && !m_start && m_reset) + { + m_state = STATE_START; + } +} + + +WRITE_LINE_MEMBER(upd7759_device::md_w) +{ + // When called from machine configs/during start up set the mode pin directly. + if (m_timer == nullptr) + { + m_md = state; + return; + } + synchronize(TID_MD_WRITE, state); +} + + +void upd7759_device::internal_md_w(int state) +{ + uint8_t old_md = m_md; + m_md = (state != 0); + + LOG_STATE("upd7759_md_w: %d->%d\n", old_md, m_md); - /* update the stream first */ m_channel->update(); - /* on the rising edge, if we're idle, start going, but not if we're held in reset */ - if (m_state == STATE_IDLE && !oldstart && m_start && m_reset) + if (m_state == STATE_IDLE && old_md && !m_md && m_reset) { + m_mode = MODE_SLAVE; m_state = STATE_START; + m_timer->adjust(attotime::zero); } } void upd775x_device::port_w(u8 data) { - /* update the FIFO value */ synchronize(TID_PORT_WRITE, data); } READ_LINE_MEMBER( upd775x_device::busy_r ) { - /* update the stream first */ m_channel->update(); - /* return /BUSY */ + // return /BUSY return (m_state == STATE_IDLE); } @@ -737,48 +761,39 @@ void upd775x_device::sound_stream_update(sound_stream &stream, std::vector<read_ uint32_t step = m_step; uint32_t pos = m_pos; - /* loop until done */ u32 index = 0; if (m_state != STATE_IDLE) for ( ; index < outputs[0].samples(); index++) { - /* store the current sample */ outputs[0].put(index, sample); - /* advance by the number of clocks/output sample */ pos += step; - /* handle clocks, but only in standalone mode */ - while (m_md && pos >= FRAC_ONE) + while ((m_mode == MODE_STAND_ALONE) && pos >= FRAC_ONE) { int clocks_this_time = pos >> FRAC_BITS; if (clocks_this_time > clocks_left) clocks_this_time = clocks_left; - /* clock once */ pos -= clocks_this_time * FRAC_ONE; clocks_left -= clocks_this_time; - /* if we're out of clocks, time to handle the next state */ if (clocks_left == 0) { - /* advance one state; if we hit idle, bail */ advance_state(); if (m_state == STATE_IDLE) break; - /* reimport the variables that we cached */ clocks_left = m_clocks_left; sample = stream_buffer::sample_t(m_sample) * sample_scale; } } } - /* if we got out early, just zap the rest of the buffer */ + // if we got out early, just zap the rest of the buffer for (; index < outputs[0].samples(); index++) outputs[0].put(index, 0); - /* flush the state back */ m_clocks_left = clocks_left; m_pos = pos; } diff --git a/src/devices/sound/upd7759.h b/src/devices/sound/upd7759.h index 5508e8d92bb..23f24ad1ae5 100644 --- a/src/devices/sound/upd7759.h +++ b/src/devices/sound/upd7759.h @@ -11,8 +11,6 @@ /* There are two modes for the uPD7759, selected through the !MD pin. This is the mode select input. High is stand alone, low is slave. - We're making the assumption that nobody switches modes through - software. */ class upd775x_device : public device_t, @@ -37,7 +35,8 @@ protected: TID_PORT_WRITE, TID_START_WRITE, TID_RESET_WRITE, - TID_SLAVE_UPDATE + TID_SLAVE_UPDATE, + TID_MD_WRITE }; // chip states @@ -57,6 +56,12 @@ protected: STATE_NIBBLE_MSN, STATE_NIBBLE_LSN }; + // chip modes + enum + { + MODE_STAND_ALONE, + MODE_SLAVE + }; upd775x_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); @@ -74,45 +79,46 @@ protected: virtual void advance_state(); // internal state - sound_stream *m_channel; /* stream channel for playback */ - - /* chip configuration */ - uint8_t m_sample_offset_shift; /* header sample address shift (access data > 0xffff) */ - - /* internal clock to output sample rate mapping */ - uint32_t m_pos; /* current output sample position */ - uint32_t m_step; /* step value per output sample */ - attotime m_clock_period; /* clock period */ - - /* I/O lines */ - uint8_t m_fifo_in; /* last data written to the sound chip */ - uint8_t m_reset; /* current state of the RESET line */ - uint8_t m_start; /* current state of the START line */ - uint8_t m_drq; /* current state of the DRQ line */ - - /* internal state machine */ - int8_t m_state; /* current overall chip state */ - int32_t m_clocks_left; /* number of clocks left in this state */ - uint16_t m_nibbles_left; /* number of ADPCM nibbles left to process */ - uint8_t m_repeat_count; /* number of repeats remaining in current repeat block */ - int8_t m_post_drq_state; /* state we will be in after the DRQ line is dropped */ - int32_t m_post_drq_clocks; /* clocks that will be left after the DRQ line is dropped */ - uint8_t m_req_sample; /* requested sample number */ - uint8_t m_last_sample; /* last sample number available */ - uint8_t m_block_header; /* header byte */ - uint8_t m_sample_rate; /* number of UPD clocks per ADPCM nibble */ - uint8_t m_first_valid_header; /* did we get our first valid header yet? */ - uint32_t m_offset; /* current ROM offset */ - uint32_t m_repeat_offset; /* current ROM repeat offset */ + sound_stream *m_channel; // stream channel for playback + + // chip configuration + uint8_t m_sample_offset_shift; // header sample address shift (access data > 0xffff) + + // internal clock to output sample rate mapping + uint32_t m_pos; // current output sample position + uint32_t m_step; // step value per output sample + attotime m_clock_period; // clock period + + // I/O lines + uint8_t m_fifo_in; // last data written to the sound chip + uint8_t m_reset; // current state of the RESET line + uint8_t m_start; // current state of the START line + uint8_t m_drq; // current state of the DRQ line + + // internal state machine + int8_t m_state; // current overall chip state + int32_t m_clocks_left; // number of clocks left in this state + uint16_t m_nibbles_left; // number of ADPCM nibbles left to process + uint8_t m_repeat_count; // number of repeats remaining in current repeat block + int8_t m_post_drq_state; // state we will be in after the DRQ line is dropped + int32_t m_post_drq_clocks; // clocks that will be left after the DRQ line is dropped + uint8_t m_req_sample; // requested sample number + uint8_t m_last_sample; // last sample number available + uint8_t m_block_header; // header byte + uint8_t m_sample_rate; // number of UPD clocks per ADPCM nibble + uint8_t m_first_valid_header; // did we get our first valid header yet? + uint32_t m_offset; // current ROM offset + uint32_t m_repeat_offset; // current ROM repeat offset uint32_t m_start_delay; + int m_mode; // current mode of the sound chip - /* ADPCM processing */ - int8_t m_adpcm_state; /* ADPCM state index */ - uint8_t m_adpcm_data; /* current byte of ADPCM data */ - int16_t m_sample; /* current sample value */ + // ADPCM processing + int8_t m_adpcm_state; // ADPCM state index + uint8_t m_adpcm_data; // current byte of ADPCM data + int16_t m_sample; // current sample value - /* ROM access */ - int m_md; /* High is stand alone, low is slave. */ + // ROM access + int m_md; // High is stand alone, low is slave. }; class upd7759_device : public upd775x_device @@ -122,10 +128,11 @@ public: upd7759_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = STANDARD_CLOCK); - DECLARE_WRITE_LINE_MEMBER( md_w ) { m_md = state; } + DECLARE_WRITE_LINE_MEMBER( md_w ); protected: virtual void internal_start_w(int state) override; + virtual void internal_reset_w(int state) override; upd7759_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); @@ -133,6 +140,8 @@ protected: virtual void device_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param) override; + void internal_md_w(int state); + devcb_write_line m_drqcallback; emu_timer *m_timer; }; diff --git a/src/lib/formats/fs_coco_rsdos.cpp b/src/lib/formats/fs_coco_rsdos.cpp index aa201a7df92..c229257d624 100644 --- a/src/lib/formats/fs_coco_rsdos.cpp +++ b/src/lib/formats/fs_coco_rsdos.cpp @@ -13,6 +13,7 @@ #include "util/corestr.h" #include "util/strformat.h" +#include <bitset> #include <optional> #include <string_view> @@ -70,6 +71,7 @@ public: std::optional<u8> m_current_granule; u8 m_maximum_granules; u16 m_last_sector_bytes; + std::bitset<256> m_visited_granules; }; class file : public ifile_t { @@ -397,6 +399,8 @@ impl::granule_iterator::granule_iterator(impl &fs, const rsdos_dirent &dirent) , m_maximum_granules(fs.maximum_granules()) , m_last_sector_bytes((u16(dirent.m_last_sector_bytes_msb) << 8) | dirent.m_last_sector_bytes_lsb) { + // visit the first granule + m_visited_granules.set(dirent.m_first_granule); } @@ -412,6 +416,7 @@ bool impl::granule_iterator::next(u8 &granule, u16 &byte_count) if (m_current_granule) { + std::optional<u8> next_granule; const u8 *granule_map_data = m_granule_map.rodata(); if (granule_map_data[*m_current_granule] < m_maximum_granules) { @@ -419,7 +424,13 @@ bool impl::granule_iterator::next(u8 &granule, u16 &byte_count) success = true; granule = *m_current_granule; byte_count = 9 * 256; - m_current_granule = granule_map_data[*m_current_granule]; + next_granule = granule_map_data[*m_current_granule]; + + // check for cycles, which should only happen if the disk is corrupt (or not in RS-DOS format) + if (m_visited_granules[*next_granule]) + next_granule = std::nullopt; // this is corrupt! + else + m_visited_granules.set(*next_granule); } else if (granule_map_data[*m_current_granule] >= 0xC0 && granule_map_data[*m_current_granule] <= 0xC9) { @@ -428,13 +439,14 @@ bool impl::granule_iterator::next(u8 &granule, u16 &byte_count) granule = *m_current_granule; u16 sector_count = std::max(granule_map_data[*m_current_granule], u8(0xC1)) - 0xC1; byte_count = sector_count * 256 + m_last_sector_bytes; - m_current_granule = std::nullopt; + next_granule = std::nullopt; } else { // should not happen; but we'll treat this as an EOF - m_current_granule = std::nullopt; + next_granule = std::nullopt; } + m_current_granule = next_granule; } return success; } diff --git a/src/mame/drivers/aa310.cpp b/src/mame/drivers/aa310.cpp index 93079648c96..3f4237471fe 100644 --- a/src/mame/drivers/aa310.cpp +++ b/src/mame/drivers/aa310.cpp @@ -219,6 +219,8 @@ public: , m_adlc(*this, "adlc") , m_centronics(*this, "centronics") , m_cent_data_out(*this, "cent_data_out") + , m_i2cmem(*this, "i2cmem") + , m_rtc(*this, "rtc") { } void aa500(machine_config &config); @@ -238,6 +240,8 @@ private: required_device<mc6854_device> m_adlc; required_device<centronics_device> m_centronics; required_device<output_latch_device> m_cent_data_out; + required_device<i2c_pcf8570_device> m_i2cmem; + required_device<pcf8573_device> m_rtc; }; @@ -326,6 +330,7 @@ class aa4000_state : public aabase_state public: aa4000_state(const machine_config &mconfig, device_type type, const char *tag) : aabase_state(mconfig, type, tag) + , m_i2cmem(*this,"i2cmem") , m_floppy(*this, "upc:fdc:%u", 0U) //, m_test(*this, "test") , m_ioeb_control(0) @@ -334,6 +339,8 @@ public: void aa3010(machine_config &config); void aa3020(machine_config &config); void aa4000(machine_config &config); + + required_device<pcf8583_device> m_i2cmem; protected: virtual void machine_reset() override; @@ -347,6 +354,7 @@ protected: //required_device<archimedes_test_slot_device> m_test; u8 m_ioeb_control; + }; @@ -377,6 +385,7 @@ public: aa4_state(const machine_config &mconfig, device_type type, const char *tag) : aa5000_state(mconfig, type, tag) , m_lc(*this, "lc") + , m_bmu(*this, "bmu") { } void aa4(machine_config &config); @@ -386,6 +395,8 @@ protected: private: required_device<acorn_lc_device> m_lc; + required_device<acorn_bmu_device> m_bmu; + }; @@ -1076,12 +1087,11 @@ void aa500_state::aa500(machine_config &config) m_ioc->peripheral_w<5>().set(FUNC(aa500_state::peripheral5_w)); m_ioc->peripheral_r<6>().set_constant(0xff); m_ioc->peripheral_w<6>().set(FUNC(aa500_state::peripheral6_w)); - m_ioc->gpio_r<0>().set("i2cmem", FUNC(i2c_pcf8570_device::read_sda)); - m_ioc->gpio_r<0>().append("rtc", FUNC(pcf8573_device::sda_r)); - m_ioc->gpio_w<0>().set("i2cmem", FUNC(i2c_pcf8570_device::write_sda)); - m_ioc->gpio_w<0>().append("rtc", FUNC(pcf8573_device::sda_w)); - m_ioc->gpio_w<1>().set("i2cmem", FUNC(i2c_pcf8570_device::write_scl)); - m_ioc->gpio_w<1>().append("rtc", FUNC(pcf8573_device::scl_w)); + m_ioc->gpio_r<0>().set([this]() { return m_i2cmem->read_sda() & m_rtc->sda_r(); }); + m_ioc->gpio_w<0>().set(m_i2cmem, FUNC(i2c_pcf8570_device::write_sda)); + m_ioc->gpio_w<0>().append(m_rtc, FUNC(pcf8573_device::sda_w)); + m_ioc->gpio_w<1>().set(m_i2cmem, FUNC(i2c_pcf8570_device::write_scl)); + m_ioc->gpio_w<1>().append(m_rtc, FUNC(pcf8573_device::scl_w)); //m_ioc->gpio_r<2>().set("rtc", FUNC(pcf8573_device::min_r)); //m_ioc->gpio_r<3>().set("rtc", FUNC(pcf8573_device::sec_r)); m_ioc->gpio_r<4>().set([this] { return m_selected_floppy ? m_selected_floppy->dskchg_r() : 1; }); @@ -1097,8 +1107,8 @@ void aa500_state::aa500(machine_config &config) m_ram->set_default_size("4M"); // PCF8570 and PCF8573 (pre PCF8583) - I2C_PCF8570(config, "i2cmem"); - PCF8573(config, "rtc", 32.768_kHz_XTAL); + I2C_PCF8570(config, m_i2cmem); + PCF8573(config, m_rtc, 32.768_kHz_XTAL); FD1793(config, m_fdc, 24_MHz_XTAL / 24); m_fdc->intrq_wr_callback().set(m_ioc, FUNC(acorn_ioc_device::fh1_w)); @@ -1468,9 +1478,9 @@ void aa4000_state::aa3010(machine_config &config) m_ioc->peripheral_w<3>().set_log("IOC: Peripheral Select 3 W"); m_ioc->peripheral_r<5>().set(FUNC(aa4000_state::ioeb_r)); m_ioc->peripheral_w<5>().set(FUNC(aa4000_state::ioeb_w)); - m_ioc->gpio_r<0>().set("i2cmem", FUNC(pcf8583_device::sda_r)); - m_ioc->gpio_w<0>().set("i2cmem", FUNC(pcf8583_device::sda_w)); - m_ioc->gpio_w<1>().set("i2cmem", FUNC(pcf8583_device::scl_w)); + m_ioc->gpio_r<0>().set(m_i2cmem, FUNC(pcf8583_device::sda_r)); + m_ioc->gpio_w<0>().set(m_i2cmem, FUNC(pcf8583_device::sda_w)); + m_ioc->gpio_w<1>().set(m_i2cmem, FUNC(pcf8583_device::scl_w)); m_ioc->gpio_r<2>().set_constant(1); // FDHden m_ioc->gpio_r<3>().set("idrom", FUNC(ds2401_device::read)); m_ioc->gpio_w<3>().set("idrom", FUNC(ds2401_device::write)); @@ -1479,7 +1489,7 @@ void aa4000_state::aa3010(machine_config &config) m_ram->set_default_size("1M").set_extra_options("2M"); - PCF8583(config, "i2cmem", 32.768_kHz_XTAL); + PCF8583(config, m_i2cmem, 32.768_kHz_XTAL); DS2401(config, "idrom", 0); // DS2400 @@ -1616,14 +1626,14 @@ void aa4_state::aa4(machine_config &config) m_maincpu->set_clock(24_MHz_XTAL); // ARM3 m_maincpu->set_copro_type(arm_cpu_device::copro_type::VL86C020); - ACORN_BMU(config, "bmu", 4.194304_MHz_XTAL); + ACORN_BMU(config, m_bmu, 4.194304_MHz_XTAL); //bmu.battlo_callback().set(m_ioc, FUNC(acorn_ioc_device::il7_w)); //m_ioc->peripheral_r<2>().set("lc", FUNC(lc_device::read)); //m_ioc->peripheral_w<2>().set("lc", FUNC(lc_device::write)); - m_ioc->gpio_r<0>().append("bmu", FUNC(acorn_bmu_device::sda_r)); - m_ioc->gpio_w<0>().append("bmu", FUNC(acorn_bmu_device::sda_w)); - m_ioc->gpio_w<1>().append("bmu", FUNC(acorn_bmu_device::scl_w)); + m_ioc->gpio_r<0>().set([this]() { return m_i2cmem->sda_r() & m_bmu->sda_r(); }); + m_ioc->gpio_w<0>().append(m_bmu, FUNC(acorn_bmu_device::sda_w)); + m_ioc->gpio_w<1>().append(m_bmu, FUNC(acorn_bmu_device::scl_w)); // video hardware screen_device &screen(SCREEN(config.replace(), "screen", SCREEN_TYPE_LCD)); diff --git a/src/mame/drivers/appoooh.cpp b/src/mame/drivers/appoooh.cpp index 86e97564fb5..9da785d7890 100644 --- a/src/mame/drivers/appoooh.cpp +++ b/src/mame/drivers/appoooh.cpp @@ -164,24 +164,345 @@ Language ***************************************************************************/ #include "emu.h" -#include "includes/appoooh.h" -#include "cpu/z80/z80.h" #include "machine/segacrp2_device.h" + +#include "cpu/z80/z80.h" +#include "sound/msm5205.h" #include "sound/sn76496.h" + +#include "emupal.h" #include "screen.h" #include "speaker.h" +#include "tilemap.h" + + +namespace { + +class base_state : public driver_device +{ +public: + base_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_spriteram(*this, "spriteram%u", 1U), + m_videoram(*this, "videoram%u", 1U), // 0 FG, 1 BG + m_colorram(*this, "colorram%u", 1U), // 0 FG, 1 BG + m_mainbank(*this, "mainbank"), + m_adpcm_rom(*this, "adpcm"), + m_maincpu(*this, "maincpu"), + m_gfxdecode(*this, "gfxdecode"), + m_palette(*this, "palette"), + m_msm(*this, "msm") + { } + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + +protected: + // memory pointers + required_shared_ptr_array<uint8_t, 2> m_spriteram; + required_shared_ptr_array<uint8_t, 2> m_videoram; + required_shared_ptr_array<uint8_t, 2> m_colorram; + required_memory_bank m_mainbank; + required_region_ptr<uint8_t> m_adpcm_rom; + + // video-related + tilemap_t *m_tilemap[2]{}; + uint8_t m_scroll_x = 0U; + uint8_t m_priority = 0U; + uint16_t m_spritebase = 0U; + + // sound-related + uint32_t m_adpcm_data = 0U; + uint32_t m_adpcm_address = 0U; + + // devices + required_device<cpu_device> m_maincpu; + required_device<gfxdecode_device> m_gfxdecode; + required_device<palette_device> m_palette; + required_device<msm5205_device> m_msm; + + uint8_t m_nmi_mask = 0U; + + void adpcm_w(uint8_t data); + void scroll_w(uint8_t data); + template <uint8_t Which> void videoram_w(offs_t offset, uint8_t data); + template <uint8_t Which> void colorram_w(offs_t offset, uint8_t data); + void out_w(uint8_t data); + template <uint8_t Which> TILE_GET_INFO_MEMBER(get_tile_info); + + INTERRUPT_GEN_MEMBER(vblank_irq); + void draw_sprites(bitmap_ind16 &dest_bmp, const rectangle &cliprect, gfx_element *gfx, uint8_t *sprite); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + DECLARE_WRITE_LINE_MEMBER(adpcm_int); + + void common(machine_config &config); + void main_map(address_map &map); + void main_portmap(address_map &map); +}; + +class appoooh_state : public base_state +{ +public: + appoooh_state(const machine_config &mconfig, device_type type, const char *tag) : + base_state(mconfig, type, tag) + { m_spritebase = 0; } + + void appoooh(machine_config &config); + +private: + void palette(palette_device &palette) const; +}; + +class robowres_state : public base_state +{ +public: + robowres_state(const machine_config &mconfig, device_type type, const char *tag) : + base_state(mconfig, type, tag), + m_decrypted_opcodes(*this, "decrypted_opcodes") + { m_spritebase = 0x200; } + + void init_robowresb(); + + void robowres(machine_config &config); + void robowrese(machine_config &config); + +private: + // memory pointers + required_shared_ptr<uint8_t> m_decrypted_opcodes; + + void palette(palette_device &palette) const; + + void decrypted_opcodes_map(address_map &map); +}; + + +// video + +/*************************************************************************** + + Convert the color PROMs into a more useable format. + + Palette information of Appoooh is not known. + + The palette decoder of Bank Panic was used for this driver. + Because these hardware is similar. + +***************************************************************************/ + +void appoooh_state::palette(palette_device &palette) const +{ + const uint8_t *color_prom = memregion("proms")->base(); + + for (int i = 0; i < palette.entries(); i++) + { + uint8_t const pen = (color_prom[0x20 + i] & 0x0f) | ((i < 0x100) ? 0x00 : 0x10); + + // red component + int bit0 = BIT(color_prom[pen], 0); + int bit1 = BIT(color_prom[pen], 1); + int bit2 = BIT(color_prom[pen], 2); + int const r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; + + // green component + bit0 = BIT(color_prom[pen], 3); + bit1 = BIT(color_prom[pen], 4); + bit2 = BIT(color_prom[pen], 5); + int const g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; + + // blue component + bit0 = 0; + bit1 = BIT(color_prom[pen], 6); + bit2 = BIT(color_prom[pen], 7); + int const b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; + + palette.set_pen_color(i, rgb_t(r, g, b)); + } +} + +void robowres_state::palette(palette_device &palette) const +{ + const uint8_t *color_prom = memregion("proms")->base(); + + for (int i = 0; i < palette.entries(); i++) + { + uint8_t const pen = color_prom[0x20 + i] & 0x0f; + + // red component + int bit0 = BIT(color_prom[pen], 0); + int bit1 = BIT(color_prom[pen], 1); + int bit2 = BIT(color_prom[pen], 2); + int const r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; + + // green component + bit0 = BIT(color_prom[pen], 3); + bit1 = BIT(color_prom[pen], 4); + bit2 = BIT(color_prom[pen], 5); + int const g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; + + // blue component + bit0 = 0; + bit1 = BIT(color_prom[pen], 6); + bit2 = BIT(color_prom[pen], 7); + int const b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; + + palette.set_pen_color(i, rgb_t(r, g, b)); + } +} + + + +/*************************************************************************** + + Callbacks for the TileMap code + +***************************************************************************/ + +template <uint8_t Which> +TILE_GET_INFO_MEMBER(base_state::get_tile_info) +{ + int code = m_videoram[Which][tile_index] + 256 * ((m_colorram[Which][tile_index] >> 5) & 7); + + tileinfo.set(Which, + code, + m_colorram[Which][tile_index] & 0x0f, + (m_colorram[Which][tile_index] & 0x10 ) ? TILEMAP_FLIPX : 0 + ); +} + +/*************************************************************************** + + Start the video hardware emulation. + +***************************************************************************/ + +void base_state::video_start() +{ + m_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(base_state::get_tile_info<0>)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); + m_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(base_state::get_tile_info<1>)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); + + m_tilemap[0]->set_transparent_pen(0); + m_tilemap[0]->set_scrolldy(8, 8); + m_tilemap[1]->set_scrolldy(8, 8); + + save_item(NAME(m_scroll_x)); + save_item(NAME(m_priority)); +} + +void base_state::scroll_w(uint8_t data) +{ + m_scroll_x = data; +} -WRITE_LINE_MEMBER(appoooh_state::adpcm_int) +template <uint8_t Which> +void base_state::videoram_w(offs_t offset, uint8_t data) +{ + m_videoram[Which][offset] = data; + m_tilemap[Which]->mark_tile_dirty(offset); +} + +template <uint8_t Which> +void base_state::colorram_w(offs_t offset, uint8_t data) +{ + m_colorram[Which][offset] = data; + m_tilemap[Which]->mark_tile_dirty(offset); +} + +void base_state::out_w(uint8_t data) +{ + // bit 0 controls NMI + m_nmi_mask = data & 1; + + // bit 1 flip screen + flip_screen_set(data & 0x02); + + // bits 2-3 unknown + + /* bits 4-5 are playfield/sprite priority + TODO: understand how this works, currently the only thing I do is draw + the front layer behind sprites when priority == 0, and invert the sprite + order when priority == 1 */ + m_priority = (data & 0x30) >> 4; + + // bit 6 ROM bank select + m_mainbank->set_entry((data & 0x40) ? 1 : 0); + + // bit 7 unknown (used) +} + +void base_state::draw_sprites(bitmap_ind16 &dest_bmp, const rectangle &cliprect, gfx_element *gfx, uint8_t *sprite) +{ + int flipy = flip_screen(); + + for (int offs = 0x20 - 4; offs >= 0; offs -= 4) + { + int sy = 240 - sprite[offs + 0]; + int code = m_spritebase + (sprite[offs + 1] >> 2) + ((sprite[offs + 2] >> 5) & 0x07) * 0x40; + int color = sprite[offs + 2] & 0x0f; // TODO: bit 4 toggles continuously, what is it? + int sx = sprite[offs + 3]; + int flipx = sprite[offs + 1] & 0x01; + + if(sx >= 248) + sx -= 256; + + if (flipy) + { + sx = 239 - sx; + sy = 239 - sy; + flipx = !flipx; + } + + gfx->transpen(dest_bmp, cliprect, + code, + color, + flipx, flipy, + sx, sy, 0); + } +} + +uint32_t base_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + // bg tilemap + m_tilemap[1]->draw(screen, bitmap, cliprect, 0, 0); + + if (m_priority == 0) // fg behind sprites + m_tilemap[0]->draw(screen, bitmap, cliprect, 0, 0); + + // draw sprites + if (m_priority == 1) + { + // sprite set #1 + draw_sprites(bitmap, cliprect, m_gfxdecode->gfx(2), m_spriteram[0]); + // sprite set #2 + draw_sprites(bitmap, cliprect, m_gfxdecode->gfx(3), m_spriteram[1]); + } + else + { + // sprite set #2 + draw_sprites(bitmap, cliprect, m_gfxdecode->gfx(3), m_spriteram[1]); + // sprite set #1 + draw_sprites(bitmap, cliprect, m_gfxdecode->gfx(2), m_spriteram[0]); + } + + if (m_priority != 0) // fg in front of sprites + m_tilemap[0]->draw(screen, bitmap, cliprect, 0, 0); + + return 0; +} + + +// machine + +WRITE_LINE_MEMBER(base_state::adpcm_int) { if (m_adpcm_address != 0xffffffff) { if (m_adpcm_data == 0xffffffff) { - uint8_t *RAM = memregion("adpcm")->base(); - - m_adpcm_data = RAM[m_adpcm_address++]; + m_adpcm_data = m_adpcm_rom[m_adpcm_address++]; m_msm->data_w(m_adpcm_data >> 4); if (m_adpcm_data == 0x70) @@ -198,8 +519,8 @@ WRITE_LINE_MEMBER(appoooh_state::adpcm_int) } } -/* adpcm address write */ -void appoooh_state::adpcm_w(uint8_t data) +// adpcm address write +void base_state::adpcm_w(uint8_t data) { m_adpcm_address = data << 8; m_msm->reset_w(0); @@ -213,40 +534,40 @@ void appoooh_state::adpcm_w(uint8_t data) * *************************************/ -void appoooh_state::main_map(address_map &map) +void base_state::main_map(address_map &map) { map(0x0000, 0x7fff).rom(); map(0x8000, 0x9fff).rom(); - map(0xa000, 0xdfff).bankr("bank1"); + map(0xa000, 0xdfff).bankr(m_mainbank); map(0xe000, 0xe7ff).ram(); - map(0xe800, 0xefff).ram(); /* RAM ? */ + map(0xe800, 0xefff).ram(); // RAM ? - map(0xf000, 0xf01f).ram().share("spriteram"); - map(0xf020, 0xf3ff).ram().w(FUNC(appoooh_state::fg_videoram_w)).share("fg_videoram"); + map(0xf000, 0xf01f).ram().share(m_spriteram[0]); + map(0xf020, 0xf3ff).ram().w(FUNC(base_state::videoram_w<0>)).share(m_videoram[0]); map(0xf400, 0xf41f).ram(); - map(0xf420, 0xf7ff).ram().w(FUNC(appoooh_state::fg_colorram_w)).share("fg_colorram"); - map(0xf800, 0xf81f).ram().share("spriteram_2"); - map(0xf820, 0xfbff).ram().w(FUNC(appoooh_state::bg_videoram_w)).share("bg_videoram"); + map(0xf420, 0xf7ff).ram().w(FUNC(base_state::colorram_w<0>)).share(m_colorram[0]); + map(0xf800, 0xf81f).ram().share(m_spriteram[1]); + map(0xf820, 0xfbff).ram().w(FUNC(base_state::videoram_w<1>)).share(m_videoram[1]); map(0xfc00, 0xfc1f).ram(); - map(0xfc20, 0xffff).ram().w(FUNC(appoooh_state::bg_colorram_w)).share("bg_colorram"); + map(0xfc20, 0xffff).ram().w(FUNC(base_state::colorram_w<1>)).share(m_colorram[1]); } -void appoooh_state::decrypted_opcodes_map(address_map &map) +void robowres_state::decrypted_opcodes_map(address_map &map) { - map(0x0000, 0x7fff).rom().share("decrypted_opcodes"); + map(0x0000, 0x7fff).rom().share(m_decrypted_opcodes); map(0x8000, 0x9fff).rom().region("maincpu", 0x8000); - map(0xa000, 0xdfff).bankr("bank1"); + map(0xa000, 0xdfff).bankr(m_mainbank); } -void appoooh_state::main_portmap(address_map &map) +void base_state::main_portmap(address_map &map) { map.global_mask(0xff); map(0x00, 0x00).portr("P1").w("sn1", FUNC(sn76489_device::write)); map(0x01, 0x01).portr("P2").w("sn2", FUNC(sn76489_device::write)); map(0x02, 0x02).w("sn3", FUNC(sn76489_device::write)); - map(0x03, 0x03).portr("DSW1").w(FUNC(appoooh_state::adpcm_w)); - map(0x04, 0x04).portr("BUTTON3").w(FUNC(appoooh_state::out_w)); - map(0x05, 0x05).w(FUNC(appoooh_state::scroll_w)); /* unknown */ + map(0x03, 0x03).portr("DSW1").w(FUNC(base_state::adpcm_w)); + map(0x04, 0x04).portr("BUTTON3").w(FUNC(base_state::out_w)); + map(0x05, 0x05).w(FUNC(base_state::scroll_w)); // unknown } @@ -281,7 +602,7 @@ static INPUT_PORTS_START( appoooh ) PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_COCKTAIL PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN3 ) - PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* probably unused */ + PORT_BIT( 0xf8, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // probably unused PORT_START("DSW1") PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3") @@ -313,7 +634,7 @@ static INPUT_PORTS_START( robowres ) PORT_INCLUDE( appoooh ) PORT_MODIFY("DSW1") - PORT_DIPUNUSED_DIPLOC(0x40,0x40, "SW1:7" ) /* Listed as "Unused" */ + PORT_DIPUNUSED_DIPLOC(0x40,0x40, "SW1:7" ) // Listed as "Unused" PORT_DIPNAME( 0x80, 0x80, DEF_STR( Language ) ) PORT_DIPLOCATION("SW1:8") PORT_DIPSETTING( 0x00, DEF_STR( Japanese ) ) PORT_DIPSETTING( 0x80, DEF_STR( English ) ) @@ -326,39 +647,8 @@ INPUT_PORTS_END * *************************************/ -static const gfx_layout charlayout = -{ - 8,8, /* 8*8 characters */ - 2048, /* 2048 characters */ - 3, /* 3 bits per pixel */ - { 2*2048*8*8, 1*2048*8*8, 0*2048*8*8 }, /* the bitplanes are separated */ - { 7, 6, 5, 4, 3, 2, 1, 0 }, - { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, - 8*8 /* every char takes 8 consecutive bytes */ -}; -static const gfx_layout spritelayout = -{ - 16,16, /* 8*8 characters */ - 512, /* 512 characters */ - 3, /* 3 bits per pixel */ - { 2*2048*8*8, 1*2048*8*8, 0*2048*8*8 }, /* the bitplanes are separated */ - { 7, 6, 5, 4, 3, 2, 1, 0 , - 8*8+7,8*8+6,8*8+5,8*8+4,8*8+3,8*8+2,8*8+1,8*8+0}, - { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, - 16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 }, - 32*8 /* every char takes 8 consecutive bytes */ -}; - -static GFXDECODE_START( gfx_appoooh ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 32 ) - GFXDECODE_ENTRY( "gfx2", 0, charlayout, 32*8, 32 ) - GFXDECODE_ENTRY( "gfx1", 0, spritelayout, 0, 32 ) - GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 32*8, 32 ) -GFXDECODE_END - - -static const gfx_layout robowres_charlayout = + static const gfx_layout charlayout = { 8,8, RGN_FRAC(1,3), @@ -369,7 +659,7 @@ static const gfx_layout robowres_charlayout = 8*8 }; -static const gfx_layout robowres_spritelayout = +static const gfx_layout spritelayout = { 16,16, RGN_FRAC(1,3), @@ -379,15 +669,15 @@ static const gfx_layout robowres_spritelayout = 8*8+7,8*8+6,8*8+5,8*8+4,8*8+3,8*8+2,8*8+1,8*8+0}, { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 }, - 32*8 /* every char takes 8 consecutive bytes */ + 32*8 // every char takes 8 consecutive bytes }; -static GFXDECODE_START( gfx_robowres ) - GFXDECODE_ENTRY( "gfx1", 0, robowres_charlayout, 0, 32 ) - GFXDECODE_ENTRY( "gfx2", 0, robowres_charlayout, 0, 32 ) - GFXDECODE_ENTRY( "gfx1", 0, robowres_spritelayout, 0, 32 ) - GFXDECODE_ENTRY( "gfx2", 0, robowres_spritelayout, 0, 32 ) +static GFXDECODE_START( gfx_appoooh ) + GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 32 ) + GFXDECODE_ENTRY( "gfx2", 0, charlayout, 32*8, 32 ) + GFXDECODE_ENTRY( "gfx1", 0, spritelayout, 0, 32 ) + GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 32*8, 32 ) GFXDECODE_END @@ -397,16 +687,15 @@ GFXDECODE_END * *************************************/ -void appoooh_state::machine_start() +void base_state::machine_start() { - membank("bank1")->configure_entries(0, 2, memregion("maincpu")->base() + 0xa000, 0x6000); + m_mainbank->configure_entries(0, 2, memregion("maincpu")->base() + 0xa000, 0x6000); save_item(NAME(m_adpcm_data)); save_item(NAME(m_adpcm_address)); } - -void appoooh_state::machine_reset() +void base_state::machine_reset() { m_adpcm_address = 0xffffffff; m_adpcm_data = 0; @@ -414,79 +703,79 @@ void appoooh_state::machine_reset() m_priority = 0; } -INTERRUPT_GEN_MEMBER(appoooh_state::vblank_irq) +INTERRUPT_GEN_MEMBER(base_state::vblank_irq) { - if(m_nmi_mask) + if (m_nmi_mask) device.execute().pulse_input_line(INPUT_LINE_NMI, attotime::zero); } -void appoooh_state::appoooh_common(machine_config &config) +void base_state::common(machine_config &config) { - /* basic machine hardware */ - Z80(config, m_maincpu, 18432000/6); /* ??? the main xtal is 18.432 MHz */ - m_maincpu->set_addrmap(AS_PROGRAM, &appoooh_state::main_map); - m_maincpu->set_addrmap(AS_IO, &appoooh_state::main_portmap); - m_maincpu->set_vblank_int("screen", FUNC(appoooh_state::vblank_irq)); + // basic machine hardware + Z80(config, m_maincpu, 18.432_MHz_XTAL / 6); // divider unknown + m_maincpu->set_addrmap(AS_PROGRAM, &base_state::main_map); + m_maincpu->set_addrmap(AS_IO, &base_state::main_portmap); + m_maincpu->set_vblank_int("screen", FUNC(base_state::vblank_irq)); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); - SN76489(config, "sn1", 18432000/6).add_route(ALL_OUTPUTS, "mono", 0.30); - SN76489(config, "sn2", 18432000/6).add_route(ALL_OUTPUTS, "mono", 0.30); - SN76489(config, "sn3", 18432000/6).add_route(ALL_OUTPUTS, "mono", 0.30); + SN76489(config, "sn1", 18.432_MHz_XTAL / 6).add_route(ALL_OUTPUTS, "mono", 0.30); // divider unknown + SN76489(config, "sn2", 18.432_MHz_XTAL / 6).add_route(ALL_OUTPUTS, "mono", 0.30); // divider unknown + SN76489(config, "sn3", 18.432_MHz_XTAL / 6).add_route(ALL_OUTPUTS, "mono", 0.30); // divider unknown MSM5205(config, m_msm, 384000); - m_msm->vck_legacy_callback().set(FUNC(appoooh_state::adpcm_int)); /* interrupt function */ - m_msm->set_prescaler_selector(msm5205_device::S64_4B); /* 6KHz */ + m_msm->vck_legacy_callback().set(FUNC(base_state::adpcm_int)); // interrupt function + m_msm->set_prescaler_selector(msm5205_device::S64_4B); // 6KHz m_msm->add_route(ALL_OUTPUTS, "mono", 0.50); } void appoooh_state::appoooh(machine_config &config) { - appoooh_common(config); + common(config); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); screen.set_size(32*8, 32*8); screen.set_visarea(0*8, 32*8-1, 2*8, 30*8-1); - screen.set_screen_update(FUNC(appoooh_state::screen_update_appoooh)); + screen.set_screen_update(FUNC(appoooh_state::screen_update)); screen.set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_appoooh); - PALETTE(config, m_palette, FUNC(appoooh_state::appoooh_palette), 32*8+32*8); + PALETTE(config, m_palette, FUNC(appoooh_state::palette), 32*8+32*8); } -void appoooh_state::robowres(machine_config &config) +void robowres_state::robowres(machine_config &config) { - appoooh_common(config); + common(config); - m_maincpu->set_addrmap(AS_OPCODES, &appoooh_state::decrypted_opcodes_map); + m_maincpu->set_addrmap(AS_OPCODES, &robowres_state::decrypted_opcodes_map); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); screen.set_size(32*8, 32*8); screen.set_visarea(0*8, 32*8-1, 2*8, 30*8-1); - screen.set_screen_update(FUNC(appoooh_state::screen_update_robowres)); + screen.set_screen_update(FUNC(robowres_state::screen_update)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_robowres); - PALETTE(config, m_palette, FUNC(appoooh_state::robowres_palette), 32*8+32*8); + GFXDECODE(config, m_gfxdecode, m_palette, gfx_appoooh); + PALETTE(config, m_palette, FUNC(robowres_state::palette), 32*8+32*8); } -void appoooh_state::robowrese(machine_config &config) +void robowres_state::robowrese(machine_config &config) { robowres(config); - sega_315_5179_device &maincpu(SEGA_315_5179(config.replace(), m_maincpu, 18432000/6)); /* ??? the main xtal is 18.432 MHz */ - maincpu.set_addrmap(AS_PROGRAM, &appoooh_state::main_map); - maincpu.set_addrmap(AS_IO, &appoooh_state::main_portmap); - maincpu.set_vblank_int("screen", FUNC(appoooh_state::vblank_irq)); - maincpu.set_addrmap(AS_OPCODES, &appoooh_state::decrypted_opcodes_map); + sega_315_5179_device &maincpu(SEGA_315_5179(config.replace(), m_maincpu, 18.432_MHz_XTAL / 6)); // divider unknown + maincpu.set_addrmap(AS_PROGRAM, &robowres_state::main_map); + maincpu.set_addrmap(AS_IO, &robowres_state::main_portmap); + maincpu.set_vblank_int("screen", FUNC(robowres_state::vblank_irq)); + maincpu.set_addrmap(AS_OPCODES, &robowres_state::decrypted_opcodes_map); maincpu.set_decrypted_tag(m_decrypted_opcodes); } @@ -497,33 +786,33 @@ void appoooh_state::robowrese(machine_config &config) *************************************/ ROM_START( appoooh ) - ROM_REGION( 0x14000, "maincpu", 0 ) /* 64k for code + 16k bank */ + ROM_REGION( 0x14000, "maincpu", 0 ) ROM_LOAD( "epr-5906.bin", 0x00000, 0x2000, CRC(fffae7fe) SHA1(b4bb60eb6331e503759bd963eafefa69331d6b86) ) ROM_LOAD( "epr-5907.bin", 0x02000, 0x2000, CRC(57696cd6) SHA1(74a005d18d55fed9ece9b579d2e7e6619a47538b) ) ROM_LOAD( "epr-5908.bin", 0x04000, 0x2000, CRC(4537cddc) SHA1(ecb71cab7b9269d713399987cbc45ff54735019f) ) ROM_LOAD( "epr-5909.bin", 0x06000, 0x2000, CRC(cf82718d) SHA1(4408c468a422735ae8f69c03003157782f1a0210) ) ROM_LOAD( "epr-5910.bin", 0x08000, 0x2000, CRC(312636da) SHA1(18817df6f2e480810726f7b11f289c59e712ee45) ) - ROM_LOAD( "epr-5911.bin", 0x0a000, 0x2000, CRC(0bc2acaa) SHA1(1ae904658ce9e44cdb79f0a13202aaff5c9f9480) ) /* bank0 */ - ROM_LOAD( "epr-5913.bin", 0x0c000, 0x2000, CRC(f5a0e6a7) SHA1(7fad534d1fba52078c4ea580ca7601fdd23cbfa6) ) /* a000-dfff */ - ROM_LOAD( "epr-5912.bin", 0x10000, 0x2000, CRC(3c3915ab) SHA1(28b501bda992ac06b10dbb5f1f7d6009f2f5f48c) ) /* bank1 */ - ROM_LOAD( "epr-5914.bin", 0x12000, 0x2000, CRC(58792d4a) SHA1(8acdb0ebee5faadadd64bd64db1fdf881ee70333) ) /* a000-dfff */ + ROM_LOAD( "epr-5911.bin", 0x0a000, 0x2000, CRC(0bc2acaa) SHA1(1ae904658ce9e44cdb79f0a13202aaff5c9f9480) ) // bank0 + ROM_LOAD( "epr-5913.bin", 0x0c000, 0x2000, CRC(f5a0e6a7) SHA1(7fad534d1fba52078c4ea580ca7601fdd23cbfa6) ) // a000-dfff + ROM_LOAD( "epr-5912.bin", 0x10000, 0x2000, CRC(3c3915ab) SHA1(28b501bda992ac06b10dbb5f1f7d6009f2f5f48c) ) // bank1 + ROM_LOAD( "epr-5914.bin", 0x12000, 0x2000, CRC(58792d4a) SHA1(8acdb0ebee5faadadd64bd64db1fdf881ee70333) ) // a000-dfff ROM_REGION( 0x0c000, "gfx1", 0 ) - ROM_LOAD( "epr-5895.bin", 0x00000, 0x4000, CRC(4b0d4294) SHA1(f9f4d928c76b32cbcbaf7bfd0ebec2d4dfc37566) ) /* playfield #1 chars */ + ROM_LOAD( "epr-5895.bin", 0x00000, 0x4000, CRC(4b0d4294) SHA1(f9f4d928c76b32cbcbaf7bfd0ebec2d4dfc37566) ) // playfield #1 chars ROM_LOAD( "epr-5896.bin", 0x04000, 0x4000, CRC(7bc84d75) SHA1(36e98eaac1ba23ab842080205bdb5b76b888ddc2) ) ROM_LOAD( "epr-5897.bin", 0x08000, 0x4000, CRC(745f3ffa) SHA1(03f5d1d567e786e7835defc6995d1b39aee2c28d) ) ROM_REGION( 0x0c000, "gfx2", 0 ) - ROM_LOAD( "epr-5898.bin", 0x00000, 0x4000, CRC(cf01644d) SHA1(0cc1b7f7a3b33b0edf4e277e320467b19dfc5bc8) ) /* playfield #2 chars */ + ROM_LOAD( "epr-5898.bin", 0x00000, 0x4000, CRC(cf01644d) SHA1(0cc1b7f7a3b33b0edf4e277e320467b19dfc5bc8) ) // playfield #2 chars ROM_LOAD( "epr-5899.bin", 0x04000, 0x4000, CRC(885ad636) SHA1(d040948f7cf030e4ab0f0509df23cb855e9c920c) ) ROM_LOAD( "epr-5900.bin", 0x08000, 0x4000, CRC(a8ed13f3) SHA1(31c4a52fea8f26b4a79564c7e8443a88d43aee12) ) ROM_REGION( 0x0220, "proms", 0 ) - ROM_LOAD( "pr5921.prm", 0x0000, 0x020, CRC(f2437229) SHA1(8fb4240142f4c77f820d7c153c22ff82f66aa7b1) ) /* palette */ - ROM_LOAD( "pr5922.prm", 0x0020, 0x100, CRC(85c542bf) SHA1(371d92fca2ae609a47d3a2ea349f14f30b846da8) ) /* charset #1 lookup table */ - ROM_LOAD( "pr5923.prm", 0x0120, 0x100, CRC(16acbd53) SHA1(e5791646730c6232efa2c0327b484472c47baf21) ) /* charset #2 lookup table */ + ROM_LOAD( "pr5921.prm", 0x0000, 0x020, CRC(f2437229) SHA1(8fb4240142f4c77f820d7c153c22ff82f66aa7b1) ) // palette + ROM_LOAD( "pr5922.prm", 0x0020, 0x100, CRC(85c542bf) SHA1(371d92fca2ae609a47d3a2ea349f14f30b846da8) ) // charset #1 lookup table + ROM_LOAD( "pr5923.prm", 0x0120, 0x100, CRC(16acbd53) SHA1(e5791646730c6232efa2c0327b484472c47baf21) ) // charset #2 lookup table - ROM_REGION( 0xa000, "adpcm", 0 ) /* adpcm voice data */ + ROM_REGION( 0xa000, "adpcm", 0 ) ROM_LOAD( "epr-5901.bin", 0x0000, 0x2000, CRC(170a10a4) SHA1(7b0c8427c69525cbcbe9f88b22b12aafb6949bfd) ) ROM_LOAD( "epr-5902.bin", 0x2000, 0x2000, CRC(f6981640) SHA1(1a93913ecb64d1c459e5bbcc28c4ca3ea90f21e1) ) ROM_LOAD( "epr-5903.bin", 0x4000, 0x2000, CRC(0439df50) SHA1(1f981c1867366fa57de25ff8f421c121d82d7321) ) @@ -532,7 +821,7 @@ ROM_START( appoooh ) ROM_END ROM_START( robowres ) - ROM_REGION( 0x1c000, "maincpu", 0 ) /* 64k for code + 16k bank */ + ROM_REGION( 0x1c000, "maincpu", 0 ) ROM_LOAD( "epr-7540.13d", 0x00000, 0x8000, CRC(a2a54237) SHA1(06c80fe6725582d19aa957728977e871e79e79e1) ) ROM_LOAD( "epr-7541.14d", 0x08000, 0x6000, CRC(cbf7d1a8) SHA1(5eb6d2130d4e5401a332df6db5cad07f3131e8e4) ) ROM_CONTINUE( 0x10000, 0x2000 ) @@ -550,16 +839,16 @@ ROM_START( robowres ) ROM_LOAD( "epr-7549.5d", 0x10000, 0x8000, CRC(f640afbb) SHA1(3aa563866f7160038ce6b1aa3204bd9d286e0a46) ) ROM_REGION( 0x0220, "proms", 0 ) - ROM_LOAD( "pr7571.10a", 0x00000, 0x0020, CRC(e82c6d5c) SHA1(de3090bf922171abd1c30f20ca163f387adc60e1) ) + ROM_LOAD( "pr7571.10a", 0x00000, 0x0020, CRC(e82c6d5c) SHA1(de3090bf922171abd1c30f20ca163f387adc60e1) ) ROM_LOAD( "pr7572.7f", 0x00020, 0x0100, CRC(2b083d0c) SHA1(5b39bd4297bec788caac9e9de5128d43932a24e2) ) ROM_LOAD( "pr7573.7g", 0x00120, 0x0100, CRC(2b083d0c) SHA1(5b39bd4297bec788caac9e9de5128d43932a24e2) ) - ROM_REGION( 0x8000, "adpcm", 0 ) /* adpcm voice data */ + ROM_REGION( 0x8000, "adpcm", 0 ) ROM_LOAD( "epr-7543.12b", 0x00000, 0x8000, CRC(4d108c49) SHA1(a7c3c5a5ad36917ea7f6d917377c2392fa9beea3) ) ROM_END ROM_START( robowresb ) - ROM_REGION( 0x1c000+0x8000, "maincpu", 0 ) /* 64k for code + 16k bank */ + ROM_REGION( 0x24000, "maincpu", 0 ) ROM_LOAD( "dg4.e13", 0x00000, 0x8000, CRC(f7585d4f) SHA1(718879f8262681b6b66968eb49a0fb04fda5160b) ) ROM_LOAD( "epr-7541.14d", 0x08000, 0x6000, CRC(cbf7d1a8) SHA1(5eb6d2130d4e5401a332df6db5cad07f3131e8e4) ) ROM_CONTINUE( 0x10000, 0x2000 ) @@ -578,11 +867,11 @@ ROM_START( robowresb ) ROM_LOAD( "epr-7549.5d", 0x10000, 0x8000, CRC(f640afbb) SHA1(3aa563866f7160038ce6b1aa3204bd9d286e0a46) ) ROM_REGION( 0x0220, "proms", 0 ) - ROM_LOAD( "pr7571.10a", 0x00000, 0x0020, CRC(e82c6d5c) SHA1(de3090bf922171abd1c30f20ca163f387adc60e1) ) + ROM_LOAD( "pr7571.10a", 0x00000, 0x0020, CRC(e82c6d5c) SHA1(de3090bf922171abd1c30f20ca163f387adc60e1) ) ROM_LOAD( "pr7572.7f", 0x00020, 0x0100, CRC(2b083d0c) SHA1(5b39bd4297bec788caac9e9de5128d43932a24e2) ) ROM_LOAD( "pr7573.7g", 0x00120, 0x0100, CRC(2b083d0c) SHA1(5b39bd4297bec788caac9e9de5128d43932a24e2) ) - ROM_REGION( 0x8000, "adpcm", 0 ) /* adpcm voice data */ + ROM_REGION( 0x8000, "adpcm", 0 ) ROM_LOAD( "epr-7543.12b", 0x00000, 0x8000, CRC(4d108c49) SHA1(a7c3c5a5ad36917ea7f6d917377c2392fa9beea3) ) ROM_END @@ -595,11 +884,13 @@ ROM_END *************************************/ -void appoooh_state::init_robowresb() +void robowres_state::init_robowresb() { memcpy(m_decrypted_opcodes, memregion("maincpu")->base() + 0x1c000, 0x8000); } +} // anonymous namespace + /************************************* * @@ -607,6 +898,6 @@ void appoooh_state::init_robowresb() * *************************************/ -GAME( 1984, appoooh, 0, appoooh, appoooh, appoooh_state, empty_init, ROT0, "Sanritsu / Sega", "Appoooh", MACHINE_SUPPORTS_SAVE ) -GAME( 1986, robowres, 0, robowrese, robowres, appoooh_state, empty_init, ROT0, "Sanritsu / Sega", "Robo Wres 2001", MACHINE_SUPPORTS_SAVE ) -GAME( 1986, robowresb, robowres, robowres, robowres, appoooh_state, init_robowresb, ROT0, "bootleg", "Robo Wres 2001 (bootleg)", MACHINE_SUPPORTS_SAVE ) +GAME( 1984, appoooh, 0, appoooh, appoooh, appoooh_state, empty_init, ROT0, "Sanritsu / Sega", "Appoooh", MACHINE_SUPPORTS_SAVE ) +GAME( 1986, robowres, 0, robowrese, robowres, robowres_state, empty_init, ROT0, "Sanritsu / Sega", "Robo Wres 2001", MACHINE_SUPPORTS_SAVE ) +GAME( 1986, robowresb, robowres, robowres, robowres, robowres_state, init_robowresb, ROT0, "bootleg", "Robo Wres 2001 (bootleg)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/apxen.cpp b/src/mame/drivers/apxen.cpp index bfb22bae08e..4a0604d019b 100644 --- a/src/mame/drivers/apxen.cpp +++ b/src/mame/drivers/apxen.cpp @@ -120,7 +120,7 @@ public: m_sio(*this, "sio"), m_fdc(*this, "fdc"), m_floppy(*this, "fdc:%u", 0U), - m_video(*this, "video"), + m_video(*this, "apvideo"), // "video" causes assert in debug build m_cur_floppy(nullptr) { } diff --git a/src/mame/drivers/at.cpp b/src/mame/drivers/at.cpp index 65f5e2fbc8f..1fd01202b45 100644 --- a/src/mame/drivers/at.cpp +++ b/src/mame/drivers/at.cpp @@ -6032,7 +6032,7 @@ COMP( 198?, ev1806, ibm5170, 0, ibm5162, 0, at_state, init_at COMP( 198?, ev1815, ibm5170, 0, ibm5162, 0, at_state, init_at, "Everex Systems", "EV-1815", MACHINE_NOT_WORKING ) // continuous beeps (RAM not detected?) COMP( 1986, ews286, ibm5170, 0, ews286, 0, at_state, init_at, "Ericsson", "Ericsson WS286", MACHINE_NOT_WORKING ) COMP( 199?, headg2, ibm5170, 0, atturbo, 0, at_state, init_at, "<unknown>", "286 motherboards with Headland G2 chipset", MACHINE_NOT_WORKING ) -COMP( 19??, ht12a, ibm5170, 0, atturbo, 0, at_state, init_at, "unknown", "unknown 286 AT clones (HT12/A chipset)", MACHINE_NOT_WORKING ) +COMP( 19??, ht12a, ibm5170, 0, atturbo, 0, at_state, init_at, "<unknown>", "unknown 286 AT clones (HT12/A chipset)", MACHINE_NOT_WORKING ) COMP( 1985, ibm5162, ibm5170, 0, ibm5162, 0, at_state, init_at, "International Business Machines", "PC/XT-286 5162", MACHINE_NOT_WORKING ) COMP( 1984, ibm5170, 0, ibm5150, ibm5170, 0, at_state, init_at, "International Business Machines", "PC/AT 5170", MACHINE_NOT_WORKING ) COMP( 1985, ibm5170a, ibm5170, 0, ibm5170a, 0, at_state, init_at, "International Business Machines", "PC/AT 5170 8MHz", MACHINE_NOT_WORKING ) @@ -6042,11 +6042,11 @@ COMP( 198?, icldrsm40, ibm5170, 0, neat, 0, at_state, init_at COMP( 1985, k286i, ibm5170, 0, k286i, 0, at_state, init_at, "Kaypro", "286i", MACHINE_NOT_WORKING ) COMP( 199?, kma202f, ibm5170, 0, atturbo, 0, at_state, init_at, "<unknown>", "KMA-202F-12R (Winbond chipset)", MACHINE_NOT_WORKING ) COMP( 19??, kt216wb5, ibm5170, 0, ibm5162, 0, at_state, init_at, "KT Technology", "KT216WB5-HI Rev.2", MACHINE_NOT_WORKING ) -COMP( 198?, lm103s, ibm5170, 0, ibm5162, 0, at_state, init_at, "unknown", "LM-103S", MACHINE_NOT_WORKING ) +COMP( 198?, lm103s, ibm5170, 0, ibm5162, 0, at_state, init_at, "<unknown>", "LM-103S", MACHINE_NOT_WORKING ) COMP( 1987, m290, ibm5170, 0, atturbo, 0, at_state, init_at, "Olivetti", "M290", MACHINE_NOT_WORKING ) COMP( 198?, magb233, ibm5170, 0, ibm5162, 0, at_state, init_at, "Magitronic Technology", "Magitronic B233", MACHINE_NOT_WORKING ) COMP( 198?, magb236, ibm5170, 0, ibm5162, 0, at_state, init_at, "Magitronic Technology", "Magitronic B236", MACHINE_NOT_WORKING ) -COMP( 19??, mat286, ibm5170, 0, ibm5162, 0, at_state, init_at, "unknown", "MAT286 Rev.D", MACHINE_NOT_WORKING ) +COMP( 19??, mat286, ibm5170, 0, ibm5162, 0, at_state, init_at, "<unknown>", "MAT286 Rev.D", MACHINE_NOT_WORKING ) COMP( 199?, mb1212c, ibm5170, 0, atturbo, 0, at_state, init_at, "Biostar", "MB-1212C", MACHINE_NOT_WORKING ) COMP( 199?, mba009, ibm5170, 0, atturbo, 0, at_state, init_at, "<unknown>", "HLB-286 MBA-009", MACHINE_NOT_WORKING ) COMP( 199?, micral45, ibm5170, 0, micral45, 0, at_state, init_at, "Bull", "Micral 45", MACHINE_NOT_WORKING ) diff --git a/src/mame/drivers/att630.cpp b/src/mame/drivers/att630.cpp index bcedcd25c15..925893cb9cf 100644 --- a/src/mame/drivers/att630.cpp +++ b/src/mame/drivers/att630.cpp @@ -19,6 +19,7 @@ public: : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") , m_vram(*this, "vram") + , m_bram_data(*this, "bram", 0x2000, ENDIANNESS_BIG) { } void att630(machine_config &config); @@ -38,16 +39,11 @@ private: required_device<m68000_device> m_maincpu; required_shared_ptr<u16> m_vram; - - std::unique_ptr<u8[]> m_bram_data; + memory_share_creator<u8> m_bram_data; }; void att630_state::machine_start() { - m_bram_data = std::make_unique<u8[]>(0x2000); - subdevice<nvram_device>("bram")->set_base(m_bram_data.get(), 0x2000); - - save_pointer(NAME(m_bram_data), 0x2000); } u32 att630_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) @@ -88,7 +84,7 @@ void att630_state::att730_map(address_map &map) att630_map(map); map(0x040000, 0x05ffff).rom().region("maincpu", 0x40000); map(0x100000, 0x15ffff).rom().region("cart", 0); - map(0x800000, 0x83ffff).ram(); // expansion RAM + map(0x800000, 0x87ffff).ram(); // expansion RAM map(0xde0000, 0xdfffff).rom().region("starlan", 0); } diff --git a/src/mame/drivers/bfm_sc1.cpp b/src/mame/drivers/bfm_sc1.cpp index ef52ed1c28e..00092d95722 100644 --- a/src/mame/drivers/bfm_sc1.cpp +++ b/src/mame/drivers/bfm_sc1.cpp @@ -1344,10 +1344,10 @@ ROM_START( m_tppokr ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "95750899.bin", 0x00000, 0x10000, CRC(639d1d62) SHA1(80620c14bf9f953588555510fc2e6e930140923f)) - ROM_REGION( 0x20000, "adder2", 0 ) + ROM_REGION( 0x20000, "adder2:cpu", 0 ) ROM_LOAD( "tpk010.vid", 0x00000, 0x20000, CRC(ea4eddca) SHA1(5fb805d35376ec7ee8d58684e584621dbb2b2a9c)) - ROM_REGION( 0x40000, "gfx1", ROMREGION_ERASEFF ) + ROM_REGION( 0x40000, "adder2:tiles", ROMREGION_ERASEFF ) ROM_LOAD( "tpk011.chr", 0x00000, 0x20000, CRC(4dc23ad8) SHA1(8e8cc699412dbb092e16e14518f407353f477ee1)) ROM_END diff --git a/src/mame/drivers/bfm_sc2.cpp b/src/mame/drivers/bfm_sc2.cpp index e346dbe7f8e..3e94b8a4759 100644 --- a/src/mame/drivers/bfm_sc2.cpp +++ b/src/mame/drivers/bfm_sc2.cpp @@ -2485,13 +2485,13 @@ ROM_START( quintoon ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("95750206.p1", 0x00000, 0x10000, CRC(05f4bfad) SHA1(22751573f3a51a9fd2d2a75a7d1b20d78112e0bb)) - ROM_REGION( 0x20000, "adder2", 0 ) + ROM_REGION( 0x20000, "adder2:cpu", 0 ) ROM_LOAD("quinp132", 0x00000, 0x20000, CRC(63896a7f) SHA1(81aa56874a15faa3aabdfc0fc524b2e25b751f22)) ROM_REGION( 0x20000, "upd", 0 ) // using Dutch samples, need to check a UK Quintoon PCB ROM_LOAD("95001016.snd", 0x00000, 0x20000, BAD_DUMP CRC(cf097d41) SHA1(6712f93896483360256d8baffc05977c8e532ef1)) - ROM_REGION( 0x40000, "gfx1", ROMREGION_ERASEFF ) + ROM_REGION( 0x40000, "adder2:tiles", ROMREGION_ERASEFF ) ROM_LOAD("quinp233", 0x00000, 0x20000, CRC(3d4ebecf) SHA1(b339cf16797ccf7a1ec20fcebf52b6edad9a1047)) ROM_END @@ -2501,13 +2501,13 @@ ROM_START( quintono ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("95750203.bin", 0x00000, 0x10000, CRC(037ef2d0) SHA1(6958624e29629a7639a80e8929b833a8b0201833)) - ROM_REGION( 0x20000, "adder2", 0 ) + ROM_REGION( 0x20000, "adder2:cpu", 0 ) ROM_LOAD("quinp132", 0x00000, 0x20000, CRC(63896a7f) SHA1(81aa56874a15faa3aabdfc0fc524b2e25b751f22)) ROM_REGION( 0x20000, "upd", 0 ) // using Dutch samples, need to check a UK Quintoon PCB ROM_LOAD("95001016.snd", 0x00000, 0x20000, BAD_DUMP CRC(cf097d41) SHA1(6712f93896483360256d8baffc05977c8e532ef1)) - ROM_REGION( 0x40000, "gfx1", ROMREGION_ERASEFF ) + ROM_REGION( 0x40000, "adder2:tiles", ROMREGION_ERASEFF ) ROM_LOAD("quinp233", 0x00000, 0x20000, CRC(3d4ebecf) SHA1(b339cf16797ccf7a1ec20fcebf52b6edad9a1047)) ROM_END @@ -2517,13 +2517,13 @@ ROM_START( quintond ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("95751206.bin", 0x00000, 0x10000, CRC(63def707) SHA1(d016df74f4f83cd72b16f9ccbe78cc382bf056c8)) - ROM_REGION( 0x20000, "adder2", 0 ) + ROM_REGION( 0x20000, "adder2:cpu", 0 ) ROM_LOAD("quinp132", 0x00000, 0x20000, CRC(63896a7f) SHA1(81aa56874a15faa3aabdfc0fc524b2e25b751f22)) ROM_REGION( 0x20000, "upd", 0 ) // using Dutch samples, need to check a UK Quintoon PCB ROM_LOAD("95001016.snd", 0x00000, 0x20000, BAD_DUMP CRC(cf097d41) SHA1(6712f93896483360256d8baffc05977c8e532ef1)) - ROM_REGION( 0x40000, "gfx1", ROMREGION_ERASEFF ) + ROM_REGION( 0x40000, "adder2:tiles", ROMREGION_ERASEFF ) ROM_LOAD("quinp233", 0x00000, 0x20000, CRC(3d4ebecf) SHA1(b339cf16797ccf7a1ec20fcebf52b6edad9a1047)) ROM_END @@ -2533,13 +2533,13 @@ ROM_START( qntoond ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("95750243.bin", 0x00000, 0x10000, CRC(36a8dcd1) SHA1(ab21301312fbb6609f850e1cf6bcda5a2b7f66f5)) - ROM_REGION( 0x20000, "adder2", 0 ) + ROM_REGION( 0x20000, "adder2:cpu", 0 ) ROM_LOAD("95770024.vid", 0x00000, 0x20000, CRC(5bc7ac55) SHA1(b54e9684f750b73c357d41b88ca8c527258e2a10)) ROM_REGION( 0x20000, "upd", 0 ) ROM_LOAD("95001016.snd", 0x00000, 0x20000, CRC(cf097d41) SHA1(6712f93896483360256d8baffc05977c8e532ef1)) - ROM_REGION( 0x40000, "gfx1", ROMREGION_ERASEFF ) + ROM_REGION( 0x40000, "adder2:tiles", ROMREGION_ERASEFF ) ROM_LOAD("95770025.chr", 0x00000, 0x20000, CRC(f59748ea) SHA1(f0f7f914fdf72db8eb60717b95e7d027c0081339)) ROM_END @@ -2549,13 +2549,13 @@ ROM_START( qntoondo ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("95750136.bin", 0x00000, 0x10000, CRC(839ea01d) SHA1(d7f77dbaea4e87c3d782408eb50d10f44b6df5e2)) - ROM_REGION( 0x20000, "adder2", 0 ) + ROM_REGION( 0x20000, "adder2:cpu", 0 ) ROM_LOAD("95770024.vid", 0x00000, 0x20000, CRC(5bc7ac55) SHA1(b54e9684f750b73c357d41b88ca8c527258e2a10)) ROM_REGION( 0x20000, "upd", 0 ) ROM_LOAD("95001016.snd", 0x00000, 0x20000, CRC(cf097d41) SHA1(6712f93896483360256d8baffc05977c8e532ef1)) - ROM_REGION( 0x40000, "gfx1", ROMREGION_ERASEFF ) + ROM_REGION( 0x40000, "adder2:tiles", ROMREGION_ERASEFF ) ROM_LOAD("95770025.chr", 0x00000, 0x20000, CRC(f59748ea) SHA1(f0f7f914fdf72db8eb60717b95e7d027c0081339)) ROM_END @@ -2565,13 +2565,13 @@ ROM_START( gldncrwn ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("95752011.bin", 0x00000, 0x10000, CRC(54f7cca0) SHA1(835727d88113700a38060f880b4dfba2ded41487)) - ROM_REGION( 0x20000, "adder2", 0 ) + ROM_REGION( 0x20000, "adder2:cpu", 0 ) ROM_LOAD("95770117.vid", 0x00000, 0x20000, CRC(598ba7cb) SHA1(ab518d7df24b0b453ec3fcddfc4db63e0391fde7)) ROM_REGION( 0x20000, "upd", 0 ) ROM_LOAD("95001039.snd", 0x00000, 0x20000, CRC(6af26157) SHA1(9b3a85f5dd760c4430e38e2844928b74aadc7e75)) - ROM_REGION( 0x40000, "gfx1", ROMREGION_ERASEFF ) + ROM_REGION( 0x40000, "adder2:tiles", ROMREGION_ERASEFF ) ROM_LOAD("95770118.ch1", 0x00000, 0x20000, CRC(9c9ac946) SHA1(9a571e7d00f6654242aface032c2fb186ef44aba)) ROM_LOAD("95770119.ch2", 0x20000, 0x20000, CRC(9e0fdb2e) SHA1(05e8257285b0009df4fcc73e93490876358a8be8)) @@ -2583,13 +2583,13 @@ ROM_START( gldncrwnhop ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("95752007.gam", 0x00000, 0x10000, CRC(ba009ab7) SHA1(df58f5ff4e9fdf8db5931833b909fb0e4ba8e23d)) - ROM_REGION( 0x20000, "adder2", 0 ) + ROM_REGION( 0x20000, "adder2:cpu", 0 ) ROM_LOAD("95770146.vid", 0x00000, 0x20000, CRC(f3109cd5) SHA1(8da5207c07015d6f5a72397eaa6ab70800785f7f)) ROM_REGION( 0x20000, "upd", 0 ) ROM_LOAD("95770139.snd", 0x00000, 0x20000, CRC(e76ca414) SHA1(2c441e3369e374c033b5585e8f6a9c34a4c5ec0f)) - ROM_REGION( 0x40000, "gfx1", ROMREGION_ERASEFF ) + ROM_REGION( 0x40000, "adder2:tiles", ROMREGION_ERASEFF ) ROM_LOAD("95770147.chr", 0x00000, 0x20000, CRC(5a4d2b79) SHA1(c2f2f39ef6816e0da1b2ff4b723612c671c6215f)) ROM_REGION( 0x10, "proms", 0 ) @@ -2603,13 +2603,13 @@ ROM_START( paradice ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("95750615.bin", 0x00000, 0x10000, CRC(f51192e5) SHA1(a1290e32bba698006e83fd8d6075202586232929)) - ROM_REGION( 0x20000, "adder2", 0 ) + ROM_REGION( 0x20000, "adder2:cpu", 0 ) ROM_LOAD("95770084.vid", 0x00000, 0x20000, CRC(8f27bd34) SHA1(fccf7283b5c952b74258ee6e5138c1ca89384e24)) ROM_REGION( 0x20000, "upd", 0 ) ROM_LOAD("95001037.snd", 0x00000, 0x20000, CRC(82f74276) SHA1(c51c3caeb7bf514ec7a1b452c8effc4c79186062)) - ROM_REGION( 0x40000, "gfx1", ROMREGION_ERASEFF ) + ROM_REGION( 0x40000, "adder2:tiles", ROMREGION_ERASEFF ) ROM_LOAD("95770085.ch1", 0x00000, 0x20000, CRC(4d1fb82f) SHA1(054f683d1d7c884911bd2d0f85aab4c59ddf9930)) ROM_LOAD("95770086.ch2", 0x20000, 0x20000, CRC(7b566e11) SHA1(f34c82ad75a0f88204ac4ae83a00801215c46ca9)) @@ -2623,13 +2623,13 @@ ROM_START( pokio ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("95750278.bin", 0x00000, 0x10000, CRC(5124b24d) SHA1(9bc63891a8e9283c2baa64c264a5d6d1625d44b2)) - ROM_REGION( 0x20000, "adder2", 0 ) + ROM_REGION( 0x20000, "adder2:cpu", 0 ) ROM_LOAD("95770044.vid", 0x00000, 0x20000, CRC(46d7a6d8) SHA1(01f58e735621661b57c61491b3769ae99e92476a)) ROM_REGION( 0x20000, "upd", 0 ) ROM_LOAD("95001016.snd", 0x00000, 0x20000, CRC(98aaff76) SHA1(4a59cf83daf018d93f1ff7805e06309d2f3d7252)) - ROM_REGION( 0x40000, "gfx1", ROMREGION_ERASEFF ) + ROM_REGION( 0x40000, "adder2:tiles", ROMREGION_ERASEFF ) ROM_LOAD("95770045.chr", 0x00000, 0x20000, CRC(dd30da90) SHA1(b4f5a229d88613c0c7d43adf3f325c619abe38a3)) ROM_REGION( 0x10, "proms", 0 ) @@ -2642,13 +2642,13 @@ ROM_START( pyramid ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("95750898.bin", 0x00000, 0x10000, CRC(3b0df16c) SHA1(9af599fe604f86c72986aa1610d74837852e023f)) - ROM_REGION( 0x20000, "adder2", 0 ) + ROM_REGION( 0x20000, "adder2:cpu", 0 ) ROM_LOAD("95770108.vid", 0x00000, 0x20000, CRC(216ff683) SHA1(227764771600ce88c5f36bed9878e6bb9988ae8f)) ROM_REGION( 0x20000, "upd", 0 ) ROM_LOAD("95001038.snd", 0x00000, 0x20000, CRC(f885c42e) SHA1(4d79fc5ae4c58247740d78d81302bfbb43331c43)) - ROM_REGION( 0x40000, "gfx1", ROMREGION_ERASEFF ) + ROM_REGION( 0x40000, "adder2:tiles", ROMREGION_ERASEFF ) ROM_LOAD("95770106.ch1", 0x00000, 0x20000, CRC(a83c27ae) SHA1(f61ca3cdf19a933bae18c1b32a5fb0a2204dde78)) ROM_LOAD("95770107.ch2", 0x20000, 0x20000, CRC(52e59f64) SHA1(ea4828c2cfb72cd77c92c60560b4d5ee424f7dca)) @@ -2662,13 +2662,13 @@ ROM_START( slotsnl ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("95750368.bin", 0x00000, 0x10000, CRC(3a43048c) SHA1(13728e05b334cba90ea9cc51ea00c4384baa8614)) - ROM_REGION( 0x20000, "adder2", 0 ) + ROM_REGION( 0x20000, "adder2:cpu", 0 ) ROM_LOAD("video.vid", 0x00000, 0x20000, CRC(cc760208) SHA1(cc01b1e31335b26f2d0f3470d8624476b153655f)) ROM_REGION( 0x20000, "upd", 0 ) ROM_LOAD("95001029.snd", 0x00000, 0x20000, CRC(7749c724) SHA1(a87cce0c99e392f501bba44b3936a7059d682c9c)) - ROM_REGION( 0x40000, "gfx1", ROMREGION_ERASEFF ) + ROM_REGION( 0x40000, "adder2:tiles", ROMREGION_ERASEFF ) ROM_LOAD("charset.chr", 0x00000, 0x20000, CRC(ef4300b6) SHA1(a1f765f38c2f146651fc685ea6195af72465f559)) ROM_REGION( 0x10, "proms", 0 ) @@ -2681,13 +2681,13 @@ ROM_START( sltblgtk ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("95750943.bin", 0x00000, 0x10000, CRC(c9fb8153) SHA1(7c1d0660c15f05b1e0784d8322c62981fe8dc4c9)) - ROM_REGION( 0x20000, "adder2", 0 ) + ROM_REGION( 0x20000, "adder2:cpu", 0 ) ROM_LOAD("adder121.bin", 0x00000, 0x20000, CRC(cedbbf28) SHA1(559ae341b55462feea771127394a54fc65266818)) ROM_REGION( 0x20000, "upd", 0 ) ROM_LOAD("sound029.bin", 0x00000, 0x20000, CRC(7749c724) SHA1(a87cce0c99e392f501bba44b3936a7059d682c9c)) - ROM_REGION( 0x40000, "gfx1", ROMREGION_ERASEFF ) + ROM_REGION( 0x40000, "adder2:tiles", ROMREGION_ERASEFF ) ROM_LOAD("chr122.bin", 0x00000, 0x20000, CRC(a1e3bdf4) SHA1(f0cabe08dee028e2014cbf0fc3fe0806cdfa60c6)) ROM_REGION( 0x10, "proms", 0 ) @@ -2700,13 +2700,13 @@ ROM_START( sltblgp1 ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("95752008.bin", 0x00000, 0x10000, CRC(3167d3b9) SHA1(a28563f65d55c4d47f3e7fdb41e050d8a733b9bd)) - ROM_REGION( 0x20000, "adder2", 0 ) + ROM_REGION( 0x20000, "adder2:cpu", 0 ) ROM_LOAD("adder142.bin", 0x00000, 0x20000, CRC(a6f6356b) SHA1(b3d3063155ee3ea888273081f844279b6e33f7d9)) ROM_REGION( 0x20000, "upd", 0 ) ROM_LOAD("sound033.bin", 0x00000, 0x20000, CRC(bb1dfa55) SHA1(442454fccfe03e6f4c3353551cb7459e184a099d)) - ROM_REGION( 0x40000, "gfx1", ROMREGION_ERASEFF ) + ROM_REGION( 0x40000, "adder2:tiles", ROMREGION_ERASEFF ) ROM_LOAD("chr143.bin", 0x00000, 0x20000, CRC(a40e91e2) SHA1(87dc76963ea961fcfbe4f3e25df9162348d39d79)) ROM_REGION( 0x10, "proms", 0 ) @@ -2719,13 +2719,13 @@ ROM_START( sltblgpo ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("95770938.bin", 0x00000, 0x10000, CRC(7e802634) SHA1(fecf86e632546649d5e647c42a248b39fc2cf982)) - ROM_REGION( 0x20000, "adder2", 0 ) + ROM_REGION( 0x20000, "adder2:cpu", 0 ) ROM_LOAD("95770120.chr", 0x00000, 0x20000, CRC(ad505138) SHA1(67ccd8dc30e76283247ab5a62b22337ebaff74cd)) ROM_REGION( 0x20000, "upd", 0 ) ROM_LOAD("sound033.bin", 0x00000, 0x20000, CRC(bb1dfa55) SHA1(442454fccfe03e6f4c3353551cb7459e184a099d)) - ROM_REGION( 0x40000, "gfx1", ROMREGION_ERASEFF ) + ROM_REGION( 0x40000, "adder2:tiles", ROMREGION_ERASEFF ) ROM_LOAD("95770110.add", 0x00000, 0x20000, CRC(64b03284) SHA1(4b1c17b75e449c9762bb949d7cde0694a3aaabeb)) ROM_REGION( 0x10, "proms", 0 ) diff --git a/src/mame/drivers/brkthru.cpp b/src/mame/drivers/brkthru.cpp index 07c4f573647..451d4f75568 100644 --- a/src/mame/drivers/brkthru.cpp +++ b/src/mame/drivers/brkthru.cpp @@ -63,7 +63,7 @@ Data East, 1986 | separation = solder -upper pcb - 3002A +upper PCB - 3002A |-------------------------------------------------| |t |-------| | |o |---------| |YM2203C| | @@ -103,7 +103,7 @@ Notes: -lower pcb - 3002B +lower PCB - 3002B |-----------------------------------------------------| |t |-----| | |o |------| |epr11| | @@ -142,17 +142,297 @@ buttons down after the game has started then pressing F3 to reset the game. ***************************************************************************/ #include "emu.h" -#include "includes/brkthru.h" #include "cpu/m6809/m6809.h" -#include "sound/ymopn.h" +#include "machine/gen_latch.h" #include "sound/ymopl.h" +#include "sound/ymopn.h" + +#include "emupal.h" #include "screen.h" #include "speaker.h" +#include "tilemap.h" + + +namespace { + +class brkthru_state : public driver_device +{ +public: + brkthru_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_fg_videoram(*this, "fg_videoram"), + m_videoram(*this, "videoram"), + m_spriteram(*this, "spriteram"), + m_mainbank(*this, "mainbank"), + m_maincpu(*this, "maincpu"), + m_audiocpu(*this, "audiocpu"), + m_gfxdecode(*this, "gfxdecode"), + m_palette(*this, "palette") + { } + + void brkthru(machine_config &config); + void darwin(machine_config &config); + + DECLARE_INPUT_CHANGED_MEMBER(coin_inserted); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + +private: + // memory pointers + required_shared_ptr<uint8_t> m_fg_videoram; + required_shared_ptr<uint8_t> m_videoram; + required_shared_ptr<uint8_t> m_spriteram; + required_memory_bank m_mainbank; + + // video-related + tilemap_t *m_fg_tilemap = nullptr; + tilemap_t *m_bg_tilemap = nullptr; + uint16_t m_bgscroll = 0; + uint8_t m_bgbasecolor = 0; + uint8_t m_flipscreen = 0; + + // devices + required_device<cpu_device> m_maincpu; + required_device<cpu_device> m_audiocpu; + required_device<gfxdecode_device> m_gfxdecode; + required_device<palette_device> m_palette; + + uint8_t m_nmi_mask = 0U; + + void brkthru_1803_w(uint8_t data); + void darwin_0803_w(uint8_t data); + void bgram_w(offs_t offset, uint8_t data); + void fgram_w(offs_t offset, uint8_t data); + void _1800_w(offs_t offset, uint8_t data); + TILE_GET_INFO_MEMBER(get_bg_tile_info); + TILE_GET_INFO_MEMBER(get_fg_tile_info); + void palette(palette_device &palette) const; + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + DECLARE_WRITE_LINE_MEMBER(vblank_irq); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int prio); + + void brkthru_main_map(address_map &map); + void darwin_main_map(address_map &map); + void sound_map(address_map &map); +}; + + +// video + + +/*************************************************************************** + + Convert the color PROMs into a more useable format. + + Break Thru has one 256x8 and one 256x4 palette PROMs. + I don't know for sure how the palette PROMs are connected to the RGB + output, but it's probably the usual: + + bit 7 -- 220 ohm resistor -- GREEN + -- 470 ohm resistor -- GREEN + -- 1 kohm resistor -- GREEN + -- 2.2kohm resistor -- GREEN + -- 220 ohm resistor -- RED + -- 470 ohm resistor -- RED + -- 1 kohm resistor -- RED + bit 0 -- 2.2kohm resistor -- RED + + bit 3 -- 220 ohm resistor -- BLUE + -- 470 ohm resistor -- BLUE + -- 1 kohm resistor -- BLUE + bit 0 -- 2.2kohm resistor -- BLUE + +***************************************************************************/ + +void brkthru_state::palette(palette_device &palette) const +{ + uint8_t const *color_prom = memregion("proms")->base(); + + for (int i = 0; i < palette.entries(); i++) + { + int bit0 = (color_prom[0] >> 0) & 0x01; + int bit1 = (color_prom[0] >> 1) & 0x01; + int bit2 = (color_prom[0] >> 2) & 0x01; + int bit3 = (color_prom[0] >> 3) & 0x01; + int const r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; + bit0 = (color_prom[0] >> 4) & 0x01; + bit1 = (color_prom[0] >> 5) & 0x01; + bit2 = (color_prom[0] >> 6) & 0x01; + bit3 = (color_prom[0] >> 7) & 0x01; + int const g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; + bit0 = (color_prom[palette.entries()] >> 0) & 0x01; + bit1 = (color_prom[palette.entries()] >> 1) & 0x01; + bit2 = (color_prom[palette.entries()] >> 2) & 0x01; + bit3 = (color_prom[palette.entries()] >> 3) & 0x01; + int const b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; + + palette.set_pen_color(i, rgb_t(r, g, b)); + + color_prom++; + } +} + + + +/*************************************************************************** + + Start the video hardware emulation. + +***************************************************************************/ + +TILE_GET_INFO_MEMBER(brkthru_state::get_bg_tile_info) +{ + /* BG RAM format + 0 1 + ---- -c-- ---- ---- = Color + ---- --xx xxxx xxxx = Code + */ + + int code = (m_videoram[tile_index * 2] | ((m_videoram[tile_index * 2 + 1]) << 8)) & 0x3ff; + int region = 1 + (code >> 7); + int colour = m_bgbasecolor + ((m_videoram[tile_index * 2 + 1] & 0x04) >> 2); + + tileinfo.set(region, code & 0x7f, colour,0); +} + +void brkthru_state::bgram_w(offs_t offset, uint8_t data) +{ + m_videoram[offset] = data; + m_bg_tilemap->mark_tile_dirty(offset / 2); +} + + +TILE_GET_INFO_MEMBER(brkthru_state::get_fg_tile_info) +{ + uint8_t code = m_fg_videoram[tile_index]; + tileinfo.set(0, code, 0, 0); +} + +void brkthru_state::fgram_w(offs_t offset, uint8_t data) +{ + m_fg_videoram[offset] = data; + m_fg_tilemap->mark_tile_dirty(offset); +} + +void brkthru_state::video_start() +{ + m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(brkthru_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(brkthru_state::get_bg_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 32, 16); + + m_fg_tilemap->set_transparent_pen(0); + m_bg_tilemap->set_transparent_pen(0); +} + + +void brkthru_state::_1800_w(offs_t offset, uint8_t data) +{ + if (offset == 0) // low 8 bits of scroll + m_bgscroll = (m_bgscroll & 0x100) | data; + else if (offset == 1) + { + // bit 0-2 = ROM bank select + m_mainbank->set_entry(data & 0x07); + + // bit 3-5 = background tiles color code + if (((data & 0x38) >> 2) != m_bgbasecolor) + { + m_bgbasecolor = (data & 0x38) >> 2; + m_bg_tilemap->mark_all_dirty(); + } + + // bit 6 = screen flip + if (m_flipscreen != (data & 0x40)) + { + m_flipscreen = data & 0x40; + m_bg_tilemap->set_flip(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); + m_fg_tilemap->set_flip(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); + + } + + // bit 7 = high bit of scroll + m_bgscroll = (m_bgscroll & 0xff) | ((data & 0x80) << 1); + } +} + +void brkthru_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int prio) +{ + // Draw the sprites. Note that it is important to draw them exactly in this order, to have the correct priorities. + + /* Sprite RAM format + 0 1 2 3 + ccc- ---- ---- ---- ---- ---- ---- ---- = Color + ---d ---- ---- ---- ---- ---- ---- ---- = Double Size + ---- p--- ---- ---- ---- ---- ---- ---- = Priority + ---- -bb- ---- ---- ---- ---- ---- ---- = Bank + ---- ---e ---- ---- ---- ---- ---- ---- = Enable/Disable + ---- ---- ssss ssss ---- ---- ---- ---- = Sprite code + ---- ---- ---- ---- yyyy yyyy ---- ---- = Y position + ---- ---- ---- ---- ---- ---- xxxx xxxx = X position + */ + + for (int offs = 0; offs < m_spriteram.bytes(); offs += 4) + { + if ((m_spriteram[offs] & 0x09) == prio) // Enable && Low Priority + { + int sx = 240 - m_spriteram[offs + 3]; + if (sx < -7) + sx += 256; + + int sy = 240 - m_spriteram[offs + 2]; + int code = m_spriteram[offs + 1] + 128 * (m_spriteram[offs] & 0x06); + int color = (m_spriteram[offs] & 0xe0) >> 5; + if (m_flipscreen) + { + sx = 240 - sx; + sy = 240 - sy; + } + + if (m_spriteram[offs] & 0x10) // double height + { + m_gfxdecode->gfx(9)->transpen(bitmap, cliprect, code & ~1, color, m_flipscreen, m_flipscreen, sx, m_flipscreen ? sy + 16 : sy - 16, 0); + m_gfxdecode->gfx(9)->transpen(bitmap, cliprect, code | 1, color, m_flipscreen, m_flipscreen, sx, sy, 0); + + // redraw with wraparound + m_gfxdecode->gfx(9)->transpen(bitmap, cliprect, code & ~1, color, m_flipscreen, m_flipscreen, sx,(m_flipscreen ? sy + 16 : sy - 16) + 256, 0); + m_gfxdecode->gfx(9)->transpen(bitmap, cliprect, code | 1, color, m_flipscreen, m_flipscreen, sx, sy + 256, 0); + } + else + { + m_gfxdecode->gfx(9)->transpen(bitmap, cliprect, code, color, m_flipscreen, m_flipscreen, sx, sy, 0); + + // redraw with wraparound + m_gfxdecode->gfx(9)->transpen(bitmap, cliprect, code, color, m_flipscreen, m_flipscreen, sx, sy + 256, 0); + } + } + } +} + +uint32_t brkthru_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + m_bg_tilemap->set_scrollx(0, m_bgscroll); + m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); + // low priority sprites + draw_sprites(bitmap, cliprect, 0x01); -#define MASTER_CLOCK XTAL(12'000'000) + // draw background over low priority sprites + m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + // high priority sprites + draw_sprites(bitmap, cliprect, 0x09); + + // fg layer + m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + + return 0; +} + + +// machine /************************************* * @@ -162,31 +442,31 @@ buttons down after the game has started then pressing F3 to reset the game. void brkthru_state::brkthru_1803_w(uint8_t data) { - /* bit 0 = NMI enable */ + // bit 0 = NMI enable m_nmi_mask = ~data & 1; - if(data & 2) + if (data & 2) m_maincpu->set_input_line(0, CLEAR_LINE); - /* bit 1 = ? maybe IRQ acknowledge */ + // bit 1 = ? maybe IRQ acknowledge } void brkthru_state::darwin_0803_w(uint8_t data) { - /* bit 0 = NMI enable */ + // bit 0 = NMI enable m_nmi_mask = data & 1; - logerror("0803 %02X\n",data); + logerror("0803 %02X\n", data); - if(data & 2) + if (data & 2) m_maincpu->set_input_line(0, CLEAR_LINE); - /* bit 1 = ? maybe IRQ acknowledge */ + // bit 1 = ? maybe IRQ acknowledge } INPUT_CHANGED_MEMBER(brkthru_state::coin_inserted) { - /* coin insertion causes an IRQ */ + // coin insertion causes an IRQ if (oldval) m_maincpu->set_input_line(0, ASSERT_LINE); } @@ -198,40 +478,40 @@ INPUT_CHANGED_MEMBER(brkthru_state::coin_inserted) * *************************************/ -void brkthru_state::brkthru_map(address_map &map) +void brkthru_state::brkthru_main_map(address_map &map) { - map(0x0000, 0x03ff).ram().w(FUNC(brkthru_state::brkthru_fgram_w)).share("fg_videoram"); + map(0x0000, 0x03ff).ram().w(FUNC(brkthru_state::fgram_w)).share(m_fg_videoram); map(0x0400, 0x0bff).ram(); - map(0x0c00, 0x0fff).ram().w(FUNC(brkthru_state::brkthru_bgram_w)).share("videoram"); - map(0x1000, 0x10ff).ram().share("spriteram"); + map(0x0c00, 0x0fff).ram().w(FUNC(brkthru_state::bgram_w)).share(m_videoram); + map(0x1000, 0x10ff).ram().share(m_spriteram); map(0x1100, 0x17ff).ram(); map(0x1800, 0x1800).portr("P1"); map(0x1801, 0x1801).portr("P2"); map(0x1802, 0x1802).portr("DSW1"); map(0x1803, 0x1803).portr("DSW2_COIN"); - map(0x1800, 0x1801).w(FUNC(brkthru_state::brkthru_1800_w)); /* bg scroll and color, ROM bank selection, flip screen */ - map(0x1802, 0x1802).w(m_soundlatch, FUNC(generic_latch_8_device::write)); - map(0x1803, 0x1803).w(FUNC(brkthru_state::brkthru_1803_w)); /* NMI enable, + ? */ - map(0x2000, 0x3fff).bankr("bank1"); + map(0x1800, 0x1801).w(FUNC(brkthru_state::_1800_w)); // bg scroll and color, ROM bank selection, flip screen + map(0x1802, 0x1802).w("soundlatch", FUNC(generic_latch_8_device::write)); + map(0x1803, 0x1803).w(FUNC(brkthru_state::brkthru_1803_w)); // NMI enable, + ? + map(0x2000, 0x3fff).bankr(m_mainbank); map(0x4000, 0xffff).rom(); } -/* same as brktrhu, but xor 0x1000 below 8k */ -void brkthru_state::darwin_map(address_map &map) +// same as brktrhu, but XOR 0x1000 below 8k +void brkthru_state::darwin_main_map(address_map &map) { - map(0x1000, 0x13ff).ram().w(FUNC(brkthru_state::brkthru_fgram_w)).share("fg_videoram"); + map(0x1000, 0x13ff).ram().w(FUNC(brkthru_state::fgram_w)).share(m_fg_videoram); map(0x1400, 0x1bff).ram(); - map(0x1c00, 0x1fff).ram().w(FUNC(brkthru_state::brkthru_bgram_w)).share("videoram"); - map(0x0000, 0x00ff).ram().share("spriteram"); - map(0x0100, 0x01ff).nopw(); /*tidyup, nothing really here?*/ + map(0x1c00, 0x1fff).ram().w(FUNC(brkthru_state::bgram_w)).share(m_videoram); + map(0x0000, 0x00ff).ram().share(m_spriteram); + map(0x0100, 0x01ff).nopw(); // tidy up, nothing really here? map(0x0800, 0x0800).portr("P1"); map(0x0801, 0x0801).portr("P2"); map(0x0802, 0x0802).portr("DSW1"); map(0x0803, 0x0803).portr("DSW2_COIN"); - map(0x0800, 0x0801).w(FUNC(brkthru_state::brkthru_1800_w)); /* bg scroll and color, ROM bank selection, flip screen */ - map(0x0802, 0x0802).w(m_soundlatch, FUNC(generic_latch_8_device::write)); - map(0x0803, 0x0803).w(FUNC(brkthru_state::darwin_0803_w)); /* NMI enable, + ? */ - map(0x2000, 0x3fff).bankr("bank1"); + map(0x0800, 0x0801).w(FUNC(brkthru_state::_1800_w)); // bg scroll and color, ROM bank selection, flip screen + map(0x0802, 0x0802).w("soundlatch", FUNC(generic_latch_8_device::write)); + map(0x0803, 0x0803).w(FUNC(brkthru_state::darwin_0803_w)); // NMI enable, + ? + map(0x2000, 0x3fff).bankr(m_mainbank); map(0x4000, 0xffff).rom(); } @@ -240,7 +520,7 @@ void brkthru_state::sound_map(address_map &map) { map(0x0000, 0x1fff).ram(); map(0x2000, 0x2001).w("ym2", FUNC(ym3526_device::write)); - map(0x4000, 0x4000).r(m_soundlatch, FUNC(generic_latch_8_device::read)); + map(0x4000, 0x4000).r("soundlatch", FUNC(generic_latch_8_device::read)); map(0x6000, 0x6001).rw("ym1", FUNC(ym2203_device::read), FUNC(ym2203_device::write)); map(0x8000, 0xffff).rom(); } @@ -271,7 +551,7 @@ static INPUT_PORTS_START( brkthru ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") /* used only by the self test */ + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") // used only by the self test PORT_START("DSW1") PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2") @@ -308,17 +588,17 @@ static INPUT_PORTS_START( brkthru ) PORT_DIPSETTING( 0x04, "10000/20000 Points" ) PORT_DIPSETTING( 0x0c, "20000/30000 Points" ) PORT_DIPSETTING( 0x08, "20000/40000 Points" ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:5") /* Manual says ALWAYS OFF */ + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:5") // Manual says ALWAYS OFF PORT_DIPSETTING( 0x00, DEF_STR( No ) ) PORT_DIPSETTING( 0x10, DEF_STR( Yes ) ) - /* According to the manual, bit 5 should control Flip Screen */ + // According to the manual, bit 5 should control Flip Screen // PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:6") // PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) // PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - /* SW2:7,8 ALWAYS OFF according to the manual */ - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, brkthru_state,coin_inserted, 0) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED_MEMBER(DEVICE_SELF, brkthru_state,coin_inserted, 0) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, brkthru_state,coin_inserted, 0) + // SW2:7,8 ALWAYS OFF according to the manual + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, brkthru_state, coin_inserted, 0) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED_MEMBER(DEVICE_SELF, brkthru_state, coin_inserted, 0) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, brkthru_state, coin_inserted, 0) INPUT_PORTS_END static INPUT_PORTS_START( brkthruj ) @@ -332,16 +612,16 @@ static INPUT_PORTS_START( darwin ) PORT_INCLUDE( brkthru ) PORT_MODIFY("DSW1") - PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW1:5" ) /* Manual says must be OFF */ + PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW1:5" ) // Manual says must be OFF PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:6") PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) PORT_DIPSETTING( 0x20, DEF_STR( Cocktail ) ) PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:7") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x40, DEF_STR( On ) ) - PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW1:8" ) /* Manual says must be OFF */ + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW1:8" ) // Manual says must be OFF - PORT_MODIFY("DSW2_COIN") /* modified by Shingo Suzuki 1999/11/02 */ + PORT_MODIFY("DSW2_COIN") // modified by Shingo Suzuki 1999/11/02 PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1") PORT_DIPSETTING( 0x01, "3" ) PORT_DIPSETTING( 0x00, "5" ) @@ -353,14 +633,14 @@ static INPUT_PORTS_START( darwin ) PORT_DIPSETTING( 0x08, DEF_STR( Medium ) ) PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) - /* According to the manual, bit 5 should control Flip Screen */ + // According to the manual, bit 5 should control Flip Screen // PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:6") // PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) // PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - /* SW2:5,7,8 ALWAYS OFF according to the manual */ - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, brkthru_state,coin_inserted, 0) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED_MEMBER(DEVICE_SELF, brkthru_state,coin_inserted, 0) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, brkthru_state,coin_inserted, 0) + // SW2:5,7,8 ALWAYS OFF according to the manual + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, brkthru_state, coin_inserted, 0) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED_MEMBER(DEVICE_SELF, brkthru_state, coin_inserted, 0) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, brkthru_state, coin_inserted, 0) INPUT_PORTS_END @@ -372,65 +652,65 @@ INPUT_PORTS_END static const gfx_layout charlayout = { - 8,8, /* 8*8 chars */ - 256, /* 256 characters */ - 3, /* 3 bits per pixel */ - { 512*8*8+4, 0, 4 }, /* plane offset */ + 8,8, // 8*8 chars + 256, // 256 characters + 3, // 3 bits per pixel + { 512*8*8+4, 0, 4 }, // plane offset { 256*8*8+0, 256*8*8+1, 256*8*8+2, 256*8*8+3, 0, 1, 2, 3 }, { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, - 8*8 /* every char takes 8 consecutive bytes */ + 8*8 // every char takes 8 consecutive bytes }; static const gfx_layout tilelayout1 = { - 16,16, /* 16*16 tiles */ - 128, /* 128 tiles */ - 3, /* 3 bits per pixel */ - { 0x4000*8+4, 0, 4 }, /* plane offset */ + 16,16, // 16*16 tiles + 128, // 128 tiles + 3, // 3 bits per pixel + { 0x4000*8+4, 0, 4 }, // plane offset { 0, 1, 2, 3, 1024*8*8+0, 1024*8*8+1, 1024*8*8+2, 1024*8*8+3, 16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+1024*8*8+0, 16*8+1024*8*8+1, 16*8+1024*8*8+2, 16*8+1024*8*8+3 }, { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 }, - 32*8 /* every tile takes 32 consecutive bytes */ + 32*8 // every tile takes 32 consecutive bytes }; static const gfx_layout tilelayout2 = { - 16,16, /* 16*16 tiles */ - 128, /* 128 tiles */ - 3, /* 3 bits per pixel */ - { 0x3000*8+0, 0, 4 }, /* plane offset */ + 16,16, // 16*16 tiles + 128, // 128 tiles + 3, // 3 bits per pixel + { 0x3000*8+0, 0, 4 }, // plane offset { 0, 1, 2, 3, 1024*8*8+0, 1024*8*8+1, 1024*8*8+2, 1024*8*8+3, 16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+1024*8*8+0, 16*8+1024*8*8+1, 16*8+1024*8*8+2, 16*8+1024*8*8+3 }, { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 }, - 32*8 /* every tile takes 32 consecutive bytes */ + 32*8 // every tile takes 32 consecutive bytes }; static const gfx_layout spritelayout = { - 16,16, /* 16*16 sprites */ - 1024, /* 1024 sprites */ - 3, /* 3 bits per pixel */ - { 2*1024*32*8, 1024*32*8, 0 }, /* plane offset */ + 16,16, // 16*16 sprites + 1024, // 1024 sprites + 3, // 3 bits per pixel + { 2*1024*32*8, 1024*32*8, 0 }, // plane offset { 16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+4, 16*8+5, 16*8+6, 16*8+7, 0, 1, 2, 3, 4, 5, 6, 7 }, { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 }, - 32*8 /* every sprite takes 32 consecutive bytes */ + 32*8 // every sprite takes 32 consecutive bytes }; static GFXDECODE_START( gfx_brkthru ) - GFXDECODE_ENTRY( "gfx1", 0x00000, charlayout, 0x00, 1 ) /* use colors 0x00-0x07 */ - GFXDECODE_ENTRY( "gfx2", 0x00000, tilelayout1, 0x80, 16 ) /* use colors 0x80-0xff */ - GFXDECODE_ENTRY( "gfx2", 0x01000, tilelayout2, 0x80, 16 ) - GFXDECODE_ENTRY( "gfx2", 0x08000, tilelayout1, 0x80, 16 ) - GFXDECODE_ENTRY( "gfx2", 0x09000, tilelayout2, 0x80, 16 ) - GFXDECODE_ENTRY( "gfx2", 0x10000, tilelayout1, 0x80, 16 ) - GFXDECODE_ENTRY( "gfx2", 0x11000, tilelayout2, 0x80, 16 ) - GFXDECODE_ENTRY( "gfx2", 0x18000, tilelayout1, 0x80, 16 ) - GFXDECODE_ENTRY( "gfx2", 0x19000, tilelayout2, 0x80, 16 ) - GFXDECODE_ENTRY( "gfx3", 0x00000, spritelayout, 0x40, 8 ) /* use colors 0x40-0x7f */ + GFXDECODE_ENTRY( "chars", 0x00000, charlayout, 0x00, 1 ) // use colors 0x00-0x07 + GFXDECODE_ENTRY( "tiles", 0x00000, tilelayout1, 0x80, 16 ) // use colors 0x80-0xff + GFXDECODE_ENTRY( "tiles", 0x01000, tilelayout2, 0x80, 16 ) + GFXDECODE_ENTRY( "tiles", 0x08000, tilelayout1, 0x80, 16 ) + GFXDECODE_ENTRY( "tiles", 0x09000, tilelayout2, 0x80, 16 ) + GFXDECODE_ENTRY( "tiles", 0x10000, tilelayout1, 0x80, 16 ) + GFXDECODE_ENTRY( "tiles", 0x11000, tilelayout2, 0x80, 16 ) + GFXDECODE_ENTRY( "tiles", 0x18000, tilelayout1, 0x80, 16 ) + GFXDECODE_ENTRY( "tiles", 0x19000, tilelayout2, 0x80, 16 ) + GFXDECODE_ENTRY( "sprites", 0x00000, spritelayout, 0x40, 8 ) // use colors 0x40-0x7f GFXDECODE_END @@ -443,6 +723,9 @@ GFXDECODE_END void brkthru_state::machine_start() { + uint8_t *rom = memregion("maincpu")->base(); + m_mainbank->configure_entries(0, 8, &rom[0x10000], 0x2000); + save_item(NAME(m_bgscroll)); save_item(NAME(m_bgbasecolor)); save_item(NAME(m_flipscreen)); @@ -465,57 +748,21 @@ WRITE_LINE_MEMBER(brkthru_state::vblank_irq) void brkthru_state::brkthru(machine_config &config) { - /* basic machine hardware */ - MC6809E(config, m_maincpu, MASTER_CLOCK/8); /* 1.5 MHz ? */ - m_maincpu->set_addrmap(AS_PROGRAM, &brkthru_state::brkthru_map); - - MC6809(config, m_audiocpu, MASTER_CLOCK/2); /* 1.5 MHz ? */ - m_audiocpu->set_addrmap(AS_PROGRAM, &brkthru_state::sound_map); + static constexpr XTAL MASTER_CLOCK = XTAL(12'000'000); - /* video hardware */ - GFXDECODE(config, m_gfxdecode, m_palette, gfx_brkthru); - PALETTE(config, m_palette, FUNC(brkthru_state::brkthru_palette), 256); - - /* not sure; assuming to be the same as darwin */ - screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_raw(MASTER_CLOCK/2, 384, 8, 248, 272, 8, 248); - screen.set_screen_update(FUNC(brkthru_state::screen_update_brkthru)); - screen.set_palette(m_palette); - screen.screen_vblank().set(FUNC(brkthru_state::vblank_irq)); - - /* sound hardware */ - SPEAKER(config, "mono").front_center(); - - GENERIC_LATCH_8(config, m_soundlatch); - m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI); - - ym2203_device &ym1(YM2203(config, "ym1", MASTER_CLOCK/8)); - ym1.add_route(0, "mono", 0.10); - ym1.add_route(1, "mono", 0.10); - ym1.add_route(2, "mono", 0.10); - ym1.add_route(3, "mono", 0.50); - - ym3526_device &ym2(YM3526(config, "ym2", MASTER_CLOCK/4)); - ym2.irq_handler().set_inputline(m_audiocpu, M6809_IRQ_LINE); - ym2.add_route(ALL_OUTPUTS, "mono", 1.0); -} + // basic machine hardware + MC6809E(config, m_maincpu, MASTER_CLOCK / 8); // 1.5 MHz ? + m_maincpu->set_addrmap(AS_PROGRAM, &brkthru_state::brkthru_main_map); -void brkthru_state::darwin(machine_config &config) -{ - /* basic machine hardware */ - MC6809E(config, m_maincpu, MASTER_CLOCK/8); /* 1.5 MHz ? */ - m_maincpu->set_addrmap(AS_PROGRAM, &brkthru_state::darwin_map); - - MC6809(config, m_audiocpu, MASTER_CLOCK/2); /* 1.5 MHz ? */ + MC6809(config, m_audiocpu, MASTER_CLOCK / 2); // 1.5 MHz ? m_audiocpu->set_addrmap(AS_PROGRAM, &brkthru_state::sound_map); - /* video hardware */ + // video hardware GFXDECODE(config, m_gfxdecode, m_palette, gfx_brkthru); - - PALETTE(config, m_palette, FUNC(brkthru_state::brkthru_palette), 256); + PALETTE(config, m_palette, FUNC(brkthru_state::palette), 256); screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_raw(MASTER_CLOCK/2, 384, 8, 248, 272, 8, 248); + screen.set_raw(MASTER_CLOCK / 2, 384, 8, 248, 272, 8, 248); // verified for darwin, not 100% sure it's the same for brkthru /* frames per second, vblank duration Horizontal video frequency: HSync = Dot Clock / Horizontal Frame Length @@ -528,27 +775,33 @@ void brkthru_state::darwin(machine_config &config) = 15.625kHz / (240 + 32) = 57.444855Hz tuned by Shingo SUZUKI(VSyncMAME Project) 2000/10/19 */ - screen.set_screen_update(FUNC(brkthru_state::screen_update_brkthru)); + screen.set_screen_update(FUNC(brkthru_state::screen_update)); screen.set_palette(m_palette); screen.screen_vblank().set(FUNC(brkthru_state::vblank_irq)); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); - GENERIC_LATCH_8(config, m_soundlatch); - m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI); + GENERIC_LATCH_8(config, "soundlatch").data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI); - ym2203_device &ym1(YM2203(config, "ym1", MASTER_CLOCK/8)); + ym2203_device &ym1(YM2203(config, "ym1", MASTER_CLOCK / 8)); ym1.add_route(0, "mono", 0.10); ym1.add_route(1, "mono", 0.10); ym1.add_route(2, "mono", 0.10); ym1.add_route(3, "mono", 0.50); - ym3526_device &ym2(YM3526(config, "ym2", MASTER_CLOCK/4)); + ym3526_device &ym2(YM3526(config, "ym2", MASTER_CLOCK / 4)); ym2.irq_handler().set_inputline(m_audiocpu, M6809_IRQ_LINE); ym2.add_route(ALL_OUTPUTS, "mono", 1.0); } +void brkthru_state::darwin(machine_config &config) +{ + brkthru(config); + + m_maincpu->set_addrmap(AS_PROGRAM, &brkthru_state::darwin_main_map); +} + /************************************* @@ -558,80 +811,78 @@ void brkthru_state::darwin(machine_config &config) *************************************/ ROM_START( brkthru ) - ROM_REGION( 0x20000, "maincpu", 0 ) /* 64k for main CPU + 64k for banked ROMs */ + ROM_REGION( 0x20000, "maincpu", 0 ) ROM_LOAD( "brkthru.1", 0x04000, 0x4000, CRC(cfb4265f) SHA1(4cd748fa06fd2727de1694196912d605672d4883) ) ROM_LOAD( "brkthru.2", 0x08000, 0x8000, CRC(fa8246d9) SHA1(d6da03b2a3d8a83411191351ee110b89352a3ead) ) ROM_LOAD( "brkthru.4", 0x10000, 0x8000, CRC(8cabf252) SHA1(45e8847b2e6b278989f67e0b27b827a9b3b92581) ) ROM_LOAD( "brkthru.3", 0x18000, 0x8000, CRC(2f2c40c2) SHA1(fcb78941453520a3a07f272127dae7c2cc1999ea) ) - ROM_REGION( 0x02000, "gfx1", 0 ) - ROM_LOAD( "brkthru.12", 0x00000, 0x2000, CRC(58c0b29b) SHA1(9dc075f8afae7e8fe164a9fe325e9948cdc7e4bb) ) /* characters */ - - ROM_REGION( 0x20000, "gfx2", 0 ) - /* background */ - /* we do a lot of scatter loading here, to place the data in a format */ - /* which can be decoded by MAME's standard functions */ - ROM_LOAD( "brkthru.7", 0x00000, 0x4000, CRC(920cc56a) SHA1(c75806691073f1f3bd54dcaca4c14155ecf4471d) ) /* bitplanes 1,2 for bank 1,2 */ - ROM_CONTINUE( 0x08000, 0x4000 ) /* bitplanes 1,2 for bank 3,4 */ - ROM_LOAD( "brkthru.6", 0x10000, 0x4000, CRC(fd3cee40) SHA1(3308b96bb69e0fa6dffbdff296273fafa16d5e70) ) /* bitplanes 1,2 for bank 5,6 */ - ROM_CONTINUE( 0x18000, 0x4000 ) /* bitplanes 1,2 for bank 7,8 */ - ROM_LOAD( "brkthru.8", 0x04000, 0x1000, CRC(f67ee64e) SHA1(75634bd481ae44b8aa02acb4f9b4d7ff973a4c71) ) /* bitplane 3 for bank 1,2 */ + ROM_REGION( 0x02000, "chars", 0 ) + ROM_LOAD( "brkthru.12", 0x00000, 0x2000, CRC(58c0b29b) SHA1(9dc075f8afae7e8fe164a9fe325e9948cdc7e4bb) ) + + ROM_REGION( 0x20000, "tiles", 0 ) + // background + // we do a lot of scatter loading here, to place the data in a format which can be decoded by MAME's standard functions + ROM_LOAD( "brkthru.7", 0x00000, 0x4000, CRC(920cc56a) SHA1(c75806691073f1f3bd54dcaca4c14155ecf4471d) ) // bitplanes 1,2 for bank 1,2 + ROM_CONTINUE( 0x08000, 0x4000 ) // bitplanes 1,2 for bank 3,4 + ROM_LOAD( "brkthru.6", 0x10000, 0x4000, CRC(fd3cee40) SHA1(3308b96bb69e0fa6dffbdff296273fafa16d5e70) ) // bitplanes 1,2 for bank 5,6 + ROM_CONTINUE( 0x18000, 0x4000 ) // bitplanes 1,2 for bank 7,8 + ROM_LOAD( "brkthru.8", 0x04000, 0x1000, CRC(f67ee64e) SHA1(75634bd481ae44b8aa02acb4f9b4d7ff973a4c71) ) // bitplane 3 for bank 1,2 ROM_CONTINUE( 0x06000, 0x1000 ) - ROM_CONTINUE( 0x0c000, 0x1000 ) /* bitplane 3 for bank 3,4 */ + ROM_CONTINUE( 0x0c000, 0x1000 ) // bitplane 3 for bank 3,4 ROM_CONTINUE( 0x0e000, 0x1000 ) - ROM_CONTINUE( 0x14000, 0x1000 ) /* bitplane 3 for bank 5,6 */ + ROM_CONTINUE( 0x14000, 0x1000 ) // bitplane 3 for bank 5,6 ROM_CONTINUE( 0x16000, 0x1000 ) - ROM_CONTINUE( 0x1c000, 0x1000 ) /* bitplane 3 for bank 7,8 */ + ROM_CONTINUE( 0x1c000, 0x1000 ) // bitplane 3 for bank 7,8 ROM_CONTINUE( 0x1e000, 0x1000 ) - ROM_REGION( 0x18000, "gfx3", 0 ) - ROM_LOAD( "brkthru.9", 0x00000, 0x8000, CRC(f54e50a7) SHA1(eccf4d859c26944271ec6586644b4730a72851fd) ) /* sprites */ + ROM_REGION( 0x18000, "sprites", 0 ) + ROM_LOAD( "brkthru.9", 0x00000, 0x8000, CRC(f54e50a7) SHA1(eccf4d859c26944271ec6586644b4730a72851fd) ) ROM_LOAD( "brkthru.10", 0x08000, 0x8000, CRC(fd156945) SHA1(a0575a4164217e63317886176ab7e59d255fc771) ) ROM_LOAD( "brkthru.11", 0x10000, 0x8000, CRC(c152a99b) SHA1(f96133aa01219eda357b9e906bd9577dbfe359c0) ) ROM_REGION( 0x0200, "proms", 0 ) - ROM_LOAD( "brkthru.13", 0x0000, 0x0100, CRC(aae44269) SHA1(7c66aeb93577104109d264ee8b848254256c81eb) ) /* red and green component */ - ROM_LOAD( "brkthru.14", 0x0100, 0x0100, CRC(f2d4822a) SHA1(f535e91b87ff01f2a73662856fd3f72907ca62e9) ) /* blue component */ + ROM_LOAD( "brkthru.13", 0x0000, 0x0100, CRC(aae44269) SHA1(7c66aeb93577104109d264ee8b848254256c81eb) ) // red and green component + ROM_LOAD( "brkthru.14", 0x0100, 0x0100, CRC(f2d4822a) SHA1(f535e91b87ff01f2a73662856fd3f72907ca62e9) ) // blue component ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "brkthru.5", 0x8000, 0x8000, CRC(c309435f) SHA1(82914004c2b169a7c31aa49af83a699ebbc7b33f) ) ROM_END ROM_START( brkthruj ) - ROM_REGION( 0x20000, "maincpu", 0 ) /* 64k for main CPU + 64k for banked ROMs */ + ROM_REGION( 0x20000, "maincpu", 0 ) ROM_LOAD( "1", 0x04000, 0x4000, CRC(09bd60ee) SHA1(9591a4c89bb69d5615a5d6b29c47e6b17350c007) ) ROM_LOAD( "2", 0x08000, 0x8000, CRC(f2b2cd1c) SHA1(dafccc74310876bc1c88de7f3c86f93ed8a0eb62) ) ROM_LOAD( "4", 0x10000, 0x8000, CRC(b42b3359) SHA1(c1da550e0f7cc52721802c7c0f2770ef0087e28b) ) ROM_LOAD( "brkthru.3", 0x18000, 0x8000, CRC(2f2c40c2) SHA1(fcb78941453520a3a07f272127dae7c2cc1999ea) ) - ROM_REGION( 0x02000, "gfx1", 0 ) - ROM_LOAD( "12", 0x00000, 0x2000, CRC(3d9a7003) SHA1(2e5de982eb75ac75312fb29bb4cb2ed12ec0fd56) ) /* characters */ - - ROM_REGION( 0x20000, "gfx2", 0 ) - /* background */ - /* we do a lot of scatter loading here, to place the data in a format */ - /* which can be decoded by MAME's standard functions */ - ROM_LOAD( "brkthru.7", 0x00000, 0x4000, CRC(920cc56a) SHA1(c75806691073f1f3bd54dcaca4c14155ecf4471d) ) /* bitplanes 1,2 for bank 1,2 */ - ROM_CONTINUE( 0x08000, 0x4000 ) /* bitplanes 1,2 for bank 3,4 */ - ROM_LOAD( "6", 0x10000, 0x4000, CRC(cb47b395) SHA1(bf5459d696e863644f13c8b0786b8f45caf6ceb6) ) /* bitplanes 1,2 for bank 5,6 */ - ROM_CONTINUE( 0x18000, 0x4000 ) /* bitplanes 1,2 for bank 7,8 */ - ROM_LOAD( "8", 0x04000, 0x1000, CRC(5e5a2cd7) SHA1(f1782d67b924b4b89bcb6602e970c28fbeaab522) ) /* bitplane 3 for bank 1,2 */ + ROM_REGION( 0x02000, "chars", 0 ) + ROM_LOAD( "12", 0x00000, 0x2000, CRC(3d9a7003) SHA1(2e5de982eb75ac75312fb29bb4cb2ed12ec0fd56) ) + + ROM_REGION( 0x20000, "tiles", 0 ) + // background + // we do a lot of scatter loading here, to place the data in a format which can be decoded by MAME's standard functions + ROM_LOAD( "brkthru.7", 0x00000, 0x4000, CRC(920cc56a) SHA1(c75806691073f1f3bd54dcaca4c14155ecf4471d) ) // bitplanes 1,2 for bank 1,2 + ROM_CONTINUE( 0x08000, 0x4000 ) // bitplanes 1,2 for bank 3,4 + ROM_LOAD( "6", 0x10000, 0x4000, CRC(cb47b395) SHA1(bf5459d696e863644f13c8b0786b8f45caf6ceb6) ) // bitplanes 1,2 for bank 5,6 + ROM_CONTINUE( 0x18000, 0x4000 ) // bitplanes 1,2 for bank 7,8 + ROM_LOAD( "8", 0x04000, 0x1000, CRC(5e5a2cd7) SHA1(f1782d67b924b4b89bcb6602e970c28fbeaab522) ) // bitplane 3 for bank 1,2 ROM_CONTINUE( 0x06000, 0x1000 ) - ROM_CONTINUE( 0x0c000, 0x1000 ) /* bitplane 3 for bank 3,4 */ + ROM_CONTINUE( 0x0c000, 0x1000 ) // bitplane 3 for bank 3,4 ROM_CONTINUE( 0x0e000, 0x1000 ) - ROM_CONTINUE( 0x14000, 0x1000 ) /* bitplane 3 for bank 5,6 */ + ROM_CONTINUE( 0x14000, 0x1000 ) // bitplane 3 for bank 5,6 ROM_CONTINUE( 0x16000, 0x1000 ) - ROM_CONTINUE( 0x1c000, 0x1000 ) /* bitplane 3 for bank 7,8 */ + ROM_CONTINUE( 0x1c000, 0x1000 ) // bitplane 3 for bank 7,8 ROM_CONTINUE( 0x1e000, 0x1000 ) - ROM_REGION( 0x18000, "gfx3", 0 ) - ROM_LOAD( "brkthru.9", 0x00000, 0x8000, CRC(f54e50a7) SHA1(eccf4d859c26944271ec6586644b4730a72851fd) ) /* sprites */ + ROM_REGION( 0x18000, "sprites", 0 ) + ROM_LOAD( "brkthru.9", 0x00000, 0x8000, CRC(f54e50a7) SHA1(eccf4d859c26944271ec6586644b4730a72851fd) ) ROM_LOAD( "brkthru.10", 0x08000, 0x8000, CRC(fd156945) SHA1(a0575a4164217e63317886176ab7e59d255fc771) ) ROM_LOAD( "brkthru.11", 0x10000, 0x8000, CRC(c152a99b) SHA1(f96133aa01219eda357b9e906bd9577dbfe359c0) ) ROM_REGION( 0x0200, "proms", 0 ) - ROM_LOAD( "brkthru.13", 0x0000, 0x0100, CRC(aae44269) SHA1(7c66aeb93577104109d264ee8b848254256c81eb) ) /* red and green component */ - ROM_LOAD( "brkthru.14", 0x0100, 0x0100, CRC(f2d4822a) SHA1(f535e91b87ff01f2a73662856fd3f72907ca62e9) ) /* blue component */ + ROM_LOAD( "brkthru.13", 0x0000, 0x0100, CRC(aae44269) SHA1(7c66aeb93577104109d264ee8b848254256c81eb) ) // red and green component + ROM_LOAD( "brkthru.14", 0x0100, 0x0100, CRC(f2d4822a) SHA1(f535e91b87ff01f2a73662856fd3f72907ca62e9) ) // blue component ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "brkthru.5", 0x8000, 0x8000, CRC(c309435f) SHA1(82914004c2b169a7c31aa49af83a699ebbc7b33f) ) @@ -639,16 +890,16 @@ ROM_END // Tecfri PCB with Data East license (DE-0230-2 / DE-0231-2). ROM_START( brkthrut ) - ROM_REGION( 0x20000, "maincpu", 0 ) // 64k for main CPU + 64k for banked ROMs + ROM_REGION( 0x20000, "maincpu", 0 ) ROM_LOAD( "5_de-0230-2_27128.f9", 0x04000, 0x4000, CRC(158e660a) SHA1(608082e8b49d3c5595c25be8c19b80402310406a) ) ROM_LOAD( "6_de-0230-2_27256.f11", 0x08000, 0x8000, CRC(62dbe49e) SHA1(f0510cf0144d75c208f0ced342d3a726325a70d4) ) ROM_LOAD( "8_de-0230-2_27256.f13", 0x10000, 0x8000, CRC(8cabf252) SHA1(45e8847b2e6b278989f67e0b27b827a9b3b92581) ) // Same as parent ROM_LOAD( "7_de-0230-2_27256.f12", 0x18000, 0x8000, CRC(2f2c40c2) SHA1(fcb78941453520a3a07f272127dae7c2cc1999ea) ) // Same as parent - ROM_REGION( 0x02000, "gfx1", 0 ) - ROM_LOAD( "9_de-0231-2_2764.c8", 0x00000, 0x2000, CRC(58c0b29b) SHA1(9dc075f8afae7e8fe164a9fe325e9948cdc7e4bb) ) // Characters, same as parent + ROM_REGION( 0x02000, "chars", 0 ) + ROM_LOAD( "9_de-0231-2_2764.c8", 0x00000, 0x2000, CRC(58c0b29b) SHA1(9dc075f8afae7e8fe164a9fe325e9948cdc7e4bb) ) // same as parent - ROM_REGION( 0x20000, "gfx2", 0 ) + ROM_REGION( 0x20000, "tiles", 0 ) // Background // We do a lot of scatter loading here, to place the data in a format // which can be decoded by MAME's standard functions @@ -665,8 +916,8 @@ ROM_START( brkthrut ) ROM_CONTINUE( 0x1c000, 0x1000 ) // Bitplane 3 for bank 7,8 ROM_CONTINUE( 0x1e000, 0x1000 ) - ROM_REGION( 0x18000, "gfx3", 0 ) - ROM_LOAD( "10_de-0231-2_27156.h2", 0x00000, 0x8000, CRC(f54e50a7) SHA1(eccf4d859c26944271ec6586644b4730a72851fd) ) // Sprites, same as parent + ROM_REGION( 0x18000, "sprites", 0 ) + ROM_LOAD( "10_de-0231-2_27156.h2", 0x00000, 0x8000, CRC(f54e50a7) SHA1(eccf4d859c26944271ec6586644b4730a72851fd) ) // Same as parent ROM_LOAD( "11_de-0231-2_27156.h4", 0x08000, 0x8000, CRC(fd156945) SHA1(a0575a4164217e63317886176ab7e59d255fc771) ) // Same as parent ROM_LOAD( "12_de-0231-2_27156.h5", 0x10000, 0x8000, CRC(c152a99b) SHA1(f96133aa01219eda357b9e906bd9577dbfe359c0) ) // Same as parent @@ -698,10 +949,10 @@ ROM_START( brkthrubl ) // 3002A + 3002B PCBs. Everything's the same as the origi ROM_LOAD( "1", 0x10000, 0x8000, CRC(209484c2) SHA1(da7311768b675b833066a7403fd507969d74699e) ) ROM_LOAD( "2", 0x18000, 0x8000, CRC(2f2c40c2) SHA1(fcb78941453520a3a07f272127dae7c2cc1999ea) ) - ROM_REGION( 0x02000, "gfx1", 0 ) - ROM_LOAD( "12", 0x00000, 0x2000, CRC(58c0b29b) SHA1(9dc075f8afae7e8fe164a9fe325e9948cdc7e4bb) ) // characters + ROM_REGION( 0x02000, "chars", 0 ) + ROM_LOAD( "12", 0x00000, 0x2000, CRC(58c0b29b) SHA1(9dc075f8afae7e8fe164a9fe325e9948cdc7e4bb) ) - ROM_REGION( 0x20000, "gfx2", 0 ) // background + ROM_REGION( 0x20000, "tiles", 0 ) // background ROM_LOAD( "7", 0x00000, 0x4000, CRC(920cc56a) SHA1(c75806691073f1f3bd54dcaca4c14155ecf4471d) ) // bitplanes 1,2 for bank 1,2 ROM_CONTINUE( 0x08000, 0x4000 ) // bitplanes 1,2 for bank 3,4 ROM_LOAD( "6", 0x10000, 0x4000, CRC(fd3cee40) SHA1(3308b96bb69e0fa6dffbdff296273fafa16d5e70) ) // bitplanes 1,2 for bank 5,6 @@ -715,8 +966,8 @@ ROM_START( brkthrubl ) // 3002A + 3002B PCBs. Everything's the same as the origi ROM_CONTINUE( 0x1c000, 0x1000 ) // bitplane 3 for bank 7,8 ROM_CONTINUE( 0x1e000, 0x1000 ) - ROM_REGION( 0x18000, "gfx3", 0 ) - ROM_LOAD( "9", 0x00000, 0x8000, CRC(f54e50a7) SHA1(eccf4d859c26944271ec6586644b4730a72851fd) ) // sprites + ROM_REGION( 0x18000, "sprites", 0 ) + ROM_LOAD( "9", 0x00000, 0x8000, CRC(f54e50a7) SHA1(eccf4d859c26944271ec6586644b4730a72851fd) ) ROM_LOAD( "10", 0x08000, 0x8000, CRC(fd156945) SHA1(a0575a4164217e63317886176ab7e59d255fc771) ) ROM_LOAD( "11", 0x10000, 0x8000, CRC(c152a99b) SHA1(f96133aa01219eda357b9e906bd9577dbfe359c0) ) @@ -728,84 +979,82 @@ ROM_START( brkthrubl ) // 3002A + 3002B PCBs. Everything's the same as the origi ROM_LOAD( "5", 0x8000, 0x8000, CRC(c309435f) SHA1(82914004c2b169a7c31aa49af83a699ebbc7b33f) ) ROM_END -/* bootleg, changed prg rom fails test, probably just the japanese version modified to have english title */ +// bootleg, changed prg ROM fails test, probably just the Japanese version modified to have English title ROM_START( forcebrk ) - ROM_REGION( 0x20000, "maincpu", 0 ) /* 64k for main CPU + 64k for banked ROMs */ + ROM_REGION( 0x20000, "maincpu", 0 ) ROM_LOAD( "1", 0x04000, 0x4000, CRC(09bd60ee) SHA1(9591a4c89bb69d5615a5d6b29c47e6b17350c007) ) ROM_LOAD( "2", 0x08000, 0x8000, CRC(f2b2cd1c) SHA1(dafccc74310876bc1c88de7f3c86f93ed8a0eb62) ) ROM_LOAD( "forcebrk4", 0x10000, 0x8000, CRC(b4838c19) SHA1(b32f183ee042872a6eb6689aab219108d37829e4) ) ROM_LOAD( "brkthru.3", 0x18000, 0x8000, CRC(2f2c40c2) SHA1(fcb78941453520a3a07f272127dae7c2cc1999ea) ) - ROM_REGION( 0x02000, "gfx1", 0 ) - ROM_LOAD( "12", 0x00000, 0x2000, CRC(3d9a7003) SHA1(2e5de982eb75ac75312fb29bb4cb2ed12ec0fd56) ) /* characters */ - - ROM_REGION( 0x20000, "gfx2", 0 ) - /* background */ - /* we do a lot of scatter loading here, to place the data in a format */ - /* which can be decoded by MAME's standard functions */ - ROM_LOAD( "brkthru.7", 0x00000, 0x4000, CRC(920cc56a) SHA1(c75806691073f1f3bd54dcaca4c14155ecf4471d) ) /* bitplanes 1,2 for bank 1,2 */ - ROM_CONTINUE( 0x08000, 0x4000 ) /* bitplanes 1,2 for bank 3,4 */ - ROM_LOAD( "forcebrk6", 0x10000, 0x4000, CRC(08bca16a) SHA1(d5dcf5cf68a5090f467c076abb1b9cf0baffe272) ) /* bitplanes 1,2 for bank 5,6 */ - ROM_CONTINUE( 0x18000, 0x4000 ) /* bitplanes 1,2 for bank 7,8 */ - ROM_LOAD( "forcebrk8", 0x04000, 0x1000, CRC(a3a1131e) SHA1(e0b73c8b2c8ea6b31418bc642830875c5985f800) ) /* bitplane 3 for bank 1,2 */ + ROM_REGION( 0x02000, "chars", 0 ) + ROM_LOAD( "12", 0x00000, 0x2000, CRC(3d9a7003) SHA1(2e5de982eb75ac75312fb29bb4cb2ed12ec0fd56) ) + + ROM_REGION( 0x20000, "tiles", 0 ) + // background + // we do a lot of scatter loading here, to place the data in a format which can be decoded by MAME's standard functions + ROM_LOAD( "brkthru.7", 0x00000, 0x4000, CRC(920cc56a) SHA1(c75806691073f1f3bd54dcaca4c14155ecf4471d) ) // bitplanes 1,2 for bank 1,2 + ROM_CONTINUE( 0x08000, 0x4000 ) // bitplanes 1,2 for bank 3,4 + ROM_LOAD( "forcebrk6", 0x10000, 0x4000, CRC(08bca16a) SHA1(d5dcf5cf68a5090f467c076abb1b9cf0baffe272) ) // bitplanes 1,2 for bank 5,6 + ROM_CONTINUE( 0x18000, 0x4000 ) // bitplanes 1,2 for bank 7,8 + ROM_LOAD( "forcebrk8", 0x04000, 0x1000, CRC(a3a1131e) SHA1(e0b73c8b2c8ea6b31418bc642830875c5985f800) ) // bitplane 3 for bank 1,2 ROM_CONTINUE( 0x06000, 0x1000 ) - ROM_CONTINUE( 0x0c000, 0x1000 ) /* bitplane 3 for bank 3,4 */ + ROM_CONTINUE( 0x0c000, 0x1000 ) // bitplane 3 for bank 3,4 ROM_CONTINUE( 0x0e000, 0x1000 ) - ROM_CONTINUE( 0x14000, 0x1000 ) /* bitplane 3 for bank 5,6 */ + ROM_CONTINUE( 0x14000, 0x1000 ) // bitplane 3 for bank 5,6 ROM_CONTINUE( 0x16000, 0x1000 ) - ROM_CONTINUE( 0x1c000, 0x1000 ) /* bitplane 3 for bank 7,8 */ + ROM_CONTINUE( 0x1c000, 0x1000 ) // bitplane 3 for bank 7,8 ROM_CONTINUE( 0x1e000, 0x1000 ) - ROM_REGION( 0x18000, "gfx3", 0 ) - ROM_LOAD( "brkthru.9", 0x00000, 0x8000, CRC(f54e50a7) SHA1(eccf4d859c26944271ec6586644b4730a72851fd) ) /* sprites */ + ROM_REGION( 0x18000, "sprites", 0 ) + ROM_LOAD( "brkthru.9", 0x00000, 0x8000, CRC(f54e50a7) SHA1(eccf4d859c26944271ec6586644b4730a72851fd) ) ROM_LOAD( "brkthru.10", 0x08000, 0x8000, CRC(fd156945) SHA1(a0575a4164217e63317886176ab7e59d255fc771) ) ROM_LOAD( "brkthru.11", 0x10000, 0x8000, CRC(c152a99b) SHA1(f96133aa01219eda357b9e906bd9577dbfe359c0) ) ROM_REGION( 0x0200, "proms", 0 ) - ROM_LOAD( "brkthru.13", 0x0000, 0x0100, CRC(aae44269) SHA1(7c66aeb93577104109d264ee8b848254256c81eb) ) /* red and green component */ - ROM_LOAD( "brkthru.14", 0x0100, 0x0100, CRC(f2d4822a) SHA1(f535e91b87ff01f2a73662856fd3f72907ca62e9) ) /* blue component */ + ROM_LOAD( "brkthru.13", 0x0000, 0x0100, CRC(aae44269) SHA1(7c66aeb93577104109d264ee8b848254256c81eb) ) // red and green component + ROM_LOAD( "brkthru.14", 0x0100, 0x0100, CRC(f2d4822a) SHA1(f535e91b87ff01f2a73662856fd3f72907ca62e9) ) // blue component ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "brkthru.5", 0x8000, 0x8000, CRC(c309435f) SHA1(82914004c2b169a7c31aa49af83a699ebbc7b33f) ) ROM_END ROM_START( darwin ) - ROM_REGION( 0x20000, "maincpu", 0 ) /* 64k for main CPU + 64k for banked ROMs */ + ROM_REGION( 0x20000, "maincpu", 0 ) ROM_LOAD( "darw_04.rom", 0x04000, 0x4000, CRC(0eabf21c) SHA1(ccad6b30fe9361e8a21b8aaf8116aa85f9e6bb19) ) ROM_LOAD( "darw_05.rom", 0x08000, 0x8000, CRC(e771f864) SHA1(8ba9f97c6abf035ceaf9f5505495708506f1b0c5) ) ROM_LOAD( "darw_07.rom", 0x10000, 0x8000, CRC(97ac052c) SHA1(8baa117472d46b99e5946f095b869de9b5c48f9a) ) ROM_LOAD( "darw_06.rom", 0x18000, 0x8000, CRC(2a9fb208) SHA1(f04a5502600e49e2494a87ec65a44a2843441d37) ) - ROM_REGION( 0x02000, "gfx1", 0 ) - ROM_LOAD( "darw_09.rom", 0x00000, 0x2000, CRC(067b4cf5) SHA1(fc752bb72e4850b71565afd1df0cbb4f732f131c) ) /* characters */ - - ROM_REGION( 0x20000, "gfx2", 0 ) - /* background */ - /* we do a lot of scatter loading here, to place the data in a format */ - /* which can be decoded by MAME's standard functions */ - ROM_LOAD( "darw_03.rom", 0x00000, 0x4000, CRC(57d0350d) SHA1(6f904047485e669afb5f4b590818743111f010c6) ) /* bitplanes 1,2 for bank 1,2 */ - ROM_CONTINUE( 0x08000, 0x4000 ) /* bitplanes 1,2 for bank 3,4 */ - ROM_LOAD( "darw_02.rom", 0x10000, 0x4000, CRC(559a71ab) SHA1(a28de25e89e0d68332f4095b988827a9cb72c675) ) /* bitplanes 1,2 for bank 5,6 */ - ROM_CONTINUE( 0x18000, 0x4000 ) /* bitplanes 1,2 for bank 7,8 */ - ROM_LOAD( "darw_01.rom", 0x04000, 0x1000, CRC(15a16973) SHA1(5eb978a32be88176936e5d37b6ec18820d9720d8) ) /* bitplane 3 for bank 1,2 */ + ROM_REGION( 0x02000, "chars", 0 ) + ROM_LOAD( "darw_09.rom", 0x00000, 0x2000, CRC(067b4cf5) SHA1(fc752bb72e4850b71565afd1df0cbb4f732f131c) ) + + ROM_REGION( 0x20000, "tiles", 0 ) + // background + // we do a lot of scatter loading here, to place the data in a format which can be decoded by MAME's standard functions + ROM_LOAD( "darw_03.rom", 0x00000, 0x4000, CRC(57d0350d) SHA1(6f904047485e669afb5f4b590818743111f010c6) ) // bitplanes 1,2 for bank 1,2 + ROM_CONTINUE( 0x08000, 0x4000 ) // bitplanes 1,2 for bank 3,4 + ROM_LOAD( "darw_02.rom", 0x10000, 0x4000, CRC(559a71ab) SHA1(a28de25e89e0d68332f4095b988827a9cb72c675) ) // bitplanes 1,2 for bank 5,6 + ROM_CONTINUE( 0x18000, 0x4000 ) // bitplanes 1,2 for bank 7,8 + ROM_LOAD( "darw_01.rom", 0x04000, 0x1000, CRC(15a16973) SHA1(5eb978a32be88176936e5d37b6ec18820d9720d8) ) // bitplane 3 for bank 1,2 ROM_CONTINUE( 0x06000, 0x1000 ) - ROM_CONTINUE( 0x0c000, 0x1000 ) /* bitplane 3 for bank 3,4 */ + ROM_CONTINUE( 0x0c000, 0x1000 ) // bitplane 3 for bank 3,4 ROM_CONTINUE( 0x0e000, 0x1000 ) - ROM_CONTINUE( 0x14000, 0x1000 ) /* bitplane 3 for bank 5,6 */ + ROM_CONTINUE( 0x14000, 0x1000 ) // bitplane 3 for bank 5,6 ROM_CONTINUE( 0x16000, 0x1000 ) - ROM_CONTINUE( 0x1c000, 0x1000 ) /* bitplane 3 for bank 7,8 */ + ROM_CONTINUE( 0x1c000, 0x1000 ) // bitplane 3 for bank 7,8 ROM_CONTINUE( 0x1e000, 0x1000 ) - ROM_REGION( 0x18000, "gfx3", 0 ) - ROM_LOAD( "darw_10.rom", 0x00000, 0x8000, CRC(487a014c) SHA1(c9543df8115088b02019e76a6473ecc5f645a836) ) /* sprites */ + ROM_REGION( 0x18000, "sprites", 0 ) + ROM_LOAD( "darw_10.rom", 0x00000, 0x8000, CRC(487a014c) SHA1(c9543df8115088b02019e76a6473ecc5f645a836) ) ROM_LOAD( "darw_11.rom", 0x08000, 0x8000, CRC(548ce2d1) SHA1(3b1757c70346ab4ee19ec85e7ae5137f8ccf446f) ) ROM_LOAD( "darw_12.rom", 0x10000, 0x8000, CRC(faba5fef) SHA1(848da4d4888f0218b737f1dc9b62944f68349a43) ) // A PCB has been found with the first PROM substituted with a TBP28S42 (4b56a744) SHA1(5fdc336d90c8a289c146c66f241dd217fc11bf35), see brkthrut ROM loading for how they did it. // With that in mind, there's a one byte difference at 0x55 (0xf0 instead of 0x70). It is unknown if it's bitrot or if it's intended. ROM_REGION( 0x0200, "proms", 0 ) - ROM_LOAD( "df.12", 0x0000, 0x0100, CRC(89b952ef) SHA1(77dc4020a2e25f81fae1182d58993cf09d13af00) ) /* red and green component */ - ROM_LOAD( "df.13", 0x0100, 0x0100, CRC(d595e91d) SHA1(5e9793f6602455c79afdc855cd13183a7f48ab1e) ) /* blue component */ + ROM_LOAD( "df.12", 0x0000, 0x0100, CRC(89b952ef) SHA1(77dc4020a2e25f81fae1182d58993cf09d13af00) ) // red and green component + ROM_LOAD( "df.13", 0x0100, 0x0100, CRC(d595e91d) SHA1(5e9793f6602455c79afdc855cd13183a7f48ab1e) ) // blue component ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "darw_08.rom", 0x8000, 0x8000, CRC(6b580d58) SHA1(a70aebc6b4a291b4adddbb41d092b2682fc2d421) ) @@ -816,18 +1065,8 @@ ROM_START( darwin ) ROM_LOAD( "3-pal16r4pc.bin", 0x400, 0x104, CRC(b3e980a0) SHA1(b1dbf01621d1053e641570fcac6618562d0721b4) ) ROM_END +} // anonymous namespace -/************************************* - * - * Driver initialization - * - *************************************/ - -void brkthru_state::init_brkthru() -{ - uint8_t *ROM = memregion("maincpu")->base(); - membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x2000); -} /************************************* * @@ -835,9 +1074,9 @@ void brkthru_state::init_brkthru() * *************************************/ -GAME( 1986, brkthru, 0, brkthru, brkthru, brkthru_state, init_brkthru, ROT0, "Data East USA", "Break Thru (US)", MACHINE_SUPPORTS_SAVE ) -GAME( 1986, brkthruj, brkthru, brkthru, brkthruj, brkthru_state, init_brkthru, ROT0, "Data East Corporation", "Kyohkoh-Toppa (Japan)", MACHINE_SUPPORTS_SAVE ) -GAME( 1986, brkthrut, brkthru, brkthru, brkthruj, brkthru_state, init_brkthru, ROT0, "Data East Corporation (Tecfri license)", "Break Thru (Tecfri license)", MACHINE_SUPPORTS_SAVE ) -GAME( 1986, forcebrk, brkthru, brkthru, brkthruj, brkthru_state, init_brkthru, ROT0, "bootleg", "Force Break (bootleg)", MACHINE_SUPPORTS_SAVE ) -GAME( 1986, brkthrubl, brkthru, brkthru, brkthruj, brkthru_state, init_brkthru, ROT0, "bootleg", "Break Thru (bootleg)", MACHINE_SUPPORTS_SAVE ) -GAME( 1986, darwin, 0, darwin, darwin, brkthru_state, init_brkthru, ROT270, "Data East Corporation", "Darwin 4078 (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1986, brkthru, 0, brkthru, brkthru, brkthru_state, empty_init, ROT0, "Data East USA", "Break Thru (US)", MACHINE_SUPPORTS_SAVE ) +GAME( 1986, brkthruj, brkthru, brkthru, brkthruj, brkthru_state, empty_init, ROT0, "Data East Corporation", "Kyohkoh-Toppa (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1986, brkthrut, brkthru, brkthru, brkthruj, brkthru_state, empty_init, ROT0, "Data East Corporation (Tecfri license)", "Break Thru (Tecfri license)", MACHINE_SUPPORTS_SAVE ) +GAME( 1986, forcebrk, brkthru, brkthru, brkthruj, brkthru_state, empty_init, ROT0, "bootleg", "Force Break (bootleg)", MACHINE_SUPPORTS_SAVE ) +GAME( 1986, brkthrubl, brkthru, brkthru, brkthruj, brkthru_state, empty_init, ROT0, "bootleg", "Break Thru (bootleg)", MACHINE_SUPPORTS_SAVE ) +GAME( 1986, darwin, 0, darwin, darwin, brkthru_state, empty_init, ROT270, "Data East Corporation", "Darwin 4078 (Japan)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/dcebridge.cpp b/src/mame/drivers/dcebridge.cpp index 46abe3bd36c..8c4c9e4bd66 100644 --- a/src/mame/drivers/dcebridge.cpp +++ b/src/mame/drivers/dcebridge.cpp @@ -308,5 +308,5 @@ ROM_END } // anonymous namespace -// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS -SYST( 197?, dcebridge, 0, 0, dcebridge, dcebridge, dcebridge_state, empty_init, "generic", "RS-232 DCE-DCE Bridge", MACHINE_NO_SOUND_HW ) +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS +SYST( 197?, dcebridge, 0, 0, dcebridge, dcebridge, dcebridge_state, empty_init, "<generic>", "RS-232 DCE-DCE Bridge", MACHINE_NO_SOUND_HW ) diff --git a/src/mame/drivers/goldstar.cpp b/src/mame/drivers/goldstar.cpp index eb4a092f823..5cff325585c 100644 --- a/src/mame/drivers/goldstar.cpp +++ b/src/mame/drivers/goldstar.cpp @@ -10640,7 +10640,11 @@ ROM_START( super7 ) ROM_LOAD( "gal20v8.bin", 0x000, 0x114, NO_DUMP ) ROM_END -ROM_START( chthree ) +/* + Channel Three + Seems a modded version of Cherry Master. + +*/ROM_START( chthree ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "1.u40", 0x0000, 0x8000, CRC(3d677758) SHA1(d2d13e54d3b55460a05b0ca42e12d8a6d72954ba) ) // 1ST AND 2ND HALF IDENTICAL ROM_IGNORE(0x8000) @@ -10655,8 +10659,8 @@ ROM_START( chthree ) ROM_REGION( 0x8000, "gfx2", 0 ) ROM_LOAD( "3.u49", 0x0000, 0x2000, CRC(b541cbc0) SHA1(ab8666c06a71fa8364c71d14715ddf9e222064cd) ) - ROM_LOAD( "4.u50", 0x2000, 0x2000, CRC(95ecd2aa) SHA1(73452c77dd83f96038d197bad5e37f0b3d9de561) ) - ROM_LOAD( "5.u51", 0x4000, 0x2000, CRC(a99c87ba) SHA1(4d74ded22da25e093b09d0a4abfbd3e1eabd816c) ) + ROM_LOAD( "5.u51", 0x2000, 0x2000, CRC(a99c87ba) SHA1(4d74ded22da25e093b09d0a4abfbd3e1eabd816c) ) + ROM_LOAD( "4.u50", 0x4000, 0x2000, CRC(95ecd2aa) SHA1(73452c77dd83f96038d197bad5e37f0b3d9de561) ) ROM_LOAD( "6.u52", 0x6000, 0x2000, CRC(5b19025d) SHA1(8e861ed8249811fdf50de8ca9c44fe1176a7e340) ) ROM_REGION( 0x10000, "user1", 0 ) @@ -10669,13 +10673,14 @@ ROM_START( chthree ) ROM_REGION( 0x200, "proms2", 0 ) ROM_LOAD( "82s129.u24", 0x0000, 0x0100, CRC(50ec383b) SHA1(ae95b92bd3946b40134bcdc22708d5c6b0f4c23e) ) - ROM_REGION( 0x800, "plds", 0 ) // PALs dumps from a 27c020 adapter are available, need checking / conversion - ROM_LOAD( "16l8_u18.bin", 0x0000, 0x117, NO_DUMP ) - ROM_LOAD( "16l8_u31.bin", 0x0200, 0x117, NO_DUMP ) - ROM_LOAD( "16l8_u32.bin", 0x0400, 0x117, NO_DUMP ) - ROM_LOAD( "16l8_u30.bin", 0x0600, 0x117, NO_DUMP ) + ROM_REGION( 0x800, "plds", 0 ) // PALs were bruteforced and converted. + ROM_LOAD( "tibpal_16l8.u18", 0x0000, 0x117, CRC(374f878e) SHA1(3b3a66dd1addbd4a8678ef8000a5426651010ebd) ) + ROM_LOAD( "tibpal_16l8.u30", 0x0200, 0x117, CRC(d3cfa978) SHA1(9aae06336be34818896c39d9af9c19d8b2035548) ) + ROM_LOAD( "tibpal_16l8.u31", 0x0400, 0x117, CRC(97f1f441) SHA1(bc9e7bba675df363e7fcad18efad89f6a543b2a4) ) + ROM_LOAD( "tibpal_16l8.u32", 0x0600, 0x117, CRC(8a5a8ded) SHA1(abb2bb51f0ead55606cc279ca4bef400d62730b0) ) ROM_END + /* 2764.u10 m4.64 IDENTICAL 27256.u11 m6.256 IDENTICAL diff --git a/src/mame/drivers/gunsmoke.cpp b/src/mame/drivers/gunsmoke.cpp index a7985a71f47..c935af82fcc 100644 --- a/src/mame/drivers/gunsmoke.cpp +++ b/src/mame/drivers/gunsmoke.cpp @@ -4,6 +4,7 @@ Gun.Smoke Capcom + 85113-A-1 main PCB + 85113-B-3 video PCB driver by Paul Leaman @@ -77,18 +78,270 @@ Stephh's notes (based on the games Z80 code and some tests) : // The DMA copies sprites to a video and halts the CPU for ~131us #include "emu.h" -#include "includes/gunsmoke.h" #include "cpu/z80/z80.h" #include "machine/gen_latch.h" #include "sound/ymopn.h" + +#include "emupal.h" #include "screen.h" #include "speaker.h" +#include "tilemap.h" + + +namespace { + +class gunsmoke_state : public driver_device +{ +public: + gunsmoke_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_videoram(*this, "videoram"), + m_colorram(*this, "colorram"), + m_scrollx(*this, "scrollx"), + m_scrolly(*this, "scrolly"), + m_spriteram(*this, "spriteram"), + m_mainbank(*this, "mainbank"), + m_maincpu(*this, "maincpu"), + m_gfxdecode(*this, "gfxdecode"), + m_palette(*this, "palette") + { } + + void gunsmoke(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + +private: + // memory pointers + required_shared_ptr<uint8_t> m_videoram; + required_shared_ptr<uint8_t> m_colorram; + required_shared_ptr<uint8_t> m_scrollx; + required_shared_ptr<uint8_t> m_scrolly; + required_shared_ptr<uint8_t> m_spriteram; + required_memory_bank m_mainbank; + + // devices + required_device<cpu_device> m_maincpu; + required_device<gfxdecode_device> m_gfxdecode; + required_device<palette_device> m_palette; + + // video-related + tilemap_t *m_bg_tilemap = nullptr; + tilemap_t *m_fg_tilemap = nullptr; + uint8_t m_chon = 0U; + uint8_t m_objon = 0U; + uint8_t m_bgon = 0U; + uint8_t m_sprite3bank = 0U; + + uint8_t protection_r(offs_t offset); + void videoram_w(offs_t offset, uint8_t data); + void colorram_w(offs_t offset, uint8_t data); + void c804_w(uint8_t data); + void d806_w(uint8_t data); + TILE_GET_INFO_MEMBER(get_bg_tile_info); + TILE_GET_INFO_MEMBER(get_fg_tile_info); + void palette(palette_device &palette) const; + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); + + void main_map(address_map &map); + void sound_map(address_map &map); +}; + + +// video + +/*************************************************************************** + + Convert the color PROMs into a more useable format. + + Gunsmoke has three 256x4 palette PROMs (one per gun) and a lot of + 256x4 lookup table PROMs. + The palette PROMs are connected to the RGB output this way: + + bit 3 -- 220 ohm resistor -- RED/GREEN/BLUE + -- 470 ohm resistor -- RED/GREEN/BLUE + -- 1 kohm resistor -- RED/GREEN/BLUE + bit 0 -- 2.2kohm resistor -- RED/GREEN/BLUE + +***************************************************************************/ + +void gunsmoke_state::palette(palette_device &palette) const +{ + const uint8_t *color_prom = memregion("proms")->base(); + + // create a lookup table for the palette + for (int i = 0; i < 0x100; i++) + { + int const r = pal4bit(color_prom[i + 0x000]); + int const g = pal4bit(color_prom[i + 0x100]); + int const b = pal4bit(color_prom[i + 0x200]); + + palette.set_indirect_color(i, rgb_t(r, g, b)); + } + + // color_prom now points to the beginning of the lookup table + color_prom += 0x300; + + // characters use colors 0x40-0x4f + for (int i = 0; i < 0x80; i++) + { + uint8_t const ctabentry = color_prom[i] | 0x40; + palette.set_pen_indirect(i, ctabentry); + } + + // background tiles use colors 0-0x3f + for (int i = 0x100; i < 0x200; i++) + { + uint8_t const ctabentry = color_prom[i] | ((color_prom[i + 0x100] & 0x03) << 4); + palette.set_pen_indirect(i - 0x80, ctabentry); + } + + // sprites use colors 0x80-0xff + for (int i = 0x300; i < 0x400; i++) + { + uint8_t const ctabentry = color_prom[i] | ((color_prom[i + 0x100] & 0x07) << 4) | 0x80; + palette.set_pen_indirect(i - 0x180, ctabentry); + } +} + +void gunsmoke_state::videoram_w(offs_t offset, uint8_t data) +{ + m_videoram[offset] = data; + m_fg_tilemap->mark_tile_dirty(offset); +} + +void gunsmoke_state::colorram_w(offs_t offset, uint8_t data) +{ + m_colorram[offset] = data; + m_fg_tilemap->mark_tile_dirty(offset); +} + +void gunsmoke_state::c804_w(uint8_t data) +{ + // bits 0 and 1 are for coin counters + machine().bookkeeping().coin_counter_w(1, data & 0x01); + machine().bookkeeping().coin_counter_w(0, data & 0x02); + + // bits 2 and 3 select the ROM bank + m_mainbank->set_entry((data & 0x0c) >> 2); + + // bit 5 resets the sound CPU? - we ignore it + + // bit 6 flips screen + flip_screen_set(data & 0x40); + + // bit 7 enables characters? + m_chon = data & 0x80; +} + +void gunsmoke_state::d806_w(uint8_t data) +{ + // bits 0-2 select the sprite 3 bank + m_sprite3bank = data & 0x07; + + // bit 4 enables bg 1? + m_bgon = data & 0x10; + + // bit 5 enables sprites? + m_objon = data & 0x20; +} + +TILE_GET_INFO_MEMBER(gunsmoke_state::get_bg_tile_info) +{ + uint8_t *tilerom = memregion("bgtiles")->base(); + + int offs = tile_index * 2; + int attr = tilerom[offs + 1]; + int code = tilerom[offs] + ((attr & 0x01) << 8); + int color = (attr & 0x3c) >> 2; + int flags = TILE_FLIPYX((attr & 0xc0) >> 6); + + tileinfo.set(1, code, color, flags); +} + +TILE_GET_INFO_MEMBER(gunsmoke_state::get_fg_tile_info) +{ + int attr = m_colorram[tile_index]; + int code = m_videoram[tile_index] + ((attr & 0xe0) << 2); + int color = attr & 0x1f; + + tileinfo.group = color; + + tileinfo.set(0, code, color, 0); +} + +void gunsmoke_state::video_start() +{ + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(gunsmoke_state::get_bg_tile_info)), TILEMAP_SCAN_COLS, 32, 32, 2048, 8); + m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(gunsmoke_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); + m_bg_tilemap->set_scrolldx(128, 128); + m_bg_tilemap->set_scrolldy( 6, 6); + m_fg_tilemap->set_scrolldx(128, 128); + m_fg_tilemap->set_scrolldy( 6, 6); -/* Read/Write Handlers */ + m_fg_tilemap->configure_groups(*m_gfxdecode->gfx(0), 0x4f); +} + +void gunsmoke_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + for (int offs = m_spriteram.bytes() - 32; offs >= 0; offs -= 32) + { + int attr = m_spriteram[offs + 1]; + int bank = (attr & 0xc0) >> 6; + int code = m_spriteram[offs]; + int color = attr & 0x0f; + int flipx = 0; + int flipy = attr & 0x10; + int sx = m_spriteram[offs + 3] - ((attr & 0x20) << 3); + int sy = m_spriteram[offs + 2]; + + if (bank == 3) + bank += m_sprite3bank; + + code += 256 * bank; + + if (flip_screen()) + { + sx = 240 - sx; + sy = 240 - sy; + flipx = !flipx; + flipy = !flipy; + } + + m_gfxdecode->gfx(2)->transpen(bitmap, cliprect, code, color, flipx, flipy, sx + 128, sy + 6, 0); + } +} + +uint32_t gunsmoke_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + m_bg_tilemap->set_scrollx(0, m_scrollx[0] + 256 * m_scrollx[1]); + m_bg_tilemap->set_scrolly(0, m_scrolly[0]); + + if (m_bgon) + m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + else + bitmap.fill(m_palette->black_pen(), cliprect); + + if (m_objon) + draw_sprites(bitmap, cliprect); -uint8_t gunsmoke_state::gunsmoke_protection_r(offs_t offset) + if (m_chon) + m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + + return 0; +} + + +// machine + +// Read/Write Handlers + +uint8_t gunsmoke_state::protection_r(offs_t offset) { /* The routine at 0x0e69 tries to read data starting at 0xc4c9. @@ -105,32 +358,32 @@ uint8_t gunsmoke_state::gunsmoke_protection_r(offs_t offset) arcade game. It's hard to tell without pulling the code apart. */ - static const uint8_t gunsmoke_fixed_data[] = { 0xff, 0x00, 0x00 }; - return gunsmoke_fixed_data[offset]; + static const uint8_t fixed_data[] = { 0xff, 0x00, 0x00 }; + return fixed_data[offset]; } -/* Memory Maps */ +// Memory Maps -void gunsmoke_state::gunsmoke_map(address_map &map) +void gunsmoke_state::main_map(address_map &map) { map(0x0000, 0x7fff).rom(); - map(0x8000, 0xbfff).bankr("bank1"); + map(0x8000, 0xbfff).bankr(m_mainbank); map(0xc000, 0xc000).portr("SYSTEM"); map(0xc001, 0xc001).portr("P1"); map(0xc002, 0xc002).portr("P2"); map(0xc003, 0xc003).portr("DSW1"); map(0xc004, 0xc004).portr("DSW2"); - map(0xc4c9, 0xc4cb).r(FUNC(gunsmoke_state::gunsmoke_protection_r)); + map(0xc4c9, 0xc4cb).r(FUNC(gunsmoke_state::protection_r)); map(0xc800, 0xc800).w("soundlatch", FUNC(generic_latch_8_device::write)); - map(0xc804, 0xc804).w(FUNC(gunsmoke_state::gunsmoke_c804_w)); // ROM bank switch, screen flip + map(0xc804, 0xc804).w(FUNC(gunsmoke_state::c804_w)); // ROM bank switch, screen flip // 0xc806 DMA trigger (not emulated) - map(0xd000, 0xd3ff).ram().w(FUNC(gunsmoke_state::gunsmoke_videoram_w)).share("videoram"); - map(0xd400, 0xd7ff).ram().w(FUNC(gunsmoke_state::gunsmoke_colorram_w)).share("colorram"); - map(0xd800, 0xd801).ram().share("scrollx"); - map(0xd802, 0xd802).ram().share("scrolly"); - map(0xd806, 0xd806).w(FUNC(gunsmoke_state::gunsmoke_d806_w)); // sprites and bg enable + map(0xd000, 0xd3ff).ram().w(FUNC(gunsmoke_state::videoram_w)).share(m_videoram); + map(0xd400, 0xd7ff).ram().w(FUNC(gunsmoke_state::colorram_w)).share(m_colorram); + map(0xd800, 0xd801).ram().share(m_scrollx); + map(0xd802, 0xd802).ram().share(m_scrolly); + map(0xd806, 0xd806).w(FUNC(gunsmoke_state::d806_w)); // sprites and bg enable map(0xe000, 0xefff).ram(); - map(0xf000, 0xffff).ram().share("spriteram"); + map(0xf000, 0xffff).ram().share(m_spriteram); } void gunsmoke_state::sound_map(address_map &map) @@ -142,7 +395,7 @@ void gunsmoke_state::sound_map(address_map &map) map(0xe002, 0xe003).w("ym2", FUNC(ym2203_device::write)); } -/* Input Ports */ +// Input Ports static INPUT_PORTS_START( gunsmoke ) PORT_START("SYSTEM") @@ -234,24 +487,24 @@ static INPUT_PORTS_START( gunsmokeu ) PORT_DIPSETTING( 0x00, "5" ) INPUT_PORTS_END -/* Graphics Layouts */ +// Graphics Layouts static const gfx_layout charlayout = { - 8,8, /* 8*8 characters */ - 1024, /* 1024 characters */ - 2, /* 2 bits per pixel */ + 8,8, // 8*8 characters + 1024, // 1024 characters + 2, // 2 bits per pixel { 4, 0 }, { 8+3, 8+2, 8+1, 8+0, 3, 2, 1, 0 }, { 7*16, 6*16, 5*16, 4*16, 3*16, 2*16, 1*16, 0*16 }, - 16*8 /* every char takes 16 consecutive bytes */ + 16*8 // every char takes 16 consecutive bytes }; static const gfx_layout tilelayout = { - 32,32, /* 32*32 tiles */ - 512, /* 512 tiles */ - 4, /* 4 bits per pixel */ + 32,32, // 32*32 tiles + 512, // 512 tiles + 4, // 4 bits per pixel { 512*256*8+4, 512*256*8+0, 4, 0 }, { 0, 1, 2, 3, 8+0, 8+1, 8+2, 8+3, 64*8+0, 64*8+1, 64*8+2, 64*8+3, 65*8+0, 65*8+1, 65*8+2, 65*8+3, @@ -261,37 +514,37 @@ static const gfx_layout tilelayout = 8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16, 16*16, 17*16, 18*16, 19*16, 20*16, 21*16, 22*16, 23*16, 24*16, 25*16, 26*16, 27*16, 28*16, 29*16, 30*16, 31*16 }, - 256*8 /* every tile takes 256 consecutive bytes */ + 256*8 // every tile takes 256 consecutive bytes }; static const gfx_layout spritelayout = { - 16,16, /* 16*16 sprites */ - 2048, /* 2048 sprites */ - 4, /* 4 bits per pixel */ + 16,16, // 16*16 sprites + 2048, // 2048 sprites + 4, // 4 bits per pixel { 2048*64*8+4, 2048*64*8+0, 4, 0 }, { 0, 1, 2, 3, 8+0, 8+1, 8+2, 8+3, 32*8+0, 32*8+1, 32*8+2, 32*8+3, 33*8+0, 33*8+1, 33*8+2, 33*8+3 }, { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16, 8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 }, - 64*8 /* every sprite takes 64 consecutive bytes */ + 64*8 // every sprite takes 64 consecutive bytes }; -/* Graphics Decode Info */ +// Graphics Decode Info static GFXDECODE_START( gfx_gunsmoke ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 32 ) - GFXDECODE_ENTRY( "gfx2", 0, tilelayout, 32*4, 16 ) - GFXDECODE_ENTRY( "gfx3", 0, spritelayout, 32*4+16*16, 16 ) + GFXDECODE_ENTRY( "chars", 0, charlayout, 0, 32 ) + GFXDECODE_ENTRY( "tiles", 0, tilelayout, 32*4, 16 ) + GFXDECODE_ENTRY( "sprites", 0, spritelayout, 32*4+16*16, 16 ) GFXDECODE_END -/* Machine Driver */ +// Machine Driver void gunsmoke_state::machine_start() { uint8_t *rombase = memregion("maincpu")->base(); - membank("bank1")->configure_entries(0, 4, &rombase[0x10000], 0x4000); + m_mainbank->configure_entries(0, 4, &rombase[0x8000], 0x4000); save_item(NAME(m_chon)); save_item(NAME(m_objon)); @@ -309,350 +562,350 @@ void gunsmoke_state::machine_reset() void gunsmoke_state::gunsmoke(machine_config &config) { - /* basic machine hardware */ - Z80(config, m_maincpu, 3000000); // 3 MHz Verified on PCB by jotego - m_maincpu->set_addrmap(AS_PROGRAM, &gunsmoke_state::gunsmoke_map); + // basic machine hardware + Z80(config, m_maincpu, 12_MHz_XTAL / 4); // 3 MHz Verified on PCB by jotego + m_maincpu->set_addrmap(AS_PROGRAM, &gunsmoke_state::main_map); m_maincpu->set_vblank_int("screen", FUNC(gunsmoke_state::irq0_line_hold)); - z80_device &audiocpu(Z80(config, "audiocpu", 3000000)); // 3 MHz + z80_device &audiocpu(Z80(config, "audiocpu", 12_MHz_XTAL / 4)); // 3 MHz, actually inside a 85H001 CAPCOM custom audiocpu.set_addrmap(AS_PROGRAM, &gunsmoke_state::sound_map); - audiocpu.set_periodic_int(FUNC(gunsmoke_state::irq0_line_hold), attotime::from_ticks(384*262/4, 6000000)); + audiocpu.set_periodic_int(FUNC(gunsmoke_state::irq0_line_hold), attotime::from_ticks(384*262/4, 12_MHz_XTAL / 2)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_raw(6000000, 384, 128, 0, 262, 22, 246); // hsync is 50..77, vsync is 257..259 - screen.set_screen_update(FUNC(gunsmoke_state::screen_update_gunsmoke)); + screen.set_raw(12_MHz_XTAL / 2, 384, 128, 0, 262, 22, 246); // hsync is 50..77, vsync is 257..259 + screen.set_screen_update(FUNC(gunsmoke_state::screen_update)); screen.set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_gunsmoke); - PALETTE(config, m_palette, FUNC(gunsmoke_state::gunsmoke_palette), 32*4 + 16*16 + 16*16, 256); + PALETTE(config, m_palette, FUNC(gunsmoke_state::palette), 32*4 + 16*16 + 16*16, 256); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, "soundlatch"); - ym2203_device &ym1(YM2203(config, "ym1", 1500000)); + ym2203_device &ym1(YM2203(config, "ym1", 12_MHz_XTAL / 8)); ym1.add_route(0, "mono", 0.22); ym1.add_route(1, "mono", 0.22); ym1.add_route(2, "mono", 0.22); ym1.add_route(3, "mono", 0.14); - ym2203_device &ym2(YM2203(config, "ym2", 1500000)); + ym2203_device &ym2(YM2203(config, "ym2", 12_MHz_XTAL / 8)); ym2.add_route(0, "mono", 0.22); ym2.add_route(1, "mono", 0.22); ym2.add_route(2, "mono", 0.22); ym2.add_route(3, "mono", 0.14); } -/* ROMs */ +// ROMs ROM_START( gunsmoke ) - ROM_REGION( 0x20000, "maincpu", 0 ) - ROM_LOAD( "gs03.09n", 0x00000, 0x8000, CRC(40a06cef) SHA1(3e2a52d476298b7252f0adaefdb42090351e921c) ) /* Code 0000-7fff */ // gse_03 ? - ROM_LOAD( "gs04.10n", 0x10000, 0x8000, CRC(8d4b423f) SHA1(149274c2ed1526ca1f419fdf8a24059ff138f7f2) ) /* Paged code */ - ROM_LOAD( "gs05.12n", 0x18000, 0x8000, CRC(2b5667fb) SHA1(5b689bca1e76d803b4cae22feaa7744fa528e93f) ) /* Paged code */ + ROM_REGION( 0x18000, "maincpu", 0 ) + ROM_LOAD( "gs03.09n", 0x00000, 0x8000, CRC(40a06cef) SHA1(3e2a52d476298b7252f0adaefdb42090351e921c) ) // Code 0000-7fff // gse_03 + ROM_LOAD( "gs04.10n", 0x08000, 0x8000, CRC(8d4b423f) SHA1(149274c2ed1526ca1f419fdf8a24059ff138f7f2) ) // Paged code + ROM_LOAD( "gs05.12n", 0x10000, 0x8000, CRC(2b5667fb) SHA1(5b689bca1e76d803b4cae22feaa7744fa528e93f) ) // Paged code ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "gs02.14h", 0x00000, 0x8000, CRC(cd7a2c38) SHA1(c76c471f694b76015370f0eacf5350e652f526ff) ) - ROM_REGION( 0x04000, "gfx1", 0 ) - ROM_LOAD( "gs01.11f", 0x00000, 0x4000, CRC(b61ece9b) SHA1(eb3fc62644cc5b5a2b9cbe67c393d4a0e2a59ca9) ) /* Characters */ + ROM_REGION( 0x04000, "chars", 0 ) + ROM_LOAD( "gs01.11f", 0x00000, 0x4000, CRC(b61ece9b) SHA1(eb3fc62644cc5b5a2b9cbe67c393d4a0e2a59ca9) ) - ROM_REGION( 0x40000, "gfx2", 0 ) - ROM_LOAD( "gs13.06c", 0x00000, 0x8000, CRC(f6769fc5) SHA1(d192ec176425327ca4b7e25fc8432fc47837ba29) ) /* 32x32 tiles planes 2-3 */ + ROM_REGION( 0x40000, "tiles", 0 ) + ROM_LOAD( "gs13.06c", 0x00000, 0x8000, CRC(f6769fc5) SHA1(d192ec176425327ca4b7e25fc8432fc47837ba29) ) // 32x32 tiles planes 2-3 ROM_LOAD( "gs12.05c", 0x08000, 0x8000, CRC(d997b78c) SHA1(3b4a9b6f9e57ecfb4ab9734379bd0ee765fd6daa) ) ROM_LOAD( "gs11.04c", 0x10000, 0x8000, CRC(125ba58e) SHA1(cf6931653cebd051564bed8121ab8713a55095c5) ) ROM_LOAD( "gs10.02c", 0x18000, 0x8000, CRC(f469c13c) SHA1(54eda52d6fce58771c0adfe2c88292a41d5a9b99) ) - ROM_LOAD( "gs09.06a", 0x20000, 0x8000, CRC(539f182d) SHA1(4190c0adbecc57b92f4d002e121acb77e8c5d8d8) ) /* 32x32 tiles planes 0-1 */ + ROM_LOAD( "gs09.06a", 0x20000, 0x8000, CRC(539f182d) SHA1(4190c0adbecc57b92f4d002e121acb77e8c5d8d8) ) // 32x32 tiles planes 0-1 ROM_LOAD( "gs08.05a", 0x28000, 0x8000, CRC(e87e526d) SHA1(d10068addf30322424a85bbc6382cb762ae3fbe2) ) ROM_LOAD( "gs07.04a", 0x30000, 0x8000, CRC(4382c0d2) SHA1(8615e62bc57b40d082f6ca211d64f22185bed1fd) ) ROM_LOAD( "gs06.02a", 0x38000, 0x8000, CRC(4cafe7a6) SHA1(fe501f3a5e9ce9e82e9708f1cd297f4c94ef0f81) ) - ROM_REGION( 0x40000, "gfx3", 0 ) - ROM_LOAD( "gs22.06n", 0x00000, 0x8000, CRC(dc9c508c) SHA1(920505dd4c63b177918feb4e54cca8a7948ec9d9) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs21.04n", 0x08000, 0x8000, CRC(68883749) SHA1(c7bf2bf49c53feddf8f30b4001dc2d59b52b1c28) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs20.03n", 0x10000, 0x8000, CRC(0be932ed) SHA1(1c5af5884a23112dbc36579515d1cb497992da2f) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs19.01n", 0x18000, 0x8000, CRC(63072f93) SHA1(cb3a2729782cf2855558d081fe92d28366228b8e) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs18.06l", 0x20000, 0x8000, CRC(f69a3c7c) SHA1(e9eb9dfa7d53aa7b728150f91d05bfc3bf6f1e75) ) /* Sprites planes 0-1 */ - ROM_LOAD( "gs17.04l", 0x28000, 0x8000, CRC(4e98562a) SHA1(0341b8a79be1d71a57d0d76ed890e15f9f92259e) ) /* Sprites planes 0-1 */ - ROM_LOAD( "gs16.03l", 0x30000, 0x8000, CRC(0d99c3b3) SHA1(436c566b76f632242448671e3b6319f7d9f65322) ) /* Sprites planes 0-1 */ - ROM_LOAD( "gs15.01l", 0x38000, 0x8000, CRC(7f14270e) SHA1(dd06c333c2ea097e25185a1423cd61e1b7afc42b) ) /* Sprites planes 0-1 */ - - ROM_REGION( 0x8000, "gfx4", 0 ) /* background tilemaps */ + ROM_REGION( 0x40000, "sprites", 0 ) + ROM_LOAD( "gs22.06n", 0x00000, 0x8000, CRC(dc9c508c) SHA1(920505dd4c63b177918feb4e54cca8a7948ec9d9) ) // Sprites planes 2-3 + ROM_LOAD( "gs21.04n", 0x08000, 0x8000, CRC(68883749) SHA1(c7bf2bf49c53feddf8f30b4001dc2d59b52b1c28) ) // Sprites planes 2-3 + ROM_LOAD( "gs20.03n", 0x10000, 0x8000, CRC(0be932ed) SHA1(1c5af5884a23112dbc36579515d1cb497992da2f) ) // Sprites planes 2-3 + ROM_LOAD( "gs19.01n", 0x18000, 0x8000, CRC(63072f93) SHA1(cb3a2729782cf2855558d081fe92d28366228b8e) ) // Sprites planes 2-3 + ROM_LOAD( "gs18.06l", 0x20000, 0x8000, CRC(f69a3c7c) SHA1(e9eb9dfa7d53aa7b728150f91d05bfc3bf6f1e75) ) // Sprites planes 0-1 + ROM_LOAD( "gs17.04l", 0x28000, 0x8000, CRC(4e98562a) SHA1(0341b8a79be1d71a57d0d76ed890e15f9f92259e) ) // Sprites planes 0-1 + ROM_LOAD( "gs16.03l", 0x30000, 0x8000, CRC(0d99c3b3) SHA1(436c566b76f632242448671e3b6319f7d9f65322) ) // Sprites planes 0-1 + ROM_LOAD( "gs15.01l", 0x38000, 0x8000, CRC(7f14270e) SHA1(dd06c333c2ea097e25185a1423cd61e1b7afc42b) ) // Sprites planes 0-1 + + ROM_REGION( 0x8000, "bgtiles", 0 ) ROM_LOAD( "gs14.11c", 0x00000, 0x8000, CRC(0af4f7eb) SHA1(24a98fdeedeeaf1035b4af52d5a8dd5e47a5e62d) ) ROM_REGION( 0x0a00, "proms", 0 ) - ROM_LOAD( "g-01.03b", 0x0000, 0x0100, CRC(02f55589) SHA1(8a3f98304aedf3aba1c08b615bf457752a480edc) ) /* red component */ - ROM_LOAD( "g-02.04b", 0x0100, 0x0100, CRC(e1e36dd9) SHA1(5bd88a35898a2d973045bdde8311aac3a12826de) ) /* green component */ - ROM_LOAD( "g-03.05b", 0x0200, 0x0100, CRC(989399c0) SHA1(e408e391f49ed0c7b9e16479fea44b809440fefc) ) /* blue component */ - ROM_LOAD( "g-04.09d", 0x0300, 0x0100, CRC(906612b5) SHA1(7b727a6200c088538180758320ede84aa7e5b96d) ) /* char lookup table */ - ROM_LOAD( "g-06.14a", 0x0400, 0x0100, CRC(4a9da18b) SHA1(fed3b81b56aab2ed0a21ed1fcebe3f1ae095a13b) ) /* tile lookup table */ - ROM_LOAD( "g-07.15a", 0x0500, 0x0100, CRC(cb9394fc) SHA1(8ad0fde6a8ef8326d2da4b6dbf3b51f5f6c668c8) ) /* tile palette bank */ - ROM_LOAD( "g-09.09f", 0x0600, 0x0100, CRC(3cee181e) SHA1(3f95bdb12391cb9b3673191bda8d09c84b36b4d3) ) /* sprite lookup table */ - ROM_LOAD( "g-08.08f", 0x0700, 0x0100, CRC(ef91cdd2) SHA1(90b9191c9f10a153d64055a4238eb6e15b8c12bc) ) /* sprite palette bank */ - ROM_LOAD( "g-10.02j", 0x0800, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* video timing (not used) */ - ROM_LOAD( "g-05.01f", 0x0900, 0x0100, CRC(25c90c2a) SHA1(42893572bab757ec01e181fc418cb911638d37e0) ) /* priority? (not used) */ + ROM_LOAD( "g-01.03b", 0x0000, 0x0100, CRC(02f55589) SHA1(8a3f98304aedf3aba1c08b615bf457752a480edc) ) // red component + ROM_LOAD( "g-02.04b", 0x0100, 0x0100, CRC(e1e36dd9) SHA1(5bd88a35898a2d973045bdde8311aac3a12826de) ) // green component + ROM_LOAD( "g-03.05b", 0x0200, 0x0100, CRC(989399c0) SHA1(e408e391f49ed0c7b9e16479fea44b809440fefc) ) // blue component + ROM_LOAD( "g-04.09d", 0x0300, 0x0100, CRC(906612b5) SHA1(7b727a6200c088538180758320ede84aa7e5b96d) ) // char lookup table + ROM_LOAD( "g-06.14a", 0x0400, 0x0100, CRC(4a9da18b) SHA1(fed3b81b56aab2ed0a21ed1fcebe3f1ae095a13b) ) // tile lookup table + ROM_LOAD( "g-07.15a", 0x0500, 0x0100, CRC(cb9394fc) SHA1(8ad0fde6a8ef8326d2da4b6dbf3b51f5f6c668c8) ) // tile palette bank + ROM_LOAD( "g-09.09f", 0x0600, 0x0100, CRC(3cee181e) SHA1(3f95bdb12391cb9b3673191bda8d09c84b36b4d3) ) // sprite lookup table + ROM_LOAD( "g-08.08f", 0x0700, 0x0100, CRC(ef91cdd2) SHA1(90b9191c9f10a153d64055a4238eb6e15b8c12bc) ) // sprite palette bank + ROM_LOAD( "g-10.02j", 0x0800, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // video timing (not used) + ROM_LOAD( "g-05.01f", 0x0900, 0x0100, CRC(25c90c2a) SHA1(42893572bab757ec01e181fc418cb911638d37e0) ) // priority? (not used) ROM_END ROM_START( gunsmokeb ) - ROM_REGION( 0x20000, "maincpu", 0 ) - ROM_LOAD( "3.ic85", 0x00000, 0x8000, CRC(ae6f4b75) SHA1(f4ee4f7a7d507ceaef9ce8165704fd80c8c1e8ba) ) /* Code 0000-7fff */ - ROM_LOAD( "4.ic86", 0x10000, 0x8000, CRC(8d4b423f) SHA1(149274c2ed1526ca1f419fdf8a24059ff138f7f2) ) /* Paged code */ - ROM_LOAD( "5.ic87", 0x18000, 0x8000, CRC(2b5667fb) SHA1(5b689bca1e76d803b4cae22feaa7744fa528e93f) ) /* Paged code */ + ROM_REGION( 0x18000, "maincpu", 0 ) + ROM_LOAD( "3.ic85", 0x00000, 0x8000, CRC(ae6f4b75) SHA1(f4ee4f7a7d507ceaef9ce8165704fd80c8c1e8ba) ) // Code 0000-7fff + ROM_LOAD( "4.ic86", 0x08000, 0x8000, CRC(8d4b423f) SHA1(149274c2ed1526ca1f419fdf8a24059ff138f7f2) ) // Paged code + ROM_LOAD( "5.ic87", 0x10000, 0x8000, CRC(2b5667fb) SHA1(5b689bca1e76d803b4cae22feaa7744fa528e93f) ) // Paged code ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "2.ic41", 0x00000, 0x8000, CRC(cd7a2c38) SHA1(c76c471f694b76015370f0eacf5350e652f526ff) ) - ROM_REGION( 0x04000, "gfx1", 0 ) - ROM_LOAD( "1.ic39", 0x00000, 0x4000, CRC(b61ece9b) SHA1(eb3fc62644cc5b5a2b9cbe67c393d4a0e2a59ca9) ) /* Characters */ + ROM_REGION( 0x04000, "chars", 0 ) + ROM_LOAD( "1.ic39", 0x00000, 0x4000, CRC(b61ece9b) SHA1(eb3fc62644cc5b5a2b9cbe67c393d4a0e2a59ca9) ) - ROM_REGION( 0x40000, "gfx2", 0 ) - ROM_LOAD( "13.ic21", 0x00000, 0x8000, CRC(f6769fc5) SHA1(d192ec176425327ca4b7e25fc8432fc47837ba29) ) /* 32x32 tiles planes 2-3 */ + ROM_REGION( 0x40000, "tiles", 0 ) + ROM_LOAD( "13.ic21", 0x00000, 0x8000, CRC(f6769fc5) SHA1(d192ec176425327ca4b7e25fc8432fc47837ba29) ) // 32x32 tiles planes 2-3 ROM_LOAD( "12.ic20", 0x08000, 0x8000, CRC(d997b78c) SHA1(3b4a9b6f9e57ecfb4ab9734379bd0ee765fd6daa) ) ROM_LOAD( "11.ic19", 0x10000, 0x8000, CRC(125ba58e) SHA1(cf6931653cebd051564bed8121ab8713a55095c5) ) ROM_LOAD( "10.ic18", 0x18000, 0x8000, CRC(f469c13c) SHA1(54eda52d6fce58771c0adfe2c88292a41d5a9b99) ) - ROM_LOAD( "9.ic04", 0x20000, 0x8000, CRC(539f182d) SHA1(4190c0adbecc57b92f4d002e121acb77e8c5d8d8) ) /* 32x32 tiles planes 0-1 */ - ROM_LOAD( "8.ic03", 0x28000, 0x8000, CRC(e87e526d) SHA1(d10068addf30322424a85bbc6382cb762ae3fbe2) ) - ROM_LOAD( "7.ic02", 0x30000, 0x8000, CRC(4382c0d2) SHA1(8615e62bc57b40d082f6ca211d64f22185bed1fd) ) - ROM_LOAD( "6.ic01", 0x38000, 0x8000, CRC(4cafe7a6) SHA1(fe501f3a5e9ce9e82e9708f1cd297f4c94ef0f81) ) - - ROM_REGION( 0x40000, "gfx3", 0 ) - ROM_LOAD( "22.ic134", 0x00000, 0x8000, CRC(dc9c508c) SHA1(920505dd4c63b177918feb4e54cca8a7948ec9d9) ) /* Sprites planes 2-3 */ - ROM_LOAD( "21.ic133", 0x08000, 0x8000, CRC(68883749) SHA1(c7bf2bf49c53feddf8f30b4001dc2d59b52b1c28) ) /* Sprites planes 2-3 */ - ROM_LOAD( "20.ic132", 0x10000, 0x8000, CRC(0be932ed) SHA1(1c5af5884a23112dbc36579515d1cb497992da2f) ) /* Sprites planes 2-3 */ - ROM_LOAD( "19.ic131", 0x18000, 0x8000, CRC(63072f93) SHA1(cb3a2729782cf2855558d081fe92d28366228b8e) ) /* Sprites planes 2-3 */ - ROM_LOAD( "18.ic115", 0x20000, 0x8000, CRC(f69a3c7c) SHA1(e9eb9dfa7d53aa7b728150f91d05bfc3bf6f1e75) ) /* Sprites planes 0-1 */ - ROM_LOAD( "17.ic114", 0x28000, 0x8000, CRC(4e98562a) SHA1(0341b8a79be1d71a57d0d76ed890e15f9f92259e) ) /* Sprites planes 0-1 */ - ROM_LOAD( "16.ic113", 0x30000, 0x8000, CRC(0d99c3b3) SHA1(436c566b76f632242448671e3b6319f7d9f65322) ) /* Sprites planes 0-1 */ - ROM_LOAD( "15.ic112", 0x38000, 0x8000, CRC(7f14270e) SHA1(dd06c333c2ea097e25185a1423cd61e1b7afc42b) ) /* Sprites planes 0-1 */ - - ROM_REGION( 0x8000, "gfx4", 0 ) /* background tilemaps */ + ROM_LOAD( "9.ic04", 0x20000, 0x8000, CRC(539f182d) SHA1(4190c0adbecc57b92f4d002e121acb77e8c5d8d8) ) // 32x32 tiles planes 0-1 + ROM_LOAD( "8.ic03", 0x28000, 0x8000, CRC(e87e526d) SHA1(d10068addf30322424a85bbc6382cb762ae3fbe2) ) + ROM_LOAD( "7.ic02", 0x30000, 0x8000, CRC(4382c0d2) SHA1(8615e62bc57b40d082f6ca211d64f22185bed1fd) ) + ROM_LOAD( "6.ic01", 0x38000, 0x8000, CRC(4cafe7a6) SHA1(fe501f3a5e9ce9e82e9708f1cd297f4c94ef0f81) ) + + ROM_REGION( 0x40000, "sprites", 0 ) + ROM_LOAD( "22.ic134", 0x00000, 0x8000, CRC(dc9c508c) SHA1(920505dd4c63b177918feb4e54cca8a7948ec9d9) ) // Sprites planes 2-3 + ROM_LOAD( "21.ic133", 0x08000, 0x8000, CRC(68883749) SHA1(c7bf2bf49c53feddf8f30b4001dc2d59b52b1c28) ) // Sprites planes 2-3 + ROM_LOAD( "20.ic132", 0x10000, 0x8000, CRC(0be932ed) SHA1(1c5af5884a23112dbc36579515d1cb497992da2f) ) // Sprites planes 2-3 + ROM_LOAD( "19.ic131", 0x18000, 0x8000, CRC(63072f93) SHA1(cb3a2729782cf2855558d081fe92d28366228b8e) ) // Sprites planes 2-3 + ROM_LOAD( "18.ic115", 0x20000, 0x8000, CRC(f69a3c7c) SHA1(e9eb9dfa7d53aa7b728150f91d05bfc3bf6f1e75) ) // Sprites planes 0-1 + ROM_LOAD( "17.ic114", 0x28000, 0x8000, CRC(4e98562a) SHA1(0341b8a79be1d71a57d0d76ed890e15f9f92259e) ) // Sprites planes 0-1 + ROM_LOAD( "16.ic113", 0x30000, 0x8000, CRC(0d99c3b3) SHA1(436c566b76f632242448671e3b6319f7d9f65322) ) // Sprites planes 0-1 + ROM_LOAD( "15.ic112", 0x38000, 0x8000, CRC(7f14270e) SHA1(dd06c333c2ea097e25185a1423cd61e1b7afc42b) ) // Sprites planes 0-1 + + ROM_REGION( 0x8000, "bgtiles", 0 ) ROM_LOAD( "14.ic25", 0x00000, 0x8000, CRC(0af4f7eb) SHA1(24a98fdeedeeaf1035b4af52d5a8dd5e47a5e62d) ) - /* The names of the proms starting with "g-" do not yet reflect their position in the pcb layout of this bootleg. - As the ICs are not socketed, but directly soldered to the pcb, it is harder to identify which is which. + /* The names of the PROMs starting with "g-" do not yet reflect their position in the PCB layout of this bootleg. + As the ICs are not socketed, but directly soldered to the PCB, it is harder to identify which is which. But it would be good to figure this out at some point, for the sake of documenting this specific board layout. */ ROM_REGION( 0x0a00, "proms", 0 ) - ROM_LOAD( "prom.ic3", 0x0000, 0x0100, CRC(02f55589) SHA1(8a3f98304aedf3aba1c08b615bf457752a480edc) ) /* red component */ - ROM_LOAD( "prom.ic4", 0x0100, 0x0100, CRC(e1e36dd9) SHA1(5bd88a35898a2d973045bdde8311aac3a12826de) ) /* green component */ - ROM_LOAD( "prom.ic5", 0x0200, 0x0100, CRC(989399c0) SHA1(e408e391f49ed0c7b9e16479fea44b809440fefc) ) /* blue component */ - ROM_LOAD( "g-04.09d", 0x0300, 0x0100, CRC(906612b5) SHA1(7b727a6200c088538180758320ede84aa7e5b96d) ) /* char lookup table */ - ROM_LOAD( "g-06.14a", 0x0400, 0x0100, CRC(4a9da18b) SHA1(fed3b81b56aab2ed0a21ed1fcebe3f1ae095a13b) ) /* tile lookup table */ - ROM_LOAD( "g-07.15a", 0x0500, 0x0100, CRC(cb9394fc) SHA1(8ad0fde6a8ef8326d2da4b6dbf3b51f5f6c668c8) ) /* tile palette bank */ - ROM_LOAD( "g-09.09f", 0x0600, 0x0100, CRC(3cee181e) SHA1(3f95bdb12391cb9b3673191bda8d09c84b36b4d3) ) /* sprite lookup table */ - ROM_LOAD( "g-08.08f", 0x0700, 0x0100, CRC(ef91cdd2) SHA1(90b9191c9f10a153d64055a4238eb6e15b8c12bc) ) /* sprite palette bank */ - ROM_LOAD( "g-10.02j", 0x0800, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* video timing (not used) */ - ROM_LOAD( "g-05.01f", 0x0900, 0x0100, CRC(25c90c2a) SHA1(42893572bab757ec01e181fc418cb911638d37e0) ) /* priority? (not used) */ + ROM_LOAD( "prom.ic3", 0x0000, 0x0100, CRC(02f55589) SHA1(8a3f98304aedf3aba1c08b615bf457752a480edc) ) // red component + ROM_LOAD( "prom.ic4", 0x0100, 0x0100, CRC(e1e36dd9) SHA1(5bd88a35898a2d973045bdde8311aac3a12826de) ) // green component + ROM_LOAD( "prom.ic5", 0x0200, 0x0100, CRC(989399c0) SHA1(e408e391f49ed0c7b9e16479fea44b809440fefc) ) // blue component + ROM_LOAD( "g-04.09d", 0x0300, 0x0100, CRC(906612b5) SHA1(7b727a6200c088538180758320ede84aa7e5b96d) ) // char lookup table + ROM_LOAD( "g-06.14a", 0x0400, 0x0100, CRC(4a9da18b) SHA1(fed3b81b56aab2ed0a21ed1fcebe3f1ae095a13b) ) // tile lookup table + ROM_LOAD( "g-07.15a", 0x0500, 0x0100, CRC(cb9394fc) SHA1(8ad0fde6a8ef8326d2da4b6dbf3b51f5f6c668c8) ) // tile palette bank + ROM_LOAD( "g-09.09f", 0x0600, 0x0100, CRC(3cee181e) SHA1(3f95bdb12391cb9b3673191bda8d09c84b36b4d3) ) // sprite lookup table + ROM_LOAD( "g-08.08f", 0x0700, 0x0100, CRC(ef91cdd2) SHA1(90b9191c9f10a153d64055a4238eb6e15b8c12bc) ) // sprite palette bank + ROM_LOAD( "g-10.02j", 0x0800, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // video timing (not used) + ROM_LOAD( "g-05.01f", 0x0900, 0x0100, CRC(25c90c2a) SHA1(42893572bab757ec01e181fc418cb911638d37e0) ) // priority? (not used) ROM_END ROM_START( gunsmokej ) - ROM_REGION( 0x20000, "maincpu", 0 ) - ROM_LOAD( "gsj_03.09n", 0x00000, 0x8000, CRC(b56b5df6) SHA1(0295a3ef491b6b8ee9c198fd08dddc29d88bbef6) ) /* Code 0000-7fff */ - ROM_LOAD( "gs04.10n", 0x10000, 0x8000, CRC(8d4b423f) SHA1(149274c2ed1526ca1f419fdf8a24059ff138f7f2) ) /* Paged code */ - ROM_LOAD( "gs05.12n", 0x18000, 0x8000, CRC(2b5667fb) SHA1(5b689bca1e76d803b4cae22feaa7744fa528e93f) ) /* Paged code */ + ROM_REGION( 0x18000, "maincpu", 0 ) + ROM_LOAD( "gsj_03.09n", 0x00000, 0x8000, CRC(b56b5df6) SHA1(0295a3ef491b6b8ee9c198fd08dddc29d88bbef6) ) // Code 0000-7fff + ROM_LOAD( "gs04.10n", 0x08000, 0x8000, CRC(8d4b423f) SHA1(149274c2ed1526ca1f419fdf8a24059ff138f7f2) ) // Paged code + ROM_LOAD( "gs05.12n", 0x10000, 0x8000, CRC(2b5667fb) SHA1(5b689bca1e76d803b4cae22feaa7744fa528e93f) ) // Paged code ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "gs02.14h", 0x00000, 0x8000, CRC(cd7a2c38) SHA1(c76c471f694b76015370f0eacf5350e652f526ff) ) - ROM_REGION( 0x04000, "gfx1", 0 ) - ROM_LOAD( "gs01.11f", 0x00000, 0x4000, CRC(b61ece9b) SHA1(eb3fc62644cc5b5a2b9cbe67c393d4a0e2a59ca9) ) /* Characters */ + ROM_REGION( 0x04000, "chars", 0 ) + ROM_LOAD( "gs01.11f", 0x00000, 0x4000, CRC(b61ece9b) SHA1(eb3fc62644cc5b5a2b9cbe67c393d4a0e2a59ca9) ) - ROM_REGION( 0x40000, "gfx2", 0 ) - ROM_LOAD( "gs13.06c", 0x00000, 0x8000, CRC(f6769fc5) SHA1(d192ec176425327ca4b7e25fc8432fc47837ba29) ) /* 32x32 tiles planes 2-3 */ + ROM_REGION( 0x40000, "tiles", 0 ) + ROM_LOAD( "gs13.06c", 0x00000, 0x8000, CRC(f6769fc5) SHA1(d192ec176425327ca4b7e25fc8432fc47837ba29) ) // 32x32 tiles planes 2-3 ROM_LOAD( "gs12.05c", 0x08000, 0x8000, CRC(d997b78c) SHA1(3b4a9b6f9e57ecfb4ab9734379bd0ee765fd6daa) ) ROM_LOAD( "gs11.04c", 0x10000, 0x8000, CRC(125ba58e) SHA1(cf6931653cebd051564bed8121ab8713a55095c5) ) ROM_LOAD( "gs10.02c", 0x18000, 0x8000, CRC(f469c13c) SHA1(54eda52d6fce58771c0adfe2c88292a41d5a9b99) ) - ROM_LOAD( "gs09.06a", 0x20000, 0x8000, CRC(539f182d) SHA1(4190c0adbecc57b92f4d002e121acb77e8c5d8d8) ) /* 32x32 tiles planes 0-1 */ + ROM_LOAD( "gs09.06a", 0x20000, 0x8000, CRC(539f182d) SHA1(4190c0adbecc57b92f4d002e121acb77e8c5d8d8) ) // 32x32 tiles planes 0-1 ROM_LOAD( "gs08.05a", 0x28000, 0x8000, CRC(e87e526d) SHA1(d10068addf30322424a85bbc6382cb762ae3fbe2) ) ROM_LOAD( "gs07.04a", 0x30000, 0x8000, CRC(4382c0d2) SHA1(8615e62bc57b40d082f6ca211d64f22185bed1fd) ) ROM_LOAD( "gs06.02a", 0x38000, 0x8000, CRC(4cafe7a6) SHA1(fe501f3a5e9ce9e82e9708f1cd297f4c94ef0f81) ) - ROM_REGION( 0x40000, "gfx3", 0 ) - ROM_LOAD( "gs22.06n", 0x00000, 0x8000, CRC(dc9c508c) SHA1(920505dd4c63b177918feb4e54cca8a7948ec9d9) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs21.04n", 0x08000, 0x8000, CRC(68883749) SHA1(c7bf2bf49c53feddf8f30b4001dc2d59b52b1c28) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs20.03n", 0x10000, 0x8000, CRC(0be932ed) SHA1(1c5af5884a23112dbc36579515d1cb497992da2f) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs19.01n", 0x18000, 0x8000, CRC(63072f93) SHA1(cb3a2729782cf2855558d081fe92d28366228b8e) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs18.06l", 0x20000, 0x8000, CRC(f69a3c7c) SHA1(e9eb9dfa7d53aa7b728150f91d05bfc3bf6f1e75) ) /* Sprites planes 0-1 */ - ROM_LOAD( "gs17.04l", 0x28000, 0x8000, CRC(4e98562a) SHA1(0341b8a79be1d71a57d0d76ed890e15f9f92259e) ) /* Sprites planes 0-1 */ - ROM_LOAD( "gs16.03l", 0x30000, 0x8000, CRC(0d99c3b3) SHA1(436c566b76f632242448671e3b6319f7d9f65322) ) /* Sprites planes 0-1 */ - ROM_LOAD( "gs15.01l", 0x38000, 0x8000, CRC(7f14270e) SHA1(dd06c333c2ea097e25185a1423cd61e1b7afc42b) ) /* Sprites planes 0-1 */ - - ROM_REGION( 0x8000, "gfx4", 0 ) /* background tilemaps */ + ROM_REGION( 0x40000, "sprites", 0 ) + ROM_LOAD( "gs22.06n", 0x00000, 0x8000, CRC(dc9c508c) SHA1(920505dd4c63b177918feb4e54cca8a7948ec9d9) ) // Sprites planes 2-3 + ROM_LOAD( "gs21.04n", 0x08000, 0x8000, CRC(68883749) SHA1(c7bf2bf49c53feddf8f30b4001dc2d59b52b1c28) ) // Sprites planes 2-3 + ROM_LOAD( "gs20.03n", 0x10000, 0x8000, CRC(0be932ed) SHA1(1c5af5884a23112dbc36579515d1cb497992da2f) ) // Sprites planes 2-3 + ROM_LOAD( "gs19.01n", 0x18000, 0x8000, CRC(63072f93) SHA1(cb3a2729782cf2855558d081fe92d28366228b8e) ) // Sprites planes 2-3 + ROM_LOAD( "gs18.06l", 0x20000, 0x8000, CRC(f69a3c7c) SHA1(e9eb9dfa7d53aa7b728150f91d05bfc3bf6f1e75) ) // Sprites planes 0-1 + ROM_LOAD( "gs17.04l", 0x28000, 0x8000, CRC(4e98562a) SHA1(0341b8a79be1d71a57d0d76ed890e15f9f92259e) ) // Sprites planes 0-1 + ROM_LOAD( "gs16.03l", 0x30000, 0x8000, CRC(0d99c3b3) SHA1(436c566b76f632242448671e3b6319f7d9f65322) ) // Sprites planes 0-1 + ROM_LOAD( "gs15.01l", 0x38000, 0x8000, CRC(7f14270e) SHA1(dd06c333c2ea097e25185a1423cd61e1b7afc42b) ) // Sprites planes 0-1 + + ROM_REGION( 0x8000, "bgtiles", 0 ) ROM_LOAD( "gs14.11c", 0x00000, 0x8000, CRC(0af4f7eb) SHA1(24a98fdeedeeaf1035b4af52d5a8dd5e47a5e62d) ) ROM_REGION( 0x0a00, "proms", 0 ) - ROM_LOAD( "g-01.03b", 0x0000, 0x0100, CRC(02f55589) SHA1(8a3f98304aedf3aba1c08b615bf457752a480edc) ) /* red component */ - ROM_LOAD( "g-02.04b", 0x0100, 0x0100, CRC(e1e36dd9) SHA1(5bd88a35898a2d973045bdde8311aac3a12826de) ) /* green component */ - ROM_LOAD( "g-03.05b", 0x0200, 0x0100, CRC(989399c0) SHA1(e408e391f49ed0c7b9e16479fea44b809440fefc) ) /* blue component */ - ROM_LOAD( "g-04.09d", 0x0300, 0x0100, CRC(906612b5) SHA1(7b727a6200c088538180758320ede84aa7e5b96d) ) /* char lookup table */ - ROM_LOAD( "g-06.14a", 0x0400, 0x0100, CRC(4a9da18b) SHA1(fed3b81b56aab2ed0a21ed1fcebe3f1ae095a13b) ) /* tile lookup table */ - ROM_LOAD( "g-07.15a", 0x0500, 0x0100, CRC(cb9394fc) SHA1(8ad0fde6a8ef8326d2da4b6dbf3b51f5f6c668c8) ) /* tile palette bank */ - ROM_LOAD( "g-09.09f", 0x0600, 0x0100, CRC(3cee181e) SHA1(3f95bdb12391cb9b3673191bda8d09c84b36b4d3) ) /* sprite lookup table */ - ROM_LOAD( "g-08.08f", 0x0700, 0x0100, CRC(ef91cdd2) SHA1(90b9191c9f10a153d64055a4238eb6e15b8c12bc) ) /* sprite palette bank */ - ROM_LOAD( "g-10.02j", 0x0800, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* video timing (not used) */ - ROM_LOAD( "g-05.01f", 0x0900, 0x0100, CRC(25c90c2a) SHA1(42893572bab757ec01e181fc418cb911638d37e0) ) /* priority? (not used) */ + ROM_LOAD( "g-01.03b", 0x0000, 0x0100, CRC(02f55589) SHA1(8a3f98304aedf3aba1c08b615bf457752a480edc) ) // red component + ROM_LOAD( "g-02.04b", 0x0100, 0x0100, CRC(e1e36dd9) SHA1(5bd88a35898a2d973045bdde8311aac3a12826de) ) // green component + ROM_LOAD( "g-03.05b", 0x0200, 0x0100, CRC(989399c0) SHA1(e408e391f49ed0c7b9e16479fea44b809440fefc) ) // blue component + ROM_LOAD( "g-04.09d", 0x0300, 0x0100, CRC(906612b5) SHA1(7b727a6200c088538180758320ede84aa7e5b96d) ) // char lookup table + ROM_LOAD( "g-06.14a", 0x0400, 0x0100, CRC(4a9da18b) SHA1(fed3b81b56aab2ed0a21ed1fcebe3f1ae095a13b) ) // tile lookup table + ROM_LOAD( "g-07.15a", 0x0500, 0x0100, CRC(cb9394fc) SHA1(8ad0fde6a8ef8326d2da4b6dbf3b51f5f6c668c8) ) // tile palette bank + ROM_LOAD( "g-09.09f", 0x0600, 0x0100, CRC(3cee181e) SHA1(3f95bdb12391cb9b3673191bda8d09c84b36b4d3) ) // sprite lookup table + ROM_LOAD( "g-08.08f", 0x0700, 0x0100, CRC(ef91cdd2) SHA1(90b9191c9f10a153d64055a4238eb6e15b8c12bc) ) // sprite palette bank + ROM_LOAD( "g-10.02j", 0x0800, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // video timing (not used) + ROM_LOAD( "g-05.01f", 0x0900, 0x0100, CRC(25c90c2a) SHA1(42893572bab757ec01e181fc418cb911638d37e0) ) // priority? (not used) ROM_END ROM_START( gunsmokeu ) - ROM_REGION( 0x20000, "maincpu", 0 ) - ROM_LOAD( "gsa_03.9n", 0x00000, 0x8000, CRC(51dc3f76) SHA1(2a188fee73c3662b665b56a825eb908b7b42dcd0) ) /* Code 0000-7fff */ - ROM_LOAD( "gs04.10n", 0x10000, 0x8000, CRC(5ecf31b8) SHA1(34ec9727330821a45b497c78c970a1a4f14ff4ee) ) /* Paged code */ - ROM_LOAD( "gs05.12n", 0x18000, 0x8000, CRC(1c9aca13) SHA1(eb92c373d2241aea4c59248e1b82717733105ac0) ) /* Paged code */ + ROM_REGION( 0x18000, "maincpu", 0 ) + ROM_LOAD( "gsa_03.9n", 0x00000, 0x8000, CRC(51dc3f76) SHA1(2a188fee73c3662b665b56a825eb908b7b42dcd0) ) // Code 0000-7fff + ROM_LOAD( "gs04.10n", 0x08000, 0x8000, CRC(5ecf31b8) SHA1(34ec9727330821a45b497c78c970a1a4f14ff4ee) ) // Paged code + ROM_LOAD( "gs05.12n", 0x10000, 0x8000, CRC(1c9aca13) SHA1(eb92c373d2241aea4c59248e1b82717733105ac0) ) // Paged code ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "gs02.14h", 0x00000, 0x8000, CRC(cd7a2c38) SHA1(c76c471f694b76015370f0eacf5350e652f526ff) ) - ROM_REGION( 0x04000, "gfx1", 0 ) - ROM_LOAD( "gs01.11f", 0x00000, 0x4000, CRC(b61ece9b) SHA1(eb3fc62644cc5b5a2b9cbe67c393d4a0e2a59ca9) ) /* Characters */ + ROM_REGION( 0x04000, "chars", 0 ) + ROM_LOAD( "gs01.11f", 0x00000, 0x4000, CRC(b61ece9b) SHA1(eb3fc62644cc5b5a2b9cbe67c393d4a0e2a59ca9) ) - ROM_REGION( 0x40000, "gfx2", 0 ) - ROM_LOAD( "gs13.06c", 0x00000, 0x8000, CRC(f6769fc5) SHA1(d192ec176425327ca4b7e25fc8432fc47837ba29) ) /* 32x32 tiles planes 2-3 */ + ROM_REGION( 0x40000, "tiles", 0 ) + ROM_LOAD( "gs13.06c", 0x00000, 0x8000, CRC(f6769fc5) SHA1(d192ec176425327ca4b7e25fc8432fc47837ba29) ) // 32x32 tiles planes 2-3 ROM_LOAD( "gs12.05c", 0x08000, 0x8000, CRC(d997b78c) SHA1(3b4a9b6f9e57ecfb4ab9734379bd0ee765fd6daa) ) ROM_LOAD( "gs11.04c", 0x10000, 0x8000, CRC(125ba58e) SHA1(cf6931653cebd051564bed8121ab8713a55095c5) ) ROM_LOAD( "gs10.02c", 0x18000, 0x8000, CRC(f469c13c) SHA1(54eda52d6fce58771c0adfe2c88292a41d5a9b99) ) - ROM_LOAD( "gs09.06a", 0x20000, 0x8000, CRC(539f182d) SHA1(4190c0adbecc57b92f4d002e121acb77e8c5d8d8) ) /* 32x32 tiles planes 0-1 */ + ROM_LOAD( "gs09.06a", 0x20000, 0x8000, CRC(539f182d) SHA1(4190c0adbecc57b92f4d002e121acb77e8c5d8d8) ) // 32x32 tiles planes 0-1 ROM_LOAD( "gs08.05a", 0x28000, 0x8000, CRC(e87e526d) SHA1(d10068addf30322424a85bbc6382cb762ae3fbe2) ) ROM_LOAD( "gs07.04a", 0x30000, 0x8000, CRC(4382c0d2) SHA1(8615e62bc57b40d082f6ca211d64f22185bed1fd) ) ROM_LOAD( "gs06.02a", 0x38000, 0x8000, CRC(4cafe7a6) SHA1(fe501f3a5e9ce9e82e9708f1cd297f4c94ef0f81) ) - ROM_REGION( 0x40000, "gfx3", 0 ) - ROM_LOAD( "gs22.06n", 0x00000, 0x8000, CRC(dc9c508c) SHA1(920505dd4c63b177918feb4e54cca8a7948ec9d9) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs21.04n", 0x08000, 0x8000, CRC(68883749) SHA1(c7bf2bf49c53feddf8f30b4001dc2d59b52b1c28) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs20.03n", 0x10000, 0x8000, CRC(0be932ed) SHA1(1c5af5884a23112dbc36579515d1cb497992da2f) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs19.01n", 0x18000, 0x8000, CRC(63072f93) SHA1(cb3a2729782cf2855558d081fe92d28366228b8e) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs18.06l", 0x20000, 0x8000, CRC(f69a3c7c) SHA1(e9eb9dfa7d53aa7b728150f91d05bfc3bf6f1e75) ) /* Sprites planes 0-1 */ - ROM_LOAD( "gs17.04l", 0x28000, 0x8000, CRC(4e98562a) SHA1(0341b8a79be1d71a57d0d76ed890e15f9f92259e) ) /* Sprites planes 0-1 */ - ROM_LOAD( "gs16.03l", 0x30000, 0x8000, CRC(0d99c3b3) SHA1(436c566b76f632242448671e3b6319f7d9f65322) ) /* Sprites planes 0-1 */ - ROM_LOAD( "gs15.01l", 0x38000, 0x8000, CRC(7f14270e) SHA1(dd06c333c2ea097e25185a1423cd61e1b7afc42b) ) /* Sprites planes 0-1 */ - - ROM_REGION( 0x8000, "gfx4", 0 ) /* background tilemaps */ + ROM_REGION( 0x40000, "sprites", 0 ) + ROM_LOAD( "gs22.06n", 0x00000, 0x8000, CRC(dc9c508c) SHA1(920505dd4c63b177918feb4e54cca8a7948ec9d9) ) // Sprites planes 2-3 + ROM_LOAD( "gs21.04n", 0x08000, 0x8000, CRC(68883749) SHA1(c7bf2bf49c53feddf8f30b4001dc2d59b52b1c28) ) // Sprites planes 2-3 + ROM_LOAD( "gs20.03n", 0x10000, 0x8000, CRC(0be932ed) SHA1(1c5af5884a23112dbc36579515d1cb497992da2f) ) // Sprites planes 2-3 + ROM_LOAD( "gs19.01n", 0x18000, 0x8000, CRC(63072f93) SHA1(cb3a2729782cf2855558d081fe92d28366228b8e) ) // Sprites planes 2-3 + ROM_LOAD( "gs18.06l", 0x20000, 0x8000, CRC(f69a3c7c) SHA1(e9eb9dfa7d53aa7b728150f91d05bfc3bf6f1e75) ) // Sprites planes 0-1 + ROM_LOAD( "gs17.04l", 0x28000, 0x8000, CRC(4e98562a) SHA1(0341b8a79be1d71a57d0d76ed890e15f9f92259e) ) // Sprites planes 0-1 + ROM_LOAD( "gs16.03l", 0x30000, 0x8000, CRC(0d99c3b3) SHA1(436c566b76f632242448671e3b6319f7d9f65322) ) // Sprites planes 0-1 + ROM_LOAD( "gs15.01l", 0x38000, 0x8000, CRC(7f14270e) SHA1(dd06c333c2ea097e25185a1423cd61e1b7afc42b) ) // Sprites planes 0-1 + + ROM_REGION( 0x8000, "bgtiles", 0 ) ROM_LOAD( "gs14.11c", 0x00000, 0x8000, CRC(0af4f7eb) SHA1(24a98fdeedeeaf1035b4af52d5a8dd5e47a5e62d) ) ROM_REGION( 0x0a00, "proms", 0 ) - ROM_LOAD( "g-01.03b", 0x0000, 0x0100, CRC(02f55589) SHA1(8a3f98304aedf3aba1c08b615bf457752a480edc) ) /* red component */ - ROM_LOAD( "g-02.04b", 0x0100, 0x0100, CRC(e1e36dd9) SHA1(5bd88a35898a2d973045bdde8311aac3a12826de) ) /* green component */ - ROM_LOAD( "g-03.05b", 0x0200, 0x0100, CRC(989399c0) SHA1(e408e391f49ed0c7b9e16479fea44b809440fefc) ) /* blue component */ - ROM_LOAD( "g-04.09d", 0x0300, 0x0100, CRC(906612b5) SHA1(7b727a6200c088538180758320ede84aa7e5b96d) ) /* char lookup table */ - ROM_LOAD( "g-06.14a", 0x0400, 0x0100, CRC(4a9da18b) SHA1(fed3b81b56aab2ed0a21ed1fcebe3f1ae095a13b) ) /* tile lookup table */ - ROM_LOAD( "g-07.15a", 0x0500, 0x0100, CRC(cb9394fc) SHA1(8ad0fde6a8ef8326d2da4b6dbf3b51f5f6c668c8) ) /* tile palette bank */ - ROM_LOAD( "g-09.09f", 0x0600, 0x0100, CRC(3cee181e) SHA1(3f95bdb12391cb9b3673191bda8d09c84b36b4d3) ) /* sprite lookup table */ - ROM_LOAD( "g-08.08f", 0x0700, 0x0100, CRC(ef91cdd2) SHA1(90b9191c9f10a153d64055a4238eb6e15b8c12bc) ) /* sprite palette bank */ - ROM_LOAD( "g-10.02j", 0x0800, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* video timing (not used) */ - ROM_LOAD( "g-05.01f", 0x0900, 0x0100, CRC(25c90c2a) SHA1(42893572bab757ec01e181fc418cb911638d37e0) ) /* priority? (not used) */ + ROM_LOAD( "g-01.03b", 0x0000, 0x0100, CRC(02f55589) SHA1(8a3f98304aedf3aba1c08b615bf457752a480edc) ) // red component + ROM_LOAD( "g-02.04b", 0x0100, 0x0100, CRC(e1e36dd9) SHA1(5bd88a35898a2d973045bdde8311aac3a12826de) ) // green component + ROM_LOAD( "g-03.05b", 0x0200, 0x0100, CRC(989399c0) SHA1(e408e391f49ed0c7b9e16479fea44b809440fefc) ) // blue component + ROM_LOAD( "g-04.09d", 0x0300, 0x0100, CRC(906612b5) SHA1(7b727a6200c088538180758320ede84aa7e5b96d) ) // char lookup table + ROM_LOAD( "g-06.14a", 0x0400, 0x0100, CRC(4a9da18b) SHA1(fed3b81b56aab2ed0a21ed1fcebe3f1ae095a13b) ) // tile lookup table + ROM_LOAD( "g-07.15a", 0x0500, 0x0100, CRC(cb9394fc) SHA1(8ad0fde6a8ef8326d2da4b6dbf3b51f5f6c668c8) ) // tile palette bank + ROM_LOAD( "g-09.09f", 0x0600, 0x0100, CRC(3cee181e) SHA1(3f95bdb12391cb9b3673191bda8d09c84b36b4d3) ) // sprite lookup table + ROM_LOAD( "g-08.08f", 0x0700, 0x0100, CRC(ef91cdd2) SHA1(90b9191c9f10a153d64055a4238eb6e15b8c12bc) ) // sprite palette bank + ROM_LOAD( "g-10.02j", 0x0800, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // video timing (not used) + ROM_LOAD( "g-05.01f", 0x0900, 0x0100, CRC(25c90c2a) SHA1(42893572bab757ec01e181fc418cb911638d37e0) ) // priority? (not used) ROM_END ROM_START( gunsmokeua ) - ROM_REGION( 0x20000, "maincpu", 0 ) // has a small extra piece of code at 0x2f00 and a jump to it at 0x297b, otherwise the same as gunsmokeub including the datecode, chip had an 'A' stamped on it, bugfix? - ROM_LOAD( "gsr_03a.9n", 0x00000, 0x8000, CRC(2f6e6ad7) SHA1(e9e4a367c240a35a1ba2eeaec9458996f7926f16) ) /* Code 0000-7fff */ - ROM_LOAD( "gs04.10n", 0x10000, 0x8000, CRC(8d4b423f) SHA1(149274c2ed1526ca1f419fdf8a24059ff138f7f2) ) /* Paged code */ - ROM_LOAD( "gs05.12n", 0x18000, 0x8000, CRC(2b5667fb) SHA1(5b689bca1e76d803b4cae22feaa7744fa528e93f) ) /* Paged code */ + ROM_REGION( 0x18000, "maincpu", 0 ) // has a small extra piece of code at 0x2f00 and a jump to it at 0x297b, otherwise the same as gunsmokeub including the datecode, chip had an 'A' stamped on it, bugfix? + ROM_LOAD( "gsr_03a.9n", 0x00000, 0x8000, CRC(2f6e6ad7) SHA1(e9e4a367c240a35a1ba2eeaec9458996f7926f16) ) // Code 0000-7fff + ROM_LOAD( "gs04.10n", 0x08000, 0x8000, CRC(8d4b423f) SHA1(149274c2ed1526ca1f419fdf8a24059ff138f7f2) ) // Paged code + ROM_LOAD( "gs05.12n", 0x10000, 0x8000, CRC(2b5667fb) SHA1(5b689bca1e76d803b4cae22feaa7744fa528e93f) ) // Paged code ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "gs02.14h", 0x00000, 0x8000, CRC(cd7a2c38) SHA1(c76c471f694b76015370f0eacf5350e652f526ff) ) - ROM_REGION( 0x04000, "gfx1", 0 ) - ROM_LOAD( "gs01.11f", 0x00000, 0x4000, CRC(b61ece9b) SHA1(eb3fc62644cc5b5a2b9cbe67c393d4a0e2a59ca9) ) /* Characters */ + ROM_REGION( 0x04000, "chars", 0 ) + ROM_LOAD( "gs01.11f", 0x00000, 0x4000, CRC(b61ece9b) SHA1(eb3fc62644cc5b5a2b9cbe67c393d4a0e2a59ca9) ) - ROM_REGION( 0x40000, "gfx2", 0 ) - ROM_LOAD( "gs13.06c", 0x00000, 0x8000, CRC(f6769fc5) SHA1(d192ec176425327ca4b7e25fc8432fc47837ba29) ) /* 32x32 tiles planes 2-3 */ + ROM_REGION( 0x40000, "tiles", 0 ) + ROM_LOAD( "gs13.06c", 0x00000, 0x8000, CRC(f6769fc5) SHA1(d192ec176425327ca4b7e25fc8432fc47837ba29) ) // 32x32 tiles planes 2-3 ROM_LOAD( "gs12.05c", 0x08000, 0x8000, CRC(d997b78c) SHA1(3b4a9b6f9e57ecfb4ab9734379bd0ee765fd6daa) ) ROM_LOAD( "gs11.04c", 0x10000, 0x8000, CRC(125ba58e) SHA1(cf6931653cebd051564bed8121ab8713a55095c5) ) ROM_LOAD( "gs10.02c", 0x18000, 0x8000, CRC(f469c13c) SHA1(54eda52d6fce58771c0adfe2c88292a41d5a9b99) ) - ROM_LOAD( "gs09.06a", 0x20000, 0x8000, CRC(539f182d) SHA1(4190c0adbecc57b92f4d002e121acb77e8c5d8d8) ) /* 32x32 tiles planes 0-1 */ + ROM_LOAD( "gs09.06a", 0x20000, 0x8000, CRC(539f182d) SHA1(4190c0adbecc57b92f4d002e121acb77e8c5d8d8) ) // 32x32 tiles planes 0-1 ROM_LOAD( "gs08.05a", 0x28000, 0x8000, CRC(e87e526d) SHA1(d10068addf30322424a85bbc6382cb762ae3fbe2) ) ROM_LOAD( "gs07.04a", 0x30000, 0x8000, CRC(4382c0d2) SHA1(8615e62bc57b40d082f6ca211d64f22185bed1fd) ) ROM_LOAD( "gs06.02a", 0x38000, 0x8000, CRC(4cafe7a6) SHA1(fe501f3a5e9ce9e82e9708f1cd297f4c94ef0f81) ) - ROM_REGION( 0x40000, "gfx3", 0 ) - ROM_LOAD( "gs22.06n", 0x00000, 0x8000, CRC(dc9c508c) SHA1(920505dd4c63b177918feb4e54cca8a7948ec9d9) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs21.04n", 0x08000, 0x8000, CRC(68883749) SHA1(c7bf2bf49c53feddf8f30b4001dc2d59b52b1c28) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs20.03n", 0x10000, 0x8000, CRC(0be932ed) SHA1(1c5af5884a23112dbc36579515d1cb497992da2f) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs19.01n", 0x18000, 0x8000, CRC(63072f93) SHA1(cb3a2729782cf2855558d081fe92d28366228b8e) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs18.06l", 0x20000, 0x8000, CRC(f69a3c7c) SHA1(e9eb9dfa7d53aa7b728150f91d05bfc3bf6f1e75) ) /* Sprites planes 0-1 */ - ROM_LOAD( "gs17.04l", 0x28000, 0x8000, CRC(4e98562a) SHA1(0341b8a79be1d71a57d0d76ed890e15f9f92259e) ) /* Sprites planes 0-1 */ - ROM_LOAD( "gs16.03l", 0x30000, 0x8000, CRC(0d99c3b3) SHA1(436c566b76f632242448671e3b6319f7d9f65322) ) /* Sprites planes 0-1 */ - ROM_LOAD( "gs15.01l", 0x38000, 0x8000, CRC(7f14270e) SHA1(dd06c333c2ea097e25185a1423cd61e1b7afc42b) ) /* Sprites planes 0-1 */ - - ROM_REGION( 0x8000, "gfx4", 0 ) /* background tilemaps */ + ROM_REGION( 0x40000, "sprites", 0 ) + ROM_LOAD( "gs22.06n", 0x00000, 0x8000, CRC(dc9c508c) SHA1(920505dd4c63b177918feb4e54cca8a7948ec9d9) ) // Sprites planes 2-3 + ROM_LOAD( "gs21.04n", 0x08000, 0x8000, CRC(68883749) SHA1(c7bf2bf49c53feddf8f30b4001dc2d59b52b1c28) ) // Sprites planes 2-3 + ROM_LOAD( "gs20.03n", 0x10000, 0x8000, CRC(0be932ed) SHA1(1c5af5884a23112dbc36579515d1cb497992da2f) ) // Sprites planes 2-3 + ROM_LOAD( "gs19.01n", 0x18000, 0x8000, CRC(63072f93) SHA1(cb3a2729782cf2855558d081fe92d28366228b8e) ) // Sprites planes 2-3 + ROM_LOAD( "gs18.06l", 0x20000, 0x8000, CRC(f69a3c7c) SHA1(e9eb9dfa7d53aa7b728150f91d05bfc3bf6f1e75) ) // Sprites planes 0-1 + ROM_LOAD( "gs17.04l", 0x28000, 0x8000, CRC(4e98562a) SHA1(0341b8a79be1d71a57d0d76ed890e15f9f92259e) ) // Sprites planes 0-1 + ROM_LOAD( "gs16.03l", 0x30000, 0x8000, CRC(0d99c3b3) SHA1(436c566b76f632242448671e3b6319f7d9f65322) ) // Sprites planes 0-1 + ROM_LOAD( "gs15.01l", 0x38000, 0x8000, CRC(7f14270e) SHA1(dd06c333c2ea097e25185a1423cd61e1b7afc42b) ) // Sprites planes 0-1 + + ROM_REGION( 0x8000, "bgtiles", 0 ) ROM_LOAD( "gs14.11c", 0x00000, 0x8000, CRC(0af4f7eb) SHA1(24a98fdeedeeaf1035b4af52d5a8dd5e47a5e62d) ) ROM_REGION( 0x0a00, "proms", 0 ) - ROM_LOAD( "g-01.03b", 0x0000, 0x0100, CRC(02f55589) SHA1(8a3f98304aedf3aba1c08b615bf457752a480edc) ) /* red component */ - ROM_LOAD( "g-02.04b", 0x0100, 0x0100, CRC(e1e36dd9) SHA1(5bd88a35898a2d973045bdde8311aac3a12826de) ) /* green component */ - ROM_LOAD( "g-03.05b", 0x0200, 0x0100, CRC(989399c0) SHA1(e408e391f49ed0c7b9e16479fea44b809440fefc) ) /* blue component */ - ROM_LOAD( "g-04.09d", 0x0300, 0x0100, CRC(906612b5) SHA1(7b727a6200c088538180758320ede84aa7e5b96d) ) /* char lookup table */ - ROM_LOAD( "g-06.14a", 0x0400, 0x0100, CRC(4a9da18b) SHA1(fed3b81b56aab2ed0a21ed1fcebe3f1ae095a13b) ) /* tile lookup table */ - ROM_LOAD( "g-07.15a", 0x0500, 0x0100, CRC(cb9394fc) SHA1(8ad0fde6a8ef8326d2da4b6dbf3b51f5f6c668c8) ) /* tile palette bank */ - ROM_LOAD( "g-09.09f", 0x0600, 0x0100, CRC(3cee181e) SHA1(3f95bdb12391cb9b3673191bda8d09c84b36b4d3) ) /* sprite lookup table */ - ROM_LOAD( "g-08.08f", 0x0700, 0x0100, CRC(ef91cdd2) SHA1(90b9191c9f10a153d64055a4238eb6e15b8c12bc) ) /* sprite palette bank */ - ROM_LOAD( "g-10.02j", 0x0800, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* video timing (not used) */ - ROM_LOAD( "g-05.01f", 0x0900, 0x0100, CRC(25c90c2a) SHA1(42893572bab757ec01e181fc418cb911638d37e0) ) /* priority? (not used) */ + ROM_LOAD( "g-01.03b", 0x0000, 0x0100, CRC(02f55589) SHA1(8a3f98304aedf3aba1c08b615bf457752a480edc) ) // red component + ROM_LOAD( "g-02.04b", 0x0100, 0x0100, CRC(e1e36dd9) SHA1(5bd88a35898a2d973045bdde8311aac3a12826de) ) // green component + ROM_LOAD( "g-03.05b", 0x0200, 0x0100, CRC(989399c0) SHA1(e408e391f49ed0c7b9e16479fea44b809440fefc) ) // blue component + ROM_LOAD( "g-04.09d", 0x0300, 0x0100, CRC(906612b5) SHA1(7b727a6200c088538180758320ede84aa7e5b96d) ) // char lookup table + ROM_LOAD( "g-06.14a", 0x0400, 0x0100, CRC(4a9da18b) SHA1(fed3b81b56aab2ed0a21ed1fcebe3f1ae095a13b) ) // tile lookup table + ROM_LOAD( "g-07.15a", 0x0500, 0x0100, CRC(cb9394fc) SHA1(8ad0fde6a8ef8326d2da4b6dbf3b51f5f6c668c8) ) // tile palette bank + ROM_LOAD( "g-09.09f", 0x0600, 0x0100, CRC(3cee181e) SHA1(3f95bdb12391cb9b3673191bda8d09c84b36b4d3) ) // sprite lookup table + ROM_LOAD( "g-08.08f", 0x0700, 0x0100, CRC(ef91cdd2) SHA1(90b9191c9f10a153d64055a4238eb6e15b8c12bc) ) // sprite palette bank + ROM_LOAD( "g-10.02j", 0x0800, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // video timing (not used) + ROM_LOAD( "g-05.01f", 0x0900, 0x0100, CRC(25c90c2a) SHA1(42893572bab757ec01e181fc418cb911638d37e0) ) // priority? (not used) ROM_END ROM_START( gunsmokeub ) - ROM_REGION( 0x20000, "maincpu", 0 ) - ROM_LOAD( "gsr_03.9n", 0x00000, 0x8000, CRC(592f211b) SHA1(8de44b3cafa3d2ce9aba515cf3ec4bac0bcdeb5b) ) /* Code 0000-7fff */ - ROM_LOAD( "gs04.10n", 0x10000, 0x8000, CRC(8d4b423f) SHA1(149274c2ed1526ca1f419fdf8a24059ff138f7f2) ) /* Paged code */ - ROM_LOAD( "gs05.12n", 0x18000, 0x8000, CRC(2b5667fb) SHA1(5b689bca1e76d803b4cae22feaa7744fa528e93f) ) /* Paged code */ + ROM_REGION( 0x18000, "maincpu", 0 ) + ROM_LOAD( "gsr_03.9n", 0x00000, 0x8000, CRC(592f211b) SHA1(8de44b3cafa3d2ce9aba515cf3ec4bac0bcdeb5b) ) // Code 0000-7fff + ROM_LOAD( "gs04.10n", 0x08000, 0x8000, CRC(8d4b423f) SHA1(149274c2ed1526ca1f419fdf8a24059ff138f7f2) ) // Paged code + ROM_LOAD( "gs05.12n", 0x10000, 0x8000, CRC(2b5667fb) SHA1(5b689bca1e76d803b4cae22feaa7744fa528e93f) ) // Paged code ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "gs02.14h", 0x00000, 0x8000, CRC(cd7a2c38) SHA1(c76c471f694b76015370f0eacf5350e652f526ff) ) - ROM_REGION( 0x04000, "gfx1", 0 ) - ROM_LOAD( "gs01.11f", 0x00000, 0x4000, CRC(b61ece9b) SHA1(eb3fc62644cc5b5a2b9cbe67c393d4a0e2a59ca9) ) /* Characters */ + ROM_REGION( 0x04000, "chars", 0 ) + ROM_LOAD( "gs01.11f", 0x00000, 0x4000, CRC(b61ece9b) SHA1(eb3fc62644cc5b5a2b9cbe67c393d4a0e2a59ca9) ) - ROM_REGION( 0x40000, "gfx2", 0 ) - ROM_LOAD( "gs13.06c", 0x00000, 0x8000, CRC(f6769fc5) SHA1(d192ec176425327ca4b7e25fc8432fc47837ba29) ) /* 32x32 tiles planes 2-3 */ + ROM_REGION( 0x40000, "tiles", 0 ) + ROM_LOAD( "gs13.06c", 0x00000, 0x8000, CRC(f6769fc5) SHA1(d192ec176425327ca4b7e25fc8432fc47837ba29) ) // 32x32 tiles planes 2-3 ROM_LOAD( "gs12.05c", 0x08000, 0x8000, CRC(d997b78c) SHA1(3b4a9b6f9e57ecfb4ab9734379bd0ee765fd6daa) ) ROM_LOAD( "gs11.04c", 0x10000, 0x8000, CRC(125ba58e) SHA1(cf6931653cebd051564bed8121ab8713a55095c5) ) ROM_LOAD( "gs10.02c", 0x18000, 0x8000, CRC(f469c13c) SHA1(54eda52d6fce58771c0adfe2c88292a41d5a9b99) ) - ROM_LOAD( "gs09.06a", 0x20000, 0x8000, CRC(539f182d) SHA1(4190c0adbecc57b92f4d002e121acb77e8c5d8d8) ) /* 32x32 tiles planes 0-1 */ + ROM_LOAD( "gs09.06a", 0x20000, 0x8000, CRC(539f182d) SHA1(4190c0adbecc57b92f4d002e121acb77e8c5d8d8) ) // 32x32 tiles planes 0-1 ROM_LOAD( "gs08.05a", 0x28000, 0x8000, CRC(e87e526d) SHA1(d10068addf30322424a85bbc6382cb762ae3fbe2) ) ROM_LOAD( "gs07.04a", 0x30000, 0x8000, CRC(4382c0d2) SHA1(8615e62bc57b40d082f6ca211d64f22185bed1fd) ) ROM_LOAD( "gs06.02a", 0x38000, 0x8000, CRC(4cafe7a6) SHA1(fe501f3a5e9ce9e82e9708f1cd297f4c94ef0f81) ) - ROM_REGION( 0x40000, "gfx3", 0 ) - ROM_LOAD( "gs22.06n", 0x00000, 0x8000, CRC(dc9c508c) SHA1(920505dd4c63b177918feb4e54cca8a7948ec9d9) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs21.04n", 0x08000, 0x8000, CRC(68883749) SHA1(c7bf2bf49c53feddf8f30b4001dc2d59b52b1c28) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs20.03n", 0x10000, 0x8000, CRC(0be932ed) SHA1(1c5af5884a23112dbc36579515d1cb497992da2f) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs19.01n", 0x18000, 0x8000, CRC(63072f93) SHA1(cb3a2729782cf2855558d081fe92d28366228b8e) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs18.06l", 0x20000, 0x8000, CRC(f69a3c7c) SHA1(e9eb9dfa7d53aa7b728150f91d05bfc3bf6f1e75) ) /* Sprites planes 0-1 */ - ROM_LOAD( "gs17.04l", 0x28000, 0x8000, CRC(4e98562a) SHA1(0341b8a79be1d71a57d0d76ed890e15f9f92259e) ) /* Sprites planes 0-1 */ - ROM_LOAD( "gs16.03l", 0x30000, 0x8000, CRC(0d99c3b3) SHA1(436c566b76f632242448671e3b6319f7d9f65322) ) /* Sprites planes 0-1 */ - ROM_LOAD( "gs15.01l", 0x38000, 0x8000, CRC(7f14270e) SHA1(dd06c333c2ea097e25185a1423cd61e1b7afc42b) ) /* Sprites planes 0-1 */ - - ROM_REGION( 0x8000, "gfx4", 0 ) /* background tilemaps */ + ROM_REGION( 0x40000, "sprites", 0 ) + ROM_LOAD( "gs22.06n", 0x00000, 0x8000, CRC(dc9c508c) SHA1(920505dd4c63b177918feb4e54cca8a7948ec9d9) ) // Sprites planes 2-3 + ROM_LOAD( "gs21.04n", 0x08000, 0x8000, CRC(68883749) SHA1(c7bf2bf49c53feddf8f30b4001dc2d59b52b1c28) ) // Sprites planes 2-3 + ROM_LOAD( "gs20.03n", 0x10000, 0x8000, CRC(0be932ed) SHA1(1c5af5884a23112dbc36579515d1cb497992da2f) ) // Sprites planes 2-3 + ROM_LOAD( "gs19.01n", 0x18000, 0x8000, CRC(63072f93) SHA1(cb3a2729782cf2855558d081fe92d28366228b8e) ) // Sprites planes 2-3 + ROM_LOAD( "gs18.06l", 0x20000, 0x8000, CRC(f69a3c7c) SHA1(e9eb9dfa7d53aa7b728150f91d05bfc3bf6f1e75) ) // Sprites planes 0-1 + ROM_LOAD( "gs17.04l", 0x28000, 0x8000, CRC(4e98562a) SHA1(0341b8a79be1d71a57d0d76ed890e15f9f92259e) ) // Sprites planes 0-1 + ROM_LOAD( "gs16.03l", 0x30000, 0x8000, CRC(0d99c3b3) SHA1(436c566b76f632242448671e3b6319f7d9f65322) ) // Sprites planes 0-1 + ROM_LOAD( "gs15.01l", 0x38000, 0x8000, CRC(7f14270e) SHA1(dd06c333c2ea097e25185a1423cd61e1b7afc42b) ) // Sprites planes 0-1 + + ROM_REGION( 0x8000, "bgtiles", 0 ) ROM_LOAD( "gs14.11c", 0x00000, 0x8000, CRC(0af4f7eb) SHA1(24a98fdeedeeaf1035b4af52d5a8dd5e47a5e62d) ) ROM_REGION( 0x0a00, "proms", 0 ) - ROM_LOAD( "g-01.03b", 0x0000, 0x0100, CRC(02f55589) SHA1(8a3f98304aedf3aba1c08b615bf457752a480edc) ) /* red component */ - ROM_LOAD( "g-02.04b", 0x0100, 0x0100, CRC(e1e36dd9) SHA1(5bd88a35898a2d973045bdde8311aac3a12826de) ) /* green component */ - ROM_LOAD( "g-03.05b", 0x0200, 0x0100, CRC(989399c0) SHA1(e408e391f49ed0c7b9e16479fea44b809440fefc) ) /* blue component */ - ROM_LOAD( "g-04.09d", 0x0300, 0x0100, CRC(906612b5) SHA1(7b727a6200c088538180758320ede84aa7e5b96d) ) /* char lookup table */ - ROM_LOAD( "g-06.14a", 0x0400, 0x0100, CRC(4a9da18b) SHA1(fed3b81b56aab2ed0a21ed1fcebe3f1ae095a13b) ) /* tile lookup table */ - ROM_LOAD( "g-07.15a", 0x0500, 0x0100, CRC(cb9394fc) SHA1(8ad0fde6a8ef8326d2da4b6dbf3b51f5f6c668c8) ) /* tile palette bank */ - ROM_LOAD( "g-09.09f", 0x0600, 0x0100, CRC(3cee181e) SHA1(3f95bdb12391cb9b3673191bda8d09c84b36b4d3) ) /* sprite lookup table */ - ROM_LOAD( "g-08.08f", 0x0700, 0x0100, CRC(ef91cdd2) SHA1(90b9191c9f10a153d64055a4238eb6e15b8c12bc) ) /* sprite palette bank */ - ROM_LOAD( "g-10.02j", 0x0800, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* video timing (not used) */ - ROM_LOAD( "g-05.01f", 0x0900, 0x0100, CRC(25c90c2a) SHA1(42893572bab757ec01e181fc418cb911638d37e0) ) /* priority? (not used) */ + ROM_LOAD( "g-01.03b", 0x0000, 0x0100, CRC(02f55589) SHA1(8a3f98304aedf3aba1c08b615bf457752a480edc) ) // red component + ROM_LOAD( "g-02.04b", 0x0100, 0x0100, CRC(e1e36dd9) SHA1(5bd88a35898a2d973045bdde8311aac3a12826de) ) // green component + ROM_LOAD( "g-03.05b", 0x0200, 0x0100, CRC(989399c0) SHA1(e408e391f49ed0c7b9e16479fea44b809440fefc) ) // blue component + ROM_LOAD( "g-04.09d", 0x0300, 0x0100, CRC(906612b5) SHA1(7b727a6200c088538180758320ede84aa7e5b96d) ) // char lookup table + ROM_LOAD( "g-06.14a", 0x0400, 0x0100, CRC(4a9da18b) SHA1(fed3b81b56aab2ed0a21ed1fcebe3f1ae095a13b) ) // tile lookup table + ROM_LOAD( "g-07.15a", 0x0500, 0x0100, CRC(cb9394fc) SHA1(8ad0fde6a8ef8326d2da4b6dbf3b51f5f6c668c8) ) // tile palette bank + ROM_LOAD( "g-09.09f", 0x0600, 0x0100, CRC(3cee181e) SHA1(3f95bdb12391cb9b3673191bda8d09c84b36b4d3) ) // sprite lookup table + ROM_LOAD( "g-08.08f", 0x0700, 0x0100, CRC(ef91cdd2) SHA1(90b9191c9f10a153d64055a4238eb6e15b8c12bc) ) // sprite palette bank + ROM_LOAD( "g-10.02j", 0x0800, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // video timing (not used) + ROM_LOAD( "g-05.01f", 0x0900, 0x0100, CRC(25c90c2a) SHA1(42893572bab757ec01e181fc418cb911638d37e0) ) // priority? (not used) ROM_END ROM_START( gunsmokeg ) - ROM_REGION( 0x20000, "maincpu", 0 ) + ROM_REGION( 0x18000, "maincpu", 0 ) ROM_LOAD( "gsg03.09n", 0x00000, 0x8000, CRC(8ad2754e) SHA1(221309d4d76e49f9b80849630b2846fc2e3d72a1) ) // Code 0000-7fff - ROM_LOAD( "gs04.10n", 0x10000, 0x8000, CRC(8d4b423f) SHA1(149274c2ed1526ca1f419fdf8a24059ff138f7f2) ) // Paged code - ROM_LOAD( "gs05.12n", 0x18000, 0x8000, CRC(2b5667fb) SHA1(5b689bca1e76d803b4cae22feaa7744fa528e93f) ) // Paged code + ROM_LOAD( "gs04.10n", 0x08000, 0x8000, CRC(8d4b423f) SHA1(149274c2ed1526ca1f419fdf8a24059ff138f7f2) ) // Paged code + ROM_LOAD( "gs05.12n", 0x10000, 0x8000, CRC(2b5667fb) SHA1(5b689bca1e76d803b4cae22feaa7744fa528e93f) ) // Paged code ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "gs02.14h", 0x00000, 0x8000, CRC(cd7a2c38) SHA1(c76c471f694b76015370f0eacf5350e652f526ff) ) - ROM_REGION( 0x04000, "gfx1", 0 ) + ROM_REGION( 0x04000, "chars", 0 ) ROM_LOAD( "gs01.11f", 0x00000, 0x4000, CRC(b61ece9b) SHA1(eb3fc62644cc5b5a2b9cbe67c393d4a0e2a59ca9) ) // Characters - ROM_REGION( 0x40000, "gfx2", 0 ) + ROM_REGION( 0x40000, "tiles", 0 ) ROM_LOAD( "gs13.06c", 0x00000, 0x8000, CRC(f6769fc5) SHA1(d192ec176425327ca4b7e25fc8432fc47837ba29) ) // 32x32 tiles planes 2-3 ROM_LOAD( "gs12.05c", 0x08000, 0x8000, CRC(d997b78c) SHA1(3b4a9b6f9e57ecfb4ab9734379bd0ee765fd6daa) ) ROM_LOAD( "gs11.04c", 0x10000, 0x8000, CRC(125ba58e) SHA1(cf6931653cebd051564bed8121ab8713a55095c5) ) @@ -663,7 +916,7 @@ ROM_START( gunsmokeg ) ROM_LOAD( "gs07.04a", 0x30000, 0x8000, CRC(4382c0d2) SHA1(8615e62bc57b40d082f6ca211d64f22185bed1fd) ) ROM_LOAD( "gsg06.02a", 0x38000, 0x8000, CRC(5cb850a7) SHA1(5b4fec3fae4d1947778c832c41f757414652f34a) ) - ROM_REGION( 0x40000, "gfx3", 0 ) + ROM_REGION( 0x40000, "sprites", 0 ) ROM_LOAD( "gsg22.06n", 0x00000, 0x8000, CRC(96779c38) SHA1(83f5811b7674e39fac6d127bcf2741a5ba111ec1) ) // Sprites planes 2-3 ROM_LOAD( "gsg21.04n", 0x08000, 0x8000, CRC(6e8a02c7) SHA1(8db5792ded8c6360e5a07f96b7799eae7591d719) ) // Sprites planes 2-3 ROM_LOAD( "gsg20.03n", 0x10000, 0x8000, CRC(139bf927) SHA1(f58bf8cffbc4e9e1a48c905d341f92a22df6cf37) ) // Sprites planes 2-3 @@ -673,7 +926,7 @@ ROM_START( gunsmokeg ) ROM_LOAD( "gsg16.03l", 0x30000, 0x8000, CRC(6620103b) SHA1(ef1260c05c958c115f54ddaffa213d320508ff11) ) // Sprites planes 0-1 ROM_LOAD( "gsg15.01l", 0x38000, 0x8000, CRC(ccc1c1b6) SHA1(feb480195bc4157d7be385b055bdd47505de6bc6) ) // Sprites planes 0-1 - ROM_REGION( 0x8000, "gfx4", 0 ) // Background tilemaps + ROM_REGION( 0x8000, "bgtiles", 0 ) ROM_LOAD( "gs14.11c", 0x00000, 0x8000, CRC(0af4f7eb) SHA1(24a98fdeedeeaf1035b4af52d5a8dd5e47a5e62d) ) ROM_REGION( 0x0a00, "proms", 0 ) @@ -689,16 +942,19 @@ ROM_START( gunsmokeg ) ROM_LOAD( "g-05.01f", 0x0900, 0x0100, CRC(25c90c2a) SHA1(42893572bab757ec01e181fc418cb911638d37e0) ) // Priority? (not used) ROM_END +} // anonymous namespace + + /* Game Drivers */ -// at 0x7E50 in the first rom is 85113 (project ident code?) and the project codename 'Gunman' both stored as ASCII. +// at 0x7E50 in the first ROM is 85113 (project ident code) and the project codename 'Gunman' both stored as ASCII. // Following that at (stored as raw data) is the build date in yyyymmdd format. After that a ROM identification string(?) which I've // left in the comment after each set. // this information is not displayed onscreen GAME( 1985, gunsmoke, 0, gunsmoke, gunsmoke, gunsmoke_state, empty_init, ROT270, "Capcom", "Gun.Smoke (World, 851115)", MACHINE_SUPPORTS_SAVE ) // GSE_03 -GAME( 1985, gunsmokeb, gunsmoke, gunsmoke, gunsmoke, gunsmoke_state, empty_init, ROT270, "bootleg", "Gun.Smoke (World, 851115) (bootleg)", MACHINE_SUPPORTS_SAVE ) // based on above version, warning message patched out +GAME( 1985, gunsmokeb, gunsmoke, gunsmoke, gunsmoke, gunsmoke_state, empty_init, ROT270, "bootleg", "Gun.Smoke (World, 851115) (bootleg)", MACHINE_SUPPORTS_SAVE ) // based on above version, warning message patched out GAME( 1985, gunsmokej, gunsmoke, gunsmoke, gunsmoke, gunsmoke_state, empty_init, ROT270, "Capcom", "Gun.Smoke (Japan, 851115)", MACHINE_SUPPORTS_SAVE ) // GSJ_03 GAME( 1986, gunsmokeu, gunsmoke, gunsmoke, gunsmokeu, gunsmoke_state, empty_init, ROT270, "Capcom (Romstar license)", "Gun.Smoke (US, 860408)", MACHINE_SUPPORTS_SAVE ) // GSA_03 GAME( 1985, gunsmokeua, gunsmoke, gunsmoke, gunsmoke, gunsmoke_state, empty_init, ROT270, "Capcom (Romstar license)", "Gun.Smoke (US, 851115, set 1)", MACHINE_SUPPORTS_SAVE ) // GSR_03 (03A on the chip) diff --git a/src/mame/drivers/junior80.cpp b/src/mame/drivers/junior80.cpp index a4c136a7584..913e7b1633c 100644 --- a/src/mame/drivers/junior80.cpp +++ b/src/mame/drivers/junior80.cpp @@ -296,5 +296,5 @@ ROM_START(junior80) ROM_LOAD( "junior80_seria_321-ok.ic46", 0x0000, 0x0800, CRC(07f09842) SHA1(c7591a1006ae59d6353859ca401c57ff6eb1d4ff) ) ROM_END -// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS -COMP( 1988, junior80, 0, 0, junior80, junior80, junior80_state, empty_init, "unknown", "Junior 80", MACHINE_IS_SKELETON ) +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS +COMP( 1988, junior80, 0, 0, junior80, junior80, junior80_state, empty_init, "<unknown>", "Junior 80", MACHINE_IS_SKELETON ) diff --git a/src/mame/drivers/konmedal68k.cpp b/src/mame/drivers/konmedal68k.cpp index 16d717cf442..01df99fa733 100644 --- a/src/mame/drivers/konmedal68k.cpp +++ b/src/mame/drivers/konmedal68k.cpp @@ -118,7 +118,10 @@ private: } if (offset & 1) + { offset |= 0x100000; + offset &= ~1; + } return m_k056832->piratesh_rom_r(offset); } diff --git a/src/mame/drivers/magicard.cpp b/src/mame/drivers/magicard.cpp index af5222aac99..7d7b0183132 100644 --- a/src/mame/drivers/magicard.cpp +++ b/src/mame/drivers/magicard.cpp @@ -7,6 +7,7 @@ Preliminary driver by Roberto Fresca, David Haywood & Angelo Salese + TODO: - driver based off raw guesses (we don't have relevant key docs); - Device-ize 66470 @@ -25,12 +26,14 @@ - Is int1_w unconnected? Doesn't seem to be enabled by games so far; - puzzleme: confirm it has a ssg (mapping matches hotslots); + Games running on this hardware: * Magic Card (set 1), Impera, 199?. * Magic Card (set 2), Impera, 199?. * Magic Card (set 3), Impera, 199?. - * Magic Card Export 94, Impera, 1994. + * Magic Card Export 94 (set 1), Impera, 1994. + * Magic Card Export 94 (set 2), Impera, 1994. * Magic Export (V.211A), Impera, 1994. * Magic Card Jackpot (4.01), Impera, 1998. * Magic Card - Wien (Sicherheitsversion 1.2), Impera, 1993. @@ -42,6 +45,9 @@ * Puzzle Me!, Impera, 199?. * unknown 'TE06', Impera, 199?. * Lucky 7 (Impera), Impera, 199?. + * unknown Poker 'W', unknown, 1993. + * Dallas Poker, unknown, 1993. + * Kajot Card (Version 1.01, Wien Euro), Amatic, 1993. ******************************************************************************* @@ -78,325 +84,27 @@ ******************************************************************************* - Magic Card Jackpot 4.01 - (Also Magic Lotto Export) - ------------------------- - - PCB Layout: - __________________________________________________________________________________________________ - | | - | SERIAL NUMBER |___ - | (A)_| - | __ _____ ___________ _________ ___| - | | | / \ |9524 GNN | |YMZ284-D | ___| - | | | |BATTERY| |HM514270AJ8| |_________| ___| - | |A | | +3V | |___________| ___| - | | | | | __________________ ________ __ ___| - | | | \_____/ ___________ | | |ULN2803A| |..| ___| - | |__| |9524 GNN | | MUSIC | |________| |..| ___| - | |HM514270AJ8| | TR9C1710-11PCA | |..|(J)_| - | |___________| | SA119X/9612 | _________ |..|| - | ___ ___ |__________________| |74HC273N | |..|| - | | | | | |_________| |..|| - | | | | | |..|| - | | B | | B | _________ _________ |..|| - | | | | | | 74HC04N | |74HC245N | |__|| - | | | | | |_________| |_________| |___ - | |___| |___| A___| - | ___| - | _____ ______________ ___| - | | | | | ________ ___| - | | | | PHILIPS | ___ ___________ ________ |ULN2803A| ___| - | | | EI79465--A/02 | SCC66470CAB | | D | |PIC16F84-10| | E | |________| ___| - | | C | LPL-CPU V4.0 | 172632=1/2 | |___| |___________| |________| ___| - | | | MULTI GAME | DfD0032I3 | _________ ___| - | | | 8603186 | | |74HC273N | ___| - | | | | | |_________| ___| - | | | | | ___| - | |_____| |______________| _ _________ ___| - | |G| |74HC245N | ___| - | |_| |_________| ___| - | _______ _______ ___| - | |] [| |IC21 | ______ ___ ___| - | |] E [| | | |ALTERA| |___| __ ___| - | |] M [| | | | MAX | F _________ |..| ___| - | |] P [| | MAGIC | ________________ | | |74HC245N | |..| ___| - | |] T [| | CARD | | | |EPM712| |_________| |..| ___| - | |] Y [| |JACKPOT| | PHILIPS | |8SQC10| |..| ___| - | |] [| | | | SCC68070CCA84 | |0-15 | |..| ___| - | |] S [| |Version| | 213140-1 | |______| X_TAL's |__| ___| - | |] O [| | 4.01| | DfD0103V3 | _ _ _ ___| - | |] C [| | | | | ALL RIGHTS | | | | | | ___| - | |] K [| |Vnr.: | | | BY IMPERA |1| |2| |3| ___| - | |] E [| |11.7.98| | | |_| |_| |_| ___| - | |] T [| | | | | ___| - | |] [| | | |________________| ___| - | |]_____[| |27C4002| ___| - | |_______| |_______| ___________ ___| - | ___________________ |RTC2421 A | ___| - | | ::::::::::::: | |___________| Z___| - | |___________________| | - |__________________________________________________________________________________________________| - - Xtal 1: 30.000 MHz. - Xtal 2: 8.000 MHz. - Xtal 3: 19.660 MHz. - - A = LT 0030 / LTC695CN / U18708 - B = NEC Japan / D43256BGU-70LL / 0008XD041 - C = MX B9819 / 29F1610MC-12C3 / M25685 / TAIWAN - D = 24C02C / 24C04 (Serial I2C Bus EEPROM with User-Defined Block Write Protection). - E = P0030SG / CD40106BCN - F = 74HCU04D - G = 74HC74D - - Silkscreened on the solder side: - - LEOTS. - 2800 - AT&S-F0 ML 94V-0 - - IMPERA AUSTRIA ------- - TEL: 0043/7242/27116 V 4.0 - FAX: 0043/7242/27053 ------- - -******************************************************************************* - - QUINGO EXPORT Version 5.00 - - Hardware PCB informations : E179465--A/02 LPL-CPU V4.0/MULTI GAME 8603186 + Impera boards... - Eprom type ST M27c4002 - Version 5.00 - vnr 27.07.99 Cksum (provided) 79C5 + KNOWN REVS | Used with these games | Differences to previews Revision + ====================================================================================================== + V 1.04 | lucky7i | lowest known revision, does not have a socket for the PIC + ------------------------------------------------------------------------------------------------------ + V 1.05 | unkte06, magicardw | PIC16C54 + XTAL got added + ------------------------------------------------------------------------------------------------------ + V 2.1 | puzzleme | ESI1, 24C02, YM2149F, RTC added + ------------------------------------------------------------------------------------------------------ + V 2.2 | magicarde | + ------------------------------------------------------------------------------------------------------ + V 4.0 | magicardj, magicardf, magicle | ESI1 replaced by ALTERA MAX EPM7128SQC100 + | | YM2149F replaced by YMZ284-D, MX29F1610 added + ------------------------------------------------------------------------------------------------------ - Eeprom : 24c04A - - PCB Layout: - __________________________________________________________________________________________________ - | | - | SERIAL NUMBER |___ - | (A)_| - | __ _____ ___________ _________ ___| - | | | / \ |9524 GNN | |YMZ284-D | ___| - | | | |BATTERY| |HM514270AJ8| |_________| ___| - | |A | | +3V | |___________| ___| - | | | | | __________________ ________ __ ___| - | | | \_____/ ___________ | | |ULN2803A| |..| ___| - | |__| |9524 GNN | | MUSIC | |________| |..| ___| - | |HM514270AJ8| | TR9C1710-11PCA | |..|(J)_| - | |___________| | SA119X/9612 | _________ |..|| - | ___ ___ |__________________| |74HC273N | |..|| - | | | | | |_________| |..|| - | | | | | |..|| - | | B | | B | _________ _________ |..|| - | | | | | | 74HC04N | |74HC245N | |__|| - | | | | | |_________| |_________| |___ - | |___| |___| A___| - | ___| - | _____ ______________ ___| - | | | | | ________ ___| - | | | | PHILIPS | ___ ___________ ________ |ULN2803A| ___| - | | | EI79465--A/02 | SCC66470CAB | | D | |PIC16F84-10| | E | |________| ___| - | | C | LPL-CPU V4.0 | 172632=1/2 | |___| |___________| |________| ___| - | | | MULTI GAME | DfD0032I3 | _________ ___| - | | | 8603186 | | |74HC273N | ___| - | | | | | |_________| ___| - | | | | | ___| - | |_____| |______________| _ _________ ___| - | |G| |74HC245N | ___| - | |_| |_________| ___| - | _______ _______ ___| - | |] [| |IC21 | ______ ___ ___| - | |] E [| | | |ALTERA| |___| __ ___| - | |] M [| | | | MAX | F _________ |..| ___| - | |] P [| |QUINGO | ________________ | | |74HC245N | |..| ___| - | |] T [| | EXPORT| | | |EPM712| |_________| |..| ___| - | |] Y [| | | | PHILIPS | |8SQC10| |..| ___| - | |] [| | | | SCC68070CCA84 | |0-15 | |..| ___| - | |] S [| |Version| | 213140-1 | |______| X_TAL's |__| ___| - | |] O [| | 5.00| | DfD0103V3 | _ _ _ ___| - | |] C [| | | | | ALL RIGHTS | | | | | | ___| - | |] K [| |Vnr.: | | | BY IMPERA |1| |2| |3| ___| - | |] E [| |270799 | | | |_| |_| |_| ___| - | |] T [| | | | | ___| - | |] [| | | |________________| ___| - | |]_____[| |27C4002| ___| - | |_______| |_______| ___________ ___| - | ___________________ |RTC2421 A | °°°°° ___| - | | ::::::::::::: | |___________| CON5 Z___| - | |___________________| | - |__________________________________________________________________________________________________| - - Xtal 1: 30.000 MHz. - Xtal 2: 8.000 MHz. - Xtal 3: 19.660 MHz. - - A = LT 0030 / LTC695CN / U18708 - B = NEC Japan / D43256BGU-70LL / 0008XD041 - C = MX B9819 / 29F1610MC-12C3 / M25685 / TAIWAN - D = 24C02C / 24C04 (Serial I2C Bus EEPROM with User-Defined Block Write Protection). - E = P0030SG / CD40106BCN - F = 74HCU04D - G = 74HC74D ******************************************************************************* - BIG DEAL BELGIEN Version 5.04 + For PCB layouts and extra info see the ROM Load of each game below. - Hardware PCB informations : E179465--A/02 LPL-CPU V4.0/MULTI GAME 8603186 - Eprom type ST M27c4002 - Version 5.04 - vnr 21.05.01 Cksum (provided) C4B7 - - Eeprom : 24c04A - - PCB Layout: - __________________________________________________________________________________________________ - | | - | SERIAL NUMBER |___ - | (A)_| - | __ _____ ___________ _________ ___| - | | | / \ |9524 GNN | |YMZ284-D | ___| - | | | |BATTERY| |HM514270AJ8| |_________| ___| - | |A | | +3V | |___________| ___| - | | | | | __________________ ________ __ ___| - | | | \_____/ ___________ | | |ULN2803A| |..| ___| - | |__| |9524 GNN | | MUSIC | |________| |..| ___| - | |HM514270AJ8| | TR9C1710-11PCA | |..|(J)_| - | |___________| | SA119X/9612 | _________ |..|| - | ___ ___ |__________________| |74HC273N | |..|| - | | | | | |_________| |..|| - | | | | | |..|| - | | B | | B | _________ _________ |..|| - | | | | | | 74HC04N | |74HC245N | |__|| - | | | | | |_________| |_________| |___ - | |___| |___| A___| - | ___| - | _____ ______________ ___| - | | | | | ________ ___| - | | | | PHILIPS | ___ ___________ ________ |ULN2803A| ___| - | | | EI79465--A/02 | SCC66470CAB | | D | |PIC16F84-10| | E | |________| ___| - | | C | LPL-CPU V4.0 | 172632=1/2 | |___| |___________| |________| ___| - | | | MULTI GAME | DfD0032I3 | _________ ___| - | | | 8603186 | | |74HC273N | ___| - | | | | | |_________| ___| - | | | | | ___| - | |_____| |______________| _ _________ ___| - | |G| |74HC245N | ___| - | |_| |_________| ___| - | _______ _______ ___| - | |] [| |IC21 | ______ ___ ___| - | |] E [| | | |ALTERA| |___| __ ___| - | |] M [| | BIG | | MAX | F _________ |..| ___| - | |] P [| | DEAL | ________________ | | |74HC245N | |..| ___| - | |] T [| |BELGIEN| | | |EPM712| |_________| |..| ___| - | |] Y [| | | | PHILIPS | |8SQC10| |..| ___| - | |] [| | | | SCC68070CCA84 | |0-15 | |..| ___| - | |] S [| |Version| | 213140-1 | |______| X_TAL's |__| ___| - | |] O [| | 5.04| | DfD0103V3 | _ _ _ ___| - | |] C [| | | | | ALL RIGHTS | | | | | | ___| - | |] K [| |Vnr.: | | | BY IMPERA |1| |2| |3| ___| - | |] E [| |210501 | | | |_| |_| |_| ___| - | |] T [| | | | | ___| - | |] [| | | |________________| ___| - | |]_____[| |27C4002| ___| - | |_______| |_______| ___________ ___| - | ___________________ |RTC2421 A | °°°°° ___| - | | ::::::::::::: | |___________| CON5 Z___| - | |___________________| | - |__________________________________________________________________________________________________| - - Xtal 1: 30.000 MHz. - Xtal 2: 8.000 MHz. - Xtal 3: 19.660 MHz. - - A = LT 0030 / LTC695CN / U18708 - B = NEC Japan / D43256BGU-70LL / 0008XD041 - C = MX B9819 / 29F1610MC-12C3 / M25685 / TAIWAN - D = 24C02C / 24C04 (Serial I2C Bus EEPROM with User-Defined Block Write Protection). - E = P0030SG / CD40106BCN - F = 74HCU04D - G = 74HC74D - -******************************************************************************* - - BEL SLOTS EXP. Version 5.01 - - Hardware PCB informations : E179465--A/02 LPL-CPU V4.0/MULTI GAME 8603186 - Eprom type ST M27c4002 - Version 5.01 - vnr 01.12.99 Cksum (provided) F718 - - Eeprom : 24c04A - - PCB Layout: - __________________________________________________________________________________________________ - | | - | SERIAL NUMBER |___ - | (A)_| - | __ _____ ___________ _________ ___| - | | | / \ |9524 GNN | |YMZ284-D | ___| - | | | |BATTERY| |HM514270AJ8| |_________| ___| - | |A | | +3V | |___________| ___| - | | | | | __________________ ________ __ ___| - | | | \_____/ ___________ | | |ULN2803A| |..| ___| - | |__| |9524 GNN | | MUSIC | |________| |..| ___| - | |HM514270AJ8| | TR9C1710-11PCA | |..|(J)_| - | |___________| | SA119X/9612 | _________ |..|| - | ___ ___ |__________________| |74HC273N | |..|| - | | | | | |_________| |..|| - | | | | | |..|| - | | B | | B | _________ _________ |..|| - | | | | | | 74HC04N | |74HC245N | |__|| - | | | | | |_________| |_________| |___ - | |___| |___| A___| - | ___| - | _____ ______________ ___| - | | | | | ________ ___| - | | | | PHILIPS | ___ ___________ ________ |ULN2803A| ___| - | | | EI79465--A/02 | SCC66470CAB | | D | |PIC16F84-10| | E | |________| ___| - | | C | LPL-CPU V4.0 | 172632=1/2 | |___| |___________| |________| ___| - | | | MULTI GAME | DfD0032I3 | _________ ___| - | | | 8603186 | | |74HC273N | ___| - | | | | | |_________| ___| - | | | | | ___| - | |_____| |______________| _ _________ ___| - | |G| |74HC245N | ___| - | |_| |_________| ___| - | _______ _______ ___| - | |] [| |IC21 | ______ ___ ___| - | |] E [| | | |ALTERA| |___| __ ___| - | |] M [| | BEL | | MAX | F _________ |..| ___| - | |] P [| | SLOTS | ________________ | | |74HC245N | |..| ___| - | |] T [| | EXP. | | | |EPM712| |_________| |..| ___| - | |] Y [| | | | PHILIPS | |8SQC10| |..| ___| - | |] [| | | | SCC68070CCA84 | |0-15 | |..| ___| - | |] S [| |Version| | 213140-1 | |______| X_TAL's |__| ___| - | |] O [| | 5.01| | DfD0103V3 | _ _ _ ___| - | |] C [| | | | | ALL RIGHTS | | | | | | ___| - | |] K [| |Vnr.: | | | BY IMPERA |1| |2| |3| ___| - | |] E [| |011299 | | | |_| |_| |_| ___| - | |] T [| | | | | ___| - | |] [| | | |________________| ___| - | |]_____[| |27C4002| ___| - | |_______| |_______| ___________ ___| - | ___________________ |RTC2421 A | °°°°° ___| - | | ::::::::::::: | |___________| CON5 Z___| - | |___________________| | - |__________________________________________________________________________________________________| - - Xtal 1: 30.000 MHz. - Xtal 2: 8.000 MHz. - Xtal 3: 19.660 MHz. - - A = LT 0030 / LTC695CN / U18708 - B = NEC Japan / D43256BGU-70LL / 0008XD041 - C = MX B9819 / 29F1610MC-12C3 / M25685 / TAIWAN - D = 24C02C / 24C04 (Serial I2C Bus EEPROM with User-Defined Block Write Protection). - E = P0030SG / CD40106BCN - F = 74HCU04D - G = 74HC74D *******************************************************************************/ @@ -455,9 +163,9 @@ private: }; -/************************* -* Video Hardware * -*************************/ +/********************************************* +* Video Hardware * +*********************************************/ /* 66470 @@ -485,7 +193,7 @@ TODO: check this register,doesn't seem to be 100% correct. r ........ .......1 BE = bus error generated by watchdog timer */ -/*63 at post test,6d all the time.*/ +// 63 at post test, 6d all the time. #define SCC_CSR_VREG (m_pcab_vregs[0x00/2] & 0xffff) #define SCC_CG_VREG ((SCC_CSR_VREG & 0x10)>>4) @@ -657,7 +365,7 @@ uint32_t magicard_state::screen_update_magicard(screen_device &screen, bitmap_rg uint32_t count = ((SCC_VSR_VREG) / 2); - if(SCC_FG_VREG) //4bpp gfx + if(SCC_FG_VREG) // 4bpp gfx { for(int y = 0; y < 300; y++) { @@ -689,7 +397,7 @@ uint32_t magicard_state::screen_update_magicard(screen_device &screen, bitmap_rg } } } - else //8bpp gfx + else // 8bpp gfx { for(int y = 0; y < 300; y++) { @@ -716,9 +424,9 @@ uint32_t magicard_state::screen_update_magicard(screen_device &screen, bitmap_rg } -/************************* -* R/W Handlers * -*************************/ +/********************************************* +* R/W Handlers * +*********************************************/ uint16_t magicard_state::test_r() { @@ -754,16 +462,16 @@ void magicard_state::philips_66470_w(offs_t offset, uint16_t data, uint16_t mem_ } -/************************* -* Memory Maps * -*************************/ +/********************************************* +* Memory Map Information * +*********************************************/ void magicard_state::magicard_map(address_map &map) { // map.global_mask(0x1fffff); map(0x00000000, 0x001ffbff).mirror(0x00200000).ram().share("magicram"); map(0x00600000, 0x007ffbff).ram().share("magicramb"); - /* 001ffc00-001ffdff System I/O */ + // 001ffc00-001ffdff System I/O map(0x001ffc00, 0x001ffc01).mirror(0x7fe00000).portr("SYSTEM"); map(0x001ffc40, 0x001ffc41).mirror(0x7fe00000).r(FUNC(magicard_state::test_r)); map(0x001ffd01, 0x001ffd01).mirror(0x7fe00000).w("ramdac", FUNC(ramdac_device::index_w)); @@ -772,7 +480,7 @@ void magicard_state::magicard_map(address_map &map) map(0x001ffd40, 0x001ffd43).mirror(0x7fe00000).w("saa", FUNC(saa1099_device::write)).umask16(0x00ff); map(0x001ffd80, 0x001ffd81).mirror(0x7fe00000).r(FUNC(magicard_state::test_r)); map(0x001ffd80, 0x001ffd81).mirror(0x7fe00000).nopw(); - map(0x001fff80, 0x001fffbf).mirror(0x7fe00000).ram(); //DRAM I/O, not accessed by this game, CD buffer? + map(0x001fff80, 0x001fffbf).mirror(0x7fe00000).ram(); // DRAM I/O, not accessed by this game, CD buffer? map(0x001fffe0, 0x001fffff).mirror(0x7fe00000).rw(FUNC(magicard_state::philips_66470_r), FUNC(magicard_state::philips_66470_w)).share("pcab_vregs"); } @@ -786,9 +494,9 @@ void magicard_state::hotslots_map(address_map &map) map(0x00000000, 0x001ffbff).mirror(0x00200000).ram().share("magicram"); map(0x00600000, 0x007ffbff).ram().share("magicramb"); map(0x00800000, 0x009ffbff).ram().share("magicramb"); - map(0x001fff80, 0x001fffbf).mirror(0x7fe00000).ram(); //DRAM I/O, not accessed by this game, CD buffer? + map(0x001fff80, 0x001fffbf).mirror(0x7fe00000).ram(); // DRAM I/O, not accessed by this game, CD buffer? map(0x001fffe0, 0x001fffff).mirror(0x7fe00000).rw(FUNC(magicard_state::philips_66470_r), FUNC(magicard_state::philips_66470_w)).share("pcab_vregs"); - map(0x00400000, 0x00403fff).ram(); // ? bigdeal0, magicardj accesses this as scratchram + map(0x00400000, 0x00403fff).ram(); // ? bigdeal0, magicardj accesses this as scratchram map(0x00411000, 0x00411001).portr("SYSTEM"); map(0x00414001, 0x00414001).w("ramdac", FUNC(ramdac_device::index_w)); map(0x00414003, 0x00414003).w("ramdac", FUNC(ramdac_device::pal_w)); @@ -799,9 +507,10 @@ void magicard_state::hotslots_map(address_map &map) map(0x00417001, 0x00417001).w("ssg", FUNC(ymz284_device::address_w)); } -/************************* -* Input ports * -*************************/ + +/********************************************* +* Input Ports * +*********************************************/ static INPUT_PORTS_START( magicard ) PORT_START("SYSTEM") @@ -829,6 +538,7 @@ static INPUT_PORTS_START( magicard ) PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0100, "SYSTEM1" ) PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) @@ -858,6 +568,10 @@ static INPUT_PORTS_START( magicard ) INPUT_PORTS_END +/****************************************** +* Machine Start & Reset * +******************************************/ + void magicard_state::machine_reset() { // TODO: confirm reset state @@ -875,9 +589,9 @@ void magicard_state::machine_reset() } -/************************* -* Machine Drivers * -*************************/ +/********************************************* +* Machine Drivers * +*********************************************/ TIMER_DEVICE_CALLBACK_MEMBER(magicard_state::magicard_scanline_cb) { @@ -900,7 +614,7 @@ void magicard_state::ramdac_map(address_map &map) void magicard_state::magicard(machine_config &config) { - SCC68070(config, m_maincpu, CLOCK_A); /* SCC-68070 CCA84 */ + SCC68070(config, m_maincpu, CLOCK_A); // SCC-68070 CCA84 m_maincpu->set_addrmap(AS_PROGRAM, &magicard_state::magicard_map); TIMER(config, "scantimer").configure_scanline(FUNC(magicard_state::magicard_scanline_cb), "screen", 0, 1); @@ -930,43 +644,128 @@ void magicard_state::hotslots(machine_config &config) YMZ284(config, "ssg", 4000000).add_route(ALL_OUTPUTS, "mono", 1.0); } -/************************* -* Rom Load * -*************************/ + +/********************************************* +* Rom Load * +*********************************************/ ROM_START( magicard ) - ROM_REGION( 0x80000, "maincpu", 0 ) /* 68070 Code & GFX */ + ROM_REGION( 0x80000, "maincpu", 0 ) // 68070 Code & GFX ROM_LOAD16_WORD_SWAP( "magicorg.bin", 0x000000, 0x80000, CRC(810edf9f) SHA1(0f1638a789a4be7413aa019b4e198353ba9c12d9) ) - ROM_REGION( 0x0100, "sereeprom", 0 ) /* Serial EPROM */ + ROM_REGION( 0x0100, "sereeprom", 0 ) // Serial EPROM ROM_LOAD16_WORD_SWAP("mgorigee.bin", 0x0000, 0x0100, CRC(73522889) SHA1(3e10d6c1585c3a63cff717a0b950528d5373c781) ) ROM_END ROM_START( magicarda ) - ROM_REGION( 0x80000, "maincpu", 0 ) /* 68070 Code & GFX */ + ROM_REGION( 0x80000, "maincpu", 0 ) // 68070 Code & GFX ROM_LOAD16_WORD_SWAP( "mcorigg2.bin", 0x00000, 0x20000, CRC(48546aa9) SHA1(23099a5e4c9f2c3386496f6d7f5bb7d435a6fb16) ) ROM_RELOAD( 0x40000, 0x20000 ) ROM_LOAD16_WORD_SWAP( "mcorigg1.bin", 0x20000, 0x20000, CRC(c9e4a38d) SHA1(812e5826b27c7ad98142a0f52fbdb6b61a2e31d7) ) ROM_RELOAD( 0x40001, 0x20000 ) - ROM_REGION( 0x0100, "sereeprom", 0 ) /* Serial EPROM */ + ROM_REGION( 0x0100, "sereeprom", 0 ) // Serial EPROM ROM_LOAD("mgorigee.bin", 0x0000, 0x0100, CRC(73522889) SHA1(3e10d6c1585c3a63cff717a0b950528d5373c781) ) ROM_END ROM_START( magicardb ) - ROM_REGION( 0x80000, "maincpu", 0 ) /* 68070 Code & GFX */ + ROM_REGION( 0x80000, "maincpu", 0 ) // 68070 Code & GFX ROM_LOAD16_WORD_SWAP( "mg_8.bin", 0x00000, 0x80000, CRC(f5499765) SHA1(63bcf40b91b43b218c1f9ec1d126a856f35d0844) ) /*bigger than the other sets?*/ - ROM_REGION( 0x20000, "other", 0 ) /* unknown */ + ROM_REGION( 0x20000, "other", 0 ) // unknown ROM_LOAD16_WORD_SWAP("mg_u3.bin", 0x00000, 0x20000, CRC(2116de31) SHA1(fb9c21ca936532e7c342db4bcaaac31c478b1a35) ) ROM_END +/* + Magic Card Jackpot 4.01 + (Also Magic Lotto Export) + ------------------------- + + PCB Layout: + __________________________________________________________________________________________________ + | | + | SERIAL NUMBER |___ + | (A)_| + | __ _____ ___________ _________ ___| + | | | / \ |9524 GNN | |YMZ284-D | ___| + | | | |BATTERY| |HM514270AJ8| |_________| ___| + | |A | | +3V | |___________| ___| + | | | | | __________________ ________ __ ___| + | | | \_____/ ___________ | | |ULN2803A| |..| ___| + | |__| |9524 GNN | | MUSIC | |________| |..| ___| + | |HM514270AJ8| | TR9C1710-11PCA | |..|(J)_| + | |___________| | SA119X/9612 | _________ |..|| + | ___ ___ |__________________| |74HC273N | |..|| + | | | | | |_________| |..|| + | | | | | |..|| + | | B | | B | _________ _________ |..|| + | | | | | | 74HC04N | |74HC245N | |__|| + | | | | | |_________| |_________| |___ + | |___| |___| A___| + | ___| + | _____ ______________ ___| + | | | | | ________ ___| + | | | | PHILIPS | ___ ___________ ________ |ULN2803A| ___| + | | | EI79465--A/02 | SCC66470CAB | | D | |PIC16F84-10| | E | |________| ___| + | | C | LPL-CPU V4.0 | 172632=1/2 | |___| |___________| |________| ___| + | | | MULTI GAME | DfD0032I3 | _________ ___| + | | | 8603186 | | |74HC273N | ___| + | | | | | |_________| ___| + | | | | | ___| + | |_____| |______________| _ _________ ___| + | |G| |74HC245N | ___| + | |_| |_________| ___| + | _______ _______ ___| + | |] [| |IC21 | ______ ___ ___| + | |] E [| | | |ALTERA| |___| __ ___| + | |] M [| | | | MAX | F _________ |..| ___| + | |] P [| | MAGIC | ________________ | | |74HC245N | |..| ___| + | |] T [| | CARD | | | |EPM712| |_________| |..| ___| + | |] Y [| |JACKPOT| | PHILIPS | |8SQC10| |..| ___| + | |] [| | | | SCC68070CCA84 | |0-15 | |..| ___| + | |] S [| |Version| | 213140-1 | |______| X_TAL's |__| ___| + | |] O [| | 4.01| | DfD0103V3 | _ _ _ ___| + | |] C [| | | | | ALL RIGHTS | | | | | | ___| + | |] K [| |Vnr.: | | | BY IMPERA |1| |2| |3| ___| + | |] E [| |11.7.98| | | |_| |_| |_| ___| + | |] T [| | | | | ___| + | |] [| | | |________________| ___| + | |]_____[| |27C4002| ___| + | |_______| |_______| ___________ ___| + | ___________________ |RTC2421 A | ___| + | | ::::::::::::: | |___________| Z___| + | |___________________| | + |__________________________________________________________________________________________________| + + Xtal 1: 30.000 MHz. + Xtal 2: 8.000 MHz. + Xtal 3: 19.660 MHz. + + A = LT 0030 / LTC695CN / U18708 + B = NEC Japan / D43256BGU-70LL / 0008XD041 + C = MX B9819 / 29F1610MC-12C3 / M25685 / TAIWAN + D = 24C02C / 24C04 (Serial I2C Bus EEPROM with User-Defined Block Write Protection). + E = P0030SG / CD40106BCN + F = 74HCU04D + G = 74HC74D + + Silkscreened on the solder side: + + LEOTS. + 2800 + AT&S-F0 ML 94V-0 + + IMPERA AUSTRIA ------- + TEL: 0043/7242/27116 V 4.0 + FAX: 0043/7242/27053 ------- + +*/ ROM_START( magicardj ) - ROM_REGION( 0x80000, "maincpu", 0 ) /* 68070 Code & GFX */ + ROM_REGION( 0x80000, "maincpu", 0 ) // 68070 Code & GFX ROM_LOAD16_WORD_SWAP( "27c4002.ic21", 0x00000, 0x80000, CRC(ab2ed583) SHA1(a2d7148b785a8dfce8cff3b15ada293d65561c98) ) // sldh - ROM_REGION16_LE( 0x4280, "pic16f84", 0 ) // decapped and dumped + ROM_REGION16_LE( 0x4280, "pic16f84", 0 ) // decapped and dumped ROM_LOAD("magicardj_4.01_pic16f84_code.bin", 0x0000, 0x0800, CRC(c6502436) SHA1(85c4126251bd60ec1f4e28615ec7f948ef8c088f) ) /* { @@ -992,16 +791,16 @@ ROM_START( magicardj ) ROM_FILL( 0x400f, 0x01, 0x00 ) ROM_LOAD("magicardj_4.01_pic16f84_data.bin", 0x4200, 0x0080, CRC(40961fef) SHA1(8617ef78d50842ea89d81d4db3728b3f799d7530) ) - ROM_REGION( 0x200000, "other", 0 ) /* unknown contents */ + ROM_REGION( 0x200000, "other", 0 ) // unknown contents ROM_LOAD("29f1610mc.ic30", 0x000000, 0x200000, NO_DUMP ) - ROM_REGION( 0x0100, "sereeprom", 0 ) /* Serial EPROM */ + ROM_REGION( 0x0100, "sereeprom", 0 ) // Serial EPROM ROM_LOAD("24c02c.ic26", 0x0000, 0x0100, CRC(b5c86862) SHA1(0debc0f7e7c506e5a4e2cae152548d80ad72fc2e) ) ROM_END /* Magic Card Export 94 - International Ver. 2.11a + International Ver. 2.11a (set 1) Vnr.29.07.94 CHECKSUM: A63D 1x Philips SCC66470CAB 383610 @@ -1015,20 +814,89 @@ ROM_END Q1: 19.6608 Mhz Q2: 30.000 Mhz Q3: 3686.400 1Q08/95 -*/ +*/ ROM_START( magicarde ) - ROM_REGION( 0x80000, "maincpu", 0 ) /* 68070 Code & GFX */ - ROM_LOAD16_WORD_SWAP( "27c4002.ic21", 0x00000, 0x80000, CRC(b5f24412) SHA1(73ff05c19132932a419fef0d5dc985440ce70e83) ) + ROM_REGION( 0x80000, "maincpu", 0 ) // 68070 Code & GFX + ROM_LOAD16_WORD_SWAP( "27c4002_v2.11a_a63d.ic21", 0x00000, 0x80000, CRC(b5f24412) SHA1(73ff05c19132932a419fef0d5dc985440ce70e83) ) - ROM_REGION( 0x2000, "pic16c54", 0 ) /* decapped */ + ROM_REGION( 0x2000, "pic16c54", 0 ) // decapped ROM_LOAD("pic16c54.ic29", 0x0000, 0x1fff, CRC(9c225a49) SHA1(249c12d23d1a85de828652c55a1a19ef8ec378ef) ) - ROM_REGION( 0x0100, "sereeprom", 0 ) /* Serial EPROM */ + ROM_REGION( 0x0100, "sereeprom", 0 ) // Serial EPROM ROM_LOAD("st24c02.ic26", 0x0000, 0x0100, CRC(98287c67) SHA1(ad34e55c1ce4f77c27049dac88050ed3c94af1a0) ) ROM_END /* + Magic Card Export 94 + International Ver. 2.11a (set 2) + Vnr.29.07.94 CHECKSUM: 9505 + + 1x Philips SCC66470CAB 383610 + 1x Philips SCC68070 CCA84 347141 + 1x ESI1 I9631 + 1x MUSIC TR9C1710-11PCA SA121X/9617 + 1x YAMAHA YM2149F 9614 + + XTAL: + + Q1: 19.6608 Mhz + Q2: 30.000 Mhz + Q3: 3686.400 1Q08/95 + +*/ +ROM_START( magicardea ) + ROM_REGION( 0x80000, "maincpu", 0 ) // 68070 Code & GFX + ROM_LOAD16_WORD_SWAP( "27c4002_v2.11a_9505.ic21", 0x00000, 0x80000, CRC(24c69c01) SHA1(0928800b9cfc2ae358f90b3f79c08acd2b2aa7d8) ) + + ROM_REGION( 0x2000, "pic16c54", 0 ) // decapped + ROM_LOAD("pic16c54.ic29", 0x0000, 0x1fff, CRC(9c225a49) SHA1(249c12d23d1a85de828652c55a1a19ef8ec378ef) ) + + ROM_REGION( 0x0100, "sereeprom", 0 ) // Serial EPROM + ROM_LOAD("st24c02.ic26", 0x0000, 0x0100, CRC(98287c67) SHA1(ad34e55c1ce4f77c27049dac88050ed3c94af1a0) ) +ROM_END + +/* + Magic Card Export 94 + Clubversion Export v2.9a + Vnr.02.08.94 CHECKSUM: 5B64 + + 1x Philips SCC66470CAB 383610 + 1x Philips SCC68070 CCA84 347141 + + Other components are unreadable + in the PCB picture. + +*/ +ROM_START( magicardeb ) + ROM_REGION( 0x80000, "maincpu", 0 ) // 68070 Code & GFX + ROM_LOAD16_WORD_SWAP( "27c4002_v2.9a_5b64.ic21", 0x00000, 0x80000, CRC(81ad0437) SHA1(117e2681541f786874cd0bce7f8bfb2bffb0b548) ) + + // PIC undumped + // Serial EPROM undumped +ROM_END + +/* + Magic Card Export + Version 4.01 + Vnr.07.03.98 CHECKSUM: AF18 + + 1x Philips SCC66470CAB 383610 + 1x Philips SCC68070 CCA84 347141 + + Other components are unreadable + in the PCB picture. + +*/ +ROM_START( magicardec ) + ROM_REGION( 0x80000, "maincpu", 0 ) // 68070 Code & GFX + ROM_LOAD16_WORD_SWAP( "27c4002_v4.01_af18.ic21", 0x00000, 0x80000, CRC(7700fd22) SHA1(0555c08c82f56e6399a89f6408e52d9d0beba2ac) ) + + // PIC undumped + // Serial EPROM undumped +ROM_END + +/* Magic Export. Ver 211A. @@ -1058,7 +926,6 @@ ROM_START( magicardf ) ROM_END /* - Magic Card - Wien Sicherheitsversion 1.2 @@ -1067,16 +934,16 @@ ROM_START( magicardw ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68070 Code & GFX ROM_LOAD16_WORD_SWAP( "am27c4096.bin", 0x00000, 0x80000, CRC(d9e2a4ec) SHA1(b3000ded242fa25709c90b9b2541c9d1d5cabebb) ) - ROM_REGION( 0x1fff, "pic16c54", 0 ) // decapped + ROM_REGION( 0x1fff, "pic16c54", 0 ) // decapped ROM_LOAD("pic16c54a.bin", 0x0000, 0x1fff, CRC(e777e814) SHA1(e0440be76fa1f3c7ae7d31e1b29a2ba73552231c) ) ROM_END ROM_START( magicle ) - ROM_REGION( 0x80000, "maincpu", 0 ) /* 68070 Code & GFX */ + ROM_REGION( 0x80000, "maincpu", 0 ) // 68070 Code & GFX ROM_LOAD16_WORD_SWAP( "27c4002.ic21", 0x00000, 0x80000, CRC(73328346) SHA1(fca5f8a93f25377e659c2b291674d706ca37400e) ) - ROM_REGION16_LE( 0x4280, "pic16f84", 0 ) // decapped and dumped + ROM_REGION16_LE( 0x4280, "pic16f84", 0 ) // decapped and dumped ROM_LOAD("magicle_5.03_pic16f84_code.bin", 0x0000, 0x0800, CRC(22965864) SHA1(c421a9e9fac7c9c5dc01adda620dc8f5f16d94ba) ) /* { @@ -1102,15 +969,14 @@ ROM_START( magicle ) ROM_FILL( 0x400f, 0x01, 0x00 ) ROM_LOAD("magicle_5.03_pic16f84_data.bin", 0x4200, 0x0080, CRC(b3cdf90f) SHA1(0afec6f78320e5fe653073769cdeb32918da061b) ) - ROM_REGION( 0x200000, "other", 0 ) /* unknown contents */ + ROM_REGION( 0x200000, "other", 0 ) // unknown contents ROM_LOAD("29f1610mc.ic30", 0x000000, 0x200000, NO_DUMP ) - ROM_REGION( 0x0200, "sereeprom", 0 ) /* Serial EPROM */ + ROM_REGION( 0x0200, "sereeprom", 0 ) // Serial EPROM ROM_LOAD("24c04a.ic26", 0x0000, 0x0200, CRC(48c4f473) SHA1(5355313cc96f655096e13bfae78be3ba2dfe8a2d) ) ROM_END /* - Hot Slots Version 6.00 Hardware PCB informations: @@ -1122,35 +988,102 @@ ROM_END */ ROM_START( hotslots ) - ROM_REGION( 0x80000, "maincpu", 0 ) /* 68070 Code & GFX */ + ROM_REGION( 0x80000, "maincpu", 0 ) // 68070 Code & GFX ROM_LOAD16_WORD_SWAP( "hot_slots_v600_15.04.02.bin", 0x00000, 0x80000, CRC(35677999) SHA1(7462eef3734b9b6087102901967a168a60ab7710) ) - ROM_REGION( 0x0100, "sereeprom", 0 ) /* Serial EPROM */ + ROM_REGION( 0x0100, "sereeprom", 0 ) // Serial EPROM ROM_LOAD16_WORD_SWAP("hot_slots_24c02.bin", 0x0000, 0x0100, CRC(fcac71ad) SHA1(1bb31e9a2d847430dc0d011f672cf3726dc6280c) ) ROM_END /* - QUINGO EXPORT Version 5.00 Hardware PCB informations : E179465--A/02 LPL-CPU V4.0/MULTI GAME 8603186 + Eprom type ST M27c4002 Version 5.00 vnr 27.07.99 Cksum (provided) 79C5 Eeprom : 24c04A + PCB Layout: + __________________________________________________________________________________________________ + | | + | SERIAL NUMBER |___ + | (A)_| + | __ _____ ___________ _________ ___| + | | | / \ |9524 GNN | |YMZ284-D | ___| + | | | |BATTERY| |HM514270AJ8| |_________| ___| + | |A | | +3V | |___________| ___| + | | | | | __________________ ________ __ ___| + | | | \_____/ ___________ | | |ULN2803A| |..| ___| + | |__| |9524 GNN | | MUSIC | |________| |..| ___| + | |HM514270AJ8| | TR9C1710-11PCA | |..|(J)_| + | |___________| | SA119X/9612 | _________ |..|| + | ___ ___ |__________________| |74HC273N | |..|| + | | | | | |_________| |..|| + | | | | | |..|| + | | B | | B | _________ _________ |..|| + | | | | | | 74HC04N | |74HC245N | |__|| + | | | | | |_________| |_________| |___ + | |___| |___| A___| + | ___| + | _____ ______________ ___| + | | | | | ________ ___| + | | | | PHILIPS | ___ ___________ ________ |ULN2803A| ___| + | | | EI79465--A/02 | SCC66470CAB | | D | |PIC16F84-10| | E | |________| ___| + | | C | LPL-CPU V4.0 | 172632=1/2 | |___| |___________| |________| ___| + | | | MULTI GAME | DfD0032I3 | _________ ___| + | | | 8603186 | | |74HC273N | ___| + | | | | | |_________| ___| + | | | | | ___| + | |_____| |______________| _ _________ ___| + | |G| |74HC245N | ___| + | |_| |_________| ___| + | _______ _______ ___| + | |] [| |IC21 | ______ ___ ___| + | |] E [| | | |ALTERA| |___| __ ___| + | |] M [| | | | MAX | F _________ |..| ___| + | |] P [| |QUINGO | ________________ | | |74HC245N | |..| ___| + | |] T [| | EXPORT| | | |EPM712| |_________| |..| ___| + | |] Y [| | | | PHILIPS | |8SQC10| |..| ___| + | |] [| | | | SCC68070CCA84 | |0-15 | |..| ___| + | |] S [| |Version| | 213140-1 | |______| X_TAL's |__| ___| + | |] O [| | 5.00| | DfD0103V3 | _ _ _ ___| + | |] C [| | | | | ALL RIGHTS | | | | | | ___| + | |] K [| |Vnr.: | | | BY IMPERA |1| |2| |3| ___| + | |] E [| |270799 | | | |_| |_| |_| ___| + | |] T [| | | | | ___| + | |] [| | | |________________| ___| + | |]_____[| |27C4002| ___| + | |_______| |_______| ___________ ___| + | ___________________ |RTC2421 A | °°°°° ___| + | | ::::::::::::: | |___________| CON5 Z___| + | |___________________| | + |__________________________________________________________________________________________________| + + Xtal 1: 30.000 MHz. + Xtal 2: 8.000 MHz. + Xtal 3: 19.660 MHz. + + A = LT 0030 / LTC695CN / U18708 + B = NEC Japan / D43256BGU-70LL / 0008XD041 + C = MX B9819 / 29F1610MC-12C3 / M25685 / TAIWAN + D = 24C02C / 24C04 (Serial I2C Bus EEPROM with User-Defined Block Write Protection). + E = P0030SG / CD40106BCN + F = 74HCU04D + G = 74HC74D + */ ROM_START( quingo ) - ROM_REGION( 0x80000, "maincpu", 0 ) /* 68070 Code & GFX */ + ROM_REGION( 0x80000, "maincpu", 0 ) // 68070 Code & GFX ROM_LOAD16_WORD_SWAP( "quingo_export_v500_27.07.99.bin", 0x00000, 0x80000, CRC(2cd89fe3) SHA1(bdd256d5114227166aff1c9f84b573e5f00530fd) ) - ROM_REGION( 0x0200, "sereeprom", 0 ) /* Serial EPROM */ + ROM_REGION( 0x0200, "sereeprom", 0 ) // Serial EPROM ROM_LOAD16_WORD_SWAP("quingo_24c04a.bin", 0x0000, 0x0200, BAD_DUMP CRC(d5e82b49) SHA1(7dbdf7d539cbd59a3ac546b6f50861c4958abb3a) ) // all AA & 55 ROM_END /* - BIG DEAL BELGIEN Version 5.04 Hardware PCB informations : E179465--A/02 LPL-CPU V4.0/MULTI GAME 8603186 @@ -1158,20 +1091,86 @@ ROM_END Version 5.04 vnr 21.05.01 Cksum (provided) C4B7 - Eeprom : 24c04A + PCB Layout: + __________________________________________________________________________________________________ + | | + | SERIAL NUMBER |___ + | (A)_| + | __ _____ ___________ _________ ___| + | | | / \ |9524 GNN | |YMZ284-D | ___| + | | | |BATTERY| |HM514270AJ8| |_________| ___| + | |A | | +3V | |___________| ___| + | | | | | __________________ ________ __ ___| + | | | \_____/ ___________ | | |ULN2803A| |..| ___| + | |__| |9524 GNN | | MUSIC | |________| |..| ___| + | |HM514270AJ8| | TR9C1710-11PCA | |..|(J)_| + | |___________| | SA119X/9612 | _________ |..|| + | ___ ___ |__________________| |74HC273N | |..|| + | | | | | |_________| |..|| + | | | | | |..|| + | | B | | B | _________ _________ |..|| + | | | | | | 74HC04N | |74HC245N | |__|| + | | | | | |_________| |_________| |___ + | |___| |___| A___| + | ___| + | _____ ______________ ___| + | | | | | ________ ___| + | | | | PHILIPS | ___ ___________ ________ |ULN2803A| ___| + | | | EI79465--A/02 | SCC66470CAB | | D | |PIC16F84-10| | E | |________| ___| + | | C | LPL-CPU V4.0 | 172632=1/2 | |___| |___________| |________| ___| + | | | MULTI GAME | DfD0032I3 | _________ ___| + | | | 8603186 | | |74HC273N | ___| + | | | | | |_________| ___| + | | | | | ___| + | |_____| |______________| _ _________ ___| + | |G| |74HC245N | ___| + | |_| |_________| ___| + | _______ _______ ___| + | |] [| |IC21 | ______ ___ ___| + | |] E [| | | |ALTERA| |___| __ ___| + | |] M [| | BIG | | MAX | F _________ |..| ___| + | |] P [| | DEAL | ________________ | | |74HC245N | |..| ___| + | |] T [| |BELGIEN| | | |EPM712| |_________| |..| ___| + | |] Y [| | | | PHILIPS | |8SQC10| |..| ___| + | |] [| | | | SCC68070CCA84 | |0-15 | |..| ___| + | |] S [| |Version| | 213140-1 | |______| X_TAL's |__| ___| + | |] O [| | 5.04| | DfD0103V3 | _ _ _ ___| + | |] C [| | | | | ALL RIGHTS | | | | | | ___| + | |] K [| |Vnr.: | | | BY IMPERA |1| |2| |3| ___| + | |] E [| |210501 | | | |_| |_| |_| ___| + | |] T [| | | | | ___| + | |] [| | | |________________| ___| + | |]_____[| |27C4002| ___| + | |_______| |_______| ___________ ___| + | ___________________ |RTC2421 A | °°°°° ___| + | | ::::::::::::: | |___________| CON5 Z___| + | |___________________| | + |__________________________________________________________________________________________________| + + Xtal 1: 30.000 MHz. + Xtal 2: 8.000 MHz. + Xtal 3: 19.660 MHz. + + A = LT 0030 / LTC695CN / U18708 + B = NEC Japan / D43256BGU-70LL / 0008XD041 + C = MX B9819 / 29F1610MC-12C3 / M25685 / TAIWAN + D = 24C02C / 24C04 (Serial I2C Bus EEPROM with User-Defined Block Write Protection). + E = P0030SG / CD40106BCN + F = 74HCU04D + G = 74HC74D + */ ROM_START( bigdeal0 ) - ROM_REGION( 0x80000, "maincpu", 0 ) /* 68070 Code & GFX */ + ROM_REGION( 0x80000, "maincpu", 0 ) // 68070 Code & GFX ROM_LOAD16_WORD_SWAP( "big_deal_belgien_v504_21.05.01.bin", 0x00000, 0x80000, CRC(3e3484db) SHA1(78bb655deacc57ad041a46de7ef153ce25922a8a) ) - ROM_REGION( 0x0200, "sereeprom", 0 ) /* Serial EPROM */ + ROM_REGION( 0x0200, "sereeprom", 0 ) // Serial EPROM ROM_LOAD16_WORD_SWAP("big_deal_24c04a.bin", 0x0000, 0x0200, BAD_DUMP CRC(d5e82b49) SHA1(7dbdf7d539cbd59a3ac546b6f50861c4958abb3a) ) // all AA & 55 ROM_END /* - BEL SLOTS EXP. Version 5.01 Hardware PCB informations : E179465--A/02 LPL-CPU V4.0/MULTI GAME 8603186 @@ -1181,12 +1180,80 @@ ROM_END Eeprom : 24c04A + PCB Layout: + __________________________________________________________________________________________________ + | | + | SERIAL NUMBER |___ + | (A)_| + | __ _____ ___________ _________ ___| + | | | / \ |9524 GNN | |YMZ284-D | ___| + | | | |BATTERY| |HM514270AJ8| |_________| ___| + | |A | | +3V | |___________| ___| + | | | | | __________________ ________ __ ___| + | | | \_____/ ___________ | | |ULN2803A| |..| ___| + | |__| |9524 GNN | | MUSIC | |________| |..| ___| + | |HM514270AJ8| | TR9C1710-11PCA | |..|(J)_| + | |___________| | SA119X/9612 | _________ |..|| + | ___ ___ |__________________| |74HC273N | |..|| + | | | | | |_________| |..|| + | | | | | |..|| + | | B | | B | _________ _________ |..|| + | | | | | | 74HC04N | |74HC245N | |__|| + | | | | | |_________| |_________| |___ + | |___| |___| A___| + | ___| + | _____ ______________ ___| + | | | | | ________ ___| + | | | | PHILIPS | ___ ___________ ________ |ULN2803A| ___| + | | | EI79465--A/02 | SCC66470CAB | | D | |PIC16F84-10| | E | |________| ___| + | | C | LPL-CPU V4.0 | 172632=1/2 | |___| |___________| |________| ___| + | | | MULTI GAME | DfD0032I3 | _________ ___| + | | | 8603186 | | |74HC273N | ___| + | | | | | |_________| ___| + | | | | | ___| + | |_____| |______________| _ _________ ___| + | |G| |74HC245N | ___| + | |_| |_________| ___| + | _______ _______ ___| + | |] [| |IC21 | ______ ___ ___| + | |] E [| | | |ALTERA| |___| __ ___| + | |] M [| | BEL | | MAX | F _________ |..| ___| + | |] P [| | SLOTS | ________________ | | |74HC245N | |..| ___| + | |] T [| | EXP. | | | |EPM712| |_________| |..| ___| + | |] Y [| | | | PHILIPS | |8SQC10| |..| ___| + | |] [| | | | SCC68070CCA84 | |0-15 | |..| ___| + | |] S [| |Version| | 213140-1 | |______| X_TAL's |__| ___| + | |] O [| | 5.01| | DfD0103V3 | _ _ _ ___| + | |] C [| | | | | ALL RIGHTS | | | | | | ___| + | |] K [| |Vnr.: | | | BY IMPERA |1| |2| |3| ___| + | |] E [| |011299 | | | |_| |_| |_| ___| + | |] T [| | | | | ___| + | |] [| | | |________________| ___| + | |]_____[| |27C4002| ___| + | |_______| |_______| ___________ ___| + | ___________________ |RTC2421 A | °°°°° ___| + | | ::::::::::::: | |___________| CON5 Z___| + | |___________________| | + |__________________________________________________________________________________________________| + + Xtal 1: 30.000 MHz. + Xtal 2: 8.000 MHz. + Xtal 3: 19.660 MHz. + + A = LT 0030 / LTC695CN / U18708 + B = NEC Japan / D43256BGU-70LL / 0008XD041 + C = MX B9819 / 29F1610MC-12C3 / M25685 / TAIWAN + D = 24C02C / 24C04 (Serial I2C Bus EEPROM with User-Defined Block Write Protection). + E = P0030SG / CD40106BCN + F = 74HCU04D + G = 74HC74D + */ ROM_START( belslots ) - ROM_REGION( 0x80000, "maincpu", 0 ) /* 68070 Code & GFX */ + ROM_REGION( 0x80000, "maincpu", 0 ) // 68070 Code & GFX ROM_LOAD16_WORD_SWAP( "bel_slots_exp_v501_01.12.99.bin", 0x00000, 0x80000, CRC(bd0b97ff) SHA1(9431359f91fd059c61441f4cb4924500889552a9) ) - ROM_REGION( 0x0200, "sereeprom", 0 ) /* Serial EPROM */ + ROM_REGION( 0x0200, "sereeprom", 0 ) // Serial EPROM ROM_LOAD16_WORD_SWAP("bel_slots_exp_24c04a.bin", 0x0000, 0x0200, BAD_DUMP CRC(d5e82b49) SHA1(7dbdf7d539cbd59a3ac546b6f50861c4958abb3a) ) // all AA & 55 ROM_END @@ -1194,30 +1261,145 @@ ROM_END Puzzle Me! Impera. - TODO: PCB + PCB layout: + ___________________________________________________________________________________________________________________________ + | ___ ___ ___ ___ | + | ___ | | | | | | | | | + | | B | | A | | A | | A | | A | ______________________________________ |____ + | |___| _____ | | | | | | | | | | ___| + | | _ | |___| |___| |___| |___| | YAMAHA | ___| + | _______ |BATTE| | YM2149F | ___| + | |LTC695C| |RY | ___ ___ ___ ___ | IC17| ___| + | |_______| | + | | E | | E | | E | | E | |______________________________________| ___| + | |_____| | M | | M | | M | | M | ___| + | | P | | P | | P | | P | ___________________________ ______________ _____ ___| + | ____ ____ | T | | T | | T | | T | | | | ULN2803A | | O O | ___| + | |HY62| |HY62| | Y | | Y | | Y | | Y | | KDA0476CN_66 | |______________| | O O | ____| + | |64AL| |64AL| |___| |___| |___| |___| | KOREA 219 IC20| ________________ | O O | | + | |J_10| |J_10| |___________________________| | 74HC273N | | O O | | + | | | | | |________________| | O O | | + | |____| |____| ___________ ____________ ________________ | O O | | + | | 74HC04AP | |EMPTY SOCKET| | 74HC245N | | O O | | + | _______ _______ |___________| |____________| |________________| | O O | | + | | | | | XTAL1 |_____| |____ + | | | | | _________________ XTAL3 ______________ CON3 ___| + | | EMPTY | | EMPTY | | IMPERA 8 | _____ _____________ _____________ | TD62083AP | ___| + | | SOCKET| | SOCKET| | 209751 | |24C02| | PIC16C54 | | HCF40106BE | |______________| ___| + | | | | | | DfD9227I3 Y | |_____| |_____________| |_____________| ________________ ___| + | | | | | | | IC26 IC29 | 74HC273N | ___| + | | | | | | SCC 66470 CAB | |________________| ___| + | | | | | | 317360 | ___| + | | | | | | DfD9501I3 Y | ________________ ___| + | | IC22A| | IC21A| |_________________| __________________ | 74HC245N | ___| + | |_______| |_______| IC19 | | |________________| ___| + | _______ _______ | | ___| + | | | | | | ESI 1 | ___| + | | | | | XTAL2 | I9349 | ________________ ___| + | | | | | _________________ | | | 74HC245N | ___| + | | EMPTY | | | | IMPERA 7 | | | |________________| ___| + | | SOCKET| |27C4002| | 204440 | | IC25| ___| + | | | | | | DfD9231V3 Y | |__________________| ___| + | | | | | | | ___| + | | | | | | SCC 68070 CCA84 | ___| + | | | | | | 324320 | ___| + | | | | | | DfD9501V3 Y | ___| + | | | | | |_________________| ___| + | | IC21| | IC21| IC1 ______________ _________ ____| + | |_______| |_______| | RTC 72421A | | DS1207 | | + | IMPERA BOARD REV V2.1 |______________| |_________| | + |___________________________________________________________________________________________________________________________| + + XTAL1 = 30.000 + XTAL2 = 19.6608 + XTAL3 = 3686.400 + + A = KM44C256CJ_6 + B = TL7705ACP + */ ROM_START( puzzleme ) - ROM_REGION( 0x80000, "maincpu", 0 ) /* 68070 Code & GFX */ + ROM_REGION( 0x80000, "maincpu", 0 ) // 68070 Code & GFX ROM_LOAD16_WORD_SWAP( "27c4002.ic21", 0x00000, 0x80000, CRC(cd3bc5a9) SHA1(682f62eba454f4f00212b2a8dabb05d6747f22fd) ) - ROM_REGION( 0x1fff, "pic16c54", 0 ) /* decapped */ + ROM_REGION( 0x1fff, "pic16c54", 0 ) // decapped ROM_LOAD("pic16c54.ic29", 0x0000, 0x1fff, CRC(6dd2bd8e) SHA1(380f6b952ddd3183e9ab5404866c30be015b3773) ) - ROM_REGION( 0x0100, "sereeprom", 0 ) /* Serial EPROM */ + ROM_REGION( 0x0100, "sereeprom", 0 ) // Serial EPROM ROM_LOAD("x24c02p.ic26", 0x0000, 0x0100, CRC(bc940f53) SHA1(6b870019752ba5c446a5ad5155e4a81dfbf6e523) ) ROM_END /* - - Unknown TE06 + Unknown 'TE06' + + PCB layout: + ________________________________________________________________________________________________________________ + | | + | __________ _____________ ___________ ___ | + | | 74LS04 | |LC324256BP-70| | C | | | ___ |__ + | |__________| |_____________| |___________| |EMP| |. .| __| + | _____________ |TY | |. .| __| + | ____ |LC324256BP-70| | | |. .| __| + | | A | |_____________| |SOC| |. .| __| + | |____| _____________ |KET| |. .| __| + | |LC324256BP-70| |___| |. .| __| + | |_____________| __________________ |. .| __| + | _____________ | ADV476KN35E | |. .| __| + | |LC324256BP-70| | | |___| __| + | _______ |_____________| | OF19802.3 | | + ||DS1207 | |__________________| | + ||_______| | + | ___ XTAL2 __________ | + | | | ________ ________________ | PIC16C54 | | + | ___ |PC7| | | | | |__________| |__ + | | | |4HC| | | | IMPERA 8 | XTAL3 __| + | |HEF| |273| |HYUNDAI | | | __| + | |400| |P | | | | | __| + | |98B| | | |HY6264AL| | 209751 | __| + | |P | | | |P_10 | | | __| + | | | | | | | | DfD0922713 Y | __| + | |___| |___| | | | | ___ ___ __| + | | 9218A | |________________| _____________ | | | | __| + | _______ | | | 74HC245N | |PC7| |ULN| __| + | | | | KOREA | |_____________| |4HC| |280| __| + | |BATTERY| |________| |273| |3A | __| + | | | |P | | | __| + | |_______| ________ ________ | | | | __| + | | | | | | | | | __| + | | | | | _____________ |___| |___| __| + | ___ | | | | XTAL1 | 74HC245N | ___ ___ __| + | | B | | | | | __________________ |_____________| | | | | __| + | |___| | | | | | | |PC7| |ULN| __| + | | EMPTY | | | | IMPERA 7 | |4HC| |280| __| + | | SOCKET | |27C4002 | | | |273| |3A | __| + | | | | | | 230031 | _____________ |P | | | __| + | ___ ___ | | | | | | | 74HC245N | | | | | __| + | | | | | | | | | | DfD9249V3 Y | |_____________| | | | | __| + | |PAL| |PAL| | | | | | | |___| |___| __| + | |CE | |CE | | | | | | | __________ __| + | | | | | | | | | | | | CNY 74-4 | __| + | | | | | | | | | |__________________| _____________ |__________| __| + | | | | | | | | | | 74HC245N | __| + | | | | | | | | | |_____________| __| + | |___| |___| |________| |________| ___________ __| + | | DIP 1 | | + | IMPERA BOARD REV V1.05 |___________| | + |________________________________________________________________________________________________________________| + + A = TL7705ACP + B = DS1210 + C = Cover scratched - unreadable + + XTAL1 = 19.6608 + XTAL2 = 30.000 + XTAL3 = 3.686JB */ ROM_START( unkte06 ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68070 Code & GFX ROM_LOAD16_WORD_SWAP( "m27c4002.bin", 0x00000, 0x80000, CRC(229a504f) SHA1(8033e9b4cb55f2364bf4606375ef9ac05fc715fe) ) - ROM_REGION( 0x1fff, "pic16c56", 0 ) // decapped + ROM_REGION( 0x1fff, "pic16c56", 0 ) // decapped ROM_LOAD("pic16c56.bin", 0x0000, 0x1fff, CRC(b5655603) SHA1(d9126c36f3fca7e769ea60aaa711bb304b4b6a11) ) ROM_END @@ -1225,6 +1407,67 @@ ROM_END Lucky 7 Impera + PCB layout: + ________________________________________________________________________________________________________________ + | | + | __________ _____________ ___________ ___ | + | | 74LS04 | |HY51C4256S-10| | C | |904| ___ |__ + | |__________| |_____________| |___________| |9 | |. .| __| + | _____________ | | |. .| __| + | ____ |HY51C4256S-10| |LT1| |. .| __| + | | A | |_____________| |081| |. .| __| + | |____| _____________ |CN | |. .| __| + | |HY51C4256S-10| |___| |. .| __| + | |_____________| __________________ |. .| __| + | _____________ | ADV476KN35E | |. .| __| + | |HY51C4256S-10| | | |___| __| + | _______ |_____________| | OF19802.3 | | + ||DS1207 | |__________________| | + ||_______| | + | ___ XTAL2 | + | | | ________ ________________ | + | ___ |PC7| | | | | |__ + | | | |4HC| | | | IMPERA 8 | __| + | |HEF| |273| |HYUNDAI | | | __| + | |400| |A | | | | | __| + | |98B| | | |HY6264AL| | 160710 | __| + | |P | | | |P_10 | | | __| + | | | | | | | | DTD9105I1 Y | __| + | |___| |___| | | | | ___ ___ __| + | | 9218A | |________________| _____________ | | | | __| + | _______ | | | 74HC245AP | |PC7| |ULN| __| + | | | | KOREA | |_____________| |4HC| |280| __| + | |BATTERY| |________| |273| |3A | __| + | | | |AP | | | __| + | |_______| ________ ________ | | | | __| + | | | | | | | | | __| + | | | | | _____________ |___| |___| __| + | ___ | | | | XTAL1 | 74HC245AP | ___ ___ __| + | | B | | | | | __________________ |_____________| | | | | __| + | |___| | | | | | | |PC7| |ULN| __| + | | | | | | IMPERA 7 | |4HC| |280| __| + | |D27C210 | |D27C210 | | | |273| |3A | __| + | | | | | | 155200 | _____________ |AP | | | __| + | ___ ___ | | | | | | | 74HC245AP | | | | | __| + | | | | | |GAME-ROM| | | | DfD9101V3 Y | |_____________| | | | | __| + | |PAL| |PAL| | Lucky 7| | | | | |___| |___| __| + | |16L| |16L| | | | | | | __________ __| + | |8 | |8 | |VNr03-07| | | | | | PC849 | __| + | | | | | |Sum.D882| | | |__________________| _____________ |__________| __| + | | | | | | | | | | 74HC245AP | __| + | | | | | | | | | |_____________| __| + | |___| |___| |________| |________| ___________ __| + | | DIP 1 | | + | IMPERA BOARD REV V1.04 |___________| | + |________________________________________________________________________________________________________________| + + A = TL7705ACP + B = DS1210 + C = Cover scratched - unreadable + + XTAL1 = 19.6608 + XTAL2 = 30.000 + */ ROM_START( lucky7i ) ROM_REGION( 0x80000, "maincpu", 0 ) // 68070 Code & GFX @@ -1233,9 +1476,264 @@ ROM_START( lucky7i ) ROM_END -/************************* -* Driver Init * -*************************/ +/* + Unknown 'W' + Poker Game. + Version: 1.2 200/93 + + PCB layout: + + +---------------------------------------------------------------------------------------+ + | | + | +--------+ +----------+ +---------+ +--+ | + | |74LS14N | |KM44C256CP| |SAA1099P | | | | + | +--+ +--------+ +----------+ +---------+ |E | +---+ + | |GA| +----------+ | | --| + | |L | +----+ |KM44C256CP| | | --| + | |16| | A | +----------+ +--+ --| + | |V8| +----+ +----------+ --| + | |B | |KM44C256CP| +--------------+ --| + | | | +----------+ | KDA0476CN-66 | --| + | +--+ +----------+ | KOREA 219 | --| + | +------+ |KM44C256CP| | | --| + | |DS1207| +----------+ +--------------+ +---+ + | +------+ | + | | + | +--+ +-------------+ +---------+ | + | +--+ +--+ | | +------+ |SCC 66470 CAB| |PIC16C58 | | + | | | | | | | |LH5164| |206880 | +---------+ +---+ + | |B | |C | |D | |D-10L | |DfD9210I3 Y | --| + | | | | | | | | | | | --| + | | | | | | | | | | PHILIPS 1988| --| + | +--+ +--+ | | | | | | +--+ --| + | +--+ | | | | +----------+ | | +--+ --| + | | | | | |PC74HC245P| | | | | --| + | | | +-------------+ +----------+ |F | |G | --| + | | | | | | | --| + | +------+ | | | | --| + | +------+ +------+ +----------+ +--+ +--+ --| + | | | | | |PC74HC245P| +--+ --| + | +----+ | | | W | +-------------+ +----------+ | | +--+ --| + | | H | | | | | |SCC 68070 CCA| | | | | --| + | +----+ | | | | | 84| |F | |G | --| + | | | | | |268340 | +----------+ | | | | --| + | +--+ +--+ |EMPTY | |M | |DfD9349V3 Y | |PC74HC245P| | | | | --| + |+--+ |PA| |PA| | SLOT| |2 | | | +----------+ +--+ +--+ --| + ||D | |L | |L | | | |7 | | PHILIPS 1988| +--------+ --| + ||I | | | | | | | |C | | | | PC849 | --| + ||P | |16| |16| | | |4 | | | +----------+ +--------+ --| + || | |L8| |L8| | | |0 | +-------------+ |PC74HC245P| --| + ||2 | | | | | | | |0 | +----------+ --| + |+--+ +--+ +--+ | | |2 | +---+ + | +------+ +------+ +---------+ | + | | DIP 1 | | + | +---------+ | + +---------------------------------------------------------------------------------------+ + + A: TL7705ACP + B: CD4040BE + C: HEF40098BP + D: PC74HC273P + E: LT1081CN + F: PC74HC273P + G: ULN2803A + H: DS1210 + + + DIP 1: + +-------------------------------+ + |O N | + |+-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+| + || | | | |#| |#| |#| |#| |#| |#|| + |+-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+| + ||#| |#| | | | | | | | | | | | || + |+-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+| + | 1 2 3 4 5 6 7 8 | + +-------------------------------+ + + DIP 2: + +-------------------------------+ + |O N | + |+-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+| + ||#| |#| |#| |#| |#| | | |#| | || + |+-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+| + || | | | | | | | | | |#| | | |#|| + |+-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+| + | 1 2 3 4 5 6 7 8 | + +-------------------------------+ + +*/ +ROM_START( unkpkr_w ) + ROM_REGION( 0x80000, "maincpu", 0 ) // 68070 Code & GFX + ROM_LOAD16_WORD_SWAP( "w.bin", 0x00000, 0x80000, CRC(28300427) SHA1(83ea014a818246f476d769ad06cb2eba1ce699e8) ) +ROM_END + +/* + Dallas Poker + + PCB layout: + +------------------------------------------------------------------------------+ + | +-------------+ | + | +---------+ XTAL1 | +------+S| | + | | EMPTY | | |AHF |u| | + | +---------+ +-------------+ | |Automa|b| +---+ + | +---------+ |SCC 66470 CAB| | |tentec|b| --| + | |P21014-07| |466006 | +---------+ | |hnik |o| --| + | +---------+ |IfD9205I3 Y | |SAA1099P | | X | |a| --| + | +---------+ | | +---------+ | T |8430 L|r| --| + | | EMPTY | | PHILIPS 1988| | A |eibnit|d| --| + | +---------+ | | | L |z | | --| + | +---------+ | | | 3 | | | --| + | |P21014-07| | | +---------------+ +--+ |Tel. 0| | --| + | +---------+ +-------------+ | ADV476KN35E | | |3452/3| | +---+ + | +---------+ | 03-24 0S | | |249 | | | + | | EMPTY | | 0F19802.3 | | +------+ | | + | +---------+ +---------------+ +----------+ | + | +---------+ XTAL2 | + | |P21014-07| +-------------+ | + | +---------+ |SCC 68070 CBA| +----+ | + | +---------+ | 84| | F | +---+ + | | EMPTY | | | +----+ --| + | +---------+ | 203590 | --| + | +---------+ | DfD9218V3 Y | +---------+ --| + | |P21014-07| | | |ULN 2803A| --| + | +---------+ | PHILIPS 1988| +---------+ --| + | | | +----+ --| + |+--+ +--+ +--+ +-------------+ | F | +----+ --| + || | |A | |B | +----+ | G | --| + ||C | +--+ +--+ +----+ --| + || | --| + |+--++--+ --| + | | | +--+ +----+ --| + | |D | | | | F | +---------+ --| + | | | |E | +----+ |ULN 2803A| --| + | | | | | +--------------------+ +---------+ --| + | +--+ | | |DALLAS POKER CZ/V1 P| --| + | +--+ |VNR:19-09-93 | +----+ --| + | |SUM:8F8A/w D27C210| | G | --| + | +--+ +--+ +--------------------+ +----+ +----+ --| + | |PA| |PA| | F | --| + | |L | |L | +--------------------+ +----+ +--------+ --| + | |16| |16| |DALLAS POKER CZ/V1 B| | PC849 | --| + | |L8| |L8| |VNR:19-09-93 | +--------+ +---+ + | |AC| |AC| |SUM:EB91/w D27C210| +---------+ | + | | | | | +--------------------+ | DIP 1 | | + | +--+ +--+ +---------+ | + +------------------------------------------------------------------------------+ + + XTAL1: 30.0000 + XTAL2: 19.6608 + XTAL3: 16.000 + + A: TL7705ACP + B: DS1210 + C: DS1207 + D: HEF40098BP / 759690T / Hnn9210P3 + E: SN74LS14N + F: HC245A + G: PC74HC273T + + Under the "DALLAS POKER CZ/V1 B" chip is a PC74HC273T chip soldered on the PCB. + Under the "DALLAS POKER CZ/V1 P" chip is a MB8464A-10L chip soldered on the PCB. + + Subboard: Looks like an 40PIN MCU or PIC...only four wires connect the subboard + with the mainboard. (GND & VCC and PIN21 and PIN22 from the 40pin-MCU/PIC) + + + DIP 1: + +-------------------------------+ + |O N | + |+-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+| + || | |O| | | | | |O| |O| |O| |O|| + |+-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+| + ||O| | | |O| |O| | | | | | | | || + |+-+ +-+ +-+ +-+ +-+ +-+ +-+ +-+| + | 1 2 3 4 5 6 7 8 | + +-------------------------------+ + +*/ +ROM_START( dallaspk ) + ROM_REGION( 0x80000, "maincpu", 0 ) // 68070 Code & GFX + ROM_LOAD16_WORD_SWAP( "cz-v1-p.bin", 0x00000, 0x20000, CRC(ad575e3f) SHA1(4e22957c42610fec0a96bd85f4b766422b020d88) ) + ROM_LOAD16_WORD_SWAP( "cz-v1-b.bin", 0x20000, 0x20000, CRC(2595d346) SHA1(34f09931d82b5376e4f3922222645c796dad0440) ) +ROM_END + + +/* + Kajot Card + Version 1.01, Wien Euro. + + Amatic. + + PCB layout: + ___________________________________________________________________________________________________________________________ + | ___ ___ ___ ___ | + | ___ | | | | | | | | | + | | B | | A | | A | | A | | A | ______________________________________ |____ + | |___| _____ | | | | | | | | | | ___| + | | _ | |___| |___| |___| |___| | YAMAHA | ___| + | _______ |BATTE| | YM2149F | ___| + | |LTC695C| |RY | ___ ___ ___ ___ | IC17| ___| + | |_______| | + | | E | | E | | E | | E | |______________________________________| ___| + | |_____| | M | | M | | M | | M | ___| + | | P | | P | | P | | P | ___________________________ ______________ _____ ___| + | ____ ____ | T | | T | | T | | T | | | | ULN2803A | | O O | ___| + | |HY62| |HY62| | Y | | Y | | Y | | Y | | KDA0476CN_50 | |______________| | O O | ____| + | |64AL| |64AL| |___| |___| |___| |___| | KOREA 332B IC20| ________________ | O O | | + | |J_10| |J_10| |___________________________| | 74HC273N | | O O | | + | | | | | |________________| | O O | | + | |____| |____| ___________ ____________ ________________ | O O | | + | | 74HC04AP | |EMPTY SOCKET| | 74HC245N | | O O | | + | _______ _______ |___________| |____________| |________________| | O O | | + | | | | | XTAL1 |_____| |____ + | | | | | _________________ XTAL3 ______________ CON3 ___| + | | EMPTY | | EMPTY | | IMPERA 8 | _____ _____________ _____________ | EMPTY SOCKET | ___| + | | SOCKET| | SOCKET| | 209751 | |24C02| | EMPTY SOCKET| | EMPTY SOCKET| |______________| ___| + | | | | | | DfD9227I3 Y | |_____| |_____________| |_____________| ________________ ___| + | | | | | | | IC26 IC29 | 74HC273N | ___| + | | | | | | | |________________| ___| + | | | | | | | ___| + | | | | | | | ________________ ___| + | | IC22A| | IC21A| |_________________| __________________ | 74HC245N | ___| + | |_______| |_______| IC19 | | |________________| ___| + | _______ _______ | | ___| + | | | | | | ESI 1 | ___| + | | 02 | | 01 | XTAL2 | I9407 | ________________ ___| + | | | | | _________________ | | | 74HC245N | ___| + | | | | | | | | | |________________| ___| + | |27C4002| |27C4002| | | | IC25| ___| + | | | | | | | |__________________| ___| + | | | | | | | ___| + | | | | | | SCC 68070 CCA84 | ___| + | | | | | | 288571 | ___| + | | | | | | DfD9414V3 Y | ___| + | | | | | |_________________| ___| + | | IC22| | IC21| IC1 ______________ _________ ____| + | |_______| |_______| | RTC 72421A | | EMPTY | | + | IMPERA BOARD REV V2.1 |______________| |_________| | + |___________________________________________________________________________________________________________________________| + + XTAL1 = 30.000 + XTAL2 = 19.6608 + XTAL3 = 3686.400 + + A = KM44C256CJ-7 + B = TL7705ACP + +*/ +ROM_START( kajotcrd ) + ROM_REGION( 0x100000, "maincpu", 0 ) // 68070 Code & GFX + ROM_LOAD16_WORD_SWAP( "01.ic21", 0x00000, 0x80000, CRC(674aa36e) SHA1(483eb09950ff7c43a7147378f2e68d113c856905) ) + ROM_LOAD16_WORD_SWAP( "02.ic22", 0x80000, 0x80000, CRC(ae52803e) SHA1(27f917b0f8b302bdab930e304b4977a4b8192cd5) ) + + ROM_REGION( 0x0100, "sereeprom", 0 ) // Serial EPROM + ROM_LOAD("x24c02.ic26", 0x0000, 0x0100, CRC(0f143d6f) SHA1(c293728a997cd0868705dced55955072c6ebf5c0) ) +ROM_END + + +/********************************************* +* Driver Init * +*********************************************/ void magicard_state::init_magicard() { @@ -1243,24 +1741,29 @@ void magicard_state::init_magicard() } -/************************* -* Game Drivers * -*************************/ - -// YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS - -GAME( 199?, magicard, 0, magicard, magicard, magicard_state, init_magicard, ROT0, "Impera", "Magic Card (set 1)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) -GAME( 199?, magicarda, magicard, magicard, magicard, magicard_state, init_magicard, ROT0, "Impera", "Magic Card (set 2)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) -GAME( 199?, magicardb, magicard, magicard, magicard, magicard_state, init_magicard, ROT0, "Impera", "Magic Card (set 3)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) -GAME( 1994, magicarde, magicard, hotslots, magicard, magicard_state, init_magicard, ROT0, "Impera", "Magic Card Export 94", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) -GAME( 1994, magicardf, magicard, hotslots, magicard, magicard_state, init_magicard, ROT0, "Impera", "Magic Export (V.211A)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) -GAME( 1998, magicardj, 0, hotslots, magicard, magicard_state, init_magicard, ROT0, "Impera", "Magic Card III Jackpot (4.01)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) -GAME( 1993, magicardw, magicard, magicard, magicard, magicard_state, init_magicard, ROT0, "Impera", "Magic Card - Wien (Sicherheitsversion 1.2)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) -GAME( 2001, magicle, 0, magicard, magicard, magicard_state, init_magicard, ROT0, "Impera", "Magic Lotto Export (5.03)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) -GAME( 2002, hotslots, 0, hotslots, magicard, magicard_state, init_magicard, ROT0, "Impera", "Hot Slots (6.00)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) -GAME( 1999, quingo, 0, hotslots, magicard, magicard_state, init_magicard, ROT0, "Impera", "Quingo Export (5.00)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) -GAME( 1999, belslots, 0, hotslots, magicard, magicard_state, init_magicard, ROT0, "Impera", "Bel Slots Export (5.01)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) -GAME( 2001, bigdeal0, 0, hotslots, magicard, magicard_state, init_magicard, ROT0, "Impera", "Big Deal Belgien (5.04)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) -GAME( 199?, puzzleme, 0, hotslots, magicard, magicard_state, init_magicard, ROT0, "Impera", "Puzzle Me!", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) -GAME( 199?, unkte06, 0, magicard, magicard, magicard_state, init_magicard, ROT0, "Impera", "unknown Poker 'TE06'", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) // strings in ROM -GAME( 199?, lucky7i, 0, magicard, magicard, magicard_state, init_magicard, ROT0, "Impera", "Lucky 7 (Impera)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +/********************************************* +* Game Drivers * +*********************************************/ + +// YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS +GAME( 199?, magicard, 0, magicard, magicard, magicard_state, init_magicard, ROT0, "Impera", "Magic Card (set 1)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 199?, magicarda, magicard, magicard, magicard, magicard_state, init_magicard, ROT0, "Impera", "Magic Card (set 2)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 199?, magicardb, magicard, magicard, magicard, magicard_state, init_magicard, ROT0, "Impera", "Magic Card (set 3)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 1994, magicarde, magicard, hotslots, magicard, magicard_state, init_magicard, ROT0, "Impera", "Magic Card Export 94 (v2.11a, set 1)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 1994, magicardea, magicard, hotslots, magicard, magicard_state, init_magicard, ROT0, "Impera", "Magic Card Export 94 (v2.11a, set 2)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 1994, magicardeb, magicard, hotslots, magicard, magicard_state, init_magicard, ROT0, "Impera", "Magic Card Export 94 (v2.9a)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 1998, magicardec, magicard, hotslots, magicard, magicard_state, init_magicard, ROT0, "Impera", "Magic Card Export (v4.01)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 1994, magicardf, magicard, hotslots, magicard, magicard_state, init_magicard, ROT0, "Impera", "Magic Export (V.211A)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 1998, magicardj, 0, hotslots, magicard, magicard_state, init_magicard, ROT0, "Impera", "Magic Card III Jackpot (4.01)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 1993, magicardw, magicard, magicard, magicard, magicard_state, init_magicard, ROT0, "Impera", "Magic Card - Wien (Sicherheitsversion 1.2)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 2001, magicle, 0, magicard, magicard, magicard_state, init_magicard, ROT0, "Impera", "Magic Lotto Export (5.03)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 2002, hotslots, 0, hotslots, magicard, magicard_state, init_magicard, ROT0, "Impera", "Hot Slots (6.00)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 1999, quingo, 0, hotslots, magicard, magicard_state, init_magicard, ROT0, "Impera", "Quingo Export (5.00)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 1999, belslots, 0, hotslots, magicard, magicard_state, init_magicard, ROT0, "Impera", "Bel Slots Export (5.01)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 2001, bigdeal0, 0, hotslots, magicard, magicard_state, init_magicard, ROT0, "Impera", "Big Deal Belgien (5.04)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 199?, puzzleme, 0, hotslots, magicard, magicard_state, init_magicard, ROT0, "Impera", "Puzzle Me!", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 199?, unkte06, 0, magicard, magicard, magicard_state, init_magicard, ROT0, "Impera", "unknown Poker 'TE06'", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) // strings in ROM +GAME( 199?, lucky7i, 0, magicard, magicard, magicard_state, init_magicard, ROT0, "Impera", "Lucky 7 (Impera)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 1993, unkpkr_w, 0, magicard, magicard, magicard_state, init_magicard, ROT0, "<unknown>", "unknown Poker 'W'", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 1993, dallaspk, 0, magicard, magicard, magicard_state, init_magicard, ROT0, "<unknown>", "Dallas Poker", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 1993, kajotcrd, 0, hotslots, magicard, magicard_state, init_magicard, ROT0, "Amatic", "Kajot Card (Version 1.01, Wien Euro)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) diff --git a/src/mame/drivers/microdar.cpp b/src/mame/drivers/microdar.cpp index e19b407280a..487c8403842 100644 --- a/src/mame/drivers/microdar.cpp +++ b/src/mame/drivers/microdar.cpp @@ -433,6 +433,6 @@ GAME(199?, dibifuca, 0, microdar, microdar, microdar_state, empty_init, R GAME(199?, dibif743, dibifuca, microdar, microdar, microdar_state, empty_init, ROT0, "Compumatic / Bifuca", "Diana Bifuca (v7.43)", MACHINE_IS_SKELETON_MECHANICAL) GAME(199?, dibif727, dibifuca, microdar, microdar, microdar_state, empty_init, ROT0, "Compumatic / Bifuca", "Diana Bifuca (v7.27)", MACHINE_IS_SKELETON_MECHANICAL) GAME(1997, cfarwest, 0, microdar, microdar, microdar_state, empty_init, ROT0, "Compumatic", "Far West (Compumatic)", MACHINE_IS_SKELETON_MECHANICAL) -GAME(1997, prospdp, 0, prospdp, microdar, microdar_state, empty_init, ROT0, "Compumatic", "Unknown Compumatic ProSPDP based darts machine", MACHINE_IS_SKELETON_MECHANICAL) +GAME(1997, prospdp, 0, prospdp, microdar, microdar_state, empty_init, ROT0, "Compumatic", "unknown Compumatic ProSPDP based darts machine", MACHINE_IS_SKELETON_MECHANICAL) GAME(1997, diolakoa, 0, microdv5, microdar, microdar_state, empty_init, ROT0, "Compumatic / Olakoa", "Diana Olakoa (v8.38)", MACHINE_IS_SKELETON_MECHANICAL) GAME(1997, diola827, diolakoa, microdv5, microdar, microdar_state, empty_init, ROT0, "Compumatic / Olakoa", "Diana Olakoa (v8.27)", MACHINE_IS_SKELETON_MECHANICAL) diff --git a/src/mame/drivers/mk98.cpp b/src/mame/drivers/mk98.cpp index 63a4bf6a372..cf9dde16fcd 100644 --- a/src/mame/drivers/mk98.cpp +++ b/src/mame/drivers/mk98.cpp @@ -70,7 +70,6 @@ public: , m_pic8259(*this, "pic8259") , m_screen(*this, "screen") , m_p_videoram(*this, "video") - , m_p_chargen(*this, "gfx1") { } void mk98(machine_config &config); @@ -103,7 +102,6 @@ private: void mk98_map(address_map &map); required_shared_ptr<u8> m_p_videoram; - required_region_ptr<u8> m_p_chargen; uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -119,6 +117,7 @@ private: uint8_t m_scancode = 0; uint8_t m_kbdflag = 0; int m_kbit = 0; + u8 m_p_chargen[0x800] = { }; }; @@ -391,7 +390,8 @@ void mk98_state::video_w(offs_t offset, uint8_t data) switch (offset) { case 2: - if (++m_font_upload > 63) + m_font_upload++; + if ((m_font_upload > 63) && (m_font_upload < 0x840)) m_p_chargen[m_font_upload - 64] = data; break; @@ -477,8 +477,6 @@ void mk98_state::mk98(machine_config &config) ROM_START( mk98 ) ROM_REGION(0x20000, "romdos", 0) ROM_LOAD("e0000.bin", 0, 0x20000, CRC(85785bd5) SHA1(b10811715f44cf8e2b41baea7b62a35082e04048)) - - ROM_REGION(0x800, "gfx1", ROMREGION_ERASE00) ROM_END diff --git a/src/mame/drivers/nmk16.cpp b/src/mame/drivers/nmk16.cpp index 9701d528f63..6c53202e0ce 100644 --- a/src/mame/drivers/nmk16.cpp +++ b/src/mame/drivers/nmk16.cpp @@ -6581,6 +6581,38 @@ ROM_START( tdragonb2 ) ROM_LOAD( "shinea2a2-01", 0x00000, 0x80000, CRC(4556e717) SHA1(efdec7c989436f97e8f18b157bfd5f9da55b29ba) ) ROM_END +ROM_START( tdragonb3 ) + ROM_REGION( 0x80000, "maincpu", 0 ) + ROM_LOAD16_BYTE( "tms27c010a.19e", 0x00000, 0x20000, CRC(659167c4) SHA1(bd9dbdf751869730513db186324c60abed4bc05e) ) + ROM_LOAD16_BYTE( "tms27c010a.19c", 0x00001, 0x20000, CRC(02f5befc) SHA1(5c0b9e7c5a811adf5c50b6ea6703df670e5a703f) ) + + ROM_REGION(0x20000, "audiocpu", 0 ) + ROM_LOAD( "d27512.4b", 0x00000, 0x8000, CRC(99ee7505) SHA1(b97c8ee5e26e8554b5de506fba3b32cc2fde53c9) ) + ROM_CONTINUE( 0x10000, 0x8000 ) + ROM_COPY( "audiocpu", 0x00000, 0x18000, 0x8000 ) + + ROM_REGION( 0x20000, "fgtile", 0 ) // 8x8 + ROM_LOAD( "tms27c010a.2k", 0x00000, 0x20000, CRC(5144dc69) SHA1(e64d88dc0e7672f811868621f74ec209aeafbc6f) ) + + ROM_REGION( 0x100000, "bgtile", 0 ) // 16x16 + ROM_LOAD( "unreadable.18h", 0x000000, 0x100000, BAD_DUMP CRC(d0bde826) SHA1(3b74d5fc88a4a9329e101ee72f393608d327d816) ) // undumpable on this PCB, probably the same as the original as the other 2 GFX ROMs are + + ROM_REGION( 0x100000, "sprites", 0 ) + ROM_LOAD16_WORD_SWAP( "upd27c8000.18f", 0x000000, 0x100000, CRC(3eedc2fe) SHA1(9f48986c231a8fbc07f2b39b2017d1e967b2ed3c) ) + + ROM_REGION( 0x40000, "unknown_rom", 0 ) // between the main CPU and the bgtile ROMs + ROM_LOAD( "tms27c020.20g", 0x00000, 0x40000, CRC(1ed8a2da) SHA1(8eabc35f1eb88f49b83baf8bd72229d40efed248) ) + + ROM_REGION( 0x40000, "oki", 0 ) + ROM_LOAD( "m27c512.1c", 0x00000, 0x10000, CRC(f6f6c4bf) SHA1(ea4cf74d968e254ae47c16c2f4c2f4bc1a528808) ) + + ROM_REGION( 0x200, "proms", 0 ) + ROM_LOAD( "n82s147n.7f", 0x000, 0x200, CRC(ed0bd072) SHA1(66a6d435d8587c82ae96dd09c39ed5749fe00e24) ) + + ROM_REGION( 0x200, "plds", 0 ) + ROM_LOAD( "pal16l8acn.8b", 0x000, 0x104, CRC(92fa095c) SHA1(4c7ece64c402ab4716fcf58d11c5b0b131a7c3e8) ) +ROM_END + ROM_START( ssmissin ) ROM_REGION( 0x40000, "maincpu", 0 ) ROM_LOAD16_BYTE( "ssm14.165", 0x00001, 0x20000, CRC(eda61b74) SHA1(6247682c27d2be7dff1fad407ccf86fe2a25f11c) ) @@ -8990,7 +9022,8 @@ GAME( 1997, tomagic, 0, tomagic, tomagic, nmk16_tomagic_stat // these use the Seibu sound system (sound / music stolen from Raiden) rather than the bootleggers copying the nmk004 GAME( 1990, mustangb, mustang, mustangb, mustang, nmk16_state, empty_init, ROT0, "bootleg", "US AAF Mustang (bootleg, set 1)", 0 ) GAME( 1990, mustangb2, mustang, mustangb, mustang, nmk16_state, empty_init, ROT0, "bootleg (TAB Austria)", "US AAF Mustang (TAB Austria bootleg)", 0 ) // PCB and ROMs have TAB Austria stickers -GAME( 1991, tdragonb, tdragon, tdragonb, tdragonb, nmk16_state, init_tdragonb, ROT270, "bootleg", "Thunder Dragon (bootleg, set 1)", 0 ) +GAME( 1991, tdragonb, tdragon, tdragonb, tdragonb, nmk16_state, init_tdragonb, ROT270, "bootleg", "Thunder Dragon (bootleg with Raiden sounds, encrypted)", 0 ) +GAME( 1991, tdragonb3, tdragon, tdragonb, tdragonb, nmk16_state, empty_init, ROT270, "bootleg", "Thunder Dragon (bootleg with Raiden sounds, unencrypted)", 0 ) GAME( 1992, strahljbl, strahl, strahljbl, strahljbl, nmk16_state, empty_init, ROT0, "bootleg", "Koutetsu Yousai Strahl (Japan, bootleg)", 0 ) // these are bootlegs with tharrier like sound hw @@ -8998,7 +9031,7 @@ GAME( 1990, mustangb3, mustang, mustangb3, mustang, nmk16_state, empty GAME( 1989, tharrierb, tharrier, tharrier, tharrier, nmk16_state, init_tharrier, ROT270, "bootleg (Lettering)", "Task Force Harrier (Lettering bootleg)", 0 ) // bootleg with no audio CPU and only 1 Oki -GAME( 1991, tdragonb2, tdragon, tdragonb2, tdragon, nmk16_state, empty_init, ROT270, "bootleg", "Thunder Dragon (bootleg, set 2)", MACHINE_NOT_WORKING ) // GFX and input problems. IRQs related? +GAME( 1991, tdragonb2, tdragon, tdragonb2, tdragon, nmk16_state, empty_init, ROT270, "bootleg", "Thunder Dragon (bootleg with reduced sound system)", MACHINE_NOT_WORKING ) // GFX and input problems. IRQs related? // bootleg with cloned airbustr sound hardware GAME( 1992, gunnailb, gunnail, gunnailb, gunnail, nmk16_state, init_gunnailb, ROT270, "bootleg", "GunNail (bootleg)", MACHINE_IMPERFECT_SOUND ) // crappy sound, unknown how much of it is incomplete emulation and how much bootleg quality diff --git a/src/mame/drivers/pentagon.cpp b/src/mame/drivers/pentagon.cpp index a98abb8b66b..9040db14f7f 100644 --- a/src/mame/drivers/pentagon.cpp +++ b/src/mame/drivers/pentagon.cpp @@ -118,13 +118,12 @@ void pentagon_state::pentagon_scr2_w(offs_t offset, uint8_t data) rectangle pentagon_state::get_screen_area() { - //TODO Possible because of incorrect z80 we have to adjust x+1 to make AccrossTheEdge look nicer - return rectangle{137, 137 + 255, 80, 80 + 191}; + return rectangle{136, 136 + 255, 80, 80 + 191}; } INTERRUPT_GEN_MEMBER(pentagon_state::pentagon_interrupt) { - timer_set(m_screen->time_until_pos(0) - m_maincpu->clocks_to_attotime(1), TIMER_IRQ_ON, 0); + timer_set(m_screen->time_until_pos(0) + /*???*/ m_maincpu->clocks_to_attotime(3), TIMER_IRQ_ON, 0); } uint8_t pentagon_state::beta_neutral_r(offs_t offset) diff --git a/src/mame/drivers/royalmah.cpp b/src/mame/drivers/royalmah.cpp index 671c695b92e..c72d0b1ac19 100644 --- a/src/mame/drivers/royalmah.cpp +++ b/src/mame/drivers/royalmah.cpp @@ -34,13 +34,14 @@ Year + Game Board(s) CPU Company Not 88 Almond Pinky D1401128L-0 + RM-1D Z80 Dynax 89 Mahjong Shinkirou D210301BL2 + FRM-00? TLCS-90 Dynax 89 Mahjong Derringer D2203018L Z80 Dynax Larger palette -9? Ichi Ban Jian MJ911 Z80 Excel Larger palette, additional YM2413 90 Mahjong If..? D2909278L TLCS-90 Dynax Larger palette 91 Mahjong Vegas D5011308L1 + FRM-00 TLCS-90 Dynax Undumped internal rom (mjvegas set) 92 Mahjong Cafe Time D6310128L1-1 TLCS-90 Dynax Larger palette, RTC 93 Mahjong Cafe Doll D76052208L-2 TLCS-90 Dynax Larger palette, RTC, Undumped internal rom +93 Ichi Ban Jian MJ911 Z80 Excel Larger palette, additional YM2413 95 Mahjong Tensinhai D10010318L1 TLCS-90 Dynax Larger palette, RTC 96 Janputer '96 NS503X0727 Z80 Dynax Larger palette, RTC +97 Pong Boo! 2 NEW PONG-BOO Z80(?) OCT OKI M6295, no PROMs 97 Janputer Special CS166P008 + NS5110207 Z80 Dynax Larger palette, RTC 99 Mahjong Cafe Break NS528-9812 TLCS-90 Nakanihon / Dynax Undumped internal rom 99 Mahjong Cafe Paradise ? + TSS001-0001 TLCS-90 Techno-Top Undumped internal rom @@ -107,6 +108,7 @@ Stephh's notes (based on the games Z80 code and some tests) : #include "sound/ay8910.h" #include "sound/dac.h" #include "sound/msm5205.h" +#include "sound/okim6295.h" #include "sound/ymopl.h" #include "video/mc6845.h" #include "emupal.h" @@ -170,6 +172,7 @@ public: void mjsiyoub(machine_config &config); void rkjanoh2(machine_config &config); void ichiban(machine_config &config); + void pongboo2(machine_config &config); void init_tahjong(); void init_dynax(); @@ -315,6 +318,9 @@ private: void mjtensin_map(address_map &map); void mjvegasa_map(address_map &map); void mjyarou_iomap(address_map &map); + void pongboo2_map(address_map &map); + void pongboo2_iomap(address_map &map); + void pongboo2_opcodes_map(address_map &map); void rkjanoh2_iomap(address_map &map); void royalmah_iomap(address_map &map); void royalmah_map(address_map &map); @@ -328,7 +334,7 @@ private: required_device<cpu_device> m_maincpu; required_device<palette_device> m_palette; - required_device<ay8910_device> m_ay; + optional_device<ay8910_device> m_ay; required_shared_ptr<uint8_t> m_videoram; optional_device<cpu_device> m_audiocpu; optional_device<msm6242_device> m_rtc; @@ -758,6 +764,21 @@ void royalmah_state::ichiban_opcodes_map(address_map &map) map(0x8000, 0xffff).rom().region("maincpu", 0x8000); } +void royalmah_state::pongboo2_map(address_map &map) +{ + map(0x0000, 0x6fff).rom().region("maincpu", 0); + map(0x7000, 0x7fff).ram().share("nvram"); + map(0x8000, 0xffff).rom().region("maincpu", 0x8000); // TODO: should be banked, as changing the offset to the other ROMs shows other graphics + map(0x8000, 0xffff).writeonly().share(m_videoram); +} + +void royalmah_state::pongboo2_opcodes_map(address_map &map) +{ + map(0x0000, 0x6fff).rom().region("maincpu", 0x10000); + map(0x7000, 0x7fff).ram().share("nvram"); + map(0x8000, 0xffff).rom().region("maincpu", 0x18000); +} + void royalmah_state::royalmah_iomap(address_map &map) { map.global_mask(0xff); @@ -883,6 +904,20 @@ void royalmah_state::ichiban_iomap(address_map &map) // TODO: writes to 0x12 and map(0x16, 0x17).w("ymsnd", FUNC(ym2413_device::write)); } +void royalmah_state::pongboo2_iomap(address_map &map) // TODO: banking, inputs +{ + map.global_mask(0xff); + // map(0x50, 0x50) // reads P1 inputs from here, but active high / different from other games? + // map(0x51, 0x51) // reads P2 inputs from here, but active high / different from other games? + // map(0x80, 0x80).w // ?? + map(0x81, 0x81).w(FUNC(royalmah_state::input_port_select_w)); // 0x01, 0x02, 0x04, 0x08, 0x10 + // map(0x82, 0x82).w // ?? + // map(0x84, 0x84).w // ?? + // map(0x91, 0x91).r // ?? + map(0x9a, 0x9a).w("oki", FUNC(okim6295_device::write)); + // map(0xa0, 0xbf).w // something similar to jansou_colortable_w ? +} + void royalmah_state::dondenmj_iomap(address_map &map) { map.global_mask(0xff); @@ -4048,6 +4083,33 @@ void royalmah_state::ichiban(machine_config &config) YM2413(config, "ymsnd", 18.432_MHz_XTAL / 6).add_route(ALL_OUTPUTS, "mono", 0.5); } +void royalmah_state::pongboo2(machine_config &config) +{ + // basic machine hardware + Z80(config, m_maincpu, 48_MHz_XTAL / 12); // not a Z80, probably some derived core + m_maincpu->set_addrmap(AS_PROGRAM, &royalmah_state::pongboo2_map); + m_maincpu->set_addrmap(AS_IO, &royalmah_state::pongboo2_iomap); + m_maincpu->set_addrmap(AS_OPCODES, &royalmah_state::pongboo2_opcodes_map); + m_maincpu->set_vblank_int("screen", FUNC(royalmah_state::irq0_line_hold)); + + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + + // video hardware + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_size(256, 256); + screen.set_visarea(0, 255, 8, 247); + screen.set_refresh_hz(60.5686); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate + screen.set_screen_update(FUNC(royalmah_state::screen_update)); + + PALETTE(config, "palette").set_format(palette_device::xRGB_444, 512); // wrong + + // sound hardware + SPEAKER(config, "mono").front_center(); + + OKIM6295(config, "oki", 1'000'000, okim6295_device::PIN7_LOW).add_route(ALL_OUTPUTS, "mono", 0.5); // frequency and pin 7 not verified +} + /*************************************************************************** @@ -5499,7 +5561,7 @@ ROM_END /*************************************************************************** Ichi Ban Jyan -Excel, 199? +Excel, 1993 PCB Layout ---------- @@ -5544,6 +5606,35 @@ ROM_START( ichiban ) ROM_END +/* +Pong Boo! 2 by OCT + +PCB is etched +NEW PONG-BOO MADE IN JAPAN +OCT. Co,Ltd. All Rights Reserved + +Main components +- 4x scratched chips. 1 is supposed to be the main CPU, possibly some kind of Z80 or Z180 based SoC? +- 1x 48.000 XTAL +- 1x OKI M6295 sound chip (there's also an unpopulated space marked for a YM2413) +- 1x CY7C185-15PC 8k x8 SRAM +- 1x CY7C199-15PC 32k x8 SRAM +- 1x HM6264ALSP-12 with a battery nearby +- 2x SN74LS174N +- 4x bank of 8 dip-switches + +This game shares the same programmer / programming team as Ichi Ban Jian by Excel. +It seems to use a similar split opcodes / data ROM arrangement. +*/ + +ROM_START( pongboo2 ) + ROM_REGION( 0x80000, "maincpu", 0 ) + ROM_LOAD( "1a.1.u016", 0x00000, 0x80000, CRC(07a95a99) SHA1(10897f8f0d8799797a577dffc9ba36b8904bb6c4) ) + + ROM_REGION( 0x40000, "oki", 0 ) + ROM_LOAD( "2.u0513", 0x00000, 0x40000, CRC(97bafe5b) SHA1(bff4df17cdb2d3ee63cc88ff486a7f5964182a15) ) +ROM_END + void royalmah_state::init_tahjong() { m_mainbank->configure_entries(0, 2, memregion("maincpu")->base() + 0x10000, 0x4000); @@ -5738,7 +5829,6 @@ GAME( 1989, mjdejavu, 0, mjdejavu, mjdejavu, royalmah_state, init_mjifb, GAME( 1989, mjdejav2, mjdejavu, mjdejavu, mjdejavu, royalmah_state, init_mjifb, ROT0, "Dynax", "Mahjong Shinkirou Deja Vu 2 (Japan)", MACHINE_NOT_WORKING ) GAME( 1989, mjderngr, 0, mjderngr, mjderngr, royalmah_state, init_dynax, ROT0, "Dynax", "Mahjong Derringer (Japan)", 0 ) GAME( 1989, daisyari, 0, daisyari, daisyari, royalmah_state, init_daisyari, ROT0, "Best System", "Daisyarin [BET] (Japan)", 0 ) -GAME( 199?, ichiban, 0, ichiban, ichiban, royalmah_state, empty_init, ROT0, "Excel", "Ichi Ban Jyan", MACHINE_NOT_WORKING | MACHINE_WRONG_COLORS | MACHINE_IMPERFECT_SOUND ) // should just need correct palette and ROM banking GAME( 1990, mjifb, 0, mjifb, mjifb, royalmah_state, init_mjifb, ROT0, "Dynax", "Mahjong If...? [BET]", 0 ) GAME( 1990, mjifb2, mjifb, mjifb, mjifb, royalmah_state, init_mjifb, ROT0, "Dynax", "Mahjong If...? [BET](2921)", 0 ) GAME( 1990, mjifb3, mjifb, mjifb, mjifb, royalmah_state, init_mjifb, ROT0, "Dynax", "Mahjong If...? [BET](2931)", 0 ) @@ -5746,8 +5836,10 @@ GAME( 1991, mjvegasa, 0, mjvegasa, mjvegasa, royalmah_state, init_mjvega GAME( 1991, mjvegas, mjvegasa, mjvegasa, mjvegasa, royalmah_state, init_mjvegasa, ROT0, "Dynax", "Mahjong Vegas (Japan)", MACHINE_NOT_WORKING ) GAME( 1992, cafetime, 0, cafetime, cafetime, royalmah_state, init_cafetime, ROT0, "Dynax", "Mahjong Cafe Time", 0 ) GAME( 1993, cafedoll, 0, mjifb, mjifb, royalmah_state, init_mjifb, ROT0, "Dynax", "Mahjong Cafe Doll (Japan)", MACHINE_NOT_WORKING ) +GAME( 1993, ichiban, 0, ichiban, ichiban, royalmah_state, empty_init, ROT0, "Excel", "Ichi Ban Jyan", MACHINE_NOT_WORKING | MACHINE_WRONG_COLORS | MACHINE_IMPERFECT_SOUND ) // should just need correct palette and ROM banking GAME( 1995, mjtensin, 0, mjtensin, mjtensin, royalmah_state, init_mjtensin, ROT0, "Dynax", "Mahjong Tensinhai (Japan)", MACHINE_NOT_WORKING ) GAME( 1996, janptr96, 0, janptr96, janptr96, royalmah_state, init_janptr96, ROT0, "Dynax", "Janputer '96 (Japan)", 0 ) GAME( 1997, janptrsp, 0, janptr96, janptr96, royalmah_state, init_janptr96, ROT0, "Dynax", "Janputer Special (Japan)", 0 ) +GAME( 1997, pongboo2, 0, pongboo2, ichiban, royalmah_state, empty_init, ROT0, "OCT", "Pong Boo! 2 (Ver. 1.31)", MACHINE_NOT_WORKING | MACHINE_WRONG_COLORS ) // banking, palette, inputs GAME( 1999, cafebrk, 0, mjifb, mjifb, royalmah_state, init_mjifb, ROT0, "Nakanihon / Dynax", "Mahjong Cafe Break", MACHINE_NOT_WORKING ) GAME( 1999, cafepara, 0, mjifb, mjifb, royalmah_state, init_mjifb, ROT0, "Techno-Top", "Mahjong Cafe Paradise", MACHINE_NOT_WORKING ) diff --git a/src/mame/drivers/spec128.cpp b/src/mame/drivers/spec128.cpp index 00394d67a02..db3a170a105 100644 --- a/src/mame/drivers/spec128.cpp +++ b/src/mame/drivers/spec128.cpp @@ -165,8 +165,17 @@ resulting mess can be seen in the F4 viewer display. /****************************************************************************************************/ /* Spectrum 128 specific functions */ +void spectrum_128_state::video_start() +{ + m_frame_invert_count = 16; + m_screen_location = m_ram->pointer() + (5 << 14); + m_contention_pattern = {1, 0, 7, 6, 5, 4, 3, 2}; +} + uint8_t spectrum_128_state::spectrum_128_pre_opcode_fetch_r(offs_t offset) { + if (is_contended(offset)) content_early(); + /* this allows expansion devices to act upon opcode fetches from MEM addresses for example, interface1 detection fetches requires fetches at 0008 / 0708 to enable paged ROM and then fetches at 0700 to disable it @@ -291,6 +300,18 @@ void spectrum_128_state::machine_reset() spectrum_128_update_memory(); } +bool spectrum_128_state::is_vram_write(offs_t offset) { + // TODO respect banks 2,5 mapped to 0xc000 + return (BIT(m_port_7ffd_data, 3)) + ? offset >= 0x8000 && offset < 0x9b00 + : spectrum_state::is_vram_write(offset); +} + +bool spectrum_128_state::is_contended(offs_t offset) { + // TODO Unlike the base 128K machine, RAM banks 4, 5, 6 and 7 are contended. + return spectrum_state::is_contended(offset);// || (offset >= 0x8000 && offset < 0xc000); +} + static const gfx_layout spectrum_charlayout = { 8, 8, /* 8 x 8 characters */ diff --git a/src/mame/drivers/spectrum.cpp b/src/mame/drivers/spectrum.cpp index 960f7a8c5d6..8a300bd1e34 100644 --- a/src/mame/drivers/spectrum.cpp +++ b/src/mame/drivers/spectrum.cpp @@ -293,6 +293,8 @@ SamRam uint8_t spectrum_state::pre_opcode_fetch_r(offs_t offset) { + if (is_contended(offset)) content_early(); + /* this allows expansion devices to act upon opcode fetches from MEM addresses for example, interface1 detection fetches requires fetches at 0008 / 0708 to enable paged ROM and then fetches at 0700 to disable it @@ -305,6 +307,8 @@ uint8_t spectrum_state::pre_opcode_fetch_r(offs_t offset) uint8_t spectrum_state::spectrum_data_r(offs_t offset) { + if (is_contended(offset)) content_early(); + m_exp->pre_data_fetch(offset); uint8_t retval = m_specmem->space(AS_PROGRAM).read_byte(offset); m_exp->post_data_fetch(offset); @@ -313,6 +317,9 @@ uint8_t spectrum_state::spectrum_data_r(offs_t offset) void spectrum_state::spectrum_data_w(offs_t offset, uint8_t data) { + if (is_contended(offset)) content_early(); + if (is_vram_write(offset)) m_screen->update_now(); + m_specmem->space(AS_PROGRAM).write_byte(offset,data); } @@ -341,6 +348,9 @@ uint8_t spectrum_state::spectrum_rom_r(offs_t offset) */ void spectrum_state::spectrum_ula_w(offs_t offset, uint8_t data) { + if (is_contended(offset)) content_early(); + content_early(1); + unsigned char Changed = m_port_fe_data^data; /* border colour changed? */ @@ -363,11 +373,13 @@ void spectrum_state::spectrum_ula_w(offs_t offset, uint8_t data) m_port_fe_data = data; } - /* KT: more accurate keyboard reading */ /* DJR: Spectrum+ keys added */ uint8_t spectrum_state::spectrum_ula_r(offs_t offset) { + if (is_contended(offset)) content_early(); + content_early(1); + int lines = offset >> 8; int data = 0xff; @@ -443,6 +455,12 @@ uint8_t spectrum_state::spectrum_ula_r(offs_t offset) void spectrum_state::spectrum_port_w(offs_t offset, uint8_t data) { + if (is_contended(offset)) + { + content_early(); + content_late(); + } + // Pass through to expansion device if present if (m_exp->get_card_device()) m_exp->iorq_w(offset | 1, data); @@ -450,6 +468,12 @@ void spectrum_state::spectrum_port_w(offs_t offset, uint8_t data) uint8_t spectrum_state::spectrum_port_r(offs_t offset) { + if (is_contended(offset)) + { + content_early(); + content_late(); + } + // Pass through to expansion device if present if (m_exp->get_card_device()) return m_exp->iorq_r(offset | 1); @@ -749,15 +773,6 @@ void spectrum_state::device_timer(emu_timer &timer, device_timer_id id, int para case TIMER_IRQ_OFF: m_maincpu->set_input_line(0, CLEAR_LINE); break; - case TIMER_SCANLINE: - { - auto vpos_next = m_screen->vpos() + 1; - if(vpos_next <= get_screen_area().bottom()) { - m_scanline_timer->adjust(m_screen->time_until_pos(vpos_next), get_screen_area().left()); - m_screen->update_now(); - } - break; - } default: throw emu_fatalerror("Unknown id in spectrum_state::device_timer"); } @@ -765,14 +780,7 @@ void spectrum_state::device_timer(emu_timer &timer, device_timer_id id, int para INTERRUPT_GEN_MEMBER(spectrum_state::spec_interrupt) { - timer_set(m_screen->time_until_pos(0), TIMER_IRQ_ON, 0); - - /* Default implementation performs screen updates per scanline. Some other - clones e.g. pentagon do updates based on video_ram access, border updates, - and full frame refresh (for attributes flashing). Such clones may define own - *_interrupt config. */ - if (m_scanline_timer != nullptr) - m_scanline_timer->adjust(m_screen->time_until_pos(get_screen_area().top() + 1)); + timer_set(m_screen->time_until_pos(0, get_screen_area().left()), TIMER_IRQ_ON, 0); } void spectrum_state::spectrum_common(machine_config &config) @@ -783,6 +791,7 @@ void spectrum_state::spectrum_common(machine_config &config) m_maincpu->set_addrmap(AS_OPCODES, &spectrum_state::spectrum_data); m_maincpu->set_addrmap(AS_IO, &spectrum_state::spectrum_io); m_maincpu->set_vblank_int("screen", FUNC(spectrum_state::spec_interrupt)); + m_maincpu->nomreq_cb().set(FUNC(spectrum_state::spectrum_nomreq)); ADDRESS_MAP_BANK(config, m_specmem).set_map(&spectrum_state::spectrum_map).set_options(ENDIANNESS_LITTLE, 8, 16, 0x10000); @@ -911,8 +920,10 @@ ROM_START(spectrum) ROMX_LOAD("diagrom.v50",0x0000,0x4000, CRC(054a2d6a) SHA1(2fa6f3b31d7bb610df78be5c4c80537cf6e5911d), ROM_BIOS(26)) ROM_SYSTEM_BIOS(27, "diagv51", "DiagROM v1.51") ROMX_LOAD("diagrom.v51",0x0000,0x4000, CRC(83034df6) SHA1(e57b2c8a8e3563ea02a20eecd1d4cb6be9f9c2df), ROM_BIOS(27)) - ROM_SYSTEM_BIOS(28, "alford37", "Brian Alford's Test ROM v0.37") - ROMX_LOAD("testromv037.bin", 0x0000,0x4000, CRC(a7ea3d1c) SHA1(f699b73abfb1ab53c063ac02ac6283705864c734), ROM_BIOS(28)) + ROM_SYSTEM_BIOS(28, "diagv56", "DiagROM v1.56") + ROMX_LOAD("diagrom.v56",0x0000,0x4000, CRC(0ed22f7a) SHA1(37caf0bbc2d023ca5afaa12b3856ac90dbc83c51), ROM_BIOS(28)) + ROM_SYSTEM_BIOS(29, "alford37", "Brian Alford's Test ROM v0.37") + ROMX_LOAD("testromv037.bin", 0x0000,0x4000, CRC(a7ea3d1c) SHA1(f699b73abfb1ab53c063ac02ac6283705864c734), ROM_BIOS(29)) ROM_END ROM_START(specide) diff --git a/src/mame/drivers/stop.cpp b/src/mame/drivers/stop.cpp index 800a80dda0e..4865147575d 100644 --- a/src/mame/drivers/stop.cpp +++ b/src/mame/drivers/stop.cpp @@ -105,5 +105,5 @@ ROM_END } // anonymous namespace -// YEAR NAME PARENT MACHINE INPUT CLASS INIT ROT COMPANY FULLNAME FLAGS -GAME( 19??, stop, 0, stop, stop, stop_state, empty_init, ROT0, "unknown", "Stop", MACHINE_IS_SKELETON ) +// YEAR NAME PARENT MACHINE INPUT CLASS INIT ROT COMPANY FULLNAME FLAGS +GAME( 19??, stop, 0, stop, stop, stop_state, empty_init, ROT0, "<unknown>", "Stop", MACHINE_IS_SKELETON ) diff --git a/src/mame/drivers/swtpc09.cpp b/src/mame/drivers/swtpc09.cpp index 0a48d6c8009..de9324eee7d 100644 --- a/src/mame/drivers/swtpc09.cpp +++ b/src/mame/drivers/swtpc09.cpp @@ -68,6 +68,24 @@ F100 - ???? CDS disk 0 controller F300 - ???? CDS disk 1 controller +The supplied flex and uniflex floppies all worked when this driver was +created (2014-03-25), but have been broken since sometime in 2015. + +The message is the same for all 3 disks: Unable to identify the image format. + +Official notes: +mess swtpc09 -flop1 DMAF2_BOOT.dsk +press D to boot flex operating system. dir 0 will perform a directory of drive 0. + +mess swtpc09u -flop1 uflxbtsd.dsk +type D to boot uniflex. This is a multiuser operating system, I need to add an extra terminal to this +and then it would be cool to get it running multiuser. + +mess swtpc09d3 -window -flop1 UOS_3S_BOOT.dsk +type D to boot uniflex. This one has potential to get harddisk support for uniflex in the future. + +mess swtpc09i not working + ***************************************************************************/ /* Address map is dynamically setup when DAT memory is written to */ @@ -609,8 +627,8 @@ ROM_END /* Driver */ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS -COMP( 1980, swtpc09, 0, 0, swtpc09, swtpc09, swtpc09_state, init_swtpc09, "SWTPC", "swtpc S/09 Sbug", MACHINE_NO_SOUND_HW ) -COMP( 1980, swtpc09i, swtpc09, 0, swtpc09i, swtpc09, swtpc09_state, init_swtpc09i, "SWTPC", "swtpc S/09 Sbug + piaide", MACHINE_NO_SOUND_HW ) -COMP( 1980, swtpc09u, swtpc09, 0, swtpc09u, swtpc09, swtpc09_state, init_swtpc09u, "SWTPC", "swtpc S/09 UNIBug + DMAF2", MACHINE_NO_SOUND_HW ) -COMP( 1980, swtpc09d3, swtpc09, 0, swtpc09d3, swtpc09, swtpc09_state, init_swtpc09d3, "SWTPC", "swtpc S/09 UNIBug + DMAF3", MACHINE_NO_SOUND_HW ) -COMP( 1980, swtpc09o, swtpc09, 0, swtpc09o, swtpc09, swtpc09_state, init_swtpc09o, "SWTPC", "swtpc S/09 OS9", MACHINE_NO_SOUND_HW ) +COMP( 1980, swtpc09, 0, 0, swtpc09, swtpc09, swtpc09_state, init_swtpc09, "SWTPC", "swtpc S/09 Sbug", MACHINE_NO_SOUND_HW | MACHINE_NOT_WORKING ) +COMP( 1980, swtpc09i, swtpc09, 0, swtpc09i, swtpc09, swtpc09_state, init_swtpc09i, "SWTPC", "swtpc S/09 Sbug + piaide", MACHINE_NO_SOUND_HW | MACHINE_NOT_WORKING ) +COMP( 1980, swtpc09u, swtpc09, 0, swtpc09u, swtpc09, swtpc09_state, init_swtpc09u, "SWTPC", "swtpc S/09 UNIBug + DMAF2", MACHINE_NO_SOUND_HW | MACHINE_NOT_WORKING ) +COMP( 1980, swtpc09d3, swtpc09, 0, swtpc09d3, swtpc09, swtpc09_state, init_swtpc09d3, "SWTPC", "swtpc S/09 UNIBug + DMAF3", MACHINE_NO_SOUND_HW | MACHINE_NOT_WORKING ) +COMP( 1980, swtpc09o, swtpc09, 0, swtpc09o, swtpc09, swtpc09_state, init_swtpc09o, "SWTPC", "swtpc S/09 OS9", MACHINE_NO_SOUND_HW | MACHINE_NOT_WORKING ) diff --git a/src/mame/drivers/system1.cpp b/src/mame/drivers/system1.cpp index 4031fc13116..d89ec4ec1a0 100644 --- a/src/mame/drivers/system1.cpp +++ b/src/mame/drivers/system1.cpp @@ -349,86 +349,86 @@ static const u8 cc_op[0x100] = { 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+1*2, 4*5+1*2, - 5*5+1*2,10*5+1*2,10*5+3*2,10*5+3*2,10*5+3*2,11*5+1*2, 7*5+2*2,11*5+1*2, 5*5+1*2,10*5+1*2,10*5+3*2, 0*5 ,10*5+3*2,17*5+3*2, 7*5+2*2,11*5+1*2, - 5*5+1*2,10*5+1*2,10*5+3*2,11*5+2*2,10*5+3*2,11*5+1*2, 7*5+2*2,11*5+1*2, 5*5+1*2, 4*5+1*2,10*5+3*2,11*5+2*2,10*5+3*2, 0*5 , 7*5+2*2,11*5+1*2, - 5*5+1*2,10*5+1*2,10*5+3*2,19*5+1*2,10*5+3*2,11*5+1*2, 7*5+2*2,11*5+1*2, 5*5+1*2, 4*5+1*2,10*5+3*2, 4*5+1*2,10*5+3*2, 0*5 , 7*5+2*2,11*5+1*2, - 5*5+1*2,10*5+1*2,10*5+3*2, 4*5+1*2,10*5+3*2,11*5+1*2, 7*5+2*2,11*5+1*2, 5*5+1*2, 6*5+1*2,10*5+3*2, 4*5+1*2,10*5+3*2, 0*5 , 7*5+2*2,11*5+1*2 + 5*5+1*2,10*5+1*2,10*5+3*2,10*5+3*2,10*5+3*2,11*5+1*2, 7*5+2*2,11*5+1*2, 5*5+1*2,10*5+1*2,10*5+3*2, 4*5+1*2,10*5+3*2,17*5+3*2, 7*5+2*2,11*5+1*2, + 5*5+1*2,10*5+1*2,10*5+3*2,11*5+2*2,10*5+3*2,11*5+1*2, 7*5+2*2,11*5+1*2, 5*5+1*2, 4*5+1*2,10*5+3*2,11*5+2*2,10*5+3*2, 4*5+1*2, 7*5+2*2,11*5+1*2, + 5*5+1*2,10*5+1*2,10*5+3*2,19*5+1*2,10*5+3*2,11*5+1*2, 7*5+2*2,11*5+1*2, 5*5+1*2, 4*5+1*2,10*5+3*2, 4*5+1*2,10*5+3*2, 4*5+1*2, 7*5+2*2,11*5+1*2, + 5*5+1*2,10*5+1*2,10*5+3*2, 4*5+1*2,10*5+3*2,11*5+1*2, 7*5+2*2,11*5+1*2, 5*5+1*2, 6*5+1*2,10*5+3*2, 4*5+1*2,10*5+3*2, 4*5+1*2, 7*5+2*2,11*5+1*2 }; static const u8 cc_cb[0x100] = { - 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, - 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, - 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, - 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, - 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,12*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,12*5+2*2, 8*5+2*2, - 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,12*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,12*5+2*2, 8*5+2*2, - 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,12*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,12*5+2*2, 8*5+2*2, - 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,12*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,12*5+2*2, 8*5+2*2, - 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, - 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, - 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, - 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, - 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, - 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, - 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, - 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,15*5+2*2, 8*5+2*2 + 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,11*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,11*5+1*2, 4*5+1*2, + 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,11*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,11*5+1*2, 4*5+1*2, + 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,11*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,11*5+1*2, 4*5+1*2, + 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,11*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,11*5+1*2, 4*5+1*2, + 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 8*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 8*5+1*2, 4*5+1*2, + 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 8*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 8*5+1*2, 4*5+1*2, + 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 8*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 8*5+1*2, 4*5+1*2, + 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 8*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 8*5+1*2, 4*5+1*2, + 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,11*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,11*5+1*2, 4*5+1*2, + 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,11*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,11*5+1*2, 4*5+1*2, + 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,11*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,11*5+1*2, 4*5+1*2, + 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,11*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,11*5+1*2, 4*5+1*2, + 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,11*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,11*5+1*2, 4*5+1*2, + 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,11*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,11*5+1*2, 4*5+1*2, + 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,11*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,11*5+1*2, 4*5+1*2, + 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,11*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,11*5+1*2, 4*5+1*2 }; static const u8 cc_ed[0x100] = { - 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, - 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, - 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, - 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, - 12*5+2*2,12*5+2*2,15*5+2*2,20*5+4*2,8*5+2*2,14*5+2*2, 8*5+2*2, 9*5+2*2,12*5+2*2,12*5+2*2,15*5+2*2,20*5+4*2, 8*5+2*2,14*5+2*2, 8*5+2*2, 9*5+2*2, - 12*5+2*2,12*5+2*2,15*5+2*2,20*5+4*2,8*5+2*2,14*5+2*2, 8*5+2*2, 9*5+2*2,12*5+2*2,12*5+2*2,15*5+2*2,20*5+4*2, 8*5+2*2,14*5+2*2, 8*5+2*2, 9*5+2*2, - 12*5+2*2,12*5+2*2,15*5+2*2,20*5+4*2,8*5+2*2,14*5+2*2, 8*5+2*2,18*5+2*2,12*5+2*2,12*5+2*2,15*5+2*2,20*5+4*2, 8*5+2*2,14*5+2*2, 8*5+2*2,18*5+2*2, - 12*5+2*2,12*5+2*2,15*5+2*2,20*5+4*2,8*5+2*2,14*5+2*2, 8*5+2*2, 8*5+2*2,12*5+2*2,12*5+2*2,15*5+2*2,20*5+4*2, 8*5+2*2,14*5+2*2, 8*5+2*2, 8*5+2*2, - 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, - 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, - 16*5+2*2,16*5+2*2,16*5+2*2,16*5+2*2,8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,16*5+2*2,16*5+2*2,16*5+2*2,16*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, - 16*5+2*2,16*5+2*2,16*5+2*2,16*5+2*2,8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2,16*5+2*2,16*5+2*2,16*5+2*2,16*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, - 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, - 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, - 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, - 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2, 8*5+2*2 + 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, + 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, + 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, + 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, + 8*5+1*2, 8*5+1*2,11*5+1*2,16*5+3*2, 4*5+1*2,14*5+2*2, 4*5+1*2, 5*5+1*2, 8*5+1*2, 8*5+1*2,11*5+1*2,16*5+3*2, 4*5+1*2,14*5+2*2, 4*5+1*2, 5*5+1*2, + 8*5+1*2, 8*5+1*2,11*5+1*2,16*5+3*2, 4*5+1*2,14*5+2*2, 4*5+1*2, 5*5+1*2, 8*5+1*2, 8*5+1*2,11*5+1*2,16*5+3*2, 4*5+1*2,14*5+2*2, 4*5+1*2, 5*5+1*2, + 8*5+1*2, 8*5+1*2,11*5+1*2,16*5+3*2, 4*5+1*2,14*5+2*2, 4*5+1*2,14*5+1*2, 8*5+1*2, 8*5+1*2,11*5+1*2,16*5+3*2, 4*5+1*2,14*5+2*2, 4*5+1*2,14*5+1*2, + 8*5+1*2, 8*5+1*2,11*5+1*2,16*5+3*2, 4*5+1*2,14*5+2*2, 4*5+1*2, 4*5+1*2, 8*5+1*2, 8*5+1*2,11*5+1*2,16*5+3*2, 4*5+1*2,14*5+2*2, 4*5+1*2, 4*5+1*2, + 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, + 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, + 12*5+1*2,12*5+1*2,12*5+1*2,12*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,12*5+1*2,12*5+1*2,12*5+1*2,12*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, + 12*5+1*2,12*5+1*2,12*5+1*2,12*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,12*5+1*2,12*5+1*2,12*5+1*2,12*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, + 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, + 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, + 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, + 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2 }; static const u8 cc_xy[0x100] = { - ( 4+4)*5+2*2,(10+4)*5+4*2,( 7+4)*5+2*2,( 6+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 7+4)*5+3*2,( 4+4)*5+2*2,( 4+4)*5+2*2,(11+4)*5+2*2,( 7+4)*5+2*2,( 6+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 7+4)*5+3*2,( 4+4)*5+2*2, - ( 8+4)*5+3*2,(10+4)*5+4*2,( 7+4)*5+2*2,( 6+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 7+4)*5+3*2,( 4+4)*5+2*2,(12+4)*5+3*2,(11+4)*5+2*2,( 7+4)*5+2*2,( 6+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 7+4)*5+3*2,( 4+4)*5+2*2, - ( 7+4)*5+3*2,(10+4)*5+4*2,(16+4)*5+4*2,( 6+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 7+4)*5+3*2,( 4+4)*5+2*2,( 7+4)*5+3*2,(11+4)*5+2*2,(16+4)*5+4*2,( 6+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 7+4)*5+3*2,( 4+4)*5+2*2, - ( 7+4)*5+3*2,(10+4)*5+4*2,(13+4)*5+4*2,( 6+4)*5+2*2,(23 )*5+3*2,(23 )*5+3*2,(19 )*5+4*2,( 4+4)*5+2*2,( 7+4)*5+3*2,(11+4)*5+2*2,(13+4)*5+4*2,( 6+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 7+4)*5+3*2,( 4+4)*5+2*2, - ( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,(19 )*5+3*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,(19 )*5+3*2,( 4+4)*5+2*2, - ( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,(19 )*5+3*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,(19 )*5+3*2,( 4+4)*5+2*2, - ( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,(19 )*5+3*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,(19 )*5+3*2,( 4+4)*5+2*2, - (19 )*5+3*2,(19 )*5+3*2,(19 )*5+3*2,(19 )*5+3*2,(19 )*5+3*2,(19 )*5+3*2,( 4+4)*5+2*2,(19 )*5+3*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,(19 )*5+3*2,( 4+4)*5+2*2, - ( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,(19 )*5+3*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,(19 )*5+3*2,( 4+4)*5+2*2, - ( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,(19 )*5+3*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,(19 )*5+3*2,( 4+4)*5+2*2, - ( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,(19 )*5+3*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,(19 )*5+3*2,( 4+4)*5+2*2, - ( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,(19 )*5+3*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,( 4+4)*5+2*2,(19 )*5+3*2,( 4+4)*5+2*2, - ( 5+4)*5+2*2,(10+4)*5+2*2,(10+4)*5+4*2,(10+4)*5+4*2,(10+4)*5+4*2,(11+4)*5+2*2,( 7+4)*5+3*2,(11+4)*5+2*2,( 5+4)*5+2*2,(10+4)*5+2*2,(10+4)*5+4*2,( 0 )*5 ,(10+4)*5+4*2,(17+4)*5+4*2,( 7+4)*5+3*2,(11+4)*5+2*2, - ( 5+4)*5+2*2,(10+4)*5+2*2,(10+4)*5+4*2,(11+4)*5+3*2,(10+4)*5+4*2,(11+4)*5+2*2,( 7+4)*5+3*2,(11+4)*5+2*2,( 5+4)*5+2*2,( 4+4)*5+2*2,(10+4)*5+4*2,(11+4)*5+3*2,(10+4)*5+4*2,( 4 )*5+2*2,( 7+4)*5+3*2,(11+4)*5+2*2, - ( 5+4)*5+2*2,(10+4)*5+2*2,(10+4)*5+4*2,(19+4)*5+2*2,(10+4)*5+4*2,(11+4)*5+2*2,( 7+4)*5+3*2,(11+4)*5+2*2,( 5+4)*5+2*2,( 4+4)*5+2*2,(10+4)*5+4*2,( 4+4)*5+2*2,(10+4)*5+4*2,( 4 )*5+2*2,( 7+4)*5+3*2,(11+4)*5+2*2, - ( 5+4)*5+2*2,(10+4)*5+2*2,(10+4)*5+4*2,( 4+4)*5+2*2,(10+4)*5+4*2,(11+4)*5+2*2,( 7+4)*5+3*2,(11+4)*5+2*2,( 5+4)*5+2*2,( 6+4)*5+2*2,(10+4)*5+4*2,( 4+4)*5+2*2,(10+4)*5+4*2,( 4 )*5+2*2,( 7+4)*5+3*2,(11+4)*5+2*2 + 4*5+1*2,10*5+3*2, 7*5+1*2, 6*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+2*2, 4*5+1*2, 4*5+1*2,11*5+1*2, 7*5+1*2, 6*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+2*2, 4*5+1*2, + 8*5+2*2,10*5+3*2, 7*5+1*2, 6*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+2*2, 4*5+1*2,12*5+2*2,11*5+1*2, 7*5+1*2, 6*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+2*2, 4*5+1*2, + 7*5+2*2,10*5+3*2,16*5+3*2, 6*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+2*2, 4*5+1*2, 7*5+2*2,11*5+1*2,16*5+3*2, 6*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+2*2, 4*5+1*2, + 7*5+2*2,10*5+3*2,13*5+3*2, 6*5+1*2,19*5+2*2,19*5+2*2,15*5+3*2, 4*5+1*2, 7*5+2*2,11*5+1*2,13*5+3*2, 6*5+1*2, 4*5+1*2, 4*5+1*2, 7*5+2*2, 4*5+1*2, + 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,15*5+2*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,15*5+2*2, 4*5+1*2, + 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,15*5+2*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,15*5+2*2, 4*5+1*2, + 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,15*5+2*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,15*5+2*2, 4*5+1*2, + 15*5+2*2,15*5+2*2,15*5+2*2,15*5+2*2,15*5+2*2,15*5+2*2, 4*5+1*2,15*5+2*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,15*5+2*2, 4*5+1*2, + 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,15*5+2*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,15*5+2*2, 4*5+1*2, + 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,15*5+2*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,15*5+2*2, 4*5+1*2, + 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,15*5+2*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,15*5+2*2, 4*5+1*2, + 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,15*5+2*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2, 4*5+1*2,15*5+2*2, 4*5+1*2, + 5*5+1*2,10*5+1*2,10*5+3*2,10*5+3*2,10*5+3*2,11*5+1*2, 7*5+2*2,11*5+1*2, 5*5+1*2,10*5+1*2,10*5+3*2, 7*5+1*2,10*5+3*2,17*5+3*2, 7*5+2*2,11*5+1*2, + 5*5+1*2,10*5+1*2,10*5+3*2,11*5+2*2,10*5+3*2,11*5+1*2, 7*5+2*2,11*5+1*2, 5*5+1*2, 4*5+1*2,10*5+3*2,11*5+2*2,10*5+3*2, 4*5+1*2, 7*5+2*2,11*5+1*2, + 5*5+1*2,10*5+1*2,10*5+3*2,19*5+1*2,10*5+3*2,11*5+1*2, 7*5+2*2,11*5+1*2, 5*5+1*2, 4*5+1*2,10*5+3*2, 4*5+1*2,10*5+3*2, 4*5+1*2, 7*5+2*2,11*5+1*2, + 5*5+1*2,10*5+1*2,10*5+3*2, 4*5+1*2,10*5+3*2,11*5+1*2, 7*5+2*2,11*5+1*2, 5*5+1*2, 6*5+1*2,10*5+3*2, 4*5+1*2,10*5+3*2, 4*5+1*2, 7*5+2*2,11*5+1*2 }; static const u8 cc_xycb[0x100] = { - 23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2, - 23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2, - 23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2, - 23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2, - 20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2, - 20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2, - 20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2, - 20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2,20*5+4*2, - 23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2, - 23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2, - 23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2, - 23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2, - 23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2, - 23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2, - 23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2, - 23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2,23*5+4*2 + 12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5, + 12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5, + 12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5, + 12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5, + 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, + 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, + 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, + 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, 9*5, + 12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5, + 12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5, + 12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5, + 12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5, + 12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5, + 12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5, + 12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5, + 12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5,12*5 }; /* extra cycles if jr/jp/call taken and 'interrupt latency' on rst 0-7 */ @@ -451,7 +451,6 @@ static const u8 cc_ex[0x100] = { 6*5, 0*5, 0*5, 0*5, 7*5, 0*5, 0*5, 2*5, 6*5, 0*5, 0*5, 0*5, 7*5, 0*5, 0*5, 2*5 }; - void system1_state::machine_start() { const u32 numbanks = (m_maincpu_region->bytes() - 0x10000) / 0x4000; diff --git a/src/mame/drivers/taitogn.cpp b/src/mame/drivers/taitogn.cpp index 4debb99bbfc..03fcbf3a9cf 100644 --- a/src/mame/drivers/taitogn.cpp +++ b/src/mame/drivers/taitogn.cpp @@ -398,12 +398,12 @@ private: required_ioport m_jp1; bool m_has_zoom; - uint8_t m_control; - uint16_t m_control2; - uint8_t m_control3; - int m_v; + uint8_t m_control = 0; + uint16_t m_control2 = 0; + uint8_t m_control3 = 0; + int m_v = 0; - uint8_t m_coin_info; + uint8_t m_coin_info = 0; }; // Misc. controls diff --git a/src/mame/drivers/timex.cpp b/src/mame/drivers/timex.cpp index 2a5e5c5b23e..0d87233c08e 100644 --- a/src/mame/drivers/timex.cpp +++ b/src/mame/drivers/timex.cpp @@ -222,7 +222,7 @@ void ts2068_state::ts2068_update_memory() uint8_t *ExROM = memregion("maincpu")->base() + 0x014000; - uint8_t *ChosenROM; + uint8_t *ChosenROM = nullptr; if (m_port_f4_data & 0x01) { @@ -601,7 +601,6 @@ DEVICE_IMAGE_LOAD_MEMBER( ts2068_state::cart_load ) if (!image.loaded_through_softlist()) { - uint8_t *DOCK; int chunks_in_file = 0; std::vector<uint8_t> header; header.resize(9); @@ -618,7 +617,7 @@ DEVICE_IMAGE_LOAD_MEMBER( ts2068_state::cart_load ) } m_dock->rom_alloc(0x10000, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); - DOCK = m_dock->get_rom_base(); + u8* DOCK = m_dock->get_rom_base(); // check header image.fread(&header[0], 9); diff --git a/src/mame/drivers/tsconf.cpp b/src/mame/drivers/tsconf.cpp index fd1b9115106..8e0abd86ae3 100644 --- a/src/mame/drivers/tsconf.cpp +++ b/src/mame/drivers/tsconf.cpp @@ -185,7 +185,7 @@ GFXDECODE_END void tsconf_state::video_start() { spectrum_128_state::video_start(); - m_scanline_timer->reset(); + m_contention_pattern = {}; // disable inherited contention m_ts_tilemap[TM_TS_CHAR] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(tsconf_state::get_tile_info_txt)), TILEMAP_SCAN_ROWS, 8, 8, 128, 64); diff --git a/src/mame/drivers/usgames.cpp b/src/mame/drivers/usgames.cpp index 128cefa4e54..263efb2f092 100644 --- a/src/mame/drivers/usgames.cpp +++ b/src/mame/drivers/usgames.cpp @@ -106,8 +106,6 @@ void usgames_state::video_start() { // assumes it can make an address mask from m_videoram.length() - 1 assert(!(m_videoram.length() & (m_videoram.length() - 1))); - - m_gfxdecode->gfx(0)->set_source(m_charram); } void usgames_state::charram_w(offs_t offset, uint8_t data) @@ -303,7 +301,7 @@ INPUT_PORTS_END static GFXDECODE_START( gfx_usgames ) - GFXDECODE_ENTRY( nullptr, 0x2800, gfx_8x8x1, 0, 1 ) + GFXDECODE_RAM( "charram", 0x2800, gfx_8x8x1, 0, 1 ) GFXDECODE_END diff --git a/src/mame/drivers/vicdual.cpp b/src/mame/drivers/vicdual.cpp index 6d67e5eceba..f5ec79c277a 100644 --- a/src/mame/drivers/vicdual.cpp +++ b/src/mame/drivers/vicdual.cpp @@ -3212,7 +3212,7 @@ ROM_START( headonn ) ROM_LOAD( "prom.g2", 0x0000, 0x0020, CRC(67104ea9) SHA1(26b6bd2a1973b83bb9af4e3385d8cb14cb3f62f2) ) ROM_REGION( 0x0040, "user1", 0 ) /* timing PROMs */ - ROM_LOAD( "prom.b6", 0x0000, 0x0020, CRC(67104ea9) SHA1(26b6bd2a1973b83bb9af4e3385d8cb14cb3f62f2) ) /* control PROM */ + ROM_LOAD( "prom.b6", 0x0000, 0x0020, CRC(7e1cb76b) SHA1(3366ead65d49cab076ccdafbb13726c7e05f8b9a) ) /* control PROM */ ROM_LOAD( "prom.f2", 0x0020, 0x0020, CRC(a1506b9d) SHA1(037c3db2ea40eca459e8acba9d1506dd28d72d10) ) /* sequence PROM */ ROM_END diff --git a/src/mame/drivers/vigilant.cpp b/src/mame/drivers/vigilant.cpp index 42ff8cb2455..a99eeefb8eb 100644 --- a/src/mame/drivers/vigilant.cpp +++ b/src/mame/drivers/vigilant.cpp @@ -24,10 +24,7 @@ Bottom board - M75-B-A (all versions regardless of mask ROM/EPROM) Roberto Fresca 2022.04.23: Added Bowmen, from Ten-Level. A very rare Spanish game. -The game uses derivative hardware, and has some oddities, like lack of some -music codes or clipped samples. They may have finished development -abruptly, without time for final polish. Seems to finish in level 10 -(30 stages), but the game is so hard, testing is difficult. +The game uses derivative hardware. ***************************************************************************/ @@ -151,7 +148,7 @@ void vigilant_state::bowmen_io_map(address_map &map) void vigilant_state::sound_map(address_map &map) { - map(0x0000, 0xbfff).rom(); + map(0x0000, 0xefff).rom(); map(0xf000, 0xffff).ram(); } diff --git a/src/mame/drivers/xavix2.cpp b/src/mame/drivers/xavix2.cpp index bb0f3d638df..b515aa8c910 100644 --- a/src/mame/drivers/xavix2.cpp +++ b/src/mame/drivers/xavix2.cpp @@ -342,6 +342,8 @@ void xavix2_state::gpu_update(u16 count, u16 adr) u32 y = (command >> 11) & 0x3ff; u32 sx = 1+(descsize & 0xff); u32 sy = 1 + ((descsize >> 8) & 0xff); + u32 scalex = (command >> 40) & 0x3; //only 1 and 2 seen as values for these two so far + u32 scaley = (command >> 46) & 0x3; u32 bpp = 1 + ((descsize >> 24) & 7); logerror("gpu - data %06x size %08x w=%x h=%x ?=%x bpp=%x pal=%x\n", sadr, descsize, sx, sy, (descsize >> 16) & 0xff, bpp, descsize >> 27); @@ -364,7 +366,13 @@ void xavix2_state::gpu_update(u16 count, u16 adr) avail = 64; } u32 color = m_palette[palette | (v & mask)]; - if (color) m_sd[y+yy][x+xx] = color; + if(color) { + for(u32 yyy = 0; yyy<scaley; yyy++) { + for(u32 xxx = 0; xxx < scalex; xxx++) { + m_sd[y+(yy*scaley)+yyy][x+(xx*scalex)+xxx] = color; + } + } + } v >>= bpp; avail -= bpp; } diff --git a/src/mame/includes/appoooh.h b/src/mame/includes/appoooh.h deleted file mode 100644 index 01d9e05bf50..00000000000 --- a/src/mame/includes/appoooh.h +++ /dev/null @@ -1,91 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Tatsuyuki Satoh -#ifndef MAME_INCLUDES_APPOOOH_H -#define MAME_INCLUDES_APPOOOH_H - -#pragma once - -#include "sound/msm5205.h" -#include "emupal.h" -#include "tilemap.h" - -class appoooh_state : public driver_device -{ -public: - appoooh_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_spriteram(*this, "spriteram"), - m_fg_videoram(*this, "fg_videoram"), - m_fg_colorram(*this, "fg_colorram"), - m_spriteram_2(*this, "spriteram_2"), - m_bg_videoram(*this, "bg_videoram"), - m_bg_colorram(*this, "bg_colorram"), - m_decrypted_opcodes(*this, "decrypted_opcodes"), - m_maincpu(*this, "maincpu"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette"), - m_msm(*this, "msm") - { } - - void init_robowresb(); - void appoooh(machine_config &config); - void robowres(machine_config &config); - void robowrese(machine_config &config); - -protected: - void adpcm_w(uint8_t data); - void scroll_w(uint8_t data); - void fg_videoram_w(offs_t offset, uint8_t data); - void fg_colorram_w(offs_t offset, uint8_t data); - void bg_videoram_w(offs_t offset, uint8_t data); - void bg_colorram_w(offs_t offset, uint8_t data); - void out_w(uint8_t data); - TILE_GET_INFO_MEMBER(get_fg_tile_info); - TILE_GET_INFO_MEMBER(get_bg_tile_info); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - void appoooh_palette(palette_device &palette) const; - void robowres_palette(palette_device &palette) const; - uint32_t screen_update_appoooh(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_robowres(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(vblank_irq); - void appoooh_draw_sprites( bitmap_ind16 &dest_bmp, const rectangle &cliprect, gfx_element *gfx, uint8_t *sprite ); - void robowres_draw_sprites( bitmap_ind16 &dest_bmp, const rectangle &cliprect, gfx_element *gfx, uint8_t *sprite ); - DECLARE_WRITE_LINE_MEMBER(adpcm_int); - - void appoooh_common(machine_config &config); - void decrypted_opcodes_map(address_map &map); - void main_map(address_map &map); - void main_portmap(address_map &map); - -private: - /* memory pointers */ - required_shared_ptr<uint8_t> m_spriteram; - required_shared_ptr<uint8_t> m_fg_videoram; - required_shared_ptr<uint8_t> m_fg_colorram; - required_shared_ptr<uint8_t> m_spriteram_2; - required_shared_ptr<uint8_t> m_bg_videoram; - required_shared_ptr<uint8_t> m_bg_colorram; - optional_shared_ptr<uint8_t> m_decrypted_opcodes; - - /* video-related */ - tilemap_t *m_fg_tilemap = nullptr; - tilemap_t *m_bg_tilemap = nullptr; - int m_scroll_x = 0; - int m_priority = 0; - - /* sound-related */ - uint32_t m_adpcm_data = 0U; - uint32_t m_adpcm_address = 0U; - - /* devices */ - required_device<cpu_device> m_maincpu; - required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; - required_device<msm5205_device> m_msm; - - uint8_t m_nmi_mask = 0U; -}; - -#endif // MAME_INCLUDES_APPOOOH_H diff --git a/src/mame/includes/brkthru.h b/src/mame/includes/brkthru.h deleted file mode 100644 index 3a71938852a..00000000000 --- a/src/mame/includes/brkthru.h +++ /dev/null @@ -1,77 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Phil Stroffolino -/*************************************************************************** - - Break Thru - -***************************************************************************/ -#ifndef MAME_INCLUDES_BRKTRHU_H -#define MAME_INCLUDES_BRKTRHU_H - -#pragma once - -#include "machine/gen_latch.h" -#include "emupal.h" -#include "tilemap.h" - -class brkthru_state : public driver_device -{ -public: - brkthru_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_fg_videoram(*this, "fg_videoram"), - m_videoram(*this, "videoram"), - m_spriteram(*this, "spriteram"), - m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette"), - m_soundlatch(*this, "soundlatch") - { } - - void brkthru(machine_config &config); - void darwin(machine_config &config); - DECLARE_INPUT_CHANGED_MEMBER(coin_inserted); - void init_brkthru(); - -private: - /* memory pointers */ - required_shared_ptr<uint8_t> m_fg_videoram; - required_shared_ptr<uint8_t> m_videoram; - required_shared_ptr<uint8_t> m_spriteram; - - /* video-related */ - tilemap_t *m_fg_tilemap = nullptr; - tilemap_t *m_bg_tilemap = nullptr; - int m_bgscroll = 0; - int m_bgbasecolor = 0; - int m_flipscreen = 0; - - /* devices */ - required_device<cpu_device> m_maincpu; - required_device<cpu_device> m_audiocpu; - required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; - required_device<generic_latch_8_device> m_soundlatch; - - uint8_t m_nmi_mask = 0U; - void brkthru_1803_w(uint8_t data); - void darwin_0803_w(uint8_t data); - void brkthru_bgram_w(offs_t offset, uint8_t data); - void brkthru_fgram_w(offs_t offset, uint8_t data); - void brkthru_1800_w(offs_t offset, uint8_t data); - TILE_GET_INFO_MEMBER(get_bg_tile_info); - TILE_GET_INFO_MEMBER(get_fg_tile_info); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - void brkthru_palette(palette_device &palette) const; - uint32_t screen_update_brkthru(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - DECLARE_WRITE_LINE_MEMBER(vblank_irq); - void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int prio ); - void brkthru_map(address_map &map); - void darwin_map(address_map &map); - void sound_map(address_map &map); -}; - -#endif // MAME_INCLUDES_BRKTRHU_H diff --git a/src/mame/includes/gunsmoke.h b/src/mame/includes/gunsmoke.h deleted file mode 100644 index 2286814eee1..00000000000 --- a/src/mame/includes/gunsmoke.h +++ /dev/null @@ -1,68 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Paul Leaman -/************************************************************************* - - Gun.Smoke - -*************************************************************************/ -#ifndef MAME_INCLUDES_GUNSMOKE_H -#define MAME_INCLUDES_GUNSMOKE_H - -#pragma once - -#include "emupal.h" -#include "tilemap.h" - -class gunsmoke_state : public driver_device -{ -public: - gunsmoke_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_videoram(*this, "videoram"), - m_colorram(*this, "colorram"), - m_scrollx(*this, "scrollx"), - m_scrolly(*this, "scrolly"), - m_spriteram(*this, "spriteram"), - m_maincpu(*this, "maincpu"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") - { } - - void gunsmoke(machine_config &config); - -private: - /* memory pointers */ - required_shared_ptr<uint8_t> m_videoram; - required_shared_ptr<uint8_t> m_colorram; - required_shared_ptr<uint8_t> m_scrollx; - required_shared_ptr<uint8_t> m_scrolly; - required_shared_ptr<uint8_t> m_spriteram; - - /* video-related */ - tilemap_t *m_bg_tilemap = nullptr; - tilemap_t *m_fg_tilemap = nullptr; - uint8_t m_chon = 0U; - uint8_t m_objon = 0U; - uint8_t m_bgon = 0U; - uint8_t m_sprite3bank = 0U; - uint8_t gunsmoke_protection_r(offs_t offset); - void gunsmoke_videoram_w(offs_t offset, uint8_t data); - void gunsmoke_colorram_w(offs_t offset, uint8_t data); - void gunsmoke_c804_w(uint8_t data); - void gunsmoke_d806_w(uint8_t data); - TILE_GET_INFO_MEMBER(get_bg_tile_info); - TILE_GET_INFO_MEMBER(get_fg_tile_info); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - void gunsmoke_palette(palette_device &palette) const; - uint32_t screen_update_gunsmoke(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); - required_device<cpu_device> m_maincpu; - required_device<gfxdecode_device> m_gfxdecode; - required_device<palette_device> m_palette; - void gunsmoke_map(address_map &map); - void sound_map(address_map &map); -}; - -#endif // MAME_INCLUDES_GUNSMOKE_H diff --git a/src/mame/includes/jaguar.h b/src/mame/includes/jaguar.h index e38991aa767..a1447575599 100644 --- a/src/mame/includes/jaguar.h +++ b/src/mame/includes/jaguar.h @@ -146,46 +146,46 @@ protected: optional_ioport m_system; // configuration - bool m_is_r3000; - bool m_is_cojag; - bool m_hacks_enabled; - int m_pixel_clock; - bool m_using_cart; + bool m_is_r3000 = false; + bool m_is_cojag = false; + bool m_hacks_enabled = false; + int m_pixel_clock = 0; + bool m_using_cart = false; - uint32_t m_joystick_data; + uint32_t m_joystick_data = 0; private: - uint32_t m_misc_control_data; - bool m_eeprom_enable; - uint32_t *m_gpu_jump_address; - bool m_gpu_command_pending; - uint32_t m_gpu_spin_pc; - uint32_t *m_main_speedup; - int m_main_speedup_hits; - uint64_t m_main_speedup_last_cycles; - uint64_t m_main_speedup_max_cycles; - uint32_t *m_main_gpu_wait; + uint32_t m_misc_control_data = 0; + bool m_eeprom_enable = false; + uint32_t *m_gpu_jump_address = 0; + bool m_gpu_command_pending = false; + uint32_t m_gpu_spin_pc = 0; + uint32_t *m_main_speedup = 0; + int m_main_speedup_hits = 0; + uint64_t m_main_speedup_last_cycles = 0; + uint64_t m_main_speedup_max_cycles = 0; + uint32_t *m_main_gpu_wait = 0; // driver data - uint8_t m_eeprom_bit_count; - uint8_t m_protection_check; /* 0 = check hasn't started yet; 1= check in progress; 2 = check is finished. */ + uint8_t m_eeprom_bit_count = 0; + uint8_t m_protection_check = 0; /* 0 = check hasn't started yet; 1= check in progress; 2 = check is finished. */ // audio data - uint16_t m_dsp_regs[0x40/2]; - uint16_t m_serial_frequency; - uint8_t m_gpu_irq_state; - emu_timer *m_serial_timer; + uint16_t m_dsp_regs[0x40/2]{}; + uint16_t m_serial_frequency = 0; + uint8_t m_gpu_irq_state = 0; + emu_timer *m_serial_timer = nullptr; // blitter variables - uint32_t m_blitter_regs[40]; - uint16_t m_gpu_regs[0x100/2]; - emu_timer *m_object_timer; - uint8_t m_cpu_irq_state; + uint32_t m_blitter_regs[40]{}; + uint16_t m_gpu_regs[0x100/2]{}; + emu_timer *m_object_timer = nullptr; + uint8_t m_cpu_irq_state = 0; bitmap_rgb32 m_screen_bitmap; - uint8_t m_blitter_status; - pen_t m_pen_table[65536]; - uint8_t m_blend_y[65536]; - uint8_t m_blend_cc[65536]; + uint8_t m_blitter_status = 0; + pen_t m_pen_table[65536]{}; + uint8_t m_blend_y[65536]{}; + uint8_t m_blend_cc[65536]{}; static void (jaguar_state::*const bitmap4[8])(uint16_t *, int32_t, int32_t, uint32_t *, int32_t, uint16_t *); static void (jaguar_state::*const bitmap8[8])(uint16_t *, int32_t, int32_t, uint32_t *, int32_t, uint16_t *); diff --git a/src/mame/includes/spectrum.h b/src/mame/includes/spectrum.h index c392c32e4e1..61fc08b6cbf 100644 --- a/src/mame/includes/spectrum.h +++ b/src/mame/includes/spectrum.h @@ -20,6 +20,7 @@ #include "sound/spkrdev.h" #include "emupal.h" #include "screen.h" +#include "cpu/z80/z80.h" /* Spectrum crystals */ @@ -52,7 +53,6 @@ public: spectrum_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_video_ram(*this, "video_ram"), - m_scanline_timer(nullptr), m_maincpu(*this, "maincpu"), m_screen(*this, "screen"), m_cassette(*this, "cassette"), @@ -99,8 +99,7 @@ protected: enum { TIMER_IRQ_ON, - TIMER_IRQ_OFF, - TIMER_SCANLINE // tsconf assumes it last know. if need more add above or fix references in clones + TIMER_IRQ_OFF // tsconf assumes it last know. if need more add above or fix references in clones }; int m_port_fe_data; @@ -115,11 +114,7 @@ protected: uint8_t *m_screen_location; int m_ROMSelection = 0; // FIXME: this is used for various things in derived classes, but not by this base class, and should be removed - - // Build up the screen bitmap line-by-line as the z80 uses CPU cycles. - // Eliminates sprite flicker on various games (E.g. Marauder and - // Stormlord) and makes Firefly playable. - emu_timer *m_scanline_timer; + std::vector<u8> m_contention_pattern; uint8_t m_ram_disabled_by_beta; uint8_t pre_opcode_fetch_r(offs_t offset); @@ -127,7 +122,12 @@ protected: uint8_t spectrum_rom_r(offs_t offset); uint8_t spectrum_data_r(offs_t offset); void spectrum_data_w(offs_t offset, uint8_t data); + virtual bool is_contended(offs_t offset); + virtual bool is_vram_write(offs_t offset); + void content_early(s8 shift = 0); + void content_late(); + void spectrum_nomreq(offs_t offset, uint8_t data); void spectrum_ula_w(offs_t offset, uint8_t data); uint8_t spectrum_ula_r(offs_t offset); void spectrum_port_w(offs_t offset, uint8_t data); @@ -142,7 +142,7 @@ protected: DECLARE_SNAPSHOT_LOAD_MEMBER(snapshot_cb); DECLARE_QUICKLOAD_LOAD_MEMBER(quickload_cb); - required_device<cpu_device> m_maincpu; + required_device<z80_device> m_maincpu; required_device<screen_device> m_screen; void spectrum_io(address_map &map); @@ -227,6 +227,9 @@ protected: virtual void spectrum_128_update_memory() override; virtual rectangle get_screen_area() override; + virtual bool is_contended(offs_t offset) override; + virtual bool is_vram_write(offs_t offset) override; + private: uint8_t spectrum_128_pre_opcode_fetch_r(offs_t offset); void spectrum_128_bank1_w(offs_t offset, uint8_t data); diff --git a/src/mame/includes/tsconf.h b/src/mame/includes/tsconf.h index 051ddae38ec..5eaab848c05 100644 --- a/src/mame/includes/tsconf.h +++ b/src/mame/includes/tsconf.h @@ -51,7 +51,7 @@ protected: private: enum timer_id : u8 { - TIMER_IRQ_FRAME = TIMER_SCANLINE + 1, + TIMER_IRQ_FRAME = TIMER_IRQ_OFF + 1, TIMER_IRQ_SCANLINE }; diff --git a/src/mame/machine/amstrad.cpp b/src/mame/machine/amstrad.cpp index 696e824892a..07c3eb31352 100644 --- a/src/mame/machine/amstrad.cpp +++ b/src/mame/machine/amstrad.cpp @@ -2787,122 +2787,121 @@ IRQ_CALLBACK_MEMBER(amstrad_state::amstrad_cpu_acknowledge_int) /* the following timings have been measured! */ static const uint8_t amstrad_cycle_table_op[256] = { - 4, 12, 8, 8, 4, 4, 8, 4, 4, 12, 8, 8, 4, 4, 8, 4, + 4, 12, 8, 8, 4, 4, 8, 4, 4, 12, 8, 8, 4, 4, 8, 4, 12, 12, 8, 8, 4, 4, 8, 4, 12, 12, 8, 8, 4, 4, 8, 4, - 8, 12, 20, 8, 4, 4, 8, 4, 8, 12, 20, 8, 4, 4, 8, 4, - 8, 12, 16, 8, 12, 12, 12, 4, 8, 12, 16, 8, 4, 4, 8, 4, - 4, 4, 4, 4, 4, 4, 8, 4, 4, 4, 4, 4, 4, 4, 8, 4, - 4, 4, 4, 4, 4, 4, 8, 4, 4, 4, 4, 4, 4, 4, 8, 4, - 4, 4, 4, 4, 4, 4, 8, 4, 4, 4, 4, 4, 4, 4, 8, 4, - 8, 8, 8, 8, 8, 8, 4, 8, 4, 4, 4, 4, 4, 4, 8, 4, - 4, 4, 4, 4, 4, 4, 8, 4, 4, 4, 4, 4, 4, 4, 8, 4, - 4, 4, 4, 4, 4, 4, 8, 4, 4, 4, 4, 4, 4, 4, 8, 4, - 4, 4, 4, 4, 4, 4, 8, 4, 4, 4, 4, 4, 4, 4, 8, 4, - 4, 4, 4, 4, 4, 4, 8, 4, 4, 4, 4, 4, 4, 4, 8, 4, - 8, 12, 12, 12, 12, 16, 8, 16, 8, 12, 12, 4, 12, 20, 8, 16, - 8, 12, 12, 12, 12, 16, 8, 16, 8, 4, 12, 12, 12, 4, 8, 16, - 8, 12, 12, 24, 12, 16, 8, 16, 8, 4, 12, 4, 12, 4, 8, 16, - 8, 12, 12, 4, 12, 16, 8, 16, 8, 8, 12, 4, 12, 4, 8, 16 + 8, 12, 20, 8, 4, 4, 8, 4, 8, 12, 20, 8, 4, 4, 8, 4, + 8, 12, 16, 8, 12, 12, 12, 4, 8, 12, 16, 8, 4, 4, 8, 4, + 4, 4, 4, 4, 4, 4, 8, 4, 4, 4, 4, 4, 4, 4, 8, 4, + 4, 4, 4, 4, 4, 4, 8, 4, 4, 4, 4, 4, 4, 4, 8, 4, + 4, 4, 4, 4, 4, 4, 8, 4, 4, 4, 4, 4, 4, 4, 8, 4, + 8, 8, 8, 8, 8, 8, 4, 8, 4, 4, 4, 4, 4, 4, 8, 4, + 4, 4, 4, 4, 4, 4, 8, 4, 4, 4, 4, 4, 4, 4, 8, 4, + 4, 4, 4, 4, 4, 4, 8, 4, 4, 4, 4, 4, 4, 4, 8, 4, + 4, 4, 4, 4, 4, 4, 8, 4, 4, 4, 4, 4, 4, 4, 8, 4, + 4, 4, 4, 4, 4, 4, 8, 4, 4, 4, 4, 4, 4, 4, 8, 4, + 8, 12, 12, 12, 12, 16, 8, 16, 8, 12, 12, 4, 12, 20, 8, 16, + 8, 12, 12, 12, 12, 16, 8, 16, 8, 4, 12, 12, 12, 4, 8, 16, + 8, 12, 12, 24, 12, 16, 8, 16, 8, 4, 12, 4, 12, 4, 8, 16, + 8, 12, 12, 4, 12, 16, 8, 16, 8, 8, 12, 4, 12, 4, 8, 16 }; static const uint8_t amstrad_cycle_table_cb[256]= { - 4, 4, 4, 4, 4, 4, 12, 4, 4, 4, 4, 4, 4, 4, 12, 4, - 4, 4, 4, 4, 4, 4, 12, 4, 4, 4, 4, 4, 4, 4, 12, 4, - 4, 4, 4, 4, 4, 4, 12, 4, 4, 4, 4, 4, 4, 4, 12, 4, - 4, 4, 4, 4, 4, 4, 12, 4, 4, 4, 4, 4, 4, 4, 12, 4, - 4, 4, 4, 4, 4, 4, 8, 4, 4, 4, 4, 4, 4, 4, 8, 4, - 4, 4, 4, 4, 4, 4, 8, 4, 4, 4, 4, 4, 4, 4, 8, 4, - 4, 4, 4, 4, 4, 4, 8, 4, 4, 4, 4, 4, 4, 4, 8, 4, - 4, 4, 4, 4, 4, 4, 8, 4, 4, 4, 4, 4, 4, 4, 8, 4, - 4, 4, 4, 4, 4, 4, 12, 4, 4, 4, 4, 4, 4, 4, 12, 4, - 4, 4, 4, 4, 4, 4, 12, 4, 4, 4, 4, 4, 4, 4, 12, 4, - 4, 4, 4, 4, 4, 4, 12, 4, 4, 4, 4, 4, 4, 4, 12, 4, - 4, 4, 4, 4, 4, 4, 12, 4, 4, 4, 4, 4, 4, 4, 12, 4, - 4, 4, 4, 4, 4, 4, 12, 4, 4, 4, 4, 4, 4, 4, 12, 4, - 4, 4, 4, 4, 4, 4, 12, 4, 4, 4, 4, 4, 4, 4, 12, 4, - 4, 4, 4, 4, 4, 4, 12, 4, 4, 4, 4, 4, 4, 4, 12, 4, - 4, 4, 4, 4, 4, 4, 12, 4, 4, 4, 4, 4, 4, 4, 12, 4 + 4, 4, 4, 4, 4, 4, 12, 4, 4, 4, 4, 4, 4, 4, 12, 4, + 4, 4, 4, 4, 4, 4, 12, 4, 4, 4, 4, 4, 4, 4, 12, 4, + 4, 4, 4, 4, 4, 4, 12, 4, 4, 4, 4, 4, 4, 4, 12, 4, + 4, 4, 4, 4, 4, 4, 12, 4, 4, 4, 4, 4, 4, 4, 12, 4, + 4, 4, 4, 4, 4, 4, 8, 4, 4, 4, 4, 4, 4, 4, 8, 4, + 4, 4, 4, 4, 4, 4, 8, 4, 4, 4, 4, 4, 4, 4, 8, 4, + 4, 4, 4, 4, 4, 4, 8, 4, 4, 4, 4, 4, 4, 4, 8, 4, + 4, 4, 4, 4, 4, 4, 8, 4, 4, 4, 4, 4, 4, 4, 8, 4, + 4, 4, 4, 4, 4, 4, 12, 4, 4, 4, 4, 4, 4, 4, 12, 4, + 4, 4, 4, 4, 4, 4, 12, 4, 4, 4, 4, 4, 4, 4, 12, 4, + 4, 4, 4, 4, 4, 4, 12, 4, 4, 4, 4, 4, 4, 4, 12, 4, + 4, 4, 4, 4, 4, 4, 12, 4, 4, 4, 4, 4, 4, 4, 12, 4, + 4, 4, 4, 4, 4, 4, 12, 4, 4, 4, 4, 4, 4, 4, 12, 4, + 4, 4, 4, 4, 4, 4, 12, 4, 4, 4, 4, 4, 4, 4, 12, 4, + 4, 4, 4, 4, 4, 4, 12, 4, 4, 4, 4, 4, 4, 4, 12, 4, + 4, 4, 4, 4, 4, 4, 12, 4, 4, 4, 4, 4, 4, 4, 12, 4 }; static const uint8_t amstrad_cycle_table_ed[256]= { - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 12, 12, 12, 20, 4, 12, 4, 8, 12, 12, 12, 20, 4, 12, 4, 8, 12, 12, 12, 20, 4, 12, 4, 8, 12, 12, 12, 20, 4, 12, 4, 8, 12, 12, 12, 20, 4, 12, 4, 16, 12, 12, 12, 20, 4, 12, 4, 16, 12, 12, 12, 20, 4, 12, 4, 4, 12, 12, 12, 20, 4, 12, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 16, 12, 16, 16, 4, 4, 4, 4, 16, 12, 16, 16, 4, 4, 4, 4, 16, 12, 16, 16, 4, 4, 4, 4, 16, 12, 16, 16, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }; static const uint8_t amstrad_cycle_table_xy[256]= { - 4, 12, 8, 8, 4, 4, 8, 4, 4, 12, 8, 8, 4, 4, 8, 4, + 4, 12, 8, 8, 4, 4, 8, 4, 4, 12, 8, 8, 4, 4, 8, 4, 12, 12, 8, 8, 4, 4, 8, 4, 12, 12, 8, 8, 4, 4, 8, 4, - 8, 12, 20, 8, 4, 4, 8, 4, 8, 12, 20, 8, 4, 4, 8, 4, - 8, 12, 16, 8, 20, 20, 20, 4, 8, 12, 16, 8, 4, 4, 8, 4, - 4, 4, 4, 4, 4, 4, 16, 4, 4, 4, 4, 4, 4, 4, 16, 4, - 4, 4, 4, 4, 4, 4, 16, 4, 4, 4, 4, 4, 4, 4, 16, 4, - 4, 4, 4, 4, 4, 4, 16, 4, 4, 4, 4, 4, 4, 4, 16, 4, + 8, 12, 20, 8, 4, 4, 8, 4, 8, 12, 20, 8, 4, 4, 8, 4, + 8, 12, 16, 8, 20, 20, 20, 4, 8, 12, 16, 8, 4, 4, 8, 4, + 4, 4, 4, 4, 4, 4, 16, 4, 4, 4, 4, 4, 4, 4, 16, 4, + 4, 4, 4, 4, 4, 4, 16, 4, 4, 4, 4, 4, 4, 4, 16, 4, + 4, 4, 4, 4, 4, 4, 16, 4, 4, 4, 4, 4, 4, 4, 16, 4, 16, 16, 16, 16, 16, 16, 4, 16, 4, 4, 4, 4, 4, 4, 16, 4, - 4, 4, 4, 4, 4, 4, 16, 4, 4, 4, 4, 4, 4, 4, 16, 4, - 4, 4, 4, 4, 4, 4, 16, 4, 4, 4, 4, 4, 4, 4, 16, 4, - 4, 4, 4, 4, 4, 4, 16, 4, 4, 4, 4, 4, 4, 4, 16, 4, - 4, 4, 4, 4, 4, 4, 16, 4, 4, 4, 4, 4, 4, 4, 16, 4, - 8, 12, 12, 12, 12, 16, 8, 16, 8, 12, 12, 4, 12, 20, 8, 16, - 8, 12, 12, 12, 12, 16, 8, 16, 8, 4, 12, 12, 12, 4, 8, 16, - 8, 12, 12, 24, 12, 16, 8, 16, 8, 4, 12, 4, 12, 4, 8, 16, - 8, 12, 12, 4, 12, 16, 8, 16, 8, 8, 12, 4, 12, 4, 8, 16 + 4, 4, 4, 4, 4, 4, 16, 4, 4, 4, 4, 4, 4, 4, 16, 4, + 4, 4, 4, 4, 4, 4, 16, 4, 4, 4, 4, 4, 4, 4, 16, 4, + 4, 4, 4, 4, 4, 4, 16, 4, 4, 4, 4, 4, 4, 4, 16, 4, + 4, 4, 4, 4, 4, 4, 16, 4, 4, 4, 4, 4, 4, 4, 16, 4, + 8, 12, 12, 12, 12, 16, 8, 16, 8, 12, 12, 8, 12, 20, 8, 16, + 8, 12, 12, 12, 12, 16, 8, 16, 8, 4, 12, 12, 12, 4, 8, 16, + 8, 12, 12, 24, 12, 16, 8, 16, 8, 4, 12, 4, 12, 4, 8, 16, + 8, 12, 12, 4, 12, 16, 8, 16, 8, 8, 12, 4, 12, 4, 8, 16 }; -static const uint8_t amstrad_cycle_table_xycb[256]= -{ - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 +static const uint8_t amstrad_cycle_table_xycb[0x100] = { + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16 }; static const uint8_t amstrad_cycle_table_ex[256]= { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 4, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, - 4, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 4, 8, 4, 4, 0, 0, 0, 0, 4, 8, 4, 4, 0, 0, 0, 0, - 8, 0, 0, 0, 8, 0, 0, 0, 8, 0, 0, 0, 8, 0, 0, 0, - 8, 0, 0, 0, 8, 0, 0, 0, 8, 0, 0, 0, 8, 0, 0, 0, - 8, 0, 0, 0, 8, 0, 0, 0, 8, 0, 0, 0, 8, 0, 0, 0, - 8, 0, 0, 0, 8, 0, 0, 0, 8, 0, 0, 0, 8, 0, 0, 0 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 4, 8, 4, 4, 0, 0, 0, 0, 4, 8, 4, 4, 0, 0, 0, 0, + 8, 0, 0, 0, 8, 0, 0, 0, 8, 0, 0, 0, 8, 0, 0, 0, + 8, 0, 0, 0, 8, 0, 0, 0, 8, 0, 0, 0, 8, 0, 0, 0, + 8, 0, 0, 0, 8, 0, 0, 0, 8, 0, 0, 0, 8, 0, 0, 0, + 8, 0, 0, 0, 8, 0, 0, 0, 8, 0, 0, 0, 8, 0, 0, 0 }; #define NEXT_ROM_SLOT m_rom_count++; \ diff --git a/src/mame/machine/msx.cpp b/src/mame/machine/msx.cpp index 7a174aa98cc..8d9df9f7aa8 100644 --- a/src/mame/machine/msx.cpp +++ b/src/mame/machine/msx.cpp @@ -43,7 +43,9 @@ void msx2_state::machine_start() save_item(NAME(m_rtc_latch)); } - +/* A hack to add 1 wait cycle in each opcode fetch. + Possibly worth not to use custom table at all but adjust desired icount + directly in m_opcodes.read_byte handler. */ static const uint8_t cc_op[0x100] = { 4+1,10+1, 7+1, 6+1, 4+1, 4+1, 7+1, 4+1, 4+1,11+1, 7+1, 6+1, 4+1, 4+1, 7+1, 4+1, 8+1,10+1, 7+1, 6+1, 4+1, 4+1, 7+1, 4+1,12+1,11+1, 7+1, 6+1, 4+1, 4+1, 7+1, 4+1, @@ -57,86 +59,67 @@ static const uint8_t cc_op[0x100] = { 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 7+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 7+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 7+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 7+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 7+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 7+1, 4+1, - 5+1,10+1,10+1,10+1,10+1,11+1, 7+1,11+1, 5+1,10+1,10+1, 0 ,10+1,17+1, 7+1,11+1, - 5+1,10+1,10+1,11+1,10+1,11+1, 7+1,11+1, 5+1, 4+1,10+1,11+1,10+1, 0 , 7+1,11+1, - 5+1,10+1,10+1,19+1,10+1,11+1, 7+1,11+1, 5+1, 4+1,10+1, 4+1,10+1, 0 , 7+1,11+1, - 5+1,10+1,10+1, 4+1,10+1,11+1, 7+1,11+1, 5+1, 6+1,10+1, 4+1,10+1, 0 , 7+1,11+1 + 5+1,10+1,10+1,10+1,10+1,11+1, 7+1,11+1, 5+1,10+1,10+1, 4+1,10+1,17+1, 7+1,11+1, + 5+1,10+1,10+1,11+1,10+1,11+1, 7+1,11+1, 5+1, 4+1,10+1,11+1,10+1, 4+1, 7+1,11+1, + 5+1,10+1,10+1,19+1,10+1,11+1, 7+1,11+1, 5+1, 4+1,10+1, 4+1,10+1, 4+1, 7+1,11+1, + 5+1,10+1,10+1, 4+1,10+1,11+1, 7+1,11+1, 5+1, 6+1,10+1, 4+1,10+1, 4+1, 7+1,11+1 }; static const uint8_t cc_cb[0x100] = { - 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,15+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,15+2, 8+2, - 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,15+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,15+2, 8+2, - 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,15+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,15+2, 8+2, - 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,15+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,15+2, 8+2, - 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,12+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,12+2, 8+2, - 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,12+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,12+2, 8+2, - 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,12+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,12+2, 8+2, - 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,12+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,12+2, 8+2, - 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,15+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,15+2, 8+2, - 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,15+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,15+2, 8+2, - 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,15+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,15+2, 8+2, - 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,15+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,15+2, 8+2, - 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,15+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,15+2, 8+2, - 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,15+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,15+2, 8+2, - 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,15+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,15+2, 8+2, - 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,15+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2,15+2, 8+2 + 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,11+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,11+1, 4+1, + 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,11+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,11+1, 4+1, + 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,11+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,11+1, 4+1, + 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,11+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,11+1, 4+1, + 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 8+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 8+1, 4+1, + 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 8+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 8+1, 4+1, + 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 8+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 8+1, 4+1, + 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 8+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 8+1, 4+1, + 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,11+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,11+1, 4+1, + 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,11+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,11+1, 4+1, + 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,11+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,11+1, 4+1, + 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,11+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,11+1, 4+1, + 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,11+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,11+1, 4+1, + 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,11+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,11+1, 4+1, + 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,11+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,11+1, 4+1, + 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,11+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,11+1, 4+1 }; static const uint8_t cc_ed[0x100] = { - 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, - 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, - 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, - 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, -12+2,12+2,15+2,20+2, 8+2,14+2, 8+2, 9+2,12+2,12+2,15+2,20+2, 8+2,14+2, 8+2, 9+2, -12+2,12+2,15+2,20+2, 8+2,14+2, 8+2, 9+2,12+2,12+2,15+2,20+2, 8+2,14+2, 8+2, 9+2, -12+2,12+2,15+2,20+2, 8+2,14+2, 8+2,18+2,12+2,12+2,15+2,20+2, 8+2,14+2, 8+2,18+2, -12+2,12+2,15+2,20+2, 8+2,14+2, 8+2, 8+2,12+2,12+2,15+2,20+2, 8+2,14+2, 8+2, 8+2, - 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, - 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, -16+2,16+2,16+2,16+2, 8+2, 8+2, 8+2, 8+2,16+2,16+2,16+2,16+2, 8+2, 8+2, 8+2, 8+2, -16+2,16+2,16+2,16+2, 8+2, 8+2, 8+2, 8+2,16+2,16+2,16+2,16+2, 8+2, 8+2, 8+2, 8+2, - 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, - 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, - 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, - 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2, 8+2 + 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, + 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, + 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, + 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, + 8+1, 8+1,15+2,16+1, 4+1,14+2, 4+1, 5+1, 8+1, 8+1,15+2,16+1, 4+1,14+2, 4+1, 5+1, + 8+1, 8+1,15+2,16+1, 4+1,14+2, 4+1, 5+1, 8+1, 8+1,15+2,16+1, 4+1,14+2, 4+1, 5+1, + 8+1, 8+1,15+2,16+1, 4+1,14+2, 4+1,14+1, 8+1, 8+1,15+2,16+1, 4+1,14+2, 4+1,14+1, + 8+1, 8+1,15+2,16+1, 4+1,14+2, 4+1, 4+1, 8+1, 8+1,15+2,16+1, 4+1,14+2, 4+1, 4+1, + 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, + 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, + 12+1,12+1,12+1,12+1, 4+1, 4+1, 4+1, 4+1,12+1,12+1,12+1,12+1, 4+1, 4+1, 4+1, 4+1, + 12+1,12+1,12+1,12+1, 4+1, 4+1, 4+1, 4+1,12+1,12+1,12+1,12+1, 4+1, 4+1, 4+1, 4+1, + 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, + 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, + 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, + 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1 }; static const uint8_t cc_xy[0x100] = { - 4+4+2,10+4+2, 7+4+2, 6+4+2, 4+4+2, 4+4+2, 7+4+2, 4+4+2, 4+4+2,11+4+2, 7+4+2, 6+4+2, 4+4+2, 4+4+2, 7+4+2, 4+4+2, - 8+4+2,10+4+2, 7+4+2, 6+4+2, 4+4+2, 4+4+2, 7+4+2, 4+4+2,12+4+2,11+4+2, 7+4+2, 6+4+2, 4+4+2, 4+4+2, 7+4+2, 4+4+2, - 7+4+2,10+4+2,16+4+2, 6+4+2, 4+4+2, 4+4+2, 7+4+2, 4+4+2, 7+4+2,11+4+2,16+4+2, 6+4+2, 4+4+2, 4+4+2, 7+4+2, 4+4+2, - 7+4+2,10+4+2,13+4+2, 6+4+2,23 +2,23 +2,19 +2, 4+4+2, 7+4+2,11+4+2,13+4+2, 6+4+2, 4+4+2, 4+4+2, 7+4+2, 4+4+2, - 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2,19 +2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2,19 +2, 4+4+2, - 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2,19 +2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2,19 +2, 4+4+2, - 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2,19 +2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2,19 +2, 4+4+2, -19 +2,19 +2,19 +2,19 +2,19 +2,19 +2, 4+4+2,19 +2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2,19 +2, 4+4+2, - 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2,19 +2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2,19 +2, 4+4+2, - 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2,19 +2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2,19 +2, 4+4+2, - 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2,19 +2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2,19 +2, 4+4+2, - 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2,19 +2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2, 4+4+2,19 +2, 4+4+2, - 5+4+2,10+4+2,10+4+2,10+4+2,10+4+2,11+4+2, 7+4+2,11+4+2, 5+4+2,10+4+2,10+4+2, 0 ,10+4+2,17+4+2, 7+4+2,11+4+2, - 5+4+2,10+4+2,10+4+2,11+4+2,10+4+2,11+4+2, 7+4+2,11+4+2, 5+4+2, 4+4+2,10+4+2,11+4+2,10+4+2, 4 +1, 7+4+2,11+4+2, - 5+4+2,10+4+2,10+4+2,19+4+2,10+4+2,11+4+2, 7+4+2,11+4+2, 5+4+2, 4+4+2,10+4+2, 4+4+2,10+4+2, 4 +1, 7+4+2,11+4+2, - 5+4+2,10+4+2,10+4+2, 4+4+2,10+4+2,11+4+2, 7+4+2,11+4+2, 5+4+2, 6+4+2,10+4+2, 4+4+2,10+4+2, 4 +1, 7+4+2,11+4+2 -}; - -static const uint8_t cc_xycb[0x100] = { -23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2, -23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2, -23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2, -23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2, -20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2, -20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2, -20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2, -20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2,20+2, -23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2, -23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2, -23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2, -23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2, -23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2, -23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2, -23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2, -23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2,23+2 + 4+1,10+1, 7+1, 6+1, 4+1, 4+1, 7+1, 4+1, 4+1,11+1, 7+1, 6+1, 4+1, 4+1, 7+1, 4+1, + 8+1,10+1, 7+1, 6+1, 4+1, 4+1, 7+1, 4+1,12+1,11+1, 7+1, 6+1, 4+1, 4+1, 7+1, 4+1, + 7+1,10+1,16+1, 6+1, 4+1, 4+1, 7+1, 4+1, 7+1,11+1,16+1, 6+1, 4+1, 4+1, 7+1, 4+1, + 7+1,10+1,13+1, 6+1,19+1,19+1,15+1, 4+1, 7+1,11+1,13+1, 6+1, 4+1, 4+1, 7+1, 4+1, + 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,15+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,15+1, 4+1, + 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,15+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,15+1, 4+1, + 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,15+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,15+1, 4+1, + 15+1,15+1,15+1,15+1,15+1,15+1, 4+1,15+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,15+1, 4+1, + 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,15+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,15+1, 4+1, + 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,15+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,15+1, 4+1, + 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,15+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,15+1, 4+1, + 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,15+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1, 4+1,15+1, 4+1, + 5+1,10+1,10+1,10+1,10+1,11+1, 7+1,11+1, 5+1,10+1,10+1, 7+1,10+1,17+1, 7+1,11+1, + 5+1,10+1,10+1,11+1,10+1,11+1, 7+1,11+1, 5+1, 4+1,10+1,11+1,10+1, 4+1, 7+1,11+1, + 5+1,10+1,10+1,19+1,10+1,11+1, 7+1,11+1, 5+1, 4+1,10+1, 4+1,10+1, 4+1, 7+1,11+1, + 5+1,10+1,10+1, 4+1,10+1,11+1, 7+1,11+1, 5+1, 6+1,10+1, 4+1,10+1, 4+1, 7+1,11+1 }; /* extra cycles if jr/jp/call taken and 'interrupt latency' on rst 0-7 */ @@ -159,14 +142,13 @@ static const uint8_t cc_ex[0x100] = { 6, 0, 0, 0, 7, 0, 0, 2, 6, 0, 0, 0, 7, 0, 0, 2+1 }; - void msx_state::driver_start() { m_maincpu->set_input_line_vector(0, 0xff); // Z80 msx_memory_init(); - m_maincpu->z80_set_cycle_tables( cc_op, cc_cb, cc_ed, cc_xy, cc_xycb, cc_ex ); + m_maincpu->z80_set_cycle_tables(cc_op, cc_cb, cc_ed, cc_xy, nullptr, cc_ex); save_item(NAME(m_psg_b)); save_item(NAME(m_mouse)); diff --git a/src/mame/mame.lst b/src/mame/mame.lst index d5d1bf77d88..dd3db0bf125 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -20758,21 +20758,27 @@ lunaprk // (c) 1998 ABM Games altaten // 1999 unknown @source:magicard.cpp +belslots // (c) 1999 Impera +bigdeal0 // (c) 2001 Impera +dallaspk // 1993, unknown hotslots // (c) 2002 Impera +kajotcrd // (c) 1993 Amatic +lucky7i // (c) 199? Impera magicard // (c) 199? Impera magicarda // (c) 199? Impera magicardb // (c) 199? Impera magicarde // (c) 1994 Impera +magicardea // (c) 1994 Impera +magicardeb // (c) 1994 Impera +magicardec // (c) 1998 Impera magicardf // (c) 199? Impera magicardj // (c) 1998 Impera magicardw // (c) 1993 Impera magicle // (c) 2001 Impera -quingo // (c) 1999 Impera -belslots // (c) 1999 Impera -bigdeal0 // (c) 2001 Impera puzzleme // (c) 199? Impera +quingo // (c) 1999 Impera +unkpkr_w // 1993, unknown unkte06 // (c) 199? Impera -lucky7i // (c) 199? Impera @source:magiceyes_pollux_vr3520f.cpp didj // (c) 2008 Leapfrog @@ -33578,6 +33584,7 @@ tdragon2a // UPL-93091 (c) 1993 NMK tdragon3h tdragonb // bootleg tdragonb2 // bootleg +tdragonb3 // bootleg tharrier // UPL-89053 (c) 1989 UPL tharrierb // Lettering bootleg tharrieru // UPL-89053 (c) 1989 UPL + American Sammy license @@ -36845,7 +36852,7 @@ cafetime // "63" (c) 1992 Dynax chalgirl // bootleg daisyari // (c) 1989 Best System dondenmj // "03" (c) 1986 Dyna Electronics -ichiban // (c) 199? Excel +ichiban // (c) 1993 Excel ippatsu // 01? (c) 1986 Dyna Electronics jangtaku // (c) 1986 Dyna Computer janoh // (c) 1984 Toaplan @@ -36876,6 +36883,7 @@ mjvegasa // "50" 1991 Dynax mjyarou // (c) 1986 Visco / Video System mjyarou2 // (c) 1986 Visco / Video System openmj // (c) 1982 Nichibutsu +pongboo2 // (c) 1997 OCT royalmah // Falcon bootleg royalmj // (c) 1982 Nichibutsu rkjanoh2 // SNK / Dyna Corp diff --git a/src/mame/video/appoooh.cpp b/src/mame/video/appoooh.cpp deleted file mode 100644 index 59c1bfa62c6..00000000000 --- a/src/mame/video/appoooh.cpp +++ /dev/null @@ -1,311 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Tatsuyuki Satoh -/*************************************************************************** - - video.c - - Functions to emulate the video hardware of the machine. - -***************************************************************************/ - -#include "emu.h" -#include "includes/appoooh.h" - -/*************************************************************************** - - Convert the color PROMs into a more useable format. - - Palette information of appoooh is not known. - - The palette decoder of Bank Panic was used for this driver. - Because these hardware is similar. - -***************************************************************************/ - -void appoooh_state::appoooh_palette(palette_device &palette) const -{ - const uint8_t *color_prom = memregion("proms")->base(); - - for (int i = 0; i < palette.entries(); i++) - { - int bit0, bit1, bit2; - - uint8_t const pen = (color_prom[0x20 + i] & 0x0f) | ((i < 0x100) ? 0x00 : 0x10); - - // red component - bit0 = BIT(color_prom[pen], 0); - bit1 = BIT(color_prom[pen], 1); - bit2 = BIT(color_prom[pen], 2); - int const r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - // green component - bit0 = BIT(color_prom[pen], 3); - bit1 = BIT(color_prom[pen], 4); - bit2 = BIT(color_prom[pen], 5); - int const g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - // blue component - bit0 = 0; - bit1 = BIT(color_prom[pen], 6); - bit2 = BIT(color_prom[pen], 7); - int const b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - palette.set_pen_color(i, rgb_t(r, g, b)); - } -} - -void appoooh_state::robowres_palette(palette_device &palette) const -{ - const uint8_t *color_prom = memregion("proms")->base(); - - for (int i = 0; i < palette.entries(); i++) - { - int bit0, bit1, bit2; - - uint8_t const pen = color_prom[0x20 + i] & 0x0f; - - // red component - bit0 = BIT(color_prom[pen], 0); - bit1 = BIT(color_prom[pen], 1); - bit2 = BIT(color_prom[pen], 2); - int const r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - // green component - bit0 = BIT(color_prom[pen], 3); - bit1 = BIT(color_prom[pen], 4); - bit2 = BIT(color_prom[pen], 5); - int const g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - // blue component - bit0 = 0; - bit1 = BIT(color_prom[pen], 6); - bit2 = BIT(color_prom[pen], 7); - int const b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; - - palette.set_pen_color(i, rgb_t(r, g, b)); - } -} - - - -/*************************************************************************** - - Callbacks for the TileMap code - -***************************************************************************/ - -TILE_GET_INFO_MEMBER(appoooh_state::get_fg_tile_info) -{ - int code = m_fg_videoram[tile_index] + 256 * ((m_fg_colorram[tile_index] >> 5) & 7); - - tileinfo.set(0, - code, - m_fg_colorram[tile_index] & 0x0f, - (m_fg_colorram[tile_index] & 0x10 ) ? TILEMAP_FLIPX : 0 - ); -} - -TILE_GET_INFO_MEMBER(appoooh_state::get_bg_tile_info) -{ - int code = m_bg_videoram[tile_index] + 256 * ((m_bg_colorram[tile_index] >> 5) & 7); - - tileinfo.set(1, - code, - m_bg_colorram[tile_index] & 0x0f, - (m_bg_colorram[tile_index] & 0x10 ) ? TILEMAP_FLIPX : 0 - ); -} - -/*************************************************************************** - - Start the video hardware emulation. - -***************************************************************************/ - -void appoooh_state::video_start() -{ - m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(appoooh_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(appoooh_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); - - m_fg_tilemap->set_transparent_pen(0); - m_fg_tilemap->set_scrolldy(8, 8); - m_bg_tilemap->set_scrolldy(8, 8); - - save_item(NAME(m_scroll_x)); - save_item(NAME(m_priority)); -} - -void appoooh_state::scroll_w(uint8_t data) -{ - m_scroll_x = data; -} - - -void appoooh_state::fg_videoram_w(offs_t offset, uint8_t data) -{ - m_fg_videoram[offset] = data; - m_fg_tilemap->mark_tile_dirty(offset); -} - -void appoooh_state::fg_colorram_w(offs_t offset, uint8_t data) -{ - m_fg_colorram[offset] = data; - m_fg_tilemap->mark_tile_dirty(offset); -} - -void appoooh_state::bg_videoram_w(offs_t offset, uint8_t data) -{ - m_bg_videoram[offset] = data; - m_bg_tilemap->mark_tile_dirty(offset); -} - -void appoooh_state::bg_colorram_w(offs_t offset, uint8_t data) -{ - m_bg_colorram[offset] = data; - m_bg_tilemap->mark_tile_dirty(offset); -} - -void appoooh_state::out_w(uint8_t data) -{ - /* bit 0 controls NMI */ - m_nmi_mask = data & 1; - - /* bit 1 flip screen */ - flip_screen_set(data & 0x02); - - /* bits 2-3 unknown */ - - /* bits 4-5 are playfield/sprite priority */ - /* TODO: understand how this works, currently the only thing I do is draw */ - /* the front layer behind sprites when priority == 0, and invert the sprite */ - /* order when priority == 1 */ - m_priority = (data & 0x30) >> 4; - - /* bit 6 ROM bank select */ - { - membank("bank1")->set_entry((data&0x40) ? 1 : 0); - } - - /* bit 7 unknown (used) */ -} - -void appoooh_state::appoooh_draw_sprites( bitmap_ind16 &dest_bmp, const rectangle &cliprect, gfx_element *gfx, uint8_t *sprite ) -{ - int offs; - int flipy = flip_screen(); - - for (offs = 0x20 - 4; offs >= 0; offs -= 4) - { - int sy = 240 - sprite[offs + 0]; - int code = (sprite[offs + 1] >> 2) + ((sprite[offs + 2] >> 5) & 0x07) * 0x40; - int color = sprite[offs + 2] & 0x0f; /* TODO: bit 4 toggles continuously, what is it? */ - int sx = sprite[offs + 3]; - int flipx = sprite[offs + 1] & 0x01; - - if(sx >= 248) - sx -= 256; - - if (flipy) - { - sx = 239 - sx; - sy = 239 - sy; - flipx = !flipx; - } - - gfx->transpen(dest_bmp,cliprect, - code, - color, - flipx,flipy, - sx, sy, 0); - } -} - -void appoooh_state::robowres_draw_sprites( bitmap_ind16 &dest_bmp, const rectangle &cliprect, gfx_element *gfx, uint8_t *sprite ) -{ - int offs; - int flipy = flip_screen(); - - for (offs = 0x20 - 4; offs >= 0; offs -= 4) - { - int sy = 240 - sprite[offs + 0]; - int code = 0x200 + (sprite[offs + 1] >> 2) + ((sprite[offs + 2] >> 5) & 0x07) * 0x40; - int color = sprite[offs + 2] & 0x0f; /* TODO: bit 4 toggles continuously, what is it? */ - int sx = sprite[offs + 3]; - int flipx = sprite[offs + 1] & 0x01; - - if(sx >= 248) - sx -= 256; - - if (flipy) - { - sx = 239 - sx; - sy = 239 - sy; - flipx = !flipx; - } - - gfx->transpen(dest_bmp,cliprect, - code, - color, - flipx,flipy, - sx, sy, 0); - } -} - - -uint32_t appoooh_state::screen_update_appoooh(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - - if (m_priority == 0) /* fg behind sprites */ - m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - - /* draw sprites */ - if (m_priority == 1) - { - /* sprite set #1 */ - appoooh_draw_sprites(bitmap, cliprect, m_gfxdecode->gfx(2), m_spriteram); - /* sprite set #2 */ - appoooh_draw_sprites(bitmap, cliprect, m_gfxdecode->gfx(3), m_spriteram_2); - } - else - { - /* sprite set #2 */ - appoooh_draw_sprites(bitmap, cliprect, m_gfxdecode->gfx(3), m_spriteram_2); - /* sprite set #1 */ - appoooh_draw_sprites(bitmap, cliprect, m_gfxdecode->gfx(2), m_spriteram); - } - - if (m_priority != 0) /* fg in front of sprites */ - m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - - return 0; -} - -uint32_t appoooh_state::screen_update_robowres(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - - if (m_priority == 0) /* fg behind sprites */ - m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - - /* draw sprites */ - if (m_priority == 1) - { - /* sprite set #1 */ - robowres_draw_sprites(bitmap, cliprect, m_gfxdecode->gfx(2), m_spriteram); - /* sprite set #2 */ - robowres_draw_sprites(bitmap, cliprect, m_gfxdecode->gfx(3), m_spriteram_2); - } - else - { - /* sprite set #2 */ - robowres_draw_sprites(bitmap, cliprect, m_gfxdecode->gfx(3), m_spriteram_2); - /* sprite set #1 */ - robowres_draw_sprites(bitmap, cliprect, m_gfxdecode->gfx(2), m_spriteram); - } - - if (m_priority != 0) /* fg in front of sprites */ - m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - - return 0; -} diff --git a/src/mame/video/bfm_adr2.cpp b/src/mame/video/bfm_adr2.cpp index fbe1333bdff..43784a6baf2 100644 --- a/src/mame/video/bfm_adr2.cpp +++ b/src/mame/video/bfm_adr2.cpp @@ -34,7 +34,7 @@ A000-BFFF |R/W| D D D D D D D D | ?window into character RAM/ROM? -----------+---+-----------------+----------------------------------------- C000-DFFF |?/W| D D D D D D D D | I/O registers C000 | W | ? ? ? ? ? ? D D | program ROM page select - controls what portion of the eprom is + controls what portion of the EPROM is mapped at 0000 - 7FFFF ______________________________________ @@ -93,124 +93,80 @@ E000-FFFF | R | D D D D D D D D | 8K ROM ***************************************************************************/ #include "emu.h" + #include "video/bfm_adr2.h" #include "cpu/m6809/m6809.h" #include "machine/bfm_bd1.h" // vfd + #include "emupal.h" #include "screen.h" -#ifdef MAME_DEBUG -#define VERBOSE 1 -#else -#define VERBOSE 0 -#endif - -#define LOG_CTRL(x) do { if (VERBOSE) logerror x; } while (0) - -// local vars ///////////////////////////////////////////////////////////// +// configurable logging +#define LOG_CTRL (1U << 1) +#define LOG_C001 (1U << 2) +#define LOG_SERIAL (1U << 3) -#define SL_DISPLAY 0x02 // displayed Adder screen, 1=screen1 0=screen0 -#define SL_ACCESS 0x01 // accessable Adder screen, 1=screen1 0=screen0 +//#define VERBOSE (LOG_GENERAL | LOG_CTRL | LOG_C001 | LOG_SERIAL) -#define ADDER_CLOCK (XTAL(8'000'000)) +#include "logmacro.h" +#define LOGCTRL(...) LOGMASKED(LOG_CTRL, __VA_ARGS__) +#define LOGC001(...) LOGMASKED(LOG_C001, __VA_ARGS__) +#define LOGSERIAL(...) LOGMASKED(LOG_SERIAL, __VA_ARGS__) -static const gfx_layout charlayout = -{ - 8,8, // 8 * 8 characters - 8192, // 8192 characters - 4, // 4 bits per pixel - { 0,1,2,3 }, - { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 }, - { 0*8*4, 1*8*4, 2*8*4, 3*8*4, 4*8*4, 5*8*4, 6*8*4, 7*8*4 }, - 8*8*4 -}; - // this is a strange beast !!!! // // characters are grouped by 64 (512 pixels) // there are max 128 of these groups -static GFXDECODE_START( gfx_adder2 ) - GFXDECODE_ENTRY( ":gfx1", 0, charlayout, 0, 16 ) +GFXDECODE_MEMBER( bfm_adder2_device::gfxinfo ) + GFXDECODE_DEVICE( "tiles", 0, gfx_8x8x4_packed_msb, 0, 16 ) GFXDECODE_END DEFINE_DEVICE_TYPE(BFM_ADDER2, bfm_adder2_device, "bfm_adder2", "BFM ADDER2") bfm_adder2_device::bfm_adder2_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock ) : device_t(mconfig, BFM_ADDER2, tag, owner, clock) - , device_gfx_interface(mconfig, *this, gfx_adder2, "palette") - , m_cpu(*this, "adder2") + , device_gfx_interface(mconfig, *this, gfxinfo, "palette") + , m_cpu(*this, "cpu") + , m_screen_ram(*this, "screen_ram%u", 0U) + , m_screen_ram_view(*this, "screen_ram_view") + , m_rombank(*this, "rombank") { } -/////////////////////////////////////////////////////////////////////////// - -TILE_GET_INFO_MEMBER( bfm_adder2_device::get_tile0_info ) -{ - short data; - int code, color, flags,x,y; - - y = tile_index / 50; - x = tile_index - (y*50); - - tile_index = y * 128 + (x * 2); - - data = m_screen_ram[0][tile_index ]<<8; - data |= m_screen_ram[0][tile_index + 1]; - - code = data & 0x1FFF; - color = 0; - flags = ((data & 0x4000)?TILE_FLIPY:0) | - ((data & 0x2000)?TILE_FLIPX:0); - - tileinfo.set(0, code, color, flags); -} - -/////////////////////////////////////////////////////////////////////////// -TILE_GET_INFO_MEMBER( bfm_adder2_device::get_tile1_info ) +template <uint8_t Which> +TILE_GET_INFO_MEMBER(bfm_adder2_device::get_tile_info) { - short data; - int code, color, flags,x,y; - - y = tile_index / 50; - x = tile_index - (y*50); + int y = tile_index / 50; + int x = tile_index - (y * 50); tile_index = y * 128 + (x * 2); - data = m_screen_ram[1][tile_index ]<<8; - data |= m_screen_ram[1][tile_index + 1]; + short data = m_screen_ram[Which][tile_index] << 8; + data |= m_screen_ram[Which][tile_index + 1]; - code = data & 0x1FFF; - color = 0; - flags = ((data & 0x4000)?TILE_FLIPY:0) | - ((data & 0x2000)?TILE_FLIPX:0); + int code = data & 0x1fff; + int color = 0; + int flags = ((data & 0x4000) ? TILE_FLIPY : 0) | ((data & 0x2000) ? TILE_FLIPX : 0); tileinfo.set(0, code, color, flags); } -// video initialisation /////////////////////////////////////////////////// void bfm_adder2_device::device_reset() { - m_screen_page_reg = 0; - m_c101 = 0; - m_rx = 0; - m_vbl_triggered = false; - m_acia_triggered = false; - m_data_from_sc2 = 0; - m_data_to_sc2 = 0; - - { - uint8_t *rom = machine().root_device().memregion("adder2")->base(); - - membank("bank2")->configure_entries(0, 4, &rom[0x00000], 0x08000); - - membank("bank2")->set_entry(0&0x03); - } + m_screen_page_reg = 0; + m_c101 = 0; + m_vbl_triggered = false; + m_acia_triggered = false; + m_data_from_sc2 = 0; + m_data_to_sc2 = 0; + + m_rombank->configure_entries(0, 4, memregion("cpu")->base(), 0x08000); } void bfm_adder2_device::device_start() @@ -218,58 +174,52 @@ void bfm_adder2_device::device_start() if (!palette().device().started()) throw device_missing_dependencies(); - adder2_decode_char_roms(); + m_screen_ram_view.select(0); + + decode_char_roms(); save_item(NAME(m_screen_page_reg)); save_item(NAME(m_c101)); - save_item(NAME(m_rx)); save_item(NAME(m_vbl_triggered)); save_item(NAME(m_acia_triggered)); save_item(NAME(m_data_from_sc2)); save_item(NAME(m_data_to_sc2)); - save_item(NAME(m_adder_ram)); - save_item(NAME(m_screen_ram)); - - m_tilemap0 = &machine().tilemap().create(*this, tilemap_get_info_delegate(*this, FUNC(bfm_adder2_device::get_tile0_info)), TILEMAP_SCAN_ROWS, 8, 8, 50, 35); - - m_tilemap1 = &machine().tilemap().create(*this, tilemap_get_info_delegate(*this, FUNC(bfm_adder2_device::get_tile1_info)), TILEMAP_SCAN_ROWS, 8, 8, 50, 35); - - palette().set_pen_color(0,rgb_t(0x00,0x00,0x00)); - palette().set_pen_color(1,rgb_t(0x00,0x00,0xFF)); - palette().set_pen_color(2,rgb_t(0x00,0xFF,0x00)); - palette().set_pen_color(3,rgb_t(0x00,0xFF,0xFF)); - palette().set_pen_color(4,rgb_t(0xFF,0x00,0x00)); - palette().set_pen_color(5,rgb_t(0xFF,0x00,0xFF)); - palette().set_pen_color(6,rgb_t(0xFF,0xFF,0x00)); - palette().set_pen_color(7,rgb_t(0xFF,0xFF,0xFF)); - palette().set_pen_color(8,rgb_t(0x80,0x80,0x80)); - palette().set_pen_color(9,rgb_t(0x00,0x00,0x80)); - palette().set_pen_color(10,rgb_t(0x00,0x80,0x00)); - palette().set_pen_color(11,rgb_t(0x00,0x80,0x80)); - palette().set_pen_color(12,rgb_t(0x80,0x00,0x00)); - palette().set_pen_color(13,rgb_t(0x80,0x00,0x80)); - palette().set_pen_color(14,rgb_t(0x80,0x80,0x00)); - palette().set_pen_color(15,rgb_t(0x80,0x80,0x80)); + m_tilemap[0] = &machine().tilemap().create(*this, tilemap_get_info_delegate(*this, FUNC(bfm_adder2_device::get_tile_info<0>)), TILEMAP_SCAN_ROWS, 8, 8, 50, 35); + + m_tilemap[1] = &machine().tilemap().create(*this, tilemap_get_info_delegate(*this, FUNC(bfm_adder2_device::get_tile_info<1>)), TILEMAP_SCAN_ROWS, 8, 8, 50, 35); + + palette().set_pen_color(0, rgb_t(0x00, 0x00, 0x00)); + palette().set_pen_color(1, rgb_t(0x00, 0x00, 0xff)); + palette().set_pen_color(2, rgb_t(0x00, 0xff, 0x00)); + palette().set_pen_color(3, rgb_t(0x00, 0xff, 0xff)); + palette().set_pen_color(4, rgb_t(0xff, 0x00, 0x00)); + palette().set_pen_color(5, rgb_t(0xff, 0x00, 0xff)); + palette().set_pen_color(6, rgb_t(0xff, 0xff, 0x00)); + palette().set_pen_color(7, rgb_t(0xff, 0xff, 0xff)); + palette().set_pen_color(8, rgb_t(0x80, 0x80, 0x80)); + palette().set_pen_color(9, rgb_t(0x00, 0x00, 0x80)); + palette().set_pen_color(10 ,rgb_t(0x00, 0x80, 0x00)); + palette().set_pen_color(11, rgb_t(0x00, 0x80, 0x80)); + palette().set_pen_color(12, rgb_t(0x80, 0x00, 0x00)); + palette().set_pen_color(13, rgb_t(0x80, 0x00, 0x80)); + palette().set_pen_color(14, rgb_t(0x80, 0x80, 0x00)); + palette().set_pen_color(15, rgb_t(0x80, 0x80, 0x80)); } -// video update /////////////////////////////////////////////////////////// -uint32_t bfm_adder2_device::update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) + +uint32_t bfm_adder2_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - const rectangle visible1(0, 400-1, 0, 280-1); //minx,maxx, miny,maxy + const rectangle visible1(0, 400 - 1, 0, 280 - 1); //minx, maxx, miny, maxy - if (m_screen_page_reg & SL_DISPLAY) - m_tilemap1->draw(screen, bitmap, visible1, 0, 0); - else - m_tilemap0->draw(screen, bitmap, visible1, 0, 0); + m_tilemap[BIT(m_screen_page_reg, 1)]->draw(screen, bitmap, visible1, 0, 0); return 0; } -/////////////////////////////////////////////////////////////////////////// -WRITE_LINE_MEMBER(bfm_adder2_device::adder2_vbl_w) +WRITE_LINE_MEMBER(bfm_adder2_device::vbl_w) { if (state && BIT(m_c101, 0)) { @@ -278,147 +228,105 @@ WRITE_LINE_MEMBER(bfm_adder2_device::adder2_vbl_w) } } -/////////////////////////////////////////////////////////////////////////// - -uint8_t bfm_adder2_device::screen_ram_r(offs_t offset) -{ - return m_screen_page_reg & SL_ACCESS ? m_screen_ram[1][offset]:m_screen_ram[0][offset]; -} - -/////////////////////////////////////////////////////////////////////////// +template <uint8_t Which> void bfm_adder2_device::screen_ram_w(offs_t offset, uint8_t data) { - int dirty_off = (offset>>7)*50 + ((offset & 0x7F)>>1); - - if ( offset > 102 && offset < 102+1+16 ) - { // format xxxrrggb //////////////////////////////////////////////////// - int pal; - uint8_t r,g,b; + int dirty_off = (offset >> 7) * 50 + ((offset & 0x7f) >> 1); - pal = offset-102-1; + if (offset > 102 && offset < 102 + 1 + 16) + { // format xxxrrggb + int pal = offset - 102 - 1; - r = ((data & 0x18)>>3) * 85; // 00011000b = 0x18 - g = ((data & 0x06)>>1) * 85; // 00000110b = 0x06 - b = ((data & 0x01) ) * 255; - palette().set_pen_color(pal, rgb_t(r,g,b)); - } - - if (m_screen_page_reg & SL_ACCESS) - { - m_screen_ram[1][offset] = data; - m_tilemap1->mark_tile_dirty(dirty_off); + uint8_t r = ((data & 0x18) >> 3) * 85; // 00011000b = 0x18 + uint8_t g = ((data & 0x06) >> 1) * 85; // 00000110b = 0x06 + uint8_t b = (data & 0x01) * 255; + palette().set_pen_color(pal, rgb_t(r, g, b)); } - else - { - m_screen_ram[0][offset] = data; - m_tilemap0->mark_tile_dirty(dirty_off); - } + m_screen_ram[Which][offset] = data; + m_tilemap[Which]->mark_tile_dirty(dirty_off); } -/////////////////////////////////////////////////////////////////////////// -uint8_t bfm_adder2_device::normal_ram_r(offs_t offset) +void bfm_adder2_device::rom_page_w(uint8_t data) { - return m_adder_ram[offset]; + m_rombank->set_entry(data & 0x03); } -/////////////////////////////////////////////////////////////////////////// -void bfm_adder2_device::normal_ram_w(offs_t offset, uint8_t data) +void bfm_adder2_device::c001_w(uint8_t data) { - m_adder_ram[offset] = data; -} - -/////////////////////////////////////////////////////////////////////////// - -void bfm_adder2_device::adder2_rom_page_w(uint8_t data) -{ - membank("bank2")->set_entry(data&0x03); -} - -/////////////////////////////////////////////////////////////////////////// - -void bfm_adder2_device::adder2_c001_w(uint8_t data) -{ - logerror("c101 = %02X\n",data); + LOGC001("c001 = %02X\n", data); //m_screen_page_reg = 0; } -/////////////////////////////////////////////////////////////////////////// -void bfm_adder2_device::adder2_screen_page_w(uint8_t data) +void bfm_adder2_device::screen_page_w(uint8_t data) { m_screen_page_reg = data; + m_screen_ram_view.select(BIT(m_screen_page_reg, 0)); } -/////////////////////////////////////////////////////////////////////////// -uint8_t bfm_adder2_device::adder2_vbl_ctrl_r() +uint8_t bfm_adder2_device::vbl_ctrl_r() { m_vbl_triggered = false; // clear VBL start IRQ return m_c101; } -/////////////////////////////////////////////////////////////////////////// -void bfm_adder2_device::adder2_vbl_ctrl_w(uint8_t data) +void bfm_adder2_device::vbl_ctrl_w(uint8_t data) { m_c101 = data; } -/////////////////////////////////////////////////////////////////////////// -uint8_t bfm_adder2_device::adder2_uart_ctrl_r() +uint8_t bfm_adder2_device::uart_ctrl_r() { int status = 0; if (m_data_from_sc2) status |= 0x01; // receive buffer full - if (!m_data_to_sc2 ) status |= 0x02; // transmit buffer empty + if (!m_data_to_sc2) status |= 0x02; // transmit buffer empty return status; } -/////////////////////////////////////////////////////////////////////////// -void bfm_adder2_device::adder2_uart_ctrl_w(uint8_t data) +void bfm_adder2_device::uart_ctrl_w(uint8_t data) { m_data_from_sc2 = false; // data available for adder from sc2 - m_sc2data = 0; // data - m_data_to_sc2 = false; // data available for sc2 from adder - m_adder2_data = 0; // data + m_sc2data = 0; // data + m_data_to_sc2 = false; // data available for sc2 from adder + m_data = 0; // data - LOG_CTRL(("adder2 uart ctrl:%02X\n", data)); + LOGCTRL("adder2 uart ctrl: %02X\n", data); } -/////////////////////////////////////////////////////////////////////////// -uint8_t bfm_adder2_device::adder2_uart_rx_r() +uint8_t bfm_adder2_device::uart_rx_r() { int data = m_sc2data; m_data_from_sc2 = false; // clr flag, data from scorpion2 board available - LOG_CTRL(("rsc2:%02X (%c)\n",data, data )); + LOGCTRL("rsc2: %02X (%c)\n", data, data); return data; } -/////////////////////////////////////////////////////////////////////////// -void bfm_adder2_device::adder2_uart_tx_w(uint8_t data) +void bfm_adder2_device::uart_tx_w(uint8_t data) { m_data_to_sc2 = true; // set flag, data from adder available - m_adder2_data = data; // store data + m_data = data; // store data - LOG_CTRL(("ssc2 %02X(%c)\n",data, data )); + LOGCTRL("ssc2: %02X (%c)\n", data, data); } -/////////////////////////////////////////////////////////////////////////// -uint8_t bfm_adder2_device::adder2_irq_r() +uint8_t bfm_adder2_device::irq_r() { int status = 0; @@ -429,86 +337,73 @@ uint8_t bfm_adder2_device::adder2_irq_r() } -/////////////////////////////////////////////////////////////////////////// - void bfm_adder2_device::vid_uart_tx_w(uint8_t data) { - m_data_from_sc2 = true; // set flag, data from scorpion2 board available - m_sc2data = data; // store data + m_data_from_sc2 = true; // set flag, data from scorpion2 board available + m_sc2data = data; // store data m_acia_triggered = true; // set flag, acia IRQ triggered - m_cpu->set_input_line(M6809_IRQ_LINE, HOLD_LINE ); + m_cpu->set_input_line(M6809_IRQ_LINE, HOLD_LINE); - //LOG_SERIAL(("sadder %02X (%c)\n",data, data )); + LOGSERIAL("sadder: %02X (%c)\n", data, data); } -/////////////////////////////////////////////////////////////////////////// void bfm_adder2_device::vid_uart_ctrl_w(uint8_t data) { } -/////////////////////////////////////////////////////////////////////////// uint8_t bfm_adder2_device::vid_uart_rx_r() { - uint8_t data = m_adder2_data; + uint8_t data = m_data; m_data_to_sc2 = false; // clr flag, data from adder available - //LOG_SERIAL(("radder: %02X(%c)\n",data, data )); + LOGSERIAL("radder: %02X (%c)\n", data, data); return data; } -/////////////////////////////////////////////////////////////////////////// uint8_t bfm_adder2_device::vid_uart_ctrl_r() { int status = 0; - if (m_data_to_sc2 ) status |= 0x01; // receive buffer full + if (m_data_to_sc2) status |= 0x01; // receive buffer full if (!m_data_from_sc2) status |= 0x02; // transmit buffer empty return status; } -//////////////////////////////////////////////////////////////////// -// // -// decode character data to a format which can be decoded by MAME // -// // -//////////////////////////////////////////////////////////////////// - -void bfm_adder2_device::adder2_decode_char_roms() +void bfm_adder2_device::decode_char_roms() // decode character data to a format which can be decoded by MAME { - uint8_t *p = machine().root_device().memregion("gfx1")->base(); + uint8_t *p = memregion("tiles")->base(); - if ( p ) + if (p) { - std::vector<uint8_t> s( 0x40000 ); + std::vector<uint8_t> s(0x40000); { - int x, y; - memcpy(&s[0], p, 0x40000); - y = 0; + int y = 0; - while ( y < 128 ) + while (y < 128) { - x = 0; - while ( x < 64 ) + int x = 0; + while (x < 64) { - uint8_t *src = &s[(y*256*8)+(x*4)]; - - *p++ = src[0*256+0];*p++ = src[0*256+1];*p++ = src[0*256+2];*p++ = src[0*256+3]; - *p++ = src[1*256+0];*p++ = src[1*256+1];*p++ = src[1*256+2];*p++ = src[1*256+3]; - *p++ = src[2*256+0];*p++ = src[2*256+1];*p++ = src[2*256+2];*p++ = src[2*256+3]; - *p++ = src[3*256+0];*p++ = src[3*256+1];*p++ = src[3*256+2];*p++ = src[3*256+3]; - *p++ = src[4*256+0];*p++ = src[4*256+1];*p++ = src[4*256+2];*p++ = src[4*256+3]; - *p++ = src[5*256+0];*p++ = src[5*256+1];*p++ = src[5*256+2];*p++ = src[5*256+3]; - *p++ = src[6*256+0];*p++ = src[6*256+1];*p++ = src[6*256+2];*p++ = src[6*256+3]; - *p++ = src[7*256+0];*p++ = src[7*256+1];*p++ = src[7*256+2];*p++ = src[7*256+3]; + uint8_t *src = &s[(y * 256 * 8) + (x * 4)]; + + *p++ = src[0 * 256 + 0]; *p++ = src[0 * 256 + 1]; *p++ = src[0 * 256 + 2]; *p++ = src[0 * 256 + 3]; + *p++ = src[1 * 256 + 0]; *p++ = src[1 * 256 + 1]; *p++ = src[1 * 256 + 2]; *p++ = src[1 * 256 + 3]; + *p++ = src[2 * 256 + 0]; *p++ = src[2 * 256 + 1]; *p++ = src[2 * 256 + 2]; *p++ = src[2 * 256 + 3]; + *p++ = src[3 * 256 + 0]; *p++ = src[3 * 256 + 1]; *p++ = src[3 * 256 + 2]; *p++ = src[3 * 256 + 3]; + *p++ = src[4 * 256 + 0]; *p++ = src[4 * 256 + 1]; *p++ = src[4 * 256 + 2]; *p++ = src[4 * 256 + 3]; + *p++ = src[5 * 256 + 0]; *p++ = src[5 * 256 + 1]; *p++ = src[5 * 256 + 2]; *p++ = src[5 * 256 + 3]; + *p++ = src[6 * 256 + 0]; *p++ = src[6 * 256 + 1]; *p++ = src[6 * 256 + 2]; *p++ = src[6 * 256 + 3]; + *p++ = src[7 * 256 + 0]; *p++ = src[7 * 256 + 1]; *p++ = src[7 * 256 + 2]; *p++ = src[7 * 256 + 3]; x++; } y++; @@ -517,30 +412,24 @@ void bfm_adder2_device::adder2_decode_char_roms() } } -/////////////////////////////////////////////////////////////////////////// -// adder2 board memorymap ///////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////// -void bfm_adder2_device::adder2_memmap(address_map &map) +void bfm_adder2_device::prg_map(address_map &map) { - map(0x0000, 0x0000).w(FUNC(bfm_adder2_device::adder2_screen_page_w)); // screen access/display select - map(0x0000, 0x7FFF).bankr("bank2"); // 8k paged ROM (4 pages) - map(0x8000, 0x917F).rw(FUNC(bfm_adder2_device::screen_ram_r), FUNC(bfm_adder2_device::screen_ram_w)); - map(0x9180, 0x9FFF).rw(FUNC(bfm_adder2_device::normal_ram_r), FUNC(bfm_adder2_device::normal_ram_w)); - - map(0xC000, 0xC000).w(FUNC(bfm_adder2_device::adder2_rom_page_w)); // ROM page select - map(0xC001, 0xC001).w(FUNC(bfm_adder2_device::adder2_c001_w)); // ?? - - map(0xC101, 0xC101).rw(FUNC(bfm_adder2_device::adder2_vbl_ctrl_r), FUNC(bfm_adder2_device::adder2_vbl_ctrl_w)); - map(0xC103, 0xC103).r(FUNC(bfm_adder2_device::adder2_irq_r)); // IRQ latch read - - // MC6850 compatible uart connected to main (scorpion2) board /////////////////////////////////////// - - map(0xC200, 0xC200).rw(FUNC(bfm_adder2_device::adder2_uart_ctrl_r), FUNC(bfm_adder2_device::adder2_uart_ctrl_w)); // 6850 compatible uart control reg - map(0xC201, 0xC201).rw(FUNC(bfm_adder2_device::adder2_uart_rx_r), FUNC(bfm_adder2_device::adder2_uart_tx_w)); // 6850 compatible uart data reg - - map(0xE000, 0xFFFF).rom().region(":adder2", 0xE000); // 8k ROM + map(0x0000, 0x0000).w(FUNC(bfm_adder2_device::screen_page_w)); // screen access/display select + map(0x0000, 0x7fff).bankr(m_rombank); // 8k paged ROM (4 pages) + map(0x8000, 0x917f).view(m_screen_ram_view); + m_screen_ram_view[0](0x8000, 0x917f).ram().w(FUNC(bfm_adder2_device::screen_ram_w<0>)).share(m_screen_ram[0]); + m_screen_ram_view[1](0x8000, 0x917f).ram().w(FUNC(bfm_adder2_device::screen_ram_w<1>)).share(m_screen_ram[1]); + map(0x9180, 0x9fff).ram(); + map(0xc000, 0xc000).w(FUNC(bfm_adder2_device::rom_page_w)); + map(0xc001, 0xc001).w(FUNC(bfm_adder2_device::c001_w)); // ?? + map(0xc101, 0xc101).rw(FUNC(bfm_adder2_device::vbl_ctrl_r), FUNC(bfm_adder2_device::vbl_ctrl_w)); + map(0xc103, 0xc103).r(FUNC(bfm_adder2_device::irq_r)); + // MC6850 compatible uart connected to main (scorpion2) board + map(0xc200, 0xc200).rw(FUNC(bfm_adder2_device::uart_ctrl_r), FUNC(bfm_adder2_device::uart_ctrl_w)); // 6850 compatible uart control reg + map(0xc201, 0xc201).rw(FUNC(bfm_adder2_device::uart_rx_r), FUNC(bfm_adder2_device::uart_tx_w)); // 6850 compatible uart data reg + map(0xe000, 0xffff).rom().region("cpu", 0xe000); } @@ -550,16 +439,16 @@ void bfm_adder2_device::adder2_memmap(address_map &map) void bfm_adder2_device::device_add_mconfig(machine_config &config) { - M6809(config, m_cpu, ADDER_CLOCK/4); // adder2 board 6809 CPU at 2 Mhz - m_cpu->set_addrmap(AS_PROGRAM, &bfm_adder2_device::adder2_memmap); // setup adder2 board memorymap + M6809(config, m_cpu, 8_MHz_XTAL / 4); // 2 MHz + m_cpu->set_addrmap(AS_PROGRAM, &bfm_adder2_device::prg_map); screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_size(400, 280); - screen.set_visarea(0, 400-1, 0, 280-1); + screen.set_visarea_full(); screen.set_refresh_hz(50); screen.set_palette("palette"); - screen.set_screen_update(FUNC(bfm_adder2_device::update_screen)); - screen.screen_vblank().set(FUNC(bfm_adder2_device::adder2_vbl_w)); // board has a VBL IRQ + screen.set_screen_update(FUNC(bfm_adder2_device::screen_update)); + screen.screen_vblank().set(FUNC(bfm_adder2_device::vbl_w)); PALETTE(config, "palette").set_entries(16); } diff --git a/src/mame/video/bfm_adr2.h b/src/mame/video/bfm_adr2.h index c213af179f9..21cfaa67d96 100644 --- a/src/mame/video/bfm_adr2.h +++ b/src/mame/video/bfm_adr2.h @@ -14,32 +14,11 @@ public: // construction/destruction bfm_adder2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - TILE_GET_INFO_MEMBER( get_tile0_info ); - TILE_GET_INFO_MEMBER( get_tile1_info ); - - uint8_t screen_ram_r(offs_t offset); - void screen_ram_w(offs_t offset, uint8_t data); - uint8_t normal_ram_r(offs_t offset); - void normal_ram_w(offs_t offset, uint8_t data); - void adder2_rom_page_w(uint8_t data); - void adder2_c001_w(uint8_t data); - void adder2_screen_page_w(uint8_t data); - uint8_t adder2_vbl_ctrl_r(); - void adder2_vbl_ctrl_w(uint8_t data); - uint8_t adder2_uart_ctrl_r(); - void adder2_uart_ctrl_w(uint8_t data); - uint8_t adder2_uart_rx_r(); - void adder2_uart_tx_w(uint8_t data); - uint8_t adder2_irq_r(); - void vid_uart_tx_w(uint8_t data); void vid_uart_ctrl_w(uint8_t data); uint8_t vid_uart_rx_r(); uint8_t vid_uart_ctrl_r(); - void adder2_decode_char_roms(); - - void adder2_memmap(address_map &map); protected: // device-level overrides virtual void device_start() override; @@ -47,28 +26,45 @@ protected: virtual void device_add_mconfig(machine_config &config) override; private: - int m_screen_page_reg = 0; // access/display select - int m_c101 = 0; - int m_rx = 0; + required_device<cpu_device> m_cpu; + required_shared_ptr_array<uint8_t, 2> m_screen_ram; // paged display RAM + memory_view m_screen_ram_view; + required_memory_bank m_rombank; + + uint8_t m_screen_page_reg = 0; // access/display select + uint8_t m_c101 = 0; bool m_vbl_triggered = 0; // flag, VBL IRQ triggered bool m_acia_triggered = 0; // flag, ACIA receive IRQ - uint8_t m_adder_ram[0xE80]{}; // normal RAM - uint8_t m_screen_ram[2][0x1180]{}; // paged display RAM - - tilemap_t *m_tilemap0 = nullptr; // tilemap screen0 - tilemap_t *m_tilemap1 = nullptr; // tilemap screen1 + tilemap_t *m_tilemap[2]{}; bool m_data_from_sc2 = false; bool m_data_to_sc2 = false; - uint8_t m_adder2_data = 0; + uint8_t m_data = 0; uint8_t m_sc2data = 0; - optional_device<cpu_device> m_cpu; + DECLARE_GFXDECODE_MEMBER(gfxinfo); + template <uint8_t Which> TILE_GET_INFO_MEMBER(get_tile_info); + + template <uint8_t Which> void screen_ram_w(offs_t offset, uint8_t data); + void rom_page_w(uint8_t data); + void c001_w(uint8_t data); + void screen_page_w(uint8_t data); + uint8_t vbl_ctrl_r(); + void vbl_ctrl_w(uint8_t data); + uint8_t uart_ctrl_r(); + void uart_ctrl_w(uint8_t data); + uint8_t uart_rx_r(); + void uart_tx_w(uint8_t data); + uint8_t irq_r(); + + void decode_char_roms(); + + void prg_map(address_map &map); - uint32_t update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - DECLARE_WRITE_LINE_MEMBER(adder2_vbl_w); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + DECLARE_WRITE_LINE_MEMBER(vbl_w); }; // device type definition diff --git a/src/mame/video/brkthru.cpp b/src/mame/video/brkthru.cpp deleted file mode 100644 index 63d4215f1c5..00000000000 --- a/src/mame/video/brkthru.cpp +++ /dev/null @@ -1,264 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Phil Stroffolino -/*************************************************************************** - - video/brkthru.c - -***************************************************************************/ - -#include "emu.h" -#include "includes/brkthru.h" - - -/*************************************************************************** - - Convert the color PROMs into a more useable format. - - Break Thru has one 256x8 and one 256x4 palette PROMs. - I don't know for sure how the palette PROMs are connected to the RGB - output, but it's probably the usual: - - bit 7 -- 220 ohm resistor -- GREEN - -- 470 ohm resistor -- GREEN - -- 1 kohm resistor -- GREEN - -- 2.2kohm resistor -- GREEN - -- 220 ohm resistor -- RED - -- 470 ohm resistor -- RED - -- 1 kohm resistor -- RED - bit 0 -- 2.2kohm resistor -- RED - - bit 3 -- 220 ohm resistor -- BLUE - -- 470 ohm resistor -- BLUE - -- 1 kohm resistor -- BLUE - bit 0 -- 2.2kohm resistor -- BLUE - -***************************************************************************/ - -void brkthru_state::brkthru_palette(palette_device &palette) const -{ - uint8_t const *color_prom = memregion("proms")->base(); - - for (int i = 0; i < palette.entries(); i++) - { - int bit0, bit1, bit2, bit3; - - bit0 = (color_prom[0] >> 0) & 0x01; - bit1 = (color_prom[0] >> 1) & 0x01; - bit2 = (color_prom[0] >> 2) & 0x01; - bit3 = (color_prom[0] >> 3) & 0x01; - int const r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - bit0 = (color_prom[0] >> 4) & 0x01; - bit1 = (color_prom[0] >> 5) & 0x01; - bit2 = (color_prom[0] >> 6) & 0x01; - bit3 = (color_prom[0] >> 7) & 0x01; - int const g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - bit0 = (color_prom[palette.entries()] >> 0) & 0x01; - bit1 = (color_prom[palette.entries()] >> 1) & 0x01; - bit2 = (color_prom[palette.entries()] >> 2) & 0x01; - bit3 = (color_prom[palette.entries()] >> 3) & 0x01; - int const b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - palette.set_pen_color(i, rgb_t(r,g,b)); - - color_prom++; - } -} - - - -/*************************************************************************** - - Start the video hardware emulation. - -***************************************************************************/ - -TILE_GET_INFO_MEMBER(brkthru_state::get_bg_tile_info) -{ - /* BG RAM format - 0 1 - ---- -c-- ---- ---- = Color - ---- --xx xxxx xxxx = Code - */ - - int code = (m_videoram[tile_index * 2] | ((m_videoram[tile_index * 2 + 1]) << 8)) & 0x3ff; - int region = 1 + (code >> 7); - int colour = m_bgbasecolor + ((m_videoram[tile_index * 2 + 1] & 0x04) >> 2); - - tileinfo.set(region, code & 0x7f, colour,0); -} - -void brkthru_state::brkthru_bgram_w(offs_t offset, uint8_t data) -{ - m_videoram[offset] = data; - m_bg_tilemap->mark_tile_dirty(offset / 2); -} - - -TILE_GET_INFO_MEMBER(brkthru_state::get_fg_tile_info) -{ - uint8_t code = m_fg_videoram[tile_index]; - tileinfo.set(0, code, 0, 0); -} - -void brkthru_state::brkthru_fgram_w(offs_t offset, uint8_t data) -{ - m_fg_videoram[offset] = data; - m_fg_tilemap->mark_tile_dirty(offset); -} - -void brkthru_state::video_start() -{ - m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(brkthru_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(brkthru_state::get_bg_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 32, 16); - - m_fg_tilemap->set_transparent_pen(0); - m_bg_tilemap->set_transparent_pen(0); -} - - -void brkthru_state::brkthru_1800_w(offs_t offset, uint8_t data) -{ - if (offset == 0) /* low 8 bits of scroll */ - m_bgscroll = (m_bgscroll & 0x100) | data; - else if (offset == 1) - { - /* bit 0-2 = ROM bank select */ - membank("bank1")->set_entry(data & 0x07); - - /* bit 3-5 = background tiles color code */ - if (((data & 0x38) >> 2) != m_bgbasecolor) - { - m_bgbasecolor = (data & 0x38) >> 2; - m_bg_tilemap->mark_all_dirty(); - } - - /* bit 6 = screen flip */ - if (m_flipscreen != (data & 0x40)) - { - m_flipscreen = data & 0x40; - m_bg_tilemap->set_flip(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); - m_fg_tilemap->set_flip(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); - - } - - /* bit 7 = high bit of scroll */ - m_bgscroll = (m_bgscroll & 0xff) | ((data & 0x80) << 1); - } -} - - -#if 0 -void brkthru_state::show_register( bitmap_ind16 &bitmap, int x, int y, uint32_t data ) -{ - char buf[5]; - - sprintf(buf, "%04X", data); - ui_draw_text(y, x, buf); -} -#endif - - -void brkthru_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int prio ) -{ - int offs; - /* Draw the sprites. Note that it is important to draw them exactly in this */ - /* order, to have the correct priorities. */ - - /* Sprite RAM format - 0 1 2 3 - ccc- ---- ---- ---- ---- ---- ---- ---- = Color - ---d ---- ---- ---- ---- ---- ---- ---- = Double Size - ---- p--- ---- ---- ---- ---- ---- ---- = Priority - ---- -bb- ---- ---- ---- ---- ---- ---- = Bank - ---- ---e ---- ---- ---- ---- ---- ---- = Enable/Disable - ---- ---- ssss ssss ---- ---- ---- ---- = Sprite code - ---- ---- ---- ---- yyyy yyyy ---- ---- = Y position - ---- ---- ---- ---- ---- ---- xxxx xxxx = X position - */ - - for (offs = 0;offs < m_spriteram.bytes(); offs += 4) - { - if ((m_spriteram[offs] & 0x09) == prio) /* Enable && Low Priority */ - { - int sx, sy, code, color; - - sx = 240 - m_spriteram[offs + 3]; - if (sx < -7) - sx += 256; - - sy = 240 - m_spriteram[offs + 2]; - code = m_spriteram[offs + 1] + 128 * (m_spriteram[offs] & 0x06); - color = (m_spriteram[offs] & 0xe0) >> 5; - if (m_flipscreen) - { - sx = 240 - sx; - sy = 240 - sy; - } - - if (m_spriteram[offs] & 0x10) /* double height */ - { - m_gfxdecode->gfx(9)->transpen(bitmap,cliprect, - code & ~1, - color, - m_flipscreen, m_flipscreen, - sx, m_flipscreen ? sy + 16 : sy - 16,0); - m_gfxdecode->gfx(9)->transpen(bitmap,cliprect, - code | 1, - color, - m_flipscreen, m_flipscreen, - sx,sy,0); - - /* redraw with wraparound */ - m_gfxdecode->gfx(9)->transpen(bitmap,cliprect, - code & ~1, - color, - m_flipscreen, m_flipscreen, - sx,(m_flipscreen ? sy + 16 : sy - 16) + 256,0); - m_gfxdecode->gfx(9)->transpen(bitmap,cliprect, - code | 1, - color, - m_flipscreen, m_flipscreen, - sx,sy + 256,0); - - } - else - { - m_gfxdecode->gfx(9)->transpen(bitmap,cliprect, - code, - color, - m_flipscreen, m_flipscreen, - sx,sy,0); - - /* redraw with wraparound */ - m_gfxdecode->gfx(9)->transpen(bitmap,cliprect, - code, - color, - m_flipscreen, m_flipscreen, - sx,sy + 256,0); - - } - } - } -} - -uint32_t brkthru_state::screen_update_brkthru(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - m_bg_tilemap->set_scrollx(0, m_bgscroll); - m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); - - /* low priority sprites */ - draw_sprites(bitmap, cliprect, 0x01); - - /* draw background over low priority sprites */ - m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - - /* high priority sprites */ - draw_sprites(bitmap, cliprect, 0x09); - - /* fg layer */ - m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - -/* show_register(bitmap, 8, 8, (uint32_t)m_flipscreen); */ - - return 0; -} diff --git a/src/mame/video/gunsmoke.cpp b/src/mame/video/gunsmoke.cpp deleted file mode 100644 index 036afa552c0..00000000000 --- a/src/mame/video/gunsmoke.cpp +++ /dev/null @@ -1,189 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Paul Leaman -#include "emu.h" -#include "includes/gunsmoke.h" - -/*************************************************************************** - - Convert the color PROMs into a more useable format. - - Gunsmoke has three 256x4 palette PROMs (one per gun) and a lot ;-) of - 256x4 lookup table PROMs. - The palette PROMs are connected to the RGB output this way: - - bit 3 -- 220 ohm resistor -- RED/GREEN/BLUE - -- 470 ohm resistor -- RED/GREEN/BLUE - -- 1 kohm resistor -- RED/GREEN/BLUE - bit 0 -- 2.2kohm resistor -- RED/GREEN/BLUE - -***************************************************************************/ - -void gunsmoke_state::gunsmoke_palette(palette_device &palette) const -{ - const uint8_t *color_prom = memregion("proms")->base(); - - // create a lookup table for the palette - for (int i = 0; i < 0x100; i++) - { - int const r = pal4bit(color_prom[i + 0x000]); - int const g = pal4bit(color_prom[i + 0x100]); - int const b = pal4bit(color_prom[i + 0x200]); - - palette.set_indirect_color(i, rgb_t(r, g, b)); - } - - // color_prom now points to the beginning of the lookup table - color_prom += 0x300; - - // characters use colors 0x40-0x4f - for (int i = 0; i < 0x80; i++) - { - uint8_t const ctabentry = color_prom[i] | 0x40; - palette.set_pen_indirect(i, ctabentry); - } - - // background tiles use colors 0-0x3f - for (int i = 0x100; i < 0x200; i++) - { - uint8_t const ctabentry = color_prom[i] | ((color_prom[i + 0x100] & 0x03) << 4); - palette.set_pen_indirect(i - 0x80, ctabentry); - } - - // sprites use colors 0x80-0xff - for (int i = 0x300; i < 0x400; i++) - { - uint8_t const ctabentry = color_prom[i] | ((color_prom[i + 0x100] & 0x07) << 4) | 0x80; - palette.set_pen_indirect(i - 0x180, ctabentry); - } -} - -void gunsmoke_state::gunsmoke_videoram_w(offs_t offset, uint8_t data) -{ - m_videoram[offset] = data; - m_fg_tilemap->mark_tile_dirty(offset); -} - -void gunsmoke_state::gunsmoke_colorram_w(offs_t offset, uint8_t data) -{ - m_colorram[offset] = data; - m_fg_tilemap->mark_tile_dirty(offset); -} - -void gunsmoke_state::gunsmoke_c804_w(uint8_t data) -{ - /* bits 0 and 1 are for coin counters */ - machine().bookkeeping().coin_counter_w(1, data & 0x01); - machine().bookkeeping().coin_counter_w(0, data & 0x02); - - /* bits 2 and 3 select the ROM bank */ - membank("bank1")->set_entry((data & 0x0c) >> 2); - - /* bit 5 resets the sound CPU? - we ignore it */ - - /* bit 6 flips screen */ - flip_screen_set(data & 0x40); - - /* bit 7 enables characters? */ - m_chon = data & 0x80; -} - -void gunsmoke_state::gunsmoke_d806_w(uint8_t data) -{ - /* bits 0-2 select the sprite 3 bank */ - m_sprite3bank = data & 0x07; - - /* bit 4 enables bg 1? */ - m_bgon = data & 0x10; - - /* bit 5 enables sprites? */ - m_objon = data & 0x20; -} - -TILE_GET_INFO_MEMBER(gunsmoke_state::get_bg_tile_info) -{ - uint8_t *tilerom = memregion("gfx4")->base(); - - int offs = tile_index * 2; - int attr = tilerom[offs + 1]; - int code = tilerom[offs] + ((attr & 0x01) << 8); - int color = (attr & 0x3c) >> 2; - int flags = TILE_FLIPYX((attr & 0xc0) >> 6); - - tileinfo.set(1, code, color, flags); -} - -TILE_GET_INFO_MEMBER(gunsmoke_state::get_fg_tile_info) -{ - int attr = m_colorram[tile_index]; - int code = m_videoram[tile_index] + ((attr & 0xe0) << 2); - int color = attr & 0x1f; - - tileinfo.group = color; - - tileinfo.set(0, code, color, 0); -} - -void gunsmoke_state::video_start() -{ - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(gunsmoke_state::get_bg_tile_info)), TILEMAP_SCAN_COLS, 32, 32, 2048, 8); - m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(gunsmoke_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); - - m_bg_tilemap->set_scrolldx(128, 128); - m_bg_tilemap->set_scrolldy( 6, 6); - m_fg_tilemap->set_scrolldx(128, 128); - m_fg_tilemap->set_scrolldy( 6, 6); - - m_fg_tilemap->configure_groups(*m_gfxdecode->gfx(0), 0x4f); -} - -void gunsmoke_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) -{ - uint8_t *spriteram = m_spriteram; - int offs; - - for (offs = m_spriteram.bytes() - 32; offs >= 0; offs -= 32) - { - int attr = spriteram[offs + 1]; - int bank = (attr & 0xc0) >> 6; - int code = spriteram[offs]; - int color = attr & 0x0f; - int flipx = 0; - int flipy = attr & 0x10; - int sx = spriteram[offs + 3] - ((attr & 0x20) << 3); - int sy = spriteram[offs + 2]; - - if (bank == 3) - bank += m_sprite3bank; - - code += 256 * bank; - - if (flip_screen()) - { - sx = 240 - sx; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } - - m_gfxdecode->gfx(2)->transpen(bitmap,cliprect, code, color, flipx, flipy, sx+128, sy+6, 0); - } -} - -uint32_t gunsmoke_state::screen_update_gunsmoke(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - m_bg_tilemap->set_scrollx(0, m_scrollx[0] + 256 * m_scrollx[1]); - m_bg_tilemap->set_scrolly(0, m_scrolly[0]); - - if (m_bgon) - m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - else - bitmap.fill(m_palette->black_pen(), cliprect); - - if (m_objon) - draw_sprites(bitmap, cliprect); - - if (m_chon) - m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - - return 0; -} diff --git a/src/mame/video/spectrum.cpp b/src/mame/video/spectrum.cpp index 971fa935c8c..b0c634286bb 100644 --- a/src/mame/video/spectrum.cpp +++ b/src/mame/video/spectrum.cpp @@ -26,14 +26,7 @@ void spectrum_state::video_start() { m_frame_invert_count = 16; m_screen_location = m_video_ram; - m_scanline_timer = timer_alloc(TIMER_SCANLINE); -} - -void spectrum_128_state::video_start() -{ - m_frame_invert_count = 16; - m_screen_location = m_ram->pointer() + (5 << 14); - m_scanline_timer = timer_alloc(TIMER_SCANLINE); + m_contention_pattern = {6, 5, 4, 3, 2, 1, 0, 0}; } /*************************************************************************** @@ -124,11 +117,23 @@ u32 spectrum_state::screen_update_spectrum(screen_device &screen, bitmap_ind16 & void spectrum_state::spectrum_update_border(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &border) { + u8 mod = m_contention_pattern.empty() ? 1 : m_contention_pattern.size(); for (auto y = border.top(); y <= border.bottom(); y++) { u16 *pix = &(bitmap.pix(y, border.left())); - for (auto x = border.left(); x <= border.right(); x++) - *pix++ = get_border_color(y, x); + for (auto x = border.left(); x <= border.right(); ) + { + if (x % mod == 0) + { + for (auto m = 0; m < mod; m++, x++) + *pix++ = get_border_color(y, x); + } + else + { + pix++; + x++; + } + } } } @@ -140,6 +145,12 @@ void spectrum_state::spectrum_update_screen(screen_device &screen_d, bitmap_ind1 { u16 hpos = screen.left(); u16 x = hpos - get_screen_area().left(); + if (x % 8) + { + u8 shift = 8 - (x % 8); + x += shift; + hpos += shift; + } u16 y = vpos - get_screen_area().top(); u8 *scr = &m_screen_location[((y & 7) << 8) | ((y & 0x38) << 2) | ((y & 0xc0) << 5) | (x >> 3)]; u8 *attr = &attrs_location[((y & 0xf8) << 2) | (x >> 3)]; @@ -150,10 +161,63 @@ void spectrum_state::spectrum_update_screen(screen_device &screen_d, bitmap_ind1 u16 pap = (*attr >> 3) & 0x0f; u8 pix8 = (invert_attrs && (*attr & 0x80)) ? ~*scr : *scr; - for (u8 b = 0x80 >> (x & 0x07); b != 0 && hpos <= screen.right(); b >>= 1, x++, hpos++) + for (u8 b = 0x80; b; b >>= 1, x++, hpos++) *pix++ = (pix8 & b) ? ink : pap; scr++; attr++; } } } + +bool spectrum_state::is_vram_write(offs_t offset) { + return offset >= 0x4000 && offset < 0x5b00; +} + +bool spectrum_state::is_contended(offs_t offset) { + return offset >= 0x4000 && offset < 0x8000; +} + +void spectrum_state::content_early(s8 shift) +{ + u64 vpos = m_screen->vpos(); + if (m_contention_pattern.empty() || vpos < get_screen_area().top() || vpos > get_screen_area().bottom()) + return; + + u64 now = m_maincpu->cycles_from_irq() + shift; + u64 cf = vpos * m_screen->width() * m_maincpu->clock() / m_screen->clock() - 1; + u64 ct = cf + get_screen_area().width() * m_maincpu->clock() / m_screen->clock(); + + if(cf <= now && now < ct) + { + u64 clocks = now - cf; + u8 c = m_contention_pattern[clocks % m_contention_pattern.size()]; + m_maincpu->adjust_icount(-c); + } +} + +void spectrum_state::content_late() +{ + u64 vpos = m_screen->vpos(); + if (m_contention_pattern.empty() || vpos < get_screen_area().top() || vpos > get_screen_area().bottom()) + return; + + u64 now = m_maincpu->cycles_from_irq() + 1; + u64 cf = vpos * m_screen->width() * m_maincpu->clock() / m_screen->clock() - 1; + u64 ct = cf + get_screen_area().width() * m_maincpu->clock() / m_screen->clock(); + for(auto i = 0x04; i; i >>= 1) + { + if(cf <= now && now < ct) + { + u64 clocks = now - cf; + u8 c = m_contention_pattern[clocks % m_contention_pattern.size()]; + m_maincpu->adjust_icount(-c); + now += c; + } + now++; + } +} + +void spectrum_state::spectrum_nomreq(offs_t offset, uint8_t data) +{ + if (is_contended(offset)) content_early(); +} diff --git a/src/mame/video/timex.cpp b/src/mame/video/timex.cpp index acc4c62b9ab..fb690a0c0c6 100644 --- a/src/mame/video/timex.cpp +++ b/src/mame/video/timex.cpp @@ -59,18 +59,16 @@ void ts2068_state::video_start() /* Draw a scanline in TS2068/TC2048 hires mode (code modified from COUPE.C) */ void tc2048_state::hires_scanline(bitmap_ind16 &bitmap, int y, int borderlines) { - int x,b,scrx,scry; - unsigned short ink,pap; - unsigned char *attr, *scr; + u8 ink, pap; bool invert_attrs = u64(m_screen->frame_number() / m_frame_invert_count) & 1; - scrx=TS2068_LEFT_BORDER; - scry=((y&7) * 8) + ((y&0x38)>>3) + (y&0xC0); + int scrx=TS2068_LEFT_BORDER; + int scry=((y&7) * 8) + ((y&0x38)>>3) + (y&0xC0); - scr=m_ram->pointer() + y*32; - attr=scr + 0x2000; + u8 *scr=m_ram->pointer() + y*32; + u8 *attr=scr + 0x2000; - for (x=0;x<32;x++) + for (int x=0;x<32;x++) { /* Get ink and paper colour with bright */ if (invert_attrs && (*attr & 0x80)) @@ -84,7 +82,7 @@ void tc2048_state::hires_scanline(bitmap_ind16 &bitmap, int y, int borderlines) pap=((*attr)>>3) & 0x0f; } - for (b=0x80;b!=0;b>>=1) + for (int b=0x80;b!=0;b>>=1) { if (*scr&b) { diff --git a/src/mame/video/x68k_crtc.cpp b/src/mame/video/x68k_crtc.cpp index a86b011f0cb..72697c3b430 100644 --- a/src/mame/video/x68k_crtc.cpp +++ b/src/mame/video/x68k_crtc.cpp @@ -367,7 +367,7 @@ void x68k_crtc_device::crtc_w(offs_t offset, u16 data, u16 mem_mask) attotime irq_time = attotime::zero; if ((data / m_vmultiple) != screen().vpos()) { - irq_time = screen().time_until_pos((data - 1) / m_vmultiple,2); + irq_time = screen().time_until_pos(((data != 0 ? data : screen().height()) - 1) / m_vmultiple,2); m_rint_callback(1); } m_raster_irq_timer->adjust(irq_time, (data) / m_vmultiple); diff --git a/src/osd/modules/input/input_common.h b/src/osd/modules/input/input_common.h index 45661fe957c..a26d6f5375e 100644 --- a/src/osd/modules/input/input_common.h +++ b/src/osd/modules/input/input_common.h @@ -447,7 +447,7 @@ protected: public: const osd_options * options() const { return m_options; } - input_device_list * devicelist() { return &m_devicelist; } + input_device_list & devicelist() { return m_devicelist; } bool input_enabled() const { return m_input_enabled; } bool input_paused() const { return m_input_paused; } bool mouse_enabled() const { return m_mouse_enabled; } @@ -504,7 +504,7 @@ public: virtual void exit() override { - devicelist()->free_all_devices(); + devicelist().free_all_devices(); } protected: diff --git a/src/osd/modules/input/input_dinput.cpp b/src/osd/modules/input/input_dinput.cpp index 8ceb29e21f4..7295b23de12 100644 --- a/src/osd/modules/input/input_dinput.cpp +++ b/src/osd/modules/input/input_dinput.cpp @@ -238,7 +238,7 @@ public: result = dinput_set_dword_property(devinfo->dinput.device, DIPROP_AXISMODE, 0, DIPH_DEVICE, DIPROPAXISMODE_REL); if (result != DI_OK && result != DI_PROPNOEFFECT) { - osd_printf_error("DirectInput: Unable to set relative mode for mouse %u (%s)\n", static_cast<unsigned int>(devicelist()->size()), devinfo->name()); + osd_printf_error("DirectInput: Unable to set relative mode for mouse %u (%s)\n", static_cast<unsigned int>(devicelist().size()), devinfo->name()); goto error; } @@ -277,7 +277,7 @@ public: error: if (devinfo) - devicelist()->free_device(*devinfo); + devicelist().free_device(*devinfo); goto exit; } }; @@ -449,10 +449,10 @@ void dinput_joystick_device::poll() int dinput_joystick_device::configure() { HRESULT result; - auto devicelist = static_cast<input_module_base&>(module()).devicelist(); + auto &devicelist = static_cast<input_module_base&>(module()).devicelist(); // temporary approximation of index - int devindex = devicelist->size(); + int devindex = devicelist.size(); // set absolute mode result = dinput_set_dword_property(dinput.device, DIPROP_AXISMODE, 0, DIPH_DEVICE, DIPROPAXISMODE_ABS); diff --git a/src/osd/modules/input/input_dinput.h b/src/osd/modules/input/input_dinput.h index 8600e73a04d..20bced84883 100644 --- a/src/osd/modules/input/input_dinput.h +++ b/src/osd/modules/input/input_dinput.h @@ -72,7 +72,7 @@ public: std::string utf8_instance_id = utf8_instance_name + " product_" + guid_to_string(instance->guidProduct) + " instance_" + guid_to_string(instance->guidInstance); // allocate memory for the device object - TDevice &devinfo = module.devicelist()->create_device<TDevice>(machine, std::move(utf8_instance_name), std::move(utf8_instance_id), module); + TDevice &devinfo = module.devicelist().create_device<TDevice>(machine, std::move(utf8_instance_name), std::move(utf8_instance_id), module); // attempt to create a device result = m_dinput->CreateDevice(instance->guidInstance, devinfo.dinput.device.GetAddressOf(), nullptr); @@ -133,7 +133,7 @@ public: return &devinfo; error: - module.devicelist()->free_device(devinfo); + module.devicelist().free_device(devinfo); return nullptr; } diff --git a/src/osd/modules/input/input_rawinput.cpp b/src/osd/modules/input/input_rawinput.cpp index 10b47a60e31..6424a0d1099 100644 --- a/src/osd/modules/input/input_rawinput.cpp +++ b/src/osd/modules/input/input_rawinput.cpp @@ -489,7 +489,7 @@ public: m_global_inputs_enabled = downcast<windows_options &>(machine.options()).global_inputs(); // If we added no devices, no need to register for notifications - if (devicelist()->empty()) + if (devicelist().empty()) return; // finally, register to receive raw input WM_INPUT messages if we found devices @@ -539,7 +539,7 @@ protected: tname.reset(); - TDevice &devinfo = devicelist()->create_device<TDevice>(machine, std::move(utf8_name), std::move(utf8_id), *this); + TDevice &devinfo = devicelist().create_device<TDevice>(machine, std::move(utf8_name), std::move(utf8_id), *this); // Add the handle devinfo.set_handle(rawinputdevice.hDevice); @@ -594,14 +594,14 @@ protected: // find the device in the list and update auto target_device = std::find_if( - devicelist()->begin(), - devicelist()->end(), + devicelist().begin(), + devicelist().end(), [input] (auto const &device) { auto devinfo = dynamic_cast<rawinput_device *>(device.get()); return devinfo && (input->header.hDevice == devinfo->device_handle()); }); - if (devicelist()->end() == target_device) + if (devicelist().end() == target_device) return false; static_cast<rawinput_device *>(target_device->get())->queue_events(input, 1); @@ -629,14 +629,14 @@ protected: // find the device in the list and update auto target_device = std::find_if( - devicelist()->begin(), - devicelist()->end(), + devicelist().begin(), + devicelist().end(), [&utf8_id] (auto const &device) { auto devinfo = dynamic_cast<rawinput_device *>(device.get()); return devinfo && !devinfo->device_handle() && (devinfo->id() == utf8_id); }); - if (devicelist()->end() == target_device) + if (devicelist().end() == target_device) return false; static_cast<rawinput_device *>(target_device->get())->set_handle(rawinputdevice); @@ -652,15 +652,15 @@ protected: // find the device in the list and update auto target_device = std::find_if( - devicelist()->begin(), - devicelist()->end(), + devicelist().begin(), + devicelist().end(), [rawinputdevice] (auto const &device) { auto devinfo = dynamic_cast<rawinput_device *>(device.get()); return devinfo && (rawinputdevice == devinfo->device_handle()); }); - if (devicelist()->end() == target_device) + if (devicelist().end() == target_device) return false; (*target_device)->reset(); diff --git a/src/osd/modules/input/input_sdl.cpp b/src/osd/modules/input/input_sdl.cpp index 58901627bcf..8937e4cb2a6 100644 --- a/src/osd/modules/input/input_sdl.cpp +++ b/src/osd/modules/input/input_sdl.cpp @@ -20,12 +20,13 @@ #include <SDL2/SDL.h> #include <cctype> // ReSharper disable once CppUnusedIncludeDirective +#include <algorithm> #include <cstddef> -#include <mutex> +#include <iterator> #include <memory> +#include <mutex> +#include <optional> #include <queue> -#include <iterator> -#include <algorithm> // MAME headers #include "emu.h" @@ -373,6 +374,14 @@ protected: class sdl_keyboard_device : public sdl_device { public: + // state information for a keyboard + struct keyboard_state + { + int32_t state[0x3ff]; // must be int32_t! + int8_t oldkey[MAX_KEYS]; + int8_t currkey[MAX_KEYS]; + }; + keyboard_state keyboard; sdl_keyboard_device(running_machine &machine, std::string &&name, std::string &&id, input_module &module) : @@ -483,6 +492,13 @@ private: int last_y; public: + // state information for a mouse + struct mouse_state + { + int32_t lX, lY; + int32_t buttons[MAX_BUTTONS]; + }; + mouse_state mouse; sdl_mouse_device(running_machine &machine, std::string &&name, std::string &&id, input_module &module) : @@ -602,40 +618,40 @@ public: // sdl_joystick_device //============================================================ -// state information for a joystick -struct sdl_joystick_state -{ - int32_t axes[MAX_AXES]; - int32_t buttons[MAX_BUTTONS]; - int32_t hatsU[MAX_HATS], hatsD[MAX_HATS], hatsL[MAX_HATS], hatsR[MAX_HATS]; - int32_t balls[MAX_AXES]; -}; - -struct sdl_api_state -{ - SDL_Joystick *device; - SDL_Haptic *hapdevice; - SDL_JoystickID joystick_id; -}; - class sdl_joystick_device : public sdl_device { public: + // state information for a joystick + struct sdl_joystick_state + { + int32_t axes[MAX_AXES]; + int32_t buttons[MAX_BUTTONS]; + int32_t hatsU[MAX_HATS], hatsD[MAX_HATS], hatsL[MAX_HATS], hatsR[MAX_HATS]; + int32_t balls[MAX_AXES]; + }; + + struct sdl_api_state + { + SDL_Joystick *device = nullptr; + SDL_Haptic *hapdevice = nullptr; + SDL_JoystickID joystick_id; + std::optional<std::string> serial; + }; + sdl_joystick_state joystick; sdl_api_state sdl_state; sdl_joystick_device(running_machine &machine, std::string &&name, std::string &&id, input_module &module) : sdl_device(machine, std::move(name), std::move(id), DEVICE_CLASS_JOYSTICK, module), - joystick({{0}}), - sdl_state({ nullptr }) + joystick({{0}}) { } ~sdl_joystick_device() { - if (sdl_state.device != nullptr) + if (sdl_state.device) { - if (sdl_state.hapdevice != nullptr) + if (sdl_state.hapdevice) { SDL_HapticClose(sdl_state.hapdevice); sdl_state.hapdevice = nullptr; @@ -665,38 +681,10 @@ public: break; case SDL_JOYHATMOTION: - if (sdlevent.jhat.value & SDL_HAT_UP) - { - joystick.hatsU[sdlevent.jhat.hat] = 0x80; - } - else - { - joystick.hatsU[sdlevent.jhat.hat] = 0; - } - if (sdlevent.jhat.value & SDL_HAT_DOWN) - { - joystick.hatsD[sdlevent.jhat.hat] = 0x80; - } - else - { - joystick.hatsD[sdlevent.jhat.hat] = 0; - } - if (sdlevent.jhat.value & SDL_HAT_LEFT) - { - joystick.hatsL[sdlevent.jhat.hat] = 0x80; - } - else - { - joystick.hatsL[sdlevent.jhat.hat] = 0; - } - if (sdlevent.jhat.value & SDL_HAT_RIGHT) - { - joystick.hatsR[sdlevent.jhat.hat] = 0x80; - } - else - { - joystick.hatsR[sdlevent.jhat.hat] = 0; - } + joystick.hatsU[sdlevent.jhat.hat] = (sdlevent.jhat.value & SDL_HAT_UP) ? 0x80 : 0; + joystick.hatsD[sdlevent.jhat.hat] = (sdlevent.jhat.value & SDL_HAT_DOWN) ? 0x80 : 0; + joystick.hatsL[sdlevent.jhat.hat] = (sdlevent.jhat.value & SDL_HAT_LEFT) ? 0x80 : 0; + joystick.hatsR[sdlevent.jhat.hat] = (sdlevent.jhat.value & SDL_HAT_RIGHT) ? 0x80 : 0; break; case SDL_JOYBUTTONDOWN: @@ -704,6 +692,21 @@ public: if (sdlevent.jbutton.button < MAX_BUTTONS) joystick.buttons[sdlevent.jbutton.button] = (sdlevent.jbutton.state == SDL_PRESSED) ? 0x80 : 0; break; + + case SDL_JOYDEVICEREMOVED: + osd_printf_verbose("Joystick: %s [GUID %s] disconnected\n", name(), id()); + reset(); + if (sdl_state.device) + { + if (sdl_state.hapdevice) + { + SDL_HapticClose(sdl_state.hapdevice); + sdl_state.hapdevice = nullptr; + } + SDL_JoystickClose(sdl_state.device); + sdl_state.device = nullptr; + } + break; } } }; @@ -786,9 +789,10 @@ public: void handle_event(SDL_Event &sdlevent) override { // By default dispatch event to every device - devicelist()->for_each_device([&sdlevent](auto device) { - downcast<sdl_device*>(device)->queue_events(&sdlevent, 1); - }); + devicelist().for_each_device( + [&sdlevent](auto device) { + downcast<sdl_device*>(device)->queue_events(&sdlevent, 1); + }); } }; @@ -810,13 +814,12 @@ public: { sdl_input_module::input_init(machine); - static int event_types[] = { - static_cast<int>(SDL_KEYDOWN), - static_cast<int>(SDL_KEYUP), - static_cast<int>(SDL_TEXTINPUT) - }; + static int const event_types[] = { + int(SDL_KEYDOWN), + int(SDL_KEYUP), + int(SDL_TEXTINPUT) }; - sdl_event_manager::instance().subscribe(event_types, std::size(event_types), this); + sdl_event_manager::instance().subscribe(event_types, this); // Read our keymap and store a pointer to our table m_key_trans_table = sdlinput_read_keymap(machine); @@ -826,7 +829,7 @@ public: osd_printf_verbose("Keyboard: Start initialization\n"); // SDL only has 1 keyboard add it now - auto &devinfo = devicelist()->create_device<sdl_keyboard_device>(machine, "System keyboard", "System keyboard", *this); + auto &devinfo = devicelist().create_device<sdl_keyboard_device>(machine, "System keyboard", "System keyboard", *this); // populate it for (int keynum = 0; local_table[keynum].mame_key != ITEM_ID_INVALID; keynum++) @@ -942,19 +945,18 @@ public: { sdl_input_module::input_init(machine); - static int event_types[] = { - static_cast<int>(SDL_MOUSEMOTION), - static_cast<int>(SDL_MOUSEBUTTONDOWN), - static_cast<int>(SDL_MOUSEBUTTONUP), - static_cast<int>(SDL_MOUSEWHEEL) - }; + static int const event_types[] = { + int(SDL_MOUSEMOTION), + int(SDL_MOUSEBUTTONDOWN), + int(SDL_MOUSEBUTTONUP), + int(SDL_MOUSEWHEEL) }; - sdl_event_manager::instance().subscribe(event_types, std::size(event_types), this); + sdl_event_manager::instance().subscribe(event_types, this); osd_printf_verbose("Mouse: Start initialization\n"); // SDL currently only supports one mouse - auto &devinfo = devicelist()->create_device<sdl_mouse_device>(machine, "System mouse", "System mouse", *this); + auto &devinfo = devicelist().create_device<sdl_mouse_device>(machine, "System mouse", "System mouse", *this); // add the axes devinfo.device()->add_item("X", ITEM_ID_XAXIS, generic_axis_get_state<std::int32_t>, &devinfo.mouse.lX); @@ -981,12 +983,15 @@ void devmap_register(device_map_t &devmap, int physical_idx, const std::string & auto entry = std::find_if( std::begin(devmap.map), std::end(devmap.map), - [&name] (auto &item) { return (item.name == name) && (item.physical < 0); }); + [&name] (auto const &item) { return (item.name == name) && (item.physical < 0); }); // If we didn't find it by name, find the first free slot if (entry == std::end(devmap.map)) { - entry = std::find_if(std::begin(devmap.map), std::end(devmap.map), [] (auto &item) { return item.name.empty(); }); + entry = std::find_if( + std::begin(devmap.map), + std::end(devmap.map), + [] (auto const &item) { return item.name.empty(); }); } if (entry != std::end(devmap.map)) @@ -1054,13 +1059,12 @@ public: char tempname[512]; - m_sixaxis_mode = downcast<const sdl_options*>(options())->sixaxis(); + m_sixaxis_mode = downcast<const sdl_options *>(options())->sixaxis(); devmap_init(machine, &m_joy_map, SDLOPTION_JOYINDEX, 8, "Joystick mapping"); osd_printf_verbose("Joystick: Start initialization\n"); - int physical_stick; - for (physical_stick = 0; physical_stick < SDL_NumJoysticks(); physical_stick++) + for (int physical_stick = 0; physical_stick < SDL_NumJoysticks(); physical_stick++) { std::string joy_name = remove_spaces(SDL_JoystickNameForIndex(physical_stick)); devmap_register(m_joy_map, physical_stick, joy_name); @@ -1073,28 +1077,40 @@ public: if (!devinfo) continue; - physical_stick = m_joy_map.map[stick].physical; - SDL_Joystick *joy = SDL_JoystickOpen(physical_stick); + int const physical_stick = m_joy_map.map[stick].physical; + SDL_Joystick *const joy = SDL_JoystickOpen(physical_stick); SDL_JoystickGUID guid = SDL_JoystickGetGUID(joy); char guid_str[256]; guid_str[0] = '\0'; - SDL_JoystickGetGUIDString(guid, guid_str, sizeof(guid_str)-1); + SDL_JoystickGetGUIDString(guid, guid_str, sizeof(guid_str) - 1); devinfo->sdl_state.device = joy; devinfo->sdl_state.joystick_id = SDL_JoystickInstanceID(joy); devinfo->sdl_state.hapdevice = SDL_HapticOpenFromJoystick(joy); - - osd_printf_verbose("Joystick: %s [GUID %s]\n", SDL_JoystickNameForIndex(physical_stick), guid_str); - osd_printf_verbose("Joystick: ... %d axes, %d buttons %d hats %d balls\n", SDL_JoystickNumAxes(joy), SDL_JoystickNumButtons(joy), SDL_JoystickNumHats(joy), SDL_JoystickNumBalls(joy)); +#if SDL_VERSION_ATLEAST(2, 0, 14) + char const *const serial = SDL_JoystickGetSerial(joy); + if (serial) + devinfo->sdl_state.serial = serial; + else +#endif // SDL_VERSION_ATLEAST(2, 0, 14) + devinfo->sdl_state.serial = std::nullopt; + + osd_printf_verbose("Joystick: %s [GUID %s] Vendor ID %04X, Product ID %04X, Revision %04X\n", + SDL_JoystickNameForIndex(physical_stick), + guid_str, + SDL_JoystickGetVendor(joy), + SDL_JoystickGetProduct(joy), + SDL_JoystickGetProductVersion(joy)); + osd_printf_verbose("Joystick: ... %d axes, %d buttons %d hats %d balls\n", + SDL_JoystickNumAxes(joy), + SDL_JoystickNumButtons(joy), + SDL_JoystickNumHats(joy), + SDL_JoystickNumBalls(joy)); osd_printf_verbose("Joystick: ... Physical id %d mapped to logical id %d\n", physical_stick, stick + 1); - if (devinfo->sdl_state.hapdevice != nullptr) - { + if (devinfo->sdl_state.hapdevice) osd_printf_verbose("Joystick: ... Has haptic capability\n"); - } else - { osd_printf_verbose("Joystick: ... Does not have haptic capability\n"); - } // loop over all axes for (int axis = 0; axis < SDL_JoystickNumAxes(joy); axis++) @@ -1108,7 +1124,7 @@ public: else itemid = ITEM_ID_OTHER_AXIS_ABSOLUTE; - snprintf(tempname, sizeof(tempname), "A%d %s", axis, devinfo->name().c_str()); + snprintf(tempname, sizeof(tempname), "A%d", axis + 1); devinfo->device()->add_item(tempname, itemid, generic_axis_get_state<std::int32_t>, &devinfo->joystick.axes[axis]); } @@ -1128,7 +1144,7 @@ public: else itemid = ITEM_ID_OTHER_SWITCH; - snprintf(tempname, sizeof(tempname), "button %d", button); + snprintf(tempname, sizeof(tempname), "Button %d", button + 1); devinfo->device()->add_item(tempname, itemid, generic_button_get_state<std::int32_t>, &devinfo->joystick.buttons[button]); } @@ -1137,16 +1153,16 @@ public: { input_item_id itemid; - snprintf(tempname, sizeof(tempname), "hat %d Up", hat); + snprintf(tempname, sizeof(tempname), "Hat %d Up", hat + 1); itemid = (input_item_id)((hat < INPUT_MAX_HATS) ? ITEM_ID_HAT1UP + 4 * hat : ITEM_ID_OTHER_SWITCH); devinfo->device()->add_item(tempname, itemid, generic_button_get_state<std::int32_t>, &devinfo->joystick.hatsU[hat]); - snprintf(tempname, sizeof(tempname), "hat %d Down", hat); + snprintf(tempname, sizeof(tempname), "Hat %d Down", hat + 1); itemid = (input_item_id)((hat < INPUT_MAX_HATS) ? ITEM_ID_HAT1DOWN + 4 * hat : ITEM_ID_OTHER_SWITCH); devinfo->device()->add_item(tempname, itemid, generic_button_get_state<std::int32_t>, &devinfo->joystick.hatsD[hat]); - snprintf(tempname, sizeof(tempname), "hat %d Left", hat); + snprintf(tempname, sizeof(tempname), "Hat %d Left", hat + 1); itemid = (input_item_id)((hat < INPUT_MAX_HATS) ? ITEM_ID_HAT1LEFT + 4 * hat : ITEM_ID_OTHER_SWITCH); devinfo->device()->add_item(tempname, itemid, generic_button_get_state<std::int32_t>, &devinfo->joystick.hatsL[hat]); - snprintf(tempname, sizeof(tempname), "hat %d Right", hat); + snprintf(tempname, sizeof(tempname), "Hat %d Right", hat + 1); itemid = (input_item_id)((hat < INPUT_MAX_HATS) ? ITEM_ID_HAT1RIGHT + 4 * hat : ITEM_ID_OTHER_SWITCH); devinfo->device()->add_item(tempname, itemid, generic_button_get_state<std::int32_t>, &devinfo->joystick.hatsR[hat]); } @@ -1161,46 +1177,90 @@ public: else itemid = ITEM_ID_OTHER_AXIS_RELATIVE; - snprintf(tempname, sizeof(tempname), "R%d %s", ball * 2, devinfo->name().c_str()); + snprintf(tempname, sizeof(tempname), "R%d X", ball + 1); devinfo->device()->add_item(tempname, (input_item_id)itemid, generic_axis_get_state<std::int32_t>, &devinfo->joystick.balls[ball * 2]); - snprintf(tempname, sizeof(tempname), "R%d %s", ball * 2 + 1, devinfo->name().c_str()); + snprintf(tempname, sizeof(tempname), "R%d Y", ball + 1); devinfo->device()->add_item(tempname, (input_item_id)(itemid + 1), generic_axis_get_state<std::int32_t>, &devinfo->joystick.balls[ball * 2 + 1]); } } - static int event_types[] = { - static_cast<int>(SDL_JOYAXISMOTION), - static_cast<int>(SDL_JOYBALLMOTION), - static_cast<int>(SDL_JOYHATMOTION), - static_cast<int>(SDL_JOYBUTTONDOWN), - static_cast<int>(SDL_JOYBUTTONUP) - }; + static int const event_types[] = { + int(SDL_JOYAXISMOTION), + int(SDL_JOYBALLMOTION), + int(SDL_JOYHATMOTION), + int(SDL_JOYBUTTONDOWN), + int(SDL_JOYBUTTONUP), + int(SDL_JOYDEVICEADDED), + int(SDL_JOYDEVICEREMOVED) }; - sdl_event_manager::instance().subscribe(event_types, std::size(event_types), this); + sdl_event_manager::instance().subscribe(event_types, this); osd_printf_verbose("Joystick: End initialization\n"); } virtual void handle_event(SDL_Event &sdlevent) override { - // Figure out which joystick this event id destined for - auto target_device = std::find_if( - devicelist()->begin(), - devicelist()->end(), - [&sdlevent] (auto &device) + if (SDL_JOYDEVICEADDED == sdlevent.type) + { + SDL_Joystick *const joy = SDL_JoystickOpen(sdlevent.jdevice.which); + if (joy) + { + SDL_JoystickGUID guid = SDL_JoystickGetGUID(joy); + char guid_str[256]; + guid_str[0] = '\0'; + SDL_JoystickGetGUIDString(guid, guid_str, sizeof(guid_str) - 1); + char const *serial = nullptr; +#if SDL_VERSION_ATLEAST(2, 0, 14) + serial = SDL_JoystickGetSerial(joy); +#endif + auto target_device = std::find_if( + devicelist().begin(), + devicelist().end(), + [&guid_str, &serial] (auto const &device) + { + auto &devinfo = downcast<sdl_joystick_device &>(*device); + return + !devinfo.sdl_state.device && + (devinfo.id() == guid_str) && + ((serial && devinfo.sdl_state.serial && (*devinfo.sdl_state.serial == serial)) || (!serial && !devinfo.sdl_state.serial)); + }); + if (devicelist().end() != target_device) { - std::unique_ptr<device_info> &ptr = device; - return downcast<sdl_joystick_device*>(ptr.get())->sdl_state.joystick_id == sdlevent.jdevice.which; - }); - - // If we find a matching joystick, dispatch the event to the joystick - if (target_device != devicelist()->end()) + auto &devinfo = downcast<sdl_joystick_device &>(**target_device); + devinfo.sdl_state.device = joy; + devinfo.sdl_state.joystick_id = SDL_JoystickInstanceID(joy); + devinfo.sdl_state.hapdevice = SDL_HapticOpenFromJoystick(joy); + osd_printf_verbose("Joystick: %s [GUID %s] reconnected\n", devinfo.name(), guid_str); + } + else + { + SDL_JoystickClose(joy); + } + } + } + else { - downcast<sdl_joystick_device*>((*target_device).get())->queue_events(&sdlevent, 1); + // Figure out which joystick this event id destined for + sdl_joystick_device *const target_device = find_joystick(sdlevent.jdevice.which); // FIXME: this depends on SDL_JoystickID being the same size as Sint32 + + // If we find a matching joystick, dispatch the event to the joystick + if (target_device) + target_device->queue_events(&sdlevent, 1); } } private: + sdl_joystick_device *find_joystick(SDL_JoystickID instance) + { + for (auto &ptr : devicelist()) + { + sdl_joystick_device *const device = downcast<sdl_joystick_device *>(ptr.get()); + if (device->sdl_state.device && (device->sdl_state.joystick_id == instance)) + return device; + } + return nullptr; + } + sdl_joystick_device *create_joystick_device(running_machine &machine, device_map_t *devmap, int index, input_device_class devclass) { char tempname[20]; @@ -1215,16 +1275,16 @@ private: { snprintf(tempname, std::size(tempname), "NC%d", index); m_sixaxis_mode - ? devicelist()->create_device<sdl_sixaxis_joystick_device>(machine, tempname, guid_str, *this) - : devicelist()->create_device<sdl_joystick_device>(machine, tempname, guid_str, *this); + ? devicelist().create_device<sdl_sixaxis_joystick_device>(machine, tempname, guid_str, *this) + : devicelist().create_device<sdl_joystick_device>(machine, tempname, guid_str, *this); } return nullptr; } return m_sixaxis_mode - ? &devicelist()->create_device<sdl_sixaxis_joystick_device>(machine, std::string(devmap->map[index].name), guid_str, *this) - : &devicelist()->create_device<sdl_joystick_device>(machine, std::string(devmap->map[index].name), guid_str, *this); + ? &devicelist().create_device<sdl_sixaxis_joystick_device>(machine, std::string(devmap->map[index].name), guid_str, *this) + : &devicelist().create_device<sdl_joystick_device>(machine, std::string(devmap->map[index].name), guid_str, *this); } }; diff --git a/src/osd/modules/input/input_sdlcommon.cpp b/src/osd/modules/input/input_sdlcommon.cpp index 92e3653e4d1..1f84e28f2f6 100644 --- a/src/osd/modules/input/input_sdlcommon.cpp +++ b/src/osd/modules/input/input_sdlcommon.cpp @@ -267,7 +267,7 @@ void sdl_osd_interface::release_keys() { auto keybd = dynamic_cast<input_module_base*>(m_keyboard_input); if (keybd != nullptr) - keybd->devicelist()->reset_devices(); + keybd->devicelist().reset_devices(); } bool sdl_osd_interface::should_hide_mouse() diff --git a/src/osd/modules/input/input_sdlcommon.h b/src/osd/modules/input/input_sdlcommon.h index 030a8ca4bd7..74b12a875ba 100644 --- a/src/osd/modules/input/input_sdlcommon.h +++ b/src/osd/modules/input/input_sdlcommon.h @@ -8,40 +8,17 @@ // //============================================================ -#ifndef INPUT_SDLCOMMON_H_ -#define INPUT_SDLCOMMON_H_ +#ifndef MAME_OSD_INPUT_INPUT_SDLCOMMON_H +#define MAME_OSD_INPUT_INPUT_SDLCOMMON_H + +#pragma once -#include <unordered_map> #include <algorithm> +#include <unordered_map> #define MAX_DEVMAP_ENTRIES 16 #define SDL_MODULE_EVENT_BUFFER_SIZE 5 -// state information for a keyboard -struct keyboard_state -{ - int32_t state[0x3ff]; // must be int32_t! - int8_t oldkey[MAX_KEYS]; - int8_t currkey[MAX_KEYS]; -}; - -// state information for a mouse -struct mouse_state -{ - int32_t lX, lY; - int32_t buttons[MAX_BUTTONS]; -}; - - -// state information for a joystick; DirectInput state must be first element -struct joystick_state -{ - SDL_Joystick *device; - int32_t axes[MAX_AXES]; - int32_t buttons[MAX_BUTTONS]; - int32_t hatsU[MAX_HATS], hatsD[MAX_HATS], hatsL[MAX_HATS], hatsR[MAX_HATS]; - int32_t balls[MAX_AXES]; -}; struct device_map_t { @@ -79,15 +56,14 @@ public: { } - void subscribe(int* event_types, int num_event_types, TSubscriber *subscriber) + template <size_t N> + void subscribe(int const (&event_types)[N], TSubscriber *subscriber) { std::lock_guard<std::mutex> scope_lock(m_lock); // Add the subscription - for (int i = 0; i < num_event_types; i++) - { - m_subscription_index.emplace(event_types[i], subscriber); - } + for (int i : event_types) + m_subscription_index.emplace(i, subscriber); } void unsubscribe(TSubscriber *subscriber) @@ -199,4 +175,4 @@ static inline void devmap_init(running_machine &machine, device_map_t *devmap, c } } -#endif +#endif // MAME_OSD_INPUT_INPUT_SDLCOMMON_H diff --git a/src/osd/modules/input/input_win32.cpp b/src/osd/modules/input/input_win32.cpp index ff154140f7f..a02b2ee426e 100644 --- a/src/osd/modules/input/input_win32.cpp +++ b/src/osd/modules/input/input_win32.cpp @@ -74,7 +74,7 @@ public: virtual void input_init(running_machine &machine) override { // Add a single win32 keyboard device that we'll monitor using Win32 - auto &devinfo = devicelist()->create_device<win32_keyboard_device>(machine, "Win32 Keyboard 1", "Win32 Keyboard 1", *this); + auto &devinfo = devicelist().create_device<win32_keyboard_device>(machine, "Win32 Keyboard 1", "Win32 Keyboard 1", *this); keyboard_trans_table &table = keyboard_trans_table::instance(); @@ -106,7 +106,7 @@ public: case INPUT_EVENT_KEYDOWN: case INPUT_EVENT_KEYUP: args = static_cast<KeyPressEventArgs*>(eventdata); - devicelist()->for_each_device([args](auto device) + devicelist().for_each_device([args](auto device) { auto keyboard = dynamic_cast<win32_keyboard_device*>(device); if (keyboard != nullptr) @@ -206,7 +206,7 @@ public: return; // allocate a device - auto &devinfo = devicelist()->create_device<win32_mouse_device>(machine, "Win32 Mouse 1", "Win32 Mouse 1", *this); + auto &devinfo = devicelist().create_device<win32_mouse_device>(machine, "Win32 Mouse 1", "Win32 Mouse 1", *this); // populate the axes for (int axisnum = 0; axisnum < 2; axisnum++) @@ -235,7 +235,7 @@ public: return false; auto args = static_cast<MouseButtonEventArgs*>(eventdata); - devicelist()->for_each_device([args](auto device) + devicelist().for_each_device([args](auto device) { auto mouse = dynamic_cast<win32_mouse_device*>(device); if (mouse != nullptr) @@ -268,7 +268,7 @@ public: m_lightgun_shared_axis_mode = downcast<windows_options &>(machine.options()).dual_lightgun(); // Since we are about to be added to the list, the current size is the zero-based index of where we will be - m_gun_index = downcast<wininput_module&>(module).devicelist()->size(); + m_gun_index = downcast<wininput_module&>(module).devicelist().size(); } void poll() override @@ -391,7 +391,7 @@ public: static const char *const gun_names[] = { "Win32 Gun 1", "Win32 Gun 2" }; // allocate a device - auto &devinfo = devicelist()->create_device<win32_lightgun_device>(machine, gun_names[gunnum], gun_names[gunnum], *this); + auto &devinfo = devicelist().create_device<win32_lightgun_device>(machine, gun_names[gunnum], gun_names[gunnum], *this); // populate the axes for (int axisnum = 0; axisnum < 2; axisnum++) @@ -421,7 +421,7 @@ public: return false; auto args = static_cast<MouseButtonEventArgs*>(eventdata); - devicelist()->for_each_device([args](auto device) + devicelist().for_each_device([args](auto device) { auto lightgun = dynamic_cast<win32_lightgun_device*>(device); if (lightgun != nullptr) diff --git a/src/osd/modules/input/input_x11.cpp b/src/osd/modules/input/input_x11.cpp index e7481d6470e..0657e99fd2d 100644 --- a/src/osd/modules/input/input_x11.cpp +++ b/src/osd/modules/input/input_x11.cpp @@ -538,9 +538,9 @@ public: osd_printf_verbose("Device %i: Registered %i events.\n", static_cast<int>(info->id), events_registered); // register ourself to handle events from event manager - int event_types[] = { motion_type, button_press_type, button_release_type }; + int const event_types[] = { motion_type, button_press_type, button_release_type }; osd_printf_verbose("Events types to register: motion:%d, press:%d, release:%d\n", motion_type, button_press_type, button_release_type); - x11_event_manager::instance().subscribe(event_types, std::size(event_types), this); + x11_event_manager::instance().subscribe(event_types, this); } osd_printf_verbose("Lightgun: End initialization\n"); @@ -582,14 +582,14 @@ public: } // Figure out which lightgun this event id destined for - auto target_device = std::find_if(devicelist()->begin(), devicelist()->end(), [deviceid](auto &device) + auto target_device = std::find_if(devicelist().begin(), devicelist().end(), [deviceid](auto &device) { std::unique_ptr<device_info> &ptr = device; return downcast<x11_input_device*>(ptr.get())->x11_state.deviceid == deviceid; }); // If we find a matching lightgun, dispatch the event to the lightgun - if (target_device != devicelist()->end()) + if (target_device != devicelist().end()) { downcast<x11_input_device*>((*target_device).get())->queue_events(&xevent, 1); } @@ -604,7 +604,7 @@ private: { char tempname[20]; snprintf(tempname, std::size(tempname), "NC%d", index); - return &devicelist()->create_device<x11_lightgun_device>(machine, tempname, tempname, *this); + return &devicelist().create_device<x11_lightgun_device>(machine, tempname, tempname, *this); } else { @@ -612,7 +612,7 @@ private: } } - return &devicelist()->create_device<x11_lightgun_device>(machine, std::string(m_lightgun_map.map[index].name), std::string(m_lightgun_map.map[index].name), *this); + return &devicelist().create_device<x11_lightgun_device>(machine, std::string(m_lightgun_map.map[index].name), std::string(m_lightgun_map.map[index].name), *this); } void add_lightgun_buttons(XAnyClassPtr first_info_class, int num_classes, x11_lightgun_device &devinfo) const diff --git a/src/osd/modules/input/input_xinput.cpp b/src/osd/modules/input/input_xinput.cpp index 8c75240abf7..152e16b4e81 100644 --- a/src/osd/modules/input/input_xinput.cpp +++ b/src/osd/modules/input/input_xinput.cpp @@ -186,7 +186,7 @@ xinput_joystick_device * xinput_api_helper::create_xinput_device(running_machine snprintf(device_name, sizeof(device_name), "XInput Player %u", index + 1); // allocate the device object - auto &devinfo = module.devicelist()->create_device<xinput_joystick_device>(machine, device_name, device_name, module, shared_from_this()); + auto &devinfo = module.devicelist().create_device<xinput_joystick_device>(machine, device_name, device_name, module, shared_from_this()); // Set the player ID devinfo.xinput_state.player_index = index; |