mirror of
https://github.com/holub/mame
synced 2025-07-01 00:09:18 +03:00
drivers of the spectrum family: removed MACHINE_*_MEMBER and VIDEO_START_MEMBER
This commit is contained in:
parent
0908f3a45d
commit
b0e5a62b47
@ -19,11 +19,11 @@ Not working because of banking issues.
|
||||
|
||||
namespace {
|
||||
|
||||
class atm_state : public spectrum_state
|
||||
class atm_state : public spectrum_128_state
|
||||
{
|
||||
public:
|
||||
atm_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: spectrum_state(mconfig, type, tag)
|
||||
: spectrum_128_state(mconfig, type, tag)
|
||||
, m_bank1(*this, "bank1")
|
||||
, m_bank2(*this, "bank2")
|
||||
, m_bank3(*this, "bank3")
|
||||
@ -35,7 +35,7 @@ public:
|
||||
void atmtb2(machine_config &config);
|
||||
|
||||
protected:
|
||||
DECLARE_MACHINE_RESET(atm);
|
||||
virtual void machine_reset() override;
|
||||
|
||||
private:
|
||||
void atm_port_7ffd_w(uint8_t data);
|
||||
@ -145,7 +145,7 @@ void atm_state::atm_switch(address_map &map)
|
||||
map(0x4000, 0xffff).r(FUNC(atm_state::beta_disable_r));
|
||||
}
|
||||
|
||||
MACHINE_RESET_MEMBER(atm_state, atm)
|
||||
void atm_state::machine_reset()
|
||||
{
|
||||
uint8_t *messram = m_ram->pointer();
|
||||
m_program = &m_maincpu->space(AS_PROGRAM);
|
||||
@ -199,8 +199,6 @@ void atm_state::atm(machine_config &config)
|
||||
m_maincpu->set_addrmap(AS_IO, &atm_state::atm_io);
|
||||
m_maincpu->set_addrmap(AS_OPCODES, &atm_state::atm_switch);
|
||||
|
||||
MCFG_MACHINE_RESET_OVERRIDE(atm_state, atm)
|
||||
|
||||
BETA_DISK(config, m_beta, 0);
|
||||
|
||||
subdevice<gfxdecode_device>("gfxdecode")->set_info(gfx_atm);
|
||||
|
@ -583,8 +583,6 @@ void elwro800_state::elwro800(machine_config &config)
|
||||
PALETTE(config, "palette", FUNC(elwro800_state::spectrum_palette), 16);
|
||||
GFXDECODE(config, "gfxdecode", "palette", gfx_elwro800);
|
||||
|
||||
MCFG_VIDEO_START_OVERRIDE(elwro800_state, spectrum)
|
||||
|
||||
UPD765A(config, "upd765", 8_MHz_XTAL / 2, true, true);
|
||||
|
||||
I8255A(config, m_i8255, 0);
|
||||
|
@ -14,11 +14,13 @@
|
||||
#include "formats/tzx_cas.h"
|
||||
|
||||
|
||||
class pentagon_state : public spectrum_state
|
||||
namespace {
|
||||
|
||||
class pentagon_state : public spectrum_128_state
|
||||
{
|
||||
public:
|
||||
pentagon_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: spectrum_state(mconfig, type, tag)
|
||||
: spectrum_128_state(mconfig, type, tag)
|
||||
, m_bank1(*this, "bank1")
|
||||
, m_bank2(*this, "bank2")
|
||||
, m_bank3(*this, "bank3")
|
||||
@ -29,6 +31,11 @@ public:
|
||||
void pent1024(machine_config &config);
|
||||
void pentagon(machine_config &config);
|
||||
|
||||
protected:
|
||||
virtual void machine_reset() override;
|
||||
virtual void video_start() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
|
||||
private:
|
||||
enum
|
||||
{
|
||||
@ -42,8 +49,6 @@ private:
|
||||
uint8_t beta_neutral_r(offs_t offset);
|
||||
uint8_t beta_enable_r(offs_t offset);
|
||||
uint8_t beta_disable_r(offs_t offset);
|
||||
DECLARE_MACHINE_RESET(pentagon);
|
||||
DECLARE_VIDEO_START(pentagon);
|
||||
INTERRUPT_GEN_MEMBER(pentagon_interrupt);
|
||||
TIMER_CALLBACK_MEMBER(irq_on);
|
||||
TIMER_CALLBACK_MEMBER(irq_off);
|
||||
@ -56,7 +61,6 @@ private:
|
||||
required_memory_bank m_bank3;
|
||||
required_memory_bank m_bank4;
|
||||
required_device<beta_disk_device> m_beta;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
|
||||
address_space *m_program;
|
||||
uint8_t *m_p_ram;
|
||||
@ -219,7 +223,7 @@ void pentagon_state::pentagon_switch(address_map &map)
|
||||
map(0x4000, 0xffff).r(FUNC(pentagon_state::beta_disable_r));
|
||||
}
|
||||
|
||||
MACHINE_RESET_MEMBER(pentagon_state,pentagon)
|
||||
void pentagon_state::machine_reset()
|
||||
{
|
||||
uint8_t *messram = m_ram->pointer();
|
||||
m_program = &m_maincpu->space(AS_PROGRAM);
|
||||
@ -246,7 +250,7 @@ MACHINE_RESET_MEMBER(pentagon_state,pentagon)
|
||||
pentagon_update_memory();
|
||||
}
|
||||
|
||||
VIDEO_START_MEMBER(pentagon_state,pentagon)
|
||||
void pentagon_state::video_start()
|
||||
{
|
||||
m_frame_invert_count = 16;
|
||||
m_frame_number = 0;
|
||||
@ -290,11 +294,9 @@ void pentagon_state::pentagon(machine_config &config)
|
||||
m_maincpu->set_addrmap(AS_IO, &pentagon_state::pentagon_io);
|
||||
m_maincpu->set_addrmap(AS_OPCODES, &pentagon_state::pentagon_switch);
|
||||
m_maincpu->set_vblank_int("screen", FUNC(pentagon_state::pentagon_interrupt));
|
||||
MCFG_MACHINE_RESET_OVERRIDE(pentagon_state, pentagon )
|
||||
|
||||
//m_screen->set_raw(XTAL(14'000'000) / 2, 448, 0, 352, 320, 0, 304);
|
||||
m_screen->set_raw(XTAL(14'000'000) / 2, 448, 0, 352, 320, 0, 287);
|
||||
MCFG_VIDEO_START_OVERRIDE(pentagon_state, pentagon )
|
||||
|
||||
BETA_DISK(config, m_beta, 0);
|
||||
subdevice<gfxdecode_device>("gfxdecode")->set_info(gfx_pentagon);
|
||||
@ -395,6 +397,9 @@ ROM_START(pent1024)
|
||||
ROMX_LOAD("gluk51.rom", 0x018000, 0x4000, CRC(ea8c760b) SHA1(adaab28066ca46fbcdcf084c3b53d5a1b82d94a9), ROM_BIOS(8))
|
||||
ROM_END
|
||||
|
||||
} // Anonymous namespace
|
||||
|
||||
|
||||
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS
|
||||
COMP( 1989, pentagon, spec128, 0, pentagon, spec_plus, pentagon_state, empty_init, "<unknown>", "Pentagon", 0 )
|
||||
COMP( 19??, pent1024, spec128, 0, pent1024, spec_plus, pentagon_state, empty_init, "<unknown>", "Pentagon 1024", 0 )
|
||||
|
@ -12,11 +12,13 @@
|
||||
#include "formats/tzx_cas.h"
|
||||
|
||||
|
||||
class scorpion_state : public spectrum_state
|
||||
namespace {
|
||||
|
||||
class scorpion_state : public spectrum_128_state
|
||||
{
|
||||
public:
|
||||
scorpion_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: spectrum_state(mconfig, type, tag)
|
||||
: spectrum_128_state(mconfig, type, tag)
|
||||
, m_bank1(*this, "bank1")
|
||||
, m_bank2(*this, "bank2")
|
||||
, m_bank3(*this, "bank3")
|
||||
@ -28,6 +30,9 @@ public:
|
||||
void profi(machine_config &config);
|
||||
void quorum(machine_config &config);
|
||||
|
||||
protected:
|
||||
virtual void machine_reset() override;
|
||||
|
||||
private:
|
||||
uint8_t beta_neutral_r(offs_t offset);
|
||||
uint8_t beta_enable_r(offs_t offset);
|
||||
@ -35,8 +40,6 @@ private:
|
||||
void scorpion_0000_w(offs_t offset, uint8_t data);
|
||||
void scorpion_port_7ffd_w(uint8_t data);
|
||||
void scorpion_port_1ffd_w(uint8_t data);
|
||||
DECLARE_MACHINE_START(scorpion);
|
||||
DECLARE_MACHINE_RESET(scorpion);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(nmi_check_callback);
|
||||
|
||||
void scorpion_io(address_map &map);
|
||||
@ -209,7 +212,7 @@ void scorpion_state::scorpion_switch(address_map &map)
|
||||
map(0x4000, 0xffff).r(FUNC(scorpion_state::beta_disable_r));
|
||||
}
|
||||
|
||||
MACHINE_RESET_MEMBER(scorpion_state,scorpion)
|
||||
void scorpion_state::machine_reset()
|
||||
{
|
||||
uint8_t *messram = m_ram->pointer();
|
||||
m_program = &m_maincpu->space(AS_PROGRAM);
|
||||
@ -233,10 +236,6 @@ MACHINE_RESET_MEMBER(scorpion_state,scorpion)
|
||||
m_port_1ffd_data = 0;
|
||||
scorpion_update_memory();
|
||||
}
|
||||
MACHINE_START_MEMBER(scorpion_state,scorpion)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/* F4 Character Displayer */
|
||||
static const gfx_layout spectrum_charlayout =
|
||||
@ -300,8 +299,6 @@ void scorpion_state::scorpion(machine_config &config)
|
||||
m_maincpu->set_addrmap(AS_IO, &scorpion_state::scorpion_io);
|
||||
m_maincpu->set_addrmap(AS_OPCODES, &scorpion_state::scorpion_switch);
|
||||
|
||||
MCFG_MACHINE_START_OVERRIDE(scorpion_state, scorpion )
|
||||
MCFG_MACHINE_RESET_OVERRIDE(scorpion_state, scorpion )
|
||||
subdevice<gfxdecode_device>("gfxdecode")->set_info(gfx_scorpion);
|
||||
|
||||
BETA_DISK(config, m_beta, 0);
|
||||
@ -404,6 +401,9 @@ ROM_START( kay1024 )
|
||||
ROMX_LOAD( "kay1024s.rom", 0x010000, 0x10000, CRC(67351caa) SHA1(1d9c0606b380c000ca1dfa33f90a122ecf9df1f1), ROM_BIOS(2))
|
||||
ROM_END
|
||||
|
||||
} // Anonymous namespace
|
||||
|
||||
|
||||
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS
|
||||
COMP( 1994, scorpio, spec128, 0, scorpion, spec_plus, scorpion_state, empty_init, "Zonov and Co.", "Scorpion ZS-256", 0 )
|
||||
COMP( 1991, profi, spec128, 0, profi, spec_plus, scorpion_state, empty_init, "Kondor and Kramis", "Profi", MACHINE_NOT_WORKING )
|
||||
|
@ -165,7 +165,7 @@ resulting mess can be seen in the F4 viewer display.
|
||||
/****************************************************************************************************/
|
||||
/* Spectrum 128 specific functions */
|
||||
|
||||
uint8_t spectrum_state::spectrum_128_pre_opcode_fetch_r(offs_t offset)
|
||||
uint8_t spectrum_128_state::spectrum_128_pre_opcode_fetch_r(offs_t offset)
|
||||
{
|
||||
/* this allows expansion devices to act upon opcode fetches from MEM addresses
|
||||
for example, interface1 detection fetches requires fetches at 0008 / 0708 to
|
||||
@ -177,12 +177,12 @@ uint8_t spectrum_state::spectrum_128_pre_opcode_fetch_r(offs_t offset)
|
||||
return retval;
|
||||
}
|
||||
|
||||
void spectrum_state::spectrum_128_bank1_w(offs_t offset, uint8_t data)
|
||||
void spectrum_128_state::spectrum_128_bank1_w(offs_t offset, uint8_t data)
|
||||
{
|
||||
m_exp->mreq_w(offset, data);
|
||||
}
|
||||
|
||||
uint8_t spectrum_state::spectrum_128_bank1_r(offs_t offset)
|
||||
uint8_t spectrum_128_state::spectrum_128_bank1_r(offs_t offset)
|
||||
{
|
||||
uint8_t data;
|
||||
|
||||
@ -201,7 +201,7 @@ uint8_t spectrum_state::spectrum_128_bank1_r(offs_t offset)
|
||||
return data;
|
||||
}
|
||||
|
||||
void spectrum_state::spectrum_128_port_7ffd_w(offs_t offset, uint8_t data)
|
||||
void spectrum_128_state::spectrum_128_port_7ffd_w(offs_t offset, uint8_t data)
|
||||
{
|
||||
/* D0-D2: RAM page located at 0x0c000-0x0ffff */
|
||||
/* D3 - Screen select (screen 0 in ram page 5, screen 1 in ram page 7 */
|
||||
@ -224,7 +224,7 @@ void spectrum_state::spectrum_128_port_7ffd_w(offs_t offset, uint8_t data)
|
||||
m_exp->iorq_w(offset | 1, data);
|
||||
}
|
||||
|
||||
void spectrum_state::spectrum_128_update_memory()
|
||||
void spectrum_128_state::spectrum_128_update_memory()
|
||||
{
|
||||
uint8_t *messram = m_ram->pointer();
|
||||
|
||||
@ -239,37 +239,37 @@ void spectrum_state::spectrum_128_update_memory()
|
||||
m_screen_location = messram + (5<<14);
|
||||
}
|
||||
|
||||
uint8_t spectrum_state::spectrum_128_ula_r()
|
||||
uint8_t spectrum_128_state::spectrum_128_ula_r()
|
||||
{
|
||||
int vpos = m_screen->vpos();
|
||||
|
||||
return vpos<193 ? m_screen_location[0x1800|(vpos&0xf8)<<2]:0xff;
|
||||
}
|
||||
|
||||
void spectrum_state::spectrum_128_io(address_map &map)
|
||||
void spectrum_128_state::spectrum_128_io(address_map &map)
|
||||
{
|
||||
map(0x0000, 0xffff).rw(m_exp, FUNC(spectrum_expansion_slot_device::iorq_r), FUNC(spectrum_expansion_slot_device::iorq_w));
|
||||
map(0x0000, 0x0000).rw(FUNC(spectrum_state::spectrum_port_fe_r), FUNC(spectrum_state::spectrum_port_fe_w)).select(0xfffe);
|
||||
map(0x0001, 0x0001).w(FUNC(spectrum_state::spectrum_128_port_7ffd_w)).select(0x7ffc); // (A15 | A1) == 0, note: reading from this port does write to it by value from data bus
|
||||
map(0x0000, 0x0000).rw(FUNC(spectrum_128_state::spectrum_port_fe_r), FUNC(spectrum_128_state::spectrum_port_fe_w)).select(0xfffe);
|
||||
map(0x0001, 0x0001).w(FUNC(spectrum_128_state::spectrum_128_port_7ffd_w)).select(0x7ffc); // (A15 | A1) == 0, note: reading from this port does write to it by value from data bus
|
||||
map(0x8000, 0x8000).w("ay8912", FUNC(ay8910_device::data_w)).mirror(0x3ffd);
|
||||
map(0xc000, 0xc000).rw("ay8912", FUNC(ay8910_device::data_r), FUNC(ay8910_device::address_w)).mirror(0x3ffd);
|
||||
map(0x0001, 0x0001).r(FUNC(spectrum_state::spectrum_128_ula_r)); // .mirror(0xfffe);
|
||||
map(0x0001, 0x0001).r(FUNC(spectrum_128_state::spectrum_128_ula_r)); // .mirror(0xfffe);
|
||||
}
|
||||
|
||||
void spectrum_state::spectrum_128_mem(address_map &map)
|
||||
void spectrum_128_state::spectrum_128_mem(address_map &map)
|
||||
{
|
||||
map(0x0000, 0x3fff).rw(FUNC(spectrum_state::spectrum_128_bank1_r), FUNC(spectrum_state::spectrum_128_bank1_w));
|
||||
map(0x0000, 0x3fff).rw(FUNC(spectrum_128_state::spectrum_128_bank1_r), FUNC(spectrum_128_state::spectrum_128_bank1_w));
|
||||
map(0x4000, 0x7fff).bankrw("bank2");
|
||||
map(0x8000, 0xbfff).bankrw("bank3");
|
||||
map(0xc000, 0xffff).bankrw("bank4");
|
||||
}
|
||||
|
||||
void spectrum_state::spectrum_128_fetch(address_map &map)
|
||||
void spectrum_128_state::spectrum_128_fetch(address_map &map)
|
||||
{
|
||||
map(0x0000, 0xffff).r(FUNC(spectrum_state::spectrum_128_pre_opcode_fetch_r));
|
||||
map(0x0000, 0xffff).r(FUNC(spectrum_128_state::spectrum_128_pre_opcode_fetch_r));
|
||||
}
|
||||
|
||||
MACHINE_RESET_MEMBER(spectrum_state,spectrum_128)
|
||||
void spectrum_128_state::machine_reset()
|
||||
{
|
||||
uint8_t *messram = m_ram->pointer();
|
||||
|
||||
@ -282,7 +282,7 @@ MACHINE_RESET_MEMBER(spectrum_state,spectrum_128)
|
||||
/* Bank 2 is always in 0x8000 - 0xbfff */
|
||||
membank("bank3")->set_base(messram + (2<<14));
|
||||
|
||||
MACHINE_RESET_CALL_MEMBER(spectrum);
|
||||
spectrum_state::machine_reset();
|
||||
|
||||
/* set initial ram config */
|
||||
m_port_7ffd_data = 0;
|
||||
@ -309,23 +309,20 @@ static GFXDECODE_START( spec128 )
|
||||
GFXDECODE_END
|
||||
|
||||
|
||||
void spectrum_state::spectrum_128(machine_config &config)
|
||||
void spectrum_128_state::spectrum_128(machine_config &config)
|
||||
{
|
||||
spectrum(config);
|
||||
|
||||
Z80(config.replace(), m_maincpu, X1_128_SINCLAIR / 5);
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &spectrum_state::spectrum_128_mem);
|
||||
m_maincpu->set_addrmap(AS_IO, &spectrum_state::spectrum_128_io);
|
||||
m_maincpu->set_addrmap(AS_OPCODES, &spectrum_state::spectrum_128_fetch);
|
||||
m_maincpu->set_vblank_int("screen", FUNC(spectrum_state::spec_interrupt));
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &spectrum_128_state::spectrum_128_mem);
|
||||
m_maincpu->set_addrmap(AS_IO, &spectrum_128_state::spectrum_128_io);
|
||||
m_maincpu->set_addrmap(AS_OPCODES, &spectrum_128_state::spectrum_128_fetch);
|
||||
m_maincpu->set_vblank_int("screen", FUNC(spectrum_128_state::spec_interrupt));
|
||||
config.set_maximum_quantum(attotime::from_hz(60));
|
||||
|
||||
MCFG_MACHINE_RESET_OVERRIDE(spectrum_state, spectrum_128 )
|
||||
|
||||
/* video hardware */
|
||||
m_screen->set_raw(X1_128_SINCLAIR / 2.5, 456, 0, 352, 311, 0, 296);
|
||||
|
||||
MCFG_VIDEO_START_OVERRIDE(spectrum_state, spectrum_128 )
|
||||
subdevice<gfxdecode_device>("gfxdecode")->set_info(spec128);
|
||||
|
||||
/* sound hardware */
|
||||
@ -394,8 +391,8 @@ ROM_START(hc2000)
|
||||
ROMX_LOAD("hc2000.v2", 0x14000,0x4000, CRC(65d90464) SHA1(5e2096e6460ff2120c8ada97579fdf82c1199c09), ROM_BIOS(1))
|
||||
ROM_END
|
||||
|
||||
// YEAR NAME PARENT COMPAT MACHINE CLASS STATE INIT COMPANY FULLNAME FLAGS
|
||||
COMP( 1986, spec128, 0, 0, spectrum_128, spec128, spectrum_state, empty_init, "Sinclair Research Ltd", "ZX Spectrum 128", 0 )
|
||||
COMP( 1986, specpls2, spec128, 0, spectrum_128, spec_plus, spectrum_state, empty_init, "Amstrad plc", "ZX Spectrum +2", 0 )
|
||||
COMP( 1991, hc128, spec128, 0, spectrum_128, spec_plus, spectrum_state, empty_init, "ICE-Felix", "HC-128", 0 )
|
||||
COMP( 1992, hc2000, spec128, 0, spectrum_128, spec_plus, spectrum_state, empty_init, "ICE-Felix", "HC-2000", MACHINE_NOT_WORKING )
|
||||
// YEAR NAME PARENT COMPAT MACHINE CLASS STATE INIT COMPANY FULLNAME FLAGS
|
||||
COMP( 1986, spec128, 0, 0, spectrum_128, spec128, spectrum_128_state, empty_init, "Sinclair Research Ltd", "ZX Spectrum 128", 0 )
|
||||
COMP( 1986, specpls2, spec128, 0, spectrum_128, spec_plus, spectrum_128_state, empty_init, "Amstrad plc", "ZX Spectrum +2", 0 )
|
||||
COMP( 1991, hc128, spec128, 0, spectrum_128, spec_plus, spectrum_128_state, empty_init, "ICE-Felix", "HC-128", 0 )
|
||||
COMP( 1992, hc2000, spec128, 0, spectrum_128, spec_plus, spectrum_128_state, empty_init, "ICE-Felix", "HC-2000", MACHINE_NOT_WORKING )
|
||||
|
@ -355,12 +355,12 @@ void specpls3_state::plus3_mem(address_map &map)
|
||||
map(0xc000, 0xffff).bankrw("bank4");
|
||||
}
|
||||
|
||||
MACHINE_RESET_MEMBER(specpls3_state,spectrum_plus3)
|
||||
void specpls3_state::machine_reset()
|
||||
{
|
||||
uint8_t *messram = m_ram->pointer();
|
||||
memset(messram,0,128*1024);
|
||||
|
||||
MACHINE_RESET_CALL_MEMBER(spectrum);
|
||||
spectrum_state::machine_reset();
|
||||
|
||||
/* Initial configuration */
|
||||
m_port_7ffd_data = 0;
|
||||
@ -412,8 +412,6 @@ void specpls3_state::spectrum_plus2(machine_config &config)
|
||||
|
||||
subdevice<gfxdecode_device>("gfxdecode")->set_info(specpls3);
|
||||
|
||||
MCFG_MACHINE_RESET_OVERRIDE(specpls3_state, spectrum_plus3 )
|
||||
|
||||
SPECTRUM_EXPANSION_SLOT(config.replace(), m_exp, specpls3_expansion_devices, nullptr);
|
||||
m_exp->irq_handler().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
|
||||
m_exp->nmi_handler().set_inputline(m_maincpu, INPUT_LINE_NMI);
|
||||
|
@ -721,7 +721,7 @@ void spectrum_state::init_spectrum()
|
||||
m_specmem->space(AS_PROGRAM).install_ram(0x5b00, m_ram->size() + 0x3fff, m_ram->pointer() + 0x1b00);
|
||||
}
|
||||
|
||||
MACHINE_RESET_MEMBER(spectrum_state,spectrum)
|
||||
void spectrum_state::machine_reset()
|
||||
{
|
||||
m_port_7ffd_data = -1;
|
||||
m_port_1ffd_data = -1;
|
||||
@ -784,8 +784,6 @@ void spectrum_state::spectrum_common(machine_config &config)
|
||||
config.set_perfect_quantum(m_maincpu);
|
||||
#endif
|
||||
|
||||
MCFG_MACHINE_RESET_OVERRIDE(spectrum_state, spectrum )
|
||||
|
||||
/* video hardware */
|
||||
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
|
||||
m_screen->set_raw(X1 / 2, 448, 0, 352, 312, 0, 296);
|
||||
@ -796,8 +794,6 @@ void spectrum_state::spectrum_common(machine_config &config)
|
||||
PALETTE(config, "palette", FUNC(spectrum_state::spectrum_palette), 16);
|
||||
GFXDECODE(config, "gfxdecode", "palette", gfx_spectrum);
|
||||
|
||||
MCFG_VIDEO_START_OVERRIDE(spectrum_state, spectrum)
|
||||
|
||||
/* sound hardware */
|
||||
SPEAKER(config, "mono").front_center();
|
||||
SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 0.50);
|
||||
|
@ -165,23 +165,23 @@ http://www.z88forever.org.uk/zxplus3e/
|
||||
/* TS2048 specific functions */
|
||||
|
||||
|
||||
uint8_t timex_state::ts2068_port_f4_r()
|
||||
uint8_t ts2068_state::port_f4_r()
|
||||
{
|
||||
return m_port_f4_data;
|
||||
}
|
||||
|
||||
void timex_state::ts2068_port_f4_w(uint8_t data)
|
||||
void ts2068_state::port_f4_w(uint8_t data)
|
||||
{
|
||||
m_port_f4_data = data;
|
||||
ts2068_update_memory();
|
||||
}
|
||||
|
||||
uint8_t timex_state::ts2068_port_ff_r()
|
||||
uint8_t tc2048_state::port_ff_r()
|
||||
{
|
||||
return m_port_ff_data;
|
||||
}
|
||||
|
||||
void timex_state::ts2068_port_ff_w(offs_t offset, uint8_t data)
|
||||
void ts2068_state::port_ff_w(offs_t offset, uint8_t data)
|
||||
{
|
||||
/* Bits 0-2 Video Mode Select
|
||||
Bits 3-5 64 column mode ink/paper selection
|
||||
@ -212,7 +212,7 @@ void timex_state::ts2068_port_ff_w(offs_t offset, uint8_t data)
|
||||
* at the same time.
|
||||
*
|
||||
*******************************************************************/
|
||||
void timex_state::ts2068_update_memory()
|
||||
void ts2068_state::ts2068_update_memory()
|
||||
{
|
||||
uint8_t *messram = nullptr;
|
||||
if (m_ram) messram = m_ram->pointer();
|
||||
@ -525,16 +525,16 @@ void timex_state::ts2068_update_memory()
|
||||
}
|
||||
}
|
||||
|
||||
void timex_state::ts2068_io(address_map &map)
|
||||
void ts2068_state::ts2068_io(address_map &map)
|
||||
{
|
||||
map(0xf4, 0xf4).rw(FUNC(timex_state::ts2068_port_f4_r), FUNC(timex_state::ts2068_port_f4_w)).mirror(0xff00);
|
||||
map(0xf4, 0xf4).rw(FUNC(ts2068_state::port_f4_r), FUNC(ts2068_state::port_f4_w)).mirror(0xff00);
|
||||
map(0xf5, 0xf5).w("ay8912", FUNC(ay8910_device::address_w)).mirror(0xff00);
|
||||
map(0xf6, 0xf6).rw("ay8912", FUNC(ay8910_device::data_r), FUNC(ay8910_device::data_w)).mirror(0xff00);
|
||||
map(0xfe, 0xfe).rw(FUNC(timex_state::spectrum_port_fe_r), FUNC(timex_state::spectrum_port_fe_w)).select(0xff00);
|
||||
map(0xff, 0xff).rw(FUNC(timex_state::ts2068_port_ff_r), FUNC(timex_state::ts2068_port_ff_w)).mirror(0xff00);
|
||||
map(0xfe, 0xfe).rw(FUNC(ts2068_state::spectrum_port_fe_r), FUNC(ts2068_state::spectrum_port_fe_w)).select(0xff00);
|
||||
map(0xff, 0xff).rw(FUNC(ts2068_state::port_ff_r), FUNC(ts2068_state::port_ff_w)).mirror(0xff00);
|
||||
}
|
||||
|
||||
void timex_state::ts2068_mem(address_map &map)
|
||||
void ts2068_state::ts2068_mem(address_map &map)
|
||||
{
|
||||
map(0x0000, 0x1fff).bankr("bank1").bankw("bank9");
|
||||
map(0x2000, 0x3fff).bankr("bank2").bankw("bank10");
|
||||
@ -547,7 +547,7 @@ void timex_state::ts2068_mem(address_map &map)
|
||||
}
|
||||
|
||||
|
||||
MACHINE_RESET_MEMBER(timex_state,ts2068)
|
||||
void ts2068_state::machine_reset()
|
||||
{
|
||||
m_port_ff_data = 0;
|
||||
m_port_f4_data = 0;
|
||||
@ -557,7 +557,7 @@ MACHINE_RESET_MEMBER(timex_state,ts2068)
|
||||
m_dock_cart_type = m_dock_crt ? TIMEX_CART_DOCK : TIMEX_CART_NONE;
|
||||
|
||||
ts2068_update_memory();
|
||||
MACHINE_RESET_CALL_MEMBER(spectrum);
|
||||
spectrum_state::machine_reset();
|
||||
}
|
||||
|
||||
|
||||
@ -565,25 +565,25 @@ MACHINE_RESET_MEMBER(timex_state,ts2068)
|
||||
/* TC2048 specific functions */
|
||||
|
||||
|
||||
void timex_state::tc2048_port_ff_w(offs_t offset, uint8_t data)
|
||||
void tc2048_state::port_ff_w(offs_t offset, uint8_t data)
|
||||
{
|
||||
m_port_ff_data = data;
|
||||
logerror("Port %04x write %02x\n", offset, data);
|
||||
}
|
||||
|
||||
void timex_state::tc2048_io(address_map &map)
|
||||
void tc2048_state::tc2048_io(address_map &map)
|
||||
{
|
||||
map(0x00, 0x00).rw(FUNC(timex_state::spectrum_port_fe_r), FUNC(timex_state::spectrum_port_fe_w)).select(0xfffe);
|
||||
map(0xff, 0xff).rw(FUNC(timex_state::ts2068_port_ff_r), FUNC(timex_state::tc2048_port_ff_w)).mirror(0xff00);
|
||||
map(0x00, 0x00).rw(FUNC(tc2048_state::spectrum_port_fe_r), FUNC(tc2048_state::spectrum_port_fe_w)).select(0xfffe);
|
||||
map(0xff, 0xff).rw(FUNC(tc2048_state::port_ff_r), FUNC(tc2048_state::port_ff_w)).mirror(0xff00);
|
||||
}
|
||||
|
||||
void timex_state::tc2048_mem(address_map &map)
|
||||
void tc2048_state::tc2048_mem(address_map &map)
|
||||
{
|
||||
map(0x0000, 0x3fff).rom();
|
||||
map(0x4000, 0xffff).bankr("bank1").bankw("bank2");
|
||||
}
|
||||
|
||||
MACHINE_RESET_MEMBER(timex_state,tc2048)
|
||||
void tc2048_state::machine_reset()
|
||||
{
|
||||
uint8_t *messram = m_ram->pointer();
|
||||
|
||||
@ -591,11 +591,11 @@ MACHINE_RESET_MEMBER(timex_state,tc2048)
|
||||
membank("bank2")->set_base(messram);
|
||||
m_port_ff_data = 0;
|
||||
m_port_f4_data = -1;
|
||||
MACHINE_RESET_CALL_MEMBER(spectrum);
|
||||
spectrum_state::machine_reset();
|
||||
}
|
||||
|
||||
|
||||
DEVICE_IMAGE_LOAD_MEMBER( timex_state::cart_load )
|
||||
DEVICE_IMAGE_LOAD_MEMBER( ts2068_state::cart_load )
|
||||
{
|
||||
uint32_t size = m_dock->common_get_size("rom");
|
||||
|
||||
@ -686,34 +686,30 @@ static GFXDECODE_START( gfx_ts2068 )
|
||||
GFXDECODE_ENTRY( "maincpu", 0x13d00, ts2068_charlayout, 0, 8 )
|
||||
GFXDECODE_END
|
||||
|
||||
void timex_state::ts2068(machine_config &config)
|
||||
void ts2068_state::ts2068(machine_config &config)
|
||||
{
|
||||
spectrum_128(config);
|
||||
|
||||
Z80(config.replace(), m_maincpu, XTAL(14'112'000)/4); /* From Schematic; 3.528 MHz */
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &timex_state::ts2068_mem);
|
||||
m_maincpu->set_addrmap(AS_IO, &timex_state::ts2068_io);
|
||||
m_maincpu->set_vblank_int("screen", FUNC(timex_state::spec_interrupt));
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &ts2068_state::ts2068_mem);
|
||||
m_maincpu->set_addrmap(AS_IO, &ts2068_state::ts2068_io);
|
||||
m_maincpu->set_vblank_int("screen", FUNC(ts2068_state::spec_interrupt));
|
||||
config.set_maximum_quantum(attotime::from_hz(60));
|
||||
|
||||
MCFG_MACHINE_RESET_OVERRIDE(timex_state, ts2068 )
|
||||
|
||||
/* video hardware */
|
||||
m_screen->set_refresh_hz(60);
|
||||
m_screen->set_size(TS2068_SCREEN_WIDTH, TS2068_SCREEN_HEIGHT);
|
||||
m_screen->set_visarea(0, TS2068_SCREEN_WIDTH-1, 0, TS2068_SCREEN_HEIGHT-1);
|
||||
m_screen->set_screen_update(FUNC(timex_state::screen_update_ts2068));
|
||||
m_screen->screen_vblank().set(FUNC(timex_state::screen_vblank_timex));
|
||||
m_screen->set_screen_update(FUNC(ts2068_state::screen_update));
|
||||
m_screen->screen_vblank().set(FUNC(ts2068_state::screen_vblank_timex));
|
||||
|
||||
subdevice<gfxdecode_device>("gfxdecode")->set_info(gfx_ts2068);
|
||||
|
||||
MCFG_VIDEO_START_OVERRIDE(timex_state, ts2068 )
|
||||
|
||||
/* sound */
|
||||
AY8912(config.replace(), "ay8912", XTAL(14'112'000)/8).add_route(ALL_OUTPUTS, "mono", 0.25); /* From Schematic; 1.764 MHz */
|
||||
|
||||
/* cartridge */
|
||||
GENERIC_CARTSLOT(config, "dockslot", generic_plain_slot, "timex_cart", "dck,bin").set_device_load(FUNC(timex_state::cart_load));
|
||||
GENERIC_CARTSLOT(config, "dockslot", generic_plain_slot, "timex_cart", "dck,bin").set_device_load(FUNC(ts2068_state::cart_load));
|
||||
|
||||
/* Software lists */
|
||||
SOFTWARE_LIST(config, "cart_list").set_original("timex_dock");
|
||||
@ -724,29 +720,25 @@ void timex_state::ts2068(machine_config &config)
|
||||
}
|
||||
|
||||
|
||||
void timex_state::uk2086(machine_config &config)
|
||||
void ts2068_state::uk2086(machine_config &config)
|
||||
{
|
||||
ts2068(config);
|
||||
m_screen->set_refresh_hz(50);
|
||||
}
|
||||
|
||||
|
||||
void timex_state::tc2048(machine_config &config)
|
||||
void tc2048_state::tc2048(machine_config &config)
|
||||
{
|
||||
spectrum(config);
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &timex_state::tc2048_mem);
|
||||
m_maincpu->set_addrmap(AS_IO, &timex_state::tc2048_io);
|
||||
|
||||
MCFG_MACHINE_RESET_OVERRIDE(timex_state, tc2048 )
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &tc2048_state::tc2048_mem);
|
||||
m_maincpu->set_addrmap(AS_IO, &tc2048_state::tc2048_io);
|
||||
|
||||
/* video hardware */
|
||||
m_screen->set_refresh_hz(50);
|
||||
m_screen->set_size(TS2068_SCREEN_WIDTH, SPEC_SCREEN_HEIGHT);
|
||||
m_screen->set_visarea(0, TS2068_SCREEN_WIDTH-1, 0, SPEC_SCREEN_HEIGHT-1);
|
||||
m_screen->set_screen_update(FUNC(timex_state::screen_update_tc2048));
|
||||
m_screen->screen_vblank().set(FUNC(timex_state::screen_vblank_timex));
|
||||
|
||||
MCFG_VIDEO_START_OVERRIDE(timex_state, spectrum_128 )
|
||||
m_screen->set_screen_update(FUNC(tc2048_state::screen_update));
|
||||
m_screen->screen_vblank().set(FUNC(tc2048_state::screen_vblank_timex));
|
||||
|
||||
/* internal ram */
|
||||
m_ram->set_default_size("48K");
|
||||
@ -781,6 +773,6 @@ ROM_START(uk2086)
|
||||
ROM_END
|
||||
|
||||
// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS
|
||||
COMP( 1984, tc2048, spectrum, 0, tc2048, spectrum, timex_state, empty_init, "Timex of Portugal", "TC-2048" , 0 )
|
||||
COMP( 1983, ts2068, spectrum, 0, ts2068, spectrum, timex_state, empty_init, "Timex Sinclair", "TS-2068" , 0 )
|
||||
COMP( 1986, uk2086, spectrum, 0, uk2086, spectrum, timex_state, empty_init, "Unipolbrit", "UK-2086 ver. 1.2" , 0 )
|
||||
COMP( 1984, tc2048, spectrum, 0, tc2048, spectrum, tc2048_state, empty_init, "Timex of Portugal", "TC-2048" , 0 )
|
||||
COMP( 1983, ts2068, spectrum, 0, ts2068, spectrum, ts2068_state, empty_init, "Timex Sinclair", "TS-2068" , 0 )
|
||||
COMP( 1986, uk2086, spectrum, 0, uk2086, spectrum, ts2068_state, empty_init, "Unipolbrit", "UK-2086 ver. 1.2" , 0 )
|
||||
|
@ -17,11 +17,11 @@
|
||||
|
||||
INPUT_PORTS_EXTERN( spec_plus );
|
||||
|
||||
class specpls3_state : public spectrum_state
|
||||
class specpls3_state : public spectrum_128_state
|
||||
{
|
||||
public:
|
||||
specpls3_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
spectrum_state(mconfig, type, tag),
|
||||
spectrum_128_state(mconfig, type, tag),
|
||||
m_upd765(*this, "upd765"),
|
||||
m_flop(*this, "upd765:%u", 0U)
|
||||
{ }
|
||||
@ -29,6 +29,10 @@ public:
|
||||
void spectrum_plus2(machine_config &config);
|
||||
void spectrum_plus3(machine_config &config);
|
||||
|
||||
protected:
|
||||
virtual void machine_reset() override;
|
||||
virtual void plus3_update_memory() override;
|
||||
|
||||
private:
|
||||
void bank1_w(offs_t offset, uint8_t data);
|
||||
uint8_t bank1_r(offs_t offset);
|
||||
@ -39,10 +43,6 @@ private:
|
||||
void port_1ffd_w(uint8_t data);
|
||||
void plus3_us_w(uint8_t data);
|
||||
|
||||
DECLARE_MACHINE_RESET(spectrum_plus3);
|
||||
|
||||
virtual void plus3_update_memory() override;
|
||||
|
||||
void plus3_io(address_map &map);
|
||||
void plus3_mem(address_map &map);
|
||||
|
||||
|
@ -96,11 +96,18 @@ public:
|
||||
void spectrum_common(machine_config &config);
|
||||
void spectrum(machine_config &config);
|
||||
void spectrum_clone(machine_config &config);
|
||||
void spectrum_128(machine_config &config);
|
||||
|
||||
void init_spectrum();
|
||||
|
||||
protected:
|
||||
virtual void machine_reset() override;
|
||||
virtual void video_start() override;
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
|
||||
// until machine/spec_snqk.cpp gets somehow disentangled
|
||||
virtual void plus3_update_memory() { }
|
||||
virtual void spectrum_128_update_memory() { }
|
||||
virtual void ts2068_update_memory() { }
|
||||
|
||||
enum
|
||||
{
|
||||
@ -151,17 +158,7 @@ protected:
|
||||
uint8_t spectrum_port_ula_r(offs_t offset);
|
||||
uint8_t spectrum_clone_port_ula_r();
|
||||
|
||||
uint8_t spectrum_128_pre_opcode_fetch_r(offs_t offset);
|
||||
void spectrum_128_bank1_w(offs_t offset, uint8_t data);
|
||||
uint8_t spectrum_128_bank1_r(offs_t offset);
|
||||
void spectrum_128_port_7ffd_w(offs_t offset, uint8_t data);
|
||||
uint8_t spectrum_128_ula_r();
|
||||
|
||||
DECLARE_MACHINE_RESET(spectrum);
|
||||
DECLARE_VIDEO_START(spectrum);
|
||||
void spectrum_palette(palette_device &palette) const;
|
||||
DECLARE_VIDEO_START(spectrum_128);
|
||||
DECLARE_MACHINE_RESET(spectrum_128);
|
||||
uint32_t screen_update_spectrum(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
DECLARE_WRITE_LINE_MEMBER(screen_vblank_spectrum);
|
||||
INTERRUPT_GEN_MEMBER(spec_interrupt);
|
||||
@ -171,19 +168,12 @@ protected:
|
||||
unsigned int m_previous_screen_x, m_previous_screen_y;
|
||||
bitmap_ind16 m_screen_bitmap;
|
||||
|
||||
void spectrum_128_update_memory();
|
||||
virtual void plus3_update_memory() { }
|
||||
virtual void ts2068_update_memory() { }
|
||||
|
||||
DECLARE_SNAPSHOT_LOAD_MEMBER(snapshot_cb);
|
||||
DECLARE_QUICKLOAD_LOAD_MEMBER(quickload_cb);
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<screen_device> m_screen;
|
||||
|
||||
void spectrum_128_io(address_map &map);
|
||||
void spectrum_128_mem(address_map &map);
|
||||
void spectrum_128_fetch(address_map &map);
|
||||
void spectrum_io(address_map &map);
|
||||
void spectrum_clone_io(address_map &map);
|
||||
void spectrum_opcodes(address_map &map);
|
||||
@ -223,7 +213,6 @@ protected:
|
||||
void spectrum_UpdateScreenBitmap(bool eof = false);
|
||||
inline unsigned char get_display_color(unsigned char color, int invert);
|
||||
inline void spectrum_plot_pixel(bitmap_ind16 &bitmap, int x, int y, uint32_t color);
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
|
||||
|
||||
// snapshot helpers
|
||||
void update_paging();
|
||||
@ -252,8 +241,34 @@ protected:
|
||||
uint8_t floating_bus_r();
|
||||
};
|
||||
|
||||
class spectrum_128_state : public spectrum_state
|
||||
{
|
||||
public:
|
||||
spectrum_128_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
spectrum_state(mconfig, type, tag)
|
||||
{ }
|
||||
|
||||
/*----------- defined in drivers/spectrum.c -----------*/
|
||||
void spectrum_128(machine_config &config);
|
||||
|
||||
protected:
|
||||
virtual void video_start() override;
|
||||
virtual void machine_reset() override;
|
||||
|
||||
virtual void spectrum_128_update_memory() override;
|
||||
|
||||
private:
|
||||
uint8_t spectrum_128_pre_opcode_fetch_r(offs_t offset);
|
||||
void spectrum_128_bank1_w(offs_t offset, uint8_t data);
|
||||
uint8_t spectrum_128_bank1_r(offs_t offset);
|
||||
void spectrum_128_port_7ffd_w(offs_t offset, uint8_t data);
|
||||
uint8_t spectrum_128_ula_r();
|
||||
|
||||
void spectrum_128_io(address_map &map);
|
||||
void spectrum_128_mem(address_map &map);
|
||||
void spectrum_128_fetch(address_map &map);
|
||||
};
|
||||
|
||||
/*----------- defined in drivers/spectrum.cpp -----------*/
|
||||
|
||||
INPUT_PORTS_EXTERN( spectrum );
|
||||
INPUT_PORTS_EXTERN( spec128 );
|
||||
|
@ -26,59 +26,78 @@
|
||||
#define TS2068_RIGHT_BORDER 96 /* Number of right hand border pixels */
|
||||
#define TS2068_SCREEN_WIDTH (TS2068_LEFT_BORDER + TS2068_DISPLAY_XSIZE + TS2068_RIGHT_BORDER)
|
||||
|
||||
enum
|
||||
{
|
||||
TIMEX_CART_NONE,
|
||||
TIMEX_CART_DOCK,
|
||||
TIMEX_CART_EXROM,
|
||||
TIMEX_CART_HOME
|
||||
};
|
||||
|
||||
|
||||
class timex_state : public spectrum_state
|
||||
class tc2048_state : public spectrum_128_state
|
||||
{
|
||||
public:
|
||||
timex_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
spectrum_state(mconfig, type, tag),
|
||||
tc2048_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
spectrum_128_state(mconfig, type, tag)
|
||||
{
|
||||
}
|
||||
|
||||
void tc2048(machine_config &config);
|
||||
|
||||
protected:
|
||||
virtual void machine_reset() override;
|
||||
|
||||
uint8_t port_ff_r();
|
||||
DECLARE_WRITE_LINE_MEMBER(screen_vblank_timex);
|
||||
|
||||
void hires_scanline(bitmap_ind16 &bitmap, int y, int borderlines);
|
||||
void _64col_scanline(bitmap_ind16 &bitmap, int y, int borderlines, unsigned short inkcolor);
|
||||
void lores_scanline(bitmap_ind16 &bitmap, int y, int borderlines, int screen);
|
||||
|
||||
private:
|
||||
void port_ff_w(offs_t offset, uint8_t data);
|
||||
|
||||
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
void tc2048_io(address_map &map);
|
||||
void tc2048_mem(address_map &map);
|
||||
|
||||
inline void spectrum_plot_pixel(bitmap_ind16 &bitmap, int x, int y, uint32_t color);
|
||||
};
|
||||
|
||||
class ts2068_state : public tc2048_state
|
||||
{
|
||||
public:
|
||||
ts2068_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
tc2048_state(mconfig, type, tag),
|
||||
m_dock(*this, "dockslot")
|
||||
{
|
||||
}
|
||||
|
||||
void ts2068(machine_config &config);
|
||||
void uk2086(machine_config &config);
|
||||
void tc2048(machine_config &config);
|
||||
|
||||
protected:
|
||||
virtual void machine_reset() override;
|
||||
virtual void video_start() override;
|
||||
|
||||
virtual void ts2068_update_memory() override;
|
||||
|
||||
private:
|
||||
uint8_t ts2068_port_f4_r();
|
||||
void ts2068_port_f4_w(uint8_t data);
|
||||
uint8_t ts2068_port_ff_r();
|
||||
void ts2068_port_ff_w(offs_t offset, uint8_t data);
|
||||
void tc2048_port_ff_w(offs_t offset, uint8_t data);
|
||||
enum
|
||||
{
|
||||
TIMEX_CART_NONE,
|
||||
TIMEX_CART_DOCK,
|
||||
TIMEX_CART_EXROM,
|
||||
TIMEX_CART_HOME
|
||||
};
|
||||
|
||||
DECLARE_MACHINE_RESET(tc2048);
|
||||
DECLARE_MACHINE_RESET(ts2068);
|
||||
DECLARE_VIDEO_START(ts2068);
|
||||
uint32_t screen_update_tc2048(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
uint32_t screen_update_ts2068(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
DECLARE_WRITE_LINE_MEMBER(screen_vblank_timex);
|
||||
uint8_t port_f4_r();
|
||||
void port_f4_w(uint8_t data);
|
||||
void port_ff_w(offs_t offset, uint8_t data);
|
||||
|
||||
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||
|
||||
DECLARE_DEVICE_IMAGE_LOAD_MEMBER(cart_load);
|
||||
int m_dock_cart_type, m_ram_chunks;
|
||||
memory_region *m_dock_crt;
|
||||
|
||||
virtual void ts2068_update_memory() override;
|
||||
|
||||
void tc2048_io(address_map &map);
|
||||
void tc2048_mem(address_map &map);
|
||||
void ts2068_io(address_map &map);
|
||||
void ts2068_mem(address_map &map);
|
||||
|
||||
optional_device<generic_slot_device> m_dock;
|
||||
|
||||
inline void spectrum_plot_pixel(bitmap_ind16 &bitmap, int x, int y, uint32_t color);
|
||||
void ts2068_hires_scanline(bitmap_ind16 &bitmap, int y, int borderlines);
|
||||
void ts2068_64col_scanline(bitmap_ind16 &bitmap, int y, int borderlines, unsigned short inkcolor);
|
||||
void ts2068_lores_scanline(bitmap_ind16 &bitmap, int y, int borderlines, int screen);
|
||||
required_device<generic_slot_device> m_dock;
|
||||
};
|
||||
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
// copyright-holders:Kevin Thacker
|
||||
/***************************************************************************
|
||||
|
||||
spectrum.c
|
||||
spectrum.cpp
|
||||
|
||||
Functions to emulate the video hardware of the ZX Spectrum.
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
/***************************************************************************
|
||||
Start the video hardware emulation.
|
||||
***************************************************************************/
|
||||
VIDEO_START_MEMBER(spectrum_state,spectrum)
|
||||
void spectrum_state::video_start()
|
||||
{
|
||||
m_frame_invert_count = 16;
|
||||
m_frame_number = 0;
|
||||
@ -44,7 +44,7 @@ VIDEO_START_MEMBER(spectrum_state,spectrum)
|
||||
m_scanline_timer->adjust(m_maincpu->cycles_to_attotime(m_CyclesPerLine));
|
||||
}
|
||||
|
||||
VIDEO_START_MEMBER(spectrum_state,spectrum_128)
|
||||
void spectrum_128_state::video_start()
|
||||
{
|
||||
m_frame_invert_count = 16;
|
||||
m_frame_number = 0;
|
||||
|
@ -20,13 +20,13 @@
|
||||
#include "includes/timex.h"
|
||||
#include "machine/ram.h"
|
||||
|
||||
inline void timex_state::spectrum_plot_pixel(bitmap_ind16 &bitmap, int x, int y, uint32_t color)
|
||||
inline void tc2048_state::spectrum_plot_pixel(bitmap_ind16 &bitmap, int x, int y, uint32_t color)
|
||||
{
|
||||
bitmap.pix(y, x) = (uint16_t)color;
|
||||
}
|
||||
|
||||
/* Update FLASH status for ts2068. Assumes flash update every 1/2s. */
|
||||
VIDEO_START_MEMBER(timex_state,ts2068)
|
||||
void ts2068_state::video_start()
|
||||
{
|
||||
m_frame_invert_count = 30;
|
||||
|
||||
@ -45,7 +45,7 @@ VIDEO_START_MEMBER(timex_state,ts2068)
|
||||
m_irq_off_timer = timer_alloc(TIMER_IRQ_OFF);
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(timex_state::screen_vblank_timex)
|
||||
WRITE_LINE_MEMBER(tc2048_state::screen_vblank_timex)
|
||||
{
|
||||
// rising edge
|
||||
if (state)
|
||||
@ -86,7 +86,7 @@ WRITE_LINE_MEMBER(timex_state::screen_vblank_timex)
|
||||
*******************************************************************/
|
||||
|
||||
/* Draw a scanline in TS2068/TC2048 hires mode (code modified from COUPE.C) */
|
||||
void timex_state::ts2068_hires_scanline(bitmap_ind16 &bitmap, int y, int borderlines)
|
||||
void tc2048_state::hires_scanline(bitmap_ind16 &bitmap, int y, int borderlines)
|
||||
{
|
||||
int x,b,scrx,scry;
|
||||
unsigned short ink,pap;
|
||||
@ -131,7 +131,7 @@ void timex_state::ts2068_hires_scanline(bitmap_ind16 &bitmap, int y, int borderl
|
||||
}
|
||||
|
||||
/* Draw a scanline in TS2068/TC2048 64-column mode */
|
||||
void timex_state::ts2068_64col_scanline(bitmap_ind16 &bitmap, int y, int borderlines, unsigned short inkcolor)
|
||||
void tc2048_state::_64col_scanline(bitmap_ind16 &bitmap, int y, int borderlines, unsigned short inkcolor)
|
||||
{
|
||||
int x,b,scrx,scry;
|
||||
unsigned char *scr1, *scr2;
|
||||
@ -165,7 +165,7 @@ void timex_state::ts2068_64col_scanline(bitmap_ind16 &bitmap, int y, int borderl
|
||||
}
|
||||
|
||||
/* Draw a scanline in TS2068/TC2048 lores (normal Spectrum) mode */
|
||||
void timex_state::ts2068_lores_scanline(bitmap_ind16 &bitmap, int y, int borderlines, int screen)
|
||||
void tc2048_state::lores_scanline(bitmap_ind16 &bitmap, int y, int borderlines, int screen)
|
||||
{
|
||||
int x,b,scrx,scry;
|
||||
unsigned short ink,pap;
|
||||
@ -209,7 +209,7 @@ void timex_state::ts2068_lores_scanline(bitmap_ind16 &bitmap, int y, int borderl
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t timex_state::screen_update_ts2068(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
uint32_t ts2068_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
/* for now TS2068 will do a full-refresh */
|
||||
int count;
|
||||
@ -222,33 +222,33 @@ uint32_t timex_state::screen_update_ts2068(screen_device &screen, bitmap_ind16 &
|
||||
/* 64 Column mode */
|
||||
unsigned short inkcolor = (m_port_ff_data & 0x38) >> 3;
|
||||
for (count = 0; count < 192; count++)
|
||||
ts2068_64col_scanline(bitmap, count, TS2068_TOP_BORDER, inkcolor);
|
||||
_64col_scanline(bitmap, count, TS2068_TOP_BORDER, inkcolor);
|
||||
}
|
||||
else if ((m_port_ff_data & 7) == 2)
|
||||
{
|
||||
/* Extended Color mode */
|
||||
for (count = 0; count < 192; count++)
|
||||
ts2068_hires_scanline(bitmap, count, TS2068_TOP_BORDER);
|
||||
hires_scanline(bitmap, count, TS2068_TOP_BORDER);
|
||||
}
|
||||
else if ((m_port_ff_data & 7) == 1)
|
||||
{
|
||||
/* Screen 6000-7aff */
|
||||
for (count = 0; count < 192; count++)
|
||||
ts2068_lores_scanline(bitmap, count, TS2068_TOP_BORDER, 1);
|
||||
lores_scanline(bitmap, count, TS2068_TOP_BORDER, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Screen 4000-5aff */
|
||||
for (count = 0; count < 192; count++)
|
||||
ts2068_lores_scanline(bitmap, count, TS2068_TOP_BORDER, 0);
|
||||
lores_scanline(bitmap, count, TS2068_TOP_BORDER, 0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t timex_state::screen_update_tc2048(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
uint32_t tc2048_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
{
|
||||
/* for now TS2068 will do a full-refresh */
|
||||
/* for now TC2048 will do a full-refresh */
|
||||
int count;
|
||||
|
||||
if (m_border_bitmap.valid())
|
||||
@ -259,25 +259,25 @@ uint32_t timex_state::screen_update_tc2048(screen_device &screen, bitmap_ind16 &
|
||||
/* 64 Column mode */
|
||||
unsigned short inkcolor = (m_port_ff_data & 0x38) >> 3;
|
||||
for (count = 0; count < 192; count++)
|
||||
ts2068_64col_scanline(bitmap, count, SPEC_TOP_BORDER, inkcolor);
|
||||
_64col_scanline(bitmap, count, SPEC_TOP_BORDER, inkcolor);
|
||||
}
|
||||
else if ((m_port_ff_data & 7) == 2)
|
||||
{
|
||||
/* Extended Color mode */
|
||||
for (count = 0; count < 192; count++)
|
||||
ts2068_hires_scanline(bitmap, count, SPEC_TOP_BORDER);
|
||||
hires_scanline(bitmap, count, SPEC_TOP_BORDER);
|
||||
}
|
||||
else if ((m_port_ff_data & 7) == 1)
|
||||
{
|
||||
/* Screen 6000-7aff */
|
||||
for (count = 0; count < 192; count++)
|
||||
ts2068_lores_scanline(bitmap, count, SPEC_TOP_BORDER, 1);
|
||||
lores_scanline(bitmap, count, SPEC_TOP_BORDER, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Screen 4000-5aff */
|
||||
for (count = 0; count < 192; count++)
|
||||
ts2068_lores_scanline(bitmap, count, SPEC_TOP_BORDER, 0);
|
||||
lores_scanline(bitmap, count, SPEC_TOP_BORDER, 0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user