summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--.gitattributes1
-rw-r--r--src/build/file2str.c1
-rw-r--r--src/emu/cpu/drcbec.c1
-rw-r--r--src/emu/cpu/drcbex86.c1
-rw-r--r--src/emu/cpu/g65816/g65816op.h1
-rw-r--r--src/emu/cpu/i860/i860.c4
-rw-r--r--src/emu/cpu/i860/i860.h2
-rw-r--r--src/emu/cpu/i860/i860dec.c3
-rw-r--r--src/emu/cpu/m37710/m37710.c1
-rw-r--r--src/emu/cpu/m37710/m37710op.h3
-rw-r--r--src/emu/driver.h3
-rw-r--r--src/emu/machine/eepromdev.c4
-rw-r--r--src/emu/machine/i2cmemdev.c4
-rw-r--r--src/emu/sound.c2
-rw-r--r--src/emu/sound/psx.c4
-rw-r--r--src/emu/sound/qsound.c2
-rw-r--r--src/emu/timer.c10
-rw-r--r--src/emu/ui.c4
-rw-r--r--src/emu/uimenu.c10
-rw-r--r--src/mame/audio/cliffhgr.c2
-rw-r--r--src/mame/audio/dkong.c8
-rw-r--r--src/mame/audio/exidy440.c6
-rw-r--r--src/mame/audio/jedi.c16
-rw-r--r--src/mame/audio/leland.c2
-rw-r--r--src/mame/audio/mario.c14
-rw-r--r--src/mame/audio/mcr.c5
-rw-r--r--src/mame/audio/redalert.c2
-rw-r--r--src/mame/audio/seibu.c8
-rw-r--r--src/mame/audio/tiamc1.c8
-rw-r--r--src/mame/audio/turbo.c16
-rw-r--r--src/mame/drivers/20pacgal.c4
-rw-r--r--src/mame/drivers/arcadia.c4
-rw-r--r--src/mame/drivers/atarig42.c2
-rw-r--r--src/mame/drivers/atarisy2.c2
-rw-r--r--src/mame/drivers/bfm_sc1.c2
-rw-r--r--src/mame/drivers/cidelsa.c24
-rw-r--r--src/mame/drivers/cps1.c2
-rw-r--r--src/mame/drivers/cps3.c60
-rw-r--r--src/mame/drivers/deco32.c2
-rw-r--r--src/mame/drivers/dkong.c30
-rw-r--r--src/mame/drivers/galaxian.c2
-rw-r--r--src/mame/drivers/gameplan.c12
-rw-r--r--src/mame/drivers/goldstar.c2
-rw-r--r--src/mame/drivers/gottlieb.c2
-rw-r--r--src/mame/drivers/grchamp.c24
-rw-r--r--src/mame/drivers/itech8.c2
-rw-r--r--src/mame/drivers/jchan.c2
-rw-r--r--src/mame/drivers/jedi.c14
-rw-r--r--src/mame/drivers/looping.c20
-rw-r--r--src/mame/drivers/lordgun.c25
-rw-r--r--src/mame/drivers/m10.c12
-rw-r--r--src/mame/drivers/m72.c2
-rw-r--r--src/mame/drivers/maygayv1.c2
-rw-r--r--src/mame/drivers/midzeus.c4
-rw-r--r--src/mame/drivers/mjkjidai.c2
-rw-r--r--src/mame/drivers/mystston.c2
-rw-r--r--src/mame/drivers/namcoic.c4
-rw-r--r--src/mame/drivers/naomi.c2
-rw-r--r--src/mame/drivers/peplus.c2
-rw-r--r--src/mame/drivers/pntnpuzl.c2
-rw-r--r--src/mame/drivers/psikyo.c2
-rw-r--r--src/mame/drivers/psikyo4.c2
-rw-r--r--src/mame/drivers/psikyosh.c2
-rw-r--r--src/mame/drivers/qdrmfgp.c2
-rw-r--r--src/mame/drivers/qix.c14
-rw-r--r--src/mame/drivers/quizpun2.c3
-rw-r--r--src/mame/drivers/renegade.c2
-rw-r--r--src/mame/drivers/segae.c10
-rw-r--r--src/mame/drivers/segaorun.c22
-rw-r--r--src/mame/drivers/segas16b.c90
-rw-r--r--src/mame/drivers/segas18.c54
-rw-r--r--src/mame/drivers/seibuspi.c2
-rw-r--r--src/mame/drivers/seta2.c2
-rw-r--r--src/mame/drivers/ssv.c2
-rw-r--r--src/mame/drivers/stactics.c10
-rw-r--r--src/mame/drivers/suprnova.c2
-rw-r--r--src/mame/drivers/trvquest.c2
-rw-r--r--src/mame/drivers/turbo.c44
-rw-r--r--src/mame/drivers/ultratnk.c2
-rw-r--r--src/mame/drivers/ultrsprt.c2
-rw-r--r--src/mame/drivers/vcombat.c14
-rw-r--r--src/mame/drivers/vegas.c2
-rw-r--r--src/mame/drivers/vicdual.c40
-rw-r--r--src/mame/drivers/wwfwfest.c4
-rw-r--r--src/mame/includes/lordgun.h34
-rw-r--r--src/mame/machine/arkanoid.c2
-rw-r--r--src/mame/machine/atari.c42
-rw-r--r--src/mame/machine/atarigen.c10
-rw-r--r--src/mame/machine/bublbobl.c4
-rw-r--r--src/mame/machine/cps2crpt.c2
-rw-r--r--src/mame/machine/dc.c2
-rw-r--r--src/mame/machine/deco102.c6
-rw-r--r--src/mame/machine/decocass.c4
-rw-r--r--src/mame/machine/fd1089.c22
-rw-r--r--src/mame/machine/harddriv.c6
-rw-r--r--src/mame/machine/konamigx.c4
-rw-r--r--src/mame/machine/mhavoc.c2
-rw-r--r--src/mame/machine/namco50.c2
-rw-r--r--src/mame/machine/namcos1.c20
-rw-r--r--src/mame/machine/naomibd.c6
-rw-r--r--src/mame/machine/neocrypt.c8
-rw-r--r--src/mame/machine/qix.c26
-rw-r--r--src/mame/machine/scramble.c6
-rw-r--r--src/mame/machine/segacrpt.c24
-rw-r--r--src/mame/machine/segaic16.c4
-rw-r--r--src/mame/machine/snesdsp1.c344
-rw-r--r--src/mame/machine/ticket.c2
-rw-r--r--src/mame/machine/tx1.c2
-rw-r--r--src/mame/machine/williams.c2
-rw-r--r--src/mame/video/20pacgal.c2
-rw-r--r--src/mame/video/atarimo.c2
-rw-r--r--src/mame/video/bwing.c1
-rw-r--r--src/mame/video/cave.c4
-rw-r--r--src/mame/video/cidelsa.c28
-rw-r--r--src/mame/video/dkong.c52
-rw-r--r--src/mame/video/flstory.c2
-rw-r--r--src/mame/video/gaelco3d.c14
-rw-r--r--src/mame/video/galastrm.c6
-rw-r--r--src/mame/video/gameplan.c18
-rw-r--r--src/mame/video/grchamp.c20
-rw-r--r--src/mame/video/gticlub.c18
-rw-r--r--src/mame/video/jaguar.c3
-rw-r--r--src/mame/video/jedi.c8
-rw-r--r--src/mame/video/konamiic.c22
-rw-r--r--src/mame/video/lordgun.c7
-rw-r--r--src/mame/video/m10.c14
-rw-r--r--src/mame/video/m107.c2
-rw-r--r--src/mame/video/m3raster.c20
-rw-r--r--src/mame/video/m92.c2
-rw-r--r--src/mame/video/mario.c18
-rw-r--r--src/mame/video/midvunit.c10
-rw-r--r--src/mame/video/midzeus.c20
-rw-r--r--src/mame/video/midzeus2.c6
-rw-r--r--src/mame/video/model2.c8
-rw-r--r--src/mame/video/model2rd.c8
-rw-r--r--src/mame/video/model3.c2
-rw-r--r--src/mame/video/mrdo.c8
-rw-r--r--src/mame/video/mystston.c14
-rw-r--r--src/mame/video/namcos21.c8
-rw-r--r--src/mame/video/namcos22.c16
-rw-r--r--src/mame/video/ppu2c0x.c6
-rw-r--r--src/mame/video/qix.c26
-rw-r--r--src/mame/video/segaic16.c26
-rw-r--r--src/mame/video/segaic24.c6
-rw-r--r--src/mame/video/segas32.c4
-rw-r--r--src/mame/video/stactics.c18
-rw-r--r--src/mame/video/starshp1.c2
-rw-r--r--src/mame/video/system1.c2
-rw-r--r--src/mame/video/taitojc.c12
-rw-r--r--src/mame/video/tceptor.c2
-rw-r--r--src/mame/video/tecmo16.c6
-rw-r--r--src/mame/video/turbo.c16
-rw-r--r--src/osd/windows/ledutil.c4
-rw-r--r--src/osd/windows/winalloc.c4
-rw-r--r--src/osd/windows/windows.mak4
-rw-r--r--src/osd/windows/winprefix.h8
-rw-r--r--src/tools/chdman.c22
-rw-r--r--src/tools/jedutil.c6
-rw-r--r--src/tools/ldresample.c4
-rw-r--r--src/tools/ldverify.c20
-rw-r--r--src/tools/regrep.c26
-rw-r--r--src/tools/romcmp.c4
-rw-r--r--src/tools/src2html.c20
-rw-r--r--src/version.c1
164 files changed, 979 insertions, 969 deletions
diff --git a/.gitattributes b/.gitattributes
index 588fb66afa6..94180b16a99 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -2390,6 +2390,7 @@ src/mame/includes/lethalj.h svneol=native#text/plain
src/mame/includes/liberatr.h svneol=native#text/plain
src/mame/includes/lkage.h svneol=native#text/plain
src/mame/includes/lockon.h svneol=native#text/plain
+src/mame/includes/lordgun.h svneol=native#text/plain
src/mame/includes/lsasquad.h svneol=native#text/plain
src/mame/includes/lwings.h svneol=native#text/plain
src/mame/includes/m10.h svneol=native#text/plain
diff --git a/src/build/file2str.c b/src/build/file2str.c
index e7a44742892..7e2ae02746c 100644
--- a/src/build/file2str.c
+++ b/src/build/file2str.c
@@ -80,6 +80,7 @@ int main(int argc, char *argv[])
}
/* write the initial header */
+ fprintf(dst, "extern const %s %s[];\n", type, varname);
fprintf(dst, "const %s %s[] =\n{\n\t", type, varname);
/* write out the data */
diff --git a/src/emu/cpu/drcbec.c b/src/emu/cpu/drcbec.c
index 4b09a9e0bff..e3e4ec40d94 100644
--- a/src/emu/cpu/drcbec.c
+++ b/src/emu/cpu/drcbec.c
@@ -283,6 +283,7 @@ static const UINT32 condition_map[] =
static UINT64 immediate_zero = 0;
+extern const drcbe_interface drcbe_c_be_interface;
const drcbe_interface drcbe_c_be_interface =
{
drcbec_alloc,
diff --git a/src/emu/cpu/drcbex86.c b/src/emu/cpu/drcbex86.c
index 34f625ec984..d8848f8329a 100644
--- a/src/emu/cpu/drcbex86.c
+++ b/src/emu/cpu/drcbex86.c
@@ -222,6 +222,7 @@ static int ddivs(UINT64 *dstlo, UINT64 *dsthi, INT64 src1, INT64 src2);
***************************************************************************/
/* globally-accessible interface to the backend */
+extern const drcbe_interface drcbe_x86_be_interface;
const drcbe_interface drcbe_x86_be_interface =
{
drcbex86_alloc,
diff --git a/src/emu/cpu/g65816/g65816op.h b/src/emu/cpu/g65816/g65816op.h
index a45c250983c..c4ef95fa652 100644
--- a/src/emu/cpu/g65816/g65816op.h
+++ b/src/emu/cpu/g65816/g65816op.h
@@ -2253,6 +2253,7 @@ OP(ff, OP_SBC ( ALX ) ) /* SBC alx (G) */
+extern TABLE_OPCODES;
TABLE_OPCODES =
{
O(00),O(01),O(02),O(03),O(04),O(05),O(06),O(07),
diff --git a/src/emu/cpu/i860/i860.c b/src/emu/cpu/i860/i860.c
index c5bf906b12f..d88e441e4dd 100644
--- a/src/emu/cpu/i860/i860.c
+++ b/src/emu/cpu/i860/i860.c
@@ -31,8 +31,8 @@ static CPU_INIT( i860 )
cpustate->device = device;
cpustate->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
reset_i860(cpustate);
- i860_set_pin(cpustate, DEC_PIN_BUS_HOLD, 0);
- i860_set_pin(cpustate, DEC_PIN_RESET, 0);
+ i860_set_pin(device, DEC_PIN_BUS_HOLD, 0);
+ i860_set_pin(device, DEC_PIN_RESET, 0);
cpustate->single_stepping = 0;
state_save_register_device_item_array(device, 0, cpustate->iregs);
diff --git a/src/emu/cpu/i860/i860.h b/src/emu/cpu/i860/i860.h
index 5fd72687797..968d1015214 100644
--- a/src/emu/cpu/i860/i860.h
+++ b/src/emu/cpu/i860/i860.h
@@ -198,7 +198,7 @@ extern void i860_gen_interrupt(i860_state_t*);
/* This is the external interface for asserting/deasserting a pin on
the i860. */
-extern void i860_set_pin(i860_state_t*, int, int);
+extern void i860_set_pin(const device_config *, int, int);
/* Hard or soft reset. */
extern void reset_i860(i860_state_t*);
diff --git a/src/emu/cpu/i860/i860dec.c b/src/emu/cpu/i860/i860dec.c
index 003ccd6680d..5116536695d 100644
--- a/src/emu/cpu/i860/i860dec.c
+++ b/src/emu/cpu/i860/i860dec.c
@@ -309,8 +309,9 @@ static int has_delay_slot(UINT32 insn)
/* This is the external interface for asserting/deasserting pins on
the i860. */
-void i860_set_pin (i860s *cpustate, int pin, int val)
+void i860_set_pin (const device_config *device, int pin, int val)
{
+ i860s *cpustate = get_safe_token(device);
if (pin == DEC_PIN_BUS_HOLD)
cpustate->pin_bus_hold = val;
else if (pin == DEC_PIN_RESET)
diff --git a/src/emu/cpu/m37710/m37710.c b/src/emu/cpu/m37710/m37710.c
index e7e12e6b4f0..eef145d2640 100644
--- a/src/emu/cpu/m37710/m37710.c
+++ b/src/emu/cpu/m37710/m37710.c
@@ -62,6 +62,7 @@ static void m37710_set_irq_line(m37710i_cpu_struct *cpustate, int line, int stat
/* interrupt control mapping */
+extern const int m37710_irq_levels[M37710_LINE_MAX];
const int m37710_irq_levels[M37710_LINE_MAX] =
{
// maskable
diff --git a/src/emu/cpu/m37710/m37710op.h b/src/emu/cpu/m37710/m37710op.h
index 22d901c557e..7f793e97e5c 100644
--- a/src/emu/cpu/m37710/m37710op.h
+++ b/src/emu/cpu/m37710/m37710op.h
@@ -2721,6 +2721,7 @@ OP(235, OP_DIV ( DX ) ) /* DIV dx */
OP(249, OP_RLA ( IMM ) ) /* RLA imm */
OP(2c2, OP_LDT ( IMM ) ) /* LDT imm */
+extern TABLE_OPCODES;
TABLE_OPCODES =
{
O(00),O(01),O(02),O(03),O(04),O(05),O(06),O(07),
@@ -2757,6 +2758,7 @@ TABLE_OPCODES =
O(f8),O(f9),O(fa),O(fb),O(fc),O(fd),O(fe),O(ff)
};
+extern TABLE_OPCODES2;
TABLE_OPCODES2 =
{
O(200),O(101),O(200),O(103),O(200),O(105),O(200),O(107),
@@ -2793,6 +2795,7 @@ TABLE_OPCODES2 =
O(200),O(200),O(200),O(200),O(200),O(200),O(200),O(200)
};
+extern TABLE_OPCODES3;
TABLE_OPCODES3 =
{
O(200),O(200),O(200),O(203),O(200),O(205),O(200),O(200),
diff --git a/src/emu/driver.h b/src/emu/driver.h
index 9d35cdbe2bb..c2ec12d67cb 100644
--- a/src/emu/driver.h
+++ b/src/emu/driver.h
@@ -189,7 +189,8 @@ struct _game_driver
GAMEL(YEAR,NAME,PARENT,MACHINE,INPUT,INIT,MONITOR,COMPANY,FULLNAME,FLAGS,((const char *)0))
#define GAMEL(YEAR,NAME,PARENT,MACHINE,INPUT,INIT,MONITOR,COMPANY,FULLNAME,FLAGS,LAYOUT) \
-const game_driver driver_##NAME = \
+extern const game_driver driver_##NAME; \
+const game_driver driver_##NAME = \
{ \
__FILE__, \
#PARENT, \
diff --git a/src/emu/machine/eepromdev.c b/src/emu/machine/eepromdev.c
index 40f0d2460e8..f46f05129ad 100644
--- a/src/emu/machine/eepromdev.c
+++ b/src/emu/machine/eepromdev.c
@@ -361,7 +361,7 @@ void *eepromdev_get_data_pointer(const device_config *device, UINT32 *length, UI
static DEVICE_NVRAM( eeprom )
{
- const eeprom_config *config = device->inline_config;
+ const eeprom_config *config = (const eeprom_config *)device->inline_config;
if (read_or_write)
eepromdev_save(device, file);
@@ -384,7 +384,7 @@ static DEVICE_START(eeprom)
assert(device->machine != NULL);
assert(device->machine->config != NULL);
- config = device->inline_config;
+ config = (const eeprom_config *)device->inline_config;
c->intf = config->pinterface;
diff --git a/src/emu/machine/i2cmemdev.c b/src/emu/machine/i2cmemdev.c
index 9485b405956..bf6b78de061 100644
--- a/src/emu/machine/i2cmemdev.c
+++ b/src/emu/machine/i2cmemdev.c
@@ -375,7 +375,7 @@ static DEVICE_START( i2cmem )
assert( device->machine != NULL );
assert( device->machine->config != NULL );
- config = device->inline_config;
+ config = (const i2cmem_config *)device->inline_config;
c->scl = 0;
c->sdaw = 0;
@@ -431,7 +431,7 @@ static DEVICE_RESET( i2cmem )
static DEVICE_NVRAM( i2cmem )
{
- const i2cmem_config *config = device->inline_config;
+ const i2cmem_config *config = (const i2cmem_config *)device->inline_config;
i2cmem_state *c = get_safe_token( device );
if( read_or_write )
diff --git a/src/emu/sound.c b/src/emu/sound.c
index 9f54ae418c4..75629f75c8a 100644
--- a/src/emu/sound.c
+++ b/src/emu/sound.c
@@ -860,7 +860,7 @@ static DEVICE_START( speaker_output )
static DEVICE_STOP( speaker_output )
{
#ifdef MAME_DEBUG
- speaker_info *info = device->token;
+ speaker_info *info = (speaker_info *)device->token;
/* log the maximum sample values for all speakers */
if (info->max_sample > 0)
diff --git a/src/emu/sound/psx.c b/src/emu/sound/psx.c
index 5cc70a5c55e..7054c197bc5 100644
--- a/src/emu/sound/psx.c
+++ b/src/emu/sound/psx.c
@@ -35,6 +35,8 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level,
#define SAMPLES_PER_BLOCK ( 28 )
#define PITCH_SHIFT ( 12 )
+typedef enum { e_attack = 0, e_decay, e_sustain, e_sustainEnd, e_release, e_releaseend } sound_envstate;
+
struct psxinfo
{
const psx_spu_interface *intf;
@@ -66,7 +68,7 @@ struct psxinfo
UINT16 m_p_n_pitch[ MAX_CHANNEL ];
UINT16 m_p_n_address[ MAX_CHANNEL ];
UINT16 m_p_n_envelopestate[ MAX_CHANNEL ];
- enum envstate { e_attack = 0, e_decay, e_sustain, e_sustainEnd, e_release, e_releaseend } m_envstate;
+ sound_envstate m_envstate;
UINT16 m_p_n_attackdecaysustain[ MAX_CHANNEL ];
UINT16 m_p_n_sustainrelease[ MAX_CHANNEL ];
UINT16 m_p_n_adsrvolume[ MAX_CHANNEL ];
diff --git a/src/emu/sound/qsound.c b/src/emu/sound/qsound.c
index bf1c9d5b1ef..e01041821a5 100644
--- a/src/emu/sound/qsound.c
+++ b/src/emu/sound/qsound.c
@@ -239,7 +239,7 @@ static void qsound_set_command(qsound_state *chip, int data, int value)
ch=(ch+1)&0x0f; /* strange ... */
chip->channel[ch].bank=(value&0x7f)<<16;
#ifdef MAME_DEBUG
- if (!value & 0x8000)
+ if (!(value & 0x8000))
popmessage("Register3=%04x",value);
#endif
diff --git a/src/emu/timer.c b/src/emu/timer.c
index 62080cacfe8..88308ad3ec9 100644
--- a/src/emu/timer.c
+++ b/src/emu/timer.c
@@ -703,7 +703,7 @@ void timer_adjust_oneshot(emu_timer *which, attotime duration, INT32 param)
void timer_device_adjust_oneshot(const device_config *timer, attotime duration, INT32 param)
{
#ifdef MAME_DEBUG
- timer_config *config = timer->inline_config;
+ timer_config *config = (timer_config *)timer->inline_config;
/* doesn't make sense for scanline timers */
assert(config->type != TIMER_TYPE_SCANLINE);
@@ -756,7 +756,7 @@ void timer_device_adjust_periodic(const device_config *timer, attotime start_del
{
timer_state *state = get_safe_token(timer);
#ifdef MAME_DEBUG
- timer_config *config = timer->inline_config;
+ timer_config *config = (timer_config *)timer->inline_config;
/* doesn't make sense for scanline timers */
assert(config->type != TIMER_TYPE_SCANLINE);
@@ -820,7 +820,7 @@ void timer_device_reset(const device_config *timer)
{
timer_state *state = get_safe_token(timer);
#ifdef MAME_DEBUG
- timer_config *config = timer->inline_config;
+ timer_config *config = (timer_config *)timer->inline_config;
/* doesn't make sense for scanline timers */
assert(config->type != TIMER_TYPE_SCANLINE);
@@ -890,7 +890,7 @@ int timer_device_get_param(const device_config *timer)
{
timer_state *state = get_safe_token(timer);
#ifdef MAME_DEBUG
- timer_config *config = timer->inline_config;
+ timer_config *config = (timer_config *)timer->inline_config;
/* doesn't make sense for scanline timers */
assert(config->type != TIMER_TYPE_SCANLINE);
@@ -915,7 +915,7 @@ void timer_device_set_param(const device_config *timer, int param)
{
timer_state *state = get_safe_token(timer);
#ifdef MAME_DEBUG
- timer_config *config = timer->inline_config;
+ timer_config *config = (timer_config *)timer->inline_config;
/* doesn't make sense for scanline timers */
assert(config->type != TIMER_TYPE_SCANLINE);
diff --git a/src/emu/ui.c b/src/emu/ui.c
index bafc859e1c8..a71e7986888 100644
--- a/src/emu/ui.c
+++ b/src/emu/ui.c
@@ -1987,7 +1987,7 @@ static char *slider_get_laserdisc_desc(const device_config *laserdisc)
#ifdef MAME_DEBUG
static INT32 slider_crossscale(running_machine *machine, void *arg, astring *string, INT32 newval)
{
- input_field_config *field = arg;
+ input_field_config *field = (input_field_config *)arg;
if (newval != SLIDER_NOCHANGE)
field->crossscale = (float)newval * 0.001f;
@@ -2006,7 +2006,7 @@ static INT32 slider_crossscale(running_machine *machine, void *arg, astring *str
#ifdef MAME_DEBUG
static INT32 slider_crossoffset(running_machine *machine, void *arg, astring *string, INT32 newval)
{
- input_field_config *field = arg;
+ input_field_config *field = (input_field_config *)arg;
if (newval != SLIDER_NOCHANGE)
field->crossoffset = (float)newval * 0.001f;
diff --git a/src/emu/uimenu.c b/src/emu/uimenu.c
index d36d10226dd..2e54be3741d 100644
--- a/src/emu/uimenu.c
+++ b/src/emu/uimenu.c
@@ -1511,7 +1511,7 @@ static void menu_main_populate(running_machine *machine, ui_menu *menu, void *st
/* add crosshair options menu */
if (crosshair_get_usage(machine))
- ui_menu_item_append(menu, "Crosshair Options", NULL, 0, menu_crosshair);
+ ui_menu_item_append(menu, "Crosshair Options", NULL, 0, (void *)menu_crosshair);
/* add cheat menu */
if (options_get_bool(mame_options(), OPTION_CHEAT) && cheat_get_next_menu_entry(machine, NULL, NULL, NULL, NULL) != NULL)
@@ -3077,7 +3077,7 @@ static void menu_crosshair(running_machine *machine, ui_menu *menu, void *parame
if (event != NULL && event->itemref != NULL)
{
crosshair_user_settings settings;
- crosshair_item_data *data = event->itemref;
+ crosshair_item_data *data = (crosshair_item_data *)event->itemref;
int changed = FALSE;
int set_def = FALSE;
int newval = data->cur;
@@ -3193,7 +3193,7 @@ static void menu_crosshair_populate(running_machine *machine, ui_menu *menu)
if (settings.mode == CROSSHAIR_VISIBILITY_AUTO) use_auto = TRUE;
/* CROSSHAIR_ITEM_VIS - allocate a data item and fill it */
- data = ui_menu_pool_alloc(menu, sizeof(*data));
+ data = (crosshair_item_data *)ui_menu_pool_alloc(menu, sizeof(*data));
data->type = CROSSHAIR_ITEM_VIS;
data->player = player;
data->min = CROSSHAIR_VISIBILITY_OFF;
@@ -3212,7 +3212,7 @@ static void menu_crosshair_populate(running_machine *machine, ui_menu *menu)
ui_menu_item_append(menu, temp_text, vis_text[settings.mode], flags, data);
/* CROSSHAIR_ITEM_PIC - allocate a data item and fill it */
- data = ui_menu_pool_alloc(menu, sizeof(*data));
+ data = (crosshair_item_data *)ui_menu_pool_alloc(menu, sizeof(*data));
data->type = CROSSHAIR_ITEM_PIC;
data->player = player;
data->last_name[0] = 0;
@@ -3299,7 +3299,7 @@ static void menu_crosshair_populate(running_machine *machine, ui_menu *menu)
crosshair_get_user_settings(machine, 0, &settings);
/* CROSSHAIR_ITEM_AUTO_TIME - allocate a data item and fill it */
- data = ui_menu_pool_alloc(menu, sizeof(*data));
+ data = (crosshair_item_data *)ui_menu_pool_alloc(menu, sizeof(*data));
data->type = CROSSHAIR_ITEM_AUTO_TIME;
data->min = CROSSHAIR_VISIBILITY_AUTOTIME_MIN;
data->max = CROSSHAIR_VISIBILITY_AUTOTIME_MAX;
diff --git a/src/mame/audio/cliffhgr.c b/src/mame/audio/cliffhgr.c
index 7a2ae17bcdd..cc08e9a4058 100644
--- a/src/mame/audio/cliffhgr.c
+++ b/src/mame/audio/cliffhgr.c
@@ -25,6 +25,8 @@ static const discrete_mixer_desc desc_cliffhgr_mixer =
8
};
+DISCRETE_SOUND_EXTERN(cliffhgr);
+
DISCRETE_SOUND_START(cliffhgr)
DISCRETE_INPUT_LOGIC(CLIFF_ENABLE_SND_1)
DISCRETE_INPUT_LOGIC(CLIFF_ENABLE_SND_2)
diff --git a/src/mame/audio/dkong.c b/src/mame/audio/dkong.c
index 92d986dcf98..d27c44cc84b 100644
--- a/src/mame/audio/dkong.c
+++ b/src/mame/audio/dkong.c
@@ -304,7 +304,7 @@ struct dkong_custom_mixer_context
static DISCRETE_STEP( dkong_custom_mixer )
{
- struct dkong_custom_mixer_context *context = node->context;
+ struct dkong_custom_mixer_context *context = (struct dkong_custom_mixer_context *)node->context;
int in_1 = (int)DKONG_CUSTOM_IN1;
@@ -323,7 +323,7 @@ static DISCRETE_STEP( dkong_custom_mixer )
static DISCRETE_RESET( dkong_custom_mixer )
{
- struct dkong_custom_mixer_context *context = node->context;
+ struct dkong_custom_mixer_context *context = (struct dkong_custom_mixer_context *)node->context;
/* everything is based on the input to the O.C. inverter */
/* precalculate current from In1 */
@@ -975,7 +975,7 @@ DISCRETE_SOUND_END
static SOUND_START( dkong)
{
- dkong_state *state = machine->driver_data;
+ dkong_state *state = (dkong_state *)machine->driver_data;
state->snd_rom = memory_region(machine, "soundcpu");
state->dev_vp2 = devtag_get_device(machine, "virtual_p2");
@@ -1106,7 +1106,7 @@ static READ8_DEVICE_HANDLER( dkong_voice_status_r )
static READ8_DEVICE_HANDLER( dkong_tune_r )
{
- dkong_state *state = device->machine->driver_data;
+ dkong_state *state = (dkong_state *)device->machine->driver_data;
UINT8 page = latch8_r(state->dev_vp2,0) & 0x47;
if ( page & 0x40 )
diff --git a/src/mame/audio/exidy440.c b/src/mame/audio/exidy440.c
index e6922c7ada1..5a8ef0eaad3 100644
--- a/src/mame/audio/exidy440.c
+++ b/src/mame/audio/exidy440.c
@@ -774,9 +774,9 @@ static void decode_and_filter_cvsd(UINT8 *input, int bytes, int maskbits, int fr
int chunk_start;
/* compute the charge, decay, and leak constants */
- charge = pow(exp(-1), 1.0 / (FILTER_CHARGE_TC * (double)frequency));
- decay = pow(exp(-1), 1.0 / (FILTER_DECAY_TC * (double)frequency));
- leak = pow(exp(-1), 1.0 / (INTEGRATOR_LEAK_TC * (double)frequency));
+ charge = pow(exp(-1.0), 1.0 / (FILTER_CHARGE_TC * (double)frequency));
+ decay = pow(exp(-1.0), 1.0 / (FILTER_DECAY_TC * (double)frequency));
+ leak = pow(exp(-1.0), 1.0 / (INTEGRATOR_LEAK_TC * (double)frequency));
/* compute the gain */
gain = SAMPLE_GAIN;
diff --git a/src/mame/audio/jedi.c b/src/mame/audio/jedi.c
index d6478615cf8..22ff827d337 100644
--- a/src/mame/audio/jedi.c
+++ b/src/mame/audio/jedi.c
@@ -22,7 +22,7 @@
static SOUND_START( jedi )
{
- jedi_state *state = machine->driver_data;
+ jedi_state *state = (jedi_state *)machine->driver_data;
/* set up save state */
state_save_register_global(machine, state->audio_latch);
@@ -40,7 +40,7 @@ static SOUND_START( jedi )
static SOUND_RESET( jedi )
{
- jedi_state *state = machine->driver_data;
+ jedi_state *state = (jedi_state *)machine->driver_data;
/* init globals */
state->audio_latch = 0;
@@ -79,7 +79,7 @@ WRITE8_HANDLER( jedi_audio_reset_w )
static TIMER_CALLBACK( delayed_audio_latch_w )
{
- jedi_state *state = machine->driver_data;
+ jedi_state *state = (jedi_state *)machine->driver_data;
state->audio_latch = param;
*state->audio_comm_stat |= 0x80;
@@ -94,7 +94,7 @@ WRITE8_HANDLER( jedi_audio_latch_w )
static READ8_HANDLER( audio_latch_r )
{
- jedi_state *state = space->machine->driver_data;
+ jedi_state *state = (jedi_state *)space->machine->driver_data;
*state->audio_comm_stat &= ~0x80;
return state->audio_latch;
@@ -103,7 +103,7 @@ static READ8_HANDLER( audio_latch_r )
CUSTOM_INPUT( jedi_audio_comm_stat_r )
{
- jedi_state *state = field->port->machine->driver_data;
+ jedi_state *state = (jedi_state *)field->port->machine->driver_data;
return *state->audio_comm_stat >> 6;
}
@@ -117,7 +117,7 @@ CUSTOM_INPUT( jedi_audio_comm_stat_r )
READ8_HANDLER( jedi_audio_ack_latch_r )
{
- jedi_state *state = space->machine->driver_data;
+ jedi_state *state = (jedi_state *)space->machine->driver_data;
*state->audio_comm_stat &= ~0x40;
return state->audio_ack_latch;
@@ -126,7 +126,7 @@ READ8_HANDLER( jedi_audio_ack_latch_r )
static WRITE8_HANDLER( audio_ack_latch_w )
{
- jedi_state *state = space->machine->driver_data;
+ jedi_state *state = (jedi_state *)space->machine->driver_data;
state->audio_ack_latch = data;
*state->audio_comm_stat |= 0x40;
@@ -142,7 +142,7 @@ static WRITE8_HANDLER( audio_ack_latch_w )
static WRITE8_HANDLER( speech_strobe_w )
{
- jedi_state *state = space->machine->driver_data;
+ jedi_state *state = (jedi_state *)space->machine->driver_data;
int new_speech_strobe_state = (~offset >> 8) & 1;
if ((new_speech_strobe_state != state->speech_strobe_state) && new_speech_strobe_state)
diff --git a/src/mame/audio/leland.c b/src/mame/audio/leland.c
index fb7b423923c..7ebce19b2c9 100644
--- a/src/mame/audio/leland.c
+++ b/src/mame/audio/leland.c
@@ -380,7 +380,7 @@ static STREAM_UPDATE( leland_80186_dac_update )
static STREAM_UPDATE( leland_80186_dma_update )
{
- const address_space *dmaspace = param;
+ const address_space *dmaspace = (const address_space *)param;
stream_sample_t *buffer = outputs[0];
int i, j;
diff --git a/src/mame/audio/mario.c b/src/mame/audio/mario.c
index a7598c0244d..5c2675fb4ea 100644
--- a/src/mame/audio/mario.c
+++ b/src/mame/audio/mario.c
@@ -190,7 +190,7 @@ struct mario_custom_run_context
static DISCRETE_STEP( mario_custom_run )
{
- struct mario_custom_run_context *context = node->context;
+ struct mario_custom_run_context *context = (struct mario_custom_run_context *)node->context;
double t1 = 0.5 / LS624_F(MARIO_CUSTOM_C1, MARIO_CUSTOM_IN1, RUN_VCO_VOLTAGE);
double t2 = 0.5 / LS624_F(MARIO_CUSTOM_C2, MARIO_CUSTOM_IN2, RUN_VCO_VOLTAGE);
@@ -248,7 +248,7 @@ static DISCRETE_STEP( mario_custom_run )
static DISCRETE_RESET( mario_custom_run )
{
- struct mario_custom_run_context *context = node->context;
+ struct mario_custom_run_context *context = (struct mario_custom_run_context *)node->context;
context->remain1 = 0.0;
context->remain2 = 0.0;
@@ -363,7 +363,7 @@ DISCRETE_SOUND_END
static void set_ea(const address_space *space, int ea)
{
- mario_state *state = space->machine->driver_data;
+ mario_state *state = (mario_state *)space->machine->driver_data;
//printf("ea: %d\n", ea);
//cputag_set_input_line(machine, "audiocpu", MCS48_INPUT_EA, (ea) ? ASSERT_LINE : CLEAR_LINE);
if (state->eabank != 0)
@@ -378,7 +378,7 @@ static void set_ea(const address_space *space, int ea)
static SOUND_START( mario )
{
- mario_state *state = machine->driver_data;
+ mario_state *state = (mario_state *)machine->driver_data;
const device_config *audiocpu = cputag_get_cpu(machine, "audiocpu");
#if USE_8039
UINT8 *SND = memory_region(machine, "audiocpu");
@@ -401,7 +401,7 @@ static SOUND_START( mario )
static SOUND_RESET( mario )
{
- mario_state *state = machine->driver_data;
+ mario_state *state = (mario_state *)machine->driver_data;
const address_space *space = cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM);
#if USE_8039
@@ -480,7 +480,7 @@ static WRITE8_HANDLER( mario_sh_p2_w )
WRITE8_HANDLER( masao_sh_irqtrigger_w )
{
- mario_state *state = space->machine->driver_data;
+ mario_state *state = (mario_state *)space->machine->driver_data;
if (state->last == 1 && data == 0)
{
@@ -513,7 +513,7 @@ WRITE8_DEVICE_HANDLER( mario_sh2_w )
/* Misc samples */
WRITE8_HANDLER( mario_sh3_w )
{
- mario_state *state = space->machine->driver_data;
+ mario_state *state = (mario_state *)space->machine->driver_data;
switch (offset)
{
diff --git a/src/mame/audio/mcr.c b/src/mame/audio/mcr.c
index 6e7f911e012..c76d19a5e30 100644
--- a/src/mame/audio/mcr.c
+++ b/src/mame/audio/mcr.c
@@ -69,24 +69,19 @@ static write8_space_func ssio_custom_output[2];
/* Chip Squeak Deluxe-specific globals */
static const device_config *csdeluxe_sound_cpu;
static UINT8 csdeluxe_status;
-static const pia6821_interface csdeluxe_pia_intf;
/* Turbo Chip Squeak-specific globals */
static const device_config *turbocs_sound_cpu;
static UINT8 turbocs_status;
-static const pia6821_interface turbocs_pia_intf;
/* Sounds Good-specific globals */
static const device_config *soundsgood_sound_cpu;
static UINT8 soundsgood_status;
-static const pia6821_interface soundsgood_pia_intf;
/* Squawk n' Talk-specific globals */
static const device_config *squawkntalk_sound_cpu;
static UINT8 squawkntalk_tms_command;
static UINT8 squawkntalk_tms_strobes;
-static const pia6821_interface squawkntalk_pia0_intf;
-static const pia6821_interface squawkntalk_pia1_intf;
diff --git a/src/mame/audio/redalert.c b/src/mame/audio/redalert.c
index 8e278fd99d1..aef497b30c9 100644
--- a/src/mame/audio/redalert.c
+++ b/src/mame/audio/redalert.c
@@ -43,8 +43,6 @@
static UINT8 ay8910_latch_1;
static UINT8 ay8910_latch_2;
-static UINT8 ay8910_latch_1;
-
/*************************************
diff --git a/src/mame/audio/seibu.c b/src/mame/audio/seibu.c
index f43424e1ae7..409cbcf7cd1 100644
--- a/src/mame/audio/seibu.c
+++ b/src/mame/audio/seibu.c
@@ -144,7 +144,7 @@ struct _seibu_adpcm_state
static STREAM_UPDATE( seibu_adpcm_callback )
{
- seibu_adpcm_state *state = param;
+ seibu_adpcm_state *state = (seibu_adpcm_state *)param;
stream_sample_t *dest = outputs[0];
while (state->playing && samples > 0)
@@ -172,7 +172,7 @@ static STREAM_UPDATE( seibu_adpcm_callback )
static DEVICE_START( seibu_adpcm )
{
running_machine *machine = device->machine;
- seibu_adpcm_state *state = device->token;
+ seibu_adpcm_state *state = (seibu_adpcm_state *)device->token;
state->playing = 0;
state->stream = stream_create(device, 0, 1, device->clock, state, seibu_adpcm_callback);
@@ -215,7 +215,7 @@ void seibu_adpcm_decrypt(running_machine *machine, const char *region)
WRITE8_DEVICE_HANDLER( seibu_adpcm_adr_w )
{
- seibu_adpcm_state *state = device->token;
+ seibu_adpcm_state *state = (seibu_adpcm_state *)device->token;
if (state->stream)
stream_update(state->stream);
@@ -232,7 +232,7 @@ WRITE8_DEVICE_HANDLER( seibu_adpcm_adr_w )
WRITE8_DEVICE_HANDLER( seibu_adpcm_ctl_w )
{
- seibu_adpcm_state *state = device->token;
+ seibu_adpcm_state *state = (seibu_adpcm_state *)device->token;
// sequence is 00 02 01 each time.
if (state->stream)
diff --git a/src/mame/audio/tiamc1.c b/src/mame/audio/tiamc1.c
index 107489948b0..27157650971 100644
--- a/src/mame/audio/tiamc1.c
+++ b/src/mame/audio/tiamc1.c
@@ -246,7 +246,7 @@ WRITE8_HANDLER( tiamc1_timer1_gate_w )
static STREAM_UPDATE( tiamc1_sound_update )
{
- int count, o0, o1, o2, len, or = 0;
+ int count, o0, o1, o2, len, orval = 0;
len = samples * CLOCK_DIVIDER;
@@ -271,11 +271,11 @@ static STREAM_UPDATE( tiamc1_sound_update )
o1 = timer8253_get_output(&timer0, 1) ? 1 : 0;
o2 = timer8253_get_output(&timer0, 2) ? 1 : 0;
- or = (or << 1) | (((o0 | o1) ^ 0xff) & o2);
+ orval = (orval << 1) | (((o0 | o1) ^ 0xff) & o2);
if ((count + 1) % CLOCK_DIVIDER == 0) {
- outputs[0][count / CLOCK_DIVIDER] = or ? 0x2828 : 0;
- or = 0;
+ outputs[0][count / CLOCK_DIVIDER] = orval ? 0x2828 : 0;
+ orval = 0;
}
}
}
diff --git a/src/mame/audio/turbo.c b/src/mame/audio/turbo.c
index 58c2dbf461e..8b3c35f7155 100644
--- a/src/mame/audio/turbo.c
+++ b/src/mame/audio/turbo.c
@@ -73,7 +73,7 @@ if (!((data >> 4) & 1)) mame_printf_debug("/TRIG4\n");
WRITE8_DEVICE_HANDLER( turbo_sound_a_w )
{
const device_config *samples = devtag_get_device(device->machine, "samples");
- turbo_state *state = device->machine->driver_data;
+ turbo_state *state = (turbo_state *)device->machine->driver_data;
UINT8 diff = data ^ state->sound_state[0];
state->sound_state[0] = data;
@@ -122,7 +122,7 @@ WRITE8_DEVICE_HANDLER( turbo_sound_a_w )
WRITE8_DEVICE_HANDLER( turbo_sound_b_w )
{
const device_config *samples = devtag_get_device(device->machine, "samples");
- turbo_state *state = device->machine->driver_data;
+ turbo_state *state = (turbo_state *)device->machine->driver_data;
UINT8 diff = data ^ state->sound_state[1];
state->sound_state[1] = data;
@@ -145,7 +145,7 @@ WRITE8_DEVICE_HANDLER( turbo_sound_b_w )
WRITE8_DEVICE_HANDLER( turbo_sound_c_w )
{
const device_config *samples = devtag_get_device(device->machine, "samples");
- turbo_state *state = device->machine->driver_data;
+ turbo_state *state = (turbo_state *)device->machine->driver_data;
/* OSEL1-2 */
state->turbo_osel = (state->turbo_osel & 1) | ((data & 3) << 1);
@@ -295,7 +295,7 @@ MACHINE_DRIVER_END
WRITE8_DEVICE_HANDLER( subroc3d_sound_a_w )
{
- turbo_state *state = device->machine->driver_data;
+ turbo_state *state = (turbo_state *)device->machine->driver_data;
state->sound_state[0] = data;
/* DIS0-3 contained in bits 0-3 */
@@ -326,7 +326,7 @@ INLINE void subroc3d_update_volume(const device_config *samples, int leftchan, U
WRITE8_DEVICE_HANDLER( subroc3d_sound_b_w )
{
const device_config *samples = devtag_get_device(device->machine, "samples");
- turbo_state *state = device->machine->driver_data;
+ turbo_state *state = (turbo_state *)device->machine->driver_data;
UINT8 diff = data ^ state->sound_state[1];
state->sound_state[1] = data;
@@ -382,7 +382,7 @@ WRITE8_DEVICE_HANDLER( subroc3d_sound_b_w )
WRITE8_DEVICE_HANDLER( subroc3d_sound_c_w )
{
const device_config *samples = devtag_get_device(device->machine, "samples");
- turbo_state *state = device->machine->driver_data;
+ turbo_state *state = (turbo_state *)device->machine->driver_data;
UINT8 diff = data ^ state->sound_state[2];
state->sound_state[2] = data;
@@ -507,7 +507,7 @@ static void buckrog_update_samples(turbo_state *state, const device_config *samp
WRITE8_DEVICE_HANDLER( buckrog_sound_a_w )
{
const device_config *samples = devtag_get_device(device->machine, "samples");
- turbo_state *state = device->machine->driver_data;
+ turbo_state *state = (turbo_state *)device->machine->driver_data;
UINT8 diff = data ^ state->sound_state[0];
state->sound_state[0] = data;
@@ -533,7 +533,7 @@ WRITE8_DEVICE_HANDLER( buckrog_sound_a_w )
WRITE8_DEVICE_HANDLER( buckrog_sound_b_w )
{
const device_config *samples = devtag_get_device(device->machine, "samples");
- turbo_state *state = device->machine->driver_data;
+ turbo_state *state = (turbo_state *)device->machine->driver_data;
UINT8 diff = data ^ state->sound_state[1];
state->sound_state[1] = data;
diff --git a/src/mame/drivers/20pacgal.c b/src/mame/drivers/20pacgal.c
index a83513610aa..9f28b22a6f1 100644
--- a/src/mame/drivers/20pacgal.c
+++ b/src/mame/drivers/20pacgal.c
@@ -160,7 +160,7 @@ static WRITE8_HANDLER( _20pacgal_coin_counter_w )
static WRITE8_HANDLER( rom_bank_select_w )
{
- _20pacgal_state *state = space->machine->driver_data;
+ _20pacgal_state *state = (_20pacgal_state *)space->machine->driver_data;
state->game_selected = data & 1;
@@ -174,7 +174,7 @@ static WRITE8_HANDLER( rom_bank_select_w )
static WRITE8_HANDLER( rom_48000_w )
{
- _20pacgal_state *state = space->machine->driver_data;
+ _20pacgal_state *state = (_20pacgal_state *)space->machine->driver_data;
if (state->game_selected)
{
diff --git a/src/mame/drivers/arcadia.c b/src/mame/drivers/arcadia.c
index 33808f2a8e3..68f845f317a 100644
--- a/src/mame/drivers/arcadia.c
+++ b/src/mame/drivers/arcadia.c
@@ -72,7 +72,7 @@ static UINT8 coin_counter[2];
static WRITE16_HANDLER( arcadia_multibios_change_game )
{
- memory_install_read16_handler(space, 0x800000, 0x97ffff, 0, 0, (data == 0) ? SMH_BANK(2) : SMH_NOP);
+ memory_install_read16_handler(space, 0x800000, 0x97ffff, 0, 0, (read16_space_func)((data == 0) ? SMH_BANK(2) : SMH_NOP));
}
@@ -156,7 +156,7 @@ static CUSTOM_INPUT( coin_counter_r )
static INPUT_CHANGED( coin_changed_callback )
{
- UINT8 *counter = param;
+ UINT8 *counter = (UINT8 *)param;
/* check for a 0 -> 1 transition */
if (!oldval && newval && *counter < 3)
diff --git a/src/mame/drivers/atarig42.c b/src/mame/drivers/atarig42.c
index 27c2b985a32..ce0e7467509 100644
--- a/src/mame/drivers/atarig42.c
+++ b/src/mame/drivers/atarig42.c
@@ -141,7 +141,7 @@ static DIRECT_UPDATE_HANDLER( sloop_direct_handler )
{
if (address < 0x80000)
{
- direct->raw = direct->decrypted = (void *)sloop_base;
+ direct->raw = direct->decrypted = (UINT8 *)sloop_base;
return (offs_t)-1;
}
return address;
diff --git a/src/mame/drivers/atarisy2.c b/src/mame/drivers/atarisy2.c
index d2fc49a052a..8f90a0cf9ec 100644
--- a/src/mame/drivers/atarisy2.c
+++ b/src/mame/drivers/atarisy2.c
@@ -457,7 +457,7 @@ static READ8_HANDLER( leta_r )
/* if the joystick is centered, leave the rest of this alone */
angle = last_angle;
if (analogx < -32 || analogx > 32 || analogy < -32 || analogy > 32)
- angle = atan2(analogx, analogy) * 360 / (2 * M_PI);
+ angle = atan2((double)analogx, (double)analogy) * 360 / (2 * M_PI);
/* detect when we pass the 0 point in either direction */
if (last_angle < -90 && angle > 90)
diff --git a/src/mame/drivers/bfm_sc1.c b/src/mame/drivers/bfm_sc1.c
index fdde28b0803..cd1e2434455 100644
--- a/src/mame/drivers/bfm_sc1.c
+++ b/src/mame/drivers/bfm_sc1.c
@@ -497,7 +497,7 @@ static WRITE8_HANDLER( mux2latch_w )
if ( changed & 0x08 )
{ // clock changed
- if ( (!data & 0x08) )
+ if ( !(data & 0x08) )
{ // clock changed to low
int strobe, offset, pattern, i;
diff --git a/src/mame/drivers/cidelsa.c b/src/mame/drivers/cidelsa.c
index ccd35014c78..39f01d18616 100644
--- a/src/mame/drivers/cidelsa.c
+++ b/src/mame/drivers/cidelsa.c
@@ -10,7 +10,7 @@
static CDP1802_MODE_READ( cidelsa_mode_r )
{
- cidelsa_state *state = device->machine->driver_data;
+ cidelsa_state *state = (cidelsa_state *)device->machine->driver_data;
return state->cdp1802_mode;
}
@@ -29,7 +29,7 @@ static CDP1802_EF_READ( cidelsa_ef_r )
static CDP1802_Q_WRITE( cidelsa_q_w )
{
- cidelsa_state *state = device->machine->driver_data;
+ cidelsa_state *state = (cidelsa_state *)device->machine->driver_data;
state->cdp1802_q = level;
}
@@ -66,7 +66,7 @@ static WRITE8_HANDLER( draco_sound_bankswitch_w )
static WRITE8_DEVICE_HANDLER( draco_sound_g_w )
{
- cidelsa_state *state = device->machine->driver_data;
+ cidelsa_state *state = (cidelsa_state *)device->machine->driver_data;
/*
@@ -97,21 +97,21 @@ static WRITE8_DEVICE_HANDLER( draco_sound_g_w )
static READ8_HANDLER( draco_sound_in_r )
{
- cidelsa_state *state = space->machine->driver_data;
+ cidelsa_state *state = (cidelsa_state *)space->machine->driver_data;
return ~(state->draco_sound) & 0x07;
}
static READ8_HANDLER( draco_sound_ay8910_r )
{
- cidelsa_state *state = space->machine->driver_data;
+ cidelsa_state *state = (cidelsa_state *)space->machine->driver_data;
return state->draco_ay_latch;
}
static WRITE8_HANDLER( draco_sound_ay8910_w )
{
- cidelsa_state *state = space->machine->driver_data;
+ cidelsa_state *state = (cidelsa_state *)space->machine->driver_data;
state->draco_ay_latch = data;
}
@@ -171,7 +171,7 @@ static WRITE8_HANDLER( draco_out1_w )
7 SONIDO C -> COP402 IN2
*/
- cidelsa_state *state = space->machine->driver_data;
+ cidelsa_state *state = (cidelsa_state *)space->machine->driver_data;
state->draco_sound = (data & 0xe0) >> 5;
}
@@ -308,14 +308,14 @@ ADDRESS_MAP_END
static CUSTOM_INPUT( cdp1869_pcb_r )
{
- cidelsa_state *state = field->port->machine->driver_data;
+ cidelsa_state *state = (cidelsa_state *)field->port->machine->driver_data;
return state->cdp1869_pcb;
}
static CUSTOM_INPUT( cdp1869_predisplay_r )
{
- cidelsa_state *state = field->port->machine->driver_data;
+ cidelsa_state *state = (cidelsa_state *)field->port->machine->driver_data;
return state->cdp1869_prd;
}
@@ -466,14 +466,14 @@ INPUT_PORTS_END
static TIMER_CALLBACK( set_cpu_mode )
{
- cidelsa_state *state = machine->driver_data;
+ cidelsa_state *state = (cidelsa_state *)machine->driver_data;
state->cdp1802_mode = CDP1802_MODE_RUN;
}
static MACHINE_START( cidelsa )
{
- cidelsa_state *state = machine->driver_data;
+ cidelsa_state *state = (cidelsa_state *)machine->driver_data;
/* reset the CPU */
state->cdp1802_mode = CDP1802_MODE_RESET;
@@ -485,7 +485,7 @@ static MACHINE_START( cidelsa )
static MACHINE_START( draco )
{
- cidelsa_state *state = machine->driver_data;
+ cidelsa_state *state = (cidelsa_state *)machine->driver_data;
MACHINE_START_CALL( cidelsa );
diff --git a/src/mame/drivers/cps1.c b/src/mame/drivers/cps1.c
index 88705b86d3b..c55cc215bc4 100644
--- a/src/mame/drivers/cps1.c
+++ b/src/mame/drivers/cps1.c
@@ -8280,7 +8280,7 @@ static DRIVER_INIT( sf2ue )
{
/* This specific version of SF2 has the CPS-B custom mapped at a different address. */
/* The mapping is handled by a PAL on the B-board */
- memory_install_readwrite16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x800140, 0x80017f, 0, 0, SMH_UNMAP, SMH_UNMAP);
+ memory_install_readwrite16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x800140, 0x80017f, 0, 0, (read16_space_func)SMH_UNMAP, (write16_space_func)SMH_UNMAP);
memory_install_readwrite16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x8001c0, 0x8001ff, 0, 0, cps1_cps_b_r, cps1_cps_b_w);
DRIVER_INIT_CALL(cps1);
diff --git a/src/mame/drivers/cps3.c b/src/mame/drivers/cps3.c
index 57aaa8182f7..96c0aec5263 100644
--- a/src/mame/drivers/cps3.c
+++ b/src/mame/drivers/cps3.c
@@ -620,13 +620,13 @@ static UINT16 rotate_left(UINT16 value, int n)
return ((value<<n)|aux)%0x10000;
}
-static UINT16 rotxor(UINT16 val, UINT16 xor)
+static UINT16 rotxor(UINT16 val, UINT16 xorval)
{
UINT16 res;
res = val + rotate_left(val,2);
- res = rotate_left(res,4) ^ (res & (val ^ xor));
+ res = rotate_left(res,4) ^ (res & (val ^ xorval));
return res;
}
@@ -1429,8 +1429,8 @@ static WRITE32_HANDLER( cps3_gfxflash_w )
UINT32* romdata = (UINT32*)cps3_user5region;
int real_offset = 0;
UINT32 newdata;
- UINT8* ptr1 = intelflash_getmemptr(flash1);
- UINT8* ptr2 = intelflash_getmemptr(flash2);
+ UINT8* ptr1 = (UINT8*)intelflash_getmemptr(flash1);
+ UINT8* ptr2 = (UINT8*)intelflash_getmemptr(flash2);
real_offset = ((cram_gfxflash_bank&0x3e) * 0x200000) + offset*4;
@@ -1532,10 +1532,10 @@ static void cps3_flashmain_w(running_machine *machine, int base, UINT32 offset,
UINT32* romdata2 = (UINT32*)decrypted_gamerom;
int real_offset = 0;
UINT32 newdata;
- UINT8* ptr1 = intelflash_getmemptr(base+0);
- UINT8* ptr2 = intelflash_getmemptr(base+1);
- UINT8* ptr3 = intelflash_getmemptr(base+2);
- UINT8* ptr4 = intelflash_getmemptr(base+3);
+ UINT8* ptr1 = (UINT8*)intelflash_getmemptr(base+0);
+ UINT8* ptr2 = (UINT8*)intelflash_getmemptr(base+1);
+ UINT8* ptr3 = (UINT8*)intelflash_getmemptr(base+2);
+ UINT8* ptr4 = (UINT8*)intelflash_getmemptr(base+3);
real_offset = offset * 4;
@@ -2297,10 +2297,10 @@ static void precopy_to_flash(running_machine *machine)
for (i=0;i<0x800000;i+=4)
{
UINT32 data;
- UINT8* ptr1 = intelflash_getmemptr(0);
- UINT8* ptr2 = intelflash_getmemptr(1);
- UINT8* ptr3 = intelflash_getmemptr(2);
- UINT8* ptr4 = intelflash_getmemptr(3);
+ UINT8* ptr1 = (UINT8*)intelflash_getmemptr(0);
+ UINT8* ptr2 = (UINT8*)intelflash_getmemptr(1);
+ UINT8* ptr3 = (UINT8*)intelflash_getmemptr(2);
+ UINT8* ptr4 = (UINT8*)intelflash_getmemptr(3);
data = romdata[i/4];
@@ -2313,10 +2313,10 @@ static void precopy_to_flash(running_machine *machine)
for (i=0;i<0x800000;i+=4)
{
UINT32 data;
- UINT8* ptr1 = intelflash_getmemptr(4);
- UINT8* ptr2 = intelflash_getmemptr(5);
- UINT8* ptr3 = intelflash_getmemptr(6);
- UINT8* ptr4 = intelflash_getmemptr(7);
+ UINT8* ptr1 = (UINT8*)intelflash_getmemptr(4);
+ UINT8* ptr2 = (UINT8*)intelflash_getmemptr(5);
+ UINT8* ptr3 = (UINT8*)intelflash_getmemptr(6);
+ UINT8* ptr4 = (UINT8*)intelflash_getmemptr(7);
data = romdata[(0x800000+i)/4];
@@ -2338,8 +2338,8 @@ static void precopy_to_flash(running_machine *machine)
for (i=0;i<0x200000;i+=2)
{
- UINT8* ptr1 = intelflash_getmemptr(flashnum);
- UINT8* ptr2 = intelflash_getmemptr(flashnum+1);
+ UINT8* ptr1 = (UINT8*)intelflash_getmemptr(flashnum);
+ UINT8* ptr2 = (UINT8*)intelflash_getmemptr(flashnum+1);
UINT32 dat = romdata[(thebase+i)/2];
ptr1[BYTE_XOR_LE(i+1)] = (dat&0xff000000)>>24;
@@ -2364,10 +2364,10 @@ static void copy_from_nvram(running_machine *machine)
for (i=0;i<0x800000;i+=4)
{
UINT32 data;
- UINT8* ptr1 = intelflash_getmemptr(0);
- UINT8* ptr2 = intelflash_getmemptr(1);
- UINT8* ptr3 = intelflash_getmemptr(2);
- UINT8* ptr4 = intelflash_getmemptr(3);
+ UINT8* ptr1 = (UINT8*)intelflash_getmemptr(0);
+ UINT8* ptr2 = (UINT8*)intelflash_getmemptr(1);
+ UINT8* ptr3 = (UINT8*)intelflash_getmemptr(2);
+ UINT8* ptr4 = (UINT8*)intelflash_getmemptr(3);
data = ((ptr1[i/4]<<24) | (ptr2[i/4]<<16) | (ptr3[i/4]<<8) | (ptr4[i/4]<<0));
@@ -2383,10 +2383,10 @@ static void copy_from_nvram(running_machine *machine)
for (i=0;i<0x800000;i+=4)
{
UINT32 data;
- UINT8* ptr1 = intelflash_getmemptr(4);
- UINT8* ptr2 = intelflash_getmemptr(5);
- UINT8* ptr3 = intelflash_getmemptr(6);
- UINT8* ptr4 = intelflash_getmemptr(7);
+ UINT8* ptr1 = (UINT8*)intelflash_getmemptr(4);
+ UINT8* ptr2 = (UINT8*)intelflash_getmemptr(5);
+ UINT8* ptr3 = (UINT8*)intelflash_getmemptr(6);
+ UINT8* ptr4 = (UINT8*)intelflash_getmemptr(7);
data = ((ptr1[i/4]<<24) | (ptr2[i/4]<<16) | (ptr3[i/4]<<8) | (ptr4[i/4]<<0));
@@ -2408,8 +2408,8 @@ static void copy_from_nvram(running_machine *machine)
for (i=0;i<0x200000;i+=2)
{
- UINT8* ptr1 = intelflash_getmemptr(flashnum);
- UINT8* ptr2 = intelflash_getmemptr(flashnum+1);
+ UINT8* ptr1 = (UINT8*)intelflash_getmemptr(flashnum);
+ UINT8* ptr2 = (UINT8*)intelflash_getmemptr(flashnum+1);
UINT32 dat = (ptr1[i+0]<<8) |
(ptr1[i+1]<<24) |
(ptr2[i+0]<<0) |
@@ -2476,7 +2476,7 @@ static NVRAM_HANDLER( cps3 )
-static UINT32 cps3_dma_callback(UINT32 src, UINT32 dst, UINT32 data, int size)
+static int cps3_dma_callback(UINT32 src, UINT32 dst, UINT32 data, int size)
{
/*
on the actual CPS3 hardware the SH2 DMA bypasses the encryption.
@@ -2535,7 +2535,7 @@ static UINT32 cps3_dma_callback(UINT32 src, UINT32 dst, UINT32 data, int size)
static const sh2_cpu_core sh2_conf_cps3 = {
0, // master
- (void*)cps3_dma_callback
+ cps3_dma_callback
};
static MACHINE_DRIVER_START( cps3 )
diff --git a/src/mame/drivers/deco32.c b/src/mame/drivers/deco32.c
index b6118d26182..cd5e66e5b56 100644
--- a/src/mame/drivers/deco32.c
+++ b/src/mame/drivers/deco32.c
@@ -480,7 +480,7 @@ static WRITE32_HANDLER( tattass_control_w )
static int pendingCommand=0; /* 1 = read, 2 = write */
static int readBitCount=0;
static int byteAddr=0;
- UINT8 *eeprom=eeprom_get_data_pointer(NULL,NULL);
+ UINT8 *eeprom=(UINT8 *)eeprom_get_data_pointer(NULL,NULL);
/* Eprom in low byte */
if (mem_mask==0x000000ff) { /* Byte write to low byte only (different from word writing including low byte) */
diff --git a/src/mame/drivers/dkong.c b/src/mame/drivers/dkong.c
index ae470e3aaad..e35ae8f0740 100644
--- a/src/mame/drivers/dkong.c
+++ b/src/mame/drivers/dkong.c
@@ -390,7 +390,7 @@ static INTERRUPT_GEN( s2650_interrupt )
static MACHINE_START( dkong2b )
{
- dkong_state *state = machine->driver_data;
+ dkong_state *state = (dkong_state *)machine->driver_data;
state->hardware_type = HARDWARE_TKG04;
@@ -401,7 +401,7 @@ static MACHINE_START( dkong2b )
static MACHINE_START( s2650 )
{
- dkong_state *state = machine->driver_data;
+ dkong_state *state = (dkong_state *)machine->driver_data;
UINT8 *p = memory_region(machine, "user1");
const char *game_name = machine->gamedrv->name;
int i;
@@ -433,7 +433,7 @@ static MACHINE_START( s2650 )
static MACHINE_START( radarscp )
{
- dkong_state *state = machine->driver_data;
+ dkong_state *state = (dkong_state *)machine->driver_data;
MACHINE_START_CALL(dkong2b);
state->hardware_type = HARDWARE_TRS02;
@@ -441,7 +441,7 @@ static MACHINE_START( radarscp )
static MACHINE_START( radarsc1 )
{
- dkong_state *state = machine->driver_data;
+ dkong_state *state = (dkong_state *)machine->driver_data;
MACHINE_START_CALL(dkong2b);
state->hardware_type = HARDWARE_TRS01;
@@ -449,7 +449,7 @@ static MACHINE_START( radarsc1 )
static MACHINE_START( dkong3 )
{
- dkong_state *state = machine->driver_data;
+ dkong_state *state = (dkong_state *)machine->driver_data;
state->hardware_type = HARDWARE_TKG04;
}
@@ -461,7 +461,7 @@ static MACHINE_RESET( dkong )
static MACHINE_RESET( strtheat )
{
- dkong_state *state = machine->driver_data;
+ dkong_state *state = (dkong_state *)machine->driver_data;
UINT8 *ROM = memory_region(machine, "maincpu");
MACHINE_RESET_CALL(dkong);
@@ -474,7 +474,7 @@ static MACHINE_RESET( strtheat )
static MACHINE_RESET( drakton )
{
- dkong_state *state = machine->driver_data;
+ dkong_state *state = (dkong_state *)machine->driver_data;
UINT8 *ROM = memory_region(machine, "maincpu");
MACHINE_RESET_CALL(dkong);
@@ -507,7 +507,7 @@ static WRITE8_DEVICE_HANDLER( dk_dma_write_byte )
static READ8_DEVICE_HANDLER( hb_dma_read_byte )
{
const address_space *space = cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
- dkong_state *state = device->machine->driver_data;
+ dkong_state *state = (dkong_state *)device->machine->driver_data;
int bucket = state->rev_map[(offset>>10) & 0x1ff];
int addr;
@@ -522,7 +522,7 @@ static READ8_DEVICE_HANDLER( hb_dma_read_byte )
static WRITE8_DEVICE_HANDLER( hb_dma_write_byte )
{
const address_space *space = cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
- dkong_state *state = device->machine->driver_data;
+ dkong_state *state = (dkong_state *)device->machine->driver_data;
int bucket = state->rev_map[(offset>>10) & 0x1ff];
int addr;
@@ -536,13 +536,13 @@ static WRITE8_DEVICE_HANDLER( hb_dma_write_byte )
static READ8_DEVICE_HANDLER( p8257_ctl_r )
{
- dkong_state *state = device->machine->driver_data;
+ dkong_state *state = (dkong_state *)device->machine->driver_data;
return state->dma_latch;
}
static WRITE8_DEVICE_HANDLER( p8257_ctl_w )
{
- dkong_state *state = device->machine->driver_data;
+ dkong_state *state = (dkong_state *)device->machine->driver_data;
state->dma_latch = data;
}
@@ -606,7 +606,7 @@ static WRITE8_HANDLER( s2650_mirror_w )
static READ8_HANDLER( epos_decrypt_rom )
{
- dkong_state *state = space->machine->driver_data;
+ dkong_state *state = (dkong_state *)space->machine->driver_data;
if (offset & 0x01)
{
@@ -636,7 +636,7 @@ static READ8_HANDLER( epos_decrypt_rom )
static WRITE8_HANDLER( s2650_data_w )
{
- dkong_state *state = space->machine->driver_data;
+ dkong_state *state = (dkong_state *)space->machine->driver_data;
#if DEBUG_PROTECTION
logerror("write : pc = %04x, loopback = %02x\n",cpu_get_pc(space->cpu), data);
#endif
@@ -646,7 +646,7 @@ static WRITE8_HANDLER( s2650_data_w )
static READ8_HANDLER( s2650_port0_r )
{
- dkong_state *state = space->machine->driver_data;
+ dkong_state *state = (dkong_state *)space->machine->driver_data;
#if DEBUG_PROTECTION
logerror("port 0 : pc = %04x, loopback = %02x\n",cpu_get_pc(space->cpu), state->hunchloopback);
#endif
@@ -673,7 +673,7 @@ static READ8_HANDLER( s2650_port0_r )
static READ8_HANDLER( s2650_port1_r )
{
- dkong_state *state = space->machine->driver_data;
+ dkong_state *state = (dkong_state *)space->machine->driver_data;
#if DEBUG_PROTECTION
logerror("port 1 : pc = %04x, loopback = %02x\n",cpu_get_pc(space->cpu), state->hunchloopback);
#endif
diff --git a/src/mame/drivers/galaxian.c b/src/mame/drivers/galaxian.c
index 0f5e812e1fc..8a9af9ba340 100644
--- a/src/mame/drivers/galaxian.c
+++ b/src/mame/drivers/galaxian.c
@@ -842,7 +842,7 @@ static INPUT_CHANGED( gmgalax_game_changed )
static CUSTOM_INPUT( gmgalax_port_r )
{
- const char *portname = param;
+ const char *portname = (const char *)param;
if (gmgalax_selected_game != 0)
portname += strlen(portname) + 1;
return input_port_read(field->port->machine, portname);
diff --git a/src/mame/drivers/gameplan.c b/src/mame/drivers/gameplan.c
index d49718dab78..7e60ce1ddd8 100644
--- a/src/mame/drivers/gameplan.c
+++ b/src/mame/drivers/gameplan.c
@@ -91,7 +91,7 @@ TODO:
static WRITE8_DEVICE_HANDLER( io_select_w )
{
- gameplan_state *state = device->machine->driver_data;
+ gameplan_state *state = (gameplan_state *)device->machine->driver_data;
switch (data)
{
@@ -108,7 +108,7 @@ static WRITE8_DEVICE_HANDLER( io_select_w )
static READ8_DEVICE_HANDLER( io_port_r )
{
static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3", "DSW0", "DSW1" };
- gameplan_state *state = device->machine->driver_data;
+ gameplan_state *state = (gameplan_state *)device->machine->driver_data;
return input_port_read(device->machine, portnames[state->current_port]);
}
@@ -139,7 +139,7 @@ static const via6522_interface via_1_interface =
static WRITE8_DEVICE_HANDLER( audio_reset_w )
{
- gameplan_state *state = device->machine->driver_data;
+ gameplan_state *state = (gameplan_state *)device->machine->driver_data;
cpu_set_input_line(device->machine->cpu[1], INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE);
if (data == 0)
{
@@ -151,14 +151,14 @@ static WRITE8_DEVICE_HANDLER( audio_reset_w )
static WRITE8_DEVICE_HANDLER( audio_cmd_w )
{
- gameplan_state *state = device->machine->driver_data;
+ gameplan_state *state = (gameplan_state *)device->machine->driver_data;
riot6532_porta_in_set(state->riot, data, 0x7f);
}
static WRITE8_DEVICE_HANDLER( audio_trigger_w )
{
- gameplan_state *state = device->machine->driver_data;
+ gameplan_state *state = (gameplan_state *)device->machine->driver_data;
riot6532_porta_in_set(state->riot, data << 7, 0x80);
}
@@ -214,7 +214,7 @@ static const riot6532_interface r6532_interface =
static MACHINE_START( gameplan )
{
- gameplan_state *state = machine->driver_data;
+ gameplan_state *state = (gameplan_state *)machine->driver_data;
state->riot = devtag_get_device(machine, "riot");
diff --git a/src/mame/drivers/goldstar.c b/src/mame/drivers/goldstar.c
index ec969b8a238..f04ecd98ae1 100644
--- a/src/mame/drivers/goldstar.c
+++ b/src/mame/drivers/goldstar.c
@@ -7002,7 +7002,7 @@ static void do_blockswaps(UINT8* ROM)
0xa000, 0xa800, 0xb000, 0xb800,
};
- buffer = malloc(0x10000);
+ buffer = alloc_array_or_die(UINT8, 0x10000);
memcpy(buffer,ROM,0x10000);
// swap some 0x800 blocks around..
diff --git a/src/mame/drivers/gottlieb.c b/src/mame/drivers/gottlieb.c
index 0118d540264..17319440d1e 100644
--- a/src/mame/drivers/gottlieb.c
+++ b/src/mame/drivers/gottlieb.c
@@ -305,7 +305,7 @@ static MACHINE_RESET( gottlieb )
static CUSTOM_INPUT( analog_delta_r )
{
- const char *string = param;
+ const char *string = (const char *)param;
int which = string[0] - '0';
return input_port_read(field->port->machine, &string[1]) - track[which];
diff --git a/src/mame/drivers/grchamp.c b/src/mame/drivers/grchamp.c
index f26a0bbe376..690795b46cb 100644
--- a/src/mame/drivers/grchamp.c
+++ b/src/mame/drivers/grchamp.c
@@ -92,7 +92,7 @@ static MACHINE_RESET( grchamp )
static INTERRUPT_GEN( grchamp_cpu0_interrupt )
{
- grchamp_state *state = device->machine->driver_data;
+ grchamp_state *state = (grchamp_state *)device->machine->driver_data;
if (state->cpu0_out[0] & 0x01)
cpu_set_input_line(device, 0, ASSERT_LINE);
@@ -101,7 +101,7 @@ static INTERRUPT_GEN( grchamp_cpu0_interrupt )
static INTERRUPT_GEN( grchamp_cpu1_interrupt )
{
- grchamp_state *state = device->machine->driver_data;
+ grchamp_state *state = (grchamp_state *)device->machine->driver_data;
if (state->cpu1_out[4] & 0x01)
cpu_set_input_line(device, 0, ASSERT_LINE);
@@ -117,7 +117,7 @@ static INTERRUPT_GEN( grchamp_cpu1_interrupt )
static WRITE8_HANDLER( cpu0_outputs_w )
{
- grchamp_state *state = space->machine->driver_data;
+ grchamp_state *state = (grchamp_state *)space->machine->driver_data;
UINT8 diff = data ^ state->cpu0_out[offset];
state->cpu0_out[offset] = data;
@@ -201,7 +201,7 @@ static WRITE8_HANDLER( led_board_w )
{
static const UINT8 ls247_map[16] =
{ 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x58,0x4c,0x62,0x69,0x78,0x00 };
- grchamp_state *state = space->machine->driver_data;
+ grchamp_state *state = (grchamp_state *)space->machine->driver_data;
switch (offset)
{
@@ -245,7 +245,7 @@ static WRITE8_HANDLER( led_board_w )
static WRITE8_HANDLER( cpu1_outputs_w )
{
const device_config *discrete = devtag_get_device(space->machine, "discrete");
- grchamp_state *state = space->machine->driver_data;
+ grchamp_state *state = (grchamp_state *)space->machine->driver_data;
UINT8 diff = data ^ state->cpu1_out[offset];
state->cpu1_out[offset] = data;
@@ -354,28 +354,28 @@ INLINE UINT8 get_pc3259_bits(running_machine *machine, grchamp_state *state, int
static READ8_HANDLER( pc3259_0_r )
{
- grchamp_state *state = space->machine->driver_data;
+ grchamp_state *state = (grchamp_state *)space->machine->driver_data;
return get_pc3259_bits(space->machine, state, 0);
}
static READ8_HANDLER( pc3259_1_r )
{
- grchamp_state *state = space->machine->driver_data;
+ grchamp_state *state = (grchamp_state *)space->machine->driver_data;
return get_pc3259_bits(space->machine, state, 1);
}
static READ8_HANDLER( pc3259_2_r )
{
- grchamp_state *state = space->machine->driver_data;
+ grchamp_state *state = (grchamp_state *)space->machine->driver_data;
return get_pc3259_bits(space->machine, state, 2);
}
static READ8_HANDLER( pc3259_3_r )
{
- grchamp_state *state = space->machine->driver_data;
+ grchamp_state *state = (grchamp_state *)space->machine->driver_data;
return get_pc3259_bits(space->machine, state, 3);
}
@@ -389,14 +389,14 @@ static READ8_HANDLER( pc3259_3_r )
static READ8_HANDLER( sub_to_main_comm_r )
{
- grchamp_state *state = space->machine->driver_data;
+ grchamp_state *state = (grchamp_state *)space->machine->driver_data;
return state->comm_latch;
}
static TIMER_CALLBACK( main_to_sub_comm_sync_w )
{
- grchamp_state *state = machine->driver_data;
+ grchamp_state *state = (grchamp_state *)machine->driver_data;
int offset = param >> 8;
state->comm_latch2[offset & 3] = param;
}
@@ -410,7 +410,7 @@ static WRITE8_HANDLER( main_to_sub_comm_w )
static READ8_HANDLER( main_to_sub_comm_r )
{
- grchamp_state *state = space->machine->driver_data;
+ grchamp_state *state = (grchamp_state *)space->machine->driver_data;
return state->comm_latch2[offset];
}
diff --git a/src/mame/drivers/itech8.c b/src/mame/drivers/itech8.c
index 0b2e86bc845..471420bb213 100644
--- a/src/mame/drivers/itech8.c
+++ b/src/mame/drivers/itech8.c
@@ -1139,7 +1139,7 @@ INPUT_PORTS_END
static CUSTOM_INPUT( gtg_mux )
{
- const char *tag1 = param;
+ const char *tag1 = (const char *)param;
const char *tag2 = tag1 + strlen(tag1) + 1;
return input_port_read(field->port->machine, tag1) & input_port_read(field->port->machine, tag2);
}
diff --git a/src/mame/drivers/jchan.c b/src/mame/drivers/jchan.c
index 55b35550044..0f517835166 100644
--- a/src/mame/drivers/jchan.c
+++ b/src/mame/drivers/jchan.c
@@ -451,8 +451,6 @@ static READ16_HANDLER ( jchan_ctrl_r )
***************************************************************************/
/* communications - hacky! */
-static UINT16 *mainsub_shared_ram;
-
static WRITE16_HANDLER( main2sub_cmd_w )
{
COMBINE_DATA(&mainsub_shared_ram[0x03ffe/2]);
diff --git a/src/mame/drivers/jedi.c b/src/mame/drivers/jedi.c
index b25f8d5a9fa..257e4e6bb4e 100644
--- a/src/mame/drivers/jedi.c
+++ b/src/mame/drivers/jedi.c
@@ -124,7 +124,7 @@
static TIMER_CALLBACK( generate_interrupt )
{
- jedi_state *state = machine->driver_data;
+ jedi_state *state = (jedi_state *)machine->driver_data;
int scanline = param;
/* IRQ is set by /32V */
@@ -154,7 +154,7 @@ static WRITE8_HANDLER( main_irq_ack_w )
static MACHINE_START( jedi )
{
- jedi_state *state = machine->driver_data;
+ jedi_state *state = (jedi_state *)machine->driver_data;
/* set a timer to run the interrupts */
state->interrupt_timer = timer_alloc(machine, generate_interrupt, NULL);
@@ -177,7 +177,7 @@ static MACHINE_START( jedi )
static MACHINE_RESET( jedi )
{
- jedi_state *state = machine->driver_data;
+ jedi_state *state = (jedi_state *)machine->driver_data;
/* init globals */
state->a2d_select = 0;
@@ -209,7 +209,7 @@ static WRITE8_HANDLER( rom_banksel_w )
static READ8_HANDLER( a2d_data_r )
{
- jedi_state *state = space->machine->driver_data;
+ jedi_state *state = (jedi_state *)space->machine->driver_data;
UINT8 ret = 0;
switch (state->a2d_select)
@@ -224,7 +224,7 @@ static READ8_HANDLER( a2d_data_r )
static WRITE8_HANDLER( a2d_select_w )
{
- jedi_state *state = space->machine->driver_data;
+ jedi_state *state = (jedi_state *)space->machine->driver_data;
state->a2d_select = offset;
}
@@ -245,7 +245,7 @@ static WRITE8_HANDLER( jedi_coin_counter_w )
static WRITE8_HANDLER( nvram_data_w )
{
- jedi_state *state = space->machine->driver_data;
+ jedi_state *state = (jedi_state *)space->machine->driver_data;
if (state->nvram_enabled)
generic_nvram[offset] = data;
@@ -254,7 +254,7 @@ static WRITE8_HANDLER( nvram_data_w )
static WRITE8_HANDLER( nvram_enable_w )
{
- jedi_state *state = space->machine->driver_data;
+ jedi_state *state = (jedi_state *)space->machine->driver_data;
state->nvram_enabled = ~offset & 1;
}
diff --git a/src/mame/drivers/looping.c b/src/mame/drivers/looping.c
index 66340b00a08..a27d1364dd8 100644
--- a/src/mame/drivers/looping.c
+++ b/src/mame/drivers/looping.c
@@ -166,7 +166,7 @@ static PALETTE_INIT( looping )
static TILE_GET_INFO( get_tile_info )
{
- looping_state *state = machine->driver_data;
+ looping_state *state = (looping_state *)machine->driver_data;
int tile_number = state->videoram[tile_index];
int color = state->colorram[(tile_index & 0x1f) * 2 + 1] & 0x07;
SET_TILE_INFO(0, tile_number, color, 0);
@@ -175,7 +175,7 @@ static TILE_GET_INFO( get_tile_info )
static VIDEO_START( looping )
{
- looping_state *state = machine->driver_data;
+ looping_state *state = (looping_state *)machine->driver_data;
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8,8, 32,32);
@@ -192,7 +192,7 @@ static VIDEO_START( looping )
static WRITE8_HANDLER( flip_screen_x_w )
{
- looping_state *state = space->machine->driver_data;
+ looping_state *state = (looping_state *)space->machine->driver_data;
flip_screen_x_set(space->machine, ~data & 0x01);
tilemap_set_scrollx(state->bg_tilemap, 0, flip_screen_get(space->machine) ? 128 : 0);
}
@@ -200,7 +200,7 @@ static WRITE8_HANDLER( flip_screen_x_w )
static WRITE8_HANDLER( flip_screen_y_w )
{
- looping_state *state = space->machine->driver_data;
+ looping_state *state = (looping_state *)space->machine->driver_data;
flip_screen_y_set(space->machine, ~data & 0x01);
tilemap_set_scrollx(state->bg_tilemap, 0, flip_screen_get(space->machine) ? 128 : 0);
}
@@ -208,7 +208,7 @@ static WRITE8_HANDLER( flip_screen_y_w )
static WRITE8_HANDLER( looping_videoram_w )
{
- looping_state *state = space->machine->driver_data;
+ looping_state *state = (looping_state *)space->machine->driver_data;
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -216,7 +216,7 @@ static WRITE8_HANDLER( looping_videoram_w )
static WRITE8_HANDLER( looping_colorram_w )
{
- looping_state *state = space->machine->driver_data;
+ looping_state *state = (looping_state *)space->machine->driver_data;
int i;
state->colorram[offset] = data;
@@ -246,7 +246,7 @@ static WRITE8_HANDLER( looping_colorram_w )
static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
{
const UINT8 *source;
- looping_state *state = machine->driver_data;
+ looping_state *state = (looping_state *)machine->driver_data;
for (source = state->spriteram; source < state->spriteram + 0x40; source += 4)
{
@@ -276,7 +276,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
static VIDEO_UPDATE( looping )
{
- looping_state *state = screen->machine->driver_data;
+ looping_state *state = (looping_state *)screen->machine->driver_data;
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
draw_sprites(screen->machine, bitmap, cliprect);
@@ -293,7 +293,7 @@ static VIDEO_UPDATE( looping )
static MACHINE_START( looping )
{
- looping_state *state = machine->driver_data;
+ looping_state *state = (looping_state *)machine->driver_data;
state_save_register_global_array(machine, state->sound);
}
@@ -365,7 +365,7 @@ static WRITE8_DEVICE_HANDLER( looping_sound_sw )
0007 = AFA
*/
- looping_state *state = device->machine->driver_data;
+ looping_state *state = (looping_state *)device->machine->driver_data;
state->sound[offset + 1] = data ^ 1;
dac_data_w(device, ((state->sound[2] << 7) + (state->sound[3] << 6)) * state->sound[7]);
}
diff --git a/src/mame/drivers/lordgun.c b/src/mame/drivers/lordgun.c
index 9d57c63abe8..7b65016dbf2 100644
--- a/src/mame/drivers/lordgun.c
+++ b/src/mame/drivers/lordgun.c
@@ -32,34 +32,11 @@ To do:
#include "machine/eeprom.h"
#include "sound/3812intf.h"
#include "sound/okim6295.h"
+#include "lordgun.h"
-// Variables defined in video:
-extern UINT16 *lordgun_vram_0, *lordgun_scroll_x_0, *lordgun_scroll_y_0;
-extern UINT16 *lordgun_vram_1, *lordgun_scroll_x_1, *lordgun_scroll_y_1;
-extern UINT16 *lordgun_vram_2, *lordgun_scroll_x_2, *lordgun_scroll_y_2;
-extern UINT16 *lordgun_vram_3, *lordgun_scroll_x_3, *lordgun_scroll_y_3;
-extern UINT16 *lordgun_scrollram;
static UINT16 *lordgun_priority_ram, lordgun_priority;
-extern int lordgun_whitescreen;
-extern struct
-{
- int scr_x, scr_y;
- UINT16 hw_x, hw_y;
-} lordgun_gun[2];
-
-// Functions defined in video:
-
-WRITE16_HANDLER( lordgun_vram_0_w );
-WRITE16_HANDLER( lordgun_vram_1_w );
-WRITE16_HANDLER( lordgun_vram_2_w );
-WRITE16_HANDLER( lordgun_vram_3_w );
-
-void lordgun_update_gun(running_machine *machine, int i);
-
-VIDEO_START( lordgun );
-VIDEO_UPDATE( lordgun );
/***************************************************************************
diff --git a/src/mame/drivers/m10.c b/src/mame/drivers/m10.c
index 5fe0f10443d..c1fb4d6a574 100644
--- a/src/mame/drivers/m10.c
+++ b/src/mame/drivers/m10.c
@@ -191,7 +191,7 @@ static PALETTE_INIT( m10 )
static MACHINE_RESET( irem )
{
- m10_state *state = machine->driver_data;
+ m10_state *state = (m10_state *)machine->driver_data;
state_save_register_global(machine, state->bottomline);
state_save_register_global(machine, state->flip);
@@ -225,7 +225,7 @@ static MACHINE_RESET( irem )
static WRITE8_HANDLER( m10_ctrl_w )
{
const device_config *samples = devtag_get_device(space->machine, "samples");
- m10_state *state = space->machine->driver_data;
+ m10_state *state = (m10_state *)space->machine->driver_data;
#if DEBUG
if (data & 0x40)
@@ -302,7 +302,7 @@ static WRITE8_HANDLER( m10_ctrl_w )
static WRITE8_HANDLER( m11_ctrl_w )
{
- m10_state *state = space->machine->driver_data;
+ m10_state *state = (m10_state *)space->machine->driver_data;
#if DEBUG
if (data & 0x4C)
@@ -335,7 +335,7 @@ static WRITE8_HANDLER( m11_ctrl_w )
static WRITE8_HANDLER( m15_ctrl_w )
{
- m10_state *state = space->machine->driver_data;
+ m10_state *state = (m10_state *)space->machine->driver_data;
#if DEBUG
if (data & 0xF0)
@@ -916,7 +916,7 @@ MACHINE_DRIVER_END
static DRIVER_INIT( andromed )
{
int i;
- m10_state *state = machine->driver_data;
+ m10_state *state = (m10_state *)machine->driver_data;
for (i=0x1c00;i<0x2000;i++)
state->rom[i]=0x60;
@@ -925,7 +925,7 @@ static DRIVER_INIT( andromed )
static DRIVER_INIT( ipminva1 )
{
int i;
- m10_state *state = machine->driver_data;
+ m10_state *state = (m10_state *)machine->driver_data;
for (i=0x1400;i<0x17ff;i++)
state->rom[i]=0x60;
diff --git a/src/mame/drivers/m72.c b/src/mame/drivers/m72.c
index 49c43b808db..4934c62d483 100644
--- a/src/mame/drivers/m72.c
+++ b/src/mame/drivers/m72.c
@@ -190,7 +190,7 @@ static TIMER_CALLBACK( delayed_ram16_w )
{
UINT16 val = ((UINT32) param) & 0xffff;
UINT16 offset = (((UINT32) param) >> 16) & 0xffff;
- UINT16 *ram = ptr;
+ UINT16 *ram = (UINT16 *)ptr;
ram[offset] = val;
}
diff --git a/src/mame/drivers/maygayv1.c b/src/mame/drivers/maygayv1.c
index ce5c8568d17..5db41c830d8 100644
--- a/src/mame/drivers/maygayv1.c
+++ b/src/mame/drivers/maygayv1.c
@@ -702,7 +702,7 @@ static READ8_HANDLER( mcu_r )
return 0;
}
- case 3: upd7759_busy_r(0) ? 0 : 0x08;
+ case 3: return upd7759_busy_r(0) ? 0 : 0x08;
}
return 0;
}
diff --git a/src/mame/drivers/midzeus.c b/src/mame/drivers/midzeus.c
index 56b12584045..20f7131e01a 100644
--- a/src/mame/drivers/midzeus.c
+++ b/src/mame/drivers/midzeus.c
@@ -441,7 +441,7 @@ static WRITE32_HANDLER( tms32031_control_w )
static CUSTOM_INPUT( custom_49way_r )
{
static const UINT8 translate49[7] = { 0x8, 0xc, 0xe, 0xf, 0x3, 0x1, 0x0 };
- const char *namex = param;
+ const char *namex = (const char *)param;
const char *namey = namex + strlen(namex) + 1;
return (translate49[input_port_read(field->port->machine, namey) >> 4] << 4) | translate49[input_port_read(field->port->machine, namex) >> 4];
}
@@ -456,7 +456,7 @@ static WRITE32_HANDLER( keypad_select_w )
static CUSTOM_INPUT( keypad_r )
{
- UINT32 bits = input_port_read(field->port->machine, param);
+ UINT32 bits = input_port_read(field->port->machine, (const char *)param);
UINT8 select = keypad_select;
while ((select & 1) != 0)
{
diff --git a/src/mame/drivers/mjkjidai.c b/src/mame/drivers/mjkjidai.c
index 7e9d2885fd9..22c1037d144 100644
--- a/src/mame/drivers/mjkjidai.c
+++ b/src/mame/drivers/mjkjidai.c
@@ -48,7 +48,7 @@ static struct mjkjidai_adpcm_state
static STREAM_UPDATE( mjkjidai_adpcm_callback )
{
- struct mjkjidai_adpcm_state *state = param;
+ struct mjkjidai_adpcm_state *state = (struct mjkjidai_adpcm_state *)param;
stream_sample_t *dest = outputs[0];
while (state->playing && samples > 0)
diff --git a/src/mame/drivers/mystston.c b/src/mame/drivers/mystston.c
index 645824fe3da..ce02f87a5c4 100644
--- a/src/mame/drivers/mystston.c
+++ b/src/mame/drivers/mystston.c
@@ -72,7 +72,7 @@ static INPUT_CHANGED( coin_inserted )
static WRITE8_HANDLER( mystston_ay8910_select_w )
{
- mystston_state *state = space->machine->driver_data;
+ mystston_state *state = (mystston_state *)space->machine->driver_data;
/* bit 5 goes to 8910 #0 BDIR pin */
if (((*state->ay8910_select & 0x20) == 0x20) && ((data & 0x20) == 0x00))
diff --git a/src/mame/drivers/namcoic.c b/src/mame/drivers/namcoic.c
index 6e3f0e07714..70875d5ad3d 100644
--- a/src/mame/drivers/namcoic.c
+++ b/src/mame/drivers/namcoic.c
@@ -57,7 +57,7 @@ namco_tilemap_init( running_machine *machine, int gfxbank, void *maskBaseAddr,
{
int i;
mTilemapInfo.gfxbank = gfxbank;
- mTilemapInfo.maskBaseAddr = maskBaseAddr;
+ mTilemapInfo.maskBaseAddr = (UINT8 *)maskBaseAddr;
mTilemapInfo.cb = cb;
mTilemapInfo.videoram = auto_alloc_array(machine, UINT16, 0x10000 );
@@ -1603,7 +1603,7 @@ namco_road_set_transparent_color(pen_t pen)
void
namco_road_draw(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int pri )
{
- const UINT8 *clut = (void *)memory_region(machine, "user3");
+ const UINT8 *clut = (const UINT8 *)memory_region(machine, "user3");
bitmap_t *pSourceBitmap;
unsigned yscroll;
int i;
diff --git a/src/mame/drivers/naomi.c b/src/mame/drivers/naomi.c
index 01b7e75e767..80862544c69 100644
--- a/src/mame/drivers/naomi.c
+++ b/src/mame/drivers/naomi.c
@@ -687,7 +687,7 @@ static NVRAM_HANDLER( naomi_eeproms )
UINT8 *dat;
UINT8* jvseeprom_default = NULL;
- dat = eeprom_get_data_pointer(&length, &size);
+ dat = (UINT8 *)eeprom_get_data_pointer(&length, &size);
memset(dat, 0, length * size);
// mainboard eeprom?
diff --git a/src/mame/drivers/peplus.c b/src/mame/drivers/peplus.c
index 198869facea..a96ba03a225 100644
--- a/src/mame/drivers/peplus.c
+++ b/src/mame/drivers/peplus.c
@@ -791,7 +791,7 @@ ADDRESS_MAP_END
static CUSTOM_INPUT( peplus_input_r )
{
UINT8 inp_ret = 0x00;
- UINT8 inp_read = input_port_read(field->port->machine, param);
+ UINT8 inp_read = input_port_read(field->port->machine, (const char *)param);
if (inp_read & 0x01) inp_ret = 0x01;
if (inp_read & 0x02) inp_ret = 0x02;
diff --git a/src/mame/drivers/pntnpuzl.c b/src/mame/drivers/pntnpuzl.c
index 4bd142dd00e..312ca2d5899 100644
--- a/src/mame/drivers/pntnpuzl.c
+++ b/src/mame/drivers/pntnpuzl.c
@@ -151,7 +151,7 @@ static NVRAM_HANDLER( pntnpuzl )
UINT32 length, size;
UINT8 *dat;
- dat = eeprom_get_data_pointer(&length, &size);
+ dat = (UINT8 *)eeprom_get_data_pointer(&length, &size);
memset(dat, 0, length * size);
}
}
diff --git a/src/mame/drivers/psikyo.c b/src/mame/drivers/psikyo.c
index da37ba97bb5..8dec377b61e 100644
--- a/src/mame/drivers/psikyo.c
+++ b/src/mame/drivers/psikyo.c
@@ -211,7 +211,7 @@ static const UINT8 s1945j_table[256] = {
};
static UINT8 s1945_mcu_direction, s1945_mcu_latch1, s1945_mcu_latch2, s1945_mcu_inlatch, s1945_mcu_index;
-static UINT8 s1945_mcu_latching, s1945_mcu_mode, s1945_mcu_direction, s1945_mcu_control, s1945_mcu_bctrl;
+static UINT8 s1945_mcu_latching, s1945_mcu_mode, s1945_mcu_control, s1945_mcu_bctrl;
static const UINT8 *s1945_mcu_table;
static void s1945_mcu_init(const UINT8 *mcu_table)
diff --git a/src/mame/drivers/psikyo4.c b/src/mame/drivers/psikyo4.c
index 47e824cf047..60f05fc03f5 100644
--- a/src/mame/drivers/psikyo4.c
+++ b/src/mame/drivers/psikyo4.c
@@ -191,7 +191,7 @@ static NVRAM_HANDLER(93C56)
UINT32 length, size;
UINT8 *dat;
- dat = eeprom_get_data_pointer(&length, &size);
+ dat = (UINT8 *)eeprom_get_data_pointer(&length, &size);
memset(dat, 0, length * size);
}
}
diff --git a/src/mame/drivers/psikyosh.c b/src/mame/drivers/psikyosh.c
index a13127bee16..444983187da 100644
--- a/src/mame/drivers/psikyosh.c
+++ b/src/mame/drivers/psikyosh.c
@@ -349,7 +349,7 @@ static NVRAM_HANDLER(93C56)
UINT32 length, size;
UINT8 *dat;
- dat = eeprom_get_data_pointer(&length, &size);
+ dat = (UINT8 *)eeprom_get_data_pointer(&length, &size);
memset(dat, 0, length * size);
if (use_factory_eeprom!=eeprom_0) /* Set the EEPROM to Factory Defaults for games needing them*/
diff --git a/src/mame/drivers/qdrmfgp.c b/src/mame/drivers/qdrmfgp.c
index 01eb9b164ef..79eb07e7531 100644
--- a/src/mame/drivers/qdrmfgp.c
+++ b/src/mame/drivers/qdrmfgp.c
@@ -46,7 +46,7 @@ static INT32 gp2_irq_control;
static CUSTOM_INPUT( inputs_r )
{
- const char *tag1 = param;
+ const char *tag1 = (const char *)param;
const char *tag2 = tag1 + strlen(tag1) + 1;
return input_port_read(field->port->machine, (control & 0x0080) ? tag1 : tag2);
}
diff --git a/src/mame/drivers/qix.c b/src/mame/drivers/qix.c
index 90d07157d03..58d4af9340d 100644
--- a/src/mame/drivers/qix.c
+++ b/src/mame/drivers/qix.c
@@ -1188,23 +1188,23 @@ static int kram3_permut1(int idx, int value)
static int kram3_permut2(int tbl_index, int idx, const UINT8 *xor_table)
{
- int xor = 0;
+ int xorval = 0;
if (idx == 0 || idx == 3)
{
- xor = xor_table[tbl_index];
+ xorval = xor_table[tbl_index];
// handle missing values in table
- if (xor == 99)
- return xor;
+ if (xorval == 99)
+ return xorval;
}
- xor ^= 0x02;
+ xorval ^= 0x02;
if (idx == 3)
- xor = BITSWAP8(xor, 7,6,5,4, 0,2,3,1);
+ xorval = BITSWAP8(xorval, 7,6,5,4, 0,2,3,1);
- return xor;
+ return xorval;
}
static int kram3_decrypt(int address, int value)
diff --git a/src/mame/drivers/quizpun2.c b/src/mame/drivers/quizpun2.c
index b2741e1fc18..014be1e5bad 100644
--- a/src/mame/drivers/quizpun2.c
+++ b/src/mame/drivers/quizpun2.c
@@ -119,8 +119,9 @@ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
***************************************************************************/
+typedef enum { STATE_IDLE = 0, STATE_ADDR_R, STATE_ROM_R, STATE_EEPROM_R, STATE_EEPROM_W } prot_state;
static struct {
- enum { STATE_IDLE = 0, STATE_ADDR_R, STATE_ROM_R, STATE_EEPROM_R, STATE_EEPROM_W } state;
+ prot_state state;
int wait_param;
int param;
int cmd;
diff --git a/src/mame/drivers/renegade.c b/src/mame/drivers/renegade.c
index 43828dd10a1..de17f3236a1 100644
--- a/src/mame/drivers/renegade.c
+++ b/src/mame/drivers/renegade.c
@@ -139,7 +139,7 @@ static struct renegade_adpcm_state
static STREAM_UPDATE( renegade_adpcm_callback )
{
- struct renegade_adpcm_state *state = param;
+ struct renegade_adpcm_state *state = (struct renegade_adpcm_state *)param;
stream_sample_t *dest = outputs[0];
while (state->playing && samples > 0)
diff --git a/src/mame/drivers/segae.c b/src/mame/drivers/segae.c
index 01509a39c85..2490ba2d1d5 100644
--- a/src/mame/drivers/segae.c
+++ b/src/mame/drivers/segae.c
@@ -1273,7 +1273,7 @@ static TIMER_CALLBACK( sms_scanline_timer_callback )
The position to get the H position also has to compensate for a few errors
*/
// printf("num %d\n",num );
- struct sms_vdp *chip = ptr;
+ struct sms_vdp *chip = (struct sms_vdp *)ptr;
if (chip->sms_scanline_counter<(chip->sms_total_scanlines-1))
{
@@ -2206,7 +2206,7 @@ static void init_systeme_map(running_machine *machine)
void init_for_megadrive(running_machine *machine)
{
- md_sms_vdp = start_vdp(machine, GEN_VDP);
+ md_sms_vdp = (struct sms_vdp *)start_vdp(machine, GEN_VDP);
md_sms_vdp->set_irq = sms_vdp_cpu1_irq_callback;
md_sms_vdp->is_pal = 0;
md_sms_vdp->sms_total_scanlines = 262;
@@ -2220,7 +2220,7 @@ DRIVER_INIT( megatech_bios )
{
// init_systeme_map(machine);
- vdp1 = start_vdp(machine, SMS2_VDP);
+ vdp1 = (struct sms_vdp *)start_vdp(machine, SMS2_VDP);
vdp1->set_irq = sms_vdp_cpu2_irq_callback;
vdp1->is_pal = 0;
vdp1->sms_total_scanlines = 262;
@@ -2235,7 +2235,7 @@ static DRIVER_INIT( segasyse )
{
init_systeme_map(machine);
- vdp1 = start_vdp(machine, SMS2_VDP);
+ vdp1 = (struct sms_vdp *)start_vdp(machine, SMS2_VDP);
// vdp1->set_irq = sms_vdp_cpu0_irq_callback;
vdp1->is_pal = 0;
vdp1->sms_total_scanlines = 262;
@@ -2246,7 +2246,7 @@ static DRIVER_INIT( segasyse )
vdp1_vram_bank1 = auto_alloc_array(machine, UINT8, 0x4000);
- vdp2 = start_vdp(machine, SMS2_VDP);
+ vdp2 = (struct sms_vdp *)start_vdp(machine, SMS2_VDP);
vdp2->set_irq = sms_vdp_cpu0_irq_callback;
vdp2->is_pal = 0;
vdp2->sms_total_scanlines = 262;
diff --git a/src/mame/drivers/segaorun.c b/src/mame/drivers/segaorun.c
index c1552ec2a2e..6194e7deebf 100644
--- a/src/mame/drivers/segaorun.c
+++ b/src/mame/drivers/segaorun.c
@@ -97,17 +97,17 @@ static const ppi8255_interface single_ppi_intf =
static const segaic16_memory_map_entry outrun_info[] =
{
- { 0x35/2, 0x90000, 0x10000, 0xf00000, ~0, segaic16_road_control_0_r, segaic16_road_control_0_w, NULL, "road control" },
- { 0x35/2, 0x80000, 0x01000, 0xf0f000, ~0, SMH_BANK(10), SMH_BANK(10), &segaic16_roadram_0, "road RAM" },
- { 0x35/2, 0x60000, 0x08000, 0xf18000, ~0, SMH_BANK(11), SMH_BANK(11), &cpu1ram, "CPU 1 RAM" },
- { 0x35/2, 0x00000, 0x60000, 0xf00000, ~0, SMH_BANK(12), SMH_UNMAP, &cpu1rom, "CPU 1 ROM" },
- { 0x31/2, 0x00000, 0x04000, 0xffc000, ~0, misc_io_r, misc_io_w, NULL, "I/O space" },
- { 0x2d/2, 0x00000, 0x01000, 0xfff000, ~0, SMH_BANK(13), SMH_BANK(13), &segaic16_spriteram_0, "object RAM" },
- { 0x29/2, 0x00000, 0x02000, 0xffe000, ~0, SMH_BANK(14), segaic16_paletteram_w, &paletteram16, "color RAM" },
- { 0x25/2, 0x00000, 0x10000, 0xfe0000, ~0, SMH_BANK(15), segaic16_tileram_0_w, &segaic16_tileram_0, "tile RAM" },
- { 0x25/2, 0x10000, 0x01000, 0xfef000, ~0, SMH_BANK(16), segaic16_textram_0_w, &segaic16_textram_0, "text RAM" },
- { 0x21/2, 0x60000, 0x08000, 0xf98000, ~0, SMH_BANK(17), SMH_BANK(17), &workram, "CPU 0 RAM" },
- { 0x21/2, 0x00000, 0x60000, 0xf80000, 0x00000, SMH_BANK(18), SMH_UNMAP, NULL, "CPU 0 ROM" },
+ { 0x35/2, 0x90000, 0x10000, 0xf00000, ~0, segaic16_road_control_0_r, segaic16_road_control_0_w, NULL, "road control" },
+ { 0x35/2, 0x80000, 0x01000, 0xf0f000, ~0, (read16_space_func)SMH_BANK(10), (write16_space_func)SMH_BANK(10), &segaic16_roadram_0, "road RAM" },
+ { 0x35/2, 0x60000, 0x08000, 0xf18000, ~0, (read16_space_func)SMH_BANK(11), (write16_space_func)SMH_BANK(11), &cpu1ram, "CPU 1 RAM" },
+ { 0x35/2, 0x00000, 0x60000, 0xf00000, ~0, (read16_space_func)SMH_BANK(12), (write16_space_func)SMH_UNMAP, &cpu1rom, "CPU 1 ROM" },
+ { 0x31/2, 0x00000, 0x04000, 0xffc000, ~0, misc_io_r, misc_io_w, NULL, "I/O space" },
+ { 0x2d/2, 0x00000, 0x01000, 0xfff000, ~0, (read16_space_func)SMH_BANK(13), (write16_space_func)SMH_BANK(13), &segaic16_spriteram_0, "object RAM" },
+ { 0x29/2, 0x00000, 0x02000, 0xffe000, ~0, (read16_space_func)SMH_BANK(14), segaic16_paletteram_w, &paletteram16, "color RAM" },
+ { 0x25/2, 0x00000, 0x10000, 0xfe0000, ~0, (read16_space_func)SMH_BANK(15), segaic16_tileram_0_w, &segaic16_tileram_0, "tile RAM" },
+ { 0x25/2, 0x10000, 0x01000, 0xfef000, ~0, (read16_space_func)SMH_BANK(16), segaic16_textram_0_w, &segaic16_textram_0, "text RAM" },
+ { 0x21/2, 0x60000, 0x08000, 0xf98000, ~0, (read16_space_func)SMH_BANK(17), (write16_space_func)SMH_BANK(17), &workram, "CPU 0 RAM" },
+ { 0x21/2, 0x00000, 0x60000, 0xf80000, 0x00000, (read16_space_func)SMH_BANK(18), (write16_space_func)SMH_UNMAP, NULL, "CPU 0 ROM" },
{ 0 }
};
diff --git a/src/mame/drivers/segas16b.c b/src/mame/drivers/segas16b.c
index c1e2b8789d0..2be32981ba4 100644
--- a/src/mame/drivers/segas16b.c
+++ b/src/mame/drivers/segas16b.c
@@ -950,71 +950,71 @@ static WRITE16_HANDLER( atomicp_sound_w );
static const segaic16_memory_map_entry rom_171_5358_info_small[] =
{
- { 0x3d/2, 0x00000, 0x04000, 0xffc000, ~0, misc_io_r, misc_io_w, NULL, "I/O space" },
- { 0x39/2, 0x00000, 0x01000, 0xfff000, ~0, SMH_BANK(10), segaic16_paletteram_w, &paletteram16, "color RAM" },
- { 0x35/2, 0x00000, 0x10000, 0xfe0000, ~0, SMH_BANK(11), segaic16_tileram_0_w, &segaic16_tileram_0, "tile RAM" },
- { 0x35/2, 0x10000, 0x01000, 0xfef000, ~0, SMH_BANK(12), segaic16_textram_0_w, &segaic16_textram_0, "text RAM" },
- { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, SMH_BANK(13), SMH_BANK(13), &segaic16_spriteram_0, "object RAM" },
- { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, SMH_BANK(14), SMH_BANK(14), &workram, "work RAM" },
- { 0x29/2, 0x00000, 0x20000, 0xfe0000, 0x20000, SMH_BANK(15), SMH_UNMAP, NULL, "ROM 2" },
- { 0x25/2, 0x00000, 0x20000, 0xfe0000, 0x10000, SMH_BANK(16), SMH_UNMAP, NULL, "ROM 1" },
- { 0x21/2, 0x00000, 0x20000, 0xfe0000, 0x00000, SMH_BANK(17), SMH_UNMAP, NULL, "ROM 0" },
+ { 0x3d/2, 0x00000, 0x04000, 0xffc000, ~0, misc_io_r, misc_io_w, NULL, "I/O space" },
+ { 0x39/2, 0x00000, 0x01000, 0xfff000, ~0, (read16_space_func)SMH_BANK(10), segaic16_paletteram_w, &paletteram16, "color RAM" },
+ { 0x35/2, 0x00000, 0x10000, 0xfe0000, ~0, (read16_space_func)SMH_BANK(11), segaic16_tileram_0_w, &segaic16_tileram_0, "tile RAM" },
+ { 0x35/2, 0x10000, 0x01000, 0xfef000, ~0, (read16_space_func)SMH_BANK(12), segaic16_textram_0_w, &segaic16_textram_0, "text RAM" },
+ { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, (read16_space_func)SMH_BANK(13), (write16_space_func)SMH_BANK(13), &segaic16_spriteram_0, "object RAM" },
+ { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, (read16_space_func)SMH_BANK(14), (write16_space_func)SMH_BANK(14), &workram, "work RAM" },
+ { 0x29/2, 0x00000, 0x20000, 0xfe0000, 0x20000, (read16_space_func)SMH_BANK(15), (write16_space_func)SMH_UNMAP, NULL, "ROM 2" },
+ { 0x25/2, 0x00000, 0x20000, 0xfe0000, 0x10000, (read16_space_func)SMH_BANK(16), (write16_space_func)SMH_UNMAP, NULL, "ROM 1" },
+ { 0x21/2, 0x00000, 0x20000, 0xfe0000, 0x00000, (read16_space_func)SMH_BANK(17), (write16_space_func)SMH_UNMAP, NULL, "ROM 0" },
{ 0 }
};
static const segaic16_memory_map_entry rom_171_5358_info[] =
{
- { 0x3d/2, 0x00000, 0x04000, 0xffc000, ~0, misc_io_r, misc_io_w, NULL, "I/O space" },
- { 0x39/2, 0x00000, 0x01000, 0xfff000, ~0, SMH_BANK(10), segaic16_paletteram_w, &paletteram16, "color RAM" },
- { 0x35/2, 0x00000, 0x10000, 0xfe0000, ~0, SMH_BANK(11), segaic16_tileram_0_w, &segaic16_tileram_0, "tile RAM" },
- { 0x35/2, 0x10000, 0x01000, 0xfef000, ~0, SMH_BANK(12), segaic16_textram_0_w, &segaic16_textram_0, "text RAM" },
- { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, SMH_BANK(13), SMH_BANK(13), &segaic16_spriteram_0, "object RAM" },
- { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, SMH_BANK(14), SMH_BANK(14), &workram, "work RAM" },
- { 0x29/2, 0x00000, 0x20000, 0xfe0000, 0x40000, SMH_BANK(15), SMH_UNMAP, NULL, "ROM 2" },
- { 0x25/2, 0x00000, 0x20000, 0xfe0000, 0x20000, SMH_BANK(16), SMH_UNMAP, NULL, "ROM 1" },
- { 0x21/2, 0x00000, 0x20000, 0xfe0000, 0x00000, SMH_BANK(17), SMH_UNMAP, NULL, "ROM 0" },
+ { 0x3d/2, 0x00000, 0x04000, 0xffc000, ~0, misc_io_r, misc_io_w, NULL, "I/O space" },
+ { 0x39/2, 0x00000, 0x01000, 0xfff000, ~0, (read16_space_func)SMH_BANK(10), segaic16_paletteram_w, &paletteram16, "color RAM" },
+ { 0x35/2, 0x00000, 0x10000, 0xfe0000, ~0, (read16_space_func)SMH_BANK(11), segaic16_tileram_0_w, &segaic16_tileram_0, "tile RAM" },
+ { 0x35/2, 0x10000, 0x01000, 0xfef000, ~0, (read16_space_func)SMH_BANK(12), segaic16_textram_0_w, &segaic16_textram_0, "text RAM" },
+ { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, (read16_space_func)SMH_BANK(13), (write16_space_func)SMH_BANK(13), &segaic16_spriteram_0, "object RAM" },
+ { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, (read16_space_func)SMH_BANK(14), (write16_space_func)SMH_BANK(14), &workram, "work RAM" },
+ { 0x29/2, 0x00000, 0x20000, 0xfe0000, 0x40000, (read16_space_func)SMH_BANK(15), (write16_space_func)SMH_UNMAP, NULL, "ROM 2" },
+ { 0x25/2, 0x00000, 0x20000, 0xfe0000, 0x20000, (read16_space_func)SMH_BANK(16), (write16_space_func)SMH_UNMAP, NULL, "ROM 1" },
+ { 0x21/2, 0x00000, 0x20000, 0xfe0000, 0x00000, (read16_space_func)SMH_BANK(17), (write16_space_func)SMH_UNMAP, NULL, "ROM 0" },
{ 0 }
};
static const segaic16_memory_map_entry rom_171_5704_info[] =
{
- { 0x3d/2, 0x00000, 0x04000, 0xffc000, ~0, misc_io_r, misc_io_w, NULL, "I/O space" },
- { 0x39/2, 0x00000, 0x01000, 0xfff000, ~0, SMH_BANK(10), segaic16_paletteram_w, &paletteram16, "color RAM" },
- { 0x35/2, 0x00000, 0x10000, 0xfe0000, ~0, SMH_BANK(11), segaic16_tileram_0_w, &segaic16_tileram_0, "tile RAM" },
- { 0x35/2, 0x10000, 0x01000, 0xfef000, ~0, SMH_BANK(12), segaic16_textram_0_w, &segaic16_textram_0, "text RAM" },
- { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, SMH_BANK(13), SMH_BANK(13), &segaic16_spriteram_0, "object RAM" },
- { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, SMH_BANK(14), SMH_BANK(14), &workram, "work RAM" },
- { 0x29/2, 0x00000, 0x10000, 0xff0000, ~0, NULL, rom_5704_bank_w, NULL, "tile bank" },
- { 0x25/2, 0x00000, 0x80000, 0xfc0000, 0x80000, SMH_BANK(16), SMH_UNMAP, NULL, "ROM 1" },
- { 0x21/2, 0x00000, 0x80000, 0xfc0000, 0x00000, SMH_BANK(17), SMH_UNMAP, NULL, "ROM 0" },
+ { 0x3d/2, 0x00000, 0x04000, 0xffc000, ~0, misc_io_r, misc_io_w, NULL, "I/O space" },
+ { 0x39/2, 0x00000, 0x01000, 0xfff000, ~0, (read16_space_func)SMH_BANK(10), segaic16_paletteram_w, &paletteram16, "color RAM" },
+ { 0x35/2, 0x00000, 0x10000, 0xfe0000, ~0, (read16_space_func)SMH_BANK(11), segaic16_tileram_0_w, &segaic16_tileram_0, "tile RAM" },
+ { 0x35/2, 0x10000, 0x01000, 0xfef000, ~0, (read16_space_func)SMH_BANK(12), segaic16_textram_0_w, &segaic16_textram_0, "text RAM" },
+ { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, (read16_space_func)SMH_BANK(13), (write16_space_func)SMH_BANK(13), &segaic16_spriteram_0, "object RAM" },
+ { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, (read16_space_func)SMH_BANK(14), (write16_space_func)SMH_BANK(14), &workram, "work RAM" },
+ { 0x29/2, 0x00000, 0x10000, 0xff0000, ~0, NULL, rom_5704_bank_w, NULL, "tile bank" },
+ { 0x25/2, 0x00000, 0x80000, 0xfc0000, 0x80000, (read16_space_func)SMH_BANK(16), (write16_space_func)SMH_UNMAP, NULL, "ROM 1" },
+ { 0x21/2, 0x00000, 0x80000, 0xfc0000, 0x00000, (read16_space_func)SMH_BANK(17), (write16_space_func)SMH_UNMAP, NULL, "ROM 0" },
{ 0 }
};
static const segaic16_memory_map_entry rom_atomicp_info[] =
{
- { 0x3d/2, 0x00000, 0x04000, 0xffc000, ~0, misc_io_r, misc_io_w, NULL, "I/O space" },
- { 0x39/2, 0x00000, 0x01000, 0xfff000, ~0, SMH_BANK(10), segaic16_paletteram_w, &paletteram16, "color RAM" },
- { 0x35/2, 0x00000, 0x10000, 0xfe0000, ~0, SMH_BANK(11), segaic16_tileram_0_w, &segaic16_tileram_0, "tile RAM" },
- { 0x35/2, 0x10000, 0x01000, 0xfef000, ~0, SMH_BANK(12), segaic16_textram_0_w, &segaic16_textram_0, "text RAM" },
- { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, SMH_BANK(13), SMH_BANK(13), &segaic16_spriteram_0, "object RAM" },
- { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, SMH_BANK(14), SMH_BANK(14), &workram, "work RAM" },
- { 0x29/2, 0x00000, 0x10000, 0xff0000, ~0, NULL, rom_5704_bank_w, NULL, "tile bank" },
- { 0x25/2, 0x00000, 0x10000, 0xff0000, ~0, NULL, atomicp_sound_w, NULL, "sound" },
- { 0x21/2, 0x00000, 0x80000, 0xfc0000, 0x00000, SMH_BANK(17), SMH_UNMAP, NULL, "ROM 0" },
+ { 0x3d/2, 0x00000, 0x04000, 0xffc000, ~0, misc_io_r, misc_io_w, NULL, "I/O space" },
+ { 0x39/2, 0x00000, 0x01000, 0xfff000, ~0, (read16_space_func)SMH_BANK(10), segaic16_paletteram_w, &paletteram16, "color RAM" },
+ { 0x35/2, 0x00000, 0x10000, 0xfe0000, ~0, (read16_space_func)SMH_BANK(11), segaic16_tileram_0_w, &segaic16_tileram_0, "tile RAM" },
+ { 0x35/2, 0x10000, 0x01000, 0xfef000, ~0, (read16_space_func)SMH_BANK(12), segaic16_textram_0_w, &segaic16_textram_0, "text RAM" },
+ { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, (read16_space_func)SMH_BANK(13), (write16_space_func)SMH_BANK(13), &segaic16_spriteram_0, "object RAM" },
+ { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, (read16_space_func)SMH_BANK(14), (write16_space_func)SMH_BANK(14), &workram, "work RAM" },
+ { 0x29/2, 0x00000, 0x10000, 0xff0000, ~0, NULL, rom_5704_bank_w, NULL, "tile bank" },
+ { 0x25/2, 0x00000, 0x10000, 0xff0000, ~0, NULL, atomicp_sound_w, NULL, "sound" },
+ { 0x21/2, 0x00000, 0x80000, 0xfc0000, 0x00000, (read16_space_func)SMH_BANK(17), (write16_space_func)SMH_UNMAP, NULL, "ROM 0" },
{ 0 }
};
static const segaic16_memory_map_entry rom_171_5797_info[] =
{
- { 0x3d/2, 0x00000, 0x04000, 0xffc000, ~0, misc_io_r, misc_io_w, NULL, "I/O space" },
- { 0x39/2, 0x00000, 0x01000, 0xfff000, ~0, SMH_BANK(10), segaic16_paletteram_w, &paletteram16, "color RAM" },
- { 0x35/2, 0x00000, 0x10000, 0xfe0000, ~0, SMH_BANK(11), segaic16_tileram_0_w, &segaic16_tileram_0, "tile RAM" },
- { 0x35/2, 0x10000, 0x01000, 0xfef000, ~0, SMH_BANK(12), segaic16_textram_0_w, &segaic16_textram_0, "text RAM" },
- { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, SMH_BANK(13), SMH_BANK(13), &segaic16_spriteram_0, "object RAM" },
- { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, SMH_BANK(14), SMH_BANK(14), &workram, "work RAM" },
- { 0x29/2, 0x00000, 0x10000, 0xff0000, ~0, unknown_rgn2_r, unknown_rgn2_w, NULL, "???" },
- { 0x25/2, 0x00000, 0x04000, 0xffc000, ~0, rom_5797_bank_math_r, rom_5797_bank_math_w, NULL, "tile bank/math" },
- { 0x21/2, 0x00000, 0x80000, 0xf80000, 0x00000, SMH_BANK(17), SMH_UNMAP, NULL, "ROM 0" },
+ { 0x3d/2, 0x00000, 0x04000, 0xffc000, ~0, misc_io_r, misc_io_w, NULL, "I/O space" },
+ { 0x39/2, 0x00000, 0x01000, 0xfff000, ~0, (read16_space_func)SMH_BANK(10), segaic16_paletteram_w, &paletteram16, "color RAM" },
+ { 0x35/2, 0x00000, 0x10000, 0xfe0000, ~0, (read16_space_func)SMH_BANK(11), segaic16_tileram_0_w, &segaic16_tileram_0, "tile RAM" },
+ { 0x35/2, 0x10000, 0x01000, 0xfef000, ~0, (read16_space_func)SMH_BANK(12), segaic16_textram_0_w, &segaic16_textram_0, "text RAM" },
+ { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, (read16_space_func)SMH_BANK(13), (write16_space_func)SMH_BANK(13), &segaic16_spriteram_0, "object RAM" },
+ { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, (read16_space_func)SMH_BANK(14), (write16_space_func)SMH_BANK(14), &workram, "work RAM" },
+ { 0x29/2, 0x00000, 0x10000, 0xff0000, ~0, unknown_rgn2_r, unknown_rgn2_w, NULL, "???" },
+ { 0x25/2, 0x00000, 0x04000, 0xffc000, ~0, rom_5797_bank_math_r, rom_5797_bank_math_w, NULL, "tile bank/math" },
+ { 0x21/2, 0x00000, 0x80000, 0xf80000, 0x00000, (read16_space_func)SMH_BANK(17), (write16_space_func)SMH_UNMAP, NULL, "ROM 0" },
{ 0 }
};
diff --git a/src/mame/drivers/segas18.c b/src/mame/drivers/segas18.c
index 0348d248cf6..53137c410cd 100644
--- a/src/mame/drivers/segas18.c
+++ b/src/mame/drivers/segas18.c
@@ -92,43 +92,43 @@ static WRITE16_HANDLER( rom_5987_bank_w );
static const segaic16_memory_map_entry rom_171_shad_info[] =
{
- { 0x3d/2, 0x00000, 0x04000, 0xffc000, ~0, misc_io_r, misc_io_w, NULL, "I/O space" },
- { 0x39/2, 0x00000, 0x02000, 0xffe000, ~0, SMH_BANK(10), segaic16_paletteram_w, &paletteram16, "color RAM" },
- { 0x35/2, 0x00000, 0x10000, 0xfe0000, ~0, SMH_BANK(11), segaic16_tileram_0_w, &segaic16_tileram_0, "tile RAM" },
- { 0x35/2, 0x10000, 0x01000, 0xfef000, ~0, SMH_BANK(12), segaic16_textram_0_w, &segaic16_textram_0, "text RAM" },
- { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, SMH_BANK(13), SMH_BANK(13), &segaic16_spriteram_0, "object RAM" },
- { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, SMH_BANK(14), SMH_BANK(14), &workram, "work RAM" },
- { 0x29/2, 0x00000, 0x10000, 0xff0000, ~0, NULL, NULL, NULL, "????" },
- { 0x25/2, 0x00000, 0x00010, 0xfffff0, ~0, genesis_vdp_r, genesis_vdp_w, NULL, "VDP" },
- { 0x21/2, 0x00000, 0x80000, 0xf80000, 0x00000, SMH_BANK(17), SMH_UNMAP, NULL, "ROM 0" },
+ { 0x3d/2, 0x00000, 0x04000, 0xffc000, ~0, misc_io_r, misc_io_w, NULL, "I/O space" },
+ { 0x39/2, 0x00000, 0x02000, 0xffe000, ~0, (read16_space_func)SMH_BANK(10), segaic16_paletteram_w, &paletteram16, "color RAM" },
+ { 0x35/2, 0x00000, 0x10000, 0xfe0000, ~0, (read16_space_func)SMH_BANK(11), segaic16_tileram_0_w, &segaic16_tileram_0, "tile RAM" },
+ { 0x35/2, 0x10000, 0x01000, 0xfef000, ~0, (read16_space_func)SMH_BANK(12), segaic16_textram_0_w, &segaic16_textram_0, "text RAM" },
+ { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, (read16_space_func)SMH_BANK(13), (write16_space_func)SMH_BANK(13), &segaic16_spriteram_0, "object RAM" },
+ { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, (read16_space_func)SMH_BANK(14), (write16_space_func)SMH_BANK(14), &workram, "work RAM" },
+ { 0x29/2, 0x00000, 0x10000, 0xff0000, ~0, NULL, NULL, NULL, "????" },
+ { 0x25/2, 0x00000, 0x00010, 0xfffff0, ~0, genesis_vdp_r, genesis_vdp_w, NULL, "VDP" },
+ { 0x21/2, 0x00000, 0x80000, 0xf80000, 0x00000, (read16_space_func)SMH_BANK(17), (write16_space_func)SMH_UNMAP, NULL, "ROM 0" },
{ 0 }
};
static const segaic16_memory_map_entry rom_171_5874_info[] =
{
- { 0x3d/2, 0x00000, 0x04000, 0xffc000, ~0, misc_io_r, misc_io_w, NULL, "I/O space" },
- { 0x39/2, 0x00000, 0x02000, 0xffe000, ~0, SMH_BANK(10), segaic16_paletteram_w, &paletteram16, "color RAM" },
- { 0x35/2, 0x00000, 0x10000, 0xfe0000, ~0, SMH_BANK(11), segaic16_tileram_0_w, &segaic16_tileram_0, "tile RAM" },
- { 0x35/2, 0x10000, 0x01000, 0xfef000, ~0, SMH_BANK(12), segaic16_textram_0_w, &segaic16_textram_0, "text RAM" },
- { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, SMH_BANK(13), SMH_BANK(13), &segaic16_spriteram_0, "object RAM" },
- { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, SMH_BANK(14), SMH_BANK(14), &workram, "work RAM" },
- { 0x29/2, 0x00000, 0x00010, 0xfffff0, ~0, genesis_vdp_r, genesis_vdp_w, NULL, "VDP" },
- { 0x25/2, 0x00000, 0x80000, 0xf80000, 0x80000, SMH_BANK(16), SMH_UNMAP, NULL, "ROM 1" },
- { 0x21/2, 0x00000, 0x80000, 0xf80000, 0x00000, SMH_BANK(17), SMH_UNMAP, NULL, "ROM 0" },
+ { 0x3d/2, 0x00000, 0x04000, 0xffc000, ~0, misc_io_r, misc_io_w, NULL, "I/O space" },
+ { 0x39/2, 0x00000, 0x02000, 0xffe000, ~0, (read16_space_func)SMH_BANK(10), segaic16_paletteram_w, &paletteram16, "color RAM" },
+ { 0x35/2, 0x00000, 0x10000, 0xfe0000, ~0, (read16_space_func)SMH_BANK(11), segaic16_tileram_0_w, &segaic16_tileram_0, "tile RAM" },
+ { 0x35/2, 0x10000, 0x01000, 0xfef000, ~0, (read16_space_func)SMH_BANK(12), segaic16_textram_0_w, &segaic16_textram_0, "text RAM" },
+ { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, (read16_space_func)SMH_BANK(13), (write16_space_func)SMH_BANK(13), &segaic16_spriteram_0, "object RAM" },
+ { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, (read16_space_func)SMH_BANK(14), (write16_space_func)SMH_BANK(14), &workram, "work RAM" },
+ { 0x29/2, 0x00000, 0x00010, 0xfffff0, ~0, genesis_vdp_r, genesis_vdp_w, NULL, "VDP" },
+ { 0x25/2, 0x00000, 0x80000, 0xf80000, 0x80000, (read16_space_func)SMH_BANK(16), (write16_space_func)SMH_UNMAP, NULL, "ROM 1" },
+ { 0x21/2, 0x00000, 0x80000, 0xf80000, 0x00000, (read16_space_func)SMH_BANK(17), (write16_space_func)SMH_UNMAP, NULL, "ROM 0" },
{ 0 }
};
static const segaic16_memory_map_entry rom_171_5987_info[] =
{
- { 0x3d/2, 0x00000, 0x04000, 0xffc000, ~0, misc_io_r, misc_io_w, NULL, "I/O space" },
- { 0x39/2, 0x00000, 0x02000, 0xffe000, ~0, SMH_BANK(10), segaic16_paletteram_w, &paletteram16, "color RAM" },
- { 0x35/2, 0x00000, 0x10000, 0xfe0000, ~0, SMH_BANK(11), segaic16_tileram_0_w, &segaic16_tileram_0, "tile RAM" },
- { 0x35/2, 0x10000, 0x01000, 0xfef000, ~0, SMH_BANK(12), segaic16_textram_0_w, &segaic16_textram_0, "text RAM" },
- { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, SMH_BANK(13), SMH_BANK(13), &segaic16_spriteram_0, "object RAM" },
- { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, SMH_BANK(14), SMH_BANK(14), &workram, "work RAM" },
- { 0x29/2, 0x00000, 0x00010, 0xfffff0, ~0, genesis_vdp_r, genesis_vdp_w, NULL, "VDP" },
- { 0x25/2, 0x00000, 0x80000, 0xf80000, 0x80000, SMH_BANK(16), rom_5987_bank_w, NULL, "ROM 1/banking" },
- { 0x21/2, 0x00000, 0x100000,0xf00000, 0x00000, SMH_BANK(17), SMH_UNMAP, NULL, "ROM 0" },
+ { 0x3d/2, 0x00000, 0x04000, 0xffc000, ~0, misc_io_r, misc_io_w, NULL, "I/O space" },
+ { 0x39/2, 0x00000, 0x02000, 0xffe000, ~0, (read16_space_func)SMH_BANK(10), segaic16_paletteram_w, &paletteram16, "color RAM" },
+ { 0x35/2, 0x00000, 0x10000, 0xfe0000, ~0, (read16_space_func)SMH_BANK(11), segaic16_tileram_0_w, &segaic16_tileram_0, "tile RAM" },
+ { 0x35/2, 0x10000, 0x01000, 0xfef000, ~0, (read16_space_func)SMH_BANK(12), segaic16_textram_0_w, &segaic16_textram_0, "text RAM" },
+ { 0x31/2, 0x00000, 0x00800, 0xfff800, ~0, (read16_space_func)SMH_BANK(13), (write16_space_func)SMH_BANK(13), &segaic16_spriteram_0, "object RAM" },
+ { 0x2d/2, 0x00000, 0x04000, 0xffc000, ~0, (read16_space_func)SMH_BANK(14), (write16_space_func)SMH_BANK(14), &workram, "work RAM" },
+ { 0x29/2, 0x00000, 0x00010, 0xfffff0, ~0, genesis_vdp_r, genesis_vdp_w, NULL, "VDP" },
+ { 0x25/2, 0x00000, 0x80000, 0xf80000, 0x80000, (read16_space_func)SMH_BANK(16), rom_5987_bank_w, NULL, "ROM 1/banking" },
+ { 0x21/2, 0x00000, 0x100000,0xf00000, 0x00000, (read16_space_func)SMH_BANK(17), (write16_space_func)SMH_UNMAP, NULL, "ROM 0" },
{ 0 }
};
diff --git a/src/mame/drivers/seibuspi.c b/src/mame/drivers/seibuspi.c
index f46ae88e74d..45c3532cb73 100644
--- a/src/mame/drivers/seibuspi.c
+++ b/src/mame/drivers/seibuspi.c
@@ -1268,7 +1268,7 @@ INPUT_PORTS_END
static CUSTOM_INPUT( ejanhs_encode )
{
static const UINT8 encoding[] = { 0x02, 0x10, 0x03, 0x18, 0x04, 0x20, 0x05, 0x28, 0x06, 0x30, 0x07 };
- input_port_value state = input_port_read(field->port->machine, param);
+ input_port_value state = input_port_read(field->port->machine, (const char *)param);
int bit;
for (bit = 0; bit < ARRAY_LENGTH(encoding); bit++)
diff --git a/src/mame/drivers/seta2.c b/src/mame/drivers/seta2.c
index 3a97c48389e..8e4287cff71 100644
--- a/src/mame/drivers/seta2.c
+++ b/src/mame/drivers/seta2.c
@@ -608,7 +608,7 @@ static NVRAM_HANDLER(93C46_gundamex)
UINT32 length, size;
UINT16 *dat;
- dat = eeprom_get_data_pointer(&length, &size);
+ dat = (UINT16 *)eeprom_get_data_pointer(&length, &size);
dat[0] = 0x7008;
}
}
diff --git a/src/mame/drivers/ssv.c b/src/mame/drivers/ssv.c
index 1cc7dbb0c40..435ef1334bf 100644
--- a/src/mame/drivers/ssv.c
+++ b/src/mame/drivers/ssv.c
@@ -397,7 +397,7 @@ static WRITE16_HANDLER( dsp_w )
if(offset == 0x21 && dsp_ram[0x21]) {
switch(dsp_ram[0x20]) {
case 0x0001:
- dsp_ram[0x11] = (UINT8)(128*atan2(dsp_ram[0] - dsp_ram[1], dsp_ram[2] - dsp_ram[3])/M_PI) ^ 0x80;
+ dsp_ram[0x11] = (UINT8)(128*atan2((double)(dsp_ram[0] - dsp_ram[1]), (double)(dsp_ram[2] - dsp_ram[3]))/M_PI) ^ 0x80;
dsp_ram[0x21] = 0;
break;
default:
diff --git a/src/mame/drivers/stactics.c b/src/mame/drivers/stactics.c
index 734cb53da3c..0953b3b0b02 100644
--- a/src/mame/drivers/stactics.c
+++ b/src/mame/drivers/stactics.c
@@ -55,7 +55,7 @@ Verify Color PROM resistor values (Last 8 colors)
static CUSTOM_INPUT( get_motor_not_ready )
{
- stactics_state *state = field->port->machine->driver_data;
+ stactics_state *state = (stactics_state *)field->port->machine->driver_data;
/* if the motor is self-centering, but not centered yet */
return ((*state->motor_on & 0x01) == 0) &&
@@ -65,7 +65,7 @@ static CUSTOM_INPUT( get_motor_not_ready )
static READ8_HANDLER( vert_pos_r )
{
- stactics_state *state = space->machine->driver_data;
+ stactics_state *state = (stactics_state *)space->machine->driver_data;
return 0x70 - state->vert_pos;
}
@@ -73,7 +73,7 @@ static READ8_HANDLER( vert_pos_r )
static READ8_HANDLER( horiz_pos_r )
{
- stactics_state *state = space->machine->driver_data;
+ stactics_state *state = (stactics_state *)space->machine->driver_data;
return state->horiz_pos + 0x88;
}
@@ -156,7 +156,7 @@ static WRITE8_HANDLER( stactics_coin_lockout_w )
static INTERRUPT_GEN( stactics_interrupt )
{
- stactics_state *state = device->machine->driver_data;
+ stactics_state *state = (stactics_state *)device->machine->driver_data;
move_motor(device->machine, state);
@@ -287,7 +287,7 @@ INPUT_PORTS_END
static MACHINE_START( stactics )
{
- stactics_state *state = machine->driver_data;
+ stactics_state *state = (stactics_state *)machine->driver_data;
state->vert_pos = 0;
state->horiz_pos = 0;
diff --git a/src/mame/drivers/suprnova.c b/src/mame/drivers/suprnova.c
index c90d0b98a68..5a65c698424 100644
--- a/src/mame/drivers/suprnova.c
+++ b/src/mame/drivers/suprnova.c
@@ -490,7 +490,7 @@ static INTERRUPT_GEN(skns_interrupt)
static CUSTOM_INPUT( paddle_r )
{
- const char *tag = param;
+ const char *tag = (const char *)param;
return input_port_read(field->port->machine, tag);
}
diff --git a/src/mame/drivers/trvquest.c b/src/mame/drivers/trvquest.c
index 6ccfe11fff1..164f534cff2 100644
--- a/src/mame/drivers/trvquest.c
+++ b/src/mame/drivers/trvquest.c
@@ -42,7 +42,7 @@ Notes:
static READ8_HANDLER( trvquest_question_r )
{
- gameplan_state *state = space->machine->driver_data;
+ gameplan_state *state = (gameplan_state *)space->machine->driver_data;
return memory_region(space->machine, "questions")[*state->trvquest_question * 0x2000 + offset];
}
diff --git a/src/mame/drivers/turbo.c b/src/mame/drivers/turbo.c
index da573d751b8..44df9bfce88 100644
--- a/src/mame/drivers/turbo.c
+++ b/src/mame/drivers/turbo.c
@@ -189,7 +189,7 @@ static READ8_DEVICE_HANDLER( turbo_analog_r );
static MACHINE_RESET( buckrog )
{
- turbo_state *state = machine->driver_data;
+ turbo_state *state = (turbo_state *)machine->driver_data;
state->buckrog_command = 0x00;
}
@@ -212,7 +212,7 @@ static MACHINE_RESET( buckrog )
static WRITE8_DEVICE_HANDLER( turbo_ppi0a_w )
{
/* bit0-7 = 0PA0-7 */
- turbo_state *state = device->machine->driver_data;
+ turbo_state *state = (turbo_state *)device->machine->driver_data;
state->turbo_opa = data;
}
@@ -220,7 +220,7 @@ static WRITE8_DEVICE_HANDLER( turbo_ppi0a_w )
static WRITE8_DEVICE_HANDLER( turbo_ppi0b_w )
{
/* bit0-7 = 0PB0-7 */
- turbo_state *state = device->machine->driver_data;
+ turbo_state *state = (turbo_state *)device->machine->driver_data;
state->turbo_opb = data;
}
@@ -228,7 +228,7 @@ static WRITE8_DEVICE_HANDLER( turbo_ppi0b_w )
static WRITE8_DEVICE_HANDLER( turbo_ppi0c_w )
{
/* bit0-7 = 0PC0-7 */
- turbo_state *state = device->machine->driver_data;
+ turbo_state *state = (turbo_state *)device->machine->driver_data;
state->turbo_opc = data;
}
@@ -236,7 +236,7 @@ static WRITE8_DEVICE_HANDLER( turbo_ppi0c_w )
static WRITE8_DEVICE_HANDLER( turbo_ppi1a_w )
{
/* bit0-7 = 1PA0-7 */
- turbo_state *state = device->machine->driver_data;
+ turbo_state *state = (turbo_state *)device->machine->driver_data;
state->turbo_ipa = data;
}
@@ -244,7 +244,7 @@ static WRITE8_DEVICE_HANDLER( turbo_ppi1a_w )
static WRITE8_DEVICE_HANDLER( turbo_ppi1b_w )
{
/* bit0-7 = 1PB0-7 */
- turbo_state *state = device->machine->driver_data;
+ turbo_state *state = (turbo_state *)device->machine->driver_data;
state->turbo_ipb = data;
}
@@ -252,7 +252,7 @@ static WRITE8_DEVICE_HANDLER( turbo_ppi1b_w )
static WRITE8_DEVICE_HANDLER( turbo_ppi1c_w )
{
/* bit0-7 = 1PC0-7 */
- turbo_state *state = device->machine->driver_data;
+ turbo_state *state = (turbo_state *)device->machine->driver_data;
state->turbo_ipc = data;
}
@@ -262,7 +262,7 @@ static WRITE8_DEVICE_HANDLER( turbo_ppi3c_w )
/* bit 0-3 = PLA0-3 */
/* bit 4-6 = COL0-2 */
/* bit 7 = n/c */
- turbo_state *state = device->machine->driver_data;
+ turbo_state *state = (turbo_state *)device->machine->driver_data;
state->turbo_fbpla = data & 0x0f;
state->turbo_fbcol = (data >> 4) & 0x07;
}
@@ -322,7 +322,7 @@ static WRITE8_DEVICE_HANDLER( subroc3d_ppi0a_w )
{
/* bit 0-3 = PLY0-3 */
/* bit 4-7 = n/c */
- turbo_state *state = device->machine->driver_data;
+ turbo_state *state = (turbo_state *)device->machine->driver_data;
state->subroc3d_ply = data & 0x0f;
}
@@ -330,7 +330,7 @@ static WRITE8_DEVICE_HANDLER( subroc3d_ppi0a_w )
static WRITE8_DEVICE_HANDLER( subroc3d_ppi0c_w )
{
/* bit 0-3 = COL0-3 */
- turbo_state *state = device->machine->driver_data;
+ turbo_state *state = (turbo_state *)device->machine->driver_data;
state->subroc3d_col = data & 0x0f;
}
@@ -342,7 +342,7 @@ static WRITE8_DEVICE_HANDLER( subroc3d_ppi0b_w )
/* bit 2 = STLA (START LAMP) */
/* bit 3 = NOUSE (n/c) */
/* bit 4 = FLIP (not really flip, just offset) */
- turbo_state *state = device->machine->driver_data;
+ turbo_state *state = (turbo_state *)device->machine->driver_data;
coin_counter_w(0, data & 0x01);
coin_counter_w(1, data & 0x02);
set_led_status(0, data & 0x04);
@@ -381,7 +381,7 @@ static const ppi8255_interface subroc3d_8255_intf[2] =
static WRITE8_DEVICE_HANDLER( buckrog_ppi0a_w )
{
/* bit 0-7 = data to be read on the /IOREQ */
- turbo_state *state = device->machine->driver_data;
+ turbo_state *state = (turbo_state *)device->machine->driver_data;
state->buckrog_command = data;
}
@@ -390,7 +390,7 @@ static WRITE8_DEVICE_HANDLER( buckrog_ppi0b_w )
{
/* bit 0-5 = MOV0-5 */
/* bit 6-7 = n/c */
- turbo_state *state = device->machine->driver_data;
+ turbo_state *state = (turbo_state *)device->machine->driver_data;
state->buckrog_mov = data & 0x3f;
}
@@ -401,7 +401,7 @@ static WRITE8_DEVICE_HANDLER( buckrog_ppi0c_w )
/* bit 3-5 = n/c */
/* bit 6 = /IOREQ on the 2nd CPU */
/* bit 7 = /INT on the 2nd CPU */
- turbo_state *state = device->machine->driver_data;
+ turbo_state *state = (turbo_state *)device->machine->driver_data;
state->buckrog_fchg = data & 0x07;
cpu_set_input_line(device->machine->cpu[1], 0, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
}
@@ -415,7 +415,7 @@ static WRITE8_DEVICE_HANDLER( buckrog_ppi1c_w )
/* bit 5 = COM2 (COIN METER 2) */
/* bit 6 = STLA (START LAMP) */
/* bit 7 = NOUSE (BODY SONIC) */
- turbo_state *state = device->machine->driver_data;
+ turbo_state *state = (turbo_state *)device->machine->driver_data;
state->buckrog_obch = data & 0x07;
coin_counter_w(0, data & 0x10);
coin_counter_w(1, data & 0x20);
@@ -479,7 +479,7 @@ static void update_outputs(i8279_state *chip, UINT16 which)
static READ8_HANDLER( turbo_8279_r )
{
- turbo_state *state = space->machine->driver_data;
+ turbo_state *state = (turbo_state *)space->machine->driver_data;
i8279_state *chip = &state->i8279;
UINT8 result = 0xff;
UINT8 addr;
@@ -520,7 +520,7 @@ static READ8_HANDLER( turbo_8279_r )
static WRITE8_HANDLER( turbo_8279_w )
{
- turbo_state *state = space->machine->driver_data;
+ turbo_state *state = (turbo_state *)space->machine->driver_data;
i8279_state *chip = &state->i8279;
UINT8 addr;
@@ -624,7 +624,7 @@ static WRITE8_HANDLER( turbo_8279_w )
static READ8_HANDLER( turbo_collision_r )
{
- turbo_state *state = space->machine->driver_data;
+ turbo_state *state = (turbo_state *)space->machine->driver_data;
video_screen_update_partial(space->machine->primary_screen, video_screen_get_vpos(space->machine->primary_screen));
return input_port_read(space->machine, "DSW3") | (state->turbo_collision & 15);
}
@@ -632,7 +632,7 @@ static READ8_HANDLER( turbo_collision_r )
static WRITE8_HANDLER( turbo_collision_clear_w )
{
- turbo_state *state = space->machine->driver_data;
+ turbo_state *state = (turbo_state *)space->machine->driver_data;
video_screen_update_partial(space->machine->primary_screen, video_screen_get_vpos(space->machine->primary_screen));
state->turbo_collision = 0;
}
@@ -640,14 +640,14 @@ static WRITE8_HANDLER( turbo_collision_clear_w )
static READ8_DEVICE_HANDLER( turbo_analog_r )
{
- turbo_state *state = device->machine->driver_data;
+ turbo_state *state = (turbo_state *)device->machine->driver_data;
return input_port_read(device->machine, "DIAL") - state->turbo_last_analog;
}
static WRITE8_HANDLER( turbo_analog_reset_w )
{
- turbo_state *state = space->machine->driver_data;
+ turbo_state *state = (turbo_state *)space->machine->driver_data;
state->turbo_last_analog = input_port_read(space->machine, "DIAL");
}
@@ -679,7 +679,7 @@ static WRITE8_HANDLER( turbo_coin_and_lamp_w )
static READ8_HANDLER( buckrog_cpu2_command_r )
{
/* assert ACK */
- turbo_state *state = space->machine->driver_data;
+ turbo_state *state = (turbo_state *)space->machine->driver_data;
ppi8255_set_port_c(devtag_get_device(space->machine, "ppi8255_0"), 0x00);
return state->buckrog_command;
}
diff --git a/src/mame/drivers/ultratnk.c b/src/mame/drivers/ultratnk.c
index 3bcc586e15a..2b5dece1797 100644
--- a/src/mame/drivers/ultratnk.c
+++ b/src/mame/drivers/ultratnk.c
@@ -29,7 +29,7 @@ static CUSTOM_INPUT( get_collision )
static CUSTOM_INPUT( get_joystick )
{
- UINT8 joy = input_port_read(field->port->machine, param) & 3;
+ UINT8 joy = input_port_read(field->port->machine, (const char *)param) & 3;
if (joy == 1)
{
diff --git a/src/mame/drivers/ultrsprt.c b/src/mame/drivers/ultrsprt.c
index 446af0970c4..be3e4f204b6 100644
--- a/src/mame/drivers/ultrsprt.c
+++ b/src/mame/drivers/ultrsprt.c
@@ -70,7 +70,7 @@ static WRITE32_HANDLER( eeprom_w )
static CUSTOM_INPUT( analog_ctrl_r )
{
- const char *tag = param;
+ const char *tag = (const char *)param;
return input_port_read(field->port->machine, tag) & 0xfff;
}
diff --git a/src/mame/drivers/vcombat.c b/src/mame/drivers/vcombat.c
index ded32d64cef..c9d590c0caa 100644
--- a/src/mame/drivers/vcombat.c
+++ b/src/mame/drivers/vcombat.c
@@ -199,21 +199,21 @@ static void wiggle_i860_common(int n, UINT16 data, const device_config *device)
if (bus_hold)
{
fprintf(stderr, "M0 asserting bus HOLD to i860 %s\n", device->tag);
- i860_set_pin(device->token, DEC_PIN_BUS_HOLD, 1);
+ i860_set_pin(device, DEC_PIN_BUS_HOLD, 1);
}
else
{
fprintf(stderr, "M0 clearing bus HOLD to i860 %s\n", device->tag);
- i860_set_pin(device->token, DEC_PIN_BUS_HOLD, 0);
+ i860_set_pin(device, DEC_PIN_BUS_HOLD, 0);
}
if (reset)
{
fprintf(stderr, "M0 asserting RESET to i860 %s\n", device->tag);
- i860_set_pin(device->token, DEC_PIN_RESET, 1);
+ i860_set_pin(device, DEC_PIN_RESET, 1);
}
else
- i860_set_pin(device->token, DEC_PIN_RESET, 0);
+ i860_set_pin(device, DEC_PIN_RESET, 0);
}
static WRITE16_HANDLER( wiggle_i860p0_pins_w )
@@ -379,8 +379,8 @@ static MACHINE_RESET( vcombat )
/* Setup the Bt476 VGA RAMDAC palette chip */
tlc34076_reset(6);
- i860_set_pin(cputag_get_cpu(machine, "vid_0")->token, DEC_PIN_BUS_HOLD, 1);
- i860_set_pin(cputag_get_cpu(machine, "vid_1")->token, DEC_PIN_BUS_HOLD, 1);
+ i860_set_pin(cputag_get_cpu(machine, "vid_0"), DEC_PIN_BUS_HOLD, 1);
+ i860_set_pin(cputag_get_cpu(machine, "vid_1"), DEC_PIN_BUS_HOLD, 1);
crtc_select = 0;
}
@@ -390,7 +390,7 @@ static MACHINE_RESET( shadfgtr )
/* Setup the Bt476 VGA RAMDAC palette chip */
tlc34076_reset(6);
- i860_set_pin(cputag_get_cpu(machine, "vid_0")->token, DEC_PIN_BUS_HOLD, 1);
+ i860_set_pin(cputag_get_cpu(machine, "vid_0"), DEC_PIN_BUS_HOLD, 1);
crtc_select = 0;
}
diff --git a/src/mame/drivers/vegas.c b/src/mame/drivers/vegas.c
index 4b17ac28371..656820b4d66 100644
--- a/src/mame/drivers/vegas.c
+++ b/src/mame/drivers/vegas.c
@@ -1571,7 +1571,7 @@ static void remap_dynamic_addresses(running_machine *machine)
add_dynamic_address(base + 0x2000, base + 0x2003, sio_irq_cause_r, NULL);
add_dynamic_address(base + 0x3000, base + 0x3003, sio_irq_status_r, NULL);
add_dynamic_address(base + 0x4000, base + 0x4003, sio_led_r, sio_led_w);
- add_dynamic_address(base + 0x5000, base + 0x5007, SMH_NOP, NULL);
+ add_dynamic_address(base + 0x5000, base + 0x5007, (read32_space_func)SMH_NOP, NULL);
add_dynamic_address(base + 0x6000, base + 0x6003, NULL, cmos_unlock_w);
add_dynamic_address(base + 0x7000, base + 0x7003, NULL, vegas_watchdog_w);
}
diff --git a/src/mame/drivers/vicdual.c b/src/mame/drivers/vicdual.c
index 51eb5e3993f..c8e1f0a9119 100644
--- a/src/mame/drivers/vicdual.c
+++ b/src/mame/drivers/vicdual.c
@@ -362,7 +362,7 @@ static READ8_HANDLER( safari_io_r )
static WRITE8_HANDLER( safari_io_w )
{
if (offset & 0x01) assert_coin_status();
- if (offset & 0x02) /* safari_audio_w(0, data) */;
+ if (offset & 0x02) { /* safari_audio_w(0, data) */ }
}
@@ -567,7 +567,7 @@ static WRITE8_HANDLER( headon_io_w )
{
if (offset & 0x01) assert_coin_status();
if (offset & 0x02) headon_audio_w(space, 0, data);
- if (offset & 0x04) /* vicdual_palette_bank_w(0, data) */; /* not written to */
+ if (offset & 0x04) { /* vicdual_palette_bank_w(0, data) */ } /* not written to */
}
@@ -759,8 +759,8 @@ static WRITE8_HANDLER( headon2_io_w )
if (offset & 0x01) assert_coin_status();
if (offset & 0x02) headon_audio_w(space, 0, data);
if (offset & 0x04) vicdual_palette_bank_w(space, 0, data);
- if (offset & 0x08) ;/* schematics show this as going into a shifer circuit, but never written to */
- if (offset & 0x10) ;/* schematics show this as going to an edge connector, but never written to */
+ if (offset & 0x08) { /* schematics show this as going into a shifer circuit, but never written to */ }
+ if (offset & 0x10) { /* schematics show this as going to an edge connector, but never written to */ }
if (offset & 0x18) logerror("********* Write to port %x\n", offset);
}
@@ -768,15 +768,15 @@ static WRITE8_HANDLER( headon2_io_w )
static WRITE8_HANDLER( digger_io_w )
{
if (offset & 0x01) assert_coin_status();
- if (offset & 0x02) /* digger_audio_1_w(0, data) */;
+ if (offset & 0x02) { /* digger_audio_1_w(0, data) */ }
if (offset & 0x04)
{
vicdual_palette_bank_w(space, 0, data & 0x03);
- /* digger_audio_2_w(0, data & 0xfc) */;
+ /* digger_audio_2_w(0, data & 0xfc); */
}
- if (offset & 0x08) ;/* schematics show this as going into a shifer circuit, but never written to */
- if (offset & 0x10) ;/* schematics show this as going to an edge connector, but never written to */
+ if (offset & 0x08) { /* schematics show this as going into a shifer circuit, but never written to */ }
+ if (offset & 0x10) { /* schematics show this as going to an edge connector, but never written to */ }
if (offset & 0x18) logerror("********* Write to port %x\n", offset);
}
@@ -972,7 +972,7 @@ static WRITE8_HANDLER( invho2_io_w )
static WRITE8_HANDLER( invds_io_w )
{
if (offset & 0x01) invinco_audio_w(space, 0, data);
- if (offset & 0x02) /* deepscan_audio_w(0, data) */;
+ if (offset & 0x02) { /* deepscan_audio_w(0, data) */ }
if (offset & 0x08) assert_coin_status();
if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
}
@@ -981,7 +981,7 @@ static WRITE8_HANDLER( invds_io_w )
static WRITE8_HANDLER( sspacaho_io_w )
{
if (offset & 0x01) invho2_audio_w(space, 0, data);
- if (offset & 0x02) /* sspaceatt_audio_w(space, 0, data) */;
+ if (offset & 0x02) { /* sspaceatt_audio_w(space, 0, data) */ }
if (offset & 0x08) assert_coin_status();
if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
}
@@ -989,7 +989,7 @@ static WRITE8_HANDLER( sspacaho_io_w )
static WRITE8_HANDLER( tranqgun_io_w )
{
- if (offset & 0x01) /* tranqgun_audio_w(space, 0, data) */;
+ if (offset & 0x01) { /* tranqgun_audio_w(space, 0, data) */ }
if (offset & 0x02) vicdual_palette_bank_w(space, 0, data);
if (offset & 0x08) assert_coin_status();
}
@@ -997,8 +997,8 @@ static WRITE8_HANDLER( tranqgun_io_w )
static WRITE8_HANDLER( spacetrk_io_w )
{
- if (offset & 0x01) /* spacetrk_audio_w(space, 0, data) */;
- if (offset & 0x02) /* spacetrk_audio_w(space, 0, data) */;
+ if (offset & 0x01) { /* spacetrk_audio_w(space, 0, data) */ }
+ if (offset & 0x02) { /* spacetrk_audio_w(space, 0, data) */ }
if (offset & 0x08) assert_coin_status();
if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
}
@@ -1015,7 +1015,7 @@ static WRITE8_HANDLER( carnival_io_w )
static WRITE8_HANDLER( brdrline_io_w )
{
- if (offset & 0x01) /* brdrline_audio_w(space, 0, data) */;
+ if (offset & 0x01) { /* brdrline_audio_w(space, 0, data) */ }
if (offset & 0x02) vicdual_palette_bank_w(space, 0, data);
if (offset & 0x08) assert_coin_status();
}
@@ -1032,12 +1032,12 @@ static WRITE8_HANDLER( pulsar_io_w )
static WRITE8_HANDLER( heiankyo_io_w )
{
- if (offset & 0x01) /* heiankyo_audio_1_w(0, data) */;
+ if (offset & 0x01) { /* heiankyo_audio_1_w(0, data) */ }
if (offset & 0x02)
{
vicdual_palette_bank_w(space, 0, data & 0x03);
- /* heiankyo_audio_2_w(0, data & 0xfc) */;
+ /* heiankyo_audio_2_w(0, data & 0xfc); */
}
if (offset & 0x08) assert_coin_status();
@@ -1046,8 +1046,8 @@ static WRITE8_HANDLER( heiankyo_io_w )
static WRITE8_HANDLER( alphaho_io_w )
{
- if (offset & 0x01) /* headon_audio_w(0, data) */;
- if (offset & 0x02) /* alphaf_audio_w(0, data) */;
+ if (offset & 0x01) { /* headon_audio_w(0, data) */ }
+ if (offset & 0x02) { /* alphaf_audio_w(0, data) */ }
if (offset & 0x08) assert_coin_status();
if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
}
@@ -1989,7 +1989,7 @@ static CUSTOM_INPUT( samurai_protection_r )
static WRITE8_HANDLER( samurai_io_w )
{
- if (offset & 0x02) /* samurai_audio_w(0, data) */;
+ if (offset & 0x02) { /* samurai_audio_w(0, data) */ }
if (offset & 0x08) assert_coin_status();
if (offset & 0x40) vicdual_palette_bank_w(space, 0, data);
}
@@ -2108,7 +2108,7 @@ static READ8_HANDLER( nsub_io_r )
static WRITE8_HANDLER( nsub_io_w )
{
if (offset & 0x01) assert_coin_status();
- if (offset & 0x02) /* nsub_audio_w(0, data) */;
+ if (offset & 0x02) { /* nsub_audio_w(0, data) */ }
if (offset & 0x04) vicdual_palette_bank_w(space, 0, data);
}
diff --git a/src/mame/drivers/wwfwfest.c b/src/mame/drivers/wwfwfest.c
index 73fbc736a7f..f3bfa2ecb77 100644
--- a/src/mame/drivers/wwfwfest.c
+++ b/src/mame/drivers/wwfwfest.c
@@ -178,13 +178,13 @@ static WRITE16_HANDLER ( wwfwfest_soundwrite )
/* DIPs are spread accross the other input ports */
static CUSTOM_INPUT( dsw_3f_r )
{
- const char *tag = param;
+ const char *tag = (const char *)param;
return input_port_read(field->port->machine, tag) & 0x3f;
}
static CUSTOM_INPUT( dsw_c0_r )
{
- const char *tag = param;
+ const char *tag = (const char *)param;
return (input_port_read(field->port->machine, tag) & 0xc0) >> 6;
}
diff --git a/src/mame/includes/lordgun.h b/src/mame/includes/lordgun.h
new file mode 100644
index 00000000000..04ee3cced8b
--- /dev/null
+++ b/src/mame/includes/lordgun.h
@@ -0,0 +1,34 @@
+/***************************************************************************
+
+ -= IGS Lord Of Gun =-
+
+*************************************************************************/
+
+/*----------- defined in video/lordgun.c -----------*/
+
+extern UINT16 *lordgun_vram_0, *lordgun_scroll_x_0, *lordgun_scroll_y_0;
+extern UINT16 *lordgun_vram_1, *lordgun_scroll_x_1, *lordgun_scroll_y_1;
+extern UINT16 *lordgun_vram_2, *lordgun_scroll_x_2, *lordgun_scroll_y_2;
+extern UINT16 *lordgun_vram_3, *lordgun_scroll_x_3, *lordgun_scroll_y_3;
+extern UINT16 *lordgun_scrollram;
+extern int lordgun_whitescreen;
+
+typedef struct _lordgun_gun_data lordgun_gun_data;
+struct _lordgun_gun_data
+{
+ int scr_x, scr_y;
+ UINT16 hw_x, hw_y;
+};
+
+extern lordgun_gun_data lordgun_gun[2];
+
+
+WRITE16_HANDLER( lordgun_vram_0_w );
+WRITE16_HANDLER( lordgun_vram_1_w );
+WRITE16_HANDLER( lordgun_vram_2_w );
+WRITE16_HANDLER( lordgun_vram_3_w );
+
+void lordgun_update_gun(running_machine *machine, int i);
+
+VIDEO_START( lordgun );
+VIDEO_UPDATE( lordgun );
diff --git a/src/mame/machine/arkanoid.c b/src/mame/machine/arkanoid.c
index ddaed96eaa2..f919e24eeb4 100644
--- a/src/mame/machine/arkanoid.c
+++ b/src/mame/machine/arkanoid.c
@@ -131,7 +131,7 @@ CUSTOM_INPUT( arkanoid_68705_input_r )
CUSTOM_INPUT( arkanoid_input_mux )
{
- const char *tag1 = param;
+ const char *tag1 = (const char *)param;
const char *tag2 = tag1 + strlen(tag1) + 1;
return input_port_read(field->port->machine, (arkanoid_paddle_select == 0) ? tag1 : tag2);
}
diff --git a/src/mame/machine/atari.c b/src/mame/machine/atari.c
index e3c9853ae53..1d5bc98797d 100644
--- a/src/mame/machine/atari.c
+++ b/src/mame/machine/atari.c
@@ -144,17 +144,17 @@ void a600xl_mmu(running_machine *machine, UINT8 new_mmu)
if ( new_mmu & 0x80 )
{
logerror("%s MMU SELFTEST RAM\n", machine->gamedrv->name);
- rbank2 = SMH_NOP;
- wbank2 = SMH_NOP;
+ rbank2 = (read8_space_func)SMH_NOP;
+ wbank2 = (write8_space_func)SMH_NOP;
}
else
{
logerror("%s MMU SELFTEST ROM\n", machine->gamedrv->name);
- rbank2 = SMH_BANK(2);
- wbank2 = SMH_UNMAP;
+ rbank2 = (read8_space_func)SMH_BANK(2);
+ wbank2 = (write8_space_func)SMH_UNMAP;
}
memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x5000, 0x57ff, 0, 0, rbank2, wbank2);
- if (rbank2 == SMH_BANK(2))
+ if (rbank2 == (read8_space_func)SMH_BANK(2))
memory_set_bankptr(machine, 2, memory_region(machine, "maincpu") + 0x5000);
}
@@ -168,21 +168,21 @@ void a800xl_mmu(running_machine *machine, UINT8 new_mmu)
if( new_mmu & 0x01 )
{
logerror("%s MMU BIOS ROM\n", machine->gamedrv->name);
- rbank3 = SMH_BANK(3);
- wbank3 = SMH_UNMAP;
+ rbank3 = (read8_space_func)SMH_BANK(3);
+ wbank3 = (write8_space_func)SMH_UNMAP;
base3 = memory_region(machine, "maincpu") + 0x14000; /* 8K lo BIOS */
- rbank4 = SMH_BANK(4);
- wbank4 = SMH_UNMAP;
+ rbank4 = (read8_space_func)SMH_BANK(4);
+ wbank4 = (write8_space_func)SMH_UNMAP;
base4 = memory_region(machine, "maincpu") + 0x15800; /* 4K FP ROM + 8K hi BIOS */
}
else
{
logerror("%s MMU BIOS RAM\n", machine->gamedrv->name);
- rbank3 = SMH_BANK(3);
- wbank3 = SMH_BANK(3);
+ rbank3 = (read8_space_func)SMH_BANK(3);
+ wbank3 = (write8_space_func)SMH_BANK(3);
base3 = memory_region(machine, "maincpu") + 0x0c000; /* 8K RAM */
- rbank4 = SMH_BANK(4);
- wbank4 = SMH_BANK(4);
+ rbank4 = (read8_space_func)SMH_BANK(4);
+ wbank4 = (write8_space_func)SMH_BANK(4);
base4 = memory_region(machine, "maincpu") + 0x0d800; /* 4K RAM + 8K RAM */
}
memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xc000, 0xcfff, 0, 0, rbank3, wbank3);
@@ -194,15 +194,15 @@ void a800xl_mmu(running_machine *machine, UINT8 new_mmu)
if( new_mmu & 0x02 )
{
logerror("%s MMU BASIC RAM\n", machine->gamedrv->name);
- rbank1 = SMH_BANK(1);
- wbank1 = SMH_BANK(1);
+ rbank1 = (read8_space_func)SMH_BANK(1);
+ wbank1 = (write8_space_func)SMH_BANK(1);
base1 = memory_region(machine, "maincpu") + 0x0a000; /* 8K RAM */
}
else
{
logerror("%s MMU BASIC ROM\n", machine->gamedrv->name);
- rbank1 = SMH_BANK(1);
- wbank1 = SMH_UNMAP;
+ rbank1 = (read8_space_func)SMH_BANK(1);
+ wbank1 = (write8_space_func)SMH_UNMAP;
base1 = memory_region(machine, "maincpu") + 0x10000; /* 8K BASIC */
}
memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xa000, 0xbfff, 0, 0, rbank1, wbank1);
@@ -212,15 +212,15 @@ void a800xl_mmu(running_machine *machine, UINT8 new_mmu)
if( new_mmu & 0x80 )
{
logerror("%s MMU SELFTEST RAM\n", machine->gamedrv->name);
- rbank2 = SMH_BANK(2);
- wbank2 = SMH_BANK(2);
+ rbank2 = (read8_space_func)SMH_BANK(2);
+ wbank2 = (write8_space_func)SMH_BANK(2);
base2 = memory_region(machine, "maincpu") + 0x05000; /* 0x0800 bytes */
}
else
{
logerror("%s MMU SELFTEST ROM\n", machine->gamedrv->name);
- rbank2 = SMH_BANK(2);
- wbank2 = SMH_UNMAP;
+ rbank2 = (read8_space_func)SMH_BANK(2);
+ wbank2 = (write8_space_func)SMH_UNMAP;
base2 = memory_region(machine, "maincpu") + 0x15000; /* 0x0800 bytes */
}
memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x5000, 0x57ff, 0, 0, rbank2, wbank2);
diff --git a/src/mame/machine/atarigen.c b/src/mame/machine/atarigen.c
index 716bf622e44..6cc9bba480c 100644
--- a/src/mame/machine/atarigen.c
+++ b/src/mame/machine/atarigen.c
@@ -321,7 +321,7 @@ WRITE32_HANDLER( atarigen_video_int_ack32_w )
static TIMER_CALLBACK( scanline_interrupt_callback )
{
- const device_config *screen = ptr;
+ const device_config *screen = (const device_config *)ptr;
emu_timer *timer = get_scanline_interrupt_timer_for_screen(screen);
/* generate the interrupt */
@@ -984,7 +984,7 @@ void atarigen_scanline_timer_reset(const device_config *screen, atarigen_scanlin
static TIMER_CALLBACK( scanline_timer_callback )
{
- const device_config *screen = ptr;
+ const device_config *screen = (const device_config *)ptr;
int scanline = param;
/* callback */
@@ -1049,7 +1049,7 @@ static emu_timer *get_atarivc_eof_update_timer_for_screen(const device_config *s
static TIMER_CALLBACK( atarivc_eof_update )
{
- const device_config *screen = ptr;
+ const device_config *screen = (const device_config *)ptr;
emu_timer *timer = get_atarivc_eof_update_timer_for_screen(screen);
int i;
@@ -1584,8 +1584,8 @@ static TIMER_CALLBACK( unhalt_cpu )
void atarigen_swap_mem(void *ptr1, void *ptr2, int bytes)
{
- UINT8 *p1 = ptr1;
- UINT8 *p2 = ptr2;
+ UINT8 *p1 = (UINT8 *)ptr1;
+ UINT8 *p2 = (UINT8 *)ptr2;
while (bytes--)
{
int temp = *p1;
diff --git a/src/mame/machine/bublbobl.c b/src/mame/machine/bublbobl.c
index 4a5b60d20c2..229b2027d6b 100644
--- a/src/mame/machine/bublbobl.c
+++ b/src/mame/machine/bublbobl.c
@@ -347,10 +347,10 @@ WRITE8_HANDLER( boblbobl_ic43_a_w )
WRITE8_HANDLER( boblbobl_ic43_b_w )
{
- static const int xor[4] = { 4, 1, 8, 2 };
+ static const int xorval[4] = { 4, 1, 8, 2 };
// logerror("%04x: ic43_b_w (offs %d) %02x\n",cpu_get_pc(space->cpu),offset,data);
- ic43_b = (data >> 4) ^ xor[offset];
+ ic43_b = (data >> 4) ^ xorval[offset];
}
READ8_HANDLER( boblbobl_ic43_b_r )
diff --git a/src/mame/machine/cps2crpt.c b/src/mame/machine/cps2crpt.c
index 1dcf3077040..7551f61f22a 100644
--- a/src/mame/machine/cps2crpt.c
+++ b/src/mame/machine/cps2crpt.c
@@ -961,7 +961,7 @@ static const struct game_keys keys_table[] =
{ "progearj", { 0x9f7edc56,0x39fb47be }, 0x400000 }, // 0C81 63A1 B8D3 cmpi.l #$63A1B8D3,D1
{ "progeara", { 0x658ab128,0xfddc9b5e }, 0x400000 }, // 0C81 63A1 B8D3 cmpi.l #$63A1B8D3,D1
- { 0 } // end of table
+ { NULL, { 0,0 }, 0 } // end of table
};
diff --git a/src/mame/machine/dc.c b/src/mame/machine/dc.c
index b93c853df0c..2edda43ebb8 100644
--- a/src/mame/machine/dc.c
+++ b/src/mame/machine/dc.c
@@ -808,7 +808,7 @@ WRITE64_HANDLER( dc_maple_w )
INPUT_CHANGED( dc_coin_slots_callback )
{
- UINT32 *counter = param;
+ UINT32 *counter = (UINT32 *)param;
/* check for a 0 -> 1 transition */
if (!oldval && newval)
diff --git a/src/mame/machine/deco102.c b/src/mame/machine/deco102.c
index e618755207e..75a8344336f 100644
--- a/src/mame/machine/deco102.c
+++ b/src/mame/machine/deco102.c
@@ -28,7 +28,7 @@ static UINT16 decrypt(UINT16 data, int address, int select_xor)
{ 12,15,8,13,9,11,14,10, 6,5,4,3,2,1,0,7 }, { 11,12,13,14,15,8,9,10, 4,5,7,1,6,3,2,0 },
{ 13,8,12,14,11,15,10,9, 7,6,5,4,3,2,1,0 }, { 15,14,13,12,11,10,9,8, 0,6,7,4,3,2,1,5 }
};
- int j, xor;
+ int j, xorval;
const UINT8 *bs;
// calculate bitswap to use
@@ -39,10 +39,10 @@ static UINT16 decrypt(UINT16 data, int address, int select_xor)
// calculate xor to use
j = (address ^ select_xor) & 0x0f;
if (address & 0x40000) j ^= 2; // boogwing
- xor = xors[j];
+ xorval = xors[j];
// decrypt
- return xor ^ BITSWAP16(data,
+ return xorval ^ BITSWAP16(data,
bs[0],bs[1],bs[2],bs[3],bs[4],bs[5],bs[6],bs[7],
bs[8],bs[9],bs[10],bs[11],bs[12],bs[13],bs[14],bs[15]);
}
diff --git a/src/mame/machine/decocass.c b/src/mame/machine/decocass.c
index 28f6e265a70..d89b3d39f4d 100644
--- a/src/mame/machine/decocass.c
+++ b/src/mame/machine/decocass.c
@@ -1996,11 +1996,11 @@ static TIMER_CALLBACK( tape_clock_callback )
UINT32 dataclock = tape->clockpos - REGION_BOT_GAP_END_CLOCK;
/* compute the block number */
- tape->region = REGION_DATA_BLOCK_0 + dataclock / (TAPE_CLOCKS_PER_BYTE * BYTE_BLOCK_TOTAL);
+ tape->region = (tape_region)(REGION_DATA_BLOCK_0 + dataclock / (TAPE_CLOCKS_PER_BYTE * BYTE_BLOCK_TOTAL));
dataclock -= (tape->region - REGION_DATA_BLOCK_0) * TAPE_CLOCKS_PER_BYTE * BYTE_BLOCK_TOTAL;
/* compute the byte within the block */
- tape->bytenum = dataclock / TAPE_CLOCKS_PER_BYTE;
+ tape->bytenum = (tape_byte)(dataclock / TAPE_CLOCKS_PER_BYTE);
dataclock -= tape->bytenum * TAPE_CLOCKS_PER_BYTE;
/* compute the bit within the byte */
diff --git a/src/mame/machine/fd1089.c b/src/mame/machine/fd1089.c
index 8392dd0e8d5..df913779c4b 100644
--- a/src/mame/machine/fd1089.c
+++ b/src/mame/machine/fd1089.c
@@ -125,7 +125,7 @@ CPU # Type Status Game Seed Unencrypted data range
struct parameters
{
- int xor;
+ int xorval;
int s7,s6,s5,s4,s3,s2,s1,s0;
};
@@ -257,7 +257,7 @@ static int decode_fd1089a(int val,int key,int opcode)
table = rearrange_key(key, opcode);
p = &addr_params[table >> 4];
- val = BITSWAP8(val, p->s7,p->s6,p->s5,p->s4,p->s3,p->s2,p->s1,p->s0) ^ p->xor;
+ val = BITSWAP8(val, p->s7,p->s6,p->s5,p->s4,p->s3,p->s2,p->s1,p->s0) ^ p->xorval;
if (BIT(table,3)) val ^= 0x01;
if (BIT(table,0)) val ^= 0xb1;
@@ -296,7 +296,7 @@ static int decode_fd1089a(int val,int key,int opcode)
q = &data_params[family];
- val ^= q->xor;
+ val ^= q->xorval;
val = BITSWAP8(val, q->s7,q->s6,q->s5,q->s4,q->s3,q->s2,q->s1,q->s0);
return val;
@@ -305,7 +305,7 @@ static int decode_fd1089a(int val,int key,int opcode)
static int decode_fd1089b(int val,int key,int opcode)
{
int table;
- int xor;
+ int xorval;
const struct parameters *p;
@@ -316,7 +316,7 @@ static int decode_fd1089b(int val,int key,int opcode)
table = rearrange_key(key, opcode);
p = &addr_params[table >> 4];
- val = BITSWAP8(val, p->s7,p->s6,p->s5,p->s4,p->s3,p->s2,p->s1,p->s0) ^ p->xor;
+ val = BITSWAP8(val, p->s7,p->s6,p->s5,p->s4,p->s3,p->s2,p->s1,p->s0) ^ p->xorval;
if (BIT(table,3)) val ^= 0x01;
if (BIT(table,0)) val ^= 0xb1;
@@ -327,19 +327,19 @@ static int decode_fd1089b(int val,int key,int opcode)
val = basetable_fd1089[val];
- xor = 0;
+ xorval = 0;
if (opcode == 0)
{
- if (BIT(~table,6) & BIT(table,2)) xor ^= 0x01;
- if (BIT(table,4)) xor ^= 0x01;
+ if (BIT(~table,6) & BIT(table,2)) xorval ^= 0x01;
+ if (BIT(table,4)) xorval ^= 0x01;
}
else
{
- if (BIT(table,6) & BIT(table,2)) xor ^= 0x01;
- if (BIT(table,5)) xor ^= 0x01;
+ if (BIT(table,6) & BIT(table,2)) xorval ^= 0x01;
+ if (BIT(table,5)) xorval ^= 0x01;
}
- val ^= xor;
+ val ^= xorval;
if (BIT(table,2))
{
diff --git a/src/mame/machine/harddriv.c b/src/mame/machine/harddriv.c
index 2e9ed1b941d..d6021a47bd4 100644
--- a/src/mame/machine/harddriv.c
+++ b/src/mame/machine/harddriv.c
@@ -895,9 +895,9 @@ static TIMER_CALLBACK( deferred_adsp_bank_switch )
if (commands)
{
INT16 *base = (INT16 *)&som_memory[param * 0x2000];
- INT16 *end = base + (UINT16)*base++;
- INT16 *current = base;
- INT16 *table = base + (UINT16)*current++;
+ INT16 *end = base + (UINT16)*base;
+ INT16 *current = base + 1;
+ INT16 *table = base + 1 + (UINT16)*current++;
fprintf(commands, "\n---------------\n");
diff --git a/src/mame/machine/konamigx.c b/src/mame/machine/konamigx.c
index 5a27bb15e30..9892b4da63d 100644
--- a/src/mame/machine/konamigx.c
+++ b/src/mame/machine/konamigx.c
@@ -106,7 +106,7 @@ INLINE void K053936GP_copyroz32clip( running_machine *machine,
cmask = colormask[tilebpp];
src_pitch = src_bitmap->rowpixels;
- src_base = src_bitmap->base;
+ src_base = (UINT16 *)src_bitmap->base;
dst_ptr = dst_base;
cy = starty;
@@ -374,7 +374,7 @@ INLINE void zdrawgfxzoom32GP( running_machine *machine,
pal_base = machine->pens + gfx->color_base + (color % gfx->total_colors) * granularity;
shd_base = machine->shadow_table;
- dst_ptr = bitmap->base;
+ dst_ptr = (UINT32 *)bitmap->base;
dst_pitch = bitmap->rowpixels;
dst_minx = cliprect->min_x;
dst_maxx = cliprect->max_x;
diff --git a/src/mame/machine/mhavoc.c b/src/mame/machine/mhavoc.c
index f6813cf2872..4960fc75622 100644
--- a/src/mame/machine/mhavoc.c
+++ b/src/mame/machine/mhavoc.c
@@ -227,7 +227,7 @@ CUSTOM_INPUT( tms5220_r )
CUSTOM_INPUT( mhavoc_bit67_r )
{
- const char *tag1 = param;
+ const char *tag1 = (const char *)param;
const char *tag2 = tag1 + strlen(tag1) + 1;
return input_port_read(field->port->machine, player_1 ? tag2 : tag1) & 0x03;
}
diff --git a/src/mame/machine/namco50.c b/src/mame/machine/namco50.c
index 6e03c09fc43..b9db6bd7218 100644
--- a/src/mame/machine/namco50.c
+++ b/src/mame/machine/namco50.c
@@ -254,7 +254,7 @@ ADDRESS_MAP_END
static TIMER_CALLBACK( namco_50xx_irq_clear )
{
- const device_config *cpu = ptr;
+ const device_config *cpu = (const device_config *)ptr;
cpu_set_input_line(cpu, 0, CLEAR_LINE);
}
diff --git a/src/mame/machine/namcos1.c b/src/mame/machine/namcos1.c
index 1648bf8832e..a5618cba257 100644
--- a/src/mame/machine/namcos1.c
+++ b/src/mame/machine/namcos1.c
@@ -64,22 +64,6 @@ static WRITE8_HANDLER( bank14_w ) { (*namcos1_active_bank[13].bank_handler_w)(sp
static WRITE8_HANDLER( bank15_w ) { (*namcos1_active_bank[14].bank_handler_w)(space, offset + namcos1_active_bank[14].bank_offset, data); }
static WRITE8_HANDLER( bank16_w ) { (*namcos1_active_bank[15].bank_handler_w)(space, offset + namcos1_active_bank[15].bank_offset, data); }
-static const read8_space_func ram_bank_handler_r[16] =
-{
- SMH_BANK(1) ,SMH_BANK(2) ,SMH_BANK(3) ,SMH_BANK(4) ,
- SMH_BANK(5) ,SMH_BANK(6) ,SMH_BANK(7) ,SMH_BANK(8) ,
- SMH_BANK(9) ,SMH_BANK(10),SMH_BANK(11),SMH_BANK(12),
- SMH_BANK(13),SMH_BANK(14),SMH_BANK(15),SMH_BANK(16)
-};
-
-static const write8_space_func ram_bank_handler_w[16] =
-{
- SMH_BANK(1) ,SMH_BANK(2) ,SMH_BANK(3) ,SMH_BANK(4) ,
- SMH_BANK(5) ,SMH_BANK(6) ,SMH_BANK(7) ,SMH_BANK(8) ,
- SMH_BANK(9) ,SMH_BANK(10),SMH_BANK(11),SMH_BANK(12),
- SMH_BANK(13),SMH_BANK(14),SMH_BANK(15),SMH_BANK(16)
-};
-
static const read8_space_func io_bank_handler_r[16] =
{
bank1_r, bank2_r, bank3_r, bank4_r,
@@ -692,7 +676,7 @@ static void set_bank(running_machine *machine, int banknum, const bankhandler *h
if (!handler->bank_handler_r)
{
if (namcos1_active_bank[banknum].bank_handler_r)
- memory_install_read8_handler(space, bankstart, bankstart + 0x1fff, 0, 0, ram_bank_handler_r[banknum]);
+ memory_install_read8_handler(space, bankstart, bankstart + 0x1fff, 0, 0, (read8_space_func)SMH_BANK(banknum + 1));
}
else
{
@@ -706,7 +690,7 @@ static void set_bank(running_machine *machine, int banknum, const bankhandler *h
if (!handler->bank_handler_w)
{
if (namcos1_active_bank[banknum].bank_handler_w)
- memory_install_write8_handler(space, bankstart, bankstart + 0x1fff, 0, 0, ram_bank_handler_w[banknum]);
+ memory_install_write8_handler(space, bankstart, bankstart + 0x1fff, 0, 0, (write8_space_func)SMH_BANK(banknum + 1));
}
else
{
diff --git a/src/mame/machine/naomibd.c b/src/mame/machine/naomibd.c
index edd9301ee88..34cfabaca21 100644
--- a/src/mame/machine/naomibd.c
+++ b/src/mame/machine/naomibd.c
@@ -112,7 +112,7 @@ INLINE naomibd_state *get_safe_token(const device_config *device)
int naomibd_interrupt_callback(const device_config *device, naomibd_interrupt_func callback)
{
- naomibd_config *config = device->inline_config;
+ naomibd_config *config = (naomibd_config *)device->inline_config;
//naomibd_state *v = get_safe_token(device);
config->interrupt = callback;
@@ -522,7 +522,7 @@ static void load_rom_gdrom(running_machine* machine, naomibd_state *v)
static DEVICE_START( naomibd )
{
- const naomibd_config *config = device->inline_config;
+ const naomibd_config *config = (const naomibd_config *)device->inline_config;
naomibd_state *v = get_safe_token(device);
/* validate some basic stuff */
@@ -623,7 +623,7 @@ static DEVICE_NVRAM( naomibd )
DEVICE_GET_INFO( naomibd )
{
- const naomibd_config *config = (device != NULL) ? device->inline_config : NULL;
+ const naomibd_config *config = (device != NULL) ? (const naomibd_config *)device->inline_config : NULL;
switch (state)
{
/* --- the following bits of info are returned as 64-bit signed integers --- */
diff --git a/src/mame/machine/neocrypt.c b/src/mame/machine/neocrypt.c
index 43d6c3efb37..ae8ef64141c 100644
--- a/src/mame/machine/neocrypt.c
+++ b/src/mame/machine/neocrypt.c
@@ -674,7 +674,7 @@ void cmc50_neogeo_gfx_decrypt(running_machine *machine, int extra_xor)
/* ms5pcb and svcpcb have an additional scramble on top of the standard CMC scrambling */
void svcpcb_gfx_decrypt(running_machine *machine)
{
- static const UINT8 xor[ 4 ] = { 0x34, 0x21, 0xc4, 0xe9 };
+ static const UINT8 xorval[ 4 ] = { 0x34, 0x21, 0xc4, 0xe9 };
int i;
int ofst;
int rom_size = memory_region_length( machine, "sprites" );
@@ -683,7 +683,7 @@ void svcpcb_gfx_decrypt(running_machine *machine)
for( i = 0; i < rom_size; i++ )
{
- rom[ i ] ^= xor[ (i % 4) ];
+ rom[ i ] ^= xorval[ (i % 4) ];
}
for( i = 0; i < rom_size; i += 4 )
{
@@ -724,7 +724,7 @@ void svcpcb_s1data_decrypt(running_machine *machine)
/* Thanks to Razoola & Halrin for the info */
void kf2k3pcb_gfx_decrypt(running_machine *machine)
{
- static const UINT8 xor[ 4 ] = { 0x34, 0x21, 0xc4, 0xe9 };
+ static const UINT8 xorval[ 4 ] = { 0x34, 0x21, 0xc4, 0xe9 };
int i;
int ofst;
int rom_size = memory_region_length( machine, "sprites" );
@@ -733,7 +733,7 @@ void kf2k3pcb_gfx_decrypt(running_machine *machine)
for ( i = 0; i < rom_size; i++ )
{
- rom[ i ] ^= xor[ (i % 4) ];
+ rom[ i ] ^= xorval[ (i % 4) ];
}
for ( i = 0; i < rom_size; i+=4 )
{
diff --git a/src/mame/machine/qix.c b/src/mame/machine/qix.c
index 6ea793ac179..75a6d1912cd 100644
--- a/src/mame/machine/qix.c
+++ b/src/mame/machine/qix.c
@@ -226,7 +226,7 @@ const pia6821_interface slither_pia_2_intf =
MACHINE_RESET( qix )
{
- qix_state *state = machine->driver_data;
+ qix_state *state = (qix_state *)machine->driver_data;
/* reset the coin counter register */
state->coinctrl = 0x00;
@@ -235,7 +235,7 @@ MACHINE_RESET( qix )
MACHINE_START( qixmcu )
{
- qix_state *state = machine->driver_data;
+ qix_state *state = (qix_state *)machine->driver_data;
/* set up save states */
state_save_register_global_array(machine, state->_68705_port_in);
@@ -347,7 +347,7 @@ READ8_HANDLER( qix_video_firq_ack_r )
READ8_DEVICE_HANDLER( qixmcu_coin_r )
{
- qix_state *state = device->machine->driver_data;
+ qix_state *state = (qix_state *)device->machine->driver_data;
logerror("6809:qixmcu_coin_r = %02X\n", state->_68705_port_out[0]);
return state->_68705_port_out[0];
@@ -356,7 +356,7 @@ READ8_DEVICE_HANDLER( qixmcu_coin_r )
static WRITE8_DEVICE_HANDLER( qixmcu_coin_w )
{
- qix_state *state = device->machine->driver_data;
+ qix_state *state = (qix_state *)device->machine->driver_data;
logerror("6809:qixmcu_coin_w = %02X\n", data);
/* this is a callback called by pia6821_w(), so I don't need to synchronize */
@@ -367,7 +367,7 @@ static WRITE8_DEVICE_HANDLER( qixmcu_coin_w )
static WRITE8_DEVICE_HANDLER( qixmcu_coinctrl_w )
{
- qix_state *state = device->machine->driver_data;
+ qix_state *state = (qix_state *)device->machine->driver_data;
/* if (!(data & 0x04)) */
if (data & 0x04)
@@ -396,7 +396,7 @@ static WRITE8_DEVICE_HANDLER( qixmcu_coinctrl_w )
READ8_HANDLER( qix_68705_portA_r )
{
- qix_state *state = space->machine->driver_data;
+ qix_state *state = (qix_state *)space->machine->driver_data;
UINT8 ddr = state->_68705_ddr[0];
UINT8 out = state->_68705_port_out[0];
@@ -408,7 +408,7 @@ READ8_HANDLER( qix_68705_portA_r )
READ8_HANDLER( qix_68705_portB_r )
{
- qix_state *state = space->machine->driver_data;
+ qix_state *state = (qix_state *)space->machine->driver_data;
UINT8 ddr = state->_68705_ddr[1];
UINT8 out = state->_68705_port_out[1];
@@ -419,7 +419,7 @@ READ8_HANDLER( qix_68705_portB_r )
READ8_HANDLER( qix_68705_portC_r )
{
- qix_state *state = space->machine->driver_data;
+ qix_state *state = (qix_state *)space->machine->driver_data;
UINT8 ddr = state->_68705_ddr[2];
UINT8 out = state->_68705_port_out[2];
@@ -437,7 +437,7 @@ READ8_HANDLER( qix_68705_portC_r )
WRITE8_HANDLER( qix_68705_portA_w )
{
- qix_state *state = space->machine->driver_data;
+ qix_state *state = (qix_state *)space->machine->driver_data;
logerror("68705:portA_w = %02X\n", data);
state->_68705_port_out[0] = data;
@@ -446,7 +446,7 @@ WRITE8_HANDLER( qix_68705_portA_w )
WRITE8_HANDLER( qix_68705_portB_w )
{
- qix_state *state = space->machine->driver_data;
+ qix_state *state = (qix_state *)space->machine->driver_data;
state->_68705_port_out[1] = data;
coin_lockout_w(0, (~data >> 6) & 1);
@@ -456,7 +456,7 @@ WRITE8_HANDLER( qix_68705_portB_w )
WRITE8_HANDLER( qix_68705_portC_w )
{
- qix_state *state = space->machine->driver_data;
+ qix_state *state = (qix_state *)space->machine->driver_data;
state->_68705_port_out[2] = data;
}
@@ -536,7 +536,7 @@ static WRITE8_DEVICE_HANDLER( slither_76489_1_w )
static READ8_DEVICE_HANDLER( slither_trak_lr_r )
{
- qix_state *state = device->machine->driver_data;
+ qix_state *state = (qix_state *)device->machine->driver_data;
return input_port_read(device->machine, state->flip ? "AN3" : "AN1");
}
@@ -544,7 +544,7 @@ static READ8_DEVICE_HANDLER( slither_trak_lr_r )
static READ8_DEVICE_HANDLER( slither_trak_ud_r )
{
- qix_state *state = device->machine->driver_data;
+ qix_state *state = (qix_state *)device->machine->driver_data;
return input_port_read(device->machine, state->flip ? "AN2" : "AN0");
}
diff --git a/src/mame/machine/scramble.c b/src/mame/machine/scramble.c
index a3e9ef7ce67..1df71257f94 100644
--- a/src/mame/machine/scramble.c
+++ b/src/mame/machine/scramble.c
@@ -71,7 +71,7 @@ CUSTOM_INPUT( darkplnt_custom_r )
0x2b, 0x2a, 0x28, 0x29, 0x09, 0x08, 0x0a, 0x0b,
0x0f, 0x0e, 0x0c, 0x0d, 0x2d, 0x2c, 0x2e, 0x2f,
0x27, 0x26, 0x24, 0x25, 0x05, 0x04, 0x06, 0x07 };
- UINT8 val = input_port_read(field->port->machine, param);
+ UINT8 val = input_port_read(field->port->machine, (const char *)param);
return remap[val >> 2];
}
@@ -323,9 +323,9 @@ DRIVER_INIT( devilfsh )
for (j = 0; j < 16; j++)
{
- offs_t new = BITSWAP8(j,7,6,5,4,2,0,3,1);
+ offs_t newval = BITSWAP8(j,7,6,5,4,2,0,3,1);
- swapbuffer[j] = RAM[i + new];
+ swapbuffer[j] = RAM[i + newval];
}
memcpy(&RAM[i], swapbuffer, 16);
diff --git a/src/mame/machine/segacrpt.c b/src/mame/machine/segacrpt.c
index 2d14f2f5cc9..9143152eccf 100644
--- a/src/mame/machine/segacrpt.c
+++ b/src/mame/machine/segacrpt.c
@@ -247,7 +247,7 @@ static void sega_decode(running_machine *machine, const char *cputag, const UINT
for (A = 0x0000;A < cryptlen;A++)
{
- int xor = 0;
+ int xorval = 0;
UINT8 src = rom[A];
@@ -260,14 +260,14 @@ static void sega_decode(running_machine *machine, const char *cputag, const UINT
if (src & 0x80)
{
col = 3 - col;
- xor = 0xa8;
+ xorval = 0xa8;
}
/* decode the opcodes */
- decrypted[A] = (src & ~0xa8) | (convtable[2*row][col] ^ xor);
+ decrypted[A] = (src & ~0xa8) | (convtable[2*row][col] ^ xorval);
/* decode the data */
- rom[A] = (src & ~0xa8) | (convtable[2*row+1][col] ^ xor);
+ rom[A] = (src & ~0xa8) | (convtable[2*row+1][col] ^ xorval);
if (convtable[2*row][col] == 0xff) /* table incomplete! (for development) */
decrypted[A] = 0xee;
@@ -468,7 +468,7 @@ void toprollr_decode(running_machine *machine, const char *cputag, const char *r
for(bankstart=0;bankstart<0x6000*3;bankstart+=0x6000)
for (A = 0x0000;A < 0x6000;A++)
{
- int xor = 0;
+ int xorval = 0;
UINT8 src = rom[A+bankstart];
@@ -481,14 +481,14 @@ void toprollr_decode(running_machine *machine, const char *cputag, const char *r
if (src & 0x80)
{
col = 3 - col;
- xor = 0xa8;
+ xorval = 0xa8;
}
/* decode the opcodes */
- decrypted[A+bankstart] = (src & ~0xa8) | (convtable[2*row][col] ^ xor);
+ decrypted[A+bankstart] = (src & ~0xa8) | (convtable[2*row][col] ^ xorval);
/* decode the data */
- rom[A+bankstart] = (src & ~0xa8) | (convtable[2*row+1][col] ^ xor);
+ rom[A+bankstart] = (src & ~0xa8) | (convtable[2*row+1][col] ^ xorval);
}
memory_configure_bank(machine, 1,0,3, memory_region(machine, regiontag),0x6000);
@@ -823,7 +823,7 @@ void jongkyo_decode(running_machine *machine, const char *cputag)
for (A = 0x0000;A < 0x9000;A++)
{
- int xor = 0;
+ int xorval = 0;
UINT8 src = rom[A];
@@ -836,7 +836,7 @@ void jongkyo_decode(running_machine *machine, const char *cputag)
if (src & 0x80)
{
col = 3 - col;
- xor = 0xa8;
+ xorval = 0xa8;
}
/* special handling for banked area */
@@ -844,10 +844,10 @@ void jongkyo_decode(running_machine *machine, const char *cputag)
row = (A & 1) + (((A >> 4) & 1) << 1) + (((A >> 8) & 1) << 2);
/* decode the opcodes */
- decrypted[A] = (src & ~0xa8) | (convtable[2*row][col] ^ xor);
+ decrypted[A] = (src & ~0xa8) | (convtable[2*row][col] ^ xorval);
/* decode the data */
- rom[A] = (src & ~0xa8) | (convtable[2*row+1][col] ^ xor);
+ rom[A] = (src & ~0xa8) | (convtable[2*row+1][col] ^ xorval);
}
memory_configure_bank(machine, 1,0,8, memory_region(machine, cputag)+0x7000,0x0400);
diff --git a/src/mame/machine/segaic16.c b/src/mame/machine/segaic16.c
index 453b4356909..8be3077484b 100644
--- a/src/mame/machine/segaic16.c
+++ b/src/mame/machine/segaic16.c
@@ -383,9 +383,9 @@ static void update_memory_mapping(running_machine *machine, struct memory_mapper
if (decrypt)
{
- decrypted = fd1094_get_decrypted_base();
+ decrypted = (UINT8 *)fd1094_get_decrypted_base();
if (!decrypted)
- decrypted = fd1089_get_decrypted_base();
+ decrypted = (UINT8 *)fd1089_get_decrypted_base();
}
memory_configure_bank(machine, banknum, 0, 1, (UINT8 *)chip->cpu->region + region_start, 0);
diff --git a/src/mame/machine/snesdsp1.c b/src/mame/machine/snesdsp1.c
index 438f239f96c..535d7d0f693 100644
--- a/src/mame/machine/snesdsp1.c
+++ b/src/mame/machine/snesdsp1.c
@@ -40,10 +40,20 @@ struct DSP1_Command {
unsigned int writes;
};
-static const struct DSP1_Command mCommandTable[0x40];
-static const INT16 DSP1_MaxAZS_Exp[16];
-static const INT16 DSP1_SinTable[256];
-static const INT16 DSP1_MulTable[256];
+
+//////////////////////////////////////////////////////////////////
+
+// Data ROM, as logged from a DSP-1B with the 0x1f command;
+// it contains the tables and constants used by the commands.
+// The tables used are: two shift tables (0x022-0x031 and 0x031-0x040 -this last one
+// with an error in 0x03c which has survived to all the DSP-1 revisions-); a inverse
+// table (used as initial guess) at 0x065-0x0e4; a square root table (used also
+// as initial guess) at 0x0e5-0x115; two sin and cos tables (used as nodes to construct
+// a interpolation curve) at, respectively, 0x116-0x197 and 0x196-0x215.
+// As a curiosity, in the positions 0x21c-0x31c it's contained a
+// 257-points arccos table that, apparently, have been not used anywhere
+// (maybe for the MaxAZS_Exp table?).
+
static UINT16 DSP1_DataRom[1024];
static struct SharedData { // some RAM variables shared between commands
@@ -121,6 +131,161 @@ static INT16 shiftR(INT16 C, INT16 E);
//////////////////////////////////////////////////////////////////
+// The info on this table follows Overload's docs.
+
+static const struct DSP1_Command mCommandTable[0x40] =
+{
+ {&DSP1_multiply, 2, 1}, //0x00
+ {&DSP1_attitudeA, 4, 0}, //0x01
+ {&DSP1_parameter, 7, 4}, //0x02
+ {&DSP1_subjectiveA, 3, 3}, //0x03
+ {&DSP1_triangle, 2, 2}, //0x04
+ {&DSP1_attitudeA, 4, 0}, //0x01
+ {&DSP1_project, 3, 3}, //0x06
+ {&DSP1_memoryTest, 1, 1}, //0x0f
+ {&DSP1_radius, 3, 2}, //0x08
+ {&DSP1_objectiveA, 3, 3}, //0x0d
+ {&DSP1_raster, 1, 4}, // 0x0a. This will normally work in continuous mode
+ {&DSP1_scalarA, 3, 1}, //0x0b
+ {&DSP1_rotate, 3, 2}, //0x0c
+ {&DSP1_objectiveA, 3, 3}, //0x0d
+ {&DSP1_target, 2, 2}, //0x0e
+ {&DSP1_memoryTest, 1, 1}, //0x0f
+
+ {&DSP1_inverse, 2, 2}, //0x10
+ {&DSP1_attitudeB, 4, 0}, //0x11
+ {&DSP1_parameter, 7, 4}, //0x02
+ {&DSP1_subjectiveB, 3, 3}, //0x13
+ {&DSP1_gyrate, 6, 3}, //0x14
+ {&DSP1_attitudeB, 4, 0}, //0x11
+ {&DSP1_project, 3, 3}, //0x06
+ {&DSP1_memoryDump, 1, 1024}, //0x1f
+ {&DSP1_range, 4, 1}, //0x18
+ {&DSP1_objectiveB, 3, 3}, //0x1d
+ {0, 0, 0}, // 0x1a; the chip freezes
+ {&DSP1_scalarB, 3, 1}, //0x1b
+ {&DSP1_polar, 6, 3}, //0x1c
+ {&DSP1_objectiveB, 3, 3}, //0x1d
+ {&DSP1_target, 2, 2}, //0x0e
+ {&DSP1_memoryDump, 1, 1024}, //0x1f
+
+ {&DSP1_multiply2, 2, 1}, //0x20
+ {&DSP1_attitudeC, 4, 0}, //0x21
+ {&DSP1_parameter, 7, 4}, //0x02
+ {&DSP1_subjectiveC, 3, 3}, //0x23
+ {&DSP1_triangle, 2, 2}, //0x04
+ {&DSP1_attitudeC, 4, 0}, //0x21
+ {&DSP1_project, 3, 3}, //0x06
+ {&DSP1_memorySize, 1, 1}, //0x2f
+ {&DSP1_distance, 3, 1}, //0x28
+ {&DSP1_objectiveC, 3, 3}, //0x2d
+ {0, 0, 0}, // 0x1a; the chip freezes
+ {&DSP1_scalarC, 3, 1}, //0x2b
+ {&DSP1_rotate, 3, 2}, //0x0c
+ {&DSP1_objectiveC, 3, 3}, //0x2d
+ {&DSP1_target, 2, 2}, //0x0e
+ {&DSP1_memorySize, 1, 1}, //0x2f
+
+ {&DSP1_inverse, 2, 2}, //0x10
+ {&DSP1_attitudeA, 4, 0}, //0x01
+ {&DSP1_parameter, 7, 4}, //0x02
+ {&DSP1_subjectiveA, 3, 3}, //0x03
+ {&DSP1_gyrate, 6, 3}, //0x14
+ {&DSP1_attitudeA, 4, 0}, //0x01
+ {&DSP1_project, 3, 3}, //0x06
+ {&DSP1_memoryDump, 1, 1024}, //0x1f
+ {&DSP1_range2, 4, 1}, //0x38
+ {&DSP1_objectiveA, 3, 3}, //0x0d
+ {0, 0, 0}, // 0x1a; the chip freezes
+ {&DSP1_scalarA, 3, 1}, //0x0b
+ {&DSP1_polar, 6, 3}, //0x1c
+ {&DSP1_objectiveA, 3, 3}, //0x0d
+ {&DSP1_target, 2, 2}, //0x0e
+ {&DSP1_memoryDump, 1, 1024}, //0x1f
+};
+
+//////////////////////////////////////////////////////////////////
+
+static const INT16 DSP1_MaxAZS_Exp[16] = {
+ 0x38b4, 0x38b7, 0x38ba, 0x38be, 0x38c0, 0x38c4, 0x38c7, 0x38ca,
+ 0x38ce, 0x38d0, 0x38d4, 0x38d7, 0x38da, 0x38dd, 0x38e0, 0x38e4
+};
+
+//////////////////////////////////////////////////////////////////
+
+static const INT16 DSP1_SinTable[256] = {
+ 0x0000, 0x0324, 0x0647, 0x096a, 0x0c8b, 0x0fab, 0x12c8, 0x15e2,
+ 0x18f8, 0x1c0b, 0x1f19, 0x2223, 0x2528, 0x2826, 0x2b1f, 0x2e11,
+ 0x30fb, 0x33de, 0x36ba, 0x398c, 0x3c56, 0x3f17, 0x41ce, 0x447a,
+ 0x471c, 0x49b4, 0x4c3f, 0x4ebf, 0x5133, 0x539b, 0x55f5, 0x5842,
+ 0x5a82, 0x5cb4, 0x5ed7, 0x60ec, 0x62f2, 0x64e8, 0x66cf, 0x68a6,
+ 0x6a6d, 0x6c24, 0x6dca, 0x6f5f, 0x70e2, 0x7255, 0x73b5, 0x7504,
+ 0x7641, 0x776c, 0x7884, 0x798a, 0x7a7d, 0x7b5d, 0x7c29, 0x7ce3,
+ 0x7d8a, 0x7e1d, 0x7e9d, 0x7f09, 0x7f62, 0x7fa7, 0x7fd8, 0x7ff6,
+ 0x7fff, 0x7ff6, 0x7fd8, 0x7fa7, 0x7f62, 0x7f09, 0x7e9d, 0x7e1d,
+ 0x7d8a, 0x7ce3, 0x7c29, 0x7b5d, 0x7a7d, 0x798a, 0x7884, 0x776c,
+ 0x7641, 0x7504, 0x73b5, 0x7255, 0x70e2, 0x6f5f, 0x6dca, 0x6c24,
+ 0x6a6d, 0x68a6, 0x66cf, 0x64e8, 0x62f2, 0x60ec, 0x5ed7, 0x5cb4,
+ 0x5a82, 0x5842, 0x55f5, 0x539b, 0x5133, 0x4ebf, 0x4c3f, 0x49b4,
+ 0x471c, 0x447a, 0x41ce, 0x3f17, 0x3c56, 0x398c, 0x36ba, 0x33de,
+ 0x30fb, 0x2e11, 0x2b1f, 0x2826, 0x2528, 0x2223, 0x1f19, 0x1c0b,
+ 0x18f8, 0x15e2, 0x12c8, 0x0fab, 0x0c8b, 0x096a, 0x0647, 0x0324,
+ -0x0000, -0x0324, -0x0647, -0x096a, -0x0c8b, -0x0fab, -0x12c8, -0x15e2,
+ -0x18f8, -0x1c0b, -0x1f19, -0x2223, -0x2528, -0x2826, -0x2b1f, -0x2e11,
+ -0x30fb, -0x33de, -0x36ba, -0x398c, -0x3c56, -0x3f17, -0x41ce, -0x447a,
+ -0x471c, -0x49b4, -0x4c3f, -0x4ebf, -0x5133, -0x539b, -0x55f5, -0x5842,
+ -0x5a82, -0x5cb4, -0x5ed7, -0x60ec, -0x62f2, -0x64e8, -0x66cf, -0x68a6,
+ -0x6a6d, -0x6c24, -0x6dca, -0x6f5f, -0x70e2, -0x7255, -0x73b5, -0x7504,
+ -0x7641, -0x776c, -0x7884, -0x798a, -0x7a7d, -0x7b5d, -0x7c29, -0x7ce3,
+ -0x7d8a, -0x7e1d, -0x7e9d, -0x7f09, -0x7f62, -0x7fa7, -0x7fd8, -0x7ff6,
+ -0x7fff, -0x7ff6, -0x7fd8, -0x7fa7, -0x7f62, -0x7f09, -0x7e9d, -0x7e1d,
+ -0x7d8a, -0x7ce3, -0x7c29, -0x7b5d, -0x7a7d, -0x798a, -0x7884, -0x776c,
+ -0x7641, -0x7504, -0x73b5, -0x7255, -0x70e2, -0x6f5f, -0x6dca, -0x6c24,
+ -0x6a6d, -0x68a6, -0x66cf, -0x64e8, -0x62f2, -0x60ec, -0x5ed7, -0x5cb4,
+ -0x5a82, -0x5842, -0x55f5, -0x539b, -0x5133, -0x4ebf, -0x4c3f, -0x49b4,
+ -0x471c, -0x447a, -0x41ce, -0x3f17, -0x3c56, -0x398c, -0x36ba, -0x33de,
+ -0x30fb, -0x2e11, -0x2b1f, -0x2826, -0x2528, -0x2223, -0x1f19, -0x1c0b,
+ -0x18f8, -0x15e2, -0x12c8, -0x0fab, -0x0c8b, -0x096a, -0x0647, -0x0324};
+
+ //////////////////////////////////////////////////////////////////
+
+// Optimised for Performance
+static const INT16 DSP1_MulTable[256] = {
+ 0x0000, 0x0003, 0x0006, 0x0009, 0x000c, 0x000f, 0x0012, 0x0015,
+ 0x0019, 0x001c, 0x001f, 0x0022, 0x0025, 0x0028, 0x002b, 0x002f,
+ 0x0032, 0x0035, 0x0038, 0x003b, 0x003e, 0x0041, 0x0045, 0x0048,
+ 0x004b, 0x004e, 0x0051, 0x0054, 0x0057, 0x005b, 0x005e, 0x0061,
+ 0x0064, 0x0067, 0x006a, 0x006d, 0x0071, 0x0074, 0x0077, 0x007a,
+ 0x007d, 0x0080, 0x0083, 0x0087, 0x008a, 0x008d, 0x0090, 0x0093,
+ 0x0096, 0x0099, 0x009d, 0x00a0, 0x00a3, 0x00a6, 0x00a9, 0x00ac,
+ 0x00af, 0x00b3, 0x00b6, 0x00b9, 0x00bc, 0x00bf, 0x00c2, 0x00c5,
+ 0x00c9, 0x00cc, 0x00cf, 0x00d2, 0x00d5, 0x00d8, 0x00db, 0x00df,
+ 0x00e2, 0x00e5, 0x00e8, 0x00eb, 0x00ee, 0x00f1, 0x00f5, 0x00f8,
+ 0x00fb, 0x00fe, 0x0101, 0x0104, 0x0107, 0x010b, 0x010e, 0x0111,
+ 0x0114, 0x0117, 0x011a, 0x011d, 0x0121, 0x0124, 0x0127, 0x012a,
+ 0x012d, 0x0130, 0x0133, 0x0137, 0x013a, 0x013d, 0x0140, 0x0143,
+ 0x0146, 0x0149, 0x014d, 0x0150, 0x0153, 0x0156, 0x0159, 0x015c,
+ 0x015f, 0x0163, 0x0166, 0x0169, 0x016c, 0x016f, 0x0172, 0x0175,
+ 0x0178, 0x017c, 0x017f, 0x0182, 0x0185, 0x0188, 0x018b, 0x018e,
+ 0x0192, 0x0195, 0x0198, 0x019b, 0x019e, 0x01a1, 0x01a4, 0x01a8,
+ 0x01ab, 0x01ae, 0x01b1, 0x01b4, 0x01b7, 0x01ba, 0x01be, 0x01c1,
+ 0x01c4, 0x01c7, 0x01ca, 0x01cd, 0x01d0, 0x01d4, 0x01d7, 0x01da,
+ 0x01dd, 0x01e0, 0x01e3, 0x01e6, 0x01ea, 0x01ed, 0x01f0, 0x01f3,
+ 0x01f6, 0x01f9, 0x01fc, 0x0200, 0x0203, 0x0206, 0x0209, 0x020c,
+ 0x020f, 0x0212, 0x0216, 0x0219, 0x021c, 0x021f, 0x0222, 0x0225,
+ 0x0228, 0x022c, 0x022f, 0x0232, 0x0235, 0x0238, 0x023b, 0x023e,
+ 0x0242, 0x0245, 0x0248, 0x024b, 0x024e, 0x0251, 0x0254, 0x0258,
+ 0x025b, 0x025e, 0x0261, 0x0264, 0x0267, 0x026a, 0x026e, 0x0271,
+ 0x0274, 0x0277, 0x027a, 0x027d, 0x0280, 0x0284, 0x0287, 0x028a,
+ 0x028d, 0x0290, 0x0293, 0x0296, 0x029a, 0x029d, 0x02a0, 0x02a3,
+ 0x02a6, 0x02a9, 0x02ac, 0x02b0, 0x02b3, 0x02b6, 0x02b9, 0x02bc,
+ 0x02bf, 0x02c2, 0x02c6, 0x02c9, 0x02cc, 0x02cf, 0x02d2, 0x02d5,
+ 0x02d8, 0x02db, 0x02df, 0x02e2, 0x02e5, 0x02e8, 0x02eb, 0x02ee,
+ 0x02f1, 0x02f5, 0x02f8, 0x02fb, 0x02fe, 0x0301, 0x0304, 0x0307,
+ 0x030b, 0x030e, 0x0311, 0x0314, 0x0317, 0x031a, 0x031d, 0x0321};
+
+//////////////////////////////////////////////////////////////////
+
static UINT8 DSP1_getSr(void)
{
mSrLowByteAccess = ~mSrLowByteAccess;
@@ -294,81 +459,6 @@ static void DSP1_fsmStep(UINT8 read, UINT8 *data)
//////////////////////////////////////////////////////////////////
-// The info on this table follows Overload's docs.
-
-static const struct DSP1_Command mCommandTable[0x40] =
-{
- {&DSP1_multiply, 2, 1}, //0x00
- {&DSP1_attitudeA, 4, 0}, //0x01
- {&DSP1_parameter, 7, 4}, //0x02
- {&DSP1_subjectiveA, 3, 3}, //0x03
- {&DSP1_triangle, 2, 2}, //0x04
- {&DSP1_attitudeA, 4, 0}, //0x01
- {&DSP1_project, 3, 3}, //0x06
- {&DSP1_memoryTest, 1, 1}, //0x0f
- {&DSP1_radius, 3, 2}, //0x08
- {&DSP1_objectiveA, 3, 3}, //0x0d
- {&DSP1_raster, 1, 4}, // 0x0a. This will normally work in continuous mode
- {&DSP1_scalarA, 3, 1}, //0x0b
- {&DSP1_rotate, 3, 2}, //0x0c
- {&DSP1_objectiveA, 3, 3}, //0x0d
- {&DSP1_target, 2, 2}, //0x0e
- {&DSP1_memoryTest, 1, 1}, //0x0f
-
- {&DSP1_inverse, 2, 2}, //0x10
- {&DSP1_attitudeB, 4, 0}, //0x11
- {&DSP1_parameter, 7, 4}, //0x02
- {&DSP1_subjectiveB, 3, 3}, //0x13
- {&DSP1_gyrate, 6, 3}, //0x14
- {&DSP1_attitudeB, 4, 0}, //0x11
- {&DSP1_project, 3, 3}, //0x06
- {&DSP1_memoryDump, 1, 1024}, //0x1f
- {&DSP1_range, 4, 1}, //0x18
- {&DSP1_objectiveB, 3, 3}, //0x1d
- {0, 0, 0}, // 0x1a; the chip freezes
- {&DSP1_scalarB, 3, 1}, //0x1b
- {&DSP1_polar, 6, 3}, //0x1c
- {&DSP1_objectiveB, 3, 3}, //0x1d
- {&DSP1_target, 2, 2}, //0x0e
- {&DSP1_memoryDump, 1, 1024}, //0x1f
-
- {&DSP1_multiply2, 2, 1}, //0x20
- {&DSP1_attitudeC, 4, 0}, //0x21
- {&DSP1_parameter, 7, 4}, //0x02
- {&DSP1_subjectiveC, 3, 3}, //0x23
- {&DSP1_triangle, 2, 2}, //0x04
- {&DSP1_attitudeC, 4, 0}, //0x21
- {&DSP1_project, 3, 3}, //0x06
- {&DSP1_memorySize, 1, 1}, //0x2f
- {&DSP1_distance, 3, 1}, //0x28
- {&DSP1_objectiveC, 3, 3}, //0x2d
- {0, 0, 0}, // 0x1a; the chip freezes
- {&DSP1_scalarC, 3, 1}, //0x2b
- {&DSP1_rotate, 3, 2}, //0x0c
- {&DSP1_objectiveC, 3, 3}, //0x2d
- {&DSP1_target, 2, 2}, //0x0e
- {&DSP1_memorySize, 1, 1}, //0x2f
-
- {&DSP1_inverse, 2, 2}, //0x10
- {&DSP1_attitudeA, 4, 0}, //0x01
- {&DSP1_parameter, 7, 4}, //0x02
- {&DSP1_subjectiveA, 3, 3}, //0x03
- {&DSP1_gyrate, 6, 3}, //0x14
- {&DSP1_attitudeA, 4, 0}, //0x01
- {&DSP1_project, 3, 3}, //0x06
- {&DSP1_memoryDump, 1, 1024}, //0x1f
- {&DSP1_range2, 4, 1}, //0x38
- {&DSP1_objectiveA, 3, 3}, //0x0d
- {0, 0, 0}, // 0x1a; the chip freezes
- {&DSP1_scalarA, 3, 1}, //0x0b
- {&DSP1_polar, 6, 3}, //0x1c
- {&DSP1_objectiveA, 3, 3}, //0x0d
- {&DSP1_target, 2, 2}, //0x0e
- {&DSP1_memoryDump, 1, 1024}, //0x1f
-};
-
-//////////////////////////////////////////////////////////////////
-
static void DSP1_memoryTest(INT16 *input, INT16 *output)
{
// INT16 *Size = &input[0];
@@ -970,13 +1060,6 @@ static void DSP1_gyrate(INT16 *input, INT16 *output)
//////////////////////////////////////////////////////////////////
-static const INT16 DSP1_MaxAZS_Exp[16] = {
- 0x38b4, 0x38b7, 0x38ba, 0x38be, 0x38c0, 0x38c4, 0x38c7, 0x38ca,
- 0x38ce, 0x38d0, 0x38d4, 0x38d7, 0x38da, 0x38dd, 0x38e0, 0x38e4
-};
-
-//////////////////////////////////////////////////////////////////
-
// Set-up the projection framework. Besides returning some values, it store in RAM some values that
// will be used by the other three projection commands (raster, target an project)
@@ -1336,7 +1419,7 @@ static INT16 DSP1_sin(INT16 Angle)
if (Angle < 0) {
if (Angle == -32768) return 0;
- return -sin(-Angle);
+ return -sin((double)-Angle);
}
S = DSP1_SinTable[Angle >> 8] + (DSP1_MulTable[Angle & 0xff] * DSP1_SinTable[0x40 + (Angle >> 8)] >> 15);
if (S > 32767) S = 32767;
@@ -1533,90 +1616,3 @@ static INT16 shiftR(INT16 C, INT16 E)
{
return (C * DSP1_DataRom[0x0031 + E] >> 15);
}
-
-//////////////////////////////////////////////////////////////////
-
-static const INT16 DSP1_SinTable[256] = {
- 0x0000, 0x0324, 0x0647, 0x096a, 0x0c8b, 0x0fab, 0x12c8, 0x15e2,
- 0x18f8, 0x1c0b, 0x1f19, 0x2223, 0x2528, 0x2826, 0x2b1f, 0x2e11,
- 0x30fb, 0x33de, 0x36ba, 0x398c, 0x3c56, 0x3f17, 0x41ce, 0x447a,
- 0x471c, 0x49b4, 0x4c3f, 0x4ebf, 0x5133, 0x539b, 0x55f5, 0x5842,
- 0x5a82, 0x5cb4, 0x5ed7, 0x60ec, 0x62f2, 0x64e8, 0x66cf, 0x68a6,
- 0x6a6d, 0x6c24, 0x6dca, 0x6f5f, 0x70e2, 0x7255, 0x73b5, 0x7504,
- 0x7641, 0x776c, 0x7884, 0x798a, 0x7a7d, 0x7b5d, 0x7c29, 0x7ce3,
- 0x7d8a, 0x7e1d, 0x7e9d, 0x7f09, 0x7f62, 0x7fa7, 0x7fd8, 0x7ff6,
- 0x7fff, 0x7ff6, 0x7fd8, 0x7fa7, 0x7f62, 0x7f09, 0x7e9d, 0x7e1d,
- 0x7d8a, 0x7ce3, 0x7c29, 0x7b5d, 0x7a7d, 0x798a, 0x7884, 0x776c,
- 0x7641, 0x7504, 0x73b5, 0x7255, 0x70e2, 0x6f5f, 0x6dca, 0x6c24,
- 0x6a6d, 0x68a6, 0x66cf, 0x64e8, 0x62f2, 0x60ec, 0x5ed7, 0x5cb4,
- 0x5a82, 0x5842, 0x55f5, 0x539b, 0x5133, 0x4ebf, 0x4c3f, 0x49b4,
- 0x471c, 0x447a, 0x41ce, 0x3f17, 0x3c56, 0x398c, 0x36ba, 0x33de,
- 0x30fb, 0x2e11, 0x2b1f, 0x2826, 0x2528, 0x2223, 0x1f19, 0x1c0b,
- 0x18f8, 0x15e2, 0x12c8, 0x0fab, 0x0c8b, 0x096a, 0x0647, 0x0324,
- -0x0000, -0x0324, -0x0647, -0x096a, -0x0c8b, -0x0fab, -0x12c8, -0x15e2,
- -0x18f8, -0x1c0b, -0x1f19, -0x2223, -0x2528, -0x2826, -0x2b1f, -0x2e11,
- -0x30fb, -0x33de, -0x36ba, -0x398c, -0x3c56, -0x3f17, -0x41ce, -0x447a,
- -0x471c, -0x49b4, -0x4c3f, -0x4ebf, -0x5133, -0x539b, -0x55f5, -0x5842,
- -0x5a82, -0x5cb4, -0x5ed7, -0x60ec, -0x62f2, -0x64e8, -0x66cf, -0x68a6,
- -0x6a6d, -0x6c24, -0x6dca, -0x6f5f, -0x70e2, -0x7255, -0x73b5, -0x7504,
- -0x7641, -0x776c, -0x7884, -0x798a, -0x7a7d, -0x7b5d, -0x7c29, -0x7ce3,
- -0x7d8a, -0x7e1d, -0x7e9d, -0x7f09, -0x7f62, -0x7fa7, -0x7fd8, -0x7ff6,
- -0x7fff, -0x7ff6, -0x7fd8, -0x7fa7, -0x7f62, -0x7f09, -0x7e9d, -0x7e1d,
- -0x7d8a, -0x7ce3, -0x7c29, -0x7b5d, -0x7a7d, -0x798a, -0x7884, -0x776c,
- -0x7641, -0x7504, -0x73b5, -0x7255, -0x70e2, -0x6f5f, -0x6dca, -0x6c24,
- -0x6a6d, -0x68a6, -0x66cf, -0x64e8, -0x62f2, -0x60ec, -0x5ed7, -0x5cb4,
- -0x5a82, -0x5842, -0x55f5, -0x539b, -0x5133, -0x4ebf, -0x4c3f, -0x49b4,
- -0x471c, -0x447a, -0x41ce, -0x3f17, -0x3c56, -0x398c, -0x36ba, -0x33de,
- -0x30fb, -0x2e11, -0x2b1f, -0x2826, -0x2528, -0x2223, -0x1f19, -0x1c0b,
- -0x18f8, -0x15e2, -0x12c8, -0x0fab, -0x0c8b, -0x096a, -0x0647, -0x0324};
-
- //////////////////////////////////////////////////////////////////
-
-// Optimised for Performance
-static const INT16 DSP1_MulTable[256] = {
- 0x0000, 0x0003, 0x0006, 0x0009, 0x000c, 0x000f, 0x0012, 0x0015,
- 0x0019, 0x001c, 0x001f, 0x0022, 0x0025, 0x0028, 0x002b, 0x002f,
- 0x0032, 0x0035, 0x0038, 0x003b, 0x003e, 0x0041, 0x0045, 0x0048,
- 0x004b, 0x004e, 0x0051, 0x0054, 0x0057, 0x005b, 0x005e, 0x0061,
- 0x0064, 0x0067, 0x006a, 0x006d, 0x0071, 0x0074, 0x0077, 0x007a,
- 0x007d, 0x0080, 0x0083, 0x0087, 0x008a, 0x008d, 0x0090, 0x0093,
- 0x0096, 0x0099, 0x009d, 0x00a0, 0x00a3, 0x00a6, 0x00a9, 0x00ac,
- 0x00af, 0x00b3, 0x00b6, 0x00b9, 0x00bc, 0x00bf, 0x00c2, 0x00c5,
- 0x00c9, 0x00cc, 0x00cf, 0x00d2, 0x00d5, 0x00d8, 0x00db, 0x00df,
- 0x00e2, 0x00e5, 0x00e8, 0x00eb, 0x00ee, 0x00f1, 0x00f5, 0x00f8,
- 0x00fb, 0x00fe, 0x0101, 0x0104, 0x0107, 0x010b, 0x010e, 0x0111,
- 0x0114, 0x0117, 0x011a, 0x011d, 0x0121, 0x0124, 0x0127, 0x012a,
- 0x012d, 0x0130, 0x0133, 0x0137, 0x013a, 0x013d, 0x0140, 0x0143,
- 0x0146, 0x0149, 0x014d, 0x0150, 0x0153, 0x0156, 0x0159, 0x015c,
- 0x015f, 0x0163, 0x0166, 0x0169, 0x016c, 0x016f, 0x0172, 0x0175,
- 0x0178, 0x017c, 0x017f, 0x0182, 0x0185, 0x0188, 0x018b, 0x018e,
- 0x0192, 0x0195, 0x0198, 0x019b, 0x019e, 0x01a1, 0x01a4, 0x01a8,
- 0x01ab, 0x01ae, 0x01b1, 0x01b4, 0x01b7, 0x01ba, 0x01be, 0x01c1,
- 0x01c4, 0x01c7, 0x01ca, 0x01cd, 0x01d0, 0x01d4, 0x01d7, 0x01da,
- 0x01dd, 0x01e0, 0x01e3, 0x01e6, 0x01ea, 0x01ed, 0x01f0, 0x01f3,
- 0x01f6, 0x01f9, 0x01fc, 0x0200, 0x0203, 0x0206, 0x0209, 0x020c,
- 0x020f, 0x0212, 0x0216, 0x0219, 0x021c, 0x021f, 0x0222, 0x0225,
- 0x0228, 0x022c, 0x022f, 0x0232, 0x0235, 0x0238, 0x023b, 0x023e,
- 0x0242, 0x0245, 0x0248, 0x024b, 0x024e, 0x0251, 0x0254, 0x0258,
- 0x025b, 0x025e, 0x0261, 0x0264, 0x0267, 0x026a, 0x026e, 0x0271,
- 0x0274, 0x0277, 0x027a, 0x027d, 0x0280, 0x0284, 0x0287, 0x028a,
- 0x028d, 0x0290, 0x0293, 0x0296, 0x029a, 0x029d, 0x02a0, 0x02a3,
- 0x02a6, 0x02a9, 0x02ac, 0x02b0, 0x02b3, 0x02b6, 0x02b9, 0x02bc,
- 0x02bf, 0x02c2, 0x02c6, 0x02c9, 0x02cc, 0x02cf, 0x02d2, 0x02d5,
- 0x02d8, 0x02db, 0x02df, 0x02e2, 0x02e5, 0x02e8, 0x02eb, 0x02ee,
- 0x02f1, 0x02f5, 0x02f8, 0x02fb, 0x02fe, 0x0301, 0x0304, 0x0307,
- 0x030b, 0x030e, 0x0311, 0x0314, 0x0317, 0x031a, 0x031d, 0x0321};
-
-//////////////////////////////////////////////////////////////////
-
-// Data ROM, as logged from a DSP-1B with the 0x1f command;
-// it contains the tables and constants used by the commands.
-// The tables used are: two shift tables (0x022-0x031 and 0x031-0x040 -this last one
-// with an error in 0x03c which has survived to all the DSP-1 revisions-); a inverse
-// table (used as initial guess) at 0x065-0x0e4; a square root table (used also
-// as initial guess) at 0x0e5-0x115; two sin and cos tables (used as nodes to construct
-// a interpolation curve) at, respectively, 0x116-0x197 and 0x196-0x215.
-// As a curiosity, in the positions 0x21c-0x31c it's contained a
-// 257-points arccos table that, apparently, have been not used anywhere
-// (maybe for the MaxAZS_Exp table?).
-static UINT16 DSP1_DataRom[1024];
diff --git a/src/mame/machine/ticket.c b/src/mame/machine/ticket.c
index 7c87afa5e04..be472706606 100644
--- a/src/mame/machine/ticket.c
+++ b/src/mame/machine/ticket.c
@@ -161,7 +161,7 @@ WRITE8_HANDLER( ticket_dispenser_1_w )
***************************************************************************/
static TIMER_CALLBACK( ticket_dispenser_toggle )
{
- struct ticket_state *dispenser = ptr;
+ struct ticket_state *dispenser = (struct ticket_state *)ptr;
/* If we still have power, keep toggling ticket states. */
if (dispenser->power)
diff --git a/src/mame/machine/tx1.c b/src/mame/machine/tx1.c
index e4037dbc07f..93d708ef44c 100644
--- a/src/mame/machine/tx1.c
+++ b/src/mame/machine/tx1.c
@@ -174,7 +174,7 @@ static void sn_divide(running_machine *machine)
if (SN74S516.X == 0)
{
mame_printf_debug("%s:SN74S516 tried to divide by zero\n", cpuexec_describe_context(machine));
- SN74S516.ZW.Z = 0xffff;
+ SN74S516.ZW.Z = (INT16)0xffff;
SN74S516.ZW.W = 0xffff;
SN74S516.ZWfl = 0;
return;
diff --git a/src/mame/machine/williams.c b/src/mame/machine/williams.c
index 2e819cc4733..6acd834552f 100644
--- a/src/mame/machine/williams.c
+++ b/src/mame/machine/williams.c
@@ -587,7 +587,7 @@ WRITE8_DEVICE_HANDLER( williams_port_select_w )
CUSTOM_INPUT( williams_mux_r )
{
- const char *tag = param;
+ const char *tag = (const char *)param;
if (port_select != 0)
tag += strlen(tag) + 1;
diff --git a/src/mame/video/20pacgal.c b/src/mame/video/20pacgal.c
index b96fd0eecde..fda5ace177d 100644
--- a/src/mame/video/20pacgal.c
+++ b/src/mame/video/20pacgal.c
@@ -292,7 +292,7 @@ static void draw_chars(const _20pacgal_state *state, bitmap_t *bitmap)
static VIDEO_UPDATE( 20pacgal )
{
- const _20pacgal_state *state = screen->machine->driver_data;
+ const _20pacgal_state *state = (_20pacgal_state *)screen->machine->driver_data;
draw_chars(state, bitmap);
draw_sprites(state, bitmap);
diff --git a/src/mame/video/atarimo.c b/src/mame/video/atarimo.c
index aa30676790d..637cb3c1fc8 100644
--- a/src/mame/video/atarimo.c
+++ b/src/mame/video/atarimo.c
@@ -246,8 +246,6 @@ INLINE void init_gfxelement(atarimo_data *mo, int idx)
mo->gfxelement[idx].total_colors = 65536;
}
-static atarimo_data atarimo[ATARIMO_MAX];
-static emu_timer *force_update_timer;
/*---------------------------------------------------------------
init_savestate: Initialize save states
diff --git a/src/mame/video/bwing.c b/src/mame/video/bwing.c
index c54adb48a5d..1e92d89abdf 100644
--- a/src/mame/video/bwing.c
+++ b/src/mame/video/bwing.c
@@ -48,6 +48,7 @@ static void fill_srxlat(int *xlat)
//****************************************************************************
// Exports
+extern const gfx_layout bwing_tilelayout;
const gfx_layout bwing_tilelayout =
{
16, 16,
diff --git a/src/mame/video/cave.c b/src/mame/video/cave.c
index dc5f168fc54..890fb6d85fb 100644
--- a/src/mame/video/cave.c
+++ b/src/mame/video/cave.c
@@ -789,7 +789,7 @@ static void sprite_init_cave(running_machine *machine)
}
sprite_zbuf = auto_bitmap_alloc(machine, screen_width, screen_height, BITMAP_FORMAT_INDEXED16 );
- blit.baseaddr_zbuf = sprite_zbuf->base;
+ blit.baseaddr_zbuf = (UINT8 *)sprite_zbuf->base;
blit.line_offset_zbuf = sprite_zbuf->rowpixels * sprite_zbuf->bpp / 8;
num_sprites = spriteram_size / 0x10 / 2;
@@ -1463,7 +1463,7 @@ VIDEO_UPDATE( cave )
set_pens(screen->machine);
- blit.baseaddr = bitmap->base;
+ blit.baseaddr = (UINT8 *)bitmap->base;
blit.line_offset = bitmap->rowpixels * bitmap->bpp / 8;
/* Choose the tilemap to display (8x8 tiles or 16x16 tiles) */
diff --git a/src/mame/video/cidelsa.c b/src/mame/video/cidelsa.c
index 365939a03da..7136426a9ba 100644
--- a/src/mame/video/cidelsa.c
+++ b/src/mame/video/cidelsa.c
@@ -7,7 +7,7 @@
static CDP1869_PAGE_RAM_READ( cidelsa_pageram_r )
{
- cidelsa_state *state = device->machine->driver_data;
+ cidelsa_state *state = (cidelsa_state *)device->machine->driver_data;
UINT16 addr = pma & CIDELSA_PAGERAM_MASK;
@@ -21,7 +21,7 @@ static CDP1869_PAGE_RAM_READ( cidelsa_pageram_r )
static CDP1869_PAGE_RAM_WRITE( cidelsa_pageram_w )
{
- cidelsa_state *state = device->machine->driver_data;
+ cidelsa_state *state = (cidelsa_state *)device->machine->driver_data;
UINT16 addr = pma & CIDELSA_PAGERAM_MASK;
@@ -35,7 +35,7 @@ static CDP1869_PAGE_RAM_WRITE( cidelsa_pageram_w )
static CDP1869_PAGE_RAM_READ( draco_pageram_r )
{
- cidelsa_state *state = device->machine->driver_data;
+ cidelsa_state *state = (cidelsa_state *)device->machine->driver_data;
UINT16 addr = pma & DRACO_PAGERAM_MASK;
@@ -44,7 +44,7 @@ static CDP1869_PAGE_RAM_READ( draco_pageram_r )
static CDP1869_PAGE_RAM_WRITE( draco_pageram_w )
{
- cidelsa_state *state = device->machine->driver_data;
+ cidelsa_state *state = (cidelsa_state *)device->machine->driver_data;
UINT16 addr = pma & DRACO_PAGERAM_MASK;
@@ -55,7 +55,7 @@ static CDP1869_PAGE_RAM_WRITE( draco_pageram_w )
static CDP1869_CHAR_RAM_READ( cidelsa_charram_r )
{
- cidelsa_state *state = device->machine->driver_data;
+ cidelsa_state *state = (cidelsa_state *)device->machine->driver_data;
UINT8 column = BIT(pma, 10) ? 0xff : state->pageram[pma & CIDELSA_PAGERAM_MASK];
UINT16 addr = ((column << 3) | (cma & 0x07)) & CIDELSA_CHARRAM_MASK;
@@ -68,7 +68,7 @@ static CDP1869_CHAR_RAM_READ( cidelsa_charram_r )
static CDP1869_CHAR_RAM_WRITE( cidelsa_charram_w )
{
- cidelsa_state *state = device->machine->driver_data;
+ cidelsa_state *state = (cidelsa_state *)device->machine->driver_data;
UINT8 column = BIT(pma, 10) ? 0xff : state->pageram[pma & CIDELSA_PAGERAM_MASK];
UINT16 addr = ((column << 3) | (cma & 0x07)) & CIDELSA_CHARRAM_MASK;
@@ -79,7 +79,7 @@ static CDP1869_CHAR_RAM_WRITE( cidelsa_charram_w )
static CDP1869_CHAR_RAM_READ( draco_charram_r )
{
- cidelsa_state *state = device->machine->driver_data;
+ cidelsa_state *state = (cidelsa_state *)device->machine->driver_data;
UINT8 column = state->pageram[pma & DRACO_PAGERAM_MASK];
UINT16 addr = ((column << 3) | (cma & 0x07)) & CIDELSA_CHARRAM_MASK;
@@ -92,7 +92,7 @@ static CDP1869_CHAR_RAM_READ( draco_charram_r )
static CDP1869_CHAR_RAM_WRITE( draco_charram_w )
{
- cidelsa_state *state = device->machine->driver_data;
+ cidelsa_state *state = (cidelsa_state *)device->machine->driver_data;
UINT8 column = state->pageram[pma & DRACO_PAGERAM_MASK];
UINT16 addr = ((column << 3) | (cma & 0x07)) & CIDELSA_CHARRAM_MASK;
@@ -105,7 +105,7 @@ static CDP1869_CHAR_RAM_WRITE( draco_charram_w )
static CDP1869_PCB_READ( cidelsa_pcb_r )
{
- cidelsa_state *state = device->machine->driver_data;
+ cidelsa_state *state = (cidelsa_state *)device->machine->driver_data;
UINT8 column = state->pageram[pma & CIDELSA_PAGERAM_MASK];
UINT16 addr = ((column << 3) | (cma & 0x07)) & CIDELSA_CHARRAM_MASK;
@@ -115,7 +115,7 @@ static CDP1869_PCB_READ( cidelsa_pcb_r )
static CDP1869_PCB_READ( draco_pcb_r )
{
- cidelsa_state *state = device->machine->driver_data;
+ cidelsa_state *state = (cidelsa_state *)device->machine->driver_data;
UINT8 column = state->pageram[pma & DRACO_PAGERAM_MASK];
UINT16 addr = ((column << 3) | (cma & 0x07)) & CIDELSA_CHARRAM_MASK;
@@ -127,7 +127,7 @@ static CDP1869_PCB_READ( draco_pcb_r )
static WRITE_LINE_DEVICE_HANDLER( cidelsa_prd_w )
{
- cidelsa_state *driver_state = device->machine->driver_data;
+ cidelsa_state *driver_state = (cidelsa_state *)device->machine->driver_data;
/* invert PRD signal */
cputag_set_input_line(device->machine, CDP1802_TAG, INPUT_LINE_IRQ0, !state);
@@ -136,7 +136,7 @@ static WRITE_LINE_DEVICE_HANDLER( cidelsa_prd_w )
static WRITE_LINE_DEVICE_HANDLER( draco_prd_w )
{
- cidelsa_state *driver_state = device->machine->driver_data;
+ cidelsa_state *driver_state = (cidelsa_state *)device->machine->driver_data;
driver_state->cdp1869_prd = state;
}
@@ -189,7 +189,7 @@ static CDP1869_INTERFACE( draco_cdp1869_intf )
static void video_start(running_machine *machine, UINT16 pageram_size)
{
- cidelsa_state *state = machine->driver_data;
+ cidelsa_state *state = (cidelsa_state *)machine->driver_data;
/* allocate memory */
state->pageram = auto_alloc_array(machine, UINT8, pageram_size);
@@ -221,7 +221,7 @@ static VIDEO_START(draco)
static VIDEO_UPDATE( cidelsa )
{
- cidelsa_state *state = screen->machine->driver_data;
+ cidelsa_state *state = (cidelsa_state *)screen->machine->driver_data;
cdp1869_update(state->cdp1869, bitmap, cliprect);
diff --git a/src/mame/video/dkong.c b/src/mame/video/dkong.c
index 1bf2c3ce8f7..0adf4810db6 100644
--- a/src/mame/video/dkong.c
+++ b/src/mame/video/dkong.c
@@ -201,7 +201,7 @@ static const res_net_info radarscp_grid_net_info =
PALETTE_INIT( dkong2b)
{
- dkong_state *state = machine->driver_data;
+ dkong_state *state = (dkong_state *)machine->driver_data;
rgb_t *rgb;
int i;
@@ -230,7 +230,7 @@ PALETTE_INIT( dkong2b)
PALETTE_INIT( dkong4b )
{
- dkong_state *state = machine->driver_data;
+ dkong_state *state = (dkong_state *)machine->driver_data;
int i;
int r,g,b;
@@ -268,7 +268,7 @@ PALETTE_INIT( dkong4b )
PALETTE_INIT( radarscp )
{
- dkong_state *state = machine->driver_data;
+ dkong_state *state = (dkong_state *)machine->driver_data;
int i;
int r,g,b;
@@ -332,7 +332,7 @@ PALETTE_INIT( radarscp )
PALETTE_INIT( radarsc1 )
{
- dkong_state *state = machine->driver_data;
+ dkong_state *state = (dkong_state *)machine->driver_data;
int i;
int r,g,b;
@@ -432,7 +432,7 @@ PALETTE_INIT( radarsc1 )
PALETTE_INIT( dkong3 )
{
- dkong_state *state = machine->driver_data;
+ dkong_state *state = (dkong_state *)machine->driver_data;
rgb_t *rgb;
rgb = compute_res_net_all(color_prom, &dkong3_decode_info, &dkong3_net_info);
@@ -447,7 +447,7 @@ PALETTE_INIT( dkong3 )
static TILE_GET_INFO( dkong_bg_tile_info )
{
- dkong_state *state = machine->driver_data;
+ dkong_state *state = (dkong_state *)machine->driver_data;
int code = state->video_ram[tile_index] + 256 * state->gfx_bank;
int color = (state->color_codes[tile_index % 32 + 32 * (tile_index / 32 / 4)] & 0x0f) + 0x10 * state->palette_bank;
@@ -456,7 +456,7 @@ static TILE_GET_INFO( dkong_bg_tile_info )
static TILE_GET_INFO( radarsc1_bg_tile_info )
{
- dkong_state *state = machine->driver_data;
+ dkong_state *state = (dkong_state *)machine->driver_data;
int code = state->video_ram[tile_index] + 256 * state->gfx_bank;
int color = (state->color_codes[tile_index % 32] & 0x0f);
color = color | (state->palette_bank<<4);
@@ -472,7 +472,7 @@ static TILE_GET_INFO( radarsc1_bg_tile_info )
WRITE8_HANDLER( dkong_videoram_w )
{
- dkong_state *state = space->machine->driver_data;
+ dkong_state *state = (dkong_state *)space->machine->driver_data;
if (state->video_ram[offset] != data)
{
@@ -483,7 +483,7 @@ WRITE8_HANDLER( dkong_videoram_w )
WRITE8_HANDLER( dkongjr_gfxbank_w )
{
- dkong_state *state = space->machine->driver_data;
+ dkong_state *state = (dkong_state *)space->machine->driver_data;
if (state->gfx_bank != (data & 0x01))
{
@@ -494,7 +494,7 @@ WRITE8_HANDLER( dkongjr_gfxbank_w )
WRITE8_HANDLER( dkong3_gfxbank_w )
{
- dkong_state *state = space->machine->driver_data;
+ dkong_state *state = (dkong_state *)space->machine->driver_data;
if (state->gfx_bank != (~data & 0x01))
{
@@ -505,7 +505,7 @@ WRITE8_HANDLER( dkong3_gfxbank_w )
WRITE8_HANDLER( dkong_palettebank_w )
{
- dkong_state *state = space->machine->driver_data;
+ dkong_state *state = (dkong_state *)space->machine->driver_data;
int newbank;
newbank = state->palette_bank;
@@ -524,14 +524,14 @@ WRITE8_HANDLER( dkong_palettebank_w )
WRITE8_HANDLER( radarscp_grid_enable_w )
{
- dkong_state *state = space->machine->driver_data;
+ dkong_state *state = (dkong_state *)space->machine->driver_data;
state->grid_on = data & 0x01;
}
WRITE8_HANDLER( radarscp_grid_color_w )
{
- dkong_state *state = space->machine->driver_data;
+ dkong_state *state = (dkong_state *)space->machine->driver_data;
state->grid_col = (data & 0x07) ^ 0x07;
/* popmessage("Gridcol: %d", state->grid_col); */
@@ -539,14 +539,14 @@ WRITE8_HANDLER( radarscp_grid_color_w )
WRITE8_HANDLER( dkong_flipscreen_w )
{
- dkong_state *state = space->machine->driver_data;
+ dkong_state *state = (dkong_state *)space->machine->driver_data;
state->flip = ~data & 0x01;
}
WRITE8_HANDLER( dkong_spritebank_w )
{
- dkong_state *state = space->machine->driver_data;
+ dkong_state *state = (dkong_state *)space->machine->driver_data;
state->sprite_bank = data & 0x01;
}
@@ -559,7 +559,7 @@ WRITE8_HANDLER( dkong_spritebank_w )
static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 mask_bank, UINT32 shift_bits)
{
- dkong_state *state = machine->driver_data;
+ dkong_state *state = (dkong_state *)machine->driver_data;
int offs;
int scanline_vf; /* buffering scanline including flip */
int scanline_vfc; /* line buffering scanline including flip - this is the cached scanline_vf*/
@@ -691,7 +691,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
INLINE double CD4049(running_machine *machine, double x)
{
- dkong_state *state = machine->driver_data;
+ dkong_state *state = (dkong_state *)machine->driver_data;
if (x>0)
return exp(-state->cd4049_a * pow(x,state->cd4049_b));
@@ -713,7 +713,7 @@ INLINE double CD4049(running_machine *machine, double x)
static void radarscp_step(running_machine *machine, int line_cnt)
{
- dkong_state *state = machine->driver_data;
+ dkong_state *state = (dkong_state *)machine->driver_data;
const device_config *dev6h = devtag_get_device(machine, "ls259.6h");
const device_config *devvp2 = devtag_get_device(machine, "virtual_p2");
@@ -839,7 +839,7 @@ static void radarscp_draw_background(running_machine *machine, dkong_state *stat
static void radarscp_scanline(running_machine *machine, int scanline)
{
- dkong_state *state = machine->driver_data;
+ dkong_state *state = (dkong_state *)machine->driver_data;
const UINT8 *table = state->gfx3;
int table_len = state->gfx3_len;
int x,y,offset;
@@ -876,7 +876,7 @@ static void radarscp_scanline(running_machine *machine, int scanline)
static TIMER_CALLBACK( scanline_callback )
{
- dkong_state *state = machine->driver_data;
+ dkong_state *state = (dkong_state *)machine->driver_data;
int scanline = param;
if ((state->hardware_type == HARDWARE_TRS02) || (state->hardware_type == HARDWARE_TRS01))
@@ -892,7 +892,7 @@ static TIMER_CALLBACK( scanline_callback )
static void check_palette(running_machine *machine)
{
- dkong_state *state = machine->driver_data;
+ dkong_state *state = (dkong_state *)machine->driver_data;
const input_port_config *port;
int newset;
@@ -921,7 +921,7 @@ static void check_palette(running_machine *machine)
static VIDEO_START( dkong_base )
{
- dkong_state *state = machine->driver_data;
+ dkong_state *state = (dkong_state *)machine->driver_data;
state->cd4049_b = (log(0.0 - log(cd4049_al)) - log(0.0 - log((1.0-cd4049_al))) ) / log(cd4049_vh/cd4049_vl);
state->cd4049_a = log(0.0 - log(cd4049_al)) - state->cd4049_b * log(cd4049_vh);
@@ -942,7 +942,7 @@ static VIDEO_START( dkong_base )
VIDEO_START( dkong )
{
- dkong_state *state = machine->driver_data;
+ dkong_state *state = (dkong_state *)machine->driver_data;
VIDEO_START_CALL(dkong_base);
@@ -978,7 +978,7 @@ VIDEO_START( dkong )
VIDEO_UPDATE( dkong )
{
- dkong_state *state = screen->machine->driver_data;
+ dkong_state *state = (dkong_state *)screen->machine->driver_data;
tilemap_set_flip(ALL_TILEMAPS, state->flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
tilemap_set_scrollx(state->bg_tilemap, 0, state->flip ? 0 : 0);
@@ -1006,7 +1006,7 @@ VIDEO_UPDATE( dkong )
VIDEO_UPDATE( pestplce )
{
- dkong_state *state = screen->machine->driver_data;
+ dkong_state *state = (dkong_state *)screen->machine->driver_data;
int offs;
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
@@ -1029,7 +1029,7 @@ VIDEO_UPDATE( pestplce )
VIDEO_UPDATE( spclforc )
{
- dkong_state *state = screen->machine->driver_data;
+ dkong_state *state = (dkong_state *)screen->machine->driver_data;
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
diff --git a/src/mame/video/flstory.c b/src/mame/video/flstory.c
index ab4cce28743..ed5bb1fbc8e 100644
--- a/src/mame/video/flstory.c
+++ b/src/mame/video/flstory.c
@@ -34,7 +34,7 @@ static TILE_GET_INFO( victnine_get_tile_info )
{
int code = videoram[tile_index*2];
int attr = videoram[tile_index*2+1];
- int tile_number = tile_number = ((attr & 0x38) << 5) + code;
+ int tile_number = ((attr & 0x38) << 5) + code;
int flags = ((attr & 0x40) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0);
SET_TILE_INFO(
diff --git a/src/mame/video/gaelco3d.c b/src/mame/video/gaelco3d.c
index a10208ad16d..53df394dbd8 100644
--- a/src/mame/video/gaelco3d.c
+++ b/src/mame/video/gaelco3d.c
@@ -144,7 +144,7 @@ static void render_poly(const device_config *screen, UINT32 *polydata)
float voz_base = convert_tms3203x_fp_to_float(polydata[7]) * 256.0f - midx * voz_dx - midy * voz_dy;
float ooz_base = convert_tms3203x_fp_to_float(polydata[8]) - midx * ooz_dx - midy * ooz_dy;
float uoz_base = convert_tms3203x_fp_to_float(polydata[9]) * 256.0f - midx * uoz_dx - midy * uoz_dy;
- poly_extra_data *extra = poly_get_extra_data(poly);
+ poly_extra_data *extra = (poly_extra_data *)poly_get_extra_data(poly);
int color = (polydata[10] & 0x7f) << 8;
poly_vertex vert[MAX_VERTICES];
UINT32 data;
@@ -223,8 +223,8 @@ static void render_poly(const device_config *screen, UINT32 *polydata)
static void render_noz_noperspective(void *destbase, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
- const poly_extra_data *extra = extradata;
- bitmap_t *bitmap = destbase;
+ const poly_extra_data *extra = (const poly_extra_data *)extradata;
+ bitmap_t *bitmap = (bitmap_t *)destbase;
float zbase = recip_approx(extra->ooz_base);
float uoz_step = extra->uoz_dx * zbase;
float voz_step = extra->voz_dx * zbase;
@@ -264,8 +264,8 @@ static void render_noz_noperspective(void *destbase, INT32 scanline, const poly_
static void render_normal(void *destbase, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
- const poly_extra_data *extra = extradata;
- bitmap_t *bitmap = destbase;
+ const poly_extra_data *extra = (const poly_extra_data *)extradata;
+ bitmap_t *bitmap = (bitmap_t *)destbase;
float ooz_dx = extra->ooz_dx;
float uoz_dx = extra->uoz_dx;
float voz_dx = extra->voz_dx;
@@ -316,8 +316,8 @@ static void render_normal(void *destbase, INT32 scanline, const poly_extent *ext
static void render_alphablend(void *destbase, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
- const poly_extra_data *extra = extradata;
- bitmap_t *bitmap = destbase;
+ const poly_extra_data *extra = (const poly_extra_data *)extradata;
+ bitmap_t *bitmap = (bitmap_t *)destbase;
float ooz_dx = extra->ooz_dx;
float uoz_dx = extra->uoz_dx;
float voz_dx = extra->voz_dx;
diff --git a/src/mame/video/galastrm.c b/src/mame/video/galastrm.c
index a77aa60253b..0aabb868a7b 100644
--- a/src/mame/video/galastrm.c
+++ b/src/mame/video/galastrm.c
@@ -239,8 +239,8 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
static void tc0610_draw_scanline(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
- const poly_extra_data *extra = extradata;
- bitmap_t *destmap = dest;
+ const poly_extra_data *extra = (const poly_extra_data *)extradata;
+ bitmap_t *destmap = (bitmap_t *)dest;
UINT16 *framebuffer = BITMAP_ADDR16(destmap, scanline, 0);
bitmap_t *texbase = extra->texbase;
int startx = extent->startx;
@@ -261,7 +261,7 @@ static void tc0610_draw_scanline(void *dest, INT32 scanline, const poly_extent *
static void tc0610_rotate_draw(running_machine *machine, bitmap_t *bitmap, bitmap_t *srcbitmap, const rectangle *clip)
{
- poly_extra_data *extra = poly_get_extra_data(poly);
+ poly_extra_data *extra = (poly_extra_data *)poly_get_extra_data(poly);
poly_draw_scanline_func callback;
poly_vertex vert[4];
int rsx = galastrm_tc0610_ctrl_reg[1][0];
diff --git a/src/mame/video/gameplan.c b/src/mame/video/gameplan.c
index 562f242eb45..a46009cc82c 100644
--- a/src/mame/video/gameplan.c
+++ b/src/mame/video/gameplan.c
@@ -71,7 +71,7 @@ static void leprechn_get_pens(pen_t *pens)
static VIDEO_UPDATE( gameplan )
{
- gameplan_state *state = screen->machine->driver_data;
+ gameplan_state *state = (gameplan_state *)screen->machine->driver_data;
pen_t pens[GAMEPLAN_NUM_PENS];
offs_t offs;
@@ -91,7 +91,7 @@ static VIDEO_UPDATE( gameplan )
static VIDEO_UPDATE( leprechn )
{
- gameplan_state *state = screen->machine->driver_data;
+ gameplan_state *state = (gameplan_state *)screen->machine->driver_data;
pen_t pens[LEPRECHN_NUM_PENS];
offs_t offs;
@@ -118,7 +118,7 @@ static VIDEO_UPDATE( leprechn )
static WRITE8_DEVICE_HANDLER( video_data_w )
{
- gameplan_state *state = device->machine->driver_data;
+ gameplan_state *state = (gameplan_state *)device->machine->driver_data;
state->video_data = data;
}
@@ -126,7 +126,7 @@ static WRITE8_DEVICE_HANDLER( video_data_w )
static WRITE8_DEVICE_HANDLER( gameplan_video_command_w )
{
- gameplan_state *state = device->machine->driver_data;
+ gameplan_state *state = (gameplan_state *)device->machine->driver_data;
state->video_command = data & 0x07;
}
@@ -134,7 +134,7 @@ static WRITE8_DEVICE_HANDLER( gameplan_video_command_w )
static WRITE8_DEVICE_HANDLER( leprechn_video_command_w )
{
- gameplan_state *state = device->machine->driver_data;
+ gameplan_state *state = (gameplan_state *)device->machine->driver_data;
state->video_command = (data >> 3) & 0x07;
}
@@ -151,7 +151,7 @@ static TIMER_CALLBACK( clear_screen_done_callback )
static WRITE8_DEVICE_HANDLER( video_command_trigger_w )
{
- gameplan_state *state = device->machine->driver_data;
+ gameplan_state *state = (gameplan_state *)device->machine->driver_data;
if (data == 0)
{
@@ -266,7 +266,7 @@ const via6522_interface trvquest_via_0_interface =
static TIMER_CALLBACK( via_0_ca1_timer_callback )
{
- gameplan_state *state = machine->driver_data;
+ gameplan_state *state = (gameplan_state *)machine->driver_data;
const device_config *via = devtag_get_device(machine, "via6522_0");
/* !VBLANK is connected to CA1 */
@@ -300,7 +300,7 @@ static void start_via_0_timer(running_machine *machine, gameplan_state *state)
static VIDEO_START( common )
{
- gameplan_state *state = machine->driver_data;
+ gameplan_state *state = (gameplan_state *)machine->driver_data;
state->videoram_size = (HBSTART - HBEND) * (VBSTART - VBEND);
state->videoram = auto_alloc_array(machine, UINT8, state->videoram_size);
@@ -343,7 +343,7 @@ static VIDEO_START( trvquest )
static VIDEO_RESET( gameplan )
{
- start_via_0_timer(machine, machine->driver_data);
+ start_via_0_timer(machine, (gameplan_state *)machine->driver_data);
}
diff --git a/src/mame/video/grchamp.c b/src/mame/video/grchamp.c
index d2585f45e8e..f803e5a4c6f 100644
--- a/src/mame/video/grchamp.c
+++ b/src/mame/video/grchamp.c
@@ -16,7 +16,7 @@ PALETTE_INIT( grchamp )
{
static const int resistances[3] = { 100, 270, 470 };
double rweights[3], gweights[3], bweights[2];
- grchamp_state *state = machine->driver_data;
+ grchamp_state *state = (grchamp_state *)machine->driver_data;
int i;
/* compute the color output resistor weights */
@@ -54,46 +54,46 @@ PALETTE_INIT( grchamp )
WRITE8_HANDLER( grchamp_left_w )
{
- grchamp_state *state = space->machine->driver_data;
+ grchamp_state *state = (grchamp_state *)space->machine->driver_data;
state->leftram[offset] = data;
tilemap_mark_tile_dirty(state->left_tilemap, offset);
}
WRITE8_HANDLER( grchamp_center_w )
{
- grchamp_state *state = space->machine->driver_data;
+ grchamp_state *state = (grchamp_state *)space->machine->driver_data;
state->centerram[offset] = data;
tilemap_mark_tile_dirty(state->center_tilemap, offset);
}
WRITE8_HANDLER( grchamp_right_w )
{
- grchamp_state *state = space->machine->driver_data;
+ grchamp_state *state = (grchamp_state *)space->machine->driver_data;
state->rightram[offset] = data;
tilemap_mark_tile_dirty(state->right_tilemap, offset);
}
static TILE_GET_INFO( get_text_tile_info )
{
- grchamp_state *state = machine->driver_data;
+ grchamp_state *state = (grchamp_state *)machine->driver_data;
SET_TILE_INFO(0, state->videoram[tile_index], 0, 0);
}
static TILE_GET_INFO( get_left_tile_info )
{
- grchamp_state *state = machine->driver_data;
+ grchamp_state *state = (grchamp_state *)machine->driver_data;
SET_TILE_INFO(1, state->leftram[tile_index], 0, 0);
}
static TILE_GET_INFO( get_right_tile_info )
{
- grchamp_state *state = machine->driver_data;
+ grchamp_state *state = (grchamp_state *)machine->driver_data;
SET_TILE_INFO(2, state->rightram[tile_index], 0, 0);
}
static TILE_GET_INFO( get_center_tile_info )
{
- grchamp_state *state = machine->driver_data;
+ grchamp_state *state = (grchamp_state *)machine->driver_data;
SET_TILE_INFO(3, state->centerram[tile_index], 0, 0);
}
@@ -105,7 +105,7 @@ static TILEMAP_MAPPER( get_memory_offset )
VIDEO_START( grchamp )
{
- grchamp_state *state = machine->driver_data;
+ grchamp_state *state = (grchamp_state *)machine->driver_data;
state->work_bitmap = auto_bitmap_alloc(machine,32,32,video_screen_get_format(machine->primary_screen));
@@ -368,7 +368,7 @@ VIDEO_UPDATE( grchamp )
MAKE_RGB(RGB_MAX,RGB_MAX,RGB_MAX)
};
- grchamp_state *state = screen->machine->driver_data;
+ grchamp_state *state = (grchamp_state *)screen->machine->driver_data;
const UINT8 *amedata = memory_region(screen->machine, "gfx5");
const UINT8 *headdata = memory_region(screen->machine, "gfx6");
const UINT8 *pldata = memory_region(screen->machine, "gfx7");
diff --git a/src/mame/video/gticlub.c b/src/mame/video/gticlub.c
index 431d04d5d3a..0894d59a800 100644
--- a/src/mame/video/gticlub.c
+++ b/src/mame/video/gticlub.c
@@ -456,8 +456,8 @@ WRITE32_HANDLER( K001005_w )
static void draw_scanline(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
- const poly_extra_data *extra = extradata;
- bitmap_t *destmap = dest;
+ const poly_extra_data *extra = (const poly_extra_data *)extradata;
+ bitmap_t *destmap = (bitmap_t *)dest;
float z = extent->param[0].start;
float dz = extent->param[0].dpdx;
UINT32 *fb = BITMAP_ADDR32(destmap, scanline, 0);
@@ -484,8 +484,8 @@ static void draw_scanline(void *dest, INT32 scanline, const poly_extent *extent,
static void draw_scanline_tex(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
- const poly_extra_data *extra = extradata;
- bitmap_t *destmap = dest;
+ const poly_extra_data *extra = (const poly_extra_data *)extradata;
+ bitmap_t *destmap = (bitmap_t *)dest;
UINT8 *texrom = gfxrom + (extra->texture_page * 0x40000);
int pal_chip = (extra->texture_palette & 0x8) ? 1 : 0;
int palette_index = (extra->texture_palette & 0x7) * 256;
@@ -552,7 +552,7 @@ static void render_polygons(running_machine *machine)
{
if (K001005_3d_fifo[i] == 0x80000003)
{
- poly_extra_data *extra = poly_get_extra_data(poly);
+ poly_extra_data *extra = (poly_extra_data *)poly_get_extra_data(poly);
poly_vertex v[4];
int r, g, b, a;
UINT32 color;
@@ -605,7 +605,7 @@ static void render_polygons(running_machine *machine)
// 0x01: -------- -------- ----x-x- x-x-x-x- Texture X / 8
// 0x01: -------- -------- -----x-x -x-x-x-x Texture Y / 8
- poly_extra_data *extra = poly_get_extra_data(poly);
+ poly_extra_data *extra = (poly_extra_data *)poly_get_extra_data(poly);
poly_vertex v[4];
int tx, ty;
UINT32 color = 0;
@@ -719,7 +719,7 @@ static void render_polygons(running_machine *machine)
while ((K001005_3d_fifo[index] & 0xffffff00) != 0x80000000 && index < K001005_3d_fifo_ptr)
{
- poly_extra_data *extra = poly_get_extra_data(poly);
+ poly_extra_data *extra = (poly_extra_data *)poly_get_extra_data(poly);
int new_verts = 0;
if (poly_type)
@@ -804,7 +804,7 @@ static void render_polygons(running_machine *machine)
else if (K001005_3d_fifo[i] == 0x80000006 || K001005_3d_fifo[i] == 0x80000026 ||
K001005_3d_fifo[i] == 0x80000020 || K001005_3d_fifo[i] == 0x80000022)
{
- poly_extra_data *extra = poly_get_extra_data(poly);
+ poly_extra_data *extra = (poly_extra_data *)poly_get_extra_data(poly);
poly_vertex v[4];
int r, g, b, a;
UINT32 color;
@@ -859,7 +859,7 @@ static void render_polygons(running_machine *machine)
while ((K001005_3d_fifo[index] & 0xffffff00) != 0x80000000 && index < K001005_3d_fifo_ptr)
{
- poly_extra_data *extra = poly_get_extra_data(poly);
+ poly_extra_data *extra = (poly_extra_data *)poly_get_extra_data(poly);
int new_verts = 0;
if (poly_type)
diff --git a/src/mame/video/jaguar.c b/src/mame/video/jaguar.c
index 259e923ed07..4d18b98fa06 100644
--- a/src/mame/video/jaguar.c
+++ b/src/mame/video/jaguar.c
@@ -479,7 +479,8 @@ static void jaguar_set_palette(UINT16 vmode)
static UINT8 *get_jaguar_memory(running_machine *machine, UINT32 offset)
{
- return memory_get_read_ptr(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), offset);
+ const address_space *space = cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM);
+ return (UINT8 *)memory_get_read_ptr(space, offset);
}
diff --git a/src/mame/video/jedi.c b/src/mame/video/jedi.c
index 7d6494bb955..b5180a8e1d4 100644
--- a/src/mame/video/jedi.c
+++ b/src/mame/video/jedi.c
@@ -30,7 +30,7 @@
static VIDEO_START( jedi )
{
- jedi_state *state = machine->driver_data;
+ jedi_state *state = (jedi_state *)machine->driver_data;
/* register for saving */
state_save_register_global(machine, state->vscroll);
@@ -110,7 +110,7 @@ static void do_pen_lookup(jedi_state *state, bitmap_t *bitmap, const rectangle *
WRITE8_HANDLER( jedi_vscroll_w )
{
- jedi_state *state = space->machine->driver_data;
+ jedi_state *state = (jedi_state *)space->machine->driver_data;
state->vscroll = data | (offset << 8);
}
@@ -118,7 +118,7 @@ WRITE8_HANDLER( jedi_vscroll_w )
WRITE8_HANDLER( jedi_hscroll_w )
{
- jedi_state *state = space->machine->driver_data;
+ jedi_state *state = (jedi_state *)space->machine->driver_data;
state->hscroll = data | (offset << 8);
}
@@ -329,7 +329,7 @@ static void draw_sprites(running_machine *machine, jedi_state *state, bitmap_t *
static VIDEO_UPDATE( jedi )
{
- jedi_state *state = screen->machine->driver_data;
+ jedi_state *state = (jedi_state *)screen->machine->driver_data;
/* if no video, clear it all to black */
if (*state->video_off & 0x01)
diff --git a/src/mame/video/konamiic.c b/src/mame/video/konamiic.c
index 2a8bd077e97..e0480aca825 100644
--- a/src/mame/video/konamiic.c
+++ b/src/mame/video/konamiic.c
@@ -7452,19 +7452,21 @@ void K054338_export_config(int **shdRGB)
/* */
/***************************************************************************/
+struct K053250_CHIPTAG
+{
+ UINT8 regs[8];
+ UINT8 *base;
+ UINT16 *ram, *rammax;
+ UINT16 *buffer[2];
+ UINT32 rommask;
+ int page[2];
+ int frame, offsx, offsy;
+};
+
static struct
{
int chips;
- struct K053250_CHIPTAG
- {
- UINT8 regs[8];
- UINT8 *base;
- UINT16 *ram, *rammax;
- UINT16 *buffer[2];
- UINT32 rommask;
- int page[2];
- int frame, offsx, offsy;
- } chip[2];
+ struct K053250_CHIPTAG chip[2];
} K053250_info;
void K053250_set_LayerOffset(int chip, int offsx, int offsy)
diff --git a/src/mame/video/lordgun.c b/src/mame/video/lordgun.c
index c216433adcd..9ca3a203e68 100644
--- a/src/mame/video/lordgun.c
+++ b/src/mame/video/lordgun.c
@@ -36,6 +36,7 @@ Note: if MAME_DEBUG is defined, pressing Z with:
***************************************************************************/
#include "driver.h"
+#include "lordgun.h"
// Variables needed by driver:
@@ -46,11 +47,7 @@ UINT16 *lordgun_vram_3, *lordgun_scroll_x_3, *lordgun_scroll_y_3;
UINT16 *lordgun_scrollram;
int lordgun_whitescreen;
-struct
-{
- int scr_x, scr_y;
- UINT16 hw_x, hw_y;
-} lordgun_gun[2];
+lordgun_gun_data lordgun_gun[2];
/***************************************************************************
diff --git a/src/mame/video/m10.c b/src/mame/video/m10.c
index cb071c89020..36820f1c8d7 100644
--- a/src/mame/video/m10.c
+++ b/src/mame/video/m10.c
@@ -64,7 +64,7 @@ WRITE8_HANDLER( m10_colorram_w )
WRITE8_HANDLER( m10_chargen_w )
{
- m10_state *state = space->machine->driver_data;
+ m10_state *state = (m10_state *)space->machine->driver_data;
if (state->chargen[offset] != data)
{
@@ -76,7 +76,7 @@ WRITE8_HANDLER( m10_chargen_w )
WRITE8_HANDLER( m15_chargen_w )
{
- m10_state *state = space->machine->driver_data;
+ m10_state *state = (m10_state *)space->machine->driver_data;
if (state->chargen[offset] != data)
{
@@ -88,7 +88,7 @@ WRITE8_HANDLER( m15_chargen_w )
INLINE void plot_pixel_m10(running_machine *machine, bitmap_t *bm, int x, int y, int col)
{
- m10_state *state = machine->driver_data;
+ m10_state *state = (m10_state *)machine->driver_data;
if (!state->flip)
*BITMAP_ADDR16(bm, y, x) = col;
@@ -99,7 +99,7 @@ INLINE void plot_pixel_m10(running_machine *machine, bitmap_t *bm, int x, int y,
VIDEO_START( m10 )
{
- m10_state *state = machine->driver_data;
+ m10_state *state = (m10_state *)machine->driver_data;
int i;
for (i=0;i<32*8;i++)
@@ -118,7 +118,7 @@ VIDEO_START( m10 )
VIDEO_START( m15 )
{
- m10_state *state = machine->driver_data;
+ m10_state *state = (m10_state *)machine->driver_data;
machine->gfx[0] = gfx_element_alloc(machine, &charlayout, state->chargen, 8, 0);
@@ -136,7 +136,7 @@ VIDEO_START( m15 )
***************************************************************************/
VIDEO_UPDATE( m10 )
{
- m10_state *state = screen->machine->driver_data;
+ m10_state *state = (m10_state *)screen->machine->driver_data;
int offs;
static const int color[4]= { 3, 3, 5, 5 };
static const int xpos[4] = { 4*8, 26*8, 7*8, 6*8};
@@ -175,7 +175,7 @@ VIDEO_UPDATE( m10 )
***************************************************************************/
VIDEO_UPDATE( m15 )
{
- m10_state *state = screen->machine->driver_data;
+ m10_state *state = (m10_state *)screen->machine->driver_data;
int offs;
for (offs = videoram_size - 1;offs >= 0;offs--)
diff --git a/src/mame/video/m107.c b/src/mame/video/m107.c
index 757061df0f7..bf6882fb8c2 100644
--- a/src/mame/video/m107.c
+++ b/src/mame/video/m107.c
@@ -59,7 +59,7 @@ UINT8 m107_spritesystem;
static TILE_GET_INFO( get_pf_tile_info )
{
- pf_layer_info *layer = param;
+ pf_layer_info *layer = (pf_layer_info *)param;
int tile, attrib;
tile_index = 2 * tile_index + layer->vram_base;
diff --git a/src/mame/video/m3raster.c b/src/mame/video/m3raster.c
index f1d143a76b2..de1f9f2f97c 100644
--- a/src/mame/video/m3raster.c
+++ b/src/mame/video/m3raster.c
@@ -1,8 +1,8 @@
static void draw_scanline_normal(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
- const poly_extra_data *extra = extradata;
+ const poly_extra_data *extra = (const poly_extra_data *)extradata;
const cached_texture *texture = extra->texture;
- bitmap_t *destmap = dest;
+ bitmap_t *destmap = (bitmap_t *)dest;
UINT16 *p = BITMAP_ADDR16(destmap, scanline, 0);
UINT32 *d = BITMAP_ADDR32(zbuffer, scanline, 0);
float ooz = extent->param[0].start;
@@ -49,9 +49,9 @@ static void draw_scanline_normal(void *dest, INT32 scanline, const poly_extent *
static void draw_scanline_trans(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
- const poly_extra_data *extra = extradata;
+ const poly_extra_data *extra = (const poly_extra_data *)extradata;
const cached_texture *texture = extra->texture;
- bitmap_t *destmap = dest;
+ bitmap_t *destmap = (bitmap_t *)dest;
UINT16 *p = BITMAP_ADDR16(destmap, scanline, 0);
UINT32 *d = BITMAP_ADDR32(zbuffer, scanline, 0);
float ooz = extent->param[0].start;
@@ -104,9 +104,9 @@ static void draw_scanline_trans(void *dest, INT32 scanline, const poly_extent *e
static void draw_scanline_alpha(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
- const poly_extra_data *extra = extradata;
+ const poly_extra_data *extra = (const poly_extra_data *)extradata;
const cached_texture *texture = extra->texture;
- bitmap_t *destmap = dest;
+ bitmap_t *destmap = (bitmap_t *)dest;
UINT16 *p = BITMAP_ADDR16(destmap, scanline, 0);
UINT32 *d = BITMAP_ADDR32(zbuffer, scanline, 0);
float ooz = extent->param[0].start;
@@ -162,9 +162,9 @@ static void draw_scanline_alpha(void *dest, INT32 scanline, const poly_extent *e
static void draw_scanline_alpha_test(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
- const poly_extra_data *extra = extradata;
+ const poly_extra_data *extra = (const poly_extra_data *)extradata;
const cached_texture *texture = extra->texture;
- bitmap_t *destmap = dest;
+ bitmap_t *destmap = (bitmap_t *)dest;
UINT16 *p = BITMAP_ADDR16(destmap, scanline, 0);
UINT32 *d = BITMAP_ADDR32(zbuffer, scanline, 0);
float ooz = extent->param[0].start;
@@ -222,8 +222,8 @@ static void draw_scanline_alpha_test(void *dest, INT32 scanline, const poly_exte
static void draw_scanline_color(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
- const poly_extra_data *extra = extradata;
- bitmap_t *destmap = dest;
+ const poly_extra_data *extra = (const poly_extra_data *)extradata;
+ bitmap_t *destmap = (bitmap_t *)dest;
UINT16 *p = BITMAP_ADDR16(destmap, scanline, 0);
UINT32 *d = BITMAP_ADDR32(zbuffer, scanline, 0);
float ooz = extent->param[0].start;
diff --git a/src/mame/video/m92.c b/src/mame/video/m92.c
index b84777002b3..1a17f181541 100644
--- a/src/mame/video/m92.c
+++ b/src/mame/video/m92.c
@@ -141,7 +141,7 @@ WRITE16_HANDLER( m92_paletteram_w )
static TILE_GET_INFO( get_pf_tile_info )
{
- pf_layer_info *layer = param;
+ pf_layer_info *layer = (pf_layer_info *)param;
int tile, attrib;
tile_index = 2 * tile_index + layer->vram_base;
diff --git a/src/mame/video/mario.c b/src/mame/video/mario.c
index d0df5bac663..5417e7c9f97 100644
--- a/src/mame/video/mario.c
+++ b/src/mame/video/mario.c
@@ -79,7 +79,7 @@ PALETTE_INIT( mario )
WRITE8_HANDLER( mario_videoram_w )
{
- mario_state *state = space->machine->driver_data;
+ mario_state *state = (mario_state *)space->machine->driver_data;
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -87,7 +87,7 @@ WRITE8_HANDLER( mario_videoram_w )
WRITE8_HANDLER( mario_gfxbank_w )
{
- mario_state *state = space->machine->driver_data;
+ mario_state *state = (mario_state *)space->machine->driver_data;
if (state->gfx_bank != (data & 0x01))
{
@@ -98,7 +98,7 @@ WRITE8_HANDLER( mario_gfxbank_w )
WRITE8_HANDLER( mario_palettebank_w )
{
- mario_state *state = space->machine->driver_data;
+ mario_state *state = (mario_state *)space->machine->driver_data;
if (state->palette_bank != (data & 0x01))
{
@@ -109,14 +109,14 @@ WRITE8_HANDLER( mario_palettebank_w )
WRITE8_HANDLER( mario_scroll_w )
{
- mario_state *state = space->machine->driver_data;
+ mario_state *state = (mario_state *)space->machine->driver_data;
state->gfx_scroll = data + 17;
}
WRITE8_HANDLER( mario_flip_w )
{
- mario_state *state = space->machine->driver_data;
+ mario_state *state = (mario_state *)space->machine->driver_data;
if (state->flip != (data & 0x01))
{
@@ -131,7 +131,7 @@ WRITE8_HANDLER( mario_flip_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- mario_state *state = machine->driver_data;
+ mario_state *state = (mario_state *)machine->driver_data;
int code = state->videoram[tile_index] + 256 * state->gfx_bank;
int color;
@@ -142,7 +142,7 @@ static TILE_GET_INFO( get_bg_tile_info )
VIDEO_START( mario )
{
- mario_state *state = machine->driver_data;
+ mario_state *state = (mario_state *)machine->driver_data;
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows,
8, 8, 32, 32);
@@ -166,7 +166,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
/* TODO: draw_sprites should adopt the scanline logic from dkong.c
* The schematics have the same logic for sprite buffering.
*/
- mario_state *state = machine->driver_data;
+ mario_state *state = (mario_state *)machine->driver_data;
int offs;
for (offs = 0;offs < state->spriteram_size;offs += 4)
@@ -212,7 +212,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
VIDEO_UPDATE( mario )
{
- mario_state *state = screen->machine->driver_data;
+ mario_state *state = (mario_state *)screen->machine->driver_data;
int t;
t = input_port_read(screen->machine, "MONITOR");
diff --git a/src/mame/video/midvunit.c b/src/mame/video/midvunit.c
index 9df782d88fa..5d23bc1487b 100644
--- a/src/mame/video/midvunit.c
+++ b/src/mame/video/midvunit.c
@@ -97,7 +97,7 @@ VIDEO_START( midvunit )
static void render_flat(void *destbase, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
- const poly_extra_data *extra = extradata;
+ const poly_extra_data *extra = (const poly_extra_data *)extradata;
UINT16 pixdata = extra->pixdata;
int xstep = extra->dither + 1;
UINT16 *dest = (UINT16 *)destbase + scanline * 512;
@@ -129,7 +129,7 @@ static void render_flat(void *destbase, INT32 scanline, const poly_extent *exten
static void render_tex(void *destbase, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
- const poly_extra_data *extra = extradata;
+ const poly_extra_data *extra = (const poly_extra_data *)extradata;
UINT16 pixdata = extra->pixdata & 0xff00;
const UINT8 *texbase = extra->texbase;
int xstep = extra->dither + 1;
@@ -167,7 +167,7 @@ static void render_tex(void *destbase, INT32 scanline, const poly_extent *extent
static void render_textrans(void *destbase, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
- const poly_extra_data *extra = extradata;
+ const poly_extra_data *extra = (const poly_extra_data *)extradata;
UINT16 pixdata = extra->pixdata & 0xff00;
const UINT8 *texbase = extra->texbase;
int xstep = extra->dither + 1;
@@ -207,7 +207,7 @@ static void render_textrans(void *destbase, INT32 scanline, const poly_extent *e
static void render_textransmask(void *destbase, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
- const poly_extra_data *extra = extradata;
+ const poly_extra_data *extra = (const poly_extra_data *)extradata;
UINT16 pixdata = extra->pixdata;
const UINT8 *texbase = extra->texbase;
int xstep = extra->dither + 1;
@@ -302,7 +302,7 @@ static void make_vertices_inclusive(poly_vertex *vert)
static void process_dma_queue(running_machine *machine)
{
- poly_extra_data *extra = poly_get_extra_data(poly);
+ poly_extra_data *extra = (poly_extra_data *)poly_get_extra_data(poly);
UINT16 *dest = &midvunit_videoram[(page_control & 4) ? 0x40000 : 0x00000];
int textured = ((dma_data[0] & 0x300) == 0x100);
poly_draw_scanline_func callback;
diff --git a/src/mame/video/midzeus.c b/src/mame/video/midzeus.c
index 8f4dff4df22..6ad7b27cb67 100644
--- a/src/mame/video/midzeus.c
+++ b/src/mame/video/midzeus.c
@@ -615,7 +615,7 @@ static void zeus_register_update(running_machine *machine, offs_t offset)
// zeusbase[0x46] = ??? = 0x00000000
// zeusbase[0x4c] = ??? = 0x00808080 (brightness?)
// zeusbase[0x4e] = ??? = 0x00808080 (brightness?)
- poly_extra_data *extra = poly_get_extra_data(poly);
+ poly_extra_data *extra = (poly_extra_data *)poly_get_extra_data(poly);
poly_vertex vert[4];
vert[0].x = (INT16)zeusbase[0x08];
@@ -700,9 +700,9 @@ static void zeus_register_update(running_machine *machine, offs_t offset)
const UINT32 *src;
if (zeusbase[0xb6] & 0x80000000)
- src = waveram1_ptr_from_expanded_addr(zeusbase[0xb4]);
+ src = (const UINT32 *)waveram1_ptr_from_expanded_addr(zeusbase[0xb4]);
else
- src = waveram0_ptr_from_expanded_addr(zeusbase[0xb4]);
+ src = (const UINT32 *)waveram0_ptr_from_expanded_addr(zeusbase[0xb4]);
poly_wait(poly, "vram_read");
zeusbase[0xb0] = WAVERAM_READ32(src, 0);
@@ -1201,7 +1201,7 @@ if (
clipvert[i].y += 0.0005f;
}
- extra = poly_get_extra_data(poly);
+ extra = (poly_extra_data *)poly_get_extra_data(poly);
extra->solidcolor = zeusbase[0x00] & 0x7fff;
extra->zoffset = zeusbase[0x7e] >> 16;
extra->alpha = zeusbase[0x4e];
@@ -1223,7 +1223,7 @@ if (
static void render_poly_4bit(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
- const poly_extra_data *extra = extradata;
+ const poly_extra_data *extra = (const poly_extra_data *)extradata;
INT32 curz = extent->param[0].start;
INT32 curu = extent->param[1].start;
INT32 curv = extent->param[2].start;
@@ -1280,7 +1280,7 @@ static void render_poly_4bit(void *dest, INT32 scanline, const poly_extent *exte
static void render_poly_8bit(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
- const poly_extra_data *extra = extradata;
+ const poly_extra_data *extra = (const poly_extra_data *)extradata;
INT32 curz = extent->param[0].start;
INT32 curu = extent->param[1].start;
INT32 curv = extent->param[2].start;
@@ -1337,7 +1337,7 @@ static void render_poly_8bit(void *dest, INT32 scanline, const poly_extent *exte
static void render_poly_shade(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
- const poly_extra_data *extra = extradata;
+ const poly_extra_data *extra = (const poly_extra_data *)extradata;
int x;
for (x = extent->startx; x < extent->stopx; x++)
@@ -1364,7 +1364,7 @@ static void render_poly_shade(void *dest, INT32 scanline, const poly_extent *ext
static void render_poly_solid(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
- const poly_extra_data *extra = extradata;
+ const poly_extra_data *extra = (const poly_extra_data *)extradata;
UINT16 color = extra->solidcolor;
INT32 curz = (INT32)(extent->param[0].start);
INT32 curv = extent->param[2].start;
@@ -1390,7 +1390,7 @@ static void render_poly_solid(void *dest, INT32 scanline, const poly_extent *ext
static void render_poly_solid_fixedz(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
- const poly_extra_data *extra = extradata;
+ const poly_extra_data *extra = (const poly_extra_data *)extradata;
UINT16 color = extra->solidcolor;
UINT16 depth = extra->zoffset;
int x;
@@ -1427,7 +1427,7 @@ static void log_waveram(UINT32 length_and_base)
} recent_entries[100];
UINT32 numoctets = (length_and_base >> 24) + 1;
- const UINT32 *ptr = waveram0_ptr_from_block_addr(length_and_base);
+ const UINT32 *ptr = (const UINT32 *)waveram0_ptr_from_block_addr(length_and_base);
UINT32 checksum = length_and_base;
int foundit = FALSE;
int i;
diff --git a/src/mame/video/midzeus2.c b/src/mame/video/midzeus2.c
index 392c560571b..afe4084d9fe 100644
--- a/src/mame/video/midzeus2.c
+++ b/src/mame/video/midzeus2.c
@@ -390,7 +390,7 @@ if (input_code_pressed(KEYCODE_DOWN)) { zbase -= 1.0f; popmessage("Zbase = %f",
if (input_code_pressed(KEYCODE_RIGHT) && width < 512) { width <<= 1; while (input_code_pressed(KEYCODE_RIGHT)) ; }
if (yoffs < 0) yoffs = 0;
- base = waveram0_ptr_from_expanded_addr(yoffs << 16);
+ base = (const UINT64 *)waveram0_ptr_from_expanded_addr(yoffs << 16);
for (y = cliprect->min_y; y <= cliprect->max_y; y++)
{
@@ -1213,7 +1213,7 @@ vert[i].p[0] += zbase;
clipvert[i].y += 0.0005f;
}
- extra = poly_get_extra_data(poly);
+ extra = (poly_extra_data *)poly_get_extra_data(poly);
switch (texmode)
{
case 0x01d: /* crusnexo: RHS of score bar */
@@ -1272,7 +1272,7 @@ vert[i].p[0] += zbase;
static void render_poly_8bit(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
- const poly_extra_data *extra = extradata;
+ const poly_extra_data *extra = (const poly_extra_data *)extradata;
INT32 curz = extent->param[0].start;
INT32 curu = extent->param[1].start;
INT32 curv = extent->param[2].start;
diff --git a/src/mame/video/model2.c b/src/mame/video/model2.c
index 05be2657ada..382df2f63c6 100644
--- a/src/mame/video/model2.c
+++ b/src/mame/video/model2.c
@@ -511,7 +511,7 @@ static void model2_3d_process_quad( UINT32 attr )
if ( ztri != NULL )
{
while( ztri->next != NULL )
- ztri = ztri->next;
+ ztri = (triangle *)ztri->next;
}
/* go through the clipped vertex list, adding triangles */
@@ -748,7 +748,7 @@ static void model2_3d_process_triangle( UINT32 attr )
if ( ztri != NULL )
{
while( ztri->next != NULL )
- ztri = ztri->next;
+ ztri = (triangle *)ztri->next;
}
/* go through the clipped vertex list, adding triangles */
@@ -929,7 +929,7 @@ static const poly_draw_scanline_func render_funcs[8] =
static void model2_3d_render( bitmap_t *bitmap, triangle *tri, const rectangle *cliprect )
{
- poly_extra_data *extra = poly_get_extra_data(poly);
+ poly_extra_data *extra = (poly_extra_data *)poly_get_extra_data(poly);
UINT8 renderer;
rectangle vp;
@@ -1085,7 +1085,7 @@ static void model2_3d_frame_end( bitmap_t *bitmap, const rectangle *cliprect )
model2_3d_project( tri );
model2_3d_render( bitmap, tri, cliprect );
- tri = tri->next;
+ tri = (triangle *)tri->next;
}
}
}
diff --git a/src/mame/video/model2rd.c b/src/mame/video/model2rd.c
index dc425ce129c..5d25f1277d2 100644
--- a/src/mame/video/model2rd.c
+++ b/src/mame/video/model2rd.c
@@ -57,8 +57,8 @@
static void MODEL2_FUNC_NAME(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
#if !defined( MODEL2_TRANSLUCENT)
- const poly_extra_data *extra = extradata;
- bitmap_t *destmap = dest;
+ const poly_extra_data *extra = (const poly_extra_data *)extradata;
+ bitmap_t *destmap = (bitmap_t *)dest;
UINT32 *p = BITMAP_ADDR32(destmap, scanline, 0);
/* extract color information */
@@ -109,8 +109,8 @@ static void MODEL2_FUNC_NAME(void *dest, INT32 scanline, const poly_extent *exte
/* textured render path */
static void MODEL2_FUNC_NAME(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
- const poly_extra_data *extra = extradata;
- bitmap_t *destmap = dest;
+ const poly_extra_data *extra = (const poly_extra_data *)extradata;
+ bitmap_t *destmap = (bitmap_t *)dest;
UINT32 *p = BITMAP_ADDR32(destmap, scanline, 0);
UINT32 tex_width = extra->texwidth;
diff --git a/src/mame/video/model3.c b/src/mame/video/model3.c
index b5932648067..afa36d78aa3 100644
--- a/src/mame/video/model3.c
+++ b/src/mame/video/model3.c
@@ -1080,7 +1080,7 @@ static int clip_polygon(const poly_vertex *v, int num_vertices, PLANE cp, poly_v
static void render_one(TRIANGLE *tri)
{
- poly_extra_data *extra = poly_get_extra_data(poly);
+ poly_extra_data *extra = (poly_extra_data *)poly_get_extra_data(poly);
poly_draw_scanline_func callback = NULL;
tri->v[0].pz = 1.0f / tri->v[0].pz;
diff --git a/src/mame/video/mrdo.c b/src/mame/video/mrdo.c
index dd5e179ef2f..bc3a3441404 100644
--- a/src/mame/video/mrdo.c
+++ b/src/mame/video/mrdo.c
@@ -63,10 +63,10 @@ PALETTE_INIT( mrdo )
{
float par = 0;
- if (i & 1) par += 1.0/R1;
- if (i & 2) par += 1.0/R2;
- if (i & 4) par += 1.0/R3;
- if (i & 8) par += 1.0/R4;
+ if (i & 1) par += 1.0f/(float)R1;
+ if (i & 2) par += 1.0f/(float)R2;
+ if (i & 4) par += 1.0f/(float)R3;
+ if (i & 8) par += 1.0f/(float)R4;
if (par)
{
par = 1/par;
diff --git a/src/mame/video/mystston.c b/src/mame/video/mystston.c
index bd8e58ac8e0..a6e2e7b74e8 100644
--- a/src/mame/video/mystston.c
+++ b/src/mame/video/mystston.c
@@ -47,7 +47,7 @@
static TIMER_CALLBACK( interrupt_callback )
{
- mystston_state *state = machine->driver_data;
+ mystston_state *state = (mystston_state *)machine->driver_data;
int scanline = param;
mystston_on_scanline_interrupt(machine);
@@ -125,7 +125,7 @@ static void set_palette(running_machine *machine, mystston_state *state)
WRITE8_HANDLER( mystston_video_control_w )
{
- mystston_state *state = space->machine->driver_data;
+ mystston_state *state = (mystston_state *)space->machine->driver_data;
*state->video_control = data;
@@ -151,7 +151,7 @@ WRITE8_HANDLER( mystston_video_control_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- mystston_state *state = machine->driver_data;
+ mystston_state *state = (mystston_state *)machine->driver_data;
int page = (*state->video_control & 0x04) << 8;
int code = ((state->bg_videoram[page | 0x200 | tile_index] & 0x01) << 8) | state->bg_videoram[page | tile_index];
@@ -163,7 +163,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- mystston_state *state = machine->driver_data;
+ mystston_state *state = (mystston_state *)machine->driver_data;
int code = ((state->fg_videoram[0x400 | tile_index] & 0x07) << 8) | state->fg_videoram[tile_index];
int color = ((*state->video_control & 0x01) << 1) | ((*state->video_control & 0x02) >> 1);
@@ -219,7 +219,7 @@ static void draw_sprites(mystston_state *state, gfx_element **gfx, bitmap_t *bit
static VIDEO_START( mystston )
{
- mystston_state *state = machine->driver_data;
+ mystston_state *state = (mystston_state *)machine->driver_data;
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols_flip_x, 16, 16, 16, 32);
@@ -240,7 +240,7 @@ static VIDEO_START( mystston )
static VIDEO_RESET( mystston )
{
- mystston_state *state = machine->driver_data;
+ mystston_state *state = (mystston_state *)machine->driver_data;
timer_adjust_oneshot(state->interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, FIRST_INT_VPOS - 1, INT_HPOS), FIRST_INT_VPOS);
}
@@ -255,7 +255,7 @@ static VIDEO_RESET( mystston )
static VIDEO_UPDATE( mystston )
{
- mystston_state *state = screen->machine->driver_data;
+ mystston_state *state = (mystston_state *)screen->machine->driver_data;
int flip = (*state->video_control & 0x80) ^ ((input_port_read(screen->machine, "DSW1") & 0x20) << 2);
diff --git a/src/mame/video/namcos21.c b/src/mame/video/namcos21.c
index 1be034a3e18..cfa03edfa2c 100644
--- a/src/mame/video/namcos21.c
+++ b/src/mame/video/namcos21.c
@@ -254,14 +254,14 @@ typedef struct
double z;
} edge;
-#define SWAP(A,B) { const void *temp = A; A = B; B = temp; }
+#define SWAP(T,A,B) { const T *temp = A; A = B; B = temp; }
static void
renderscanline_flat( const edge *e1, const edge *e2, int sy, unsigned color, int depthcueenable )
{
if( e1->x > e2->x )
{
- SWAP(e1,e2);
+ SWAP(edge,e1,e2);
}
{
@@ -335,11 +335,11 @@ rendertri(
{
if( v0->y > v1->y )
{
- SWAP(v0,v1);
+ SWAP(vertex,v0,v1);
}
else if( v1->y > v2->y )
{
- SWAP(v1,v2);
+ SWAP(vertex,v1,v2);
}
else
{
diff --git a/src/mame/video/namcos22.c b/src/mame/video/namcos22.c
index 3e0f3c315b4..1854d7db52c 100644
--- a/src/mame/video/namcos22.c
+++ b/src/mame/video/namcos22.c
@@ -276,8 +276,8 @@ static void renderscanline_uvi_full(void *dest, INT32 scanline, const poly_exten
float du = extent->param[1].dpdx;
float dv = extent->param[2].dpdx;
float di = extent->param[3].dpdx;
- bitmap_t *bitmap = dest;
- const poly_extra_data *extra = extradata;
+ bitmap_t *bitmap = (bitmap_t *)dest;
+ const poly_extra_data *extra = (const poly_extra_data *)extradata;
int bn = extra->bn * 0x1000;
const pen_t *pens = extra->pens;
int fogFactor = 0xff - extra->fogFactor;
@@ -434,7 +434,7 @@ static void poly3d_DrawQuad(running_machine *machine, bitmap_t *bitmap, int text
}
}
- extra = poly_get_extra_data(poly);
+ extra = (poly_extra_data *)poly_get_extra_data(poly);
extra->pens = &machine->pens[(color&0x7f)<<8];
extra->bn = textureBank;
@@ -488,8 +488,8 @@ static void renderscanline_sprite(void *destbase, INT32 scanline, const poly_ext
int x_index = extent->param[0].start * 65536.0f;
int y_index = extent->param[1].start * 65536.0f;
int dx = extent->param[0].dpdx * 65536.0f;
- const poly_extra_data *extra = extradata;
- bitmap_t *destmap = destbase;
+ const poly_extra_data *extra = (const poly_extra_data *)extradata;
+ bitmap_t *destmap = (bitmap_t *)destbase;
const pen_t *pal = extra->pens;
int prioverchar = extra->prioverchar;
int z = extra->z;
@@ -591,7 +591,7 @@ mydrawgfxzoom(
vert[3].p[0] = flipx ? fwidth : 0;
vert[3].p[1] = flipy ? 0 : fheight;
- extra = poly_get_extra_data(poly);
+ extra = (poly_extra_data *)poly_get_extra_data(poly);
extra->z = z;
extra->alpha = alpha;
extra->prioverchar = prioverchar;
@@ -1232,8 +1232,8 @@ Prepare3dTexture( running_machine *machine, void *pTilemapROM, void *pTextureROM
*pUnpackedTileAttr++ = (*pPackedTileAttr)&0xf;
pPackedTileAttr++;
}
- mpTextureTileMap16 = pTilemapROM;
- mpTextureTileData = pTextureROM;
+ mpTextureTileMap16 = (UINT16 *)pTilemapROM;
+ mpTextureTileData = (UINT8 *)pTextureROM;
PatchTexture();
}
}
diff --git a/src/mame/video/ppu2c0x.c b/src/mame/video/ppu2c0x.c
index a73fcbaed1b..45a10875464 100644
--- a/src/mame/video/ppu2c0x.c
+++ b/src/mame/video/ppu2c0x.c
@@ -372,7 +372,7 @@ static DEVICE_START( ppu2c0x )
static TIMER_CALLBACK( hblank_callback )
{
- const device_config *device = ptr;
+ const device_config *device = (const device_config *)ptr;
ppu2c0x_chip *this_ppu = get_token(device);
int *ppu_regs = &this_ppu->regs[0];
@@ -389,7 +389,7 @@ static TIMER_CALLBACK( hblank_callback )
static TIMER_CALLBACK( nmi_callback )
{
- const device_config *device = ptr;
+ const device_config *device = (const device_config *)ptr;
ppu2c0x_chip *this_ppu = get_token(device);
const ppu2c0x_interface *intf = get_interface(device);
int *ppu_regs = &this_ppu->regs[0];
@@ -861,7 +861,7 @@ static void update_scanline(const device_config *device)
static TIMER_CALLBACK( scanline_callback )
{
- const device_config *device = ptr;
+ const device_config *device = (const device_config *)ptr;
ppu2c0x_chip *this_ppu = get_token(device);
int *ppu_regs = &this_ppu->regs[0];
int blanked = ( ppu_regs[PPU_CONTROL1] & ( PPU_CONTROL1_BACKGROUND | PPU_CONTROL1_SPRITES ) ) == 0;
diff --git a/src/mame/video/qix.c b/src/mame/video/qix.c
index b673cb45238..f927b99fae5 100644
--- a/src/mame/video/qix.c
+++ b/src/mame/video/qix.c
@@ -43,7 +43,7 @@ static MC6845_ON_DE_CHANGED( display_enable_changed );
static VIDEO_START( qix )
{
- qix_state *state = machine->driver_data;
+ qix_state *state = (qix_state *)machine->driver_data;
/* allocate memory for the full video RAM */
state->videoram = auto_alloc_array(machine, UINT8, 256 * 256);
@@ -65,7 +65,7 @@ static VIDEO_START( qix )
static MC6845_ON_DE_CHANGED( display_enable_changed )
{
- qix_state *state = device->machine->driver_data;
+ qix_state *state = (qix_state *)device->machine->driver_data;
/* on the rising edge, latch the scanline */
if (display_enabled)
@@ -88,7 +88,7 @@ static MC6845_ON_DE_CHANGED( display_enable_changed )
WRITE8_DEVICE_HANDLER( qix_flip_screen_w )
{
- qix_state *state = device->machine->driver_data;
+ qix_state *state = (qix_state *)device->machine->driver_data;
state->flip = data;
}
@@ -112,7 +112,7 @@ WRITE8_DEVICE_HANDLER( qix_flip_screen_w )
static READ8_HANDLER( qix_videoram_r )
{
- qix_state *state = space->machine->driver_data;
+ qix_state *state = (qix_state *)space->machine->driver_data;
/* add in the upper bit of the address latch */
offset += (state->videoram_address[0] & 0x80) << 8;
@@ -122,7 +122,7 @@ static READ8_HANDLER( qix_videoram_r )
static WRITE8_HANDLER( qix_videoram_w )
{
- qix_state *state = space->machine->driver_data;
+ qix_state *state = (qix_state *)space->machine->driver_data;
/* update the screen in case the game is writing "behind" the beam -
Zookeeper likes to do this */
@@ -138,7 +138,7 @@ static WRITE8_HANDLER( qix_videoram_w )
static WRITE8_HANDLER( slither_videoram_w )
{
- qix_state *state = space->machine->driver_data;
+ qix_state *state = (qix_state *)space->machine->driver_data;
/* update the screen in case the game is writing "behind" the beam -
Zookeeper likes to do this */
@@ -170,7 +170,7 @@ static WRITE8_HANDLER( slither_videoram_w )
static READ8_HANDLER( qix_addresslatch_r )
{
- qix_state *state = space->machine->driver_data;
+ qix_state *state = (qix_state *)space->machine->driver_data;
/* compute the value at the address latch */
offset = (state->videoram_address[0] << 8) | state->videoram_address[1];
@@ -180,7 +180,7 @@ static READ8_HANDLER( qix_addresslatch_r )
static WRITE8_HANDLER( qix_addresslatch_w )
{
- qix_state *state = space->machine->driver_data;
+ qix_state *state = (qix_state *)space->machine->driver_data;
/* update the screen in case the game is writing "behind" the beam */
video_screen_update_now(space->machine->primary_screen);
@@ -195,7 +195,7 @@ static WRITE8_HANDLER( qix_addresslatch_w )
static WRITE8_HANDLER( slither_addresslatch_w )
{
- qix_state *state = space->machine->driver_data;
+ qix_state *state = (qix_state *)space->machine->driver_data;
/* update the screen in case the game is writing "behind" the beam */
video_screen_update_now(space->machine->primary_screen);
@@ -220,7 +220,7 @@ static WRITE8_HANDLER( slither_addresslatch_w )
static WRITE8_HANDLER( qix_paletteram_w )
{
- qix_state *state = space->machine->driver_data;
+ qix_state *state = (qix_state *)space->machine->driver_data;
UINT8 old_data = state->paletteram[offset];
@@ -236,7 +236,7 @@ static WRITE8_HANDLER( qix_paletteram_w )
WRITE8_HANDLER( qix_palettebank_w )
{
- qix_state *state = space->machine->driver_data;
+ qix_state *state = (qix_state *)space->machine->driver_data;
/* set the bank value */
if (state->palette_bank != (data & 3))
@@ -308,7 +308,7 @@ static void get_pens(qix_state *state, pen_t *pens)
static MC6845_BEGIN_UPDATE( begin_update )
{
- qix_state *state = device->machine->driver_data;
+ qix_state *state = (qix_state *)device->machine->driver_data;
#if 0
// note the confusing bit order!
@@ -326,7 +326,7 @@ static MC6845_BEGIN_UPDATE( begin_update )
static MC6845_UPDATE_ROW( update_row )
{
- qix_state *state = device->machine->driver_data;
+ qix_state *state = (qix_state *)device->machine->driver_data;
UINT32 *dest = BITMAP_ADDR32(bitmap, y, 0);
UINT16 x;
diff --git a/src/mame/video/segaic16.c b/src/mame/video/segaic16.c
index 5cbd5550a1a..d2a7f99323d 100644
--- a/src/mame/video/segaic16.c
+++ b/src/mame/video/segaic16.c
@@ -402,9 +402,9 @@ struct tilemap_info
UINT16 latched_yscroll[4]; /* latched Y scroll values */
UINT16 latched_pageselect[4]; /* latched page select values */
INT32 xoffs; /* X scroll offset */
- tilemap *tilemaps[16]; /* up to 16 tilemap pages */
- tilemap *textmap; /* a single text tilemap */
- struct tilemap_callback_info tilemap_info[16]; /* callback info for 16 tilemap pages */
+ tilemap * tilemaps[16]; /* up to 16 tilemap pages */
+ tilemap * textmap; /* a single text tilemap */
+ struct tilemap_callback_info tmap_info[16]; /* callback info for 16 tilemap pages */
struct tilemap_callback_info textmap_info; /* callback info for a single textmap page */
void (*reset)(running_machine *machine, struct tilemap_info *info);/* reset callback */
void (*draw_layer)(running_machine *machine, struct tilemap_info *info, bitmap_t *bitmap, const rectangle *cliprect, int which, int flags, int priority);
@@ -808,7 +808,7 @@ static void segaic16_draw_virtual_tilemap(running_machine *machine, struct tilem
static TILE_GET_INFO( segaic16_tilemap_16a_tile_info )
{
- const struct tilemap_callback_info *info = param;
+ const struct tilemap_callback_info *info = (const struct tilemap_callback_info *)param;
UINT16 data = info->rambase[tile_index];
int code = ((data >> 1) & 0x1000) | (data & 0xfff);
int color = (data >> 5) & 0x7f;
@@ -820,7 +820,7 @@ static TILE_GET_INFO( segaic16_tilemap_16a_tile_info )
static TILE_GET_INFO( segaic16_tilemap_16a_text_info )
{
- const struct tilemap_callback_info *info = param;
+ const struct tilemap_callback_info *info = (const struct tilemap_callback_info *)param;
UINT16 data = info->rambase[tile_index];
int color = (data >> 8) & 0x07;
int code = data & 0xff;
@@ -1020,7 +1020,7 @@ static void segaic16_tilemap_16a_draw_layer(running_machine *machine, struct til
static TILE_GET_INFO( segaic16_tilemap_16b_tile_info )
{
- const struct tilemap_callback_info *info = param;
+ const struct tilemap_callback_info *info = (const struct tilemap_callback_info *)param;
UINT16 data = info->rambase[tile_index];
int color = (data >> 6) & 0x7f;
int code = data & 0x1fff;
@@ -1034,7 +1034,7 @@ static TILE_GET_INFO( segaic16_tilemap_16b_tile_info )
static TILE_GET_INFO( segaic16_tilemap_16b_text_info )
{
- const struct tilemap_callback_info *info = param;
+ const struct tilemap_callback_info *info = (const struct tilemap_callback_info *)param;
UINT16 data = info->rambase[tile_index];
int bank = info->bank[0];
int color = (data >> 9) & 0x07;
@@ -1047,7 +1047,7 @@ static TILE_GET_INFO( segaic16_tilemap_16b_text_info )
static TILE_GET_INFO( segaic16_tilemap_16b_alt_tile_info )
{
- const struct tilemap_callback_info *info = param;
+ const struct tilemap_callback_info *info = (const struct tilemap_callback_info *)param;
UINT16 data = info->rambase[tile_index];
int color = (data >> 5) & 0x7f;
int code = data & 0x1fff;
@@ -1061,7 +1061,7 @@ static TILE_GET_INFO( segaic16_tilemap_16b_alt_tile_info )
static TILE_GET_INFO( segaic16_tilemap_16b_alt_text_info )
{
- const struct tilemap_callback_info *info = param;
+ const struct tilemap_callback_info *info = (const struct tilemap_callback_info *)param;
UINT16 data = info->rambase[tile_index];
int bank = info->bank[0];
int color = (data >> 8) & 0x07;
@@ -1287,10 +1287,10 @@ void segaic16_tilemap_init(running_machine *machine, int which, int type, int co
info->tilemaps[pagenum] = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8,8, 64,32);
/* configure the tilemap */
- info->tilemap_info[pagenum].rambase = info->tileram + pagenum * 64*32;
- info->tilemap_info[pagenum].bank = info->bank;
- info->tilemap_info[pagenum].banksize = info->banksize;
- tilemap_set_user_data(info->tilemaps[pagenum], &info->tilemap_info[pagenum]);
+ info->tmap_info[pagenum].rambase = info->tileram + pagenum * 64*32;
+ info->tmap_info[pagenum].bank = info->bank;
+ info->tmap_info[pagenum].banksize = info->banksize;
+ tilemap_set_user_data(info->tilemaps[pagenum], &info->tmap_info[pagenum]);
tilemap_set_palette_offset(info->tilemaps[pagenum], colorbase);
tilemap_set_transparent_pen(info->tilemaps[pagenum], 0);
tilemap_set_scrolldx(info->tilemaps[pagenum], 0, 22);
diff --git a/src/mame/video/segaic24.c b/src/mame/video/segaic24.c
index f0359bbe835..a49c71173d8 100644
--- a/src/mame/video/segaic24.c
+++ b/src/mame/video/segaic24.c
@@ -172,8 +172,8 @@ static void sys24_tile_draw_rect(running_machine *machine, bitmap_t *bm, bitmap_
int y;
const UINT16 *source = ((UINT16 *)bm->base) + sx + sy*bm->rowpixels;
const UINT8 *trans = ((UINT8 *) tm->base) + sx + sy*tm->rowpixels;
- UINT8 *prib = priority_bitmap->base;
- UINT16 *dest = dm->base;
+ UINT8 *prib = (UINT8 *)priority_bitmap->base;
+ UINT16 *dest = (UINT16 *)dm->base;
tpri |= TILEMAP_PIXEL_LAYER0;
@@ -306,7 +306,7 @@ static void sys24_tile_draw_rect_rgb(running_machine *machine, bitmap_t *bm, bit
int y;
const UINT16 *source = ((UINT16 *)bm->base) + sx + sy*bm->rowpixels;
const UINT8 *trans = ((UINT8 *) tm->base) + sx + sy*tm->rowpixels;
- UINT16 *dest = dm->base;
+ UINT16 *dest = (UINT16 *)dm->base;
const pen_t *pens = machine->pens;
tpri |= TILEMAP_PIXEL_LAYER0;
diff --git a/src/mame/video/segas32.c b/src/mame/video/segas32.c
index 48cc9e9def5..ec1337fc0ea 100644
--- a/src/mame/video/segas32.c
+++ b/src/mame/video/segas32.c
@@ -583,7 +583,7 @@ READ16_HANDLER( system32_sprite_control_r )
/* D1 : Seems to be '1' only during an erase in progress, this
occurs very briefly though.
D0 : Selected frame buffer (0= A, 1= B) */
- return 0xfffc | (layer_data[MIXER_LAYER_SPRITES].bitmap < layer_data[MIXER_LAYER_SPRITES_2].bitmap);
+ return 0xfffc | (int)(layer_data[MIXER_LAYER_SPRITES].bitmap < layer_data[MIXER_LAYER_SPRITES_2].bitmap);
case 1:
/* D1 : ?
@@ -792,7 +792,7 @@ static tilemap *find_cache_entry(int page, int bank)
static TILE_GET_INFO( get_tile_info )
{
- struct cache_entry *entry = param;
+ struct cache_entry *entry = (struct cache_entry *)param;
UINT16 data = system32_videoram[(entry->page & 0x7f) * 0x200 + tile_index];
SET_TILE_INFO(0, (entry->bank << 13) + (data & 0x1fff), (data >> 4) & 0x1ff, (data >> 14) & 3);
}
diff --git a/src/mame/video/stactics.c b/src/mame/video/stactics.c
index a1e07c3bf84..cc5c03c8e05 100644
--- a/src/mame/video/stactics.c
+++ b/src/mame/video/stactics.c
@@ -91,7 +91,7 @@ static PALETTE_INIT( stactics )
WRITE8_HANDLER( stactics_scroll_ram_w )
{
- stactics_state *state = space->machine->driver_data;
+ stactics_state *state = (stactics_state *)space->machine->driver_data;
if (data & 0x01)
{
@@ -114,7 +114,7 @@ WRITE8_HANDLER( stactics_scroll_ram_w )
CUSTOM_INPUT( stactics_get_frame_count_d3 )
{
- stactics_state *state = field->port->machine->driver_data;
+ stactics_state *state = (stactics_state *)field->port->machine->driver_data;
return (state->frame_count >> 3) & 0x01;
}
@@ -129,7 +129,7 @@ CUSTOM_INPUT( stactics_get_frame_count_d3 )
WRITE8_HANDLER( stactics_speed_latch_w )
{
- stactics_state *state = space->machine->driver_data;
+ stactics_state *state = (stactics_state *)space->machine->driver_data;
/* This writes to a shift register which is clocked by */
/* a 555 oscillator. This value determines the speed of */
@@ -156,7 +156,7 @@ WRITE8_HANDLER( stactics_speed_latch_w )
WRITE8_HANDLER( stactics_shot_trigger_w )
{
- stactics_state *state = space->machine->driver_data;
+ stactics_state *state = (stactics_state *)space->machine->driver_data;
state->shot_standby = 0;
}
@@ -164,7 +164,7 @@ WRITE8_HANDLER( stactics_shot_trigger_w )
WRITE8_HANDLER( stactics_shot_flag_clear_w )
{
- stactics_state *state = space->machine->driver_data;
+ stactics_state *state = (stactics_state *)space->machine->driver_data;
state->shot_arrive = 0;
}
@@ -172,7 +172,7 @@ WRITE8_HANDLER( stactics_shot_flag_clear_w )
CUSTOM_INPUT( stactics_get_shot_standby )
{
- stactics_state *state = field->port->machine->driver_data;
+ stactics_state *state = (stactics_state *)field->port->machine->driver_data;
return state->shot_standby;
}
@@ -180,7 +180,7 @@ CUSTOM_INPUT( stactics_get_shot_standby )
CUSTOM_INPUT( stactics_get_not_shot_arrive )
{
- stactics_state *state = field->port->machine->driver_data;
+ stactics_state *state = (stactics_state *)field->port->machine->driver_data;
return !state->shot_arrive;
}
@@ -367,7 +367,7 @@ static void update_artwork(running_machine *machine, stactics_state *state)
static VIDEO_START( stactics )
{
- stactics_state *state = machine->driver_data;
+ stactics_state *state = (stactics_state *)machine->driver_data;
state->y_scroll_d = 0;
state->y_scroll_e = 0;
@@ -390,7 +390,7 @@ static VIDEO_START( stactics )
static VIDEO_UPDATE( stactics )
{
- stactics_state *state = screen->machine->driver_data;
+ stactics_state *state = (stactics_state *)screen->machine->driver_data;
update_beam(state);
draw_background(state, bitmap, cliprect);
diff --git a/src/mame/video/starshp1.c b/src/mame/video/starshp1.c
index 744de904777..cd01d966746 100644
--- a/src/mame/video/starshp1.c
+++ b/src/mame/video/starshp1.c
@@ -266,7 +266,7 @@ static void draw_phasor(bitmap_t* bitmap)
static int get_radius(void)
{
- return 6 * sqrt(starshp1_circle_size); /* size calibrated by hand */
+ return 6 * sqrt((double)starshp1_circle_size); /* size calibrated by hand */
}
static int get_circle_hpos(void)
{
diff --git a/src/mame/video/system1.c b/src/mame/video/system1.c
index daac677f3e9..77fd9b2cdcd 100644
--- a/src/mame/video/system1.c
+++ b/src/mame/video/system1.c
@@ -105,7 +105,7 @@ static UINT8 tilemap_pages;
static TILE_GET_INFO( tile_get_info )
{
- UINT8 *rambase = param;
+ const UINT8 *rambase = (const UINT8 *)param;
UINT32 tiledata = rambase[tile_index*2+0] | (rambase[tile_index*2+1] << 8);
UINT32 code = ((tiledata >> 4) & 0x800) | (tiledata & 0x7ff);
UINT32 color = (tiledata >> 5) & 0xff;
diff --git a/src/mame/video/taitojc.c b/src/mame/video/taitojc.c
index 478cbf334da..ddfdd84c3f3 100644
--- a/src/mame/video/taitojc.c
+++ b/src/mame/video/taitojc.c
@@ -289,7 +289,7 @@ VIDEO_UPDATE( taitojc )
static void render_solid_scan(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
- bitmap_t *destmap = dest;
+ bitmap_t *destmap = (bitmap_t *)dest;
float z = extent->param[0].start;
int color = extent->param[1].start;
float dz = extent->param[0].dpdx;
@@ -313,7 +313,7 @@ static void render_solid_scan(void *dest, INT32 scanline, const poly_extent *ext
static void render_shade_scan(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
- bitmap_t *destmap = dest;
+ bitmap_t *destmap = (bitmap_t *)dest;
float z = extent->param[0].start;
float color = extent->param[1].start;
float dz = extent->param[0].dpdx;
@@ -340,8 +340,8 @@ static void render_shade_scan(void *dest, INT32 scanline, const poly_extent *ext
static void render_texture_scan(void *dest, INT32 scanline, const poly_extent *extent, const void *extradata, int threadid)
{
- const poly_extra_data *extra = extradata;
- bitmap_t *destmap = dest;
+ const poly_extra_data *extra = (const poly_extra_data *)extradata;
+ bitmap_t *destmap = (bitmap_t *)dest;
float z = extent->param[0].start;
float u = extent->param[1].start;
float v = extent->param[2].start;
@@ -434,7 +434,7 @@ void taitojc_render_polygons(running_machine *machine, UINT16 *polygon_fifo, int
// 0x12: Vertex 3 X
// 0x13: Vertex 3 Z
- poly_extra_data *extra = poly_get_extra_data(poly);
+ poly_extra_data *extra = (poly_extra_data *)poly_get_extra_data(poly);
UINT16 texbase;
/*
@@ -552,7 +552,7 @@ void taitojc_render_polygons(running_machine *machine, UINT16 *polygon_fifo, int
// 0x18: Vertex 4 X
// 0x19: Vertex 4 Z
- poly_extra_data *extra = poly_get_extra_data(poly);
+ poly_extra_data *extra = (poly_extra_data *)poly_get_extra_data(poly);
UINT16 texbase;
/*
diff --git a/src/mame/video/tceptor.c b/src/mame/video/tceptor.c
index bc97bdadfe7..8433a185892 100644
--- a/src/mame/video/tceptor.c
+++ b/src/mame/video/tceptor.c
@@ -282,7 +282,7 @@ static void decode_bg(running_machine *machine, const char * region)
static void decode_sprite(running_machine *machine, int gfx_index, const gfx_layout *layout, const void *data)
{
/* decode the graphics */
- machine->gfx[gfx_index] = gfx_element_alloc(machine, layout, data, 64, 1024);
+ machine->gfx[gfx_index] = gfx_element_alloc(machine, layout, (const UINT8 *)data, 64, 1024);
}
// fix sprite order
diff --git a/src/mame/video/tecmo16.c b/src/mame/video/tecmo16.c
index a2c87aa6ce7..5254a2584a9 100644
--- a/src/mame/video/tecmo16.c
+++ b/src/mame/video/tecmo16.c
@@ -251,9 +251,9 @@ static void blendbitmaps(running_machine *machine,
const pen_t *paldata = machine->pens;
UINT32 *end;
- UINT16 *sd1 = src1->base; /* source data */
- UINT16 *sd2 = src2->base;
- UINT16 *sd3 = src3->base;
+ UINT16 *sd1 = (UINT16 *)src1->base; /* source data */
+ UINT16 *sd2 = (UINT16 *)src2->base;
+ UINT16 *sd3 = (UINT16 *)src3->base;
int sw = ex-sx+1; /* source width */
int sh = ey-sy+1; /* source height */
diff --git a/src/mame/video/turbo.c b/src/mame/video/turbo.c
index 031397292fd..f934dd0ee4a 100644
--- a/src/mame/video/turbo.c
+++ b/src/mame/video/turbo.c
@@ -167,7 +167,7 @@ PALETTE_INIT( buckrog )
static TILE_GET_INFO( get_fg_tile_info )
{
- turbo_state *state = machine->driver_data;
+ turbo_state *state = (turbo_state *)machine->driver_data;
int code = state->videoram[tile_index];
SET_TILE_INFO(0, code, code >> 2, 0);
}
@@ -175,7 +175,7 @@ static TILE_GET_INFO( get_fg_tile_info )
VIDEO_START( turbo )
{
- turbo_state *state = machine->driver_data;
+ turbo_state *state = (turbo_state *)machine->driver_data;
/* initialize the foreground tilemap */
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8,8, 32,32);
@@ -184,7 +184,7 @@ VIDEO_START( turbo )
VIDEO_START( buckrog )
{
- turbo_state *state = machine->driver_data;
+ turbo_state *state = (turbo_state *)machine->driver_data;
/* initialize the foreground tilemap */
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8,8, 32,32);
@@ -204,7 +204,7 @@ VIDEO_START( buckrog )
WRITE8_HANDLER( turbo_videoram_w )
{
- turbo_state *state = space->machine->driver_data;
+ turbo_state *state = (turbo_state *)space->machine->driver_data;
state->videoram[offset] = data;
if (offset < 0x400)
{
@@ -216,7 +216,7 @@ WRITE8_HANDLER( turbo_videoram_w )
WRITE8_HANDLER( buckrog_bitmap_w )
{
- turbo_state *state = space->machine->driver_data;
+ turbo_state *state = (turbo_state *)space->machine->driver_data;
state->buckrog_bitmap_ram[offset] = data & 1;
}
@@ -406,7 +406,7 @@ static UINT32 turbo_get_sprite_bits(running_machine *machine, UINT8 road, sprite
VIDEO_UPDATE( turbo )
{
- turbo_state *state = screen->machine->driver_data;
+ turbo_state *state = (turbo_state *)screen->machine->driver_data;
bitmap_t *fgpixmap = tilemap_get_pixmap(state->fg_tilemap);
const UINT8 *road_gfxdata = memory_region(screen->machine, "gfx3");
const UINT8 *prom_base = memory_region(screen->machine, "proms");
@@ -761,7 +761,7 @@ static UINT32 subroc3d_get_sprite_bits(running_machine *machine, sprite_info *sp
VIDEO_UPDATE( subroc3d )
{
- turbo_state *state = screen->machine->driver_data;
+ turbo_state *state = (turbo_state *)screen->machine->driver_data;
bitmap_t *fgpixmap = tilemap_get_pixmap(state->fg_tilemap);
const UINT8 *prom_base = memory_region(screen->machine, "proms");
const UINT8 *pr1419 = prom_base + 0x000;
@@ -981,7 +981,7 @@ static UINT32 buckrog_get_sprite_bits(running_machine *machine, sprite_info *spr
VIDEO_UPDATE( buckrog )
{
- turbo_state *state = screen->machine->driver_data;
+ turbo_state *state = (turbo_state *)screen->machine->driver_data;
bitmap_t *fgpixmap = tilemap_get_pixmap(state->fg_tilemap);
const UINT8 *bgcolor = memory_region(screen->machine, "gfx3");
const UINT8 *prom_base = memory_region(screen->machine, "proms");
diff --git a/src/osd/windows/ledutil.c b/src/osd/windows/ledutil.c
index 708231c9a14..9b940f9eec2 100644
--- a/src/osd/windows/ledutil.c
+++ b/src/osd/windows/ledutil.c
@@ -381,11 +381,11 @@ static LRESULT handle_copydata(WPARAM wparam, LPARAM lparam)
return 1;
// allocate memory
- entry = malloc(sizeof(*entry));
+ entry = (id_map_entry *)malloc(sizeof(*entry));
if (entry == NULL)
return 0;
- string = malloc(strlen(data->string) + 1);
+ string = (char *)malloc(strlen(data->string) + 1);
if (string == NULL)
{
free(entry);
diff --git a/src/osd/windows/winalloc.c b/src/osd/windows/winalloc.c
index 6b7357cbd97..e33f339c33e 100644
--- a/src/osd/windows/winalloc.c
+++ b/src/osd/windows/winalloc.c
@@ -155,12 +155,12 @@ void *malloc_file_line(size_t size, const char *file, int line)
rounded_size = ((size + PAGE_SIZE - 1) / PAGE_SIZE) * PAGE_SIZE;
// reserve that much memory, plus two guard pages
- page_base = VirtualAlloc(NULL, rounded_size + 2 * PAGE_SIZE, MEM_RESERVE, PAGE_NOACCESS);
+ page_base = (UINT8 *)VirtualAlloc(NULL, rounded_size + 2 * PAGE_SIZE, MEM_RESERVE, PAGE_NOACCESS);
if (page_base == NULL)
return NULL;
// now allow access to everything but the first and last pages
- page_base = VirtualAlloc(page_base + PAGE_SIZE, rounded_size, MEM_COMMIT, PAGE_READWRITE);
+ page_base = (UINT8 *)VirtualAlloc(page_base + PAGE_SIZE, rounded_size, MEM_COMMIT, PAGE_READWRITE);
if (page_base == NULL)
return NULL;
diff --git a/src/osd/windows/windows.mak b/src/osd/windows/windows.mak
index 35a563d73f3..1a2b58f3126 100644
--- a/src/osd/windows/windows.mak
+++ b/src/osd/windows/windows.mak
@@ -207,6 +207,10 @@ endif
# add the windows libraries
LIBS += -luser32 -lgdi32 -lddraw -ldsound -ldxguid -lwinmm -ladvapi32 -lcomctl32 -lshlwapi
+ifdef CPP_COMPILE
+LIBS += -lsupc++
+endif
+
ifeq ($(DIRECTINPUT),8)
LIBS += -ldinput8
CCOMFLAGS += -DDIRECTINPUT_VERSION=0x0800
diff --git a/src/osd/windows/winprefix.h b/src/osd/windows/winprefix.h
index ef0f3f1e69b..6e5e059ca69 100644
--- a/src/osd/windows/winprefix.h
+++ b/src/osd/windows/winprefix.h
@@ -13,12 +13,20 @@
#include <stdlib.h>
#include <malloc.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
// override malloc/calloc/realloc/free to track file/line
void *malloc_file_line(size_t size, const char *file, int line);
void *calloc_file_line(size_t size, size_t count, const char *FILE, int line);
void *realloc_file_line(void *memory, size_t size, const char *file, int line);
void free_file_line(void *memory, const char *file, int line);
+#ifdef __cplusplus
+};
+#endif
+
#undef malloc
#define malloc(x) malloc_file_line(x, __FILE__, __LINE__)
#undef calloc
diff --git a/src/tools/chdman.c b/src/tools/chdman.c
index 8e0fb2175c3..0f2a8e8957c 100644
--- a/src/tools/chdman.c
+++ b/src/tools/chdman.c
@@ -519,7 +519,7 @@ static int do_createcd(int argc, char *argv[], int param)
outputfile = argv[3];
/* allocate a cache */
- cache = malloc(hunksize);
+ cache = (UINT8 *)malloc(hunksize);
if (cache == NULL)
{
fprintf(stderr, "Out of memory allocating temporary buffer\n");
@@ -933,7 +933,7 @@ static int do_createav(int argc, char *argv[], int param)
/* allocate space for the frame data */
if (height == 524/2 || height == 624/2)
{
- ldframedata = malloc(numframes * VBI_PACKED_BYTES);
+ ldframedata = (UINT8 *)malloc(numframes * VBI_PACKED_BYTES);
if (ldframedata == NULL)
{
fprintf(stderr, "Out of memory allocating frame metadata\n");
@@ -961,7 +961,7 @@ static int do_createav(int argc, char *argv[], int param)
avconfig.channels = channels;
for (chnum = 0; chnum < channels; chnum++)
{
- avconfig.audio[chnum] = malloc(max_samples_per_frame * 2);
+ avconfig.audio[chnum] = (INT16 *)malloc(max_samples_per_frame * 2);
if (avconfig.audio[chnum] == NULL)
{
fprintf(stderr, "Out of memory allocating temporary audio buffer\n");
@@ -1143,7 +1143,7 @@ static int do_createblankhd(int argc, char *argv[], int param)
}
/* alloc and zero buffer*/
- cache = malloc(hunksize);
+ cache = (UINT8 *)malloc(hunksize);
if (cache == NULL)
{
fprintf(stderr, "Error allocating memory buffer\n");
@@ -1608,7 +1608,7 @@ static int do_extractav(int argc, char *argv[], int param)
avconfig.actsamples = &numsamples;
for (chnum = 0; chnum < channels; chnum++)
{
- avconfig.audio[chnum] = malloc(avconfig.maxsamples * 2);
+ avconfig.audio[chnum] = (INT16 *)malloc(avconfig.maxsamples * 2);
if (avconfig.audio[chnum] == NULL)
{
fprintf(stderr, "Out of memory allocating temporary audio buffer\n");
@@ -1954,7 +1954,7 @@ static int do_fixavdata(int argc, char *argv[], int param)
avconfig.video = &fakebitmap;
/* allocate memory for VBI data */
- vbidata = malloc(header.totalhunks * VBI_PACKED_BYTES);
+ vbidata = (UINT8 *)malloc(header.totalhunks * VBI_PACKED_BYTES);
if (vbidata == NULL)
{
fprintf(stderr, "Out of memory allocating VBI data\n");
@@ -2762,7 +2762,7 @@ static int do_addmeta(int argc, char *argv[], int param)
/* if it's text, strip any trailing Ctrl-Z and CR/LF and add a trailing NULL */
if (param)
{
- metadata = realloc(metadata, metalength + 1);
+ metadata = (UINT8 *)realloc(metadata, metalength + 1);
if (metadata == NULL)
{
fprintf(stderr, "Out of memory preparing metadata\n");
@@ -2838,7 +2838,7 @@ static chd_error chdman_compress_file(chd_file *chd, const char *rawfile, UINT32
/* get the header */
header = chd_get_header(chd);
- cache = malloc(header->hunkbytes);
+ cache = (UINT8 *)malloc(header->hunkbytes);
if (cache == NULL)
{
err = CHDERR_OUT_OF_MEMORY;
@@ -2909,7 +2909,7 @@ static chd_error chdman_compress_chd(chd_file *chd, chd_file *source, UINT32 tot
/* get the header */
header = chd_get_header(chd);
- cache = malloc(header->hunkbytes);
+ cache = (UINT8 *)malloc(header->hunkbytes);
if (cache == NULL)
{
err = CHDERR_OUT_OF_MEMORY;
@@ -2918,7 +2918,7 @@ static chd_error chdman_compress_chd(chd_file *chd, chd_file *source, UINT32 tot
/* get the source CHD header */
source_header = chd_get_header(source);
- source_cache = malloc(source_header->hunkbytes);
+ source_cache = (UINT8 *)malloc(source_header->hunkbytes);
if (source_cache == NULL)
{
err = CHDERR_OUT_OF_MEMORY;
@@ -3166,7 +3166,7 @@ int CLIB_DECL main(int argc, char **argv)
{ "-addmetatext", do_addmeta, TRUE },
{ "-addmetabin", do_addmeta, FALSE },
};
- extern char build_version[];
+ extern const char build_version[];
int i;
/* print the header */
diff --git a/src/tools/jedutil.c b/src/tools/jedutil.c
index d48e28a0007..409dc55114c 100644
--- a/src/tools/jedutil.c
+++ b/src/tools/jedutil.c
@@ -99,7 +99,7 @@ static int read_source_file(const char *srcfile)
fseek(file, 0, SEEK_END);
srcbuflen = ftell(file);
fseek(file, 0, SEEK_SET);
- srcbuf = malloc(srcbuflen);
+ srcbuf = (UINT8 *)malloc(srcbuflen);
if (!srcbuf)
{
fprintf(stderr, "Unable to allocate %d bytes for the source!\n", (int)srcbuflen);
@@ -243,7 +243,7 @@ int main(int argc, char *argv[])
/* generate the output */
dstbuflen = jedbin_output(&jed, NULL, 0);
- dstbuf = malloc(dstbuflen);
+ dstbuf = (UINT8 *)malloc(dstbuflen);
if (!dstbuf)
{
fprintf(stderr, "Unable to allocate %d bytes for the target buffer!\n", (int)dstbuflen);
@@ -270,7 +270,7 @@ int main(int argc, char *argv[])
/* generate the output */
dstbuflen = jed_output(&jed, NULL, 0);
- dstbuf = malloc(dstbuflen);
+ dstbuf = (UINT8 *)malloc(dstbuflen);
if (!dstbuf)
{
fprintf(stderr, "Unable to allocate %d bytes for the target buffer!\n", (int)dstbuflen);
diff --git a/src/tools/ldresample.c b/src/tools/ldresample.c
index 6ec450ca651..c995c820363 100644
--- a/src/tools/ldresample.c
+++ b/src/tools/ldresample.c
@@ -129,8 +129,8 @@ static int chd_allocate_buffers(movie_info *info)
}
/* allocate sound buffers */
- info->lsound = malloc(info->samplerate * sizeof(*info->lsound));
- info->rsound = malloc(info->samplerate * sizeof(*info->rsound));
+ info->lsound = (INT16 *)malloc(info->samplerate * sizeof(*info->lsound));
+ info->rsound = (INT16 *)malloc(info->samplerate * sizeof(*info->rsound));
if (info->lsound == NULL || info->rsound == NULL)
{
fprintf(stderr, "Out of memory allocating sound buffers of %d bytes\n", (INT32)(info->samplerate * sizeof(*info->rsound)));
diff --git a/src/tools/ldverify.c b/src/tools/ldverify.c
index 1e52ab53128..187bea0cefa 100644
--- a/src/tools/ldverify.c
+++ b/src/tools/ldverify.c
@@ -123,19 +123,19 @@ static void *open_avi(const char *filename, movie_info *info)
static int read_avi(void *file, int frame, bitmap_t *bitmap, INT16 *lsound, INT16 *rsound, int *samples)
{
- const avi_movie_info *aviinfo = avi_get_movie_info(file);
+ const avi_movie_info *aviinfo = avi_get_movie_info((avi_file *)file);
UINT32 firstsample = ((UINT64)aviinfo->audio_samplerate * (UINT64)frame * (UINT64)aviinfo->video_sampletime + aviinfo->video_timescale - 1) / (UINT64)aviinfo->video_timescale;
UINT32 lastsample = ((UINT64)aviinfo->audio_samplerate * (UINT64)(frame + 1) * (UINT64)aviinfo->video_sampletime + aviinfo->video_timescale - 1) / (UINT64)aviinfo->video_timescale;
avi_error avierr;
/* read the frame */
- avierr = avi_read_video_frame_yuy16(file, frame, bitmap);
+ avierr = avi_read_video_frame_yuy16((avi_file *)file, frame, bitmap);
if (avierr != AVIERR_NONE)
return FALSE;
/* read the samples */
- avierr = avi_read_sound_samples(file, 0, firstsample, lastsample - firstsample, lsound);
- avierr = avi_read_sound_samples(file, 1, firstsample, lastsample - firstsample, rsound);
+ avierr = avi_read_sound_samples((avi_file *)file, 0, firstsample, lastsample - firstsample, lsound);
+ avierr = avi_read_sound_samples((avi_file *)file, 1, firstsample, lastsample - firstsample, rsound);
if (avierr != AVIERR_NONE)
return FALSE;
*samples = lastsample - firstsample;
@@ -149,7 +149,7 @@ static int read_avi(void *file, int frame, bitmap_t *bitmap, INT16 *lsound, INT1
static void close_avi(void *file)
{
- avi_close(file);
+ avi_close((avi_file *)file);
}
@@ -247,10 +247,10 @@ static int read_chd(void *file, int frame, bitmap_t *bitmap, INT16 *lsound, INT1
avconfig.audio[1] = &rsound[*samples];
/* configure the decompressor for this frame */
- chd_codec_config(file, AV_CODEC_DECOMPRESS_CONFIG, &avconfig);
+ chd_codec_config((chd_file *)file, AV_CODEC_DECOMPRESS_CONFIG, &avconfig);
/* read the frame */
- chderr = chd_read(file, frame * interlace_factor + fieldnum, NULL);
+ chderr = chd_read((chd_file *)file, frame * interlace_factor + fieldnum, NULL);
if (chderr != CHDERR_NONE)
return FALSE;
@@ -267,7 +267,7 @@ static int read_chd(void *file, int frame, bitmap_t *bitmap, INT16 *lsound, INT1
static void close_chd(void *file)
{
- chd_close(file);
+ chd_close((chd_file *)file);
}
@@ -723,8 +723,8 @@ int main(int argc, char *argv[])
}
/* allocate sound buffers */
- lsound = malloc(info.samplerate * sizeof(*lsound));
- rsound = malloc(info.samplerate * sizeof(*rsound));
+ lsound = (INT16 *)malloc(info.samplerate * sizeof(*lsound));
+ rsound = (INT16 *)malloc(info.samplerate * sizeof(*rsound));
if (lsound == NULL || rsound == NULL)
{
isavi ? close_avi(file) : close_chd(file);
diff --git a/src/tools/regrep.c b/src/tools/regrep.c
index 255b3b7b701..1f0b456854a 100644
--- a/src/tools/regrep.c
+++ b/src/tools/regrep.c
@@ -151,8 +151,8 @@ static int CLIB_DECL compare_file(const void *file0ptr, const void *file1ptr);
static summary_file *sort_file_list(void);
/* HTML helpers */
-static core_file *create_file_and_output_header(const astring *filename, const astring *template, const astring *title);
-static void output_footer_and_close_file(core_file *file, const astring *template, const astring *title);
+static core_file *create_file_and_output_header(const astring *filename, const astring *templatefile, const astring *title);
+static void output_footer_and_close_file(core_file *file, const astring *templatefile, const astring *title);
/* report generators */
static void output_report(const astring *dirname, const astring *tempheader, const astring *tempfooter, summary_file *filelist);
@@ -240,7 +240,7 @@ int main(int argc, char *argv[])
/* read the template file into an astring */
if (core_fload(astring_c(tempfilename), &buffer, &bufsize) == FILERR_NONE)
{
- tempheader = astring_dupch(buffer, bufsize);
+ tempheader = astring_dupch((const char *)buffer, bufsize);
free(buffer);
}
@@ -299,7 +299,7 @@ static summary_file *get_file(const char *filename)
return file;
/* didn't find one -- allocate */
- file = malloc(sizeof(*file));
+ file = (summary_file *)malloc(sizeof(*file));
if (file == NULL)
return NULL;
memset(file, 0, sizeof(*file));
@@ -376,7 +376,7 @@ static int read_summary_log(const char *filename, int index)
char *dirname = trim_string(linestart + 4);
/* allocate a copy of the string */
- lists[index].dir = malloc(strlen(dirname) + 1);
+ lists[index].dir = (char *)malloc(strlen(dirname) + 1);
if (lists[index].dir == NULL)
goto error;
strcpy(lists[index].dir, dirname);
@@ -413,7 +413,7 @@ static int read_summary_log(const char *filename, int index)
if (curfile->textsize[index] + (curptr - linestart) + 1 >= curfile->textalloc[index])
{
curfile->textalloc[index] = curfile->textsize[index] + (curptr - linestart) + 256;
- curfile->text[index] = realloc(curfile->text[index], curfile->textalloc[index]);
+ curfile->text[index] = (char *)realloc(curfile->text[index], curfile->textalloc[index]);
if (curfile->text[index] == NULL)
{
fprintf(stderr, "Unable to allocate memory for text\n");
@@ -542,7 +542,7 @@ static summary_file *sort_file_list(void)
numfiles++;
/* allocate an array of files */
- filearray = malloc(numfiles * sizeof(*filearray));
+ filearray = (summary_file **)malloc(numfiles * sizeof(*filearray));
if (filearray == NULL)
{
fprintf(stderr, "Out of memory!\n");
@@ -584,7 +584,7 @@ static summary_file *sort_file_list(void)
HTML file with a standard header
-------------------------------------------------*/
-static core_file *create_file_and_output_header(const astring *filename, const astring *template, const astring *title)
+static core_file *create_file_and_output_header(const astring *filename, const astring *templatefile, const astring *title)
{
astring *modified;
core_file *file;
@@ -594,7 +594,7 @@ static core_file *create_file_and_output_header(const astring *filename, const a
return NULL;
/* print a header */
- modified = astring_dup(template);
+ modified = astring_dup(templatefile);
astring_replacec(modified, 0, "<!--TITLE-->", astring_c(title));
core_fwrite(file, astring_c(modified), astring_len(modified));
@@ -609,11 +609,11 @@ static core_file *create_file_and_output_header(const astring *filename, const a
standard footer to an HTML file and close it
-------------------------------------------------*/
-static void output_footer_and_close_file(core_file *file, const astring *template, const astring *title)
+static void output_footer_and_close_file(core_file *file, const astring *templatefile, const astring *title)
{
astring *modified;
- modified = astring_dup(template);
+ modified = astring_dup(templatefile);
astring_replacec(modified, 0, "<!--TITLE-->", astring_c(title));
core_fwrite(file, astring_c(modified), astring_len(modified));
astring_free(modified);
@@ -904,7 +904,7 @@ static int generate_png_diff(const summary_file *curfile, const astring *destdir
/* load the source image */
pngerr = png_read_bitmap(file, &bitmaps[bitmapcount++]);
core_fclose(file);
- if (pngerr != FILERR_NONE)
+ if (pngerr != PNGERR_NONE)
goto error;
}
@@ -976,7 +976,7 @@ static int generate_png_diff(const summary_file *curfile, const astring *destdir
goto error;
pngerr = png_write_bitmap(file, NULL, finalbitmap, 0, NULL);
core_fclose(file);
- if (pngerr != FILERR_NONE)
+ if (pngerr != PNGERR_NONE)
goto error;
/* if we get here, we are error free */
diff --git a/src/tools/romcmp.c b/src/tools/romcmp.c
index 5cc39855f76..5271e5d2675 100644
--- a/src/tools/romcmp.c
+++ b/src/tools/romcmp.c
@@ -405,7 +405,7 @@ static void readfile(const char *path,fileinfo *file)
else fullname[0] = 0;
strcat(fullname,file->name);
- if ((file->buf = malloc(file->size)) == 0)
+ if ((file->buf = (unsigned char *)malloc(file->size)) == 0)
{
printf("%s: out of memory!\n",file->name);
return;
@@ -522,7 +522,7 @@ static int load_files(int i, int *found, const char *path)
else
strcpy(file->name,zipent->filename);
file->size = zipent->uncompressed_length;
- if ((file->buf = malloc(file->size)) == 0)
+ if ((file->buf = (unsigned char *)malloc(file->size)) == 0)
printf("%s: out of memory!\n",file->name);
else
{
diff --git a/src/tools/src2html.c b/src/tools/src2html.c
index 0b5322d516b..6f5719f74b6 100644
--- a/src/tools/src2html.c
+++ b/src/tools/src2html.c
@@ -181,8 +181,8 @@ static int recurse_dir(int srcrootlen, int dstrootlen, const astring *srcdir, co
static int output_file(file_type type, int srcrootlen, int dstrootlen, const astring *srcfile, const astring *dstfile, int link_to_file, const astring *tempheader, const astring *tempfooter);
/* HTML helpers */
-static core_file *create_file_and_output_header(const astring *filename, const astring *template, const astring *path);
-static void output_footer_and_close_file(core_file *file, const astring *template, const astring *path);
+static core_file *create_file_and_output_header(const astring *filename, const astring *templatefile, const astring *path);
+static void output_footer_and_close_file(core_file *file, const astring *templatefile, const astring *path);
/* path helpers */
static const astring *normalized_subpath(const astring *path, int start);
@@ -216,7 +216,7 @@ int main(int argc, char *argv[])
/* include path? */
if (arg[0] == '-' && arg[1] == 'I')
{
- *incpathhead = malloc(sizeof(**incpathhead));
+ *incpathhead = (include_path *)malloc(sizeof(**incpathhead));
if (*incpathhead != NULL)
{
(*incpathhead)->next = NULL;
@@ -252,7 +252,7 @@ int main(int argc, char *argv[])
/* read the template file into an astring */
if (core_fload(astring_c(tempfilename), &buffer, &bufsize) == FILERR_NONE)
{
- tempheader = astring_dupch(buffer, bufsize);
+ tempheader = astring_dupch((const char *)buffer, bufsize);
free(buffer);
}
@@ -353,7 +353,7 @@ static int recurse_dir(int srcrootlen, int dstrootlen, const astring *srcdir, co
while ((entry = osd_readdir(dir)) != NULL)
if (entry->type == entry_type && entry->name[0] != '.')
{
- list_entry *lentry = malloc(sizeof(*lentry));
+ list_entry *lentry = (list_entry *)malloc(sizeof(*lentry));
lentry->name = astring_dupc(entry->name);
lentry->next = list;
list = lentry;
@@ -368,7 +368,7 @@ static int recurse_dir(int srcrootlen, int dstrootlen, const astring *srcdir, co
continue;
/* allocate memory for sorting */
- listarray = malloc(sizeof(list_entry *) * found);
+ listarray = (list_entry **)malloc(sizeof(list_entry *) * found);
found = 0;
for (curlist = list; curlist != NULL; curlist = curlist->next)
listarray[found++] = curlist;
@@ -734,7 +734,7 @@ static int output_file(file_type type, int srcrootlen, int dstrootlen, const ast
HTML file with a standard header
-------------------------------------------------*/
-static core_file *create_file_and_output_header(const astring *filename, const astring *template, const astring *path)
+static core_file *create_file_and_output_header(const astring *filename, const astring *templatefile, const astring *path)
{
astring *modified;
core_file *file;
@@ -744,7 +744,7 @@ static core_file *create_file_and_output_header(const astring *filename, const a
return NULL;
/* print a header */
- modified = astring_dup(template);
+ modified = astring_dup(templatefile);
astring_replacec(modified, 0, "<!--PATH-->", astring_c(path));
core_fwrite(file, astring_c(modified), astring_len(modified));
@@ -759,11 +759,11 @@ static core_file *create_file_and_output_header(const astring *filename, const a
standard footer to an HTML file and close it
-------------------------------------------------*/
-static void output_footer_and_close_file(core_file *file, const astring *template, const astring *path)
+static void output_footer_and_close_file(core_file *file, const astring *templatefile, const astring *path)
{
astring *modified;
- modified = astring_dup(template);
+ modified = astring_dup(templatefile);
astring_replacec(modified, 0, "<!--PATH-->", astring_c(path));
core_fwrite(file, astring_c(modified), astring_len(modified));
astring_free(modified);
diff --git a/src/version.c b/src/version.c
index fb0a143f68b..11fb9b52512 100644
--- a/src/version.c
+++ b/src/version.c
@@ -9,4 +9,5 @@
***************************************************************************/
+extern const char build_version[];
const char build_version[] = "0.131 ("__DATE__")";