trunk/src/mess/drivers/apc.c
| r19081 | r19082 | |
| 96 | 96 | required_device<upd765a_device> m_fdc; |
| 97 | 97 | required_device<am9517a_device> m_dmac; |
| 98 | 98 | UINT8 *m_char_rom; |
| 99 | UINT8 *m_aux_pcg; |
| 99 | 100 | |
| 100 | 101 | required_shared_ptr<UINT8> m_video_ram_1; |
| 101 | 102 | required_shared_ptr<UINT8> m_video_ram_2; |
| r19081 | r19082 | |
| 118 | 119 | DECLARE_WRITE8_MEMBER(apc_irq_ack_w); |
| 119 | 120 | DECLARE_READ8_MEMBER(apc_rtc_r); |
| 120 | 121 | DECLARE_WRITE8_MEMBER(apc_rtc_w); |
| 122 | // DECLARE_READ8_MEMBER(aux_pcg_r); |
| 123 | // DECLARE_WRITE8_MEMBER(aux_pcg_w); |
| 121 | 124 | |
| 122 | 125 | struct { |
| 123 | 126 | UINT8 status; //status |
| r19081 | r19082 | |
| 163 | 166 | void apc_state::video_start() |
| 164 | 167 | { |
| 165 | 168 | m_char_rom = memregion("gfx")->base(); |
| 169 | m_aux_pcg = memregion("aux_pcg")->base(); |
| 166 | 170 | } |
| 167 | 171 | |
| 168 | 172 | UINT32 apc_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ) |
| r19081 | r19082 | |
| 203 | 207 | UINT8 color; |
| 204 | 208 | UINT8 tile,attr,pen; |
| 205 | 209 | UINT32 tile_addr; |
| 210 | UINT8 tile_sel; |
| 206 | 211 | |
| 207 | 212 | // tile_addr = addr+(x*(state->m_video_ff[WIDTH40_REG]+1)); |
| 208 | 213 | tile_addr = addr+(x*(1)); |
| 209 | 214 | |
| 210 | 215 | tile = state->m_video_ram_1[(tile_addr*2+1) & 0x1fff] & 0x00ff; |
| 216 | tile_sel = state->m_video_ram_1[(tile_addr*2) & 0x1fff] & 0x00ff; |
| 211 | 217 | attr = (state->m_video_ram_1[(tile_addr*2 & 0x1fff) | 0x2000] & 0x00ff); |
| 212 | 218 | |
| 213 | 219 | u_line = attr & 0x01; |
| r19081 | r19082 | |
| 232 | 238 | if(res_x > 640 || res_y > 494) //TODO |
| 233 | 239 | continue; |
| 234 | 240 | |
| 235 | | // tile_data = secret ? 0 : (state->m_char_rom[tile*char_size+interlace_on*0x800+yi]); |
| 236 | 241 | /* |
| 237 | | Addr bus: C BA98 7654 3210 |
| 238 | | | |||| |\\\ \\\\- character number bits 0-6 |
| 239 | | | |||| \--------- y' bit 0 |
| 240 | | | |||\----------- y' bit 1 |
| 241 | | | ||\------------ y' bit 2 |
| 242 | | | |\------------- y' bit 3 |
| 243 | | | \-------------- character number bit 7 |
| 244 | | \---------------- y' bit 4 |
| 242 | Addr bus: C BA98 7654 3210 |
| 243 | | |||| |\\\ \\\\- character number bits 0-6 |
| 244 | | |||| \--------- y' bit 0 |
| 245 | | |||\----------- y' bit 1 |
| 246 | | ||\------------ y' bit 2 |
| 247 | | |\------------- y' bit 3 |
| 248 | | \-------------- character number bit 7 |
| 249 | \---------------- y' bit 4 |
| 245 | 250 | |
| 246 | 251 | y to y' (assumed; this needs hardware tests since there could be one more 'blank' line between all char rows): |
| 247 | 252 | y = 0 1 2 3 ... 16 17 18 |
| 248 | 253 | y' = 18 0 1 2 ... 15 16 17 |
| 249 | 254 | |
| 250 | | Data bus: 76543210 = pixels, in left->01234567->right order |
| 251 | | */ |
| 252 | | tile_data = (state->m_char_rom[(tile & 0x7f)+((tile & 0x80)<<4)+((yi_trans & 0xf)*0x80)+((yi_trans & 0x10)<<8)]); |
| 255 | Data bus: 76543210 = pixels, in left->01234567->right order |
| 256 | */ |
| 257 | if(tile_sel == 0x89)// Aux character RAM select TODO: correct triggering? |
| 258 | { |
| 259 | if(yi & 0x10) |
| 260 | tile_data = 0; |
| 261 | else |
| 262 | tile_data = state->m_aux_pcg[(tile & 0xff)*0x20+yi*2]; |
| 263 | } |
| 264 | else |
| 265 | tile_data = state->m_char_rom[(tile & 0x7f)+((tile & 0x80)<<4)+((yi_trans & 0xf)*0x80)+((yi_trans & 0x10)<<8)]; |
| 253 | 266 | |
| 254 | 267 | if(reverse) { tile_data^=0xff; } |
| 255 | 268 | if(u_line && yi == lr-1) { tile_data = 0xff; } |
| r19081 | r19082 | |
| 459 | 472 | AM_RANGE(0x00000, 0x9ffff) AM_RAM |
| 460 | 473 | AM_RANGE(0xa0000, 0xa0fff) AM_RAM AM_SHARE("cmos") |
| 461 | 474 | // AM_RANGE(0xc0000, 0xcffff) standard character ROM |
| 462 | | AM_RANGE(0xd8000, 0xdffff) AM_RAM // AUX character RAM |
| 475 | AM_RANGE(0xd8000, 0xd9fff) AM_RAM AM_REGION("aux_pcg", 0) // AUX character RAM |
| 463 | 476 | // AM_RANGE(0xe0000, 0xeffff) Special Character RAM |
| 464 | 477 | AM_RANGE(0xfe000, 0xfffff) AM_ROM AM_REGION("ipl", 0) |
| 465 | 478 | ADDRESS_MAP_END |
| r19081 | r19082 | |
| 797 | 810 | 8 |
| 798 | 811 | }; |
| 799 | 812 | |
| 813 | #if 0 |
| 814 | static const gfx_layout charset_pcg = |
| 815 | { |
| 816 | 8, 16, |
| 817 | RGN_FRAC(1,1), |
| 818 | 1, |
| 819 | { 0 }, |
| 820 | { 7, 6, 5, 4, 3, 2, 1, 0 }, |
| 821 | { STEP16(0,16) }, |
| 822 | 8*32 |
| 823 | }; |
| 824 | #endif |
| 825 | |
| 800 | 826 | static GFXDECODE_START( apc ) |
| 801 | 827 | GFXDECODE_ENTRY( "gfx", 0x0000, charset_8x16, 0, 128 ) |
| 802 | 828 | GFXDECODE_ENTRY( "gfx", 0x0800, charset_8x16, 0, 128 ) |
| 803 | 829 | GFXDECODE_ENTRY( "gfx", 0x1000, charset_8x16, 0, 128 ) |
| 804 | 830 | GFXDECODE_ENTRY( "gfx", 0x1800, charset_8x16, 0, 128 ) |
| 831 | // GFXDECODE_ENTRY( "aux_pcg", 0x0000, charset_pcg, 0, 128 ) |
| 805 | 832 | GFXDECODE_END |
| 806 | 833 | |
| 807 | 834 | |
| r19081 | r19082 | |
| 1049 | 1076 | |
| 1050 | 1077 | ROM_REGION( 0x2000, "gfx", ROMREGION_ERASE00 ) |
| 1051 | 1078 | ROM_LOAD("pfcu1r.bin", 0x000000, 0x002000, CRC(683efa94) SHA1(43157984a1746b2e448f3236f571011af9a3aa73) ) |
| 1079 | |
| 1080 | ROM_REGION( 0x2000, "aux_pcg", ROMREGION_ERASE00 ) |
| 1052 | 1081 | ROM_END |
| 1053 | 1082 | |
| 1054 | 1083 | DRIVER_INIT_MEMBER(apc_state,apc) |