mirror of
https://github.com/holub/mame
synced 2025-04-29 11:30:28 +03:00
hp1ll3, atarist, samcoupe: Replace first_screen with finders or device_video_interface (nw)
This commit is contained in:
parent
6b2708f8f6
commit
1b35f30c93
@ -183,7 +183,7 @@ void hp1ll3_device::device_start()
|
|||||||
// register for state saving
|
// register for state saving
|
||||||
save_item(NAME(m_conf));
|
save_item(NAME(m_conf));
|
||||||
|
|
||||||
machine().first_screen()->register_screen_bitmap(m_bitmap);
|
screen().register_screen_bitmap(m_bitmap);
|
||||||
|
|
||||||
m_cursor.allocate(16, 16);
|
m_cursor.allocate(16, 16);
|
||||||
m_sprite.allocate(16, 16);
|
m_sprite.allocate(16, 16);
|
||||||
|
@ -117,12 +117,11 @@ WRITE8_MEMBER(samcoupe_state::samcoupe_disk_w)
|
|||||||
|
|
||||||
READ8_MEMBER(samcoupe_state::samcoupe_pen_r)
|
READ8_MEMBER(samcoupe_state::samcoupe_pen_r)
|
||||||
{
|
{
|
||||||
screen_device *scr = machine().first_screen();
|
|
||||||
uint8_t data;
|
uint8_t data;
|
||||||
|
|
||||||
if (offset & 0x100)
|
if (offset & 0x100)
|
||||||
{
|
{
|
||||||
int vpos = scr->vpos();
|
int vpos = m_screen->vpos();
|
||||||
|
|
||||||
/* return the current screen line or 192 for the border area */
|
/* return the current screen line or 192 for the border area */
|
||||||
if (vpos < SAM_BORDER_TOP || vpos >= SAM_BORDER_TOP + SAM_SCREEN_HEIGHT)
|
if (vpos < SAM_BORDER_TOP || vpos >= SAM_BORDER_TOP + SAM_SCREEN_HEIGHT)
|
||||||
@ -133,7 +132,7 @@ READ8_MEMBER(samcoupe_state::samcoupe_pen_r)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* horizontal position is encoded into bits 3 to 8 */
|
/* horizontal position is encoded into bits 3 to 8 */
|
||||||
data = scr->hpos() & 0xfc;
|
data = m_screen->hpos() & 0xfc;
|
||||||
}
|
}
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include "machine/wd_fdc.h"
|
#include "machine/wd_fdc.h"
|
||||||
#include "sound/ay8910.h"
|
#include "sound/ay8910.h"
|
||||||
#include "sound/lmc1992.h"
|
#include "sound/lmc1992.h"
|
||||||
|
#include "screen.h"
|
||||||
|
|
||||||
#define M68000_TAG "m68000"
|
#define M68000_TAG "m68000"
|
||||||
#define HD6301V1_TAG "hd6301"
|
#define HD6301V1_TAG "hd6301"
|
||||||
@ -120,7 +121,8 @@ public:
|
|||||||
m_ikbd_mouse_pc(0),
|
m_ikbd_mouse_pc(0),
|
||||||
m_ikbd_joy(1),
|
m_ikbd_joy(1),
|
||||||
m_monochrome(1),
|
m_monochrome(1),
|
||||||
m_palette(*this, "palette")
|
m_palette(*this, "palette"),
|
||||||
|
m_screen(*this, "screen")
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
required_device<cpu_device> m_maincpu;
|
required_device<cpu_device> m_maincpu;
|
||||||
@ -333,6 +335,7 @@ public:
|
|||||||
|
|
||||||
int m_monochrome;
|
int m_monochrome;
|
||||||
required_device<palette_device> m_palette;
|
required_device<palette_device> m_palette;
|
||||||
|
required_device<screen_device> m_screen;
|
||||||
DECLARE_WRITE_LINE_MEMBER( write_monochrome );
|
DECLARE_WRITE_LINE_MEMBER( write_monochrome );
|
||||||
|
|
||||||
void st(machine_config &config);
|
void st(machine_config &config);
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
#include "machine/ram.h"
|
#include "machine/ram.h"
|
||||||
#include "machine/wd_fdc.h"
|
#include "machine/wd_fdc.h"
|
||||||
#include "sound/spkrdev.h"
|
#include "sound/spkrdev.h"
|
||||||
|
#include "screen.h"
|
||||||
|
|
||||||
/* screen dimensions */
|
/* screen dimensions */
|
||||||
#define SAM_BLOCK 8
|
#define SAM_BLOCK 8
|
||||||
@ -53,6 +54,7 @@ public:
|
|||||||
samcoupe_state(const machine_config &mconfig, device_type type, const char *tag)
|
samcoupe_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||||
: driver_device(mconfig, type, tag),
|
: driver_device(mconfig, type, tag),
|
||||||
m_maincpu(*this, "maincpu"),
|
m_maincpu(*this, "maincpu"),
|
||||||
|
m_screen(*this, "screen"),
|
||||||
m_speaker(*this, "speaker"),
|
m_speaker(*this, "speaker"),
|
||||||
m_cassette(*this, "cassette"),
|
m_cassette(*this, "cassette"),
|
||||||
m_lpt1(*this, "lpt1"),
|
m_lpt1(*this, "lpt1"),
|
||||||
@ -156,6 +158,7 @@ public:
|
|||||||
uint8_t* sam_bank_write_ptr[4];
|
uint8_t* sam_bank_write_ptr[4];
|
||||||
DECLARE_FLOPPY_FORMATS( floppy_formats );
|
DECLARE_FLOPPY_FORMATS( floppy_formats );
|
||||||
required_device<cpu_device> m_maincpu;
|
required_device<cpu_device> m_maincpu;
|
||||||
|
required_device<screen_device> m_screen;
|
||||||
required_device<speaker_sound_device> m_speaker;
|
required_device<speaker_sound_device> m_speaker;
|
||||||
required_device<cassette_image_device> m_cassette;
|
required_device<cassette_image_device> m_cassette;
|
||||||
required_device<centronics_device> m_lpt1;
|
required_device<centronics_device> m_lpt1;
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
|
|
||||||
#include "emu.h"
|
#include "emu.h"
|
||||||
#include "includes/samcoupe.h"
|
#include "includes/samcoupe.h"
|
||||||
#include "screen.h"
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
CONSTANTS
|
CONSTANTS
|
||||||
@ -297,7 +296,7 @@ void samcoupe_state::machine_start()
|
|||||||
|
|
||||||
/* schedule our video updates */
|
/* schedule our video updates */
|
||||||
m_video_update_timer = timer_alloc(TIMER_VIDEO_UPDATE);
|
m_video_update_timer = timer_alloc(TIMER_VIDEO_UPDATE);
|
||||||
m_video_update_timer->adjust(machine().first_screen()->time_until_pos(0, 0));
|
m_video_update_timer->adjust(m_screen->time_until_pos(0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
|
@ -15,10 +15,6 @@
|
|||||||
#include "video/atarist.h"
|
#include "video/atarist.h"
|
||||||
#include "includes/atarist.h"
|
#include "includes/atarist.h"
|
||||||
|
|
||||||
#include "cpu/m68000/m68000.h"
|
|
||||||
#include "machine/ram.h"
|
|
||||||
#include "screen.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//**************************************************************************
|
//**************************************************************************
|
||||||
@ -136,8 +132,8 @@ inline pen_t st_state::shift_mode_2()
|
|||||||
|
|
||||||
void st_state::shifter_tick()
|
void st_state::shifter_tick()
|
||||||
{
|
{
|
||||||
int y = machine().first_screen()->vpos();
|
int y = m_screen->vpos();
|
||||||
int x = machine().first_screen()->hpos();
|
int x = m_screen->hpos();
|
||||||
|
|
||||||
pen_t pen;
|
pen_t pen;
|
||||||
|
|
||||||
@ -201,8 +197,8 @@ void st_state::draw_pixel(int x, int y, u32 pen)
|
|||||||
|
|
||||||
void st_state::glue_tick()
|
void st_state::glue_tick()
|
||||||
{
|
{
|
||||||
int y = machine().first_screen()->vpos();
|
int y = m_screen->vpos();
|
||||||
int x = machine().first_screen()->hpos();
|
int x = m_screen->hpos();
|
||||||
|
|
||||||
int v = (y >= m_shifter_y_start) && (y < m_shifter_y_end);
|
int v = (y >= m_shifter_y_start) && (y < m_shifter_y_end);
|
||||||
int h = (x >= m_shifter_x_start) && (x < m_shifter_x_end);
|
int h = (x >= m_shifter_x_start) && (x < m_shifter_x_end);
|
||||||
@ -1077,10 +1073,10 @@ void st_state::video_start()
|
|||||||
m_shifter_timer = timer_alloc(TIMER_SHIFTER_TICK);
|
m_shifter_timer = timer_alloc(TIMER_SHIFTER_TICK);
|
||||||
m_glue_timer = timer_alloc(TIMER_GLUE_TICK);
|
m_glue_timer = timer_alloc(TIMER_GLUE_TICK);
|
||||||
|
|
||||||
// m_shifter_timer->adjust(machine().first_screen()->time_until_pos(0), 0, attotime::from_hz(Y2/4)); // 125 ns
|
// m_shifter_timer->adjust(m_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
|
m_glue_timer->adjust(m_screen->time_until_pos(0), 0, attotime::from_hz(Y2/16)); // 500 ns
|
||||||
|
|
||||||
machine().first_screen()->register_screen_bitmap(m_bitmap);
|
m_screen->register_screen_bitmap(m_bitmap);
|
||||||
|
|
||||||
/* register for state saving */
|
/* register for state saving */
|
||||||
save_item(NAME(m_shifter_base));
|
save_item(NAME(m_shifter_base));
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
|
|
||||||
#include "emu.h"
|
#include "emu.h"
|
||||||
#include "includes/samcoupe.h"
|
#include "includes/samcoupe.h"
|
||||||
#include "screen.h"
|
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
@ -29,7 +28,7 @@
|
|||||||
|
|
||||||
void samcoupe_state::video_start()
|
void samcoupe_state::video_start()
|
||||||
{
|
{
|
||||||
machine().first_screen()->register_screen_bitmap(m_bitmap);
|
m_screen->register_screen_bitmap(m_bitmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t samcoupe_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
uint32_t samcoupe_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||||
@ -124,8 +123,8 @@ void samcoupe_state::draw_mode1_line(int y, int hpos)
|
|||||||
|
|
||||||
TIMER_CALLBACK_MEMBER(samcoupe_state::sam_video_update_callback)
|
TIMER_CALLBACK_MEMBER(samcoupe_state::sam_video_update_callback)
|
||||||
{
|
{
|
||||||
int vpos = machine().first_screen()->vpos();
|
int vpos = m_screen->vpos();
|
||||||
int hpos = machine().first_screen()->hpos();
|
int hpos = m_screen->hpos();
|
||||||
|
|
||||||
int next_vpos = vpos;
|
int next_vpos = vpos;
|
||||||
int next_hpos = hpos + SAM_BLOCK*2;
|
int next_hpos = hpos + SAM_BLOCK*2;
|
||||||
@ -168,5 +167,5 @@ TIMER_CALLBACK_MEMBER(samcoupe_state::sam_video_update_callback)
|
|||||||
samcoupe_irq(SAM_LINE_INT);
|
samcoupe_irq(SAM_LINE_INT);
|
||||||
|
|
||||||
/* schedule next update */
|
/* schedule next update */
|
||||||
m_video_update_timer->adjust(machine().first_screen()->time_until_pos(next_vpos, next_hpos));
|
m_video_update_timer->adjust(m_screen->time_until_pos(next_vpos, next_hpos));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user