summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/bus/a7800
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/bus/a7800')
-rw-r--r--src/emu/bus/a7800/a78_carts.h8
-rw-r--r--src/emu/bus/a7800/a78_slot.c86
-rw-r--r--src/emu/bus/a7800/a78_slot.h32
-rw-r--r--src/emu/bus/a7800/cpuwiz.c20
-rw-r--r--src/emu/bus/a7800/cpuwiz.h14
-rw-r--r--src/emu/bus/a7800/hiscore.c3
-rw-r--r--src/emu/bus/a7800/hiscore.h4
-rw-r--r--src/emu/bus/a7800/rom.c51
-rw-r--r--src/emu/bus/a7800/rom.h54
-rw-r--r--src/emu/bus/a7800/xboard.c30
-rw-r--r--src/emu/bus/a7800/xboard.h10
11 files changed, 154 insertions, 158 deletions
diff --git a/src/emu/bus/a7800/a78_carts.h b/src/emu/bus/a7800/a78_carts.h
index 1d31e22acdb..73739dddcf8 100644
--- a/src/emu/bus/a7800/a78_carts.h
+++ b/src/emu/bus/a7800/a78_carts.h
@@ -20,10 +20,10 @@ static SLOT_INTERFACE_START(a7800_cart)
SLOT_INTERFACE_INTERNAL("a78_abs", A78_ROM_ABSOLUTE)
SLOT_INTERFACE_INTERNAL("a78_act", A78_ROM_ACTIVISION)
SLOT_INTERFACE_INTERNAL("a78_hsc", A78_HISCORE)
- SLOT_INTERFACE_INTERNAL("a78_xboard", A78_XBOARD) // the actual XBoarD expansion (as passthru)
- SLOT_INTERFACE_INTERNAL("a78_xm", A78_XM) // the actual XM expansion (as passthru)
- SLOT_INTERFACE_INTERNAL("a78_megacart", A78_ROM_MEGACART)
- SLOT_INTERFACE_INTERNAL("a78_versa", A78_ROM_VERSABOARD)
+ SLOT_INTERFACE_INTERNAL("a78_xboard", A78_XBOARD) // the actual XBoarD expansion (as passthru)
+ SLOT_INTERFACE_INTERNAL("a78_xm", A78_XM) // the actual XM expansion (as passthru)
+ SLOT_INTERFACE_INTERNAL("a78_megacart", A78_ROM_MEGACART)
+ SLOT_INTERFACE_INTERNAL("a78_versa", A78_ROM_VERSABOARD)
// cart variants with a POKEY at 0x0450 (typically a VersaBoard variant, or an homebrew pcb)
SLOT_INTERFACE_INTERNAL("a78_p450_t0", A78_ROM_P450)
SLOT_INTERFACE_INTERNAL("a78_p450_t1", A78_ROM_P450_POKEY)
diff --git a/src/emu/bus/a7800/a78_slot.c b/src/emu/bus/a7800/a78_slot.c
index 9deac1afdd4..d1d6130ba26 100644
--- a/src/emu/bus/a7800/a78_slot.c
+++ b/src/emu/bus/a7800/a78_slot.c
@@ -21,7 +21,7 @@
- read_40xx/write_40xx for accesses in the $4000 to $ffff range
even if not all carts use all of them (in particular no cart type
seems to use access to the ranges $0500 to $0fff and $2800 to $2fff)
-
+
***********************************************************************************************************/
@@ -70,15 +70,15 @@ void device_a78_cart_interface::rom_alloc(UINT32 size, const char *tag)
tempstring.cat(A78SLOT_ROM_REGION_TAG);
m_rom = device().machine().memory().region_alloc(tempstring, size, 1, ENDIANNESS_LITTLE)->base();
m_rom_size = size;
-
+
// setup other helpers
if ((size / 0x4000) & 1) // compensate for SuperGame carts with 9 x 16K banks (to my knowledge no other cart has m_bank_mask != power of 2)
m_bank_mask = (size / 0x4000) - 2;
else
m_bank_mask = (size / 0x4000) - 1;
-
+
// the rom is mapped to the top of the memory area
- // so we store the starting point of data to simplify
+ // so we store the starting point of data to simplify
// the access handling
m_base_rom = 0x10000 - size;
}
@@ -272,7 +272,7 @@ int a78_cart_slot_device::validate_header(int head, bool log)
}
head &= 0xff00;
}
-
+
if ((head & 0xff00) > 0x300)
{
if (log)
@@ -282,7 +282,7 @@ int a78_cart_slot_device::validate_header(int head, bool log)
}
head &= 0x00ff;
}
-
+
return head;
}
@@ -329,7 +329,7 @@ static int a78_get_pcb_id(const char *slot)
if (!core_stricmp(slot_list[i].slot_option, slot))
return slot_list[i].pcb_id;
}
-
+
return 0;
}
@@ -340,7 +340,7 @@ static const char *a78_get_slot(int type)
if (slot_list[i].pcb_id == type)
return slot_list[i].slot_option;
}
-
+
return "a78_rom";
}
@@ -349,17 +349,17 @@ bool a78_cart_slot_device::call_load()
if (m_cart)
{
UINT32 len;
-
+
if (software_entry() != NULL)
{
const char *pcb_name;
bool has_ram = get_software_region("ram") ? TRUE : FALSE;
bool has_nvram = get_software_region("nvram") ? TRUE : FALSE;
len = get_software_region_length("rom");
-
+
m_cart->rom_alloc(len, tag());
memcpy(m_cart->get_rom_base(), get_software_region("rom"), len);
-
+
if ((pcb_name = get_feature("slot")) != NULL)
m_type = a78_get_pcb_id(pcb_name);
else
@@ -377,19 +377,19 @@ bool a78_cart_slot_device::call_load()
{
// Load and check the header
int mapper;
- char head[128];
+ char head[128];
fread(head, 128);
-
+
if (verify_header((char *)head) == IMAGE_VERIFY_FAIL)
return IMAGE_INIT_FAIL;
-
+
len = (head[49] << 24) | (head[50] << 16) | (head[51] << 8) | head[52];
if (len + 128 > length())
{
logerror("Invalid length in the header. The game might be corrupted.\n");
len = length() - 128;
}
-
+
// let's try to auto-fix some common errors in the header
mapper = validate_header((head[53] << 8) | head[54], TRUE);
@@ -415,7 +415,7 @@ bool a78_cart_slot_device::call_load()
m_type = A78_VERSABOARD;
break;
}
-
+
// check if cart has a POKEY at $0450 (typically a VersaBoard variant)!
if (mapper & 0x40)
{
@@ -425,7 +425,7 @@ bool a78_cart_slot_device::call_load()
m_type += A78_POKEY0450;
}
}
-
+
// check special bits, which override the previous
if ((mapper & 0xff00) == 0x0100)
m_type = A78_ACTIVISION;
@@ -452,10 +452,10 @@ bool a78_cart_slot_device::call_load()
}
internal_header_logging((UINT8 *)head, length());
-
+
m_cart->rom_alloc(len, tag());
fread(m_cart->get_rom_base(), len);
-
+
if (m_type == A78_TYPE6)
m_cart->ram_alloc(0x4000);
if (m_type == A78_MEGACART || (m_type >= A78_VERSABOARD && m_type <= A78_VERSA_POK450))
@@ -468,7 +468,7 @@ bool a78_cart_slot_device::call_load()
battery_load(m_cart->get_nvram_base(), 0x800, 0xff);
}
}
-
+
//printf("Type: %s\n", a78_get_slot(m_type));
}
return IMAGE_INIT_PASS;
@@ -476,7 +476,7 @@ bool a78_cart_slot_device::call_load()
void a78_partialhash(hash_collection &dest, const unsigned char *data,
- unsigned long length, const char *functions)
+ unsigned long length, const char *functions)
{
if (length <= 128)
return;
@@ -537,13 +537,13 @@ void a78_cart_slot_device::get_default_card_software(astring &result)
const char *slot_string = "a78_rom";
dynamic_buffer head(128);
int type = A78_TYPE0, mapper;
-
+
// Load and check the header
- core_fread(m_file, head, 128);
+ core_fread(m_file, head, 128);
// let's try to auto-fix some common errors in the header
mapper = validate_header((head[53] << 8) | head[54], FALSE);
-
+
switch (mapper & 0x2e)
{
case 0x0000:
@@ -566,7 +566,7 @@ void a78_cart_slot_device::get_default_card_software(astring &result)
type = A78_VERSABOARD;
break;
}
-
+
// check if cart has a POKEY at $0450 (typically a VersaBoard variant)!
if (mapper & 0x40)
{
@@ -576,18 +576,18 @@ void a78_cart_slot_device::get_default_card_software(astring &result)
type += A78_POKEY0450;
}
}
-
+
// check special bits, which override the previous
if ((mapper & 0xff00) == 0x0100)
type = A78_ACTIVISION;
else if ((mapper & 0xff00) == 0x0200)
type = A78_ABSOLUTE;
-
+
logerror("Cart type: %x\n", type);
slot_string = a78_get_slot(type);
-
+
clear();
-
+
result.cpy(slot_string);
}
else
@@ -663,9 +663,9 @@ WRITE8_MEMBER(a78_cart_slot_device::write_40xx)
/*-------------------------------------------------
A78 header logging
-
+
A78 HEADER FORMAT
-
+
Bytes | Content | Length
========================================
0 | Header version | 1 byte
@@ -679,7 +679,7 @@ WRITE8_MEMBER(a78_cart_slot_device::write_40xx)
53..54 | Cart type [*] | 2 bytes
-------|-------------------|------------
55 | Controller 1 type | 1 byte
- | |
+ | |
| 0 = None |
| 1 = Joystick |
| 2 = Light Gun |
@@ -690,23 +690,23 @@ WRITE8_MEMBER(a78_cart_slot_device::write_40xx)
-------|-------------------|------------
57 | TV System | 1 byte
| |
- | 0 = NTSC/1 = PAL |
+ | 0 = NTSC/1 = PAL |
-------|-------------------|------------
58 | Save data | 1 byte
| | (only v2)
| 0 = None / Unk |
| 1 = High Score |
| 2 = Savekey |
- -------|-------------------|-----------
+ -------|-------------------|-----------
63 | Expansion module | 1 byte
| |
| 0 = No expansion |
| module |
| 1 = Expansion |
| required |
- -------|-------------------|-----------
-
-
+ -------|-------------------|-----------
+
+
[*] Cart type:
bit 0-7 - Hardware "flags"
@@ -716,13 +716,13 @@ WRITE8_MEMBER(a78_cart_slot_device::write_40xx)
bit 3 [0x08] - bank 0 of 144K ROM at $4000
bit 4 [0x10] - bank 6 at $4000
bit 5 [0x20] - banked RAM at $4000
-
+
bit 8-15 - Special values
0 = Normal cart
1 = Absolute (F18 Hornet)
2 = Activision (Double Dragon & Rampage)
3 = POKEY at $0450
-
+
-------------------------------------------------*/
void a78_cart_slot_device::internal_header_logging(UINT8 *header, UINT32 len)
@@ -788,7 +788,7 @@ void a78_cart_slot_device::internal_header_logging(UINT8 *header, UINT32 len)
ctrl1.cpy("Unknown controller");
break;
}
-
+
switch (head_ctrl2)
{
case 0x00:
@@ -804,10 +804,10 @@ void a78_cart_slot_device::internal_header_logging(UINT8 *header, UINT32 len)
ctrl2.cpy("Unknown controller");
break;
}
-
+
logerror( "ROM DETAILS\n" );
logerror( "===========\n\n" );
- logerror( "\tTotal length (with header): 0x%x (%dK + 128b header)\n\n", len, len/0x400);
+ logerror( "\tTotal length (with header): 0x%x (%dK + 128b header)\n\n", len, len/0x400);
logerror( "HEADER DETAILS\n" );
logerror( "==============\n\n" );
logerror( "\tTitle: %.32s\n", head_title);
@@ -829,5 +829,5 @@ void a78_cart_slot_device::internal_header_logging(UINT8 *header, UINT32 len)
logerror( "\n");
logerror( "\tController 1: 0x%.2X [%s]\n", head_ctrl1, ctrl1.cstr());
logerror( "\tController 2: 0x%.2X [%s]\n", head_ctrl2, ctrl2.cstr());
- logerror( "\tVideo: %s\n", (head_ispal) ? "PAL" : "NTSC");
+ logerror( "\tVideo: %s\n", (head_ispal) ? "PAL" : "NTSC");
}
diff --git a/src/emu/bus/a7800/a78_slot.h b/src/emu/bus/a7800/a78_slot.h
index b9c7e935d40..528c8932c04 100644
--- a/src/emu/bus/a7800/a78_slot.h
+++ b/src/emu/bus/a7800/a78_slot.h
@@ -12,19 +12,19 @@
/* PCB */
enum
{
- A78_TYPE0 = 0, // standard 8K/16K/32K games, no bankswitch
- A78_TYPE1, // as TYPE0 + POKEY chip on the PCB
- A78_TYPE2, // Atari SuperGame pcb (8x16K banks with bankswitch)
- A78_TYPE3, // as TYPE1 + POKEY chip on the PCB
- A78_TYPE6, // as TYPE1 + RAM IC on the PCB
- A78_TYPEA, // Alien Brigade, Crossbow (9x16K banks with diff bankswitch)
- A78_ABSOLUTE, // F18 Hornet
- A78_ACTIVISION, // Double Dragon, Rampage
- A78_HSC, // Atari HighScore cart
- A78_XB_BOARD, // A7800 Expansion Board (it shall more or less apply to the Expansion Module too, but this is not officially released yet)
- A78_XM_BOARD, // A7800 XM Expansion Module (theoretical specs only, since this is not officially released yet)
- A78_MEGACART, // Homebrew by CPUWIZ, consists of SuperGame bank up to 512K + 32K RAM banked
- A78_VERSABOARD = 0x10, // Homebrew by CPUWIZ, consists of SuperGame bank up to 256K + 32K RAM banked
+ A78_TYPE0 = 0, // standard 8K/16K/32K games, no bankswitch
+ A78_TYPE1, // as TYPE0 + POKEY chip on the PCB
+ A78_TYPE2, // Atari SuperGame pcb (8x16K banks with bankswitch)
+ A78_TYPE3, // as TYPE1 + POKEY chip on the PCB
+ A78_TYPE6, // as TYPE1 + RAM IC on the PCB
+ A78_TYPEA, // Alien Brigade, Crossbow (9x16K banks with diff bankswitch)
+ A78_ABSOLUTE, // F18 Hornet
+ A78_ACTIVISION, // Double Dragon, Rampage
+ A78_HSC, // Atari HighScore cart
+ A78_XB_BOARD, // A7800 Expansion Board (it shall more or less apply to the Expansion Module too, but this is not officially released yet)
+ A78_XM_BOARD, // A7800 XM Expansion Module (theoretical specs only, since this is not officially released yet)
+ A78_MEGACART, // Homebrew by CPUWIZ, consists of SuperGame bank up to 512K + 32K RAM banked
+ A78_VERSABOARD = 0x10, // Homebrew by CPUWIZ, consists of SuperGame bank up to 256K + 32K RAM banked
// VersaBoard variants configured as Type 1/3/A or VersaBoard + POKEY at $0450
A78_TYPE0_POK450 = 0x20,
A78_TYPE1_POK450 = 0x21,
@@ -68,7 +68,7 @@ protected:
UINT8 *m_rom;
UINT32 m_rom_size;
dynamic_buffer m_ram;
- dynamic_buffer m_nvram; // HiScore cart can save scores!
+ dynamic_buffer m_nvram; // HiScore cart can save scores!
// helpers
UINT32 m_base_rom;
int m_bank_mask;
@@ -101,7 +101,7 @@ public:
int get_cart_type() { return m_type; };
int identify_cart_type(UINT8 *ROM, UINT32 len);
bool has_cart() { return m_cart != NULL; }
-
+
virtual iodevice_t image_type() const { return IO_CARTSLOT; }
virtual bool is_readable() const { return 1; }
virtual bool is_writeable() const { return 0; }
@@ -125,7 +125,7 @@ public:
virtual DECLARE_WRITE8_MEMBER(write_10xx);
virtual DECLARE_WRITE8_MEMBER(write_30xx);
virtual DECLARE_WRITE8_MEMBER(write_40xx);
-
+
private:
device_a78_cart_interface* m_cart;
int m_type;
diff --git a/src/emu/bus/a7800/cpuwiz.c b/src/emu/bus/a7800/cpuwiz.c
index c5d6ef74532..f25580a1c08 100644
--- a/src/emu/bus/a7800/cpuwiz.c
+++ b/src/emu/bus/a7800/cpuwiz.c
@@ -3,26 +3,26 @@
/***********************************************************************************************************
A7800 CPUWIZ's homebrew boards (MegaCart+ and VersaBoard)
-
+
Here we emulate the base configurations of these two boards:
MegaCart+ = up to 512K (31 banks at $8000, 1 at $C000) of ROM and 2 x 16K RAM @ $4000
VersaBoard = up to 256K of ROM and 2 x 16K RAM
-
- Plus, for the moment, a VersaBoard with POKEY mapped at 0x0450 and support for 144K ROM,
- since a few demo homebrew programs seems to use this to combine compatibility with
+
+ Plus, for the moment, a VersaBoard with POKEY mapped at 0x0450 and support for 144K ROM,
+ since a few demo homebrew programs seems to use this to combine compatibility with
XBoarD & XM expansions
Note that the VersaBoard can be configured to work with different banking hardware
e.g. with SG 9bank games or with SG + RAM (so to allow reproduction of games which
- could have worked on old carts without sacrifying original carts), but games running
+ could have worked on old carts without sacrifying original carts), but games running
on those "standard" variants can be emulated with the standard code from rom.c ;-)
-
-
+
+
TO DO:
- investigate whether the POKEY detection routines in homebrew do fail due to emulation
issues or not
-
+
***********************************************************************************************************/
@@ -86,7 +86,7 @@ READ8_MEMBER(a78_versaboard_device::read_40xx)
else if (offset < 0x8000)
return m_rom[(offset & 0x3fff) + (m_bank * 0x4000)];
else
- return m_rom[(offset & 0x3fff) + (m_bank_mask * 0x4000)]; // last bank
+ return m_rom[(offset & 0x3fff) + (m_bank_mask * 0x4000)]; // last bank
}
WRITE8_MEMBER(a78_versaboard_device::write_40xx)
@@ -130,5 +130,3 @@ machine_config_constructor a78_rom_p450_vb_device::device_mconfig_additions() co
{
return MACHINE_CONFIG_NAME( a78_pokeyvb );
}
-
-
diff --git a/src/emu/bus/a7800/cpuwiz.h b/src/emu/bus/a7800/cpuwiz.h
index ab019433b70..193ba336b96 100644
--- a/src/emu/bus/a7800/cpuwiz.h
+++ b/src/emu/bus/a7800/cpuwiz.h
@@ -15,15 +15,15 @@ public:
// construction/destruction
a78_versaboard_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
a78_versaboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_40xx);
virtual DECLARE_WRITE8_MEMBER(write_40xx);
-
+
protected:
int m_ram_bank;
};
@@ -36,7 +36,7 @@ class a78_megacart_device : public a78_versaboard_device
public:
// construction/destruction
a78_megacart_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_WRITE8_MEMBER(write_40xx);
};
@@ -51,14 +51,14 @@ class a78_rom_p450_vb_device : public a78_versaboard_device
public:
// construction/destruction
a78_rom_p450_vb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual machine_config_constructor device_mconfig_additions() const;
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_04xx) { if (offset >= 0x50 && offset < 0x60) return m_pokey450->read(space, offset & 0x0f); else return 0xff; }
virtual DECLARE_WRITE8_MEMBER(write_04xx) { if (offset >= 0x50 && offset < 0x60) m_pokey450->write(space, offset & 0x0f, data); }
-
+
protected:
required_device<pokey_device> m_pokey450;
};
diff --git a/src/emu/bus/a7800/hiscore.c b/src/emu/bus/a7800/hiscore.c
index 2e941af9fbd..c51d1c26b74 100644
--- a/src/emu/bus/a7800/hiscore.c
+++ b/src/emu/bus/a7800/hiscore.c
@@ -3,7 +3,7 @@
/***********************************************************************************************************
A7800 HighScore passthrough cart emulation
-
+
***********************************************************************************************************/
@@ -75,4 +75,3 @@ WRITE8_MEMBER(a78_hiscore_device::write_40xx)
{
m_hscslot->write_40xx(space, offset, data);
}
-
diff --git a/src/emu/bus/a7800/hiscore.h b/src/emu/bus/a7800/hiscore.h
index d848becfea7..d1750c77486 100644
--- a/src/emu/bus/a7800/hiscore.h
+++ b/src/emu/bus/a7800/hiscore.h
@@ -14,10 +14,10 @@ class a78_hiscore_device : public a78_rom_device
public:
// construction/destruction
a78_hiscore_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual machine_config_constructor device_mconfig_additions() const;
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_04xx);
virtual DECLARE_WRITE8_MEMBER(write_04xx);
diff --git a/src/emu/bus/a7800/rom.c b/src/emu/bus/a7800/rom.c
index 508c9cc895b..d2bfc5d78a4 100644
--- a/src/emu/bus/a7800/rom.c
+++ b/src/emu/bus/a7800/rom.c
@@ -10,7 +10,7 @@
- 9 banks or not
etc...
But we might merge many of these if they become too many
-
+
TODO:
- Are POKEY regs readable somewhere in SG 144K + POKEY homebrew? How do they detect
the POKEY otherwise?!?
@@ -232,11 +232,11 @@ READ8_MEMBER(a78_rom_device::read_40xx)
/*-------------------------------------------------
Carts with no bankswitch + POKEY chip
- The Pokey chips is accessed by writing at
+ The Pokey chips is accessed by writing at
0x4000-0x7fff.
-
+
GAMES: Ballblazer, Beef Drop (homebrew)
-
+
-------------------------------------------------*/
READ8_MEMBER(a78_rom_pokey_device::read_40xx)
@@ -274,19 +274,19 @@ machine_config_constructor a78_rom_pokey_device::device_mconfig_additions() cons
some test is run)
Note that the code is written so that also
homebrew games with larger ROMs work!
-
+
GAMES: Crack'd, Fatal Run, Ikari Warriors...
-
+
-------------------------------------------------*/
READ8_MEMBER(a78_rom_sg_device::read_40xx)
{
if (offset < 0x4000)
- return m_rom[(offset & 0x3fff) + ((m_bank_mask - 1) * 0x4000)]; // second to last bank (is this always ok?!?)
+ return m_rom[(offset & 0x3fff) + ((m_bank_mask - 1) * 0x4000)]; // second to last bank (is this always ok?!?)
else if (offset < 0x8000)
return m_rom[(offset & 0x3fff) + (m_bank * 0x4000)];
else
- return m_rom[(offset & 0x3fff) + (m_bank_mask * 0x4000)]; // last bank
+ return m_rom[(offset & 0x3fff) + (m_bank_mask * 0x4000)]; // last bank
}
WRITE8_MEMBER(a78_rom_sg_device::write_40xx)
@@ -300,9 +300,9 @@ WRITE8_MEMBER(a78_rom_sg_device::write_40xx)
Carts with SuperGame bankswitch + POKEY chip
As above + Pokey chip access
-
+
GAMES: Commando
-
+
-------------------------------------------------*/
READ8_MEMBER(a78_rom_sg_pokey_device::read_40xx)
@@ -312,7 +312,7 @@ READ8_MEMBER(a78_rom_sg_pokey_device::read_40xx)
else if (offset < 0x8000)
return m_rom[(offset & 0x3fff) + (m_bank * 0x4000)];
else
- return m_rom[(offset & 0x3fff) + (m_bank_mask * 0x4000)]; // last bank
+ return m_rom[(offset & 0x3fff) + (m_bank_mask * 0x4000)]; // last bank
}
WRITE8_MEMBER(a78_rom_sg_pokey_device::write_40xx)
@@ -332,12 +332,12 @@ machine_config_constructor a78_rom_sg_pokey_device::device_mconfig_additions() c
/*-------------------------------------------------
Carts with SuperGame bankswitch + 16K RAM
- FIXME: Some games contained only 8K of RAM, but
+ FIXME: Some games contained only 8K of RAM, but
for the moment we treat all as 16K of RAM even if
from softlist we shall differentiate between them.
-
+
GAMES: Impossible Mission, Jinks and some protos
-
+
-------------------------------------------------*/
READ8_MEMBER(a78_rom_sg_ram_device::read_40xx)
@@ -347,7 +347,7 @@ READ8_MEMBER(a78_rom_sg_ram_device::read_40xx)
else if (offset < 0x8000)
return m_rom[(offset & 0x3fff) + (m_bank * 0x4000)];
else
- return m_rom[(offset & 0x3fff) + (m_bank_mask * 0x4000)]; // last bank
+ return m_rom[(offset & 0x3fff) + (m_bank_mask * 0x4000)]; // last bank
}
WRITE8_MEMBER(a78_rom_sg_ram_device::write_40xx)
@@ -364,11 +364,11 @@ WRITE8_MEMBER(a78_rom_sg_ram_device::write_40xx)
Carts with SuperGame bankswitch 9banks:
9 x 16K banks mappable in 0x8000-0xbfff
bank 7 is always mapped in 0xc000-0xffff
-
- GAMES: Alien Brigade & Crossbow + some homebrew
- like Donkey Kong XM demo, Bentley Bear's Crystal
+
+ GAMES: Alien Brigade & Crossbow + some homebrew
+ like Donkey Kong XM demo, Bentley Bear's Crystal
Quest
-
+
-------------------------------------------------*/
READ8_MEMBER(a78_rom_sg9_device::read_40xx)
@@ -378,7 +378,7 @@ READ8_MEMBER(a78_rom_sg9_device::read_40xx)
else if (offset < 0x8000)
return m_rom[(offset & 0x3fff) + (m_bank * 0x4000)];
else
- return m_rom[(offset & 0x3fff) + ((m_bank_mask + 1) * 0x4000)]; // last bank
+ return m_rom[(offset & 0x3fff) + ((m_bank_mask + 1) * 0x4000)]; // last bank
}
WRITE8_MEMBER(a78_rom_sg9_device::write_40xx)
@@ -388,14 +388,14 @@ WRITE8_MEMBER(a78_rom_sg9_device::write_40xx)
}
/*-------------------------------------------------
-
+
Carts with Absolute bankswitch:
64K games. Lower 32K are 2 banks of 16K to be mapped
in 0x4000-0x7fff, depending on the value written
at 0x8000. Higher 32K are fixed in 0x8000-0xffff
-
+
GAMES: F-18 Hornet
-
+
-------------------------------------------------*/
READ8_MEMBER(a78_rom_abs_device::read_40xx)
@@ -431,9 +431,9 @@ WRITE8_MEMBER(a78_rom_abs_device::write_40xx)
0x6000-0x7fff first 8kb of bank 6
0x8000-0x9fff second 8kb of bank 7
0xe000-0xffff first 8kb of bank 7
-
+
GAMES: Double Dragon, Rampage.
-
+
-------------------------------------------------*/
READ8_MEMBER(a78_rom_act_device::read_40xx)
@@ -495,4 +495,3 @@ machine_config_constructor a78_rom_p450_sg9_device::device_mconfig_additions() c
{
return MACHINE_CONFIG_NAME( a78_pokey450 );
}
-
diff --git a/src/emu/bus/a7800/rom.h b/src/emu/bus/a7800/rom.h
index 425513d02d7..16f31360a74 100644
--- a/src/emu/bus/a7800/rom.h
+++ b/src/emu/bus/a7800/rom.h
@@ -34,14 +34,14 @@ public:
// construction/destruction
a78_rom_pokey_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
a78_rom_pokey_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual machine_config_constructor device_mconfig_additions() const;
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_40xx);
virtual DECLARE_WRITE8_MEMBER(write_40xx);
-
+
protected:
required_device<pokey_device> m_pokey;
};
@@ -55,11 +55,11 @@ public:
// construction/destruction
a78_rom_sg_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
a78_rom_sg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_40xx);
virtual DECLARE_WRITE8_MEMBER(write_40xx);
@@ -76,14 +76,14 @@ class a78_rom_sg_pokey_device : public a78_rom_sg_device
public:
// construction/destruction
a78_rom_sg_pokey_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual machine_config_constructor device_mconfig_additions() const;
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_40xx);
virtual DECLARE_WRITE8_MEMBER(write_40xx);
-
+
protected:
required_device<pokey_device> m_pokey;
};
@@ -97,7 +97,7 @@ public:
// construction/destruction
a78_rom_sg_ram_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
a78_rom_sg_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_40xx);
virtual DECLARE_WRITE8_MEMBER(write_40xx);
@@ -112,7 +112,7 @@ public:
// construction/destruction
a78_rom_sg9_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
a78_rom_sg9_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_40xx);
virtual DECLARE_WRITE8_MEMBER(write_40xx);
@@ -126,15 +126,15 @@ class a78_rom_abs_device : public a78_rom_device
public:
// construction/destruction
a78_rom_abs_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_40xx);
virtual DECLARE_WRITE8_MEMBER(write_40xx);
-
+
protected:
int m_bank;
};
@@ -147,15 +147,15 @@ class a78_rom_act_device : public a78_rom_device
public:
// construction/destruction
a78_rom_act_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_40xx);
virtual DECLARE_WRITE8_MEMBER(write_40xx);
-
+
protected:
int m_bank;
};
@@ -170,13 +170,13 @@ class a78_rom_p450_device : public a78_rom_device
public:
// construction/destruction
a78_rom_p450_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
virtual machine_config_constructor device_mconfig_additions() const;
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_04xx) { if (offset >= 0x50 && offset < 0x60) return m_pokey450->read(space, offset & 0x0f); else return 0xff; }
virtual DECLARE_WRITE8_MEMBER(write_04xx) { if (offset >= 0x50 && offset < 0x60) m_pokey450->write(space, offset & 0x0f, data); }
-
+
protected:
required_device<pokey_device> m_pokey450;
};
@@ -189,13 +189,13 @@ class a78_rom_p450_pokey_device : public a78_rom_pokey_device
public:
// construction/destruction
a78_rom_p450_pokey_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
virtual machine_config_constructor device_mconfig_additions() const;
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_04xx) { if (offset >= 0x50 && offset < 0x60) return m_pokey450->read(space, offset & 0x0f); else return 0xff; }
virtual DECLARE_WRITE8_MEMBER(write_04xx) { if (offset >= 0x50 && offset < 0x60) m_pokey450->write(space, offset & 0x0f, data); }
-
+
protected:
required_device<pokey_device> m_pokey450;
};
@@ -208,13 +208,13 @@ class a78_rom_p450_sg_ram_device : public a78_rom_sg_ram_device
public:
// construction/destruction
a78_rom_p450_sg_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
virtual machine_config_constructor device_mconfig_additions() const;
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_04xx) { if (offset >= 0x50 && offset < 0x60) return m_pokey450->read(space, offset & 0x0f); else return 0xff; }
virtual DECLARE_WRITE8_MEMBER(write_04xx) { if (offset >= 0x50 && offset < 0x60) m_pokey450->write(space, offset & 0x0f, data); }
-
+
protected:
required_device<pokey_device> m_pokey450;
};
@@ -227,13 +227,13 @@ class a78_rom_p450_sg9_device : public a78_rom_sg9_device
public:
// construction/destruction
a78_rom_p450_sg9_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
virtual machine_config_constructor device_mconfig_additions() const;
// reading and writing
virtual DECLARE_READ8_MEMBER(read_04xx) { if (offset >= 0x50 && offset < 0x60) return m_pokey450->read(space, offset & 0x0f); else return 0xff; }
virtual DECLARE_WRITE8_MEMBER(write_04xx) { if (offset >= 0x50 && offset < 0x60) m_pokey450->write(space, offset & 0x0f, data); }
-
+
protected:
required_device<pokey_device> m_pokey450;
};
diff --git a/src/emu/bus/a7800/xboard.c b/src/emu/bus/a7800/xboard.c
index 66c89d3d05c..4a7d3742f1b 100644
--- a/src/emu/bus/a7800/xboard.c
+++ b/src/emu/bus/a7800/xboard.c
@@ -3,7 +3,7 @@
/***********************************************************************************************************
A7800 XBoarD & XM expansions emulation
-
+
The XBoarD should be socketed in the A7800 pcb in place of the Maria chip.
It adds to the system additional 128K of RAM and an onboard pokey.
The XM seems to work the same as XBoarD, but it also features HighScore savings
@@ -12,31 +12,31 @@
Currently, we emulate both of these as a passthru cart, even if not 100% accurate for the XBoarD
-
+
Memory map:
POKEY1 $0450 $045F 16 bytes
POKEY2* $0460 $046F 16 bytes
XCTRL $0470 $047F 1 byte
RAM $4000 $7FFF 16384 bytes
-
+
XCTRL Bit Description
-
+
+-------------------------------+
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
+-------------------------------+
| | | | | | | |
| | | | | | | +-- Bank select bit 0 \
| | | | | | +------ Bank select bit 1 | Totally 128 KByte in 16 KByte banks
- | | | | | +---------- Bank select bit 2 /
+ | | | | | +---------- Bank select bit 2 /
| | | | +-------------- Enable memory bit (1 = Memory enabled, 0 after power on)
| | | +------------------ Enable POKEY bit** (1 = POKEY enabled, 0 after power on)
| | |
NA NA NA = Not Available or Not Used
-
+
* = Can be mounted piggy back on the first POKEY. Description how to do this will come when i have tried it out.
** This bit controls both POKEY chip select signals.
-
+
TODO:
- verify what happens when 2 POKEYs are present
@@ -142,9 +142,9 @@ machine_config_constructor a78_xm_device::device_mconfig_additions() const
-------------------------------------------------*/
/*-------------------------------------------------
-
+
XBoarD: passthru + 128K RAM + POKEY
-
+
-------------------------------------------------*/
READ8_MEMBER(a78_xboard_device::read_40xx)
@@ -168,7 +168,7 @@ READ8_MEMBER(a78_xboard_device::read_04xx)
if (BIT(m_reg, 4) && offset >= 0x50 && offset < 0x60)
return m_pokey->read(space, offset & 0x0f);
else if (BIT(m_reg, 4) && offset >= 0x60 && offset < 0x70)
- return m_xbslot->read_04xx(space, offset - 0x10); // access second POKEY
+ return m_xbslot->read_04xx(space, offset - 0x10); // access second POKEY
else
return 0xff;
}
@@ -178,7 +178,7 @@ WRITE8_MEMBER(a78_xboard_device::write_04xx)
if (BIT(m_reg, 4) && offset >= 0x50 && offset < 0x60)
m_pokey->write(space, offset & 0x0f, data);
else if (BIT(m_reg, 4) && offset >= 0x60 && offset < 0x70)
- m_xbslot->write_04xx(space, offset - 0x10, data); // access second POKEY
+ m_xbslot->write_04xx(space, offset - 0x10, data); // access second POKEY
else if (offset >= 0x70 && offset < 0x80)
{
m_reg = data;
@@ -188,9 +188,9 @@ WRITE8_MEMBER(a78_xboard_device::write_04xx)
/*-------------------------------------------------
-
+
XM: Same as above but also featuring High Score savings
-
+
-------------------------------------------------*/
READ8_MEMBER(a78_xm_device::read_10xx)
@@ -215,7 +215,7 @@ READ8_MEMBER(a78_xm_device::read_04xx)
else if (m_ym_enabled && offset >= 0x60 && offset <= 0x61)
return m_ym->read(space, offset & 1);
else if (BIT(m_reg, 4) && offset >= 0x60 && offset < 0x70)
- return m_xbslot->read_04xx(space, offset - 0x10); // access second POKEY
+ return m_xbslot->read_04xx(space, offset - 0x10); // access second POKEY
else
return 0xff;
}
@@ -227,7 +227,7 @@ WRITE8_MEMBER(a78_xm_device::write_04xx)
else if (m_ym_enabled && offset >= 0x60 && offset <= 0x61)
m_ym->write(space, offset & 1, data);
else if (BIT(m_reg, 4) && offset >= 0x60 && offset < 0x70)
- m_xbslot->write_04xx(space, offset - 0x10, data); // access second POKEY
+ m_xbslot->write_04xx(space, offset - 0x10, data); // access second POKEY
else if (offset >= 0x70 && offset < 0x80)
{
//printf("regs 0x%X\n", data);
diff --git a/src/emu/bus/a7800/xboard.h b/src/emu/bus/a7800/xboard.h
index 2eb63462b47..0e5e7f26cf0 100644
--- a/src/emu/bus/a7800/xboard.h
+++ b/src/emu/bus/a7800/xboard.h
@@ -17,12 +17,12 @@ public:
// construction/destruction
a78_xboard_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
a78_xboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual machine_config_constructor device_mconfig_additions() const;
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_04xx);
virtual DECLARE_WRITE8_MEMBER(write_04xx);
@@ -43,19 +43,19 @@ class a78_xm_device : public a78_xboard_device
public:
// construction/destruction
a78_xm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual machine_config_constructor device_mconfig_additions() const;
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_04xx);
virtual DECLARE_WRITE8_MEMBER(write_04xx);
virtual DECLARE_READ8_MEMBER(read_10xx);
virtual DECLARE_WRITE8_MEMBER(write_10xx);
virtual DECLARE_READ8_MEMBER(read_30xx);
-
+
protected:
required_device<ym2151_device> m_ym;
int m_ym_enabled;