| Previous | 15994 Revisions | Next |
| r1582 Monday 21st January, 2008 at 03:39:30 UTC by Nathan Woods |
|---|
| 1. Statification/Constification [Atari Ace] 2. Sync with MAME (i8039.c, pcshare.c) |
| [docs] | messnew.txt |
| [src/emu/cpu/i8039] | i8039.c |
| [src/mame/machine] | pcshare.c |
| [src/mess] | image.c mslegacy.c opresolv.c |
| [src/mess/audio] | dai.c gb.c |
| [src/mess/devices] | chd_cd.c harddriv.c sonydriv.c thomflop.c |
| [src/mess/drivers] | a2600.c a310.c acrnsys1.c amstrad.c arcadia.c einstein.c ex800.c exelv.c genesis.c ip22.c mpf1.c nc.c pcw16.c pokemini.c psx.c saturn.c snes.c |
| [src/mess/formats] | ap2_dsk.c thom_cas.c vt_cas.c zx81_p.c |
| [src/mess/machine] | 3do.c 99_dsk.c adam.c amigacd.c apple2gs.c applefdc.c at.c bbc.c bebox.c c128.c c64.c cbmb.c concept.c cybiko.c ds1315.c gamecom.c gb.c geneve.c intv.c kim1.c lisa.c mac.c mc6850.c mekd2.c msx.c pet.c pokemini.c sms.c svi318.c thomson.c ti99_4x.c tms5501.c vc1541.c vc20.c vtech2.c wd17xx.c wswan.c |
| [src/mess/osd/windows] | menu.c |
| [src/mess/tools/imgtool] | imgterrs.c modules.c |
| [src/mess/tools/imgtool/modules] | cococas.c d64.c ti85.c vzdos.c |
| [src/mess/tools/imgtool/windows] | wimgtool.c |
| [src/mess/tools/messtest] | core.c |
| [src/mess/video] | 911_vdt.c channelf.c crtc6845.c dgn_beta.c hp48.c kaypro.c kc.c kim1.c m6845.c m6847.c mekd2.c pc1350.c pc_cga.c ssystem3.c vic6560.c vtech2.c |
| r1581 | r1582 | |
|---|---|---|
| 43 | 43 | #include "machine/pc_fdc.h" |
| 44 | 44 | |
| 45 | 45 | #include "includes/pclpt.h" |
| 46 | #include "in | |
| 46 | #include "machin | |
| 47 | 47 | |
| 48 | 48 | #include "machine/pc_hdc.h" |
| 49 | 49 | #include "machine/nec765.h" |
| r1581 | r1582 | |
|---|---|---|
| 619 | 619 | R.timer = 0; |
| 620 | 620 | } |
| 621 | 621 | |
| 622 | #if (HAS_I8035) | |
| 622 | 623 | static void i8035_init (int index, int clock, const void *config, int (*irqcallback)(int)) |
| 623 | 624 | { |
| 624 | 625 | i8039_init(index, clock, config, irqcallback); |
| 625 | 626 | R.ram_mask = 0x3F; |
| 626 | 627 | R.int_rom_size = 0x400; |
| 627 | 628 | } |
| 629 | #endif /* HAS_I8035 */ | |
| 628 | 630 | |
| 629 | 631 | #if (HAS_M58715) |
| 630 | 632 | static void m58715_init (int index, int clock, const void *config, int (*irqcallback)(int)) |
| r1581 | r1582 | |
| 632 | 634 | i8039_init(index, clock, config, irqcallback); |
| 633 | 635 | R.cpu_feature = FEATURE_M58715; |
| 634 | 636 | } |
| 635 | #endif | |
| 637 | #endif /* HAS_M58715 */ | |
| 636 | 638 | |
| 637 | 639 | /**************************************************************************** |
| 638 | 640 | * Reset registers to their initial values |
| r1581 | r1582 | |
|---|---|---|
| 22 | 22 | #define MAX_HARDDISKS 8 |
| 23 | 23 | #define USE_CHD_OPEN 0 |
| 24 | 24 | |
| 25 | static const char *error_strings[] = | |
| 25 | static const char *const error_strings[] = | |
| 26 | 26 | { |
| 27 | 27 | "no error", |
| 28 | 28 | "no drive interface", |
| r1581 | r1582 | |
|---|---|---|
| 226 | 226 | else |
| 227 | 227 | { /* 800k unit : rotation speed controlled by drive */ |
| 228 | 228 | #if 1 /* Mac Plus */ |
| 229 | static int speeds[] = | |
| 229 | static const int speeds[] = | |
| 230 | 230 | { |
| 231 | 231 | 500, /* 00-15: timing value 117B (acceptable range {1135-11E9} */ |
| 232 | 232 | 550, /* 16-31: timing value ???? (acceptable range {12C6-138A} */ |
| r1581 | r1582 | |
| 236 | 236 | }; |
| 237 | 237 | #else /* Lisa 2 */ |
| 238 | 238 | /* 237 + 1.3*(256-reg) */ |
| 239 | static int speeds[] = | |
| 239 | static const int speeds[] = | |
| 240 | 240 | { |
| 241 | 241 | 293, /* 00-15: timing value ???? (acceptable range {0330-0336} */ |
| 242 | 242 | 322, /* 16-31: timing value ???? (acceptable range {02ED-02F3} */ |
| r1581 | r1582 | |
|---|---|---|
| 12 | 12 | |
| 13 | 13 | #define MAX_CDROMS (4) // up to this many drives |
| 14 | 14 | |
| 15 | static const char *error_strings[] = | |
| 15 | static const char *const error_strings[] = | |
| 16 | 16 | { |
| 17 | 17 | "no error", |
| 18 | 18 | "no drive interface", |
| r1581 | r1582 | |
| 53 | 53 | OPTION_INT('K', "hunksize", "Hunk Bytes") |
| 54 | 54 | OPTION_GUIDE_END |
| 55 | 55 | |
| 56 | static const char | |
| 56 | static const char | |
| 57 | 57 | "K512/1024/2048/[4096]"; |
| 58 | 58 | |
| 59 | 59 |
| r1581 | r1582 | |
|---|---|---|
| 779 | 779 | /* most of these are unused now */ |
| 780 | 780 | static const int bit[8] = { 6, 6, 7, 8, 7, 7, 8, 8 }; |
| 781 | 781 | static const int par[8] = { 2, 1, 0, 0, 2, 1, 2, 1 }; |
| 782 | static const char* parname[3] = { "none", "odd", "even" }; | |
| 782 | static const char *const parname[3] = { "none", "odd", "even" }; | |
| 783 | 783 | int bits, parity; |
| 784 | 784 | bits = bit[ (data >> 3) & 7 ]; |
| 785 | 785 | parity = par[ (data >> 3) & 7 ]; |
| r1581 | r1582 | |
| 1227 | 1227 | /* accumulate bytes to form an id field */ |
| 1228 | 1228 | if ( thmfc1->data_idx || data==0xA1 ) |
| 1229 | 1229 | { |
| 1230 | UINT8 header[] = { 0xa1, 0xa1, 0xa1, 0xfe }; | |
| 1230 | static const UINT8 header[] = { 0xa1, 0xa1, 0xa1, 0xfe }; | |
| 1231 | 1231 | thmfc1->data[ thmfc1->data_idx ] = data; |
| 1232 | 1232 | thmfc1->data_idx++; |
| 1233 | 1233 | if ( thmfc1->data_idx > 11 ) |
| r1581 | r1582 | |
|---|---|---|
| 1 | /********************************************************************* | |
| 2 | ||
| 3 | mslegacy.c | |
| 4 | ||
| 5 | Defines since removed from MAME, but kept in MESS for legacy | |
| 6 | reasons | |
| 7 | ||
| 8 | *********************************************************************/ | |
| 9 | ||
| 10 | #include "driver.h" | |
| 11 | #include "mslegacy.h" | |
| 12 | ||
| 13 | ||
| 14 | static const char *mess_default_text[] = | |
| 15 | { | |
| 16 | "OK", | |
| 17 | "Off", | |
| 18 | "On", | |
| 19 | "Dip Switches", | |
| 20 | "Driver Configuration", | |
| 21 | "Analog Controls", | |
| 22 | "Digital Speed", | |
| 23 | "Autocenter Speed", | |
| 24 | "Reverse", | |
| 25 | "Sensitivity", | |
| 1 | /********************************************************************* | |
| 2 | ||
| 3 | mslegacy.c | |
| 4 | ||
| 5 | Defines since removed from MAME, but kept in MESS for legacy | |
| 6 | reasons | |
| 7 | ||
| 8 | *********************************************************************/ | |
| 9 | ||
| 10 | #include "driver.h" | |
| 11 | #include "mslegacy.h" | |
| 12 | ||
| 13 | ||
| 14 | static const char *const mess_default_text[] = | |
| 15 | { | |
| 16 | "OK", | |
| 17 | "Off", | |
| 18 | "On", | |
| 19 | "Dip Switches", | |
| 20 | "Driver Configuration", | |
| 21 | "Analog Controls", | |
| 22 | "Digital Speed", | |
| 23 | "Autocenter Speed", | |
| 24 | "Reverse", | |
| 25 | "Sensitivity", | |
| 26 | 26 | "\xc2\xab", |
| 27 | 27 | "\xc2\xbb", |
| 28 | 28 | "Return to Main Menu", |
| 29 | ||
| 30 | "Keyboard Emulation Status", | |
| 31 | "-------------------------", | |
| 32 | "Mode: PARTIAL Emulation", | |
| 33 | "Mode: FULL Emulation", | |
| 34 | "UI: Enabled", | |
| 35 | "UI: Disabled", | |
| 36 | "**Use ScrLock to toggle**", | |
| 37 | ||
| 38 | "Image Information", | |
| 39 | "File Manager", | |
| 40 | "Tape Control", | |
| 41 | ||
| 42 | "No Tape Image loaded", | |
| 43 | "recording", | |
| 44 | "playing", | |
| 45 | "(recording)", | |
| 46 | "(playing)", | |
| 47 | "stopped", | |
| 48 | "Pause/Stop", | |
| 49 | "Record", | |
| 50 | "Play", | |
| 51 | "Rewind", | |
| 52 | "Fast Forward", | |
| 53 | "Mount...", | |
| 54 | "Create...", | |
| 55 | "Unmount", | |
| 56 | "[empty slot]", | |
| 57 | "Input Devices", | |
| 58 | "Quit Fileselector", | |
| 59 | "File Specification", /* IMPORTANT: be careful to ensure that the following */ | |
| 60 | "Cartridge", /* device list matches the order found in device.h */ | |
| 61 | "Floppy Disk", /* and is ALWAYS placed after "File Specification" */ | |
| 62 | "Hard Disk", | |
| 63 | "Cylinder", | |
| 64 | "Cassette", | |
| 65 | "Punched Card", | |
| 66 | "Punched Tape", | |
| 67 | "Printer", | |
| 68 | "Serial Port", | |
| 69 | "Parallel Port", | |
| 70 | "Snapshot", | |
| 71 | "Quickload", | |
| 72 | "Memory Card", | |
| 73 | "CD-ROM" | |
| 74 | }; | |
| 75 | ||
| 76 | ||
| 77 | ||
| 29 | ||
| 30 | "Keyboard Emulation Status", | |
| 31 | "-------------------------", | |
| 32 | "Mode: PARTIAL Emulation", | |
| 33 | "Mode: FULL Emulation", | |
| 34 | "UI: Enabled", | |
| 35 | "UI: Disabled", | |
| 36 | "**Use ScrLock to toggle**", | |
| 37 | ||
| 38 | "Image Information", | |
| 39 | "File Manager", | |
| 40 | "Tape Control", | |
| 41 | ||
| 42 | "No Tape Image loaded", | |
| 43 | "recording", | |
| 44 | "playing", | |
| 45 | "(recording)", | |
| 46 | "(playing)", | |
| 47 | "stopped", | |
| 48 | "Pause/Stop", | |
| 49 | "Record", | |
| 50 | "Play", | |
| 51 | "Rewind", | |
| 52 | "Fast Forward", | |
| 53 | "Mount...", | |
| 54 | "Create...", | |
| 55 | "Unmount", | |
| 56 | "[empty slot]", | |
| 57 | "Input Devices", | |
| 58 | "Quit Fileselector", | |
| 59 | "File Specification", /* IMPORTANT: be careful to ensure that the following */ | |
| 60 | "Cartridge", /* device list matches the order found in device.h */ | |
| 61 | "Floppy Disk", /* and is ALWAYS placed after "File Specification" */ | |
| 62 | "Hard Disk", | |
| 63 | "Cylinder", | |
| 64 | "Cassette", | |
| 65 | "Punched Card", | |
| 66 | "Punched Tape", | |
| 67 | "Printer", | |
| 68 | "Serial Port", | |
| 69 | "Parallel Port", | |
| 70 | "Snapshot", | |
| 71 | "Quickload", | |
| 72 | "Memory Card", | |
| 73 | "CD-ROM" | |
| 74 | }; | |
| 75 | ||
| 76 | ||
| 77 | ||
| 78 | 78 | /*************************************************************************** |
| 79 | 79 | PALETTE |
| 80 | 80 | ***************************************************************************/ |
| 81 | 81 | |
| 82 | void palette_set_colors_rgb(running_machine *machine, pen_t color_base, const UINT8 *colors, int color_count) | |
| 83 | { | |
| 84 | while (color_count--) | |
| 85 | { | |
| 86 | UINT8 r = *colors++; | |
| 87 | UINT8 g = *colors++; | |
| 88 | UINT8 b = *colors++; | |
| 89 | palette_set_color_rgb(machine, color_base++, r, g, b); | |
| 90 | } | |
| 91 | } | |
| 92 | ||
| 93 | ||
| 82 | void palette_set_colors_rgb(running_machine *machine, pen_t color_base, const UINT8 *colors, int color_count) | |
| 83 | { | |
| 84 | while (color_count--) | |
| 85 | { | |
| 86 | UINT8 r = *colors++; | |
| 87 | UINT8 g = *colors++; | |
| 88 | UINT8 b = *colors++; | |
| 89 | palette_set_color_rgb(machine, color_base++, r, g, b); | |
| 90 | } | |
| 91 | } | |
| 94 | 92 | |
| 93 | ||
| 94 | ||
| 95 | 95 | /*************************************************************************** |
| 96 | 96 | UI TEXT |
| 97 | 97 | ***************************************************************************/ |
| 98 | 98 | |
| 99 | const char * ui_getstring (int string_num) | |
| 100 | { | |
| 101 | return mess_default_text[string_num]; | |
| 102 | } | |
| 99 | const char * ui_getstring (int string_num) | |
| 100 | { | |
| 101 | return mess_default_text[string_num]; | |
| 102 | } |
| r1581 | r1582 | |
|---|---|---|
| 565 | 565 | |
| 566 | 566 | const char *option_resolution_error_string(optreserr_t err) |
| 567 | 567 | { |
| 568 | static const char *errors[] = | |
| 568 | static const char *const errors[] = | |
| 569 | 569 | { |
| 570 | 570 | "The operation completed successfully", /* OPTIONRESOLUTION_ERROR_SUCCESS */ |
| 571 | 571 | "Out of memory", /* OPTIONRESOLUTION_ERROR_OUTOFMEMORY */ |
| r1581 | r1582 | |
|---|---|---|
| 377 | 377 | XML_Parser extparser = NULL; |
| 378 | 378 | int rc = 0; |
| 379 | 379 | char buf[256]; |
| 380 | static const char | |
| 380 | static const char | |
| 381 | 381 | input_code c; |
| 382 | 382 | |
| 383 | 383 | buf[0] = '\0'; |
| r1581 | r1582 | |
|---|---|---|
| 18 | 18 | |
| 19 | 19 | /* step 2: define the modules[] array */ |
| 20 | 20 | #define MODULE(name) name##_get_info, |
| 21 | static void (*modules[])(const imgtool_class *imgclass, UINT32 state, union imgtoolinfo *info) = | |
| 21 | static void (*const modules[])(const imgtool_class *imgclass, UINT32 state, union imgtoolinfo *info) = | |
| 22 | 22 | { |
| 23 | 23 | #include "modules.c" |
| 24 | 24 | }; |
| r1581 | r1582 | |
| 32 | 32 | imgtool_module *module; |
| 33 | 33 | |
| 34 | 34 | /* list of modules that we drop */ |
| 35 | static const char *irrelevant_modules[] = | |
| 35 | static const char *const irrelevant_modules[] = | |
| 36 | 36 | { |
| 37 | 37 | "coco_os9_rsdos" |
| 38 | 38 | }; |
| r1581 | r1582 | |
|---|---|---|
| 1550 | 1550 | static LRESULT wimgtool_create(HWND window, CREATESTRUCT *pcs) |
| 1551 | 1551 | { |
| 1552 | 1552 | wimgtool_info *info; |
| 1553 | static int status_widths[3] = { 200, 400, -1 }; | |
| 1553 | static const int status_widths[3] = { 200, 400, -1 }; | |
| 1554 | 1554 | |
| 1555 | 1555 | info = malloc(sizeof(*info)); |
| 1556 | 1556 | if (!info) |
| r1581 | r1582 | |
|---|---|---|
| 11 | 11 | static int cococas_nextfile(imgtool_image *img, imgtool_dirent *ent); |
| 12 | 12 | static int cococas_readfile(imgtool_image *img, imgtool_stream *destf); |
| 13 | 13 | |
| 14 | static UINT8 blockheader[] = { 0x55, 0x3C }; | |
| 14 | static const UINT8 blockheader[] = { 0x55, 0x3C }; | |
| 15 | 15 | |
| 16 | 16 | WAVEMODULE( |
| 17 | 17 | cococas, |
| r1581 | r1582 | |
|---|---|---|
| 3 | 3 | #include "utils.h" |
| 4 | 4 | #include "formats/ti85_ser.h" |
| 5 | 5 | |
| 6 | static const char *var_type[] = { | |
| 6 | static const char *const var_type[] = { | |
| 7 | 7 | "Real number", //0x00 |
| 8 | 8 | "Complex number", //0x01 |
| 9 | 9 | "Real vector", //0x02 |
| r1581 | r1582 | |
|---|---|---|
| 52 | 52 | |
| 53 | 53 | #define D64_MAX_TRACKS 40 |
| 54 | 54 | |
| 55 | static int d64_sectors_per_track[] = | |
| 55 | static const int d64_sectors_per_track[] = | |
| 56 | 56 | { |
| 57 | 57 | 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, |
| 58 | 58 | 19, 19, 19, 19, 19, 19, 19, |
| r1581 | r1582 | |
| 139 | 139 | |
| 140 | 140 | #define D71_MAX_TRACKS 70 |
| 141 | 141 | |
| 142 | int d71_sectors_per_track[] = | |
| 142 | static const int d71_sectors_per_track[] = | |
| 143 | 143 | { |
| 144 | 144 | 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, |
| 145 | 145 | 19, 19, 19, 19, 19, 19, 19, |
| r1581 | r1582 | |
| 1201 | 1201 | static int d81_image_create(const imgtool_module *mod, imgtool_stream *f, const ResolvedOption *options_) |
| 1202 | 1202 | { |
| 1203 | 1203 | unsigned char sector[0x100]={0}; |
| 1204 | unsigned char id[2]={'1','2'}; | |
| 1204 | static const unsigned char id[2]={'1','2'}; | |
| 1205 | 1205 | int t,s,i; |
| 1206 | 1206 | |
| 1207 | 1207 | for (t=1; t<=80; t++) { |
| r1581 | r1582 | |
|---|---|---|
| 363 | 363 | int ret; |
| 364 | 364 | UINT8 sector_data[DATA_SIZE + 4]; |
| 365 | 365 | |
| 366 | UINT8 sector_header[24] = { | |
| 366 | static UINT8 sector_header[24] = { | |
| 367 | 367 | 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0xFE, 0xE7, |
| 368 | 368 | 0x18, 0xC3, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, |
| 369 | 369 | 0x80, 0x80, 0x80, 0x00, 0xC3, 0x18, 0xE7, 0xFE |
| r1581 | r1582 | |
|---|---|---|
| 9 | 9 | #include <assert.h> |
| 10 | 10 | #include "imgterrs.h" |
| 11 | 11 | |
| 12 | static const char *msgs[] = | |
| 12 | static const char *const msgs[] = | |
| 13 | 13 | { |
| 14 | 14 | "Out of memory", |
| 15 | 15 | "Unexpected error", |
| r1581 | r1582 | |
|---|---|---|
| 90 | 90 | static int rate; |
| 91 | 91 | |
| 92 | 92 | /* Represents wave duties of 12.5%, 25%, 50% and 75% */ |
| 93 | static float wave_duty_table[4] = { 8, 4, 2, 1.33 }; | |
| 93 | static const float wave_duty_table[4] = { 8, 4, 2, 1.33 }; | |
| 94 | 94 | static INT32 env_length_table[8]; |
| 95 | 95 | static INT32 swp_time_table[8]; |
| 96 | 96 | static UINT32 period_table[MAX_FREQUENCIES]; |
| r1581 | r1582 | |
|---|---|---|
| 19 | 19 | |
| 20 | 20 | static sound_stream *mixer_channel; |
| 21 | 21 | |
| 22 | static UINT16 dai_osc_volume_table[] = { 0, 500, 1000, 1500, | |
| 22 | static const UINT16 dai_osc_volume_table[] = { | |
| 23 | 0, 500, 1000, 1500, | |
| 23 | 24 | 2000, 2500, 3000, 3500, |
| 24 | 25 | 4000, 4500, 5000, 5500, |
| 25 | 26 | 6000, 6500, 7000, 7500}; |
| 26 | 27 | |
| 27 | static UINT16 dai_noise_volume_table[] = { | |
| 28 | static const UINT16 dai_noise_volume_table[] = { | |
| 28 | 29 | 0, 0, 0, 0, |
| 30 | 0, 0, 0, 0, | |
| 29 | 31 | 500, 1000, 1500, 2000, |
| 30 | 32 | 2500, 3000, 3500, 4000}; |
| 31 | 33 |
| r1581 | r1582 | |
|---|---|---|
| 806 | 806 | |
| 807 | 807 | const char *image_error(mess_image *image) |
| 808 | 808 | { |
| 809 | static const char *messages[] = | |
| 809 | static const char *const messages[] = | |
| 810 | 810 | { |
| 811 | 811 | NULL, |
| 812 | 812 | "Internal error", |
| r1581 | r1582 | |
|---|---|---|
| 352 | 352 | { |
| 353 | 353 | /* this is a a static graphical object */ |
| 354 | 354 | /* should be easy to convert to gfx_element!? */ |
| 355 | static UINT8 blackmask[] = | |
| 355 | static const UINT8 blackmask[] = | |
| 356 | 356 | {0x00, 0x70, 0x60, 0x50, 0x08, 0x04, 0x00, 0x00}; |
| 357 | static UINT8 whitemask[] = | |
| 357 | static const UINT8 whitemask[] = | |
| 358 | 358 | {0xf0, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00}; |
| 359 | 359 | int i, j, y, x; |
| 360 | 360 |
| r1581 | r1582 | |
|---|---|---|
| 160 | 160 | static void beta_Set_VSync(int offset, int data); |
| 161 | 161 | static void beta_Set_DE(int offset, int data); |
| 162 | 162 | |
| 163 | static const struct m6845_interface | |
| 164 | beta_m6845_interface= { | |
| 163 | static const struct m6845_interface beta_m6845_interface = { | |
| 165 | 164 | 0, // Memory Address register |
| 166 | 165 | beta_Set_RA, // Row Address register |
| 167 | 166 | beta_Set_HSync, // Horizontal status |
| r1581 | r1582 | |
|---|---|---|
| 73 | 73 | video_start_generic(machine); |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | static void hp48_draw_special(mame_bitmap *bitmap,int x, int y, const char *figure, int color) | |
| 76 | typedef const char *HP48_FIGURE; | |
| 77 | ||
| 78 | static void hp48_draw_special(mame_bitmap *bitmap,int x, int y, const HP48_FIGURE figure, int color) | |
| 77 | 79 | { |
| 78 | 80 | int j, xi=0; |
| 79 | 81 | for (j=0; figure[j]; j++) { |
| r1581 | r1582 | |
| 96 | 98 | |
| 97 | 99 | #define LCD_LINES (hp48_hardware.data[0x28]|((hp48_hardware.data[0x29]&3)<<4) |
| 98 | 100 | |
| 99 | static const char *hp48_orange={ | |
| 101 | ||
| 102 | static const HP48_FIGURE hp48_orange={ | |
| 100 | 103 | "11111111111\r" |
| 101 | 104 | "111 1111111\r" |
| 102 | 105 | "11 1111111\r" |
| r1581 | r1582 | |
| 104 | 107 | "11 11111 1\r" |
| 105 | 108 | "111 11111 1\r" |
| 106 | 109 | "111111111 1" |
| 107 | }, | |
| 110 | }, | |
| 108 | 111 | "11111111111\r" |
| 109 | 112 | "1111111 111\r" |
| 110 | 113 | "1111111 11\r" |
| r1581 | r1582 | |
| 112 | 115 | "1 11111 11\r" |
| 113 | 116 | "1 11111 111\r" |
| 114 | 117 | "1 111111111" |
| 115 | }, | |
| 118 | }, | |
| 116 | 119 | " 1\r" |
| 117 | 120 | " 11111 1\r" |
| 118 | 121 | " 1 1\r" |
| r1581 | r1582 | |
| 120 | 123 | " 1 1\r" |
| 121 | 124 | " 1 11\r" |
| 122 | 125 | " 11111 1" |
| 123 | }, | |
| 126 | }, | |
| 124 | 127 | " 1 1\r" |
| 125 | 128 | " 1 1 1 1\r" |
| 126 | 129 | "1 1 1 1 1\r" |
| r1581 | r1582 | |
| 128 | 131 | "1 1 1 1 1\r" |
| 129 | 132 | " 1 1 1 1\r" |
| 130 | 133 | " 1 1" |
| 131 | }, | |
| 134 | }, | |
| 132 | 135 | "11111111\r" |
| 133 | 136 | " 1 1\r" |
| 134 | 137 | " 1 1\r" |
| r1581 | r1582 | |
| 136 | 139 | " 1 1\r" |
| 137 | 140 | " 1 1\r" |
| 138 | 141 | "11111111" |
| 139 | }, | |
| 142 | }, | |
| 140 | 143 | " 11\r" |
| 141 | 144 | "1 1 1\r" |
| 142 | 145 | " 1 1\r" |
| r1581 | r1582 | |
|---|---|---|
| 516 | 516 | } |
| 517 | 517 | } |
| 518 | 518 | |
| 519 | static const unsigned char (*key_translate[])[91] = | |
| 519 | static const unsigned char (*const key_translate[])[91] = | |
| 520 | 520 | { /* array must use same order as vdt911_model_t!!! */ |
| 521 | 521 | /* US */ |
| 522 | 522 | US_key_translate, |
| r1581 | r1582 | |
|---|---|---|
| 125 | 125 | 701e .. 703b, 721e..723b, 741e ..743b, 761e ..763b, 781e .. 783b |
| 126 | 126 | 705e .. 707b, 725e..727b, 745e ..747b, 765e ..767b, 785e .. 787b |
| 127 | 127 | 783c: 0 SHIFT 1 DEF 4 RUN 5 PRO 6 JAPAN 7 SML */ |
| 128 | static int pc1350_addr[4]={ 0, 0x40, 0x1e, 0x5e }; | |
| 128 | static const int pc1350_addr[4]={ 0, 0x40, 0x1e, 0x5e }; | |
| 129 | 129 | |
| 130 | 130 | #define DOWN 45 |
| 131 | 131 | #define RIGHT 76 |
| r1581 | r1582 | |
|---|---|---|
| 71 | 71 | |
| 72 | 72 | for (x = 0; x < 4; x++) |
| 73 | 73 | { |
| 74 | static int layout[6][4] = | |
| 74 | static const int layout[6][4] = | |
| 75 | 75 | { |
| 76 | 76 | {22, 19, 21, 23}, |
| 77 | 77 | {16, 17, 20, 18}, |
| r1581 | r1582 | |
|---|---|---|
| 1172 | 1172 | |
| 1173 | 1173 | |
| 1174 | 1174 | |
| 1175 | static void (*graphics_modes[8])(UINT32 *line, const m6847_pixel *video_data) = | |
| 1175 | static void (*const graphics_modes[8])(UINT32 *line, const m6847_pixel *video_data) = | |
| 1176 | 1176 | { |
| 1177 | 1177 | graphics_color_64, graphics_bw_128, |
| 1178 | 1178 | graphics_color_128, graphics_bw_128, |
| r1581 | r1582 | |
|---|---|---|
| 455 | 455 | |
| 456 | 456 | static void kaypro_pixel(int x, int y, int set) |
| 457 | 457 | { |
| 458 | static int attr_bits[4][2] = { | |
| 458 | static const int attr_bits[4][2] = { | |
| 459 | 459 | { 0x002, 0x001}, |
| 460 | 460 | { 0x008, 0x004}, |
| 461 | 461 | { 0x020, 0x010}, |
| r1581 | r1582 | |
|---|---|---|
| 103 | 103 | |
| 104 | 104 | /* The PC1512 has not got a full MC6845; the first 9 registers act as if they |
| 105 | 105 | * had these hardwired values: */ |
| 106 | static UINT8 pc1512_defaults[] = | |
| 106 | static const UINT8 pc1512_defaults[] = | |
| 107 | 107 | { |
| 108 | 108 | 113, 80, 90, 10, 127, 6, 100, 112, 2 |
| 109 | 109 | }; |
| r1581 | r1582 | |
|---|---|---|
| 82 | 82 | |
| 83 | 83 | for (x = 0; x < 4; x++) |
| 84 | 84 | { |
| 85 | static int layout[6][4] = | |
| 85 | static const int layout[6][4] = | |
| 86 | 86 | { |
| 87 | 87 | {22, 19, 21, 23}, |
| 88 | 88 | {16, 17, 20, 18}, |
| r1581 | r1582 | |
|---|---|---|
| 26 | 26 | #define LTGREEN 6 |
| 27 | 27 | #define LTBLUE 7 |
| 28 | 28 | |
| 29 | static UINT16 colormap[] = { | |
| 29 | static const UINT16 colormap[] = { | |
| 30 | 30 | BLACK, WHITE, WHITE, WHITE, |
| 31 | 31 | LTBLUE, BLUE, RED, GREEN, |
| 32 | 32 | LTGRAY, BLUE, RED, GREEN, |
| r1581 | r1582 | |
|---|---|---|
| 252 | 252 | |
| 253 | 253 | |
| 254 | 254 | |
| 255 | static struct mscrtc6845_config config= { 14318180 /*?*/, pc_cga_cursor }; | |
| 255 | static struct mscrtc6845_config config = { 14318180 /*?*/, pc_cga_cursor }; | |
| 256 | 256 | |
| 257 | 257 | static int internal_pc_cga_video_start(int personality) |
| 258 | 258 | { |
| r1581 | r1582 | |
|---|---|---|
| 112 | 112 | {125,123}, |
| 113 | 113 | }; |
| 114 | 114 | |
| 115 | static const char | |
| 115 | static const char | |
| 116 | 116 | " c 1 1\r" |
| 117 | 117 | " bb ccccc bb 1 1\r" |
| 118 | 118 | " bb c bb 1 1\r" |
| r1581 | r1582 | |
|---|---|---|
| 104 | 104 | #endif |
| 105 | 105 | |
| 106 | 106 | // local copy of the 6845 external procedure calls |
| 107 | static struct m6845_interface | |
| 108 | crct6845_calls= { | |
| 107 | static struct m6845_interface crct6845_calls = | |
| 108 | { | |
| 109 | 109 | 0,// Memory Address register |
| 110 | 110 | 0,// Row Address register |
| 111 | 111 | 0,// Horizontal status |
| r1581 | r1582 | |
|---|---|---|
| 107 | 107 | 0x2750,0x27d0,0x2f50,0x2fd0,0x3750,0x37d0,0x3f50,0x3fd0 |
| 108 | 108 | }; |
| 109 | 109 | |
| 110 | static int offs_0[96] = { | |
| 110 | static const int offs_0[96] = { | |
| 111 | 111 | 0x2000,0x2800,0x3000,0x3800,0x2100,0x2900,0x3100,0x3900, |
| 112 | 112 | 0x2200,0x2a00,0x3200,0x3a00,0x2300,0x2b00,0x3300,0x3b00, |
| 113 | 113 | 0x2400,0x2c00,0x3400,0x3c00,0x2500,0x2d00,0x3500,0x3d00, |
| r1581 | r1582 | |
|---|---|---|
| 213 | 213 | |
| 214 | 214 | */ |
| 215 | 215 | |
| 216 | static int horizontal_next_state_table[]= | |
| 216 | static const int horizontal_next_state_table[]= | |
| 217 | 217 | { |
| 218 | 218 | 1,2,3,0 |
| 219 | 219 | }; |
| 220 | 220 | |
| 221 | 221 | /* number of cycles for each state */ |
| 222 | static int horizontal_graphics_state_cycles[]= | |
| 222 | static const int horizontal_graphics_state_cycles[]= | |
| 223 | 223 | { |
| 224 | 224 | /* left border */ |
| 225 | 225 | (KC85_LEFT_BORDER_SIZE*KC85_CYCLES_PER_PIXEL), |
| r1581 | r1582 | |
| 231 | 231 | (KC85_RETRACE_SIZE*KC85_CYCLES_PER_PIXEL) |
| 232 | 232 | }; |
| 233 | 233 | |
| 234 | static int vertical_next_state_table[]= | |
| 234 | static const int vertical_next_state_table[]= | |
| 235 | 235 | { |
| 236 | 236 | 1,2,3,0 |
| 237 | 237 | }; |
| 238 | 238 | |
| 239 | 239 | /* number of lines for each state */ |
| 240 | static int vertical_graphics_state_lines[]= | |
| 240 | static const int vertical_graphics_state_lines[]= | |
| 241 | 241 | { |
| 242 | 242 | /* top border */ |
| 243 | 243 | KC85_TOP_BORDER_SIZE*KC85_CYCLES_PER_LINE, |
| r1581 | r1582 | |
|---|---|---|
| 644 | 644 | char buf[256]; |
| 645 | 645 | struct file_dialog_params *params; |
| 646 | 646 | struct storeval_optres_params *storeval_params; |
| 647 | const struct dialog_layout filedialog_layout = { 44, 220 }; | |
| 647 | static const struct dialog_layout filedialog_layout = { 44, 220 }; | |
| 648 | 648 | |
| 649 | 649 | // make the filter |
| 650 | 650 | pos = 0; |
| r1581 | r1582 | |
|---|---|---|
| 23 | 23 | |
| 24 | 24 | enum enum_system { WSWAN=0, WSC }; |
| 25 | 25 | enum enum_sram { SRAM_NONE=0, SRAM_64K, SRAM_256K, SRAM_512K, SRAM_1M, SRAM_2M, EEPROM_1K, EEPROM_16K, EEPROM_8K, SRAM_UNKNOWN }; |
| 26 | static const char* wswan_sram_str[] = { "none", "64Kbit SRAM", "256Kbit SRAM", "512Kbit SRAM", "1Mbit SRAM", "2Mbit SRAM", "1Kbit EEPROM", "16Kbit EEPROM", "8Kbit EEPROM", "Unknown" }; | |
| 26 | static const char *const wswan_sram_str[] = { "none", "64Kbit SRAM", "256Kbit SRAM", "512Kbit SRAM", "1Mbit SRAM", "2Mbit SRAM", "1Kbit EEPROM", "16Kbit EEPROM", "8Kbit EEPROM", "Unknown" }; | |
| 27 | 27 | static const int wswan_sram_size[] = { 0, 64*1024/8, 256*1024/8, 512*1024/8, 1024*1024/8, 2*1024*1024/8, 1024/8, 16*1024/8, 8*1024/8, 0 }; |
| 28 | 28 | |
| 29 | 29 | struct EEPROM { |
| r1581 | r1582 | |
| 1245 | 1245 | |
| 1246 | 1246 | #ifdef MAME_DEBUG |
| 1247 | 1247 | enum enum_romsize { ROM_4M=0, ROM_8M, ROM_16M, ROM_32M, ROM_64M, ROM_128M, ROM_UNKNOWN }; |
| 1248 | static const char* wswan_romsize_str[] = { | |
| 1248 | static const char *const wswan_romsize_str[] = { | |
| 1249 | 1249 | "4Mbit", "8Mbit", "16Mbit", "32Mbit", "64Mbit", "128Mbit", "Unknown" |
| 1250 | 1250 | }; |
| 1251 | 1251 |
| r1581 | r1582 | |
|---|---|---|
| 931 | 931 | static int apple2gs_get_vpos(void) |
| 932 | 932 | { |
| 933 | 933 | int result, scan; |
| 934 | static UINT8 top_border_vert[BORDER_TOP] = | |
| 934 | static const UINT8 top_border_vert[BORDER_TOP] = | |
| 935 | 935 | { |
| 936 | 936 | 0xfa, 0xfa, 0xfa, 0xfa, 0xfb, 0xfb, 0xfb, 0xfb, |
| 937 | 937 | 0xfc, 0xfc, 0xfc, 0xfd, 0xfd, 0xfe, 0xfe, 0xff, |
| r1581 | r1582 | |
|---|---|---|
| 278 | 278 | |
| 279 | 279 | static void iwm_access(int offset) |
| 280 | 280 | { |
| 281 | static const char *lines[] = | |
| 281 | static const char *const lines[] = | |
| 282 | 282 | { |
| 283 | 283 | "PH0", |
| 284 | 284 | "PH1", |
| r1581 | r1582 | |
|---|---|---|
| 160 | 160 | case 0x0a: return 0x40; break; |
| 161 | 161 | case 0x0d: |
| 162 | 162 | { |
| 163 | static UINT32 irq_sequence[3] = { 0, 4, 12 }; | |
| 163 | static const UINT32 irq_sequence[3] = { 0, 4, 12 }; | |
| 164 | 164 | static int counter = 0; |
| 165 | 165 | |
| 166 | 166 | return irq_sequence[(counter++)%3]; |
| r1581 | r1582 | |
|---|---|---|
| 1298 | 1298 | |
| 1299 | 1299 | /* initialize floppy */ |
| 1300 | 1300 | { |
| 1301 | struct applefdc_interface intf = | |
| 1301 | static const struct applefdc_interface intf = | |
| 1302 | 1302 | { |
| 1303 | 1303 | APPLEFDC_IWM, |
| 1304 | 1304 | sony_set_lines, |
| r1581 | r1582 | |
| 2346 | 2346 | { 23, "ReturnDriveInfo" } |
| 2347 | 2347 | }; |
| 2348 | 2348 | |
| 2349 | static const char *scsisels[] = | |
| 2349 | static const char *const scsisels[] = | |
| 2350 | 2350 | { |
| 2351 | 2351 | "SCSIReset", /* $00 */ |
| 2352 | 2352 | "SCSIGet", /* $01 */ |
| r1581 | r1582 | |
|---|---|---|
| 523 | 523 | int DCB_Num, deviceNum, statusDCB; |
| 524 | 524 | int i, buffer, byteCount, sectorNmbr, sectorCount, currentSector; |
| 525 | 525 | UINT8 kbcode; |
| 526 | static UINT8 interleave[8] = {0,5,2,7,4,1,6,3}; | |
| 526 | static const UINT8 interleave[8] = {0,5,2,7,4,1,6,3}; | |
| 527 | 527 | mess_image *image; |
| 528 | 528 | |
| 529 | 529 | if (offset == adam_pcb) |
| r1581 | r1582 | |
|---|---|---|
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | //static const struct mscrtc6845_config cbm600_crtc= { 1600000 /*?*/, cbmb_vh_cursor }; |
| 254 | ||
| 254 | ||
| 255 | 255 | 0, |
| 256 | 256 | 1600000 /*?*/, |
| 257 | 257 | 8 /*?*/, |
| r1581 | r1582 | |
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | //static const struct mscrtc6845_config cbm700_crtc= { 2000000 /*?*/, cbmb_vh_cursor }; |
| 288 | ||
| 288 | ||
| 289 | 289 | 0, |
| 290 | 290 | 2000000 /*?*/, |
| 291 | 291 | 9 /*?*/, |
| r1581 | r1582 | |
|---|---|---|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | WRITE8_HANDLER( pokemini_hwreg_w ) { |
| 106 | const int timer_to_cycles[8] = { 2, 8, 32, 64, 128, 256, 1024, 4096 }; | |
| 106 | static const int timer_to_cycles[8] = { 2, 8, 32, 64, 128, 256, 1024, 4096 }; | |
| 107 | 107 | logerror( "%0X: Write to hardware address: %02X, %02X\n", activecpu_get_pc(), offset, data ); |
| 108 | 108 | switch( offset ) { |
| 109 | 109 | case 0x00: /* start-up contrast |
| r1581 | r1582 | |
|---|---|---|
| 112 | 112 | |
| 113 | 113 | // Bits 0,1 of control Register |
| 114 | 114 | |
| 115 | static int divide_by_lookup[4]={1,16,64,0}; | |
| 115 | static const int divide_by_lookup[4]={1,16,64,0}; | |
| 116 | 116 | static int divide_by; |
| 117 | 117 | |
| 118 | 118 | |
| 119 | 119 | // Bits 2,3,4 of control Register |
| 120 | 120 | |
| 121 | static int word_length_lookup[8]={7,7,7,7,8,8,8,8}; | |
| 121 | static const int word_length_lookup[8]={7,7,7,7,8,8,8,8}; | |
| 122 | 122 | static int word_length; |
| 123 | 123 | |
| 124 | 124 | // Parity Settings |
| 125 | 125 | // 2 = even |
| 126 | 126 | // 1 = odd |
| 127 | 127 | // 0 = no parity bit |
| 128 | static int parity_lookup[8]={2,1,2,1,0,0,2,1}; | |
| 128 | static const int parity_lookup[8]={2,1,2,1,0,0,2,1}; | |
| 129 | 129 | static int parity; |
| 130 | 130 | |
| 131 | static int stop_bits_lookup[8]={2,2,1,1,2,1,1,1}; | |
| 131 | static const int stop_bits_lookup[8]={2,2,1,1,2,1,1,1}; | |
| 132 | 132 | static int stop_bits; |
| 133 | 133 | |
| 134 | 134 | // Bits 5,6 of control Register |
| 135 | 135 | |
| 136 | static int RTS_lookup[4]={0,0,1,0}; | |
| 136 | static const int RTS_lookup[4]={0,0,1,0}; | |
| 137 | 137 | static int RTS; |
| 138 | 138 | |
| 139 | static int break_level_lookup[4]={0,0,0,1}; | |
| 139 | static const int break_level_lookup[4]={0,0,0,1}; | |
| 140 | 140 | static int break_level; |
| 141 | 141 | |
| 142 | 142 | // transmitting Interrupt 0 = Disabled 1 = Enabled |
| 143 | static int transmit_interrupt_enabled_lookup[4]={0,1,0,0}; | |
| 143 | static const int transmit_interrupt_enabled_lookup[4]={0,1,0,0}; | |
| 144 | 144 | static int transmit_interrupt_enabled; |
| 145 | 145 | |
| 146 | 146 | // Bit 7 of control Register |
| r1581 | r1582 | |
| 153 | 153 | |
| 154 | 154 | |
| 155 | 155 | //Local copy of the MC6850 external procedure calls |
| 156 | static struct MC6850_interface | |
| 157 | MC6850_calls= { | |
| 156 | static struct MC6850_interface MC6850_calls = | |
| 157 | { | |
| 158 | 158 | 0,// Transmit data ouput |
| 159 | 159 | 0,// Request to Send output |
| 160 | 160 | 0,// Interupt Request output |
| r1581 | r1582 | |
|---|---|---|
| 395 | 395 | memory_install_write16_handler(0, ADDRESS_SPACE_PROGRAM, base, base + 0xFFFF, 0, 0, MWA16_UNMAP); |
| 396 | 396 | } |
| 397 | 397 | |
| 398 | static amiga_autoconfig_device dmac_device = | |
| 398 | static const amiga_autoconfig_device dmac_device = | |
| 399 | 399 | { |
| 400 | 400 | 0, /* link into free memory list */ |
| 401 | 401 | 0, /* ROM vector offset valid */ |
| r1581 | r1582 | |
|---|---|---|
| 1447 | 1447 | int Checksum, I, J, filesize; |
| 1448 | 1448 | UINT16 reported_rom_banks; |
| 1449 | 1449 | UINT8 *gb_header; |
| 1450 | int rambanks[8] = {0, 1, 1, 4, 16, 8, 0, 0}; | |
| 1450 | static const int rambanks[8] = {0, 1, 1, 4, 16, 8, 0, 0}; | |
| 1451 | 1451 | |
| 1452 | 1452 | filesize = image_length(image); |
| 1453 | 1453 | |
| r1581 | r1582 | |
| 1633 | 1633 | { |
| 1634 | 1634 | const char *P; |
| 1635 | 1635 | char S[50]; |
| 1636 | int ramsize[8] = { 0, 2, 8, 32, 128, 64, 0, 0 }; | |
| 1636 | static const int ramsize[8] = { 0, 2, 8, 32, 128, 64, 0, 0 }; | |
| 1637 | 1637 | |
| 1638 | 1638 | |
| 1639 | 1639 | strncpy (S, (char *)&gb_header[0x0134], 16); |
| r1581 | r1582 | |
| 1878 | 1878 | |
| 1879 | 1879 | /* Map megaduck audio offset to gameboy audio offsets */ |
| 1880 | 1880 | |
| 1881 | static UINT8 megaduck_sound_offsets[16] = { 0, 2, 1, 3, 4, 6, 5, 7, 8, 9, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }; | |
| 1881 | static const UINT8 megaduck_sound_offsets[16] = { 0, 2, 1, 3, 4, 6, 5, 7, 8, 9, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }; | |
| 1882 | 1882 | |
| 1883 | 1883 | WRITE8_HANDLER( megaduck_sound_w1 ) |
| 1884 | 1884 | { |
| r1581 | r1582 | |
|---|---|---|
| 679 | 679 | |
| 680 | 680 | static READ8_HANDLER(concept_fdc_rom_r) |
| 681 | 681 | { |
| 682 | UINT8 data[8] = "CORVUS01"; | |
| 682 | static const UINT8 data[8] = "CORVUS01"; | |
| 683 | 683 | return (offset < 8) ? data[offset] : 0; |
| 684 | 684 | } |
| 685 | 685 | |
| r1581 | r1582 | |
| 743 | 743 | */ |
| 744 | 744 | static READ8_HANDLER(concept_hdc_rom_r) |
| 745 | 745 | { |
| 746 | UINT8 data[8] = { 0xa9, 0x20, 0xa9, 0x00, 0xa9, 0x03, 0xa9, 0x3c }; /* Same as Apple II */ | |
| 746 | static const UINT8 data[8] = { 0xa9, 0x20, 0xa9, 0x00, 0xa9, 0x03, 0xa9, 0x3c }; /* Same as Apple II */ | |
| 747 | 747 | return (offset < 8) ? data[offset] : 0; |
| 748 | 748 | } |
| r1581 | r1582 | |
|---|---|---|
| 36 | 36 | UINT8 *dst; |
| 37 | 37 | int x, y, i; |
| 38 | 38 | |
| 39 | static const char | |
| 39 | static const char | |
| 40 | 40 | "....aaaaaaaaaaaaa." \ |
| 41 | 41 | "...f.aaaaaaaaaaa.b" \ |
| 42 | 42 | "...ff.aaaaaaaaa.bb" \ |
| r1581 | r1582 | |
|---|---|---|
| 61 | 61 | /* on rising edge, sets DVENA for 4.23 seconds on rising edge */ |
| 62 | 62 | static int motor_on; |
| 63 | 63 | /* count 4.23s from rising edge of motor_on */ |
| 64 | void *motor_on_timer; | |
| 64 | static void *motor_on_timer; | |
| 65 | 65 | |
| 66 | 66 | /* |
| 67 | 67 | call this when the state of DSKhold or DRQ/IRQ or DVENA change |
| r1581 | r1582 | |
|---|---|---|
| 336 | 336 | int i, n; |
| 337 | 337 | |
| 338 | 338 | /* z80 stuff */ |
| 339 | static int z80_cycle_table[] = | |
| 339 | static const int z80_cycle_table[] = | |
| 340 | 340 | { |
| 341 | 341 | Z80_TABLE_op, Z80_TABLE_cb, Z80_TABLE_xy, |
| 342 | 342 | Z80_TABLE_ed, Z80_TABLE_xycb, Z80_TABLE_ex |
| r1581 | r1582 | |
|---|---|---|
| 56 | 56 | static GAMECOM_DMA gamecom_dma; |
| 57 | 57 | static GAMECOM_TIMER gamecom_timer[2]; |
| 58 | 58 | |
| 59 | //int gamecom_timer_limit[8] = { 2/2, 1024/2, 2048/2, 4096/2, 8192/2, 16384/2, 32768/2, 65536/2 }; | |
| 60 | static int gamecom_timer_limit[8] = { 2, 1024, 2048, 4096, 8192, 16384, 32768, 65536 }; | |
| 59 | //static const int gamecom_timer_limit[8] = { 2/2, 1024/2, 2048/2, 4096/2, 8192/2, 16384/2, 32768/2, 65536/2 }; | |
| 60 | static const int gamecom_timer_limit[8] = { 2, 1024, 2048, 4096, 8192, 16384, 32768, 65536 }; | |
| 61 | 61 | |
| 62 | 62 | static void gamecom_dma_init(void); |
| 63 | 63 |
| r1581 | r1582 | |
|---|---|---|
| 175 | 175 | static CBM_Drive_Emu vc1541_static= { 0 }, *vc1541 = &vc1541_static; |
| 176 | 176 | |
| 177 | 177 | /* four different frequencies for the 4 different zones on the disk */ |
| 178 | static double vc1541_times[4]= { | |
| 178 | static const double vc1541_times[4]= { | |
| 179 | 179 | 13/16e6, 14/16e6, 15/16e6, 16/16e6 |
| 180 | 180 | }; |
| 181 | 181 | |
| r1581 | r1582 | |
| 204 | 204 | * |
| 205 | 205 | * max 42 tracks, stepper resolution 84 tracks |
| 206 | 206 | */ |
| 207 | static int bin_2_gcr[] = | |
| 207 | static const int bin_2_gcr[] = | |
| 208 | 208 | { |
| 209 | 209 | 0xa, 0xb, 0x12, 0x13, 0xe, 0xf, 0x16, 0x17, |
| 210 | 210 | 9, 0x19, 0x1a, 0x1b, 0xd, 0x1d, 0x1e, 0x15 |
| 211 | 211 | }; |
| 212 | 212 | |
| 213 | 213 | #if 0 |
| 214 | static int gcr_2_bin[] = { | |
| 214 | static const int gcr_2_bin[] = { | |
| 215 | 215 | -1, -1, -1, -1, |
| 216 | 216 | -1, -1, -1, -1, |
| 217 | 217 | -1, 8, 0, 1, |
| r1581 | r1582 | |
|---|---|---|
| 1176 | 1176 | |
| 1177 | 1177 | |
| 1178 | 1178 | |
| 1179 | static chardev_interface to7_midi_interface = | |
| 1179 | static const chardev_interface to7_midi_interface = | |
| 1180 | 1180 | { |
| 1181 | 1181 | to7_midi_byte_received_cb, |
| 1182 | 1182 | to7_midi_ready_to_send_cb, |
| r1581 | r1582 | |
|---|---|---|
| 349 | 349 | } |
| 350 | 350 | |
| 351 | 351 | /* send data (queue it into the FIFO if needed) */ |
| 352 | static void COPS_queue_data(UINT8 *data, int len) | |
| 352 | static void COPS_queue_data(const UINT8 *data, int len) | |
| 353 | 353 | { |
| 354 | 354 | #if 0 |
| 355 | 355 | if (fifo_size + len <= 8) |
| r1581 | r1582 | |
| 709 | 709 | |
| 710 | 710 | static void unplug_keyboard(void) |
| 711 | 711 | { |
| 712 | UINT8 cmd[2] = | |
| 712 | static const UINT8 cmd[2] = | |
| 713 | 713 | { |
| 714 | 714 | 0x80, /* RESET code */ |
| 715 | 715 | 0xFD /* keyboard unplugged */ |
| r1581 | r1582 | |
| 737 | 737 | unknown : spanish, US dvorak, italian & swedish |
| 738 | 738 | */ |
| 739 | 739 | |
| 740 | UINT8 cmd[2] = | |
| 740 | static const UINT8 cmd[2] = | |
| 741 | 741 | { |
| 742 | 742 | 0x80, /* RESET code */ |
| 743 | 743 | 0x3f /* keyboard ID - US for now */ |
| r1581 | r1582 | |
| 1177 | 1177 | |
| 1178 | 1178 | /* initialize floppy */ |
| 1179 | 1179 | { |
| 1180 | struct applefdc_interface intf = | |
| 1180 | static struct applefdc_interface intf = | |
| 1181 | 1181 | { |
| 1182 | 1182 | APPLEFDC_IWM, |
| 1183 | 1183 | sony_set_lines, |
| r1581 | r1582 | |
| 1223 | 1223 | if (clock_regs.alarm == 0) |
| 1224 | 1224 | { |
| 1225 | 1225 | /* generate reset (should cause a VIA interrupt...) */ |
| 1226 | UINT8 cmd[2] = | |
| 1226 | static const UINT8 cmd[2] = | |
| 1227 | 1227 | { |
| 1228 | 1228 | 0x80, /* RESET code */ |
| 1229 | 1229 | 0xFC /* timer time-out */ |
| r1581 | r1582 | |
|---|---|---|
| 264 | 264 | |
| 265 | 265 | if (has_speech) |
| 266 | 266 | { |
| 267 | spchroms_interface speech_intf = { region_speech_rom }; | |
| 267 | static const spchroms_interface speech_intf = { region_speech_rom }; | |
| 268 | 268 | |
| 269 | 269 | spchroms_config(& speech_intf); |
| 270 | 270 | } |
| r1581 | r1582 | |
|---|---|---|
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | static UINT8 c128_mmu[0x0b]; |
| 250 | static int c128_mmu_helper[4] = | |
| 250 | static const int c128_mmu_helper[4] = | |
| 251 | 251 | {0x400, 0x1000, 0x2000, 0x4000}; |
| 252 | 252 | static int mmu_cpu=0; |
| 253 | 253 | static int mmu_page0, mmu_page1; |
| r1581 | r1582 | |
|---|---|---|
| 20 | 20 | static int ds1315_count; |
| 21 | 21 | static int ds1315_mode; |
| 22 | 22 | static int ds1315_raw_data[8*8]; |
| 23 | static int ds1315_pattern[] = { 1, 0, 1, 0, 0, 0, 1, 1, | |
| 23 | static const int ds1315_pattern[] = { 1, 0, 1, 0, 0, 0, 1, 1, | |
| 24 | 24 | 0, 1, 0, 1, 1, 1, 0, 0, |
| 25 | 25 | 1, 1, 0, 0, 0, 1, 0, 1, |
| 26 | 26 | 0, 0, 1, 1, 1, 0, 1, 0, |
| r1581 | r1582 | |
|---|---|---|
| 487 | 487 | static void pet_display_enable_changed(int display_enabled) { |
| 488 | 488 | } |
| 489 | 489 | |
| 490 | ||
| 490 | ||
| 491 | 491 | 0, |
| 492 | 492 | 800000 /*?*/, |
| 493 | 493 | 8 /*?*/, |
| r1581 | r1582 | |
| 497 | 497 | pet_display_enable_changed |
| 498 | 498 | }; |
| 499 | 499 | |
| 500 | ||
| 500 | ||
| 501 | 501 | 0, |
| 502 | 502 | 800000 /*?*/, |
| 503 | 503 | 16 /*?*/, |
| r1581 | r1582 | |
|---|---|---|
| 20 | 20 | UINT8 *dst; |
| 21 | 21 | int x, y, i; |
| 22 | 22 | |
| 23 | static const char | |
| 23 | static const char | |
| 24 | 24 | "....aaaaaaaaaaaaa." \ |
| 25 | 25 | "...f.aaaaaaaaaaa.b" \ |
| 26 | 26 | "...ff.aaaaaaaaa.bb" \ |
| r1581 | r1582 | |
| 47 | 47 | ".................."; |
| 48 | 48 | |
| 49 | 49 | |
| 50 | static const char *keys[24] = | |
| 50 | static const char *const keys[24] = | |
| 51 | 51 | { |
| 52 | 52 | "........................" \ |
| 53 | 53 | "........................" \ |
| r1581 | r1582 | |
|---|---|---|
| 63 | 63 | |
| 64 | 64 | DRIVER_INIT( atcga ) |
| 65 | 65 | { |
| 66 | struct kbdc8042_interface at8042 = | |
| 66 | static const struct kbdc8042_interface at8042 = | |
| 67 | 67 | { |
| 68 | 68 | KBDC8042_STANDARD, at_set_gate_a20, at_keyboard_interrupt |
| 69 | 69 | }; |
| r1581 | r1582 | |
| 74 | 74 | |
| 75 | 75 | DRIVER_INIT( at386 ) |
| 76 | 76 | { |
| 77 | struct kbdc8042_interface at8042 = | |
| 77 | static const struct kbdc8042_interface at8042 = | |
| 78 | 78 | { |
| 79 | 79 | KBDC8042_AT386, at_set_gate_a20, at_keyboard_interrupt |
| 80 | 80 | }; |
| r1581 | r1582 | |
| 124 | 124 | |
| 125 | 125 | DRIVER_INIT( at_vga ) |
| 126 | 126 | { |
| 127 | struct kbdc8042_interface at8042 = | |
| 127 | static const struct kbdc8042_interface at8042 = | |
| 128 | 128 | { |
| 129 | 129 | KBDC8042_STANDARD, at_set_gate_a20, at_keyboard_interrupt |
| 130 | 130 | }; |
| r1581 | r1582 | |
| 138 | 138 | |
| 139 | 139 | DRIVER_INIT( ps2m30286 ) |
| 140 | 140 | { |
| 141 | struct kbdc8042_interface at8042 = | |
| 141 | static const struct kbdc8042_interface at8042 = | |
| 142 | 142 | { |
| 143 | 143 | KBDC8042_PS2, at_set_gate_a20, at_keyboard_interrupt |
| 144 | 144 | }; |
| r1581 | r1582 | |
|---|---|---|
| 608 | 608 | |
| 609 | 609 | static int vc20_rom_id(mess_image *image) |
| 610 | 610 | { |
| 611 | unsigned char magic[] = | |
| 611 | static const unsigned char magic[] = | |
| 612 | 612 | {0x41, 0x30, 0x20, 0xc3, 0xc2, 0xcd}; /* A0 CBM at 0xa004 (module offset 4) */ |
| 613 | 613 | unsigned char buffer[sizeof (magic)]; |
| 614 | 614 | const char *cp; |
| r1581 | r1582 | |
|---|---|---|
| 267 | 267 | |
| 268 | 268 | static void bebox_set_irq_bit(unsigned int interrupt_bit, int val) |
| 269 | 269 | { |
| 270 | static const char *interrupt_names[32] = | |
| 270 | static const char *const interrupt_names[32] = | |
| 271 | 271 | { |
| 272 | 272 | NULL, |
| 273 | 273 | NULL, |
| r1581 | r1582 | |
|---|---|---|
| 156 | 156 | static int tape_interrupts_enabled; |
| 157 | 157 | static int tape_unknown_write[6]; |
| 158 | 158 | static int tape_motor_mode; |
| 159 | static const char *tape_motor_mode_desc[8] = | |
| 159 | static const char *const tape_motor_mode_desc[8] = | |
| 160 | 160 | { |
| 161 | 161 | "IDLE", "IDLE", "IDLE", "IDLE", |
| 162 | 162 | "EJECT", "PLAY/RECORD", "REWIND", "FF" |
| r1581 | r1582 | |
| 440 | 440 | stic_screenrefresh(); |
| 441 | 441 | } |
| 442 | 442 | |
| 443 | static UINT8 controller_table[] = | |
| 443 | static const UINT8 controller_table[] = | |
| 444 | 444 | { |
| 445 | 445 | 0x81, 0x41, 0x21, 0x82, 0x42, 0x22, 0x84, 0x44, |
| 446 | 446 | 0x24, 0x88, 0x48, 0x28, 0xa0, 0x60, 0xc0, 0x00, |
| r1581 | r1582 | |
|---|---|---|
| 706 | 706 | The Korean game Jang Pung II also seems to use a codemasters style mapper. |
| 707 | 707 | */ |
| 708 | 708 | static int detect_codemasters_mapper( UINT8 *rom ) { |
| 709 | UINT8 | |
| 709 | static const UINT8 jang_pung2[16] = { 0x00, 0xBA, 0x38, 0x0D, 0x00, 0xB8, 0x38, 0x0C, 0x00, 0xB6, 0x38, 0x0B, 0x00, 0xB4, 0x38, 0x0A }; | |
| 710 | 710 | |
| 711 | 711 | if ( ( ( rom[0x7fe0] & 0x0F ) <= 9 ) && |
| 712 | 712 | ( rom[0x7fe3] == 0x93 || rom[0x7fe3] == 0x94 || rom[0x7fe3] == 0x95 ) && |
| r1581 | r1582 | |
| 722 | 722 | } |
| 723 | 723 | |
| 724 | 724 | static int detect_korean_mapper( UINT8 *rom ) { |
| 725 | UINT8 | |
| 725 | static const UINT8 signatures[2][16] = { | |
| 726 | 726 | { 0x3E, 0x11, 0x32, 0x00, 0xA0, 0x78, 0xCD, 0x84, 0x85, 0x3E, 0x02, 0x32, 0x00, 0xA0, 0xC9, 0xFF }, /* Dodgeball King */ |
| 727 | 727 | { 0x41, 0x48, 0x37, 0x37, 0x44, 0x37, 0x4E, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20 }, /* Sangokushi 3 */ |
| 728 | 728 | }; |
| r1581 | r1582 | |
|---|---|---|
| 191 | 191 | /* structure describing a double density track */ |
| 192 | 192 | #define TRKSIZE_DD 6144 |
| 193 | 193 | #if 0 |
| 194 | static UINT8 track_DD[][2] = { | |
| 194 | static const UINT8 track_DD[][2] = { | |
| 195 | 195 | {16, 0x4e}, /* 16 * 4E (track lead in) */ |
| 196 | 196 | { 8, 0x00}, /* 8 * 00 (pre DAM) */ |
| 197 | 197 | { 3, 0xf5}, /* 3 * F5 (clear CRC) */ |
| r1581 | r1582 | |
| 213 | 213 | /* structure describing a single density track */ |
| 214 | 214 | #define TRKSIZE_SD 3172 |
| 215 | 215 | #if 0 |
| 216 | static UINT8 track_SD[][2] = { | |
| 216 | static const UINT8 track_SD[][2] = { | |
| 217 | 217 | {16, 0xff}, /* 16 * FF (track lead in) */ |
| 218 | 218 | { 8, 0x00}, /* 8 * 00 (pre DAM) */ |
| 219 | 219 | { 1, 0xfc}, /* 1 * FC (clear CRC) */ |
| r1581 | r1582 | |
|---|---|---|
| 439 | 439 | return data; |
| 440 | 440 | } |
| 441 | 441 | |
| 442 | READ8_HANDLER( cybiko_io_reg_r ) | |
| 442 | static READ8_HANDLER( cybiko_io_reg_r ) | |
| 443 | 443 | { |
| 444 | 444 | UINT8 data = 0; |
| 445 | 445 | _logerror( 2, ("cybiko_io_reg_r (%08X)\n", offset)); |
| r1581 | r1582 | |
| 473 | 473 | return data; |
| 474 | 474 | } |
| 475 | 475 | |
| 476 | WRITE8_HANDLER( cybiko_io_reg_w ) | |
| 476 | static WRITE8_HANDLER( cybiko_io_reg_w ) | |
| 477 | 477 | { |
| 478 | 478 | _logerror( 2, ("cybiko_io_reg_w (%08X/%02X)\n", offset, data)); |
| 479 | 479 | switch (offset) |
| r1581 | r1582 | |
|---|---|---|
| 374 | 374 | |
| 375 | 375 | static void c64_cia1_port_a_w (UINT8 data) |
| 376 | 376 | { |
| 377 | static int helper[4] = {0xc000, 0x8000, 0x4000, 0x0000}; | |
| 377 | static const int helper[4] = {0xc000, 0x8000, 0x4000, 0x0000}; | |
| 378 | 378 | |
| 379 | 379 | cbm_serial_clock_write (serial_clock = !(data & 0x10)); |
| 380 | 380 | cbm_serial_data_write (serial_data = !(data & 0x20)); |
| r1581 | r1582 | |
|---|---|---|
| 543 | 543 | int i, n; |
| 544 | 544 | |
| 545 | 545 | /* z80 stuff */ |
| 546 | static int z80_cycle_table[] = | |
| 546 | static const int z80_cycle_table[] = | |
| 547 | 547 | { |
| 548 | 548 | Z80_TABLE_op, Z80_TABLE_cb, Z80_TABLE_xy, |
| 549 | 549 | Z80_TABLE_ed, Z80_TABLE_xycb, Z80_TABLE_ex |
| r1581 | r1582 | |
|---|---|---|
| 815 | 815 | |
| 816 | 816 | if (has_speech) |
| 817 | 817 | { |
| 818 | spchroms_interface speech_intf = { region_speech_rom }; | |
| 818 | static const spchroms_interface speech_intf = { region_speech_rom }; | |
| 819 | 819 | |
| 820 | 820 | spchroms_config(& speech_intf); |
| 821 | 821 |
| r1581 | r1582 | |
|---|---|---|
| 108 | 108 | |
| 109 | 109 | static void tms5501_field_interrupts(int which) |
| 110 | 110 | { |
| 111 | UINT8 int_vectors[] = { 0xc7, 0xcf, 0xd7, 0xdf, 0xe7, 0xef, 0xf7, 0xff }; | |
| 111 | static const UINT8 int_vectors[] = { 0xc7, 0xcf, 0xd7, 0xdf, 0xe7, 0xef, 0xf7, 0xff }; | |
| 112 | 112 | UINT8 current_ints = tms5501[which].pending_interrupts; |
| 113 | 113 | |
| 114 | 114 | /* disabling masked interrupts */ |
| r1581 | r1582 | |
|---|---|---|
| 1170 | 1170 | } |
| 1171 | 1171 | |
| 1172 | 1172 | |
| 1173 | static const struct via6522_interface | |
| 1174 | bbcb_system_via= { | |
| 1173 | static const struct via6522_interface bbcb_system_via = | |
| 1174 | { | |
| 1175 | 1175 | bbcb_via_system_read_porta, |
| 1176 | 1176 | bbcb_via_system_read_portb, |
| 1177 | 1177 | bbcb_via_system_read_ca1, |
| r1581 | r1582 | |
| 1307 | 1307 | via_0_cb1_w(0,data); |
| 1308 | 1308 | } |
| 1309 | 1309 | |
| 1310 | static const struct uPD7002_interface | |
| 1311 | BBC_uPD7002= { | |
| 1310 | static const struct uPD7002_interface BBC_uPD7002 = | |
| 1311 | { | |
| 1312 | 1312 | BBC_get_analogue_input, |
| 1313 | 1313 | BBC_uPD7002_EOC |
| 1314 | 1314 | }; |
| r1581 | r1582 | |
| 1362 | 1362 | //logerror("Set SIO irq %01x\n",level); |
| 1363 | 1363 | } |
| 1364 | 1364 | |
| 1365 | static const struct MC6850_interface | |
| 1366 | BBC_MC6850_calls= { | |
| 1365 | static const struct MC6850_interface BBC_MC6850_calls = | |
| 1366 | { | |
| 1367 | 1367 | 0,// Transmit data ouput |
| 1368 | 1368 | 0,// Request to Send output |
| 1369 | 1369 | Serial_interrupt,// Interupt Request output |
| r1581 | r1582 | |
|---|---|---|
| 62 | 62 | static READ8_HANDLER ( mra_bank4) { return mra_bank(3,offset); } |
| 63 | 63 | |
| 64 | 64 | /* read banked memory (handle memory mapped i/o) */ |
| 65 | static read8_handler mra_bank_soft[4] = | |
| 65 | static const read8_handler mra_bank_soft[4] = | |
| 66 | 66 | { |
| 67 | 67 | mra_bank1, /* mapped in 0000-3fff */ |
| 68 | 68 | mra_bank2, /* mapped in 4000-7fff */ |
| r1581 | r1582 | |
| 71 | 71 | }; |
| 72 | 72 | |
| 73 | 73 | /* write banked memory (handle memory mapped i/o and videoram) */ |
| 74 | static write8_handler mwa_bank_soft[4] = | |
| 74 | static const write8_handler mwa_bank_soft[4] = | |
| 75 | 75 | { |
| 76 | 76 | mwa_bank1, /* mapped in 0000-3fff */ |
| 77 | 77 | mwa_bank2, /* mapped in 4000-7fff */ |
| r1581 | r1582 | |
| 80 | 80 | }; |
| 81 | 81 | |
| 82 | 82 | /* read banked memory (plain ROM/RAM) */ |
| 83 | static read8_handler mra_bank_hard[4] = | |
| 83 | static const read8_handler mra_bank_hard[4] = | |
| 84 | 84 | { |
| 85 | 85 | MRA8_BANK1, /* mapped in 0000-3fff */ |
| 86 | 86 | MRA8_BANK2, /* mapped in 4000-7fff */ |
| r1581 | r1582 | |
| 89 | 89 | }; |
| 90 | 90 | |
| 91 | 91 | /* write banked memory (plain ROM/RAM) */ |
| 92 | static write8_handler mwa_bank_hard[4] = | |
| 92 | static const write8_handler mwa_bank_hard[4] = | |
| 93 | 93 | { |
| 94 | 94 | MWA8_BANK1, /* mapped in 0000-3fff */ |
| 95 | 95 | MWA8_BANK2, /* mapped in 4000-7fff */ |
| r1581 | r1582 | |
| 148 | 148 | |
| 149 | 149 | WRITE8_HANDLER( laser_bank_select_w ) |
| 150 | 150 | { |
| 151 | static const char *bank_name[16] = { | |
| 151 | static const char *const bank_name[16] = { | |
| 152 | 152 | "ROM lo","ROM hi","MM I/O","Video RAM lo", |
| 153 | 153 | "RAM #0","RAM #1","RAM #2","RAM #3", |
| 154 | 154 | "RAM #4","RAM #5","RAM #6","RAM #7/Video RAM hi", |
| r1581 | r1582 | |
|---|---|---|
| 136 | 136 | #define VT2_BITSAMPLES 18 |
| 137 | 137 | #define VT2_BYTESAMPLES 8*VT2_BITSAMPLES |
| 138 | 138 | |
| 139 | static INT16 vtech2_bit0[VT2_BITSAMPLES] = | |
| 139 | static const INT16 vtech2_bit0[VT2_BITSAMPLES] = | |
| 140 | 140 | { |
| 141 | 141 | /* short cycle, long cycles */ |
| 142 | 142 | VT2_HI,VT2_HI,VT2_HI,VT2_LO,VT2_LO,VT2_LO, |
| r1581 | r1582 | |
| 144 | 144 | VT2_LO,VT2_LO,VT2_LO,VT2_LO,VT2_LO,VT2_LO |
| 145 | 145 | }; |
| 146 | 146 | |
| 147 | static INT16 vtech2_bit1[VT2_BITSAMPLES] = | |
| 147 | static const INT16 vtech2_bit1[VT2_BITSAMPLES] = | |
| 148 | 148 | { |
| 149 | 149 | /* three short cycle */ |
| 150 | 150 | VT2_HI,VT2_HI,VT2_HI,VT2_LO,VT2_LO,VT2_LO, |
| r1581 | r1582 | |
|---|---|---|
| 150 | 150 | |
| 151 | 151 | static int apple2_do_translate_sector(floppy_image *floppy, int sector) |
| 152 | 152 | { |
| 153 | static UINT8 skewing[] = | |
| 153 | static const UINT8 skewing[] = | |
| 154 | 154 | { |
| 155 | 155 | /* DOS order (*.do) */ |
| 156 | 156 | 0x00, 0x07, 0x0E, 0x06, 0x0D, 0x05, 0x0C, 0x04, |
| r1581 | r1582 | |
| 163 | 163 | |
| 164 | 164 | static int apple2_po_translate_sector(floppy_image *floppy, int sector) |
| 165 | 165 | { |
| 166 | static UINT8 skewing[] = | |
| 166 | static const UINT8 skewing[] = | |
| 167 | 167 | { |
| 168 | 168 | /* ProDOS order (*.po) */ |
| 169 | 169 | 0x00, 0x08, 0x01, 0x09, 0x02, 0x0A, 0x03, 0x0B, |
| r1581 | r1582 | |
|---|---|---|
| 130 | 130 | |
| 131 | 131 | /* ZX-81 functions */ |
| 132 | 132 | |
| 133 | static UINT8 zx81_chars[]={ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*00h-07h*/ | |
| 133 | static const UINT8 zx81_chars[]={ | |
| 134 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*00h-07h*/ | |
| 134 | 135 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*08h-0fh*/ |
| 135 | 136 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*10h-17h*/ |
| 136 | 137 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /*18h-1fh*/ |
| r1581 | r1582 | |
|---|---|---|
| 616 | 616 | |
| 617 | 617 | |
| 618 | 618 | /* overloaded wav: dump info */ |
| 619 | ||
| 619 | ||
| 620 | 620 | { "wav", to7_wav_identify, to7_wav_load, to7_wav_save }; |
| 621 | 621 | |
| 622 | 622 | |
| r1581 | r1582 | |
| 967 | 967 | |
| 968 | 968 | |
| 969 | 969 | /* overloaded wav: dump info */ |
| 970 | ||
| 970 | ||
| 971 | 971 | { "wav", mo5_wav_identify, mo5_wav_load, mo5_wav_save }; |
| 972 | 972 | |
| 973 | 973 |
| r1581 | r1582 | |
|---|---|---|
| 330 | 330 | } |
| 331 | 331 | |
| 332 | 332 | |
| 333 | static read8_handler nc_bankhandler_r[]={ | |
| 333 | static const read8_handler nc_bankhandler_r[]={ | |
| 334 | 334 | MRA8_BANK1, MRA8_BANK2, MRA8_BANK3, MRA8_BANK4}; |
| 335 | 335 | |
| 336 | static write8_handler nc_bankhandler_w[]={ | |
| 336 | static const write8_handler nc_bankhandler_w[]={ | |
| 337 | 337 | MWA8_BANK5, MWA8_BANK6, MWA8_BANK7, MWA8_BANK8}; |
| 338 | 338 | |
| 339 | 339 | static void nc_refresh_memory_bank_config(int bank) |
| r1581 | r1582 | |
|---|---|---|
| 32 | 32 | INPUT_PORTS_END |
| 33 | 33 | |
| 34 | 34 | static PALETTE_INIT( pokemini ) { |
| 35 | const unsigned char pokemini_pal[4][3] = { | |
| 35 | static const unsigned char pokemini_pal[4][3] = { | |
| 36 | 36 | { 0xFF, 0xFB, 0x87 }, |
| 37 | 37 | { 0xB1, 0xAE, 0x4E }, |
| 38 | 38 | { 0x84, 0x80, 0x4E }, |
| r1581 | r1582 | |
|---|---|---|
| 259 | 259 | return pcw16_flash1_bank_handler_r(3, offset); |
| 260 | 260 | } |
| 261 | 261 | |
| 262 | static read8_handler pcw16_flash0_bank_handlers_r[4] = | |
| 262 | static const read8_handler pcw16_flash0_bank_handlers_r[4] = | |
| 263 | 263 | { |
| 264 | 264 | pcw16_flash0_bank_handler0_r, |
| 265 | 265 | pcw16_flash0_bank_handler1_r, |
| r1581 | r1582 | |
| 267 | 267 | pcw16_flash0_bank_handler3_r, |
| 268 | 268 | }; |
| 269 | 269 | |
| 270 | static read8_handler pcw16_flash1_bank_handlers_r[4] = | |
| 270 | static const read8_handler pcw16_flash1_bank_handlers_r[4] = | |
| 271 | 271 | { |
| 272 | 272 | pcw16_flash1_bank_handler0_r, |
| 273 | 273 | pcw16_flash1_bank_handler1_r, |
| r1581 | r1582 | |
| 336 | 336 | pcw16_flash1_bank_handler_w(3, offset, data); |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | static write8_handler pcw16_flash0_bank_handlers_w[4] = | |
| 339 | static const write8_handler pcw16_flash0_bank_handlers_w[4] = | |
| 340 | 340 | { |
| 341 | 341 | pcw16_flash0_bank_handler0_w, |
| 342 | 342 | pcw16_flash0_bank_handler1_w, |
| r1581 | r1582 | |
| 344 | 344 | pcw16_flash0_bank_handler3_w, |
| 345 | 345 | }; |
| 346 | 346 | |
| 347 | static write8_handler pcw16_flash1_bank_handlers_w[4] = | |
| 347 | static const write8_handler pcw16_flash1_bank_handlers_w[4] = | |
| 348 | 348 | { |
| 349 | 349 | pcw16_flash1_bank_handler0_w, |
| 350 | 350 | pcw16_flash1_bank_handler1_w, |
| r1581 | r1582 | |
| 809 | 809 | static unsigned char rtc_control; |
| 810 | 810 | static unsigned char rtc_256ths_seconds; |
| 811 | 811 | |
| 812 | static int rtc_days_in_each_month[]= | |
| 812 | static const int rtc_days_in_each_month[]= | |
| 813 | 813 | { |
| 814 | 814 | 31,/* jan */ |
| 815 | 815 | 28, /* feb */ |
| r1581 | r1582 | |
| 825 | 825 | 31 /* december */ |
| 826 | 826 | }; |
| 827 | 827 | |
| 828 | static int rtc_days_in_february[] = | |
| 828 | static const int rtc_days_in_february[] = | |
| 829 | 829 | { |
| 830 | 830 | 29, 28, 28, 28 |
| 831 | 831 | }; |
| r1581 | r1582 | |
|---|---|---|
| 475 | 475 | UINT8 *rom=memory_region(REGION_CPU1); |
| 476 | 476 | /* this is a simple routine to display all rom characters |
| 477 | 477 | on the display for a snapshot */ |
| 478 | UINT8 prog[]={ // address 0 of course | |
| 478 | static const UINT8 prog[]={ // address 0 of course | |
| 479 | 479 | 0x20, // eorz, 0 |
| 480 | 480 | 0x1b, 0x01, // bctr,a $0004 |
| 481 | 481 | 0x17, // retc a |
| r1581 | r1582 | |
|---|---|---|
| 141 | 141 | static VIDEO_UPDATE( mpf1 ) |
| 142 | 142 | { |
| 143 | 143 | int x; |
| 144 | static UINT8 xpositions[] = { 20, 59, 97, 135, 185, 223 }; | |
| 144 | static const UINT8 xpositions[] = { 20, 59, 97, 135, 185, 223 }; | |
| 145 | 145 | |
| 146 | 146 | //fillbitmap(bitmap, get_black_pen(), NULL); |
| 147 | 147 |
| r1581 | r1582 | |
|---|---|---|
| 1443 | 1443 | |
| 1444 | 1444 | static DRIVER_INIT( ip225015 ) |
| 1445 | 1445 | { |
| 1446 | struct kbdc8042_interface at8042 = | |
| 1446 | static const struct kbdc8042_interface at8042 = | |
| 1447 | 1447 | { |
| 1448 | 1448 | KBDC8042_STANDARD, NULL, NULL |
| 1449 | 1449 | }; |
| r1581 | r1582 | |
|---|---|---|
| 148 | 148 | |
| 149 | 149 | unsigned int left,right; |
| 150 | 150 | int i,j,foundkeypad = 0; |
| 151 | unsigned char signatures[][5] = { | |
| 151 | static const unsigned char signatures[][5] = { | |
| 152 | 152 | { 0x55, 0xa5, 0x3c, 0x29, 0}, // star raiders |
| 153 | 153 | { 0xf9, 0xff, 0xa5, 0x80, 1}, // sentinel |
| 154 | 154 | { 0x81, 0x02, 0xe8, 0x86, 1}, // shooting arcade |
| r1581 | r1582 | |
| 209 | 209 | { |
| 210 | 210 | int i,numfound = 0; |
| 211 | 211 | // signature is also in 'video reflex'.. maybe figure out that controller port someday... |
| 212 | unsigned char signature[3] = { 0x8d, 0xf0, 0xff }; | |
| 212 | static const unsigned char signature[3] = { 0x8d, 0xf0, 0xff }; | |
| 213 | 213 | if (cart_size == 0x10000) |
| 214 | 214 | { |
| 215 | 215 | for (i = 0; i < cart_size - sizeof signature; i++) |
| r1581 | r1582 | |
| 227 | 227 | static int detect_modef6(void) |
| 228 | 228 | { |
| 229 | 229 | int i,numfound = 0; |
| 230 | unsigned char signature[3] = { 0x8d, 0xf6, 0xff }; | |
| 230 | static const unsigned char signature[3] = { 0x8d, 0xf6, 0xff }; | |
| 231 | 231 | if (cart_size == 0x4000) |
| 232 | 232 | { |
| 233 | 233 | for (i = 0; i < cart_size - sizeof signature; i++) |
| r1581 | r1582 | |
| 249 | 249 | // Would have used STA $3e, but 'Alien' and 'Star Raiders' do that for unknown reasons |
| 250 | 250 | |
| 251 | 251 | int i,numfound = 0; |
| 252 | unsigned char signature[3] = { 0x84, 0x3e, 0x9d }; | |
| 252 | static const unsigned char signature[3] = { 0x84, 0x3e, 0x9d }; | |
| 253 | 253 | if (cart_size == 0x0800 || cart_size == 0x1000) |
| 254 | 254 | { |
| 255 | 255 | for (i = 0; i < cart_size - sizeof signature; i++) |
| r1581 | r1582 | |
| 267 | 267 | static int detect_modeSS(void) |
| 268 | 268 | { |
| 269 | 269 | int i,numfound = 0; |
| 270 | unsigned char signature[5] = { 0xbd, 0xe5, 0xff, 0x95, 0x81 }; | |
| 270 | static const unsigned char signature[5] = { 0xbd, 0xe5, 0xff, 0x95, 0x81 }; | |
| 271 | 271 | if (cart_size == 0x0800 || cart_size == 0x1000) |
| 272 | 272 | { |
| 273 | 273 | for (i = 0; i < cart_size - sizeof signature; i++) |
| r1581 | r1582 | |
| 285 | 285 | static int detect_modeFE(void) |
| 286 | 286 | { |
| 287 | 287 | int i,j,numfound = 0; |
| 288 | unsigned char signatures[][5] = { | |
| 288 | static const unsigned char signatures[][5] = { | |
| 289 | 289 | { 0x20, 0x00, 0xd0, 0xc6, 0xc5 }, |
| 290 | 290 | { 0x20, 0xc3, 0xf8, 0xa5, 0x82 }, |
| 291 | 291 | { 0xd0, 0xfb, 0x20, 0x73, 0xfe }, |
| r1581 | r1582 | |
| 310 | 310 | static int detect_modeE0(void) |
| 311 | 311 | { |
| 312 | 312 | int i,j,numfound = 0; |
| 313 | unsigned char signatures[][3] = { | |
| 313 | static const unsigned char signatures[][3] = { | |
| 314 | 314 | { 0x8d, 0xe0, 0x1f }, |
| 315 | 315 | { 0x8d, 0xe0, 0x5f }, |
| 316 | 316 | { 0x8d, 0xe9, 0xff }, |
| r1581 | r1582 | |
| 337 | 337 | static int detect_modeCV(void) |
| 338 | 338 | { |
| 339 | 339 | int i,j,numfound = 0; |
| 340 | unsigned char signatures[][3] = { | |
| 340 | static const unsigned char signatures[][3] = { | |
| 341 | 341 | { 0x9d, 0xff, 0xf3 }, |
| 342 | 342 | { 0x99, 0x00, 0xf4 }}; |
| 343 | 343 | if (cart_size == 0x0800 || cart_size == 0x1000) |
| r1581 | r1582 | |
| 360 | 360 | static int detect_modeFV(void) |
| 361 | 361 | { |
| 362 | 362 | int i,j,numfound = 0; |
| 363 | unsigned char signatures[][3] = { | |
| 363 | static const unsigned char signatures[][3] = { | |
| 364 | 364 | { 0x2c, 0xd0, 0xff }}; |
| 365 | 365 | if (cart_size == 0x2000) |
| 366 | 366 | { |
| r1581 | r1582 | |
| 383 | 383 | static int detect_modeJVP(void) |
| 384 | 384 | { |
| 385 | 385 | int i,j,numfound = 0; |
| 386 | unsigned char signatures[][4] = { | |
| 386 | static const unsigned char signatures[][4] = { | |
| 387 | 387 | { 0x2c, 0xc0, 0xef, 0x60 }, |
| 388 | 388 | { 0x8d, 0xa0, 0x0f, 0xf0 }}; |
| 389 | 389 | if (cart_size == 0x4000 || cart_size == 0x2000) |
| r1581 | r1582 | |
| 406 | 406 | static int detect_modeE7(void) |
| 407 | 407 | { |
| 408 | 408 | int i,j,numfound = 0; |
| 409 | unsigned char signatures[][3] = { | |
| 409 | static const unsigned char signatures[][3] = { | |
| 410 | 410 | { 0xad, 0xe5, 0xff }, |
| 411 | 411 | { 0x8d, 0xe7, 0xff }}; |
| 412 | 412 | if (cart_size == 0x2000 || cart_size == 0x4000) |
| r1581 | r1582 | |
| 429 | 429 | static int detect_modeUA(void) |
| 430 | 430 | { |
| 431 | 431 | int i,numfound = 0; |
| 432 | unsigned char signature[3] = { 0x8d, 0x40, 0x02 }; | |
| 432 | static const unsigned char signature[3] = { 0x8d, 0x40, 0x02 }; | |
| 433 | 433 | if (cart_size == 0x2000) |
| 434 | 434 | { |
| 435 | 435 | for (i = 0; i < cart_size - sizeof signature; i++) |
| r1581 | r1582 | |
| 447 | 447 | static int detect_8K_mode3F(void) |
| 448 | 448 | { |
| 449 | 449 | int i,numfound = 0; |
| 450 | unsigned char signature1[4] = { 0xa9, 0x01, 0x85, 0x3f }; | |
| 451 | unsigned char signature2[4] = { 0xa9, 0x02, 0x85, 0x3f }; | |
| 450 | static const unsigned char signature1[4] = { 0xa9, 0x01, 0x85, 0x3f }; | |
| 451 | static const unsigned char signature2[4] = { 0xa9, 0x02, 0x85, 0x3f }; | |
| 452 | 452 | // have to look for two signatures because 'not boulderdash' gives false positive otherwise |
| 453 | 453 | if (cart_size == 0x2000) |
| 454 | 454 | { |
| r1581 | r1582 | |
| 471 | 471 | static int detect_32K_mode3F(void) |
| 472 | 472 | { |
| 473 | 473 | int i,numfound = 0; |
| 474 | unsigned char signature[4] = { 0xa9, 0x0e, 0x85, 0x3f }; | |
| 474 | static const unsigned char signature[4] = { 0xa9, 0x0e, 0x85, 0x3f }; | |
| 475 | 475 | if (cart_size >= 0x8000) |
| 476 | 476 | { |
| 477 | 477 | for (i = 0; i < cart_size - sizeof signature; i++) |
| r1581 | r1582 | |
| 489 | 489 | static int detect_super_chip(void) |
| 490 | 490 | { |
| 491 | 491 | int i,j; |
| 492 | unsigned char signatures[][5] = { | |
| 492 | static const unsigned char signatures[][5] = { | |
| 493 | 493 | { 0xa2, 0x7f, 0x9d, 0x00, 0xf0 }, // dig dug |
| 494 | 494 | { 0xae, 0xf6, 0xff, 0x4c, 0x00 }}; // off the wall |
| 495 | 495 | |
| r1581 | r1582 | |
| 1469 | 1469 | |
| 1470 | 1470 | int chip = 0xFF; |
| 1471 | 1471 | unsigned long controltemp; |
| 1472 | unsigned char snowwhite[] = { 0x10, 0xd0, 0xff, 0xff }; // Snow White Proto | |
| 1472 | static const unsigned char snowwhite[] = { 0x10, 0xd0, 0xff, 0xff }; // Snow White Proto | |
| 1473 | 1473 | |
| 1474 | 1474 | current_reset_bank_counter++; |
| 1475 | 1475 |
| r1581 | r1582 | |
|---|---|---|
| 435 | 435 | ******************************************************************************/ |
| 436 | 436 | |
| 437 | 437 | |
| 438 | static UPD7810_CONFIG ex800_cpu_config = | |
| 438 | static const UPD7810_CONFIG ex800_cpu_config = | |
| 439 | 439 | { |
| 440 | 440 | TYPE_7810, |
| 441 | 441 | 0 |
| r1581 | r1582 | |
|---|---|---|
| 264 | 264 | UINT8 valid_mode20, valid_mode21; |
| 265 | 265 | |
| 266 | 266 | /* Cart types */ |
| 267 | static struct | |
| 267 | static const struct | |
| 268 | 268 | { |
| 269 | 269 | INT16 Code; |
| 270 | 270 | const char *Name; |
| r1581 | r1582 | |
|---|---|---|
| 1911 | 1911 | |
| 1912 | 1912 | static NVRAM_HANDLER(saturn) |
| 1913 | 1913 | { |
| 1914 | static UINT32 init[8] = | |
| 1914 | static const UINT32 init[8] = | |
| 1915 | 1915 | { |
| 1916 | 1916 | 0x420061, 0x63006b, 0x550070, 0x520061, 0x6d0020, 0x46006f, 0x72006d, 0x610074, |
| 1917 | 1917 | }; |
| r1581 | r1582 | |
|---|---|---|
| 22 | 22 | static UINT8 key_digit; |
| 23 | 23 | |
| 24 | 24 | |
| 25 | READ8_HANDLER( ins8154_b1_port_a_r ) | |
| 25 | static READ8_HANDLER( ins8154_b1_port_a_r ) | |
| 26 | 26 | { |
| 27 | 27 | char port[11]; |
| 28 | 28 | UINT8 data; |
| r1581 | r1582 | |
| 32 | 32 | return data; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | WRITE8_HANDLER( ins8154_b1_port_a_w ) | |
| 35 | static WRITE8_HANDLER( ins8154_b1_port_a_w ) | |
| 36 | 36 | { |
| 37 | 37 | ttl74145_0_w(0, data & 0x07); |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | WRITE8_HANDLER( acrnsys1_led_segment_w ) | |
| 40 | static WRITE8_HANDLER( acrnsys1_led_segment_w ) | |
| 41 | 41 | { |
| 42 | 42 | logerror("led %d segment data: %02x\n", key_digit, data); |
| 43 | 43 | |
| r1581 | r1582 | |
| 76 | 76 | NULL, /* not connected */ |
| 77 | 77 | }; |
| 78 | 78 | |
| 79 | DRIVER_INIT( acrnsys1 ) | |
| 79 | static DRIVER_INIT( acrnsys1 ) | |
| 80 | 80 | { |
| 81 | 81 | ins8154_config(0, &ins8154_b1); |
| 82 | 82 | ttl74145_config(0, &ic8_7445); |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | MACHINE_RESET( acrnsys1 ) | |
| 85 | static MACHINE_RESET( acrnsys1 ) | |
| 86 | 86 | { |
| 87 | 87 | ins8154_reset(0); |
| 88 | 88 | ttl74145_reset(0); |
| r1581 | r1582 | |
|---|---|---|
| 217 | 217 | //} |
| 218 | 218 | |
| 219 | 219 | |
| 220 | //static struct m6845_interface | |
| 221 | //einstein_m6845_interface= { | |
| 220 | //static const struct m6845_interface einstein_m6845_interface = { | |
| 222 | 221 | // 0,// Memory Address register |
| 223 | 222 | // Einstein_Set_RA,// Row Address register |
| 224 | 223 | // Einstein_Set_HSync,// Horizontal status |
| r1581 | r1582 | |
|---|---|---|
| 236 | 236 | break; |
| 237 | 237 | case IOS_CHARDEF4: |
| 238 | 238 | { |
| 239 | static UINT8 fontdata[10*127] = | |
| 239 | static const UINT8 fontdata[10*127] = | |
| 240 | 240 | { |
| 241 | 241 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| 242 | 242 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
| r1581 | r1582 | |
|---|---|---|
| 1101 | 1101 | } |
| 1102 | 1102 | } |
| 1103 | 1103 | |
| 1104 | void aleste_msx_mapper(int offset, int data) | |
| 1104 | static void aleste_msx_mapper(int offset, int data) | |
| 1105 | 1105 | { |
| 1106 | 1106 | int page = (offset & 0x0300) >> 8; |
| 1107 | 1107 | int ramptr = (data & 0x1f) * 0x4000; |
| r1581 | r1582 | |
|---|---|---|
| 61 | 61 | #define A310_FIQ_PODULE (0x40) |
| 62 | 62 | #define A310_FIQ_FORCE (0x80) |
| 63 | 63 | |
| 64 | static int page_sizes[4] = { 4096, 8192, 16384, 32768 }; | |
| 64 | static const int page_sizes[4] = { 4096, 8192, 16384, 32768 }; | |
| 65 | 65 | |
| 66 | 66 | static UINT32 *a310_physmem; |
| 67 | 67 | static UINT32 a310_pagesize; |
| r1581 | r1582 | |
| 549 | 549 | { |
| 550 | 550 | UINT32 reg = data>>24; |
| 551 | 551 | UINT32 val = data & 0xffffff; |
| 552 | static const char *vrnames[] = | |
| 552 | static const char *const vrnames[] = | |
| 553 | 553 | { |
| 554 | 554 | "horizontal total", |
| 555 | 555 | "horizontal sync width", |
| r1581 | r1582 | |
|---|---|---|
| 507 | 507 | /* NYI */ |
| 508 | 508 | } |
| 509 | 509 | |
| 510 | static void (*psx_cdcmds[])(void) = | |
| 510 | static void (*const psx_cdcmds[])(void) = | |
| 511 | 511 | { |
| 512 | 512 | psx_cdcmd_sync, |
| 513 | 513 | psx_cdcmd_nop, |
| r1581 | r1582 | |
|---|---|---|
| 62 | 62 | static int genesis_sram_active; |
| 63 | 63 | static int genesis_sram_readonly; |
| 64 | 64 | |
| 65 | READ16_HANDLER( genesis_sram_read ) | |
| 65 | static READ16_HANDLER( genesis_sram_read ) | |
| 66 | 66 | { |
| 67 | 67 | UINT16 retval = 0; |
| 68 | 68 | |
| r1581 | r1582 | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | |
| 81 | WRITE16_HANDLER( genesis_sram_write ) | |
| 81 | static WRITE16_HANDLER( genesis_sram_write ) | |
| 82 | 82 | { |
| 83 | 83 | offset <<= 1; |
| 84 | 84 | |
| r1581 | r1582 | |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | |
| 93 | WRITE16_HANDLER( genesis_sram_toggle ) | |
| 93 | static WRITE16_HANDLER( genesis_sram_toggle ) | |
| 94 | 94 | { |
| 95 | 95 | /* unsure if this is actually supposed to toggle or just switch on? |
| 96 | 96 | * Yet to encounter game that utilizes |
| r1581 | r1582 | |
|---|---|---|
| 51 | 51 | - The core is based on MAME 0.122u6. This incorporates all features of the |
| 52 | 52 | update to this core. [MAME team] |
| 53 | 53 | |
| 54 | - Conditional logging and core callback cleanups. [Atari Ace] | |
| 54 | - Miscellaneous cleanups (staticization, constification, conditional logging, | |
| 55 | core callbacks). [Atari Ace] | |
| 55 | 56 | |
| 56 | 57 | - Greater use of ATTR_PRINTF. [Oliver Stoeneberg] |
| 57 | 58 |
| Previous | 15994 Revisions | Next |