Previous 15994 Revisions Next

r1582 Monday 21st January, 2008 at 03:39:30 UTC by Nathan Woods
1. Statification/Constification [Atari Ace]

2. Sync with MAME (i8039.c, pcshare.c)
[docs]messnew.txt
[src/emu/cpu/i8039]i8039.c
[src/mame/machine]pcshare.c
[src/mess]image.c mslegacy.c opresolv.c
[src/mess/audio]dai.c gb.c
[src/mess/devices]chd_cd.c harddriv.c sonydriv.c thomflop.c
[src/mess/drivers]a2600.c a310.c acrnsys1.c amstrad.c arcadia.c einstein.c ex800.c exelv.c genesis.c ip22.c mpf1.c nc.c pcw16.c pokemini.c psx.c saturn.c snes.c
[src/mess/formats]ap2_dsk.c thom_cas.c vt_cas.c zx81_p.c
[src/mess/machine]3do.c 99_dsk.c adam.c amigacd.c apple2gs.c applefdc.c at.c bbc.c bebox.c c128.c c64.c cbmb.c concept.c cybiko.c ds1315.c gamecom.c gb.c geneve.c intv.c kim1.c lisa.c mac.c mc6850.c mekd2.c msx.c pet.c pokemini.c sms.c svi318.c thomson.c ti99_4x.c tms5501.c vc1541.c vc20.c vtech2.c wd17xx.c wswan.c
[src/mess/osd/windows]menu.c
[src/mess/tools/imgtool]imgterrs.c modules.c
[src/mess/tools/imgtool/modules]cococas.c d64.c ti85.c vzdos.c
[src/mess/tools/imgtool/windows]wimgtool.c
[src/mess/tools/messtest]core.c
[src/mess/video]911_vdt.c channelf.c crtc6845.c dgn_beta.c hp48.c kaypro.c kc.c kim1.c m6845.c m6847.c mekd2.c pc1350.c pc_cga.c ssystem3.c vic6560.c vtech2.c

