src/mess/drivers/pc88va.c
| r9515 | r9516 | |
| 9 | 9 | TODO: |
| 10 | 10 | - Does this system have one or two CPUs? I'm prone to think that the V30 does all the job |
| 11 | 11 | and then enters into z80 compatible mode for PC-8801 emulation. |
| 12 | - What exact kind of garbage happens if you try to enable both direct and palette color |
| 13 | modes to a graphic layer? |
| 14 | - What is exactly supposed to be a "bus slot"? |
| 12 | 15 | |
| 13 | 16 | ********************************************************************************************/ |
| 14 | 17 | |
| r9515 | r9516 | |
| 38 | 41 | UINT8 blink; |
| 39 | 42 | UINT16 cur_pos_x,cur_pos_y; |
| 40 | 43 | }tsp; |
| 44 | static UINT16 video_pri_reg[2]; |
| 41 | 45 | |
| 42 | 46 | static UINT8 backupram_wp; |
| 43 | 47 | |
| r9515 | r9516 | |
| 143 | 147 | /* TODO: this is either a result of an hand-crafted ROM or the JIS stuff is really attribute related ... */ |
| 144 | 148 | static UINT32 calc_kanji_rom_addr(UINT8 jis1,UINT8 jis2,int x,int y) |
| 145 | 149 | { |
| 146 | | if(jis1 < 0x28) |
| 150 | if(jis1 < 0x30) |
| 147 | 151 | return ((jis2 & 0x60) << 8) + ((jis1 & 0x07) << 10) + ((jis2 & 0x1f) << 5); |
| 148 | | else if(jis1 >= 0x28 && jis1 < 0x30) |
| 149 | | return ((jis2 & 0x60) << 8) + ((jis1 & 0x07) << 10) + ((jis2 & 0x1f) << 5); |
| 150 | 152 | else if(jis1 >= 0x30 && jis1 < 0x3f) |
| 151 | 153 | return ((jis2 & 0x60) << 10) + ((jis1 & 0x0f) << 10) + ((jis2 & 0x1f) << 5); |
| 152 | 154 | else if(jis1 >= 0x40 && jis1 < 0x50) |
| r9515 | r9516 | |
| 301 | 303 | hline = 1; |
| 302 | 304 | break; |
| 303 | 305 | default: |
| 304 | | popmessage("Illegal text tilemap attribute mode %02x",attr_mode); |
| 306 | popmessage("Illegal text tilemap attribute mode %02x, contact MESSdev",attr_mode); |
| 305 | 307 | return; |
| 306 | 308 | } |
| 307 | 309 | |
| r9515 | r9516 | |
| 339 | 341 | |
| 340 | 342 | static VIDEO_UPDATE( pc88va ) |
| 341 | 343 | { |
| 344 | UINT8 pri,cur_pri_lv; |
| 345 | UINT32 screen_pri; |
| 342 | 346 | bitmap_fill(bitmap, cliprect, 0); |
| 343 | 347 | |
| 348 | /* |
| 349 | video_pri_reg[0] |
| 350 | xxxx ---- ---- ---- priority 3 |
| 351 | ---- xxxx ---- ---- priority 2 |
| 352 | ---- ---- xxxx ---- priority 1 |
| 353 | ---- ---- ---- xxxx priority 0 |
| 354 | video_pri_reg[1] |
| 355 | ---- ---- xxxx ---- priority 5 |
| 356 | ---- ---- ---- xxxx priority 4 |
| 357 | |
| 358 | Note that orthogonality level is actually REVERSED than the level number it indicates, so we have to play a little with the data for an easier usage ... |
| 359 | */ |
| 360 | |
| 361 | screen_pri = (video_pri_reg[1] & 0x00f0) >> 4; // priority 5 |
| 362 | screen_pri|= (video_pri_reg[1] & 0x000f) << 4; // priority 4 |
| 363 | screen_pri|= (video_pri_reg[0] & 0xf000) >> 4; // priority 3 |
| 364 | screen_pri|= (video_pri_reg[0] & 0x0f00) << 4; // priority 2 |
| 365 | screen_pri|= (video_pri_reg[0] & 0x00f0) << 12; // priority 1 |
| 366 | screen_pri|= (video_pri_reg[0] & 0x000f) << 20; // priority 0 |
| 367 | |
| 368 | for(pri=0;pri<6;pri++) |
| 344 | 369 | { |
| 345 | | draw_text(screen->machine,bitmap,cliprect); |
| 370 | cur_pri_lv = (screen_pri >> (pri*4)) & 0xf; |
| 371 | |
| 372 | if(cur_pri_lv & 8) // enable layer |
| 373 | { |
| 374 | if(pri <= 1) // (direct color mode, priority 5 and 4) |
| 375 | { |
| 376 | // 8 = graphic 0 |
| 377 | // 9 = graphic 1 |
| 378 | } |
| 379 | else |
| 380 | { |
| 381 | switch(cur_pri_lv & 3) // (palette color mode) |
| 382 | { |
| 383 | case 0: draw_text(screen->machine,bitmap,cliprect); break; |
| 384 | case 1: if(tsp.spr_on) { draw_sprites(screen->machine,bitmap,cliprect); } break; |
| 385 | case 2: /* A = graphic 0 */ break; |
| 386 | case 3: /* B = graphic 1 */ break; |
| 387 | } |
| 388 | } |
| 389 | } |
| 346 | 390 | } |
| 347 | 391 | |
| 348 | | if(tsp.spr_on) |
| 349 | | draw_sprites(screen->machine,bitmap,cliprect); |
| 350 | | |
| 351 | | |
| 352 | 392 | return 0; |
| 353 | 393 | } |
| 354 | 394 | |
| r9515 | r9516 | |
| 892 | 932 | } |
| 893 | 933 | } |
| 894 | 934 | |
| 935 | static WRITE16_HANDLER( video_pri_w ) |
| 936 | { |
| 937 | COMBINE_DATA(&video_pri_reg[offset]); |
| 938 | } |
| 939 | |
| 895 | 940 | static ADDRESS_MAP_START( pc88va_io_map, ADDRESS_SPACE_IO, 16 ) |
| 896 | 941 | AM_RANGE(0x0000, 0x000f) AM_READ8(key_r,0xffff) // Keyboard ROW reading |
| 897 | 942 | // AM_RANGE(0x0010, 0x0010) Printer / Calendar Clock Interface |
| r9515 | r9516 | |
| 921 | 966 | |
| 922 | 967 | AM_RANGE(0x0100, 0x0101) AM_READWRITE(screen_ctrl_r,screen_ctrl_w) // Screen Control Register |
| 923 | 968 | // AM_RANGE(0x0102, 0x0103) Graphic Screen Control Register |
| 924 | | // AM_RANGE(0x0106, 0x0107) Palette Control Register |
| 925 | | // AM_RANGE(0x0108, 0x0109) Direct Color Control Register |
| 969 | AM_RANGE(0x0106, 0x0109) AM_WRITE(video_pri_w) // Palette Control Register (priority) / Direct Color Control Register (priority) |
| 926 | 970 | // AM_RANGE(0x010a, 0x010b) Picture Mask Mode Register |
| 927 | 971 | // AM_RANGE(0x010c, 0x010d) Color Palette Mode Register |
| 928 | 972 | // AM_RANGE(0x010e, 0x010f) Backdrop Color Register |