summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/ci-linux.yml8
-rw-r--r--.github/workflows/ci-macos.yml6
-rw-r--r--.github/workflows/ci-windows.yml6
-rw-r--r--dist.mak4
-rw-r--r--hash/msx.hsi22
-rw-r--r--hash/msx1_cart.xml4
-rw-r--r--hash/msx1_cass.xml2
-rw-r--r--hash/pc98.xml2
-rw-r--r--hash/saitek_egr.xml2
-rw-r--r--hash/x1_flop.xml2
-rw-r--r--scripts/src/main.lua28
-rw-r--r--scripts/src/tests.lua28
-rw-r--r--src/devices/bus/msx_cart/hfox.cpp2
-rw-r--r--src/devices/bus/rs232/printer.cpp29
-rw-r--r--src/devices/bus/rs232/printer.h9
-rw-r--r--src/devices/bus/rs232/rs232.cpp7
-rw-r--r--src/devices/cpu/mcs48/mcs48.h64
-rw-r--r--src/devices/imagedev/floppy.cpp6
-rw-r--r--src/devices/machine/iwm.cpp83
-rw-r--r--src/devices/machine/iwm.h3
-rw-r--r--src/devices/machine/swim1.cpp34
-rw-r--r--src/devices/machine/swim1.h16
-rw-r--r--src/devices/sound/rf5c400.cpp91
-rw-r--r--src/devices/sound/rf5c400.h1
-rw-r--r--src/emu/debug/express.cpp153
-rw-r--r--src/emu/debug/express.h9
-rw-r--r--src/mame/drivers/alpha68k_i.cpp126
-rw-r--r--src/mame/drivers/bogeyman.cpp5
-rw-r--r--src/mame/drivers/coco12.cpp6
-rw-r--r--src/mame/drivers/coco3.cpp6
-rw-r--r--src/mame/drivers/geniusjr.cpp2
-rw-r--r--src/mame/drivers/gokidetor.cpp30
-rw-r--r--src/mame/drivers/jungleyo.cpp47
-rw-r--r--src/mame/drivers/laserbas.cpp106
-rw-r--r--src/mame/drivers/mac.cpp12
-rw-r--r--src/mame/drivers/oric.cpp5
-rw-r--r--src/mame/drivers/saitek_corona.cpp2
-rw-r--r--src/mame/drivers/saitek_simultano.cpp5
-rw-r--r--src/mame/drivers/shootout.cpp10
-rw-r--r--src/mame/drivers/skylncr.cpp159
-rw-r--r--src/mame/drivers/snk.cpp1
-rw-r--r--src/mame/mame.lst1
-rw-r--r--src/osd/modules/debugger/win/debugviewinfo.cpp225
-rw-r--r--src/osd/modules/debugger/win/debugviewinfo.h12
44 files changed, 927 insertions, 454 deletions
diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml
index 953eefbe971..6922871bcd3 100644
--- a/.github/workflows/ci-linux.yml
+++ b/.github/workflows/ci-linux.yml
@@ -33,8 +33,10 @@ jobs:
TOOLS: 1
run: make -j2
- name: Validate
- run: ./mame64 -validate
+ run: ./mame -validate
+ - name: ORM check
+ run: python scripts/minimaws/minimaws.py load --executable ./mame --softwarepath hash
- uses: actions/upload-artifact@master
with:
- name: mame64-linux-${{ matrix.compiler }}-${{ github.sha }}
- path: mame64
+ name: mame-linux-${{ matrix.compiler }}-${{ github.sha }}
+ path: mame
diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml
index dfe53e39537..cf23ddf3c3a 100644
--- a/.github/workflows/ci-macos.yml
+++ b/.github/workflows/ci-macos.yml
@@ -15,8 +15,8 @@ jobs:
TOOLS: 1
run: make -j2
- name: Validate
- run: ./mame64 -validate
+ run: ./mame -validate
- uses: actions/upload-artifact@master
with:
- name: mame64-macos-${{ github.sha }}
- path: mame64
+ name: mame-macos-${{ github.sha }}
+ path: mame
diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml
index 611c3206131..c227c0d6f09 100644
--- a/.github/workflows/ci-windows.yml
+++ b/.github/workflows/ci-windows.yml
@@ -21,8 +21,8 @@ jobs:
TOOLS: 1
run: make -j2
- name: Validate
- run: ./mame64 -validate
+ run: ./mame -validate
- uses: actions/upload-artifact@master
with:
- name: mame64-windows-gcc-${{ github.sha }}
- path: mame64.exe
+ name: mame-windows-gcc-${{ github.sha }}
+ path: mame.exe
diff --git a/dist.mak b/dist.mak
index 1c8d9507aa6..c378dfdf708 100644
--- a/dist.mak
+++ b/dist.mak
@@ -67,10 +67,8 @@ else
endif
ifeq ($(PTR64),1)
- MAINBINARCH := 64
BUILDARCH := x64
else
- MAINBINARCH :=
BUILDARCH := x32
endif
@@ -97,7 +95,7 @@ ifndef TARGET
TARGET := mame
endif
-MAINBIN := $(TARGET)$(MAINBINARCH)$(MAINBINVARIANT)
+MAINBIN := $(TARGET)$(MAINBINVARIANT)
BINDIR := build/$(PROJECTTYPE)/bin/$(BUILDARCH)/$(BUILDVARIANT)
STAGEDIR := build/release/$(BUILDARCH)/$(BUILDVARIANT)/$(TARGET)
diff --git a/hash/msx.hsi b/hash/msx.hsi
index 5e60b27e73b..43c433cc50e 100644
--- a/hash/msx.hsi
+++ b/hash/msx.hsi
@@ -214,7 +214,7 @@ license:CC0
<hash crc32="15a0f98a" name="Animal Land Satsujin Jiken">
<year>1987</year>
<manufacturer>Enix</manufacturer>
- <status> Not Playable</status>
+ <status>Not Playable</status>
<extrainfo>4</extrainfo>
</hash>
<hash crc32="aae7028b" name="Antarctic Adventure">
@@ -548,7 +548,7 @@ license:CC0
<hash crc32="8801b31e" name="Break In">
<year>1987</year>
<manufacturer>Jaleco</manufacturer>
- <status> Not Playable</status>
+ <status>Not Playable</status>
<extrainfo>0</extrainfo>
</hash>
<hash crc32="70113f76" name="Break Out">
@@ -957,7 +957,7 @@ license:CC0
<hash crc32="1fc65e80" name="Dawn Patrol">
<year>1987</year>
<manufacturer>Pony Canyon</manufacturer>
- <status> Not Playable</status>
+ <status>Not Playable</status>
<extrainfo>0</extrainfo>
</hash>
<hash crc32="cd016b93" name="Decathlon">
@@ -1003,13 +1003,13 @@ license:CC0
<hash crc32="4b673b29" name="Disk Basic 1.0 (For FS-FD1A)">
<year>1987</year>
<manufacturer>Panasonic</manufacturer>
- <status> Not Playable</status>
+ <status>Not Playable</status>
<extrainfo>15</extrainfo>
</hash>
<hash crc32="006fba38" name="Disk Basic 1.0 (For FS-FD351)">
<year>1985</year>
<manufacturer>National</manufacturer>
- <status> Not Playable</status>
+ <status>Not Playable</status>
<extrainfo>15</extrainfo>
</hash>
<hash crc32="a21f5266" name="Disk Basic 1.0 (For HB-F1XDJ)">
@@ -1393,7 +1393,7 @@ license:CC0
<hash crc32="a00526d0" name="Flight Deck 2">
<year>1986</year>
<manufacturer>Pony Canyon</manufacturer>
- <status> Not Playable</status>
+ <status>Not Playable</status>
<extrainfo>0</extrainfo>
</hash>
<hash crc32="a6165bd4" name="Flight Simulator">
@@ -1736,20 +1736,20 @@ license:CC0
<manufacturer>Ascii</manufacturer>
<extrainfo>0</extrainfo>
</hash>
- <hash crc32="96b7faca" name="Harryfox MSX Special">
+ <hash crc32="96b7faca" name="Hurryfox MSX Special">
<year>1986</year>
<manufacturer>Micro Cabin</manufacturer>
<extrainfo>8</extrainfo>
</hash>
- <hash crc32="a0d363d3" name="Harryfox Yki No Maou (hacked)">
+ <hash crc32="a0d363d3" name="Hurryfox Yuki No Maou (hacked)">
<manufacturer>Micro Cabin</manufacturer>
<year>1985</year>
<extrainfo>5</extrainfo>
</hash>
- <hash crc32="c7fe3ee1" name="Harryfox Yuki No Maou">
+ <hash crc32="c7fe3ee1" name="Hurryfox Yuki No Maou">
<year>1985</year>
<manufacturer>Micro Cabin</manufacturer>
- <status> Not Playable</status>
+ <status>Not Playable</status>
<extrainfo>0</extrainfo>
</hash>
<hash crc32="f1637c31" name="Hayabusa - Moonsweeper">
@@ -2575,7 +2575,7 @@ license:CC0
<hash crc32="d34d74f7" name="Mashou No Yakata Gabalin">
<year>1987</year>
<manufacturer>Pony Canyon</manufacturer>
- <status> Not Playable</status>
+ <status>Not Playable</status>
<extrainfo>0</extrainfo>
</hash>
<hash crc32="b0b90a4d" name="Mayhem (hacked)">
diff --git a/hash/msx1_cart.xml b/hash/msx1_cart.xml
index 59cce75f4a6..bb8cb0b4a6d 100644
--- a/hash/msx1_cart.xml
+++ b/hash/msx1_cart.xml
@@ -6137,7 +6137,7 @@ kept for now until finding out what those bytes affect...
<feature name="slot" value="ascii16_sram" />
<feature name="mapper" value="M60002-0125SP-16" />
<dataarea name="rom" size="262144">
- <rom name="harryfox msx special (japan).rom" size="131072" crc="96b7faca" sha1="a3de07612da7986387a4f5c41bbbc7e3b244e077" offset="0" />
+ <rom name="hurryfox msx special (japan).rom" size="131072" crc="96b7faca" sha1="a3de07612da7986387a4f5c41bbbc7e3b244e077" offset="0" />
<rom size="131072" offset="0x20000" loadflag="reload" />
</dataarea>
<dataarea name="sram" size="2048">
@@ -6154,7 +6154,7 @@ kept for now until finding out what those bytes affect...
<feature name="slot" value="hfox" />
<feature name="mapper" value="M60002-0125SP-16" />
<dataarea name="rom" size="65536">
- <rom name="harryfox yki no maoh (japan).rom" size="65536" crc="c7fe3ee1" sha1="3626b5dd3188ec2a16e102d05c79f8f242fbd892" offset="0" />
+ <rom name="hurryfox yuki no maoh (japan).rom" size="65536" crc="c7fe3ee1" sha1="3626b5dd3188ec2a16e102d05c79f8f242fbd892" offset="0" />
</dataarea>
</part>
</software>
diff --git a/hash/msx1_cass.xml b/hash/msx1_cass.xml
index 16772fcc898..d606a8a972c 100644
--- a/hash/msx1_cass.xml
+++ b/hash/msx1_cass.xml
@@ -6662,7 +6662,7 @@ license:CC0
<part name="cass1" interface="msx_cass">
<dataarea name="cass" size="62870">
- <rom name="harry fox yki no maoh (1985)(micro cabin)(jp)[bload'cas-',r].cas" size="62870" crc="878b3fd2" sha1="3ed7bfc036f1561d789fedc9ab86e5bdc65be01e"/>
+ <rom name="hurry fox yuki no maoh (1985)(micro cabin)(jp)[bload'cas-',r].cas" size="62870" crc="878b3fd2" sha1="3ed7bfc036f1561d789fedc9ab86e5bdc65be01e"/>
</dataarea>
</part>
</software>
diff --git a/hash/pc98.xml b/hash/pc98.xml
index 839d37c1292..a1de80a91e4 100644
--- a/hash/pc98.xml
+++ b/hash/pc98.xml
@@ -23831,7 +23831,7 @@ only have some part of Windows file and a Video driver(CLGD?).
<info name="alt_title" value="は~りぃふぉっくす" />
<part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="1086448">
- <rom name="harryfox.d88" size="1086448" crc="ed7067e1" sha1="682c5d9b2b4f7e84d7fc40582c80b15f8ff4b92d" offset="0" />
+ <rom name="hurryfox.d88" size="1086448" crc="ed7067e1" sha1="682c5d9b2b4f7e84d7fc40582c80b15f8ff4b92d" offset="0" />
</dataarea>
</part>
</software>
diff --git a/hash/saitek_egr.xml b/hash/saitek_egr.xml
index e2c57a2ad60..c6df74f98aa 100644
--- a/hash/saitek_egr.xml
+++ b/hash/saitek_egr.xml
@@ -13,6 +13,7 @@ license:CC0
<description>Endgame ROM (ver. 1)</description>
<year>1988</year>
<publisher>Saitek</publisher>
+ <sharedfeat name="compatibility" value="egr"/>
<part name="extrom" interface="saitek_egr">
<dataarea name="rom" size="0x8000">
<rom name="egr.bin" size="0x8000" crc="1f9800c8" sha1="6147ad3de65b897fa5f6ab06b2f8597403d6e32e" />
@@ -24,6 +25,7 @@ license:CC0
<description>Endgame ROM (ver. 2)</description>
<year>1988</year>
<publisher>Saitek</publisher>
+ <sharedfeat name="compatibility" value="egr2"/>
<part name="extrom" interface="saitek_egr">
<dataarea name="rom" size="0x8000">
<rom name="egr2.bin" size="0x8000" crc="9f751516" sha1="c46053b0af55856f2a6871d4aa65b3bd0e7d865f" />
diff --git a/hash/x1_flop.xml b/hash/x1_flop.xml
index 6c0a110dea8..581125b3aff 100644
--- a/hash/x1_flop.xml
+++ b/hash/x1_flop.xml
@@ -1018,7 +1018,7 @@ Plus, some games crash MESS at exit (e.g. some sorcer disks or some arcus disks)
<info name="alt_title" value="はーりぃふぉっくす"/>
<part name="flop1" interface="floppy_5_25">
<dataarea name="flop" size="348848">
- <rom name="harry fox.d88" size="348848" crc="493c9699" sha1="0fa37d988d20dd698d096025b645994b874ca8cb"/>
+ <rom name="hurry fox.d88" size="348848" crc="493c9699" sha1="0fa37d988d20dd698d096025b645994b874ca8cb"/>
</dataarea>
</part>
</software>
diff --git a/scripts/src/main.lua b/scripts/src/main.lua
index 46f23a256e5..256a99c690f 100644
--- a/scripts/src/main.lua
+++ b/scripts/src/main.lua
@@ -98,37 +98,13 @@ end
configuration "**/*"
flags { "DeploymentContent" }
- configuration { "x64", "Release" }
- targetsuffix "64"
- if _OPTIONS["PROFILE"] then
- targetsuffix "64p"
- end
-
- configuration { "x64", "Debug" }
- targetsuffix "64d"
- if _OPTIONS["PROFILE"] then
- targetsuffix "64dp"
- end
-
- configuration { "x32", "Release" }
- targetsuffix ""
- if _OPTIONS["PROFILE"] then
- targetsuffix "p"
- end
-
- configuration { "x32", "Debug" }
- targetsuffix "d"
- if _OPTIONS["PROFILE"] then
- targetsuffix "dp"
- end
-
- configuration { "Native", "Release" }
+ configuration { "Release" }
targetsuffix ""
if _OPTIONS["PROFILE"] then
targetsuffix "p"
end
- configuration { "Native", "Debug" }
+ configuration { "Debug" }
targetsuffix "d"
if _OPTIONS["PROFILE"] then
targetsuffix "dp"
diff --git a/scripts/src/tests.lua b/scripts/src/tests.lua
index 6d964737079..89c8c976c39 100644
--- a/scripts/src/tests.lua
+++ b/scripts/src/tests.lua
@@ -21,37 +21,13 @@ project("mametests")
targetdir(MAME_DIR)
end
- configuration { "x64", "Release" }
- targetsuffix "64"
- if _OPTIONS["PROFILE"] then
- targetsuffix "64p"
- end
-
- configuration { "x64", "Debug" }
- targetsuffix "64d"
- if _OPTIONS["PROFILE"] then
- targetsuffix "64dp"
- end
-
- configuration { "x32", "Release" }
- targetsuffix ""
- if _OPTIONS["PROFILE"] then
- targetsuffix "p"
- end
-
- configuration { "x32", "Debug" }
- targetsuffix "d"
- if _OPTIONS["PROFILE"] then
- targetsuffix "dp"
- end
-
- configuration { "Native", "Release" }
+ configuration { "Release" }
targetsuffix ""
if _OPTIONS["PROFILE"] then
targetsuffix "p"
end
- configuration { "Native", "Debug" }
+ configuration { "Debug" }
targetsuffix "d"
if _OPTIONS["PROFILE"] then
targetsuffix "dp"
diff --git a/src/devices/bus/msx_cart/hfox.cpp b/src/devices/bus/msx_cart/hfox.cpp
index c08f0a0e1c0..007155b6e5b 100644
--- a/src/devices/bus/msx_cart/hfox.cpp
+++ b/src/devices/bus/msx_cart/hfox.cpp
@@ -4,7 +4,7 @@
#include "hfox.h"
-DEFINE_DEVICE_TYPE(MSX_CART_HFOX, msx_cart_hfox_device, "msx_cart_hfox", "MSX Cartridge - Harry Fox")
+DEFINE_DEVICE_TYPE(MSX_CART_HFOX, msx_cart_hfox_device, "msx_cart_hfox", "MSX Cartridge - Hurry Fox")
msx_cart_hfox_device::msx_cart_hfox_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
diff --git a/src/devices/bus/rs232/printer.cpp b/src/devices/bus/rs232/printer.cpp
index 18c29759131..4309463fd17 100644
--- a/src/devices/bus/rs232/printer.cpp
+++ b/src/devices/bus/rs232/printer.cpp
@@ -1,12 +1,30 @@
// license:BSD-3-Clause
// copyright-holders:smf
+
+/**************************************************************************
+
+ Simple printer emulation
+
+ This allows capturing the byte stream to a file.
+
+ Radio Shack printers differ in that the RX line is used as a
+ busy signal.
+
+**************************************************************************/
+
#include "emu.h"
#include "printer.h"
serial_printer_device::serial_printer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, SERIAL_PRINTER, tag, owner, clock),
+ : serial_printer_device(mconfig, SERIAL_PRINTER, tag, owner, clock)
+{
+}
+
+serial_printer_device::serial_printer_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, type, tag, owner, clock),
device_serial_interface(mconfig, *this),
device_rs232_port_interface(mconfig, *this),
+ m_initial_rx_state(1),
m_printer(*this, "printer"),
m_rs232_rxbaud(*this, "RS232_RXBAUD"),
m_rs232_startbits(*this, "RS232_STARTBITS"),
@@ -52,7 +70,7 @@ WRITE_LINE_MEMBER(serial_printer_device::update_serial)
set_rcv_rate(rxbaud);
// TODO: make this configurable
- output_rxd(1);
+ output_rxd(m_initial_rx_state);
output_dcd(0);
output_dsr(0);
output_cts(0);
@@ -74,4 +92,11 @@ void serial_printer_device::rcv_complete()
m_printer->output(get_received_char());
}
+radio_shack_serial_printer_device::radio_shack_serial_printer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : serial_printer_device(mconfig, RADIO_SHACK_SERIAL_PRINTER, tag, owner, clock)
+{
+ m_initial_rx_state = 0;
+}
+
DEFINE_DEVICE_TYPE(SERIAL_PRINTER, serial_printer_device, "serial_printer", "Serial Printer")
+DEFINE_DEVICE_TYPE(RADIO_SHACK_SERIAL_PRINTER, radio_shack_serial_printer_device, "rs_serial_printer", "Radio Shack Serial Printer")
diff --git a/src/devices/bus/rs232/printer.h b/src/devices/bus/rs232/printer.h
index 8cab55e7344..973e46dc768 100644
--- a/src/devices/bus/rs232/printer.h
+++ b/src/devices/bus/rs232/printer.h
@@ -21,12 +21,14 @@ public:
DECLARE_WRITE_LINE_MEMBER(update_serial);
protected:
+ serial_printer_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
virtual void device_add_mconfig(machine_config &config) override;
virtual ioport_constructor device_input_ports() const override;
virtual void device_start() override;
virtual void device_reset() override;
virtual void rcv_complete() override;
+ int m_initial_rx_state;
private:
DECLARE_WRITE_LINE_MEMBER(printer_online);
@@ -40,6 +42,13 @@ private:
required_ioport m_rs232_stopbits;
};
+class radio_shack_serial_printer_device : public serial_printer_device
+{
+public:
+ radio_shack_serial_printer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+};
+
DECLARE_DEVICE_TYPE(SERIAL_PRINTER, serial_printer_device)
+DECLARE_DEVICE_TYPE(RADIO_SHACK_SERIAL_PRINTER, radio_shack_serial_printer_device)
#endif // MAME_BUS_RS232_PRINTER_H
diff --git a/src/devices/bus/rs232/rs232.cpp b/src/devices/bus/rs232/rs232.cpp
index 77b79132de0..d55628d64c4 100644
--- a/src/devices/bus/rs232/rs232.cpp
+++ b/src/devices/bus/rs232/rs232.cpp
@@ -174,14 +174,15 @@ device_rs232_port_interface::~device_rs232_port_interface()
void default_rs232_devices(device_slot_interface &device)
{
+ device.option_add("dec_loopback", DEC_RS232_LOOPBACK);
+ device.option_add("ie15", SERIAL_TERMINAL_IE15);
device.option_add("keyboard", SERIAL_KEYBOARD);
device.option_add("loopback", RS232_LOOPBACK);
- device.option_add("dec_loopback", DEC_RS232_LOOPBACK);
device.option_add("null_modem", NULL_MODEM);
device.option_add("printer", SERIAL_PRINTER);
- device.option_add("terminal", SERIAL_TERMINAL);
device.option_add("pty", PSEUDO_TERMINAL);
+ device.option_add("rs_printer", RADIO_SHACK_SERIAL_PRINTER);
device.option_add("sunkbd", SUN_KBD_ADAPTOR);
- device.option_add("ie15", SERIAL_TERMINAL_IE15);
device.option_add("swtpc8212", SERIAL_TERMINAL_SWTPC8212);
+ device.option_add("terminal", SERIAL_TERMINAL);
}
diff --git a/src/devices/cpu/mcs48/mcs48.h b/src/devices/cpu/mcs48/mcs48.h
index cb9725f704f..fa73d33e5b6 100644
--- a/src/devices/cpu/mcs48/mcs48.h
+++ b/src/devices/cpu/mcs48/mcs48.h
@@ -182,35 +182,35 @@ protected:
clock_update_delegate m_t0_clk_func;
devcb_write_line m_prog_out_cb;
- uint16_t m_prevpc; /* 16-bit previous program counter */
- uint16_t m_pc; /* 16-bit program counter */
-
- uint8_t m_a; /* 8-bit accumulator */
- uint8_t * m_regptr; /* pointer to r0-r7 */
- uint8_t m_psw; /* 8-bit PSW */
- bool m_f1; /* F1 flag (F0 is in PSW) */
- uint8_t m_p1; /* 8-bit latched port 1 */
- uint8_t m_p2; /* 8-bit latched port 2 */
- uint8_t m_ea; /* 1-bit latched ea input */
- uint8_t m_timer; /* 8-bit timer */
- uint8_t m_prescaler; /* 5-bit timer prescaler */
- uint8_t m_t1_history; /* 8-bit history of the T1 input */
- uint8_t m_sts; /* 4-bit status register + OBF/IBF flags (UPI-41 only) */
- uint8_t m_dbbi; /* 8-bit input data buffer (UPI-41 only) */
- uint8_t m_dbbo; /* 8-bit output data buffer (UPI-41 only) */
-
- bool m_irq_state; /* true if the IRQ line is active */
- bool m_irq_polled; /* true if last instruction was JNI (and not taken) */
- bool m_irq_in_progress; /* true if an IRQ is in progress */
- bool m_timer_overflow; /* true on a timer overflow; cleared by taking interrupt */
- bool m_timer_flag; /* true on a timer overflow; cleared on JTF */
- bool m_tirq_enabled; /* true if the timer IRQ is enabled */
- bool m_xirq_enabled; /* true if the external IRQ is enabled */
- uint8_t m_timecount_enabled; /* bitmask of timer/counter enabled */
- bool m_flags_enabled; /* true if I/O flags have been enabled (UPI-41 only) */
- bool m_dma_enabled; /* true if DMA has been enabled (UPI-41 only) */
-
- uint16_t m_a11; /* A11 value, either 0x000 or 0x800 */
+ uint16_t m_prevpc; // 16-bit previous program counter
+ uint16_t m_pc; // 16-bit program counter
+
+ uint8_t m_a; // 8-bit accumulator
+ uint8_t * m_regptr; // pointer to r0-r7
+ uint8_t m_psw; // 8-bit PSW
+ bool m_f1; // F1 flag (F0 is in PSW)
+ uint8_t m_p1; // 8-bit latched port 1
+ uint8_t m_p2; // 8-bit latched port 2
+ uint8_t m_ea; // 1-bit latched ea input
+ uint8_t m_timer; // 8-bit timer
+ uint8_t m_prescaler; // 5-bit timer prescaler
+ uint8_t m_t1_history; // 8-bit history of the T1 input
+ uint8_t m_sts; // 4-bit status register + OBF/IBF flags (UPI-41 only)
+ uint8_t m_dbbi; // 8-bit input data buffer (UPI-41 only)
+ uint8_t m_dbbo; // 8-bit output data buffer (UPI-41 only)
+
+ bool m_irq_state; // true if the IRQ line is active
+ bool m_irq_polled; // true if last instruction was JNI (and not taken)
+ bool m_irq_in_progress; // true if an IRQ is in progress
+ bool m_timer_overflow; // true on a timer overflow; cleared by taking interrupt
+ bool m_timer_flag; // true on a timer overflow; cleared on JTF
+ bool m_tirq_enabled; // true if the timer IRQ is enabled
+ bool m_xirq_enabled; // true if the external IRQ is enabled
+ uint8_t m_timecount_enabled; // bitmask of timer/counter enabled
+ bool m_flags_enabled; // true if I/O flags have been enabled (UPI-41 only)
+ bool m_dma_enabled; // true if DMA has been enabled (UPI-41 only)
+
+ uint16_t m_a11; // A11 value, either 0x000 or 0x800
int m_icount;
@@ -221,10 +221,10 @@ protected:
required_shared_ptr<uint8_t> m_dataptr;
- uint8_t m_feature_mask; /* processor feature flags */
- uint16_t m_int_rom_size; /* internal rom size */
+ uint8_t m_feature_mask; // processor feature flags
+ uint16_t m_int_rom_size; // internal rom size
- uint8_t m_rtemp; /* temporary for import/export */
+ uint8_t m_rtemp; // temporary for import/export
static const mcs48_ophandler s_mcs48_opcodes[256];
static const mcs48_ophandler s_upi41_opcodes[256];
diff --git a/src/devices/imagedev/floppy.cpp b/src/devices/imagedev/floppy.cpp
index 6d87751280e..e4634147843 100644
--- a/src/devices/imagedev/floppy.cpp
+++ b/src/devices/imagedev/floppy.cpp
@@ -925,16 +925,14 @@ attotime floppy_image_device::get_next_transition(const attotime &from_when)
if(!image || mon)
return attotime::never;
- if(from_when < cache_start_time || (!cache_end_time.is_never() && from_when >= cache_end_time))
+ if(from_when < cache_start_time || cache_start_time.is_zero() || (!cache_end_time.is_never() && from_when >= cache_end_time))
cache_fill(from_when);
if(!cache_weak)
return cache_end_time;
// Put a flux transition in the middle of a 4us interval with a 50% probability
- int64_t interval_index = (from_when - cache_weak_start).as_ticks(250000);
- if(interval_index < 0)
- interval_index = 0;
+ uint64_t interval_index = (from_when < cache_weak_start) ? 0 : (from_when - cache_weak_start).as_ticks(250000);
attotime weak_time = cache_weak_start + attotime::from_ticks(interval_index*2+1, 500000);
for(;;) {
if(weak_time >= cache_end_time)
diff --git a/src/devices/machine/iwm.cpp b/src/devices/machine/iwm.cpp
index 68e1c9b9b6b..1b3359d5a4d 100644
--- a/src/devices/machine/iwm.cpp
+++ b/src/devices/machine/iwm.cpp
@@ -66,6 +66,7 @@ void iwm_device::device_start()
save_item(NAME(m_control));
save_item(NAME(m_rsh));
save_item(NAME(m_wsh));
+ save_item(NAME(m_rw_bit_count));
}
void iwm_device::device_reset()
@@ -78,7 +79,7 @@ void iwm_device::device_reset()
m_rw = MODE_IDLE;
m_rw_state = S_IDLE;
m_data = 0x00;
- m_whd = 0xff;
+ m_whd = 0xbf;
m_mode = 0x00;
m_status = 0x00;
m_control = 0x00;
@@ -86,17 +87,20 @@ void iwm_device::device_reset()
m_rsh = 0x00;
m_flux_write_start = 0;
m_flux_write_count = 0;
+ m_rw_bit_count = 0;
m_devsel_cb(0);
}
void iwm_device::device_timer(emu_timer &, device_timer_id, int, void *)
{
if(m_active == MODE_DELAY) {
+ flush_write();
m_active = MODE_IDLE;
if(m_floppy && !m_disable_mon)
m_floppy->mon_w(true);
m_devsel_cb(0);
m_status &= ~0x20;
+ m_whd &= ~0x40;
}
}
@@ -149,7 +153,7 @@ void iwm_device::flush_write()
u8 iwm_device::control(int offset, u8 data)
{
sync();
- logerror("control trigger %x, %02x\n", offset, data);
+ // logerror("control trigger %x, %02x\n", offset, data);
u8 changed = m_control | (m_phases & 0xf);
if(offset < 8) {
if(offset & 1)
@@ -177,8 +181,10 @@ u8 iwm_device::control(int offset, u8 data)
m_floppy->mon_w(false);
} else {
if(m_mode & 0x04) {
+ flush_write();
m_active = MODE_IDLE;
m_status &= ~0x20;
+ m_whd &= ~0x40;
if(m_floppy && !m_disable_mon)
m_floppy->mon_w(true);
} else {
@@ -200,9 +206,10 @@ u8 iwm_device::control(int offset, u8 data)
m_async_update = 0;
m_data = 0x00;
- } else if((m_control & 0xc0) == 0xc0 && (changed & 0xc0) == 0x40 && m_active && m_rw != MODE_WRITE) {
+ } else if((m_control & 0xc0) == 0xc0 && m_active && m_rw != MODE_WRITE) {
m_rw = MODE_WRITE;
m_rw_state = S_IDLE;
+ m_whd |= 0x40;
m_next_state_change = 0;
m_flux_write_start = m_last_sync;
m_flux_write_count = 0;
@@ -218,7 +225,7 @@ u8 iwm_device::control(int offset, u8 data)
m_rw = MODE_IDLE;
}
- if(changed || 1) {
+ if(1) {
u8 s = m_control & 0xc0;
const char *slot = "?";
if(s == 0x00 && !m_active)
@@ -234,7 +241,7 @@ u8 iwm_device::control(int offset, u8 data)
if(s == 0xc0 && m_active)
slot = "write load / write data";
- logerror("control %c%c %c%c %c%c%c%c (%s) [%s, %s]\n",
+ logerror("control %c%c %c%c %c%c%c%c (%s) [%s, %s] whd=%02x data=%02x\n",
m_control & 0x80 ? '1' : '0',
m_control & 0x40 ? '1' : '0',
m_control & 0x20 ? 'b' : 'a',
@@ -245,7 +252,8 @@ u8 iwm_device::control(int offset, u8 data)
m_phases & 0x01 ? '#' : '.',
slot,
m_active == MODE_IDLE ? "idle" : m_active == MODE_DELAY ? "delay" : "active",
- m_rw == MODE_IDLE ? "idle" : m_rw == MODE_READ ? "read" : "write");
+ m_rw == MODE_IDLE ? "idle" : m_rw == MODE_READ ? "read" : "write",
+ m_whd, m_data);
}
if(m_active && !(m_control & 0xc0) && !is_sync() && (m_data & 0x80))
@@ -281,6 +289,9 @@ void iwm_device::data_w(u8 data)
m_data = data;
if(is_sync() && m_rw == MODE_WRITE)
m_wsh = data;
+ if(m_mode & 0x01)
+ m_whd &= 0x7f;
+ logerror("data load %02x, m_mode %02x whd %02x\n", m_data, m_mode, m_whd);
}
u64 iwm_device::time_to_cycles(const attotime &tm) const
@@ -383,6 +394,9 @@ void iwm_device::sync()
if(is_sync()) {
if(m_rsh >= 0x80) {
m_data = m_rsh;
+ logerror("DATAR %02x\n", m_data);
+ if(m_data == 0xfc)
+ machine().debug_break();
m_rsh = 0;
} else if(m_rsh >= 0x04) {
m_data = m_rsh;
@@ -392,6 +406,9 @@ void iwm_device::sync()
} else if(m_rsh >= 0x80) {
m_data = m_rsh;
+ logerror("DATAR %02x\n", m_data);
+ if(m_data == 0xfc)
+ machine().debug_break();
m_rsh = 0;
}
break;
@@ -422,25 +439,65 @@ void iwm_device::sync()
m_last_sync = m_next_state_change;
switch(m_rw_state) {
case S_IDLE:
- m_wsh = m_data;
- m_rw_state = SW_WINDOW_MIDDLE;
- m_next_state_change = q3_to_fclk(fclk_to_q3(m_last_sync) + write_sync_half_window_size());
+ // logerror("%s: idle\n", attotime::from_ticks(m_last_sync, clock()).to_string());
m_flux_write_count = 0;
+ if(m_mode & 0x02) {
+ m_rw_state = SW_WINDOW_LOAD;
+ m_rw_bit_count = 8;
+ m_next_state_change = m_last_sync + 7;
+ } else {
+ m_wsh = m_data;
+ m_rw_state = SW_WINDOW_MIDDLE;
+ m_next_state_change = q3_to_fclk(fclk_to_q3(m_last_sync) + write_sync_half_window_size());
+ }
+ break;
+
+ case SW_WINDOW_LOAD:
+ // logerror("%s: window load\n", attotime::from_ticks(m_last_sync, clock()).to_string());
+ if(m_whd & 0x80) {
+ // logerror("Underrun\n");
+ m_whd &= ~0x40;
+ m_rw_state = S_IDLE;
+ m_last_sync = next_sync;
+ } else {
+ logerror("DATAW %02x\n", m_data);
+ m_wsh = m_data;
+ m_rw_state = SW_WINDOW_MIDDLE;
+ m_whd |= 0x80;
+ m_next_state_change = m_last_sync + half_window_size() - 7;
+ }
break;
case SW_WINDOW_MIDDLE:
+ // logerror("%s: window middle\n", attotime::from_ticks(m_last_sync, clock()).to_string());
if(m_wsh & 0x80)
m_flux_write[m_flux_write_count++] = m_last_sync;
m_wsh <<= 1;
- m_next_state_change = q3_to_fclk(fclk_to_q3(m_last_sync) + write_sync_half_window_size());
-
m_rw_state = SW_WINDOW_END;
+ if(m_mode & 0x02)
+ m_next_state_change = m_last_sync + half_window_size();
+ else
+ m_next_state_change = q3_to_fclk(fclk_to_q3(m_last_sync) + write_sync_half_window_size());
break;
+
case SW_WINDOW_END:
+ // logerror("%s: window end\n", attotime::from_ticks(m_last_sync, clock()).to_string());
if(m_flux_write_count == m_flux_write.size())
flush_write();
- m_next_state_change = q3_to_fclk(fclk_to_q3(m_last_sync) + write_sync_half_window_size());
- m_rw_state = SW_WINDOW_MIDDLE;
+ if(m_mode & 0x02) {
+ m_rw_bit_count --;
+ if(m_rw_bit_count == 0) {
+ m_rw_state = SW_WINDOW_LOAD;
+ m_rw_bit_count = 8;
+ m_next_state_change = m_last_sync + 7;
+ } else {
+ m_rw_state = SW_WINDOW_MIDDLE;
+ m_next_state_change = m_last_sync + half_window_size();
+ }
+ } else {
+ m_next_state_change = q3_to_fclk(fclk_to_q3(m_last_sync) + write_sync_half_window_size());
+ m_rw_state = SW_WINDOW_MIDDLE;
+ }
break;
}
}
diff --git a/src/devices/machine/iwm.h b/src/devices/machine/iwm.h
index b311feed299..279f207537f 100644
--- a/src/devices/machine/iwm.h
+++ b/src/devices/machine/iwm.h
@@ -52,6 +52,7 @@ private:
S_IDLE,
SR_WINDOW_EDGE_0,
SR_WINDOW_EDGE_1,
+ SW_WINDOW_LOAD,
SW_WINDOW_MIDDLE,
SW_WINDOW_END
};
@@ -65,7 +66,7 @@ private:
u32 m_flux_write_count;
u32 m_q3_clock;
int m_active, m_rw, m_rw_state;
- u8 m_data, m_whd, m_mode, m_status, m_control;
+ u8 m_data, m_whd, m_mode, m_status, m_control, m_rw_bit_count;
u8 m_rsh, m_wsh;
bool m_disable_mon;
diff --git a/src/devices/machine/swim1.cpp b/src/devices/machine/swim1.cpp
index 9c49fd94dad..f789a4e01cb 100644
--- a/src/devices/machine/swim1.cpp
+++ b/src/devices/machine/swim1.cpp
@@ -11,20 +11,9 @@
DEFINE_DEVICE_TYPE(SWIM1, swim1_device, "swim1", "Apple SWIM1 (Sander/Wozniak Integrated Machine) version 1 floppy controller")
-swim1_device::swim1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, uint32_t q3_clock) :
- applefdintf_device(mconfig, SWIM1, tag, owner, clock),
- m_q3_clock(q3_clock)
-{
- m_iwm_q3_fclk_ratio = double(clock)/double(q3_clock); // ~0.125
- m_iwm_fclk_q3_ratio = double(q3_clock)/double(clock); // ~8
-}
-
swim1_device::swim1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- applefdintf_device(mconfig, SWIM1, tag, owner, clock),
- m_q3_clock(0)
+ applefdintf_device(mconfig, SWIM1, tag, owner, clock)
{
- m_iwm_q3_fclk_ratio = 0;
- m_iwm_fclk_q3_ratio = 0;
}
void swim1_device::device_start()
@@ -414,16 +403,6 @@ attotime swim1_device::cycles_to_time(u64 cycles) const
return attotime::from_ticks(cycles, clock());
}
-u64 swim1_device::iwm_q3_to_fclk(u64 cycles) const
-{
- return u64(m_iwm_q3_fclk_ratio * double(cycles) + 0.5);
-}
-
-u64 swim1_device::iwm_fclk_to_q3(u64 cycles) const
-{
- return u64(m_iwm_fclk_q3_ratio * double(cycles) + 0.5);
-}
-
void swim1_device::ism_fifo_clear()
{
m_ism_fifo_pos = 0;
@@ -502,11 +481,6 @@ u64 swim1_device::iwm_read_register_update_delay() const
return m_iwm_mode & 0x08 ? 4 : 8;
}
-u64 swim1_device::iwm_write_sync_half_window_size() const
-{
- return m_iwm_mode & 0x08 ? 2 : 4;
-}
-
void swim1_device::iwm_sync()
{
if(!m_iwm_active)
@@ -602,7 +576,7 @@ void swim1_device::iwm_sync()
case S_IDLE:
m_iwm_wsh = m_iwm_data;
m_iwm_rw_state = SW_WINDOW_MIDDLE;
- m_iwm_next_state_change = iwm_q3_to_fclk(iwm_fclk_to_q3(m_last_sync) + iwm_write_sync_half_window_size());
+ // m_iwm_next_state_change = iwm_q3_to_fclk(iwm_fclk_to_q3(m_last_sync) + iwm_write_sync_half_window_size());
m_flux_write_count = 0;
break;
@@ -610,14 +584,14 @@ void swim1_device::iwm_sync()
if(m_iwm_wsh & 0x80)
m_flux_write[m_flux_write_count++] = m_last_sync;
m_iwm_wsh <<= 1;
- m_iwm_next_state_change = iwm_q3_to_fclk(iwm_fclk_to_q3(m_last_sync) + iwm_write_sync_half_window_size());
+ // m_iwm_next_state_change = iwm_q3_to_fclk(iwm_fclk_to_q3(m_last_sync) + iwm_write_sync_half_window_size());
m_iwm_rw_state = SW_WINDOW_END;
break;
case SW_WINDOW_END:
if(m_flux_write_count == m_flux_write.size())
flush_write();
- m_iwm_next_state_change = iwm_q3_to_fclk(iwm_fclk_to_q3(m_last_sync) + iwm_write_sync_half_window_size());
+ // m_iwm_next_state_change = iwm_q3_to_fclk(iwm_fclk_to_q3(m_last_sync) + iwm_write_sync_half_window_size());
m_iwm_rw_state = SW_WINDOW_MIDDLE;
break;
}
diff --git a/src/devices/machine/swim1.h b/src/devices/machine/swim1.h
index 47e1032e128..47f68727dfb 100644
--- a/src/devices/machine/swim1.h
+++ b/src/devices/machine/swim1.h
@@ -22,7 +22,6 @@ class swim1_device : public applefdintf_device
{
public:
// construction/destruction
- swim1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, uint32_t q3_clock);
swim1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual u8 read(offs_t offset) override;
@@ -61,19 +60,17 @@ private:
std::array<u64, 32> m_flux_write;
u32 m_flux_write_count;
u64 m_last_sync;
- double m_iwm_q3_fclk_ratio, m_iwm_fclk_q3_ratio;
- [[maybe_unused]] u32 m_q3_clock;
u8 m_ism_param[16];
u8 m_ism_mode, m_ism_setup;
- [[maybe_unused]] u8 m_ism_error;
+ //u8 m_ism_error;
u8 m_ism_param_idx, m_ism_fifo_pos;
- [[maybe_unused]] u8 m_ism_tss_sr, m_ism_tss_output, m_ism_current_bit;
+ //u8 m_ism_tss_sr, m_ism_tss_output, m_ism_current_bit;
u16 m_ism_fifo[2];
- [[maybe_unused]] u16 m_ism_sr;
+ //u16 m_ism_sr;
u16 m_ism_crc;
- [[maybe_unused]] u16 m_ism_mfm_sync_counter;
- [[maybe_unused]] u32 m_ism_half_cycles_before_change;
+ //u16 m_ism_mfm_sync_counter;
+ //u32 m_ism_half_cycles_before_change;
u64 m_iwm_next_state_change, m_iwm_sync_update, m_iwm_async_update;
int m_iwm_active, m_iwm_rw, m_iwm_rw_state;
@@ -85,12 +82,9 @@ private:
attotime cycles_to_time(u64 cycles) const;
void flush_write(u64 when = 0);
- u64 iwm_fclk_to_q3(u64 cycles) const;
- u64 iwm_q3_to_fclk(u64 cycles) const;
u64 iwm_window_size() const;
u64 iwm_half_window_size() const;
u64 iwm_read_register_update_delay() const;
- u64 iwm_write_sync_half_window_size() const;
inline bool iwm_is_sync() const;
void iwm_mode_w(u8 data);
void iwm_data_w(u8 data);
diff --git a/src/devices/sound/rf5c400.cpp b/src/devices/sound/rf5c400.cpp
index 7495e484540..9c650275aa1 100644
--- a/src/devices/sound/rf5c400.cpp
+++ b/src/devices/sound/rf5c400.cpp
@@ -5,16 +5,6 @@
Written by Ville Linde
Improvements by the hoot development team
-
- history -
- 2007-02-08 hoot development team
- looping
- stereo panning
- 8-bit sample support
-
- 2007-02-16 hoot development team
- envelope
- fixed volume table
*/
#include "emu.h"
@@ -149,15 +139,33 @@ void rf5c400_device::device_start()
// init channel info
for (rf5c400_channel &chan : m_channels)
{
+ chan.startH = 0;
+ chan.startL = 0;
+ chan.freq = 0;
+ chan.endL = 0;
+ chan.endHloopH = 0;
+ chan.loopL = 0;
+ chan.pan = 0;
+ chan.effect = 0;
+ chan.volume = 0;
+ chan.attack = 0;
+ chan.decay = 0;
+ chan.release = 0;
+ chan.pos = 0;
+ chan.step = 0;
+ chan.keyon = 0;
chan.env_phase = PHASE_NONE;
chan.env_level = 0.0;
chan.env_step = 0.0;
chan.env_scale = 1.0;
}
+ m_req_channel = 0;
+
save_item(NAME(m_rf5c400_status));
save_item(NAME(m_ext_mem_address));
save_item(NAME(m_ext_mem_data));
+ save_item(NAME(m_req_channel));
save_item(STRUCT_MEMBER(m_channels, startH));
save_item(STRUCT_MEMBER(m_channels, startL));
@@ -201,7 +209,7 @@ void rf5c400_device::device_clock_changed()
void rf5c400_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs)
{
int i, ch;
- uint64_t end, loop;
+ uint64_t start, end, loop;
uint64_t pos;
uint8_t vol, lvol, rvol, type;
uint8_t env_phase;
@@ -216,9 +224,9 @@ void rf5c400_device::sound_stream_update(sound_stream &stream, std::vector<read_
auto &buf0 = outputs[0];
auto &buf1 = outputs[1];
-// start = ((channel->startH & 0xFF00) << 8) | channel->startL;
- end = ((channel->endHloopH & 0xFF) << 16) | channel->endL;
- loop = ((channel->endHloopH & 0xFF00) << 8) | channel->loopL;
+ start = ((uint32_t)(channel->startH & 0xFF00) << 8) | channel->startL;
+ end = ((uint32_t)(channel->endHloopH & 0xFF) << 16) | channel->endL;
+ loop = ((uint32_t)(channel->endHloopH & 0xFF00) << 8) | channel->loopL;
pos = channel->pos;
vol = channel->volume & 0xFF;
lvol = channel->pan & 0xFF;
@@ -230,6 +238,12 @@ void rf5c400_device::sound_stream_update(sound_stream &stream, std::vector<read_
env_step = channel->env_step;
env_rstep = env_step * channel->env_scale;
+ if (start == end)
+ {
+ // This occurs in pop'n music when trying to play a non-existent sample on the sound test menu
+ continue;
+ }
+
for (i=0; i < buf0.samples(); i++)
{
int16_t tmp;
@@ -308,6 +322,15 @@ void rf5c400_device::sound_stream_update(sound_stream &stream, std::vector<read_
{
pos -= loop<<16;
pos &= 0xFFFFFF0000ULL;
+
+ if (pos < (start<<16))
+ {
+ // This case only shows up in Firebeat games from what I could tell.
+ // The loop value will be higher than the actual buffer size.
+ // This is used when DMAs will be overwriting the current buffer.
+ // It expects the buffer to be looped without any additional commands.
+ pos = start<<16;
+ }
}
}
@@ -344,6 +367,32 @@ uint16_t rf5c400_device::rf5c400_r(offs_t offset, uint16_t mem_mask)
return 0;
}
+ case 0x09: // position read?
+ {
+ // The game will always call rf5c400_w 0x08 with a channel number and some other value before reading this register.
+ // The call to rf5c400_w 0x08 contains additional information, potentially what information it's expecting to be returned here.
+ // This implementation assumes all commands want the same information as command 6.
+ m_stream->update();
+
+ rf5c400_channel* channel = &m_channels[m_req_channel];
+ if (channel->env_phase == PHASE_NONE)
+ {
+ return 0;
+ }
+
+ // pop'n music's SPU program expects to read this register 6 times with the same value between every read before it will send the next DMA request.
+ //
+ // This register is polled while a streaming BGM is being played.
+ // For pop'n music specifically, the game starts off by reading 0x200000 into 0x00780000 - 0x00880000.
+ // When 2xxx is found (pos - start = 0x00080000), it will trigger the next DMA of 0x100000 overwriting 0x00780000 - 0x00800000, and continues polling the register until it reads 1xxx next.
+ // When 1xxx is found (pos - start = 0x00040000), it will trigger the next DMA of 0x100000 overwriting 0x00800000 - 0x00880000, and continues polling the register until it reads 2xxx next.
+ // ... repeat until song is finished, alternating between 2xxx and 1xxx ...
+ // This ends up so that it'll always be buffering new sample data into the sections of memory that aren't being used.
+ auto start = ((uint32_t)(channel->startH & 0xFF00) << 8) | channel->startL;
+ auto ch_offset = (channel->pos >> 16) - start;
+ return ch_offset >> 6;
+ }
+
case 0x13: // memory read
{
return read_word(m_ext_mem_address<<1);
@@ -391,7 +440,7 @@ void rf5c400_device::rf5c400_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
case 0x60:
m_channels[ch].pos =
- ((m_channels[ch].startH & 0xFF00) << 8) | m_channels[ch].startL;
+ ((uint32_t)(m_channels[ch].startH & 0xFF00) << 8) | m_channels[ch].startL;
m_channels[ch].pos <<= 16;
m_channels[ch].env_phase = PHASE_ATTACK;
@@ -421,8 +470,16 @@ void rf5c400_device::rf5c400_w(offs_t offset, uint16_t data, uint16_t mem_mask)
break;
}
- case 0x08: // relative to env attack (channel no)
- case 0x09: // relative to env attack (0x0c00/ 0x1c00)
+ case 0x08:
+ {
+ // There's some other data stuffed in the upper bits beyond the channel: data >> 5
+ // The other data might be some kind of register or command. I've seen 0, 4, 5, and 6.
+ // Firebeat uses 6 when polling rf5c400_r 0x09.
+ m_req_channel = data & 0x1f;
+ break;
+ }
+
+ case 0x09: // relative to env attack (0x0c00/ 0x1c00/ 0x1e00)
case 0x11: // memory r/w address, bits 15 - 0
{
diff --git a/src/devices/sound/rf5c400.h b/src/devices/sound/rf5c400.h
index 6e729daad0a..8f54d2bc8b3 100644
--- a/src/devices/sound/rf5c400.h
+++ b/src/devices/sound/rf5c400.h
@@ -96,6 +96,7 @@ private:
uint16_t m_rf5c400_status;
uint32_t m_ext_mem_address;
uint16_t m_ext_mem_data;
+ uint16_t m_req_channel;
};
DECLARE_DEVICE_TYPE(RF5C400, rf5c400_device)
diff --git a/src/emu/debug/express.cpp b/src/emu/debug/express.cpp
index 351c340333a..6ad1bec038e 100644
--- a/src/emu/debug/express.cpp
+++ b/src/emu/debug/express.cpp
@@ -41,7 +41,9 @@
DEBUGGING
***************************************************************************/
-#define DEBUG_TOKENS 0
+#define LOG_OUTPUT_FUNC osd_printf_info
+#define VERBOSE 0
+#include "logmacro.h"
@@ -1119,89 +1121,72 @@ void parsed_expression::copy(const parsed_expression &src)
// human readable token representation
//-------------------------------------------------
-void parsed_expression::print_tokens(FILE *out)
+void parsed_expression::print_tokens()
{
-#if DEBUG_TOKENS
- osd_printf_debug("----\n");
- for (parse_token *token = m_tokens.first(); token != nullptr; token = token->next())
+ LOG("----\n");
+ for (parse_token &token : m_tokenlist)
{
- switch (token->type)
+ if (token.is_number())
+ LOG("NUMBER: %016X\n", token.value());
+ else if (token.is_string())
+ LOG("STRING: ""%s""\n", token.string());
+ else if (token.is_symbol())
+ LOG("SYMBOL: %s%s%s\n", token.symbol().name(), token.symbol().is_function() ? "()" : "", token.symbol().is_lval() ? " &" : "");
+ else if (token.is_operator())
{
- default:
- case parse_token::INVALID:
- fprintf(out, "INVALID\n");
- break;
-
- case parse_token::END:
- fprintf(out, "END\n");
- break;
-
- case parse_token::NUMBER:
- fprintf(out, "NUMBER: %08X%08X\n", (u32)(token->value.i >> 32), u32(token->value.i));
- break;
-
- case parse_token::STRING:
- fprintf(out, "STRING: ""%s""\n", token->string);
- break;
-
- case parse_token::SYMBOL:
- fprintf(out, "SYMBOL: %08X%08X\n", u32(token->value.i >> 32), u32(token->value.i));
- break;
-
- case parse_token::OPERATOR:
- switch (token->value.i)
- {
- case TVL_LPAREN: fprintf(out, "(\n"); break;
- case TVL_RPAREN: fprintf(out, ")\n"); break;
- case TVL_PLUSPLUS: fprintf(out, "++ (unspecified)\n"); break;
- case TVL_MINUSMINUS: fprintf(out, "-- (unspecified)\n"); break;
- case TVL_PREINCREMENT: fprintf(out, "++ (prefix)\n"); break;
- case TVL_PREDECREMENT: fprintf(out, "-- (prefix)\n"); break;
- case TVL_POSTINCREMENT: fprintf(out, "++ (postfix)\n"); break;
- case TVL_POSTDECREMENT: fprintf(out, "-- (postfix)\n"); break;
- case TVL_COMPLEMENT: fprintf(out, "!\n"); break;
- case TVL_NOT: fprintf(out, "~\n"); break;
- case TVL_UPLUS: fprintf(out, "+ (unary)\n"); break;
- case TVL_UMINUS: fprintf(out, "- (unary)\n"); break;
- case TVL_MULTIPLY: fprintf(out, "*\n"); break;
- case TVL_DIVIDE: fprintf(out, "/\n"); break;
- case TVL_MODULO: fprintf(out, "%%\n"); break;
- case TVL_ADD: fprintf(out, "+\n"); break;
- case TVL_SUBTRACT: fprintf(out, "-\n"); break;
- case TVL_LSHIFT: fprintf(out, "<<\n"); break;
- case TVL_RSHIFT: fprintf(out, ">>\n"); break;
- case TVL_LESS: fprintf(out, "<\n"); break;
- case TVL_LESSOREQUAL: fprintf(out, "<=\n"); break;
- case TVL_GREATER: fprintf(out, ">\n"); break;
- case TVL_GREATEROREQUAL:fprintf(out, ">=\n"); break;
- case TVL_EQUAL: fprintf(out, "==\n"); break;
- case TVL_NOTEQUAL: fprintf(out, "!=\n"); break;
- case TVL_BAND: fprintf(out, "&\n"); break;
- case TVL_BXOR: fprintf(out, "^\n"); break;
- case TVL_BOR: fprintf(out, "|\n"); break;
- case TVL_LAND: fprintf(out, "&&\n"); break;
- case TVL_LOR: fprintf(out, "||\n"); break;
- case TVL_ASSIGN: fprintf(out, "=\n"); break;
- case TVL_ASSIGNMULTIPLY:fprintf(out, "*=\n"); break;
- case TVL_ASSIGNDIVIDE: fprintf(out, "/=\n"); break;
- case TVL_ASSIGNMODULO: fprintf(out, "%%=\n"); break;
- case TVL_ASSIGNADD: fprintf(out, "+=\n"); break;
- case TVL_ASSIGNSUBTRACT:fprintf(out, "-=\n"); break;
- case TVL_ASSIGNLSHIFT: fprintf(out, "<<=\n"); break;
- case TVL_ASSIGNRSHIFT: fprintf(out, ">>=\n"); break;
- case TVL_ASSIGNBAND: fprintf(out, "&=\n"); break;
- case TVL_ASSIGNBXOR: fprintf(out, "^=\n"); break;
- case TVL_ASSIGNBOR: fprintf(out, "|=\n"); break;
- case TVL_COMMA: fprintf(out, ",\n"); break;
- case TVL_MEMORYAT: fprintf(out, token.memory_size_effect() ? "mem!\n" : "mem@\n");break;
- case TVL_EXECUTEFUNC: fprintf(out, "execute\n"); break;
- default: fprintf(out, "INVALID OPERATOR\n"); break;
- }
- break;
+ switch (token.optype())
+ {
+ case TVL_LPAREN: LOG("(\n"); break;
+ case TVL_RPAREN: LOG(")\n"); break;
+ case TVL_PLUSPLUS: LOG("++ (unspecified)\n"); break;
+ case TVL_MINUSMINUS: LOG("-- (unspecified)\n"); break;
+ case TVL_PREINCREMENT: LOG("++ (prefix)\n"); break;
+ case TVL_PREDECREMENT: LOG("-- (prefix)\n"); break;
+ case TVL_POSTINCREMENT: LOG("++ (postfix)\n"); break;
+ case TVL_POSTDECREMENT: LOG("-- (postfix)\n"); break;
+ case TVL_COMPLEMENT: LOG("!\n"); break;
+ case TVL_NOT: LOG("~\n"); break;
+ case TVL_UPLUS: LOG("+ (unary)\n"); break;
+ case TVL_UMINUS: LOG("- (unary)\n"); break;
+ case TVL_MULTIPLY: LOG("*\n"); break;
+ case TVL_DIVIDE: LOG("/\n"); break;
+ case TVL_MODULO: LOG("%%\n"); break;
+ case TVL_ADD: LOG("+\n"); break;
+ case TVL_SUBTRACT: LOG("-\n"); break;
+ case TVL_LSHIFT: LOG("<<\n"); break;
+ case TVL_RSHIFT: LOG(">>\n"); break;
+ case TVL_LESS: LOG("<\n"); break;
+ case TVL_LESSOREQUAL: LOG("<=\n"); break;
+ case TVL_GREATER: LOG(">\n"); break;
+ case TVL_GREATEROREQUAL:LOG(">=\n"); break;
+ case TVL_EQUAL: LOG("==\n"); break;
+ case TVL_NOTEQUAL: LOG("!=\n"); break;
+ case TVL_BAND: LOG("&\n"); break;
+ case TVL_BXOR: LOG("^\n"); break;
+ case TVL_BOR: LOG("|\n"); break;
+ case TVL_LAND: LOG("&&\n"); break;
+ case TVL_LOR: LOG("||\n"); break;
+ case TVL_ASSIGN: LOG("=\n"); break;
+ case TVL_ASSIGNMULTIPLY:LOG("*=\n"); break;
+ case TVL_ASSIGNDIVIDE: LOG("/=\n"); break;
+ case TVL_ASSIGNMODULO: LOG("%%=\n"); break;
+ case TVL_ASSIGNADD: LOG("+=\n"); break;
+ case TVL_ASSIGNSUBTRACT:LOG("-=\n"); break;
+ case TVL_ASSIGNLSHIFT: LOG("<<=\n"); break;
+ case TVL_ASSIGNRSHIFT: LOG(">>=\n"); break;
+ case TVL_ASSIGNBAND: LOG("&=\n"); break;
+ case TVL_ASSIGNBXOR: LOG("^=\n"); break;
+ case TVL_ASSIGNBOR: LOG("|=\n"); break;
+ case TVL_COMMA: LOG(",\n"); break;
+ case TVL_MEMORYAT: LOG(token.memory_side_effects() ? "mem!\n" : "mem@\n");break;
+ case TVL_EXECUTEFUNC: LOG("execute\n"); break;
+ default: LOG("INVALID OPERATOR\n"); break;
+ }
}
+ else
+ LOG("INVALID\n");
}
- osd_printf_debug("----\n");
-#endif
+ LOG("----\n");
}
@@ -1696,9 +1681,8 @@ void parsed_expression::parse_memory_operator(parse_token &token, const char *st
// ambiguities based on neighboring tokens
//-------------------------------------------------
-void parsed_expression::normalize_operator(parse_token *prevtoken, parse_token &thistoken, const std::list<parse_token> &stack, bool was_rparen)
+void parsed_expression::normalize_operator(parse_token &thistoken, parse_token *prevtoken, parse_token *nexttoken, const std::list<parse_token> &stack, bool was_rparen)
{
- parse_token *nexttoken = thistoken.next();
switch (thistoken.optype())
{
// Determine if an open paren is part of a function or not
@@ -1791,7 +1775,7 @@ void parsed_expression::infix_to_postfix()
else if (token->is_operator())
{
// normalize the operator based on neighbors
- normalize_operator(prev, *token, stack, was_rparen);
+ normalize_operator(*token, prev, next != m_tokenlist.end() ? &*next : nullptr, stack, was_rparen);
was_rparen = false;
// if the token is an opening parenthesis, push it onto the stack.
@@ -2206,8 +2190,7 @@ u64 parsed_expression::execute_tokens()
//-------------------------------------------------
parsed_expression::parse_token::parse_token(int offset)
- : m_next(nullptr),
- m_type(INVALID),
+ : m_type(INVALID),
m_offset(offset),
m_value(0),
m_flags(0),
@@ -2274,7 +2257,7 @@ void parsed_expression::execute_function(parse_token &token)
// if it is a function symbol, break out of the loop
if (peek.is_symbol())
{
- symbol = peek.symbol();
+ symbol = &peek.symbol();
if (symbol->is_function())
{
m_token_stack.pop_back();
diff --git a/src/emu/debug/express.h b/src/emu/debug/express.h
index e9e8a86ab78..958959b27df 100644
--- a/src/emu/debug/express.h
+++ b/src/emu/debug/express.h
@@ -283,7 +283,6 @@ private:
parse_token(int offset = 0);
// getters
- parse_token *next() const { return m_next; }
int offset() const { return m_offset; }
bool is_number() const { return (m_type == NUMBER); }
bool is_string() const { return (m_type == STRING); }
@@ -294,8 +293,9 @@ private:
bool is_lval() const { return ((m_type == SYMBOL && m_symbol->is_lval()) || m_type == MEMORY); }
u64 value() const { assert(m_type == NUMBER); return m_value; }
+ const char *string() const { assert(m_type == STRING); return m_string; }
u32 address() const { assert(m_type == MEMORY); return m_value; }
- symbol_entry *symbol() const { assert(m_type == SYMBOL); return m_symbol; }
+ symbol_entry &symbol() const { assert(m_type == SYMBOL); return *m_symbol; }
u8 optype() const { assert(m_type == OPERATOR); return (m_flags & TIN_OPTYPE_MASK) >> TIN_OPTYPE_SHIFT; }
u8 precedence() const { assert(m_type == OPERATOR); return (m_flags & TIN_PRECEDENCE_MASK) >> TIN_PRECEDENCE_SHIFT; }
@@ -329,7 +329,6 @@ private:
private:
// internal state
- parse_token * m_next; // next token in list
token_type m_type; // type of token
int m_offset; // offset within the string
u64 m_value; // integral value
@@ -340,7 +339,7 @@ private:
// internal helpers
void copy(const parsed_expression &src);
- void print_tokens(FILE *out);
+ void print_tokens();
// parsing helpers
void parse_string_into_tokens();
@@ -349,7 +348,7 @@ private:
void parse_quoted_char(parse_token &token, const char *&string);
void parse_quoted_string(parse_token &token, const char *&string);
void parse_memory_operator(parse_token &token, const char *string, bool disable_se);
- void normalize_operator(parse_token *prevtoken, parse_token &thistoken, const std::list<parse_token> &stack, bool was_rparen);
+ void normalize_operator(parse_token &thistoken, parse_token *prevtoken, parse_token *nexttoken, const std::list<parse_token> &stack, bool was_rparen);
void infix_to_postfix();
// execution helpers
diff --git a/src/mame/drivers/alpha68k_i.cpp b/src/mame/drivers/alpha68k_i.cpp
index 1da3ac3ef21..2f3bc932e2b 100644
--- a/src/mame/drivers/alpha68k_i.cpp
+++ b/src/mame/drivers/alpha68k_i.cpp
@@ -11,6 +11,30 @@
i.e. Paddle Mania draws a middle line there, which isn't shown on real HW.
- Paddle Mania: ranking screen is unreadable, maybe
+***************************************************************************
+
+The Next Space:
+ Mainboard A8004-1
+ MC68000P10 @ 9MHz
+ Z80A @ 4MHz
+ YM3812 @ 4MHz + YM3014 DAC
+ 24MHz, 18MHz & 4MHz OSCs
+ 8 switch Dipswitch x 2
+ Custom SNK CLK chip
+ Custom SNK I/O chip x 2
+ Many PCBs feature a A8004-2 daughtercard with 4 smaller mask ROMs, labeled
+ NS 5, NS 6, NS 7 & NS 8 instead of the single larger mask ROM
+
+***************************************************************************
+
+Paddle Mania
+ Mainboard 68K-96-I
+ MC68000-8 @ 6MHz
+ Z80A @ 4MHz
+ YM3812 @ 4MHz + YM3014 DAC
+ 24MHz OSC
+ 8 switch Dipswitch x 2
+
***************************************************************************/
#include "emu.h"
@@ -350,7 +374,7 @@ void alpha68k_I_state::base_config(machine_config &config)
GENERIC_LATCH_8(config, m_soundlatch);
- ym3812_device &ymsnd(YM3812(config, "ymsnd", 4000000));
+ ym3812_device &ymsnd(YM3812(config, "ymsnd", XTAL(24'000'000)/6)); // 4MHz (24MHz/6) verified
ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
ymsnd.add_route(ALL_OUTPUTS, "speaker", 1.0);
}
@@ -374,11 +398,11 @@ void paddlemania_state::paddlema(machine_config &config)
{
base_config(config);
/* basic machine hardware */
- M68000(config, m_maincpu, 6000000); /* 24MHz/4? */
+ M68000(config, m_maincpu, XTAL(24'000'000)/4); // 6MHz (24MHz/4) verified
m_maincpu->set_addrmap(AS_PROGRAM, &paddlemania_state::main_map);
m_maincpu->set_vblank_int("screen", FUNC(paddlemania_state::irq1_line_hold)); /* VBL */
- Z80(config, m_audiocpu, 4000000); // 4Mhz seems to yield the correct tone
+ Z80(config, m_audiocpu, XTAL(24'000'000)/6); // 4MHz (24MHz/6) verified
m_audiocpu->set_addrmap(AS_PROGRAM, &paddlemania_state::sound_map);
video_config(config, 0);
@@ -390,11 +414,11 @@ void thenextspace_state::tnextspc(machine_config &config)
{
base_config(config);
/* basic machine hardware */
- M68000(config, m_maincpu, 9000000); /* Confirmed 18 MHz/2 */
+ M68000(config, m_maincpu, XTAL(18'000'000)/2); // 9MHz (18MHz/2) verified
m_maincpu->set_addrmap(AS_PROGRAM, &thenextspace_state::main_map);
m_maincpu->set_vblank_int("screen", FUNC(thenextspace_state::irq1_line_hold)); /* VBL */
- Z80(config, m_audiocpu, 4000000);
+ Z80(config, m_audiocpu, XTAL(4'000'000)); // 4Mhz verified
m_audiocpu->set_addrmap(AS_PROGRAM, &thenextspace_state::sound_map);
m_audiocpu->set_addrmap(AS_IO, &thenextspace_state::sound_iomap);
@@ -408,6 +432,7 @@ void thenextspace_state::tnextspc(machine_config &config)
*
*/
+// Several bootleg boards with identical ROMs but no Alpha MCU have been found.
ROM_START( paddlema )
ROM_REGION( 0x40000, "maincpu", 0 )
ROM_LOAD16_BYTE( "padlem.6g", 0x00000, 0x10000, CRC(c227a6e8) SHA1(9c98be6e82a0dd76fd5b786601456b060407c57f) )
@@ -415,7 +440,7 @@ ROM_START( paddlema )
ROM_LOAD16_BYTE( "padlem.6h", 0x20000, 0x10000, CRC(8897555f) SHA1(7d30aa56a727700a6e02af92b065ed982a39ccc2) )
ROM_LOAD16_BYTE( "padlem.3h", 0x20001, 0x10000, CRC(f0fe9b9d) SHA1(2e7a80dc25c549e57b7698052f53562a9a608205) )
- ROM_REGION( 0x10000, "audiocpu", 0 )
+ ROM_REGION( 0x10000, "audiocpu", 0 ) // Sound CPU
ROM_LOAD( "padlem.18c", 0x000000, 0x10000, CRC(9269778d) SHA1(bdc9100827f2e018db943d9f7d81b7936c155bf0) )
ROM_REGION( 0x10000, "mcu", 0 )
@@ -432,51 +457,52 @@ ROM_START( paddlema )
ROM_LOAD16_BYTE( "padlem.13n", 0x60000, 0x10000, CRC(1d460486) SHA1(4ade817a036447e7e6d4fe56fa2c5712f198c625) )
ROM_REGION( 0x300, "proms", 0 )
- ROM_LOAD( "padlem.a", 0x0000, 0x0100, CRC(cae6bcd6) SHA1(da3b3bdcdc7fefae80b0ef8365565bbe5ff0d5d2) ) /* R */
- ROM_LOAD( "padlem.b", 0x0100, 0x0100, CRC(b6df8dcb) SHA1(318ca20fab6608aa2956ec3bb82e8ae77c250d51) ) /* G */
- ROM_LOAD( "padlem.c", 0x0200, 0x0100, CRC(39ca9b86) SHA1(8b8d7aae85830e69366e86f8b6cccfb8140cd526) ) /* B */
+ ROM_LOAD( "padlem.a", 0x0000, 0x0100, CRC(cae6bcd6) SHA1(da3b3bdcdc7fefae80b0ef8365565bbe5ff0d5d2) ) // R
+ ROM_LOAD( "padlem.b", 0x0100, 0x0100, CRC(b6df8dcb) SHA1(318ca20fab6608aa2956ec3bb82e8ae77c250d51) ) // G
+ ROM_LOAD( "padlem.c", 0x0200, 0x0100, CRC(39ca9b86) SHA1(8b8d7aae85830e69366e86f8b6cccfb8140cd526) ) // B
ROM_REGION( 0x800, "clut_proms", 0 )
- ROM_LOAD( "padlem.17j", 0x0000, 0x0400, CRC(86170069) SHA1(8e2ad7afa50453e9a2dc89386ce02d10e7c89fbc) ) /* Clut low nibble */
- ROM_LOAD( "padlem.16j", 0x0400, 0x0400, CRC(8da58e2c) SHA1(6012715a2d3ba4cf8bc5a8250e7f28cb59913092) ) /* Clut high nibble */
+ ROM_LOAD( "padlem.17j", 0x0000, 0x0400, CRC(86170069) SHA1(8e2ad7afa50453e9a2dc89386ce02d10e7c89fbc) ) // Clut low nibble
+ ROM_LOAD( "padlem.16j", 0x0400, 0x0400, CRC(8da58e2c) SHA1(6012715a2d3ba4cf8bc5a8250e7f28cb59913092) ) // Clut high nibble
ROM_REGION( 0x8000, "color_proms", 0 )
- ROM_LOAD( "padlem.18n", 0x0000, 0x8000, CRC(06506200) SHA1(d43337e5611cb0d3432942539ccf04bff2bdd345) ) /* Colour lookup */
+ ROM_LOAD( "padlem.18n", 0x0000, 0x8000, CRC(488df971) SHA1(fe1436ddc63ffb37fcc9e57aeb923c8c96fd6ac3) ) // Colour lookup
+ // The dump with the following hashes has a bad bit 3 at 0x7de6: CRC(06506200) SHA1(d43337e5611cb0d3432942539ccf04bff2bdd345)
ROM_END
-ROM_START( tnextspc ) /* mask ROM for gfx */
+ROM_START( tnextspc )
ROM_REGION( 0x40000, "maincpu", 0 )
- ROM_LOAD16_BYTE( "ns_4.bin", 0x00000, 0x20000, CRC(4617cba3) SHA1(615a1e67fc1c76d2be004b19a965f423b8daaf5c) )
- ROM_LOAD16_BYTE( "ns_3.bin", 0x00001, 0x20000, CRC(a6c47fef) SHA1(b7e4a0fffd5c44ed0b138c1ad04c3b6644ec463b) )
+ ROM_LOAD16_BYTE( "ns_4.4", 0x00000, 0x20000, CRC(4617cba3) SHA1(615a1e67fc1c76d2be004b19a965f423b8daaf5c) ) // Silkscreened "4" @ 14L
+ ROM_LOAD16_BYTE( "ns_3.3", 0x00001, 0x20000, CRC(a6c47fef) SHA1(b7e4a0fffd5c44ed0b138c1ad04c3b6644ec463b) ) // Silkscreened "3" @ 11L
- ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound CPU */
- ROM_LOAD( "ns_1.bin", 0x000000, 0x10000, CRC(fc26853c) SHA1(0118b048046a6125bba20dec081b936486eb1597) )
+ ROM_REGION( 0x10000, "audiocpu", 0 ) // Sound CPU
+ ROM_LOAD( "ns_1.1", 0x000000, 0x10000, CRC(fc26853c) SHA1(0118b048046a6125bba20dec081b936486eb1597) ) // Silkscreened "1" @ 18B
ROM_REGION( 0x080000, "gfx1", 0 )
- ROM_LOAD16_WORD_SWAP( "ns_5678.bin", 0x000000, 0x80000, CRC(22756451) SHA1(ce1d58a75ef4b09feb6fd9b3dd2de48b986070c0) )
+ ROM_LOAD16_WORD_SWAP( "ns_5678.bin", 0x000000, 0x80000, CRC(22756451) SHA1(ce1d58a75ef4b09feb6fd9b3dd2de48b986070c0) ) // single mask ROM for gfx
ROM_REGION( 0x300, "proms", 0 )
- ROM_LOAD( "2.p2", 0x0000, 0x0100, CRC(1f388d48) SHA1(5e7dc37b4e177483f4fc65b801dca8ef132ac282) ) /* R */
- ROM_LOAD( "3.p3", 0x0100, 0x0100, CRC(0254533a) SHA1(d0ec0d03ed78482cd9344661eab3305640e85682) ) /* G */
- ROM_LOAD( "1.p1", 0x0200, 0x0100, CRC(488fd0e9) SHA1(cde18e9ca0b320ded821bea537c88424b02e8910) ) /* B */
+ ROM_LOAD( "2.p2", 0x0000, 0x0100, CRC(1f388d48) SHA1(5e7dc37b4e177483f4fc65b801dca8ef132ac282) ) // R
+ ROM_LOAD( "3.p3", 0x0100, 0x0100, CRC(0254533a) SHA1(d0ec0d03ed78482cd9344661eab3305640e85682) ) // G
+ ROM_LOAD( "1.p1", 0x0200, 0x0100, CRC(488fd0e9) SHA1(cde18e9ca0b320ded821bea537c88424b02e8910) ) // B
ROM_REGION( 0x800, "clut_proms", 0 )
- ROM_LOAD( "5.p5", 0x0000, 0x0400, CRC(9c8527bf) SHA1(6b52ab37ea6c07a4814ed33deadd59d137b5fd4d) ) /* Clut high nibble */
- ROM_LOAD( "4.p4", 0x0400, 0x0400, CRC(cc9ff769) SHA1(e9de0371fd8bae7f08924891d78799ace97902b1) ) /* Clut low nibble */
+ ROM_LOAD( "5.p5", 0x0000, 0x0400, CRC(9c8527bf) SHA1(6b52ab37ea6c07a4814ed33deadd59d137b5fd4d) ) // Clut high nibble
+ ROM_LOAD( "4.p4", 0x0400, 0x0400, CRC(cc9ff769) SHA1(e9de0371fd8bae7f08924891d78799ace97902b1) ) // Clut low nibble
ROM_REGION( 0x8000, "color_proms", 0 )
- ROM_LOAD( "ns_2.bin", 0x0000, 0x8000, CRC(05771d48) SHA1(9e9376b1449679f554eabf8cea023714dd1ed487) ) /* Colour lookup */
+ ROM_LOAD( "ns_2.bin", 0x0000, 0x8000, CRC(05771d48) SHA1(9e9376b1449679f554eabf8cea023714dd1ed487) ) // Colour lookup
ROM_END
ROM_START( tnextspc2 ) // two bootleg PCBs have been found with the same ROMs as this set, the only difference being ns_2.bin being double sized with 1st and 2nd half identical
ROM_REGION( 0x40000, "maincpu", 0 )
- ROM_LOAD16_BYTE( "ns_4.bin", 0x00000, 0x20000, CRC(4617cba3) SHA1(615a1e67fc1c76d2be004b19a965f423b8daaf5c) ) /* b18.ic13 */
- ROM_LOAD16_BYTE( "ns_3.bin", 0x00001, 0x20000, CRC(a6c47fef) SHA1(b7e4a0fffd5c44ed0b138c1ad04c3b6644ec463b) ) /* b17.ic11 */
+ ROM_LOAD16_BYTE( "ns_4.4", 0x00000, 0x20000, CRC(4617cba3) SHA1(615a1e67fc1c76d2be004b19a965f423b8daaf5c) ) // == b18.ic13
+ ROM_LOAD16_BYTE( "ns_3.3", 0x00001, 0x20000, CRC(a6c47fef) SHA1(b7e4a0fffd5c44ed0b138c1ad04c3b6644ec463b) ) // == b17.ic11
- ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound CPU */
- ROM_LOAD( "ns_1.bin", 0x000000, 0x10000, CRC(fc26853c) SHA1(0118b048046a6125bba20dec081b936486eb1597) ) /* b1.ic129 */
+ ROM_REGION( 0x10000, "audiocpu", 0 ) // Sound CPU
+ ROM_LOAD( "ns_1.1", 0x000000, 0x10000, CRC(fc26853c) SHA1(0118b048046a6125bba20dec081b936486eb1597) ) // == b1.ic129
- ROM_REGION( 0x080000, "gfx1", 0 ) /* EPROMs, graphics are odd/even interleaved */
+ ROM_REGION( 0x080000, "gfx1", 0 ) // EPROMs, graphics are odd/even interleaved
ROM_LOAD16_BYTE( "b3.ic49", 0x00001, 0x10000, CRC(2bddf94d) SHA1(e064f48d0e3bb089753c1b59c863bb46bfa2bcee) )
ROM_LOAD16_BYTE( "b7.ic53", 0x00000, 0x10000, CRC(a8b13a9a) SHA1(2f808c17e97a272be14099c53b287e665dd90b14) )
ROM_LOAD16_BYTE( "b4.ic50", 0x20001, 0x10000, CRC(80c6c841) SHA1(ab0aa4cad6dcadae62f849e53c3c5cd909f77971) )
@@ -487,40 +513,40 @@ ROM_START( tnextspc2 ) // two bootleg PCBs have been found with the same ROMs as
ROM_LOAD16_BYTE( "b10.ic56", 0x60000, 0x10000, CRC(f48819df) SHA1(86d688590379316638ef4c3094c11629931cd69e) )
ROM_REGION( 0x300, "proms", 0 )
- ROM_LOAD( "2.p2", 0x0000, 0x0100, CRC(1f388d48) SHA1(5e7dc37b4e177483f4fc65b801dca8ef132ac282) ) /* R */
- ROM_LOAD( "3.p3", 0x0100, 0x0100, CRC(0254533a) SHA1(d0ec0d03ed78482cd9344661eab3305640e85682) ) /* G */
- ROM_LOAD( "1.p1", 0x0200, 0x0100, CRC(488fd0e9) SHA1(cde18e9ca0b320ded821bea537c88424b02e8910) ) /* B */
+ ROM_LOAD( "2.p2", 0x0000, 0x0100, CRC(1f388d48) SHA1(5e7dc37b4e177483f4fc65b801dca8ef132ac282) ) // R
+ ROM_LOAD( "3.p3", 0x0100, 0x0100, CRC(0254533a) SHA1(d0ec0d03ed78482cd9344661eab3305640e85682) ) // G
+ ROM_LOAD( "1.p1", 0x0200, 0x0100, CRC(488fd0e9) SHA1(cde18e9ca0b320ded821bea537c88424b02e8910) ) // B
ROM_REGION( 0x800, "clut_proms", 0 )
- ROM_LOAD( "5.p5", 0x0000, 0x0400, CRC(9c8527bf) SHA1(6b52ab37ea6c07a4814ed33deadd59d137b5fd4d) ) /* Clut high nibble */
- ROM_LOAD( "4.p4", 0x0400, 0x0400, CRC(cc9ff769) SHA1(e9de0371fd8bae7f08924891d78799ace97902b1) ) /* Clut low nibble */
+ ROM_LOAD( "5.p5", 0x0000, 0x0400, CRC(9c8527bf) SHA1(6b52ab37ea6c07a4814ed33deadd59d137b5fd4d) ) // Clut high nibble
+ ROM_LOAD( "4.p4", 0x0400, 0x0400, CRC(cc9ff769) SHA1(e9de0371fd8bae7f08924891d78799ace97902b1) ) // Clut low nibble
ROM_REGION( 0x8000, "color_proms", 0 )
- ROM_LOAD( "ns_2.bin", 0x0000, 0x8000, CRC(05771d48) SHA1(9e9376b1449679f554eabf8cea023714dd1ed487) ) /* b2.ic90 - Colour lookup */
+ ROM_LOAD( "ns_2.bin", 0x0000, 0x8000, CRC(05771d48) SHA1(9e9376b1449679f554eabf8cea023714dd1ed487) ) // b2.ic90 - Colour lookup
ROM_END
ROM_START( tnextspcj )
ROM_REGION( 0x40000, "maincpu", 0 )
- ROM_LOAD16_BYTE( "ns_ver1_j4.bin", 0x00000, 0x20000, CRC(5cdf710d) SHA1(c744e532f2f5a248d7b50a2e62cc77a0888d8dff) )
- ROM_LOAD16_BYTE( "ns_ver1_j3.bin", 0x00001, 0x20000, CRC(cd9532d0) SHA1(dbd7ced8f015334f0acb8d760f4d9d0299feef70) )
+ ROM_LOAD16_BYTE( "ns_ver1_j4.4", 0x00000, 0x20000, CRC(5cdf710d) SHA1(c744e532f2f5a248d7b50a2e62cc77a0888d8dff) ) // Silkscreened "4" @ 14L
+ ROM_LOAD16_BYTE( "ns_ver1_j3.3", 0x00001, 0x20000, CRC(cd9532d0) SHA1(dbd7ced8f015334f0acb8d760f4d9d0299feef70) ) // Silkscreened "3" @ 11L
- ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound CPU */
- ROM_LOAD( "ns_1.bin", 0x000000, 0x10000, CRC(fc26853c) SHA1(0118b048046a6125bba20dec081b936486eb1597) )
+ ROM_REGION( 0x10000, "audiocpu", 0 ) // Sound CPU
+ ROM_LOAD( "ns_1.1", 0x000000, 0x10000, CRC(fc26853c) SHA1(0118b048046a6125bba20dec081b936486eb1597) ) // Silkscreened "1" @ 18B
ROM_REGION( 0x080000, "gfx1", 0 )
- ROM_LOAD16_WORD_SWAP( "ns_5678.bin", 0x000000, 0x80000, CRC(22756451) SHA1(ce1d58a75ef4b09feb6fd9b3dd2de48b986070c0) )
+ ROM_LOAD16_WORD_SWAP( "ns_5678.bin", 0x000000, 0x80000, CRC(22756451) SHA1(ce1d58a75ef4b09feb6fd9b3dd2de48b986070c0) ) // single mask ROM for gfx
ROM_REGION( 0x300, "proms", 0 )
- ROM_LOAD( "2.p2", 0x0000, 0x0100, CRC(1f388d48) SHA1(5e7dc37b4e177483f4fc65b801dca8ef132ac282) ) /* R */
- ROM_LOAD( "3.p3", 0x0100, 0x0100, CRC(0254533a) SHA1(d0ec0d03ed78482cd9344661eab3305640e85682) ) /* G */
- ROM_LOAD( "1.p1", 0x0200, 0x0100, CRC(488fd0e9) SHA1(cde18e9ca0b320ded821bea537c88424b02e8910) ) /* B */
+ ROM_LOAD( "2.p2", 0x0000, 0x0100, CRC(1f388d48) SHA1(5e7dc37b4e177483f4fc65b801dca8ef132ac282) ) // R
+ ROM_LOAD( "3.p3", 0x0100, 0x0100, CRC(0254533a) SHA1(d0ec0d03ed78482cd9344661eab3305640e85682) ) // G
+ ROM_LOAD( "1.p1", 0x0200, 0x0100, CRC(488fd0e9) SHA1(cde18e9ca0b320ded821bea537c88424b02e8910) ) // B
ROM_REGION( 0x800, "clut_proms", 0 )
- ROM_LOAD( "5.p5", 0x0000, 0x0400, CRC(9c8527bf) SHA1(6b52ab37ea6c07a4814ed33deadd59d137b5fd4d) ) /* Clut high nibble */
- ROM_LOAD( "4.p4", 0x0400, 0x0400, CRC(cc9ff769) SHA1(e9de0371fd8bae7f08924891d78799ace97902b1) ) /* Clut low nibble */
+ ROM_LOAD( "5.p5", 0x0000, 0x0400, CRC(9c8527bf) SHA1(6b52ab37ea6c07a4814ed33deadd59d137b5fd4d) ) // Clut high nibble
+ ROM_LOAD( "4.p4", 0x0400, 0x0400, CRC(cc9ff769) SHA1(e9de0371fd8bae7f08924891d78799ace97902b1) ) // Clut low nibble
ROM_REGION( 0x8000, "color_proms", 0 )
- ROM_LOAD( "ns_2.bin", 0x0000, 0x8000, CRC(05771d48) SHA1(9e9376b1449679f554eabf8cea023714dd1ed487) ) /* Colour lookup */
+ ROM_LOAD( "ns_2.bin", 0x0000, 0x8000, CRC(05771d48) SHA1(9e9376b1449679f554eabf8cea023714dd1ed487) ) // Colour lookup
ROM_END
void paddlemania_state::init_paddlema()
@@ -537,9 +563,9 @@ void thenextspace_state::init_tnextspc()
m_game_id = 0;
}
-GAME( 1988, paddlema, 0, paddlema, paddlema, paddlemania_state, init_paddlema, ROT90, "SNK", "Paddle Mania", MACHINE_SUPPORTS_SAVE )
+GAME( 1988, paddlema, 0, paddlema, paddlema, paddlemania_state, init_paddlema, ROT90, "SNK", "Paddle Mania", MACHINE_SUPPORTS_SAVE )
-GAME( 1989, tnextspc, 0, tnextspc, tnextspc, thenextspace_state, init_tnextspc, ROT90, "SNK", "The Next Space (set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL )
-GAME( 1989, tnextspc2, tnextspc, tnextspc, tnextspc, thenextspace_state, init_tnextspc, ROT90, "SNK", "The Next Space (set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL )
-GAME( 1989, tnextspcj, tnextspc, tnextspc, tnextspc, thenextspace_state, init_tnextspc, ROT90, "SNK (Pasadena International Corp. license)", "The Next Space (Japan)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL )
+GAME( 1989, tnextspc, 0, tnextspc, tnextspc, thenextspace_state, init_tnextspc, ROT90, "SNK", "The Next Space (set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL )
+GAME( 1989, tnextspc2, tnextspc, tnextspc, tnextspc, thenextspace_state, init_tnextspc, ROT90, "SNK", "The Next Space (set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL )
+GAME( 1989, tnextspcj, tnextspc, tnextspc, tnextspc, thenextspace_state, init_tnextspc, ROT90, "SNK (Pasadena International Corp. license)", "The Next Space (Japan)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL )
diff --git a/src/mame/drivers/bogeyman.cpp b/src/mame/drivers/bogeyman.cpp
index 5c806149779..85f4cb17038 100644
--- a/src/mame/drivers/bogeyman.cpp
+++ b/src/mame/drivers/bogeyman.cpp
@@ -33,7 +33,7 @@ void bogeyman_state::ay8910_latch_w(uint8_t data)
void bogeyman_state::ay8910_control_w(uint8_t data)
{
// bit 0 is flipscreen
- flip_screen_set(data & 0x01);
+ flip_screen_set(~data & 0x01);
// bit 5 goes to 8910 #0 BDIR pin
if ((m_last_write & 0x20) == 0x20 && (data & 0x20) == 0x00)
@@ -295,4 +295,5 @@ ROM_END
/* Game Driver */
-GAME( 1985, bogeyman, 0, bogeyman, bogeyman, bogeyman_state, empty_init, ROT0, "Technos Japan", "Bogey Manor", MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE )
+// ROT180 confirmed by Kold
+GAME( 1985, bogeyman, 0, bogeyman, bogeyman, bogeyman_state, empty_init, ROT180, "Technos Japan", "Bogey Manor", MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/coco12.cpp b/src/mame/drivers/coco12.cpp
index 5233d3e6948..69daabe838a 100644
--- a/src/mame/drivers/coco12.cpp
+++ b/src/mame/drivers/coco12.cpp
@@ -446,7 +446,7 @@ void coco_state::coco_floating(machine_config &config)
// DEVICE_INPUT_DEFAULTS_START( printer )
//-------------------------------------------------
-static DEVICE_INPUT_DEFAULTS_START( printer )
+static DEVICE_INPUT_DEFAULTS_START( rs_printer )
DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_600 )
DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 )
DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_8 )
@@ -509,9 +509,9 @@ void coco12_state::coco(machine_config &config)
m_cassette->set_formats(coco_cassette_formats);
m_cassette->set_default_state(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED);
- rs232_port_device &rs232(RS232_PORT(config, RS232_TAG, default_rs232_devices, "printer"));
+ rs232_port_device &rs232(RS232_PORT(config, RS232_TAG, default_rs232_devices, "rs_printer"));
rs232.dcd_handler().set(PIA1_TAG, FUNC(pia6821_device::ca1_w));
- rs232.set_option_device_input_defaults("printer", DEVICE_INPUT_DEFAULTS_NAME(printer));
+ rs232.set_option_device_input_defaults("rs_printer", DEVICE_INPUT_DEFAULTS_NAME(rs_printer));
cococart_slot_device &cartslot(COCOCART_SLOT(config, CARTRIDGE_TAG, DERIVED_CLOCK(1, 1), coco_cart, "pak"));
cartslot.cart_callback().set([this] (int state) { cart_w(state != 0); }); // lambda because name is overloaded
diff --git a/src/mame/drivers/coco3.cpp b/src/mame/drivers/coco3.cpp
index 44e0facd3dc..c00d40c0968 100644
--- a/src/mame/drivers/coco3.cpp
+++ b/src/mame/drivers/coco3.cpp
@@ -239,7 +239,7 @@ static INPUT_PORTS_START( coco3dw )
PORT_INCLUDE( coco_beckerport_dw )
INPUT_PORTS_END
-static DEVICE_INPUT_DEFAULTS_START( printer )
+static DEVICE_INPUT_DEFAULTS_START( rs_printer )
DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_600 )
DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 )
DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_8 )
@@ -293,9 +293,9 @@ void coco3_state::coco3(machine_config &config)
m_cassette->set_formats(coco_cassette_formats);
m_cassette->set_default_state(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED);
- rs232_port_device &rs232(RS232_PORT(config, RS232_TAG, default_rs232_devices, "printer"));
+ rs232_port_device &rs232(RS232_PORT(config, RS232_TAG, default_rs232_devices, "rs_printer"));
rs232.dcd_handler().set(PIA1_TAG, FUNC(pia6821_device::ca1_w));
- rs232.set_option_device_input_defaults("printer", DEVICE_INPUT_DEFAULTS_NAME(printer));
+ rs232.set_option_device_input_defaults("rs_printer", DEVICE_INPUT_DEFAULTS_NAME(rs_printer));
cococart_slot_device &cartslot(COCOCART_SLOT(config, CARTRIDGE_TAG, DERIVED_CLOCK(1, 1), coco_cart, "fdcv11"));
cartslot.cart_callback().set([this] (int state) { cart_w(state != 0); }); // lambda because name is overloaded
diff --git a/src/mame/drivers/geniusjr.cpp b/src/mame/drivers/geniusjr.cpp
index c1becbb7c40..0553c9d1393 100644
--- a/src/mame/drivers/geniusjr.cpp
+++ b/src/mame/drivers/geniusjr.cpp
@@ -390,7 +390,7 @@ ROM_END
ROM_START( gls )
ROM_REGION( 0x2000, "maincpu", 0 )
- ROM_LOAD( "hc05_internal.bin", 0x0000, 0x2000, NO_DUMP )
+ ROM_LOAD( "hc05_internal.bin", 0x0000, 0x2000, NO_DUMP ) // As per decap, confirmed to be a Motorola 68HC05 CSIC (Customer Specification Integrated Circuit)
ROM_REGION( 0x40000, "extrom", 0 )
ROM_LOAD( "27-5635-00.u2", 0x000000, 0x40000, CRC(bc3c0587) SHA1(fe98f162bd80d96ce3264087b5869f4505955464))
diff --git a/src/mame/drivers/gokidetor.cpp b/src/mame/drivers/gokidetor.cpp
index 21e5a646bf5..181f5936656 100644
--- a/src/mame/drivers/gokidetor.cpp
+++ b/src/mame/drivers/gokidetor.cpp
@@ -17,6 +17,8 @@
#include "sound/okim6295.h"
#include "audio/taitosnd.h"
+namespace {
+
class gokidetor_state : public driver_device
{
public:
@@ -262,12 +264,12 @@ ROM_START( gokidetor )
ROM_LOAD( "ic87", 0, 0x40000, CRC(adb9fd16) SHA1(59aae5ac26cae30b961b30e17fd494094aa7aa15) )
ROM_REGION( 0x8000, "pals", 0 ) // unprotected
- ROM_LOAD( "d33-01.pal16l8a.ic20.jed", 0x0000, 0xb01, CRC(7d614a54) SHA1(e79b6ac99f46ff69ea0565e89d6807667c9e0547) )
- ROM_LOAD( "d33-02.pal16l8b.ic62.jed", 0x1000, 0xb01, CRC(6653423f) SHA1(ac93acccf649b97a3252aedf398310be90fe5d2d) )
- ROM_LOAD( "d33-03.pal16l8a.ic70.jed", 0x2000, 0xb01, CRC(abfd9a01) SHA1(c76cc16842231c2f688ddd46a17f3a6df92a9580) )
- ROM_LOAD( "d33-04.pal16l8b.ic81.jed", 0x3000, 0xb01, CRC(bf17aa05) SHA1(0cbbb2ee49c31e94ed7ea3a25f85e3d33c6b68fb) )
- ROM_LOAD( "d33-05.pal16l8b.ic93.jed", 0x4000, 0xb01, CRC(2df9105e) SHA1(d28fc48588727e4bd3ec2377b383160329c261c3) )
- ROM_LOAD( "d33-06.pal20l8b.ic44.jed", 0x5000, 0xd01, CRC(a1400501) SHA1(0b86d09d3e12668eaaf2c4b5a2d2b676d2e599f7) )
+ ROM_LOAD( "d33-01.pal16l8a.ic20", 0x0000, 0x104, CRC(6d6a8601) SHA1(b3e343358f8f9334b0befefef80f2a0b53ae0cc7) )
+ ROM_LOAD( "d33-02.pal16l8b.ic62", 0x1000, 0x104, CRC(1e2d2e73) SHA1(3cbb95f26daed685ac8ad3d324e2c10ff444378a) )
+ ROM_LOAD( "d33-03.pal16l8a.ic70", 0x2000, 0x104, CRC(f18b8ad0) SHA1(eabaccd50e72520c5fd91fb27cbd88962e8e82c2) )
+ ROM_LOAD( "d33-04.pal16l8b.ic81", 0x3000, 0x104, CRC(b5690dd6) SHA1(0118d272b2c66e3faade1f4f7328167697fd0649) )
+ ROM_LOAD( "d33-05.pal16l8b.ic93", 0x4000, 0x104, CRC(81b5ce19) SHA1(7602c8aa22ea3b3a64633ce9b55a45cfd20167cb) )
+ ROM_LOAD( "d33-06.pal20l8b.ic44", 0x5000, 0x144, CRC(bf4eeb17) SHA1(d78f65eacf1c7893f87b9fe8be0e5e1b28af7c7a) )
ROM_END
ROM_START( gokidetor2 )
@@ -281,14 +283,16 @@ ROM_START( gokidetor2 )
ROM_REGION( 0x40000, "oki", 0 )
ROM_LOAD( "ic87.rom", 0, 0x40000, CRC(adb9fd16) SHA1(59aae5ac26cae30b961b30e17fd494094aa7aa15) )
- ROM_REGION( 0x8000, "pals", 0 ) // unprotected
- ROM_LOAD( "d33-01.pal16l8a.ic20.jed", 0x0000, 0xb01, CRC(7d614a54) SHA1(e79b6ac99f46ff69ea0565e89d6807667c9e0547) ) // PALs missing for this board, using the one from the parent.
- ROM_LOAD( "d33-02.pal16l8b.ic62.jed", 0x1000, 0xb01, CRC(6653423f) SHA1(ac93acccf649b97a3252aedf398310be90fe5d2d) )
- ROM_LOAD( "d33-03.pal16l8a.ic70.jed", 0x2000, 0xb01, CRC(abfd9a01) SHA1(c76cc16842231c2f688ddd46a17f3a6df92a9580) )
- ROM_LOAD( "d33-04.pal16l8b.ic81.jed", 0x3000, 0xb01, CRC(bf17aa05) SHA1(0cbbb2ee49c31e94ed7ea3a25f85e3d33c6b68fb) )
- ROM_LOAD( "d33-05.pal16l8b.ic93.jed", 0x4000, 0xb01, CRC(2df9105e) SHA1(d28fc48588727e4bd3ec2377b383160329c261c3) )
- ROM_LOAD( "d33-06.pal20l8b.ic44.jed", 0x5000, 0xd01, CRC(a1400501) SHA1(0b86d09d3e12668eaaf2c4b5a2d2b676d2e599f7) )
+ ROM_REGION( 0x8000, "pals", 0 ) // PALs missing for this board, using the ones from the parent.
+ ROM_LOAD( "d33-01.pal16l8a.ic20", 0x0000, 0x104, CRC(6d6a8601) SHA1(b3e343358f8f9334b0befefef80f2a0b53ae0cc7) )
+ ROM_LOAD( "d33-02.pal16l8b.ic62", 0x1000, 0x104, CRC(1e2d2e73) SHA1(3cbb95f26daed685ac8ad3d324e2c10ff444378a) )
+ ROM_LOAD( "d33-03.pal16l8a.ic70", 0x2000, 0x104, CRC(f18b8ad0) SHA1(eabaccd50e72520c5fd91fb27cbd88962e8e82c2) )
+ ROM_LOAD( "d33-04.pal16l8b.ic81", 0x3000, 0x104, CRC(b5690dd6) SHA1(0118d272b2c66e3faade1f4f7328167697fd0649) )
+ ROM_LOAD( "d33-05.pal16l8b.ic93", 0x4000, 0x104, CRC(81b5ce19) SHA1(7602c8aa22ea3b3a64633ce9b55a45cfd20167cb) )
+ ROM_LOAD( "d33-06.pal20l8b.ic44", 0x5000, 0x144, CRC(bf4eeb17) SHA1(d78f65eacf1c7893f87b9fe8be0e5e1b28af7c7a) )
ROM_END
+} // Anonymous namespace
+
GAME( 1992, gokidetor, 0, gokidetor, gokidetor, gokidetor_state, empty_init, ROT0, "Taito", "Gokidetor (set 1)", MACHINE_IS_SKELETON_MECHANICAL )
GAME( 1992, gokidetor2, gokidetor, gokidetor, gokidetor, gokidetor_state, empty_init, ROT0, "Taito", "Gokidetor (set 2)", MACHINE_IS_SKELETON_MECHANICAL )
diff --git a/src/mame/drivers/jungleyo.cpp b/src/mame/drivers/jungleyo.cpp
index 5fbc5cd4600..eb87dc8cd84 100644
--- a/src/mame/drivers/jungleyo.cpp
+++ b/src/mame/drivers/jungleyo.cpp
@@ -54,6 +54,14 @@ TODO:
#include "speaker.h"
#include "tilemap.h"
+// configurable logging
+#define LOG_OUTPUTS (1U << 1)
+
+// #define VERBOSE (2)
+
+#include "logmacro.h"
+
+#define LOGOUTPUTS(...) LOGMASKED(LOG_OUTPUTS, __VA_ARGS__)
namespace {
@@ -76,6 +84,8 @@ protected:
virtual void video_start() override;
private:
+ void output_w(uint16_t data);
+
// video-related
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TILE_GET_INFO_MEMBER(get_bg_tile_info);
@@ -95,6 +105,32 @@ private:
};
+void jungleyo_state::output_w(uint16_t data)
+{
+ // bit 15 ?
+ // bit 14 coin counter?
+ // bit 13 ?
+ // bit 12 ?
+ // bit 11 ?
+ // bit 10 ?
+ // bit 09 ?
+ // bit 08 ?
+ // bit 07 ?
+ // bit 06 ?
+ // bit 05 ?
+ // bit 04 ?
+ // bit 03 ?
+ // bit 02 ?
+ // bit 01 start lamp?
+ // bit 00 bet lamp?
+
+ machine().bookkeeping().coin_counter_w(0, BIT(data, 14));
+
+ if (data & 0xbfff)
+ LOGOUTPUTS("%s output_w: %04x\n", machine().describe_context(), data);
+}
+
+
TILE_GET_INFO_MEMBER(jungleyo_state::get_bg_tile_info)
{
uint16_t code = m_bg_videoram[tile_index];
@@ -141,7 +177,16 @@ void jungleyo_state::main_map(address_map &map)
map(0xa00310, 0xa00311).portr("IN0");
map(0xa0032a, 0xa0032b).portr("DSW12");
map(0xa0032c, 0xa0032d).portr("DSW34");
- map(0xa00689, 0xa00689).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write));
+ map(0xa00336, 0xa00337).w(FUNC(jungleyo_state::output_w)); // outputs? observed values: lots
+ map(0xa00689, 0xa00689).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // TODO: something's definitely wrong here, lots of errors in the log
+ //map(0xa0068a, 0xa0068b).nopw(); // observed values: 0x0101
+ //map(0xa0082e, 0xa0082f).nopw(); // observed values: 0x0000, 0x4000, 0x5900 (double up),
+ //map(0xa00830, 0xa00831).nopw(); // observed values: 0x0000 and 0x0007
+ //map(0xa00832, 0xa00833).nopw(); // tilemap priority ? observed values: 0x0000 and 0x0001
+ //map(0xa00aaa, 0xa00aab).nopw(); // observed values: 0x0000, this is written continuously
+ //map(0xa00d58, 0xa00d59).nopw(); // observed values: 0x0004
+ //map(0xa00e9a, 0xa00e9b).nopw(); // observed values: 0x0005
+ //map(0xa00fc6, 0xa00fc7).nopw(); // observed values: 0x0006
map(0xb00000, 0xb0ffff).ram();
map(0xb10000, 0xb1ffff).ram();
map(0xb20000, 0xb2ffff).ram();
diff --git a/src/mame/drivers/laserbas.cpp b/src/mame/drivers/laserbas.cpp
index cca695f5a07..657f9900795 100644
--- a/src/mame/drivers/laserbas.cpp
+++ b/src/mame/drivers/laserbas.cpp
@@ -6,7 +6,7 @@
============================================
TODO:
-- Video: weird palette changes, Laserbase colors, missing bg scrolling between stages (CRT address lines + m_hset ( or m_vset ?))
+- Video: weird palette changes, Laserbase colors, gfx rendering in general needs verification
- Sound: sound related i/o writes ( out_w handler )
- Interrupts - NMI/Int timing is wrong, it's based on measures of broken PCB
TS 20.01.2017
@@ -106,7 +106,8 @@ private:
uint8_t vram_r(offs_t offset);
void vram_w(offs_t offset, uint8_t data);
- void videoctrl_w(offs_t offset, uint8_t data);
+ void videoctrl1_w(offs_t offset, uint8_t data);
+ void videoctrl2_w(offs_t offset, uint8_t data);
uint8_t z1_r(offs_t offset);
uint8_t track_lo_r();
uint8_t track_hi_r();
@@ -136,41 +137,32 @@ TIMER_DEVICE_CALLBACK_MEMBER( laserbas_state::laserbas_scanline )
MC6845_UPDATE_ROW( laserbas_state::crtc_update_row )
{
- int x = 0;
- int x_max = 0x100;
- int dx = 1;
-
- if (m_flipscreen)
- {
- y = 0xdf - y;
- x = 0xff;
- x_max = -1;
- dx = -1;
- }
-
- int pixaddr = y << 8;
rgb_t const *const palette = m_palette->palette()->entry_list_raw();
- uint32_t *const b = &bitmap.pix(y);
- while (x != x_max)
+ offs_t addr = ((ma & 0x3ff) << 5) | (ra << 7);
+ addr += (m_vset << 7);
+
+ for (int x = 0; x < x_count; x++)
{
- int offset = (pixaddr >> 1) & 0x7fff;
- int shift = (pixaddr & 1) * 4; // two 4 bit pixels in one byte
- int p1 = (m_vram[offset] >> shift) & 0xf;
- int p2 = (m_vram[offset + 0x8000] >> shift) & 0xf; // 0x10000 VRAM, two 4 bit layers 0x8000 bytes each
- int p;
-
- if (p2)
- p = p2;
- else if (p1)
- p = p1 + 16;
- else
- p = m_bset;
-
- b[x] = palette[p];
-
- pixaddr++;
- x += dx;
+ // draw 8 pixels
+ for (int i = 0; i < 8; i++)
+ {
+ // layer 1 (scrolling)
+ offs_t offset_p1 = (addr + (x << 2) + (i >> 1)) & 0x7fff;
+ uint8_t p1 = (m_vram[0x0000 + offset_p1] >> ((i & 1) * 4)) & 0x0f;
+
+ // layer 2 (fixed)
+ offs_t offset_p2= ((y * 0x80) | (ra << 7)) + (x << 2) + (i >> 1);
+ uint8_t p2 = (m_vram[0x8000 + offset_p2] >> ((i & 1) * 4)) & 0x0f;
+
+ // priority: p2 > p1 > background
+ uint8_t p = p2 ? p2 : p1 ? (p1 + 16) : m_bset;
+
+ if (m_flipscreen)
+ bitmap.pix(0xdf - y, 0xff - (x * 8 + i)) = palette[p];
+ else
+ bitmap.pix(y, x * 8 + i) = palette[p];
+ }
}
}
@@ -184,22 +176,33 @@ void laserbas_state::vram_w(offs_t offset, uint8_t data)
m_vram[offset+(m_vrambank?0x8000:0)] = data;
}
-void laserbas_state::videoctrl_w(offs_t offset, uint8_t data)
+void laserbas_state::videoctrl1_w(offs_t offset, uint8_t data)
{
- if (!(offset&1))
- {
- m_vrambank = data & 0x40; // layer select
- m_flipscreen = !(data & 0x80);
- m_vset = (data>>3)&7; // inc-ed on interrupts ( 8 ints / frame ?)
- m_hset = data&7;
- }
- else
- {
- data^=0xff;
- m_bset = data>>4; // bg pen
- m_scl = (data&8)>>3; // unknown
- m_nmi=data&1; // nmi enable (not on schematics, traced)
- }
+ data ^= 0xff;
+
+ // 7------- flip screen
+ // -6------ layer select
+ // --543--- vset (vertical scroll, inc'ed on interrupts - 8 ints/frame?)
+ // -----210 hset (presumely horizontal scroll)
+
+ m_flipscreen = bool(BIT(data, 7));
+ m_vrambank = BIT(data, 6) ? 0 : 1;
+ m_vset = (data >> 3) & 0x07;
+ m_hset = (data >> 0) & 0x07;
+}
+
+void laserbas_state::videoctrl2_w(offs_t offset, uint8_t data)
+{
+ data ^= 0xff;
+
+ // 7654---- background pen
+ // ----3--- scl (unknown)
+ // -----21- not used?
+ // -------0 nmi enable (not on schematics, traced)
+
+ m_bset = (data >> 4) & 0x0f;
+ m_scl = BIT(data, 3);
+ m_nmi = BIT(data, 0);
}
uint8_t laserbas_state::z1_r(offs_t offset)
@@ -301,7 +304,8 @@ void laserbas_state::laserbas_io(address_map &map)
map.global_mask(0xff);
map(0x00, 0x00).w("crtc", FUNC(mc6845_device::address_w));
map(0x01, 0x01).w("crtc", FUNC(mc6845_device::register_w));
- map(0x10, 0x11).w(FUNC(laserbas_state::videoctrl_w));
+ map(0x10, 0x10).w(FUNC(laserbas_state::videoctrl1_w));
+ map(0x11, 0x11).w(FUNC(laserbas_state::videoctrl2_w));
map(0x20, 0x20).portr("DSW");
map(0x21, 0x21).portr("INPUTS");
map(0x22, 0x22).r(FUNC(laserbas_state::track_hi_r));
@@ -392,7 +396,7 @@ void laserbas_state::laserbas(machine_config &config)
pit1.out_handler<2>().set(FUNC(laserbas_state::pit_out_w<5>));
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
- screen.set_raw(4000000, 256, 0, 256, 256, 0, 256); /* temporary, CRTC will configure screen */
+ screen.set_raw(6000000, 360, 0, 256, 274, 0, 224);
screen.set_screen_update("crtc", FUNC(mc6845_device::screen_update));
mc6845_device &crtc(MC6845(config, "crtc", 3000000/4)); /* unknown clock, hand tuned to get ~60 fps */
diff --git a/src/mame/drivers/mac.cpp b/src/mame/drivers/mac.cpp
index 15d81790f85..10ce9a72548 100644
--- a/src/mame/drivers/mac.cpp
+++ b/src/mame/drivers/mac.cpp
@@ -674,7 +674,7 @@ void mac_state::pwrmac_map(address_map &map)
/***************************************************************************
DEVICE CONFIG
***************************************************************************/
-
+#if !NEW_SWIM
static const applefdc_interface mac_iwm_interface =
{
sony_set_lines,
@@ -684,7 +684,7 @@ static const applefdc_interface mac_iwm_interface =
sony_write_data,
sony_read_status
};
-
+#endif
static void mac_nubus_cards(device_slot_interface &device)
{
device.option_add("m2video", NUBUS_M2VIDEO); /* Apple Macintosh II Video Card */
@@ -722,14 +722,14 @@ static void mac_lcpds_cards(device_slot_interface &device)
/***************************************************************************
MACHINE DRIVERS
***************************************************************************/
-
+#if !NEW_SWIM
static const floppy_interface mac_floppy_interface =
{
FLOPPY_STANDARD_3_5_DSHD,
LEGACY_FLOPPY_OPTIONS_NAME(apple35_mac),
"floppy_3_5"
};
-
+#endif
void mac_state::add_base_devices(machine_config &config, bool rtc, int woz_version)
{
if (rtc)
@@ -738,10 +738,10 @@ void mac_state::add_base_devices(machine_config &config, bool rtc, int woz_versi
#if NEW_SWIM
switch (woz_version) {
case 0:
- IWM(config, m_fdc, C7M, 1021800*2, true);
+ IWM(config, m_fdc, C7M, 1021800*4, true);
break;
case 1:
- SWIM1(config, m_fdc, C15M, 1021800*2);
+ SWIM1(config, m_fdc, C15M);
break;
case 2:
SWIM2(config, m_fdc, C15M);
diff --git a/src/mame/drivers/oric.cpp b/src/mame/drivers/oric.cpp
index 1910c73b5f2..975a1723262 100644
--- a/src/mame/drivers/oric.cpp
+++ b/src/mame/drivers/oric.cpp
@@ -904,7 +904,10 @@ void telestrat_state::telstrat(machine_config &config)
ROM_START(oric1)
ROM_REGION(0x4000, "maincpu", 0)
- ROM_LOAD ("basic10.rom", 0, 0x04000, CRC(f18710b4) SHA1(333116e6884d85aaa4dfc7578a91cceeea66d016))
+ ROM_SYSTEM_BIOS( 0, "ver10", "Basic 1.0")
+ ROMX_LOAD ("basic10.rom", 0, 0x04000, CRC(f18710b4) SHA1(333116e6884d85aaa4dfc7578a91cceeea66d016), ROM_BIOS(0))
+ ROM_SYSTEM_BIOS( 1, "ver10uk", "Basic 1.0 UK")
+ ROMX_LOAD( "basic10uk.rom", 0, 0x04000, CRC(d6006a01) SHA1(84759cc8faae53070f1c8ce8408982a0edcb0796), ROM_BIOS(1))
ROM_END
ROM_START(orica)
diff --git a/src/mame/drivers/saitek_corona.cpp b/src/mame/drivers/saitek_corona.cpp
index d62e10a0b78..710a8119c1e 100644
--- a/src/mame/drivers/saitek_corona.cpp
+++ b/src/mame/drivers/saitek_corona.cpp
@@ -294,7 +294,7 @@ void corona_state::corona(machine_config &config)
/* extension rom */
GENERIC_CARTSLOT(config, "extrom", generic_plain_slot, "saitek_egr");
- SOFTWARE_LIST(config, "cart_list").set_original("saitek_egr");
+ SOFTWARE_LIST(config, "cart_list").set_original("saitek_egr").set_filter("egr2");
}
diff --git a/src/mame/drivers/saitek_simultano.cpp b/src/mame/drivers/saitek_simultano.cpp
index 372e86c281d..788247eb0af 100644
--- a/src/mame/drivers/saitek_simultano.cpp
+++ b/src/mame/drivers/saitek_simultano.cpp
@@ -10,7 +10,7 @@ Two versions are known: "B" from 1988/1989, and "C" from 1989.
Hardware notes:
- WDC W65C02P @ 5MHz
-- 64KB ROM (2*AMI 27256), socket for 32KB Endgame ROM
+- 64KB ROM (2*AMI 27256), socket for 32KB Endgame ROM (ver. 2)
- 8KB RAM (SRM2264LC) battery-backed
- "HELIOS" NEC gate array
- Epson SED1502F, LCD screen
@@ -21,6 +21,7 @@ with hardware differences: 3MHz R65C02, 1 64KB ROM and no EGR socket.
TODO:
- where does the IRQ come from? same problem as with stratos
+- verify that egr(1) does not work on real chesscomputer
***************************************************************************/
@@ -336,7 +337,7 @@ void simultano_state::simultano(machine_config &config)
/* extension rom */
GENERIC_CARTSLOT(config, "extrom", generic_plain_slot, "saitek_egr");
- SOFTWARE_LIST(config, "cart_list").set_original("saitek_egr");
+ SOFTWARE_LIST(config, "cart_list").set_original("saitek_egr").set_filter("egr2");
}
diff --git a/src/mame/drivers/shootout.cpp b/src/mame/drivers/shootout.cpp
index ad18084ea0a..5427177b5e2 100644
--- a/src/mame/drivers/shootout.cpp
+++ b/src/mame/drivers/shootout.cpp
@@ -75,7 +75,7 @@ void shootout_state::sound_cpu_command_w(uint8_t data)
void shootout_state::flipscreen_w(uint8_t data)
{
- flip_screen_set(data & 0x01);
+ flip_screen_set(~data & 0x01);
}
/*
@@ -432,7 +432,7 @@ void shootout_state::init_shootout()
membank("bank1")->configure_entries(0, 16, memregion("maincpu")->base() + 0x8000, 0x4000);
}
-
-GAME( 1985, shootout, 0, shootout, shootout, shootout_state, init_shootout, ROT0, "Data East USA", "Shoot Out (US)", MACHINE_SUPPORTS_SAVE )
-GAME( 1985, shootoutj, shootout, shootouj, shootouj, shootout_state, init_shootout, ROT0, "Data East Corporation", "Shoot Out (Japan)", MACHINE_SUPPORTS_SAVE )
-GAME( 1985, shootoutb, shootout, shootouk, shootout, shootout_state, init_shootout, ROT0, "bootleg", "Shoot Out (Korean Bootleg)", MACHINE_SUPPORTS_SAVE )
+// ROT180 confirmed by Kold
+GAME( 1985, shootout, 0, shootout, shootout, shootout_state, init_shootout, ROT180, "Data East USA", "Shoot Out (US)", MACHINE_SUPPORTS_SAVE )
+GAME( 1985, shootoutj, shootout, shootouj, shootouj, shootout_state, init_shootout, ROT180, "Data East Corporation", "Shoot Out (Japan)", MACHINE_SUPPORTS_SAVE )
+GAME( 1985, shootoutb, shootout, shootouk, shootout, shootout_state, init_shootout, ROT180, "bootleg", "Shoot Out (Korean Bootleg)", MACHINE_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/skylncr.cpp b/src/mame/drivers/skylncr.cpp
index 16f3cf68b73..150df0cefd6 100644
--- a/src/mame/drivers/skylncr.cpp
+++ b/src/mame/drivers/skylncr.cpp
@@ -1501,7 +1501,147 @@ static INPUT_PORTS_START( sonikfig )
PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) // OK
INPUT_PORTS_END
+static INPUT_PORTS_START( score5 ) // TODO: verify inputs when game works (copied from sonikfig for now), dips are taken from manual so presumed correct
+ PORT_START("IN1") // $00 (PPI0 port A)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SLOT_STOP2)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_D) PORT_NAME("IN1-02")
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SLOT_STOP1)
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_F) PORT_NAME("IN1-08")
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SLOT_STOP3)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_G) PORT_NAME("IN1-20")
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_H) PORT_NAME("IN1-40")
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_J) PORT_NAME("IN1-80")
+
+ PORT_START("IN2") // $01 (PPI0 port B)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_BET)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_K) PORT_NAME("IN2-02")
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_LOW) PORT_NAME("Down/Low") PORT_CODE(KEYCODE_S)
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_L) PORT_NAME("IN2-08")
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1) PORT_NAME("Start") // OK
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_T) PORT_NAME("Reset #2") // Behaves like a reset, only when attract DSW is off...
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Y) PORT_NAME("IN2-40")
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_U) PORT_NAME("IN2-80")
+
+ PORT_START("IN3") // $11 (PPI1 port B)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) // OK
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2) // OK
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_IMPULSE(2) // OK
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) // OK
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH) PORT_NAME("Up/High") PORT_CODE(KEYCODE_A)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_D_UP )
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_I) PORT_NAME("IN3-40")
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_TAKE ) PORT_NAME("Take Score")
+
+ PORT_START("IN4") // $12 (PPI1 port C)
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("IN4-01")
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_R) PORT_NAME("Reset #1") // OK
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_NAME("Stats")
+ PORT_SERVICE_NO_TOGGLE( 0x08, IP_ACTIVE_LOW ) // Settings OK
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("IN4-10")
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("IN4-20")
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("IN4-40")
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT )
+
+ PORT_START("DSW1") // $02 (PPI0 port C)
+ PORT_DIPNAME( 0x07, 0x07, "Percent" ) PORT_DIPLOCATION("DSW1:1,2,3")
+ PORT_DIPSETTING( 0x07, "55%" )
+ PORT_DIPSETTING( 0x06, "60%" )
+ PORT_DIPSETTING( 0x05, "65%" )
+ PORT_DIPSETTING( 0x04, "70%" )
+ PORT_DIPSETTING( 0x03, "75%" )
+ PORT_DIPSETTING( 0x02, "80%" )
+ PORT_DIPSETTING( 0x01, "85%" )
+ PORT_DIPSETTING( 0x00, "90%" )
+ PORT_DIPNAME( 0x08, 0x08, "Break" ) PORT_DIPLOCATION("DSW1:4")
+ PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPNAME( 0x10, 0x10, "Speed" ) PORT_DIPLOCATION("DSW1:5")
+ PORT_DIPSETTING( 0x10, "Slow" )
+ PORT_DIPSETTING( 0x00, "Fast" )
+ PORT_DIPNAME( 0xe0, 0xe0, "Payout" ) PORT_DIPLOCATION("DSW1:6,7,8")
+ PORT_DIPSETTING( 0xe0, "1" )
+ PORT_DIPSETTING( 0xc0, "2" )
+ PORT_DIPSETTING( 0xa0, "5" )
+ PORT_DIPSETTING( 0x80, "7" )
+ PORT_DIPSETTING( 0x60, "9" )
+ PORT_DIPSETTING( 0x40, "12" )
+ PORT_DIPSETTING( 0x20, "15" )
+ PORT_DIPSETTING( 0x00, "20" )
+
+ PORT_START("DSW2") // $10 (PPI1 port A)
+ PORT_DIPNAME( 0x01, 0x01, "Win Mode" ) PORT_DIPLOCATION("DSW2:1")
+ PORT_DIPSETTING( 0x01, "Line" )
+ PORT_DIPSETTING( 0x00, "Square" )
+ PORT_DIPNAME( 0x02, 0x02, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("DSW2:2")
+ PORT_DIPSETTING( 0x02, DEF_STR( Normal ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( Hard ) )
+ PORT_DIPNAME( 0x04, 0x04, "Double-Up" ) PORT_DIPLOCATION("DSW2:3")
+ PORT_DIPSETTING( 0x00, DEF_STR( No ) )
+ PORT_DIPSETTING( 0x04, DEF_STR( Yes ) )
+ PORT_DIPNAME( 0x08, 0x08, "Control" ) PORT_DIPLOCATION("DSW2:4")
+ PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPNAME( 0x30, 0x30, "Res." ) PORT_DIPLOCATION("DSW2:5,6")
+ PORT_DIPSETTING( 0x30, DEF_STR (Off) )
+ PORT_DIPSETTING( 0x20, "10%" )
+ PORT_DIPSETTING( 0x10, "20%" )
+ PORT_DIPSETTING( 0x00, "30%" )
+ PORT_DIPNAME( 0x40, 0x40, "Bonus" ) PORT_DIPLOCATION("DSW2:7")
+ PORT_DIPSETTING( 0x40, "100" )
+ PORT_DIPSETTING( 0x00, "200" )
+ PORT_DIPNAME( 0x80, 0x80, "Cycle Bonus" ) PORT_DIPLOCATION("DSW2:8")
+ PORT_DIPSETTING( 0x80, "1" )
+ PORT_DIPSETTING( 0x00, "2" )
+
+ PORT_START("DSW3") // AY8910 port A
+ PORT_DIPNAME( 0x01, 0x01, "Limit" ) PORT_DIPLOCATION("DSW3:1")
+ PORT_DIPSETTING( 0x01, "300" )
+ PORT_DIPSETTING( 0x00, "500" )
+ PORT_DIPNAME( 0x06, 0x06, "Limit In" )
+ PORT_DIPSETTING( 0x06, DEF_STR( Off ) ) PORT_DIPLOCATION("DSW3:2,3")
+ PORT_DIPSETTING( 0x04, "10" )
+ PORT_DIPSETTING( 0x02, "20" )
+ PORT_DIPSETTING( 0x00, "30" )
+ PORT_DIPNAME( 0x18, 0x18, "Min Bet" ) PORT_DIPLOCATION("DSW3:4,5")
+ PORT_DIPSETTING( 0x18, "1" )
+ PORT_DIPSETTING( 0x10, "5" )
+ PORT_DIPSETTING( 0x08, "9" )
+ PORT_DIPSETTING( 0x00, "12" )
+ PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) ) PORT_DIPLOCATION("DSW3:6") // marked as reserved and off in manual
+ PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) ) PORT_DIPLOCATION("DSW3:7") // marked as reserved and off in manual
+ PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_DIPNAME( 0x80, 0x00, "Memo Safe" ) PORT_DIPLOCATION("DSW3:8") // marked as on in manual
+ PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
+ PORT_DIPSETTING( 0x00, DEF_STR( On ) )
+ PORT_START("DSW4") // AY8910 port B
+ PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) ) PORT_DIPLOCATION("DSW4:1,2,3")
+ PORT_DIPSETTING( 0x07, DEF_STR( 1C_5C ) )
+ PORT_DIPSETTING( 0x06, "1 Coin / 10 Credits" )
+ PORT_DIPSETTING( 0x05, "1 Coin / 20 Credits" )
+ PORT_DIPSETTING( 0x04, "1 Coin / 50 Credits" )
+ PORT_DIPSETTING( 0x03, "1 Coin / 100 Credits" )
+ PORT_DIPSETTING( 0x02, "1 Coin / 200 Credits" )
+ PORT_DIPSETTING( 0x01, "1 Coin / 500 Credits" )
+ PORT_DIPSETTING( 0x00, "1 Coin / 1000 Credits" )
+ PORT_DIPNAME( 0x38, 0x38, "Key In" ) PORT_DIPLOCATION("DSW4:4,5,6")
+ PORT_DIPSETTING( 0x38, "1 Pulse / 5 Credits" )
+ PORT_DIPSETTING( 0x30, "1 Pulse / 10 Credits" )
+ PORT_DIPSETTING( 0x28, "1 Pulse / 20 Credits" )
+ PORT_DIPSETTING( 0x20, "1 Pulse / 50 Credits" )
+ PORT_DIPSETTING( 0x18, "1 Pulse / 100 Credits" )
+ PORT_DIPSETTING( 0x10, "1 Pulse / 200 Credits" )
+ PORT_DIPSETTING( 0x08, "1 Pulse / 500 Credits" )
+ PORT_DIPSETTING( 0x00, "1 Pulse / 1000 Credits" )
+ PORT_DIPNAME( 0xc0, 0xc0, "Key Out" ) PORT_DIPLOCATION("DSW4:7,8")
+ PORT_DIPSETTING( 0xc0, "1" )
+ PORT_DIPSETTING( 0x80, "5" )
+ PORT_DIPSETTING( 0x40, "10" )
+ PORT_DIPSETTING( 0x00, "100" )
+INPUT_PORTS_END
// It runs in IM 0, thus needs an opcode on the data bus
INTERRUPT_GEN_MEMBER(skylncr_state::vblank_interrupt)
@@ -1955,6 +2095,24 @@ ROM_START( rolla )
ROM_LOAD16_BYTE( "4w g4.u58", 0x40001, 0x20000, CRC(1cce85f1) SHA1(f35709b29a13917fe3c69240b4ab03aa6bdc3a3b) )
ROM_END
+// this runs on a Rolla PCB with a Z80 + logic on a daughterboard
+ROM_START( score5 )
+ ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
+ ROM_LOAD( "27c512_suboard.bin", 0x00000, 0x10000, CRC(a0670df0) SHA1(66c7f990141411c71978ec4500ea5a92264576e0) )
+
+ ROM_REGION( 0x80000, "gfx1", 0 )
+ ROM_LOAD16_BYTE( "1_am27c100.u29", 0x00000, 0x20000, CRC(42b03f90) SHA1(490ca43284e58931b8334ddeae3242cfd0a7a700) )
+ ROM_LOAD16_BYTE( "2_am27c100.u31", 0x00001, 0x20000, CRC(12ab7866) SHA1(5d608a9d569b5a7ebd2cb0cf2b2c95463c421c87) )
+ ROM_LOAD16_BYTE( "3_am27c100.u33", 0x40000, 0x20000, CRC(ffb88d0a) SHA1(b14147c96d81e5838bccf3c3df08fc26b3e917ad) )
+ ROM_LOAD16_BYTE( "4_am27c100.u35", 0x40001, 0x20000, CRC(91176aac) SHA1(18aab2578f4db1f04fb0570be685aa28a511d099) )
+
+ ROM_REGION( 0x80000, "gfx2", 0 )
+ ROM_LOAD16_BYTE( "5_am27c100.u52", 0x00000, 0x20000, CRC(d4d8e699) SHA1(5ba9e8c634fde06e55362f47fbd49503a9da2ed3) )
+ ROM_LOAD16_BYTE( "6_am27c100.u54", 0x00001, 0x20000, CRC(59631eaf) SHA1(a7f8dfc6737e6db6be8311e054f1e07b65792a93) )
+ ROM_LOAD16_BYTE( "7_am27c100.u56", 0x40000, 0x20000, CRC(801881a4) SHA1(fe0914db7d178c6d689682cb6e2af4ba782eaf8e) )
+ ROM_LOAD16_BYTE( "8_am27c100.u58", 0x40001, 0x20000, CRC(db20c424) SHA1(537c3b4dfb532473955042a58d204aebf60e950e) )
+ROM_END
+
/**********************************
* Driver Init *
**********************************/
@@ -2047,3 +2205,4 @@ GAME( 199?, sstar97, 0, sstar97, sstar97, skylncr_state, empty_init,
GAME( 1995, bdream97, 0, bdream97, skylncr, skylncr_state, empty_init, ROT0, "bootleg (KKK)", "Hudie Meng 97", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE )
GAME( 2000, sonikfig, 0, skylncr, sonikfig, skylncr_state, init_sonikfig, ROT0, "Z Games", "Sonik Fighter (version 02, encrypted)", MACHINE_WRONG_COLORS | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE )
GAME( 199?, rolla, 0, skylncr, skylncr, skylncr_state, empty_init, ROT0, "<unknown>", "unknown 'Rolla' slot machine", MACHINE_IS_SKELETON ) // internal CPU ROM not dumped
+GAME( 2000?,score5, 0, skylncr, score5, skylncr_state, init_sonikfig, ROT0, "Z Games", "Score 5", MACHINE_WRONG_COLORS | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // game runs but screen is completely black due to palette mishandling
diff --git a/src/mame/drivers/snk.cpp b/src/mame/drivers/snk.cpp
index cca973ac016..039680dda14 100644
--- a/src/mame/drivers/snk.cpp
+++ b/src/mame/drivers/snk.cpp
@@ -6937,6 +6937,7 @@ ROM_END
/***********************************************************************/
+// TODO: according to Kold at very least Athena is ROT180 not ROT0
GAME( 1983, marvins, 0, marvins, marvins, snk_state, empty_init, ROT270, "SNK", "Marvin's Maze", 0 )
GAME( 1984, vangrd2, 0, vangrd2, vangrd2, snk_state, empty_init, ROT270, "SNK", "Vanguard II", 0 )
GAME( 1984, madcrash, 0, vangrd2, madcrash, snk_state, empty_init, ROT0, "SNK", "Mad Crasher", 0 )
diff --git a/src/mame/mame.lst b/src/mame/mame.lst
index b8d5ee6df91..3c9033355cc 100644
--- a/src/mame/mame.lst
+++ b/src/mame/mame.lst
@@ -37964,6 +37964,7 @@ mbutrfly // (c) 1999 (Bordun International?)
miaction // (c) Vegas
neraidou // Bootleg?
rolla //
+score5 // Z Games
skylncr // (c) 1995 Bordun International
sonikfig // Z Games
sstar97 // (c) 199? Bordun International
diff --git a/src/osd/modules/debugger/win/debugviewinfo.cpp b/src/osd/modules/debugger/win/debugviewinfo.cpp
index d40684c5f99..e2b3e9f07a3 100644
--- a/src/osd/modules/debugger/win/debugviewinfo.cpp
+++ b/src/osd/modules/debugger/win/debugviewinfo.cpp
@@ -19,6 +19,8 @@
#include "winutil.h"
+#include <mmsystem.h>
+
// debugger view styles
#define DEBUG_VIEW_STYLE WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN
@@ -46,14 +48,15 @@ debugview_info::debugview_info(debugger_windows_interface &debugger, debugwin_in
m_view(nullptr),
m_wnd(nullptr),
m_hscroll(nullptr),
- m_vscroll(nullptr)
+ m_vscroll(nullptr),
+ m_contextmenu(nullptr)
{
register_window_class();
// create the child view
m_wnd = CreateWindowEx(DEBUG_VIEW_STYLE_EX, TEXT("MAMEDebugView"), nullptr, DEBUG_VIEW_STYLE,
0, 0, 100, 100, parent, nullptr, GetModuleHandleUni(), this);
- if (m_wnd == nullptr)
+ if (!m_wnd)
goto cleanup;
// create the scroll bars
@@ -61,27 +64,27 @@ debugview_info::debugview_info(debugger_windows_interface &debugger, debugwin_in
0, 0, 100, CW_USEDEFAULT, m_wnd, nullptr, GetModuleHandleUni(), this);
m_vscroll = CreateWindowEx(VSCROLL_STYLE_EX, TEXT("SCROLLBAR"), nullptr, VSCROLL_STYLE,
0, 0, CW_USEDEFAULT, 100, m_wnd, nullptr, GetModuleHandleUni(), this);
- if ((m_hscroll == nullptr) || (m_vscroll == nullptr))
+ if (!m_hscroll || !m_vscroll)
goto cleanup;
// create the debug view
m_view = machine().debug_view().alloc_view(type, &debugview_info::static_update, this);
- if (m_view == nullptr)
+ if (!m_view)
goto cleanup;
return;
cleanup:
- if (m_hscroll != nullptr)
+ if (m_hscroll)
DestroyWindow(m_hscroll);
m_hscroll = nullptr;
- if (m_vscroll != nullptr)
+ if (m_vscroll)
DestroyWindow(m_vscroll);
m_vscroll = nullptr;
- if (m_wnd != nullptr)
+ if (m_wnd)
DestroyWindow(m_wnd);
m_wnd = nullptr;
- if (m_view != nullptr)
+ if (m_view)
machine().debug_view().free_view(*m_view);
m_view = nullptr;
}
@@ -89,7 +92,9 @@ cleanup:
debugview_info::~debugview_info()
{
- if (m_wnd != nullptr)
+ if (m_contextmenu)
+ DestroyMenu(m_contextmenu);
+ if (m_wnd)
DestroyWindow(m_wnd);
if (m_view)
machine().debug_view().free_view(*m_view);
@@ -119,7 +124,7 @@ uint32_t debugview_info::maxwidth()
if (max < chars)
max = chars;
}
- if (cursource != nullptr)
+ if (cursource)
m_view->set_source(*cursource);
return (max * metrics().debug_font_width()) + metrics().vscroll_width();
}
@@ -164,27 +169,23 @@ void debugview_info::send_vscroll(int delta)
void debugview_info::send_pageup()
{
if (m_vscroll)
- {
SendMessage(m_wnd, WM_VSCROLL, SB_PAGELEFT, (LPARAM)m_vscroll);
- }
}
void debugview_info::send_pagedown()
{
if (m_vscroll)
- {
SendMessage(m_wnd, WM_VSCROLL, SB_PAGERIGHT, (LPARAM)m_vscroll);
- }
}
char const *debugview_info::source_name() const
{
- if (m_view != nullptr)
+ if (m_view)
{
debug_view_source const *const source = m_view->source();
- if (source != nullptr)
+ if (source)
return source->name();
}
return "";
@@ -193,10 +194,10 @@ char const *debugview_info::source_name() const
device_t *debugview_info::source_device() const
{
- if (m_view != nullptr)
+ if (m_view)
{
debug_view_source const *const source = m_view->source();
- if (source != nullptr)
+ if (source)
return source->device();
}
return nullptr;
@@ -205,10 +206,10 @@ device_t *debugview_info::source_device() const
bool debugview_info::source_is_visible_cpu() const
{
- if (m_view != nullptr)
+ if (m_view)
{
const debug_view_source *const source = m_view->source();
- return (source != nullptr) && (machine().debugger().console().get_visible_cpu() == source->device());
+ return source && (machine().debugger().console().get_visible_cpu() == source->device());
}
return false;
}
@@ -216,10 +217,10 @@ bool debugview_info::source_is_visible_cpu() const
bool debugview_info::set_source_index(int index)
{
- if (m_view != nullptr)
+ if (m_view)
{
const debug_view_source *const source = m_view->source(index);
- if (source != nullptr)
+ if (source)
{
m_view->set_source(*source);
return true;
@@ -231,10 +232,10 @@ bool debugview_info::set_source_index(int index)
bool debugview_info::set_source_for_device(device_t &device)
{
- if (m_view != nullptr)
+ if (m_view)
{
const debug_view_source *const source = m_view->source_for_device(&device);
- if (source != nullptr)
+ if (source)
{
m_view->set_source(*source);
return true;
@@ -247,7 +248,7 @@ bool debugview_info::set_source_for_device(device_t &device)
bool debugview_info::set_source_for_visible_cpu()
{
device_t *const curcpu = machine().debugger().console().get_visible_cpu();
- if (curcpu != nullptr)
+ if (curcpu)
return set_source_for_device(*curcpu);
else
return false;
@@ -273,7 +274,7 @@ HWND debugview_info::create_source_combobox(HWND parent, LONG_PTR userdata)
auto t_name = osd::text::to_tstring(source->name());
SendMessage(result, CB_ADDSTRING, 0, (LPARAM)t_name.c_str());
}
- if (cursource != nullptr)
+ if (cursource)
{
SendMessage(result, CB_SETCURSEL, m_view->source_index(*cursource), 0);
SendMessage(result, CB_SETDROPPEDWIDTH, ((maxlength + 2) * metrics().debug_font_width()) + metrics().vscroll_width(), 0);
@@ -283,6 +284,115 @@ HWND debugview_info::create_source_combobox(HWND parent, LONG_PTR userdata)
}
+void debugview_info::add_items_to_context_menu(HMENU menu)
+{
+ AppendMenu(menu, MF_ENABLED, ID_CONTEXT_COPY_VISIBLE, TEXT("Copy Visible"));
+ AppendMenu(menu, MF_ENABLED, ID_CONTEXT_PASTE, TEXT("Paste"));
+}
+
+
+void debugview_info::update_context_menu(HMENU menu)
+{
+ EnableMenuItem(menu, ID_CONTEXT_PASTE, MF_BYCOMMAND | (IsClipboardFormatAvailable(CF_UNICODETEXT) ? MF_ENABLED : MF_GRAYED));
+}
+
+
+void debugview_info::handle_context_menu(unsigned command)
+{
+ switch (command)
+ {
+ case ID_CONTEXT_COPY_VISIBLE:
+ {
+ // get visible text
+ debug_view_xy const visarea = m_view->visible_size();
+ debug_view_char const *viewdata = m_view->viewdata();
+ if (!viewdata)
+ {
+ PlaySound(TEXT("SystemAsterisk"), nullptr, SND_SYNC);
+ break;
+ }
+
+ // turn into a plain string, trimming trailing whitespace
+ std::wstring text;
+ for (uint32_t row = 0; row < visarea.y; row++, viewdata += visarea.x)
+ {
+ std::wstring::size_type const start = text.length();
+ for (uint32_t col = 0; col < visarea.x; ++col)
+ text += wchar_t(viewdata[col].byte);
+ std::wstring::size_type const nonblank = text.find_last_not_of(L"\t\n\v\r ");
+ if ((nonblank != std::wstring::npos) && (nonblank >= start))
+ text.resize(nonblank + 1);
+ text += L"\r\n";
+ }
+
+ // copy to the clipboard
+ HGLOBAL const clip = GlobalAlloc(GMEM_MOVEABLE, (text.length() + 1) * sizeof(wchar_t));
+ if (!clip)
+ {
+ PlaySound(TEXT("SystemAsterisk"), nullptr, SND_SYNC);
+ break;
+ }
+ if (!OpenClipboard(m_wnd))
+ {
+ GlobalFree(clip);
+ PlaySound(TEXT("SystemAsterisk"), nullptr, SND_SYNC);
+ break;
+ }
+ EmptyClipboard();
+ LPWSTR const lock = reinterpret_cast<LPWSTR>(GlobalLock(clip));
+ std::copy_n(text.c_str(), text.length() + 1, lock);
+ GlobalUnlock(clip);
+ if (!SetClipboardData(CF_UNICODETEXT, clip))
+ {
+ GlobalFree(clip);
+ PlaySound(TEXT("SystemAsterisk"), nullptr, SND_SYNC);
+ }
+ CloseClipboard();
+ break;
+ }
+
+ case ID_CONTEXT_PASTE:
+ if (!IsClipboardFormatAvailable(CF_UNICODETEXT) || !OpenClipboard(m_wnd))
+ {
+ PlaySound(TEXT("SystemAsterisk"), nullptr, SND_SYNC);
+ }
+ else
+ {
+ HGLOBAL const clip = GetClipboardData(CF_UNICODETEXT);
+ LPCWSTR lock = clip ? reinterpret_cast<LPCWSTR>(GlobalLock(clip)) : nullptr;
+ if (!clip || !lock)
+ {
+ PlaySound(TEXT("SystemAsterisk"), nullptr, SND_SYNC);
+ }
+ else
+ {
+ try
+ {
+ while (*lock)
+ {
+ if ((32 <= *lock) && (127 >= *lock))
+ m_view->process_char(*lock);
+ ++lock;
+ }
+ }
+ catch (...)
+ {
+ GlobalUnlock(clip);
+ CloseClipboard();
+ throw;
+ }
+ GlobalUnlock(clip);
+ }
+ CloseClipboard();
+ }
+ break;
+
+ default:
+ osd_printf_warning("debugview_info: unhandled context menu item %u\n", command);
+ }
+}
+
+
void debugview_info::draw_contents(HDC windc)
{
debug_view_char const *viewdata = m_view->viewdata();
@@ -294,10 +404,10 @@ void debugview_info::draw_contents(HDC windc)
// create a compatible DC and an offscreen bitmap
HDC const dc = CreateCompatibleDC(windc);
- if (dc == nullptr)
+ if (!dc)
return;
HBITMAP const bitmap = CreateCompatibleBitmap(windc, client.right, client.bottom);
- if (bitmap == nullptr)
+ if (!bitmap)
{
DeleteDC(dc);
return;
@@ -585,6 +695,40 @@ uint32_t debugview_info::process_scroll(WORD type, HWND wnd)
}
+bool debugview_info::process_context_menu(int x, int y)
+{
+ // don't show a menu if not in client rect
+ RECT clientrect;
+ GetClientRect(m_wnd, &clientrect);
+ POINT loc{ x, y };
+ ScreenToClient(m_wnd, &loc);
+ if (!PtInRect(&clientrect, loc))
+ return false;
+
+ // create the context menu if we haven’t already
+ if (!m_contextmenu)
+ {
+ m_contextmenu = CreatePopupMenu();
+ if (!m_contextmenu)
+ return false;
+ add_items_to_context_menu(m_contextmenu);
+ }
+
+ // show the context menu
+ update_context_menu(m_contextmenu);
+ BOOL const command(TrackPopupMenu(
+ m_contextmenu,
+ (GetSystemMetrics(SM_MENUDROPALIGNMENT) ? TPM_RIGHTALIGN : TPM_LEFTALIGN) | TPM_LEFTBUTTON | TPM_NONOTIFY | TPM_RETURNCMD,
+ x, y,
+ 0,
+ m_wnd,
+ nullptr));
+ if (command)
+ handle_context_menu(command);
+ return true;
+}
+
+
LRESULT debugview_info::view_proc(UINT message, WPARAM wparam, LPARAM lparam)
{
// handle a few messages
@@ -718,17 +862,31 @@ LRESULT debugview_info::view_proc(UINT message, WPARAM wparam, LPARAM lparam)
// mouse click
case WM_LBUTTONDOWN:
+ case WM_MBUTTONDOWN:
{
debug_view_xy topleft = m_view->visible_position();
debug_view_xy newpos;
newpos.x = topleft.x + GET_X_LPARAM(lparam) / metrics().debug_font_width();
newpos.y = topleft.y + GET_Y_LPARAM(lparam) / metrics().debug_font_height();
- m_view->process_click(DCK_LEFT_CLICK, newpos);
+ m_view->process_click((message == WM_LBUTTONDOWN) ? DCK_LEFT_CLICK : DCK_MIDDLE_CLICK, newpos);
SetFocus(m_wnd);
break;
}
- // hscroll
+ // right click
+ case WM_RBUTTONDOWN:
+ if (m_view->cursor_supported())
+ {
+ debug_view_xy topleft = m_view->visible_position();
+ debug_view_xy newpos;
+ newpos.x = topleft.x + GET_X_LPARAM(lparam) / metrics().debug_font_width();
+ newpos.y = topleft.y + GET_Y_LPARAM(lparam) / metrics().debug_font_height();
+ m_view->set_cursor_position(newpos);
+ m_view->set_cursor_visible(true);
+ }
+ return DefWindowProc(m_wnd, message, wparam, lparam);
+
+ // horizontal scroll
case WM_HSCROLL:
{
debug_view_xy topleft = m_view->visible_position();
@@ -738,7 +896,7 @@ LRESULT debugview_info::view_proc(UINT message, WPARAM wparam, LPARAM lparam)
break;
}
- // vscroll
+ // vertical scroll
case WM_VSCROLL:
{
debug_view_xy topleft = m_view->visible_position();
@@ -748,6 +906,11 @@ LRESULT debugview_info::view_proc(UINT message, WPARAM wparam, LPARAM lparam)
break;
}
+ case WM_CONTEXTMENU:
+ if (!process_context_menu(GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam)))
+ return DefWindowProc(m_wnd, message, wparam, lparam);
+ break;
+
// everything else: defaults
default:
return DefWindowProc(m_wnd, message, wparam, lparam);
diff --git a/src/osd/modules/debugger/win/debugviewinfo.h b/src/osd/modules/debugger/win/debugviewinfo.h
index fd48c7975bf..beb5ee66ff0 100644
--- a/src/osd/modules/debugger/win/debugviewinfo.h
+++ b/src/osd/modules/debugger/win/debugviewinfo.h
@@ -52,12 +52,23 @@ public:
HWND create_source_combobox(HWND parent, LONG_PTR userdata);
protected:
+ enum
+ {
+ ID_CONTEXT_COPY_VISIBLE = 1,
+ ID_CONTEXT_PASTE
+ };
+
template <typename T> T *view() const { return downcast<T *>(m_view); }
+ virtual void add_items_to_context_menu(HMENU menu);
+ virtual void update_context_menu(HMENU menu);
+ virtual void handle_context_menu(unsigned command);
+
private:
void draw_contents(HDC windc);
void update();
uint32_t process_scroll(WORD type, HWND wnd);
+ bool process_context_menu(int x, int y);
LRESULT view_proc(UINT message, WPARAM wparam, LPARAM lparam);
static void static_update(debug_view &view, void *osdprivate);
@@ -70,6 +81,7 @@ private:
HWND m_wnd;
HWND m_hscroll;
HWND m_vscroll;
+ HMENU m_contextmenu;
static bool s_window_class_registered;
};