branches/alto2/src/emu/cpu/alto2/a2disp.c
| r26245 | r26246 | |
| 189 | 189 | 0xffc0,0xffc3,0xffcc,0xffcf,0xfff0,0xfff3,0xfffc,0xffff |
| 190 | 190 | }; |
| 191 | 191 | |
| 192 | #define BLACK 1 |
| 193 | #define WHITE 0 |
| 194 | |
| 195 | //! update the internal bitmap to the MAME bitmap.pix16 |
| 196 | void alto2_cpu_device::update_bitmap_word(int x, int y, UINT16 word) |
| 197 | { |
| 198 | UINT16* pix = &m_displ_bitmap->pix16(y) + x; |
| 199 | *pix++ = (word & 0100000) ? BLACK : WHITE; |
| 200 | *pix++ = (word & 0040000) ? BLACK : WHITE; |
| 201 | *pix++ = (word & 0020000) ? BLACK : WHITE; |
| 202 | *pix++ = (word & 0010000) ? BLACK : WHITE; |
| 203 | *pix++ = (word & 0004000) ? BLACK : WHITE; |
| 204 | *pix++ = (word & 0002000) ? BLACK : WHITE; |
| 205 | *pix++ = (word & 0001000) ? BLACK : WHITE; |
| 206 | *pix++ = (word & 0000400) ? BLACK : WHITE; |
| 207 | *pix++ = (word & 0000200) ? BLACK : WHITE; |
| 208 | *pix++ = (word & 0000100) ? BLACK : WHITE; |
| 209 | *pix++ = (word & 0000040) ? BLACK : WHITE; |
| 210 | *pix++ = (word & 0000020) ? BLACK : WHITE; |
| 211 | *pix++ = (word & 0000010) ? BLACK : WHITE; |
| 212 | *pix++ = (word & 0000004) ? BLACK : WHITE; |
| 213 | *pix++ = (word & 0000002) ? BLACK : WHITE; |
| 214 | *pix++ = (word & 0000001) ? BLACK : WHITE; |
| 215 | } |
| 216 | |
| 192 | 217 | /** |
| 193 | 218 | * @brief unload the next word from the display FIFO and shift it to the screen |
| 194 | 219 | */ |
| r26245 | r26246 | |
| 196 | 221 | { |
| 197 | 222 | int y = ((m_dsp.hlc - m_dsp.vblank) & ~(1024|1)) + HLC1024(); |
| 198 | 223 | UINT16* scanline = m_dsp.scanline[y]; |
| 199 | | UINT8 dirty = m_dsp.scanline_dirty[y]; |
| 200 | 224 | |
| 201 | 225 | UINT32 word = m_dsp.inverse; |
| 202 | 226 | if (FIFO_MBEMPTY_0() == 0) { |
| r26245 | r26246 | |
| 210 | 234 | |
| 211 | 235 | if (y >= 0 && y < ALTO2_DISPLAY_HEIGHT && x < ALTO2_DISPLAY_VISIBLE_WORDS) { |
| 212 | 236 | if (m_dsp.halfclock) { |
| 213 | | UINT32 word1 = double_bits[word / 256]; |
| 214 | | UINT32 word2 = double_bits[word % 256]; |
| 237 | UINT16 word1 = double_bits[word / 256]; |
| 238 | UINT16 word2 = double_bits[word % 256]; |
| 215 | 239 | /* mixing with the cursor */ |
| 216 | 240 | if (x == m_dsp.curword + 0) |
| 217 | 241 | word1 ^= m_dsp.curdata >> 16; |
| r26245 | r26246 | |
| 219 | 243 | word1 ^= m_dsp.curdata & 0177777; |
| 220 | 244 | if (word1 != scanline[x]) { |
| 221 | 245 | scanline[x] = word1; |
| 222 | | dirty = 1; |
| 246 | update_bitmap_word(16 * x, y, word1); |
| 223 | 247 | } |
| 224 | 248 | x++; |
| 225 | 249 | if (x < ALTO2_DISPLAY_VISIBLE_WORDS) { |
| r26245 | r26246 | |
| 230 | 254 | word2 ^= m_dsp.curdata & 0177777; |
| 231 | 255 | if (word2 != scanline[x]) { |
| 232 | 256 | scanline[x] = word2; |
| 233 | | dirty = 1; |
| 257 | update_bitmap_word(16 * x, y, word2); |
| 234 | 258 | } |
| 235 | 259 | x++; |
| 236 | 260 | } |
| r26245 | r26246 | |
| 242 | 266 | word ^= m_dsp.curdata & 0177777; |
| 243 | 267 | if (word != scanline[x]) { |
| 244 | 268 | scanline[x] = word; |
| 245 | | dirty = 1; |
| 269 | update_bitmap_word(16 * x, y, word); |
| 246 | 270 | } |
| 247 | 271 | x++; |
| 248 | 272 | } |
| 249 | 273 | } |
| 250 | | m_dsp.scanline_dirty[y] = dirty; |
| 251 | 274 | if (x < ALTO2_DISPLAY_VISIBLE_WORDS) { |
| 252 | 275 | m_unload_time += ALTO2_DISPLAY_BITTIME(m_dsp.halfclock ? 32 : 16); |
| 253 | 276 | return x; |
| r26245 | r26246 | |
| 277 | 300 | |
| 278 | 301 | a63 = m_disp_a63[arg]; |
| 279 | 302 | |
| 280 | | if (A2_HLCGATE_HI(a63)) { |
| 303 | if (A63_HLCGATE_HI(a63)) { |
| 281 | 304 | /* reset or count horizontal line counters */ |
| 282 | 305 | if (m_dsp.hlc == ALTO2_DISPLAY_HLC_END) |
| 283 | 306 | m_dsp.hlc = ALTO2_DISPLAY_HLC_START; |
| r26245 | r26246 | |
| 301 | 324 | // next address from PROM a63, use A4 from HLC1 |
| 302 | 325 | next = (16 * (HLC1() ^ 1)) | A63_NEXT(a63); |
| 303 | 326 | |
| 304 | | if (A2_VBLANK_HI(a66)) { |
| 327 | if (A66_VBLANK_HI(a66, HLC1024())) { |
| 305 | 328 | /* VBLANK: remember hlc */ |
| 306 | 329 | m_dsp.vblank = m_dsp.hlc | 1; |
| 307 | 330 | |
| 308 | 331 | LOG((LOG_DISPL,1, " VBLANK")); |
| 309 | 332 | |
| 310 | 333 | /* VSYNC is always within VBLANK */ |
| 311 | | if (A2_VSYNC_HI(a66)) { |
| 312 | | if (A2_VSYNC_LO(m_dsp.a66)) { |
| 334 | if (A66_VSYNC_HI(a66, HLC1024())) { |
| 335 | if (A66_VSYNC_LO(m_dsp.a66, HLC1024())) { |
| 313 | 336 | LOG((LOG_DISPL,1, " VSYNC/ (wake DVT)")); |
| 314 | 337 | /* |
| 315 | 338 | * The display vertical task DVT is awakened once per field, |
| r26245 | r26246 | |
| 322 | 345 | } |
| 323 | 346 | } |
| 324 | 347 | } else { |
| 325 | | if (A2_VBLANK_HI(m_dsp.a66)) { |
| 348 | if (A66_VBLANK_HI(m_dsp.a66, HLC1024())) { |
| 326 | 349 | /** |
| 327 | 350 | * VBLANKPULSE: |
| 328 | 351 | * The display horizontal task DHT is awakened once at the |
| r26245 | r26246 | |
| 342 | 365 | */ |
| 343 | 366 | m_dsp.curt_blocks = 0; |
| 344 | 367 | } |
| 345 | | if (A2_HBLANK_LO(a63) && A2_HBLANK_HI(m_dsp.a63)) { |
| 368 | if (A63_HBLANK_LO(a63) && A63_HBLANK_HI(m_dsp.a63)) { |
| 346 | 369 | /* falling edge of a63 HBLANK starts unload */ |
| 347 | 370 | LOG((LOG_DISPL,1, " HBLANK\\ UNLOAD")); |
| 348 | 371 | m_unload_time = ALTO2_DISPLAY_BITTIME(m_dsp.halfclock ? 32 : 16); |
| r26245 | r26246 | |
| 368 | 391 | } |
| 369 | 392 | } |
| 370 | 393 | |
| 371 | | if (A2_SCANEND_HI(a63)) { |
| 394 | if (A63_SCANEND_HI(a63)) { |
| 372 | 395 | LOG((LOG_DISPL,1, " SCANEND")); |
| 373 | 396 | m_task_wakeup &= ~(1 << task_dwt); |
| 374 | 397 | } |
| 375 | 398 | |
| 376 | 399 | LOG((LOG_DISPL,1, "%s", (a63 & A63_HBLANK) ? " HBLANK": "")); |
| 377 | 400 | |
| 378 | | if (A2_HSYNC_HI(a63)) { |
| 379 | | if (A2_HSYNC_LO(m_dsp.a63)) { |
| 401 | if (A63_HSYNC_HI(a63)) { |
| 402 | if (A63_HSYNC_LO(m_dsp.a63)) { |
| 380 | 403 | LOG((LOG_DISPL,1, " HSYNC/ (CLRBUF)")); |
| 381 | 404 | /* |
| 382 | 405 | * The hardware sets the buffer empty and clears the DWT block |
| r26245 | r26246 | |
| 394 | 417 | } else { |
| 395 | 418 | LOG((LOG_DISPL,1, " HSYNC")); |
| 396 | 419 | } |
| 397 | | } else if (A2_HSYNC_HI(m_dsp.a63)) { |
| 420 | } else if (A63_HSYNC_HI(m_dsp.a63)) { |
| 398 | 421 | /* |
| 399 | 422 | * CLRBUF' also resets the 2nd cursor task block flip flop, |
| 400 | 423 | * which is built from two NAND gates a30c and a30d (74H00). |
| r26245 | r26246 | |
| 439 | 462 | void alto2_cpu_device::init_disp() |
| 440 | 463 | { |
| 441 | 464 | memset(&m_dsp, 0, sizeof(m_dsp)); |
| 465 | // allocate the 16bpp bitmap |
| 466 | m_displ_bitmap = auto_bitmap_ind16_alloc(machine(), ALTO2_DISPLAY_WIDTH, ALTO2_DISPLAY_HEIGHT); |
| 467 | LOG((LOG_DISPL,0," m_bitmap=%p\n", m_displ_bitmap)); |
| 442 | 468 | m_dsp.hlc = ALTO2_DISPLAY_HLC_START; |
| 443 | 469 | m_dsp.raw_bitmap = auto_alloc_array(machine(), UINT16, ALTO2_DISPLAY_HEIGHT * ALTO2_DISPLAY_SCANLINE_WORDS); |
| 444 | 470 | m_dsp.scanline = auto_alloc_array(machine(), UINT16*, ALTO2_DISPLAY_HEIGHT); |
| 445 | 471 | 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); |
| 472 | UINT16* scanline = m_dsp.raw_bitmap + y * ALTO2_DISPLAY_SCANLINE_WORDS; |
| 473 | m_dsp.scanline[y] = scanline; |
| 474 | memset(m_dsp.scanline[y], y & 1 ? 0x55 : 0xaa, sizeof(UINT16) * ALTO2_DISPLAY_VISIBLE_WORDS); |
| 475 | for (int x = 0; x < ALTO2_DISPLAY_SCANLINE_WORDS; x++) |
| 476 | update_bitmap_word(x*16, y, scanline[x]); |
| 448 | 477 | } |
| 449 | | m_dsp.scanline_dirty = auto_alloc_array(machine(), UINT8, ALTO2_DISPLAY_HEIGHT); |
| 450 | | memset(m_dsp.scanline_dirty, 1, sizeof(UINT8) * ALTO2_DISPLAY_HEIGHT); |
| 451 | 478 | } |
| 452 | 479 | |
| 453 | 480 | void alto2_cpu_device::exit_disp() |
| 454 | 481 | { |
| 455 | 482 | // nothing to do yet |
| 456 | 483 | } |
| 457 | | |
| 458 | | #define BLACK 1 |
| 459 | | #define WHITE 0 |
| 460 | | |
| 461 | | //! update the internal bitmap to the MAME bitmap.pix16 |
| 462 | | void alto2_cpu_device::screen_update(bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 463 | | { |
| 464 | | for (UINT32 y = 0; y < ALTO2_DISPLAY_HEIGHT; y++) { |
| 465 | | if (0 == m_dsp.scanline_dirty[y]) |
| 466 | | continue; |
| 467 | | m_dsp.scanline_dirty[y] = 0; |
| 468 | | UINT16* src = m_dsp.scanline[y]; |
| 469 | | UINT16* pix = &bitmap.pix16(y); |
| 470 | | for (UINT32 x = 0; x < ALTO2_DISPLAY_WIDTH; x += 16) { |
| 471 | | UINT16 w = *src++; |
| 472 | | *pix++ = (w & 0100000) ? BLACK : WHITE; |
| 473 | | *pix++ = (w & 0040000) ? BLACK : WHITE; |
| 474 | | *pix++ = (w & 0020000) ? BLACK : WHITE; |
| 475 | | *pix++ = (w & 0010000) ? BLACK : WHITE; |
| 476 | | *pix++ = (w & 0004000) ? BLACK : WHITE; |
| 477 | | *pix++ = (w & 0002000) ? BLACK : WHITE; |
| 478 | | *pix++ = (w & 0001000) ? BLACK : WHITE; |
| 479 | | *pix++ = (w & 0000400) ? BLACK : WHITE; |
| 480 | | *pix++ = (w & 0000200) ? BLACK : WHITE; |
| 481 | | *pix++ = (w & 0000100) ? BLACK : WHITE; |
| 482 | | *pix++ = (w & 0000040) ? BLACK : WHITE; |
| 483 | | *pix++ = (w & 0000020) ? BLACK : WHITE; |
| 484 | | *pix++ = (w & 0000010) ? BLACK : WHITE; |
| 485 | | *pix++ = (w & 0000004) ? BLACK : WHITE; |
| 486 | | *pix++ = (w & 0000002) ? BLACK : WHITE; |
| 487 | | *pix++ = (w & 0000001) ? BLACK : WHITE; |
| 488 | | } |
| 489 | | } |
| 490 | | } |
branches/alto2/src/emu/cpu/alto2/alto2.h
| r26245 | r26246 | |
| 20 | 20 | #define ALTO2_TAG "alto2" |
| 21 | 21 | |
| 22 | 22 | #ifndef ALTO2_DEBUG |
| 23 | | #define ALTO2_DEBUG 0 //!< define to 1 to enable logerror() output |
| 23 | #define ALTO2_DEBUG 1 //!< define to 1 to enable logerror() output |
| 24 | 24 | #endif |
| 25 | 25 | |
| 26 | 26 | #define USE_PRIO_F9318 0 //!< define to 1 to use the F9318 priority encoder code |
| r26245 | r26246 | |
| 144 | 144 | |
| 145 | 145 | #define ALTO2_DISPLAY_SCANLINE_WORDS (ALTO2_DISPLAY_TOTAL_WIDTH/16) //!< words per scanline |
| 146 | 146 | #define ALTO2_DISPLAY_HEIGHT 808 //!< number of visible scanlines per frame; 808 really, but there are some empty lines? |
| 147 | | #define ALTO2_DISPLAY_WIDTH 606 //!< visible width of the display |
| 147 | #define ALTO2_DISPLAY_WIDTH 606 //!< visible width of the display; 38 words - 2 pixels |
| 148 | 148 | #define ALTO2_DISPLAY_VISIBLE_WORDS ((ALTO2_DISPLAY_WIDTH+15)/16) //!< visible words per scanline |
| 149 | 149 | #define ALTO2_DISPLAY_BITCLOCK 20160000ll //!< display bit clock in in Hertz (20.16MHz) |
| 150 | 150 | #define ALTO2_DISPLAY_BITTIME(n) ((n)*U64(1000000000)/ALTO2_DISPLAY_BITCLOCK) //!< display bit time in in atto seconds (~= 49.6031ns) |
| r26245 | r26246 | |
| 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 | 223 | //! call in for the next sector callback |
| 227 | 224 | void next_sector(int unit); |
| 228 | 225 | |
| 226 | //! return the display bitmap |
| 227 | bitmap_ind16& display() { return *m_displ_bitmap; } |
| 228 | |
| 229 | 229 | DECLARE_ADDRESS_MAP( ucode_map, 32 ); |
| 230 | 230 | DECLARE_ADDRESS_MAP( const_map, 16 ); |
| 231 | 231 | DECLARE_ADDRESS_MAP( iomem_map, 16 ); |
| r26245 | r26246 | |
| 1601 | 1601 | UINT32 curdata; //!< helper: shifted cursor data (32-bit) |
| 1602 | 1602 | UINT16 *raw_bitmap; //!< array of words of the raw bitmap that is displayed |
| 1603 | 1603 | UINT16 **scanline; //!< array of pointers to the scanlines |
| 1604 | | UINT8 *scanline_dirty; //!< array of flags indicating whenever the scanline contents changed |
| 1605 | 1604 | } m_dsp; |
| 1606 | 1605 | |
| 1607 | 1606 | //! horizontal line counter bit 0 |
| r26245 | r26246 | |
| 1656 | 1655 | */ |
| 1657 | 1656 | UINT8* m_disp_a38; |
| 1658 | 1657 | |
| 1658 | //! output bits of PROM A38 |
| 1659 | enum { |
| 1660 | A38_STOPWAKE = (1 << 1), |
| 1661 | A38_MBEMPTY = (1 << 3) |
| 1662 | }; |
| 1663 | |
| 1659 | 1664 | //! PROM a38 bit O1 is STOPWAKE' (stop DWT if bit is zero) |
| 1660 | | inline int FIFO_STOPWAKE_0() { return m_disp_a38[m_dsp.fifo_rd * 16 + m_dsp.fifo_wr] & 002; } |
| 1665 | inline int FIFO_STOPWAKE_0() { return m_disp_a38[m_dsp.fifo_rd * 16 + m_dsp.fifo_wr] & A38_STOPWAKE; } |
| 1661 | 1666 | |
| 1662 | 1667 | //! PROM a38 bit O3 is MBEMPTY' (FIFO is empty if bit is zero) |
| 1663 | | inline int FIFO_MBEMPTY_0() { return m_disp_a38[m_dsp.fifo_rd * 16 + m_dsp.fifo_wr] & 010; } |
| 1668 | inline int FIFO_MBEMPTY_0() { return m_disp_a38[m_dsp.fifo_rd * 16 + m_dsp.fifo_wr] & A38_MBEMPTY; } |
| 1664 | 1669 | |
| 1665 | 1670 | /** |
| 1666 | 1671 | * @brief emulation of PROM a63 in the display schematics page 8 |
| r26245 | r26246 | |
| 1702 | 1707 | A63_HLCGATE = (1 << 7) //!< PROM a63 B7 HLCGATE signal, which enables counting the HLC |
| 1703 | 1708 | }; |
| 1704 | 1709 | //!< helper to extract A3-A0 from a PROM a63 value |
| 1705 | | inline UINT8 A63_NEXT(UINT8 n) { return (n >> 2) & 017; } |
| 1710 | static inline UINT8 A63_NEXT(UINT8 n) { return (n >> 2) & 017; } |
| 1706 | 1711 | |
| 1707 | 1712 | //!< test the HBLANK (horizontal blanking) signal in PROM a63 being high |
| 1708 | | static inline bool A2_HBLANK_HI(UINT8 a) { return (a & A63_HBLANK) ? true : false; } |
| 1713 | static inline bool A63_HBLANK_HI(UINT8 a) { return (a & A63_HBLANK) ? true : false; } |
| 1709 | 1714 | //!< test the HBLANK (horizontal blanking) signal in PROM a63 being low |
| 1710 | | static inline bool A2_HBLANK_LO(UINT8 a) { return !A2_HBLANK_HI(a); } |
| 1715 | static inline bool A63_HBLANK_LO(UINT8 a) { return (a & A63_HBLANK) ? false : true; } |
| 1711 | 1716 | //!< test the HSYNC (horizontal synchonisation) signal in PROM a63 being high |
| 1712 | | static inline bool A2_HSYNC_HI(UINT8 a) { return (a & A63_HSYNC) ? true : false; } |
| 1717 | static inline bool A63_HSYNC_HI(UINT8 a) { return (a & A63_HSYNC) ? true : false; } |
| 1713 | 1718 | //!< test the HSYNC (horizontal synchonisation) signal in PROM a63 being low |
| 1714 | | static inline bool A2_HSYNC_LO(UINT8 a) { return !A2_HSYNC_HI(a); } |
| 1719 | static inline bool A63_HSYNC_LO(UINT8 a) { return (a & A63_HSYNC) ? false : true; } |
| 1715 | 1720 | //!< test the SCANEND (scanline end) signal in PROM a63 being high |
| 1716 | | static inline bool A2_SCANEND_HI(UINT8 a) { return (a & A63_SCANEND) ? true : false; } |
| 1721 | static inline bool A63_SCANEND_HI(UINT8 a) { return (a & A63_SCANEND) ? true : false; } |
| 1717 | 1722 | //!< test the SCANEND (scanline end) signal in PROM a63 being low |
| 1718 | | static inline bool A2_SCANEND_LO(UINT8 a) { return !A2_SCANEND_HI(a); } |
| 1723 | static inline bool A63_SCANEND_LO(UINT8 a) { return (a & A63_SCANEND) ? false : true; } |
| 1719 | 1724 | //!< test the HLCGATE (horz. line counter gate) signal in PROM a63 being high |
| 1720 | | static inline bool A2_HLCGATE_HI(UINT8 a) { return (a & A63_HLCGATE) ? true : false; } |
| 1725 | static inline bool A63_HLCGATE_HI(UINT8 a) { return (a & A63_HLCGATE) ? true : false; } |
| 1721 | 1726 | //!< test the HLCGATE (horz. line counter gate) signal in PROM a63 being low |
| 1722 | | static inline bool A2_HLCGATE_LO(UINT8 a) { return !A2_HLCGATE_HI(a); } |
| 1727 | static inline bool A63_HLCGATE_LO(UINT8 a) { return (a & A63_HLCGATE) ? false : true; } |
| 1723 | 1728 | |
| 1724 | 1729 | /** |
| 1725 | 1730 | * @brief vertical blank and synch PROM |
| r26245 | r26246 | |
| 1742 | 1747 | A66_VBLANK_EVEN = (1 << 3) |
| 1743 | 1748 | }; |
| 1744 | 1749 | |
| 1745 | | //! test for the VSYNC signal (depends on "field", i.e. HLC1024) |
| 1746 | | inline bool A66_VSYNC(UINT8 a) { return a & (HLC1024() ? A66_VSYNC_ODD : A66_VSYNC_EVEN) ? true : false; } |
| 1747 | | //! test for the VBLANK signal (depends on "field", i.e. HLC1024) |
| 1748 | | inline bool A66_VBLANK(UINT8 a) { return a & (HLC1024() ? A66_VBLANK_ODD : A66_VBLANK_EVEN) ? true : false; } |
| 1749 | 1750 | //! test the VSYNC (vertical synchronisation) signal in PROM a66 being high |
| 1750 | | inline bool A2_VSYNC_HI(UINT8 a) { return A66_VSYNC(a); } |
| 1751 | static inline bool A66_VSYNC_HI(UINT8 a, int hlc1024) { return a & (hlc1024 ? A66_VSYNC_ODD : A66_VSYNC_EVEN) ? true : false; } |
| 1751 | 1752 | //! test the VSYNC (vertical synchronisation) signal in PROM a66 being low |
| 1752 | | inline bool A2_VSYNC_LO(UINT8 a) { return !A66_VSYNC(a); } |
| 1753 | static inline bool A66_VSYNC_LO(UINT8 a, int hlc1024) { return a & (hlc1024 ? A66_VSYNC_ODD : A66_VSYNC_EVEN) ? false : true; } |
| 1753 | 1754 | //! test the VBLANK (vertical blanking) signal in PROM a66 being high |
| 1754 | | inline bool A2_VBLANK_HI(UINT8 a) { return A66_VBLANK(a); } |
| 1755 | static inline bool A66_VBLANK_HI(UINT8 a, int hlc1024) { return a & (hlc1024 ? A66_VBLANK_ODD : A66_VBLANK_EVEN) ? true : false; } |
| 1755 | 1756 | //! test the VBLANK (vertical blanking) signal in PROM a66 being low |
| 1756 | | inline bool A2_VBLANK_LO(UINT8 a) { return !A66_VBLANK(a); } |
| 1757 | static inline bool A66_VBLANK_LO(UINT8 a, int hlc1024) { return a & (hlc1024 ? A66_VBLANK_ODD : A66_VBLANK_EVEN) ? false : true; } |
| 1757 | 1758 | |
| 1758 | | /** |
| 1759 | | * @brief unload the next word from the display FIFO and shift it to the screen |
| 1760 | | */ |
| 1759 | //! screen bitmap |
| 1760 | bitmap_ind16* m_displ_bitmap; |
| 1761 | |
| 1762 | //! update a word in the screen bitmap |
| 1763 | void update_bitmap_word(int x, int y, UINT16 word); |
| 1764 | |
| 1765 | //! unload the next word from the display FIFO and shift it to the screen |
| 1761 | 1766 | int unload_word(int x); |
| 1762 | 1767 | |
| 1763 | 1768 | /** |
branches/alto2/src/mess/drivers/alto2.c
| r26245 | r26246 | |
| 13 | 13 | UINT32 alto2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 14 | 14 | { |
| 15 | 15 | alto2_cpu_device* cpu = downcast<alto2_cpu_device *>(m_maincpu.target()); |
| 16 | | cpu->screen_update(bitmap, cliprect); |
| 16 | copybitmap(bitmap, cpu->display(), 0, 0, 0, 0, cliprect); |
| 17 | 17 | return 0; |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | | #if 0 |
| 21 | 20 | void alto2_state::screen_eof_alto2(screen_device &screen, bool state) |
| 22 | 21 | { |
| 23 | 22 | // FIXME: what do we do here? |
| 24 | 23 | } |
| 25 | | #endif |
| 26 | 24 | |
| 27 | 25 | /* Input Ports */ |
| 28 | 26 | |
| r26245 | r26246 | |
| 253 | 251 | |
| 254 | 252 | /* video hardware */ |
| 255 | 253 | MCFG_SCREEN_ADD("screen", RASTER) |
| 256 | | MCFG_SCREEN_RAW_PARAMS(XTAL_20_16MHz, 768, 0, 606, 875, 0, 808) |
| 254 | MCFG_SCREEN_RAW_PARAMS(XTAL_20_16MHz, |
| 255 | ALTO2_DISPLAY_TOTAL_WIDTH, 0, ALTO2_DISPLAY_WIDTH, |
| 256 | ALTO2_DISPLAY_TOTAL_HEIGHT, 0, ALTO2_DISPLAY_HEIGHT) |
| 257 | 257 | MCFG_SCREEN_UPDATE_DRIVER(alto2_state, screen_update) |
| 258 | | // MCFG_SCREEN_VBLANK_DRIVER(alto2_state, screen_eof_alto2) |
| 258 | MCFG_SCREEN_VBLANK_DRIVER(alto2_state, screen_eof_alto2) |
| 259 | 259 | |
| 260 | 260 | MCFG_PALETTE_LENGTH(2) |
| 261 | 261 | |
| r26245 | r26246 | |
| 270 | 270 | alto2_cpu_device* cpu = downcast<alto2_cpu_device *>(m_maincpu.target()); |
| 271 | 271 | cpu->set_diablo(0, downcast<diablo_hd_device *>(machine().device(DIABLO_HD_0))); |
| 272 | 272 | cpu->set_diablo(1, downcast<diablo_hd_device *>(machine().device(DIABLO_HD_1))); |
| 273 | | |
| 274 | | #define UNICODE_TESTING 0 |
| 275 | | #if UNICODE_TESTING |
| 276 | | const char* filename = "docs/UnicodeData.txt"; |
| 277 | | int res = unicode_data_load(filename); |
| 278 | | logerror("%s: unicode_data_load(\"%s\") result %d\n", filename, __FUNCTION__, res); |
| 279 | | for (unicode_char uchar = 0; uchar < UNICODE_PLANESIZE; uchar++) { |
| 280 | | if (UNICODE_NOT_DECIMAL != unicode_decimal(uchar)) |
| 281 | | logerror("%s: U+%04x (%s) is decimal %u\n", __FUNCTION__, uchar, unicode_name(uchar), unicode_decimal(uchar)); |
| 282 | | if (UNICODE_NOT_DIGIT != unicode_digit(uchar)) |
| 283 | | logerror("%s: U+%04x (%s) is digit %u\n", __FUNCTION__, uchar, unicode_name(uchar), unicode_digit(uchar)); |
| 284 | | if (UNICODE_NOT_NUMERIC != unicode_digit(uchar)) |
| 285 | | logerror("%s: U+%04x (%s) is numeric %u\n", __FUNCTION__, uchar, unicode_name(uchar), unicode_numeric(uchar)); |
| 286 | | if (uchar != unicode_lcase(uchar)) |
| 287 | | logerror("%s: U+%04x (%s) lower chase is U+%04x (%s)\n", __FUNCTION__, uchar, unicode_name(uchar), unicode_lcase(uchar), unicode_name(unicode_lcase(uchar))); |
| 288 | | } |
| 289 | | unicode_data_free(); |
| 290 | | #endif |
| 291 | 273 | } |
| 292 | 274 | |
| 293 | 275 | /* Game Drivers */ |