branches/alto2/src/emu/cpu/alto2/alto2.c
| r26203 | r26204 | |
| 1113 | 1113 | state_add( A2_KSTAT, "KSTAT", m_dsk.kstat).formatstr("%06O"); |
| 1114 | 1114 | state_add( A2_KCOM, "KCOM", m_dsk.kcom).formatstr("%06O"); |
| 1115 | 1115 | state_add( A2_KRECNO, "KRECNO", m_dsk.krecno).formatstr("%02O"); |
| 1116 | | state_add( A2_SHIFTIN, "SHIFTIN", m_dsk.shiftin).formatstr("%07O"); |
| 1117 | | state_add( A2_SHIFTOUT,"SHIFTOUT",m_dsk.shiftout).formatstr("%07O"); |
| 1116 | state_add( A2_SHIFTIN, "SHIFTIN", m_dsk.shiftin).formatstr("%06O"); |
| 1117 | state_add( A2_SHIFTOUT,"SHIFTOUT",m_dsk.shiftout).formatstr("%06O"); |
| 1118 | 1118 | state_add( A2_DATAIN, "DATAIN", m_dsk.datain).formatstr("%06O"); |
| 1119 | 1119 | state_add( A2_DATAOUT, "DATAOUT", m_dsk.dataout).formatstr("%06O"); |
| 1120 | 1120 | state_add( A2_KRWC, "KRWC", m_dsk.krwc).formatstr("%1u"); |
| r26203 | r26204 | |
| 1237 | 1237 | *reinterpret_cast<UINT32 *>(m_ucode_cram + offset * 4) = data; |
| 1238 | 1238 | } |
| 1239 | 1239 | |
| 1240 | #define RD_CROM(addr) crom_r(space(AS_0), addr, 0xffffffff) |
| 1241 | #define RD_CRAM(addr) cram_r(space(AS_0), addr, 0xffffffff) |
| 1242 | #define WR_CRAM(addr,data) cram_w(space(AS_0), addr, data) |
| 1243 | |
| 1240 | 1244 | //! read constants PROM |
| 1241 | 1245 | READ16_MEMBER ( alto2_cpu_device::const_r ) |
| 1242 | 1246 | { |
| r26203 | r26204 | |
| 2181 | 2185 | LOG((LOG_CPU,0,"invalid address (%06o)\n", val)); |
| 2182 | 2186 | return; |
| 2183 | 2187 | } |
| 2184 | | val = m_ucode->read_dword(m_ucode->address_to_byte(addr)) ^ ALTO2_UCODE_INVERTED; |
| 2188 | val = RD_CRAM(addr) ^ ALTO2_UCODE_INVERTED; |
| 2185 | 2189 | if (GET_CRAM_HALFSEL(m_cram_addr)) { |
| 2186 | 2190 | val = val >> 16; |
| 2187 | 2191 | LOG((LOG_CPU,0,"upper:%06o\n", val)); |
| r26203 | r26204 | |
| 2218 | 2222 | return; |
| 2219 | 2223 | } |
| 2220 | 2224 | LOG((LOG_CPU,0,"\n")); |
| 2221 | | m_ucode->write_dword(m_ucode->address_to_byte(addr), ((m_m << 16) | m_alu) ^ ALTO2_UCODE_INVERTED); |
| 2225 | WR_CRAM(addr, ((m_m << 16) | m_alu) ^ ALTO2_UCODE_INVERTED); |
| 2222 | 2226 | } |
| 2223 | 2227 | |
| 2224 | 2228 | #if USE_ALU_74181 |
| r26203 | r26204 | |
| 2642 | 2646 | |
| 2643 | 2647 | /* next instruction's mpc */ |
| 2644 | 2648 | m_mpc = m_next; |
| 2645 | | m_mir = m_ucode->read_dword(m_ucode->address_to_byte(m_mpc)); |
| 2649 | m_mir = RD_CROM(m_mpc); |
| 2646 | 2650 | m_rsel = MIR_RSEL(m_mir); |
| 2647 | 2651 | m_next = MIR_NEXT(m_mir) | m_next2; |
| 2648 | | m_next2 = A2_GET32(m_ucode->read_dword(m_ucode->address_to_byte(m_next)), 32, NEXT0, NEXT9) | (m_next2 & ~ALTO2_UCODE_PAGE_MASK); |
| 2652 | m_next2 = A2_GET32(RD_CROM(m_next), 32, NEXT0, NEXT9) | (m_next2 & ~ALTO2_UCODE_PAGE_MASK); |
| 2649 | 2653 | aluf = MIR_ALUF(m_mir); |
| 2650 | 2654 | bs = MIR_BS(m_mir); |
| 2651 | 2655 | f1 = MIR_F1(m_mir); |
branches/alto2/src/emu/cpu/alto2/a2disp.c
| r26203 | r26204 | |
| 218 | 218 | word1 ^= m_dsp.curdata & 0177777; |
| 219 | 219 | if (word1 != m_dsp.raw_bitmap[y * ALTO2_DISPLAY_SCANLINE_WORDS + x]) { |
| 220 | 220 | m_dsp.raw_bitmap[y * ALTO2_DISPLAY_SCANLINE_WORDS + x] = word1; |
| 221 | | // sdl_write(x * 16, y, word1); // FIXME: invalidate bitmap word |
| 221 | m_dsp.scanline_dirty[y] = 0; |
| 222 | 222 | } |
| 223 | 223 | x++; |
| 224 | 224 | if (x < ALTO2_DISPLAY_VISIBLE_WORDS) { |
| r26203 | r26204 | |
| 229 | 229 | word2 ^= m_dsp.curdata & 0177777; |
| 230 | 230 | if (word2 != m_dsp.raw_bitmap[y * ALTO2_DISPLAY_SCANLINE_WORDS + x]) { |
| 231 | 231 | m_dsp.raw_bitmap[y * ALTO2_DISPLAY_SCANLINE_WORDS + x] = word2; |
| 232 | | // sdl_write(x * 16, y, word2); // FIXME: invalidate bitmap word |
| 232 | m_dsp.scanline_dirty[y] = 0; |
| 233 | 233 | } |
| 234 | 234 | x++; |
| 235 | 235 | } |
| r26203 | r26204 | |
| 241 | 241 | word ^= m_dsp.curdata & 0177777; |
| 242 | 242 | if (word != m_dsp.raw_bitmap[y * ALTO2_DISPLAY_SCANLINE_WORDS + x]) { |
| 243 | 243 | m_dsp.raw_bitmap[y * ALTO2_DISPLAY_SCANLINE_WORDS + x] = word; |
| 244 | | // sdl_write(x * 16, y, word); // FIXME: invalidate bitmap word |
| 244 | m_dsp.scanline_dirty[y] = 0; |
| 245 | 245 | } |
| 246 | 246 | x++; |
| 247 | 247 | } |
| r26203 | r26204 | |
| 441 | 441 | |
| 442 | 442 | memset(&m_dsp, 0, sizeof(m_dsp)); |
| 443 | 443 | m_dsp.hlc = ALTO2_DISPLAY_HLC_START; |
| 444 | | m_dsp.raw_bitmap = (UINT16*)malloc(ALTO2_DISPLAY_HEIGHT * ALTO2_DISPLAY_SCANLINE_WORDS * sizeof(UINT16)); |
| 445 | | if (NULL == m_dsp.raw_bitmap) |
| 446 | | return -1; |
| 447 | 444 | |
| 445 | m_dsp.raw_bitmap = global_alloc_array(UINT16, ALTO2_DISPLAY_HEIGHT * ALTO2_DISPLAY_SCANLINE_WORDS); |
| 448 | 446 | for (y = 0; y < ALTO2_DISPLAY_HEIGHT; y++) |
| 449 | | memset(m_dsp.raw_bitmap + y * ALTO2_DISPLAY_SCANLINE_WORDS, 0x55, ALTO2_DISPLAY_VISIBLE_WORDS * sizeof(UINT16)); |
| 447 | memset(m_dsp.raw_bitmap + y * ALTO2_DISPLAY_SCANLINE_WORDS, 0, ALTO2_DISPLAY_VISIBLE_WORDS * sizeof(UINT16)); |
| 450 | 448 | |
| 449 | m_dsp.scanline_dirty = global_alloc_array(UINT8, ALTO2_DISPLAY_HEIGHT); |
| 450 | memset(m_dsp.scanline_dirty, 1, sizeof(UINT8) * ALTO2_DISPLAY_HEIGHT); |
| 451 | 451 | return 0; |
| 452 | 452 | } |
| 453 | |
| 454 | #define BLACK 0 |
| 455 | #define WHITE 1 |
| 456 | |
| 457 | //! update the internal bitmap to the MAME bitmap.pix16 |
| 458 | void alto2_cpu_device::screen_update(bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 459 | { |
| 460 | for (UINT32 y = 0; y < ALTO2_DISPLAY_HEIGHT; y++) { |
| 461 | if (0 == m_dsp.scanline_dirty[y]) |
| 462 | continue; |
| 463 | m_dsp.scanline_dirty[y] = 0; |
| 464 | UINT16* src = &m_dsp.raw_bitmap[y * ALTO2_DISPLAY_SCANLINE_WORDS]; |
| 465 | UINT16* pix = &bitmap.pix16(y); |
| 466 | for (UINT32 x = 0; x < ALTO2_DISPLAY_WIDTH; x += 16) { |
| 467 | UINT16 w = *src++; |
| 468 | *pix++ = (w & 0100000) ? BLACK : WHITE; |
| 469 | *pix++ = (w & 0040000) ? BLACK : WHITE; |
| 470 | *pix++ = (w & 0020000) ? BLACK : WHITE; |
| 471 | *pix++ = (w & 0010000) ? BLACK : WHITE; |
| 472 | *pix++ = (w & 0004000) ? BLACK : WHITE; |
| 473 | *pix++ = (w & 0002000) ? BLACK : WHITE; |
| 474 | *pix++ = (w & 0001000) ? BLACK : WHITE; |
| 475 | *pix++ = (w & 0000400) ? BLACK : WHITE; |
| 476 | *pix++ = (w & 0000200) ? BLACK : WHITE; |
| 477 | *pix++ = (w & 0000100) ? BLACK : WHITE; |
| 478 | *pix++ = (w & 0000040) ? BLACK : WHITE; |
| 479 | *pix++ = (w & 0000020) ? BLACK : WHITE; |
| 480 | *pix++ = (w & 0000010) ? BLACK : WHITE; |
| 481 | *pix++ = (w & 0000004) ? BLACK : WHITE; |
| 482 | *pix++ = (w & 0000002) ? BLACK : WHITE; |
| 483 | *pix++ = (w & 0000001) ? BLACK : WHITE; |
| 484 | } |
| 485 | } |
| 486 | } |
branches/alto2/src/emu/cpu/alto2/alto2.h
| r26203 | r26204 | |
| 1 | | /***************************************************************************** |
| 1 | /***************************************************************************** |
| 2 | 2 | * |
| 3 | 3 | * Portable Xerox AltoII CPU core interface |
| 4 | 4 | * |
| r26203 | r26204 | |
| 220 | 220 | //! driver interface to set diablo_hd_device |
| 221 | 221 | void set_diablo(int unit, diablo_hd_device* ptr); |
| 222 | 222 | |
| 223 | //! update the internal bitmap to the MAME bitmap.pix16 |
| 224 | void screen_update(bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 225 | |
| 226 | //! call in for the next sector callback |
| 223 | 227 | void next_sector(int unit); |
| 224 | 228 | |
| 225 | 229 | DECLARE_ADDRESS_MAP( ucode_map, 32 ); |
| r26203 | r26204 | |
| 1402 | 1406 | UINT8 egate; //!< current erase gate signal to the DIABLO hd |
| 1403 | 1407 | UINT8 wrgate; //!< current write gate signal to the DIABLO hd |
| 1404 | 1408 | UINT8 rdgate; //!< current read gate signal to the DIABLO hd |
| 1405 | | UINT32 shiftin; //!< input shift register |
| 1406 | | UINT32 shiftout; //!< output shift register |
| 1407 | | UINT32 datain; //!< disk data in latch |
| 1408 | | UINT32 dataout; //!< disk data out latch |
| 1409 | UINT16 shiftin; //!< input shift register |
| 1410 | UINT16 shiftout; //!< output shift register |
| 1411 | UINT16 datain; //!< disk data in latch |
| 1412 | UINT16 dataout; //!< disk data out latch |
| 1409 | 1413 | UINT8 krwc; //!< read/write/check for current record |
| 1410 | 1414 | UINT8 kfer; //!< disk fatal error signal state |
| 1411 | 1415 | UINT8 wdtskena; //!< disk word task enable (active low) |
| r26203 | r26204 | |
| 1592 | 1596 | UINT32 curword; //!< helper: first cursor word in current scanline |
| 1593 | 1597 | UINT32 curdata; //!< helper: shifted cursor data (32-bit) |
| 1594 | 1598 | UINT16 *raw_bitmap; //!< array of words of the raw bitmap that is displayed |
| 1599 | UINT8 *scanline_dirty; //!< array of flags indicating whenever the scanline contents changed |
| 1595 | 1600 | } m_dsp; |
| 1596 | 1601 | |
| 1597 | 1602 | //! horizontal line counter bit 0 |
branches/alto2/src/mess/drivers/alto2.c
| r26203 | r26204 | |
| 12 | 12 | |
| 13 | 13 | UINT32 alto2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 14 | 14 | { |
| 15 | alto2_cpu_device* cpu = downcast<alto2_cpu_device *>(m_maincpu.target()); |
| 16 | cpu->screen_update(bitmap, cliprect); |
| 15 | 17 | return 0; |
| 16 | 18 | } |
| 17 | 19 | |
| 18 | 20 | void alto2_state::screen_eof_alto2(screen_device &screen, bool state) |
| 19 | 21 | { |
| 20 | | |
| 22 | // FIXME: what do we do here? |
| 21 | 23 | } |
| 22 | 24 | |
| 23 | 25 | /* Input Ports */ |
| r26203 | r26204 | |
| 249 | 251 | |
| 250 | 252 | /* video hardware */ |
| 251 | 253 | MCFG_SCREEN_ADD("screen", RASTER) |
| 252 | | MCFG_SCREEN_RAW_PARAMS(XTAL_20_16MHz, |
| 253 | | ALTO2_DISPLAY_TOTAL_WIDTH, 0, ALTO2_DISPLAY_WIDTH, |
| 254 | | ALTO2_DISPLAY_TOTAL_HEIGHT, ALTO2_DISPLAY_HLC_START, ALTO2_DISPLAY_HLC_END) |
| 254 | MCFG_SCREEN_RAW_PARAMS(XTAL_20_16MHz, 768, 0, 606, 875, 150, 958) |
| 255 | 255 | MCFG_SCREEN_UPDATE_DRIVER(alto2_state, screen_update) |
| 256 | 256 | MCFG_SCREEN_VBLANK_DRIVER(alto2_state, screen_eof_alto2) |
| 257 | 257 | |