diff options
Diffstat (limited to 'src/mame/drivers/einstein.cpp')
-rw-r--r-- | src/mame/drivers/einstein.cpp | 253 |
1 files changed, 24 insertions, 229 deletions
diff --git a/src/mame/drivers/einstein.cpp b/src/mame/drivers/einstein.cpp index 701253a1978..4a333745f5b 100644 --- a/src/mame/drivers/einstein.cpp +++ b/src/mame/drivers/einstein.cpp @@ -62,8 +62,6 @@ #include "machine/clock.h" #include "machine/z80pio.h" #include "sound/ay8910.h" - -#include "rendlay.h" #include "softlist.h" #include "speaker.h" @@ -71,87 +69,6 @@ #define VERBOSE_KEYBOARD 0 #define VERBOSE_DISK 0 -/*************************************************************************** - 80 COLUMN DEVICE -***************************************************************************/ - -/* lower 3 bits of address define a 256-byte "row". - * upper 8 bits define the offset in the row, - * data bits define data to write - */ -WRITE8_MEMBER(einstein_state::einstein_80col_ram_w) -{ - m_crtc_ram[((offset & 0x07) << 8) | ((offset >> 8) & 0xff)] = data; -} - -READ8_MEMBER(einstein_state::einstein_80col_ram_r) -{ - return m_crtc_ram[((offset & 0x07) << 8) | ((offset >> 8) & 0xff)]; -} - -/* TODO: Verify implementation */ -/* From traces of the TK02 board character ROM is addressed by the 6845 as follows - bit 0..2 ra0..ra2 - bit 3..10 data 0..7 from VRAM - bit 11 ra3 - bit 12 jumper M004, this could be used to select two different character - sets. -*/ -MC6845_UPDATE_ROW( einstein_state::crtc_update_row ) -{ - const rgb_t *palette = m_palette->palette()->entry_list_raw(); - uint8_t *data = m_region_gfx1->base(); - uint8_t char_code, data_byte; - int i, x; - - for (i = 0, x = 0; i < x_count; i++, x += 8) - { - char_code = m_crtc_ram[(ma + i) & 0x07ff]; - data_byte = data[(char_code << 3) + (ra & 0x07) + ((ra & 0x08) << 8)]; - - bitmap.pix32(y, x + 0) = palette[tms9928a_device::PALETTE_SIZE + BIT(data_byte, 7)]; - bitmap.pix32(y, x + 1) = palette[tms9928a_device::PALETTE_SIZE + BIT(data_byte, 6)]; - bitmap.pix32(y, x + 2) = palette[tms9928a_device::PALETTE_SIZE + BIT(data_byte, 5)]; - bitmap.pix32(y, x + 3) = palette[tms9928a_device::PALETTE_SIZE + BIT(data_byte, 4)]; - bitmap.pix32(y, x + 4) = palette[tms9928a_device::PALETTE_SIZE + BIT(data_byte, 3)]; - bitmap.pix32(y, x + 5) = palette[tms9928a_device::PALETTE_SIZE + BIT(data_byte, 2)]; - bitmap.pix32(y, x + 6) = palette[tms9928a_device::PALETTE_SIZE + BIT(data_byte, 1)]; - bitmap.pix32(y, x + 7) = palette[tms9928a_device::PALETTE_SIZE + BIT(data_byte, 0)]; - } -} - -WRITE_LINE_MEMBER(einstein_state::einstein_6845_de_changed) -{ - m_de=state; -} - -/* bit 0 - latched display enabled (DE) from 6845 - * bit 1 - Jumper M003 0 = 40 column mode (color monitor), 1 = 80 column mode (b/w monitor) - * bit 2 - Jumper M002 0 = 50Hz, 1 = 60Hz - * bit 3 - Jumper M001 0 = ???, 1=??? perminently wired high on both the boards I have seen - PHS. - */ -READ8_MEMBER(einstein_state::einstein_80col_state_r) -{ - uint8_t result = 0; - - result |= m_de; - result |= m_80column_dips->read() & 0x06; - - return result; -} - -/* int priority */ -/* keyboard int->ctc/adc->pio */ -static const z80_daisy_config einstein_daisy_chain[] = -{ - { "keyboard_daisy" }, - { IC_I058 }, - { "adc_daisy" }, - { IC_I063 }, - { "fire_daisy" }, - { nullptr } -}; - /*************************************************************************** KEYBOARD @@ -283,6 +200,18 @@ WRITE8_MEMBER(einstein_state::einstein_rom_w) INTERRUPTS ***************************************************************************/ +/* int priority */ +/* keyboard int->ctc/adc->pio */ +static const z80_daisy_config einstein_daisy_chain[] = +{ + { "keyboard_daisy" }, + { IC_I058 }, + { "adc_daisy" }, + { IC_I063 }, + { "fire_daisy" }, + { nullptr } +}; + WRITE_LINE_MEMBER(einstein_state::write_centronics_busy) { m_centronics_busy = state; @@ -382,13 +311,13 @@ WRITE8_MEMBER(einstein_state::einstein_fire_int_w) void einstein_state::machine_start() { + // setup expansion slot + m_pipe->set_program_space(&m_maincpu->space(AS_PROGRAM)); + m_pipe->set_io_space(&m_maincpu->space(AS_IO)); } void einstein_state::machine_reset() { - //device_t *floppy; - //uint8_t config = m_config->read(); - /* initialize memory mapping */ m_bank2->set_base(m_ram->pointer()); m_bank3->set_base(m_ram->pointer() + 0x8000); @@ -399,57 +328,6 @@ void einstein_state::machine_reset() to be set to 1, which causes all these to be DISABLED */ m_interrupt = 0; m_interrupt_mask = 0; - - /* configure floppy drives */ -/* floppy_type_t type_80 = FLOPPY_STANDARD_5_25_DSHD; - floppy_type_t type_40 = FLOPPY_STANDARD_5_25_SSDD_40; - floppy = machine().device("floppy0"); - floppy_drive_set_geometry(floppy, config & 0x01 ? type_80 : type_40); - floppy = machine().device("floppy1"); - floppy_drive_set_geometry(floppy, config & 0x02 ? type_80 : type_40); - floppy = machine().device("floppy2"); - floppy_drive_set_geometry(floppy, config & 0x04 ? type_80 : type_40); - floppy = machine().device("floppy3"); - floppy_drive_set_geometry(floppy, config & 0x08 ? type_80 : type_40);*/ -} - -MACHINE_RESET_MEMBER(einstein_state,einstein2) -{ - /* call standard initialization first */ - einstein_state::machine_reset(); - - /* 80 column card palette */ - m_palette->set_pen_color(tms9928a_device::PALETTE_SIZE, rgb_t::black()); - m_palette->set_pen_color(tms9928a_device::PALETTE_SIZE + 1, rgb_t(0, 224, 0)); -} - -MACHINE_START_MEMBER(einstein_state,einstein2) -{ - m_crtc_ram = std::make_unique<uint8_t[]>(2048); - memset(m_crtc_ram.get(), 0, sizeof(uint8_t) * 2048); - einstein_state::machine_start(); -} - - -/*************************************************************************** - VIDEO EMULATION -***************************************************************************/ - -uint32_t einstein_state::screen_update_einstein2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) -{ - if (&screen == m_color_screen) - { - bitmap_rgb32 &src = m_tms9929a->get_bitmap(); - for (int y = cliprect.min_y; y <= cliprect.max_y; y++) - for (int x = cliprect.min_x; x <= cliprect.max_x; x++) - bitmap.pix32(y, x) = src.pix32(y, x); - } - else if (&screen == m_crtc_screen) - m_mc6845->screen_update( screen, bitmap, cliprect); - else - fatalerror("Unknown screen '%s'\n", screen.tag()); - - return 0; } @@ -492,14 +370,6 @@ static ADDRESS_MAP_START( einstein_io, AS_IO, 8, einstein_state ) #endif ADDRESS_MAP_END -static ADDRESS_MAP_START( einstein2_io, AS_IO, 8, einstein_state ) - AM_IMPORT_FROM(einstein_io) - AM_RANGE(0x40, 0x47) AM_SELECT(0xff00) AM_READWRITE(einstein_80col_ram_r, einstein_80col_ram_w) - AM_RANGE(0x48, 0x48) AM_MIRROR(0xff00) AM_DEVWRITE("crtc", mc6845_device, address_w) - AM_RANGE(0x49, 0x49) AM_MIRROR(0xff00) AM_DEVWRITE("crtc", mc6845_device, register_w) - AM_RANGE(0x4c, 0x4c) AM_MIRROR(0xff00) AM_READ(einstein_80col_state_r) -ADDRESS_MAP_END - /*************************************************************************** INPUT PORTS @@ -629,43 +499,11 @@ static INPUT_PORTS_START( einstein ) PORT_CONFSETTING(0x08, "Double sided") INPUT_PORTS_END -static INPUT_PORTS_START( einstein_80col ) - PORT_INCLUDE(einstein) - - /* dip switches on the 80 column card */ - PORT_START("80column_dips") - PORT_DIPNAME(0x02, 0x00, "Startup mode") - PORT_DIPSETTING(0x00, "40 column") - PORT_DIPSETTING(0x02, "80 column") - PORT_DIPNAME(0x04, 0x00, "50/60Hz") - PORT_DIPSETTING(0x00, "50Hz") - PORT_DIPSETTING(0x04, "60Hz") -INPUT_PORTS_END - /*************************************************************************** MACHINE DRIVERS ***************************************************************************/ -/* F4 Character Displayer */ -static const gfx_layout einstei2_charlayout = -{ - 8, 10, /* 8 x 10 characters */ - 256, /* 256*2 characters */ - 1, /* 1 bits per pixel */ - { 0 }, - /* x offsets */ - { 0, 1, 2, 3, 4, 5, 6, 7 }, - /* y offsets */ - { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 0x800*8, 0x801*8 }, - 8*8 -}; - -static GFXDECODE_START( einstei2 ) - GFXDECODE_ENTRY( "gfx1", 0x0000, einstei2_charlayout, 16, 1 ) - GFXDECODE_ENTRY( "gfx1", 0x1000, einstei2_charlayout, 16, 1 ) -GFXDECODE_END - static SLOT_INTERFACE_START( einstein_floppies ) SLOT_INTERFACE( "525dd", FLOPPY_525_DD ) SLOT_INTERFACE_END @@ -705,9 +543,9 @@ static MACHINE_CONFIG_START( einstein ) /* video hardware */ MCFG_DEVICE_ADD( "tms9929a", TMS9929A, XTAL_10_738635MHz / 2 ) MCFG_TMS9928A_VRAM_SIZE(0x4000) /* 16k RAM, provided by IC i040 and i041 */ - MCFG_TMS9928A_SET_SCREEN( "screen" ) - MCFG_TMS9928A_SCREEN_ADD_PAL( "screen" ) - MCFG_SCREEN_UPDATE_DEVICE( "tms9929a", tms9929a_device, screen_update ) + MCFG_TMS9928A_SET_SCREEN("screen") + MCFG_TMS9928A_SCREEN_ADD_PAL("screen") + MCFG_SCREEN_UPDATE_DEVICE("tms9929a", tms9929a_device, screen_update) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") @@ -742,36 +580,9 @@ static MACHINE_CONFIG_START( einstein ) /* internal ram */ MCFG_RAM_ADD(RAM_TAG) MCFG_RAM_DEFAULT_SIZE("64K") -MACHINE_CONFIG_END - -static MACHINE_CONFIG_DERIVED( einstei2, einstein ) - - MCFG_CPU_MODIFY(IC_I001) - MCFG_CPU_IO_MAP(einstein2_io) - - MCFG_MACHINE_START_OVERRIDE(einstein_state,einstein2) - MCFG_MACHINE_RESET_OVERRIDE(einstein_state,einstein2) - - /* video hardware */ - MCFG_DEFAULT_LAYOUT(layout_dualhsxs) - - MCFG_SCREEN_ADD("80column", RASTER) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ - MCFG_SCREEN_SIZE(640, 400) - MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 400-1) - MCFG_SCREEN_REFRESH_RATE(50) - MCFG_SCREEN_UPDATE_DRIVER(einstein_state, screen_update_einstein2) - MCFG_GFXDECODE_ADD("gfxdecode", "palette", einstei2) - - /* 2 additional colors for the 80 column screen */ - MCFG_PALETTE_ADD("palette", tms9928a_device::PALETTE_SIZE + 2) - - MCFG_MC6845_ADD("crtc", MC6845, "80column", XTAL_X002 / 4) - MCFG_MC6845_SHOW_BORDER_AREA(false) - MCFG_MC6845_CHAR_WIDTH(8) - MCFG_MC6845_UPDATE_ROW_CB(einstein_state, crtc_update_row) - MCFG_MC6845_OUT_DE_CB(WRITELINE(einstein_state, einstein_6845_de_changed)) + // tatung pipe connector + MCFG_TATUNG_PIPE_ADD("pipe") MACHINE_CONFIG_END @@ -796,32 +607,16 @@ ROM_START( einstein ) ROM_FILL(0x4000, 0x4000, 0xff) ROM_END -ROM_START( einstei2 ) - ROM_REGION(0x8000, "bios", 0) - /* i023 */ - ROM_SYSTEM_BIOS(0, "mos12", "MOS 1.2") - ROMX_LOAD("mos12.i023", 0, 0x2000, CRC(ec134953) SHA1(a02125d8ebcda48aa784adbb42a8b2d7ef3a4b77), ROM_BIOS(1)) - ROM_SYSTEM_BIOS(1, "mos121", "MOS 1.21") - ROMX_LOAD("mos121.i023", 0, 0x2000, CRC(a746eeb6) SHA1(f75aaaa777d0fd92225acba291f6bf428b341d3e), ROM_BIOS(2)) - ROM_RELOAD(0x2000, 0x2000) - /* i024 */ - ROM_FILL(0x4000, 0x4000, 0xff) - - /* character rom from 80 column card */ - ROM_REGION(0x2000, "gfx1", 0) - ROM_LOAD("tk02-v1.00.rom", 0, 0x2000, CRC(ad3c4346) SHA1(cd57e630371b4d0314e3f15693753fb195c7257d)) -ROM_END - ROM_START( einst256 ) ROM_REGION(0x8000, "bios", 0) ROM_LOAD("tc256.rom", 0x0000, 0x4000, CRC(ef8dad88) SHA1(eb2102d3bef572db7161c26a7c68a5fcf457b4d0) ) ROM_END + /*************************************************************************** GAME DRIVERS ***************************************************************************/ -// YEAR NAME PARENT COMPAT MACHINE INPUT STATE INIT COMPANY FULLNAME FLAGS -COMP( 1984, einstein, 0, 0, einstein, einstein, einstein_state, 0, "Tatung", "Einstein TC-01", 0 ) -COMP( 1984, einstei2, einstein, 0, einstei2, einstein_80col, einstein_state, 0, "Tatung", "Einstein TC-01 + 80 column device", 0 ) -COMP( 1984, einst256, 0, 0, einstein, einstein, einstein_state, 0, "Tatung", "Einstein 256", MACHINE_NOT_WORKING ) +// YEAR NAME PARENT COMPAT MACHINE INPUT STATE INIT COMPANY FULLNAME FLAGS +COMP( 1984, einstein, 0, 0, einstein, einstein, einstein_state, 0, "Tatung", "Einstein TC-01", 0 ) +COMP( 1984, einst256, 0, 0, einstein, einstein, einstein_state, 0, "Tatung", "Einstein 256", MACHINE_NOT_WORKING ) |