Previous 15994 Revisions Next

r1999 Sunday 16th March, 2008 at 23:53:08 UTC by Nathan Woods
Fixed some video calls that were changed in the 0.123u5 update
[src/mess/drivers]a310.c amstrad.c spectrum.c x68k.c
[src/mess/machine]apple2.c apple2gs.c coco.c genesis.c lisa.c mac.c mz700.c nes_mmc.c osborne1.c primo.c vtech1.c zx.c
[src/mess/video]apple1.c astrocde.c atarist.c bbc.c border.c cdp1861.c cdp1864.c electron.c kc.c mbee.c odyssey2.c smsvdp.c spectrum.c x68k.c zx.c

src/mess/video/zx.c
r1998r1999
1717****************************************************************************/
1818
1919#include "driver.h"
20#include "deprecat.h"
2021#include "cpu/z80/z80.h"
2122#include "includes/zx.h"
2223#include "sound/dac.h"
r1998r1999
5253      rectangle r;
5354      bitmap_t *bitmap = tmpbitmap;
5455
55      new_y = video_screen_get_vpos(0);
56      new_x = video_screen_get_hpos(0);
56      new_y = video_screen_get_vpos(machine->primary_screen);
57      new_x = video_screen_get_hpos(machine->primary_screen);
5758/*      logerror("zx_ula_bkgnd: %3d,%3d - %3d,%3d\n", old_x, old_y, new_x, new_y);*/
5859      y = old_y;
5960      for (;;)
r1998r1999
106107   rectangle r = *video_screen_get_visible_area(screen);
107108   bitmap_t *bitmap = tmpbitmap;
108109
109   r.min_y = r.max_y = video_screen_get_vpos(0);
110   r.min_y = r.max_y = video_screen_get_vpos(machine->primary_screen);
110111   fillbitmap(bitmap, machine->pens[1], &r);
111   logerror("ULA %3d[%d] NMI, R:$%02X, $%04x\n", video_screen_get_vpos(0), ula_scancode_count, (unsigned) cpunum_get_reg(0, Z80_R), (unsigned) cpunum_get_reg(0, Z80_PC));
112   logerror("ULA %3d[%d] NMI, R:$%02X, $%04x\n", video_screen_get_vpos(machine->primary_screen), ula_scancode_count, (unsigned) cpunum_get_reg(0, Z80_R), (unsigned) cpunum_get_reg(0, Z80_PC));
112113   cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, PULSE_LINE);
113114   if (++ula_scanline_count == height)
114115      ula_scanline_count = 0;
r1998r1999
126127    */
127128   if (ula_irq_active)
128129   {
129      logerror("ULA %3d[%d] IRQ, R:$%02X, $%04x\n", video_screen_get_vpos(0), ula_scancode_count, (unsigned) cpunum_get_reg(0, Z80_R), (unsigned) cpunum_get_reg(0, Z80_PC));
130      logerror("ULA %3d[%d] IRQ, R:$%02X, $%04x\n", video_screen_get_vpos(machine->primary_screen), ula_scancode_count, (unsigned) cpunum_get_reg(0, Z80_R), (unsigned) cpunum_get_reg(0, Z80_PC));
130131
131132      ula_irq_active = 0;
132133      if (++ula_scancode_count == 8)
r1998r1999
151152      chrgen = memory_region(region);
152153      ireg = cpunum_get_reg(0, Z80_I) << 8;
153154      rreg = cpunum_get_reg(0, Z80_R);
154      y = video_screen_get_vpos(0);
155      y = video_screen_get_vpos(Machine->primary_screen);
155156
156157      cycles = 4 * (64 - (rreg & 63));
157158      timer_set(ATTOTIME_IN_CYCLES(cycles, 0), NULL, 0, zx_ula_irq);
src/mess/video/mbee.c
r1998r1999
209209   const device_config *screen = video_screen_first(machine->config);
210210   const rectangle *visarea = video_screen_get_visible_area(screen);
211211
212   int data = 0, y = video_screen_get_vpos(0);
212   int data = 0, y = video_screen_get_vpos(machine->primary_screen);
213213
214214   if( y < visarea->min_y ||
215215      y > visarea->max_y )
src/mess/video/x68k.c
r1998r1999
229229
230230   video_screen_configure(machine->primary_screen,sys.crtc.video_width,sys.crtc.video_height,&rect,HZ_TO_ATTOSECONDS(55.45));
231231   logerror("video_screen_configure(machine->primary_screen,%i,%i,[%i,%i,%i,%i],55.45)\n",sys.crtc.video_width,sys.crtc.video_height,rect.min_x,rect.min_y,rect.max_x,rect.max_y);
232//   x68k_scanline = video_screen_get_vpos(0);
232//   x68k_scanline = video_screen_get_vpos(machine->primary_screen);
233233   if(sys.crtc.reg[4] != 0)
234234   {
235235//      scantime = ATTOTIME_IN_HZ(55.45) / sys.crtc.reg[4];
r1998r1999
245245   sys.crtc.hblank = state;
246246   if(state == 1)
247247   {
248      int scan = video_screen_get_vpos(0);
248      int scan = video_screen_get_vpos(machine->primary_screen);
249249      if(scan > sys.crtc.vend)
250250         scan = 0;
251      hsync_time = video_screen_get_time_until_pos(0,scan+1,sys.crtc.hsync_end);
251      hsync_time = video_screen_get_time_until_pos(machine->primary_screen,scan+1,sys.crtc.hsync_end);
252252      timer_adjust_oneshot(scanline_timer, hsync_time, 0);
253253   }
254254   if(state == 0)
255255   {
256      hsync_time = video_screen_get_time_until_pos(0,video_screen_get_vpos(0),sys.crtc.hend);
256      hsync_time = video_screen_get_time_until_pos(machine->primary_screen,video_screen_get_vpos(machine->primary_screen),sys.crtc.hend);
257257      timer_adjust_oneshot(scanline_timer, hsync_time, 1);
258258//      if(!(sys.mfp.gpio & 0x40))  // if GPIP6 is active, clear it
259259//         sys.mfp.gpio |= 0x40;
r1998r1999
277277      video_screen_update_partial(0,scan);
278278   }
279279
280   irq_time = video_screen_get_time_until_pos(0,scan,2);
280   irq_time = video_screen_get_time_until_pos(machine->primary_screen,scan,2);
281281   // end of HBlank period clears GPIP6 also?
282   end_time = video_screen_get_time_until_pos(0,scan,sys.crtc.hbegin);
282   end_time = video_screen_get_time_until_pos(machine->primary_screen,scan,sys.crtc.hbegin);
283283   timer_adjust_oneshot(raster_irq, irq_time, scan);
284284   timer_set(end_time,NULL,0,x68k_crtc_raster_end);
285   logerror("GPIP6: Raster triggered at line %i (%i)\n",scan,video_screen_get_vpos(0));
285   logerror("GPIP6: Raster triggered at line %i (%i)\n",scan,video_screen_get_vpos(machine->primary_screen));
286286}
287287
288288TIMER_CALLBACK(x68k_crtc_vblank_irq)
r1998r1999
297297      vblank_line = sys.crtc.vend;
298298      if(vblank_line > sys.crtc.vtotal)
299299         vblank_line = sys.crtc.vtotal;
300      irq_time = video_screen_get_time_until_pos(0,vblank_line,2);
300      irq_time = video_screen_get_time_until_pos(machine->primary_screen,vblank_line,2);
301301      timer_adjust_oneshot(vblank_irq, irq_time, 0);
302302      logerror("CRTC: VBlank on\n");
303303   }
r1998r1999
305305   {
306306      sys.crtc.vblank = 0;
307307      vblank_line = sys.crtc.vbegin;
308      irq_time = video_screen_get_time_until_pos(0,vblank_line,2);
308      irq_time = video_screen_get_time_until_pos(machine->primary_screen,vblank_line,2);
309309      timer_adjust_oneshot(vblank_irq, irq_time, 1);
310310      logerror("CRTC: VBlank off\n");
311311   }
r1998r1999
381381      if(data != 0)
382382      {
383383         attotime irq_time;
384         irq_time = video_screen_get_time_until_pos(0,(data - 1) / sys.crtc.vmultiple,2);
384         irq_time = video_screen_get_time_until_pos(machine->primary_screen,(data - 1) / sys.crtc.vmultiple,2);
385385
386386         if(attotime_to_double(irq_time) > 0)
387387            timer_adjust_oneshot(raster_irq, irq_time, (data - 1) / sys.crtc.vmultiple);
src/mess/video/spectrum.c
r1998r1999
111111                pItem = EventList_GetFirstItem();
112112                set_last_border_color ( pItem[NumItems-1].Event_Data );
113113                EventList_Reset();
114            EventList_SetOffsetStartTime ( ATTOTIME_TO_CYCLES(0, attotime_mul(video_screen_get_scan_period(0), video_screen_get_vpos(0))) );
114            EventList_SetOffsetStartTime ( ATTOTIME_TO_CYCLES(0, attotime_mul(video_screen_get_scan_period(machine->primary_screen), video_screen_get_vpos(machine->primary_screen))) );
115115                logerror ("Event log reset in callback fn.\n");
116116        }
117117}
r1998r1999
138138                pItem = EventList_GetFirstItem();
139139                set_last_border_color ( pItem[NumItems-1].Event_Data );
140140                EventList_Reset();
141            EventList_SetOffsetStartTime ( ATTOTIME_TO_CYCLES(0, attotime_mul(video_screen_get_scan_period(0), video_screen_get_vpos(0))) );
141            EventList_SetOffsetStartTime ( ATTOTIME_TO_CYCLES(0, attotime_mul(video_screen_get_scan_period(machine->primary_screen), video_screen_get_vpos(machine->primary_screen))) );
142142                logerror ("Event log reset in callback fn.\n");
143143        }
144144}
src/mess/video/astrocde.c
r1998r1999
176176
177177READ8_HANDLER( astrocade_video_retrace_r )
178178{
179    return video_screen_get_vpos(0);
179    return video_screen_get_vpos(machine->primary_screen);
180180}
181181
182182
r1998r1999
455455
456456VIDEO_UPDATE( astrocde )
457457{
458   int line = video_screen_get_vpos(0);
458   int line = video_screen_get_vpos(screen);
459459    int num_bytes = astrocade_mode ? 80 : 40;
460460    int memloc = line * num_bytes;
461461    int vblank_start = astrocade_mode ? VerticalBlank : VerticalBlank >> 1;
src/mess/video/atarist.c
r1998r1999
102102
103103static TIMER_CALLBACK(atarist_shifter_tick)
104104{
105   int y = video_screen_get_vpos(0);
106   int x = video_screen_get_hpos(0);
105   int y = video_screen_get_vpos(machine->primary_screen);
106   int x = video_screen_get_hpos(machine->primary_screen);
107107
108108   pen_t pen;
109109
r1998r1999
150150
151151static TIMER_CALLBACK(atarist_glue_tick)
152152{
153   int y = video_screen_get_vpos(0);
154   int x = video_screen_get_hpos(0);
153   int y = video_screen_get_vpos(machine->primary_screen);
154   int x = video_screen_get_hpos(machine->primary_screen);
155155
156156   int v = (y >= shifter.y_start) && (y < shifter.y_end);
157157   int h = (x >= shifter.x_start) && (x < shifter.x_end);
r1998r1999
721721   atarist_shifter_timer = timer_alloc(atarist_shifter_tick, NULL);
722722   atarist_glue_timer = timer_alloc(atarist_glue_tick, NULL);
723723
724   timer_adjust_periodic(atarist_shifter_timer, video_screen_get_time_until_pos(0,0,0), 0, ATTOTIME_IN_HZ(Y2/4)); // 125 ns
725   timer_adjust_periodic(atarist_glue_timer, video_screen_get_time_until_pos(0,0,0), 0, ATTOTIME_IN_HZ(Y2/16)); // 500 ns
724   timer_adjust_periodic(atarist_shifter_timer, video_screen_get_time_until_pos(machine->primary_screen,0,0), 0, ATTOTIME_IN_HZ(Y2/4)); // 125 ns
725   timer_adjust_periodic(atarist_glue_timer, video_screen_get_time_until_pos(machine->primary_screen,0,0), 0, ATTOTIME_IN_HZ(Y2/16)); // 500 ns
726726
727727   memset(&shifter, 0, sizeof(shifter));
728728
src/mess/video/border.c
r1998r1999
341341
342342   /* Assume all other routines have processed their data from the list */
343343   EventList_Reset();
344   EventList_SetOffsetStartTime ( ATTOTIME_TO_CYCLES(0, attotime_mul(video_screen_get_scan_period(0), video_screen_get_vpos(0))) );
344   EventList_SetOffsetStartTime ( ATTOTIME_TO_CYCLES(0, attotime_mul(video_screen_get_scan_period(machine->primary_screen), video_screen_get_vpos(machine->primary_screen))) );
345345}
src/mess/video/electron.c
r1998r1999
6161   int i;
6262   int x = 0;
6363   int pal[16];
64   int scanline = video_screen_get_vpos(0);
64   int scanline = video_screen_get_vpos(screen);
6565   rectangle r = *cliprect;
6666   r.min_y = r.max_y = scanline;
6767
r1998r1999
245245
246246INTERRUPT_GEN( electron_scanline_interrupt )
247247{
248   switch (video_screen_get_vpos(0))
248   switch (video_screen_get_vpos(machine->primary_screen))
249249   {
250250   case 43:
251251      electron_interrupt_handler( machine, INT_SET, INT_RTC );
src/mess/video/apple1.c
r1998r1999
179179{
180180   int cursor_x, cursor_y;
181181   int cursor_scanline;
182   double scanline_period = attotime_to_double(video_screen_get_scan_period(0));
182   double scanline_period = attotime_to_double(video_screen_get_scan_period(machine->primary_screen));
183183   double cursor_hfrac;
184184
185185   /* The video hardware refreshes the screen by reading the
r1998r1999
198198      for the visible part of the scanline. */
199199   cursor_hfrac = (175 + cursor_x * apple1_charlayout.width) / 455;
200200
201   if (video_screen_get_vpos(0) == cursor_scanline) {
201   if (video_screen_get_vpos(machine->primary_screen) == cursor_scanline) {
202202      /* video_screen_get_hpos() doesn't account for the horizontal
203203         blanking interval; it acts as if the scanline period is
204204         entirely composed of visible pixel times.  However, we can
205205         still use it to find what fraction of the current scanline
206206         period has elapsed. */
207      double current_hfrac = video_screen_get_hpos(0) /
207      double current_hfrac = video_screen_get_hpos(machine->primary_screen) /
208208                        video_screen_get_width(video_screen_first(machine->config));
209209      if (current_hfrac < cursor_hfrac)
210210         return double_to_attotime(scanline_period * (cursor_hfrac - current_hfrac));
211211   }
212212
213213   return double_to_attotime(
214      attotime_to_double(video_screen_get_time_until_pos(0, cursor_scanline, 0)) +
214      attotime_to_double(video_screen_get_time_until_pos(machine->primary_screen, cursor_scanline, 0)) +
215215      scanline_period * cursor_hfrac);
216216}
217217
src/mess/video/smsvdp.c
r1998r1999
167167}
168168
169169 READ8_HANDLER(sms_vdp_vcount_r) {
170   return ( smsvdp.sms_frame_timing[ INIT_VCOUNT ] + video_screen_get_vpos(0) ) & 0xFF;
170   return ( smsvdp.sms_frame_timing[ INIT_VCOUNT ] + video_screen_get_vpos(machine->primary_screen) ) & 0xFF;
171171}
172172
173173READ8_HANDLER(sms_vdp_hcount_r) {
174   return video_screen_get_hpos(0) >> 1;
174   return video_screen_get_hpos(machine->primary_screen) >> 1;
175175}
176176
177177void sms_set_ggsmsmode( int mode ) {
r1998r1999
217217   set_display_settings( machine );
218218
219219   smsvdp.smsvdp_display_timer = timer_alloc( smsvdp_display_callback , NULL);
220   timer_adjust_periodic(smsvdp.smsvdp_display_timer, video_screen_get_time_until_pos( 0, 0, 0 ), 0, video_screen_get_scan_period( 0 ));
220   timer_adjust_periodic(smsvdp.smsvdp_display_timer, video_screen_get_time_until_pos(machine->primary_screen, 0, 0 ), 0, video_screen_get_scan_period( 0 ));
221221   return 0;
222222}
223223
r1998r1999
231231static TIMER_CALLBACK(smsvdp_display_callback)
232232{
233233   rectangle rec;
234   int vpos = video_screen_get_vpos(0);
234   int vpos = video_screen_get_vpos(machine->primary_screen);
235235   int vpos_limit = smsvdp.sms_frame_timing[VERTICAL_BLANKING] + smsvdp.sms_frame_timing[TOP_BLANKING]
236236                  + smsvdp.sms_frame_timing[TOP_BORDER] + smsvdp.sms_frame_timing[ACTIVE_DISPLAY_V]
237237                  + smsvdp.sms_frame_timing[BOTTOM_BORDER] + smsvdp.sms_frame_timing[BOTTOM_BLANKING];
r1998r1999
261261            smsvdp.status |= STATUS_HINT;
262262            if ( smsvdp.reg[0x00] & 0x10 ) {
263263               /* Delay triggering of interrupt to allow software to read the status bit before the irq */
264               timer_set( video_screen_get_time_until_pos( 0, video_screen_get_vpos(0), video_screen_get_hpos(0) + 1 ), NULL, 0, smsvdp_set_irq );
264               timer_set( video_screen_get_time_until_pos(machine->primary_screen, video_screen_get_vpos(machine->primary_screen), video_screen_get_hpos(machine->primary_screen) + 1 ), NULL, 0, smsvdp_set_irq );
265265            }
266266         }
267267
r1998r1999
270270         smsvdp.status |= STATUS_VINT;
271271         if ( smsvdp.reg[0x01] & 0x20 ) {
272272            /* Delay triggering of interrupt to allow software to read the status bit before the irq */
273            timer_set( video_screen_get_time_until_pos( 0, video_screen_get_vpos(0), video_screen_get_hpos(0) + 1 ), NULL, 0, smsvdp_set_irq );
273            timer_set( video_screen_get_time_until_pos(machine->primary_screen, video_screen_get_vpos(machine->primary_screen), video_screen_get_hpos(machine->primary_screen) + 1 ), NULL, 0, smsvdp_set_irq );
274274         }
275275      }
276276      if ( video_skip_this_frame() ) {
r1998r1999
305305         smsvdp.status |= STATUS_HINT;
306306         if ( smsvdp.reg[0x00] & 0x10 ) {
307307            /* Delay triggering of interrupt to allow software to read the status bit before the irq */
308            timer_set( video_screen_get_time_until_pos( 0, video_screen_get_vpos(0), video_screen_get_hpos(0) + 1 ), NULL, 0, smsvdp_set_irq );
308            timer_set( video_screen_get_time_until_pos(machine->primary_screen, video_screen_get_vpos(machine->primary_screen), video_screen_get_hpos(machine->primary_screen) + 1 ), NULL, 0, smsvdp_set_irq );
309309         }
310310      } else {
311311         smsvdp.line_counter -= 1;
src/mess/video/cdp1864.c
r1998r1999
3030
3131static TIMER_CALLBACK(cdp1864_int_tick)
3232{
33   int scanline = video_screen_get_vpos(0);
33   int scanline = video_screen_get_vpos(machine->primary_screen);
3434
3535   if (scanline == CDP1864_SCANLINE_INT_START)
3636   {
r1998r1999
4040         cdp1864.dmaptr = 0;
4141      }
4242
43      timer_adjust_oneshot(cdp1864_int_timer, video_screen_get_time_until_pos(0, CDP1864_SCANLINE_INT_END, 0), 0);
43      timer_adjust_oneshot(cdp1864_int_timer, video_screen_get_time_until_pos(machine->primary_screen, CDP1864_SCANLINE_INT_END, 0), 0);
4444   }
4545   else
4646   {
r1998r1999
4949         cpunum_set_input_line(machine, 0, CDP1802_INPUT_LINE_INT, CLEAR_LINE);
5050      }
5151
52      timer_adjust_oneshot(cdp1864_int_timer, video_screen_get_time_until_pos(0, CDP1864_SCANLINE_INT_START, 0), 0);
52      timer_adjust_oneshot(cdp1864_int_timer, video_screen_get_time_until_pos(machine->primary_screen, CDP1864_SCANLINE_INT_START, 0), 0);
5353   }
5454}
5555
5656static TIMER_CALLBACK(cdp1864_efx_tick)
5757{
58   int scanline = video_screen_get_vpos(0);
58   int scanline = video_screen_get_vpos(machine->primary_screen);
5959
6060   switch (scanline)
6161   {
6262   case CDP1864_SCANLINE_EFX_TOP_START:
6363      cdp1864_efx = ASSERT_LINE;
64      timer_adjust_oneshot(cdp1864_efx_timer, video_screen_get_time_until_pos(0, CDP1864_SCANLINE_EFX_TOP_END, 0), 0);
64      timer_adjust_oneshot(cdp1864_efx_timer, video_screen_get_time_until_pos(machine->primary_screen, CDP1864_SCANLINE_EFX_TOP_END, 0), 0);
6565      break;
6666
6767   case CDP1864_SCANLINE_EFX_TOP_END:
6868      cdp1864_efx = CLEAR_LINE;
69      timer_adjust_oneshot(cdp1864_efx_timer, video_screen_get_time_until_pos(0, CDP1864_SCANLINE_EFX_BOTTOM_START, 0), 0);
69      timer_adjust_oneshot(cdp1864_efx_timer, video_screen_get_time_until_pos(machine->primary_screen, CDP1864_SCANLINE_EFX_BOTTOM_START, 0), 0);
7070      break;
7171
7272   case CDP1864_SCANLINE_EFX_BOTTOM_START:
7373      cdp1864_efx = ASSERT_LINE;
74      timer_adjust_oneshot(cdp1864_efx_timer, video_screen_get_time_until_pos(0, CDP1864_SCANLINE_EFX_BOTTOM_END, 0), 0);
74      timer_adjust_oneshot(cdp1864_efx_timer, video_screen_get_time_until_pos(machine->primary_screen, CDP1864_SCANLINE_EFX_BOTTOM_END, 0), 0);
7575      break;
7676
7777   case CDP1864_SCANLINE_EFX_BOTTOM_END:
7878      cdp1864_efx = CLEAR_LINE;
79      timer_adjust_oneshot(cdp1864_efx_timer, video_screen_get_time_until_pos(0, CDP1864_SCANLINE_EFX_TOP_START, 0), 0);
79      timer_adjust_oneshot(cdp1864_efx_timer, video_screen_get_time_until_pos(machine->primary_screen, CDP1864_SCANLINE_EFX_TOP_START, 0), 0);
8080      break;
8181   }
8282}
8383
8484static TIMER_CALLBACK(cdp1864_dma_tick)
8585{
86   int scanline = video_screen_get_vpos(0);
86   int scanline = video_screen_get_vpos(machine->primary_screen);
8787
8888   if (cdp1864.dmaout)
8989   {
r1998r1999
117117
118118void cdp1864_dma_w(UINT8 data)
119119{
120   int sx = video_screen_get_hpos(0) + 4;
121   int y = video_screen_get_vpos(0);
120   int sx = video_screen_get_hpos(Machine->primary_screen) + 4;
121   int y = video_screen_get_vpos(Machine->primary_screen);
122122   int x;
123123
124124   for (x = 0; x < 8; x++)
r1998r1999
180180
181181MACHINE_RESET( cdp1864 )
182182{
183   timer_adjust_oneshot(cdp1864_int_timer, video_screen_get_time_until_pos(0, CDP1864_SCANLINE_INT_START, 0), 0);
184   timer_adjust_oneshot(cdp1864_efx_timer, video_screen_get_time_until_pos(0, CDP1864_SCANLINE_EFX_TOP_START, 0), 0);
183   timer_adjust_oneshot(cdp1864_int_timer, video_screen_get_time_until_pos(machine->primary_screen, CDP1864_SCANLINE_INT_START, 0), 0);
184   timer_adjust_oneshot(cdp1864_efx_timer, video_screen_get_time_until_pos(machine->primary_screen, CDP1864_SCANLINE_EFX_TOP_START, 0), 0);
185185   timer_adjust_oneshot(cdp1864_dma_timer, ATTOTIME_IN_CYCLES(CDP1864_CYCLES_DMA_START, 0), 0);
186186
187187   cdp1864.disp = 0;
src/mess/video/odyssey2.c
r1998r1999
549549   tmp_bitmap = auto_bitmap_alloc( width, height, video_screen_get_format(screen) );
550550
551551   i824x_line_timer = timer_alloc( i824x_scanline_callback, NULL );
552   timer_adjust_periodic( i824x_line_timer, video_screen_get_time_until_pos( 0, 1, I824X_START_ACTIVE_SCAN ), 0, video_screen_get_scan_period( 0 ) );
552   timer_adjust_periodic( i824x_line_timer, video_screen_get_time_until_pos(machine->primary_screen, 1, I824X_START_ACTIVE_SCAN ), 0, video_screen_get_scan_period( 0 ) );
553553
554554   i824x_hblank_timer = timer_alloc( i824x_hblank_callback, NULL );
555   timer_adjust_periodic( i824x_hblank_timer, video_screen_get_time_until_pos( 0, 1, I824X_END_ACTIVE_SCAN + 18 ), 0, video_screen_get_scan_period( 0 ) );
555   timer_adjust_periodic( i824x_hblank_timer, video_screen_get_time_until_pos(machine->primary_screen, 1, I824X_END_ACTIVE_SCAN + 18 ), 0, video_screen_get_scan_period( 0 ) );
556556}
557557
558558/***************************************************************************
src/mess/video/cdp1861.c
r1998r1999
2121
2222static TIMER_CALLBACK(cdp1861_int_tick)
2323{
24   int scanline = video_screen_get_vpos(0);
24   int scanline = video_screen_get_vpos(machine->primary_screen);
2525
2626   if (scanline == CDP1861_SCANLINE_INT_START)
2727   {
r1998r1999
3030         cpunum_set_input_line(machine, 0, CDP1802_INPUT_LINE_INT, HOLD_LINE);
3131      }
3232
33      timer_adjust_oneshot(cdp1861_int_timer, video_screen_get_time_until_pos(0, CDP1861_SCANLINE_INT_END, 0), 0);
33      timer_adjust_oneshot(cdp1861_int_timer, video_screen_get_time_until_pos(machine->primary_screen, CDP1861_SCANLINE_INT_END, 0), 0);
3434   }
3535   else
3636   {
r1998r1999
3939         cpunum_set_input_line(machine, 0, CDP1802_INPUT_LINE_INT, CLEAR_LINE);
4040      }
4141
42      timer_adjust_oneshot(cdp1861_int_timer, video_screen_get_time_until_pos(0, CDP1861_SCANLINE_INT_START, 0), 0);
42      timer_adjust_oneshot(cdp1861_int_timer, video_screen_get_time_until_pos(machine->primary_screen, CDP1861_SCANLINE_INT_START, 0), 0);
4343   }
4444}
4545
4646static TIMER_CALLBACK(cdp1861_efx_tick)
4747{
48   int scanline = video_screen_get_vpos(0);
48   int scanline = video_screen_get_vpos(machine->primary_screen);
4949
5050   switch (scanline)
5151   {
5252   case CDP1861_SCANLINE_EFX_TOP_START:
5353      cdp1861_efx = ASSERT_LINE;
54      timer_adjust_oneshot(cdp1861_efx_timer, video_screen_get_time_until_pos(0, CDP1861_SCANLINE_EFX_TOP_END, 0), 0);
54      timer_adjust_oneshot(cdp1861_efx_timer, video_screen_get_time_until_pos(machine->primary_screen, CDP1861_SCANLINE_EFX_TOP_END, 0), 0);
5555      break;
5656
5757   case CDP1861_SCANLINE_EFX_TOP_END:
5858      cdp1861_efx = CLEAR_LINE;
59      timer_adjust_oneshot(cdp1861_efx_timer, video_screen_get_time_until_pos(0, CDP1861_SCANLINE_EFX_BOTTOM_START, 0), 0);
59      timer_adjust_oneshot(cdp1861_efx_timer, video_screen_get_time_until_pos(machine->primary_screen, CDP1861_SCANLINE_EFX_BOTTOM_START, 0), 0);
6060      break;
6161
6262   case CDP1861_SCANLINE_EFX_BOTTOM_START:
6363      cdp1861_efx = ASSERT_LINE;
64      timer_adjust_oneshot(cdp1861_efx_timer, video_screen_get_time_until_pos(0, CDP1861_SCANLINE_EFX_BOTTOM_END, 0), 0);
64      timer_adjust_oneshot(cdp1861_efx_timer, video_screen_get_time_until_pos(machine->primary_screen, CDP1861_SCANLINE_EFX_BOTTOM_END, 0), 0);
6565      break;
6666
6767   case CDP1861_SCANLINE_EFX_BOTTOM_END:
6868      cdp1861_efx = CLEAR_LINE;
69      timer_adjust_oneshot(cdp1861_efx_timer, video_screen_get_time_until_pos(0, CDP1861_SCANLINE_EFX_TOP_START, 0), 0);
69      timer_adjust_oneshot(cdp1861_efx_timer, video_screen_get_time_until_pos(machine->primary_screen, CDP1861_SCANLINE_EFX_TOP_START, 0), 0);
7070      break;
7171   }
7272}
7373
7474static TIMER_CALLBACK(cdp1861_dma_tick)
7575{
76   int scanline = video_screen_get_vpos(0);
76   int scanline = video_screen_get_vpos(machine->primary_screen);
7777
7878   if (cdp1861.dmaout)
7979   {
r1998r1999
107107
108108void cdp1861_dma_w(UINT8 data)
109109{
110   int sx = video_screen_get_hpos(0) + 4;
111   int y = video_screen_get_vpos(0);
110   int sx = video_screen_get_hpos(Machine->primary_screen) + 4;
111   int y = video_screen_get_vpos(Machine->primary_screen);
112112   int x;
113113
114114   for (x = 0; x < 8; x++)
r1998r1999
121121
122122MACHINE_RESET( cdp1861 )
123123{
124   timer_adjust_oneshot(cdp1861_int_timer, video_screen_get_time_until_pos(0, CDP1861_SCANLINE_INT_START, 0), 0);
125   timer_adjust_oneshot(cdp1861_efx_timer, video_screen_get_time_until_pos(0, CDP1861_SCANLINE_EFX_TOP_START, 0), 0);
124   timer_adjust_oneshot(cdp1861_int_timer, video_screen_get_time_until_pos(machine->primary_screen, CDP1861_SCANLINE_INT_START, 0), 0);
125   timer_adjust_oneshot(cdp1861_efx_timer, video_screen_get_time_until_pos(machine->primary_screen, CDP1861_SCANLINE_EFX_TOP_START, 0), 0);
126126   timer_adjust_oneshot(cdp1861_dma_timer, ATTOTIME_IN_CYCLES(CDP1861_CYCLES_DMA_START, 0), 0);
127127
128128   cdp1861.disp = 0;
src/mess/video/bbc.c
r1998r1999
278278
279279   // emulation refresh optimisation
280280   video_refresh=1;
281   video_screen_update_partial(0, video_screen_get_vpos(0) - 1);
281   video_screen_update_partial(0, video_screen_get_vpos(machine->primary_screen) - 1);
282282
283283//   logerror("setting videoULA %s at %.4x size:%.4x\n",image_filename(image), addr, size);
284   logerror("setting videoULA %.4x to:%.4x   at :%d \n",data,offset,video_screen_get_vpos(0) );
284   logerror("setting videoULA %.4x to:%.4x   at :%d \n",data,offset,video_screen_get_vpos(machine->primary_screen) );
285285
286286
287287   switch (offset&0x01)
src/mess/video/kc.c
r1998r1999
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1011#include "includes/kc.h"
1112#include "eventlst.h"
1213
r1998r1999
111112/* set new blink state - record blink state in event list */
112113void   kc85_video_set_blink_state(int data)
113114{
114   EventList_AddItemOffset(KC85_VIDEO_EVENT_SET_BLINK_STATE, ((data & 0x01)<<7), ATTOTIME_TO_CYCLES(0, attotime_mul(video_screen_get_scan_period(0), video_screen_get_vpos(0))));
115   EventList_AddItemOffset(KC85_VIDEO_EVENT_SET_BLINK_STATE, ((data & 0x01)<<7), ATTOTIME_TO_CYCLES(0, attotime_mul(video_screen_get_scan_period(Machine->primary_screen), video_screen_get_vpos(Machine->primary_screen))));
115116}
116117
117118
r1998r1999
548549   /* process remainder */
549550   kc85_common_vh_process_lines(machine, &video_update, cycles_remaining_in_frame);
550551   EventList_Reset();
551   EventList_SetOffsetStartTime ( ATTOTIME_TO_CYCLES(0, attotime_mul(video_screen_get_scan_period(0), video_screen_get_vpos(0))) );
552   EventList_SetOffsetStartTime ( ATTOTIME_TO_CYCLES(0, attotime_mul(video_screen_get_scan_period(machine->primary_screen), video_screen_get_vpos(machine->primary_screen))) );
552553}
553554
554555
r1998r1999
571572      {
572573         pItem = EventList_GetFirstItem();
573574         EventList_Reset();
574         EventList_SetOffsetStartTime ( ATTOTIME_TO_CYCLES(0, attotime_mul(video_screen_get_scan_period(0), video_screen_get_vpos(0))) );
575         EventList_SetOffsetStartTime ( ATTOTIME_TO_CYCLES(0, attotime_mul(video_screen_get_scan_period(machine->primary_screen), video_screen_get_vpos(machine->primary_screen))) );
575576         logerror ("Event log reset in callback fn.\n");
576577      }
577578}
src/mess/machine/zx.c
r1998r1999
1616#define   DEBUG_ZX81_PORTS   1
1717#define DEBUG_ZX81_VSYNC   1
1818
19#define LOG_ZX81_IOR(_comment) { if (DEBUG_ZX81_PORTS) logerror("ZX81 IOR: %04x, Data: %02x, Scanline: %d (%s)\n", offset, data, video_screen_get_vpos(0), _comment); }
20#define LOG_ZX81_IOW(_comment) { if (DEBUG_ZX81_PORTS) logerror("ZX81 IOW: %04x, Data: %02x, Scanline: %d (%s)\n", offset, data, video_screen_get_vpos(0), _comment); }
21#define LOG_ZX81_VSYNC { if (DEBUG_ZX81_VSYNC) logerror("VSYNC starts in scanline: %d\n", video_screen_get_vpos(0)); }
19#define LOG_ZX81_IOR(_comment) { if (DEBUG_ZX81_PORTS) logerror("ZX81 IOR: %04x, Data: %02x, Scanline: %d (%s)\n", offset, data, video_screen_get_vpos(machine->primary_screen), _comment); }
20#define LOG_ZX81_IOW(_comment) { if (DEBUG_ZX81_PORTS) logerror("ZX81 IOW: %04x, Data: %02x, Scanline: %d (%s)\n", offset, data, video_screen_get_vpos(machine->primary_screen), _comment); }
21#define LOG_ZX81_VSYNC { if (DEBUG_ZX81_VSYNC) logerror("VSYNC starts in scanline: %d\n", video_screen_get_vpos(machine->primary_screen)); }
2222
2323static UINT8 zx_tape_bit = 0x80;
2424
r1998r1999
9494      zx_ula_bkgnd(machine, 1);
9595      if (ula_frame_vsync == 2)
9696      {
97         cpu_spinuntil_time(video_screen_get_time_until_pos(0, height - 1, 0));
97         cpu_spinuntil_time(video_screen_get_time_until_pos(machine->primary_screen, height - 1, 0));
9898         ula_scanline_count = height - 1;
99         logerror ("S: %d B: %d\n", video_screen_get_vpos(0), video_screen_get_hpos(0));
99         logerror ("S: %d B: %d\n", video_screen_get_vpos(machine->primary_screen), video_screen_get_hpos(machine->primary_screen));
100100      }
101101
102102      LOG_ZX81_IOW("ULA IRQs on");
src/mess/machine/apple2gs.c
r1998r1999
798798   // make sure we're in the 65816's context
799799   cpuintrf_push_context(0);
800800
801   scanline = video_screen_get_vpos(0);
801   scanline = video_screen_get_vpos(machine->primary_screen);
802802
803803   video_screen_update_partial(0, scanline);
804804
r1998r1999
832832      adb_check_mouse(machine);
833833
834834      /* call Apple II interrupt handler */
835      if ((video_screen_get_vpos(0) % 8) == 7)
835      if ((video_screen_get_vpos(machine->primary_screen) % 8) == 7)
836836         apple2_interrupt(machine, 0);
837837   }
838838
839   timer_adjust_oneshot(apple2gs_scanline_timer, video_screen_get_time_until_pos(0, (scanline+1)%262, 0), 0);
839   timer_adjust_oneshot(apple2gs_scanline_timer, video_screen_get_time_until_pos(machine->primary_screen, (scanline+1)%262, 0), 0);
840840
841841   cpuintrf_pop_context();
842842}
r1998r1999
933933// apple2gs_get_vpos - return the correct vertical counter value for the current scanline,
934934// keeping borders in mind.
935935
936static int apple2gs_get_vpos(void)
936static int apple2gs_get_vpos(running_machine *machine)
937937{
938938   int result, scan;
939939   static const UINT8 top_border_vert[BORDER_TOP] =
r1998r1999
943943
944944   };
945945
946   scan = video_screen_get_vpos(0);
946   scan = video_screen_get_vpos(machine->primary_screen);
947947
948948   if (scan < BORDER_TOP)
949949   {
r1998r1999
966966   switch(offset)
967967   {
968968      case 0x19:   /* C019 - RDVBLBAR */
969         result = (video_screen_get_vpos(0) >= (192+BORDER_TOP)) ? 0x80 : 0x00;
969         result = (video_screen_get_vpos(machine->primary_screen) >= (192+BORDER_TOP)) ? 0x80 : 0x00;
970970         break;
971971
972972      case 0x22:   /* C022 - TBCOLOR */
r1998r1999
10071007         break;
10081008
10091009      case 0x2E:   /* C02E - VERTCNT */
1010         result = apple2gs_get_vpos() >> 1;
1010         result = apple2gs_get_vpos(machine) >> 1;
10111011         break;
10121012
10131013      case 0x2F:   /* C02F - HORIZCNT */
1014         result = video_screen_get_hpos(0) / 11;
1014         result = video_screen_get_hpos(machine->primary_screen) / 11;
10151015         if (result > 0)
10161016         {
10171017            result += 0x40;
10181018         }
10191019
1020         if (apple2gs_get_vpos() & 1)
1020         if (apple2gs_get_vpos(machine) & 1)
10211021         {
10221022            result |= 0x80;
10231023         }
r1998r1999
17281728   timer_adjust_oneshot(apple2gs_scanline_timer, attotime_never, 0);
17291729
17301730   // fire on scanline zero
1731   timer_adjust_oneshot(apple2gs_scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0);
1731   timer_adjust_oneshot(apple2gs_scanline_timer, video_screen_get_time_until_pos(machine->primary_screen, 0, 0), 0);
17321732}
17331733
17341734MACHINE_START( apple2gs )
src/mess/machine/mac.c
r1998r1999
11921192   int val = 0;
11931193
11941194   /* video beam in display (! VBLANK && ! HBLANK basically) */
1195   if (video_screen_get_vpos(0) >= MAC_V_VIS)
1195   if (video_screen_get_vpos(machine->primary_screen) >= MAC_V_VIS)
11961196      val |= 0x40;
11971197
11981198   if (has_adb())
r1998r1999
13291329      timer_set(attotime_zero, NULL, 0, set_memory_overlay_callback);
13301330
13311331   mac_scanline_timer = timer_alloc(mac_scanline_tick, NULL);
1332   timer_adjust_oneshot(mac_scanline_timer, video_screen_get_time_until_pos(0, 0, 0), 0);
1332   timer_adjust_oneshot(mac_scanline_timer, video_screen_get_time_until_pos(machine->primary_screen, 0, 0), 0);
13331333}
13341334
13351335
r1998r1999
14651465
14661466   mac_sh_updatebuffer();
14671467
1468   scanline = video_screen_get_vpos(0);
1468   scanline = video_screen_get_vpos(machine->primary_screen);
14691469   if (scanline == MAC_V_VIS)
14701470      mac_vblank_irq();
14711471
r1998r1999
14731473   if (!(scanline % 10))
14741474      mouse_callback(machine);
14751475
1476   timer_adjust_oneshot(mac_scanline_timer, video_screen_get_time_until_pos(0, (scanline+1) % MAC_V_TOTAL, 0), 0);
1476   timer_adjust_oneshot(mac_scanline_timer, video_screen_get_time_until_pos(machine->primary_screen, (scanline+1) % MAC_V_TOTAL, 0), 0);
14771477
14781478   cpuintrf_pop_context();
14791479}
src/mess/machine/coco.c
r1998r1999
103103/*common vars/calls */
104104static UINT8 *coco_rom;
105105static int dclg_state, dclg_output_h, dclg_output_v, dclg_timer;
106static UINT8 (*update_keyboard)(void);
106static UINT8 (*update_keyboard)(running_machine *machine);
107107static emu_timer *update_keyboard_timer;
108108static emu_timer *mux_sel1_timer;
109109static emu_timer *mux_sel2_timer;
r1998r1999
816816         coco3_recalc_irq(machine);
817817
818818         if (LOG_INT_COCO3)
819            logerror("CoCo3 Interrupt: Raising IRQ; scanline=%i\n", video_screen_get_vpos(0));
819            logerror("CoCo3 Interrupt: Raising IRQ; scanline=%i\n", video_screen_get_vpos(machine->primary_screen));
820820      }
821821      if ((coco3_gimereg[0] & 0x10) && (coco3_gimereg[3] & mask))
822822      {
r1998r1999
824824         coco3_recalc_firq(machine);
825825
826826         if (LOG_INT_COCO3)
827            logerror("CoCo3 Interrupt: Raising FIRQ; scanline=%i\n", video_screen_get_vpos(0));
827            logerror("CoCo3 Interrupt: Raising FIRQ; scanline=%i\n", video_screen_get_vpos(machine->primary_screen));
828828      }
829829   }
830830}
r1998r1999
10211021      coco_hiresjoy_ytransitiontime = attotime_zero;
10221022   }
10231023   coco_hiresjoy_ca = data;
1024   (*update_keyboard)();
1024   (*update_keyboard)(Machine);
10251025}
10261026
10271027static int coco_hiresjoy_readone(attotime transitiontime)
r1998r1999
11951195static TIMER_CALLBACK(coco_update_sel1_timerproc)
11961196{
11971197   mux_sel1 = param;;
1198   (*update_keyboard)();
1198   (*update_keyboard)(machine);
11991199   soundmux_update();
12001200}
12011201
r1998r1999
12071207static TIMER_CALLBACK(coco_update_sel2_timerproc)
12081208{
12091209   mux_sel2 = param;
1210   (*update_keyboard)();
1210   (*update_keyboard)(machine);
12111211   soundmux_update();
12121212}
12131213
r1998r1999
12261226
12271227
12281228
1229static UINT8 coco_update_keyboard(void)
1229static UINT8 coco_update_keyboard(running_machine *machine)
12301230{
12311231   UINT8 porta = 0x7F, port_za = 0x7f;
12321232   int joyval;
r1998r1999
12841284         break;
12851285
12861286      case INPUTDEVICE_DIECOM_LIGHTGUN:
1287         if( (video_screen_get_vpos(0) == readinputportbytag_safe("dclg_y", 0)) )
1287         if( (video_screen_get_vpos(machine->primary_screen) == readinputportbytag_safe("dclg_y", 0)) )
12881288         {
12891289            /* If gun is pointing at the current scan line, set hit bit and cache horizontal timer value */
12901290            dclg_output_h |= 0x02;
r1998r1999
12971297         if( (dclg_state == 7) )
12981298         {
12991299            /* While in state 7, prepare to chech next video frame for a hit */
1300            dclg_time = video_screen_get_time_until_pos(0, readinputportbytag_safe("dclg_y", 0), 0);
1300            dclg_time = video_screen_get_time_until_pos(machine->primary_screen, readinputportbytag_safe("dclg_y", 0), 0);
13011301         }
13021302
13031303         break;
r1998r1999
13321332
13331333
13341334
1335static UINT8 coco3_update_keyboard(void)
1335static UINT8 coco3_update_keyboard(running_machine *machine)
13361336{
13371337   /* the CoCo 3 keyboard update routine must also check for the GIME EI1 interrupt */
13381338   UINT8 porta;
1339   porta = coco_update_keyboard();
1340   coco3_raise_interrupt(Machine, COCO3_INT_EI1, ((porta & 0x7F) == 0x7F) ? CLEAR_LINE : ASSERT_LINE);
1339   porta = coco_update_keyboard(machine);
1340   coco3_raise_interrupt(machine, COCO3_INT_EI1, ((porta & 0x7F) == 0x7F) ? CLEAR_LINE : ASSERT_LINE);
13411341   return porta;
13421342}
13431343
13441344
13451345
13461346/* three functions that update the keyboard in varying ways */
1347static WRITE8_HANDLER ( d_pia0_pb_w )               { (*update_keyboard)(); }
1348INPUT_CHANGED(coco_keyboard_changed)               { (*update_keyboard)(); }
1349static TIMER_CALLBACK(coco_update_keyboard_timerproc)   { (*update_keyboard)(); }
1347static WRITE8_HANDLER ( d_pia0_pb_w )               { (*update_keyboard)(machine); }
1348INPUT_CHANGED(coco_keyboard_changed)               { (*update_keyboard)(machine); }
1349static TIMER_CALLBACK(coco_update_keyboard_timerproc)   { (*update_keyboard)(machine); }
13501350
13511351static WRITE8_HANDLER ( d_pia0_pa_w )
13521352{
r1998r1999
14601460      cassette_output(cassette_device_image(), ((int) dac - 0x80) / 128.0);
14611461   }
14621462
1463   (*update_keyboard)();
1463   (*update_keyboard)(machine);
14641464
14651465   if (get_input_device(INPUTPORT_RIGHT_JOYSTICK) == INPUTDEVICE_HIRES_INTERFACE)
14661466      coco_hiresjoy_w(dac >= 0x80);
src/mess/machine/mz700.c
r1998r1999
241241   case 8:
242242      data = ne556_out[1] ? 0x01 : 0x00;
243243      data |= readinputport(12);   /* get joystick ports */
244      if (video_screen_get_hpos(0) >= visarea->max_x - 32)
244      if (video_screen_get_hpos(machine->primary_screen) >= visarea->max_x - 32)
245245         data |= 0x80;
246246      LOG(1,"mz700_e008_r",("%02X\n", data));
247247        break;
src/mess/machine/nes_mmc.c
r1998r1999
632632
633633      if (IRQ_enable && !blanked && (IRQ_count == 0) && priorCount)
634634      {
635         logerror("irq fired, scanline: %d (MAME %d, beam pos: %d)\n", scanline, video_screen_get_vpos(0), video_screen_get_hpos(0));
635         logerror("irq fired, scanline: %d (MAME %d, beam pos: %d)\n", scanline, video_screen_get_vpos(Machine->primary_screen), video_screen_get_hpos(Machine->primary_screen));
636636         cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, HOLD_LINE);
637637//         timer_adjust_oneshot(nes_irq_timer, ATTOTIME_IN_CYCLES(4, 0), 0);
638638      }
r1998r1999
43244324
43254325      if (IRQ_enable && !blanked && (IRQ_count == 0) && priorCount)
43264326      {
4327         logerror("irq fired, scanline: %d (MAME %d, beam pos: %d)\n", scanline, video_screen_get_vpos(0), video_screen_get_hpos(0));
4327         logerror("irq fired, scanline: %d (MAME %d, beam pos: %d)\n", scanline, video_screen_get_vpos(Machine->primary_screen), video_screen_get_hpos(Machine->primary_screen));
43284328         cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, HOLD_LINE);
43294329      }
43304330   }
r1998r1999
48304830
48314831      if (IRQ_enable && !blanked && (IRQ_count == 0) && priorCount)
48324832      {
4833         logerror("irq fired, scanline: %d (MAME %d, beam pos: %d)\n", scanline, video_screen_get_vpos(0), video_screen_get_hpos(0));
4833         logerror("irq fired, scanline: %d (MAME %d, beam pos: %d)\n", scanline, video_screen_get_vpos(Machine->primary_screen), video_screen_get_hpos(Machine->primary_screen));
48344834         cpunum_set_input_line(Machine, 0, M6502_IRQ_LINE, HOLD_LINE);
48354835      }
48364836   }
src/mess/machine/lisa.c
r1998r1999
16201620               videoROM_address |= 0x80;
16211621            }
16221622#else
1623            int time_in_frame = video_screen_get_vpos(0);
1623            int time_in_frame = video_screen_get_vpos(machine->primary_screen);
16241624            static int videoROM_address = 0;
16251625
16261626            videoROM_address = (videoROM_address + 1) & 0x7f;
src/mess/machine/osborne1.c
r1998r1999
309309//};
310310
311311static TIMER_CALLBACK(osborne1_video_callback) {
312   int y = video_screen_get_vpos(0);
312   int y = video_screen_get_vpos(machine->primary_screen);
313313
314314   /* Check for start of frame */
315315   if ( y == 0 ) {
r1998r1999
357357      beep_set_state( 0, 0 );
358358   }
359359
360   timer_adjust_oneshot(osborne1.video_timer, video_screen_get_time_until_pos( 0, y + 1, 0 ), 0);
360   timer_adjust_oneshot(osborne1.video_timer, video_screen_get_time_until_pos(machine->primary_screen, y + 1, 0 ), 0);
361361}
362362
363363/*
r1998r1999
434434   memset( mess_ram + 0x10000, 0xFF, 0x1000 );
435435
436436   osborne1.video_timer = timer_alloc( osborne1_video_callback , NULL);
437   timer_adjust_oneshot(osborne1.video_timer, video_screen_get_time_until_pos( 0, 1, 0 ), 0);
437   timer_adjust_oneshot(osborne1.video_timer, video_screen_get_time_until_pos(machine->primary_screen, 1, 0 ), 0);
438438   pia_1_ca1_w( machine, 0, 0 );
439439
440440   timer_set( attotime_zero, NULL, 0, setup_beep );
src/mess/machine/vtech1.c
r1998r1999
481481         data &= readinputportbytag(portname);
482482   }
483483
484   if (video_screen_get_vblank(0))
484   if (video_screen_get_vblank(machine->primary_screen))
485485        data &= ~0x80;
486486
487487   /* cassette input is bit 5 (0x40) */
src/mess/machine/apple2.c
r1998r1999
764764
765765   profiler_mark(PROFILER_A2INT);
766766
767   scanline = video_screen_get_vpos(0);
767   scanline = video_screen_get_vpos(machine->primary_screen);
768768
769769   if (scanline > 190)
770770   {
r1998r1999
886886      case 0x06:         result |= (a2 & VAR_ALTZP)      ? 0x80 : 0x00;   break;
887887      case 0x07:         result |= (a2 & VAR_SLOTC3ROM)   ? 0x80 : 0x00;   break;
888888      case 0x08:         result |= (a2 & VAR_80STORE)   ? 0x80 : 0x00;   break;
889      case 0x09:         result |= !video_screen_get_vblank(0)      ? 0x80 : 0x00;   break;
889      case 0x09:         result |= !video_screen_get_vblank(machine->primary_screen)      ? 0x80 : 0x00;   break;
890890      case 0x0A:         result |= (a2 & VAR_TEXT)      ? 0x80 : 0x00;   break;
891891      case 0x0B:         result |= (a2 & VAR_MIXED)      ? 0x80 : 0x00;   break;
892892      case 0x0C:         result |= (a2 & VAR_PAGE2)      ? 0x80 : 0x00;   break;
src/mess/machine/primo.c
r1998r1999
8383   // bit 7, 6 - not used
8484
8585   // bit 5 - VBLANK
86   data |= (video_screen_get_vblank(0)) ? 0x20 : 0x00;
86   data |= (video_screen_get_vblank(machine->primary_screen)) ? 0x20 : 0x00;
8787
8888   // bit 4 - I4 (external bus)
8989
src/mess/machine/genesis.c
r1998r1999
15211521   if (current_vdp->sline>=224) retvalue |= 0x0008;
15221522   if (current_vdp->sline>=224) retvalue |= 0x0080;
15231523
1524   if (video_screen_get_hpos(0) > 0xc0) retvalue |= 0x0004; // ??
1524   if (video_screen_get_hpos(machine->primary_screen) > 0xc0) retvalue |= 0x0004; // ??
15251525   if (!genesis_is_ntsc) retvalue |= 0x0001;
15261526
15271527
r1998r1999
15451545
15461546
15471547//   logerror("Read from HV Counters\n");
1548   return (((vcnt))&0xff)<<8|(video_screen_get_hpos(0)&0xff);
1548   return (((vcnt))&0xff)<<8|(video_screen_get_hpos(machine->primary_screen)&0xff);
15491549}
15501550
15511551UINT16 genesis_vdp_read ( genvdp *current_vdp, offs_t offset, UINT16 mem_mask )
src/mess/drivers/x68k.c
r1998r1999
952952    {
953953    case 0x00:  // GPIP - General purpose I/O register (read-only)
954954        ret = 0x23;
955        if(video_screen_get_vpos(0) == sys.crtc.reg[9])
955        if(video_screen_get_vpos(machine->primary_screen) == sys.crtc.reg[9])
956956            ret |= 0x40;
957957        if(sys.crtc.vblank == 0)
958958            ret |= 0x10;  // Vsync signal (low if in vertical retrace)
959959//      if(sys.mfp.isrb & 0x08)
960960//          ret |= 0x08;  // FM IRQ signal
961        if(video_screen_get_hpos(0) > sys.crtc.width - 32)
961        if(video_screen_get_hpos(machine->primary_screen) > sys.crtc.width - 32)
962962            ret |= 0x80;  // Hsync signal
963963//      logerror("MFP: [%08x] Reading offset %i (ret=%02x)\n",activecpu_get_pc(),offset,ret);
964964        return ret;  // bit 5 is always 1
r1998r1999
19111911   nec765_reset(0);
19121912   mfp_init();
19131913
1914   x68k_scanline = video_screen_get_vpos(0);// = sys.crtc.reg[6];  // Vertical start
1914   x68k_scanline = video_screen_get_vpos(machine->primary_screen);// = sys.crtc.reg[6];  // Vertical start
19151915
19161916   // start VBlank timer
19171917   sys.crtc.vblank = 1;
1918   irq_time = video_screen_get_time_until_pos(0,sys.crtc.reg[6],2);
1918   irq_time = video_screen_get_time_until_pos(machine->primary_screen,sys.crtc.reg[6],2);
19191919   timer_adjust_oneshot(vblank_irq, irq_time, 0);
19201920
19211921   // start HBlank timer
1922   timer_adjust_oneshot(scanline_timer, video_screen_get_scan_period(0), 1);
1922   timer_adjust_oneshot(scanline_timer, video_screen_get_scan_period(machine->primary_screen), 1);
19231923
19241924   sys.mfp.gpio = 0xfb;
19251925}
src/mess/drivers/spectrum.c
r1998r1999
190190   if ((Changed & 0x07)!=0)
191191   {
192192      /* yes - send event */
193      EventList_AddItemOffset(0x0fe, data & 0x07, ATTOTIME_TO_CYCLES(0,attotime_mul(video_screen_get_scan_period(0), video_screen_get_vpos(0))));
193      EventList_AddItemOffset(0x0fe, data & 0x07, ATTOTIME_TO_CYCLES(0,attotime_mul(video_screen_get_scan_period(machine->primary_screen), video_screen_get_vpos(machine->primary_screen))));
194194   }
195195
196196   if ((Changed & (1<<4))!=0)
r1998r1999
330330   if ((offset & 0xff)==0xdf)
331331      return spectrum_port_df_r(machine, offset);
332332
333   return video_screen_get_vpos(0)<193 ? spectrum_colorram[(video_screen_get_vpos(0)&0xf8)<<2]:0xff;
333   return video_screen_get_vpos(machine->primary_screen)<193 ? spectrum_colorram[(video_screen_get_vpos(machine->primary_screen)&0xf8)<<2]:0xff;
334334}
335335
336336static WRITE8_HANDLER ( spectrum_port_w )
r1998r1999
473473    if ((offset & 0xff)==0xdf)
474474       return spectrum_port_df_r(machine, offset);
475475
476    return video_screen_get_vpos(0)<193 ? spectrum_128_screen_location[0x1800|(video_screen_get_vpos(0)&0xf8)<<2]:0xff;
476    return video_screen_get_vpos(machine->primary_screen)<193 ? spectrum_128_screen_location[0x1800|(video_screen_get_vpos(machine->primary_screen)&0xf8)<<2]:0xff;
477477}
478478
479479static WRITE8_HANDLER ( spectrum_128_port_w )
r1998r1999
759759       }
760760    }
761761
762    return video_screen_get_vpos(0)<193 ? spectrum_128_screen_location[0x1800|(video_screen_get_vpos(0)&0xf8)<<2]:0xff;
762    return video_screen_get_vpos(machine->primary_screen)<193 ? spectrum_128_screen_location[0x1800|(video_screen_get_vpos(machine->primary_screen)&0xf8)<<2]:0xff;
763763}
764764
765765static WRITE8_HANDLER ( spectrum_plus3_port_w )
src/mess/drivers/amstrad.c
r1998r1999
100910090   x     |*/
10101010     case 0x01: {
10111011#ifdef AMSTRAD_VIDEO_EVENT_LIST
1012    EventList_AddItemOffset((EVENT_LIST_CODE_GA_COLOUR<<6) | PenIndex, AmstradCPC_PenColours[PenIndex], TIME_TO_CYCLES(0,video_screen_get_vpos(0)*video_screen_get_scan_period(0)));
1012    EventList_AddItemOffset((EVENT_LIST_CODE_GA_COLOUR<<6) | PenIndex, AmstradCPC_PenColours[PenIndex], TIME_TO_CYCLES(0,video_screen_get_vpos(machine->primary_screen)*video_screen_get_scan_period(machine->primary_screen)));
10131013#else
10141014      amstrad_vh_update_colour(machine, amstrad_GateArray_PenSelected, (dataToGateArray & 0x1F));
10151015#endif
r1998r1999
10801080/* b1b0 mode change? */
10811081           if (((amstrad_GateArray_ModeAndRomConfiguration & 0x03)^(Previous_GateArray_ModeAndRomConfiguration & 0x03)) != 0) {
10821082#ifdef AMSTRAD_VIDEO_EVENT_LIST
1083          EventList_AddItemOffset((EVENT_LIST_CODE_GA_MODE<<6) , amstrad_GateArray_ModeAndRomConfiguration & 0x03, TIME_TO_CYCLES(0,video_screen_get_vpos(0)*video_screen_get_scan_period(0)));
1083          EventList_AddItemOffset((EVENT_LIST_CODE_GA_MODE<<6) , amstrad_GateArray_ModeAndRomConfiguration & 0x03, TIME_TO_CYCLES(0,video_screen_get_vpos(machine->primary_screen)*video_screen_get_scan_period(machine->primary_screen)));
10841084#else
10851085              amstrad_vh_update_mode(amstrad_GateArray_ModeAndRomConfiguration & 0x03);
10861086#endif
r1998r1999
13571357      switch ((offset & 0x0300) >> 8) { // r1r0
13581358        case 0x00: {/* Select internal 6845 register Write Only */
13591359#ifdef AMSTRAD_VIDEO_EVENT_LIST
1360           EventList_AddItemOffset((EVENT_LIST_CODE_CRTC_INDEX_WRITE<<6), data, TIME_TO_CYCLES(0,video_screen_get_vpos(0)*video_screen_get_scan_period(0)));
1360           EventList_AddItemOffset((EVENT_LIST_CODE_CRTC_INDEX_WRITE<<6), data, TIME_TO_CYCLES(0,video_screen_get_vpos(machine->primary_screen)*video_screen_get_scan_period(machine->primary_screen)));
13611361#endif
13621362        m6845_address_w(0,data);
13631363      if(amstrad_system_type != SYSTEM_CPC)
r1998r1999
13661366      } break;
13671367        case 0x01: {/* Write to selected internal 6845 register Write Only */
13681368#ifdef AMSTRAD_VIDEO_EVENT_LIST
1369            EventList_AddItemOffset((EVENT_LIST_CODE_CRTC_WRITE<<6), data, TIME_TO_CYCLES(0,video_screen_get_vpos(0)*video_screen_get_scan_period(0)));
1369            EventList_AddItemOffset((EVENT_LIST_CODE_CRTC_WRITE<<6), data, TIME_TO_CYCLES(0,video_screen_get_vpos(machine->primary_screen)*video_screen_get_scan_period(machine->primary_screen)));
13701370#endif
13711371//            logerror("m6845 register (%02d : %04x)\n", selected_m6845_address, (data&0x3F));
13721372        m6845_register_w(0,data);
src/mess/drivers/a310.c
r1998r1999
128128   a310_request_irq_a(machine, A310_IRQA_VBL);
129129
130130   // set up for next vbl
131   timer_adjust_oneshot(vbl_timer, video_screen_get_time_until_pos(0, a310_vidregs[0xb4], 0), 0);
131   timer_adjust_oneshot(vbl_timer, video_screen_get_time_until_pos(machine->primary_screen, a310_vidregs[0xb4], 0), 0);
132132}
133133
134134static void a310_set_timer(int tmr)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team