Previous 199869 Revisions Next

r26243 Sunday 17th November, 2013 at 23:09:24 UTC by Jürgen Buchmüller
Fix ALTO2_DISPLAY_BITTIME macro. Enable disk speedup hack.
[/branches/alto2/src/emu/cpu/alto2]a2disk.c a2disp.c alto2.h
[/branches/alto2/src/mess/drivers]alto2.c

branches/alto2/src/emu/cpu/alto2/a2disk.c
r26242r26243
1010#include "alto2.h"
1111
1212
13#define   JKFF_FUNCTION   1   //!< define 1 to debug the JK flip-flops, 0 to use a lookup table
13#define   JKFF_FUNCTION   0   //!< define 1 to debug the JK flip-flops, 0 to use a lookup table
1414
1515#define   GET_KADDR_SECTOR(kaddr)         A2_GET16(kaddr,16, 0, 3)         //!< get sector number from address register
1616#define   PUT_KADDR_SECTOR(kaddr,val)      A2_PUT16(kaddr,16, 0, 3,val)      //!< put sector number into address register
r26242r26243
23162316#else
23172317   // TODO: verify current sector == requested sector and only then run the bitclk?
23182318   // HACK: no command, no bit clock
2319//   if (debug_read_mem(0521))
2319   if (debug_read_mem(0521))
23202320   {
23212321      // Make the CPU execution loop call disk_bitclk
23222322      m_bitclk_time = 0;
branches/alto2/src/emu/cpu/alto2/a2disp.c
r26242r26243
194194 */
195195int alto2_cpu_device::unload_word(int x)
196196{
197   UINT32 word, word1, word2;
198197   int y = ((m_dsp.hlc - m_dsp.vblank) & ~(1024|1)) + HLC1024();
198   UINT16* scanline = m_dsp.scanline[y];
199   UINT8 dirty = m_dsp.scanline_dirty[y];
199200
200   word = m_dsp.inverse;
201   UINT32 word = m_dsp.inverse;
201202   if (FIFO_MBEMPTY_0() == 0) {
202203      LOG((LOG_DISPL,1, "   DSP FIFO underrun y:%d x:%d\n", y, x));
203204   } else {
r26242r26243
209210
210211   if (y >= 0 && y < ALTO2_DISPLAY_HEIGHT && x < ALTO2_DISPLAY_VISIBLE_WORDS) {
211212      if (m_dsp.halfclock) {
212         word1 = double_bits[word / 256];
213         word2 = double_bits[word % 256];
213         UINT32 word1 = double_bits[word / 256];
214         UINT32 word2 = double_bits[word % 256];
214215         /* mixing with the cursor */
215216         if (x == m_dsp.curword + 0)
216217            word1 ^= m_dsp.curdata >> 16;
217218         if (x == m_dsp.curword + 1)
218219            word1 ^= m_dsp.curdata & 0177777;
219         if (word1 != m_dsp.raw_bitmap[y * ALTO2_DISPLAY_SCANLINE_WORDS + x]) {
220            m_dsp.raw_bitmap[y * ALTO2_DISPLAY_SCANLINE_WORDS + x] = word1;
221            m_dsp.scanline_dirty[y] = 1;
220         if (word1 != scanline[x]) {
221            scanline[x] = word1;
222            dirty = 1;
222223         }
223224         x++;
224225         if (x < ALTO2_DISPLAY_VISIBLE_WORDS) {
r26242r26243
227228               word2 ^= m_dsp.curdata >> 16;
228229            if (x == m_dsp.curword + 1)
229230               word2 ^= m_dsp.curdata & 0177777;
230            if (word2 != m_dsp.raw_bitmap[y * ALTO2_DISPLAY_SCANLINE_WORDS + x]) {
231               m_dsp.raw_bitmap[y * ALTO2_DISPLAY_SCANLINE_WORDS + x] = word2;
232               m_dsp.scanline_dirty[y] = 1;
231            if (word2 != scanline[x]) {
232               scanline[x] = word2;
233               dirty = 1;
233234            }
234235            x++;
235236         }
r26242r26243
239240            word ^= m_dsp.curdata >> 16;
240241         if (x == m_dsp.curword + 1)
241242            word ^= m_dsp.curdata & 0177777;
242         if (word != m_dsp.raw_bitmap[y * ALTO2_DISPLAY_SCANLINE_WORDS + x]) {
243            m_dsp.raw_bitmap[y * ALTO2_DISPLAY_SCANLINE_WORDS + x] = word;
244            m_dsp.scanline_dirty[y] = 1;
243         if (word != scanline[x]) {
244            scanline[x] = word;
245            dirty = 1;
245246         }
246247         x++;
247248      }
248249   }
249
250   m_dsp.scanline_dirty[y] = dirty;
250251   if (x < ALTO2_DISPLAY_VISIBLE_WORDS) {
251252      m_unload_time += ALTO2_DISPLAY_BITTIME(m_dsp.halfclock ? 32 : 16);
252253      return x;
r26242r26243
440441   memset(&m_dsp, 0, sizeof(m_dsp));
441442   m_dsp.hlc = ALTO2_DISPLAY_HLC_START;
442443   m_dsp.raw_bitmap = auto_alloc_array(machine(), UINT16, ALTO2_DISPLAY_HEIGHT * ALTO2_DISPLAY_SCANLINE_WORDS);
443   for (int y = 0; y < ALTO2_DISPLAY_HEIGHT; y++)
444      memset(m_dsp.raw_bitmap + y * ALTO2_DISPLAY_SCANLINE_WORDS, 0, ALTO2_DISPLAY_VISIBLE_WORDS * sizeof(UINT16));
445
444   m_dsp.scanline = auto_alloc_array(machine(), UINT16*, ALTO2_DISPLAY_HEIGHT);
445   for (int y = 0; y < ALTO2_DISPLAY_HEIGHT; y++) {
446      m_dsp.scanline[y] = m_dsp.raw_bitmap + y * ALTO2_DISPLAY_SCANLINE_WORDS;
447      memset(m_dsp.scanline[y], 0, sizeof(UINT16) * ALTO2_DISPLAY_VISIBLE_WORDS);
448   }
446449   m_dsp.scanline_dirty = auto_alloc_array(machine(), UINT8, ALTO2_DISPLAY_HEIGHT);
447450   memset(m_dsp.scanline_dirty, 1, sizeof(UINT8) * ALTO2_DISPLAY_HEIGHT);
448451}
r26242r26243
462465      if (0 == m_dsp.scanline_dirty[y])
463466         continue;
464467      m_dsp.scanline_dirty[y] = 0;
465      UINT16* src = &m_dsp.raw_bitmap[y * ALTO2_DISPLAY_SCANLINE_WORDS];
468      UINT16* src = m_dsp.scanline[y];
466469      UINT16* pix = &bitmap.pix16(y);
467470      for (UINT32 x = 0; x < ALTO2_DISPLAY_WIDTH; x += 16) {
468471         UINT16 w = *src++;
branches/alto2/src/emu/cpu/alto2/alto2.h
r26242r26243
2020#define   ALTO2_TAG "alto2"
2121
2222#ifndef   ALTO2_DEBUG
23#define   ALTO2_DEBUG         1
23#define   ALTO2_DEBUG             0   //!< define to 1 to enable logerror() output
2424#endif
2525
2626#define   USE_PRIO_F9318         0   //!< define to 1 to use the F9318 priority encoder code
r26242r26243
147147#define   ALTO2_DISPLAY_WIDTH 606                                 //!< visible width of the display
148148#define   ALTO2_DISPLAY_VISIBLE_WORDS ((ALTO2_DISPLAY_WIDTH+15)/16)      //!< visible words per scanline
149149#define   ALTO2_DISPLAY_BITCLOCK 20160000ll                        //!< display bit clock in in Hertz (20.16MHz)
150#define   ALTO2_DISPLAY_BITTIME(n) (HZ_TO_ATTOSECONDS(ALTO2_DISPLAY_BITCLOCK)*(n))      //!< display bit time in in atto seconds (~= 49.6031ns)
150#define   ALTO2_DISPLAY_BITTIME(n) ((n)*U64(1000000000)/ALTO2_DISPLAY_BITCLOCK)   //!< display bit time in in atto seconds (~= 49.6031ns)
151151#define   ALTO2_DISPLAY_SCANLINE_TIME   ALTO2_DISPLAY_BITTIME(ALTO2_DISPLAY_TOTAL_WIDTH)   //!< time for a scanline in nano seconds (768 * 49.6031ns)
152152#define   ALTO2_DISPLAY_VISIBLE_TIME ALTO2_DISPLAY_BITTIME(ALTO2_DISPLAY_WIDTH)   //!< time of the visible part of a scanline (606 * 49.6031ns)
153153#define   ALTO2_DISPLAY_WORD_TIME   ALTO2_DISPLAY_BITTIME(16)            //!< time for a word (16 pixels * 49.6031ns)
r26242r26243
16001600      UINT32 curword;                  //!< helper: first cursor word in current scanline
16011601      UINT32 curdata;                  //!< helper: shifted cursor data (32-bit)
16021602      UINT16 *raw_bitmap;               //!< array of words of the raw bitmap that is displayed
1603      UINT16 **scanline;               //!< array of pointers to the scanlines
16031604      UINT8 *scanline_dirty;            //!< array of flags indicating whenever the scanline contents changed
16041605   }   m_dsp;
16051606
branches/alto2/src/mess/drivers/alto2.c
r26242r26243
1717   return 0;
1818}
1919
20#if   0
2021void alto2_state::screen_eof_alto2(screen_device &screen, bool state)
2122{
2223   // FIXME: what do we do here?
2324}
25#endif
2426
2527/* Input Ports */
2628
r26242r26243
253255   MCFG_SCREEN_ADD("screen", RASTER)
254256   MCFG_SCREEN_RAW_PARAMS(XTAL_20_16MHz, 768,   0, 606, 875,   0, 808)
255257   MCFG_SCREEN_UPDATE_DRIVER(alto2_state, screen_update)
256   MCFG_SCREEN_VBLANK_DRIVER(alto2_state, screen_eof_alto2)
258//   MCFG_SCREEN_VBLANK_DRIVER(alto2_state, screen_eof_alto2)
257259
258260   MCFG_PALETTE_LENGTH(2)
259261

Previous 199869 Revisions Next


© 1997-2024 The MAME Team