trunk/src/mame/drivers/scotrsht.c
| r243625 | r243626 | |
| 45 | 45 | flip_screen_set(data & 0x08); |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | | INTERRUPT_GEN_MEMBER(scotrsht_state::scotrsht_interrupt) |
| 48 | INTERRUPT_GEN_MEMBER(scotrsht_state::interrupt) |
| 49 | 49 | { |
| 50 | 50 | if (m_irq_enable) |
| 51 | | device.execute().set_input_line(0, HOLD_LINE); |
| 51 | m_maincpu->set_input_line(0, HOLD_LINE); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | | WRITE8_MEMBER(scotrsht_state::scotrsht_soundlatch_w) |
| 54 | WRITE8_MEMBER(scotrsht_state::soundlatch_w) |
| 55 | 55 | { |
| 56 | 56 | soundlatch_byte_w(space, 0, data); |
| 57 | 57 | m_audiocpu->set_input_line(0, HOLD_LINE); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | static ADDRESS_MAP_START( scotrsht_map, AS_PROGRAM, 8, scotrsht_state ) |
| 61 | | AM_RANGE(0x0000, 0x07ff) AM_RAM_WRITE(scotrsht_colorram_w) AM_SHARE("colorram") |
| 62 | | AM_RANGE(0x0800, 0x0fff) AM_RAM_WRITE(scotrsht_videoram_w) AM_SHARE("videoram") |
| 61 | AM_RANGE(0x0000, 0x07ff) AM_RAM_WRITE(colorram_w) AM_SHARE("colorram") |
| 62 | AM_RANGE(0x0800, 0x0fff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram") |
| 63 | 63 | AM_RANGE(0x1000, 0x10bf) AM_RAM AM_SHARE("spriteram") /* sprites */ |
| 64 | 64 | AM_RANGE(0x10c0, 0x1fff) AM_RAM /* work ram */ |
| 65 | 65 | AM_RANGE(0x2000, 0x201f) AM_RAM AM_SHARE("scroll") /* scroll registers */ |
| 66 | 66 | AM_RANGE(0x2040, 0x2040) AM_WRITENOP |
| 67 | 67 | AM_RANGE(0x2041, 0x2041) AM_WRITENOP |
| 68 | 68 | AM_RANGE(0x2042, 0x2042) AM_WRITENOP /* it should be -> bit 2 = scroll direction like in jailbrek, but it's not used */ |
| 69 | | AM_RANGE(0x2043, 0x2043) AM_WRITE(scotrsht_charbank_w) |
| 69 | AM_RANGE(0x2043, 0x2043) AM_WRITE(charbank_w) |
| 70 | 70 | AM_RANGE(0x2044, 0x2044) AM_WRITE(ctrl_w) |
| 71 | | AM_RANGE(0x3000, 0x3000) AM_WRITE(scotrsht_palettebank_w) |
| 72 | | AM_RANGE(0x3100, 0x3100) AM_WRITE(scotrsht_soundlatch_w) |
| 71 | AM_RANGE(0x3000, 0x3000) AM_WRITE(palettebank_w) |
| 72 | AM_RANGE(0x3100, 0x3100) AM_WRITE(soundlatch_w) |
| 73 | 73 | AM_RANGE(0x3200, 0x3200) AM_WRITENOP /* it writes 0, 1 */ |
| 74 | 74 | AM_RANGE(0x3100, 0x3100) AM_READ_PORT("DSW2") |
| 75 | 75 | AM_RANGE(0x3200, 0x3200) AM_READ_PORT("DSW3") |
| r243625 | r243626 | |
| 182 | 182 | /* basic machine hardware */ |
| 183 | 183 | MCFG_CPU_ADD("maincpu", M6809, 18432000/6) /* 3.072 MHz */ |
| 184 | 184 | MCFG_CPU_PROGRAM_MAP(scotrsht_map) |
| 185 | | MCFG_CPU_VBLANK_INT_DRIVER("screen", scotrsht_state, scotrsht_interrupt) |
| 185 | MCFG_CPU_VBLANK_INT_DRIVER("screen", scotrsht_state, interrupt) |
| 186 | 186 | |
| 187 | 187 | MCFG_CPU_ADD("audiocpu", Z80, 18432000/6) /* 3.072 MHz */ |
| 188 | 188 | MCFG_CPU_PROGRAM_MAP(scotrsht_sound_map) |
| r243625 | r243626 | |
| 194 | 194 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 195 | 195 | MCFG_SCREEN_SIZE(32*8, 32*8) |
| 196 | 196 | MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) |
| 197 | | MCFG_SCREEN_UPDATE_DRIVER(scotrsht_state, screen_update_scotrsht) |
| 197 | MCFG_SCREEN_UPDATE_DRIVER(scotrsht_state, screen_update) |
| 198 | 198 | MCFG_SCREEN_PALETTE("palette") |
| 199 | 199 | |
| 200 | 200 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", scotrsht) |
| r243625 | r243626 | |
| 240 | 240 | ROM_LOAD( "gx545_6301_8f.bin", 0x0400, 0x0100, CRC(c1c7cf58) SHA1(08452228bf13e43ce4a05806f79e9cd1542416f1) ) /* sprites lookup */ |
| 241 | 241 | ROM_END |
| 242 | 242 | |
| 243 | | GAME( 1985, scotrsht, 0, scotrsht, scotrsht, driver_device, 0, ROT90,"Konami", "Scooter Shooter", 0 ) |
| 243 | GAME( 1985, scotrsht, 0, scotrsht, scotrsht, driver_device, 0, ROT90,"Konami", "Scooter Shooter", GAME_SUPPORTS_SAVE ) |
trunk/src/mame/includes/scotrsht.h
| r243625 | r243626 | |
| 3 | 3 | public: |
| 4 | 4 | scotrsht_state(const machine_config &mconfig, device_type type, const char *tag) |
| 5 | 5 | : driver_device(mconfig, type, tag), |
| 6 | m_maincpu(*this, "maincpu"), |
| 7 | m_audiocpu(*this, "audiocpu"), |
| 8 | m_gfxdecode(*this, "gfxdecode"), |
| 9 | m_palette(*this, "palette"), |
| 6 | 10 | m_colorram(*this, "colorram"), |
| 7 | 11 | m_videoram(*this, "videoram"), |
| 8 | 12 | m_spriteram(*this, "spriteram"), |
| 9 | | m_scroll(*this, "scroll"), |
| 10 | | m_maincpu(*this, "maincpu"), |
| 11 | | m_audiocpu(*this, "audiocpu"), |
| 12 | | m_gfxdecode(*this, "gfxdecode"), |
| 13 | | m_palette(*this, "palette") { } |
| 13 | m_scroll(*this, "scroll") { } |
| 14 | 14 | |
| 15 | | int m_irq_enable; |
| 15 | required_device<cpu_device> m_maincpu; |
| 16 | required_device<cpu_device> m_audiocpu; |
| 17 | required_device<gfxdecode_device> m_gfxdecode; |
| 18 | required_device<palette_device> m_palette; |
| 19 | |
| 16 | 20 | required_shared_ptr<UINT8> m_colorram; |
| 17 | 21 | required_shared_ptr<UINT8> m_videoram; |
| 18 | 22 | required_shared_ptr<UINT8> m_spriteram; |
| 19 | 23 | required_shared_ptr<UINT8> m_scroll; |
| 24 | |
| 20 | 25 | tilemap_t *m_bg_tilemap; |
| 26 | |
| 27 | int m_irq_enable; |
| 21 | 28 | int m_charbank; |
| 22 | 29 | int m_palette_bank; |
| 30 | |
| 23 | 31 | DECLARE_WRITE8_MEMBER(ctrl_w); |
| 24 | | DECLARE_WRITE8_MEMBER(scotrsht_soundlatch_w); |
| 25 | | DECLARE_WRITE8_MEMBER(scotrsht_videoram_w); |
| 26 | | DECLARE_WRITE8_MEMBER(scotrsht_colorram_w); |
| 27 | | DECLARE_WRITE8_MEMBER(scotrsht_charbank_w); |
| 28 | | DECLARE_WRITE8_MEMBER(scotrsht_palettebank_w); |
| 29 | | TILE_GET_INFO_MEMBER(scotrsht_get_bg_tile_info); |
| 32 | DECLARE_WRITE8_MEMBER(soundlatch_w); |
| 33 | DECLARE_WRITE8_MEMBER(videoram_w); |
| 34 | DECLARE_WRITE8_MEMBER(colorram_w); |
| 35 | DECLARE_WRITE8_MEMBER(charbank_w); |
| 36 | DECLARE_WRITE8_MEMBER(palettebank_w); |
| 37 | |
| 38 | TILE_GET_INFO_MEMBER(get_bg_tile_info); |
| 39 | |
| 40 | INTERRUPT_GEN_MEMBER(interrupt); |
| 41 | |
| 30 | 42 | virtual void video_start(); |
| 31 | 43 | DECLARE_PALETTE_INIT(scotrsht); |
| 32 | | UINT32 screen_update_scotrsht(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 33 | | INTERRUPT_GEN_MEMBER(scotrsht_interrupt); |
| 44 | |
| 45 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 34 | 46 | void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ); |
| 35 | | required_device<cpu_device> m_maincpu; |
| 36 | | required_device<cpu_device> m_audiocpu; |
| 37 | | required_device<gfxdecode_device> m_gfxdecode; |
| 38 | | required_device<palette_device> m_palette; |
| 39 | 47 | }; |
trunk/src/mame/video/scotrsht.c
| r243625 | r243626 | |
| 34 | 34 | } |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | | WRITE8_MEMBER(scotrsht_state::scotrsht_videoram_w) |
| 37 | WRITE8_MEMBER(scotrsht_state::videoram_w) |
| 38 | 38 | { |
| 39 | 39 | m_videoram[offset] = data; |
| 40 | 40 | m_bg_tilemap->mark_tile_dirty(offset); |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | | WRITE8_MEMBER(scotrsht_state::scotrsht_colorram_w) |
| 43 | WRITE8_MEMBER(scotrsht_state::colorram_w) |
| 44 | 44 | { |
| 45 | 45 | m_colorram[offset] = data; |
| 46 | 46 | m_bg_tilemap->mark_tile_dirty(offset); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | | WRITE8_MEMBER(scotrsht_state::scotrsht_charbank_w) |
| 49 | WRITE8_MEMBER(scotrsht_state::charbank_w) |
| 50 | 50 | { |
| 51 | 51 | if (m_charbank != (data & 0x01)) |
| 52 | 52 | { |
| r243625 | r243626 | |
| 57 | 57 | /* other bits unknown */ |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | | WRITE8_MEMBER(scotrsht_state::scotrsht_palettebank_w) |
| 60 | WRITE8_MEMBER(scotrsht_state::palettebank_w) |
| 61 | 61 | { |
| 62 | 62 | if (m_palette_bank != ((data & 0x70) >> 4)) |
| 63 | 63 | { |
| r243625 | r243626 | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | |
| 75 | | TILE_GET_INFO_MEMBER(scotrsht_state::scotrsht_get_bg_tile_info) |
| 75 | TILE_GET_INFO_MEMBER(scotrsht_state::get_bg_tile_info) |
| 76 | 76 | { |
| 77 | 77 | int attr = m_colorram[tile_index]; |
| 78 | 78 | int code = m_videoram[tile_index] + (m_charbank << 9) + ((attr & 0x40) << 2); |
| r243625 | r243626 | |
| 90 | 90 | /* Same as Jailbreak + palette bank */ |
| 91 | 91 | void scotrsht_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| 92 | 92 | { |
| 93 | | UINT8 *spriteram = m_spriteram; |
| 94 | | int i; |
| 95 | | |
| 96 | | for (i = 0; i < m_spriteram.bytes(); i += 4) |
| 93 | for (int i = 0; i < m_spriteram.bytes(); i += 4) |
| 97 | 94 | { |
| 98 | | int attr = spriteram[i + 1]; // attributes = ?tyxcccc |
| 99 | | int code = spriteram[i] + ((attr & 0x40) << 2); |
| 95 | int attr = m_spriteram[i + 1]; // attributes = ?tyxcccc |
| 96 | int code = m_spriteram[i] + ((attr & 0x40) << 2); |
| 100 | 97 | int color = (attr & 0x0f) + m_palette_bank * 16; |
| 101 | 98 | int flipx = attr & 0x10; |
| 102 | 99 | int flipy = attr & 0x20; |
| 103 | | int sx = spriteram[i + 2] - ((attr & 0x80) << 1); |
| 104 | | int sy = spriteram[i + 3]; |
| 100 | int sx = m_spriteram[i + 2] - ((attr & 0x80) << 1); |
| 101 | int sy = m_spriteram[i + 3]; |
| 105 | 102 | |
| 106 | 103 | if (flip_screen()) |
| 107 | 104 | { |
| r243625 | r243626 | |
| 119 | 116 | |
| 120 | 117 | void scotrsht_state::video_start() |
| 121 | 118 | { |
| 122 | | m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(scotrsht_state::scotrsht_get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); |
| 119 | m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(scotrsht_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); |
| 123 | 120 | |
| 124 | 121 | m_bg_tilemap->set_scroll_cols(64); |
| 122 | |
| 123 | save_item(NAME(m_irq_enable)); |
| 124 | save_item(NAME(m_charbank)); |
| 125 | save_item(NAME(m_palette_bank)); |
| 125 | 126 | } |
| 126 | 127 | |
| 127 | | UINT32 scotrsht_state::screen_update_scotrsht(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 128 | UINT32 scotrsht_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 128 | 129 | { |
| 129 | | int col; |
| 130 | | |
| 131 | | for (col = 0; col < 32; col++) |
| 130 | for (int col = 0; col < 32; col++) |
| 132 | 131 | m_bg_tilemap->set_scrolly(col, m_scroll[col]); |
| 133 | 132 | |
| 134 | 133 | m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); |