aboutsummaryrefslogtreecommitdiff
path: root/config/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'config/config.c')
-rw-r--r--config/config.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/config/config.c b/config/config.c
index bd9c1a6..9c97d43 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;
@@ -81,6 +83,19 @@ void detect_dos(void) {
if(h || d) have_dos = 1;
}
+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 print(const char *text) {
fputs(text, stdout);
}
@@ -536,6 +551,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 +564,8 @@ void main(void) {
print("Version " VERSION "\n\n");
detect_dos();
+ detect_xl();
+
if(!load(0))
print("Using built-in default config.\n");