src/mame/machine/pcshare.c
r1581r1582
4343#include "machine/pc_fdc.h"
4444
4545#include "includes/pclpt.h"
46#include "includes/centroni.h"
46#include "machine/centroni.h"
4747
4848#include "machine/pc_hdc.h"
4949#include "machine/nec765.h"
src/emu/cpu/i8039/i8039.c
r1581r1582
619619   R.timer = 0;
620620}
621621
622#if (HAS_I8035)
622623static void i8035_init (int index, int clock, const void *config, int (*irqcallback)(int))
623624{
624625   i8039_init(index, clock, config, irqcallback);
625626   R.ram_mask = 0x3F;
626627   R.int_rom_size = 0x400;
627628}
629#endif /* HAS_I8035 */
628630
629631#if (HAS_M58715)
630632static void m58715_init (int index, int clock, const void *config, int (*irqcallback)(int))
r1581r1582
632634   i8039_init(index, clock, config, irqcallback);
633635   R.cpu_feature = FEATURE_M58715;
634636}
635#endif
637#endif /* HAS_M58715 */
636638
637639/****************************************************************************
638640 * Reset registers to their initial values
src/mess/devices/harddriv.c
r1581r1582
2222#define MAX_HARDDISKS   8
2323#define USE_CHD_OPEN   0
2424
25static const char *error_strings[] =
25static const char *const error_strings[] =
2626{
2727   "no error",
2828   "no drive interface",
src/mess/devices/sonydriv.c
r1581r1582
226226   else
227227   {   /* 800k unit : rotation speed controlled by drive */
228228#if 1   /* Mac Plus */
229      static int speeds[] =
229      static const int speeds[] =
230230      {
231231         500,   /* 00-15:   timing value 117B (acceptable range {1135-11E9} */
232232         550,   /* 16-31:   timing value ???? (acceptable range {12C6-138A} */
r1581r1582
236236      };
237237#else   /* Lisa 2 */
238238      /* 237 + 1.3*(256-reg) */
239      static int speeds[] =
239      static const int speeds[] =
240240      {
241241         293,   /* 00-15:   timing value ???? (acceptable range {0330-0336} */
242242         322,   /* 16-31:   timing value ???? (acceptable range {02ED-02F3} */
src/mess/devices/chd_cd.c
r1581r1582
1212
1313#define MAX_CDROMS   (4)   // up to this many drives
1414
15static const char *error_strings[] =
15static const char *const error_strings[] =
1616{
1717   "no error",
1818   "no drive interface",
r1581r1582
5353   OPTION_INT('K', "hunksize",         "Hunk Bytes")
5454OPTION_GUIDE_END
5555
56static const char *mess_cd_option_spec =
56static const char mess_cd_option_spec[] =
5757   "K512/1024/2048/[4096]";
5858
5959
src/mess/devices/thomflop.c
r1581r1582
779779         /* most of these are unused now */
780780         static const int bit[8] = { 6, 6, 7, 8, 7, 7, 8, 8 };
781781         static const int par[8] = { 2, 1, 0, 0, 2, 1, 2, 1 };
782         static const char* parname[3] = { "none", "odd", "even" };
782         static const char *const parname[3] = { "none", "odd", "even" };
783783         int bits, parity;
784784         bits   = bit[ (data >> 3) & 7 ];
785785         parity = par[ (data >> 3) & 7 ];
r1581r1582
12271227   /* accumulate bytes to form an id field */
12281228   if ( thmfc1->data_idx || data==0xA1 )
12291229   {
1230      UINT8 header[] = { 0xa1, 0xa1, 0xa1, 0xfe };
1230      static const UINT8 header[] = { 0xa1, 0xa1, 0xa1, 0xfe };
12311231      thmfc1->data[ thmfc1->data_idx ] = data;
12321232      thmfc1->data_idx++;
12331233      if ( thmfc1->data_idx > 11 )
src/mess/mslegacy.c
r1581r1582
1/*********************************************************************
2
3   mslegacy.c
4
5   Defines since removed from MAME, but kept in MESS for legacy
6   reasons
7
8*********************************************************************/
9
10#include "driver.h"
11#include "mslegacy.h"
12
13
14static const char *mess_default_text[] =
15{
16   "OK",
17   "Off",
18   "On",
19   "Dip Switches",
20   "Driver Configuration",
21   "Analog Controls",
22   "Digital Speed",
23   "Autocenter Speed",
24   "Reverse",
25   "Sensitivity",
1/*********************************************************************
2 
3   mslegacy.c
4 
5   Defines since removed from MAME, but kept in MESS for legacy
6   reasons
7 
8*********************************************************************/
9 
10#include "driver.h"
11#include "mslegacy.h"
12 
13 
14static const char *const mess_default_text[] =
15{
16   "OK",
17   "Off",
18   "On",
19   "Dip Switches",
20   "Driver Configuration",
21   "Analog Controls",
22   "Digital Speed",
23   "Autocenter Speed",
24   "Reverse",
25   "Sensitivity",
2626   "\xc2\xab",
2727   "\xc2\xbb",
2828   "Return to Main Menu",
29
30   "Keyboard Emulation Status",
31   "-------------------------",
32   "Mode: PARTIAL Emulation",
33   "Mode: FULL Emulation",
34   "UI:   Enabled",
35   "UI:   Disabled",
36   "**Use ScrLock to toggle**",
37
38   "Image Information",
39   "File Manager",
40   "Tape Control",
41
42   "No Tape Image loaded",
43   "recording",
44   "playing",
45   "(recording)",
46   "(playing)",
47   "stopped",
48   "Pause/Stop",
49   "Record",
50   "Play",
51   "Rewind",
52   "Fast Forward",
53   "Mount...",
54   "Create...",
55   "Unmount",
56   "[empty slot]",
57   "Input Devices",
58   "Quit Fileselector",
59   "File Specification",   /* IMPORTANT: be careful to ensure that the following */
60   "Cartridge",      /* device list matches the order found in device.h    */
61   "Floppy Disk",      /* and is ALWAYS placed after "File Specification"    */
62   "Hard Disk",
63   "Cylinder",
64   "Cassette",
65   "Punched Card",
66   "Punched Tape",
67   "Printer",
68   "Serial Port",
69   "Parallel Port",
70   "Snapshot",
71   "Quickload",
72   "Memory Card",
73   "CD-ROM"
74};
75
76
77
29 
30   "Keyboard Emulation Status",
31   "-------------------------",
32   "Mode: PARTIAL Emulation",
33   "Mode: FULL Emulation",
34   "UI:   Enabled",
35   "UI:   Disabled",
36   "**Use ScrLock to toggle**",
37 
38   "Image Information",
39   "File Manager",
40   "Tape Control",
41 
42   "No Tape Image loaded",
43   "recording",
44   "playing",
45   "(recording)",
46   "(playing)",
47   "stopped",
48   "Pause/Stop",
49   "Record",
50   "Play",
51   "Rewind",
52   "Fast Forward",
53   "Mount...",
54   "Create...",
55   "Unmount",
56   "[empty slot]",
57   "Input Devices",
58   "Quit Fileselector",
59   "File Specification",   /* IMPORTANT: be careful to ensure that the following */
60   "Cartridge",      /* device list matches the order found in device.h    */
61   "Floppy Disk",      /* and is ALWAYS placed after "File Specification"    */
62   "Hard Disk",
63   "Cylinder",
64   "Cassette",
65   "Punched Card",
66   "Punched Tape",
67   "Printer",
68   "Serial Port",
69   "Parallel Port",
70   "Snapshot",
71   "Quickload",
72   "Memory Card",
73   "CD-ROM"
74};
75 
76 
77 
7878/***************************************************************************
7979    PALETTE
8080***************************************************************************/
8181 
82void palette_set_colors_rgb(running_machine *machine, pen_t color_base, const UINT8 *colors, int color_count)
83{
84   while (color_count--)
85   {
86      UINT8 r = *colors++;
87      UINT8 g = *colors++;
88      UINT8 b = *colors++;
89      palette_set_color_rgb(machine, color_base++, r, g, b);
90   }
91}
92
93
82void palette_set_colors_rgb(running_machine *machine, pen_t color_base, const UINT8 *colors, int color_count)
83{
84   while (color_count--)
85   {
86      UINT8 r = *colors++;
87      UINT8 g = *colors++;
88      UINT8 b = *colors++;
89      palette_set_color_rgb(machine, color_base++, r, g, b);
90   }
91}
9492 
93 
94 
9595/***************************************************************************
9696    UI TEXT
9797***************************************************************************/
9898 
99const char * ui_getstring (int string_num)
100{
101   return mess_default_text[string_num];
102}
99const char * ui_getstring (int string_num)
100{
101   return mess_default_text[string_num];
102}
src/mess/opresolv.c
r1581r1582
565565
566566const char *option_resolution_error_string(optreserr_t err)
567567{
568   static const char *errors[] =
568   static const char *const errors[] =
569569   {
570570      "The operation completed successfully",      /* OPTIONRESOLUTION_ERROR_SUCCESS */
571571      "Out of memory",                     /* OPTIONRESOLUTION_ERROR_OUTOFMEMORY */
src/mess/tools/messtest/core.c
r1581r1582
377377   XML_Parser extparser = NULL;
378378   int rc = 0;
379379   char buf[256];
380   static const char *mamekey_prefix = "mamekey_";
380   static const char mamekey_prefix[] = "mamekey_";
381381   input_code c;
382382
383383   buf[0] = '\0';
src/mess/tools/imgtool/modules.c
r1581r1582
1818
1919/* step 2: define the modules[] array */
2020#define MODULE(name)   name##_get_info,
21static void (*modules[])(const imgtool_class *imgclass, UINT32 state, union imgtoolinfo *info) =
21static void (*const modules[])(const imgtool_class *imgclass, UINT32 state, union imgtoolinfo *info) =
2222{
2323#include "modules.c"
2424};
r1581r1582
3232   imgtool_module *module;
3333
3434   /* list of modules that we drop */
35   static const char *irrelevant_modules[] =
35   static const char *const irrelevant_modules[] =
3636   {
3737      "coco_os9_rsdos"
3838   };
src/mess/tools/imgtool/windows/wimgtool.c
r1581r1582
15501550static LRESULT wimgtool_create(HWND window, CREATESTRUCT *pcs)
15511551{
15521552   wimgtool_info *info;
1553   static int status_widths[3] = { 200, 400, -1 };
1553   static const int status_widths[3] = { 200, 400, -1 };
15541554
15551555   info = malloc(sizeof(*info));
15561556   if (!info)
src/mess/tools/imgtool/modules/cococas.c
r1581r1582
1111static int cococas_nextfile(imgtool_image *img, imgtool_dirent *ent);
1212static int cococas_readfile(imgtool_image *img, imgtool_stream *destf);
1313
14static UINT8 blockheader[] = { 0x55, 0x3C };
14static const UINT8 blockheader[] = { 0x55, 0x3C };
1515
1616WAVEMODULE(
1717   cococas,
src/mess/tools/imgtool/modules/ti85.c
r1581r1582
33#include "utils.h"
44#include "formats/ti85_ser.h"
55
6static const char *var_type[] = {
6static const char *const var_type[] = {
77      "Real number",         //0x00
88      "Complex number",      //0x01
99      "Real vector",         //0x02
src/mess/tools/imgtool/modules/d64.c
r1581r1582
5252
5353#define D64_MAX_TRACKS 40
5454
55static int d64_sectors_per_track[] =
55static const int d64_sectors_per_track[] =
5656{
5757   21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
5858   19, 19, 19, 19, 19, 19, 19,
r1581r1582
139139
140140#define D71_MAX_TRACKS 70
141141
142int d71_sectors_per_track[] =
142static const int d71_sectors_per_track[] =
143143{
144144   21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
145145   19, 19, 19, 19, 19, 19, 19,
r1581r1582
12011201static int d81_image_create(const imgtool_module *mod, imgtool_stream *f, const ResolvedOption *options_)
12021202{
12031203   unsigned char sector[0x100]={0};
1204   unsigned char id[2]={'1','2'};
1204   static const unsigned char id[2]={'1','2'};
12051205   int t,s,i;
12061206
12071207   for (t=1; t<=80; t++) {
src/mess/tools/imgtool/modules/vzdos.c
r1581r1582
363363   int ret;
364364   UINT8 sector_data[DATA_SIZE + 4];
365365
366   UINT8 sector_header[24] = {
366   static UINT8 sector_header[24] = {
367367      0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0xFE, 0xE7,
368368      0x18, 0xC3, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80,
369369      0x80, 0x80, 0x80, 0x00, 0xC3, 0x18, 0xE7, 0xFE
src/mess/tools/imgtool/imgterrs.c
r1581r1582
99#include <assert.h>
1010#include "imgterrs.h"
1111
12static const char *msgs[] =
12static const char *const msgs[] =
1313{
1414   "Out of memory",
1515   "Unexpected error",
src/mess/audio/gb.c
r1581r1582
9090static int rate;
9191
9292/* Represents wave duties of 12.5%, 25%, 50% and 75% */
93static float wave_duty_table[4] = { 8, 4, 2, 1.33 };
93static const float wave_duty_table[4] = { 8, 4, 2, 1.33 };
9494static INT32 env_length_table[8];
9595static INT32 swp_time_table[8];
9696static UINT32 period_table[MAX_FREQUENCIES];
src/mess/audio/dai.c
r1581r1582
1919
2020static sound_stream *mixer_channel;
2121
22static UINT16 dai_osc_volume_table[] = {   0,  500, 1000, 1500,
22static const UINT16 dai_osc_volume_table[] = {
23                  0,  500, 1000, 1500,
2324               2000, 2500, 3000, 3500,
2425               4000, 4500, 5000, 5500,
2526               6000, 6500, 7000, 7500};
2627
27static UINT16 dai_noise_volume_table[] = {   0,    0,    0,    0,
28static const UINT16 dai_noise_volume_table[] = {
2829                    0,    0,    0,    0,
30                    0,    0,    0,    0,
2931                       500, 1000, 1500, 2000,
3032                 2500, 3000, 3500, 4000};
3133
src/mess/image.c
r1581r1582
806806
807807const char *image_error(mess_image *image)
808808{
809   static const char *messages[] =
809   static const char *const messages[] =
810810   {
811811      NULL,
812812      "Internal error",
src/mess/video/vic6560.c
r1581r1582
352352{
353353   /* this is a a static graphical object */
354354   /* should be easy to convert to gfx_element!? */
355   static UINT8 blackmask[] =
355   static const UINT8 blackmask[] =
356356   {0x00, 0x70, 0x60, 0x50, 0x08, 0x04, 0x00, 0x00};
357   static UINT8 whitemask[] =
357   static const UINT8 whitemask[] =
358358   {0xf0, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00};
359359   int i, j, y, x;
360360
src/mess/video/dgn_beta.c
r1581r1582
160160static void beta_Set_VSync(int offset, int data);
161161static void beta_Set_DE(int offset, int data);
162162
163static const struct m6845_interface
164beta_m6845_interface= {
163static const struct m6845_interface beta_m6845_interface = {
165164   0,      // Memory Address register
166165   beta_Set_RA,   // Row Address register
167166   beta_Set_HSync,   // Horizontal status
src/mess/video/hp48.c
r1581r1582
7373   video_start_generic(machine);
7474}
7575
76static void hp48_draw_special(mame_bitmap *bitmap,int x, int y, const char *figure, int color)
76typedef const char *HP48_FIGURE;
77
78static void hp48_draw_special(mame_bitmap *bitmap,int x, int y, const HP48_FIGURE figure, int color)
7779{
7880   int j, xi=0;
7981   for (j=0; figure[j]; j++) {
r1581r1582
9698
9799#define LCD_LINES (hp48_hardware.data[0x28]|((hp48_hardware.data[0x29]&3)<<4)
98100
99static const char *hp48_orange={
101
102static const HP48_FIGURE hp48_orange={
100103   "11111111111\r"
101104   "111 1111111\r"
102105   "11  1111111\r"
r1581r1582
104107   "11  11111 1\r"
105108   "111 11111 1\r"
106109   "111111111 1"
107}, *hp48_blue= {
110}, hp48_blue= {
108111   "11111111111\r"
109112   "1111111 111\r"
110113   "1111111  11\r"
r1581r1582
112115   "1 11111  11\r"
113116   "1 11111 111\r"
114117   "1 111111111"
115}, *hp48_alpha= {
118}, hp48_alpha= {
116119   "          1\r"
117120   "   11111 1\r"
118121   "  1     1\r"
r1581r1582
120123   " 1      1\r"
121124   " 1     11\r"
122125   "  11111  1"
123}, *hp48_alarm= {
126}, hp48_alarm= {
124127   "  1       1\r"
125128   " 1  1   1  1\r"
126129   "1  1  1  1  1\r"
r1581r1582
128131   "1  1  1  1  1\r"
129132   " 1  1   1  1\r"
130133   "  1       1"
131}, *hp48_busy= {
134}, hp48_busy= {
132135   "11111111\r"
133136   " 1    1\r"
134137   "  1  1\r"
r1581r1582
136139   "  1  1\r"
137140   " 1    1\r"
138141   "11111111"
139}, *hp48_transmit={
142}, hp48_transmit={
140143   " 11\r"
141144   "1  1   1\r"
142145   "    1   1\r"
src/mess/video/911_vdt.c
r1581r1582
516516      }
517517}
518518
519static const unsigned char (*key_translate[])[91] =
519static const unsigned char (*const key_translate[])[91] =
520520{   /* array must use same order as vdt911_model_t!!! */
521521   /* US */
522522   US_key_translate,
src/mess/video/pc1350.c
r1581r1582
125125   701e .. 703b, 721e..723b, 741e ..743b, 761e ..763b, 781e .. 783b
126126   705e .. 707b, 725e..727b, 745e ..747b, 765e ..767b, 785e .. 787b
127127   783c: 0 SHIFT 1 DEF 4 RUN 5 PRO 6 JAPAN 7 SML */
128static int pc1350_addr[4]={ 0, 0x40, 0x1e, 0x5e };
128static const int pc1350_addr[4]={ 0, 0x40, 0x1e, 0x5e };
129129
130130#define DOWN 45
131131#define RIGHT 76
src/mess/video/kim1.c
r1581r1582
7171
7272        for (x = 0; x < 4; x++)
7373        {
74            static int layout[6][4] =
74            static const int layout[6][4] =
7575            {
7676                {22, 19, 21, 23},
7777                {16, 17, 20, 18},
src/mess/video/m6847.c
r1581r1582
11721172
11731173
11741174
1175static void (*graphics_modes[8])(UINT32 *line, const m6847_pixel *video_data) =
1175static void (*const graphics_modes[8])(UINT32 *line, const m6847_pixel *video_data) =
11761176{
11771177   graphics_color_64,   graphics_bw_128,
11781178   graphics_color_128,   graphics_bw_128,
src/mess/video/kaypro.c
r1581r1582
455455
456456static void kaypro_pixel(int x, int y, int set)
457457{
458   static int attr_bits[4][2] = {
458   static const int attr_bits[4][2] = {
459459      {     0x002, 0x001},
460460      {     0x008, 0x004},
461461      {     0x020, 0x010},
src/mess/video/crtc6845.c
r1581r1582
103103
104104/* The PC1512 has not got a full MC6845; the first 9 registers act as if they
105105 * had these hardwired values: */
106static UINT8 pc1512_defaults[] =
106static const UINT8 pc1512_defaults[] =
107107{
108108   113, 80, 90, 10, 127, 6, 100, 112, 2
109109};
src/mess/video/mekd2.c
r1581r1582
8282
8383        for (x = 0; x < 4; x++)
8484        {
85            static int layout[6][4] =
85            static const int layout[6][4] =
8686            {
8787                {22, 19, 21, 23},
8888                {16, 17, 20, 18},
src/mess/video/channelf.c
r1581r1582
2626#define LTGREEN 6
2727#define LTBLUE   7
2828
29static UINT16 colormap[] = {
29static const UINT16 colormap[] = {
3030   BLACK,   WHITE, WHITE, WHITE,
3131   LTBLUE,  BLUE,  RED,   GREEN,
3232   LTGRAY,  BLUE,  RED,   GREEN,
src/mess/video/pc_cga.c
r1581r1582
252252
253253
254254
255static struct mscrtc6845_config config= { 14318180 /*?*/, pc_cga_cursor };
255static struct mscrtc6845_config config = { 14318180 /*?*/, pc_cga_cursor };
256256
257257static int internal_pc_cga_video_start(int personality)
258258{
src/mess/video/ssystem3.c
r1581r1582
112112   {125,123},
113113};
114114
115static const char* single_led=
115static const char single_led[]=
116116"          c                                                                                                           1 1\r"
117117"   bb   ccccc   bb                                                                                                    1 1\r"
118118"   bb     c     bb                                                                                                    1 1\r"
src/mess/video/m6845.c
r1581r1582
104104#endif
105105
106106// local copy of the 6845 external procedure calls
107static struct m6845_interface
108crct6845_calls= {
107static struct m6845_interface crct6845_calls =
108{
109109   0,// Memory Address register
110110   0,// Row Address register
111111   0,// Horizontal status
src/mess/video/vtech2.c
r1581r1582
107107   0x2750,0x27d0,0x2f50,0x2fd0,0x3750,0x37d0,0x3f50,0x3fd0
108108};
109109
110static int offs_0[96] = {
110static const int offs_0[96] = {
111111   0x2000,0x2800,0x3000,0x3800,0x2100,0x2900,0x3100,0x3900,
112112   0x2200,0x2a00,0x3200,0x3a00,0x2300,0x2b00,0x3300,0x3b00,
113113   0x2400,0x2c00,0x3400,0x3c00,0x2500,0x2d00,0x3500,0x3d00,
src/mess/video/kc.c
r1581r1582
213213
214214*/
215215
216static int horizontal_next_state_table[]=
216static const int horizontal_next_state_table[]=
217217{
218218   1,2,3,0
219219};
220220
221221/* number of cycles for each state */
222static int horizontal_graphics_state_cycles[]=
222static const int horizontal_graphics_state_cycles[]=
223223{
224224   /* left border */
225225   (KC85_LEFT_BORDER_SIZE*KC85_CYCLES_PER_PIXEL),
r1581r1582
231231   (KC85_RETRACE_SIZE*KC85_CYCLES_PER_PIXEL)
232232};
233233
234static int vertical_next_state_table[]=
234static const int vertical_next_state_table[]=
235235{
236236   1,2,3,0
237237};
238238
239239/* number of lines for each state */
240static int vertical_graphics_state_lines[]=
240static const int vertical_graphics_state_lines[]=
241241{
242242   /* top border */
243243   KC85_TOP_BORDER_SIZE*KC85_CYCLES_PER_LINE,
src/mess/osd/windows/menu.c
r1581r1582
644644   char buf[256];
645645   struct file_dialog_params *params;
646646   struct storeval_optres_params *storeval_params;
647   const struct dialog_layout filedialog_layout = { 44, 220 };
647   static const struct dialog_layout filedialog_layout = { 44, 220 };
648648
649649   // make the filter
650650   pos = 0;
src/mess/machine/wswan.c
r1581r1582
2323
2424enum enum_system { WSWAN=0, WSC };
2525enum enum_sram { SRAM_NONE=0, SRAM_64K, SRAM_256K, SRAM_512K, SRAM_1M, SRAM_2M, EEPROM_1K, EEPROM_16K, EEPROM_8K, SRAM_UNKNOWN };
26static const char* wswan_sram_str[] = { "none", "64Kbit SRAM", "256Kbit SRAM", "512Kbit SRAM", "1Mbit SRAM", "2Mbit SRAM", "1Kbit EEPROM", "16Kbit EEPROM", "8Kbit EEPROM", "Unknown" };
26static const char *const wswan_sram_str[] = { "none", "64Kbit SRAM", "256Kbit SRAM", "512Kbit SRAM", "1Mbit SRAM", "2Mbit SRAM", "1Kbit EEPROM", "16Kbit EEPROM", "8Kbit EEPROM", "Unknown" };
2727static const int wswan_sram_size[] = { 0, 64*1024/8, 256*1024/8, 512*1024/8, 1024*1024/8, 2*1024*1024/8,  1024/8, 16*1024/8, 8*1024/8, 0 };
2828
2929struct EEPROM {
r1581r1582
12451245
12461246#ifdef MAME_DEBUG
12471247enum enum_romsize { ROM_4M=0, ROM_8M, ROM_16M, ROM_32M, ROM_64M, ROM_128M, ROM_UNKNOWN };
1248static const char* wswan_romsize_str[] = {
1248static const char *const wswan_romsize_str[] = {
12491249   "4Mbit", "8Mbit", "16Mbit", "32Mbit", "64Mbit", "128Mbit", "Unknown"
12501250};
12511251
src/mess/machine/apple2gs.c
r1581r1582
931931static int apple2gs_get_vpos(void)
932932{
933933   int result, scan;
934   static UINT8 top_border_vert[BORDER_TOP] =
934   static const UINT8 top_border_vert[BORDER_TOP] =
935935   {
936936      0xfa, 0xfa, 0xfa, 0xfa, 0xfb, 0xfb, 0xfb, 0xfb,
937937      0xfc, 0xfc, 0xfc, 0xfd, 0xfd, 0xfe, 0xfe, 0xff,
src/mess/machine/applefdc.c
r1581r1582
278278
279279static void iwm_access(int offset)
280280{
281   static const char *lines[] =
281   static const char *const lines[] =
282282   {
283283      "PH0",
284284      "PH1",
src/mess/machine/3do.c
r1581r1582
160160      case 0x0a: return 0x40; break;
161161      case 0x0d:
162162      {
163         static UINT32 irq_sequence[3] = { 0, 4, 12 };
163         static const UINT32 irq_sequence[3] = { 0, 4, 12 };
164164         static int counter = 0;
165165
166166         return irq_sequence[(counter++)%3];
src/mess/machine/mac.c
r1581r1582
12981298
12991299   /* initialize floppy */
13001300   {
1301      struct applefdc_interface intf =
1301      static const struct applefdc_interface intf =
13021302      {
13031303         APPLEFDC_IWM,
13041304         sony_set_lines,
r1581r1582
23462346      { 23, "ReturnDriveInfo" }
23472347   };
23482348
2349   static const char *scsisels[] =
2349   static const char *const scsisels[] =
23502350   {
23512351      "SCSIReset",   /* $00 */
23522352      "SCSIGet",      /* $01 */
src/mess/machine/adam.c
r1581r1582
523523   int DCB_Num, deviceNum, statusDCB;
524524   int i, buffer, byteCount, sectorNmbr, sectorCount, currentSector;
525525   UINT8 kbcode;
526   static UINT8 interleave[8] = {0,5,2,7,4,1,6,3};
526   static const UINT8 interleave[8] = {0,5,2,7,4,1,6,3};
527527   mess_image *image;
528528
529529   if (offset == adam_pcb)
src/mess/machine/cbmb.c
r1581r1582
251251}
252252
253253//static const struct mscrtc6845_config cbm600_crtc= { 1600000 /*?*/, cbmb_vh_cursor };
254const static crtc6845_interface cbm600_crtc = {
254static const crtc6845_interface cbm600_crtc = {
255255   0,
256256   1600000 /*?*/,
257257   8 /*?*/,
r1581r1582
285285}
286286
287287//static const struct mscrtc6845_config cbm700_crtc= { 2000000 /*?*/, cbmb_vh_cursor };
288const static crtc6845_interface cbm700_crtc = {
288static const crtc6845_interface cbm700_crtc = {
289289   0,
290290   2000000 /*?*/,
291291   9 /*?*/,
src/mess/machine/pokemini.c
r1581r1582
103103}
104104
105105WRITE8_HANDLER( pokemini_hwreg_w ) {
106   const int timer_to_cycles[8] = { 2, 8, 32, 64, 128, 256, 1024, 4096 };
106   static const int timer_to_cycles[8] = { 2, 8, 32, 64, 128, 256, 1024, 4096 };
107107   logerror( "%0X: Write to hardware address: %02X, %02X\n", activecpu_get_pc(), offset, data );
108108   switch( offset ) {
109109   case 0x00:   /* start-up contrast
src/mess/machine/mc6850.c
r1581r1582
112112
113113// Bits 0,1 of control Register
114114
115static int divide_by_lookup[4]={1,16,64,0};
115static const int divide_by_lookup[4]={1,16,64,0};
116116static int divide_by;
117117
118118
119119// Bits 2,3,4 of control Register
120120
121static int word_length_lookup[8]={7,7,7,7,8,8,8,8};
121static const int word_length_lookup[8]={7,7,7,7,8,8,8,8};
122122static int word_length;
123123
124124// Parity Settings
125125// 2 = even
126126// 1 = odd
127127// 0 = no parity bit
128static int parity_lookup[8]={2,1,2,1,0,0,2,1};
128static const int parity_lookup[8]={2,1,2,1,0,0,2,1};
129129static int parity;
130130
131static int stop_bits_lookup[8]={2,2,1,1,2,1,1,1};
131static const int stop_bits_lookup[8]={2,2,1,1,2,1,1,1};
132132static int stop_bits;
133133
134134// Bits 5,6 of control Register
135135
136static int RTS_lookup[4]={0,0,1,0};
136static const int RTS_lookup[4]={0,0,1,0};
137137static int RTS;
138138
139static int break_level_lookup[4]={0,0,0,1};
139static const int break_level_lookup[4]={0,0,0,1};
140140static int break_level;
141141
142142// transmitting Interrupt 0 = Disabled  1 = Enabled
143static int transmit_interrupt_enabled_lookup[4]={0,1,0,0};
143static const int transmit_interrupt_enabled_lookup[4]={0,1,0,0};
144144static int transmit_interrupt_enabled;
145145
146146// Bit 7 of control Register
r1581r1582
153153
154154
155155//Local copy of the MC6850 external procedure calls
156static struct MC6850_interface
157MC6850_calls= {
156static struct MC6850_interface MC6850_calls =
157{
158158   0,// Transmit data ouput
159159   0,// Request to Send output
160160   0,// Interupt Request output
src/mess/machine/amigacd.c
r1581r1582
395395   memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, base, base + 0xFFFF, 0, 0, MWA16_UNMAP);
396396}
397397
398static amiga_autoconfig_device dmac_device =
398static const amiga_autoconfig_device dmac_device =
399399{
400400   0,            /* link into free memory list */
401401   0,            /* ROM vector offset valid */
src/mess/machine/gb.c
r1581r1582
14471447   int Checksum, I, J, filesize;
14481448   UINT16 reported_rom_banks;
14491449   UINT8   *gb_header;
1450   int rambanks[8] = {0, 1, 1, 4, 16, 8, 0, 0};
1450   static const int rambanks[8] = {0, 1, 1, 4, 16, 8, 0, 0};
14511451
14521452   filesize = image_length(image);
14531453
r1581r1582
16331633   {
16341634      const char *P;
16351635      char S[50];
1636      int ramsize[8] = { 0, 2, 8, 32, 128, 64, 0, 0 };
1636      static const int ramsize[8] = { 0, 2, 8, 32, 128, 64, 0, 0 };
16371637
16381638
16391639      strncpy (S, (char *)&gb_header[0x0134], 16);
r1581r1582
18781878
18791879/* Map megaduck audio offset to gameboy audio offsets */
18801880
1881static UINT8 megaduck_sound_offsets[16] = { 0, 2, 1, 3, 4, 6, 5, 7, 8, 9, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F };
1881static const UINT8 megaduck_sound_offsets[16] = { 0, 2, 1, 3, 4, 6, 5, 7, 8, 9, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F };
18821882
18831883WRITE8_HANDLER( megaduck_sound_w1 )
18841884{
src/mess/machine/concept.c
r1581r1582
679679
680680static  READ8_HANDLER(concept_fdc_rom_r)
681681{
682   UINT8 data[8] = "CORVUS01";
682   static const UINT8 data[8] = "CORVUS01";
683683   return (offset < 8) ? data[offset] : 0;
684684}
685685
r1581r1582
743743 */
744744static  READ8_HANDLER(concept_hdc_rom_r)
745745{
746   UINT8 data[8] = { 0xa9, 0x20, 0xa9, 0x00, 0xa9, 0x03, 0xa9, 0x3c };         /* Same as Apple II */
746   static const UINT8 data[8] = { 0xa9, 0x20, 0xa9, 0x00, 0xa9, 0x03, 0xa9, 0x3c };         /* Same as Apple II */
747747   return (offset < 8) ? data[offset] : 0;
748748}
src/mess/machine/kim1.c
r1581r1582
3636   UINT8 *dst;
3737   int x, y, i;
3838
39   static const char *seg7 =
39   static const char seg7[] =
4040   "....aaaaaaaaaaaaa." \
4141   "...f.aaaaaaaaaaa.b" \
4242   "...ff.aaaaaaaaa.bb" \
src/mess/machine/99_dsk.c
r1581r1582
6161/* on rising edge, sets DVENA for 4.23 seconds on rising edge */
6262static int motor_on;
6363/* count 4.23s from rising edge of motor_on */
64void *motor_on_timer;
64static void *motor_on_timer;
6565
6666/*
6767   call this when the state of DSKhold or DRQ/IRQ or DVENA change
src/mess/machine/msx.c
r1581r1582
336336   int i, n;
337337
338338   /* z80 stuff */
339   static int z80_cycle_table[] =
339   static const int z80_cycle_table[] =
340340   {
341341      Z80_TABLE_op, Z80_TABLE_cb, Z80_TABLE_xy,
342342        Z80_TABLE_ed, Z80_TABLE_xycb, Z80_TABLE_ex
src/mess/machine/gamecom.c
r1581r1582
5656static GAMECOM_DMA gamecom_dma;
5757static GAMECOM_TIMER gamecom_timer[2];
5858
59//int gamecom_timer_limit[8] = { 2/2, 1024/2, 2048/2, 4096/2, 8192/2, 16384/2, 32768/2, 65536/2 };
60static int gamecom_timer_limit[8] = { 2, 1024, 2048, 4096, 8192, 16384, 32768, 65536 };
59//static const int gamecom_timer_limit[8] = { 2/2, 1024/2, 2048/2, 4096/2, 8192/2, 16384/2, 32768/2, 65536/2 };
60static const int gamecom_timer_limit[8] = { 2, 1024, 2048, 4096, 8192, 16384, 32768, 65536 };
6161
6262static void gamecom_dma_init(void);
6363
src/mess/machine/vc1541.c
r1581r1582
175175static CBM_Drive_Emu vc1541_static= { 0 }, *vc1541 = &vc1541_static;
176176
177177/* four different frequencies for the 4 different zones on the disk */
178static double vc1541_times[4]= {
178static const double vc1541_times[4]= {
179179   13/16e6, 14/16e6, 15/16e6, 16/16e6
180180};
181181
r1581r1582
204204 *
205205 * max 42 tracks, stepper resolution 84 tracks
206206 */
207static int bin_2_gcr[] =
207static const int bin_2_gcr[] =
208208{
209209   0xa, 0xb, 0x12, 0x13, 0xe, 0xf, 0x16, 0x17,
210210   9, 0x19, 0x1a, 0x1b, 0xd, 0x1d, 0x1e, 0x15
211211};
212212
213213#if 0
214static int gcr_2_bin[] = {
214static const int gcr_2_bin[] = {
215215   -1, -1, -1, -1,
216216   -1, -1, -1, -1,
217217   -1, 8, 0, 1,
src/mess/machine/thomson.c
r1581r1582
11761176
11771177
11781178
1179static chardev_interface to7_midi_interface =
1179static const chardev_interface to7_midi_interface =
11801180{
11811181   to7_midi_byte_received_cb,
11821182   to7_midi_ready_to_send_cb,
src/mess/machine/lisa.c
r1581r1582
349349}
350350
351351/* send data (queue it into the FIFO if needed) */
352static void COPS_queue_data(UINT8 *data, int len)
352static void COPS_queue_data(const UINT8 *data, int len)
353353{
354354#if 0
355355   if (fifo_size + len <= 8)
r1581r1582
709709
710710static void unplug_keyboard(void)
711711{
712   UINT8 cmd[2] =
712   static const UINT8 cmd[2] =
713713   {
714714      0x80,   /* RESET code */
715715      0xFD   /* keyboard unplugged */
r1581r1582
737737         unknown : spanish, US dvorak, italian & swedish
738738   */
739739
740   UINT8 cmd[2] =
740   static const UINT8 cmd[2] =
741741   {
742742      0x80,   /* RESET code */
743743      0x3f   /* keyboard ID - US for now */
r1581r1582
11771177
11781178   /* initialize floppy */
11791179   {
1180      struct applefdc_interface intf =
1180      static struct applefdc_interface intf =
11811181      {
11821182         APPLEFDC_IWM,
11831183         sony_set_lines,
r1581r1582
12231223               if (clock_regs.alarm == 0)
12241224               {
12251225                  /* generate reset (should cause a VIA interrupt...) */
1226                  UINT8 cmd[2] =
1226                  static const UINT8 cmd[2] =
12271227                  {
12281228                     0x80,   /* RESET code */
12291229                     0xFC   /* timer time-out */
src/mess/machine/geneve.c
r1581r1582
264264
265265   if (has_speech)
266266   {
267      spchroms_interface speech_intf = { region_speech_rom };
267      static const spchroms_interface speech_intf = { region_speech_rom };
268268
269269      spchroms_config(& speech_intf);
270270   }
src/mess/machine/c128.c
r1581r1582
247247}
248248
249249static UINT8 c128_mmu[0x0b];
250static int c128_mmu_helper[4] =
250static const int c128_mmu_helper[4] =
251251{0x400, 0x1000, 0x2000, 0x4000};
252252static int mmu_cpu=0;
253253static int mmu_page0, mmu_page1;
src/mess/machine/ds1315.c
r1581r1582
2020static int ds1315_count;
2121static int ds1315_mode;
2222static int ds1315_raw_data[8*8];
23static int ds1315_pattern[] = {  1, 0, 1, 0, 0, 0, 1, 1,
23static const int ds1315_pattern[] = {  1, 0, 1, 0, 0, 0, 1, 1,
2424                          0, 1, 0, 1, 1, 1, 0, 0,
2525                          1, 1, 0, 0, 0, 1, 0, 1,
2626                          0, 0, 1, 1, 1, 0, 1, 0,
src/mess/machine/pet.c
r1581r1582
487487static void pet_display_enable_changed(int display_enabled) {
488488}
489489
490const static crtc6845_interface crtc_pet40 = {
490static const crtc6845_interface crtc_pet40 = {
491491   0,
492492   800000 /*?*/,
493493   8 /*?*/,
r1581r1582
497497   pet_display_enable_changed
498498};
499499
500const static crtc6845_interface crtc_pet80 = {
500static const crtc6845_interface crtc_pet80 = {
501501   0,
502502   800000 /*?*/,
503503   16 /*?*/,
src/mess/machine/mekd2.c
r1581r1582
2020   UINT8 *dst;
2121   int x, y, i;
2222
23   static const char *seg7 =
23   static const char seg7[] =
2424      "....aaaaaaaaaaaaa." \
2525      "...f.aaaaaaaaaaa.b" \
2626      "...ff.aaaaaaaaa.bb" \
r1581r1582
4747      "..................";
4848
4949
50   static const char *keys[24] =
50   static const char *const keys[24] =
5151   {
5252      "........................" \
5353      "........................" \
src/mess/machine/at.c
r1581r1582
6363
6464DRIVER_INIT( atcga )
6565{
66   struct kbdc8042_interface at8042 =
66   static const struct kbdc8042_interface at8042 =
6767   {
6868      KBDC8042_STANDARD, at_set_gate_a20, at_keyboard_interrupt
6969   };
r1581r1582
7474
7575DRIVER_INIT( at386 )
7676{
77   struct kbdc8042_interface at8042 =
77   static const struct kbdc8042_interface at8042 =
7878   {
7979      KBDC8042_AT386, at_set_gate_a20, at_keyboard_interrupt
8080   };
r1581r1582
124124
125125DRIVER_INIT( at_vga )
126126{
127   struct kbdc8042_interface at8042 =
127   static const struct kbdc8042_interface at8042 =
128128   {
129129      KBDC8042_STANDARD, at_set_gate_a20, at_keyboard_interrupt
130130   };
r1581r1582
138138
139139DRIVER_INIT( ps2m30286 )
140140{
141   struct kbdc8042_interface at8042 =
141   static const struct kbdc8042_interface at8042 =
142142   {
143143      KBDC8042_PS2, at_set_gate_a20, at_keyboard_interrupt
144144   };
src/mess/machine/vc20.c
r1581r1582
608608
609609static int vc20_rom_id(mess_image *image)
610610{
611   unsigned char magic[] =
611   static const unsigned char magic[] =
612612   {0x41, 0x30, 0x20, 0xc3, 0xc2, 0xcd};   /* A0 CBM at 0xa004 (module offset 4) */
613613   unsigned char buffer[sizeof (magic)];
614614   const char *cp;
src/mess/machine/bebox.c
r1581r1582
267267
268268static void bebox_set_irq_bit(unsigned int interrupt_bit, int val)
269269{
270   static const char *interrupt_names[32] =
270   static const char *const interrupt_names[32] =
271271   {
272272      NULL,
273273      NULL,
src/mess/machine/intv.c
r1581r1582
156156static int tape_interrupts_enabled;
157157static int tape_unknown_write[6];
158158static int tape_motor_mode;
159static const char *tape_motor_mode_desc[8] =
159static const char *const tape_motor_mode_desc[8] =
160160{
161161   "IDLE", "IDLE", "IDLE", "IDLE",
162162   "EJECT", "PLAY/RECORD", "REWIND", "FF"
r1581r1582
440440   stic_screenrefresh();
441441}
442442
443static UINT8 controller_table[] =
443static const UINT8 controller_table[] =
444444{
445445   0x81, 0x41, 0x21, 0x82, 0x42, 0x22, 0x84, 0x44,
446446   0x24, 0x88, 0x48, 0x28, 0xa0, 0x60, 0xc0, 0x00,
src/mess/machine/sms.c
r1581r1582
706706The Korean game Jang Pung II also seems to use a codemasters style mapper.
707707 */
708708static int detect_codemasters_mapper( UINT8 *rom ) {
709   UINT8   jang_pung2[16] = { 0x00, 0xBA, 0x38, 0x0D, 0x00, 0xB8, 0x38, 0x0C, 0x00, 0xB6, 0x38, 0x0B, 0x00, 0xB4, 0x38, 0x0A };
709   static const UINT8 jang_pung2[16] = { 0x00, 0xBA, 0x38, 0x0D, 0x00, 0xB8, 0x38, 0x0C, 0x00, 0xB6, 0x38, 0x0B, 0x00, 0xB4, 0x38, 0x0A };
710710
711711   if ( ( ( rom[0x7fe0] & 0x0F ) <= 9 ) &&
712712        ( rom[0x7fe3] == 0x93 || rom[0x7fe3] == 0x94 || rom[0x7fe3] == 0x95 ) &&
r1581r1582
722722}
723723
724724static int detect_korean_mapper( UINT8 *rom ) {
725   UINT8   signatures[2][16] = {
725   static const UINT8 signatures[2][16] = {
726726      { 0x3E, 0x11, 0x32, 0x00, 0xA0, 0x78, 0xCD, 0x84, 0x85, 0x3E, 0x02, 0x32, 0x00, 0xA0, 0xC9, 0xFF }, /* Dodgeball King */
727727      { 0x41, 0x48, 0x37, 0x37, 0x44, 0x37, 0x4E, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20 },   /* Sangokushi 3 */
728728   };
src/mess/machine/wd17xx.c
r1581r1582
191191/* structure describing a double density track */
192192#define TRKSIZE_DD      6144
193193#if 0
194static UINT8 track_DD[][2] = {
194static const UINT8 track_DD[][2] = {
195195   {16, 0x4e},    /* 16 * 4E (track lead in)             */
196196   { 8, 0x00},    /*   8 * 00 (pre DAM)                */
197197   { 3, 0xf5},    /*   3 * F5 (clear CRC)                */
r1581r1582
213213/* structure describing a single density track */
214214#define TRKSIZE_SD      3172
215215#if 0
216static UINT8 track_SD[][2] = {
216static const UINT8 track_SD[][2] = {
217217   {16, 0xff},    /* 16 * FF (track lead in)             */
218218   { 8, 0x00},    /*   8 * 00 (pre DAM)                */
219219   { 1, 0xfc},    /*   1 * FC (clear CRC)                */
src/mess/machine/cybiko.c
r1581r1582
439439   return data;
440440}
441441
442READ8_HANDLER( cybiko_io_reg_r )
442static READ8_HANDLER( cybiko_io_reg_r )
443443{
444444   UINT8 data = 0;
445445   _logerror( 2, ("cybiko_io_reg_r (%08X)\n", offset));
r1581r1582
473473   return data;
474474}
475475
476WRITE8_HANDLER( cybiko_io_reg_w )
476static WRITE8_HANDLER( cybiko_io_reg_w )
477477{
478478   _logerror( 2, ("cybiko_io_reg_w (%08X/%02X)\n", offset, data));
479479   switch (offset)
src/mess/machine/c64.c
r1581r1582
374374
375375static void c64_cia1_port_a_w (UINT8 data)
376376{
377   static int helper[4] = {0xc000, 0x8000, 0x4000, 0x0000};
377   static const int helper[4] = {0xc000, 0x8000, 0x4000, 0x0000};
378378
379379   cbm_serial_clock_write (serial_clock = !(data & 0x10));
380380   cbm_serial_data_write (serial_data = !(data & 0x20));
src/mess/machine/svi318.c
r1581r1582
543543   int i, n;
544544
545545   /* z80 stuff */
546   static int z80_cycle_table[] =
546   static const int z80_cycle_table[] =
547547   {
548548      Z80_TABLE_op, Z80_TABLE_cb, Z80_TABLE_xy,
549549           Z80_TABLE_ed, Z80_TABLE_xycb, Z80_TABLE_ex
src/mess/machine/ti99_4x.c
r1581r1582
815815
816816        if (has_speech)
817817   {
818      spchroms_interface speech_intf = { region_speech_rom };
818      static const spchroms_interface speech_intf = { region_speech_rom };
819819
820820      spchroms_config(& speech_intf);
821821
src/mess/machine/tms5501.c
r1581r1582
108108
109109static void tms5501_field_interrupts(int which)
110110{
111   UINT8 int_vectors[] = { 0xc7, 0xcf, 0xd7, 0xdf, 0xe7, 0xef, 0xf7, 0xff };
111   static const UINT8 int_vectors[] = { 0xc7, 0xcf, 0xd7, 0xdf, 0xe7, 0xef, 0xf7, 0xff };
112112   UINT8 current_ints = tms5501[which].pending_interrupts;
113113
114114   /* disabling masked interrupts */
src/mess/machine/bbc.c
r1581r1582
11701170}
11711171
11721172
1173static const struct via6522_interface
1174bbcb_system_via= {
1173static const struct via6522_interface bbcb_system_via =
1174{
11751175  bbcb_via_system_read_porta,
11761176  bbcb_via_system_read_portb,
11771177  bbcb_via_system_read_ca1,
r1581r1582
13071307   via_0_cb1_w(0,data);
13081308}
13091309
1310static const struct uPD7002_interface
1311BBC_uPD7002= {
1310static const struct uPD7002_interface BBC_uPD7002 =
1311{
13121312   BBC_get_analogue_input,
13131313   BBC_uPD7002_EOC
13141314};
r1581r1582
13621362  //logerror("Set SIO irq  %01x\n",level);
13631363}
13641364
1365static const struct MC6850_interface
1366BBC_MC6850_calls= {
1365static const struct MC6850_interface BBC_MC6850_calls =
1366{
13671367   0,// Transmit data ouput
13681368   0,// Request to Send output
13691369   Serial_interrupt,// Interupt Request output
src/mess/machine/vtech2.c
r1581r1582
6262static  READ8_HANDLER ( mra_bank4) { return mra_bank(3,offset); }
6363
6464/* read banked memory (handle memory mapped i/o) */
65static read8_handler mra_bank_soft[4] =
65static const read8_handler mra_bank_soft[4] =
6666{
6767    mra_bank1,  /* mapped in 0000-3fff */
6868    mra_bank2,  /* mapped in 4000-7fff */
r1581r1582
7171};
7272
7373/* write banked memory (handle memory mapped i/o and videoram) */
74static write8_handler mwa_bank_soft[4] =
74static const write8_handler mwa_bank_soft[4] =
7575{
7676    mwa_bank1,  /* mapped in 0000-3fff */
7777    mwa_bank2,  /* mapped in 4000-7fff */
r1581r1582
8080};
8181
8282/* read banked memory (plain ROM/RAM) */
83static read8_handler mra_bank_hard[4] =
83static const read8_handler mra_bank_hard[4] =
8484{
8585    MRA8_BANK1,  /* mapped in 0000-3fff */
8686    MRA8_BANK2,  /* mapped in 4000-7fff */
r1581r1582
8989};
9090
9191/* write banked memory (plain ROM/RAM) */
92static write8_handler mwa_bank_hard[4] =
92static const write8_handler mwa_bank_hard[4] =
9393{
9494    MWA8_BANK1,  /* mapped in 0000-3fff */
9595    MWA8_BANK2,  /* mapped in 4000-7fff */
r1581r1582
148148
149149WRITE8_HANDLER( laser_bank_select_w )
150150{
151    static const char *bank_name[16] = {
151    static const char *const bank_name[16] = {
152152        "ROM lo","ROM hi","MM I/O","Video RAM lo",
153153        "RAM #0","RAM #1","RAM #2","RAM #3",
154154        "RAM #4","RAM #5","RAM #6","RAM #7/Video RAM hi",
src/mess/formats/vt_cas.c
r1581r1582
136136#define VT2_BITSAMPLES   18
137137#define VT2_BYTESAMPLES 8*VT2_BITSAMPLES
138138
139static INT16 vtech2_bit0[VT2_BITSAMPLES] =
139static const INT16 vtech2_bit0[VT2_BITSAMPLES] =
140140{
141141   /* short cycle, long cycles */
142142   VT2_HI,VT2_HI,VT2_HI,VT2_LO,VT2_LO,VT2_LO,
r1581r1582
144144   VT2_LO,VT2_LO,VT2_LO,VT2_LO,VT2_LO,VT2_LO
145145};
146146
147static INT16 vtech2_bit1[VT2_BITSAMPLES] =
147static const INT16 vtech2_bit1[VT2_BITSAMPLES] =
148148{
149149   /* three short cycle */
150150   VT2_HI,VT2_HI,VT2_HI,VT2_LO,VT2_LO,VT2_LO,
src/mess/formats/ap2_dsk.c
r1581r1582
150150
151151static int apple2_do_translate_sector(floppy_image *floppy, int sector)
152152{
153   static UINT8 skewing[] =
153   static const UINT8 skewing[] =
154154   {
155155      /* DOS order (*.do) */
156156      0x00, 0x07, 0x0E, 0x06, 0x0D, 0x05, 0x0C, 0x04,
r1581r1582
163163
164164static int apple2_po_translate_sector(floppy_image *floppy, int sector)
165165{
166   static UINT8 skewing[] =
166   static const UINT8 skewing[] =
167167   {
168168      /* ProDOS order (*.po) */
169169      0x00, 0x08, 0x01, 0x09, 0x02, 0x0A, 0x03, 0x0B,
src/mess/formats/zx81_p.c
r1581r1582
130130
131131/* ZX-81 functions */
132132
133static UINT8 zx81_chars[]={ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*00h-07h*/
133static const UINT8 zx81_chars[]={
134           0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*00h-07h*/
134135           0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*08h-0fh*/
135136           0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*10h-17h*/
136137           0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*18h-1fh*/
src/mess/formats/thom_cas.c
r1581r1582
616616
617617
618618/* overloaded wav: dump info */
619const static struct CassetteFormat to7_wav =
619static const struct CassetteFormat to7_wav =
620620{ "wav", to7_wav_identify, to7_wav_load, to7_wav_save };
621621
622622
r1581r1582
967967
968968
969969/* overloaded wav: dump info */
970const static struct CassetteFormat mo5_wav =
970static const struct CassetteFormat mo5_wav =
971971{ "wav", mo5_wav_identify, mo5_wav_load, mo5_wav_save };
972972
973973
src/mess/drivers/nc.c
r1581r1582
330330}
331331
332332
333static read8_handler nc_bankhandler_r[]={
333static const read8_handler nc_bankhandler_r[]={
334334MRA8_BANK1, MRA8_BANK2, MRA8_BANK3, MRA8_BANK4};
335335
336static write8_handler nc_bankhandler_w[]={
336static const write8_handler nc_bankhandler_w[]={
337337MWA8_BANK5, MWA8_BANK6, MWA8_BANK7, MWA8_BANK8};
338338
339339static void nc_refresh_memory_bank_config(int bank)
src/mess/drivers/pokemini.c
r1581r1582
3232INPUT_PORTS_END
3333
3434static PALETTE_INIT( pokemini ) {
35   const unsigned char pokemini_pal[4][3] = {
35   static const unsigned char pokemini_pal[4][3] = {
3636      { 0xFF, 0xFB, 0x87 },
3737      { 0xB1, 0xAE, 0x4E },
3838      { 0x84, 0x80, 0x4E },
src/mess/drivers/pcw16.c
r1581r1582
259259   return pcw16_flash1_bank_handler_r(3, offset);
260260}
261261
262static read8_handler pcw16_flash0_bank_handlers_r[4] =
262static const read8_handler pcw16_flash0_bank_handlers_r[4] =
263263{
264264   pcw16_flash0_bank_handler0_r,
265265   pcw16_flash0_bank_handler1_r,
r1581r1582
267267   pcw16_flash0_bank_handler3_r,
268268};
269269
270static read8_handler pcw16_flash1_bank_handlers_r[4] =
270static const read8_handler pcw16_flash1_bank_handlers_r[4] =
271271{
272272   pcw16_flash1_bank_handler0_r,
273273   pcw16_flash1_bank_handler1_r,
r1581r1582
336336   pcw16_flash1_bank_handler_w(3, offset, data);
337337}
338338
339static write8_handler pcw16_flash0_bank_handlers_w[4] =
339static const write8_handler pcw16_flash0_bank_handlers_w[4] =
340340{
341341   pcw16_flash0_bank_handler0_w,
342342   pcw16_flash0_bank_handler1_w,
r1581r1582
344344   pcw16_flash0_bank_handler3_w,
345345};
346346
347static write8_handler pcw16_flash1_bank_handlers_w[4] =
347static const write8_handler pcw16_flash1_bank_handlers_w[4] =
348348{
349349   pcw16_flash1_bank_handler0_w,
350350   pcw16_flash1_bank_handler1_w,
r1581r1582
809809static unsigned char rtc_control;
810810static unsigned char rtc_256ths_seconds;
811811
812static int rtc_days_in_each_month[]=
812static const int rtc_days_in_each_month[]=
813813{
814814   31,/* jan */
815815   28, /* feb */
r1581r1582
825825   31   /* december */
826826};
827827
828static int rtc_days_in_february[] =
828static const int rtc_days_in_february[] =
829829{
830830   29, 28, 28, 28
831831};
src/mess/drivers/arcadia.c
r1581r1582
475475       UINT8 *rom=memory_region(REGION_CPU1);
476476       /* this is a simple routine to display all rom characters
477477           on the display for a snapshot */
478       UINT8 prog[]={ // address 0 of course
478       static const UINT8 prog[]={ // address 0 of course
479479      0x20, // eorz, 0
480480      0x1b, 0x01, // bctr,a $0004
481481      0x17, // retc a
src/mess/drivers/mpf1.c
r1581r1582
141141static VIDEO_UPDATE( mpf1 )
142142{
143143   int x;
144   static UINT8 xpositions[] = { 20, 59, 97, 135, 185, 223 };
144   static const UINT8 xpositions[] = { 20, 59, 97, 135, 185, 223 };
145145
146146   //fillbitmap(bitmap, get_black_pen(), NULL);
147147
src/mess/drivers/ip22.c
r1581r1582
14431443
14441444static DRIVER_INIT( ip225015 )
14451445{
1446   struct kbdc8042_interface at8042 =
1446   static const struct kbdc8042_interface at8042 =
14471447   {
14481448      KBDC8042_STANDARD, NULL, NULL
14491449   };
src/mess/drivers/a2600.c
r1581r1582
148148
149149   unsigned int left,right;
150150   int i,j,foundkeypad = 0;
151   unsigned char signatures[][5] =  {
151   static const unsigned char signatures[][5] =  {
152152                           { 0x55, 0xa5, 0x3c, 0x29, 0}, // star raiders
153153                           { 0xf9, 0xff, 0xa5, 0x80, 1}, // sentinel
154154                           { 0x81, 0x02, 0xe8, 0x86, 1}, // shooting arcade
r1581r1582
209209{
210210   int i,numfound = 0;
211211   // signature is also in 'video reflex'.. maybe figure out that controller port someday...
212   unsigned char signature[3] = { 0x8d, 0xf0, 0xff };
212   static const unsigned char signature[3] = { 0x8d, 0xf0, 0xff };
213213   if (cart_size == 0x10000)
214214   {
215215      for (i = 0; i < cart_size - sizeof signature; i++)
r1581r1582
227227static int detect_modef6(void)
228228{
229229   int i,numfound = 0;
230   unsigned char signature[3] = { 0x8d, 0xf6, 0xff };
230   static const unsigned char signature[3] = { 0x8d, 0xf6, 0xff };
231231   if (cart_size == 0x4000)
232232   {
233233      for (i = 0; i < cart_size - sizeof signature; i++)
r1581r1582
249249   // Would have used STA $3e, but 'Alien' and 'Star Raiders' do that for unknown reasons
250250
251251   int i,numfound = 0;
252   unsigned char signature[3] = { 0x84, 0x3e, 0x9d };
252   static const unsigned char signature[3] = { 0x84, 0x3e, 0x9d };
253253   if (cart_size == 0x0800 || cart_size == 0x1000)
254254   {
255255      for (i = 0; i < cart_size - sizeof signature; i++)
r1581r1582
267267static int detect_modeSS(void)
268268{
269269   int i,numfound = 0;
270   unsigned char signature[5] = { 0xbd, 0xe5, 0xff, 0x95, 0x81 };
270   static const unsigned char signature[5] = { 0xbd, 0xe5, 0xff, 0x95, 0x81 };
271271   if (cart_size == 0x0800 || cart_size == 0x1000)
272272   {
273273      for (i = 0; i < cart_size - sizeof signature; i++)
r1581r1582
285285static int detect_modeFE(void)
286286{
287287   int i,j,numfound = 0;
288   unsigned char signatures[][5] =  {
288   static const unsigned char signatures[][5] =  {
289289                           { 0x20, 0x00, 0xd0, 0xc6, 0xc5 },
290290                           { 0x20, 0xc3, 0xf8, 0xa5, 0x82 },
291291                           { 0xd0, 0xfb, 0x20, 0x73, 0xfe },
r1581r1582
310310static int detect_modeE0(void)
311311{
312312   int i,j,numfound = 0;
313   unsigned char signatures[][3] =  {
313   static const unsigned char signatures[][3] =  {
314314                           { 0x8d, 0xe0, 0x1f },
315315                           { 0x8d, 0xe0, 0x5f },
316316                           { 0x8d, 0xe9, 0xff },
r1581r1582
337337static int detect_modeCV(void)
338338{
339339   int i,j,numfound = 0;
340   unsigned char signatures[][3] = {
340   static const unsigned char signatures[][3] = {
341341                           { 0x9d, 0xff, 0xf3 },
342342                           { 0x99, 0x00, 0xf4 }};
343343   if (cart_size == 0x0800 || cart_size == 0x1000)
r1581r1582
360360static int detect_modeFV(void)
361361{
362362   int i,j,numfound = 0;
363   unsigned char signatures[][3] = {
363   static const unsigned char signatures[][3] = {
364364                           { 0x2c, 0xd0, 0xff }};
365365   if (cart_size == 0x2000)
366366   {
r1581r1582
383383static int detect_modeJVP(void)
384384{
385385   int i,j,numfound = 0;
386   unsigned char signatures[][4] = {
386   static const unsigned char signatures[][4] = {
387387                           { 0x2c, 0xc0, 0xef, 0x60 },
388388                           { 0x8d, 0xa0, 0x0f, 0xf0 }};
389389   if (cart_size == 0x4000 || cart_size == 0x2000)
r1581r1582
406406static int detect_modeE7(void)
407407{
408408   int i,j,numfound = 0;
409   unsigned char signatures[][3] = {
409   static const unsigned char signatures[][3] = {
410410                           { 0xad, 0xe5, 0xff },
411411                           { 0x8d, 0xe7, 0xff }};
412412   if (cart_size == 0x2000 || cart_size == 0x4000)
r1581r1582
429429static int detect_modeUA(void)
430430{
431431   int i,numfound = 0;
432   unsigned char signature[3] = { 0x8d, 0x40, 0x02 };
432   static const unsigned char signature[3] = { 0x8d, 0x40, 0x02 };
433433   if (cart_size == 0x2000)
434434   {
435435      for (i = 0; i < cart_size - sizeof signature; i++)
r1581r1582
447447static int detect_8K_mode3F(void)
448448{
449449   int i,numfound = 0;
450   unsigned char signature1[4] = { 0xa9, 0x01, 0x85, 0x3f };
451   unsigned char signature2[4] = { 0xa9, 0x02, 0x85, 0x3f };
450   static const unsigned char signature1[4] = { 0xa9, 0x01, 0x85, 0x3f };
451   static const unsigned char signature2[4] = { 0xa9, 0x02, 0x85, 0x3f };
452452   // have to look for two signatures because 'not boulderdash' gives false positive otherwise
453453   if (cart_size == 0x2000)
454454   {
r1581r1582
471471static int detect_32K_mode3F(void)
472472{
473473   int i,numfound = 0;
474   unsigned char signature[4] = { 0xa9, 0x0e, 0x85, 0x3f };
474   static const unsigned char signature[4] = { 0xa9, 0x0e, 0x85, 0x3f };
475475   if (cart_size >= 0x8000)
476476   {
477477      for (i = 0; i < cart_size - sizeof signature; i++)
r1581r1582
489489static int detect_super_chip(void)
490490{
491491   int i,j;
492   unsigned char signatures[][5] = {
492   static const unsigned char signatures[][5] = {
493493                           { 0xa2, 0x7f, 0x9d, 0x00, 0xf0 }, // dig dug
494494                           { 0xae, 0xf6, 0xff, 0x4c, 0x00 }}; // off the wall
495495
r1581r1582
14691469
14701470   int chip = 0xFF;
14711471   unsigned long controltemp;
1472   unsigned char snowwhite[] = { 0x10, 0xd0, 0xff, 0xff }; // Snow White Proto
1472   static const unsigned char snowwhite[] = { 0x10, 0xd0, 0xff, 0xff }; // Snow White Proto
14731473
14741474   current_reset_bank_counter++;
14751475
src/mess/drivers/ex800.c
r1581r1582
435435******************************************************************************/
436436
437437
438static UPD7810_CONFIG ex800_cpu_config =
438static const UPD7810_CONFIG ex800_cpu_config =
439439{
440440    TYPE_7810,
441441    0
src/mess/drivers/snes.c
r1581r1582
264264   UINT8 valid_mode20, valid_mode21;
265265
266266   /* Cart types */
267   static struct
267   static const struct
268268   {
269269      INT16 Code;
270270      const char *Name;
src/mess/drivers/saturn.c
r1581r1582
19111911
19121912static NVRAM_HANDLER(saturn)
19131913{
1914   static UINT32 init[8] =
1914   static const UINT32 init[8] =
19151915   {
19161916      0x420061, 0x63006b, 0x550070, 0x520061, 0x6d0020, 0x46006f, 0x72006d, 0x610074,
19171917   };
src/mess/drivers/acrnsys1.c
r1581r1582
2222static UINT8 key_digit;
2323
2424
25READ8_HANDLER( ins8154_b1_port_a_r )
25static READ8_HANDLER( ins8154_b1_port_a_r )
2626{
2727   char port[11];
2828   UINT8 data;
r1581r1582
3232   return data;
3333}
3434
35WRITE8_HANDLER( ins8154_b1_port_a_w )
35static WRITE8_HANDLER( ins8154_b1_port_a_w )
3636{
3737   ttl74145_0_w(0, data & 0x07);
3838}
3939
40WRITE8_HANDLER( acrnsys1_led_segment_w )
40static WRITE8_HANDLER( acrnsys1_led_segment_w )
4141{
4242   logerror("led %d segment data: %02x\n", key_digit, data);
4343   
r1581r1582
7676   NULL,  /* not connected */
7777};
7878
79DRIVER_INIT( acrnsys1 )
79static DRIVER_INIT( acrnsys1 )
8080{
8181   ins8154_config(0, &ins8154_b1);
8282   ttl74145_config(0, &ic8_7445);
8383}
8484
85MACHINE_RESET( acrnsys1 )
85static MACHINE_RESET( acrnsys1 )
8686{
8787   ins8154_reset(0);
8888   ttl74145_reset(0);
src/mess/drivers/einstein.c
r1581r1582
217217//}
218218
219219
220//static struct m6845_interface
221//einstein_m6845_interface= {
220//static const struct m6845_interface einstein_m6845_interface = {
222221//  0,// Memory Address register
223222//  Einstein_Set_RA,// Row Address register
224223//  Einstein_Set_HSync,// Horizontal status
src/mess/drivers/exelv.c
r1581r1582
236236         break;
237237      case IOS_CHARDEF4:
238238         {
239            static UINT8 fontdata[10*127] =
239            static const UINT8 fontdata[10*127] =
240240            {
241241               0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
242242               0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
src/mess/drivers/amstrad.c
r1581r1582
11011101  }
11021102}
11031103
1104void aleste_msx_mapper(int offset, int data)
1104static void aleste_msx_mapper(int offset, int data)
11051105{
11061106   int page = (offset & 0x0300) >> 8;
11071107   int ramptr = (data & 0x1f) * 0x4000;
src/mess/drivers/a310.c
r1581r1582
6161#define A310_FIQ_PODULE        (0x40)
6262#define A310_FIQ_FORCE         (0x80)
6363
64static int page_sizes[4] = { 4096, 8192, 16384, 32768 };
64static const int page_sizes[4] = { 4096, 8192, 16384, 32768 };
6565
6666static UINT32 *a310_physmem;
6767static UINT32 a310_pagesize;
r1581r1582
549549{
550550   UINT32 reg = data>>24;
551551   UINT32 val = data & 0xffffff;
552   static const char *vrnames[] =
552   static const char *const vrnames[] =
553553   {
554554      "horizontal total",
555555      "horizontal sync width",
src/mess/drivers/psx.c
r1581r1582
507507   /* NYI */
508508}
509509
510static void (*psx_cdcmds[])(void) =
510static void (*const psx_cdcmds[])(void) =
511511{
512512   psx_cdcmd_sync,
513513   psx_cdcmd_nop,
src/mess/drivers/genesis.c
r1581r1582
6262static int genesis_sram_active;
6363static int genesis_sram_readonly;
6464
65READ16_HANDLER( genesis_sram_read )
65static READ16_HANDLER( genesis_sram_read )
6666{
6767        UINT16 retval = 0;
6868
r1581r1582
7878}
7979
8080
81WRITE16_HANDLER( genesis_sram_write )
81static WRITE16_HANDLER( genesis_sram_write )
8282{
8383        offset <<= 1;
8484
r1581r1582
9090}
9191
9292
93WRITE16_HANDLER( genesis_sram_toggle )
93static WRITE16_HANDLER( genesis_sram_toggle )
9494{
9595        /* unsure if this is actually supposed to toggle or just switch on?
9696          * Yet to encounter game that utilizes
docs/messnew.txt
r1581r1582
5151- The core is based on MAME 0.122u6.  This incorporates all features of the
5252  update to this core.  [MAME team]
5353
54- Conditional logging and core callback cleanups.  [Atari Ace]
54- Miscellaneous cleanups (staticization, constification, conditional logging,
55  core callbacks).  [Atari Ace]
5556
5657- Greater use of ATTR_PRINTF.  [Oliver Stoeneberg]
5758

Previous 15994 Revisions Next


© 1998-2018 The MESS Team