summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/bus/nes
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/bus/nes')
-rw-r--r--src/emu/bus/nes/act53.c20
-rw-r--r--src/emu/bus/nes/aladdin.c36
-rw-r--r--src/emu/bus/nes/aladdin.h30
-rw-r--r--src/emu/bus/nes/bandai.c6
-rw-r--r--src/emu/bus/nes/bandai.h6
-rw-r--r--src/emu/bus/nes/camerica.c6
-rw-r--r--src/emu/bus/nes/datach.c38
-rw-r--r--src/emu/bus/nes/datach.h16
-rw-r--r--src/emu/bus/nes/jy.c20
-rw-r--r--src/emu/bus/nes/jy.h4
-rw-r--r--src/emu/bus/nes/karastudio.c41
-rw-r--r--src/emu/bus/nes/karastudio.h28
-rw-r--r--src/emu/bus/nes/mmc5.c34
-rw-r--r--src/emu/bus/nes/mmc5.h2
-rw-r--r--src/emu/bus/nes/nes_carts.c3
-rw-r--r--src/emu/bus/nes/nes_ines.inc14
-rw-r--r--src/emu/bus/nes/nes_slot.h4
-rw-r--r--src/emu/bus/nes/nxrom.c24
-rw-r--r--src/emu/bus/nes/sunsoft_dcs.c8
-rw-r--r--src/emu/bus/nes/sunsoft_dcs.h8
20 files changed, 173 insertions, 175 deletions
diff --git a/src/emu/bus/nes/act53.c b/src/emu/bus/nes/act53.c
index 5ee6293ac68..6914d1137df 100644
--- a/src/emu/bus/nes/act53.c
+++ b/src/emu/bus/nes/act53.c
@@ -7,7 +7,7 @@
Visit http://mamedev.org for licensing and usage restrictions.
- Here we emulate the Multi-Discrete PCB designed by Tepples for
+ Here we emulate the Multi-Discrete PCB designed by Tepples for
this homebew multicart [mapper 28]
***********************************************************************************************************/
@@ -67,23 +67,23 @@ void nes_action53_device::pcb_reset()
Board ACTION 53
- In MESS: *VERY* preliminary support.
-
+ In MESS: *VERY* preliminary support.
+
This board uses 4 registers (reg is selected by writes to 0x5xxx)
Info from nesdev wiki
-
+
R:$00: [...M ..CC]
C = CHR Reg
M = Mirroring
This bit overwrites bit 0 of R:$80, but only if bit 1 of
R:$80 is clear
-
+
R:$01: [...M PPPP]
P = PRG Reg
M = Mirroring
This bit overwrites bit 0 of R:$80, but only if bit 1 of
R:$80 is clear
-
+
R:$80: [..GG PSMM]
G = Game Size (0=32K, 1=64K, 2=128K, 3=256K)
P = PRG Size (0=32k mode, 1=16k mode)
@@ -106,9 +106,9 @@ void nes_action53_device::pcb_reset()
void nes_action53_device::update_prg()
{
UINT8 prg_lo = 0, prg_hi = 0, helper = 0;
- UINT8 out = (m_reg[3] & 0x3f) << 1; // Outer PRG reg
- UINT8 size = (m_reg[2] & 0x30) >> 4; // Game size
- UINT8 mask = (1 << (size + 1)) - 1; // Bits to be taken from PRG reg
+ UINT8 out = (m_reg[3] & 0x3f) << 1; // Outer PRG reg
+ UINT8 size = (m_reg[2] & 0x30) >> 4; // Game size
+ UINT8 mask = (1 << (size + 1)) - 1; // Bits to be taken from PRG reg
if (!BIT(m_reg[2], 3))
{
@@ -134,7 +134,7 @@ void nes_action53_device::update_prg()
}
}
-// printf("banks : 0x%2X - 0x%2X\n", prg_lo, prg_hi);
+// printf("banks : 0x%2X - 0x%2X\n", prg_lo, prg_hi);
prg16_89ab(prg_lo);
prg16_cdef(prg_hi);
}
diff --git a/src/emu/bus/nes/aladdin.c b/src/emu/bus/nes/aladdin.c
index 9a09aba7818..ea5e3a763d3 100644
--- a/src/emu/bus/nes/aladdin.c
+++ b/src/emu/bus/nes/aladdin.c
@@ -31,7 +31,7 @@
//----------------------------------
//
-// Aladdin Cartslot implementation
+// Aladdin Cartslot implementation
//
//----------------------------------
@@ -52,7 +52,7 @@ aladdin_cart_interface::~aladdin_cart_interface()
}
READ8_MEMBER(aladdin_cart_interface::read)
-{
+{
if (offset < 0x4000)
return m_rom[(m_lobank * 0x4000) + (offset & 0x3fff)];
else
@@ -86,7 +86,7 @@ READ8_MEMBER(nes_aladdin_slot_device::read)
{
if (m_cart)
return m_cart->read(space, offset, mem_mask);
-
+
return 0xff;
}
@@ -100,18 +100,18 @@ bool nes_aladdin_slot_device::call_load()
if (!ROM)
return IMAGE_INIT_FAIL;
-
+
if (software_entry() == NULL)
{
if (length() != 0x20010 && length() != 0x40010)
return IMAGE_INIT_FAIL;
-
+
UINT8 temp[0x40010];
size = length() - 0x10;
fread(&temp, length());
memcpy(ROM, temp + 0x10, size);
-
- // double check that iNES files are really mapper 71 or 232
+
+ // double check that iNES files are really mapper 71 or 232
{
UINT8 mapper = (temp[6] & 0xf0) >> 4;
mapper |= temp[7] & 0xf0;
@@ -123,14 +123,14 @@ bool nes_aladdin_slot_device::call_load()
{
if (get_software_region_length("rom") != 0x20000 && get_software_region_length("rom") != 0x40000)
return IMAGE_INIT_FAIL;
-
+
size = get_software_region_length("rom");
memcpy(ROM, get_software_region("rom"), size);
}
m_cart->set_cart_size(size);
}
-
+
return IMAGE_INIT_PASS;
}
@@ -149,19 +149,19 @@ void nes_aladdin_slot_device::get_default_card_software(astring &result)
UINT32 len = core_fsize(m_file);
dynamic_buffer rom(len);
UINT8 mapper;
-
+
core_fread(m_file, rom, len);
mapper = (rom[6] & 0xf0) >> 4;
mapper |= rom[7] & 0xf0;
-// if (mapper == 71)
-// slot_string = "algn";
+// if (mapper == 71)
+// slot_string = "algn";
if (mapper == 232)
slot_string = "algq";
clear();
-
+
result.cpy(slot_string);
}
else
@@ -171,7 +171,7 @@ void nes_aladdin_slot_device::get_default_card_software(astring &result)
//----------------------------------
//
-// Aladdin Minicart implementation
+// Aladdin Minicart implementation
//
//----------------------------------
@@ -262,7 +262,7 @@ void nes_algq_rom_device::write_prg(UINT32 offset, UINT8 data)
//-----------------------------------------------
//
-// Camerica/Codemasters Aladdin passthru
+// Camerica/Codemasters Aladdin passthru
// implementation
//
//-----------------------------------------------
@@ -295,7 +295,7 @@ void nes_aladdin_device::pcb_reset()
/*-------------------------------------------------
Camerica/Codemasters Aladdin Deck Enhancer
-
+
iNES: mapper 71 & 232
In MESS: Supported (but timing issues in some games)
@@ -307,10 +307,10 @@ READ8_MEMBER(nes_aladdin_device::read_h)
LOG_MMC(("aladdin read_h, offset: %04x\n", offset));
// this shall be the proper code, but it's a bit slower, so we access directly the subcart below
//return m_subslot->read(space, offset, mem_mask);
-
+
if (m_subslot->m_cart)
return m_subslot->m_cart->read(space, offset, mem_mask);
- else // this is "fake" in the sense that we fill CPU space with 0xff if no Aladdin cart is loaded
+ else // this is "fake" in the sense that we fill CPU space with 0xff if no Aladdin cart is loaded
return hi_access_rom(offset);
}
diff --git a/src/emu/bus/nes/aladdin.h b/src/emu/bus/nes/aladdin.h
index 922e9778a82..fad8ac15f27 100644
--- a/src/emu/bus/nes/aladdin.h
+++ b/src/emu/bus/nes/aladdin.h
@@ -6,7 +6,7 @@
//----------------------------------
//
-// Aladdin Cartslot implementation
+// Aladdin Cartslot implementation
//
//----------------------------------
@@ -18,14 +18,14 @@ public:
// construction/destruction
aladdin_cart_interface(const machine_config &mconfig, device_t &device);
virtual ~aladdin_cart_interface();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read);
-
+
UINT8 *get_cart_base() { return m_rom; }
void set_cart_size(UINT32 size) { m_rom_size = size; m_rom_mask = (size / 0x4000) - 1; }
virtual void write_prg(UINT32 offset, UINT8 data) { }
-
+
protected:
// internal state
UINT8 *m_rom;
@@ -43,15 +43,15 @@ public:
// construction/destruction
nes_aladdin_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
virtual ~nes_aladdin_slot_device();
-
+
// device-level overrides
virtual void device_start();
virtual void device_config_complete() { update_names(); }
-
+
// image-level overrides
virtual bool call_load();
virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry);
-
+
virtual iodevice_t image_type() const { return IO_CARTSLOT; }
virtual bool is_readable() const { return 1; }
virtual bool is_writeable() const { return 0; }
@@ -61,13 +61,13 @@ public:
virtual const char *image_interface() const { return "ade_cart"; }
virtual const char *file_extensions() const { return "nes,bin"; }
virtual const option_guide *create_option_guide() const { return NULL; }
-
+
// slot interface overrides
virtual void get_default_card_software(astring &result);
-
+
virtual DECLARE_READ8_MEMBER(read);
void write_prg(UINT32 offset, UINT8 data) { if (m_cart) m_cart->write_prg(offset, data); }
-
+
aladdin_cart_interface* m_cart;
};
@@ -82,7 +82,7 @@ extern const device_type NES_ALADDIN_SLOT;
//----------------------------------
//
-// Aladdin Minicart implementation
+// Aladdin Minicart implementation
//
//----------------------------------
@@ -95,12 +95,12 @@ public:
// construction/destruction
nes_algn_rom_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);
nes_algn_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// optional information overrides
virtual const rom_entry *device_rom_region() const;
virtual UINT8* get_cart_base();
virtual void write_prg(UINT32 offset, UINT8 data);
-
+
protected:
// device-level overrides
virtual void device_start();
@@ -115,7 +115,7 @@ class nes_algq_rom_device : public nes_algn_rom_device
public:
// construction/destruction
nes_algq_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// optional information overrides
virtual void write_prg(UINT32 offset, UINT8 data);
@@ -134,7 +134,7 @@ extern const device_type NES_ALGQ_ROM;
//-----------------------------------------------
//
-// Codemasters Aladdin passthru implementation
+// Codemasters Aladdin passthru implementation
//
//-----------------------------------------------
diff --git a/src/emu/bus/nes/bandai.c b/src/emu/bus/nes/bandai.c
index e92b2ad33ed..4114f32896f 100644
--- a/src/emu/bus/nes/bandai.c
+++ b/src/emu/bus/nes/bandai.c
@@ -19,11 +19,11 @@
* Bandai Datach Joint ROM System [mapper 157] is emulated in a separate source file
to implement also the subslot, but the PCB is basically a Bandai LZ93D50 + 24C02 EEPROM
pcb with added barcode reader and subslot
-
+
* Bandai Karaoke Studio [mapper 188] is emulated in a separate source file
to implement also the subslot and the mic inputs
-
-
+
+
TODO:
- investigate why EEPROM does not work
- add support to the PPU for the code necessary to Oeka Kids games (also needed by UNL-DANCE2000 PCB)
diff --git a/src/emu/bus/nes/bandai.h b/src/emu/bus/nes/bandai.h
index 9fafb604c6f..2561fdfa264 100644
--- a/src/emu/bus/nes/bandai.h
+++ b/src/emu/bus/nes/bandai.h
@@ -38,7 +38,7 @@ public:
// construction/destruction
nes_fcg_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);
nes_fcg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
@@ -46,11 +46,11 @@ public:
virtual DECLARE_WRITE8_MEMBER(write_m);
virtual void pcb_reset();
-
+
protected:
UINT16 m_irq_count;
int m_irq_enable;
-
+
static const device_timer_id TIMER_IRQ = 0;
emu_timer *irq_timer;
};
diff --git a/src/emu/bus/nes/camerica.c b/src/emu/bus/nes/camerica.c
index 8b0386034d7..5c70ea8ecb9 100644
--- a/src/emu/bus/nes/camerica.c
+++ b/src/emu/bus/nes/camerica.c
@@ -13,10 +13,10 @@
* Camerica BF9096 Boards [mapper 232]
* Camerica Golden Five [mapper 104]
- Aladdin Deck Enhancer pass-thru cart and the corresponding minicarts
+ Aladdin Deck Enhancer pass-thru cart and the corresponding minicarts
(ALGNV11 & ALGQV11 PCBs) are emulated in a separate source file.
-
+
TODO:
- check what causes flickering from PPU in Fire Hawk, Poogie and Big Nose (same PPU issue as Back to
Future 2&3?)
@@ -189,7 +189,7 @@ WRITE8_MEMBER(nes_bf9096_device::write_h)
{
m_latch = data & 3;
prg16_89ab(m_bank_base | m_latch);
- }
+ }
}
/*-------------------------------------------------
diff --git a/src/emu/bus/nes/datach.c b/src/emu/bus/nes/datach.c
index b16efe9ffdf..949ae046b41 100644
--- a/src/emu/bus/nes/datach.c
+++ b/src/emu/bus/nes/datach.c
@@ -35,7 +35,7 @@
//--------------------------------
//
-// Datach Cartslot implementation
+// Datach Cartslot implementation
//
//--------------------------------
@@ -55,7 +55,7 @@ datach_cart_interface::~datach_cart_interface()
}
READ8_MEMBER(datach_cart_interface::read)
-{
+{
if (offset < 0x4000)
return m_rom[(m_bank * 0x4000) + (offset & 0x3fff)];
else
@@ -113,7 +113,7 @@ bool nes_datach_slot_device::call_load()
fread(&temp, length());
memcpy(ROM, temp + shift, 0x40000);
- // double check that iNES files are really mapper 157
+ // double check that iNES files are really mapper 157
// (or 16, since some older .nes files marked Datach as mapper 16)
if (length() == 0x40010)
{
@@ -153,7 +153,7 @@ void nes_datach_slot_device::get_default_card_software(astring &result)
//--------------------------------
//
-// Datach Minicart implementation
+// Datach Minicart implementation
//
// Two kinds of PCB exist
// * ROM only, used by most games
@@ -221,7 +221,7 @@ machine_config_constructor nes_datach_24c01_device::device_mconfig_additions() c
//---------------------------------
//
-// Datach Base Unit implementation
+// Datach Base Unit implementation
//
//---------------------------------
@@ -244,7 +244,7 @@ void nes_datach_device::device_start()
serial_timer = timer_alloc(TIMER_SERIAL);
irq_timer->adjust(attotime::zero, 0, machine().device<cpu_device>("maincpu")->cycles_to_attotime(1));
serial_timer->adjust(attotime::zero, 0, machine().device<cpu_device>("maincpu")->cycles_to_attotime(1000));
-
+
save_item(NAME(m_irq_enable));
save_item(NAME(m_irq_count));
save_item(NAME(m_datach_latch));
@@ -256,7 +256,7 @@ void nes_datach_device::pcb_reset()
prg16_89ab(0);
prg16_cdef(m_prg_chunks - 1);
chr8(0, m_chr_source);
-
+
m_irq_enable = 0;
m_irq_count = 0;
m_datach_latch = 0;
@@ -269,27 +269,27 @@ void nes_datach_device::pcb_reset()
-------------------------------------------------*/
/*-------------------------------------------------
-
+
Bandai LZ93D50 + Datach barcode reader emulation
-
+
Games: Datach Games
-
+
iNES: mappers 157
-
+
In MESS: Supported
-
+
TODO: Datach carts should actually be handled
separately! Original carts were minicarts to be
inserted in a smaller slot of the Barcode reader
FC cart. The Barcode reader acts as a passthrough
but it has no internal ROM (it does not work if
you don't have any minicart inserted)
-
- TODO2: This class should be derived from the
+
+ TODO2: This class should be derived from the
LZ93D50 + X24C02 class, since the main board
- has this EEPROM. Moreover, Datach - Battle Rush
+ has this EEPROM. Moreover, Datach - Battle Rush
has a second X24C01 EEPROM that we don't emulate yet...
-
+
-------------------------------------------------*/
@@ -318,14 +318,14 @@ READ8_MEMBER(nes_datach_device::read_h)
if (m_subslot->m_cart)
return m_subslot->m_cart->read(space, offset, mem_mask);
- else // this is "fake" in the sense that we fill CPU space with 0xff if no Datach cart is loaded
+ else // this is "fake" in the sense that we fill CPU space with 0xff if no Datach cart is loaded
return hi_access_rom(offset);
}
WRITE8_MEMBER(nes_datach_device::write_h)
{
LOG_MMC(("Datach write_h, offset: %04x, data: %02x\n", offset, data));
-
+
switch (offset & 0x0f)
{
case 0: case 1: case 2: case 3:
@@ -406,7 +406,7 @@ void nes_datach_device::device_timer(emu_timer &timer, device_timer_id id, int p
m_irq_count = 0xffff;
else
m_irq_count--;
-
+
if (!m_irq_count)
{
machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, ASSERT_LINE);
diff --git a/src/emu/bus/nes/datach.h b/src/emu/bus/nes/datach.h
index 6fc8cd5e0b4..76a95a06395 100644
--- a/src/emu/bus/nes/datach.h
+++ b/src/emu/bus/nes/datach.h
@@ -7,7 +7,7 @@
//--------------------------------
//
-// Datach Cartslot implementation
+// Datach Cartslot implementation
//
//--------------------------------
@@ -84,7 +84,7 @@ extern const device_type NES_DATACH_SLOT;
//--------------------------------
//
-// Datach Minicart implementation
+// Datach Minicart implementation
//
//--------------------------------
@@ -127,7 +127,7 @@ extern const device_type NES_DATACH_24C01;
//---------------------------------
//
-// Datach Base Unit implementation
+// Datach Base Unit implementation
//
//---------------------------------
@@ -138,7 +138,7 @@ class nes_datach_device : public nes_lz93d50_device
public:
// construction/destruction
nes_datach_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
@@ -146,17 +146,17 @@ public:
virtual DECLARE_READ8_MEMBER(read_m);
virtual DECLARE_READ8_MEMBER(read_h);
virtual DECLARE_WRITE8_MEMBER(write_h);
-
+
virtual void pcb_reset();
-
+
protected:
UINT8 m_datach_latch;
required_device<i2cmem_device> m_i2cmem;
- required_device<barcode_reader_device> m_reader;
+ required_device<barcode_reader_device> m_reader;
required_device<nes_datach_slot_device> m_subslot;
UINT8 m_i2c_dir;
UINT8 m_i2c_in_use;
-
+
static const device_timer_id TIMER_SERIAL = 1;
emu_timer *serial_timer;
};
diff --git a/src/emu/bus/nes/jy.c b/src/emu/bus/nes/jy.c
index 1eedc36ac9b..66caa918769 100644
--- a/src/emu/bus/nes/jy.c
+++ b/src/emu/bus/nes/jy.c
@@ -310,13 +310,13 @@ void nes_jy_typea_device::update_prg()
prg32((last & 0x0f) | (exPrg >> 2));
m_bank_6000 = (((m_mmc_prg_bank[3] * 4) + 3) & 0x3f) | (exPrg >> 2);
break;
-
+
case 1: // 16KB
prg16_89ab((m_mmc_prg_bank[1] & 0x1f) | (exPrg >> 1));
prg16_cdef((last & 0x1f) | (exPrg >> 1));
m_bank_6000 = (((m_mmc_prg_bank[3] * 2) + 1) & 0x1f) | (exPrg >> 1);
break;
-
+
case 2: // 8KB
prg8_89(m_mmc_prg_bank[0] | exPrg);
prg8_ab(m_mmc_prg_bank[1] | exPrg);
@@ -324,7 +324,7 @@ void nes_jy_typea_device::update_prg()
prg8_ef(last | exPrg);
m_bank_6000 = m_mmc_prg_bank[3] | exPrg;
break;
-
+
case 3: // 8KB Alt
prg8_89((unscramble(m_mmc_prg_bank[0]) & 0x3f) | exPrg);
prg8_ab((unscramble(m_mmc_prg_bank[1]) & 0x3f) | exPrg);
@@ -347,12 +347,12 @@ void nes_jy_typea_device::update_chr()
// Block mode enabled: in this case lower bits select a 256KB page inside CHRROM
// and the low bytes of m_mmc_vrom_bank select the banks inside such a page
- // docs suggest m_reg[3] & 0x1f for chr_page below,
+ // docs suggest m_reg[3] & 0x1f for chr_page below,
// but 45 in 1 (JY-120A) menu requires to use this (from NEStopia)
- UINT8 chr_page = (m_reg[3] & 1) | ((m_reg[3] & 0x18) >> 2);
+ UINT8 chr_page = (m_reg[3] & 1) | ((m_reg[3] & 0x18) >> 2);
UINT32 extra_chr_base = BIT(m_reg[3], 5) ? 0 : (chr_page * 0x100);
UINT32 extra_chr_mask = BIT(m_reg[3], 5) ? 0xffffff : 0xff;
-
+
switch (m_reg[0] & 0x18)
{
case 0x00: // 8KB
@@ -360,7 +360,7 @@ void nes_jy_typea_device::update_chr()
extra_chr_mask >>= 3;
chr8(extra_chr_base | (m_mmc_vrom_bank[0] & extra_chr_mask), m_chr_source);
break;
-
+
case 0x08: // 4KB
extra_chr_base >>= 2;
extra_chr_mask >>= 2;
@@ -369,7 +369,7 @@ void nes_jy_typea_device::update_chr()
chr4_0(extra_chr_base | (m_mmc_vrom_bank[m_chr_latch[0]] & extra_chr_mask), m_chr_source);
chr4_4(extra_chr_base | (m_mmc_vrom_bank[m_chr_latch[1]] & extra_chr_mask), m_chr_source);
break;
-
+
case 0x10: // 2KB
extra_chr_base >>= 1;
extra_chr_mask >>= 1;
@@ -378,7 +378,7 @@ void nes_jy_typea_device::update_chr()
chr2_4(extra_chr_base | (m_mmc_vrom_bank[4] & extra_chr_mask), m_chr_source);
chr2_6(extra_chr_base | (m_mmc_vrom_bank[6] & extra_chr_mask), m_chr_source);
break;
-
+
case 0x18: // 1KB
chr1_0(extra_chr_base | (m_mmc_vrom_bank[0] & extra_chr_mask), m_chr_source);
chr1_1(extra_chr_base | (m_mmc_vrom_bank[1] & extra_chr_mask), m_chr_source);
@@ -573,7 +573,7 @@ void nes_jy_typec_device::update_mirror_typec()
READ8_MEMBER(nes_jy_typec_device::chr_r)
{
int bank = offset >> 10;
-
+
irq_clock(0, 2);
switch (offset & 0xff0)
{
diff --git a/src/emu/bus/nes/jy.h b/src/emu/bus/nes/jy.h
index 720c3ea2e60..47e16d983c4 100644
--- a/src/emu/bus/nes/jy.h
+++ b/src/emu/bus/nes/jy.h
@@ -20,7 +20,7 @@ public:
virtual DECLARE_READ8_MEMBER(read_m);
virtual DECLARE_WRITE8_MEMBER(write_l);
virtual DECLARE_WRITE8_MEMBER(write_h);
-
+
virtual DECLARE_READ8_MEMBER(chr_r);
virtual DECLARE_READ8_MEMBER(nt_r);
@@ -39,7 +39,7 @@ protected:
UINT8 m_mul[2];
UINT8 m_latch;
UINT8 m_reg[4];
- UINT8 m_chr_latch[2]; // type C uses a more complex CHR 4K mode, and these vars are only changed for those games
+ UINT8 m_chr_latch[2]; // type C uses a more complex CHR 4K mode, and these vars are only changed for those games
UINT8 m_mmc_prg_bank[4];
UINT16 m_mmc_nt_bank[4];
UINT16 m_mmc_vrom_bank[8];
diff --git a/src/emu/bus/nes/karastudio.c b/src/emu/bus/nes/karastudio.c
index d331cbdeb4d..afb7a2b1363 100644
--- a/src/emu/bus/nes/karastudio.c
+++ b/src/emu/bus/nes/karastudio.c
@@ -8,22 +8,22 @@
Here we emulate the following PCBs Bandai Karaoke Studio [mapper 188]
-
+
The Karaoke Studio cart consist of a large connector which fits the FC cart slot, with a microphone
- connected. The game data is in the connector itself. The microphone has two buttons on it, and the
- game uses these only to navigate through the menus (the two buttons are not read through the controller
- port, which is not accessible from the cart, but from $6000-$7fff). Part of the connector body can be
+ connected. The game data is in the connector itself. The microphone has two buttons on it, and the
+ game uses these only to navigate through the menus (the two buttons are not read through the controller
+ port, which is not accessible from the cart, but from $6000-$7fff). Part of the connector body can be
removed to be replaced by an expansion cart containing new songs (we emulate this by adding a -cart2 slot).
-
+
TODO:
- verify expansion slot emulation for the Senyou Cassettes:
not much documentation exists about the expansion carts (except for few paragraphs
at Enri's FC webpage), so I implemented it based on "common sense"
* expansion carts do not contain the required game data => main PRG must be in the main cart
- so to remain connected even when an expansion is inserted (differently from Datach, where
+ so to remain connected even when an expansion is inserted (differently from Datach, where
the base unit contains no PRG)
- * bankswicth writes with bit3=0 (to access expansion) when no expansion is present should do
+ * bankswicth writes with bit3=0 (to access expansion) when no expansion is present should do
nothing
***********************************************************************************************************/
@@ -43,7 +43,7 @@
//-----------------------------------------
//
-// Karaoke Studio Cartslot implementation
+// Karaoke Studio Cartslot implementation
//
//-----------------------------------------
@@ -93,7 +93,7 @@ READ8_MEMBER(nes_kstudio_slot_device::read)
{
if (m_cart)
return m_cart->read(space, offset, mem_mask);
-
+
return 0xff;
}
@@ -102,27 +102,27 @@ bool nes_kstudio_slot_device::call_load()
if (m_cart)
{
UINT8 *ROM = m_cart->get_cart_base();
-
+
if (!ROM)
return IMAGE_INIT_FAIL;
-
+
// Existing exapnsion carts are all 128K, so we only load files of this size
if (software_entry() == NULL)
{
if (length() != 0x20000)
return IMAGE_INIT_FAIL;
-
- fread(&ROM, 0x20000);
+
+ fread(&ROM, 0x20000);
}
else
{
if (get_software_region_length("rom") != 0x20000)
return IMAGE_INIT_FAIL;
-
+
memcpy(ROM, get_software_region("rom"), 0x20000);
}
}
-
+
return IMAGE_INIT_PASS;
}
@@ -141,7 +141,7 @@ void nes_kstudio_slot_device::get_default_card_software(astring &result)
//-----------------------------------------------
//
-// Karaoke Studio Expansion cart implementation
+// Karaoke Studio Expansion cart implementation
//
//-----------------------------------------------
@@ -181,7 +181,7 @@ UINT8 *nes_kstudio_rom_device::get_cart_base()
//------------------------------------------
//
-// Karaoke Studio Base Cart implementation
+// Karaoke Studio Base Cart implementation
//
//------------------------------------------
@@ -220,7 +220,7 @@ void nes_karaokestudio_device::pcb_reset()
Bandai Karaoke Studio board emulation
- Games: Karaoke Studio + expansion carts with
+ Games: Karaoke Studio + expansion carts with
additional songs
Note: we currently do not emulate properly the
@@ -260,7 +260,7 @@ WRITE8_MEMBER(nes_karaokestudio_device::write_h)
// cart (when expansion is present, code keeps switching both from the expansion rom and from
// the main ROM)
// my guess is that writes with bit3=0 and no expansion just do nothing, but it shall be verified
-
+
if (offset >= 04000)
{
if (BIT(data, 3))
@@ -268,7 +268,7 @@ WRITE8_MEMBER(nes_karaokestudio_device::write_h)
m_exp_active = 0;
prg16_89ab(data & 7);
}
- else // expansion cart
+ else // expansion cart
{
m_exp_active = 1;
m_subslot->write_prg_bank(data & 7);
@@ -308,4 +308,3 @@ machine_config_constructor nes_karaokestudio_device::device_mconfig_additions()
{
return MACHINE_CONFIG_NAME( karaoke_studio );
}
-
diff --git a/src/emu/bus/nes/karastudio.h b/src/emu/bus/nes/karastudio.h
index d3c8f2a6568..bfa4c252ac7 100644
--- a/src/emu/bus/nes/karastudio.h
+++ b/src/emu/bus/nes/karastudio.h
@@ -6,7 +6,7 @@
//-----------------------------------------
//
-// Karaoke Studio Cartslot implementation
+// Karaoke Studio Cartslot implementation
//
//-----------------------------------------
@@ -18,13 +18,13 @@ public:
// construction/destruction
kstudio_cart_interface(const machine_config &mconfig, device_t &device);
virtual ~kstudio_cart_interface();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read);
-
+
UINT8 *get_cart_base() { return m_rom; }
void write_prg_bank(UINT8 bank) { m_bank = bank; }
-
+
protected:
// internal state
UINT8 *m_rom;
@@ -42,15 +42,15 @@ public:
// construction/destruction
nes_kstudio_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
virtual ~nes_kstudio_slot_device();
-
+
// device-level overrides
virtual void device_start();
virtual void device_config_complete() { update_names(); }
-
+
// image-level overrides
virtual bool call_load();
virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry);
-
+
virtual iodevice_t image_type() const { return IO_CARTSLOT; }
virtual bool is_readable() const { return 1; }
virtual bool is_writeable() const { return 0; }
@@ -60,13 +60,13 @@ public:
virtual const char *image_interface() const { return "ks_cart"; }
virtual const char *file_extensions() const { return "bin"; }
virtual const option_guide *create_option_guide() const { return NULL; }
-
+
// slot interface overrides
virtual void get_default_card_software(astring &result);
-
+
virtual DECLARE_READ8_MEMBER(read);
void write_prg_bank(UINT8 bank) { if (m_cart) m_cart->write_prg_bank(bank); }
-
+
kstudio_cart_interface* m_cart;
};
@@ -81,7 +81,7 @@ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, NULL, false)
//-----------------------------------------------
//
-// Karaoke Studio Expansion cart implementation
+// Karaoke Studio Expansion cart implementation
//
//-----------------------------------------------
@@ -93,11 +93,11 @@ class nes_kstudio_rom_device : public device_t,
public:
// construction/destruction
nes_kstudio_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// optional information overrides
virtual const rom_entry *device_rom_region() const;
virtual UINT8* get_cart_base();
-
+
protected:
// device-level overrides
virtual void device_start();
@@ -110,7 +110,7 @@ extern const device_type NES_KSEXPANSION_ROM;
//-------------------------------------------
//
-// Karaoke Studio Base Cart implementation
+// Karaoke Studio Base Cart implementation
//
//-------------------------------------------
diff --git a/src/emu/bus/nes/mmc5.c b/src/emu/bus/nes/mmc5.c
index 7601a90c914..c3aa9beeed7 100644
--- a/src/emu/bus/nes/mmc5.c
+++ b/src/emu/bus/nes/mmc5.c
@@ -117,7 +117,7 @@ void nes_exrom_device::pcb_reset()
m_split_chr = 0;
m_ex1_bank = 0;
m_vcount = 0;
-
+
memset(m_vrom_bank, 0x3ff, ARRAY_LENGTH(m_vrom_bank));
m_prg_regs[0] = 0xfc;
m_prg_regs[1] = 0xfd;
@@ -241,7 +241,7 @@ void nes_exrom_device::update_prg()
void nes_exrom_device::hblank_irq(int scanline, int vblank, int blanked )
{
m_vcount = scanline;
-
+
if (scanline == m_irq_count)
{
if (m_irq_enable)
@@ -284,7 +284,7 @@ inline bool nes_exrom_device::in_split()
{
ppu2c0x_device *ppu = machine().device<ppu2c0x_device>("ppu");
int tile = ppu->get_tilenum();
-
+
if (tile < 34)
{
if (!m_split_rev && tile < m_split_ctrl)
@@ -303,7 +303,7 @@ READ8_MEMBER(nes_exrom_device::nt_r)
{
case MMC5FILL:
if ((offset & 0x3ff) >= 0x3c0)
- return m_floodattr;
+ return m_floodattr;
return m_floodtile;
case EXRAM:
@@ -315,7 +315,7 @@ READ8_MEMBER(nes_exrom_device::nt_r)
case CIRAM:
default:
- // Uchuu Keibitai SDF uses extensively split screen for its intro,
+ // Uchuu Keibitai SDF uses extensively split screen for its intro,
// but it does not work yet
if (m_split_scr && !(m_exram_control & 0x02) && in_split())
{
@@ -338,7 +338,7 @@ READ8_MEMBER(nes_exrom_device::nt_r)
{
if ((offset & 0x3ff) >= 0x3c0)
return m_mmc5_attrib[(m_exram[offset & 0x3ff] >> 6) & 0x03];
- else // in this case, we write Ex1 CHR bank, but then access NT normally!
+ else // in this case, we write Ex1 CHR bank, but then access NT normally!
{
m_ex1_chr = 1;
m_ex1_bank = (m_exram[offset & 0x3ff] & 0x3f) | (m_high_chr << 6);
@@ -350,17 +350,17 @@ READ8_MEMBER(nes_exrom_device::nt_r)
WRITE8_MEMBER(nes_exrom_device::nt_w)
{
- int page = ((offset & 0xc00) >> 10);
-
+ int page = ((offset & 0xc00) >> 10);
+
if (!m_nt_writable[page])
return;
-
+
switch (m_nt_src[page])
{
case EXRAM:
m_exram[offset & 0x3ff] = data;
break;
-
+
case CIRAM:
default:
m_nt_access[page][offset & 0x3ff] = data;
@@ -415,10 +415,10 @@ READ8_MEMBER(nes_exrom_device::chr_r)
// However, if a game enables Ex1 but does not write a new m_ex1_bank, I'm not sure here we get the correct behavior
if (m_exram_control == 1 && ppu->get_draw_phase() == PPU_DRAW_BG && m_ex1_chr)
return bg_ex1_chr_r(offset & 0xfff);
-
+
if (m_split_scr && !(m_exram_control & 0x02) && in_split() && ppu->get_draw_phase() == PPU_DRAW_BG && m_split_chr)
return split_chr_r(offset & 0xfff);
-
+
if (ppu->is_sprite_8x16())
{
if (ppu->get_draw_phase() == PPU_DRAW_OAM)
@@ -444,9 +444,9 @@ READ8_MEMBER(nes_exrom_device::read_l)
if ((offset >= 0x1c00) && (offset <= 0x1fff))
{
// EXRAM
- if (BIT(m_exram_control, 1)) // Modes 2,3 = read
+ if (BIT(m_exram_control, 1)) // Modes 2,3 = read
return m_exram[offset - 0x1c00];
- else
+ else
return m_open_bus; // Modes 0,1 = open bus
}
@@ -486,9 +486,9 @@ WRITE8_MEMBER(nes_exrom_device::write_l)
if ((offset >= 0x1c00) && (offset <= 0x1fff))
{
// EXRAM
- if (m_exram_control == 0x02) // Mode 2 = write data
+ if (m_exram_control == 0x02) // Mode 2 = write data
m_exram[offset - 0x1c00] = data;
- else if (m_exram_control != 0x03) // Modes 0,1 = write data in frame / write 0 otherwise
+ else if (m_exram_control != 0x03) // Modes 0,1 = write data in frame / write 0 otherwise
{
if (m_irq_status & 0x40)
m_exram[offset - 0x1c00] = data;
@@ -554,7 +554,7 @@ WRITE8_MEMBER(nes_exrom_device::write_l)
case 0x1116:
case 0x1117:
m_prg_regs[offset & 3] = data & 0x7f;
- m_prg_ram_mapped[offset & 3] = !BIT(data, 7); // m_prg_ram_mapped[3] is not used, in fact!
+ m_prg_ram_mapped[offset & 3] = !BIT(data, 7); // m_prg_ram_mapped[3] is not used, in fact!
update_prg();
break;
diff --git a/src/emu/bus/nes/mmc5.h b/src/emu/bus/nes/mmc5.h
index cd15c58d817..dbd4988d839 100644
--- a/src/emu/bus/nes/mmc5.h
+++ b/src/emu/bus/nes/mmc5.h
@@ -66,7 +66,7 @@ protected:
UINT8 m_prg_ram_mapped[4];
UINT8 m_ex1_bank;
-
+
UINT8 m_high_chr; // $5130
UINT8 m_split_scr; // $5200
diff --git a/src/emu/bus/nes/nes_carts.c b/src/emu/bus/nes/nes_carts.c
index 047683d4103..27ef460b504 100644
--- a/src/emu/bus/nes/nes_carts.c
+++ b/src/emu/bus/nes/nes_carts.c
@@ -127,7 +127,7 @@ SLOT_INTERFACE_START(nes_cart)
SLOT_INTERFACE_INTERNAL("bf9093", NES_BF9093)
SLOT_INTERFACE_INTERNAL("bf9096", NES_BF9096)
SLOT_INTERFACE_INTERNAL("goldenfive", NES_GOLDEN5)
- SLOT_INTERFACE_INTERNAL("ade", NES_ALADDIN)
+ SLOT_INTERFACE_INTERNAL("ade", NES_ALADDIN)
SLOT_INTERFACE_INTERNAL("cne_decathl", NES_CNE_DECATHL)
SLOT_INTERFACE_INTERNAL("cne_fsb", NES_CNE_FSB)
SLOT_INTERFACE_INTERNAL("cne_shlz", NES_CNE_SHLZ)
@@ -354,4 +354,3 @@ SLOT_INTERFACE_INTERNAL("test", NES_NROM)
//
SLOT_INTERFACE_INTERNAL("unknown", NES_NROM) // a few pirate dumps uses the wrong mapper...
SLOT_INTERFACE_END
-
diff --git a/src/emu/bus/nes/nes_ines.inc b/src/emu/bus/nes/nes_ines.inc
index 9577fef635a..0a464506667 100644
--- a/src/emu/bus/nes/nes_ines.inc
+++ b/src/emu/bus/nes/nes_ines.inc
@@ -56,8 +56,8 @@ static const nes_mmc mmc_list[] =
{ 24, KONAMI_VRC6 },
{ 25, KONAMI_VRC4 },
{ 26, KONAMI_VRC6 },
- { 27, UNL_WORLDHERO }, // 27 World Hero board - Unsupported
- { 28, BTL_ACTION53 }, // 28 - Multi-discrete PCB designed by Tepples for Action 53
+ { 27, UNL_WORLDHERO }, // 27 World Hero board - Unsupported
+ { 28, BTL_ACTION53 }, // 28 - Multi-discrete PCB designed by Tepples for Action 53
// 29 Unused
// 30 Unused
// 31 Unused
@@ -132,7 +132,7 @@ static const nes_mmc mmc_list[] =
// 100 images hacked to work with nesticle?
// 101 Unused (Urusei Yatsura had been assigned to this mapper, but it's Mapper 87)
// 102 Unused
- { 103, UNL_2708 }, // 103 Bootleg cart 2708 (Doki Doki Panic - FDS Conversion) - Unsupported
+ { 103, UNL_2708 }, // 103 Bootleg cart 2708 (Doki Doki Panic - FDS Conversion) - Unsupported
{ 104, CAMERICA_GOLDENFIVE },
{ 105, STD_EVENT },
{ 106, BTL_SMB3 },
@@ -191,7 +191,7 @@ static const nes_mmc mmc_list[] =
{ 159, BANDAI_LZ93EX1 }, // with 24c01
{ 160, SACHEN_SA009 },
// 161 Unused
- { 162, WAIXING_FS304}, // not confirmed, but a lot of chinese releases use it like this...
+ { 162, WAIXING_FS304}, // not confirmed, but a lot of chinese releases use it like this...
{ 163, NANJING_BOARD},
{ 164, WAIXING_FFV },
{ 165, WAIXING_SH2 },
@@ -264,7 +264,7 @@ static const nes_mmc mmc_list[] =
{ 232, CAMERICA_BF9096 },
{ 233, BMC_SUPER22 },
{ 234, AVE_MAXI15 },
- { 235, BMC_GOLD150 }, // 235 Golden Game x-in-1 - Unsupported
+ { 235, BMC_GOLD150 }, // 235 Golden Game x-in-1 - Unsupported
// 236 Game 800-in-1 - Unsupported
// 237 Unused
{ 238, UNL_603_5052 },
@@ -525,7 +525,7 @@ void nes_cart_slot_device::call_load_ines()
switch (m_pcb_id)
{
case STD_NROM:
- if (prg_size == 3 * 0x4000) // NROM368 are padded with 2k empty data at start to accomplish with iNES standard
+ if (prg_size == 3 * 0x4000) // NROM368 are padded with 2k empty data at start to accomplish with iNES standard
{
m_pcb_id = STD_NROM368;
fseek(0x810, SEEK_SET);
@@ -834,7 +834,7 @@ const char * nes_cart_slot_device::get_default_card_ines(UINT8 *ROM, UINT32 len)
}
// use info from nes.hsi if available!
-// if (hashfile_extrainfo(*this, mapinfo))
+// if (hashfile_extrainfo(*this, mapinfo))
if (0)
{
if (4 == sscanf(mapinfo,"%d %d %d %d", &mapint1, &mapint2, &mapint3, &mapint4))
diff --git a/src/emu/bus/nes/nes_slot.h b/src/emu/bus/nes/nes_slot.h
index c37ccb1d88d..f93f5f76819 100644
--- a/src/emu/bus/nes/nes_slot.h
+++ b/src/emu/bus/nes/nes_slot.h
@@ -119,8 +119,8 @@ enum
WAIXING_DQ8, WAIXING_FFV, WAIXING_WXZS2, SUPERGAME_LIONKING, SUPERGAME_BOOGERMAN,
KAY_BOARD, HOSENKAN_BOARD, NITRA_TDA, GOUDER_37017, NANJING_BOARD,
WHIRLWIND_2706,
- NOCASH_NOCHR, // homebrew PCB design which uses NTRAM for CHRRAM
- BTL_ACTION53, // homebrew PCB for homebrew multicarts
+ NOCASH_NOCHR, // homebrew PCB design which uses NTRAM for CHRRAM
+ BTL_ACTION53, // homebrew PCB for homebrew multicarts
/* FFE boards, for mappers 6, 8, 17 */
FFE3_BOARD, FFE4_BOARD, FFE8_BOARD, TEST_BOARD,
/* Unsupported (for place-holder boards, with no working emulation) & no-board (at init) */
diff --git a/src/emu/bus/nes/nxrom.c b/src/emu/bus/nes/nxrom.c
index 68349d97f7b..8c3d56a4e6a 100644
--- a/src/emu/bus/nes/nxrom.c
+++ b/src/emu/bus/nes/nxrom.c
@@ -283,15 +283,15 @@ void nes_un1rom_device::pcb_reset()
-------------------------------------------------*/
/*-------------------------------------------------
-
+
NROM-368 board emulation
-
+
iNES: mapper 0 with 3xPRG banks
This is an homebrew extension to map linearly 46KB
or PRG in boards with no PRG bankswitch logic
-
+
In MESS: Supported
-
+
-------------------------------------------------*/
READ8_MEMBER(nes_nrom368_device::read_l)
@@ -425,7 +425,7 @@ READ8_MEMBER(nes_cnrom_device::chr_r)
// For most boards, chr_open_bus remains always zero.
if (m_chr_open_bus)
return m_open_bus;
-
+
return m_chr_access[bank][offset & 0x3ff];
}
@@ -549,16 +549,16 @@ WRITE8_MEMBER(nes_un1rom_device::write_h)
}
/*-------------------------------------------------
-
+
NoCash NOCHR board emulation
-
+
This is an homebrew PCB design on a single chip
(+possibly CIC) which uses the NTRAM as CHRRAM!
-
+
iNES: mapper 218
-
+
In MESS: Supported.
-
+
-------------------------------------------------*/
WRITE8_MEMBER(nes_nochr_device::chr_w)
@@ -569,7 +569,7 @@ WRITE8_MEMBER(nes_nochr_device::chr_w)
else if (mirr == PPU_MIRROR_LOW)
m_ciram[(offset & 0x3ff) + 0x400] = data;
else
- m_ciram[offset & 0x7ff] = data; // not sure here, since there is no software to test...
+ m_ciram[offset & 0x7ff] = data; // not sure here, since there is no software to test...
}
READ8_MEMBER(nes_nochr_device::chr_r)
@@ -580,5 +580,5 @@ READ8_MEMBER(nes_nochr_device::chr_r)
else if (mirr == PPU_MIRROR_LOW)
return m_ciram[(offset & 0x3ff) + 0x400];
else
- return m_ciram[offset & 0x7ff]; // not sure here, since there is no software to test...
+ return m_ciram[offset & 0x7ff]; // not sure here, since there is no software to test...
}
diff --git a/src/emu/bus/nes/sunsoft_dcs.c b/src/emu/bus/nes/sunsoft_dcs.c
index 93e1e67bf59..d4dd1a8e261 100644
--- a/src/emu/bus/nes/sunsoft_dcs.c
+++ b/src/emu/bus/nes/sunsoft_dcs.c
@@ -27,7 +27,7 @@
//-----------------------------------------------
//
-// Nantettate!! Baseball Cartslot implementation
+// Nantettate!! Baseball Cartslot implementation
//
//-----------------------------------------------
@@ -119,7 +119,7 @@ void nes_ntb_slot_device::get_default_card_software(astring &result)
//-----------------------------------------------
//
-// Nantettate!! Baseball Minicart implementation
+// Nantettate!! Baseball Minicart implementation
//
//-----------------------------------------------
@@ -154,8 +154,8 @@ UINT8 *nes_ntb_rom_device::get_cart_base()
//------------------------------------------------
//
-// Nantettate!! Baseball base cart implementation
-// a.k.a. Sunsoft Dual Cassette System
+// Nantettate!! Baseball base cart implementation
+// a.k.a. Sunsoft Dual Cassette System
// (variant of Sunsoft-4 PCB)
//
//------------------------------------------------
diff --git a/src/emu/bus/nes/sunsoft_dcs.h b/src/emu/bus/nes/sunsoft_dcs.h
index c11794fd640..02c32fc3f19 100644
--- a/src/emu/bus/nes/sunsoft_dcs.h
+++ b/src/emu/bus/nes/sunsoft_dcs.h
@@ -6,7 +6,7 @@
//-----------------------------------------------
//
-// Nantettate!! Baseball Cartslot implementation
+// Nantettate!! Baseball Cartslot implementation
//
//-----------------------------------------------
@@ -77,7 +77,7 @@ extern const device_type NES_NTB_SLOT;
//-----------------------------------------------
//
-// Nantettate!! Baseball Minicart implementation
+// Nantettate!! Baseball Minicart implementation
//
//-----------------------------------------------
@@ -106,8 +106,8 @@ extern const device_type NES_NTB_ROM;
//------------------------------------------------
//
-// Nantettate!! Baseball base cart implementation
-// a.k.a. Sunsoft Dual Cassette System
+// Nantettate!! Baseball base cart implementation
+// a.k.a. Sunsoft Dual Cassette System
// (variant of Sunsoft-4 PCB)
//
//------------------------------------------------