(From Atari Ace)

Some more static qualifiers for MAME, mostly on recent new/changed
code, but also on some arrays declared in functions I noticed.
This commit is contained in:
Aaron Giles 2008-01-14 17:39:44 +00:00
parent 81feac74f6
commit ea7fc1a5e9
27 changed files with 72 additions and 74 deletions

View File

@ -2112,7 +2112,7 @@ handle_unknown:
sprintf(s, "???");
}
int i386_dasm_one_ex(char *buffer, UINT64 eip, const UINT8 *oprom, int mode)
static int i386_dasm_one_ex(char *buffer, UINT64 eip, const UINT8 *oprom, int mode)
{
UINT8 op;

View File

@ -370,7 +370,7 @@ static int ad2083_speech_rom_read_bit(void)
static WRITE8_HANDLER( ad2083_tms5110_ctrl_w )
{
int tbl[8] = {0,4,2,6,1,5,3,7};
static const int tbl[8] = {0,4,2,6,1,5,3,7};
speech_rom_bit = tbl[data & 0x07];
switch (data>>3)

View File

@ -275,9 +275,9 @@ static void tx1_stream_update(void *param, stream_sample_t **inputs, stream_samp
void *tx1_sh_start(int clock, const struct CustomSound_interface *config)
{
const int r0[4] = { 390e3, 180e3, 180e3, 180e3 };
const int r1[3] = { 180e3, 390e3, 56e3 };
const int r2[3] = { 390e3, 390e3, 180e3 };
static const int r0[4] = { 390e3, 180e3, 180e3, 180e3 };
static const int r1[3] = { 180e3, 390e3, 56e3 };
static const int r2[3] = { 390e3, 390e3, 180e3 };
/* Allocate the stream */

View File

@ -84,7 +84,7 @@ static VIDEO_UPDATE( acefruit )
{
int y;
int x;
int spriteskip[] = { 1, 2, 4 };
static const int spriteskip[] = { 1, 2, 4 };
int spritesize = spriteskip[ color - 5 ];
const gfx_element *gfx = machine->gfx[ 0 ];

View File

@ -1142,7 +1142,7 @@ static VIDEO_UPDATE(cps3)
int xsizedraw2 = ((value3 & 0x007f0000)>>16);
int xx,yy;
int tilestable[4] = { 8,1,2,4 };
static const int tilestable[4] = { 8,1,2,4 };
int ysize2 = ((value3 & 0x0000000c)>>2);
int xsize2 = ((value3 & 0x00000003)>>0);
UINT32 xinc,yinc;
@ -1967,11 +1967,6 @@ static WRITE32_HANDLER( cps3_ss_pal_base_w )
}
}
static UINT32* tilemap20_regs_base;
static UINT32* tilemap30_regs_base;
static UINT32* tilemap40_regs_base;
static UINT32* tilemap50_regs_base;
//<ElSemi> +0 X +2 Y +4 unknown +6 enable (&0x8000) +8 low part tilemap base, high part linescroll base
//<ElSemi> (a word each)

View File

@ -1461,7 +1461,7 @@ static const int keyboard_notes[24] =
static TIMER_CALLBACK( keyboard_timer_callback )
{
const int kb_uart_channel[2] = { 1, 0 };
static const int kb_uart_channel[2] = { 1, 0 };
int keyboard;
int i;

View File

@ -663,7 +663,7 @@ static int lastoffset=0;
static int decrypt(int game, int key, int high_word, int low_word)
{
int swaps[4][16] =
static const int swaps[4][16] =
{
{ 5,7,9,12,2,14,13,15,3,6,8,11,4,10,0,1 },
{ 11,2,5,14,8,13,10,4,7,12,0,6,15,9,1,3 },
@ -673,7 +673,7 @@ static int decrypt(int game, int key, int high_word, int low_word)
int dst[16],carry[16];
int i;
int *s = swaps[key & 3];
const int *s = swaps[key & 3];
int flag1 = BIT(high_word, 9) ^ BIT(high_word, 12) ^ 1;
int flag2 = game ? BIT(high_word, 10) : (BIT(high_word, 9) ^ BIT(high_word, 10));

View File

@ -214,7 +214,7 @@ static DRIVER_INIT(hshavoc)
int x;
UINT16 *src = (UINT16 *)memory_region(REGION_CPU1);
UINT16 typedat[16] = {
static const UINT16 typedat[16] = {
1,1,1,1, 1,1,1,1,
1,0,0,1, 1,0,1,1
};

View File

@ -131,7 +131,7 @@ static int imola_draw_mode;
static void
InitializeColors( void )
{ /* optional runtime remapping of colors */
const UINT8 color[0x10][3] =
static const UINT8 color[0x10][3] =
{ /* wrong! need color-accurate screenshots to fix */
{ 0x44,0x44,0x00 },
{ 0x7f,0xff,0xff },

View File

@ -646,7 +646,7 @@ static WRITE16_HANDLER( namcona1_mcu_w )
*/
static void write_version_info( void )
{
const UINT16 source[0x8] =
static const UINT16 source[0x8] =
{ /* "NSA-BIOS ver"... */
0x534e,0x2d41,0x4942,0x534f,0x7620,0x7265,0x2e31,0x3133
};
@ -778,7 +778,7 @@ static READ16_HANDLER( custom_key_r )
if( offset==4 ) keyseq = 0;
if( offset==3 )
{
const UINT16 data[] =
static const UINT16 data[] =
{
0x0000,0x2000,0x2100,0x2104,0x0106,0x0007,0x4003,0x6021,
0x61a0,0x31a4,0x9186,0x9047,0xc443,0x6471,0x6db0,0x39bc,

View File

@ -520,33 +520,33 @@ static INTERRUPT_GEN( naomi_vblank )
dc_vblank();
}
READ64_HANDLER( naomi_arm_r )
static READ64_HANDLER( naomi_arm_r )
{
return *((UINT64 *)dc_sound_ram+offset);
}
WRITE64_HANDLER( naomi_arm_w )
static WRITE64_HANDLER( naomi_arm_w )
{
COMBINE_DATA((UINT64 *)dc_sound_ram + offset);
}
READ64_HANDLER( naomi_unknown1_r )
static READ64_HANDLER( naomi_unknown1_r )
{
if ((offset * 8) == 0xc0) // trick so that it does not "wait for multiboard sync"
return -1;
return 0;
}
WRITE64_HANDLER( naomi_unknown1_w )
static WRITE64_HANDLER( naomi_unknown1_w )
{
}
READ32_HANDLER( dc_aica_arm_r )
static READ32_HANDLER( dc_aica_arm_r )
{
return 0;
}
WRITE32_HANDLER( dc_aica_arm_w )
static WRITE32_HANDLER( dc_aica_arm_w )
{
}
@ -572,7 +572,7 @@ WRITE32_HANDLER( dc_aica_arm_w )
// NOTE: all accesses are 16 or 32 bits wide but only 16 bits are valid
READ64_HANDLER( naomi_rom_board_r )
static READ64_HANDLER( naomi_rom_board_r )
{
UINT8 *ROM = (UINT8 *)memory_region(REGION_USER1);
@ -595,7 +595,7 @@ READ64_HANDLER( naomi_rom_board_r )
return U64(0xffffffffffffffff);
}
WRITE64_HANDLER( naomi_rom_board_w )
static WRITE64_HANDLER( naomi_rom_board_w )
{
if ((offset == 1) && ((mem_mask & U64(0xffff)) == 0))
{
@ -652,7 +652,7 @@ static ADDRESS_MAP_START( naomi_map, ADDRESS_SPACE_PROGRAM, 64 )
AM_RANGE(0xa0000000, 0xa01fffff) AM_ROM AM_REGION(REGION_CPU1, 0)
ADDRESS_MAP_END
READ32_HANDLER( test1 )
static READ32_HANDLER( test1 )
{
return -1;
}

View File

@ -84,7 +84,7 @@ static WRITE8_HANDLER( paranoia_8085_8155_w )
}
}
ADDRESS_MAP_START(paranoia_8085_map, ADDRESS_SPACE_PROGRAM, 8)
static ADDRESS_MAP_START(paranoia_8085_map, ADDRESS_SPACE_PROGRAM, 8)
AM_RANGE( 0x0000, 0x7fff) AM_ROM
AM_RANGE( 0x8000, 0x80ff) AM_RAM
AM_RANGE( 0x8100, 0x8105) AM_WRITE( paranoia_8085_8155_w )
@ -92,10 +92,10 @@ ADDRESS_MAP_START(paranoia_8085_map, ADDRESS_SPACE_PROGRAM, 8)
AM_RANGE( 0xe000, 0xe1ff) AM_RAM
ADDRESS_MAP_END
ADDRESS_MAP_START(paranoia_8085_io_map, ADDRESS_SPACE_IO, 8)
static ADDRESS_MAP_START(paranoia_8085_io_map, ADDRESS_SPACE_IO, 8)
ADDRESS_MAP_END
ADDRESS_MAP_START(paranoia_z80_map, ADDRESS_SPACE_PROGRAM, 8)
static ADDRESS_MAP_START(paranoia_z80_map, ADDRESS_SPACE_PROGRAM, 8)
AM_RANGE( 0x0000, 0x3fff) AM_ROM
AM_RANGE( 0x6000, 0x67ff) AM_RAM
AM_RANGE( 0x7000, 0x73ff) AM_RAM
@ -119,7 +119,7 @@ static WRITE8_HANDLER(paranoia_z80_io_37_w)
{
}
ADDRESS_MAP_START(paranoia_z80_io_map, ADDRESS_SPACE_IO, 8)
static ADDRESS_MAP_START(paranoia_z80_io_map, ADDRESS_SPACE_IO, 8)
ADDRESS_MAP_FLAGS( AMEF_ABITS(8) )
AM_RANGE( 0x01, 0x01 ) AM_READ( paranoia_z80_io_01_r )
AM_RANGE( 0x02, 0x02 ) AM_READ( paranoia_z80_io_02_r )

View File

@ -2262,7 +2262,7 @@ MACHINE_DRIVER_END
DRIVER_INIT(rdx_v33)
static DRIVER_INIT(rdx_v33)
{
memory_set_bankptr(1,&memory_region(REGION_CPU1)[0x020000]);
memory_set_bankptr(2,&memory_region(REGION_CPU1)[0x030000]);

View File

@ -336,11 +336,12 @@ static const gfx_layout sauro_spritelayout =
16*16 /* every sprite takes 32 consecutive bytes */
};
const struct sp0256_interface sauro_sp256 =
static const struct sp0256_interface sauro_sp256 =
{
lrq_callback,
0,
REGION_SOUND1};
REGION_SOUND1
};
static GFXDECODE_START( sauro )
GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 64 )

View File

@ -173,7 +173,7 @@ static MACHINE_RESET( irem )
* 0x06: SAUCER HIT
*/
WRITE8_HANDLER( iremm10_ctrl_w )
static WRITE8_HANDLER( iremm10_ctrl_w )
{
irem_state *state = Machine->driver_data;
@ -250,7 +250,7 @@ WRITE8_HANDLER( iremm10_ctrl_w )
* Will be updated only in attract mode
*/
WRITE8_HANDLER( iremm11_ctrl_w )
static WRITE8_HANDLER( iremm11_ctrl_w )
{
irem_state *state = Machine->driver_data;
@ -283,7 +283,7 @@ WRITE8_HANDLER( iremm11_ctrl_w )
* Will be updated only in attract mode
*/
WRITE8_HANDLER( iremm15_ctrl_w )
static WRITE8_HANDLER( iremm15_ctrl_w )
{
irem_state *state = Machine->driver_data;
@ -311,7 +311,7 @@ WRITE8_HANDLER( iremm15_ctrl_w )
* Will be updated only in attract mode
*/
WRITE8_HANDLER( iremm10_a500_w )
static WRITE8_HANDLER( iremm10_a500_w )
{
#if DEBUG
if (data & 0xFC)
@ -319,7 +319,7 @@ WRITE8_HANDLER( iremm10_a500_w )
#endif
}
WRITE8_HANDLER( iremm11_a100_w )
static WRITE8_HANDLER( iremm11_a100_w )
{
static int last = 0x00;
int raising_bits = data & ~last;
@ -353,7 +353,7 @@ WRITE8_HANDLER( iremm11_a100_w )
}
WRITE8_HANDLER( iremm15_a100_w )
static WRITE8_HANDLER( iremm15_a100_w )
{
static int last = 0x00;
//int raising_bits = data & ~last;
@ -411,14 +411,14 @@ WRITE8_HANDLER( iremm15_a100_w )
last = data;
}
READ8_HANDLER( iremm10_a700_r )
static READ8_HANDLER( iremm10_a700_r )
{
//printf("rd:%d\n",video_screen_get_vpos(0));
cpunum_set_input_line(0, 0, CLEAR_LINE);
return 0x00;
}
READ8_HANDLER( iremm11_a700_r )
static READ8_HANDLER( iremm11_a700_r )
{
//printf("rd:%d\n",video_screen_get_vpos(0));
return 0x00;
@ -430,7 +430,7 @@ READ8_HANDLER( iremm11_a700_r )
*
*************************************/
TIMER_CALLBACK( skychut_callback )
static TIMER_CALLBACK( skychut_callback )
{
if (param==0)
{
@ -447,7 +447,7 @@ TIMER_CALLBACK( skychut_callback )
}
INTERRUPT_GEN( iremm11_interrupt )
static INTERRUPT_GEN( iremm11_interrupt )
{
if (readinputport(2) & 1) /* Left Coin */
cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
@ -458,7 +458,7 @@ INTERRUPT_GEN( iremm11_interrupt )
}
}
INTERRUPT_GEN( iremm10_interrupt )
static INTERRUPT_GEN( iremm10_interrupt )
{
if (readinputport(2) & 1) /* Left Coin */
cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
@ -466,7 +466,7 @@ INTERRUPT_GEN( iremm10_interrupt )
cpunum_set_input_line(0, 0, ASSERT_LINE);
}
INTERRUPT_GEN( iremm15_interrupt )
static INTERRUPT_GEN( iremm15_interrupt )
{
if (readinputport(2) & 1) /* Left Coin */
cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
@ -543,7 +543,7 @@ ADDRESS_MAP_END
PORT_BIT( 0xfc, IP_ACTIVE_HIGH, IPT_UNUSED )
INPUT_PORTS_START( skychut )
static INPUT_PORTS_START( skychut )
PORT_START
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
@ -584,7 +584,7 @@ INPUT_PORTS_START( skychut )
CAB_PORTENV
INPUT_PORTS_END
INPUT_PORTS_START( ipminvad )
static INPUT_PORTS_START( ipminvad )
PORT_START
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
@ -625,7 +625,7 @@ INPUT_PORTS_START( ipminvad )
CAB_PORTENV
INPUT_PORTS_END
INPUT_PORTS_START( spacebeam )
static INPUT_PORTS_START( spacebeam )
PORT_START
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
@ -659,7 +659,7 @@ INPUT_PORTS_START( spacebeam )
CAB_PORTENV
INPUT_PORTS_END
INPUT_PORTS_START( headoni )
static INPUT_PORTS_START( headoni )
PORT_START
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )

View File

@ -1649,7 +1649,7 @@ static int slapfigh_prot_pos;
static READ8_HANDLER( slapfigh_mcu_r )
{
/* pass initial checks */
int protvalues[] = { 0xc7, 0x55, -1 };
static const int protvalues[] = { 0xc7, 0x55, -1 };
if ((activecpu_get_pc()==0x1369) || // slapfigh
(activecpu_get_pc()==0x136d)) // slapfiga

View File

@ -148,7 +148,9 @@ UINT16 *roundup5_d0000_ram, *roundup5_e0000_ram;
UINT8 *tatsumi_rom_sprite_lookup1, *tatsumi_rom_sprite_lookup2;
UINT8 *tatsumi_rom_clut0, *tatsumi_rom_clut1;
UINT16 *roundup5_unknown0, *roundup5_unknown1, *roundup5_unknown2;
UINT16 bigfight_a20000[8], bigfight_a40000[2], bigfight_a60000[2];
static UINT16 bigfight_a20000[8];
UINT16 bigfight_a40000[2];
static UINT16 bigfight_a60000[2];
extern UINT16 bigfight_bank;
static UINT8 *apache3_bg_ram;

View File

@ -113,7 +113,7 @@ static MACHINE_RESET( uapce )
jamma_if_control_latch = 0;
};
ADDRESS_MAP_START( z80_map, ADDRESS_SPACE_PROGRAM, 8)
static ADDRESS_MAP_START( z80_map, ADDRESS_SPACE_PROGRAM, 8)
AM_RANGE( 0x0000, 0x07FF) AM_ROM
AM_RANGE( 0x0800, 0x0FFF) AM_RAM
AM_RANGE( 0x1000, 0x17FF) AM_WRITE( jamma_if_control_latch_w )

View File

@ -15,7 +15,7 @@
#include "tinv2650.lh"
WRITE8_HANDLER( tinvader_videoram_w );
WRITE8_HANDLER( tinvader_sound_w );
static WRITE8_HANDLER( tinvader_sound_w );
READ8_HANDLER( zac_s2636_r );
READ8_HANDLER( tinvader_port_0_r );
@ -343,7 +343,7 @@ static MACHINE_DRIVER_START( tinvader )
/* sound hardware */
MACHINE_DRIVER_END
WRITE8_HANDLER( tinvader_sound_w )
static WRITE8_HANDLER( tinvader_sound_w )
{
/* sounds are NOT the same as space invaders */

View File

@ -1110,7 +1110,7 @@ DRIVER_INIT( bakutotu )
#if 0
// resolves CPU deadlocks caused by sloppy coding(see driver\namcos1.c)
{
UINT8 target[8] = {0x34,0x37,0x35,0x37,0x96,0x00,0x2e,0xed};
static const UINT8 target[8] = {0x34,0x37,0x35,0x37,0x96,0x00,0x2e,0xed};
UINT8 *rombase, *srcptr, *endptr, *scanptr;
rombase = memory_region(REGION_USER1);

View File

@ -768,7 +768,7 @@ WRITE8_HANDLER( changela_colors_w )
111 | 3.819 (2.2k)
Which were normalized to produce the following table: */
UINT8 color_table[8] = { 0, 7, 18, 31, 58, 88, 146, 255 };
static const UINT8 color_table[8] = { 0, 7, 18, 31, 58, 88, 146, 255 };
int r, g, b;
UINT32 c, color_index;

View File

@ -210,7 +210,7 @@ void cvs_scroll_stars(void)
VIDEO_UPDATE( cvs )
{
const int ram_based_char_start_indecies[] = { 0xe0, 0xc0, 0x100, 0x80 };
static const int ram_based_char_start_indices[] = { 0xe0, 0xc0, 0x100, 0x80 };
int code;
offs_t offs;
int scroll[8];
@ -232,7 +232,7 @@ VIDEO_UPDATE( cvs )
character_banking_mode = cvs_get_character_banking_mode();
/* ROM based tiles first */
for (code = 0; code < ram_based_char_start_indecies[character_banking_mode]; code++)
for (code = 0; code < ram_based_char_start_indices[character_banking_mode]; code++)
decodechar(machine->gfx[0], code, memory_region(REGION_GFX1));
/* now the RAM based ones */

View File

@ -360,7 +360,7 @@ WRITE64_HANDLER( ta_fifo_yuv_w )
}
/* test video start */
UINT32 dilate0(UINT32 value,int bits) // dilate first "bits" bits in "value"
static UINT32 dilate0(UINT32 value,int bits) // dilate first "bits" bits in "value"
{
UINT32 x,m1,m2,m3;
int a;
@ -376,7 +376,7 @@ UINT32 dilate0(UINT32 value,int bits) // dilate first "bits" bits in "value"
return x;
}
UINT32 dilate1(UINT32 value,int bits) // dilate first "bits" bits in "value"
static UINT32 dilate1(UINT32 value,int bits) // dilate first "bits" bits in "value"
{
UINT32 x,m1,m2,m3;
int a;
@ -392,7 +392,7 @@ UINT32 dilate1(UINT32 value,int bits) // dilate first "bits" bits in "value"
return x;
}
void computedilated(void)
static void computedilated(void)
{
int a,b;
@ -406,7 +406,7 @@ void computedilated(void)
dilatechose[(b << 3) + a]=3+(a < b ? a : b);
}
void testdrawscreen(bitmap_t *bitmap,const rectangle *cliprect)
static void testdrawscreen(bitmap_t *bitmap,const rectangle *cliprect)
{
int cs,x,y,dx,dy,xi,yi,a;
float iu,iv,u,v;

View File

@ -145,7 +145,7 @@ void ppu2c0x_init_palette(running_machine *machine, int first_entry )
double Ku = 2.029;
double Kv = 1.140;
double brightness[3][4] =
static const double brightness[3][4] =
{
{ 0.50, 0.75, 1.0, 1.0 },
{ 0.29, 0.45, 0.73, 0.9 },

View File

@ -138,8 +138,8 @@ VIDEO_UPDATE( iremm10 )
{
irem_state *state = machine->driver_data;
int offs;
int color[4]= { 3, 3, 5, 5};
int xpos[4] = { 4*8, 26*8, 7*8, 6*8} ;
static const int color[4]= { 3, 3, 5, 5 };
static const int xpos[4] = { 4*8, 26*8, 7*8, 6*8};
int i;
fillbitmap(bitmap,machine->pens[7],cliprect);

View File

@ -12,7 +12,7 @@ UINT16 *cyclwarr_videoram0, *cyclwarr_videoram1;
UINT16* tatsumi_sprite_control_ram;
static UINT16* roundup5_vram;
extern UINT16 bigfight_a20000[8], bigfight_a40000[2], bigfight_a60000[8];
extern UINT16 bigfight_a40000[2];
static UINT16 bigfight_bank, bigfight_last_bank;
static UINT8 roundupt_crt_selected_reg;

View File

@ -89,14 +89,14 @@ WRITE8_HANDLER( tiamc1_palette_w )
PALETTE_INIT( tiamc1 )
{
// Voltage computed by Proteus
//const float g_v[8]={1.05f,0.87f,0.81f,0.62f,0.44f,0.25f,0.19f,0.00f};
//const float r_v[8]={1.37f,1.13f,1.00f,0.75f,0.63f,0.38f,0.25f,0.00f};
//const float b_v[4]={1.16f,0.75f,0.42f,0.00f};
//static const float g_v[8]={1.05f,0.87f,0.81f,0.62f,0.44f,0.25f,0.19f,0.00f};
//static const float r_v[8]={1.37f,1.13f,1.00f,0.75f,0.63f,0.38f,0.25f,0.00f};
//static const float b_v[4]={1.16f,0.75f,0.42f,0.00f};
// Voltage adjusted by Shiru
const float g_v[8] = { 1.2071f,0.9971f,0.9259f,0.7159f,0.4912f,0.2812f,0.2100f,0.0000f};
const float r_v[8] = { 1.5937f,1.3125f,1.1562f,0.8750f,0.7187f,0.4375f,0.2812f,0.0000f};
const float b_v[4] = { 1.3523f,0.8750f,0.4773f,0.0000f};
static const float g_v[8] = { 1.2071f,0.9971f,0.9259f,0.7159f,0.4912f,0.2812f,0.2100f,0.0000f};
static const float r_v[8] = { 1.5937f,1.3125f,1.1562f,0.8750f,0.7187f,0.4375f,0.2812f,0.0000f};
static const float b_v[4] = { 1.3523f,0.8750f,0.4773f,0.0000f};
int col;
int r, g, b, ir, ig, ib;