Previous 199869 Revisions Next

r33438 Tuesday 18th November, 2014 at 18:03:04 UTC by Osso
antic: pass device_video_interface and kill some machine().first_screen() (nw)
[src/mame/video]antic.c antic.h

trunk/src/mame/video/antic.c
r241949r241950
2020const device_type ATARI_ANTIC = &device_creator<antic_device>;
2121
2222//-------------------------------------------------
23//  upd7220_device - constructor
23//  antic_device - constructor
2424//-------------------------------------------------
2525
2626antic_device::antic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
2727            device_t(mconfig, ATARI_ANTIC, "Atari ANTIC", tag, owner, clock, "antic", __FILE__),
28            device_video_interface(mconfig, *this),
2829            m_gtia_tag(NULL),
2930            m_tv_artifacts(0),
3031            m_render1(0),
r241949r241950
5960   m_gtia = machine().device<gtia_device>(m_gtia_tag);
6061   assert(m_gtia);
6162
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());
6364
6465   m_cclk_expand = auto_alloc_array_clear(machine(), UINT32, 21 * 256);
6566
r241949r241950
9697   LOG(("atari prio_init\n"));
9798   prio_init();
9899
99   for (int i = 0; i < machine().first_screen()->height(); i++)
100   for (int i = 0; i < m_screen->height(); i++)
100101      m_video[i] = auto_alloc_clear(machine(), VIDEO);
101102
102103   /* save states */
r241949r241950
15521553   UINT16 *color_lookup = m_gtia->get_color_lookup();
15531554
15541555   /* increment the scanline */
1555   if( ++m_scanline == machine().first_screen()->height() )
1556   if( ++m_scanline == m_screen->height() )
15561557   {
15571558      /* and return to the top if the frame was complete */
15581559      m_scanline = 0;
r241949r241950
16541655
16551656
16561657#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)
16581659
16591660void antic_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
16601661{
r241949r241950
16771678
16781679int antic_device::cycle()
16791680{
1680   return machine().first_screen()->hpos() * CYCLES_PER_LINE / machine().first_screen()->width();
1681   return m_screen->hpos() * CYCLES_PER_LINE / m_screen->width();
16811682}
16821683
16831684TIMER_CALLBACK_MEMBER( antic_device::issue_dli )
r241949r241950
19281929                     /* produce empty scanlines until vblank start */
19291930                     m_modelines = VBL_START + 1 - m_scanline;
19301931                     if( m_modelines < 0 )
1931                        m_modelines = machine().first_screen()->height() - m_scanline;
1932                        m_modelines = m_screen->height() - m_scanline;
19321933                     LOG(("           JVB $%04x\n", m_dpage|m_doffs));
19331934                  }
19341935                  else
r241949r241950
20812082      m_gtia->button_interrupt(button_count, machine().root_device().ioport("djoy_b")->read_safe(0));
20822083
20832084      /* 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;
20852086      m_render1 = 0;
20862087      m_render2 = 0;
20872088      m_render3 = 0;
trunk/src/mame/video/antic.h
r241949r241950
359359};
360360
361361
362class antic_device :  public device_t
362class antic_device :  public device_t,
363                        public device_video_interface
363364{
364365public:
365366   // construction/destruction


Previous 199869 Revisions Next


© 1997-2024 The MAME Team