trunk/src/mame/drivers/sidepckt.c
| r243607 | r243608 | |
| 146 | 146 | m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | | READ8_MEMBER(sidepckt_state::sidepckt_i8751_r) |
| 149 | READ8_MEMBER(sidepckt_state::i8751_r) |
| 150 | 150 | { |
| 151 | 151 | return m_i8751_return; |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | | WRITE8_MEMBER(sidepckt_state::sidepckt_i8751_w) |
| 154 | WRITE8_MEMBER(sidepckt_state::i8751_w) |
| 155 | 155 | { |
| 156 | 156 | m_maincpu->set_input_line(M6809_FIRQ_LINE, HOLD_LINE); /* i8751 triggers FIRQ on main cpu */ |
| 157 | 157 | |
| r243607 | r243608 | |
| 193 | 193 | |
| 194 | 194 | static ADDRESS_MAP_START( sidepckt_map, AS_PROGRAM, 8, sidepckt_state ) |
| 195 | 195 | AM_RANGE(0x0000, 0x0fff) AM_RAM |
| 196 | | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(sidepckt_videoram_w) AM_SHARE("videoram") |
| 196 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram") |
| 197 | 197 | AM_RANGE(0x1400, 0x17ff) AM_RAM // ??? |
| 198 | | AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(sidepckt_colorram_w) AM_SHARE("colorram") |
| 198 | AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(colorram_w) AM_SHARE("colorram") |
| 199 | 199 | AM_RANGE(0x1c00, 0x1fff) AM_RAM // ??? |
| 200 | 200 | AM_RANGE(0x2000, 0x20ff) AM_RAM AM_SHARE("spriteram") |
| 201 | 201 | AM_RANGE(0x2100, 0x24ff) AM_RAM // ??? |
| r243607 | r243608 | |
| 204 | 204 | AM_RANGE(0x3002, 0x3002) AM_READ_PORT("DSW1") |
| 205 | 205 | AM_RANGE(0x3003, 0x3003) AM_READ_PORT("DSW2") |
| 206 | 206 | AM_RANGE(0x3004, 0x3004) AM_WRITE(sound_cpu_command_w) |
| 207 | | AM_RANGE(0x300c, 0x300c) AM_READNOP AM_WRITE(sidepckt_flipscreen_w) |
| 208 | | AM_RANGE(0x3014, 0x3014) AM_READ(sidepckt_i8751_r) |
| 209 | | AM_RANGE(0x3018, 0x3018) AM_WRITE(sidepckt_i8751_w) |
| 207 | AM_RANGE(0x300c, 0x300c) AM_READNOP AM_WRITE(flipscreen_w) |
| 208 | AM_RANGE(0x3014, 0x3014) AM_READ(i8751_r) |
| 209 | AM_RANGE(0x3018, 0x3018) AM_WRITE(i8751_w) |
| 210 | 210 | AM_RANGE(0x4000, 0xffff) AM_ROM |
| 211 | 211 | ADDRESS_MAP_END |
| 212 | 212 | |
| r243607 | r243608 | |
| 377 | 377 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */ ) |
| 378 | 378 | MCFG_SCREEN_SIZE(32*8, 32*8) |
| 379 | 379 | MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) |
| 380 | | MCFG_SCREEN_UPDATE_DRIVER(sidepckt_state, screen_update_sidepckt) |
| 380 | MCFG_SCREEN_UPDATE_DRIVER(sidepckt_state, screen_update) |
| 381 | 381 | MCFG_SCREEN_PALETTE("palette") |
| 382 | 382 | |
| 383 | 383 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", sidepckt) |
| r243607 | r243608 | |
| 488 | 488 | m_prot_table[0] = sidepckt_prot_table_1; |
| 489 | 489 | m_prot_table[1] = sidepckt_prot_table_2; |
| 490 | 490 | m_prot_table[2] = sidepckt_prot_table_3; |
| 491 | |
| 492 | save_item(NAME(m_i8751_return)); |
| 493 | save_item(NAME(m_current_ptr)); |
| 494 | save_item(NAME(m_current_table)); |
| 495 | save_item(NAME(m_in_math)); |
| 496 | save_item(NAME(m_math_param)); |
| 491 | 497 | } |
| 492 | 498 | |
| 493 | 499 | DRIVER_INIT_MEMBER(sidepckt_state,sidepcktj) |
| r243607 | r243608 | |
| 495 | 501 | m_prot_table[0] = sidepcktj_prot_table_1; |
| 496 | 502 | m_prot_table[1] = sidepcktj_prot_table_2; |
| 497 | 503 | m_prot_table[2] = sidepcktj_prot_table_3; |
| 504 | |
| 505 | save_item(NAME(m_i8751_return)); |
| 506 | save_item(NAME(m_current_ptr)); |
| 507 | save_item(NAME(m_current_table)); |
| 508 | save_item(NAME(m_in_math)); |
| 509 | save_item(NAME(m_math_param)); |
| 498 | 510 | } |
| 499 | 511 | |
| 500 | 512 | |
| 501 | | GAME( 1986, sidepckt, 0, sidepckt, sidepckt, sidepckt_state, sidepckt, ROT0, "Data East Corporation", "Side Pocket (World)", GAME_NO_COCKTAIL ) |
| 502 | | GAME( 1986, sidepcktj, sidepckt, sidepckt, sidepcktj, sidepckt_state, sidepcktj, ROT0, "Data East Corporation", "Side Pocket (Japan)", GAME_NO_COCKTAIL ) |
| 503 | | GAME( 1986, sidepcktb, sidepckt, sidepcktb, sidepcktb, driver_device, 0, ROT0, "bootleg", "Side Pocket (bootleg)", GAME_NO_COCKTAIL ) |
| 513 | GAME( 1986, sidepckt, 0, sidepckt, sidepckt, sidepckt_state, sidepckt, ROT0, "Data East Corporation", "Side Pocket (World)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) |
| 514 | GAME( 1986, sidepcktj, sidepckt, sidepckt, sidepcktj, sidepckt_state, sidepcktj, ROT0, "Data East Corporation", "Side Pocket (Japan)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) |
| 515 | GAME( 1986, sidepcktb, sidepckt, sidepcktb, sidepcktb, driver_device, 0, ROT0, "bootleg", "Side Pocket (bootleg)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) |
trunk/src/mame/includes/sidepckt.h
| r243607 | r243608 | |
| 11 | 11 | : driver_device(mconfig, type, tag), |
| 12 | 12 | m_maincpu(*this, "maincpu"), |
| 13 | 13 | m_audiocpu(*this, "audiocpu"), |
| 14 | m_gfxdecode(*this, "gfxdecode"), |
| 15 | m_palette(*this, "palette"), |
| 14 | 16 | m_videoram(*this, "videoram"), |
| 15 | 17 | m_colorram(*this, "colorram"), |
| 16 | | m_spriteram(*this, "spriteram"), |
| 17 | | m_gfxdecode(*this, "gfxdecode"), |
| 18 | | m_palette(*this, "palette") |
| 18 | m_spriteram(*this, "spriteram") |
| 19 | 19 | { } |
| 20 | 20 | |
| 21 | | tilemap_t *m_bg_tilemap; |
| 22 | 21 | required_device<cpu_device> m_maincpu; |
| 23 | 22 | required_device<cpu_device> m_audiocpu; |
| 23 | required_device<gfxdecode_device> m_gfxdecode; |
| 24 | required_device<palette_device> m_palette; |
| 25 | |
| 24 | 26 | required_shared_ptr<UINT8> m_videoram; |
| 25 | 27 | required_shared_ptr<UINT8> m_colorram; |
| 26 | 28 | required_shared_ptr<UINT8> m_spriteram; |
| 27 | | required_device<gfxdecode_device> m_gfxdecode; |
| 28 | | required_device<palette_device> m_palette; |
| 29 | | |
| 29 | |
| 30 | tilemap_t *m_bg_tilemap; |
| 30 | 31 | const UINT8* m_prot_table[3]; |
| 31 | 32 | UINT8 m_i8751_return; |
| 32 | 33 | UINT8 m_current_ptr; |
| r243607 | r243608 | |
| 35 | 36 | UINT8 m_math_param; |
| 36 | 37 | |
| 37 | 38 | DECLARE_WRITE8_MEMBER(sound_cpu_command_w); |
| 38 | | DECLARE_READ8_MEMBER(sidepckt_i8751_r); |
| 39 | | DECLARE_WRITE8_MEMBER(sidepckt_i8751_w); |
| 40 | | DECLARE_WRITE8_MEMBER(sidepctj_i8751_w); |
| 41 | | DECLARE_WRITE8_MEMBER(sidepckt_videoram_w); |
| 42 | | DECLARE_WRITE8_MEMBER(sidepckt_colorram_w); |
| 43 | | DECLARE_WRITE8_MEMBER(sidepckt_flipscreen_w); |
| 39 | DECLARE_READ8_MEMBER(i8751_r); |
| 40 | DECLARE_WRITE8_MEMBER(i8751_w); |
| 41 | DECLARE_WRITE8_MEMBER(videoram_w); |
| 42 | DECLARE_WRITE8_MEMBER(colorram_w); |
| 43 | DECLARE_WRITE8_MEMBER(flipscreen_w); |
| 44 | |
| 44 | 45 | DECLARE_DRIVER_INIT(sidepckt); |
| 45 | 46 | DECLARE_DRIVER_INIT(sidepcktj); |
| 47 | |
| 46 | 48 | TILE_GET_INFO_MEMBER(get_tile_info); |
| 49 | |
| 47 | 50 | virtual void machine_reset(); |
| 48 | 51 | virtual void video_start(); |
| 49 | 52 | DECLARE_PALETTE_INIT(sidepckt); |
| 50 | | UINT32 screen_update_sidepckt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 53 | |
| 54 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 51 | 55 | void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); |
| 52 | 56 | }; |
trunk/src/mame/video/sidepckt.c
| r243607 | r243608 | |
| 86 | 86 | |
| 87 | 87 | ***************************************************************************/ |
| 88 | 88 | |
| 89 | | WRITE8_MEMBER(sidepckt_state::sidepckt_videoram_w) |
| 89 | WRITE8_MEMBER(sidepckt_state::videoram_w) |
| 90 | 90 | { |
| 91 | 91 | m_videoram[offset] = data; |
| 92 | 92 | m_bg_tilemap->mark_tile_dirty(offset); |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | | WRITE8_MEMBER(sidepckt_state::sidepckt_colorram_w) |
| 95 | WRITE8_MEMBER(sidepckt_state::colorram_w) |
| 96 | 96 | { |
| 97 | 97 | m_colorram[offset] = data; |
| 98 | 98 | m_bg_tilemap->mark_tile_dirty(offset); |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | | WRITE8_MEMBER(sidepckt_state::sidepckt_flipscreen_w) |
| 101 | WRITE8_MEMBER(sidepckt_state::flipscreen_w) |
| 102 | 102 | { |
| 103 | 103 | int flipscreen = data; |
| 104 | 104 | machine().tilemap().set_flip_all(flipscreen ? TILEMAP_FLIPY : TILEMAP_FLIPX); |
| r243607 | r243608 | |
| 113 | 113 | |
| 114 | 114 | void sidepckt_state::draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect) |
| 115 | 115 | { |
| 116 | | UINT8 *spriteram = m_spriteram; |
| 117 | | int offs; |
| 118 | | |
| 119 | | for (offs = 0;offs < m_spriteram.bytes(); offs += 4) |
| 116 | for (int offs = 0;offs < m_spriteram.bytes(); offs += 4) |
| 120 | 117 | { |
| 121 | 118 | int sx,sy,code,color,flipx,flipy; |
| 122 | 119 | |
| 123 | | code = spriteram[offs+3] + ((spriteram[offs+1] & 0x03) << 8); |
| 124 | | color = (spriteram[offs+1] & 0xf0) >> 4; |
| 120 | code = m_spriteram[offs+3] + ((m_spriteram[offs+1] & 0x03) << 8); |
| 121 | color = (m_spriteram[offs+1] & 0xf0) >> 4; |
| 125 | 122 | |
| 126 | | sx = spriteram[offs+2]-2; |
| 127 | | sy = spriteram[offs]; |
| 123 | sx = m_spriteram[offs+2]-2; |
| 124 | sy = m_spriteram[offs]; |
| 128 | 125 | |
| 129 | | flipx = spriteram[offs+1] & 0x08; |
| 130 | | flipy = spriteram[offs+1] & 0x04; |
| 126 | flipx = m_spriteram[offs+1] & 0x08; |
| 127 | flipy = m_spriteram[offs+1] & 0x04; |
| 131 | 128 | |
| 132 | 129 | m_gfxdecode->gfx(1)->transpen(bitmap,cliprect, |
| 133 | 130 | code, |
| r243607 | r243608 | |
| 144 | 141 | } |
| 145 | 142 | |
| 146 | 143 | |
| 147 | | UINT32 sidepckt_state::screen_update_sidepckt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 144 | UINT32 sidepckt_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 148 | 145 | { |
| 149 | 146 | m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1,0); |
| 150 | 147 | draw_sprites(bitmap,cliprect); |