src/mess/drivers/mz2500.c
| r8955 | r8956 | |
| 240 | 240 | UINT8 *vram = memory_region(machine, "maincpu"); |
| 241 | 241 | UINT8 pen,pen_bit[4]; |
| 242 | 242 | int x,y,xi,pen_i; |
| 243 | UINT32 wa_reg; |
| 244 | UINT8 s_x; |
| 243 | 245 | |
| 244 | | count = 0x40000 + (plane * 0x2000); |
| 246 | count = (cg_reg[0x10]) | ((cg_reg[0x11] & 0x3f) << 8); |
| 247 | wa_reg = (cg_reg[0x12]) | ((cg_reg[0x13] & 0x3f) << 8); |
| 248 | /* TODO: layer 2 scrolling */ |
| 249 | s_x = (cg_reg[0x0f] & 0xf); |
| 245 | 250 | |
| 246 | 251 | for(y=0;y<200;y++) |
| 247 | 252 | { |
| r8955 | r8956 | |
| 249 | 254 | { |
| 250 | 255 | for(xi=0;xi<8;xi++) |
| 251 | 256 | { |
| 252 | | pen_bit[0] = (vram[count+0x0000]>>(xi)) & 1 ? 1 : 0; //B |
| 253 | | pen_bit[1] = (vram[count+0x4000]>>(xi)) & 1 ? 2 : 0; //R |
| 254 | | pen_bit[2] = (vram[count+0x8000]>>(xi)) & 1 ? 4 : 0; //G |
| 255 | | pen_bit[3] = (vram[count+0xc000]>>(xi)) & 1 ? 8 : 0; //I |
| 257 | pen_bit[0] = (vram[count+0x40000+(plane * 0x2000)]>>(xi)) & 1 ? 1 : 0; //B |
| 258 | pen_bit[1] = (vram[count+0x44000+(plane * 0x2000)]>>(xi)) & 1 ? 2 : 0; //R |
| 259 | pen_bit[2] = (vram[count+0x48000+(plane * 0x2000)]>>(xi)) & 1 ? 4 : 0; //G |
| 260 | pen_bit[3] = (vram[count+0x4c000+(plane * 0x2000)]>>(xi)) & 1 ? 8 : 0; //I |
| 256 | 261 | |
| 257 | 262 | pen = 0; |
| 258 | 263 | for(pen_i=0;pen_i<4;pen_i++) |
| 259 | 264 | pen |= pen_bit[pen_i]; |
| 260 | 265 | |
| 261 | 266 | if(pen != 0 || clut16[pen] & 0x10) |
| 262 | | *BITMAP_ADDR16(bitmap, y, x+xi) = machine->pens[(clut16[pen] & 0x0f)+0x200]; |
| 267 | *BITMAP_ADDR16(bitmap, y, x+xi+s_x) = machine->pens[(clut16[pen] & 0x0f)+0x200]; |
| 263 | 268 | } |
| 264 | 269 | count++; |
| 270 | count&=0x3fff; |
| 271 | if(count > wa_reg) |
| 272 | count = 0; |
| 265 | 273 | } |
| 266 | 274 | } |
| 267 | 275 | } |
| r8955 | r8956 | |
| 333 | 341 | draw_tv_screen(screen->machine,bitmap,cliprect); |
| 334 | 342 | draw_cg_screen(screen->machine,bitmap,cliprect); |
| 335 | 343 | //draw_tv_screen(screen->machine,bitmap,cliprect); |
| 344 | popmessage("%02x (%02x %02x) (%02x %02x) (%02x %02x) (%02x %02x)",cg_reg[0x0f],cg_reg[0x10],cg_reg[0x11],cg_reg[0x12],cg_reg[0x13],cg_reg[0x14],cg_reg[0x15],cg_reg[0x16],cg_reg[0x17]); |
| 336 | 345 | } |
| 337 | 346 | else //4096 mode colors |
| 338 | 347 | { |
| r8955 | r8956 | |
| 880 | 889 | hs = (cg_reg[0x0c] & 0x7f)*8; |
| 881 | 890 | he = (cg_reg[0x0d] & 0x7f)*8; |
| 882 | 891 | |
| 883 | | // popmessage("%d %d %d %d %02x",vs,ve,hs,he,cg_reg[0x0e]); |
| 892 | popmessage("%d %d %d %d %02x",vs,ve,hs,he,cg_reg[0x0e]); |
| 884 | 893 | |
| 885 | 894 | space->machine->primary_screen->configure(720, 480, visarea, space->machine->primary_screen->frame_period().attoseconds); //TODO |
| 886 | 895 | } |
| r8955 | r8956 | |
| 1282 | 1291 | |
| 1283 | 1292 | static READ8_DEVICE_HANDLER( mz2500_portb_r ) |
| 1284 | 1293 | { |
| 1285 | | return 0xff; |
| 1294 | static UINT8 vblank_bit; |
| 1295 | |
| 1296 | vblank_bit = device->machine->primary_screen->vblank() ? 0 : 1; //Guess: NOBO wants this bit to be high/low |
| 1297 | |
| 1298 | return 0xfe | vblank_bit; |
| 1286 | 1299 | } |
| 1287 | 1300 | |
| 1288 | 1301 | static READ8_DEVICE_HANDLER( mz2500_portc_r ) |