electron: added cassette softlist and implemented BREAK key

This commit is contained in:
Nigel Barnes 2016-02-08 00:20:07 +00:00
parent 9a3e057bd6
commit 7816f4d0a5
4 changed files with 10460 additions and 32 deletions

10418
hash/electron_cass.xml Normal file

File diff suppressed because it is too large Load diff

View file

@ -64,7 +64,6 @@ Incomplete:
Missing:
- Support for floppy disks
- Other peripherals
- Keyboard is missing the 'Break' key
******************************************************************************/
#include "emu.h"
@ -93,34 +92,39 @@ PALETTE_INIT_MEMBER(electron_state, electron)
}
static ADDRESS_MAP_START(electron_mem, AS_PROGRAM, 8, electron_state )
AM_RANGE(0x0000, 0x7fff) AM_RAM AM_REGION("maincpu", 0x00000) /* 32KB of RAM */
AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank2") /* Banked ROM pages */
AM_RANGE(0xc000, 0xfbff) AM_ROM AM_REGION("user1", 0x40000) /* OS ROM */
AM_RANGE(0xfc00, 0xfcff) AM_READWRITE(electron_jim_r, electron_jim_w ) /* JIM pages */
AM_RANGE(0xfd00, 0xfdff) AM_READWRITE(electron_1mhz_r, electron_1mhz_w ) /* 1 MHz bus */
AM_RANGE(0xfe00, 0xfeff) AM_READWRITE(electron_ula_r, electron_ula_w ) /* Electron ULA */
AM_RANGE(0xff00, 0xffff) AM_ROM AM_REGION("user1", 0x43f00) /* OS ROM continued */
AM_RANGE(0x0000, 0x7fff) AM_RAM AM_REGION("maincpu", 0x00000) /* 32KB of RAM */
AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank2") /* Banked ROM pages */
AM_RANGE(0xc000, 0xfbff) AM_ROM AM_REGION("user1", 0x40000) /* OS ROM */
AM_RANGE(0xfc00, 0xfcff) AM_READWRITE(electron_fred_r, electron_fred_w ) /* FRED */
AM_RANGE(0xfd00, 0xfdff) AM_READWRITE(electron_jim_r, electron_jim_w ) /* JIM */
AM_RANGE(0xfe00, 0xfeff) AM_READWRITE(electron_sheila_r, electron_sheila_w ) /* SHEILA */
AM_RANGE(0xff00, 0xffff) AM_ROM AM_REGION("user1", 0x43f00) /* OS ROM continued */
ADDRESS_MAP_END
INPUT_CHANGED_MEMBER(electron_state::trigger_reset)
{
m_maincpu->set_input_line(INPUT_LINE_RESET, PULSE_LINE);
}
static INPUT_PORTS_START( electron )
PORT_START("LINE.0")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("\xE2\x86\x92 | \\") PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) PORT_CHAR('|') PORT_CHAR('\\') // on the real keyboard, this would be on the 1st row, the 3rd key after 0
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("COPY") PORT_CODE(KEYCODE_END) PORT_CHAR(UCHAR_MAMEKEY(F1)) PORT_CHAR('[') PORT_CHAR(']')
/* PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("<NONE>") PORT_CODE(KEYCODE_) */
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')
PORT_START("LINE.1")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("\xE2\x86\x90 ^ ~") PORT_CODE(KEYCODE_EQUALS) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) PORT_CHAR('^') PORT_CHAR('~')
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("\xE2\x86\x93 _ }") PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) PORT_CHAR('_') PORT_CHAR('}')
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13)
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RETURN") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13)
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("DELETE") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8)
PORT_START("LINE.2")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=')
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("\xE2\x86\x91 \xC2\xA3 {") PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR(UCHAR_MAMEKEY(UP)) PORT_CHAR('\xA3') PORT_CHAR('{')
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(':') PORT_CHAR('*')
/* PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("<NONE>") PORT_CODE(KEYCODE_) */
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_START("LINE.3")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR('@')
@ -188,10 +192,12 @@ static INPUT_PORTS_START( electron )
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_SHIFT_2)
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_RSHIFT) PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
PORT_START("BRK") /* BREAK */
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("BREAK") PORT_CODE(KEYCODE_F12) PORT_CHAR(UCHAR_MAMEKEY(F12)) PORT_CHANGED_MEMBER(DEVICE_SELF, electron_state, trigger_reset, 0)
INPUT_PORTS_END
static MACHINE_CONFIG_START( electron, electron_state )
MCFG_CPU_ADD( "maincpu", M6502, 2000000 )
MCFG_CPU_ADD( "maincpu", M6502, XTAL_16MHz/8 )
MCFG_CPU_PROGRAM_MAP( electron_mem)
MCFG_SCREEN_ADD("screen", RASTER)
@ -212,11 +218,13 @@ static MACHINE_CONFIG_START( electron, electron_state )
MCFG_CASSETTE_ADD( "cassette" )
MCFG_CASSETTE_FORMATS(uef_cassette_formats)
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY)
MCFG_CASSETTE_INTERFACE("electron_cass")
MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_plain_slot, "electron_cart")
MCFG_GENERIC_LOAD(electron_state, electron_cart)
/* software lists */
MCFG_SOFTWARE_LIST_ADD("cass_list","electron_cass")
MCFG_SOFTWARE_LIST_ADD("cart_list","electron_cart")
MACHINE_CONFIG_END
@ -246,5 +254,6 @@ ROM_START(electron)
/* 3c000 15 available for cartridges with a language ROM */
ROM_END
/* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME */
COMP ( 1983, electron, 0, 0, electron, electron, driver_device, 0, "Acorn", "Acorn Electron", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME */
COMP ( 1983, electron, 0, 0, electron, electron, driver_device, 0, "Acorn", "Acorn Electron", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS )
//COMP ( 1985, btm2501, electron, 0, electron, electron, driver_device, 0, "British Telecom Business Systems", "Merlin M2501", MACHINE_NOT_WORKING )

View file

@ -23,10 +23,10 @@
#define INT_HIGH_TONE 0x40
#define INT_TRANSMIT_EMPTY 0x20
#define INT_RECEIVE_FULL 0x10
#define INT_RTC 0x08
#define INT_RTC 0x08
#define INT_DISPLAY_END 0x04
#define INT_SET 0x100
#define INT_CLEAR 0x200
#define INT_SET 0x100
#define INT_CLEAR 0x200
/* ULA context */
@ -83,12 +83,12 @@ public:
int m_map16[256];
emu_timer *m_scanline_timer;
DECLARE_READ8_MEMBER(electron_read_keyboard);
DECLARE_READ8_MEMBER(electron_fred_r);
DECLARE_WRITE8_MEMBER(electron_fred_w);
DECLARE_READ8_MEMBER(electron_jim_r);
DECLARE_WRITE8_MEMBER(electron_jim_w);
DECLARE_READ8_MEMBER(electron_1mhz_r);
DECLARE_WRITE8_MEMBER(electron_1mhz_w);
DECLARE_READ8_MEMBER(electron_ula_r);
DECLARE_WRITE8_MEMBER(electron_ula_w);
DECLARE_READ8_MEMBER(electron_sheila_r);
DECLARE_WRITE8_MEMBER(electron_sheila_w);
void electron_tape_start();
void electron_tape_stop();
virtual void machine_start() override;
@ -108,6 +108,7 @@ public:
inline void electron_plot_pixel(bitmap_ind16 &bitmap, int x, int y, UINT32 color);
void electron_interrupt_handler(int mode, int interrupt);
DECLARE_DEVICE_IMAGE_LOAD_MEMBER( electron_cart );
DECLARE_INPUT_CHANGED_MEMBER( trigger_reset );
protected:
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;

View file

@ -145,6 +145,15 @@ READ8_MEMBER(electron_state::electron_read_keyboard)
return data;
}
READ8_MEMBER(electron_state::electron_fred_r)
{
return 0xff;
}
WRITE8_MEMBER(electron_state::electron_fred_w)
{
}
READ8_MEMBER(electron_state::electron_jim_r)
{
return 0xff;
@ -154,16 +163,7 @@ WRITE8_MEMBER(electron_state::electron_jim_w)
{
}
READ8_MEMBER(electron_state::electron_1mhz_r)
{
return 0xff;
}
WRITE8_MEMBER(electron_state::electron_1mhz_w)
{
}
READ8_MEMBER(electron_state::electron_ula_r)
READ8_MEMBER(electron_state::electron_sheila_r)
{
UINT8 data = ((UINT8 *)memregion("user1")->base())[0x43E00 + offset];
switch ( offset & 0x0f )
@ -186,7 +186,7 @@ READ8_MEMBER(electron_state::electron_ula_r)
static const int electron_palette_offset[4] = { 0, 4, 5, 1 };
static const UINT16 electron_screen_base[8] = { 0x3000, 0x3000, 0x3000, 0x4000, 0x5800, 0x5800, 0x6000, 0x5800 };
WRITE8_MEMBER(electron_state::electron_ula_w)
WRITE8_MEMBER(electron_state::electron_sheila_w)
{
int i = electron_palette_offset[(( offset >> 1 ) & 0x03)];
logerror( "ULA: write offset %02x <- %02x\n", offset & 0x0f, data );