trunk/src/mame/drivers/popobear.c
| r21839 | r21840 | |
| 6 | 6 | |
| 7 | 7 | TODO: |
| 8 | 8 | - auto-animation speed is erratic (way too fast); |
| 9 | | - tilemap effects (scrolling, colscroll, linescroll); |
| 10 | | (high score table?) |
| 11 | 9 | - BGM seems quite off, YM2413 core bug? |
| 10 | - IRQ generation; |
| 11 | - all possible related to some timers? |
| 12 | |
| 13 | |
| 12 | 14 | - I/Os; |
| 13 | | - IRQ generation; |
| 14 | 15 | - Port 0x620000 is quite a mystery, some silly protection? |
| 15 | 16 | |
| 16 | 17 | ============================================================================================ |
| r21839 | r21840 | |
| 267 | 268 | int width = 8 << ((param & 0x30)>>4); |
| 268 | 269 | int height = width; // sprites are always square? |
| 269 | 270 | |
| 270 | | int color_bank = ((param & 0xc)<<4); |
| 271 | int color_bank = ((param & 0xc)>>2); |
| 271 | 272 | int x_dir = param & 0x40; |
| 272 | 273 | int y_dir = param & 0x80; |
| 273 | 274 | |
| r21839 | r21840 | |
| 290 | 291 | UINT8 pix = (vram[spr_num^1] & 0xff); |
| 291 | 292 | int x_draw = (x_dir) ? x+((width-1) - xi) : x+xi; |
| 292 | 293 | |
| 293 | | if(cliprect.contains(x_draw, y_draw) && pix) |
| 294 | | bitmap.pix16(y_draw, x_draw) = machine().pens[pix+0x100+color_bank]; |
| 294 | if(cliprect.contains(x_draw, y_draw)) |
| 295 | { |
| 296 | // this is a bit strange, pix data is basically 8-bit |
| 297 | // but we have to treat 0x00, 0x20, 0x40, 0x60, 0x80, 0xa0, 0xc0 and 0xe0 as transpens? |
| 298 | // see scores when you colect an item |
| 299 | // granularity also means colour bank is applied *0x40 |
| 300 | // and we have 2 more possible colour bank bits |
| 301 | if (pix&0x1f) |
| 302 | { |
| 303 | bitmap.pix16(y_draw, x_draw) = machine().pens[((pix+(color_bank*0x40))&0xff)+0x100]; |
| 304 | } |
| 305 | } |
| 295 | 306 | |
| 296 | 307 | spr_num++; |
| 297 | 308 | } |
| r21839 | r21840 | |
| 314 | 325 | //popmessage("%04x",m_vregs[0/2]); |
| 315 | 326 | UINT16* vreg = m_vregs; |
| 316 | 327 | |
| 317 | | 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]); |
| 328 | // 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]); |
| 318 | 329 | |
| 330 | // vreg[0x00] also looks like it could be some enable registers |
| 331 | // 0x82ff - BMC logo |
| 332 | // 0x8aff - some attract scenes (no sprites) |
| 333 | // 0x8bff - game attract scense etc. (sprites) |
| 319 | 334 | |
| 335 | // vreg[0x01] is always |
| 336 | // 0xfefb |
| 320 | 337 | |
| 338 | |
| 339 | |
| 321 | 340 | // these are more than just enable, they get written with 0x0d and 0x1f (and 0x00 when a layer is off) |
| 322 | 341 | // seems to be related to the linescroll mode at least? maybe sizes? |
| 323 | 342 | int enable0 = (m_vregs[0x0c] & 0xff00)>>8; |
| r21839 | r21840 | |
| 327 | 346 | |
| 328 | 347 | if ((enable0 != 0x00) && (enable0 != 0x0d) && (enable0 != 0x1f)) printf("unknown enable0 value %02x\n", enable0); |
| 329 | 348 | if ((enable1 != 0x00) && (enable1 != 0x0d) && (enable1 != 0x1f)) printf("unknown enable1 value %02x\n", enable1); |
| 330 | | if ((enable2 != 0x00) && (enable2 != 0x0d) && (enable2 != 0x1f)) printf("unknown enable2 value %02x\n", enable2); |
| 331 | | if ((enable3 != 0x00) && (enable3 != 0x0d) && (enable3 != 0x1f)) printf("unknown enable3 value %02x\n", enable3); |
| 349 | if ((enable2 != 0x00) && (enable2 != 0x0d)) printf("unknown enable2 value %02x\n", enable2); |
| 350 | if ((enable3 != 0x00) && (enable3 != 0x0d)) printf("unknown enable3 value %02x\n", enable3); |
| 332 | 351 | |
| 333 | 352 | |
| 334 | 353 | // the lower 2 tilemaps use regular scrolling |
| r21839 | r21840 | |
| 574 | 593 | m_maincpu->set_input_line(5, ASSERT_LINE); |
| 575 | 594 | |
| 576 | 595 | /* TODO: actually a timer irq, tied with YM2413 sound chip (controls BGM tempo) */ |
| 596 | /* the YM2413 doesn't have interrupts? */ |
| 577 | 597 | if(scanline == 64 || scanline == 192) |
| 578 | 598 | m_maincpu->set_input_line(2, ASSERT_LINE); |
| 579 | 599 | } |