diff options
Diffstat (limited to 'src/mame/drivers/anes.cpp')
-rw-r--r-- | src/mame/drivers/anes.cpp | 84 |
1 files changed, 59 insertions, 25 deletions
diff --git a/src/mame/drivers/anes.cpp b/src/mame/drivers/anes.cpp index 206aeff43e8..6be2d5ace8b 100644 --- a/src/mame/drivers/anes.cpp +++ b/src/mame/drivers/anes.cpp @@ -4,6 +4,11 @@ /* TON PUU MAHJONG (Japan) by ANES +TODO: +- ROM banking; +- blitter, 8bpp with hardcoded palette & writes to ROM area!? +- inputs; + - 1x Z0840008PSC Z80 CPU - 1x 16.000 XTAL near the Z80 - 1x YM2413 sound chip @@ -31,28 +36,72 @@ public: { } - u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + DECLARE_WRITE8_MEMBER(vram_offset_w); + DECLARE_WRITE8_MEMBER(blit_trigger_w); + + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); protected: virtual void machine_start() override; private: + uint8_t m_vram_offset[3]; }; +uint32_t anes_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + return 0; +} + +WRITE8_MEMBER(anes_state::vram_offset_w) +{ + m_vram_offset[offset] = data; +} + +WRITE8_MEMBER(anes_state::blit_trigger_w) +{ + /* + operation is: + checks for bit 4 to be high in port $16 + writes either 0 or 3 to port $04 + writes a 0 to port $00 + writes an offset to ports $0c / $0d / $0e + writes 1 to port $0b, writes to program space, writes 2 to port $0b, writes to program space + writes a mode to port $0b, writes to trigger port $0a + */ + + //printf("%02x%02x%02x\n",m_vram_offset[0],m_vram_offset[1],m_vram_offset[2]); +} + static ADDRESS_MAP_START( prg_map, AS_PROGRAM, 8, anes_state ) - AM_RANGE(0x0000, 0x7fff) AM_ROM + AM_RANGE(0x0000, 0xefff) AM_ROM + AM_RANGE(0xf000, 0xffff) AM_RAM ADDRESS_MAP_END static ADDRESS_MAP_START( io_map, AS_IO, 8, anes_state ) ADDRESS_MAP_GLOBAL_MASK(0xff) + ADDRESS_MAP_UNMAP_HIGH + + AM_RANGE(0x07, 0x07) AM_WRITENOP // mux write + AM_RANGE(0x08, 0x09) AM_DEVWRITE("ym", ym2413_device, write) + AM_RANGE(0x0a, 0x0a) AM_WRITE(blit_trigger_w) +// AM_RANGE(0x0b, 0x0b) AM_WRITE(blit_mode_w) + AM_RANGE(0x0c, 0x0e) AM_WRITE(vram_offset_w) + AM_RANGE(0x11, 0x11) AM_READ_PORT("DSW1") + AM_RANGE(0x12, 0x12) AM_READ_PORT("DSW2") + AM_RANGE(0x13, 0x13) AM_READ_PORT("DSW3") + AM_RANGE(0x14, 0x15) AM_READNOP // mux read + AM_RANGE(0x16, 0x16) AM_READ_PORT("IN0") AM_WRITENOP +// AM_RANGE(0xfe, 0xfe) banking? unknown ROM range ADDRESS_MAP_END static INPUT_PORTS_START( anes ) - PORT_START("IN") - PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_START("IN0") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // blitter busy status + PORT_BIT( 0xef, IP_ACTIVE_LOW, IPT_UNKNOWN ) // used, coin? - PORT_START("SW1") + PORT_START("DSW1") PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW1:1") PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW1:2") PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW1:3") @@ -62,7 +111,7 @@ static INPUT_PORTS_START( anes ) PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW1:7") PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW1:8") - PORT_START("SW2") + PORT_START("DSW2") PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW2:1") PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW2:2") PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW2:3") @@ -72,7 +121,7 @@ static INPUT_PORTS_START( anes ) PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW2:7") PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW2:8") - PORT_START("SW3") + PORT_START("DSW3") PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW3:1") PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW3:2") PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW3:3") @@ -82,7 +131,7 @@ static INPUT_PORTS_START( anes ) PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW3:7") PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW3:8") - PORT_START("SW4") + PORT_START("DSW4") PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW4:1") PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW4:2") PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW4:3") @@ -98,20 +147,6 @@ void anes_state::machine_start() { } -u32 anes_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - return 0; -} - - -static const gfx_layout gfx_layout = -{ -}; - - -static GFXDECODE_START( anes ) - GFXDECODE_ENTRY( "gfx1", 0, gfx_layout, 0x0, 16) -GFXDECODE_END static MACHINE_CONFIG_START( anes ) @@ -119,6 +154,7 @@ static MACHINE_CONFIG_START( anes ) MCFG_CPU_ADD("maincpu", Z80, XTAL_16MHz / 2) // Z0840008PSC MCFG_CPU_PROGRAM_MAP(prg_map) MCFG_CPU_IO_MAP(io_map) + MCFG_CPU_VBLANK_INT_DRIVER("screen", anes_state, irq0_line_hold) // all wrong MCFG_SCREEN_ADD("screen", RASTER) @@ -131,8 +167,6 @@ static MACHINE_CONFIG_START( anes ) MCFG_PALETTE_ADD("palette", 0x100) - MCFG_GFXDECODE_ADD("gfxdecode", "palette", anes) - /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") MCFG_SOUND_ADD("ym", YM2413, XTAL_3_579545MHz) @@ -150,4 +184,4 @@ ROM_START( tonpuu ) ROM_END -GAME( 200?, tonpuu, 0, anes, anes, anes_state, 0, ROT0, "ANES", "Ton Puu Mahjong", MACHINE_IS_SKELETON ) +GAME( 200?, tonpuu, 0, anes, anes, anes_state, 0, ROT0, "ANES", "Ton Puu Mahjong [BET] (Japan)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS ) |