diff options
45 files changed, 789 insertions, 683 deletions
diff --git a/android-project/app/src/main/AndroidManifest.xml b/android-project/app/src/main/AndroidManifest.xml index 6bd4a141cec..a9bc73b9e6c 100644 --- a/android-project/app/src/main/AndroidManifest.xml +++ b/android-project/app/src/main/AndroidManifest.xml @@ -4,8 +4,8 @@ --> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.mamedev.mame" - android:versionCode="217" - android:versionName="0.217" + android:versionCode="218" + android:versionName="0.218" android:installLocation="auto"> <!-- OpenGL ES 2.0 --> diff --git a/hash/buzztime_cart.xml b/hash/buzztime_cart.xml index 38fd947a6c7..0e9d20c1c5a 100644 --- a/hash/buzztime_cart.xml +++ b/hash/buzztime_cart.xml @@ -1,6 +1,7 @@ <?xml version="1.0"?> <!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> +<!-- Only 4 cartridges were released for this system, all in 'Series 1' --> <softwarelist name="buzztime_cart" description="Cadaco Buzztime Trivia Cartridges"> <software name="s1tv" supported="no"> @@ -23,6 +24,17 @@ <rom name="buzztimeseries1history.bin" size="0x200000" crc="384b0c0e" sha1="c359e69b5c91ba98ebf477aee1bb5f62b721b427"/> </dataarea> </part> - </software> + </software> + + <software name="s1every" supported="no"> + <description>Series 1 - Everything</description> + <year>200?</year> + <publisher>Cadaco</publisher> + <part name="cart" interface="buzztime_cart"> + <dataarea name="rom" size="0x200000"> + <rom name="buzztimeseries1everything.bin" size="0x200000" crc="84acabd9" sha1="cbbda9134bd899a3ec0b91664a3db0f986d5636b"/> + </dataarea> + </part> + </software> </softwarelist> diff --git a/hash/jaguar.xml b/hash/jaguar.xml index 7e65188a3dd..430f6221130 100644 --- a/hash/jaguar.xml +++ b/hash/jaguar.xml @@ -257,7 +257,7 @@ Unreleased (possibly no prototypes exist): </part> </software> - <!-- throws an exception if the Telegames logo isn't skipped, switching items in main menu causes a glitch on the text --> + <!-- switching items in main menu causes a glitch on the text --> <!-- rightmost column of gameplay has odd "overscan" area --> <software name="brutalsp" supported="no"> <description>Brutal Sports Football</description> @@ -719,7 +719,7 @@ Unreleased (possibly no prototypes exist): </part> </software> - <!-- throws an exception off the bat --> + <!-- black screen --> <software name="ruinerp" supported="no"> <description>Ruiner Pinball</description> <year>1995</year> @@ -803,7 +803,7 @@ Unreleased (possibly no prototypes exist): </part> </software> - <!-- throws an exception off the bat --> + <!-- gets to title screen (with wrong GFX width) then hangs --> <software name="spacewar" supported="no"> <description>Space War 2000</description> <year>2001</year> @@ -815,7 +815,7 @@ Unreleased (possibly no prototypes exist): </part> </software> - <!-- throws an exception off the bat --> + <!-- gets to title screen (with wrong GFX width) then hangs --> <software name="spacewarp" cloneof="spacewar" supported="no"> <description>Space War 2000 (Prototype)</description> <year>19??</year> @@ -869,7 +869,7 @@ Unreleased (possibly no prototypes exist): </part> </software> - <!-- throws exception after few seconds on title screen --> + <!-- boot OK --> <software name="tempst2k" supported="no"> <description>Tempest 2000</description> <year>1994</year> @@ -1699,14 +1699,14 @@ endif ifeq (posix,$(SHELLTYPE)) $(GENDIR)/version.cpp: makefile $(GENDIR)/git_desc | $(GEN_FOLDERS) - @echo '#define BARE_BUILD_VERSION "0.217"' > $@ + @echo '#define BARE_BUILD_VERSION "0.218"' > $@ @echo 'extern const char bare_build_version[];' >> $@ @echo 'extern const char build_version[];' >> $@ @echo 'const char bare_build_version[] = BARE_BUILD_VERSION;' >> $@ @echo 'const char build_version[] = BARE_BUILD_VERSION " ($(NEW_GIT_VERSION))";' >> $@ else $(GENDIR)/version.cpp: makefile $(GENDIR)/git_desc | $(GEN_FOLDERS) - @echo #define BARE_BUILD_VERSION "0.217" > $@ + @echo #define BARE_BUILD_VERSION "0.218" > $@ @echo extern const char bare_build_version[]; >> $@ @echo extern const char build_version[]; >> $@ @echo const char bare_build_version[] = BARE_BUILD_VERSION; >> $@ diff --git a/src/devices/bus/isa/s3virge.cpp b/src/devices/bus/isa/s3virge.cpp index d24e0893fb0..111d87002e8 100644 --- a/src/devices/bus/isa/s3virge.cpp +++ b/src/devices/bus/isa/s3virge.cpp @@ -80,9 +80,9 @@ void s3virge_vga_device::device_start() vga.memory.resize(vga.svga_intf.vram_size); memset(&vga.memory[0], 0, vga.svga_intf.vram_size); save_item(vga.memory,"Video RAM"); - save_pointer(vga.crtc.data,"CRTC Registers",0x100); - save_pointer(vga.sequencer.data,"Sequencer Registers",0x100); - save_pointer(vga.attribute.data,"Attribute Registers", 0x15); + save_item(vga.crtc.data,"CRTC Registers"); + save_item(vga.sequencer.data,"Sequencer Registers"); + save_item(vga.attribute.data,"Attribute Registers"); m_vblank_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vga_device::vblank_timer_cb),this)); m_draw_timer = timer_alloc(TIMER_DRAW_STEP); @@ -91,12 +91,12 @@ void s3virge_vga_device::device_start() memset(&s3virge, 0, sizeof(s3virge)); s3virge.linear_address = 0x70000000; s3virge.s3d.cmd_fifo_slots_free = 16; - save_pointer(s3virge.s3d.pattern,"S3D Pattern Data", 0xc0); - save_pointer(s3virge.s3d.reg[0],"S3D Registers: BitBLT",0x100); - save_pointer(s3virge.s3d.reg[1],"S3D Registers: 2D Line",0x100); - save_pointer(s3virge.s3d.reg[2],"S3D Registers: 2D Polygon",0x100); - save_pointer(s3virge.s3d.reg[3],"S3D Registers: 3D Line",0x100); - save_pointer(s3virge.s3d.reg[4],"S3D Registers: 3D Triangle",0x100); + save_item(s3virge.s3d.pattern,"S3D Pattern Data"); + save_item(s3virge.s3d.reg[0],"S3D Registers: BitBLT"); + save_item(s3virge.s3d.reg[1],"S3D Registers: 2D Line"); + save_item(s3virge.s3d.reg[2],"S3D Registers: 2D Polygon"); + save_item(s3virge.s3d.reg[3],"S3D Registers: 3D Line"); + save_item(s3virge.s3d.reg[4],"S3D Registers: 3D Triangle"); // Initialise hardware graphics cursor colours, Windows 95 doesn't touch the registers for some reason for(x=0;x<4;x++) @@ -932,7 +932,7 @@ void s3virge_vga_device::command_start() m_draw_timer->adjust(attotime::from_nsec(250),0,attotime::from_nsec(250)); s3virge.s3d.bitblt_step_count = 0; s3virge.s3d.bitblt_mono_pattern = - s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_MONO_PAT_0] | (uint64_t)(s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_MONO_PAT_1]) << 32; + s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_MONO_PAT_0] | (uint64_t)(s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_MONO_PAT_1]) << 32; s3virge.s3d.bitblt_current_pixel = 0; s3virge.s3d.bitblt_pixel_pos = 0; s3virge.s3d.cmd_fifo[s3virge.s3d.cmd_fifo_current_ptr].reg[S3D_REG_PAT_BG_CLR] = 0xffffffff; // win31 never sets this? @@ -1058,8 +1058,10 @@ bool s3virge_vga_device::advance_pixel() s3virge.s3d.bitblt_pat_x = s3virge.s3d.bitblt_x_current % 8; if(s3virge.s3d.bitblt_pat_y >= 8 || s3virge.s3d.bitblt_pat_y < 0) s3virge.s3d.bitblt_pat_y = s3virge.s3d.bitblt_y_current % 8; - logerror("SRC: %i,%i DST: %i,%i PAT: %i,%i Bounds: %i,%i,%i,%i\n", - s3virge.s3d.bitblt_x_src_current,s3virge.s3d.bitblt_y_src_current,s3virge.s3d.bitblt_x_current,s3virge.s3d.bitblt_y_current,s3virge.s3d.bitblt_pat_x,s3virge.s3d.bitblt_pat_y, + logerror("SRC: %i,%i DST: %i,%i PAT: %i,%i Bounds: %i,%i,%i,%i\n", + s3virge.s3d.bitblt_x_src_current,s3virge.s3d.bitblt_y_src_current, + s3virge.s3d.bitblt_x_current,s3virge.s3d.bitblt_y_current, + s3virge.s3d.bitblt_pat_x,s3virge.s3d.bitblt_pat_y, left,right,top,bottom); if((s3virge.s3d.bitblt_y_current >= bottom) || (s3virge.s3d.bitblt_y_current <= top)) return true; diff --git a/src/devices/bus/multibus/isbc202.cpp b/src/devices/bus/multibus/isbc202.cpp index 864856eca8c..490ed125e97 100644 --- a/src/devices/bus/multibus/isbc202.cpp +++ b/src/devices/bus/multibus/isbc202.cpp @@ -135,11 +135,11 @@ offs_t isbc202_disassembler::disassemble(std::ostream &stream, offs_t pc, const uint32_t microcode = opcodes.r32(pc); // Decode address control instruction - uint8_t ac = (uint8_t)(microcode >> 25); + uint8_t ac = uint8_t(microcode >> 25); if ((ac & 0b1100000) == 0b0000000) { // JCC - util::stream_format(stream , "JCC $%03x" , (((uint16_t)ac & 0b11111) << 4) | (pc & 0xf)); + util::stream_format(stream , "JCC $%03x" , ((uint16_t(ac) & 0b11111) << 4) | (pc & 0xf)); } else if ((ac & 0b1110000) == 0b0100000) { // JZR util::stream_format(stream , "JZR $00%x" , ac & 0b1111); @@ -173,11 +173,11 @@ offs_t isbc202_disassembler::disassemble(std::ostream &stream, offs_t pc, const } // Decode input multiplexer - uint8_t in = (uint8_t)((microcode >> 13) & 7); + uint8_t in = uint8_t((microcode >> 13) & 7); util::stream_format(stream , " I=%u" , in); // Decode function code - uint8_t fc = (uint8_t)((microcode >> 18) & 0x7f); + uint8_t fc = uint8_t((microcode >> 18) & 0x7f); uint8_t fg; uint8_t rg; unsigned reg; @@ -189,8 +189,8 @@ offs_t isbc202_disassembler::disassemble(std::ostream &stream, offs_t pc, const stream << (BIT(microcode , 16) ? " HCZ" : " SCZ"); // Decode K - uint8_t slk = (uint8_t)((microcode >> 8) & 3); - uint8_t mask = (uint8_t)microcode; + uint8_t slk = uint8_t((microcode >> 8) & 3); + uint8_t mask = uint8_t(microcode); uint8_t kbus; if (!BIT(slk , 0)) { kbus = mask; @@ -204,7 +204,7 @@ offs_t isbc202_disassembler::disassemble(std::ostream &stream, offs_t pc, const // Decode OUT util::stream_format(stream , " S=%u M=$%02x" , slk , mask); if (BIT(slk , 0) && !BIT(mask , 7)) { - uint8_t out = (uint8_t)((microcode >> 10) & 7); + uint8_t out = uint8_t((microcode >> 10) & 7); util::stream_format(stream , " O=%u" , out); } @@ -481,11 +481,11 @@ void isbc202_device::device_timer(emu_timer &timer, device_timer_id id, int para } ROM_START(isbc202) - ROM_REGION(0x800 , "microcode" , ROMREGION_32BIT | ROMREGION_BE) - ROM_LOAD32_BYTE("sbc202-a10-0230.bin" , 0x000 , 0x200 , CRC(e8fa3893) SHA1(88fab74b0466e8aac36eee46cd7536ed1b32a2c9)) - ROM_LOAD32_BYTE("sbc202-a11-0261.bin" , 0x001 , 0x200 , CRC(3ad01769) SHA1(4c22b8fc3ea599dd49684ff4dcafc29ec3425c4c)) - ROM_LOAD32_BYTE("sbc202-a12-0233.bin" , 0x002 , 0x200 , CRC(61496232) SHA1(b0473217944b2f6e966d97e97cf5ad8d883a09e4)) - ROM_LOAD32_BYTE("sbc202-a13-0232.bin" , 0x003 , 0x200 , CRC(c369ab86) SHA1(fc3b7f9c3e71ea1442827c51247a9944c6d40b37)) + ROM_REGION(0x800 , "microcode" , ROMREGION_32BIT | ROMREGION_BE) + ROM_LOAD32_BYTE("sbc202-a10-0230.bin" , 0x000 , 0x200 , CRC(e8fa3893) SHA1(88fab74b0466e8aac36eee46cd7536ed1b32a2c9)) + ROM_LOAD32_BYTE("sbc202-a11-0261.bin" , 0x001 , 0x200 , CRC(3ad01769) SHA1(4c22b8fc3ea599dd49684ff4dcafc29ec3425c4c)) + ROM_LOAD32_BYTE("sbc202-a12-0233.bin" , 0x002 , 0x200 , CRC(61496232) SHA1(b0473217944b2f6e966d97e97cf5ad8d883a09e4)) + ROM_LOAD32_BYTE("sbc202-a13-0232.bin" , 0x003 , 0x200 , CRC(c369ab86) SHA1(fc3b7f9c3e71ea1442827c51247a9944c6d40b37)) ROM_END const tiny_rom_entry *isbc202_device::device_rom_region() const @@ -571,14 +571,14 @@ void isbc202_device::execute_run() // 12..10 Output control // 9..8 SLK field // 7..0 Mask field - m_ac = (uint8_t)(m_code_word >> 25); - m_fc = (uint8_t)((m_code_word >> 18) & 0x7f); + m_ac = uint8_t(m_code_word >> 25); + m_fc = uint8_t((m_code_word >> 18) & 0x7f); m_fc32 = BIT(m_code_word , 17); m_fc10 = BIT(m_code_word , 16); - m_in_sel = (uint8_t)((m_code_word >> 13) & 7); - m_out_sel = (uint8_t)((m_code_word >> 10) & 7); - m_slk = (uint8_t)((m_code_word >> 8) & 3); - m_mask = (uint8_t)m_code_word; + m_in_sel = uint8_t((m_code_word >> 13) & 7); + m_out_sel = uint8_t((m_code_word >> 10) & 7); + m_slk = uint8_t((m_code_word >> 8) & 3); + m_mask = uint8_t(m_code_word); m_mcu->fc_w((m_fc32 ? 0b1100 : 0b0000) | (m_fc10 ? 0b0011 : 0b0000)); @@ -852,7 +852,7 @@ void isbc202_device::set_output() if (m_mem_wrt) { if (!m_wrt_inh) { // CPU memory write - uint16_t addr = m_addr_low_out | ((uint16_t)abus_r() << 8); + uint16_t addr = m_addr_low_out | (uint16_t(abus_r()) << 8); if (m_mem_space) { LOG_BUS("MEM W %04x=%02x\n" , addr , m_data_low_out); m_mem_space->write_byte(addr , m_data_low_out); @@ -862,7 +862,7 @@ void isbc202_device::set_output() } } else { // CPU memory read - uint16_t addr = m_addr_low_out | ((uint16_t)abus_r() << 8); + uint16_t addr = m_addr_low_out | (uint16_t(abus_r()) << 8); if (m_mem_space) { m_data_low_in = m_mem_space->read_byte(addr); LOG_BUS("MEM R %04x=%02x\n" , addr , m_data_low_in); @@ -1130,7 +1130,7 @@ uint8_t isbc202_device::aligned_rd_data(uint16_t sr) LOG_RD("Aligning by %u bits\n" , bits); sr <<= bits; } - return (uint8_t)(sr >> 8); + return uint8_t(sr >> 8); } void isbc202_device::rd_bits(unsigned n) diff --git a/src/devices/bus/nes_ctrl/ctrl.cpp b/src/devices/bus/nes_ctrl/ctrl.cpp index 7ef1da0850f..991191a1f0c 100644 --- a/src/devices/bus/nes_ctrl/ctrl.cpp +++ b/src/devices/bus/nes_ctrl/ctrl.cpp @@ -212,13 +212,3 @@ void fc_expansion_devices(device_slot_interface &device) device.option_add("barcode_battler", NES_BARCODE_BATTLER); device.option_add("subor_keyboard", NES_SUBORKEYBOARD); } - -void majesco_control_port1_devices(device_slot_interface &device) -{ - device.option_add("ddr", NES_VT_MAJESCO_DDR); -} - -void majesco_control_port2_devices(device_slot_interface &device) -{ - // nothing? -} diff --git a/src/devices/bus/nes_ctrl/ctrl.h b/src/devices/bus/nes_ctrl/ctrl.h index 7991a549c93..6e9e05aac17 100644 --- a/src/devices/bus/nes_ctrl/ctrl.h +++ b/src/devices/bus/nes_ctrl/ctrl.h @@ -91,8 +91,6 @@ void nes_control_port2_devices(device_slot_interface &device); void fc_control_port1_devices(device_slot_interface &device); void fc_control_port2_devices(device_slot_interface &device); void fc_expansion_devices(device_slot_interface &device); -void majesco_control_port1_devices(device_slot_interface &device); -void majesco_control_port2_devices(device_slot_interface &device); #endif // MAME_BUS_NES_CTRL_CTRL_H diff --git a/src/devices/bus/nes_ctrl/joypad.cpp b/src/devices/bus/nes_ctrl/joypad.cpp index 1027340cf63..f6c8116c72c 100644 --- a/src/devices/bus/nes_ctrl/joypad.cpp +++ b/src/devices/bus/nes_ctrl/joypad.cpp @@ -39,8 +39,6 @@ DEFINE_DEVICE_TYPE(NES_FCPAD_P2, nes_fcpad2_device, "nes_fcpad2", "Ninten DEFINE_DEVICE_TYPE(NES_CCPAD_LEFT, nes_ccpadl_device, "nes_ccpadl", "FC Crazy Climber Left Pad") DEFINE_DEVICE_TYPE(NES_CCPAD_RIGHT, nes_ccpadr_device, "nes_ccpadr", "FC Crazy Climber Right Pad") DEFINE_DEVICE_TYPE(NES_ARCSTICK, nes_arcstick_device, "nes_arcstick", "Nintendo Family Computer Arcade Stick") -// for the standalone TV Plug and Play -DEFINE_DEVICE_TYPE(NES_VT_MAJESCO_DDR, nes_vt_majesco_ddr_device, "nes_ddr", "Majesco DDR Pad") static INPUT_PORTS_START( nes_joypad ) PORT_START("JOYPAD") @@ -78,18 +76,6 @@ static INPUT_PORTS_START( nes_ccpad_left ) PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICKLEFT_DOWN ) PORT_8WAY INPUT_PORTS_END -static INPUT_PORTS_START( nes_ddr ) - PORT_START("JOYPAD") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Up Arrow") // these can't be treated as a joystick as opposing directions are often required - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Down Arrow") - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Left Arrow") - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Right Arrow") -INPUT_PORTS_END - static INPUT_PORTS_START( nes_ccpad_right ) PORT_START("JOYPAD") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) @@ -155,12 +141,6 @@ ioport_constructor nes_arcstick_device::device_input_ports() const return INPUT_PORTS_NAME( nes_arcstick ); } -ioport_constructor nes_vt_majesco_ddr_device::device_input_ports() const -{ - return INPUT_PORTS_NAME( nes_ddr ); -} - - static void arcstick_daisy(device_slot_interface &device) { device.option_add("arcstick", NES_ARCSTICK); @@ -215,11 +195,6 @@ nes_ccpadr_device::nes_ccpadr_device(const machine_config &mconfig, const char * { } -nes_vt_majesco_ddr_device::nes_vt_majesco_ddr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - nes_joypad_device(mconfig, NES_VT_MAJESCO_DDR, tag, owner, clock) -{ -} - nes_arcstick_device::nes_arcstick_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : nes_joypad_device(mconfig, NES_ARCSTICK, tag, owner, clock), m_daisychain(*this, "subexp"), diff --git a/src/devices/bus/nes_ctrl/joypad.h b/src/devices/bus/nes_ctrl/joypad.h index 46cfd854756..76acd478906 100644 --- a/src/devices/bus/nes_ctrl/joypad.h +++ b/src/devices/bus/nes_ctrl/joypad.h @@ -80,17 +80,6 @@ public: virtual ioport_constructor device_input_ports() const override; }; -// ======================> nes_vt_majesco_ddr_device - -class nes_vt_majesco_ddr_device : public nes_joypad_device -{ -public: - // construction/destruction - nes_vt_majesco_ddr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - - virtual ioport_constructor device_input_ports() const override; -}; - // ======================> nes_arcstick_device class nes_arcstick_device : public nes_joypad_device @@ -118,6 +107,5 @@ DECLARE_DEVICE_TYPE(NES_FCPAD_P2, nes_fcpad2_device) DECLARE_DEVICE_TYPE(NES_CCPAD_LEFT, nes_ccpadl_device) DECLARE_DEVICE_TYPE(NES_CCPAD_RIGHT, nes_ccpadr_device) DECLARE_DEVICE_TYPE(NES_ARCSTICK, nes_arcstick_device) -DECLARE_DEVICE_TYPE(NES_VT_MAJESCO_DDR, nes_vt_majesco_ddr_device) #endif // MAME_BUS_NES_CTRL_JOYPAD_H diff --git a/src/devices/bus/ti99/internal/992board.cpp b/src/devices/bus/ti99/internal/992board.cpp index fcb5d904a68..5bae14a0e9a 100644 --- a/src/devices/bus/ti99/internal/992board.cpp +++ b/src/devices/bus/ti99/internal/992board.cpp @@ -12,6 +12,7 @@ ***************************************************************************/ #include "emu.h" +#include "992board.h" #define LOG_WARN (1U<<1) // Warnings #define LOG_CRU (1U<<2) // CRU logging @@ -20,10 +21,9 @@ #define LOG_BANK (1U<<5) // Change ROM banks #define LOG_KEYBOARD (1U<<6) // Keyboard operation -#define VERBOSE ( LOG_GENERAL | LOG_WARN ) +#define VERBOSE ( LOG_WARN ) #include "logmacro.h" -#include "992board.h" /* Emulation of the CRT Gate Array of the TI-99/2 diff --git a/src/devices/cpu/gigatron/gigatron.cpp b/src/devices/cpu/gigatron/gigatron.cpp index 3e687baa930..643e99dabe5 100644 --- a/src/devices/cpu/gigatron/gigatron.cpp +++ b/src/devices/cpu/gigatron/gigatron.cpp @@ -13,7 +13,7 @@ #include "gigatrondasm.h" -DEFINE_DEVICE_TYPE(GTRON, gigatron_cpu_device, "gigatron_cpu", "Gigatron") +DEFINE_DEVICE_TYPE(GTRON, gigatron_cpu_device, "gigatron_cpu", "Gigatron CPU") /* FLAGS */ @@ -59,28 +59,28 @@ void gigatron_cpu_device::execute_run() uint8_t bus = (opcode >> 8) & 0x0003; uint8_t d = (opcode >> 0) & 0x00ff; - switch( op) + switch (op) { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - aluOp(op, mode, bus, d); - break; - case 6: - storeOp(op, mode, bus, d); - break; - case 7: - branchOp(op, mode, bus, d); - break; - default: - gigatron_illegal(); - break; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + aluOp(op, mode, bus, d); + break; + case 6: + storeOp(op, mode, bus, d); + break; + case 7: + branchOp(op, mode, bus, d); + break; + default: + gigatron_illegal(); + break; } m_icount--; - } while( m_icount > 0 ); + } while (m_icount > 0); } @@ -127,35 +127,37 @@ void gigatron_cpu_device::branchOp(uint8_t op, uint8_t mode, uint8_t bus, uint8_ bool c = false; uint8_t ac2 = m_ac ^ ZERO; uint16_t base = m_pc & 0xff00; - switch (mode) { - case 0: - c = true; - base = m_y << 8; - break; - case 1: - c = (ac2 > ZERO); - break; - case 2: - c = (ac2 < ZERO); - break; - case 3: - c = (ac2 != ZERO); - break; - case 4: - c = (ac2 == ZERO); - break; - case 5: - c = (ac2 >= ZERO); - break; - case 6: - c = (ac2 <= ZERO); - break; - case 7: - c = true; - break; + switch (mode) + { + case 0: + c = true; + base = m_y << 8; + break; + case 1: + c = (ac2 > ZERO); + break; + case 2: + c = (ac2 < ZERO); + break; + case 3: + c = (ac2 != ZERO); + break; + case 4: + c = (ac2 == ZERO); + break; + case 5: + c = (ac2 >= ZERO); + break; + case 6: + c = (ac2 <= ZERO); + break; + case 7: + c = true; + break; } - if (c) { + if (c) + { uint8_t b = offset(bus, d); m_npc = base | b; } @@ -164,94 +166,97 @@ void gigatron_cpu_device::branchOp(uint8_t op, uint8_t mode, uint8_t bus, uint8_ void gigatron_cpu_device::aluOp(uint8_t op, uint8_t mode, uint8_t bus, uint8_t d) { uint8_t b = 0; - switch(bus) { - case 0: - b = d; - break; - case 1: - b = gigatron_readmem8((uint16_t)(addr(mode, d) & m_ramMask)); - break; - case 2: - b = m_ac; - break; - case 3: - b = m_inReg; - break; + switch (bus) + { + case 0: + b = d; + break; + case 1: + b = gigatron_readmem8((uint16_t)(addr(mode, d) & m_ramMask)); + break; + case 2: + b = m_ac; + break; + case 3: + b = m_inReg; + break; } - switch(op) { - case 1: - b = (m_ac & b); - break; - case 2: - b = (m_ac | b); - break; - case 3: - b = (m_ac ^ b); - break; - case 4: - b = (m_ac + b); - break; - case 5: - b = (m_ac - b); - break; + switch (op) + { + case 1: + b = (m_ac & b); + break; + case 2: + b = (m_ac | b); + break; + case 3: + b = (m_ac ^ b); + break; + case 4: + b = (m_ac + b); + break; + case 5: + b = (m_ac - b); + break; } - switch (mode) { - case 0: - case 1: - case 2: - case 3: - m_ac = b; - break; - case 4: - m_x = b; - break; - case 5: - m_y = b; - break; - case 6: - case 7: - uint16_t rising = ~(m_out & b); - if (rising & 0x40) { - m_outx = m_ac; - } - break; - + switch (mode) + { + case 0: + case 1: + case 2: + case 3: + m_ac = b; + break; + case 4: + m_x = b; + break; + case 5: + m_y = b; + break; + case 6: + case 7: + uint16_t rising = ~(m_out & b); + if (rising & 0x40) + m_outx = m_ac; + break; } } uint16_t gigatron_cpu_device::addr(uint8_t mode, uint8_t d) { - switch (mode) { - case 0: - case 4: - case 5: - case 6: - return d; - case 1: - return m_x; - case 2: - return (m_y << 8) | d; - case 3: - return (m_y << 8) | m_x; - case 7: - uint16_t addr2 = (m_y << 8) | m_x; - m_x = (m_x + 1) & 0xff; - return addr2; + switch (mode) + { + case 0: + case 4: + case 5: + case 6: + return d; + case 1: + return m_x; + case 2: + return (m_y << 8) | d; + case 3: + return (m_y << 8) | m_x; + case 7: + uint16_t addr2 = (m_y << 8) | m_x; + m_x = (m_x + 1) & 0xff; + return addr2; } return 0; } uint8_t gigatron_cpu_device::offset(uint8_t bus, uint8_t d) { - switch (bus) { - case 0: - return d; - case 1: - return gigatron_readmem8(d); - case 2: - return m_ac; - case 3: - return m_inReg; + switch (bus) + { + case 0: + return d; + case 1: + return gigatron_readmem8(d); + case 2: + return m_ac; + case 3: + return m_inReg; } return 0; } @@ -259,16 +264,17 @@ uint8_t gigatron_cpu_device::offset(uint8_t bus, uint8_t d) void gigatron_cpu_device::storeOp(uint8_t op, uint8_t mode, uint8_t bus, uint8_t d) { uint8_t b = 0; - switch (bus) { - case 0: - b = d; - break; - case 2: - b = m_ac; - break; - case 3: - b = m_inReg; - break; + switch (bus) + { + case 0: + b = d; + break; + case 2: + b = m_ac; + break; + case 3: + b = m_inReg; + break; } u16 address = addr(mode, d); @@ -277,13 +283,14 @@ void gigatron_cpu_device::storeOp(uint8_t op, uint8_t mode, uint8_t bus, uint8_t else gigatron_writemem8(address & m_ramMask, b); - switch (mode) { - case 4: - m_x = b; - break; - case 5: - m_y = b; - break; + switch (mode) + { + case 4: + m_x = b; + break; + case 5: + m_y = b; + break; } } @@ -294,10 +301,10 @@ void gigatron_cpu_device::device_reset() void gigatron_cpu_device::execute_set_input(int irqline, int state) { #if 0 - switch(irqline) + switch (irqline) { - default: - break; + default: + break; } #endif } @@ -315,13 +322,13 @@ void gigatron_cpu_device::state_string_export(const device_state_entry &entry, s { switch (entry.index()) { - case STATE_GENFLAGS: - str = util::string_format("%c%c%c%c", - m_flags & 0x80 ? 'S':'.', - m_flags & 0x40 ? 'Z':'.', - m_flags & 0x20 ? 'V':'.', - m_flags & 0x10 ? 'C':'.'); - break; + case STATE_GENFLAGS: + str = util::string_format("%c%c%c%c", + m_flags & 0x80 ? 'S':'.', + m_flags & 0x40 ? 'Z':'.', + m_flags & 0x20 ? 'V':'.', + m_flags & 0x10 ? 'C':'.'); + break; } } diff --git a/src/devices/machine/s3c24xx.hxx b/src/devices/machine/s3c24xx.hxx index 63e8dfbd2d7..603ee085b1b 100644 --- a/src/devices/machine/s3c24xx.hxx +++ b/src/devices/machine/s3c24xx.hxx @@ -77,45 +77,45 @@ #endif -#define LOG_RESET (1 << 0) -#define LOG_ADC (1 << 1) -#define LOG_LCD_DMA (1 << 2) -#define LOG_LCD_TIMER (1 << 3) -#define LOG_LCD_REGS (1 << 4) -#define LOG_SPI (1 << 5) -#define LOG_LCD_CFG (1 << 6) -#define LOG_LCD_TFT (1 << 7) -#define LOG_LCD_STN (1 << 8) -#define LOG_CLKPOW (1 << 9) -#define LOG_MMC (1 << 10) -#define LOG_IRQS (1 << 11) -#define LOG_IRQ_REGS (1 << 12) -#define LOG_FLASH (1 << 13) -#define LOG_PWM (1 << 14) -#define LOG_PWM_REGS (1 << 15) -#define LOG_CAM (1 << 16) -#define LOG_DMA (1 << 17) -#define LOG_DMA_REQS (1 << 18) -#define LOG_DMA_REGS (1 << 19) -#define LOG_AC97 (1 << 20) -#define LOG_DMA_TIMERS (1 << 21) -#define LOG_GPIO (1 << 22) -#define LOG_MEMCON (1 << 23) -#define LOG_USBHOST (1 << 24) -#define LOG_UART (1 << 25) -#define LOG_USB (1 << 26) -#define LOG_WDT (1 << 27) -#define LOG_I2C (1 << 28) -#define LOG_I2S (1 << 29) -#define LOG_RTC (1 << 30) -#define LOG_SDI (1 << 31) +#define LOG_RESET (u64(1) << 1) +#define LOG_ADC (u64(1) << 2) +#define LOG_LCD_DMA (u64(1) << 3) +#define LOG_LCD_TIMER (u64(1) << 4) +#define LOG_LCD_REGS (u64(1) << 5) +#define LOG_SPI (u64(1) << 6) +#define LOG_LCD_CFG (u64(1) << 7) +#define LOG_LCD_TFT (u64(1) << 8) +#define LOG_LCD_STN (u64(1) << 9) +#define LOG_CLKPOW (u64(1) << 10) +#define LOG_MMC (u64(1) << 11) +#define LOG_IRQS (u64(1) << 12) +#define LOG_IRQ_REGS (u64(1) << 13) +#define LOG_FLASH (u64(1) << 14) +#define LOG_PWM (u64(1) << 15) +#define LOG_PWM_REGS (u64(1) << 16) +#define LOG_CAM (u64(1) << 17) +#define LOG_DMA (u64(1) << 18) +#define LOG_DMA_REQS (u64(1) << 19) +#define LOG_DMA_REGS (u64(1) << 20) +#define LOG_AC97 (u64(1) << 21) +#define LOG_DMA_TIMERS (u64(1) << 22) +#define LOG_GPIO (u64(1) << 23) +#define LOG_MEMCON (u64(1) << 24) +#define LOG_USBHOST (u64(1) << 25) +#define LOG_UART (u64(1) << 26) +#define LOG_USB (u64(1) << 27) +#define LOG_WDT (u64(1) << 28) +#define LOG_I2C (u64(1) << 29) +#define LOG_I2S (u64(1) << 30) +#define LOG_RTC (u64(1) << 31) +#define LOG_SDI (u64(1) << 32) #define LOG_ALL (LOG_RESET | LOG_ADC | LOG_LCD_DMA | LOG_LCD_TIMER | LOG_LCD_REGS | LOG_SPI | LOG_LCD_CFG | LOG_LCD_TFT | LOG_LCD_STN \ | LOG_CLKPOW | LOG_MMC | LOG_IRQS | LOG_IRQ_REGS | LOG_FLASH | LOG_PWM | LOG_PWM_REGS | LOG_CAM | LOG_DMA | LOG_DMA_REQS \ | LOG_DMA_REGS | LOG_AC97 | LOG_DMA_TIMERS | LOG_GPIO | LOG_MEMCON | LOG_USBHOST | LOG_UART | LOG_USB \ | LOG_WDT | LOG_I2C | LOG_I2S | LOG_RTC | LOG_SDI) -#define VERBOSE (LOG_ALL & ~(LOG_FLASH | LOG_UART)) +//#define VERBOSE (LOG_ALL & ~(LOG_FLASH | LOG_UART)) #include "logmacro.h" /*************************************************************************** @@ -272,11 +272,6 @@ void S3C24_CLASS_NAME::s3c24xx_lcd_dma_reload() LOGMASKED(LOG_LCD_DMA, "LCD - vramaddr %08X %08X offsize %08X pagewidth %08X\n", m_lcd.vramaddr_cur, m_lcd.vramaddr_max, m_lcd.offsize, m_lcd.pagewidth_max); m_lcd.dma_data = 0; m_lcd.dma_bits = 0; - - if (machine().input().code_pressed_once(KEYCODE_K)) - { - s3c24xx_uart_fifo_w(0, 0x55); - } } void S3C24_CLASS_NAME::s3c24xx_lcd_dma_init() diff --git a/src/devices/video/fixfreq.cpp b/src/devices/video/fixfreq.cpp index 5e333d9eec5..732a6994ae4 100644 --- a/src/devices/video/fixfreq.cpp +++ b/src/devices/video/fixfreq.cpp @@ -20,7 +20,7 @@ // for quick and dirty debugging #define VERBOSE 0 -#define LOG_OUTPUT_FUNC printf +#define LOG_OUTPUT_STREAM std::cerr #include "logmacro.h" #include <algorithm> diff --git a/src/emu/xtal.cpp b/src/emu/xtal.cpp index 2e02b4ab0e0..156a452a1b8 100644 --- a/src/emu/xtal.cpp +++ b/src/emu/xtal.cpp @@ -89,7 +89,7 @@ const double XTAL::known_xtals[] = { 3'521'280, /* 3.52128_MHz_XTAL RCA COSMAC VIP */ 3'570'000, /* 3.57_MHz_XTAL Telmac TMC-600 */ 3'578'640, /* 3.57864_MHz_XTAL Atari Portfolio PCD3311T */ - 3'579'000, /* 3.579_MHz_XTAL BeebOPL */ + 3'579'000, /* 3.579_MHz_XTAL BeebOPL */ 3'579'545, /* 3.579545_MHz_XTAL NTSC color subcarrier, extremely common, used on 100's of PCBs (Keytronic custom part #48-300-010 is equivalent) */ 3'686'400, /* 3.6864_MHz_XTAL Baud rate clock for MC68681 and similar UARTs */ 3'840'000, /* 3.84_MHz_XTAL Fairlight CMI Alphanumeric Keyboard */ diff --git a/src/lib/formats/img_dsk.cpp b/src/lib/formats/img_dsk.cpp index 0dfcc7a359f..40093bee4aa 100644 --- a/src/lib/formats/img_dsk.cpp +++ b/src/lib/formats/img_dsk.cpp @@ -19,7 +19,7 @@ // Debugging #define VERBOSE 0 -#define LOG(...) do { if (VERBOSE) printf(__VA_ARGS__); } while (false) +#define LOG(...) do { if (VERBOSE) osd_printf_info(__VA_ARGS__); } while (false) constexpr unsigned CELL_SIZE = 1200; // Bit cell size (1 µs) constexpr uint8_t INDEX_AM = 0x0c; // Index address mark @@ -31,7 +31,7 @@ constexpr unsigned SYNC_00_LEN = 18; // 00's in sync (gaps 1, 2, 3) constexpr unsigned SYNC_FF_LEN = 10; // FF's in sync (gaps 1, 2, 3) constexpr int ID_DATA_OFFSET = 35 * 16; // Nominal distance (in cells) between ID & DATA AM // Size of image file -constexpr unsigned IMG_IMAGE_SIZE = IMG_TRACKS * IMG_HEADS * IMG_SECTORS * IMG_SECTOR_SIZE; +constexpr unsigned IMG_IMAGE_SIZE = img_format::TRACKS * img_format::HEADS * img_format::SECTORS * img_format::SECTOR_SIZE; constexpr uint16_t CRC_POLY = 0x1021; // CRC-CCITT img_format::img_format() @@ -62,7 +62,7 @@ bool img_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) std::vector<uint8_t> image_data(size); io_generic_read(io, (void *)image_data.data(), 0, size); - for (unsigned cyl = 0; cyl < IMG_TRACKS; cyl++) { + for (unsigned cyl = 0; cyl < TRACKS; cyl++) { std::vector<uint32_t> track_data; write_gap(track_data, 0 , PREIDX_GAP); @@ -83,9 +83,9 @@ bool img_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) } std::vector<uint8_t> sector_list = interleaved_sectors(il_factor); - for (unsigned sector = 0; sector < IMG_SECTORS; sector++) { - unsigned real_sector = sector_list[ (sector + skew) % IMG_SECTORS ]; - unsigned offset_in_image = (real_sector - 1 + cyl * IMG_SECTORS) * IMG_SECTOR_SIZE; + for (unsigned sector = 0; sector < SECTORS; sector++) { + unsigned real_sector = sector_list[ (sector + skew) % SECTORS ]; + unsigned offset_in_image = (real_sector - 1 + cyl * SECTORS) * SECTOR_SIZE; write_sector(track_data , cyl , real_sector , &image_data[ offset_in_image ]); } fill_with_gap4(track_data); @@ -96,17 +96,17 @@ bool img_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) bool img_format::save(io_generic *io, floppy_image *image) { - for (int cyl = 0; cyl < IMG_TRACKS; cyl++) { + for (int cyl = 0; cyl < TRACKS; cyl++) { uint8_t bitstream[ 21000 ]; int bitstream_size; generate_bitstream_from_track(cyl , 0 , CELL_SIZE , bitstream , bitstream_size , image , 0); int pos = 0; unsigned track_no , sector_no; - uint8_t sector_data[ IMG_SECTOR_SIZE ]; + uint8_t sector_data[ SECTOR_SIZE ]; while (get_next_sector(bitstream , bitstream_size , pos , track_no , sector_no , sector_data)) { - if (track_no == cyl && sector_no >= 1 && sector_no <= IMG_SECTORS) { - unsigned offset_in_image = (cyl * IMG_SECTORS + sector_no - 1) * IMG_SECTOR_SIZE; - io_generic_write(io, sector_data, offset_in_image, IMG_SECTOR_SIZE); + if (track_no == cyl && sector_no >= 1 && sector_no <= SECTORS) { + unsigned offset_in_image = (cyl * SECTORS + sector_no - 1) * SECTOR_SIZE; + io_generic_write(io, sector_data, offset_in_image, SECTOR_SIZE); } } } @@ -135,18 +135,18 @@ bool img_format::supports_save() const std::vector<uint8_t> img_format::interleaved_sectors(unsigned il_factor) { - std::vector<uint8_t> out(IMG_SECTORS); + std::vector<uint8_t> out(SECTORS); unsigned idx = 0; - for (unsigned s = 0; s < IMG_SECTORS; s++) { + for (unsigned s = 0; s < SECTORS; s++) { while (out[ idx ] != 0) { - if (++idx >= IMG_SECTORS) { + if (++idx >= SECTORS) { idx = 0; } } out[ idx ] = s + 1; idx += il_factor; - if (idx >= IMG_SECTORS) { - idx -= IMG_SECTORS; + if (idx >= SECTORS) { + idx -= SECTORS; } } return out; @@ -235,7 +235,7 @@ void img_format::write_sector(std::vector<uint32_t> &buffer , uint8_t track_no , // Data AM m_crc = 0; write_mmfm_byte(buffer , DATA_AM , AM_CLOCK); - for (unsigned i = 0; i < IMG_SECTOR_SIZE; i++) { + for (unsigned i = 0; i < SECTOR_SIZE; i++) { // Data write_mmfm_byte(buffer , sect_data[ i ]); } @@ -317,7 +317,7 @@ std::vector<uint8_t> img_format::get_next_id_n_block(const uint8_t *bitstream , if (data_sr == ID_AM) { to_dump = 4; } else if (data_sr == DATA_AM) { - to_dump = IMG_SECTOR_SIZE; + to_dump = SECTOR_SIZE; } else { to_dump = 0; } @@ -365,12 +365,12 @@ bool img_format::get_next_sector(const uint8_t *bitstream , int bitstream_size , if (block.size() == 0) { return false; } - if (block[ 0 ] == DATA_AM && block.size() >= (IMG_SECTOR_SIZE + 1) && abs((data_pos - id_pos) - ID_DATA_OFFSET) <= 64) { + if (block[ 0 ] == DATA_AM && block.size() >= (SECTOR_SIZE + 1) && abs((data_pos - id_pos) - ID_DATA_OFFSET) <= 64) { break; } } - memcpy(sector_data , block.data() + 1 , IMG_SECTOR_SIZE); + memcpy(sector_data , block.data() + 1 , SECTOR_SIZE); return true; } diff --git a/src/lib/formats/img_dsk.h b/src/lib/formats/img_dsk.h index f1ac7aef3c0..ab2c5adc1c2 100644 --- a/src/lib/formats/img_dsk.h +++ b/src/lib/formats/img_dsk.h @@ -16,15 +16,15 @@ #include <vector> -// Geometry constants -constexpr unsigned IMG_TRACKS = 77; -constexpr unsigned IMG_HEADS = 1; -constexpr unsigned IMG_SECTORS = 52; -constexpr unsigned IMG_SECTOR_SIZE = 128; - class img_format : public floppy_image_format_t { public: + // Geometry constants + static constexpr unsigned TRACKS = 77; + static constexpr unsigned HEADS = 1; + static constexpr unsigned SECTORS = 52; + static constexpr unsigned SECTOR_SIZE = 128; + img_format(); virtual int identify(io_generic *io, uint32_t form_factor) override; diff --git a/src/lib/netlist/tools/nl_convert.cpp b/src/lib/netlist/tools/nl_convert.cpp index 58bf8fa2a47..d1a4235633e 100644 --- a/src/lib/netlist/tools/nl_convert.cpp +++ b/src/lib/netlist/tools/nl_convert.cpp @@ -91,6 +91,8 @@ nl_convert_base_t::nl_convert_base_t() { "CCCS", {"OP", "ON", "IP", "IN"} }, { "CCVS", {"OP", "ON", "IP", "IN"} }, { "VS", {"1", "2"} }, + { "TTL_INPUT", {"Q", "VCC", "GND"} }, + { "DIODE", {"A", "K"} }, }; } @@ -138,6 +140,10 @@ void nl_convert_base_t::add_device(const pstring &atype, const pstring &aname) void nl_convert_base_t::add_term(const pstring &netname, const pstring &termname) { + // Ignore NC nets! + if (plib::startsWith(netname,"NC_")) + return; + net_t * net = nullptr; auto idx = m_nets.find(netname); if (idx != m_nets.end()) @@ -254,7 +260,7 @@ void nl_convert_base_t::dump_nl() for (auto & i : m_nets) { net_t * net = i.second.get(); - if (!net->is_no_export()) + if (!net->is_no_export() && !(net->terminals().size() == 1 && net->terminals()[0] == "GND" )) { out("NET_C({}", net->terminals()[0].c_str() ); for (std::size_t j=1; j<net->terminals().size(); j++) @@ -276,8 +282,16 @@ pstring nl_convert_base_t::get_nl_val(double val) for (auto &e : m_units) { if (e.m_mult <= plib::abs(val)) - return plib::pfmt(e.m_func)(val / e.m_mult); + { + double v = val / e.m_mult; + if (plib::abs(v - std::round(v)) <= 1e-6) + return plib::pfmt(e.m_func)(static_cast<int>(std::round(v))); + return plib::pfmt(e.m_func)(v); + } } + + if (plib::abs(val - std::round(val)) <= 1e-6) + return plib::pfmt("{1}")(static_cast<int>(std::round(val))); return plib::pfmt("{1}")(val); } @@ -334,6 +348,7 @@ void nl_convert_spice_t::convert(const pstring &contents) // FIXME: Parameter out("NETLIST_START(dummy)\n"); add_term("0", "GND"); + add_term("GND", "GND"); // For Kicad pstring line = ""; @@ -412,6 +427,10 @@ void nl_convert_spice_t::process_line(const pstring &line) { out("NET_MODEL(\"{} {}\")\n", m_subckt + tt[1], rem(tt,2)); } + else if (tt[0] == ".TITLE" && tt[1] == "KICAD") + { + m_is_kicad = true; + } else out("// {}\n", line.c_str()); break; @@ -572,16 +591,6 @@ void nl_convert_spice_t::process_line(const pstring &line) add_term(tt[1], tt[0] + ".1"); add_term(tt[2], tt[0] + ".2"); break; -#if 0 - // This is wrong ... Need to use something else for inputs! - case 'I': // Input pin special notation - { - val = get_sp_val(tt[2]); - add_device("ANALOG_INPUT", tt[0], val); - add_term(tt[1], tt[0] + ".Q"); - } - break; -#else case 'I': { val = get_sp_val(tt[3] == "DC" ? tt[4] : tt[3]); @@ -590,13 +599,12 @@ void nl_convert_spice_t::process_line(const pstring &line) add_term(tt[2], tt[0] + ".2"); } break; -#endif case 'D': add_device("DIODE", tt[0], m_subckt + tt[3]); // Spice D Anode Kathode model - // FIXME ==> does Kicad use different notation from LTSPICE ? - add_term(tt[1], tt[0] + ".A"); - add_term(tt[2], tt[0] + ".K"); + // Kicad outputs K first and D as second net + add_term(tt[1], tt[0], is_kicad() ? 1 : 0); + add_term(tt[2], tt[0], is_kicad() ? 0 : 1); break; case 'U': case 'X': @@ -606,15 +614,44 @@ void nl_convert_spice_t::process_line(const pstring &line) // FIXME: Parameter pstring xname = plib::replace_all(tt[0], pstring("."), pstring("_")); - pstring tname = "TTL_" + tt[tt.size()-1] + "_DIP"; + pstring modname = tt[tt.size()-1]; + pstring tname = modname; + if (plib::startsWith(modname, "7")) + tname = "TTL_" + modname + "_DIP"; + else if (plib::startsWith(modname, "4")) + tname = "CD" + modname + "_DIP"; + add_device(tname, xname); for (std::size_t i=1; i < tt.size() - 1; i++) { - pstring term = plib::pfmt("{1}.{2}")(xname)(i); + pstring term = plib::pfmt("X{1}.{2}")(xname)(i); add_term(tt[i], term); } break; } + case 'Y': + { + auto st=tt[0].substr(0,3); + if (st == "YT_") + { + auto yname=pstring("I_") + tt[0].substr(3); + val = get_sp_val(tt[4]); + add_device("TTL_INPUT", yname, val); + add_term(tt[1], yname, 0); + add_term(tt[2], yname, 1); + add_term(tt[3], yname, 2); + } + else if (st == "YA_") + { + auto yname=pstring("I_") + tt[0].substr(3); + val = get_sp_val(tt[2]); + add_device("ANALOG_INPUT", yname, val); + add_term(tt[1], yname + ".Q"); + } + else + out("// IGNORED {}: {}\n", tt[0].c_str(), line.c_str()); + break; + } default: out("// IGNORED {}: {}\n", tt[0].c_str(), line.c_str()); } diff --git a/src/lib/netlist/tools/nl_convert.h b/src/lib/netlist/tools/nl_convert.h index 4d32eb7e2a6..f47eaf5ccaa 100644 --- a/src/lib/netlist/tools/nl_convert.h +++ b/src/lib/netlist/tools/nl_convert.h @@ -155,9 +155,6 @@ private: pstring m_alias; }; - -private: - void add_device(plib::unique_ptr<dev_t> dev); dev_t *get_device(const pstring &name) { @@ -185,16 +182,18 @@ class nl_convert_spice_t : public nl_convert_base_t { public: - nl_convert_spice_t() = default; + nl_convert_spice_t() : m_is_kicad(false) { } void convert(const pstring &contents) override; protected: + bool is_kicad() const { return m_is_kicad; } void process_line(const pstring &line); private: pstring m_subckt; + bool m_is_kicad; }; class nl_convert_eagle_t : public nl_convert_base_t diff --git a/src/mame/audio/galaxian.cpp b/src/mame/audio/galaxian.cpp index 4485c26104a..ba99ca5e6b3 100644 --- a/src/mame/audio/galaxian.cpp +++ b/src/mame/audio/galaxian.cpp @@ -78,7 +78,7 @@ TODO: * it is only listed once and given as 15k. This is more in line with recordings */ #define GAL_R34 RES_K(5.1) -#define MCRST_R34 RES_K(15) +#define MCRST_R34 RES_K(15) #define GAL_R35 RES_K(150) #define GAL_R36 RES_K(22) @@ -391,14 +391,14 @@ DEFINE_DEVICE_TYPE(GALAXIAN_SOUND, galaxian_sound_device, "galaxian_sound", "Gal DEFINE_DEVICE_TYPE(MOONCRST_SOUND, mooncrst_sound_device, "mooncrst_sound", "Mooncrst Custom Sound") galaxian_sound_device::galaxian_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) -: galaxian_sound_device(mconfig, GALAXIAN_SOUND, tag, owner, clock) + : galaxian_sound_device(mconfig, GALAXIAN_SOUND, tag, owner, clock) { } galaxian_sound_device::galaxian_sound_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) -: device_t(mconfig, type, tag, owner, clock) -, m_discrete(*this, "discrete") -, m_lfo_val(0) + : device_t(mconfig, type, tag, owner, clock) + , m_discrete(*this, "discrete") + , m_lfo_val(0) { } @@ -498,7 +498,7 @@ WRITE8_MEMBER( galaxian_sound_device::sound_w ) } mooncrst_sound_device::mooncrst_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) -: galaxian_sound_device(mconfig, MOONCRST_SOUND, tag, owner, clock) + : galaxian_sound_device(mconfig, MOONCRST_SOUND, tag, owner, clock) { } diff --git a/src/mame/audio/galaxian.h b/src/mame/audio/galaxian.h index fe84309fd67..f2129722468 100644 --- a/src/mame/audio/galaxian.h +++ b/src/mame/audio/galaxian.h @@ -11,7 +11,6 @@ class galaxian_sound_device : public device_t { public: galaxian_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - galaxian_sound_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE8_MEMBER( sound_w ); DECLARE_WRITE8_MEMBER( pitch_w ); @@ -22,14 +21,14 @@ public: DECLARE_WRITE8_MEMBER( lfo_freq_w ); protected: + galaxian_sound_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + // device-level overrides virtual void device_start() override; virtual void device_add_mconfig(machine_config &config) override; - // sound stream update overrides - // virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; - required_device<discrete_device> m_discrete; + private: // internal state uint8_t m_lfo_val; @@ -43,13 +42,9 @@ public: protected: // device-level overrides virtual void device_add_mconfig(machine_config &config) override; - }; DECLARE_DEVICE_TYPE(GALAXIAN_SOUND, galaxian_sound_device) DECLARE_DEVICE_TYPE(MOONCRST_SOUND, mooncrst_sound_device) -//DISCRETE_SOUND_EXTERN(galaxian_discrete); -//DISCRETE_SOUND_EXTERN(mooncrst_discrete); - #endif // MAME_AUDIO_GALAXIAN_H diff --git a/src/mame/drivers/jaguar.cpp b/src/mame/drivers/jaguar.cpp index e8ed3b94abb..cd8108a394b 100644 --- a/src/mame/drivers/jaguar.cpp +++ b/src/mame/drivers/jaguar.cpp @@ -298,6 +298,9 @@ Notes: F1D000-F1DFFF R xxxxxxxx xxxxxxxx Wavetable ROM ------------------------------------------------------------ + Jaguar console schematics include a ADC0844 at U16, selected by GPIOL5. This IC + may or may not be populated. + Jaguar System Notes: Protection Check diff --git a/src/mame/drivers/mastboyo.cpp b/src/mame/drivers/mastboyo.cpp index f07e63ac0cd..6e92db86a6f 100644 --- a/src/mame/drivers/mastboyo.cpp +++ b/src/mame/drivers/mastboyo.cpp @@ -300,6 +300,27 @@ ROM_START( mastboyoa ) ROM_LOAD( "masterboy-1987-82s129-l-ic40.bin", 0x000, 0x100, CRC(4d061216) SHA1(1abf9320da75a3fd23c6bdbcc4088d18e133c4e5) ) // Identical to the parent set. ROM_END +ROM_START( mastboyob ) + ROM_REGION( 0x4000, "maincpu", 0 ) + ROM_LOAD( "mb_p1.ic14", 0x0000, 0x4000, CRC(9ff8d386) SHA1(4bf0df6d5cb605f2a4c9ef3cf0ece229ce8cbb40) ) // masterboy-1987-27128-ic14.bin 43.347168% + + ROM_REGION( 0x4000, "gfx1", 0 ) + ROM_LOAD( "fij.c36", 0x0000, 0x4000, CRC(bdd0f821) SHA1(63f607bccf1eded92531b2a10605d0578d371f77) ) // masterboy-1987-27128-mbfij-ic36.bin 97.308350% + + ROM_REGION( 0x80000, "questions", ROMREGION_ERASEFF ) + ROM_LOAD( "mb_3.ic9", 0x60000, 0x08000, CRC(b92ffd4f) SHA1(34431d6771e58f2ec083756f07e8b2a02bdb0e5a) ) // mastboy_27256.ic10 IDENTICAL + ROM_LOAD( "mb_4.ic8", 0x68000, 0x08000, CRC(c4844264) SHA1(e8a45b87878f95ad4590ad5e19c15339fde1a762) ) // mastboy_27256.ic9 99.996948% + ROM_LOAD( "mb_1.ic11", 0x70000, 0x08000, CRC(f5a9bf63) SHA1(53890e615cd73809c950a302bb423ec111ee493b) ) // mastboy_27256.ic12 99.996948% + ROM_LOAD( "mb_2.ic10", 0x78000, 0x08000, CRC(f2611186) SHA1(05860fecc23014c39cb28762763e94bc91412b34) ) // mastboy_27256.ic11 IDENTICAL + + ROM_REGION( 0x100, "proms", 0 ) // timing or memory mapping? + ROM_LOAD( "d_82s129.ic23", 0x000, 0x100, CRC(d5fd2dfd) SHA1(66e3afa9e73507db0647d125c0be992b27d08adc) ) + + ROM_REGION( 0x200, "palette", 0 ) + ROM_LOAD( "h_82s129.ic39", 0x100, 0x100, CRC(8e965fc3) SHA1(b52c8e505438937c7a5d3e1393d54f0ad0425e78) ) + ROM_LOAD( "l_82s129.ic40", 0x000, 0x100, CRC(4d061216) SHA1(1abf9320da75a3fd23c6bdbcc4088d18e133c4e5) ) +ROM_END -GAME( 1987, mastboyo, 0, mastboyo, mastboyo, mastboyo_state, empty_init, ROT0, "Gaelco (Covielsa license)", "Master Boy (1987, Z80 hardware, set 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1987, mastboyoa, mastboyo, mastboyo, mastboyo, mastboyo_state, empty_init, ROT0, "Gaelco (Covielsa license)", "Master Boy (1987, Z80 hardware, set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1987, mastboyo, 0, mastboyo, mastboyo, mastboyo_state, empty_init, ROT0, "Gaelco (Covielsa license)", "Master Boy (1987, Z80 hardware, Covielsa, set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1987, mastboyoa, mastboyo, mastboyo, mastboyo, mastboyo_state, empty_init, ROT0, "Gaelco (Covielsa license)", "Master Boy (1987, Z80 hardware, Covielsa, set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1987, mastboyob, mastboyo, mastboyo, mastboyo, mastboyo_state, empty_init, ROT0, "Gaelco (Ichi-Funtel license)", "Master Boy (1987, Z80 hardware, Ichi-Funtel)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/mephisto_brikett.cpp b/src/mame/drivers/mephisto_brikett.cpp index 5fce26cd829..4917ecba1ab 100644 --- a/src/mame/drivers/mephisto_brikett.cpp +++ b/src/mame/drivers/mephisto_brikett.cpp @@ -495,11 +495,18 @@ ROM_START( mephisto ) ROM_END -ROM_START( mephisto2 ) +ROM_START( mephisto2 ) // cartridge s/n 0302446 ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD("5619_03_351", 0x0000, 0x1000, CRC(5b13d7bf) SHA1(e1b7dee278a03f75e8a1554715fca4c7fbbc1cb8) ) // TC5334P - ROM_LOAD("5620_03_352", 0x1000, 0x1000, CRC(e93bf521) SHA1(42f9adce0d5e25b1b9d10217f8e3e0994d7b70d5) ) // " - ROM_LOAD("5621_03_353", 0x2000, 0x1000, CRC(430dac62) SHA1(a0e23fcb4cfa27778a9398bd4994a7792e4541d0) ) // " + ROM_LOAD("5619_03_351.1", 0x0000, 0x1000, CRC(5b13d7bf) SHA1(e1b7dee278a03f75e8a1554715fca4c7fbbc1cb8) ) // TC5334P + ROM_LOAD("5620_03_352.2", 0x1000, 0x1000, CRC(e93bf521) SHA1(42f9adce0d5e25b1b9d10217f8e3e0994d7b70d5) ) // " + ROM_LOAD("5621_03_353.3", 0x2000, 0x1000, CRC(430dac62) SHA1(a0e23fcb4cfa27778a9398bd4994a7792e4541d0) ) // " +ROM_END + +ROM_START( mephisto2a ) // cartridge s/n 0037011 + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD("4005_02_351_01.1", 0x0000, 0x1000, CRC(5b13d7bf) SHA1(e1b7dee278a03f75e8a1554715fca4c7fbbc1cb8) ) // HN462532G + ROM_LOAD("4005_02_352_01.2", 0x1000, 0x1000, CRC(da88b62f) SHA1(f5e71521ba8ab0b481e4725ffa706b1c157424b5) ) // " + ROM_LOAD("4005_02_353_01.3", 0x2000, 0x1000, CRC(1f933d33) SHA1(5d5bfd40158354830c434f4c8b4ff1cac8ab4f5c) ) // " ROM_END ROM_START( mephisto2e ) @@ -533,7 +540,8 @@ ROM_END // YEAR NAME PARENT CMP MACHINE INPUT STATE INIT COMPANY, FULLNAME, FLAGS CONS( 1980, mephisto, 0, 0, mephisto, mephisto, brikett_state, empty_init, "Hegener + Glaser", "Mephisto", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1981, mephisto2, 0, 0, mephisto2, mephisto, brikett_state, empty_init, "Hegener + Glaser", "Mephisto II", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1981, mephisto2, 0, 0, mephisto2, mephisto, brikett_state, empty_init, "Hegener + Glaser", "Mephisto II (set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1981, mephisto2a, mephisto2, 0, mephisto2, mephisto, brikett_state, empty_init, "Hegener + Glaser", "Mephisto II (set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) CONS( 1981, mephisto2e, mephisto2, 0, mephisto2e, mephisto2e, brikett_state, empty_init, "Hegener + Glaser", "Mephisto ESB II", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) CONS( 1983, mephisto3, 0, 0, mephisto3, mephisto3, brikett_state, empty_init, "Hegener + Glaser", "Mephisto III (ver. A)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) diff --git a/src/mame/drivers/nes_vt.cpp b/src/mame/drivers/nes_vt.cpp index 187bc4ebc9b..ae343acb51b 100644 --- a/src/mame/drivers/nes_vt.cpp +++ b/src/mame/drivers/nes_vt.cpp @@ -67,7 +67,6 @@ ***************************************************************************/ #include "emu.h" -#include "includes/nes.h" #include "cpu/m6502/n2a03.h" #include "machine/bankdev.h" #include "video/ppu2c0x_vt.h" @@ -76,16 +75,18 @@ #include "screen.h" #include "speaker.h" - -class nes_vt_state : public nes_base_state +class nes_vt_state : public driver_device { public: nes_vt_state(const machine_config& mconfig, device_type type, const char* tag) : - nes_base_state(mconfig, type, tag), + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_io0(*this, "IO0"), + m_io1(*this, "IO1"), m_screen(*this, "screen"), m_ppu(*this, "ppu"), m_apu(*this, "apu"), - m_csel(*this, "CARTSEL"), + m_cartsel(*this, "CARTSEL"), m_exin0(*this, "EXTRAIN0"), m_exin1(*this, "EXTRAIN1"), m_exin2(*this, "EXTRAIN2"), @@ -104,9 +105,8 @@ public: void nes_vt_base(machine_config& config); void nes_vt(machine_config& config); - void nes_vt_ddr(machine_config& config); - void nes_vt_xx(machine_config& config); + void nes_vt_4k_ram(machine_config& config); void nes_vt_sudopptv(machine_config& config); /* OneBus read callbacks for getting sprite and tile data during rendering */ @@ -125,10 +125,20 @@ protected: virtual void machine_start() override; virtual void machine_reset() override; + virtual DECLARE_READ8_MEMBER(in0_r); + virtual DECLARE_READ8_MEMBER(in1_r); + virtual DECLARE_WRITE8_MEMBER(in0_w); + uint32_t screen_update(screen_device& screen, bitmap_rgb32& bitmap, const rectangle& cliprect); void nes_vt_map(address_map& map); + required_device<cpu_device> m_maincpu; + optional_ioport m_io0; + optional_ioport m_io1; + uint8_t m_latch0; + uint8_t m_latch1; + required_device<screen_device> m_screen; required_device<ppu_vt03_device> m_ppu; required_device<nesapu_device> m_apu; @@ -160,7 +170,7 @@ protected: DECLARE_WRITE8_MEMBER(vt03_8000_w); DECLARE_WRITE8_MEMBER(vt03_4034_w); - optional_ioport m_csel; + optional_ioport m_cartsel; optional_ioport m_exin0; optional_ioport m_exin1; optional_ioport m_exin2; @@ -168,7 +178,7 @@ protected: required_device<address_map_bank_device> m_prg; - void nes_vt_xx_map(address_map& map); + void nes_vt_4k_ram_map(address_map& map); /* Misc */ DECLARE_READ8_MEMBER(rs232flags_region_r); @@ -219,7 +229,6 @@ private: int calculate_real_video_address(int addr, int extended, int readtype); - required_memory_bank m_prgbank0; required_memory_bank m_prgbank1; required_memory_bank m_prgbank2; @@ -338,6 +347,28 @@ private: DECLARE_READ8_MEMBER(vt03_415c_r); }; +class nes_vt_cy_lexibook_state : public nes_vt_cy_state +{ +public: + nes_vt_cy_lexibook_state(const machine_config& mconfig, device_type type, const char* tag) : + nes_vt_cy_state(mconfig, type, tag), + m_previous_port0(0), + m_latch0_bit(0), + m_latch1_bit(0) + { } + +protected: + virtual DECLARE_READ8_MEMBER(in0_r) override; + virtual DECLARE_READ8_MEMBER(in1_r) override; + virtual DECLARE_WRITE8_MEMBER(in0_w) override; + +private: + int m_previous_port0; + uint8_t m_latch0_bit; + uint8_t m_latch1_bit; +}; + + class nes_vt_dg_state : public nes_vt_state { public: @@ -393,8 +424,6 @@ public: nes_vt_ablpinb_state(const machine_config& mconfig, device_type type, const char* tag) : nes_vt_state(mconfig, type, tag), m_ablpinb_in0_val(0), - m_io0(*this, "IO0"), - m_io1(*this, "IO1"), m_plunger(*this, "PLUNGER") { } @@ -405,19 +434,15 @@ protected: virtual void machine_reset() override; private: - DECLARE_READ8_MEMBER(ablpinb_in0_r); - DECLARE_READ8_MEMBER(ablpinb_in1_r); - DECLARE_WRITE8_MEMBER(ablpinb_in0_w); - DECLARE_READ8_MEMBER(ablpinb_410f_r); + virtual DECLARE_READ8_MEMBER(in0_r) override; + virtual DECLARE_READ8_MEMBER(in1_r) override; + virtual DECLARE_WRITE8_MEMBER(in0_w) override; - void nes_vt_ablpinb_map(address_map& map); uint8_t m_ablpinb_in0_val; int m_plunger_off; int m_plunger_state_count; - required_ioport m_io0; - required_ioport m_io1; required_ioport m_plunger; }; @@ -425,9 +450,7 @@ class nes_vt_sudoku_state : public nes_vt_state { public: nes_vt_sudoku_state(const machine_config& mconfig, device_type type, const char* tag) : - nes_vt_state(mconfig, type, tag), - m_io0(*this, "IO0"), - m_io1(*this, "IO1") + nes_vt_state(mconfig, type, tag) { } void init_sudoku(); @@ -439,23 +462,16 @@ protected: //virtual void machine_reset() override; private: - DECLARE_READ8_MEMBER(in0_r); - DECLARE_READ8_MEMBER(in1_r); - DECLARE_WRITE8_MEMBER(in0_w); - - void nes_vt_sudoku_map(address_map& map); - - required_ioport m_io0; - required_ioport m_io1; + virtual DECLARE_READ8_MEMBER(in0_r) override; + virtual DECLARE_READ8_MEMBER(in1_r) override; + virtual DECLARE_WRITE8_MEMBER(in0_w) override; }; class nes_vt_majgnc_state : public nes_vt_state { public: nes_vt_majgnc_state(const machine_config& mconfig, device_type type, const char* tag) : - nes_vt_state(mconfig, type, tag), - m_io0(*this, "IO0"), - m_io1(*this, "IO1") + nes_vt_state(mconfig, type, tag) { } void nes_vt_majgnc(machine_config& config); @@ -463,15 +479,74 @@ public: protected: private: - DECLARE_READ8_MEMBER(in0_r); - DECLARE_READ8_MEMBER(in1_r); - DECLARE_WRITE8_MEMBER(in0_w); +}; - void nes_vt_majgnc_map(address_map& map); +/* Standard I/O handlers (NES Controller clone) */ + +READ8_MEMBER(nes_vt_state::in0_r) +{ + //logerror("%s: in0_r\n", machine().describe_context()); + uint8_t ret = 0x40; + ret |= m_latch0 & 1; + m_latch0 >>= 1; + return ret; +} + +READ8_MEMBER(nes_vt_state::in1_r) +{ + //logerror("%s: in1_r\n", machine().describe_context()); + uint8_t ret = 0x40; + ret |= m_latch1 & 1; + m_latch1 >>= 1; + return ret; +} + +WRITE8_MEMBER(nes_vt_state::in0_w) +{ + //logerror("%s: in0_w %02x\n", machine().describe_context(), data); + if (data & 0x01) + return; + + m_latch0 = m_io0->read(); + m_latch1 = m_io1->read(); +} + +/* Lexibook I/O handlers */ + +READ8_MEMBER(nes_vt_cy_lexibook_state::in0_r) +{ + //logerror("%s: in0_r\n", machine().describe_context()); + uint8_t ret = m_latch0_bit; + return ret; +} + +READ8_MEMBER(nes_vt_cy_lexibook_state::in1_r) +{ + //logerror("%s: in1_r\n", machine().describe_context()); + uint8_t ret = m_latch1_bit; + return ret; +} + +WRITE8_MEMBER(nes_vt_cy_lexibook_state::in0_w) +{ + //logerror("%s: in0_w %02x\n", machine().describe_context(), data); + if ((!(data & 0x01)) && (m_previous_port0 & 0x01)) // 0x03 -> 0x02 transition + { + m_latch0 = m_io0->read(); + m_latch1 = m_io1->read(); + } + + if ((!(data & 0x02)) && (m_previous_port0 & 0x02)) // 0x02 -> 0x00 transition + { + m_latch0_bit = m_latch0 & 0x01; + m_latch0 >>= 1; + m_latch1_bit = m_latch1 & 0x01; + m_latch1 >>= 1; + } + + m_previous_port0 = data; +} - required_ioport m_io0; - required_ioport m_io1; -}; uint32_t nes_vt_state::get_banks(uint8_t bnk) { @@ -708,22 +783,22 @@ WRITE8_MEMBER(nes_vt_dg_state::vtfa_412c_w) m_ahigh |= (data & 0x01) ? (1 << 25) : 0x0; m_ahigh |= (data & 0x02) ? (1 << 24) : 0x0; - //m_ahigh |= (m_csel->read() == 0x01) ? (1 << 25) : 0x0; + //m_ahigh |= (m_cartsel->read() == 0x01) ? (1 << 25) : 0x0; update_banks(); } READ8_MEMBER(nes_vt_dg_state::vtfa_412c_r) { - if (m_csel) - return m_csel->read(); + if (m_cartsel) + return m_cartsel->read(); else return 0; } READ8_MEMBER(nes_vt_hh_state::vtfp_412d_r) { - if (m_csel) - return m_csel->read(); + if (m_cartsel) + return m_cartsel->read(); else return 0; } @@ -968,8 +1043,8 @@ void nes_vt_state::machine_reset() m_411d = 0x00; m_4242 = 0x00; - if (m_csel) - m_ahigh = (m_csel->read() == 0x01) ? (1 << 25) : 0x0; + if (m_cartsel) + m_ahigh = (m_cartsel->read() == 0x01) ? (1 << 25) : 0x0; else m_ahigh = 0; @@ -1473,7 +1548,7 @@ WRITE8_MEMBER(nes_vt_state::extra_io_control_w) 0x80 Extra I/O port 3 enable (1 = enable, 0 = disable) */ - logerror("%s: extra_io_control_w %02x\n", data); + logerror("%s: extra_io_control_w %02x\n", machine().describe_context(), data); } READ8_MEMBER(nes_vt_state::extrain_01_r) @@ -1557,7 +1632,7 @@ void nes_vt_ablpinb_state::machine_reset() } -READ8_MEMBER(nes_vt_ablpinb_state::ablpinb_in0_r) +READ8_MEMBER(nes_vt_ablpinb_state::in0_r) { if (m_plunger_off) { @@ -1586,7 +1661,7 @@ READ8_MEMBER(nes_vt_ablpinb_state::ablpinb_in0_r) } -READ8_MEMBER(nes_vt_ablpinb_state::ablpinb_in1_r) +READ8_MEMBER(nes_vt_ablpinb_state::in1_r) { uint8_t i = machine().rand() & 0x10; @@ -1598,14 +1673,14 @@ READ8_MEMBER(nes_vt_ablpinb_state::ablpinb_in1_r) return i | ret; } -WRITE8_MEMBER(nes_vt_ablpinb_state::ablpinb_in0_w) +WRITE8_MEMBER(nes_vt_ablpinb_state::in0_w) { // write 0x04 to 0x4016 sets bit 0x08 in 0x4017 // write 0x00 to 0x4016 clears bit 0x08 in 0x4017 // could be related to vibration motor? m_ablpinb_in0_val = data; - logerror("ablpinb_in0_w %02x\n", data); + logerror("in0_w %02x\n", data); } READ8_MEMBER(nes_vt_sudoku_state::in0_r) @@ -1622,20 +1697,6 @@ WRITE8_MEMBER(nes_vt_sudoku_state::in0_w) { } -READ8_MEMBER(nes_vt_majgnc_state::in0_r) -{ - return 0x00;// machine().rand(); -} - -READ8_MEMBER(nes_vt_majgnc_state::in1_r) -{ - return 0x00;// machine().rand(); -} - -WRITE8_MEMBER(nes_vt_majgnc_state::in0_w) -{ -} - void nes_vt_state::nes_vt_map(address_map &map) { map(0x0000, 0x07ff).ram(); @@ -1644,8 +1705,8 @@ void nes_vt_state::nes_vt_map(address_map &map) map(0x4000, 0x4013).rw(m_apu, FUNC(nesapu_device::read), FUNC(nesapu_device::write)); map(0x4014, 0x4014).r(FUNC(nes_vt_state::psg1_4014_r)).w(FUNC(nes_vt_state::vt_dma_w)); map(0x4015, 0x4015).rw(FUNC(nes_vt_state::psg1_4015_r), FUNC(nes_vt_state::psg1_4015_w)); /* PSG status / first control register */ - map(0x4016, 0x4016).rw(FUNC(nes_vt_state::nes_in0_r), FUNC(nes_vt_state::nes_in0_w)); - map(0x4017, 0x4017).r(FUNC(nes_vt_state::nes_in1_r)).w(FUNC(nes_vt_state::psg1_4017_w)); + map(0x4016, 0x4016).rw(FUNC(nes_vt_state::in0_r), FUNC(nes_vt_state::in0_w)); + map(0x4017, 0x4017).r(FUNC(nes_vt_state::in1_r)).w(FUNC(nes_vt_state::psg1_4017_w)); map(0x4034, 0x4034).w(FUNC(nes_vt_state::vt03_4034_w)); @@ -1668,36 +1729,8 @@ void nes_vt_state::nes_vt_map(address_map &map) map(0x6000, 0x7fff).ram(); } -void nes_vt_ablpinb_state::nes_vt_ablpinb_map(address_map& map) -{ - nes_vt_map(map); - - // override the inputs as specific non-standard 'controller' behavior is needed here and adding it to the generic NES controller bus wouldn't make sense. - map(0x4016, 0x4016).rw(FUNC(nes_vt_ablpinb_state::ablpinb_in0_r), FUNC(nes_vt_ablpinb_state::ablpinb_in0_w)); - map(0x4017, 0x4017).r(FUNC(nes_vt_ablpinb_state::ablpinb_in1_r)); -} - -void nes_vt_sudoku_state::nes_vt_sudoku_map(address_map& map) -{ - nes_vt_map(map); - - // override the inputs as specific non-standard 'controller' behavior is needed here and adding it to the generic NES controller bus wouldn't make sense. - map(0x4016, 0x4016).rw(FUNC(nes_vt_sudoku_state::in0_r),FUNC(nes_vt_sudoku_state::in0_w)); - map(0x4017, 0x4017).r(FUNC(nes_vt_sudoku_state::in1_r)); -} - -void nes_vt_majgnc_state::nes_vt_majgnc_map(address_map& map) -{ - nes_vt_map(map); - - map(0x4014, 0x4014).w(FUNC(nes_vt_majgnc_state::vt_dma_w)); - - map(0x4016, 0x4016).rw(FUNC(nes_vt_majgnc_state::in0_r),FUNC(nes_vt_majgnc_state::in0_w)); - map(0x4017, 0x4017).r(FUNC(nes_vt_majgnc_state::in1_r)); -} - /* Some later VT models have more RAM */ -void nes_vt_state::nes_vt_xx_map(address_map &map) +void nes_vt_state::nes_vt_4k_ram_map(address_map &map) { nes_vt_map(map); map(0x0800, 0x0fff).ram(); @@ -1711,7 +1744,7 @@ void nes_vt_ablping_state::nes_vt_ablping_map(address_map &map) void nes_vt_cy_state::nes_vt_cy_map(address_map &map) { - nes_vt_xx_map(map); + nes_vt_4k_ram_map(map); map(0x41b0, 0x41bf).r(FUNC(nes_vt_cy_state::vt03_41bx_r)).w(FUNC(nes_vt_cy_state::vt03_41bx_w)); map(0x48a0, 0x48af).r(FUNC(nes_vt_cy_state::vt03_48ax_r)).w(FUNC(nes_vt_cy_state::vt03_48ax_w)); map(0x4130, 0x4136).r(FUNC(nes_vt_cy_state::vt03_413x_r)).w(FUNC(nes_vt_cy_state::vt03_413x_w)); @@ -1722,7 +1755,7 @@ void nes_vt_cy_state::nes_vt_cy_map(address_map &map) void nes_vt_cy_state::nes_vt_bt_map(address_map &map) { - nes_vt_xx_map(map); + nes_vt_4k_ram_map(map); map(0x412c, 0x412c).w(FUNC(nes_vt_cy_state::vt03_412c_w)); } @@ -1734,8 +1767,8 @@ void nes_vt_hh_state::nes_vt_hh_map(address_map &map) map(0x4000, 0x4013).rw(m_apu, FUNC(nesapu_device::read), FUNC(nesapu_device::write)); map(0x4015, 0x4015).rw(FUNC(nes_vt_hh_state::psg1_4015_r), FUNC(nes_vt_hh_state::psg1_4015_w)); /* PSG status / first control register */ - map(0x4016, 0x4016).rw(FUNC(nes_vt_hh_state::nes_in0_r), FUNC(nes_vt_hh_state::nes_in0_w)); - map(0x4017, 0x4017).r(FUNC(nes_vt_hh_state::nes_in1_r)).w(FUNC(nes_vt_hh_state::psg1_4017_w)); + map(0x4016, 0x4016).rw(FUNC(nes_vt_hh_state::in0_r), FUNC(nes_vt_hh_state::in0_w)); + map(0x4017, 0x4017).r(FUNC(nes_vt_hh_state::in1_r)).w(FUNC(nes_vt_hh_state::psg1_4017_w)); map(0x4100, 0x410b).r(FUNC(nes_vt_hh_state::vt03_410x_r)).w(FUNC(nes_vt_hh_state::vt03_410x_w)); @@ -1784,8 +1817,8 @@ void nes_vt_dg_state::nes_vt_dg_map(address_map &map) map(0x4000, 0x4013).rw(m_apu, FUNC(nesapu_device::read), FUNC(nesapu_device::write)); map(0x4015, 0x4015).rw(FUNC(nes_vt_dg_state::psg1_4015_r), FUNC(nes_vt_dg_state::psg1_4015_w)); /* PSG status / first control register */ - map(0x4016, 0x4016).rw(FUNC(nes_vt_dg_state::nes_in0_r), FUNC(nes_vt_dg_state::nes_in0_w)); - map(0x4017, 0x4017).r(FUNC(nes_vt_dg_state::nes_in1_r)).w(FUNC(nes_vt_dg_state::psg1_4017_w)); + map(0x4016, 0x4016).rw(FUNC(nes_vt_dg_state::in0_r), FUNC(nes_vt_dg_state::in0_w)); + map(0x4017, 0x4017).r(FUNC(nes_vt_dg_state::in1_r)).w(FUNC(nes_vt_dg_state::psg1_4017_w)); map(0x4100, 0x410b).r(FUNC(nes_vt_dg_state::vt03_410x_r)).w(FUNC(nes_vt_dg_state::vt03_410x_w)); @@ -1926,42 +1959,22 @@ void nes_vt_ablpinb_state::nes_vt_ablpinb(machine_config &config) (ppu2c0x_device::VBLANK_LAST_SCANLINE_PAL - ppu2c0x_device::VBLANK_FIRST_SCANLINE_PALC + 1 + 2))); m_screen->set_size(32 * 8, 312); m_screen->set_visarea(0 * 8, 32 * 8 - 1, 0 * 8, 30 * 8 - 1); - - // override for controllers - m_maincpu->set_addrmap(AS_PROGRAM, &nes_vt_ablpinb_state::nes_vt_ablpinb_map); } void nes_vt_sudoku_state::nes_vt_sudoku(machine_config &config) { nes_vt_base(config); - m_maincpu->set_addrmap(AS_PROGRAM, &nes_vt_sudoku_state::nes_vt_sudoku_map); } void nes_vt_majgnc_state::nes_vt_majgnc(machine_config &config) { nes_vt_base(config); - m_maincpu->set_addrmap(AS_PROGRAM, &nes_vt_majgnc_state::nes_vt_majgnc_map); m_ppu->set_palette_mode(PAL_MODE_NEW_VG); } void nes_vt_state::nes_vt(machine_config &config) { nes_vt_base(config); - - NES_CONTROL_PORT(config, m_ctrl1, nes_control_port1_devices, "joypad"); - NES_CONTROL_PORT(config, m_ctrl2, nes_control_port2_devices, "joypad"); - m_ctrl1->set_screen_tag(m_screen); - m_ctrl2->set_screen_tag(m_screen); -} - -void nes_vt_state::nes_vt_ddr(machine_config &config) -{ - nes_vt_base(config); - - NES_CONTROL_PORT(config, m_ctrl1, majesco_control_port1_devices, "ddr"); - NES_CONTROL_PORT(config, m_ctrl2, majesco_control_port2_devices, nullptr); - m_ctrl1->set_screen_tag(m_screen); - m_ctrl2->set_screen_tag(m_screen); } void nes_vt_state::nes_vt_sudopptv(machine_config &config) @@ -2002,27 +2015,27 @@ void nes_vt_ablping_state::nes_vt_ablping(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &nes_vt_ablping_state::nes_vt_ablping_map); } -void nes_vt_state::nes_vt_xx(machine_config &config) +void nes_vt_state::nes_vt_4k_ram(machine_config &config) { nes_vt(config); - m_maincpu->set_addrmap(AS_PROGRAM, &nes_vt_state::nes_vt_xx_map); + m_maincpu->set_addrmap(AS_PROGRAM, &nes_vt_state::nes_vt_4k_ram_map); } void nes_vt_cy_state::nes_vt_cy(machine_config &config) { - nes_vt_xx(config); + nes_vt_4k_ram(config); m_maincpu->set_addrmap(AS_PROGRAM, &nes_vt_cy_state::nes_vt_cy_map); } void nes_vt_cy_state::nes_vt_bt(machine_config &config) { - nes_vt_xx(config); + nes_vt_4k_ram(config); m_maincpu->set_addrmap(AS_PROGRAM, &nes_vt_cy_state::nes_vt_bt_map); } void nes_vt_dg_state::nes_vt_dg(machine_config &config) { - nes_vt_xx(config); + nes_vt_4k_ram(config); m_maincpu->set_addrmap(AS_PROGRAM, &nes_vt_dg_state::nes_vt_dg_map); m_screen->set_refresh_hz(50.0070); @@ -2052,7 +2065,7 @@ void nes_vt_hh_state::nes_vt_vg_baddma(machine_config &config) // New mystery handheld architecture, VTxx derived void nes_vt_hh_state::nes_vt_hh(machine_config &config) { - nes_vt_xx(config); + nes_vt_4k_ram(config); m_maincpu->set_addrmap(AS_PROGRAM, &nes_vt_hh_state::nes_vt_hh_map); m_ppu->set_palette_mode(PAL_MODE_NEW_RGB); @@ -2065,12 +2078,45 @@ void nes_vt_hh_state::nes_vt_hh(machine_config &config) } static INPUT_PORTS_START( nes_vt ) - PORT_START("CARTSEL") + PORT_START("IO0") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("A") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("B") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(1) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(1) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_8WAY + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_8WAY + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_8WAY + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_8WAY + + PORT_START("IO1") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("A") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("B") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_PLAYER(2) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) PORT_PLAYER(2) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_8WAY + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_8WAY + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_8WAY + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_8WAY +INPUT_PORTS_END + +static INPUT_PORTS_START( nes_vt_ddr ) + PORT_START("IO0") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_NAME("Up Arrow") PORT_16WAY // NOT A JOYSTICK!! + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_NAME("Down Arrow") PORT_16WAY + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_NAME("Left Arrow") PORT_16WAY + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_NAME("Right Arrow") PORT_16WAY + + PORT_START("IO1") + PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END void nes_vt_hh_state::nes_vt_fp(machine_config &config) { - nes_vt_xx(config); + nes_vt_4k_ram(config); m_maincpu->set_addrmap(AS_PROGRAM, &nes_vt_hh_state::nes_vt_fp_map); m_ppu->set_palette_mode(PAL_MODE_NEW_RGB12); @@ -2078,7 +2124,7 @@ void nes_vt_hh_state::nes_vt_fp(machine_config &config) void nes_vt_dg_state::nes_vt_fa(machine_config &config) { - nes_vt_xx(config); + nes_vt_4k_ram(config); m_maincpu->set_addrmap(AS_PROGRAM, &nes_vt_dg_state::nes_vt_fa_map); } @@ -2100,9 +2146,9 @@ void nes_vt_ts_state::nes_vt_ts(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &nes_vt_ts_state::nes_vt_ts_map); } - - static INPUT_PORTS_START( nes_vt_fp ) + PORT_INCLUDE(nes_vt) + PORT_START("CARTSEL") PORT_DIPNAME( 0x06, 0x00, "Cartridge Select" ) PORT_CODE(KEYCODE_3) PORT_TOGGLE PORT_DIPSETTING( 0x00, "472-in-1" ) @@ -2110,6 +2156,8 @@ static INPUT_PORTS_START( nes_vt_fp ) INPUT_PORTS_END static INPUT_PORTS_START( nes_vt_fa ) + PORT_INCLUDE(nes_vt) + PORT_START("CARTSEL") PORT_DIPNAME( 0x01, 0x00, "Cartridge Select" ) PORT_CODE(KEYCODE_3) PORT_TOGGLE PORT_DIPSETTING( 0x00, "508-in-1" ) @@ -2140,62 +2188,41 @@ static INPUT_PORTS_START( ablpinb ) INPUT_PORTS_END static INPUT_PORTS_START( sudoku ) - PORT_START("IO0") - PORT_START("IO1") + PORT_INCLUDE(nes_vt) INPUT_PORTS_END +// the test mode shows 2 gamepads, however this is not the control scheme the game uses +// there is a reset button too but it doesn't seem to be a software switch static INPUT_PORTS_START( majgnc ) - PORT_START("IO0") - PORT_DIPNAME( 0x01, 0x01, "0" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_INCLUDE(nes_vt) - PORT_START("IO1") - PORT_DIPNAME( 0x01, 0x01, "1" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_MODIFY("IO0") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("1") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("2") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START ) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_8WAY + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_8WAY + + PORT_MODIFY("IO1") + PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("EXTRAIN0") + PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("EXTRAIN1") + PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("EXTRAIN2") + PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED ) + + PORT_START("EXTRAIN3") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("3") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("5 / BET") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("4") INPUT_PORTS_END void nes_vt_sudoku_state::init_sudoku() @@ -2301,8 +2328,9 @@ ROM_START( lxcmcy ) ROM_END ROM_START( lxcmcysw ) - ROM_REGION( 0x4000000, "mainrom", 0 ) - ROM_LOAD( "jl2365swr-1.u2", 0x00000, 0x4000000, CRC(60ece391) SHA1(655de6b36ba596d873de2839522b948ccf45e006) ) + ROM_REGION( 0x2000000, "mainrom", 0 ) + ROM_LOAD( "jl2365swr-1.u2", 0x00000, 0x2000000, CRC(60ece391) SHA1(655de6b36ba596d873de2839522b948ccf45e006) ) + ROM_CONTINUE(0x0000000, 0x2000000) ROM_END ROM_START( lxcmcyfz ) @@ -2665,11 +2693,11 @@ CONS( 200?, vgpmini, 0, 0, nes_vt_vg, nes_vt, nes_vt_hh_state, empty_init, " CONS( 200?, dgun2500, 0, 0, nes_vt_dg, nes_vt, nes_vt_dg_state, empty_init, "dreamGEAR", "dreamGEAR Wireless Motion Control with 130 games (DGUN-2500)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND) // don't even get to menu. very enhanced chipset, VT368/9? -CONS( 2012, dgun2561, 0, 0, nes_vt_cy, nes_vt, nes_vt_cy_state, empty_init, "dreamGEAR", "dreamGEAR My Arcade Portable Gaming System (DGUN-2561)", MACHINE_NOT_WORKING ) -CONS( 200?, lxcmcy, 0, 0, nes_vt_cy, nes_vt, nes_vt_cy_state, empty_init, "Lexibook", "Lexibook Compact Cyber Arcade", MACHINE_NOT_WORKING ) -CONS( 200?, lxcmc250, 0, 0, nes_vt_cy, nes_vt, nes_vt_cy_state, empty_init, "Lexibook", "Lexibook Compact Cyber Arcade - 250-in-1 (JL2375)", MACHINE_NOT_WORKING ) -CONS( 200?, lxcmcysw, 0, 0, nes_vt_cy, nes_vt, nes_vt_cy_state, empty_init, "Lexibook", "Lexibook Compact Cyber Arcade - Star Wars Rebels", MACHINE_NOT_WORKING ) -CONS( 200?, lxcmcyfz, 0, 0, nes_vt_cy, nes_vt, nes_vt_cy_state, empty_init, "Lexibook", "Lexibook Compact Cyber Arcade - Frozen", MACHINE_NOT_WORKING ) +CONS( 2012, dgun2561, 0, 0, nes_vt_cy, nes_vt, nes_vt_cy_lexibook_state, empty_init, "dreamGEAR", "dreamGEAR My Arcade Portable Gaming System (DGUN-2561)", MACHINE_NOT_WORKING ) +CONS( 200?, lxcmcy, 0, 0, nes_vt_cy, nes_vt, nes_vt_cy_lexibook_state, empty_init, "Lexibook", "Lexibook Compact Cyber Arcade", MACHINE_NOT_WORKING ) +CONS( 200?, lxcmc250, 0, 0, nes_vt_cy, nes_vt, nes_vt_cy_lexibook_state, empty_init, "Lexibook", "Lexibook Compact Cyber Arcade - 250-in-1 (JL2375)", MACHINE_NOT_WORKING ) +CONS( 200?, lxcmcysw, 0, 0, nes_vt_cy, nes_vt, nes_vt_cy_lexibook_state, empty_init, "Lexibook", "Lexibook Compact Cyber Arcade - Star Wars Rebels", MACHINE_NOT_WORKING ) +CONS( 200?, lxcmcyfz, 0, 0, nes_vt_cy, nes_vt, nes_vt_cy_lexibook_state, empty_init, "Lexibook", "Lexibook Compact Cyber Arcade - Frozen", MACHINE_NOT_WORKING ) // Also Lexibook Compact Cyber Arcade - Disney Princesses // Lexibook Compact Cyber Arcade - Cars // Lexibook Compact Cyber Arcade - Paw Patrol @@ -2732,8 +2760,8 @@ CONS( 200?, gprnrs16, 0, 0, nes_vt, nes_vt, nes_vt_state, empty_ini // Notes about the DDR games: // * Missing PCM sounds (unsupported in NES VT APU code right now) // * Console has stereo output (dual RCA connectors). -CONS( 2006, ddrdismx, 0, 0, nes_vt_ddr, nes_vt, nes_vt_state, empty_init, "Majesco (licensed from Konami, Disney)", "Dance Dance Revolution Disney Mix", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) // shows (c)2001 Disney onscreen, but that's recycled art from the Playstation release, actual release was 2006 -CONS( 2006, ddrstraw, 0, 0, nes_vt_ddr, nes_vt, nes_vt_state, empty_init, "Majesco (licensed from Konami)", "Dance Dance Revolution Strawberry Shortcake", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) +CONS( 2006, ddrdismx, 0, 0, nes_vt, nes_vt_ddr, nes_vt_state, empty_init, "Majesco (licensed from Konami, Disney)", "Dance Dance Revolution Disney Mix", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) // shows (c)2001 Disney onscreen, but that's recycled art from the Playstation release, actual release was 2006 +CONS( 2006, ddrstraw, 0, 0, nes_vt, nes_vt_ddr, nes_vt_state, empty_init, "Majesco (licensed from Konami)", "Dance Dance Revolution Strawberry Shortcake", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) @@ -2765,7 +2793,7 @@ CONS( 201?, mc_89in1, 0, 0, nes_vt, nes_vt, nes_vt_state, empty_ini CONS( 201?, mc_pg150, 0, 0, nes_vt_bt, nes_vt, nes_vt_cy_state, empty_init, "<unknown>", "Pocket Games 150 in 1", MACHINE_NOT_WORKING ) // No title screen, but press start and menu and games run fine. Makes odd // memory accesses which probably explain broken title screen -CONS( 201?, mc_hh210, 0, 0, nes_vt_xx, nes_vt, nes_vt_state, empty_init, "<unknown>", "Handheld 210 in 1", MACHINE_NOT_WORKING ) +CONS( 201?, mc_hh210, 0, 0, nes_vt_4k_ram, nes_vt, nes_vt_state, empty_init, "<unknown>", "Handheld 210 in 1", MACHINE_NOT_WORKING ) // First half of games don't work, probably bad dump CONS( 201?, dvnimbus, 0, 0, nes_vt_vg, nes_vt, nes_vt_hh_state, empty_init, "<unknown>", "DVTech Nimbus 176 in 1", MACHINE_NOT_WORKING ) // Works fine, VT02 based diff --git a/src/mame/drivers/spg2xx.cpp b/src/mame/drivers/spg2xx.cpp index e17b256d820..4091d27d68e 100644 --- a/src/mame/drivers/spg2xx.cpp +++ b/src/mame/drivers/spg2xx.cpp @@ -148,6 +148,7 @@ *******************************************************************************/ +#include "emu.h" #include "includes/spg2xx.h" /************************* diff --git a/src/mame/drivers/spg2xx_dreamlife.cpp b/src/mame/drivers/spg2xx_dreamlife.cpp index 53fb40bd29e..e580c308d49 100644 --- a/src/mame/drivers/spg2xx_dreamlife.cpp +++ b/src/mame/drivers/spg2xx_dreamlife.cpp @@ -1,7 +1,9 @@ // license:BSD-3-Clause // copyright-holders:Ryan Holtz, David Haywood +#include "emu.h" #include "includes/spg2xx.h" + #include "machine/eepromser.h" class dreamlif_state : public spg2xx_game_state diff --git a/src/mame/drivers/spg2xx_ican.cpp b/src/mame/drivers/spg2xx_ican.cpp index 01e2f570fa9..c0892d8feb2 100644 --- a/src/mame/drivers/spg2xx_ican.cpp +++ b/src/mame/drivers/spg2xx_ican.cpp @@ -3,10 +3,13 @@ /* Fisher Price / Mattel "I Can..." systems */ +#include "emu.h" #include "includes/spg2xx.h" + #include "bus/generic/slot.h" #include "bus/generic/carts.h" + class icanguit_state : public spg2xx_game_state { public: diff --git a/src/mame/drivers/spg2xx_jakks.cpp b/src/mame/drivers/spg2xx_jakks.cpp index 18590249053..46bbd408382 100644 --- a/src/mame/drivers/spg2xx_jakks.cpp +++ b/src/mame/drivers/spg2xx_jakks.cpp @@ -3,9 +3,12 @@ // Note: even after the GameKey port was physically removed and the PCBs redesigned, many of the test modes still show the value read from the port (and many games still show the Game Key Ready splash screen on startup) +#include "emu.h" #include "includes/spg2xx.h" + #include "bus/jakks_gamekey/slot.h" + class jakks_gkr_state : public spg2xx_game_state { public: diff --git a/src/mame/drivers/spg2xx_lexibook.cpp b/src/mame/drivers/spg2xx_lexibook.cpp index 4519dd4dde1..3257dc86bc3 100644 --- a/src/mame/drivers/spg2xx_lexibook.cpp +++ b/src/mame/drivers/spg2xx_lexibook.cpp @@ -1,8 +1,10 @@ // license:BSD-3-Clause // copyright-holders:Ryan Holtz, David Haywood +#include "emu.h" #include "includes/spg2xx.h" + class spg2xx_lexiseal_game_state : public spg2xx_game_state { public: @@ -252,10 +254,14 @@ ROM_START( lexiseal ) ROM_LOAD16_WORD_SWAP( "lexibook_seal.bin", 0x0000, 0x1000000, CRC(3529f154) SHA1(f5f142600c6b2d037b97e007364ea2fa228e0163) ) ROM_END - +ROM_START( discpal ) + ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "disneyhh.bin", 0x0000, 0x400000, CRC(5fb7f32e) SHA1(795c992826ad4ac66d5438207f1c9b48f9fadc44) ) +ROM_END // Similar, SPG260?, scrambled CONS( 200?, lexizeus, 0, 0, lexizeus, lexizeus, spg2xx_lexiseal_game_state, init_zeus, "Lexibook", "Zeus IG900 20-in-1 (US?)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // bad sound and some corrupt bg tilemap entries in Tiger Rescue, verify ROM data (same game runs in Zone 60 without issue) CONS( 200?, lexiseal, 0, 0, lexiseal, lexiseal, spg2xx_lexiseal_game_state, init_zeus, "Lexibook / Sit Up Limited", "Seal 50-in-1", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // also has bad sound in Tiger Rescue, but no corrupt tilemap - +CONS( 200?, discpal, 0, 0, lexiseal, lexiseal, spg2xx_lexiseal_game_state, init_zeus, "Performance Designed Products / Disney / Jungle Soft", "Disney Game It! Classic Pals", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +// there was also a Game It! Princess Pals
\ No newline at end of file diff --git a/src/mame/drivers/spg2xx_pdc.cpp b/src/mame/drivers/spg2xx_pdc.cpp index 37bd32d212d..a42d798c1ca 100644 --- a/src/mame/drivers/spg2xx_pdc.cpp +++ b/src/mame/drivers/spg2xx_pdc.cpp @@ -1,8 +1,10 @@ // license:BSD-3-Clause // copyright-holders:Ryan Holtz, David Haywood +#include "emu.h" #include "includes/spg2xx.h" + class spg2xx_pdc100_game_state : public spg2xx_game_state { public: diff --git a/src/mame/drivers/spg2xx_playvision.cpp b/src/mame/drivers/spg2xx_playvision.cpp index 7d8650d345b..5fafc471b8f 100644 --- a/src/mame/drivers/spg2xx_playvision.cpp +++ b/src/mame/drivers/spg2xx_playvision.cpp @@ -1,7 +1,9 @@ // license:BSD-3-Clause // copyright-holders:Ryan Holtz, David Haywood +#include "emu.h" #include "includes/spg2xx.h" + #include "pvmil.lh" diff --git a/src/mame/drivers/spg2xx_senario.cpp b/src/mame/drivers/spg2xx_senario.cpp index 4b217e1063a..dc8c945d87f 100644 --- a/src/mame/drivers/spg2xx_senario.cpp +++ b/src/mame/drivers/spg2xx_senario.cpp @@ -14,9 +14,12 @@ */ +#include "emu.h" #include "includes/spg2xx.h" + #include "machine/intelfsh.h" + class spg2xx_senario_state : public spg2xx_game_state { public: diff --git a/src/mame/drivers/spg2xx_senario_poker.cpp b/src/mame/drivers/spg2xx_senario_poker.cpp index 3a532ba3d30..6cbba4ada8b 100644 --- a/src/mame/drivers/spg2xx_senario_poker.cpp +++ b/src/mame/drivers/spg2xx_senario_poker.cpp @@ -8,7 +8,9 @@ improve controller hookup / simulation and remove PC-based hacks! */ +#include "emu.h" #include "includes/spg2xx.h" + #include "sentx6p.lh" diff --git a/src/mame/drivers/spg2xx_shredmjr.cpp b/src/mame/drivers/spg2xx_shredmjr.cpp index bc6304e12ed..09cbdfbc101 100644 --- a/src/mame/drivers/spg2xx_shredmjr.cpp +++ b/src/mame/drivers/spg2xx_shredmjr.cpp @@ -1,8 +1,10 @@ // license:BSD-3-Clause // copyright-holders:Ryan Holtz, David Haywood +#include "emu.h" #include "includes/spg2xx.h" + class shredmjr_game_state : public spg2xx_game_state { public: diff --git a/src/mame/drivers/spg2xx_telestory.cpp b/src/mame/drivers/spg2xx_telestory.cpp index bfc9537bd8e..97fde832e7e 100644 --- a/src/mame/drivers/spg2xx_telestory.cpp +++ b/src/mame/drivers/spg2xx_telestory.cpp @@ -1,10 +1,13 @@ // license:BSD-3-Clause // copyright-holders:Ryan Holtz, David Haywood +#include "emu.h" #include "includes/spg2xx.h" + #include "bus/generic/slot.h" #include "bus/generic/carts.h" + class telestory_state : public spg2xx_game_state { public: diff --git a/src/mame/drivers/spg2xx_tvgogo.cpp b/src/mame/drivers/spg2xx_tvgogo.cpp index 47208b85a09..8fe9e3948c2 100644 --- a/src/mame/drivers/spg2xx_tvgogo.cpp +++ b/src/mame/drivers/spg2xx_tvgogo.cpp @@ -1,10 +1,13 @@ // license:BSD-3-Clause // copyright-holders:Ryan Holtz, David Haywood +#include "emu.h" #include "includes/spg2xx.h" + #include "bus/generic/slot.h" #include "bus/generic/carts.h" + class tvgogo_state : public spg2xx_game_state { public: diff --git a/src/mame/drivers/spg2xx_vii.cpp b/src/mame/drivers/spg2xx_vii.cpp index 00f71242817..537d2cdd8c9 100644 --- a/src/mame/drivers/spg2xx_vii.cpp +++ b/src/mame/drivers/spg2xx_vii.cpp @@ -3,10 +3,13 @@ /* 'Zone' systems */ +#include "emu.h" #include "includes/spg2xx.h" + #include "bus/generic/slot.h" #include "bus/generic/carts.h" + class vii_state : public spg2xx_game_state { public: diff --git a/src/mame/drivers/spg2xx_zone.cpp b/src/mame/drivers/spg2xx_zone.cpp index e31a57533a4..0f74d332205 100644 --- a/src/mame/drivers/spg2xx_zone.cpp +++ b/src/mame/drivers/spg2xx_zone.cpp @@ -3,8 +3,10 @@ /* 'Zone' systems */ +#include "emu.h" #include "includes/spg2xx.h" + class wireless60_state : public spg2xx_game_state { public: diff --git a/src/mame/drivers/spg2xx_zone_32bit.cpp b/src/mame/drivers/spg2xx_zone_32bit.cpp index 7a048a4b2e8..c056fc15f92 100644 --- a/src/mame/drivers/spg2xx_zone_32bit.cpp +++ b/src/mame/drivers/spg2xx_zone_32bit.cpp @@ -3,8 +3,10 @@ /* 'Zone' '32-bit' systems */ +#include "emu.h" #include "includes/spg2xx.h" + class zon32bit_state : public spg2xx_game_state { public: diff --git a/src/mame/drivers/xavix.cpp b/src/mame/drivers/xavix.cpp index 6e3eb53624a..8f3191d6d6b 100644 --- a/src/mame/drivers/xavix.cpp +++ b/src/mame/drivers/xavix.cpp @@ -546,6 +546,24 @@ static INPUT_PORTS_START( xavix_i2c ) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("i2cmem", i2cmem_device, read_sda) INPUT_PORTS_END + +static INPUT_PORTS_START( tomcpin ) + PORT_INCLUDE(xavix_i2c) + + PORT_MODIFY("IN0") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 Right Flipper") + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("P1 Left Flipper") + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("P1 Launch Ball") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_NAME("P1 Nudge") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 Right Flipper") + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P2 Left Flipper") + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME("P2 Launch Ball") + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_NAME("P2 Nudge") + + PORT_MODIFY("IN1") + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_POWER_OFF ) PORT_NAME("Power Switch") // pressing this will turn the game off. +INPUT_PORTS_END + static INPUT_PORTS_START( epo_bowl ) PORT_INCLUDE(xavix) @@ -1934,6 +1952,11 @@ ROM_START( tcarnavi ) ROM_LOAD("navi.bin", 0x000000, 0x400000, CRC(f4e693fb) SHA1(be37b35f1e1e661e10187253c2c3aa9858a90812) ) ROM_END +ROM_START( tomcpin ) + ROM_REGION(0x400000, "bios", ROMREGION_ERASE00) + ROM_LOAD("championpinball.bin", 0x000000, 0x400000, CRC(24f6d753) SHA1(3d3b39692bef8156da9e350b456c4e2f0af74484) ) +ROM_END + /* The e-kara cartridges require the BIOS rom to map into 2nd external bus space as they fetch palette data from it etc. @@ -2128,6 +2151,7 @@ CONS( 2003, jarajal, 0, 0, xavix_nv, jarajal, xavix_state, CONS( 2003, tcarnavi, 0, 0, xavix_nv, jarajal, xavix_state, init_xavix, "Tomy / SSD Company LTD", "Tomica Carnavi Drive (Japan)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) +CONS( 2003, tomcpin, 0, 0, xavix_i2c_24c02, tomcpin, xavix_i2c_state, init_xavix, "Tomy / SSD Company LTD", "Champiyon Pinball (Japan)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) /* Music titles: Emulation note: SEEPROM write appears to work (save NVRAM file looks valid) but game fails to read it back properly, fails backup data checksum, and blanks it again. diff --git a/src/mame/includes/nes.h b/src/mame/includes/nes.h index b0717a6ad19..ee38c919a26 100644 --- a/src/mame/includes/nes.h +++ b/src/mame/includes/nes.h @@ -48,7 +48,6 @@ #define NES_BATTERY 0 #define NES_WRAM 1 -// so that the NES and Famiclones (VT03 for example) can use some common functionality class nes_base_state : public driver_device { public: diff --git a/src/mame/includes/spg2xx.h b/src/mame/includes/spg2xx.h index 8ec57d6fabb..d12bc476de1 100644 --- a/src/mame/includes/spg2xx.h +++ b/src/mame/includes/spg2xx.h @@ -1,11 +1,9 @@ // license:BSD-3-Clause // copyright-holders:Ryan Holtz, David Haywood -#pragma once - #ifndef MAME_INCLUDES_SPG2XX_H #define MAME_INCLUDES_SPG2XX_H -#include "emu.h" +#pragma once #include "cpu/unsp/unsp.h" #include "machine/i2cmem.h" diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 4f9e6b9ad3a..a6c077a6ea0 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -19632,6 +19632,7 @@ mastboyia // (c) 1991 - No Ref on the PCB @source:mastboyo.cpp mastboyo // (c) 1987 - No Ref on the PCB mastboyoa // (c) 1987 - No Ref on the PCB +mastboyob @source:matmania.cpp excthour // TA-0015 (c) 1985 + Taito license @@ -21906,6 +21907,7 @@ berlinpl // 1996 Mephisto Berlin Pro London Upgrade @source:mephisto_brikett.cpp mephisto mephisto2 +mephisto2a mephisto2e mephisto3 mephisto3b @@ -36927,6 +36929,105 @@ speedspn // (c) 1994 @source:speglsht.cpp speglsht // (c) 1994 Seta +@source:spg110.cpp +jak_capb // +jak_spdmo // +conyteni // +conyping // +conyfght + +@source:spg2xx.cpp +rad_skat // +rad_skatp // +rad_sktv // +rad_crik // +rad_fb2 // +mattelcs // +abltenni // +tvsprt10 // +wiwi18 // + +@source:spg2xx_dreamlife.cpp +dreamlif // + +@source:spg2xx_ican.cpp +icanguit // +icanpian // + +@source:spg2xx_jakks.cpp +jak_batm // The Batman, 2004 +jak_wall // +jak_wwe // +jak_fan4 // +jak_just // +jak_dora // +jak_dorr // +jak_disn // +jak_disf // +jak_dpr // +jak_dprs // +jak_sith // +jak_sdoo // +jak_dbz // +jak_mpac // +jak_capc // +jak_wof // +jak_spdm // +jak_pooh // +jak_care // +jak_nick // +jak_sbfc // + +@source:spg2xx_lexibook.cpp +lexizeus // Lexibook +lexiseal // +discpal + +@source:spg2xx_pdc.cpp +pdc100 +tmntpdc + +@source:spg2xx_playvision.cpp +pvmil // + +@source:spg2xx_senario.cpp +senmil +senbbs +senapren +senpmate +sencosmo + +@source:spg2xx_senario_poker.cpp +sentx6p // +sentx6puk +sentx6pd + +@source:spg2xx_shredmjr.cpp +taikeegr // +shredmjr // + +@source:spg2xx_telestory.cpp +telestry // + +@source:spg2xx_tvgogo.cpp +tvgogo // + +@source:spg2xx_vii.cpp +vii // KenSingTon / Jungle Soft / Siatronics Vii + +@source:spg2xx_zone.cpp +wirels60 // Wireless 60 +zone40 // Zone 40 +reactmd +itvg49 +zone60 // Zone 60 +zone100 // +lx_jg7415 // + +@source:spg2xx_zone_32bit.cpp +mywicodx // +zon32bit // Zone 32-bit + @source:spiders.cpp spiders // (c) 1981 Sigma Ent. Inc. spiders2 // (c) 1981 Sigma Ent. Inc. @@ -39846,104 +39947,6 @@ vigilantd // (c) 1988 (Japan Rev D) vigilantg // (c) 1988 (US Rev G) vigilanto // (c) 1988 (US) -@source:spg110.cpp -jak_capb // -jak_spdmo // -conyteni // -conyping // -conyfght - -@source:spg2xx.cpp -rad_skat // -rad_skatp // -rad_sktv // -rad_crik // -rad_fb2 // -mattelcs // -abltenni // -tvsprt10 // -wiwi18 // - -@source:spg2xx_jakks.cpp -jak_batm // The Batman, 2004 -jak_wall // -jak_wwe // -jak_fan4 // -jak_just // -jak_dora // -jak_dorr // -jak_disn // -jak_disf // -jak_dpr // -jak_dprs // -jak_sith // -jak_sdoo // -jak_dbz // -jak_mpac // -jak_capc // -jak_wof // -jak_spdm // -jak_pooh // -jak_care // -jak_nick // -jak_sbfc // - -@source:spg2xx_zone.cpp -wirels60 // Wireless 60 -zone40 // Zone 40 -reactmd -itvg49 -zone60 // Zone 60 -zone100 // -lx_jg7415 // - -@source:spg2xx_zone_32bit.cpp -mywicodx // -zon32bit // Zone 32-bit - -@source:spg2xx_senario.cpp -senmil -senbbs -senapren -senpmate -sencosmo - -@source:spg2xx_senario_poker.cpp -sentx6p // -sentx6puk -sentx6pd - -@source:spg2xx_vii.cpp -vii // KenSingTon / Jungle Soft / Siatronics Vii - -@source:spg2xx_ican.cpp -icanguit // -icanpian // - -@source:spg2xx_playvision.cpp -pvmil // - -@source:spg2xx_shredmjr.cpp -taikeegr // -shredmjr // - -@source:spg2xx_telestory.cpp -telestry // - -@source:spg2xx_tvgogo.cpp -tvgogo // - -@source:spg2xx_pdc.cpp -pdc100 -tmntpdc - -@source:spg2xx_dreamlife.cpp -dreamlif // - -@source:spg2xx_lexibook.cpp -lexizeus // Lexibook -lexiseal // - @source:vsmile.cpp vsmile // vsmilem // @@ -41132,6 +41135,7 @@ ltv_tam // tak_geig // jarajal // tcarnavi // +tomcpin ban_onep // ekara // ekaraa // diff --git a/src/mame/video/jagblit.hxx b/src/mame/video/jagblit.hxx index 61027802607..86c3bc9d8d7 100644 --- a/src/mame/video/jagblit.hxx +++ b/src/mame/video/jagblit.hxx @@ -35,43 +35,43 @@ #ifndef PIXEL_SHIFT_1 #define PIXEL_SHIFT_1(a) ((~a##_x >> 16) & 7) -#define PIXEL_OFFSET_1(a) BYTE4_XOR_BE(((uint32_t)a##_y >> 16) * a##_width / 8 + (((uint32_t)a##_x >> 19) & ~7) * (1 + a##_pitch) + (((uint32_t)a##_x >> 19) & 7)) +#define PIXEL_OFFSET_1(a) (((uint32_t)a##_y >> 16) * a##_width / 8 + (((uint32_t)a##_x >> 19) & ~7) * (1 + a##_pitch) + (((uint32_t)a##_x >> 19) & 7)) #define ZDATA_OFFSET_1(a) 0 /* huh? */ #define READ_RDATA_1(r,a,p) ((p) ? (((((uint8_t *)&m_blitter_regs[r])[BYTE4_XOR_BE(((uint32_t)a##_x >> 19) & 7)]) >> PIXEL_SHIFT_1(a)) & 0x01) : (m_blitter_regs[r] & 0x01)) -#define READ_PIXEL_1(a) (((((uint8_t *)a##_base_mem)[PIXEL_OFFSET_1(a)]) >> PIXEL_SHIFT_1(a)) & 0x01) +#define READ_PIXEL_1(a) ((m_gpu->space(AS_PROGRAM).read_byte(a##_base + PIXEL_OFFSET_1(a)) >> PIXEL_SHIFT_1(a)) & 0x01) #define READ_ZDATA_1(a) 0 /* huh? */ #define PIXEL_SHIFT_2(a) ((~a##_x >> 15) & 6) -#define PIXEL_OFFSET_2(a) BYTE4_XOR_BE(((uint32_t)a##_y >> 16) * a##_width / 4 + (((uint32_t)a##_x >> 18) & ~7) * (1 + a##_pitch) + (((uint32_t)a##_x >> 18) & 7)) +#define PIXEL_OFFSET_2(a) (((uint32_t)a##_y >> 16) * a##_width / 4 + (((uint32_t)a##_x >> 18) & ~7) * (1 + a##_pitch) + (((uint32_t)a##_x >> 18) & 7)) #define ZDATA_OFFSET_2(a) 0 /* huh? */ #define READ_RDATA_2(r,a,p) ((p) ? (((((uint8_t *)&m_blitter_regs[r])[BYTE4_XOR_BE(((uint32_t)a##_x >> 18) & 7)]) >> PIXEL_SHIFT_2(a)) & 0x03) : (m_blitter_regs[r] & 0x03)) -#define READ_PIXEL_2(a) (((((uint8_t *)a##_base_mem)[PIXEL_OFFSET_2(a)]) >> PIXEL_SHIFT_2(a)) & 0x03) +#define READ_PIXEL_2(a) ((m_gpu->space(AS_PROGRAM).read_byte(a##_base + PIXEL_OFFSET_2(a)) >> PIXEL_SHIFT_2(a)) & 0x03) #define READ_ZDATA_2(a) 0 /* huh? */ #define PIXEL_SHIFT_4(a) ((~a##_x >> 14) & 4) -#define PIXEL_OFFSET_4(a) BYTE4_XOR_BE(((uint32_t)a##_y >> 16) * a##_width / 2 + (((uint32_t)a##_x >> 17) & ~7) * (1 + a##_pitch) + (((uint32_t)a##_x >> 17) & 7)) +#define PIXEL_OFFSET_4(a) (((uint32_t)a##_y >> 16) * a##_width / 2 + (((uint32_t)a##_x >> 17) & ~7) * (1 + a##_pitch) + (((uint32_t)a##_x >> 17) & 7)) #define ZDATA_OFFSET_4(a) 0 /* huh? */ #define READ_RDATA_4(r,a,p) ((p) ? (((((uint8_t *)&m_blitter_regs[r])[BYTE4_XOR_BE(((uint32_t)a##_x >> 17) & 7)]) >> PIXEL_SHIFT_4(a)) & 0x0f) : (m_blitter_regs[r] & 0x0f)) -#define READ_PIXEL_4(a) (((((uint8_t *)a##_base_mem)[PIXEL_OFFSET_4(a)]) >> PIXEL_SHIFT_4(a)) & 0x0f) +#define READ_PIXEL_4(a) ((m_gpu->space(AS_PROGRAM).read_byte(a##_base + PIXEL_OFFSET_4(a)) >> PIXEL_SHIFT_4(a)) & 0x0f) #define READ_ZDATA_4(a) 0 /* huh? */ -#define PIXEL_OFFSET_8(a) BYTE4_XOR_BE(((uint32_t)a##_y >> 16) * a##_width + (((uint32_t)a##_x >> 16) & ~7) * (1 + a##_pitch) + (((uint32_t)a##_x >> 16) & 7)) +#define PIXEL_OFFSET_8(a) (((uint32_t)a##_y >> 16) * a##_width + (((uint32_t)a##_x >> 16) & ~7) * (1 + a##_pitch) + (((uint32_t)a##_x >> 16) & 7)) #define ZDATA_OFFSET_8(a) (PIXEL_OFFSET_8(a) + a##_zoffs * 8) #define READ_RDATA_8(r,a,p) ((p) ? (((uint8_t *)&m_blitter_regs[r])[BYTE4_XOR_BE(((uint32_t)a##_x >> 16) & 7)]) : (m_blitter_regs[r] & 0xff)) -#define READ_PIXEL_8(a) (((uint8_t *)a##_base_mem)[PIXEL_OFFSET_8(a)]) -#define READ_ZDATA_8(a) (((uint8_t *)a##_base_mem)[ZDATA_OFFSET_8(a)]) +#define READ_PIXEL_8(a) (m_gpu->space(AS_PROGRAM).read_byte(a##_base + PIXEL_OFFSET_8(a))) +#define READ_ZDATA_8(a) (m_gpu->space(AS_PROGRAM).read_byte(a##_base + ZDATA_OFFSET_8(a))) -#define PIXEL_OFFSET_16(a) BYTE_XOR_BE(((uint32_t)a##_y >> 16) * a##_width + (((uint32_t)a##_x >> 16) & ~3) * (1 + a##_pitch) + (((uint32_t)a##_x >> 16) & 3)) +#define PIXEL_OFFSET_16(a) (((uint32_t)a##_y >> 16) * a##_width + (((uint32_t)a##_x >> 16) & ~3) * (1 + a##_pitch) + (((uint32_t)a##_x >> 16) & 3)) #define ZDATA_OFFSET_16(a) (PIXEL_OFFSET_16(a) + a##_zoffs * 4) #define READ_RDATA_16(r,a,p) ((p) ? (((uint16_t *)&m_blitter_regs[r])[BYTE_XOR_BE(((uint32_t)a##_x >> 16) & 3)]) : (m_blitter_regs[r] & 0xffff)) -#define READ_PIXEL_16(a) (((uint16_t *)a##_base_mem)[PIXEL_OFFSET_16(a)]) -#define READ_ZDATA_16(a) (((uint16_t *)a##_base_mem)[ZDATA_OFFSET_16(a)]) +#define READ_PIXEL_16(a) (m_gpu->space(AS_PROGRAM).read_word(a##_base + (PIXEL_OFFSET_16(a)<<1))) +#define READ_ZDATA_16(a) (m_gpu->space(AS_PROGRAM).read_word(a##_base + (ZDATA_OFFSET_16(a)<<1))) #define PIXEL_OFFSET_32(a) (((uint32_t)a##_y >> 16) * a##_width + (((uint32_t)a##_x >> 16) & ~1) * (1 + a##_pitch) + (((uint32_t)a##_x >> 16) & 1)) #define ZDATA_OFFSET_32(a) (PIXEL_OFFSET_32(a) + a##_zoffs * 2) #define READ_RDATA_32(r,a,p) ((p) ? (m_blitter_regs[r + (((uint32_t)a##_x >> 16) & 1)]) : m_blitter_regs[r]) -#define READ_PIXEL_32(a) (((uint32_t *)a##_base_mem)[PIXEL_OFFSET_32(a)]) -#define READ_ZDATA_32(a) (((uint32_t *)a##_base_mem)[ZDATA_OFFSET_32(a)]) +#define READ_PIXEL_32(a) (m_gpu->space(AS_PROGRAM).read_dword(a##_base + (PIXEL_OFFSET_32(a)<<2))) +#define READ_ZDATA_32(a) (m_gpu->space(AS_PROGRAM).read_dword(a##_base + (ZDATA_OFFSET_32(a)<<2))) #define READ_RDATA(r,a,f,p) \ ((((f) & 0x38) == (0 << 3)) ? (READ_RDATA_1(r,a,p)) : \ @@ -189,11 +189,7 @@ void jaguar_state::FUNCNAME(uint32_t command, uint32_t a1flags, uint32_t a2flags uint8_t a1_phrase_mode = 0; uint8_t a2_phrase_mode = 0; - void *a1_base_mem = memory_base(a1_base); - void *a2_base_mem = memory_base(a2_base); - - void *asrc_base_mem = (COMMAND & 0x00000800) ? a1_base_mem : a2_base_mem; - void *adest_base_mem = (COMMAND & 0x00000800) ? a2_base_mem : a1_base_mem; + uint32_t asrc_base = (COMMAND & 0x00000800) ? a1_base : a2_base; uint32_t asrcflags = (COMMAND & 0x00000800) ? A1FIXED : A2FIXED; int32_t asrc_x = (COMMAND & 0x00000800) ? a1_x : a2_x; int32_t asrc_y = (COMMAND & 0x00000800) ? a1_y : a2_y; @@ -215,18 +211,6 @@ void jaguar_state::FUNCNAME(uint32_t command, uint32_t a1flags, uint32_t a2flags int32_t adest_xadd, adest_xstep, adest_yadd, adest_ystep; uint32_t adest_xmask, adest_ymask; - /* don't blit if pointer bad */ - if (!a1_base_mem || !a2_base_mem) - { - if (LOG_BAD_BLITS) - { - logerror("%s:Blit!\n", machine().describe_context()); - logerror(" a1_base = %08X\n", a1_base); - logerror(" a2_base = %08X\n", a2_base); - } - return; - } - /* determine actual xadd/yadd for A1 */ a1_yadd <<= 16; if (A1FIXED & 0x00100000) |