src/mess/drivers/pc8801.c
| r10097 | r10098 | |
| 26 | 26 | - Acro Jet: hangs waiting for an irq; |
| 27 | 27 | - Aggress: crashes after that it shows the title screen; |
| 28 | 28 | - American Success: reads the light pen? |
| 29 | | - Alphos: test case for text VRAM attributes; |
| 29 | - Alpha (demo): crashes with "illegal function" msg; |
| 30 | 30 | - Alphos: text VRAM garbage during gameplay; |
| 31 | 31 | - Balance of Power: attempt to use the SIO port for mouse polling, worked around for now; |
| 32 | 32 | - Battle Entry: moans with a kanji msg then dies if you try to press either numpad 1 or 2 (what it basically asks by looking at the DASM) |
| 33 | 33 | - Bersekers Front Gaiden 3: checks CPU speed port and polls the PCG stuff too; |
| 34 | 34 | - Bishoujo Baseball Gakuen: checks ym2608 after intro screen; |
| 35 | - Blue Moon Story: moans with a kanji msg;. |
| 35 | 36 | - Bokosuka Wars: doesn't boot, floppy issue; |
| 37 | - Bouken Roman: doesn't boot, floppy issue; |
| 38 | - Bruce Lee: doesn't boot, floppy issue; |
| 39 | - Bu U Ma: sets gfx compatibility mode (attr bit 4,N-BASIC), dunno how to draw with it ...; |
| 36 | 40 | - Grobda: palette is ugly; |
| 37 | 41 | - Wanderers from Ys: floppy / irq issues? |
| 38 | 42 | - Xevious: game is too fast |
| r10097 | r10098 | |
| 314 | 318 | |
| 315 | 319 | |
| 316 | 320 | |
| 317 | | static UINT8 extract_text_attribute(running_machine *machine,UINT32 address,int x,int swap) |
| 321 | static UINT8 extract_text_attribute(running_machine *machine,UINT32 address,int x) |
| 318 | 322 | { |
| 319 | 323 | UINT8 *vram = machine->region("maincpu")->base() + WRAM_BASE; |
| 320 | 324 | int i; |
| r10097 | r10098 | |
| 330 | 334 | |
| 331 | 335 | for(i=0;i<fifo_size;i++) |
| 332 | 336 | { |
| 333 | | /* TODO: do we have a bug lying to somewhere else? N-BASIC attributes doesn't work without this +2 ... */ |
| 334 | | if(x < vram[address+swap]) |
| 337 | /* TODO: DMA timing bug? N-BASIC attributes doesn't work here without +2 here ... */ |
| 338 | if(x < vram[address]) |
| 335 | 339 | { |
| 336 | 340 | return vram[address+1]; |
| 337 | 341 | } |
| r10097 | r10098 | |
| 352 | 356 | UINT8 attr; |
| 353 | 357 | UINT8 reverse; |
| 354 | 358 | UINT8 pal; |
| 359 | UINT8 gfx_mode; |
| 355 | 360 | |
| 356 | 361 | y_height = y_size == 20 ? 10 : 8; |
| 357 | 362 | |
| r10097 | r10098 | |
| 359 | 364 | { |
| 360 | 365 | for(x=0;x<80;x++) |
| 361 | 366 | { |
| 362 | | attr = extract_text_attribute(machine,(((y*120)+80+dma_address[2]) & 0xffff),(x),0); |
| 367 | attr = extract_text_attribute(machine,(((y*120)+80+dma_address[2]) & 0xffff),(x)); |
| 363 | 368 | |
| 364 | 369 | if(text_color_flag) |
| 370 | { |
| 365 | 371 | pal = (attr & 0xe0) >> 5; |
| 372 | gfx_mode = (attr & 0x10) >> 4; |
| 373 | } |
| 366 | 374 | else |
| 375 | { |
| 367 | 376 | pal = 7; |
| 377 | reverse = attr & 4; |
| 378 | } |
| 368 | 379 | |
| 369 | | reverse = attr & 4; |
| 380 | pal|=8; //text pal bank |
| 370 | 381 | |
| 371 | 382 | for(yi=0;yi<8;yi++) |
| 372 | 383 | { |
| r10097 | r10098 | |
| 377 | 388 | int res_x,res_y; |
| 378 | 389 | int tile; |
| 379 | 390 | int color; |
| 380 | | UINT8 *gfx_data = machine->region("gfx1")->base(); |
| 381 | 391 | |
| 382 | | tile = vram[x+(y*120)+dma_address[2]]; |
| 392 | { |
| 393 | UINT8 *gfx_data = machine->region("gfx1")->base(); |
| 383 | 394 | |
| 384 | | res_x = x*8+xi; |
| 385 | | res_y = y*y_height+yi; |
| 395 | tile = vram[x+(y*120)+dma_address[2]]; |
| 386 | 396 | |
| 387 | | if(is_cursor || reverse) |
| 388 | | color = ((gfx_data[tile*8+yi] >> (7-xi)) & 1) ? -1 : pal; |
| 389 | | else |
| 390 | | color = ((gfx_data[tile*8+yi] >> (7-xi)) & 1) ? pal : -1; |
| 397 | res_x = x*8+xi; |
| 398 | res_y = y*y_height+yi; |
| 391 | 399 | |
| 392 | | if((res_x)<=machine->primary_screen->visible_area().max_x && (res_y)<=machine->primary_screen->visible_area().max_y) |
| 393 | | if(color != -1) |
| 394 | | *BITMAP_ADDR16(bitmap, res_y, res_x) = machine->pens[color]; |
| 400 | if(is_cursor || reverse) |
| 401 | color = ((gfx_data[tile*8+yi] >> (7-xi)) & 1) ? -1 : pal; |
| 402 | else |
| 403 | color = ((gfx_data[tile*8+yi] >> (7-xi)) & 1) ? pal : -1; |
| 404 | |
| 405 | if((res_x)<=machine->primary_screen->visible_area().max_x && (res_y)<=machine->primary_screen->visible_area().max_y) |
| 406 | if(color != -1) |
| 407 | *BITMAP_ADDR16(bitmap, res_y, res_x) = machine->pens[color]; |
| 408 | } |
| 395 | 409 | } |
| 396 | 410 | } |
| 397 | 411 | } |
| r10097 | r10098 | |
| 407 | 421 | UINT8 y_height; |
| 408 | 422 | UINT8 attr; |
| 409 | 423 | UINT8 reverse; |
| 424 | UINT8 pal; |
| 410 | 425 | |
| 411 | 426 | y_height = y_size == 20 ? 10 : 8; |
| 412 | 427 | |
| r10097 | r10098 | |
| 417 | 432 | if(x & 1) |
| 418 | 433 | continue; |
| 419 | 434 | |
| 420 | | attr = extract_text_attribute(machine,(((y*120)+80+dma_address[2]) & 0xffff),(x),2); |
| 435 | attr = extract_text_attribute(machine,(((y*120)+80+dma_address[2]) & 0xffff),(x)); |
| 421 | 436 | |
| 437 | if(text_color_flag) |
| 438 | pal = (attr & 0xe0) >> 5; |
| 439 | else |
| 440 | pal = 7; |
| 441 | |
| 442 | pal|=8; //text pal bank |
| 443 | |
| 422 | 444 | reverse = attr & 4; |
| 423 | 445 | |
| 424 | 446 | for(yi=0;yi<8;yi++) |
| r10097 | r10098 | |
| 438 | 460 | res_y = (y*y_height)+yi; |
| 439 | 461 | |
| 440 | 462 | if(is_cursor || reverse) |
| 441 | | color = ((gfx_data[tile*8+yi] >> (7-xi)) & 1) ? -1 : 7; |
| 463 | color = ((gfx_data[tile*8+yi] >> (7-xi)) & 1) ? -1 : pal; |
| 442 | 464 | else |
| 443 | | color = ((gfx_data[tile*8+yi] >> (7-xi)) & 1) ? 7 : -1; |
| 465 | color = ((gfx_data[tile*8+yi] >> (7-xi)) & 1) ? pal : -1; |
| 444 | 466 | |
| 445 | 467 | if((res_x)<=machine->primary_screen->visible_area().max_x && (res_y)<=machine->primary_screen->visible_area().max_y) |
| 446 | 468 | if(color != -1) |
| r10097 | r10098 | |
| 1131 | 1153 | |
| 1132 | 1154 | static WRITE8_HANDLER( pc8801_pcg8100_w ) |
| 1133 | 1155 | { |
| 1156 | if(data) |
| 1134 | 1157 | printf("Write to PCG-8100 %02x %02x\n",offset,data); |
| 1135 | 1158 | } |
| 1136 | 1159 | |
| r10097 | r10098 | |
| 1739 | 1762 | extram_bank = 0; |
| 1740 | 1763 | extram_mode = 0; |
| 1741 | 1764 | } |
| 1765 | |
| 1766 | { |
| 1767 | int i; |
| 1768 | |
| 1769 | for(i=0;i<0x10;i++) //text + bitmap |
| 1770 | palette_set_color_rgb(machine, i, pal1bit(i >> 1), pal1bit(i >> 2), pal1bit(i >> 0)); |
| 1771 | } |
| 1742 | 1772 | } |
| 1743 | 1773 | |
| 1744 | 1774 | static PALETTE_INIT( pc8801 ) |
| 1745 | 1775 | { |
| 1746 | 1776 | int i; |
| 1747 | 1777 | |
| 1748 | | for(i=0;i<8;i++) |
| 1778 | for(i=0;i<0x10;i++) //text + bitmap |
| 1749 | 1779 | palette_set_color_rgb(machine, i, pal1bit(i >> 1), pal1bit(i >> 2), pal1bit(i >> 0)); |
| 1750 | 1780 | } |
| 1751 | 1781 | |
| r10097 | r10098 | |
| 1867 | 1897 | ROM_LOAD( "kanji2.rom", 0x20000, 0x20000, CRC(154803cc) SHA1(7e6591cd465cbb35d6d3446c5a83b46d30fafe95) ) // it should not be here |
| 1868 | 1898 | |
| 1869 | 1899 | ROM_REGION( 0x40000, "gfx1", 0) |
| 1870 | | ROM_COPY( "kanji", 0x1000, 0x0000, 0x800 ) |
| 1900 | ROM_COPY( "kanji", 0x1000, 0x0000, 0x1000 ) |
| 1871 | 1901 | ROM_END |
| 1872 | 1902 | |
| 1873 | 1903 | ROM_START( pc8801mk2fr ) |