trunk/src/mess/drivers/casloopy.c
| r21615 | r21616 | |
| 184 | 184 | }; |
| 185 | 185 | |
| 186 | 186 | |
| 187 | | static const gfx_layout casloopy_tile_layout = |
| 187 | static const gfx_layout casloopy_4bpp_layout = |
| 188 | 188 | { |
| 189 | 189 | 8,8, |
| 190 | 190 | 0x10000/32, |
| 191 | 191 | 4, |
| 192 | | { 0, 1, 2, 3 }, |
| 192 | { STEP4(0, 1) }, |
| 193 | 193 | { STEP8(0, 4) }, |
| 194 | 194 | { STEP8(0, 4*8) }, |
| 195 | 195 | 4*8*8 |
| 196 | 196 | }; |
| 197 | 197 | |
| 198 | static const gfx_layout casloopy_8bpp_layout = |
| 199 | { |
| 200 | 8,8, |
| 201 | 0x10000/64, |
| 202 | 8, |
| 203 | { STEP8(0, 1) }, |
| 204 | { STEP8(0, 8) }, |
| 205 | { STEP8(0, 8*8) }, |
| 206 | 8*8*8 |
| 207 | }; |
| 208 | |
| 198 | 209 | void casloopy_state::video_start() |
| 199 | 210 | { |
| 200 | 211 | /* TODO: proper sizes */ |
| r21615 | r21616 | |
| 206 | 217 | if (machine().gfx[m_gfx_index] == 0) |
| 207 | 218 | break; |
| 208 | 219 | |
| 209 | | machine().gfx[m_gfx_index] = auto_alloc(machine(), gfx_element(machine(), casloopy_tile_layout, m_vram, 0x10, 0)); |
| 220 | machine().gfx[m_gfx_index] = auto_alloc(machine(), gfx_element(machine(), casloopy_4bpp_layout, m_vram, 0x10, 0)); |
| 221 | machine().gfx[m_gfx_index+1] = auto_alloc(machine(), gfx_element(machine(), casloopy_8bpp_layout, m_vram, 0x10, 0)); |
| 222 | |
| 210 | 223 | } |
| 211 | 224 | |
| 212 | 225 | UINT32 casloopy_state::screen_update_casloopy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| r21615 | r21616 | |
| 251 | 264 | |
| 252 | 265 | pix = m_bitmap_vram[count]; |
| 253 | 266 | if(pix) |
| 254 | | bitmap.pix16(y, x) = pix; |
| 267 | bitmap.pix16(y, x) = pix + 0x100; |
| 255 | 268 | |
| 256 | 269 | count++; |
| 257 | 270 | } |
| r21615 | r21616 | |
| 270 | 283 | if(offset == 2/2) |
| 271 | 284 | return machine().rand();/*(machine().primary_screen->hblank() << 8) | (machine().primary_screen->hpos() & 0xff);*/ // hblank + hpos? |
| 272 | 285 | |
| 286 | if(offset == 0/2) |
| 287 | return machine().rand(); // pccllect |
| 288 | |
| 273 | 289 | printf("%08x\n",offset*2); |
| 274 | 290 | |
| 275 | 291 | return 0xffff; |
| r21615 | r21616 | |
| 308 | 324 | m_vram[offset] = data; |
| 309 | 325 | |
| 310 | 326 | machine().gfx[m_gfx_index]->mark_dirty(offset/32); |
| 327 | machine().gfx[m_gfx_index+1]->mark_dirty(offset/64); |
| 311 | 328 | } |
| 312 | 329 | |
| 313 | 330 | /* TODO: all of this should be internal to the SH core, this is just to check what it enables. */ |
| r21615 | r21616 | |
| 329 | 346 | size = (sh7021_regs[0x4a/2]&0xffff); |
| 330 | 347 | type = (sh7021_regs[0x4e/2]&0xffff); |
| 331 | 348 | |
| 332 | | printf("%08x %08x %04x %04x\n",src & 0x7ffffff,dst & 0x7ffffff,size,type); |
| 349 | printf("0 %08x %08x %04x %04x\n",src & 0x7ffffff,dst & 0x7ffffff,size,type); |
| 333 | 350 | |
| 334 | 351 | sh7021_regs[0x4e/2]&=0xfffe; |
| 335 | 352 | } |
| 336 | 353 | |
| 354 | if(offset == 0x7e/2) |
| 355 | { |
| 356 | UINT32 src,dst,size,type; |
| 357 | |
| 358 | src = (sh7021_regs[0x70/2]<<16)|(sh7021_regs[0x72/2]&0xffff); |
| 359 | dst = (sh7021_regs[0x74/2]<<16)|(sh7021_regs[0x76/2]&0xffff); |
| 360 | size = (sh7021_regs[0x7a/2]&0xffff); |
| 361 | type = (sh7021_regs[0x7e/2]&0xffff); |
| 362 | |
| 363 | printf("%08x %08x %04x %04x\n",src & 0x7ffffff,dst & 0x7ffffff,size,type); |
| 364 | |
| 365 | sh7021_regs[0x7e/2]&=0xfffe; |
| 366 | } |
| 367 | |
| 337 | 368 | // printf("%08x %04x\n",sh7021_regs[offset],0x05ffff00+offset*2); |
| 338 | 369 | } |
| 339 | 370 | |