Previous 199869 Revisions Next

r26336 Thursday 21st November, 2013 at 16:51:57 UTC by Jürgen Buchmüller
Simplify display PROMs macros
[/branches/alto2/src/emu/cpu/alto2]a2disp.c a2disp.h

branches/alto2/src/emu/cpu/alto2/a2disp.c
r26335r26336
3232 * </PRE>
3333 */
3434
35//! PROM a38 bit O1 is STOPWAKE' (stop DWT if bit is zero)
36#define FIFO_STOPWAKE(a38) (0 == (a38 & disp_a38_STOPWAKE) ? true : false)
37
38//! PROM a38 bit O3 is MBEMPTY' (FIFO is empty if bit is zero)
39#define   FIFO_MBEMPTY(a38) (0 == (a38 & disp_a38_MBEMPTY) ? true : false)
40
3541/**
3642 * @brief emulation of PROM a63 in the display schematics page 8
3743 * <PRE>
r26335r26336
97103 */
98104
99105//!< test the HBLANK (horizontal blanking) signal in PROM a63 being high
100#define A63_HBLANK_HI(a) ((a & A63_HBLANK) ? true : false)
106#define A63_HBLANK(a) ((a & disp_a63_HBLANK) ? true : false)
101107
102108//!< test the HSYNC (horizontal synchonisation) signal in PROM a63 being high
103#define A63_HSYNC_HI(a) ((a & A63_HSYNC) ? true : false)
109#define A63_HSYNC(a) ((a & disp_a63_HSYNC) ? true : false)
104110
105111//!< test the SCANEND (scanline end) signal in PROM a63 being high
106#define A63_SCANEND_HI(a) ((a & A63_SCANEND) ? true : false)
112#define A63_SCANEND(a) ((a & disp_a63_SCANEND) ? true : false)
107113
108114//!< test the HLCGATE (horz. line counter gate) signal in PROM a63 being high
109#define A63_HLCGATE_HI(a) ((a & A63_HLCGATE) ? true : false)
115#define A63_HLCGATE(a) ((a & disp_a63_HLCGATE) ? true : false)
110116
111117/**
112118 * @brief PROM a66 is a 256x4 bit (type 3601)
r26335r26336
122128 */
123129
124130//! test the VSYNC (vertical synchronisation) signal in PROM a66 being high
125#define A66_VSYNC(a) (a & (HLC1024 ? A66_VSYNC_ODD : A66_VSYNC_EVEN) ? false : true)
131#define A66_VSYNC(a) (a & (HLC1024 ? disp_a66_VSYNC_ODD : disp_a66_VSYNC_EVEN) ? false : true)
126132
127133//! test the VBLANK (vertical blanking) signal in PROM a66 being high
128#define A66_VBLANK(a) (a & (HLC1024 ? A66_VBLANK_ODD : A66_VBLANK_EVEN) ? false : true)
134#define A66_VBLANK(a) (a & (HLC1024 ? disp_a66_VBLANK_ODD : disp_a66_VBLANK_EVEN) ? false : true)
129135
130136/**
131137 * @brief double the bits for a byte (left and right of display word) to a word
r26335r26336
215221   UINT16* scanline = m_dsp.raw_bitmap  + y * ALTO2_DISPLAY_SCANLINE_WORDS;
216222
217223   UINT32 word = m_dsp.inverse;
218   if (FIFO_MBEMPTY_0() == 0) {
224   UINT8 a38 = m_disp_a38[m_dsp.fifo_rd * 16 + m_dsp.fifo_wr];
225   if (FIFO_MBEMPTY(a38)) {
219226      LOG((LOG_DISPL,1, "   DSP FIFO underrun y:%d x:%d\n", y, x));
220227   } else {
221228      word ^= m_dsp.fifo[m_dsp.fifo_rd];
r26335r26336
288295   }
289296
290297   UINT8 a63 = m_disp_a63[m_dsp.state];
291   if (A63_HLCGATE_HI(a63)) {
298   if (A63_HLCGATE(a63)) {
292299      /* reset or count horizontal line counters */
293300      if (m_dsp.hlc == ALTO2_DISPLAY_HLC_END)
294301         m_dsp.hlc = ALTO2_DISPLAY_HLC_START;
r26335r26336
348355          */
349356         m_dsp.curt_blocks = false;
350357      }
351      if (!A63_HBLANK_HI(a63) && A63_HBLANK_HI(m_dsp.a63)) {
358      if (!A63_HBLANK(a63) && A63_HBLANK(m_dsp.a63)) {
352359         // falling edge of a63 HBLANK starts unloading of FIFO words
353360         LOG((LOG_DISPL,1, " HBLANK↘ UNLOAD"));
354361         m_unload_time = ALTO2_DISPLAY_BITTIME(m_dsp.halfclock ? 32 : 16);
r26335r26336
367374    * if DHT is not blocked, and if the buffer is not full, DWT wakeups
368375    * are generated.
369376    */
370   if (!m_dsp.dwt_blocks && !m_dsp.dht_blocks && FIFO_STOPWAKE_0() != 0) {
377   UINT8 a38 = m_disp_a38[m_dsp.fifo_rd * 16 + m_dsp.fifo_wr];
378   if (!m_dsp.dwt_blocks && !m_dsp.dht_blocks && !FIFO_STOPWAKE(a38)) {
371379      m_task_wakeup |= 1 << task_dwt;
372380      LOG((LOG_DISPL,1, " (wake DWT)"));
373381   }
374382
375383   // Stop waking the display word task at SCANEND time
376   if (A63_SCANEND_HI(a63)) {
384   if (A63_SCANEND(a63)) {
377385      LOG((LOG_DISPL,1, " SCANEND"));
378386      m_task_wakeup &= ~(1 << task_dwt);
379387   }
380388
381   LOG((LOG_DISPL,1, "%s", A63_HBLANK_HI(a63) ? " HBLANK": ""));
389   LOG((LOG_DISPL,1, "%s", A63_HBLANK(a63) ? " HBLANK": ""));
382390
383   if (A63_HSYNC_HI(a63)) {
384      if (!A63_HSYNC_HI(m_dsp.a63)) {
391   if (A63_HSYNC(a63)) {
392      if (!A63_HSYNC(m_dsp.a63)) {
385393         LOG((LOG_DISPL,1, " HSYNC↗ (CLRBUF)"));
386394         /*
387395          * The hardware sets the buffer empty and clears the DWT block
r26335r26336
401409      }
402410   }
403411   // FIXME: jiggly cursor issue; try to wake up CURT at the end of HSYNC
404   if (A63_HSYNC_HI(m_dsp.a63) && !A63_HSYNC_HI(a63)) {
412   if (A63_HSYNC(m_dsp.a63) && !A63_HSYNC(a63)) {
405413      /*
406414       * CLRBUF' also resets the 2nd cursor task block flip flop,
407415       * which is built from two NAND gates a30c and a30d (74H00).
branches/alto2/src/emu/cpu/alto2/a2disp.h
r26335r26336
226226
227227//! output bits of PROM A38
228228enum {
229   A38_STOPWAKE   = (1 << 1),
230   A38_MBEMPTY      = (1 << 3)
229   disp_a38_STOPWAKE   = (1 << 1),
230   disp_a38_MBEMPTY   = (1 << 3)
231231};
232232
233//! PROM a38 bit O1 is STOPWAKE' (stop DWT if bit is zero)
234inline UINT8 FIFO_STOPWAKE_0() { return m_disp_a38[m_dsp.fifo_rd * 16 + m_dsp.fifo_wr] & A38_STOPWAKE; }
235
236//! PROM a38 bit O3 is MBEMPTY' (FIFO is empty if bit is zero)
237inline UINT8 FIFO_MBEMPTY_0() { return m_disp_a38[m_dsp.fifo_rd * 16 + m_dsp.fifo_wr] & A38_MBEMPTY; }
238
239233/**
240234 * @brief emulation of PROM a63 in the display schematics page 8
241235 * <PRE>
r26335r26336
266260UINT8* m_disp_a63;
267261
268262enum {
269   A63_HBLANK   = (1 << 0),            //!< PROM a63 B0 is latched as HBLANK signal
270   A63_HSYNC   = (1 << 1),            //!< PROM a63 B1 is latched as HSYNC signal
271   A63_A0      = (1 << 2),            //!< PROM a63 B2 is the latched next address bit A0
272   A63_A1      = (1 << 3),            //!< PROM a63 B3 is the latched next address bit A1
273   A63_A2      = (1 << 4),            //!< PROM a63 B4 is the latched next address bit A2
274   A63_A3      = (1 << 5),            //!< PROM a63 B5 is the latched next address bit A3
275   A63_SCANEND   = (1 << 6),            //!< PROM a63 B6 SCANEND signal, which resets the FIFO counters
276   A63_HLCGATE   = (1 << 7)            //!< PROM a63 B7 HLCGATE signal, which enables counting the HLC
263   disp_a63_HBLANK      = (1 << 0),         //!< PROM a63 B0 is latched as HBLANK signal
264   disp_a63_HSYNC      = (1 << 1),         //!< PROM a63 B1 is latched as HSYNC signal
265   disp_a63_A0         = (1 << 2),         //!< PROM a63 B2 is the latched next address bit A0
266   disp_a63_A1         = (1 << 3),         //!< PROM a63 B3 is the latched next address bit A1
267   disp_a63_A2         = (1 << 4),         //!< PROM a63 B4 is the latched next address bit A2
268   disp_a63_A3         = (1 << 5),         //!< PROM a63 B5 is the latched next address bit A3
269   disp_a63_SCANEND   = (1 << 6),         //!< PROM a63 B6 SCANEND signal, which resets the FIFO counters
270   disp_a63_HLCGATE   = (1 << 7)         //!< PROM a63 B7 HLCGATE signal, which enables counting the HLC
277271};
278272
279273/**
r26335r26336
282276 * PROM a66 is a 256x4 bit (type 3601), containing the vertical blank + synch.
283277 * Address lines are driven by H[1] to H[128] of the the horz. line counters.
284278 * The PROM is enabled whenever H[256] and H[512] are both 0.
285 *
286 * Q1 (001) is VSYNC for the odd field (with H1024=1)
287 * Q2 (002) is VSYNC for the even field (with H1024=0)
288 * Q3 (004) is VBLANK for the odd field (with H1024=1)
289 * Q4 (010) is VBLANK for the even field (with H1024=0)
290279 */
291280UINT8* m_disp_a66;
292281
293282enum {
294   A66_VSYNC_ODD   = (1 << 0),
295   A66_VSYNC_EVEN   = (1 << 1),
296   A66_VBLANK_ODD   = (1 << 2),
297   A66_VBLANK_EVEN   = (1 << 3)
283   disp_a66_VSYNC_ODD      = (1 << 0),      //!< Q1 (001) is VSYNC for the odd field (with H1024=1)
284   disp_a66_VSYNC_EVEN      = (1 << 1),      //!< Q2 (002) is VSYNC for the even field (with H1024=0)
285   disp_a66_VBLANK_ODD      = (1 << 2),      //!< Q3 (004) is VBLANK for the odd field (with H1024=1)
286   disp_a66_VBLANK_EVEN   = (1 << 3)      //!< Q4 (010) is VBLANK for the even field (with H1024=0)
298287};
299288
300289void update_bitmap_word(int x, int y, UINT16 word);   //!< update a word in the screen bitmap

Previous 199869 Revisions Next


© 1997-2024 The MAME Team