trunk/src/mame/includes/bwing.h
| r32830 | r32831 | |
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 | |
| 7 | #include "machine/bankdev.h" |
| 8 | |
| 7 | 9 | #define BW_DEBUG 0 |
| 8 | 10 | |
| 9 | 11 | class bwing_state : public driver_device |
| r32830 | r32831 | |
| 11 | 13 | public: |
| 12 | 14 | bwing_state(const machine_config &mconfig, device_type type, const char *tag) |
| 13 | 15 | : driver_device(mconfig, type, tag), |
| 14 | | m_bwp1_sharedram1(*this, "bwp1_sharedram1"), |
| 15 | 16 | m_videoram(*this, "videoram"), |
| 16 | 17 | m_spriteram(*this, "spriteram"), |
| 17 | 18 | m_paletteram(*this, "paletteram"), |
| 18 | | m_bwp2_sharedram1(*this, "bwp2_sharedram1"), |
| 19 | | m_bwp3_rombase(*this, "bwp3_rombase"), |
| 19 | m_fgscrollram(*this, "fgscrollram"), |
| 20 | m_bgscrollram(*this, "bgscrollram"), |
| 21 | m_gfxram(*this, "gfxram"), |
| 20 | 22 | m_maincpu(*this, "maincpu"), |
| 21 | 23 | m_subcpu(*this, "sub"), |
| 22 | 24 | m_audiocpu(*this, "audiocpu"), |
| 23 | 25 | m_gfxdecode(*this, "gfxdecode"), |
| 24 | | m_palette(*this, "palette") { } |
| 26 | m_palette(*this, "palette"), |
| 27 | m_vrambank(*this, "vrambank") { } |
| 25 | 28 | |
| 26 | 29 | /* memory pointers */ |
| 27 | | required_shared_ptr<UINT8> m_bwp1_sharedram1; |
| 28 | 30 | required_shared_ptr<UINT8> m_videoram; |
| 29 | 31 | required_shared_ptr<UINT8> m_spriteram; |
| 30 | 32 | required_shared_ptr<UINT8> m_paletteram; |
| 31 | | required_shared_ptr<UINT8> m_bwp2_sharedram1; |
| 32 | | required_shared_ptr<UINT8> m_bwp3_rombase; |
| 33 | required_shared_ptr<UINT8> m_fgscrollram; |
| 34 | required_shared_ptr<UINT8> m_bgscrollram; |
| 35 | required_shared_ptr<UINT8> m_gfxram; |
| 33 | 36 | |
| 34 | 37 | /* video-related */ |
| 35 | 38 | tilemap_t *m_charmap; |
| 36 | 39 | tilemap_t *m_fgmap; |
| 37 | 40 | tilemap_t *m_bgmap; |
| 38 | | UINT8 *m_srbase[4]; |
| 39 | | UINT8 *m_fgdata; |
| 40 | | UINT8 *m_bgdata; |
| 41 | | int *m_srxlat; |
| 42 | 41 | unsigned m_sreg[8]; |
| 43 | 42 | unsigned m_palatch; |
| 44 | | unsigned m_srbank; |
| 45 | 43 | unsigned m_mapmask; |
| 46 | | unsigned m_mapflip; |
| 47 | 44 | |
| 48 | 45 | /* sound-related */ |
| 49 | 46 | int m_bwp3_nmimask; |
| r32830 | r32831 | |
| 58 | 55 | required_device<cpu_device> m_audiocpu; |
| 59 | 56 | required_device<gfxdecode_device> m_gfxdecode; |
| 60 | 57 | required_device<palette_device> m_palette; |
| 58 | required_device<address_map_bank_device> m_vrambank; |
| 61 | 59 | |
| 62 | | DECLARE_WRITE8_MEMBER(bwp12_sharedram1_w); |
| 63 | 60 | DECLARE_WRITE8_MEMBER(bwp3_u8F_w); |
| 64 | 61 | DECLARE_WRITE8_MEMBER(bwp3_nmimask_w); |
| 65 | 62 | DECLARE_WRITE8_MEMBER(bwp3_nmiack_w); |
| r32830 | r32831 | |
| 68 | 65 | DECLARE_WRITE8_MEMBER(bwp2_ctrl_w); |
| 69 | 66 | DECLARE_WRITE8_MEMBER(bwing_spriteram_w); |
| 70 | 67 | DECLARE_WRITE8_MEMBER(bwing_videoram_w); |
| 71 | | DECLARE_READ8_MEMBER(bwing_scrollram_r); |
| 72 | | DECLARE_WRITE8_MEMBER(bwing_scrollram_w); |
| 68 | DECLARE_WRITE8_MEMBER(fgscrollram_w); |
| 69 | DECLARE_WRITE8_MEMBER(bgscrollram_w); |
| 70 | DECLARE_WRITE8_MEMBER(gfxram_w); |
| 73 | 71 | DECLARE_WRITE8_MEMBER(bwing_scrollreg_w); |
| 74 | 72 | DECLARE_WRITE8_MEMBER(bwing_paletteram_w); |
| 75 | 73 | DECLARE_INPUT_CHANGED_MEMBER(coin_inserted); |
| r32830 | r32831 | |
| 84 | 82 | virtual void video_start(); |
| 85 | 83 | UINT32 screen_update_bwing(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 86 | 84 | INTERRUPT_GEN_MEMBER(bwp3_interrupt); |
| 87 | | void fill_srxlat( int *xlat ); |
| 88 | 85 | void draw_sprites( bitmap_ind16 &bmp, const rectangle &clip, UINT8 *ram, int pri ); |
| 89 | 86 | void fix_bwp3( ); |
| 90 | 87 | }; |
| 91 | | |
| 92 | | /*----------- defined in video/bwing.c -----------*/ |
| 93 | | extern const gfx_layout bwing_tilelayout; |
trunk/src/mame/video/bwing.c
| r32830 | r32831 | |
| 4 | 4 | Zaviga (c) 1984 Data East Corporation |
| 5 | 5 | |
| 6 | 6 | drivers by Acho A. Tang |
| 7 | revised by Alex W. Jackson |
| 7 | 8 | |
| 8 | 9 | *****************************************************************************/ |
| 9 | 10 | // Directives |
| r32830 | r32831 | |
| 12 | 13 | #include "includes/bwing.h" |
| 13 | 14 | |
| 14 | 15 | |
| 15 | | #define BW_DEBUG 0 |
| 16 | | |
| 17 | | #define BW_NTILES_L2 7 |
| 18 | | #define BW_NTILES (1<<BW_NTILES_L2) |
| 19 | | |
| 20 | | |
| 21 | 16 | //**************************************************************************** |
| 22 | | // Local Functions |
| 23 | | |
| 24 | | void bwing_state::fill_srxlat( int *xlat ) |
| 25 | | { |
| 26 | | unsigned base, offset, i; |
| 27 | | |
| 28 | | for (base = 0; base < 0x2000; base += 0x400) |
| 29 | | { |
| 30 | | for(i = 0; i < 0x100; i++) |
| 31 | | { |
| 32 | | offset = base + (i<<2 & ~0x3f) + (i & 0x0f); |
| 33 | | |
| 34 | | xlat[base + i] = offset; |
| 35 | | xlat[base + i + 0x100] = offset + 0x10; |
| 36 | | xlat[base + i + 0x200] = offset + 0x20; |
| 37 | | xlat[base + i + 0x300] = offset + 0x30; |
| 38 | | } |
| 39 | | } |
| 40 | | } |
| 41 | | |
| 42 | | //**************************************************************************** |
| 43 | 17 | // Exports |
| 44 | 18 | |
| 45 | | const gfx_layout bwing_tilelayout = |
| 46 | | { |
| 47 | | 16, 16, |
| 48 | | BW_NTILES, |
| 49 | | 3, |
| 50 | | { 0x4000*8, 0x2000*8, 0 }, |
| 51 | | { 7, 6, 5, 4, 3, 2, 1, 0, 128+7, 128+6, 128+5, 128+4, 128+3, 128+2, 128+1, 128+0 }, |
| 52 | | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, |
| 53 | | 8*8, 9*8,10*8,11*8,12*8,13*8,14*8,15*8 }, |
| 54 | | 32*8 |
| 55 | | }; |
| 56 | 19 | |
| 57 | | |
| 58 | | WRITE8_MEMBER(bwing_state::bwing_spriteram_w) |
| 59 | | { |
| 60 | | m_spriteram[offset] = data; |
| 61 | | } |
| 62 | | |
| 63 | 20 | WRITE8_MEMBER(bwing_state::bwing_videoram_w) |
| 64 | 21 | { |
| 65 | 22 | m_videoram[offset] = data; |
| r32830 | r32831 | |
| 67 | 24 | } |
| 68 | 25 | |
| 69 | 26 | |
| 70 | | READ8_MEMBER(bwing_state::bwing_scrollram_r) |
| 27 | WRITE8_MEMBER(bwing_state::fgscrollram_w) |
| 71 | 28 | { |
| 72 | | int offs; |
| 73 | | |
| 74 | | if (!m_srbank) |
| 75 | | offs = m_srxlat[offset]; |
| 76 | | else |
| 77 | | offs = offset; |
| 78 | | |
| 79 | | return ((m_srbase[m_srbank])[offs]); |
| 29 | m_fgscrollram[offset] = data; |
| 30 | m_fgmap->mark_tile_dirty(offset); |
| 80 | 31 | } |
| 81 | 32 | |
| 82 | 33 | |
| 83 | | WRITE8_MEMBER(bwing_state::bwing_scrollram_w) |
| 34 | WRITE8_MEMBER(bwing_state::bgscrollram_w) |
| 84 | 35 | { |
| 85 | | int offs; |
| 36 | m_bgscrollram[offset] = data; |
| 37 | m_bgmap->mark_tile_dirty(offset); |
| 38 | } |
| 86 | 39 | |
| 87 | | if (!m_srbank) |
| 88 | | { |
| 89 | | offs = m_srxlat[offset]; |
| 90 | | if (offs >> 12) |
| 91 | | m_bgmap->mark_tile_dirty(offs & 0xfff); |
| 92 | | else |
| 93 | | m_fgmap->mark_tile_dirty(offs & 0xfff); |
| 94 | | } |
| 95 | | else |
| 96 | | { |
| 97 | | offs = offset; |
| 98 | | if (offset < 0x1000) |
| 99 | | m_gfxdecode->gfx(2)->mark_dirty(offset / 32); |
| 100 | | else |
| 101 | | m_gfxdecode->gfx(3)->mark_dirty(offset / 32); |
| 102 | | } |
| 103 | 40 | |
| 104 | | (m_srbase[m_srbank])[offs] = data; |
| 41 | WRITE8_MEMBER(bwing_state::gfxram_w) |
| 42 | { |
| 43 | m_gfxram[offset] = data; |
| 44 | int whichgfx = (offset & 0x1000) ? 3 : 2; |
| 45 | m_gfxdecode->gfx(whichgfx)->mark_dirty((offset & 0xfff) / 32); |
| 105 | 46 | } |
| 106 | 47 | |
| 107 | 48 | |
| r32830 | r32831 | |
| 114 | 55 | case 6: m_palatch = data; break; // one of the palette components is latched through I/O(yike) |
| 115 | 56 | |
| 116 | 57 | case 7: |
| 117 | | // tile graphics are decoded in RAM on the fly and tile codes are banked + interleaved(ouch) |
| 118 | 58 | m_mapmask = data; |
| 119 | | m_srbank = data >> 6; |
| 120 | | |
| 121 | | #if BW_DEBUG |
| 122 | | logerror("(%s)%04x: w=%02x a=%04x f=%d\n", device().tag, space.device().safe_pc(), data, 0x1b00 + offset, m_screen->frame_number()); |
| 123 | | #endif |
| 59 | m_vrambank->set_bank(data >> 6); |
| 124 | 60 | break; |
| 125 | 61 | } |
| 126 | | |
| 127 | | #if BW_DEBUG |
| 128 | | (memregion(REGION_CPU1)->base())[0x1b10 + offset] = data; |
| 129 | | #endif |
| 130 | 62 | } |
| 131 | 63 | |
| 132 | 64 | |
| r32830 | r32831 | |
| 161 | 93 | } |
| 162 | 94 | |
| 163 | 95 | m_palette->set_pen_color(offset, rgb_t(r, g, b)); |
| 164 | | |
| 165 | | #if BW_DEBUG |
| 166 | | m_paletteram[offset + 0x40] = m_palatch; |
| 167 | | #endif |
| 168 | 96 | } |
| 169 | 97 | |
| 170 | 98 | //**************************************************************************** |
| r32830 | r32831 | |
| 172 | 100 | |
| 173 | 101 | TILE_GET_INFO_MEMBER(bwing_state::get_fgtileinfo) |
| 174 | 102 | { |
| 175 | | SET_TILE_INFO_MEMBER(2, m_fgdata[tile_index] & 0x7f, m_fgdata[tile_index] >> 7, 0); |
| 103 | SET_TILE_INFO_MEMBER(2, m_fgscrollram[tile_index] & 0x7f, m_fgscrollram[tile_index] >> 7, 0); |
| 176 | 104 | } |
| 177 | 105 | |
| 178 | 106 | TILE_GET_INFO_MEMBER(bwing_state::get_bgtileinfo) |
| 179 | 107 | { |
| 180 | | SET_TILE_INFO_MEMBER(3, m_bgdata[tile_index] & 0x7f, m_bgdata[tile_index] >> 7, 0); |
| 108 | SET_TILE_INFO_MEMBER(3, m_bgscrollram[tile_index] & 0x7f, m_bgscrollram[tile_index] >> 7, 0); |
| 181 | 109 | } |
| 182 | 110 | |
| 183 | 111 | TILE_GET_INFO_MEMBER(bwing_state::get_charinfo) |
| r32830 | r32831 | |
| 187 | 115 | |
| 188 | 116 | TILEMAP_MAPPER_MEMBER(bwing_state::bwing_scan_cols) |
| 189 | 117 | { |
| 190 | | return ((col << 6) + row); |
| 118 | return (row & 0xf) | ((col & 0xf) << 4) | ((row & 0x30) << 4) | ((col & 0x30) << 6); |
| 191 | 119 | } |
| 192 | 120 | |
| 193 | 121 | |
| 194 | 122 | void bwing_state::video_start() |
| 195 | 123 | { |
| 196 | | // UINT32 *dwptr; |
| 197 | 124 | int i; |
| 198 | 125 | |
| 199 | 126 | m_charmap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(bwing_state::get_charinfo),this), TILEMAP_SCAN_COLS, 8, 8, 32, 32); |
| r32830 | r32831 | |
| 203 | 130 | m_charmap->set_transparent_pen(0); |
| 204 | 131 | m_fgmap->set_transparent_pen(0); |
| 205 | 132 | |
| 206 | | m_srxlat = auto_alloc_array(machine(), int, 0x2000); |
| 207 | | save_pointer(NAME(m_srxlat), 0x2000); |
| 208 | | |
| 209 | | fill_srxlat(m_srxlat); |
| 210 | | |
| 211 | | m_fgdata = memregion("gpu")->base(); |
| 212 | | m_bgdata = m_fgdata + 0x1000; |
| 213 | | |
| 214 | | for (i = 0; i < 4; i++) |
| 215 | | m_srbase[i] = m_fgdata + i * 0x2000; |
| 216 | | |
| 217 | 133 | for (i = 0; i < 8; i++) |
| 218 | 134 | m_sreg[i] = 0; |
| 219 | | |
| 220 | | // m_fgfx = m_gfxdecode->gfx(2); |
| 221 | | m_gfxdecode->gfx(2)->set_source(m_srbase[1]); |
| 222 | | |
| 223 | | // m_bgfx = m_gfxdecode->gfx(3); |
| 224 | | m_gfxdecode->gfx(3)->set_source(m_srbase[1] + 0x1000); |
| 225 | 135 | } |
| 226 | 136 | |
| 227 | 137 | //**************************************************************************** |
| r32830 | r32831 | |
| 270 | 180 | |
| 271 | 181 | UINT32 bwing_state::screen_update_bwing(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 272 | 182 | { |
| 273 | | unsigned x, y, shiftx; |
| 183 | unsigned flip, x, y, shiftx; |
| 274 | 184 | |
| 275 | 185 | if (m_mapmask & 0x20) |
| 276 | 186 | { |
| 277 | | m_mapflip = TILEMAP_FLIPX; |
| 187 | flip = TILEMAP_FLIPX; |
| 278 | 188 | shiftx = -8; |
| 279 | 189 | } |
| 280 | 190 | else |
| 281 | 191 | { |
| 282 | | m_mapflip = TILEMAP_FLIPY; |
| 192 | flip = TILEMAP_FLIPY; |
| 283 | 193 | shiftx = 8; |
| 284 | 194 | } |
| 285 | 195 | |
| 286 | 196 | // draw background |
| 287 | 197 | if (!(m_mapmask & 1)) |
| 288 | 198 | { |
| 289 | | m_bgmap->set_flip(m_mapflip); |
| 199 | m_bgmap->set_flip(flip); |
| 290 | 200 | x = ((m_sreg[1]<<2 & 0x300) + m_sreg[2] + shiftx) & 0x3ff; |
| 291 | 201 | m_bgmap->set_scrollx(0, x); |
| 292 | 202 | y = (m_sreg[1]<<4 & 0x300) + m_sreg[3]; |
| r32830 | r32831 | |
| 302 | 212 | // draw foreground |
| 303 | 213 | if (!(m_mapmask & 2)) |
| 304 | 214 | { |
| 305 | | m_fgmap->set_flip(m_mapflip); |
| 215 | m_fgmap->set_flip(flip); |
| 306 | 216 | x = ((m_sreg[1] << 6 & 0x300) + m_sreg[4] + shiftx) & 0x3ff; |
| 307 | 217 | m_fgmap->set_scrollx(0, x); |
| 308 | 218 | y = (m_sreg[1] << 8 & 0x300) + m_sreg[5]; |
| r32830 | r32831 | |
| 316 | 226 | // draw text layer |
| 317 | 227 | // if (m_mapmask & 4) |
| 318 | 228 | { |
| 319 | | m_charmap->set_flip(m_mapflip); |
| 229 | m_charmap->set_flip(flip); |
| 320 | 230 | m_charmap->draw(screen, bitmap, cliprect, 0, 0); |
| 321 | 231 | } |
| 322 | 232 | return 0; |
trunk/src/mame/drivers/bwing.c
| r32830 | r32831 | |
| 4 | 4 | Zaviga (c) 1984 Data East Corporation |
| 5 | 5 | |
| 6 | 6 | driver by Acho A. Tang |
| 7 | revised by Alex W. Jackson |
| 7 | 8 | |
| 8 | 9 | Known issues: |
| 9 | 10 | |
| r32830 | r32831 | |
| 41 | 42 | //**************************************************************************** |
| 42 | 43 | // Memory and I/O Handlers |
| 43 | 44 | |
| 44 | | WRITE8_MEMBER(bwing_state::bwp12_sharedram1_w) |
| 45 | | { |
| 46 | | m_bwp1_sharedram1[offset] = m_bwp2_sharedram1[offset] = data; |
| 47 | | } |
| 48 | | |
| 49 | 45 | WRITE8_MEMBER(bwing_state::bwp3_u8F_w) |
| 50 | 46 | { |
| 51 | 47 | m_bwp3_u8F_d = data; // prepares custom chip for various operations |
| r32830 | r32831 | |
| 110 | 106 | // hardwired to SWAP |
| 111 | 107 | case 7: break; |
| 112 | 108 | } |
| 113 | | |
| 114 | | #if BW_DEBUG |
| 115 | | (m_bwp123_membase[0])[0x1c00 + offset] = data; |
| 116 | | #endif |
| 117 | 109 | } |
| 118 | 110 | |
| 119 | 111 | |
| r32830 | r32831 | |
| 129 | 121 | |
| 130 | 122 | case 3: m_subcpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); break; |
| 131 | 123 | } |
| 132 | | |
| 133 | | #if BW_DEBUG |
| 134 | | { |
| 135 | | (m_bwp123_membase[1])[0x1800 + offset] = data; |
| 136 | | } |
| 137 | | #endif |
| 138 | 124 | } |
| 139 | 125 | |
| 140 | 126 | //**************************************************************************** |
| r32830 | r32831 | |
| 143 | 129 | // Main CPU |
| 144 | 130 | static ADDRESS_MAP_START( bwp1_map, AS_PROGRAM, 8, bwing_state ) |
| 145 | 131 | AM_RANGE(0x1b00, 0x1b07) AM_READ(bwp1_io_r) |
| 146 | | AM_RANGE(0x0000, 0x07ff) AM_RAM_WRITE(bwp12_sharedram1_w) AM_SHARE("bwp1_sharedram1") |
| 132 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_SHARE("sharedram") |
| 147 | 133 | AM_RANGE(0x0800, 0x0fff) AM_RAM |
| 148 | 134 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(bwing_videoram_w) AM_SHARE("videoram") |
| 149 | 135 | AM_RANGE(0x1400, 0x17ff) AM_RAM |
| 150 | | AM_RANGE(0x1800, 0x19ff) AM_RAM_WRITE(bwing_spriteram_w) AM_SHARE("spriteram") |
| 136 | AM_RANGE(0x1800, 0x19ff) AM_RAM AM_SHARE("spriteram") |
| 151 | 137 | AM_RANGE(0x1a00, 0x1aff) AM_RAM_WRITE(bwing_paletteram_w) AM_SHARE("paletteram") |
| 152 | 138 | AM_RANGE(0x1b00, 0x1b07) AM_RAM_WRITE(bwing_scrollreg_w) |
| 153 | 139 | AM_RANGE(0x1c00, 0x1c07) AM_RAM_WRITE(bwp1_ctrl_w) |
| 154 | | AM_RANGE(0x2000, 0x3fff) AM_READWRITE(bwing_scrollram_r, bwing_scrollram_w) |
| 140 | AM_RANGE(0x2000, 0x3fff) AM_DEVICE("vrambank", address_map_bank_device, amap8) |
| 155 | 141 | AM_RANGE(0x4000, 0xffff) AM_ROM // "B-Wings US" writes to 9631-9632(debug?) |
| 156 | 142 | ADDRESS_MAP_END |
| 157 | 143 | |
| 144 | // Banked video RAM |
| 145 | static ADDRESS_MAP_START( bank_map, AS_PROGRAM, 8, bwing_state ) |
| 146 | AM_RANGE(0x0000, 0x0fff) AM_RAM_WRITE(fgscrollram_w) AM_SHARE("fgscrollram") |
| 147 | AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(bgscrollram_w) AM_SHARE("bgscrollram") |
| 148 | AM_RANGE(0x2000, 0x7fff) AM_RAM_WRITE(gfxram_w) AM_SHARE("gfxram") |
| 149 | ADDRESS_MAP_END |
| 158 | 150 | |
| 159 | 151 | // Sub CPU |
| 160 | 152 | static ADDRESS_MAP_START( bwp2_map, AS_PROGRAM, 8, bwing_state ) |
| 161 | | AM_RANGE(0x0000, 0x07ff) AM_RAM_WRITE(bwp12_sharedram1_w) AM_SHARE("bwp2_sharedram1") |
| 153 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_SHARE("sharedram") |
| 162 | 154 | AM_RANGE(0x0800, 0x0fff) AM_RAM |
| 163 | 155 | AM_RANGE(0x1800, 0x1803) AM_WRITE(bwp2_ctrl_w) |
| 164 | 156 | AM_RANGE(0xa000, 0xffff) AM_ROM |
| r32830 | r32831 | |
| 176 | 168 | AM_RANGE(0x8000, 0x8000) AM_DEVWRITE("ay2", ay8910_device, address_w) |
| 177 | 169 | AM_RANGE(0xa000, 0xa000) AM_READ(soundlatch_byte_r) |
| 178 | 170 | AM_RANGE(0xd000, 0xd000) AM_WRITE(bwp3_nmimask_w) |
| 179 | | AM_RANGE(0xe000, 0xffff) AM_ROM AM_SHARE("bwp3_rombase") |
| 171 | AM_RANGE(0xe000, 0xffff) AM_ROM AM_REGION("audiocpu", 0) |
| 180 | 172 | ADDRESS_MAP_END |
| 181 | 173 | |
| 182 | 174 | |
| r32830 | r32831 | |
| 298 | 290 | static const gfx_layout charlayout = |
| 299 | 291 | { |
| 300 | 292 | 8, 8, |
| 301 | | 256, |
| 293 | RGN_FRAC(1,2), |
| 302 | 294 | 2, |
| 303 | | { 0, 0x4000 }, |
| 295 | { 0, RGN_FRAC(1,2) }, |
| 304 | 296 | { 7, 6, 5, 4, 3, 2, 1, 0 }, |
| 305 | 297 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, |
| 306 | 298 | 8*8 |
| r32830 | r32831 | |
| 309 | 301 | static const gfx_layout spritelayout = |
| 310 | 302 | { |
| 311 | 303 | 16, 16, |
| 312 | | 512, |
| 304 | RGN_FRAC(1,3), |
| 313 | 305 | 3, |
| 314 | | { 0x40000, 0x20000, 0 }, |
| 306 | { RGN_FRAC(2,3), RGN_FRAC(1,3), 0 }, |
| 315 | 307 | { 7, 6, 5, 4, 3, 2, 1, 0, 128+7, 128+6, 128+5, 128+4, 128+3, 128+2, 128+1, 128+0 }, |
| 316 | 308 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, |
| 317 | 309 | 8*8, 9*8,10*8,11*8,12*8,13*8,14*8,15*8 }, |
| 318 | 310 | 32*8 |
| 319 | 311 | }; |
| 320 | 312 | |
| 313 | static const gfx_layout ram_tilelayout = |
| 314 | { |
| 315 | 16, 16, |
| 316 | RGN_FRAC(1,6), // two sets interleaved in the same RAM |
| 317 | 3, |
| 318 | { RGN_FRAC(2,3), RGN_FRAC(1,3), 0 }, |
| 319 | { 7, 6, 5, 4, 3, 2, 1, 0, 128+7, 128+6, 128+5, 128+4, 128+3, 128+2, 128+1, 128+0 }, |
| 320 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, |
| 321 | 8*8, 9*8,10*8,11*8,12*8,13*8,14*8,15*8 }, |
| 322 | 32*8 |
| 323 | }; |
| 321 | 324 | |
| 322 | 325 | static GFXDECODE_START( bwing ) |
| 323 | | GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0x00, 1 ) // chars |
| 324 | | GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 0x20, 2 ) // sprites |
| 325 | | GFXDECODE_ENTRY( "gpu", 0, bwing_tilelayout, 0x10, 2 ) // foreground tiles place holder |
| 326 | | GFXDECODE_ENTRY( "gpu", 0, bwing_tilelayout, 0x30, 2 ) // background tiles place holder |
| 326 | GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0x00, 1 ) // chars |
| 327 | GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 0x20, 2 ) // sprites |
| 328 | GFXDECODE_RAM( "gfxram", 0, ram_tilelayout, 0x10, 2 ) // foreground tiles |
| 329 | GFXDECODE_RAM( "gfxram", 0x1000, ram_tilelayout, 0x30, 2 ) // background tiles |
| 327 | 330 | GFXDECODE_END |
| 328 | 331 | |
| 329 | 332 | //**************************************************************************** |
| r32830 | r32831 | |
| 332 | 335 | void bwing_state::machine_start() |
| 333 | 336 | { |
| 334 | 337 | save_item(NAME(m_palatch)); |
| 335 | | save_item(NAME(m_srbank)); |
| 336 | 338 | save_item(NAME(m_mapmask)); |
| 337 | | save_item(NAME(m_mapflip)); |
| 338 | 339 | save_item(NAME(m_bwp3_nmimask)); |
| 339 | 340 | save_item(NAME(m_bwp3_u8F_d)); |
| 340 | 341 | |
| r32830 | r32831 | |
| 344 | 345 | void bwing_state::machine_reset() |
| 345 | 346 | { |
| 346 | 347 | m_palatch = 0; |
| 347 | | m_srbank = 0; |
| 348 | 348 | m_mapmask = 0; |
| 349 | | m_mapflip = 0; |
| 350 | 349 | |
| 351 | 350 | m_bwp3_nmimask = 0; |
| 352 | 351 | m_bwp3_u8F_d = 0; |
| r32830 | r32831 | |
| 368 | 367 | |
| 369 | 368 | MCFG_QUANTUM_TIME(attotime::from_hz(18000)) // high enough? |
| 370 | 369 | |
| 370 | MCFG_DEVICE_ADD("vrambank", ADDRESS_MAP_BANK, 0) |
| 371 | MCFG_DEVICE_PROGRAM_MAP(bank_map) |
| 372 | MCFG_ADDRESS_MAP_BANK_ENDIANNESS(ENDIANNESS_BIG) |
| 373 | MCFG_ADDRESS_MAP_BANK_DATABUS_WIDTH(8) |
| 374 | MCFG_ADDRESS_MAP_BANK_ADDRBUS_WIDTH(15) |
| 375 | MCFG_ADDRESS_MAP_BANK_STRIDE(0x2000) |
| 371 | 376 | |
| 372 | 377 | // video hardware |
| 373 | 378 | MCFG_SCREEN_ADD("screen", RASTER) |
| r32830 | r32831 | |
| 411 | 416 | ROM_LOAD( "bw_bv-05-.9d", 0x0c000, 0x02000, CRC(1e393300) SHA1(8d847256eb5dbccf5f524ec3aa836073d70b4edc) ) // different |
| 412 | 417 | ROM_LOAD( "bw_bv-04-.7d", 0x0e000, 0x02000, CRC(6548c5bb) SHA1(d12cc8d0d5692c3de766f5c42c818dd8f685760a) ) // different |
| 413 | 418 | |
| 414 | | ROM_REGION( 0x10000, "audiocpu", 0 ) // sound CPU(encrypted) |
| 415 | | ROM_LOAD( "bw_bv-03.13a", 0x0e000, 0x02000, CRC(e8ac9379) SHA1(aaf5c20aa33ed05747a8a27739e9d09e094a518d) ) |
| 419 | ROM_REGION( 0x2000, "audiocpu", 0 ) // sound CPU(encrypted) |
| 420 | ROM_LOAD( "bw_bv-03.13a", 0x00000, 0x02000, CRC(e8ac9379) SHA1(aaf5c20aa33ed05747a8a27739e9d09e094a518d) ) |
| 416 | 421 | |
| 417 | 422 | // Bottom Board(CCU-01) |
| 418 | 423 | ROM_REGION( 0x01000, "gfx1", 0 ) // chars |
| r32830 | r32831 | |
| 423 | 428 | ROM_LOAD( "bw_bv-07.1l", 0x00000, 0x04000, CRC(3d5ab2be) SHA1(2b3a039914ebfcc3993da74853a67546fc22c191) ) |
| 424 | 429 | ROM_LOAD( "bw_bv-08.1k", 0x04000, 0x04000, CRC(7a585f1e) SHA1(99e5d947b6b1fa96b90c676a282376d67fc377f0) ) |
| 425 | 430 | ROM_LOAD( "bw_bv-09.1h", 0x08000, 0x04000, CRC(a14c0b57) SHA1(5033354793d77922f5ef7f268cbe212e551efadf) ) |
| 426 | | |
| 427 | | // GPU Banks |
| 428 | | ROM_REGION( 0x08000, "gpu", ROMREGION_ERASE00 ) |
| 429 | 431 | ROM_END |
| 430 | 432 | |
| 431 | 433 | |
| r32830 | r32831 | |
| 441 | 443 | ROM_LOAD( "bw_bv-05.9d", 0x0c000, 0x02000, CRC(f283f39a) SHA1(9f7f4c39d49f4dfff73fe74cd457480e8a43a3c5) ) |
| 442 | 444 | ROM_LOAD( "bw_bv-04.7d", 0x0e000, 0x02000, CRC(29ae75b6) SHA1(48c94e996857f2ac995bcd25f0e67b9f7c17d807) ) |
| 443 | 445 | |
| 444 | | ROM_REGION( 0x10000, "audiocpu", 0 ) // sound CPU(encrypted) |
| 445 | | ROM_LOAD( "bw_bv-03.13a", 0x0e000, 0x02000, CRC(e8ac9379) SHA1(aaf5c20aa33ed05747a8a27739e9d09e094a518d) ) |
| 446 | ROM_REGION( 0x2000, "audiocpu", 0 ) // sound CPU(encrypted) |
| 447 | ROM_LOAD( "bw_bv-03.13a", 0x00000, 0x02000, CRC(e8ac9379) SHA1(aaf5c20aa33ed05747a8a27739e9d09e094a518d) ) |
| 446 | 448 | |
| 447 | 449 | // Bottom Board(CCU-01) |
| 448 | 450 | ROM_REGION( 0x01000, "gfx1", 0 ) // chars |
| r32830 | r32831 | |
| 453 | 455 | ROM_LOAD( "bw_bv-07.1l", 0x00000, 0x04000, CRC(3d5ab2be) SHA1(2b3a039914ebfcc3993da74853a67546fc22c191) ) |
| 454 | 456 | ROM_LOAD( "bw_bv-08.1k", 0x04000, 0x04000, CRC(7a585f1e) SHA1(99e5d947b6b1fa96b90c676a282376d67fc377f0) ) |
| 455 | 457 | ROM_LOAD( "bw_bv-09.1h", 0x08000, 0x04000, CRC(a14c0b57) SHA1(5033354793d77922f5ef7f268cbe212e551efadf) ) |
| 456 | | |
| 457 | | // GPU Banks |
| 458 | | ROM_REGION( 0x08000, "gpu", ROMREGION_ERASE00 ) |
| 459 | 458 | ROM_END |
| 460 | 459 | |
| 461 | 460 | |
| r32830 | r32831 | |
| 472 | 471 | ROM_LOAD( "bw_bv-05.9d", 0x0c000, 0x02000, CRC(f283f39a) SHA1(9f7f4c39d49f4dfff73fe74cd457480e8a43a3c5) ) |
| 473 | 472 | ROM_LOAD( "bw_bv-04.7d", 0x0e000, 0x02000, CRC(29ae75b6) SHA1(48c94e996857f2ac995bcd25f0e67b9f7c17d807) ) |
| 474 | 473 | |
| 475 | | ROM_REGION( 0x10000, "audiocpu", 0 ) // sound CPU(encrypted) |
| 476 | | ROM_LOAD( "bw_bv-03.13a", 0x0e000, 0x02000, CRC(e8ac9379) SHA1(aaf5c20aa33ed05747a8a27739e9d09e094a518d) ) |
| 474 | ROM_REGION( 0x2000, "audiocpu", 0 ) // sound CPU(encrypted) |
| 475 | ROM_LOAD( "bw_bv-03.13a", 0x00000, 0x02000, CRC(e8ac9379) SHA1(aaf5c20aa33ed05747a8a27739e9d09e094a518d) ) |
| 477 | 476 | |
| 478 | 477 | // Bottom Board(CCU-01) |
| 479 | 478 | ROM_REGION( 0x01000, "gfx1", 0 ) // chars |
| r32830 | r32831 | |
| 484 | 483 | ROM_LOAD( "bw_bv-07.1l", 0x00000, 0x04000, CRC(3d5ab2be) SHA1(2b3a039914ebfcc3993da74853a67546fc22c191) ) |
| 485 | 484 | ROM_LOAD( "bw_bv-08.1k", 0x04000, 0x04000, CRC(7a585f1e) SHA1(99e5d947b6b1fa96b90c676a282376d67fc377f0) ) |
| 486 | 485 | ROM_LOAD( "bw_bv-09.1h", 0x08000, 0x04000, CRC(a14c0b57) SHA1(5033354793d77922f5ef7f268cbe212e551efadf) ) |
| 487 | | |
| 488 | | // GPU Banks |
| 489 | | ROM_REGION( 0x08000, "gpu", ROMREGION_ERASE00 ) |
| 490 | 486 | ROM_END |
| 491 | 487 | |
| 492 | 488 | ROM_START( zaviga ) |
| r32830 | r32831 | |
| 501 | 497 | ROM_LOAD( "as07.9d", 0x0c000, 0x02000, CRC(dc1170e3) SHA1(c8e4d1564fd272d726d0e4ffd4f33f67f1b37cd7) ) |
| 502 | 498 | ROM_LOAD( "as06.7d", 0x0e000, 0x02000, CRC(ba888f84) SHA1(f94de8553cd4704d9b3349ded881a7cc62fa9b57) ) |
| 503 | 499 | |
| 504 | | ROM_REGION( 0x10000, "audiocpu", 0 ) // sound CPU(encrypted) |
| 505 | | ROM_LOAD( "as05.13a", 0x0e000, 0x02000, CRC(afe9b0ac) SHA1(3c653cd4fff7f4e00971249900b5a810b6e74dfe) ) |
| 500 | ROM_REGION( 0x2000, "audiocpu", 0 ) // sound CPU(encrypted) |
| 501 | ROM_LOAD( "as05.13a", 0x00000, 0x02000, CRC(afe9b0ac) SHA1(3c653cd4fff7f4e00971249900b5a810b6e74dfe) ) |
| 506 | 502 | |
| 507 | 503 | // Bottom Board(DE-0170-0) |
| 508 | 504 | ROM_REGION( 0x01000, "gfx1", 0 ) // chars |
| r32830 | r32831 | |
| 513 | 509 | ROM_LOAD( "as11.1l", 0x00000, 0x04000, CRC(aa84af24) SHA1(af4ff085dc44b3d1493ec1c8b4a8d18dccecc872) ) |
| 514 | 510 | ROM_LOAD( "as12.1k", 0x04000, 0x04000, CRC(84af9041) SHA1(8fbd5995ca8e708cd7fb9cdfcdb174e12084f526) ) |
| 515 | 511 | ROM_LOAD( "as13.1h", 0x08000, 0x04000, CRC(15d0922b) SHA1(b8d715a9e610531472d516c19f6035adbce93c84) ) |
| 516 | | |
| 517 | | // GPU Banks |
| 518 | | ROM_REGION( 0x08000, "gpu", ROMREGION_ERASE00 ) |
| 519 | 512 | ROM_END |
| 520 | 513 | |
| 521 | 514 | |
| r32830 | r32831 | |
| 531 | 524 | ROM_LOAD( "as07.9d", 0x0c000, 0x02000, CRC(dc1170e3) SHA1(c8e4d1564fd272d726d0e4ffd4f33f67f1b37cd7) ) |
| 532 | 525 | ROM_LOAD( "as06-.7d", 0x0e000, 0x02000, CRC(b02d270c) SHA1(beea3d44d367543b5b5075c5892580e690691e75) ) // different |
| 533 | 526 | |
| 534 | | ROM_REGION( 0x10000, "audiocpu", 0 ) // sound CPU(encrypted) |
| 535 | | ROM_LOAD( "as05.13a", 0x0e000, 0x02000, CRC(afe9b0ac) SHA1(3c653cd4fff7f4e00971249900b5a810b6e74dfe) ) |
| 527 | ROM_REGION( 0x2000, "audiocpu", 0 ) // sound CPU(encrypted) |
| 528 | ROM_LOAD( "as05.13a", 0x00000, 0x02000, CRC(afe9b0ac) SHA1(3c653cd4fff7f4e00971249900b5a810b6e74dfe) ) |
| 536 | 529 | |
| 537 | 530 | // Bottom Board(DE-0170-0) |
| 538 | 531 | ROM_REGION( 0x01000, "gfx1", 0 ) // chars |
| r32830 | r32831 | |
| 543 | 536 | ROM_LOAD( "as11.1l", 0x00000, 0x04000, CRC(aa84af24) SHA1(af4ff085dc44b3d1493ec1c8b4a8d18dccecc872) ) |
| 544 | 537 | ROM_LOAD( "as12.1k", 0x04000, 0x04000, CRC(84af9041) SHA1(8fbd5995ca8e708cd7fb9cdfcdb174e12084f526) ) |
| 545 | 538 | ROM_LOAD( "as13.1h", 0x08000, 0x04000, CRC(15d0922b) SHA1(b8d715a9e610531472d516c19f6035adbce93c84) ) |
| 546 | | |
| 547 | | // GPU Banks |
| 548 | | ROM_REGION( 0x08000, "gpu", ROMREGION_ERASE00 ) |
| 549 | 539 | ROM_END |
| 550 | 540 | |
| 551 | 541 | //**************************************************************************** |
| r32830 | r32831 | |
| 553 | 543 | |
| 554 | 544 | void bwing_state::fix_bwp3( ) |
| 555 | 545 | { |
| 556 | | UINT8 *rom = m_bwp3_rombase; |
| 557 | | int i, j = m_bwp3_rombase.bytes(); |
| 546 | UINT8 *rom = memregion("audiocpu")->base(); |
| 547 | int j = memregion("audiocpu")->bytes(); |
| 558 | 548 | |
| 559 | 549 | // swap nibbles |
| 560 | | for (i = 0; i < j; i++) |
| 550 | for (int i = 0; i < j; i++) |
| 561 | 551 | rom[i] = ((rom[i] & 0xf0) >> 4) | ((rom[i] & 0xf) << 4); |
| 562 | 552 | |
| 563 | 553 | // relocate vectors |