trunk/src/mame/video/spbactn.c
| r20711 | r20712 | |
| 127 | 127 | { |
| 128 | 128 | int attr = m_bgvideoram[tile_index]; |
| 129 | 129 | int tileno = m_bgvideoram[tile_index+0x2000]; |
| 130 | | SET_TILE_INFO_MEMBER(1, tileno, ((attr & 0x00f0)>>4), 0); |
| 130 | SET_TILE_INFO_MEMBER(1, tileno, ((attr & 0x00f0)>>4)+0x80, 0); |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | |
| r20711 | r20712 | |
| 142 | 142 | int attr = m_fgvideoram[tile_index]; |
| 143 | 143 | int tileno = m_fgvideoram[tile_index+0x2000]; |
| 144 | 144 | |
| 145 | | SET_TILE_INFO_MEMBER(0, tileno, ((attr & 0x00f0)>>4), 0); |
| 145 | int color = ((attr & 0x00f0)>>4); |
| 146 | |
| 147 | /* blending */ |
| 148 | if (attr & 0x0008) |
| 149 | color += 0x00f0; |
| 150 | else |
| 151 | color |= 0x0080; |
| 152 | |
| 153 | SET_TILE_INFO_MEMBER(0, tileno, color, 0); |
| 146 | 154 | } |
| 147 | 155 | |
| 148 | 156 | |
| r20711 | r20712 | |
| 156 | 164 | |
| 157 | 165 | m_bg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(spbactn_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 8, 64, 128); |
| 158 | 166 | m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(spbactn_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 8, 64, 128); |
| 167 | m_bg_tilemap->set_transparent_pen(0); |
| 168 | m_fg_tilemap->set_transparent_pen(0); |
| 159 | 169 | |
| 160 | 170 | } |
| 161 | 171 | |
| 162 | | int spbactn_state::draw_video(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, bool alt_sprites) |
| 172 | |
| 173 | WRITE16_MEMBER( spbactn_state::spbatnp_90002_w ) |
| 163 | 174 | { |
| 164 | | int offs, sx, sy; |
| 175 | //printf("spbatnp_90002_w %04x\n",data); |
| 176 | } |
| 165 | 177 | |
| 166 | | m_tile_bitmap_fg.fill(0, cliprect); |
| 178 | WRITE16_MEMBER( spbactn_state::spbatnp_90006_w ) |
| 179 | { |
| 180 | //printf("spbatnp_90006_w %04x\n",data); |
| 181 | } |
| 167 | 182 | |
| 168 | | /* draw table bg gfx */ |
| 169 | | for (sx = sy = offs = 0; offs < 0x4000 / 2; offs++) |
| 170 | | { |
| 171 | | int attr, code, color; |
| 172 | 183 | |
| 173 | | code = m_bgvideoram[offs + 0x4000 / 2]; |
| 174 | | attr = m_bgvideoram[offs + 0x0000 / 2]; |
| 184 | WRITE16_MEMBER( spbactn_state::spbatnp_9000c_w ) |
| 185 | { |
| 186 | //printf("spbatnp_9000c_w %04x\n",data); |
| 187 | } |
| 175 | 188 | |
| 176 | | color = ((attr & 0x00f0) >> 4) | 0x80; |
| 189 | WRITE16_MEMBER( spbactn_state::spbatnp_9000e_w ) |
| 190 | { |
| 191 | //printf("spbatnp_9000e_w %04x\n",data); |
| 192 | } |
| 177 | 193 | |
| 178 | | drawgfx_transpen_raw(m_tile_bitmap_bg, cliprect, machine().gfx[1], |
| 179 | | code, |
| 180 | | machine().gfx[1]->colorbase() + color * machine().gfx[1]->granularity(), |
| 181 | | 0, 0, |
| 182 | | 16 * sx, 8 * sy, |
| 183 | | (UINT32)-1); |
| 194 | WRITE16_MEMBER( spbactn_state::spbatnp_9000a_w ) |
| 195 | { |
| 196 | //printf("spbatnp_9000a_w %04x\n",data); |
| 197 | } |
| 184 | 198 | |
| 185 | | sx++; |
| 186 | | if (sx > 63) |
| 187 | | { |
| 188 | | sy++; |
| 189 | | sx = 0; |
| 190 | | } |
| 191 | | } |
| 199 | WRITE16_MEMBER( spbactn_state::spbatnp_90124_w ) |
| 200 | { |
| 201 | //printf("spbatnp_90124_w %04x\n",data); |
| 202 | m_bg_tilemap->set_scrolly(0, data); |
| 192 | 203 | |
| 193 | | if (draw_sprites(machine(), m_tile_bitmap_bg, cliprect, 0, alt_sprites)) |
| 194 | | { |
| 195 | | /* kludge: draw table bg gfx again if priority 0 sprites are enabled */ |
| 196 | | for (sx = sy = offs = 0; offs < 0x4000 / 2; offs++) |
| 197 | | { |
| 198 | | int attr, code, color; |
| 204 | } |
| 199 | 205 | |
| 200 | | code = m_bgvideoram[offs + 0x4000 / 2]; |
| 201 | | attr = m_bgvideoram[offs + 0x0000 / 2]; |
| 206 | WRITE16_MEMBER( spbactn_state::spbatnp_9012c_w ) |
| 207 | { |
| 208 | //printf("spbatnp_9012c_w %04x\n",data); |
| 209 | m_bg_tilemap->set_scrollx(0, data); |
| 210 | } |
| 202 | 211 | |
| 203 | | color = ((attr & 0x00f0) >> 4) | 0x80; |
| 204 | 212 | |
| 205 | | drawgfx_transpen_raw(m_tile_bitmap_bg, cliprect, machine().gfx[1], |
| 206 | | code, |
| 207 | | machine().gfx[1]->colorbase() + color * machine().gfx[1]->granularity(), |
| 208 | | 0, 0, |
| 209 | | 16 * sx, 8 * sy, |
| 210 | | 0); |
| 211 | 213 | |
| 212 | | sx++; |
| 213 | | if (sx > 63) |
| 214 | | { |
| 215 | | sy++; |
| 216 | | sx = 0; |
| 217 | | } |
| 218 | | } |
| 219 | | } |
| 214 | int spbactn_state::draw_video(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, bool alt_sprites) |
| 215 | { |
| 216 | m_tile_bitmap_fg.fill(0, cliprect); |
| 220 | 217 | |
| 221 | | draw_sprites(machine(), m_tile_bitmap_bg, cliprect, 1, alt_sprites); |
| 218 | m_bg_tilemap->draw(m_tile_bitmap_bg, cliprect, TILEMAP_DRAW_OPAQUE, 0); |
| 222 | 219 | |
| 223 | | /* draw table fg gfx */ |
| 224 | | for (sx = sy = offs = 0; offs < 0x4000 / 2; offs++) |
| 225 | | { |
| 226 | | int attr, code, color; |
| 227 | 220 | |
| 228 | | code = m_fgvideoram[offs + 0x4000 / 2]; |
| 229 | | attr = m_fgvideoram[offs + 0x0000 / 2]; |
| 230 | 221 | |
| 231 | | color = ((attr & 0x00f0) >> 4); |
| 222 | if (draw_sprites(machine(), m_tile_bitmap_bg, cliprect, 0, alt_sprites)) |
| 223 | { |
| 224 | m_bg_tilemap->draw(m_tile_bitmap_bg, cliprect, 0, 0); |
| 225 | } |
| 232 | 226 | |
| 233 | | /* blending */ |
| 234 | | if (attr & 0x0008) |
| 235 | | color += 0x00f0; |
| 236 | | else |
| 237 | | color |= 0x0080; |
| 227 | draw_sprites(machine(), m_tile_bitmap_bg, cliprect, 1, alt_sprites); |
| 238 | 228 | |
| 239 | | drawgfx_transpen_raw(m_tile_bitmap_fg, cliprect, machine().gfx[0], |
| 240 | | code, |
| 241 | | machine().gfx[0]->colorbase() + color * machine().gfx[0]->granularity(), |
| 242 | | 0, 0, |
| 243 | | 16 * sx, 8 * sy, |
| 244 | | 0); |
| 229 | m_fg_tilemap->draw(m_tile_bitmap_fg, cliprect, 0, 0); |
| 245 | 230 | |
| 246 | | sx++; |
| 247 | | if (sx > 63) |
| 248 | | { |
| 249 | | sy++; |
| 250 | | sx = 0; |
| 251 | | } |
| 252 | | } |
| 253 | 231 | |
| 254 | 232 | draw_sprites(machine(), m_tile_bitmap_fg, cliprect, 2, alt_sprites); |
| 255 | 233 | draw_sprites(machine(), m_tile_bitmap_fg, cliprect, 3, alt_sprites); |
trunk/src/mame/drivers/spbactn.c
| r20711 | r20712 | |
| 160 | 160 | AM_RANGE(0x90030, 0x90031) AM_READ_PORT("DSW1") |
| 161 | 161 | AM_RANGE(0x90040, 0x90041) AM_READ_PORT("DSW2") |
| 162 | 162 | |
| 163 | | /* this is an awful lot of unknowns */ |
| 163 | /* this are an awful lot of unknowns */ |
| 164 | 164 | AM_RANGE(0x90000, 0x90001) AM_WRITENOP |
| 165 | 165 | AM_RANGE(0x90010, 0x90011) AM_WRITE(soundcommand_w) |
| 166 | 166 | // AM_RANGE(0x90020, 0x90021) AM_WRITE(soundcommand_w) |
| r20711 | r20712 | |
| 203 | 203 | AM_RANGE(0x70000, 0x77fff) AM_RAM_WRITE(bg_videoram_w) AM_SHARE("bgvideoram") |
| 204 | 204 | AM_RANGE(0x80000, 0x827ff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_word_w) AM_SHARE("paletteram") // yes R and G are swapped vs. the released version |
| 205 | 205 | |
| 206 | AM_RANGE(0x90002, 0x90003) AM_WRITE( spbatnp_90002_w ) |
| 207 | AM_RANGE(0x90006, 0x90007) AM_WRITE( spbatnp_90006_w ) |
| 208 | AM_RANGE(0x9000a, 0x9000b) AM_WRITE( spbatnp_9000a_w ) |
| 209 | AM_RANGE(0x9000c, 0x9000d) AM_WRITE( spbatnp_9000c_w ) |
| 210 | AM_RANGE(0x9000e, 0x9000f) AM_WRITE( spbatnp_9000e_w ) |
| 211 | |
| 212 | AM_RANGE(0x90124, 0x90125) AM_WRITE( spbatnp_90124_w ) // bg scroll |
| 213 | AM_RANGE(0x9012c, 0x9012d) AM_WRITE( spbatnp_9012c_w ) // bg scroll |
| 214 | |
| 215 | |
| 216 | |
| 206 | 217 | AM_RANGE(0x90000, 0x900ff) AM_READ(temp_read_handler_r) // temp |
| 207 | 218 | |
| 208 | 219 | ADDRESS_MAP_END |
| r20711 | r20712 | |
| 218 | 229 | ADDRESS_MAP_END |
| 219 | 230 | |
| 220 | 231 | |
| 232 | |
| 233 | static ADDRESS_MAP_START( spbactnp_extra_map, AS_PROGRAM, 8, spbactn_state ) |
| 234 | AM_RANGE(0x0000, 0xefff) AM_ROM |
| 235 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 236 | AM_RANGE(0xe000, 0xefff) AM_RAM |
| 237 | AM_RANGE(0xd000, 0xd1ff) AM_RAM |
| 238 | AM_RANGE(0xd200, 0xd200) AM_RAM |
| 239 | ADDRESS_MAP_END |
| 240 | |
| 241 | |
| 242 | |
| 221 | 243 | static INPUT_PORTS_START( spbactn ) |
| 222 | 244 | PORT_START("IN0") |
| 223 | 245 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r20711 | r20712 | |
| 432 | 454 | MCFG_CPU_VBLANK_INT_DRIVER("screen", spbactn_state, irq3_line_hold) |
| 433 | 455 | |
| 434 | 456 | MCFG_CPU_ADD("audiocpu", Z80, XTAL_4MHz) |
| 435 | | MCFG_CPU_PROGRAM_MAP(spbactn_sound_map) // wrong |
| 457 | MCFG_CPU_PROGRAM_MAP(spbactn_sound_map) |
| 436 | 458 | |
| 437 | | // there is a rom for another Z80 and a socket for one.. |
| 459 | // yes another cpu.. |
| 460 | MCFG_CPU_ADD("extracpu", Z80, XTAL_4MHz) |
| 461 | MCFG_CPU_PROGRAM_MAP(spbactnp_extra_map) |
| 462 | MCFG_CPU_VBLANK_INT_DRIVER("screen", spbactn_state, irq0_line_hold) |
| 438 | 463 | |
| 464 | |
| 439 | 465 | /* video hardware */ |
| 440 | 466 | MCFG_SCREEN_ADD("screen", RASTER) |
| 441 | 467 | MCFG_SCREEN_REFRESH_RATE(60) |
| r20711 | r20712 | |
| 521 | 547 | ROM_LOAD16_BYTE( "spa.21k", 0x20001, 0x10000, CRC(8226f644) SHA1(2d3e32368fbfec7437bd972096fd92972f52f6b0) ) |
| 522 | 548 | |
| 523 | 549 | ROM_REGION( 0x10000, "audiocpu", 0 ) |
| 524 | | ROM_LOAD( "6204_6-6.29c", 0x00000, 0x10000, CRC(e8250c26) SHA1(9b669878790c8e3c5d80f165b5ffa1d6830f4696) ) |
| 550 | ROM_LOAD( "spa.17g", 0x00000, 0x10000, CRC(445fc2c5) SHA1(c0e40496cfcaa0a8c90fb05111fadee74582f91a) ) |
| 525 | 551 | |
| 526 | 552 | |
| 527 | 553 | ROM_REGION( 0x40000, "oki", 0 ) |
| r20711 | r20712 | |
| 540 | 566 | ROM_LOAD( "spa_sp1_3-14-a-10.4m", 0x20000, 0x20000, CRC(86406336) SHA1(bf091dc13404535e6baee990f5e957d3538841ac) ) |
| 541 | 567 | |
| 542 | 568 | |
| 569 | /* does this have an extra (horizontal) screen maybe, with the girls being displayed on that instead of the main one.. */ |
| 570 | ROM_REGION( 0x10000, "extracpu", 0 ) // what? it's annother z80 rom... unused for now |
| 571 | ROM_LOAD( "6204_6-6.29c", 0x00000, 0x10000, CRC(e8250c26) SHA1(9b669878790c8e3c5d80f165b5ffa1d6830f4696) ) |
| 543 | 572 | |
| 544 | | ROM_REGION( 0x10000, "otherz80", 0 ) // what? it's annother z80 rom... unused for now |
| 545 | | ROM_LOAD( "spa.17g", 0x00000, 0x10000, CRC(445fc2c5) SHA1(c0e40496cfcaa0a8c90fb05111fadee74582f91a) ) |
| 546 | | |
| 547 | 573 | ROM_REGION( 0x080000, "gfx4", 0 ) /* 8x8 BG Tiles */ // more 8x8 tiles, with the girl graphics? unused for now .. for horizontal orientation?? |
| 548 | 574 | ROM_LOAD( "spa.25c", 0x00000, 0x20000, CRC(02b69ab9) SHA1(368e774693a6fab756faaeec4ffd42406816e6e2) ) |
| 549 | 575 | |
| 550 | 576 | ROM_REGION( 0x10000, "misc", 0 ) //misc |
| 551 | | ROM_LOAD( "p109.18d", 0x00000, 0x100, CRC(2297a725) SHA1(211ebae11ca55cc67df29291c3e0916836550bfb) ) |
| 552 | | ROM_LOAD( "pin.b.sub.23g", 0x00000, 0x100, CRC(3a0c70ed) SHA1(9be38c421e9a14f6811752a4464dd5dbf037e385) ) |
| 577 | ROM_LOAD( "p109.18d", 0x00000, 0x100, CRC(2297a725) SHA1(211ebae11ca55cc67df29291c3e0916836550bfb) ) // mostly empty.. is this correct? |
| 578 | ROM_LOAD( "pin.b.sub.23g", 0x00000, 0x100, CRC(3a0c70ed) SHA1(9be38c421e9a14f6811752a4464dd5dbf037e385) ) // mostly empty.. is this correct? |
| 553 | 579 | ROM_LOAD( "tcm1.19g.bin", 0x00000, 0x53, CRC(2c54354a) SHA1(11d8b6cdaf052b5a9fbcf6b6fbf99c5f89575cfa) ) |
| 554 | 580 | ROM_END |
| 555 | 581 | |