mirror of
https://github.com/holub/mame
synced 2025-04-25 17:56:43 +03:00
Merge pull request #546 from ajrhacker/liberatr
liberatr: fully disentangle from atarigen, fix typo
This commit is contained in:
commit
d373bc6505
@ -15,7 +15,7 @@
|
||||
Liberator Memory Map (for the main set, the other one is rearranged)
|
||||
(from the schematics/manual)
|
||||
|
||||
HEX R/W D7 D6 D5 D4 D3 D2 D2 D0 function
|
||||
HEX R/W D7 D6 D5 D4 D3 D2 D1 D0 function
|
||||
---------+-----+------------------------+------------------------
|
||||
0000 D D D D D D D D XCOORD
|
||||
0001 D D D D D D D D YCOORD
|
||||
@ -144,7 +144,8 @@
|
||||
|
||||
void liberatr_state::machine_start()
|
||||
{
|
||||
atarigen_state::machine_start();
|
||||
save_item(NAME(m_earom_data));
|
||||
save_item(NAME(m_earom_control));
|
||||
|
||||
save_item(NAME(m_trackball_offset));
|
||||
save_item(NAME(m_ctrld));
|
||||
@ -152,6 +153,13 @@ void liberatr_state::machine_start()
|
||||
}
|
||||
|
||||
|
||||
void liberatr_state::machine_reset()
|
||||
{
|
||||
// reset the control latch on the EAROM
|
||||
m_earom->set_control(0, 1, 1, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
@ -208,6 +216,48 @@ READ8_MEMBER( liberatr_state::port0_r )
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Early raster EAROM interface
|
||||
*
|
||||
*************************************/
|
||||
|
||||
READ8_MEMBER( liberatr_state::earom_r )
|
||||
{
|
||||
// return data latched from previous clock
|
||||
return m_earom->data();
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER( liberatr_state::earom_w )
|
||||
{
|
||||
// remember the value written
|
||||
m_earom_data = data;
|
||||
|
||||
// output latch only enabled if control bit 2 is set
|
||||
if (m_earom_control & 4)
|
||||
m_earom->set_data(m_earom_data);
|
||||
|
||||
// always latch the address
|
||||
m_earom->set_address(offset);
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER( liberatr_state::earom_control_w )
|
||||
{
|
||||
// remember the control state
|
||||
m_earom_control = data;
|
||||
|
||||
// ensure ouput data is put on data lines prior to updating controls
|
||||
if (m_earom_control & 4)
|
||||
m_earom->set_data(m_earom_data);
|
||||
|
||||
// set the control lines; /CS2 is always held low
|
||||
m_earom->set_control(data & 8, 1, ~data & 4, data & 2, data & 1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Main CPU memory handlers
|
||||
|
@ -7,14 +7,18 @@
|
||||
*************************************************************************/
|
||||
|
||||
#include "cpu/m6502/m6502.h"
|
||||
#include "machine/atarigen.h"
|
||||
#include "machine/er2055.h"
|
||||
#include "sound/pokey.h"
|
||||
|
||||
class liberatr_state : public atarigen_state
|
||||
class liberatr_state : public driver_device
|
||||
{
|
||||
public:
|
||||
liberatr_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: atarigen_state(mconfig, type, tag),
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_earom(*this, "earom"),
|
||||
m_earom_data(0),
|
||||
m_earom_control(0),
|
||||
m_screen(*this, "screen"),
|
||||
m_base_ram(*this, "base_ram"),
|
||||
m_planet_frame(*this, "planet_frame"),
|
||||
m_planet_select(*this, "planet_select"),
|
||||
@ -35,11 +39,20 @@ public:
|
||||
|
||||
UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
|
||||
// early raster EAROM interface
|
||||
DECLARE_READ8_MEMBER( earom_r );
|
||||
DECLARE_WRITE8_MEMBER( earom_w );
|
||||
DECLARE_WRITE8_MEMBER( earom_control_w );
|
||||
|
||||
protected:
|
||||
virtual void machine_start() override;
|
||||
virtual void machine_reset() override;
|
||||
virtual void video_start() override;
|
||||
|
||||
virtual void update_interrupts() override { }
|
||||
// vector and early raster EAROM interface
|
||||
required_device<er2055_device> m_earom;
|
||||
UINT8 m_earom_data;
|
||||
UINT8 m_earom_control;
|
||||
|
||||
struct planet;
|
||||
|
||||
@ -48,6 +61,7 @@ protected:
|
||||
void draw_planet(bitmap_rgb32 &bitmap, pen_t *pens);
|
||||
void draw_bitmap(bitmap_rgb32 &bitmap, pen_t *pens);
|
||||
|
||||
required_device<screen_device> m_screen;
|
||||
required_shared_ptr<UINT8> m_base_ram;
|
||||
required_shared_ptr<UINT8> m_planet_frame;
|
||||
required_shared_ptr<UINT8> m_planet_select;
|
||||
|
@ -951,9 +951,6 @@ machine_config_constructor atari_eeprom_2816_device::device_mconfig_additions()
|
||||
|
||||
atarigen_state::atarigen_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_earom(*this, "earom"),
|
||||
m_earom_data(0),
|
||||
m_earom_control(0),
|
||||
m_scanline_int_state(0),
|
||||
m_sound_int_state(0),
|
||||
m_video_int_state(0),
|
||||
@ -1004,9 +1001,6 @@ void atarigen_state::machine_start()
|
||||
save_item(NAME(m_slapstic_last_address));
|
||||
|
||||
save_item(NAME(m_scanlines_per_callback));
|
||||
|
||||
save_item(NAME(m_earom_data));
|
||||
save_item(NAME(m_earom_control));
|
||||
}
|
||||
|
||||
|
||||
@ -1015,10 +1009,6 @@ void atarigen_state::machine_reset()
|
||||
// reset the interrupt states
|
||||
m_video_int_state = m_sound_int_state = m_scanline_int_state = 0;
|
||||
|
||||
// reset the control latch on the EAROM, if present
|
||||
if (m_earom != nullptr)
|
||||
m_earom->set_control(0, 1, 1, 0, 0);
|
||||
|
||||
// reset the slapstic
|
||||
if (m_slapstic_num != 0)
|
||||
{
|
||||
@ -1465,43 +1455,3 @@ void atarigen_state::blend_gfx(int gfx0, int gfx1, int mask0, int mask1)
|
||||
// free the second graphics element
|
||||
m_gfxdecode->set_gfx(gfx1, nullptr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// VECTOR AND EARLY RASTER EAROM INTERFACE
|
||||
//**************************************************************************
|
||||
|
||||
READ8_MEMBER( atarigen_state::earom_r )
|
||||
{
|
||||
// return data latched from previous clock
|
||||
return m_earom->data();
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER( atarigen_state::earom_w )
|
||||
{
|
||||
// remember the value written
|
||||
m_earom_data = data;
|
||||
|
||||
// output latch only enabled if control bit 2 is set
|
||||
if (m_earom_control & 4)
|
||||
m_earom->set_data(m_earom_data);
|
||||
|
||||
// always latch the address
|
||||
m_earom->set_address(offset);
|
||||
}
|
||||
|
||||
|
||||
WRITE8_MEMBER( atarigen_state::earom_control_w )
|
||||
{
|
||||
// remember the control state
|
||||
m_earom_control = data;
|
||||
|
||||
// ensure ouput data is put on data lines prior to updating controls
|
||||
if (m_earom_control & 4)
|
||||
m_earom->set_data(m_earom_data);
|
||||
|
||||
// set the control lines; /CS2 is always held low
|
||||
m_earom->set_control(data & 8, 1, ~data & 4, data & 2, data & 1);
|
||||
}
|
||||
|
@ -11,8 +11,6 @@
|
||||
#ifndef __MACHINE_ATARIGEN__
|
||||
#define __MACHINE_ATARIGEN__
|
||||
|
||||
#include "machine/nvram.h"
|
||||
#include "machine/er2055.h"
|
||||
#include "machine/eeprompar.h"
|
||||
#include "video/atarimo.h"
|
||||
#include "cpu/m6502/m6502.h"
|
||||
@ -383,11 +381,6 @@ public:
|
||||
// misc helpers
|
||||
void blend_gfx(int gfx0, int gfx1, int mask0, int mask1);
|
||||
|
||||
// vector and early raster EAROM interface
|
||||
DECLARE_READ8_MEMBER( earom_r );
|
||||
DECLARE_WRITE8_MEMBER( earom_w );
|
||||
DECLARE_WRITE8_MEMBER( earom_control_w );
|
||||
|
||||
// timer IDs
|
||||
enum
|
||||
{
|
||||
@ -397,11 +390,6 @@ public:
|
||||
TID_ATARIGEN_LAST
|
||||
};
|
||||
|
||||
// vector and early raster EAROM interface
|
||||
optional_device<er2055_device> m_earom;
|
||||
UINT8 m_earom_data;
|
||||
UINT8 m_earom_control;
|
||||
|
||||
UINT8 m_scanline_int_state;
|
||||
UINT8 m_sound_int_state;
|
||||
UINT8 m_video_int_state;
|
||||
|
Loading…
Reference in New Issue
Block a user