trunk/src/mess/drivers/sapi1.c
| r25518 | r25519 | |
| 16 | 16 | According to wikipedia, sapi1 & 2 have cassette facility, |
| 17 | 17 | while sapi3 uses 8 inch floppy disk. |
| 18 | 18 | |
| 19 | ToDo: |
| 20 | - Add cassette to sapi1 and 2 |
| 21 | -- UART on port 12, save and load bytes |
| 22 | -- port 11 bit 7 for load, chr available |
| 23 | -- port 11 bit 6 for save, tx buffer empty |
| 24 | - sapi3 is trying to read a disk, so there is no response after showing the logo |
| 25 | |
| 26 | Unable to proceed due to no info available (& in English). |
| 27 | |
| 19 | 28 | ****************************************************************************/ |
| 20 | 29 | |
| 21 | 30 | |
| r25518 | r25519 | |
| 59 | 68 | DECLARE_MACHINE_RESET(sapi1); |
| 60 | 69 | DECLARE_MACHINE_RESET(sapizps3); |
| 61 | 70 | UINT32 screen_update_sapi1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 71 | UINT32 screen_update_sapi3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 62 | 72 | private: |
| 63 | 73 | UINT8 m_term_data; |
| 64 | 74 | UINT8 m_keyboard_mask; |
| r25518 | r25519 | |
| 334 | 344 | return 0; |
| 335 | 345 | } |
| 336 | 346 | |
| 347 | // The attributes seem to be different on this one, they need to be understood, so disabled for now |
| 348 | UINT32 sapi1_state::screen_update_sapi3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 349 | { |
| 350 | bool val; |
| 351 | UINT16 addr,xpos; |
| 352 | UINT8 chr,attr,ra,x,y,b; |
| 353 | |
| 354 | for(y = 0; y < 20; y++ ) |
| 355 | { |
| 356 | addr = y*64; |
| 357 | xpos = 0; |
| 358 | for(x = 0; x < 40; x++ ) |
| 359 | { |
| 360 | chr = m_p_videoram[addr + x]; |
| 361 | attr = 0;//(chr >> 6) & 3; |
| 362 | if (chr > 0x3f) |
| 363 | chr &= 0x1f; |
| 364 | |
| 365 | for(ra = 0; ra < 9; ra++ ) |
| 366 | { |
| 367 | for(b = 0; b < 6; b++ ) |
| 368 | { |
| 369 | val = 0; |
| 370 | |
| 371 | if (ra==8) |
| 372 | { |
| 373 | if (attr==2) |
| 374 | val = BIT(m_refresh_counter, 5); |
| 375 | } |
| 376 | else |
| 377 | { |
| 378 | val = BIT(MHB2501[(chr<<3) | ra], 5-b); |
| 379 | if (attr==1) |
| 380 | val = BIT(m_refresh_counter, 5) ? val : 0; |
| 381 | } |
| 382 | |
| 383 | if(attr==3) |
| 384 | { |
| 385 | bitmap.pix16(y*9+ra, xpos+2*b ) = val; |
| 386 | bitmap.pix16(y*9+ra, xpos+2*b+1 ) = val; |
| 387 | } |
| 388 | else |
| 389 | { |
| 390 | bitmap.pix16(y*9+ra, xpos+b ) = val; |
| 391 | } |
| 392 | } |
| 393 | } |
| 394 | xpos+= (attr==3) ? 12 : 6; |
| 395 | if (xpos>=6*40) break; |
| 396 | } |
| 397 | } |
| 398 | m_refresh_counter++; |
| 399 | return 0; |
| 400 | } |
| 401 | |
| 337 | 402 | static MC6845_UPDATE_ROW( update_row ) |
| 338 | 403 | { |
| 339 | 404 | sapi1_state *state = device->machine().driver_data<sapi1_state>(); |
| r25518 | r25519 | |
| 518 | 583 | MCFG_CPU_PROGRAM_MAP(sapi3_mem) |
| 519 | 584 | MCFG_CPU_IO_MAP(sapi3_io) |
| 520 | 585 | MCFG_MACHINE_RESET_OVERRIDE(sapi1_state, sapizps3 ) |
| 586 | MCFG_SCREEN_MODIFY("screen") |
| 587 | MCFG_SCREEN_SIZE(40*6, 20*9) |
| 588 | MCFG_SCREEN_VISIBLE_AREA(0, 40*6-1, 0, 20*9-1) |
| 589 | MCFG_SCREEN_UPDATE_DRIVER(sapi1_state, screen_update_sapi3) |
| 521 | 590 | MACHINE_CONFIG_END |
| 522 | 591 | |
| 523 | 592 | static MACHINE_CONFIG_DERIVED( sapi3b, sapi3 ) |