Previous 15994 Revisions Next

r3713 Friday 28th November, 2008 at 21:09:37 UTC by Nathan Woods
Const correctness [Atari Ace]
[src/mess/drivers]abc80.c abc80x.c acrnsys1.c amstrad.c apf.c aquarius.c avigo.c bw2.c einstein.c enterp.c exidy.c jupiter.c mpf1.c nc.c newbrain.c pasogo.c pcw.c pdp1.c psx.c saturn.c sg1000.c sord.c super80.c ti99_2.c tm990189.c tmc1800.c tmc2000e.c tmc600.c x68k.c z88.c
[src/mess/includes]hp48.h mz80.h
[src/mess/machine]abc77.c aim65.c apple1.c atom.c ay3600.c bbc.c bk.c c16.c c64.c cdp1871.c compis.c comx35.c concept.c corvushd.c cybiko.c dai.c dgn_beta.c electron.c galaxy.c galeb.c genesis.c geneve.c hp48.c irisha.c kc.c kramermc.c lisa.c mac.c microtan.c msx.c mz700.c mz80.c nascom1.c nes.c odyssey2.c oric.c p2000t.c pdp1.c pecom.c pet.c pmd85.c primo.c sms.c snescart.c svi318.c thomson.c ti85.c ti99_4x.c tx0.c ut88.c vectrex.c vtech1.c
[src/mess/video]733_asr.c 911_vdt.c bbc.c hp48.c mbee.c mekd2.c mz80.c sapi1.c

