mirror of
https://github.com/holub/mame
synced 2025-06-23 21:06:38 +03:00
cheekyms.c, clshroad.c, sbugger.c, spcforce.c: added / completed / enabled save state support (nw)
This commit is contained in:
parent
7dc3254647
commit
33ecdfcb9f
@ -32,15 +32,6 @@ wiping_sound_device::wiping_sound_device(const machine_config &mconfig, const ch
|
||||
memset(m_soundregs, 0, sizeof(UINT8)*0x4000);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_config_complete - perform any
|
||||
// operations now that the configuration is
|
||||
// complete
|
||||
//-------------------------------------------------
|
||||
|
||||
void wiping_sound_device::device_config_complete()
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// device_start - device-specific startup
|
||||
@ -78,6 +69,17 @@ void wiping_sound_device::device_start()
|
||||
voice->wave = &m_sound_prom[0];
|
||||
voice->counter = 0;
|
||||
}
|
||||
|
||||
save_item(NAME(m_soundregs));
|
||||
|
||||
for (int i = 0; i < MAX_VOICES; i++)
|
||||
{
|
||||
save_item(NAME(m_channel_list[i].frequency), i);
|
||||
save_item(NAME(m_channel_list[i].counter), i);
|
||||
save_item(NAME(m_channel_list[i].volume), i);
|
||||
save_item(NAME(m_channel_list[i].oneshot), i);
|
||||
save_item(NAME(m_channel_list[i].oneshotplaying), i);
|
||||
}
|
||||
}
|
||||
|
||||
/* build a table to divide by the number of voices; gain is specified as gain*16 */
|
||||
|
@ -23,11 +23,11 @@ public:
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_config_complete();
|
||||
virtual void device_start();
|
||||
|
||||
// sound stream update overrides
|
||||
virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
|
||||
|
||||
private:
|
||||
// internal state
|
||||
|
||||
|
@ -2,8 +2,8 @@
|
||||
Universal Cheeky Mouse Driver
|
||||
(c)Lee Taylor May/June 1998, All rights reserved.
|
||||
|
||||
For use only in offical MAME releases.
|
||||
Not to be distributed as part of any commerical work.
|
||||
For use only in official MAME releases.
|
||||
Not to be distributed as part of any commercial work.
|
||||
**************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
@ -31,8 +31,8 @@ static ADDRESS_MAP_START( io_map, AS_IO, 8, cheekyms_state )
|
||||
AM_RANGE(0x00, 0x00) AM_READ_PORT("DSW")
|
||||
AM_RANGE(0x01, 0x01) AM_READ_PORT("INPUTS")
|
||||
AM_RANGE(0x20, 0x3f) AM_WRITEONLY AM_SHARE("spriteram")
|
||||
AM_RANGE(0x40, 0x40) AM_WRITE(cheekyms_port_40_w)
|
||||
AM_RANGE(0x80, 0x80) AM_WRITE(cheekyms_port_80_w) AM_SHARE("port_80")
|
||||
AM_RANGE(0x40, 0x40) AM_WRITE(port_40_w)
|
||||
AM_RANGE(0x80, 0x80) AM_WRITE(port_80_w) AM_SHARE("port_80")
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
@ -109,6 +109,7 @@ GFXDECODE_END
|
||||
|
||||
void cheekyms_state::machine_start()
|
||||
{
|
||||
save_item(NAME(m_irq_mask));
|
||||
}
|
||||
|
||||
INTERRUPT_GEN_MEMBER(cheekyms_state::vblank_irq)
|
||||
@ -133,7 +134,7 @@ static MACHINE_CONFIG_START( cheekyms, cheekyms_state )
|
||||
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
|
||||
MCFG_SCREEN_SIZE(32*8, 32*8)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 4*8, 28*8-1)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(cheekyms_state, screen_update_cheekyms)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(cheekyms_state, screen_update)
|
||||
MCFG_SCREEN_PALETTE("palette")
|
||||
|
||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", cheekyms)
|
||||
|
@ -28,7 +28,7 @@ void clshroad_state::machine_reset()
|
||||
}
|
||||
|
||||
|
||||
READ8_MEMBER(clshroad_state::clshroad_input_r)
|
||||
READ8_MEMBER(clshroad_state::input_r)
|
||||
{
|
||||
return ((~ioport("P1")->read() & (1 << offset)) ? 1 : 0) |
|
||||
((~ioport("P2")->read() & (1 << offset)) ? 2 : 0) |
|
||||
@ -44,11 +44,11 @@ static ADDRESS_MAP_START( clshroad_map, AS_PROGRAM, 8, clshroad_state )
|
||||
AM_RANGE(0x9800, 0x9dff) AM_RAM
|
||||
AM_RANGE(0x9e00, 0x9fff) AM_RAM AM_SHARE("spriteram")
|
||||
AM_RANGE(0xa001, 0xa001) AM_WRITENOP // ? Interrupt related
|
||||
AM_RANGE(0xa004, 0xa004) AM_WRITE(clshroad_flipscreen_w)
|
||||
AM_RANGE(0xa100, 0xa107) AM_READ(clshroad_input_r)
|
||||
AM_RANGE(0xa800, 0xafff) AM_RAM_WRITE(clshroad_vram_1_w) AM_SHARE("vram_1") // Layer 1
|
||||
AM_RANGE(0xa004, 0xa004) AM_WRITE(flipscreen_w)
|
||||
AM_RANGE(0xa100, 0xa107) AM_READ(input_r)
|
||||
AM_RANGE(0xa800, 0xafff) AM_RAM_WRITE(vram_1_w) AM_SHARE("vram_1") // Layer 1
|
||||
AM_RANGE(0xb000, 0xb003) AM_WRITEONLY AM_SHARE("vregs") // Scroll
|
||||
AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(clshroad_vram_0_w) AM_SHARE("vram_0") // Layer 0
|
||||
AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(vram_0_w) AM_SHARE("vram_0") // Layer 0
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( clshroad_sound_map, AS_PROGRAM, 8, clshroad_state )
|
||||
@ -244,7 +244,7 @@ static MACHINE_CONFIG_START( firebatl, clshroad_state )
|
||||
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
|
||||
MCFG_SCREEN_SIZE(0x120, 0x100)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0, 0x120-1, 0x0+16, 0x100-16-1)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(clshroad_state, screen_update_clshroad)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(clshroad_state, screen_update)
|
||||
MCFG_SCREEN_PALETTE("palette")
|
||||
|
||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", firebatl)
|
||||
@ -279,7 +279,7 @@ static MACHINE_CONFIG_START( clshroad, clshroad_state )
|
||||
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
|
||||
MCFG_SCREEN_SIZE(0x120, 0x100)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0, 0x120-1, 0x0+16, 0x100-16-1)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(clshroad_state, screen_update_clshroad)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(clshroad_state, screen_update)
|
||||
MCFG_SCREEN_PALETTE("palette")
|
||||
|
||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", clshroad)
|
||||
@ -479,7 +479,7 @@ die once, it would be nice to avoid the hack however
|
||||
ROM[0x05C8] = 0x23;
|
||||
}
|
||||
|
||||
GAME( 1984, firebatl, 0, firebatl, firebatl, clshroad_state, firebatl, ROT90, "Taito", "Fire Battle", GAME_IMPERFECT_GRAPHICS )
|
||||
GAME( 1986, clshroad, 0, clshroad, clshroad, driver_device, 0, ROT0, "Wood Place Inc.", "Clash-Road", 0 )
|
||||
GAME( 1986, clshroads,clshroad, clshroad, clshroad, driver_device, 0, ROT0, "Wood Place Inc. (Status Game Corp. license)", "Clash-Road (Status license)", 0 )
|
||||
GAME( 1986, clshroadd,clshroad, clshroad, clshroad, driver_device, 0, ROT0, "Wood Place Inc. (Data East license)", "Clash-Road (Data East license)", 0 )
|
||||
GAME( 1984, firebatl, 0, firebatl, firebatl, clshroad_state, firebatl, ROT90, "Taito", "Fire Battle", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
|
||||
GAME( 1986, clshroad, 0, clshroad, clshroad, driver_device, 0, ROT0, "Wood Place Inc.", "Clash-Road", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1986, clshroads,clshroad, clshroad, clshroad, driver_device, 0, ROT0, "Wood Place Inc. (Status Game Corp. license)", "Clash-Road (Status license)", GAME_SUPPORTS_SAVE )
|
||||
GAME( 1986, clshroadd,clshroad, clshroad, clshroad, driver_device, 0, ROT0, "Wood Place Inc. (Data East license)", "Clash-Road (Data East license)", GAME_SUPPORTS_SAVE )
|
||||
|
@ -108,8 +108,8 @@ Sound PCB
|
||||
|
||||
static ADDRESS_MAP_START( sbugger_map, AS_PROGRAM, 8, sbugger_state )
|
||||
AM_RANGE(0x0000, 0x37ff) AM_ROM
|
||||
AM_RANGE(0xc800, 0xcbff) AM_RAM_WRITE(sbugger_videoram_attr_w) AM_SHARE("videoram_attr")
|
||||
AM_RANGE(0xcc00, 0xcfff) AM_RAM_WRITE(sbugger_videoram_w) AM_SHARE("videoram")
|
||||
AM_RANGE(0xc800, 0xcbff) AM_RAM_WRITE(videoram_attr_w) AM_SHARE("videoram_attr")
|
||||
AM_RANGE(0xcc00, 0xcfff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram")
|
||||
AM_RANGE(0xe000, 0xe0ff) AM_DEVREADWRITE("i8156", i8155_device, memory_r, memory_w) /* sp is set to e0ff */
|
||||
AM_RANGE(0xf400, 0xffff) AM_RAM
|
||||
ADDRESS_MAP_END
|
||||
@ -206,10 +206,6 @@ INPUT_PORTS_END
|
||||
|
||||
/* machine driver */
|
||||
|
||||
WRITE_LINE_MEMBER(sbugger_state::sbugger_interrupt)
|
||||
{
|
||||
m_maincpu->set_input_line(I8085_RST75_LINE, state ? CLEAR_LINE : ASSERT_LINE );
|
||||
}
|
||||
|
||||
static MACHINE_CONFIG_START( sbugger, sbugger_state )
|
||||
|
||||
@ -221,7 +217,7 @@ static MACHINE_CONFIG_START( sbugger, sbugger_state )
|
||||
MCFG_I8155_IN_PORTA_CB(IOPORT("INPUTS"))
|
||||
MCFG_I8155_IN_PORTB_CB(IOPORT("DSW1"))
|
||||
MCFG_I8155_IN_PORTC_CB(IOPORT("DSW2"))
|
||||
MCFG_I8155_OUT_TIMEROUT_CB(WRITELINE(sbugger_state, sbugger_interrupt))
|
||||
MCFG_I8155_OUT_TIMEROUT_CB(INPUTLINE("maincpu", I8085_RST75_LINE))
|
||||
|
||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", sbugger)
|
||||
|
||||
@ -230,7 +226,7 @@ static MACHINE_CONFIG_START( sbugger, sbugger_state )
|
||||
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
|
||||
MCFG_SCREEN_SIZE(64*8, 32*8)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0*8, 32*8-1)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(sbugger_state, screen_update_sbugger)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(sbugger_state, screen_update)
|
||||
MCFG_SCREEN_PALETTE("palette")
|
||||
|
||||
MCFG_PALETTE_ADD("palette", 512)
|
||||
@ -278,5 +274,5 @@ ROM_START( sbuggera )
|
||||
ROM_LOAD( "spbugger.gfx", 0x0000, 0x1000, CRC(d3f345b5) SHA1(a5082ffc3043352e9b731af95770bdd62fb928bf) )
|
||||
ROM_END
|
||||
|
||||
GAME( 1981, sbugger, 0, sbugger, sbugger, driver_device, 0, ROT270, "Game-A-Tron", "Space Bugger (set 1)", GAME_NOT_WORKING | GAME_WRONG_COLORS )
|
||||
GAME( 1981, sbuggera, sbugger, sbugger, sbugger, driver_device, 0, ROT270, "Game-A-Tron", "Space Bugger (set 2)", GAME_WRONG_COLORS )
|
||||
GAME( 1981, sbugger, 0, sbugger, sbugger, driver_device, 0, ROT270, "Game-A-Tron", "Space Bugger (set 1)", GAME_NOT_WORKING | GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE )
|
||||
GAME( 1981, sbuggera, sbugger, sbugger, sbugger, driver_device, 0, ROT270, "Game-A-Tron", "Space Bugger (set 2)", GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE )
|
||||
|
@ -38,8 +38,17 @@ TODO:
|
||||
#include "cpu/mcs48/mcs48.h"
|
||||
#include "includes/spcforce.h"
|
||||
|
||||
void spcforce_state::machine_start()
|
||||
{
|
||||
save_item(NAME(m_sn76496_latch));
|
||||
save_item(NAME(m_sn76496_select));
|
||||
save_item(NAME(m_sn1_ready));
|
||||
save_item(NAME(m_sn2_ready));
|
||||
save_item(NAME(m_sn3_ready));
|
||||
save_item(NAME(m_irq_mask));
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(spcforce_state::spcforce_SN76496_latch_w)
|
||||
WRITE8_MEMBER(spcforce_state::SN76496_latch_w)
|
||||
{
|
||||
m_sn76496_latch = data;
|
||||
}
|
||||
@ -59,7 +68,7 @@ WRITE_LINE_MEMBER(spcforce_state::write_sn3_ready)
|
||||
m_sn3_ready = state;
|
||||
}
|
||||
|
||||
READ8_MEMBER(spcforce_state::spcforce_SN76496_select_r)
|
||||
READ8_MEMBER(spcforce_state::SN76496_select_r)
|
||||
{
|
||||
if (~m_sn76496_select & 0x40) return m_sn1_ready;
|
||||
if (~m_sn76496_select & 0x20) return m_sn2_ready;
|
||||
@ -68,7 +77,7 @@ READ8_MEMBER(spcforce_state::spcforce_SN76496_select_r)
|
||||
return 0;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(spcforce_state::spcforce_SN76496_select_w)
|
||||
WRITE8_MEMBER(spcforce_state::SN76496_select_w)
|
||||
{
|
||||
m_sn76496_select = data;
|
||||
|
||||
@ -77,14 +86,14 @@ WRITE8_MEMBER(spcforce_state::spcforce_SN76496_select_w)
|
||||
if (~data & 0x10) m_sn3->write(space, 0, m_sn76496_latch);
|
||||
}
|
||||
|
||||
READ8_MEMBER(spcforce_state::spcforce_t0_r)
|
||||
READ8_MEMBER(spcforce_state::t0_r)
|
||||
{
|
||||
/* SN76496 status according to Al - not supported by MAME?? */
|
||||
return machine().rand() & 1;
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(spcforce_state::spcforce_soundtrigger_w)
|
||||
WRITE8_MEMBER(spcforce_state::soundtrigger_w)
|
||||
{
|
||||
m_audiocpu->set_input_line(0, (~data & 0x08) ? ASSERT_LINE : CLEAR_LINE);
|
||||
}
|
||||
@ -98,9 +107,9 @@ static ADDRESS_MAP_START( spcforce_map, AS_PROGRAM, 8, spcforce_state )
|
||||
AM_RANGE(0x0000, 0x3fff) AM_ROM
|
||||
AM_RANGE(0x4000, 0x43ff) AM_RAM
|
||||
AM_RANGE(0x7000, 0x7000) AM_READ_PORT("DSW") AM_WRITE(soundlatch_byte_w)
|
||||
AM_RANGE(0x7001, 0x7001) AM_READ_PORT("P1") AM_WRITE(spcforce_soundtrigger_w)
|
||||
AM_RANGE(0x7001, 0x7001) AM_READ_PORT("P1") AM_WRITE(soundtrigger_w)
|
||||
AM_RANGE(0x7002, 0x7002) AM_READ_PORT("P2")
|
||||
AM_RANGE(0x700b, 0x700b) AM_WRITE(spcforce_flip_screen_w)
|
||||
AM_RANGE(0x700b, 0x700b) AM_WRITE(flip_screen_w)
|
||||
AM_RANGE(0x700e, 0x700e) AM_WRITE(irq_mask_w)
|
||||
AM_RANGE(0x700f, 0x700f) AM_WRITENOP
|
||||
AM_RANGE(0x8000, 0x83ff) AM_RAM AM_SHARE("videoram")
|
||||
@ -114,9 +123,9 @@ ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START( spcforce_sound_io_map, AS_IO, 8, spcforce_state )
|
||||
AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_READ(soundlatch_byte_r)
|
||||
AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(spcforce_SN76496_latch_w)
|
||||
AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READWRITE(spcforce_SN76496_select_r, spcforce_SN76496_select_w)
|
||||
AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(spcforce_t0_r)
|
||||
AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_WRITE(SN76496_latch_w)
|
||||
AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_READWRITE(SN76496_select_r, SN76496_select_w)
|
||||
AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(t0_r)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
|
||||
@ -276,7 +285,7 @@ static MACHINE_CONFIG_START( spcforce, spcforce_state )
|
||||
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
|
||||
MCFG_SCREEN_SIZE(32*8, 32*8)
|
||||
MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 28*8-1)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(spcforce_state, screen_update_spcforce)
|
||||
MCFG_SCREEN_UPDATE_DRIVER(spcforce_state, screen_update)
|
||||
MCFG_SCREEN_PALETTE("palette")
|
||||
|
||||
MCFG_GFXDECODE_ADD("gfxdecode", "palette", spcforce)
|
||||
@ -375,6 +384,6 @@ ROM_START( meteor )
|
||||
ROM_END
|
||||
|
||||
|
||||
GAME( 1980, spcforce, 0, spcforce, spcforce, driver_device, 0, ROT270, "Venture Line", "Space Force (set 1)", GAME_IMPERFECT_COLORS )
|
||||
GAME( 19??, spcforc2, spcforce, spcforce, spcforc2, driver_device, 0, ROT270, "bootleg? (Elcon)", "Space Force (set 2)", GAME_IMPERFECT_COLORS )
|
||||
GAME( 1981, meteor, spcforce, spcforce, spcforc2, driver_device, 0, ROT270, "Venture Line", "Meteoroids", GAME_IMPERFECT_COLORS )
|
||||
GAME( 1980, spcforce, 0, spcforce, spcforce, driver_device, 0, ROT270, "Venture Line", "Space Force (set 1)", GAME_IMPERFECT_COLORS | GAME_SUPPORTS_SAVE )
|
||||
GAME( 19??, spcforc2, spcforce, spcforce, spcforc2, driver_device, 0, ROT270, "bootleg? (Elcon)", "Space Force (set 2)", GAME_IMPERFECT_COLORS | GAME_SUPPORTS_SAVE )
|
||||
GAME( 1981, meteor, spcforce, spcforce, spcforc2, driver_device, 0, ROT270, "Venture Line", "Meteoroids", GAME_IMPERFECT_COLORS | GAME_SUPPORTS_SAVE )
|
||||
|
@ -10,14 +10,21 @@ class cheekyms_state : public driver_device
|
||||
public:
|
||||
cheekyms_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_videoram(*this, "videoram"),
|
||||
m_spriteram(*this, "spriteram"),
|
||||
m_port_80(*this, "port_80"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_dac(*this, "dac"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_screen(*this, "screen"),
|
||||
m_palette(*this, "palette") { }
|
||||
m_palette(*this, "palette"),
|
||||
m_videoram(*this, "videoram"),
|
||||
m_spriteram(*this, "spriteram"),
|
||||
m_port_80(*this, "port_80") { }
|
||||
|
||||
/* devices */
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<dac_device> m_dac;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<screen_device> m_screen;
|
||||
required_device<palette_device> m_palette;
|
||||
|
||||
/* memory pointers */
|
||||
required_shared_ptr<UINT8> m_videoram;
|
||||
@ -27,23 +34,21 @@ public:
|
||||
/* video-related */
|
||||
tilemap_t *m_cm_tilemap;
|
||||
bitmap_ind16 *m_bitmap_buffer;
|
||||
|
||||
/* devices */
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<dac_device> m_dac;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<screen_device> m_screen;
|
||||
required_device<palette_device> m_palette;
|
||||
|
||||
|
||||
UINT8 m_irq_mask;
|
||||
DECLARE_WRITE8_MEMBER(cheekyms_port_40_w);
|
||||
DECLARE_WRITE8_MEMBER(cheekyms_port_80_w);
|
||||
|
||||
DECLARE_WRITE8_MEMBER(port_40_w);
|
||||
DECLARE_WRITE8_MEMBER(port_80_w);
|
||||
|
||||
DECLARE_INPUT_CHANGED_MEMBER(coin_inserted);
|
||||
TILE_GET_INFO_MEMBER(cheekyms_get_tile_info);
|
||||
INTERRUPT_GEN_MEMBER(vblank_irq);
|
||||
|
||||
TILE_GET_INFO_MEMBER(get_tile_info);
|
||||
|
||||
virtual void machine_start();
|
||||
virtual void video_start();
|
||||
DECLARE_PALETTE_INIT(cheekyms);
|
||||
UINT32 screen_update_cheekyms(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
INTERRUPT_GEN_MEMBER(vblank_irq);
|
||||
|
||||
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element *gfx, int flip );
|
||||
};
|
||||
|
@ -3,39 +3,45 @@ class clshroad_state : public driver_device
|
||||
public:
|
||||
clshroad_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_spriteram(*this, "spriteram"),
|
||||
m_vram_1(*this, "vram_1"),
|
||||
m_vregs(*this, "vregs"),
|
||||
m_vram_0(*this, "vram_0"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_palette(*this, "palette") { }
|
||||
m_palette(*this, "palette"),
|
||||
m_spriteram(*this, "spriteram"),
|
||||
m_vram_0(*this, "vram_0"),
|
||||
m_vram_1(*this, "vram_1"),
|
||||
m_vregs(*this, "vregs") { }
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<palette_device> m_palette;
|
||||
|
||||
required_shared_ptr<UINT8> m_spriteram;
|
||||
required_shared_ptr<UINT8> m_vram_0;
|
||||
required_shared_ptr<UINT8> m_vram_1;
|
||||
required_shared_ptr<UINT8> m_vregs;
|
||||
required_shared_ptr<UINT8> m_vram_0;
|
||||
|
||||
tilemap_t *m_tilemap_0a;
|
||||
tilemap_t *m_tilemap_0b;
|
||||
tilemap_t *m_tilemap_1;
|
||||
DECLARE_READ8_MEMBER(clshroad_input_r);
|
||||
DECLARE_WRITE8_MEMBER(clshroad_flipscreen_w);
|
||||
DECLARE_WRITE8_MEMBER(clshroad_vram_0_w);
|
||||
DECLARE_WRITE8_MEMBER(clshroad_vram_1_w);
|
||||
DECLARE_DRIVER_INIT(firebatl);
|
||||
|
||||
DECLARE_READ8_MEMBER(input_r);
|
||||
DECLARE_WRITE8_MEMBER(flipscreen_w);
|
||||
DECLARE_WRITE8_MEMBER(vram_0_w);
|
||||
DECLARE_WRITE8_MEMBER(vram_1_w);
|
||||
|
||||
TILE_GET_INFO_MEMBER(get_tile_info_0a);
|
||||
TILE_GET_INFO_MEMBER(get_tile_info_0b);
|
||||
TILEMAP_MAPPER_MEMBER(tilemap_scan_rows_extra);
|
||||
TILE_GET_INFO_MEMBER(get_tile_info_fb1);
|
||||
TILE_GET_INFO_MEMBER(get_tile_info_1);
|
||||
|
||||
|
||||
DECLARE_DRIVER_INIT(firebatl);
|
||||
virtual void machine_reset();
|
||||
DECLARE_VIDEO_START(firebatl);
|
||||
DECLARE_PALETTE_INIT(firebatl);
|
||||
DECLARE_VIDEO_START(clshroad);
|
||||
DECLARE_PALETTE_INIT(clshroad);
|
||||
UINT32 screen_update_clshroad(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<palette_device> m_palette;
|
||||
};
|
||||
|
@ -3,22 +3,26 @@ class sbugger_state : public driver_device
|
||||
public:
|
||||
sbugger_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_videoram_attr(*this, "videoram_attr"),
|
||||
m_videoram(*this, "videoram"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_gfxdecode(*this, "gfxdecode") { }
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_videoram_attr(*this, "videoram_attr"),
|
||||
m_videoram(*this, "videoram") { }
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
|
||||
required_shared_ptr<UINT8> m_videoram_attr;
|
||||
required_shared_ptr<UINT8> m_videoram;
|
||||
|
||||
tilemap_t *m_tilemap;
|
||||
DECLARE_WRITE8_MEMBER(sbugger_videoram_w);
|
||||
DECLARE_WRITE8_MEMBER(sbugger_videoram_attr_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(sbugger_interrupt);
|
||||
TILE_GET_INFO_MEMBER(get_sbugger_tile_info);
|
||||
|
||||
DECLARE_WRITE8_MEMBER(videoram_w);
|
||||
DECLARE_WRITE8_MEMBER(videoram_attr_w);
|
||||
|
||||
TILE_GET_INFO_MEMBER(get_tile_info);
|
||||
|
||||
virtual void video_start();
|
||||
DECLARE_PALETTE_INIT(sbugger);
|
||||
UINT32 screen_update_sbugger(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
|
||||
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
};
|
||||
|
@ -5,48 +5,51 @@ class spcforce_state : public driver_device
|
||||
public:
|
||||
spcforce_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_scrollram(*this, "scrollram"),
|
||||
m_videoram(*this, "videoram"),
|
||||
m_colorram(*this, "colorram"),
|
||||
m_sn1(*this, "sn1"),
|
||||
m_sn2(*this, "sn2"),
|
||||
m_sn3(*this, "sn3"),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_audiocpu(*this, "audiocpu"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_palette(*this, "palette") { }
|
||||
m_palette(*this, "palette"),
|
||||
m_sn1(*this, "sn1"),
|
||||
m_sn2(*this, "sn2"),
|
||||
m_sn3(*this, "sn3"),
|
||||
m_scrollram(*this, "scrollram"),
|
||||
m_videoram(*this, "videoram"),
|
||||
m_colorram(*this, "colorram") { }
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<cpu_device> m_audiocpu;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<palette_device> m_palette;
|
||||
required_device<sn76496_device> m_sn1;
|
||||
required_device<sn76496_device> m_sn2;
|
||||
required_device<sn76496_device> m_sn3;
|
||||
|
||||
required_shared_ptr<UINT8> m_scrollram;
|
||||
required_shared_ptr<UINT8> m_videoram;
|
||||
required_shared_ptr<UINT8> m_colorram;
|
||||
|
||||
required_device<sn76496_device> m_sn1;
|
||||
required_device<sn76496_device> m_sn2;
|
||||
required_device<sn76496_device> m_sn3;
|
||||
|
||||
int m_sn76496_latch;
|
||||
int m_sn76496_select;
|
||||
int m_sn1_ready;
|
||||
int m_sn2_ready;
|
||||
int m_sn3_ready;
|
||||
|
||||
UINT8 m_irq_mask;
|
||||
DECLARE_WRITE8_MEMBER(spcforce_SN76496_latch_w);
|
||||
DECLARE_READ8_MEMBER(spcforce_SN76496_select_r);
|
||||
DECLARE_WRITE8_MEMBER(spcforce_SN76496_select_w);
|
||||
|
||||
DECLARE_WRITE8_MEMBER(SN76496_latch_w);
|
||||
DECLARE_READ8_MEMBER(SN76496_select_r);
|
||||
DECLARE_WRITE8_MEMBER(SN76496_select_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(write_sn1_ready);
|
||||
DECLARE_WRITE_LINE_MEMBER(write_sn2_ready);
|
||||
DECLARE_WRITE_LINE_MEMBER(write_sn3_ready);
|
||||
DECLARE_READ8_MEMBER(spcforce_t0_r);
|
||||
DECLARE_WRITE8_MEMBER(spcforce_soundtrigger_w);
|
||||
DECLARE_READ8_MEMBER(t0_r);
|
||||
DECLARE_WRITE8_MEMBER(soundtrigger_w);
|
||||
DECLARE_WRITE8_MEMBER(irq_mask_w);
|
||||
DECLARE_WRITE8_MEMBER(spcforce_flip_screen_w);
|
||||
DECLARE_WRITE8_MEMBER(flip_screen_w);
|
||||
|
||||
virtual void machine_start();
|
||||
DECLARE_PALETTE_INIT(spcforce);
|
||||
UINT32 screen_update_spcforce(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
INTERRUPT_GEN_MEMBER(vblank_irq);
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<cpu_device> m_audiocpu;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<palette_device> m_palette;
|
||||
};
|
||||
|
@ -2,8 +2,8 @@
|
||||
Universal Cheeky Mouse Driver
|
||||
(c)Lee Taylor May 1998, All rights reserved.
|
||||
|
||||
For use only in offical MAME releases.
|
||||
Not to be distrabuted as part of any commerical work.
|
||||
For use only in official MAME releases.
|
||||
Not to be distributed as part of any commercial work.
|
||||
***************************************************************************
|
||||
Functions to emulate the video hardware of the machine.
|
||||
***************************************************************************/
|
||||
@ -40,14 +40,14 @@ PALETTE_INIT_MEMBER(cheekyms_state, cheekyms)
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(cheekyms_state::cheekyms_port_40_w)
|
||||
WRITE8_MEMBER(cheekyms_state::port_40_w)
|
||||
{
|
||||
/* the lower bits probably trigger sound samples */
|
||||
m_dac->write_unsigned8(data ? 0x80 : 0);
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER(cheekyms_state::cheekyms_port_80_w)
|
||||
WRITE8_MEMBER(cheekyms_state::port_80_w)
|
||||
{
|
||||
/* d0-d1 - sound enables, not sure which bit is which */
|
||||
/* d3-d5 - man scroll amount */
|
||||
@ -61,7 +61,7 @@ WRITE8_MEMBER(cheekyms_state::cheekyms_port_80_w)
|
||||
|
||||
|
||||
|
||||
TILE_GET_INFO_MEMBER(cheekyms_state::cheekyms_get_tile_info)
|
||||
TILE_GET_INFO_MEMBER(cheekyms_state::get_tile_info)
|
||||
{
|
||||
int color;
|
||||
|
||||
@ -98,7 +98,7 @@ void cheekyms_state::video_start()
|
||||
height = m_screen->height();
|
||||
m_bitmap_buffer = auto_bitmap_ind16_alloc(machine(), width, height);
|
||||
|
||||
m_cm_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(cheekyms_state::cheekyms_get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
|
||||
m_cm_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(cheekyms_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
|
||||
m_cm_tilemap->set_transparent_pen(0);
|
||||
}
|
||||
|
||||
@ -142,7 +142,7 @@ void cheekyms_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clipre
|
||||
}
|
||||
|
||||
|
||||
UINT32 cheekyms_state::screen_update_cheekyms(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
UINT32 cheekyms_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
int y, x;
|
||||
int scrolly = ((*m_port_80 >> 3) & 0x07);
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include "includes/clshroad.h"
|
||||
|
||||
|
||||
WRITE8_MEMBER(clshroad_state::clshroad_flipscreen_w)
|
||||
WRITE8_MEMBER(clshroad_state::flipscreen_w)
|
||||
{
|
||||
flip_screen_set(data & 1 );
|
||||
}
|
||||
@ -125,7 +125,7 @@ TILE_GET_INFO_MEMBER(clshroad_state::get_tile_info_0b)
|
||||
0);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(clshroad_state::clshroad_vram_0_w)
|
||||
WRITE8_MEMBER(clshroad_state::vram_0_w)
|
||||
{
|
||||
int tile_index = offset / 2;
|
||||
int tile = (tile_index & 0x1f) + (tile_index & ~0x3f)/2;
|
||||
@ -190,7 +190,7 @@ TILE_GET_INFO_MEMBER(clshroad_state::get_tile_info_1)
|
||||
0);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(clshroad_state::clshroad_vram_1_w)
|
||||
WRITE8_MEMBER(clshroad_state::vram_1_w)
|
||||
{
|
||||
m_vram_1[offset] = data;
|
||||
m_tilemap_1->mark_tile_dirty(offset % 0x400);
|
||||
@ -275,15 +275,12 @@ Offset: Format: Value:
|
||||
|
||||
void clshroad_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
UINT8 *spriteram = m_spriteram;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < m_spriteram.bytes() ; i += 8)
|
||||
for (int i = 0; i < m_spriteram.bytes() ; i += 8)
|
||||
{
|
||||
int y = 240 - spriteram[i+1];
|
||||
int code = (spriteram[i+3] & 0x3f) + (spriteram[i+2] << 6);
|
||||
int x = spriteram[i+5] + (spriteram[i+6] << 8);
|
||||
int attr = spriteram[i+7];
|
||||
int y = 240 - m_spriteram[i+1];
|
||||
int code = (m_spriteram[i+3] & 0x3f) + (m_spriteram[i+2] << 6);
|
||||
int x = m_spriteram[i+5] + (m_spriteram[i+6] << 8);
|
||||
int attr = m_spriteram[i+7];
|
||||
|
||||
int flipx = 0;
|
||||
int flipy = 0;
|
||||
@ -313,7 +310,7 @@ void clshroad_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
UINT32 clshroad_state::screen_update_clshroad(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
UINT32 clshroad_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
int scrollx = m_vregs[ 0 ] + (m_vregs[ 1 ] << 8);
|
||||
// int priority = m_vregs[ 2 ];
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "emu.h"
|
||||
#include "includes/sbugger.h"
|
||||
|
||||
TILE_GET_INFO_MEMBER(sbugger_state::get_sbugger_tile_info)
|
||||
TILE_GET_INFO_MEMBER(sbugger_state::get_tile_info)
|
||||
{
|
||||
int tileno, color;
|
||||
|
||||
@ -13,13 +13,13 @@ TILE_GET_INFO_MEMBER(sbugger_state::get_sbugger_tile_info)
|
||||
SET_TILE_INFO_MEMBER(0,tileno,color,0);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sbugger_state::sbugger_videoram_w)
|
||||
WRITE8_MEMBER(sbugger_state::videoram_w)
|
||||
{
|
||||
m_videoram[offset] = data;
|
||||
m_tilemap->mark_tile_dirty(offset);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(sbugger_state::sbugger_videoram_attr_w)
|
||||
WRITE8_MEMBER(sbugger_state::videoram_attr_w)
|
||||
{
|
||||
m_videoram_attr[offset] = data;
|
||||
m_tilemap->mark_tile_dirty(offset);
|
||||
@ -27,10 +27,10 @@ WRITE8_MEMBER(sbugger_state::sbugger_videoram_attr_w)
|
||||
|
||||
void sbugger_state::video_start()
|
||||
{
|
||||
m_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(sbugger_state::get_sbugger_tile_info),this), TILEMAP_SCAN_ROWS, 8, 16, 64, 16);
|
||||
m_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(sbugger_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 8, 16, 64, 16);
|
||||
}
|
||||
|
||||
UINT32 sbugger_state::screen_update_sbugger(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
UINT32 sbugger_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
m_tilemap->draw(screen, bitmap, cliprect, 0,0);
|
||||
return 0;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/***************************************************************************
|
||||
|
||||
video.c
|
||||
spcforce.c
|
||||
|
||||
Functions to emulate the video hardware of the machine.
|
||||
|
||||
@ -10,13 +10,13 @@
|
||||
#include "includes/spcforce.h"
|
||||
|
||||
|
||||
WRITE8_MEMBER(spcforce_state::spcforce_flip_screen_w)
|
||||
WRITE8_MEMBER(spcforce_state::flip_screen_w)
|
||||
{
|
||||
flip_screen_set(~data & 0x01);
|
||||
}
|
||||
|
||||
|
||||
UINT32 spcforce_state::screen_update_spcforce(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
UINT32 spcforce_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
int offs;
|
||||
int flip = flip_screen();
|
||||
|
Loading…
Reference in New Issue
Block a user