Mercurial > repos > blastem
comparison blastem.c @ 948:f87522554d7b
Allow changing the 68K clock divider in the config file
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 10 Apr 2016 22:22:36 -0700 |
parents | 4f4f8385da8d |
children | fec4a59ae5d7 |
comparison
equal
deleted
inserted
replaced
947:d29722e3359c | 948:f87522554d7b |
---|---|
25 #define BLASTEM_VERSION "0.3.X" | 25 #define BLASTEM_VERSION "0.3.X" |
26 | 26 |
27 #define MCLKS_NTSC 53693175 | 27 #define MCLKS_NTSC 53693175 |
28 #define MCLKS_PAL 53203395 | 28 #define MCLKS_PAL 53203395 |
29 | 29 |
30 #define MCLKS_PER_68K 7 | 30 uint32_t MCLKS_PER_68K; |
31 #define MCLKS_PER_YM MCLKS_PER_68K | 31 #define MCLKS_PER_YM 7 |
32 #define MCLKS_PER_Z80 15 | 32 #define MCLKS_PER_Z80 15 |
33 #define MCLKS_PER_PSG (MCLKS_PER_Z80*16) | 33 #define MCLKS_PER_PSG (MCLKS_PER_Z80*16) |
34 #define DEFAULT_SYNC_INTERVAL MCLKS_LINE | 34 #define DEFAULT_SYNC_INTERVAL MCLKS_LINE |
35 | 35 |
36 //TODO: Figure out the exact value for this | 36 //TODO: Figure out the exact value for this |
1084 } | 1084 } |
1085 } | 1085 } |
1086 uint8_t menu = !loaded; | 1086 uint8_t menu = !loaded; |
1087 if (!loaded) { | 1087 if (!loaded) { |
1088 //load menu | 1088 //load menu |
1089 romfname = tern_find_path(config, "ui\rom\0").ptrval; | 1089 romfname = tern_find_path(config, "ui\0rom\0").ptrval; |
1090 if (!romfname) { | 1090 if (!romfname) { |
1091 romfname = "menu.bin"; | 1091 romfname = "menu.bin"; |
1092 } | 1092 } |
1093 if (romfname[0] == '/') { | 1093 if (romfname[0] == '/') { |
1094 if (!(rom_size = load_rom(romfname))) { | 1094 if (!(rom_size = load_rom(romfname))) { |
1106 } | 1106 } |
1107 } | 1107 } |
1108 //TODO: load relative to executable or from assets depending on platform | 1108 //TODO: load relative to executable or from assets depending on platform |
1109 | 1109 |
1110 loaded = 1; | 1110 loaded = 1; |
1111 } | |
1112 char *m68k_divider = tern_find_path(config, "clocks\0m68k_divider\0").ptrval; | |
1113 if (!m68k_divider) { | |
1114 m68k_divider = "7"; | |
1115 } | |
1116 MCLKS_PER_68K = atoi(m68k_divider); | |
1117 if (!MCLKS_PER_68K) { | |
1118 MCLKS_PER_68K = 7; | |
1111 } | 1119 } |
1112 ram = malloc(RAM_WORDS * sizeof(uint16_t)); | 1120 ram = malloc(RAM_WORDS * sizeof(uint16_t)); |
1113 memmap_chunk base_map[] = { | 1121 memmap_chunk base_map[] = { |
1114 {0xE00000, 0x1000000, 0xFFFF, 0, MMAP_READ | MMAP_WRITE | MMAP_CODE, ram, | 1122 {0xE00000, 0x1000000, 0xFFFF, 0, MMAP_READ | MMAP_WRITE | MMAP_CODE, ram, |
1115 NULL, NULL, NULL, NULL}, | 1123 NULL, NULL, NULL, NULL}, |