From 9566fb07763d6a2a696b8a5e449ec03c74498307 Mon Sep 17 00:00:00 2001 From: hap Date: Wed, 10 Jul 2019 13:12:52 +0200 Subject: mmboard: increase delay, glasgow didn't recognize every capture (nw) --- src/mame/machine/mmboard.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mame/machine/mmboard.cpp b/src/mame/machine/mmboard.cpp index 66340bf3e11..8886689450e 100644 --- a/src/mame/machine/mmboard.cpp +++ b/src/mame/machine/mmboard.cpp @@ -59,7 +59,7 @@ void mephisto_buttons_board_device::device_add_mconfig(machine_config &config) mephisto_board_device::mephisto_board_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock) , m_board(*this, "board") - , m_sensordelay(attotime::from_msec(150)) + , m_sensordelay(attotime::from_msec(200)) , m_led(*this, "led%u", 0U) , m_disable_leds(false) { -- cgit v1.2.3-70-g09d2 From f34c77ebed9345f1e616146ba683dbb3eda2a747 Mon Sep 17 00:00:00 2001 From: hap Date: Wed, 10 Jul 2019 13:24:08 +0200 Subject: mmboard: update prev commit, didnt notice that it has its own set_delay (nw) --- src/mame/drivers/glasgow.cpp | 3 ++- src/mame/drivers/mephisto.cpp | 2 +- src/mame/drivers/mephisto_montec.cpp | 4 ++-- src/mame/drivers/mmodular.cpp | 16 ++++++++-------- src/mame/drivers/modena.cpp | 2 +- src/mame/drivers/polgar.cpp | 10 +++++----- src/mame/machine/mmboard.cpp | 2 +- src/mame/machine/mmboard.h | 6 +++--- 8 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/mame/drivers/glasgow.cpp b/src/mame/drivers/glasgow.cpp index 3c96046532c..493b437c042 100644 --- a/src/mame/drivers/glasgow.cpp +++ b/src/mame/drivers/glasgow.cpp @@ -314,7 +314,8 @@ void glasgow_state::glasgow(machine_config &config) M68000(config, m_maincpu, 12_MHz_XTAL); m_maincpu->set_addrmap(AS_PROGRAM, &glasgow_state::glasgow_mem); - MEPHISTO_SENSORS_BOARD(config, m_board, 0); + MEPHISTO_SENSORS_BOARD(config, m_board); + m_board->set_delay(attotime::from_msec(200)); /* video hardware */ config.set_default_layout(layout_glasgow); diff --git a/src/mame/drivers/mephisto.cpp b/src/mame/drivers/mephisto.cpp index d1c142e3194..eea2c099a98 100644 --- a/src/mame/drivers/mephisto.cpp +++ b/src/mame/drivers/mephisto.cpp @@ -316,7 +316,7 @@ void mephisto_state::mephisto(machine_config &config) TIMER(config, "nmi_timer").configure_periodic(FUNC(mephisto_state::update_nmi), attotime::from_hz(600)); - MEPHISTO_SENSORS_BOARD(config, "board", 0); + MEPHISTO_SENSORS_BOARD(config, "board"); config.set_default_layout(layout_mephisto); } diff --git a/src/mame/drivers/mephisto_montec.cpp b/src/mame/drivers/mephisto_montec.cpp index 19b6d074817..57b232541ad 100644 --- a/src/mame/drivers/mephisto_montec.cpp +++ b/src/mame/drivers/mephisto_montec.cpp @@ -470,7 +470,7 @@ void mephisto_montec_state::montec(machine_config &config) SPEAKER(config, "mono").front_center(); BEEP(config, m_beeper, 3250).add_route(ALL_OUTPUTS, "mono", 1.0); - MEPHISTO_SENSORS_BOARD(config, m_board, 0); + MEPHISTO_SENSORS_BOARD(config, m_board); m_board->set_delay(attotime::from_msec(300)); config.set_default_layout(layout_mephisto_montec); @@ -490,7 +490,7 @@ void mephisto_montec_state::megaiv(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &mephisto_montec_state::megaiv_mem); m_maincpu->set_periodic_int(FUNC(mephisto_montec_state::nmi_line_pulse), attotime::from_hz(XTAL(4'915'200) / (1 << 13))); - MEPHISTO_BUTTONS_BOARD(config.replace(), m_board, 0); + MEPHISTO_BUTTONS_BOARD(config.replace(), m_board); m_board->set_delay(attotime::from_msec(250)); m_board->set_disable_leds(true); config.set_default_layout(layout_mephisto_megaiv); diff --git a/src/mame/drivers/mmodular.cpp b/src/mame/drivers/mmodular.cpp index 25a256d9d92..20494ee60af 100644 --- a/src/mame/drivers/mmodular.cpp +++ b/src/mame/drivers/mmodular.cpp @@ -261,8 +261,8 @@ void mmodular_state::alm16(machine_config &config) maincpu.set_addrmap(AS_PROGRAM, &mmodular_state::alm16_mem); maincpu.set_periodic_int(FUNC(mmodular_state::irq2_line_hold), attotime::from_hz(600)); - MEPHISTO_SENSORS_BOARD(config, "board", 0); - MEPHISTO_DISPLAY_MODUL(config, "display", 0); + MEPHISTO_SENSORS_BOARD(config, "board"); + MEPHISTO_DISPLAY_MODUL(config, "display"); config.set_default_layout(layout_mmodular); } @@ -282,8 +282,8 @@ void mmodular_state::alm32(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - MEPHISTO_SENSORS_BOARD(config, "board", 0); - MEPHISTO_DISPLAY_MODUL(config, "display", 0); + MEPHISTO_SENSORS_BOARD(config, "board"); + MEPHISTO_DISPLAY_MODUL(config, "display"); config.set_default_layout(layout_mmodular); } @@ -303,8 +303,8 @@ void mmodular_state::gen32(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - MEPHISTO_SENSORS_BOARD(config, "board", 0); - MEPHISTO_DISPLAY_MODUL(config, "display", 0); + MEPHISTO_SENSORS_BOARD(config, "board"); + MEPHISTO_DISPLAY_MODUL(config, "display"); config.set_default_layout(layout_mmodular); } @@ -317,8 +317,8 @@ void berlinp_state::berlinp(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - MEPHISTO_BUTTONS_BOARD(config, m_board, 0); - MEPHISTO_DISPLAY_MODUL(config, "display", 0); + MEPHISTO_BUTTONS_BOARD(config, m_board); + MEPHISTO_DISPLAY_MODUL(config, "display"); config.set_default_layout(layout_mmodular); } diff --git a/src/mame/drivers/modena.cpp b/src/mame/drivers/modena.cpp index 43fce448759..61601a7e8c5 100644 --- a/src/mame/drivers/modena.cpp +++ b/src/mame/drivers/modena.cpp @@ -149,7 +149,7 @@ void mephisto_modena_state::modena(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - MEPHISTO_BUTTONS_BOARD(config, m_board, 0); + MEPHISTO_BUTTONS_BOARD(config, m_board); m_board->set_disable_leds(true); config.set_default_layout(layout_mephisto_modena); diff --git a/src/mame/drivers/polgar.cpp b/src/mame/drivers/polgar.cpp index 7a6534bebc0..9f1222f8ea2 100644 --- a/src/mame/drivers/polgar.cpp +++ b/src/mame/drivers/polgar.cpp @@ -311,8 +311,8 @@ void mephisto_polgar_state::polgar(machine_config &config) outlatch.q_out_cb<4>().set_output("led104"); outlatch.q_out_cb<5>().set_output("led105"); - MEPHISTO_SENSORS_BOARD(config, "board", 0); - MEPHISTO_DISPLAY_MODUL(config, "display", 0); + MEPHISTO_SENSORS_BOARD(config, "board"); + MEPHISTO_DISPLAY_MODUL(config, "display"); config.set_default_layout(layout_mephisto_lcd); } @@ -342,8 +342,8 @@ void mephisto_risc_state::mrisc(machine_config &config) outlatch.q_out_cb<5>().set_output("led105"); outlatch.parallel_out_cb().set_membank("rombank").rshift(6).mask(0x03).exor(0x01); - MEPHISTO_SENSORS_BOARD(config, "board", 0); - MEPHISTO_DISPLAY_MODUL(config, "display", 0); + MEPHISTO_SENSORS_BOARD(config, "board"); + MEPHISTO_DISPLAY_MODUL(config, "display"); config.set_default_layout(layout_mephisto_lcd); } @@ -352,7 +352,7 @@ void mephisto_milano_state::milano(machine_config &config) polgar(config); subdevice("maincpu")->set_addrmap(AS_PROGRAM, &mephisto_milano_state::milano_mem); - MEPHISTO_BUTTONS_BOARD(config.replace(), m_board, 0); + MEPHISTO_BUTTONS_BOARD(config.replace(), m_board); m_board->set_disable_leds(true); config.set_default_layout(layout_mephisto_milano); } diff --git a/src/mame/machine/mmboard.cpp b/src/mame/machine/mmboard.cpp index 8886689450e..66340bf3e11 100644 --- a/src/mame/machine/mmboard.cpp +++ b/src/mame/machine/mmboard.cpp @@ -59,7 +59,7 @@ void mephisto_buttons_board_device::device_add_mconfig(machine_config &config) mephisto_board_device::mephisto_board_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock) , m_board(*this, "board") - , m_sensordelay(attotime::from_msec(200)) + , m_sensordelay(attotime::from_msec(150)) , m_led(*this, "led%u", 0U) , m_disable_leds(false) { diff --git a/src/mame/machine/mmboard.h b/src/mame/machine/mmboard.h index eed4a61d818..2ea9ed3eec1 100644 --- a/src/mame/machine/mmboard.h +++ b/src/mame/machine/mmboard.h @@ -67,7 +67,7 @@ class mephisto_sensors_board_device : public mephisto_board_device { public: // construction/destruction - mephisto_sensors_board_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + mephisto_sensors_board_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); protected: @@ -82,7 +82,7 @@ class mephisto_buttons_board_device : public mephisto_board_device { public: // construction/destruction - mephisto_buttons_board_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + mephisto_buttons_board_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); protected: @@ -97,7 +97,7 @@ class mephisto_display_modul_device : public device_t { public: // construction/destruction - mephisto_display_modul_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + mephisto_display_modul_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); DECLARE_WRITE8_MEMBER(latch_w); DECLARE_WRITE8_MEMBER(io_w); -- cgit v1.2.3-70-g09d2 From daaa6c2a17b94cdc9de273f146997e348fd7e59e Mon Sep 17 00:00:00 2001 From: hap Date: Wed, 10 Jul 2019 13:36:15 +0200 Subject: mephisto: remove unneeded 'artwork adjuster' (nw) --- src/mame/drivers/glasgow.cpp | 2 -- src/mame/drivers/mephisto.cpp | 17 ----------------- 2 files changed, 19 deletions(-) diff --git a/src/mame/drivers/glasgow.cpp b/src/mame/drivers/glasgow.cpp index 493b437c042..7432d460bc4 100644 --- a/src/mame/drivers/glasgow.cpp +++ b/src/mame/drivers/glasgow.cpp @@ -81,8 +81,6 @@ protected: uint8_t m_lcd_shift_counter; uint8_t m_led7; uint8_t m_key_select; - -private: }; diff --git a/src/mame/drivers/mephisto.cpp b/src/mame/drivers/mephisto.cpp index eea2c099a98..a525b7571d0 100644 --- a/src/mame/drivers/mephisto.cpp +++ b/src/mame/drivers/mephisto.cpp @@ -274,23 +274,6 @@ void mephisto_state::machine_reset() { m_lcd_shift_counter = 3; m_allowNMI = 1; - -/* adjust artwork depending on current emulation*/ - - if (!strcmp(machine().system().name,"mm2") ) - output().set_value("MM",1); - else if (!strcmp(machine().system().name,"mm4") ) - output().set_value("MM",2); - else if (!strcmp(machine().system().name,"mm4tk") ) - output().set_value("MM",5); - else if (!strcmp(machine().system().name,"mm5tk") ) - output().set_value("MM",5); - else if (!strcmp(machine().system().name,"mm5") ) - output().set_value("MM",3); - else if (!strcmp(machine().system().name,"mm50") ) - output().set_value("MM",3); - else if (!strcmp(machine().system().name,"rebel5") ) - output().set_value("MM",4); } -- cgit v1.2.3-70-g09d2 From a7a30f473fa8161185f0f10e0165964a9b1c85d4 Mon Sep 17 00:00:00 2001 From: hap Date: Wed, 10 Jul 2019 14:00:35 +0200 Subject: chess*: change wood color in some layouts, that red-yellow template is too hard on the eyes (nw) --- src/mame/layout/chessmst.lay | 106 +++++++++++++++++++-------------------- src/mame/layout/chessmstdm.lay | 88 ++++++++++++++++---------------- src/mame/layout/glasgow.lay | 50 +++++++++--------- src/mame/layout/mephisto.lay | 50 +++++++++--------- src/mame/layout/mephisto_lcd.lay | 52 +++++++++---------- src/mame/layout/mmodular.lay | 52 +++++++++---------- 6 files changed, 199 insertions(+), 199 deletions(-) diff --git a/src/mame/layout/chessmst.lay b/src/mame/layout/chessmst.lay index bdc53d071a5..3e6493be196 100644 --- a/src/mame/layout/chessmst.lay +++ b/src/mame/layout/chessmst.lay @@ -21,56 +21,56 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + @@ -106,8 +106,8 @@ - - + + @@ -248,34 +248,34 @@ - + - + - + - + - + - + - + diff --git a/src/mame/layout/chessmstdm.lay b/src/mame/layout/chessmstdm.lay index 1d48d9bd738..e3dff09f388 100644 --- a/src/mame/layout/chessmstdm.lay +++ b/src/mame/layout/chessmstdm.lay @@ -30,42 +30,42 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -103,7 +103,7 @@ - + @@ -245,34 +245,34 @@ - + - + - + - + - + - + - + diff --git a/src/mame/layout/glasgow.lay b/src/mame/layout/glasgow.lay index f2e7fb7d450..9b6d210603e 100644 --- a/src/mame/layout/glasgow.lay +++ b/src/mame/layout/glasgow.lay @@ -24,22 +24,22 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -75,8 +75,8 @@ - - + + @@ -220,34 +220,34 @@ - + - + - + - + - + - + - + diff --git a/src/mame/layout/mephisto.lay b/src/mame/layout/mephisto.lay index adbace156c9..842f8786939 100644 --- a/src/mame/layout/mephisto.lay +++ b/src/mame/layout/mephisto.lay @@ -25,22 +25,22 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -76,8 +76,8 @@ - - + + @@ -221,34 +221,34 @@ - + - + - + - + - + - + - + diff --git a/src/mame/layout/mephisto_lcd.lay b/src/mame/layout/mephisto_lcd.lay index 7f28547f960..d6a762dcffb 100644 --- a/src/mame/layout/mephisto_lcd.lay +++ b/src/mame/layout/mephisto_lcd.lay @@ -20,22 +20,22 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -87,8 +87,8 @@ - - + + @@ -232,34 +232,34 @@ - + - + - + - + - + - + - + @@ -422,6 +422,6 @@ - + diff --git a/src/mame/layout/mmodular.lay b/src/mame/layout/mmodular.lay index f070e5469b5..879bcd1d6d4 100644 --- a/src/mame/layout/mmodular.lay +++ b/src/mame/layout/mmodular.lay @@ -10,22 +10,22 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -62,8 +62,8 @@ - - + + @@ -207,34 +207,34 @@ - + - + - + - + - + - + - + @@ -364,6 +364,6 @@ - + -- cgit v1.2.3-70-g09d2 From af576f7a8f298e1ada3f295dc48f0df92a4ee5a1 Mon Sep 17 00:00:00 2001 From: hap Date: Wed, 10 Jul 2019 14:51:28 +0200 Subject: chess layouts: the overlapping chess squares is to avoid rounding errors (1-pixel seams), each square is still 10*10 in the end (nw) --- src/mame/layout/chessmst.lay | 205 ++++++++++++++++----------------- src/mame/layout/chessmstdm.lay | 205 ++++++++++++++++----------------- src/mame/layout/glasgow.lay | 140 +++++++++++----------- src/mame/layout/mephisto_academy.lay | 187 +++++++++++++++--------------- src/mame/layout/mephisto_lcd.lay | 140 +++++++++++----------- src/mame/layout/mephisto_megaiv.lay | 140 +++++++++++----------- src/mame/layout/mephisto_milano.lay | 140 +++++++++++----------- src/mame/layout/mephisto_modena.lay | 140 +++++++++++----------- src/mame/layout/mephisto_mondial2.lay | 140 +++++++++++----------- src/mame/layout/mephisto_montec.lay | 140 +++++++++++----------- src/mame/layout/mephisto_smondial2.lay | 140 +++++++++++----------- src/mame/layout/mmodular.lay | 140 +++++++++++----------- src/mame/layout/saitek_risc2500.lay | 147 ++++++++++++----------- 13 files changed, 995 insertions(+), 1009 deletions(-) diff --git a/src/mame/layout/chessmst.lay b/src/mame/layout/chessmst.lay index 3e6493be196..738c935f26e 100644 --- a/src/mame/layout/chessmst.lay +++ b/src/mame/layout/chessmst.lay @@ -118,122 +118,118 @@ - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - + + + + + + + + - + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + @@ -468,7 +464,8 @@ - + + diff --git a/src/mame/layout/chessmstdm.lay b/src/mame/layout/chessmstdm.lay index e3dff09f388..0bfc27f7d3f 100644 --- a/src/mame/layout/chessmstdm.lay +++ b/src/mame/layout/chessmstdm.lay @@ -114,122 +114,118 @@ - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - + + + + + + + + - + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + @@ -440,7 +436,8 @@ - + + diff --git a/src/mame/layout/glasgow.lay b/src/mame/layout/glasgow.lay index 9b6d210603e..abdaa7892c1 100644 --- a/src/mame/layout/glasgow.lay +++ b/src/mame/layout/glasgow.lay @@ -90,76 +90,76 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/mephisto_academy.lay b/src/mame/layout/mephisto_academy.lay index c1f81f2339e..af4b236a3b8 100644 --- a/src/mame/layout/mephisto_academy.lay +++ b/src/mame/layout/mephisto_academy.lay @@ -118,76 +118,76 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -372,11 +372,7 @@ - - - - - + @@ -420,30 +416,27 @@ - - - - + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/mephisto_lcd.lay b/src/mame/layout/mephisto_lcd.lay index d6a762dcffb..20188bdddf6 100644 --- a/src/mame/layout/mephisto_lcd.lay +++ b/src/mame/layout/mephisto_lcd.lay @@ -102,76 +102,76 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/mephisto_megaiv.lay b/src/mame/layout/mephisto_megaiv.lay index 79fd82476b0..983b3550c40 100644 --- a/src/mame/layout/mephisto_megaiv.lay +++ b/src/mame/layout/mephisto_megaiv.lay @@ -120,76 +120,76 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/mephisto_milano.lay b/src/mame/layout/mephisto_milano.lay index 13311ae0c23..84f5bab31d9 100644 --- a/src/mame/layout/mephisto_milano.lay +++ b/src/mame/layout/mephisto_milano.lay @@ -101,76 +101,76 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/mephisto_modena.lay b/src/mame/layout/mephisto_modena.lay index 7f3b79b773e..300916bbd88 100644 --- a/src/mame/layout/mephisto_modena.lay +++ b/src/mame/layout/mephisto_modena.lay @@ -106,76 +106,76 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/mephisto_mondial2.lay b/src/mame/layout/mephisto_mondial2.lay index 56591e8e52d..07778dd9d15 100644 --- a/src/mame/layout/mephisto_mondial2.lay +++ b/src/mame/layout/mephisto_mondial2.lay @@ -115,76 +115,76 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/mephisto_montec.lay b/src/mame/layout/mephisto_montec.lay index bfd1e1684a9..e3a7393f142 100644 --- a/src/mame/layout/mephisto_montec.lay +++ b/src/mame/layout/mephisto_montec.lay @@ -128,76 +128,76 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/mephisto_smondial2.lay b/src/mame/layout/mephisto_smondial2.lay index a01312b969b..ec15beeb497 100644 --- a/src/mame/layout/mephisto_smondial2.lay +++ b/src/mame/layout/mephisto_smondial2.lay @@ -123,76 +123,76 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/mmodular.lay b/src/mame/layout/mmodular.lay index 879bcd1d6d4..809bb56933a 100644 --- a/src/mame/layout/mmodular.lay +++ b/src/mame/layout/mmodular.lay @@ -77,76 +77,76 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/saitek_risc2500.lay b/src/mame/layout/saitek_risc2500.lay index b93932234a7..3b85a193a8b 100644 --- a/src/mame/layout/saitek_risc2500.lay +++ b/src/mame/layout/saitek_risc2500.lay @@ -70,6 +70,7 @@ + @@ -120,76 +121,76 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -387,10 +388,8 @@ - - - - + + -- cgit v1.2.3-70-g09d2 From 3be27fbd0c032d21be039133f138f89d212caa01 Mon Sep 17 00:00:00 2001 From: hap Date: Wed, 10 Jul 2019 15:26:40 +0200 Subject: mephisto layouts: the 7seg panel is an LCD, not LED, change color to white (nw) --- src/mame/layout/chessmstdm.lay | 2 +- src/mame/layout/glasgow.lay | 5 ++++- src/mame/layout/mephisto.lay | 5 ++++- src/mame/layout/mephisto_megaiv.lay | 5 ++++- src/mame/layout/mephisto_modena.lay | 5 ++++- src/mame/layout/mephisto_montec.lay | 5 ++++- src/mame/layout/mephisto_smondial2.lay | 5 ++++- 7 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/mame/layout/chessmstdm.lay b/src/mame/layout/chessmstdm.lay index 0bfc27f7d3f..2c382ab40eb 100644 --- a/src/mame/layout/chessmstdm.lay +++ b/src/mame/layout/chessmstdm.lay @@ -436,7 +436,7 @@ - + diff --git a/src/mame/layout/glasgow.lay b/src/mame/layout/glasgow.lay index abdaa7892c1..dd44f7f2bf9 100644 --- a/src/mame/layout/glasgow.lay +++ b/src/mame/layout/glasgow.lay @@ -1,10 +1,13 @@ + + - + + diff --git a/src/mame/layout/mephisto.lay b/src/mame/layout/mephisto.lay index 842f8786939..ac57dafdf84 100644 --- a/src/mame/layout/mephisto.lay +++ b/src/mame/layout/mephisto.lay @@ -1,11 +1,14 @@ + + - + + diff --git a/src/mame/layout/mephisto_megaiv.lay b/src/mame/layout/mephisto_megaiv.lay index 983b3550c40..3a52011ad59 100644 --- a/src/mame/layout/mephisto_megaiv.lay +++ b/src/mame/layout/mephisto_megaiv.lay @@ -1,11 +1,14 @@ + + - + + diff --git a/src/mame/layout/mephisto_modena.lay b/src/mame/layout/mephisto_modena.lay index 300916bbd88..9f85e574415 100644 --- a/src/mame/layout/mephisto_modena.lay +++ b/src/mame/layout/mephisto_modena.lay @@ -1,11 +1,14 @@ + + - + + diff --git a/src/mame/layout/mephisto_montec.lay b/src/mame/layout/mephisto_montec.lay index e3a7393f142..ba25ffec318 100644 --- a/src/mame/layout/mephisto_montec.lay +++ b/src/mame/layout/mephisto_montec.lay @@ -1,11 +1,14 @@ + + - + + diff --git a/src/mame/layout/mephisto_smondial2.lay b/src/mame/layout/mephisto_smondial2.lay index ec15beeb497..d2c1ccf517a 100644 --- a/src/mame/layout/mephisto_smondial2.lay +++ b/src/mame/layout/mephisto_smondial2.lay @@ -1,11 +1,14 @@ + + - + + -- cgit v1.2.3-70-g09d2 From 40d6c4525157610bfdfc74c138c9002a99e43964 Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Wed, 10 Jul 2019 15:48:29 +0200 Subject: mindset: i/o traps and display vram lookup [O. Galibert] --- src/mame/drivers/mindset.cpp | 139 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 120 insertions(+), 19 deletions(-) diff --git a/src/mame/drivers/mindset.cpp b/src/mame/drivers/mindset.cpp index 9740400eb0b..bddb8c12a99 100644 --- a/src/mame/drivers/mindset.cpp +++ b/src/mame/drivers/mindset.cpp @@ -36,7 +36,10 @@ protected: bool m_genlock[16]; u16 m_dispctrl, m_screenpos, m_intpos, m_intaddr, m_fdc_dma_count; u8 m_kbd_p1, m_kbd_p2, m_borderidx; - bool m_fdc_intext, m_fdc_int; + bool m_fdc_intext, m_fdc_int, m_fdc_drq, m_trap_int, m_trap_drq; + + u16 m_trap_data[8]; + u32 m_trap_pos, m_trap_len; static u16 gco_blend_0(u16, u16); static u16 gco_blend_1(u16, u16); @@ -86,6 +89,11 @@ protected: u8 fdc_dma_r(); void fdc_dma_w(u8 data); + u16 trap_dma_r(offs_t, u16); + u16 trap_r(offs_t offset); + void trap_w(offs_t offset, u16 data); + u16 trap_clear_interrupt(); + u16 keyscan(); u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); @@ -120,11 +128,36 @@ void mindset_state::machine_start() m_gcos = m_maincpu->space(AS_PROGRAM).cache<1, 0, ENDIANNESS_LITTLE>(); for(int i=0; i<2; i++) m_floppy[i] = m_fdco[i]->get_device(); + + save_item(NAME(m_fdc_intext)); + save_item(NAME(m_fdc_int)); + save_item(NAME(m_fdc_drq)); + save_item(NAME(m_trap_int)); + save_item(NAME(m_trap_drq)); + save_item(NAME(m_trap_pos)); + save_item(NAME(m_trap_len)); + save_item(NAME(m_trap_data)); + save_item(NAME(m_palette)); + save_item(NAME(m_genlock)); + save_item(NAME(m_dispctrl)); + save_item(NAME(m_screenpos)); + save_item(NAME(m_intpos)); + save_item(NAME(m_intaddr)); + save_item(NAME(m_fdc_dma_count)); + save_item(NAME(m_kbd_p1)); + save_item(NAME(m_kbd_p2)); + save_item(NAME(m_borderidx)); } void mindset_state::machine_reset() { - m_fdc_intext = m_fdc_int = false; + m_fdc_intext = m_fdc_int = m_trap_int = m_fdc_drq = m_trap_drq = false; + m_trap_pos = m_trap_len = 0; + memset(m_trap_data, 0, sizeof(m_trap_data)); + memset(m_palette, 0, sizeof(m_palette)); + memset(m_genlock, 0, sizeof(m_genlock)); + m_dispctrl = m_screenpos = m_intpos = m_intaddr = m_fdc_dma_count = 0; + m_kbd_p1 = m_kbd_p2 = m_borderidx = 0; } int mindset_state::sys_t0_r() @@ -222,9 +255,22 @@ void mindset_state::dispctrl_w(u16 data) u16 mindset_state::dispreg_r() { - // a..5 needed to pass the display test - // 0080 needed to allow uploading the palette - return 0xa085; + switch((m_dispctrl >> 4) & 7) { + case 1: { // Read vram at interrupt position + u16 v = m_vram[m_intaddr >> 1]; + if(m_intaddr & 1) + v >>= 8; + return sw(v << 4); + break; + } + case 5: { + // wants 0080 set to be able to upload the palette + return 0x0080; + } + } + + logerror("dispreg read %x\n", (m_dispctrl >> 4) & 7); + return 0; } void mindset_state::dispreg_w(u16 data) @@ -243,19 +289,26 @@ void mindset_state::dispreg_w(u16 data) int intx = (159 - ((m_intpos >> 8) & 255)) * ((m_dispctrl & 0x100) ? 2 : 4); int inty = 199 - (m_intpos & 255); m_intaddr = 0; - int mode_type = (m_dispctrl & 0x6000) >> 13; + bool bank = m_dispctrl & 0x4000; + bool ibm_mode = m_dispctrl & 0x2000; + // bool interleave = m_dispctrl & 0x0800; int pixels_per_byte_order = (m_dispctrl & 0x0600) >> 9; bool large_pixels = m_dispctrl & 0x0100; - switch(mode_type) { - case 0: - m_intaddr = inty * (160 >> (pixels_per_byte_order - large_pixels + 1)) + (intx >> (pixels_per_byte_order - large_pixels + 2)); - break; - case 1: + if(ibm_mode) m_intaddr = (inty & 1) * 0x2000 + (inty >> 1) * 80 + (intx >> (3 - large_pixels)) ; - break; + else { + int stepy = 0; + if(pixels_per_byte_order == 2) stepy = 40; + if(pixels_per_byte_order == 1) stepy = 80; + if(pixels_per_byte_order == 0) stepy = 160; + + m_intaddr = inty * stepy + (intx >> (pixels_per_byte_order - large_pixels + 2)); } - logerror("interrupt position (%3d, %3d) %04x.%04x = %04x (%d,%d)\n", intx, inty, m_dispctrl, m_intpos, m_intaddr, pixels_per_byte_order, large_pixels); + if(bank) + m_intaddr += 16000; + + logerror("interrupt position (%3d, %3d) ramdac address %04x\n", intx, inty, m_intaddr); break; } case 4: { @@ -583,10 +636,11 @@ void mindset_state::blit(u16 packet_seg, u16 packet_adr) // x = go right to left (unimplemented) // f = fast (no idea what it means) // n = invert collision flag (unimplemented) - // p = pattern fill (semi-implemented, used by fill_dest_buffer) + // p = pattern fill (used by fill_dest_buffer) // i/f = increment source / don't (used by blt_copy_word) if(mode & 0x200) { + // pattern fill u16 src = m_gcos->read_word((src_seg << 4) + src_adr); for(u16 w=0; w != width/2; w++) { m_gcos->write_word((dst_seg << 4) + dst_adr, src); @@ -596,6 +650,7 @@ void mindset_state::blit(u16 packet_seg, u16 packet_adr) } else { auto blend = gco_blend[(mode >> 2) & 7]; + // Need to rotate rmask depending on the shifts too u16 awmask = ((wmask << 16) | wmask) >> (15 - dst_sft); u16 swmask, mwmask, ewmask; if(dst_sft >= width) { @@ -685,7 +740,7 @@ void mindset_state::gco_w(u16) u16 packet_adr = sw(m_gcos->read_word(0xbfd78)); u16 global_mode = sw(m_gcos->read_word(0xbfd76)); - if(1) + if(0) logerror("GCO: start %04x:%04x mode %04x (%05x)\n", packet_seg, packet_adr, global_mode, m_maincpu->pc()); switch(global_mode) { @@ -715,13 +770,13 @@ void mindset_state::fdc_int_w(int state) if(!m_fdc_intext && state) m_fdc_int = true; m_fdc_intext = state; - m_maincpu->int0_w(m_fdc_int); + m_maincpu->int0_w(m_fdc_int || m_trap_int); } u16 mindset_state::fdc_clear_interrupt() { m_fdc_int = false; - m_maincpu->int0_w(m_fdc_int); + m_maincpu->int0_w(m_fdc_int || m_trap_int); return 0x0000; } @@ -752,6 +807,48 @@ void mindset_state::fdc_dma_w(u8 data) m_fdc_dma_count--; } +u16 mindset_state::trap_clear_interrupt() +{ + m_trap_int = false; + m_maincpu->int0_w(m_fdc_int || m_trap_int); + return 0x0000; +} + +u16 mindset_state::trap_r(offs_t offset) +{ + // machine().debug_break(); + logerror("trap_r %04x\n", offset << 1); + m_trap_data[m_trap_len++] = (offset << 1) | 0x8000; + m_trap_data[m_trap_len++] = 0; + m_trap_drq = true; + m_maincpu->drq1_w(m_fdc_drq || m_trap_drq); + return 0; +} + +void mindset_state::trap_w(offs_t offset, u16 data) +{ + // machine().debug_break(); + logerror("trap_w %04x, %04x\n", offset << 1, data); + m_trap_data[m_trap_len++] = offset << 1; + m_trap_data[m_trap_len++] = data; + m_trap_drq = true; + m_maincpu->drq1_w(m_fdc_drq || m_trap_drq); +} + +u16 mindset_state::trap_dma_r(offs_t, u16 mem_mask) +{ + u16 res = m_trap_pos < m_trap_len ? m_trap_data[m_trap_pos++] : 0; + logerror("trap dma %04x @ %04x\n", res, mem_mask); + if(m_trap_pos >= m_trap_len) { + m_trap_drq = false; + m_trap_int = true; + m_maincpu->drq1_w(m_fdc_drq || m_trap_drq); + m_maincpu->int0_w(m_fdc_int || m_trap_int); + m_trap_pos = m_trap_len = 0; + } + return res; +} + void mindset_state::maincpu_mem(address_map &map) { map(0x00000, 0x3ffff).ram(); @@ -761,6 +858,10 @@ void mindset_state::maincpu_mem(address_map &map) void mindset_state::maincpu_io(address_map &map) { + map(0x0000, 0x7fff).rw(FUNC(mindset_state::trap_r), FUNC(mindset_state::trap_w)); + + map(0x8040, 0x8041).r(FUNC(mindset_state::trap_dma_r)); + map(0x8048, 0x8049).r(FUNC(mindset_state::trap_clear_interrupt)); map(0x8050, 0x8050).w(FUNC(mindset_state::fdc_ctrl_w)); map(0x8054, 0x8054).rw(FUNC(mindset_state::fdc_dma_r), FUNC(mindset_state::fdc_dma_w)); map(0x8058, 0x8059).w(FUNC(mindset_state::fdc_dma_count_w)); @@ -772,7 +873,7 @@ void mindset_state::maincpu_io(address_map &map) map(0x80c0, 0x80c0).lr8("id3f", []() -> u8 { return 0x3f; }); // serial type 1, maybe? map(0x8100, 0x8100).lr8("id5f", []() -> u8 { return 0x5f; }); // serial type 2 map(0x8140, 0x8140).lr8("id70", []() -> u8 { return 0x70; }); // parallel printer, init writes 0x82 at +6 - map(0x8180, 0x8180).lr8("id73", []() -> u8 { return 0x73; }); // serial type 3 + map(0x8180, 0x8180).lr8("rs232-id", []() -> u8 { return 0x73; }); // rs232 map(0x8280, 0x8283).rw(m_syscpu, FUNC(i8042_device::upi41_master_r), FUNC(i8042_device::upi41_master_w)).umask16(0x00ff); map(0x82a0, 0x82a3).rw(m_soundcpu, FUNC(i8042_device::upi41_master_r), FUNC(i8042_device::upi41_master_w)).umask16(0x00ff); @@ -825,7 +926,7 @@ void mindset_state::mindset(machine_config &config) I8272A(config, m_fdc, 16_MHz_XTAL/2, true); m_fdc->intrq_wr_callback().set(FUNC(mindset_state::fdc_int_w)); - m_fdc->drq_wr_callback().set(m_maincpu, FUNC(i80186_cpu_device::drq1_w)); + m_fdc->drq_wr_callback().set([this](int state) { m_fdc_drq = state; m_maincpu->drq1_w(m_fdc_drq || m_trap_drq); }); m_fdc->set_ready_line_connected(false); FLOPPY_CONNECTOR(config, m_fdco[0], pc_dd_floppies, "525dd", mindset_state::floppy_formats); FLOPPY_CONNECTOR(config, m_fdco[1], pc_dd_floppies, "525dd", mindset_state::floppy_formats); -- cgit v1.2.3-70-g09d2 From ecc9e29489fec7aad41e125d192bf4b9f85f8a00 Mon Sep 17 00:00:00 2001 From: hap Date: Wed, 10 Jul 2019 16:11:22 +0200 Subject: risc2500: i broke the lcd screen in prev commit (nw) --- src/mame/layout/saitek_risc2500.lay | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mame/layout/saitek_risc2500.lay b/src/mame/layout/saitek_risc2500.lay index 3b85a193a8b..45796b14371 100644 --- a/src/mame/layout/saitek_risc2500.lay +++ b/src/mame/layout/saitek_risc2500.lay @@ -355,7 +355,7 @@ - + @@ -388,8 +388,8 @@ - - + + -- cgit v1.2.3-70-g09d2 From 143efb2ec8df1afdc68b900f9f530382e94feb66 Mon Sep 17 00:00:00 2001 From: hap Date: Wed, 10 Jul 2019 18:11:48 +0200 Subject: model2: change .lay workaround, also fix lightgun cursor not showing in vcop (create "screen" before "ioboard") (nw) --- src/mame/drivers/model2.cpp | 6 +++--- src/mame/layout/coco3.lay | 4 ++-- src/mame/layout/model1io2.lay | 6 +++--- src/mame/layout/sms1.lay | 5 ++--- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/mame/drivers/model2.cpp b/src/mame/drivers/model2.cpp index 196a75344e9..caa20f2a83c 100644 --- a/src/mame/drivers/model2.cpp +++ b/src/mame/drivers/model2.cpp @@ -2531,6 +2531,9 @@ void model2o_state::model2o(machine_config &config) NVRAM(config, "backup1", nvram_device::DEFAULT_ALL_1); + model2_timers(config); + model2_screen(config); + model1io_device &ioboard(SEGA_MODEL1IO(config, "ioboard", 0)); ioboard.set_default_bios_tag("epr14869c"); ioboard.read_callback().set("dpram", FUNC(mb8421_device::left_r)); @@ -2540,9 +2543,6 @@ void model2o_state::model2o(machine_config &config) MB8421(config, "dpram", 0); - model2_timers(config); - model2_screen(config); - SEGAM1AUDIO(config, m_m1audio, 0); m_m1audio->rxd_handler().set(m_uart, FUNC(i8251_device::write_rxd)); diff --git a/src/mame/layout/coco3.lay b/src/mame/layout/coco3.lay index 5bb06a96148..24634e4ab52 100644 --- a/src/mame/layout/coco3.lay +++ b/src/mame/layout/coco3.lay @@ -1,12 +1,12 @@ - + - + diff --git a/src/mame/layout/model1io2.lay b/src/mame/layout/model1io2.lay index 1a552d3352c..60b1d49cc97 100644 --- a/src/mame/layout/model1io2.lay +++ b/src/mame/layout/model1io2.lay @@ -18,12 +18,12 @@ - - - + + + diff --git a/src/mame/layout/sms1.lay b/src/mame/layout/sms1.lay index c6988743e6f..93a8c03a3cf 100644 --- a/src/mame/layout/sms1.lay +++ b/src/mame/layout/sms1.lay @@ -1,14 +1,13 @@ - - - + + -- cgit v1.2.3-70-g09d2 From e8eb6bab4a5ab52fd773f6f36d4b4a95a850d1f4 Mon Sep 17 00:00:00 2001 From: hap Date: Wed, 10 Jul 2019 19:25:51 +0200 Subject: seta: clickable artwork flag for some games (nw) --- src/mame/drivers/seta.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mame/drivers/seta.cpp b/src/mame/drivers/seta.cpp index dda4504a30e..983d64cada1 100644 --- a/src/mame/drivers/seta.cpp +++ b/src/mame/drivers/seta.cpp @@ -12082,7 +12082,7 @@ GAME( 1989, metafox, 0, metafox, metafox, seta_state, init_meta /* 68000 */ -GAME( 1989?,setaroul, 0, setaroul, setaroul, setaroul_state, empty_init, ROT270, "Visco", "The Roulette (Visco)", 0 ) +GAME( 1989?,setaroul, 0, setaroul, setaroul, setaroul_state, empty_init, ROT270, "Visco", "The Roulette (Visco)", MACHINE_CLICKABLE_ARTWORK ) GAME( 1989, drgnunit, 0, drgnunit, drgnunit, seta_state, empty_init, ROT0, "Seta", "Dragon Unit / Castle of Dragon", 0 ) @@ -12095,9 +12095,9 @@ GAME( 1990, thunderlbl2,thunderl,thunderlbl,thunderl, seta_state, empty_ini GAME( 1994, wiggie, 0, wiggie, thunderl, seta_state, init_wiggie, ROT270, "Promat", "Wiggie Waggie", MACHINE_IMPERFECT_GRAPHICS ) // hack of Thunder & Lightning GAME( 1994, superbar, wiggie, superbar, thunderl, seta_state, init_wiggie, ROT270, "Promat", "Super Bar", MACHINE_IMPERFECT_GRAPHICS ) // hack of Thunder & Lightning -GAME( 1990, jockeyc, 0, jockeyc, jockeyc, jockeyc_state, empty_init, ROT0, "Seta (Visco license)", "Jockey Club (v1.18)", 0 ) -GAME( 1993, inttoote2, jockeyc, jockeyc, jockeyc, jockeyc_state, empty_init, ROT0, "bootleg (Coinmaster)", "International Toote II (v1.24, P387.V01)", 0 ) -GAME( 1998, inttoote, jockeyc, inttoote, inttoote, jockeyc_state, init_inttoote, ROT0, "bootleg (Coinmaster)", "International Toote (Germany, P523.V01)", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) +GAME( 1990, jockeyc, 0, jockeyc, jockeyc, jockeyc_state, empty_init, ROT0, "Seta (Visco license)", "Jockey Club (v1.18)", MACHINE_CLICKABLE_ARTWORK ) +GAME( 1993, inttoote2, jockeyc, jockeyc, jockeyc, jockeyc_state, empty_init, ROT0, "bootleg (Coinmaster)", "International Toote II (v1.24, P387.V01)", MACHINE_CLICKABLE_ARTWORK ) +GAME( 1998, inttoote, jockeyc, inttoote, inttoote, jockeyc_state, init_inttoote, ROT0, "bootleg (Coinmaster)", "International Toote (Germany, P523.V01)", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION | MACHINE_CLICKABLE_ARTWORK ) GAME( 1991, rezon, 0, rezon, rezon, seta_state, init_rezon, ROT0, "Allumer", "Rezon", 0 ) GAME( 1992, rezont, rezon, rezon, rezont, seta_state, init_rezon, ROT0, "Allumer (Taito license)", "Rezon (Taito)", 0 ) -- cgit v1.2.3-70-g09d2 From 1604863c0784b618f6a443299babc8a8ba01f178 Mon Sep 17 00:00:00 2001 From: MooglyGuy Date: Wed, 10 Jul 2019 20:07:45 +0200 Subject: -core: Removed TEXFORMAT_PALETTEA16. [Ryan Holtz] --- src/devices/machine/laserdsc.cpp | 26 +-- src/devices/machine/laserdsc.h | 24 +-- src/emu/render.cpp | 6 +- src/emu/rendersw.hxx | 100 --------- src/emu/screen.h | 3 +- src/mame/drivers/alg.cpp | 2 - src/mame/drivers/deco_ld.cpp | 71 +++---- src/mame/drivers/dlair.cpp | 9 +- src/mame/drivers/esh.cpp | 6 +- src/mame/drivers/firefox.cpp | 26 +-- src/mame/drivers/gottlieb.cpp | 2 - src/mame/drivers/gpworld.cpp | 1 - src/mame/drivers/istellar.cpp | 14 +- src/mame/drivers/konblands.cpp | 12 +- src/mame/drivers/lgp.cpp | 13 +- src/mame/drivers/segald.cpp | 25 +-- src/mame/drivers/superdq.cpp | 1 - .../render/bgfx/shaders/chains/lottes/fs.sc | 236 +++++++++++++++++++++ .../render/bgfx/shaders/chains/lottes/fs_vert.sc | 236 +++++++++++++++++++++ .../bgfx/shaders/chains/lottes/varying.def.sc | 9 + .../render/bgfx/shaders/chains/lottes/vs.sc | 26 +++ .../render/bgfx/shaders/chains/lottes/vs_vert.sc | 26 +++ src/osd/modules/render/bgfxutil.cpp | 3 - src/osd/modules/render/copyutil.h | 9 - src/osd/modules/render/d3d/d3dcomm.h | 1 - src/osd/modules/render/draw13.cpp | 3 - src/osd/modules/render/drawd3d.cpp | 21 +- src/osd/modules/render/drawogl.cpp | 31 --- 28 files changed, 618 insertions(+), 324 deletions(-) create mode 100644 src/osd/modules/render/bgfx/shaders/chains/lottes/fs.sc create mode 100644 src/osd/modules/render/bgfx/shaders/chains/lottes/fs_vert.sc create mode 100644 src/osd/modules/render/bgfx/shaders/chains/lottes/varying.def.sc create mode 100644 src/osd/modules/render/bgfx/shaders/chains/lottes/vs.sc create mode 100644 src/osd/modules/render/bgfx/shaders/chains/lottes/vs_vert.sc diff --git a/src/devices/machine/laserdsc.cpp b/src/devices/machine/laserdsc.cpp index 7794ebb026e..436a238fe88 100644 --- a/src/devices/machine/laserdsc.cpp +++ b/src/devices/machine/laserdsc.cpp @@ -92,8 +92,7 @@ laserdisc_device::laserdisc_device(const machine_config &mconfig, device_type ty m_videopalette(nullptr), m_overenable(false), m_overindex(0), - m_overtex(nullptr), - m_overlay_palette(*this, finder_base::DUMMY_TAG) + m_overtex(nullptr) { // initialize overlay_config m_orig_config.m_overposx = m_orig_config.m_overposy = 0.0f; @@ -157,7 +156,7 @@ uint32_t laserdisc_device::screen_update(screen_device &screen, bitmap_rgb32 &bi { // handle the overlay if present screen_bitmap &overbitmap = m_overbitmap[m_overindex]; - if (overbitmap.valid() && (!m_overupdate_ind16.isnull() || !m_overupdate_rgb32.isnull())) + if (overbitmap.valid() && !m_overupdate_rgb32.isnull()) { // scale the cliprect to the overlay size rectangle clip(m_overclip); @@ -167,10 +166,7 @@ uint32_t laserdisc_device::screen_update(screen_device &screen, bitmap_rgb32 &bi clip.max_y = (cliprect.max_y + 1) * overbitmap.height() / bitmap.height() - 1; // call the update callback - if (!m_overupdate_ind16.isnull()) - m_overupdate_ind16(screen, overbitmap.as_ind16(), clip); - else - m_overupdate_rgb32(screen, overbitmap.as_rgb32(), clip); + m_overupdate_rgb32(screen, overbitmap.as_rgb32(), clip); } // if this is the last update, do the rendering @@ -218,10 +214,6 @@ uint32_t laserdisc_device::screen_update(screen_device &screen, bitmap_rgb32 &bi void laserdisc_device::device_start() { - // if we have a palette and it's not started, wait for it - if (m_overlay_palette != nullptr && !m_overlay_palette->started()) - throw device_missing_dependencies(); - // initialize the various pieces init_disc(); init_video(); @@ -278,9 +270,6 @@ void laserdisc_device::device_reset() void laserdisc_device::device_validity_check(validity_checker &valid) const { - texture_format texformat = !m_overupdate_ind16.isnull() ? TEXFORMAT_PALETTE16 : TEXFORMAT_RGB32; - if (m_overlay_palette == nullptr && texformat == TEXFORMAT_PALETTE16) - osd_printf_error("Overlay screen does not have palette defined\n"); } //------------------------------------------------- @@ -741,19 +730,12 @@ void laserdisc_device::init_video() if (m_overenable) { // bind our handlers - m_overupdate_ind16.bind_relative_to(*owner()); m_overupdate_rgb32.bind_relative_to(*owner()); - // configure bitmap formats - bitmap_format format = !m_overupdate_ind16.isnull() ? BITMAP_FORMAT_IND16 : BITMAP_FORMAT_RGB32; - texture_format texformat = !m_overupdate_ind16.isnull() ? TEXFORMAT_PALETTEA16 : TEXFORMAT_ARGB32; - // allocate overlay bitmaps for (auto & elem : m_overbitmap) { - elem.set_format(format, texformat); - if (format==BITMAP_FORMAT_IND16) - elem.set_palette(m_overlay_palette->palette()); + elem.set_format(BITMAP_FORMAT_RGB32, TEXFORMAT_ARGB32); elem.resize(m_overwidth, m_overheight); } diff --git a/src/devices/machine/laserdsc.h b/src/devices/machine/laserdsc.h index 510d22366ec..78f4ad2702a 100644 --- a/src/devices/machine/laserdsc.h +++ b/src/devices/machine/laserdsc.h @@ -117,48 +117,29 @@ public: uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); // configuration - bool overlay_configured() const { return (m_overwidth > 0 && m_overheight > 0 && (!m_overupdate_ind16.isnull() || !m_overupdate_rgb32.isnull())); } + bool overlay_configured() const { return (m_overwidth > 0 && m_overheight > 0 && (!m_overupdate_rgb32.isnull())); } void get_overlay_config(laserdisc_overlay_config &config) { config = static_cast(*this); } void set_overlay_config(const laserdisc_overlay_config &config) { static_cast(*this) = config; } // configuration helpers template void set_get_disc(T &&... args) { m_getdisc_callback = get_disc_delegate(std::forward(args)...); } template void set_audio(T &&... args) { m_audio_callback = audio_delegate(std::forward(args)...); } - template // FIXME: these should be aware of current device for resolving the tag - void set_overlay(uint32_t width, uint32_t height, u32 (FunctionClass::*callback)(screen_device &, bitmap_ind16 &, const rectangle &), const char *name) - { - set_overlay(width, height, screen_update_ind16_delegate(callback, name, nullptr, static_cast(nullptr))); - } template void set_overlay(uint32_t width, uint32_t height, u32 (FunctionClass::*callback)(screen_device &, bitmap_rgb32 &, const rectangle &), const char *name) { set_overlay(width, height, screen_update_rgb32_delegate(callback, name, nullptr, static_cast(nullptr))); } template - void set_overlay(uint32_t width, uint32_t height, const char *devname, u32 (FunctionClass::*callback)(screen_device &, bitmap_ind16 &, const rectangle &), const char *name) - { - set_overlay(width, height, screen_update_ind16_delegate(callback, name, devname, static_cast(nullptr))); - } - template void set_overlay(uint32_t width, uint32_t height, const char *devname, u32 (FunctionClass::*callback)(screen_device &, bitmap_rgb32 &, const rectangle &), const char *name) { set_overlay(width, height, screen_update_rgb32_delegate(callback, name, devname, static_cast(nullptr))); } - void set_overlay(uint32_t width, uint32_t height, screen_update_ind16_delegate &&update) - { - m_overwidth = width; - m_overheight = height; - m_overclip.set(0, width - 1, 0, height - 1); - m_overupdate_ind16 = std::move(update); - m_overupdate_rgb32 = screen_update_rgb32_delegate(); - } void set_overlay(uint32_t width, uint32_t height, screen_update_rgb32_delegate &&update) { m_overwidth = width; m_overheight = height; m_overclip.set(0, width - 1, 0, height - 1); - m_overupdate_ind16 = screen_update_ind16_delegate(); m_overupdate_rgb32 = std::move(update); } void set_overlay_clip(int32_t minx, int32_t maxx, int32_t miny, int32_t maxy) { m_overclip.set(minx, maxx, miny, maxy); } @@ -172,7 +153,6 @@ public: m_orig_config.m_overscalex = m_overscalex = scalex; m_orig_config.m_overscaley = m_overscaley = scaley; } - template void set_overlay_palette(T &&tag) { m_overlay_palette.set_tag(std::forward(tag)); } protected: // timer IDs @@ -297,7 +277,6 @@ private: uint32_t m_overwidth; // overlay screen width uint32_t m_overheight; // overlay screen height rectangle m_overclip; // overlay visarea - screen_update_ind16_delegate m_overupdate_ind16; // overlay update delegate screen_update_rgb32_delegate m_overupdate_rgb32; // overlay update delegate // disc parameters @@ -351,7 +330,6 @@ private: screen_bitmap m_overbitmap[2]; // overlay bitmaps int m_overindex; // index of the overlay bitmap render_texture * m_overtex; // texture for the overlay - optional_device m_overlay_palette; // overlay screen palette }; // iterator - interface iterator works for subclasses too diff --git a/src/emu/render.cpp b/src/emu/render.cpp index 34d29285162..e896c3748f1 100644 --- a/src/emu/render.cpp +++ b/src/emu/render.cpp @@ -361,7 +361,7 @@ void render_texture::set_bitmap(bitmap_t &bitmap, const rectangle &sbounds, text assert(bitmap.cliprect().contains(sbounds)); // ensure we have a valid palette for palettized modes - if (format == TEXFORMAT_PALETTE16 || format == TEXFORMAT_PALETTEA16) + if (format == TEXFORMAT_PALETTE16) assert(bitmap.palette() != nullptr); // invalidate references to the old bitmap @@ -501,7 +501,6 @@ const rgb_t *render_texture::get_adjusted_palette(render_container &container) switch (m_format) { case TEXFORMAT_PALETTE16: - case TEXFORMAT_PALETTEA16: assert(m_bitmap->palette() != nullptr); @@ -684,7 +683,6 @@ const rgb_t *render_container::bcg_lookup_table(int texformat, palette_t *palett switch (texformat) { case TEXFORMAT_PALETTE16: - case TEXFORMAT_PALETTEA16: if (m_palclient == nullptr) // if adjusted palette hasn't been created yet, create it { m_palclient = std::make_unique(*palette); @@ -2866,7 +2864,7 @@ void render_target::add_clear_and_optimize_primitive_list(render_primitive_list case render_primitive::QUAD: { // stop when we hit an alpha texture - if (PRIMFLAG_GET_TEXFORMAT(prim.flags) == TEXFORMAT_ARGB32 || PRIMFLAG_GET_TEXFORMAT(prim.flags) == TEXFORMAT_PALETTEA16) + if (PRIMFLAG_GET_TEXFORMAT(prim.flags) == TEXFORMAT_ARGB32) goto done; // if this quad can't be cleanly removed from the extents list, we're done diff --git a/src/emu/rendersw.hxx b/src/emu/rendersw.hxx index 32df8b833ff..8dbf28b35b3 100644 --- a/src/emu/rendersw.hxx +++ b/src/emu/rendersw.hxx @@ -795,102 +795,6 @@ private: - //************************************************************************** - // 16-BIT ALPHA PALETTE RASTERIZERS - //************************************************************************** - - //------------------------------------------------- - // draw_quad_palettea16_alpha - perform - // rasterization using standard alpha blending - //------------------------------------------------- - - static void draw_quad_palettea16_alpha(const render_primitive &prim, _PixelType *dstdata, u32 pitch, quad_setup_data &setup) - { - s32 dudx = setup.dudx; - s32 dvdx = setup.dvdx; - s32 endx = setup.endx; - - // ensure all parameters are valid - assert(prim.texture.palette != nullptr); - - // fast case: no coloring, no alpha - if (prim.color.r >= 1.0f && prim.color.g >= 1.0f && prim.color.b >= 1.0f && is_opaque(prim.color.a)) - { - // loop over rows - for (s32 y = setup.starty; y < setup.endy; y++) - { - _PixelType *dest = dstdata + y * pitch + setup.startx; - s32 curu = setup.startu + (y - setup.starty) * setup.dudy; - s32 curv = setup.startv + (y - setup.starty) * setup.dvdy; - - // loop over cols - for (s32 x = setup.startx; x < endx; x++) - { - u32 pix = get_texel_palette16a(prim.texture, curu, curv); - u32 ta = pix >> 24; - if (ta != 0) - { - u32 dpix = _NoDestRead ? 0 : *dest; - u32 invta = 0x100 - ta; - u32 r = (source32_r(pix) * ta + dest_r(dpix) * invta) >> 8; - u32 g = (source32_g(pix) * ta + dest_g(dpix) * invta) >> 8; - u32 b = (source32_b(pix) * ta + dest_b(dpix) * invta) >> 8; - - *dest = dest_assemble_rgb(r, g, b); - } - dest++; - curu += dudx; - curv += dvdx; - } - } - } - - // alpha and/or coloring case - else - { - u32 sr = u32(256.0f * prim.color.r); - u32 sg = u32(256.0f * prim.color.g); - u32 sb = u32(256.0f * prim.color.b); - u32 sa = u32(256.0f * prim.color.a); - - // clamp R,G,B and inverse A to 0-256 range - if (sr > 0x100) { if (s32(sr) < 0) sr = 0; else sr = 0x100; } - if (sg > 0x100) { if (s32(sg) < 0) sg = 0; else sg = 0x100; } - if (sb > 0x100) { if (s32(sb) < 0) sb = 0; else sb = 0x100; } - if (sa > 0x100) { if (s32(sa) < 0) sa = 0; else sa = 0x100; } - - // loop over rows - for (s32 y = setup.starty; y < setup.endy; y++) - { - _PixelType *dest = dstdata + y * pitch + setup.startx; - s32 curu = setup.startu + (y - setup.starty) * setup.dudy; - s32 curv = setup.startv + (y - setup.starty) * setup.dvdy; - - // loop over cols - for (s32 x = setup.startx; x < endx; x++) - { - u32 pix = get_texel_palette16a(prim.texture, curu, curv); - u32 ta = (pix >> 24) * sa; - if (ta != 0) - { - u32 dpix = _NoDestRead ? 0 : *dest; - u32 invsta = (0x10000 - ta) << 8; - u32 r = (source32_r(pix) * sr * ta + dest_r(dpix) * invsta) >> 24; - u32 g = (source32_g(pix) * sg * ta + dest_g(dpix) * invsta) >> 24; - u32 b = (source32_b(pix) * sb * ta + dest_b(dpix) * invsta) >> 24; - - *dest = dest_assemble_rgb(r, g, b); - } - dest++; - curu += dudx; - curv += dvdx; - } - } - } - } - - - //************************************************************************** // 16-BIT YUY RASTERIZERS //************************************************************************** @@ -1884,10 +1788,6 @@ private: draw_quad_palette16_add(prim, dstdata, pitch, setup); break; - case PRIMFLAG_TEXFORMAT(TEXFORMAT_PALETTEA16) | PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA): - draw_quad_palettea16_alpha(prim, dstdata, pitch, setup); - break; - case PRIMFLAG_TEXFORMAT(TEXFORMAT_YUY16) | PRIMFLAG_BLENDMODE(BLENDMODE_NONE): case PRIMFLAG_TEXFORMAT(TEXFORMAT_YUY16) | PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA): draw_quad_yuy16_none(prim, dstdata, pitch, setup); diff --git a/src/emu/screen.h b/src/emu/screen.h index a2b0b5eb0a4..98d049be8ae 100644 --- a/src/emu/screen.h +++ b/src/emu/screen.h @@ -33,8 +33,7 @@ enum screen_type_enum enum texture_format { TEXFORMAT_UNDEFINED = 0, // require a format to be specified - TEXFORMAT_PALETTE16, // 16bpp palettized, alpha ignored - TEXFORMAT_PALETTEA16, // 16bpp palettized, alpha respected + TEXFORMAT_PALETTE16, // 16bpp palettized, no alpha TEXFORMAT_RGB32, // 32bpp 8-8-8 RGB TEXFORMAT_ARGB32, // 32bpp 8-8-8-8 ARGB TEXFORMAT_YUY16 // 16bpp 8-8 Y/Cb, Y/Cr in sequence diff --git a/src/mame/drivers/alg.cpp b/src/mame/drivers/alg.cpp index e341d5dc1af..2cb251611c7 100644 --- a/src/mame/drivers/alg.cpp +++ b/src/mame/drivers/alg.cpp @@ -322,8 +322,6 @@ void alg_state::alg_r1(machine_config &config) m_laserdisc->set_screen("screen"); m_laserdisc->set_overlay(512*2, 262, FUNC(amiga_state::screen_update_amiga)); m_laserdisc->set_overlay_clip((129-8)*2, (449+8-1)*2, 44-8, 244+8-1); - m_laserdisc->set_overlay_palette(m_palette); - PALETTE(config, m_palette, FUNC(alg_state::amiga_palette), 4097); diff --git a/src/mame/drivers/deco_ld.cpp b/src/mame/drivers/deco_ld.cpp index 04f2dced8be..553b43ece79 100644 --- a/src/mame/drivers/deco_ld.cpp +++ b/src/mame/drivers/deco_ld.cpp @@ -163,17 +163,16 @@ private: DECLARE_READ8_MEMBER(sound_status_r); DECLARE_WRITE8_MEMBER(decold_sound_cmd_w); virtual void machine_start() override; - uint32_t screen_update_rblaster(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_rblaster(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(sound_interrupt); - void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t *spriteram, uint16_t tile_bank ); + void draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint8_t *spriteram, uint16_t tile_bank ); void rblaster_map(address_map &map); void rblaster_sound_map(address_map &map); }; -void deco_ld_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t *spriteram, uint16_t tile_bank ) +void deco_ld_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, uint8_t *spriteram, uint16_t tile_bank ) { gfx_element *gfx = m_gfxdecode->gfx(1); - int i,spr_offs,x,y,col,fx,fy; /* [+0] ---- -x-- flip X @@ -184,68 +183,67 @@ void deco_ld_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect [+3] x coord */ - for(i=0;i<0x20;i+=4) + for (int i = 0; i < 0x20; i += 4) { - if(~spriteram[i+0] & 1) + if (~spriteram[i] & 1) continue; - spr_offs = spriteram[i+1]|tile_bank; - x = spriteram[i+3]; - y = spriteram[i+2]; - col = 6; /* TODO */ - fx = (spriteram[i+0] & 0x04) ? 1 : 0; - fy = (spriteram[i+0] & 0x02) ? 1 : 0; + int spr_offs = spriteram[i + 1] | tile_bank; + int x = spriteram[i + 3]; + int y = spriteram[i + 2]; + int col = 6; /* TODO */ + int fx = (spriteram[i] & 0x04) ? 1 : 0; + int fy = (spriteram[i] & 0x02) ? 1 : 0; - gfx->transpen(bitmap,cliprect,spr_offs,col,fx,fy,x,y,0); + gfx->transpen(bitmap, cliprect, spr_offs, col, fx, fy, x, y, 0); } - for(i=0x3e0;i<0x400;i+=4) + for (int i = 0x3e0; i < 0x400; i += 4) { - if(~spriteram[i+0] & 1) + if (~spriteram[i] & 1) continue; - spr_offs = spriteram[i+1]|tile_bank; - x = spriteram[i+3]; - y = spriteram[i+2]; - col = 6; /* TODO */ - fx = (spriteram[i+0] & 0x04) ? 1 : 0; - fy = (spriteram[i+0] & 0x02) ? 1 : 0; + int spr_offs = spriteram[i + 1] | tile_bank; + int x = spriteram[i + 3]; + int y = spriteram[i + 2]; + int col = 6; /* TODO */ + int fx = (spriteram[i] & 0x04) ? 1 : 0; + int fy = (spriteram[i] & 0x02) ? 1 : 0; - gfx->transpen(bitmap,cliprect,spr_offs,col,fx,fy,x,y,0); + gfx->transpen(bitmap, cliprect, spr_offs, col, fx, fy, x, y, 0); } } -uint32_t deco_ld_state::screen_update_rblaster(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t deco_ld_state::screen_update_rblaster(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { gfx_element *gfx = m_gfxdecode->gfx(0); - int y,x; bitmap.fill(0, cliprect); - draw_sprites(bitmap,cliprect,m_vram1,0x000); - draw_sprites(bitmap,cliprect,m_vram0,0x100); + draw_sprites(bitmap, cliprect, m_vram1, 0x000); + draw_sprites(bitmap, cliprect, m_vram0, 0x100); - for (y=0;y<32;y++) + for (int y = 0; y < 32; y++) { - for (x=0;x<32;x++) + for (int x = 0; x < 32; x++) { - int attr = m_attr0[x+y*32]; - int tile = m_vram0[x+y*32] | ((attr & 3) << 8); + int attr = m_attr0[x + y * 32]; + int tile = m_vram0[x + y * 32] | ((attr & 3) << 8); int colour = (6 & 0x7); /* TODO */ - gfx->transpen(bitmap,cliprect,tile|0x400,colour,0,0,x*8,y*8,0); + gfx->transpen(bitmap, cliprect, tile | 0x400, colour, 0, 0, x * 8, y * 8, 0); } } - for (y=0;y<32;y++) + for (int y = 0; y < 32; y++) { - for (x=0;x<32;x++) + for (int x = 0; x < 32; x++) { - int attr = m_attr1[x+y*32]; - int tile = m_vram1[x+y*32] | ((attr & 3) << 8); + int attr = m_attr1[x + y * 32]; + int tile = m_vram1[x + y * 32] | ((attr & 3) << 8); int colour = (6 & 0x7); /* TODO */ - gfx->transpen(bitmap,cliprect,tile,colour,0,0,x*8,y*8,0); + gfx->transpen(bitmap, cliprect, tile, colour, 0, 0, x * 8, y * 8, 0); } } @@ -478,7 +476,6 @@ void deco_ld_state::rblaster(machine_config &config) SONY_LDP1000(config, m_laserdisc, 0); m_laserdisc->set_overlay(256, 256, FUNC(deco_ld_state::screen_update_rblaster)); //m_laserdisc->set_overlay_clip(0, 256-1, 8, 240-1); - m_laserdisc->set_overlay_palette(m_palette); m_laserdisc->add_route(0, "lspeaker", 1.0); m_laserdisc->add_route(1, "rspeaker", 1.0); diff --git a/src/mame/drivers/dlair.cpp b/src/mame/drivers/dlair.cpp index c14042dd9ce..4c2ef3c9511 100644 --- a/src/mame/drivers/dlair.cpp +++ b/src/mame/drivers/dlair.cpp @@ -128,7 +128,7 @@ private: virtual void machine_start() override; virtual void machine_reset() override; void dleuro_palette(palette_device &palette) const; - uint32_t screen_update_dleuro(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_dleuro(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_WRITE_LINE_MEMBER(write_speaker); void dleuro_io_map(address_map &map); @@ -220,16 +220,18 @@ void dlair_state::dleuro_palette(palette_device &palette) const * *************************************/ -uint32_t dlair_state::screen_update_dleuro(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t dlair_state::screen_update_dleuro(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { // redraw the overlay for (int y = 0; y < 32; y++) + { for (int x = 0; x < 32; x++) { uint8_t const *const base = &m_videoram[y * 64 + x * 2 + 1]; // TODO: opaque? - m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, base[0], base[1], 0, 0, 10 * x, 16 * y); + m_gfxdecode->gfx(0)->opaque(bitmap, cliprect, base[0], base[1], 0, 0, 10 * x, 16 * y); } + } return 0; } @@ -782,7 +784,6 @@ void dlair_state::dleuro(machine_config &config) PHILIPS_22VP932(config, m_22vp932, 0); m_22vp932->set_overlay(256, 256, FUNC(dlair_state::screen_update_dleuro)); - m_22vp932->set_overlay_palette(m_palette); m_22vp932->add_route(0, "lspeaker", 1.0); m_22vp932->add_route(1, "rspeaker", 1.0); diff --git a/src/mame/drivers/esh.cpp b/src/mame/drivers/esh.cpp index ad1335700c0..38a52dcf039 100644 --- a/src/mame/drivers/esh.cpp +++ b/src/mame/drivers/esh.cpp @@ -90,7 +90,6 @@ private: /* VIDEO GOODS */ uint32_t esh_state::screen_update_esh(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - int charx, chary; const uint8_t pal_bank = m_ld_video_visible == true ? 0x10 : 0x00; const uint32_t trans_mask = m_ld_video_visible == true ? 0 : -1; gfx_element *gfx;// = m_gfxdecode->gfx(0); @@ -100,9 +99,9 @@ uint32_t esh_state::screen_update_esh(screen_device &screen, bitmap_rgb32 &bitma /* Draw tiles */ - for (charx = 0; charx < 32; charx++) + for (int charx = 0; charx < 32; charx++) { - for (chary = 0; chary < 32; chary++) + for (int chary = 0; chary < 32; chary++) { int current_screen_character = (chary*32) + charx; @@ -372,7 +371,6 @@ void esh_state::esh(machine_config &config) PIONEER_LDV1000(config, m_laserdisc, 0); m_laserdisc->command_strobe_callback().set(FUNC(esh_state::ld_command_strobe_cb)); m_laserdisc->set_overlay(256, 256, FUNC(esh_state::screen_update_esh)); - m_laserdisc->set_overlay_palette(m_palette); m_laserdisc->add_route(0, "lspeaker", 1.0); m_laserdisc->add_route(1, "rspeaker", 1.0); diff --git a/src/mame/drivers/firefox.cpp b/src/mame/drivers/firefox.cpp index 60f32448ccb..a2bd450efd6 100644 --- a/src/mame/drivers/firefox.cpp +++ b/src/mame/drivers/firefox.cpp @@ -257,35 +257,32 @@ void firefox_state::video_start() uint32_t firefox_state::screen_update_firefox(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - int sprite; int gfxtop = screen.visible_area().top(); bitmap.fill(m_palette->pen_color(256), cliprect); - for( sprite = 0; sprite < 32; sprite++ ) + for (int sprite = 0; sprite < 32; sprite++) { - uint8_t *sprite_data = m_spriteram + ( 0x200 * m_sprite_bank ) + ( sprite * 16 ); - int flags = sprite_data[ 0 ]; - int y = sprite_data[ 1 ] + ( 256 * ( ( flags >> 0 ) & 1 ) ); - int x = sprite_data[ 2 ] + ( 256 * ( ( flags >> 1 ) & 1 ) ); + uint8_t *sprite_data = m_spriteram + (0x200 * m_sprite_bank) + (sprite * 16); + int flags = sprite_data[0]; + int y = sprite_data[1] + (256 * ((flags >> 0) & 1)); + int x = sprite_data[2] + (256 * ((flags >> 1) & 1)); - if( x != 0 ) + if (x != 0) { - int row; - - for( row = 0; row < 8; row++ ) + for (int row = 0; row < 8; row++) { - int color = ( flags >> 2 ) & 0x03; + int color = (flags >> 2) & 0x03; int flipy = flags & 0x10; int flipx = flags & 0x20; - int code = sprite_data[ 15 - row ] + ( 256 * ( ( flags >> 6 ) & 3 ) ); + int code = sprite_data[15 - row] + (256 * ((flags >> 6) & 3)); - m_gfxdecode->gfx( 1 )->transpen(bitmap,cliprect, code, color, flipx, flipy, x + 8, gfxtop + 500 - y - ( row * 16 ), 0 ); + m_gfxdecode->gfx(1)->transpen(bitmap, cliprect, code, color, flipx, flipy, x + 8, gfxtop + 500 - y - (row * 16), 0); } } } - m_bgtiles->draw(screen, bitmap, cliprect, 0, 0 ); + m_bgtiles->draw(screen, bitmap, cliprect, 0, 0); return 0; } @@ -693,7 +690,6 @@ void firefox_state::firefox(machine_config &config) PHILIPS_22VP931(config, m_laserdisc, 0); m_laserdisc->set_overlay(64*8, 525, FUNC(firefox_state::screen_update_firefox)); m_laserdisc->set_overlay_clip(7*8, 53*8-1, 44, 480+44); - m_laserdisc->set_overlay_palette(m_palette); m_laserdisc->add_route(0, "lspeaker", 0.50); m_laserdisc->add_route(1, "rspeaker", 0.50); m_laserdisc->add_ntsc_screen(config, "screen"); diff --git a/src/mame/drivers/gottlieb.cpp b/src/mame/drivers/gottlieb.cpp index ba5f2b9f230..25c0bdb61d5 100644 --- a/src/mame/drivers/gottlieb.cpp +++ b/src/mame/drivers/gottlieb.cpp @@ -1802,7 +1802,6 @@ void gottlieb_state::g2laser(machine_config &config) m_laserdisc->set_audio(FUNC(gottlieb_state::laserdisc_audio_process), this); m_laserdisc->set_overlay(GOTTLIEB_VIDEO_HCOUNT, GOTTLIEB_VIDEO_VCOUNT, FUNC(gottlieb_state::screen_update)); m_laserdisc->set_overlay_clip(0, GOTTLIEB_VIDEO_HBLANK-1, 0, GOTTLIEB_VIDEO_VBLANK-8); - m_laserdisc->set_overlay_palette("palette"); m_laserdisc->add_route(0, "speaker", 1.0); m_laserdisc->set_screen(m_screen); /* right channel is processed as data */ @@ -1868,7 +1867,6 @@ void gottlieb_state::cobram3(machine_config &config) m_laserdisc->set_audio(FUNC(gottlieb_state::laserdisc_audio_process), this); m_laserdisc->set_overlay(GOTTLIEB_VIDEO_HCOUNT, GOTTLIEB_VIDEO_VCOUNT, FUNC(gottlieb_state::screen_update)); m_laserdisc->set_overlay_clip(0, GOTTLIEB_VIDEO_HBLANK-1, 0, GOTTLIEB_VIDEO_VBLANK-8); - m_laserdisc->set_overlay_palette("palette"); m_laserdisc->add_route(0, "speaker", 1.0); m_laserdisc->set_screen(m_screen); /* right channel is processed as data */ diff --git a/src/mame/drivers/gpworld.cpp b/src/mame/drivers/gpworld.cpp index 90147b8dcdf..df0edef9ad1 100644 --- a/src/mame/drivers/gpworld.cpp +++ b/src/mame/drivers/gpworld.cpp @@ -508,7 +508,6 @@ void gpworld_state::gpworld(machine_config &config) PIONEER_LDV1000(config, m_laserdisc, 0); m_laserdisc->set_overlay(512, 256, FUNC(gpworld_state::screen_update)); - m_laserdisc->set_overlay_palette(m_palette); m_laserdisc->add_route(0, "lspeaker", 1.0); m_laserdisc->add_route(1, "rspeaker", 1.0); diff --git a/src/mame/drivers/istellar.cpp b/src/mame/drivers/istellar.cpp index f31809d82d2..a9d4bd4166d 100644 --- a/src/mame/drivers/istellar.cpp +++ b/src/mame/drivers/istellar.cpp @@ -77,24 +77,21 @@ private: /* VIDEO GOODS */ uint32_t istellar_state::screen_update_istellar(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - int x, y; - /* clear */ bitmap.fill(0, cliprect); /* Draw tiles */ - for (y = 0; y < 32; y++) + for (int y = 0; y < 32; y++) { - for (x = 0; x < 32; x++) + for (int x = 0; x < 32; x++) { - int tile = m_tile_ram[x+y*32]; - int attr = m_tile_control_ram[x+y*32]; + int tile = m_tile_ram[x + y * 32]; + int attr = m_tile_control_ram[x + y * 32]; - m_gfxdecode->gfx(0)->transpen(bitmap,cliprect,tile,attr & 0x0f,0, 0, x*8, y*8, 0); + m_gfxdecode->gfx(0)->transpen(bitmap, cliprect, tile, attr & 0x0f, 0, 0, x * 8, y * 8, 0); } } - /* Draw sprites */ return 0; @@ -298,7 +295,6 @@ void istellar_state::istellar(machine_config &config) PIONEER_LDV1000(config, m_laserdisc, 0); m_laserdisc->set_overlay(256, 256, FUNC(istellar_state::screen_update_istellar)); - m_laserdisc->set_overlay_palette(m_palette); m_laserdisc->add_route(0, "lspeaker", 1.0); m_laserdisc->add_route(1, "rspeaker", 1.0); diff --git a/src/mame/drivers/konblands.cpp b/src/mame/drivers/konblands.cpp index 6078b275cb5..b7ad79ff59b 100644 --- a/src/mame/drivers/konblands.cpp +++ b/src/mame/drivers/konblands.cpp @@ -45,7 +45,7 @@ public: private: // screen updates - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void konblands_palette(palette_device &palette) const; DECLARE_READ8_MEMBER(ldp_r); DECLARE_WRITE8_MEMBER(ldp_w); @@ -102,19 +102,18 @@ void konblands_state::video_start() { } -uint32_t konblands_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) +uint32_t konblands_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { gfx_element *gfx = m_gfxdecode->gfx(0); - int y,x; int count = 0; - for (y=0;y<32;y++) + for (int y = 0; y < 32; y++) { - for (x=0;x<64;x++) + for (int x = 0; x < 64; x++) { uint8_t tile = m_vram[count]; - gfx->opaque(bitmap,cliprect,tile,0,0,0,x*8,y*8); + gfx->opaque(bitmap, cliprect, tile, 0, 0, 0, x * 8, y * 8); count++; } @@ -289,7 +288,6 @@ void konblands_state::konblands(machine_config &config) m_laserdisc->command_strobe_callback().set(FUNC(konblands_state::ld_command_strobe_cb)); // TODO: might be different m_laserdisc->set_overlay(512, 256, FUNC(konblands_state::screen_update)); - m_laserdisc->set_overlay_palette("palette"); /* video hardware */ m_laserdisc->add_ntsc_screen(config, "screen"); diff --git a/src/mame/drivers/lgp.cpp b/src/mame/drivers/lgp.cpp index f2f4fc4d76d..76b21aa9428 100644 --- a/src/mame/drivers/lgp.cpp +++ b/src/mame/drivers/lgp.cpp @@ -124,8 +124,6 @@ private: /* VIDEO GOODS */ uint32_t lgp_state::screen_update_lgp(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - int charx, chary; - /* make color 0 transparent */ m_palette->set_pen_color(0, rgb_t(0,0,0,0)); @@ -133,18 +131,18 @@ uint32_t lgp_state::screen_update_lgp(screen_device &screen, bitmap_rgb32 &bitma bitmap.fill(0, cliprect); /* Draw tiles */ - for (charx = 0; charx < 32; charx++) + for (int charx = 0; charx < 32; charx++) { - for (chary = 0; chary < 32; chary++) + for (int chary = 0; chary < 32; chary++) { - int current_screen_character = (chary*32) + charx; + int current_screen_character = (chary * 32) + charx; /* Somewhere there's a flag that offsets the tilemap by 0x100*x */ /* Palette is likely set somewhere as well (tile_control_ram?) */ - m_gfxdecode->gfx(0)->transpen(bitmap,cliprect, + m_gfxdecode->gfx(0)->transpen(bitmap, cliprect, m_tile_ram[current_screen_character], 0, - 0, 0, charx*8, chary*8, 0); + 0, 0, charx * 8, chary * 8, 0); } } @@ -426,7 +424,6 @@ void lgp_state::lgp(machine_config &config) PIONEER_LDV1000(config, m_laserdisc, 0); m_laserdisc->command_strobe_callback().set(FUNC(lgp_state::ld_command_strobe_cb)); m_laserdisc->set_overlay(256, 256, FUNC(lgp_state::screen_update_lgp)); - m_laserdisc->set_overlay_palette(m_palette); m_laserdisc->add_route(0, "lspeaker", 1.0); m_laserdisc->add_route(1, "rspeaker", 1.0); diff --git a/src/mame/drivers/segald.cpp b/src/mame/drivers/segald.cpp index 8f5f3de8a64..24d4ca2866c 100644 --- a/src/mame/drivers/segald.cpp +++ b/src/mame/drivers/segald.cpp @@ -82,15 +82,13 @@ private: /* VIDEO GOODS */ void segald_state::astron_draw_characters(bitmap_rgb32 &bitmap,const rectangle &cliprect) { - uint8_t characterX, characterY; - - for (characterX = 0; characterX < 32; characterX++) + for (uint8_t character_x = 0; character_x < 32; character_x++) { - for (characterY = 0; characterY < 32; characterY++) + for (uint8_t character_y = 0; character_y < 32; character_y++) { - int current_screen_character = (characterY*32) + characterX; - m_gfxdecode->gfx(0)->transpen(bitmap,cliprect, m_fix_ram[current_screen_character], - 1, 0, 0, characterX*8, characterY*8, 0); + int current_screen_character = (character_y * 32) + character_x; + m_gfxdecode->gfx(0)->transpen(bitmap, cliprect, m_fix_ram[current_screen_character], + 1, 0, 0, character_x * 8, character_y * 8, 0); } } } @@ -107,15 +105,11 @@ void segald_state::astron_draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cl /* const uint8_t SPR_GFXOFS_LO = 6;*/ /* const uint8_t SPR_GFXOFS_HI = 7;*/ - int sx,sy; - int spr_number; - int spr_base; - - for (spr_number = 0; spr_number < 32; spr_number++) + for (int spr_number = 0; spr_number < 32; spr_number++) { - spr_base = 0x10 * spr_number; - sy = m_obj_ram[spr_base + SPR_Y_TOP]; - sx = m_obj_ram[spr_base + SPR_X_LO]; + int spr_base = 0x10 * spr_number; + int sy = m_obj_ram[spr_base + SPR_Y_TOP]; + int sx = m_obj_ram[spr_base + SPR_X_LO]; if (sx != 0 || sy != 0) logerror("Hey! A sprite's not at 0,0 : %d %d", sx, sy); @@ -387,7 +381,6 @@ void segald_state::astron(machine_config &config) PIONEER_LDV1000(config, m_laserdisc, 0); m_laserdisc->set_overlay(256, 256, FUNC(segald_state::screen_update_astron)); - m_laserdisc->set_overlay_palette(m_palette); m_laserdisc->add_route(0, "lspeaker", 1.0); m_laserdisc->add_route(1, "rspeaker", 1.0); diff --git a/src/mame/drivers/superdq.cpp b/src/mame/drivers/superdq.cpp index 3cc3a1267bf..5bc30815604 100644 --- a/src/mame/drivers/superdq.cpp +++ b/src/mame/drivers/superdq.cpp @@ -346,7 +346,6 @@ void superdq_state::superdq(machine_config &config) PIONEER_LDV1000(config, m_laserdisc, 0); m_laserdisc->set_overlay(256, 256, FUNC(superdq_state::screen_update_superdq)); - m_laserdisc->set_overlay_palette(m_palette); m_laserdisc->add_route(0, "lspeaker", 1.0); m_laserdisc->add_route(1, "rspeaker", 1.0); diff --git a/src/osd/modules/render/bgfx/shaders/chains/lottes/fs.sc b/src/osd/modules/render/bgfx/shaders/chains/lottes/fs.sc new file mode 100644 index 00000000000..d7cb93c9124 --- /dev/null +++ b/src/osd/modules/render/bgfx/shaders/chains/lottes/fs.sc @@ -0,0 +1,236 @@ +// +// PUBLIC DOMAIN CRT STYLED SCAN-LINE SHADER +// +// by Timothy Lottes +// +// This is more along the style of a really good CGA arcade monitor. +// With RGB inputs instead of NTSC. +// The shadow mask example has the mask rotated 90 degrees for less chromatic aberration. +// +// Left it unoptimized to show the theory behind the algorithm. +// +// It is an example what I personally would want as a display option for pixel art games. +// Please take and use, change, or whatever. + +//Comment these out to disable the corresponding effect. +//#define VERTICAL //rotates shadow mask effect to fix vertical games on landscape monitors +//#define CURVATURE //Screen curvature effect. +#define YUV //Tint and Saturation adjustments. You adjust the settings in Lottes_CRT.vsh now... +#define GAMMA_CONTRAST_BOOST //Expands contrast and makes image brighter but causes clipping. +#define BLOOM //enables a bloom effect +//#define MASK_APERTURE_GRILL //Only uncomment one of the MASK patterns at a time... +#define MASK_TV +//#define MASK_VGA +//#define ORIGINAL_SCANLINES //Enable to use the original scanlines. +//#define ORIGINAL_HARDPIX //Enable to use the original hardPix calculation. + +//Normal MAME GLSL Uniforms +uniform sampler2D color_texture; +uniform vec2 color_texture_sz; // size of color_texture +uniform vec2 color_texture_pow2_sz; // size of color texture rounded up to power of 2 +uniform vec2 screen_texture_sz; // size of output resolution +uniform vec2 screen_texture_pow2_sz; // size of output resolution rounded up to power of 2 + +//CRT Filter Variables +const float hardScan=-20.0; //-8,-12,-16, etc to make scalines more prominent. +const vec2 warp=vec2(1.0/64.0,1.0/48.0); //adjusts the warp filter (curvature). +const float maskDark=0.4; //Sets how dark a "dark subpixel" is in the aperture pattern. +const float maskLight=1.5; //Sets how dark a "bright subpixel" is in the aperture pattern. +const float hardPix=-6.0; //-1,-2,-4, etc to make the upscaling sharper. +const float hardBloomScan=-2.5; +const float hardBloomPix=-1.75; +const float bloomAmount=1.0/12.0; //Lower this if there is too much bloom! +const float blackClip = 0.02; +const float brightMult = 1.2; +const float maskStrength = 0.6; //This sets the strength of the shadow mask effect +const vec3 gammaBoost = vec3(1.0/1.15, 1.0/1.15, 1.0/1.15); +varying vec3 YUVr; +varying vec3 YUVg; +varying vec3 YUVb; + +//CRT Filter Functions + +// sRGB to Linear. +// Assuing using sRGB typed textures this should not be needed. +float ToLinear1(float c){return(c<=0.04045)?c/12.92:pow((c+0.055)/1.055,2.4);} +vec3 ToLinear(vec3 c){return vec3(ToLinear1(c.r),ToLinear1(c.g),ToLinear1(c.b));} + +// Linear to sRGB. +// Assuing using sRGB typed textures this should not be needed. +float ToSrgb1(float c){return(c<0.0031308?c*12.92:1.055*pow(c,0.41666)-0.055);} +vec3 ToSrgb(vec3 c){return vec3(ToSrgb1(c.r),ToSrgb1(c.g),ToSrgb1(c.b));} + +// Nearest emulated sample given floating point position and texel offset. +// Also zero's off screen. +vec3 Fetch(vec2 pos,vec2 off){ + pos=(floor(pos*color_texture_pow2_sz+off)+0.5)/color_texture_pow2_sz; + //if(max(abs(pos.x-0.5),abs(pos.y-0.5))>0.5)return vec3(0.0,0.0,0.0); + return ToLinear(texture2D(color_texture,pos.xy).rgb);} + +// Distance in emulated pixels to nearest texel. +vec2 Dist(vec2 pos){pos=pos*color_texture_pow2_sz;return -((pos-floor(pos))-vec2(0.5));} + +// 1D Gaussian. +float Gaus(float pos,float scale){return exp2(scale*pos*pos);} + +// 3-tap Gaussian filter along horz line. +vec3 Horz3(vec2 pos,float off){ + vec3 b=Fetch(pos,vec2(-1.0,off)); + vec3 c=Fetch(pos,vec2( 0.0,off)); + vec3 d=Fetch(pos,vec2( 1.0,off)); + float dst=Dist(pos).x; + // Convert distance to weight. +#ifdef ORIGINAL_HARDPIX + float scale=hardPix; +#else + float scale=hardPix * max(0.2, 1.5-color_texture_sz.x/512.0); +#endif + float wb=Gaus(dst-1.0,scale); + float wc=Gaus(dst+0.0,scale); + float wd=Gaus(dst+1.0,scale); + // Return filtered sample. + return (b*wb+c*wc+d*wd)/(wb+wc+wd);} + +// 5-tap Gaussian filter along horz line. +vec3 Horz5(vec2 pos,float off){ + vec3 a=Fetch(pos,vec2(-2.0,off)); + vec3 b=Fetch(pos,vec2(-1.0,off)); + vec3 c=Fetch(pos,vec2( 0.0,off)); + vec3 d=Fetch(pos,vec2( 1.0,off)); + vec3 e=Fetch(pos,vec2( 2.0,off)); + float dst=Dist(pos).x; + // Convert distance to weight. +#ifdef ORIGINAL_HARDPIX + float scale=hardPix; +#else + float scale=hardPix * max(0.2, 1.5-color_texture_sz.x/512.0); +#endif + float wa=Gaus(dst-2.0,scale); + float wb=Gaus(dst-1.0,scale); + float wc=Gaus(dst+0.0,scale); + float wd=Gaus(dst+1.0,scale); + float we=Gaus(dst+2.0,scale); + // Return filtered sample. + return (a*wa+b*wb+c*wc+d*wd+e*we)/(wa+wb+wc+wd+we);} + +vec3 Horz7(vec2 pos,float off){ + vec3 a=Fetch(pos,vec2(-3.0,off)); + vec3 b=Fetch(pos,vec2(-2.0,off)); + vec3 c=Fetch(pos,vec2(-1.0,off)); + vec3 d=Fetch(pos,vec2( 0.0,off)); + vec3 e=Fetch(pos,vec2( 1.0,off)); + vec3 f=Fetch(pos,vec2( 2.0,off)); + vec3 g=Fetch(pos,vec2( 3.0,off)); + float dst=Dist(pos).x; + // Convert distance to weight. + float scale=hardBloomPix* max(0.5, 1.5-color_texture_sz.x/512.0); + float wa=Gaus(dst-3.0,scale); + float wb=Gaus(dst-2.0,scale); + float wc=Gaus(dst-1.0,scale); + float wd=Gaus(dst+0.0,scale); + float we=Gaus(dst+1.0,scale); + float wf=Gaus(dst+2.0,scale); + float wg=Gaus(dst+3.0,scale); + // Return filtered sample. + return (a*wa+b*wb+c*wc+d*wd+e*we+f*wf+g*wg)/(wa+wb+wc+wd+we+wf+wg);} + +// Return scanline weight. +float Scan(vec2 pos,float off){ + float dst=Dist(pos).y; +#ifdef ORIGINAL_SCANLINES + return Gaus(dst+off,hardScan);} +#else + vec3 col=Fetch(pos,vec2(0.0)); + return Gaus(dst+off,hardScan/(dot(col,col)*0.25+1.0));} //Modified to make scanline respond to pixel brightness +#endif + +// Return scanline weight for bloom. +float BloomScan(vec2 pos,float off){ + float dst=Dist(pos).y; + return Gaus(dst+off,hardBloomScan);} + +// Allow nearest three lines to effect pixel. +vec3 Tri(vec2 pos){ + vec3 a=Horz3(pos,-1.0); + vec3 b=Horz5(pos, 0.0); + vec3 c=Horz3(pos, 1.0); + float wa=Scan(pos,-1.0); + float wb=Scan(pos, 0.0); + float wc=Scan(pos, 1.0); + return a*wa+b*wb+c*wc;} + +// Small bloom. +vec3 Bloom(vec2 pos){ + vec3 a=Horz5(pos,-2.0); + vec3 b=Horz7(pos,-1.0); + vec3 c=Horz7(pos, 0.0); + vec3 d=Horz7(pos, 1.0); + vec3 e=Horz5(pos, 2.0); + float wa=BloomScan(pos,-2.0); + float wb=BloomScan(pos,-1.0); + float wc=BloomScan(pos, 0.0); + float wd=BloomScan(pos, 1.0); + float we=BloomScan(pos, 2.0); + return a*wa+b*wb+c*wc+d*wd+e*we;} + +// Distortion of scanlines, and end of screen alpha. +vec2 Warp(vec2 pos){ + pos=pos*2.0-1.0; + pos*=vec2(1.0+(pos.y*pos.y)*warp.x,1.0+(pos.x*pos.x)*warp.y); + return pos*0.5+0.5;} + +// Shadow mask. + +vec3 Mask(vec2 pos){ +#ifdef VERTICAL +pos.xy=pos.yx; +#endif +#ifdef MASK_VGA + pos.x+=pos.y*3.0; + vec3 mask=vec3(maskDark,maskDark,maskDark); + pos.x=fract(pos.x/6.0); + if(pos.x<0.333)mask.r=maskLight; + else if(pos.x<0.666)mask.g=maskLight; + else mask.b=maskLight; +#endif +#ifdef MASK_TV + float line=maskLight; + float odd=0.0; + if(fract(pos.x/6.0)<0.5)odd=1.0; + if(fract((pos.y+odd)/2.0)<0.5)line=maskDark; + pos.x=fract(pos.x/3.0); + vec3 mask=vec3(maskDark,maskDark,maskDark); + if(pos.x<0.333)mask.r=maskLight; + else if(pos.x<0.666)mask.g=maskLight; + else mask.b=maskLight; + mask*=line; +#endif +#ifdef MASK_APERTURE_GRILL + pos.x=fract(pos.x/3.0); + vec3 mask=vec3(maskDark,maskDark,maskDark); + if(pos.x<0.333)mask.r=maskLight; + else if(pos.x<0.666)mask.g=maskLight; + else mask.b=maskLight; +#endif + return mask;} + +void main(void){ +#ifdef CURVATURE + vec2 pos=Warp(gl_TexCoord[0].xy); +#else + vec2 pos=gl_TexCoord[0].xy; +#endif + gl_FragColor.a=texture2D(color_texture,pos.xy).a; + gl_FragColor.rgb=Tri(pos)*mix(vec3(1.0),Mask(gl_FragCoord.xy),maskStrength); +#ifdef BLOOM + gl_FragColor.rgb+=Bloom(pos)*bloomAmount; +#endif +#ifdef YUV + gl_FragColor.rgb = vec3(dot(YUVr,gl_FragColor.rgb),dot(YUVg,gl_FragColor.rgb),dot(YUVb,gl_FragColor.rgb)); + gl_FragColor.rgb=clamp(gl_FragColor.rgb,0.0,1.0); +#endif +#ifdef GAMMA_CONTRAST_BOOST + gl_FragColor.rgb=brightMult*pow(gl_FragColor.rgb,gammaBoost )-vec3(blackClip); +#endif + gl_FragColor.rgb=clamp(ToSrgb(gl_FragColor.rgb),0.0,1.0); +} \ No newline at end of file diff --git a/src/osd/modules/render/bgfx/shaders/chains/lottes/fs_vert.sc b/src/osd/modules/render/bgfx/shaders/chains/lottes/fs_vert.sc new file mode 100644 index 00000000000..f8fc2450203 --- /dev/null +++ b/src/osd/modules/render/bgfx/shaders/chains/lottes/fs_vert.sc @@ -0,0 +1,236 @@ +// +// PUBLIC DOMAIN CRT STYLED SCAN-LINE SHADER +// +// by Timothy Lottes +// +// This is more along the style of a really good CGA arcade monitor. +// With RGB inputs instead of NTSC. +// The shadow mask example has the mask rotated 90 degrees for less chromatic aberration. +// +// Left it unoptimized to show the theory behind the algorithm. +// +// It is an example what I personally would want as a display option for pixel art games. +// Please take and use, change, or whatever. + +//Comment these out to disable the corresponding effect. +#define VERTICAL //rotates shadow mask effect to fix vertical games on landscape monitors +#define CURVATURE //Screen curvature effect. +#define YUV //Tint and Saturation adjustments. You adjust the settings in Lottes_CRT.vsh now... +#define GAMMA_CONTRAST_BOOST //Expands contrast and makes image brighter but causes clipping. +#define BLOOM //enables a bloom effect +//#define MASK_APERTURE_GRILL //Only uncomment one of the MASK patterns at a time... +#define MASK_TV +//#define MASK_VGA +//#define ORIGINAL_SCANLINES //Enable to use the original scanlines. +//#define ORIGINAL_HARDPIX //Enable to use the original hardPix calculation. + +//Normal MAME GLSL Uniforms +uniform sampler2D color_texture; +uniform vec2 color_texture_sz; // size of color_texture +uniform vec2 color_texture_pow2_sz; // size of color texture rounded up to power of 2 +uniform vec2 screen_texture_sz; // size of output resolution +uniform vec2 screen_texture_pow2_sz; // size of output resolution rounded up to power of 2 + +//CRT Filter Variables +const float hardScan=-20.0; //-8,-12,-16, etc to make scalines more prominent. +const vec2 warp=vec2(1.0/64.0,1.0/48.0); //adjusts the warp filter (curvature). +const float maskDark=0.4; //Sets how dark a "dark subpixel" is in the aperture pattern. +const float maskLight=1.5; //Sets how dark a "bright subpixel" is in the aperture pattern. +const float hardPix=-5.0; //-1,-2,-4, etc to make the upscaling sharper. +const float hardBloomScan=-2.5; +const float hardBloomPix=-1.75; +const float bloomAmount=1.0/12.0; //Lower this if there is too much bloom! +const float blackClip = 0.02; +const float brightMult = 1.2; +const float maskStrength = 0.6; //This sets the strength of the shadow mask effect +const vec3 gammaBoost = vec3(1.0/1.15, 1.0/1.15, 1.0/1.15); +varying vec3 YUVr; +varying vec3 YUVg; +varying vec3 YUVb; + +//CRT Filter Functions + +// sRGB to Linear. +// Assuing using sRGB typed textures this should not be needed. +float ToLinear1(float c){return(c<=0.04045)?c/12.92:pow((c+0.055)/1.055,2.4);} +vec3 ToLinear(vec3 c){return vec3(ToLinear1(c.r),ToLinear1(c.g),ToLinear1(c.b));} + +// Linear to sRGB. +// Assuing using sRGB typed textures this should not be needed. +float ToSrgb1(float c){return(c<0.0031308?c*12.92:1.055*pow(c,0.41666)-0.055);} +vec3 ToSrgb(vec3 c){return vec3(ToSrgb1(c.r),ToSrgb1(c.g),ToSrgb1(c.b));} + +// Nearest emulated sample given floating point position and texel offset. +// Also zero's off screen. +vec3 Fetch(vec2 pos,vec2 off){ + pos=(floor(pos*color_texture_pow2_sz+off)+0.5)/color_texture_pow2_sz; + //if(max(abs(pos.x-0.5),abs(pos.y-0.5))>0.5)return vec3(0.0,0.0,0.0); + return ToLinear(texture2D(color_texture,pos.xy).rgb);} + +// Distance in emulated pixels to nearest texel. +vec2 Dist(vec2 pos){pos=pos*color_texture_pow2_sz;return -((pos-floor(pos))-vec2(0.5));} + +// 1D Gaussian. +float Gaus(float pos,float scale){return exp2(scale*pos*pos);} + +// 3-tap Gaussian filter along horz line. +vec3 Horz3(vec2 pos,float off){ + vec3 b=Fetch(pos,vec2(-1.0,off)); + vec3 c=Fetch(pos,vec2( 0.0,off)); + vec3 d=Fetch(pos,vec2( 1.0,off)); + float dst=Dist(pos).x; + // Convert distance to weight. +#ifdef ORIGINAL_HARDPIX + float scale=hardPix; +#else + float scale=hardPix * max(0.2, 1.5-color_texture_sz.x/512.0); +#endif + float wb=Gaus(dst-1.0,scale); + float wc=Gaus(dst+0.0,scale); + float wd=Gaus(dst+1.0,scale); + // Return filtered sample. + return (b*wb+c*wc+d*wd)/(wb+wc+wd);} + +// 5-tap Gaussian filter along horz line. +vec3 Horz5(vec2 pos,float off){ + vec3 a=Fetch(pos,vec2(-2.0,off)); + vec3 b=Fetch(pos,vec2(-1.0,off)); + vec3 c=Fetch(pos,vec2( 0.0,off)); + vec3 d=Fetch(pos,vec2( 1.0,off)); + vec3 e=Fetch(pos,vec2( 2.0,off)); + float dst=Dist(pos).x; + // Convert distance to weight. +#ifdef ORIGINAL_HARDPIX + float scale=hardPix; +#else + float scale=hardPix * max(0.2, 1.5-color_texture_sz.x/512.0); +#endif + float wa=Gaus(dst-2.0,scale); + float wb=Gaus(dst-1.0,scale); + float wc=Gaus(dst+0.0,scale); + float wd=Gaus(dst+1.0,scale); + float we=Gaus(dst+2.0,scale); + // Return filtered sample. + return (a*wa+b*wb+c*wc+d*wd+e*we)/(wa+wb+wc+wd+we);} + +vec3 Horz7(vec2 pos,float off){ + vec3 a=Fetch(pos,vec2(-3.0,off)); + vec3 b=Fetch(pos,vec2(-2.0,off)); + vec3 c=Fetch(pos,vec2(-1.0,off)); + vec3 d=Fetch(pos,vec2( 0.0,off)); + vec3 e=Fetch(pos,vec2( 1.0,off)); + vec3 f=Fetch(pos,vec2( 2.0,off)); + vec3 g=Fetch(pos,vec2( 3.0,off)); + float dst=Dist(pos).x; + // Convert distance to weight. + float scale=hardBloomPix* max(0.5, 1.5-color_texture_sz.x/512.0); + float wa=Gaus(dst-3.0,scale); + float wb=Gaus(dst-2.0,scale); + float wc=Gaus(dst-1.0,scale); + float wd=Gaus(dst+0.0,scale); + float we=Gaus(dst+1.0,scale); + float wf=Gaus(dst+2.0,scale); + float wg=Gaus(dst+3.0,scale); + // Return filtered sample. + return (a*wa+b*wb+c*wc+d*wd+e*we+f*wf+g*wg)/(wa+wb+wc+wd+we+wf+wg);} + +// Return scanline weight. +float Scan(vec2 pos,float off){ + float dst=Dist(pos).y; +#ifdef ORIGINAL_SCANLINES + return Gaus(dst+off,hardScan);} +#else + vec3 col=Fetch(pos,vec2(0.0)); + return Gaus(dst+off,hardScan/(dot(col,col)*0.25+1.0));} //Modified to make scanline respond to pixel brightness +#endif + +// Return scanline weight for bloom. +float BloomScan(vec2 pos,float off){ + float dst=Dist(pos).y; + return Gaus(dst+off,hardBloomScan);} + +// Allow nearest three lines to effect pixel. +vec3 Tri(vec2 pos){ + vec3 a=Horz3(pos,-1.0); + vec3 b=Horz5(pos, 0.0); + vec3 c=Horz3(pos, 1.0); + float wa=Scan(pos,-1.0); + float wb=Scan(pos, 0.0); + float wc=Scan(pos, 1.0); + return a*wa+b*wb+c*wc;} + +// Small bloom. +vec3 Bloom(vec2 pos){ + vec3 a=Horz5(pos,-2.0); + vec3 b=Horz7(pos,-1.0); + vec3 c=Horz7(pos, 0.0); + vec3 d=Horz7(pos, 1.0); + vec3 e=Horz5(pos, 2.0); + float wa=BloomScan(pos,-2.0); + float wb=BloomScan(pos,-1.0); + float wc=BloomScan(pos, 0.0); + float wd=BloomScan(pos, 1.0); + float we=BloomScan(pos, 2.0); + return a*wa+b*wb+c*wc+d*wd+e*we;} + +// Distortion of scanlines, and end of screen alpha. +vec2 Warp(vec2 pos){ + pos=pos*2.0-1.0; + pos*=vec2(1.0+(pos.y*pos.y)*warp.x,1.0+(pos.x*pos.x)*warp.y); + return pos*0.5+0.5;} + +// Shadow mask. + +vec3 Mask(vec2 pos){ +#ifdef VERTICAL +pos.xy=pos.yx; +#endif +#ifdef MASK_VGA + pos.x+=pos.y*3.0; + vec3 mask=vec3(maskDark,maskDark,maskDark); + pos.x=fract(pos.x/6.0); + if(pos.x<0.333)mask.r=maskLight; + else if(pos.x<0.666)mask.g=maskLight; + else mask.b=maskLight; +#endif +#ifdef MASK_TV + float line=maskLight; + float odd=0.0; + if(fract(pos.x/6.0)<0.5)odd=1.0; + if(fract((pos.y+odd)/2.0)<0.5)line=maskDark; + pos.x=fract(pos.x/3.0); + vec3 mask=vec3(maskDark,maskDark,maskDark); + if(pos.x<0.333)mask.r=maskLight; + else if(pos.x<0.666)mask.g=maskLight; + else mask.b=maskLight; + mask*=line; +#endif +#ifdef MASK_APERTURE_GRILL + pos.x=fract(pos.x/3.0); + vec3 mask=vec3(maskDark,maskDark,maskDark); + if(pos.x<0.333)mask.r=maskLight; + else if(pos.x<0.666)mask.g=maskLight; + else mask.b=maskLight; +#endif + return mask;} + +void main(void){ +#ifdef CURVATURE + vec2 pos=Warp(gl_TexCoord[0].xy); +#else + vec2 pos=gl_TexCoord[0].xy; +#endif + gl_FragColor.a=texture2D(color_texture,pos.xy).a; + gl_FragColor.rgb=Tri(pos)*mix(vec3(1.0),Mask(gl_FragCoord.xy),maskStrength); +#ifdef BLOOM + gl_FragColor.rgb+=Bloom(pos)*bloomAmount; +#endif +#ifdef YUV + gl_FragColor.rgb = vec3(dot(YUVr,gl_FragColor.rgb),dot(YUVg,gl_FragColor.rgb),dot(YUVb,gl_FragColor.rgb)); + gl_FragColor.rgb=clamp(gl_FragColor.rgb,0.0,1.0); +#endif +#ifdef GAMMA_CONTRAST_BOOST + gl_FragColor.rgb=brightMult*pow(gl_FragColor.rgb,gammaBoost )-vec3(blackClip); +#endif + gl_FragColor.rgb=clamp(ToSrgb(gl_FragColor.rgb),0.0,1.0); +} \ No newline at end of file diff --git a/src/osd/modules/render/bgfx/shaders/chains/lottes/varying.def.sc b/src/osd/modules/render/bgfx/shaders/chains/lottes/varying.def.sc new file mode 100644 index 00000000000..53fe40d0b8a --- /dev/null +++ b/src/osd/modules/render/bgfx/shaders/chains/lottes/varying.def.sc @@ -0,0 +1,9 @@ +vec4 v_color0 : COLOR0 = vec4(1.0, 0.0, 0.0, 1.0); +vec2 v_texcoord0 : TEXCOORD0 = vec2(0.0, 0.0); +vec2 v_texcoord1 : TEXCOORD1 = vec2(0.0, 0.0); +vec2 v_texcoord2 : TEXCOORD2 = vec2(0.0, 0.0); +vec2 v_texcoord3 : TEXCOORD3 = vec2(0.0, 0.0); + +vec3 a_position : POSITION; +vec4 a_color0 : COLOR0; +vec2 a_texcoord0 : TEXCOORD0; diff --git a/src/osd/modules/render/bgfx/shaders/chains/lottes/vs.sc b/src/osd/modules/render/bgfx/shaders/chains/lottes/vs.sc new file mode 100644 index 00000000000..21e0eeb35ac --- /dev/null +++ b/src/osd/modules/render/bgfx/shaders/chains/lottes/vs.sc @@ -0,0 +1,26 @@ +varying float saturation; +varying float tint; +varying float U; //U and W are for the tint/saturation calculations +varying float W; +varying vec3 YUVr; +varying vec3 YUVg; +varying vec3 YUVb; +#define PI 3.141592653589 + +void main() +{ + //gl_TexCoord[0] = gl_MultiTexCoord0; + gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; + gl_Position = ftransform(); + + //Had to move the YUV calculations to the vertex shader for space + saturation = 1.1; // 1.0 is normal saturation. Increase as needed. + tint = 0.0; //0.0 is 0.0 degrees of Tint. Adjust as needed. + U = cos(tint*PI/180.0); + W = sin(tint*PI/180.0); + YUVr=vec3(0.701*saturation*U+0.16774*saturation*W+0.299,0.587-0.32931*saturation*W-0.587*saturation*U,-0.497*saturation*W-0.114*saturation*U+0.114); + YUVg=vec3(-0.3281*saturation*W-0.299*saturation*U+0.299,0.413*saturation*U+0.03547*saturation*W+0.587,0.114+0.29265*saturation*W-0.114*saturation*U); + YUVb=vec3(0.299+1.24955*saturation*W-0.299*saturation*U,-1.04634*saturation*W-0.587*saturation*U+0.587,0.886*saturation*U-0.20321*saturation*W+0.114); +} + + diff --git a/src/osd/modules/render/bgfx/shaders/chains/lottes/vs_vert.sc b/src/osd/modules/render/bgfx/shaders/chains/lottes/vs_vert.sc new file mode 100644 index 00000000000..21e0eeb35ac --- /dev/null +++ b/src/osd/modules/render/bgfx/shaders/chains/lottes/vs_vert.sc @@ -0,0 +1,26 @@ +varying float saturation; +varying float tint; +varying float U; //U and W are for the tint/saturation calculations +varying float W; +varying vec3 YUVr; +varying vec3 YUVg; +varying vec3 YUVb; +#define PI 3.141592653589 + +void main() +{ + //gl_TexCoord[0] = gl_MultiTexCoord0; + gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; + gl_Position = ftransform(); + + //Had to move the YUV calculations to the vertex shader for space + saturation = 1.1; // 1.0 is normal saturation. Increase as needed. + tint = 0.0; //0.0 is 0.0 degrees of Tint. Adjust as needed. + U = cos(tint*PI/180.0); + W = sin(tint*PI/180.0); + YUVr=vec3(0.701*saturation*U+0.16774*saturation*W+0.299,0.587-0.32931*saturation*W-0.587*saturation*U,-0.497*saturation*W-0.114*saturation*U+0.114); + YUVg=vec3(-0.3281*saturation*W-0.299*saturation*U+0.299,0.413*saturation*U+0.03547*saturation*W+0.587,0.114+0.29265*saturation*W-0.114*saturation*U); + YUVb=vec3(0.299+1.24955*saturation*W-0.299*saturation*U,-1.04634*saturation*W-0.587*saturation*U+0.587,0.886*saturation*U-0.20321*saturation*W+0.114); +} + + diff --git a/src/osd/modules/render/bgfxutil.cpp b/src/osd/modules/render/bgfxutil.cpp index cbf2428d61f..5ba76cbd2a1 100644 --- a/src/osd/modules/render/bgfxutil.cpp +++ b/src/osd/modules/render/bgfxutil.cpp @@ -31,9 +31,6 @@ const bgfx::Memory* bgfx_util::mame_texture_data_to_bgfx_texture_data(uint32_t f case PRIMFLAG_TEXFORMAT(TEXFORMAT_PALETTE16): copy_util::copyline_palette16(dst_line, src_line16, width, palette); break; - case PRIMFLAG_TEXFORMAT(TEXFORMAT_PALETTEA16): - copy_util::copyline_palettea16(dst_line, src_line16, width, palette); - break; case PRIMFLAG_TEXFORMAT(TEXFORMAT_YUY16): copy_util::copyline_yuy16_to_argb(dst_line, src_line16, width, palette, 1); break; diff --git a/src/osd/modules/render/copyutil.h b/src/osd/modules/render/copyutil.h index 81a880555cd..715fcba0dca 100644 --- a/src/osd/modules/render/copyutil.h +++ b/src/osd/modules/render/copyutil.h @@ -24,15 +24,6 @@ public: } } - static inline void copyline_palettea16(uint32_t *dst, const uint16_t *src, int width, const rgb_t *palette) - { - for (int x = 0; x < width; x++) - { - rgb_t srcpixel = palette[*src++]; - *dst++ = (srcpixel.a() << 24) | (srcpixel.b() << 16) | (srcpixel.g() << 8) | srcpixel.r(); - } - } - static inline void copyline_rgb32(uint32_t *dst, const uint32_t *src, int width, const rgb_t *palette) { int x; diff --git a/src/osd/modules/render/d3d/d3dcomm.h b/src/osd/modules/render/d3d/d3dcomm.h index 95dcac48ca7..d576c5e7d0c 100644 --- a/src/osd/modules/render/d3d/d3dcomm.h +++ b/src/osd/modules/render/d3d/d3dcomm.h @@ -144,7 +144,6 @@ private: void compute_size_subroutine(int texwidth, int texheight, int* p_width, int* p_height); inline void copyline_palette16(uint32_t *dst, const uint16_t *src, int width, const rgb_t *palette, int xborderpix); - inline void copyline_palettea16(uint32_t *dst, const uint16_t *src, int width, const rgb_t *palette, int xborderpix); inline void copyline_rgb32(uint32_t *dst, const uint32_t *src, int width, const rgb_t *palette, int xborderpix); inline void copyline_argb32(uint32_t *dst, const uint32_t *src, int width, const rgb_t *palette, int xborderpix); inline void copyline_yuy16_to_yuy2(uint16_t *dst, const uint16_t *src, int width, const rgb_t *palette); diff --git a/src/osd/modules/render/draw13.cpp b/src/osd/modules/render/draw13.cpp index 9282c35e9b4..f99ebf70601 100644 --- a/src/osd/modules/render/draw13.cpp +++ b/src/osd/modules/render/draw13.cpp @@ -705,9 +705,6 @@ texture_info::texture_info(renderer_sdl2 *renderer, const render_texinfo &texsou case TEXFORMAT_PALETTE16: m_format = SDL_TEXFORMAT_PALETTE16; break; - case TEXFORMAT_PALETTEA16: - m_format = SDL_TEXFORMAT_PALETTE16A; - break; case TEXFORMAT_YUY16: m_format = texsource.palette ? SDL_TEXFORMAT_YUY16_PALETTED : SDL_TEXFORMAT_YUY16; break; diff --git a/src/osd/modules/render/drawd3d.cpp b/src/osd/modules/render/drawd3d.cpp index dceac6ef412..fd1331c47eb 100644 --- a/src/osd/modules/render/drawd3d.cpp +++ b/src/osd/modules/render/drawd3d.cpp @@ -2011,7 +2011,7 @@ texture_info::texture_info(d3d_texture_manager *manager, const render_texinfo* t { format = m_texture_manager->get_yuv_format(); } - else if (PRIMFLAG_GET_TEXFORMAT(flags) == TEXFORMAT_ARGB32 || PRIMFLAG_GET_TEXFORMAT(flags) == TEXFORMAT_PALETTEA16) + else if (PRIMFLAG_GET_TEXFORMAT(flags) == TEXFORMAT_ARGB32) { format = D3DFMT_A8R8G8B8; } @@ -2229,21 +2229,6 @@ inline void texture_info::copyline_palette16(uint32_t *dst, const uint16_t *src, } -//============================================================ -// copyline_palettea16 -//============================================================ - -inline void texture_info::copyline_palettea16(uint32_t *dst, const uint16_t *src, int width, const rgb_t *palette, int xborderpix) -{ - if (xborderpix) - *dst++ = palette[*src]; - for (int x = 0; x < width; x++) - *dst++ = palette[*src++]; - if (xborderpix) - *dst++ = palette[*--src]; -} - - //============================================================ // copyline_rgb32 //============================================================ @@ -2457,10 +2442,6 @@ void texture_info::set_data(const render_texinfo *texsource, uint32_t flags) copyline_palette16((uint32_t *)dst, (uint16_t *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette, m_xborderpix); break; - case TEXFORMAT_PALETTEA16: - copyline_palettea16((uint32_t *)dst, (uint16_t *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette, m_xborderpix); - break; - case TEXFORMAT_RGB32: copyline_rgb32((uint32_t *)dst, (uint32_t *)texsource->base + srcy * texsource->rowpixels, texsource->width, texsource->palette, m_xborderpix); break; diff --git a/src/osd/modules/render/drawogl.cpp b/src/osd/modules/render/drawogl.cpp index 95345878cfd..6c1cb405316 100644 --- a/src/osd/modules/render/drawogl.cpp +++ b/src/osd/modules/render/drawogl.cpp @@ -1908,9 +1908,6 @@ ogl_texture_info *renderer_ogl::texture_create(const render_texinfo *texsource, case TEXFORMAT_PALETTE16: texture->format = SDL_TEXFORMAT_PALETTE16; break; - case TEXFORMAT_PALETTEA16: - texture->format = SDL_TEXFORMAT_PALETTE16A; - break; case TEXFORMAT_YUY16: if (texsource->palette != nullptr) texture->format = SDL_TEXFORMAT_YUY16_PALETTED; @@ -2066,30 +2063,6 @@ static inline void copyline_palette16(uint32_t *dst, const uint16_t *src, int wi -//============================================================ -// copyline_palettea16 -//============================================================ - -static inline void copyline_palettea16(uint32_t *dst, const uint16_t *src, int width, const rgb_t *palette, int xborderpix, int xprescale) -{ - int x; - - assert(xborderpix == 0 || xborderpix == 1); - if (xborderpix) - *dst++ = palette[*src]; - for (x = 0; x < width; x++) - { - int srcpix = *src++; - uint32_t dstval = palette[srcpix]; - for (int x2 = 0; x2 < xprescale; x2++) - *dst++ = dstval; - } - if (xborderpix) - *dst++ = palette[*--src]; -} - - - //============================================================ // copyline_rgb32 //============================================================ @@ -2359,10 +2332,6 @@ static void texture_set_data(ogl_texture_info *texture, const render_texinfo *te copyline_palette16((uint32_t *)dst, (uint16_t *)texsource->base + y * texsource->rowpixels, texsource->width, texsource->palette, texture->borderpix, texture->xprescale); break; - case TEXFORMAT_PALETTEA16: - copyline_palettea16((uint32_t *)dst, (uint16_t *)texsource->base + y * texsource->rowpixels, texsource->width, texsource->palette, texture->borderpix, texture->xprescale); - break; - case TEXFORMAT_RGB32: copyline_rgb32((uint32_t *)dst, (uint32_t *)texsource->base + y * texsource->rowpixels, texsource->width, texsource->palette, texture->borderpix, texture->xprescale); break; -- cgit v1.2.3-70-g09d2 From bef4466f12cd22d8f1fb93a791a2ddcb1012a3ac Mon Sep 17 00:00:00 2001 From: MooglyGuy Date: Wed, 10 Jul 2019 20:08:24 +0200 Subject: Remove shaders that I didn't mean to commit, nw --- .../render/bgfx/shaders/chains/lottes/fs.sc | 236 --------------------- .../render/bgfx/shaders/chains/lottes/fs_vert.sc | 236 --------------------- .../bgfx/shaders/chains/lottes/varying.def.sc | 9 - .../render/bgfx/shaders/chains/lottes/vs.sc | 26 --- .../render/bgfx/shaders/chains/lottes/vs_vert.sc | 26 --- 5 files changed, 533 deletions(-) delete mode 100644 src/osd/modules/render/bgfx/shaders/chains/lottes/fs.sc delete mode 100644 src/osd/modules/render/bgfx/shaders/chains/lottes/fs_vert.sc delete mode 100644 src/osd/modules/render/bgfx/shaders/chains/lottes/varying.def.sc delete mode 100644 src/osd/modules/render/bgfx/shaders/chains/lottes/vs.sc delete mode 100644 src/osd/modules/render/bgfx/shaders/chains/lottes/vs_vert.sc diff --git a/src/osd/modules/render/bgfx/shaders/chains/lottes/fs.sc b/src/osd/modules/render/bgfx/shaders/chains/lottes/fs.sc deleted file mode 100644 index d7cb93c9124..00000000000 --- a/src/osd/modules/render/bgfx/shaders/chains/lottes/fs.sc +++ /dev/null @@ -1,236 +0,0 @@ -// -// PUBLIC DOMAIN CRT STYLED SCAN-LINE SHADER -// -// by Timothy Lottes -// -// This is more along the style of a really good CGA arcade monitor. -// With RGB inputs instead of NTSC. -// The shadow mask example has the mask rotated 90 degrees for less chromatic aberration. -// -// Left it unoptimized to show the theory behind the algorithm. -// -// It is an example what I personally would want as a display option for pixel art games. -// Please take and use, change, or whatever. - -//Comment these out to disable the corresponding effect. -//#define VERTICAL //rotates shadow mask effect to fix vertical games on landscape monitors -//#define CURVATURE //Screen curvature effect. -#define YUV //Tint and Saturation adjustments. You adjust the settings in Lottes_CRT.vsh now... -#define GAMMA_CONTRAST_BOOST //Expands contrast and makes image brighter but causes clipping. -#define BLOOM //enables a bloom effect -//#define MASK_APERTURE_GRILL //Only uncomment one of the MASK patterns at a time... -#define MASK_TV -//#define MASK_VGA -//#define ORIGINAL_SCANLINES //Enable to use the original scanlines. -//#define ORIGINAL_HARDPIX //Enable to use the original hardPix calculation. - -//Normal MAME GLSL Uniforms -uniform sampler2D color_texture; -uniform vec2 color_texture_sz; // size of color_texture -uniform vec2 color_texture_pow2_sz; // size of color texture rounded up to power of 2 -uniform vec2 screen_texture_sz; // size of output resolution -uniform vec2 screen_texture_pow2_sz; // size of output resolution rounded up to power of 2 - -//CRT Filter Variables -const float hardScan=-20.0; //-8,-12,-16, etc to make scalines more prominent. -const vec2 warp=vec2(1.0/64.0,1.0/48.0); //adjusts the warp filter (curvature). -const float maskDark=0.4; //Sets how dark a "dark subpixel" is in the aperture pattern. -const float maskLight=1.5; //Sets how dark a "bright subpixel" is in the aperture pattern. -const float hardPix=-6.0; //-1,-2,-4, etc to make the upscaling sharper. -const float hardBloomScan=-2.5; -const float hardBloomPix=-1.75; -const float bloomAmount=1.0/12.0; //Lower this if there is too much bloom! -const float blackClip = 0.02; -const float brightMult = 1.2; -const float maskStrength = 0.6; //This sets the strength of the shadow mask effect -const vec3 gammaBoost = vec3(1.0/1.15, 1.0/1.15, 1.0/1.15); -varying vec3 YUVr; -varying vec3 YUVg; -varying vec3 YUVb; - -//CRT Filter Functions - -// sRGB to Linear. -// Assuing using sRGB typed textures this should not be needed. -float ToLinear1(float c){return(c<=0.04045)?c/12.92:pow((c+0.055)/1.055,2.4);} -vec3 ToLinear(vec3 c){return vec3(ToLinear1(c.r),ToLinear1(c.g),ToLinear1(c.b));} - -// Linear to sRGB. -// Assuing using sRGB typed textures this should not be needed. -float ToSrgb1(float c){return(c<0.0031308?c*12.92:1.055*pow(c,0.41666)-0.055);} -vec3 ToSrgb(vec3 c){return vec3(ToSrgb1(c.r),ToSrgb1(c.g),ToSrgb1(c.b));} - -// Nearest emulated sample given floating point position and texel offset. -// Also zero's off screen. -vec3 Fetch(vec2 pos,vec2 off){ - pos=(floor(pos*color_texture_pow2_sz+off)+0.5)/color_texture_pow2_sz; - //if(max(abs(pos.x-0.5),abs(pos.y-0.5))>0.5)return vec3(0.0,0.0,0.0); - return ToLinear(texture2D(color_texture,pos.xy).rgb);} - -// Distance in emulated pixels to nearest texel. -vec2 Dist(vec2 pos){pos=pos*color_texture_pow2_sz;return -((pos-floor(pos))-vec2(0.5));} - -// 1D Gaussian. -float Gaus(float pos,float scale){return exp2(scale*pos*pos);} - -// 3-tap Gaussian filter along horz line. -vec3 Horz3(vec2 pos,float off){ - vec3 b=Fetch(pos,vec2(-1.0,off)); - vec3 c=Fetch(pos,vec2( 0.0,off)); - vec3 d=Fetch(pos,vec2( 1.0,off)); - float dst=Dist(pos).x; - // Convert distance to weight. -#ifdef ORIGINAL_HARDPIX - float scale=hardPix; -#else - float scale=hardPix * max(0.2, 1.5-color_texture_sz.x/512.0); -#endif - float wb=Gaus(dst-1.0,scale); - float wc=Gaus(dst+0.0,scale); - float wd=Gaus(dst+1.0,scale); - // Return filtered sample. - return (b*wb+c*wc+d*wd)/(wb+wc+wd);} - -// 5-tap Gaussian filter along horz line. -vec3 Horz5(vec2 pos,float off){ - vec3 a=Fetch(pos,vec2(-2.0,off)); - vec3 b=Fetch(pos,vec2(-1.0,off)); - vec3 c=Fetch(pos,vec2( 0.0,off)); - vec3 d=Fetch(pos,vec2( 1.0,off)); - vec3 e=Fetch(pos,vec2( 2.0,off)); - float dst=Dist(pos).x; - // Convert distance to weight. -#ifdef ORIGINAL_HARDPIX - float scale=hardPix; -#else - float scale=hardPix * max(0.2, 1.5-color_texture_sz.x/512.0); -#endif - float wa=Gaus(dst-2.0,scale); - float wb=Gaus(dst-1.0,scale); - float wc=Gaus(dst+0.0,scale); - float wd=Gaus(dst+1.0,scale); - float we=Gaus(dst+2.0,scale); - // Return filtered sample. - return (a*wa+b*wb+c*wc+d*wd+e*we)/(wa+wb+wc+wd+we);} - -vec3 Horz7(vec2 pos,float off){ - vec3 a=Fetch(pos,vec2(-3.0,off)); - vec3 b=Fetch(pos,vec2(-2.0,off)); - vec3 c=Fetch(pos,vec2(-1.0,off)); - vec3 d=Fetch(pos,vec2( 0.0,off)); - vec3 e=Fetch(pos,vec2( 1.0,off)); - vec3 f=Fetch(pos,vec2( 2.0,off)); - vec3 g=Fetch(pos,vec2( 3.0,off)); - float dst=Dist(pos).x; - // Convert distance to weight. - float scale=hardBloomPix* max(0.5, 1.5-color_texture_sz.x/512.0); - float wa=Gaus(dst-3.0,scale); - float wb=Gaus(dst-2.0,scale); - float wc=Gaus(dst-1.0,scale); - float wd=Gaus(dst+0.0,scale); - float we=Gaus(dst+1.0,scale); - float wf=Gaus(dst+2.0,scale); - float wg=Gaus(dst+3.0,scale); - // Return filtered sample. - return (a*wa+b*wb+c*wc+d*wd+e*we+f*wf+g*wg)/(wa+wb+wc+wd+we+wf+wg);} - -// Return scanline weight. -float Scan(vec2 pos,float off){ - float dst=Dist(pos).y; -#ifdef ORIGINAL_SCANLINES - return Gaus(dst+off,hardScan);} -#else - vec3 col=Fetch(pos,vec2(0.0)); - return Gaus(dst+off,hardScan/(dot(col,col)*0.25+1.0));} //Modified to make scanline respond to pixel brightness -#endif - -// Return scanline weight for bloom. -float BloomScan(vec2 pos,float off){ - float dst=Dist(pos).y; - return Gaus(dst+off,hardBloomScan);} - -// Allow nearest three lines to effect pixel. -vec3 Tri(vec2 pos){ - vec3 a=Horz3(pos,-1.0); - vec3 b=Horz5(pos, 0.0); - vec3 c=Horz3(pos, 1.0); - float wa=Scan(pos,-1.0); - float wb=Scan(pos, 0.0); - float wc=Scan(pos, 1.0); - return a*wa+b*wb+c*wc;} - -// Small bloom. -vec3 Bloom(vec2 pos){ - vec3 a=Horz5(pos,-2.0); - vec3 b=Horz7(pos,-1.0); - vec3 c=Horz7(pos, 0.0); - vec3 d=Horz7(pos, 1.0); - vec3 e=Horz5(pos, 2.0); - float wa=BloomScan(pos,-2.0); - float wb=BloomScan(pos,-1.0); - float wc=BloomScan(pos, 0.0); - float wd=BloomScan(pos, 1.0); - float we=BloomScan(pos, 2.0); - return a*wa+b*wb+c*wc+d*wd+e*we;} - -// Distortion of scanlines, and end of screen alpha. -vec2 Warp(vec2 pos){ - pos=pos*2.0-1.0; - pos*=vec2(1.0+(pos.y*pos.y)*warp.x,1.0+(pos.x*pos.x)*warp.y); - return pos*0.5+0.5;} - -// Shadow mask. - -vec3 Mask(vec2 pos){ -#ifdef VERTICAL -pos.xy=pos.yx; -#endif -#ifdef MASK_VGA - pos.x+=pos.y*3.0; - vec3 mask=vec3(maskDark,maskDark,maskDark); - pos.x=fract(pos.x/6.0); - if(pos.x<0.333)mask.r=maskLight; - else if(pos.x<0.666)mask.g=maskLight; - else mask.b=maskLight; -#endif -#ifdef MASK_TV - float line=maskLight; - float odd=0.0; - if(fract(pos.x/6.0)<0.5)odd=1.0; - if(fract((pos.y+odd)/2.0)<0.5)line=maskDark; - pos.x=fract(pos.x/3.0); - vec3 mask=vec3(maskDark,maskDark,maskDark); - if(pos.x<0.333)mask.r=maskLight; - else if(pos.x<0.666)mask.g=maskLight; - else mask.b=maskLight; - mask*=line; -#endif -#ifdef MASK_APERTURE_GRILL - pos.x=fract(pos.x/3.0); - vec3 mask=vec3(maskDark,maskDark,maskDark); - if(pos.x<0.333)mask.r=maskLight; - else if(pos.x<0.666)mask.g=maskLight; - else mask.b=maskLight; -#endif - return mask;} - -void main(void){ -#ifdef CURVATURE - vec2 pos=Warp(gl_TexCoord[0].xy); -#else - vec2 pos=gl_TexCoord[0].xy; -#endif - gl_FragColor.a=texture2D(color_texture,pos.xy).a; - gl_FragColor.rgb=Tri(pos)*mix(vec3(1.0),Mask(gl_FragCoord.xy),maskStrength); -#ifdef BLOOM - gl_FragColor.rgb+=Bloom(pos)*bloomAmount; -#endif -#ifdef YUV - gl_FragColor.rgb = vec3(dot(YUVr,gl_FragColor.rgb),dot(YUVg,gl_FragColor.rgb),dot(YUVb,gl_FragColor.rgb)); - gl_FragColor.rgb=clamp(gl_FragColor.rgb,0.0,1.0); -#endif -#ifdef GAMMA_CONTRAST_BOOST - gl_FragColor.rgb=brightMult*pow(gl_FragColor.rgb,gammaBoost )-vec3(blackClip); -#endif - gl_FragColor.rgb=clamp(ToSrgb(gl_FragColor.rgb),0.0,1.0); -} \ No newline at end of file diff --git a/src/osd/modules/render/bgfx/shaders/chains/lottes/fs_vert.sc b/src/osd/modules/render/bgfx/shaders/chains/lottes/fs_vert.sc deleted file mode 100644 index f8fc2450203..00000000000 --- a/src/osd/modules/render/bgfx/shaders/chains/lottes/fs_vert.sc +++ /dev/null @@ -1,236 +0,0 @@ -// -// PUBLIC DOMAIN CRT STYLED SCAN-LINE SHADER -// -// by Timothy Lottes -// -// This is more along the style of a really good CGA arcade monitor. -// With RGB inputs instead of NTSC. -// The shadow mask example has the mask rotated 90 degrees for less chromatic aberration. -// -// Left it unoptimized to show the theory behind the algorithm. -// -// It is an example what I personally would want as a display option for pixel art games. -// Please take and use, change, or whatever. - -//Comment these out to disable the corresponding effect. -#define VERTICAL //rotates shadow mask effect to fix vertical games on landscape monitors -#define CURVATURE //Screen curvature effect. -#define YUV //Tint and Saturation adjustments. You adjust the settings in Lottes_CRT.vsh now... -#define GAMMA_CONTRAST_BOOST //Expands contrast and makes image brighter but causes clipping. -#define BLOOM //enables a bloom effect -//#define MASK_APERTURE_GRILL //Only uncomment one of the MASK patterns at a time... -#define MASK_TV -//#define MASK_VGA -//#define ORIGINAL_SCANLINES //Enable to use the original scanlines. -//#define ORIGINAL_HARDPIX //Enable to use the original hardPix calculation. - -//Normal MAME GLSL Uniforms -uniform sampler2D color_texture; -uniform vec2 color_texture_sz; // size of color_texture -uniform vec2 color_texture_pow2_sz; // size of color texture rounded up to power of 2 -uniform vec2 screen_texture_sz; // size of output resolution -uniform vec2 screen_texture_pow2_sz; // size of output resolution rounded up to power of 2 - -//CRT Filter Variables -const float hardScan=-20.0; //-8,-12,-16, etc to make scalines more prominent. -const vec2 warp=vec2(1.0/64.0,1.0/48.0); //adjusts the warp filter (curvature). -const float maskDark=0.4; //Sets how dark a "dark subpixel" is in the aperture pattern. -const float maskLight=1.5; //Sets how dark a "bright subpixel" is in the aperture pattern. -const float hardPix=-5.0; //-1,-2,-4, etc to make the upscaling sharper. -const float hardBloomScan=-2.5; -const float hardBloomPix=-1.75; -const float bloomAmount=1.0/12.0; //Lower this if there is too much bloom! -const float blackClip = 0.02; -const float brightMult = 1.2; -const float maskStrength = 0.6; //This sets the strength of the shadow mask effect -const vec3 gammaBoost = vec3(1.0/1.15, 1.0/1.15, 1.0/1.15); -varying vec3 YUVr; -varying vec3 YUVg; -varying vec3 YUVb; - -//CRT Filter Functions - -// sRGB to Linear. -// Assuing using sRGB typed textures this should not be needed. -float ToLinear1(float c){return(c<=0.04045)?c/12.92:pow((c+0.055)/1.055,2.4);} -vec3 ToLinear(vec3 c){return vec3(ToLinear1(c.r),ToLinear1(c.g),ToLinear1(c.b));} - -// Linear to sRGB. -// Assuing using sRGB typed textures this should not be needed. -float ToSrgb1(float c){return(c<0.0031308?c*12.92:1.055*pow(c,0.41666)-0.055);} -vec3 ToSrgb(vec3 c){return vec3(ToSrgb1(c.r),ToSrgb1(c.g),ToSrgb1(c.b));} - -// Nearest emulated sample given floating point position and texel offset. -// Also zero's off screen. -vec3 Fetch(vec2 pos,vec2 off){ - pos=(floor(pos*color_texture_pow2_sz+off)+0.5)/color_texture_pow2_sz; - //if(max(abs(pos.x-0.5),abs(pos.y-0.5))>0.5)return vec3(0.0,0.0,0.0); - return ToLinear(texture2D(color_texture,pos.xy).rgb);} - -// Distance in emulated pixels to nearest texel. -vec2 Dist(vec2 pos){pos=pos*color_texture_pow2_sz;return -((pos-floor(pos))-vec2(0.5));} - -// 1D Gaussian. -float Gaus(float pos,float scale){return exp2(scale*pos*pos);} - -// 3-tap Gaussian filter along horz line. -vec3 Horz3(vec2 pos,float off){ - vec3 b=Fetch(pos,vec2(-1.0,off)); - vec3 c=Fetch(pos,vec2( 0.0,off)); - vec3 d=Fetch(pos,vec2( 1.0,off)); - float dst=Dist(pos).x; - // Convert distance to weight. -#ifdef ORIGINAL_HARDPIX - float scale=hardPix; -#else - float scale=hardPix * max(0.2, 1.5-color_texture_sz.x/512.0); -#endif - float wb=Gaus(dst-1.0,scale); - float wc=Gaus(dst+0.0,scale); - float wd=Gaus(dst+1.0,scale); - // Return filtered sample. - return (b*wb+c*wc+d*wd)/(wb+wc+wd);} - -// 5-tap Gaussian filter along horz line. -vec3 Horz5(vec2 pos,float off){ - vec3 a=Fetch(pos,vec2(-2.0,off)); - vec3 b=Fetch(pos,vec2(-1.0,off)); - vec3 c=Fetch(pos,vec2( 0.0,off)); - vec3 d=Fetch(pos,vec2( 1.0,off)); - vec3 e=Fetch(pos,vec2( 2.0,off)); - float dst=Dist(pos).x; - // Convert distance to weight. -#ifdef ORIGINAL_HARDPIX - float scale=hardPix; -#else - float scale=hardPix * max(0.2, 1.5-color_texture_sz.x/512.0); -#endif - float wa=Gaus(dst-2.0,scale); - float wb=Gaus(dst-1.0,scale); - float wc=Gaus(dst+0.0,scale); - float wd=Gaus(dst+1.0,scale); - float we=Gaus(dst+2.0,scale); - // Return filtered sample. - return (a*wa+b*wb+c*wc+d*wd+e*we)/(wa+wb+wc+wd+we);} - -vec3 Horz7(vec2 pos,float off){ - vec3 a=Fetch(pos,vec2(-3.0,off)); - vec3 b=Fetch(pos,vec2(-2.0,off)); - vec3 c=Fetch(pos,vec2(-1.0,off)); - vec3 d=Fetch(pos,vec2( 0.0,off)); - vec3 e=Fetch(pos,vec2( 1.0,off)); - vec3 f=Fetch(pos,vec2( 2.0,off)); - vec3 g=Fetch(pos,vec2( 3.0,off)); - float dst=Dist(pos).x; - // Convert distance to weight. - float scale=hardBloomPix* max(0.5, 1.5-color_texture_sz.x/512.0); - float wa=Gaus(dst-3.0,scale); - float wb=Gaus(dst-2.0,scale); - float wc=Gaus(dst-1.0,scale); - float wd=Gaus(dst+0.0,scale); - float we=Gaus(dst+1.0,scale); - float wf=Gaus(dst+2.0,scale); - float wg=Gaus(dst+3.0,scale); - // Return filtered sample. - return (a*wa+b*wb+c*wc+d*wd+e*we+f*wf+g*wg)/(wa+wb+wc+wd+we+wf+wg);} - -// Return scanline weight. -float Scan(vec2 pos,float off){ - float dst=Dist(pos).y; -#ifdef ORIGINAL_SCANLINES - return Gaus(dst+off,hardScan);} -#else - vec3 col=Fetch(pos,vec2(0.0)); - return Gaus(dst+off,hardScan/(dot(col,col)*0.25+1.0));} //Modified to make scanline respond to pixel brightness -#endif - -// Return scanline weight for bloom. -float BloomScan(vec2 pos,float off){ - float dst=Dist(pos).y; - return Gaus(dst+off,hardBloomScan);} - -// Allow nearest three lines to effect pixel. -vec3 Tri(vec2 pos){ - vec3 a=Horz3(pos,-1.0); - vec3 b=Horz5(pos, 0.0); - vec3 c=Horz3(pos, 1.0); - float wa=Scan(pos,-1.0); - float wb=Scan(pos, 0.0); - float wc=Scan(pos, 1.0); - return a*wa+b*wb+c*wc;} - -// Small bloom. -vec3 Bloom(vec2 pos){ - vec3 a=Horz5(pos,-2.0); - vec3 b=Horz7(pos,-1.0); - vec3 c=Horz7(pos, 0.0); - vec3 d=Horz7(pos, 1.0); - vec3 e=Horz5(pos, 2.0); - float wa=BloomScan(pos,-2.0); - float wb=BloomScan(pos,-1.0); - float wc=BloomScan(pos, 0.0); - float wd=BloomScan(pos, 1.0); - float we=BloomScan(pos, 2.0); - return a*wa+b*wb+c*wc+d*wd+e*we;} - -// Distortion of scanlines, and end of screen alpha. -vec2 Warp(vec2 pos){ - pos=pos*2.0-1.0; - pos*=vec2(1.0+(pos.y*pos.y)*warp.x,1.0+(pos.x*pos.x)*warp.y); - return pos*0.5+0.5;} - -// Shadow mask. - -vec3 Mask(vec2 pos){ -#ifdef VERTICAL -pos.xy=pos.yx; -#endif -#ifdef MASK_VGA - pos.x+=pos.y*3.0; - vec3 mask=vec3(maskDark,maskDark,maskDark); - pos.x=fract(pos.x/6.0); - if(pos.x<0.333)mask.r=maskLight; - else if(pos.x<0.666)mask.g=maskLight; - else mask.b=maskLight; -#endif -#ifdef MASK_TV - float line=maskLight; - float odd=0.0; - if(fract(pos.x/6.0)<0.5)odd=1.0; - if(fract((pos.y+odd)/2.0)<0.5)line=maskDark; - pos.x=fract(pos.x/3.0); - vec3 mask=vec3(maskDark,maskDark,maskDark); - if(pos.x<0.333)mask.r=maskLight; - else if(pos.x<0.666)mask.g=maskLight; - else mask.b=maskLight; - mask*=line; -#endif -#ifdef MASK_APERTURE_GRILL - pos.x=fract(pos.x/3.0); - vec3 mask=vec3(maskDark,maskDark,maskDark); - if(pos.x<0.333)mask.r=maskLight; - else if(pos.x<0.666)mask.g=maskLight; - else mask.b=maskLight; -#endif - return mask;} - -void main(void){ -#ifdef CURVATURE - vec2 pos=Warp(gl_TexCoord[0].xy); -#else - vec2 pos=gl_TexCoord[0].xy; -#endif - gl_FragColor.a=texture2D(color_texture,pos.xy).a; - gl_FragColor.rgb=Tri(pos)*mix(vec3(1.0),Mask(gl_FragCoord.xy),maskStrength); -#ifdef BLOOM - gl_FragColor.rgb+=Bloom(pos)*bloomAmount; -#endif -#ifdef YUV - gl_FragColor.rgb = vec3(dot(YUVr,gl_FragColor.rgb),dot(YUVg,gl_FragColor.rgb),dot(YUVb,gl_FragColor.rgb)); - gl_FragColor.rgb=clamp(gl_FragColor.rgb,0.0,1.0); -#endif -#ifdef GAMMA_CONTRAST_BOOST - gl_FragColor.rgb=brightMult*pow(gl_FragColor.rgb,gammaBoost )-vec3(blackClip); -#endif - gl_FragColor.rgb=clamp(ToSrgb(gl_FragColor.rgb),0.0,1.0); -} \ No newline at end of file diff --git a/src/osd/modules/render/bgfx/shaders/chains/lottes/varying.def.sc b/src/osd/modules/render/bgfx/shaders/chains/lottes/varying.def.sc deleted file mode 100644 index 53fe40d0b8a..00000000000 --- a/src/osd/modules/render/bgfx/shaders/chains/lottes/varying.def.sc +++ /dev/null @@ -1,9 +0,0 @@ -vec4 v_color0 : COLOR0 = vec4(1.0, 0.0, 0.0, 1.0); -vec2 v_texcoord0 : TEXCOORD0 = vec2(0.0, 0.0); -vec2 v_texcoord1 : TEXCOORD1 = vec2(0.0, 0.0); -vec2 v_texcoord2 : TEXCOORD2 = vec2(0.0, 0.0); -vec2 v_texcoord3 : TEXCOORD3 = vec2(0.0, 0.0); - -vec3 a_position : POSITION; -vec4 a_color0 : COLOR0; -vec2 a_texcoord0 : TEXCOORD0; diff --git a/src/osd/modules/render/bgfx/shaders/chains/lottes/vs.sc b/src/osd/modules/render/bgfx/shaders/chains/lottes/vs.sc deleted file mode 100644 index 21e0eeb35ac..00000000000 --- a/src/osd/modules/render/bgfx/shaders/chains/lottes/vs.sc +++ /dev/null @@ -1,26 +0,0 @@ -varying float saturation; -varying float tint; -varying float U; //U and W are for the tint/saturation calculations -varying float W; -varying vec3 YUVr; -varying vec3 YUVg; -varying vec3 YUVb; -#define PI 3.141592653589 - -void main() -{ - //gl_TexCoord[0] = gl_MultiTexCoord0; - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; - gl_Position = ftransform(); - - //Had to move the YUV calculations to the vertex shader for space - saturation = 1.1; // 1.0 is normal saturation. Increase as needed. - tint = 0.0; //0.0 is 0.0 degrees of Tint. Adjust as needed. - U = cos(tint*PI/180.0); - W = sin(tint*PI/180.0); - YUVr=vec3(0.701*saturation*U+0.16774*saturation*W+0.299,0.587-0.32931*saturation*W-0.587*saturation*U,-0.497*saturation*W-0.114*saturation*U+0.114); - YUVg=vec3(-0.3281*saturation*W-0.299*saturation*U+0.299,0.413*saturation*U+0.03547*saturation*W+0.587,0.114+0.29265*saturation*W-0.114*saturation*U); - YUVb=vec3(0.299+1.24955*saturation*W-0.299*saturation*U,-1.04634*saturation*W-0.587*saturation*U+0.587,0.886*saturation*U-0.20321*saturation*W+0.114); -} - - diff --git a/src/osd/modules/render/bgfx/shaders/chains/lottes/vs_vert.sc b/src/osd/modules/render/bgfx/shaders/chains/lottes/vs_vert.sc deleted file mode 100644 index 21e0eeb35ac..00000000000 --- a/src/osd/modules/render/bgfx/shaders/chains/lottes/vs_vert.sc +++ /dev/null @@ -1,26 +0,0 @@ -varying float saturation; -varying float tint; -varying float U; //U and W are for the tint/saturation calculations -varying float W; -varying vec3 YUVr; -varying vec3 YUVg; -varying vec3 YUVb; -#define PI 3.141592653589 - -void main() -{ - //gl_TexCoord[0] = gl_MultiTexCoord0; - gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; - gl_Position = ftransform(); - - //Had to move the YUV calculations to the vertex shader for space - saturation = 1.1; // 1.0 is normal saturation. Increase as needed. - tint = 0.0; //0.0 is 0.0 degrees of Tint. Adjust as needed. - U = cos(tint*PI/180.0); - W = sin(tint*PI/180.0); - YUVr=vec3(0.701*saturation*U+0.16774*saturation*W+0.299,0.587-0.32931*saturation*W-0.587*saturation*U,-0.497*saturation*W-0.114*saturation*U+0.114); - YUVg=vec3(-0.3281*saturation*W-0.299*saturation*U+0.299,0.413*saturation*U+0.03547*saturation*W+0.587,0.114+0.29265*saturation*W-0.114*saturation*U); - YUVb=vec3(0.299+1.24955*saturation*W-0.299*saturation*U,-1.04634*saturation*W-0.587*saturation*U+0.587,0.886*saturation*U-0.20321*saturation*W+0.114); -} - - -- cgit v1.2.3-70-g09d2 From cb1f534d99533669816b6115ed2256ce07cb9dac Mon Sep 17 00:00:00 2001 From: cam900 Date: Thu, 11 Jul 2019 03:39:18 +0900 Subject: nmk16.cpp : Updates (#5325) * nmk16.cpp : Updates Reduce duplicates, Move afega related stuffs into afega_state, Cleanup twinactn OKI bankswitching routine tdragon2, raphero has address-swapped main RAM; related to protection? Simplify handlers, Reduce unnecessary lines, Runtime tag lookups, Fix spacings, Namings, Use shorter / correct type values correct sound output(afega games aren't have a stereo output) Fix metadata, Add/Fix notes (Vince is seems like bootlegger name, Add 'horizontal' in horizontal screen version of red hawk games) Fix tilemap RAM bankswitching behavior - mark tilemap dirty when RAM bank is changed * nmk16.cpp : Fix spacing * nmk16.cpp : Fix sound output balance * nmk16.cpp: Fix metadata related to regional notice --- src/mame/drivers/nmk16.cpp | 918 +++++++++++++++++++++------------------------ src/mame/includes/nmk16.h | 216 ++++++----- src/mame/video/nmk16.cpp | 361 ++++++++---------- 3 files changed, 705 insertions(+), 790 deletions(-) diff --git a/src/mame/drivers/nmk16.cpp b/src/mame/drivers/nmk16.cpp index 7d2f6bfda4b..f05cada4446 100644 --- a/src/mame/drivers/nmk16.cpp +++ b/src/mame/drivers/nmk16.cpp @@ -132,7 +132,7 @@ Questions / Notes Sound notes for games with a Z80: mustangb and tdragonb use the Seibu Raiden sound hardware and a modified -Z80 program (but the music is intact and recognizable). See audio/seibu.c +Z80 program (but the music is intact and recognizable). See audio/seibu.cpp for more info on this. --- @@ -140,9 +140,9 @@ for more info on this. Afega Games 95 Twin Action this is a hack of Mustang with new graphics -97 Red Hawk US Version of Stagger 1 +97 Red Hawk 98 Sen Jin - Guardian Storm -98 Stagger I +98 Stagger I Japanese release of Red Hawk 98 Bubble 2000 By Tuning, but it seems to be the same HW / Hot Bubble @@ -154,6 +154,8 @@ Afega Games Afega stands for "Art-Fiction Electronic Game" +Reference of music tempo: + stagger1 - https://www.youtube.com/watch?v=xWszb2fP07M ********************************************************************/ @@ -176,7 +178,7 @@ Afega stands for "Art-Fiction Electronic Game" #include "speaker.h" -WRITE16_MEMBER(nmk16_state::nmk16_x0016_w) +void nmk16_state::nmk004_x0016_w(u16 data) { // this is part of a watchdog scheme // generating an NMI on the NMK004 keeps a timer alive @@ -185,7 +187,7 @@ WRITE16_MEMBER(nmk16_state::nmk16_x0016_w) } -WRITE16_MEMBER(nmk16_state::nmk16_bioship_x0016_w) +void nmk16_state::nmk004_bioship_x0016_w(u16 data) { // ugly, ugly logic invert hack, but otherwise bioship doesn't hit the NMI enough to keep the game alive! m_nmk004->nmi_w(BIT(data, 0) ? CLEAR_LINE : ASSERT_LINE); @@ -208,24 +210,20 @@ WRITE16_MEMBER(nmk16_state::nmk16_bioship_x0016_w) **********************************************************/ -WRITE16_MEMBER(nmk16_state::nmk16_mainram_strange_w) +void nmk16_state::mainram_strange_w(offs_t offset, u16 data/*, u16 mem_mask*/) { #if 0 - uint16_t* dstram; - - dstram = m_mainram; - if (!ACCESSING_BITS_8_15) { - dstram[offset] = (data & 0x00ff) | ((data & 0x00ff)<<8); + m_mainram[offset] = (data & 0x00ff) | ((data & 0x00ff)<<8); } else if (!ACCESSING_BITS_0_7) { - dstram[offset] = (data & 0xff00) | ((data & 0xff00)>>8); + m_mainram[offset] = (data & 0xff00) | ((data & 0xff00) >> 8); } else { - dstram[offset] = data; + m_mainram[offset] = data; } #endif // as of SVN 30715 the 68k core replicates the above behavior, providing mirrored bits in 'data' regardless of the value of 'mem_mask' @@ -233,26 +231,35 @@ WRITE16_MEMBER(nmk16_state::nmk16_mainram_strange_w) } +// tdragon2, raphero has address-swapped mainram handler +u16 nmk16_state::mainram_swapped_r(offs_t offset) +{ + return m_mainram[bitswap<16>(offset, 15, 14, 13, 12, 11, 7, 9, 8, 10, 6, 5, 4, 3, 2, 1, 0)]; +} -WRITE8_MEMBER(nmk16_state::ssmissin_soundbank_w) +void nmk16_state::mainram_swapped_w(offs_t offset, u16 data, u16 mem_mask) { - m_okibank[0]->set_entry(data & 0x3); + COMBINE_DATA(&m_mainram[bitswap<16>(offset, 15, 14, 13, 12, 11, 7, 9, 8, 10, 6, 5, 4, 3, 2, 1, 0)]); } +void nmk16_state::ssmissin_soundbank_w(u8 data) +{ + m_okibank[0]->set_entry(data & 0x3); +} -WRITE16_MEMBER(nmk16_state::tharrier_mcu_control_w) +void nmk16_state::tharrier_mcu_control_w(u16 data) { // logerror("%04x: mcu_control_w %02x\n",m_maincpu->pc(),data); } -READ16_MEMBER(nmk16_state::tharrier_mcu_r) +u16 nmk16_state::tharrier_mcu_r(offs_t offset, u16 mem_mask) { /* The MCU is mapped as the top byte for byte accesses only, all word accesses are to the input port */ if (ACCESSING_BITS_8_15 && !ACCESSING_BITS_0_7) { - static const uint8_t to_main[] = + static const u8 to_main[] = { 0x82,0xc7,0x00,0x2c,0x6c,0x00,0x9f,0xc7,0x00,0x29,0x69,0x00,0x8b,0xc7,0x00 }; @@ -279,20 +286,20 @@ READ16_MEMBER(nmk16_state::tharrier_mcu_r) } } -WRITE16_MEMBER(nmk16_state::macross2_sound_reset_w) +void nmk16_state::macross2_sound_reset_w(u16 data) { /* PCB behaviour verified by Corrado Tomaselli at MAME Italia Forum: every time music changes Z80 is reset */ m_audiocpu->set_input_line(INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE); } -WRITE8_MEMBER(nmk16_state::macross2_sound_bank_w) +void nmk16_state::macross2_sound_bank_w(u8 data) { m_audiobank->set_entry(data & 0x07); } -template -WRITE8_MEMBER(nmk16_state::tharrier_oki6295_bankswitch_w) +template +void nmk16_state::tharrier_oki_bankswitch_w(u8 data) { data &= 3; if (data != 3) @@ -305,22 +312,22 @@ WRITE8_MEMBER(nmk16_state::tharrier_oki6295_bankswitch_w) ***************************************************************************/ -template -WRITE16_MEMBER(nmk16_state::nmk_bgvideoram_w) +template +void nmk16_state::bgvideoram_w(offs_t offset, u16 data, u16 mem_mask) { - COMBINE_DATA(&m_nmk_bgvideoram[Layer][offset]); + COMBINE_DATA(&m_bgvideoram[Layer][offset]); if ((offset >> 13) == m_tilerambank) m_bg_tilemap[Layer]->mark_tile_dirty(offset & 0x1fff); } -WRITE16_MEMBER(nmk16_state::nmk_txvideoram_w) +void nmk16_state::txvideoram_w(offs_t offset, u16 data, u16 mem_mask) { - COMBINE_DATA(&m_nmk_txvideoram[offset]); + COMBINE_DATA(&m_txvideoram[offset]); m_tx_tilemap->mark_tile_dirty(offset); } -template -WRITE8_MEMBER(nmk16_state::nmk_scroll_w) +template +void nmk16_state::scroll_w(offs_t offset, u8 data) { m_scroll[Layer][offset] = data; @@ -330,12 +337,16 @@ WRITE8_MEMBER(nmk16_state::nmk_scroll_w) } else { - if ((m_nmk_bgvideoram[Layer].bytes() > 0x4000) && (offset == 0)) + if ((m_bgvideoram[Layer].bytes() > 0x4000) && (offset == 0)) { - int newbank = (m_scroll[Layer][0] >> 4) & ((m_nmk_bgvideoram[Layer].bytes() >> 14)-1); + int newbank = (m_scroll[Layer][0] >> 4) & ((m_bgvideoram[Layer].bytes() >> 14) - 1); if (m_tilerambank != newbank) + { m_tilerambank = newbank; + if (m_bg_tilemap[Layer]) + m_bg_tilemap[Layer]->mark_all_dirty(); + } } m_bg_tilemap[Layer]->set_scrollx(0,((m_scroll[Layer][0] << 8) | m_scroll[Layer][1]) - m_videoshift); } @@ -352,14 +363,14 @@ void nmk16_state::vandyke_map(address_map &map) map(0x080008, 0x080009).portr("DSW1"); map(0x08000a, 0x08000b).portr("DSW2"); map(0x08000f, 0x08000f).r(m_nmk004, FUNC(nmk004_device::read)); - map(0x080016, 0x080017).w(FUNC(nmk16_state::nmk16_x0016_w)); - map(0x080019, 0x080019).w(FUNC(nmk16_state::nmk_tilebank_w)); + map(0x080016, 0x080017).w(FUNC(nmk16_state::nmk004_x0016_w)); + map(0x080019, 0x080019).w(FUNC(nmk16_state::tilebank_w)); map(0x08001f, 0x08001f).w(m_nmk004, FUNC(nmk004_device::write)); map(0x088000, 0x0887ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x08c000, 0x08c007).w(FUNC(nmk16_state::vandyke_scroll_w)); - map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::nmk_bgvideoram_w<0>)).share("nmk_bgvideoram0"); + map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); map(0x094000, 0x097fff).ram(); /* what is this? */ - map(0x09d000, 0x09d7ff).ram().w(FUNC(nmk16_state::nmk_txvideoram_w)).share("nmk_txvideoram"); + map(0x09d000, 0x09d7ff).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); map(0x0f0000, 0x0fffff).ram().share("mainram"); } @@ -373,13 +384,13 @@ void nmk16_state::vandykeb_map(address_map &map) // map(0x08000f, 0x08000f).r(m_nmk004, FUNC(nmk004_device::read)); map(0x080010, 0x08001d).w(FUNC(nmk16_state::vandykeb_scroll_w)); /* 10, 12, 1a, 1c */ map(0x080016, 0x080017).nopw(); /* IRQ enable? */ - map(0x080019, 0x080019).w(FUNC(nmk16_state::nmk_tilebank_w)); + map(0x080019, 0x080019).w(FUNC(nmk16_state::tilebank_w)); // map(0x08001f, 0x08001f).w(m_nmk004, FUNC(nmk004_device::write)); map(0x088000, 0x0887ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x08c000, 0x08c007).nopw(); /* just in case... */ - map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::nmk_bgvideoram_w<0>)).share("nmk_bgvideoram0"); + map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); map(0x094000, 0x097fff).ram(); /* what is this? */ - map(0x09d000, 0x09d7ff).ram().w(FUNC(nmk16_state::nmk_txvideoram_w)).share("nmk_txvideoram"); + map(0x09d000, 0x09d7ff).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); map(0x0f0000, 0x0fffff).ram().share("mainram"); } @@ -391,13 +402,13 @@ void nmk16_state::manybloc_map(address_map &map) map(0x080004, 0x080005).portr("DSW1"); map(0x080010, 0x080011).nopw(); /* See notes at the top of the driver */ map(0x080012, 0x080013).nopw(); /* See notes at the top of the driver */ - map(0x080015, 0x080015).w(FUNC(nmk16_state::nmk_flipscreen_w)); + map(0x080015, 0x080015).w(FUNC(nmk16_state::flipscreen_w)); map(0x08001c, 0x08001d).nopw(); /* See notes at the top of the driver */ map(0x08001f, 0x08001f).r("soundlatch2", FUNC(generic_latch_8_device::read)).w(m_soundlatch, FUNC(generic_latch_8_device::write)).umask16(0x00ff); map(0x088000, 0x0883ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::nmk_bgvideoram_w<0>)).share("nmk_bgvideoram0"); + map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); map(0x09c000, 0x09cfff).ram().w(FUNC(nmk16_state::manybloc_scroll_w)).share("scrollram"); - map(0x09d000, 0x09d7ff).ram().w(FUNC(nmk16_state::nmk_txvideoram_w)).share("nmk_txvideoram"); + map(0x09d000, 0x09d7ff).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); map(0x0f0000, 0x0fffff).ram().share("mainram"); } @@ -408,16 +419,16 @@ void nmk16_tomagic_state::tomagic_map(address_map &map) map(0x080002, 0x080003).portr("IN1"); map(0x080008, 0x080009).portr("DSW1"); map(0x08000a, 0x08000b).portr("DSW2"); - map(0x080014, 0x080015).w(FUNC(nmk16_tomagic_state::nmk_flipscreen_w)); - map(0x080018, 0x080019).w(FUNC(nmk16_tomagic_state::nmk_tilebank_w)); + map(0x080014, 0x080015).w(FUNC(nmk16_tomagic_state::flipscreen_w)); + map(0x080018, 0x080019).w(FUNC(nmk16_tomagic_state::tilebank_w)); map(0x08001f, 0x08001f).w(m_soundlatch, FUNC(generic_latch_8_device::write)); map(0x088000, 0x0887ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x08c000, 0x08c1ff).writeonly().share("scrollram"); map(0x08c200, 0x08c3ff).writeonly().share("scrollramy"); - map(0x090000, 0x093fff).ram().w(FUNC(nmk16_tomagic_state::nmk_bgvideoram_w<0>)).share("nmk_bgvideoram0"); + map(0x090000, 0x093fff).ram().w(FUNC(nmk16_tomagic_state::bgvideoram_w<0>)).share("bgvideoram0"); map(0x094001, 0x094001).w(m_oki[0], FUNC(okim6295_device::write)); map(0x094003, 0x094003).r(m_oki[0], FUNC(okim6295_device::read)); - map(0x09c000, 0x09cfff).mirror(0x001000).ram().w(FUNC(nmk16_tomagic_state::nmk_txvideoram_w)).share("nmk_txvideoram"); + map(0x09c000, 0x09cfff).mirror(0x001000).ram().w(FUNC(nmk16_tomagic_state::txvideoram_w)).share("txvideoram"); map(0x0f0000, 0x0fffff).ram().share("mainram"); } @@ -440,21 +451,21 @@ void nmk16_state::tharrier_map(address_map &map) { map(0x000000, 0x03ffff).rom(); map(0x080000, 0x080001).portr("IN0"); - map(0x080002, 0x080003).r(FUNC(nmk16_state::tharrier_mcu_r)); // AM_READ_PORT("IN1") + map(0x080002, 0x080003).r(FUNC(nmk16_state::tharrier_mcu_r)); // .portr("IN1"); map(0x080004, 0x080005).portr("DSW1"); map(0x08000f, 0x08000f).r("soundlatch2", FUNC(generic_latch_8_device::read)); /* from Z80 */ map(0x080010, 0x080011).w(FUNC(nmk16_state::tharrier_mcu_control_w)); map(0x080012, 0x080013).nopw(); -// map(0x080015, 0x080015).w(FUNC(nmk16_state::nmk_flipscreen_w)); -// map(0x080019, 0x080019).w(FUNC(nmk16_state::nmk_tilebank_w)); +// map(0x080015, 0x080015).w(FUNC(nmk16_state::flipscreen_w)); +// map(0x080019, 0x080019).w(FUNC(nmk16_state::tilebank_w)); map(0x08001f, 0x08001f).w(m_soundlatch, FUNC(generic_latch_8_device::write)); map(0x080202, 0x080203).portr("IN2"); map(0x088000, 0x0883ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); -// map(0x08c000, 0x08c007).w(FUNC(nmk16_state::nmk_scroll_w<0>)).umask16(0x00ff); - map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::nmk_bgvideoram_w<0>)).share("nmk_bgvideoram0"); +// map(0x08c000, 0x08c007).w(FUNC(nmk16_state::scroll_w<0>)).umask16(0x00ff); + map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); map(0x09c000, 0x09c7ff).ram(); /* Unused txvideoram area? */ - map(0x09d000, 0x09d7ff).ram().w(FUNC(nmk16_state::nmk_txvideoram_w)).share("nmk_txvideoram"); - map(0x0f0000, 0x0fffff).ram().w(FUNC(nmk16_state::nmk16_mainram_strange_w)).share("mainram"); + map(0x09d000, 0x09d7ff).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); + map(0x0f0000, 0x0fffff).ram().w(FUNC(nmk16_state::mainram_strange_w)).share("mainram"); } void nmk16_state::tharrier_sound_map(address_map &map) @@ -464,8 +475,8 @@ void nmk16_state::tharrier_sound_map(address_map &map) map(0xf000, 0xf000).r(m_soundlatch, FUNC(generic_latch_8_device::read)).w("soundlatch2", FUNC(generic_latch_8_device::write)); map(0xf400, 0xf400).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0xf500, 0xf500).rw(m_oki[1], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0xf600, 0xf600).w(FUNC(nmk16_state::tharrier_oki6295_bankswitch_w<0>)); - map(0xf700, 0xf700).w(FUNC(nmk16_state::tharrier_oki6295_bankswitch_w<1>)); + map(0xf600, 0xf600).w(FUNC(nmk16_state::tharrier_oki_bankswitch_w<0>)); + map(0xf700, 0xf700).w(FUNC(nmk16_state::tharrier_oki_bankswitch_w<1>)); } void nmk16_state::tharrier_sound_io_map(address_map &map) @@ -485,15 +496,15 @@ void nmk16_state::mustang_map(address_map &map) map(0x080004, 0x080005).portr("DSW1"); map(0x08000f, 0x08000f).r(m_nmk004, FUNC(nmk004_device::read)); map(0x08000e, 0x08000f).nopw(); - map(0x080015, 0x080015).w(FUNC(nmk16_state::nmk_flipscreen_w)); - map(0x080016, 0x080017).w(FUNC(nmk16_state::nmk16_x0016_w)); // frame number? + map(0x080015, 0x080015).w(FUNC(nmk16_state::flipscreen_w)); + map(0x080016, 0x080017).w(FUNC(nmk16_state::nmk004_x0016_w)); // frame number? map(0x08001f, 0x08001f).w(m_nmk004, FUNC(nmk004_device::write)); map(0x088000, 0x0887ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x08c000, 0x08c001).w(FUNC(nmk16_state::mustang_scroll_w)); map(0x08c002, 0x08c087).nopw(); // ?? - map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::nmk_bgvideoram_w<0>)).share("nmk_bgvideoram0"); - map(0x09c000, 0x09c7ff).ram().w(FUNC(nmk16_state::nmk_txvideoram_w)).share("nmk_txvideoram"); - map(0x0f0000, 0x0fffff).ram().w(FUNC(nmk16_state::nmk16_mainram_strange_w)).share("mainram"); + map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); + map(0x09c000, 0x09c7ff).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); + map(0x0f0000, 0x0fffff).ram().w(FUNC(nmk16_state::mainram_strange_w)).share("mainram"); } void nmk16_state::mustangb_map(address_map &map) @@ -503,15 +514,15 @@ void nmk16_state::mustangb_map(address_map &map) map(0x080002, 0x080003).portr("IN1"); map(0x080004, 0x080005).portr("DSW1"); map(0x08000e, 0x08000f).noprw(); - map(0x080015, 0x080015).w(FUNC(nmk16_state::nmk_flipscreen_w)); + map(0x080015, 0x080015).w(FUNC(nmk16_state::flipscreen_w)); map(0x080016, 0x080017).nopw(); // frame number? map(0x08001e, 0x08001f).w("seibu_sound", FUNC(seibu_sound_device::main_mustb_w)); map(0x088000, 0x0887ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x08c000, 0x08c001).w(FUNC(nmk16_state::mustang_scroll_w)); map(0x08c002, 0x08c087).nopw(); // ?? - map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::nmk_bgvideoram_w<0>)).share("nmk_bgvideoram0"); - map(0x09c000, 0x09c7ff).ram().w(FUNC(nmk16_state::nmk_txvideoram_w)).share("nmk_txvideoram"); - map(0x0f0000, 0x0fffff).ram().w(FUNC(nmk16_state::nmk16_mainram_strange_w)).share("mainram"); + map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); + map(0x09c000, 0x09c7ff).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); + map(0x0f0000, 0x0fffff).ram().w(FUNC(nmk16_state::mainram_strange_w)).share("mainram"); } void nmk16_state::twinactn_map(address_map &map) @@ -521,15 +532,15 @@ void nmk16_state::twinactn_map(address_map &map) map(0x080002, 0x080003).portr("IN1"); map(0x080004, 0x080005).portr("DSW1"); map(0x08000e, 0x08000f).noprw(); - map(0x080015, 0x080015).w(FUNC(nmk16_state::nmk_flipscreen_w)); + map(0x080015, 0x080015).w(FUNC(nmk16_state::flipscreen_w)); map(0x080016, 0x080017).nopw(); // frame number? map(0x08001f, 0x08001f).w(m_soundlatch, FUNC(generic_latch_8_device::write)); map(0x088000, 0x0887ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x08c000, 0x08c001).w(FUNC(nmk16_state::mustang_scroll_w)); map(0x08c002, 0x08c087).nopw(); // ?? - map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::nmk_bgvideoram_w<0>)).share("nmk_bgvideoram0"); - map(0x09c000, 0x09c7ff).ram().w(FUNC(nmk16_state::nmk_txvideoram_w)).share("nmk_txvideoram"); - map(0x0f0000, 0x0fffff).ram().w(FUNC(nmk16_state::nmk16_mainram_strange_w)).share("mainram"); + map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); + map(0x09c000, 0x09c7ff).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); + map(0x0f0000, 0x0fffff).ram().w(FUNC(nmk16_state::mainram_strange_w)).share("mainram"); } void nmk16_state::acrobatm_map(address_map &map) @@ -541,14 +552,14 @@ void nmk16_state::acrobatm_map(address_map &map) map(0xc0008, 0xc0009).portr("DSW1"); map(0xc000a, 0xc000b).portr("DSW2"); map(0xc000f, 0xc000f).r(m_nmk004, FUNC(nmk004_device::read)); - map(0xc0015, 0xc0015).w(FUNC(nmk16_state::nmk_flipscreen_w)); - map(0xc0016, 0xc0017).w(FUNC(nmk16_state::nmk16_x0016_w)); - map(0xc0019, 0xc0019).w(FUNC(nmk16_state::nmk_tilebank_w)); + map(0xc0015, 0xc0015).w(FUNC(nmk16_state::flipscreen_w)); + map(0xc0016, 0xc0017).w(FUNC(nmk16_state::nmk004_x0016_w)); + map(0xc0019, 0xc0019).w(FUNC(nmk16_state::tilebank_w)); map(0xc001f, 0xc001f).w(m_nmk004, FUNC(nmk004_device::write)); map(0xc4000, 0xc45ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0xc8000, 0xc8007).ram().w(FUNC(nmk16_state::nmk_scroll_w<0>)).umask16(0x00ff); - map(0xcc000, 0xcffff).ram().w(FUNC(nmk16_state::nmk_bgvideoram_w<0>)).share("nmk_bgvideoram0"); - map(0xd4000, 0xd47ff).ram().w(FUNC(nmk16_state::nmk_txvideoram_w)).share("nmk_txvideoram"); + map(0xc8000, 0xc8007).ram().w(FUNC(nmk16_state::scroll_w<0>)).umask16(0x00ff); + map(0xcc000, 0xcffff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); + map(0xd4000, 0xd47ff).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); } void nmk16_state::bioship_map(address_map &map) @@ -559,15 +570,15 @@ void nmk16_state::bioship_map(address_map &map) map(0x080008, 0x080009).portr("DSW1"); map(0x08000a, 0x08000b).portr("DSW2"); map(0x08000f, 0x08000f).r(m_nmk004, FUNC(nmk004_device::read)); -// map(0xc0015, 0xc0015).w(FUNC(nmk16_state::nmk_flipscreen_w)); - map(0x080016, 0x080017).w(FUNC(nmk16_state::nmk16_bioship_x0016_w)); +// map(0xc0015, 0xc0015).w(FUNC(nmk16_state::flipscreen_w)); + map(0x080016, 0x080017).w(FUNC(nmk16_state::nmk004_bioship_x0016_w)); map(0x08001f, 0x08001f).w(m_nmk004, FUNC(nmk004_device::write)); map(0x084001, 0x084001).w(FUNC(nmk16_state::bioship_bank_w)); map(0x088000, 0x0887ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x08c000, 0x08c007).ram().w(FUNC(nmk16_state::nmk_scroll_w<1>)).umask16(0xff00); - map(0x08c010, 0x08c017).ram().w(FUNC(nmk16_state::nmk_scroll_w<0>)).umask16(0xff00); - map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::nmk_bgvideoram_w<1>)).share("nmk_bgvideoram1"); - map(0x09c000, 0x09c7ff).ram().w(FUNC(nmk16_state::nmk_txvideoram_w)).share("nmk_txvideoram"); + map(0x08c000, 0x08c007).ram().w(FUNC(nmk16_state::scroll_w<1>)).umask16(0xff00); + map(0x08c010, 0x08c017).ram().w(FUNC(nmk16_state::scroll_w<0>)).umask16(0xff00); + map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::bgvideoram_w<1>)).share("bgvideoram1"); + map(0x09c000, 0x09c7ff).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); map(0x0f0000, 0x0fffff).ram().share("mainram"); } @@ -585,7 +596,7 @@ printed on the up-left corner of the screen). #define PROT_JSR(_offs_,_protvalue_,_pc_) \ - if(m_mainram[(_offs_)/2] == _protvalue_) \ + if (m_mainram[(_offs_)/2] == _protvalue_) \ { \ m_mainram[(_offs_)/2] = 0xffff; /*(MCU job done)*/ \ m_mainram[(_offs_+2-0x10)/2] = 0x4ef9;/*JMP*/\ @@ -593,9 +604,9 @@ printed on the up-left corner of the screen). m_mainram[(_offs_+6-0x10)/2] = _pc_; /*LO-DWORD*/\ } #define PROT_INPUT(_offs_,_protvalue_,_protinput_,_input_) \ - if(m_mainram[_offs_] == _protvalue_) \ + if (m_mainram[_offs_] == _protvalue_) \ { \ - m_mainram[_protinput_] = ((_input_ & 0xffff0000)>>16);\ + m_mainram[_protinput_] = ((_input_ & 0xffff0000) >> 16);\ m_mainram[_protinput_+1] = (_input_ & 0x0000ffff);\ } @@ -672,12 +683,12 @@ f0 - player bombs (8c36) */ -WRITE16_MEMBER(nmk16_state::hachamf_mainram_w) +void nmk16_state::hachamf_mainram_w(offs_t offset, u16 data, u16 mem_mask) { COMBINE_DATA(&m_mainram[offset]); #define DUMMYA 0x7b9c // 7960 - switch(offset) + switch (offset) { case 0xe058/2: PROT_INPUT(0xe058/2,0xc71f,0xe000/2,0x00080000); break; case 0xe182/2: PROT_INPUT(0xe182/2,0x865d,0xe004/2,0x00080002); break; @@ -716,7 +727,7 @@ WRITE16_MEMBER(nmk16_state::hachamf_mainram_w) case 0xe1fe/2: PROT_JSR(0xe1fe,0x8026,0x8d0c);//8c36 PROT_JSR(0xe1fe,0x8016,DUMMYA); break; //unused case 0xef00/2: - if(m_mainram[0xef00/2] == 0x60fe) + if (m_mainram[0xef00/2] == 0x60fe) { m_mainram[0xef00/2] = 0x0000; //this is the coin counter m_mainram[0xef02/2] = 0x0000; @@ -739,26 +750,25 @@ void nmk16_state::hachamf_map(address_map &map) map(0x080008, 0x080009).portr("DSW1"); map(0x08000a, 0x08000b).portr("DSW2"); map(0x08000f, 0x08000f).r(m_nmk004, FUNC(nmk004_device::read)); - map(0x080015, 0x080015).w(FUNC(nmk16_state::nmk_flipscreen_w)); - map(0x080016, 0x080017).w(FUNC(nmk16_state::nmk16_x0016_w)); - map(0x080019, 0x080019).w(FUNC(nmk16_state::nmk_tilebank_w)); + map(0x080015, 0x080015).w(FUNC(nmk16_state::flipscreen_w)); + map(0x080016, 0x080017).w(FUNC(nmk16_state::nmk004_x0016_w)); + map(0x080019, 0x080019).w(FUNC(nmk16_state::tilebank_w)); map(0x08001f, 0x08001f).w(m_nmk004, FUNC(nmk004_device::write)); /* Video Region */ map(0x088000, 0x0887ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x08c000, 0x08c007).w(FUNC(nmk16_state::nmk_scroll_w<0>)).umask16(0x00ff); - map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::nmk_bgvideoram_w<0>)).share("nmk_bgvideoram0"); - map(0x09c000, 0x09c7ff).ram().w(FUNC(nmk16_state::nmk_txvideoram_w)).share("nmk_txvideoram"); + map(0x08c000, 0x08c007).w(FUNC(nmk16_state::scroll_w<0>)).umask16(0x00ff); + map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); + map(0x09c000, 0x09c7ff).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); /* Main RAM, inc sprites, shared with MCU */ map(0x0f0000, 0x0fffff).ram().share("mainram"); // ram is shared with MCU } - -WRITE16_MEMBER(nmk16_state::tdragon_mainram_w) +void nmk16_state::tdragon_mainram_w(offs_t offset, u16 data, u16 mem_mask) { COMBINE_DATA(&m_mainram[offset]); - switch(offset) + switch (offset) { case 0xe066/2: PROT_INPUT(0xe066/2,0xe23e,0xe000/2,0x000c0000); break; case 0xe144/2: PROT_INPUT(0xe144/2,0xf54d,0xe004/2,0x000c0002); break; @@ -797,7 +807,7 @@ WRITE16_MEMBER(nmk16_state::tdragon_mainram_w) case 0xe7fe/2: PROT_JSR(0xe7fe,0x8026,0xa57a); PROT_JSR(0xe7fe,0x8016,0xa57a); break; case 0xef00/2: - if(m_mainram[0xef00/2] == 0x60fe) + if (m_mainram[0xef00/2] == 0x60fe) { m_mainram[0xef00/2] = 0x0000; //this is the coin counter m_mainram[0xef02/2] = 0x0000; @@ -810,34 +820,34 @@ WRITE16_MEMBER(nmk16_state::tdragon_mainram_w) } /*coin setting MCU simulation*/ -void nmk16_state::mcu_run(uint8_t dsw_setting) +void nmk16_state::mcu_run(u8 dsw_setting) { - uint16_t coin_input; - uint8_t dsw[2]; - uint8_t i; + u16 coin_input; + u8 dsw[2]; + u8 i; /*Accept the start button but needs some m68k processing first,otherwise you can't start a play with 1 credit inserted*/ - if(m_start_helper & 1 && m_mainram[0x9000/2] & 0x0200) /*start 1 */ + if (m_start_helper & 1 && m_mainram[0x9000/2] & 0x0200) /*start 1 */ { m_mainram[0xef00/2]--; m_start_helper = m_start_helper & 2; } - if(m_start_helper & 2 && m_mainram[0x9000/2] & 0x0100) /*start 2*/ + if (m_start_helper & 2 && m_mainram[0x9000/2] & 0x0100) /*start 2*/ { m_mainram[0xef00/2]--; m_start_helper = m_start_helper & 1; } /*needed because of the uncompatibility of the dsw settings.*/ - if(dsw_setting) // Thunder Dragon + if (dsw_setting) // Thunder Dragon { dsw[0] = (m_dsw_io[1]->read() & 0x7); dsw[1] = (m_dsw_io[1]->read() & 0x38) >> 3; - for(i=0;i<2;i++) + for (i = 0; i < 2; i++) { - switch(dsw[i] & 7) + switch (dsw[i] & 7) { - case 0: m_mainram[0x9000/2]|=0x4000; break; //free play + case 0: m_mainram[0x9000/2] |= 0x4000; break; //free play case 1: m_coin_count_frac[i] = 1; m_coin_count[i] = 4; break; case 2: m_coin_count_frac[i] = 1; m_coin_count[i] = 3; break; case 3: m_coin_count_frac[i] = 1; m_coin_count[i] = 2; break; @@ -852,11 +862,11 @@ void nmk16_state::mcu_run(uint8_t dsw_setting) { dsw[0] = (m_dsw_io[0]->read() & 0x0700) >> 8; dsw[1] = (m_dsw_io[0]->read() & 0x3800) >> 11; - for(i=0;i<2;i++) + for (i = 0; i < 2; i++) { - switch(dsw[i] & 7) + switch (dsw[i] & 7) { - case 0: m_mainram[0x9000/2]|=0x4000; break; //free play + case 0: m_mainram[0x9000/2] |= 0x4000; break; //free play case 1: m_coin_count_frac[i] = 4; m_coin_count[i] = 1; break; case 2: m_coin_count_frac[i] = 3; m_coin_count[i] = 1; break; case 3: m_coin_count_frac[i] = 2; m_coin_count[i] = 1; break; @@ -871,51 +881,51 @@ void nmk16_state::mcu_run(uint8_t dsw_setting) /*read the coin port*/ coin_input = (~(m_in_io[0]->read())); - if(coin_input & 0x01)//coin 1 + if (coin_input & 0x01)//coin 1 { - if((m_input_pressed & 0x01) == 0) + if ((m_input_pressed & 0x01) == 0) { - if(m_coin_count_frac[0] != 1) + if (m_coin_count_frac[0] != 1) { - m_mainram[0xef02/2]+=m_coin_count[0]; - if(m_coin_count_frac[0] == m_mainram[0xef02/2]) + m_mainram[0xef02/2] += m_coin_count[0]; + if (m_coin_count_frac[0] == m_mainram[0xef02/2]) { - m_mainram[0xef00/2]+=m_coin_count[0]; + m_mainram[0xef00/2] += m_coin_count[0]; m_mainram[0xef02/2] = 0; } } else - m_mainram[0xef00/2]+=m_coin_count[0]; + m_mainram[0xef00/2] += m_coin_count[0]; } m_input_pressed = (m_input_pressed & 0xfe) | 1; } else m_input_pressed = (m_input_pressed & 0xfe); - if(coin_input & 0x02)//coin 2 + if (coin_input & 0x02)//coin 2 { - if((m_input_pressed & 0x02) == 0) + if ((m_input_pressed & 0x02) == 0) { - if(m_coin_count_frac[1] != 1) + if (m_coin_count_frac[1] != 1) { - m_mainram[0xef02/2]+=m_coin_count[1]; - if(m_coin_count_frac[1] == m_mainram[0xef02/2]) + m_mainram[0xef02/2] += m_coin_count[1]; + if (m_coin_count_frac[1] == m_mainram[0xef02/2]) { - m_mainram[0xef00/2]+=m_coin_count[1]; + m_mainram[0xef00/2] += m_coin_count[1]; m_mainram[0xef02/2] = 0; } } else - m_mainram[0xef00/2]+=m_coin_count[1]; + m_mainram[0xef00/2] += m_coin_count[1]; } m_input_pressed = (m_input_pressed & 0xfd) | 2; } else m_input_pressed = (m_input_pressed & 0xfd); - if(coin_input & 0x04)//service 1 + if (coin_input & 0x04)//service 1 { - if((m_input_pressed & 0x04) == 0) + if ((m_input_pressed & 0x04) == 0) m_mainram[0xef00/2]++; m_input_pressed = (m_input_pressed & 0xfb) | 4; } @@ -923,11 +933,11 @@ void nmk16_state::mcu_run(uint8_t dsw_setting) m_input_pressed = (m_input_pressed & 0xfb); /*The 0x9000 ram address is the status */ - if(m_mainram[0xef00/2] > 0 && m_mainram[0x9000/2] & 0x8000) //enable start button + if (m_mainram[0xef00/2] > 0 && m_mainram[0x9000/2] & 0x8000) //enable start button { - if(coin_input & 0x08)//start 1 + if (coin_input & 0x08)//start 1 { - if((m_input_pressed & 0x08) == 0 && (!(m_mainram[0x9000/2] & 0x0200))) //start 1 + if ((m_input_pressed & 0x08) == 0 && (!(m_mainram[0x9000/2] & 0x0200))) //start 1 m_start_helper = 1; m_input_pressed = (m_input_pressed & 0xf7) | 8; @@ -935,10 +945,10 @@ void nmk16_state::mcu_run(uint8_t dsw_setting) else m_input_pressed = (m_input_pressed & 0xf7); - if(coin_input & 0x10)//start 2 + if (coin_input & 0x10)//start 2 { /*Decrease two coins to let two players play with one start 2 button and two credits inserted at the insert coin screen.*/ - if((m_input_pressed & 0x10) == 0 && (!(m_mainram[0x9000/2] & 0x0100))) // start 2 + if ((m_input_pressed & 0x10) == 0 && (!(m_mainram[0x9000/2] & 0x0100))) // start 2 m_start_helper = (m_mainram[0x9000/2] == 0x8000) ? (3) : (2); m_input_pressed = (m_input_pressed & 0xef) | 0x10; @@ -973,18 +983,18 @@ void nmk16_state::tdragon_map(address_map &map) map(0x0c0008, 0x0c0009).portr("DSW1"); map(0x0c000a, 0x0c000b).portr("DSW2"); map(0x0c000f, 0x0c000f).r(m_nmk004, FUNC(nmk004_device::read)); - map(0x0c0015, 0x0c0015).w(FUNC(nmk16_state::nmk_flipscreen_w)); /* Maybe */ - map(0x0c0016, 0x0c0017).w(FUNC(nmk16_state::nmk16_x0016_w)); - map(0x0c0019, 0x0c0019).w(FUNC(nmk16_state::nmk_tilebank_w)); /* Tile Bank ? */ + map(0x0c0015, 0x0c0015).w(FUNC(nmk16_state::flipscreen_w)); /* Maybe */ + map(0x0c0016, 0x0c0017).w(FUNC(nmk16_state::nmk004_x0016_w)); + map(0x0c0019, 0x0c0019).w(FUNC(nmk16_state::tilebank_w)); /* Tile Bank ? */ map(0x0c001f, 0x0c001f).w(m_nmk004, FUNC(nmk004_device::write)); - map(0x0c4000, 0x0c4007).ram().w(FUNC(nmk16_state::nmk_scroll_w<0>)).umask16(0x00ff); + map(0x0c4000, 0x0c4007).ram().w(FUNC(nmk16_state::scroll_w<0>)).umask16(0x00ff); map(0x0c8000, 0x0c87ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x0cc000, 0x0cffff).ram().w(FUNC(nmk16_state::nmk_bgvideoram_w<0>)).share("nmk_bgvideoram0"); - map(0x0d0000, 0x0d07ff).ram().w(FUNC(nmk16_state::nmk_txvideoram_w)).share("nmk_txvideoram"); + map(0x0cc000, 0x0cffff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); + map(0x0d0000, 0x0d07ff).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); } // No sprites without this. Is it actually protection? -READ16_MEMBER(nmk16_state::tdragonb_prot_r) +u16 nmk16_state::tdragonb_prot_r() { return 0x0003; } @@ -998,13 +1008,13 @@ void nmk16_state::tdragonb_map(address_map &map) map(0x0c0002, 0x0c0003).portr("IN1"); map(0x0c0008, 0x0c0009).portr("DSW1"); map(0x0c000a, 0x0c000b).portr("DSW2"); - map(0x0c0015, 0x0c0015).w(FUNC(nmk16_state::nmk_flipscreen_w)); /* Maybe */ - map(0x0c0019, 0x0c0019).w(FUNC(nmk16_state::nmk_tilebank_w)); /* Tile Bank ? */ + map(0x0c0015, 0x0c0015).w(FUNC(nmk16_state::flipscreen_w)); /* Maybe */ + map(0x0c0019, 0x0c0019).w(FUNC(nmk16_state::tilebank_w)); /* Tile Bank ? */ map(0x0c001e, 0x0c001f).w("seibu_sound", FUNC(seibu_sound_device::main_mustb_w)); - map(0x0c4000, 0x0c4007).ram().w(FUNC(nmk16_state::nmk_scroll_w<0>)).umask16(0x00ff); + map(0x0c4000, 0x0c4007).ram().w(FUNC(nmk16_state::scroll_w<0>)).umask16(0x00ff); map(0x0c8000, 0x0c87ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x0cc000, 0x0cffff).ram().w(FUNC(nmk16_state::nmk_bgvideoram_w<0>)).share("nmk_bgvideoram0"); - map(0x0d0000, 0x0d07ff).ram().w(FUNC(nmk16_state::nmk_txvideoram_w)).share("nmk_txvideoram"); + map(0x0cc000, 0x0cffff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); + map(0x0d0000, 0x0d07ff).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); } void nmk16_state::ssmissin_map(address_map &map) @@ -1015,13 +1025,13 @@ void nmk16_state::ssmissin_map(address_map &map) map(0x0c0004, 0x0c0005).portr("IN1"); map(0x0c0006, 0x0c0007).portr("DSW1"); // AM_RANGE(0x0c000e, 0x0c000f) AM_READ(??) - map(0x0c0015, 0x0c0015).w(FUNC(nmk16_state::nmk_flipscreen_w)); /* Maybe */ - map(0x0c0019, 0x0c0019).w(FUNC(nmk16_state::nmk_tilebank_w)); /* Tile Bank ? */ + map(0x0c0015, 0x0c0015).w(FUNC(nmk16_state::flipscreen_w)); /* Maybe */ + map(0x0c0019, 0x0c0019).w(FUNC(nmk16_state::tilebank_w)); /* Tile Bank ? */ map(0x0c001f, 0x0c001f).w(m_soundlatch, FUNC(generic_latch_8_device::write)); - map(0x0c4000, 0x0c4007).ram().w(FUNC(nmk16_state::nmk_scroll_w<0>)).umask16(0x00ff); + map(0x0c4000, 0x0c4007).ram().w(FUNC(nmk16_state::scroll_w<0>)).umask16(0x00ff); map(0x0c8000, 0x0c87ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x0cc000, 0x0cffff).ram().w(FUNC(nmk16_state::nmk_bgvideoram_w<0>)).share("nmk_bgvideoram0"); - map(0x0d0000, 0x0d07ff).mirror(0x1800).ram().w(FUNC(nmk16_state::nmk_txvideoram_w)).share("nmk_txvideoram"); //mirror for airattck + map(0x0cc000, 0x0cffff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); + map(0x0d0000, 0x0d07ff).mirror(0x1800).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); //mirror for airattck } void nmk16_state::ssmissin_sound_map(address_map &map) @@ -1035,13 +1045,13 @@ void nmk16_state::ssmissin_sound_map(address_map &map) void nmk16_state::oki1_map(address_map &map) { - map(0x00000, 0x1ffff).rom(); + map(0x00000, 0x1ffff).rom().region("oki1", 0); map(0x20000, 0x3ffff).bankr("okibank1"); } void nmk16_state::oki2_map(address_map &map) { - map(0x00000, 0x1ffff).rom(); + map(0x00000, 0x1ffff).rom().region("oki2", 0); map(0x20000, 0x3ffff).bankr("okibank2"); } @@ -1053,15 +1063,15 @@ void nmk16_state::strahl_map(address_map &map) map(0x80008, 0x80009).portr("DSW1"); map(0x8000a, 0x8000b).portr("DSW2"); map(0x8000f, 0x8000f).r(m_nmk004, FUNC(nmk004_device::read)); - map(0x80015, 0x80015).w(FUNC(nmk16_state::nmk_flipscreen_w)); - map(0x80016, 0x80017).w(FUNC(nmk16_state::nmk16_x0016_w)); + map(0x80015, 0x80015).w(FUNC(nmk16_state::flipscreen_w)); + map(0x80016, 0x80017).w(FUNC(nmk16_state::nmk004_x0016_w)); map(0x8001f, 0x8001f).w(m_nmk004, FUNC(nmk004_device::write)); - map(0x84000, 0x84007).ram().w(FUNC(nmk16_state::nmk_scroll_w<0>)).umask16(0x00ff); - map(0x88000, 0x88007).ram().w(FUNC(nmk16_state::nmk_scroll_w<1>)).umask16(0x00ff); + map(0x84000, 0x84007).ram().w(FUNC(nmk16_state::scroll_w<0>)).umask16(0x00ff); + map(0x88000, 0x88007).ram().w(FUNC(nmk16_state::scroll_w<1>)).umask16(0x00ff); map(0x8c000, 0x8c7ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x90000, 0x93fff).ram().w(FUNC(nmk16_state::nmk_bgvideoram_w<0>)).share("nmk_bgvideoram0"); - map(0x94000, 0x97fff).ram().w(FUNC(nmk16_state::nmk_bgvideoram_w<1>)).share("nmk_bgvideoram1"); - map(0x9c000, 0x9c7ff).ram().w(FUNC(nmk16_state::nmk_txvideoram_w)).share("nmk_txvideoram"); + map(0x90000, 0x93fff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); + map(0x94000, 0x97fff).ram().w(FUNC(nmk16_state::bgvideoram_w<1>)).share("bgvideoram1"); + map(0x9c000, 0x9c7ff).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); map(0xf0000, 0xfffff).ram().share("mainram"); } @@ -1073,15 +1083,15 @@ void nmk16_state::macross_map(address_map &map) map(0x080008, 0x080009).portr("DSW1"); map(0x08000a, 0x08000b).portr("DSW2"); map(0x08000f, 0x08000f).r(m_nmk004, FUNC(nmk004_device::read)); - map(0x080015, 0x080015).w(FUNC(nmk16_state::nmk_flipscreen_w)); - map(0x080016, 0x080017).w(FUNC(nmk16_state::nmk16_x0016_w)); - map(0x080019, 0x080019).w(FUNC(nmk16_state::nmk_tilebank_w)); + map(0x080015, 0x080015).w(FUNC(nmk16_state::flipscreen_w)); + map(0x080016, 0x080017).w(FUNC(nmk16_state::nmk004_x0016_w)); + map(0x080019, 0x080019).w(FUNC(nmk16_state::tilebank_w)); map(0x08001f, 0x08001f).w(m_nmk004, FUNC(nmk004_device::write)); map(0x088000, 0x0887ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x08c000, 0x08c007).ram().w(FUNC(nmk16_state::nmk_scroll_w<0>)).umask16(0x00ff); - map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::nmk_bgvideoram_w<0>)).share("nmk_bgvideoram0"); - map(0x09c000, 0x09c7ff).ram().w(FUNC(nmk16_state::nmk_txvideoram_w)).share("nmk_txvideoram"); - map(0x0f0000, 0x0fffff).ram().w(FUNC(nmk16_state::nmk16_mainram_strange_w)).share("mainram"); + map(0x08c000, 0x08c007).ram().w(FUNC(nmk16_state::scroll_w<0>)).umask16(0x00ff); + map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); + map(0x09c000, 0x09c7ff).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); + map(0x0f0000, 0x0fffff).ram().w(FUNC(nmk16_state::mainram_strange_w)).share("mainram"); } void nmk16_state::gunnail_map(address_map &map) @@ -1092,16 +1102,16 @@ void nmk16_state::gunnail_map(address_map &map) map(0x080008, 0x080009).portr("DSW1"); map(0x08000a, 0x08000b).portr("DSW2"); map(0x08000f, 0x08000f).r(m_nmk004, FUNC(nmk004_device::read)); - map(0x080015, 0x080015).w(FUNC(nmk16_state::nmk_flipscreen_w)); - map(0x080016, 0x080017).w(FUNC(nmk16_state::nmk16_x0016_w)); - map(0x080019, 0x080019).w(FUNC(nmk16_state::nmk_tilebank_w)); + map(0x080015, 0x080015).w(FUNC(nmk16_state::flipscreen_w)); + map(0x080016, 0x080017).w(FUNC(nmk16_state::nmk004_x0016_w)); + map(0x080019, 0x080019).w(FUNC(nmk16_state::tilebank_w)); map(0x08001f, 0x08001f).w(m_nmk004, FUNC(nmk004_device::write)); map(0x088000, 0x0887ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x08c000, 0x08c1ff).writeonly().share("scrollram"); map(0x08c200, 0x08c3ff).writeonly().share("scrollramy"); map(0x08c400, 0x08c7ff).writeonly(); // unknown - map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::nmk_bgvideoram_w<0>)).share("nmk_bgvideoram0"); - map(0x09c000, 0x09cfff).mirror(0x001000).ram().w(FUNC(nmk16_state::nmk_txvideoram_w)).share("nmk_txvideoram"); + map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); + map(0x09c000, 0x09cfff).mirror(0x001000).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); map(0x0f0000, 0x0fffff).ram().share("mainram"); } @@ -1113,16 +1123,16 @@ void nmk16_state::gunnailb_map(address_map &map) map(0x080008, 0x080009).portr("DSW1"); map(0x08000a, 0x08000b).portr("DSW2"); // map(0x08000e, 0x08000f).nopr(); - map(0x080015, 0x080015).w(FUNC(nmk16_state::nmk_flipscreen_w)); + map(0x080015, 0x080015).w(FUNC(nmk16_state::flipscreen_w)); // map(0x080016, 0x080017).noprw(); - map(0x080019, 0x080019).w(FUNC(nmk16_state::nmk_tilebank_w)); + map(0x080019, 0x080019).w(FUNC(nmk16_state::tilebank_w)); // map(0x08001e, 0x08001f).nopw(); map(0x088000, 0x0887ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x08c000, 0x08c1ff).writeonly().share("scrollram"); map(0x08c200, 0x08c3ff).writeonly().share("scrollramy"); map(0x08c400, 0x08c7ff).writeonly(); // unknown - map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::nmk_bgvideoram_w<0>)).share("nmk_bgvideoram0"); - map(0x09c000, 0x09cfff).mirror(0x001000).ram().w(FUNC(nmk16_state::nmk_txvideoram_w)).share("nmk_txvideoram"); + map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); + map(0x09c000, 0x09cfff).mirror(0x001000).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); map(0x0f0000, 0x0fffff).ram().share("mainram"); // map(0x194000, 0x194000) } @@ -1151,20 +1161,26 @@ void nmk16_state::macross2_map(address_map &map) map(0x100008, 0x100009).portr("DSW1"); map(0x10000a, 0x10000b).portr("DSW2"); map(0x10000f, 0x10000f).r("soundlatch2", FUNC(generic_latch_8_device::read)); /* from Z80 */ - map(0x100015, 0x100015).w(FUNC(nmk16_state::nmk_flipscreen_w)); + map(0x100015, 0x100015).w(FUNC(nmk16_state::flipscreen_w)); map(0x100016, 0x100017).w(FUNC(nmk16_state::macross2_sound_reset_w)); /* Z80 reset */ - map(0x100019, 0x100019).w(FUNC(nmk16_state::nmk_tilebank_w)); + map(0x100019, 0x100019).w(FUNC(nmk16_state::tilebank_w)); map(0x10001f, 0x10001f).w(m_soundlatch, FUNC(generic_latch_8_device::write)); /* to Z80 */ map(0x120000, 0x1207ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x130000, 0x130007).ram().w(FUNC(nmk16_state::nmk_scroll_w<0>)).umask16(0x00ff); - map(0x140000, 0x14ffff).ram().w(FUNC(nmk16_state::nmk_bgvideoram_w<0>)).share("nmk_bgvideoram0"); - map(0x170000, 0x170fff).mirror(0x1000).ram().w(FUNC(nmk16_state::nmk_txvideoram_w)).share("nmk_txvideoram"); + map(0x130000, 0x130007).ram().w(FUNC(nmk16_state::scroll_w<0>)).umask16(0x00ff); + map(0x140000, 0x14ffff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); + map(0x170000, 0x170fff).mirror(0x1000).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); map(0x1f0000, 0x1fffff).ram().share("mainram"); } +void nmk16_state::tdragon2_map(address_map &map) +{ // mainram address scrambled + macross2_map(map); + map(0x1f0000, 0x1fffff).rw(FUNC(nmk16_state::mainram_swapped_r), FUNC(nmk16_state::mainram_swapped_w)).share("mainram"); +} + void nmk16_state::tdragon3h_map(address_map &map) { // bootleg has these 2 swapped - macross2_map(map); + tdragon2_map(map); map(0x10000e, 0x10000f).portr("DSW2"); map(0x10000b, 0x10000b).r("soundlatch2", FUNC(generic_latch_8_device::read)); /* from Z80 */ } @@ -1177,17 +1193,17 @@ void nmk16_state::raphero_map(address_map &map) map(0x100008, 0x100009).portr("DSW1"); map(0x10000a, 0x10000b).portr("DSW2"); map(0x10000f, 0x10000f).r("soundlatch2", FUNC(generic_latch_8_device::read)); /* from Z80 */ - map(0x100015, 0x100015).w(FUNC(nmk16_state::nmk_flipscreen_w)); + map(0x100015, 0x100015).w(FUNC(nmk16_state::flipscreen_w)); map(0x100016, 0x100017).nopw(); /* IRQ enable or z80 sound reset like in Macross 2? */ - map(0x100019, 0x100019).w(FUNC(nmk16_state::nmk_tilebank_w)); + map(0x100019, 0x100019).w(FUNC(nmk16_state::tilebank_w)); map(0x10001f, 0x10001f).w(m_soundlatch, FUNC(generic_latch_8_device::write)); /* to Z80 */ map(0x120000, 0x1207ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0x130000, 0x1301ff).ram().w(FUNC(nmk16_state::raphero_scroll_w)).share("scrollram"); map(0x130200, 0x1303ff).ram().share("scrollramy"); map(0x130400, 0x1307ff).ram(); - map(0x140000, 0x14ffff).ram().w(FUNC(nmk16_state::nmk_bgvideoram_w<0>)).share("nmk_bgvideoram0"); - map(0x170000, 0x170fff).mirror(0x1000).ram().w(FUNC(nmk16_state::nmk_txvideoram_w)).share("nmk_txvideoram"); - map(0x1f0000, 0x1fffff).ram().share("mainram"); + map(0x140000, 0x14ffff).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); + map(0x170000, 0x170fff).mirror(0x1000).ram().w(FUNC(nmk16_state::txvideoram_w)).share("txvideoram"); + map(0x1f0000, 0x1fffff).rw(FUNC(nmk16_state::mainram_swapped_r), FUNC(nmk16_state::mainram_swapped_w)).share("mainram"); } void nmk16_state::raphero_sound_mem_map(address_map &map) @@ -1229,14 +1245,14 @@ void nmk16_state::bjtwin_map(address_map &map) map(0x080002, 0x080003).portr("IN1"); map(0x080008, 0x080009).portr("DSW1"); map(0x08000a, 0x08000b).portr("DSW2"); - map(0x080015, 0x080015).w(FUNC(nmk16_state::nmk_flipscreen_w)); + map(0x080015, 0x080015).w(FUNC(nmk16_state::flipscreen_w)); map(0x084001, 0x084001).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0x084011, 0x084011).rw(m_oki[1], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0x084020, 0x08402f).w("nmk112", FUNC(nmk112_device::okibank_w)).umask16(0x00ff); map(0x088000, 0x0887ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0x094001, 0x094001).w(FUNC(nmk16_state::nmk_tilebank_w)); + map(0x094001, 0x094001).w(FUNC(nmk16_state::tilebank_w)); map(0x094002, 0x094003).nopw(); /* IRQ enable? */ - map(0x09c000, 0x09cfff).mirror(0x1000).ram().w(FUNC(nmk16_state::nmk_bgvideoram_w<0>)).share("nmk_bgvideoram0"); + map(0x09c000, 0x09cfff).mirror(0x1000).ram().w(FUNC(nmk16_state::bgvideoram_w<0>)).share("bgvideoram0"); map(0x0f0000, 0x0fffff).ram().share("mainram"); } @@ -3964,17 +3980,6 @@ static INPUT_PORTS_START( dolmen ) INPUT_PORTS_END -static const gfx_layout charlayout = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { STEP4(0,1) }, - { STEP8(0,4) }, - { STEP8(0,4*8) }, - 32*8 -}; - static const gfx_layout tilelayout = { 16,16, @@ -3987,42 +3992,41 @@ static const gfx_layout tilelayout = }; static GFXDECODE_START( gfx_tharrier ) - GFXDECODE_ENTRY( "fgtile", 0, charlayout, 0x000, 16 ) /* color 0x200-0x2ff */ - GFXDECODE_ENTRY( "bgtile", 0, tilelayout, 0x000, 16 ) /* color 0x000-0x0ff */ - GFXDECODE_ENTRY( "sprites", 0, tilelayout, 0x100, 16 ) /* color 0x100-0x1ff */ + GFXDECODE_ENTRY( "fgtile", 0, gfx_8x8x4_packed_msb, 0x000, 16 ) /* color 0x000-0x0ff */ + GFXDECODE_ENTRY( "bgtile", 0, tilelayout, 0x000, 16 ) /* color 0x000-0x0ff */ + GFXDECODE_ENTRY( "sprites", 0, tilelayout, 0x100, 16 ) /* color 0x100-0x1ff */ GFXDECODE_END static GFXDECODE_START( gfx_macross ) - GFXDECODE_ENTRY( "fgtile", 0, charlayout, 0x200, 16 ) /* color 0x200-0x2ff */ - GFXDECODE_ENTRY( "bgtile", 0, tilelayout, 0x000, 16 ) /* color 0x000-0x0ff */ - GFXDECODE_ENTRY( "sprites", 0, tilelayout, 0x100, 16 ) /* color 0x100-0x1ff */ + GFXDECODE_ENTRY( "fgtile", 0, gfx_8x8x4_packed_msb, 0x200, 16 ) /* color 0x200-0x2ff */ + GFXDECODE_ENTRY( "bgtile", 0, tilelayout, 0x000, 16 ) /* color 0x000-0x0ff */ + GFXDECODE_ENTRY( "sprites", 0, tilelayout, 0x100, 16 ) /* color 0x100-0x1ff */ GFXDECODE_END static GFXDECODE_START( gfx_macross2 ) - GFXDECODE_ENTRY( "fgtile", 0, charlayout, 0x300, 16 ) /* color 0x300-0x3ff */ - GFXDECODE_ENTRY( "bgtile", 0, tilelayout, 0x000, 16 ) /* color 0x000-0x0ff */ - GFXDECODE_ENTRY( "sprites", 0, tilelayout, 0x100, 32 ) /* color 0x100-0x2ff */ + GFXDECODE_ENTRY( "fgtile", 0, gfx_8x8x4_packed_msb, 0x300, 16 ) /* color 0x300-0x3ff */ + GFXDECODE_ENTRY( "bgtile", 0, tilelayout, 0x000, 16 ) /* color 0x000-0x0ff */ + GFXDECODE_ENTRY( "sprites", 0, tilelayout, 0x100, 32 ) /* color 0x100-0x2ff */ GFXDECODE_END static GFXDECODE_START( gfx_bjtwin ) - GFXDECODE_ENTRY( "fgtile", 0, charlayout, 0x000, 16 ) /* color 0x000-0x0ff */ - GFXDECODE_ENTRY( "bgtile", 0, charlayout, 0x000, 16 ) /* color 0x000-0x0ff */ - GFXDECODE_ENTRY( "sprites", 0, tilelayout, 0x100, 16 ) /* color 0x100-0x1ff */ + GFXDECODE_ENTRY( "fgtile", 0, gfx_8x8x4_packed_msb, 0x000, 16 ) /* color 0x000-0x0ff */ + GFXDECODE_ENTRY( "bgtile", 0, gfx_8x8x4_packed_msb, 0x000, 16 ) /* color 0x000-0x0ff */ + GFXDECODE_ENTRY( "sprites", 0, tilelayout, 0x100, 16 ) /* color 0x100-0x1ff */ GFXDECODE_END - static GFXDECODE_START( gfx_bioship ) - GFXDECODE_ENTRY( "fgtile", 0, charlayout, 0x300, 16 ) /* color 0x300-0x3ff */ - GFXDECODE_ENTRY( "bgtile", 0, tilelayout, 0x100, 16 ) /* color 0x100-0x1ff */ - GFXDECODE_ENTRY( "sprites", 0, tilelayout, 0x200, 16 ) /* color 0x200-0x2ff */ - GFXDECODE_ENTRY( "gfx4", 0, tilelayout, 0x000, 16 ) /* color 0x000-0x0ff */ + GFXDECODE_ENTRY( "fgtile", 0, gfx_8x8x4_packed_msb, 0x300, 16 ) /* color 0x300-0x3ff */ + GFXDECODE_ENTRY( "bgtile", 0, tilelayout, 0x100, 16 ) /* color 0x100-0x1ff */ + GFXDECODE_ENTRY( "sprites", 0, tilelayout, 0x200, 16 ) /* color 0x200-0x2ff */ + GFXDECODE_ENTRY( "gfx4", 0, tilelayout, 0x000, 16 ) /* color 0x000-0x0ff */ GFXDECODE_END static GFXDECODE_START( gfx_strahl ) - GFXDECODE_ENTRY( "fgtile", 0, charlayout, 0x000, 16 ) /* color 0x000-0x0ff */ - GFXDECODE_ENTRY( "bgtile", 0, tilelayout, 0x300, 16 ) /* color 0x300-0x3ff */ - GFXDECODE_ENTRY( "sprites", 0, tilelayout, 0x100, 16 ) /* color 0x100-0x1ff */ - GFXDECODE_ENTRY( "gfx4", 0, tilelayout, 0x200, 16 ) /* color 0x200-0x2ff */ + GFXDECODE_ENTRY( "fgtile", 0, gfx_8x8x4_packed_msb, 0x000, 16 ) /* color 0x000-0x0ff */ + GFXDECODE_ENTRY( "bgtile", 0, tilelayout, 0x300, 16 ) /* color 0x300-0x3ff */ + GFXDECODE_ENTRY( "sprites", 0, tilelayout, 0x100, 16 ) /* color 0x100-0x1ff */ + GFXDECODE_ENTRY( "gfx4", 0, tilelayout, 0x200, 16 ) /* color 0x200-0x2ff */ GFXDECODE_END @@ -4064,7 +4068,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(nmk16_state::nmk16_scanline) int scanline = param; - if(scanline == VBOUT_sCANLINE) // vblank-out irq + if (scanline == VBOUT_sCANLINE) // vblank-out irq m_maincpu->set_input_line(4, HOLD_LINE); if (scanline == SPRDMA_SCANLINE) @@ -4076,15 +4080,15 @@ TIMER_DEVICE_CALLBACK_MEMBER(nmk16_state::nmk16_scanline) /* Vblank-in irq, Vandyke definitely relies that irq fires at scanline ~0 instead of 112 (as per previous cpu_getiloops function implementation), mostly noticeable with sword collisions and related attract mode behaviour. */ - if(scanline == VBIN_SCANLINE) + if (scanline == VBIN_SCANLINE) m_maincpu->set_input_line(2, HOLD_LINE); /* time from IRQ2 to first IRQ1 fire. is not stated, 25 is a guess */ - if(scanline == IRQ1_SCANLINE) + if (scanline == IRQ1_SCANLINE) m_maincpu->set_input_line(1, HOLD_LINE); /* 8.9ms from first IRQ1 to second IRQ1 fire. approx 128 lines (half frame time) */ - if(scanline == IRQ1_SCANLINE+(NUM_SCANLINES/2)) // if this happens too late bioship sprites will glitch on the left edge + if (scanline == IRQ1_SCANLINE+(NUM_SCANLINES/2)) // if this happens too late bioship sprites will glitch on the left edge m_maincpu->set_input_line(1, HOLD_LINE); } @@ -4258,11 +4262,11 @@ void nmk16_state::bioship(machine_config &config) ymsnd.add_route(2, "mono", 0.50); ymsnd.add_route(3, "mono", 1.20); - OKIM6295(config, m_oki[0], BIOSHIP_CRYSTAL2 / 3 , okim6295_device::PIN7_LOW); /* 4.0 Mhz, Pin 7 High (verified) */ + OKIM6295(config, m_oki[0], BIOSHIP_CRYSTAL2 / 3, okim6295_device::PIN7_LOW); /* 4.0 Mhz, Pin 7 High (verified) */ m_oki[0]->set_addrmap(0, &nmk16_state::oki1_map); m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.10); - OKIM6295(config, m_oki[1], BIOSHIP_CRYSTAL2 / 3 , okim6295_device::PIN7_LOW); /* 4.0 Mhz, Pin 7 High (verified) */ + OKIM6295(config, m_oki[1], BIOSHIP_CRYSTAL2 / 3, okim6295_device::PIN7_LOW); /* 4.0 Mhz, Pin 7 High (verified) */ m_oki[1]->set_addrmap(0, &nmk16_state::oki2_map); m_oki[1]->add_route(ALL_OUTPUTS, "mono", 0.10); } @@ -4734,7 +4738,7 @@ void nmk16_state::tdragon2(machine_config &config) { /* basic machine hardware */ M68000(config, m_maincpu, 10000000); /* 10 MHz */ - m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::macross2_map); + m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::tdragon2_map); set_hacky_interrupt_timing(config); Z80(config, m_audiocpu, 4000000); /* 4 MHz */ @@ -4743,7 +4747,7 @@ void nmk16_state::tdragon2(machine_config &config) /* video hardware */ set_hacky_screen_hires(config); - m_screen->set_screen_update(FUNC(nmk16_state::screen_update_tdragon2)); + m_screen->set_screen_update(FUNC(nmk16_state::screen_update_macross)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_macross2); PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 1024); @@ -4793,7 +4797,7 @@ void nmk16_state::raphero(machine_config &config) /* video hardware */ set_hacky_screen_hires(config); - m_screen->set_screen_update(FUNC(nmk16_state::screen_update_tdragon2)); + m_screen->set_screen_update(FUNC(nmk16_state::screen_update_macross)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_macross2); PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 1024); @@ -4857,7 +4861,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(nmk16_state::manybloc_scanline) { int scanline = param; - if(scanline == 248) // vblank-out irq + if (scanline == 248) // vblank-out irq m_maincpu->set_input_line(4, HOLD_LINE); if (scanline == 248) @@ -4867,7 +4871,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(nmk16_state::manybloc_scanline) } /* This is either vblank-in or sprite dma irq complete */ - if(scanline == 0) + if (scanline == 0) m_maincpu->set_input_line(2, HOLD_LINE); } @@ -4955,48 +4959,44 @@ void nmk16_tomagic_state::tomagic(machine_config &config) } -uint8_t nmk16_state::decode_byte(uint8_t src, const uint8_t *bitp) +u8 nmk16_state::decode_byte(u8 src, const u8 *bitp) { - uint8_t ret, i; - - ret = 0; - for (i=0; i<8; i++) - ret |= (((src >> bitp[i]) & 1) << (7-i)); + u8 ret = 0; + for (int i = 0; i < 8; i++) + ret |= (((src >> bitp[i]) & 1) << (7 - i)); return ret; } -uint32_t nmk16_state::bjtwin_address_map_bg0(uint32_t addr) +u32 nmk16_state::bjtwin_address_map_bg0(u32 addr) { - return ((addr&0x00004)>> 2) | ((addr&0x00800)>> 10) | ((addr&0x40000)>>16); + return ((addr & 0x00004) >> 2) | ((addr & 0x00800) >> 10) | ((addr & 0x40000) >> 16); } -uint16_t nmk16_state::decode_word(uint16_t src, const uint8_t *bitp) +u16 nmk16_state::decode_word(u16 src, const u8 *bitp) { - uint16_t ret, i; - - ret=0; - for (i=0; i<16; i++) - ret |= (((src >> bitp[i]) & 1) << (15-i)); + u16 ret = 0; + for (int i = 0; i < 16; i++) + ret |= (((src >> bitp[i]) & 1) << (15 - i)); return ret; } -uint32_t nmk16_state::bjtwin_address_map_sprites(uint32_t addr) +u32 nmk16_state::bjtwin_address_map_sprites(u32 addr) { - return ((addr&0x00010)>> 4) | ((addr&0x20000)>>16) | ((addr&0x100000)>>18); + return ((addr & 0x00010) >> 4) | ((addr & 0x20000) >> 16) | ((addr & 0x100000) >> 18); } void nmk16_state::decode_gfx() { /* GFX are scrambled. We decode them here. (BIG Thanks to Antiriad for descrambling info) */ - uint8_t *rom; - int A, len; + u8 *rom; + int len; - static const uint8_t decode_data_bg[8][8] = + static const u8 decode_data_bg[8][8] = { {0x3,0x0,0x7,0x2,0x5,0x1,0x4,0x6}, {0x1,0x2,0x6,0x5,0x4,0x0,0x3,0x7}, @@ -5008,7 +5008,7 @@ void nmk16_state::decode_gfx() {0x3,0x4,0x7,0x6,0x2,0x0,0x5,0x1}, }; - static const uint8_t decode_data_sprite[8][16] = + static const u8 decode_data_sprite[8][16] = { {0x9,0x3,0x4,0x5,0x7,0x1,0xb,0x8,0x0,0xd,0x2,0xc,0xe,0x6,0xf,0xa}, {0x1,0x3,0xc,0x4,0x0,0xf,0xb,0xa,0x8,0x5,0xe,0x6,0xd,0x2,0x7,0x9}, @@ -5025,17 +5025,17 @@ void nmk16_state::decode_gfx() /* background */ rom = memregion("bgtile")->base(); len = memregion("bgtile")->bytes(); - for (A = 0;A < len;A++) + for (int A = 0; A < len; A++) { - rom[A] = decode_byte( rom[A], decode_data_bg[bjtwin_address_map_bg0(A)]); + rom[A] = decode_byte(rom[A], decode_data_bg[bjtwin_address_map_bg0(A)]); } /* sprites */ rom = memregion("sprites")->base(); len = memregion("sprites")->bytes(); - for (A = 0;A < len;A += 2) + for (int A = 0; A < len; A += 2) { - uint16_t tmp = decode_word( rom[A+1]*256 + rom[A], decode_data_sprite[bjtwin_address_map_sprites(A)]); + u16 tmp = decode_word(rom[A+1]*256 + rom[A], decode_data_sprite[bjtwin_address_map_sprites(A)]); rom[A+1] = tmp >> 8; rom[A] = tmp & 0xff; } @@ -5046,70 +5046,70 @@ void nmk16_state::decode_tdragonb() /* Descrambling Info Again Taken from Raine, Huge Thanks to Antiriad and the Raine Team for going Open Source, best of luck in future development. */ - uint8_t *rom; - int A, len; + u8 *rom; + int len; /* The Main 68k Program of the Bootleg is Bitswapped */ - static const uint8_t decode_data_tdragonb[1][16] = + static const u8 decode_data_tdragonb[1][16] = { {0xe,0xc,0xa,0x8,0x7,0x5,0x3,0x1,0xf,0xd,0xb,0x9,0x6,0x4,0x2,0x0}, }; /* Graphic Roms Could Also Do With Rearranging to make things simpler */ - static const uint8_t decode_data_tdragonbgfx[1][8] = + static const u8 decode_data_tdragonbgfx[1][8] = { {0x7,0x6,0x5,0x3,0x4,0x2,0x1,0x0}, }; rom = memregion("maincpu")->base(); len = memregion("maincpu")->bytes(); - for (A = 0;A < len;A += 2) + for (int A = 0; A < len; A += 2) { - int h = A+NATIVE_ENDIAN_VALUE_LE_BE(1,0), l = A+NATIVE_ENDIAN_VALUE_LE_BE(0,1); - uint16_t tmp = decode_word( rom[h]*256 + rom[l], decode_data_tdragonb[0]); + int h = A + NATIVE_ENDIAN_VALUE_LE_BE(1,0), l = A + NATIVE_ENDIAN_VALUE_LE_BE(0,1); + u16 tmp = decode_word(rom[h]*256 + rom[l], decode_data_tdragonb[0]); rom[h] = tmp >> 8; rom[l] = tmp & 0xff; } rom = memregion("bgtile")->base(); len = memregion("bgtile")->bytes(); - for (A = 0;A < len;A++) + for (int A = 0; A < len; A++) { - rom[A] = decode_byte( rom[A], decode_data_tdragonbgfx[0]); + rom[A] = decode_byte(rom[A], decode_data_tdragonbgfx[0]); } rom = memregion("sprites")->base(); len = memregion("sprites")->bytes(); - for (A = 0;A < len;A++) + for (int A = 0; A < len; A++) { - rom[A] = decode_byte( rom[A], decode_data_tdragonbgfx[0]); + rom[A] = decode_byte(rom[A], decode_data_tdragonbgfx[0]); } } void nmk16_state::decode_ssmissin() { /* Like Thunder Dragon Bootleg without the Program Rom Swapping */ - uint8_t *rom; - int A, len; + u8 *rom; + int len; /* Graphic Roms Could Also Do With Rearranging to make things simpler */ - static const uint8_t decode_data_tdragonbgfx[1][8] = + static const u8 decode_data_ssmissingfx[1][8] = { {0x7,0x6,0x5,0x3,0x4,0x2,0x1,0x0}, }; rom = memregion("bgtile")->base(); len = memregion("bgtile")->bytes(); - for (A = 0;A < len;A++) + for (int A = 0; A < len; A++) { - rom[A] = decode_byte( rom[A], decode_data_tdragonbgfx[0]); + rom[A] = decode_byte(rom[A], decode_data_ssmissingfx[0]); } rom = memregion("sprites")->base(); len = memregion("sprites")->bytes(); - for (A = 0;A < len;A++) + for (int A = 0; A < len; A++) { - rom[A] = decode_byte( rom[A], decode_data_tdragonbgfx[0]); + rom[A] = decode_byte(rom[A], decode_data_ssmissingfx[0]); } } @@ -5140,7 +5140,7 @@ void nmk16_state::init_tharrier() void nmk16_state::init_hachamf_prot() { - uint16_t *rom = (uint16_t *)memregion("maincpu")->base(); + u16 *rom = (u16 *)memregion("maincpu")->base(); //rom[0x0006/2] = 0x7dc2; /* replace reset vector with the "real" one */ @@ -5148,7 +5148,7 @@ void nmk16_state::init_hachamf_prot() rom[0x048a/2] = 0x4e71; rom[0x04aa/2] = 0x4e71; - m_maincpu->space(AS_PROGRAM).install_write_handler(0x0f0000, 0x0fffff, write16_delegate(FUNC(nmk16_state::hachamf_mainram_w),this)); + m_maincpu->space(AS_PROGRAM).install_write_handler(0x0f0000, 0x0fffff, write16s_delegate(FUNC(nmk16_state::hachamf_mainram_w),this)); save_protregs(); } @@ -5159,7 +5159,7 @@ void nmk16_state::init_tdragonb() void nmk16_state::init_tdragon_prot() { - uint16_t *rom = (uint16_t *)memregion("maincpu")->base(); + u16 *rom = (u16 *)memregion("maincpu")->base(); //rom[0x94b0/2] = 0; /* Patch out JMP to shared memory (protection) */ //rom[0x94b2/2] = 0x92f4; @@ -5168,7 +5168,7 @@ void nmk16_state::init_tdragon_prot() rom[0x048a/2] = 0x4e71; rom[0x04aa/2] = 0x4e71; - m_maincpu->space(AS_PROGRAM).install_write_handler(0x0b0000, 0x0bffff, write16_delegate(FUNC(nmk16_state::tdragon_mainram_w),this)); + m_maincpu->space(AS_PROGRAM).install_write_handler(0x0b0000, 0x0bffff, write16s_delegate(FUNC(nmk16_state::tdragon_mainram_w),this)); save_protregs(); } @@ -5179,6 +5179,11 @@ void nmk16_state::init_ssmissin() m_okibank[0]->configure_entries(0, 4, memregion("oki1")->base() + 0x80000, 0x20000); } +void nmk16_state::init_twinactn() +{ + m_okibank[0]->configure_entries(0, 4, memregion("oki1")->base(), 0x20000); +} + void nmk16_state::init_bjtwin() { /* Patch ROM to enable test mode */ @@ -5197,7 +5202,7 @@ void nmk16_state::init_bjtwin() * 008F7E: 207C 000F 9000 movea.l #$f9000, A0 */ #if 0 - uint16_t *rom = (uint16_t *)memregion("maincpu")->base(); + u16 *rom = (u16 *)memregion("maincpu")->base(); rom[0x09172/2] = 0x6006; /* patch checksum error */ rom[0x08f74/2] = 0x4e71; #endif @@ -5213,18 +5218,18 @@ void nmk16_state::init_gunnailb() } /* NO NMK004, it has a PIC instead */ -READ16_MEMBER(nmk16_state::vandykeb_r){ return 0x0000; } +u16 nmk16_state::vandykeb_r(){ return 0x0000; } void nmk16_state::init_vandykeb() { m_okibank[0]->configure_entries(0, 4, memregion("oki1")->base() + 0x20000, 0x20000); - m_maincpu->space(AS_PROGRAM).install_read_handler(0x08000e, 0x08000f, read16_delegate(FUNC(nmk16_state::vandykeb_r),this)); + m_maincpu->space(AS_PROGRAM).install_read_handler(0x08000e, 0x08000f, read16smo_delegate(FUNC(nmk16_state::vandykeb_r),this)); m_maincpu->space(AS_PROGRAM).nop_write(0x08001e, 0x08001f); } void nmk16_tomagic_state::init_tomagic() { // rearrange data so that we can use standard decode - uint8_t *rom = memregion("sprites")->base(); + u8 *rom = memregion("sprites")->base(); int size = memregion("sprites")->bytes(); for (int i = 0; i < size; i++) rom[i] = bitswap<8>(rom[i], 0,1,2,3,4,5,6,7); @@ -5241,60 +5246,60 @@ void nmk16_tomagic_state::init_tomagic() ***************************************************************************/ -READ16_MEMBER(nmk16_state::afega_unknown_r) +u16 afega_state::afega_unknown_r() { /* This fixes the text in Service Mode. */ return 0x0100; } -template -WRITE16_MEMBER(nmk16_state::afega_scroll_w) +template +void afega_state::afega_scroll_w(offs_t offset, u16 data, u16 mem_mask) { COMBINE_DATA(&m_afega_scroll[Scroll][offset]); } -void nmk16_state::afega_map(address_map &map) +void afega_state::afega_map(address_map &map) { map.global_mask(0xfffff); map(0x000000, 0x07ffff).rom(); map(0x080000, 0x080001).portr("IN0"); // Buttons map(0x080002, 0x080003).portr("IN1"); // P1 + P2 map(0x080004, 0x080005).portr("DSW1"); // 2 x DSW - map(0x080012, 0x080013).r(FUNC(nmk16_state::afega_unknown_r)); + map(0x080012, 0x080013).r(FUNC(afega_state::afega_unknown_r)); map(0x08001f, 0x08001f).w(m_soundlatch, FUNC(generic_latch_8_device::write)); // To Sound CPU - map(0x084000, 0x084003).ram().w(FUNC(nmk16_state::afega_scroll_w<0>)); // Scroll on redhawkb (mirror or changed?..) - map(0x084004, 0x084007).ram().w(FUNC(nmk16_state::afega_scroll_w<1>)); // Scroll on redhawkb (mirror or changed?..) + map(0x084000, 0x084003).ram().w(FUNC(afega_state::afega_scroll_w<0>)); // Scroll on redhawkb (mirror or changed?..) + map(0x084004, 0x084007).ram().w(FUNC(afega_state::afega_scroll_w<1>)); // Scroll on redhawkb (mirror or changed?..) map(0x088000, 0x0885ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette - map(0x08c000, 0x08c003).ram().w(FUNC(nmk16_state::afega_scroll_w<0>)).share("afega_scroll_0"); // Scroll - map(0x08c004, 0x08c007).ram().w(FUNC(nmk16_state::afega_scroll_w<1>)).share("afega_scroll_1"); // - map(0x090000, 0x093fff).ram().w(FUNC(nmk16_state::nmk_bgvideoram_w<0>)).share("nmk_bgvideoram0"); // Layer 0 // ? - map(0x09c000, 0x09c7ff).ram().w(FUNC(nmk16_state::nmk_txvideoram_w)).share("nmk_txvideoram"); // Layer 1 + map(0x08c000, 0x08c003).ram().w(FUNC(afega_state::afega_scroll_w<0>)).share("afega_scroll_0"); // Scroll + map(0x08c004, 0x08c007).ram().w(FUNC(afega_state::afega_scroll_w<1>)).share("afega_scroll_1"); // + map(0x090000, 0x093fff).ram().w(FUNC(afega_state::bgvideoram_w<0>)).share("bgvideoram0"); // Layer 0 // ? + map(0x09c000, 0x09c7ff).ram().w(FUNC(afega_state::txvideoram_w)).share("txvideoram"); // Layer 1 - map(0x0c0000, 0x0cffff).ram().w(FUNC(nmk16_state::nmk16_mainram_strange_w)).share("mainram"); - map(0x0f0000, 0x0fffff).ram().w(FUNC(nmk16_state::nmk16_mainram_strange_w)).share("mainram"); + map(0x0c0000, 0x0cffff).ram().w(FUNC(afega_state::mainram_strange_w)).share("mainram"); + map(0x0f0000, 0x0fffff).ram().w(FUNC(afega_state::mainram_strange_w)).share("mainram"); } // firehawk has 0x100000 bytes of program ROM (at least the switchable version) so the above can't work. -void nmk16_state::firehawk_map(address_map &map) +void afega_state::firehawk_map(address_map &map) { map.global_mask(0x3fffff); map(0x000000, 0x0fffff).rom(); map(0x280000, 0x280001).portr("IN0"); // Buttons map(0x280002, 0x280003).portr("IN1"); // P1 + P2 map(0x280004, 0x280005).portr("DSW1"); // 2 x DSW - map(0x280012, 0x280013).r(FUNC(nmk16_state::afega_unknown_r)); + map(0x280012, 0x280013).r(FUNC(afega_state::afega_unknown_r)); map(0x28001f, 0x28001f).w(m_soundlatch, FUNC(generic_latch_8_device::write)); // To Sound CPU - map(0x284000, 0x284003).ram().w(FUNC(nmk16_state::afega_scroll_w<0>)); // Scroll on redhawkb (mirror or changed?..) - map(0x284004, 0x284007).ram().w(FUNC(nmk16_state::afega_scroll_w<1>)); // Scroll on redhawkb (mirror or changed?..) + map(0x284000, 0x284003).ram().w(FUNC(afega_state::afega_scroll_w<0>)); // Scroll on redhawkb (mirror or changed?..) + map(0x284004, 0x284007).ram().w(FUNC(afega_state::afega_scroll_w<1>)); // Scroll on redhawkb (mirror or changed?..) map(0x288000, 0x2885ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette - map(0x28c000, 0x28c003).ram().w(FUNC(nmk16_state::afega_scroll_w<0>)).share("afega_scroll_0"); // Scroll - map(0x28c004, 0x28c007).ram().w(FUNC(nmk16_state::afega_scroll_w<1>)).share("afega_scroll_1"); // - map(0x290000, 0x293fff).ram().w(FUNC(nmk16_state::nmk_bgvideoram_w<0>)).share("nmk_bgvideoram0"); // Layer 0 // ? - map(0x29c000, 0x29c7ff).ram().w(FUNC(nmk16_state::nmk_txvideoram_w)).share("nmk_txvideoram"); // Layer 1 + map(0x28c000, 0x28c003).ram().w(FUNC(afega_state::afega_scroll_w<0>)).share("afega_scroll_0"); // Scroll + map(0x28c004, 0x28c007).ram().w(FUNC(afega_state::afega_scroll_w<1>)).share("afega_scroll_1"); // + map(0x290000, 0x293fff).ram().w(FUNC(afega_state::bgvideoram_w<0>)).share("bgvideoram0"); // Layer 0 // ? + map(0x29c000, 0x29c7ff).ram().w(FUNC(afega_state::txvideoram_w)).share("txvideoram"); // Layer 1 - map(0x3c0000, 0x3cffff).ram().w(FUNC(nmk16_state::nmk16_mainram_strange_w)).share("mainram"); - map(0x3f0000, 0x3fffff).ram().w(FUNC(nmk16_state::nmk16_mainram_strange_w)).share("mainram"); + map(0x3c0000, 0x3cffff).ram().w(FUNC(afega_state::mainram_strange_w)).share("mainram"); + map(0x3f0000, 0x3fffff).ram().w(FUNC(afega_state::mainram_strange_w)).share("mainram"); } @@ -5305,15 +5310,15 @@ void nmk16_state::firehawk_map(address_map &map) ***************************************************************************/ -WRITE8_MEMBER(nmk16_state::spec2k_oki1_banking_w) +void afega_state::spec2k_oki1_banking_w(u8 data) { - if(data == 0xfe) + if (data == 0xfe) m_oki[1]->set_rom_bank(0); - else if(data == 0xff) + else if (data == 0xff) m_oki[1]->set_rom_bank(1); } -void nmk16_state::afega_sound_cpu(address_map &map) +void afega_state::afega_sound_cpu(address_map &map) { map(0x0003, 0x0003).nopw(); // bug in sound prg? map(0x0004, 0x0004).nopw(); // bug in sound prg? @@ -5324,37 +5329,18 @@ void nmk16_state::afega_sound_cpu(address_map &map) map(0xf80a, 0xf80a).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // M6295 } -void nmk16_state::firehawk_sound_cpu(address_map &map) +void afega_state::firehawk_sound_cpu(address_map &map) { map(0x0000, 0xefff).rom(); map(0xf000, 0xf7ff).ram(); map(0xf800, 0xffff).ram(); // not used, only tested map(0xfff0, 0xfff0).r(m_soundlatch, FUNC(generic_latch_8_device::read)); - map(0xfff2, 0xfff2).w(FUNC(nmk16_state::spec2k_oki1_banking_w)); + map(0xfff2, 0xfff2).w(FUNC(afega_state::spec2k_oki1_banking_w)); map(0xfff8, 0xfff8).rw(m_oki[1], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0xfffa, 0xfffa).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); } -WRITE8_MEMBER(nmk16_state::twinactn_oki_bank_w) -{ - m_oki[0]->set_rom_bank(data & 3); - - if (data & (~3)) - logerror("%s: invalid oki bank %02x\n", machine().describe_context(), data); - -// logerror("%04x: oki bank %02x\n", m_audiocpu->pc(), data); -} - -void nmk16_state::twinactn_sound_cpu(address_map &map) -{ - map(0x0000, 0x7fff).rom(); - map(0x8000, 0x87ff).ram(); - map(0x9000, 0x9000).w(FUNC(nmk16_state::twinactn_oki_bank_w)); - map(0x9800, 0x9800).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0xa000, 0xa000).r(m_soundlatch, FUNC(generic_latch_8_device::read)); // From Main CPU -} - /*************************************************************************** @@ -5363,67 +5349,39 @@ void nmk16_state::twinactn_sound_cpu(address_map &map) ***************************************************************************/ -static const gfx_layout layout_8x8x4 = -{ - 8,8, - RGN_FRAC(1,1), - 4, - { STEP4(0,1) }, - { STEP8(0,4) }, - { STEP8(0,8*4) }, - 8*8*4 -}; - -static const gfx_layout layout_16x16x4 = -{ - 16,16, - RGN_FRAC(1,1), - 4, - { STEP4(0,1) }, - { STEP8(0,4), STEP8(8*8*4*2,4) }, - { STEP8(0,8*4), STEP8(8*8*4*1,8*4) }, - 16*16*4 -}; - -static const gfx_layout layout_16x16x8 = +static const gfx_layout tilelayout_8bpp = { 16,16, RGN_FRAC(1,2), 8, - { STEP4(RGN_FRAC(0,2),1), STEP4(RGN_FRAC(1,2),1) }, - { STEP8(0,4), STEP8(8*8*4*2,4) }, - { STEP8(0,8*4), STEP8(8*8*4*1,8*4) }, + { STEP4(RGN_FRAC(0,2),1), STEP4(RGN_FRAC(1,2),1) }, + { STEP8(0,4), STEP8(4*8*16,4) }, + { STEP16(0,4*8) }, 16*16*4 }; -static const gfx_layout layout_16x16x4_swapped = +static const gfx_layout tilelayout_swapnibble = { 16,16, RGN_FRAC(1,1), 4, - { STEP4(0,1) }, - { 4,0,12,8,20,16,28,24, 512+4,512+0,512+12,512+8,512+20,512+16,512+28,512+24}, - { STEP8(0,8*4), STEP8(8*8*4*1,8*4) }, + { STEP4(0,1) }, + { 4,0,12,8,20,16,28,24, 512+4,512+0,512+12,512+8,512+20,512+16,512+28,512+24 }, + { STEP16(0,4*8) }, 16*16*4 }; static GFXDECODE_START( gfx_grdnstrm ) - GFXDECODE_ENTRY( "fgtile", 0, layout_8x8x4, 256*2, 16 ) // [2] Layer 1 - GFXDECODE_ENTRY( "bgtile", 0, layout_16x16x8, 256*0, 1 ) // [1] Layer 0 - GFXDECODE_ENTRY( "sprites", 0, layout_16x16x4, 256*1, 16 ) // [0] Sprites -GFXDECODE_END - -static GFXDECODE_START( gfx_stagger1 ) - GFXDECODE_ENTRY( "fgtile", 0, layout_8x8x4, 256*2, 16 ) // [2] Layer 1 - GFXDECODE_ENTRY( "bgtile", 0, layout_16x16x4, 256*0, 16 ) // [1] Layer 0 - GFXDECODE_ENTRY( "sprites", 0, layout_16x16x4, 256*1, 16 ) // [0] Sprites + GFXDECODE_ENTRY( "fgtile", 0, gfx_8x8x4_packed_msb, 0x200, 16 ) // [2] Layer 1 + GFXDECODE_ENTRY( "bgtile", 0, tilelayout_8bpp, 0x000, 1 ) // [1] Layer 0 + GFXDECODE_ENTRY( "sprites", 0, tilelayout, 0x100, 16 ) // [0] Sprites GFXDECODE_END static GFXDECODE_START( gfx_redhawkb ) - GFXDECODE_ENTRY( "fgtile", 0, layout_8x8x4, 256*2, 16 ) // [2] Layer 1 - GFXDECODE_ENTRY( "bgtile", 0, layout_16x16x4_swapped, 256*0, 16 ) // [1] Layer 0 - GFXDECODE_ENTRY( "sprites", 0, layout_16x16x4_swapped, 256*1, 16 ) // [0] Sprites + GFXDECODE_ENTRY( "fgtile", 0, gfx_8x8x4_packed_msb, 0x200, 16 ) // [2] Layer 1 + GFXDECODE_ENTRY( "bgtile", 0, tilelayout_swapnibble, 0x000, 16 ) // [1] Layer 0 + GFXDECODE_ENTRY( "sprites", 0, tilelayout_swapnibble, 0x100, 16 ) // [0] Sprites GFXDECODE_END @@ -5435,61 +5393,58 @@ GFXDECODE_END ***************************************************************************/ -void nmk16_state::stagger1(machine_config &config) +void afega_state::stagger1(machine_config &config) { /* basic machine hardware */ M68000(config, m_maincpu, XTAL(12'000'000)); /* 68000p10 running at 12mhz, verified on pcb */ - m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::afega_map); + m_maincpu->set_addrmap(AS_PROGRAM, &afega_state::afega_map); set_hacky_interrupt_timing(config); Z80(config, m_audiocpu, XTAL(4'000'000)); /* verified on pcb */ - m_audiocpu->set_addrmap(AS_PROGRAM, &nmk16_state::afega_sound_cpu); + m_audiocpu->set_addrmap(AS_PROGRAM, &afega_state::afega_sound_cpu); /* video hardware */ set_hacky_screen_lowres(config); - m_screen->set_screen_update(FUNC(nmk16_state::screen_update_afega)); + m_screen->set_screen_update(FUNC(afega_state::screen_update_afega)); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_stagger1); + GFXDECODE(config, m_gfxdecode, m_palette, gfx_macross); PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 768); - MCFG_VIDEO_START_OVERRIDE(nmk16_state,afega) + MCFG_VIDEO_START_OVERRIDE(afega_state,afega) /* sound hardware */ - SPEAKER(config, "lspeaker").front_left(); - SPEAKER(config, "rspeaker").front_right(); + SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, m_soundlatch); m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0); ym2151_device &ymsnd(YM2151(config, "ymsnd", XTAL(4'000'000))); /* verified on pcb */ ymsnd.irq_handler().set_inputline(m_audiocpu, 0); - ymsnd.add_route(0, "lspeaker", 0.30); - ymsnd.add_route(1, "rspeaker", 0.30); + ymsnd.add_route(ALL_OUTPUTS, "mono", 0.15); OKIM6295(config, m_oki[0], XTAL(4'000'000)/4, okim6295_device::PIN7_HIGH); /* verified on pcb */ - m_oki[0]->add_route(ALL_OUTPUTS, "lspeaker", 0.70); - m_oki[0]->add_route(ALL_OUTPUTS, "rspeaker", 0.70); + m_oki[0]->add_route(ALL_OUTPUTS, "mono", 0.70); } -void nmk16_state::redhawki(machine_config &config) +void afega_state::redhawki(machine_config &config) { stagger1(config); /* basic machine hardware */ /* video hardware */ - m_screen->set_screen_update(FUNC(nmk16_state::screen_update_redhawki)); + m_screen->set_screen_update(FUNC(afega_state::screen_update_redhawki)); } -void nmk16_state::redhawkb(machine_config &config) +void afega_state::redhawkb(machine_config &config) { stagger1(config); /* basic machine hardware */ /* video hardware */ m_gfxdecode->set_info(gfx_redhawkb); - m_screen->set_screen_update(FUNC(nmk16_state::screen_update_redhawkb)); + m_screen->set_screen_update(FUNC(afega_state::screen_update_redhawkb)); } -void nmk16_state::grdnstrm(machine_config &config) +void afega_state::grdnstrm(machine_config &config) { stagger1(config); @@ -5497,45 +5452,45 @@ void nmk16_state::grdnstrm(machine_config &config) /* video hardware */ m_gfxdecode->set_info(gfx_grdnstrm); - MCFG_VIDEO_START_OVERRIDE(nmk16_state,grdnstrm) - m_screen->set_screen_update(FUNC(nmk16_state::screen_update_firehawk)); + MCFG_VIDEO_START_OVERRIDE(afega_state,grdnstrm) + m_screen->set_screen_update(FUNC(afega_state::screen_update_firehawk)); } -void nmk16_state::grdnstrmk(machine_config &config) /* Side by side with PCB, the music seems too fast as well */ +void afega_state::grdnstrmk(machine_config &config) /* Side by side with PCB, the music seems too fast as well */ { stagger1(config); /* video hardware */ m_screen->set_refresh_hz(57); /* Side by side with PCB, MAME is too fast at 56 */ m_gfxdecode->set_info(gfx_grdnstrm); - MCFG_VIDEO_START_OVERRIDE(nmk16_state,grdnstrm) + MCFG_VIDEO_START_OVERRIDE(afega_state,grdnstrm) } -void nmk16_state::popspops(machine_config &config) +void afega_state::popspops(machine_config &config) { grdnstrm(config); /* video hardware */ - m_screen->set_screen_update(FUNC(nmk16_state::screen_update_bubl2000)); + m_screen->set_screen_update(FUNC(afega_state::screen_update_bubl2000)); } -void nmk16_state::firehawk(machine_config &config) +void afega_state::firehawk(machine_config &config) { /* basic machine hardware */ M68000(config, m_maincpu, 12000000); - m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::firehawk_map); + m_maincpu->set_addrmap(AS_PROGRAM, &afega_state::firehawk_map); set_hacky_interrupt_timing(config); Z80(config, m_audiocpu, 4000000); - m_audiocpu->set_addrmap(AS_PROGRAM, &nmk16_state::firehawk_sound_cpu); + m_audiocpu->set_addrmap(AS_PROGRAM, &afega_state::firehawk_sound_cpu); /* video hardware */ set_hacky_screen_lowres(config); - m_screen->set_screen_update(FUNC(nmk16_state::screen_update_firehawk)); + m_screen->set_screen_update(FUNC(afega_state::screen_update_firehawk)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_grdnstrm); PALETTE(config, m_palette).set_format(palette_device::RRRRGGGGBBBBRGBx, 768); - MCFG_VIDEO_START_OVERRIDE(nmk16_state,grdnstrm) + MCFG_VIDEO_START_OVERRIDE(afega_state,grdnstrm) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -5550,10 +5505,10 @@ void nmk16_state::firehawk(machine_config &config) m_oki[1]->add_route(ALL_OUTPUTS, "mono", 1.0); } -void nmk16_state::spec2k(machine_config &config) +void afega_state::spec2k(machine_config &config) { firehawk(config); - m_maincpu->set_addrmap(AS_PROGRAM, &nmk16_state::afega_map); + m_maincpu->set_addrmap(AS_PROGRAM, &afega_state::afega_map); } @@ -5565,7 +5520,7 @@ void nmk16_state::twinactn(machine_config &config) set_hacky_interrupt_timing(config); Z80(config, m_audiocpu, 4000000); - m_audiocpu->set_addrmap(AS_PROGRAM, &nmk16_state::twinactn_sound_cpu); + m_audiocpu->set_addrmap(AS_PROGRAM, &nmk16_state::ssmissin_sound_map); /* video hardware */ set_hacky_screen_lowres(config); @@ -5582,6 +5537,7 @@ void nmk16_state::twinactn(machine_config &config) m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0); OKIM6295(config, m_oki[0], 1000000, okim6295_device::PIN7_HIGH); + m_oki[0]->set_addrmap(0, &nmk16_state::oki1_map); m_oki[0]->add_route(ALL_OUTPUTS, "mono", 1.0); } @@ -5599,16 +5555,15 @@ void nmk16_state::twinactn(machine_config &config) static void decryptcode( running_machine &machine, int a23, int a22, int a21, int a20, int a19, int a18, int a17, int a16, int a15, int a14, int a13, int a12, int a11, int a10, int a9, int a8, int a7, int a6, int a5, int a4, int a3, int a2, int a1, int a0 ) { - int i; - uint8_t *RAM = machine.root_device().memregion( "maincpu" )->base(); - size_t size = machine.root_device().memregion( "maincpu" )->bytes(); - std::vector buffer( size ); + u8 *RAM = machine.root_device().memregion("maincpu")->base(); + size_t size = machine.root_device().memregion("maincpu")->bytes(); + std::vector buffer(size); - memcpy( &buffer[0], RAM, size ); - for( i = 0; i < size; i++ ) + memcpy(&buffer[0], RAM, size); + for (int i = 0; i < size; i++) { - RAM[ i ] = buffer[ bitswap<24>( i, a23, a22, a21, a20, a19, a18, a17, a16, a15, a14, a13, a12, - a11, a10, a9, a8, a7, a6, a5, a4, a3, a2, a1, a0 ) ]; + RAM[i] = buffer[bitswap<24>(i, a23, a22, a21, a20, a19, a18, a17, a16, a15, a14, a13, a12, + a11, a10, a9, a8, a7, a6, a5, a4, a3, a2, a1, a0)]; } } @@ -5741,17 +5696,17 @@ ROM_END ROM_START( tharrier ) ROM_REGION( 0x40000, "maincpu", 0 ) - ROM_LOAD16_BYTE( "2.bin" , 0x00000, 0x20000, CRC(f3887a44) SHA1(4e5b660d33ba1d1e00263030efa67e2db376a234) ) - ROM_LOAD16_BYTE( "3.bin" , 0x00001, 0x20000, CRC(65c247f6) SHA1(9f35f2b6f54814b4c4d23e2d78db8043e678fef2) ) + ROM_LOAD16_BYTE( "2.bin", 0x00000, 0x20000, CRC(f3887a44) SHA1(4e5b660d33ba1d1e00263030efa67e2db376a234) ) + ROM_LOAD16_BYTE( "3.bin", 0x00001, 0x20000, CRC(65c247f6) SHA1(9f35f2b6f54814b4c4d23e2d78db8043e678fef2) ) ROM_REGION( 0x010000, "audiocpu", 0 ) - ROM_LOAD( "12" , 0x00000, 0x10000, CRC(b959f837) SHA1(073b14935e7d5b0cad19a3471fd26e9e3a363827) ) + ROM_LOAD( "12", 0x00000, 0x10000, CRC(b959f837) SHA1(073b14935e7d5b0cad19a3471fd26e9e3a363827) ) ROM_REGION( 0x020000, "fgtile", 0 ) - ROM_LOAD( "1.bin" , 0x000000, 0x10000, CRC(005c26c3) SHA1(ee88d8f956b9b0a8ba5fb49c5c05f6ed6f01729c) ) + ROM_LOAD( "1.bin", 0x000000, 0x10000, CRC(005c26c3) SHA1(ee88d8f956b9b0a8ba5fb49c5c05f6ed6f01729c) ) ROM_REGION( 0x080000, "bgtile", 0 ) - ROM_LOAD( "89050-4" , 0x000000, 0x80000, CRC(64d7d687) SHA1(dcfeac71fd577439e31cc1186b720388fbdc6ca0) ) + ROM_LOAD( "89050-4", 0x000000, 0x80000, CRC(64d7d687) SHA1(dcfeac71fd577439e31cc1186b720388fbdc6ca0) ) ROM_REGION( 0x100000, "sprites", 0 ) ROM_LOAD16_BYTE( "89050-13", 0x000000, 0x80000, CRC(24db3fa4) SHA1(e0d76c479dfcacf03c04ec4760caecf3fd1e2ff7) ) /* Sprites */ @@ -5774,17 +5729,17 @@ ROM_END ROM_START( tharrieru ) ROM_REGION( 0x40000, "maincpu", 0 ) - ROM_LOAD16_BYTE( "2" , 0x00000, 0x20000, CRC(78923aaa) SHA1(28338f49581180604403e1bd200f524fc4cb8b9f) ) - ROM_LOAD16_BYTE( "3" , 0x00001, 0x20000, CRC(99cea259) SHA1(75abfb08b2358dd13809ade5a2dfffeb8b8df82c) ) + ROM_LOAD16_BYTE( "2", 0x00000, 0x20000, CRC(78923aaa) SHA1(28338f49581180604403e1bd200f524fc4cb8b9f) ) + ROM_LOAD16_BYTE( "3", 0x00001, 0x20000, CRC(99cea259) SHA1(75abfb08b2358dd13809ade5a2dfffeb8b8df82c) ) ROM_REGION( 0x010000, "audiocpu", 0 ) - ROM_LOAD( "12" , 0x00000, 0x10000, CRC(b959f837) SHA1(073b14935e7d5b0cad19a3471fd26e9e3a363827) ) + ROM_LOAD( "12", 0x00000, 0x10000, CRC(b959f837) SHA1(073b14935e7d5b0cad19a3471fd26e9e3a363827) ) ROM_REGION( 0x020000, "fgtile", 0 ) - ROM_LOAD( "1" , 0x000000, 0x10000, CRC(c7402e4a) SHA1(25cade2f8d4784887f0f51beb48b1e6b695629c2) ) + ROM_LOAD( "1", 0x000000, 0x10000, CRC(c7402e4a) SHA1(25cade2f8d4784887f0f51beb48b1e6b695629c2) ) ROM_REGION( 0x080000, "bgtile", 0 ) - ROM_LOAD( "89050-4" , 0x000000, 0x80000, CRC(64d7d687) SHA1(dcfeac71fd577439e31cc1186b720388fbdc6ca0) ) + ROM_LOAD( "89050-4", 0x000000, 0x80000, CRC(64d7d687) SHA1(dcfeac71fd577439e31cc1186b720388fbdc6ca0) ) ROM_REGION( 0x100000, "sprites", 0 ) ROM_LOAD16_BYTE( "89050-13", 0x000000, 0x80000, CRC(24db3fa4) SHA1(e0d76c479dfcacf03c04ec4760caecf3fd1e2ff7) ) /* Sprites */ @@ -5830,7 +5785,7 @@ ROM_START( mustang ) ROM_LOAD( "90058-6", 0x00000, 0x80000, CRC(233c1776) SHA1(7010a2f914611698a65bf4f22bc1753a9ed26277) ) /* 0x20000 - 0x80000 banked */ ROM_REGION( 0x200, "proms", 0 ) - ROM_LOAD( "10.bpr", 0x00000, 0x100, CRC(633ab1c9) SHA1(acd99fcca41eaab7948ca84988352f1d7d519c61) ) /* unknown */ + ROM_LOAD( "10.bpr", 0x00000, 0x100, CRC(633ab1c9) SHA1(acd99fcca41eaab7948ca84988352f1d7d519c61) ) /* unknown */ ROM_LOAD( "90058-11", 0x00100, 0x100, CRC(cfdbb86c) SHA1(588822f6308a860937349c9106c2b4b1a75823ec) ) /* unknown */ ROM_END @@ -7045,7 +7000,7 @@ ROM_START( sabotenb ) ROM_LOAD( "ic35.sb3", 0x000000, 0x010000, CRC(eb7bc99d) SHA1(b3063afd58025a441d4750c22483e9129da402e7) ) /* 8x8 tiles */ ROM_REGION( 0x200000, "bgtile", 0 ) - ROM_LOAD( "ic32.sb4", 0x000000, 0x200000, CRC(24c62205) SHA1(3ab0ca5d7c698328d91421ccf6f7dafc20df3c8d) ) /* 16x16 tiles */ + ROM_LOAD( "ic32.sb4", 0x000000, 0x200000, CRC(24c62205) SHA1(3ab0ca5d7c698328d91421ccf6f7dafc20df3c8d) ) /* 8x8 tiles */ ROM_REGION( 0x200000, "sprites", 0 ) ROM_LOAD16_WORD_SWAP( "ic100.sb5", 0x000000, 0x200000, CRC(b20f166e) SHA1(074d770fd6d233040a80a92f4467d81f961c650b) ) /* Sprites */ @@ -7066,7 +7021,7 @@ ROM_START( sabotenba ) ROM_LOAD( "ic35.sb3", 0x000000, 0x010000, CRC(eb7bc99d) SHA1(b3063afd58025a441d4750c22483e9129da402e7) ) /* 8x8 tiles */ ROM_REGION( 0x200000, "bgtile", 0 ) - ROM_LOAD( "ic32.sb4", 0x000000, 0x200000, CRC(24c62205) SHA1(3ab0ca5d7c698328d91421ccf6f7dafc20df3c8d) ) /* 16x16 tiles */ + ROM_LOAD( "ic32.sb4", 0x000000, 0x200000, CRC(24c62205) SHA1(3ab0ca5d7c698328d91421ccf6f7dafc20df3c8d) ) /* 8x8 tiles */ ROM_REGION( 0x200000, "sprites", 0 ) ROM_LOAD16_WORD_SWAP( "ic100.sb5", 0x000000, 0x200000, CRC(b20f166e) SHA1(074d770fd6d233040a80a92f4467d81f961c650b) ) /* Sprites */ @@ -7110,7 +7065,7 @@ ROM_START( bjtwin ) ROM_LOAD( "93087-3.bin", 0x000000, 0x010000, CRC(aa13df7c) SHA1(162d4f12364c68028e86fe97ee75c262daa4c699) ) /* 8x8 tiles */ ROM_REGION( 0x100000, "bgtile", 0 ) - ROM_LOAD( "93087-4.bin", 0x000000, 0x100000, CRC(8a4f26d0) SHA1(be057a2b6d28c623ac1f16cf02ddbe12ca430b4a) ) /* 16x16 tiles */ + ROM_LOAD( "93087-4.bin", 0x000000, 0x100000, CRC(8a4f26d0) SHA1(be057a2b6d28c623ac1f16cf02ddbe12ca430b4a) ) /* 8x8 tiles */ ROM_REGION( 0x100000, "sprites", 0 ) ROM_LOAD16_WORD_SWAP( "93087-5.bin", 0x000000, 0x100000, CRC(bb06245d) SHA1(c91e2284d95370b8ef2eb1b9d6305fdd6cde23a0) ) /* Sprites */ @@ -7135,7 +7090,7 @@ ROM_START( bjtwina ) ROM_LOAD( "93087-3.bin", 0x000000, 0x010000, CRC(aa13df7c) SHA1(162d4f12364c68028e86fe97ee75c262daa4c699) ) /* 8x8 tiles */ ROM_REGION( 0x100000, "bgtile", 0 ) - ROM_LOAD( "93087-4.bin", 0x000000, 0x100000, CRC(8a4f26d0) SHA1(be057a2b6d28c623ac1f16cf02ddbe12ca430b4a) ) /* 16x16 tiles */ + ROM_LOAD( "93087-4.bin", 0x000000, 0x100000, CRC(8a4f26d0) SHA1(be057a2b6d28c623ac1f16cf02ddbe12ca430b4a) ) /* 8x8 tiles */ ROM_REGION( 0x100000, "sprites", 0 ) ROM_LOAD16_WORD_SWAP( "93087-5.bin", 0x000000, 0x100000, CRC(bb06245d) SHA1(c91e2284d95370b8ef2eb1b9d6305fdd6cde23a0) ) /* Sprites */ @@ -7214,7 +7169,7 @@ ROM_START( nouryoku ) ROM_LOAD( "ic35.3", 0x000000, 0x010000, CRC(03d0c3b1) SHA1(4d5427c324e2141d0a953cc5133d10b327827e0b) ) /* 8x8 tiles */ ROM_REGION( 0x200000, "bgtile", 0 ) - ROM_LOAD( "ic32.4", 0x000000, 0x200000, CRC(88d454fd) SHA1(c79c48d9b3602266499a5dd0b15fd2fb032809be) ) /* 16x16 tiles */ + ROM_LOAD( "ic32.4", 0x000000, 0x200000, CRC(88d454fd) SHA1(c79c48d9b3602266499a5dd0b15fd2fb032809be) ) /* 8x8 tiles */ ROM_REGION( 0x200000, "sprites", 0 ) ROM_LOAD16_WORD_SWAP( "ic100.5", 0x000000, 0x200000, CRC(24d3e24e) SHA1(71e38637953ec98bf308824aaef5628803aead21) ) /* Sprites */ @@ -7394,7 +7349,7 @@ Other: Lattice pLSI 1032 x 2 ***************************************************************************/ -void nmk16_state::init_redhawk() +void afega_state::init_redhawk() { decryptcode( machine(), 23, 22, 21, 20, 19, 18, 16, 15, 14, 17, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 ); } @@ -7443,7 +7398,7 @@ ROM_START( redhawke ) /* Excellent Co., Ldt license (no code scramble), (c) 1997 ROM_LOAD( "5", 0x00000, 0x40000, CRC(e911ce33) SHA1(a29c4dea98a22235122303325c63c15fadd3431d) ) ROM_END -void nmk16_state::init_redhawki() +void afega_state::init_redhawki() { decryptcode( machine(), 23, 22, 21, 20, 19, 18, 15, 16, 17, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 ); } @@ -7470,7 +7425,7 @@ ROM_START( redhawki ) ROM_LOAD( "5", 0x00000, 0x40000, CRC(e911ce33) SHA1(a29c4dea98a22235122303325c63c15fadd3431d) ) ROM_END -void nmk16_state::init_redhawkg() +void afega_state::init_redhawkg() { decryptcode( machine(), 23, 22, 21, 20, 19, 18, 15, 14, 16, 17, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 ); } @@ -7607,7 +7562,7 @@ AF1-B1.UC3 mask ROM read as 27C160 - Backgrounds ***************************************************************************/ -void nmk16_state::init_grdnstrm() +void afega_state::init_grdnstrm() { decryptcode( machine(), 23, 22, 21, 20, 19, 18, 16, 17, 14, 15, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 ); } @@ -7700,9 +7655,9 @@ ROM_START( grdnstrmv ) /* Apples Industries license - Vertical version */ ROM_LOAD( "afega1.u95", 0x00000, 0x40000, CRC(e911ce33) SHA1(a29c4dea98a22235122303325c63c15fadd3431d) ) ROM_END -void nmk16_state::init_grdnstrmg() +void afega_state::init_grdnstrmg() { - decryptcode( machine(), 23, 22, 21, 20, 19, 18, 13, 16, 15 ,14, 17, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 ); + decryptcode( machine(), 23, 22, 21, 20, 19, 18, 13, 16, 15, 14, 17, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 ); } ROM_START( grdnstrmg ) /* Germany */ @@ -7734,7 +7689,7 @@ ROM_START( grdnstrmg ) /* Germany */ ROM_LOAD( "gs2_s2.uc18", 0x00000, 0x40000, CRC(e911ce33) SHA1(a29c4dea98a22235122303325c63c15fadd3431d) ) // ROM_END -void nmk16_state::init_grdnstrmau() +void afega_state::init_grdnstrmau() { decryptcode( machine(), 23, 22, 21, 20, 19, 18, 13, 16, 14, 15, 17, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 ); } @@ -7789,7 +7744,7 @@ ROM_START( redfoxwp2 ) ROM_LOAD( "afega1.u95", 0x00000, 0x40000, CRC(e911ce33) SHA1(a29c4dea98a22235122303325c63c15fadd3431d) ) ROM_END -void nmk16_state::init_redfoxwp2a() +void afega_state::init_redfoxwp2a() { decryptcode( machine(), 23, 22, 21, 20, 19, 18, 16, 17, 13, 14, 15, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 ); } @@ -7942,7 +7897,7 @@ V1.2 V1.2 The PCB had a genuine Tuning stick with 11 & 98 struck out for month and year ***************************************************************************/ -void nmk16_state::init_bubl2000() +void afega_state::init_bubl2000() { decryptcode( machine(), 23, 22, 21, 20, 19, 18, 13, 14, 15, 16, 17, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 ); } @@ -8143,15 +8098,10 @@ ROM_START( dolmen ) /* Original source of the caveman concept for Bubble 2000 / ROM_REGION( 0x20000, "fgtile", 0 ) /* Layer 1, 8x8x4 */ ROM_LOAD( "afega6.uj11", 0x00000, 0x20000, CRC(13fa4415) SHA1(193524ebccbaae6b8c00893c42399c38cafdbd79) ) - ROM_REGION( 0x100000, "oki1", 0 ) /* Samples */ + ROM_REGION( 0x80000, "oki1", 0 ) /* Samples */ ROM_LOAD( "afega2.su12", 0x000000, 0x20000, CRC(1a2ce1c2) SHA1(ae6991fbfe57d35f32b541367d3b31244456713e) ) - ROM_RELOAD( 0x040000, 0x20000 ) - ROM_RELOAD( 0x080000, 0x20000 ) - ROM_RELOAD( 0x0c0000, 0x20000 ) ROM_RELOAD( 0x020000, 0x20000 ) - ROM_RELOAD( 0x060000, 0x20000 ) - ROM_LOAD( "afega3.su13", 0x0a0000, 0x20000, CRC(d3531018) SHA1(940067a8634339258666c89319cb0e1b43f2af56) ) - ROM_CONTINUE( 0x0e0000, 0x20000 ) + ROM_LOAD( "afega3.su13", 0x040000, 0x40000, CRC(d3531018) SHA1(940067a8634339258666c89319cb0e1b43f2af56) ) ROM_END @@ -8297,7 +8247,7 @@ UC1, UC2 & UC3 have solder pads for both MX29F1610 Flash & 27C160 EPROMs ***************************************************************************/ -void nmk16_state::init_spec2k() +void afega_state::init_spec2k() { decryptcode( machine(), 23, 22, 21, 20, 19, 18, 17, 13, 14, 15, 16, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 ); } @@ -8391,15 +8341,10 @@ ROM_START( twinactn ) ROM_REGION( 0x20000, "fgtile", 0 ) /* Layer 1, 8x8x4 */ ROM_LOAD( "afega.uj11", 0x00000, 0x20000, CRC(3f439e92) SHA1(27e5b1b0aa3b13fa35e3f83793037314b2942aa2) ) - ROM_REGION( 0x100000, "oki1", 0 ) /* Samples */ + ROM_REGION( 0x80000, "oki1", 0 ) /* Samples */ ROM_LOAD( "afega.su12", 0x000000, 0x20000, CRC(91d665f3) SHA1(10b5b07ed28ea78b6d3493afc03e003a8468c007) ) - ROM_RELOAD( 0x040000, 0x20000 ) - ROM_RELOAD( 0x080000, 0x20000 ) - ROM_RELOAD( 0x0c0000, 0x20000 ) ROM_RELOAD( 0x020000, 0x20000 ) - ROM_RELOAD( 0x060000, 0x20000 ) - ROM_LOAD( "afega.su13", 0x0a0000, 0x20000, CRC(30e1c306) SHA1(c859f11fd329793b11e96264e91c79a557b488a4) ) - ROM_CONTINUE( 0x0e0000, 0x20000 ) + ROM_LOAD( "afega.su13", 0x040000, 0x40000, CRC(30e1c306) SHA1(c859f11fd329793b11e96264e91c79a557b488a4) ) ROM_END /*************************************************************************** @@ -8420,9 +8365,9 @@ GAME( 1990, mustangs, mustang, mustang, mustang, nmk16_state, empty GAME( 1990, bioship, 0, bioship, bioship, nmk16_state, empty_init, ROT0, "UPL (American Sammy license)", "Bio-ship Paladin", 0 ) // US version but no regional notice GAME( 1990, sbsgomo, bioship, bioship, bioship, nmk16_state, empty_init, ROT0, "UPL", "Space Battle Ship Gomorrah", 0 ) -GAME( 1990, vandyke, 0, vandyke, vandyke, nmk16_state, empty_init, ROT270, "UPL", "Vandyke (Japan)", 0 ) -GAME( 1990, vandykejal, vandyke, vandyke, vandyke, nmk16_state, empty_init, ROT270, "UPL (Jaleco license)", "Vandyke (Jaleco, set 1)", 0 ) -GAME( 1990, vandykejal2,vandyke, vandyke, vandyke, nmk16_state, empty_init, ROT270, "UPL (Jaleco license)", "Vandyke (Jaleco, set 2)", 0 ) +GAME( 1990, vandyke, 0, vandyke, vandyke, nmk16_state, empty_init, ROT270, "UPL", "Vandyke (Japan)", 0 ) +GAME( 1990, vandykejal, vandyke, vandyke, vandyke, nmk16_state, empty_init, ROT270, "UPL (Jaleco license)", "Vandyke (Jaleco, set 1)", 0 ) +GAME( 1990, vandykejal2,vandyke, vandyke, vandyke, nmk16_state, empty_init, ROT270, "UPL (Jaleco license)", "Vandyke (Jaleco, set 2)", 0 ) GAME( 1990, vandykeb, vandyke, vandykeb, vandykeb, nmk16_state, init_vandykeb, ROT270, "bootleg", "Vandyke (bootleg with PIC16c57)", MACHINE_NO_SOUND ) GAME( 1991, blkheart, 0, blkheart, blkheart, nmk16_state, empty_init, ROT0, "UPL", "Black Heart", 0 ) @@ -8471,12 +8416,17 @@ GAME( 1993, bjtwina, bjtwin, bjtwin, bjtwin, nmk16_state, init_ GAME( 1993, bjtwinp, bjtwin, bjtwin, bjtwin, nmk16_state, empty_init, ROT270, "NMK", "Bombjack Twin (prototype? with adult pictures, set 1)", MACHINE_NO_COCKTAIL ) // Cheap looking PCB, but Genuine NMK PCB, GFX aren't encrypted (maybe Korean version not proto?) GAME( 1993, bjtwinpa, bjtwin, bjtwin, bjtwin, nmk16_state, init_bjtwin, ROT270, "NMK", "Bombjack Twin (prototype? with adult pictures, set 2)", MACHINE_NO_COCKTAIL ) // same PCB as above, different program revision, GFX are encrypted - GAME( 1995, nouryoku, 0, bjtwin, nouryoku, nmk16_state, init_nmk, ROT0, "Tecmo", "Nouryoku Koujou Iinkai", MACHINE_NO_COCKTAIL ) GAME( 1995, nouryokup, nouryoku, bjtwin, nouryoku, nmk16_state, empty_init, ROT0, "Tecmo", "Nouryoku Koujou Iinkai (prototype)", MACHINE_NO_COCKTAIL ) // GFX aren't encrypted /* Non NMK boards */ +// bee-oh board - different display / interrupt timing to others? +GAME( 1991, manybloc, 0, manybloc, manybloc, nmk16_state, init_tharrier, ROT270, "Bee-Oh", "Many Block", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND ) + +// clone board, different sound / bg hardware, but similar memory maps, same tx layer, sprites etc. +GAME( 1997, tomagic, 0, tomagic, tomagic, nmk16_tomagic_state, init_tomagic, ROT0, "Hobbitron T.K.Trading Co. Ltd.", "Tom Tom Magic", 0 ) + // these use the seibu sound system (sound / music stolen from Raiden) rather than the bootleggers copying the nmk004 GAME( 1990, mustangb, mustang, mustangb, mustang, nmk16_state, empty_init, ROT0, "bootleg", "US AAF Mustang (bootleg)", 0 ) GAME( 1990, mustangb2, mustang, mustangb, mustang, nmk16_state, empty_init, ROT0, "bootleg (TAB Austria)", "US AAF Mustang (TAB Austria bootleg)", 0 ) // PCB and ROMs have TAB Austria stickers @@ -8489,45 +8439,39 @@ GAME( 1996, airattck, 0, ssmissin, airattck, nmk16_state, init_ GAME( 1996, airattcka, airattck, ssmissin, airattck, nmk16_state, init_ssmissin, ROT270, "Comad", "Air Attack (set 2)", MACHINE_NO_COCKTAIL ) // afega & clones -GAME( 1995, twinactn, 0, twinactn, twinactn, nmk16_state, empty_init, ROT0, "Afega", "Twin Action", 0 ) // hacked from USSAF Mustang - -GAME( 1995, dolmen, 0, twinactn, dolmen, nmk16_state, empty_init, ROT0, "Afega", "Dolmen", 0 ) - -GAME( 1998, stagger1, 0, stagger1, stagger1, nmk16_state, empty_init, ROT270, "Afega", "Stagger I (Japan)", 0 ) -GAME( 1997, redhawk, stagger1, stagger1, stagger1, nmk16_state, init_redhawk, ROT270, "Afega (New Vision Ent. license)", "Red Hawk (US)", 0 ) -GAME( 1997, redhawki, stagger1, redhawki, stagger1, nmk16_state, init_redhawki, ROT0, "Afega (Hea Dong Corp license)", "Red Hawk (Italy)", 0 ) // bootleg? strange scroll regs -GAME( 1997, redhawkg, stagger1, redhawki, stagger1, nmk16_state, init_redhawkg, ROT0, "Afega", "Red Hawk (Greece)", 0 ) -GAME( 1997, redhawke, stagger1, stagger1, stagger1, nmk16_state, empty_init, ROT270, "Afega (Excellent Co. license)", "Red Hawk (Excellent Co., Ltd)", 0 ) -GAME( 1997, redhawkk, stagger1, stagger1, stagger1, nmk16_state, empty_init, ROT270, "Afega", "Red Hawk (Korea)", 0 ) -GAME( 1997, redhawkb, stagger1, redhawkb, redhawkb, nmk16_state, empty_init, ROT0, "bootleg", "Vince (bootleg of Red Hawk)", 0 ) - -GAME( 1998, grdnstrm, 0, grdnstrm, grdnstrm, nmk16_state, empty_init, ORIENTATION_FLIP_Y, "Afega (Apples Industries license)", "Guardian Storm (horizontal, not encrypted)", 0 ) -GAME( 1998, grdnstrmv, grdnstrm, grdnstrmk, grdnstrk, nmk16_state, init_grdnstrm, ROT270, "Afega (Apples Industries license)", "Guardian Storm (vertical)", 0 ) -GAME( 1998, grdnstrmj, grdnstrm, grdnstrmk, grdnstrk, nmk16_state, init_grdnstrmg, ROT270, "Afega", "Sen Jing - Guardian Storm (Japan)", 0 ) -GAME( 1998, grdnstrmk, grdnstrm, grdnstrmk, grdnstrk, nmk16_state, init_grdnstrm, ROT270, "Afega", "Jeon Sin - Guardian Storm (Korea)", 0 ) -GAME( 1998, redfoxwp2, grdnstrm, grdnstrmk, grdnstrk, nmk16_state, init_grdnstrm, ROT270, "Afega", "Hong Hu Zhanji II (China, set 1)", 0 ) -GAME( 1998, redfoxwp2a, grdnstrm, grdnstrmk, grdnstrk, nmk16_state, init_redfoxwp2a, ROT270, "Afega", "Hong Hu Zhanji II (China, set 2)", 0 ) -GAME( 1998, grdnstrmg, grdnstrm, grdnstrmk, grdnstrk, nmk16_state, init_grdnstrmg, ROT270, "Afega", "Guardian Storm (Germany)", 0 ) -GAME( 1998, grdnstrmau, grdnstrm, grdnstrm, grdnstrm, nmk16_state, init_grdnstrmau, ORIENTATION_FLIP_Y, "Afega", "Guardian Storm (horizontal, Australia)", 0 ) +GAME( 1995, twinactn, 0, twinactn, twinactn, nmk16_state, init_twinactn, ROT0, "Afega", "Twin Action", 0 ) // hacked from USSAF Mustang + +GAME( 1995, dolmen, 0, twinactn, dolmen, nmk16_state, init_twinactn, ROT0, "Afega", "Dolmen", 0 ) + +GAME( 1998, stagger1, 0, stagger1, stagger1, afega_state, empty_init, ROT270, "Afega", "Stagger I (Japan)", 0 ) +GAME( 1997, redhawk, stagger1, stagger1, stagger1, afega_state, init_redhawk, ROT270, "Afega (New Vision Ent. license)", "Red Hawk (USA, Canada & South America)", 0 ) +GAME( 1997, redhawki, stagger1, redhawki, stagger1, afega_state, init_redhawki, ROT0, "Afega (Hea Dong Corp license)", "Red Hawk (horizontal, Italy)", 0 ) // bootleg? strange scroll regs +GAME( 1997, redhawkg, stagger1, redhawki, stagger1, afega_state, init_redhawkg, ROT0, "Afega", "Red Hawk (horizontal, Greece)", 0 ) +GAME( 1997, redhawke, stagger1, stagger1, stagger1, afega_state, empty_init, ROT270, "Afega (Excellent Co. license)", "Red Hawk (Excellent Co., Ltd)", 0 ) // earlier revision? different afega logo and score and credit number fonts compared to other sets +GAME( 1997, redhawkk, stagger1, stagger1, stagger1, afega_state, empty_init, ROT270, "Afega", "Red Hawk (Korea)", 0 ) +GAME( 1997, redhawkb, stagger1, redhawkb, redhawkb, afega_state, empty_init, ROT0, "bootleg (Vince)", "Red Hawk (horizontal, bootleg)", 0 ) + +GAME( 1998, grdnstrm, 0, grdnstrm, grdnstrm, afega_state, empty_init, ORIENTATION_FLIP_Y, "Afega (Apples Industries license)", "Guardian Storm (horizontal, not encrypted)", 0 ) +GAME( 1998, grdnstrmv, grdnstrm, grdnstrmk, grdnstrk, afega_state, init_grdnstrm, ROT270, "Afega (Apples Industries license)", "Guardian Storm (vertical)", 0 ) +GAME( 1998, grdnstrmj, grdnstrm, grdnstrmk, grdnstrk, afega_state, init_grdnstrmg, ROT270, "Afega", "Sen Jing - Guardian Storm (Japan)", 0 ) +GAME( 1998, grdnstrmk, grdnstrm, grdnstrmk, grdnstrk, afega_state, init_grdnstrm, ROT270, "Afega", "Jeon Sin - Guardian Storm (Korea)", 0 ) +GAME( 1998, redfoxwp2, grdnstrm, grdnstrmk, grdnstrk, afega_state, init_grdnstrm, ROT270, "Afega", "Hong Hu Zhanji II (China, set 1)", 0 ) +GAME( 1998, redfoxwp2a, grdnstrm, grdnstrmk, grdnstrk, afega_state, init_redfoxwp2a, ROT270, "Afega", "Hong Hu Zhanji II (China, set 2)", 0 ) +GAME( 1998, grdnstrmg, grdnstrm, grdnstrmk, grdnstrk, afega_state, init_grdnstrmg, ROT270, "Afega", "Guardian Storm (Germany)", 0 ) +GAME( 1998, grdnstrmau, grdnstrm, grdnstrm, grdnstrm, afega_state, init_grdnstrmau, ORIENTATION_FLIP_Y, "Afega", "Guardian Storm (horizontal, Australia)", 0 ) // is there a 'bubble 2000' / 'hot bubble' version with Afega copyright, or is the only Afega release dolmen above, this seems like a sequel, not a clone? -GAME( 1998, bubl2000, 0, popspops, bubl2000, nmk16_state, init_bubl2000, ROT0, "Afega (Tuning license)", "Bubble 2000", 0 ) // on a tuning board - Has a Demo Sound DSW -GAME( 1998, bubl2000a, bubl2000, popspops, bubl2000a, nmk16_state, init_bubl2000, ROT0, "Afega (Tuning license)", "Bubble 2000 V1.2", 0 ) // on a tuning board - No Demo Sounds -GAME( 1998, hotbubl, bubl2000, popspops, bubl2000, nmk16_state, init_bubl2000, ROT0, "Afega (Pandora license)", "Hot Bubble (Korea, with adult pictures)" , 0 ) // on an afega board .. -GAME( 1998, hotbubla, bubl2000, popspops, bubl2000, nmk16_state, init_bubl2000, ROT0, "Afega (Pandora license)", "Hot Bubble (Korea)" , 0 ) // on an afega board .. +GAME( 1998, bubl2000, 0, popspops, bubl2000, afega_state, init_bubl2000, ROT0, "Afega (Tuning license)", "Bubble 2000", 0 ) // on a tuning board - Has a Demo Sound DSW +GAME( 1998, bubl2000a, bubl2000, popspops, bubl2000a, afega_state, init_bubl2000, ROT0, "Afega (Tuning license)", "Bubble 2000 V1.2", 0 ) // on a tuning board - No Demo Sounds +GAME( 1998, hotbubl, bubl2000, popspops, bubl2000, afega_state, init_bubl2000, ROT0, "Afega (Pandora license)", "Hot Bubble (Korea, with adult pictures)", 0 ) // on an afega board .. +GAME( 1998, hotbubla, bubl2000, popspops, bubl2000, afega_state, init_bubl2000, ROT0, "Afega (Pandora license)", "Hot Bubble (Korea)", 0 ) // on an afega board .. -GAME( 1999, popspops, 0, popspops, popspops, nmk16_state, init_grdnstrm, ROT0, "Afega", "Pop's Pop's", 0 ) +GAME( 1999, popspops, 0, popspops, popspops, afega_state, init_grdnstrm, ROT0, "Afega", "Pop's Pop's", 0 ) -GAME( 2000, mangchi, 0, popspops, mangchi, nmk16_state, init_bubl2000, ROT0, "Afega", "Mang-Chi", 0 ) +GAME( 2000, mangchi, 0, popspops, mangchi, afega_state, init_bubl2000, ROT0, "Afega", "Mang-Chi", 0 ) // these two are very similar games, but the exact parent/clone relationship is unknown -GAME( 2000, spec2k, 0, spec2k, spec2k, nmk16_state, init_spec2k, ROT270, "Yona Tech", "Spectrum 2000 (vertical)", MACHINE_IMPERFECT_GRAPHICS ) // the ships sometimes scroll off the screen if you insert a coin during the attract demo? verify it doesn't happen on real hw(!) -GAME( 2000, spec2kh, spec2k, spec2k, spec2k, nmk16_state, init_spec2k, ORIENTATION_FLIP_Y, "Yona Tech", "Spectrum 2000 (horizontal, buggy) (Europe)", 0 ) // this has odd bugs even on real hardware, eg glitchy 3 step destruction sequence of some larger enemies -GAME( 2001, firehawk, spec2k, firehawk, firehawk, nmk16_state, empty_init, ORIENTATION_FLIP_Y, "ESD", "Fire Hawk (World) / Huohu Chuanshuo (China) (horizontal)", 0 ) -GAME( 2001, firehawkv, spec2k, firehawk, firehawkv, nmk16_state, empty_init, ORIENTATION_FLIP_Y, "ESD", "Fire Hawk (World) / Huohu Chuanshuo (China) (switchable orientation)", MACHINE_NOT_WORKING ) // incomplete dump, vertical mode gfx not dumped - -// bee-oh board - different display / interrupt timing to others? -GAME( 1991, manybloc, 0, manybloc, manybloc, nmk16_state, init_tharrier, ROT270, "Bee-Oh", "Many Block", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_SOUND ) - -// clone board, different sound / bg hardware, but similar memory maps, same tx layer, sprites etc. -GAME( 1997, tomagic, 0, tomagic, tomagic, nmk16_tomagic_state, init_tomagic, ROT0, "Hobbitron T.K.Trading Co. Ltd.", "Tom Tom Magic", 0 ) +GAME( 2000, spec2k, 0, spec2k, spec2k, afega_state, init_spec2k, ROT270, "Yona Tech", "Spectrum 2000 (vertical, Korea)", MACHINE_IMPERFECT_GRAPHICS ) // the ships sometimes scroll off the screen if you insert a coin during the attract demo? verify it doesn't happen on real hw(!) +GAME( 2000, spec2kh, spec2k, spec2k, spec2k, afega_state, init_spec2k, ORIENTATION_FLIP_Y, "Yona Tech", "Spectrum 2000 (horizontal, buggy) (Europe)", 0 ) // this has odd bugs even on real hardware, eg glitchy 3 step destruction sequence of some larger enemies +GAME( 2001, firehawk, spec2k, firehawk, firehawk, afega_state, empty_init, ORIENTATION_FLIP_Y, "ESD", "Fire Hawk (World) / Huohu Chuanshuo (China) (horizontal)", 0 ) +GAME( 2001, firehawkv, spec2k, firehawk, firehawkv, afega_state, empty_init, ORIENTATION_FLIP_Y, "ESD", "Fire Hawk (World) / Huohu Chuanshuo (China) (switchable orientation)", MACHINE_NOT_WORKING ) // incomplete dump, vertical mode gfx not dumped diff --git a/src/mame/includes/nmk16.h b/src/mame/includes/nmk16.h index 1ba5719f9ef..bd29bef9fbe 100644 --- a/src/mame/includes/nmk16.h +++ b/src/mame/includes/nmk16.h @@ -27,13 +27,12 @@ public: m_palette(*this, "palette"), m_nmk004(*this, "nmk004"), m_soundlatch(*this, "soundlatch"), - m_nmk_bgvideoram(*this, "nmk_bgvideoram%u", 0U), - m_nmk_txvideoram(*this, "nmk_txvideoram"), + m_bgvideoram(*this, "bgvideoram%u", 0U), + m_txvideoram(*this, "txvideoram"), m_mainram(*this, "mainram"), m_gunnail_scrollram(*this, "scrollram"), m_spriteram(*this, "spriteram"), m_gunnail_scrollramy(*this, "scrollramy"), - m_afega_scroll(*this, "afega_scroll_%u", 0U), m_tilemap_rom(*this, "tilerom"), m_audiobank(*this, "audiobank"), m_okibank(*this, "okibank%u", 1U), @@ -43,38 +42,30 @@ public: { } void vandyke(machine_config &config); - void redhawkb(machine_config &config); - void grdnstrm(machine_config &config); void tdragon_prot(machine_config &config); void tdragon2(machine_config &config); void tharrier(machine_config &config); void raphero(machine_config &config); void tdragon(machine_config &config); void tdragonb(machine_config &config); - void twinactn(machine_config &config); - void firehawk(machine_config &config); void gunnail(machine_config &config); void gunnailb(machine_config &config); void hachamf(machine_config &config); - void redhawki(machine_config &config); void bjtwin(machine_config &config); void ssmissin(machine_config &config); void bioship(machine_config &config); - void spec2k(machine_config &config); void macross2(machine_config &config); void blkheart(machine_config &config); - void stagger1(machine_config &config); void manybloc(machine_config &config); void acrobatm(machine_config &config); void strahl(machine_config &config); void tdragon3h(machine_config &config); void atombjt(machine_config &config); void hachamf_prot(machine_config &config); - void popspops(machine_config &config); - void grdnstrmk(machine_config &config); void macross(machine_config &config); void mustangb(machine_config &config); void mustang(machine_config &config); + void twinactn(machine_config &config); void vandykeb(machine_config &config); void init_nmk(); @@ -82,31 +73,23 @@ public: void init_vandykeb(); void init_tdragonb(); void init_ssmissin(); + void init_twinactn(); void init_hachamf_prot(); - void init_redhawk(); - void init_redhawkg(); - void init_redhawki(); void init_tdragon_prot(); - void init_bubl2000(); void init_banked_audiocpu(); - void init_grdnstrm(); - void init_grdnstrmau(); void init_gunnailb(); - void init_spec2k(); - void init_redfoxwp2a(); - void init_grdnstrmg(); void init_bjtwin(); void init_atombjt(); DECLARE_VIDEO_START(gunnail); TIMER_DEVICE_CALLBACK_MEMBER(nmk16_scanline); - uint32_t screen_update_macross(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + u32 screen_update_macross(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - DECLARE_WRITE16_MEMBER(nmk_txvideoram_w); - DECLARE_WRITE8_MEMBER(nmk_flipscreen_w); - DECLARE_WRITE8_MEMBER(nmk_tilebank_w); + void txvideoram_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void flipscreen_w(u8 data); + void tilebank_w(u8 data); - DECLARE_WRITE8_MEMBER(macross2_sound_bank_w); + void macross2_sound_bank_w(u8 data); protected: required_device m_maincpu; @@ -118,15 +101,14 @@ protected: optional_device m_nmk004; optional_device m_soundlatch; - optional_shared_ptr_array m_nmk_bgvideoram; - optional_shared_ptr m_nmk_txvideoram; - required_shared_ptr m_mainram; - optional_shared_ptr m_gunnail_scrollram; - optional_shared_ptr m_spriteram; - optional_shared_ptr m_gunnail_scrollramy; - optional_shared_ptr_array m_afega_scroll; + optional_shared_ptr_array m_bgvideoram; + optional_shared_ptr m_txvideoram; + required_shared_ptr m_mainram; + optional_shared_ptr m_gunnail_scrollram; + optional_shared_ptr m_spriteram; + optional_shared_ptr m_gunnail_scrollramy; - optional_region_ptr m_tilemap_rom; + optional_region_ptr m_tilemap_rom; optional_memory_bank m_audiobank; optional_memory_bank_array<2> m_okibank; @@ -138,45 +120,43 @@ protected: int m_tilerambank; int m_sprdma_base; int mask[4*2]; - std::unique_ptr m_spriteram_old; - std::unique_ptr m_spriteram_old2; + std::unique_ptr m_spriteram_old; + std::unique_ptr m_spriteram_old2; int m_bgbank; int m_videoshift; int m_bioship_background_bank; tilemap_t *m_bg_tilemap[2]; tilemap_t *m_tx_tilemap; int m_mustang_bg_xscroll; - uint8_t m_scroll[2][4]; - uint16_t m_vscroll[4]; + u8 m_scroll[2][4]; + u16 m_vscroll[4]; int m_prot_count; - uint8_t m_input_pressed; - uint8_t m_start_helper; - uint8_t m_coin_count[2]; - uint8_t m_coin_count_frac[2]; - DECLARE_WRITE16_MEMBER(nmk16_mainram_strange_w); - DECLARE_WRITE8_MEMBER(ssmissin_soundbank_w); - DECLARE_WRITE16_MEMBER(tharrier_mcu_control_w); - DECLARE_READ16_MEMBER(tharrier_mcu_r); - DECLARE_WRITE16_MEMBER(macross2_sound_reset_w); - template DECLARE_WRITE8_MEMBER(tharrier_oki6295_bankswitch_w); - DECLARE_WRITE16_MEMBER(hachamf_mainram_w); - DECLARE_WRITE16_MEMBER(tdragon_mainram_w); - DECLARE_READ16_MEMBER(vandykeb_r); - DECLARE_READ16_MEMBER(tdragonb_prot_r); - DECLARE_READ16_MEMBER(afega_unknown_r); - template DECLARE_WRITE16_MEMBER(afega_scroll_w); - template DECLARE_WRITE16_MEMBER(nmk_bgvideoram_w); - DECLARE_WRITE16_MEMBER(mustang_scroll_w); - DECLARE_WRITE16_MEMBER(raphero_scroll_w); - template DECLARE_WRITE8_MEMBER(nmk_scroll_w); - DECLARE_WRITE16_MEMBER(vandyke_scroll_w); - DECLARE_WRITE16_MEMBER(vandykeb_scroll_w); - DECLARE_WRITE16_MEMBER(manybloc_scroll_w); - DECLARE_WRITE8_MEMBER(bioship_bank_w); - DECLARE_WRITE8_MEMBER(spec2k_oki1_banking_w); - DECLARE_WRITE8_MEMBER(twinactn_oki_bank_w); - DECLARE_WRITE16_MEMBER(nmk16_x0016_w); - DECLARE_WRITE16_MEMBER(nmk16_bioship_x0016_w); + u8 m_input_pressed; + u8 m_start_helper; + u8 m_coin_count[2]; + u8 m_coin_count_frac[2]; + void mainram_strange_w(offs_t offset, u16 data/*, u16 mem_mask = ~0*/); + u16 mainram_swapped_r(offs_t offset); + void mainram_swapped_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void ssmissin_soundbank_w(u8 data); + void tharrier_mcu_control_w(u16 data); + u16 tharrier_mcu_r(offs_t offset, u16 mem_mask = ~0); + void macross2_sound_reset_w(u16 data); + template void tharrier_oki_bankswitch_w(u8 data); + void hachamf_mainram_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void tdragon_mainram_w(offs_t offset, u16 data, u16 mem_mask = ~0); + u16 vandykeb_r(); + u16 tdragonb_prot_r(); + template void bgvideoram_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void mustang_scroll_w(u16 data); + void raphero_scroll_w(offs_t offset, u16 data, u16 mem_mask = ~0); + template void scroll_w(offs_t offset, u8 data); + void vandyke_scroll_w(offs_t offset, u16 data); + void vandykeb_scroll_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void manybloc_scroll_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void bioship_bank_w(u8 data); + void nmk004_x0016_w(u16 data); + void nmk004_bioship_x0016_w(u16 data); void save_protregs(); void set_hacky_interrupt_timing(machine_config &config); @@ -184,59 +164,42 @@ protected: void set_hacky_screen_hires(machine_config &config); TILEMAP_MAPPER_MEMBER(tilemap_scan_pages); - template TILE_GET_INFO_MEMBER(common_get_bg_tile_info); + template TILE_GET_INFO_MEMBER(common_get_bg_tile_info); TILE_GET_INFO_MEMBER(common_get_tx_tile_info); TILE_GET_INFO_MEMBER(bioship_get_bg_tile_info); TILE_GET_INFO_MEMBER(bjtwin_get_bg_tile_info); - TILE_GET_INFO_MEMBER(get_tile_info_0_8bit); DECLARE_VIDEO_START(macross); DECLARE_VIDEO_START(bioship); DECLARE_VIDEO_START(strahl); DECLARE_VIDEO_START(macross2); DECLARE_VIDEO_START(bjtwin); - DECLARE_VIDEO_START(afega); - DECLARE_VIDEO_START(grdnstrm); - uint32_t screen_update_tharrier(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_manybloc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_strahl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_tdragon2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_bjtwin(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_afega(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_firehawk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_redhawki(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_redhawkb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_bubl2000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + u32 screen_update_tharrier(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + u32 screen_update_manybloc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + u32 screen_update_strahl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + u32 screen_update_bjtwin(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(tdragon_mcu_sim); TIMER_DEVICE_CALLBACK_MEMBER(hachamf_mcu_sim); TIMER_DEVICE_CALLBACK_MEMBER(manybloc_scanline); - void nmk16_video_init(); - inline void nmk16_draw_sprite(bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t *spr); - inline void nmk16_draw_sprite_flipsupported(bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t *spr); - void nmk16_draw_sprites_swap(bitmap_ind16 &bitmap, const rectangle &cliprect, int *bittbl); - void nmk16_draw_sprites_swap_flipsupported(bitmap_ind16 &bitmap, const rectangle &cliprect, int *bittbl); - void nmk16_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); - void nmk16_draw_sprites_flipsupported(bitmap_ind16 &bitmap, const rectangle &cliprect); - void nmk16_bg_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer = 0); - void nmk16_tx_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void video_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect,int dsw_flipscreen,int xoffset, int yoffset,int attr_mask); - void redhawki_video_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ); - void mcu_run(uint8_t dsw_setting); - uint8_t decode_byte(uint8_t src, const uint8_t *bitp); - uint32_t bjtwin_address_map_bg0(uint32_t addr); - uint16_t decode_word(uint16_t src, const uint8_t *bitp); - uint32_t bjtwin_address_map_sprites(uint32_t addr); + void video_init(); + inline void draw_sprite(bitmap_ind16 &bitmap, const rectangle &cliprect, u16 *spr); + inline void draw_sprite_flipsupported(bitmap_ind16 &bitmap, const rectangle &cliprect, u16 *spr); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites_flipsupported(bitmap_ind16 &bitmap, const rectangle &cliprect); + void bg_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer = 0); + void tx_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void mcu_run(u8 dsw_setting); + u8 decode_byte(u8 src, const u8 *bitp); + u32 bjtwin_address_map_bg0(u32 addr); + u16 decode_word(u16 src, const u8 *bitp); + u32 bjtwin_address_map_sprites(u32 addr); void decode_gfx(); void decode_tdragonb(); void decode_ssmissin(); void acrobatm_map(address_map &map); - void afega_map(address_map &map); - void afega_sound_cpu(address_map &map); void atombjt_map(address_map &map); void bioship_map(address_map &map); void bjtwin_map(address_map &map); - void firehawk_map(address_map &map); - void firehawk_sound_cpu(address_map &map); void gunnail_map(address_map &map); void gunnailb_map(address_map &map); void gunnailb_sound_map(address_map &map); @@ -256,6 +219,7 @@ protected: void ssmissin_map(address_map &map); void ssmissin_sound_map(address_map &map); void strahl_map(address_map &map); + void tdragon2_map(address_map &map); void tdragon3h_map(address_map &map); void tdragon_map(address_map &map); void tdragonb_map(address_map &map); @@ -263,11 +227,61 @@ protected: void tharrier_sound_io_map(address_map &map); void tharrier_sound_map(address_map &map); void twinactn_map(address_map &map); - void twinactn_sound_cpu(address_map &map); void vandyke_map(address_map &map); void vandykeb_map(address_map &map); }; +class afega_state : public nmk16_state +{ +public: + afega_state(const machine_config &mconfig, device_type type, const char *tag) : + nmk16_state(mconfig, type, tag), + m_afega_scroll(*this, "afega_scroll_%u", 0U) + {} + + void firehawk(machine_config &config); + void grdnstrm(machine_config &config); + void grdnstrmk(machine_config &config); + void popspops(machine_config &config); + void redhawki(machine_config &config); + void redhawkb(machine_config &config); + void stagger1(machine_config &config); + void spec2k(machine_config &config); + void init_bubl2000(); + void init_grdnstrm(); + void init_grdnstrmau(); + void init_redfoxwp2a(); + void init_grdnstrmg(); + void init_redhawk(); + void init_redhawkg(); + void init_redhawki(); + void init_spec2k(); + +private: + optional_shared_ptr_array m_afega_scroll; + + u16 afega_unknown_r(); + void spec2k_oki1_banking_w(u8 data); + template void afega_scroll_w(offs_t offset, u16 data, u16 mem_mask = ~0); + + TILE_GET_INFO_MEMBER(get_bg_tile_info_4bit); + TILE_GET_INFO_MEMBER(get_bg_tile_info_8bit); + DECLARE_VIDEO_START(afega); + DECLARE_VIDEO_START(grdnstrm); + u32 screen_update_afega(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + u32 screen_update_firehawk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + u32 screen_update_redhawki(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + u32 screen_update_redhawkb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + u32 screen_update_bubl2000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void video_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int dsw_flipscreen, int xoffset, int yoffset, int attr_mask); + void redhawki_video_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + void afega_map(address_map &map); + void afega_sound_cpu(address_map &map); + void firehawk_map(address_map &map); + void firehawk_sound_cpu(address_map &map); +}; + class nmk16_tomagic_state : public nmk16_state { public: diff --git a/src/mame/video/nmk16.cpp b/src/mame/video/nmk16.cpp index 061fcf39509..e2c60ca0ea2 100644 --- a/src/mame/video/nmk16.cpp +++ b/src/mame/video/nmk16.cpp @@ -33,50 +33,38 @@ TILEMAP_MAPPER_MEMBER(nmk16_state::tilemap_scan_pages) { - return (row & 0xf) | ((col & 0xff) << 4) | ((row & 0x10) << 8); + return (row & 0xf) | ((col & 0xff) << 4) | ((row & 0x10) << 8); } -template +template TILE_GET_INFO_MEMBER(nmk16_state::common_get_bg_tile_info) { - int code = m_nmk_bgvideoram[Layer][(m_tilerambank << 13)|tile_index]; - SET_TILE_INFO_MEMBER(Gfx,(code & 0xfff) | (m_bgbank << 12),code >> 12,0); + const u16 code = m_bgvideoram[Layer][(m_tilerambank << 13) | tile_index]; + SET_TILE_INFO_MEMBER(Gfx, (code & 0xfff) | (m_bgbank << 12), code >> 12, 0); } TILE_GET_INFO_MEMBER(nmk16_state::common_get_tx_tile_info) { - int code = m_nmk_txvideoram[tile_index]; - SET_TILE_INFO_MEMBER(0, - code & 0xfff, - code >> 12, - 0); + const u16 code = m_txvideoram[tile_index]; + SET_TILE_INFO_MEMBER(0, code & 0xfff, code >> 12, 0); } TILE_GET_INFO_MEMBER(nmk16_state::bioship_get_bg_tile_info) { - int code = m_tilemap_rom[(m_bioship_background_bank << 13) | tile_index]; // ROM Based - SET_TILE_INFO_MEMBER(3,(code & 0xfff),code >> 12,0); + const u16 code = m_tilemap_rom[(m_bioship_background_bank << 13) | tile_index]; // ROM Based + SET_TILE_INFO_MEMBER(3, code & 0xfff, code >> 12, 0); } TILE_GET_INFO_MEMBER(nmk16_state::bjtwin_get_bg_tile_info) { - int code = m_nmk_bgvideoram[0][tile_index]; - int bank = (code & 0x800) ? 1 : 0; + const u16 code = m_bgvideoram[0][tile_index]; + const u8 bank = BIT(code, 11); SET_TILE_INFO_MEMBER(bank, (code & 0x7ff) + ((bank) ? (m_bgbank << 11) : 0), code >> 12, 0); } -TILE_GET_INFO_MEMBER(nmk16_state::get_tile_info_0_8bit) -{ - uint16_t code = m_nmk_bgvideoram[0][tile_index]; - SET_TILE_INFO_MEMBER(1, - code, - 0, - 0); -} - /*************************************************************************** @@ -84,10 +72,10 @@ TILE_GET_INFO_MEMBER(nmk16_state::get_tile_info_0_8bit) ***************************************************************************/ -void nmk16_state::nmk16_video_init() +void nmk16_state::video_init() { - m_spriteram_old = make_unique_clear(0x1000/2); - m_spriteram_old2 = make_unique_clear(0x1000/2); + m_spriteram_old = make_unique_clear(0x1000/2); + m_spriteram_old2 = make_unique_clear(0x1000/2); m_videoshift = 0; /* 256x224 screen, no shift */ m_tilerambank = 0; @@ -105,18 +93,18 @@ void nmk16_state::nmk16_video_init() } -VIDEO_START_MEMBER(nmk16_state,bioship) +VIDEO_START_MEMBER(nmk16_state, bioship) { m_sprlimit = 384 * 263; // ROM Based Tilemap - m_bg_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(nmk16_state::bioship_get_bg_tile_info),this), tilemap_mapper_delegate(FUNC(nmk16_state::tilemap_scan_pages),this),16,16,256,32); - m_bg_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(&nmk16_state::common_get_bg_tile_info<1, 1>, "bg1_gfx1",this), tilemap_mapper_delegate(FUNC(nmk16_state::tilemap_scan_pages),this),16,16,256,32); - m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(nmk16_state::common_get_tx_tile_info),this),TILEMAP_SCAN_COLS,8,8,32,32); + m_bg_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(nmk16_state::bioship_get_bg_tile_info), this), tilemap_mapper_delegate(FUNC(nmk16_state::tilemap_scan_pages), this), 16, 16, 256, 32); + m_bg_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(&nmk16_state::common_get_bg_tile_info<1, 1>, "bg1_gfx1", this), tilemap_mapper_delegate(FUNC(nmk16_state::tilemap_scan_pages), this), 16, 16, 256, 32); + m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(nmk16_state::common_get_tx_tile_info), this),TILEMAP_SCAN_COLS, 8, 8, 32, 32); m_bg_tilemap[1]->set_transparent_pen(15); m_tx_tilemap->set_transparent_pen(15); - nmk16_video_init(); + video_init(); m_bioship_background_bank=0; save_item(NAME(m_bioship_background_bank)); } @@ -124,18 +112,18 @@ VIDEO_START_MEMBER(nmk16_state,bioship) VIDEO_START_MEMBER(nmk16_state,macross) { m_sprlimit = 384 * 263; - m_bg_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(&nmk16_state::common_get_bg_tile_info<0, 1>, "bg0_gfx1",this), tilemap_mapper_delegate(FUNC(nmk16_state::tilemap_scan_pages),this),16,16,256,32); - m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(nmk16_state::common_get_tx_tile_info),this),TILEMAP_SCAN_COLS,8,8,32,32); + m_bg_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(&nmk16_state::common_get_bg_tile_info<0, 1>, "bg0_gfx1", this), tilemap_mapper_delegate(FUNC(nmk16_state::tilemap_scan_pages), this), 16, 16, 256, 32); + m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(nmk16_state::common_get_tx_tile_info), this),TILEMAP_SCAN_COLS, 8, 8, 32, 32); m_tx_tilemap->set_transparent_pen(15); - nmk16_video_init(); + video_init(); } VIDEO_START_MEMBER(nmk16_state,strahl) { - VIDEO_START_CALL_MEMBER( macross ); - m_bg_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(&nmk16_state::common_get_bg_tile_info<1, 3>, "bg1_gfx3",this), tilemap_mapper_delegate(FUNC(nmk16_state::tilemap_scan_pages),this),16,16,256,32); + VIDEO_START_CALL_MEMBER(macross); + m_bg_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(&nmk16_state::common_get_bg_tile_info<1, 3>, "bg1_gfx3", this), tilemap_mapper_delegate(FUNC(nmk16_state::tilemap_scan_pages), this), 16, 16, 256, 32); m_bg_tilemap[1]->set_transparent_pen(15); m_sprdma_base = 0xf000; @@ -144,33 +132,33 @@ VIDEO_START_MEMBER(nmk16_state,strahl) VIDEO_START_MEMBER(nmk16_state,macross2) { m_sprlimit = 512 * 263; // not verified - m_bg_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(&nmk16_state::common_get_bg_tile_info<0, 1>, "bg0_gfx1",this), tilemap_mapper_delegate(FUNC(nmk16_state::tilemap_scan_pages),this),16,16,256,32); - m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(nmk16_state::common_get_tx_tile_info),this),TILEMAP_SCAN_COLS,8,8,64,32); + m_bg_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(&nmk16_state::common_get_bg_tile_info<0, 1>, "bg0_gfx1", this), tilemap_mapper_delegate(FUNC(nmk16_state::tilemap_scan_pages), this), 16, 16, 256, 32); + m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(nmk16_state::common_get_tx_tile_info), this),TILEMAP_SCAN_COLS, 8, 8, 64, 32); m_tx_tilemap->set_transparent_pen(15); - nmk16_video_init(); + video_init(); m_videoshift = 64; /* 384x224 screen, leftmost 64 pixels have to be retrieved */ /* from the other side of the tilemap (!) */ } VIDEO_START_MEMBER(nmk16_state,gunnail) { - VIDEO_START_CALL_MEMBER( macross2 ); + VIDEO_START_CALL_MEMBER(macross2); m_bg_tilemap[0]->set_scroll_rows(512); } -VIDEO_START_MEMBER(nmk16_state,bjtwin) +VIDEO_START_MEMBER(nmk16_state, bjtwin) { m_sprlimit = 512 * 263; // not verified - m_bg_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(nmk16_state::bjtwin_get_bg_tile_info),this),TILEMAP_SCAN_COLS,8,8,64,32); + m_bg_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(nmk16_state::bjtwin_get_bg_tile_info), this),TILEMAP_SCAN_COLS, 8, 8, 64, 32); - nmk16_video_init(); + video_init(); m_videoshift = 64; /* 384x224 screen, leftmost 64 pixels have to be retrieved */ /* from the other side of the tilemap (!) */ } -WRITE16_MEMBER(nmk16_state::mustang_scroll_w) +void nmk16_state::mustang_scroll_w(u16 data) { // osd_printf_debug("mustang %04x %04x %04x\n",offset,data,mem_mask); @@ -197,7 +185,7 @@ WRITE16_MEMBER(nmk16_state::mustang_scroll_w) m_bg_tilemap[0]->set_scrollx(0,m_mustang_bg_xscroll - m_videoshift); } -WRITE16_MEMBER(nmk16_state::vandyke_scroll_w) +void nmk16_state::vandyke_scroll_w(offs_t offset, u16 data) { m_vscroll[offset] = data; @@ -205,7 +193,7 @@ WRITE16_MEMBER(nmk16_state::vandyke_scroll_w) m_bg_tilemap[0]->set_scrolly(0,m_vscroll[2] * 256 + (m_vscroll[3] >> 8)); } -WRITE16_MEMBER(nmk16_state::vandykeb_scroll_w) +void nmk16_state::vandykeb_scroll_w(offs_t offset, u16 data, u16 mem_mask) { switch (offset) { @@ -219,7 +207,7 @@ WRITE16_MEMBER(nmk16_state::vandykeb_scroll_w) m_bg_tilemap[0]->set_scrolly(0,m_vscroll[2] * 256 + (m_vscroll[3] >> 8)); } -WRITE16_MEMBER(nmk16_state::manybloc_scroll_w) +void nmk16_state::manybloc_scroll_w(offs_t offset, u16 data, u16 mem_mask) { COMBINE_DATA(&m_gunnail_scrollram[offset]); @@ -227,12 +215,12 @@ WRITE16_MEMBER(nmk16_state::manybloc_scroll_w) m_bg_tilemap[0]->set_scrolly(0,m_gunnail_scrollram[0xc2/2]); } -WRITE8_MEMBER(nmk16_state::nmk_flipscreen_w) +void nmk16_state::flipscreen_w(u8 data) { flip_screen_set(data & 0x01); } -WRITE8_MEMBER(nmk16_state::nmk_tilebank_w) +void nmk16_state::tilebank_w(u8 data) { if (m_bgbank != data) { @@ -243,20 +231,25 @@ WRITE8_MEMBER(nmk16_state::nmk_tilebank_w) } } -WRITE16_MEMBER(nmk16_state::raphero_scroll_w) +void nmk16_state::raphero_scroll_w(offs_t offset, u16 data, u16 mem_mask) { COMBINE_DATA(&m_gunnail_scrollram[offset]); - if ((m_nmk_bgvideoram[0].bytes() > 0x4000) && (offset == 0)) + if ((m_bgvideoram[0].bytes() > 0x4000) && (offset == 0)) { - int newbank = (m_gunnail_scrollram[0] >> 12) & ((m_nmk_bgvideoram[0].bytes() >> 14)-1); + int newbank = (m_gunnail_scrollram[0] >> 12) & ((m_bgvideoram[0].bytes() >> 14) - 1); if (m_tilerambank != newbank) { m_tilerambank = newbank; + for (int layer = 0; layer < 2; layer++) + { + if (m_bg_tilemap[layer]) + m_bg_tilemap[layer]->mark_all_dirty(); + } } } } -WRITE8_MEMBER(nmk16_state::bioship_bank_w) +void nmk16_state::bioship_bank_w(u8 data) { if (m_bioship_background_bank != data) { @@ -272,21 +265,19 @@ WRITE8_MEMBER(nmk16_state::bioship_bank_w) ***************************************************************************/ - // manybloc uses extra flip bits on the sprites, but these break other games -inline void nmk16_state::nmk16_draw_sprite(bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t *spr) +inline void nmk16_state::draw_sprite(bitmap_ind16 &bitmap, const rectangle &cliprect, u16 *spr) { - if(!(spr[0] & 0x0001)) + if (!(spr[0] & 0x0001)) return; - int sx = (spr[4] & 0x1ff) + m_videoshift; - int sy = spr[6] & 0x1ff; - int code = spr[3]; - int color = spr[7]; - int w = spr[1] & 0x00f; - int h = (spr[1] & 0x0f0) >> 4; - int xx,yy,x; + int sx = (spr[4] & 0x1ff) + m_videoshift; + int sy = spr[6] & 0x1ff; + int code = spr[3]; + const u16 color = spr[7]; + const int w = spr[1] & 0x00f; + const int h = (spr[1] & 0x0f0) >> 4; int delta = 16; if (flip_screen()) @@ -296,18 +287,18 @@ inline void nmk16_state::nmk16_draw_sprite(bitmap_ind16 &bitmap, const rectangle delta = -16; } - yy = h; + int yy = h; do { - x = sx; - xx = w; + int x = sx; + int xx = w; do { - m_gfxdecode->gfx(2)->transpen(bitmap,cliprect, + m_gfxdecode->gfx(2)->transpen(bitmap, cliprect, code, color, flip_screen(), flip_screen(), - ((x + 16) & 0x1ff) - 16,sy & 0x1ff,15); + ((x + 16) & 0x1ff) - 16,sy & 0x1ff, 15); m_sprclk += 128; // 128 clock per each 16x16 tile if (m_sprclk >= m_sprlimit) return; @@ -320,21 +311,20 @@ inline void nmk16_state::nmk16_draw_sprite(bitmap_ind16 &bitmap, const rectangle } while (--yy >= 0); } -inline void nmk16_state::nmk16_draw_sprite_flipsupported(bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t *spr) +inline void nmk16_state::draw_sprite_flipsupported(bitmap_ind16 &bitmap, const rectangle &cliprect, u16 *spr) { - if(!(spr[0] & 0x0001)) + if (!(spr[0] & 0x0001)) return; - int sx = (spr[4] & 0x1ff) + m_videoshift; - int sy = spr[6] & 0x1ff; - int code = spr[3]; - int color = spr[7]; - int w = spr[1] & 0x00f; - int h = (spr[1] & 0x0f0) >> 4; - int flipy = (spr[1] & 0x200) >> 9; - int flipx = (spr[1] & 0x100) >> 8; + int sx = (spr[4] & 0x1ff) + m_videoshift; + int sy = spr[6] & 0x1ff; + int code = spr[3]; + const u16 color = spr[7]; + const int w = spr[1] & 0x00f; + const int h = (spr[1] & 0x0f0) >> 4; + int flipy = (spr[1] & 0x200) >> 9; + int flipx = (spr[1] & 0x100) >> 8; - int xx,yy,x; int delta = 16; flipx ^= flip_screen(); @@ -347,19 +337,19 @@ inline void nmk16_state::nmk16_draw_sprite_flipsupported(bitmap_ind16 &bitmap, c delta = -16; } - yy = h; - sy += flipy ? (delta*h) : 0; + int yy = h; + sy += flipy ? (delta * h) : 0; do { - x = sx + (flipx ? (delta*w) : 0); - xx = w; + int x = sx + (flipx ? (delta * w) : 0); + int xx = w; do { - m_gfxdecode->gfx(2)->transpen(bitmap,cliprect, + m_gfxdecode->gfx(2)->transpen(bitmap, cliprect, code, color, flipx, flipy, - ((x + 16) & 0x1ff) - 16,sy & 0x1ff,15); + ((x + 16) & 0x1ff) - 16,sy & 0x1ff, 15); m_sprclk += 128; // 128 clock per each 16x16 tile if (m_sprclk >= m_sprlimit) return; @@ -371,65 +361,31 @@ inline void nmk16_state::nmk16_draw_sprite_flipsupported(bitmap_ind16 &bitmap, c } while (--yy >= 0); } -void nmk16_state::nmk16_draw_sprites_swap(bitmap_ind16 &bitmap, const rectangle &cliprect, int *bittbl) -{ - m_sprclk = 0; - int i; - - for (i = 0; i < 0x100; i++) - { - m_sprclk += 16; // 16 clock per each reading - if (m_sprclk >= m_sprlimit) - return; - - int spr = bitswap<8>(i, bittbl[0], bittbl[1], bittbl[2], bittbl[3], bittbl[4], bittbl[5], bittbl[6], bittbl[7]); - nmk16_draw_sprite(bitmap, cliprect, m_spriteram_old2.get() + (spr * 16/2)); - } -} - -void nmk16_state::nmk16_draw_sprites_swap_flipsupported(bitmap_ind16 &bitmap, const rectangle &cliprect, int *bittbl) +void nmk16_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) { m_sprclk = 0; - int i; - for ( i = 0; i < 0x100; i++ ) + for (int offs = 0; offs < 0x1000/2; offs += 8) { m_sprclk += 16; // 16 clock per each reading if (m_sprclk >= m_sprlimit) return; - int spr = bitswap<8>(i, bittbl[0], bittbl[1], bittbl[2], bittbl[3], bittbl[4], bittbl[5], bittbl[6], bittbl[7]); - nmk16_draw_sprite_flipsupported(bitmap, cliprect, m_spriteram_old2.get() + (spr * 16/2)); + draw_sprite(bitmap, cliprect, m_spriteram_old2.get() + offs); } } -void nmk16_state::nmk16_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) +void nmk16_state::draw_sprites_flipsupported(bitmap_ind16 &bitmap, const rectangle &cliprect) { m_sprclk = 0; - int offs; - for (offs = 0; offs < 0x1000/2; offs += 8) + for (int offs = 0; offs < 0x1000/2; offs += 8) { m_sprclk += 16; // 16 clock per each reading if (m_sprclk >= m_sprlimit) return; - nmk16_draw_sprite(bitmap, cliprect, m_spriteram_old2.get() + offs); - } -} - -void nmk16_state::nmk16_draw_sprites_flipsupported(bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - m_sprclk = 0; - int offs; - - for (offs = 0; offs < 0x1000/2; offs += 8) - { - m_sprclk += 16; // 16 clock per each reading - if (m_sprclk >= m_sprlimit) - return; - - nmk16_draw_sprite_flipsupported(bitmap, cliprect, m_spriteram_old2.get() + offs); + draw_sprite_flipsupported(bitmap, cliprect, m_spriteram_old2.get() + offs); } } @@ -441,19 +397,18 @@ void nmk16_state::nmk16_draw_sprites_flipsupported(bitmap_ind16 &bitmap, const r ***************************************************************************/ -void nmk16_state::nmk16_bg_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer) +void nmk16_state::bg_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer) { if (m_gunnail_scrollram && m_gunnail_scrollramy) { // the hardware supports per-scanline X *and* Y scroll which isn't // supported by tilemaps so we have to draw the tilemap one line at a time - int i=16; - int y1; + int i = 16; rectangle bgclip = cliprect; - y1 = cliprect.min_y; + int y1 = cliprect.min_y; while (y1 <= cliprect.max_y) { - int const yscroll = m_gunnail_scrollramy[0] + m_gunnail_scrollramy[y1]; + const int yscroll = m_gunnail_scrollramy[0] + m_gunnail_scrollramy[y1]; bgclip.min_y = y1; bgclip.max_y = y1; @@ -463,7 +418,7 @@ void nmk16_state::nmk16_bg_update(screen_device &screen, bitmap_ind16 &bitmap, c m_bg_tilemap[layer]->set_scrolly(0, yscroll); m_bg_tilemap[layer]->set_scrollx((i + yscroll) & 0x1ff, m_gunnail_scrollram[0] + m_gunnail_scrollram[i] - m_videoshift); - m_bg_tilemap[layer]->draw(screen, bitmap, bgclip, 0,0); + m_bg_tilemap[layer]->draw(screen, bitmap, bgclip, 0, 0); y1++; i++; @@ -471,14 +426,14 @@ void nmk16_state::nmk16_bg_update(screen_device &screen, bitmap_ind16 &bitmap, c } else { - m_bg_tilemap[layer]->draw(screen, bitmap, cliprect, 0,0); + m_bg_tilemap[layer]->draw(screen, bitmap, cliprect, 0, 0); } } -void nmk16_state::nmk16_tx_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +void nmk16_state::tx_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_tx_tilemap->set_scrollx(0,-m_videoshift); - m_tx_tilemap->draw(screen, bitmap, cliprect, 0,0); + m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0); } /*************************************************************************** @@ -489,62 +444,50 @@ void nmk16_state::nmk16_tx_update(screen_device &screen, bitmap_ind16 &bitmap, c ***************************************************************************/ -uint32_t nmk16_state::screen_update_macross(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +u32 nmk16_state::screen_update_macross(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - nmk16_bg_update(screen,bitmap,cliprect,0); - nmk16_draw_sprites(bitmap,cliprect); - nmk16_tx_update(screen,bitmap,cliprect); + bg_update(screen, bitmap, cliprect, 0); + draw_sprites(bitmap, cliprect); + tx_update(screen, bitmap, cliprect); return 0; } -uint32_t nmk16_state::screen_update_manybloc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +u32 nmk16_state::screen_update_manybloc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - nmk16_bg_update(screen,bitmap,cliprect,0); - nmk16_draw_sprites_flipsupported(bitmap,cliprect); - nmk16_tx_update(screen,bitmap,cliprect); + bg_update(screen, bitmap, cliprect, 0); + draw_sprites_flipsupported(bitmap, cliprect); + tx_update(screen, bitmap, cliprect); return 0; } -uint32_t nmk16_state::screen_update_tharrier(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +u32 nmk16_state::screen_update_tharrier(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { /* I think the protection device probably copies this to the regs... */ - uint16_t tharrier_scroll = m_mainram[0x9f00/2]; + u16 tharrier_scroll = m_mainram[0x9f00/2]; - m_bg_tilemap[0]->set_scrollx(0,tharrier_scroll); + m_bg_tilemap[0]->set_scrollx(0, tharrier_scroll); - nmk16_bg_update(screen,bitmap,cliprect,0); - nmk16_draw_sprites_flipsupported(bitmap,cliprect); - nmk16_tx_update(screen,bitmap,cliprect); + bg_update(screen, bitmap, cliprect, 0); + draw_sprites_flipsupported(bitmap, cliprect); + tx_update(screen, bitmap, cliprect); return 0; } -uint32_t nmk16_state::screen_update_tdragon2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +u32 nmk16_state::screen_update_strahl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - static int bittbl[8] = { - 4, 6, 5, 7, 3, 2, 1, 0 - }; - - nmk16_bg_update(screen,bitmap,cliprect,0); - nmk16_draw_sprites_swap(bitmap,cliprect, bittbl); - nmk16_tx_update(screen,bitmap,cliprect); - return 0; -} - -uint32_t nmk16_state::screen_update_strahl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - nmk16_bg_update(screen,bitmap,cliprect,0); - nmk16_bg_update(screen,bitmap,cliprect,1); - nmk16_draw_sprites(bitmap,cliprect); - nmk16_tx_update(screen,bitmap,cliprect); + bg_update(screen, bitmap, cliprect, 0); + bg_update(screen, bitmap, cliprect, 1); + draw_sprites(bitmap, cliprect); + tx_update(screen, bitmap, cliprect); return 0; } -uint32_t nmk16_state::screen_update_bjtwin(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +u32 nmk16_state::screen_update_bjtwin(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap[0]->set_scrollx(0,-m_videoshift); - nmk16_bg_update(screen,bitmap,cliprect,0); - nmk16_draw_sprites(bitmap,cliprect); + bg_update(screen, bitmap, cliprect, 0); + draw_sprites(bitmap, cliprect); return 0; } @@ -557,51 +500,67 @@ uint32_t nmk16_state::screen_update_bjtwin(screen_device &screen, bitmap_ind16 & ***************************************************************************/ -VIDEO_START_MEMBER(nmk16_state,afega) +TILE_GET_INFO_MEMBER(afega_state::get_bg_tile_info_4bit) +{ + const u16 code = m_bgvideoram[0][tile_index]; + SET_TILE_INFO_MEMBER(1, code & 0xfff, code >> 12, 0); +} + +TILE_GET_INFO_MEMBER(afega_state::get_bg_tile_info_8bit) +{ + const u16 code = m_bgvideoram[0][tile_index]; + SET_TILE_INFO_MEMBER(1, code, 0, 0); +} + +VIDEO_START_MEMBER(afega_state,afega) { m_sprlimit = 384 * 263; - m_spriteram_old = make_unique_clear(0x1000/2); - m_spriteram_old2 = make_unique_clear(0x1000/2); + m_sprclk = 0; + m_spriteram_old = make_unique_clear(0x1000/2); + m_spriteram_old2 = make_unique_clear(0x1000/2); m_bg_tilemap[0] = &machine().tilemap().create( *m_gfxdecode, - tilemap_get_info_delegate(&nmk16_state::common_get_bg_tile_info<0, 1>, "bg0_gfx1",this), - tilemap_mapper_delegate(FUNC(nmk16_state::tilemap_scan_pages),this), - 16,16, 256,32); + tilemap_get_info_delegate(FUNC(afega_state::get_bg_tile_info_4bit), this), + tilemap_mapper_delegate(FUNC(afega_state::tilemap_scan_pages), this), + 16, 16, 256, 32); m_tx_tilemap = &machine().tilemap().create( *m_gfxdecode, - tilemap_get_info_delegate(FUNC(nmk16_state::common_get_tx_tile_info),this), + tilemap_get_info_delegate(FUNC(afega_state::common_get_tx_tile_info), this), TILEMAP_SCAN_COLS, - 8,8, 32,32); + 8, 8, 32, 32); m_tx_tilemap->set_transparent_pen(0xf); save_pointer(NAME(m_spriteram_old), 0x1000/2); save_pointer(NAME(m_spriteram_old2), 0x1000/2); + save_item(NAME(m_sprclk)); } -VIDEO_START_MEMBER(nmk16_state,grdnstrm) +VIDEO_START_MEMBER(afega_state,grdnstrm) { m_sprlimit = 384 * 263; - m_spriteram_old = make_unique_clear(0x1000/2); - m_spriteram_old2 = make_unique_clear(0x1000/2); + m_sprclk = 0; + m_spriteram_old = make_unique_clear(0x1000/2); + m_spriteram_old2 = make_unique_clear(0x1000/2); m_bg_tilemap[0] = &machine().tilemap().create( *m_gfxdecode, - tilemap_get_info_delegate(FUNC(nmk16_state::get_tile_info_0_8bit),this), - tilemap_mapper_delegate(FUNC(nmk16_state::tilemap_scan_pages),this), - 16,16, 256,32); + tilemap_get_info_delegate(FUNC(afega_state::get_bg_tile_info_8bit), this), + tilemap_mapper_delegate(FUNC(afega_state::tilemap_scan_pages), this), + 16, 16, 256, 32); m_tx_tilemap = &machine().tilemap().create( *m_gfxdecode, - tilemap_get_info_delegate(FUNC(nmk16_state::common_get_tx_tile_info),this), + tilemap_get_info_delegate(FUNC(afega_state::common_get_tx_tile_info), this), TILEMAP_SCAN_COLS, - 8,8, 32,32); + 8, 8, 32, 32); m_tx_tilemap->set_transparent_pen(0xf); save_pointer(NAME(m_spriteram_old), 0x1000/2); save_pointer(NAME(m_spriteram_old2), 0x1000/2); + save_item(NAME(m_sprclk)); } @@ -613,7 +572,7 @@ VIDEO_START_MEMBER(nmk16_state,grdnstrm) ***************************************************************************/ -void nmk16_state::video_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, +void afega_state::video_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int dsw_flipscreen, // 1 = Horizontal and vertical screen flip are hardwired to 2 dip switches int xoffset, int yoffset, // bg_tilemap0 offsets int attr_mask // "sprite active" mask @@ -621,49 +580,47 @@ void nmk16_state::video_update(screen_device &screen, bitmap_ind16 &bitmap, cons { if (dsw_flipscreen) { - flip_screen_x_set(~ioport("DSW1")->read() & 0x0100); - flip_screen_y_set(~ioport("DSW1")->read() & 0x0200); + flip_screen_x_set(~m_dsw_io[0]->read() & 0x0100); + flip_screen_y_set(~m_dsw_io[0]->read() & 0x0200); } - m_bg_tilemap[0]->set_scrollx(0, m_afega_scroll[0][1] + xoffset); m_bg_tilemap[0]->set_scrolly(0, m_afega_scroll[0][0] + yoffset); m_tx_tilemap->set_scrollx(0, m_afega_scroll[1][1]); m_tx_tilemap->set_scrolly(0, m_afega_scroll[1][0]); + m_bg_tilemap[0]->draw(screen, bitmap, cliprect, 0, 0); - m_bg_tilemap[0]->draw(screen, bitmap, cliprect, 0,0); - - nmk16_draw_sprites_flipsupported(bitmap,cliprect); + draw_sprites_flipsupported(bitmap, cliprect); - m_tx_tilemap->draw(screen, bitmap, cliprect, 0,0); + m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0); } -void nmk16_state::redhawki_video_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) +void afega_state::redhawki_video_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap[0]->set_scrollx(0, m_afega_scroll[1][0]&0xff); m_bg_tilemap[0]->set_scrolly(0, m_afega_scroll[1][1]&0xff); - m_bg_tilemap[0]->draw(screen, bitmap, cliprect, 0,0); + m_bg_tilemap[0]->draw(screen, bitmap, cliprect, 0, 0); - nmk16_draw_sprites_flipsupported(bitmap,cliprect); + draw_sprites_flipsupported(bitmap, cliprect); } -uint32_t nmk16_state::screen_update_afega(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { video_update(screen,bitmap,cliprect, 1, -0x100,+0x000, 0x0001); return 0; } -uint32_t nmk16_state::screen_update_bubl2000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){ video_update(screen,bitmap,cliprect, 0, -0x100,+0x000, 0x0001); return 0; } // no flipscreen support, I really would confirmation from the schematics -uint32_t nmk16_state::screen_update_redhawkb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){ video_update(screen,bitmap,cliprect, 0, +0x000,+0x100, 0x0001); return 0; } -uint32_t nmk16_state::screen_update_redhawki(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){ redhawki_video_update(screen,bitmap,cliprect); return 0;} // strange scroll regs +u32 afega_state::screen_update_afega(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { video_update(screen, bitmap, cliprect, 1, -0x100, +0x000, 0x0001); return 0; } +u32 afega_state::screen_update_bubl2000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){ video_update(screen, bitmap, cliprect, 0, -0x100, +0x000, 0x0001); return 0; } // no flipscreen support, I really would confirmation from the schematics +u32 afega_state::screen_update_redhawkb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){ video_update(screen, bitmap, cliprect, 0, +0x000, +0x100, 0x0001); return 0; } +u32 afega_state::screen_update_redhawki(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect){ redhawki_video_update(screen, bitmap, cliprect); return 0;} // strange scroll regs -uint32_t nmk16_state::screen_update_firehawk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +u32 afega_state::screen_update_firehawk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap[0]->set_scrolly(0, m_afega_scroll[1][1] + 0x100); m_bg_tilemap[0]->set_scrollx(0, m_afega_scroll[0][1] - 0x100); - m_bg_tilemap[0]->draw(screen, bitmap, cliprect, 0,0); + m_bg_tilemap[0]->draw(screen, bitmap, cliprect, 0, 0); - nmk16_draw_sprites_flipsupported(bitmap,cliprect); + draw_sprites_flipsupported(bitmap, cliprect); - m_tx_tilemap->draw(screen, bitmap, cliprect, 0,0); + m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; } -- cgit v1.2.3-70-g09d2 From 47db4b7d85a0fbbfcacb3da01dc6b0fa14f984e1 Mon Sep 17 00:00:00 2001 From: ClawGrip Date: Wed, 10 Jul 2019 22:15:32 +0200 Subject: mpu5.cpp: Add PCB ASCII layout (nw) --- src/mame/drivers/mpu5.cpp | 100 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 97 insertions(+), 3 deletions(-) diff --git a/src/mame/drivers/mpu5.cpp b/src/mame/drivers/mpu5.cpp index 2ee65220b1b..405d699e4d4 100644 --- a/src/mame/drivers/mpu5.cpp +++ b/src/mame/drivers/mpu5.cpp @@ -4,8 +4,7 @@ /* This file contains the hardware emulation, the mpu5.c contains the set listings */ -/* - Many of the games in here also seem to exist on other hardware. +/* Many of the games in here also seem to exist on other hardware. MPU5 @@ -37,10 +36,105 @@ In general things have been added here if the rom structure and initial code looks like the MPU5 boot code - 15/07/11 - rom loading for most games added, still some missing tho and clones still need sorting out properly. */ +/* BARCREST MPU5 XP53922-v1 + ______________________________________________________________________ + | _________ _______________ ____________________ __ | + | |__SW1___| ||||BUTTONS|||| ||LAMPS_1||||||||||| | | | + | ________________ ____________________ | | | + | |||||PAYOUT||||| ||LAMPS_2||||||||||| | | | + | __ |L| | + | |S| |E| | + | |W| |D| | + | |I| |S| | + | |T| | | | + | |_| | | | + | __ | | | + | |D| _________ _________ _________ _________ _________ |_| | + | |A| |4116R LF| TPIC6B273N TPIC6B273N TPIC6B273N |4116R LF| __ | + | |T| _________ _________ _________ __________ _________ |M| | + | |A| |4116R LF| M74HC257B1 M74HC257B1 |ATMEL | TPIC6B273N |E| | + | |P| ____________________ |BARCREST | _________ |T| | + | |_| _________ |BARCREST 881687 | |881685 X | TPIC6B273N |E| | + | __ |CNY74-4 | |_0605_FU___________| |_0544____| |R| | + | |C| ________________________________ |S| | + | |O| |.....CON1 (to game cart).......| | | | + | |I| |_______________________________| |_| | + | |_| _________ _________ _________ _________ __ | + | __ |MC1489PG |74ACT541 |74ACT541 |74ACT541 |B| | + | |A| _________ ____________ _________ _________ |A| | + | |U| |MC1488P| |_GAL20V8B__| |74ACT541 |74ACT541 |R| | + | |X| XTAL1 |B| | + | |_| ________________ _______________ |U| | + | __ | SCC68681C1N40 | |BS62LV1027PCP55 __ |_| | + | |A| |__NXP__________| |__BSI_________|SN75176BP F | + | |U| _______________ U o -> LED -12 + | |X| |BS62LV1027PCP55 S o -> LED +12 + | |P| __________ |__BSI_________| E o -> LED +24 + | |O| |MC68340AG16E o -> LED + +34 + | |R| |L75M | F | + | |T| |QGR0633 | ______ __ U o -> LED STATUS + | |_| |_________| M74HC08N MS6610BSG S o -> LED HALT + | __ ____ __ E __ | + | |A| BATT SWBAT |A| | + | |L| |U| | + | |P| ______________ ___ |D| | + | |_| |||VEND-BUS||| |MIC |_| | + |_____________________________________________________________________| + +SW1 = 8 dipswitches +SWBAT = Single jumper for battery + +XTAL1 = 3.6864MHz +MIC = Microphone + +SWIT = SWITCHES +DATAP = DATAPORT (female DB25) +COI = COINS +AUX = AUX-RS232 +ALP = ALPHA +AUD = AUDIO +BARBU = BARBUS + +Buttons Payout Lamps 1 Lamps 2 Leds Meters Audio + 1 - H3 1 - PAY0 1 - H0 1 \ 1 - C7 \ C 1 - 0V 1 - R+ + 2 - H2 2 - PAY1 2 - H1 2 | 2 - C6 | A 2 - GAP 2 - L- + 3 - H1 3 - PAY2 3 - H2 3 | HIGH 3 - C5 | T 3 - M0 3 - R- + 4 - H0 4 - PAY3 4 - H3 4 | SIDE 4 - C4 | H 4 - M1 4 - L+ + 5 - GAP 5 - 0V 5 - H4 5 | 34V 5 - C3 | O 5 - M2 5 - 0V + 6 - L3 6 - GAP 6 - H5 6 | 6 - C2 | D 6 - M3 6 - GAP + 7 - L2 7 - +24V 7 - GAP 7 | 7 - C1 | E 7 - M4 7 - RIN + 8 - L1 8 - IN0 8 - H6 8 | 8 - C0 / S 8 - M5 8 - LIN + 9 - L0 9 - IN1 9 - H7 9 / 9 - A7 \ 9 - M6 9 - MIC +10 - SW0 10 - IN2 10 - L0 10 \ 10 - A6 | A 10 - M7 +11 - SW1 11 - IN3 11 - L1 11 | 11 - A5 | N 11 \ SENSE +12 - SW2 12 - +12V 12 - L2 12 | LOW 12 - A4 | O 12 / +13 - SW3 13 - +5V 13 - L3 13 | SIDE 13 - GAP| D 13 +12 + 14 - 0V 14 - L4 14 | 0V 14 - A3 | E + 15 - L5 15 | 15 - A2 | S + 16 - L6 16 | 16 - A1 | + 17 - L7 17 / 17 - A0 / + +Switches Aux-RS232 Aux Port Alpha Vend-Bus + 1 - SW0 1 - +12 1 - AX7 1 - CLK 1 - -34 + 2 - GAP 2 - TX 2 - AX6 2 - D 2 - +12 + 3 - SW1 3 - RX 3 - AX5 3 - RES 3 - GAP + 4 - SW2 4 - RTS 4 - AX4 4 - 0V 4 - TX \ + 5 - SW3 5 - CTS 5 - AX3 5 - GAP 5 - RX / RS232 + 6 - L7 6 - GAP 6 - AX2 6 - 0V 6 - RX \ + 7 - L6 7 - 0V 7 - AX1 7 - +12 7 - TX / VEND + 8 - L5 8 - AX0 8 - TX - O.C. + 9 - L4 9 - 11 9 - 0V + 10 - 10 + 11 - ST + 12 - +5 + 13 - +12 + 14 - GAP + 15 - 0V +*/ + #include "emu.h" -- cgit v1.2.3-70-g09d2 From f94e99861434960025b1e3f8a138c4f5b25fedd2 Mon Sep 17 00:00:00 2001 From: Sandro Ronco Date: Wed, 10 Jul 2019 23:57:28 +0200 Subject: New WORKING machines -------------------- Mephisto Berlin 68000 [Sandro Ronco] Mephisto Berlin 68000 London Upgrade [Sandro Ronco] --- src/mame/drivers/mmodular.cpp | 39 +++- src/mame/layout/mephisto_berlin.lay | 402 ++++++++++++++++++++++++++++++++++++ src/mame/mame.lst | 2 + 3 files changed, 442 insertions(+), 1 deletion(-) create mode 100644 src/mame/layout/mephisto_berlin.lay diff --git a/src/mame/drivers/mmodular.cpp b/src/mame/drivers/mmodular.cpp index 20494ee60af..39cbb14cb4a 100644 --- a/src/mame/drivers/mmodular.cpp +++ b/src/mame/drivers/mmodular.cpp @@ -41,6 +41,7 @@ #include "screen.h" #include "speaker.h" +#include "mephisto_berlin.lh" #include "mmodular.lh" @@ -77,11 +78,13 @@ public: , m_keys(*this, "KEY") { } + void berl16(machine_config &config); void berlinp(machine_config &config); private: DECLARE_READ8_MEMBER(berlinp_input_r); + void berl16_mem(address_map &map); void berlinp_mem(address_map &map); required_device m_board; @@ -177,6 +180,18 @@ READ8_MEMBER(berlinp_state::berlinp_input_r) return m_board->input_r(space, offset) ^ 0xff; } +void berlinp_state::berl16_mem(address_map &map) +{ + map(0x000000, 0x01ffff).rom(); + map(0x800000, 0x87ffff).ram(); + map(0x900000, 0x907fff).ram().share("nvram"); + map(0xa00000, 0xa00000).r(FUNC(berlinp_state::berlinp_input_r)); + map(0xb00000, 0xb00000).w(m_board, FUNC(mephisto_board_device::mux_w)); + map(0xc00000, 0xc00000).w("display", FUNC(mephisto_display_modul_device::latch_w)); + map(0xd00008, 0xd00008).w("display", FUNC(mephisto_display_modul_device::io_w)); + map(0xe00000, 0xe00000).w(m_board, FUNC(mephisto_board_device::led_w)); +} + void berlinp_state::berlinp_mem(address_map &map) { map(0x000000, 0x03ffff).rom(); @@ -319,7 +334,15 @@ void berlinp_state::berlinp(machine_config &config) MEPHISTO_BUTTONS_BOARD(config, m_board); MEPHISTO_DISPLAY_MODUL(config, "display"); - config.set_default_layout(layout_mmodular); + config.set_default_layout(layout_mephisto_berlin); +} + +void berlinp_state::berl16(machine_config &config) +{ + berlinp(config); + m68000_device &maincpu(M68000(config.replace(), "maincpu", XTAL(12'000'000))); + maincpu.set_addrmap(AS_PROGRAM, &berlinp_state::berl16_mem); + maincpu.set_periodic_int(FUNC(berlinp_state::irq2_line_hold), attotime::from_hz(750)); } @@ -385,11 +408,23 @@ ROM_START( lyon32 ) ROM_LOAD("lyon32.bin", 0x00000, 0x20000, CRC(5c128b06) SHA1(954c8f0d3fae29900cb1e9c14a41a9a07a8e185f)) ROM_END +ROM_START( berl16 ) + ROM_REGION16_BE( 0x20000, "maincpu", 0 ) + ROM_LOAD16_BYTE("berlin_68000_even.bin", 0x00000, 0x10000, CRC(31337f15) SHA1(0dcacb153a6f8376e6f1c2f3e57e60aad4370740)) + ROM_LOAD16_BYTE("berlin_68000_odd.bin", 0x00001, 0x10000, CRC(cc146819) SHA1(e4b2c6e496eff4a657a0718be292f563fb4e5688)) +ROM_END + ROM_START( berlinp ) ROM_REGION32_BE( 0x40000, "maincpu", 0 ) ROM_LOAD("berlinp.bin", 0x00000, 0x40000, CRC(82fbaf6e) SHA1(729b7cef3dfaecc4594a6178fc4ba6015afa6202)) ROM_END +ROM_START( berl16l ) + ROM_REGION16_BE( 0x20000, "maincpu", 0 ) + ROM_LOAD16_BYTE("berlin_68000_london_even.bin", 0x00000, 0x10000, CRC(0ccddbc6) SHA1(90effdc9f2811a24d450b74ccfb24995ce896b86)) + ROM_LOAD16_BYTE("berlin_68000_london_odd.bin", 0x00001, 0x10000, CRC(5edac658) SHA1(18ebebc5ceffd9a01798d8a3709875120bd096f7)) +ROM_END + ROM_START( bpl32 ) ROM_REGION32_BE( 0x40000, "maincpu", 0 ) ROM_LOAD("bpl32.bin", 0x00000, 0x40000, CRC(d75e170f) SHA1(ac0ebdaa114abd4fef87361a03df56928768b1ae)) @@ -414,5 +449,7 @@ CONS( 1996, lond020, alm32, 0, van32, alm32, mmodular_state, empty_in CONS( 1996, lond030, gen32, 0, gen32, gen32, mmodular_state, init_gen32, "Hegener & Glaser", "Mephisto Genius 68030 London Upgrade", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK ) // not modular boards +CONS( 1992, berl16, 0, 0, berl16, berlinp, berlinp_state, empty_init, "Hegener & Glaser", "Mephisto Berlin 68000", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK ) CONS( 1994, berlinp, 0, 0, berlinp, berlinp, berlinp_state, empty_init, "Hegener & Glaser", "Mephisto Berlin Pro 68020", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1996, berl16l, berl16, 0, berl16, berlinp, berlinp_state, empty_init, "Hegener & Glaser", "Mephisto Berlin 68000 London Upgrade", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK ) CONS( 1996, bpl32, berlinp, 0, berlinp, berlinp, berlinp_state, empty_init, "Hegener & Glaser", "Mephisto Berlin Pro London Upgrade", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_TIMING | MACHINE_CLICKABLE_ARTWORK ) diff --git a/src/mame/layout/mephisto_berlin.lay b/src/mame/layout/mephisto_berlin.lay new file mode 100644 index 00000000000..dfc7ee7697a --- /dev/null +++ b/src/mame/layout/mephisto_berlin.lay @@ -0,0 +1,402 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/mame.lst b/src/mame/mame.lst index f58bed174e8..313bbe34dfd 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -21999,7 +21999,9 @@ van32 // 1991 Mephisto Vancouver 68020 gen32 // 1993 Mephisto Genius 68030 lond020 // 1996 Mephisto London 68020 lond030 // 1996 Mephisto Genius 68030 London Upgrade +berl16 // 1992 Mephisto Berlin 68000 berlinp // 1994 Mephisto Berlin Pro 68020 +berl16l // 1996 Mephisto Berlin 68000 London Upgrade bpl32 // 1996 Mephisto Berlin Pro London Upgrade @source:mod8.cpp -- cgit v1.2.3-70-g09d2 From 7804df982140d84144c119917804136a916efca4 Mon Sep 17 00:00:00 2001 From: AJR Date: Wed, 10 Jul 2019 18:13:02 -0400 Subject: m37710: Fix alpinerd regression (port writes are blocked when direction register = 0, not FF) (nw) --- src/devices/cpu/m37710/m37710.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devices/cpu/m37710/m37710.cpp b/src/devices/cpu/m37710/m37710.cpp index 15da8e4ae5a..7d6d79a9403 100644 --- a/src/devices/cpu/m37710/m37710.cpp +++ b/src/devices/cpu/m37710/m37710.cpp @@ -509,7 +509,7 @@ void m37710_cpu_device::port_w(offs_t offset, uint8_t data) else { uint8_t d = m_port_dir[p]; - if (d != 0xff) + if (d != 0) m_port_out_cb[p](0, data & d, d); m_port_regs[p] = data; } -- cgit v1.2.3-70-g09d2 From 5eaac5e857176b56c990f6bb864a1a5c27b6cf6d Mon Sep 17 00:00:00 2001 From: hap Date: Thu, 11 Jul 2019 01:02:32 +0200 Subject: New not working machine added ----------- Talking Wrinkles [hap, David Viens] --- scripts/target/mame/mess.lua | 1 + src/mame/drivers/wrinkles.cpp | 136 ++++++++++++++++++++++++++++++++++++++++++ src/mame/mame.lst | 3 + src/mame/mess.flt | 1 + 4 files changed, 141 insertions(+) create mode 100644 src/mame/drivers/wrinkles.cpp diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua index 83b8b4986dd..e4e610ac7d0 100644 --- a/scripts/target/mame/mess.lua +++ b/scripts/target/mame/mess.lua @@ -1918,6 +1918,7 @@ files { MAME_DIR .. "src/mame/includes/coleco.h", MAME_DIR .. "src/mame/machine/coleco.cpp", MAME_DIR .. "src/mame/machine/coleco.h", + MAME_DIR .. "src/mame/drivers/wrinkles.cpp", } createMESSProjects(_target, _subtarget, "compugraphic") diff --git a/src/mame/drivers/wrinkles.cpp b/src/mame/drivers/wrinkles.cpp new file mode 100644 index 00000000000..170bc86f349 --- /dev/null +++ b/src/mame/drivers/wrinkles.cpp @@ -0,0 +1,136 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/****************************************************************************** + +Coleco Talking Wrinkles, a plushie dog handpuppet toy + +Hardware is a P80C31BH @ 11MHz and a 32KB ROM, RAM is in the MCU. +It also has a cartridge slot, but no known cartridges were released. +The speech technology is by Electronic Speech Systems. + +TODO: +- add sensors + +******************************************************************************/ + +#include "emu.h" +#include "cpu/mcs51/mcs51.h" +#include "sound/dac.h" +#include "sound/volt_reg.h" +#include "speaker.h" + + +namespace { + +class wrinkles_state : public driver_device +{ +public: + wrinkles_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu") + { } + + void wrinkles(machine_config &config); + +protected: + virtual void machine_start() override; + +private: + // devices/pointers + required_device m_maincpu; + + void main_map(address_map &map); + + // I/O handlers + DECLARE_WRITE8_MEMBER(sensor_w); + DECLARE_READ8_MEMBER(sensor_r); +}; + +void wrinkles_state::machine_start() +{ +} + + + +/****************************************************************************** + I/O +******************************************************************************/ + +WRITE8_MEMBER(wrinkles_state::sensor_w) +{ +} + +READ8_MEMBER(wrinkles_state::sensor_r) +{ + // sensors here + // d1: hold down for power-off? + // d7: mouth sensor? + // other: ? + return 0xff; +} + + + +/****************************************************************************** + Address Maps +******************************************************************************/ + +void wrinkles_state::main_map(address_map &map) +{ + map.global_mask(0x7fff); + map(0x0000, 0x7fff).rom(); +} + + + +/****************************************************************************** + Input Ports +******************************************************************************/ + +static INPUT_PORTS_START( wrinkles ) +INPUT_PORTS_END + + + +/****************************************************************************** + Machine Configs +******************************************************************************/ + +void wrinkles_state::wrinkles(machine_config &config) +{ + /* basic machine hardware */ + I80C31(config, m_maincpu, 11_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &wrinkles_state::main_map); + m_maincpu->port_in_cb<1>().set(FUNC(wrinkles_state::sensor_r)); + m_maincpu->port_out_cb<1>().set(FUNC(wrinkles_state::sensor_w)); + m_maincpu->port_out_cb<3>().set("dac", FUNC(dac_8bit_r2r_device::write)); + + /* sound hardware */ + SPEAKER(config, "speaker").front_center(); + DAC_8BIT_R2R(config, "dac").add_route(ALL_OUTPUTS, "speaker", 0.5); + voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref")); + vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT); + vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT); +} + + + +/****************************************************************************** + ROM Definitions +******************************************************************************/ + +ROM_START( wrinkles ) + ROM_REGION( 0x8000, "maincpu", 0 ) + ROM_LOAD("umua117_wrkl_dif4.u3", 0x0000, 0x8000, CRC(4ec8ddbf) SHA1(beb165d933659859a4f966168ca121843cd6642b) ) +ROM_END + +} // anonymous namespace + + + +/****************************************************************************** + Drivers +******************************************************************************/ + +// YEAR NAME PARENT CMP MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS +CONS( 1986, wrinkles, 0, 0, wrinkles, wrinkles, wrinkles_state, empty_init, "Coleco / Ganz", "Talking Wrinkles", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 313bbe34dfd..abb9ea2e4d4 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -40164,6 +40164,9 @@ wrallya // (c) 1993 - Ref 930705 wrallyat // (c) 1993 - Ref 930217 wrallyb // (c) 1993 - Ref 930217 +@source:wrinkles.cpp +wrinkles + @source:wswan.cpp wscolor // Bandai WonderSwan Color Handheld wswan // Bandai WonderSwan Handheld diff --git a/src/mame/mess.flt b/src/mame/mess.flt index 988c0c620aa..20fd3854b01 100644 --- a/src/mame/mess.flt +++ b/src/mame/mess.flt @@ -904,6 +904,7 @@ vtech2.cpp vtech_eu3a12.cpp wangpc.cpp wicat.cpp +wrinkles.cpp wswan.cpp wy100.cpp wy150.cpp -- cgit v1.2.3-70-g09d2