summaryrefslogtreecommitdiff
path: root/blastem.c
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2016-04-10 22:22:36 -0700
committerMichael Pavone <pavone@retrodev.com>2016-04-10 22:22:36 -0700
commit31f5791bd9d205a0f28e3e734c5328e743939ad7 (patch)
tree78f6d029d0608f0d56a3a19df2c099fb1c1760c1 /blastem.c
parent3bdd5bbf930d00052e91e22290fae776706158e0 (diff)
Allow changing the 68K clock divider in the config file
Diffstat (limited to 'blastem.c')
-rw-r--r--blastem.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/blastem.c b/blastem.c
index 0b5f03c..76ddd16 100644
--- a/blastem.c
+++ b/blastem.c
@@ -27,8 +27,8 @@
#define MCLKS_NTSC 53693175
#define MCLKS_PAL 53203395
-#define MCLKS_PER_68K 7
-#define MCLKS_PER_YM MCLKS_PER_68K
+uint32_t MCLKS_PER_68K;
+#define MCLKS_PER_YM 7
#define MCLKS_PER_Z80 15
#define MCLKS_PER_PSG (MCLKS_PER_Z80*16)
#define DEFAULT_SYNC_INTERVAL MCLKS_LINE
@@ -1086,7 +1086,7 @@ int main(int argc, char ** argv)
uint8_t menu = !loaded;
if (!loaded) {
//load menu
- romfname = tern_find_path(config, "ui\rom\0").ptrval;
+ romfname = tern_find_path(config, "ui\0rom\0").ptrval;
if (!romfname) {
romfname = "menu.bin";
}
@@ -1109,6 +1109,14 @@ int main(int argc, char ** argv)
loaded = 1;
}
+ char *m68k_divider = tern_find_path(config, "clocks\0m68k_divider\0").ptrval;
+ if (!m68k_divider) {
+ m68k_divider = "7";
+ }
+ MCLKS_PER_68K = atoi(m68k_divider);
+ if (!MCLKS_PER_68K) {
+ MCLKS_PER_68K = 7;
+ }
ram = malloc(RAM_WORDS * sizeof(uint16_t));
memmap_chunk base_map[] = {
{0xE00000, 0x1000000, 0xFFFF, 0, MMAP_READ | MMAP_WRITE | MMAP_CODE, ram,