sharp/x1.cpp: convert machine_start/reset calls

This commit is contained in:
angelosa 2024-05-31 00:04:15 +02:00
parent 344de2ca8b
commit afa1c667c0
3 changed files with 16 additions and 28 deletions

View File

@ -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<gfx_element>(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));

View File

@ -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<z80dma_device> m_dma;

View File

@ -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);