trunk/src/mame/drivers/gunpey.c
| r21525 | r21526 | |
| 240 | 240 | UINT8 *vram = memregion("vram")->base(); |
| 241 | 241 | |
| 242 | 242 | // +0 +1 +2 +3 +4 +5 +6 +7 |
| 243 | | // cccc cccc e--b b--- | xxxx ---- u--- ---- | yyyy yy-- --XX XXXX | nnnn nnnn ---Y YYYY | mmmm mmmm -MMM -NNN | hhhh hhhh wwww wwww | ---- ---- ---- ---- | ---- ---- ---- ---- | |
| 243 | // cccc cccc e--b b--- | xxxx ---- u--- ---- | yyyy yy-- --XX XXXX | nnnn nnnn ---Y YYYY | mmmm mmmm -MMM -NNN | hhhh hhhh wwww wwww | ---- ---- oooo oooo | pppp pppp ---- ---- | |
| 244 | 244 | |
| 245 | 245 | // c = color palette |
| 246 | 246 | // e = END marker |
| r21525 | r21526 | |
| 256 | 256 | // h = height |
| 257 | 257 | // w = width |
| 258 | 258 | // u = unknown, set on text, maybe 'solid' ? |
| 259 | // o = zoom width |
| 260 | // p = zoom height |
| 261 | const int debug = 0; |
| 259 | 262 | |
| 260 | | |
| 261 | 263 | if(!(m_wram[count+0] & 1)) |
| 262 | 264 | { |
| 263 | 265 | x = (m_wram[count+3] >> 8) | ((m_wram[count+4] & 0x03) << 8); |
| r21525 | r21526 | |
| 270 | 272 | x-=0x160; |
| 271 | 273 | y-=0x188; |
| 272 | 274 | |
| 275 | UINT8 zoomwidth = (m_wram[count+6] & 0xff); |
| 276 | UINT8 zoomheight = (m_wram[count+7] >> 8); |
| 277 | |
| 273 | 278 | //UINT32 col = 0xffffff; |
| 274 | 279 | // UINT32 val = (m_wram[count+1] << 16) | ((m_wram[count+2])); |
| 275 | 280 | int xsource = ((m_wram[count+2] & 0x003f) << 4) | ((m_wram[count+1] & 0xf000) >> 12); |
| r21525 | r21526 | |
| 284 | 289 | UINT8 testhack = vram[((((ysource+0)&0x7ff)*0x800) + ((xsource+0)&0x7ff))]; |
| 285 | 290 | UINT8 testhack2 = vram[((((ysource+0)&0x7ff)*0x800) + ((xsource+1)&0x7ff))]; |
| 286 | 291 | |
| 287 | | //if (m_wram[count+1] & 0x0080) // set on text |
| 288 | | // color = machine.rand()&0xf; |
| 292 | if (m_wram[count+1] & 0x0010) |
| 293 | color = machine.rand()&0xf; |
| 289 | 294 | |
| 290 | 295 | |
| 291 | 296 | |
| 292 | 297 | |
| 298 | UINT16 unused; |
| 299 | if (debug) printf("sprite %04x %04x %04x %04x %04x %04x %04x %04x\n", m_wram[count+0], m_wram[count+1], m_wram[count+2], m_wram[count+3], m_wram[count+4], m_wram[count+5], m_wram[count+6], m_wram[count+7]); |
| 300 | |
| 301 | unused = m_wram[count+0]&~0xff98; if (unused) printf("unused bits set in word 0 - %04x\n", unused); |
| 302 | unused = m_wram[count+1]&~0xf080; if (unused) printf("unused bits set in word 1 - %04x\n", unused); |
| 303 | unused = m_wram[count+2]&~0xfc3f; if (unused) printf("unused bits set in word 2 - %04x\n", unused); |
| 304 | unused = m_wram[count+3]&~0xff1f; if (unused) printf("unused bits set in word 3 - %04x\n", unused); |
| 305 | unused = m_wram[count+4]&~0xff77; if (unused) printf("unused bits set in word 4 - %04x\n", unused); |
| 306 | unused = m_wram[count+5]&~0xffff; if (unused) printf("unused bits set in word 5 - %04x\n", unused); |
| 307 | unused = m_wram[count+6]&~0x00ff; if (unused) printf("unused bits set in word 6 - %04x\n", unused); |
| 308 | unused = m_wram[count+7]&~0xff00; if (unused) printf("unused bits set in word 7 - %04x\n", unused); |
| 309 | |
| 310 | if ((zoomwidth != width) || (zoomheight!= height)) |
| 311 | { |
| 312 | printf("zoomed widths %02x %02x heights %02x %02x\n", width, zoomwidth, height, zoomheight); |
| 313 | } |
| 293 | 314 | |
| 294 | | printf("sprite %04x %04x %04x %04x %04x %04x %04x %04x\n", m_wram[count+0], m_wram[count+1], m_wram[count+2], m_wram[count+3], m_wram[count+4], m_wram[count+5], m_wram[count+6], m_wram[count+7]); |
| 295 | | printf("unused %04x %04x %04x %04x %04x %04x %04x %04x\n\n", m_wram[count+0]&~0xff98, m_wram[count+1]&~0xf080, m_wram[count+2]&~0xfc3f, m_wram[count+3]&~0xff1f, m_wram[count+4]&~0xff77, m_wram[count+5]&~0xffff, m_wram[count+6]&~0x0000, m_wram[count+7]&~0x0000); |
| 296 | 315 | |
| 316 | |
| 297 | 317 | if ((testhack2 & 0x0f) == 0x08) |
| 298 | 318 | return m_wram[count+0] & 0x80; |
| 299 | 319 | |
| 300 | | printf("testhack1 %02x %02x\n", testhack, testhack2); |
| 320 | if (debug) printf("testhack1 %02x %02x\n", testhack, testhack2); |
| 301 | 321 | |
| 302 | 322 | if(bpp_sel == 0x00) // 4bpp |
| 303 | 323 | { |
| r21525 | r21526 | |
| 691 | 711 | |
| 692 | 712 | if(scanline == 224) |
| 693 | 713 | { |
| 694 | | printf("frame\n"); |
| 714 | //printf("frame\n"); |
| 695 | 715 | gunpey_irq_check(0x50); |
| 696 | 716 | } |
| 697 | 717 | } |