mirror of
https://github.com/holub/mame
synced 2025-06-06 21:03:47 +03:00
Removed SG-1000, nw
This commit is contained in:
parent
e4d30e722f
commit
d0186209e2
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -2569,7 +2569,6 @@ src/mame/drivers/sf.c svneol=native#text/plain
|
||||
src/mame/drivers/sfbonus.c svneol=native#text/plain
|
||||
src/mame/drivers/sfcbox.c svneol=native#text/plain
|
||||
src/mame/drivers/sfkick.c svneol=native#text/plain
|
||||
src/mame/drivers/sg1000.c svneol=native#text/plain
|
||||
src/mame/drivers/sg1000a.c svneol=native#text/plain
|
||||
src/mame/drivers/shadfrce.c svneol=native#text/plain
|
||||
src/mame/drivers/shangha3.c svneol=native#text/plain
|
||||
@ -3356,7 +3355,6 @@ src/mame/includes/senjyo.h svneol=native#text/plain
|
||||
src/mame/includes/seta.h svneol=native#text/plain
|
||||
src/mame/includes/seta2.h svneol=native#text/plain
|
||||
src/mame/includes/sf.h svneol=native#text/plain
|
||||
src/mame/includes/sg1000.h svneol=native#text/plain
|
||||
src/mame/includes/shadfrce.h svneol=native#text/plain
|
||||
src/mame/includes/shangha3.h svneol=native#text/plain
|
||||
src/mame/includes/shangkid.h svneol=native#text/plain
|
||||
|
@ -1,967 +0,0 @@
|
||||
/*
|
||||
|
||||
Sega SG-1000
|
||||
|
||||
PCB Layout
|
||||
----------
|
||||
|
||||
171-5078 (C) SEGA 1983
|
||||
171-5046 REV. A (C) SEGA 1983
|
||||
|
||||
|---------------------------| |----------------------------|
|
||||
| SW1 CN2 | |------|---------------| | SW2 CN4 |
|
||||
| |---| CN3 |---| |
|
||||
| CN1 CN5 |
|
||||
| |
|
||||
| 10.738635MHz |------------------------------| 7805 |
|
||||
| |---| |------------------------------| |
|
||||
| | | CN6 |
|
||||
| | 9 | |
|
||||
| | 9 | LS32 |
|
||||
| | 1 | |---------| |
|
||||
| | 8 | | TMM2009 | LS139 |
|
||||
| | A | |---------| |------------------| |
|
||||
| | | | Z80 | |
|
||||
| |---| |------------------| |
|
||||
| |
|
||||
| |
|
||||
| MB8118 MB8118 MB8118 MB8118 SN76489A SW3 |
|
||||
| MB8118 MB8118 MB8118 MB8118 LS257 LS257 |
|
||||
|---------------------------------------------------------------------------------------|
|
||||
|
||||
Notes:
|
||||
All IC's shown.
|
||||
|
||||
Z80 - NEC D780C-1 / Zilog Z8400A (REV.A) Z80A CPU @ 3.579545
|
||||
TMS9918A- Texas Instruments TMS9918ANL Video Display Processor @ 10.738635MHz
|
||||
MB8118 - Fujitsu MB8118-12 16K x 1 Dynamic RAM
|
||||
TMM2009 - Toshiba TMM2009P-A / TMM2009P-B (REV.A)
|
||||
SN76489A- Texas Instruments SN76489AN Digital Complex Sound Generator @ 3.579545
|
||||
CN1 - player 1 joystick connector
|
||||
CN2 - RF video connector
|
||||
CN3 - keyboard connector
|
||||
CN4 - power connector (+9VDC)
|
||||
CN5 - player 2 joystick connector
|
||||
CN6 - cartridge connector
|
||||
SW1 - TV channel select switch
|
||||
SW2 - power switch
|
||||
SW3 - hold switch
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
TODO:
|
||||
|
||||
- SC-3000 return instruction referenced by R when reading ports 60-7f,e0-ff
|
||||
- connect PSG /READY signal to Z80 WAIT
|
||||
- accurate video timing
|
||||
- SP-400 serial printer
|
||||
- SH-400 racing controller
|
||||
- SF-7000 serial comms
|
||||
|
||||
*/
|
||||
|
||||
#define ADDRESS_MAP_MODERN
|
||||
|
||||
#include "emu.h"
|
||||
#include "cpu/z80/z80.h"
|
||||
#include "imagedev/cartslot.h"
|
||||
#include "imagedev/cassette.h"
|
||||
#include "machine/ram.h"
|
||||
#include "imagedev/printer.h"
|
||||
#include "machine/ctronics.h"
|
||||
#include "machine/i8255.h"
|
||||
#include "sound/sn76496.h"
|
||||
#include "crsshair.h"
|
||||
#include "includes/sg1000.h"
|
||||
|
||||
/***************************************************************************
|
||||
READ/WRITE HANDLERS
|
||||
***************************************************************************/
|
||||
|
||||
/*
|
||||
|
||||
Terebi Oekaki (TV Draw)
|
||||
|
||||
Address Access Bits
|
||||
7 6 5 4 3 2 1 0
|
||||
$6000 W - - - - - - - AXIS
|
||||
$8000 R BUSY - - - - - - PRESS
|
||||
$A000 R/W DATA
|
||||
|
||||
AXIS: write 0 to select X axis, 1 to select Y axis.
|
||||
BUSY: reads 1 when graphic board is busy sampling position, else 0.
|
||||
PRESS: reads 0 when pen is touching graphic board, else 1.
|
||||
DATA: when pen is touching graphic board, return 8-bit sample position for currently selected axis (X is in the 0-255 range, Y in the 0-191 range). Else, return 0.
|
||||
|
||||
*/
|
||||
|
||||
/*-------------------------------------------------
|
||||
tvdraw_axis_w - TV Draw axis select
|
||||
-------------------------------------------------*/
|
||||
|
||||
WRITE8_MEMBER( sg1000_state::tvdraw_axis_w )
|
||||
{
|
||||
if (data & 0x01)
|
||||
{
|
||||
m_tvdraw_data = input_port_read(machine(), "TVDRAW_X");
|
||||
|
||||
if (m_tvdraw_data < 4) m_tvdraw_data = 4;
|
||||
if (m_tvdraw_data > 251) m_tvdraw_data = 251;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_tvdraw_data = input_port_read(machine(), "TVDRAW_Y") + 32;
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------
|
||||
tvdraw_status_r - TV Draw status read
|
||||
-------------------------------------------------*/
|
||||
|
||||
READ8_MEMBER( sg1000_state::tvdraw_status_r )
|
||||
{
|
||||
return input_port_read(machine(), "TVDRAW_PEN");
|
||||
}
|
||||
|
||||
/*-------------------------------------------------
|
||||
tvdraw_data_r - TV Draw data read
|
||||
-------------------------------------------------*/
|
||||
|
||||
READ8_MEMBER( sg1000_state::tvdraw_data_r )
|
||||
{
|
||||
return m_tvdraw_data;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------
|
||||
joysel_r -
|
||||
-------------------------------------------------*/
|
||||
|
||||
READ8_MEMBER( sg1000_state::joysel_r )
|
||||
{
|
||||
return 0x80;
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
MEMORY MAPS
|
||||
***************************************************************************/
|
||||
|
||||
/*-------------------------------------------------
|
||||
ADDRESS_MAP( sg1000_map )
|
||||
-------------------------------------------------*/
|
||||
|
||||
static ADDRESS_MAP_START( sg1000_map, AS_PROGRAM, 8, sg1000_state )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM
|
||||
AM_RANGE(0x8000, 0xbfff) AM_RAMBANK("bank1")
|
||||
AM_RANGE(0xc000, 0xffff) AM_RAMBANK("bank2")
|
||||
ADDRESS_MAP_END
|
||||
|
||||
/*-------------------------------------------------
|
||||
ADDRESS_MAP( sg1000_io_map )
|
||||
-------------------------------------------------*/
|
||||
|
||||
static ADDRESS_MAP_START( sg1000_io_map, AS_IO, 8, sg1000_state )
|
||||
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||
AM_RANGE(0x40, 0x40) AM_MIRROR(0x3f) AM_DEVWRITE_LEGACY(SN76489A_TAG, sn76496_w)
|
||||
AM_RANGE(0x80, 0x80) AM_MIRROR(0x3e) AM_READWRITE_LEGACY(TMS9928A_vram_r, TMS9928A_vram_w)
|
||||
AM_RANGE(0x81, 0x81) AM_MIRROR(0x3e) AM_READWRITE_LEGACY(TMS9928A_register_r, TMS9928A_register_w)
|
||||
AM_RANGE(0xdc, 0xdc) AM_READ_PORT("PA7")
|
||||
AM_RANGE(0xdd, 0xdd) AM_READ_PORT("PB7")
|
||||
AM_RANGE(0xde, 0xde) AM_READ(joysel_r) AM_WRITENOP
|
||||
AM_RANGE(0xdf, 0xdf) AM_NOP
|
||||
ADDRESS_MAP_END
|
||||
|
||||
/*-------------------------------------------------
|
||||
ADDRESS_MAP( omv_map )
|
||||
-------------------------------------------------*/
|
||||
|
||||
static ADDRESS_MAP_START( omv_map, AS_PROGRAM, 8, sg1000_state )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM
|
||||
AM_RANGE(0x8000, 0xbfff) AM_RAMBANK("bank1")
|
||||
AM_RANGE(0xc000, 0xc7ff) AM_MIRROR(0x3800) AM_RAM
|
||||
ADDRESS_MAP_END
|
||||
|
||||
/*-------------------------------------------------
|
||||
ADDRESS_MAP( omv_io_map )
|
||||
-------------------------------------------------*/
|
||||
|
||||
static ADDRESS_MAP_START( omv_io_map, AS_IO, 8, sg1000_state )
|
||||
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||
AM_RANGE(0x40, 0x40) AM_MIRROR(0x3f) AM_DEVWRITE_LEGACY(SN76489A_TAG, sn76496_w)
|
||||
AM_RANGE(0x80, 0x80) AM_MIRROR(0x3e) AM_READWRITE_LEGACY(TMS9928A_vram_r, TMS9928A_vram_w)
|
||||
AM_RANGE(0x81, 0x81) AM_MIRROR(0x3e) AM_READWRITE_LEGACY(TMS9928A_register_r, TMS9928A_register_w)
|
||||
AM_RANGE(0xc0, 0xc0) AM_MIRROR(0x38) AM_READ_PORT("C0")
|
||||
AM_RANGE(0xc1, 0xc1) AM_MIRROR(0x38) AM_READ_PORT("C1")
|
||||
AM_RANGE(0xc2, 0xc2) AM_MIRROR(0x38) AM_READ_PORT("C2")
|
||||
AM_RANGE(0xc3, 0xc3) AM_MIRROR(0x38) AM_READ_PORT("C3")
|
||||
AM_RANGE(0xc4, 0xc4) AM_MIRROR(0x3a) AM_READ_PORT("C4")
|
||||
AM_RANGE(0xc5, 0xc5) AM_MIRROR(0x3a) AM_READ_PORT("C5")
|
||||
ADDRESS_MAP_END
|
||||
|
||||
/*-------------------------------------------------
|
||||
ADDRESS_MAP( sc3000_map )
|
||||
-------------------------------------------------*/
|
||||
|
||||
static ADDRESS_MAP_START( sc3000_map, AS_PROGRAM, 8, sg1000_state )
|
||||
AM_RANGE(0x0000, 0x7fff) AM_ROM
|
||||
AM_RANGE(0x8000, 0xbfff) AM_RAMBANK("bank1")
|
||||
AM_RANGE(0xc000, 0xffff) AM_RAMBANK("bank2")
|
||||
ADDRESS_MAP_END
|
||||
|
||||
/*-------------------------------------------------
|
||||
ADDRESS_MAP( sc3000_io_map )
|
||||
-------------------------------------------------*/
|
||||
|
||||
static ADDRESS_MAP_START( sc3000_io_map, AS_IO, 8, sg1000_state )
|
||||
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||
AM_RANGE(0x7f, 0x7f) AM_DEVWRITE_LEGACY(SN76489A_TAG, sn76496_w)
|
||||
AM_RANGE(0xbe, 0xbe) AM_READWRITE_LEGACY(TMS9928A_vram_r, TMS9928A_vram_w)
|
||||
AM_RANGE(0xbf, 0xbf) AM_READWRITE_LEGACY(TMS9928A_register_r, TMS9928A_register_w)
|
||||
AM_RANGE(0xdc, 0xdf) AM_DEVREADWRITE(UPD9255_TAG, i8255_device, read, write)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
/* This is how the I/O ports are really mapped, but MAME does not support overlapping ranges
|
||||
static ADDRESS_MAP_START( sc3000_io_map, AS_IO, 8, sg1000_state )
|
||||
ADDRESS_MAP_GLOBAL_MASK(0xff)
|
||||
AM_RANGE(0x00, 0x00) AM_MIRROR(0xdf) AM_DEVREADWRITE(UPD9255_TAG, i8255_device, read, write)
|
||||
AM_RANGE(0x00, 0x00) AM_MIRROR(0x7f) AM_DEVWRITE_LEGACY(SN76489A_TAG, sn76496_w)
|
||||
AM_RANGE(0x00, 0x00) AM_MIRROR(0xae) AM_READWRITE_LEGACY(TMS9928A_vram_r, TMS9928A_vram_w)
|
||||
AM_RANGE(0x01, 0x01) AM_MIRROR(0xae) AM_READWRITE_LEGACY(TMS9928A_register_r, TMS9928A_register_w)
|
||||
AM_RANGE(0x60, 0x60) AM_MIRROR(0x9f) AM_READ(sc3000_r_r)
|
||||
ADDRESS_MAP_END
|
||||
*/
|
||||
|
||||
/***************************************************************************
|
||||
INPUT PORTS
|
||||
***************************************************************************/
|
||||
|
||||
/*-------------------------------------------------
|
||||
INPUT_CHANGED( trigger_nmi )
|
||||
-------------------------------------------------*/
|
||||
|
||||
static INPUT_CHANGED( trigger_nmi )
|
||||
{
|
||||
cputag_set_input_line(field.machine(), Z80_TAG, INPUT_LINE_NMI, (input_port_read(field.machine(), "NMI") ? CLEAR_LINE : ASSERT_LINE));
|
||||
}
|
||||
|
||||
/*-------------------------------------------------
|
||||
INPUT_PORTS( tvdraw )
|
||||
-------------------------------------------------*/
|
||||
|
||||
static INPUT_PORTS_START( tvdraw )
|
||||
PORT_START("TVDRAW_X")
|
||||
PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_PLAYER(1)
|
||||
|
||||
PORT_START("TVDRAW_Y")
|
||||
PORT_BIT( 0xff, 0x60, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_MINMAX(0, 191) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_PLAYER(1)
|
||||
|
||||
PORT_START("TVDRAW_PEN")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Pen")
|
||||
INPUT_PORTS_END
|
||||
|
||||
/*-------------------------------------------------
|
||||
INPUT_PORTS( sg1000 )
|
||||
-------------------------------------------------*/
|
||||
|
||||
static INPUT_PORTS_START( sg1000 )
|
||||
PORT_START("PA7")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
|
||||
|
||||
PORT_START("PB7")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("NMI")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START ) PORT_NAME("PAUSE") PORT_CODE(KEYCODE_P) PORT_CHANGED(trigger_nmi, 0)
|
||||
|
||||
PORT_INCLUDE( tvdraw )
|
||||
INPUT_PORTS_END
|
||||
|
||||
/*-------------------------------------------------
|
||||
INPUT_PORTS( omv )
|
||||
-------------------------------------------------*/
|
||||
|
||||
static INPUT_PORTS_START( omv )
|
||||
PORT_START("C0")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3')
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4')
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5')
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6')
|
||||
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("C1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("9 #") PORT_CODE(KEYCODE_9) PORT_CHAR('9')
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("0 *") PORT_CODE(KEYCODE_0) PORT_CHAR('0')
|
||||
PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("C2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_B) PORT_CHAR('B')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_C) PORT_CHAR('C')
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_D) PORT_CHAR('D')
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_E) PORT_CHAR('E')
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_F) PORT_CHAR('F')
|
||||
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("C3")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_G) PORT_CHAR('G')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_H) PORT_CHAR('H')
|
||||
PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("C4")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("S-1")
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("S-2")
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
|
||||
|
||||
PORT_START("C5")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_INCLUDE( tvdraw )
|
||||
INPUT_PORTS_END
|
||||
|
||||
/*-------------------------------------------------
|
||||
INPUT_PORTS( sk1100 )
|
||||
-------------------------------------------------*/
|
||||
|
||||
INPUT_PORTS_START( sk1100 )
|
||||
PORT_START("PA0")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') PORT_CHAR('q')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A') PORT_CHAR('a')
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') PORT_CHAR('z')
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("ENG DIER'S") PORT_CODE(KEYCODE_RALT) PORT_CHAR(UCHAR_MAMEKEY(RALT))
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<')
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('K') PORT_CHAR('k')
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('I') PORT_CHAR('i')
|
||||
|
||||
PORT_START("PA1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('"')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('W') PORT_CHAR('w')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('S') PORT_CHAR('s')
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('X') PORT_CHAR('x')
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("SPC") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>')
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('L') PORT_CHAR('l')
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('O') PORT_CHAR('o')
|
||||
|
||||
PORT_START("PA2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('E') PORT_CHAR('e')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('D') PORT_CHAR('d')
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('C') PORT_CHAR('c')
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("HOME CLR") PORT_CODE(KEYCODE_HOME) PORT_CHAR(UCHAR_MAMEKEY(HOME))
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?')
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR('+')
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('P') PORT_CHAR('p')
|
||||
|
||||
PORT_START("PA3")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('R') PORT_CHAR('r')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('F') PORT_CHAR('f')
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('V') PORT_CHAR('v')
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("INS DEL") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8)
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("\xcf\x80") PORT_CODE(KEYCODE_EQUALS) PORT_CHAR(0x03c0)
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(':') PORT_CHAR('*')
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('@') PORT_CHAR('`')
|
||||
|
||||
PORT_START("PA4")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('T') PORT_CHAR('t')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('G') PORT_CHAR('g')
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('B') PORT_CHAR('b')
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_DOWN) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN))
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR(']') PORT_CHAR('}')
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR('[') PORT_CHAR('{')
|
||||
|
||||
PORT_START("PA5")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') PORT_CHAR('y')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('H') PORT_CHAR('h')
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('N') PORT_CHAR('n')
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_LEFT) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT))
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CR") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("PA6")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'')
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('U') PORT_CHAR('u')
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('J') PORT_CHAR('j')
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('M') PORT_CHAR('m')
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_RIGHT) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT))
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_UP) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP))
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("PA7")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
|
||||
|
||||
PORT_START("PB0")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(')
|
||||
PORT_BIT( 0x06, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("PB1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')')
|
||||
PORT_BIT( 0x06, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("PB2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0')
|
||||
PORT_BIT( 0x06, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("PB3")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=')
|
||||
PORT_BIT( 0x06, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("PB4")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH2) PORT_CHAR('^')
|
||||
PORT_BIT( 0x06, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
|
||||
PORT_START("PB5")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("\xc2\xa5") PORT_CODE(KEYCODE_TILDE) PORT_CHAR(0x00a5)
|
||||
PORT_BIT( 0x06, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("FUNC") PORT_CODE(KEYCODE_TAB)
|
||||
|
||||
PORT_START("PB6")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("BREAK") PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC))
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("GRAPH") PORT_CODE(KEYCODE_LALT) PORT_CHAR(UCHAR_MAMEKEY(LALT))
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL))
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
|
||||
|
||||
PORT_START("PB7")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
|
||||
|
||||
PORT_START("NMI")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("RESET") PORT_CODE(KEYCODE_F10) PORT_CHANGED(trigger_nmi, 0)
|
||||
INPUT_PORTS_END
|
||||
|
||||
/*-------------------------------------------------
|
||||
INPUT_PORTS( sc3000 )
|
||||
-------------------------------------------------*/
|
||||
|
||||
static INPUT_PORTS_START( sc3000 )
|
||||
PORT_INCLUDE( sk1100 )
|
||||
PORT_INCLUDE( tvdraw )
|
||||
INPUT_PORTS_END
|
||||
|
||||
/***************************************************************************
|
||||
DEVICE CONFIGURATION
|
||||
***************************************************************************/
|
||||
|
||||
/*-------------------------------------------------
|
||||
TMS9928a_interface tms9928a_interface
|
||||
-------------------------------------------------*/
|
||||
|
||||
INTERRUPT_GEN( sg1000_int )
|
||||
{
|
||||
TMS9928A_interrupt(device->machine());
|
||||
}
|
||||
|
||||
static void sg1000_vdp_interrupt(running_machine &machine, int state)
|
||||
{
|
||||
cputag_set_input_line(machine, Z80_TAG, INPUT_LINE_IRQ0, state);
|
||||
}
|
||||
|
||||
const TMS9928a_interface tms9928a_interface =
|
||||
{
|
||||
TMS99x8A,
|
||||
0x4000,
|
||||
0, 0,
|
||||
sg1000_vdp_interrupt
|
||||
};
|
||||
|
||||
/*-------------------------------------------------
|
||||
I8255_INTERFACE( sc3000_ppi_intf )
|
||||
-------------------------------------------------*/
|
||||
|
||||
READ8_MEMBER( sc3000_state::ppi_pa_r )
|
||||
{
|
||||
/*
|
||||
Signal Description
|
||||
|
||||
PA0 Keyboard input
|
||||
PA1 Keyboard input
|
||||
PA2 Keyboard input
|
||||
PA3 Keyboard input
|
||||
PA4 Keyboard input
|
||||
PA5 Keyboard input
|
||||
PA6 Keyboard input
|
||||
PA7 Keyboard input
|
||||
*/
|
||||
|
||||
static const char *const keynames[] = { "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7" };
|
||||
|
||||
return input_port_read(machine(), keynames[m_keylatch]);
|
||||
}
|
||||
|
||||
READ8_MEMBER( sc3000_state::ppi_pb_r )
|
||||
{
|
||||
/*
|
||||
Signal Description
|
||||
|
||||
PB0 Keyboard input
|
||||
PB1 Keyboard input
|
||||
PB2 Keyboard input
|
||||
PB3 Keyboard input
|
||||
PB4 /CONT input from cartridge terminal B-11
|
||||
PB5 FAULT input from printer
|
||||
PB6 BUSY input from printer
|
||||
PB7 Cassette tape input
|
||||
*/
|
||||
|
||||
static const char *const keynames[] = { "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7" };
|
||||
|
||||
/* keyboard */
|
||||
UINT8 data = input_port_read(machine(), keynames[m_keylatch]);
|
||||
|
||||
/* cartridge contact */
|
||||
data |= 0x10;
|
||||
|
||||
/* printer */
|
||||
data |= 0x60;
|
||||
|
||||
/* tape input */
|
||||
if (cassette_input(m_cassette) > +0.0) data |= 0x80;
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER( sc3000_state::ppi_pc_w )
|
||||
{
|
||||
/*
|
||||
Signal Description
|
||||
|
||||
PC0 Keyboard raster output
|
||||
PC1 Keyboard raster output
|
||||
PC2 Keyboard raster output
|
||||
PC3 not connected
|
||||
PC4 Cassette tape output
|
||||
PC5 DATA to printer
|
||||
PC6 /RESET to printer
|
||||
PC7 /FEED to printer
|
||||
*/
|
||||
|
||||
/* keyboard */
|
||||
m_keylatch = data & 0x07;
|
||||
|
||||
/* cassette */
|
||||
cassette_output(m_cassette, BIT(data, 4) ? +1.0 : -1.0);
|
||||
|
||||
/* TODO printer */
|
||||
}
|
||||
|
||||
I8255_INTERFACE( sc3000_ppi_intf )
|
||||
{
|
||||
DEVCB_DRIVER_MEMBER(sc3000_state, ppi_pa_r), // Port A read
|
||||
DEVCB_NULL, // Port A write
|
||||
DEVCB_DRIVER_MEMBER(sc3000_state, ppi_pb_r), // Port B read
|
||||
DEVCB_NULL, // Port B write
|
||||
DEVCB_NULL, // Port C read
|
||||
DEVCB_DRIVER_MEMBER(sc3000_state, ppi_pc_w), // Port C write
|
||||
};
|
||||
|
||||
/*-------------------------------------------------
|
||||
cassette_config sc3000_cassette_config
|
||||
-------------------------------------------------*/
|
||||
|
||||
const cassette_config sc3000_cassette_config =
|
||||
{
|
||||
cassette_default_formats,
|
||||
NULL,
|
||||
(cassette_state)(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED),
|
||||
NULL
|
||||
};
|
||||
|
||||
/***************************************************************************
|
||||
CARTRIDGE LOADING
|
||||
***************************************************************************/
|
||||
|
||||
/*-------------------------------------------------
|
||||
sg1000_install_cartridge -
|
||||
-------------------------------------------------*/
|
||||
|
||||
void sg1000_state::install_cartridge(UINT8 *ptr, int size)
|
||||
{
|
||||
address_space *program = m_maincpu->memory().space(AS_PROGRAM);
|
||||
|
||||
switch (size)
|
||||
{
|
||||
case 40 * 1024:
|
||||
program->install_read_bank(0x8000, 0x9fff, "bank1");
|
||||
program->unmap_write(0x8000, 0x9fff);
|
||||
memory_configure_bank(machine(), "bank1", 0, 1, machine().region(Z80_TAG)->base() + 0x8000, 0);
|
||||
memory_set_bank(machine(), "bank1", 0);
|
||||
break;
|
||||
|
||||
case 48 * 1024:
|
||||
program->install_read_bank(0x8000, 0xbfff, "bank1");
|
||||
program->unmap_write(0x8000, 0xbfff);
|
||||
memory_configure_bank(machine(), "bank1", 0, 1, machine().region(Z80_TAG)->base() + 0x8000, 0);
|
||||
memory_set_bank(machine(), "bank1", 0);
|
||||
break;
|
||||
|
||||
default:
|
||||
if (IS_CARTRIDGE_TV_DRAW(ptr))
|
||||
{
|
||||
program->install_write_handler(0x6000, 0x6000, 0, 0, write8_delegate(FUNC(sg1000_state::tvdraw_axis_w), this), 0);
|
||||
program->install_read_handler(0x8000, 0x8000, 0, 0, read8_delegate(FUNC(sg1000_state::tvdraw_status_r), this), 0);
|
||||
program->install_read_handler(0xa000, 0xa000, 0, 0, read8_delegate(FUNC(sg1000_state::tvdraw_data_r), this), 0);
|
||||
program->nop_write(0xa000, 0xa000);
|
||||
}
|
||||
else if (IS_CARTRIDGE_THE_CASTLE(ptr))
|
||||
{
|
||||
program->install_readwrite_bank(0x8000, 0x9fff, "bank1");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------
|
||||
DEVICE_IMAGE_LOAD( sg1000_cart )
|
||||
-------------------------------------------------*/
|
||||
|
||||
static DEVICE_IMAGE_LOAD( sg1000_cart )
|
||||
{
|
||||
running_machine &machine = image.device().machine();
|
||||
sg1000_state *state = machine.driver_data<sg1000_state>();
|
||||
address_space *program = machine.device(Z80_TAG)->memory().space(AS_PROGRAM);
|
||||
UINT8 *ptr = machine.region(Z80_TAG)->base();
|
||||
UINT32 size;
|
||||
|
||||
if (image.software_entry() == NULL)
|
||||
{
|
||||
size = image.length();
|
||||
if (image.fread( ptr, size) != size)
|
||||
return IMAGE_INIT_FAIL;
|
||||
}
|
||||
else
|
||||
{
|
||||
size = image.get_software_region_length("rom");
|
||||
memcpy(ptr, image.get_software_region("rom"), size);
|
||||
}
|
||||
|
||||
/* cartridge ROM banking */
|
||||
state->install_cartridge(ptr, size);
|
||||
|
||||
/* work RAM banking */
|
||||
program->install_readwrite_bank(0xc000, 0xc3ff, 0, 0x3c00, "bank2");
|
||||
|
||||
return IMAGE_INIT_PASS;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------
|
||||
DEVICE_IMAGE_LOAD( omv_cart )
|
||||
-------------------------------------------------*/
|
||||
|
||||
static DEVICE_IMAGE_LOAD( omv_cart )
|
||||
{
|
||||
running_machine &machine = image.device().machine();
|
||||
sg1000_state *state = machine.driver_data<sg1000_state>();
|
||||
UINT32 size;
|
||||
UINT8 *ptr = machine.region(Z80_TAG)->base();
|
||||
|
||||
if (image.software_entry() == NULL)
|
||||
{
|
||||
size = image.length();
|
||||
if (image.fread( ptr, size) != size)
|
||||
return IMAGE_INIT_FAIL;
|
||||
}
|
||||
else
|
||||
{
|
||||
size = image.get_software_region_length("rom");
|
||||
memcpy(ptr, image.get_software_region("rom"), size);
|
||||
}
|
||||
|
||||
/* cartridge ROM banking */
|
||||
state->install_cartridge(ptr, size);
|
||||
|
||||
return IMAGE_INIT_PASS;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------
|
||||
sc3000_install_cartridge -
|
||||
-------------------------------------------------*/
|
||||
|
||||
void sc3000_state::install_cartridge(UINT8 *ptr, int size)
|
||||
{
|
||||
address_space *program = m_maincpu->memory().space(AS_PROGRAM);
|
||||
|
||||
/* include SG-1000 mapping */
|
||||
sg1000_state::install_cartridge(ptr, size);
|
||||
|
||||
if (IS_CARTRIDGE_BASIC_LEVEL_III(ptr))
|
||||
{
|
||||
program->install_readwrite_bank(0x8000, 0xbfff, "bank1");
|
||||
program->install_readwrite_bank(0xc000, 0xffff, "bank2");
|
||||
}
|
||||
else if (IS_CARTRIDGE_MUSIC_EDITOR(ptr))
|
||||
{
|
||||
program->install_readwrite_bank(0x8000, 0x9fff, "bank1");
|
||||
program->install_readwrite_bank(0xc000, 0xc7ff, 0, 0x3800, "bank2");
|
||||
}
|
||||
else
|
||||
{
|
||||
/* regular cartridges */
|
||||
program->install_readwrite_bank(0xc000, 0xc7ff, 0, 0x3800, "bank2");
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------
|
||||
DEVICE_IMAGE_LOAD( sc3000_cart )
|
||||
-------------------------------------------------*/
|
||||
|
||||
static DEVICE_IMAGE_LOAD( sc3000_cart )
|
||||
{
|
||||
running_machine &machine = image.device().machine();
|
||||
sc3000_state *state = machine.driver_data<sc3000_state>();
|
||||
UINT8 *ptr = machine.region(Z80_TAG)->base();
|
||||
UINT32 size;
|
||||
|
||||
if (image.software_entry() == NULL)
|
||||
{
|
||||
size = image.length();
|
||||
if (image.fread( ptr, size) != size)
|
||||
return IMAGE_INIT_FAIL;
|
||||
}
|
||||
else
|
||||
{
|
||||
size = image.get_software_region_length("rom");
|
||||
memcpy(ptr, image.get_software_region("rom"), size);
|
||||
}
|
||||
|
||||
/* cartridge ROM and work RAM banking */
|
||||
state->install_cartridge(ptr, size);
|
||||
|
||||
return IMAGE_INIT_PASS;
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
MACHINE INITIALIZATION
|
||||
***************************************************************************/
|
||||
|
||||
/*-------------------------------------------------
|
||||
TIMER_CALLBACK( lightgun_tick )
|
||||
-------------------------------------------------*/
|
||||
|
||||
static TIMER_CALLBACK( lightgun_tick )
|
||||
{
|
||||
UINT8 *rom = machine.region(Z80_TAG)->base();
|
||||
|
||||
if (IS_CARTRIDGE_TV_DRAW(rom))
|
||||
{
|
||||
/* enable crosshair for TV Draw */
|
||||
crosshair_set_screen(machine, 0, CROSSHAIR_SCREEN_ALL);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* disable crosshair for other cartridges */
|
||||
crosshair_set_screen(machine, 0, CROSSHAIR_SCREEN_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------
|
||||
MACHINE_START( sg1000 )
|
||||
-------------------------------------------------*/
|
||||
|
||||
void sg1000_state::machine_start()
|
||||
{
|
||||
/* configure VDP */
|
||||
TMS9928A_configure(&tms9928a_interface);
|
||||
|
||||
/* toggle light gun crosshair */
|
||||
machine().scheduler().timer_set(attotime::zero, FUNC(lightgun_tick));
|
||||
|
||||
/* register for state saving */
|
||||
state_save_register_global(machine(), m_tvdraw_data);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------
|
||||
MACHINE_START( sc3000 )
|
||||
-------------------------------------------------*/
|
||||
|
||||
void sc3000_state::machine_start()
|
||||
{
|
||||
/* configure VDP */
|
||||
TMS9928A_configure(&tms9928a_interface);
|
||||
|
||||
/* toggle light gun crosshair */
|
||||
machine().scheduler().timer_set(attotime::zero, FUNC(lightgun_tick));
|
||||
|
||||
/* register for state saving */
|
||||
state_save_register_global(machine(), m_tvdraw_data);
|
||||
state_save_register_global(machine(), m_keylatch);
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
MACHINE DRIVERS
|
||||
***************************************************************************/
|
||||
|
||||
/*-------------------------------------------------
|
||||
MACHINE_CONFIG_START( sg1000, sg1000_state )
|
||||
-------------------------------------------------*/
|
||||
|
||||
static MACHINE_CONFIG_START( sg1000, sg1000_state )
|
||||
/* basic machine hardware */
|
||||
MCFG_CPU_ADD(Z80_TAG, Z80, XTAL_10_738635MHz/3)
|
||||
MCFG_CPU_PROGRAM_MAP(sg1000_map)
|
||||
MCFG_CPU_IO_MAP(sg1000_io_map)
|
||||
MCFG_CPU_VBLANK_INT(SCREEN_TAG, sg1000_int)
|
||||
|
||||
/* video hardware */
|
||||
MCFG_FRAGMENT_ADD(tms9928a)
|
||||
MCFG_SCREEN_MODIFY(SCREEN_TAG)
|
||||
MCFG_SCREEN_REFRESH_RATE((float)XTAL_10_738635MHz/2/342/262)
|
||||
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
|
||||
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
MCFG_SOUND_ADD(SN76489A_TAG, SN76489A, XTAL_10_738635MHz/3)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
|
||||
|
||||
/* cartridge */
|
||||
MCFG_CARTSLOT_ADD("cart")
|
||||
MCFG_CARTSLOT_EXTENSION_LIST("sg,bin")
|
||||
MCFG_CARTSLOT_MANDATORY
|
||||
MCFG_CARTSLOT_INTERFACE("sg1000_cart")
|
||||
MCFG_CARTSLOT_LOAD(sg1000_cart)
|
||||
|
||||
/* software lists */
|
||||
MCFG_SOFTWARE_LIST_ADD("cart_list","sg1000")
|
||||
|
||||
/* internal ram */
|
||||
MCFG_RAM_ADD(RAM_TAG)
|
||||
MCFG_RAM_DEFAULT_SIZE("1K")
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
/*-------------------------------------------------
|
||||
MACHINE_CONFIG_DERIVED( omv, sg1000 )
|
||||
-------------------------------------------------*/
|
||||
|
||||
static MACHINE_CONFIG_DERIVED( omv, sg1000 )
|
||||
MCFG_CPU_MODIFY(Z80_TAG)
|
||||
MCFG_CPU_PROGRAM_MAP(omv_map)
|
||||
MCFG_CPU_IO_MAP(omv_io_map)
|
||||
|
||||
MCFG_CARTSLOT_MODIFY("cart")
|
||||
MCFG_CARTSLOT_EXTENSION_LIST("sg,bin")
|
||||
MCFG_CARTSLOT_NOT_MANDATORY
|
||||
MCFG_CARTSLOT_LOAD(omv_cart)
|
||||
|
||||
MCFG_RAM_MODIFY(RAM_TAG)
|
||||
MCFG_RAM_DEFAULT_SIZE("2K")
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
/*-------------------------------------------------
|
||||
MACHINE_CONFIG_START( sc3000, sc3000_state )
|
||||
-------------------------------------------------*/
|
||||
|
||||
static MACHINE_CONFIG_START( sc3000, sc3000_state )
|
||||
/* basic machine hardware */
|
||||
MCFG_CPU_ADD(Z80_TAG, Z80, XTAL_10_738635MHz/3) // LH0080A
|
||||
MCFG_CPU_PROGRAM_MAP(sc3000_map)
|
||||
MCFG_CPU_IO_MAP(sc3000_io_map)
|
||||
MCFG_CPU_VBLANK_INT(SCREEN_TAG, sg1000_int)
|
||||
|
||||
/* video hardware */
|
||||
MCFG_FRAGMENT_ADD(tms9928a)
|
||||
MCFG_SCREEN_MODIFY(SCREEN_TAG)
|
||||
MCFG_SCREEN_REFRESH_RATE((float)XTAL_10_738635MHz/2/342/262)
|
||||
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
|
||||
|
||||
/* sound hardware */
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
MCFG_SOUND_ADD(SN76489A_TAG, SN76489A, XTAL_10_738635MHz/3)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
|
||||
|
||||
/* devices */
|
||||
MCFG_I8255_ADD(UPD9255_TAG, sc3000_ppi_intf)
|
||||
// MCFG_PRINTER_ADD("sp400") /* serial printer */
|
||||
MCFG_CASSETTE_ADD(CASSETTE_TAG, sc3000_cassette_config)
|
||||
|
||||
/* cartridge */
|
||||
MCFG_CARTSLOT_ADD("cart")
|
||||
MCFG_CARTSLOT_EXTENSION_LIST("sg,sc,bin")
|
||||
MCFG_CARTSLOT_INTERFACE("sg1000_cart")
|
||||
MCFG_CARTSLOT_LOAD(sc3000_cart)
|
||||
|
||||
/* software lists */
|
||||
MCFG_SOFTWARE_LIST_ADD("cart_list","sg1000")
|
||||
|
||||
/* internal ram */
|
||||
MCFG_RAM_ADD(RAM_TAG)
|
||||
MCFG_RAM_DEFAULT_SIZE("2K")
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
ROMS
|
||||
***************************************************************************/
|
||||
|
||||
ROM_START( sg1000 )
|
||||
ROM_REGION( 0x10000, Z80_TAG, ROMREGION_ERASE00 )
|
||||
ROM_END
|
||||
|
||||
#define rom_sg1000m2 rom_sg1000
|
||||
|
||||
ROM_START( sc3000 )
|
||||
ROM_REGION( 0x10000, Z80_TAG, ROMREGION_ERASE00 )
|
||||
ROM_LOAD( "sc3000.rom", 0x0000, 0x8000, CRC(a46e3c73) SHA1(b1a8585a9afff962e8fd0e79b3305199da4e4562))
|
||||
ROM_END
|
||||
|
||||
#define rom_sc3000h rom_sg1000
|
||||
|
||||
ROM_START( omv1000 )
|
||||
ROM_REGION( 0x10000, Z80_TAG, ROMREGION_ERASE00 )
|
||||
ROM_LOAD( "omvbios.bin", 0x0000, 0x4000, BAD_DUMP CRC(c5a67b95) SHA1(6d7c64dd60dee4a33061d3d3a7c2ed190d895cdb) ) // The BIOS comes from a Multivision FG-2000. It is still unknown if the FG-1000 BIOS differs
|
||||
ROM_END
|
||||
|
||||
ROM_START( omv2000 )
|
||||
ROM_REGION( 0x10000, Z80_TAG, ROMREGION_ERASE00 )
|
||||
ROM_LOAD( "omvbios.bin", 0x0000, 0x4000, CRC(c5a67b95) SHA1(6d7c64dd60dee4a33061d3d3a7c2ed190d895cdb) )
|
||||
ROM_END
|
||||
|
||||
/***************************************************************************
|
||||
SYSTEM DRIVERS
|
||||
***************************************************************************/
|
||||
|
||||
/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */
|
||||
CONS( 1983, sg1000, 0, 0, sg1000, sg1000, 0, "Sega", "SG-1000", GAME_SUPPORTS_SAVE )
|
||||
CONS( 1984, sg1000m2, sg1000, 0, sc3000, sc3000, 0, "Sega", "SG-1000 II", GAME_SUPPORTS_SAVE )
|
||||
COMP( 1983, sc3000, 0, sg1000, sc3000, sc3000, 0, "Sega", "SC-3000", GAME_SUPPORTS_SAVE )
|
||||
COMP( 1983, sc3000h, sc3000, 0, sc3000, sc3000, 0, "Sega", "SC-3000H", GAME_SUPPORTS_SAVE )
|
||||
CONS( 1984, omv1000, sg1000, 0, omv, omv, 0, "Tsukuda Original", "Othello Multivision FG-1000", GAME_SUPPORTS_SAVE )
|
||||
CONS( 1984, omv2000, sg1000, 0, omv, omv, 0, "Tsukuda Original", "Othello Multivision FG-2000", GAME_SUPPORTS_SAVE )
|
@ -1,84 +0,0 @@
|
||||
#ifndef __SG1000__
|
||||
#define __SG1000__
|
||||
|
||||
#include "machine/ram.h"
|
||||
#include "video/tms9928a.h"
|
||||
#include "imagedev/cassette.h"
|
||||
|
||||
#define SCREEN_TAG "screen"
|
||||
#define Z80_TAG "z80"
|
||||
#define SN76489A_TAG "sn76489a"
|
||||
#define UPD765_TAG "upd765"
|
||||
#define CASSETTE_TAG "cassette"
|
||||
#define UPD8251_TAG "upd8251"
|
||||
#define UPD9255_TAG "upd9255"
|
||||
#define UPD9255_0_TAG "upd9255_0"
|
||||
#define UPD9255_1_TAG "upd9255_1"
|
||||
#define CENTRONICS_TAG "centronics"
|
||||
|
||||
#define IS_CARTRIDGE_TV_DRAW(ptr) \
|
||||
(!strncmp("annakmn", (const char *)&ptr[0x13b3], 7))
|
||||
|
||||
#define IS_CARTRIDGE_THE_CASTLE(ptr) \
|
||||
(!strncmp("ASCII 1986", (const char *)&ptr[0x1cc3], 10))
|
||||
|
||||
#define IS_CARTRIDGE_BASIC_LEVEL_III(ptr) \
|
||||
(!strncmp("SC-3000 BASIC Level 3 ver 1.0", (const char *)&ptr[0x6a20], 29))
|
||||
|
||||
#define IS_CARTRIDGE_MUSIC_EDITOR(ptr) \
|
||||
(!strncmp("PIANO", (const char *)&ptr[0x0841], 5))
|
||||
|
||||
extern const TMS9928a_interface tms9928a_interface;
|
||||
INPUT_PORTS_EXTERN( sk1100 );
|
||||
extern INTERRUPT_GEN( sg1000_int );
|
||||
extern const i8255_interface ( sc3000_ppi_intf );
|
||||
extern const cassette_config sc3000_cassette_config;
|
||||
|
||||
class sg1000_state : public driver_device
|
||||
{
|
||||
public:
|
||||
sg1000_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, Z80_TAG),
|
||||
m_ram(*this, RAM_TAG)
|
||||
{ }
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<device_t> m_ram;
|
||||
|
||||
virtual void machine_start();
|
||||
|
||||
void install_cartridge(UINT8 *ptr, int size);
|
||||
|
||||
DECLARE_WRITE8_MEMBER( tvdraw_axis_w );
|
||||
DECLARE_READ8_MEMBER( tvdraw_status_r );
|
||||
DECLARE_READ8_MEMBER( tvdraw_data_r );
|
||||
DECLARE_READ8_MEMBER( joysel_r );
|
||||
|
||||
/* keyboard state */
|
||||
UINT8 m_keylatch;
|
||||
|
||||
/* TV Draw state */
|
||||
UINT8 m_tvdraw_data;
|
||||
};
|
||||
|
||||
class sc3000_state : public sg1000_state
|
||||
{
|
||||
public:
|
||||
sc3000_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: sg1000_state(mconfig, type, tag),
|
||||
m_cassette(*this, CASSETTE_TAG)
|
||||
{ }
|
||||
|
||||
required_device<device_t> m_cassette;
|
||||
|
||||
virtual void machine_start();
|
||||
|
||||
void install_cartridge(UINT8 *ptr, int size);
|
||||
|
||||
DECLARE_READ8_MEMBER( ppi_pa_r );
|
||||
DECLARE_READ8_MEMBER( ppi_pb_r );
|
||||
DECLARE_WRITE8_MEMBER( ppi_pc_w );
|
||||
};
|
||||
|
||||
#endif
|
@ -1223,7 +1223,6 @@ $(MAMEOBJ)/sega.a: \
|
||||
$(VIDEO)/smsvdp.o \
|
||||
$(MACHINE)/segasms.o \
|
||||
$(DRIVERS)/segasms.o \
|
||||
$(DRIVERS)/sg1000.o \
|
||||
$(MACHINE)/gdrom.o \
|
||||
|
||||
$(MAMEOBJ)/seibu.a: \
|
||||
|
Loading…
Reference in New Issue
Block a user