mirror of
https://github.com/holub/mame
synced 2025-07-03 17:08:39 +03:00
einstein: Added quickload option for .COM files.
This commit is contained in:
parent
d5a9abb048
commit
469e50bc20
@ -21,6 +21,7 @@
|
||||
#include "bus/rs232/rs232.h"
|
||||
#include "imagedev/cassette.h"
|
||||
#include "imagedev/floppy.h"
|
||||
#include "imagedev/snapquik.h"
|
||||
#include "machine/adc0844.h"
|
||||
#include "machine/i8251.h"
|
||||
#include "machine/ram.h"
|
||||
@ -100,6 +101,8 @@ public:
|
||||
|
||||
DECLARE_INPUT_CHANGED_MEMBER(joystick_button);
|
||||
|
||||
DECLARE_QUICKLOAD_LOAD_MEMBER(quickload_cb);
|
||||
|
||||
private:
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(keyboard_timer_callback);
|
||||
void keyboard_line_write(uint8_t data);
|
||||
@ -455,6 +458,9 @@ void einstein_state::machine_start()
|
||||
m_bank1->configure_entry(1, m_bios->base());
|
||||
m_bank2->set_base(m_ram->pointer());
|
||||
m_bank3->set_base(m_ram->pointer() + 0x8000);
|
||||
|
||||
// register save states
|
||||
save_item(NAME(m_rom_enabled));
|
||||
}
|
||||
|
||||
void einstein_state::machine_reset()
|
||||
@ -608,7 +614,7 @@ void einstein_state::einstein_mem(address_map &map)
|
||||
void einstein_state::einstein_io(address_map &map)
|
||||
{
|
||||
map.unmap_value_high();
|
||||
map(0x00, 0x00).mirror(0xff04).rw(FUNC(einstein_state::reset_r), FUNC(einstein_state::reset_w));
|
||||
map(0x00, 0x01).mirror(0xff04).rw(FUNC(einstein_state::reset_r), FUNC(einstein_state::reset_w));
|
||||
map(0x02, 0x02).mirror(0xff04).rw(m_psg, FUNC(ay8910_device::data_r), FUNC(ay8910_device::address_w));
|
||||
map(0x03, 0x03).mirror(0xff04).w(m_psg, FUNC(ay8910_device::data_w));
|
||||
map(0x08, 0x09).mirror(0xff06).rw("vdp", FUNC(tms9129_device::read), FUNC(tms9129_device::write));
|
||||
@ -627,7 +633,7 @@ void einstein_state::einstein_io(address_map &map)
|
||||
void einstein_state::einst256_io(address_map &map)
|
||||
{
|
||||
map.unmap_value_high();
|
||||
map(0x00, 0x00).mirror(0xff04).rw(FUNC(einstein_state::reset_r), FUNC(einstein_state::reset_w));
|
||||
map(0x00, 0x01).mirror(0xff04).rw(FUNC(einstein_state::reset_r), FUNC(einstein_state::reset_w));
|
||||
map(0x02, 0x02).mirror(0xff04).rw(m_psg, FUNC(ay8910_device::data_r), FUNC(ay8910_device::address_w));
|
||||
map(0x03, 0x03).mirror(0xff04).w(m_psg, FUNC(ay8910_device::data_w));
|
||||
map(0x08, 0x0b).mirror(0xff04).rw("v9938", FUNC(v9938_device::read), FUNC(v9938_device::write));
|
||||
@ -806,6 +812,38 @@ static INPUT_PORTS_START( einst256 )
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
QUICKLOAD
|
||||
***************************************************************************/
|
||||
|
||||
QUICKLOAD_LOAD_MEMBER(einstein_state::quickload_cb)
|
||||
{
|
||||
address_space& prog_space = m_maincpu->space(AS_PROGRAM);
|
||||
|
||||
if (quickload_size >= 0xfd00)
|
||||
return image_init_result::FAIL;
|
||||
|
||||
/* disable rom */
|
||||
m_rom_enabled = 0;
|
||||
m_bank1->set_entry(m_rom_enabled);
|
||||
|
||||
/* load image */
|
||||
for (uint16_t i = 0; i < quickload_size; i++)
|
||||
{
|
||||
uint8_t data;
|
||||
|
||||
if (image.fread(&data, 1) != 1)
|
||||
return image_init_result::FAIL;
|
||||
prog_space.write_byte(i + 0x100, data);
|
||||
}
|
||||
|
||||
/* start program */
|
||||
m_maincpu->set_pc(0x100);
|
||||
|
||||
return image_init_result::PASS;
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
MACHINE DRIVERS
|
||||
***************************************************************************/
|
||||
@ -889,19 +927,19 @@ void einstein_state::einstein(machine_config &config)
|
||||
|
||||
TIMER(config, m_strobe_timer).configure_generic(FUNC(einstein_state::strobe_callback));
|
||||
|
||||
// uart
|
||||
/* uart */
|
||||
i8251_device &ic_i060(I8251(config, IC_I060, XTAL_X002 / 4));
|
||||
ic_i060.txd_handler().set("rs232", FUNC(rs232_port_device::write_txd));
|
||||
ic_i060.rts_handler().set("rs232", FUNC(rs232_port_device::write_rts));
|
||||
ic_i060.dtr_handler().set("rs232", FUNC(rs232_port_device::write_dtr));
|
||||
|
||||
// rs232 port
|
||||
/* rs232 port */
|
||||
rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, nullptr));
|
||||
rs232.rxd_handler().set(IC_I060, FUNC(i8251_device::write_rxd));
|
||||
rs232.dsr_handler().set(IC_I060, FUNC(i8251_device::write_dsr));
|
||||
rs232.cts_handler().set(IC_I060, FUNC(i8251_device::write_cts));
|
||||
|
||||
// floppy
|
||||
/* floppy */
|
||||
WD1770(config, m_fdc, XTAL_X002);
|
||||
|
||||
FLOPPY_CONNECTOR(config, IC_I042 ":0", einstein_floppies, "3ss", floppy_image_device::default_floppy_formats).enable_sound(true);
|
||||
@ -912,17 +950,21 @@ void einstein_state::einstein(machine_config &config)
|
||||
/* software lists */
|
||||
SOFTWARE_LIST(config, "disk_list").set_original("einstein").set_filter("TC01");
|
||||
|
||||
quickload_image_device &quickload(QUICKLOAD(config, "quickload", "com", attotime::from_seconds(2)));
|
||||
quickload.set_load_callback(FUNC(einstein_state::quickload_cb));
|
||||
quickload.set_interface("einstein_quik");
|
||||
|
||||
/* RAM is provided by 8k DRAM ICs i009, i010, i011, i012, i013, i014, i015 and i016 */
|
||||
/* internal ram */
|
||||
RAM(config, RAM_TAG).set_default_size("64K");
|
||||
|
||||
// tatung pipe connector
|
||||
/* tatung pipe connector */
|
||||
TATUNG_PIPE(config, m_pipe, XTAL_X002 / 2, tatung_pipe_cards, nullptr);
|
||||
m_pipe->set_program_space(m_maincpu, AS_PROGRAM);
|
||||
m_pipe->set_io_space(m_maincpu, AS_IO);
|
||||
m_pipe->nmi_handler().set_inputline(IC_I001, INPUT_LINE_NMI);
|
||||
|
||||
// user port
|
||||
/* user port */
|
||||
EINSTEIN_USERPORT(config, "user").bstb_handler().set(IC_I063, FUNC(z80pio_device::strobe_b));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user