trunk/src/mame/drivers/popobear.c
| r21834 | r21835 | |
| 87 | 87 | m_maincpu(*this,"maincpu"), |
| 88 | 88 | m_spr(*this, "spr"), |
| 89 | 89 | m_vregs(*this, "vregs") |
| 90 | | |
| 91 | | { |
| 90 | |
| 91 | { |
| 92 | 92 | tilemap_base[0] = 0xf0000; |
| 93 | 93 | tilemap_base[1] = 0xf4000; |
| 94 | 94 | tilemap_base[2] = 0xf8000; |
| r21834 | r21835 | |
| 97 | 97 | tilemap_size[0] = 0x04000; |
| 98 | 98 | tilemap_size[1] = 0x04000; |
| 99 | 99 | tilemap_size[2] = 0x04000; |
| 100 | | tilemap_size[3] = 0x04000; |
| 100 | tilemap_size[3] = 0x04000; |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | required_device<cpu_device> m_maincpu; |
| r21834 | r21835 | |
| 130 | 130 | |
| 131 | 131 | // the graphic data for the tiles is in a strange order, rearrange it so that we can use it as tiles.. |
| 132 | 132 | int swapped_offset = BITSWAP32(offset, /* unused bits */ 31,30,29,28,27,26,25,24,23,22,21,20,19, /* end unused bits */ |
| 133 | | |
| 133 | |
| 134 | 134 | 18,17,16,15,14,13,12, |
| 135 | | |
| 135 | |
| 136 | 136 | 8,7,6,5,4,3,2, |
| 137 | 137 | |
| 138 | 138 | 11,10,9, /* y tile address bits */ |
| 139 | | |
| 139 | |
| 140 | 140 | 1,0 /* x tile address bits */); |
| 141 | 141 | |
| 142 | 142 | |
| r21834 | r21835 | |
| 302 | 302 | UINT16* vreg = m_vregs; |
| 303 | 303 | |
| 304 | 304 | popmessage("%04x %04x %04x %04x %04x %04x %04x - %04x - %04x %04x",vreg[0x00],vreg[0x01],vreg[0x02],vreg[0x03],vreg[0x04],vreg[0x05],vreg[0x06], vreg[0x0b],vreg[0x0e],vreg[0x0f]); |
| 305 | | |
| 306 | 305 | |
| 307 | 306 | |
| 307 | |
| 308 | 308 | // these are more than just enable, they get written with 0x0d and 0x1f (and 0x00 when a layer is off) |
| 309 | 309 | // seems to be related to the linescroll mode at least? maybe sizes? |
| 310 | 310 | int enable0 = (m_vregs[0x0c] & 0xff00)>>8; |
| r21834 | r21835 | |
| 343 | 343 | clip.min_y = clip.max_y = line; |
| 344 | 344 | |
| 345 | 345 | m_bg_tilemap[1]->set_scrollx(0,(val&0x00ff) | (upper << 8)); |
| 346 | | m_bg_tilemap[1]->set_scrolly((0,(val&0xff00)>>8)-line); |
| 346 | m_bg_tilemap[1]->set_scrolly(0,((val&0xff00)>>8)-line); |
| 347 | 347 | |
| 348 | 348 | m_bg_tilemap[1]->draw(bitmap, clip, 0, 0); |
| 349 | 349 | } |
| r21834 | r21835 | |
| 368 | 368 | clip.min_y = clip.max_y = line; |
| 369 | 369 | |
| 370 | 370 | m_bg_tilemap[0]->set_scrollx(0,(val&0x00ff) | (upper << 8)); |
| 371 | | m_bg_tilemap[0]->set_scrolly((0,(val&0xff00)>>8)-line); |
| 371 | m_bg_tilemap[0]->set_scrolly(0,((val&0xff00)>>8)-line); |
| 372 | 372 | |
| 373 | 373 | m_bg_tilemap[0]->draw(bitmap, clip, 0, 0); |
| 374 | 374 | } |
| r21834 | r21835 | |
| 408 | 408 | AM_RANGE(0x210000, 0x21ffff) AM_RAM |
| 409 | 409 | AM_RANGE(0x280000, 0x2fffff) AM_RAM AM_SHARE("spr") // unknown boundaries, 0x2ff800 contains a sprite list, lower area = sprite gfx |
| 410 | 410 | AM_RANGE(0x300000, 0x3fffff) AM_READWRITE( popo_vram_r, popo_vram_w ) // tile definitions + tilemaps |
| 411 | | |
| 412 | 411 | |
| 412 | |
| 413 | 413 | /* Most if not all of these are vregs */ |
| 414 | 414 | AM_RANGE(0x480000, 0x48001f) AM_RAM AM_SHARE("vregs") |
| 415 | 415 | AM_RANGE(0x480020, 0x480023) AM_RAM |