trunk/src/mame/drivers/ttchamp.c
| r245131 | r245132 | |
| 90 | 90 | |
| 91 | 91 | |
| 92 | 92 | UINT16 m_port10; |
| 93 | UINT8 m_rombank; |
| 93 | 94 | |
| 94 | 95 | DECLARE_DRIVER_INIT(ttchamp); |
| 95 | 96 | |
| r245131 | r245132 | |
| 104 | 105 | |
| 105 | 106 | |
| 106 | 107 | |
| 107 | | |
| 108 | 108 | UINT16 m_mainram[0x10000 / 2]; |
| 109 | 109 | |
| 110 | 110 | int m_spritesinit; |
| r245131 | r245132 | |
| 299 | 299 | { |
| 300 | 300 | // printf("%06x: spider_blitter_w %08x %04x %04x (init2) (width?)\n", space.device().safe_pc(), offset * 2, data, mem_mask); |
| 301 | 301 | m_spriteswidth = offset & 0xff; |
| 302 | //printf("%08x\n",(offset*2) & 0xfff00); |
| 302 | 303 | |
| 303 | | m_spritesinit = 0; |
| 304 | m_spritesinit = 3; |
| 304 | 305 | } |
| 305 | 306 | else |
| 306 | 307 | { |
| r245131 | r245132 | |
| 314 | 315 | } |
| 315 | 316 | else if ((offset >= 0x30000 / 2) && (offset < 0x40000 / 2)) |
| 316 | 317 | { |
| 318 | if(m_spritesinit != 3) |
| 319 | { |
| 320 | printf("blitter bus write but blitter unselected? %08x %04x\n",offset*2,data); |
| 321 | return; |
| 322 | } |
| 323 | |
| 324 | m_spritesinit = 0; |
| 325 | |
| 317 | 326 | // 0x30000-0x3ffff used, on Spider it's 0x20000-0x2ffff |
| 318 | 327 | offset &= 0x7fff; |
| 319 | 328 | |
| 320 | 329 | UINT8 *src = m_rom8; |
| 321 | 330 | |
| 322 | | if (m_port10 & 2) // NO, wrong for the portraits |
| 331 | if (m_rombank) |
| 323 | 332 | src += 0x100000; |
| 324 | 333 | |
| 325 | 334 | // printf("%06x: spider_blitter_w %08x %04x %04x (previous data width %d address %08x)\n", space.device().safe_pc(), offset * 2, data, mem_mask, m_spriteswidth, m_spritesaddr); |
| r245131 | r245132 | |
| 371 | 380 | AM_RANGE(0x00000, 0xfffff) AM_READWRITE(ttchamp_mem_r, ttchamp_mem_w) |
| 372 | 381 | ADDRESS_MAP_END |
| 373 | 382 | |
| 383 | /* Re-use same parameters as before (one-shot) */ |
| 374 | 384 | READ16_MEMBER(ttchamp_state::port1e_r) |
| 375 | 385 | { |
| 386 | m_spritesinit = 3; |
| 376 | 387 | return 0xff; |
| 377 | 388 | } |
| 378 | 389 | |
| r245131 | r245132 | |
| 401 | 412 | printf("Check me, i/o 0x10 used with %02x\n",res); |
| 402 | 413 | } |
| 403 | 414 | |
| 415 | /* selects upper bank for the blitter */ |
| 404 | 416 | WRITE16_MEMBER(ttchamp_state::port20_w) |
| 405 | 417 | { |
| 406 | 418 | printf("%06x: port20_w %04x %04x\n", space.device().safe_pc(), data, mem_mask); |
| 407 | | // seems to somehow be tied to layer clear |
| 408 | | // might also depend on layer selected with 0x10 tho? written after it |
| 409 | | /*for (int i = 0; i < 0x8000; i++) |
| 410 | | { |
| 411 | | // m_videoram0[i] = 0x0000; |
| 412 | | m_videoram2[i] = 0x0000; |
| 413 | | }*/ |
| 414 | | |
| 419 | m_rombank = 1; |
| 415 | 420 | } |
| 416 | 421 | |
| 422 | /* selects lower bank for the blitter */ |
| 417 | 423 | WRITE16_MEMBER(ttchamp_state::port62_w) |
| 418 | 424 | { |
| 419 | 425 | printf("%06x: port62_w %04x %04x\n", space.device().safe_pc(), data, mem_mask); |
| 426 | m_rombank = 0; |
| 420 | 427 | } |
| 421 | 428 | |
| 422 | 429 | static ADDRESS_MAP_START( ttchamp_io, AS_IO, 16, ttchamp_state ) |
| 423 | | AM_RANGE(0x0000, 0x0001) AM_WRITENOP // startup only |
| 430 | AM_RANGE(0x0000, 0x0001) AM_WRITENOP // startup only, nmi enable? |
| 424 | 431 | |
| 425 | 432 | AM_RANGE(0x0002, 0x0003) AM_READ_PORT("SYSTEM") |
| 426 | 433 | AM_RANGE(0x0004, 0x0005) AM_READ_PORT("P1_P2") |