summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2008-11-02 02:40:46 +0000
committer Aaron Giles <aaron@aarongiles.com>2008-11-02 02:40:46 +0000
commit4e80367366c8bcf13d4222a2ec5ce2bdbac37a47 (patch)
tree14b686668c8d74005937c0fa508f1bbb3cd9a3e2
parentd08215d8ee11f1565fdae77cf661fac3f7b69404 (diff)
Here's another MAME tidy patch. This one adds missing const/statics,
adds/removes entries in header files, and fixes a few potential multisession issues by explicitly adding initializers. asic65.c has significant changes to accomodate using a struct instead of 16 variables, otherwise the changes in this patch are modest and obvious. [Atari Ace]
-rw-r--r--src/emu/cpu/mips/mips3com.h2
-rw-r--r--src/emu/cpu/powerpc/ppccom.h1
-rw-r--r--src/emu/machine/8042kbdc.c4
-rw-r--r--src/emu/machine/ldcore.c2
-rw-r--r--src/emu/machine/pd4990a.c20
-rw-r--r--src/emu/machine/z80ctc.h1
-rw-r--r--src/emu/render.h6
-rw-r--r--src/emu/uimenu.c6
-rw-r--r--src/mame/audio/dkong.c2
-rw-r--r--src/mame/drivers/cave.c2
-rw-r--r--src/mame/drivers/chanbara.c2
-rw-r--r--src/mame/drivers/cosmic.c2
-rw-r--r--src/mame/drivers/ddealer.c4
-rw-r--r--src/mame/drivers/dwarfd.c4
-rw-r--r--src/mame/drivers/expro02.c6
-rw-r--r--src/mame/drivers/firefox.c2
-rw-r--r--src/mame/drivers/gstriker.c10
-rw-r--r--src/mame/drivers/hotblock.c2
-rw-r--r--src/mame/drivers/jalmah.c6
-rw-r--r--src/mame/drivers/magictg.c4
-rw-r--r--src/mame/drivers/megadriv.c8
-rw-r--r--src/mame/drivers/megadriv.h21
-rw-r--r--src/mame/drivers/merit.c4
-rw-r--r--src/mame/drivers/meritm.c6
-rw-r--r--src/mame/drivers/namcos12.c15
-rw-r--r--src/mame/drivers/segac2.c15
-rw-r--r--src/mame/drivers/sliver.c3
-rw-r--r--src/mame/drivers/snesb.c2
-rw-r--r--src/mame/drivers/snookr10.c4
-rw-r--r--src/mame/drivers/taito_f2.c2
-rw-r--r--src/mame/drivers/ttchamp.c2
-rw-r--r--src/mame/drivers/twins.c4
-rw-r--r--src/mame/drivers/videopkr.c18
-rw-r--r--src/mame/includes/bzone.h1
-rw-r--r--src/mame/includes/cave.h2
-rw-r--r--src/mame/includes/cchasm.h3
-rw-r--r--src/mame/includes/cps1.h3
-rw-r--r--src/mame/includes/galaxold.h9
-rw-r--r--src/mame/includes/gottlieb.h1
-rw-r--r--src/mame/includes/snes.h1
-rw-r--r--src/mame/includes/snk.h3
-rw-r--r--src/mame/includes/starwars.h3
-rw-r--r--src/mame/includes/stv.h2
-rw-r--r--src/mame/includes/tx1.h4
-rw-r--r--src/mame/machine/asic65.c249
-rw-r--r--src/mame/machine/namcos2.c17
-rw-r--r--src/mame/machine/neocrypt.c2
-rw-r--r--src/mame/machine/playch10.c4
-rw-r--r--src/mame/video/cischeat.c9
-rw-r--r--src/mame/video/popeye.c4
-rw-r--r--src/mame/video/segag80r.c2
-rw-r--r--src/mame/video/silkroad.c6
-rw-r--r--src/mame/video/tx1.c2
53 files changed, 268 insertions, 251 deletions
diff --git a/src/emu/cpu/mips/mips3com.h b/src/emu/cpu/mips/mips3com.h
index f21cea2ede3..e03857b3ccc 100644
--- a/src/emu/cpu/mips/mips3com.h
+++ b/src/emu/cpu/mips/mips3com.h
@@ -229,8 +229,6 @@ void mips3com_reset(mips3_state *mips);
offs_t mips3com_dasm(mips3_state *mips, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
void mips3com_update_cycle_counting(mips3_state *mips);
-void mips3com_map_tlb_entry(mips3_state *mips, int tlbindex);
-void mips3com_map_tlb_entries(mips3_state *mips);
void mips3com_asid_changed(mips3_state *mips);
int mips3com_translate_address(mips3_state *mips, int space, int intention, offs_t *address);
void mips3com_tlbr(mips3_state *mips);
diff --git a/src/emu/cpu/powerpc/ppccom.h b/src/emu/cpu/powerpc/ppccom.h
index 00701c224f9..9ace71aa23f 100644
--- a/src/emu/cpu/powerpc/ppccom.h
+++ b/src/emu/cpu/powerpc/ppccom.h
@@ -575,7 +575,6 @@ void ppccom_exit(powerpc_state *ppc);
void ppccom_reset(powerpc_state *ppc);
offs_t ppccom_dasm(powerpc_state *ppc, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
-void ppccom_update_cycle_counting(powerpc_state *ppc);
int ppccom_translate_address(powerpc_state *ppc, int space, int intention, offs_t *address);
diff --git a/src/emu/machine/8042kbdc.c b/src/emu/machine/8042kbdc.c
index d0d5e292126..cf1fa3deca7 100644
--- a/src/emu/machine/8042kbdc.c
+++ b/src/emu/machine/8042kbdc.c
@@ -232,6 +232,8 @@ static struct
int offset1;
} kbdc8042;
+static int poll_delay;
+
static void at_8042_check_keyboard(void);
@@ -266,6 +268,7 @@ static TIMER_CALLBACK( kbdc8042_time )
void kbdc8042_init(const struct kbdc8042_interface *intf)
{
+ poll_delay = 10;
memset(&kbdc8042, 0, sizeof(kbdc8042));
kbdc8042.type = intf->type;
kbdc8042.set_gate_a20 = intf->set_gate_a20;
@@ -347,7 +350,6 @@ static void at_8042_clear_keyboard_received(void)
READ8_HANDLER(kbdc8042_8_r)
{
- static int poll_delay = 10;
UINT8 data = 0;
switch (offset) {
diff --git a/src/emu/machine/ldcore.c b/src/emu/machine/ldcore.c
index d8800c08308..6d8793bd656 100644
--- a/src/emu/machine/ldcore.c
+++ b/src/emu/machine/ldcore.c
@@ -156,7 +156,7 @@ static void configuration_save(running_machine *machine, int config_type, xml_da
GLOBAL VARIABLES
***************************************************************************/
-static const ldplayer_interface *player_interfaces[] =
+static const ldplayer_interface *const player_interfaces[] =
{
// &pr7820_interface,
&pr8210_interface,
diff --git a/src/emu/machine/pd4990a.c b/src/emu/machine/pd4990a.c
index 22010476975..433c899027d 100644
--- a/src/emu/machine/pd4990a.c
+++ b/src/emu/machine/pd4990a.c
@@ -36,7 +36,7 @@
/* Set the data in the chip to Monday 09/09/73 00:00:00 */
/* If you ever read this Leejanne, you know what I mean :-) */
-struct pd4990a_s pd4990a =
+static const struct pd4990a_s pd4990a_initval =
{
0x00, /* seconds BCD */
0x00, /* minutes BCD */
@@ -47,11 +47,13 @@ struct pd4990a_s pd4990a =
1 /* weekday BCD */
};
+struct pd4990a_s pd4990a;
+
static UINT32 shiftlo,shifthi;
static int retraces = 0; /* Assumes 60 retraces a second */
static int testwaits= 0;
-static int maxwaits= 1; /*switch test every frame*/
+static int maxwaits= 0; /*switch test every frame*/
static int testbit = 0; /* Pulses a bit in order to simulate */
/* test output */
static int outputbit=0;
@@ -326,6 +328,20 @@ WRITE16_HANDLER( pd4990a_control_16_w )
void pd4990a_init(void)
{
+ pd4990a = pd4990a_initval;
+ shiftlo = 0;
+ shifthi = 0;
+ retraces = 0;
+ testwaits = 0;
+ maxwaits = 1;
+ testbit = 0;
+ outputbit = 0;
+ bitno = 0;
+ reading = 0;
+ writting = 0;
+ clock_line = 0;
+ command_line =0;
+
state_save_register_item("pd4990a", 0, pd4990a.seconds);
state_save_register_item("pd4990a", 0, pd4990a.minutes);
state_save_register_item("pd4990a", 0, pd4990a.hours);
diff --git a/src/emu/machine/z80ctc.h b/src/emu/machine/z80ctc.h
index 8b4b08ed3de..355b89458f9 100644
--- a/src/emu/machine/z80ctc.h
+++ b/src/emu/machine/z80ctc.h
@@ -57,7 +57,6 @@ struct _z80ctc_interface
INITIALIZATION/CONFIGURATION
***************************************************************************/
-void z80ctc_reset(const device_config *device);
attotime z80ctc_getperiod(const device_config *device, int ch);
diff --git a/src/emu/render.h b/src/emu/render.h
index f8f61531f28..a2b62768b80 100644
--- a/src/emu/render.h
+++ b/src/emu/render.h
@@ -324,9 +324,6 @@ struct _render_container_user_settings
/* allocate base structures for the rendering system */
void render_init(running_machine *machine);
-/* set a notifier that we call before doing long scaling operations */
-void render_set_rescale_notify(running_machine *machine, int (*notifier)(running_machine *, int, int));
-
/* return a boolean indicating if the screen is live */
int render_is_live_screen(const device_config *screen);
@@ -342,9 +339,6 @@ render_target *render_get_ui_target(void);
/* return the aspect ratio for UI fonts */
float render_get_ui_aspect(void);
-/* performs an input hit test */
-int render_input_hit_test(render_target *target, INT32 target_x, INT32 target_y, const char *input_tag, UINT32 input_mask);
-
/* ----- render target management ----- */
diff --git a/src/emu/uimenu.c b/src/emu/uimenu.c
index d1c00cf807a..895183f5387 100644
--- a/src/emu/uimenu.c
+++ b/src/emu/uimenu.c
@@ -217,9 +217,9 @@ static render_texture *hilight_texture;
static render_texture *arrow_texture;
-static const char *priortext = "Return to Prior Menu";
-static const char *backtext = "Return to " CAPSTARTGAMENOUN;
-static const char *exittext = "Exit";
+static const char priortext[] = "Return to Prior Menu";
+static const char backtext[] = "Return to " CAPSTARTGAMENOUN;
+static const char exittext[] = "Exit";
static const rgb_t text_fgcolor = MAKE_ARGB(0xff,0xff,0xff,0xff);
static const rgb_t text_bgcolor = MAKE_ARGB(0xe0,0x80,0x80,0x80);
diff --git a/src/mame/audio/dkong.c b/src/mame/audio/dkong.c
index 157940e7f87..e9e387fc017 100644
--- a/src/mame/audio/dkong.c
+++ b/src/mame/audio/dkong.c
@@ -973,7 +973,7 @@ DISCRETE_SOUND_END
*
****************************************************************/
-SOUND_START( dkong)
+static SOUND_START( dkong)
{
dkong_state *state = machine->driver_data;
diff --git a/src/mame/drivers/cave.c b/src/mame/drivers/cave.c
index a089ec66fa8..69d05e90001 100644
--- a/src/mame/drivers/cave.c
+++ b/src/mame/drivers/cave.c
@@ -78,8 +78,6 @@ Versions known to exist but not dumped:
#include "sound/okim6295.h"
#include "sound/ymz280b.h"
-extern UINT16 *cave_spriteram16_2;
-
/***************************************************************************
diff --git a/src/mame/drivers/chanbara.c b/src/mame/drivers/chanbara.c
index 9533fd27238..5bebcc57457 100644
--- a/src/mame/drivers/chanbara.c
+++ b/src/mame/drivers/chanbara.c
@@ -163,7 +163,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
static UINT8 scroll;
static UINT8 scrollhi;
-VIDEO_UPDATE( chanbara )
+static VIDEO_UPDATE( chanbara )
{
tilemap_set_scrolly(bg2_tilemap,0,scroll | (scrollhi << 8));
tilemap_draw(bitmap, cliprect, bg2_tilemap, 0, 0);
diff --git a/src/mame/drivers/cosmic.c b/src/mame/drivers/cosmic.c
index 42a7f232ecc..f9daa024962 100644
--- a/src/mame/drivers/cosmic.c
+++ b/src/mame/drivers/cosmic.c
@@ -998,7 +998,7 @@ static GFXDECODE_START( cosmica )
GFXDECODE_END
-static const char *cosmica_sample_names[] =
+static const char *const cosmica_sample_names[] =
{
"*cosmica",
"backgr.wav",
diff --git a/src/mame/drivers/ddealer.c b/src/mame/drivers/ddealer.c
index 139531f82d4..9b1a4498053 100644
--- a/src/mame/drivers/ddealer.c
+++ b/src/mame/drivers/ddealer.c
@@ -337,14 +337,14 @@ static TIMER_DEVICE_CALLBACK( ddealer_mcu_sim )
-WRITE16_HANDLER( back_vram_w )
+static WRITE16_HANDLER( back_vram_w )
{
COMBINE_DATA(&back_vram[offset]);
tilemap_mark_tile_dirty(back_tilemap,offset);
}
-WRITE16_HANDLER( ddealer_vregs_w )
+static WRITE16_HANDLER( ddealer_vregs_w )
{
COMBINE_DATA(&ddealer_vregs[offset]);
}
diff --git a/src/mame/drivers/dwarfd.c b/src/mame/drivers/dwarfd.c
index ab7bb267713..69695e8bb7e 100644
--- a/src/mame/drivers/dwarfd.c
+++ b/src/mame/drivers/dwarfd.c
@@ -86,8 +86,8 @@ A ||| |______| |
#include "sound/ay8910.h"
//should be taken from crt params
-static int maxy=25;
-static int maxx=80;
+static const int maxy=25;
+static const int maxx=80;
static int bank=0;
static UINT8 *videobuf;
diff --git a/src/mame/drivers/expro02.c b/src/mame/drivers/expro02.c
index 89b606feb86..9b75c04370a 100644
--- a/src/mame/drivers/expro02.c
+++ b/src/mame/drivers/expro02.c
@@ -339,7 +339,7 @@ static WRITE16_HANDLER( galsnew_6295_bankswitch_w )
static UINT16 vram_0_bank_num = 0, vram_1_bank_num = 0;
-WRITE16_HANDLER(galsnew_vram_0_bank_w)
+static WRITE16_HANDLER(galsnew_vram_0_bank_w)
{
int i;
if(vram_0_bank_num != data)
@@ -355,7 +355,7 @@ WRITE16_HANDLER(galsnew_vram_0_bank_w)
}
}
-WRITE16_HANDLER(galsnew_vram_1_bank_w)
+static WRITE16_HANDLER(galsnew_vram_1_bank_w)
{
int i;
if(vram_1_bank_num != data)
@@ -695,7 +695,7 @@ ROM_START( fantasia )
ROM_END
-DRIVER_INIT(galsnew)
+static DRIVER_INIT(galsnew)
{
UINT32 *src = (UINT32 *)memory_region(machine, "gfx3" );
UINT32 *dst = (UINT32 *)memory_region(machine, "gfx2" );
diff --git a/src/mame/drivers/firefox.c b/src/mame/drivers/firefox.c
index a95145335b4..4256540ba1b 100644
--- a/src/mame/drivers/firefox.c
+++ b/src/mame/drivers/firefox.c
@@ -518,7 +518,7 @@ ADDRESS_MAP_END
*
*************************************/
-INPUT_PORTS_START( firefox )
+static INPUT_PORTS_START( firefox )
PORT_START("rdin0")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 )
diff --git a/src/mame/drivers/gstriker.c b/src/mame/drivers/gstriker.c
index b38dd57a505..01003dd1223 100644
--- a/src/mame/drivers/gstriker.c
+++ b/src/mame/drivers/gstriker.c
@@ -180,15 +180,15 @@ Frequencies: 68k is XTAL_32MHZ/2
//UINT16 *gs_videoram3;
static UINT16 *gs_mixer_regs;
+static UINT16 dmmy_8f_ret;
/*** MISC READ / WRITE HANDLERS **********************************************/
static READ16_HANDLER(dmmy_8f)
{
- static int ret = 0xFFFF;
- ret = ~ret;
- return ret;
+ dmmy_8f_ret = ~dmmy_8f_ret;
+ return dmmy_8f_ret;
}
/*** SOUND RELATED ***********************************************************/
@@ -986,6 +986,10 @@ static WRITE16_HANDLER( vbl_toggle_w )
static void mcu_init( running_machine *machine )
{
+ dmmy_8f_ret = 0xFFFF;
+ pending_command = 0;
+ mcu_data = 0;
+
memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x20008a, 0x20008b, 0, 0, twrldc94_mcu_w);
memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x20008a, 0x20008b, 0, 0, twrldc94_mcu_r);
diff --git a/src/mame/drivers/hotblock.c b/src/mame/drivers/hotblock.c
index ce24a887e71..fccbf1f8d75 100644
--- a/src/mame/drivers/hotblock.c
+++ b/src/mame/drivers/hotblock.c
@@ -124,7 +124,7 @@ static VIDEO_UPDATE(hotblock)
int y,x,count;
int i;
- static int xxx=320,yyy=204;
+ static const int xxx=320,yyy=204;
fillbitmap(bitmap, get_black_pen(screen->machine), 0);
diff --git a/src/mame/drivers/jalmah.c b/src/mame/drivers/jalmah.c
index 1fc3be7ec09..a760440c4ed 100644
--- a/src/mame/drivers/jalmah.c
+++ b/src/mame/drivers/jalmah.c
@@ -412,7 +412,7 @@ static VIDEO_UPDATE( jalmah )
return 0;
}
-VIDEO_UPDATE( urashima )
+static VIDEO_UPDATE( urashima )
{
/*this game doesn't use the RANGE register at all.*/
tilemap_set_scrollx( sc0_tilemap_0, 0, jm_scrollram[0]);
@@ -525,7 +525,7 @@ static WRITE16_HANDLER( jalmah_scroll_w )
}
}
-WRITE16_HANDLER( urashima_bank_w )
+static WRITE16_HANDLER( urashima_bank_w )
{
if (ACCESSING_BITS_0_7)
{
@@ -628,7 +628,7 @@ if((0xffff - input_port_read(machine, tag)) & _bit_) { jm_shared_ram[_offset_] =
/*Funky "DMA" / protection thing*/
/*---- -x-- "DMA" execute.*/
/*---- ---x used too very often,I don't have any clue of what it is,it might just be the source or the destination address.*/
-WRITE16_HANDLER( urashima_dma_w )
+static WRITE16_HANDLER( urashima_dma_w )
{
if(data & 4)
{
diff --git a/src/mame/drivers/magictg.c b/src/mame/drivers/magictg.c
index 2b3cf57b8d2..3bde79d792a 100644
--- a/src/mame/drivers/magictg.c
+++ b/src/mame/drivers/magictg.c
@@ -114,12 +114,12 @@ Medium size chip with heat sink on it
#include "cpu/mips/mips3.h"
-VIDEO_START(magictg)
+static VIDEO_START(magictg)
{
}
-VIDEO_UPDATE(magictg)
+static VIDEO_UPDATE(magictg)
{
return 0;
}
diff --git a/src/mame/drivers/megadriv.c b/src/mame/drivers/megadriv.c
index c1e3ce700e8..35e855719e6 100644
--- a/src/mame/drivers/megadriv.c
+++ b/src/mame/drivers/megadriv.c
@@ -125,14 +125,14 @@ static int _svp_cpu_number;
static int _genesis_snd_z80_cpu_number;
-int segac2_bg_pal_lookup[4] = { 0x00, 0x10, 0x20, 0x30 };
-int segac2_sp_pal_lookup[4] = { 0x00, 0x10, 0x20, 0x30 };
+int segac2_bg_pal_lookup[4];
+int segac2_sp_pal_lookup[4];
// hacks for C2
-int genvdp_use_cram = 1; // c2 uses it's own palette ram
+int genvdp_use_cram = 0; // c2 uses it's own palette ram
int genesis_has_z80;
int genesis_always_irq6 = 0; // c2 never enables the irq6, different source??
-int genesis_other_hacks = 1; // misc hacks
+int genesis_other_hacks = 0; // misc hacks
INLINE UINT16 get_hposition(void);
diff --git a/src/mame/drivers/megadriv.h b/src/mame/drivers/megadriv.h
index aaf85e79118..bcb6a480a71 100644
--- a/src/mame/drivers/megadriv.h
+++ b/src/mame/drivers/megadriv.h
@@ -1,7 +1,8 @@
+extern DRIVER_INIT( megadriv_c2 );
extern DRIVER_INIT( megadrie );
extern DRIVER_INIT( megadriv );
extern DRIVER_INIT( megadrij );
-extern DRIVER_INIT( megadsvp );
+extern DRIVER_INIT( _32x );
INPUT_PORTS_EXTERN(megadriv);
INPUT_PORTS_EXTERN(aladbl);
@@ -9,10 +10,13 @@ INPUT_PORTS_EXTERN(megadri6);
INPUT_PORTS_EXTERN(ssf2ghw);
INPUT_PORTS_EXTERN(megdsvp);
+MACHINE_DRIVER_EXTERN( megdsvppal );
MACHINE_DRIVER_EXTERN(megadriv);
MACHINE_DRIVER_EXTERN(megadpal);
-MACHINE_DRIVER_EXTERN(_32x);
MACHINE_DRIVER_EXTERN(megdsvp);
+MACHINE_DRIVER_EXTERN( genesis_32x );
+MACHINE_DRIVER_EXTERN( genesis_scd );
+MACHINE_DRIVER_EXTERN( genesis_32x_scd );
extern UINT16* megadriv_backupram;
extern int megadriv_backupram_length;
@@ -39,3 +43,16 @@ extern UINT8 (*megadrive_io_read_data_port_ptr)(int offset);
extern void (*megadrive_io_write_data_port_ptr)(int offset, UINT16 data);
extern UINT8 megadrive_io_data_regs[3];
extern UINT8 megadrive_io_ctrl_regs[3];
+
+extern UINT16* megadrive_vdp_palette_lookup;
+extern UINT16* megadrive_vdp_palette_lookup_sprite; // for C2
+extern UINT16* megadrive_vdp_palette_lookup_shadow;
+extern UINT16* megadrive_vdp_palette_lookup_highlight;
+
+extern int segac2_bg_pal_lookup[4];
+extern int segac2_sp_pal_lookup[4];
+
+extern int genvdp_use_cram;
+extern int genesis_has_z80;
+extern int genesis_always_irq6;
+extern int genesis_other_hacks;
diff --git a/src/mame/drivers/merit.c b/src/mame/drivers/merit.c
index 83f2bd4e1aa..dd05fbf0a15 100644
--- a/src/mame/drivers/merit.c
+++ b/src/mame/drivers/merit.c
@@ -232,13 +232,13 @@ static MC6845_UPDATE_ROW( update_row )
}
-MC6845_ON_HSYNC_CHANGED(hsync_changed)
+static MC6845_ON_HSYNC_CHANGED(hsync_changed)
{
/* update any video up to the current scanline */
video_screen_update_now(device->machine->primary_screen);
}
-MC6845_ON_VSYNC_CHANGED(vsync_changed)
+static MC6845_ON_VSYNC_CHANGED(vsync_changed)
{
cpunum_set_input_line(device->machine, 0, 0, vsync ? ASSERT_LINE : CLEAR_LINE);
}
diff --git a/src/mame/drivers/meritm.c b/src/mame/drivers/meritm.c
index 53313041afa..f0bbbcaf090 100644
--- a/src/mame/drivers/meritm.c
+++ b/src/mame/drivers/meritm.c
@@ -318,8 +318,12 @@ static void meritm_vdp1_interrupt(running_machine *machine, int i)
}
}
+static int layer0_enabled, layer1_enabled;
+
static VIDEO_START( meritm )
{
+ layer0_enabled = layer1_enabled = 1;
+
vdp0_bitmap = video_screen_auto_bitmap_alloc(machine->primary_screen);
v9938_init (machine, 0, machine->primary_screen, vdp0_bitmap, MODEL_V9938, 0x20000, meritm_vdp0_interrupt);
v9938_reset(0);
@@ -336,8 +340,6 @@ static VIDEO_START( meritm )
}
-static int layer0_enabled = 1, layer1_enabled = 1;
-
static VIDEO_UPDATE( meritm )
{
if(input_code_pressed_once(KEYCODE_Q))
diff --git a/src/mame/drivers/namcos12.c b/src/mame/drivers/namcos12.c
index 3903eb97761..c1457bbe78c 100644
--- a/src/mame/drivers/namcos12.c
+++ b/src/mame/drivers/namcos12.c
@@ -1008,7 +1008,7 @@ static WRITE32_HANDLER( bankoffset_w )
static UINT32 m_n_dmaoffset;
static UINT32 m_n_dmabias;
-static UINT32 m_n_tektagdmaoffset = 0xffffffff;
+static UINT32 m_n_tektagdmaoffset;
static WRITE32_HANDLER( dmaoffset_w )
{
@@ -1330,7 +1330,7 @@ static READ8_HANDLER( s12_mcu_rtc_r )
return ret;
}
-static int s12_lastpB = 0x50, s12_setstate = 0, s12_setnum, s12_settings[8];
+static int s12_lastpB, s12_setstate, s12_setnum, s12_settings[8];
static READ8_HANDLER( s12_mcu_portB_r )
{
@@ -1438,6 +1438,17 @@ static DRIVER_INIT( namcos12 )
psx_dma_install_read_handler( 5, namcos12_rom_read );
memory_configure_bank( 1, 0, memory_region_length( machine, "user2" ) / 0x200000, memory_region( machine, "user2" ), 0x200000 );
+
+ s12_porta = 0;
+ s12_rtcstate = 0;
+ s12_lastpB = 0x50;
+ s12_setstate = 0;
+ s12_setnum = 0;
+ memset(s12_settings, 0, sizeof(s12_settings));
+
+ m_n_tektagdmaoffset = 0xffffffff;
+ m_n_dmaoffset = 0;
+ m_n_dmabias = 0;
m_n_bankoffset = 0;
memory_set_bank( 1, 0 );
diff --git a/src/mame/drivers/segac2.c b/src/mame/drivers/segac2.c
index ca7c47a5679..4ec62d0ecb1 100644
--- a/src/mame/drivers/segac2.c
+++ b/src/mame/drivers/segac2.c
@@ -247,12 +247,6 @@ static READ16_HANDLER( palette_r )
return paletteram16[offset + palbank * 0x200];
}
-extern UINT16* megadrive_vdp_palette_lookup;
-extern UINT16* megadrive_vdp_palette_lookup_sprite; // for C2
-extern UINT16* megadrive_vdp_palette_lookup_shadow;
-extern UINT16* megadrive_vdp_palette_lookup_highlight;
-
-
UINT16* megadrive_vdp_palette_lookup_segac2;
UINT16* megadrive_vdp_palette_lookup_sprite_segac2;
UINT16* megadrive_vdp_palette_lookup_shadow_segac2;
@@ -326,9 +320,6 @@ static WRITE16_HANDLER( palette_w )
******************************************************************************/
-extern int segac2_bg_pal_lookup[4];
-extern int segac2_sp_pal_lookup[4];
-
static void recompute_palette_tables(void)
{
int i;
@@ -1868,12 +1859,6 @@ it should be, otherwise I don't see how the formula could be computed.
******************************************************************************/
-extern int genvdp_use_cram;
-extern int genesis_has_z80;
-extern int genesis_always_irq6;
-extern int genesis_other_hacks;
-extern DRIVER_INIT( megadriv_c2 );
-
static void segac2_common_init(running_machine* machine, int (*func)(int in))
{
DRIVER_INIT_CALL( megadriv_c2 );
diff --git a/src/mame/drivers/sliver.c b/src/mame/drivers/sliver.c
index 460129013e7..67aa03b88da 100644
--- a/src/mame/drivers/sliver.c
+++ b/src/mame/drivers/sliver.c
@@ -80,7 +80,7 @@ static UINT16 io_reg[IO_SIZE];
static UINT16 fifo[FIFO_SIZE];
static UINT16 fptr;
-static int jpeg_addr=-1;
+static int jpeg_addr;
static UINT16 jpeg1,jpeg2;
static int jpeg_h=0;
static int jpeg_w=0;
@@ -588,6 +588,7 @@ ROM_END
static DRIVER_INIT(sliver)
{
+ jpeg_addr = -1;
colorram=auto_malloc(256*3);
}
diff --git a/src/mame/drivers/snesb.c b/src/mame/drivers/snesb.c
index dcc4a54c874..51e789718e6 100644
--- a/src/mame/drivers/snesb.c
+++ b/src/mame/drivers/snesb.c
@@ -650,7 +650,7 @@ static const UINT8 address_substitution_high[] =
0x2b,0x25,0x28,0x2f,0x26,0x22,0x23,0x2a,0x2d,0x24,0x2e,0x20,0x27,0x2c,0x21,0x29
};
-DRIVER_INIT( sblast2b )
+static DRIVER_INIT( sblast2b )
{
int i, cipherText, plainText, newAddress;
UINT8 *src = memory_region(machine, "user7");
diff --git a/src/mame/drivers/snookr10.c b/src/mame/drivers/snookr10.c
index 74183724301..b6f5345f8ee 100644
--- a/src/mame/drivers/snookr10.c
+++ b/src/mame/drivers/snookr10.c
@@ -375,8 +375,8 @@ VIDEO_START( snookr10 );
VIDEO_START( apple10 );
VIDEO_UPDATE( snookr10 );
-int outportl, outporth;
-int bit0, bit1, bit2, bit3, bit4, bit5;
+static int outportl, outporth;
+static int bit0, bit1, bit2, bit3, bit4, bit5;
/**********************
* Read/Write Handlers *
diff --git a/src/mame/drivers/taito_f2.c b/src/mame/drivers/taito_f2.c
index ed1edfb08d3..2db6afb41d6 100644
--- a/src/mame/drivers/taito_f2.c
+++ b/src/mame/drivers/taito_f2.c
@@ -3499,7 +3499,7 @@ static INPUT_PORTS_START( mjnquest )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
INPUT_PORTS_END
-INPUT_PORTS_START( yesnoj )
+static INPUT_PORTS_START( yesnoj )
/* 0xb00000 -> 0x20c0e0.b ($40e0,A5) */
PORT_START("DSWA")
PORT_DIPNAME( 0x01, 0x00, "Print Results" )
diff --git a/src/mame/drivers/ttchamp.c b/src/mame/drivers/ttchamp.c
index e0e35c9e324..793240a13be 100644
--- a/src/mame/drivers/ttchamp.c
+++ b/src/mame/drivers/ttchamp.c
@@ -54,7 +54,7 @@ static VIDEO_UPDATE(ttchamp)
{
int y,x,count;
// int i;
- static int xxx=320,yyy=204;
+ static const int xxx=320,yyy=204;
fillbitmap(bitmap, get_black_pen(screen->machine), 0);
diff --git a/src/mame/drivers/twins.c b/src/mame/drivers/twins.c
index c1a296a24c9..3c45f60da50 100644
--- a/src/mame/drivers/twins.c
+++ b/src/mame/drivers/twins.c
@@ -100,7 +100,7 @@ static VIDEO_UPDATE(twins)
{
int y,x,count;
int i;
- static int xxx=320,yyy=204;
+ static const int xxx=320,yyy=204;
fillbitmap(bitmap, get_black_pen(screen->machine), 0);
@@ -205,7 +205,7 @@ static VIDEO_UPDATE(twinsa)
{
int y,x,count;
int i;
- static int xxx=320,yyy=204;
+ static const int xxx=320,yyy=204;
fillbitmap(bitmap, get_black_pen(screen->machine), 0);
diff --git a/src/mame/drivers/videopkr.c b/src/mame/drivers/videopkr.c
index ecc5a4809e3..e53b2c54491 100644
--- a/src/mame/drivers/videopkr.c
+++ b/src/mame/drivers/videopkr.c
@@ -288,8 +288,8 @@ static UINT8 dc_40103;
static UINT8 te_40103;
static UINT8 ld_40103;
-UINT8 ant_jckp, jckp, ant_cio, c_io, hp_1, hp_2, bell, aux3, dvrt;
-unsigned long count0, count1, count2, count3, count4;
+static UINT8 ant_jckp, jckp, ant_cio, c_io, hp_1, hp_2, bell, aux3, dvrt;
+static unsigned long count0, count1, count2, count3, count4;
/* Baby vars */
static UINT8 sbp0, sbp2, sbp3;
@@ -302,7 +302,7 @@ static UINT8 sbp0, sbp2, sbp3;
static tilemap *bg_tilemap;
/* BCD to Seven Segment Decoder */
-UINT8 dec_7seg(int data)
+static UINT8 dec_7seg(int data)
{
UINT8 segment;
switch (data)
@@ -324,7 +324,7 @@ UINT8 dec_7seg(int data)
}
/* Display a seven digit counter on layout - Index points to less significant digit*/
-void count_7dig(unsigned long data, UINT8 index)
+static void count_7dig(unsigned long data, UINT8 index)
{
UINT8 i;
char strn[7];
@@ -336,7 +336,7 @@ void count_7dig(unsigned long data, UINT8 index)
}
}
-PALETTE_INIT( videopkr )
+static PALETTE_INIT( videopkr )
{
int j;
@@ -362,7 +362,7 @@ PALETTE_INIT( videopkr )
}
}
-PALETTE_INIT( babypkr )
+static PALETTE_INIT( babypkr )
{
int j;
@@ -402,18 +402,18 @@ static TILE_GET_INFO( get_bg_tile_info )
}
-VIDEO_START( videopkr )
+static VIDEO_START( videopkr )
{
bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
-VIDEO_START( vidadcba )
+static VIDEO_START( vidadcba )
{
bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_rows, 16, 8, 32, 32);
}
-VIDEO_UPDATE( videopkr )
+static VIDEO_UPDATE( videopkr )
{
tilemap_mark_all_tiles_dirty(bg_tilemap);
tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
diff --git a/src/mame/includes/bzone.h b/src/mame/includes/bzone.h
index a937024a574..b95c72fbfe5 100644
--- a/src/mame/includes/bzone.h
+++ b/src/mame/includes/bzone.h
@@ -10,7 +10,6 @@
/*----------- defined in drivers/bzone.c -----------*/
extern UINT8 rb_input_select;
-READ8_HANDLER( bzone_IN0_r );
/*----------- defined in audio/bzone.c -----------*/
diff --git a/src/mame/includes/cave.h b/src/mame/includes/cave.h
index cebdcf38ddc..ee15a14033a 100644
--- a/src/mame/includes/cave.h
+++ b/src/mame/includes/cave.h
@@ -6,6 +6,8 @@
/*----------- defined in video/cave.c -----------*/
+extern UINT16 *cave_spriteram16_2;
+
extern int cave_spritetype;
extern int cave_kludge;
diff --git a/src/mame/includes/cchasm.h b/src/mame/includes/cchasm.h
index 14b2fb88d28..1c43b16e74b 100644
--- a/src/mame/includes/cchasm.h
+++ b/src/mame/includes/cchasm.h
@@ -5,6 +5,7 @@
*************************************************************************/
#include "sound/custom.h"
+#include "machine/z80ctc.h"
/*----------- defined in machine/cchasm.c -----------*/
@@ -12,6 +13,8 @@ WRITE16_HANDLER( cchasm_led_w );
/*----------- defined in audio/cchasm.c -----------*/
+extern z80ctc_interface cchasm_ctc_intf;
+
READ8_HANDLER( cchasm_snd_io_r );
WRITE8_HANDLER( cchasm_snd_io_w );
diff --git a/src/mame/includes/cps1.h b/src/mame/includes/cps1.h
index 79154d150be..2d2f7d96601 100644
--- a/src/mame/includes/cps1.h
+++ b/src/mame/includes/cps1.h
@@ -14,9 +14,6 @@ WRITE16_HANDLER( cps1_eeprom_port_w );
INTERRUPT_GEN( cps1_qsound_interrupt );
READ16_HANDLER( cps1_dsw_r );
-READ16_HANDLER( cps1_in1_r );
-READ16_HANDLER( cps1_in2_r );
-READ16_HANDLER( cps1_in3_r );
WRITE16_HANDLER( cps1_coinctrl_w );
INTERRUPT_GEN( cps1_interrupt );
diff --git a/src/mame/includes/galaxold.h b/src/mame/includes/galaxold.h
index 1e0b6c5c6d5..50dfda3d0e0 100644
--- a/src/mame/includes/galaxold.h
+++ b/src/mame/includes/galaxold.h
@@ -105,16 +105,13 @@ DRIVER_INIT( pisces );
DRIVER_INIT( checkmaj );
DRIVER_INIT( dingo );
DRIVER_INIT( dingoe );
-DRIVER_INIT( kingball );
DRIVER_INIT( mooncrsu );
DRIVER_INIT( mooncrst );
DRIVER_INIT( mooncrgx );
DRIVER_INIT( moonqsr );
DRIVER_INIT( checkman );
-DRIVER_INIT( azurian );
DRIVER_INIT( 4in1 );
DRIVER_INIT( ladybugg );
-DRIVER_INIT( gmgalax );
WRITE8_HANDLER( galaxold_nmi_enable_w );
@@ -131,17 +128,12 @@ WRITE8_HANDLER( galaxold_leds_w );
READ8_HANDLER( scramblb_protection_1_r );
READ8_HANDLER( scramblb_protection_2_r );
-WRITE8_HANDLER( kingball_speech_dip_w );
-WRITE8_HANDLER( kingball_sound1_w );
-WRITE8_HANDLER( kingball_sound2_w );
-
WRITE8_HANDLER( _4in1_bank_w );
CUSTOM_INPUT( _4in1_fake_port_r );
WRITE8_HANDLER( zigzag_sillyprotection_w );
INTERRUPT_GEN( hunchbks_vh_interrupt );
-INTERRUPT_GEN( gmgalax_vh_interrupt );
/*----------- defined in machine/scramble.c -----------*/
@@ -175,7 +167,6 @@ DRIVER_INIT( anteater );
DRIVER_INIT( rescue );
DRIVER_INIT( minefld );
DRIVER_INIT( losttomb );
-DRIVER_INIT( superbon );
DRIVER_INIT( hustler );
DRIVER_INIT( billiard );
DRIVER_INIT( mrkougar );
diff --git a/src/mame/includes/gottlieb.h b/src/mame/includes/gottlieb.h
index 7e79bfa67ac..4c69c3e8a5e 100644
--- a/src/mame/includes/gottlieb.h
+++ b/src/mame/includes/gottlieb.h
@@ -29,7 +29,6 @@ INPUT_PORTS_EXTERN( gottlieb2_sound );
extern UINT8 gottlieb_gfxcharlo;
extern UINT8 gottlieb_gfxcharhi;
extern UINT8 *gottlieb_charram;
-extern UINT8 *gottlieb_riot_regs;
extern WRITE8_HANDLER( gottlieb_videoram_w );
extern WRITE8_HANDLER( gottlieb_charram_w );
diff --git a/src/mame/includes/snes.h b/src/mame/includes/snes.h
index b1dfe98cd90..821658f9915 100644
--- a/src/mame/includes/snes.h
+++ b/src/mame/includes/snes.h
@@ -394,7 +394,6 @@ extern READ8_HANDLER( snes_r_bank6 );
extern READ8_HANDLER( snes_r_bank7 );
extern WRITE8_HANDLER( snes_w_bank1 );
extern WRITE8_HANDLER( snes_w_bank2 );
-extern WRITE8_HANDLER( snes_w_bank3 );
extern WRITE8_HANDLER( snes_w_bank4 );
extern WRITE8_HANDLER( snes_w_bank5 );
extern WRITE8_HANDLER( snes_w_bank6 );
diff --git a/src/mame/includes/snk.h b/src/mame/includes/snk.h
index 2c6efa7f6c0..5d43ef36e9c 100644
--- a/src/mame/includes/snk.h
+++ b/src/mame/includes/snk.h
@@ -6,8 +6,6 @@
/*----------- defined in drivers/snk.c -----------*/
-extern UINT8 *snk_rambase;
-
extern READ8_HANDLER ( snk_cpuA_nmi_trigger_r );
extern WRITE8_HANDLER( snk_cpuA_nmi_ack_w );
@@ -20,7 +18,6 @@ extern WRITE8_HANDLER( snk_cpuB_nmi_ack_w );
extern PALETTE_INIT( tnk3 );
extern VIDEO_START( marvins );
-extern VIDEO_START( madcrash );
extern VIDEO_START( jcross );
extern VIDEO_START( sgladiat );
extern VIDEO_START( hal21 );
diff --git a/src/mame/includes/starwars.h b/src/mame/includes/starwars.h
index d854ecba370..463bff3f0ee 100644
--- a/src/mame/includes/starwars.h
+++ b/src/mame/includes/starwars.h
@@ -47,7 +47,4 @@ WRITE8_HANDLER( starwars_main_wr_w );
WRITE8_HANDLER( starwars_soundrst_w );
READ8_HANDLER( starwars_sin_r );
-READ8_HANDLER( starwars_m6532_r );
-
WRITE8_HANDLER( starwars_sout_w );
-WRITE8_HANDLER( starwars_m6532_w );
diff --git a/src/mame/includes/stv.h b/src/mame/includes/stv.h
index 9c23abb0b66..8e0d915a462 100644
--- a/src/mame/includes/stv.h
+++ b/src/mame/includes/stv.h
@@ -14,10 +14,8 @@ DRIVER_INIT ( stv );
/*----------- defined in drivers/stvinit.c -----------*/
-DRIVER_INIT( ic13 );
NVRAM_HANDLER( stv );
void install_stvbios_speedups(running_machine *machine);
-DRIVER_INIT(bakubaku);
DRIVER_INIT(mausuke);
DRIVER_INIT(puyosun);
DRIVER_INIT(shienryu);
diff --git a/src/mame/includes/tx1.h b/src/mame/includes/tx1.h
index a3f3258855e..567f86bf15a 100644
--- a/src/mame/includes/tx1.h
+++ b/src/mame/includes/tx1.h
@@ -74,7 +74,6 @@ extern UINT16 *tx1_objram;
extern UINT16 *tx1_rcram;
extern size_t tx1_objram_size;
PALETTE_INIT( tx1 );
-WRITE16_HANDLER( tx1_vram_w );
VIDEO_START( tx1 );
VIDEO_UPDATE( tx1 );
VIDEO_EOF( tx1 );
@@ -89,15 +88,12 @@ extern UINT16 *buggyboy_rcram;
extern UINT16 *buggyboy_vram;
extern size_t buggyboy_objram_size;
extern size_t buggyboy_rcram_size;
-PALETTE_INIT( buggybjr );
PALETTE_INIT( buggyboy );
-WRITE16_HANDLER( buggyboy_vram_w );
VIDEO_START( buggyboy );
VIDEO_UPDATE( buggyboy );
VIDEO_EOF( buggyboy );
extern UINT16 *buggybjr_vram;
-WRITE16_HANDLER( buggybjr_vram_w );
VIDEO_START( buggybjr );
VIDEO_UPDATE( buggybjr );
WRITE16_HANDLER( buggyboy_slincs_w );
diff --git a/src/mame/machine/asic65.c b/src/mame/machine/asic65.c
index 8ad12f4e3f0..6db88a92fa3 100644
--- a/src/mame/machine/asic65.c
+++ b/src/mame/machine/asic65.c
@@ -19,25 +19,28 @@
*
*************************************/
-static UINT8 asic65_type;
-static int asic65_command;
-static UINT16 asic65_param[32];
-static UINT16 asic65_yorigin = 0x1800;
-static UINT8 asic65_param_index;
-static UINT8 asic65_result_index;
-static UINT8 asic65_reset_state;
-static UINT8 asic65_last_bank;
-
-/* ROM-based interface states */
-static UINT8 asic65_cpunum;
-static UINT8 asic65_tfull;
-static UINT8 asic65_68full;
-static UINT8 asic65_cmd;
-static UINT8 asic65_xflg;
-static UINT16 asic65_68data;
-static UINT16 asic65_tdata;
-
-static FILE * asic65_log;
+static struct _asic65_t
+{
+ UINT8 type;
+ int command;
+ UINT16 param[32];
+ UINT16 yorigin;
+ UINT8 param_index;
+ UINT8 result_index;
+ UINT8 reset_state;
+ UINT8 last_bank;
+
+ /* ROM-based interface states */
+ UINT8 cpunum;
+ UINT8 tfull;
+ UINT8 _68full;
+ UINT8 cmd;
+ UINT8 xflg;
+ UINT16 _68data;
+ UINT16 tdata;
+
+ FILE * log;
+} asic65;
WRITE16_HANDLER( asic65_w );
WRITE16_HANDLER( asic65_data_w );
@@ -125,9 +128,11 @@ static const UINT8 command_map[3][MAX_COMMANDS] =
void asic65_config(running_machine *machine, int asictype)
{
- asic65_type = asictype;
- if (asic65_type == ASIC65_ROMBASED)
- asic65_cpunum = mame_find_cpu_index(machine, "asic65");
+ memset(&asic65, 0, sizeof(asic65));
+ asic65.type = asictype;
+ asic65.yorigin = 0x1800;
+ if (asic65.type == ASIC65_ROMBASED)
+ asic65.cpunum = mame_find_cpu_index(machine, "asic65");
}
@@ -141,8 +146,8 @@ void asic65_config(running_machine *machine, int asictype)
void asic65_reset(running_machine *machine, int state)
{
/* rom-based means reset and clear states */
- if (asic65_type == ASIC65_ROMBASED)
- cpunum_set_input_line(machine, asic65_cpunum, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
+ if (asic65.type == ASIC65_ROMBASED)
+ cpunum_set_input_line(machine, asic65.cpunum, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
/* otherwise, do it manually */
else
@@ -150,18 +155,18 @@ void asic65_reset(running_machine *machine, int state)
cpunum_suspend(mame_find_cpu_index(machine, "asic65"), SUSPEND_REASON_DISABLE, 1);
/* if reset is being signalled, clear everything */
- if (state && !asic65_reset_state)
- asic65_command = -1;
+ if (state && !asic65.reset_state)
+ asic65.command = -1;
/* if reset is going high, latch the command */
- else if (!state && asic65_reset_state)
+ else if (!state && asic65.reset_state)
{
- if (asic65_command != -1)
- asic65_data_w(machine, 1, asic65_command, 0xffff);
+ if (asic65.command != -1)
+ asic65_data_w(machine, 1, asic65.command, 0xffff);
}
/* update the state */
- asic65_reset_state = state;
+ asic65.reset_state = state;
}
}
@@ -175,20 +180,20 @@ void asic65_reset(running_machine *machine, int state)
static TIMER_CALLBACK( m68k_asic65_deferred_w )
{
- asic65_tfull = 1;
- asic65_cmd = param >> 16;
- asic65_tdata = param;
- cpunum_set_input_line(machine, asic65_cpunum, 0, ASSERT_LINE);
+ asic65.tfull = 1;
+ asic65.cmd = param >> 16;
+ asic65.tdata = param;
+ cpunum_set_input_line(machine, asic65.cpunum, 0, ASSERT_LINE);
}
WRITE16_HANDLER( asic65_data_w )
{
/* logging */
- if (LOG_ASIC && !asic65_log) asic65_log = fopen("asic65.log", "w");
+ if (LOG_ASIC && !asic65.log) asic65.log = fopen("asic65.log", "w");
/* rom-based use a deferred write mechanism */
- if (asic65_type == ASIC65_ROMBASED)
+ if (asic65.type == ASIC65_ROMBASED)
{
timer_call_after_resynch(NULL, data | (offset << 16), m68k_asic65_deferred_w);
cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(20));
@@ -198,51 +203,51 @@ WRITE16_HANDLER( asic65_data_w )
/* parameters go to offset 0 */
if (!(offset & 1))
{
- if (asic65_log) fprintf(asic65_log, " W=%04X", data);
+ if (asic65.log) fprintf(asic65.log, " W=%04X", data);
/* add to the parameter list, but don't overflow */
- asic65_param[asic65_param_index++] = data;
- if (asic65_param_index >= 32)
- asic65_param_index = 32;
+ asic65.param[asic65.param_index++] = data;
+ if (asic65.param_index >= 32)
+ asic65.param_index = 32;
}
/* commands go to offset 2 */
else
{
- int command = (data < MAX_COMMANDS) ? command_map[asic65_type][data] : OP_UNKNOWN;
- if (asic65_log) fprintf(asic65_log, "\n(%06X)%c%04X:", activecpu_get_previouspc(), (command == OP_UNKNOWN) ? '*' : ' ', data);
+ int command = (data < MAX_COMMANDS) ? command_map[asic65.type][data] : OP_UNKNOWN;
+ if (asic65.log) fprintf(asic65.log, "\n(%06X)%c%04X:", activecpu_get_previouspc(), (command == OP_UNKNOWN) ? '*' : ' ', data);
/* set the command number and reset the parameter/result indices */
- asic65_command = data;
- asic65_result_index = asic65_param_index = 0;
+ asic65.command = data;
+ asic65.result_index = asic65.param_index = 0;
}
}
READ16_HANDLER( asic65_r )
{
- int command = (asic65_command < MAX_COMMANDS) ? command_map[asic65_type][asic65_command] : OP_UNKNOWN;
+ int command = (asic65.command < MAX_COMMANDS) ? command_map[asic65.type][asic65.command] : OP_UNKNOWN;
INT64 element, result64 = 0;
UINT16 result = 0;
/* rom-based just returns latched data */
- if (asic65_type == ASIC65_ROMBASED)
+ if (asic65.type == ASIC65_ROMBASED)
{
- asic65_68full = 0;
+ asic65._68full = 0;
cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(5));
- return asic65_68data;
+ return asic65._68data;
}
/* update results */
switch (command)
{
case OP_UNKNOWN: /* return bogus data */
- popmessage("ASIC65: Unknown cmd %02X", asic65_command);
+ popmessage("ASIC65: Unknown cmd %02X", asic65.command);
break;
case OP_REFLECT: /* reflect data */
- if (asic65_param_index >= 1)
- result = asic65_param[--asic65_param_index];
+ if (asic65.param_index >= 1)
+ result = asic65.param[--asic65.param_index];
break;
case OP_CHECKSUM: /* compute checksum (should be XX27) */
@@ -258,24 +263,24 @@ READ16_HANDLER( asic65_r )
break;
case OP_RESET: /* reset */
- asic65_result_index = asic65_param_index = 0;
+ asic65.result_index = asic65.param_index = 0;
break;
case OP_SIN: /* sin */
- if (asic65_param_index >= 1)
- result = (int)(16384. * sin(M_PI * (double)(INT16)asic65_param[0] / 32768.));
+ if (asic65.param_index >= 1)
+ result = (int)(16384. * sin(M_PI * (double)(INT16)asic65.param[0] / 32768.));
break;
case OP_COS: /* cos */
- if (asic65_param_index >= 1)
- result = (int)(16384. * cos(M_PI * (double)(INT16)asic65_param[0] / 32768.));
+ if (asic65.param_index >= 1)
+ result = (int)(16384. * cos(M_PI * (double)(INT16)asic65.param[0] / 32768.));
break;
case OP_ATAN: /* vector angle */
- if (asic65_param_index >= 4)
+ if (asic65.param_index >= 4)
{
- INT32 xint = (INT32)((asic65_param[0] << 16) | asic65_param[1]);
- INT32 yint = (INT32)((asic65_param[2] << 16) | asic65_param[3]);
+ INT32 xint = (INT32)((asic65.param[0] << 16) | asic65.param[1]);
+ INT32 yint = (INT32)((asic65.param[2] << 16) | asic65.param[3]);
double a = atan2((double)yint, (double)xint);
result = (INT16)(a * 32768. / M_PI);
}
@@ -284,84 +289,84 @@ READ16_HANDLER( asic65_r )
case OP_TMATRIXMULT: /* matrix multiply by transpose */
/* if this is wrong, the labels on the car selection screen */
/* in Race Drivin' will be off */
- if (asic65_param_index >= 9+6)
+ if (asic65.param_index >= 9+6)
{
- INT32 v0 = (INT32)((asic65_param[9] << 16) | asic65_param[10]);
- INT32 v1 = (INT32)((asic65_param[11] << 16) | asic65_param[12]);
- INT32 v2 = (INT32)((asic65_param[13] << 16) | asic65_param[14]);
+ INT32 v0 = (INT32)((asic65.param[9] << 16) | asic65.param[10]);
+ INT32 v1 = (INT32)((asic65.param[11] << 16) | asic65.param[12]);
+ INT32 v2 = (INT32)((asic65.param[13] << 16) | asic65.param[14]);
/* 2 results per element */
- switch (asic65_result_index / 2)
+ switch (asic65.result_index / 2)
{
case 0:
- result64 = (INT64)v0 * (INT16)asic65_param[0] +
- (INT64)v1 * (INT16)asic65_param[3] +
- (INT64)v2 * (INT16)asic65_param[6];
+ result64 = (INT64)v0 * (INT16)asic65.param[0] +
+ (INT64)v1 * (INT16)asic65.param[3] +
+ (INT64)v2 * (INT16)asic65.param[6];
break;
case 1:
- result64 = (INT64)v0 * (INT16)asic65_param[1] +
- (INT64)v1 * (INT16)asic65_param[4] +
- (INT64)v2 * (INT16)asic65_param[7];
+ result64 = (INT64)v0 * (INT16)asic65.param[1] +
+ (INT64)v1 * (INT16)asic65.param[4] +
+ (INT64)v2 * (INT16)asic65.param[7];
break;
case 2:
- result64 = (INT64)v0 * (INT16)asic65_param[2] +
- (INT64)v1 * (INT16)asic65_param[5] +
- (INT64)v2 * (INT16)asic65_param[8];
+ result64 = (INT64)v0 * (INT16)asic65.param[2] +
+ (INT64)v1 * (INT16)asic65.param[5] +
+ (INT64)v2 * (INT16)asic65.param[8];
break;
}
/* remove lower 14 bits and pass back either upper or lower words */
result64 >>= 14;
- result = (asic65_result_index & 1) ? (result64 & 0xffff) : ((result64 >> 16) & 0xffff);
- asic65_result_index++;
+ result = (asic65.result_index & 1) ? (result64 & 0xffff) : ((result64 >> 16) & 0xffff);
+ asic65.result_index++;
}
break;
case OP_MATRIXMULT: /* matrix multiply???? */
- if (asic65_param_index >= 9+6)
+ if (asic65.param_index >= 9+6)
{
- INT32 v0 = (INT32)((asic65_param[9] << 16) | asic65_param[10]);
- INT32 v1 = (INT32)((asic65_param[11] << 16) | asic65_param[12]);
- INT32 v2 = (INT32)((asic65_param[13] << 16) | asic65_param[14]);
+ INT32 v0 = (INT32)((asic65.param[9] << 16) | asic65.param[10]);
+ INT32 v1 = (INT32)((asic65.param[11] << 16) | asic65.param[12]);
+ INT32 v2 = (INT32)((asic65.param[13] << 16) | asic65.param[14]);
/* 2 results per element */
- switch (asic65_result_index / 2)
+ switch (asic65.result_index / 2)
{
case 0:
- result64 = (INT64)v0 * (INT16)asic65_param[0] +
- (INT64)v1 * (INT16)asic65_param[1] +
- (INT64)v2 * (INT16)asic65_param[2];
+ result64 = (INT64)v0 * (INT16)asic65.param[0] +
+ (INT64)v1 * (INT16)asic65.param[1] +
+ (INT64)v2 * (INT16)asic65.param[2];
break;
case 1:
- result64 = (INT64)v0 * (INT16)asic65_param[3] +
- (INT64)v1 * (INT16)asic65_param[4] +
- (INT64)v2 * (INT16)asic65_param[5];
+ result64 = (INT64)v0 * (INT16)asic65.param[3] +
+ (INT64)v1 * (INT16)asic65.param[4] +
+ (INT64)v2 * (INT16)asic65.param[5];
break;
case 2:
- result64 = (INT64)v0 * (INT16)asic65_param[6] +
- (INT64)v1 * (INT16)asic65_param[7] +
- (INT64)v2 * (INT16)asic65_param[8];
+ result64 = (INT64)v0 * (INT16)asic65.param[6] +
+ (INT64)v1 * (INT16)asic65.param[7] +
+ (INT64)v2 * (INT16)asic65.param[8];
break;
}
/* remove lower 14 bits and pass back either upper or lower words */
result64 >>= 14;
- result = (asic65_result_index & 1) ? (result64 & 0xffff) : ((result64 >> 16) & 0xffff);
- asic65_result_index++;
+ result = (asic65.result_index & 1) ? (result64 & 0xffff) : ((result64 >> 16) & 0xffff);
+ asic65.result_index++;
}
break;
case OP_YORIGIN:
- if (asic65_param_index >= 1)
- asic65_yorigin = asic65_param[asic65_param_index - 1];
+ if (asic65.param_index >= 1)
+ asic65.yorigin = asic65.param[asic65.param_index - 1];
break;
case OP_TRANSFORM: /* 3d transform */
- if (asic65_param_index >= 2)
+ if (asic65.param_index >= 2)
{
/* param 0 == 1/z */
/* param 1 == height */
@@ -370,29 +375,29 @@ READ16_HANDLER( asic65_r )
/* return 0 == scale factor for 1/z */
/* return 1 == transformed X */
/* return 2 == transformed Y, taking height into account */
- element = (INT16)asic65_param[0];
- if (asic65_param_index == 2)
+ element = (INT16)asic65.param[0];
+ if (asic65.param_index == 2)
{
- result64 = (element * (INT16)asic65_param[1]) >> 8;
+ result64 = (element * (INT16)asic65.param[1]) >> 8;
result64 -= 1;
if (result64 > 0x3fff) result64 = 0;
}
- else if (asic65_param_index == 3)
+ else if (asic65.param_index == 3)
{
- result64 = (element * (INT16)asic65_param[2]) >> 15;
+ result64 = (element * (INT16)asic65.param[2]) >> 15;
result64 += 0xa8;
}
- else if (asic65_param_index == 4)
+ else if (asic65.param_index == 4)
{
- result64 = (INT16)((element * (INT16)asic65_param[3]) >> 10);
- result64 = (INT16)asic65_yorigin - result64 - (result64 << 1);
+ result64 = (INT16)((element * (INT16)asic65.param[3]) >> 10);
+ result64 = (INT16)asic65.yorigin - result64 - (result64 << 1);
}
result = result64 & 0xffff;
}
break;
case OP_INITBANKS: /* initialize banking */
- asic65_last_bank = 0;
+ asic65.last_bank = 0;
break;
case OP_SETBANK: /* set a bank */
@@ -411,12 +416,12 @@ READ16_HANDLER( asic65_r )
{ 0x77f0,0x77fe,0x77f2,0x77fc,0x77f4,0x77fa,0x77f6,0x77f8 },
{ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 },
};
- if (asic65_param_index >= 1)
+ if (asic65.param_index >= 1)
{
- if (asic65_param_index < sizeof(banklist) && banklist[asic65_param[0]] < 4)
- asic65_last_bank = banklist[asic65_param[0]];
- result = bankaddr[asic65_last_bank][(asic65_result_index < 8) ? asic65_result_index : 7];
- asic65_result_index++;
+ if (asic65.param_index < sizeof(banklist) && banklist[asic65.param[0]] < 4)
+ asic65.last_bank = banklist[asic65.param[0]];
+ result = bankaddr[asic65.last_bank][(asic65.result_index < 8) ? asic65.result_index : 7];
+ asic65.result_index++;
}
break;
}
@@ -427,13 +432,13 @@ READ16_HANDLER( asic65_r )
{
0x0eb2,0x1000,0x171b,0x3d28
};
- result = bankverify[asic65_last_bank];
+ result = bankverify[asic65.last_bank];
break;
}
}
- if (LOG_ASIC && !asic65_log) asic65_log = fopen("asic65.log", "w");
- if (asic65_log) fprintf(asic65_log, " (R=%04X)", result);
+ if (LOG_ASIC && !asic65.log) asic65.log = fopen("asic65.log", "w");
+ if (asic65.log) fprintf(asic65.log, " (R=%04X)", result);
return result;
}
@@ -441,14 +446,14 @@ READ16_HANDLER( asic65_r )
READ16_HANDLER( asic65_io_r )
{
- if (asic65_type == ASIC65_ROMBASED)
+ if (asic65.type == ASIC65_ROMBASED)
{
/* bit 15 = TFULL */
/* bit 14 = 68FULL */
/* bit 13 = XFLG */
/* bit 12 = controlled by jumper */
cpu_boost_interleave(attotime_zero, ATTOTIME_IN_USEC(5));
- return (asic65_tfull << 15) | (asic65_68full << 14) | (asic65_xflg << 13) | 0x0000;
+ return (asic65.tfull << 15) | (asic65._68full << 14) | (asic65.xflg << 13) | 0x0000;
}
else
{
@@ -467,22 +472,22 @@ READ16_HANDLER( asic65_io_r )
static WRITE16_HANDLER( asic65_68k_w )
{
- asic65_68full = 1;
- asic65_68data = data;
+ asic65._68full = 1;
+ asic65._68data = data;
}
static READ16_HANDLER( asic65_68k_r )
{
- asic65_tfull = 0;
- cpunum_set_input_line(machine, asic65_cpunum, 0, CLEAR_LINE);
- return asic65_tdata;
+ asic65.tfull = 0;
+ cpunum_set_input_line(machine, asic65.cpunum, 0, CLEAR_LINE);
+ return asic65.tdata;
}
static WRITE16_HANDLER( asic65_stat_w )
{
- asic65_xflg = data & 1;
+ asic65.xflg = data & 1;
}
@@ -492,15 +497,15 @@ static READ16_HANDLER( asic65_stat_r )
/* bit 14 = TFULL */
/* bit 13 = CMD */
/* bit 12 = controlled by jumper (0 = test?) */
- return (asic65_68full << 15) | (asic65_tfull << 14) | (asic65_cmd << 13) | 0x1000;
+ return (asic65._68full << 15) | (asic65.tfull << 14) | (asic65.cmd << 13) | 0x1000;
}
static READ16_HANDLER( asci65_get_bio )
{
- if (!asic65_tfull)
+ if (!asic65.tfull)
cpu_spinuntil_int();
- return asic65_tfull ? CLEAR_LINE : ASSERT_LINE;
+ return asic65.tfull ? CLEAR_LINE : ASSERT_LINE;
}
diff --git a/src/mame/machine/namcos2.c b/src/mame/machine/namcos2.c
index 47e291048f6..637d5f8bfda 100644
--- a/src/mame/machine/namcos2.c
+++ b/src/mame/machine/namcos2.c
@@ -19,6 +19,12 @@ extern void namcos21_kickstart(running_machine *, int);
int namcos2_gametype;
static unsigned mFinalLapProtCount;
+static int namcos2_mcu_analog_ctrl;
+static int namcos2_mcu_analog_data;
+static int namcos2_mcu_analog_complete;
+static UINT8 *namcos2_eeprom;
+static int sendval;
+
READ16_HANDLER( namcos2_flap_prot_r )
{
@@ -69,7 +75,6 @@ READ16_HANDLER( namcos2_flap_prot_r )
/*************************************************************/
#define namcos2_eeprom_size 0x2000
-static UINT8 *namcos2_eeprom;
static void
ResetAllSubCPUs( running_machine *machine, int state )
@@ -102,6 +107,10 @@ MACHINE_RESET( namcos2 )
{
int loop;
mFinalLapProtCount = 0;
+ namcos2_mcu_analog_ctrl=0;
+ namcos2_mcu_analog_data=0xaa;
+ namcos2_mcu_analog_complete=0;
+ sendval = 0;
/* Initialise the bank select in the sound CPU */
namcos2_sound_bankselect_w(machine,0,0); /* Page in bank 0 */
@@ -238,7 +247,7 @@ sws92g 1992 332 $014c
suzuk8h2 1993
sws93 1993 334 $014e
*************************************************************/
-static int sendval = 0;
+
READ16_HANDLER( namcos2_68k_key_r )
{
switch (namcos2_gametype)
@@ -724,10 +733,6 @@ WRITE8_HANDLER( namcos2_sound_bankselect_w )
/* */
/**************************************************************/
-static int namcos2_mcu_analog_ctrl=0;
-static int namcos2_mcu_analog_data=0xaa;
-static int namcos2_mcu_analog_complete=0;
-
WRITE8_HANDLER( namcos2_mcu_analog_ctrl_w )
{
namcos2_mcu_analog_ctrl = data & 0xff;
diff --git a/src/mame/machine/neocrypt.c b/src/mame/machine/neocrypt.c
index d6316f2c47a..b6b661fc17b 100644
--- a/src/mame/machine/neocrypt.c
+++ b/src/mame/machine/neocrypt.c
@@ -850,7 +850,7 @@ static UINT16 generate_cs16(UINT8 *rom, int size)
}
-int m1_address_scramble(int address, UINT16 key)
+static int m1_address_scramble(int address, UINT16 key)
{
int block;
int aux;
diff --git a/src/mame/machine/playch10.c b/src/mame/machine/playch10.c
index 9b6f67a23bf..047b3c42f29 100644
--- a/src/mame/machine/playch10.c
+++ b/src/mame/machine/playch10.c
@@ -664,7 +664,7 @@ static int gboard_scanline_counter;
static int gboard_scanline_latch;
static int gboard_banks[2];
static int gboard_4screen;
-static int gboard_last_bank = 0xff;
+static int gboard_last_bank;
static int gboard_command;
static void gboard_scanline_cb( int num, int scanline, int vblank, int blanked )
@@ -946,6 +946,8 @@ DRIVER_INIT( pchboard )
gboard_banks[1] = 0x1f;
gboard_scanline_counter = 0;
gboard_scanline_latch = 0;
+ gboard_last_bank = 0xff;
+ gboard_command = 0;
/* common init */
DRIVER_INIT_CALL(playch10);
diff --git a/src/mame/video/cischeat.c b/src/mame/video/cischeat.c
index 1abff20d1a0..613ce294a6b 100644
--- a/src/mame/video/cischeat.c
+++ b/src/mame/video/cischeat.c
@@ -59,6 +59,7 @@ Note: if MAME_DEBUG is defined, pressing Z or X with:
/* Variables only used here: */
static int cischeat_ip_select;
+static int shift_ret = 1;
#ifdef MAME_DEBUG
static int debugsprites; // For debug purposes
@@ -141,6 +142,7 @@ static void prepare_shadows(void)
/* 32 colour codes for the tiles */
VIDEO_START( cischeat )
{
+ shift_ret = 1;
VIDEO_START_CALL(megasys1);
megasys1_bits_per_color_code = 5;
@@ -184,13 +186,12 @@ VIDEO_START( bigrun )
CUSTOM_INPUT( cischeat_shift_r )
{
- static int ret = 1; /* start with low shift */
switch ( (input_port_read(field->port->machine, "FAKE") >> 2) & 3 )
{
- case 1 : ret = 1; break; // low shift: button 3
- case 2 : ret = 0; break; // high shift: button 4
+ case 1 : shift_ret = 1; break; // low shift: button 3
+ case 2 : shift_ret = 0; break; // high shift: button 4
}
- return ret;
+ return shift_ret;
}
/*
diff --git a/src/mame/video/popeye.c b/src/mame/video/popeye.c
index 59badb4679a..937e6d4f431 100644
--- a/src/mame/video/popeye.c
+++ b/src/mame/video/popeye.c
@@ -11,15 +11,13 @@
UINT8 *popeye_background_pos;
UINT8 *popeye_palettebank;
static UINT8 *popeye_bitmapram;
-static size_t popeye_bitmapram_size = 0x2000;
+static const size_t popeye_bitmapram_size = 0x2000;
static bitmap_t *tmpbitmap2;
static int invertmask;
static int bitmap_type;
enum { TYPE_SKYSKIPR, TYPE_POPEYE };
-#define BGRAM_SIZE 0x2000
-
static tilemap *fg_tilemap;
diff --git a/src/mame/video/segag80r.c b/src/mame/video/segag80r.c
index ff43f8dd7b4..33f97585b34 100644
--- a/src/mame/video/segag80r.c
+++ b/src/mame/video/segag80r.c
@@ -25,7 +25,7 @@ static UINT16 spaceod_vcounter;
static UINT8 spaceod_fixed_color;
static UINT8 spaceod_bg_control;
static UINT8 spaceod_bg_detect;
-static UINT8 spaceod_bg_detect_tile_color = 1;
+static const UINT8 spaceod_bg_detect_tile_color = 1;
static tilemap *bg_tilemap;
static UINT8 bg_enable;
diff --git a/src/mame/video/silkroad.c b/src/mame/video/silkroad.c
index 3d3cb3bb2cf..e8c2a39b990 100644
--- a/src/mame/video/silkroad.c
+++ b/src/mame/video/silkroad.c
@@ -135,8 +135,12 @@ WRITE32_HANDLER( silkroad_fgram3_w )
+static int enable1, enable2, enable3;
+
VIDEO_START(silkroad)
{
+ enable1 = enable2 = enable3 = 1;
+
fg_tilemap = tilemap_create(get_fg_tile_info,tilemap_scan_rows,16,16,64, 64);
tilemap_set_transparent_pen(fg_tilemap,0);
@@ -147,8 +151,6 @@ VIDEO_START(silkroad)
tilemap_set_transparent_pen(fg3_tilemap,0);
}
-static int enable1=1,enable2=1,enable3=1;
-
VIDEO_UPDATE(silkroad)
{
fillbitmap(bitmap,0x7c0,cliprect);
diff --git a/src/mame/video/tx1.c b/src/mame/video/tx1.c
index fc55b84ee18..8dcce042eb7 100644
--- a/src/mame/video/tx1.c
+++ b/src/mame/video/tx1.c
@@ -75,7 +75,7 @@ enum
TX1_RDFLAG_TNLF,
TX1_RDFLAG_STLF,
TX1_RDFLAG_SCCHGF
-} tx1_roadreg;
+};
static struct
{