trunk/src/mess/drivers/pc9801.c
| r19640 | r19641 | |
| 431 | 431 | UINT8 *m_vram256; |
| 432 | 432 | UINT8 m_pc9821_window_bank; |
| 433 | 433 | UINT8 m_joy_sel; |
| 434 | UINT8 m_ext2_ff; |
| 434 | 435 | |
| 435 | 436 | DECLARE_READ8_MEMBER(pc9801_xx_r); |
| 436 | 437 | DECLARE_WRITE8_MEMBER(pc9801_xx_w); |
| r19640 | r19641 | |
| 676 | 677 | if(state->m_video_ff[DISPLAY_REG] == 0) //screen is off |
| 677 | 678 | return; |
| 678 | 679 | |
| 680 | // popmessage("%02x %d",state->m_video_ff[INTERLACE_REG],device->machine().primary_screen->visible_area().max_y + 1); |
| 681 | // interlace_on = ((device->machine().primary_screen->visible_area().max_y + 1) >= 400) ? 1 : 0; |
| 679 | 682 | interlace_on = state->m_video_ff[INTERLACE_REG]; |
| 680 | 683 | colors16_mode = (state->m_ex_video_ff[ANALOG_16_MODE]) ? 16 : 8; |
| 681 | 684 | |
| r19640 | r19641 | |
| 1151 | 1154 | if((offset & 1) == 0) |
| 1152 | 1155 | { |
| 1153 | 1156 | /* |
| 1154 | | TODO: this is my best bet so far. Register 4 is annoying, the pattern seems to be: |
| 1157 | TODO: this is my best bet so far. Register 4 is annoying, the pattern seems to be: |
| 1155 | 1158 | Write to video FF register Graphic -> 00 |
| 1156 | 1159 | Write to video FF register 200 lines -> 0x |
| 1157 | 1160 | Write to video FF register 200 lines -> 00 |
| r19640 | r19641 | |
| 1161 | 1164 | switch((data & 0x0e) >> 1) |
| 1162 | 1165 | { |
| 1163 | 1166 | case 1: |
| 1164 | | m_gfx_ff = 1; |
| 1165 | | if(data & 1) |
| 1166 | | printf("Graphic f/f actually enabled!\n"); |
| 1167 | | break; |
| 1167 | m_gfx_ff = 1; |
| 1168 | if(data & 1) |
| 1169 | printf("Graphic f/f actually enabled!\n"); |
| 1170 | break; |
| 1168 | 1171 | case 4: |
| 1169 | 1172 | if(m_gfx_ff) |
| 1170 | | { |
| 1171 | | m_video_ff[(data & 0x0e) >> 1] = data & 1; |
| 1173 | { |
| 1174 | m_video_ff[(data & 0x0e) >> 1] = data &1; |
| 1172 | 1175 | m_gfx_ff = 0; |
| 1173 | 1176 | } |
| 1174 | | break; |
| 1177 | break; |
| 1175 | 1178 | default: m_video_ff[(data & 0x0e) >> 1] = data & 1; break; |
| 1176 | 1179 | } |
| 1177 | 1180 | |
| 1178 | | |
| 1179 | 1181 | if(0) |
| 1180 | 1182 | { |
| 1181 | 1183 | static const char *const video_ff_regnames[] = |
| r19640 | r19641 | |
| 2415 | 2417 | return m_maincpu->total_cycles(); |
| 2416 | 2418 | } |
| 2417 | 2419 | |
| 2420 | /* basically a read-back of various registers */ |
| 2418 | 2421 | READ8_MEMBER(pc9801_state::pc9821_ext2_video_ff_r) |
| 2419 | 2422 | { |
| 2420 | | return 0; |
| 2423 | UINT8 res; |
| 2424 | |
| 2425 | if(offset) |
| 2426 | return 0xff; |
| 2427 | |
| 2428 | res = 0; |
| 2429 | |
| 2430 | switch(m_ext2_ff) |
| 2431 | { |
| 2432 | case 3: res = m_video_ff[DISPLAY_REG]; break; // display reg |
| 2433 | default: |
| 2434 | printf("PC-9821: read ext2 f/f with value %02x\n",m_ext2_ff); |
| 2435 | } |
| 2436 | |
| 2437 | return res; |
| 2421 | 2438 | } |
| 2422 | 2439 | |
| 2423 | 2440 | WRITE8_MEMBER(pc9801_state::pc9821_ext2_video_ff_w) |
| 2424 | 2441 | { |
| 2425 | | // ... |
| 2442 | if(offset == 0) |
| 2443 | m_ext2_ff = data; |
| 2426 | 2444 | } |
| 2427 | 2445 | |
| 2428 | 2446 | static ADDRESS_MAP_START( pc9821_map, AS_PROGRAM, 32, pc9801_state ) |