Previous 199869 Revisions Next

r26204 Saturday 16th November, 2013 at 19:08:48 UTC by Jürgen Buchmüller
Simple stupid monochrome blit in a2disp. Read microcode in CPU through crom_r or cram_r.
[/branches/alto2/src/emu/cpu/alto2]a2disp.c alto2.c alto2.h
[/branches/alto2/src/mess/drivers]alto2.c

branches/alto2/src/emu/cpu/alto2/alto2.c
r26203r26204
11131113   state_add( A2_KSTAT,   "KSTAT",   m_dsk.kstat).formatstr("%06O");
11141114   state_add( A2_KCOM,    "KCOM",    m_dsk.kcom).formatstr("%06O");
11151115   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");
11181118   state_add( A2_DATAIN,  "DATAIN",  m_dsk.datain).formatstr("%06O");
11191119   state_add( A2_DATAOUT, "DATAOUT", m_dsk.dataout).formatstr("%06O");
11201120   state_add( A2_KRWC,    "KRWC",    m_dsk.krwc).formatstr("%1u");
r26203r26204
12371237   *reinterpret_cast<UINT32 *>(m_ucode_cram + offset * 4) = data;
12381238}
12391239
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
12401244//! read constants PROM
12411245READ16_MEMBER ( alto2_cpu_device::const_r )
12421246{
r26203r26204
21812185      LOG((LOG_CPU,0,"invalid address (%06o)\n", val));
21822186      return;
21832187   }
2184   val = m_ucode->read_dword(m_ucode->address_to_byte(addr)) ^ ALTO2_UCODE_INVERTED;
2188   val = RD_CRAM(addr) ^ ALTO2_UCODE_INVERTED;
21852189   if (GET_CRAM_HALFSEL(m_cram_addr)) {
21862190      val = val >> 16;
21872191      LOG((LOG_CPU,0,"upper:%06o\n", val));
r26203r26204
22182222      return;
22192223   }
22202224   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);
22222226}
22232227
22242228#if   USE_ALU_74181
r26203r26204
26422646
26432647      /* next instruction's mpc */
26442648      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);
26462650      m_rsel = MIR_RSEL(m_mir);
26472651      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);
26492653      aluf = MIR_ALUF(m_mir);
26502654      bs = MIR_BS(m_mir);
26512655      f1 = MIR_F1(m_mir);
branches/alto2/src/emu/cpu/alto2/a2disp.c
r26203r26204
218218            word1 ^= m_dsp.curdata & 0177777;
219219         if (word1 != m_dsp.raw_bitmap[y * ALTO2_DISPLAY_SCANLINE_WORDS + x]) {
220220            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;
222222         }
223223         x++;
224224         if (x < ALTO2_DISPLAY_VISIBLE_WORDS) {
r26203r26204
229229               word2 ^= m_dsp.curdata & 0177777;
230230            if (word2 != m_dsp.raw_bitmap[y * ALTO2_DISPLAY_SCANLINE_WORDS + x]) {
231231               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;
233233            }
234234            x++;
235235         }
r26203r26204
241241            word ^= m_dsp.curdata & 0177777;
242242         if (word != m_dsp.raw_bitmap[y * ALTO2_DISPLAY_SCANLINE_WORDS + x]) {
243243            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;
245245         }
246246         x++;
247247      }
r26203r26204
441441
442442   memset(&m_dsp, 0, sizeof(m_dsp));
443443   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;
447444
445   m_dsp.raw_bitmap = global_alloc_array(UINT16, ALTO2_DISPLAY_HEIGHT * ALTO2_DISPLAY_SCANLINE_WORDS);
448446   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));
450448
449   m_dsp.scanline_dirty = global_alloc_array(UINT8, ALTO2_DISPLAY_HEIGHT);
450   memset(m_dsp.scanline_dirty, 1, sizeof(UINT8) * ALTO2_DISPLAY_HEIGHT);
451451   return 0;
452452}
453
454#define   BLACK   0
455#define   WHITE   1
456
457//! update the internal bitmap to the MAME bitmap.pix16
458void 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
r26203r26204
1/*****************************************************************************
1/*****************************************************************************
22 *
33 *   Portable Xerox AltoII CPU core interface
44 *
r26203r26204
220220   //! driver interface to set diablo_hd_device
221221   void set_diablo(int unit, diablo_hd_device* ptr);
222222
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
223227   void next_sector(int unit);
224228
225229   DECLARE_ADDRESS_MAP( ucode_map, 32 );
r26203r26204
14021406      UINT8 egate;               //!< current erase gate signal to the DIABLO hd
14031407      UINT8 wrgate;               //!< current write gate signal to the DIABLO hd
14041408      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
14091413      UINT8 krwc;                  //!< read/write/check for current record
14101414      UINT8 kfer;                  //!< disk fatal error signal state
14111415      UINT8 wdtskena;               //!< disk word task enable (active low)
r26203r26204
15921596      UINT32 curword;                  //!< helper: first cursor word in current scanline
15931597      UINT32 curdata;                  //!< helper: shifted cursor data (32-bit)
15941598      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
15951600   }   m_dsp;
15961601
15971602   //! horizontal line counter bit 0
branches/alto2/src/mess/drivers/alto2.c
r26203r26204
1212
1313UINT32 alto2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
1414{
15   alto2_cpu_device* cpu = downcast<alto2_cpu_device *>(m_maincpu.target());
16   cpu->screen_update(bitmap, cliprect);
1517   return 0;
1618}
1719
1820void alto2_state::screen_eof_alto2(screen_device &screen, bool state)
1921{
20
22   // FIXME: what do we do here?
2123}
2224
2325/* Input Ports */
r26203r26204
249251
250252   /* video hardware */
251253   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)
255255   MCFG_SCREEN_UPDATE_DRIVER(alto2_state, screen_update)
256256   MCFG_SCREEN_VBLANK_DRIVER(alto2_state, screen_eof_alto2)
257257

Previous 199869 Revisions Next


© 1997-2024 The MAME Team