From a17902373dc3fd2f06f0796ed2621109cb4acdd3 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Mon, 6 Apr 2026 06:08:45 -0400 Subject: Precalculate timer intervals (in config segment; client gets them preset). 6780 bytes free. --- config/config.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'config/config.c') diff --git a/config/config.c b/config/config.c index ae3b110..0fb2fab 100644 --- a/config/config.c +++ b/config/config.c @@ -10,6 +10,7 @@ #include #include "../src/config.h" +#include "../src/timers.h" #include "os2ram.h" #ifndef VERSION @@ -51,11 +52,19 @@ char use_xl_ram = 1; unsigned int *bonus_addrs = (unsigned int *)0xd4; /* aka FR0 */ +void setup_timers_and_exit(void) { + timers.hz = (GTIA_READ.pal & 0x0e) ? 60 : 50; + timers.one_tenth_sec = timers.hz / 10; + timers.one_sec = timers.hz * 60; + timers.net_ind_time = (timers.hz / 10) * 37; + exit(0); +} + char lcgetc(void) { char c; c = cgetc(); - if(c == 0x03) exit(0); + if(c == 0x03) setup_timers_and_exit(); return c; } @@ -619,4 +628,6 @@ void main(void) { Clearing the screen here band-aids it: a byte of the client's screen memory is getting zeroed out, but it's a byte that was already zero... */ print("\x7d"); + + setup_timers_and_exit(); } -- cgit v1.2.3