mirror of
https://github.com/holub/mame
synced 2025-05-25 23:35:26 +03:00
(MESS) abc806: Video and save state cleanup. (nw)
This commit is contained in:
parent
3066f1e2c4
commit
c921326678
@ -260,7 +260,8 @@ public:
|
|||||||
m_rtc(*this, E0516_TAG),
|
m_rtc(*this, E0516_TAG),
|
||||||
m_rad_prom(*this, "rad"),
|
m_rad_prom(*this, "rad"),
|
||||||
m_hru2_prom(*this, "hru"),
|
m_hru2_prom(*this, "hru"),
|
||||||
m_char_rom(*this, MC6845_TAG)
|
m_char_rom(*this, MC6845_TAG),
|
||||||
|
m_attr_ram(*this, "attr_ram")
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
required_device<mc6845_device> m_crtc;
|
required_device<mc6845_device> m_crtc;
|
||||||
@ -268,6 +269,7 @@ public:
|
|||||||
required_memory_region m_rad_prom;
|
required_memory_region m_rad_prom;
|
||||||
required_memory_region m_hru2_prom;
|
required_memory_region m_hru2_prom;
|
||||||
required_memory_region m_char_rom;
|
required_memory_region m_char_rom;
|
||||||
|
optional_shared_ptr<UINT8> m_attr_ram;
|
||||||
|
|
||||||
DECLARE_DRIVER_INIT(driver_init);
|
DECLARE_DRIVER_INIT(driver_init);
|
||||||
virtual void machine_start();
|
virtual void machine_start();
|
||||||
@ -303,8 +305,6 @@ public:
|
|||||||
UINT8 m_map[16]; // memory page register
|
UINT8 m_map[16]; // memory page register
|
||||||
|
|
||||||
// video state
|
// video state
|
||||||
UINT8 *m_color_ram; // attribute RAM
|
|
||||||
|
|
||||||
int m_txoff; // text display enable
|
int m_txoff; // text display enable
|
||||||
int m_40; // 40/80 column mode
|
int m_40; // 40/80 column mode
|
||||||
int m_flshclk_ctr; // flash clock counter
|
int m_flshclk_ctr; // flash clock counter
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// these are needed because the MC6845 emulation does
|
|
||||||
// not position the active display area correctly
|
|
||||||
#define HORIZONTAL_PORCH_HACK 109
|
#define HORIZONTAL_PORCH_HACK 109
|
||||||
#define VERTICAL_PORCH_HACK 27
|
#define VERTICAL_PORCH_HACK 27
|
||||||
|
|
||||||
@ -82,7 +80,7 @@ WRITE8_MEMBER( abc806_state::hrc_w )
|
|||||||
|
|
||||||
READ8_MEMBER( abc806_state::charram_r )
|
READ8_MEMBER( abc806_state::charram_r )
|
||||||
{
|
{
|
||||||
m_attr_data = m_color_ram[offset];
|
m_attr_data = m_attr_ram[offset];
|
||||||
|
|
||||||
return m_char_ram[offset];
|
return m_char_ram[offset];
|
||||||
}
|
}
|
||||||
@ -94,7 +92,7 @@ READ8_MEMBER( abc806_state::charram_r )
|
|||||||
|
|
||||||
WRITE8_MEMBER( abc806_state::charram_w )
|
WRITE8_MEMBER( abc806_state::charram_w )
|
||||||
{
|
{
|
||||||
m_color_ram[offset] = m_attr_data;
|
m_attr_ram[offset] = m_attr_data;
|
||||||
|
|
||||||
m_char_ram[offset] = data;
|
m_char_ram[offset] = data;
|
||||||
}
|
}
|
||||||
@ -254,7 +252,7 @@ static MC6845_UPDATE_ROW( abc806_update_row )
|
|||||||
for (int column = 0; column < x_count; column++)
|
for (int column = 0; column < x_count; column++)
|
||||||
{
|
{
|
||||||
UINT8 data = state->m_char_ram[(ma + column) & 0x7ff];
|
UINT8 data = state->m_char_ram[(ma + column) & 0x7ff];
|
||||||
UINT8 attr = state->m_color_ram[(ma + column) & 0x7ff];
|
UINT8 attr = state->m_attr_ram[(ma + column) & 0x7ff];
|
||||||
UINT16 rad_addr;
|
UINT16 rad_addr;
|
||||||
UINT8 rad_data;
|
UINT8 rad_data;
|
||||||
|
|
||||||
@ -283,7 +281,7 @@ static MC6845_UPDATE_ROW( abc806_update_row )
|
|||||||
e6 = BIT(attr, 1);
|
e6 = BIT(attr, 1);
|
||||||
|
|
||||||
// read attributes from next byte
|
// read attributes from next byte
|
||||||
attr = state->m_color_ram[(ma + column + 1) & 0x7ff];
|
attr = state->m_attr_ram[(ma + column + 1) & 0x7ff];
|
||||||
|
|
||||||
if (attr != 0x00)
|
if (attr != 0x00)
|
||||||
{
|
{
|
||||||
@ -471,12 +469,9 @@ void abc806_state::video_start()
|
|||||||
|
|
||||||
// allocate memory
|
// allocate memory
|
||||||
m_char_ram.allocate(ABC806_CHAR_RAM_SIZE);
|
m_char_ram.allocate(ABC806_CHAR_RAM_SIZE);
|
||||||
m_color_ram = auto_alloc_array(machine(), UINT8, ABC806_ATTR_RAM_SIZE);
|
m_attr_ram.allocate(ABC806_ATTR_RAM_SIZE);
|
||||||
|
|
||||||
// register for state saving
|
// register for state saving
|
||||||
save_pointer(NAME(m_char_ram.target()), ABC806_CHAR_RAM_SIZE);
|
|
||||||
save_pointer(NAME(m_color_ram), ABC806_ATTR_RAM_SIZE);
|
|
||||||
save_pointer(NAME(m_video_ram.target()), ABC806_VIDEO_RAM_SIZE);
|
|
||||||
save_item(NAME(m_txoff));
|
save_item(NAME(m_txoff));
|
||||||
save_item(NAME(m_40));
|
save_item(NAME(m_40));
|
||||||
save_item(NAME(m_flshclk_ctr));
|
save_item(NAME(m_flshclk_ctr));
|
||||||
@ -499,9 +494,6 @@ void abc806_state::video_start()
|
|||||||
|
|
||||||
UINT32 abc806_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
|
UINT32 abc806_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
|
||||||
{
|
{
|
||||||
// HACK expand visible area to workaround MC6845
|
|
||||||
screen.set_visible_area(0, 767, 0, 311);
|
|
||||||
|
|
||||||
// clear screen
|
// clear screen
|
||||||
bitmap.fill(rgb_t::black, cliprect);
|
bitmap.fill(rgb_t::black, cliprect);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user