summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2007-12-17 16:41:39 +0000
committer Aaron Giles <aaron@aarongiles.com>2007-12-17 16:41:39 +0000
commit507ca2d27520118151a2556d96b9a15aac768876 (patch)
tree46bb2585f4114b1dfc157c3bfe60238d23877e7a /src/emu
parentdf34329a478833efbd542a424ce1813a11214d4a (diff)
Changes for MAME 0.121u4.mame0121u4
Diffstat (limited to 'src/emu')
-rw-r--r--src/emu/cheat.c48
-rw-r--r--src/emu/cpu/adsp2100/2100ops.c12
-rw-r--r--src/emu/cpu/asap/asap.c4
-rw-r--r--src/emu/cpu/h6280/tblh6280.c2
-rw-r--r--src/emu/cpu/hd6309/6309dasm.c2
-rw-r--r--src/emu/cpu/hd6309/6309ops.c2
-rw-r--r--src/emu/cpu/i86/ea.h2
-rw-r--r--src/emu/cpu/konami/konamtbl.c8
-rw-r--r--src/emu/cpu/m37710/m37710.c4
-rw-r--r--src/emu/cpu/m6502/t65c02.c2
-rw-r--r--src/emu/cpu/m68000/m68kcpu.c2
-rw-r--r--src/emu/cpu/m68000/m68kmame.c14
-rw-r--r--src/emu/cpu/m6805/m6805.c2
-rw-r--r--src/emu/cpu/m6809/6809dasm.c2
-rw-r--r--src/emu/cpu/m6809/6809tbl.c2
-rw-r--r--src/emu/cpu/mips/psx.c6
-rw-r--r--src/emu/cpu/nec/necea.h2
-rw-r--r--src/emu/cpu/nec/necinstr.h2
-rw-r--r--src/emu/cpu/pic16c5x/pic16c5x.c14
-rw-r--r--src/emu/cpu/powerpc/ppcdrc.c2
-rw-r--r--src/emu/cpu/saturn/saturnds.c2
-rw-r--r--src/emu/cpu/sharc/sharcdsm.c2
-rw-r--r--src/emu/cpu/sharc/sharcops.h2
-rw-r--r--src/emu/cpu/tms32010/tms32010.c4
-rw-r--r--src/emu/cpu/tms32025/tms32025.c6
-rw-r--r--src/emu/cpu/tms34010/tms34010.c2
-rw-r--r--src/emu/cpu/tms7000/tms70tb.c4
-rw-r--r--src/emu/cpu/v30mz/necea.h2
-rw-r--r--src/emu/cpu/v30mz/necinstr.h2
-rw-r--r--src/emu/cpu/v60/v60mem.c4
-rw-r--r--src/emu/cpu/z8000/z8000.c14
-rw-r--r--src/emu/cpuexec.h2
-rw-r--r--src/emu/cpuint.c2
-rw-r--r--src/emu/cpuint.h2
-rw-r--r--src/emu/debug/debugcmd.c4
-rw-r--r--src/emu/debug/debugcpu.c4
-rw-r--r--src/emu/debug/debughlp.c4
-rw-r--r--src/emu/debug/express.c6
-rw-r--r--src/emu/drawgfx.c2
-rw-r--r--src/emu/driver.h11
-rw-r--r--src/emu/emuopts.c1
-rw-r--r--src/emu/emuopts.h1
-rw-r--r--src/emu/hash.c2
-rw-r--r--src/emu/inptport.c10
-rw-r--r--src/emu/inptport.h4
-rw-r--r--src/emu/input.c8
-rw-r--r--src/emu/input.h6
-rw-r--r--src/emu/machine/53c810.c8
-rw-r--r--src/emu/machine/53c810.h4
-rw-r--r--src/emu/machine/6840ptm.c2
-rw-r--r--src/emu/machine/am53cf96.c4
-rw-r--r--src/emu/machine/am53cf96.h4
-rw-r--r--src/emu/machine/cr589.c4
-rw-r--r--src/emu/machine/cr589.h2
-rw-r--r--src/emu/machine/ds2401.c11
-rw-r--r--src/emu/machine/ds2401.h2
-rw-r--r--src/emu/machine/idectrl.c14
-rw-r--r--src/emu/machine/idectrl.h8
-rw-r--r--src/emu/machine/laserdsc.c2
-rw-r--r--src/emu/machine/laserdsc.h2
-rw-r--r--src/emu/machine/mb87078.c4
-rw-r--r--src/emu/machine/roc10937.c2
-rw-r--r--src/emu/machine/rp5h01.c4
-rw-r--r--src/emu/machine/rp5h01.h2
-rw-r--r--src/emu/machine/scsi.c12
-rw-r--r--src/emu/machine/scsi.h18
-rw-r--r--src/emu/machine/scsicd.c2
-rw-r--r--src/emu/machine/scsicd.h2
-rw-r--r--src/emu/machine/scsidev.c2
-rw-r--r--src/emu/machine/scsidev.h2
-rw-r--r--src/emu/machine/scsihd.c2
-rw-r--r--src/emu/machine/scsihd.h2
-rw-r--r--src/emu/machine/smc91c9x.c4
-rw-r--r--src/emu/machine/smc91c9x.h2
-rw-r--r--src/emu/machine/wd33c93.c6
-rw-r--r--src/emu/machine/wd33c93.h4
-rw-r--r--src/emu/machine/z80pio.c2
-rw-r--r--src/emu/machine/z80pio.h2
-rw-r--r--src/emu/mame.c4
-rw-r--r--src/emu/mame.h4
-rw-r--r--src/emu/mamecore.c2
-rw-r--r--src/emu/memory.c8
-rw-r--r--src/emu/memory.h4
-rw-r--r--src/emu/profiler.c2
-rw-r--r--src/emu/rendlay.c2
-rw-r--r--src/emu/sound/c140.c2
-rw-r--r--src/emu/sound/c6280.c2
-rw-r--r--src/emu/sound/discrete.c2
-rw-r--r--src/emu/sound/es5503.c8
-rw-r--r--src/emu/sound/flt_rc.c2
-rw-r--r--src/emu/sound/flt_rc.h2
-rw-r--r--src/emu/sound/fm.c14
-rw-r--r--src/emu/sound/k007232.c4
-rw-r--r--src/emu/sound/k053260.c2
-rw-r--r--src/emu/sound/k054539.c4
-rw-r--r--src/emu/sound/msm5232.c4
-rw-r--r--src/emu/sound/multipcm.c4
-rw-r--r--src/emu/sound/okim6295.c2
-rw-r--r--src/emu/sound/s14001a.c2
-rw-r--r--src/emu/sound/scsp.c29
-rw-r--r--src/emu/sound/scspdsp.c52
-rw-r--r--src/emu/sound/scsplfo.c8
-rw-r--r--src/emu/sound/side6581.h2
-rw-r--r--src/emu/sound/sidenvel.c4
-rw-r--r--src/emu/sound/sidw6581.h8
-rw-r--r--src/emu/sound/sidw8580.h8
-rw-r--r--src/emu/sound/sn76477.c2
-rw-r--r--src/emu/sound/sp0256.c2
-rw-r--r--src/emu/sound/speaker.c4
-rw-r--r--src/emu/sound/tms3615.c2
-rw-r--r--src/emu/sound/tms36xx.c2
-rw-r--r--src/emu/sound/tms5110.c2
-rw-r--r--src/emu/sound/tms5220r.c4
-rw-r--r--src/emu/sound/vlm5030.c2
-rw-r--r--src/emu/sound/ym2151.c14
-rw-r--r--src/emu/sound/ym2413.c2
-rw-r--r--src/emu/sound/ymdeltat.c2
-rw-r--r--src/emu/sound/ymz280b.c2
-rw-r--r--src/emu/state.c2
-rw-r--r--src/emu/ui.c5
-rw-r--r--src/emu/uimenu.c4
-rw-r--r--src/emu/uitext.c4
-rw-r--r--src/emu/validity.c2
-rw-r--r--src/emu/video.c13
-rw-r--r--src/emu/video/rgbutil.h2
-rw-r--r--src/emu/video/s2636.c2
-rw-r--r--src/emu/video/tms34061.c4
-rw-r--r--src/emu/video/tms34061.h2
-rw-r--r--src/emu/video/tms9928a.c4
-rw-r--r--src/emu/video/v9938.c30
-rw-r--r--src/emu/video/vooddefs.h10
131 files changed, 371 insertions, 332 deletions
diff --git a/src/emu/cheat.c b/src/emu/cheat.c
index 599f4d2d250..d4c89b4389e 100644
--- a/src/emu/cheat.c
+++ b/src/emu/cheat.c
@@ -563,7 +563,7 @@ static INT32 menuItemInfoLength = 0;
static UINT32 cheatOptions = 2;
-static const char * kCheatNameTemplates[] =
+static const char *const kCheatNameTemplates[] =
{
"Infinite Credits",
"Infinite Time",
@@ -724,14 +724,14 @@ static const UINT32 kPrefillValueTable[] =
0x01
};
-static const char * kWatchLabelStringList[] =
+static const char *const kWatchLabelStringList[] =
{
"None",
"Address",
"String"
};
-static const char * kWatchDisplayTypeStringList[] =
+static const char *const kWatchDisplayTypeStringList[] =
{
"Hex",
"Decimal",
@@ -2827,7 +2827,7 @@ static int AddEditCheatMenu(int selection)
static int EditCheatMenu(CheatEntry * entry, int index, int selection)
{
- static const char * kTypeNames[] =
+ static const char *const kTypeNames[] =
{
"Normal/Delay",
"Wait",
@@ -2837,7 +2837,7 @@ static int EditCheatMenu(CheatEntry * entry, int index, int selection)
"Select"
};
- static const char * kNumbersTable[] =
+ static const char *const kNumbersTable[] =
{
"0", "1", "2", "3", "4", "5", "6", "7",
"8", "9", "10", "11", "12", "13", "14", "15",
@@ -2845,7 +2845,7 @@ static int EditCheatMenu(CheatEntry * entry, int index, int selection)
"24", "25", "26", "27", "28", "29", "30", "31"
};
- static const char * kOperationNames[] =
+ static const char *const kOperationNames[] =
{
"Write",
"Add/Subtract",
@@ -2857,19 +2857,19 @@ static int EditCheatMenu(CheatEntry * entry, int index, int selection)
"Null"
};
- static const char * kAddSubtractNames[] =
+ static const char *const kAddSubtractNames[] =
{
"Add",
"Subtract"
};
- static const char * kSetClearNames[] =
+ static const char *const kSetClearNames[] =
{
"Set",
"Clear"
};
- static const char * kPrefillNames[] =
+ static const char *const kPrefillNames[] =
{
"None",
"FF",
@@ -2877,13 +2877,13 @@ static int EditCheatMenu(CheatEntry * entry, int index, int selection)
"01"
};
- static const char * kEndiannessNames[] =
+ static const char *const kEndiannessNames[] =
{
"Normal",
"Swap"
};
- static const char * kRegionNames[] =
+ static const char *const kRegionNames[] =
{
"CPU1", "CPU2", "CPU3", "CPU4", "CPU5", "CPU6", "CPU7", "CPU8",
"GFX1", "GFX2", "GFX3", "GFX4", "GFX5", "GFX6", "GFX7", "GFX8",
@@ -2892,7 +2892,7 @@ static int EditCheatMenu(CheatEntry * entry, int index, int selection)
"USER1", "USER2", "USER3", "USER4", "USER5", "USER6", "USER7", "USER8"
};
- static const char * kLocationNames[] =
+ static const char *const kLocationNames[] =
{
"Normal",
"Region",
@@ -2904,7 +2904,7 @@ static int EditCheatMenu(CheatEntry * entry, int index, int selection)
"Unused (7)"
};
- static const char * kCustomLocationNames[] =
+ static const char *const kCustomLocationNames[] =
{
"Comment",
"EEPROM",
@@ -2917,7 +2917,7 @@ static int EditCheatMenu(CheatEntry * entry, int index, int selection)
"Unused (28)", "Unused (29)", "Unused (30)", "Unused (31)"
};
- static const char * kSizeNames[] =
+ static const char *const kSizeNames[] =
{
"8 Bit",
"16 Bit",
@@ -5270,7 +5270,7 @@ static int DoSearchMenuMinimum(int selection)
static int DoSearchMenuClassic(int selection)
{
- static const char * energyStrings[] =
+ static const char *const energyStrings[] =
{
"Less",
"Greater",
@@ -5278,13 +5278,13 @@ static int DoSearchMenuClassic(int selection)
"Greater or Equal",
};
- static const char * equalOrNotStrings[] =
+ static const char *const equalOrNotStrings[] =
{
"Equal",
"Not Equal",
};
- static const char * operandStrings[] =
+ static const char *const operandStrings[] =
{
"Previous Data",
"First Data",
@@ -5800,7 +5800,7 @@ static int DoSearchMenuClassic(int selection)
static int DoSearchMenu(int selection)
{
/* menu stirngs */
- static const char * kOperandNameTable[] =
+ static const char *const kOperandNameTable[] =
{
"Current Data",
"Previous Data",
@@ -5808,7 +5808,7 @@ static int DoSearchMenu(int selection)
"Value"
};
- static const char * kComparisonNameTable[] =
+ static const char *const kComparisonNameTable[] =
{
"Less",
"Greater",
@@ -5820,7 +5820,7 @@ static int DoSearchMenu(int selection)
"Near To"
};
- static const char * kSearchByteNameTable[] =
+ static const char *const kSearchByteNameTable[] =
{
"1",
"2",
@@ -6289,7 +6289,7 @@ static int DoSearchMenu(int selection)
static int SelectSearchRegions(int selection, SearchInfo * search)
{
- static const char * kSearchSpeedList[] =
+ static const char *const kSearchSpeedList[] =
{
"Fast",
"Medium",
@@ -7066,7 +7066,7 @@ static int EditWatch(WatchInfo * entry, int selection)
kMenu_Return
};
- static const char * kWatchSizeStringList[] =
+ static const char *const kWatchSizeStringList[] =
{
"8 Bit",
"16 Bit",
@@ -9246,7 +9246,7 @@ static int ConvertOldCode(int code, int cpu, int * data, int * extendData)
UINT8 customField;
};
- static struct ConversionTable kConversionTable[] =
+ static const struct ConversionTable kConversionTable[] =
{
{ 0, 0x00000000, kCustomField_None },
{ 1, 0x00000001, kCustomField_None },
@@ -9313,7 +9313,7 @@ static int ConvertOldCode(int code, int cpu, int * data, int * extendData)
{ -1, 0x00000000, kCustomField_End }
};
- struct ConversionTable * traverse = kConversionTable;
+ const struct ConversionTable * traverse = kConversionTable;
UINT32 newCode;
UINT8 linkCheat = 0;
diff --git a/src/emu/cpu/adsp2100/2100ops.c b/src/emu/cpu/adsp2100/2100ops.c
index 0d50f217bcf..403b69bd77d 100644
--- a/src/emu/cpu/adsp2100/2100ops.c
+++ b/src/emu/cpu/adsp2100/2100ops.c
@@ -420,7 +420,7 @@ static void wr_topstack(INT32 val) { pc_stack_push_val(val & 0x3fff); }
#define WRITE_REG(grp,reg,val) ((*wr_reg[grp][reg])(val))
-static void (*wr_reg[4][16])(INT32) =
+static void (*const wr_reg[4][16])(INT32) =
{
{
wr_ax0, wr_ax1, wr_mx0, wr_mx1, wr_ay0, wr_ay1, wr_my0, wr_my1,
@@ -681,7 +681,7 @@ INLINE UINT32 pgm_read_dag2(UINT32 op)
#define ALU_GETYREG_UNSIGNED(y) (*(UINT16 *)alu_yregs[y])
#define ALU_GETYREG_SIGNED(y) (*( INT16 *)alu_yregs[y])
-static const void *alu_xregs[8] =
+static const void *const alu_xregs[8] =
{
&adsp2100.core.ax0,
&adsp2100.core.ax1,
@@ -693,7 +693,7 @@ static const void *alu_xregs[8] =
&adsp2100.core.sr.srx.sr1
};
-static const void *alu_yregs[4] =
+static const void *const alu_yregs[4] =
{
&adsp2100.core.ay0,
&adsp2100.core.ay1,
@@ -712,7 +712,7 @@ static const void *alu_yregs[4] =
#define MAC_GETYREG_UNSIGNED(y) (*(UINT16 *)mac_yregs[y])
#define MAC_GETYREG_SIGNED(y) (*( INT16 *)mac_yregs[y])
-static const void *mac_xregs[8] =
+static const void *const mac_xregs[8] =
{
&adsp2100.core.mx0,
&adsp2100.core.mx1,
@@ -724,7 +724,7 @@ static const void *mac_xregs[8] =
&adsp2100.core.sr.srx.sr1
};
-static const void *mac_yregs[4] =
+static const void *const mac_yregs[4] =
{
&adsp2100.core.my0,
&adsp2100.core.my1,
@@ -741,7 +741,7 @@ static const void *mac_yregs[4] =
#define SHIFT_GETXREG_UNSIGNED(x) (*(UINT16 *)shift_xregs[x])
#define SHIFT_GETXREG_SIGNED(x) (*( INT16 *)shift_xregs[x])
-static const void *shift_xregs[8] =
+static const void *const shift_xregs[8] =
{
&adsp2100.core.si,
&adsp2100.core.si,
diff --git a/src/emu/cpu/asap/asap.c b/src/emu/cpu/asap/asap.c
index 91278197f75..b478d0be54f 100644
--- a/src/emu/cpu/asap/asap.c
+++ b/src/emu/cpu/asap/asap.c
@@ -217,7 +217,7 @@ static void jsr_c(void);
static void jsr_c0(void);
static void trapf(void);
-static void (*opcodetable[32][4])(void) =
+static void (*const opcodetable[32][4])(void) =
{
{ trap0, trap0, trap0, trap0 },
{ NULL, NULL, NULL, NULL },
@@ -253,7 +253,7 @@ static void (*opcodetable[32][4])(void) =
{ trapf, trapf, trapf, trapf }
};
-static void (*conditiontable[16])(void) =
+static void (*const conditiontable[16])(void) =
{
bsp, bmz, bgt, ble, bge, blt, bhi, bls,
bcc, bcs, bpl, bmi, bne, beq, bvc, bvs
diff --git a/src/emu/cpu/h6280/tblh6280.c b/src/emu/cpu/h6280/tblh6280.c
index 1cd317e5a03..da4c7b2532d 100644
--- a/src/emu/cpu/h6280/tblh6280.c
+++ b/src/emu/cpu/h6280/tblh6280.c
@@ -308,7 +308,7 @@ OP(_0bf) { int tmp; H6280_CYCLES(4); RD_ZPG; BBS(3); } // 6/8 BBS3 ZPG,REL
OP(_0df) { int tmp; H6280_CYCLES(4); RD_ZPG; BBS(5); } // 6/8 BBS5 ZPG,REL
OP(_0ff) { int tmp; H6280_CYCLES(4); RD_ZPG; BBS(7); } // 6/8 BBS7 ZPG,REL
-static void (*insnh6280[0x100])(void) = {
+static void (*const insnh6280[0x100])(void) = {
h6280_000,h6280_001,h6280_002,h6280_003,h6280_004,h6280_005,h6280_006,h6280_007,
h6280_008,h6280_009,h6280_00a,h6280_00b,h6280_00c,h6280_00d,h6280_00e,h6280_00f,
h6280_010,h6280_011,h6280_012,h6280_013,h6280_014,h6280_015,h6280_016,h6280_017,
diff --git a/src/emu/cpu/hd6309/6309dasm.c b/src/emu/cpu/hd6309/6309dasm.c
index f558de9a633..0b36b6a1804 100644
--- a/src/emu/cpu/hd6309/6309dasm.c
+++ b/src/emu/cpu/hd6309/6309dasm.c
@@ -574,7 +574,7 @@ static const opcodeinfo hd6309_pg2opcodes[] =
{ 0xFB, 4, "ADDF", EXT }
};
-static const opcodeinfo *hd6309_pgpointers[3] =
+static const opcodeinfo *const hd6309_pgpointers[3] =
{
hd6309_pg0opcodes, hd6309_pg1opcodes, hd6309_pg2opcodes
};
diff --git a/src/emu/cpu/hd6309/6309ops.c b/src/emu/cpu/hd6309/6309ops.c
index ed3e6098584..3894d49404c 100644
--- a/src/emu/cpu/hd6309/6309ops.c
+++ b/src/emu/cpu/hd6309/6309ops.c
@@ -1344,7 +1344,7 @@ INLINE void swi( void )
#define decodePB_dst(n) (((n) >> 0) & 0x07)
static UINT8 dummy_byte;
-static unsigned char *regTable[4] = { &(CC), &(A), &(B), &dummy_byte };
+static unsigned char *const regTable[4] = { &(CC), &(A), &(B), &dummy_byte };
static const UINT8 bitTable[] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 };
diff --git a/src/emu/cpu/i86/ea.h b/src/emu/cpu/i86/ea.h
index 3dbb6e0e802..dca12337a5b 100644
--- a/src/emu/cpu/i86/ea.h
+++ b/src/emu/cpu/i86/ea.h
@@ -28,7 +28,7 @@ static unsigned EA_205(void) { i8086_ICount-=9; EO=FETCHOP; EO+=FETCHOP<<8; EO+=
static unsigned EA_206(void) { i8086_ICount-=9; EO=FETCHOP; EO+=FETCHOP<<8; EO+=I.regs.w[BP]; EA=DefaultBase(SS)+(WORD)EO; return EA; }
static unsigned EA_207(void) { i8086_ICount-=9; EO=FETCHOP; EO+=FETCHOP<<8; EO+=I.regs.w[BX]; EA=DefaultBase(DS)+(WORD)EO; return EA; }
-static unsigned (*GetEA[192])(void)={
+static unsigned (*const GetEA[192])(void)={
EA_000, EA_001, EA_002, EA_003, EA_004, EA_005, EA_006, EA_007,
EA_000, EA_001, EA_002, EA_003, EA_004, EA_005, EA_006, EA_007,
EA_000, EA_001, EA_002, EA_003, EA_004, EA_005, EA_006, EA_007,
diff --git a/src/emu/cpu/konami/konamtbl.c b/src/emu/cpu/konami/konamtbl.c
index f2725c3be73..d9a8c770194 100644
--- a/src/emu/cpu/konami/konamtbl.c
+++ b/src/emu/cpu/konami/konamtbl.c
@@ -350,7 +350,7 @@ INLINE void absd( void );
INLINE void opcode2( void );
-static void (*konami_main[0x100])(void) = {
+static void (*const konami_main[0x100])(void) = {
illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, /* 00 */
opcode2,opcode2,opcode2,opcode2,pshs ,pshu ,puls ,pulu ,
lda_im ,ldb_im ,opcode2,opcode2,adda_im,addb_im,opcode2,opcode2, /* 10 */
@@ -385,7 +385,7 @@ static void (*konami_main[0x100])(void) = {
illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal
};
-static void (*konami_indexed[0x100])(void) = {
+static void (*const konami_indexed[0x100])(void) = {
illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, /* 00 */
leax ,leay ,leau ,leas ,illegal,illegal,illegal,illegal,
illegal,illegal,lda_ix ,ldb_ix ,illegal,illegal,adda_ix,addb_ix, /* 10 */
@@ -420,7 +420,7 @@ static void (*konami_indexed[0x100])(void) = {
illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal
};
-static void (*konami_direct[0x100])(void) = {
+static void (*const konami_direct[0x100])(void) = {
illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, /* 00 */
illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal,
illegal,illegal,lda_di ,ldb_di ,illegal,illegal,adda_di,addb_di, /* 10 */
@@ -455,7 +455,7 @@ static void (*konami_direct[0x100])(void) = {
illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal
};
-static void (*konami_extended[0x100])(void) = {
+static void (*const konami_extended[0x100])(void) = {
illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal, /* 00 */
illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal,
illegal,illegal,lda_ex ,ldb_ex ,illegal,illegal,adda_ex,addb_ex, /* 10 */
diff --git a/src/emu/cpu/m37710/m37710.c b/src/emu/cpu/m37710/m37710.c
index d9e91045be4..230c283c4cb 100644
--- a/src/emu/cpu/m37710/m37710.c
+++ b/src/emu/cpu/m37710/m37710.c
@@ -426,7 +426,7 @@ static void m37710_recalc_timer(int timer)
switch (m37710i_cpu.m37710_regs[0x56+timer] & 0x3)
{
case 0: // timer mode
- time = attotime_mul(ATTOTIME_IN_HZ(16000000), tscales[m37710i_cpu.m37710_regs[tcr[timer]]>>6]);
+ time = attotime_mul(ATTOTIME_IN_HZ(cpunum_get_clock(cpu_getactivecpu())), tscales[m37710i_cpu.m37710_regs[tcr[timer]]>>6]);
time = attotime_mul(time, tval + 1);
#if M37710_DEBUG
@@ -461,7 +461,7 @@ static void m37710_recalc_timer(int timer)
switch (m37710i_cpu.m37710_regs[0x56+timer] & 0x3)
{
case 0: // timer mode
- time = attotime_mul(ATTOTIME_IN_HZ(16000000), tscales[m37710i_cpu.m37710_regs[tcr[timer]]>>6]);
+ time = attotime_mul(ATTOTIME_IN_HZ(cpunum_get_clock(cpu_getactivecpu())), tscales[m37710i_cpu.m37710_regs[tcr[timer]]>>6]);
time = attotime_mul(time, tval + 1);
#if M37710_DEBUG
diff --git a/src/emu/cpu/m6502/t65c02.c b/src/emu/cpu/m6502/t65c02.c
index 9566e3d0548..ddd4a8d2f18 100644
--- a/src/emu/cpu/m6502/t65c02.c
+++ b/src/emu/cpu/m6502/t65c02.c
@@ -371,7 +371,7 @@ OP(7e_wdc) { int tmp; RD_ABX_P; RD_EA; ROR; WB_EA; } /* 6 ROR ABX page pena
OP(de_wdc) { int tmp; RD_ABX_P; RD_EA; DEC; WB_EA; } /* 6 DEC ABX page penalty */
OP(fe_wdc) { int tmp; RD_ABX_P; RD_EA; INC; WB_EA; } /* 6 INC ABX page penalty */
-static void (*insnwdc65c02[0x100])(void) = {
+static void (*const insnwdc65c02[0x100])(void) = {
m65c02_00,m65c02_01,m65c02_02,m65c02_03,m65c02_04,m65c02_05,m65c02_06,m65c02_07,
m65c02_08,m65c02_09,m65c02_0a,m65c02_0b,m65c02_0c,m65c02_0d,m65c02_0e,m65c02_0f,
m65c02_10,m65c02_11,m65c02_12,m65c02_13,m65c02_14,m65c02_15,m65c02_16,m65c02_17,
diff --git a/src/emu/cpu/m68000/m68kcpu.c b/src/emu/cpu/m68000/m68kcpu.c
index 97b67df5db2..d8b278c772b 100644
--- a/src/emu/cpu/m68000/m68kcpu.c
+++ b/src/emu/cpu/m68000/m68kcpu.c
@@ -995,8 +995,8 @@ static void m68k_post_load(void)
void m68k_state_register(const char *type, int index)
{
+ /* Note, D covers A because the dar array is common, REG_A=REG_D+8 */
state_save_register_item_array(type, index, REG_D);
- state_save_register_item_array(type, index, REG_A);
state_save_register_item(type, index, REG_PPC);
state_save_register_item(type, index, REG_PC);
state_save_register_item(type, index, REG_USP);
diff --git a/src/emu/cpu/m68000/m68kmame.c b/src/emu/cpu/m68000/m68kmame.c
index b213023ccba..84969ed6a88 100644
--- a/src/emu/cpu/m68000/m68kmame.c
+++ b/src/emu/cpu/m68000/m68kmame.c
@@ -178,10 +178,6 @@ static const struct m68k_memory_interface interface_d32 =
};
-/* global access */
-struct m68k_memory_interface m68k_memory_intf;
-
-
static void set_irq_line(int irqline, int state)
{
if (irqline == INPUT_LINE_NMI)
@@ -298,7 +294,7 @@ static offs_t m68008_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UIN
}
#endif /* MAME_DEBUG */
-#endif
+#endif /* HAS_M68008 */
/****************************************************************************
* M68010 section
@@ -814,7 +810,7 @@ void m68008_get_info(UINT32 state, cpuinfo *info)
}
}
-#endif
+#endif /* HAS_M68008 */
/**************************************************************************
* CPU-specific set_info
@@ -859,7 +855,7 @@ void m68010_get_info(UINT32 state, cpuinfo *info)
}
}
-#endif
+#endif /* HAS_M68010 */
/**************************************************************************
* CPU-specific set_info
@@ -1099,7 +1095,7 @@ void m68ec020_get_info(UINT32 state, cpuinfo *info)
}
}
-#endif
+#endif /* HAS_M68EC020 */
/**************************************************************************
* CPU-specific set_info
@@ -1301,5 +1297,5 @@ void m68040_get_info(UINT32 state, cpuinfo *info)
}
}
-#endif
+#endif /* HAS_M68040 */
diff --git a/src/emu/cpu/m6805/m6805.c b/src/emu/cpu/m6805/m6805.c
index 22eafd6420e..c028d2e0a3a 100644
--- a/src/emu/cpu/m6805/m6805.c
+++ b/src/emu/cpu/m6805/m6805.c
@@ -199,7 +199,7 @@ static const UINT8 flags8d[256]= /* decrement */
#define BRANCH(f) { UINT8 t; IMMBYTE(t); if(f) { PC+=SIGNED(t); change_pc(PC); if (t==0xfe) { /* speed up busy loops */ if(m6805_ICount > 0) m6805_ICount = 0; } } }
/* what they say it is ... */
-static unsigned char cycles1[] =
+static const unsigned char cycles1[] =
{
/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
/*0*/ 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
diff --git a/src/emu/cpu/m6809/6809dasm.c b/src/emu/cpu/m6809/6809dasm.c
index 08c19724477..fe4a6797b04 100644
--- a/src/emu/cpu/m6809/6809dasm.c
+++ b/src/emu/cpu/m6809/6809dasm.c
@@ -342,7 +342,7 @@ static const opcodeinfo m6809_pg2opcodes[] =
{ 0xBC, 4, "CMPS", EXT }
};
-static const opcodeinfo *m6809_pgpointers[3] =
+static const opcodeinfo *const m6809_pgpointers[3] =
{
m6809_pg0opcodes, m6809_pg1opcodes, m6809_pg2opcodes
};
diff --git a/src/emu/cpu/m6809/6809tbl.c b/src/emu/cpu/m6809/6809tbl.c
index 66a6afe8424..b0b6bcd3660 100644
--- a/src/emu/cpu/m6809/6809tbl.c
+++ b/src/emu/cpu/m6809/6809tbl.c
@@ -279,7 +279,7 @@ INLINE void pref10(void);
INLINE void pref11(void);
#if (BIG_SWITCH==0)
-static void (*m6809_main[0x100])(void) = {
+static void (*const m6809_main[0x100])(void) = {
neg_di, neg_di, illegal,com_di, lsr_di, illegal,ror_di, asr_di, /* 00 */
asl_di, rol_di, dec_di, illegal,inc_di, tst_di, jmp_di, clr_di,
pref10, pref11, nop, sync, illegal,illegal,lbra, lbsr, /* 10 */
diff --git a/src/emu/cpu/mips/psx.c b/src/emu/cpu/mips/psx.c
index fd0c9582c4b..06a5eedd49d 100644
--- a/src/emu/cpu/mips/psx.c
+++ b/src/emu/cpu/mips/psx.c
@@ -2524,12 +2524,12 @@ static void docop2( int gteop )
static const UINT16 *const p_n_lm[] = { &L11, &L12, &L13, &L21, &L22, &L23, &L31, &L32, &L33 };
static const UINT16 *const p_n_cm[] = { &LR1, &LR2, &LR3, &LG1, &LG2, &LG3, &LB1, &LB2, &LB3 };
static const UINT16 *const p_n_zm[] = { &n_zm, &n_zm, &n_zm, &n_zm, &n_zm, &n_zm, &n_zm, &n_zm, &n_zm };
- static const UINT16 *const *p_p_n_mx[] = { p_n_rm, p_n_lm, p_n_cm, p_n_zm };
+ static const UINT16 *const *const p_p_n_mx[] = { p_n_rm, p_n_lm, p_n_cm, p_n_zm };
static const UINT32 *const p_n_tr[] = { &TRX, &TRY, &TRZ };
static const UINT32 *const p_n_bk[] = { &RBK, &GBK, &BBK };
static const UINT32 *const p_n_fc[] = { &RFC, &GFC, &BFC };
static const UINT32 *const p_n_zc[] = { &n_zc, &n_zc, &n_zc };
- static const UINT32 *const *p_p_n_cv[] = { p_n_tr, p_n_bk, p_n_fc, p_n_zc };
+ static const UINT32 *const *const p_p_n_cv[] = { p_n_tr, p_n_bk, p_n_fc, p_n_zc };
switch( GTE_FUNCT( gteop ) )
{
@@ -2788,7 +2788,7 @@ static void docop2( int gteop )
}
break;
case 0x1b:
- if( gteop == 0x108041b )
+ if( gteop == 0x108041b || gteop == 0x118041b )
{
GTELOG( "NCCS" );
FLAG = 0;
diff --git a/src/emu/cpu/nec/necea.h b/src/emu/cpu/nec/necea.h
index f754523805e..5a1c3b1f749 100644
--- a/src/emu/cpu/nec/necea.h
+++ b/src/emu/cpu/nec/necea.h
@@ -30,7 +30,7 @@ static unsigned EA_205(void) { E16=FETCH; E16+=FETCH<<8; EO=I.regs.w[IY]+(INT16)
static unsigned EA_206(void) { E16=FETCH; E16+=FETCH<<8; EO=I.regs.w[BP]+(INT16)E16; EA=DefaultBase(SS)+EO; return EA; }
static unsigned EA_207(void) { E16=FETCH; E16+=FETCH<<8; EO=I.regs.w[BW]+(INT16)E16; EA=DefaultBase(DS0)+EO; return EA; }
-static unsigned (*GetEA[192])(void)={
+static unsigned (*const GetEA[192])(void)={
EA_000, EA_001, EA_002, EA_003, EA_004, EA_005, EA_006, EA_007,
EA_000, EA_001, EA_002, EA_003, EA_004, EA_005, EA_006, EA_007,
EA_000, EA_001, EA_002, EA_003, EA_004, EA_005, EA_006, EA_007,
diff --git a/src/emu/cpu/nec/necinstr.h b/src/emu/cpu/nec/necinstr.h
index f07fe442c0c..b4c6e51ce87 100644
--- a/src/emu/cpu/nec/necinstr.h
+++ b/src/emu/cpu/nec/necinstr.h
@@ -246,7 +246,7 @@ static void i_ffpre(void);
static void i_wait(void);
-static void (*nec_instruction[256])(void) =
+static void (*const nec_instruction[256])(void) =
{
i_add_br8, /* 0x00 */
i_add_wr16, /* 0x01 */
diff --git a/src/emu/cpu/pic16c5x/pic16c5x.c b/src/emu/cpu/pic16c5x/pic16c5x.c
index f8ee36e9967..731dda0b54c 100644
--- a/src/emu/cpu/pic16c5x/pic16c5x.c
+++ b/src/emu/cpu/pic16c5x/pic16c5x.c
@@ -107,7 +107,7 @@ static int picmodel;
static int pic16C5x_reset_vector;
static int pic16C5x_icount;
typedef void (*opcode_fn) (void);
-static unsigned cycles_000_other[16];
+static const unsigned cycles_000_other[16];
#define TMR0 internalram[1]
@@ -174,8 +174,8 @@ static unsigned cycles_000_other[16];
/* Easy bit position selectors */
#define POS ((R.opcode.b.l >> 5) & 7)
-static unsigned int bit_clr[8] = { 0xfe, 0xfd, 0xfb, 0xf7, 0xef, 0xdf, 0xbf, 0x7f };
-static unsigned int bit_set[8] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 };
+static const unsigned int bit_clr[8] = { 0xfe, 0xfd, 0xfb, 0xf7, 0xef, 0xdf, 0xbf, 0x7f };
+static const unsigned int bit_set[8] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 };
INLINE void CLR(UINT16 flag) { R.STATUS &= ~flag; }
@@ -615,7 +615,7 @@ static void xorwf(void)
* Cycle Timings
***********************************************************************/
-static unsigned cycles_main[256]=
+static const unsigned cycles_main[256]=
{
/*00*/ 1*CLK, 0*CLK, 1*CLK, 1*CLK, 1*CLK, 0*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK,
/*10*/ 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK,
@@ -635,7 +635,7 @@ static unsigned cycles_main[256]=
/*F0*/ 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK
};
-static opcode_fn opcode_main[256]=
+static const opcode_fn opcode_main[256]=
{
/*00*/ nop, illegal,movwf, movwf, clrw, illegal,clrf, clrf,
/*08*/ subwf, subwf, subwf, subwf, decf, decf, decf, decf,
@@ -672,12 +672,12 @@ static opcode_fn opcode_main[256]=
};
-static unsigned cycles_000_other[16]=
+static const unsigned cycles_000_other[16]=
{
/*00*/ 1*CLK, 0*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK
};
-static opcode_fn opcode_000_other[16]=
+static const opcode_fn opcode_000_other[16]=
{
/*00*/ nop, illegal,option, sleepic,clrwdt, tris, tris, tris,
/*08*/ illegal,illegal,illegal,illegal,illegal,illegal,illegal,illegal
diff --git a/src/emu/cpu/powerpc/ppcdrc.c b/src/emu/cpu/powerpc/ppcdrc.c
index 98decf6fdc7..5a5b337b73a 100644
--- a/src/emu/cpu/powerpc/ppcdrc.c
+++ b/src/emu/cpu/powerpc/ppcdrc.c
@@ -1280,7 +1280,9 @@ static void ppcdrc603_init(int index, int clock, const void *_config, int (*irqc
ppc.optable59[i * 32 | 30] = recompile_fnmsubsx;
}
+#if (HAS_PPC602 || HAS_MPC8240)
ppc.optable31[978] = recompile_tlbld;
+#endif /* (HAS_PPC602 || HAS_MPC8240) */
for(i = 0; i < 256; i++)
{
diff --git a/src/emu/cpu/saturn/saturnds.c b/src/emu/cpu/saturn/saturnds.c
index dce67bf487a..15f113035d3 100644
--- a/src/emu/cpu/saturn/saturnds.c
+++ b/src/emu/cpu/saturn/saturnds.c
@@ -191,7 +191,7 @@ typedef enum {
} MNEMONICS;
-static struct {
+static const struct {
const char *name[2];
} mnemonics[]={
{ { "rtn", "RET" } },
diff --git a/src/emu/cpu/sharc/sharcdsm.c b/src/emu/cpu/sharc/sharcdsm.c
index 3845433f9e7..487a3f59834 100644
--- a/src/emu/cpu/sharc/sharcdsm.c
+++ b/src/emu/cpu/sharc/sharcdsm.c
@@ -1052,7 +1052,7 @@ static UINT32 dasm_invalid(UINT32 pc, UINT64 opcode)
return 0;
}
-static SHARC_DASM_OP sharc_dasm_ops[] =
+static const SHARC_DASM_OP sharc_dasm_ops[] =
{
// |0 0 1|
{ 0xe000, 0x2000, dasm_compute_dreg_dmpm },
diff --git a/src/emu/cpu/sharc/sharcops.h b/src/emu/cpu/sharc/sharcops.h
index 77f1a400074..17a6a70b0c0 100644
--- a/src/emu/cpu/sharc/sharcops.h
+++ b/src/emu/cpu/sharc/sharcops.h
@@ -5,7 +5,7 @@ typedef struct
void (* handler)(void);
} SHARC_OP;
-static SHARC_OP sharc_opcode_table[] =
+static const SHARC_OP sharc_opcode_table[] =
{
// |0 0 1|
{ 0xe000, 0x2000, sharcop_compute_dreg_dm_dreg_pm },
diff --git a/src/emu/cpu/tms32010/tms32010.c b/src/emu/cpu/tms32010/tms32010.c
index 580256a896f..d1fe310a504 100644
--- a/src/emu/cpu/tms32010/tms32010.c
+++ b/src/emu/cpu/tms32010/tms32010.c
@@ -634,7 +634,7 @@ static void zals(void)
* Cycle Timings
***********************************************************************/
-static unsigned cycles_main[256]=
+static const unsigned cycles_main[256]=
{
/*00*/ 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK,
/*10*/ 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK,
@@ -654,7 +654,7 @@ static unsigned cycles_main[256]=
/*F0*/ 0*CLK, 0*CLK, 0*CLK, 0*CLK, 2*CLK, 2*CLK, 2*CLK, 0*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK
};
-static unsigned cycles_7F_other[32]=
+static const unsigned cycles_7F_other[32]=
{
/*80*/ 1*CLK, 1*CLK, 1*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 2*CLK, 2*CLK, 1*CLK, 1*CLK,
/*90*/ 1*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 0*CLK, 2*CLK, 2*CLK, 0*CLK, 0*CLK
diff --git a/src/emu/cpu/tms32025/tms32025.c b/src/emu/cpu/tms32025/tms32025.c
index 352f787efba..a7fc99bb273 100644
--- a/src/emu/cpu/tms32025/tms32025.c
+++ b/src/emu/cpu/tms32025/tms32025.c
@@ -1561,7 +1561,7 @@ static void zals(void)
* Cycle Timings
***********************************************************************/
-static unsigned cycles_main[256]=
+static const unsigned cycles_main[256]=
{
/*00*/ 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK,
/*08*/ 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK,
@@ -1597,12 +1597,12 @@ static unsigned cycles_main[256]=
/*F8*/ 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK
};
-static unsigned cycles_DX_subset[8]=
+static const unsigned cycles_DX_subset[8]=
{
/*00*/ 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 2*CLK, 0
};
-static unsigned cycles_CE_subset[256]=
+static const unsigned cycles_CE_subset[256]=
{
/*00*/ 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK,
/*08*/ 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK, 1*CLK,
diff --git a/src/emu/cpu/tms34010/tms34010.c b/src/emu/cpu/tms34010/tms34010.c
index 9860e91a953..dabb1bd58fd 100644
--- a/src/emu/cpu/tms34010/tms34010.c
+++ b/src/emu/cpu/tms34010/tms34010.c
@@ -98,7 +98,7 @@ static UINT8 screen_to_cpu[MAX_SCREENS];
static UINT8 executing_cpu = 0xff;
/* default configuration */
-static tms34010_config default_config =
+static const tms34010_config default_config =
{
0
};
diff --git a/src/emu/cpu/tms7000/tms70tb.c b/src/emu/cpu/tms7000/tms70tb.c
index c9b6587e234..ef1db21498d 100644
--- a/src/emu/cpu/tms7000/tms70tb.c
+++ b/src/emu/cpu/tms7000/tms70tb.c
@@ -17,7 +17,7 @@
*
*****************************************************************************/
-static void (*opfn[0x100])(void) = {
+static void (*const opfn[0x100])(void) = {
/* 0xX0, 0xX1, 0xX2, 0xX3, 0xX4, 0xX5, 0xX6, 0xX7,
0xX8, 0xX9, 0xXA, 0xXB, 0xXC, 0xXD, 0xXE, 0xXF */
@@ -70,7 +70,7 @@ static void (*opfn[0x100])(void) = {
trap_7, trap_6, trap_5, trap_4, trap_3, trap_2, trap_1, trap_0
};
-static void (*opfn_exl[0x100])(void) = {
+static void (*const opfn_exl[0x100])(void) = {
/* 0xX0, 0xX1, 0xX2, 0xX3, 0xX4, 0xX5, 0xX6, 0xX7,
0xX8, 0xX9, 0xXA, 0xXB, 0xXC, 0xXD, 0xXE, 0xXF */
diff --git a/src/emu/cpu/v30mz/necea.h b/src/emu/cpu/v30mz/necea.h
index 12fb93f3fee..4cd072fd2bc 100644
--- a/src/emu/cpu/v30mz/necea.h
+++ b/src/emu/cpu/v30mz/necea.h
@@ -30,7 +30,7 @@ static unsigned EA_205(void) { E16=FETCH; E16+=FETCH<<8; EO=I.regs.w[IY]+(INT16)
static unsigned EA_206(void) { E16=FETCH; E16+=FETCH<<8; EO=I.regs.w[BP]+(INT16)E16; EA=DefaultBase(SS)+EO; return EA; }
static unsigned EA_207(void) { E16=FETCH; E16+=FETCH<<8; EO=I.regs.w[BW]+(INT16)E16; EA=DefaultBase(DS)+EO; return EA; }
-static unsigned (*GetEA[192])(void)={
+static unsigned (*const GetEA[192])(void)={
EA_000, EA_001, EA_002, EA_003, EA_004, EA_005, EA_006, EA_007,
EA_000, EA_001, EA_002, EA_003, EA_004, EA_005, EA_006, EA_007,
EA_000, EA_001, EA_002, EA_003, EA_004, EA_005, EA_006, EA_007,
diff --git a/src/emu/cpu/v30mz/necinstr.h b/src/emu/cpu/v30mz/necinstr.h
index f07fe442c0c..b4c6e51ce87 100644
--- a/src/emu/cpu/v30mz/necinstr.h
+++ b/src/emu/cpu/v30mz/necinstr.h
@@ -246,7 +246,7 @@ static void i_ffpre(void);
static void i_wait(void);
-static void (*nec_instruction[256])(void) =
+static void (*const nec_instruction[256])(void) =
{
i_add_br8, /* 0x00 */
i_add_wr16, /* 0x01 */
diff --git a/src/emu/cpu/v60/v60mem.c b/src/emu/cpu/v60/v60mem.c
index c29a1a81f33..2f283e31fe0 100644
--- a/src/emu/cpu/v60/v60mem.c
+++ b/src/emu/cpu/v60/v60mem.c
@@ -337,7 +337,7 @@ static void ChangePC_32(offs_t pc)
/* Structures pointing to various I/O functions */
/************************************************/
-static struct cpu_info v60_i =
+static const struct cpu_info v60_i =
{
MemRead8_16, MemWrite8_16, MemRead16_16, MemWrite16_16, MemRead32_16, MemWrite32_16,
PortRead8_16, PortWrite8_16, PortRead16_16, PortWrite16_16, PortRead32_16, PortWrite32_16,
@@ -346,7 +346,7 @@ static struct cpu_info v60_i =
0xfffff0
};
-static struct cpu_info v70_i =
+static const struct cpu_info v70_i =
{
MemRead8_32, MemWrite8_32, MemRead16_32, MemWrite16_32, MemRead32_32, MemWrite32_32,
PortRead8_32, PortWrite8_32, PortRead16_32, PortWrite16_32, PortRead32_32, PortWrite32_32,
diff --git a/src/emu/cpu/z8000/z8000.c b/src/emu/cpu/z8000/z8000.c
index d845083aacc..0a3e089e19b 100644
--- a/src/emu/cpu/z8000/z8000.c
+++ b/src/emu/cpu/z8000/z8000.c
@@ -125,7 +125,7 @@ static UINT8 z8000_zsp[256];
**************************************************************************/
#ifdef LSB_FIRST
/* pointers to byte (8bit) registers */
- static UINT8 *pRB[16] =
+ static UINT8 *const pRB[16] =
{
&Z.regs.B[ 7],&Z.regs.B[ 5],&Z.regs.B[ 3],&Z.regs.B[ 1],
&Z.regs.B[15],&Z.regs.B[13],&Z.regs.B[11],&Z.regs.B[ 9],
@@ -133,7 +133,7 @@ static UINT8 z8000_zsp[256];
&Z.regs.B[14],&Z.regs.B[12],&Z.regs.B[10],&Z.regs.B[ 8]
};
- static UINT16 *pRW[16] =
+ static UINT16 *const pRW[16] =
{
&Z.regs.W[ 3],&Z.regs.W[ 2],&Z.regs.W[ 1],&Z.regs.W[ 0],
&Z.regs.W[ 7],&Z.regs.W[ 6],&Z.regs.W[ 5],&Z.regs.W[ 4],
@@ -142,7 +142,7 @@ static UINT8 z8000_zsp[256];
};
/* pointers to long (32bit) registers */
- static UINT32 *pRL[16] =
+ static UINT32 *const pRL[16] =
{
&Z.regs.L[ 1],&Z.regs.L[ 1],&Z.regs.L[ 0],&Z.regs.L[ 0],
&Z.regs.L[ 3],&Z.regs.L[ 3],&Z.regs.L[ 2],&Z.regs.L[ 2],
@@ -153,7 +153,7 @@ static UINT8 z8000_zsp[256];
#else /* MSB_FIRST */
/* pointers to byte (8bit) registers */
- static UINT8 *pRB[16] =
+ static UINT8 *const pRB[16] =
{
&Z.regs.B[ 0],&Z.regs.B[ 2],&Z.regs.B[ 4],&Z.regs.B[ 6],
&Z.regs.B[ 8],&Z.regs.B[10],&Z.regs.B[12],&Z.regs.B[14],
@@ -162,7 +162,7 @@ static UINT8 z8000_zsp[256];
};
/* pointers to word (16bit) registers */
- static UINT16 *pRW[16] =
+ static UINT16 *const pRW[16] =
{
&Z.regs.W[ 0],&Z.regs.W[ 1],&Z.regs.W[ 2],&Z.regs.W[ 3],
&Z.regs.W[ 4],&Z.regs.W[ 5],&Z.regs.W[ 6],&Z.regs.W[ 7],
@@ -171,7 +171,7 @@ static UINT8 z8000_zsp[256];
};
/* pointers to long (32bit) registers */
- static UINT32 *pRL[16] =
+ static UINT32 *const pRL[16] =
{
&Z.regs.L[ 0],&Z.regs.L[ 0],&Z.regs.L[ 1],&Z.regs.L[ 1],
&Z.regs.L[ 2],&Z.regs.L[ 2],&Z.regs.L[ 3],&Z.regs.L[ 3],
@@ -182,7 +182,7 @@ static UINT8 z8000_zsp[256];
#endif
/* pointers to quad word (64bit) registers */
-static UINT64 *pRQ[16] = {
+static UINT64 *const pRQ[16] = {
&Z.regs.Q[ 0],&Z.regs.Q[ 0],&Z.regs.Q[ 0],&Z.regs.Q[ 0],
&Z.regs.Q[ 1],&Z.regs.Q[ 1],&Z.regs.Q[ 1],&Z.regs.Q[ 1],
&Z.regs.Q[ 2],&Z.regs.Q[ 2],&Z.regs.Q[ 2],&Z.regs.Q[ 2],
diff --git a/src/emu/cpuexec.h b/src/emu/cpuexec.h
index 206cbb982c4..36de52747c1 100644
--- a/src/emu/cpuexec.h
+++ b/src/emu/cpuexec.h
@@ -227,7 +227,7 @@ struct _cpu_config
int vblank_interrupts_per_frame;/* usually 1 */
void (*timed_interrupt)(void); /* for interrupts not tied to VBLANK */
attoseconds_t timed_interrupt_period; /* period for periodic interrupts */
- void * reset_param; /* parameter for cpu_reset */
+ const void *reset_param; /* parameter for cpu_reset */
const char *tag;
};
diff --git a/src/emu/cpuint.c b/src/emu/cpuint.c
index 2d9acfb0061..5ce2795752f 100644
--- a/src/emu/cpuint.c
+++ b/src/emu/cpuint.c
@@ -83,7 +83,7 @@ static int cpu_5_irq_callback(int line);
static int cpu_6_irq_callback(int line);
static int cpu_7_irq_callback(int line);
-int (*cpu_irq_callbacks[MAX_CPU])(int) =
+int (*const cpu_irq_callbacks[MAX_CPU])(int) =
{
cpu_0_irq_callback,
cpu_1_irq_callback,
diff --git a/src/emu/cpuint.h b/src/emu/cpuint.h
index ca45d3006c4..c6dcf7c3f69 100644
--- a/src/emu/cpuint.h
+++ b/src/emu/cpuint.h
@@ -30,7 +30,7 @@ void cpuint_init(running_machine *machine);
void cpuint_reset(void);
-extern int (*cpu_irq_callbacks[])(int);
+extern int (*const cpu_irq_callbacks[])(int);
diff --git a/src/emu/debug/debugcmd.c b/src/emu/debug/debugcmd.c
index 41fe159e064..75c444a6d00 100644
--- a/src/emu/debug/debugcmd.c
+++ b/src/emu/debug/debugcmd.c
@@ -1275,7 +1275,7 @@ static void execute_wpdisenable(int ref, int params, const char *param[])
static void execute_wplist(int ref, int params, const char *param[])
{
- static const char *spacenames[ADDRESS_SPACES] = { "program", "data", "I/O" };
+ static const char *const spacenames[ADDRESS_SPACES] = { "program", "data", "I/O" };
int cpunum, printed = 0;
char buffer[256];
@@ -1292,7 +1292,7 @@ static void execute_wplist(int ref, int params, const char *param[])
{
if (cpuinfo->space[spacenum].first_wp)
{
- static const char *types[] = { "unkn ", "read ", "write", "r/w " };
+ static const char *const types[] = { "unkn ", "read ", "write", "r/w " };
debug_cpu_watchpoint *wp;
debug_console_printf("CPU %d %s space watchpoints:\n", cpunum, spacenames[spacenum]);
diff --git a/src/emu/debug/debugcpu.c b/src/emu/debug/debugcpu.c
index 81099acd348..3d25239aaac 100644
--- a/src/emu/debug/debugcpu.c
+++ b/src/emu/debug/debugcpu.c
@@ -42,7 +42,7 @@
FILE *debug_source_file;
symbol_table *global_symtable;
-static const char *address_space_name[] = { "program", "data", "I/O" };
+static const char *const address_space_name[] = { "program", "data", "I/O" };
static UINT64 wpdata;
static UINT64 wpaddr;
@@ -1317,7 +1317,7 @@ static void check_watchpoints(int cpunum, int spacenum, int type, offs_t address
/* if we do, evaluate the condition */
if (wp->condition == NULL || (expression_execute(wp->condition, &result) == EXPRERR_NONE && result))
{
- static const char *sizes[] =
+ static const char *const sizes[] =
{
"0bytes", "byte", "word", "3bytes", "dword", "5bytes", "6bytes", "7bytes", "qword"
};
diff --git a/src/emu/debug/debughlp.c b/src/emu/debug/debughlp.c
index 68e188130da..d1241aab076 100644
--- a/src/emu/debug/debughlp.c
+++ b/src/emu/debug/debughlp.c
@@ -53,7 +53,7 @@ struct _help_item
TABLE OF HELP
***************************************************************************/
-static help_item static_help_list[] =
+static const help_item static_help_list[] =
{
{
"",
@@ -1035,7 +1035,7 @@ static help_item static_help_list[] =
const char *debug_get_help(const char *tag)
{
static char ambig_message[1024];
- help_item *found = NULL;
+ const help_item *found = NULL;
int i, msglen, foundcount = 0;
int taglen = (int)strlen(tag);
char tagcopy[256];
diff --git a/src/emu/debug/express.c b/src/emu/debug/express.c
index 22aa49d9782..8694c8751d9 100644
--- a/src/emu/debug/express.c
+++ b/src/emu/debug/express.c
@@ -1158,6 +1158,12 @@ static EXPRERR execute_tokens(parsed_expression *expr, UINT64 *result)
/* reset the token stack */
init_token_stack(expr);
+ /* Initialize t1, t2 to keep gcc's warnings-as-errors happy */
+ t1.type = TOK_INVALID;
+ t1.offset = 0;
+ t2.type = TOK_INVALID;
+ t2.offset = 0;
+
/* create a temporary token for holding intermediate number and memory values */
tempnum.type = TOK_NUMBER;
tempnum.offset = 0;
diff --git a/src/emu/drawgfx.c b/src/emu/drawgfx.c
index 89a9f3231ea..43f7b184354 100644
--- a/src/emu/drawgfx.c
+++ b/src/emu/drawgfx.c
@@ -82,7 +82,7 @@ INLINE void write_dword(void *address, UINT32 data)
offset
-------------------------------------------------*/
-INLINE int readbit(const UINT8 *src, int bitnum)
+INLINE int readbit(const UINT8 *src, unsigned int bitnum)
{
return src[bitnum / 8] & (0x80 >> (bitnum % 8));
}
diff --git a/src/emu/driver.h b/src/emu/driver.h
index 7db71669c22..cf4a820c8e1 100644
--- a/src/emu/driver.h
+++ b/src/emu/driver.h
@@ -119,16 +119,17 @@
/* ----- flags for video_attributes ----- */
-/* is the video hardware raser or vector base? */
-#define VIDEO_TYPE_RASTER 0x0000
-#define VIDEO_TYPE_VECTOR 0x0001
+/* is the video hardware raster or vector based? */
+#define VIDEO_TYPE_NONE 0x0000
+#define VIDEO_TYPE_RASTER 0x0001
+#define VIDEO_TYPE_VECTOR 0x0002
/* should VIDEO_UPDATE by called at the start of VBLANK or at the end? */
#define VIDEO_UPDATE_BEFORE_VBLANK 0x0000
-#define VIDEO_UPDATE_AFTER_VBLANK 0x0002
+#define VIDEO_UPDATE_AFTER_VBLANK 0x0004
/* indicates VIDEO_UPDATE will add container bits its */
-#define VIDEO_SELF_RENDER 0x0004
+#define VIDEO_SELF_RENDER 0x0008
/* automatically extend the palette creating a darker copy for shadows */
#define VIDEO_HAS_SHADOWS 0x0010
diff --git a/src/emu/emuopts.c b/src/emu/emuopts.c
index 1b75f35b245..1463b1350b8 100644
--- a/src/emu/emuopts.c
+++ b/src/emu/emuopts.c
@@ -143,6 +143,7 @@ const options_entry mame_core_options[] =
{ NULL, NULL, OPTION_HEADER, "CORE DEBUGGING OPTIONS" },
{ "log", "0", OPTION_BOOLEAN, "generate an error.log file" },
{ "verbose;v", "0", OPTION_BOOLEAN, "display additional diagnostic information" },
+ { "update_in_pause", "0", OPTION_BOOLEAN, "keep calling video updates while in pause" },
#ifdef MAME_DEBUG
{ "debug;d", "1", OPTION_BOOLEAN, "enable/disable debugger" },
{ "debugscript", NULL, 0, "script for debugger" },
diff --git a/src/emu/emuopts.h b/src/emu/emuopts.h
index 982f2556826..eab42ba5b34 100644
--- a/src/emu/emuopts.h
+++ b/src/emu/emuopts.h
@@ -133,6 +133,7 @@
#define OPTION_LOG "log"
#define OPTION_DEBUG "debug"
#define OPTION_DEBUGSCRIPT "debugscript"
+#define OPTION_UPDATEINPAUSE "update_in_pause"
/* core misc options */
#define OPTION_BIOS "bios"
diff --git a/src/emu/hash.c b/src/emu/hash.c
index 5c3a293d604..db92127523b 100644
--- a/src/emu/hash.c
+++ b/src/emu/hash.c
@@ -185,7 +185,7 @@ static const hash_function_desc hash_descs[HASH_NUM_FUNCTIONS] =
},
};
-static const char* info_strings[] =
+static const char *const info_strings[] =
{
"$ND$", // No dump
"$BD$" // Bad dump
diff --git a/src/emu/inptport.c b/src/emu/inptport.c
index 4c698e96ef8..ff17aa3d148 100644
--- a/src/emu/inptport.c
+++ b/src/emu/inptport.c
@@ -264,7 +264,7 @@ static digital_joystick_info joystick_info[MAX_PLAYERS][DIGITAL_JOYSTICKS_PER_PL
static UINT8 ui_memory[__ipt_max];
/* XML attributes for the different types */
-static const char *seqtypestrings[] = { "standard", "decrement", "increment" };
+static const char *const seqtypestrings[] = { "standard", "decrement", "increment" };
/* original input_ports without modifications */
static input_port_entry *input_ports_default;
@@ -2598,9 +2598,9 @@ const char *input_port_name(const input_port_entry *port)
}
-input_seq *input_port_seq(input_port_entry *port, int seqtype)
+const input_seq *input_port_seq(input_port_entry *port, int seqtype)
{
- static input_seq ip_none = SEQ_DEF_0;
+ static const input_seq ip_none = SEQ_DEF_0;
input_seq *portseq;
/* if port is disabled, return no key */
@@ -2639,9 +2639,9 @@ input_seq *input_port_seq(input_port_entry *port, int seqtype)
}
-input_seq *input_port_default_seq(int type, int player, int seqtype)
+const input_seq *input_port_default_seq(int type, int player, int seqtype)
{
- static input_seq ip_none = SEQ_DEF_0;
+ static const input_seq ip_none = SEQ_DEF_0;
/* find the default setting */
int defindex = default_ports_lookup[type][player];
diff --git a/src/emu/inptport.h b/src/emu/inptport.h
index 527bcf453eb..31fc3ce21c9 100644
--- a/src/emu/inptport.h
+++ b/src/emu/inptport.h
@@ -876,8 +876,8 @@ read16_handler port_tag_to_handler16(const char *tag);
read32_handler port_tag_to_handler32(const char *tag);
read64_handler port_tag_to_handler64(const char *tag);
const char *input_port_name(const input_port_entry *in);
-input_seq *input_port_seq(input_port_entry *in, int seqtype);
-input_seq *input_port_default_seq(int type, int player, int seqtype);
+const input_seq *input_port_seq(input_port_entry *in, int seqtype);
+const input_seq *input_port_default_seq(int type, int player, int seqtype);
int input_port_condition(const input_port_entry *in);
void input_port_set_changed_callback(int port, UINT32 mask, void (*callback)(void *, UINT32, UINT32), void *param);
diff --git a/src/emu/input.c b/src/emu/input.c
index 9a961ea0b7a..2f841fadd9a 100644
--- a/src/emu/input.c
+++ b/src/emu/input.c
@@ -337,9 +337,9 @@ static INT32 joystick_deadzone;
static INT32 joystick_saturation;
/* standard joystick mappings */
-const char * joystick_map_8way = "7778...4445";
-const char * joystick_map_4way_sticky = "s8.4s8.44s8.4445";
-const char * joystick_map_4way_diagonal = "4444s8888..444458888.444555888.ss5.222555666.222256666.2222s6666.2222s6666";
+const char joystick_map_8way[] = "7778...4445";
+const char joystick_map_4way_sticky[] = "s8.4s8.44s8.4445";
+const char joystick_map_4way_diagonal[] = "4444s8888..444458888.444555888.ss5.222555666.222256666.2222s6666.2222s6666";
@@ -1549,7 +1549,7 @@ static int joystick_map_parse(const char *mapstring, joystick_map *map)
JOYSTICK_MAP_DOWN | JOYSTICK_MAP_RIGHT,
JOYSTICK_MAP_STICKY
};
- static const char *validchars = "789456123s";
+ static const char validchars[] = "789456123s";
const char *ptr = strchr(validchars, *mapstring++);
/* invalid characters exit immediately */
diff --git a/src/emu/input.h b/src/emu/input.h
index 4f2c82086d8..30fd3fea98f 100644
--- a/src/emu/input.h
+++ b/src/emu/input.h
@@ -485,9 +485,9 @@ typedef struct _input_device input_device;
***************************************************************************/
/* joystick maps */
-extern const char * joystick_map_8way;
-extern const char * joystick_map_4way_sticky;
-extern const char * joystick_map_4way_diagonal;
+extern const char joystick_map_8way[];
+extern const char joystick_map_4way_sticky[];
+extern const char joystick_map_4way_diagonal[];
diff --git a/src/emu/machine/53c810.c b/src/emu/machine/53c810.c
index ec8b30fe50e..8c182413843 100644
--- a/src/emu/machine/53c810.c
+++ b/src/emu/machine/53c810.c
@@ -7,7 +7,7 @@
#define DASM_OPCODES 0
static SCSIInstance *devices[8]; /* SCSI IDs 0-7 */
-static struct LSI53C810interface *intf;
+static const struct LSI53C810interface *intf;
static UINT8 last_id;
static struct {
@@ -659,7 +659,7 @@ static void add_opcode(UINT8 op, UINT8 mask, void (* handler)(void))
}
}
-extern void lsi53c810_init(struct LSI53C810interface *interface)
+extern void lsi53c810_init(const struct LSI53C810interface *interface)
{
int i;
@@ -756,7 +756,7 @@ unsigned lsi53c810_dasm(char *buf, UINT32 pc)
UINT32 dest;
int i;
- static const char *phases[] =
+ static const char *const phases[] =
{
"DATA_OUT", "DATA_IN", "CMD", "STATUS",
"RESERVED_OUT??", "RESERVED_IN??", "MSG_OUT", "MSG_IN"
@@ -777,7 +777,7 @@ unsigned lsi53c810_dasm(char *buf, UINT32 pc)
else if (((op & 0xF8000000) == 0x58000000)
| ((op & 0xF8000000) == 0x60000000))
{
- static struct
+ static const struct
{
UINT32 flag;
const char *text;
diff --git a/src/emu/machine/53c810.h b/src/emu/machine/53c810.h
index 8cbb6065146..8818ee9f3b3 100644
--- a/src/emu/machine/53c810.h
+++ b/src/emu/machine/53c810.h
@@ -5,13 +5,13 @@
struct LSI53C810interface
{
- SCSIConfigTable *scsidevs; /* SCSI devices */
+ const SCSIConfigTable *scsidevs; /* SCSI devices */
void (*irq_callback)(void); /* IRQ callback */
void (*dma_callback)(UINT32, UINT32, int, int); /* DMA callback */
UINT32 (*fetch)(UINT32 dsp);
};
-extern void lsi53c810_init(struct LSI53C810interface *interface);
+extern void lsi53c810_init(const struct LSI53C810interface *interface);
extern void lsi53c810_read_data(int bytes, UINT8 *pData);
extern void lsi53c810_write_data(int bytes, UINT8 *pData);
diff --git a/src/emu/machine/6840ptm.c b/src/emu/machine/6840ptm.c
index 4a0492afb68..5ba50449134 100644
--- a/src/emu/machine/6840ptm.c
+++ b/src/emu/machine/6840ptm.c
@@ -97,7 +97,7 @@ static TIMER_CALLBACK( ptm6840_t3_timeout );
static ptm6840 ptm[PTM_6840_MAX];
#if PTMVERBOSE
-static const char *opmode[] =
+static const char *const opmode[] =
{
"000 continous mode",
"001 freq comparison mode",
diff --git a/src/emu/machine/am53cf96.c b/src/emu/machine/am53cf96.c
index 9e5467138f7..0dce33a9e54 100644
--- a/src/emu/machine/am53cf96.c
+++ b/src/emu/machine/am53cf96.c
@@ -13,7 +13,7 @@
#include "am53cf96.h"
static UINT8 scsi_regs[32], fifo[16], fptr = 0, xfer_state, last_id;
-static struct AM53CF96interface *intf;
+static const struct AM53CF96interface *intf;
static SCSIInstance *devices[8]; // SCSI IDs 0-7
@@ -208,7 +208,7 @@ WRITE32_HANDLER( am53cf96_w )
}
}
-void am53cf96_init( struct AM53CF96interface *interface )
+void am53cf96_init( const struct AM53CF96interface *interface )
{
int i;
diff --git a/src/emu/machine/am53cf96.h b/src/emu/machine/am53cf96.h
index b3e23de8712..ea893904f1d 100644
--- a/src/emu/machine/am53cf96.h
+++ b/src/emu/machine/am53cf96.h
@@ -10,11 +10,11 @@
struct AM53CF96interface
{
- SCSIConfigTable *scsidevs; /* SCSI devices */
+ const SCSIConfigTable *scsidevs; /* SCSI devices */
void (*irq_callback)(void); /* irq callback */
};
-extern void am53cf96_init( struct AM53CF96interface *interface );
+extern void am53cf96_init( const struct AM53CF96interface *interface );
extern void am53cf96_read_data(int bytes, UINT8 *pData);
void am53cf96_write_data(int bytes, UINT8 *pData);
void *am53cf96_get_device(int id);
diff --git a/src/emu/machine/cr589.c b/src/emu/machine/cr589.c
index 4ec39d35845..102631c4fe3 100644
--- a/src/emu/machine/cr589.c
+++ b/src/emu/machine/cr589.c
@@ -14,7 +14,7 @@ typedef struct
} SCSICr589;
static const int identity_offset = 0x3ab;
-static const char *download_identity = "MATSHITA CD98Q4 DOWNLOADGS0N";
+static const char download_identity[] = "MATSHITA CD98Q4 DOWNLOADGS0N";
static int cr589_exec_command( SCSIInstance *scsiInstance, UINT8 *statusCode )
{
@@ -144,7 +144,7 @@ static int cr589_dispatch( int operation, void *file, INT64 intparm, void *ptrpa
return SCSIBase( &SCSIClassCr589, operation, file, intparm, ptrparm );
}
-SCSIClass SCSIClassCr589 =
+const SCSIClass SCSIClassCr589 =
{
&SCSIClassCDROM,
cr589_dispatch,
diff --git a/src/emu/machine/cr589.h b/src/emu/machine/cr589.h
index a0e9313abe9..1f27614eb01 100644
--- a/src/emu/machine/cr589.h
+++ b/src/emu/machine/cr589.h
@@ -1,3 +1,3 @@
#include "scsi.h"
-extern SCSIClass SCSIClassCr589;
+extern const SCSIClass SCSIClassCr589;
diff --git a/src/emu/machine/ds2401.c b/src/emu/machine/ds2401.c
index cd3ebd52274..0d61bad2243 100644
--- a/src/emu/machine/ds2401.c
+++ b/src/emu/machine/ds2401.c
@@ -41,7 +41,7 @@ struct ds2401_chip
int shift;
int rx;
int tx;
- UINT8 *data;
+ const UINT8 *data;
emu_timer *timer;
emu_timer *reset_timer;
attotime t_samp;
@@ -138,15 +138,10 @@ static TIMER_CALLBACK( ds2401_tick )
}
}
-void ds2401_init( int which, UINT8 *data )
+void ds2401_init( int which, const UINT8 *data )
{
struct ds2401_chip *c = &ds2401[ which ];
- if( data == NULL )
- {
- data = auto_malloc( SIZE_DATA );
- }
-
c->state = STATE_IDLE;
c->bit = 0;
c->byte = 0;
@@ -166,7 +161,7 @@ void ds2401_init( int which, UINT8 *data )
state_save_register_item( "ds2401", which, c->shift );
state_save_register_item( "ds2401", which, c->rx );
state_save_register_item( "ds2401", which, c->tx );
- state_save_register_item_pointer( "ds2401", which, data, SIZE_DATA );
+ state_save_register_generic( "ds2401", which, "data", (UINT8 *)&data[0], data[0], SIZE_DATA );
c->timer = timer_alloc( ds2401_tick , NULL);
c->reset_timer = timer_alloc( ds2401_reset , NULL);
diff --git a/src/emu/machine/ds2401.h b/src/emu/machine/ds2401.h
index 52241177e0e..6acd33b786e 100644
--- a/src/emu/machine/ds2401.h
+++ b/src/emu/machine/ds2401.h
@@ -11,7 +11,7 @@
#define DS2401_MAXCHIP ( 3 )
-extern void ds2401_init( int which, UINT8 *data );
+extern void ds2401_init( int which, const UINT8 *data );
extern void ds2401_write( int which, int data );
extern int ds2401_read( int which );
diff --git a/src/emu/machine/idectrl.c b/src/emu/machine/idectrl.c
index bd08522cdfc..a0a746cb92f 100644
--- a/src/emu/machine/idectrl.c
+++ b/src/emu/machine/idectrl.c
@@ -157,15 +157,15 @@ struct ide_state
UINT8 config_register[IDE_CONFIG_REGISTERS];
UINT8 config_register_num;
- struct ide_interface *intf;
+ const struct ide_interface *intf;
hard_disk_file * disk;
emu_timer * last_status_timer;
emu_timer * reset_timer;
UINT8 master_password_enable;
UINT8 user_password_enable;
- UINT8 * master_password;
- UINT8 * user_password;
+ const UINT8 * master_password;
+ const UINT8 * user_password;
};
@@ -289,7 +289,7 @@ static void ide_controller_exit(running_machine *machine)
}
-int ide_controller_init_custom(int which, struct ide_interface *intf, chd_file *diskhandle)
+int ide_controller_init_custom(int which, const struct ide_interface *intf, chd_file *diskhandle)
{
struct ide_state *ide = &idestate[which];
const hard_disk_info *hdinfo;
@@ -380,7 +380,7 @@ int ide_controller_init_custom(int which, struct ide_interface *intf, chd_file *
return 0;
}
-int ide_controller_init(int which, struct ide_interface *intf)
+int ide_controller_init(int which, const struct ide_interface *intf)
{
/* we only support one hard disk right now; get a handle to it */
return ide_controller_init_custom(which, intf, get_disk_handle(0));
@@ -414,7 +414,7 @@ UINT8 *ide_get_features(int which)
}
-void ide_set_master_password(int which, UINT8 *password)
+void ide_set_master_password(int which, const UINT8 *password)
{
struct ide_state *ide = &idestate[which];
@@ -423,7 +423,7 @@ void ide_set_master_password(int which, UINT8 *password)
}
-void ide_set_user_password(int which, UINT8 *password)
+void ide_set_user_password(int which, const UINT8 *password)
{
struct ide_state *ide = &idestate[which];
diff --git a/src/emu/machine/idectrl.h b/src/emu/machine/idectrl.h
index 0112d6d71f4..a73929bc1f8 100644
--- a/src/emu/machine/idectrl.h
+++ b/src/emu/machine/idectrl.h
@@ -14,13 +14,13 @@ struct ide_interface
void (*interrupt)(int state);
};
-int ide_controller_init(int which, struct ide_interface *intf);
-int ide_controller_init_custom(int which, struct ide_interface *intf, chd_file *diskhandle);
+int ide_controller_init(int which, const struct ide_interface *intf);
+int ide_controller_init_custom(int which, const struct ide_interface *intf, chd_file *diskhandle);
void ide_controller_reset(int which);
UINT8 *ide_get_features(int which);
-void ide_set_master_password(int which, UINT8 *password);
-void ide_set_user_password(int which, UINT8 *password);
+void ide_set_master_password(int which, const UINT8 *password);
+void ide_set_user_password(int which, const UINT8 *password);
int ide_bus_0_r(int select, int offset);
void ide_bus_0_w(int select, int offset, int data);
diff --git a/src/emu/machine/laserdsc.c b/src/emu/machine/laserdsc.c
index 3ab6eeb7412..e1b224602e3 100644
--- a/src/emu/machine/laserdsc.c
+++ b/src/emu/machine/laserdsc.c
@@ -363,7 +363,7 @@ static void vp932_state_changed(laserdisc_info *info, UINT8 oldstate);
GLOBAL VARIABLES
***************************************************************************/
-struct CustomSound_interface laserdisc_custom_interface =
+const struct CustomSound_interface laserdisc_custom_interface =
{
custom_start
};
diff --git a/src/emu/machine/laserdsc.h b/src/emu/machine/laserdsc.h
index 78a404b577d..0da43dcc292 100644
--- a/src/emu/machine/laserdsc.h
+++ b/src/emu/machine/laserdsc.h
@@ -60,7 +60,7 @@ typedef struct _laserdisc_info laserdisc_info;
GLOBAL VARIABLES
***************************************************************************/
-extern struct CustomSound_interface laserdisc_custom_interface;
+extern const struct CustomSound_interface laserdisc_custom_interface;
diff --git a/src/emu/machine/mb87078.c b/src/emu/machine/mb87078.c
index c98eccceccb..432e22816d0 100644
--- a/src/emu/machine/mb87078.c
+++ b/src/emu/machine/mb87078.c
@@ -19,7 +19,7 @@ struct MB87078 {
static struct MB87078 chip[MAX_MB87078];
-static float MB87078_gain_decibel[66]={
+static const float MB87078_gain_decibel[66]={
0.0, -0.5, -1.0, -1.5, -2.0, -2.5, -3.0, -3.5,
-4.0, -4.5, -5.0, -5.5, -6.0, -6.5, -7.0, -7.5,
-8.0, -8.5, -9.0, -9.5,-10.0,-10.5,-11.0,-11.5,
@@ -31,7 +31,7 @@ static float MB87078_gain_decibel[66]={
-32.0, -256.0
};
-static int MB87078_gain_percent[66]={
+static const int MB87078_gain_percent[66]={
100,94,89,84,79,74,70,66,
63,59,56,53,50,47,44,42,
39,37,35,33,31,29,28,26,
diff --git a/src/emu/machine/roc10937.c b/src/emu/machine/roc10937.c
index 59a44b7a04a..4b23c8b1df7 100644
--- a/src/emu/machine/roc10937.c
+++ b/src/emu/machine/roc10937.c
@@ -65,7 +65,7 @@ we actually have 18 segments, including the semicolon portions.
This means our segment maths needs to be more than 16-bit to work!
*/
-static UINT32 roc10937charset[]=
+static const UINT32 roc10937charset[]=
{ // 11 10 FEDC BA98 7654 3210
0x0507F, // 0 0 0101 0000 0111 1111 @.
0x044CF, // 0 0 0100 0100 1100 1111 A.
diff --git a/src/emu/machine/rp5h01.c b/src/emu/machine/rp5h01.c
index 32b46da62ec..3abed1220da 100644
--- a/src/emu/machine/rp5h01.c
+++ b/src/emu/machine/rp5h01.c
@@ -4,7 +4,7 @@
/****************************************************************************/
/* local copy of the interface pointer */
-static struct RP5H01_interface *intf;
+static const struct RP5H01_interface *intf;
/* these also work as the address masks */
enum {
@@ -25,7 +25,7 @@ static RP5H01 RP5H01_state[MAX_RP5H01];
/****************************************************************************/
-int RP5H01_init( struct RP5H01_interface *interface ) {
+int RP5H01_init( const struct RP5H01_interface *interface ) {
int i;
/* setup our local copy of the interface */
diff --git a/src/emu/machine/rp5h01.h b/src/emu/machine/rp5h01.h
index b0bb3898c89..9f9fec7dce6 100644
--- a/src/emu/machine/rp5h01.h
+++ b/src/emu/machine/rp5h01.h
@@ -10,7 +10,7 @@ struct RP5H01_interface {
int offset[MAX_RP5H01]; /* memory offset within the above region where data resides */
};
-int RP5H01_init( struct RP5H01_interface *interface );
+int RP5H01_init( const struct RP5H01_interface *interface );
void RP5H01_enable_w( int which, int data ); /* /CE */
void RP5H01_reset_w( int which, int data ); /* RESET */
void RP5H01_clock_w( int which, int data ); /* DATA CLOCK (active low) */
diff --git a/src/emu/machine/scsi.c b/src/emu/machine/scsi.c
index f01f60d5390..33097caffb7 100644
--- a/src/emu/machine/scsi.c
+++ b/src/emu/machine/scsi.c
@@ -1,8 +1,8 @@
#include "scsi.h"
-void SCSIAllocInstance( SCSIClass *scsiClass, SCSIInstance **instance, int diskId )
+void SCSIAllocInstance( const SCSIClass *scsiClass, SCSIInstance **instance, int diskId )
{
- scsiClass->dispatch( SCSIOP_ALLOC_INSTANCE, scsiClass, diskId, instance );
+ scsiClass->dispatch( SCSIOP_ALLOC_INSTANCE, (void *)scsiClass, diskId, instance );
}
void SCSIDeleteInstance( SCSIInstance *instance )
@@ -60,19 +60,19 @@ void SCSIGetPhase( SCSIInstance *instance, int *phase )
*phase = instance->scsiClass->dispatch( SCSIOP_GET_PHASE, instance, 0, NULL );
}
-int SCSIBase( SCSIClass *scsiClass, int operation, void *file, INT64 intparm, UINT8 *ptrparm )
+int SCSIBase( const SCSIClass *scsiClass, int operation, void *file, INT64 intparm, UINT8 *ptrparm )
{
return scsiClass->baseClass->dispatch( operation, file, intparm, ptrparm );
}
-SCSIInstance *SCSIMalloc( SCSIClass *scsiClass )
+SCSIInstance *SCSIMalloc( const SCSIClass *scsiClass )
{
SCSIInstance *scsiInstance = (SCSIInstance *) malloc_or_die( SCSISizeof( scsiClass ) );
scsiInstance->scsiClass = scsiClass;
return scsiInstance;
}
-void *SCSIThis( SCSIClass *scsiClass, SCSIInstance *instance )
+void *SCSIThis( const SCSIClass *scsiClass, SCSIInstance *instance )
{
if( instance != NULL )
{
@@ -90,7 +90,7 @@ void *SCSIThis( SCSIClass *scsiClass, SCSIInstance *instance )
return NULL;
}
-int SCSISizeof( SCSIClass *scsiClass )
+int SCSISizeof( const SCSIClass *scsiClass )
{
int sizeofData = sizeof( SCSIInstance );
diff --git a/src/emu/machine/scsi.h b/src/emu/machine/scsi.h
index 7097cf38147..38464e0a6bc 100644
--- a/src/emu/machine/scsi.h
+++ b/src/emu/machine/scsi.h
@@ -14,14 +14,14 @@ typedef int (*pSCSIDispatch)( int operation, void *file, INT64 intparm, void *pt
typedef struct _SCSIClass
{
- struct _SCSIClass *baseClass;
+ const struct _SCSIClass *baseClass;
pSCSIDispatch dispatch;
int sizeofData;
} SCSIClass;
typedef struct
{
- SCSIClass *scsiClass;
+ const SCSIClass *scsiClass;
} SCSIInstance;
// commands accepted by a SCSI device's dispatch handler
@@ -45,7 +45,7 @@ typedef struct scsiconfigitem
{
int scsiID;
int diskID;
- SCSIClass *scsiClass;
+ const SCSIClass *scsiClass;
} SCSIConfigItem;
#define SCSI_MAX_DEVICES (16)
@@ -53,7 +53,7 @@ typedef struct scsiconfigitem
typedef struct scsiconfigtable
{
int devs_present;
- SCSIConfigItem devices[SCSI_MAX_DEVICES];
+ const SCSIConfigItem devices[SCSI_MAX_DEVICES];
} SCSIConfigTable;
// SCSI IDs
@@ -77,7 +77,7 @@ enum
#define SCSI_PHASE_MESSAGE_OUT ( 6 )
#define SCSI_PHASE_MESSAGE_IN ( 7 )
-extern void SCSIAllocInstance( SCSIClass *scsiClass, SCSIInstance **instance, int diskId );
+extern void SCSIAllocInstance( const SCSIClass *scsiClass, SCSIInstance **instance, int diskId );
extern void SCSIDeleteInstance( SCSIInstance *instance );
extern void SCSISetDevice( SCSIInstance *instance, void *device );
extern void SCSIGetDevice( SCSIInstance *instance, void **device );
@@ -90,10 +90,10 @@ extern void SCSIReadData( SCSIInstance *instance, void *data, int dataLength );
extern void SCSISetPhase( SCSIInstance *instance, int phase );
extern void SCSIGetPhase( SCSIInstance *instance, int *phase );
-extern SCSIInstance *SCSIMalloc( SCSIClass *scsiClass );
-extern int SCSIBase( SCSIClass *scsiClass, int operation, void *file, INT64 intparm, UINT8 *ptrparm );
-extern void *SCSIThis( SCSIClass *scsiClass, SCSIInstance *instance );
-extern int SCSISizeof( SCSIClass *scsiClass );
+extern SCSIInstance *SCSIMalloc( const SCSIClass *scsiClass );
+extern int SCSIBase( const SCSIClass *scsiClass, int operation, void *file, INT64 intparm, UINT8 *ptrparm );
+extern void *SCSIThis( const SCSIClass *scsiClass, SCSIInstance *instance );
+extern int SCSISizeof( const SCSIClass *scsiClass );
extern int SCSILengthFromUINT8( UINT8 *length );
extern int SCSILengthFromUINT16( UINT8 *length );
diff --git a/src/emu/machine/scsicd.c b/src/emu/machine/scsicd.c
index b611eac5614..a3e0f6f6737 100644
--- a/src/emu/machine/scsicd.c
+++ b/src/emu/machine/scsicd.c
@@ -760,7 +760,7 @@ static int scsicd_dispatch(int operation, void *file, INT64 intparm, void *ptrpa
return SCSIBase( &SCSIClassCDROM, operation, file, intparm, ptrparm );
}
-SCSIClass SCSIClassCDROM =
+const SCSIClass SCSIClassCDROM =
{
&SCSIClassDevice,
scsicd_dispatch,
diff --git a/src/emu/machine/scsicd.h b/src/emu/machine/scsicd.h
index 5300a9563b1..67998398631 100644
--- a/src/emu/machine/scsicd.h
+++ b/src/emu/machine/scsicd.h
@@ -10,7 +10,7 @@
#include "machine/scsi.h"
// CD-ROM handler
-extern SCSIClass SCSIClassCDROM;
+extern const SCSIClass SCSIClassCDROM;
#define SCSI_DEVICE_CDROM &SCSIClassCDROM
#endif
diff --git a/src/emu/machine/scsidev.c b/src/emu/machine/scsidev.c
index 11ac55b1193..3e816e70903 100644
--- a/src/emu/machine/scsidev.c
+++ b/src/emu/machine/scsidev.c
@@ -147,7 +147,7 @@ static int scsidev_dispatch( int operation, void *file, INT64 intparm, void *ptr
return 0;
}
-SCSIClass SCSIClassDevice =
+const SCSIClass SCSIClassDevice =
{
NULL,
scsidev_dispatch,
diff --git a/src/emu/machine/scsidev.h b/src/emu/machine/scsidev.h
index f765e187cbe..984ab7f818e 100644
--- a/src/emu/machine/scsidev.h
+++ b/src/emu/machine/scsidev.h
@@ -10,6 +10,6 @@
#include "machine/scsi.h"
// base handler
-extern SCSIClass SCSIClassDevice;
+extern const SCSIClass SCSIClassDevice;
#endif
diff --git a/src/emu/machine/scsihd.c b/src/emu/machine/scsihd.c
index 81d3770eb71..2c11b5dc889 100644
--- a/src/emu/machine/scsihd.c
+++ b/src/emu/machine/scsihd.c
@@ -303,7 +303,7 @@ static int scsihd_dispatch(int operation, void *file, INT64 intparm, void *ptrpa
return SCSIBase( &SCSIClassHARDDISK, operation, file, intparm, ptrparm );
}
-SCSIClass SCSIClassHARDDISK =
+const SCSIClass SCSIClassHARDDISK =
{
&SCSIClassDevice,
scsihd_dispatch,
diff --git a/src/emu/machine/scsihd.h b/src/emu/machine/scsihd.h
index 4adb0c8fbd3..f4549926655 100644
--- a/src/emu/machine/scsihd.h
+++ b/src/emu/machine/scsihd.h
@@ -10,7 +10,7 @@
#include "machine/scsi.h"
// CD-ROM handler
-extern SCSIClass SCSIClassHARDDISK;
+extern const SCSIClass SCSIClassHARDDISK;
#define SCSI_DEVICE_HARDDISK &SCSIClassHARDDISK
#endif
diff --git a/src/emu/machine/smc91c9x.c b/src/emu/machine/smc91c9x.c
index 4735863fe7f..6eff3f50fc5 100644
--- a/src/emu/machine/smc91c9x.c
+++ b/src/emu/machine/smc91c9x.c
@@ -92,7 +92,7 @@
#define EINT_ERCV 0x40
/* Ethernet register names */
-static const char *ethernet_regname[64] =
+static const char *const ethernet_regname[64] =
{
"TCR", "EPH STATUS", "RCR", "COUNTER", "MIR", "MCR", "(0.6)", "BANK",
"CONFIG", "BASE", "IA0-1", "IA2-3", "IA4-5", "GENERAL PURPOSE", "CONTROL", "BANK",
@@ -164,7 +164,7 @@ static void update_ethernet_irq(void);
*
*************************************/
-void smc91c94_init(struct smc91c9x_interface *config)
+void smc91c94_init(const struct smc91c9x_interface *config)
{
ethernet.irq_handler = config->irq_handler;
}
diff --git a/src/emu/machine/smc91c9x.h b/src/emu/machine/smc91c9x.h
index 2cef861294c..6abc6c001a5 100644
--- a/src/emu/machine/smc91c9x.h
+++ b/src/emu/machine/smc91c9x.h
@@ -14,7 +14,7 @@ struct smc91c9x_interface
void (*irq_handler)(int state);
};
-void smc91c94_init(struct smc91c9x_interface *config);
+void smc91c94_init(const struct smc91c9x_interface *config);
void smc91c94_reset(void);
READ16_HANDLER( smc91c94_r );
WRITE16_HANDLER( smc91c94_w );
diff --git a/src/emu/machine/wd33c93.c b/src/emu/machine/wd33c93.c
index 9fa3bb408ae..03b8f4455b0 100644
--- a/src/emu/machine/wd33c93.c
+++ b/src/emu/machine/wd33c93.c
@@ -18,7 +18,7 @@
#define VERBOSE 0
static SCSIInstance *devices[8]; // SCSI IDs 0-7
-static struct WD33C93interface *intf;
+static const struct WD33C93interface *intf;
/* wd register names */
#define WD_OWN_ID 0x00
@@ -457,7 +457,7 @@ static void wd33c93_xferinfo_cmd( void )
}
/* Command handlers */
-static cmd_handler wd33c93_cmds[0x22] =
+static const cmd_handler wd33c93_cmds[0x22] =
{
&wd33c93_reset_cmd, /* 0x00 - WD_CMD_RESET */
&wd33c93_abort_cmd, /* 0x01 - WD_CMD_ABORT */
@@ -785,7 +785,7 @@ READ8_HANDLER(wd33c93_r)
return 0;
}
-extern void wd33c93_init( struct WD33C93interface *interface )
+extern void wd33c93_init( const struct WD33C93interface *interface )
{
int i;
diff --git a/src/emu/machine/wd33c93.h b/src/emu/machine/wd33c93.h
index 99f13944b9d..4e967941465 100644
--- a/src/emu/machine/wd33c93.h
+++ b/src/emu/machine/wd33c93.h
@@ -10,11 +10,11 @@
struct WD33C93interface
{
- SCSIConfigTable *scsidevs; /* SCSI devices */
+ const SCSIConfigTable *scsidevs; /* SCSI devices */
void (*irq_callback)(int state); /* irq callback */
};
-extern void wd33c93_init( struct WD33C93interface *interface );
+extern void wd33c93_init( const struct WD33C93interface *interface );
extern void wd33c93_get_dma_data(int bytes, UINT8 *pData);
extern void wd33c93_write_data(int bytes, UINT8 *pData);
extern void *wd33c93_get_device(int id);
diff --git a/src/emu/machine/z80pio.c b/src/emu/machine/z80pio.c
index 81f293b83c9..aa893e027f7 100644
--- a/src/emu/machine/z80pio.c
+++ b/src/emu/machine/z80pio.c
@@ -167,7 +167,7 @@ static void update_irq_state(z80pio *pio, int ch)
INITIALIZATION/CONFIGURATION
***************************************************************************/
-void z80pio_init(int which, z80pio_interface *intf)
+void z80pio_init(int which, const z80pio_interface *intf)
{
z80pio *pio = pios + which;
diff --git a/src/emu/machine/z80pio.h b/src/emu/machine/z80pio.h
index e699ce0de03..adfb54fb735 100644
--- a/src/emu/machine/z80pio.h
+++ b/src/emu/machine/z80pio.h
@@ -33,7 +33,7 @@ typedef struct _z80pio_interface z80pio_interface;
INITIALIZATION/CONFIGURATION
***************************************************************************/
-void z80pio_init(int which, z80pio_interface *intf);
+void z80pio_init(int which, const z80pio_interface *intf);
void z80pio_reset(int which);
diff --git a/src/emu/mame.c b/src/emu/mame.c
index 2d23eaad4e5..0934fa3ff4f 100644
--- a/src/emu/mame.c
+++ b/src/emu/mame.c
@@ -190,7 +190,7 @@ static output_callback output_cb[OUTPUT_CHANNEL_COUNT];
static void *output_cb_param[OUTPUT_CHANNEL_COUNT];
/* the "disclaimer" that should be printed when run with no parameters */
-const char *mame_disclaimer =
+const char mame_disclaimer[] =
"MAME is an emulator: it reproduces, more or less faithfully, the behaviour of\n"
"several arcade machines. But hardware is useless without software, so an image\n"
"of the ROMs which run on that hardware is required. Such ROMs, like any other\n"
@@ -200,7 +200,7 @@ const char *mame_disclaimer =
"images is a violation of copyright law and should be promptly reported to the\n"
"authors so that appropriate legal action can be taken.\n";
-const char *memory_region_names[REGION_MAX] =
+const char *const memory_region_names[REGION_MAX] =
{
"REGION_INVALID",
"REGION_CPU1",
diff --git a/src/emu/mame.h b/src/emu/mame.h
index 328ee632c8d..97b34c24990 100644
--- a/src/emu/mame.h
+++ b/src/emu/mame.h
@@ -148,7 +148,7 @@ enum
REGION_MAX
};
-extern const char *memory_region_names[REGION_MAX];
+extern const char *const memory_region_names[REGION_MAX];
@@ -249,7 +249,7 @@ struct _mame_system_time
***************************************************************************/
extern running_machine *Machine;
-extern const char *mame_disclaimer;
+extern const char mame_disclaimer[];
extern char giant_string_buffer[];
extern char build_version[];
diff --git a/src/emu/mamecore.c b/src/emu/mamecore.c
index aa3cf98c9d0..dfc2039bcc7 100644
--- a/src/emu/mamecore.c
+++ b/src/emu/mamecore.c
@@ -14,4 +14,4 @@
#include <ctype.h>
/* a giant string buffer for temporary strings */
-char giant_string_buffer[GIANT_STRING_BUFFER_SIZE];
+char giant_string_buffer[GIANT_STRING_BUFFER_SIZE] = { 0 };
diff --git a/src/emu/memory.c b/src/emu/memory.c
index eade6d00fe7..90e027382e2 100644
--- a/src/emu/memory.c
+++ b/src/emu/memory.c
@@ -243,7 +243,7 @@ struct _addrspace_data
UINT64 unmap; /* unmapped value */
table_data read; /* memory read lookup table */
table_data write; /* memory write lookup table */
- data_accessors * accessors; /* pointer to the memory accessors */
+ const data_accessors * accessors; /* pointer to the memory accessors */
address_map * map; /* original memory map */
address_map * adjmap; /* adjusted memory map */
};
@@ -300,7 +300,7 @@ static debug_hook_read_ptr debug_hook_read; /* pointer to debugger callback f
static debug_hook_write_ptr debug_hook_write; /* pointer to debugger callback for memory writes */
#endif
-static data_accessors memory_accessors[ADDRESS_SPACES][4][2] =
+static const data_accessors memory_accessors[ADDRESS_SPACES][4][2] =
{
/* program accessors */
{
@@ -363,7 +363,7 @@ static data_accessors memory_accessors[ADDRESS_SPACES][4][2] =
},
};
-const char *address_space_names[ADDRESS_SPACES] = { "program", "data", "I/O" };
+const char *const address_space_names[ADDRESS_SPACES] = { "program", "data", "I/O" };
/*-------------------------------------------------
@@ -3254,7 +3254,7 @@ static genf *get_static_handler(int databits, int readorwrite, int spacenum, int
static const char *handler_to_string(const table_data *table, UINT8 entry)
{
- static const char *strings[] =
+ static const char *const strings[] =
{
"invalid", "bank 1", "bank 2", "bank 3",
"bank 4", "bank 5", "bank 6", "bank 7",
diff --git a/src/emu/memory.h b/src/emu/memory.h
index 61f59a3d654..87a84ec5e27 100644
--- a/src/emu/memory.h
+++ b/src/emu/memory.h
@@ -591,7 +591,7 @@ struct _address_space
UINT8 * writelookup; /* write table lookup */
handler_data * readhandlers; /* read handlers */
handler_data * writehandlers; /* write handlers */
- data_accessors * accessors; /* pointers to the data access handlers */
+ const data_accessors * accessors; /* pointers to the data access handlers */
};
@@ -728,7 +728,7 @@ enum
ADDRESS_SPACES /* maximum number of address spaces */
};
-extern const char *address_space_names[ADDRESS_SPACES];
+extern const char *const address_space_names[ADDRESS_SPACES];
/* ----- address map lookup table definitions ----- */
#define SUBTABLE_COUNT 64 /* number of slots reserved for subtables */
diff --git a/src/emu/profiler.c b/src/emu/profiler.c
index 7c70ee4abc2..65bfb91648b 100644
--- a/src/emu/profiler.c
+++ b/src/emu/profiler.c
@@ -102,7 +102,7 @@ const char *profiler_get_text(void)
int i,j;
UINT64 total,normalize;
UINT64 computed;
- static const char *names[PROFILER_TOTAL] =
+ static const char *const names[PROFILER_TOTAL] =
{
"CPU 1 ",
"CPU 2 ",
diff --git a/src/emu/rendlay.c b/src/emu/rendlay.c
index 95f92443ede..04b7c6f61c8 100644
--- a/src/emu/rendlay.c
+++ b/src/emu/rendlay.c
@@ -1772,7 +1772,7 @@ static layout_view *load_layout_view(xml_data_node *viewnode, layout_element *el
/* loop over all the layer types we support */
for (layer = 0; layer < ITEM_LAYER_MAX; layer++)
{
- static const char *layer_node_name[ITEM_LAYER_MAX] = { "backdrop", "screen", "overlay", "bezel" };
+ static const char *const layer_node_name[ITEM_LAYER_MAX] = { "backdrop", "screen", "overlay", "bezel" };
xml_data_node *itemnode;
/* initialize the list */
diff --git a/src/emu/sound/c140.c b/src/emu/sound/c140.c
index 180a34b2bab..9cc4922a1e2 100644
--- a/src/emu/sound/c140.c
+++ b/src/emu/sound/c140.c
@@ -138,7 +138,7 @@ static long find_sample(struct c140_info *info, long adrs, long bank, int voice)
{
long newadr = 0;
- static INT16 asic219banks[4] = { 0x1f7, 0x1f1, 0x1f3, 0x1f5 };
+ static const INT16 asic219banks[4] = { 0x1f7, 0x1f1, 0x1f3, 0x1f5 };
adrs=(bank<<16)+adrs;
diff --git a/src/emu/sound/c6280.c b/src/emu/sound/c6280.c
index e2e01f30ddd..49dbfa011b6 100644
--- a/src/emu/sound/c6280.c
+++ b/src/emu/sound/c6280.c
@@ -214,7 +214,7 @@ static void c6280_write(c6280_t *p, int offset, int data)
static void c6280_update(void *param, stream_sample_t **inputs, stream_sample_t **buffer, int length)
{
- static int scale_tab[] = {
+ static const int scale_tab[] = {
0x00, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
0x10, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F
};
diff --git a/src/emu/sound/discrete.c b/src/emu/sound/discrete.c
index 25b3e03024b..bc6d43f979f 100644
--- a/src/emu/sound/discrete.c
+++ b/src/emu/sound/discrete.c
@@ -162,7 +162,7 @@ static void CLIB_DECL discrete_log(const char *text, ...)
*
*************************************/
-static discrete_module module_list[] =
+static const discrete_module module_list[] =
{
{ DSO_OUTPUT ,"DSO_OUTPUT" ,0 ,NULL ,NULL },
{ DSO_CSVLOG ,"DSO_CSVLOG" ,0 ,NULL ,NULL },
diff --git a/src/emu/sound/es5503.c b/src/emu/sound/es5503.c
index 86bb1a5a5f2..c804d7fab73 100644
--- a/src/emu/sound/es5503.c
+++ b/src/emu/sound/es5503.c
@@ -79,10 +79,10 @@ typedef struct
UINT32 output_rate;
} ES5503Chip;
-static UINT16 wavesizes[8] = { 256, 512, 1024, 2048, 4096, 8192, 16384, 32768 };
-static UINT32 wavemasks[8] = { 0x1ff00, 0x1fe00, 0x1fc00, 0x1f800, 0x1f000, 0x1e000, 0x1c000, 0x18000 };
-static UINT32 accmasks[8] = { 0xff, 0x1ff, 0x3ff, 0x7ff, 0xfff, 0x1fff, 0x3fff, 0x7fff };
-static int resshifts[8] = { 9, 10, 11, 12, 13, 14, 15, 16 };
+static const UINT16 wavesizes[8] = { 256, 512, 1024, 2048, 4096, 8192, 16384, 32768 };
+static const UINT32 wavemasks[8] = { 0x1ff00, 0x1fe00, 0x1fc00, 0x1f800, 0x1f000, 0x1e000, 0x1c000, 0x18000 };
+static const UINT32 accmasks[8] = { 0xff, 0x1ff, 0x3ff, 0x7ff, 0xfff, 0x1fff, 0x3fff, 0x7fff };
+static const int resshifts[8] = { 9, 10, 11, 12, 13, 14, 15, 16 };
enum
{
diff --git a/src/emu/sound/flt_rc.c b/src/emu/sound/flt_rc.c
index 0a6c864a746..5e68cbb5b1b 100644
--- a/src/emu/sound/flt_rc.c
+++ b/src/emu/sound/flt_rc.c
@@ -11,7 +11,7 @@ struct filter_rc_info
int type;
};
-flt_rc_config flt_rc_ac_default = {FLT_RC_AC, 10000, 0, 0, CAP_U(1)};
+const flt_rc_config flt_rc_ac_default = {FLT_RC_AC, 10000, 0, 0, CAP_U(1)};
static void filter_rc_update(void *param, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
diff --git a/src/emu/sound/flt_rc.h b/src/emu/sound/flt_rc.h
index 189d98c3651..c8b16324df8 100644
--- a/src/emu/sound/flt_rc.h
+++ b/src/emu/sound/flt_rc.h
@@ -52,7 +52,7 @@ struct _flt_rc_config
double C;
};
-extern flt_rc_config flt_rc_ac_default;
+extern const flt_rc_config flt_rc_ac_default;
void filter_rc_set_RC(int num, int type, double R1, double R2, double R3, double C);
diff --git a/src/emu/sound/fm.c b/src/emu/sound/fm.c
index aca7d18584e..fd1e4a34ecc 100644
--- a/src/emu/sound/fm.c
+++ b/src/emu/sound/fm.c
@@ -2333,7 +2333,7 @@ typedef struct
UINT8 addr_A1; /* address line A1 */
/* ADPCM-A unit */
- UINT8 *pcmbuf; /* pcm rom buffer */
+ const UINT8 *pcmbuf; /* pcm rom buffer */
UINT32 pcm_size; /* size of pcm rom */
UINT8 adpcmTL; /* adpcmA total level */
ADPCM_CH adpcm[6]; /* adpcm channels */
@@ -2353,14 +2353,14 @@ typedef YM2610 YM2608;
#define ADPCM_SHIFT (16) /* frequency step rate */
#define ADPCMA_ADDRESS_SHIFT 8 /* adpcm A address shift */
-static UINT8 *pcmbufA;
+static const UINT8 *pcmbufA;
static UINT32 pcmsizeA;
/* Algorithm and tables verified on real YM2608 and YM2610 */
/* usual ADPCM table (16 * 1.1^N) */
-static int steps[49] =
+static const int steps[49] =
{
16, 17, 19, 21, 23, 25, 28,
31, 34, 37, 41, 45, 50, 55,
@@ -2372,7 +2372,7 @@ static int steps[49] =
};
/* different from the usual ADPCM table */
-static int step_inc[8] = { -1*16, -1*16, -1*16, -1*16, 2*16, 5*16, 7*16, 9*16 };
+static const int step_inc[8] = { -1*16, -1*16, -1*16, -1*16, 2*16, 5*16, 7*16, 9*16 };
/* speedup purposes only */
static int jedi_table[ 49*16 ];
@@ -2599,7 +2599,7 @@ static void FMsave_state_adpcma(const char *name,int num,ADPCM_CH *adpcm)
-static unsigned int YM2608_ADPCM_ROM_addr[2*6] = {
+static const unsigned int YM2608_ADPCM_ROM_addr[2*6] = {
0x0000, 0x01bf, /* bass drum */
0x01c0, 0x043f, /* snare drum */
0x0440, 0x1b7f, /* top cymbal */
@@ -2614,7 +2614,7 @@ static unsigned int YM2608_ADPCM_ROM_addr[2*6] = {
It was verified, using real YM2608, that this ADPCM stream produces 100% correct output signal.
*/
-static unsigned char YM2608_ADPCM_ROM[0x2000] = {
+static const unsigned char YM2608_ADPCM_ROM[0x2000] = {
/* Source: 01BD.ROM */
/* Length: 448 / 0x000001C0 */
@@ -4119,7 +4119,7 @@ void *YM2610Init(void *param, int index, int clock, int rate,
F2610->OPN.ST.IRQ_Handler = IRQHandler;
F2610->OPN.ST.SSG = ssg;
/* ADPCM */
- F2610->pcmbuf = (UINT8 *)pcmroma;
+ F2610->pcmbuf = (const UINT8 *)pcmroma;
F2610->pcm_size = pcmsizea;
/* DELTA-T */
F2610->deltaT.memory = (UINT8 *)pcmromb;
diff --git a/src/emu/sound/k007232.c b/src/emu/sound/k007232.c
index 53c33c346e7..3e4f609bfee 100644
--- a/src/emu/sound/k007232.c
+++ b/src/emu/sound/k007232.c
@@ -58,7 +58,7 @@ typedef struct kdacApcm
#if 0
-static int kdac_note[] = {
+static const int kdac_note[] = {
261.63/8, 277.18/8,
293.67/8, 311.13/8,
329.63/8,
@@ -70,7 +70,7 @@ static int kdac_note[] = {
523.25/8,
};
-static float kdaca_fn[][2] = {
+static const float kdaca_fn[][2] = {
/* B */
{ 0x03f, 493.88/8 }, /* ?? */
{ 0x11f, 493.88/4 }, /* ?? */
diff --git a/src/emu/sound/k053260.c b/src/emu/sound/k053260.c
index 6a6b6fc1d1a..054e281d6c6 100644
--- a/src/emu/sound/k053260.c
+++ b/src/emu/sound/k053260.c
@@ -95,7 +95,7 @@ INLINE int limit( int val, int max, int min ) {
#define MINOUT -0x8000
static void K053260_update( void * param, stream_sample_t **inputs, stream_sample_t **buffer, int length ) {
- static long dpcmcnv[] = { 0,1,2,4,8,16,32,64, -128, -64, -32, -16, -8, -4, -2, -1};
+ static const long dpcmcnv[] = { 0,1,2,4,8,16,32,64, -128, -64, -32, -16, -8, -4, -2, -1};
int i, j, lvol[4], rvol[4], play[4], loop[4], ppcm_data[4], ppcm[4];
unsigned char *rom[4];
diff --git a/src/emu/sound/k054539.c b/src/emu/sound/k054539.c
index 1d5c13a4ab9..1677ed3085b 100644
--- a/src/emu/sound/k054539.c
+++ b/src/emu/sound/k054539.c
@@ -123,7 +123,7 @@ static void K054539_update(void *param, stream_sample_t **inputs, stream_sample_
struct k054539_info *info = param;
#define VOL_CAP 1.80
- static INT16 dpcm[16] = {
+ static const INT16 dpcm[16] = {
0<<8, 1<<8, 4<<8, 9<<8, 16<<8, 25<<8, 36<<8, 49<<8,
-64<<8, -49<<8, -36<<8, -25<<8, -16<<8, -9<<8, -4<<8, -1<<8
};
@@ -368,7 +368,7 @@ else
#if CHANNEL_DEBUG
{
- static char gc_msg[32] = "chip : ";
+ static const char gc_msg[32] = "chip : ";
static int gc_active=0, gc_chip=0, gc_pos[2]={0,0};
double *gc_fptr;
char *gc_cptr;
diff --git a/src/emu/sound/msm5232.c b/src/emu/sound/msm5232.c
index 0853d38acb2..ef065e1f5ec 100644
--- a/src/emu/sound/msm5232.c
+++ b/src/emu/sound/msm5232.c
@@ -179,8 +179,8 @@ static void msm5232_init_tables( MSM5232 *chip )
#if 0
{
/* rate tables (in miliseconds) */
- static int ATBL[8] = { 2,4,8,16, 32,64, 32,64};
- static int DTBL[16]= { 40,80,160,320, 640,1280, 640,1280,
+ static const int ATBL[8] = { 2,4,8,16, 32,64, 32,64};
+ static const int DTBL[16]= { 40,80,160,320, 640,1280, 640,1280,
333,500,1000,2000, 4000,8000, 4000,8000};
for (i=0; i<8; i++)
{
diff --git a/src/emu/sound/multipcm.c b/src/emu/sound/multipcm.c
index 414d7681a0f..8310235d0a9 100644
--- a/src/emu/sound/multipcm.c
+++ b/src/emu/sound/multipcm.c
@@ -35,7 +35,7 @@
#define MULTIPCM_CLOCKDIV (360.0)
#define MULTIPCM_ONE (18)
-static int ctbl[] =
+static const int ctbl[] =
{
0, 1, 2, 3, 4, 5, 6 , -1, // voice number mapping
7, 8, 9, 10,11,12,13, -1,
@@ -43,7 +43,7 @@ static int ctbl[] =
21,22,23,24,25,26,27, -1,
};
-static int decaytbl[16] = // decay times
+static const int decaytbl[16] = // decay times
{
0, 300, 800, 1400,
2100, 3000, 4000, 5200,
diff --git a/src/emu/sound/okim6295.c b/src/emu/sound/okim6295.c
index 6b42a68e020..119897c6409 100644
--- a/src/emu/sound/okim6295.c
+++ b/src/emu/sound/okim6295.c
@@ -86,7 +86,7 @@ const struct OKIM6295interface okim6295_interface_region_4_pin7low = { REGION_SO
static void compute_tables(void)
{
/* nibble to bit map */
- static int nbl2bit[16][4] =
+ static const int nbl2bit[16][4] =
{
{ 1, 0, 0, 0}, { 1, 0, 0, 1}, { 1, 0, 1, 0}, { 1, 0, 1, 1},
{ 1, 1, 0, 0}, { 1, 1, 0, 1}, { 1, 1, 1, 0}, { 1, 1, 1, 1},
diff --git a/src/emu/sound/s14001a.c b/src/emu/sound/s14001a.c
index 306b537db8d..7e50a5b5d1b 100644
--- a/src/emu/sound/s14001a.c
+++ b/src/emu/sound/s14001a.c
@@ -172,7 +172,7 @@ typedef struct
#define REPEATCOUNT ((chip->PlayParams<<1)&0x6) // remember: its 3 bits and the bottom bit is always zero!
#define LOCALSILENCESTATE ((chip->OutputCounter & 0x2) && (MIRRORMODE)) // 1 when silent output, 0 when DAC output.
-static INT8 DeltaTable[4][4] =
+static const INT8 DeltaTable[4][4] =
{
{ 0xCD, 0xCD, 0xEF, 0xEF, },
{ 0xEF, 0xEF, 0x00, 0x00, },
diff --git a/src/emu/sound/scsp.c b/src/emu/sound/scsp.c
index a24ed931946..542c53a448a 100644
--- a/src/emu/sound/scsp.c
+++ b/src/emu/sound/scsp.c
@@ -411,6 +411,8 @@ static int EG_Update(struct _SLOT *slot)
break;
case DECAY1:
slot->EG.volume-=slot->EG.D1R;
+ if(slot->EG.volume<=0)
+ slot->EG.volume=0;
if(slot->EG.volume>>(EG_SHIFT+5)<slot->EG.DL)
slot->EG.state=DECAY2;
break;
@@ -1063,7 +1065,7 @@ SCSPTMPL(1,1,1,3)
typedef void (*_SCSPUpdateModes)(struct _SCSP *,struct _SLOT *,unsigned int,unsigned int);
-static _SCSPUpdateModes SCSPUpdateModes[]=
+static const _SCSPUpdateModes SCSPUpdateModes[]=
{
SCSPTMPL(0,0,0,0)
SCSPTMPL(0,0,0,1)
@@ -1225,18 +1227,18 @@ INLINE INT32 SCSP_UpdateSlot(struct _SCSP *SCSP, struct _SLOT *slot)
switch(LPCTL(slot))
{
case 0: //no loop
- if(addr>LEA(slot))
+ if(addr>=LEA(slot))
{
//slot->active=0;
SCSP_StopSlot(slot,0);
}
break;
case 1: //normal loop
- if(addr>LEA(slot))
+ if(addr>=LEA(slot))
slot->cur_addr=LSA(slot)<<SHIFT;
break;
case 2: //reverse loop
- if(addr>LEA(slot))
+ if(addr>=LEA(slot))
{
slot->cur_addr=LEA(slot)<<SHIFT;
slot->Backwards=1;
@@ -1245,7 +1247,7 @@ INLINE INT32 SCSP_UpdateSlot(struct _SCSP *SCSP, struct _SLOT *slot)
slot->cur_addr=LEA(slot)<<SHIFT;
break;
case 3: //ping-pong
- if(addr>LEA(slot)) //reached end, reverse till start
+ if(addr>=LEA(slot)) //reached end, reverse till start
{
slot->cur_addr=LEA(slot)<<SHIFT;
slot->Backwards=1;
@@ -1302,12 +1304,13 @@ static void SCSP_DoMasterSamples(struct _SCSP *SCSP, int nsamples)
++SCSP->BUFPTR;
SCSP->BUFPTR&=63;
#ifdef USEDSP
- SCSPDSP_SetSample(&SCSP->DSP,sample>>SHIFT,ISEL(slot),IMXL(slot));
+ Enc=((TL(slot))<<0x0)|((IMXL(slot))<<0xd);
+ SCSPDSP_SetSample(&SCSP->DSP,(sample*SCSP->LPANTABLE[Enc])>>SHIFT,ISEL(slot),IMXL(slot));
#endif
Enc=((TL(slot))<<0x0)|((DIPAN(slot))<<0x8)|((DISDL(slot))<<0xd);
{
- smpl+=(sample*SCSP->LPANTABLE[Enc])>>SHIFT;
- smpr+=(sample*SCSP->RPANTABLE[Enc])>>SHIFT;
+ smpl+=(sample*SCSP->LPANTABLE[Enc])>>SHIFT;
+ smpr+=(sample*SCSP->RPANTABLE[Enc])>>SHIFT;
}
}
@@ -1320,14 +1323,14 @@ static void SCSP_DoMasterSamples(struct _SCSP *SCSP, int nsamples)
struct _SLOT *slot=SCSP->Slots+i;
if(EFSDL(slot))
{
- unsigned short Enc=(TL(slot))|((EFPAN(slot))<<0x8)|((EFSDL(slot))<<0xd);
- smpl+=(SCSP->DSP.EFREG[i]*SCSP->LPANTABLE[Enc])>>(SHIFT-4);
- smpr+=(SCSP->DSP.EFREG[i]*SCSP->RPANTABLE[Enc])>>(SHIFT-4);
+ unsigned short Enc=((EFPAN(slot))<<0x8)|((EFSDL(slot))<<0xd);
+ smpl+=(SCSP->DSP.EFREG[i]*SCSP->LPANTABLE[Enc])>>SHIFT;
+ smpr+=(SCSP->DSP.EFREG[i]*SCSP->RPANTABLE[Enc])>>SHIFT;
}
}
- *bufl++ = ICLIP16(smpl>>4);
- *bufr++ = ICLIP16(smpr>>4);
+ *bufl++ = ICLIP16(smpl>>2);
+ *bufr++ = ICLIP16(smpr>>2);
}
}
#endif
diff --git a/src/emu/sound/scspdsp.c b/src/emu/sound/scspdsp.c
index 9a417c47443..bb30dd376be 100644
--- a/src/emu/sound/scspdsp.c
+++ b/src/emu/sound/scspdsp.c
@@ -6,19 +6,49 @@
static UINT16 PACK(INT32 val)
{
- //cut to 16 bits
- INT32 f=((UINT32 ) val)>>8;
- return f;
+ UINT32 temp;
+ int sign,exponent,k;
+
+ sign = (val >> 23) & 0x1;
+ temp = (val ^ (val << 1)) & 0xFFFFFF;
+ exponent = 0;
+ for (k=0; k<12; k++)
+ {
+ if (temp & 0x800000)
+ break;
+ temp <<= 1;
+ exponent += 1;
+ }
+ if (exponent < 12)
+ val = (val << exponent) & 0x3FFFFF;
+ else
+ val <<= 11;
+ val >>= 11;
+ val |= sign << 15;
+ val |= exponent << 11;
+
+ return (UINT16)val;
}
static INT32 UNPACK(UINT16 val)
{
- INT32 r=val<<8;
- r<<=8;
- r>>=8;
- //if(r&0x00800000)
- // r|=0xFF000000;
- return r;
+ int sign,exponent,mantissa;
+ INT32 uval;
+
+ sign = (val >> 15) & 0x1;
+ exponent = (val >> 11) & 0xF;
+ mantissa = val & 0x7FF;
+ uval = mantissa << 11;
+ if (exponent > 11)
+ exponent = 11;
+ else
+ uval |= (sign ^ 1) << 22;
+ uval |= sign << 23;
+ uval <<= 8;
+ uval >>= 8;
+ uval >>= exponent;
+
+ return uval;
}
void SCSPDSP_Init(struct _SCSPDSP *DSP)
@@ -125,7 +155,7 @@ void SCSPDSP_Step(struct _SCSPDSP *DSP)
if(IRA<=0x1f)
INPUTS=DSP->MEMS[IRA];
else if(IRA<=0x2F)
- INPUTS=DSP->MIXS[IRA-0x20]<<8; //MIXS is 16 bit
+ INPUTS=DSP->MIXS[IRA-0x20]<<4; //MIXS is 20 bit
else if(IRA<=0x31)
INPUTS=0;
@@ -298,7 +328,7 @@ void SCSPDSP_Step(struct _SCSPDSP *DSP)
void SCSPDSP_SetSample(struct _SCSPDSP *DSP,INT32 sample,int SEL,int MXL)
{
//DSP->MIXS[SEL]+=sample<<(MXL+1)/*7*/;
- DSP->MIXS[SEL]+=sample<<7;
+ DSP->MIXS[SEL]+=sample;
// if(MXL)
// int a=1;
}
diff --git a/src/emu/sound/scsplfo.c b/src/emu/sound/scsplfo.c
index dc9dcca674c..01023a4ba82 100644
--- a/src/emu/sound/scsplfo.c
+++ b/src/emu/sound/scsplfo.c
@@ -28,10 +28,10 @@ struct _LFO
static int PLFO_TRI[256],PLFO_SQR[256],PLFO_SAW[256],PLFO_NOI[256];
static int ALFO_TRI[256],ALFO_SQR[256],ALFO_SAW[256],ALFO_NOI[256];
-static float LFOFreq[32]={0.17,0.19,0.23,0.27,0.34,0.39,0.45,0.55,0.68,0.78,0.92,1.10,1.39,1.60,1.87,2.27,
+static const float LFOFreq[32]={0.17,0.19,0.23,0.27,0.34,0.39,0.45,0.55,0.68,0.78,0.92,1.10,1.39,1.60,1.87,2.27,
2.87,3.31,3.92,4.79,6.15,7.18,8.60,10.8,14.4,17.2,21.5,28.7,43.1,57.4,86.1,172.3};
-static float ASCALE[8]={0.0,0.4,0.8,1.5,3.0,6.0,12.0,24.0};
-static float PSCALE[8]={0.0,7.0,13.5,27.0,55.0,112.0,230.0,494};
+static const float ASCALE[8]={0.0,0.4,0.8,1.5,3.0,6.0,12.0,24.0};
+static const float PSCALE[8]={0.0,7.0,13.5,27.0,55.0,112.0,230.0,494};
static int PSCALES[8][256];
static int ASCALES[8][256];
@@ -47,7 +47,7 @@ static void LFO_Init(void)
if(i<128)
p=i;
else
- p=255-i;
+ p=i-256;
ALFO_SAW[i]=a;
PLFO_SAW[i]=p;
diff --git a/src/emu/sound/side6581.h b/src/emu/sound/side6581.h
index 8e2a5b8e829..149f5e24edf 100644
--- a/src/emu/sound/side6581.h
+++ b/src/emu/sound/side6581.h
@@ -11,7 +11,7 @@
// C64 C PAL, MOS 6581R4 1686 S
//
-static UINT8 releaseTab[] =
+static const UINT8 releaseTab[] =
{
255, 255, 254, 254, 253, 253, 252, 252, 251, 251, 250, 250, 249, 249, 248,
248, 247, 247, 246, 246, 245, 245, 244, 244, 243, 243, 242, 242, 241, 241,
diff --git a/src/emu/sound/sidenvel.c b/src/emu/sound/sidenvel.c
index 2958b8a9b24..a042f303baa 100644
--- a/src/emu/sound/sidenvel.c
+++ b/src/emu/sound/sidenvel.c
@@ -46,7 +46,7 @@ const UINT8 masterVolumeLevels[16] =
static UINT16 masterAmplModTable[16*256];
-static float attackTimes[16] =
+static const float attackTimes[16] =
{
/* milliseconds */
#if defined(SID_REFTIMES)
@@ -60,7 +60,7 @@ static float attackTimes[16] =
#endif
};
-static float decayReleaseTimes[16] =
+static const float decayReleaseTimes[16] =
{
/* milliseconds */
#if defined(SID_REFTIMES)
diff --git a/src/emu/sound/sidw6581.h b/src/emu/sound/sidw6581.h
index c18445a3f10..d66bf58d85c 100644
--- a/src/emu/sound/sidw6581.h
+++ b/src/emu/sound/sidw6581.h
@@ -8,7 +8,7 @@
* Copyright (C) 1998 Dag Lem <resid@nimrod.no>
*/
-static UINT8 waveform30_6581[4096] =
+static const UINT8 waveform30_6581[4096] =
{
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
@@ -268,7 +268,7 @@ static UINT8 waveform30_6581[4096] =
0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3e,0x3e,0x3f,0x3f,0x7f,0x7f,0x7f,0x7f
};
-static UINT8 waveform50_6581[4096+4096] =
+static const UINT8 waveform50_6581[4096+4096] =
{
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
@@ -528,7 +528,7 @@ static UINT8 waveform50_6581[4096+4096] =
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0
};
-static UINT8 waveform60_6581[4096+4096] =
+static const UINT8 waveform60_6581[4096+4096] =
{
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
@@ -788,7 +788,7 @@ static UINT8 waveform60_6581[4096+4096] =
0x70,0x7c,0x7c,0x7f,0x7c,0x7f,0x7f,0x7f,0x7e,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f
};
-static UINT8 waveform70_6581[4096+4096] =
+static const UINT8 waveform70_6581[4096+4096] =
{
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
diff --git a/src/emu/sound/sidw8580.h b/src/emu/sound/sidw8580.h
index 226d2e18b34..033d550c228 100644
--- a/src/emu/sound/sidw8580.h
+++ b/src/emu/sound/sidw8580.h
@@ -7,7 +7,7 @@
* Created with Deadman's Raw Data to C Header converter
*/
-static UINT8 waveform30_8580[4096] =
+static const UINT8 waveform30_8580[4096] =
{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
@@ -353,7 +353,7 @@ static UINT8 waveform30_8580[4096] =
0xff,0xff,0xff,0xff
};
-static UINT8 waveform50_8580[4096+4096] =
+static const UINT8 waveform50_8580[4096+4096] =
{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
@@ -699,7 +699,7 @@ static UINT8 waveform50_8580[4096+4096] =
0x00,0x00,0x00,0x00
};
-static UINT8 waveform60_8580[4096+4096] =
+static const UINT8 waveform60_8580[4096+4096] =
{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
@@ -1045,7 +1045,7 @@ static UINT8 waveform60_8580[4096+4096] =
0xff,0xff,0xff,0xff
};
-static UINT8 waveform70_8580[4096+4096] =
+static const UINT8 waveform70_8580[4096+4096] =
{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
diff --git a/src/emu/sound/sn76477.c b/src/emu/sound/sn76477.c
index 34db6ea018e..a9a25eac9f3 100644
--- a/src/emu/sound/sn76477.c
+++ b/src/emu/sound/sn76477.c
@@ -643,7 +643,7 @@ static double compute_center_to_peak_voltage_out(struct SN76477 *sn)
static void log_enable_line(struct SN76477 *sn)
{
#if VERBOSE
- static const char *desc[] =
+ static const char *const desc[] =
{
"Enabled", "Inhibited"
};
diff --git a/src/emu/sound/sp0256.c b/src/emu/sound/sp0256.c
index 67b34e621f7..22762080ba2 100644
--- a/src/emu/sound/sp0256.c
+++ b/src/emu/sound/sp0256.c
@@ -283,7 +283,7 @@ static int lpc12_update(struct lpc12_t *f, int num_samp, INT16 *out, UINT32 *opt
return i;
}
-static int stage_map[6] = { 0, 1, 2, 3, 4, 5 };
+static const int stage_map[6] = { 0, 1, 2, 3, 4, 5 };
/* ======================================================================== */
/* LPC12_REGDEC -- Decode the register set in the filter bank. */
diff --git a/src/emu/sound/speaker.c b/src/emu/sound/speaker.c
index 4fba85bb5e3..fe5277cb56e 100644
--- a/src/emu/sound/speaker.c
+++ b/src/emu/sound/speaker.c
@@ -11,12 +11,12 @@
#include "streams.h"
#include "speaker.h"
-static INT16 default_levels[2] = {0,32767};
+static const INT16 default_levels[2] = {0,32767};
struct speaker
{
sound_stream *channel;
- INT16 *levels;
+ const INT16 *levels;
int num_levels;
int level;
};
diff --git a/src/emu/sound/tms3615.c b/src/emu/sound/tms3615.c
index 46225348ccd..1b3212627e6 100644
--- a/src/emu/sound/tms3615.c
+++ b/src/emu/sound/tms3615.c
@@ -7,7 +7,7 @@
#define TONES 13
-static int divisor[TONES] = { 478, 451, 426, 402, 379, 358, 338, 319, 301, 284, 268, 253, 239 };
+static const int divisor[TONES] = { 478, 451, 426, 402, 379, 358, 338, 319, 301, 284, 268, 253, 239 };
struct TMS3615 {
sound_stream *channel; /* returned by stream_create() */
diff --git a/src/emu/sound/tms36xx.c b/src/emu/sound/tms36xx.c
index 911e929e08b..250634bb826 100644
--- a/src/emu/sound/tms36xx.c
+++ b/src/emu/sound/tms36xx.c
@@ -301,7 +301,7 @@ static const int tune4[13*6] = {
B(1), B(2), Dx(3), B(3), Dx(4), B(4)
};
-static const int *tunes[] = {NULL,tune1,tune2,tune3,tune4};
+static const int *const tunes[] = {NULL,tune1,tune2,tune3,tune4};
#define DECAY(voice) \
if( tms->vol[voice] > VMIN ) \
diff --git a/src/emu/sound/tms5110.c b/src/emu/sound/tms5110.c
index a1e3ee5131c..96ceea772b7 100644
--- a/src/emu/sound/tms5110.c
+++ b/src/emu/sound/tms5110.c
@@ -709,7 +709,7 @@ static void parse_frame(struct tms5110 *tms)
#if 0
/*This is an example word TEN taken from the TMS5110A datasheet*/
-static unsigned int example_word_TEN[619]={
+static const unsigned int example_word_TEN[619]={
/* 1*/1,0,0,0, 0, 0,0,0,0,0, 1,1,0,0,0, 0,0,0,1,0, 0,1,1,1, 0,1,0,1,
/* 2*/1,0,0,0, 0, 0,0,0,0,0, 1,0,0,1,0, 0,0,1,1,0, 0,0,1,1, 0,1,0,1,
/* 3*/1,1,0,0, 0, 1,0,0,0,0, 1,0,1,0,0, 0,1,0,1,0, 0,1,0,0, 1,0,1,0, 1,0,0,0, 1,0,0,1, 0,1,0,1, 0,0,1, 0,1,0, 0,1,1,
diff --git a/src/emu/sound/tms5220r.c b/src/emu/sound/tms5220r.c
index e373dd045ec..c3d47f04e21 100644
--- a/src/emu/sound/tms5220r.c
+++ b/src/emu/sound/tms5220r.c
@@ -83,7 +83,7 @@ const static short k10table [0x08]={
/* chirp table */
-static char chirptable[51]={
+static const char chirptable[51]={
0x00, 0x2a, (char)0xd4, 0x32,
(char)0xb2, 0x12, 0x25, 0x14,
0x02, (char)0xe1, (char)0xc5, 0x02,
@@ -101,7 +101,7 @@ static char chirptable[51]={
/* interpolation coefficients (in rightshifts, as in actual chip) */
-static char interp_coeff[8] = {
+static const char interp_coeff[8] = {
3, 3, 3, 2, 2, 1, 1, 0
};
diff --git a/src/emu/sound/vlm5030.c b/src/emu/sound/vlm5030.c
index 9d1ea3eef1e..303c2dda0da 100644
--- a/src/emu/sound/vlm5030.c
+++ b/src/emu/sound/vlm5030.c
@@ -174,7 +174,7 @@ static const char VLM_NAME[] = "VLM5030";
/* This is the energy lookup table */
/* sampled from real chip */
-static unsigned short energytable[0x20] =
+static const unsigned short energytable[0x20] =
{
0, 2, 4, 6, 10, 12, 14, 18, /* 0-7 */
22, 26, 30, 34, 38, 44, 48, 54, /* 8-15 */
diff --git a/src/emu/sound/ym2151.c b/src/emu/sound/ym2151.c
index 063cfcc7477..5180db44620 100644
--- a/src/emu/sound/ym2151.c
+++ b/src/emu/sound/ym2151.c
@@ -229,7 +229,7 @@ static UINT32 d1l_tab[16];
#define RATE_STEPS (8)
-static UINT8 eg_inc[19*RATE_STEPS]={
+static const UINT8 eg_inc[19*RATE_STEPS]={
/*cycle:0 1 2 3 4 5 6 7*/
@@ -262,7 +262,7 @@ static UINT8 eg_inc[19*RATE_STEPS]={
#define O(a) (a*RATE_STEPS)
/*note that there is no O(17) in this table - it's directly in the code */
-static UINT8 eg_rate_select[32+64+32]={ /* Envelope Generator rates (32 + 64 rates + 32 RKS) */
+static const UINT8 eg_rate_select[32+64+32]={ /* Envelope Generator rates (32 + 64 rates + 32 RKS) */
/* 32 dummy (infinite time) rates */
O(18),O(18),O(18),O(18),O(18),O(18),O(18),O(18),
O(18),O(18),O(18),O(18),O(18),O(18),O(18),O(18),
@@ -309,7 +309,7 @@ O(16),O(16),O(16),O(16),O(16),O(16),O(16),O(16)
/*mask 2047, 1023, 511, 255, 127, 63, 31, 15, 7, 3, 1, 0, 0, 0, 0, 0 */
#define O(a) (a*1)
-static UINT8 eg_rate_shift[32+64+32]={ /* Envelope Generator counter shifts (32 + 64 rates + 32 RKS) */
+static const UINT8 eg_rate_shift[32+64+32]={ /* Envelope Generator counter shifts (32 + 64 rates + 32 RKS) */
/* 32 infinite time rates */
O(0),O(0),O(0),O(0),O(0),O(0),O(0),O(0),
O(0),O(0),O(0),O(0),O(0),O(0),O(0),O(0),
@@ -362,14 +362,14 @@ O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0),O( 0)
* DT2=0 DT2=1 DT2=2 DT2=3
* 0 600 781 950
*/
-static UINT32 dt2_tab[4] = { 0, 384, 500, 608 };
+static const UINT32 dt2_tab[4] = { 0, 384, 500, 608 };
/* DT1 defines offset in Hertz from base note
* This table is converted while initialization...
* Detune table shown in YM2151 User's Manual is wrong (verified on the real chip)
*/
-static UINT8 dt1_tab[4*32] = { /* 4*32 DT1 values */
+static const UINT8 dt1_tab[4*32] = { /* 4*32 DT1 values */
/* DT1=0 */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -387,7 +387,7 @@ static UINT8 dt1_tab[4*32] = { /* 4*32 DT1 values */
8, 8, 9,10,11,12,13,14,16,17,19,20,22,22,22,22
};
-static UINT16 phaseinc_rom[768]={
+static const UINT16 phaseinc_rom[768]={
1299,1300,1301,1302,1303,1304,1305,1306,1308,1309,1310,1311,1313,1314,1315,1316,
1318,1319,1320,1321,1322,1323,1324,1325,1327,1328,1329,1330,1332,1333,1334,1335,
1337,1338,1339,1340,1341,1342,1343,1344,1346,1347,1348,1349,1351,1352,1353,1354,
@@ -457,7 +457,7 @@ static UINT16 phaseinc_rom[768]={
some 0x80 could be 0x81 as well as some 0x00 could be 0x01.
*/
-static UINT8 lfo_noise_waveform[256] = {
+static const UINT8 lfo_noise_waveform[256] = {
0xFF,0xEE,0xD3,0x80,0x58,0xDA,0x7F,0x94,0x9E,0xE3,0xFA,0x00,0x4D,0xFA,0xFF,0x6A,
0x7A,0xDE,0x49,0xF6,0x00,0x33,0xBB,0x63,0x91,0x60,0x51,0xFF,0x00,0xD8,0x7F,0xDE,
0xDC,0x73,0x21,0x85,0xB2,0x9C,0x5D,0x24,0xCD,0x91,0x9E,0x76,0x7F,0x20,0xFB,0xF3,
diff --git a/src/emu/sound/ym2413.c b/src/emu/sound/ym2413.c
index f4d65b2263a..d688829c2c0 100644
--- a/src/emu/sound/ym2413.c
+++ b/src/emu/sound/ym2413.c
@@ -557,7 +557,7 @@ static const INT8 lfo_pm_table[8*8] = {
- waveform DC and DM select are 100% correct
*/
-static unsigned char table[19][8] = {
+static const unsigned char table[19][8] = {
/* MULT MULT modTL DcDmFb AR/DR AR/DR SL/RR SL/RR */
/* 0 1 2 3 4 5 6 7 */
{0x49, 0x4c, 0x4c, 0x12, 0x00, 0x00, 0x00, 0x00 }, //0
diff --git a/src/emu/sound/ymdeltat.c b/src/emu/sound/ymdeltat.c
index 2c91a0ca066..f37a6cacaf5 100644
--- a/src/emu/sound/ymdeltat.c
+++ b/src/emu/sound/ymdeltat.c
@@ -151,7 +151,7 @@ UINT8 YM_DELTAT_ADPCM_Read(YM_DELTAT *DELTAT)
/* 0-DRAM x1, 1-ROM, 2-DRAM x8, 3-ROM (3 is bad setting - not allowed by the manual) */
-static UINT8 dram_rightshift[4]={3,0,0,0};
+static const UINT8 dram_rightshift[4]={3,0,0,0};
/* DELTA-T ADPCM write register */
void YM_DELTAT_ADPCM_Write(YM_DELTAT *DELTAT,int r,int v)
diff --git a/src/emu/sound/ymz280b.c b/src/emu/sound/ymz280b.c
index 3af8405b342..ddd9acb3376 100644
--- a/src/emu/sound/ymz280b.c
+++ b/src/emu/sound/ymz280b.c
@@ -117,7 +117,7 @@ static TIMER_CALLBACK( update_irq_state_timer_5 );
static TIMER_CALLBACK( update_irq_state_timer_6 );
static TIMER_CALLBACK( update_irq_state_timer_7 );
-static timer_callback update_irq_state_cb[] =
+static const timer_callback update_irq_state_cb[] =
{
update_irq_state_timer_0,
update_irq_state_timer_1,
diff --git a/src/emu/state.c b/src/emu/state.c
index 9b4159f82a5..a0c7073e9e0 100644
--- a/src/emu/state.c
+++ b/src/emu/state.c
@@ -135,7 +135,7 @@ static void ss_c2(UINT8 *, UINT32);
static void ss_c4(UINT8 *, UINT32);
static void ss_c8(UINT8 *, UINT32);
-static void (*ss_conv[])(UINT8 *, UINT32) = { 0, 0, ss_c2, 0, ss_c4, 0, 0, 0, ss_c8 };
+static void (*const ss_conv[])(UINT8 *, UINT32) = { 0, 0, ss_c2, 0, ss_c4, 0, 0, 0, ss_c8 };
diff --git a/src/emu/ui.c b/src/emu/ui.c
index adbef791c1c..2f6a630b09f 100644
--- a/src/emu/ui.c
+++ b/src/emu/ui.c
@@ -1134,13 +1134,16 @@ int sprintf_game_info(char *buffer)
bufptr += sprintf(bufptr, "\n%s\n", ui_getstring(UI_vectorgame));
/* display screen resolution and refresh rate info for raster games */
- else
+ else if (Machine->drv->video_attributes & VIDEO_TYPE_RASTER)
bufptr += sprintf(bufptr,"\n%s:\n%d " UTF8_MULTIPLY " %d (%s) %f" UTF8_NBSP "Hz\n",
ui_getstring(UI_screenres),
Machine->screen[0].visarea.max_x - Machine->screen[0].visarea.min_x + 1,
Machine->screen[0].visarea.max_y - Machine->screen[0].visarea.min_y + 1,
(Machine->gamedrv->flags & ORIENTATION_SWAP_XY) ? "V" : "H",
ATTOSECONDS_TO_HZ(Machine->screen[0].refresh));
+ else
+ *bufptr++ = '\0';
+
return bufptr - buffer;
}
diff --git a/src/emu/uimenu.c b/src/emu/uimenu.c
index 4f1aeaf7e0d..34cd685a7df 100644
--- a/src/emu/uimenu.c
+++ b/src/emu/uimenu.c
@@ -130,7 +130,7 @@ static render_texture *hilight_texture;
static render_texture *arrow_texture;
-static const char *input_format[] =
+static const char *const input_format[] =
{
"%s",
"%s Analog",
@@ -1891,7 +1891,7 @@ static int input_menu_get_game_items(input_item_data *itemlist)
((in->type == IPT_OTHER && in->name != IP_NAME_DEFAULT) || port_type_to_group(in->type, in->player) != IPG_INVALID))
{
UINT16 sortorder;
- input_seq *curseq, *defseq;
+ const input_seq *curseq, *defseq;
/* determine the sorting order */
if (in->type >= IPT_START1 && in->type <= __ipt_analog_end)
diff --git a/src/emu/uitext.c b/src/emu/uitext.c
index 62e4b9abe7b..8d3a0f8cb4a 100644
--- a/src/emu/uitext.c
+++ b/src/emu/uitext.c
@@ -21,7 +21,7 @@ extern const char *mess_default_text[];
static lang_struct lang;
/* All entries in this table must match the enum ordering in "uitext.h" */
-static const char *mame_default_text[] =
+static const char *const mame_default_text[] =
{
APPNAME,
/* copyright stuff */
@@ -215,7 +215,7 @@ static const char *mame_default_text[] =
-static const char **default_text[] =
+static const char *const *const default_text[] =
{
mame_default_text,
#ifdef MESS
diff --git a/src/emu/validity.c b/src/emu/validity.c
index faa37b60768..633e4f3f6c3 100644
--- a/src/emu/validity.c
+++ b/src/emu/validity.c
@@ -654,7 +654,7 @@ static int validate_cpu(int drivnum, const machine_config *drv, const UINT32 *re
{
#define SPACE_SHIFT(a) ((addr_shift < 0) ? ((a) << -addr_shift) : ((a) >> addr_shift))
#define SPACE_SHIFT_END(a) ((addr_shift < 0) ? (((a) << -addr_shift) | ((1 << -addr_shift) - 1)) : ((a) >> addr_shift))
- static const char *spacename[] = { "program", "data", "I/O" };
+ static const char *const spacename[] = { "program", "data", "I/O" };
int databus_width = cputype_databus_width(cpu->type, spacenum);
int addr_shift = cputype_addrbus_shift(cpu->type, spacenum);
int alignunit = databus_width/8;
diff --git a/src/emu/video.c b/src/emu/video.c
index f89b961ed89..fd7324c785c 100644
--- a/src/emu/video.c
+++ b/src/emu/video.c
@@ -121,6 +121,7 @@ struct _video_global
UINT32 speed; /* overall speed (*100) */
UINT32 original_speed; /* originally-specified speed */
UINT8 refresh_speed; /* flag: TRUE if we max out our speed according to the refresh */
+ UINT8 update_in_pause; /* flag: TRUE if video is updated while in pause */
/* frameskipping */
UINT8 empty_skip_count; /* number of empty frames we have skipped */
@@ -284,6 +285,7 @@ void video_init(running_machine *machine)
global.seconds_to_run = options_get_int(mame_options(), OPTION_SECONDS_TO_RUN);
global.original_speed = global.speed = (options_get_float(mame_options(), OPTION_SPEED) * 100.0 + 0.5);
global.refresh_speed = options_get_bool(mame_options(), OPTION_REFRESHSPEED);
+ global.update_in_pause = options_get_bool(mame_options(), OPTION_UPDATEINPAUSE);
/* allocate memory for our private data */
viddata = machine->video_data = auto_malloc(sizeof(*viddata));
@@ -1023,11 +1025,7 @@ void video_frame_update(int debug)
int phase = mame_get_phase(Machine);
/* only render sound and video if we're in the running phase */
-#ifdef MAME_DEBUG
- if (phase == MAME_PHASE_RUNNING)
-#else
- if (phase == MAME_PHASE_RUNNING && (debug || !mame_is_paused(Machine)))
-#endif
+ if (phase == MAME_PHASE_RUNNING && (!mame_is_paused(Machine) || global.update_in_pause))
{
int anything_changed = finish_screen_updates(Machine);
@@ -1522,6 +1520,7 @@ static osd_ticks_t throttle_until_ticks(osd_ticks_t target_ticks)
}
current_ticks = new_ticks;
}
+ profiler_mark(PROFILER_END);
return current_ticks;
}
@@ -1864,6 +1863,7 @@ static void movie_record_frame(running_machine *machine, int scrnum)
{
video_private *viddata = machine->video_data;
internal_screen_info *info = &viddata->scrinfo[scrnum];
+ const rgb_t *palette;
/* only record if we have a file */
if (info->movie_file != NULL)
@@ -1901,7 +1901,8 @@ static void movie_record_frame(running_machine *machine, int scrnum)
}
/* write the next frame */
- error = mng_capture_frame(mame_core_file(info->movie_file), &pnginfo, bitmap, machine->drv->total_colors, palette_entry_list_adjusted(machine->palette));
+ palette = (machine->palette != NULL) ? palette_entry_list_adjusted(machine->palette) : NULL;
+ error = mng_capture_frame(mame_core_file(info->movie_file), &pnginfo, bitmap, machine->drv->total_colors, palette);
png_free(&pnginfo);
if (error != PNGERR_NONE)
{
diff --git a/src/emu/video/rgbutil.h b/src/emu/video/rgbutil.h
index d3c94496976..43821682963 100644
--- a/src/emu/video/rgbutil.h
+++ b/src/emu/video/rgbutil.h
@@ -14,7 +14,7 @@
#define __RGBUTIL__
/* use SSE on 64-bit implementations, where it can be assumed */
-#if defined(__SSE2__) || (defined(PTR64) && defined(_MSC_VER))
+#if (defined(__SSE2__) && defined(PTR64))
#include "rgbsse.h"
#elif defined(__ALTIVEC__)
#include "rgbvmx.h"
diff --git a/src/emu/video/s2636.c b/src/emu/video/s2636.c
index 664399e4834..baff57f0a8e 100644
--- a/src/emu/video/s2636.c
+++ b/src/emu/video/s2636.c
@@ -76,7 +76,7 @@
#include "driver.h"
#include "s2636.h"
-static int SpriteOffset[4] = {0,0x10,0x20,0x40};
+static const int SpriteOffset[4] = {0,0x10,0x20,0x40};
/* To adjust sprites against bitmap */
diff --git a/src/emu/video/tms34061.c b/src/emu/video/tms34061.c
index f601842cd1d..9f7a6ff4a16 100644
--- a/src/emu/video/tms34061.c
+++ b/src/emu/video/tms34061.c
@@ -47,7 +47,7 @@ struct tms34061_data
static struct tms34061_data tms34061;
-static const char *regnames[] =
+static const char *const regnames[] =
{
"HORENDSYNC", "HORENDBLNK", "HORSTARTBLNK", "HORTOTAL",
"VERENDSYNC", "VERENDBLNK", "VERSTARTBLNK", "VERTOTAL",
@@ -74,7 +74,7 @@ static TIMER_CALLBACK( tms34061_interrupt );
*
*************************************/
-void tms34061_start(struct tms34061_interface *interface)
+void tms34061_start(const struct tms34061_interface *interface)
{
/* reset the data */
memset(&tms34061, 0, sizeof(tms34061));
diff --git a/src/emu/video/tms34061.h b/src/emu/video/tms34061.h
index 9ff83a8eb6a..fb3dc6c04e7 100644
--- a/src/emu/video/tms34061.h
+++ b/src/emu/video/tms34061.h
@@ -56,7 +56,7 @@ struct tms34061_display
/* starts/stops the emulator */
-void tms34061_start(struct tms34061_interface *interface);
+void tms34061_start(const struct tms34061_interface *interface);
/* reads/writes to the 34061 */
UINT8 tms34061_r(int col, int row, int func);
diff --git a/src/emu/video/tms9928a.c b/src/emu/video/tms9928a.c
index cf20b9d60ee..5ff8fcaada3 100644
--- a/src/emu/video/tms9928a.c
+++ b/src/emu/video/tms9928a.c
@@ -110,7 +110,7 @@ static void draw_modebogus (running_machine *machine, mame_bitmap *bitmap, const
static void draw_sprites (running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect);
static void change_register (int reg, UINT8 data);
-static void (*ModeHandlers[])(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect) = {
+static void (*const ModeHandlers[])(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect) = {
draw_mode0, draw_mode1, draw_mode2, draw_mode12,
draw_mode3, draw_modebogus, draw_mode23,
draw_modebogus };
@@ -305,7 +305,7 @@ WRITE8_HANDLER (TMS9928A_register_w) {
static void change_register (int reg, UINT8 val) {
static const UINT8 Mask[8] =
{ 0x03, 0xfb, 0x0f, 0xff, 0x07, 0x7f, 0x07, 0xff };
- static const char *modes[] = {
+ static const char *const modes[] = {
"Mode 0 (GRAPHIC 1)", "Mode 1 (TEXT 1)", "Mode 2 (GRAPHIC 2)",
"Mode 1+2 (TEXT 1 variation)", "Mode 3 (MULTICOLOR)",
"Mode 1+3 (BOGUS)", "Mode 2+3 (MULTICOLOR variation)",
diff --git a/src/emu/video/v9938.c b/src/emu/video/v9938.c
index 1a239f982db..9e41f30eb00 100644
--- a/src/emu/video/v9938.c
+++ b/src/emu/video/v9938.c
@@ -62,7 +62,7 @@ static UINT16 pal_ind16[16], pal_ind256[256], *pal_indYJK;
#define V9938_MODE_UNKNOWN (10)
-static const char *v9938_modes[] = {
+static const char *const v9938_modes[] = {
"TEXT 1", "MULTICOLOR", "GRAPHIC 1", "GRAPHIC 2", "GRAPHIC 3",
"GRAPHIC 4", "GRAPHIC 5", "GRAPHIC 6", "GRAPHIC 7", "TEXT 2",
"UNKNOWN" };
@@ -1504,7 +1504,7 @@ static void VDPpset(register UINT8 SM, register int MXD,
register int DX, register int DY,
register UINT8 CL, register UINT8 OP);
-static int GetVdpTimingValue(register int *);
+static int GetVdpTimingValue(register const int *);
static void SrchEngine(void);
static void LineEngine(void);
@@ -1522,27 +1522,27 @@ static void ReportVdpCommand(register UINT8 Op);
/*************************************************************/
/** Variables visible only in this module **/
/*************************************************************/
-static UINT8 Mask[4] = { 0x0F,0x03,0x0F,0xFF };
-static int PPB[4] = { 2,4,2,1 };
-static int PPL[4] = { 256,512,512,256 };
+static const UINT8 Mask[4] = { 0x0F,0x03,0x0F,0xFF };
+static const int PPB[4] = { 2,4,2,1 };
+static const int PPL[4] = { 256,512,512,256 };
static int VdpOpsCnt=1;
static void (*VdpEngine)(void)=0;
/* SprOn SprOn SprOf SprOf */
/* ScrOf ScrOn ScrOf ScrOn */
-static int srch_timing[8]={ 818, 1025, 818, 830, /* ntsc */
+static const int srch_timing[8]={ 818, 1025, 818, 830, /* ntsc */
696, 854, 696, 684 }; /* pal */
-static int line_timing[8]={ 1063, 1259, 1063, 1161,
+static const int line_timing[8]={ 1063, 1259, 1063, 1161,
904, 1026, 904, 953 };
-static int hmmv_timing[8]={ 439, 549, 439, 531,
+static const int hmmv_timing[8]={ 439, 549, 439, 531,
366, 439, 366, 427 };
-static int lmmv_timing[8]={ 873, 1135, 873, 1056,
+static const int lmmv_timing[8]={ 873, 1135, 873, 1056,
732, 909, 732, 854 };
-static int ymmm_timing[8]={ 586, 952, 586, 610,
+static const int ymmm_timing[8]={ 586, 952, 586, 610,
488, 720, 488, 500 };
-static int hmmm_timing[8]={ 818, 1111, 818, 854,
+static const int hmmm_timing[8]={ 818, 1111, 818, 854,
684, 879, 684, 708 };
-static int lmmm_timing[8]={ 1160, 1599, 1160, 1172,
+static const int lmmm_timing[8]={ 1160, 1599, 1160, 1172,
964, 1257, 964, 977 };
@@ -1695,7 +1695,7 @@ INLINE void VDPpset(UINT8 SM, int MXD, int DX, int DY, UINT8 CL, UINT8 OP)
/** GetVdpTimingValue() **************************************/
/** Get timing value for a certain VDP command **/
/*************************************************************/
-static int GetVdpTimingValue(register int *timing_values)
+static int GetVdpTimingValue(register const int *timing_values)
{
return(timing_values[((VDP[1]>>6)&1)|(VDP[8]&2)|((VDP[9]<<1)&4)]);
}
@@ -2249,12 +2249,12 @@ static UINT8 v9938_vdp_to_cpu (void)
/*************************************************************/
static void ReportVdpCommand(register UINT8 Op)
{
- static const char *Ops[16] =
+ static const char *const Ops[16] =
{
"SET ","AND ","OR ","XOR ","NOT ","NOP ","NOP ","NOP ",
"TSET","TAND","TOR ","TXOR","TNOT","NOP ","NOP ","NOP "
};
- static const char *Commands[16] =
+ static const char *const Commands[16] =
{
" ABRT"," ????"," ????"," ????","POINT"," PSET"," SRCH"," LINE",
" LMMV"," LMMM"," LMCM"," LMMC"," HMMV"," HMMM"," YMMM"," HMMC"
diff --git a/src/emu/video/vooddefs.h b/src/emu/video/vooddefs.h
index 374df64e76b..f15017d3c14 100644
--- a/src/emu/video/vooddefs.h
+++ b/src/emu/video/vooddefs.h
@@ -604,7 +604,7 @@ static const UINT8 banshee_register_access[0x100] =
*
*************************************/
-static const char *voodoo_reg_name[] =
+static const char *const voodoo_reg_name[] =
{
/* 0x000 */
"status", "{intrCtrl}", "vertexAx", "vertexAy",
@@ -681,7 +681,7 @@ static const char *voodoo_reg_name[] =
};
-static const char *banshee_reg_name[] =
+static const char *const banshee_reg_name[] =
{
/* 0x000 */
"status", "intrCtrl", "vertexAx", "vertexAy",
@@ -843,7 +843,7 @@ static const char *banshee_reg_name[] =
*
*************************************/
-static const char *banshee_io_reg_name[] =
+static const char *const banshee_io_reg_name[] =
{
/* 0x000 */
"status", "pciInit0", "sipMonitor", "lfbMemoryConfig",
@@ -924,7 +924,7 @@ static const char *banshee_io_reg_name[] =
*
*************************************/
-static const char *banshee_agp_reg_name[] =
+static const char *const banshee_agp_reg_name[] =
{
/* 0x000 */
"agpReqSize", "agpHostAddressLow","agpHostAddressHigh","agpGraphicsAddress",
@@ -1681,7 +1681,7 @@ struct _voodoo_state
voodoo_reg reg[0x400]; /* raw registers */
const UINT8 *regaccess; /* register access array */
- const char **regnames; /* register names array */
+ const char *const *regnames; /* register names array */
UINT8 alt_regmap; /* enable alternate register map? */
pci_state pci; /* PCI state */