From 28d23853ae0f6d69080f4d3cb960257502d4be90 Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Wed, 26 Dec 2007 16:55:35 +0000 Subject: [PATCH] (From AtariAce) This patch should complete the addition of static qualifiers to all MAME symbols that aren't explicitly exported. It primarily handles generated code (e.g. amspdwy.c), plus a handful of cases I'd previously missed and some new cases introduced in the last update. One interesting bit was the discovery that the 32-bit scanline routines in drawgfx.c are unused. I debated eliminating them but decided instead to just export them. Various internal drawgfx functions were conditionally removed by examining a new RAW define, although one routine (blockmove_8toN_alphaone) was determined to be dead code. While investigating constifying MESS, I came across a few core APIs that were missing const qualifiers which this patch fixes. I also consted up tx1.c while I was at it. --- src/emu/cpu/f8/f3853.c | 2 +- src/emu/cpu/f8/f3853.h | 2 +- src/emu/cpu/z80gb/z80gb.h | 2 +- src/emu/drawgfx.c | 66 ++++++++++++++++++++++++++++--------- src/emu/drawgfx.h | 3 ++ src/emu/sound/sidenvel.c | 2 +- src/emu/sound/sidenvel.h | 2 +- src/emu/sound/speaker.h | 2 +- src/mame/drivers/amspdwy.c | 2 +- src/mame/drivers/galpani3.c | 2 +- src/mame/drivers/jchan.c | 2 +- src/mame/drivers/megadriv.c | 4 +-- src/mame/drivers/model2.c | 3 +- src/mame/drivers/mpu4drvr.c | 2 +- src/mame/drivers/nmk16.c | 4 --- src/mame/drivers/starwars.c | 2 +- src/mame/drivers/tx1.c | 14 ++++---- src/mame/drivers/wecleman.c | 4 +-- src/mame/includes/amiga.h | 2 +- src/mame/includes/tx1.h | 4 +-- src/mame/machine/amiga.c | 2 +- src/mame/machine/tx1.c | 2 +- src/mame/video/nmk16.c | 3 +- src/mame/video/seta.c | 2 +- src/mame/video/taito_h.c | 3 -- src/mame/video/taitoair.c | 3 -- src/mame/video/taitoic.c | 3 +- src/mame/video/tx1.c | 9 +++-- 28 files changed, 92 insertions(+), 61 deletions(-) diff --git a/src/emu/cpu/f8/f3853.c b/src/emu/cpu/f8/f3853.c index a51040446cf..949ffdf8f76 100644 --- a/src/emu/cpu/f8/f3853.c +++ b/src/emu/cpu/f8/f3853.c @@ -72,7 +72,7 @@ static TIMER_CALLBACK( f3853_timer_callback ) } -void f3853_init(F3853_CONFIG *config) +void f3853_init(const F3853_CONFIG *config) { UINT8 reg=0xfe; int i; diff --git a/src/emu/cpu/f8/f3853.h b/src/emu/cpu/f8/f3853.h index ba1b6e4273f..35e5f78a7a1 100644 --- a/src/emu/cpu/f8/f3853.h +++ b/src/emu/cpu/f8/f3853.h @@ -12,7 +12,7 @@ typedef struct { void (*interrupt_request)(UINT16 addr, int level); } F3853_CONFIG; -void f3853_init(F3853_CONFIG *config); +void f3853_init(const F3853_CONFIG *config); void f3853_reset(void); // ports 0x0c - 0x0f diff --git a/src/emu/cpu/z80gb/z80gb.h b/src/emu/cpu/z80gb/z80gb.h index 5721c4cf8aa..abbbe41df0b 100644 --- a/src/emu/cpu/z80gb/z80gb.h +++ b/src/emu/cpu/z80gb/z80gb.h @@ -4,7 +4,7 @@ #include "cpuintrf.h" typedef struct { - UINT16 *regs; + const UINT16 *regs; UINT8 features; void (*timer_callback)(int cycles); } Z80GB_CONFIG; diff --git a/src/emu/drawgfx.c b/src/emu/drawgfx.c index 43f7b184354..51aa6dee463 100644 --- a/src/emu/drawgfx.c +++ b/src/emu/drawgfx.c @@ -617,43 +617,50 @@ int pdrawgfx_shadow_lowpri = 0; int leftskip,int topskip,int flipx,int flipy, \ DATA_TYPE *dstdata,int dstwidth,int dstheight,int dstmodulo +#define RAW 1 #define COLOR_ARG unsigned int colorbase,UINT8 *pridata,UINT32 pmask #define INCREMENT_DST(n) {dstdata+=(n);pridata += (n);} #define LOOKUP(n) (colorbase + (n)) #define SETPIXELCOLOR(dest,n) { if (((1 << (pridata[dest] & 0x1f)) & pmask) == 0) { if (pridata[dest] & 0x80) { dstdata[dest] = palette_shadow_table[n];} else { dstdata[dest] = (n);} } pridata[dest] = (pridata[dest] & 0x7f) | afterdrawmask; } -#define DECLARE_SWAP_RAW_PRI(function,args,body) void function##_raw_pri8 args body +#define DECLARE_SWAP_RAW_PRI(function,args,body) static void function##_raw_pri8 args body #include "drawgfx.c" #undef DECLARE_SWAP_RAW_PRI #undef COLOR_ARG #undef LOOKUP #undef SETPIXELCOLOR +#undef RAW +#define RAW 0 #define COLOR_ARG const pen_t *paldata,UINT8 *pridata,UINT32 pmask #define LOOKUP(n) (paldata[n]) #define SETPIXELCOLOR(dest,n) { if (((1 << (pridata[dest] & 0x1f)) & pmask) == 0) { if (pridata[dest] & 0x80) { dstdata[dest] = palette_shadow_table[n];} else { dstdata[dest] = (n);} } pridata[dest] = (pridata[dest] & 0x7f) | afterdrawmask; } -#define DECLARE_SWAP_RAW_PRI(function,args,body) void function##_pri8 args body +#define DECLARE_SWAP_RAW_PRI(function,args,body) static void function##_pri8 args body #include "drawgfx.c" #undef DECLARE_SWAP_RAW_PRI #undef COLOR_ARG #undef LOOKUP #undef INCREMENT_DST #undef SETPIXELCOLOR +#undef RAW +#define RAW 1 #define COLOR_ARG unsigned int colorbase #define INCREMENT_DST(n) {dstdata+=(n);} #define LOOKUP(n) (colorbase + (n)) #define SETPIXELCOLOR(dest,n) {dstdata[dest] = (n);} -#define DECLARE_SWAP_RAW_PRI(function,args,body) void function##_raw8 args body +#define DECLARE_SWAP_RAW_PRI(function,args,body) static void function##_raw8 args body #include "drawgfx.c" #undef DECLARE_SWAP_RAW_PRI #undef COLOR_ARG #undef LOOKUP #undef SETPIXELCOLOR +#undef RAW +#define RAW 0 #define COLOR_ARG const pen_t *paldata #define LOOKUP(n) (paldata[n]) #define SETPIXELCOLOR(dest,n) {dstdata[dest] = (n);} -#define DECLARE_SWAP_RAW_PRI(function,args,body) void function##8 args body +#define DECLARE_SWAP_RAW_PRI(function,args,body) static void function##8 args body #include "drawgfx.c" #undef DECLARE_SWAP_RAW_PRI #undef COLOR_ARG @@ -667,7 +674,7 @@ int pdrawgfx_shadow_lowpri = 0; #undef DECLARE #undef DECLAREG -#define DECLARE(function,args,body) void function##8 args body +#define DECLARE(function,args,body) static void function##8 args body #define DECLAREG(function,args,body) void function##8 args body #define DECLARE_SWAP_RAW_PRI(function,args,body) #define BLOCKMOVE(function,flipx,args) \ @@ -691,6 +698,7 @@ int pdrawgfx_shadow_lowpri = 0; #undef BLOCKMOVEPRI #undef BLOCKMOVERAWPRI +#undef RAW #undef DEPTH #undef DATA_TYPE @@ -710,43 +718,50 @@ int pdrawgfx_shadow_lowpri = 0; int leftskip,int topskip,int flipx,int flipy, \ DATA_TYPE *dstdata,int dstwidth,int dstheight,int dstmodulo +#define RAW 1 #define COLOR_ARG unsigned int colorbase,UINT8 *pridata,UINT32 pmask #define INCREMENT_DST(n) {dstdata+=(n);pridata += (n);} #define LOOKUP(n) (colorbase + (n)) #define SETPIXELCOLOR(dest,n) { if (((1 << (pridata[dest] & 0x1f)) & pmask) == 0) { if (pridata[dest] & 0x80) { dstdata[dest] = palette_shadow_table[n];} else { dstdata[dest] = (n);} } pridata[dest] = (pridata[dest] & 0x7f) | afterdrawmask; } -#define DECLARE_SWAP_RAW_PRI(function,args,body) void function##_raw_pri16 args body +#define DECLARE_SWAP_RAW_PRI(function,args,body) static void function##_raw_pri16 args body #include "drawgfx.c" #undef DECLARE_SWAP_RAW_PRI #undef COLOR_ARG #undef LOOKUP #undef SETPIXELCOLOR +#undef RAW +#define RAW 0 #define COLOR_ARG const pen_t *paldata,UINT8 *pridata,UINT32 pmask #define LOOKUP(n) (paldata[n]) #define SETPIXELCOLOR(dest,n) { if (((1 << (pridata[dest] & 0x1f)) & pmask) == 0) { if (pridata[dest] & 0x80) { dstdata[dest] = palette_shadow_table[n];} else { dstdata[dest] = (n);} } pridata[dest] = (pridata[dest] & 0x7f) | afterdrawmask; } -#define DECLARE_SWAP_RAW_PRI(function,args,body) void function##_pri16 args body +#define DECLARE_SWAP_RAW_PRI(function,args,body) static void function##_pri16 args body #include "drawgfx.c" #undef DECLARE_SWAP_RAW_PRI #undef COLOR_ARG #undef LOOKUP #undef INCREMENT_DST #undef SETPIXELCOLOR +#undef RAW +#define RAW 1 #define COLOR_ARG unsigned int colorbase #define INCREMENT_DST(n) {dstdata+=(n);} #define LOOKUP(n) (colorbase + (n)) #define SETPIXELCOLOR(dest,n) {dstdata[dest] = (n);} -#define DECLARE_SWAP_RAW_PRI(function,args,body) void function##_raw16 args body +#define DECLARE_SWAP_RAW_PRI(function,args,body) static void function##_raw16 args body #include "drawgfx.c" #undef DECLARE_SWAP_RAW_PRI #undef COLOR_ARG #undef LOOKUP #undef SETPIXELCOLOR +#undef RAW +#define RAW 0 #define COLOR_ARG const pen_t *paldata #define LOOKUP(n) (paldata[n]) #define SETPIXELCOLOR(dest,n) {dstdata[dest] = (n);} -#define DECLARE_SWAP_RAW_PRI(function,args,body) void function##16 args body +#define DECLARE_SWAP_RAW_PRI(function,args,body) static void function##16 args body #include "drawgfx.c" #undef DECLARE_SWAP_RAW_PRI #undef COLOR_ARG @@ -760,7 +775,7 @@ int pdrawgfx_shadow_lowpri = 0; #undef DECLARE #undef DECLAREG -#define DECLARE(function,args,body) void function##16 args body +#define DECLARE(function,args,body) static void function##16 args body #define DECLAREG(function,args,body) void function##16 args body #define DECLARE_SWAP_RAW_PRI(function,args,body) #define BLOCKMOVE(function,flipx,args) \ @@ -784,6 +799,7 @@ int pdrawgfx_shadow_lowpri = 0; #undef BLOCKMOVEPRI #undef BLOCKMOVERAWPRI +#undef RAW #undef DEPTH #undef DATA_TYPE #undef alpha_blend_r @@ -810,43 +826,50 @@ INLINE UINT32 SHADOW32(pen_t *shadow_table, UINT32 c) { int leftskip,int topskip,int flipx,int flipy, \ DATA_TYPE *dstdata,int dstwidth,int dstheight,int dstmodulo +#define RAW 1 #define COLOR_ARG unsigned int colorbase,UINT8 *pridata,UINT32 pmask #define INCREMENT_DST(n) {dstdata+=(n);pridata += (n);} #define LOOKUP(n) (colorbase + (n)) #define SETPIXELCOLOR(dest,n) { UINT8 r8=pridata[dest]; if(!(1<<(r8&0x1f)&pmask)){ if(afterdrawmask){ r8&=0x7f; r8|=0x1f; dstdata[dest]=(n); pridata[dest]=r8; } else if(!(r8&0x80)){ dstdata[dest]=SHADOW32(palette_shadow_table,n); pridata[dest]|=0x80; } } } -#define DECLARE_SWAP_RAW_PRI(function,args,body) void function##_raw_pri32 args body +#define DECLARE_SWAP_RAW_PRI(function,args,body) static void function##_raw_pri32 args body #include "drawgfx.c" #undef DECLARE_SWAP_RAW_PRI #undef COLOR_ARG #undef LOOKUP #undef SETPIXELCOLOR +#undef RAW +#define RAW 0 #define COLOR_ARG const pen_t *paldata,UINT8 *pridata,UINT32 pmask #define LOOKUP(n) (paldata[n]) #define SETPIXELCOLOR(dest,n) { UINT8 r8=pridata[dest]; if(!(1<<(r8&0x1f)&pmask)){ if(afterdrawmask){ r8&=0x7f; r8|=0x1f; dstdata[dest]=(n); pridata[dest]=r8; } else if(!(r8&0x80)){ dstdata[dest]=SHADOW32(palette_shadow_table,n); pridata[dest]|=0x80; } } } -#define DECLARE_SWAP_RAW_PRI(function,args,body) void function##_pri32 args body +#define DECLARE_SWAP_RAW_PRI(function,args,body) static void function##_pri32 args body #include "drawgfx.c" #undef DECLARE_SWAP_RAW_PRI #undef COLOR_ARG #undef LOOKUP #undef INCREMENT_DST #undef SETPIXELCOLOR +#undef RAW +#define RAW 1 #define COLOR_ARG unsigned int colorbase #define INCREMENT_DST(n) {dstdata+=(n);} #define LOOKUP(n) (colorbase + (n)) #define SETPIXELCOLOR(dest,n) {dstdata[dest] = (n);} -#define DECLARE_SWAP_RAW_PRI(function,args,body) void function##_raw32 args body +#define DECLARE_SWAP_RAW_PRI(function,args,body) static void function##_raw32 args body #include "drawgfx.c" #undef DECLARE_SWAP_RAW_PRI #undef COLOR_ARG #undef LOOKUP #undef SETPIXELCOLOR +#undef RAW +#define RAW 0 #define COLOR_ARG const pen_t *paldata #define LOOKUP(n) (paldata[n]) #define SETPIXELCOLOR(dest,n) {dstdata[dest] = (n);} -#define DECLARE_SWAP_RAW_PRI(function,args,body) void function##32 args body +#define DECLARE_SWAP_RAW_PRI(function,args,body) static void function##32 args body #include "drawgfx.c" #undef DECLARE_SWAP_RAW_PRI #undef COLOR_ARG @@ -860,7 +883,7 @@ INLINE UINT32 SHADOW32(pen_t *shadow_table, UINT32 c) { #undef DECLARE #undef DECLAREG -#define DECLARE(function,args,body) void function##32 args body +#define DECLARE(function,args,body) static void function##32 args body #define DECLAREG(function,args,body) void function##32 args body #define DECLARE_SWAP_RAW_PRI(function,args,body) #define BLOCKMOVE(function,flipx,args) \ @@ -884,6 +907,7 @@ INLINE UINT32 SHADOW32(pen_t *shadow_table, UINT32 c) { #undef BLOCKMOVEPRI #undef BLOCKMOVERAWPRI +#undef RAW #undef DEPTH #undef DATA_TYPE #undef alpha_blend_r @@ -3755,6 +3779,7 @@ DECLARE_SWAP_RAW_PRI(blockmove_4toN_transpen,(COMMON_ARGS, } }) +#if (RAW == 1) DECLARE_SWAP_RAW_PRI(blockmove_8toN_transblend,(COMMON_ARGS, COLOR_ARG,int transpen), { @@ -3866,6 +3891,7 @@ DECLARE_SWAP_RAW_PRI(blockmove_8toN_transblend,(COMMON_ARGS, } } }) +#endif #define PEN_IS_OPAQUE ((1<= 16 +#if (1 == 0) DECLARE_SWAP_RAW_PRI(blockmove_8toN_alphaone,(COMMON_ARGS, COLOR_ARG,int transpen, int alphapen), { @@ -4446,7 +4475,9 @@ DECLARE_SWAP_RAW_PRI(blockmove_8toN_alphaone,(COMMON_ARGS, } } }) +#endif +#if (RAW == 0) DECLARE_SWAP_RAW_PRI(blockmove_8toN_alpha,(COMMON_ARGS, COLOR_ARG,int transpen), { @@ -4623,17 +4654,22 @@ DECLARE_SWAP_RAW_PRI(blockmove_8toN_alpharange,(COMMON_ARGS, } } }) +#endif #else +#if (1 == 0) DECLARE_SWAP_RAW_PRI(blockmove_8toN_alphaone,(COMMON_ARGS, COLOR_ARG,int transpen, int alphapen),{}) +#endif +#if (RAW == 0) DECLARE_SWAP_RAW_PRI(blockmove_8toN_alpha,(COMMON_ARGS, COLOR_ARG,int transpen),{}) DECLARE_SWAP_RAW_PRI(blockmove_8toN_alpharange,(COMMON_ARGS, COLOR_ARG,int transpen),{}) +#endif #endif diff --git a/src/emu/drawgfx.h b/src/emu/drawgfx.h index 513b7b289df..9f99b6ca1b8 100644 --- a/src/emu/drawgfx.h +++ b/src/emu/drawgfx.h @@ -227,10 +227,13 @@ void mdrawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx, void draw_scanline8(mame_bitmap *bitmap,int x,int y,int length,const UINT8 *src,const pen_t *pens,int transparent_pen); void draw_scanline16(mame_bitmap *bitmap,int x,int y,int length,const UINT16 *src,const pen_t *pens,int transparent_pen); +void draw_scanline32(mame_bitmap *bitmap,int x,int y,int length,const UINT32 *src,const pen_t *pens,int transparent_pen); void pdraw_scanline8(mame_bitmap *bitmap,int x,int y,int length,const UINT8 *src,const pen_t *pens,int transparent_pen,int pri); void pdraw_scanline16(mame_bitmap *bitmap,int x,int y,int length,const UINT16 *src,const pen_t *pens,int transparent_pen,int pri); +void pdraw_scanline32(mame_bitmap *bitmap,int x,int y,int length,const UINT32 *src,const pen_t *pens,int transparent_pen,int pri); void extract_scanline8(mame_bitmap *bitmap,int x,int y,int length,UINT8 *dst); void extract_scanline16(mame_bitmap *bitmap,int x,int y,int length,UINT16 *dst); +void extract_scanline32(mame_bitmap *bitmap,int x,int y,int length,UINT32 *dst); void copybitmap(mame_bitmap *dest,mame_bitmap *src,int flipx,int flipy,int sx,int sy, diff --git a/src/emu/sound/sidenvel.c b/src/emu/sound/sidenvel.c index bb90d31829e..83a9f774d0b 100644 --- a/src/emu/sound/sidenvel.c +++ b/src/emu/sound/sidenvel.c @@ -214,7 +214,7 @@ INLINE UINT16 enveEmuAlterShortAttack(sidOperator*); INLINE UINT16 enveEmuShortAttack(sidOperator*); -ptr2sidUwordFunc enveModeTable[] = +const ptr2sidUwordFunc enveModeTable[] = { /* 0 */ &enveEmuStartAttack, &enveEmuStartRelease, diff --git a/src/emu/sound/sidenvel.h b/src/emu/sound/sidenvel.h index 8f0c83a1465..a609770cb79 100644 --- a/src/emu/sound/sidenvel.h +++ b/src/emu/sound/sidenvel.h @@ -10,7 +10,7 @@ extern void enveEmuInit(UINT32 updateFreq, int measuredValues); void enveEmuResetOperator(sidOperator* pVoice); -extern ptr2sidUwordFunc enveModeTable[]; // -> envelope.cpp +extern const ptr2sidUwordFunc enveModeTable[]; // -> envelope.cpp extern const UINT8 masterVolumeLevels[16]; // -> envelope.cpp static const UINT8 ENVE_STARTATTACK = 0; diff --git a/src/emu/sound/speaker.h b/src/emu/sound/speaker.h index ae89881bb80..7a2e5fef8f8 100644 --- a/src/emu/sound/speaker.h +++ b/src/emu/sound/speaker.h @@ -15,7 +15,7 @@ extern "C" { struct Speaker_interface { int num_level; /* optional: number of levels (if not two) */ - INT16 *levels; /* optional: pointer to level lookup table */ + const INT16 *levels; /* optional: pointer to level lookup table */ }; void speaker_level_w (int which, int new_level); diff --git a/src/mame/drivers/amspdwy.c b/src/mame/drivers/amspdwy.c index f2011d28afb..0fd5a68759e 100644 --- a/src/mame/drivers/amspdwy.c +++ b/src/mame/drivers/amspdwy.c @@ -43,7 +43,7 @@ VIDEO_UPDATE( amspdwy ); Or last value when wheel delta = 0 */ #define AMSPDWY_WHEEL_R( _n_ ) \ -READ8_HANDLER( amspdwy_wheel_##_n_##_r ) \ +static READ8_HANDLER( amspdwy_wheel_##_n_##_r ) \ { \ static UINT8 wheel_old, ret; \ UINT8 wheel = readinputport(5 + _n_); \ diff --git a/src/mame/drivers/galpani3.c b/src/mame/drivers/galpani3.c index 27ef6635508..730c05d0b95 100644 --- a/src/mame/drivers/galpani3.c +++ b/src/mame/drivers/galpani3.c @@ -286,7 +286,7 @@ static void galpani3_mcu_run(void) * com2=com3=0xFFFF -> status reading only */ #define GALPANI3_MCU_COM_W(_n_) \ -WRITE16_HANDLER( galpani3_mcu_com##_n_##_w ) \ +static WRITE16_HANDLER( galpani3_mcu_com##_n_##_w ) \ { \ COMBINE_DATA(&galpani3_mcu_com[_n_]); \ if (galpani3_mcu_com[0] != 0xFFFF) return; \ diff --git a/src/mame/drivers/jchan.c b/src/mame/drivers/jchan.c index 7f448ec33f1..10717859c4f 100644 --- a/src/mame/drivers/jchan.c +++ b/src/mame/drivers/jchan.c @@ -367,7 +367,7 @@ are loaded in RAM then saved with cmd 0x42 (see code @ $5196 & $50d4) } #define JCHAN_MCU_COM_W(_n_) \ -WRITE16_HANDLER( jchan_mcu_com##_n_##_w ) \ +static WRITE16_HANDLER( jchan_mcu_com##_n_##_w ) \ { \ COMBINE_DATA(&jchan_mcu_com[_n_]); \ if (jchan_mcu_com[0] != 0xFFFF) return; \ diff --git a/src/mame/drivers/megadriv.c b/src/mame/drivers/megadriv.c index 3fb0dd2d6a9..9d546043af1 100644 --- a/src/mame/drivers/megadriv.c +++ b/src/mame/drivers/megadriv.c @@ -1435,8 +1435,8 @@ static void init_megadri6_io(void) } /* pointers to our io data read/write functions */ -UINT8 (*megadrive_io_read_data_port_ptr)(int offset); -void (*megadrive_io_write_data_port_ptr)(int offset, UINT16 data); +static UINT8 (*megadrive_io_read_data_port_ptr)(int offset); +static void (*megadrive_io_write_data_port_ptr)(int offset, UINT16 data); INPUT_PORTS_START( megadri6 ) PORT_START /* Joypad 1 (6 button + start + mode) NOT READ DIRECTLY */ PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) diff --git a/src/mame/drivers/model2.c b/src/mame/drivers/model2.c index 8ae4881ea52..5e5fc011edf 100644 --- a/src/mame/drivers/model2.c +++ b/src/mame/drivers/model2.c @@ -64,7 +64,8 @@ extern VIDEO_UPDATE(model2); extern void model2_3d_set_zclip( UINT8 clip ); -UINT32 *model2_bufferram, *model2_colorxlat, *model2_workram, *model2_backup1, *model2_backup2; +UINT32 *model2_bufferram, *model2_colorxlat; +static UINT32 *model2_workram, *model2_backup1, *model2_backup2; UINT32 *model2_textureram0, *model2_textureram1, *model2_lumaram; static UINT32 model2_intreq; static UINT32 model2_intena; diff --git a/src/mame/drivers/mpu4drvr.c b/src/mame/drivers/mpu4drvr.c index 6d870b695cf..391ff4ee3a7 100644 --- a/src/mame/drivers/mpu4drvr.c +++ b/src/mame/drivers/mpu4drvr.c @@ -1463,7 +1463,7 @@ static GFXDECODE_START( dealem ) GFXDECODE_ENTRY( REGION_GFX1, 0x0000, dealemcharlayout, 0, 32 ) GFXDECODE_END -UINT8 *dealem_videoram,*dealem_charram; +UINT8 *dealem_videoram; /*************************************************************************** diff --git a/src/mame/drivers/nmk16.c b/src/mame/drivers/nmk16.c index 88dc5770e3d..5ab72de070d 100644 --- a/src/mame/drivers/nmk16.c +++ b/src/mame/drivers/nmk16.c @@ -4737,10 +4737,6 @@ static DRIVER_INIT( ssmissin ) decode_ssmissin(); } - -int is_blkheart; - - static DRIVER_INIT( bjtwin ) { driver_init_nmk(machine); diff --git a/src/mame/drivers/starwars.c b/src/mame/drivers/starwars.c index 0ae21542162..27a179d8577 100644 --- a/src/mame/drivers/starwars.c +++ b/src/mame/drivers/starwars.c @@ -123,7 +123,7 @@ static WRITE8_HANDLER( esb_slapstic_w ) * *************************************/ -OPBASE_HANDLER( esb_setopbase ) +static OPBASE_HANDLER( esb_setopbase ) { int prevpc = activecpu_get_previouspc(); diff --git a/src/mame/drivers/tx1.c b/src/mame/drivers/tx1.c index 3267615513b..198a96f4551 100644 --- a/src/mame/drivers/tx1.c +++ b/src/mame/drivers/tx1.c @@ -579,7 +579,7 @@ GFXDECODE_END * *************************************/ -static struct AY8910interface tx1_ay8910_interface = +static const struct AY8910interface tx1_ay8910_interface = { /* TODO */ 0, @@ -590,7 +590,7 @@ static struct AY8910interface tx1_ay8910_interface = /* YM2149 IC19 */ -static struct AY8910interface buggyboy_ym2149_interface_1 = +static const struct AY8910interface buggyboy_ym2149_interface_1 = { input_port_1_r, input_port_2_r, @@ -599,7 +599,7 @@ static struct AY8910interface buggyboy_ym2149_interface_1 = }; /* YM2149 IC24 */ -static struct AY8910interface buggyboy_ym2149_interface_2 = +static const struct AY8910interface buggyboy_ym2149_interface_2 = { 0, 0, @@ -613,7 +613,7 @@ static WRITE8_HANDLER( tx1_coin_cnt ) coin_counter_w(1, data & 0x40); } -ppi8255_interface tx1_ppi8255_intf = +const ppi8255_interface tx1_ppi8255_intf = { 1, { tx1_ppi_porta_r }, /* Accelerator and brake */ @@ -624,7 +624,7 @@ ppi8255_interface tx1_ppi8255_intf = { tx1_coin_cnt }, }; -static struct CustomSound_interface tx1_custom_interface = +static const struct CustomSound_interface tx1_custom_interface = { tx1_sh_start, NULL, @@ -632,7 +632,7 @@ static struct CustomSound_interface tx1_custom_interface = }; /* Buggy Boy uses an 8255 PPI instead of YM2149 ports for inputs! */ -ppi8255_interface buggyboy_ppi8255_intf = +const ppi8255_interface buggyboy_ppi8255_intf = { 1, { input_port_1_r }, @@ -643,7 +643,7 @@ ppi8255_interface buggyboy_ppi8255_intf = { 0 }, }; -static struct CustomSound_interface bb_custom_interface = +static const struct CustomSound_interface bb_custom_interface = { buggyboy_sh_start, NULL, diff --git a/src/mame/drivers/wecleman.c b/src/mame/drivers/wecleman.c index 54f2ebde2a5..d2f467720f0 100644 --- a/src/mame/drivers/wecleman.c +++ b/src/mame/drivers/wecleman.c @@ -788,11 +788,11 @@ static WRITE8_HANDLER( hotchase_sound_control_w ) /* Read and write handlers for one K007232 chip: even and odd register are mapped swapped */ #define HOTCHASE_K007232_RW(_chip_) \ -READ8_HANDLER( hotchase_K007232_##_chip_##_r ) \ +static READ8_HANDLER( hotchase_K007232_##_chip_##_r ) \ { \ return K007232_read_port_##_chip_##_r(offset ^ 1); \ } \ -WRITE8_HANDLER( hotchase_K007232_##_chip_##_w ) \ +static WRITE8_HANDLER( hotchase_K007232_##_chip_##_w ) \ { \ K007232_write_port_##_chip_##_w(offset ^ 1, data); \ } \ diff --git a/src/mame/includes/amiga.h b/src/mame/includes/amiga.h index d0c26ffb5a6..3d3121dba95 100644 --- a/src/mame/includes/amiga.h +++ b/src/mame/includes/amiga.h @@ -390,7 +390,7 @@ WRITE16_HANDLER( amiga_custom_w ); void amiga_serial_in_w(UINT16 data); attotime amiga_get_serial_char_period(void); -void amiga_add_autoconfig(amiga_autoconfig_device *device); +void amiga_add_autoconfig(const amiga_autoconfig_device *device); READ16_HANDLER( amiga_autoconfig_r ); WRITE16_HANDLER( amiga_autoconfig_w ); diff --git a/src/mame/includes/tx1.h b/src/mame/includes/tx1.h index b027bdf724f..f7927cb43a5 100644 --- a/src/mame/includes/tx1.h +++ b/src/mame/includes/tx1.h @@ -29,8 +29,8 @@ /*----------- defined in drivers/tx1.c -----------*/ extern UINT16 *tx1_math_ram; -extern ppi8255_interface tx1_ppi8255_intf; -extern ppi8255_interface buggyboy_ppi8255_intf; +extern const ppi8255_interface tx1_ppi8255_intf; +extern const ppi8255_interface buggyboy_ppi8255_intf; /*----------- defined in machine/tx1.c -----------*/ READ16_HANDLER( tx1_spcs_rom_r ); diff --git a/src/mame/machine/amiga.c b/src/mame/machine/amiga.c index 0be6e7d78cf..e1979afdd15 100644 --- a/src/mame/machine/amiga.c +++ b/src/mame/machine/amiga.c @@ -1529,7 +1529,7 @@ attotime amiga_get_serial_char_period(void) * *************************************/ -void amiga_add_autoconfig(amiga_autoconfig_device *device) +void amiga_add_autoconfig(const amiga_autoconfig_device *device) { autoconfig_device *dev, **d; diff --git a/src/mame/machine/tx1.c b/src/mame/machine/tx1.c index 5421bb54853..f1e59ec4348 100644 --- a/src/mame/machine/tx1.c +++ b/src/mame/machine/tx1.c @@ -229,7 +229,7 @@ static void sn_divide(void) SN74S516.ZWfl = 0; } -void sn74s516_update(const int ins) +static void sn74s516_update(const int ins) { SN74S516.state = state_table[SN74S516.state][ins]; diff --git a/src/mame/video/nmk16.c b/src/mame/video/nmk16.c index ef76200fd58..df6166ef5a1 100644 --- a/src/mame/video/nmk16.c +++ b/src/mame/video/nmk16.c @@ -12,7 +12,6 @@ UINT16 *nmk_bgvideoram,*nmk_fgvideoram,*nmk_txvideoram; UINT16 *gunnail_scrollram; static UINT16 gunnail_scrolly; -UINT16 tharrier_scroll; static int redraw_bitmap; @@ -871,6 +870,7 @@ UINT16 *afega_vram_1, *afega_scroll_1; ***************************************************************************/ +#ifdef UNUSED_FUNCTION WRITE16_HANDLER( afega_palette_w ) { int r,g,b; @@ -880,6 +880,7 @@ WRITE16_HANDLER( afega_palette_w ) r = ((data & 0xF000) >> 11) + ((data & 0x0008) >> 3); palette_set_color_rgb( Machine, offset, pal5bit(r) , pal5bit(g) , pal5bit(b) ); } +#endif /* This game uses 8 bit tiles, so it ignores the color codes and just uses the same 256 colors for every tile */ diff --git a/src/mame/video/seta.c b/src/mame/video/seta.c index 835870d841e..ecd30613ada 100644 --- a/src/mame/video/seta.c +++ b/src/mame/video/seta.c @@ -150,7 +150,7 @@ static int tilemaps_flip; int seta_tiles_offset; UINT16 *seta_vram_0, *seta_vctrl_0; -UINT16 *seta_vram_2, *seta_vram_3, *seta_vctrl_2; +UINT16 *seta_vram_2, *seta_vctrl_2; UINT16 *seta_vregs; UINT16 *seta_workram; // Used for zombraid crosshair hack diff --git a/src/mame/video/taito_h.c b/src/mame/video/taito_h.c index aa3f18d12f0..1c90da5306d 100644 --- a/src/mame/video/taito_h.c +++ b/src/mame/video/taito_h.c @@ -55,9 +55,6 @@ extern UINT16 *TC0080VCO_spriteram; extern UINT16 *TC0080VCO_scroll_ram; extern int TC0080VCO_flipscreen; -/* Needed in the sprite palette color marking */ -extern int TC0080VCO_has_tx; - /* These are hand-tuned values */ static const int zoomy_conv_table[] = { diff --git a/src/mame/video/taitoair.c b/src/mame/video/taitoair.c index 628b8be1a3e..d8912d76d23 100644 --- a/src/mame/video/taitoair.c +++ b/src/mame/video/taitoair.c @@ -55,9 +55,6 @@ extern UINT16 *TC0080VCO_spriteram; extern UINT16 *TC0080VCO_scroll_ram; extern int TC0080VCO_flipscreen; -/* Needed in the sprite palette color marking */ -extern int TC0080VCO_has_tx; - /* These are hand-tuned values */ static const int zoomy_conv_table[] = { diff --git a/src/mame/video/taitoic.c b/src/mame/video/taitoic.c index d44e223c925..17b9adf89af 100644 --- a/src/mame/video/taitoic.c +++ b/src/mame/video/taitoic.c @@ -1367,7 +1367,8 @@ static int TC0080VCO_bg_gfx,TC0080VCO_tx_gfx; static int TC0080VCO_bg_xoffs,TC0080VCO_bg_yoffs; static int TC0080VCO_bg_flip_yoffs; -INT32 TC0080VCO_flipscreen = 0,TC0080VCO_has_tx; +INT32 TC0080VCO_flipscreen = 0; +static int TC0080VCO_has_tx; #if 0 diff --git a/src/mame/video/tx1.c b/src/mame/video/tx1.c index bd4ebf0f390..e1d9abe029b 100644 --- a/src/mame/video/tx1.c +++ b/src/mame/video/tx1.c @@ -582,12 +582,11 @@ UINT16 *buggybjr_vram; size_t buggyboy_objram_size; size_t buggyboy_rcram_size; -tilemap *buggybjr_tilemap; -tilemap *buggyboy_tilemap; +static tilemap *buggyboy_tilemap; -UINT8 *chr_bmp; -UINT8 *obj_bmp; -UINT8 *rod_bmp; +static UINT8 *chr_bmp; +static UINT8 *obj_bmp; +static UINT8 *rod_bmp; /***************************************************************************