trunk/src/mame/video/antic.c
| r241949 | r241950 | |
| 20 | 20 | const device_type ATARI_ANTIC = &device_creator<antic_device>; |
| 21 | 21 | |
| 22 | 22 | //------------------------------------------------- |
| 23 | | // upd7220_device - constructor |
| 23 | // antic_device - constructor |
| 24 | 24 | //------------------------------------------------- |
| 25 | 25 | |
| 26 | 26 | antic_device::antic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 27 | 27 | device_t(mconfig, ATARI_ANTIC, "Atari ANTIC", tag, owner, clock, "antic", __FILE__), |
| 28 | device_video_interface(mconfig, *this), |
| 28 | 29 | m_gtia_tag(NULL), |
| 29 | 30 | m_tv_artifacts(0), |
| 30 | 31 | m_render1(0), |
| r241949 | r241950 | |
| 59 | 60 | m_gtia = machine().device<gtia_device>(m_gtia_tag); |
| 60 | 61 | assert(m_gtia); |
| 61 | 62 | |
| 62 | | m_bitmap = auto_bitmap_ind16_alloc(machine(), machine().first_screen()->width(), machine().first_screen()->height()); |
| 63 | m_bitmap = auto_bitmap_ind16_alloc(machine(), m_screen->width(), m_screen->height()); |
| 63 | 64 | |
| 64 | 65 | m_cclk_expand = auto_alloc_array_clear(machine(), UINT32, 21 * 256); |
| 65 | 66 | |
| r241949 | r241950 | |
| 96 | 97 | LOG(("atari prio_init\n")); |
| 97 | 98 | prio_init(); |
| 98 | 99 | |
| 99 | | for (int i = 0; i < machine().first_screen()->height(); i++) |
| 100 | for (int i = 0; i < m_screen->height(); i++) |
| 100 | 101 | m_video[i] = auto_alloc_clear(machine(), VIDEO); |
| 101 | 102 | |
| 102 | 103 | /* save states */ |
| r241949 | r241950 | |
| 1552 | 1553 | UINT16 *color_lookup = m_gtia->get_color_lookup(); |
| 1553 | 1554 | |
| 1554 | 1555 | /* increment the scanline */ |
| 1555 | | if( ++m_scanline == machine().first_screen()->height() ) |
| 1556 | if( ++m_scanline == m_screen->height() ) |
| 1556 | 1557 | { |
| 1557 | 1558 | /* and return to the top if the frame was complete */ |
| 1558 | 1559 | m_scanline = 0; |
| r241949 | r241950 | |
| 1654 | 1655 | |
| 1655 | 1656 | |
| 1656 | 1657 | #define ANTIC_TIME_FROM_CYCLES(cycles) \ |
| 1657 | | (attotime)(machine().first_screen()->scan_period() * (cycles) / CYCLES_PER_LINE) |
| 1658 | (attotime)(m_screen->scan_period() * (cycles) / CYCLES_PER_LINE) |
| 1658 | 1659 | |
| 1659 | 1660 | void antic_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
| 1660 | 1661 | { |
| r241949 | r241950 | |
| 1677 | 1678 | |
| 1678 | 1679 | int antic_device::cycle() |
| 1679 | 1680 | { |
| 1680 | | return machine().first_screen()->hpos() * CYCLES_PER_LINE / machine().first_screen()->width(); |
| 1681 | return m_screen->hpos() * CYCLES_PER_LINE / m_screen->width(); |
| 1681 | 1682 | } |
| 1682 | 1683 | |
| 1683 | 1684 | TIMER_CALLBACK_MEMBER( antic_device::issue_dli ) |
| r241949 | r241950 | |
| 1928 | 1929 | /* produce empty scanlines until vblank start */ |
| 1929 | 1930 | m_modelines = VBL_START + 1 - m_scanline; |
| 1930 | 1931 | if( m_modelines < 0 ) |
| 1931 | | m_modelines = machine().first_screen()->height() - m_scanline; |
| 1932 | m_modelines = m_screen->height() - m_scanline; |
| 1932 | 1933 | LOG((" JVB $%04x\n", m_dpage|m_doffs)); |
| 1933 | 1934 | } |
| 1934 | 1935 | else |
| r241949 | r241950 | |
| 2081 | 2082 | m_gtia->button_interrupt(button_count, machine().root_device().ioport("djoy_b")->read_safe(0)); |
| 2082 | 2083 | |
| 2083 | 2084 | /* do nothing new for the rest of the frame */ |
| 2084 | | m_modelines = machine().first_screen()->height() - VBL_START; |
| 2085 | m_modelines = m_screen->height() - VBL_START; |
| 2085 | 2086 | m_render1 = 0; |
| 2086 | 2087 | m_render2 = 0; |
| 2087 | 2088 | m_render3 = 0; |