| 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 |
| r3712 | r3713 | |
|---|---|---|
| 31 | 31 | ***************************************************************************/ |
| 32 | 32 | |
| 33 | 33 | /* base colors */ |
| 34 | static int hp48_bg_color[3] = { 136, 147, 109 }; /* yellow */ | |
| 35 | static int hp48_fg_color[3] = { 0, 0, 64 }; /* dark blue */ | |
| 34 | static const int hp48_bg_color[3] = { 136, 147, 109 }; /* yellow */ | |
| 35 | static const int hp48_fg_color[3] = { 0, 0, 64 }; /* dark blue */ | |
| 36 | 36 | |
| 37 | 37 | /* color mixing */ |
| 38 | 38 | #define mix(c1,c2,x) (c1)*(1-(x))+(c2)*(x) |
| r3712 | r3713 | |
|---|---|---|
| 576 | 576 | modifier_state_t modifier_state; |
| 577 | 577 | int repeat_mode; |
| 578 | 578 | |
| 579 | static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5" }; | |
| 579 | static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5" }; | |
| 580 | 580 | |
| 581 | 581 | /* read current key state */ |
| 582 | 582 | for (i = 0; i < 6; i++) |
| r3712 | r3713 | |
|---|---|---|
| 103 | 103 | int bit = (offs >> 4) & 7; |
| 104 | 104 | int extra = input_port_read(machine, "EXTRA"); |
| 105 | 105 | 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" }; | |
| 107 | 107 | |
| 108 | 108 | |
| 109 | 109 | data = (input_port_read(machine, keynames[port]) >> bit) & 1; |
| r3712 | r3713 | |
|---|---|---|
| 54 | 54 | { |
| 55 | 55 | int width = video_screen_get_width(screen); |
| 56 | 56 | int x, y; |
| 57 | static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3" }; | |
| 57 | static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3" }; | |
| 58 | 58 | |
| 59 | 59 | for (x = 0; x < 6; x++) |
| 60 | 60 | { |
| r3712 | r3713 | |
|---|---|---|
| 10 | 10 | #include "driver.h" |
| 11 | 11 | #include "includes/sapi1.h" |
| 12 | 12 | |
| 13 | UINT8 MHB2501[] = { | |
| 13 | static const UINT8 MHB2501[] = { | |
| 14 | 14 | 0x0c,0x11,0x13,0x15,0x17,0x10,0x0e,0x00, // @ |
| 15 | 15 | 0x04,0x0a,0x11,0x11,0x1f,0x11,0x11,0x00, // A |
| 16 | 16 | 0x1e,0x11,0x11,0x1e,0x11,0x11,0x1e,0x00, // B |
| r3712 | r3713 | |
|---|---|---|
| 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 | ||
| 14 | 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 | ||
| 25 | 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 */ | |
| 37 | VIDEO_START( mz80k ) | |
| 38 | { | |
| 39 | } | |
| 40 | ||
| 41 | VIDEO_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 | ||
| 14 | const 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 | ||
| 25 | const 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 */ | |
| 37 | VIDEO_START( mz80k ) | |
| 38 | { | |
| 39 | } | |
| 40 | ||
| 41 | VIDEO_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 | } |
| r3712 | r3713 | |
|---|---|---|
| 625 | 625 | modifier_state_t modifier_state; |
| 626 | 626 | int repeat_mode; |
| 627 | 627 | |
| 628 | static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3" }; | |
| 628 | static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3" }; | |
| 629 | 629 | |
| 630 | 630 | /* read current key state */ |
| 631 | 631 | /* 2008-05 FP: in 733_asr.h there are only 4 input ports defined... */ |
| r3712 | r3713 | |
|---|---|---|
| 533 | 533 | } |
| 534 | 534 | |
| 535 | 535 | |
| 536 | static struct m6845_interface | |
| 537 | BBC6845= { | |
| 536 | static const struct m6845_interface BBC6845 = | |
| 537 | { | |
| 538 | 538 | 0,// Memory Address register |
| 539 | 539 | BBC_Set_Character_Row,// Row Address register |
| 540 | 540 | BBC_Set_HSync,// Horizontal status |
| r3712 | r3713 | |
|---|---|---|
| 62 | 62 | |
| 63 | 63 | struct hp48_port_config; |
| 64 | 64 | |
| 65 | extern struct hp48_port_config hp48sx_port1_config; | |
| 66 | extern struct hp48_port_config hp48sx_port2_config; | |
| 67 | extern struct hp48_port_config hp48gx_port1_config; | |
| 68 | extern struct hp48_port_config hp48gx_port2_config; | |
| 65 | extern const struct hp48_port_config hp48sx_port1_config; | |
| 66 | extern const struct hp48_port_config hp48sx_port2_config; | |
| 67 | extern const struct hp48_port_config hp48gx_port1_config; | |
| 68 | extern const struct hp48_port_config hp48gx_port2_config; | |
| 69 | 69 | |
| 70 | 70 | extern DEVICE_GET_INFO( hp48_port ); |
| 71 | 71 |
| r3712 | r3713 | |
|---|---|---|
| 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 | ||
| 12 | extern DRIVER_INIT( mz80k ); | |
| 13 | extern MACHINE_RESET( mz80k ); | |
| 14 | extern READ8_HANDLER( mz80k_strobe_r ); | |
| 15 | extern WRITE8_HANDLER( mz80k_strobe_w ); | |
| 16 | ||
| 17 | extern ppi8255_interface mz80k_8255_int; | |
| 18 | extern struct pit8253_config mz80k_pit8253_config; | |
| 19 | ||
| 20 | extern UINT8 mz80k_vertical; | |
| 21 | extern UINT8 mz80k_cursor_cnt; | |
| 22 | ||
| 23 | /*----------- defined in video/mz80.c -----------*/ | |
| 24 | ||
| 25 | extern gfx_layout mz80k_charlayout; | |
| 26 | extern gfx_layout mz80kj_charlayout; | |
| 27 | ||
| 28 | extern VIDEO_START( mz80k ); | |
| 29 | extern 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 | ||
| 12 | extern DRIVER_INIT( mz80k ); | |
| 13 | extern MACHINE_RESET( mz80k ); | |
| 14 | extern READ8_HANDLER( mz80k_strobe_r ); | |
| 15 | extern WRITE8_HANDLER( mz80k_strobe_w ); | |
| 16 | ||
| 17 | extern const ppi8255_interface mz80k_8255_int; | |
| 18 | extern const struct pit8253_config mz80k_pit8253_config; | |
| 19 | ||
| 20 | extern UINT8 mz80k_vertical; | |
| 21 | extern UINT8 mz80k_cursor_cnt; | |
| 22 | ||
| 23 | /*----------- defined in video/mz80.c -----------*/ | |
| 24 | ||
| 25 | extern const gfx_layout mz80k_charlayout; | |
| 26 | extern const gfx_layout mz80kj_charlayout; | |
| 27 | ||
| 28 | extern VIDEO_START( mz80k ); | |
| 29 | extern VIDEO_UPDATE( mz80k ); | |
| 30 | ||
| 31 | #endif /* MZ80_H_ */ |
| r3712 | r3713 | |
|---|---|---|
| 541 | 541 | int RetVal; |
| 542 | 542 | int Idx; |
| 543 | 543 | int Selected; |
| 544 | static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", | |
| 544 | static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", | |
| 545 | 545 | "KEY5", "KEY6", "KEY7", "KEY8", "KEY9" }; |
| 546 | 546 | |
| 547 | 547 | LOG_KEYBOARD(("PB Read\n")); |
| r3712 | r3713 | |
| 967 | 967 | #if 0 |
| 968 | 968 | int Idx; |
| 969 | 969 | int Row; |
| 970 | static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", | |
| 970 | static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", | |
| 971 | 971 | "KEY5", "KEY6", "KEY7", "KEY8", "KEY9" }; |
| 972 | 972 | |
| 973 | 973 | LOG_KEYBOARD(("Scanning Host keyboard\n")); |
| r3712 | r3713 | |
|---|---|---|
| 1259 | 1259 | static int old_typewriter_keys[4]; |
| 1260 | 1260 | |
| 1261 | 1261 | int typewriter_transitions; |
| 1262 | static const char *twrnames[] = { "TWR0", "TWR1", "TWR2", "TWR3" }; | |
| 1262 | static const char *const twrnames[] = { "TWR0", "TWR1", "TWR2", "TWR3" }; | |
| 1263 | 1263 | |
| 1264 | 1264 | |
| 1265 | 1265 | for (i=0; i<4; i++) |
| r3712 | r3713 | |
|---|---|---|
| 101 | 101 | /* from highest to lowest priority: HDW, NCE2, CE1, CE2, NCE3, NCE1 */ |
| 102 | 102 | static hp48_module hp48_modules[6]; |
| 103 | 103 | |
| 104 | static const char* hp48_module_names[6] = | |
| 104 | static const char *const hp48_module_names[6] = | |
| 105 | 105 | { "HDW (I/O)", "NCE2 (RAM)", "CE1", "CE2", "NCE3", "NCE1 (ROM)" }; |
| 106 | 106 | |
| 107 | 107 | /* values returned by C=ID */ |
| r3712 | r3713 | |
| 989 | 989 | /* ----- card images ------ */ |
| 990 | 990 | |
| 991 | 991 | /* port information configurations */ |
| 992 | struct hp48_port_config hp48sx_port1_config = { 0, 2, 128*1024, "p1", "port1" }; | |
| 993 | struct hp48_port_config hp48sx_port2_config = { 1, 3, 128*1024, "p2", "port2" }; | |
| 994 | struct hp48_port_config hp48gx_port1_config = { 0, 3, 128*1024, "p1", "port1" }; | |
| 995 | struct hp48_port_config hp48gx_port2_config = { 1, 4, 4*1024*1024, "p2", "port2" }; | |
| 992 | const struct hp48_port_config hp48sx_port1_config = { 0, 2, 128*1024, "p1", "port1" }; | |
| 993 | const struct hp48_port_config hp48sx_port2_config = { 1, 3, 128*1024, "p2", "port2" }; | |
| 994 | const struct hp48_port_config hp48gx_port1_config = { 0, 3, 128*1024, "p1", "port1" }; | |
| 995 | const struct hp48_port_config hp48gx_port2_config = { 1, 4, 4*1024*1024, "p2", "port2" }; | |
| 996 | 996 | |
| 997 | 997 | /* helper for load and create */ |
| 998 | 998 | static void hp48_fill_port( const device_config* image ) |
| r3712 | r3713 | |
|---|---|---|
| 62 | 62 | { |
| 63 | 63 | UINT8 data = 0x00; |
| 64 | 64 | 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" }; | |
| 66 | 66 | |
| 67 | 67 | for (i = 0; i < 8; i++) |
| 68 | 68 | { |
| r3712 | r3713 | |
|---|---|---|
| 133 | 133 | |
| 134 | 134 | UINT8 aim65_riot_b_r(const device_config *device, UINT8 olddata) |
| 135 | 135 | { |
| 136 | static const char *keynames[] = | |
| 136 | static const char *const keynames[] = | |
| 137 | 137 | { |
| 138 | 138 | "keyboard_0", "keyboard_1", "keyboard_2", "keyboard_3", |
| 139 | 139 | "keyboard_4", "keyboard_5", "keyboard_6", "keyboard_7" |
| r3712 | r3713 | |
|---|---|---|
| 677 | 677 | int keyline = pia_get_output_b( THOM_PIA_SYS ); |
| 678 | 678 | UINT8 val = 0xff; |
| 679 | 679 | 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", | |
| 681 | 681 | "keyboard_4", "keyboard_5", "keyboard_6", "keyboard_7" }; |
| 682 | 682 | |
| 683 | 683 | for ( i = 0; i < 8; i++ ) |
| r3712 | r3713 | |
| 1570 | 1570 | static READ8_HANDLER ( to770_sys_porta_in ) |
| 1571 | 1571 | { |
| 1572 | 1572 | /* 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", | |
| 1574 | 1574 | "keyboard_4", "keyboard_5", "keyboard_6", "keyboard_7" }; |
| 1575 | 1575 | int keyline = pia_get_output_b( THOM_PIA_SYS ) & 7; |
| 1576 | 1576 | |
| r3712 | r3713 | |
| 1873 | 1873 | UINT8 portb = pia_get_output_b( THOM_PIA_SYS ); |
| 1874 | 1874 | int col = (portb >> 1) & 7; /* key column */ |
| 1875 | 1875 | 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", | |
| 1877 | 1877 | "keyboard_4", "keyboard_5", "keyboard_6", "keyboard_7" }; |
| 1878 | 1878 | |
| 1879 | 1879 | return ( input_port_read(space->machine, keynames[lin]) & (1 << col) ) ? 0x80 : 0; |
| r3712 | r3713 | |
| 2537 | 2537 | { |
| 2538 | 2538 | int line, bit; |
| 2539 | 2539 | 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", | |
| 2541 | 2541 | "keyboard_5", "keyboard_6", "keyboard_7", "keyboard_8", "keyboard_9" }; |
| 2542 | 2542 | |
| 2543 | 2543 | for ( line = 0; line < 10; line++ ) |
| r3712 | r3713 | |
| 2771 | 2771 | int shift = ! (input_port_read(Machine, "keyboard_9") & 1); |
| 2772 | 2772 | int key = -1, line, bit; |
| 2773 | 2773 | 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", | |
| 2775 | 2775 | "keyboard_5", "keyboard_6", "keyboard_7", "keyboard_8", "keyboard_9" }; |
| 2776 | 2776 | |
| 2777 | 2777 | for ( line = 0; line < 10; line++ ) |
| r3712 | r3713 | |
| 3180 | 3180 | { |
| 3181 | 3181 | int line, bit; |
| 3182 | 3182 | 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", | |
| 3184 | 3184 | "keyboard_5", "keyboard_6", "keyboard_7", "keyboard_8", "keyboard_9" }; |
| 3185 | 3185 | |
| 3186 | 3186 | if ( input_port_read(machine, "config") & 2 ) |
| r3712 | r3713 | |
| 3212 | 3212 | int shift = (input_port_read(machine, "keyboard_9") & 1) ? 0 : 0x080; |
| 3213 | 3213 | int key = -1, line, bit; |
| 3214 | 3214 | 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", | |
| 3216 | 3216 | "keyboard_5", "keyboard_6", "keyboard_7", "keyboard_8", "keyboard_9" }; |
| 3217 | 3217 | |
| 3218 | 3218 | if ( input_port_read(machine, "config") & 2 ) |
| r3712 | r3713 | |
| 4534 | 4534 | UINT8 portb = pia_get_output_b( THOM_PIA_SYS ); |
| 4535 | 4535 | int col = (portb >> 4) & 7; /* B bits 4-6: kbd column */ |
| 4536 | 4536 | 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", | |
| 4538 | 4538 | "keyboard_5", "keyboard_6", "keyboard_7", "keyboard_8", "keyboard_9" }; |
| 4539 | 4539 | |
| 4540 | 4540 | if ( ! (porta & 8) ) |
| r3712 | r3713 | |
| 4958 | 4958 | UINT8 portb = pia_get_output_b( THOM_PIA_SYS ); |
| 4959 | 4959 | int col = (portb >> 4) & 7; /* B bits 4-6: kbd column */ |
| 4960 | 4960 | 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", | |
| 4962 | 4962 | "keyboard_4", "keyboard_5", "keyboard_6", "keyboard_7" }; |
| 4963 | 4963 | |
| 4964 | 4964 | return ( input_port_read(space->machine, keynames[lin]) & (1 << col) ) ? 0x80 : 0; |
| r3712 | r3713 | |
|---|---|---|
| 143 | 143 | static void detect_keypress(const device_config *device) |
| 144 | 144 | { |
| 145 | 145 | 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" }; | |
| 147 | 147 | |
| 148 | 148 | if (input_port_read(device->machine, keynames[cdp1871->drive]) == (1 << cdp1871->sense)) |
| 149 | 149 | { |
| r3712 | r3713 | |
|---|---|---|
| 241 | 241 | |
| 242 | 242 | static READ8_DEVICE_HANDLER ( pmd85_ppi_0_portb_r ) |
| 243 | 243 | { |
| 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", | |
| 245 | 245 | "KEY8", "KEY9", "KEY10", "KEY11", "KEY12", "KEY13", "KEY14", "KEY15" }; |
| 246 | 246 | |
| 247 | 247 | return input_port_read(device->machine, keynames[(pmd85_ppi_port_outputs[0][0] & 0x0f)]) & input_port_read(device->machine, "KEY15"); |
| r3712 | r3713 | |
| 281 | 281 | { |
| 282 | 282 | int i; |
| 283 | 283 | 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" }; | |
| 285 | 285 | |
| 286 | 286 | for (i = 0; i < 8; i++) |
| 287 | 287 | { |
| r3712 | r3713 | |
|---|---|---|
| 20 | 20 | |
| 21 | 21 | READ8_DEVICE_HANDLER (kramermc_port_b_r) |
| 22 | 22 | { |
| 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" }; | |
| 24 | 24 | |
| 25 | 25 | return input_port_read(device->machine, keynames[kramermc_key_row]); |
| 26 | 26 | } |
| r3712 | r3713 | |
|---|---|---|
| 1120 | 1120 | |
| 1121 | 1121 | int typewriter_transitions; |
| 1122 | 1122 | int charcode, lr; |
| 1123 | static const char *twrnames[] = { "TWR0", "TWR1", "TWR2", "TWR3" }; | |
| 1123 | static const char *const twrnames[] = { "TWR0", "TWR1", "TWR2", "TWR3" }; | |
| 1124 | 1124 | |
| 1125 | 1125 | for (i=0; i<4; i++) |
| 1126 | 1126 | { |
| r3712 | r3713 | |
|---|---|---|
| 367 | 367 | |
| 368 | 368 | static unsigned int time_until_repeat = MAGIC_KEY_REPEAT_NUMBER; |
| 369 | 369 | |
| 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", | |
| 371 | 371 | "keypad_1", "keypad_2" }; |
| 372 | 372 | |
| 373 | 373 | /* check for these special cases because they affect the emulated key codes */ |
| r3712 | r3713 | |
|---|---|---|
| 42 | 42 | |
| 43 | 43 | READ8_HANDLER ( p2000t_port_000f_r ) |
| 44 | 44 | { |
| 45 | static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", | |
| 45 | static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", | |
| 46 | 46 | "KEY5", "KEY6", "KEY7", "KEY8", "KEY9" }; |
| 47 | 47 | |
| 48 | 48 | if (p2000t_ports.port_101f & P2000M_101F_KEYINT) |
| r3712 | r3713 | |
|---|---|---|
| 106 | 106 | static READ8_HANDLER ( pet_pia0_port_b_read ) |
| 107 | 107 | { |
| 108 | 108 | UINT8 data = 0xff; |
| 109 | static const char *keynames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", | |
| 109 | static const char *const keynames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", | |
| 110 | 110 | "ROW5", "ROW6", "ROW7", "ROW8", "ROW9" }; |
| 111 | 111 | |
| 112 | 112 | if (pet_keyline_select < 10) |
| r3712 | r3713 | |
| 123 | 123 | static READ8_HANDLER( petb_pia0_port_b_read ) |
| 124 | 124 | { |
| 125 | 125 | UINT8 data = 0xff; |
| 126 | static const char *keynames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", | |
| 126 | static const char *const keynames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", | |
| 127 | 127 | "ROW5", "ROW6", "ROW7", "ROW8", "ROW9" }; |
| 128 | 128 | |
| 129 | 129 | if (pet_keyline_select < 10) |
| r3712 | r3713 | |
|---|---|---|
| 600 | 600 | INTERRUPT_GEN( c16_frame_interrupt ) |
| 601 | 601 | { |
| 602 | 602 | 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" }; | |
| 604 | 604 | |
| 605 | 605 | /* Lines 0-7 : common keyboard */ |
| 606 | 606 | for (i = 0; i < 8; i++) |
| r3712 | r3713 | |
|---|---|---|
| 119 | 119 | |
| 120 | 120 | /* what if data is 0, can it sense if any of the keys on a line are pressed? */ |
| 121 | 121 | 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" }; | |
| 123 | 123 | |
| 124 | 124 | input_port_data = input_port_read(machine, keynames[oric_keyboard_line]); |
| 125 | 125 |
| r3712 | r3713 | |
|---|---|---|
| 23 | 23 | |
| 24 | 24 | READ8_HANDLER( galeb_keyboard_r ) |
| 25 | 25 | { |
| 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" }; | |
| 27 | 27 | |
| 28 | 28 | return input_port_read(space->machine, keynames[offset]); |
| 29 | 29 | } |
| r3712 | r3713 | |
|---|---|---|
| 98 | 98 | { |
| 99 | 99 | UINT8 data = 0; |
| 100 | 100 | 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", | |
| 102 | 102 | "LINE7", "LINE8", "LINE9", "LINE10", "LINE11", "LINE12", "LINE13" }; |
| 103 | 103 | |
| 104 | 104 | //logerror( "PC=%04x: keyboard read from paged rom area, address: %04x", activecpu_get_pc(), offset ); |
| r3712 | r3713 | |
|---|---|---|
| 39 | 39 | irisha_keypressed = 0; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | static const char *keynames[] = { | |
| 42 | static const char *const keynames[] = { | |
| 43 | 43 | "LINE0", "LINE1", "LINE2", "LINE3", |
| 44 | 44 | "LINE4", "LINE5", "LINE6", "LINE7", |
| 45 | 45 | "LINE8", "LINE9"}; |
| r3712 | r3713 | |
|---|---|---|
| 22 | 22 | static TIMER_CALLBACK(keyboard_callback) |
| 23 | 23 | { |
| 24 | 24 | 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", | |
| 26 | 26 | "LINE7", "LINE8", "LINE9", "LINE10", "LINE11" }; |
| 27 | 27 | |
| 28 | 28 | for(i = 1; i < 12; i++) |
| r3712 | r3713 | |
|---|---|---|
| 151 | 151 | |
| 152 | 152 | READ8_HANDLER ( nascom1_port_00_r ) |
| 153 | 153 | { |
| 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" }; | |
| 155 | 155 | |
| 156 | 156 | if (nascom1_portstat.stat_count < 9) |
| 157 | 157 | return (input_port_read(space->machine, keynames[nascom1_portstat.stat_count]) | ~0x7f); |
| r3712 | r3713 | |
|---|---|---|
| 608 | 608 | { |
| 609 | 609 | int mod, row, col, chg, new; |
| 610 | 610 | 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" }; | |
| 612 | 612 | |
| 613 | 613 | if( repeat ) |
| 614 | 614 | { |
| r3712 | r3713 | |
| 923 | 923 | MACHINE_RESET( microtan ) |
| 924 | 924 | { |
| 925 | 925 | 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" }; | |
| 927 | 927 | |
| 928 | 928 | for (i = 1; i < 10; i++) |
| 929 | 929 | { |
| r3712 | r3713 | |
|---|---|---|
| 484 | 484 | static int cassette_bit = 0; |
| 485 | 485 | int row, data = 0xff; |
| 486 | 486 | 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", | |
| 488 | 488 | "keyboard_4", "keyboard_5", "keyboard_6", "keyboard_7" }; |
| 489 | 489 | |
| 490 | 490 | /* scan keyboard rows */ |
| r3712 | r3713 | |
| 528 | 528 | /* cassette data bits toggle? */ |
| 529 | 529 | if ((vtech1_latch ^ data ) & 0x06) |
| 530 | 530 | { |
| 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 }; | |
| 532 | 532 | cassette_output(cassette_device_image(space->machine), amp[(data >> 1) & 3]); |
| 533 | 533 | } |
| 534 | 534 |
| r3712 | r3713 | |
|---|---|---|
| 29 | 29 | static UINT8 *sms_banking_bios[5]; /* we are going to use 1-4, same as bank numbers */ |
| 30 | 30 | static UINT8 *sms_banking_cart[5]; /* we are going to use 1-4, same as bank numbers */ |
| 31 | 31 | static UINT8 *sms_banking_none[5]; /* we are going to use 1-4, same as bank numbers */ |
| 32 | static UINT8 ggSIO[5] | |
| 32 | static UINT8 ggSIO[5] | |
| 33 | 33 | static UINT8 sms_store_control = 0; |
| 34 | 34 | |
| 35 | 35 | static UINT8 sms_input_port0; |
| r3712 | r3713 | |
|---|---|---|
| 322 | 322 | static void get_active_bank(running_machine *machine, UINT8 data) |
| 323 | 323 | { |
| 324 | 324 | 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" }; | |
| 326 | 326 | |
| 327 | 327 | if (expansion_box_installed(machine)) |
| 328 | 328 | { |
| r3712 | r3713 | |
|---|---|---|
| 148 | 148 | { |
| 149 | 149 | UINT8 h = 0xFF; |
| 150 | 150 | 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" }; | |
| 152 | 152 | |
| 153 | 153 | if (!(p1 & P1_KEYBOARD_SCAN_ENABLE)) |
| 154 | 154 | { |
| r3712 | r3713 | |
|---|---|---|
| 81 | 81 | READ8_HANDLER( primo_be_1_r ) |
| 82 | 82 | { |
| 83 | 83 | UINT8 data = 0x00; |
| 84 | static const char *portnames[] = { "IN0", "IN1", "IN2", "IN3" }; | |
| 84 | static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" }; | |
| 85 | 85 | |
| 86 | 86 | // bit 7, 6 - not used |
| 87 | 87 |
| r3712 | r3713 | |
|---|---|---|
| 296 | 296 | int data = 0xff; |
| 297 | 297 | int port; |
| 298 | 298 | 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" }; | |
| 300 | 300 | |
| 301 | 301 | if (ti85_keypad_mask == 0x7f) return data; |
| 302 | 302 |
| r3712 | r3713 | |
|---|---|---|
| 191 | 191 | static READ8_DEVICE_HANDLER ( svi318_ppi_port_b_r ) |
| 192 | 192 | { |
| 193 | 193 | 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", | |
| 195 | 195 | "LINE6", "LINE7", "LINE8", "LINE9", "LINE10" }; |
| 196 | 196 | |
| 197 | 197 | row = svi.keyboard_row; |
| r3712 | r3713 | |
|---|---|---|
| 18 | 18 | |
| 19 | 19 | READ8_HANDLER( galaxy_keyboard_r ) |
| 20 | 20 | { |
| 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" }; | |
| 22 | 22 | |
| 23 | 23 | if (offset == 0) |
| 24 | 24 | { |
| r3712 | r3713 | |
|---|---|---|
| 230 | 230 | UINT8 icol; |
| 231 | 231 | UINT16 data; |
| 232 | 232 | 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" }; | |
| 234 | 234 | |
| 235 | 235 | key_code = 0; |
| 236 | 236 | key_status = 0x80; |
| r3712 | r3713 | |
|---|---|---|
| 1173 | 1173 | // hard_disk_file object |
| 1174 | 1174 | // |
| 1175 | 1175 | static hard_disk_file *corvus_hdc_file(running_machine *machine, int id) { |
| 1176 | const char *tags[] = { | |
| 1176 | static const char *const tags[] = { | |
| 1177 | 1177 | "harddisk1" |
| 1178 | 1178 | }; |
| 1179 | 1179 | const device_config *img; |
| r3712 | r3713 | |
|---|---|---|
| 380 | 380 | int i, j; |
| 381 | 381 | int keybuf; |
| 382 | 382 | 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" }; | |
| 384 | 384 | |
| 385 | 385 | if (keycode_buf_index) |
| 386 | 386 | { |
| r3712 | r3713 | |
|---|---|---|
| 306 | 306 | static void nes_read_input_device(running_machine *machine, int cfg, nes_input *vals, int pad_port, |
| 307 | 307 | int supports_zapper, int paddle_port) |
| 308 | 308 | { |
| 309 | static const char *padnames[] = { "PAD1", "PAD2", "PAD3", "PAD4" }; | |
| 309 | static const char *const padnames[] = { "PAD1", "PAD2", "PAD3", "PAD4" }; | |
| 310 | 310 | |
| 311 | 311 | vals->i0 = 0; |
| 312 | 312 | vals->i1 = 0; |
| r3712 | r3713 | |
|---|---|---|
| 174 | 174 | UINT32 key_transitions; |
| 175 | 175 | int i, j; |
| 176 | 176 | 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" }; | |
| 178 | 178 | |
| 179 | 179 | for(i = 0; (i < /*4*/3) && (KeyQueueLen <= (KeyQueueSize-MaxKeyMessageLen)); i++) |
| 180 | 180 | { |
| r3712 | r3713 | |
|---|---|---|
| 730 | 730 | { |
| 731 | 731 | UINT8 result = 0xff; |
| 732 | 732 | 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" }; | |
| 734 | 734 | |
| 735 | 735 | row = ppi8255_r(device, 2) & 0x0f; |
| 736 | 736 | if (row <= 10) |
| r3712 | r3713 | |
|---|---|---|
| 138 | 138 | static READ8_DEVICE_HANDLER ( pio_port_b_r ) |
| 139 | 139 | { |
| 140 | 140 | 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", | |
| 142 | 142 | "ROW6", "ROW7", "ROW8", "ROW9", "ROW10" }; |
| 143 | 143 | |
| 144 | 144 | demux_LS145 = pio_port_a_output & 15; |
| r3712 | r3713 | |
|---|---|---|
| 227 | 227 | READ8_HANDLER(v_via_pb_r) |
| 228 | 228 | { |
| 229 | 229 | int pot; |
| 230 | static const char *ctrlnames[] = { "CONTR1X", "CONTR1Y", "CONTR2X", "CONTR2Y" }; | |
| 230 | static const char *const ctrlnames[] = { "CONTR1X", "CONTR1Y", "CONTR2X", "CONTR2Y" }; | |
| 231 | 231 | |
| 232 | 232 | pot = input_port_read(space->machine, ctrlnames[(vectrex_via_out[PORTB] & 0x6) >> 1]) - 0x80; |
| 233 | 233 |
| r3712 | r3713 | |
|---|---|---|
| 395 | 395 | int i, j; |
| 396 | 396 | int keybuf; |
| 397 | 397 | 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" }; | |
| 399 | 399 | |
| 400 | 400 | if (! COPS_force_unplug) |
| 401 | 401 | for (i=0; i<8; i++) |
| r3712 | r3713 | |
|---|---|---|
| 1037 | 1037 | int i, j; |
| 1038 | 1038 | int keycode; |
| 1039 | 1039 | 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" }; | |
| 1041 | 1041 | |
| 1042 | 1042 | static const UINT8 keyboard_mf1_code[0xe] = |
| 1043 | 1043 | { |
| r3712 | r3713 | |
|---|---|---|
| 356 | 356 | READ8_DEVICE_HANDLER ( atom_8255_portb_r ) |
| 357 | 357 | { |
| 358 | 358 | 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", | |
| 360 | 360 | "KEY6", "KEY7", "KEY8", "KEY9", "KEY10", "KEY11" }; |
| 361 | 361 | |
| 362 | 362 | row = atom_8255_porta & 0x0f; |
| r3712 | r3713 | |
|---|---|---|
| 289 | 289 | int port, bit; |
| 290 | 290 | int key_pressed; |
| 291 | 291 | UINT32 shiftkeys, ctrlkeys; |
| 292 | static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3" }; | |
| 292 | static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3" }; | |
| 293 | 293 | |
| 294 | 294 | /* This holds the values of all the input ports for ordinary keys |
| 295 | 295 | seen during the last scan. */ |
| r3712 | r3713 | |
|---|---|---|
| 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 | ||
| 16 | UINT8 mz80k_tempo_strobe = 0; | |
| 17 | UINT8 mz80k_8255_portc = 0; | |
| 18 | UINT8 mz80k_vertical = 0; | |
| 19 | UINT8 mz80k_cursor_cnt = 0; | |
| 20 | UINT8 mz80k_keyboard_line = 0; | |
| 21 | ||
| 22 | ||
| 23 | /* Driver initialization */ | |
| 24 | DRIVER_INIT(mz80k) | |
| 25 | { | |
| 26 | } | |
| 27 | ||
| 28 | ||
| 29 | MACHINE_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 | ||
| 39 | READ8_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 | ||
| 49 | READ8_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 | ||
| 62 | WRITE8_DEVICE_HANDLER(mz80k_8255_porta_w) | |
| 63 | { | |
| 64 | mz80k_keyboard_line = data & 0x0f; | |
| 65 | } | |
| 66 | ||
| 67 | WRITE8_DEVICE_HANDLER(mz80k_8255_portc_w) | |
| 68 | { | |
| 69 | // logerror("mz80k_8255_portc_w %02x\n",data); | |
| 70 | } | |
| 71 | ||
| 72 | static PIT8253_OUTPUT_CHANGED( pit_out0_changed ) | |
| 73 | { | |
| 74 | speaker_level_w( 0, state ? 1 : 0 ); | |
| 75 | } | |
| 76 | ||
| 77 | ||
| 78 | static PIT8253_OUTPUT_CHANGED( pit_out1_changed ) | |
| 79 | { | |
| 80 | pit8253_set_clock_signal( device, 2, state ); | |
| 81 | } | |
| 82 | ||
| 83 | ||
| 84 | static PIT8253_OUTPUT_CHANGED( pit_out2_changed ) | |
| 85 | { | |
| 86 | cpu_set_input_line(device->machine->cpu[0], 0, HOLD_LINE); | |
| 87 | } | |
| 88 | ||
| 89 | 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 | ||
| 99 | 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 | ||
| 109 | READ8_HANDLER(mz80k_strobe_r) | |
| 110 | { | |
| 111 | mz80k_tempo_strobe^=1; | |
| 112 | return(0x7e | mz80k_tempo_strobe); | |
| 113 | } | |
| 114 | WRITE8_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 | ||
| 16 | UINT8 mz80k_tempo_strobe = 0; | |
| 17 | UINT8 mz80k_8255_portc = 0; | |
| 18 | UINT8 mz80k_vertical = 0; | |
| 19 | UINT8 mz80k_cursor_cnt = 0; | |
| 20 | UINT8 mz80k_keyboard_line = 0; | |
| 21 | ||
| 22 | ||
| 23 | /* Driver initialization */ | |
| 24 | DRIVER_INIT(mz80k) | |
| 25 | { | |
| 26 | } | |
| 27 | ||
| 28 | ||
| 29 | MACHINE_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 | ||
| 39 | READ8_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 | ||
| 49 | READ8_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 | ||
| 62 | WRITE8_DEVICE_HANDLER(mz80k_8255_porta_w) | |
| 63 | { | |
| 64 | mz80k_keyboard_line = data & 0x0f; | |
| 65 | } | |
| 66 | ||
| 67 | WRITE8_DEVICE_HANDLER(mz80k_8255_portc_w) | |
| 68 | { | |
| 69 | // logerror("mz80k_8255_portc_w %02x\n",data); | |
| 70 | } | |
| 71 | ||
| 72 | static PIT8253_OUTPUT_CHANGED( pit_out0_changed ) | |
| 73 | { | |
| 74 | speaker_level_w( 0, state ? 1 : 0 ); | |
| 75 | } | |
| 76 | ||
| 77 | ||
| 78 | static PIT8253_OUTPUT_CHANGED( pit_out1_changed ) | |
| 79 | { | |
| 80 | pit8253_set_clock_signal( device, 2, state ); | |
| 81 | } | |
| 82 | ||
| 83 | ||
| 84 | static PIT8253_OUTPUT_CHANGED( pit_out2_changed ) | |
| 85 | { | |
| 86 | cpu_set_input_line(device->machine->cpu[0], 0, HOLD_LINE); | |
| 87 | } | |
| 88 | ||
| 89 | const 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 | ||
| 99 | const 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 | ||
| 109 | READ8_HANDLER(mz80k_strobe_r) | |
| 110 | { | |
| 111 | mz80k_tempo_strobe^=1; | |
| 112 | return(0x7e | mz80k_tempo_strobe); | |
| 113 | } | |
| 114 | WRITE8_HANDLER(mz80k_strobe_w) | |
| 115 | { | |
| 116 | } | |
| 117 |
| r3712 | r3713 | |
|---|---|---|
| 99 | 99 | const device_config *device = devtag_get_device(space->machine, ABC77, ABC77_TAG); |
| 100 | 100 | abc77_t *abc77 = get_safe_token(device); |
| 101 | 101 | |
| 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" }; | |
| 103 | 103 | |
| 104 | 104 | return input_port_read(device->machine, keynames[abc77->keylatch]); |
| 105 | 105 | } |
| r3712 | r3713 | |
|---|---|---|
| 137 | 137 | } |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | static | |
| 140 | static const UINT8 hex_to_7seg[16] = | |
| 141 | 141 | {0x3F, 0x06, 0x5B, 0x4F, |
| 142 | 142 | 0x66, 0x6D, 0x7D, 0x07, |
| 143 | 143 | 0x7F, 0x6F, 0x77, 0x7c, |
| r3712 | r3713 | |
|---|---|---|
| 418 | 418 | { |
| 419 | 419 | UINT8 data = 0xFF; |
| 420 | 420 | 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" }; | |
| 422 | 422 | |
| 423 | 423 | _logerror( 2, ("cybiko_key_r_byte (%08X)\n", offset)); |
| 424 | 424 | // A11 |
| r3712 | r3713 | |
|---|---|---|
| 16 | 16 | #define UNK "Unknown" |
| 17 | 17 | |
| 18 | 18 | /* Some known type of cart */ |
| 19 | static const char *types[] = | |
| 19 | static const char *const types[] = | |
| 20 | 20 | { |
| 21 | 21 | "ROM", |
| 22 | 22 | "ROM, DSP-1", |
| r3712 | r3713 | |
| 39 | 39 | }; |
| 40 | 40 | |
| 41 | 41 | /* Some known countries */ |
| 42 | static const char *countries[] = | |
| 42 | static const char *const countries[] = | |
| 43 | 43 | { |
| 44 | 44 | /* 0*/ "Japan (NTSC)", "USA & Canada (NTSC)", "Europe, Oceania & Asia (PAL)", "Sweden (PAL)", |
| 45 | 45 | /* 4*/ "Finland (PAL)", "Denmark (PAL)", "France (PAL)", "Holland (PAL)", |
| r3712 | r3713 | |
| 48 | 48 | }; |
| 49 | 49 | |
| 50 | 50 | /* Some known companies (integrations to the list from Snes9x) */ |
| 51 | static const char *companies[] = | |
| 51 | static const char *const companies[] = | |
| 52 | 52 | { |
| 53 | 53 | /* 0*/ "Invalid", "Nintendo", "Ajinomoto", "Imagineer-Zoom", "Chris Gray Enterprises Inc.", "Zamuse", "Falcom", UNK, |
| 54 | 54 | /* 8*/ "Capcom", "HOT-B", "Jaleco", "Coconuts", "Rage Software", "Micronet", "Technos", "Mebio Software", |
| r3712 | r3713 | |
|---|---|---|
| 1151 | 1151 | int value, i; |
| 1152 | 1152 | int controller1 = input_port_read(device->machine, "CTRLSEL") & 0x07; |
| 1153 | 1153 | 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" }; | |
| 1156 | 1156 | |
| 1157 | 1157 | c64_nmi(device->machine); |
| 1158 | 1158 |
| r3712 | r3713 | |
|---|---|---|
| 1056 | 1056 | |
| 1057 | 1057 | /* Detect carts which need additional handlers */ |
| 1058 | 1058 | { |
| 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 }, | |
| 1060 | 1060 | mjlover_sig[] = { 0x13, 0xf9, 0x00, 0x40, 0x00, 0x00 }, // move.b ($400000).l,($FFFF0C).l (partial) |
| 1061 | 1061 | squir_sig[] = { 0x26, 0x79, 0x00, 0xff, 0x00, 0xfa }, |
| 1062 | 1062 | bugsl_sig[] = { 0x20, 0x12, 0x13, 0xc0, 0x00, 0xff }, |
| r3712 | r3713 | |
|---|---|---|
| 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 | ||
| 15 | static UINT8 pecom_caps_state = 4; | |
| 16 | static UINT8 pecom_prev_caps_state = 4; | |
| 17 | ||
| 18 | /* Driver initialization */ | |
| 19 | DRIVER_INIT(pecom) | |
| 20 | { | |
| 21 | memset(mess_ram,0,32*1024); | |
| 22 | } | |
| 23 | ||
| 24 | static TIMER_CALLBACK( reset_tick ) | |
| 25 | { | |
| 26 | pecom_state *state = machine->driver_data; | |
| 27 | ||
| 28 | state->cdp1802_mode = CDP1802_MODE_RUN; | |
| 29 | } | |
| 30 | ||
| 31 | MACHINE_START( pecom ) | |
| 32 | { | |
| 33 | pecom_state *state = machine->driver_data; | |
| 34 | state->reset_timer = timer_alloc(reset_tick, NULL); | |
| 35 | } | |
| 36 | ||
| 37 | MACHINE_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 | ||
| 63 | WRITE8_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 | ||
| 86 | READ8_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 */ | |
| 104 | static CDP1802_MODE_READ( pecom64_mode_r ) | |
| 105 | { | |
| 106 | pecom_state *state = device->machine->driver_data; | |
| 107 | ||
| 108 | return state->cdp1802_mode; | |
| 109 | } | |
| 110 | ||
| 111 | static const device_config *cassette_device_image(running_machine *machine) | |
| 112 | { | |
| 113 | return devtag_get_device(machine, CASSETTE, "cassette"); | |
| 114 | } | |
| 115 | ||
| 116 | static 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 | ||
| 135 | static CDP1802_Q_WRITE( pecom64_q_w ) | |
| 136 | { | |
| 137 | cassette_output(cassette_device_image(device->machine), level ? -1.0 : +1.0); | |
| 138 | } | |
| 139 | ||
| 140 | static 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 | } | |
| 159 | CDP1802_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 | ||
| 15 | static UINT8 pecom_caps_state = 4; | |
| 16 | static UINT8 pecom_prev_caps_state = 4; | |
| 17 | ||
| 18 | /* Driver initialization */ | |
| 19 | DRIVER_INIT(pecom) | |
| 20 | { | |
| 21 | memset(mess_ram,0,32*1024); | |
| 22 | } | |
| 23 | ||
| 24 | static TIMER_CALLBACK( reset_tick ) | |
| 25 | { | |
| 26 | pecom_state *state = machine->driver_data; | |
| 27 | ||
| 28 | state->cdp1802_mode = CDP1802_MODE_RUN; | |
| 29 | } | |
| 30 | ||
| 31 | MACHINE_START( pecom ) | |
| 32 | { | |
| 33 | pecom_state *state = machine->driver_data; | |
| 34 | state->reset_timer = timer_alloc(reset_tick, NULL); | |
| 35 | } | |
| 36 | ||
| 37 | MACHINE_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 | ||
| 63 | WRITE8_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 | ||
| 86 | READ8_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 */ | |
| 104 | static CDP1802_MODE_READ( pecom64_mode_r ) | |
| 105 | { | |
| 106 | pecom_state *state = device->machine->driver_data; | |
| 107 | ||
| 108 | return state->cdp1802_mode; | |
| 109 | } | |
| 110 | ||
| 111 | static const device_config *cassette_device_image(running_machine *machine) | |
| 112 | { | |
| 113 | return devtag_get_device(machine, CASSETTE, "cassette"); | |
| 114 | } | |
| 115 | ||
| 116 | static 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 | ||
| 135 | static CDP1802_Q_WRITE( pecom64_q_w ) | |
| 136 | { | |
| 137 | cassette_output(cassette_device_image(device->machine), level ? -1.0 : +1.0); | |
| 138 | } | |
| 139 | ||
| 140 | static 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 | } | |
| 159 | CDP1802_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 | }; |
| r3712 | r3713 | |
|---|---|---|
| 355 | 355 | static UINT16 *current_page_ptr; |
| 356 | 356 | static UINT8 *current_page_ptr_8; |
| 357 | 357 | /* keep track of cart file types - required for cleanup... */ |
| 358 | typedef 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; | |
| 358 | typedef 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; | |
| 359 | 359 | static slot_type_t slot_type[3] = { SLOT_EMPTY, SLOT_EMPTY, SLOT_EMPTY}; |
| 360 | 360 | |
| 361 | 361 | /* true if 99/4p rom6 is enabled */ |
| r3712 | r3713 | |
| 1857 | 1857 | UINT32 key_buf; |
| 1858 | 1858 | UINT8 current_key; |
| 1859 | 1859 | int i; |
| 1860 | static const char *keynames[] = { "KP0", "KP1", "KP2", "KP3", "KP4" }; | |
| 1860 | static const char *const keynames[] = { "KP0", "KP1", "KP2", "KP3", "KP4" }; | |
| 1861 | 1861 | |
| 1862 | 1862 | /* read current key state */ |
| 1863 | 1863 | key_buf = ( input_port_read(machine, keynames[num]) | (input_port_read(machine, keynames[num + 1]) << 16) ) >> (4*num); |
| r3712 | r3713 | |
| 2261 | 2261 | { |
| 2262 | 2262 | running_machine *machine = Machine; |
| 2263 | 2263 | int answer; |
| 2264 | static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3" }; | |
| 2264 | static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3" }; | |
| 2265 | 2265 | |
| 2266 | 2266 | if ((ti99_model == model_99_4) && (KeyCol == 7)) |
| 2267 | 2267 | answer = (ti99_handset_poll_bus() << 3) | 0x80; |
| r3712 | r3713 | |
| 2305 | 2305 | { |
| 2306 | 2306 | running_machine *machine = Machine; |
| 2307 | 2307 | int answer; |
| 2308 | static const char *keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3" }; | |
| 2308 | static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3" }; | |
| 2309 | 2309 | |
| 2310 | 2310 | if (/*(ti99_model == model_99_4) &&*/ (KeyCol == 7)) |
| 2311 | 2311 | answer = 0x07; |
| r3712 | r3713 | |
| 2401 | 2401 | { |
| 2402 | 2402 | running_machine *machine = Machine; |
| 2403 | 2403 | 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", | |
| 2405 | 2405 | "KEY8", "KEY9", "KEY10", "KEY11", "KEY12", "KEY13", "KEY14", "KEY15" }; |
| 2406 | 2406 | |
| 2407 | 2407 | if (has_mecmouse && (KeyCol == 15)) |
| r3712 | r3713 | |
| 2435 | 2435 | { |
| 2436 | 2436 | running_machine *machine = Machine; |
| 2437 | 2437 | 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", | |
| 2439 | 2439 | "KEY8", "KEY9", "KEY10", "KEY11", "KEY12", "KEY13", "KEY14", "KEY15" }; |
| 2440 | 2440 | |
| 2441 | 2441 | if (has_mecmouse && (KeyCol == 15)) |
| r3712 | r3713 | |
|---|---|---|
| 767 | 767 | |
| 768 | 768 | INTERRUPT_GEN( bbcb_keyscan ) |
| 769 | 769 | { |
| 770 | static const char *colnames[] = { "COL0", "COL1", "COL2", "COL3", "COL4", | |
| 770 | static const char *const colnames[] = { "COL0", "COL1", "COL2", "COL3", "COL4", | |
| 771 | 771 | "COL5", "COL6", "COL7", "COL8", "COL9" }; |
| 772 | 772 | |
| 773 | 773 | /* only do auto scan if keyboard is not enabled */ |
| r3712 | r3713 | |
| 802 | 802 | |
| 803 | 803 | INTERRUPT_GEN( bbcm_keyscan ) |
| 804 | 804 | { |
| 805 | static const char *colnames[] = { "COL0", "COL1", "COL2", "COL3", "COL4", | |
| 805 | static const char *const colnames[] = { "COL0", "COL1", "COL2", "COL3", "COL4", | |
| 806 | 806 | "COL5", "COL6", "COL7", "COL8", "COL9" }; |
| 807 | 807 | |
| 808 | 808 | /* only do auto scan if keyboard is not enabled */ |
| r3712 | r3713 | |
| 839 | 839 | int bit; |
| 840 | 840 | int row; |
| 841 | 841 | int res; |
| 842 | static const char *colnames[] = { "COL0", "COL1", "COL2", "COL3", "COL4", | |
| 842 | static const char *const colnames[] = { "COL0", "COL1", "COL2", "COL3", "COL4", | |
| 843 | 843 | "COL5", "COL6", "COL7", "COL8", "COL9" }; |
| 844 | 844 | |
| 845 | 845 | column = data & 0x0f; |
| r3712 | r3713 | |
|---|---|---|
| 899 | 899 | static void kc_keyboard_init(running_machine *machine) |
| 900 | 900 | { |
| 901 | 901 | 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" }; | |
| 903 | 903 | |
| 904 | 904 | /* head and tail of list is at beginning */ |
| 905 | 905 | keyboard_data.head = (keyboard_data.tail = 0); |
| r3712 | r3713 | |
| 1040 | 1040 | static TIMER_CALLBACK(kc_keyboard_update) |
| 1041 | 1041 | { |
| 1042 | 1042 | 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" }; | |
| 1044 | 1044 | |
| 1045 | 1045 | /* scan all lines (excluding shift) */ |
| 1046 | 1046 | for (i=0; i<KC_KEYBOARD_NUM_LINES-1; i++) |
| r3712 | r3713 | |
|---|---|---|
| 369 | 369 | pen_typewriter_bg, pen_red |
| 370 | 370 | }; |
| 371 | 371 | |
| 372 | static UINT8 total_colors_needed = pen_crt_num_levels + sizeof(pdp1_colors) / 3; | |
| 372 | static const UINT8 total_colors_needed = pen_crt_num_levels + sizeof(pdp1_colors) / 3; | |
| 373 | 373 | |
| 374 | 374 | static GFXDECODE_START( pdp1 ) |
| 375 | 375 | GFXDECODE_ENTRY( "gfx1", 0, fontlayout, pen_crt_num_levels + sizeof(pdp1_colors) / 3, 3 ) |
| r3712 | r3713 | |
|---|---|---|
| 683 | 683 | |
| 684 | 684 | static READ8_HANDLER(nc_key_data_in_r) |
| 685 | 685 | { |
| 686 | static const char *keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", | |
| 686 | static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", | |
| 687 | 687 | "LINE5", "LINE6", "LINE7", "LINE8", "LINE9" }; |
| 688 | 688 | |
| 689 | 689 | if (offset==9) |
| r3712 | r3713 | |
|---|---|---|
| 311 | 311 | |
| 312 | 312 | static READ8_HANDLER ( sord_keyboard_r ) |
| 313 | 313 | { |
| 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", | |
| 315 | 315 | "LINE8", "LINE9", "LINE10", "LINE11", "LINE12", "LINE13", "LINE14", "LINE15", |
| 316 | 316 | "RESET"}; |
| 317 | 317 |
| r3712 | r3713 | |
|---|---|---|
| 77 | 77 | static TIMER_CALLBACK(z88_rtc_timer_callback) |
| 78 | 78 | { |
| 79 | 79 | 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" }; | |
| 81 | 81 | |
| 82 | 82 | /* is z88 in snooze state? */ |
| 83 | 83 | if (blink.z88_state == Z88_SNOOZE) |
| r3712 | r3713 | |
|---|---|---|
| 241 | 241 | tmc600_state *state = device->machine->driver_data; |
| 242 | 242 | |
| 243 | 243 | 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" }; | |
| 245 | 245 | |
| 246 | 246 | /* |
| 247 | 247 | EF1 ? |
| r3712 | r3713 | |
|---|---|---|
| 406 | 406 | static int sys9901_r0(int offset) |
| 407 | 407 | { |
| 408 | 408 | 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" }; | |
| 410 | 410 | |
| 411 | 411 | /* keyboard read */ |
| 412 | 412 | if (digitsel < 9) |
| r3712 | r3713 | |
|---|---|---|
| 344 | 344 | INPUT_PORTS_END |
| 345 | 345 | |
| 346 | 346 | /* palette in red, green, blue tribles */ |
| 347 | static unsigned char pasogo_palette[][3] = | |
| 347 | static const unsigned char pasogo_palette[][3] = | |
| 348 | 348 | { |
| 349 | 349 | { 0, 0, 0 }, |
| 350 | 350 | { 45,45,43 }, |
| r3712 | r3713 | |
|---|---|---|
| 145 | 145 | |
| 146 | 146 | UINT8 keylatch = offset >> 8; |
| 147 | 147 | 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" }; | |
| 149 | 149 | |
| 150 | 150 | if (keylatch == 0) return 0; |
| 151 | 151 |
| r3712 | r3713 | |
|---|---|---|
| 173 | 173 | { |
| 174 | 174 | abc80_state *state = machine->driver_data; |
| 175 | 175 | |
| 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" }; | |
| 177 | 177 | int table = 0, row, col; |
| 178 | 178 | |
| 179 | 179 | if (input_port_read(machine, "ROW7") & 0x07) |
| r3712 | r3713 | |
|---|---|---|
| 473 | 473 | static TIMER_CALLBACK(x68k_keyboard_poll) |
| 474 | 474 | { |
| 475 | 475 | int x; |
| 476 | static const char *keynames[] = { "key1", "key2", "key3", "key4" }; | |
| 476 | static const char *const keynames[] = { "key1", "key2", "key3", "key4" }; | |
| 477 | 477 | |
| 478 | 478 | for(x=0;x<0x80;x++) |
| 479 | 479 | { |
| r3712 | r3713 | |
|---|---|---|
| 303 | 303 | |
| 304 | 304 | static READ8_DEVICE_HANDLER( mpf1_porta_r ) |
| 305 | 305 | { |
| 306 | static const char *keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5" }; | |
| 306 | static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5" }; | |
| 307 | 307 | |
| 308 | 308 | UINT8 retval; |
| 309 | 309 | for(keycol = 0; keycol < 6; keycol++) |
| r3712 | r3713 | |
|---|---|---|
| 29 | 29 | static UINT8 mc6845_cursor[16]; // cursor shape |
| 30 | 30 | static UINT8 mc6845_reg[20]; /* registers */ |
| 31 | 31 | static UINT8 mc6845_ind; /* register index */ |
| 32 | static UINT8 mc6845_mask[]={0xff,0xff,0xff,0x0f,0x7f,0x1f,0x7f,0x7f,3,0x1f,0x7f,0x1f,0x3f,0xff,0x3f,0xff,0,0}; | |
| 32 | static const UINT8 mc6845_mask[]={0xff,0xff,0xff,0x0f,0x7f,0x1f,0x7f,0x7f,3,0x1f,0x7f,0x1f,0x3f,0xff,0x3f,0xff,0,0}; | |
| 33 | 33 | |
| 34 | 34 | #define MASTER_CLOCK (XTAL_12MHz) |
| 35 | 35 | #define PIXEL_CLOCK (MASTER_CLOCK/2) |
| r3712 | r3713 | |
| 359 | 359 | |
| 360 | 360 | static READ8_DEVICE_HANDLER( pio_port_b_r ) |
| 361 | 361 | { |
| 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" }; | |
| 363 | 363 | |
| 364 | 364 | int bit; |
| 365 | 365 | UINT8 data = 0xff; |
| r3712 | r3713 | |
|---|---|---|
| 483 | 483 | |
| 484 | 484 | static READ8_DEVICE_HANDLER( sc3000_ppi8255_a_r ) |
| 485 | 485 | { |
| 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" }; | |
| 487 | 487 | |
| 488 | 488 | /* |
| 489 | 489 | Signal Description |
| r3712 | r3713 | |
| 503 | 503 | |
| 504 | 504 | static READ8_DEVICE_HANDLER( sc3000_ppi8255_b_r ) |
| 505 | 505 | { |
| 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" }; | |
| 507 | 507 | |
| 508 | 508 | /* |
| 509 | 509 | Signal Description |
| r3712 | r3713 | |
|---|---|---|
| 558 | 558 | - tied high, allowing PARIN and PAROUT bios routines to run */ |
| 559 | 559 | |
| 560 | 560 | 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", | |
| 562 | 562 | "LINE8", "LINE9", "LINE10", "LINE11", "LINE12", "LINE13", "LINE14", "LINE15" }; |
| 563 | 563 | |
| 564 | 564 | /* bit 5 - vsync (inverted) */ |
| r3712 | r3713 | |
|---|---|---|
| 247 | 247 | /* PCW keyboard is mapped into memory */ |
| 248 | 248 | static READ8_HANDLER(pcw_keyboard_r) |
| 249 | 249 | { |
| 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", | |
| 251 | 251 | "LINE8", "LINE9", "LINE10", "LINE11", "LINE12", "LINE13", "LINE14", "LINE15" }; |
| 252 | 252 | |
| 253 | 253 | return input_port_read(space->machine, keynames[offset]); |
| r3712 | r3713 | |
|---|---|---|
| 436 | 436 | */ |
| 437 | 437 | |
| 438 | 438 | 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" }; | |
| 440 | 440 | |
| 441 | 441 | row = keyboard_row; |
| 442 | 442 |
| r3712 | r3713 | |
|---|---|---|
| 120 | 120 | |
| 121 | 121 | static void enterprise_dave_reg_read(running_machine *machine, int RegIndex) |
| 122 | 122 | { |
| 123 | static const char *keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", | |
| 123 | static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", | |
| 124 | 124 | "LINE5", "LINE6", "LINE7", "LINE8", "LINE9" }; |
| 125 | 125 | switch (RegIndex) |
| 126 | 126 | { |
| r3712 | r3713 | |
|---|---|---|
| 248 | 248 | /* bit 7 = ??? */ |
| 249 | 249 | |
| 250 | 250 | 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" }; | |
| 252 | 252 | |
| 253 | 253 | keyboard_line = data & 0x07; |
| 254 | 254 | keyboard_data = input_port_read(space->machine, keynames[keyboard_line]); |
| r3712 | r3713 | |
|---|---|---|
| 479 | 479 | static void smpc_intbackhelper(running_machine *machine) |
| 480 | 480 | { |
| 481 | 481 | int pad; |
| 482 | static const char *padnames[] = { "JOY1", "JOY2" }; | |
| 482 | static const char *const padnames[] = { "JOY1", "JOY2" }; | |
| 483 | 483 | |
| 484 | 484 | if (intback_stage == 1) |
| 485 | 485 | { |
| r3712 | r3713 | |
|---|---|---|
| 145 | 145 | UINT8 keycode = 0; |
| 146 | 146 | UINT8 data; |
| 147 | 147 | 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" }; | |
| 149 | 149 | |
| 150 | 150 | // shift, upper case |
| 151 | 151 | if (input_port_read(machine, "ROW7") & 0x07) |
| r3712 | r3713 | |
| 884 | 884 | return -1; |
| 885 | 885 | } |
| 886 | 886 | |
| 887 | static z80sio_interface sio_intf = | |
| 887 | static const z80sio_interface sio_intf = | |
| 888 | 888 | { |
| 889 | 889 | Z80_TAG, /* cpu */ |
| 890 | 890 | ABC800_X01/2/2, /* clock */ |
| r3712 | r3713 | |
|---|---|---|
| 189 | 189 | tmc2000e_state *state = device->machine->driver_data; |
| 190 | 190 | |
| 191 | 191 | 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" }; | |
| 193 | 193 | |
| 194 | 194 | /* |
| 195 | 195 | EF1 CDP1864 |
| r3712 | r3713 | |
|---|---|---|
| 455 | 455 | tmc1800_state *state = device->machine->driver_data; |
| 456 | 456 | |
| 457 | 457 | 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" }; | |
| 459 | 459 | |
| 460 | 460 | /* |
| 461 | 461 | EF1 CDP1861 |
| r3712 | r3713 | |
| 540 | 540 | tmc2000_state *state = device->machine->driver_data; |
| 541 | 541 | |
| 542 | 542 | 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" }; | |
| 544 | 544 | |
| 545 | 545 | /* |
| 546 | 546 | EF1 CDP1864 |
| r3712 | r3713 | |
| 651 | 651 | { |
| 652 | 652 | oscnano_state *state = device->machine->driver_data; |
| 653 | 653 | |
| 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" }; | |
| 655 | 655 | |
| 656 | 656 | int flags = 0x0f; |
| 657 | 657 |
| r3712 | r3713 | |
|---|---|---|
| 25 | 25 | static READ8_DEVICE_HANDLER( ins8154_b1_port_a_r ) |
| 26 | 26 | { |
| 27 | 27 | 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", | |
| 29 | 29 | "keyboard_4", "keyboard_5", "keyboard_6", "keyboard_7" }; |
| 30 | 30 | |
| 31 | 31 | data = input_port_read(device->machine, keynames[key_digit]); |
| r3712 | r3713 | |
|---|---|---|
| 371 | 371 | */ |
| 372 | 372 | |
| 373 | 373 | 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", | |
| 375 | 375 | "D8", "D9", "D10", "D11", "D12", "D13", "D14", "D15" }; |
| 376 | 376 | |
| 377 | 377 | /* keyboard row reset */ |
| r3712 | r3713 | |
| 1112 | 1112 | NULL |
| 1113 | 1113 | }; |
| 1114 | 1114 | |
| 1115 | static z80ctc_interface newbrain_ctc_intf = | |
| 1115 | static const z80ctc_interface newbrain_ctc_intf = | |
| 1116 | 1116 | { |
| 1117 | 1117 | Z80_TAG, /* cpu */ |
| 1118 | 1118 | 0, /* clock */ |
| r3712 | r3713 | |
|---|---|---|
| 341 | 341 | { |
| 342 | 342 | unsigned char data = 0x0ff; |
| 343 | 343 | 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" }; | |
| 345 | 345 | |
| 346 | 346 | for (i=0; i<8; i++) |
| 347 | 347 | { |
| r3712 | r3713 | |
| 427 | 427 | msm8251_receive_clock(); |
| 428 | 428 | } |
| 429 | 429 | |
| 430 | static z80ctc_interface | |
| 430 | static const z80ctc_interface einstein_ctc_intf = | |
| 431 | 431 | { |
| 432 | 432 | "main", |
| 433 | 433 | EINSTEIN_SYSTEM_CLOCK, |
| r3712 | r3713 | |
| 435 | 435 | einstein_ctc_interrupt, |
| 436 | 436 | einstein_serial_transmit_clock, |
| 437 | 437 | einstein_serial_receive_clock, |
| 438 | ||
| 438 | | |
| 439 | 439 | }; |
| 440 | 440 | |
| 441 | 441 | static Z80PIO_ON_ARDY_CHANGED( einstein_pio_ardy ) |
| r3712 | r3713 | |
|---|---|---|
| 247 | 247 | /* read keys in the current row */ |
| 248 | 248 | static READ8_HANDLER ( ti99_2_read_kbd ) |
| 249 | 249 | { |
| 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" }; | |
| 251 | 251 | |
| 252 | 252 | return input_port_read(space->machine, keynames[KeyRow]); |
| 253 | 253 | } |
| r3712 | r3713 | |
|---|---|---|
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | |
| 295 | static cassette_config jupiter_cassette_config = | |
| 295 | static const cassette_config jupiter_cassette_config = | |
| 296 | 296 | { |
| 297 | 297 | jupiter_cassette_formats, |
| 298 | 298 | NULL, |
| r3712 | r3713 | |
|---|---|---|
| 2282 | 2282 | If keyboard matrix line 11-14 are selected, the byte is always &ff. |
| 2283 | 2283 | After testing on a real CPC, it is found that these never change, they always return &FF. */ |
| 2284 | 2284 | |
| 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", | |
| 2286 | 2286 | "keyboard_row_5", "keyboard_row_6", "keyboard_row_7", "keyboard_row_8", "keyboard_row_9", |
| 2287 | 2287 | "keyboard_row_10" }; |
| 2288 | 2288 |
| r3712 | r3713 | |
|---|---|---|
| 180 | 180 | static int ox = 0, oy = 0; |
| 181 | 181 | int nx,ny; |
| 182 | 182 | int dx, dy; |
| 183 | static const char *linenames[] = { "LINE0", "LINE1", "LINE2", "LINE3" }; | |
| 183 | static const char *const linenames[] = { "LINE0", "LINE1", "LINE2", "LINE3" }; | |
| 184 | 184 | |
| 185 | 185 | for (i = 0; i < 4; i++) |
| 186 | 186 | { |
| r3712 | r3713 | |
| 403 | 403 | { |
| 404 | 404 | int i; |
| 405 | 405 | unsigned char *addr; |
| 406 | static const char *linenames[] = { "LINE0", "LINE1", "LINE2", "LINE3" }; | |
| 406 | static const char *const linenames[] = { "LINE0", "LINE1", "LINE2", "LINE3" }; | |
| 407 | 407 | |
| 408 | 408 | memset(avigo_banked_opbase, 0, sizeof(avigo_banked_opbase)); |
| 409 | 409 |
| r3712 | r3713 | |
|---|---|---|
| 199 | 199 | int b_data; |
| 200 | 200 | int b_ack; |
| 201 | 201 | int b_ready; |
| 202 | static const char *portnames[] = { "IN0", "IN1", "IN2", "IN3" }; | |
| 202 | static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" }; | |
| 203 | 203 | |
| 204 | 204 | b_sel = ( n_data & PSX_SIO_OUT_DTR ) / PSX_SIO_OUT_DTR; |
| 205 | 205 | b_clock = ( n_data & PSX_SIO_OUT_CLOCK ) / PSX_SIO_OUT_CLOCK; |
| Previous | 15994 Revisions | Next |