diff options
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 |
commit | 507ca2d27520118151a2556d96b9a15aac768876 (patch) | |
tree | 46bb2585f4114b1dfc157c3bfe60238d23877e7a /src/mame/machine | |
parent | df34329a478833efbd542a424ce1813a11214d4a (diff) |
Changes for MAME 0.121u4.mame0121u4
Diffstat (limited to 'src/mame/machine')
44 files changed, 170 insertions, 144 deletions
diff --git a/src/mame/machine/amiga.c b/src/mame/machine/amiga.c index 2bdd46ca2c0..0be6e7d78cf 100644 --- a/src/mame/machine/amiga.c +++ b/src/mame/machine/amiga.c @@ -79,7 +79,7 @@ static autoconfig_device *cur_autoconfig; static emu_timer * amiga_irq_timer; static emu_timer * amiga_blitter_timer; -const char *amiga_custom_names[0x100] = +const char *const amiga_custom_names[0x100] = { /* 0x000 */ "BLTDDAT", "DMACONR", "VPOSR", "VHPOSR", @@ -925,7 +925,7 @@ static TIMER_CALLBACK( amiga_blitter_proc ) /* logging */ if (LOG_BLITS) { - static const char *type[] = { "ASCENDING", "LINE", "DESCENDING", "LINE" }; + static const char *const type[] = { "ASCENDING", "LINE", "DESCENDING", "LINE" }; logerror("BLIT %s: %dx%d %04x %04x\n", type[CUSTOM_REG(REG_BLTCON1) & 0x0003], CUSTOM_REG(REG_BLTSIZH), CUSTOM_REG(REG_BLTSIZV), CUSTOM_REG(REG_BLTCON0), CUSTOM_REG(REG_BLTCON1)); if (CUSTOM_REG(REG_BLTCON0) & 0x0800) logerror(" A: addr=%06X mod=%3d shift=%2d maskl=%04x maskr=%04x\n", CUSTOM_REG_LONG(REG_BLTAPTH), CUSTOM_REG_SIGNED(REG_BLTAMOD), CUSTOM_REG(REG_BLTCON0) >> 12, CUSTOM_REG(REG_BLTAFWM), CUSTOM_REG(REG_BLTALWM)); diff --git a/src/mame/machine/bagman.c b/src/mame/machine/bagman.c index 6c9bedf4b0b..d23e8219b1f 100644 --- a/src/mame/machine/bagman.c +++ b/src/mame/machine/bagman.c @@ -35,7 +35,7 @@ static UINT8 outvalue[8]; ** 1 - fuse blown: disconnected from input (equal to 1) ** 0 - fuse not blown: connected to input (ie. x, not x, q, not q accordingly) */ -static UINT8 fusemap[64*32]= +static const UINT8 fusemap[64*32]= { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,0,1,1,1,1,0,1,1,0,1,1,1,1,0,1,1,0,1,1,1,0,1,1,1,1,1, diff --git a/src/mame/machine/balsente.c b/src/mame/machine/balsente.c index 3d76236ed43..c581a09a2fc 100644 --- a/src/mame/machine/balsente.c +++ b/src/mame/machine/balsente.c @@ -1066,7 +1066,7 @@ WRITE8_HANDLER( balsente_chip_select_w ) #if LOG_CEM_WRITES if (temp != cem3394_get_parameter(i, reg)) { - static const char *names[] = + static const char *const names[] = { "VCO_FREQUENCY", "FINAL_GAIN", diff --git a/src/mame/machine/beezer.c b/src/mame/machine/beezer.c index 66a6e3036a5..4509848f79f 100644 --- a/src/mame/machine/beezer.c +++ b/src/mame/machine/beezer.c @@ -20,7 +20,7 @@ static WRITE8_HANDLER( b_via_1_pa_w ); static WRITE8_HANDLER( b_via_1_pb_w ); static void b_via_1_irq (int level); -static struct via6522_interface b_via_0_interface = +static const struct via6522_interface b_via_0_interface = { /*inputs : A/B */ 0, b_via_0_pb_r, /*inputs : CA/B1,CA/B2 */ 0, via_1_ca2_r, b_via_0_ca2_r, via_1_ca1_r, @@ -29,7 +29,7 @@ static struct via6522_interface b_via_0_interface = /*irq */ b_via_0_irq }; -static struct via6522_interface b_via_1_interface = +static const struct via6522_interface b_via_1_interface = { /*inputs : A/B */ b_via_1_pa_r, b_via_1_pb_r, /*inputs : CA/B1,CA/B2 */ via_0_cb2_r, 0, via_0_cb1_r, 0, diff --git a/src/mame/machine/bfm_bd1.c b/src/mame/machine/bfm_bd1.c index a3bac92df10..83027954252 100644 --- a/src/mame/machine/bfm_bd1.c +++ b/src/mame/machine/bfm_bd1.c @@ -71,7 +71,7 @@ static const char BD1ASCII[] = */ -static UINT16 BD1charset[]= +static const UINT16 BD1charset[]= { // FEDC BA98 7654 3210 0xA626, // 1010 0110 0010 0110 @. 0xE027, // 1110 0000 0010 0111 A. diff --git a/src/mame/machine/bublbobl.c b/src/mame/machine/bublbobl.c index e57a3a0e79f..9c2f0571cee 100644 --- a/src/mame/machine/bublbobl.c +++ b/src/mame/machine/bublbobl.c @@ -63,7 +63,7 @@ WRITE8_HANDLER( bublbobl_nmitrigger_w ) } -static UINT8 tokio_prot_data[] = +static const UINT8 tokio_prot_data[] = { 0x6c, 0x7f,0x5f,0x7f,0x6f,0x5f,0x77,0x5f,0x7f,0x5f,0x7f,0x5f,0x7f,0x5b,0x7f,0x5f,0x7f, @@ -337,7 +337,7 @@ WRITE8_HANDLER( boblbobl_ic43_a_w ) WRITE8_HANDLER( boblbobl_ic43_b_w ) { - static int xor[4] = { 4, 1, 8, 2 }; + static const int xor[4] = { 4, 1, 8, 2 }; // logerror("%04x: ic43_b_w (offs %d) %02x\n",activecpu_get_pc(),offset,data); ic43_b = (data >> 4) ^ xor[offset]; diff --git a/src/mame/machine/carpolo.c b/src/mame/machine/carpolo.c index 6ebadeacd3e..5512e2e5c6b 100644 --- a/src/mame/machine/carpolo.c +++ b/src/mame/machine/carpolo.c @@ -483,27 +483,27 @@ static const pia6821_interface pia_1_intf = /*irqs : A/B */ 0, 0 }; -static struct TTL74148_interface TTL74148_3S_intf = +static const struct TTL74148_interface TTL74148_3S_intf = { TTL74148_3S_cb }; -static struct TTL7474_interface TTL7474_2S_1_intf = +static const struct TTL7474_interface TTL7474_2S_1_intf = { TTL7474_2S_1_cb }; -static struct TTL7474_interface TTL7474_2S_2_intf = +static const struct TTL7474_interface TTL7474_2S_2_intf = { TTL7474_2S_2_cb }; -static struct TTL7474_interface TTL7474_2U_1_intf = +static const struct TTL7474_interface TTL7474_2U_1_intf = { TTL7474_2U_1_cb }; -static struct TTL7474_interface TTL7474_2U_2_intf = +static const struct TTL7474_interface TTL7474_2U_2_intf = { TTL7474_2U_2_cb }; diff --git a/src/mame/machine/cchip.c b/src/mame/machine/cchip.c index 8424f33b711..4b216d65a9c 100644 --- a/src/mame/machine/cchip.c +++ b/src/mame/machine/cchip.c @@ -47,7 +47,7 @@ static UINT8 cc_port = 0; /* This code for sound communication is a hack, it will not be identical to the code derived from the real c-chip */ -static UINT8 superman_code[40] = +static const UINT8 superman_code[40] = { 0x48, 0xe7, 0x80, 0x80, /* MOVEM.L D0/A0,-(A7) ( Preserve Regs ) */ 0x20, 0x6d, 0x1c, 0x40, /* MOVEA.L ($1C40,A5),A0 ( Load sound pointer in A0 ) */ diff --git a/src/mame/machine/copsnrob.c b/src/mame/machine/copsnrob.c index 53186c867a6..ed5b3f78b61 100644 --- a/src/mame/machine/copsnrob.c +++ b/src/mame/machine/copsnrob.c @@ -7,7 +7,7 @@ #include "driver.h" #include "copsnrob.h" -static int gun_mask[] = {0x7e, 0x7d, 0x7b, 0x77, 0x6f, 0x5f, 0x3f}; +static const int gun_mask[] = {0x7e, 0x7d, 0x7b, 0x77, 0x6f, 0x5f, 0x3f}; // The gun control is a 7 position switch. I'm doing the following to // emulate it: diff --git a/src/mame/machine/cubocd32.c b/src/mame/machine/cubocd32.c index 5ff4a4c64b1..3380ba3591c 100644 --- a/src/mame/machine/cubocd32.c +++ b/src/mame/machine/cubocd32.c @@ -229,7 +229,7 @@ static UINT32 akiko_c2p_read(void) } #if LOG_AKIKO -static const char* akiko_reg_names[] = +static const char *const akiko_reg_names[] = { /*0*/ "ID", /*1*/ "CDROM STATUS 1", diff --git a/src/mame/machine/daikaiju.c b/src/mame/machine/daikaiju.c index a4f6423a2c1..ccd7fcbeca8 100644 --- a/src/mame/machine/daikaiju.c +++ b/src/mame/machine/daikaiju.c @@ -129,7 +129,7 @@ static int daikaiju_xor, daikaiju_command, daikaiju_length, daikaiju_prev, daika static int daikaiju_buffer[256]; -static int xortable[]= +static const int xortable[]= { 0xF5, 0xD5, 0x6A, 0x26, 0x00, 0x29, 0x29, 0x29, 0x29, 0x29, 0x29, 0x16, 0x00, 0xCB, 0x23, 0x19, 0x11, 0x00, 0xC0, 0x19, 0xD1, 0xF1, 0xC9, -1 diff --git a/src/mame/machine/deco102.c b/src/mame/machine/deco102.c index ede2d8dd861..1c85dafd908 100644 --- a/src/mame/machine/deco102.c +++ b/src/mame/machine/deco102.c @@ -14,11 +14,11 @@ extern void deco102_decrypt(int region, int address_xor, int data_select_xor, in static UINT16 decrypt(UINT16 data, int address, int select_xor) { - static UINT16 xors[16] = + static const UINT16 xors[16] = { 0xb52c,0x2458,0x139a,0xc998,0xce8e,0x5144,0x0429,0xaad4,0xa331,0x3645,0x69a3,0xac64,0x1a53,0x5083,0x4dea,0xd237 }; - static UINT8 bitswaps[16][16] = + static const UINT8 bitswaps[16][16] = { { 12,8,13,11,14,10,15,9, 3,2,1,0,4,5,6,7 }, { 10,11,14,12,15,13,8,9, 6,7,5,3,0,4,2,1 }, { 14,13,15,9,8,12,11,10, 7,4,1,5,6,0,3,2 }, { 15,14,8,9,10,11,13,12, 1,2,7,3,4,6,0,5 }, @@ -30,7 +30,7 @@ static UINT16 decrypt(UINT16 data, int address, int select_xor) { 13,8,12,14,11,15,10,9, 7,6,5,4,3,2,1,0 }, { 15,14,13,12,11,10,9,8, 0,6,7,4,3,2,1,5 } }; int j, xor; - UINT8 *bs; + const UINT8 *bs; // calculate bitswap to use j = ((address ^ select_xor) & 0xf0) >> 4; diff --git a/src/mame/machine/equites.c b/src/mame/machine/equites.c index 5d0fc9b48e1..53abfe39927 100644 --- a/src/mame/machine/equites.c +++ b/src/mame/machine/equites.c @@ -54,8 +54,8 @@ extern WRITE8_HANDLER(equites_dac0_w); extern WRITE8_HANDLER(equites_dac1_w); extern UINT16 *equites_8404ram; -extern struct MSM5232interface equites_5232intf; -extern struct AY8910interface equites_8910intf; +extern struct const MSM5232interface equites_5232intf; +extern struct const AY8910interface equites_8910intf; static ADDRESS_MAP_START( equites_s_readmem, ADDRESS_SPACE_PROGRAM, 8 ) { 0x0000, 0xbfff, MRA8_ROM }, // sound program @@ -92,7 +92,7 @@ extern UINT16 *equites_workram; /******************************************************************************/ // Locals -static UINT16 e_ent_addr[8][4] = +static const UINT16 e_ent_addr[8][4] = { {0xce25, 0xcd3c, 0xcd89, 0xcdd5}, { 0, 0xce6e, 0xcebe, 0xcff2}, @@ -104,7 +104,7 @@ static UINT16 e_ent_addr[8][4] = { 0, 0, 0, 0}, }; -static UINT16 e_exit_pos[8][4] = +static const UINT16 e_exit_pos[8][4] = { {0x1878, 0x4878, 0x7878, 0x3878}, { 0, 0x3878, 0x4878, 0x4878}, @@ -116,7 +116,7 @@ static UINT16 e_exit_pos[8][4] = { 0, 0, 0, 0}, }; -static UINT16 e_swap_addr[4][4] = +static const UINT16 e_swap_addr[4][4] = { { 0, 0x92ec, 0, 0x92ec}, { 0, 0x92ec, 0, 0x92ec}, @@ -124,7 +124,7 @@ static UINT16 e_swap_addr[4][4] = { 0, 0x92d2, 0, 0x92d2}, }; -static UINT16 e_respawn_addr[4][4] = +static const UINT16 e_respawn_addr[4][4] = { { 0, 0x9382, 0, 0x9382}, { 0, 0x9382, 0, 0x9382}, @@ -132,26 +132,26 @@ static UINT16 e_respawn_addr[4][4] = { 0, 0x0cc8, 0, 0x9382}, }; -static UINT16 h_respawn_addr[2][4] = +static const UINT16 h_respawn_addr[2][4] = { {0x1026, 0x0fb6, 0x0fb6, 0x0fb6}, {0x11ac, 0x20b0, 0x1c44, 0x1996}, }; -static UINT16 s_respawn_addr[3][6] = +static const UINT16 s_respawn_addr[3][6] = { {0x0b6a, 0x0b52, 0x29da, 0x0846, 0x1610, 0x0c84}, // game over seq {0x347e, 0x0e10, 0x0c2c, 0x0c2c, 0x0c2c, 0x0c2c}, // depth seq {0x0c2e, 0x1fbe, 0x166a, 0x0c84, 0x0c2c, 0x0c2c}, // level change seq }; -static UINT16 s_lvdata_addr[6] = {0xccc2, 0xd04a, 0xd408, 0xd796, 0xdaa8, 0xdbd6}; +static const UINT16 s_lvdata_addr[6] = {0xccc2, 0xd04a, 0xd408, 0xd796, 0xdaa8, 0xdbd6}; -static UINT16 s_objdata_addr[6] = {0xb7ce, 0xba64, 0xbdbc, 0xc0f2, 0xc446, 0xc810}; +static const UINT16 s_objdata_addr[6] = {0xb7ce, 0xba64, 0xbdbc, 0xc0f2, 0xc446, 0xc810}; -static UINT8 s_spawn_list[8] = {0x07, 0x08, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26}; +static const UINT8 s_spawn_list[8] = {0x07, 0x08, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26}; -static UINT8 s_pow_list[8] = {0, 0, 2, 2, 2, 2, 2, 1}; +static const UINT8 s_pow_list[8] = {0, 0, 2, 2, 2, 2, 2, 1}; static struct MRULE { @@ -428,12 +428,12 @@ WRITE8_HANDLER(equites_dac1_w) /******************************************************************************/ // Alpha "Soundboard 7" Chip Definitions -struct MSM5232interface equites_5232intf = +const struct MSM5232interface equites_5232intf = { { 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6 } // needs verification }; -struct AY8910interface equites_8910intf = +const struct AY8910interface equites_8910intf = { 0, 0, diff --git a/src/mame/machine/fd1089.c b/src/mame/machine/fd1089.c index 05971a0e879..5f77d3e9ec5 100644 --- a/src/mame/machine/fd1089.c +++ b/src/mame/machine/fd1089.c @@ -6323,7 +6323,7 @@ struct parameters int s7,s6,s5,s4,s3,s2,s1,s0; }; -static UINT8 basetable_fd1089[0x100] = +static const UINT8 basetable_fd1089[0x100] = { 0x00,0x1c,0x75,0x69,0x5d,0x41,0x24,0x38,0x4b,0x67,0xae,0x82,0xea,0xc6,0x03,0x2f, 0x46,0x6a,0xaf,0x83,0xe7,0xcb,0x02,0x2e,0x01,0x1d,0x78,0x64,0x5c,0x40,0x29,0x35, @@ -6345,7 +6345,7 @@ static UINT8 basetable_fd1089[0x100] = /* common to FD1089A and FD1089B */ -static struct parameters addr_params[16] = +static const struct parameters addr_params[16] = { { 0x26, 3,1,7,5,2,4,6,0 }, { 0x08, 6,7,4,2,0,5,1,3 }, @@ -6368,7 +6368,7 @@ static struct parameters addr_params[16] = static int decode_fd1089a(int val,int table,int opcode) { - static struct parameters data_params[16] = + static const struct parameters data_params[16] = { { 0x94, 7,6,4,2,1,5,0,3 }, { 0x3f, 7,3,1,2,4,6,0,5 }, @@ -6387,8 +6387,8 @@ static int decode_fd1089a(int val,int table,int opcode) { 0x71, 4,3,7,1,5,6,0,2 }, { 0x57, 6,4,7,2,0,5,3,1 }, }; - struct parameters *p = &addr_params[table >> 4]; - struct parameters *q; + const struct parameters *p = &addr_params[table >> 4]; + const struct parameters *q; int family = table & 0x0e; @@ -6445,7 +6445,7 @@ static int decode_fd1089a(int val,int table,int opcode) static int decode_fd1089b(int val,int table,int opcode) { - struct parameters *p = &addr_params[table >> 4]; + const struct parameters *p = &addr_params[table >> 4]; /* special case - don't decrypt */ diff --git a/src/mame/machine/konamigx.c b/src/mame/machine/konamigx.c index ba336815a5b..8781f534d23 100644 --- a/src/mame/machine/konamigx.c +++ b/src/mame/machine/konamigx.c @@ -920,8 +920,8 @@ static int vinmix, vmixon, osinmix, osmixon; static void konamigx_precache_registers(void) { // (see sprite color coding scheme on p.46 & 47) - static int coregmasks[5] = {0xf,0xe,0xc,0x8,0x0}; - static int coregshifts[5]= {4,5,6,7,8}; + static const int coregmasks[5] = {0xf,0xe,0xc,0x8,0x0}; + static const int coregshifts[5]= {4,5,6,7,8}; int i; K053246_objset1 = K053246_read_register(5); @@ -1232,8 +1232,8 @@ void konamigx_mixer(running_machine *machine, mame_bitmap *bitmap, const rectang tilemap *sub2, int sub2flags, int mixerflags) { - static int xoffset[8] = { 0, 1, 4, 5, 16, 17, 20, 21 }; - static int yoffset[8] = { 0, 2, 8, 10, 32, 34, 40, 42 }; + static const int xoffset[8] = { 0, 1, 4, 5, 16, 17, 20, 21 }; + static const int yoffset[8] = { 0, 2, 8, 10, 32, 34, 40, 42 }; static int parity = 0; int objbuf[GX_MAX_OBJECTS]; @@ -2049,7 +2049,7 @@ void konamigx_esc_alert(UINT32 *srcbase, int srcoffs, int count, int mode) // (W { // hand-filled but should be close -static UINT8 ztable[7][8] = +static const UINT8 ztable[7][8] = { {5,4,3,2,1,7,6,0}, {4,3,2,1,0,7,6,5}, @@ -2060,7 +2060,7 @@ static UINT8 ztable[7][8] = {5,4,3,2,1,7,6,0} }; -static UINT8 ptable[7][8] = +static const UINT8 ptable[7][8] = { {0x00,0x00,0x00,0x10,0x20,0x00,0x00,0x30}, {0x20,0x20,0x20,0x20,0x20,0x00,0x20,0x20}, @@ -2074,7 +2074,7 @@ static UINT8 ptable[7][8] = INT32 data1, data2, i, j, vpos, hpos, voffs, hoffs, vcorr, hcorr, vmask, hmask, magicid; UINT32 *src, *srcend, *obj, *objend; UINT16 *dst; - UINT8 *zcode, *pcode; + const UINT8 *zcode, *pcode; if (!count || !srcbase) return; diff --git a/src/mame/machine/mcr.c b/src/mame/machine/mcr.c index 4478f8af296..5e2b20dca3a 100644 --- a/src/mame/machine/mcr.c +++ b/src/mame/machine/mcr.c @@ -101,7 +101,7 @@ static WRITE8_HANDLER( ipu_break_changed ); * *************************************/ -gfx_layout mcr_bg_layout = +const gfx_layout mcr_bg_layout = { 8,8, RGN_FRAC(1,2), @@ -113,7 +113,7 @@ gfx_layout mcr_bg_layout = }; -gfx_layout mcr_sprite_layout = +const gfx_layout mcr_sprite_layout = { 32,32, RGN_FRAC(1,4), @@ -199,14 +199,14 @@ static void ipu_ctc_interrupt(int state) } -struct z80_irq_daisy_chain mcr_daisy_chain[] = +const struct z80_irq_daisy_chain mcr_daisy_chain[] = { { z80ctc_reset, z80ctc_irq_state, z80ctc_irq_ack, z80ctc_irq_reti, 0 }, /* CTC number 0 */ { 0, 0, 0, 0, -1 } /* end mark */ }; -struct z80_irq_daisy_chain mcr_ipu_daisy_chain[] = +const struct z80_irq_daisy_chain mcr_ipu_daisy_chain[] = { { z80ctc_reset, z80ctc_irq_state, z80ctc_irq_ack, z80ctc_irq_reti, 1 }, /* CTC number 1 */ { z80pio_reset, z80pio_irq_state, z80pio_irq_ack, z80pio_irq_reti, 1 }, /* PIO number 1 */ @@ -238,7 +238,7 @@ static z80ctc_interface nflfoot_ctc_intf = }; -static z80pio_interface nflfoot_pio_intf = +static const z80pio_interface nflfoot_pio_intf = { ipu_ctc_interrupt, 0, diff --git a/src/mame/machine/mexico86.c b/src/mame/machine/mexico86.c index bb5dd1fbfff..2f3263b1c2f 100644 --- a/src/mame/machine/mexico86.c +++ b/src/mame/machine/mexico86.c @@ -107,7 +107,7 @@ logerror("initialising MCU\n"); if (mexico86_protection_ram[0xe0] > 0 && mexico86_protection_ram[0xe0] < 4) { - static UINT8 answers[3][16] = + static const UINT8 answers[3][16] = { { 0x00,0x40,0x48,0x50,0x58,0x60,0x68,0x70,0x78,0x80,0x88,0x00,0x00,0x00,0x00,0x00 }, { 0x00,0x04,0x08,0x0C,0x10,0x14,0x18,0x1C,0x20,0x31,0x2B,0x35,0x00,0x00,0x00,0x00 }, @@ -130,7 +130,7 @@ logerror("initialising MCU\n"); // The following is missing from Knight Boy // this should be equivalent to the obfuscated kiki_clogic() below { - static int db[16]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x10,0x18,0x00,0x00,0x00,0x00}; + static const int db[16]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x10,0x18,0x00,0x00,0x00,0x00}; int sy = mexico86_protection_ram[0xa0] + ((0x18)>>1); int sx = mexico86_protection_ram[0xa1] + ((0x18)>>1); @@ -175,7 +175,7 @@ INTERRUPT_GEN( kikikai_interrupt ) static void kiki_clogic(int address, int latch) { - static UINT8 db[16]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x10,0x18,0x00,0x00,0x00,0x00}; + static const UINT8 db[16]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x10,0x18,0x00,0x00,0x00,0x00}; static UINT8 queue[64]; static int qfront = 0, state = 0; int sy, sx, hw, i, qptr, diff1, diff2; diff --git a/src/mame/machine/midwayic.c b/src/mame/machine/midwayic.c index 21c145ddc8d..23bb83edf03 100644 --- a/src/mame/machine/midwayic.c +++ b/src/mame/machine/midwayic.c @@ -72,7 +72,7 @@ struct ioasic_state UINT8 dcs_cpu; UINT8 shuffle_type; UINT8 shuffle_active; - UINT8 * shuffle_map; + const UINT8 * shuffle_map; void (*irq_callback)(int); UINT8 irq_state; UINT16 sound_irq_state; @@ -589,7 +589,7 @@ static void ioasic_register_state(void) void midway_ioasic_init(int shuffle, int upper, int yearoffs, void (*irq_callback)(int)) { - static UINT8 shuffle_maps[][16] = + static const UINT8 shuffle_maps[][16] = { { 0x0,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x8,0x9,0xa,0xb,0xc,0xd,0xe,0xf }, /* WarGods, WG3DH, SFRush, MK4 */ { 0x4,0x5,0x6,0x7,0xb,0xa,0x9,0x8,0x3,0x2,0x1,0x0,0xf,0xe,0xd,0xc }, /* Blitz, Blitz99 */ diff --git a/src/mame/machine/model1.c b/src/mame/machine/model1.c index 93f32644bc8..a07b40125b5 100644 --- a/src/mame/machine/model1.c +++ b/src/mame/machine/model1.c @@ -2157,7 +2157,7 @@ WRITE16_HANDLER( model1_vr_tgp_w ) } /* TGP config */ -struct mb86233_config model1_vr_tgp_config = +const struct mb86233_config model1_vr_tgp_config = { copro_fifoin_pop, copro_fifoout_push diff --git a/src/mame/machine/model3.c b/src/mame/machine/model3.c index 6575f3d7a4f..58e1dde4d6a 100644 --- a/src/mame/machine/model3.c +++ b/src/mame/machine/model3.c @@ -22,7 +22,7 @@ static int m3_step; #define NEXT(new_state) fsm[state][new_state] static INT32 state; // current state -static INT32 fsm[][2] = { +static const INT32 fsm[][2] = { { 1, 0 }, // 0 Test-Logic/Reset { 1, 2 }, // 1 Run-Test/Idle { 3, 9 }, // 2 Select-DR-Scan diff --git a/src/mame/machine/n64.c b/src/mame/machine/n64.c index 1925c5702e9..8a25201ce9b 100644 --- a/src/mame/machine/n64.c +++ b/src/mame/machine/n64.c @@ -564,7 +564,7 @@ WRITE32_HANDLER( n64_dp_reg_w ) } -rsp_config n64_rsp_config = +const rsp_config n64_rsp_config = { n64_dp_reg_r, n64_dp_reg_w, diff --git a/src/mame/machine/namcoio.c b/src/mame/machine/namcoio.c index 38e135ccefc..5f6c3fe7748 100644 --- a/src/mame/machine/namcoio.c +++ b/src/mame/machine/namcoio.c @@ -277,7 +277,7 @@ static void namcoio_51XX_write(int chip,int data) verified on Namco original hardware, but they are the same in all the bootlegs, so we can assume they are right. */ -static int joy_map[16] = +static const int joy_map[16] = /* LDRU, LDR, LDU, LD, LRU, LR, LU, L, DRU, DR, DU, D, RU, R, U, center */ { 0xf, 0xe, 0xd, 0x5, 0xc, 0x9, 0x7, 0x6, 0xb, 0x3, 0xa, 0x4, 0x1, 0x2, 0x0, 0x8 }; diff --git a/src/mame/machine/neoboot.c b/src/mame/machine/neoboot.c index 849f87ab24a..f709708085e 100644 --- a/src/mame/machine/neoboot.c +++ b/src/mame/machine/neoboot.c @@ -414,7 +414,7 @@ void decrypt_cthd2003(void) static WRITE16_HANDLER ( cthd2003_bankswitch_w ) { int bankaddress; - static int cthd2003_banks[8] = + static const int cthd2003_banks[8] = { 1,0,1,0,1,0,3,2, }; diff --git a/src/mame/machine/neoprot.c b/src/mame/machine/neoprot.c index 5a350202f38..65969b102ed 100644 --- a/src/mame/machine/neoprot.c +++ b/src/mame/machine/neoprot.c @@ -189,7 +189,7 @@ void mslugx_install_protection(void) static WRITE16_HANDLER( kof99_bankswitch_w ) { int bankaddress; - static int bankoffset[64] = + static const int bankoffset[64] = { 0x000000, 0x100000, 0x200000, 0x300000, 0x3cc000, 0x4cc000, 0x3f2000, 0x4f2000, @@ -221,7 +221,7 @@ static WRITE16_HANDLER( garou_bankswitch_w ) { /* thanks to Razoola and Mr K for the info */ int bankaddress; - static int bankoffset[64] = + static const int bankoffset[64] = { 0x000000, 0x100000, 0x200000, 0x300000, // 00 0x280000, 0x380000, 0x2d0000, 0x3d0000, // 04 @@ -258,7 +258,7 @@ static WRITE16_HANDLER( garouo_bankswitch_w ) { /* thanks to Razoola and Mr K for the info */ int bankaddress; - static int bankoffset[64] = + static const int bankoffset[64] = { 0x000000, 0x100000, 0x200000, 0x300000, // 00 0x280000, 0x380000, 0x2d0000, 0x3d0000, // 04 @@ -297,7 +297,7 @@ static WRITE16_HANDLER( mslug3_bankswitch_w ) { /* thanks to Razoola and Mr K for the info */ int bankaddress; - static int bankoffset[64] = + static const int bankoffset[64] = { 0x000000, 0x020000, 0x040000, 0x060000, // 00 0x070000, 0x090000, 0x0b0000, 0x0d0000, // 04 @@ -333,7 +333,7 @@ static WRITE16_HANDLER( kof2000_bankswitch_w ) { /* thanks to Razoola and Mr K for the info */ int bankaddress; - static int bankoffset[64] = + static const int bankoffset[64] = { 0x000000, 0x100000, 0x200000, 0x300000, // 00 0x3f7800, 0x4f7800, 0x3ff800, 0x4ff800, // 04 diff --git a/src/mame/machine/nmk004.c b/src/mame/machine/nmk004.c index ca38777b8c9..160505281fa 100644 --- a/src/mame/machine/nmk004.c +++ b/src/mame/machine/nmk004.c @@ -587,7 +587,7 @@ popmessage("%02x %02x%02x%02x%02x %02x %02x%02x%02x%02x %02x %02x%02x%02x%02x", static void fm_voices_update(void) { - static int ym2203_registers[0x18] = + static const int ym2203_registers[0x18] = { 0x30,0x38,0x34,0x3C,0x40,0x48,0x44,0x4C,0x50,0x58,0x54,0x5C,0x60,0x68,0x64,0x6C, 0x70,0x78,0x74,0x7C,0x80,0x88,0x84,0x8C @@ -896,11 +896,11 @@ static void psg_update(int channel) static void get_command(void) { - static UINT8 from_main[] = + static const UINT8 from_main[] = { 0x00,0x22,0x62,0x8c,0xc7,0x00,0x00,0x3f,0x7f,0x89,0xc7,0x00,0x00,0x2b,0x6b }; - static UINT8 to_main[] = + static const UINT8 to_main[] = { 0x82,0xc7,0x00,0x2c,0x6c,0x00,0x9f,0xc7,0x00,0x29,0x69,0x00,0x8b,0xc7,0x00 }; @@ -1019,7 +1019,7 @@ void NMK004_irq(int irq) static TIMER_CALLBACK( real_nmk004_init ) { - static UINT8 ym2203_init[] = + static const UINT8 ym2203_init[] = { 0x07,0x38,0x08,0x00,0x09,0x00,0x0A,0x00,0x24,0xB3,0x25,0x00,0x26,0xF9,0x27,0x15, 0x28,0x00,0x28,0x01,0x28,0x02,0x40,0x00,0x41,0x00,0x42,0x00,0x44,0x00,0x45,0x00, diff --git a/src/mame/machine/pckeybrd.c b/src/mame/machine/pckeybrd.c index 929b9089cb1..38ccedd9f9b 100644 --- a/src/mame/machine/pckeybrd.c +++ b/src/mame/machine/pckeybrd.c @@ -58,7 +58,7 @@ to the scancode set I have here. - KT 22/Jun/2000 */ /* key set 3 */ -static int at_keyboard_scancode_set_2_3[]= +static const int at_keyboard_scancode_set_2_3[]= { 0, 0x076, @@ -199,7 +199,7 @@ typedef struct extended_keyboard_code } extended_keyboard_code; -static extended_keyboard_code keyboard_mf2_code[0x10][2/*numlock off, on*/]={ +static const extended_keyboard_code keyboard_mf2_code[0x10][2/*numlock off, on*/]={ { { "\xe0\x1c", "\xe0\x9c" } }, // keypad enter { { "\xe0\x1d", "\xe0\x9d" } }, // right control { { "\xe0\x35", "\xe0\xb5" } }, @@ -220,7 +220,7 @@ static extended_keyboard_code keyboard_mf2_code[0x10][2/*numlock off, on*/]={ /* I don't think these keys change if num-lock is active! */ /* pc-at extended keyboard make/break codes for code set 3 */ -static extended_keyboard_code at_keyboard_extended_codes_set_2_3[]= +static const extended_keyboard_code at_keyboard_extended_codes_set_2_3[]= { /*keypad enter */ { @@ -477,7 +477,7 @@ static void at_keyboard_extended_scancode_insert(int code, int pressed) case 2: case 3: { - extended_keyboard_code *key = &at_keyboard_extended_codes_set_2_3[code]; + const extended_keyboard_code *key = &at_keyboard_extended_codes_set_2_3[code]; if (pressed) { diff --git a/src/mame/machine/pcshare.c b/src/mame/machine/pcshare.c index a6a58ff025b..c0f91d84d0f 100644 --- a/src/mame/machine/pcshare.c +++ b/src/mame/machine/pcshare.c @@ -104,7 +104,7 @@ static void pc_com_refresh_connected(int n, int data) /* PC interface to PC-com hardware. Done this way because PCW16 also uses PC-com hardware and doesn't have the same setup! */ -static uart8250_interface com_interface[4]= +static const uart8250_interface com_interface[4]= { { TYPE8250, @@ -201,7 +201,7 @@ static const struct pit8253_config pc_pit8254_config = #ifdef MESS -static PC_LPT_CONFIG lpt_config[3]={ +static const PC_LPT_CONFIG lpt_config[3]={ { 1, LPT_UNIDIRECTIONAL, @@ -219,7 +219,7 @@ static PC_LPT_CONFIG lpt_config[3]={ } }; -static CENTRONICS_CONFIG cent_config[3]={ +static const CENTRONICS_CONFIG cent_config[3]={ { PRINTER_IBM, pc_lpt_handshake_in @@ -367,7 +367,7 @@ static void pc_dma_write_byte(int channel, offs_t offset, UINT8 data) -static struct dma8237_interface pc_dma = +static const struct dma8237_interface pc_dma = { 0, 1.0e-6, // 1us diff --git a/src/mame/machine/pgmcrypt.c b/src/mame/machine/pgmcrypt.c index 68f48ec4c1e..f3b5a3223c2 100644 --- a/src/mame/machine/pgmcrypt.c +++ b/src/mame/machine/pgmcrypt.c @@ -320,7 +320,7 @@ void pgm_killbld_decrypt(void) #ifdef UNUSED_FUNCTION -static UINT8 dfront_tab[256] = { +static const UINT8 dfront_tab[256] = { 0x51, 0xc4, 0xe3, 0x10, 0x1c, 0xad, 0x8a, 0x39, 0x8c, 0xe0, 0xa5, 0x04, 0x0f, 0xe4, 0x35, 0xc3, 0x2d, 0x6b, 0x32, 0xe2, 0x60, 0x54, 0x63, 0x06, 0xa3, 0xf1, 0x0b, 0x5f, 0x6c, 0x5c, 0xb3, 0xec, 0x77, 0x61, 0x69, 0xe7, 0x3c, 0xb7, 0x42, 0x72, 0x1a, 0x70, 0xb0, 0x96, 0xa4, 0x28, 0xc0, 0xfb, @@ -380,7 +380,7 @@ void pgm_dfront_decrypt(void) } -static UINT8 ddp2_tab[256] = { +static const UINT8 ddp2_tab[256] = { 0x2a, 0x4a, 0x39, 0x98, 0xac, 0x39, 0xb2, 0x55, 0x72, 0xf3, 0x7b, 0x3c, 0xee, 0x94, 0x6e, 0xd5, 0xcd, 0xbc, 0x9a, 0xd0, 0x45, 0x7d, 0x49, 0x68, 0xb1, 0x61, 0x54, 0xef, 0xa2, 0x84, 0x29, 0x20, 0x32, 0x52, 0x82, 0x04, 0x38, 0x69, 0x9f, 0x24, 0x46, 0xf4, 0x3f, 0xc2, 0xf1, 0x25, 0xac, 0x2d, @@ -435,7 +435,7 @@ void pgm_ddp2_decrypt(void) #endif -static UINT8 mm_tab[256] = { +static const UINT8 mm_tab[256] = { 0xd0, 0x45, 0xbc, 0x84, 0x93, 0x60, 0x7d, 0x49, 0x68, 0xb1, 0x54, 0xa2, 0x05, 0x29, 0x41, 0x20, 0x04, 0x08, 0x52, 0x25, 0x89, 0xf4, 0x69, 0x9f, 0x24, 0x46, 0x3d, 0xf1, 0xf9, 0xab, 0xa6, 0x2d, 0x18, 0x19, 0x6d, 0x33, 0x79, 0x23, 0x3b, 0x1d, 0xe0, 0xb8, 0x61, 0x1a, 0xe1, 0x4c, 0x5d, 0x3f, diff --git a/src/mame/machine/pgmprot.c b/src/mame/machine/pgmprot.c index 9ecdade6a75..3d96723d24c 100644 --- a/src/mame/machine/pgmprot.c +++ b/src/mame/machine/pgmprot.c @@ -16,38 +16,38 @@ static UINT32 PSTARS_VAL; static UINT16 pstar_e7,pstar_b1,pstar_ce; static UINT16 pstar_ram[3]; -static int Pstar_ba[0x1E]={ +static const int Pstar_ba[0x1E]={ 0x02,0x00,0x00,0x01,0x00,0x03,0x00,0x00, //0 0x02,0x00,0x06,0x00,0x22,0x04,0x00,0x03, //8 0x00,0x00,0x06,0x00,0x20,0x07,0x00,0x03, //10 0x00,0x21,0x01,0x00,0x00,0x63 }; -static int Pstar_b0[0x10]={ +static const int Pstar_b0[0x10]={ 0x09,0x0A,0x0B,0x00,0x01,0x02,0x03,0x04, 0x05,0x06,0x07,0x08,0x00,0x00,0x00,0x00 }; -static int Pstar_ae[0x10]={ +static const int Pstar_ae[0x10]={ 0x5D,0x86,0x8C ,0x8B,0xE0,0x8B,0x62,0xAF, 0xB6,0xAF,0x10A,0xAF,0x00,0x00,0x00,0x00 }; -static int Pstar_a0[0x10]={ +static const int Pstar_a0[0x10]={ 0x02,0x03,0x04,0x05,0x06,0x01,0x0A,0x0B, 0x0C,0x0D,0x0E,0x09,0x00,0x00,0x00,0x00, }; -static int Pstar_9d[0x10]={ +static const int Pstar_9d[0x10]={ 0x05,0x03,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, }; -static int Pstar_90[0x10]={ +static const int Pstar_90[0x10]={ 0x0C,0x10,0x0E,0x0C,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; -static int Pstar_8c[0x23]={ +static const int Pstar_8c[0x23]={ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01, 0x01,0x01,0x01,0x01,0x02,0x02,0x02,0x02, @@ -55,7 +55,7 @@ static int Pstar_8c[0x23]={ 0x03,0x03,0x03 }; -static int Pstar_80[0x1a3]={ +static const int Pstar_80[0x1a3]={ 0x03,0x03,0x04,0x04,0x04,0x04,0x05,0x05, 0x05,0x05,0x06,0x06,0x03,0x03,0x04,0x04, 0x05,0x05,0x05,0x05,0x06,0x06,0x07,0x07, @@ -317,7 +317,7 @@ static UINT32 bt(UINT32 v, int bit) static void asic3_compute_hold(void) { // The mode is dependant on the region - static int modes[4] = { 1, 1, 3, 2 }; + static const int modes[4] = { 1, 1, 3, 2 }; int mode = modes[readinputport(4) & 3]; switch(mode) { diff --git a/src/mame/machine/playch10.c b/src/mame/machine/playch10.c index ca9f98cf7fb..c2518b6f41b 100644 --- a/src/mame/machine/playch10.c +++ b/src/mame/machine/playch10.c @@ -254,7 +254,7 @@ READ8_HANDLER( pc10_in1_r ) } /* RP5H01 interface */ -static struct RP5H01_interface rp5h01_interface = +static const struct RP5H01_interface rp5h01_interface = { 1, { REGION_USER1 }, diff --git a/src/mame/machine/psx.c b/src/mame/machine/psx.c index be4ffe996b3..d1d9216b3f3 100644 --- a/src/mame/machine/psx.c +++ b/src/mame/machine/psx.c @@ -997,7 +997,7 @@ static UINT16 m_p_n_mdec_r5[ 256 * 3 ]; static UINT16 m_p_n_mdec_g5[ 256 * 3 ]; static UINT16 m_p_n_mdec_b5[ 256 * 3 ]; -static UINT32 m_p_n_mdec_zigzag[ DCTSIZE2 ] = +static const UINT32 m_p_n_mdec_zigzag[ DCTSIZE2 ] = { 0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, diff --git a/src/mame/machine/scramble.c b/src/mame/machine/scramble.c index 5dc2aae78ee..1259075a52a 100644 --- a/src/mame/machine/scramble.c +++ b/src/mame/machine/scramble.c @@ -66,7 +66,7 @@ MACHINE_RESET( explorer ) static READ8_HANDLER( scrambls_input_port_2_r ) { - static UINT8 mask[] = { 0x20, 0x20, 0x80, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0 }; + static const UINT8 mask[] = { 0x20, 0x20, 0x80, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0 }; UINT8 res; diff --git a/src/mame/machine/scudsp.c b/src/mame/machine/scudsp.c index 7f7320961a7..daef9dc69d1 100644 --- a/src/mame/machine/scudsp.c +++ b/src/mame/machine/scudsp.c @@ -877,7 +877,7 @@ void dsp_execute_program() SCU DSP Disassembler ************************************************************************/ -static const char* ALU_Commands[] = +static const char *const ALU_Commands[] = { "", /* 0000 */ "AND", /* 0001 */ @@ -897,7 +897,7 @@ static const char* ALU_Commands[] = "RL8", /* 1111 */ }; -static const char* X_Commands[] = +static const char *const X_Commands[] = { "", /* 000 */ "", /* 001 */ /* NOP? check instruction @ 0x0B */ @@ -906,7 +906,7 @@ static const char* X_Commands[] = "MOV %s,X", /* 100 */ }; -static const char* Y_Commands[] = +static const char *const Y_Commands[] = { "", /* 000 */ "CLR A", /* 001 */ @@ -915,7 +915,7 @@ static const char* Y_Commands[] = "MOV %s,Y", /* 100 */ }; -static const char* D1_Commands[] = +static const char *const D1_Commands[] = { "", /* 00 */ "MOV %I8,%d", /* 01 */ @@ -923,7 +923,7 @@ static const char* D1_Commands[] = "MOV %S,%d", /* 11 */ }; -static const char* SourceMemory[] = +static const char *const SourceMemory[] = { "M0", /* 000 */ "M1", /* 001 */ @@ -935,7 +935,7 @@ static const char* SourceMemory[] = "MC3", /* 111 */ }; -static const char* SourceMemory2[] = +static const char *const SourceMemory2[] = { "M0", /* 0000 */ "M1", /* 0001 */ @@ -955,7 +955,7 @@ static const char* SourceMemory2[] = "???", /* 1111 */ }; -static const char* DestMemory[] = +static const char *const DestMemory[] = { "MC0", /* 0000 */ "MC1", /* 0001 */ @@ -975,7 +975,7 @@ static const char* DestMemory[] = "CT3", /* 1111 */ }; -static const char* DestDMAMemory[] = +static const char *const DestDMAMemory[] = { "M0", /* 000 */ "M1", /* 001 */ @@ -987,19 +987,19 @@ static const char* DestDMAMemory[] = "???", /* 111 */ }; -static const char* MVI_Command[] = +static const char *const MVI_Command[] = { "MVI %I,%d", /* 0 */ "MVI %I,%d,%f", /* 1 */ }; -static const char* JMP_Command[] = +static const char *const JMP_Command[] = { "JMP %IA", "JMP %f,%IA", }; -static const char* DMA_Command[] = +static const char *const DMA_Command[] = { "DMA%H%A D0,%M,%I", "DMA%H%A %s,D0,%I", diff --git a/src/mame/machine/segacrpt.c b/src/mame/machine/segacrpt.c index 66c682adf94..2d11dbfc216 100644 --- a/src/mame/machine/segacrpt.c +++ b/src/mame/machine/segacrpt.c @@ -184,7 +184,7 @@ static void lfkp(int mask) for (A = 0x0000;A < 0x8000-14;A++) { - static char text[] = "INSERT COIN"; + static const char text[] = "INSERT COIN"; int i; diff --git a/src/mame/machine/segas32.c b/src/mame/machine/segas32.c index 0026d3beaac..6f0c38ff86e 100644 --- a/src/mame/machine/segas32.c +++ b/src/mame/machine/segas32.c @@ -83,7 +83,7 @@ READ16_HANDLER( ga2_dpram_r ) #if 0 // simulation READ16_HANDLER(ga2_sprite_protection_r) { - static UINT32 prot[16] = + static const UINT16 prot[16] = { 0x0a, 0, 0xc5, 0, @@ -100,7 +100,7 @@ READ16_HANDLER(ga2_sprite_protection_r) READ16_HANDLER(ga2_wakeup_protection_r) { - static const char *prot = + static const char prot[] = "wake up! GOLDEN AXE The Revenge of Death-Adder! "; return prot[offset]; } @@ -310,7 +310,7 @@ WRITE16_HANDLER(arabfgt_protection_w) READ16_HANDLER(arf_wakeup_protection_r) { - static const char *prot = + static const char prot[] = "wake up! ARF! "; return prot[offset]; } diff --git a/src/mame/machine/snes.c b/src/mame/machine/snes.c index 6119ea42f39..e9d25715a71 100644 --- a/src/mame/machine/snes.c +++ b/src/mame/machine/snes.c @@ -46,9 +46,9 @@ static UINT16 snes_htmult; /* in 512 wide, we run HTOTAL double and halve it on // full graphic variables static UINT16 vram_fgr_high, vram_fgr_increment, vram_fgr_count, vram_fgr_mask, vram_fgr_shift, vram_read_buffer; -static UINT16 vram_fgr_inctab[4] = { 1, 32, 128, 128 }; -static UINT16 vram_fgr_inccnts[4] = { 0, 32, 64, 128 }; -static UINT16 vram_fgr_shiftab[4] = { 0, 5, 6, 7 }; +static const UINT16 vram_fgr_inctab[4] = { 1, 32, 128, 128 }; +static const UINT16 vram_fgr_inccnts[4] = { 0, 32, 64, 128 }; +static const UINT16 vram_fgr_shiftab[4] = { 0, 5, 6, 7 }; struct snes_cart_info snes_cart = { SNES_MODE_20, 0x40000, 0x40000 }; diff --git a/src/mame/machine/starwars.c b/src/mame/machine/starwars.c index 97ed1b697e2..0795edc4764 100644 --- a/src/mame/machine/starwars.c +++ b/src/mame/machine/starwars.c @@ -17,7 +17,7 @@ #define kYaw 1 #define kThrust 2 -/* Constants for mathbox operations */ +/* Constants for matrix processor operations */ #define NOP 0x00 #define LAC 0x01 #define READ_ACC 0x02 @@ -31,6 +31,7 @@ /* Debugging flag */ #define MATHDEBUG 0 +#define MASTER_CLOCK (12096000) UINT8 *starwars_mathram; UINT8 *starwars_ram_overlay; @@ -49,11 +50,18 @@ static UINT8 *PROM_STR; /* Storage for instruction strobe only */ static UINT8 *PROM_MAS; /* Storage for direct address only */ static UINT8 *PROM_AM; /* Storage for address mode select only */ +static int math_run; +static emu_timer *math_timer; /* Local function prototypes */ -static void run_mbox(void); +static void run_mproc(void); +static TIMER_CALLBACK( math_run_clear ) +{ + math_run = 0; +} + /************************************* * @@ -122,10 +130,11 @@ READ8_HANDLER( starwars_input_1_r ) { int x = readinputport(1); - /* Kludge to enable Starwars Mathbox Self-test */ - /* The mathbox looks like it's running, from this address... :) */ - if (activecpu_get_pc() == 0xf978 || activecpu_get_pc() == 0xf655) + /* set the matrix processor flag */ + if (math_run) x |= 0x80; + else + x &= ~0x80; /* set the AVG done flag */ if (avgdvg_done()) @@ -169,11 +178,11 @@ WRITE8_HANDLER( starwars_adc_select_w ) /************************************* * - * Mathbox initialization + * Matrix Processor initialization * *************************************/ -void swmathbox_init(void) +void starwars_mproc_init(void) { UINT8 *src = memory_region(REGION_USER2); int cnt, val; @@ -195,30 +204,33 @@ void swmathbox_init(void) PROM_MAS[cnt] = val & 0x007f; PROM_AM[cnt] = (val >> 7) & 0x0001; } + + math_timer = timer_alloc(math_run_clear, NULL); } /************************************* * - * Mathbox reset + * Matrix Processor reset * *************************************/ -void swmathbox_reset(void) +void starwars_mproc_reset(void) { MPA = BIC = 0; + math_run = 0; } /************************************* * - * Mathbox execution + * Matrix Processor execution * *************************************/ -void run_mbox(void) +void run_mproc(void) { static INT16 A, B, C; static INT32 ACC; @@ -229,13 +241,20 @@ void run_mbox(void) int M_STOP = 100000; /* Limit on number of instructions allowed before halt */ int MA; int IP15_8, IP7, IP6_0; /* Instruction PROM values */ + int mptime; + logerror("Running Matrix Processor...\n"); - logerror("Running Mathbox...\n"); + mptime = 0; + math_run = 1; /* loop until finished */ while (M_STOP > 0) { + + /* each step of the matrix processor takes five clock cycles */ + mptime += 5; + /* fetch the current instruction data */ IP15_8 = PROM_STR[MPA]; IP7 = PROM_AM[MPA]; @@ -341,6 +360,11 @@ void run_mbox(void) */ A = (A & 0x8000)? 0xffff: 0; B = (B & 0x8000)? 0xffff: 0; + + /* The multiply-add holds the main matrix processor counter + * for 33 cycles + */ + mptime += 33; } /* 0x40 - LDB */ @@ -362,6 +386,8 @@ void run_mbox(void) M_STOP--; /* Decrease count */ } + + timer_adjust(math_timer, attotime_mul(ATTOTIME_IN_HZ(MASTER_CLOCK), mptime), 1, attotime_zero); } @@ -372,7 +398,7 @@ void run_mbox(void) * *************************************/ -READ8_HANDLER( swmathbx_prng_r ) +READ8_HANDLER( starwars_prng_r ) { /* * The PRNG is a modified 23 bit LFSR. Taps are at 4 and 22 so the @@ -394,23 +420,23 @@ READ8_HANDLER( swmathbx_prng_r ) /************************************* * - * Mathbox divider + * Starwars divider * *************************************/ -READ8_HANDLER( swmathbx_reh_r ) +READ8_HANDLER( starwars_div_reh_r ) { return (quotient_shift & 0xff00) >> 8; } -READ8_HANDLER( swmathbx_rel_r ) +READ8_HANDLER( starwars_div_rel_r ) { return quotient_shift & 0x00ff; } -WRITE8_HANDLER( swmathbx_w ) +WRITE8_HANDLER( starwars_math_w ) { int i; @@ -419,7 +445,7 @@ WRITE8_HANDLER( swmathbx_w ) { case 0: /* mw0 */ MPA = data << 2; /* Set starting PROM address */ - run_mbox(); /* and run the Mathbox */ + run_mproc(); /* and run the Matrix Processor */ break; case 1: /* mw1 */ diff --git a/src/mame/machine/stfight.c b/src/mame/machine/stfight.c index 92c3c28a9c0..842f530766b 100644 --- a/src/mame/machine/stfight.c +++ b/src/mame/machine/stfight.c @@ -170,7 +170,7 @@ WRITE8_HANDLER( stfight_coin_w ) * Machine hardware for MSM5205 ADPCM sound control */ -static int sampleLimits[] = +static const int sampleLimits[] = { 0x0000, // machine gun fire? 0x1000, // player getting shot diff --git a/src/mame/machine/stvprot.c b/src/mame/machine/stvprot.c index 3ac6d603877..d46fc65e662 100644 --- a/src/mame/machine/stvprot.c +++ b/src/mame/machine/stvprot.c @@ -116,7 +116,7 @@ Wrong vectors (at least not where I tested it): 0x060427FC (1st) (resets the sh2) 0x0603B1B2 (1st) (crashes the sh2) */ -static UINT32 vector_prot[] = { 0x0603B1B2,0x234 }; +static const UINT32 vector_prot[] = { 0x0603B1B2,0x234 }; static READ32_HANDLER( a_bus_ctrl_r ) { diff --git a/src/mame/machine/system16.c b/src/mame/machine/system16.c index d4d315bda77..a457640fdfa 100644 --- a/src/mame/machine/system16.c +++ b/src/mame/machine/system16.c @@ -59,7 +59,7 @@ static void sound_cause_nmi( int chip ){ } -struct upd7759_interface sys16_upd7759_interface = +const struct upd7759_interface sys16_upd7759_interface = { 0, /* memory region 3 contains the sample data */ sound_cause_nmi diff --git a/src/mame/machine/twincobr.c b/src/mame/machine/twincobr.c index 2fded5e44b3..50c45396e44 100644 --- a/src/mame/machine/twincobr.c +++ b/src/mame/machine/twincobr.c @@ -24,7 +24,7 @@ static int dsp_execute; static UINT32 dsp_addr_w, main_ram_seg; #if LOG_DSP_CALLS -const static int toaplan_port_type[2] = { 0x7800c, 0x5c }; +static const int toaplan_port_type[2] = { 0x7800c, 0x5c }; #endif UINT8 *twincobr_sharedram; diff --git a/src/mame/machine/vertigo.c b/src/mame/machine/vertigo.c index 0b8b3f3a225..2ec573bbf58 100644 --- a/src/mame/machine/vertigo.c +++ b/src/mame/machine/vertigo.c @@ -39,7 +39,7 @@ static UINT8 irq_state; static UINT8 adc_result; /* 8254 timer config */ -static struct pit8253_config pit8254_config = +static const struct pit8253_config pit8254_config = { TYPE8254, { @@ -59,7 +59,7 @@ static struct pit8253_config pit8254_config = } }; -static struct TTL74148_interface irq_encoder = +static const struct TTL74148_interface irq_encoder = { update_irq }; diff --git a/src/mame/machine/volfied.c b/src/mame/machine/volfied.c index d8b9ffe61d6..95d93a9c463 100644 --- a/src/mame/machine/volfied.c +++ b/src/mame/machine/volfied.c @@ -260,7 +260,7 @@ static const UINT16 palette_data_11[0x50] = 0xce39, 0x1c02, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }; -static const UINT16* palette_data_lookup[] = +static const UINT16 *const palette_data_lookup[] = { 0, palette_data_01, diff --git a/src/mame/machine/vsnes.c b/src/mame/machine/vsnes.c index fbcdd2b03fa..13bfddc5dfd 100644 --- a/src/mame/machine/vsnes.c +++ b/src/mame/machine/vsnes.c @@ -16,7 +16,7 @@ static int vsnes_do_vrom_bank; /* Locals */ static int input_latch[4]; -static UINT8 *remapped_colortable; +static const UINT8 *remapped_colortable; static int sound_fix=0; /************************************* @@ -27,7 +27,7 @@ static int sound_fix=0; /* RP2C04-001 */ /* check 0x08 */ -static UINT8 rp2c04001_colortable[] = +static const UINT8 rp2c04001_colortable[] = { 0x35, 0xff, 0x16, 0x22, 0x1c, 0xff, 0xff, 0x15, /* 0x00 - 0x07 */ 0x20, 0x00, 0x27, 0x05, 0x04, 0x27, 0x08, 0x30, /* 0x08 - 0x0f */ @@ -41,7 +41,7 @@ static UINT8 rp2c04001_colortable[] = /* RP2C04-002 */ /* 0x04, 0x24 */ -static UINT8 rp2c04002_colortable[] = +static const UINT8 rp2c04002_colortable[] = { 0xff, 0x27, 0x18, 0xff, 0x3a, 0x25, 0x2b, 0x31, /* 0x00 - 0x07 */ 0x15, 0x13, 0x38, 0x34, 0x20, 0x23, 0xff, 0x0b, /* 0x08 - 0x0f */ @@ -55,7 +55,7 @@ static UINT8 rp2c04002_colortable[] = /* RP2C04-003 */ /* check 0x0f, 0x2e, 0x34 */ -static UINT8 rp2c04003_colortable[] = +static const UINT8 rp2c04003_colortable[] = { 0xff, 0xff, 0xff, 0x10, 0x1a, 0x30, 0x31, 0x09, /* 0x00 - 0x07 */ 0x01, 0x0f, 0x36, 0x08, 0x15, 0xff, 0xff, 0x30, /* 0x08 - 0x0f */ @@ -69,7 +69,7 @@ static UINT8 rp2c04003_colortable[] = /* RP2C05-004 */ /* check 0x03 0x1d, 0x38, 0x3b*/ -static UINT8 rp2c05004_colortable[] = +static const UINT8 rp2c05004_colortable[] = { 0x18, 0xff, 0x1c, 0x89, 0xff, 0xff, 0x01, 0x17, /* 0x00 - 0x07 */ 0x10, 0x0f, 0x2a, 0xff, 0x36, 0x37, 0x1a, 0xff, /* 0x08 - 0x0f */ @@ -1075,7 +1075,7 @@ DRIVER_INIT( supxevs ) static READ8_HANDLER( tko_security_r ) { static int security_counter; - static UINT8 security_data[] = { + static const UINT8 security_data[] = { 0xff, 0xbf, 0xb7, 0x97, 0x97, 0x17, 0x57, 0x4f, 0x6f, 0x6b, 0xeb, 0xa9, 0xb1, 0x90, 0x94, 0x14, 0x56, 0x4e, 0x6f, 0x6b, 0xeb, 0xa9, 0xb1, 0x90, |