trunk/src/mess/drivers/sapi1.c
| r25505 | r25506 | |
| 8 | 8 | With no available docs, the i/o ports are a guess. The ram |
| 9 | 9 | allocation is based on the actions of the various bios roms. |
| 10 | 10 | Port 25 is used as a jump vector. in a,(25); ld l,a; jp(hl). |
| 11 | | According to wikipedia, e800+ is the videoram area, and the |
| 12 | | number of columns is 64. |
| 13 | 11 | |
| 14 | 12 | 2012-04-19 Connected sapizps3 to a terminal. It is trying to |
| 15 | 13 | load a 128-byte boot sector from a floppy disk. |
| r25505 | r25506 | |
| 50 | 48 | DECLARE_WRITE8_MEMBER(sapi1_keyboard_w); |
| 51 | 49 | DECLARE_READ8_MEMBER(sapi2_keyboard_status_r); |
| 52 | 50 | DECLARE_READ8_MEMBER(sapi2_keyboard_data_r); |
| 51 | DECLARE_READ8_MEMBER(sapi3_0c_r); |
| 53 | 52 | DECLARE_WRITE8_MEMBER(sapi3_00_w); |
| 54 | 53 | DECLARE_READ8_MEMBER(sapi3_25_r); |
| 55 | 54 | DECLARE_WRITE8_MEMBER(sapi3_25_w); |
| r25505 | r25506 | |
| 192 | 191 | static ADDRESS_MAP_START(sapi3b_mem, AS_PROGRAM, 8, sapi1_state ) |
| 193 | 192 | ADDRESS_MAP_UNMAP_HIGH |
| 194 | 193 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_RAMBANK("bank1") |
| 195 | | AM_RANGE(0x0800, 0xf7ff) AM_RAM |
| 196 | | AM_RANGE(0xf800, 0xffff) AM_RAM AM_SHARE("videoram") |
| 194 | AM_RANGE(0x0800, 0xafff) AM_RAM |
| 195 | AM_RANGE(0xb000, 0xb7ff) AM_RAM AM_SHARE("videoram") |
| 196 | AM_RANGE(0xb800, 0xffff) AM_RAM |
| 197 | 197 | ADDRESS_MAP_END |
| 198 | 198 | |
| 199 | 199 | static ADDRESS_MAP_START( sapi3_io, AS_IO, 8, sapi1_state ) |
| r25505 | r25506 | |
| 215 | 215 | ADDRESS_MAP_UNMAP_HIGH |
| 216 | 216 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 217 | 217 | AM_RANGE(0x00, 0x00) AM_WRITE(sapi3_00_w) |
| 218 | AM_RANGE(0x0c, 0x0c) AM_READ(sapi3_0c_r) |
| 218 | 219 | AM_RANGE(0x25, 0x25) AM_READWRITE(sapi3_25_r,sapi3_25_w) |
| 219 | 220 | AM_RANGE(0xe0, 0xe0) AM_DEVREADWRITE("crtc", mc6845_device, status_r, address_w) |
| 220 | 221 | AM_RANGE(0xe1, 0xe1) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w) |
| r25505 | r25506 | |
| 283 | 284 | |
| 284 | 285 | UINT32 sapi1_state::screen_update_sapi1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 285 | 286 | { |
| 286 | | int x,y,j,b; |
| 287 | 287 | bool val; |
| 288 | | UINT16 addr; |
| 289 | | int xpos; |
| 288 | UINT16 addr,xpos; |
| 289 | UINT8 chr,attr,ra,x,y,b; |
| 290 | 290 | |
| 291 | 291 | for(y = 0; y < 24; y++ ) |
| 292 | 292 | { |
| r25505 | r25506 | |
| 294 | 294 | xpos = 0; |
| 295 | 295 | for(x = 0; x < 40; x++ ) |
| 296 | 296 | { |
| 297 | | UINT8 code = m_p_videoram[addr + x]; |
| 298 | | UINT8 attr = (code >> 6) & 3; |
| 299 | | code &= 0x3f; |
| 300 | | for(j = 0; j < 9; j++ ) |
| 297 | chr = m_p_videoram[addr + x]; |
| 298 | attr = (chr >> 6) & 3; |
| 299 | chr &= 0x3f; |
| 300 | for(ra = 0; ra < 9; ra++ ) |
| 301 | 301 | { |
| 302 | 302 | for(b = 0; b < 6; b++ ) |
| 303 | 303 | { |
| 304 | 304 | val = 0; |
| 305 | 305 | |
| 306 | | if (j==8) |
| 306 | if (ra==8) |
| 307 | 307 | { |
| 308 | 308 | if (attr==2) |
| 309 | 309 | val = BIT(m_refresh_counter, 5); |
| 310 | 310 | } |
| 311 | 311 | else |
| 312 | 312 | { |
| 313 | | val = BIT(MHB2501[code*8 + j], 5-b); |
| 313 | val = BIT(MHB2501[(chr<<3) | ra], 5-b); |
| 314 | 314 | if (attr==1) |
| 315 | 315 | val = BIT(m_refresh_counter, 5) ? val : 0; |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | if(attr==3) |
| 319 | 319 | { |
| 320 | | bitmap.pix16(y*9+j, xpos+2*b ) = val; |
| 321 | | bitmap.pix16(y*9+j, xpos+2*b+1 ) = val; |
| 320 | bitmap.pix16(y*9+ra, xpos+2*b ) = val; |
| 321 | bitmap.pix16(y*9+ra, xpos+2*b+1 ) = val; |
| 322 | 322 | } |
| 323 | 323 | else |
| 324 | 324 | { |
| 325 | | bitmap.pix16(y*9+j, xpos+b ) = val; |
| 325 | bitmap.pix16(y*9+ra, xpos+b ) = val; |
| 326 | 326 | } |
| 327 | 327 | } |
| 328 | 328 | } |
| r25505 | r25506 | |
| 336 | 336 | |
| 337 | 337 | static MC6845_UPDATE_ROW( update_row ) |
| 338 | 338 | { |
| 339 | sapi1_state *state = device->machine().driver_data<sapi1_state>(); |
| 340 | const rgb_t *palette = palette_entry_list_raw(bitmap.palette()); |
| 341 | UINT8 chr,gfx,inv; |
| 342 | UINT16 mem,x; |
| 343 | UINT32 *p = &bitmap.pix32(y); |
| 344 | |
| 345 | for (x = 0; x < x_count; x++) |
| 346 | { |
| 347 | inv = gfx = 0; |
| 348 | if (x == cursor_x) inv ^= 0xff; |
| 349 | mem = (2*(ma + x)) & 0xfff; |
| 350 | chr = state->m_p_videoram[mem] & 0x3f; |
| 351 | |
| 352 | if (ra < 8) |
| 353 | gfx = MHB2501[(chr<<3) | ra] ^ inv; |
| 354 | |
| 355 | /* Display a scanline of a character */ |
| 356 | *p++ = palette[BIT(gfx, 5)]; |
| 357 | *p++ = palette[BIT(gfx, 4)]; |
| 358 | *p++ = palette[BIT(gfx, 3)]; |
| 359 | *p++ = palette[BIT(gfx, 2)]; |
| 360 | *p++ = palette[BIT(gfx, 1)]; |
| 361 | *p++ = palette[BIT(gfx, 0)]; |
| 362 | } |
| 339 | 363 | } |
| 340 | 364 | |
| 341 | 365 | static MC6845_INTERFACE( mc6845_intf ) |
| r25505 | r25506 | |
| 406 | 430 | |
| 407 | 431 | **************************************/ |
| 408 | 432 | |
| 433 | READ8_MEMBER( sapi1_state::sapi3_0c_r ) |
| 434 | { |
| 435 | return 0xc0; |
| 436 | } |
| 437 | |
| 409 | 438 | /* switch out the rom shadow */ |
| 410 | 439 | WRITE8_MEMBER( sapi1_state::sapi3_00_w ) |
| 411 | 440 | { |
| r25505 | r25506 | |
| 564 | 593 | |
| 565 | 594 | ROM_START( sapizps3b ) |
| 566 | 595 | ROM_REGION( 0x10800, "maincpu", 0 ) |
| 567 | | // This bios uses a 6845 and unknown videoram |
| 596 | // This bios uses a 6845 |
| 568 | 597 | ROM_LOAD( "pkt1.bin", 0x10000, 0x0800, CRC(ed5a2725) SHA1(3383c15f87f976400b8d0f31829e2a95236c4b6c)) |
| 569 | 598 | ROM_END |
| 570 | 599 | |