src/mess/video/hp48.c
r3712r3713
3131***************************************************************************/
3232
3333/* base colors */
34static int hp48_bg_color[3] = { 136, 147, 109 };  /* yellow */
35static int hp48_fg_color[3] = {   0,   0,  64 };  /* dark blue */
34static const int hp48_bg_color[3] = { 136, 147, 109 };  /* yellow */
35static const int hp48_fg_color[3] = {   0,   0,  64 };  /* dark blue */
3636
3737/* color mixing */
3838#define mix(c1,c2,x) (c1)*(1-(x))+(c2)*(x)
src/mess/video/911_vdt.c
r3712r3713
576576   modifier_state_t modifier_state;
577577   int repeat_mode;
578578
579   static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5" };
579   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5" };
580580
581581   /* read current key state */
582582   for (i = 0; i < 6; i++)
src/mess/video/mbee.c
r3712r3713
103103   int bit = (offs >> 4) & 7;
104104   int extra = input_port_read(machine, "EXTRA");
105105   int data = 0;
106   static const char *keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7" };
106   static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7" };
107107
108108
109109   data = (input_port_read(machine, keynames[port]) >> bit) & 1;
src/mess/video/mekd2.c
r3712r3713
5454{
5555   int width = video_screen_get_width(screen);
5656    int x, y;
57   static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3" };
57   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3" };
5858
5959    for (x = 0; x < 6; x++)
6060    {
src/mess/video/sapi1.c
r3712r3713
1010#include "driver.h"
1111#include "includes/sapi1.h"
1212
13UINT8 MHB2501[] = {
13static const UINT8 MHB2501[] = {
1414   0x0c,0x11,0x13,0x15,0x17,0x10,0x0e,0x00, // @
1515   0x04,0x0a,0x11,0x11,0x1f,0x11,0x11,0x00, // A
1616   0x1e,0x11,0x11,0x1e,0x11,0x11,0x1e,0x00, // B
src/mess/video/mz80.c
r3712r3713
1/***************************************************************************
2 
3        MZ80 driver by Miodrag Milanovic
4 
5        22/11/2008 Preliminary driver.
6 
7****************************************************************************/
8 
9#include "driver.h"
10#include "machine/8255ppi.h"
11#include "machine/pit8253.h"
12#include "includes/mz80.h"
13 
14gfx_layout mz80k_charlayout =
15{
16   8, 8,            /* 8x8 characters */
17   256,            /* 256 characters */
18   1,              /* 1 bits per pixel */
19   {0},            /* no bitplanes; 1 bit per pixel */
20   {0, 1, 2, 3, 4, 5, 6, 7},
21   {0 * 8, 1 * 8, 2 * 8, 3 * 8, 4 * 8, 5 * 8, 6 * 8, 7 * 8},
22   8*8               /* size of one char */
23};
24 
25gfx_layout mz80kj_charlayout =
26{
27   8, 8,            /* 8x8 characters */
28   256,            /* 256 characters */
29   1,              /* 1 bits per pixel */
30   {0},            /* no bitplanes; 1 bit per pixel */
31   {7, 6, 5, 4, 3, 2, 1, 0},
32   {0 * 8, 1 * 8, 2 * 8, 3 * 8, 4 * 8, 5 * 8, 6 * 8, 7 * 8},
33   8*8               /* size of one char */
34};
35 
36/* Video hardware */
37VIDEO_START( mz80k )
38{
39}
40 
41VIDEO_UPDATE( mz80k )
42{
43   int x,y;
44   const address_space *space = cpu_get_address_space(screen->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
45   mz80k_vertical = mz80k_vertical ? 0 : 1;   
46   mz80k_cursor_cnt++;
47   if (mz80k_cursor_cnt==64) mz80k_cursor_cnt = 0;
48       
49   for(y = 0; y < 25; y++ )
50   {
51      for(x = 0; x < 40; x++ )
52      {
53         int code = memory_read_byte(space,0xD000 + x + y*40);       
54         drawgfx(bitmap, screen->machine->gfx[0],  code , 0, 0,0, x*8,y*8,
55            NULL, TRANSPARENCY_NONE, 0);
56      }
57   }
58   return 0;
59}
1/***************************************************************************
2
3        MZ80 driver by Miodrag Milanovic
4
5        22/11/2008 Preliminary driver.
6
7****************************************************************************/
8
9#include "driver.h"
10#include "machine/8255ppi.h"
11#include "machine/pit8253.h"
12#include "includes/mz80.h"
13
14const gfx_layout mz80k_charlayout =
15{
16   8, 8,            /* 8x8 characters */
17   256,            /* 256 characters */
18   1,              /* 1 bits per pixel */
19   {0},            /* no bitplanes; 1 bit per pixel */
20   {0, 1, 2, 3, 4, 5, 6, 7},
21   {0 * 8, 1 * 8, 2 * 8, 3 * 8, 4 * 8, 5 * 8, 6 * 8, 7 * 8},
22   8*8               /* size of one char */
23};
24
25const gfx_layout mz80kj_charlayout =
26{
27   8, 8,            /* 8x8 characters */
28   256,            /* 256 characters */
29   1,              /* 1 bits per pixel */
30   {0},            /* no bitplanes; 1 bit per pixel */
31   {7, 6, 5, 4, 3, 2, 1, 0},
32   {0 * 8, 1 * 8, 2 * 8, 3 * 8, 4 * 8, 5 * 8, 6 * 8, 7 * 8},
33   8*8               /* size of one char */
34};
35
36/* Video hardware */
37VIDEO_START( mz80k )
38{
39}
40
41VIDEO_UPDATE( mz80k )
42{
43   int x,y;
44   const address_space *space = cpu_get_address_space(screen->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
45   mz80k_vertical = mz80k_vertical ? 0 : 1;   
46   mz80k_cursor_cnt++;
47   if (mz80k_cursor_cnt==64) mz80k_cursor_cnt = 0;
48     
49   for(y = 0; y < 25; y++ )
50   {
51      for(x = 0; x < 40; x++ )
52      {
53         int code = memory_read_byte(space,0xD000 + x + y*40);     
54         drawgfx(bitmap, screen->machine->gfx[0],  code , 0, 0,0, x*8,y*8,
55            NULL, TRANSPARENCY_NONE, 0);
56      }
57   }
58   return 0;
59}
src/mess/video/733_asr.c
r3712r3713
625625   modifier_state_t modifier_state;
626626   int repeat_mode;
627627
628   static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3" };
628   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3" };
629629
630630   /* read current key state */
631631   /* 2008-05 FP: in 733_asr.h there are only 4 input ports defined... */
src/mess/video/bbc.c
r3712r3713
533533}
534534
535535
536static struct m6845_interface
537BBC6845= {
536static const struct m6845_interface BBC6845 =
537{
538538   0,// Memory Address register
539539   BBC_Set_Character_Row,// Row Address register
540540   BBC_Set_HSync,// Horizontal status
src/mess/includes/hp48.h
r3712r3713
6262
6363struct hp48_port_config;
6464
65extern struct hp48_port_config hp48sx_port1_config;
66extern struct hp48_port_config hp48sx_port2_config;
67extern struct hp48_port_config hp48gx_port1_config;
68extern struct hp48_port_config hp48gx_port2_config;
65extern const struct hp48_port_config hp48sx_port1_config;
66extern const struct hp48_port_config hp48sx_port2_config;
67extern const struct hp48_port_config hp48gx_port1_config;
68extern const struct hp48_port_config hp48gx_port2_config;
6969
7070extern DEVICE_GET_INFO( hp48_port );
7171
src/mess/includes/mz80.h
r3712r3713
1/*****************************************************************************
2 *
3 * includes/mz80.h
4 *
5 ****************************************************************************/
6 
7#ifndef MZ80_H_
8#define MZ80_H_
9 
10/*----------- defined in machine/galeb.c -----------*/
11 
12extern DRIVER_INIT( mz80k );
13extern MACHINE_RESET( mz80k );
14extern READ8_HANDLER( mz80k_strobe_r );
15extern WRITE8_HANDLER( mz80k_strobe_w );
16 
17extern ppi8255_interface mz80k_8255_int;     
18extern struct pit8253_config mz80k_pit8253_config;
19 
20extern UINT8 mz80k_vertical;
21extern UINT8 mz80k_cursor_cnt;
22 
23/*----------- defined in video/mz80.c -----------*/
24 
25extern gfx_layout mz80k_charlayout;
26extern gfx_layout mz80kj_charlayout;
27 
28extern VIDEO_START( mz80k );
29extern VIDEO_UPDATE( mz80k );
30 
31#endif /* MZ80_H_ */
1/*****************************************************************************
2 *
3 * includes/mz80.h
4 *
5 ****************************************************************************/
6
7#ifndef MZ80_H_
8#define MZ80_H_
9
10/*----------- defined in machine/mz80.c -----------*/
11
12extern DRIVER_INIT( mz80k );
13extern MACHINE_RESET( mz80k );
14extern READ8_HANDLER( mz80k_strobe_r );
15extern WRITE8_HANDLER( mz80k_strobe_w );
16
17extern const ppi8255_interface mz80k_8255_int;   
18extern const struct pit8253_config mz80k_pit8253_config;
19
20extern UINT8 mz80k_vertical;
21extern UINT8 mz80k_cursor_cnt;
22
23/*----------- defined in video/mz80.c -----------*/
24
25extern const gfx_layout mz80k_charlayout;
26extern const gfx_layout mz80kj_charlayout;
27
28extern VIDEO_START( mz80k );
29extern VIDEO_UPDATE( mz80k );
30
31#endif /* MZ80_H_ */
src/mess/machine/dgn_beta.c
r3712r3713
541541   int RetVal;
542542   int Idx;
543543   int Selected;
544   static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4",
544   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4",
545545                              "KEY5", "KEY6", "KEY7", "KEY8", "KEY9" };
546546   
547547   LOG_KEYBOARD(("PB Read\n"));
r3712r3713
967967#if 0
968968   int   Idx;
969969   int   Row;
970   static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4",
970   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4",
971971                              "KEY5", "KEY6", "KEY7", "KEY8", "KEY9" };
972972   
973973   LOG_KEYBOARD(("Scanning Host keyboard\n"));
src/mess/machine/pdp1.c
r3712r3713
12591259   static int old_typewriter_keys[4];
12601260
12611261   int typewriter_transitions;
1262   static const char *twrnames[] = { "TWR0", "TWR1", "TWR2", "TWR3" };
1262   static const char *const twrnames[] = { "TWR0", "TWR1", "TWR2", "TWR3" };
12631263
12641264
12651265   for (i=0; i<4; i++)
src/mess/machine/hp48.c
r3712r3713
101101/* from highest to lowest priority: HDW, NCE2, CE1, CE2, NCE3, NCE1 */
102102static hp48_module hp48_modules[6];
103103
104static const char* hp48_module_names[6] =
104static const char *const hp48_module_names[6] =
105105  { "HDW (I/O)", "NCE2 (RAM)", "CE1", "CE2", "NCE3", "NCE1 (ROM)" };
106106
107107/* values returned by C=ID */
r3712r3713
989989/* ----- card images ------ */
990990
991991/* port information configurations */
992struct hp48_port_config hp48sx_port1_config = { 0, 2,    128*1024, "p1", "port1" };
993struct hp48_port_config hp48sx_port2_config = { 1, 3,    128*1024, "p2", "port2" };
994struct hp48_port_config hp48gx_port1_config = { 0, 3,    128*1024, "p1", "port1" };
995struct hp48_port_config hp48gx_port2_config = { 1, 4, 4*1024*1024, "p2", "port2" };
992const struct hp48_port_config hp48sx_port1_config = { 0, 2,    128*1024, "p1", "port1" };
993const struct hp48_port_config hp48sx_port2_config = { 1, 3,    128*1024, "p2", "port2" };
994const struct hp48_port_config hp48gx_port1_config = { 0, 3,    128*1024, "p1", "port1" };
995const struct hp48_port_config hp48gx_port2_config = { 1, 4, 4*1024*1024, "p2", "port2" };
996996
997997/* helper for load and create */
998998static void hp48_fill_port( const device_config* image )
src/mess/machine/dai.c
r3712r3713
6262{
6363   UINT8 data = 0x00;
6464   int i;
65   static const char *keynames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
65   static const char *const keynames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
6666
6767   for (i = 0; i < 8; i++)
6868   {
src/mess/machine/aim65.c
r3712r3713
133133
134134UINT8 aim65_riot_b_r(const device_config *device, UINT8 olddata)
135135{
136   static const char *keynames[] =
136   static const char *const keynames[] =
137137   {
138138      "keyboard_0", "keyboard_1", "keyboard_2", "keyboard_3",
139139      "keyboard_4", "keyboard_5", "keyboard_6", "keyboard_7"
src/mess/machine/thomson.c
r3712r3713
677677      int keyline = pia_get_output_b( THOM_PIA_SYS );
678678      UINT8 val = 0xff;
679679      int i;
680      static const char *keynames[] = { "keyboard_0", "keyboard_1", "keyboard_2", "keyboard_3",
680      static const char *const keynames[] = { "keyboard_0", "keyboard_1", "keyboard_2", "keyboard_3",
681681                                 "keyboard_4", "keyboard_5", "keyboard_6", "keyboard_7" };
682682     
683683      for ( i = 0; i < 8; i++ )
r3712r3713
15701570static READ8_HANDLER ( to770_sys_porta_in )
15711571{
15721572   /* keyboard */
1573   static const char *keynames[] = { "keyboard_0", "keyboard_1", "keyboard_2", "keyboard_3",
1573   static const char *const keynames[] = { "keyboard_0", "keyboard_1", "keyboard_2", "keyboard_3",
15741574                              "keyboard_4", "keyboard_5", "keyboard_6", "keyboard_7" };
15751575   int keyline = pia_get_output_b( THOM_PIA_SYS ) & 7;
15761576   
r3712r3713
18731873   UINT8 portb = pia_get_output_b( THOM_PIA_SYS );
18741874   int col = (portb >> 1) & 7;       /* key column */
18751875   int lin = 7 - ((portb >> 4) & 7); /* key line */
1876   static const char *keynames[] = { "keyboard_0", "keyboard_1", "keyboard_2", "keyboard_3",
1876   static const char *const keynames[] = { "keyboard_0", "keyboard_1", "keyboard_2", "keyboard_3",
18771877                              "keyboard_4", "keyboard_5", "keyboard_6", "keyboard_7" };
18781878   
18791879   return ( input_port_read(space->machine, keynames[lin]) & (1 << col) ) ? 0x80 : 0;
r3712r3713
25372537{
25382538   int line, bit;
25392539   UINT8 port;
2540   static const char *keynames[] = { "keyboard_0", "keyboard_1", "keyboard_2", "keyboard_3", "keyboard_4",
2540   static const char *const keynames[] = { "keyboard_0", "keyboard_1", "keyboard_2", "keyboard_3", "keyboard_4",
25412541                              "keyboard_5", "keyboard_6", "keyboard_7", "keyboard_8", "keyboard_9" };
25422542
25432543   for ( line = 0; line < 10; line++ )
r3712r3713
27712771   int shift   = ! (input_port_read(Machine, "keyboard_9") & 1);
27722772   int key = -1, line, bit;
27732773   UINT8 port;
2774   static const char *keynames[] = { "keyboard_0", "keyboard_1", "keyboard_2", "keyboard_3", "keyboard_4",
2774   static const char *const keynames[] = { "keyboard_0", "keyboard_1", "keyboard_2", "keyboard_3", "keyboard_4",
27752775                              "keyboard_5", "keyboard_6", "keyboard_7", "keyboard_8", "keyboard_9" };
27762776
27772777   for ( line = 0; line < 10; line++ )
r3712r3713
31803180{
31813181   int line, bit;
31823182   UINT8 port;
3183   static const char *keynames[] = { "keyboard_0", "keyboard_1", "keyboard_2", "keyboard_3", "keyboard_4",
3183   static const char *const keynames[] = { "keyboard_0", "keyboard_1", "keyboard_2", "keyboard_3", "keyboard_4",
31843184                              "keyboard_5", "keyboard_6", "keyboard_7", "keyboard_8", "keyboard_9" };
31853185
31863186   if ( input_port_read(machine, "config") & 2 )
r3712r3713
32123212   int shift   = (input_port_read(machine, "keyboard_9") & 1) ? 0 : 0x080;
32133213   int key = -1, line, bit;
32143214   UINT8 port;
3215   static const char *keynames[] = { "keyboard_0", "keyboard_1", "keyboard_2", "keyboard_3", "keyboard_4",
3215   static const char *const keynames[] = { "keyboard_0", "keyboard_1", "keyboard_2", "keyboard_3", "keyboard_4",
32163216                              "keyboard_5", "keyboard_6", "keyboard_7", "keyboard_8", "keyboard_9" };
32173217   
32183218   if ( input_port_read(machine, "config") & 2 )
r3712r3713
45344534   UINT8 portb = pia_get_output_b( THOM_PIA_SYS );
45354535   int col = (portb >> 4) & 7;    /* B bits 4-6: kbd column */
45364536   int lin = (portb >> 1) & 7;    /* B bits 1-3: kbd line */
4537   static const char *keynames[] = { "keyboard_0", "keyboard_1", "keyboard_2", "keyboard_3", "keyboard_4",
4537   static const char *const keynames[] = { "keyboard_0", "keyboard_1", "keyboard_2", "keyboard_3", "keyboard_4",
45384538                              "keyboard_5", "keyboard_6", "keyboard_7", "keyboard_8", "keyboard_9" };
45394539
45404540   if ( ! (porta & 8) )
r3712r3713
49584958   UINT8 portb = pia_get_output_b( THOM_PIA_SYS );
49594959   int col = (portb >> 4) & 7;    /* B bits 4-6: kbd column */
49604960   int lin = (portb >> 1) & 7;    /* B bits 1-3: kbd line */
4961   static const char *keynames[] = { "keyboard_0", "keyboard_1", "keyboard_2", "keyboard_3",
4961   static const char *const keynames[] = { "keyboard_0", "keyboard_1", "keyboard_2", "keyboard_3",
49624962                              "keyboard_4", "keyboard_5", "keyboard_6", "keyboard_7" };
49634963   
49644964   return ( input_port_read(space->machine, keynames[lin]) & (1 << col) ) ? 0x80 : 0;
src/mess/machine/cdp1871.c
r3712r3713
143143static void detect_keypress(const device_config *device)
144144{
145145   cdp1871_t *cdp1871 = get_safe_token(device);
146   static const char *keynames[] = { "D1", "D2", "D3", "D4", "D5", "D6", "D7", "D8", "D9", "D10", "D11" };
146   static const char *const keynames[] = { "D1", "D2", "D3", "D4", "D5", "D6", "D7", "D8", "D9", "D10", "D11" };
147147
148148   if (input_port_read(device->machine, keynames[cdp1871->drive]) == (1 << cdp1871->sense))
149149   {
src/mess/machine/pmd85.c
r3712r3713
241241
242242static  READ8_DEVICE_HANDLER ( pmd85_ppi_0_portb_r )
243243{
244   static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6", "KEY7",
244   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6", "KEY7",
245245                              "KEY8", "KEY9", "KEY10", "KEY11", "KEY12", "KEY13", "KEY14", "KEY15" };
246246
247247   return input_port_read(device->machine, keynames[(pmd85_ppi_port_outputs[0][0] & 0x0f)]) & input_port_read(device->machine, "KEY15");
r3712r3713
281281{
282282   int i;
283283   UINT8 data = 0xff;
284   static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6", "KEY7" };
284   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6", "KEY7" };
285285
286286   for (i = 0; i < 8; i++)
287287   {
src/mess/machine/kramermc.c
r3712r3713
2020
2121READ8_DEVICE_HANDLER (kramermc_port_b_r)
2222{
23   static const char *keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7" };
23   static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7" };
2424
2525   return input_port_read(device->machine, keynames[kramermc_key_row]);
2626}
src/mess/machine/tx0.c
r3712r3713
11201120
11211121   int typewriter_transitions;
11221122   int charcode, lr;
1123   static const char *twrnames[] = { "TWR0", "TWR1", "TWR2", "TWR3" };
1123   static const char *const twrnames[] = { "TWR0", "TWR1", "TWR2", "TWR3" };
11241124
11251125   for (i=0; i<4; i++)
11261126   {
src/mess/machine/ay3600.c
r3712r3713
367367
368368   static unsigned int time_until_repeat = MAGIC_KEY_REPEAT_NUMBER;
369369
370   static const char *portnames[] = { "keyb_0", "keyb_1", "keyb_2", "keyb_3", "keyb_4", "keyb_5", "keyb_6",
370   static const char *const portnames[] = { "keyb_0", "keyb_1", "keyb_2", "keyb_3", "keyb_4", "keyb_5", "keyb_6",
371371                              "keypad_1", "keypad_2" };
372372
373373   /* check for these special cases because they affect the emulated key codes */
src/mess/machine/p2000t.c
r3712r3713
4242
4343READ8_HANDLER (   p2000t_port_000f_r )
4444{
45   static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4",
45   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4",
4646                              "KEY5", "KEY6", "KEY7", "KEY8", "KEY9" };
4747
4848   if (p2000t_ports.port_101f & P2000M_101F_KEYINT)
src/mess/machine/pet.c
r3712r3713
106106static  READ8_HANDLER ( pet_pia0_port_b_read )
107107{
108108   UINT8 data = 0xff;
109   static const char *keynames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4",
109   static const char *const keynames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4",
110110                              "ROW5", "ROW6", "ROW7", "ROW8", "ROW9" };
111111   
112112   if (pet_keyline_select < 10)
r3712r3713
123123static READ8_HANDLER( petb_pia0_port_b_read )
124124{
125125   UINT8 data = 0xff;
126   static const char *keynames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4",
126   static const char *const keynames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4",
127127                              "ROW5", "ROW6", "ROW7", "ROW8", "ROW9" };
128128   
129129   if (pet_keyline_select < 10)
src/mess/machine/c16.c
r3712r3713
600600INTERRUPT_GEN( c16_frame_interrupt )
601601{
602602   int value, i;
603   static const char *c16ports[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7" };
603   static const char *const c16ports[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7" };
604604
605605   /* Lines 0-7 : common keyboard */
606606   for (i = 0; i < 8; i++)
src/mess/machine/oric.c
r3712r3713
119119
120120   /* what if data is 0, can it sense if any of the keys on a line are pressed? */
121121   int input_port_data;
122   static const char *keynames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7" };
122   static const char *const keynames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7" };
123123
124124    input_port_data = input_port_read(machine, keynames[oric_keyboard_line]);
125125
src/mess/machine/galeb.c
r3712r3713
2323
2424READ8_HANDLER( galeb_keyboard_r )
2525{
26   static const char *keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7" };
26   static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7" };
2727
2828   return input_port_read(space->machine, keynames[offset]);
2929}
src/mess/machine/electron.c
r3712r3713
9898{
9999   UINT8 data = 0;
100100   int i;
101   static const char *keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6",
101   static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6",
102102                              "LINE7", "LINE8", "LINE9", "LINE10", "LINE11", "LINE12", "LINE13" };
103103   
104104   //logerror( "PC=%04x: keyboard read from paged rom area, address: %04x", activecpu_get_pc(), offset );
src/mess/machine/irisha.c
r3712r3713
3939  irisha_keypressed = 0;
4040}
4141
42static const char *keynames[] = {
42static const char *const keynames[] = {
4343                     "LINE0", "LINE1", "LINE2", "LINE3",
4444                     "LINE4", "LINE5", "LINE6", "LINE7",
4545                     "LINE8", "LINE9"};
src/mess/machine/bk.c
r3712r3713
2222static TIMER_CALLBACK(keyboard_callback)
2323{
2424   UINT8 code, i, j;
25   static const char *keynames[] = { "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6",
25   static const char *const keynames[] = { "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6",
2626                              "LINE7", "LINE8", "LINE9", "LINE10", "LINE11" };
2727
2828   for(i = 1; i < 12; i++)
src/mess/machine/nascom1.c
r3712r3713
151151
152152READ8_HANDLER ( nascom1_port_00_r )
153153{
154   static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6", "KEY7", "KEY8" };
154   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6", "KEY7", "KEY8" };
155155
156156   if (nascom1_portstat.stat_count < 9)
157157      return (input_port_read(space->machine, keynames[nascom1_portstat.stat_count]) | ~0x7f);
src/mess/machine/microtan.c
r3712r3713
608608{
609609    int mod, row, col, chg, new;
610610    static int lastrow = 0, mask = 0x00, key = 0x00, repeat = 0, repeater = 0;
611   static const char *keynames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7", "ROW8" };
611   static const char *const keynames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7", "ROW8" };
612612
613613    if( repeat )
614614    {
r3712r3713
923923MACHINE_RESET( microtan )
924924{
925925    int i;
926   static const char *keynames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7", "ROW8" };
926   static const char *const keynames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7", "ROW8" };
927927   
928928   for (i = 1; i < 10;  i++)
929929   {
src/mess/machine/vtech1.c
r3712r3713
484484   static int cassette_bit = 0;
485485   int row, data = 0xff;
486486   double level;
487   static const char *keynames[] = { "keyboard_0", "keyboard_1", "keyboard_2", "keyboard_3",
487   static const char *const keynames[] = { "keyboard_0", "keyboard_1", "keyboard_2", "keyboard_3",
488488                              "keyboard_4", "keyboard_5", "keyboard_6", "keyboard_7" };
489489
490490   /* scan keyboard rows */
r3712r3713
528528   /* cassette data bits toggle? */
529529   if ((vtech1_latch ^ data ) & 0x06)
530530   {
531      static double amp[4] = { +1.0, +0.5, -0.5, -1.0 };
531      static const double amp[4] = { +1.0, +0.5, -0.5, -1.0 };
532532      cassette_output(cassette_device_image(space->machine), amp[(data >> 1) & 3]);
533533   }
534534
src/mess/machine/sms.c
r3712r3713
2929static UINT8 *sms_banking_bios[5]; /* we are going to use 1-4, same as bank numbers */
3030static UINT8 *sms_banking_cart[5]; /* we are going to use 1-4, same as bank numbers */
3131static UINT8 *sms_banking_none[5]; /* we are going to use 1-4, same as bank numbers */
32static UINT8 ggSIO[5] = { 0x7F, 0xFF, 0x00, 0xFF, 0x00 };
32static UINT8 ggSIO[5];
3333static UINT8 sms_store_control = 0;
3434
3535static UINT8 sms_input_port0;
src/mess/machine/comx35.c
r3712r3713
322322static void get_active_bank(running_machine *machine, UINT8 data)
323323{
324324   comx35_state *state = machine->driver_data;
325   static const char *slotnames[] = { "", "SLOT1", "SLOT2", "SLOT3", "SLOT4" };
325   static const char *const slotnames[] = { "", "SLOT1", "SLOT2", "SLOT3", "SLOT4" };
326326
327327   if (expansion_box_installed(machine))
328328   {
src/mess/machine/odyssey2.c
r3712r3713
148148{
149149    UINT8 h = 0xFF;
150150    int i, j;
151   static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5" };
151   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5" };
152152
153153    if (!(p1 & P1_KEYBOARD_SCAN_ENABLE))
154154   {
src/mess/machine/primo.c
r3712r3713
8181READ8_HANDLER( primo_be_1_r )
8282{
8383   UINT8 data = 0x00;
84   static const char *portnames[] = { "IN0", "IN1", "IN2", "IN3" };
84   static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" };
8585
8686   // bit 7, 6 - not used
8787
src/mess/machine/ti85.c
r3712r3713
296296   int data = 0xff;
297297   int port;
298298   int bit;
299   static const char *bitnames[] = { "BIT0", "BIT1", "BIT2", "BIT3", "BIT4", "BIT5", "BIT6", "BIT7" };
299   static const char *const bitnames[] = { "BIT0", "BIT1", "BIT2", "BIT3", "BIT4", "BIT5", "BIT6", "BIT7" };
300300
301301   if (ti85_keypad_mask == 0x7f) return data;
302302
src/mess/machine/svi318.c
r3712r3713
191191static READ8_DEVICE_HANDLER ( svi318_ppi_port_b_r )
192192{
193193   int row;
194   static const char *keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5",
194   static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5",
195195                              "LINE6", "LINE7", "LINE8", "LINE9", "LINE10" };
196196
197197   row = svi.keyboard_row;
src/mess/machine/galaxy.c
r3712r3713
1818
1919READ8_HANDLER( galaxy_keyboard_r )
2020{
21   static const char *keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7" };
21   static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7" };
2222
2323   if (offset == 0)
2424   {
src/mess/machine/compis.c
r3712r3713
230230   UINT8 icol;
231231   UINT16 data;
232232   UINT16 ibit;
233   static const char *rownames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5" };
233   static const char *const rownames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5" };
234234   
235235   key_code = 0;
236236   key_status = 0x80;
src/mess/machine/corvushd.c
r3712r3713
11731173//      hard_disk_file object
11741174//
11751175static hard_disk_file *corvus_hdc_file(running_machine *machine, int id) {
1176   const char *tags[] = {
1176   static const char *const tags[] = {
11771177      "harddisk1"
11781178   };
11791179   const device_config *img;
src/mess/machine/mac.c
r3712r3713
380380   int i, j;
381381   int keybuf;
382382   int keycode;
383   static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6" };
383   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6" };
384384
385385   if (keycode_buf_index)
386386   {
src/mess/machine/nes.c
r3712r3713
306306static void nes_read_input_device(running_machine *machine, int cfg, nes_input *vals, int pad_port,
307307   int supports_zapper, int paddle_port)
308308{
309   static const char *padnames[] = { "PAD1", "PAD2", "PAD3", "PAD4" };
309   static const char *const padnames[] = { "PAD1", "PAD2", "PAD3", "PAD4" };
310310
311311   vals->i0 = 0;
312312   vals->i1 = 0;
src/mess/machine/concept.c
r3712r3713
174174   UINT32 key_transitions;
175175   int i, j;
176176   int keycode;
177   static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5" };
177   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5" };
178178
179179   for(i = 0; (i < /*4*/3) && (KeyQueueLen <= (KeyQueueSize-MaxKeyMessageLen)); i++)
180180   {
src/mess/machine/msx.c
r3712r3713
730730{
731731   UINT8 result = 0xff;
732732   int row, data;
733   static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5" };
733   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5" };
734734
735735   row = ppi8255_r(device, 2) & 0x0f;
736736   if (row <= 10)
src/mess/machine/mz700.c
r3712r3713
138138static READ8_DEVICE_HANDLER ( pio_port_b_r )
139139{
140140   UINT8 demux_LS145, data = 0xff;
141   static const char *keynames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5",
141   static const char *const keynames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5",
142142                              "ROW6", "ROW7", "ROW8", "ROW9", "ROW10" };
143143
144144    demux_LS145 = pio_port_a_output & 15;
src/mess/machine/vectrex.c
r3712r3713
227227READ8_HANDLER(v_via_pb_r)
228228{
229229   int pot;
230   static const char *ctrlnames[] = { "CONTR1X", "CONTR1Y", "CONTR2X", "CONTR2Y" };
230   static const char *const ctrlnames[] = { "CONTR1X", "CONTR1Y", "CONTR2X", "CONTR2Y" };
231231
232232   pot = input_port_read(space->machine, ctrlnames[(vectrex_via_out[PORTB] & 0x6) >> 1]) - 0x80;
233233   
src/mess/machine/lisa.c
r3712r3713
395395   int i, j;
396396   int keybuf;
397397   UINT8 keycode;
398   static const char *keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7" };
398   static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7" };
399399
400400   if (! COPS_force_unplug)
401401      for (i=0; i<8; i++)
src/mess/machine/geneve.c
r3712r3713
10371037   int i, j;
10381038   int keycode;
10391039   int pressed;
1040   static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6", "KEY7" };
1040   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6", "KEY7" };
10411041
10421042   static const UINT8 keyboard_mf1_code[0xe] =
10431043   {
src/mess/machine/atom.c
r3712r3713
356356READ8_DEVICE_HANDLER ( atom_8255_portb_r )
357357{
358358   int row;
359   static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5",
359   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5",
360360                              "KEY6", "KEY7", "KEY8", "KEY9", "KEY10", "KEY11" };
361361   
362362   row = atom_8255_porta & 0x0f;
src/mess/machine/apple1.c
r3712r3713
289289   int port, bit;
290290   int key_pressed;
291291   UINT32 shiftkeys, ctrlkeys;
292   static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3" };
292   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3" };
293293
294294   /* This holds the values of all the input ports for ordinary keys
295295      seen during the last scan. */
src/mess/machine/mz80.c
r3712r3713
1/***************************************************************************
2 
3        MZ80 driver by Miodrag Milanovic
4 
5        22/11/2008 Preliminary driver.
6 
7****************************************************************************/
8 
9#include "driver.h"
10#include "machine/8255ppi.h"
11#include "machine/pit8253.h"
12#include "devices/cassette.h"
13#include "sound/speaker.h"
14#include "includes/mz80.h"
15 
16UINT8 mz80k_tempo_strobe = 0;
17UINT8 mz80k_8255_portc = 0;
18UINT8 mz80k_vertical = 0;
19UINT8 mz80k_cursor_cnt = 0;
20UINT8 mz80k_keyboard_line = 0;
21 
22 
23/* Driver initialization */
24DRIVER_INIT(mz80k)
25{
26}
27 
28 
29MACHINE_RESET( mz80k )
30{
31   mz80k_tempo_strobe = 0;
32   mz80k_8255_portc = 0;
33   mz80k_vertical = 0;
34   mz80k_cursor_cnt = 0;
35   mz80k_keyboard_line = 0;
36}
37 
38 
39READ8_DEVICE_HANDLER(mz80k_8255_portb_r)
40{
41   static const char *keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7", "LINE8", "LINE9" };
42   if (mz80k_keyboard_line > 9) {
43      return 0xff;
44   } else {
45      return input_port_read(device->machine, keynames[mz80k_keyboard_line]);
46   }
47}
48 
49READ8_DEVICE_HANDLER(mz80k_8255_portc_r)
50{
51   UINT8 val = 0;
52   val |= mz80k_vertical ? 0x80 : 0x00;
53   val |= (mz80k_cursor_cnt > 31) ? 0x40 : 0x00;
54    val |= (cassette_get_state(device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, "cassette" )) & CASSETTE_MASK_UISTATE)== CASSETTE_PLAY ? 0x10 : 0x00;
55 
56    if (cassette_input(device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, "cassette" )) > 0.00)
57        val |= 0x20;
58 
59   return val;
60}
61 
62WRITE8_DEVICE_HANDLER(mz80k_8255_porta_w) 
63{   
64   mz80k_keyboard_line = data & 0x0f;   
65}
66 
67WRITE8_DEVICE_HANDLER(mz80k_8255_portc_w) 
68{   
69//   logerror("mz80k_8255_portc_w %02x\n",data);
70}
71 
72static PIT8253_OUTPUT_CHANGED( pit_out0_changed )
73{
74   speaker_level_w( 0, state ? 1 : 0 );
75}
76 
77 
78static PIT8253_OUTPUT_CHANGED( pit_out1_changed )
79{
80   pit8253_set_clock_signal( device, 2, state );
81}
82 
83 
84static PIT8253_OUTPUT_CHANGED( pit_out2_changed )
85{
86   cpu_set_input_line(device->machine->cpu[0], 0, HOLD_LINE);
87}
88 
89ppi8255_interface mz80k_8255_int =
90{
91   NULL,
92   mz80k_8255_portb_r,
93   mz80k_8255_portc_r,
94   mz80k_8255_porta_w,
95   NULL,
96   mz80k_8255_portc_w,
97};
98 
99struct pit8253_config mz80k_pit8253_config =
100{
101   {
102      /* clockin     irq callback     */
103      { 1108800.0,  pit_out0_changed },       
104      {   15611.0,  pit_out1_changed },
105      {        0,  pit_out2_changed },
106   }
107};
108 
109READ8_HANDLER(mz80k_strobe_r)
110{
111    mz80k_tempo_strobe^=1;
112   return(0x7e | mz80k_tempo_strobe);
113}
114WRITE8_HANDLER(mz80k_strobe_w)
115{
116}
117 
1/***************************************************************************
2
3        MZ80 driver by Miodrag Milanovic
4
5        22/11/2008 Preliminary driver.
6
7****************************************************************************/
8
9#include "driver.h"
10#include "machine/8255ppi.h"
11#include "machine/pit8253.h"
12#include "devices/cassette.h"
13#include "sound/speaker.h"
14#include "includes/mz80.h"
15 
16UINT8 mz80k_tempo_strobe = 0;
17UINT8 mz80k_8255_portc = 0;
18UINT8 mz80k_vertical = 0;
19UINT8 mz80k_cursor_cnt = 0;
20UINT8 mz80k_keyboard_line = 0;
21
22
23/* Driver initialization */
24DRIVER_INIT(mz80k)
25{
26}
27
28
29MACHINE_RESET( mz80k )
30{
31   mz80k_tempo_strobe = 0;
32   mz80k_8255_portc = 0;
33   mz80k_vertical = 0;
34   mz80k_cursor_cnt = 0;
35   mz80k_keyboard_line = 0;
36}
37
38
39READ8_DEVICE_HANDLER(mz80k_8255_portb_r)
40{
41   static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7", "LINE8", "LINE9" };
42   if (mz80k_keyboard_line > 9) {
43      return 0xff;
44   } else {
45      return input_port_read(device->machine, keynames[mz80k_keyboard_line]);
46   }
47}
48
49READ8_DEVICE_HANDLER(mz80k_8255_portc_r)
50{
51   UINT8 val = 0;
52   val |= mz80k_vertical ? 0x80 : 0x00;
53   val |= (mz80k_cursor_cnt > 31) ? 0x40 : 0x00;
54    val |= (cassette_get_state(device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, "cassette" )) & CASSETTE_MASK_UISTATE)== CASSETTE_PLAY ? 0x10 : 0x00;
55
56    if (cassette_input(device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, "cassette" )) > 0.00)
57        val |= 0x20;
58
59   return val;
60}
61
62WRITE8_DEVICE_HANDLER(mz80k_8255_porta_w)
63{   
64   mz80k_keyboard_line = data & 0x0f;   
65}
66
67WRITE8_DEVICE_HANDLER(mz80k_8255_portc_w)
68{   
69//   logerror("mz80k_8255_portc_w %02x\n",data);
70}
71
72static PIT8253_OUTPUT_CHANGED( pit_out0_changed )
73{
74   speaker_level_w( 0, state ? 1 : 0 );
75}
76
77
78static PIT8253_OUTPUT_CHANGED( pit_out1_changed )
79{
80   pit8253_set_clock_signal( device, 2, state );
81}
82
83
84static PIT8253_OUTPUT_CHANGED( pit_out2_changed )
85{
86   cpu_set_input_line(device->machine->cpu[0], 0, HOLD_LINE);
87}
88
89const ppi8255_interface mz80k_8255_int =
90{
91   NULL,
92   mz80k_8255_portb_r,
93   mz80k_8255_portc_r,
94   mz80k_8255_porta_w,
95   NULL,
96   mz80k_8255_portc_w,
97};
98
99const struct pit8253_config mz80k_pit8253_config =
100{
101   {
102      /* clockin     irq callback     */
103      { 1108800.0,  pit_out0_changed },     
104      {   15611.0,  pit_out1_changed },
105      {        0,  pit_out2_changed },
106   }
107};
108
109READ8_HANDLER(mz80k_strobe_r)
110{
111    mz80k_tempo_strobe^=1;
112   return(0x7e | mz80k_tempo_strobe);
113}
114WRITE8_HANDLER(mz80k_strobe_w)
115{
116}
117
src/mess/machine/abc77.c
r3712r3713
9999   const device_config *device = devtag_get_device(space->machine, ABC77, ABC77_TAG);
100100   abc77_t *abc77 = get_safe_token(device);
101101
102   static const char *keynames[] = { "ABC77_X0", "ABC77_X1", "ABC77_X2", "ABC77_X3", "ABC77_X4", "ABC77_X5", "ABC77_X6", "ABC77_X7", "ABC77_X8", "ABC77_X9", "ABC77_X10", "ABC77_X11" };
102   static const char *const keynames[] = { "ABC77_X0", "ABC77_X1", "ABC77_X2", "ABC77_X3", "ABC77_X4", "ABC77_X5", "ABC77_X6", "ABC77_X7", "ABC77_X8", "ABC77_X9", "ABC77_X10", "ABC77_X11" };
103103
104104   return input_port_read(device->machine, keynames[abc77->keylatch]);
105105}
src/mess/machine/ut88.c
r3712r3713
137137      }
138138}
139139
140static int hex_to_7seg[16] =
140static const UINT8 hex_to_7seg[16] =
141141   {0x3F, 0x06, 0x5B, 0x4F,
142142    0x66, 0x6D, 0x7D, 0x07,
143143    0x7F, 0x6F, 0x77, 0x7c,
src/mess/machine/cybiko.c
r3712r3713
418418{
419419   UINT8 data = 0xFF;
420420   int i;
421   static const char *keynames[] = { "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9" };
421   static const char *const keynames[] = { "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9" };
422422   
423423   _logerror( 2, ("cybiko_key_r_byte (%08X)\n", offset));
424424   // A11
src/mess/machine/snescart.c
r3712r3713
1616#define UNK "Unknown"
1717
1818/* Some known type of cart */
19static const char *types[] =
19static const char *const types[] =
2020{
2121   "ROM",
2222   "ROM, DSP-1",
r3712r3713
3939};
4040
4141/* Some known countries */
42static const char *countries[] =
42static const char *const countries[] =
4343{
4444/* 0*/   "Japan (NTSC)", "USA & Canada (NTSC)", "Europe, Oceania & Asia (PAL)", "Sweden (PAL)",
4545/* 4*/   "Finland (PAL)", "Denmark (PAL)", "France (PAL)", "Holland (PAL)",
r3712r3713
4848};
4949
5050/* Some known companies (integrations to the list from Snes9x) */
51static const char *companies[] =
51static const char *const companies[] =
5252{
5353/* 0*/   "Invalid", "Nintendo", "Ajinomoto", "Imagineer-Zoom", "Chris Gray Enterprises Inc.", "Zamuse", "Falcom", UNK,
5454/* 8*/   "Capcom", "HOT-B", "Jaleco", "Coconuts", "Rage Software", "Micronet", "Technos", "Mebio Software",
src/mess/machine/c64.c
r3712r3713
11511151   int value, i;
11521152   int controller1 = input_port_read(device->machine, "CTRLSEL") & 0x07;
11531153   int controller2 = input_port_read(device->machine, "CTRLSEL") & 0x70;
1154   static const char *c64ports[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7" };
1155   static const char *c128ports[] = { "KP0", "KP1", "KP2" };
1154   static const char *const c64ports[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7" };
1155   static const char *const c128ports[] = { "KP0", "KP1", "KP2" };
11561156
11571157   c64_nmi(device->machine);
11581158
src/mess/machine/genesis.c
r3712r3713
10561056
10571057   /* Detect carts which need additional handlers */
10581058   {
1059      static unsigned char smouse_sig[] = { 0x4d, 0xf9, 0x00, 0x40, 0x00, 0x02 },
1059      static const unsigned char smouse_sig[] = { 0x4d, 0xf9, 0x00, 0x40, 0x00, 0x02 },
10601060         mjlover_sig[]   = { 0x13, 0xf9, 0x00, 0x40, 0x00, 0x00 }, // move.b  ($400000).l,($FFFF0C).l (partial)
10611061         squir_sig[]      = { 0x26, 0x79, 0x00, 0xff, 0x00, 0xfa },
10621062         bugsl_sig[]      = { 0x20, 0x12, 0x13, 0xc0, 0x00, 0xff },
src/mess/machine/pecom.c
r3712r3713
1/***************************************************************************
2 
3        Pecom driver by Miodrag Milanovic
4 
5        08/11/2008 Preliminary driver.
6 
7****************************************************************************/
8 
9#include "driver.h"
10#include "cpu/cdp1802/cdp1802.h"
11#include "video/cdp1869.h"
12#include "devices/cassette.h"
13#include "includes/pecom.h"
14 
15static UINT8 pecom_caps_state = 4;
16static UINT8 pecom_prev_caps_state = 4;
17 
18/* Driver initialization */
19DRIVER_INIT(pecom)
20{
21   memset(mess_ram,0,32*1024);
22}
23 
24static TIMER_CALLBACK( reset_tick )
25{
26   pecom_state *state = machine->driver_data;
27 
28   state->cdp1802_mode = CDP1802_MODE_RUN;
29}
30 
31MACHINE_START( pecom )
32{
33   pecom_state *state = machine->driver_data;
34   state->reset_timer = timer_alloc(reset_tick, NULL);
35}
36 
37MACHINE_RESET( pecom )
38{
39   UINT8 *rom = memory_region(machine, "main");
40   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
41   
42   pecom_state *state = machine->driver_data;
43   
44   memory_install_write8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_UNMAP);
45   memory_install_write8_handler(space, 0x4000, 0x7fff, 0, 0, SMH_BANK2);
46   memory_install_write8_handler(space, 0xf000, 0xf7ff, 0, 0, SMH_UNMAP);
47   memory_install_write8_handler(space, 0xf800, 0xffff, 0, 0, SMH_UNMAP);
48   memory_install_read8_handler (space, 0xf000, 0xf7ff, 0, 0, SMH_BANK3);
49   memory_install_read8_handler (space, 0xf800, 0xffff, 0, 0, SMH_BANK4);
50   memory_set_bankptr(machine, 1, rom + 0x8000);   
51   memory_set_bankptr(machine, 2, mess_ram + 0x4000);
52   memory_set_bankptr(machine, 3, rom + 0xf000);
53   memory_set_bankptr(machine, 4, rom + 0xf800);
54   
55   pecom_caps_state = 4;
56   pecom_prev_caps_state = 4;
57 
58   state->cdp1802_mode = CDP1802_MODE_RESET;
59   state->dma = 0;
60   timer_adjust_oneshot(state->reset_timer, ATTOTIME_IN_MSEC(5), 0);
61}
62 
63WRITE8_HANDLER( pecom_bank_w )
64{
65   const device_config *cdp1869 = device_list_find_by_tag(space->machine->config->devicelist, CDP1869_VIDEO, CDP1869_TAG);
66   const address_space *space2 = cpu_get_address_space(space->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
67   UINT8 *rom = memory_region(space->machine, "main");
68   memory_install_write8_handler(cpu_get_address_space(space->machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x3fff, 0, 0, SMH_BANK1);
69   memory_set_bankptr(space->machine, 1, mess_ram + 0x0000);
70       
71   if (data==2) {
72      memory_install_read8_device_handler (space2, cdp1869, 0xf000, 0xf7ff, 0, 0, cdp1869_charram_r);
73      memory_install_write8_device_handler(space2, cdp1869, 0xf000, 0xf7ff, 0, 0, cdp1869_charram_w);
74      memory_install_read8_device_handler (space2, cdp1869, 0xf800, 0xffff, 0, 0, cdp1869_pageram_r);
75      memory_install_write8_device_handler(space2, cdp1869, 0xf800, 0xffff, 0, 0, cdp1869_pageram_w);   
76   } else {
77      memory_install_write8_handler(space2, 0xf000, 0xf7ff, 0, 0, SMH_UNMAP);
78      memory_install_write8_handler(space2, 0xf800, 0xffff, 0, 0, SMH_UNMAP);
79      memory_install_read8_handler (space2, 0xf000, 0xf7ff, 0, 0, SMH_BANK3);
80      memory_install_read8_handler (space2, 0xf800, 0xffff, 0, 0, SMH_BANK4);
81      memory_set_bankptr(space->machine, 3, rom + 0xf000);
82      memory_set_bankptr(space->machine, 4, rom + 0xf800);
83   }
84}
85 
86READ8_HANDLER (pecom_keyboard_r)
87{
88   static const char *keynames[] = {    "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7",
89                              "LINE8", "LINE9", "LINE10", "LINE11", "LINE12", "LINE13", "LINE14", "LINE15", "LINE16",
90                              "LINE17", "LINE18", "LINE19", "LINE20", "LINE21", "LINE22", "LINE23", "LINE24","LINE25" };
91   /* 
92      INP command BUS -> M(R(X)) BUS -> D 
93      so on each input, address is also set, 8 lower bits are used as input for keyboard 
94      Address is available on address bus during reading of value from port, and that is 
95      used to determine keyboard line reading
96   */
97   UINT16 addr = cpu_get_reg(space->machine->cpu[0],CDP1802_R0 + cpu_get_reg(space->machine->cpu[0],CDP1802_X));
98   /* just in case somone is reading non existing ports */
99   if (addr<0x7cca || addr>0x7ce3) return 0; 
100   return input_port_read(space->machine, keynames[addr - 0x7cca]) & 0x03;
101}
102 
103/* CDP1802 Interface */
104static CDP1802_MODE_READ( pecom64_mode_r )
105{
106   pecom_state *state = device->machine->driver_data;
107 
108   return state->cdp1802_mode;   
109}
110 
111static const device_config *cassette_device_image(running_machine *machine)
112{
113   return devtag_get_device(machine, CASSETTE, "cassette");
114}
115 
116static CDP1802_EF_READ( pecom64_ef_r )
117{
118   int flags = 0x0f;
119   double valcas = cassette_input(cassette_device_image(device->machine));
120   UINT8 val = input_port_read(device->machine, "CNT");
121   
122   if ((val & 0x04)==0x04 && pecom_prev_caps_state==0) {
123      pecom_caps_state = (pecom_caps_state==4) ? 0 : 4; // Change CAPS state
124   }
125   pecom_prev_caps_state = val & 0x04;
126   if (valcas!=0.0) { // If there is any cassette signal
127      val = (val & 0x0D); // remove EF2 from SHIFT
128      flags -= EF2;
129      if ( valcas > 0.00) flags += EF2;
130   }   
131   flags -= (val & 0x0b) + pecom_caps_state;
132   return flags;
133}
134 
135static CDP1802_Q_WRITE( pecom64_q_w )
136{   
137   cassette_output(cassette_device_image(device->machine), level ? -1.0 : +1.0);
138}
139 
140static CDP1802_SC_WRITE( pecom64_sc_w )
141{
142   switch (state)
143   {
144   case CDP1802_STATE_CODE_S0_FETCH:
145      // not connected
146      break;
147 
148   case CDP1802_STATE_CODE_S1_EXECUTE:
149      break;
150       
151   case CDP1802_STATE_CODE_S2_DMA:
152      // DMA acknowledge clears the DMAOUT request
153      cpu_set_input_line(device->machine->cpu[0], CDP1802_INPUT_LINE_DMAOUT, CLEAR_LINE);
154      break;
155   case CDP1802_STATE_CODE_S3_INTERRUPT:
156      break;
157   }
158}
159CDP1802_INTERFACE( pecom64_cdp1802_config )
160{
161   pecom64_mode_r,
162   pecom64_ef_r,
163   pecom64_sc_w,
164   pecom64_q_w,
165   NULL,
166   NULL
167};
1/***************************************************************************
2
3        Pecom driver by Miodrag Milanovic
4
5        08/11/2008 Preliminary driver.
6
7****************************************************************************/
8
9#include "driver.h"
10#include "cpu/cdp1802/cdp1802.h"
11#include "video/cdp1869.h"
12#include "devices/cassette.h"
13#include "includes/pecom.h"
14 
15static UINT8 pecom_caps_state = 4;
16static UINT8 pecom_prev_caps_state = 4;
17
18/* Driver initialization */
19DRIVER_INIT(pecom)
20{
21   memset(mess_ram,0,32*1024);
22}
23
24static TIMER_CALLBACK( reset_tick )
25{
26   pecom_state *state = machine->driver_data;
27
28   state->cdp1802_mode = CDP1802_MODE_RUN;
29}
30
31MACHINE_START( pecom )
32{
33   pecom_state *state = machine->driver_data;
34   state->reset_timer = timer_alloc(reset_tick, NULL);
35}
36
37MACHINE_RESET( pecom )
38{
39   UINT8 *rom = memory_region(machine, "main");
40   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
41   
42   pecom_state *state = machine->driver_data;
43   
44   memory_install_write8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_UNMAP);
45   memory_install_write8_handler(space, 0x4000, 0x7fff, 0, 0, SMH_BANK2);
46   memory_install_write8_handler(space, 0xf000, 0xf7ff, 0, 0, SMH_UNMAP);
47   memory_install_write8_handler(space, 0xf800, 0xffff, 0, 0, SMH_UNMAP);
48   memory_install_read8_handler (space, 0xf000, 0xf7ff, 0, 0, SMH_BANK3);
49   memory_install_read8_handler (space, 0xf800, 0xffff, 0, 0, SMH_BANK4);
50   memory_set_bankptr(machine, 1, rom + 0x8000);   
51   memory_set_bankptr(machine, 2, mess_ram + 0x4000);
52   memory_set_bankptr(machine, 3, rom + 0xf000);
53   memory_set_bankptr(machine, 4, rom + 0xf800);
54   
55   pecom_caps_state = 4;
56   pecom_prev_caps_state = 4;
57
58   state->cdp1802_mode = CDP1802_MODE_RESET;
59   state->dma = 0;
60   timer_adjust_oneshot(state->reset_timer, ATTOTIME_IN_MSEC(5), 0);
61}
62
63WRITE8_HANDLER( pecom_bank_w )
64{
65   const device_config *cdp1869 = device_list_find_by_tag(space->machine->config->devicelist, CDP1869_VIDEO, CDP1869_TAG);
66   const address_space *space2 = cpu_get_address_space(space->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
67   UINT8 *rom = memory_region(space->machine, "main");
68   memory_install_write8_handler(cpu_get_address_space(space->machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x3fff, 0, 0, SMH_BANK1);
69   memory_set_bankptr(space->machine, 1, mess_ram + 0x0000);
70     
71   if (data==2) {
72      memory_install_read8_device_handler (space2, cdp1869, 0xf000, 0xf7ff, 0, 0, cdp1869_charram_r);
73      memory_install_write8_device_handler(space2, cdp1869, 0xf000, 0xf7ff, 0, 0, cdp1869_charram_w);
74      memory_install_read8_device_handler (space2, cdp1869, 0xf800, 0xffff, 0, 0, cdp1869_pageram_r);
75      memory_install_write8_device_handler(space2, cdp1869, 0xf800, 0xffff, 0, 0, cdp1869_pageram_w);   
76   } else {
77      memory_install_write8_handler(space2, 0xf000, 0xf7ff, 0, 0, SMH_UNMAP);
78      memory_install_write8_handler(space2, 0xf800, 0xffff, 0, 0, SMH_UNMAP);
79      memory_install_read8_handler (space2, 0xf000, 0xf7ff, 0, 0, SMH_BANK3);
80      memory_install_read8_handler (space2, 0xf800, 0xffff, 0, 0, SMH_BANK4);
81      memory_set_bankptr(space->machine, 3, rom + 0xf000);
82      memory_set_bankptr(space->machine, 4, rom + 0xf800);
83   }
84}
85
86READ8_HANDLER (pecom_keyboard_r)
87{
88   static const char *const keynames[] = {    "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7",
89                              "LINE8", "LINE9", "LINE10", "LINE11", "LINE12", "LINE13", "LINE14", "LINE15", "LINE16",
90                              "LINE17", "LINE18", "LINE19", "LINE20", "LINE21", "LINE22", "LINE23", "LINE24","LINE25" };
91   /*
92      INP command BUS -> M(R(X)) BUS -> D
93      so on each input, address is also set, 8 lower bits are used as input for keyboard
94      Address is available on address bus during reading of value from port, and that is
95      used to determine keyboard line reading
96   */
97   UINT16 addr = cpu_get_reg(space->machine->cpu[0],CDP1802_R0 + cpu_get_reg(space->machine->cpu[0],CDP1802_X));
98   /* just in case somone is reading non existing ports */
99   if (addr<0x7cca || addr>0x7ce3) return 0;
100   return input_port_read(space->machine, keynames[addr - 0x7cca]) & 0x03;
101}
102
103/* CDP1802 Interface */
104static CDP1802_MODE_READ( pecom64_mode_r )
105{
106   pecom_state *state = device->machine->driver_data;
107
108   return state->cdp1802_mode;   
109}
110
111static const device_config *cassette_device_image(running_machine *machine)
112{
113   return devtag_get_device(machine, CASSETTE, "cassette");
114}
115
116static CDP1802_EF_READ( pecom64_ef_r )
117{
118   int flags = 0x0f;
119   double valcas = cassette_input(cassette_device_image(device->machine));
120   UINT8 val = input_port_read(device->machine, "CNT");
121   
122   if ((val & 0x04)==0x04 && pecom_prev_caps_state==0) {
123      pecom_caps_state = (pecom_caps_state==4) ? 0 : 4; // Change CAPS state
124   }
125   pecom_prev_caps_state = val & 0x04;
126   if (valcas!=0.0) { // If there is any cassette signal
127      val = (val & 0x0D); // remove EF2 from SHIFT
128      flags -= EF2;
129      if ( valcas > 0.00) flags += EF2;
130   }   
131   flags -= (val & 0x0b) + pecom_caps_state;
132   return flags;
133}
134
135static CDP1802_Q_WRITE( pecom64_q_w )
136{   
137   cassette_output(cassette_device_image(device->machine), level ? -1.0 : +1.0);
138}
139
140static CDP1802_SC_WRITE( pecom64_sc_w )
141{
142   switch (state)
143   {
144   case CDP1802_STATE_CODE_S0_FETCH:
145      // not connected
146      break;
147
148   case CDP1802_STATE_CODE_S1_EXECUTE:
149      break;
150     
151   case CDP1802_STATE_CODE_S2_DMA:
152      // DMA acknowledge clears the DMAOUT request
153      cpu_set_input_line(device->machine->cpu[0], CDP1802_INPUT_LINE_DMAOUT, CLEAR_LINE);
154      break;
155   case CDP1802_STATE_CODE_S3_INTERRUPT:
156      break;
157   }
158}
159CDP1802_INTERFACE( pecom64_cdp1802_config )
160{
161   pecom64_mode_r,
162   pecom64_ef_r,
163   pecom64_sc_w,
164   pecom64_q_w,
165   NULL,
166   NULL
167};
src/mess/machine/ti99_4x.c
r3712r3713
355355static UINT16 *current_page_ptr;
356356static UINT8 *current_page_ptr_8;
357357/* keep track of cart file types - required for cleanup... */
358typedef enum slot_type_t { SLOT_EMPTY = -1, SLOT_GROM = 0, SLOT_CROM = 1, SLOT_DROM = 2, SLOT_MINIMEM = 3, SLOT_MBX = 4 } slot_type_t;
358typedef enum _slot_type_t { SLOT_EMPTY = -1, SLOT_GROM = 0, SLOT_CROM = 1, SLOT_DROM = 2, SLOT_MINIMEM = 3, SLOT_MBX = 4 } slot_type_t;
359359static slot_type_t slot_type[3] = { SLOT_EMPTY, SLOT_EMPTY, SLOT_EMPTY};
360360
361361/* true if 99/4p rom6 is enabled */
r3712r3713
18571857   UINT32 key_buf;
18581858   UINT8 current_key;
18591859   int i;
1860   static const char *keynames[] = { "KP0", "KP1", "KP2", "KP3", "KP4" };
1860   static const char *const keynames[] = { "KP0", "KP1", "KP2", "KP3", "KP4" };
18611861
18621862   /* read current key state */
18631863   key_buf = ( input_port_read(machine, keynames[num]) | (input_port_read(machine, keynames[num + 1]) << 16) ) >> (4*num);
r3712r3713
22612261{
22622262   running_machine *machine = Machine;
22632263   int answer;
2264   static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3" };
2264   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3" };
22652265
22662266   if ((ti99_model == model_99_4) && (KeyCol == 7))
22672267      answer = (ti99_handset_poll_bus() << 3) | 0x80;
r3712r3713
23052305{
23062306   running_machine *machine = Machine;
23072307   int answer;
2308   static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3" };
2308   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3" };
23092309
23102310   if (/*(ti99_model == model_99_4) &&*/ (KeyCol == 7))
23112311      answer = 0x07;
r3712r3713
24012401{
24022402   running_machine *machine = Machine;
24032403   int answer;
2404   static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6", "KEY7",
2404   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6", "KEY7",
24052405                              "KEY8", "KEY9", "KEY10", "KEY11", "KEY12", "KEY13", "KEY14", "KEY15" };
24062406
24072407   if (has_mecmouse && (KeyCol == 15))
r3712r3713
24352435{
24362436   running_machine *machine = Machine;
24372437   int answer;
2438   static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6", "KEY7",
2438   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6", "KEY7",
24392439                              "KEY8", "KEY9", "KEY10", "KEY11", "KEY12", "KEY13", "KEY14", "KEY15" };
24402440
24412441   if (has_mecmouse && (KeyCol == 15))
src/mess/machine/bbc.c
r3712r3713
767767
768768INTERRUPT_GEN( bbcb_keyscan )
769769{
770   static const char *colnames[] = { "COL0", "COL1", "COL2", "COL3", "COL4",
770   static const char *const colnames[] = { "COL0", "COL1", "COL2", "COL3", "COL4",
771771                              "COL5", "COL6", "COL7", "COL8", "COL9" };
772772   
773773     /* only do auto scan if keyboard is not enabled */
r3712r3713
802802
803803INTERRUPT_GEN( bbcm_keyscan )
804804{
805   static const char *colnames[] = { "COL0", "COL1", "COL2", "COL3", "COL4",
805   static const char *const colnames[] = { "COL0", "COL1", "COL2", "COL3", "COL4",
806806                              "COL5", "COL6", "COL7", "COL8", "COL9" };
807807
808808     /* only do auto scan if keyboard is not enabled */
r3712r3713
839839   int bit;
840840   int row;
841841   int res;
842   static const char *colnames[] = { "COL0", "COL1", "COL2", "COL3", "COL4",
842   static const char *const colnames[] = { "COL0", "COL1", "COL2", "COL3", "COL4",
843843                              "COL5", "COL6", "COL7", "COL8", "COL9" };
844844
845845   column = data & 0x0f;
src/mess/machine/kc.c
r3712r3713
899899static void kc_keyboard_init(running_machine *machine)
900900{
901901   int i;
902   static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6", "KEY7" };
902   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6", "KEY7" };
903903
904904   /* head and tail of list is at beginning */
905905   keyboard_data.head = (keyboard_data.tail = 0);
r3712r3713
10401040static TIMER_CALLBACK(kc_keyboard_update)
10411041{
10421042   int i;
1043   static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6", "KEY7" };
1043   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6", "KEY7" };
10441044
10451045   /* scan all lines (excluding shift) */
10461046   for (i=0; i<KC_KEYBOARD_NUM_LINES-1; i++)
src/mess/drivers/pdp1.c
r3712r3713
369369   pen_typewriter_bg, pen_red
370370};
371371
372static UINT8 total_colors_needed = pen_crt_num_levels + sizeof(pdp1_colors) / 3;
372static const UINT8 total_colors_needed = pen_crt_num_levels + sizeof(pdp1_colors) / 3;
373373
374374static GFXDECODE_START( pdp1 )
375375   GFXDECODE_ENTRY( "gfx1", 0, fontlayout, pen_crt_num_levels + sizeof(pdp1_colors) / 3, 3 )
src/mess/drivers/nc.c
r3712r3713
683683
684684static READ8_HANDLER(nc_key_data_in_r)
685685{
686   static const char *keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4",
686   static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4",
687687                              "LINE5", "LINE6", "LINE7", "LINE8", "LINE9" };
688688
689689   if (offset==9)
src/mess/drivers/sord.c
r3712r3713
311311
312312static READ8_HANDLER ( sord_keyboard_r )
313313{
314   static const char *keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7",
314   static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7",
315315                              "LINE8", "LINE9", "LINE10", "LINE11", "LINE12", "LINE13", "LINE14", "LINE15",
316316                              "RESET"};
317317
src/mess/drivers/z88.c
r3712r3713
7777static TIMER_CALLBACK(z88_rtc_timer_callback)
7878{
7979   int refresh_ints = 0;
80   static const char *keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7" };
80   static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7" };
8181
8282   /* is z88 in snooze state? */
8383   if (blink.z88_state == Z88_SNOOZE)
src/mess/drivers/tmc600.c
r3712r3713
241241   tmc600_state *state = device->machine->driver_data;
242242
243243   int flags = 0x0f;
244   static const char *keynames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
244   static const char *const keynames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
245245
246246   /*
247247        EF1     ?
src/mess/drivers/tm990189.c
r3712r3713
406406static int sys9901_r0(int offset)
407407{
408408   int reply = 0x00;
409   static const char *keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7", "LINE8" };
409   static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7", "LINE8" };
410410
411411   /* keyboard read */
412412   if (digitsel < 9)
src/mess/drivers/pasogo.c
r3712r3713
344344INPUT_PORTS_END
345345
346346/* palette in red, green, blue tribles */
347static unsigned char pasogo_palette[][3] =
347static const unsigned char pasogo_palette[][3] =
348348{
349349   { 0, 0, 0 },
350350   { 45,45,43 },
src/mess/drivers/aquarius.c
r3712r3713
145145
146146   UINT8 keylatch = offset >> 8;
147147   int row;
148   static const char *rownames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7" };
148   static const char *const rownames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7" };
149149
150150   if (keylatch == 0) return 0;
151151
src/mess/drivers/abc80.c
r3712r3713
173173{
174174   abc80_state *state = machine->driver_data;
175175
176   static const char *keynames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6" };
176   static const char *const keynames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6" };
177177   int table = 0, row, col;
178178
179179   if (input_port_read(machine, "ROW7") & 0x07)
src/mess/drivers/x68k.c
r3712r3713
473473static TIMER_CALLBACK(x68k_keyboard_poll)
474474{
475475   int x;
476   static const char *keynames[] = { "key1", "key2", "key3", "key4" };
476   static const char *const keynames[] = { "key1", "key2", "key3", "key4" };
477477
478478   for(x=0;x<0x80;x++)
479479   {
src/mess/drivers/mpf1.c
r3712r3713
303303
304304static READ8_DEVICE_HANDLER( mpf1_porta_r )
305305{
306   static const char *keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5" };
306   static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5" };
307307
308308   UINT8 retval;
309309   for(keycol = 0; keycol < 6; keycol++)
src/mess/drivers/super80.c
r3712r3713
2929static UINT8 mc6845_cursor[16];            // cursor shape
3030static UINT8 mc6845_reg[20];            /* registers */
3131static UINT8 mc6845_ind;            /* register index */
32static UINT8 mc6845_mask[]={0xff,0xff,0xff,0x0f,0x7f,0x1f,0x7f,0x7f,3,0x1f,0x7f,0x1f,0x3f,0xff,0x3f,0xff,0,0};
32static const UINT8 mc6845_mask[]={0xff,0xff,0xff,0x0f,0x7f,0x1f,0x7f,0x7f,3,0x1f,0x7f,0x1f,0x3f,0xff,0x3f,0xff,0,0};
3333
3434#define MASTER_CLOCK         (XTAL_12MHz)
3535#define PIXEL_CLOCK         (MASTER_CLOCK/2)
r3712r3713
359359
360360static READ8_DEVICE_HANDLER( pio_port_b_r )
361361{
362   static const char *keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7" };
362   static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7" };
363363
364364   int bit;
365365   UINT8 data = 0xff;
src/mess/drivers/sg1000.c
r3712r3713
483483
484484static READ8_DEVICE_HANDLER( sc3000_ppi8255_a_r )
485485{
486   static const char *keynames[] = { "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7" };
486   static const char *const keynames[] = { "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7" };
487487
488488   /*
489489        Signal  Description
r3712r3713
503503
504504static READ8_DEVICE_HANDLER( sc3000_ppi8255_b_r )
505505{
506   static const char *keynames[] = { "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7" };
506   static const char *const keynames[] = { "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7" };
507507
508508   /*
509509        Signal  Description
src/mess/drivers/exidy.c
r3712r3713
558558     - tied high, allowing PARIN and PAROUT bios routines to run */
559559
560560   UINT8 data = 0xc0;
561   static const char *keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7",
561   static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7",
562562                              "LINE8", "LINE9", "LINE10", "LINE11", "LINE12", "LINE13", "LINE14", "LINE15" };
563563
564564   /* bit 5 - vsync (inverted) */
src/mess/drivers/pcw.c
r3712r3713
247247/* PCW keyboard is mapped into memory */
248248static  READ8_HANDLER(pcw_keyboard_r)
249249{
250   static const char *keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7",
250   static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7",
251251                              "LINE8", "LINE9", "LINE10", "LINE11", "LINE12", "LINE13", "LINE14", "LINE15" };
252252
253253   return input_port_read(space->machine, keynames[offset]);
src/mess/drivers/bw2.c
r3712r3713
436436   */
437437
438438   UINT8 row;
439   static const char *rownames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7", "ROW8", "ROW9" };
439   static const char *const rownames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7", "ROW8", "ROW9" };
440440
441441   row = keyboard_row;
442442
src/mess/drivers/enterp.c
r3712r3713
120120
121121static void enterprise_dave_reg_read(running_machine *machine, int RegIndex)
122122{
123   static const char *keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4",
123   static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4",
124124                              "LINE5", "LINE6", "LINE7", "LINE8", "LINE9" };
125125   switch (RegIndex)
126126   {
src/mess/drivers/apf.c
r3712r3713
248248   /* bit 7 = ??? */
249249
250250   int keyboard_line;
251   static const char *keynames[] = { "key0", "key1", "key2", "key3", "key4", "key5", "key6", "key7" };
251   static const char *const keynames[] = { "key0", "key1", "key2", "key3", "key4", "key5", "key6", "key7" };
252252
253253   keyboard_line = data & 0x07;
254254   keyboard_data = input_port_read(space->machine, keynames[keyboard_line]);
src/mess/drivers/saturn.c
r3712r3713
479479static void smpc_intbackhelper(running_machine *machine)
480480{
481481   int pad;
482   static const char *padnames[] = { "JOY1", "JOY2" };
482   static const char *const padnames[] = { "JOY1", "JOY2" };
483483
484484   if (intback_stage == 1)
485485   {
src/mess/drivers/abc80x.c
r3712r3713
145145   UINT8 keycode = 0;
146146   UINT8 data;
147147   int table = 0, row, col;
148   static const char *keynames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6" };
148   static const char *const keynames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6" };
149149
150150   // shift, upper case
151151   if (input_port_read(machine, "ROW7") & 0x07)
r3712r3713
884884   return -1;
885885}
886886
887static z80sio_interface sio_intf =
887static const z80sio_interface sio_intf =
888888{
889889   Z80_TAG,            /* cpu */
890890   ABC800_X01/2/2,         /* clock */
src/mess/drivers/tmc2000e.c
r3712r3713
189189   tmc2000e_state *state = device->machine->driver_data;
190190
191191   UINT8 flags = 0x0f;
192   static const char *keynames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
192   static const char *const keynames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
193193
194194   /*
195195        EF1     CDP1864
src/mess/drivers/tmc1800.c
r3712r3713
455455   tmc1800_state *state = device->machine->driver_data;
456456
457457   UINT8 flags = 0x0f;
458   static const char *keynames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
458   static const char *const keynames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
459459
460460   /*
461461        EF1     CDP1861
r3712r3713
540540   tmc2000_state *state = device->machine->driver_data;
541541
542542   int flags = 0x0f;
543   static const char *keynames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
543   static const char *const keynames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
544544
545545   /*
546546        EF1     CDP1864
r3712r3713
651651{
652652   oscnano_state *state = device->machine->driver_data;
653653
654   static const char *keynames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
654   static const char *const keynames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
655655
656656   int flags = 0x0f;
657657
src/mess/drivers/acrnsys1.c
r3712r3713
2525static READ8_DEVICE_HANDLER( ins8154_b1_port_a_r )
2626{
2727   UINT8 data;
28   static const char *keynames[] = { "keyboard_0", "keyboard_1", "keyboard_2", "keyboard_3",
28   static const char *const keynames[] = { "keyboard_0", "keyboard_1", "keyboard_2", "keyboard_3",
2929                              "keyboard_4", "keyboard_5", "keyboard_6", "keyboard_7" };
3030
3131   data = input_port_read(device->machine, keynames[key_digit]);
src/mess/drivers/newbrain.c
r3712r3713
371371   */
372372
373373   newbrain_state *state = space->machine->driver_data;
374   static const char *keynames[] = { "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
374   static const char *const keynames[] = { "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7",
375375                              "D8", "D9", "D10", "D11", "D12", "D13", "D14", "D15" };
376376
377377   /* keyboard row reset */
r3712r3713
11121112   NULL
11131113};
11141114
1115static z80ctc_interface newbrain_ctc_intf =
1115static const z80ctc_interface newbrain_ctc_intf =
11161116{
11171117   Z80_TAG,            /* cpu */
11181118   0,                  /* clock */
src/mess/drivers/einstein.c
r3712r3713
341341{
342342   unsigned char data = 0x0ff;
343343   int i;
344   static const char *keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7" };
344   static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7" };
345345
346346   for (i=0; i<8; i++)
347347   {
r3712r3713
427427   msm8251_receive_clock();
428428}
429429
430static z80ctc_interface   einstein_ctc_intf =
430static const z80ctc_interface einstein_ctc_intf =
431431{
432432   "main",
433433   EINSTEIN_SYSTEM_CLOCK,
r3712r3713
435435   einstein_ctc_interrupt,
436436   einstein_serial_transmit_clock,
437437   einstein_serial_receive_clock,
438    z80ctc_trg3_w
438   z80ctc_trg3_w
439439};
440440
441441static Z80PIO_ON_ARDY_CHANGED( einstein_pio_ardy )
src/mess/drivers/ti99_2.c
r3712r3713
247247/* read keys in the current row */
248248static  READ8_HANDLER ( ti99_2_read_kbd )
249249{
250   static const char *keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7" };
250   static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7" };
251251
252252   return input_port_read(space->machine, keynames[KeyRow]);
253253}
src/mess/drivers/jupiter.c
r3712r3713
292292}
293293
294294
295static cassette_config jupiter_cassette_config =
295static const cassette_config jupiter_cassette_config =
296296{
297297   jupiter_cassette_formats,
298298   NULL,
src/mess/drivers/amstrad.c
r3712r3713
22822282   If keyboard matrix line 11-14 are selected, the byte is always &ff.
22832283   After testing on a real CPC, it is found that these never change, they always return &FF. */
22842284
2285   static const char *keynames[] = { "keyboard_row_0", "keyboard_row_1", "keyboard_row_2", "keyboard_row_3", "keyboard_row_4",
2285   static const char *const keynames[] = { "keyboard_row_0", "keyboard_row_1", "keyboard_row_2", "keyboard_row_3", "keyboard_row_4",
22862286                              "keyboard_row_5", "keyboard_row_6", "keyboard_row_7", "keyboard_row_8", "keyboard_row_9",
22872287                              "keyboard_row_10" };
22882288
src/mess/drivers/avigo.c
r3712r3713
180180   static int ox = 0, oy = 0;
181181   int nx,ny;
182182   int dx, dy;
183   static const char *linenames[] = { "LINE0", "LINE1", "LINE2", "LINE3" };
183   static const char *const linenames[] = { "LINE0", "LINE1", "LINE2", "LINE3" };
184184
185185   for (i = 0; i < 4; i++)
186186   {
r3712r3713
403403{
404404   int i;
405405   unsigned char *addr;
406   static const char *linenames[] = { "LINE0", "LINE1", "LINE2", "LINE3" };
406   static const char *const linenames[] = { "LINE0", "LINE1", "LINE2", "LINE3" };
407407
408408   memset(avigo_banked_opbase, 0, sizeof(avigo_banked_opbase));
409409
src/mess/drivers/psx.c
r3712r3713
199199   int b_data;
200200   int b_ack;
201201   int b_ready;
202   static const char *portnames[] = { "IN0", "IN1", "IN2", "IN3" };
202   static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" };
203203
204204   b_sel = ( n_data & PSX_SIO_OUT_DTR ) / PSX_SIO_OUT_DTR;
205205   b_clock = ( n_data & PSX_SIO_OUT_CLOCK ) / PSX_SIO_OUT_CLOCK;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team