diff options
author | hap <happppp@users.noreply.github.com> | 2020-08-18 21:34:40 +0200 |
---|---|---|
committer | hap <happppp@users.noreply.github.com> | 2020-08-18 21:34:55 +0200 |
commit | a93e0407b9033c6e75dd7da8088c9f69e7f6bacd (patch) | |
tree | f828a9ce9359bfdb36e18e04c1016f29bea00ee2 | |
parent | 88415d53e86b74f0173b4146e8f42d91efb0ffb8 (diff) |
odyssey2: add cartridge B pin
-rw-r--r-- | hash/g7400.xml | 32 | ||||
-rw-r--r-- | hash/odyssey2.xml | 9 | ||||
-rw-r--r-- | src/devices/bus/odyssey2/slot.cpp | 37 | ||||
-rw-r--r-- | src/devices/bus/odyssey2/slot.h | 7 | ||||
-rw-r--r-- | src/devices/bus/odyssey2/voice.h | 1 | ||||
-rw-r--r-- | src/devices/cpu/mcs48/mcs48.cpp | 2 | ||||
-rw-r--r-- | src/mame/drivers/odyssey2.cpp | 33 |
7 files changed, 86 insertions, 35 deletions
diff --git a/hash/g7400.xml b/hash/g7400.xml index f37234c46de..8c8b135b14d 100644 --- a/hash/g7400.xml +++ b/hash/g7400.xml @@ -50,6 +50,7 @@ The C7420 Home Computer Module contains a Z80, 16K RAM and 16K ROM. <info name="serial" value="58"/> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rally" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="0x4000"> <rom name="air battle (europe).bin" offset="0x0000" size="0x3000" crc="d94d4109" sha1="66837bbd0b9df12c89215f533a1ec8b5a42d5610"/> <rom offset="0x1000" size="0x3000" loadflag="reload" /> @@ -63,6 +64,7 @@ The C7420 Home Computer Module contains a Z80, 16K RAM and 16K ROM. <publisher>Jopac</publisher> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rom" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="8192"> <rom name="basket - bowling + (france).bin" size="8192" crc="b5fb1416" sha1="c341ed24346546b75de2ab24af1a9223ca2d1aac"/> </dataarea> @@ -75,6 +77,7 @@ The C7420 Home Computer Module contains a Z80, 16K RAM and 16K ROM. <publisher>Philips</publisher> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rom" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="8192"> <rom name="tenpin bowling - basketball (europe).bin" size="8192" crc="e5fb4260" sha1="29d5c9b252e65d257f1472e343039ed8c47eeb05"/> </dataarea> @@ -89,6 +92,7 @@ The C7420 Home Computer Module contains a Z80, 16K RAM and 16K ROM. <info name="serial" value="JXA D03"/> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rom" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="8192"> <rom name="billiard americain (france).bin" size="8192" crc="4cec1404" sha1="004ea921b691db6b310f5b51c495df9b86be3aa8"/> </dataarea> @@ -102,6 +106,7 @@ The C7420 Home Computer Module contains a Z80, 16K RAM and 16K ROM. <info name="programmer" value="Ed Averett"/> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rom" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="8192"> <rom name="billiard (europe).bin" size="8192" crc="3c949a57" sha1="4c7f1dc569e9abe829e36dbe42d91d39419bfd60"/> </dataarea> @@ -114,6 +119,7 @@ The C7420 Home Computer Module contains a Z80, 16K RAM and 16K ROM. <publisher>Philips</publisher> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rom" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="8192"> <rom name="clay pigeon (europe).bin" size="8192" crc="6fabcb7e" sha1="3f6dbef6bf13427a52f4f7324d9c33cfce52adb0"/> </dataarea> @@ -126,6 +132,7 @@ The C7420 Home Computer Module contains a Z80, 16K RAM and 16K ROM. <publisher>Philips</publisher> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rom" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="8192"> <rom name="clay pigeon (europe, alt).bin" size="8192" crc="7c989567" sha1="431547d04d5c57b0730b1136f8e68b0ac44b755f"/> </dataarea> @@ -138,6 +145,7 @@ The C7420 Home Computer Module contains a Z80, 16K RAM and 16K ROM. <publisher>Philips</publisher> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rom" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="8192"> <rom name="cosmic conflict (europe).bin" size="8192" crc="a8dbed92" sha1="99932be5496a0daa7dffc70c7a3ab85bfa726043"/> </dataarea> @@ -150,6 +158,7 @@ The C7420 Home Computer Module contains a Z80, 16K RAM and 16K ROM. <publisher>Radiola</publisher> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rom" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="8192"> <rom name="demon attack (france).bin" size="8192" crc="50af9d45" sha1="cfd1337c8d5a40f2f4e1ab49158a8963764919da"/> </dataarea> @@ -162,6 +171,7 @@ The C7420 Home Computer Module contains a Z80, 16K RAM and 16K ROM. <publisher>Jopac</publisher> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rom" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="8192"> <rom name="exojet (france).bin" size="8192" crc="cfca6f39" sha1="8aafcd055a2ef45c3d85804c8a3ea04d9a9732ab"/> </dataarea> @@ -174,6 +184,7 @@ The C7420 Home Computer Module contains a Z80, 16K RAM and 16K ROM. <publisher>Jopac</publisher> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rom" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="8192"> <rom name="billard electrique (france).bin" size="8192" crc="ac5c74e6" sha1="215439c1044b93888b71bd6a210ebfda93d97c22"/> </dataarea> @@ -186,6 +197,7 @@ The C7420 Home Computer Module contains a Z80, 16K RAM and 16K ROM. <publisher>Philips</publisher> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rom" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="8192"> <rom name="flipper (europe).bin" size="8192" crc="2fce9245" sha1="6510b54e3e9bf9bc7ae558d1d16fa73294701ddb"/> </dataarea> @@ -198,6 +210,7 @@ The C7420 Home Computer Module contains a Z80, 16K RAM and 16K ROM. <publisher>Philips</publisher> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rom" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="8192"> <rom name="freedom fighters (europe).bin" size="8192" crc="1931f5c5" sha1="3f8d6cd5bed5244b400c69640065c77ec103a6cd"/> </dataarea> @@ -210,6 +223,7 @@ The C7420 Home Computer Module contains a Z80, 16K RAM and 16K ROM. <publisher>Radiola</publisher> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rom" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="8192"> <rom name="guerre de l'espace (france).bin" size="8192" crc="105231f8" sha1="9220dc32d3bb9225292f3e709d1320b9b1052140"/> </dataarea> @@ -222,6 +236,7 @@ The C7420 Home Computer Module contains a Z80, 16K RAM and 16K ROM. <publisher>Philips</publisher> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rom" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="8192"> <rom name="killer bees (europe).bin" size="8192" crc="dee70b33" sha1="9253586337917bda0b7c43dbb251999b6c974f30"/> </dataarea> @@ -234,6 +249,7 @@ The C7420 Home Computer Module contains a Z80, 16K RAM and 16K ROM. <publisher>Radiola</publisher> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rom" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="8192"> <rom name="la ruche infernale (france).bin" size="8192" crc="20e2f7be" sha1="34f91468bf42b26eb237af342164043c16d173ca"/> </dataarea> @@ -246,6 +262,7 @@ The C7420 Home Computer Module contains a Z80, 16K RAM and 16K ROM. <publisher>Radiola</publisher> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rom" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="8192"> <rom name="le tresor englouti (france).bin" size="8192" crc="b2f0f0b4" sha1="c0fcaef6a18026e0acc04c3d48443d768043cb03"/> </dataarea> @@ -259,6 +276,7 @@ The C7420 Home Computer Module contains a Z80, 16K RAM and 16K ROM. <info name="serial" value="54"/> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rom" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="8192"> <rom name="loony balloon (europe).bin" size="8192" crc="b932d584" sha1="8dd1cba7ce6622aaf5e1b432ab8d47e395d211f2"/> </dataarea> @@ -272,6 +290,7 @@ The C7420 Home Computer Module contains a Z80, 16K RAM and 16K ROM. <info name="serial" value="55"/> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rally" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="0x4000"> <rom name="neutron star (europe).bin" offset="0x0000" size="0x3000" crc="be11157c" sha1="fde3e0791b9cbef91a8462764ebf09a457ffe038"/> <rom offset="0x1000" size="0x3000" loadflag="reload" /> @@ -286,6 +305,7 @@ The C7420 Home Computer Module contains a Z80, 16K RAM and 16K ROM. <info name="serial" value="53"/> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rom" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="8192"> <rom name="nightmare (europe).bin" size="8192" crc="26b0ff5b" sha1="c8988f13c2af7632de6ef326ed617279bf6c8221"/> </dataarea> @@ -298,6 +318,7 @@ The C7420 Home Computer Module contains a Z80, 16K RAM and 16K ROM. <publisher>Philips</publisher> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rom" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="8192"> <rom name="pickaxe pete (europe).bin" size="8192" crc="b2ffb353" sha1="182829b4cd5184ab3705d26f75e3d8c497b5abf6"/> </dataarea> @@ -310,6 +331,7 @@ The C7420 Home Computer Module contains a Z80, 16K RAM and 16K ROM. <publisher>Philips</publisher> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rom" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="8192"> <rom name="race - spin-out - cryptogram (europe).bin" size="8192" crc="ee3ee642" sha1="69a73208c0c0a6d1b879e62d0ccf3a5a534510bd"/> </dataarea> @@ -322,6 +344,7 @@ The C7420 Home Computer Module contains a Z80, 16K RAM and 16K ROM. <publisher>Jopac</publisher> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rom" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="8192"> <rom name="course de voitures - autodrome - cryptogramme (france).bin" size="8192" crc="9bc04ebb" sha1="e69e524eba10976310333787eafef1d18da6d568"/> </dataarea> @@ -334,6 +357,7 @@ The C7420 Home Computer Module contains a Z80, 16K RAM and 16K ROM. <publisher>Philips</publisher> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rom" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="8192"> <rom name="satellite attack (europe).bin" size="8192" crc="b4735e6b" sha1="8bec213886d026040ed2037f01e8e9f81fa395b9"/> </dataarea> @@ -346,6 +370,7 @@ The C7420 Home Computer Module contains a Z80, 16K RAM and 16K ROM. <publisher>Philips</publisher> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rom" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="8192"> <rom name="stone sling (europe).bin" size="8192" crc="2391c2fb" sha1="d358fcc6a0fa6469d7063114aa0dc143af14e3e9"/> </dataarea> @@ -358,6 +383,7 @@ The C7420 Home Computer Module contains a Z80, 16K RAM and 16K ROM. <publisher>Philips</publisher> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rom" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="8192"> <rom name="terrahawks (europe).bin" size="8192" crc="764894a1" sha1="0c01df9799b6d0235fef3c86fec1beac5b0b2d74"/> </dataarea> @@ -375,6 +401,7 @@ The C7420 Home Computer Module contains a Z80, 16K RAM and 16K ROM. <publisher>Philips</publisher> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rom" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="8192"> <rom name="flashpoint (usa)(proto)(pal conversion).bin" size="8192" crc="06861a9c" sha1="6810ccc1508244216860271417a866618a731ae2"/> </dataarea> @@ -388,6 +415,7 @@ The C7420 Home Computer Module contains a Z80, 16K RAM and 16K ROM. <info name="serial" value="59"/> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rally" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="0x4000"> <rom name="helicopter rescue (europe).bin" size="0x4000" crc="c4134df8" sha1="7369a2d3fb81ddc4c8086bbcd245c11ea7aaa331"/> </dataarea> @@ -401,6 +429,7 @@ The C7420 Home Computer Module contains a Z80, 16K RAM and 16K ROM. <info name="serial" value="C7420"/> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_homecomp" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="0x4800"> <rom name="z80_c7420.bin" offset="0x0000" size="0x4000" crc="939f0e4c" sha1="24c334ba4321f3dd30ac659d35e43f74283ad93b" /> <rom name="vp_c7420.bin" offset="0x4000" size="0x0800" crc="8e824b98" sha1="60dfc1eea93c25f30d25e549f32f837e22735224" /> @@ -414,6 +443,7 @@ The C7420 Home Computer Module contains a Z80, 16K RAM and 16K ROM. <publisher>Radiola</publisher> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rom" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="8192"> <rom name="moto-crash (france).bin" size="8192" crc="68560dc7" sha1="f6de2f95e5cf4849a4d7071b1a470c3ef0634e5f"/> </dataarea> @@ -428,6 +458,7 @@ The C7420 Home Computer Module contains a Z80, 16K RAM and 16K ROM. <info name="serial" value="57"/> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rom" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="8192"> <rom name="norseman (europe).bin" size="8192" crc="a75c42f8" sha1="8e8fe23225631eef673517f3e2970eade15b7a5c"/> </dataarea> @@ -440,6 +471,7 @@ The C7420 Home Computer Module contains a Z80, 16K RAM and 16K ROM. <publisher>Philips</publisher> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rally" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="0x4000"> <rom name="trans american rally (europe).bin" size="0x4000" crc="0d2d721d" sha1="be8a9f2aa66acb4f5e288d1a77afada9565b530a"/> </dataarea> diff --git a/hash/odyssey2.xml b/hash/odyssey2.xml index 54fb1258452..cf7d5f68894 100644 --- a/hash/odyssey2.xml +++ b/hash/odyssey2.xml @@ -390,6 +390,7 @@ The C7010 Chess Module had a NSC800 CMOS microprocessor, with 2K RAM and 8K ROM. <info name="serial" value="48"/> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rom" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="8192"> <rom name="backgammon (europe).bin" size="8192" crc="9d2c45dc" sha1="bcb420dc1cc6fa5cf13dc46c546145953fb11643" offset="0" /> </dataarea> @@ -529,6 +530,7 @@ The C7010 Chess Module had a NSC800 CMOS microprocessor, with 2K RAM and 8K ROM. <info name="serial" value="56"/> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rom" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="8192"> <rom name="blobbers (europe).bin" size="8192" crc="9d72d4e9" sha1="cae4e1f3ee090ec423aff89102f359b9e14dba41" offset="0" /> </dataarea> @@ -763,7 +765,7 @@ The C7010 Chess Module had a NSC800 CMOS microprocessor, with 2K RAM and 8K ROM. <feature name="slot" value="o2_rom" /> <dataarea name="rom" size="2048"> <rom name="blockout - breakdown (usa, europe).bin" size="2048" crc="fb83171e" sha1="00ef6868724a6826534da620f34dad207fcb3800" offset="0" /> - </dataarea> + </dataarea> </part> </software> @@ -1647,6 +1649,7 @@ The C7010 Chess Module had a NSC800 CMOS microprocessor, with 2K RAM and 8K ROM. <info name="serial" value="50"/> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rom" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="4096"> <rom name="super bee (europe).bin" size="4096" crc="9585d511" sha1="dfcfd9c019773e703aa130bc55f5b2f972ece8f0" offset="0" /> </dataarea> @@ -1659,6 +1662,7 @@ The C7010 Chess Module had a NSC800 CMOS microprocessor, with 2K RAM and 8K ROM. <publisher>Philips</publisher> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rom" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="4096"> <rom name="super bee (brazil).bin" size="4096" crc="02743352" sha1="98c1f3a9726fe1ba880d43f0ba004821c4cbec6c" offset="0" /> </dataarea> @@ -1813,6 +1817,7 @@ The C7010 Chess Module had a NSC800 CMOS microprocessor, with 2K RAM and 8K ROM. <info name="serial" value="49"/> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rom" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="8192"> <rom name="turtles (europe).bin" size="8192" crc="1c750349" sha1="1fdca749675f62212d0b79c5f0911bcabc4e4e11" offset="0" /> </dataarea> @@ -1827,6 +1832,7 @@ The C7010 Chess Module had a NSC800 CMOS microprocessor, with 2K RAM and 8K ROM. <info name="serial" value="AC9446"/> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_rom" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="8192"> <rom name="turtles (usa).bin" size="8192" crc="9e42e766" sha1="ee456305397ecbd54fffa0bb7a894f53976d2a7c" offset="0" /> </dataarea> @@ -1912,6 +1918,7 @@ The C7010 Chess Module had a NSC800 CMOS microprocessor, with 2K RAM and 8K ROM. <info name="programmer" value="Soeren Gust" /> <part name="cart" interface="odyssey_cart"> <feature name="slot" value="o2_ktaa" /> + <feature name="b_pin" value="1" /> <dataarea name="rom" size="12288"> <rom name="ktaa.bin" size="12288" crc="4e2cc6d3" sha1="42ad0c57bd16b7f24c242f60b5c0e9988d8dfba8" offset="0" /> </dataarea> diff --git a/src/devices/bus/odyssey2/slot.cpp b/src/devices/bus/odyssey2/slot.cpp index 417fb3230c1..1e1a9896921 100644 --- a/src/devices/bus/odyssey2/slot.cpp +++ b/src/devices/bus/odyssey2/slot.cpp @@ -55,16 +55,6 @@ void device_o2_cart_interface::rom_alloc(uint32_t size, const char *tag) } -//------------------------------------------------- -// ram_alloc - alloc the space for the ram -//------------------------------------------------- - -void device_o2_cart_interface::ram_alloc(uint32_t size) -{ - m_ram.resize(size); -} - - //************************************************************************** // LIVE DEVICE //************************************************************************** @@ -78,6 +68,7 @@ o2_cart_slot_device::o2_cart_slot_device(const machine_config &mconfig, const ch , device_single_card_slot_interface<device_o2_cart_interface>(mconfig, *this) , m_type(O2_STD) , m_cart(nullptr) + , m_b(0) { } @@ -156,19 +147,23 @@ image_init_result o2_cart_slot_device::call_load() uint32_t size = !loaded_through_softlist() ? length() : get_software_region_length("rom"); m_cart->rom_alloc(size, tag()); - if (!loaded_through_softlist()) - fread(m_cart->get_rom_base(), size); - else - memcpy(m_cart->get_rom_base(), get_software_region("rom"), size); - if (loaded_through_softlist()) { + memcpy(m_cart->get_rom_base(), get_software_region("rom"), size); + const char *pcb_name = get_feature("slot"); if (pcb_name) m_type = o2_get_pcb_id(pcb_name); + + // Videopac+ determines whether the screen should have a border, with a gate connected + // to the cartridge B pin. This way, old Videopac games can still run in full screen. + m_b = bool(strtoul(get_feature("b_pin"), nullptr, 0)) ? 1 : 0; } else + { + fread(m_cart->get_rom_base(), size); m_type = (size == 16384) ? O2_RALLY : O2_STD; + } m_cart->cart_init(); @@ -238,6 +233,18 @@ uint8_t o2_cart_slot_device::io_read(offs_t offset) return 0xff; } +int o2_cart_slot_device::b_read() +{ + if (m_cart) + { + int b = m_cart->b_read(); + const bool override = b != -1; + return override ? b : m_b; + } + else + return 0; +} + #include "bus/odyssey2/rom.h" #include "bus/odyssey2/4in1.h" diff --git a/src/devices/bus/odyssey2/slot.h b/src/devices/bus/odyssey2/slot.h index 419e187ac7a..4571ec4f9fa 100644 --- a/src/devices/bus/odyssey2/slot.h +++ b/src/devices/bus/odyssey2/slot.h @@ -43,15 +43,13 @@ public: virtual void io_write(offs_t offset, uint8_t data) { } virtual uint8_t io_read(offs_t offset) { return 0xff; } virtual DECLARE_READ_LINE_MEMBER(t0_read) { return 0; } + virtual int b_read() { return -1; } virtual void cart_init() { } // called after loading ROM void rom_alloc(uint32_t size, const char *tag); - void ram_alloc(uint32_t size); uint8_t* get_rom_base() { return m_rom; } - uint8_t* get_ram_base() { return &m_ram[0]; } uint32_t get_rom_size() { return m_rom_size; } - uint32_t get_ram_size() { return m_ram.size(); } protected: device_o2_cart_interface(const machine_config &mconfig, device_t &device); @@ -59,7 +57,6 @@ protected: // internal state uint8_t *m_rom; uint32_t m_rom_size; - std::vector<uint8_t> m_ram; }; @@ -108,6 +105,7 @@ public: void io_write(offs_t offset, uint8_t data); uint8_t io_read(offs_t offset); DECLARE_READ_LINE_MEMBER(t0_read) { if (m_cart) return m_cart->t0_read(); else return 0; } + int b_read(); void write_p1(uint8_t data) { if (m_cart) m_cart->write_p1(data); } void write_p2(uint8_t data) { if (m_cart) m_cart->write_p2(data); } @@ -121,6 +119,7 @@ protected: int m_type; device_o2_cart_interface* m_cart; + int m_b; }; // device type definition diff --git a/src/devices/bus/odyssey2/voice.h b/src/devices/bus/odyssey2/voice.h index 981eddeb1dd..54ad23ea76b 100644 --- a/src/devices/bus/odyssey2/voice.h +++ b/src/devices/bus/odyssey2/voice.h @@ -34,6 +34,7 @@ public: virtual void io_write(offs_t offset, u8 data) override; virtual u8 io_read(offs_t offset) override { return (m_subslot->exists()) ? m_subslot->io_read(offset) : 0xff; } virtual DECLARE_READ_LINE_MEMBER(t0_read) override; + virtual int b_read() override { return (m_subslot->exists()) ? m_subslot->b_read() : -1; } protected: // device-level overrides diff --git a/src/devices/cpu/mcs48/mcs48.cpp b/src/devices/cpu/mcs48/mcs48.cpp index 951c9b5e5f6..3e10789f8a6 100644 --- a/src/devices/cpu/mcs48/mcs48.cpp +++ b/src/devices/cpu/mcs48/mcs48.cpp @@ -416,7 +416,7 @@ void mcs48_cpu_device::push_pc_psw() uint8_t sp = m_psw & 0x07; ram_w(8 + 2*sp, m_pc); ram_w(9 + 2*sp, ((m_pc >> 8) & 0x0f) | (m_psw & 0xf0)); - m_psw = (m_psw & 0xf8) | ((sp + 1) & 0x07); + m_psw = (m_psw & 0xf0) | ((sp + 1) & 0x07); } diff --git a/src/mame/drivers/odyssey2.cpp b/src/mame/drivers/odyssey2.cpp index e0cad9d5546..6b12c8e2116 100644 --- a/src/mame/drivers/odyssey2.cpp +++ b/src/mame/drivers/odyssey2.cpp @@ -36,7 +36,7 @@ TODO: - backgamm doesn't draw all the sprites, what causes it? It doesn't seem like it's a 824x bug since it does properly write data in the partial screen updates - 824x screen resolution is not strictly defined, height(243) is correct, but - horizontal overscan differs depending on monitor/tv? + horizontal overscan differs depending on monitor/tv? see syracuse for overscan - 824x on the real console, overlapping characters on eachother will cause glitches (it is used to an advantage in some as-of-yet undumped homebrews) - 8244(NTSC) is not supposed to show characters near the upper border, but @@ -44,19 +44,20 @@ TODO: - 8245(PAL) video timing is not 100% accurate, though vtotal and htotal should be correct - ppp(the tetris game) does not work properly on PAL, is this homebrew NTSC-only, - or is it due to PAL video timing? The game does mid-scanline updates + or is PAL detection going wrong? The game does mid-scanline updates - g7400 helicopt sometimes locks up at the sea level, timing related? - g7400 probably has different video timing too (not same as g7000) - 4in1 and musician are not supposed to work on g7400, but work fine on MAME, - reason they shouldn't work is probably because they write to P2 + caused by bus conflict or because they write to P2? - verify odyssey3 cpu/video clocks - odyssey3 keyboard layout is not the same as g7400, but there is no software to test the scancodes BTANB: - a lot of PAL games have problems on NTSC (the other way around, not so much) -- g7400 games don't look correct on odyssey3: ef934x graphics are placed lower -- Blackjack (Videopac 5) does not work on G7400 +- g7400 games don't look correct on odyssey3 and vice versa: ef934x graphics are + placed lower on odyssey3 +- Blackjack (Videopac 5) does not work on G7400, caused by a removed BIOS routine Plenty games have minor bugs not worth mentioning here. @@ -254,14 +255,18 @@ uint32_t g7400_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, for (int x = clip.min_x; x <= clip.max_x; x++) { - uint16_t d = bitmap.pix16(y, x); + uint16_t d = bitmap.pix16(y, x) & 7; uint16_t e = ef934x_bitmap->pix16(y, x); - // I outputs to CX - bool i2 = !BIT(m_mix_ef934x, e & 0x07); + // i8244 decoder enable is masked with cartridge pin B + bool en = (e & 8) || !m_cart->b_read(); + e &= 7; + + // ef934x decoder output is tied to CX + bool i2 = !BIT(m_mix_ef934x, e); m_i8244->write_cx(x, i2); - if (m_mix_i8244 == 0xff || ((e & 0x08) && BIT(m_mix_i8244, d & 0x07))) + if (en && BIT(m_mix_i8244, d)) { // Use i8245 input bitmap.pix16(y, x) |= lum; @@ -269,7 +274,7 @@ uint32_t g7400_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, else { // Use EF934x input - bitmap.pix16(y, x) = i2 ? e | 0x08 : e & 0x07; + bitmap.pix16(y, x) = e | (i2 ? 8 : 0); } } } @@ -666,7 +671,7 @@ void odyssey2_state::odyssey2(machine_config &config) I8244(config, m_i8244, XTAL(7'159'090) / 2); m_i8244->set_screen("screen"); - m_i8244->set_screen_size(356, 243); + m_i8244->set_screen_size(360, 243); m_i8244->irq_cb().set_inputline(m_maincpu, MCS48_INPUT_IRQ); m_i8244->add_route(ALL_OUTPUTS, "mono", 0.40); @@ -685,7 +690,7 @@ void odyssey2_state::videopac(machine_config &config) // PAL video chip I8245(config.replace(), m_i8244, XTAL(17'734'476) / 5); m_i8244->set_screen("screen"); - m_i8244->set_screen_size(356, 243); + m_i8244->set_screen_size(360, 243); m_i8244->irq_cb().set_inputline(m_maincpu, MCS48_INPUT_IRQ); m_i8244->add_route(ALL_OUTPUTS, "mono", 0.40); @@ -739,7 +744,7 @@ void g7400_state::g7400(machine_config &config) I8245(config, m_i8244, XTAL(8'867'000)/5 * 2); m_i8244->set_screen("screen"); - m_i8244->set_screen_size(356, 243); + m_i8244->set_screen_size(360, 243); m_i8244->irq_cb().set_inputline(m_maincpu, MCS48_INPUT_IRQ); m_i8244->add_route(ALL_OUTPUTS, "mono", 0.40); @@ -758,7 +763,7 @@ void g7400_state::odyssey3(machine_config &config) // NTSC video chip I8244(config.replace(), m_i8244, XTAL(7'159'090) / 2); m_i8244->set_screen("screen"); - m_i8244->set_screen_size(356, 243); + m_i8244->set_screen_size(360, 243); m_i8244->irq_cb().set_inputline(m_maincpu, MCS48_INPUT_IRQ); m_i8244->add_route(ALL_OUTPUTS, "mono", 0.40); |