diff options
| author | 2009-09-10 08:35:37 +0000 | |
|---|---|---|
| committer | 2009-09-10 08:35:37 +0000 | |
| commit | fa68c11272125a442eff36e6da5cd3b60256b8ef (patch) | |
| tree | 9aa58ff14b5ad7918edc0ed910448425d09a7614 /src | |
| parent | 8eeb0f1d20551ce88e1068b608b05e223ea6130d (diff) | |
> From: Atari Ace [mailto:atari_ace@verizon.net]
> Sent: Monday, September 07, 2009 8:08 PM
> To: submit@mamedev.org
> Cc: atariace@hotmail.com
> Subject: [patch] const/static/include fixes
>
> Hi mamedev,
>
> A result of some code auditing, this patch adds missing static and
> const qualifiers, and fixes up some header files.
>
> ~aa
Diffstat (limited to 'src')
55 files changed, 111 insertions, 226 deletions
diff --git a/src/emu/cpu/dsp32/dsp32dis.c b/src/emu/cpu/dsp32/dsp32dis.c index dca729625a1..2354c380479 100644 --- a/src/emu/cpu/dsp32/dsp32dis.c +++ b/src/emu/cpu/dsp32/dsp32dis.c @@ -196,7 +196,7 @@ static const char *dasm_PI(UINT16 bits, char *buffer) } -unsigned dasm_dsp32(char *buffer, unsigned pc, UINT32 op) +static unsigned dasm_dsp32(char *buffer, unsigned pc, UINT32 op) { UINT32 flags = 0; diff --git a/src/emu/cpu/h83002/h8disasm.c b/src/emu/cpu/h83002/h8disasm.c index d01d35ab4d4..d0c1883c2ad 100644 --- a/src/emu/cpu/h83002/h8disasm.c +++ b/src/emu/cpu/h83002/h8disasm.c @@ -29,7 +29,7 @@ static UINT32 h8disasm_7(UINT32 address, UINT32 opcode, char *output, const UINT #define h8_mem_read16(x) ((oprom[x] << 8) | oprom[(x) + 1]) #define h8_mem_read32(x) ((oprom[x] << 24) | (oprom[(x) + 1] << 16) | (oprom[(x) + 2] << 8) | oprom[(x) + 3]) -offs_t h8_disasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 addr_mask) +static offs_t h8_disasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 addr_mask) { UINT32 size = 0; UINT16 opcode; diff --git a/src/emu/cpu/i4004/i4004.c b/src/emu/cpu/i4004/i4004.c index af76a239b36..2c267ee31b1 100644 --- a/src/emu/cpu/i4004/i4004.c +++ b/src/emu/cpu/i4004/i4004.c @@ -14,7 +14,7 @@ #define LOG(x) do { if (VERBOSE) logerror x; } while (0) -static UINT8 kbp_table[] = { 0x00,0x01,0x02,0x0f,0x03,0x0f,0x0f,0x0f,0x04,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f }; +static const UINT8 kbp_table[] = { 0x00,0x01,0x02,0x0f,0x03,0x0f,0x0f,0x0f,0x04,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f }; /*************************************************************************** TYPE DEFINITIONS diff --git a/src/emu/cpu/i8085/i8085.c b/src/emu/cpu/i8085/i8085.c index ef77031c623..ab004b78f2b 100644 --- a/src/emu/cpu/i8085/i8085.c +++ b/src/emu/cpu/i8085/i8085.c @@ -250,7 +250,7 @@ static const cpu_state_table state_table_template = ***************************************************************************/ /* cycles lookup */ -const UINT8 lut_cycles_8080[256]={ +static const UINT8 lut_cycles_8080[256]={ /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ /* 0 */ 4, 10,7, 5, 5, 5, 7, 4, 4, 10,7, 5, 5, 5, 7, 4, /* 1 */ 4, 10,7, 5, 5, 5, 7, 4, 4, 10,7, 5, 5, 5, 7, 4, @@ -268,7 +268,7 @@ const UINT8 lut_cycles_8080[256]={ /* D */ 5, 10,10,10,11,11,7, 11,5, 10,10,10,11,11,7, 11, /* E */ 5, 10,10,18,11,11,7, 11,5, 5, 10,5, 11,11,7, 11, /* F */ 5, 10,10,4, 11,11,7, 11,5, 5, 10,4, 11,11,7, 11 }; -const UINT8 lut_cycles_8085[256]={ +static const UINT8 lut_cycles_8085[256]={ /* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ /* 0 */ 4, 10,7, 6, 4, 4, 7, 4, 10,10,7, 6, 4, 4, 7, 4, /* 1 */ 7, 10,7, 6, 4, 4, 7, 4, 10,10,7, 6, 4, 4, 7, 4, diff --git a/src/emu/cpu/jaguar/jagdasm.c b/src/emu/cpu/jaguar/jagdasm.c index b06dadd60b9..060a780b1e4 100644 --- a/src/emu/cpu/jaguar/jagdasm.c +++ b/src/emu/cpu/jaguar/jagdasm.c @@ -76,7 +76,7 @@ INLINE char *signed_16bit(INT16 val) return temp; } -unsigned dasmjag(int variant, char *buffer, unsigned pc, const UINT8 *oprom) +static unsigned dasmjag(int variant, char *buffer, unsigned pc, const UINT8 *oprom) { UINT32 flags = 0; int op = ROPCODE(0); diff --git a/src/emu/cpu/mb86233/mb86233d.c b/src/emu/cpu/mb86233/mb86233d.c index c75986105b1..e468eb844e2 100644 --- a/src/emu/cpu/mb86233/mb86233d.c +++ b/src/emu/cpu/mb86233/mb86233d.c @@ -372,7 +372,7 @@ static char * ALU( UINT32 alu) return buf; } -unsigned dasm_mb86233(char *buffer, UINT32 opcode ) +static unsigned dasm_mb86233(char *buffer, UINT32 opcode ) { char *p = buffer; UINT32 grp = ( opcode >> 26 ) & 0x3f; diff --git a/src/emu/cpu/mips/r3kdasm.c b/src/emu/cpu/mips/r3kdasm.c index 171efcc2f5a..c7ce7ea7135 100644 --- a/src/emu/cpu/mips/r3kdasm.c +++ b/src/emu/cpu/mips/r3kdasm.c @@ -232,7 +232,7 @@ static UINT32 dasm_cop1(UINT32 pc, UINT32 op, char *buffer) return flags; } -unsigned dasmr3k(char *buffer, unsigned pc, UINT32 op) +static unsigned dasmr3k(char *buffer, unsigned pc, UINT32 op) { int rs = (op >> 21) & 31; int rt = (op >> 16) & 31; diff --git a/src/emu/cpu/sharc/sharcdsm.c b/src/emu/cpu/sharc/sharcdsm.c index 2049afe2ddd..3cf13223d22 100644 --- a/src/emu/cpu/sharc/sharcdsm.c +++ b/src/emu/cpu/sharc/sharcdsm.c @@ -1152,7 +1152,7 @@ static void build_dasm_table(void) } } -UINT32 sharc_dasm_one(char *buffer, offs_t pc, UINT64 opcode) +static UINT32 sharc_dasm_one(char *buffer, offs_t pc, UINT64 opcode) { #define DEFAULT_DASM_WIDTH (64) diff --git a/src/emu/cpu/ssp1601/ssp1601d.c b/src/emu/cpu/ssp1601/ssp1601d.c index 30b8eebbff4..4563eb7c202 100644 --- a/src/emu/cpu/ssp1601/ssp1601d.c +++ b/src/emu/cpu/ssp1601/ssp1601d.c @@ -78,7 +78,7 @@ static char *get_cond(int op) } -unsigned dasm_ssp1601(char *buffer, unsigned pc, const UINT8 *oprom) +static unsigned dasm_ssp1601(char *buffer, unsigned pc, const UINT8 *oprom) { const UINT8 *base_oprom; UINT16 op; diff --git a/src/emu/cpu/tms0980/tms0980d.c b/src/emu/cpu/tms0980/tms0980d.c index da86411996e..9062d744850 100644 --- a/src/emu/cpu/tms0980/tms0980d.c +++ b/src/emu/cpu/tms0980/tms0980d.c @@ -30,7 +30,7 @@ enum e_addressing { }; -static const char *s_mnemonic[] = { +static const char *const s_mnemonic[] = { "a10aac", "a6aac", "a8aac", "ac1ac", "acacc", "acnaa", "alec", "alem", "amaac", "branch", "call", "ccla", "cla", "clo", "comc", "comx", "comx8", "cpaiz", "ctmdyn", "dan", "dman", "dmea", "dnaa", "dyn", "ia", "imac", "iyc", "kne", "knez", "ldp", "ldx", "ldx", "mnea", "mnez", diff --git a/src/emu/cpu/tms32031/dis32031.c b/src/emu/cpu/tms32031/dis32031.c index d7a7a1c45ea..289536f0b8f 100644 --- a/src/emu/cpu/tms32031/dis32031.c +++ b/src/emu/cpu/tms32031/dis32031.c @@ -373,7 +373,7 @@ static void disasm_parallel_storestore(const char *opstring1, const char *opstri -unsigned dasm_tms32031(char *buffer, unsigned pc, UINT32 op) +static unsigned dasm_tms32031(char *buffer, unsigned pc, UINT32 op) { UINT32 flags = 0; diff --git a/src/emu/cpu/z8/z8dasm.c b/src/emu/cpu/z8/z8dasm.c index f1992a79ff8..3fbfd944d7d 100644 --- a/src/emu/cpu/z8/z8dasm.c +++ b/src/emu/cpu/z8/z8dasm.c @@ -6,7 +6,7 @@ CONSTANTS ***************************************************************************/ -static const char* REGISTER_NAME[256] = +static const char *const REGISTER_NAME[256] = { "P0", "P1", "P2", "P3", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", @@ -26,7 +26,7 @@ static const char* REGISTER_NAME[256] = "SIO", "TMR", "T1", "PRE1", "T0", "PRE0", "P2M", "P3M", "P01M", "IPR", "IRQ", "IMR", "FLAGS", "RP", "SPH", "SPL" }; -static const char* CONDITION_CODE[16] = +static const char *const CONDITION_CODE[16] = { "F", "LT", "LE", "ULE", "OV", "MI", "Z", "C", "", "GE", "GT", "UGT", "NOV", "PL", "NZ", "NC" diff --git a/src/emu/sound/tms5110.c b/src/emu/sound/tms5110.c index 3e86b6dcd19..27a108f8205 100644 --- a/src/emu/sound/tms5110.c +++ b/src/emu/sound/tms5110.c @@ -217,7 +217,7 @@ void tms5110_set_variant(tms5110_state *tms, int variant) } -void register_for_save_states(tms5110_state *tms) +static void register_for_save_states(tms5110_state *tms) { state_save_register_device_item_array(tms->device, 0, tms->fifo); state_save_register_device_item(tms->device, 0, tms->fifo_head); diff --git a/src/mame/drivers/39in1.c b/src/mame/drivers/39in1.c index 9a462ec34da..a671d42903a 100644 --- a/src/mame/drivers/39in1.c +++ b/src/mame/drivers/39in1.c @@ -220,7 +220,7 @@ static void pxa255_dma_irq_check(running_machine* machine) pxa255_set_irq_line(machine, PXA255_INT_DMA, set_intr); } -void pxa255_dma_load_descriptor_and_start(running_machine* machine, int channel) +static void pxa255_dma_load_descriptor_and_start(running_machine* machine, int channel) { attotime period; diff --git a/src/mame/drivers/cischeat.c b/src/mame/drivers/cischeat.c index d956c279937..4112dd6d762 100644 --- a/src/mame/drivers/cischeat.c +++ b/src/mame/drivers/cischeat.c @@ -168,46 +168,16 @@ Cisco Heat. ***************************************************************************/ #include "driver.h" -#include "cpu/m68000/m68000.h" #include "deprecat.h" -#include "megasys1.h" +#include "cpu/m68000/m68000.h" #include "sound/2151intf.h" #include "sound/okim6295.h" - -/* Variables only used here: */ +#include "megasys1.h" +#include "includes/cischeat.h" static UINT16 *rom_1, *rom_2, *rom_3; static UINT16 *sharedram1, *sharedram2; -/* Variables defined in video: */ - -extern UINT16 *cischeat_roadram[2]; -extern UINT16 *f1gpstr2_ioready; - -/* Functions defined in video: */ - -READ16_HANDLER( bigrun_vregs_r ); -READ16_HANDLER( cischeat_vregs_r ); -READ16_HANDLER( f1gpstar_vregs_r ); -READ16_HANDLER( f1gpstr2_vregs_r ); -READ16_HANDLER( wildplt_vregs_r ); - -WRITE16_HANDLER( bigrun_vregs_w ); -WRITE16_HANDLER( cischeat_vregs_w ); -WRITE16_HANDLER( f1gpstar_vregs_w ); -WRITE16_HANDLER( f1gpstr2_vregs_w ); -WRITE16_HANDLER( scudhamm_vregs_w ); - -CUSTOM_INPUT( cischeat_shift_r ); - -VIDEO_START( bigrun ); -VIDEO_START( cischeat ); -VIDEO_START( f1gpstar ); - -VIDEO_UPDATE( bigrun ); -VIDEO_UPDATE( cischeat ); -VIDEO_UPDATE( f1gpstar ); -VIDEO_UPDATE( scudhamm ); /************************************************************************** diff --git a/src/mame/drivers/cmmb.c b/src/mame/drivers/cmmb.c index 51c4c4d602e..32e5c3f3703 100644 --- a/src/mame/drivers/cmmb.c +++ b/src/mame/drivers/cmmb.c @@ -30,12 +30,12 @@ CYC1399 #include "driver.h" #include "cpu/m6502/m6502.h" -VIDEO_START( cmmb ) +static VIDEO_START( cmmb ) { } -VIDEO_UPDATE( cmmb ) +static VIDEO_UPDATE( cmmb ) { const gfx_element *gfx = screen->machine->gfx[0]; int count = 0x00000; diff --git a/src/mame/drivers/darkhors.c b/src/mame/drivers/darkhors.c index 75acd204711..c454ccaa75b 100644 --- a/src/mame/drivers/darkhors.c +++ b/src/mame/drivers/darkhors.c @@ -73,8 +73,6 @@ To do: ***************************************************************************/ -extern UINT8 *st0016_charram; - static VIDEO_START( darkhors ); static VIDEO_UPDATE( darkhors ); @@ -331,7 +329,7 @@ ADDRESS_MAP_END static UINT32* jclub2_tileram; static int jclub2_gfx_index; -WRITE32_HANDLER( jclub2_tileram_w ) +static WRITE32_HANDLER( jclub2_tileram_w ) { COMBINE_DATA(&jclub2_tileram[offset]); gfx_element_mark_dirty(space->machine->gfx[jclub2_gfx_index], offset/(256/4)); @@ -672,7 +670,7 @@ MACHINE_DRIVER_END -VIDEO_START(jclub2) +static VIDEO_START(jclub2) { /* find first empty slot to decode gfx */ for (jclub2_gfx_index = 0; jclub2_gfx_index < MAX_GFX_ELEMENTS; jclub2_gfx_index++) @@ -687,7 +685,7 @@ VIDEO_START(jclub2) } -VIDEO_UPDATE(jclub2) +static VIDEO_UPDATE(jclub2) { return 0; } @@ -738,12 +736,12 @@ static const st0016_interface st0016_config = &st0016_charram }; -VIDEO_START(jclub2o) +static VIDEO_START(jclub2o) { } -VIDEO_UPDATE(jclub2o) +static VIDEO_UPDATE(jclub2o) { return 0; } diff --git a/src/mame/drivers/gaiden.c b/src/mame/drivers/gaiden.c index 04c270ae8bd..c31c63dde19 100644 --- a/src/mame/drivers/gaiden.c +++ b/src/mame/drivers/gaiden.c @@ -1646,7 +1646,7 @@ static void descramble_mastninj_gfx(UINT8* src) } } -DRIVER_INIT(mastninj) +static DRIVER_INIT(mastninj) { // rearrange the graphic roms into a format that MAME can decode descramble_mastninj_gfx(memory_region(machine,"gfx2")); diff --git a/src/mame/drivers/hitpoker.c b/src/mame/drivers/hitpoker.c index 663e7de0e95..8b48782db1e 100644 --- a/src/mame/drivers/hitpoker.c +++ b/src/mame/drivers/hitpoker.c @@ -52,14 +52,14 @@ static UINT8 hitpoker_pic_data; #define CRTC_CLOCK XTAL_3_579545MHz -VIDEO_START(hitpoker) +static VIDEO_START(hitpoker) { videoram = auto_alloc_array(machine, UINT8, 0x35ff); paletteram = auto_alloc_array(machine, UINT8, 0x1000); colorram = auto_alloc_array(machine, UINT8, 0x2000); } -VIDEO_UPDATE(hitpoker) +static VIDEO_UPDATE(hitpoker) { int count = 0; int y,x; @@ -488,7 +488,7 @@ static MACHINE_DRIVER_START( hitpoker ) MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) MACHINE_DRIVER_END -DRIVER_INIT(hitpoker) +static DRIVER_INIT(hitpoker) { UINT8 *ROM = memory_region(machine, "maincpu"); diff --git a/src/mame/drivers/kaneko16.c b/src/mame/drivers/kaneko16.c index a41e452e480..8d1c5692eea 100644 --- a/src/mame/drivers/kaneko16.c +++ b/src/mame/drivers/kaneko16.c @@ -817,12 +817,6 @@ static WRITE16_HANDLER( shogwarr_oki_bank_w ) } } -extern void calc3_mcu_run(running_machine *machine); - -WRITE16_HANDLER(shogwarr_calc_w); -READ16_HANDLER(shogwarr_calc_r); - - static ADDRESS_MAP_START( shogwarr, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x000000, 0x03ffff) AM_ROM // ROM AM_RANGE(0x100000, 0x10ffff) AM_RAM AM_BASE(&kaneko16_mainram) // Work RAM @@ -2103,7 +2097,7 @@ static INTERRUPT_GEN( shogwarr_interrupt ) } /* -unsigned char shogwarr_default_eeprom[128] = { +static const unsigned char shogwarr_default_eeprom[128] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4B, 0x41, 0x4E, 0x45, 0x4B, 0x4F, 0x2F, 0x41, 0x54, 0x4F, 0x50, 0x20, 0x31, 0x39, 0x39, 0x32, 0x46, 0x55, 0x4A, 0x49, 0xFF, 0xFF, 0x4D, 0x41, 0x20, 0x42, 0x55, 0x53, 0x54, 0x45, 0x52, 0x20, @@ -2116,7 +2110,7 @@ unsigned char shogwarr_default_eeprom[128] = { */ // the above eeprom looks corrupt, some of the text is wrong, the game never writes this text tho.. maybe it should be as below // leaving both here incase they relate to which tables get 'locked out' by the MCU somehow -UINT8 shogwarr_default_eeprom[128] = { +static const UINT8 shogwarr_default_eeprom[128] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4B, 0x41, 0x4E, 0x45, 0x4B, 0x4F, 0x2F, 0x41, 0x54, 0x4F, 0x50, 0x20, 0x31, 0x39, 0x39, 0x32, 0x46, 0x55, 0x4A, 0x49, 0x59, 0x41, 0x4D, 0x41, 0x20, 0x42, 0x55, 0x53, 0x54, 0x45, 0x52, 0x20, @@ -2127,7 +2121,7 @@ UINT8 shogwarr_default_eeprom[128] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF }; -UINT8 brapboys_default_eeprom[128] = { +static const UINT8 brapboys_default_eeprom[128] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x20, 0x30, 0x00, 0x03, 0x68, 0x18, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, 0x04, 0x00, 0x08, 0x4B, 0x41, 0x4E, 0x45, 0x4B, 0x4F, 0x20, 0x20, @@ -3810,9 +3804,7 @@ static DRIVER_INIT( gtmr2 ) DRIVER_INIT_CALL(decrypt_toybox_rom_alt); } -extern DRIVER_INIT(calc3_scantables); - -DRIVER_INIT( calc3 ) +static DRIVER_INIT( calc3 ) { DRIVER_INIT_CALL(calc3_scantables); diff --git a/src/mame/drivers/littlerb.c b/src/mame/drivers/littlerb.c index 2d58fb3589a..4822c83705e 100644 --- a/src/mame/drivers/littlerb.c +++ b/src/mame/drivers/littlerb.c @@ -161,8 +161,8 @@ static READ16_HANDLER( littlerb_vdp_r ) return -1; } -int type2_writes = 0; -UINT32 lasttype2pc = 0; +static int type2_writes = 0; +static UINT32 lasttype2pc = 0; static WRITE16_HANDLER( littlerb_vdp_w ) { diff --git a/src/mame/drivers/looping.c b/src/mame/drivers/looping.c index 28f772bdb0f..2ceef905201 100644 --- a/src/mame/drivers/looping.c +++ b/src/mame/drivers/looping.c @@ -87,7 +87,7 @@ L056-6 9A " " VLI-8-4 7A " #define VBEND (16) #define VBSTART (224+16) -UINT8 *cop_io; +static UINT8 *cop_io; /************************************* * diff --git a/src/mame/drivers/macs.c b/src/mame/drivers/macs.c index 0a0cca6ef5b..98c4d58c594 100644 --- a/src/mame/drivers/macs.c +++ b/src/mame/drivers/macs.c @@ -297,7 +297,7 @@ static INPUT_PORTS_START( macs_base ) PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) INPUT_PORTS_END -INPUT_PORTS_START( macs_m) +static INPUT_PORTS_START( macs_m) PORT_INCLUDE( macs_base ) /*MAHJONG PANEL*/ @@ -344,7 +344,7 @@ INPUT_PORTS_START( macs_m) PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) INPUT_PORTS_END -INPUT_PORTS_START( macs_h) +static INPUT_PORTS_START( macs_h) PORT_INCLUDE( macs_base ) /*HANAFUDA PANEL*/ diff --git a/src/mame/drivers/mlanding.c b/src/mame/drivers/mlanding.c index 34c036f7a5e..ed276474532 100644 --- a/src/mame/drivers/mlanding.c +++ b/src/mame/drivers/mlanding.c @@ -69,7 +69,7 @@ static VIDEO_UPDATE(mlanding) } /* Return the number of pixels processed for timing purposes? */ -int start_dma(void) +static int start_dma(void) { /* Traverse the DMA RAM list */ int offs; diff --git a/src/mame/drivers/naomi.c b/src/mame/drivers/naomi.c index 5d92dee9a19..e06f0b34e51 100644 --- a/src/mame/drivers/naomi.c +++ b/src/mame/drivers/naomi.c @@ -1019,7 +1019,6 @@ Notes: #define CPU_CLOCK (200000000) static UINT32 *dc_sound_ram; -extern UINT64 *naomi_ram64; /* MD2 MD1 MD0 MD6 MD4 MD3 MD5 MD7 MD8 */ static const struct sh4_config sh4cpu_config = { 1, 0, 1, 0, 0, 0, 1, 1, 0, CPU_CLOCK }; @@ -1053,9 +1052,6 @@ static WRITE64_HANDLER( naomi_unknown1_w ) * Non-volatile memories */ -extern UINT8 maple0x86data1[0x80]; - - // some default eeprom settings static const struct { @@ -1375,7 +1371,7 @@ INLINE int decode_reg32_64(running_machine *machine, UINT32 offset, UINT64 mem_m return reg; } -READ64_HANDLER( aw_modem_r ) +static READ64_HANDLER( aw_modem_r ) { int reg; UINT64 shift; @@ -1402,7 +1398,7 @@ READ64_HANDLER( aw_modem_r ) return 0; } -WRITE64_HANDLER( aw_modem_w ) +static WRITE64_HANDLER( aw_modem_w ) { int reg; UINT64 shift; diff --git a/src/mame/drivers/photon.c b/src/mame/drivers/photon.c index 1113e24fb7d..08b1de9ec69 100644 --- a/src/mame/drivers/photon.c +++ b/src/mame/drivers/photon.c @@ -165,7 +165,7 @@ static INPUT_PORTS_START( photon ) INPUT_PORTS_END -INTERRUPT_GEN( pk8000_interrupt ) +static INTERRUPT_GEN( pk8000_interrupt ) { cpu_set_input_line(device, 0, HOLD_LINE); } diff --git a/src/mame/drivers/skeetsht.c b/src/mame/drivers/skeetsht.c index 0930a6f2096..811454ddac3 100644 --- a/src/mame/drivers/skeetsht.c +++ b/src/mame/drivers/skeetsht.c @@ -46,7 +46,7 @@ static VIDEO_START ( skeetsht ) } -void skeetsht_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) +static void skeetsht_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params) { const rgb_t *const pens = tlc34076_get_pens(); UINT16 *vram = &tms_vram[(params->rowaddr << 8) & 0x3ff00]; diff --git a/src/mame/drivers/srmp5.c b/src/mame/drivers/srmp5.c index 9c90c92cd8e..f26541b4493 100644 --- a/src/mame/drivers/srmp5.c +++ b/src/mame/drivers/srmp5.c @@ -42,7 +42,6 @@ This is not a bug (real machine behaves the same). #include "st0016.h" #define DEBUG_CHAR -extern UINT8 *st0016_charram; static UINT32 databank; static UINT32 srmp5_vidregs[0x120 / 4]; static UINT16 *tileram, *palram; diff --git a/src/mame/drivers/ssgbl.c b/src/mame/drivers/ssgbl.c index ffbd8ba8595..389ace1a5b2 100644 --- a/src/mame/drivers/ssgbl.c +++ b/src/mame/drivers/ssgbl.c @@ -18,12 +18,12 @@ ROM_START( ssgbl ) ROM_END -READ16_HANDLER( sunsetbl_r ) +static READ16_HANDLER( sunsetbl_r ) { return mame_rand(space->machine); } -READ16_HANDLER( sunsetbl2_r ) +static READ16_HANDLER( sunsetbl2_r ) { return 0x0000;//mame_rand(space->machine); } diff --git a/src/mame/drivers/st0016.c b/src/mame/drivers/st0016.c index d7ec42f3361..231eeca4856 100644 --- a/src/mame/drivers/st0016.c +++ b/src/mame/drivers/st0016.c @@ -421,7 +421,6 @@ static INTERRUPT_GEN(st0016_int) cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE ); } -extern UINT8 *st0016_charram; static const st0016_interface st0016_config = { &st0016_charram diff --git a/src/mame/drivers/system16.c b/src/mame/drivers/system16.c index acfd5bb2b0b..b31d078ce59 100644 --- a/src/mame/drivers/system16.c +++ b/src/mame/drivers/system16.c @@ -97,6 +97,8 @@ #include "sound/rf5c68.h" #include "video/segaic16.h" +#define ShadowColorsMultiplier 2 + /***************************************************************************/ static UINT16 coinctrl; diff --git a/src/mame/drivers/timetrv.c b/src/mame/drivers/timetrv.c index a2c690a5aa3..28ebc51ce8d 100644 --- a/src/mame/drivers/timetrv.c +++ b/src/mame/drivers/timetrv.c @@ -28,12 +28,12 @@ CPU is an Intel 80188 static UINT8 *led_vram_lo,*led_vram_hi; -VIDEO_START( timetrv ) +static VIDEO_START( timetrv ) { } -VIDEO_UPDATE( timetrv ) +static VIDEO_UPDATE( timetrv ) { popmessage("%s%s",led_vram_lo,led_vram_hi); return 0; diff --git a/src/mame/drivers/tmaster.c b/src/mame/drivers/tmaster.c index 35157dc4c48..3223705c3b1 100644 --- a/src/mame/drivers/tmaster.c +++ b/src/mame/drivers/tmaster.c @@ -541,7 +541,7 @@ static const eeprom_interface galgames_eeprom_interface = #define GALGAMES_EEPROM_CART3 "eeprom_cart3" #define GALGAMES_EEPROM_CART4 "eeprom_cart4" -const char *galgames_eeprom_names[5] = { GALGAMES_EEPROM_BIOS, GALGAMES_EEPROM_CART1, GALGAMES_EEPROM_CART2, GALGAMES_EEPROM_CART3, GALGAMES_EEPROM_CART4 }; +static const char *const galgames_eeprom_names[5] = { GALGAMES_EEPROM_BIOS, GALGAMES_EEPROM_CART1, GALGAMES_EEPROM_CART2, GALGAMES_EEPROM_CART3, GALGAMES_EEPROM_CART4 }; static READ16_HANDLER( galgames_eeprom_r ) { @@ -939,7 +939,7 @@ static MACHINE_RESET( galgames ) device_reset(cputag_get_cpu(machine, "maincpu")); } -UINT8 *galgames_eeprom_data = NULL; +static UINT8 *galgames_eeprom_data = NULL; static MACHINE_DRIVER_START( galgames ) MDRV_CPU_ADD("maincpu", M68000, XTAL_24MHz / 2) diff --git a/src/mame/drivers/turrett.c b/src/mame/drivers/turrett.c index 9a3351c2276..b30aaf2f0d8 100644 --- a/src/mame/drivers/turrett.c +++ b/src/mame/drivers/turrett.c @@ -65,12 +65,12 @@ Windows showed a 5.94 gig partion empty and a 12.74 unallocated partition #define R3041_CLOCK 25000000 -VIDEO_START(turrett) +static VIDEO_START(turrett) { } -VIDEO_UPDATE(turrett) +static VIDEO_UPDATE(turrett) { return 0; } diff --git a/src/mame/drivers/vpoker.c b/src/mame/drivers/vpoker.c index 43e9d819bba..1a43cfc62d3 100644 --- a/src/mame/drivers/vpoker.c +++ b/src/mame/drivers/vpoker.c @@ -82,12 +82,12 @@ mm74c920J/mmc6551j-9 x2 #include "cpu/m6809/m6809.h" #include "machine/6840ptm.h" -VIDEO_START( vpoker ) +static VIDEO_START( vpoker ) { videoram = auto_alloc_array(machine, UINT8, 0x200); } -VIDEO_UPDATE( vpoker ) +static VIDEO_UPDATE( vpoker ) { const gfx_element *gfx = screen->machine->gfx[0]; int count = 0x0000; diff --git a/src/mame/includes/dc.h b/src/mame/includes/dc.h index 6fbbd8cdec7..9240e6f4239 100644 --- a/src/mame/includes/dc.h +++ b/src/mame/includes/dc.h @@ -40,7 +40,7 @@ INPUT_CHANGED( dc_coin_slots_callback ); extern UINT32 dc_sysctrl_regs[0x200/4]; extern UINT32 dc_coin_counts[2]; -extern UINT32 pvrctrl_regs[0x100/4]; +extern UINT8 maple0x86data1[0x80]; /*--------- Ch2-DMA Control Registers ----------*/ #define SB_C2DSTAT ((0x005f6800-0x005f6800)/4) @@ -203,6 +203,7 @@ extern UINT32 pvrctrl_regs[0x100/4]; /*----------- defined in video/dc.c -----------*/ +extern UINT32 pvrctrl_regs[0x100/4]; extern UINT64 *dc_texture_ram; extern UINT64 *dc_framebuffer_ram; diff --git a/src/mame/includes/kaneko16.h b/src/mame/includes/kaneko16.h index e2ae6641111..e7ae0891389 100644 --- a/src/mame/includes/kaneko16.h +++ b/src/mame/includes/kaneko16.h @@ -32,9 +32,15 @@ extern void (*toybox_mcu_run)(running_machine *machine); /* one of the following void bloodwar_mcu_run(running_machine *machine); void bonkadv_mcu_run(running_machine *machine); void gtmr_mcu_run(running_machine *machine); +void calc3_mcu_run(running_machine *machine); + void toxboy_handle_04_subcommand(running_machine* machine,UINT8 mcu_subcmd, UINT16*mcu_ram); + DRIVER_INIT( decrypt_toybox_rom ); DRIVER_INIT( decrypt_toybox_rom_alt ); +DRIVER_INIT( calc3_scantables ); + + /*----------- defined in drivers/kaneko16.c -----------*/ diff --git a/src/mame/includes/nmk16.h b/src/mame/includes/nmk16.h index ef758b17668..2542ed4fa59 100644 --- a/src/mame/includes/nmk16.h +++ b/src/mame/includes/nmk16.h @@ -7,8 +7,8 @@ extern UINT16 *nmk_bgvideoram3; extern UINT16 *nmk_fgvideoram,*nmk_txvideoram; extern UINT16 *gunnail_scrollram, *gunnail_scrollramy; -extern UINT16 *nmk_bgvideoram0, *afega_scroll_0; -extern UINT16 *nmk_txvideoram, *afega_scroll_1; +extern UINT16 *afega_scroll_0; +extern UINT16 *afega_scroll_1; WRITE16_HANDLER( nmk_bgvideoram0_w ); @@ -20,7 +20,6 @@ WRITE16_HANDLER( nmk_fgvideoram_w ); WRITE16_HANDLER( nmk_txvideoram_w ); WRITE16_HANDLER( nmk_scroll_w ); WRITE16_HANDLER( nmk_scroll_2_w ); -WRITE16_HANDLER( nmk_scroll_3_w ); WRITE16_HANDLER( nmk_flipscreen_w ); WRITE16_HANDLER( nmk_tilebank_w ); WRITE16_HANDLER( bioship_scroll_w ); diff --git a/src/mame/includes/pk8000.h b/src/mame/includes/pk8000.h index 7eed9193717..ec534db61bc 100644 --- a/src/mame/includes/pk8000.h +++ b/src/mame/includes/pk8000.h @@ -1,3 +1,5 @@ +/*----------- defined in video/pk8000.c -----------*/ + READ8_HANDLER(pk8000_video_color_r); WRITE8_HANDLER(pk8000_video_color_w); READ8_HANDLER(pk8000_text_start_r); @@ -17,5 +19,3 @@ extern UINT8 pk8000_video_enable; PALETTE_INIT( pk8000 ); UINT32 pk8000_video_update(const device_config *screen, bitmap_t *bitmap, const rectangle *cliprect, UINT8 *videomem); - - diff --git a/src/mame/includes/snes.h b/src/mame/includes/snes.h index 659600ca3ae..be3d95d88d2 100644 --- a/src/mame/includes/snes.h +++ b/src/mame/includes/snes.h @@ -403,15 +403,14 @@ extern WRITE8_HANDLER( snes_w_bank7 ); extern READ8_HANDLER( superfx_r_bank1 ); extern READ8_HANDLER( superfx_r_bank2 ); extern READ8_HANDLER( superfx_r_bank3 ); -extern READ8_HANDLER( superfx_r_bank4 ); extern WRITE8_HANDLER( superfx_w_bank1 ); extern WRITE8_HANDLER( superfx_w_bank2 ); extern WRITE8_HANDLER( superfx_w_bank3 ); -extern WRITE8_HANDLER( superfx_w_bank4 ); WRITE_LINE_DEVICE_HANDLER( snes_extern_irq_w ); extern UINT8 snes_has_addon_chip; +extern UINT16 snes_htmult; extern void snes_gdma( const address_space *space, UINT8 channels ); extern void snes_hdma_init(void); diff --git a/src/mame/includes/st0016.h b/src/mame/includes/st0016.h index a5003d0f607..0743e47bd25 100644 --- a/src/mame/includes/st0016.h +++ b/src/mame/includes/st0016.h @@ -32,7 +32,7 @@ WRITE8_HANDLER (st0016_rom_bank_w); /*----------- defined in video/st0016.c -----------*/ -extern UINT8 *st0016_charram,*st0016_spriteram,*st0016_paletteram; +extern UINT8 *st0016_charram; extern UINT8 *macs_ram1,*macs_ram2; diff --git a/src/mame/includes/stv.h b/src/mame/includes/stv.h index b86f6a85f88..ec28d247863 100644 --- a/src/mame/includes/stv.h +++ b/src/mame/includes/stv.h @@ -3,7 +3,6 @@ extern UINT32 *stv_workram_h; extern UINT32 *stv_workram_l; -extern int stv_vblank,stv_hblank; extern int stv_enable_slave_sh2; extern int minit_boost,sinit_boost; @@ -79,6 +78,7 @@ READ32_HANDLER ( stv_vdp1_framebuffer0_r ); extern UINT32* stv_vdp2_regs; extern UINT32* stv_vdp2_vram; +extern int stv_vblank,stv_hblank; extern UINT32* stv_vdp2_cram; UINT8 stv_get_vblank(running_machine *machine); diff --git a/src/mame/includes/system16.h b/src/mame/includes/system16.h index 3788623d30b..0e092ebaaa4 100644 --- a/src/mame/includes/system16.h +++ b/src/mame/includes/system16.h @@ -48,40 +48,6 @@ VIDEO_START( yboard ); VIDEO_UPDATE( yboard ); - -/******************** OLD STUFF *******************/ - -#define SYS16_SPR_FLIPX 0x01 -#define SYS16_SPR_VISIBLE 0x04 -#define SYS16_SPR_DRAW_TO_LEFT 0x08 -#define SYS16_SPR_SPECIAL 0x10 -#define SYS16_SPR_SHADOW 0x20 /* all pixels */ -#define SYS16_SPR_PARTIAL_SHADOW 0x40 /* pen #10 */ -#define SYS16_SPR_DRAW_TO_TOP 0x80 - -struct sys16_sprite_attributes { - int priority, flags; - int gfx, color; - UINT8 pitch; - int zoomx, zoomy; - int x,y, screen_height; /* in screen coordinates */ - int shadow_pen; -}; - -extern int (*sys16_spritesystem)( - struct sys16_sprite_attributes *sprite, - const UINT16 *source, - int bJustGetColor ); - -/*----------- defined in video/sys16spr.c -----------*/ - -extern int sys16_sprite_shinobi( struct sys16_sprite_attributes *sprite, const UINT16 *source, int bJustGetColor ); -extern int sys16_sprite_passshot( struct sys16_sprite_attributes *sprite, const UINT16 *source, int bJustGetColor ); -extern int sys16_sprite_quartet2( struct sys16_sprite_attributes *sprite, const UINT16 *source, int bJustGetColor ); - -#define NumOfShadowColors 32 -#define ShadowColorsMultiplier 2 - /*----------- defined in machine/s16fd.c -----------*/ void *fd1094_get_decrypted_base(void); @@ -110,35 +76,8 @@ struct _sys16_patch extern void sys16_patch_code( running_machine *machine, const sys16_patch *patch, int count ); -#define SYS16_MWA16_PALETTERAM sys16_paletteram_w -#define SYS16_MRA16_PALETTERAM SMH_RAM - -#define SYS16_MRA16_WORKINGRAM SMH_RAM -#define SYS16_MWA16_WORKINGRAM SMH_RAM - -#define SYS16_MRA16_WORKINGRAM2 SMH_RAM -#define SYS16_MWA16_WORKINGRAM2 SMH_RAM - extern MACHINE_RESET( sys16_onetime ); -#define SYS16_MRA16_SPRITERAM SMH_RAM -#define SYS16_MWA16_SPRITERAM SMH_RAM - -#define SYS16_MRA16_EXTRAM SMH_RAM -#define SYS16_MWA16_EXTRAM SMH_RAM - -#define SYS16_MRA16_EXTRAM2 SMH_RAM -#define SYS16_MWA16_EXTRAM2 SMH_RAM - -#define SYS16_MRA16_EXTRAM3 SMH_RAM -#define SYS16_MWA16_EXTRAM3 SMH_RAM - -#define SYS16_MRA16_EXTRAM4 SMH_RAM -#define SYS16_MWA16_EXTRAM4 SMH_RAM - -#define SYS16_MRA16_ROADRAM SMH_RAM -#define SYS16_MWA16_ROADRAM SMH_RAM - GFXDECODE_EXTERN( sys16 ); /*----------- defined in video/system16.c -----------*/ @@ -160,7 +99,6 @@ extern UINT16* system16a_bootleg_bg1_tileram; /* video hardware */ extern WRITE16_HANDLER( sys16_tileram_w ); extern WRITE16_HANDLER( sys16_textram_w ); -extern WRITE16_HANDLER( sys16_paletteram_w ); /* "normal" video hardware */ extern VIDEO_START( system16 ); @@ -205,9 +143,7 @@ extern int sys16_bg_page[4]; extern int sys16_fg_scrollx, sys16_fg_scrolly; extern int sys16_fg_page[4]; -extern int sys16_bg2_scrollx, sys16_bg2_scrolly; extern int sys16_bg2_page[4]; -extern int sys16_fg2_scrollx, sys16_fg2_scrolly; extern int sys16_fg2_page[4]; extern int sys18_bg2_active; diff --git a/src/mame/machine/dc.c b/src/mame/machine/dc.c index 0f5e121c57f..fd5fd7d4454 100644 --- a/src/mame/machine/dc.c +++ b/src/mame/machine/dc.c @@ -112,7 +112,7 @@ static const char *const maple_names[] = #endif -static UINT8 dc_controller_id[0x70] = +static const UINT8 dc_controller_id[0x70] = { 0x00, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x06, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x44, 0x72, 0x65, 0x61, 0x6d, 0x63, 0x61, 0x73, 0x74, 0x20, 0x43, 0x6f, 0x6e, 0x74, @@ -123,7 +123,7 @@ static UINT8 dc_controller_id[0x70] = 0x45, 0x53, 0x2c, 0x4c, 0x54, 0x44, 0x2e, 0x20, 0x20, 0x20, 0x20, 0x20, 0xae, 0x01, 0xf4, 0x01 }; -static UINT8 dc_controller_version[0x50] = +static const UINT8 dc_controller_version[0x50] = { 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x31, 0x2e, 0x30, 0x31, 0x30, 0x2c, 0x31, 0x39, 0x39, 0x38, 0x2f, 0x30, 0x39, 0x2f, 0x32, 0x38, 0x2c, 0x33, 0x31, 0x35, 0x2d, 0x36, 0x32, 0x31, diff --git a/src/mame/machine/kaneko16.c b/src/mame/machine/kaneko16.c index e1a89a673cd..959599a3b7c 100644 --- a/src/mame/machine/kaneko16.c +++ b/src/mame/machine/kaneko16.c @@ -37,8 +37,8 @@ UINT16 *kaneko16_mcu_ram; - see notes about this "calculator" implementation in drivers\galpanic.c - bonkadv only uses Random Number, XY Overlap Collision bit and register '0x02' */ -READ16_HANDLER(shogwarr_calc_r); -WRITE16_HANDLER(shogwarr_calc_w); +static READ16_HANDLER(shogwarr_calc_r); +static WRITE16_HANDLER(shogwarr_calc_w); static struct { UINT16 x1p, y1p, x1s, y1s; @@ -399,7 +399,7 @@ static void shogwarr_recalc_collisions(void) } -WRITE16_HANDLER(shogwarr_calc_w) +static WRITE16_HANDLER(shogwarr_calc_w) { int idx=offset*4; switch (idx) @@ -464,7 +464,7 @@ WRITE16_HANDLER(shogwarr_calc_w) } -READ16_HANDLER(shogwarr_calc_r) +static READ16_HANDLER(shogwarr_calc_r) { int idx=offset*4; @@ -558,8 +558,6 @@ void calc3_mcu_init(void) calc3_mcu_command_offset = 0; } -void calc3_mcu_run(running_machine *machine); - WRITE16_HANDLER( calc3_mcu_ram_w ) { COMBINE_DATA(&kaneko16_mcu_ram[offset]); @@ -634,7 +632,7 @@ where games specify the same decryption key the table used is the same, I don't */ -UINT16 calc3_mcu_crc; +static UINT16 calc3_mcu_crc; /* decryption tables */ @@ -647,7 +645,7 @@ UINT16 calc3_mcu_crc; part of the table to be 0 */ -static INT16 calc3_keydata[0x40*0x100] = { +static const INT16 calc3_keydata[0x40*0x100] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, @@ -1686,12 +1684,12 @@ static UINT16 calc3_database; static int data_header[2]; -UINT32 calc3_writeaddress; -UINT32 calc3_writeaddress_current; -UINT16 calc3_dsw_addr = 0x00; -UINT16 calc3_eeprom_addr; -UINT16 calc3_poll_addr; -UINT16 cakc3_checkumaddress; +static UINT32 calc3_writeaddress; +static UINT32 calc3_writeaddress_current; +static UINT16 calc3_dsw_addr = 0x00; +static UINT16 calc3_eeprom_addr; +static UINT16 calc3_poll_addr; +static UINT16 cakc3_checkumaddress; static UINT8 shift_bits(UINT8 dat, int bits) { @@ -1710,7 +1708,7 @@ static UINT8 shift_bits(UINT8 dat, int bits) } // endian safe? you're having a laugh -int calc3_decompress_table(running_machine* machine, int tabnum, UINT8* dstram, int dstoffset) +static int calc3_decompress_table(running_machine* machine, int tabnum, UINT8* dstram, int dstoffset) { @@ -1940,7 +1938,7 @@ int calc3_decompress_table(running_machine* machine, int tabnum, UINT8* dstram, } else { - INT16* key = calc3_keydata+(calc3_decryption_key_byte*0x40); + const INT16* key = calc3_keydata+(calc3_decryption_key_byte*0x40); if (key[0] == -1) { @@ -2105,8 +2103,6 @@ DRIVER_INIT(calc3_scantables) -extern UINT16 calc3_mcu_crc; - void calc3_mcu_run(running_machine *machine) { UINT16 mcu_command; diff --git a/src/mame/machine/naomibd.c b/src/mame/machine/naomibd.c index a3d72d70b36..20c26c49029 100644 --- a/src/mame/machine/naomibd.c +++ b/src/mame/machine/naomibd.c @@ -225,7 +225,7 @@ struct _naomibd_state UINT32 prot_offset, prot_key; UINT32 aw_offset, aw_file_base, aw_file_offset; - UINT32 *prot_translate; + const UINT32 *prot_translate; int prot_reverse_bytes; #if NAOMIBD_PRINTF_PROTECTION int prot_pio_count; @@ -235,7 +235,7 @@ struct _naomibd_state // maps protection offsets to real addresses // format of array: encryption key, address written, address to switch out with. if key is -1 it's ignored and address written is the match. // if key is not -1, it's used for the match instead of the address written. -static naomibd_config_table naomibd_translate_tbl[] = +static const naomibd_config_table naomibd_translate_tbl[] = { { "doa2", 0, { -1, 0x500, 0, -1, 0x20504, 0x20000, -1, 0x40508, 0x40000, -1, 0x6050c, 0x60000, -1, 0x80510, 0x80000, -1, 0xa0514, 0xa0000, -1, 0xc0518, 0xc0000, -1, 0xe051c, 0xe0000, -1, 0x100520,0x100000, -1, 0x118a3a, 0x120000, diff --git a/src/mame/machine/snesrtc.c b/src/mame/machine/snesrtc.c index 5425fa56117..cd7c5a0f81c 100644 --- a/src/mame/machine/snesrtc.c +++ b/src/mame/machine/snesrtc.c @@ -13,9 +13,9 @@ typedef struct INT8 rtc_index; } _snes_rtc_t; -_snes_rtc_t snes_rtc; +static _snes_rtc_t snes_rtc; -const UINT8 srtc_months[12] = +static const UINT8 srtc_months[12] = { 31, 28, 31, 30, 31, 30, diff --git a/src/mame/machine/snessdd1.c b/src/mame/machine/snessdd1.c index 7351762193d..89e47a7df41 100644 --- a/src/mame/machine/snessdd1.c +++ b/src/mame/machine/snessdd1.c @@ -172,7 +172,7 @@ typedef struct UINT8 nextIfLPS; } SDD1_PEM_state; -SDD1_PEM_state SDD1_PEM_evolution_table[33] = +static const SDD1_PEM_state SDD1_PEM_evolution_table[33] = { { 0,25,25}, { 0, 2, 1}, @@ -258,7 +258,7 @@ static UINT8 SDD1_PEM_getBit(SDD1_PEM* thisptr, UINT8 context) SDD1_PEM_ContextInfo *pContInfo = &(thisptr->contextInfo)[context]; UINT8 currStatus = pContInfo->status; - SDD1_PEM_state* pState = &(SDD1_PEM_evolution_table[currStatus]); + const SDD1_PEM_state* pState = &(SDD1_PEM_evolution_table[currStatus]); UINT8 currentMPS = pContInfo->MPS; bit = SDD1_BG_getBit(thisptr->BG[pState->code_num], &endOfRun); @@ -533,7 +533,7 @@ typedef struct } buffer; } _snes_sdd1_t; -_snes_sdd1_t snes_sdd1; +static _snes_sdd1_t snes_sdd1; static void sdd1_init(running_machine* machine) { diff --git a/src/mame/video/btime.c b/src/mame/video/btime.c index 50106d1d18a..5696ec07639 100644 --- a/src/mame/video/btime.c +++ b/src/mame/video/btime.c @@ -19,7 +19,7 @@ UINT8 *lnc_charbank; UINT8 *bnj_backgroundram; UINT8 *zoar_scrollram; UINT8 *deco_charram; -UINT8 *progolf_fg_fb; +//UINT8 *progolf_fg_fb; size_t bnj_backgroundram_size; static UINT8 btime_palette = 0; diff --git a/src/mame/video/cischeat.c b/src/mame/video/cischeat.c index b0056a631d0..eeb87f93d5b 100644 --- a/src/mame/video/cischeat.c +++ b/src/mame/video/cischeat.c @@ -55,6 +55,7 @@ Note: if MAME_DEBUG is defined, pressing Z or X with: #include "driver.h" #include "megasys1.h" +#include "includes/cischeat.h" /* Variables only used here: */ @@ -1313,12 +1314,6 @@ VIDEO_UPDATE( f1gpstar ) Scud Hammer **************************************************************************/ -extern UINT16 scudhamm_motor_command; - - READ16_HANDLER( scudhamm_motor_pos_r ); - READ16_HANDLER( scudhamm_motor_status_r ); - READ16_HANDLER( scudhamm_analog_r ); - VIDEO_UPDATE( scudhamm ) { int megasys1_active_layers1, flag; diff --git a/src/mame/video/ppu2c0x.c b/src/mame/video/ppu2c0x.c index 1f9bccdeb52..3f3353d6687 100644 --- a/src/mame/video/ppu2c0x.c +++ b/src/mame/video/ppu2c0x.c @@ -125,8 +125,8 @@ static TIMER_CALLBACK( nmi_callback ); void (*ppu_latch)( const device_config *device, offs_t offset ); /* palette handlers */ -WRITE8_HANDLER( ppu2c0x_palette_write ); -READ8_HANDLER( ppu2c0x_palette_read ); +static WRITE8_HANDLER( ppu2c0x_palette_write ); +static READ8_HANDLER( ppu2c0x_palette_read ); /* name and attribute table functions */ WRITE8_HANDLER( ppu2c0x_name_write ); READ8_HANDLER( ppu2c0x_name_read ); @@ -980,7 +980,7 @@ static DEVICE_RESET( ppu2c0x ) * *************************************/ -WRITE8_HANDLER( ppu2c0x_palette_write ) +static WRITE8_HANDLER( ppu2c0x_palette_write ) { ppu2c0x_chip *this_ppu = get_token(space->cpu); const ppu2c0x_interface *intf = get_interface(space->cpu); @@ -1011,7 +1011,7 @@ WRITE8_HANDLER( ppu2c0x_palette_write ) } } -READ8_HANDLER( ppu2c0x_palette_read ) +static READ8_HANDLER( ppu2c0x_palette_read ) { ppu2c0x_chip *this_ppu = get_token(space->cpu); { diff --git a/src/mame/video/snes.c b/src/mame/video/snes.c index e5e4cc2f16b..b0a3e3b0e1d 100644 --- a/src/mame/video/snes.c +++ b/src/mame/video/snes.c @@ -124,8 +124,6 @@ struct SCANLINE static struct SCANLINE scanlines[2]; struct SNES_PPU_STRUCT snes_ppu; -extern UINT16 snes_htmult; - enum { SNES_COLOR_DEPTH_2BPP = 0, diff --git a/src/mame/video/st0016.c b/src/mame/video/st0016.c index e20aa13ebc7..f08a2f72519 100644 --- a/src/mame/video/st0016.c +++ b/src/mame/video/st0016.c @@ -6,7 +6,8 @@ #include "driver.h" #include "st0016.h" -UINT8 *st0016_charram,*st0016_spriteram,*st0016_paletteram; +UINT8 *st0016_charram; +static UINT8 *st0016_spriteram,*st0016_paletteram; UINT8 *macs_ram1,*macs_ram2; diff --git a/src/mame/video/system16.c b/src/mame/video/system16.c index 6bc26455fe1..8dcc40807f6 100644 --- a/src/mame/video/system16.c +++ b/src/mame/video/system16.c @@ -29,11 +29,11 @@ #include "video/resnet.h" #include "video/segaic16.h" -int system16_bootleg_spritebank_type = -1; -int system16_bootleg_back_tilemap_yscroll = 0; -int system16_bootleg_fore_tilemap_yscroll = 0; -int system16_bootleg_text_tilemap_yscroll = 0; -int system16_bootleg_sprite_xoffs = 0; +static int system16_bootleg_spritebank_type = -1; +static int system16_bootleg_back_tilemap_yscroll = 0; +static int system16_bootleg_fore_tilemap_yscroll = 0; +static int system16_bootleg_text_tilemap_yscroll = 0; +static int system16_bootleg_sprite_xoffs = 0; /* A config table for per-game offsets and bank types */ struct system15_bootleg_config @@ -85,7 +85,7 @@ static const struct system15_bootleg_config config_table[] = -void setup_system16_bootleg_video(running_machine* machine) +static void setup_system16_bootleg_video(running_machine* machine) { const char *gamename = machine->gamedrv->name; const struct system15_bootleg_config *k = &config_table[0]; @@ -108,7 +108,7 @@ void setup_system16_bootleg_video(running_machine* machine) if (!found) fatalerror("system16 bootleg not in system15_bootleg_config config_table[]!\n"); } -void setup_system16_bootleg_spritebanking(running_machine* machine) +static void setup_system16_bootleg_spritebanking(running_machine* machine) { if (system16_bootleg_spritebank_type == 1) @@ -171,9 +171,7 @@ int sys16_tile_bank0; int sys16_refreshenable; int sys16_bg_scrollx, sys16_bg_scrolly; -int sys16_bg2_scrollx, sys16_bg2_scrolly; int sys16_fg_scrollx, sys16_fg_scrolly; -int sys16_fg2_scrollx, sys16_fg2_scrolly; int sys16_bg_page[4]; int sys16_bg2_page[4]; @@ -311,7 +309,7 @@ static const int resistances_normal[6] = {3900, 2000, 1000, 1000/2, 1000/4, 0}; static const int resistances_sh[6] = {3900, 2000, 1000, 1000/2, 1000/4, 470}; static double weights[2][3][6]; -#if 0 +#ifdef UNUSED_CODE WRITE16_HANDLER( sys16_paletteram_w ) { UINT16 newword; diff --git a/src/tools/unidasm.c b/src/tools/unidasm.c index 8884d664d96..9f772bc6f4e 100644 --- a/src/tools/unidasm.c +++ b/src/tools/unidasm.c @@ -326,7 +326,7 @@ void CLIB_DECL mame_printf_debug(const char *format, ...) } -int parse_options(int argc, char *argv[], options *opts) +static int parse_options(int argc, char *argv[], options *opts) { int pending_base = FALSE; int pending_arch = FALSE; |
