diff options
| -rw-r--r-- | config/Makefile | 2 | ||||
| -rw-r--r-- | config/exehdr.s | 11 | ||||
| -rw-r--r-- | font_dl.asm | 30 | ||||
| -rw-r--r-- | loading.asm | 2 | ||||
| -rw-r--r-- | memsetup.asm | 6 | ||||
| -rw-r--r-- | src/addrs.c | 63 | ||||
| -rw-r--r-- | src/addrs.h | 6 | ||||
| -rw-r--r-- | src/atari.cfg | 21 | ||||
| -rw-r--r-- | src/exehdr.s | 4 | ||||
| -rw-r--r-- | src/page20.s | 5 | ||||
| -rw-r--r-- | src/rxtxbuf.h | 4 | ||||
| -rw-r--r-- | src/txbuf.s | 2 |
12 files changed, 90 insertions, 66 deletions
diff --git a/config/Makefile b/config/Makefile index b27952f..bef6296 100644 --- a/config/Makefile +++ b/config/Makefile @@ -3,7 +3,7 @@ all: config.xex #config.xex: config.c exetrailer.s ../src/config.h ../src/config.c config.xex: - cl65 -DVERSION='"$(VERSION)"' -m config.map -Oris -t atari -C atari.cfg -o config.xex config.c os2ram.c ../src/exehdr.s exetrailer.s + cl65 -DVERSION='"$(VERSION)"' -m config.map -Oris -t atari -C atari.cfg -o config.xex config.c os2ram.c exehdr.s exetrailer.s clean: rm -f config.xex diff --git a/config/exehdr.s b/config/exehdr.s new file mode 100644 index 0000000..7abb7c1 --- /dev/null +++ b/config/exehdr.s @@ -0,0 +1,11 @@ +; This file defines the EXE header and main chunk load header for Atari executables + + .export __EXEHDR__: absolute = 1 + .import __MAIN_START__, __BSS_LOAD__ + +.segment "EXEHDR" + .word $FFFF + +.segment "MAINHDR" + .word __MAIN_START__ + .word __BSS_LOAD__ - 1 diff --git a/font_dl.asm b/font_dl.asm index a48699a..f89e682 100644 --- a/font_dl.asm +++ b/font_dl.asm @@ -1,8 +1,17 @@ - *= $8000 + *= $3400 .incbin "font.dat" -; screen RAM starts right after the font. +; shoehorn the transmit & receive buffers here + *= $3800 +rx_buf ; 512 bytes + *= $3a00 +tx_buf ; 512 bytes + *= $3c00 +scr_vis_buf ; not used yet + + *= $4000 +; screen RAM starts at the XE bankswitching window! ; 7 double-height screens, 50 lines each. scr0_top *= * + 1000 @@ -10,10 +19,10 @@ scr1_top *= * + 1000 scr2_top *= * + 1000 -edbox_only_dlist = * +edbox_only_dlist ; can't cross a 4K boundary... - *= $9000 + *= $5000 scr3_top *= * + 1000 scr4_top @@ -22,13 +31,7 @@ scr5_top *= * + 1000 scr6_top -; shoehorn the transmit & receive buffers here - *= $a000 -rx_buf ; 512 bytes - *= $a200 -tx_buf ; 512 bytes - *= $a400 - + *= $6000 scr0_bot *= * + 1000 scr1_bot @@ -36,7 +39,7 @@ scr1_bot scr2_bot *= * + 1000 - *= $b000 + *= $7000 scr3_bot *= * + 1000 scr4_bot @@ -77,6 +80,7 @@ dl_status_lms .byte $06 ; one GR.1 line .byte $41 ; JVB .word dlist_bot +topbot_dlist_done *= edbox_only_dlist .byte $70, $70, $30 ; 2 8-line blanks, 1 4-line blank @@ -90,4 +94,4 @@ dl_status_lms .byte $06 ; GR.1 .byte $41 .word edbox_only_dlist - +edbox_dlist_done diff --git a/loading.asm b/loading.asm index 2932c8f..d5df6e2 100644 --- a/loading.asm +++ b/loading.asm @@ -1,4 +1,4 @@ - *= $8400 ; aka screen_bot_addrs[0], gets cleared by main() in the client. + *= $6000 ; aka screen_bot_addrs[0], gets cleared by main() in the client. save_dlist_loc = $fe diff --git a/memsetup.asm b/memsetup.asm index f1e3694..5419aef 100644 --- a/memsetup.asm +++ b/memsetup.asm @@ -1,6 +1,6 @@ ; Initial load segment for the fnchat.exe executable. Sets MEMTOP and -; RAMTOP to $6A00, disables BASIC (on XL/XE), disables ANTIC DMA, then -; returns so the rest of the .xex continues to load. +; RAMTOP to $C000, disables BASIC (on XL/XE), disables ANTIC DMA (not +; really), then returns so the rest of the .xex continues to load. *= $2000 memsetup @@ -14,9 +14,9 @@ memsetup lda $d301 ; PORTB ora #$02 sta $d301 - lda #$80 ; set up everything else + lda #$C0 sta $6a ; RAMTOP sta $02e6 ; MEMTOP high lda #0 diff --git a/src/addrs.c b/src/addrs.c index c7af1f2..fd3c8a4 100644 --- a/src/addrs.c +++ b/src/addrs.c @@ -3,57 +3,54 @@ u8 *dlist_top = u8p(DLIST_TOP_ADDR); u8 *dlist_bot = u8p(DLIST_BOT_ADDR); -u16 *dlist_top_lms = u16p(0xbfa4); -u16 *dlist_bot_lms = u16p(0xbfd4); -u16 *dlist_status_lms = u16p(0xbfee); -u8 *dlist_last_line = u8p(0xbff0); +u16 *dlist_top_lms = u16p(0x7fa4); +u16 *dlist_bot_lms = u16p(0x7fd4); +u16 *dlist_status_lms = u16p(0x7fee); +u8 *dlist_last_line = u8p(0x7ff0); -u8 *edbox_only_dlist = u8p(0x8fb8); -// u8 *rx_buf = u8p(0xa000); /* 512 bytes */ -// u8 *tx_buf = u8p(0xa200); /* 512 bytes */ +u8 *edbox_only_dlist = u8p(0x4bb8); /* 1000 bytes (25 40-char lines) apiece. */ u8 *screen_top_addrs[7] = { - u8p(0x8400), - u8p(0x87e8), - u8p(0x8bd0), - u8p(0x9000), - u8p(0x93e8), - u8p(0x97d0), - u8p(0x9bb8) + u8p(0x4000), + u8p(0x43e8), + u8p(0x47d0), + u8p(0x5000), + u8p(0x53e8), + u8p(0x57d0), + u8p(0x5bb8) }; /* 1000 bytes (25 40-char lines) apiece. */ u8 *screen_bot_addrs[7] = { - u8p(0xa400), - u8p(0xa7e8), - u8p(0xabd0), - u8p(0xb000), - u8p(0xb3e8), - u8p(0xb7d0), - u8p(0xbbb8) + u8p(0x6000), + u8p(0x63e8), + u8p(0x67d0), + u8p(0x7000), + u8p(0x73e8), + u8p(0x77d0), + u8p(0x7bb8) }; /* 40 bytes (1 line), third from the bottom of each _bot_addr */ u8 *screen_lastlines[7] = { - u8p(0xa770), - u8p(0xab58), - u8p(0xaf40), - u8p(0xb370), - u8p(0xb758), - u8p(0xbb40), - u8p(0xbf28) + u8p(0x6370), + u8p(0x6758), + u8p(0x6b40), + u8p(0x7370), + u8p(0x7758), + u8p(0x7b40), + u8p(0x7f28) }; /* 60 bytes, 1 GR.0 line and 1 GR.1 line. also 20 more bytes filler. this is the bottom 2 lines of screen 0. screens 1-6 actually have 80 bytes of free RAM - at the bottom (2 unused lines), for now at least. addresses: - 0xab80 0xaf68 0xb398 0xb780 0xbb68 0xbf50 */ -u8 *status_box = (u8 *)0xa798; + at the bottom (2 unused lines), for now at least. */ +u8 *status_box = (u8 *)0x6398; /* 1 byte, leftmost column of GR.1 line at bottom */ -u8 *ind_net_status = (u8 *)0xa7c0; +u8 *ind_net_status = (u8 *)0x63c0; /* 1 byte, 2nd column of GR.1 line at bottom */ -u8 *ind_act_status = (u8 *)0xa7c1; +u8 *ind_act_status = (u8 *)0x63c1; diff --git a/src/addrs.h b/src/addrs.h index 4099765..a7b6755 100644 --- a/src/addrs.h +++ b/src/addrs.h @@ -1,6 +1,6 @@ -#define FONT_ADDR_HI 0x80 -#define DLIST_TOP_ADDR 0xbfa0 -#define DLIST_BOT_ADDR 0xbfd0 +#define FONT_ADDR_HI 0x34 +#define DLIST_TOP_ADDR 0x7fa0 +#define DLIST_BOT_ADDR 0x7fd0 #define EDBOX_ADDR 0x0600 #define u8 unsigned char diff --git a/src/atari.cfg b/src/atari.cfg index ea3e0eb..4e0859d 100644 --- a/src/atari.cfg +++ b/src/atari.cfg @@ -1,9 +1,11 @@ # This is a hacked-up modified config, DO NOT USE for the config segment. # The ONCE segment and the CONDES stuff are removed (don't need). # The STARTUP segment now loads to page 6. +# CODE loads high ($8000) and everything else loads low ($2000), to leave +# an 8K hole for the banking window at $4000-$7FFF. FEATURES { - STARTADDRESS: default = $2000; + STARTADDRESS: default = $8000; } SYMBOLS { __EXEHDR__: type = import; @@ -22,9 +24,13 @@ MEMORY { P6HDR: file = %O, start = $0000, size = $0004; PAGE6: file = %O, define = yes, start = $0600, size = $00ff; +# $2000 for everything but STARTUP and CODE + P20HDR: file = %O, start = $0000, size = $0004; + PAGE20: file = %O, define = yes, start = $2000, size = $1360; + # "main program" load chunk MAINHDR: file = %O, start = $0000, size = $0004; - MAIN: file = %O, define = yes, start = %S, size = $8000 - __STACKSIZE__ - __RESERVED_MEMORY__ - %S; + MAIN: file = %O, define = yes, start = %S, size = $4000 - __STACKSIZE__ - __RESERVED_MEMORY__ - %S; TRAILER: file = %O, start = $0000, size = $0006; } SEGMENTS { @@ -34,12 +40,13 @@ SEGMENTS { P6HDR: load = P6HDR, type = ro; STARTUP: load = PAGE6, type = ro, define = yes; MAINHDR: load = MAINHDR, type = ro; - LOWBSS: load = MAIN, type = rw, optional = yes; # not zero initialized - LOWCODE: load = MAIN, type = ro, define = yes, optional = yes; + P20HDR: load = P20HDR, type = ro; + LOWBSS: load = PAGE20, type = rw, optional = yes; # not zero initialized + RODATA: load = PAGE20, type = ro; + DATA: load = PAGE20, type = rw; + LOWCODE: load = PAGE20, type = ro, define = yes, optional = yes; + BSS: load = PAGE20, type = bss, define = yes; CODE: load = MAIN, type = ro, define = yes; - RODATA: load = MAIN, type = ro; - DATA: load = MAIN, type = rw; INIT: load = MAIN, type = rw, optional = yes; - BSS: load = MAIN, type = bss, define = yes; AUTOSTRT: load = TRAILER, type = ro; } diff --git a/src/exehdr.s b/src/exehdr.s index 7abb7c1..941e286 100644 --- a/src/exehdr.s +++ b/src/exehdr.s @@ -1,11 +1,11 @@ ; This file defines the EXE header and main chunk load header for Atari executables .export __EXEHDR__: absolute = 1 - .import __MAIN_START__, __BSS_LOAD__ + .import __MAIN_START__, __CODE_SIZE__ .segment "EXEHDR" .word $FFFF .segment "MAINHDR" .word __MAIN_START__ - .word __BSS_LOAD__ - 1 + .word __MAIN_START__ + __CODE_SIZE__ - 1 diff --git a/src/page20.s b/src/page20.s new file mode 100644 index 0000000..75fda20 --- /dev/null +++ b/src/page20.s @@ -0,0 +1,5 @@ + + .import __BSS_LOAD__ + .segment "P20HDR" + .word $2000 + .word __BSS_LOAD__ - 1 diff --git a/src/rxtxbuf.h b/src/rxtxbuf.h index 888092a..622f0a0 100644 --- a/src/rxtxbuf.h +++ b/src/rxtxbuf.h @@ -1,5 +1,5 @@ typedef char buf512_t[512]; -#define RXBUF_ADDR 0xa000 -#define TXBUF_ADDR 0xa200 +#define RXBUF_ADDR 0x3800 +#define TXBUF_ADDR 0x3a00 #define rx_buf (*(buf512_t *)RXBUF_ADDR) #define tx_buf (*(buf512_t *)TXBUF_ADDR) diff --git a/src/txbuf.s b/src/txbuf.s index 6f7b55d..beb4fef 100644 --- a/src/txbuf.s +++ b/src/txbuf.s @@ -4,7 +4,7 @@ ; compiles to 45 bytes. routine below is 29 bytes (~33% smaller) - tx_buf = $a200 ; MUST agree with src/rxtxbuf.h! + tx_buf = $3a00 ; MUST agree with src/rxtxbuf.h! .import _txbuflen, _txbuf_send .export _txbuf_append_chr, _txbuf_append_str |
