summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess/machine
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2013-06-11 07:16:42 +0000
committer Miodrag Milanovic <mmicko@gmail.com>2013-06-11 07:16:42 +0000
commit16f5234d435ee57b65043533f8fa2b105fb15a77 (patch)
treec6f95d84c6a1cb89ced5353230a98e1f61a6938e /src/mess/machine
parent2dc6458ede8c0039e308c994e50acb3b8de2d1ae (diff)
Cleanups and version bumpmame0149
Diffstat (limited to 'src/mess/machine')
-rw-r--r--src/mess/machine/abc99.c8
-rw-r--r--src/mess/machine/abc99.h2
-rw-r--r--src/mess/machine/abckb.h2
-rw-r--r--src/mess/machine/apollo.c4
-rw-r--r--src/mess/machine/bbc.c6
-rw-r--r--src/mess/machine/concept.c37
-rw-r--r--src/mess/machine/concept_exp.c119
-rw-r--r--src/mess/machine/concept_exp.h12
-rw-r--r--src/mess/machine/ds1315.c2
-rw-r--r--src/mess/machine/ds1315.h2
-rw-r--r--src/mess/machine/ep64_exdos.c26
-rw-r--r--src/mess/machine/ep64_exdos.h2
-rw-r--r--src/mess/machine/ep64exp.h4
-rw-r--r--src/mess/machine/gba_rom.c79
-rw-r--r--src/mess/machine/gba_rom.h26
-rw-r--r--src/mess/machine/gba_slot.c25
-rw-r--r--src/mess/machine/gba_slot.h8
-rw-r--r--src/mess/machine/intv.c18
-rw-r--r--src/mess/machine/mboard.c4
-rw-r--r--src/mess/machine/mc68328.c37
-rw-r--r--src/mess/machine/mc68328.h78
-rw-r--r--src/mess/machine/md_rom.c2
-rw-r--r--src/mess/machine/md_rom.h8
-rw-r--r--src/mess/machine/msx.c2
-rw-r--r--src/mess/machine/pce.c6
-rw-r--r--src/mess/machine/pce_cd.c192
-rw-r--r--src/mess/machine/pce_cd.h10
-rw-r--r--src/mess/machine/pce_rom.c7
-rw-r--r--src/mess/machine/pce_rom.h8
-rw-r--r--src/mess/machine/pce_slot.c29
-rw-r--r--src/mess/machine/pce_slot.h2
-rw-r--r--src/mess/machine/s3c44b0.c34
-rw-r--r--src/mess/machine/s3c44b0.h6
-rw-r--r--src/mess/machine/sega8_rom.c153
-rw-r--r--src/mess/machine/sega8_rom.h74
-rw-r--r--src/mess/machine/sega8_slot.c122
-rw-r--r--src/mess/machine/sega8_slot.h20
-rw-r--r--src/mess/machine/sms.c74
-rw-r--r--src/mess/machine/sns_sa1.c11
-rw-r--r--src/mess/machine/sns_sdd1.c2
-rw-r--r--src/mess/machine/sns_sgb.c85
-rw-r--r--src/mess/machine/sns_sgb.h4
-rw-r--r--src/mess/machine/sns_spc7110.c8
-rw-r--r--src/mess/machine/sns_spc7110.h10
-rw-r--r--src/mess/machine/softbox.h2
-rw-r--r--src/mess/machine/upd71071.c2
-rw-r--r--src/mess/machine/victor9kb.h3
-rw-r--r--src/mess/machine/vp575.c10
-rw-r--r--src/mess/machine/wangpc_mcc.c2
-rw-r--r--src/mess/machine/zx8302.h4
50 files changed, 689 insertions, 704 deletions
diff --git a/src/mess/machine/abc99.c b/src/mess/machine/abc99.c
index aa438ebcdbb..ff7dc083f19 100644
--- a/src/mess/machine/abc99.c
+++ b/src/mess/machine/abc99.c
@@ -153,10 +153,10 @@ ADDRESS_MAP_END
//-------------------------------------------------
static ADDRESS_MAP_START( abc99_z5_io, AS_IO, 8, abc99_device )
-/* AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_READ(z5_p1_r)
- AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(z5_p2_w)
- AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_WRITENOP // Z2 CLK
- AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(z5_t1_r)*/
+/* AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_READ(z5_p1_r)
+ AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(z5_p2_w)
+ AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_WRITENOP // Z2 CLK
+ AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(z5_t1_r)*/
ADDRESS_MAP_END
diff --git a/src/mess/machine/abc99.h b/src/mess/machine/abc99.h
index 75ae283c292..2b146a3c8e2 100644
--- a/src/mess/machine/abc99.h
+++ b/src/mess/machine/abc99.h
@@ -64,7 +64,7 @@ private:
TIMER_SERIAL,
TIMER_MOUSE
};
-
+
enum
{
LED_1 = 0,
diff --git a/src/mess/machine/abckb.h b/src/mess/machine/abckb.h
index a231d461aa5..207ca9c0a49 100644
--- a/src/mess/machine/abckb.h
+++ b/src/mess/machine/abckb.h
@@ -20,7 +20,7 @@
// MACROS / CONSTANTS
//**************************************************************************
-#define ABC_KEYBOARD_PORT_TAG "kb"
+#define ABC_KEYBOARD_PORT_TAG "kb"
diff --git a/src/mess/machine/apollo.c b/src/mess/machine/apollo.c
index 3315635550e..bf842dae2cb 100644
--- a/src/mess/machine/apollo.c
+++ b/src/mess/machine/apollo.c
@@ -691,9 +691,9 @@ IRQ_CALLBACK_MEMBER(apollo_state::apollo_pic_acknowledge)
READ8_MEMBER( apollo_state::apollo_pic8259_get_slave_ack )
{
- MLOG1(("apollo_pic8259_get_slave_ack: offset=%x", offset));
+ MLOG1(("apollo_pic8259_get_slave_ack: offset=%x", offset));
- return offset == 3 ? m_pic8259_slave->inta_r() : 0;
+ return offset == 3 ? m_pic8259_slave->inta_r() : 0;
}
WRITE_LINE_MEMBER( apollo_state::apollo_pic8259_master_set_int_line ) {
diff --git a/src/mess/machine/bbc.c b/src/mess/machine/bbc.c
index fe3786c5ba6..0dfbddb6406 100644
--- a/src/mess/machine/bbc.c
+++ b/src/mess/machine/bbc.c
@@ -1417,8 +1417,8 @@ TIMER_CALLBACK_MEMBER(bbc_state::bbc_tape_timer_cb)
READ_LINE_MEMBER( bbc_state::bbc_rxd_r )
-{
- return ( m_serproc_data & 0x40 ) ? m_rs232->rx() : m_rxd_cass;
+{
+ return ( m_serproc_data & 0x40 ) ? m_rs232->rx() : m_rxd_cass;
}
@@ -1429,7 +1429,7 @@ READ_LINE_MEMBER( bbc_state::bbc_dcd_r )
READ_LINE_MEMBER( bbc_state::bbc_cts_r )
-{
+{
return ( m_serproc_data & 0x40 ) ? m_rs232->cts_r() : 0;
}
diff --git a/src/mess/machine/concept.c b/src/mess/machine/concept.c
index b4272e4277c..d8656b53faa 100644
--- a/src/mess/machine/concept.c
+++ b/src/mess/machine/concept.c
@@ -58,7 +58,7 @@ void concept_state::machine_start()
/* clear keyboard interface state */
m_KeyQueueHead = m_KeyQueueLen = 0;
memset(m_KeyStateSave, 0, sizeof(m_KeyStateSave));
-
+
m_exp[0] = machine().device<concept_exp_port_device>("exp1");
m_exp[1] = machine().device<concept_exp_port_device>("exp2");
m_exp[2] = machine().device<concept_exp_port_device>("exp3");
@@ -248,10 +248,10 @@ READ16_MEMBER(concept_state::concept_io_r)
/* I/O slot regs */
switch ((offset >> 4) & 7)
{
- case 1: // IO1 registers
- case 2: // IO2 registers
- case 3: // IO3 registers
- case 4: // IO4 registers
+ case 1: // IO1 registers
+ case 2: // IO2 registers
+ case 3: // IO3 registers
+ case 4: // IO4 registers
return m_exp[((offset >> 4) & 7) - 1]->reg_r(space, offset & 0x0f);
break;
@@ -261,10 +261,10 @@ READ16_MEMBER(concept_state::concept_io_r)
}
break;
- case 1: // IO1 ROM
- case 2: // IO2 ROM
- case 3: // IO3 ROM
- case 4: // IO4 ROM
+ case 1: // IO1 ROM
+ case 2: // IO2 ROM
+ case 3: // IO3 ROM
+ case 4: // IO4 ROM
LOG(("concept_io_r: Slot ROM memory accessed for slot %d at address 0x03%4.4x\n", ((offset >> 8) & 7) - 1, offset << 1));
return m_exp[((offset >> 8) & 7) - 1]->rom_r(space, offset & 0xff);
break;
@@ -373,23 +373,23 @@ WRITE16_MEMBER(concept_state::concept_io_w)
/* I/O slot regs */
switch ((offset >> 4) & 7)
{
- case 1: // IO1 registers
- case 2: // IO2 registers
- case 3: // IO3 registers
- case 4: // IO4 registers
+ case 1: // IO1 registers
+ case 2: // IO2 registers
+ case 3: // IO3 registers
+ case 4: // IO4 registers
return m_exp[((offset >> 4) & 7) - 1]->reg_w(space, offset & 0x0f, data);
break;
- default: // ???
+ default: // ???
logerror("concept_io_w: Slot I/O memory written for unknown purpose at address 0x03%4.4x, data: 0x%4.4x\n", offset << 1, data);
break;
}
break;
- case 1: // IO1 ROM
- case 2: // IO2 ROM
- case 3: // IO3 ROM
- case 4: // IO4 ROM
+ case 1: // IO1 ROM
+ case 2: // IO2 ROM
+ case 3: // IO3 ROM
+ case 4: // IO4 ROM
LOG(("concept_io_w: Slot ROM memory written to for slot %d at address 0x03%4.4x, data: 0x%4.4x\n", ((offset >> 8) & 7) - 1, offset << 1, data));
return m_exp[((offset >> 8) & 7) - 1]->rom_w(space, offset & 0xff, data);
break;
@@ -463,4 +463,3 @@ WRITE16_MEMBER(concept_state::concept_io_w)
break;
}
}
-
diff --git a/src/mess/machine/concept_exp.c b/src/mess/machine/concept_exp.c
index 1c07300c491..94a8be1119b 100644
--- a/src/mess/machine/concept_exp.c
+++ b/src/mess/machine/concept_exp.c
@@ -1,14 +1,14 @@
/**********************************************************************
-
+
Corvus Concept expansion port emulation
-
+
Copyright MESS Team.
Visit http://mamedev.org for licensing and usage restrictions.
-
-
+
+
FIXME: Concept expansion ports should just use the Apple II Bus device!
- The code below is outdated and inaccurate!
-
+ The code below is outdated and inaccurate!
+
**********************************************************************/
#include "machine/concept_exp.h"
@@ -82,7 +82,7 @@ READ8_MEMBER( concept_exp_port_device::rom_r )
{
if (m_card)
return m_card->reg_r(space, offset);
-
+
return 0;
}
@@ -139,7 +139,7 @@ enum
LS_8IN_bit = 5, // 1 if 8" floppy drive?
LS_DSKCHG_bit = 6, // 0 if disk changed, 1 if not
LS_SD_bit = 7, // 1 if single density
-
+
LS_DRQ_mask = (1 << LS_DRQ_bit),
LS_INT_mask = (1 << LS_INT_bit),
LS_SS_mask = (1 << LS_SS_bit),
@@ -156,7 +156,7 @@ enum
LC_MOTOROF_bit = 5, // 1 if motor to be turned off
LC_FLP8IN_bit = 6, // 1 to select 8", 0 for 5"1/4 (which I knew what it means)
LC_FMMFM_bit = 7, // 1 to select single density, 0 for double
-
+
LC_FLPSD1_mask = (1 << LC_FLPSD1_bit),
LC_DE0_mask = (1 << LC_DE0_bit),
LC_DE1_mask = (1 << LC_DE1_bit),
@@ -209,22 +209,22 @@ READ8_MEMBER(concept_fdc_device::reg_r)
{
switch (offset)
{
- case 0: // LOCAL STATUS REG
+ case 0: // LOCAL STATUS REG
return m_fdc_local_status;
-
- case 8: // FDC STATUS REG
+
+ case 8: // FDC STATUS REG
return wd17xx_status_r(m_wd179x, space, offset);
-
- case 9: // FDC TRACK REG
+
+ case 9: // FDC TRACK REG
return wd17xx_track_r(m_wd179x, space, offset);
-
- case 10: // FDC SECTOR REG
+
+ case 10: // FDC SECTOR REG
return wd17xx_sector_r(m_wd179x, space, offset);
-
- case 11: // FDC DATA REG
+
+ case 11: // FDC DATA REG
return wd17xx_data_r(m_wd179x, space, offset);
}
-
+
return 0;
}
@@ -234,9 +234,9 @@ WRITE8_MEMBER(concept_fdc_device::reg_w)
switch (offset)
{
- case 0: // LOCAL COMMAND REG
+ case 0: // LOCAL COMMAND REG
m_fdc_local_command = data;
-
+
wd17xx_set_side(m_wd179x, (data & LC_FLPSD1_mask) != 0);
current_drive = ((data >> LC_DE0_bit) & 1) | ((data >> (LC_DE1_bit-1)) & 2);
wd17xx_set_drive(m_wd179x, current_drive);
@@ -246,20 +246,20 @@ WRITE8_MEMBER(concept_fdc_device::reg_w)
wd17xx_dden_w(m_wd179x, BIT(data, 7));
floppy_drive_set_ready_state(floppy_get_device(machine(), current_drive), 1, 0);
break;
-
- case 8: // FDC COMMAMD REG
+
+ case 8: // FDC COMMAMD REG
wd17xx_command_w(m_wd179x, space, offset, data);
break;
-
- case 9: // FDC TRACK REG
+
+ case 9: // FDC TRACK REG
wd17xx_track_w(m_wd179x, space, offset, data);
break;
-
- case 10: // FDC SECTOR REG
+
+ case 10: // FDC SECTOR REG
wd17xx_sector_w(m_wd179x, space, offset, data);
break;
-
- case 11: // FDC DATA REG
+
+ case 11: // FDC DATA REG
wd17xx_data_w(m_wd179x, space, offset, data);
break;
}
@@ -276,42 +276,42 @@ static LEGACY_FLOPPY_OPTIONS_START(concept)
#if 1
/* SSSD 8" */
LEGACY_FLOPPY_OPTION(concept, "img", "Corvus Concept 8\" SSSD disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([1])
- TRACKS([77])
- SECTORS([26])
- SECTOR_LENGTH([128])
- FIRST_SECTOR_ID([1]))
+ HEADS([1])
+ TRACKS([77])
+ SECTORS([26])
+ SECTOR_LENGTH([128])
+ FIRST_SECTOR_ID([1]))
#elif 0
/* SSDD 8" (according to ROMs) */
LEGACY_FLOPPY_OPTION(concept, "img", "Corvus Concept 8\" SSDD disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([1])
- TRACKS([77])
- SECTORS([26])
- SECTOR_LENGTH([256])
- FIRST_SECTOR_ID([1]))
+ HEADS([1])
+ TRACKS([77])
+ SECTORS([26])
+ SECTOR_LENGTH([256])
+ FIRST_SECTOR_ID([1]))
#elif 0
/* Apple II DSDD 5"1/4 (according to ROMs) */
LEGACY_FLOPPY_OPTION(concept, "img", "Corvus Concept Apple II 5\"1/4 DSDD disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([2])
- TRACKS([35])
- SECTORS([16])
- SECTOR_LENGTH([256])
- FIRST_SECTOR_ID([1]))
+ HEADS([2])
+ TRACKS([35])
+ SECTORS([16])
+ SECTOR_LENGTH([256])
+ FIRST_SECTOR_ID([1]))
#elif 0
/* actual formats found */
LEGACY_FLOPPY_OPTION(concept, "img", "Corvus Concept 5\"1/4 DSDD disk image (256-byte sectors)", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([2])
- TRACKS([80])
- SECTORS([16])
- SECTOR_LENGTH([256])
- FIRST_SECTOR_ID([1]))
+ HEADS([2])
+ TRACKS([80])
+ SECTORS([16])
+ SECTOR_LENGTH([256])
+ FIRST_SECTOR_ID([1]))
#else
LEGACY_FLOPPY_OPTION(concept, "img", "Corvus Concept 5\"1/4 DSDD disk image (512-byte sectors)", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([2])
- TRACKS([80])
- SECTORS([9])
- SECTOR_LENGTH([512])
- FIRST_SECTOR_ID([1]))
+ HEADS([2])
+ TRACKS([80])
+ SECTORS([9])
+ SECTOR_LENGTH([512])
+ FIRST_SECTOR_ID([1]))
#endif
LEGACY_FLOPPY_OPTIONS_END
@@ -358,13 +358,13 @@ READ8_MEMBER(concept_hdc_device::reg_r)
{
switch (offset)
{
- case 0: // HDC Data Register
+ case 0: // HDC Data Register
return corvus_hdc_data_r(space, offset);
-
- case 1: // HDC Status Register
+
+ case 1: // HDC Status Register
return corvus_hdc_status_r(space, offset);
}
-
+
return 0;
}
@@ -373,7 +373,7 @@ WRITE8_MEMBER(concept_hdc_device::reg_w)
{
switch (offset)
{
- case 0: // HDC Data Register
+ case 0: // HDC Data Register
corvus_hdc_data_w(space, offset, data);
break;
}
@@ -396,4 +396,3 @@ machine_config_constructor concept_hdc_device::device_mconfig_additions() const
{
return MACHINE_CONFIG_NAME(hdc);
}
-
diff --git a/src/mess/machine/concept_exp.h b/src/mess/machine/concept_exp.h
index 4c8e22d20e2..fc9fab4be13 100644
--- a/src/mess/machine/concept_exp.h
+++ b/src/mess/machine/concept_exp.h
@@ -54,12 +54,12 @@ class concept_exp_card_device : public device_slot_card_interface
public:
// construction/destruction
concept_exp_card_device(const machine_config &mconfig, device_t &device);
-
+
DECLARE_READ8_MEMBER( reg_r ) { return 0xff; }
DECLARE_READ8_MEMBER( rom_r ) { return 0xff; }
DECLARE_WRITE8_MEMBER( reg_w ) {}
DECLARE_WRITE8_MEMBER( rom_w ) {}
-
+
protected:
};
@@ -70,19 +70,19 @@ class concept_fdc_device : public device_t,
public:
// construction/destruction
concept_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
DECLARE_READ8_MEMBER(reg_r);
DECLARE_READ8_MEMBER(rom_r);
DECLARE_WRITE8_MEMBER(reg_w);
DECLARE_WRITE_LINE_MEMBER(intrq_w);
DECLARE_WRITE_LINE_MEMBER(drq_w);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
virtual machine_config_constructor device_mconfig_additions() const;
-
+
protected:
device_t *m_wd179x;
@@ -96,7 +96,7 @@ class concept_hdc_device : public device_t,
public:
// construction/destruction
concept_hdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
DECLARE_READ8_MEMBER( reg_r );
DECLARE_READ8_MEMBER( rom_r );
DECLARE_WRITE8_MEMBER( reg_w );
diff --git a/src/mess/machine/ds1315.c b/src/mess/machine/ds1315.c
index 632fb4fc02f..f5a9d0903c5 100644
--- a/src/mess/machine/ds1315.c
+++ b/src/mess/machine/ds1315.c
@@ -216,5 +216,3 @@ void ds1315_device::input_raw_data()
We always return the host's time when asked.
*/
}
-
-
diff --git a/src/mess/machine/ds1315.h b/src/mess/machine/ds1315.h
index e7ba2c1d58a..d4ab0cfb967 100644
--- a/src/mess/machine/ds1315.h
+++ b/src/mess/machine/ds1315.h
@@ -48,7 +48,7 @@ private:
void fill_raw_data();
void input_raw_data();
-
+
int m_count;
ds1315_mode_t m_mode;
UINT8 m_raw_data[8*8];
diff --git a/src/mess/machine/ep64_exdos.c b/src/mess/machine/ep64_exdos.c
index 4c7b5be1e5f..c587419f50f 100644
--- a/src/mess/machine/ep64_exdos.c
+++ b/src/mess/machine/ep64_exdos.c
@@ -12,7 +12,7 @@
Floppy Drive Controller PCB Layout
----------------------------------
-INTELLIGENT SOFTWARE LTD DISK CONTROLLER
+INTELLIGENT SOFTWARE LTD DISK CONTROLLER
ISS1
|--------------------------------------------|
| |
@@ -54,7 +54,7 @@ This PCB plugs into the external expansion connector on the right side of the ma
// MACROS/CONSTANTS
//**************************************************************************
-#define WD1770_TAG "u1"
+#define WD1770_TAG "u1"
@@ -180,18 +180,18 @@ void ep64_exdos_device::device_reset()
READ8_MEMBER( ep64_exdos_device::read )
{
/*
-
+
bit description
-
- 0
+
+ 0
1 INTRQ
- 2
- 3
- 4
- 5
+ 2
+ 3
+ 4
+ 5
6 DCHG
7 DRQ
-
+
*/
UINT8 data = 0;
@@ -212,9 +212,9 @@ READ8_MEMBER( ep64_exdos_device::read )
WRITE8_MEMBER( ep64_exdos_device::write )
{
/*
-
+
bit description
-
+
0 SELECT 0
1 SELECT 1
2 SELECT 2
@@ -223,7 +223,7 @@ WRITE8_MEMBER( ep64_exdos_device::write )
5 _DDEN
6 DISK CHANGE RESET
7 IN USE
-
+
*/
m_floppy = NULL;
diff --git a/src/mess/machine/ep64_exdos.h b/src/mess/machine/ep64_exdos.h
index 18f1561e288..8cc83b36d5e 100644
--- a/src/mess/machine/ep64_exdos.h
+++ b/src/mess/machine/ep64_exdos.h
@@ -26,7 +26,7 @@
// ======================> ep64_exdos_device
class ep64_exdos_device : public device_t,
- public device_ep64_expansion_bus_card_interface
+ public device_ep64_expansion_bus_card_interface
{
public:
// construction/destruction
diff --git a/src/mess/machine/ep64exp.h b/src/mess/machine/ep64exp.h
index 93d60d03f32..db2e89f27bd 100644
--- a/src/mess/machine/ep64exp.h
+++ b/src/mess/machine/ep64exp.h
@@ -57,7 +57,7 @@
// MACROS / CONSTANTS
//**************************************************************************
-#define EP64_EXPANSION_BUS_TAG "exp"
+#define EP64_EXPANSION_BUS_TAG "exp"
@@ -86,7 +86,7 @@
class device_ep64_expansion_bus_card_interface;
class ep64_expansion_bus_slot_device : public device_t,
- public device_slot_interface
+ public device_slot_interface
{
friend class device_ep64_expansion_bus_card_interface;
diff --git a/src/mess/machine/gba_rom.c b/src/mess/machine/gba_rom.c
index 1d2bf5c649a..3b2c081de21 100644
--- a/src/mess/machine/gba_rom.c
+++ b/src/mess/machine/gba_rom.c
@@ -1,12 +1,12 @@
/***********************************************************************************************************
-
+
Game Boy Advance cart emulation
We support carts with several kind of Save RAM (actual SRAM, Flash RAM or EEPROM)
-
-
+
+
***********************************************************************************************************/
@@ -120,7 +120,7 @@ void gba_rom_eeprom64_device::device_start()
{
astring tempstring;
m_rom = (UINT32 *)memregion(this->subtag(tempstring, "cartridge"))->base();
-
+
// for the moment we use a custom eeprom implementation, so we alloc/save it as nvram
nvram_alloc(machine(), 0x2000);
m_eeprom = auto_alloc(machine(), gba_eeprom_device(machine(), (UINT8*)get_nvram_base(), get_nvram_size(), 14));
@@ -140,7 +140,7 @@ READ32_MEMBER(gba_rom_sram_device::read_ram)
{
if (m_nvram && offset < m_nvram_size/4)
return m_nvram[offset];
- else // this cannot actually happen...
+ else // this cannot actually happen...
return 0xffffffff;
}
@@ -168,25 +168,25 @@ machine_config_constructor gba_rom_flash_device::device_mconfig_additions() cons
READ32_MEMBER(gba_rom_flash_device::read_ram)
{
UINT32 rv = 0;
-
+
offset &= m_flash_mask;
-
- if (mem_mask & 0xff)
+
+ if (mem_mask & 0xff)
rv |= m_flash->read(offset * 4);
- if (mem_mask & 0xff00)
+ if (mem_mask & 0xff00)
rv |= m_flash->read((offset * 4) + 1) << 8;
- if (mem_mask & 0xff0000)
+ if (mem_mask & 0xff0000)
rv |= m_flash->read((offset * 4) + 2) << 16;
- if (mem_mask & 0xff000000)
+ if (mem_mask & 0xff000000)
rv |= m_flash->read((offset * 4) + 3) << 24;
-
+
return rv;
}
WRITE32_MEMBER(gba_rom_flash_device::write_ram)
{
offset &= m_flash_mask;
-
+
switch (mem_mask)
{
case 0xff:
@@ -220,18 +220,18 @@ machine_config_constructor gba_rom_flash1m_device::device_mconfig_additions() co
READ32_MEMBER(gba_rom_flash1m_device::read_ram)
{
UINT32 rv = 0;
-
+
offset &= m_flash_mask;
- if (mem_mask & 0xff)
+ if (mem_mask & 0xff)
rv |= m_flash->read(offset * 4);
- if (mem_mask & 0xff00)
+ if (mem_mask & 0xff00)
rv |= m_flash->read((offset * 4) + 1) << 8;
- if (mem_mask & 0xff0000)
+ if (mem_mask & 0xff0000)
rv |= m_flash->read((offset * 4) + 2) << 16;
- if (mem_mask & 0xff000000)
+ if (mem_mask & 0xff000000)
rv |= m_flash->read((offset * 4) + 3) << 24;
-
+
return rv;
}
@@ -262,8 +262,8 @@ WRITE32_MEMBER(gba_rom_flash1m_device::write_ram)
/*-------------------------------------------------
Carts with EEPROM
-
- TODO: can this sketchy EEPROM device be merged
+
+ TODO: can this sketchy EEPROM device be merged
with the core implementation?
-------------------------------------------------*/
@@ -288,16 +288,16 @@ gba_eeprom_device::gba_eeprom_device(running_machine &machine, UINT8 *eeprom, UI
UINT32 gba_eeprom_device::read()
{
UINT32 out;
-
+
switch (m_state)
{
case EEP_IDLE:
// printf("eeprom_r: @ %x, mask %08x (state %d) (PC=%x) = %d\n", offset, ~mem_mask, m_state, activecpu_get_pc(), 1);
return 0x00010001; // "ready"
-
+
case EEP_READFIRST:
m_count--;
-
+
if (!m_count)
{
m_count = 64;
@@ -318,19 +318,19 @@ UINT32 gba_eeprom_device::read()
m_addr++;
m_bits = 8;
}
-
+
out = (m_eep_data & 0x80) ? 1 : 0;
out |= (out<<16);
m_eep_data <<= 1;
-
+
m_bits--;
m_count--;
-
+
if (!m_count)
{
m_state = EEP_IDLE;
}
-
+
// printf("out = %08x\n", out);
// printf("eeprom_r: @ %x, mask %08x (state %d) (PC=%x) = %08x\n", offset, ~mem_mask, m_state, activecpu_get_pc(), out);
return out;
@@ -348,7 +348,7 @@ void gba_eeprom_device::write(UINT32 data)
if (data == 1)
m_state++;
break;
-
+
case EEP_COMMAND:
if (data == 1)
m_command = EEP_READFIRST;
@@ -358,7 +358,7 @@ void gba_eeprom_device::write(UINT32 data)
m_count = m_addr_bits;
m_addr = 0;
break;
-
+
case EEP_ADDR:
m_addr <<= 1;
m_addr |= (data & 1);
@@ -377,7 +377,7 @@ void gba_eeprom_device::write(UINT32 data)
}
}
break;
-
+
case EEP_AFTERADDR:
m_state = m_command;
m_count = 64;
@@ -386,13 +386,13 @@ void gba_eeprom_device::write(UINT32 data)
if (m_state == EEP_READFIRST)
m_count = 4;
break;
-
+
case EEP_WRITE:
m_eep_data <<= 1;
m_eep_data |= (data & 1);
m_bits--;
m_count--;
-
+
if (m_bits == 0)
{
mame_printf_verbose("%08x: EEPROM: %02x to %x\n", machine().device("maincpu")->safe_pc(), m_eep_data, m_addr);
@@ -404,11 +404,11 @@ void gba_eeprom_device::write(UINT32 data)
m_eep_data = 0;
m_bits = 8;
}
-
+
if (!m_count)
m_state = EEP_AFTERWRITE;
break;
-
+
case EEP_AFTERWRITE:
m_state = EEP_IDLE;
break;
@@ -434,7 +434,7 @@ WRITE32_MEMBER(gba_rom_eeprom_device::write_ram)
if (~mem_mask == 0x0000ffff)
data >>= 16;
-
+
m_eeprom->write(data);
}
@@ -443,7 +443,7 @@ READ32_MEMBER(gba_rom_eeprom64_device::read_ram)
// Larger games have smaller access to EERPOM content
if (m_rom_size > (16 * 1024 * 1024) && offset < 0xffff00/4)
return 0xffffffff;
-
+
return m_eeprom->read();
}
@@ -452,10 +452,9 @@ WRITE32_MEMBER(gba_rom_eeprom64_device::write_ram)
// Larger games have smaller access to EEPROM content
if (m_rom_size > (16 * 1024 * 1024) && offset < 0xffff00/4)
return;
-
+
if (~mem_mask == 0x0000ffff)
data >>= 16;
-
+
m_eeprom->write(data);
}
-
diff --git a/src/mess/machine/gba_rom.h b/src/mess/machine/gba_rom.h
index bb232a649b3..d51de2b36c9 100644
--- a/src/mess/machine/gba_rom.h
+++ b/src/mess/machine/gba_rom.h
@@ -19,7 +19,7 @@ public:
virtual void device_start();
virtual const rom_entry *device_rom_region() const;
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ32_MEMBER(read_rom) { return m_rom[offset]; }
};
@@ -31,7 +31,7 @@ class gba_rom_sram_device : public gba_rom_device
public:
// construction/destruction
gba_rom_sram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ32_MEMBER(read_ram);
virtual DECLARE_WRITE32_MEMBER(write_ram);
@@ -44,11 +44,11 @@ class gba_rom_flash_device : public gba_rom_device
public:
// construction/destruction
gba_rom_flash_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual machine_config_constructor device_mconfig_additions() const;
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ32_MEMBER(read_ram);
virtual DECLARE_WRITE32_MEMBER(write_ram);
@@ -66,15 +66,15 @@ class gba_rom_flash1m_device : public gba_rom_device
public:
// construction/destruction
gba_rom_flash1m_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual machine_config_constructor device_mconfig_additions() const;
virtual void device_reset();
-
+
// reading and writing
virtual DECLARE_READ32_MEMBER(read_ram);
virtual DECLARE_WRITE32_MEMBER(write_ram);
-
+
private:
//UINT32 m_flash_size;
UINT32 m_flash_mask;
@@ -115,7 +115,7 @@ protected:
int m_bits;
int m_addr_bits;
UINT8 m_eep_data;
-
+
running_machine& m_machine;
};
@@ -127,10 +127,10 @@ class gba_rom_eeprom_device : public gba_rom_device
public:
// construction/destruction
gba_rom_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
-
+
// reading and writing
virtual DECLARE_READ32_MEMBER(read_ram);
virtual DECLARE_WRITE32_MEMBER(write_ram);
@@ -147,14 +147,14 @@ class gba_rom_eeprom64_device : public gba_rom_device
public:
// construction/destruction
gba_rom_eeprom64_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
-
+
// reading and writing
virtual DECLARE_READ32_MEMBER(read_ram);
virtual DECLARE_WRITE32_MEMBER(write_ram);
-
+
private:
gba_eeprom_device *m_eeprom;
};
diff --git a/src/mess/machine/gba_slot.c b/src/mess/machine/gba_slot.c
index 9a75d1ae50a..4486d07b0a9 100644
--- a/src/mess/machine/gba_slot.c
+++ b/src/mess/machine/gba_slot.c
@@ -159,7 +159,7 @@ bool gba_cart_slot_device::call_load()
{
UINT8 *ROM = (UINT8 *)m_cart->get_rom_base();
UINT32 cart_size;
-
+
if (software_entry() == NULL)
{
cart_size = length();
@@ -169,9 +169,9 @@ bool gba_cart_slot_device::call_load()
return IMAGE_INIT_FAIL;
}
fread(ROM, cart_size);
- m_cart->set_rom_size(cart_size); // we store the actual game size...
+ m_cart->set_rom_size(cart_size); // we store the actual game size...
- m_type = get_cart_type(ROM, cart_size);
+ m_type = get_cart_type(ROM, cart_size);
}
else
{
@@ -184,8 +184,8 @@ bool gba_cart_slot_device::call_load()
return IMAGE_INIT_FAIL;
}
memcpy(ROM, get_software_region("rom"), cart_size);
- m_cart->set_rom_size(cart_size); // we store the actual game size...
-
+ m_cart->set_rom_size(cart_size); // we store the actual game size...
+
if (pcb_name)
m_type = gba_get_pcb_id(pcb_name);
@@ -249,7 +249,7 @@ bool gba_cart_slot_device::call_softlist_load(char *swlist, char *swname, rom_en
/*-------------------------------------------------
- get_cart_type - code to detect NVRAM type from
+ get_cart_type - code to detect NVRAM type from
fullpath
-------------------------------------------------*/
@@ -305,16 +305,16 @@ int gba_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len)
chip |= GBA_CHIP_RTC;
}
mame_printf_info("GBA: Detected (ROM) %s\n", gba_chip_string(chip).cstr());
-
+
// fix for games which return more than one kind of chip: either it is one of the known titles, or we default to no battery
if (gba_chip_has_conflict(chip))
{
char game_code[5] = { 0 };
bool resolved = FALSE;
-
+
if (len >= 0xac + 4)
memcpy(game_code, ROM + 0xac, 4);
-
+
mame_printf_info("GBA: Game Code \"%s\"\n", game_code);
chip &= ~(GBA_CHIP_EEPROM | GBA_CHIP_EEPROM_4K | GBA_CHIP_EEPROM_64K | GBA_CHIP_FLASH | GBA_CHIP_FLASH_1M | GBA_CHIP_FLASH_512 | GBA_CHIP_SRAM);
@@ -333,7 +333,7 @@ int gba_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len)
if (!resolved)
mame_printf_warning("GBA: NVRAM is disabled because multiple NVRAM chips were detected!\n");
}
-
+
// fix for games which are known to require an eeprom with 14-bit addressing (64 kbit)
if (chip & GBA_CHIP_EEPROM)
{
@@ -341,7 +341,7 @@ int gba_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len)
if (len >= 0xac + 4)
memcpy(game_code, ROM + 0xac, 4);
-
+
mame_printf_info("GBA: Game Code \"%s\"\n", game_code);
for (int i = 0; i < sizeof(gba_chip_fix_eeprom_list) / sizeof(gba_chip_fix_eeprom_item); i++)
@@ -462,7 +462,7 @@ void gba_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len)
/*-------------------------------------------------
- Install ROM - directly point system address map
+ Install ROM - directly point system address map
to the cart ROM region so to avoid the memory
system additional load
-------------------------------------------------*/
@@ -481,4 +481,3 @@ void gba_cart_slot_device::install_rom()
machine().root_device().membank("rom3")->set_base(machine().root_device().memregion(m_cart->device().subtag(tempstring, "cartridge"))->base());
}
}
-
diff --git a/src/mess/machine/gba_slot.h b/src/mess/machine/gba_slot.h
index 119d0d31aa8..efb3c9077a5 100644
--- a/src/mess/machine/gba_slot.h
+++ b/src/mess/machine/gba_slot.h
@@ -42,9 +42,9 @@ public:
void set_rom_size(UINT32 val) { m_rom_size = val; }
// internal state
- UINT32 *m_rom; // this points to the cart rom region
+ UINT32 *m_rom; // this points to the cart rom region
UINT32 *m_nvram;
- UINT32 m_rom_size; // this is the actual game size, not the rom region size!
+ UINT32 m_rom_size; // this is the actual game size, not the rom region size!
UINT32 m_nvram_size;
};
@@ -119,9 +119,9 @@ extern const device_type GBA_CART_SLOT;
//------------------------------------------------------------------------
-//
+//
// Misc structs to attempt NVRAM identification when loading from fullpath
-//
+//
//------------------------------------------------------------------------
diff --git a/src/mess/machine/intv.c b/src/mess/machine/intv.c
index 0119b6b992d..21205d72adc 100644
--- a/src/mess/machine/intv.c
+++ b/src/mess/machine/intv.c
@@ -250,7 +250,7 @@ READ16_MEMBER( intv_state::intv_stic_r )
{
if (m_bus_copy_mode || !m_stic->read_stic_handshake())
return m_stic->read(space, offset, mem_mask);
- else
+ else
return offset;
}
@@ -266,8 +266,8 @@ READ16_MEMBER( intv_state::intv_gram_r )
//logerror("read: %d = GRAM(%d)\n",state->m_gram[offset],offset);
if (m_bus_copy_mode || !m_stic->read_stic_handshake())
return m_stic->gram_read(space, offset, mem_mask);
- else
- return offset;
+ else
+ return offset;
}
WRITE16_MEMBER( intv_state::intv_gram_w )
@@ -345,7 +345,7 @@ WRITE16_MEMBER( intv_state::ecs_bank2_page_select )
if (data == 0x7a50)
{
m_ecs_bank_src[1] = 1;
- m_bank2->set_base(m_bank_base[m_ecs_bank_src[1]] + (0x7000 << 1)); // ECS ROM at 0x7000 is on page 1
+ m_bank2->set_base(m_bank_base[m_ecs_bank_src[1]] + (0x7000 << 1)); // ECS ROM at 0x7000 is on page 1
}
else if (data == 0x7a51 )
{
@@ -619,10 +619,10 @@ void intv_state::machine_reset()
if (m_is_ecs)
{
// ECS can switch between the maincpu and the ecs roms
- m_ecs_bank_src[0] = 0; // CPU
- m_ecs_bank_src[1] = 1; // ECS
- m_ecs_bank_src[2] = 0; // CPU
- m_ecs_bank_src[3] = 0; // CPU
+ m_ecs_bank_src[0] = 0; // CPU
+ m_ecs_bank_src[1] = 1; // ECS
+ m_ecs_bank_src[2] = 0; // CPU
+ m_ecs_bank_src[3] = 0; // CPU
m_bank_base[0] = m_region_maincpu->base();
m_bank_base[1] = m_region_ecs_rom->base();
m_bank1->set_base(m_bank_base[m_ecs_bank_src[0]] + (0x2000 << 1));
@@ -684,7 +684,7 @@ void intv_state::machine_start()
save_item(NAME(m_ecs_bank_src));
machine().save().register_postload(save_prepost_delegate(FUNC(intv_state::ecs_banks_restore), this));
}
-
+
// intvkbd
if (m_is_keybd)
{
diff --git a/src/mess/machine/mboard.c b/src/mess/machine/mboard.c
index 6650de7ab63..a669df137e1 100644
--- a/src/mess/machine/mboard.c
+++ b/src/mess/machine/mboard.c
@@ -109,11 +109,11 @@ data: 0 0000 0000 all fields occupied
else
{
/* looking for a piece in this line and clear bit in data if found */
-
+
for (i_AH = 0; i_AH < 8; i_AH = i_AH + 1)
if (IsPiece(64 - (i_18 * 8 + 8 - i_AH)))
data &= ~(1 << i_AH); // clear bit
-
+
read_board_flag = TRUE;
}
}
diff --git a/src/mess/machine/mc68328.c b/src/mess/machine/mc68328.c
index 732f8839661..89fbb7be55b 100644
--- a/src/mess/machine/mc68328.c
+++ b/src/mess/machine/mc68328.c
@@ -47,7 +47,7 @@ void mc68328_device::device_config_complete()
const mc68328_interface *intf = reinterpret_cast<const mc68328_interface *>(static_config());
if (intf != NULL)
*static_cast<mc68328_interface *>(this) = *intf;
-
+
// or initialize to defaults if none provided
else
{
@@ -84,7 +84,7 @@ void mc68328_device::device_config_complete()
//-------------------------------------------------
void mc68328_device::device_start()
-{
+{
m_out_port_a.resolve(m_out_port_a_func, *this);
m_out_port_b.resolve(m_out_port_b_func, *this);
m_out_port_c.resolve(m_out_port_c_func, *this);
@@ -95,7 +95,7 @@ void mc68328_device::device_start()
m_out_port_j.resolve(m_out_port_j_func, *this);
m_out_port_k.resolve(m_out_port_k_func, *this);
m_out_port_m.resolve(m_out_port_m_func, *this);
-
+
m_in_port_a.resolve(m_in_port_a_func, *this);
m_in_port_b.resolve(m_in_port_b_func, *this);
m_in_port_c.resolve(m_in_port_c_func, *this);
@@ -108,7 +108,7 @@ void mc68328_device::device_start()
m_in_port_m.resolve(m_in_port_m_func, *this);
m_out_pwm.resolve(m_out_pwm_func, *this);
-
+
m_out_spim.resolve(m_out_spim_func, *this);
m_in_spim.resolve(m_in_spim_func, *this);
@@ -155,18 +155,18 @@ void mc68328_device::device_reset()
m_regs.csd1 = 0x00010006;
m_regs.csd2 = 0x00010006;
m_regs.csd3 = 0x00010006;
-
+
m_regs.pllcr = 0x2400;
m_regs.pllfsr = 0x0123;
m_regs.pctlr = 0x1f;
-
+
m_regs.ivr = 0x00;
m_regs.icr = 0x0000;
m_regs.imr = 0x00ffffff;
m_regs.iwr = 0x00ffffff;
m_regs.isr = 0x00000000;
m_regs.ipr = 0x00000000;
-
+
m_regs.padir = 0x00;
m_regs.padata = 0x00;
m_regs.pasel = 0x00;
@@ -206,12 +206,12 @@ void mc68328_device::device_reset()
m_regs.pmdata = 0x00;
m_regs.pmpuen = 0xff;
m_regs.pmsel = 0xff;
-
+
m_regs.pwmc = 0x0000;
m_regs.pwmp = 0x0000;
m_regs.pwmw = 0x0000;
m_regs.pwmcnt = 0x0000;
-
+
m_regs.tctl[0] = m_regs.tctl[1] = 0x0000;
m_regs.tprer[0] = m_regs.tprer[1] = 0x0000;
m_regs.tcmp[0] = m_regs.tcmp[1] = 0xffff;
@@ -221,18 +221,18 @@ void mc68328_device::device_reset()
m_regs.wctlr = 0x0000;
m_regs.wcmpr = 0xffff;
m_regs.wcn = 0x0000;
-
+
m_regs.spisr = 0x0000;
-
+
m_regs.spimdata = 0x0000;
m_regs.spimcont = 0x0000;
-
+
m_regs.ustcnt = 0x0000;
m_regs.ubaud = 0x003f;
m_regs.urx = 0x0000;
m_regs.utx = 0x0000;
m_regs.umisc = 0x0000;
-
+
m_regs.lssa = 0x00000000;
m_regs.lvpw = 0xff;
m_regs.lxmax = 0x03ff;
@@ -251,14 +251,14 @@ void mc68328_device::device_reset()
m_regs.lposr = 0x00;
m_regs.lfrcm = 0xb9;
m_regs.lgpmr = 0x1073;
-
+
m_regs.hmsr = 0x00000000;
m_regs.alarm = 0x00000000;
m_regs.rtcctl = 0x00;
m_regs.rtcisr = 0x00;
m_regs.rtcienr = 0x00;
m_regs.stpwtch = 0x00;
-
+
m_rtc->adjust(attotime::from_hz(1), 0, attotime::from_hz(1));
}
@@ -2735,13 +2735,13 @@ UINT32 mc68328_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap
UINT16 word;
UINT16 *line;
int y, x, b;
-
+
if (m_regs.lckcon & LCKCON_LCDC_EN)
{
for (y = 0; y < 160; y++)
{
line = &bitmap.pix16(y);
-
+
for (x = 0; x < 160; x += 16)
{
word = *(video_ram++);
@@ -2757,7 +2757,7 @@ UINT32 mc68328_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap
for (y = 0; y < 160; y++)
{
line = &bitmap.pix16(y);
-
+
for (x = 0; x < 160; x++)
{
line[x] = 0;
@@ -2905,4 +2905,3 @@ void mc68328_device::register_state_save()
save_item(NAME(m_regs.rtcienr));
save_item(NAME(m_regs.stpwtch));
}
-
diff --git a/src/mess/machine/mc68328.h b/src/mess/machine/mc68328.h
index 617c21e7f9a..78ed79fa43b 100644
--- a/src/mess/machine/mc68328.h
+++ b/src/mess/machine/mc68328.h
@@ -1,14 +1,14 @@
/**********************************************************************
-
+
Motorola 68328 ("DragonBall") System-on-a-Chip implementation
-
+
By MooglyGuy
contact mooglyguy@gmail.com with licensing and usage questions.
-
+
**********************************************************************/
/*****************************************************************************************************************
-
+
P P P P P P P P P P P P P P
E E E E E E E J J J J J J J
1 2 3 4 5 6 7 0 1 2 3 4 5 6
@@ -80,11 +80,11 @@
1 2 P
I
O
-
+
Figure 12-1. MC68328 144-Lead Plastic Thin-Quad Flat Pack Pin Assignment
-
+
Source: MC68328 (DragonBall)(tm) Integrated Processor User's Manual
-
+
*****************************************************************************************************************/
#ifndef __MC68328_H__
@@ -412,7 +412,7 @@
struct mc68328_interface
{
const char *m68k_cpu_tag;
-
+
devcb_write8 m_out_port_a_func; /* 8-bit output */
devcb_write8 m_out_port_b_func; /* 8-bit output */
devcb_write8 m_out_port_c_func; /* 8-bit output */
@@ -423,7 +423,7 @@ struct mc68328_interface
devcb_write8 m_out_port_j_func; /* 8-bit output */
devcb_write8 m_out_port_k_func; /* 8-bit output */
devcb_write8 m_out_port_m_func; /* 8-bit output */
-
+
devcb_read8 m_in_port_a_func; /* 8-bit input */
devcb_read8 m_in_port_b_func; /* 8-bit input */
devcb_read8 m_in_port_c_func; /* 8-bit input */
@@ -434,9 +434,9 @@ struct mc68328_interface
devcb_read8 m_in_port_j_func; /* 8-bit input */
devcb_read8 m_in_port_k_func; /* 8-bit input */
devcb_read8 m_in_port_m_func; /* 8-bit input */
-
+
devcb_write8 m_out_pwm_func; /* 1-bit output */
-
+
devcb_write16 m_out_spim_func; /* 16-bit output */
devcb_read16 m_in_spim_func; /* 16-bit input */
@@ -449,7 +449,7 @@ struct mc68328_regs_t
// $(FF)FFF000
UINT8 scr; // System Control Register
UINT8 unused0[255];
-
+
// $(FF)FFF100
UINT16 grpbasea; // Chip Select Group A Base Register
UINT16 grpbaseb; // Chip Select Group B Base Register
@@ -476,14 +476,14 @@ struct mc68328_regs_t
UINT32 csd2; // Group D Chip Select 2 Register
UINT32 csd3; // Group D Chip Select 3 Register
UINT8 unused1[176];
-
+
// $(FF)FFF200
UINT16 pllcr; // PLL Control Register
UINT16 pllfsr; // PLL Frequency Select Register
UINT8 pad2[3];
UINT8 pctlr; // Power Control Register
UINT8 unused3[248];
-
+
// $(FF)FFF300
UINT8 ivr; // Interrupt Vector Register
UINT8 unused4[1];
@@ -493,26 +493,26 @@ struct mc68328_regs_t
UINT32 isr; // Interrupt Status Register
UINT32 ipr; // Interrupt Pending Register
UINT8 unused5[236];
-
+
// $(FF)FFF400
UINT8 padir; // Port A Direction Register
UINT8 padata; // Port A Data Register
UINT8 unused6[1];
UINT8 pasel; // Port A Select Register
UINT8 unused7[4];
-
+
UINT8 pbdir; // Port B Direction Register
UINT8 pbdata; // Port B Data Register
UINT8 unused8[1];
UINT8 pbsel; // Port B Select Register
UINT8 unused9[4];
-
+
UINT8 pcdir; // Port C Direction Register
UINT8 pcdata; // Port C Data Register
UINT8 unused10[1];
UINT8 pcsel; // Port C Select Register
UINT8 unused11[4];
-
+
UINT8 pddir; // Port D Direction Register
UINT8 pddata; // Port D Data Register
UINT8 pdpuen; // Port D Pullup Enable Register
@@ -521,25 +521,25 @@ struct mc68328_regs_t
UINT8 pdirqen; // Port D IRQ Enable Register
UINT8 pddataedge; // Port D Data Edge Level
UINT8 pdirqedge; // Port D IRQ Edge Register
-
+
UINT8 pedir; // Port E Direction Register
UINT8 pedata; // Port E Data Register
UINT8 pepuen; // Port E Pullup Enable Register
UINT8 pesel; // Port E Select Register
UINT8 unused14[4];
-
+
UINT8 pfdir; // Port F Direction Register
UINT8 pfdata; // Port F Data Register
UINT8 pfpuen; // Port F Pullup Enable Register
UINT8 pfsel; // Port F Select Register
UINT8 unused15[4];
-
+
UINT8 pgdir; // Port G Direction Register
UINT8 pgdata; // Port G Data Register
UINT8 pgpuen; // Port G Pullup Enable Register
UINT8 pgsel; // Port G Select Register
UINT8 unused16[4];
-
+
UINT8 pjdir; // Port J Direction Register
UINT8 pjdata; // Port J Data Register
UINT8 unused17[1];
@@ -550,20 +550,20 @@ struct mc68328_regs_t
UINT8 pkpuen; // Port K Pullup Enable Register
UINT8 pksel; // Port K Select Register
UINT8 unused19[4];
-
+
UINT8 pmdir; // Port M Direction Register
UINT8 pmdata; // Port M Data Register
UINT8 pmpuen; // Port M Pullup Enable Register
UINT8 pmsel; // Port M Select Register
UINT8 unused20[180];
-
+
// $(FF)FFF500
UINT16 pwmc; // PWM Control Register
UINT16 pwmp; // PWM Period Register
UINT16 pwmw; // PWM Width Register
UINT16 pwmcnt; // PWN Counter
UINT8 unused21[248];
-
+
// $(FF)FFF600
UINT16 tctl[2]; // Timer Control Register
UINT16 tprer[2]; // Timer Prescaler Register
@@ -576,16 +576,16 @@ struct mc68328_regs_t
UINT16 wcn; // Watchdog Counter
UINT8 tclear[2]; // Timer Clearable Status
UINT8 unused22[224];
-
+
// $(FF)FFF700
UINT16 spisr; // SPIS Register
UINT8 unused23[254];
-
+
// $(FF)FFF800
UINT16 spimdata; // SPIM Data Register
UINT16 spimcont; // SPIM Control/Status Register
UINT8 unused24[252];
-
+
// $(FF)FFF900
UINT16 ustcnt; // UART Status/Control Register
UINT16 ubaud; // UART Baud Control Register
@@ -593,7 +593,7 @@ struct mc68328_regs_t
UINT16 utx; // UART TX Register
UINT16 umisc; // UART Misc Register
UINT8 unused25[246];
-
+
// $(FF)FFFA00
UINT32 lssa; // Screen Starting Address Register
UINT8 unused26[1];
@@ -625,7 +625,7 @@ struct mc68328_regs_t
UINT8 lfrcm; // Frame Rate Control Modulation Register
UINT16 lgpmr; // Gray Palette Mapping Register
UINT8 unused37[204];
-
+
// $(FF)FFFB00
UINT32 hmsr; // RTC Hours Minutes Seconds Register
UINT32 alarm; // RTC Alarm Register
@@ -657,15 +657,15 @@ protected:
virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
-
-private:
+
+private:
// internal state
void set_interrupt_line(UINT32 line, UINT32 active);
void poll_port_d_interrupts();
UINT32 get_timer_frequency(UINT32 index);
void maybe_start_timer(UINT32 index, UINT32 new_enable);
void timer_compare_event(UINT32 index);
-
+
void register_state_save();
TIMER_CALLBACK_MEMBER(timer1_hit);
@@ -674,11 +674,11 @@ private:
TIMER_CALLBACK_MEMBER(rtc_tick);
mc68328_regs_t m_regs;
-
+
emu_timer *m_gptimer[2];
emu_timer *m_rtc;
emu_timer *m_pwm;
-
+
devcb_resolved_write8 m_out_port_a; /* 8-bit output */
devcb_resolved_write8 m_out_port_b; /* 8-bit output */
devcb_resolved_write8 m_out_port_c; /* 8-bit output */
@@ -689,7 +689,7 @@ private:
devcb_resolved_write8 m_out_port_j; /* 8-bit output */
devcb_resolved_write8 m_out_port_k; /* 8-bit output */
devcb_resolved_write8 m_out_port_m; /* 8-bit output */
-
+
devcb_resolved_read8 m_in_port_a; /* 8-bit input */
devcb_resolved_read8 m_in_port_b; /* 8-bit input */
devcb_resolved_read8 m_in_port_c; /* 8-bit input */
@@ -700,13 +700,13 @@ private:
devcb_resolved_read8 m_in_port_j; /* 8-bit input */
devcb_resolved_read8 m_in_port_k; /* 8-bit input */
devcb_resolved_read8 m_in_port_m; /* 8-bit input */
-
+
devcb_resolved_write8 m_out_pwm; /* 1-bit output */
-
+
devcb_resolved_write16 m_out_spim; /* 16-bit output */
devcb_resolved_read16 m_in_spim; /* 16-bit input */
- devcb_resolved_write_line m_spim_xch_trigger; // not really a write_line, fix when converting to devcb2!
+ devcb_resolved_write_line m_spim_xch_trigger; // not really a write_line, fix when converting to devcb2!
cpu_device *m_cpu;
};
diff --git a/src/mess/machine/md_rom.c b/src/mess/machine/md_rom.c
index 93fc21639db..17d3113284e 100644
--- a/src/mess/machine/md_rom.c
+++ b/src/mess/machine/md_rom.c
@@ -1212,7 +1212,7 @@ WRITE16_MEMBER(md_rom_tekkensp_device::write)
// data output mode bit 1 ? (never written by game)
break;
default:
- if (data & 0x100) // data input (only connected to D0 ?)
+ if (data & 0x100) // data input (only connected to D0 ?)
{
// 4-bit hardware register ($400004 corresponds to bit0, $400006 to bit1, etc)
int shift = (offset - 2) & 3;
diff --git a/src/mess/machine/md_rom.h b/src/mess/machine/md_rom.h
index 890e6287db6..6cd16d477d2 100644
--- a/src/mess/machine/md_rom.h
+++ b/src/mess/machine/md_rom.h
@@ -155,7 +155,7 @@ class md_rom_16mj2_device : public md_std_rom_device
public:
// construction/destruction
md_rom_16mj2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ16_MEMBER(read);
};
@@ -447,15 +447,15 @@ class md_rom_tekkensp_device : public md_std_rom_device
public:
// construction/destruction
md_rom_tekkensp_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_READ16_MEMBER(read);
virtual DECLARE_WRITE16_MEMBER(write);
-
+
private:
UINT16 m_reg;
};
diff --git a/src/mess/machine/msx.c b/src/mess/machine/msx.c
index 8df2039e0ad..a76d1ba0aa2 100644
--- a/src/mess/machine/msx.c
+++ b/src/mess/machine/msx.c
@@ -858,7 +858,7 @@ void msx_state::msx_memory_init()
size = layout->size;
option = layout->option;
-
+
if (layout->type != SLOT_CARTRIDGE1 && layout->type != SLOT_CARTRIDGE2)
{
int size_tmp = 0;
diff --git a/src/mess/machine/pce.c b/src/mess/machine/pce.c
index 0e8925a009b..daee087e3b5 100644
--- a/src/mess/machine/pce.c
+++ b/src/mess/machine/pce.c
@@ -120,7 +120,7 @@ MACHINE_RESET_MEMBER(pce_state,mess_pce)
m_sys3_card = 1;
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x080000, 0x087fff, read8_delegate(FUNC(pce_state::pce_cd_acard_wram_r),this),write8_delegate(FUNC(pce_state::pce_cd_acard_wram_w),this));
}
-
+
if (m_cartslot->get_type() == PCE_CDSYS3U)
{
m_sys3_card = 3;
@@ -213,7 +213,7 @@ WRITE8_MEMBER(pce_state::pce_cd_intf_w)
if (offset & 0x200 && m_sys3_card && m_acard) // route Arcade Card handling ports
return m_cd->acard_w(space, offset, data);
-
+
m_cd->intf_w(space, offset, data);
m_cd->update();
@@ -238,7 +238,7 @@ READ8_MEMBER(pce_state::pce_cd_intf_r)
case 0xc7: return 0x03;
}
}
-
+
return m_cd->intf_r(space, offset);
}
diff --git a/src/mess/machine/pce_cd.c b/src/mess/machine/pce_cd.c
index ca08ef6847a..3050fc6e989 100644
--- a/src/mess/machine/pce_cd.c
+++ b/src/mess/machine/pce_cd.c
@@ -98,30 +98,30 @@ void pce_cd_device::device_start()
/* set up adpcm related things */
m_adpcm_ram = auto_alloc_array_clear(machine(), UINT8, PCE_ADPCM_RAM_SIZE);
m_adpcm_clock_divider = 1;
-
+
/* Set up cd command buffer */
m_command_buffer = auto_alloc_array_clear(machine(), UINT8, PCE_CD_COMMAND_BUFFER_SIZE);
m_command_buffer_index = 0;
-
+
/* Set up Arcade Card RAM buffer */
m_acard_ram = auto_alloc_array_clear(machine(), UINT8, PCE_ACARD_RAM_SIZE);
-
+
m_data_buffer = auto_alloc_array_clear(machine(), UINT8, 8192);
m_data_buffer_size = 0;
m_data_buffer_index = 0;
-
+
m_subcode_buffer = auto_alloc_array(machine(), UINT8, 96);
-
+
m_data_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pce_cd_device::data_timer_callback),this));
m_data_timer->adjust(attotime::never);
m_adpcm_dma_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pce_cd_device::adpcm_dma_timer_callback),this));
m_adpcm_dma_timer->adjust(attotime::never);
-
+
m_cdda_fadeout_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pce_cd_device::cdda_fadeout_callback),this));
m_cdda_fadeout_timer->adjust(attotime::never);
m_cdda_fadein_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pce_cd_device::cdda_fadein_callback),this));
m_cdda_fadein_timer->adjust(attotime::never);
-
+
m_adpcm_fadeout_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pce_cd_device::adpcm_fadeout_callback),this));
m_adpcm_fadeout_timer->adjust(attotime::never);
m_adpcm_fadein_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pce_cd_device::adpcm_fadein_callback),this));
@@ -187,16 +187,16 @@ void pce_cd_device::device_start()
}
void pce_cd_device::device_reset()
-{
+{
m_adpcm_read_buf = 0;
m_adpcm_write_buf = 0;
-
+
// TODO: add CD-DA stop command here
//m_cdda_status = PCE_CD_CDDA_OFF;
//m_cdda->stop_audio();
memset(m_regs, 0, sizeof(m_regs));
-
+
m_regs[0x0c] |= PCE_CD_ADPCM_STOP_FLAG;
m_regs[0x0c] &= ~PCE_CD_ADPCM_PLAY_FLAG;
//m_regs[0x03] = (m_regs[0x03] & ~0x0c) | (PCE_CD_SAMPLE_STOP_PLAY);
@@ -286,28 +286,28 @@ void pce_cd_device::adpcm_play()
WRITE_LINE_MEMBER( pce_cd_device::msm5205_int )
{
UINT8 msm_data;
-
+
// popmessage("%08x %08x %08x %02x %02x",m_msm_start_addr,m_msm_end_addr,m_msm_half_addr,m_regs[0x0c],m_regs[0x0d]);
-
+
if (m_msm_idle)
return;
-
+
/* Supply new ADPCM data */
msm_data = (m_msm_nibble) ? (m_adpcm_ram[m_msm_start_addr] & 0x0f) : ((m_adpcm_ram[m_msm_start_addr] & 0xf0) >> 4);
-
+
m_msm->data_w(msm_data);
m_msm_nibble ^= 1;
-
+
if (m_msm_nibble == 0)
{
m_msm_start_addr++;
-
+
if (m_msm_start_addr == m_msm_half_addr)
{
//set_irq_line(PCE_CD_IRQ_SAMPLE_FULL_PLAY, CLEAR_LINE);
//set_irq_line(PCE_CD_IRQ_SAMPLE_HALF_PLAY, ASSERT_LINE);
}
-
+
if (m_msm_start_addr > m_msm_end_addr)
{
//set_irq_line(PCE_CD_IRQ_SAMPLE_HALF_PLAY, CLEAR_LINE);
@@ -328,7 +328,7 @@ void pce_cd_device::reply_status_byte(UINT8 status)
m_scsi_MSG = 0;
m_message_after_status = 1;
m_status_sent = m_message_sent = 0;
-
+
if (status == SCSI_STATUS_OK)
{
m_regs[0x01] = 0x00;
@@ -361,24 +361,24 @@ void pce_cd_device::read_6()
UINT32 frame = ((m_command_buffer[1] & 0x1f) << 16) | (m_command_buffer[2] << 8) | m_command_buffer[3];
UINT32 frame_count = m_command_buffer[4];
printf("%08x %08x\n",frame,frame_count);
-
+
/* Check for presence of a CD */
if (!m_cd_file)
{
reply_status_byte(SCSI_CHECK_CONDITION);
return;
}
-
+
if (m_cdda_status != PCE_CD_CDDA_OFF)
{
m_cdda_status = PCE_CD_CDDA_OFF;
m_cdda->stop_audio();
m_end_mark = 0;
}
-
+
m_current_frame = frame;
m_end_frame = frame + frame_count;
-
+
if (frame_count == 0)
{
/* Star Breaker uses this */
@@ -389,7 +389,7 @@ void pce_cd_device::read_6()
{
m_data_timer->adjust(attotime::from_hz(PCE_CD_DATA_FRAMES_PER_SECOND), 0, attotime::from_hz(PCE_CD_DATA_FRAMES_PER_SECOND));
}
-
+
/* TODO: correct place? */
set_irq_line(PCE_CD_IRQ_TRANSFER_READY, ASSERT_LINE);
}
@@ -398,14 +398,14 @@ void pce_cd_device::read_6()
void pce_cd_device::nec_set_audio_start_position()
{
UINT32 frame = 0;
-
+
if (!m_cd_file)
{
/* Throw some error here */
reply_status_byte(SCSI_CHECK_CONDITION);
return;
}
-
+
switch (m_command_buffer[9] & 0xC0)
{
case 0x00:
@@ -415,11 +415,11 @@ void pce_cd_device::nec_set_audio_start_position()
case 0x40:
{
UINT8 m,s,f;
-
+
m = bcd_2_dec(m_command_buffer[2]);
s = bcd_2_dec(m_command_buffer[3]);
f = bcd_2_dec(m_command_buffer[4]);
-
+
frame = f + 75 * (s + m * 60);
// PCE tries to be clever here and set (start of track + track pregap size) to skip the pregap
// (I guess it wants the TOC to have the real start sector for data tracks and the start of the pregap for audio?)
@@ -434,9 +434,9 @@ void pce_cd_device::nec_set_audio_start_position()
//assert(NULL == nec_set_audio_start_position);
break;
}
-
+
m_current_frame = frame;
-
+
if (m_cdda_status == PCE_CD_CDDA_PAUSED)
{
m_cdda_status = PCE_CD_CDDA_OFF;
@@ -463,7 +463,7 @@ void pce_cd_device::nec_set_audio_start_position()
m_cdda_play_mode = 3;
}
}
-
+
reply_status_byte(SCSI_STATUS_OK);
set_irq_line(PCE_CD_IRQ_TRANSFER_DONE, ASSERT_LINE);
}
@@ -472,14 +472,14 @@ void pce_cd_device::nec_set_audio_start_position()
void pce_cd_device::nec_set_audio_stop_position()
{
UINT32 frame = 0;
-
+
if (!m_cd_file)
{
/* Throw some error here */
reply_status_byte(SCSI_CHECK_CONDITION);
return;
}
-
+
switch (m_command_buffer[9] & 0xC0)
{
case 0x00:
@@ -489,11 +489,11 @@ void pce_cd_device::nec_set_audio_stop_position()
case 0x40:
{
UINT8 m,s,f;
-
+
m = bcd_2_dec(m_command_buffer[2]);
s = bcd_2_dec(m_command_buffer[3]);
f = bcd_2_dec(m_command_buffer[4]);
-
+
frame = f + 75 * (s + m * 60);
// if (frame >= 525) // TODO: seven seconds gap? O_o
// frame -= 525;
@@ -507,10 +507,10 @@ void pce_cd_device::nec_set_audio_stop_position()
//assert(NULL == nec_set_audio_start_position);
break;
}
-
+
m_end_frame = frame;
m_cdda_play_mode = m_command_buffer[1] & 0x03;
-
+
if (m_cdda_play_mode)
{
if (m_cdda_status == PCE_CD_CDDA_PAUSED)
@@ -533,7 +533,7 @@ void pce_cd_device::nec_set_audio_stop_position()
m_end_mark = 0;
// assert(NULL == nec_set_audio_stop_position);
}
-
+
reply_status_byte(SCSI_STATUS_OK);
set_irq_line(PCE_CD_IRQ_TRANSFER_DONE, ASSERT_LINE);
}
@@ -547,14 +547,14 @@ void pce_cd_device::nec_pause()
reply_status_byte(SCSI_CHECK_CONDITION);
return;
}
-
+
/* If there was no cdda playing, throw an error */
if (m_cdda_status == PCE_CD_CDDA_OFF)
{
reply_status_byte(SCSI_CHECK_CONDITION);
return;
}
-
+
m_cdda_status = PCE_CD_CDDA_PAUSED;
m_current_frame = m_cdda->get_audio_lba();
m_cdda->pause_audio(1);
@@ -566,16 +566,16 @@ void pce_cd_device::nec_get_subq()
{
/* WP - I do not have access to chds with subchannel information yet, so I'm faking something here */
UINT32 msf_abs, msf_rel, track, frame;
-
+
if (!m_cd_file)
{
/* Throw some error here */
reply_status_byte(SCSI_CHECK_CONDITION);
return;
}
-
+
frame = m_current_frame;
-
+
switch (m_cdda_status)
{
case PCE_CD_CDDA_PAUSED:
@@ -590,11 +590,11 @@ void pce_cd_device::nec_get_subq()
m_data_buffer[0] = 3;
break;
}
-
+
msf_abs = lba_to_msf_alt(frame);
track = cdrom_get_track(m_cd_file, frame);
msf_rel = lba_to_msf_alt(frame - cdrom_get_track_start(m_cd_file, track));
-
+
m_data_buffer[1] = 0x01 | ((cdrom_get_track_type(m_cd_file, cdrom_get_track(m_cd_file, track+1)) == CD_TRACK_AUDIO) ? 0x00 : 0x40);
m_data_buffer[2] = dec_2_bcd(track+1); /* track */
m_data_buffer[3] = 1; /* index */
@@ -605,7 +605,7 @@ void pce_cd_device::nec_get_subq()
m_data_buffer[8] = dec_2_bcd((msf_abs >> 8) & 0xFF); /* S (absolute) */
m_data_buffer[9] = dec_2_bcd(msf_abs & 0xFF); /* F (absolute) */
m_data_buffer_size = 10;
-
+
m_data_buffer_index = 0;
m_data_transferred = 1;
m_scsi_IO = 1;
@@ -618,15 +618,15 @@ void pce_cd_device::nec_get_dir_info()
UINT32 frame, msf, track = 0;
const cdrom_toc *toc;
logerror("nec get dir info\n");
-
+
if (!m_cd_file)
{
/* Throw some error here */
reply_status_byte(SCSI_CHECK_CONDITION);
}
-
+
toc = cdrom_get_toc(m_cd_file);
-
+
switch (m_command_buffer[1])
{
case 0x00: /* Get first and last track numbers */
@@ -638,7 +638,7 @@ void pce_cd_device::nec_get_dir_info()
frame = toc->tracks[toc->numtrks-1].logframeofs;
frame += toc->tracks[toc->numtrks-1].frames;
msf = lba_to_msf(frame + 150);
-
+
m_data_buffer[0] = (msf >> 16) & 0xFF; /* M */
m_data_buffer[1] = (msf >> 8) & 0xFF; /* S */
m_data_buffer[2] = msf & 0xFF; /* F */
@@ -672,7 +672,7 @@ void pce_cd_device::nec_get_dir_info()
// assert(pce_cd_nec_get_dir_info == NULL); // Not implemented yet
break;
}
-
+
m_data_buffer_index = 0;
m_data_transferred = 1;
m_scsi_IO = 1;
@@ -702,28 +702,28 @@ void pce_cd_device::handle_data_output()
{ 0xDE,10, &pce_cd_device::nec_get_dir_info }, /* NEC GET DIR INFO */
{ 0xFF, 1, &pce_cd_device::end_of_list } /* end of list marker */
};
-
+
if (m_scsi_REQ && m_scsi_ACK)
{
/* Command byte received */
logerror("Command byte $%02X received\n", m_regs[0x01]);
-
+
/* Check for buffer overflow */
assert(m_command_buffer_index < PCE_CD_COMMAND_BUFFER_SIZE);
-
+
m_command_buffer[m_command_buffer_index] = m_regs[0x01];
m_command_buffer_index++;
m_scsi_REQ = 0;
}
-
+
if (! m_scsi_REQ && ! m_scsi_ACK && m_command_buffer_index)
{
int i = 0;
-
+
logerror("Check if command done\n");
-
+
for(i = 0; m_command_buffer[0] > pce_cd_commands[i].command_byte; i++);
-
+
/* Check for unknown commands */
if (m_command_buffer[0] != pce_cd_commands[i].command_byte)
{
@@ -732,7 +732,7 @@ void pce_cd_device::handle_data_output()
popmessage("CD command 0x03 issued (Request Sense), contact MESSdev");
}
assert(m_command_buffer[0] == pce_cd_commands[i].command_byte);
-
+
if (m_command_buffer_index == pce_cd_commands[i].command_size)
{
//printf("%02x command issued\n",m_command_buffer[0]);
@@ -757,7 +757,7 @@ void pce_cd_device::handle_data_input()
m_scsi_REQ = 0;
m_status_sent = 1;
}
-
+
if (! m_scsi_REQ && ! m_scsi_ACK && m_status_sent)
{
m_status_sent = 0;
@@ -777,7 +777,7 @@ void pce_cd_device::handle_data_input()
{
m_scsi_REQ = 0;
}
-
+
if (! m_scsi_REQ && ! m_scsi_ACK)
{
if (m_data_buffer_index == m_data_buffer_size)
@@ -814,7 +814,7 @@ void pce_cd_device::handle_message_input()
m_scsi_REQ = 0;
m_message_sent = 1;
}
-
+
if (! m_scsi_REQ && ! m_scsi_ACK && m_message_sent)
{
m_message_sent = 0;
@@ -842,7 +842,7 @@ void pce_cd_device::update()
}
m_scsi_last_RST = m_scsi_RST;
}
-
+
/* Check if bus can be freed */
if (! m_scsi_SEL && ! m_scsi_BSY && m_selected)
{
@@ -851,7 +851,7 @@ void pce_cd_device::update()
m_scsi_CD = m_scsi_MSG = m_scsi_IO = m_scsi_REQ = 0;
set_irq_line(PCE_CD_IRQ_TRANSFER_DONE, CLEAR_LINE);
}
-
+
/* Select the CD device */
if (m_scsi_SEL)
{
@@ -863,7 +863,7 @@ void pce_cd_device::update()
m_scsi_MSG = m_scsi_IO = 0;
}
}
-
+
if (m_scsi_ATN)
{
}
@@ -900,7 +900,7 @@ void pce_cd_device::update()
}
}
}
-
+
/* FIXME: presumably CD-DA needs an irq interface for this */
if (m_cdda->audio_ended() && m_end_mark == 1)
{
@@ -919,7 +919,7 @@ void pce_cd_device::set_irq_line(int num, int state)
m_regs[0x03] |= num;
else
m_regs[0x03] &= ~num;
-
+
if (m_regs[0x02] & m_regs[0x03] & 0x7c)
{
//printf("IRQ PEND = %02x MASK = %02x IRQ ENABLE %02X\n",m_regs[0x02] & m_regs[0x03] & 0x7c,m_regs[0x02] & 0x7c,m_regs[0x03] & 0x7c);
@@ -945,14 +945,14 @@ TIMER_CALLBACK_MEMBER(pce_cd_device::data_timer_callback)
{
logerror("Succesfully read mode1 frame #%d\n", m_current_frame);
}
-
+
m_data_buffer_index = 0;
m_data_buffer_size = 2048;
m_current_frame++;
-
+
m_scsi_IO = 1;
m_scsi_CD = 0;
-
+
if (m_current_frame == m_end_frame)
{
/* We are done, disable the timer */
@@ -997,7 +997,7 @@ void pce_cd_device::set_adpcm_ram_byte(UINT8 val)
TIMER_CALLBACK_MEMBER(pce_cd_device::cdda_fadeout_callback)
{
m_cdda_volume -= 0.1;
-
+
if (m_cdda_volume <= 0)
{
m_cdda_volume = 0.0;
@@ -1014,7 +1014,7 @@ TIMER_CALLBACK_MEMBER(pce_cd_device::cdda_fadeout_callback)
TIMER_CALLBACK_MEMBER(pce_cd_device::cdda_fadein_callback)
{
m_cdda_volume += 0.1;
-
+
if (m_cdda_volume >= 100.0)
{
m_cdda_volume = 100.0;
@@ -1031,7 +1031,7 @@ TIMER_CALLBACK_MEMBER(pce_cd_device::cdda_fadein_callback)
TIMER_CALLBACK_MEMBER(pce_cd_device::adpcm_fadeout_callback)
{
m_adpcm_volume -= 0.1;
-
+
if (m_adpcm_volume <= 0)
{
m_adpcm_volume = 0.0;
@@ -1048,7 +1048,7 @@ TIMER_CALLBACK_MEMBER(pce_cd_device::adpcm_fadeout_callback)
TIMER_CALLBACK_MEMBER(pce_cd_device::adpcm_fadein_callback)
{
m_adpcm_volume += 0.1;
-
+
if (m_adpcm_volume >= 100.0)
{
m_adpcm_volume = 100.0;
@@ -1066,7 +1066,7 @@ TIMER_CALLBACK_MEMBER(pce_cd_device::adpcm_fadein_callback)
WRITE8_MEMBER(pce_cd_device::intf_w)
{
logerror("%04X: write to CD interface offset %02X, data %02X\n", space.device().safe_pc(), offset, data);
-
+
switch (offset & 0xf)
{
case 0x00: /* CDC status */
@@ -1134,7 +1134,7 @@ WRITE8_MEMBER(pce_cd_device::intf_w)
adpcm_stop(0);
m_msm->reset_w(1);
}
-
+
if ((data & 0x40) && ((m_regs[0x0D] & 0x40) == 0)) // ADPCM play
{
m_msm_start_addr = (m_adpcm_read_ptr);
@@ -1143,7 +1143,7 @@ WRITE8_MEMBER(pce_cd_device::intf_w)
m_msm_nibble = 0;
adpcm_play();
m_msm->reset_w(0);
-
+
//popmessage("%08x %08x",m_adpcm_read_ptr,m_adpcm_length);
}
else if ((data & 0x40) == 0)
@@ -1152,9 +1152,9 @@ WRITE8_MEMBER(pce_cd_device::intf_w)
adpcm_stop(0);
m_msm->reset_w(1);
}
-
+
m_msm_repeat = BIT(data, 5);
-
+
if (data & 0x10) //ADPCM set length
{
m_adpcm_length = (m_regs[0x09] << 8) | m_regs[0x08];
@@ -1273,7 +1273,7 @@ TIMER_CALLBACK_MEMBER(pce_cd_device::adpcm_dma_timer_callback)
{
m_adpcm_ram[m_adpcm_write_ptr] = get_cd_data_byte();
m_adpcm_write_ptr = (m_adpcm_write_ptr + 1) & 0xFFFF;
-
+
m_regs[0x0c] &= ~4;
}
}
@@ -1288,10 +1288,10 @@ UINT8 pce_cd_device::get_adpcm_ram_byte()
else
{
UINT8 res;
-
+
res = m_adpcm_ram[m_adpcm_read_ptr];
m_adpcm_read_ptr = ((m_adpcm_read_ptr + 1) & 0xffff);
-
+
return res;
}
}
@@ -1356,7 +1356,7 @@ READ8_MEMBER(pce_cd_device::intf_r)
data = 0xFF;
break;
}
-
+
return data;
}
@@ -1370,7 +1370,7 @@ PC Engine Arcade Card emulation
READ8_MEMBER(pce_cd_device::acard_r)
{
UINT8 r_num;
-
+
if ((offset & 0x2e0) == 0x2e0)
{
switch (offset & 0x2ef)
@@ -1384,12 +1384,12 @@ READ8_MEMBER(pce_cd_device::acard_r)
case 0x2ee: return 0x10;
case 0x2ef: return 0x51;
}
-
+
return 0;
}
-
+
r_num = (offset & 0x30) >> 4;
-
+
switch (offset & 0x0f)
{
case 0x00:
@@ -1400,7 +1400,7 @@ READ8_MEMBER(pce_cd_device::acard_r)
res = m_acard_ram[(m_acard_base_addr[r_num] + m_acard_addr_offset[r_num]) & 0x1fffff];
else
res = m_acard_ram[m_acard_base_addr[r_num] & 0x1fffff];
-
+
if (m_acard_ctrl[r_num] & 0x1)
{
if (m_acard_ctrl[r_num] & 0x10)
@@ -1413,7 +1413,7 @@ READ8_MEMBER(pce_cd_device::acard_r)
m_acard_addr_offset[r_num] += m_acard_addr_inc[r_num];
}
}
-
+
return res;
}
case 0x02: return (m_acard_base_addr[r_num] >> 0) & 0xff;
@@ -1426,14 +1426,14 @@ READ8_MEMBER(pce_cd_device::acard_r)
case 0x09: return m_acard_ctrl[r_num];
default: return 0;
}
-
+
return 0;
}
WRITE8_MEMBER(pce_cd_device::acard_w)
{
UINT8 w_num;
-
+
if ((offset & 0x2e0) == 0x2e0)
{
switch (offset & 0x0f)
@@ -1445,7 +1445,7 @@ WRITE8_MEMBER(pce_cd_device::acard_w)
case 4:
{
m_acard_shift_reg = data & 0x0f;
-
+
if (m_acard_shift_reg != 0)
{
m_acard_shift = (m_acard_shift_reg < 8) ?
@@ -1460,7 +1460,7 @@ WRITE8_MEMBER(pce_cd_device::acard_w)
else
{
w_num = (offset & 0x30) >> 4;
-
+
switch (offset & 0x0f)
{
case 0x00:
@@ -1469,7 +1469,7 @@ WRITE8_MEMBER(pce_cd_device::acard_w)
m_acard_ram[(m_acard_base_addr[w_num] + m_acard_addr_offset[w_num]) & 0x1fffff] = data;
else
m_acard_ram[m_acard_base_addr[w_num] & 0x1FFFFF] = data;
-
+
if (m_acard_ctrl[w_num] & 0x1)
{
if (m_acard_ctrl[w_num] & 0x10)
@@ -1482,16 +1482,16 @@ WRITE8_MEMBER(pce_cd_device::acard_w)
m_acard_addr_offset[w_num] += m_acard_addr_inc[w_num];
}
}
-
+
break;
-
+
case 0x02: m_acard_base_addr[w_num] = (data & 0xff) | (m_acard_base_addr[w_num] & 0xffff00); break;
case 0x03: m_acard_base_addr[w_num] = (data << 8) | (m_acard_base_addr[w_num] & 0xff00ff); break;
case 0x04: m_acard_base_addr[w_num] = (data << 16) | (m_acard_base_addr[w_num] & 0x00ffff); break;
case 0x05: m_acard_addr_offset[w_num] = (data & 0xff) | (m_acard_addr_offset[w_num] & 0xff00); break;
case 0x06:
m_acard_addr_offset[w_num] = (data << 8) | (m_acard_addr_offset[w_num] & 0x00ff);
-
+
if ((m_acard_ctrl[w_num] & 0x60) == 0x40)
{
m_acard_base_addr[w_num] += m_acard_addr_offset[w_num] + ((m_acard_ctrl[w_num] & 0x08) ? 0xff0000 : 0);
diff --git a/src/mess/machine/pce_cd.h b/src/mess/machine/pce_cd.h
index 967e0f8d887..c500ccb0770 100644
--- a/src/mess/machine/pce_cd.h
+++ b/src/mess/machine/pce_cd.h
@@ -105,7 +105,7 @@ private:
UINT8 m_msm_nibble;
UINT8 m_msm_idle;
UINT8 m_msm_repeat;
-
+
/* SCSI signals */
int m_scsi_BSY; /* Busy. Bus in use */
int m_scsi_SEL; /* Select. Initiator has won arbitration and has selected a target */
@@ -128,7 +128,7 @@ private:
int m_data_buffer_size;
int m_data_buffer_index;
int m_data_transferred;
-
+
/* Arcade Card specific */
UINT8 *m_acard_ram;
UINT8 m_acard_latch;
@@ -138,7 +138,7 @@ private:
UINT16 m_acard_addr_inc[4];
UINT32 m_acard_shift;
UINT8 m_acard_shift_reg;
-
+
UINT32 m_current_frame;
UINT32 m_end_frame;
UINT32 m_last_frame;
@@ -151,12 +151,12 @@ private:
required_device<cdda_device> m_cdda;
required_device<nvram_device> m_nvram;
required_device<cdrom_image_device> m_cdrom;
-
+
cdrom_file *m_cd_file;
const cdrom_toc* m_toc;
emu_timer *m_data_timer;
emu_timer *m_adpcm_dma_timer;
-
+
emu_timer *m_cdda_fadeout_timer;
emu_timer *m_cdda_fadein_timer;
double m_cdda_volume;
diff --git a/src/mess/machine/pce_rom.c b/src/mess/machine/pce_rom.c
index 4fbef351d62..86474afa9a4 100644
--- a/src/mess/machine/pce_rom.c
+++ b/src/mess/machine/pce_rom.c
@@ -1,8 +1,8 @@
/***********************************************************************************************************
-
+
PC-Engine & Turbografx-16 cart emulation
-
+
***********************************************************************************************************/
@@ -98,7 +98,7 @@ READ8_MEMBER(pce_populous_device::read_cart)
int bank = offset / 0x20000;
if (m_ram && offset >= 0x80000 && offset < 0x88000)
return m_ram[offset];
-
+
return m_rom[rom_bank_map[bank] * 0x20000 + (offset & 0x1ffff)];
}
@@ -122,4 +122,3 @@ WRITE8_MEMBER(pce_sf2_device::write_cart)
if (offset >= 0x1ff0 && offset < 0x1ff4)
m_bank_base = offset & 3;
}
-
diff --git a/src/mess/machine/pce_rom.h b/src/mess/machine/pce_rom.h
index 40eb8b45a9e..caaa1bcc7c7 100644
--- a/src/mess/machine/pce_rom.h
+++ b/src/mess/machine/pce_rom.h
@@ -13,11 +13,11 @@ public:
// construction/destruction
pce_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);
pce_rom_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_cart);
};
@@ -57,11 +57,11 @@ class pce_sf2_device : public pce_rom_device
public:
// construction/destruction
pce_sf2_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_cart);
virtual DECLARE_WRITE8_MEMBER(write_cart);
diff --git a/src/mess/machine/pce_slot.c b/src/mess/machine/pce_slot.c
index a4286622710..bb190ca7dd8 100644
--- a/src/mess/machine/pce_slot.c
+++ b/src/mess/machine/pce_slot.c
@@ -96,7 +96,7 @@ void device_pce_cart_interface::rom_map_setup(UINT32 size)
// setup the rom_bank_map array to faster ROM read
for (i = 0; i < size / 0x20000 && i < 8; i++)
rom_bank_map[i] = i;
-
+
// fill up remaining blocks with mirrors
while (i % 8)
{
@@ -110,10 +110,10 @@ void device_pce_cart_interface::rom_map_setup(UINT32 size)
}
}
// check bank map!
-// for (i = 0; i < 8; i++)
-// {
-// printf("bank %3d = %3d\t", i, rom_bank_map[i]);
-// }
+// for (i = 0; i < 8; i++)
+// {
+// printf("bank %3d = %3d\t", i, rom_bank_map[i]);
+// }
}
@@ -218,7 +218,7 @@ bool pce_cart_slot_device::call_load()
UINT32 offset = 0;
UINT32 len = (software_entry() == NULL) ? length() : get_software_region_length("rom");
UINT8 *ROM;
-
+
// From fullpath, check for presence of a header and skip it
if (software_entry() == NULL && (len % 0x4000) == 512)
{
@@ -227,7 +227,7 @@ bool pce_cart_slot_device::call_load()
len -= offset;
fseek(offset, SEEK_SET);
}
-
+
m_cart->rom_alloc(machine(), len);
ROM = m_cart->get_rom_base();
@@ -240,11 +240,11 @@ bool pce_cart_slot_device::call_load()
if (ROM[0x1fff] < 0xe0)
{
UINT8 decrypted[256];
-
+
/* Initialize decryption table */
for (int i = 0; i < 256; i++)
decrypted[i] = ((i & 0x01) << 7) | ((i & 0x02) << 5) | ((i & 0x04) << 3) | ((i & 0x08) << 1) | ((i & 0x10) >> 1) | ((i & 0x20 ) >> 3) | ((i & 0x40) >> 5) | ((i & 0x80) >> 7);
-
+
/* Decrypt ROM image */
for (int i = 0; i < len; i++)
ROM[i] = decrypted[ROM[i]];
@@ -253,13 +253,13 @@ bool pce_cart_slot_device::call_load()
m_cart->rom_map_setup(len);
if (software_entry() == NULL)
- m_type = get_cart_type(ROM, len);
+ m_type = get_cart_type(ROM, len);
else
{
const char *pcb_name = get_feature("slot");
if (pcb_name)
m_type = pce_get_pcb_id(pcb_name);
- }
+ }
//printf("Type: %s\n", pce_get_slot(m_type));
if (m_type == PCE_POPULOUS)
@@ -296,7 +296,7 @@ bool pce_cart_slot_device::call_softlist_load(char *swlist, char *swname, rom_en
/*-------------------------------------------------
- get_cart_type - code to detect NVRAM type from
+ get_cart_type - code to detect NVRAM type from
fullpath
-------------------------------------------------*/
@@ -307,11 +307,11 @@ int pce_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len)
/* Check for Street fighter 2 */
if (len == 0x280000)
type = PCE_SF2;
-
+
/* Check for Populous */
if (len >= 0x1f26 + 8 && !memcmp(ROM + 0x1f26, "POPULOUS", 8))
type = PCE_POPULOUS;
-
+
// Check for CD system card v3 which adds on-cart RAM to the system
if (!memcmp(ROM + 0x3FFB6, "PC Engine CD-ROM SYSTEM", 23))
{
@@ -382,4 +382,3 @@ WRITE8_MEMBER(pce_cart_slot_device::write_cart)
void pce_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len)
{
}
-
diff --git a/src/mess/machine/pce_slot.h b/src/mess/machine/pce_slot.h
index b8c4ca0b65f..5622024ebd8 100644
--- a/src/mess/machine/pce_slot.h
+++ b/src/mess/machine/pce_slot.h
@@ -44,7 +44,7 @@ public:
UINT32 m_ram_size;
void rom_map_setup(UINT32 size);
-
+
UINT8 rom_bank_map[8]; // 128K chunks of rom
};
diff --git a/src/mess/machine/s3c44b0.c b/src/mess/machine/s3c44b0.c
index 487c5410263..18e4df1cfb2 100644
--- a/src/mess/machine/s3c44b0.c
+++ b/src/mess/machine/s3c44b0.c
@@ -61,7 +61,7 @@ void s3c44b0_device::device_config_complete()
const s3c44b0_interface *intf = reinterpret_cast<const s3c44b0_interface *>(static_config());
if (intf != NULL)
*static_cast<s3c44b0_interface *>(this) = *intf;
-
+
// or initialize to defaults if none provided
else
{
@@ -83,8 +83,8 @@ void s3c44b0_device::device_start()
m_sda_w.resolve(i2c_itf.sda_w, *this);
m_adc_data_r.resolve(adc_itf.data_r, *this);
m_i2s_data_w.resolve(i2s_itf.data_w, *this);
-
-
+
+
for (int i = 0; i < 6; i++) m_pwm.timer[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(s3c44b0_device::pwm_timer_exp),this));
for (int i = 0; i < 2; i++) m_uart[i].timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(s3c44b0_device::uart_timer_exp),this));
for (int i = 0; i < 2; i++) m_zdma[i].timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(s3c44b0_device::zdma_timer_exp),this));
@@ -114,12 +114,12 @@ void s3c44b0_device::device_start()
save_item(NAME(m_irq.regs.f_ispc));
save_item(NAME(m_irq.line_irq));
save_item(NAME(m_irq.line_fiq));
-
+
save_item(NAME(m_clkpow.regs.pllcon));
save_item(NAME(m_clkpow.regs.clkcon));
save_item(NAME(m_clkpow.regs.clkslow));
save_item(NAME(m_clkpow.regs.locktime));
-
+
// FIXME: how to save m_lcd.bitmap which gets allocated/freed during emulation?
save_item(NAME(m_lcd.regs.lcdcon1));
save_item(NAME(m_lcd.regs.lcdcon2));
@@ -149,9 +149,9 @@ void s3c44b0_device::device_start()
save_item(NAME(m_lcd.vpos_max));
save_item(NAME(m_lcd.vpos_end));
save_item(NAME(m_lcd.frame_time));
-
+
machine().save().register_postload(save_prepost_delegate(FUNC(s3c44b0_device::s3c44b0_postload), this));
-
+
for (int i = 0; i < 2; i++)
{
save_item(NAME(m_zdma[i].regs.dcon), i);
@@ -161,7 +161,7 @@ void s3c44b0_device::device_start()
save_item(NAME(m_zdma[i].regs.dcsrc), i);
save_item(NAME(m_zdma[i].regs.dcdst), i);
save_item(NAME(m_zdma[i].regs.dccnt), i);
-
+
save_item(NAME(m_bdma[i].regs.dcon), i);
save_item(NAME(m_bdma[i].regs.disrc), i);
save_item(NAME(m_bdma[i].regs.didst), i);
@@ -169,7 +169,7 @@ void s3c44b0_device::device_start()
save_item(NAME(m_bdma[i].regs.dcsrc), i);
save_item(NAME(m_bdma[i].regs.dcdst), i);
save_item(NAME(m_bdma[i].regs.dccnt), i);
-
+
save_item(NAME(m_uart[i].regs.ulcon), i);
save_item(NAME(m_uart[i].regs.ucon), i);
save_item(NAME(m_uart[i].regs.ufcon), i);
@@ -182,13 +182,13 @@ void s3c44b0_device::device_start()
save_item(NAME(m_uart[i].regs.urxh), i);
save_item(NAME(m_uart[i].regs.ubrdiv), i);
}
-
+
save_item(NAME(m_sio.regs.siocon));
save_item(NAME(m_sio.regs.siodat));
save_item(NAME(m_sio.regs.sbrdr));
save_item(NAME(m_sio.regs.itvcnt));
save_item(NAME(m_sio.regs.dcntz));
-
+
save_item(NAME(m_pwm.regs.tcfg0));
save_item(NAME(m_pwm.regs.tcfg1));
save_item(NAME(m_pwm.regs.tcon));
@@ -212,17 +212,17 @@ void s3c44b0_device::device_start()
save_item(NAME(m_pwm.cnt));
save_item(NAME(m_pwm.cmp));
save_item(NAME(m_pwm.freq));
-
+
save_item(NAME(m_wdt.regs.wtcon));
save_item(NAME(m_wdt.regs.wtdat));
save_item(NAME(m_wdt.regs.wtcnt));
-
+
save_item(NAME(m_iic.regs.iiccon));
save_item(NAME(m_iic.regs.iicstat));
save_item(NAME(m_iic.regs.iicadd));
save_item(NAME(m_iic.regs.iicds));
save_item(NAME(m_iic.count));
-
+
save_item(NAME(m_iis.regs.iiscon));
save_item(NAME(m_iis.regs.iismod));
save_item(NAME(m_iis.regs.iispsr));
@@ -230,7 +230,7 @@ void s3c44b0_device::device_start()
save_item(NAME(m_iis.regs.iisfifo));
save_item(NAME(m_iis.fifo));
save_item(NAME(m_iis.fifo_index));
-
+
save_item(NAME(m_gpio.regs.gpacon));
save_item(NAME(m_gpio.regs.gpadat));
save_item(NAME(m_gpio.regs.gpbcon));
@@ -253,11 +253,11 @@ void s3c44b0_device::device_start()
save_item(NAME(m_gpio.regs.spucr));
save_item(NAME(m_gpio.regs.extint));
save_item(NAME(m_gpio.regs.extintpnd));
-
+
save_item(NAME(m_adc.regs.adccon));
save_item(NAME(m_adc.regs.adcpsr));
save_item(NAME(m_adc.regs.adcdat));
-
+
save_item(NAME(m_cpuwrap.regs.syscfg));
save_item(NAME(m_cpuwrap.regs.ncachbe0));
save_item(NAME(m_cpuwrap.regs.ncachbe1));
diff --git a/src/mess/machine/s3c44b0.h b/src/mess/machine/s3c44b0.h
index 5b764d99ee3..0ae1c60699c 100644
--- a/src/mess/machine/s3c44b0.h
+++ b/src/mess/machine/s3c44b0.h
@@ -635,7 +635,7 @@ class s3c44b0_device : public device_t,
public:
s3c44b0_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~s3c44b0_device() {}
-
+
DECLARE_READ32_MEMBER(lcd_r);
DECLARE_READ32_MEMBER(clkpow_r);
DECLARE_READ32_MEMBER(irq_r);
@@ -680,7 +680,7 @@ protected:
virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
-
+
private:
// internal state
// LCD Controller
@@ -754,7 +754,7 @@ private:
void adc_stop();
void adc_recalc();
TIMER_CALLBACK_MEMBER(adc_timer_exp);
-
+
// SIO
void sio_start();
void sio_stop();
diff --git a/src/mess/machine/sega8_rom.c b/src/mess/machine/sega8_rom.c
index 9d8b37262de..4f02c3b6cc7 100644
--- a/src/mess/machine/sega8_rom.c
+++ b/src/mess/machine/sega8_rom.c
@@ -1,7 +1,7 @@
/***********************************************************************************************************
Sega 8-bit cart emulation (for Master System, GameGear and SG-1000)
-
+
TODO: implement proper ROM & RAM mirroring when the cart size is not a power of 2K (e.g. 24K or 48K)
***********************************************************************************************************/
@@ -318,20 +318,20 @@ void sega8_korean_device::late_bank_setup()
-------------------------------------------------*/
/*-------------------------------------------------
-
+
Base Sega 8bit carts, possibly with bankswitch
(only used by Mark III, SMS and GG games)
-
+
-------------------------------------------------*/
READ8_MEMBER(sega8_rom_device::read_cart)
{
int bank = offset / 0x4000;
-
+
if (bank == 2 && m_ram && m_ram_enabled)
return m_ram[(m_ram_base * 0x4000 + (offset & 0x3fff)) % m_ram_size];
- if (offset < 0x400) // first 1k is hardcoded
+ if (offset < 0x400) // first 1k is hardcoded
return m_rom[offset];
return m_rom[m_rom_bank_base[bank] * 0x4000 + (offset & 0x3fff)];
@@ -340,7 +340,7 @@ READ8_MEMBER(sega8_rom_device::read_cart)
WRITE8_MEMBER(sega8_rom_device::write_cart)
{
int bank = offset / 0x4000;
-
+
if (bank == 2 && m_ram && m_ram_enabled)
m_ram[(m_ram_base * 0x4000 + (offset & 0x3fff)) % m_ram_size] = data;
}
@@ -362,29 +362,29 @@ WRITE8_MEMBER(sega8_rom_device::write_mapper)
else
m_ram_enabled = 0;
break;
-
+
case 1: // Select 16k ROM bank for 0000-3fff
case 2: // Select 16k ROM bank for 4000-7fff
case 3: // Select 16k ROM bank for 8000-bfff
m_rom_bank_base[offset - 1] = data % m_rom_page_count;
break;
- }
+ }
}
/*-------------------------------------------------
-
- Sega Card Catcher is a passthrough adapter for
- SG-1000 to load games in MyCard format into the
+
+ Sega Card Catcher is a passthrough adapter for
+ SG-1000 to load games in MyCard format into the
main cartslot
-
+
-------------------------------------------------*/
READ8_MEMBER(sega8_cardcatch_device::read_cart)
{
if (offset < 0x8000)
return m_card->read_cart(space, offset);
-
+
return 0xff;
}
@@ -409,11 +409,11 @@ machine_config_constructor sega8_cardcatch_device::device_mconfig_additions() co
}
/*-------------------------------------------------
-
- Othello is a SG-1000 game featuring 2K of
+
+ Othello is a SG-1000 game featuring 2K of
oncart RAM, mapped at 0x8000-0x9fff.
Is RAM mirrored? For now we assume so...
-
+
-------------------------------------------------*/
READ8_MEMBER(sega8_othello_device::read_cart)
@@ -421,7 +421,7 @@ READ8_MEMBER(sega8_othello_device::read_cart)
// 8K of RAM sits in 0x8000-0x9fff
if (offset >= 0x8000 && offset < 0xa000)
return m_ram[offset & 0x7ff];
-
+
return m_rom[offset % m_rom_size];
}
@@ -434,10 +434,10 @@ WRITE8_MEMBER(sega8_othello_device::write_cart)
/*-------------------------------------------------
-
- The Castle is a SG-1000 game featuring 8K of
+
+ The Castle is a SG-1000 game featuring 8K of
oncart RAM, mapped at 0x8000-0x9fff
-
+
-------------------------------------------------*/
READ8_MEMBER(sega8_castle_device::read_cart)
@@ -445,7 +445,7 @@ READ8_MEMBER(sega8_castle_device::read_cart)
// 8K of RAM sits in 0x8000-0x9fff
if (offset >= 0x8000 && offset < 0xa000)
return m_ram[offset & 0x1fff];
-
+
return m_rom[offset % m_rom_size];
}
@@ -458,10 +458,10 @@ WRITE8_MEMBER(sega8_castle_device::write_cart)
/*-------------------------------------------------
-
- BASIC Level III cart featured 32K of
+
+ BASIC Level III cart featured 32K of
oncart RAM, mapped at 0x8000-0xffff?
-
+
-------------------------------------------------*/
READ8_MEMBER(sega8_basic_l3_device::read_cart)
@@ -469,7 +469,7 @@ READ8_MEMBER(sega8_basic_l3_device::read_cart)
// 8K of RAM sits in 0x8000-0x9fff
if (offset >= 0x8000)
return m_ram[offset & 0x3fff];
-
+
return m_rom[offset % m_rom_size];
}
@@ -492,10 +492,10 @@ WRITE8_MEMBER(sega8_basic_l3_device::write_ram)
/*-------------------------------------------------
-
- Music Editor cart featured 10K of oncart RAM, mapped
+
+ Music Editor cart featured 10K of oncart RAM, mapped
in 0x8000-0x9fff and 0xc000-0xffff
-
+
-------------------------------------------------*/
READ8_MEMBER(sega8_music_editor_device::read_cart)
@@ -503,7 +503,7 @@ READ8_MEMBER(sega8_music_editor_device::read_cart)
// 8K of RAM sits in 0x8000-0x9fff
if (offset >= 0x8000 && offset < 0xa000)
return m_ram[offset & 0x1fff];
-
+
return m_rom[offset % m_rom_size];
}
@@ -530,38 +530,38 @@ WRITE8_MEMBER(sega8_music_editor_device::write_ram)
/*-------------------------------------------------
-
+
SG-1000 Terebi Oekaki using a Tablet input device
-
+
-------------------------------------------------*/
/*
-
+
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.
-
+
*/
READ8_MEMBER(sega8_terebi_device::read_cart)
{
int bank = offset / 0x4000;
-
+
if (offset == 0x8000)
return m_tvdraw_pen->read();
if (offset == 0xa000)
return m_tvdraw_data;
-
+
return m_rom[m_rom_bank_base[bank] * 0x4000 + (offset & 0x3fff)];
}
@@ -573,7 +573,7 @@ WRITE8_MEMBER(sega8_terebi_device::write_cart)
if (data & 0x01)
{
m_tvdraw_data = m_tvdraw_x->read();
-
+
if (m_tvdraw_data < 4) m_tvdraw_data = 4;
if (m_tvdraw_data > 251) m_tvdraw_data = 251;
}
@@ -604,16 +604,16 @@ ioport_constructor sega8_terebi_device::device_input_ports() const
/*-------------------------------------------------
-
+
Dahjee carts were sold with a RAM expansion pass-through
- cart (which we don't emulate separately for the
- moment) which allowed to play on old SG1000 machines
+ cart (which we don't emulate separately for the
+ moment) which allowed to play on old SG1000 machines
some MSX conversions requiring more RAM than available
-
+
Two kind of expansion existed (for different games),
- one with 9K of RAM (Type A) and one with 8K of
+ one with 9K of RAM (Type A) and one with 8K of
RAM (Type B).
-
+
-------------------------------------------------*/
// TYPE A
@@ -622,7 +622,7 @@ READ8_MEMBER(sega8_dahjee_typea_device::read_cart)
// 8K of RAM sits in 0x2000-0x3fff
if (offset >= 0x2000 && offset < 0x4000)
return m_ram[offset & 0x1fff];
-
+
return m_rom[offset % m_rom_size];
}
@@ -670,27 +670,27 @@ WRITE8_MEMBER(sega8_dahjee_typeb_device::write_ram)
/*-------------------------------------------------
-
+
Sega carts + EEPROM, used for some GameGear baseball
games
-
+
-------------------------------------------------*/
READ8_MEMBER(sega8_eeprom_device::read_cart)
{
int bank = offset / 0x4000;
-
+
if (offset == 0x8000 && m_93c46_enabled)
{
UINT8 value = (m_93c46_lines & 0xfc) | 0x02;
value |= m_eeprom->read_bit() ? 1 : 0;
return value;
}
-
- if (offset < 0x400) // first 1k is hardcoded
+
+ if (offset < 0x400) // first 1k is hardcoded
return m_rom[offset];
-
+
return m_rom[m_rom_bank_base[bank] * 0x4000 + (offset & 0x3fff)];
}
@@ -719,13 +719,13 @@ WRITE8_MEMBER(sega8_eeprom_device::write_mapper)
m_93c46_enabled = BIT(data, 3);
logerror("eeprom %s\n", m_93c46_enabled ? "enabled" : "disabled");
break;
-
+
case 1: // Select 16k ROM bank for 0000-3fff
case 2: // Select 16k ROM bank for 4000-7fff
case 3: // Select 16k ROM bank for 8000-bfff
m_rom_bank_base[offset - 1] = data % m_rom_page_count;
break;
- }
+ }
}
MACHINE_CONFIG_FRAGMENT( gg_eeprom )
@@ -739,19 +739,19 @@ machine_config_constructor sega8_eeprom_device::device_mconfig_additions() const
/*-------------------------------------------------
-
+
Codemasters carts, possibly having on cart RAM
(Ernie Els Golf)
-
+
-------------------------------------------------*/
READ8_MEMBER(sega8_codemasters_device::read_cart)
{
int bank = offset / 0x2000;
-
+
if (bank == 5 && m_ram && m_ram_enabled)
return m_ram[(m_ram_base * 0x2000 + (offset & 0x1fff)) % m_ram_size];
-
+
return m_rom[m_rom_bank_base[bank/2] * 0x4000 + (offset & 0x3fff)];
}
@@ -786,9 +786,9 @@ WRITE8_MEMBER(sega8_codemasters_device::write_cart)
}
/*-------------------------------------------------
-
+
HES 4 PAK All Action cart
-
+
-------------------------------------------------*/
@@ -814,25 +814,25 @@ WRITE8_MEMBER(sega8_4pak_device::write_cart)
/*-------------------------------------------------
-
+
base Zemina carts, allowing for 8K bankswitch
-
+
-------------------------------------------------*/
READ8_MEMBER(sega8_zemina_device::read_cart)
{
int bank = offset / 0x2000;
-
+
if (bank >= 4 && m_ram && m_ram_enabled)
return m_ram[(m_ram_base * 0x2000 + (offset & 0x1fff)) % m_ram_size];
-
+
return m_rom[m_rom_bank_base[bank] * 0x2000 + (offset & 0x1fff)];
}
WRITE8_MEMBER(sega8_zemina_device::write_cart)
{
int bank = offset / 0x2000;
-
+
if (bank >= 4 && m_ram && m_ram_enabled)
m_ram[(m_ram_base * 0x2000 + (offset & 0x1fff)) % m_ram_size] = data;
@@ -857,28 +857,28 @@ WRITE8_MEMBER(sega8_zemina_device::write_cart)
}
/*-------------------------------------------------
-
+
Zemina cart used for Nemesis: same as above, but
different bank layout at start (see late_bank_setup)
-
+
-------------------------------------------------*/
/*-------------------------------------------------
-
+
Daiou cart used for SMS Janggun-ui Adeul
-
+
the game expects to access 256 x 8K banks:
first 64 are just the game, second 64 are a mirror of the first ones
upper 128 are the same as the previous but with bytes in reverse order
probably as a shortcut to get sprite flipping for free from hw
so if bit7 of current bank page is set, we swap the result
-
+
-------------------------------------------------*/
READ8_MEMBER(sega8_janggun_device::read_cart)
{
int bank = offset / 0x2000;
-
+
if (m_rom_bank_base[bank] < 0x80)
return m_rom[(m_rom_bank_base[bank] & 0x3f) * 0x2000 + (offset & 0x1fff)];
else
@@ -911,32 +911,31 @@ WRITE8_MEMBER(sega8_janggun_device::write_mapper)
{
case 0:
break;
-
+
case 1: // Select 16k ROM bank for 0000-3fff
case 2: // Select 16k ROM bank for 4000-7fff
case 3: // Select 16k ROM bank for 8000-bfff
m_rom_bank_base[(offset - 1) * 2] = (data % m_rom_page_count) * 2;
m_rom_bank_base[(offset - 1) * 2 + 1] = (data % m_rom_page_count) * 2 + 1;
break;
- }
+ }
}
/*-------------------------------------------------
-
- Korean cart, used e.g. in Dodgeball King,
+
+ Korean cart, used e.g. in Dodgeball King,
uses writes to 0xa000 for bankswitch
-
+
-------------------------------------------------*/
WRITE8_MEMBER(sega8_korean_device::write_cart)
{
int bank = offset / 0x4000;
-
+
if (bank == 2 && m_ram && m_ram_enabled)
m_ram[m_ram_base * 0x4000 + (offset & 0x3fff)] = data;
if (offset == 0xa000)
m_rom_bank_base[2] = data % m_rom_page_count;
}
-
diff --git a/src/mess/machine/sega8_rom.h b/src/mess/machine/sega8_rom.h
index 1c78a20788f..98403c2f0ec 100644
--- a/src/mess/machine/sega8_rom.h
+++ b/src/mess/machine/sega8_rom.h
@@ -41,14 +41,14 @@ class sega8_cardcatch_device : public sega8_rom_device
public:
// construction/destruction
sega8_cardcatch_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_cart);
virtual DECLARE_WRITE8_MEMBER(write_cart);
virtual DECLARE_WRITE8_MEMBER(write_mapper) {}
-
+
virtual machine_config_constructor device_mconfig_additions() const;
-
+
protected:
required_device<sega8_card_slot_device> m_card;
};
@@ -61,7 +61,7 @@ class sega8_othello_device : public sega8_rom_device
public:
// construction/destruction
sega8_othello_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_cart);
virtual DECLARE_WRITE8_MEMBER(write_cart);
@@ -76,7 +76,7 @@ class sega8_castle_device : public sega8_rom_device
public:
// construction/destruction
sega8_castle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_cart);
virtual DECLARE_WRITE8_MEMBER(write_cart);
@@ -91,12 +91,12 @@ class sega8_basic_l3_device : public sega8_rom_device
public:
// construction/destruction
sega8_basic_l3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_cart);
virtual DECLARE_WRITE8_MEMBER(write_cart);
virtual DECLARE_WRITE8_MEMBER(write_mapper) {}
-
+
// has internal RAM which overwrites the system one!
virtual DECLARE_READ8_MEMBER(read_ram);
virtual DECLARE_WRITE8_MEMBER(write_ram);
@@ -110,12 +110,12 @@ class sega8_music_editor_device : public sega8_rom_device
public:
// construction/destruction
sega8_music_editor_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_cart);
virtual DECLARE_WRITE8_MEMBER(write_cart);
virtual DECLARE_WRITE8_MEMBER(write_mapper) {}
-
+
// has internal RAM which overwrites the system one!
virtual DECLARE_READ8_MEMBER(read_ram);
virtual DECLARE_WRITE8_MEMBER(write_ram);
@@ -129,21 +129,21 @@ class sega8_terebi_device : public sega8_rom_device
public:
// construction/destruction
sega8_terebi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual ioport_constructor device_input_ports() const;
virtual void device_reset();
-
+
required_ioport m_tvdraw_x;
required_ioport m_tvdraw_y;
required_ioport m_tvdraw_pen;
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_cart);
virtual DECLARE_WRITE8_MEMBER(write_cart);
virtual DECLARE_WRITE8_MEMBER(write_mapper) {}
-
+
protected:
UINT8 m_tvdraw_data;
};
@@ -156,12 +156,12 @@ class sega8_dahjee_typea_device : public sega8_rom_device
public:
// construction/destruction
sega8_dahjee_typea_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_cart);
virtual DECLARE_WRITE8_MEMBER(write_cart);
virtual DECLARE_WRITE8_MEMBER(write_mapper) {}
-
+
// has internal RAM which overwrites the system one!
virtual DECLARE_READ8_MEMBER(read_ram);
virtual DECLARE_WRITE8_MEMBER(write_ram);
@@ -175,12 +175,12 @@ class sega8_dahjee_typeb_device : public sega8_rom_device
public:
// construction/destruction
sega8_dahjee_typeb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_cart);
virtual DECLARE_WRITE8_MEMBER(write_cart) {}
virtual DECLARE_WRITE8_MEMBER(write_mapper) {}
-
+
// has internal RAM which overwrites the system one!
virtual DECLARE_READ8_MEMBER(read_ram);
virtual DECLARE_WRITE8_MEMBER(write_ram);
@@ -197,22 +197,22 @@ class sega8_eeprom_device : public device_t,
public:
// construction/destruction
sega8_eeprom_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();
-
+
virtual void late_bank_setup();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_cart);
virtual DECLARE_WRITE8_MEMBER(write_cart);
virtual DECLARE_WRITE8_MEMBER(write_mapper);
-
+
protected:
UINT8 m_rom_bank_base[3];
-
+
required_device<eeprom_device> m_eeprom;
int m_93c46_enabled;
UINT8 m_93c46_lines;
@@ -227,18 +227,18 @@ class sega8_codemasters_device : public device_t,
public:
// construction/destruction
sega8_codemasters_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
virtual void late_bank_setup();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_cart);
virtual DECLARE_WRITE8_MEMBER(write_cart);
// no mapper write for this!
-
+
protected:
UINT8 m_rom_bank_base[3];
UINT8 m_ram_base;
@@ -253,7 +253,7 @@ class sega8_4pak_device : public sega8_rom_device
public:
// construction/destruction
sega8_4pak_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
@@ -275,18 +275,18 @@ public:
// construction/destruction
sega8_zemina_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);
sega8_zemina_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
-
+
virtual void late_bank_setup();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_cart);
virtual DECLARE_WRITE8_MEMBER(write_cart);
// no mapper write for this!
-
+
protected:
UINT8 m_rom_bank_base[6];
UINT8 m_ram_base;
@@ -301,7 +301,7 @@ class sega8_nemesis_device : public sega8_zemina_device
public:
// construction/destruction
sega8_nemesis_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
virtual void late_bank_setup();
};
@@ -317,14 +317,14 @@ public:
// device-level overrides
virtual void device_start() { save_item(NAME(m_rom_bank_base)); }
-
+
virtual void late_bank_setup();
-
+
// reading and writing
virtual DECLARE_READ8_MEMBER(read_cart);
virtual DECLARE_WRITE8_MEMBER(write_cart);
virtual DECLARE_WRITE8_MEMBER(write_mapper);
-
+
protected:
UINT8 m_rom_bank_base[6];
};
@@ -337,9 +337,9 @@ class sega8_korean_device : public sega8_rom_device
public:
// construction/destruction
sega8_korean_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
virtual void late_bank_setup();
-
+
// reading and writing
virtual DECLARE_WRITE8_MEMBER(write_cart);
virtual DECLARE_WRITE8_MEMBER(write_mapper) {}
diff --git a/src/mess/machine/sega8_slot.c b/src/mess/machine/sega8_slot.c
index 31d8245d966..5b4f53bb810 100644
--- a/src/mess/machine/sega8_slot.c
+++ b/src/mess/machine/sega8_slot.c
@@ -1,13 +1,13 @@
/***********************************************************************************************************
-
-
+
+
Sega 8-bit cart emulation
(through slot devices)
Master System (Mark III) and Game Gear memory map can access 3 x 16K banks of ROM in
- 0x0000-0xbfff memory range. These banks can however point to different ROM or RAM area
+ 0x0000-0xbfff memory range. These banks can however point to different ROM or RAM area
of the cart (or to BIOS banks, but these are handled directly in SMS emulation).
-
+
Hence, carts can interface with the main system through the following handlers
* read_cart : to read from ROM/RAM in memory range [0000-bfff]
* write_cart : to write to ROM/RAM in memory range [0000-bfff]
@@ -17,10 +17,10 @@
Note about Sega Card / MyCard: the data contained in these matches the data in carts, it's only
the connector to be different. We emulate this with a variant of the slot having different media
switch and different interface (the latter not implemented yet)
-
+
TODO:
- investigate SG-1000 carts so to reduce duplicated code and to add full .sg support to sg1000m3
-
+
***********************************************************************************************************/
@@ -81,8 +81,8 @@ void device_sega8_cart_interface::rom_alloc(running_machine &machine, UINT32 siz
m_rom = auto_alloc_array_clear(machine, UINT8, size);
m_rom_size = size;
m_rom_page_count = size / 0x4000;
- if (!m_rom_page_count)
- m_rom_page_count = 1; // we compute rom pages through (XXX % m_rom_page_count)!
+ if (!m_rom_page_count)
+ m_rom_page_count = 1; // we compute rom pages through (XXX % m_rom_page_count)!
late_bank_setup();
}
}
@@ -221,14 +221,14 @@ static const char *sega8_get_slot(int type)
int sega8_cart_slot_device::verify_cart( UINT8 *magic, int size )
{
int retval = IMAGE_VERIFY_FAIL;
-
+
// Verify the file is a valid image - check $7ff0 for "TMR SEGA"
if (size >= 0x8000)
{
if (!strncmp((char*)&magic[0x7ff0], "TMR SEGA", 8))
- retval = IMAGE_VERIFY_PASS;
+ retval = IMAGE_VERIFY_PASS;
}
-
+
return retval;
}
@@ -256,19 +256,19 @@ void sega8_cart_slot_device::set_lphaser_xoffset( UINT8 *rom, int size )
{
if (!memcmp(&rom[0x7ff0], signatures[0], 16) || !memcmp(&rom[0x7ff0], signatures[1], 16))
xoff = 41;
-
+
if (!memcmp(&rom[0x7ff0], signatures[2], 16))
xoff = 50;
-
+
if (!memcmp(&rom[0x7ff0], signatures[3], 16))
xoff = 48;
-
+
if (!memcmp(&rom[0x7ff0], signatures[4], 16))
xoff = 45;
-
+
if (!memcmp(&rom[0x7ff0], signatures[5], 16))
xoff = 54;
-
+
}
m_cart->set_lphaser_xoffs(xoff);
@@ -313,11 +313,11 @@ void sega8_cart_slot_device::setup_ram()
// Codemasters cart can have 64KB of RAM (Ernie Els Golf? or 8KB?) and no battery
m_cart->ram_alloc(machine(), 0x10000);
m_cart->set_has_battery(FALSE);
- }
+ }
else
{
- // for generic carts loaded from fullpath we have no way to know exactly if there was RAM,
- // how much RAM was in the cart and if there was a battery so we always alloc 32KB and
+ // for generic carts loaded from fullpath we have no way to know exactly if there was RAM,
+ // how much RAM was in the cart and if there was a battery so we always alloc 32KB and
// we save its content only if the game enable the RAM
m_cart->set_late_battery(TRUE);
m_cart->ram_alloc(machine(), 0x08000);
@@ -328,13 +328,13 @@ void sega8_cart_slot_device::setup_ram()
// from softlist we rely on the xml to only allocate the correct amount of RAM and to save it only if a battery was present
const char *battery = get_feature("battery");
m_cart->set_late_battery(FALSE);
-
+
if (get_software_region_length("ram"))
m_cart->ram_alloc(machine(), get_software_region_length("ram"));
if (battery && !strcmp(battery, "yes"))
m_cart->set_has_battery(TRUE);
- }
+ }
}
bool sega8_cart_slot_device::call_load()
@@ -350,21 +350,21 @@ bool sega8_cart_slot_device::call_load()
seterror(IMAGE_ERROR_UNSPECIFIED, "Attempted loading a card larger than 32KB");
return IMAGE_INIT_FAIL;
}
-
+
// check for header
if ((len % 0x4000) == 512)
{
offset = 512;
len -= 512;
}
-
+
// make sure that we only get complete (0x4000) rom banks
if (len & 0x3fff)
len = ((len >> 14) + 1) << 14;
-
+
m_cart->rom_alloc(machine(), len);
ROM = m_cart->get_rom_base();
-
+
if (software_entry() == NULL)
{
fseek(offset, SEEK_SET);
@@ -372,7 +372,7 @@ bool sega8_cart_slot_device::call_load()
}
else
memcpy(ROM, get_software_region("rom") + offset, len);
-
+
/* check the image */
if (verify_cart(ROM, len) == IMAGE_VERIFY_FAIL)
logerror("Warning loading image: verify_cart failed\n");
@@ -381,11 +381,11 @@ bool sega8_cart_slot_device::call_load()
m_type = sega8_get_pcb_id(get_feature("slot") ? get_feature("slot") : "rom");
else
m_type = get_cart_type(ROM, len);
-
+
set_lphaser_xoffset(ROM, len);
setup_ram();
-
+
// Check for gamegear cartridges with PIN 42 set to SMS mode
if (software_entry() != NULL)
{
@@ -398,11 +398,11 @@ bool sega8_cart_slot_device::call_load()
// we attempt to load a battery because the game might have it!
if (m_cart->get_ram_size() && (m_cart->get_has_battery() || m_cart->get_late_battery()))
battery_load(m_cart->get_ram_base(), m_cart->get_ram_size(), 0x00);
-
+
//printf("Type: %s\n", sega8_get_slot(type));
-
+
internal_header_logging(ROM + offset, len, m_cart->get_ram_size());
-
+
return IMAGE_INIT_PASS;
}
@@ -452,19 +452,19 @@ bool sega8_cart_slot_device::call_softlist_load(char *swlist, char *swname, rom_
- gamegear Pete Sampras Tennis
- gamegear S.S. Lucifer
- 95 - gamegear Micro Machines 2 - Turbo Tournament
-
+
The Korean game Jang Pung II also seems to use a codemasters style mapper.
*/
int sms_state::detect_codemasters_mapper( UINT8 *rom )
{
static const UINT8 jang_pung2[16] = { 0x00, 0xba, 0x38, 0x0d, 0x00, 0xb8, 0x38, 0x0c, 0x00, 0xb6, 0x38, 0x0b, 0x00, 0xb4, 0x38, 0x0a };
-
+
if (((rom[0x7fe0] & 0x0f ) <= 9) && (rom[0x7fe3] == 0x93 || rom[0x7fe3] == 0x94 || rom[0x7fe3] == 0x95) && rom[0x7fef] == 0x00)
return 1;
-
+
if (!memcmp(&rom[0x7ff0], jang_pung2, 16))
return 1;
-
+
return 0;
}
@@ -477,7 +477,7 @@ int sms_state::detect_korean_mapper( UINT8 *rom )
{ 0x41, 0x48, 0x37, 0x37, 0x44, 0x37, 0x4e, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20 }, /* Sangokushi 3 */
};
int i;
-
+
for (i = 0; i < 2; i++)
{
if (!memcmp(&rom[0x7ff0], signatures[i], 16))
@@ -518,9 +518,9 @@ int sega8_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len)
{ i += 2; _6000++; continue; }
}
}
-
+
LOG(("Mapper test: _0002 = %d, _8000 = %d, _a000 = %d, _ffff = %d\n", _0002, _8000, _a000, _ffff));
-
+
// 2 is a security measure, although tests on existing ROM showed it was not needed
if (_0002 > _ffff + 2 || (_0002 > 0 && _ffff == 0))
{
@@ -545,13 +545,13 @@ int sega8_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len)
if (len >= 0x8000)
{
int x2000_3000 = 0, xd000_e000_f000 = 0, x2000_ff = 0;
-
+
for (int i = 0; i < 0x8000; i++)
{
if (ROM[i] == 0x32)
{
UINT16 addr = ROM[i + 1] | (ROM[i + 2] << 8);
-
+
switch (addr & 0xf000)
{
case 0x2000:
@@ -559,7 +559,7 @@ int sega8_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len)
i += 2;
x2000_3000++;
break;
-
+
case 0xd000:
case 0xe000:
case 0xf000:
@@ -582,7 +582,7 @@ int sega8_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len)
type = SEGA8_DAHJEE_TYPEA;
}
}
-
+
// Terebi Oekaki (TV Draw)
if (!strncmp((const char *)&ROM[0x13b3], "annakmn", 7))
type = SEGA8_TEREBIOEKAKI;
@@ -590,16 +590,16 @@ int sega8_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len)
// The Castle (ROM+RAM)
if (!strncmp((const char *)&ROM[0x1cc3], "ASCII 1986", 10))
type = SEGA8_CASTLE;
-
+
// BASIC Level 3
if (!strncmp((const char *)&ROM[0x6a20], "SC-3000 BASIC Level 3 ver 1.0", 29))
type = SEGA8_BASIC_L3;
-
+
// Music Editor
if (!strncmp((const char *)&ROM[0x0841], "PIANO", 5) || !strncmp((const char *)&ROM[0x0841], "music", 5))
type = SEGA8_MUSIC_EDITOR;
-
-
+
+
return type;
}
/*-------------------------------------------------
@@ -724,12 +724,12 @@ void sega8_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len, UIN
0x10000,
0x20000,
};
-
+
char reserved[10];
UINT8 version, csum_size, region, serial[3];
UINT16 checksum, csum = 0;
UINT32 csum_end = 0;
-
+
// LOG FILE DETAILS
logerror("FILE DETAILS\n" );
logerror("============\n" );
@@ -741,30 +741,30 @@ void sega8_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len, UIN
if (nvram_len)
logerror("RAM (Allocated) Size: 0x%X - Battery: %s\n", nvram_len, m_cart->get_has_battery() ? "Yes" : "No");
logerror("\n" );
-
-
+
+
// LOG HEADER DETAILS
if (len < 0x8000)
return;
for (int i = 0; i < 10; i++)
reserved[i] = ROM[0x7ff0 + i];
-
+
checksum = ROM[0x7ffa] | (ROM[0x7ffb] << 8);
-
+
for (int i = 0; i < 3; i++)
serial[i] = ROM[0x7ffc + i];
serial[2] &= 0x0f;
-
+
version = (ROM[0x7ffe] & 0xf0) >> 4;
-
+
csum_size = ROM[0x7fff] & 0x0f;
csum_end = csum_length[csum_size];
if (!csum_end || csum_end > len)
csum_end = len;
-
+
region = (ROM[0x7fff] & 0xf0) >> 4;
-
+
// compute cart checksum to compare with expected one
for (int i = 0; i < csum_end; i++)
{
@@ -772,9 +772,9 @@ void sega8_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len, UIN
{
csum += ROM[i];
csum &= 0xffff;
- }
+ }
}
-
+
logerror("INTERNAL HEADER\n" );
logerror("===============\n" );
logerror("Reserved String: %.10s\n", reserved);
@@ -785,12 +785,12 @@ void sega8_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len, UIN
logerror("Software Revision: %x\n", version);
logerror("\n" );
-
+
if (m_type == SEGA8_CODEMASTERS)
{
UINT8 day, month, year, hour, minute;
csum = 0;
-
+
day = ROM[0x7fe1];
month = ROM[0x7fe2];
year = ROM[0x7fe3];
@@ -808,7 +808,7 @@ void sega8_cart_slot_device::internal_header_logging(UINT8 *ROM, UINT32 len, UIN
csum &= 0xffff;
}
}
-
+
logerror("CODEMASTERS HEADER\n" );
logerror("==================\n" );
logerror("Build date & time: %x/%x/%x %.2x:%.2x\n", day, month, year, hour, minute);
diff --git a/src/mess/machine/sega8_slot.h b/src/mess/machine/sega8_slot.h
index 2a4fafb53f3..7e681ae294b 100644
--- a/src/mess/machine/sega8_slot.h
+++ b/src/mess/machine/sega8_slot.h
@@ -48,12 +48,12 @@ public:
// a few carts (for SG1000) acts as a RAM expansion, taking control of the system RAM in 0xc000-0xffff
virtual DECLARE_READ8_MEMBER(read_ram) { return 0xff; }
virtual DECLARE_WRITE8_MEMBER(write_ram) {}
-
+
void rom_alloc(running_machine &machine, UINT32 size);
void ram_alloc(running_machine &machine, UINT32 size);
-
+
virtual void late_bank_setup() {}
-
+
void set_has_battery(bool val) { has_battery = val; }
bool get_has_battery() { return has_battery; }
void set_late_battery(bool val) { m_late_battery_enable = val; }
@@ -62,7 +62,7 @@ public:
int get_lphaser_xoffs() { return m_lphaser_xoffs; }
void set_sms_mode(int val) { m_sms_mode = val; }
int get_sms_mode() { return m_sms_mode; }
-
+
//protected:
UINT8* get_rom_base() { return m_rom; }
UINT8* get_ram_base() { return m_ram; }
@@ -81,10 +81,10 @@ public:
int m_rom_page_count;
bool has_battery;
-
- // we use this variable for fullpath loading only: in this case, RAM is always allocated,
+
+ // we use this variable for fullpath loading only: in this case, RAM is always allocated,
// but we set has_battery only if RAM is actually enabled during game...
- bool m_late_battery_enable;
+ bool m_late_battery_enable;
int m_lphaser_xoffs;
int m_sms_mode;
@@ -218,14 +218,12 @@ public:
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
static_cast<sega8_card_slot_device *>(device)->set_mandatory(FALSE); \
static_cast<sega8_card_slot_device *>(device)->set_intf("sms_card"); \
- static_cast<sega8_card_slot_device *>(device)->set_ext("bin"); \
-
+ static_cast<sega8_card_slot_device *>(device)->set_ext("bin");
#define MCFG_SG1000_CARD_ADD(_tag,_slot_intf,_def_slot) \
MCFG_DEVICE_ADD(_tag, SEGA8_CARD_SLOT, 0) \
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \
static_cast<sega8_card_slot_device *>(device)->set_intf("sg1000_cart"); \
- static_cast<sega8_card_slot_device *>(device)->set_ext("bin,sg"); \
-
+ static_cast<sega8_card_slot_device *>(device)->set_ext("bin,sg");
#endif
diff --git a/src/mess/machine/sms.c b/src/mess/machine/sms.c
index 3f62b69aa09..c75f71794d3 100644
--- a/src/mess/machine/sms.c
+++ b/src/mess/machine/sms.c
@@ -694,7 +694,7 @@ WRITE8_MEMBER(sms_state::sms_mapper_w)
{
bool bios_selected = false;
bool cartridge_selected = false;
-
+
m_mapper[offset] = data;
m_mainram[0x1ffc + offset] = data;
@@ -703,19 +703,19 @@ WRITE8_MEMBER(sms_state::sms_mapper_w)
if (!(m_bios_port & IO_CARTRIDGE) || (m_is_gamegear && m_BIOS == NULL))
cartridge_selected = true;
else
- return; // nothing to page in
+ return; // nothing to page in
}
else
{
if (!m_BIOS)
- return; // nothing to page in
+ return; // nothing to page in
bios_selected = true;
}
-
+
switch (offset)
{
case 0: // Control RAM/ROM
- if (!(data & 0x08) && !(m_bios_port & IO_BIOS_ROM) && bios_selected) // BIOS ROM
+ if (!(data & 0x08) && !(m_bios_port & IO_BIOS_ROM) && bios_selected) // BIOS ROM
{
if (!m_has_bios_0400 && !m_has_bios_2000)
{
@@ -723,13 +723,13 @@ WRITE8_MEMBER(sms_state::sms_mapper_w)
m_bios_page[2] = m_mapper[3];
}
}
- else if (cartridge_selected) // CART ROM/RAM
+ else if (cartridge_selected) // CART ROM/RAM
{
m_bank_enabled[2] = ENABLE_CART;
m_cartslot->write_mapper(space, offset, data);
}
break;
-
+
case 1: // Select 16k ROM bank for 0400-3fff
case 2: // Select 16k ROM bank for 4000-7fff
case 3: // Select 16k ROM bank for 8000-bfff
@@ -761,9 +761,9 @@ READ8_MEMBER(sms_state::read_0000)
return m_BIOS[(m_bios_page[3] * 0x4000) + (offset & 0x3fff)];
}
if (m_bank_enabled[3] == ENABLE_CART)
- return m_cartslot->read_cart(space, offset);
+ return m_cartslot->read_cart(space, offset);
if (m_card && m_bank_enabled[3] == ENABLE_CARD)
- return m_card->read_cart(space, offset);
+ return m_card->read_cart(space, offset);
}
else
{
@@ -773,10 +773,10 @@ READ8_MEMBER(sms_state::read_0000)
return m_BIOS[(m_bios_page[0] * 0x4000) + (offset & 0x3fff)];
}
if (m_bank_enabled[0] == ENABLE_CART)
- return m_cartslot->read_cart(space, offset);
+ return m_cartslot->read_cart(space, offset);
if (m_card && m_bank_enabled[0] == ENABLE_CARD)
- return m_card->read_cart(space, offset);
- }
+ return m_card->read_cart(space, offset);
+ }
return m_region_maincpu->base()[offset];
}
@@ -789,9 +789,9 @@ READ8_MEMBER(sms_state::read_4000)
}
if (m_bank_enabled[1] == ENABLE_CART)
- return m_cartslot->read_cart(space, offset + 0x4000);
+ return m_cartslot->read_cart(space, offset + 0x4000);
if (m_card && m_bank_enabled[1] == ENABLE_CARD)
- return m_card->read_cart(space, offset + 0x4000);
+ return m_card->read_cart(space, offset + 0x4000);
return m_region_maincpu->base()[offset];
}
@@ -805,9 +805,9 @@ READ8_MEMBER(sms_state::read_8000)
}
if (m_bank_enabled[2] == ENABLE_CART)
- return m_cartslot->read_cart(space, offset + 0x8000);
+ return m_cartslot->read_cart(space, offset + 0x8000);
if (m_card && m_bank_enabled[2] == ENABLE_CARD)
- return m_card->read_cart(space, offset + 0x8000);
+ return m_card->read_cart(space, offset + 0x8000);
return m_region_maincpu->base()[offset];
}
@@ -827,9 +827,9 @@ READ8_MEMBER(smssdisp_state::store_read_0000)
return m_BIOS[(m_bios_page[3] * 0x4000) + (offset & 0x3fff)];
}
if (m_bank_enabled[3] == ENABLE_CART)
- return m_slots[m_current_cartridge]->read_cart(space, offset);
+ return m_slots[m_current_cartridge]->read_cart(space, offset);
if (m_bank_enabled[3] == ENABLE_CARD)
- return m_cards[m_current_cartridge]->read_cart(space, offset);
+ return m_cards[m_current_cartridge]->read_cart(space, offset);
}
else
{
@@ -839,10 +839,10 @@ READ8_MEMBER(smssdisp_state::store_read_0000)
return m_BIOS[(m_bios_page[0] * 0x4000) + (offset & 0x3fff)];
}
if (m_bank_enabled[0] == ENABLE_CART)
- return m_slots[m_current_cartridge]->read_cart(space, offset);
+ return m_slots[m_current_cartridge]->read_cart(space, offset);
if (m_bank_enabled[0] == ENABLE_CARD)
- return m_cards[m_current_cartridge]->read_cart(space, offset);
- }
+ return m_cards[m_current_cartridge]->read_cart(space, offset);
+ }
return m_region_maincpu->base()[offset];
}
@@ -855,10 +855,10 @@ READ8_MEMBER(smssdisp_state::store_read_4000)
return m_BIOS[(m_bios_page[1] * 0x4000) + (offset & 0x3fff)];
}
if (m_bank_enabled[1] == ENABLE_CART)
- return m_slots[m_current_cartridge]->read_cart(space, offset + 0x4000);
+ return m_slots[m_current_cartridge]->read_cart(space, offset + 0x4000);
if (m_bank_enabled[1] == ENABLE_CARD)
- return m_cards[m_current_cartridge]->read_cart(space, offset + 0x4000);
-
+ return m_cards[m_current_cartridge]->read_cart(space, offset + 0x4000);
+
return m_region_maincpu->base()[offset];
}
@@ -868,12 +868,12 @@ READ8_MEMBER(smssdisp_state::store_read_8000)
{
if (m_BIOS)
return m_BIOS[(m_bios_page[2] * 0x4000) + (offset & 0x3fff)];
- }
+ }
if (m_bank_enabled[2] == ENABLE_CART)
- return m_slots[m_current_cartridge]->read_cart(space, offset + 0x8000);
+ return m_slots[m_current_cartridge]->read_cart(space, offset + 0x8000);
if (m_bank_enabled[2] == ENABLE_CARD)
- return m_cards[m_current_cartridge]->read_cart(space, offset + 0x8000);
-
+ return m_cards[m_current_cartridge]->read_cart(space, offset + 0x8000);
+
return m_region_maincpu->base()[offset];
}
@@ -882,18 +882,18 @@ WRITE8_MEMBER(smssdisp_state::store_write_cart)
// this might only work because we are not emulating properly the cart/card selection system
// it will have to be reviewed when proper emulation is worked on!
if (m_bank_enabled[0] == ENABLE_CART)
- m_slots[m_current_cartridge]->write_cart(space, offset, data);
+ m_slots[m_current_cartridge]->write_cart(space, offset, data);
if (m_bank_enabled[0] == ENABLE_CARD)
- m_cards[m_current_cartridge]->write_cart(space, offset, data);
+ m_cards[m_current_cartridge]->write_cart(space, offset, data);
}
READ8_MEMBER(smssdisp_state::store_cart_peek)
{
if (m_bank_enabled[1] == ENABLE_CART)
- return m_slots[m_current_cartridge]->read_cart(space, 0x4000 + (offset & 0x1fff));
+ return m_slots[m_current_cartridge]->read_cart(space, 0x4000 + (offset & 0x1fff));
if (m_bank_enabled[1] == ENABLE_CARD)
- return m_cards[m_current_cartridge]->read_cart(space, 0x4000 + (offset & 0x1fff));
-
+ return m_cards[m_current_cartridge]->read_cart(space, 0x4000 + (offset & 0x1fff));
+
return m_region_maincpu->base()[offset];
}
@@ -1055,7 +1055,7 @@ void sms_state::setup_bios()
MACHINE_START_MEMBER(sms_state,sms)
{
char str[7];
-
+
m_rapid_fire_timer = timer_alloc(TIMER_RAPID_FIRE);
m_rapid_fire_timer->adjust(attotime::from_hz(10), 0, attotime::from_hz(10));
@@ -1132,7 +1132,7 @@ MACHINE_START_MEMBER(sms_state,sms)
// a bunch of SG1000 carts (compatible with SG1000 Mark III) can access directly system RAM... let's install here the necessary handlers
// TODO: are BASIC and Music actually compatible with Mark III??
- if (m_cartslot->get_type() == SEGA8_BASIC_L3 || m_cartslot->get_type() == SEGA8_MUSIC_EDITOR
+ if (m_cartslot->get_type() == SEGA8_BASIC_L3 || m_cartslot->get_type() == SEGA8_MUSIC_EDITOR
|| m_cartslot->get_type() == SEGA8_DAHJEE_TYPEA || m_cartslot->get_type() == SEGA8_DAHJEE_TYPEB)
{
m_maincpu->space(AS_PROGRAM).install_read_handler(0xc000, 0xffff, 0, 0, read8_delegate(FUNC(sega8_cart_slot_device::read_ram),(sega8_cart_slot_device*)m_cartslot));
@@ -1206,8 +1206,8 @@ WRITE8_MEMBER(smssdisp_state::sms_store_cart_select_w)
logerror("switching in part of %s slot #%d\n", slottype ? "card" : "cartridge", slot );
/* cartridge? slot #0 */
-// if (slottype == 0)
-// m_current_cartridge = slot;
+// if (slottype == 0)
+// m_current_cartridge = slot;
setup_rom();
}
diff --git a/src/mess/machine/sns_sa1.c b/src/mess/machine/sns_sa1.c
index 147f088277b..bdfac6cf11f 100644
--- a/src/mess/machine/sns_sa1.c
+++ b/src/mess/machine/sns_sa1.c
@@ -53,7 +53,6 @@ sns_sa1_device::sns_sa1_device(const machine_config &mconfig, const char *tag, d
void sns_sa1_device::device_start()
{
-
}
void sns_sa1_device::device_reset()
@@ -78,7 +77,7 @@ void sns_sa1_device::device_reset()
m_bwram_sa1 = 0;
m_bwram_sa1_source = 0;
m_bwram_sa1_format = 0;
- m_bwram_write_snes = 1;
+ m_bwram_write_snes = 1;
m_bwram_write_sa1 = 1;
m_bwpa_sa1 = 0x0f;
m_iram_write_snes = 1;
@@ -220,15 +219,15 @@ UINT8 sns_sa1_device::read_regs(address_space &space, UINT32 offset)
UINT32 data = (var_length_read(space, m_vda + 0) << 0) | (var_length_read(space, m_vda + 1) << 8)
| (var_length_read(space, m_vda + 2) << 16);
data >>= m_vbit;
-
- if (m_drm == 1)
+
+ if (m_drm == 1)
{
//auto-increment mode
m_vbit += m_vlen;
m_vda += (m_vbit >> 3);
m_vbit &= 7;
}
-
+
value = (data >> 8) & 0xff;
}
break;
@@ -255,7 +254,7 @@ void sns_sa1_device::write_regs(UINT32 offset, UINT8 data)
// reset sa-1?
}
m_sa1_ctrl = data;
-
+
if (BIT(m_sa1_ctrl, 7))
{
// IRQ
diff --git a/src/mess/machine/sns_sdd1.c b/src/mess/machine/sns_sdd1.c
index 85d336d4d5a..8291e00574e 100644
--- a/src/mess/machine/sns_sdd1.c
+++ b/src/mess/machine/sns_sdd1.c
@@ -435,7 +435,7 @@ void sns_rom_sdd1_device::device_start()
save_item(NAME(m_sdd1_enable));
save_item(NAME(m_xfer_enable));
save_item(NAME(m_mmc));
-
+
for (int i = 0; i < 8; i++)
{
save_item(NAME(m_dma[i].addr), i);
diff --git a/src/mess/machine/sns_sgb.c b/src/mess/machine/sns_sgb.c
index eba0b14b57e..cdab2bdd3a4 100644
--- a/src/mess/machine/sns_sgb.c
+++ b/src/mess/machine/sns_sgb.c
@@ -1,12 +1,12 @@
/***********************************************************************************************************
-
+
Super Game Boy emulation (for SNES/SFC)
-
+
Copyright MESS Team.
Visit http://mamedev.org for licensing and usage restrictions.
TODO: almost everything
-
+
***********************************************************************************************************/
@@ -123,60 +123,60 @@ READ8_MEMBER( sns_rom_sgb_device::chip_read )
UINT16 address = offset & 0xffff;
//LY counter
- if (address == 0x6000)
+ if (address == 0x6000)
{
m_sgb_ly = 0;// GameBoy PPU LY here
m_sgb_row = m_lcd_row;
return m_sgb_ly;
}
-
+
//command ready port
- if (address == 0x6002)
+ if (address == 0x6002)
{
bool data = (m_packetsize > 0);
- if (data)
+ if (data)
{
- for (int i = 0; i < 16; i++)
+ for (int i = 0; i < 16; i++)
m_joy_pckt[i] = m_packet_data[0][i];
- m_packetsize--;
+ m_packetsize--;
//hack because we still don't emulate input packets!
if (!m_packetsize) m_packetsize = 64;
// shift packet
- for (int i = 0; i < m_packetsize; i++)
+ for (int i = 0; i < m_packetsize; i++)
for (int j = 0; j < 16; j++)
m_packet_data[i][j] = m_packet_data[i + 1][j];
}
return data;
}
-
+
//ICD2 revision
- if (address == 0x600f)
+ if (address == 0x600f)
return 0x21;
-
+
//command port
- if ((address & 0xfff0) == 0x7000)
+ if ((address & 0xfff0) == 0x7000)
return m_joy_pckt[address & 0x0f];
-
+
//VRAM port
- if (address == 0x7800)
+ if (address == 0x7800)
{
UINT8 data = m_lcd_output[m_vram_offs];
m_vram_offs = (m_vram_offs + 1) % 320;
return data;
}
- return 0x00; // this should never happen?
+ return 0x00; // this should never happen?
}
-void sns_rom_sgb_device::lcd_render(UINT32 *source)
+void sns_rom_sgb_device::lcd_render(UINT32 *source)
{
memset(m_lcd_output, 0x00, 320 * sizeof(UINT16));
-
+
for (int y = 0; y < 8; y++)
{
- for (int x = 0; x < 160; x++)
+ for (int x = 0; x < 160; x++)
{
UINT32 pixel = *source++;
UINT16 addr = y * 2 + (x / 8 * 16);
@@ -189,59 +189,58 @@ void sns_rom_sgb_device::lcd_render(UINT32 *source)
WRITE8_MEMBER( sns_rom_sgb_device::chip_write )
{
UINT16 address = offset & 0xffff;
-
+
//VRAM port
- if (address == 0x6001)
+ if (address == 0x6001)
{
m_vram = data;
m_vram_offs = 0;
-
+
UINT8 offset = (m_sgb_row - (4 - (m_vram - (m_sgb_ly & 3)))) & 3;
lcd_render(m_lcd_buffer + offset * 160 * 8);
-
+
return;
}
-
+
//control port
- if (address == 0x6003)
+ if (address == 0x6003)
{
- if ((m_port & 0x80) == 0x00 && (data & 0x80) == 0x80)
+ if ((m_port & 0x80) == 0x00 && (data & 0x80) == 0x80)
{
//reset
}
- switch (data & 3)
+ switch (data & 3)
{
//change CPU frequency
}
m_port = data;
return;
}
-
- if (address == 0x6004)
+
+ if (address == 0x6004)
{
//joypad 1
- m_joy1 = data;
- return;
+ m_joy1 = data;
+ return;
}
- if (address == 0x6005)
+ if (address == 0x6005)
{
//joypad 2
- m_joy2 = data;
- return;
+ m_joy2 = data;
+ return;
}
- if (address == 0x6006)
+ if (address == 0x6006)
{
//joypad 3
- m_joy3 = data;
- return;
+ m_joy3 = data;
+ return;
}
- if (address == 0x6007)
+ if (address == 0x6007)
{
//joypad 4
- m_joy4 = data;
- return;
+ m_joy4 = data;
+ return;
}
-
-}
+}
diff --git a/src/mess/machine/sns_sgb.h b/src/mess/machine/sns_sgb.h
index 4c6ebf15af5..492a35f3315 100644
--- a/src/mess/machine/sns_sgb.h
+++ b/src/mess/machine/sns_sgb.h
@@ -14,7 +14,7 @@ class sns_rom_sgb_device : public sns_rom_device
public:
// construction/destruction
sns_rom_sgb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
-
+
// device-level overrides
virtual void device_start();
virtual void device_reset();
@@ -25,7 +25,7 @@ public:
virtual DECLARE_READ8_MEMBER(read_h);
virtual DECLARE_READ8_MEMBER(chip_read);
virtual DECLARE_WRITE8_MEMBER(chip_write);
-
+
virtual DECLARE_READ8_MEMBER(gb_cart_r);
virtual DECLARE_WRITE8_MEMBER(gb_bank_w);
virtual DECLARE_READ8_MEMBER(gb_ram_r);
diff --git a/src/mess/machine/sns_spc7110.c b/src/mess/machine/sns_spc7110.c
index 8bf8536284b..2eb768af13f 100644
--- a/src/mess/machine/sns_spc7110.c
+++ b/src/mess/machine/sns_spc7110.c
@@ -318,7 +318,7 @@ SPC7110_Decomp::SPC7110_Decomp(running_machine &machine)
+ map(3, 24) + map(2, 16) + map(1, 8) + map(0, 0);
#undef map
}
-
+
state_save_register_item(machine, "SNES_SPC7110", NULL, 0, m_decomp_mode);
state_save_register_item(machine, "SNES_SPC7110", NULL, 0, m_decomp_offset);
state_save_register_item_pointer(machine, "SNES_SPC7110", NULL, 0, m_decomp_buffer, SPC7110_DECOMP_BUFFER_SIZE);
@@ -331,7 +331,7 @@ SPC7110_Decomp::SPC7110_Decomp(running_machine &machine)
state_save_register_item(machine, "SNES_SPC7110", NULL, i, m_context[i].index);
state_save_register_item(machine, "SNES_SPC7110", NULL, i, m_context[i].invert);
}
-
+
state_save_register_item(machine, "SNES_SPC7110", NULL, 0, m_m0_val);
state_save_register_item(machine, "SNES_SPC7110", NULL, 0, m_m0_in);
state_save_register_item(machine, "SNES_SPC7110", NULL, 0, m_m0_span);
@@ -349,7 +349,7 @@ SPC7110_Decomp::SPC7110_Decomp(running_machine &machine)
state_save_register_item(machine, "SNES_SPC7110", NULL, 0, m_m1_inverts);
state_save_register_item(machine, "SNES_SPC7110", NULL, 0, m_m1_lps);
state_save_register_item(machine, "SNES_SPC7110", NULL, 0, m_m1_in_count);
-
+
state_save_register_item(machine, "SNES_SPC7110", NULL, 0, m_m2_pixelorder);
state_save_register_item(machine, "SNES_SPC7110", NULL, 0, m_m2_realorder);
state_save_register_item(machine, "SNES_SPC7110", NULL, 0, m_m2_bitplanebuffer);
@@ -455,7 +455,7 @@ UINT8 SPC7110_Decomp::dataread(UINT8 *ROM, UINT32 len)
}
void SPC7110_Decomp::mode0(UINT8 init, UINT8 *ROM, UINT32 len)
-{
+{
if (init == 1)
{
m_m0_out = m_m0_inverts = m_m0_lps = 0;
diff --git a/src/mess/machine/sns_spc7110.h b/src/mess/machine/sns_spc7110.h
index 24871f3040f..0a607d2d001 100644
--- a/src/mess/machine/sns_spc7110.h
+++ b/src/mess/machine/sns_spc7110.h
@@ -36,7 +36,7 @@ public:
void mode2(UINT8 init, UINT8 *ROM, UINT32 len);
private:
-
+
UINT8 dataread(UINT8 *ROM, UINT32 len);
UINT8 probability(UINT32 n);
UINT8 next_lps(UINT32 n);
@@ -44,21 +44,21 @@ private:
UINT8 toggle_invert(UINT32 n);
UINT32 morton_2x8(UINT32 data);
UINT32 morton_4x8(UINT32 data);
-
+
UINT32 m_decomp_mode;
UINT32 m_decomp_offset;
-
+
UINT8 *m_decomp_buffer;
UINT32 m_decomp_buffer_rdoffset;
UINT32 m_decomp_buffer_wroffset;
UINT32 m_decomp_buffer_length;
-
+
struct ContextState
{
UINT8 index;
UINT8 invert;
} m_context[32];
-
+
UINT32 m_morton16[2][256];
UINT32 m_morton32[4][256];
diff --git a/src/mess/machine/softbox.h b/src/mess/machine/softbox.h
index 68100948ad8..f11d5737cb6 100644
--- a/src/mess/machine/softbox.h
+++ b/src/mess/machine/softbox.h
@@ -74,4 +74,4 @@ extern const device_type SOFTBOX;
-#endif \ No newline at end of file
+#endif
diff --git a/src/mess/machine/upd71071.c b/src/mess/machine/upd71071.c
index b3ebe814bd8..58fa6a44e90 100644
--- a/src/mess/machine/upd71071.c
+++ b/src/mess/machine/upd71071.c
@@ -100,7 +100,7 @@ void upd71071_device::device_config_complete()
const upd71071_intf *intf = reinterpret_cast<const upd71071_intf *>(static_config());
if (intf != NULL)
*static_cast<upd71071_intf *>(this) = *intf;
-
+
// or initialize to defaults if none provided
else
{
diff --git a/src/mess/machine/victor9kb.h b/src/mess/machine/victor9kb.h
index f067320a7ca..cd4321b688c 100644
--- a/src/mess/machine/victor9kb.h
+++ b/src/mess/machine/victor9kb.h
@@ -32,8 +32,7 @@
#define MCFG_VICTOR9K_KEYBOARD_ADD(_kbrdy) \
MCFG_DEVICE_ADD(VICTOR9K_KEYBOARD_TAG, VICTOR9K_KEYBOARD, 0) \
- downcast<victor9k_keyboard_device *>(device)->set_kbrdy_callback(DEVCB2_##_kbrdy); \
-
+ downcast<victor9k_keyboard_device *>(device)->set_kbrdy_callback(DEVCB2_##_kbrdy);
//**************************************************************************
diff --git a/src/mess/machine/vp575.c b/src/mess/machine/vp575.c
index e31c7a10923..17f9c8c1aff 100644
--- a/src/mess/machine/vp575.c
+++ b/src/mess/machine/vp575.c
@@ -65,15 +65,15 @@ WRITE_LINE_MEMBER( vp575_device::exp5_dma_in_w ) { m_dma_in[4] = state; update_i
static MACHINE_CONFIG_FRAGMENT( vp575 )
MCFG_VIP_EXPANSION_SLOT_ADD("exp1", XTAL_3_52128MHz/2, vip_expansion_cards, NULL)
- MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp1_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp1_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp1_dma_in_w))
+ MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp1_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp1_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp1_dma_in_w))
MCFG_VIP_EXPANSION_SLOT_ADD("exp2", XTAL_3_52128MHz/2, vip_expansion_cards, NULL)
- MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp2_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp2_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp2_dma_in_w))
+ MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp2_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp2_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp2_dma_in_w))
MCFG_VIP_EXPANSION_SLOT_ADD("exp3", XTAL_3_52128MHz/2, vip_expansion_cards, NULL)
- MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp3_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp3_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp3_dma_in_w))
+ MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp3_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp3_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp3_dma_in_w))
MCFG_VIP_EXPANSION_SLOT_ADD("exp4", XTAL_3_52128MHz/2, vip_expansion_cards, NULL)
- MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp4_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp4_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp4_dma_in_w))
+ MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp4_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp4_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp4_dma_in_w))
MCFG_VIP_EXPANSION_SLOT_ADD("exp5", XTAL_3_52128MHz/2, vip_expansion_cards, NULL)
- MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp5_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp5_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp5_dma_in_w))
+ MCFG_VIP_EXPANSION_SLOT_CALLBACKS(DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp5_int_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp5_dma_out_w), DEVWRITELINE(DEVICE_SELF_OWNER, vp575_device, exp5_dma_in_w))
MACHINE_CONFIG_END
diff --git a/src/mess/machine/wangpc_mcc.c b/src/mess/machine/wangpc_mcc.c
index aa83bb1fdd7..0049608899e 100644
--- a/src/mess/machine/wangpc_mcc.c
+++ b/src/mess/machine/wangpc_mcc.c
@@ -272,7 +272,7 @@ void wangpc_mcc_device::wangpcbus_aiowc_w(address_space &space, offs_t offset, U
case 0x06/2:
m_sio->cd_ba_w(space, offset >> 1, data & 0xff);
break;
-
+
case 0x08/2:
case 0x0a/2:
case 0x0c/2:
diff --git a/src/mess/machine/zx8302.h b/src/mess/machine/zx8302.h
index edabc673d00..47b46d12ecb 100644
--- a/src/mess/machine/zx8302.h
+++ b/src/mess/machine/zx8302.h
@@ -172,7 +172,7 @@ private:
enum
{
- INT_GAP = 0x01,
+ INT_GAP = 0x01,
INT_INTERFACE = 0x02,
INT_TRANSMIT = 0x04,
INT_FRAME = 0x08,
@@ -181,7 +181,7 @@ private:
enum
{
- STATUS_NETWORK_PORT = 0x01,
+ STATUS_NETWORK_PORT = 0x01,
STATUS_TX_BUFFER_FULL = 0x02,
STATUS_RX_BUFFER_FULL = 0x04,
STATUS_MICRODRIVE_GAP = 0x08,