src/mess/drivers/supracan.c
| r6874 | r6875 | |
| 30 | 30 | static UINT16 *supracan_soundram_16; |
| 31 | 31 | static UINT16 supracan_video_regs[256]; |
| 32 | 32 | static emu_timer *supracan_video_timer; |
| 33 | | static UINT16 *supracan_charram; |
| 34 | 33 | static UINT16 *supracan_vram; |
| 35 | | static UINT16 *supracan_rram; |
| 36 | | static UINT16 *supracan_rozpal; |
| 37 | 34 | |
| 38 | 35 | static READ16_HANDLER( supracan_unk1_r ); |
| 39 | 36 | static WRITE16_HANDLER( supracan_soundram_w ); |
| r6874 | r6875 | |
| 68 | 65 | |
| 69 | 66 | } |
| 70 | 67 | |
| 68 | /* FIXME: vram is currently hardcoded, but there's an high chance it's tied to some video registers */ |
| 71 | 69 | static VIDEO_UPDATE( supracan ) |
| 72 | 70 | { |
| 73 | 71 | int x,y,count; |
| 74 | 72 | const gfx_element *gfx = screen->machine->gfx[0]; |
| 75 | 73 | |
| 76 | | count = 0; |
| 74 | bitmap_fill(bitmap, cliprect, 0); |
| 77 | 75 | |
| 76 | count = 0x4400/2; |
| 77 | |
| 78 | 78 | for (y=0;y<64;y++) |
| 79 | 79 | { |
| 80 | 80 | for (x=0;x<32;x += 8) |
| r6874 | r6875 | |
| 82 | 82 | static UINT16 dot_data; |
| 83 | 83 | |
| 84 | 84 | /* FIXME: likely to be clutted */ |
| 85 | | dot_data = supracan_rram[count] ^ 0xffff; |
| 85 | dot_data = supracan_vram[count] ^ 0xffff; |
| 86 | 86 | |
| 87 | 87 | *BITMAP_ADDR16(bitmap, y, 128+x+0) = ((dot_data >> 14) & 0x0003) + 0x20; |
| 88 | 88 | *BITMAP_ADDR16(bitmap, y, 128+x+1) = ((dot_data >> 12) & 0x0003) + 0x20; |
| r6874 | r6875 | |
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | | count = 0; |
| 99 | count = 0x4200/2; |
| 100 | 100 | |
| 101 | 101 | for (y=0;y<16;y++) |
| 102 | 102 | { |
| r6874 | r6875 | |
| 110 | 110 | } |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | { |
| 114 | int x,y,spr_offs,col,i,spr_base; |
| 115 | |
| 116 | spr_base = 0x1d000; |
| 117 | |
| 118 | for(i=spr_base/2;i<(spr_base+0x100)/2;i+=4) |
| 119 | { |
| 120 | y = supracan_vram[i+0] & 0xff; |
| 121 | x = supracan_vram[i+3] & 0xff; |
| 122 | spr_offs = supracan_vram[i+2] & 0x1ff;; |
| 123 | col = (supracan_vram[i+1] & 0x000f); |
| 124 | |
| 125 | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],spr_offs,col,0,0,x,y,0); |
| 126 | } |
| 127 | } |
| 128 | |
| 113 | 129 | return 0; |
| 114 | 130 | } |
| 115 | 131 | |
| r6874 | r6875 | |
| 216 | 232 | AM_RANGE( 0xe90020, 0xe9002b ) AM_WRITE( supracan_dma_w ) |
| 217 | 233 | AM_RANGE( 0xf00000, 0xf001ff ) AM_READWRITE( supracan_video_r, supracan_video_w ) |
| 218 | 234 | AM_RANGE( 0xf00200, 0xf003ff ) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE_GENERIC(paletteram) |
| 219 | | AM_RANGE( 0xf40000, 0xf43fff ) AM_RAM_WRITE(supracan_char_w) AM_BASE(&supracan_charram) /* Unknown, some data gets copied here during boot */ |
| 220 | | AM_RANGE( 0xf44000, 0xf441ff ) AM_RAM AM_BASE(&supracan_rozpal) /* Unknown */ |
| 221 | | AM_RANGE( 0xf44200, 0xf443ff ) AM_RAM AM_BASE(&supracan_vram) /* Foreground tilemap layer */ |
| 222 | | AM_RANGE( 0xf44400, 0xf445ff ) AM_RAM AM_BASE(&supracan_rram) /* ROZ layer tiles */ |
| 223 | | AM_RANGE( 0xf44600, 0xf44fff ) AM_RAM /* Unknown, stuff gets written here. Zoom table?? */ |
| 224 | | AM_RANGE( 0xf48000, 0xf4ffff ) AM_RAM /* more character data */ |
| 225 | | AM_RANGE( 0xf5d000, 0xf5d0ff ) AM_RAM |
| 235 | AM_RANGE( 0xf40000, 0xf5ffff ) AM_RAM_WRITE(supracan_char_w) AM_BASE(&supracan_vram) /* Unknown, some data gets copied here during boot */ |
| 236 | // AM_RANGE( 0xf44000, 0xf441ff ) AM_RAM AM_BASE(&supracan_rozpal) /* clut data for the ROZ? */ |
| 237 | // AM_RANGE( 0xf44600, 0xf44fff ) AM_RAM /* Unknown, stuff gets written here. Zoom table?? */ |
| 226 | 238 | AM_RANGE( 0xfc0000, 0xfcffff ) AM_RAM /* System work ram */ |
| 227 | 239 | AM_RANGE( 0xff8000, 0xffffff ) AM_RAM /* System work ram */ |
| 228 | 240 | ADDRESS_MAP_END |
| r6874 | r6875 | |
| 235 | 247 | |
| 236 | 248 | static WRITE16_HANDLER( supracan_char_w ) |
| 237 | 249 | { |
| 238 | | COMBINE_DATA(&supracan_charram[offset]); |
| 250 | COMBINE_DATA(&supracan_vram[offset]); |
| 239 | 251 | |
| 240 | 252 | { |
| 241 | 253 | UINT8 *gfx = memory_region(space->machine, "ram_gfx"); |
| 242 | 254 | |
| 243 | | gfx[offset*2+0] = (supracan_charram[offset] & 0xff00) >> 8; |
| 244 | | gfx[offset*2+1] = (supracan_charram[offset] & 0x00ff) >> 0; |
| 255 | gfx[offset*2+0] = (supracan_vram[offset] & 0xff00) >> 8; |
| 256 | gfx[offset*2+1] = (supracan_vram[offset] & 0x00ff) >> 0; |
| 245 | 257 | |
| 246 | 258 | gfx_element_mark_dirty(space->machine->gfx[0], offset/32); |
| 247 | 259 | gfx_element_mark_dirty(space->machine->gfx[1], offset/16); |
| r6874 | r6875 | |
| 382 | 394 | acan_sprdma_regs.count = data; |
| 383 | 395 | break; |
| 384 | 396 | case 0x1e/2: |
| 385 | | //if(data != 0xa000) |
| 386 | 397 | //printf("%08x %08x %04x %04x\n",acan_sprdma_regs.src,acan_sprdma_regs.dst,acan_sprdma_regs.count,data); |
| 387 | 398 | if(data & 0xa000) //0x2000 selects dword transfer? |
| 388 | 399 | { |
| r6874 | r6875 | |
| 390 | 401 | { |
| 391 | 402 | if(data & 0x0100) //dma 0x00 fill (or fixed value?) |
| 392 | 403 | { |
| 393 | | memory_write_dword(space, acan_sprdma_regs.dst, 0x00000000); |
| 404 | memory_write_dword(space, acan_sprdma_regs.dst, 0); |
| 394 | 405 | acan_sprdma_regs.dst+=4; |
| 395 | 406 | } |
| 396 | 407 | else |
| r6874 | r6875 | |
| 506 | 517 | ROM_START( supracan ) |
| 507 | 518 | ROM_REGION( 0x80000, "cart", ROMREGION_ERASEFF ) |
| 508 | 519 | |
| 509 | | ROM_REGION( 0x4000, "ram_gfx", ROMREGION_ERASEFF ) |
| 520 | ROM_REGION( 0x20000, "ram_gfx", ROMREGION_ERASEFF ) |
| 510 | 521 | |
| 511 | 522 | // ROM_REGION( 0x8000, "spr_gfx", ROMREGION_ERASEFF ) |
| 512 | 523 | |