aboutsummaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/Makefile10
-rw-r--r--config/config.c23
2 files changed, 25 insertions, 8 deletions
diff --git a/config/Makefile b/config/Makefile
index 6518ea7..15567e9 100644
--- a/config/Makefile
+++ b/config/Makefile
@@ -3,11 +3,7 @@ all: config.xex
#config.xex: config.c exetrailer.s ../src/config.h ../src/config.c
config.xex:
- cl65 -DVERSION='"$(VERSION)"' -Oris -t atari -C ../src/atari.cfg -o config.xex config.c ../src/exehdr.s exetrailer.s ../src/config.c
+ cl65 -DVERSION='"$(VERSION)"' -m config.map -Oris -t atari -C ../src/atari.cfg -o config.xex config.c os2ram.c ../src/exehdr.s exetrailer.s ../src/config.c
-test:
- cl65 -Oris -t atari -C ../src/atari.cfg -o config.xex config.c exetrailer.s ../src/config.c
- cl65 -Oris -t atari -C ../src/atari.cfg -o conftest.xex conftest.c
- cat config.xex conftest.xex > autorun.sys
- cp dos25_sd.atr test.atr
- axe -w autorun.sys test.atr
+clean:
+ rm -f config.xex
diff --git a/config/config.c b/config/config.c
index bd9c1a6..b753bbd 100644
--- a/config/config.c
+++ b/config/config.c
@@ -10,6 +10,7 @@
#include <peekpoke.h>
#include "../src/config.h"
+#include "os2ram.h"
#ifndef VERSION
#define VERSION "?????"
@@ -44,8 +45,9 @@ char buf[128];
char numbuf[4];
char server[101];
char port[6];
+char use_xl_ram = 1;
-unsigned int *bonus_addrs = 0xf0;
+unsigned int *bonus_addrs = (unsigned int *)0xd4; /* aka FR0 */
char lcgetc(void) {
char c;
@@ -522,6 +524,20 @@ void prompt_server() {
}
}
+void detect_xl(void) {
+ if(!is_xl()) {
+ print("400/800 detected, no extra RAM\n");
+ use_xl_ram = 0;
+ return;
+ }
+
+ yn("XL/XE detected, use extra RAM", use_xl_ram);
+ if(!use_xl_ram) return;
+
+ os_to_ram();
+}
+
+
void set_default_config(void) {
memcpy(conf, &defaults, sizeof(conf_t));
}
@@ -536,6 +552,9 @@ void main(void) {
/* loading1.xex left the original DL address at $fe */
if(PEEKW(0xfe)) POKEW(0x0230, PEEKW(0xfe));
+ /* clear the bonus screen addresses in case something left junk there */
+ memset(bonus_addrs, 0, 14);
+
set_default_config();
OS.color2 = conf->colors[0];
@@ -546,6 +565,8 @@ void main(void) {
print("Version " VERSION "\n\n");
detect_dos();
+ detect_xl();
+
if(!load(0))
print("Using built-in default config.\n");