summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar Miodrag Milanovic <mmicko@gmail.com>2014-03-15 13:00:23 +0000
committerGravatarGravatar Miodrag Milanovic <mmicko@gmail.com>2014-03-15 13:00:23 +0000
commita66aff27d6ca7657fe729f8a922e8773d601a37a (patch)
tree3835abb43e8ca1388434b8d4541a6276e18daf0e
parent445c89c839044afed3a09478dbd1cdb77f87cf92 (diff)
primary_screen -> first_screen() (nw)
-rw-r--r--src/emu/bus/iq151/grafik.c2
-rw-r--r--src/emu/bus/iq151/video32.c2
-rw-r--r--src/emu/bus/iq151/video64.c2
-rw-r--r--src/emu/bus/nes/bootleg.c2
-rw-r--r--src/emu/bus/nes/hosenkan.c2
-rw-r--r--src/emu/bus/nes/mmc3.c2
-rw-r--r--src/emu/bus/nes/pirate.c2
-rw-r--r--src/emu/cpu/esrip/esrip.c2
-rw-r--r--src/emu/crsshair.c6
-rw-r--r--src/emu/debug/debugcpu.c4
-rw-r--r--src/emu/debug/dvstate.c2
-rw-r--r--src/emu/machine.h2
-rw-r--r--src/emu/machine/s3c24xx.c14
-rw-r--r--src/emu/machine/smpc.c22
-rw-r--r--src/emu/screen.c4
-rw-r--r--src/emu/sound/nes_apu.c4
-rw-r--r--src/emu/ui/ui.c4
-rw-r--r--src/emu/video.c20
-rw-r--r--src/emu/video/hd63484.c2
-rw-r--r--src/emu/video/huc6270.c8
-rw-r--r--src/emu/video/pc_vga.c48
-rw-r--r--src/emu/video/psx.c8
-rw-r--r--src/emu/video/stvvdp2.c22
-rw-r--r--src/emu/video/tms3556.c2
-rw-r--r--src/ldplayer/ldplayer.c4
-rw-r--r--src/mame/audio/cinemat.c12
-rw-r--r--src/mame/video/atari.c14
-rw-r--r--src/mame/video/avgdvg.c4
-rw-r--r--src/mame/video/decmxc06.c2
-rw-r--r--src/mame/video/gp9001.c4
-rw-r--r--src/mame/video/gtia.c2
-rw-r--r--src/mame/video/gticlub.c10
-rw-r--r--src/mame/video/harddriv.c2
-rw-r--r--src/mame/video/hng64.c8
-rw-r--r--src/mame/video/konamigx.c2
-rw-r--r--src/mame/video/midzeus.c10
-rw-r--r--src/mame/video/midzeus2.c8
-rw-r--r--src/mame/video/model1.c2
-rw-r--r--src/mame/video/scn2674.c8
-rw-r--r--src/mame/video/sknsspr.c4
-rw-r--r--src/mame/video/snes.c10
-rw-r--r--src/mame/video/taito_f3.c2
-rw-r--r--src/mame/video/taitojc.c2
-rw-r--r--src/mame/video/vdc.c2
-rw-r--r--src/mame/video/wecleman.c2
-rw-r--r--src/mess/drivers/a2600.c4
-rw-r--r--src/mess/drivers/a5105.c6
-rw-r--r--src/mess/drivers/a7000.c10
-rw-r--r--src/mess/drivers/apc.c6
-rw-r--r--src/mess/drivers/casloopy.c4
-rw-r--r--src/mess/drivers/dmv.c2
-rw-r--r--src/mess/drivers/fm7.c2
-rw-r--r--src/mess/drivers/gba.c16
-rw-r--r--src/mess/drivers/gp32.c10
-rw-r--r--src/mess/drivers/ie15.c12
-rw-r--r--src/mess/drivers/itt3030.c4
-rw-r--r--src/mess/drivers/lynx.c2
-rw-r--r--src/mess/drivers/multi8.c6
-rw-r--r--src/mess/drivers/mz2000.c2
-rw-r--r--src/mess/drivers/mz2500.c10
-rw-r--r--src/mess/drivers/osbexec.c8
-rw-r--r--src/mess/drivers/pasogo.c2
-rw-r--r--src/mess/drivers/pasopia7.c10
-rw-r--r--src/mess/drivers/pc6001.c4
-rw-r--r--src/mess/drivers/pc8801.c12
-rw-r--r--src/mess/drivers/pc88va.c4
-rw-r--r--src/mess/drivers/pc9801.c20
-rw-r--r--src/mess/drivers/pokemini.c2
-rw-r--r--src/mess/drivers/qx10.c4
-rw-r--r--src/mess/drivers/samcoupe.c2
-rw-r--r--src/mess/drivers/scv.c6
-rw-r--r--src/mess/drivers/smc777.c6
-rw-r--r--src/mess/drivers/spec128.c2
-rw-r--r--src/mess/drivers/spectrum.c2
-rw-r--r--src/mess/drivers/supracan.c20
-rw-r--r--src/mess/drivers/uzebox.c2
-rw-r--r--src/mess/drivers/vboy.c2
-rw-r--r--src/mess/drivers/x1.c36
-rw-r--r--src/mess/drivers/x68k.c6
-rw-r--r--src/mess/machine/amigakbd.c4
-rw-r--r--src/mess/machine/apple2.c4
-rw-r--r--src/mess/machine/apple2gs.c18
-rw-r--r--src/mess/machine/apple3.c4
-rw-r--r--src/mess/machine/coco.c4
-rw-r--r--src/mess/machine/gamecom.c2
-rw-r--r--src/mess/machine/hp48.c2
-rw-r--r--src/mess/machine/lisa.c4
-rw-r--r--src/mess/machine/lynx.c2
-rw-r--r--src/mess/machine/mac.c16
-rw-r--r--src/mess/machine/mz700.c6
-rw-r--r--src/mess/machine/orion.c2
-rw-r--r--src/mess/machine/osborne1.c8
-rw-r--r--src/mess/machine/primo.c2
-rw-r--r--src/mess/machine/s3c44b0.c4
-rw-r--r--src/mess/machine/samcoupe.c2
-rw-r--r--src/mess/machine/vector06.c2
-rw-r--r--src/mess/machine/zx.c6
-rw-r--r--src/mess/video/a7800.c2
-rw-r--r--src/mess/video/atarist.c14
-rw-r--r--src/mess/video/bbc.c8
-rw-r--r--src/mess/video/electron.c4
-rw-r--r--src/mess/video/fm7.c10
-rw-r--r--src/mess/video/fmtowns.c10
-rw-r--r--src/mess/video/galaxy.c2
-rw-r--r--src/mess/video/gamecom.c4
-rw-r--r--src/mess/video/gba.c2
-rw-r--r--src/mess/video/kaypro.c2
-rw-r--r--src/mess/video/kc.c2
-rw-r--r--src/mess/video/mac.c4
-rw-r--r--src/mess/video/pc1512.c4
-rw-r--r--src/mess/video/poisk1.c4
-rw-r--r--src/mess/video/samcoupe.c8
-rw-r--r--src/mess/video/spectrum.c8
-rw-r--r--src/mess/video/stic.c2
-rw-r--r--src/mess/video/wswan.c2
-rw-r--r--src/mess/video/x68k.c44
-rw-r--r--src/mess/video/zx.c8
-rw-r--r--src/osd/windows/d3dhlsl.c2
118 files changed, 394 insertions, 392 deletions
diff --git a/src/emu/bus/iq151/grafik.c b/src/emu/bus/iq151/grafik.c
index 80b39fcb790..b74caba9c94 100644
--- a/src/emu/bus/iq151/grafik.c
+++ b/src/emu/bus/iq151/grafik.c
@@ -65,7 +65,7 @@ void iq151_grafik_device::device_start()
void iq151_grafik_device::device_reset()
{
- screen_device *screen = machine().primary_screen;
+ screen_device *screen = machine().first_screen();
// if required adjust screen size
if (screen->visible_area().max_x < 64*8-1)
diff --git a/src/emu/bus/iq151/video32.c b/src/emu/bus/iq151/video32.c
index c784be9b8fb..8f6f242a4f1 100644
--- a/src/emu/bus/iq151/video32.c
+++ b/src/emu/bus/iq151/video32.c
@@ -84,7 +84,7 @@ void iq151_video32_device::device_start()
void iq151_video32_device::device_reset()
{
- screen_device *screen = machine().primary_screen;
+ screen_device *screen = machine().first_screen();
// if required adjust screen size
if (screen->visible_area().max_x < 32*8 - 1)
diff --git a/src/emu/bus/iq151/video64.c b/src/emu/bus/iq151/video64.c
index 60ff0d10e2f..a9b179aa991 100644
--- a/src/emu/bus/iq151/video64.c
+++ b/src/emu/bus/iq151/video64.c
@@ -83,7 +83,7 @@ void iq151_video64_device::device_start()
void iq151_video64_device::device_reset()
{
- screen_device *screen = machine().primary_screen;
+ screen_device *screen = machine().first_screen();
// if required adjust screen size
if (screen->visible_area().max_x < 64*6 - 1)
diff --git a/src/emu/bus/nes/bootleg.c b/src/emu/bus/nes/bootleg.c
index 724b4cb7a2c..37180be43ec 100644
--- a/src/emu/bus/nes/bootleg.c
+++ b/src/emu/bus/nes/bootleg.c
@@ -626,7 +626,7 @@ void nes_sc127_device::hblank_irq(int scanline, int vblank, int blanked)
if (!blanked && (m_irq_count == 0))
{
LOG_MMC(("irq fired, scanline: %d (MAME %d, beam pos: %d)\n", scanline,
- machine().primary_screen->vpos(), machine().primary_screen->hpos()));
+ machine().first_screen()->vpos(), machine().first_screen()->hpos()));
machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, HOLD_LINE);
m_irq_enable = 0;
}
diff --git a/src/emu/bus/nes/hosenkan.c b/src/emu/bus/nes/hosenkan.c
index 077e1b70ca1..261aabd0f0d 100644
--- a/src/emu/bus/nes/hosenkan.c
+++ b/src/emu/bus/nes/hosenkan.c
@@ -95,7 +95,7 @@ void nes_hosenkan_device::hblank_irq( int scanline, int vblank, int blanked )
if (m_irq_enable && !blanked && (m_irq_count == 0) && (prior_count || m_irq_clear))
{
LOG_MMC(("irq fired, scanline: %d (MAME %d, beam pos: %d)\n", scanline,
- machine().primary_screen->vpos(), machine().primary_screen->hpos()));
+ machine().first_screen()->vpos(), machine().first_screen()->hpos()));
machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, HOLD_LINE);
}
}
diff --git a/src/emu/bus/nes/mmc3.c b/src/emu/bus/nes/mmc3.c
index 8aa780aa69c..9a5348ab0ba 100644
--- a/src/emu/bus/nes/mmc3.c
+++ b/src/emu/bus/nes/mmc3.c
@@ -202,7 +202,7 @@ void nes_txrom_device::hblank_irq(int scanline, int vblank, int blanked)
if (m_irq_enable && !blanked && (m_irq_count == 0) && (prior_count || m_irq_clear /*|| !m_mmc3_alt_irq*/)) // according to blargg the latter should be present as well, but it breaks Rampart and Joe & Mac US: they probably use the alt irq!
{
LOG_MMC(("irq fired, scanline: %d (MAME %d, beam pos: %d)\n", scanline,
- machine().primary_screen->vpos(), machine().primary_screen->hpos()));
+ machine().first_screen()->vpos(), machine().first_screen()->hpos()));
machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, ASSERT_LINE);
}
}
diff --git a/src/emu/bus/nes/pirate.c b/src/emu/bus/nes/pirate.c
index 0c75c3e1c06..b180ecb6707 100644
--- a/src/emu/bus/nes/pirate.c
+++ b/src/emu/bus/nes/pirate.c
@@ -985,7 +985,7 @@ void nes_mk2_device::hblank_irq( int scanline, int vblank, int blanked )
if (m_irq_enable && !blanked && (m_irq_count == 0) && (prior_count || m_irq_clear))
{
LOG_MMC(("irq fired, scanline: %d (MAME %d, beam pos: %d)\n", scanline,
- machine().primary_screen->vpos(), machine().primary_screen->hpos()));
+ machine().first_screen()->vpos(), machine().first_screen()->hpos()));
machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, HOLD_LINE);
}
}
diff --git a/src/emu/cpu/esrip/esrip.c b/src/emu/cpu/esrip/esrip.c
index 7653df56956..e77c4565b3b 100644
--- a/src/emu/cpu/esrip/esrip.c
+++ b/src/emu/cpu/esrip/esrip.c
@@ -411,7 +411,7 @@ offs_t esrip_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *op
int esrip_device::get_hblank()
{
- return machine().primary_screen->hblank();
+ return machine().first_screen()->hblank();
}
/* Return the state of the LBRM line (Y-scaling related) */
diff --git a/src/emu/crsshair.c b/src/emu/crsshair.c
index b99a1f5d679..b5aa7f43d0c 100644
--- a/src/emu/crsshair.c
+++ b/src/emu/crsshair.c
@@ -235,7 +235,7 @@ void crosshair_init(running_machine &machine)
global.visible[player] = (CROSSHAIR_VISIBILITY_DEFAULT == CROSSHAIR_VISIBILITY_OFF) ? FALSE : TRUE;
/* for now, use the main screen */
- global.screen[player] = machine.primary_screen;
+ global.screen[player] = machine.first_screen();
create_bitmap(machine, player);
}
@@ -245,8 +245,8 @@ void crosshair_init(running_machine &machine)
config_register(machine, "crosshairs", config_saveload_delegate(FUNC(crosshair_load), &machine), config_saveload_delegate(FUNC(crosshair_save), &machine));
/* register the animation callback */
- if (machine.primary_screen != NULL)
- machine.primary_screen->register_vblank_callback(vblank_state_delegate(FUNC(animate), &machine));
+ if (machine.first_screen() != NULL)
+ machine.first_screen()->register_vblank_callback(vblank_state_delegate(FUNC(animate), &machine));
}
diff --git a/src/emu/debug/debugcpu.c b/src/emu/debug/debugcpu.c
index a52534fd630..9ba61431f5f 100644
--- a/src/emu/debug/debugcpu.c
+++ b/src/emu/debug/debugcpu.c
@@ -150,8 +150,8 @@ void debug_cpu_init(running_machine &machine)
global->visiblecpu = machine.firstcpu;
/* add callback for breaking on VBLANK */
- if (machine.primary_screen != NULL)
- machine.primary_screen->register_vblank_callback(vblank_state_delegate(FUNC(on_vblank), &machine));
+ if (machine.first_screen() != NULL)
+ machine.first_screen()->register_vblank_callback(vblank_state_delegate(FUNC(on_vblank), &machine));
machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(debug_cpu_exit), &machine));
}
diff --git a/src/emu/debug/dvstate.c b/src/emu/debug/dvstate.c
index a2f6c24dacc..ba26d8bbfe4 100644
--- a/src/emu/debug/dvstate.c
+++ b/src/emu/debug/dvstate.c
@@ -211,7 +211,7 @@ void debug_view_state::view_update()
curitem = curitem->m_next;
// loop over visible rows
- screen_device *screen = machine().primary_screen;
+ screen_device *screen = machine().first_screen();
debug_view_char *dest = m_viewdata;
for (UINT32 row = 0; row < m_visible.y; row++)
{
diff --git a/src/emu/machine.h b/src/emu/machine.h
index 81657587965..7de095c95c4 100644
--- a/src/emu/machine.h
+++ b/src/emu/machine.h
@@ -265,9 +265,11 @@ public:
// CPU information
cpu_device * firstcpu; // first CPU
+private:
// video-related information
screen_device * primary_screen; // the primary screen device, or NULL if screenless
+public:
// debugger-related information
UINT32 debug_flags; // the current debug flags
diff --git a/src/emu/machine/s3c24xx.c b/src/emu/machine/s3c24xx.c
index af662472ad6..b041fa80759 100644
--- a/src/emu/machine/s3c24xx.c
+++ b/src/emu/machine/s3c24xx.c
@@ -738,7 +738,7 @@ static TIMER_CALLBACK( s3c24xx_lcd_timer_exp )
{
device_t *device = (device_t *)ptr;
s3c24xx_t *s3c24xx = get_token( device);
- screen_device *screen = machine.primary_screen;
+ screen_device *screen = machine.first_screen();
UINT32 tpalen;
verboselog( machine, 2, "LCD timer callback\n");
s3c24xx->lcd.vpos = screen->vpos();
@@ -782,7 +782,7 @@ static TIMER_CALLBACK( s3c24xx_lcd_timer_exp )
static void s3c24xx_video_start( device_t *device, running_machine &machine)
{
s3c24xx_t *s3c24xx = get_token( device);
- screen_device *screen = machine.primary_screen;
+ screen_device *screen = machine.first_screen();
s3c24xx->lcd.bitmap[0] = auto_bitmap_rgb32_alloc(machine, screen->width(), screen->height());
s3c24xx->lcd.bitmap[1] = auto_bitmap_rgb32_alloc(machine, screen->width(), screen->height());
}
@@ -846,7 +846,7 @@ READ32_DEVICE_HANDLER( s3c2440_lcd_r )
case S3C24XX_LCDCON1 :
{
// make sure line counter is going
- UINT32 vpos = device->machine().primary_screen->vpos();
+ UINT32 vpos = device->machine().first_screen()->vpos();
if (vpos < s3c24xx->lcd.vpos_min) vpos = s3c24xx->lcd.vpos_min;
if (vpos > s3c24xx->lcd.vpos_max) vpos = s3c24xx->lcd.vpos_max;
data = (data & ~0xFFFC0000) | ((s3c24xx->lcd.vpos_max - vpos) << 18);
@@ -854,7 +854,7 @@ READ32_DEVICE_HANDLER( s3c2440_lcd_r )
break;
case S3C24XX_LCDCON5 :
{
- UINT32 vpos = device->machine().primary_screen->vpos();
+ UINT32 vpos = device->machine().first_screen()->vpos();
data = data & ~0x00018000;
if (vpos < s3c24xx->lcd.vpos_min) data = data | 0x00000000;
if (vpos > s3c24xx->lcd.vpos_max) data = data | 0x00018000;
@@ -869,7 +869,7 @@ READ32_DEVICE_HANDLER( s3c2440_lcd_r )
static int s3c24xx_lcd_configure_tft( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
- screen_device *screen = device->machine().primary_screen;
+ screen_device *screen = device->machine().first_screen();
UINT32 vspw, vbpd, lineval, vfpd, hspw, hbpd, hfpd, hozval, clkval, hclk;
double framerate, vclk;
UINT32 width, height;
@@ -910,7 +910,7 @@ static int s3c24xx_lcd_configure_tft( device_t *device)
static int s3c24xx_lcd_configure_stn( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
- screen_device *screen = device->machine().primary_screen;
+ screen_device *screen = device->machine().first_screen();
UINT32 pnrmode, bppmode, clkval, lineval, wdly, hozval, lineblank, wlh, hclk;
double vclk, framerate;
UINT32 width, height;
@@ -973,7 +973,7 @@ static int s3c24xx_lcd_configure( device_t *device)
static void s3c24xx_lcd_start( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
- screen_device *screen = device->machine().primary_screen;
+ screen_device *screen = device->machine().first_screen();
verboselog( device->machine(), 1, "LCD start\n");
if (s3c24xx_lcd_configure( device))
{
diff --git a/src/emu/machine/smpc.c b/src/emu/machine/smpc.c
index 677e82641b7..b9abb8b6b68 100644
--- a/src/emu/machine/smpc.c
+++ b/src/emu/machine/smpc.c
@@ -209,7 +209,7 @@ static TIMER_CALLBACK( smpc_slave_enable )
state->m_smpc.OREG[31] = param + 0x02; //read-back for last command issued
state->m_smpc.SF = 0x00; //clear hand-shake flag
state->m_smpc.slave_on = param;
-// printf("%d %d\n",machine.primary_screen->hpos(),machine.primary_screen->vpos());
+// printf("%d %d\n",machine.first_screen()->hpos(),machine.first_screen()->vpos());
}
static TIMER_CALLBACK( smpc_sound_enable )
@@ -254,7 +254,7 @@ static TIMER_CALLBACK( smpc_change_clock )
saturn_state *state = machine.driver_data<saturn_state>();
UINT32 xtal;
- if(LOG_SMPC) printf ("Clock change execute at (%d %d)\n",machine.primary_screen->hpos(),machine.primary_screen->vpos());
+ if(LOG_SMPC) printf ("Clock change execute at (%d %d)\n",machine.first_screen()->hpos(),machine.first_screen()->vpos());
xtal = param ? MASTER_CLOCK_320 : MASTER_CLOCK_352;
@@ -525,7 +525,7 @@ static TIMER_CALLBACK( intback_peripheral )
/* doesn't work? */
//pad_num = state->m_smpc.intback_stage - 1;
- if(LOG_PAD_CMD) printf("%d %d %d\n",state->m_smpc.intback_stage - 1,machine.primary_screen->vpos(),(int)machine.primary_screen->frame_number());
+ if(LOG_PAD_CMD) printf("%d %d %d\n",state->m_smpc.intback_stage - 1,machine.first_screen()->vpos(),(int)machine.first_screen()->frame_number());
offset = 0;
@@ -660,7 +660,7 @@ static TIMER_CALLBACK( smpc_nmi_set )
{
saturn_state *state = machine.driver_data<saturn_state>();
-// printf("%d %d\n",machine.primary_screen->hpos(),machine.primary_screen->vpos());
+// printf("%d %d\n",machine.first_screen()->hpos(),machine.first_screen()->vpos());
state->m_NMI_reset = param;
/* put issued command in OREG31 */
state->m_smpc.OREG[31] = 0x19 + param;
@@ -695,7 +695,7 @@ static void smpc_comreg_exec(address_space &space, UINT8 data, UINT8 is_stv)
//case 0x01: Master OFF?
case 0x02:
case 0x03:
- if(LOG_SMPC) printf ("SMPC: Slave %s %d %d\n",(data & 1) ? "off" : "on",space.machine().primary_screen->hpos(),space.machine().primary_screen->vpos());
+ if(LOG_SMPC) printf ("SMPC: Slave %s %d %d\n",(data & 1) ? "off" : "on",space.machine().first_screen()->hpos(),space.machine().first_screen()->vpos());
space.machine().scheduler().timer_set(attotime::from_usec(15), FUNC(smpc_slave_enable),data & 1);
break;
case 0x06:
@@ -717,7 +717,7 @@ static void smpc_comreg_exec(address_space &space, UINT8 data, UINT8 is_stv)
break;
case 0x0e:
case 0x0f:
- if(LOG_SMPC) printf ("SMPC: Change Clock to %s (%d %d)\n",data & 1 ? "320" : "352",space.machine().primary_screen->hpos(),space.machine().primary_screen->vpos());
+ if(LOG_SMPC) printf ("SMPC: Change Clock to %s (%d %d)\n",data & 1 ? "320" : "352",space.machine().first_screen()->hpos(),space.machine().first_screen()->vpos());
/* on ST-V timing of this is pretty fussy, you get 2 credits at start-up otherwise
My current theory is that SMPC first stops all CPUs until it executes the whole snippet for this,
@@ -729,14 +729,14 @@ static void smpc_comreg_exec(address_space &space, UINT8 data, UINT8 is_stv)
state->m_slave->set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
state->m_audiocpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
- space.machine().scheduler().timer_set(space.machine().primary_screen->time_until_pos(state->get_vblank_start_position()*state->get_ystep_count(), 0), FUNC(smpc_change_clock),data & 1);
+ space.machine().scheduler().timer_set(space.machine().first_screen()->time_until_pos(state->get_vblank_start_position()*state->get_ystep_count(), 0), FUNC(smpc_change_clock),data & 1);
break;
/*"Interrupt Back"*/
case 0x10:
if(0)
{
saturn_state *state = space.machine().driver_data<saturn_state>();
- printf ("SMPC: Status Acquire %02x %02x %02x %d\n",state->m_smpc.IREG[0],state->m_smpc.IREG[1],state->m_smpc.IREG[2],space.machine().primary_screen->vpos());
+ printf ("SMPC: Status Acquire %02x %02x %02x %d\n",state->m_smpc.IREG[0],state->m_smpc.IREG[1],state->m_smpc.IREG[2],space.machine().first_screen()->vpos());
}
int timing;
@@ -764,7 +764,7 @@ static void smpc_comreg_exec(address_space &space, UINT8 data, UINT8 is_stv)
}
else
{
- if(LOG_PAD_CMD) printf("INTBACK %02x %02x %d %d\n",state->m_smpc.IREG[0],state->m_smpc.IREG[1],space.machine().primary_screen->vpos(),(int)space.machine().primary_screen->frame_number());
+ if(LOG_PAD_CMD) printf("INTBACK %02x %02x %d %d\n",state->m_smpc.IREG[0],state->m_smpc.IREG[1],space.machine().first_screen()->vpos(),(int)space.machine().first_screen()->frame_number());
space.machine().scheduler().timer_set(attotime::from_usec(timing), FUNC(saturn_smpc_intback),0); //TODO: is variable time correct?
}
break;
@@ -785,7 +785,7 @@ static void smpc_comreg_exec(address_space &space, UINT8 data, UINT8 is_stv)
case 0x19:
case 0x1a:
/* TODO: timing */
- if(LOG_SMPC) printf ("SMPC: NMI %sable %d %d\n",data & 1 ? "Dis" : "En",space.machine().primary_screen->hpos(),space.machine().primary_screen->vpos());
+ if(LOG_SMPC) printf ("SMPC: NMI %sable %d %d\n",data & 1 ? "Dis" : "En",space.machine().first_screen()->hpos(),space.machine().first_screen()->vpos());
space.machine().scheduler().timer_set(attotime::from_usec(100), FUNC(smpc_nmi_set),data & 1);
break;
default:
@@ -1001,7 +1001,7 @@ READ8_MEMBER( saturn_state::saturn_SMPC_r )
if (offset == 0x63)
{
- //printf("SF %d %d\n",space.machine().primary_screen->hpos(),space.machine().primary_screen->vpos());
+ //printf("SF %d %d\n",space.machine().first_screen()->hpos(),space.machine().first_screen()->vpos());
return_data = m_smpc.SF;
}
diff --git a/src/emu/screen.c b/src/emu/screen.c
index 6941307cc24..4a21b87cfdd 100644
--- a/src/emu/screen.c
+++ b/src/emu/screen.c
@@ -808,7 +808,7 @@ void screen_device::vblank_begin()
m_vblank_end_time = m_vblank_start_time + attotime(0, m_vblank_period);
// if this is the primary screen and we need to update now
- if (this == machine().primary_screen && !(m_video_attributes & VIDEO_UPDATE_AFTER_VBLANK))
+ if (this == machine().first_screen() && !(m_video_attributes & VIDEO_UPDATE_AFTER_VBLANK))
machine().video().frame_update();
// call the screen specific callbacks
@@ -842,7 +842,7 @@ void screen_device::vblank_end()
m_screen_vblank(*this, false);
// if this is the primary screen and we need to update now
- if (this == machine().primary_screen && (m_video_attributes & VIDEO_UPDATE_AFTER_VBLANK))
+ if (this == machine().first_screen() && (m_video_attributes & VIDEO_UPDATE_AFTER_VBLANK))
machine().video().frame_update();
// increment the frame number counter
diff --git a/src/emu/sound/nes_apu.c b/src/emu/sound/nes_apu.c
index 62e3e59782a..8f54578c3a0 100644
--- a/src/emu/sound/nes_apu.c
+++ b/src/emu/sound/nes_apu.c
@@ -161,9 +161,9 @@ void nesapu_device::device_start()
int i;
/* Initialize global variables */
- m_samps_per_sync = rate / ATTOSECONDS_TO_HZ(machine().primary_screen->frame_period().attoseconds);
+ m_samps_per_sync = rate / ATTOSECONDS_TO_HZ(machine().first_screen()->frame_period().attoseconds);
m_buffer_size = m_samps_per_sync;
- m_real_rate = m_samps_per_sync * ATTOSECONDS_TO_HZ(machine().primary_screen->frame_period().attoseconds);
+ m_real_rate = m_samps_per_sync * ATTOSECONDS_TO_HZ(machine().first_screen()->frame_period().attoseconds);
m_apu_incsize = (float) (clock() / (float) m_real_rate);
/* Use initializer calls */
diff --git a/src/emu/ui/ui.c b/src/emu/ui/ui.c
index 8f50ead60f9..d957d8086af 100644
--- a/src/emu/ui/ui.c
+++ b/src/emu/ui/ui.c
@@ -2017,8 +2017,8 @@ static INT32 slider_refresh(running_machine &machine, void *arg, astring *string
screen->configure(width, height, visarea, HZ_TO_ATTOSECONDS(defrefresh + (double)newval * 0.001));
}
if (string != NULL)
- string->printf("%.3ffps", ATTOSECONDS_TO_HZ(machine.primary_screen->frame_period().attoseconds));
- refresh = ATTOSECONDS_TO_HZ(machine.primary_screen->frame_period().attoseconds);
+ string->printf("%.3ffps", ATTOSECONDS_TO_HZ(machine.first_screen()->frame_period().attoseconds));
+ refresh = ATTOSECONDS_TO_HZ(machine.first_screen()->frame_period().attoseconds);
return floor((refresh - defrefresh) * 1000.0f + 0.5f);
}
diff --git a/src/emu/video.c b/src/emu/video.c
index 576495e0ded..c9424ba6c57 100644
--- a/src/emu/video.c
+++ b/src/emu/video.c
@@ -115,7 +115,7 @@ video_manager::video_manager(running_machine &machine)
// create a render target for snapshots
const char *viewname = machine.options().snap_view();
- m_snap_native = (machine.primary_screen != NULL && (viewname[0] == 0 || strcmp(viewname, "native") == 0));
+ m_snap_native = (machine.first_screen() != NULL && (viewname[0] == 0 || strcmp(viewname, "native") == 0));
// the native target is hard-coded to our internal layout and has all options disabled
if (m_snap_native)
@@ -152,7 +152,7 @@ video_manager::video_manager(running_machine &machine)
begin_recording(filename, MF_AVI);
// if no screens, create a periodic timer to drive updates
- if (machine.primary_screen == NULL)
+ if (machine.first_screen() == NULL)
{
m_screenless_frame_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(video_manager::screenless_update_callback), this));
m_screenless_frame_timer->adjust(screen_device::DEFAULT_FRAME_PERIOD, 0, screen_device::DEFAULT_FRAME_PERIOD);
@@ -240,8 +240,8 @@ void video_manager::frame_update(bool debug)
if (phase == MACHINE_PHASE_RUNNING)
{
// reset partial updates if we're paused or if the debugger is active
- if (machine().primary_screen != NULL && (machine().paused() || debug || debugger_within_instruction_hook(machine())))
- machine().primary_screen->reset_partial_updates();
+ if (machine().first_screen() != NULL && (machine().paused() || debug || debugger_within_instruction_hook(machine())))
+ machine().first_screen()->reset_partial_updates();
}
}
@@ -375,7 +375,7 @@ void video_manager::begin_recording(const char *name, movie_format format)
// build up information about this new movie
avi_movie_info info;
info.video_format = 0;
- info.video_timescale = 1000 * ((machine().primary_screen != NULL) ? ATTOSECONDS_TO_HZ(machine().primary_screen->frame_period().attoseconds) : screen_device::DEFAULT_FRAME_RATE);
+ info.video_timescale = 1000 * ((machine().first_screen() != NULL) ? ATTOSECONDS_TO_HZ(machine().first_screen()->frame_period().attoseconds) : screen_device::DEFAULT_FRAME_RATE);
info.video_sampletime = 1000;
info.video_numsamples = 0;
info.video_width = m_snap_bitmap.width();
@@ -431,7 +431,7 @@ void video_manager::begin_recording(const char *name, movie_format format)
if (filerr == FILERR_NONE)
{
// start the capture
- int rate = (machine().primary_screen != NULL) ? ATTOSECONDS_TO_HZ(machine().primary_screen->frame_period().attoseconds) : screen_device::DEFAULT_FRAME_RATE;
+ int rate = (machine().first_screen() != NULL) ? ATTOSECONDS_TO_HZ(machine().first_screen()->frame_period().attoseconds) : screen_device::DEFAULT_FRAME_RATE;
png_error pngerr = mng_capture_start(*m_mngfile, m_snap_bitmap, rate);
if (pngerr != PNGERR_NONE)
return end_recording();
@@ -1003,13 +1003,13 @@ void video_manager::recompute_speed(attotime emutime)
// if we're past the "time-to-execute" requested, signal an exit
if (m_seconds_to_run != 0 && emutime.seconds >= m_seconds_to_run)
{
- if (machine().primary_screen != NULL)
+ if (machine().first_screen() != NULL)
{
// create a final screenshot
emu_file file(machine().options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
file_error filerr = file.open(machine().basename(), PATH_SEPARATOR "final.png");
if (filerr == FILERR_NONE)
- save_snapshot(machine().primary_screen, file);
+ save_snapshot(machine().first_screen(), file);
}
// schedule our demise
@@ -1228,8 +1228,8 @@ void video_manager::record_frame()
}
// write the next frame
- const rgb_t *palette = (machine().primary_screen->palette() != NULL) ? machine().primary_screen->palette()->palette()->entry_list_adjusted() : NULL;
- png_error error = mng_capture_frame(*m_mngfile, &pnginfo, m_snap_bitmap, machine().primary_screen->palette()->entries(), palette);
+ const rgb_t *palette = (machine().first_screen()->palette() != NULL) ? machine().first_screen()->palette()->palette()->entry_list_adjusted() : NULL;
+ png_error error = mng_capture_frame(*m_mngfile, &pnginfo, m_snap_bitmap, machine().first_screen()->palette()->entries(), palette);
png_free(&pnginfo);
if (error != PNGERR_NONE)
{
diff --git a/src/emu/video/hd63484.c b/src/emu/video/hd63484.c
index 4c3db8e1166..40b1e6cac68 100644
--- a/src/emu/video/hd63484.c
+++ b/src/emu/video/hd63484.c
@@ -1557,7 +1557,7 @@ READ16_MEMBER( hd63484_device::data_r )
int res;
if (m_regno == 0x80)
- res = machine().primary_screen->vpos();
+ res = machine().first_screen()->vpos();
else if (m_regno == 0)
{
#if LOG_COMMANDS
diff --git a/src/emu/video/huc6270.c b/src/emu/video/huc6270.c
index 366ec198e73..a711792d1a0 100644
--- a/src/emu/video/huc6270.c
+++ b/src/emu/video/huc6270.c
@@ -376,7 +376,7 @@ inline void huc6270_device::next_horz_state()
{
case HUC6270_HDS:
m_bxr_latched = m_bxr;
-//if (LOG) printf("latched bxr vpos=%d, hpos=%d\n", video_screen_get_vpos(device->machine->primary_screen), video_screen_get_hpos(device->machine->primary_screen));
+//if (LOG) printf("latched bxr vpos=%d, hpos=%d\n", video_screen_get_vpos(device->machine->first_screen()), video_screen_get_hpos(device->machine->first_screen()));
m_horz_state = HUC6270_HDW;
m_horz_to_go = ( m_hdr & 0x7F ) + 1;
{
@@ -656,18 +656,18 @@ WRITE8_MEMBER( huc6270_device::write )
// m_status |= HUC6270_RR;
// m_irq_changed( ASSERT_LINE );
// }
-//if (LOG) printf("%04x: RCR (%03x) written at %d,%d\n", activecpu_get_pc(), huc6270->m_rcr, video_screen_get_vpos(device->machine->primary_screen), video_screen_get_hpos(device->machine->primary_screen) );
+//if (LOG) printf("%04x: RCR (%03x) written at %d,%d\n", activecpu_get_pc(), huc6270->m_rcr, video_screen_get_vpos(device->machine->first_screen()), video_screen_get_hpos(device->machine->first_screen()) );
break;
case BXR: /* background x-scroll register LSB */
m_bxr = ( m_bxr & 0x0300 ) | data;
-//if (LOG) printf("*********************** BXR written %d at %d,%d\n", m_bxr, video_screen_get_vpos(device->machine->primary_screen), video_screen_get_hpos(device->machine->primary_screen) );
+//if (LOG) printf("*********************** BXR written %d at %d,%d\n", m_bxr, video_screen_get_vpos(device->machine->first_screen()), video_screen_get_hpos(device->machine->first_screen()) );
break;
case BYR: /* background y-scroll register LSB */
m_byr = ( m_byr & 0x0100 ) | data;
m_byr_latched = m_byr;
-//if (LOG) printf("******************** BYR written %d at %d,%d\n", huc6270->m_byr, video_screen_get_vpos(device->machine->primary_screen), video_screen_get_hpos(device->machine->primary_screen) );
+//if (LOG) printf("******************** BYR written %d at %d,%d\n", huc6270->m_byr, video_screen_get_vpos(device->machine->first_screen()), video_screen_get_hpos(device->machine->first_screen()) );
break;
case MWR: /* memory width register LSB */
diff --git a/src/emu/video/pc_vga.c b/src/emu/video/pc_vga.c
index dc8ae4e6d53..6ecd465c742 100644
--- a/src/emu/video/pc_vga.c
+++ b/src/emu/video/pc_vga.c
@@ -208,7 +208,7 @@ mach8_device::mach8_device(const machine_config &mconfig, const char *tag, devic
TIMER_CALLBACK_MEMBER(vga_device::vblank_timer_cb)
{
vga.crtc.start_addr = vga.crtc.start_addr_latch;
- m_vblank_timer->adjust( machine().primary_screen->time_until_pos(vga.crtc.vert_blank_start) );
+ m_vblank_timer->adjust( machine().first_screen()->time_until_pos(vga.crtc.vert_blank_start) );
}
void vga_device::device_start()
@@ -347,7 +347,7 @@ void vga_device::vga_vh_text(bitmap_rgb32 &bitmap, const rectangle &cliprect)
pen_t pen;
if(vga.crtc.cursor_enable)
- vga.cursor.visible = machine().primary_screen->frame_number() & 0x10;
+ vga.cursor.visible = machine().first_screen()->frame_number() & 0x10;
else
vga.cursor.visible = 0;
@@ -360,7 +360,7 @@ void vga_device::vga_vh_text(bitmap_rgb32 &bitmap, const rectangle &cliprect)
attr = vga.memory[(pos<<1) + 1];
font_base = 0x20000+(ch<<5);
font_base += ((attr & 8) ? vga.sequencer.char_sel.A : vga.sequencer.char_sel.B)*0x2000;
- blink_en = (vga.attribute.data[0x10]&8&&machine().primary_screen->frame_number() & 0x20) ? attr & 0x80 : 0;
+ blink_en = (vga.attribute.data[0x10]&8&&machine().first_screen()->frame_number() & 0x20) ? attr & 0x80 : 0;
fore_col = attr & 0xf;
back_col = (attr & 0x70) >> 4;
@@ -378,7 +378,7 @@ void vga_device::vga_vh_text(bitmap_rgb32 &bitmap, const rectangle &cliprect)
else
pen = vga.pens[back_col];
- if(!machine().primary_screen->visible_area().contains(column*width+w, line+h))
+ if(!machine().first_screen()->visible_area().contains(column*width+w, line+h))
continue;
bitmapline[column*width+w] = pen;
@@ -391,7 +391,7 @@ void vga_device::vga_vh_text(bitmap_rgb32 &bitmap, const rectangle &cliprect)
else
pen = vga.pens[back_col];
- if(!machine().primary_screen->visible_area().contains(column*width+w, line+h))
+ if(!machine().first_screen()->visible_area().contains(column*width+w, line+h))
continue;
bitmapline[column*width+w] = pen;
}
@@ -402,7 +402,7 @@ void vga_device::vga_vh_text(bitmap_rgb32 &bitmap, const rectangle &cliprect)
(h<=vga.crtc.cursor_scan_end)&&(h<height)&&(line+h<TEXT_LINES);
h++)
{
- if(!machine().primary_screen->visible_area().contains(column*width, line+h))
+ if(!machine().first_screen()->visible_area().contains(column*width, line+h))
continue;
bitmap.plot_box(column*width, line+h, width, 1, vga.pens[attr&0xf]);
}
@@ -447,7 +447,7 @@ void vga_device::vga_vh_ega(bitmap_rgb32 &bitmap, const rectangle &cliprect)
data[2]>>=1;
data[3]>>=1;
- if(!machine().primary_screen->visible_area().contains(c+i-pel_shift, line + yi))
+ if(!machine().first_screen()->visible_area().contains(c+i-pel_shift, line + yi))
continue;
bitmapline[c+i-pel_shift] = pen;
}
@@ -491,7 +491,7 @@ void vga_device::vga_vh_vga(bitmap_rgb32 &bitmap, const rectangle &cliprect)
for(xi=0;xi<8;xi++)
{
- if(!machine().primary_screen->visible_area().contains(c+xi-(pel_shift), line + yi))
+ if(!machine().first_screen()->visible_area().contains(c+xi-(pel_shift), line + yi))
continue;
bitmapline[c+xi-(pel_shift)] = m_palette->pen(vga.memory[(pos & 0xffff)+((xi >> 1)*0x10000)]);
}
@@ -518,7 +518,7 @@ void vga_device::vga_vh_vga(bitmap_rgb32 &bitmap, const rectangle &cliprect)
for(xi=0;xi<0x10;xi++)
{
- if(!machine().primary_screen->visible_area().contains(c+xi-(pel_shift), line + yi))
+ if(!machine().first_screen()->visible_area().contains(c+xi-(pel_shift), line + yi))
continue;
bitmapline[c+xi-pel_shift] = m_palette->pen(vga.memory[(pos+(xi >> 1)) & 0xffff]);
}
@@ -552,7 +552,7 @@ void vga_device::vga_vh_cga(bitmap_rgb32 &bitmap, const rectangle &cliprect)
for(xi=0;xi<4;xi++)
{
pen = vga.pens[(vga.memory[addr] >> (6-xi*2)) & 3];
- if(!machine().primary_screen->visible_area().contains(x+xi, y * height + yi))
+ if(!machine().first_screen()->visible_area().contains(x+xi, y * height + yi))
continue;
bitmapline[x+xi] = pen;
}
@@ -587,7 +587,7 @@ void vga_device::vga_vh_mono(bitmap_rgb32 &bitmap, const rectangle &cliprect)
for(xi=0;xi<8;xi++)
{
pen = vga.pens[(vga.memory[addr] >> (7-xi)) & 1];
- if(!machine().primary_screen->visible_area().contains(x+xi, y * height + yi))
+ if(!machine().first_screen()->visible_area().contains(x+xi, y * height + yi))
continue;
bitmapline[x+xi] = pen;
}
@@ -640,7 +640,7 @@ void svga_device::svga_vh_rgb8(bitmap_rgb32 &bitmap, const rectangle &cliprect)
for(xi=0;xi<8;xi++)
{
- if(!machine().primary_screen->visible_area().contains(c+xi, line + yi))
+ if(!machine().first_screen()->visible_area().contains(c+xi, line + yi))
continue;
bitmapline[c+xi] = m_palette->pen(vga.memory[(pos+(xi))]);
}
@@ -679,7 +679,7 @@ void svga_device::svga_vh_rgb15(bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
int r,g,b;
- if(!machine().primary_screen->visible_area().contains(c+xi, line + yi))
+ if(!machine().first_screen()->visible_area().contains(c+xi, line + yi))
continue;
r = (MV(pos+xm)&0x7c00)>>10;
@@ -723,7 +723,7 @@ void svga_device::svga_vh_rgb16(bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
int r,g,b;
- if(!machine().primary_screen->visible_area().contains(c+xi, line + yi))
+ if(!machine().first_screen()->visible_area().contains(c+xi, line + yi))
continue;
r = (MV(pos+xm)&0xf800)>>11;
@@ -767,7 +767,7 @@ void svga_device::svga_vh_rgb24(bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
int r,g,b;
- if(!machine().primary_screen->visible_area().contains(c+xi, line + yi))
+ if(!machine().first_screen()->visible_area().contains(c+xi, line + yi))
continue;
r = (MD(pos+xm)&0xff0000)>>16;
@@ -808,7 +808,7 @@ void svga_device::svga_vh_rgb32(bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
int r,g,b;
- if(!machine().primary_screen->visible_area().contains(c+xi, line + yi))
+ if(!machine().first_screen()->visible_area().contains(c+xi, line + yi))
continue;
r = (MD(pos+xm)&0xff0000)>>16;
@@ -1317,9 +1317,9 @@ void vga_device::recompute_params_clock(int divisor, int xtal)
pixel_clock = xtal / (((vga.sequencer.data[1]&8) >> 3) + 1);
refresh = HZ_TO_ATTOSECONDS(pixel_clock) * (hblank_period) * vblank_period;
- machine().primary_screen->configure((hblank_period), (vblank_period), visarea, refresh );
+ machine().first_screen()->configure((hblank_period), (vblank_period), visarea, refresh );
//popmessage("%d %d\n",vga.crtc.horz_total * 8,vga.crtc.vert_total);
- m_vblank_timer->adjust( machine().primary_screen->time_until_pos(vga.crtc.vert_blank_start) );
+ m_vblank_timer->adjust( machine().first_screen()->time_until_pos(vga.crtc.vert_blank_start) );
}
void vga_device::recompute_params()
@@ -1506,7 +1506,7 @@ UINT8 vga_device::vga_vblank()
res = 0;
vblank_start = vga.crtc.vert_blank_start;
vblank_end = vga.crtc.vert_blank_start + vga.crtc.vert_blank_end;
- vpos = machine().primary_screen->vpos();
+ vpos = machine().first_screen()->vpos();
/* check if we are under vblank period */
if(vblank_end > vga.crtc.vert_total)
@@ -1542,8 +1542,8 @@ READ8_MEMBER(vga_device::vga_crtc_r)
vga.attribute.state = 0;
data = 0;
- hsync = space.machine().primary_screen->hblank() & 1;
- vsync = vga_vblank(); //space.machine().primary_screen->vblank() & 1;
+ hsync = space.machine().first_screen()->hblank() & 1;
+ vsync = vga_vblank(); //space.machine().first_screen()->vblank() & 1;
data |= (hsync | vsync) & 1; // DD - display disable register
data |= (vsync & 1) << 3; // VRetrace register
@@ -1594,10 +1594,10 @@ WRITE8_MEMBER(vga_device::vga_crtc_w)
}
crtc_reg_write(vga.crtc.index,data);
- //space.machine().primary_screen->update_partial(space.machine().primary_screen->vpos());
+ //space.machine().first_screen()->update_partial(space.machine().first_screen()->vpos());
#if 0
if((vga.crtc.index & 0xfe) != 0x0e)
- printf("%02x %02x %d\n",vga.crtc.index,data,space.machine().primary_screen->vpos());
+ printf("%02x %02x %d\n",vga.crtc.index,data,space.machine().first_screen()->vpos());
#endif
break;
@@ -2530,7 +2530,7 @@ WRITE8_MEMBER(tseng_vga_device::port_03d0_w)
vga.crtc.data[vga.crtc.index] = data;
tseng_crtc_reg_write(vga.crtc.index,data);
//if((vga.crtc.index & 0xfe) != 0x0e)
- // printf("%02x %02x %d\n",vga.crtc.index,data,space.machine().primary_screen->vpos());
+ // printf("%02x %02x %d\n",vga.crtc.index,data,space.machine().first_screen()->vpos());
break;
case 8:
et4k.reg_3d8 = data;
diff --git a/src/emu/video/psx.c b/src/emu/video/psx.c
index 51c2b1ec12e..ff927744ad4 100644
--- a/src/emu/video/psx.c
+++ b/src/emu/video/psx.c
@@ -114,7 +114,7 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine& machine, int n_level,
void psxgpu_device::DebugMeshInit( void )
{
- screen_device *screen = machine().primary_screen;
+ screen_device *screen = machine().first_screen();
int width = screen->width();
int height = screen->height();
@@ -131,7 +131,7 @@ void psxgpu_device::DebugMesh( int n_coordx, int n_coordy )
{
int n_coord;
int n_colour;
- screen_device *screen = machine().primary_screen;
+ screen_device *screen = machine().first_screen();
int width = screen->width();
int height = screen->height();
@@ -330,7 +330,7 @@ int psxgpu_device::DebugTextureDisplay( bitmap_ind16 &bitmap )
if( m_debug.b_texture )
{
- screen_device *screen = machine().primary_screen;
+ screen_device *screen = machine().first_screen();
int width = screen->width();
int height = screen->height();
@@ -442,7 +442,7 @@ void psxgpu_device::updatevisiblearea()
#endif
visarea.set(0, n_screenwidth - 1, 0, n_screenheight - 1);
- machine().primary_screen->configure(n_screenwidth, n_screenheight, visarea, HZ_TO_ATTOSECONDS(refresh));
+ machine().first_screen()->configure(n_screenwidth, n_screenheight, visarea, HZ_TO_ATTOSECONDS(refresh));
}
void psxgpu_device::psx_gpu_init( int n_gputype )
diff --git a/src/emu/video/stvvdp2.c b/src/emu/video/stvvdp2.c
index 1aca651daf8..de75439955c 100644
--- a/src/emu/video/stvvdp2.c
+++ b/src/emu/video/stvvdp2.c
@@ -5940,8 +5940,8 @@ int saturn_state::get_pixel_clock( void )
/* TODO: hblank position and hblank firing doesn't really match HW behaviour. */
UINT8 saturn_state::get_hblank( void )
{
- const rectangle &visarea = machine().primary_screen->visible_area();
- int cur_h = machine().primary_screen->hpos();
+ const rectangle &visarea = machine().first_screen()->visible_area();
+ int cur_h = machine().first_screen()->hpos();
if (cur_h > visarea.max_x) //TODO
return 1;
@@ -5952,7 +5952,7 @@ UINT8 saturn_state::get_hblank( void )
UINT8 saturn_state::get_vblank( void )
{
int cur_v,vblank;
- cur_v = machine().primary_screen->vpos();
+ cur_v = machine().first_screen()->vpos();
vblank = get_vblank_start_position() * get_ystep_count();
@@ -5970,7 +5970,7 @@ UINT8 saturn_state::get_odd_bit( void )
if(STV_VDP2_LSMD == 0) // same for non-interlace mode
return 1;
- return machine().primary_screen->frame_number() & 1;
+ return machine().first_screen()->frame_number() & 1;
}
int saturn_state::get_vblank_start_position( void )
@@ -5988,7 +5988,7 @@ int saturn_state::get_vblank_start_position( void )
int saturn_state::get_ystep_count( void )
{
- int max_y = machine().primary_screen->height();
+ int max_y = machine().first_screen()->height();
int y_step;
y_step = 2;
@@ -6004,7 +6004,7 @@ int saturn_state::get_hcounter( void )
{
int hcount;
- hcount = machine().primary_screen->hpos();
+ hcount = machine().first_screen()->hpos();
switch(STV_VDP2_HRES & 6)
{
@@ -6035,7 +6035,7 @@ int saturn_state::get_vcounter( void )
{
int vcount;
- vcount = machine().primary_screen->vpos();
+ vcount = machine().first_screen()->vpos();
/* Exclusive Monitor */
if(STV_VDP2_HRES & 4)
@@ -6043,7 +6043,7 @@ int saturn_state::get_vcounter( void )
/* Double Density Interlace */
if((STV_VDP2_LSMD & 3) == 3)
- return (vcount & ~1) | (machine().primary_screen->frame_number() & 1);
+ return (vcount & ~1) | (machine().first_screen()->frame_number() & 1);
/* docs says << 1, but according to HW tests it's a typo. */
return (true_vcount[vcount & 0x1ff][STV_VDP2_VRES]); // Non-interlace
@@ -6119,7 +6119,7 @@ int saturn_state::stv_vdp2_start ( void )
VIDEO_START_MEMBER(saturn_state,stv_vdp2)
{
int i;
- machine().primary_screen->register_screen_bitmap(m_tmpbitmap);
+ machine().first_screen()->register_screen_bitmap(m_tmpbitmap);
stv_vdp2_start();
stv_vdp1_start();
m_vdpdebug_roz = 0;
@@ -6184,9 +6184,9 @@ void saturn_state::stv_vdp2_dynamic_res_change( void )
refresh = HZ_TO_ATTOSECONDS(get_pixel_clock()) * (hblank_period) * vblank_period;
//printf("%d %d %d %d\n",horz_res,vert_res,horz_res+hblank_period,vblank_period);
- machine().primary_screen->configure(hblank_period, vblank_period, visarea, refresh );
+ machine().first_screen()->configure(hblank_period, vblank_period, visarea, refresh );
}
-// machine().primary_screen->set_visible_area(0*8, horz_res-1,0*8, vert_res-1);
+// machine().first_screen()->set_visible_area(0*8, horz_res-1,0*8, vert_res-1);
}
/*This is for calculating the rgb brightness*/
diff --git a/src/emu/video/tms3556.c b/src/emu/video/tms3556.c
index de351849041..a18aba1a2ab 100644
--- a/src/emu/video/tms3556.c
+++ b/src/emu/video/tms3556.c
@@ -118,7 +118,7 @@ void tms3556_device::device_start()
save_item(NAME(m_char_line_counter));
save_item(NAME(m_dbl_h_phase));
- machine().primary_screen->register_screen_bitmap(m_bitmap);
+ machine().first_screen()->register_screen_bitmap(m_bitmap);
}
diff --git a/src/ldplayer/ldplayer.c b/src/ldplayer/ldplayer.c
index b741350e2b8..f15510d350b 100644
--- a/src/ldplayer/ldplayer.c
+++ b/src/ldplayer/ldplayer.c
@@ -343,8 +343,8 @@ void ldplayer_state::device_timer(emu_timer &timer, device_timer_id id, int para
process_commands();
// set a timer to go off on the next VBLANK
- int vblank_scanline = machine().primary_screen->visible_area().max_y + 1;
- attotime target = machine().primary_screen->time_until_pos(vblank_scanline);
+ int vblank_scanline = machine().first_screen()->visible_area().max_y + 1;
+ attotime target = machine().first_screen()->time_until_pos(vblank_scanline);
timer_set(target, TIMER_ID_VSYNC_UPDATE);
break;
}
diff --git a/src/mame/audio/cinemat.c b/src/mame/audio/cinemat.c
index e3101fb23fd..aca38ed304d 100644
--- a/src/mame/audio/cinemat.c
+++ b/src/mame/audio/cinemat.c
@@ -867,14 +867,14 @@ static void starcas_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bit
target_pitch = 0x5800 + (target_pitch << 12);
/* once per frame slide the pitch toward the target */
- if (machine.primary_screen->frame_number() > state->m_last_frame)
+ if (machine.first_screen()->frame_number() > state->m_last_frame)
{
if (state->m_current_pitch > target_pitch)
state->m_current_pitch -= 225;
if (state->m_current_pitch < target_pitch)
state->m_current_pitch += 150;
samples->set_frequency(4, state->m_current_pitch);
- state->m_last_frame = machine.primary_screen->frame_number();
+ state->m_last_frame = machine.first_screen()->frame_number();
}
/* remember the previous value */
@@ -970,7 +970,7 @@ static void solarq_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits
state->m_target_volume = 0;
/* ramp the thrust volume */
- if (samples->playing(2) && machine.primary_screen->frame_number() > state->m_last_frame)
+ if (samples->playing(2) && machine.first_screen()->frame_number() > state->m_last_frame)
{
if (state->m_current_volume > state->m_target_volume)
state->m_current_volume -= 0.078f;
@@ -980,7 +980,7 @@ static void solarq_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits
samples->set_volume(2, state->m_current_volume);
else
samples->stop(2);
- state->m_last_frame = machine.primary_screen->frame_number();
+ state->m_last_frame = machine.first_screen()->frame_number();
}
/* fire - falling edge */
@@ -1250,14 +1250,14 @@ static void wotw_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_c
target_pitch = 0x10000 + (target_pitch << 12);
/* once per frame slide the pitch toward the target */
- if (machine.primary_screen->frame_number() > state->m_last_frame)
+ if (machine.first_screen()->frame_number() > state->m_last_frame)
{
if (state->m_current_pitch > target_pitch)
state->m_current_pitch -= 300;
if (state->m_current_pitch < target_pitch)
state->m_current_pitch += 200;
samples->set_frequency(4, state->m_current_pitch);
- state->m_last_frame = machine.primary_screen->frame_number();
+ state->m_last_frame = machine.first_screen()->frame_number();
}
/* remember the previous value */
diff --git a/src/mame/video/atari.c b/src/mame/video/atari.c
index 11acaf23530..97e7f8c57da 100644
--- a/src/mame/video/atari.c
+++ b/src/mame/video/atari.c
@@ -714,7 +714,7 @@ VIDEO_START( atari )
LOG(("atari antic_vh_start\n"));
memset(&antic, 0, sizeof(antic));
- antic.bitmap = auto_bitmap_ind16_alloc(machine, machine.primary_screen->width(), machine.primary_screen->height());
+ antic.bitmap = auto_bitmap_ind16_alloc(machine, machine.first_screen()->width(), machine.first_screen()->height());
antic.renderer = antic_mode_0_xx;
antic.cclk_expand = auto_alloc_array(machine, UINT32, 21 * 256);
@@ -758,7 +758,7 @@ VIDEO_START( atari )
LOG(("atari prio_init\n"));
prio_init();
- for( i = 0; i < machine.primary_screen->height(); i++ )
+ for( i = 0; i < machine.first_screen()->height(); i++ )
{
antic.video[i] = auto_alloc_clear(machine, VIDEO);
}
@@ -947,7 +947,7 @@ static void antic_linerefresh(running_machine &machine)
UINT32 scanline[4 + (HCHARS * 2) + 4];
/* increment the scanline */
- if( ++antic.scanline == machine.primary_screen->height() )
+ if( ++antic.scanline == machine.first_screen()->height() )
{
/* and return to the top if the frame was complete */
antic.scanline = 0;
@@ -1049,12 +1049,12 @@ static void antic_linerefresh(running_machine &machine)
static int cycle(running_machine &machine)
{
- return machine.primary_screen->hpos() * CYCLES_PER_LINE / machine.primary_screen->width();
+ return machine.first_screen()->hpos() * CYCLES_PER_LINE / machine.first_screen()->width();
}
static void after(running_machine &machine, int cycles, timer_expired_func function, const char *funcname)
{
- attotime duration = machine.primary_screen->scan_period() * cycles / CYCLES_PER_LINE;
+ attotime duration = machine.first_screen()->scan_period() * cycles / CYCLES_PER_LINE;
(void)funcname;
LOG((" after %3d (%5.1f us) %s\n", cycles, duration.as_double() * 1.0e6, funcname));
machine.scheduler().timer_set(duration, function, funcname);
@@ -1355,7 +1355,7 @@ static void antic_scanline_dma(running_machine &machine, int param)
/* produce empty scanlines until vblank start */
antic.modelines = VBL_START + 1 - antic.scanline;
if( antic.modelines < 0 )
- antic.modelines = machine.primary_screen->height() - antic.scanline;
+ antic.modelines = machine.first_screen()->height() - antic.scanline;
LOG((" JVB $%04x\n", antic.dpage|antic.doffs));
}
else
@@ -1520,7 +1520,7 @@ static void generic_atari_interrupt(running_machine &machine, int button_count)
}
/* do nothing new for the rest of the frame */
- antic.modelines = machine.primary_screen->height() - VBL_START;
+ antic.modelines = machine.first_screen()->height() - VBL_START;
antic.renderer = antic_mode_0_xx;
/* if the CPU want's to be interrupted at vertical blank... */
diff --git a/src/mame/video/avgdvg.c b/src/mame/video/avgdvg.c
index f6899000251..86e81478855 100644
--- a/src/mame/video/avgdvg.c
+++ b/src/mame/video/avgdvg.c
@@ -1488,7 +1488,7 @@ static void register_state (running_machine &machine)
static VIDEO_START( avg_common )
{
- const rectangle &visarea = machine.primary_screen->visible_area();
+ const rectangle &visarea = machine.first_screen()->visible_area();
avgdvg_vectorram = reinterpret_cast<UINT8 *>(machine.root_device().memshare("vectorram")->ptr());
avgdvg_vectorram_size = machine.root_device().memshare("vectorram")->bytes();
@@ -1525,7 +1525,7 @@ static VIDEO_START( avg_common )
VIDEO_START( dvg )
{
- const rectangle &visarea = machine.primary_screen->visible_area();
+ const rectangle &visarea = machine.first_screen()->visible_area();
avgdvg_vectorram = reinterpret_cast<UINT8 *>(machine.root_device().memshare("vectorram")->ptr());
avgdvg_vectorram_size = machine.root_device().memshare("vectorram")->bytes();
diff --git a/src/mame/video/decmxc06.c b/src/mame/video/decmxc06.c
index 0eb871d1004..c5ab3bdcfe4 100644
--- a/src/mame/video/decmxc06.c
+++ b/src/mame/video/decmxc06.c
@@ -128,7 +128,7 @@ void deco_mxc06_device::draw_sprites( running_machine &machine, bitmap_ind16 &bi
if (spriteram[offs] & 0x8000)
{
int draw = 0;
- if (!flash || (machine.primary_screen->frame_number() & 1))
+ if (!flash || (machine.first_screen()->frame_number() & 1))
{
if (m_priority_type==0) // most cases
{
diff --git a/src/mame/video/gp9001.c b/src/mame/video/gp9001.c
index 014bb1cb045..b68025b4961 100644
--- a/src/mame/video/gp9001.c
+++ b/src/mame/video/gp9001.c
@@ -903,8 +903,8 @@ void gp9001vdp_device::draw_sprites( running_machine &machine, bitmap_ind16 &bit
void gp9001vdp_device::gp9001_draw_custom_tilemap(running_machine& machine, bitmap_ind16 &bitmap, tilemap_t* tilemap, const UINT8* priremap, const UINT8* pri_enable )
{
- int width = machine.primary_screen->width();
- int height = machine.primary_screen->height();
+ int width = machine.first_screen()->width();
+ int height = machine.first_screen()->height();
int y,x;
bitmap_ind16 &tmb = tilemap->pixmap();
UINT16* srcptr;
diff --git a/src/mame/video/gtia.c b/src/mame/video/gtia.c
index d7c45161247..d5d91fcade7 100644
--- a/src/mame/video/gtia.c
+++ b/src/mame/video/gtia.c
@@ -149,7 +149,7 @@ static void gtia_state(running_machine &machine)
static int is_ntsc(running_machine &machine)
{
- return ATTOSECONDS_TO_HZ(machine.primary_screen->frame_period().attoseconds) > 55;
+ return ATTOSECONDS_TO_HZ(machine.first_screen()->frame_period().attoseconds) > 55;
}
diff --git a/src/mame/video/gticlub.c b/src/mame/video/gticlub.c
index c3956380dc8..51d949f47fc 100644
--- a/src/mame/video/gticlub.c
+++ b/src/mame/video/gticlub.c
@@ -235,14 +235,14 @@ void K001005_init(running_machine &machine)
{
int i,k;
- int width = machine.primary_screen->width();
- int height = machine.primary_screen->height();
+ int width = machine.first_screen()->width();
+ int height = machine.first_screen()->height();
K001005_zbuffer = auto_bitmap_ind32_alloc(machine, width, height);
gfxrom = machine.root_device().memregion("gfx1")->base();
- K001005_bitmap[0] = auto_bitmap_rgb32_alloc(machine, machine.primary_screen->width(), machine.primary_screen->height());
- K001005_bitmap[1] = auto_bitmap_rgb32_alloc(machine, machine.primary_screen->width(), machine.primary_screen->height());
+ K001005_bitmap[0] = auto_bitmap_rgb32_alloc(machine, machine.first_screen()->width(), machine.first_screen()->height());
+ K001005_bitmap[1] = auto_bitmap_rgb32_alloc(machine, machine.first_screen()->width(), machine.first_screen()->height());
K001005_texture = auto_alloc_array(machine, UINT8, 0x800000);
@@ -833,7 +833,7 @@ static void draw_scanline_gouraud_blend(void *dest, INT32 scanline, const poly_e
static void render_polygons(running_machine &machine)
{
- const rectangle& visarea = machine.primary_screen->visible_area();
+ const rectangle& visarea = machine.first_screen()->visible_area();
poly_vertex v[4];
int poly_type;
int brightness;
diff --git a/src/mame/video/harddriv.c b/src/mame/video/harddriv.c
index ed5aa51f736..eeca1d56d0b 100644
--- a/src/mame/video/harddriv.c
+++ b/src/mame/video/harddriv.c
@@ -166,7 +166,7 @@ void hdgsp_read_from_shiftreg(address_space &space, UINT32 address, UINT16 *shif
static void update_palette_bank(running_machine &machine, int newbank)
{
harddriv_state *state = machine.driver_data<harddriv_state>();
- machine.primary_screen->update_partial(machine.primary_screen->vpos());
+ machine.first_screen()->update_partial(machine.first_screen()->vpos());
state->m_gfx_palettebank = newbank;
}
diff --git a/src/mame/video/hng64.c b/src/mame/video/hng64.c
index fde784d8d8a..be90650f35d 100644
--- a/src/mame/video/hng64.c
+++ b/src/mame/video/hng64.c
@@ -1894,7 +1894,7 @@ static void recoverPolygonBlock(running_machine& machine, const UINT16* packet,
setIdentity(objectMatrix);
struct polygon lastPoly = { 0 };
- const rectangle &visarea = machine.primary_screen->visible_area();
+ const rectangle &visarea = machine.first_screen()->visible_area();
/////////////////
// HEADER INFO //
@@ -2786,7 +2786,7 @@ static void performFrustumClip(struct polygon *p)
#ifdef UNUSED_FUNCTION
static void plot(running_machine &machine, INT32 x, INT32 y, UINT32 color)
{
- UINT32* cb = &(colorBuffer3d[(y * machine.primary_screen->visible_area().max_x) + x]);
+ UINT32* cb = &(colorBuffer3d[(y * machine.first_screen()->visible_area().max_x) + x]);
*cb = color;
}
@@ -2903,8 +2903,8 @@ INLINE void FillSmoothTexPCHorizontalLine(running_machine &machine,
float s_start, float s_delta, float t_start, float t_delta)
{
hng64_state *state = machine.driver_data<hng64_state>();
- float* db = &(state->m_depthBuffer3d[(y * machine.primary_screen->visible_area().max_x) + x_start]);
- UINT32* cb = &(state->m_colorBuffer3d[(y * machine.primary_screen->visible_area().max_x) + x_start]);
+ float* db = &(state->m_depthBuffer3d[(y * machine.first_screen()->visible_area().max_x) + x_start]);
+ UINT32* cb = &(state->m_colorBuffer3d[(y * machine.first_screen()->visible_area().max_x) + x_start]);
UINT8 paletteEntry = 0;
float t_coord, s_coord;
diff --git a/src/mame/video/konamigx.c b/src/mame/video/konamigx.c
index d9655733f68..60acce16a29 100644
--- a/src/mame/video/konamigx.c
+++ b/src/mame/video/konamigx.c
@@ -292,7 +292,7 @@ int K055555GX_decode_osmixcolor(int layer, int *color) // (see p.63, p.49-50 and
static void gx_wipezbuf(running_machine &machine, int noshadow)
{
- const rectangle &visarea = machine.primary_screen->visible_area();
+ const rectangle &visarea = machine.first_screen()->visible_area();
int w = visarea.width();
int h = visarea.height();
diff --git a/src/mame/video/midzeus.c b/src/mame/video/midzeus.c
index 500d14d5941..ce87b76aaab 100644
--- a/src/mame/video/midzeus.c
+++ b/src/mame/video/midzeus.c
@@ -547,7 +547,7 @@ static void zeus_register16_w(running_machine &machine, offs_t offset, UINT16 da
/* writes to register $CC need to force a partial update */
if ((offset & ~1) == 0xcc)
- machine.primary_screen->update_partial(machine.primary_screen->vpos());
+ machine.first_screen()->update_partial(machine.first_screen()->vpos());
/* write to high part on odd addresses */
if (offset & 1)
@@ -573,7 +573,7 @@ static void zeus_register32_w(running_machine &machine, offs_t offset, UINT32 da
/* writes to register $CC need to force a partial update */
if ((offset & ~1) == 0xcc)
- machine.primary_screen->update_partial(machine.primary_screen->vpos());
+ machine.first_screen()->update_partial(machine.first_screen()->vpos());
/* always write to low word? */
state->m_zeusbase[offset & ~1] = data;
@@ -742,7 +742,7 @@ static void zeus_register_update(running_machine &machine, offs_t offset)
case 0xc6:
case 0xc8:
case 0xca:
- machine.primary_screen->update_partial(machine.primary_screen->vpos());
+ machine.first_screen()->update_partial(machine.first_screen()->vpos());
{
int vtotal = state->m_zeusbase[0xca] >> 16;
int htotal = state->m_zeusbase[0xc6] >> 16;
@@ -750,7 +750,7 @@ static void zeus_register_update(running_machine &machine, offs_t offset)
rectangle visarea(state->m_zeusbase[0xc6] & 0xffff, htotal - 3, 0, state->m_zeusbase[0xc8] & 0xffff);
if (htotal > 0 && vtotal > 0 && visarea.min_x < visarea.max_x && visarea.max_y < vtotal)
{
- machine.primary_screen->configure(htotal, vtotal, visarea, HZ_TO_ATTOSECONDS((double)MIDZEUS_VIDEO_CLOCK / 8.0 / (htotal * vtotal)));
+ machine.first_screen()->configure(htotal, vtotal, visarea, HZ_TO_ATTOSECONDS((double)MIDZEUS_VIDEO_CLOCK / 8.0 / (htotal * vtotal)));
zeus_cliprect = visarea;
zeus_cliprect.max_x -= zeus_cliprect.min_x;
zeus_cliprect.min_x = 0;
@@ -759,7 +759,7 @@ static void zeus_register_update(running_machine &machine, offs_t offset)
break;
case 0xcc:
- machine.primary_screen->update_partial(machine.primary_screen->vpos());
+ machine.first_screen()->update_partial(machine.first_screen()->vpos());
log_fifo = machine.input().code_pressed(KEYCODE_L);
break;
diff --git a/src/mame/video/midzeus2.c b/src/mame/video/midzeus2.c
index bb0d0d70494..5ea2b4fc5b6 100644
--- a/src/mame/video/midzeus2.c
+++ b/src/mame/video/midzeus2.c
@@ -510,7 +510,7 @@ if (regdata_count[offset] < 256)
/* writes to register $CC need to force a partial update */
// if ((offset & ~1) == 0xcc)
-// machine.primary_screen->update_partial(machine.primary_screen->vpos());
+// machine.first_screen()->update_partial(machine.first_screen()->vpos());
/* always write to low word? */
state->m_zeusbase[offset] = data;
@@ -562,7 +562,7 @@ static void zeus_register_update(running_machine &machine, offs_t offset, UINT32
case 0x35:
case 0x36:
case 0x37:
- machine.primary_screen->update_partial(machine.primary_screen->vpos());
+ machine.first_screen()->update_partial(machine.first_screen()->vpos());
{
int vtotal = state->m_zeusbase[0x37] & 0xffff;
int htotal = state->m_zeusbase[0x34] >> 16;
@@ -570,7 +570,7 @@ static void zeus_register_update(running_machine &machine, offs_t offset, UINT32
rectangle visarea(state->m_zeusbase[0x33] >> 16, (state->m_zeusbase[0x34] & 0xffff) - 1, 0, state->m_zeusbase[0x35] & 0xffff);
if (htotal > 0 && vtotal > 0 && visarea.min_x < visarea.max_x && visarea.max_y < vtotal)
{
- machine.primary_screen->configure(htotal, vtotal, visarea, HZ_TO_ATTOSECONDS((double)MIDZEUS_VIDEO_CLOCK / 4.0 / (htotal * vtotal)));
+ machine.first_screen()->configure(htotal, vtotal, visarea, HZ_TO_ATTOSECONDS((double)MIDZEUS_VIDEO_CLOCK / 4.0 / (htotal * vtotal)));
zeus_cliprect = visarea;
zeus_cliprect.max_x -= zeus_cliprect.min_x;
zeus_cliprect.min_x = 0;
@@ -582,7 +582,7 @@ static void zeus_register_update(running_machine &machine, offs_t offset, UINT32
{
UINT32 temp = state->m_zeusbase[0x38];
state->m_zeusbase[0x38] = oldval;
- machine.primary_screen->update_partial(machine.primary_screen->vpos());
+ machine.first_screen()->update_partial(machine.first_screen()->vpos());
log_fifo = machine.input().code_pressed(KEYCODE_L);
state->m_zeusbase[0x38] = temp;
}
diff --git a/src/mame/video/model1.c b/src/mame/video/model1.c
index 70f36d73227..b78fd0f0e6f 100644
--- a/src/mame/video/model1.c
+++ b/src/mame/video/model1.c
@@ -1164,7 +1164,7 @@ static int get_list_number(model1_state *state)
static void end_frame(running_machine &machine)
{
model1_state *state = machine.driver_data<model1_state>();
- if((state->m_listctl[0] & 4) && (machine.primary_screen->frame_number() & 1))
+ if((state->m_listctl[0] & 4) && (machine.first_screen()->frame_number() & 1))
state->m_listctl[0] ^= 0x40;
}
diff --git a/src/mame/video/scn2674.c b/src/mame/video/scn2674.c
index 68d05bd18b8..e8d304965df 100644
--- a/src/mame/video/scn2674.c
+++ b/src/mame/video/scn2674.c
@@ -636,12 +636,12 @@ void scn2674_device::scn2674_line(running_machine &machine)
m_scn2674_status_register |= 0x04;
if (m_scn2674_irq_mask&0x04)
{
- machine.primary_screen->update_partial(m_linecounter);
+ machine.first_screen()->update_partial(m_linecounter);
m_scn2674_irq_register |= 0x04;
LOG2674(("SCN2674 Split Screen 1\n"));
m_scn2674_irq_state = 1;
m_interrupt_callback(1);
-// machine.primary_screen->update_partial(m_linecounter);
+// machine.first_screen()->update_partial(m_linecounter);
}
}
@@ -656,12 +656,12 @@ void scn2674_device::scn2674_line(running_machine &machine)
m_scn2674_status_register |= 0x01;
if (m_scn2674_irq_mask&0x01)
{
- machine.primary_screen->update_partial(m_linecounter);
+ machine.first_screen()->update_partial(m_linecounter);
LOG2674(("SCN2674 Split Screen 2 irq\n"));
m_scn2674_irq_state = 1;
m_scn2674_irq_register |= 0x01;
m_interrupt_callback(1);
- //machine.primary_screen->update_partial(m_linecounter);
+ //machine.first_screen()->update_partial(m_linecounter);
}
}
diff --git a/src/mame/video/sknsspr.c b/src/mame/video/sknsspr.c
index fb1dae9035a..4755124201e 100644
--- a/src/mame/video/sknsspr.c
+++ b/src/mame/video/sknsspr.c
@@ -395,12 +395,12 @@ void sknsspr_device::skns_draw_sprites(running_machine &machine, bitmap_ind16 &b
if (sprite_flip&2)
{
xflip ^= 1;
- sx = machine.primary_screen->visible_area().max_x+1 - sx;
+ sx = machine.first_screen()->visible_area().max_x+1 - sx;
}
if (sprite_flip&1)
{
yflip ^= 1;
- sy = machine.primary_screen->visible_area().max_y+1 - sy;
+ sy = machine.first_screen()->visible_area().max_y+1 - sy;
}
/* Palette linking */
diff --git a/src/mame/video/snes.c b/src/mame/video/snes.c
index d58a6619f10..f9ad7e2c843 100644
--- a/src/mame/video/snes.c
+++ b/src/mame/video/snes.c
@@ -1820,8 +1820,8 @@ static const UINT16 vram_fgr_shiftab[4] = { 0, 5, 6, 7 };
// utility function - latches the H/V counters. Used by IRQ, writes to WRIO, etc.
void snes_ppu_class::latch_counters( running_machine &machine )
{
- m_beam.current_horz = machine.primary_screen->hpos() / m_htmult;
- m_beam.latch_vert = machine.primary_screen->vpos();
+ m_beam.current_horz = machine.first_screen()->hpos() / m_htmult;
+ m_beam.latch_vert = machine.first_screen()->vpos();
m_beam.latch_horz = m_beam.current_horz;
m_stat78 |= 0x40; // indicate we latched
// m_read_ophct = m_read_opvct = 0; // clear read flags - 2009-08: I think we must clear these when STAT78 is read...
@@ -1831,7 +1831,7 @@ void snes_ppu_class::latch_counters( running_machine &machine )
void snes_ppu_class::dynamic_res_change( running_machine &machine )
{
- rectangle visarea = machine.primary_screen->visible_area();
+ rectangle visarea = machine.first_screen()->visible_area();
attoseconds_t refresh;
visarea.min_x = visarea.min_y = 0;
@@ -1848,12 +1848,12 @@ void snes_ppu_class::dynamic_res_change( running_machine &machine )
if ((m_stat78 & 0x10) == SNES_NTSC)
{
refresh = HZ_TO_ATTOSECONDS(DOTCLK_NTSC) * SNES_HTOTAL * SNES_VTOTAL_NTSC;
- machine.primary_screen->configure(SNES_HTOTAL * 2, SNES_VTOTAL_NTSC * m_interlace, visarea, refresh);
+ machine.first_screen()->configure(SNES_HTOTAL * 2, SNES_VTOTAL_NTSC * m_interlace, visarea, refresh);
}
else
{
refresh = HZ_TO_ATTOSECONDS(DOTCLK_PAL) * SNES_HTOTAL * SNES_VTOTAL_PAL;
- machine.primary_screen->configure(SNES_HTOTAL * 2, SNES_VTOTAL_PAL * m_interlace, visarea, refresh);
+ machine.first_screen()->configure(SNES_HTOTAL * 2, SNES_VTOTAL_PAL * m_interlace, visarea, refresh);
}
}
diff --git a/src/mame/video/taito_f3.c b/src/mame/video/taito_f3.c
index 81bfcf3c973..ca37f9ffbd7 100644
--- a/src/mame/video/taito_f3.c
+++ b/src/mame/video/taito_f3.c
@@ -2835,7 +2835,7 @@ inline void taito_f3_state::f3_drawgfxzoom(bitmap_rgb32 &dest_bmp,const rectangl
static void get_sprite_info(running_machine &machine, const UINT16 *spriteram16_ptr)
{
taito_f3_state *state = machine.driver_data<taito_f3_state>();
- const rectangle &visarea = machine.primary_screen->visible_area();
+ const rectangle &visarea = machine.first_screen()->visible_area();
const int min_x=visarea.min_x,max_x=visarea.max_x;
const int min_y=visarea.min_y,max_y=visarea.max_y;
int offs,spritecont,flipx,flipy,/*old_x,*/color,x,y;
diff --git a/src/mame/video/taitojc.c b/src/mame/video/taitojc.c
index 499b38d295e..968fdc3a13b 100644
--- a/src/mame/video/taitojc.c
+++ b/src/mame/video/taitojc.c
@@ -483,7 +483,7 @@ void taitojc_renderer::render_texture_scan(INT32 scanline, const extent_t &exten
void taitojc_renderer::render_polygons(running_machine &machine, UINT16 *polygon_fifo, int length)
{
// taitojc_state *state = machine.driver_data<taitojc_state>();
- const rectangle visarea = machine.primary_screen->visible_area();
+ const rectangle visarea = machine.first_screen()->visible_area();
vertex_t vert[4];
int i;
int ptr;
diff --git a/src/mame/video/vdc.c b/src/mame/video/vdc.c
index c1bdf7db7ee..72ed4fa7485 100644
--- a/src/mame/video/vdc.c
+++ b/src/mame/video/vdc.c
@@ -422,7 +422,7 @@ VIDEO_START( pce )
memset(vdc[1].vram, 0, 0x10000);
/* create display bitmap */
- vce.bmp = auto_bitmap_ind16_alloc(machine, machine.primary_screen->width(), machine.primary_screen->height());
+ vce.bmp = auto_bitmap_ind16_alloc(machine, machine.first_screen()->width(), machine.first_screen()->height());
vdc[0].inc = 1;
vdc[1].inc = 1;
diff --git a/src/mame/video/wecleman.c b/src/mame/video/wecleman.c
index 9fe99f1994b..ff41f954a1d 100644
--- a/src/mame/video/wecleman.c
+++ b/src/mame/video/wecleman.c
@@ -793,7 +793,7 @@ static void hotchase_draw_road(running_machine &machine, bitmap_ind16 &bitmap, c
#define YSIZE 512
int sx, sy;
- const rectangle &visarea = machine.primary_screen->visible_area();
+ const rectangle &visarea = machine.first_screen()->visible_area();
/* Let's draw from the top to the bottom of the visible screen */
for (sy = visarea.min_y;sy <= visarea.max_y;sy++)
diff --git a/src/mess/drivers/a2600.c b/src/mess/drivers/a2600.c
index 29136f44891..1d3b2fcd27c 100644
--- a/src/mess/drivers/a2600.c
+++ b/src/mess/drivers/a2600.c
@@ -1429,7 +1429,7 @@ WRITE16_MEMBER(a2600_state::a2600_tia_vsync_callback)
if ( supported_screen_heights[i] != m_current_screen_height )
{
m_current_screen_height = supported_screen_heights[i];
-// machine.primary_screen->configure(228, m_current_screen_height, &visarea[i], HZ_TO_ATTOSECONDS( MASTER_CLOCK_NTSC ) * 228 * m_current_screen_height );
+// machine.first_screen()->configure(228, m_current_screen_height, &visarea[i], HZ_TO_ATTOSECONDS( MASTER_CLOCK_NTSC ) * 228 * m_current_screen_height );
}
}
}
@@ -1446,7 +1446,7 @@ WRITE16_MEMBER(a2600_state::a2600_tia_vsync_callback_pal)
if ( supported_screen_heights[i] != m_current_screen_height )
{
m_current_screen_height = supported_screen_heights[i];
-// machine.primary_screen->configure(228, m_current_screen_height, &visarea[i], HZ_TO_ATTOSECONDS( MASTER_CLOCK_PAL ) * 228 * m_current_screen_height );
+// machine.first_screen()->configure(228, m_current_screen_height, &visarea[i], HZ_TO_ATTOSECONDS( MASTER_CLOCK_PAL ) * 228 * m_current_screen_height );
}
}
}
diff --git a/src/mess/drivers/a5105.c b/src/mess/drivers/a5105.c
index 20ecde8340f..470225f36c5 100644
--- a/src/mess/drivers/a5105.c
+++ b/src/mess/drivers/a5105.c
@@ -127,7 +127,7 @@ static UPD7220_DRAW_TEXT_LINE( hgdc_draw_text )
{
tile_data = state->m_char_ram[(tile*8+yi) & 0x7ff];
- if(cursor_on && cursor_addr == addr+x && device->machine().primary_screen->frame_number() & 0x10)
+ if(cursor_on && cursor_addr == addr+x && device->machine().first_screen()->frame_number() & 0x10)
tile_data^=0xff;
for( xi = 0; xi < 8; xi++)
@@ -141,12 +141,12 @@ static UPD7220_DRAW_TEXT_LINE( hgdc_draw_text )
if(yi >= 8) { pen = 0; }
/* TODO: pitch is currently 40, this should actually go in the upd7220 device */
- if(!device->machine().primary_screen->visible_area().contains(res_x*2+0, res_y))
+ if(!device->machine().first_screen()->visible_area().contains(res_x*2+0, res_y))
continue;
bitmap.pix32(res_y, res_x*2+0) = palette[pen];
- if(!device->machine().primary_screen->visible_area().contains(res_x*2+1, res_y))
+ if(!device->machine().first_screen()->visible_area().contains(res_x*2+1, res_y))
continue;
bitmap.pix32(res_y, res_x*2+1) = palette[pen];
diff --git a/src/mess/drivers/a7000.c b/src/mess/drivers/a7000.c
index 945d102f837..094db2b6714 100644
--- a/src/mess/drivers/a7000.c
+++ b/src/mess/drivers/a7000.c
@@ -177,7 +177,7 @@ void a7000_state::vidc20_dynamic_screen_change()
{
/* finally ready to change the resolution */
int hblank_period,vblank_period;
- rectangle visarea = machine().primary_screen->visible_area();
+ rectangle visarea = machine().first_screen()->visible_area();
hblank_period = (m_vidc20_horz_reg[HCR] & 0x3ffc);
vblank_period = (m_vidc20_vert_reg[VCR] & 0x3fff);
/* note that we use the border registers as the visible area */
@@ -186,7 +186,7 @@ void a7000_state::vidc20_dynamic_screen_change()
visarea.min_y = (m_vidc20_vert_reg[VBSR] & 0x1fff);
visarea.max_y = (m_vidc20_vert_reg[VBER] & 0x1fff)-1;
- machine().primary_screen->configure(hblank_period, vblank_period, visarea, machine().primary_screen->frame_period().attoseconds );
+ machine().first_screen()->configure(hblank_period, vblank_period, visarea, machine().first_screen()->frame_period().attoseconds );
logerror("VIDC20: successfully changed the screen to:\n Display Size = %d x %d\n Border Size %d x %d\n Cycle Period %d x %d\n",
(m_vidc20_horz_reg[HDER]-m_vidc20_horz_reg[HDSR]),(m_vidc20_vert_reg[VDER]-m_vidc20_vert_reg[VDSR]),
(m_vidc20_horz_reg[HBER]-m_vidc20_horz_reg[HBSR]),(m_vidc20_vert_reg[VBER]-m_vidc20_vert_reg[VBSR]),
@@ -257,7 +257,7 @@ WRITE32_MEMBER( a7000_state::a7000_vidc20_w )
if(vert_reg == 4)
{
if(m_vidc20_vert_reg[VDER] != 0)
- m_flyback_timer->adjust(machine().primary_screen->time_until_pos(m_vidc20_vert_reg[VDER]));
+ m_flyback_timer->adjust(machine().first_screen()->time_until_pos(m_vidc20_vert_reg[VDER]));
else
m_flyback_timer->adjust(attotime::never);
}
@@ -608,7 +608,7 @@ TIMER_CALLBACK_MEMBER(a7000_state::flyback_timer_callback)
generic_pulse_irq_line(m_maincpu, ARM7_IRQ_LINE,1);
}
- m_flyback_timer->adjust(machine().primary_screen->time_until_pos(m_vidc20_vert_reg[VDER]));
+ m_flyback_timer->adjust(machine().first_screen()->time_until_pos(m_vidc20_vert_reg[VDER]));
}
void a7000_state::viddma_transfer_start()
@@ -643,7 +643,7 @@ READ32_MEMBER( a7000_state::a7000_iomd_r )
UINT8 flyback;
int vert_pos;
- vert_pos = machine().primary_screen->vpos();
+ vert_pos = machine().first_screen()->vpos();
flyback = (vert_pos <= m_vidc20_vert_reg[VDSR] || vert_pos >= m_vidc20_vert_reg[VDER]) ? 0x80 : 0x00;
return m_IOMD_IO_ctrl | 0x34 | flyback;
diff --git a/src/mess/drivers/apc.c b/src/mess/drivers/apc.c
index 4eca34216b8..3b712a7a36e 100644
--- a/src/mess/drivers/apc.c
+++ b/src/mess/drivers/apc.c
@@ -238,7 +238,7 @@ static UPD7220_DRAW_TEXT_LINE( hgdc_draw_text )
res_x = (x*8+xi);
res_y = y*lr+yi;
- if(!device->machine().primary_screen->visible_area().contains(res_x, res_y))
+ if(!device->machine().first_screen()->visible_area().contains(res_x, res_y))
continue;
/*
@@ -271,9 +271,9 @@ static UPD7220_DRAW_TEXT_LINE( hgdc_draw_text )
if(u_line && yi == lr-1) { tile_data = 0xff; }
if(o_line && yi == 0) { tile_data = 0xff; }
if(v_line) { tile_data|=1; }
- if(blink && device->machine().primary_screen->frame_number() & 0x20) { tile_data = 0; } // TODO: rate & correct behaviour
+ if(blink && device->machine().first_screen()->frame_number() & 0x20) { tile_data = 0; } // TODO: rate & correct behaviour
- if(cursor_on && cursor_addr == tile_addr && device->machine().primary_screen->frame_number() & 0x10)
+ if(cursor_on && cursor_addr == tile_addr && device->machine().first_screen()->frame_number() & 0x10)
tile_data^=0xff;
if(yi >= char_size)
diff --git a/src/mess/drivers/casloopy.c b/src/mess/drivers/casloopy.c
index d793da4712f..a43d432d6aa 100644
--- a/src/mess/drivers/casloopy.c
+++ b/src/mess/drivers/casloopy.c
@@ -296,11 +296,11 @@ READ16_MEMBER(casloopy_state::casloopy_vregs_r)
{
if(offset == 4/2)
{
- return (machine().primary_screen->vblank() << 8) | (machine().rand() & 0xff); // vblank + vpos?
+ return (machine().first_screen()->vblank() << 8) | (machine().rand() & 0xff); // vblank + vpos?
}
if(offset == 2/2)
- return machine().rand();/*(machine().primary_screen->hblank() << 8) | (machine().primary_screen->hpos() & 0xff);*/ // hblank + hpos?
+ return machine().rand();/*(machine().first_screen()->hblank() << 8) | (machine().first_screen()->hpos() & 0xff);*/ // hblank + hpos?
if(offset == 0/2)
return machine().rand(); // pccllect
diff --git a/src/mess/drivers/dmv.c b/src/mess/drivers/dmv.c
index 98ba00536d0..47d3a39c544 100644
--- a/src/mess/drivers/dmv.c
+++ b/src/mess/drivers/dmv.c
@@ -175,7 +175,7 @@ static UPD7220_DRAW_TEXT_LINE( hgdc_draw_text )
res_x = x * 8 + xi;
res_y = y * lr + yi;
- if(!device->machine().primary_screen->visible_area().contains(res_x, res_y))
+ if(!device->machine().first_screen()->visible_area().contains(res_x, res_y))
continue;
if(yi >= 16) { pen = 0; }
diff --git a/src/mess/drivers/fm7.c b/src/mess/drivers/fm7.c
index 4a6669db541..ef6b3333304 100644
--- a/src/mess/drivers/fm7.c
+++ b/src/mess/drivers/fm7.c
@@ -1896,7 +1896,7 @@ void fm7_state::machine_reset()
m_subtimer->adjust(attotime::from_msec(20),0,attotime::from_msec(20));
m_keyboard_timer->adjust(attotime::zero,0,attotime::from_msec(10));
if(m_type == SYS_FM77AV || m_type == SYS_FM77AV40EX || m_type == SYS_FM11)
- m_fm77av_vsync_timer->adjust(machine().primary_screen->time_until_vblank_end());
+ m_fm77av_vsync_timer->adjust(machine().first_screen()->time_until_vblank_end());
m_irq_mask = 0x00;
m_irq_flags = 0x00;
diff --git a/src/mess/drivers/gba.c b/src/mess/drivers/gba.c
index 7bf449a7f45..66ba795bd72 100644
--- a/src/mess/drivers/gba.c
+++ b/src/mess/drivers/gba.c
@@ -493,7 +493,7 @@ READ32_MEMBER(gba_state::gba_io_r)
}
break;
case 0x0004/4:
- retval = (m_DISPSTAT & 0xffff) | (machine().primary_screen->vpos()<<16);
+ retval = (m_DISPSTAT & 0xffff) | (machine().first_screen()->vpos()<<16);
break;
case 0x0008/4:
if( (mem_mask) & 0x0000ffff )
@@ -1767,7 +1767,7 @@ WRITE32_MEMBER(gba_state::gba_io_w)
case 0x0200/4:
if( (mem_mask) & 0x0000ffff )
{
-// printf("IE (%08x) = %04x raw %x (%08x) (scan %d PC %x)\n", 0x04000000 + ( offset << 2 ), data & mem_mask, data, ~mem_mask, machine.primary_screen->vpos(), space.device().safe_pc());
+// printf("IE (%08x) = %04x raw %x (%08x) (scan %d PC %x)\n", 0x04000000 + ( offset << 2 ), data & mem_mask, data, ~mem_mask, machine.first_screen()->vpos(), space.device().safe_pc());
m_IE = ( m_IE & ~mem_mask ) | ( data & mem_mask );
#if 0
if (m_IE & m_IF)
@@ -1943,7 +1943,7 @@ INPUT_PORTS_END
TIMER_CALLBACK_MEMBER(gba_state::perform_hbl)
{
int ch, ctrl;
- int scanline = machine().primary_screen->vpos();
+ int scanline = machine().first_screen()->vpos();
// draw only visible scanlines
if (scanline < 160)
@@ -1977,7 +1977,7 @@ TIMER_CALLBACK_MEMBER(gba_state::perform_scan)
// clear hblank and raster IRQ flags
m_DISPSTAT &= ~(DISPSTAT_HBL|DISPSTAT_VCNT);
- scanline = machine().primary_screen->vpos();
+ scanline = machine().first_screen()->vpos();
// VBL is set for scanlines 160 through 226 (but not 227, which is the last line)
if (scanline >= 160 && scanline < 227)
@@ -2043,8 +2043,8 @@ TIMER_CALLBACK_MEMBER(gba_state::perform_scan)
}
}
- m_hbl_timer->adjust(machine().primary_screen->time_until_pos(scanline, 240));
- m_scan_timer->adjust(machine().primary_screen->time_until_pos(( scanline + 1 ) % 228, 0));
+ m_hbl_timer->adjust(machine().first_screen()->time_until_pos(scanline, 240));
+ m_scan_timer->adjust(machine().first_screen()->time_until_pos(( scanline + 1 ) % 228, 0));
}
void gba_state::machine_reset()
@@ -2070,7 +2070,7 @@ void gba_state::machine_reset()
m_bios_protected = 0;
- m_scan_timer->adjust(machine().primary_screen->time_until_pos(0, 0));
+ m_scan_timer->adjust(machine().first_screen()->time_until_pos(0, 0));
m_hbl_timer->adjust(attotime::never);
m_dma_timer[0]->adjust(attotime::never);
m_dma_timer[1]->adjust(attotime::never, 1);
@@ -2092,7 +2092,7 @@ void gba_state::machine_start()
/* create a timer to fire scanline functions */
m_scan_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gba_state::perform_scan),this));
m_hbl_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gba_state::perform_hbl),this));
- m_scan_timer->adjust(machine().primary_screen->time_until_pos(0, 0));
+ m_scan_timer->adjust(machine().first_screen()->time_until_pos(0, 0));
/* and one for each DMA channel */
m_dma_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gba_state::dma_complete),this));
diff --git a/src/mess/drivers/gp32.c b/src/mess/drivers/gp32.c
index 9e6be05a5c3..635a8aa9f7f 100644
--- a/src/mess/drivers/gp32.c
+++ b/src/mess/drivers/gp32.c
@@ -241,7 +241,7 @@ void gp32_state::s3c240x_lcd_render_16( )
TIMER_CALLBACK_MEMBER(gp32_state::s3c240x_lcd_timer_exp)
{
- screen_device *screen = machine().primary_screen;
+ screen_device *screen = machine().first_screen();
verboselog( machine(), 2, "LCD timer callback\n");
m_s3c240x_lcd.vpos = screen->vpos();
m_s3c240x_lcd.hpos = screen->hpos();
@@ -269,7 +269,7 @@ TIMER_CALLBACK_MEMBER(gp32_state::s3c240x_lcd_timer_exp)
void gp32_state::video_start()
{
- machine().primary_screen->register_screen_bitmap(m_bitmap);
+ machine().first_screen()->register_screen_bitmap(m_bitmap);
}
UINT32 gp32_state::screen_update_gp32(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
@@ -289,7 +289,7 @@ READ32_MEMBER(gp32_state::s3c240x_lcd_r)
{
// make sure line counter is going
UINT32 lineval = BITS( m_s3c240x_lcd_regs[1], 23, 14);
- data = (data & ~0xFFFC0000) | ((lineval - machine().primary_screen->vpos()) << 18);
+ data = (data & ~0xFFFC0000) | ((lineval - machine().first_screen()->vpos()) << 18);
}
break;
}
@@ -299,7 +299,7 @@ READ32_MEMBER(gp32_state::s3c240x_lcd_r)
void gp32_state::s3c240x_lcd_configure()
{
- screen_device *screen = machine().primary_screen;
+ screen_device *screen = machine().first_screen();
UINT32 vspw, vbpd, lineval, vfpd, hspw, hbpd, hfpd, hozval, clkval, hclk;
double framerate, vclk;
rectangle visarea;
@@ -325,7 +325,7 @@ void gp32_state::s3c240x_lcd_configure()
void gp32_state::s3c240x_lcd_start()
{
- screen_device *screen = machine().primary_screen;
+ screen_device *screen = machine().first_screen();
verboselog( machine(), 1, "LCD start\n");
s3c240x_lcd_configure();
s3c240x_lcd_dma_init();
diff --git a/src/mess/drivers/ie15.c b/src/mess/drivers/ie15.c
index 2f7711e4ab7..960f62e7a48 100644
--- a/src/mess/drivers/ie15.c
+++ b/src/mess/drivers/ie15.c
@@ -382,13 +382,13 @@ READ8_MEMBER( ie15_state::flag_r ) {
switch (offset)
{
case 0: // hsync pulse (not hblank)
- ret = machine().primary_screen->hpos() < IE15_HORZ_START;
+ ret = machine().first_screen()->hpos() < IE15_HORZ_START;
break;
case 1: // marker scanline
- ret = (machine().primary_screen->vpos() % 11) > 7;
+ ret = (machine().first_screen()->vpos() % 11) > 7;
break;
case 2: // vblank
- ret = !machine().primary_screen->vblank();
+ ret = !machine().first_screen()->vblank();
break;
case 4:
ret = m_ruslat;
@@ -519,7 +519,7 @@ UINT32 ie15_state::draw_scanline(UINT16 *p, UINT16 offset, UINT8 scanline, UINT8
UINT16 x,chr;
bg = 0; fg = 1; ra = scanline % 8;
- blink = (machine().primary_screen->frame_number() % 10) >= 5;
+ blink = (machine().first_screen()->frame_number() % 10) >= 5;
red = m_io_keyboard->read() & 0x01;
DBG_LOG(2,"draw_scanline",
@@ -577,9 +577,9 @@ UINT32 ie15_state::draw_scanline(UINT16 *p, UINT16 offset, UINT8 scanline, UINT8
TIMER_DEVICE_CALLBACK_MEMBER(ie15_state::scanline_callback)
{
- UINT16 y = machine().primary_screen->vpos();
+ UINT16 y = machine().first_screen()->vpos();
// DBG_LOG(2,"scanline",
-// ("addr %03x frame %lld x %04d y %03d\n", m_videoptr_2, machine().primary_screen->frame_number(), machine().primary_screen->hpos(), y));
+// ("addr %03x frame %lld x %04d y %03d\n", m_videoptr_2, machine().first_screen()->frame_number(), machine().first_screen()->hpos(), y));
if (y>=IE15_VERT_START) {
y -= IE15_VERT_START;
if (y < IE15_DISP_VERT) {
diff --git a/src/mess/drivers/itt3030.c b/src/mess/drivers/itt3030.c
index 09c2798bc5b..d5c4b2f06cc 100644
--- a/src/mess/drivers/itt3030.c
+++ b/src/mess/drivers/itt3030.c
@@ -293,12 +293,12 @@ READ8_MEMBER(itt3030_state::vsync_r)
{
UINT8 ret = 0;
- if (machine().primary_screen->vblank())
+ if (machine().first_screen()->vblank())
{
ret |= 0xc0; // set both bits 6 and 7 if vblank
}
- if (machine().primary_screen->hblank())
+ if (machine().first_screen()->hblank())
{
ret |= 0x80; // set only bit 7 if hblank
}
diff --git a/src/mess/drivers/lynx.c b/src/mess/drivers/lynx.c
index 060bbbefba3..a6bc642af40 100644
--- a/src/mess/drivers/lynx.c
+++ b/src/mess/drivers/lynx.c
@@ -55,7 +55,7 @@ PALETTE_INIT_MEMBER(lynx_state, lynx)
void lynx_state::video_start()
{
- machine().primary_screen->register_screen_bitmap(m_bitmap);
+ machine().first_screen()->register_screen_bitmap(m_bitmap);
}
UINT32 lynx_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
diff --git a/src/mess/drivers/multi8.c b/src/mess/drivers/multi8.c
index 4637df96728..1fa9c0373fe 100644
--- a/src/mess/drivers/multi8.c
+++ b/src/mess/drivers/multi8.c
@@ -106,7 +106,7 @@ void multi8_state::video_start()
void multi8_state::multi8_draw_pixel(bitmap_ind16 &bitmap,int y,int x,UINT8 pen,UINT8 width)
{
- if(!machine().primary_screen->visible_area().contains(x, y))
+ if(!machine().first_screen()->visible_area().contains(x, y))
return;
if(width)
@@ -195,8 +195,8 @@ UINT32 multi8_state::screen_update_multi8(screen_device &screen, bitmap_ind16 &b
{
case 0x00: cursor_on = 1; break; //always on
case 0x20: cursor_on = 0; break; //always off
- case 0x40: if(machine().primary_screen->frame_number() & 0x10) { cursor_on = 1; } break; //fast blink
- case 0x60: if(machine().primary_screen->frame_number() & 0x20) { cursor_on = 1; } break; //slow blink
+ case 0x40: if(machine().first_screen()->frame_number() & 0x10) { cursor_on = 1; } break; //fast blink
+ case 0x60: if(machine().first_screen()->frame_number() & 0x20) { cursor_on = 1; } break; //slow blink
}
if(cursor_on)
diff --git a/src/mess/drivers/mz2000.c b/src/mess/drivers/mz2000.c
index b37468cb328..9bcc5bc9b8d 100644
--- a/src/mess/drivers/mz2000.c
+++ b/src/mess/drivers/mz2000.c
@@ -635,7 +635,7 @@ READ8_MEMBER(mz2000_state::mz2000_portb_r)
else
res |= 0x20;
- res |= (machine().primary_screen->vblank()) ? 0x00 : 0x01;
+ res |= (machine().first_screen()->vblank()) ? 0x00 : 0x01;
return res;
}
diff --git a/src/mess/drivers/mz2500.c b/src/mess/drivers/mz2500.c
index 7ce05520423..bfbd7fb8ef6 100644
--- a/src/mess/drivers/mz2500.c
+++ b/src/mess/drivers/mz2500.c
@@ -712,7 +712,7 @@ void mz2500_state::mz2500_reconfigure_screen()
//popmessage("%d %d %d %d %02x",vs,ve,hs,he,m_cg_reg[0x0e]);
- machine().primary_screen->configure(720, 480, visarea, machine().primary_screen->frame_period().attoseconds);
+ machine().first_screen()->configure(720, 480, visarea, machine().first_screen()->frame_period().attoseconds);
/* calculate CG window parameters here */
m_cg_vs = (m_cg_reg[0x08]) | ((m_cg_reg[0x09]<<8) & 1);
@@ -1032,8 +1032,8 @@ READ8_MEMBER(mz2500_state::mz2500_crtc_hvblank_r)
{
UINT8 vblank_bit, hblank_bit;
- vblank_bit = machine().primary_screen->vblank() ? 0 : 1;
- hblank_bit = machine().primary_screen->hblank() ? 0 : 2;
+ vblank_bit = machine().first_screen()->vblank() ? 0 : 1;
+ hblank_bit = machine().first_screen()->hblank() ? 0 : 2;
return vblank_bit | hblank_bit;
}
@@ -1307,7 +1307,7 @@ READ8_MEMBER(mz2500_state::mz2500_rplane_latch_r)
{
UINT8 vblank_bit;
- vblank_bit = machine().primary_screen->vblank() ? 0 : 0x80 | m_cg_clear_flag;
+ vblank_bit = machine().first_screen()->vblank() ? 0 : 0x80 | m_cg_clear_flag;
return vblank_bit;
}
@@ -1884,7 +1884,7 @@ READ8_MEMBER(mz2500_state::mz2500_portb_r)
{
UINT8 vblank_bit;
- vblank_bit = machine().primary_screen->vblank() ? 0 : 1; //Guess: NOBO wants this bit to be high/low
+ vblank_bit = machine().first_screen()->vblank() ? 0 : 1; //Guess: NOBO wants this bit to be high/low
return 0xfe | vblank_bit;
}
diff --git a/src/mess/drivers/osbexec.c b/src/mess/drivers/osbexec.c
index 32c782ef0c1..20f3c8e9e39 100644
--- a/src/mess/drivers/osbexec.c
+++ b/src/mess/drivers/osbexec.c
@@ -316,7 +316,7 @@ PALETTE_INIT_MEMBER(osbexec_state, osbexec)
void osbexec_state::video_start()
{
- machine().primary_screen->register_screen_bitmap(m_bitmap);
+ machine().first_screen()->register_screen_bitmap(m_bitmap);
}
UINT32 osbexec_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
@@ -515,7 +515,7 @@ static const floppy_interface osbexec_floppy_interface =
TIMER_CALLBACK_MEMBER(osbexec_state::osbexec_video_callback)
{
- int y = machine().primary_screen->vpos();
+ int y = machine().first_screen()->vpos();
/* Start of frame */
if ( y == 0 )
@@ -562,7 +562,7 @@ TIMER_CALLBACK_MEMBER(osbexec_state::osbexec_video_callback)
}
}
- m_video_timer->adjust( machine().primary_screen->time_until_pos( y + 1, 0 ) );
+ m_video_timer->adjust( machine().first_screen()->time_until_pos( y + 1, 0 ) );
}
@@ -587,7 +587,7 @@ void osbexec_state::machine_reset()
set_banks( machine() );
- m_video_timer->adjust( machine().primary_screen->time_until_pos( 0, 0 ) );
+ m_video_timer->adjust( machine().first_screen()->time_until_pos( 0, 0 ) );
m_rtc = 0;
}
diff --git a/src/mess/drivers/pasogo.c b/src/mess/drivers/pasogo.c
index e2b84858cd2..f7bce7bbcc0 100644
--- a/src/mess/drivers/pasogo.c
+++ b/src/mess/drivers/pasogo.c
@@ -660,7 +660,7 @@ UINT32 pasogo_state::screen_update_pasogo(screen_device &screen, bitmap_ind16 &b
if (w!=width || h!=height)
{
width = w; height = h;
-// machine().primary_screen->set_visible_area(0, width - 1, 0, height - 1);
+// machine().first_screen()->set_visible_area(0, width - 1, 0, height - 1);
screen.set_visible_area(0, width - 1, 0, height - 1);
}
#endif
diff --git a/src/mess/drivers/pasopia7.c b/src/mess/drivers/pasopia7.c
index aef1df0f162..6112e454d6d 100644
--- a/src/mess/drivers/pasopia7.c
+++ b/src/mess/drivers/pasopia7.c
@@ -209,8 +209,8 @@ void pasopia7_state::draw_tv_screen(bitmap_ind16 &bitmap,const rectangle &clipre
{
case 0x00: cursor_on = 1; break; //always on
case 0x20: cursor_on = 0; break; //always off
- case 0x40: if(machine().primary_screen->frame_number() & 0x10) { cursor_on = 1; } break; //fast blink
- case 0x60: if(machine().primary_screen->frame_number() & 0x20) { cursor_on = 1; } break; //slow blink
+ case 0x40: if(machine().first_screen()->frame_number() & 0x10) { cursor_on = 1; } break; //fast blink
+ case 0x60: if(machine().first_screen()->frame_number() & 0x20) { cursor_on = 1; } break; //slow blink
}
if(cursor_on)
@@ -287,8 +287,8 @@ void pasopia7_state::draw_mixed_screen(bitmap_ind16 &bitmap,const rectangle &cli
{
case 0x00: cursor_on = 1; break; //always on
case 0x20: cursor_on = 0; break; //always off
- case 0x40: if(machine().primary_screen->frame_number() & 0x10) { cursor_on = 1; } break; //fast blink
- case 0x60: if(machine().primary_screen->frame_number() & 0x20) { cursor_on = 1; } break; //slow blink
+ case 0x40: if(machine().first_screen()->frame_number() & 0x10) { cursor_on = 1; } break; //fast blink
+ case 0x60: if(machine().first_screen()->frame_number() & 0x20) { cursor_on = 1; } break; //slow blink
}
if(cursor_on)
@@ -811,7 +811,7 @@ READ8_MEMBER( pasopia7_state::crtc_portb_r )
// --x- ---- vsync bit
// ---x ---- hardcoded bit, defines if the system screen is raster (1) or LCD (0)
// ---- x--- disp bit
- UINT8 vdisp = (machine().primary_screen->vpos() < (m_screen_type ? 200 : 28)) ? 0x08 : 0x00; //TODO: check LCD vpos trigger
+ UINT8 vdisp = (machine().first_screen()->vpos() < (m_screen_type ? 200 : 28)) ? 0x08 : 0x00; //TODO: check LCD vpos trigger
UINT8 vsync = vdisp ? 0x00 : 0x20;
return 0x40 | (m_attr_latch & 0x87) | vsync | vdisp | (m_screen_type << 4);
diff --git a/src/mess/drivers/pc6001.c b/src/mess/drivers/pc6001.c
index 882c8157055..a34cde3a8ba 100644
--- a/src/mess/drivers/pc6001.c
+++ b/src/mess/drivers/pc6001.c
@@ -1337,14 +1337,14 @@ WRITE8_MEMBER(pc6001_state::pc6001m2_vram_bank_w)
{
/* Apparently bitmap modes changes the screen res to 320 x 200 */
{
- rectangle visarea = machine().primary_screen->visible_area();
+ rectangle visarea = machine().first_screen()->visible_area();
int y_height;
y_height = (m_exgfx_bitmap_mode || m_exgfx_2bpp_mode) ? 200 : 240;
visarea.set(0, (320) - 1, 0, (y_height) - 1);
- machine().primary_screen->configure(320, 240, visarea, machine().primary_screen->frame_period().attoseconds);
+ machine().first_screen()->configure(320, 240, visarea, machine().first_screen()->frame_period().attoseconds);
}
}
diff --git a/src/mess/drivers/pc8801.c b/src/mess/drivers/pc8801.c
index cf440fafe4a..a054daf496e 100644
--- a/src/mess/drivers/pc8801.c
+++ b/src/mess/drivers/pc8801.c
@@ -675,7 +675,7 @@ UINT8 pc8801_state::calc_cursor_pos(int x,int y,int yi)
if(!(m_crtc.param[0][2] & 0x20))
return 1;
- if(((machine().primary_screen->frame_number() / blink_speed) & 1) == 0)
+ if(((machine().first_screen()->frame_number() / blink_speed) & 1) == 0)
return 1;
return 0;
@@ -754,7 +754,7 @@ void pc8801_state::pc8801_draw_char(bitmap_ind16 &bitmap,int x,int y,int pal,UIN
res_x = x*8+xi*(width+1);
res_y = y*y_height+yi;
- if(!machine().primary_screen->visible_area().contains(res_x, res_y))
+ if(!machine().first_screen()->visible_area().contains(res_x, res_y))
continue;
if(gfx_mode)
@@ -771,7 +771,7 @@ void pc8801_state::pc8801_draw_char(bitmap_ind16 &bitmap,int x,int y,int pal,UIN
UINT8 blink_mask;
blink_mask = 0;
- if(blink && ((machine().primary_screen->frame_number() / blink_speed) & 3) == 1)
+ if(blink && ((machine().first_screen()->frame_number() / blink_speed) & 3) == 1)
blink_mask = 1;
if(yi >= (1 << (y_double+3)) || secret || blink_mask)
@@ -799,7 +799,7 @@ void pc8801_state::pc8801_draw_char(bitmap_ind16 &bitmap,int x,int y,int pal,UIN
bitmap.pix16(res_y, res_x) = m_palette->pen(color);
if(width)
{
- if(!machine().primary_screen->visible_area().contains(res_x+1, res_y))
+ if(!machine().first_screen()->visible_area().contains(res_x+1, res_y))
continue;
bitmap.pix16(res_y, res_x+1) = m_palette->pen(color);
@@ -1241,7 +1241,7 @@ WRITE8_MEMBER(pc8801_state::pc8801_ext_rom_bank_w)
UINT8 pc8801_state::pc8801_pixel_clock(void)
{
- int ysize = machine().primary_screen->height(); /* TODO: correct condition*/
+ int ysize = machine().first_screen()->height(); /* TODO: correct condition*/
return (ysize >= 400);
}
@@ -1269,7 +1269,7 @@ void pc8801_state::pc8801_dynamic_res_change(void)
else
refresh = HZ_TO_ATTOSECONDS(PIXEL_CLOCK_15KHz) * (xsize) * ysize;
- machine().primary_screen->configure(xsize, ysize, visarea, refresh);
+ machine().first_screen()->configure(xsize, ysize, visarea, refresh);
}
WRITE8_MEMBER(pc8801_state::pc8801_gfx_ctrl_w)
diff --git a/src/mess/drivers/pc88va.c b/src/mess/drivers/pc88va.c
index 924142f1ff3..1f7dd6ead9c 100644
--- a/src/mess/drivers/pc88va.c
+++ b/src/mess/drivers/pc88va.c
@@ -804,7 +804,7 @@ void pc88va_state::execute_sync_cmd()
refresh = HZ_TO_ATTOSECONDS(60);
- machine().primary_screen->configure(640, 480, visarea, refresh);
+ machine().first_screen()->configure(640, 480, visarea, refresh);
}
void pc88va_state::execute_dspon_cmd()
@@ -957,7 +957,7 @@ WRITE16_MEMBER(pc88va_state::palette_ram_w)
READ16_MEMBER(pc88va_state::sys_port4_r)
{
UINT8 vrtc,sw1;
- vrtc = (machine().primary_screen->vpos() < 200) ? 0x20 : 0x00; // vblank
+ vrtc = (machine().first_screen()->vpos() < 200) ? 0x20 : 0x00; // vblank
sw1 = (ioport("DSW")->read() & 1) ? 2 : 0;
diff --git a/src/mess/drivers/pc9801.c b/src/mess/drivers/pc9801.c
index 78dc4a47977..b4b9ad7ac6a 100644
--- a/src/mess/drivers/pc9801.c
+++ b/src/mess/drivers/pc9801.c
@@ -804,8 +804,8 @@ static UPD7220_DISPLAY_PIXELS( hgdc_display_pixels )
if(state->m_video_ff[DISPLAY_REG] == 0) //screen is off
return;
-// popmessage("%02x %d",state->m_video_ff[INTERLACE_REG],device->machine().primary_screen->visible_area().max_y + 1);
-// interlace_on = ((device->machine().primary_screen->visible_area().max_y + 1) >= 400) ? 1 : 0;
+// popmessage("%02x %d",state->m_video_ff[INTERLACE_REG],device->machine().first_screen()->visible_area().max_y + 1);
+// interlace_on = ((device->machine().first_screen()->visible_area().max_y + 1) >= 400) ? 1 : 0;
interlace_on = state->m_video_ff[INTERLACE_REG];
colors16_mode = (state->m_ex_video_ff[ANALOG_16_MODE]) ? 16 : 8;
@@ -816,13 +816,13 @@ static UPD7220_DISPLAY_PIXELS( hgdc_display_pixels )
res_x = x + xi;
res_y = y;
- if(!device->machine().primary_screen->visible_area().contains(res_x, res_y*2+0))
+ if(!device->machine().first_screen()->visible_area().contains(res_x, res_y*2+0))
return;
pen = state->m_ext_gvram[(address*8+xi)+(state->m_vram_disp*0x40000)];
bitmap.pix32(res_y*2+0, res_x) = palette[pen + 0x20];
- if(device->machine().primary_screen->visible_area().contains(res_x, res_y*2+1))
+ if(device->machine().first_screen()->visible_area().contains(res_x, res_y*2+1))
bitmap.pix32(res_y*2+1, res_x) = palette[pen + 0x20];
}
}
@@ -841,10 +841,10 @@ static UPD7220_DISPLAY_PIXELS( hgdc_display_pixels )
if(interlace_on)
{
- if(device->machine().primary_screen->visible_area().contains(res_x, res_y*2+0))
+ if(device->machine().first_screen()->visible_area().contains(res_x, res_y*2+0))
bitmap.pix32(res_y*2+0, res_x) = palette[pen + colors16_mode];
/* TODO: it looks like that PC-98xx can only display even lines ... */
- if(device->machine().primary_screen->visible_area().contains(res_x, res_y*2+1))
+ if(device->machine().first_screen()->visible_area().contains(res_x, res_y*2+1))
bitmap.pix32(res_y*2+1, res_x) = palette[pen + colors16_mode];
}
else
@@ -931,7 +931,7 @@ static UPD7220_DRAW_TEXT_LINE( hgdc_draw_text )
res_x = ((x+kanji_lr)*8+xi) * (state->m_video_ff[WIDTH40_REG]+1);
res_y = y*lr+yi - (state->m_txt_scroll_reg[3] & 0xf);
- if(!device->machine().primary_screen->visible_area().contains(res_x, res_y))
+ if(!device->machine().first_screen()->visible_area().contains(res_x, res_y))
continue;
tile_data = 0;
@@ -972,10 +972,10 @@ static UPD7220_DRAW_TEXT_LINE( hgdc_draw_text )
if(v_line) { tile_data|=8; }
/* TODO: proper blink rate for these two */
- if(cursor_on && cursor_addr == tile_addr && device->machine().primary_screen->frame_number() & 0x10)
+ if(cursor_on && cursor_addr == tile_addr && device->machine().first_screen()->frame_number() & 0x10)
tile_data^=0xff;
- if(blink && device->machine().primary_screen->frame_number() & 0x10)
+ if(blink && device->machine().first_screen()->frame_number() & 0x10)
tile_data^=0xff;
if(yi >= char_size)
@@ -988,7 +988,7 @@ static UPD7220_DRAW_TEXT_LINE( hgdc_draw_text )
if(state->m_video_ff[WIDTH40_REG])
{
- if(!device->machine().primary_screen->visible_area().contains(res_x+1, res_y))
+ if(!device->machine().first_screen()->visible_area().contains(res_x+1, res_y))
continue;
if(pen != -1)
diff --git a/src/mess/drivers/pokemini.c b/src/mess/drivers/pokemini.c
index 37b8ccbe2fa..75d91814c68 100644
--- a/src/mess/drivers/pokemini.c
+++ b/src/mess/drivers/pokemini.c
@@ -1760,7 +1760,7 @@ static const speaker_interface pokemini_speaker_interface =
void pokemini_state::video_start()
{
- machine().primary_screen->register_screen_bitmap(m_bitmap);
+ machine().first_screen()->register_screen_bitmap(m_bitmap);
}
diff --git a/src/mess/drivers/qx10.c b/src/mess/drivers/qx10.c
index 338ff2f4543..23b81de6250 100644
--- a/src/mess/drivers/qx10.c
+++ b/src/mess/drivers/qx10.c
@@ -210,7 +210,7 @@ static UPD7220_DRAW_TEXT_LINE( hgdc_draw_text )
if(cursor_on && cursor_addr == addr+x) //TODO
tile_data^=0xff;
- if(attr & 0x80 && device->machine().primary_screen->frame_number() & 0x10) //TODO: check for blinking interval
+ if(attr & 0x80 && device->machine().first_screen()->frame_number() & 0x10) //TODO: check for blinking interval
tile_data=0;
for( xi = 0; xi < 8; xi++)
@@ -220,7 +220,7 @@ static UPD7220_DRAW_TEXT_LINE( hgdc_draw_text )
res_x = x * 8 + xi;
res_y = y * lr + yi;
- if(!device->machine().primary_screen->visible_area().contains(res_x, res_y))
+ if(!device->machine().first_screen()->visible_area().contains(res_x, res_y))
continue;
if(yi >= 16)
diff --git a/src/mess/drivers/samcoupe.c b/src/mess/drivers/samcoupe.c
index d60ffa23fc1..5b2bf820979 100644
--- a/src/mess/drivers/samcoupe.c
+++ b/src/mess/drivers/samcoupe.c
@@ -125,7 +125,7 @@ WRITE8_MEMBER(samcoupe_state::samcoupe_disk_w)
READ8_MEMBER(samcoupe_state::samcoupe_pen_r)
{
- screen_device *scr = machine().primary_screen;
+ screen_device *scr = machine().first_screen();
UINT8 data;
if (offset & 0x100)
diff --git a/src/mess/drivers/scv.c b/src/mess/drivers/scv.c
index 31dc83d92c5..fe642456746 100644
--- a/src/mess/drivers/scv.c
+++ b/src/mess/drivers/scv.c
@@ -420,7 +420,7 @@ void scv_state::device_timer(emu_timer &timer, device_timer_id id, int param, vo
{
case TIMER_VB:
{
- int vpos = machine().primary_screen->vpos();
+ int vpos = machine().first_screen()->vpos();
switch( vpos )
{
@@ -432,7 +432,7 @@ void scv_state::device_timer(emu_timer &timer, device_timer_id id, int param, vo
break;
}
- m_vb_timer->adjust(machine().primary_screen->time_until_pos((vpos + 1) % 262, 0));
+ m_vb_timer->adjust(machine().first_screen()->time_until_pos((vpos + 1) % 262, 0));
}
break;
@@ -791,7 +791,7 @@ void scv_state::machine_start()
void scv_state::machine_reset()
{
- m_vb_timer->adjust(machine().primary_screen->time_until_pos(0, 0));
+ m_vb_timer->adjust(machine().first_screen()->time_until_pos(0, 0));
scv_set_banks();
}
diff --git a/src/mess/drivers/smc777.c b/src/mess/drivers/smc777.c
index 1d561853a7e..84d636b6573 100644
--- a/src/mess/drivers/smc777.c
+++ b/src/mess/drivers/smc777.c
@@ -220,7 +220,7 @@ UINT32 smc777_state::screen_update_smc777(screen_device &screen, bitmap_ind16 &b
case 3: bk_pen = (color ^ 0xf); break; //complementary
}
- if(blink && machine().primary_screen->frame_number() & 0x10) //blinking, used by Dragon's Alphabet
+ if(blink && machine().first_screen()->frame_number() & 0x10) //blinking, used by Dragon's Alphabet
color = bk_pen;
for(yi=0;yi<8;yi++)
@@ -254,8 +254,8 @@ UINT32 smc777_state::screen_update_smc777(screen_device &screen, bitmap_ind16 &b
{
case 0x00: cursor_on = 1; break; //always on
case 0x20: cursor_on = 0; break; //always off
- case 0x40: if(machine().primary_screen->frame_number() & 0x10) { cursor_on = 1; } break; //fast blink
- case 0x60: if(machine().primary_screen->frame_number() & 0x20) { cursor_on = 1; } break; //slow blink
+ case 0x40: if(machine().first_screen()->frame_number() & 0x10) { cursor_on = 1; } break; //fast blink
+ case 0x60: if(machine().first_screen()->frame_number() & 0x20) { cursor_on = 1; } break; //slow blink
}
if(cursor_on)
diff --git a/src/mess/drivers/spec128.c b/src/mess/drivers/spec128.c
index 4b25c7894d4..5cdc252c4a3 100644
--- a/src/mess/drivers/spec128.c
+++ b/src/mess/drivers/spec128.c
@@ -225,7 +225,7 @@ void spectrum_state::spectrum_128_update_memory()
READ8_MEMBER( spectrum_state::spectrum_128_ula_r )
{
- int vpos = machine().primary_screen->vpos();
+ int vpos = machine().first_screen()->vpos();
return vpos<193 ? m_screen_location[0x1800|(vpos&0xf8)<<2]:0xff;
}
diff --git a/src/mess/drivers/spectrum.c b/src/mess/drivers/spectrum.c
index af21551e5ed..e7e0510fb63 100644
--- a/src/mess/drivers/spectrum.c
+++ b/src/mess/drivers/spectrum.c
@@ -411,7 +411,7 @@ READ8_MEMBER(spectrum_state::spectrum_port_df_r)
READ8_MEMBER(spectrum_state::spectrum_port_ula_r)
{
- int vpos = machine().primary_screen->vpos();
+ int vpos = machine().first_screen()->vpos();
return vpos<193 ? m_video_ram[(vpos&0xf8)<<2]:0xff;
}
diff --git a/src/mess/drivers/supracan.c b/src/mess/drivers/supracan.c
index 406f87a5865..d67dc4bc91d 100644
--- a/src/mess/drivers/supracan.c
+++ b/src/mess/drivers/supracan.c
@@ -1525,7 +1525,7 @@ TIMER_CALLBACK_MEMBER(supracan_state::supracan_line_off_callback)
TIMER_CALLBACK_MEMBER(supracan_state::supracan_video_callback)
{
- int vpos = machine().primary_screen->vpos();
+ int vpos = machine().first_screen()->vpos();
m_video_regs[0] &= ~0x0002;
@@ -1556,10 +1556,10 @@ TIMER_CALLBACK_MEMBER(supracan_state::supracan_video_callback)
break;
}
- m_video_regs[1] = machine().primary_screen->vpos()-16; // for son of evil, wants vblank active around 224 instead...
+ m_video_regs[1] = machine().first_screen()->vpos()-16; // for son of evil, wants vblank active around 224 instead...
- m_hbl_timer->adjust( machine().primary_screen->time_until_pos( vpos, 320 ) );
- m_video_timer->adjust( machine().primary_screen->time_until_pos( ( vpos + 1 ) % 256, 0 ) );
+ m_hbl_timer->adjust( machine().first_screen()->time_until_pos( vpos, 320 ) );
+ m_video_timer->adjust( machine().first_screen()->time_until_pos( ( vpos + 1 ) % 256, 0 ) );
}
WRITE16_MEMBER( supracan_state::supracan_video_w )
@@ -1569,7 +1569,7 @@ WRITE16_MEMBER( supracan_state::supracan_video_w )
int i;
// if any of this changes we need a partial update (see sango fighters intro)
- machine().primary_screen->update_partial(machine().primary_screen->vpos());
+ machine().first_screen()->update_partial(machine().first_screen()->vpos());
COMBINE_DATA(&m_video_regs[offset]);
data = m_video_regs[offset];
@@ -1650,10 +1650,10 @@ WRITE16_MEMBER( supracan_state::supracan_video_w )
verboselog("maincpu", 3, "video_flags = %04x\n", data);
m_video_flags = data;
- rectangle visarea = machine().primary_screen->visible_area();
+ rectangle visarea = machine().first_screen()->visible_area();
visarea.set(0, ((m_video_flags & 0x100) ? 320 : 256) - 1, 8, 232 - 1);
- machine().primary_screen->configure(348, 256, visarea, machine().primary_screen->frame_period().attoseconds);
+ machine().first_screen()->configure(348, 256, visarea, machine().first_screen()->frame_period().attoseconds);
}
break;
case 0x0a/2:
@@ -1662,7 +1662,7 @@ WRITE16_MEMBER( supracan_state::supracan_video_w )
verboselog("maincpu", 0, "IRQ Trigger? = %04x\n", data);
if(data & 0x8000)
{
- m_line_on_timer->adjust(machine().primary_screen->time_until_pos((data & 0x00ff), 0));
+ m_line_on_timer->adjust(machine().first_screen()->time_until_pos((data & 0x00ff), 0));
}
else
{
@@ -1676,7 +1676,7 @@ WRITE16_MEMBER( supracan_state::supracan_video_w )
verboselog("maincpu", 0, "IRQ De-Trigger? = %04x\n", data);
if(data & 0x8000)
{
- m_line_off_timer->adjust(machine().primary_screen->time_until_pos(data & 0x00ff, 0));
+ m_line_off_timer->adjust(machine().first_screen()->time_until_pos(data & 0x00ff, 0));
}
else
{
@@ -1794,7 +1794,7 @@ void supracan_state::machine_reset()
{
m_soundcpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
- m_video_timer->adjust( machine().primary_screen->time_until_pos( 0, 0 ) );
+ m_video_timer->adjust( machine().first_screen()->time_until_pos( 0, 0 ) );
m_irq_mask = 0;
}
diff --git a/src/mess/drivers/uzebox.c b/src/mess/drivers/uzebox.c
index 697fc00127c..ca2952c4775 100644
--- a/src/mess/drivers/uzebox.c
+++ b/src/mess/drivers/uzebox.c
@@ -63,7 +63,7 @@ private:
void uzebox_state::machine_start()
{
- machine().primary_screen->register_screen_bitmap(m_bitmap);
+ machine().first_screen()->register_screen_bitmap(m_bitmap);
}
void uzebox_state::machine_reset()
diff --git a/src/mess/drivers/vboy.c b/src/mess/drivers/vboy.c
index d7628618a57..e1c1124b0ea 100644
--- a/src/mess/drivers/vboy.c
+++ b/src/mess/drivers/vboy.c
@@ -1273,7 +1273,7 @@ void vboy_state::m_set_irq(UINT16 irq_vector)
/* TODO: obviously all of this needs clean-ups and better implementation ... */
void vboy_state::m_scanline_tick(int scanline, UINT8 screen_type)
{
- //int frame_num = machine().primary_screen->frame_number();
+ //int frame_num = machine().first_screen()->frame_number();
if(screen_type == 0)
m_row_num = (scanline / 8) & 0x1f;
diff --git a/src/mess/drivers/x1.c b/src/mess/drivers/x1.c
index 304b9cf6cf7..80258624bf9 100644
--- a/src/mess/drivers/x1.c
+++ b/src/mess/drivers/x1.c
@@ -231,7 +231,7 @@ VIDEO_START_MEMBER(x1_state,x1)
void x1_state::x1_draw_pixel(running_machine &machine, bitmap_rgb32 &bitmap,int y,int x,UINT16 pen,UINT8 width,UINT8 height)
{
- if(!machine.primary_screen->visible_area().contains(x, y))
+ if(!machine.first_screen()->visible_area().contains(x, y))
return;
if(width && height)
@@ -429,7 +429,7 @@ void x1_state::draw_fgtilemap(running_machine &machine, bitmap_rgb32 &bitmap,con
pcg_pen = pen[2]<<2|pen[1]<<1|pen[0]<<0;
- if(color & 0x10 && machine.primary_screen->frame_number() & 0x10) //reverse flickering
+ if(color & 0x10 && machine.first_screen()->frame_number() & 0x10) //reverse flickering
pcg_pen^=7;
if(pcg_pen == 0 && (!(color & 8)))
@@ -1098,11 +1098,11 @@ UINT16 x1_state::check_chr_addr()
UINT16 x1_state::get_pcg_addr( UINT16 width, UINT8 y_char_size )
{
- int hbeam = machine().primary_screen->hpos() >> 3;
- int vbeam = machine().primary_screen->vpos() / y_char_size;
+ int hbeam = machine().first_screen()->hpos() >> 3;
+ int vbeam = machine().first_screen()->vpos() / y_char_size;
UINT16 pcg_offset = ((hbeam + vbeam*width) + (((m_crtc_vreg[0x0c]<<8) & 0x3f00) | (m_crtc_vreg[0x0d] & 0xff))) & 0x7ff;
- //printf("%08x %d %d %d %d\n",(hbeam+vbeam*width),hbeam,vbeam,machine.primary_screen->vpos() & 7,width);
+ //printf("%08x %d %d %d %d\n",(hbeam+vbeam*width),hbeam,vbeam,machine.first_screen()->vpos() & 7,width);
return pcg_offset;
}
@@ -1135,7 +1135,7 @@ READ8_MEMBER( x1_state::x1_pcg_r )
y_char_size = ((m_crtc_vreg[9]+1) > 8) ? 8 : m_crtc_vreg[9]+1;
if(y_char_size == 0) { y_char_size = 1; }
pcg_offset = m_tvram[get_pcg_addr(m_crtc_vreg[1], y_char_size)]*8;
- pcg_offset+= machine().primary_screen->vpos() & (y_char_size-1);
+ pcg_offset+= machine().first_screen()->vpos() & (y_char_size-1);
if(addr) { pcg_offset+= ((addr-1)*0x800); }
res = gfx_data[pcg_offset];
}
@@ -1175,7 +1175,7 @@ WRITE8_MEMBER( x1_state::x1_pcg_w )
y_char_size = (m_crtc_vreg[9]+1) > 8 ? (m_crtc_vreg[9]+1)-8 : m_crtc_vreg[9]+1;
if(y_char_size == 0) { y_char_size = 1; }
pcg_offset = m_tvram[get_pcg_addr(m_crtc_vreg[1], y_char_size)]*8;
- pcg_offset+= machine().primary_screen->vpos() & (y_char_size-1);
+ pcg_offset+= machine().first_screen()->vpos() & (y_char_size-1);
pcg_offset+= ((addr-1)*0x800);
m_pcg_ram[pcg_offset] = data;
@@ -1237,10 +1237,10 @@ WRITE8_MEMBER( x1_state::x1_pal_r_w )
{
m_x_r = data;
set_current_palette();
- //if(m_old_vpos != machine().primary_screen->vpos())
+ //if(m_old_vpos != machine().first_screen()->vpos())
//{
- // machine().primary_screen->update_partial(machine().primary_screen->vpos());
- // m_old_vpos = machine().primary_screen->vpos();
+ // machine().first_screen()->update_partial(machine().first_screen()->vpos());
+ // m_old_vpos = machine().first_screen()->vpos();
//}
}
}
@@ -1256,10 +1256,10 @@ WRITE8_MEMBER( x1_state::x1_pal_g_w )
{
m_x_g = data;
set_current_palette();
- //if(m_old_vpos != machine().primary_screen->vpos())
+ //if(m_old_vpos != machine().first_screen()->vpos())
//{
- machine().primary_screen->update_partial(machine().primary_screen->vpos());
- // m_old_vpos = machine().primary_screen->vpos();
+ machine().first_screen()->update_partial(machine().first_screen()->vpos());
+ // m_old_vpos = machine().first_screen()->vpos();
//}
}
}
@@ -1275,10 +1275,10 @@ WRITE8_MEMBER( x1_state::x1_pal_b_w )
{
m_x_b = data;
set_current_palette();
- //if(m_old_vpos != machine().primary_screen->vpos())
+ //if(m_old_vpos != machine().first_screen()->vpos())
//{
- // machine().primary_screen->update_partial(machine().primary_screen->vpos());
- // m_old_vpos = machine().primary_screen->vpos();
+ // machine().first_screen()->update_partial(machine().first_screen()->vpos());
+ // m_old_vpos = machine().first_screen()->vpos();
//}
}
}
@@ -1804,8 +1804,8 @@ READ8_MEMBER( x1_state::x1_portb_r )
UINT8 res = 0;
int vblank_line = m_crtc_vreg[6] * (m_crtc_vreg[9]+1);
int vsync_line = m_crtc_vreg[7] * (m_crtc_vreg[9]+1);
- m_vdisp = (machine().primary_screen->vpos() < vblank_line) ? 0x80 : 0x00;
- m_vsync = (machine().primary_screen->vpos() < vsync_line) ? 0x00 : 0x04;
+ m_vdisp = (machine().first_screen()->vpos() < vblank_line) ? 0x80 : 0x00;
+ m_vsync = (machine().first_screen()->vpos() < vsync_line) ? 0x00 : 0x04;
// popmessage("%d",vsync_line);
// popmessage("%d",vblank_line);
diff --git a/src/mess/drivers/x68k.c b/src/mess/drivers/x68k.c
index b436d496feb..42a44029858 100644
--- a/src/mess/drivers/x68k.c
+++ b/src/mess/drivers/x68k.c
@@ -1715,15 +1715,15 @@ MACHINE_RESET_MEMBER(x68k_state,x68000)
m_crtc.reg[7] = 552; // Vertical end
m_crtc.reg[8] = 27; // Horizontal adjust
- m_scanline = machine().primary_screen->vpos();// = m_crtc.reg[6]; // Vertical start
+ m_scanline = machine().first_screen()->vpos();// = m_crtc.reg[6]; // Vertical start
// start VBlank timer
m_crtc.vblank = 1;
- irq_time = machine().primary_screen->time_until_pos(m_crtc.reg[6],2);
+ irq_time = machine().first_screen()->time_until_pos(m_crtc.reg[6],2);
m_vblank_irq->adjust(irq_time);
// start HBlank timer
- m_scanline_timer->adjust(machine().primary_screen->scan_period(), 1);
+ m_scanline_timer->adjust(machine().first_screen()->scan_period(), 1);
/// TODO: get callbacks to trigger these
m_mfpdev->i0_w(1); // alarm
diff --git a/src/mess/machine/amigakbd.c b/src/mess/machine/amigakbd.c
index 6e50fbc3d8e..063e997119e 100644
--- a/src/mess/machine/amigakbd.c
+++ b/src/mess/machine/amigakbd.c
@@ -75,7 +75,7 @@ void amigakbd_device::device_timer(emu_timer &timer, device_timer_id id, int par
/* if we still have more data, schedule another update */
if ( m_buf_pos != m_cur_pos )
{
- m_timer->adjust(machine().primary_screen->frame_period() / 4);
+ m_timer->adjust(machine().first_screen()->frame_period() / 4);
}
}
@@ -116,7 +116,7 @@ INPUT_CHANGED_MEMBER(amigakbd_device::kbd_update)
/* if the buffer was empty and we have new data, start a timer to send the keystrokes */
if ( key_buf_was_empty && ( m_buf_pos != m_cur_pos ) )
{
- m_timer->adjust(machine().primary_screen->frame_period() / 4);
+ m_timer->adjust(machine().first_screen()->frame_period() / 4);
}
}
}
diff --git a/src/mess/machine/apple2.c b/src/mess/machine/apple2.c
index 97d7709e058..7128a80da32 100644
--- a/src/mess/machine/apple2.c
+++ b/src/mess/machine/apple2.c
@@ -1181,7 +1181,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(apple2_state::apple2_interrupt)
int scanline = param;
if((scanline % 8) == 0)
- machine().primary_screen->update_partial(machine().primary_screen->vpos());
+ machine().first_screen()->update_partial(machine().first_screen()->vpos());
if ((m_kbspecial->read() & 0x80) &&
(a2_no_ctrl_reset() || (m_kbspecial->read() & 0x08)))
{
@@ -1675,7 +1675,7 @@ READ8_MEMBER( apple2_state::apple2_c01x_r )
case 0x06: result |= (m_flags & VAR_ALTZP) ? 0x80 : 0x00; break;
case 0x07: result |= (m_flags & VAR_SLOTC3ROM) ? 0x80 : 0x00; break;
case 0x08: result |= (m_flags & VAR_80STORE) ? 0x80 : 0x00; break;
- case 0x09: result |= !space.machine().primary_screen->vblank() ? 0x80 : 0x00; break;
+ case 0x09: result |= !space.machine().first_screen()->vblank() ? 0x80 : 0x00; break;
case 0x0A: result |= (m_flags & VAR_TEXT) ? 0x80 : 0x00; break;
case 0x0B: result |= (m_flags & VAR_MIXED) ? 0x80 : 0x00; break;
case 0x0C: result |= (m_flags & VAR_PAGE2) ? 0x80 : 0x00; break;
diff --git a/src/mess/machine/apple2gs.c b/src/mess/machine/apple2gs.c
index 423e0c50d0a..3d3eb5d5577 100644
--- a/src/mess/machine/apple2gs.c
+++ b/src/mess/machine/apple2gs.c
@@ -726,8 +726,8 @@ TIMER_CALLBACK_MEMBER(apple2gs_state::apple2gs_scanline_tick)
{
int scanline;
- scanline = machine().primary_screen->vpos();
- machine().primary_screen->update_partial(scanline);
+ scanline = machine().first_screen()->vpos();
+ machine().first_screen()->update_partial(scanline);
/* check scanline interrupt bits if we're in super hi-res and the current scanline is within the active display area */
if ((m_newvideo & 0x80) && (scanline >= (BORDER_TOP-1)) && (scanline < (200+BORDER_TOP-1)))
@@ -768,15 +768,15 @@ TIMER_CALLBACK_MEMBER(apple2gs_state::apple2gs_scanline_tick)
#endif
/* call Apple II interrupt handler */
- if ((machine().primary_screen->vpos() % 8) == 7)
+ if ((machine().first_screen()->vpos() % 8) == 7)
{
//apple2_interrupt(m_maincpu);
/* TODO: check me! */
- machine().primary_screen->update_partial(machine().primary_screen->vpos());
+ machine().first_screen()->update_partial(machine().first_screen()->vpos());
}
}
- m_scanline_timer->adjust(machine().primary_screen->time_until_pos((scanline+1)%262, 0));
+ m_scanline_timer->adjust(machine().first_screen()->time_until_pos((scanline+1)%262, 0));
}
@@ -881,7 +881,7 @@ int apple2gs_state::apple2gs_get_vpos()
};
- scan = machine().primary_screen->vpos();
+ scan = machine().first_screen()->vpos();
if (scan < BORDER_TOP)
{
@@ -920,7 +920,7 @@ READ8_MEMBER( apple2gs_state::apple2gs_c0xx_r )
#endif
case 0x19: /* C019 - RDVBLBAR */
- result = (space.machine().primary_screen->vpos() >= (192+BORDER_TOP)) ? 0x80 : 0x00;
+ result = (space.machine().first_screen()->vpos() >= (192+BORDER_TOP)) ? 0x80 : 0x00;
break;
case 0x22: /* C022 - TBCOLOR */
@@ -1021,7 +1021,7 @@ READ8_MEMBER( apple2gs_state::apple2gs_c0xx_r )
break;
case 0x2F: /* C02F - HORIZCNT */
- result = space.machine().primary_screen->hpos() / 11;
+ result = space.machine().first_screen()->hpos() / 11;
if (result > 0)
{
result += 0x40;
@@ -2068,7 +2068,7 @@ MACHINE_START_MEMBER(apple2gs_state,apple2gscommon)
m_scanline_timer->adjust(attotime::never);
// fire on scanline zero
- m_scanline_timer->adjust(machine().primary_screen->time_until_pos(0, 0));
+ m_scanline_timer->adjust(machine().first_screen()->time_until_pos(0, 0));
}
MACHINE_START_MEMBER(apple2gs_state,apple2gs)
diff --git a/src/mess/machine/apple3.c b/src/mess/machine/apple3.c
index 212f66adbc6..db9528c6e03 100644
--- a/src/mess/machine/apple3.c
+++ b/src/mess/machine/apple3.c
@@ -372,8 +372,8 @@ WRITE8_MEMBER(apple3_state::apple3_c0xx_w)
TIMER_DEVICE_CALLBACK_MEMBER(apple3_state::apple3_interrupt)
{
- m_via_1->write_cb1(machine().primary_screen->vblank());
- m_via_1->write_cb2(machine().primary_screen->vblank());
+ m_via_1->write_cb1(machine().first_screen()->vblank());
+ m_via_1->write_cb2(machine().first_screen()->vblank());
}
UINT8 *apple3_state::apple3_bankaddr(UINT16 bank, offs_t offset)
diff --git a/src/mess/machine/coco.c b/src/mess/machine/coco.c
index ae44f8e69fc..ee204254c81 100644
--- a/src/mess/machine/coco.c
+++ b/src/mess/machine/coco.c
@@ -808,7 +808,7 @@ void coco_state::poll_joystick(bool *joyin, UINT8 *buttons)
/* get the vertical position of the lightgun */
dclg_vpos = analog->input(joystick, 1);
- if (machine().primary_screen->vpos() == dclg_vpos)
+ if (machine().first_screen()->vpos() == dclg_vpos)
{
/* if gun is pointing at the current scan line, set hit bit and cache horizontal timer value */
m_dclg_output_h |= 0x02;
@@ -820,7 +820,7 @@ void coco_state::poll_joystick(bool *joyin, UINT8 *buttons)
if (m_dclg_state == 7)
{
/* while in state 7, prepare to check next video frame for a hit */
- attotime dclg_time = machine().primary_screen->time_until_pos(dclg_vpos, 0);
+ attotime dclg_time = machine().first_screen()->time_until_pos(dclg_vpos, 0);
m_diecom_lightgun_timer->adjust(dclg_time);
}
break;
diff --git a/src/mess/machine/gamecom.c b/src/mess/machine/gamecom.c
index b3edcfabeb8..dfb4daa00f3 100644
--- a/src/mess/machine/gamecom.c
+++ b/src/mess/machine/gamecom.c
@@ -234,7 +234,7 @@ void gamecom_state::recompute_lcd_params()
hblank_period = (H_timing + 200);
refresh = HZ_TO_ATTOSECONDS(pixel_clock) * (hblank_period) * vblank_period;
- machine().primary_screen->configure((hblank_period), (vblank_period), visarea, refresh );
+ machine().first_screen()->configure((hblank_period), (vblank_period), visarea, refresh );
}
WRITE8_MEMBER( gamecom_state::gamecom_internal_w )
diff --git a/src/mess/machine/hp48.c b/src/mess/machine/hp48.c
index 108326117ba..e8fe2445e51 100644
--- a/src/mess/machine/hp48.c
+++ b/src/mess/machine/hp48.c
@@ -499,7 +499,7 @@ READ8_MEMBER(hp48_state::hp48_io_r)
case 0x29:
{
int last_line = HP48_IO_8(0x28) & 0x3f; /* last line of main bitmap before menu */
- int cur_line = space.machine().primary_screen->vpos();
+ int cur_line = space.machine().first_screen()->vpos();
if ( last_line <= 1 ) last_line = 0x3f;
data = ( cur_line >= 0 && cur_line <= last_line ) ? last_line - cur_line : 0;
if ( offset == 0x29 )
diff --git a/src/mess/machine/lisa.c b/src/mess/machine/lisa.c
index 92189c57185..949c842e559 100644
--- a/src/mess/machine/lisa.c
+++ b/src/mess/machine/lisa.c
@@ -1407,7 +1407,7 @@ READ16_MEMBER(lisa_state::lisa_r)
/* problem : due to collisions with video, timings of the LISA CPU
are slightly different from timings of a bare 68k */
/* so we use a kludge... */
- int time_in_frame = machine().primary_screen->vpos();
+ int time_in_frame = machine().first_screen()->vpos();
/* the BOOT ROM only reads 56 bits, so there must be some wrap-around for
videoROM_address <= 56 */
@@ -1814,7 +1814,7 @@ READ16_MEMBER(lisa_state::lisa_IO_r)
if (m_VTIR<=1)
// GFE : needs to be in phase with Serial NUM
{
- int time_in_frame = machine().primary_screen->vpos();
+ int time_in_frame = machine().first_screen()->vpos();
if (m_features.has_mac_xl_video)
{
if ((time_in_frame >= 374) && (time_in_frame <= 392)) /* these values have not been tested */
diff --git a/src/mess/machine/lynx.c b/src/mess/machine/lynx.c
index 030bce8a79f..79ca0ce3d6c 100644
--- a/src/mess/machine/lynx.c
+++ b/src/mess/machine/lynx.c
@@ -1417,7 +1417,7 @@ void lynx_state::lynx_timer_signal_irq(int which)
lynx_timer_count_down(2);
break;
case 2:
- copybitmap(m_bitmap, m_bitmap_temp, 0, 0, 0, 0, machine().primary_screen->cliprect());
+ copybitmap(m_bitmap, m_bitmap_temp, 0, 0, 0, 0, machine().first_screen()->cliprect());
lynx_timer_count_down(4);
break;
case 1:
diff --git a/src/mess/machine/mac.c b/src/mess/machine/mac.c
index c3690f9c0aa..f1df6dee825 100644
--- a/src/mess/machine/mac.c
+++ b/src/mess/machine/mac.c
@@ -1251,9 +1251,9 @@ READ8_MEMBER(mac_state::mac_via_in_b)
{
int val = 0;
/* video beam in display (! VBLANK && ! HBLANK basically) */
- if (machine().primary_screen)
+ if (machine().first_screen())
{
- if (machine().primary_screen->vpos() >= MAC_V_VIS)
+ if (machine().first_screen()->vpos() >= MAC_V_VIS)
val |= 0x40;
}
@@ -1298,9 +1298,9 @@ READ8_MEMBER(mac_state::mac_via_in_b_via2pmu)
int val = 0;
// TODO: is this valid for VIA2 PMU machines?
/* video beam in display (! VBLANK && ! HBLANK basically) */
- if (machine().primary_screen)
+ if (machine().first_screen())
{
- if (machine().primary_screen->vpos() >= MAC_V_VIS)
+ if (machine().first_screen()->vpos() >= MAC_V_VIS)
val |= 0x40;
}
@@ -1742,10 +1742,10 @@ void mac_state::machine_start()
}
}
- if (machine().primary_screen)
+ if (machine().first_screen())
{
this->m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mac_state::mac_scanline_tick),this));
- this->m_scanline_timer->adjust(machine().primary_screen->time_until_pos(0, 0));
+ this->m_scanline_timer->adjust(machine().first_screen()->time_until_pos(0, 0));
}
m_6015_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mac_state::mac_6015_tick),this));
@@ -2218,7 +2218,7 @@ TIMER_CALLBACK_MEMBER(mac_state::mac_scanline_tick)
}
}
- scanline = machine().primary_screen->vpos();
+ scanline = machine().first_screen()->vpos();
if (scanline == MAC_V_VIS)
vblank_irq();
@@ -2229,7 +2229,7 @@ TIMER_CALLBACK_MEMBER(mac_state::mac_scanline_tick)
mouse_callback();
}
- m_scanline_timer->adjust(machine().primary_screen->time_until_pos((scanline+1) % MAC_V_TOTAL, 0));
+ m_scanline_timer->adjust(machine().first_screen()->time_until_pos((scanline+1) % MAC_V_TOTAL, 0));
}
WRITE_LINE_MEMBER(mac_state::nubus_irq_9_w)
diff --git a/src/mess/machine/mz700.c b/src/mess/machine/mz700.c
index be894cba8de..9c990a443de 100644
--- a/src/mess/machine/mz700.c
+++ b/src/mess/machine/mz700.c
@@ -92,7 +92,7 @@ READ8_MEMBER(mz_state::mz700_e008_r)
data |= m_other_timer;
data |= ioport("JOY")->read();
- data |= machine().primary_screen->hblank() << 7;
+ data |= machine().first_screen()->hblank() << 7;
LOG(1, "mz700_e008_r", ("%02X\n", data), machine());
@@ -431,7 +431,7 @@ READ8_MEMBER(mz_state::pio_port_c_r)
data |= 0x20; /* set the RDATA status */
data |= m_cursor_timer << 6;
- data |= machine().primary_screen->vblank() << 7;
+ data |= machine().first_screen()->vblank() << 7;
LOG(2,"mz700_pio_port_c_r",("%02X\n", data),machine());
@@ -524,7 +524,7 @@ READ8_MEMBER(mz_state::mz800_z80pio_port_a_r)
result |= m_centronics_busy;
result |= m_centronics_perror << 1;
- result |= machine().primary_screen->hblank() << 5;
+ result |= machine().first_screen()->hblank() << 5;
return result;
}
diff --git a/src/mess/machine/orion.c b/src/mess/machine/orion.c
index 837ced06760..7f4f0c13c80 100644
--- a/src/mess/machine/orion.c
+++ b/src/mess/machine/orion.c
@@ -75,7 +75,7 @@ WRITE8_MEMBER(orion_state::orion128_romdisk_w)
void orion_state::orion_set_video_mode(int width)
{
rectangle visarea(0, width-1, 0, 255);
- machine().primary_screen->configure(width, 256, visarea, machine().primary_screen->frame_period().attoseconds);
+ machine().first_screen()->configure(width, 256, visarea, machine().first_screen()->frame_period().attoseconds);
}
WRITE8_MEMBER(orion_state::orion128_video_mode_w)
diff --git a/src/mess/machine/osborne1.c b/src/mess/machine/osborne1.c
index c58c6325592..6f22f9b7498 100644
--- a/src/mess/machine/osborne1.c
+++ b/src/mess/machine/osborne1.c
@@ -325,7 +325,7 @@ void osborne1_state::device_timer(emu_timer &timer, device_timer_id id, int para
TIMER_CALLBACK_MEMBER(osborne1_state::osborne1_video_callback)
{
- int y = machine().primary_screen->vpos();
+ int y = machine().first_screen()->vpos();
UINT8 ra=0,chr,gfx,dim;
UINT16 x,ma;
@@ -378,7 +378,7 @@ TIMER_CALLBACK_MEMBER(osborne1_state::osborne1_video_callback)
m_beep->set_state( 0 );
}
- m_video_timer->adjust(machine().primary_screen->time_until_pos(y + 1, 0 ));
+ m_video_timer->adjust(machine().first_screen()->time_until_pos(y + 1, 0 ));
}
TIMER_CALLBACK_MEMBER(osborne1_state::setup_osborne1)
@@ -443,7 +443,7 @@ DRIVER_INIT_MEMBER(osborne1_state,osborne1)
/* Configure the 6850 ACIA */
// acia6850_config( 0, &osborne1_6850_config );
m_video_timer = timer_alloc(TIMER_VIDEO);
- m_video_timer->adjust(machine().primary_screen->time_until_pos(1, 0 ));
+ m_video_timer->adjust(machine().first_screen()->time_until_pos(1, 0 ));
timer_set(attotime::zero, TIMER_SETUP);
}
@@ -451,7 +451,7 @@ DRIVER_INIT_MEMBER(osborne1_state,osborne1)
void osborne1_state::video_start()
{
- machine().primary_screen->register_screen_bitmap(m_bitmap);
+ machine().first_screen()->register_screen_bitmap(m_bitmap);
}
UINT32 osborne1_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
diff --git a/src/mess/machine/primo.c b/src/mess/machine/primo.c
index 807720ec1ff..759ad9192c3 100644
--- a/src/mess/machine/primo.c
+++ b/src/mess/machine/primo.c
@@ -82,7 +82,7 @@ READ8_MEMBER(primo_state::primo_be_1_r)
// bit 7, 6 - not used
// bit 5 - VBLANK
- data |= (machine().primary_screen->vblank()) ? 0x20 : 0x00;
+ data |= (machine().first_screen()->vblank()) ? 0x20 : 0x00;
// bit 4 - I4 (external bus)
diff --git a/src/mess/machine/s3c44b0.c b/src/mess/machine/s3c44b0.c
index fe5767fcff3..73744094c4d 100644
--- a/src/mess/machine/s3c44b0.c
+++ b/src/mess/machine/s3c44b0.c
@@ -567,7 +567,7 @@ READ32_MEMBER( s3c44b0_device::lcd_r )
void s3c44b0_device::lcd_configure()
{
- screen_device *screen = machine().primary_screen;
+ screen_device *screen = machine().first_screen();
int dismode, clkval, lineval, wdly, hozval, lineblank, wlh, mclk;
double vclk, framerate;
int width, height;
@@ -620,7 +620,7 @@ void s3c44b0_device::lcd_configure()
void s3c44b0_device::lcd_start()
{
- screen_device *screen = machine().primary_screen;
+ screen_device *screen = machine().first_screen();
verboselog(machine(), 1, "LCD start\n");
lcd_configure();
lcd_dma_init();
diff --git a/src/mess/machine/samcoupe.c b/src/mess/machine/samcoupe.c
index e4598f8543f..59439d093b2 100644
--- a/src/mess/machine/samcoupe.c
+++ b/src/mess/machine/samcoupe.c
@@ -301,7 +301,7 @@ void samcoupe_state::machine_start()
/* schedule our video updates */
m_video_update_timer = timer_alloc(TIMER_VIDEO_UPDATE);
- m_video_update_timer->adjust(machine().primary_screen->time_until_pos(0, 0));
+ m_video_update_timer->adjust(machine().first_screen()->time_until_pos(0, 0));
}
/***************************************************************************
diff --git a/src/mess/machine/vector06.c b/src/mess/machine/vector06.c
index 28b34f7a44d..9195bcce66f 100644
--- a/src/mess/machine/vector06.c
+++ b/src/mess/machine/vector06.c
@@ -42,7 +42,7 @@ WRITE8_MEMBER( vector06_state::vector06_8255_porta_w )
void vector06_state::vector06_set_video_mode(int width)
{
rectangle visarea(0, width+64-1, 0, 256+64-1);
- machine().primary_screen->configure(width+64, 256+64, visarea, machine().primary_screen->frame_period().attoseconds);
+ machine().first_screen()->configure(width+64, 256+64, visarea, machine().first_screen()->frame_period().attoseconds);
}
WRITE8_MEMBER( vector06_state::vector06_8255_portb_w )
diff --git a/src/mess/machine/zx.c b/src/mess/machine/zx.c
index f9bfba3c749..37b69eb0a77 100644
--- a/src/mess/machine/zx.c
+++ b/src/mess/machine/zx.c
@@ -13,9 +13,9 @@
#define DEBUG_ZX81_PORTS 1
#define DEBUG_ZX81_VSYNC 1
-#define LOG_ZX81_IOR(_comment) do { if (DEBUG_ZX81_PORTS) logerror("ZX81 IOR: %04x, Data: %02x, Scanline: %d (%s)\n", offset, data, space.machine().primary_screen->vpos(), _comment); } while (0)
-#define LOG_ZX81_IOW(_comment) do { if (DEBUG_ZX81_PORTS) logerror("ZX81 IOW: %04x, Data: %02x, Scanline: %d (%s)\n", offset, data, space.machine().primary_screen->vpos(), _comment); } while (0)
-#define LOG_ZX81_VSYNC do { if (DEBUG_ZX81_VSYNC) logerror("VSYNC starts in scanline: %d\n", space.machine().primary_screen->vpos()); } while (0)
+#define LOG_ZX81_IOR(_comment) do { if (DEBUG_ZX81_PORTS) logerror("ZX81 IOR: %04x, Data: %02x, Scanline: %d (%s)\n", offset, data, space.machine().first_screen()->vpos(), _comment); } while (0)
+#define LOG_ZX81_IOW(_comment) do { if (DEBUG_ZX81_PORTS) logerror("ZX81 IOW: %04x, Data: %02x, Scanline: %d (%s)\n", offset, data, space.machine().first_screen()->vpos(), _comment); } while (0)
+#define LOG_ZX81_VSYNC do { if (DEBUG_ZX81_VSYNC) logerror("VSYNC starts in scanline: %d\n", space.machine().first_screen()->vpos()); } while (0)
WRITE8_MEMBER(zx_state::zx_ram_w)
diff --git a/src/mess/video/a7800.c b/src/mess/video/a7800.c
index b2d1fc5ae9b..a74caacd01c 100644
--- a/src/mess/video/a7800.c
+++ b/src/mess/video/a7800.c
@@ -68,7 +68,7 @@ void a7800_state::video_start()
m_maria_kangaroo = 0;
m_maria_rm = 0;
- machine().primary_screen->register_screen_bitmap(m_bitmap);
+ machine().first_screen()->register_screen_bitmap(m_bitmap);
}
/***************************************************************************
diff --git a/src/mess/video/atarist.c b/src/mess/video/atarist.c
index e6339d26a0f..2c80d6beb9a 100644
--- a/src/mess/video/atarist.c
+++ b/src/mess/video/atarist.c
@@ -134,8 +134,8 @@ inline pen_t st_state::shift_mode_2()
void st_state::shifter_tick()
{
- int y = machine().primary_screen->vpos();
- int x = machine().primary_screen->hpos();
+ int y = machine().first_screen()->vpos();
+ int x = machine().first_screen()->hpos();
pen_t pen;
@@ -193,8 +193,8 @@ inline void st_state::shifter_load()
void st_state::glue_tick()
{
- int y = machine().primary_screen->vpos();
- int x = machine().primary_screen->hpos();
+ int y = machine().first_screen()->vpos();
+ int x = machine().first_screen()->hpos();
int v = (y >= m_shifter_y_start) && (y < m_shifter_y_end);
int h = (x >= m_shifter_x_start) && (x < m_shifter_x_end);
@@ -1069,10 +1069,10 @@ void st_state::video_start()
m_shifter_timer = timer_alloc(TIMER_SHIFTER_TICK);
m_glue_timer = timer_alloc(TIMER_GLUE_TICK);
-// m_shifter_timer->adjust(machine().primary_screen->time_until_pos(0), 0, attotime::from_hz(Y2/4)); // 125 ns
- m_glue_timer->adjust(machine().primary_screen->time_until_pos(0), 0, attotime::from_hz(Y2/16)); // 500 ns
+// m_shifter_timer->adjust(machine().first_screen()->time_until_pos(0), 0, attotime::from_hz(Y2/4)); // 125 ns
+ m_glue_timer->adjust(machine().first_screen()->time_until_pos(0), 0, attotime::from_hz(Y2/16)); // 500 ns
- machine().primary_screen->register_screen_bitmap(m_bitmap);
+ machine().first_screen()->register_screen_bitmap(m_bitmap);
/* register for state saving */
save_item(NAME(m_shifter_base));
diff --git a/src/mess/video/bbc.c b/src/mess/video/bbc.c
index 3b3d10bb25a..c3df043c574 100644
--- a/src/mess/video/bbc.c
+++ b/src/mess/video/bbc.c
@@ -108,13 +108,13 @@ void bbc_state::set_pixel_lookup()
WRITE8_MEMBER(bbc_state::bbc_videoULA_w)
{
// Make sure vpos is never <0 2008-10-11 PHS.
- int vpos=machine().primary_screen->vpos();
+ int vpos=machine().first_screen()->vpos();
if(vpos==0)
- machine().primary_screen->update_partial(vpos);
+ machine().first_screen()->update_partial(vpos);
else
- machine().primary_screen->update_partial(vpos -1 );
+ machine().first_screen()->update_partial(vpos -1 );
- logerror("setting videoULA %.4x to:%.4x at :%d \n",data,offset,machine().primary_screen->vpos() );
+ logerror("setting videoULA %.4x to:%.4x at :%d \n",data,offset,machine().first_screen()->vpos() );
switch (offset&0x01)
diff --git a/src/mess/video/electron.c b/src/mess/video/electron.c
index 9d23b120274..9e26bfc5fa7 100644
--- a/src/mess/video/electron.c
+++ b/src/mess/video/electron.c
@@ -46,7 +46,7 @@ void electron_state::video_start()
m_map16[i] = ( ( i & 0x40 ) >> 3 ) | ( ( i & 0x10 ) >> 2 ) | ( ( i & 0x04 ) >> 1 ) | ( i & 0x01 );
}
m_scanline_timer = timer_alloc(TIMER_SCANLINE_INTERRUPT);
- m_scanline_timer->adjust( machine().primary_screen->time_until_pos(0), 0, machine().primary_screen->scan_period() );
+ m_scanline_timer->adjust( machine().first_screen()->time_until_pos(0), 0, machine().first_screen()->scan_period() );
}
inline UINT8 electron_state::read_vram( UINT16 addr )
@@ -256,7 +256,7 @@ UINT32 electron_state::screen_update_electron(screen_device &screen, bitmap_ind1
TIMER_CALLBACK_MEMBER(electron_state::electron_scanline_interrupt)
{
- switch (machine().primary_screen->vpos())
+ switch (machine().first_screen()->vpos())
{
case 43:
electron_interrupt_handler( INT_SET, INT_RTC );
diff --git a/src/mess/video/fm7.c b/src/mess/video/fm7.c
index 0eaa5045d50..154541fc4be 100644
--- a/src/mess/video/fm7.c
+++ b/src/mess/video/fm7.c
@@ -1063,7 +1063,7 @@ READ8_MEMBER(fm7_state::fm77av_video_flags_r)
{
UINT8 ret = 0xff;
- if(machine().primary_screen->vblank())
+ if(machine().first_screen()->vblank())
ret &= ~0x80;
if(m_alu.busy != 0)
@@ -1104,7 +1104,7 @@ READ8_MEMBER(fm7_state::fm77av_sub_modestatus_r)
ret |= 0xbc;
ret |= (m_video.modestatus & 0x40);
- if(!machine().primary_screen->vblank())
+ if(!machine().first_screen()->vblank())
ret |= 0x02;
if(m_video.vsync_flag != 0)
@@ -1119,12 +1119,12 @@ WRITE8_MEMBER(fm7_state::fm77av_sub_modestatus_w)
if(data & 0x40)
{
rectangle rect(0, 320-1, 0, 200-1);
- machine().primary_screen->configure(320,200,rect,HZ_TO_ATTOSECONDS(60));
+ machine().first_screen()->configure(320,200,rect,HZ_TO_ATTOSECONDS(60));
}
else
{
rectangle rect(0, 640-1, 0, 200-1);
- machine().primary_screen->configure(640,200,rect,HZ_TO_ATTOSECONDS(60));
+ machine().first_screen()->configure(640,200,rect,HZ_TO_ATTOSECONDS(60));
}
}
@@ -1355,7 +1355,7 @@ TIMER_CALLBACK_MEMBER(fm7_state::fm77av_vsync)
else
{
m_video.vsync_flag = 0;
- m_fm77av_vsync_timer->adjust(machine().primary_screen->time_until_vblank_end());
+ m_fm77av_vsync_timer->adjust(machine().first_screen()->time_until_vblank_end());
}
}
diff --git a/src/mess/video/fmtowns.c b/src/mess/video/fmtowns.c
index 500fe1802e9..a807773489b 100644
--- a/src/mess/video/fmtowns.c
+++ b/src/mess/video/fmtowns.c
@@ -122,7 +122,7 @@ void towns_state::towns_crtc_refresh_mode()
if(scr.max_x <= scr.min_x || scr.max_y <= scr.min_y)
return;
- machine().primary_screen->configure(scr.max_x+1,scr.max_y+1,scr,HZ_TO_ATTOSECONDS(60));
+ machine().first_screen()->configure(scr.max_x+1,scr.max_y+1,scr,HZ_TO_ATTOSECONDS(60));
}
READ8_MEMBER( towns_state::towns_gfx_high_r )
@@ -365,8 +365,8 @@ READ8_MEMBER(towns_state::towns_video_440_r)
if(m_video.towns_crtc_sel == 30)
{
// check video position
- xpos = space.machine().primary_screen->hpos();
- ypos = space.machine().primary_screen->vpos();
+ xpos = space.machine().first_screen()->hpos();
+ ypos = space.machine().first_screen()->vpos();
if(xpos < (m_video.towns_crtc_reg[0] & 0xfe))
ret |= 0x02;
@@ -521,7 +521,7 @@ READ8_MEMBER(towns_state::towns_video_fd90_r)
return m_video.towns_degipal[offset-0x08];
case 0x10: // "sub status register"
// check video position
- xpos = space.machine().primary_screen->hpos();
+ xpos = space.machine().first_screen()->hpos();
if(xpos < m_video.towns_crtc_layerscr[0].max_x && xpos > m_video.towns_crtc_layerscr[0].min_x)
ret |= 0x02;
@@ -1655,7 +1655,7 @@ INTERRUPT_GEN_MEMBER(towns_state::towns_vsync_irq)
dev->ir3_w(1); // IRQ11 = VSync
if(IRQ_LOG) logerror("PIC: IRQ11 (VSync) set high\n");
m_video.towns_vblank_flag = 1;
- machine().scheduler().timer_set(machine().primary_screen->time_until_vblank_end(), timer_expired_delegate(FUNC(towns_state::towns_vblank_end),this), 0, (void*)dev);
+ machine().scheduler().timer_set(machine().first_screen()->time_until_vblank_end(), timer_expired_delegate(FUNC(towns_state::towns_vblank_end),this), 0, (void*)dev);
if(m_video.towns_tvram_enable)
draw_text_layer();
if(m_video.towns_sprite_reg[1] & 0x80)
diff --git a/src/mess/video/galaxy.c b/src/mess/video/galaxy.c
index e16baab5fd1..35dfec58d01 100644
--- a/src/mess/video/galaxy.c
+++ b/src/mess/video/galaxy.c
@@ -115,7 +115,7 @@ void galaxy_state::video_start()
m_gal_video_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(galaxy_state::gal_video),this));
m_gal_video_timer->adjust(attotime::zero, 0, attotime::never);
- machine().primary_screen->register_screen_bitmap(m_bitmap);
+ machine().first_screen()->register_screen_bitmap(m_bitmap);
}
UINT32 galaxy_state::screen_update_galaxy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
diff --git a/src/mess/video/gamecom.c b/src/mess/video/gamecom.c
index 1d605e8055c..61b1ac22e3d 100644
--- a/src/mess/video/gamecom.c
+++ b/src/mess/video/gamecom.c
@@ -65,6 +65,6 @@ TIMER_CALLBACK_MEMBER(gamecom_state::gamecom_scanline)
void gamecom_state::video_start()
{
m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gamecom_state::gamecom_scanline),this));
- m_scanline_timer->adjust( machine().primary_screen->time_until_pos(0 ), 0, machine().primary_screen->scan_period() );
- machine().primary_screen->register_screen_bitmap(m_bitmap);
+ m_scanline_timer->adjust( machine().first_screen()->time_until_pos(0 ), 0, machine().first_screen()->scan_period() );
+ machine().first_screen()->register_screen_bitmap(m_bitmap);
}
diff --git a/src/mess/video/gba.c b/src/mess/video/gba.c
index 3c79b773fc5..df584dfea13 100644
--- a/src/mess/video/gba.c
+++ b/src/mess/video/gba.c
@@ -1890,7 +1890,7 @@ void gba_state::draw_scanline(int y)
void gba_state::video_start()
{
- machine().primary_screen->register_screen_bitmap(m_bitmap);
+ machine().first_screen()->register_screen_bitmap(m_bitmap);
}
UINT32 gba_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
diff --git a/src/mess/video/kaypro.c b/src/mess/video/kaypro.c
index 2078829a693..6e97b80853f 100644
--- a/src/mess/video/kaypro.c
+++ b/src/mess/video/kaypro.c
@@ -250,7 +250,7 @@ void kaypro_state::mc6845_screen_configure()
/* Resize the screen */
if ((width < 640) && (height < 400) && (bytes < 0x800)) /* bounds checking to prevent an assert or violation */
- machine().primary_screen->set_visible_area(0, width, 0, height);
+ machine().first_screen()->set_visible_area(0, width, 0, height);
}
diff --git a/src/mess/video/kc.c b/src/mess/video/kc.c
index d847e648873..dc87b4599e4 100644
--- a/src/mess/video/kc.c
+++ b/src/mess/video/kc.c
@@ -58,7 +58,7 @@ WRITE_LINE_MEMBER( kc_state::video_toggle_blink_state )
{
if (state)
{
- machine().primary_screen->update_partial(machine().primary_screen->vpos());
+ machine().first_screen()->update_partial(machine().first_screen()->vpos());
m_kc85_blink_state = !m_kc85_blink_state;
}
diff --git a/src/mess/video/mac.c b/src/mess/video/mac.c
index 3ac1e80e00f..abeda9cd450 100644
--- a/src/mess/video/mac.c
+++ b/src/mess/video/mac.c
@@ -280,7 +280,7 @@ VIDEO_RESET_MEMBER(mac_state,macrbv)
}
// printf("RBV reset: monitor is %dx%d @ %f Hz\n", visarea.max_x+1, visarea.max_y+1, framerate);
- machine().primary_screen->configure(htotal, vtotal, visarea, HZ_TO_ATTOSECONDS(framerate));
+ machine().first_screen()->configure(htotal, vtotal, visarea, HZ_TO_ATTOSECONDS(framerate));
render_target *target = machine().render().first_target();
target->set_view(view);
}
@@ -337,7 +337,7 @@ VIDEO_RESET_MEMBER(mac_state,macsonora)
}
// printf("Sonora reset: monitor is %dx%d @ %f Hz\n", visarea.max_x+1, visarea.max_y+1, framerate);
- machine().primary_screen->configure(htotal, vtotal, visarea, HZ_TO_ATTOSECONDS(framerate));
+ machine().first_screen()->configure(htotal, vtotal, visarea, HZ_TO_ATTOSECONDS(framerate));
render_target *target = machine().render().first_target();
target->set_view(view);
}
diff --git a/src/mess/video/pc1512.c b/src/mess/video/pc1512.c
index 40fd02b6f81..fd015f03d21 100644
--- a/src/mess/video/pc1512.c
+++ b/src/mess/video/pc1512.c
@@ -169,8 +169,8 @@ READ8_MEMBER( pc1512_state::vdu_r )
// vertical sync
int flyback = 0;
- if (machine().primary_screen->vpos() < VFP_LORES - 16) flyback = 1;
- if (machine().primary_screen->vpos() > VFP_LORES + 200) flyback = 1;
+ if (machine().first_screen()->vpos() < VFP_LORES - 16) flyback = 1;
+ if (machine().first_screen()->vpos() > VFP_LORES + 200) flyback = 1;
data |= flyback << 3;
break;
diff --git a/src/mess/video/poisk1.c b/src/mess/video/poisk1.c
index db32d66103a..6f367c6eb2a 100644
--- a/src/mess/video/poisk1.c
+++ b/src/mess/video/poisk1.c
@@ -116,9 +116,9 @@ WRITE8_MEMBER(p1_state::p1_ppi2_porta_w)
// HIRES -- XXX
if (BIT(data, 7) != BIT(m_video.color_select_68, 7)) {
if (BIT(data, 7))
- machine().primary_screen->set_visible_area(0, 640-1, 0, 200-1);
+ machine().first_screen()->set_visible_area(0, 640-1, 0, 200-1);
else
- machine().primary_screen->set_visible_area(0, 320-1, 0, 200-1);
+ machine().first_screen()->set_visible_area(0, 320-1, 0, 200-1);
}
m_video.color_select_68 = data;
set_palette_luts();
diff --git a/src/mess/video/samcoupe.c b/src/mess/video/samcoupe.c
index 2376a676880..95961b4f7b9 100644
--- a/src/mess/video/samcoupe.c
+++ b/src/mess/video/samcoupe.c
@@ -29,7 +29,7 @@
void samcoupe_state::video_start()
{
- machine().primary_screen->register_screen_bitmap(m_bitmap);
+ machine().first_screen()->register_screen_bitmap(m_bitmap);
}
UINT32 samcoupe_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
@@ -124,8 +124,8 @@ void samcoupe_state::draw_mode1_line(int y, int hpos)
TIMER_CALLBACK_MEMBER(samcoupe_state::sam_video_update_callback)
{
- int vpos = machine().primary_screen->vpos();
- int hpos = machine().primary_screen->hpos();
+ int vpos = machine().first_screen()->vpos();
+ int hpos = machine().first_screen()->hpos();
int next_vpos = vpos;
int next_hpos = hpos + SAM_BLOCK*2;
@@ -168,5 +168,5 @@ TIMER_CALLBACK_MEMBER(samcoupe_state::sam_video_update_callback)
samcoupe_irq(SAM_LINE_INT);
/* schedule next update */
- m_video_update_timer->adjust(machine().primary_screen->time_until_pos(next_vpos, next_hpos));
+ m_video_update_timer->adjust(machine().first_screen()->time_until_pos(next_vpos, next_hpos));
}
diff --git a/src/mess/video/spectrum.c b/src/mess/video/spectrum.c
index ab0fc789755..886974452c1 100644
--- a/src/mess/video/spectrum.c
+++ b/src/mess/video/spectrum.c
@@ -26,7 +26,7 @@ VIDEO_START_MEMBER(spectrum_state,spectrum)
m_flash_invert = 0;
m_previous_border_x = 0; m_previous_border_y = 0;
- machine().primary_screen->register_screen_bitmap(m_border_bitmap);
+ machine().first_screen()->register_screen_bitmap(m_border_bitmap);
m_screen_location = m_video_ram;
}
@@ -38,7 +38,7 @@ VIDEO_START_MEMBER(spectrum_state,spectrum_128)
m_flash_invert = 0;
m_previous_border_x = 0; m_previous_border_y = 0;
- machine().primary_screen->register_screen_bitmap(m_border_bitmap);
+ machine().first_screen()->register_screen_bitmap(m_border_bitmap);
}
@@ -183,8 +183,8 @@ PALETTE_INIT_MEMBER(spectrum_state,spectrum)
void spectrum_state::spectrum_UpdateBorderBitmap()
{
- unsigned int x = machine().primary_screen->hpos();
- unsigned int y = machine().primary_screen->vpos();
+ unsigned int x = machine().first_screen()->hpos();
+ unsigned int y = machine().first_screen()->vpos();
int width = m_border_bitmap.width();
int height = m_border_bitmap.height();
diff --git a/src/mess/video/stic.c b/src/mess/video/stic.c
index d908eac5fd4..5cf9488d2af 100644
--- a/src/mess/video/stic.c
+++ b/src/mess/video/stic.c
@@ -41,7 +41,7 @@ stic_device::~stic_device()
void stic_device::device_start()
{
- machine().primary_screen->register_screen_bitmap(m_bitmap);
+ machine().first_screen()->register_screen_bitmap(m_bitmap);
save_item(NAME(m_stic_registers));
save_item(NAME(m_gramdirty));
diff --git a/src/mess/video/wswan.c b/src/mess/video/wswan.c
index 0625b964bf3..da649d76779 100644
--- a/src/mess/video/wswan.c
+++ b/src/mess/video/wswan.c
@@ -572,7 +572,7 @@ void wswan_state::wswan_refresh_scanline()
void wswan_state::video_start()
{
- machine().primary_screen->register_screen_bitmap(m_bitmap);
+ machine().first_screen()->register_screen_bitmap(m_bitmap);
save_item(NAME(m_bitmap));
}
diff --git a/src/mess/video/x68k.c b/src/mess/video/x68k.c
index 2ccd1243f84..8ff6ae7240f 100644
--- a/src/mess/video/x68k.c
+++ b/src/mess/video/x68k.c
@@ -166,8 +166,8 @@ void x68k_state::x68k_crtc_refresh_mode()
// logerror("CRTC regs - %i %i %i %i - %i %i %i %i - %i - %i\n",m_crtc.reg[0],m_crtc.reg[1],m_crtc.reg[2],m_crtc.reg[3],
// m_crtc.reg[4],m_crtc.reg[5],m_crtc.reg[6],m_crtc.reg[7],m_crtc.reg[8],m_crtc.reg[9]);
- logerror("video_screen_configure(machine.primary_screen,%i,%i,[%i,%i,%i,%i],55.45)\n",scr.max_x,scr.max_y,visiblescr.min_x,visiblescr.min_y,visiblescr.max_x,visiblescr.max_y);
- machine().primary_screen->configure(scr.max_x,scr.max_y,visiblescr,HZ_TO_ATTOSECONDS(55.45));
+ logerror("video_screen_configure(machine.first_screen(),%i,%i,[%i,%i,%i,%i],55.45)\n",scr.max_x,scr.max_y,visiblescr.min_x,visiblescr.min_y,visiblescr.max_x,visiblescr.max_y);
+ machine().first_screen()->configure(scr.max_x,scr.max_y,visiblescr,HZ_TO_ATTOSECONDS(55.45));
}
TIMER_CALLBACK_MEMBER(x68k_state::x68k_hsync)
@@ -183,31 +183,31 @@ TIMER_CALLBACK_MEMBER(x68k_state::x68k_hsync)
{
if(m_oddscanline == 1)
{
- int scan = machine().primary_screen->vpos();
+ int scan = machine().first_screen()->vpos();
if(scan > m_crtc.vend)
scan = m_crtc.vbegin;
- hsync_time = machine().primary_screen->time_until_pos(scan,(m_crtc.htotal + m_crtc.hend) / 2);
+ hsync_time = machine().first_screen()->time_until_pos(scan,(m_crtc.htotal + m_crtc.hend) / 2);
m_scanline_timer->adjust(hsync_time);
if(scan != 0)
{
if((ioport("options")->read() & 0x04))
{
- machine().primary_screen->update_partial(scan);
+ machine().first_screen()->update_partial(scan);
}
}
}
else
{
- int scan = machine().primary_screen->vpos();
+ int scan = machine().first_screen()->vpos();
if(scan > m_crtc.vend)
scan = m_crtc.vbegin;
- hsync_time = machine().primary_screen->time_until_pos(scan,m_crtc.hend / 2);
+ hsync_time = machine().first_screen()->time_until_pos(scan,m_crtc.hend / 2);
m_scanline_timer->adjust(hsync_time);
if(scan != 0)
{
if((ioport("options")->read() & 0x04))
{
- machine().primary_screen->update_partial(scan);
+ machine().first_screen()->update_partial(scan);
}
}
}
@@ -216,18 +216,18 @@ TIMER_CALLBACK_MEMBER(x68k_state::x68k_hsync)
{
if(m_oddscanline == 1)
{
- int scan = machine().primary_screen->vpos();
+ int scan = machine().first_screen()->vpos();
if(scan > m_crtc.vend)
scan = m_crtc.vbegin;
else
scan++;
- hsync_time = machine().primary_screen->time_until_pos(scan,m_crtc.hbegin / 2);
+ hsync_time = machine().first_screen()->time_until_pos(scan,m_crtc.hbegin / 2);
m_scanline_timer->adjust(hsync_time, 1);
m_oddscanline = 0;
}
else
{
- hsync_time = machine().primary_screen->time_until_pos(machine().primary_screen->vpos(),(m_crtc.htotal + m_crtc.hbegin) / 2);
+ hsync_time = machine().first_screen()->time_until_pos(machine().first_screen()->vpos(),(m_crtc.htotal + m_crtc.hbegin) / 2);
m_scanline_timer->adjust(hsync_time, 1);
m_oddscanline = 1;
}
@@ -237,22 +237,22 @@ TIMER_CALLBACK_MEMBER(x68k_state::x68k_hsync)
{
if(hstate == 1)
{
- int scan = machine().primary_screen->vpos();
+ int scan = machine().first_screen()->vpos();
if(scan > m_crtc.vend)
scan = 0;
- hsync_time = machine().primary_screen->time_until_pos(scan,m_crtc.hend);
+ hsync_time = machine().first_screen()->time_until_pos(scan,m_crtc.hend);
m_scanline_timer->adjust(hsync_time);
if(scan != 0)
{
if((ioport("options")->read() & 0x04))
{
- machine().primary_screen->update_partial(scan);
+ machine().first_screen()->update_partial(scan);
}
}
}
if(hstate == 0)
{
- hsync_time = machine().primary_screen->time_until_pos(machine().primary_screen->vpos()+1,m_crtc.hbegin);
+ hsync_time = machine().first_screen()->time_until_pos(machine().first_screen()->vpos()+1,m_crtc.hbegin);
m_scanline_timer->adjust(hsync_time, 1);
}
}
@@ -272,13 +272,13 @@ TIMER_CALLBACK_MEMBER(x68k_state::x68k_crtc_raster_irq)
if(scan <= m_crtc.vtotal)
{
m_mfpdev->i6_w(0);
- machine().primary_screen->update_partial(scan);
- irq_time = machine().primary_screen->time_until_pos(scan,m_crtc.hbegin);
+ machine().first_screen()->update_partial(scan);
+ irq_time = machine().first_screen()->time_until_pos(scan,m_crtc.hbegin);
// end of HBlank period clears GPIP6 also?
- end_time = machine().primary_screen->time_until_pos(scan,m_crtc.hend);
+ end_time = machine().first_screen()->time_until_pos(scan,m_crtc.hend);
m_raster_irq->adjust(irq_time, scan);
timer_set(end_time, TIMER_X68K_CRTC_RASTER_END);
- logerror("GPIP6: Raster triggered at line %i (%i)\n",scan,machine().primary_screen->vpos());
+ logerror("GPIP6: Raster triggered at line %i (%i)\n",scan,machine().first_screen()->vpos());
}
}
@@ -292,7 +292,7 @@ TIMER_CALLBACK_MEMBER(x68k_state::x68k_crtc_vblank_irq)
{
m_crtc.vblank = 1;
vblank_line = m_crtc.vbegin;
- irq_time = machine().primary_screen->time_until_pos(vblank_line,2);
+ irq_time = machine().first_screen()->time_until_pos(vblank_line,2);
m_vblank_irq->adjust(irq_time);
logerror("CRTC: VBlank on\n");
}
@@ -302,7 +302,7 @@ TIMER_CALLBACK_MEMBER(x68k_state::x68k_crtc_vblank_irq)
vblank_line = m_crtc.vend;
if(vblank_line > m_crtc.vtotal)
vblank_line = m_crtc.vtotal;
- irq_time = machine().primary_screen->time_until_pos(vblank_line,2);
+ irq_time = machine().first_screen()->time_until_pos(vblank_line,2);
m_vblank_irq->adjust(irq_time, 1);
logerror("CRTC: VBlank off\n");
}
@@ -379,7 +379,7 @@ WRITE16_MEMBER(x68k_state::x68k_crtc_w )
case 9: // CRTC raster IRQ (GPIP6)
{
attotime irq_time;
- irq_time = machine().primary_screen->time_until_pos((data) / m_crtc.vmultiple,2);
+ irq_time = machine().first_screen()->time_until_pos((data) / m_crtc.vmultiple,2);
if(irq_time.as_double() > 0)
m_raster_irq->adjust(irq_time, (data) / m_crtc.vmultiple);
diff --git a/src/mess/video/zx.c b/src/mess/video/zx.c
index 12161fb615f..edf8e4f3786 100644
--- a/src/mess/video/zx.c
+++ b/src/mess/video/zx.c
@@ -58,8 +58,8 @@ void zx_state::zx_ula_bkgnd(UINT8 color)
rectangle r;
bitmap_ind16 &bitmap = m_bitmap;
- new_y = machine().primary_screen->vpos();
- new_x = machine().primary_screen->hpos();
+ new_y = machine().first_screen()->vpos();
+ new_x = machine().first_screen()->hpos();
/* logerror("zx_ula_bkgnd: %3d,%3d - %3d,%3d\n", state->m_old_x, state->m_old_y, new_x, new_y);*/
y = m_old_y;
for (;;)
@@ -109,7 +109,7 @@ TIMER_CALLBACK_MEMBER(zx_state::zx_ula_nmi)
bitmap_ind16 &bitmap = m_bitmap;
r.set(r1.min_x, r1.max_x, m_ula_scanline_count, m_ula_scanline_count);
bitmap.fill(1, r);
-// logerror("ULA %3d[%d] NMI, R:$%02X, $%04x\n", machine().primary_screen->vpos(), ula_scancode_count, (unsigned) m_maincpu->state_int(Z80_R), (unsigned) m_maincpu->state_int(Z80_PC));
+// logerror("ULA %3d[%d] NMI, R:$%02X, $%04x\n", machine().first_screen()->vpos(), ula_scancode_count, (unsigned) m_maincpu->state_int(Z80_R), (unsigned) m_maincpu->state_int(Z80_PC));
m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
if (++m_ula_scanline_count == height)
m_ula_scanline_count = 0;
@@ -124,7 +124,7 @@ TIMER_CALLBACK_MEMBER(zx_state::zx_ula_irq)
*/
if (m_ula_irq_active)
{
-// logerror("ULA %3d[%d] IRQ, R:$%02X, $%04x\n", machine().primary_screen->vpos(), ula_scancode_count, (unsigned) m_maincpu->state_int(Z80_R), (unsigned) m_maincpu->state_int(Z80_PC));
+// logerror("ULA %3d[%d] IRQ, R:$%02X, $%04x\n", machine().first_screen()->vpos(), ula_scancode_count, (unsigned) m_maincpu->state_int(Z80_R), (unsigned) m_maincpu->state_int(Z80_PC));
m_ula_irq_active = 0;
m_maincpu->set_input_line(0, HOLD_LINE);
diff --git a/src/osd/windows/d3dhlsl.c b/src/osd/windows/d3dhlsl.c
index b07300ab44e..4cdc1a4fea0 100644
--- a/src/osd/windows/d3dhlsl.c
+++ b/src/osd/windows/d3dhlsl.c
@@ -531,7 +531,7 @@ void shaders::begin_avi_recording(const char *name)
// build up information about this new movie
avi_movie_info info;
info.video_format = 0;
- info.video_timescale = 1000 * ((window->machine().primary_screen != NULL) ? ATTOSECONDS_TO_HZ(window->machine().primary_screen->frame_period().attoseconds) : screen_device::DEFAULT_FRAME_RATE);
+ info.video_timescale = 1000 * ((window->machine().first_screen() != NULL) ? ATTOSECONDS_TO_HZ(window->machine().first_screen()->frame_period().attoseconds) : screen_device::DEFAULT_FRAME_RATE);
info.video_sampletime = 1000;
info.video_numsamples = 0;
info.video_width = snap_width;