From afa1c667c07826c408f8d32ceebfdd3d8b2d2356 Mon Sep 17 00:00:00 2001 From: angelosa Date: Fri, 31 May 2024 00:04:15 +0200 Subject: sharp/x1.cpp: convert machine_start/reset calls --- src/mame/sharp/x1.cpp | 22 +++++----------------- src/mame/sharp/x1.h | 6 ++++-- src/mame/sharp/x1twin.cpp | 16 +++++++--------- 3 files changed, 16 insertions(+), 28 deletions(-) diff --git a/src/mame/sharp/x1.cpp b/src/mame/sharp/x1.cpp index b182f1dfce1..5cc34a06d31 100644 --- a/src/mame/sharp/x1.cpp +++ b/src/mame/sharp/x1.cpp @@ -37,20 +37,10 @@ TODO: - specific x1turboz features? per-game/program specific TODO (to be moved to hash file): -- CZ8FB02 / CZ8FB03: doesn't load at all, they are 2hd floppies apparently; -- Chack'n Pop: game is too fast, presumably missing wait states; -- Dragon Buster: it crashed to me once with a obj flag hang; -- The Goonies (x1 only): goes offsync with the PCG beam positions; -- Graphtol: sets up x1turboz paletteram, graphic garbage due of it; -- Gyajiko2: hangs when it's supposed to load the character selection screen, FDC bug? -- Hydlide 3: can't get the user disk to work properly, could be a bad dump; -- Lupin the 3rd: don't know neither how to "data load" nor how to "create a character" ... does the game hangs? - Might & Magic: uses 0xe80-3 kanji ports, should be a good test case for that; -- "newtype": trips a z80dma assert, worked around for now; - Saziri: doesn't re-initialize the tilemap attribute vram when you start a play, making it to have missing colors if you don't start a play in time; - Super Billiards (X1 Pack 14): has a slight PCG timing bug, that happens randomly; - Trivia-Q: dunno what to do on the selection screen, missing inputs? -- X1F Demo ("New X1 Demo"): needs partial updates, but they doesn't cope well with current video system; - Ys 2: crashes after the disclaimer screen; - Ys 3: missing user disk, to hack it (and play with x1turboz features): bp 81ca,pc += 2 - Ys 3: never uploads a valid 4096 palette, probably related to the fact that we don't have an user disk @@ -1066,6 +1056,7 @@ void x1_state::ex_gfxram_w(offs_t offset, uint8_t data) */ void x1_state::scrn_w(uint8_t data) { + m_scrn_reg.video_mode = data & 0xc7; m_scrn_reg.pcg_mode = BIT(data, 5); m_bitmapbank->set_entry(BIT(data, 4)); m_scrn_reg.disp_bank = BIT(data, 3); @@ -2075,7 +2066,7 @@ TIMER_CALLBACK_MEMBER(x1_state::rtc_tick_cb) if((m_rtc.year & 0xf0) >= 0xa0) { m_rtc.year = 0; } //roll over } -MACHINE_RESET_MEMBER(x1_state,x1) +void x1_state::machine_reset() { //uint8_t *ROM = memregion("x1_cpu")->base(); int i; @@ -2125,9 +2116,9 @@ MACHINE_RESET_MEMBER(x1_state,x1) m_fdc->dden_w(0); } -MACHINE_RESET_MEMBER(x1_state,x1turbo) +void x1turbo_state::machine_reset() { - MACHINE_RESET_CALL_MEMBER( x1 ); + x1_state::machine_reset(); m_is_turbo = 1; m_ex_bank = 0x10; @@ -2171,6 +2162,7 @@ void x1_state::machine_start() save_pointer(NAME(m_work_ram), 0x10000*0x10); save_pointer(NAME(m_emm_ram), 0x1000000); save_pointer(NAME(m_pcg_ram), 0x1800); + save_item(STRUCT_MEMBER(m_scrn_reg, video_mode)); m_gfxdecode->set_gfx(3, std::make_unique(m_palette, x1_pcg_8x8, m_pcg_ram.get(), 0, 1, 0)); } @@ -2215,8 +2207,6 @@ void x1_state::x1(machine_config &config) ppi.out_pb_callback().set(FUNC(x1_state::x1_portb_w)); ppi.out_pc_callback().set(FUNC(x1_state::x1_portc_w)); - MCFG_MACHINE_RESET_OVERRIDE(x1_state,x1) - /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(60); @@ -2274,8 +2264,6 @@ void x1turbo_state::x1turbo(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &x1turbo_state::x1turbo_mem); m_maincpu->set_daisy_config(x1turbo_daisy); - MCFG_MACHINE_RESET_OVERRIDE(x1_state,x1turbo) - m_iobank->set_map(&x1turbo_state::x1turbo_io_banks); z80sio_device& sio(Z80SIO(config, "sio", MAIN_CLOCK/4)); diff --git a/src/mame/sharp/x1.h b/src/mame/sharp/x1.h index d7ed50c3ed3..9d3f3ccceaf 100644 --- a/src/mame/sharp/x1.h +++ b/src/mame/sharp/x1.h @@ -133,9 +133,9 @@ public: void x1_portc_w(uint8_t data); void init_x1_kanji(); virtual void machine_start() override; - DECLARE_MACHINE_RESET(x1); + virtual void machine_reset() override; virtual void video_start() override; - DECLARE_MACHINE_RESET(x1turbo); + uint32_t screen_update_x1(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); DECLARE_INPUT_CHANGED_MEMBER(ipl_reset); DECLARE_INPUT_CHANGED_MEMBER(nmi_reset); @@ -181,6 +181,7 @@ protected: uint8_t pcg_mode = 0; uint8_t v400_mode = 0; uint8_t ank_sel = 0; + uint8_t video_mode = 0; /**< temp debugging variable */ uint8_t pri = 0; uint8_t blackclip = 0; // x1 turbo specific @@ -339,6 +340,7 @@ public: protected: void x1turbo_io_banks(address_map &map); void x1turbo_mem(address_map &map); + virtual void machine_reset() override; private: required_device m_dma; diff --git a/src/mame/sharp/x1twin.cpp b/src/mame/sharp/x1twin.cpp index 68d9173e18f..4281c6a227b 100644 --- a/src/mame/sharp/x1twin.cpp +++ b/src/mame/sharp/x1twin.cpp @@ -2,15 +2,15 @@ // copyright-holders:Angelo Salese /************************************************************************************************ - Sharp X1Twin = Sharp X1 + NEC PC Engine All-in-One +Sharp X1Twin = Sharp X1 + NEC PC Engine All-in-One - Both systems don't interact at all, according to info on the net they just share the - same "house". It doesn't even do super-imposing, not even with the in-built X1 feature apparently +Both systems don't interact at all, according to info on the net they just share the +same "house". It doesn't even do super-imposing, not even with the in-built X1 feature apparently - TODO: - - Find 100% trusted info about it. - - inherit pce_state into x1twin_state - - Needs video mods +TODO: +- Find 100% trusted info about it. +- Work out this to really be a middleground for both pce_state & x1twin_state +- Needs video mods ************************************************************************************************/ @@ -444,8 +444,6 @@ void x1twin_state::x1twin(machine_config &config) ppi.out_pb_callback().set(FUNC(x1_state::x1_portb_w)); ppi.out_pc_callback().set(FUNC(x1_state::x1_portc_w)); - MCFG_MACHINE_RESET_OVERRIDE(x1twin_state,x1) - #if 0 H6280(config, m_maincpu, PCE_MAIN_CLOCK/3); m_maincpu->set_addrmap(AS_PROGRAM, pce_mem); -- cgit v1.2.3