aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--DOSes.txt52
-rw-r--r--Makefile122
-rw-r--r--bank3.s8
-rw-r--r--bank7.s88
-rw-r--r--cart.txt104
5 files changed, 256 insertions, 118 deletions
diff --git a/DOSes.txt b/DOSes.txt
index ace4fad..4362120 100644
--- a/DOSes.txt
+++ b/DOSes.txt
@@ -1,22 +1,31 @@
-Taipan's intended target is really an 800 with an 810 drive and DOS
-2.0S. However, most people use something else these days.
+The intended target for the .xex version of Taipan is really a 48K 800
+with an 810 drive and DOS 2.0S. However, most people use something else
+these days.
There are only two XL/XE specific things in Taipan:
- The checkmem code attempts to disable built-in BASIC if
- it's enabled, which won't work on an 800 (you get a "remove
- cartridge" message instead)
+ it's enabled, which won't work on an 800 (you get a "remove cartridge"
+ message instead). Most .xex file games won't work with a BASIC cart in,
+ so I don't consider this a problem (and at least Taipan fails gracefully
+ instead of splattering the screen with ANTIC gibberish).
-- Keyclicks are disabled on XL/XE, with POKE 731,1. This doesn't
- work on an 800, but doesn't hurt anything either (you just get
- the game with keyclicks enabled)
+- Keyclicks are disabled on XL/XE, with POKE 731,1 (because the Apple II
+ version has no keyclick). This doesn't work on an 800, but doesn't
+ hurt anything either: You just get the game with keyclicks enabled,
+ which at least one of my testers prefers anyway.
Unfortunately, the wide variety of Atari DOSes, both ancient and modern,
plus the various new bits of hardware (MyIDE, Atarimax Flash cart, etc)
leads to a compatibility nightmare. The rest of this file is a list of
DOSes (and other loaders), and their compatibility with Taipan.
+At this point, all the "obvious" reasons for load failure have been
+addressed. Loaders that fail now probably do so for hard-to-diagnose
+reasons, or else because MEMLO is too high. Taipan loads at $2000,
+which should *not* be a problem for any useful Atari DOS.
+
Tested on actual hardware:
- Atari DOS 2.0S: success
@@ -24,26 +33,45 @@ Tested on actual hardware:
- MyDOS 4.55 (floppy): success
- MyDOS 4.55 (with MyIDE): success
- SpartaDOS X: success, with "X" command
-- SpartaDOS 3.2dx: fails to load. This is 3.2d patched for the XF551 drive.
- SIDE2: success (older build though, need to get results for latest)
- APE loader: success (older build, need newer results)
- DOS XL 2.30: success
+- SpartaDOS 3.2dx: fails to load. This is 3.2d patched for the XF551 drive.
+- SpartaDOS 3.2g/3.2gx with MIO: failure.
Tested on emulators:
- atari800 3.1.0 direct xex loader: success
- atari++ direct xex loader: success
- altirra direct xex loader: success
-- Fenders 3-sector loader on atari800: success
- SpartaDOS 3.2g and 3.2d on atari800: success (unexpectedly so)
-- Atari DOS 3.0 on atari800: success
- MyDOS 4.50 (floppy) on atari800: success
+- SpartaDOS 1.1 on atari800: success (with STANDARD.SYS kernel).
+ I doubt that exiting the game will
+ work, as MEMLO is $2300 on this DOS.
+- MyPicoDOS 4.03 on atari800: success
+- Fenders 3-sector loader on atari800: success
+- Atari DOS 3.0 on atari800: success
+- Top DOS 1.5 on atari800: success
+- "DOS 2.6f" on atari800: success
+- Smart DOS 6.1d on atari800: success
+- Super DOS 2.9 on atari800: failure. MEMLO is $35c1 on this DOS,
+ *way* too high!
+
+Note: all the oddball DOSes at the end of the list are ones I really
+used to run at various different times, in the old days. All the tests
+with atari800, other than the direct xex loading, were done with SIO
+patching disabled. On some of the DOSes, exiting the program may not work
+(answering N to the "play again?" prompt); I didn't test this with most
+of them.
Untested (waiting on results from testers):
-- Atarimax flash cart EXE loader
+- Atarimax flash cart EXE loader. An older Taipan build failed due
+ to the loader leaving RAMTOP set to $a0. My first attempt to fix this
+ worked, but broke loading with MyIDE and SDX. The current code *should*
+ be fine, but I have yet to hear back from my tester about it.
Untested, but worth looking at:
-- MyPicoDOS
- RealDOS, BeweDOS? probably same results as Sparta 3...
diff --git a/Makefile b/Makefile
index c68cbea..d1d8410 100644
--- a/Makefile
+++ b/Makefile
@@ -2,6 +2,8 @@
# Written for GNU make, but seems to work with BSD make (though
# I don't test BSD make every time I change anything).
+# 'make help' will show the list of targets.
+
# cl65 binary:
CC=cl65
@@ -67,10 +69,14 @@ AS=ca65
ASFLAGS=
AR=ar65
-# C compiler for host system. Currently only used for building convfont.
+# C compiler for host system. Currently only used for building convfont
+# and mkcart.
HOSTCC=gcc
HOSTCFLAGS=-Wall
+# Perl binary. This Makefile relies heavily on perl.
+PERL=perl
+
# A few files have no make rules here. LORCHA.DAT is generated as a
# side-effect of generating taifont.xex. It's a 49-byte (7x7) blob of
# Atari "internal" screen codes.
@@ -103,19 +109,47 @@ BIGNUM_CFLAGS=-DBIGNUM=BIGFLOAT
#BIGNUM_CFLAGS=-DBIGNUM=BIGINT48
# Default rule for plain 'make' command is to build the binary.
-all: $(XEX) tags
+all: checkenv $(XEX) tags
# I have F10 in my editor bound to 'make test', so:
test: all
atari800 -nobasic $(XEX)
+# Check the build environment.
+checkenv:
+ @$(PERL) -e1 && echo "perl found" && exit 0 || echo "perl missing" && exit 1
+ @$(PERL) -MImage::Magick -e1 && echo "perl Image::Magick found" && exit 0 || echo "perl Image::Magick missing" && exit 1
+ @$(CC) --help > /dev/null && echo "cl65 found" && exit 0 || echo "cl65 missing (install cc65)" && exit 1
+ @echo "int main() { return 0; }" > 1.c && exit 0 || echo "can't create files in current directory" && exit 1
+ @$(HOSTCC) -o 1 1.c && echo "host C compiler found" && exit 0 || echo "host C compiler missing or broken" && exit 1
+
# ctags. I forgot it can handle cc65 asm source. One wrinkle: C
# identifiers get prepended with an underscore from the POV of assembly
# code, and asm identifiers need a leading underscore to be used from
# C. There's probably a clever way to get ctags to handle this, but I
# don't know it, so I wrote a perl script to do the job.
tags:
- @ctags $(TAIMAIN_C_SRC) $(TAIMAIN_ASM_SRC) 2>/dev/null && perl fixtags.pl tags || true
+ @ctags $(TAIMAIN_C_SRC) $(TAIMAIN_ASM_SRC) 2>/dev/null && $(PERL) fixtags.pl tags || true
+
+help:
+ @echo "Top-level targets:"
+ @echo "make - builds taipan.xex (disk version)"
+ @echo "make cart - builds taipan.rom and taipan.cart (cartridge version)"
+ @echo "make test - builds & runs taipan.xex in atari800 emulator"
+ @echo "make dos2 - builds & runs taipan.xex in atari800 on a "; \
+ echo " DOS 2.0S floppy image"
+ @echo "make mydos - builds & runs taipan.xex in atari800 on a "; \
+ echo " MyDOS 4.50 floppy image"
+ @echo "make fenders - builds & runs taipan.xex in atari800 on a "; \
+ echo " Fenders 3-sector Loader floppy image"
+ @echo "make testcart - builds & runs taipan.cart in atari800 emulator"
+ @echo
+ @echo "Useful variables to add to the make command:"
+ @echo " CC - path to cl65 binary (default: cl65, searches PATH)"
+ @echo " EXTRACFLAGS - extra options to pass to cl65"
+ @echo " HOSTCC - path to native C compiler (default: gcc, searches PATH)"
+ @echo " HOSTCFLAGS - extra options to pass to HOSTCC (default: -Wall)"
+ @echo " PERL - path to perl binary (default: perl, searches PATH)"
# The above is fast & easy, but from time to time it's necessary
# to test slow loading, make sure the title screen stuff works OK.
@@ -144,8 +178,8 @@ mydos: all
# The game binary is a multi-part binary load file. This rule
# depends on all the pieces, and just concatenates them.
$(XEX): checkmem.xex taimain.xex taifont.xex newtitle.xex comptitle.xex
- perl multixex.pl checkmem.xex comptitle.xex newtitle.xex taifont.xex taimain.xex > $(XEX)
- perl size.pl $(TAIMAIN_ADDR) $(STACK_SIZE)
+ $(PERL) multixex.pl checkmem.xex comptitle.xex newtitle.xex taifont.xex taimain.xex > $(XEX)
+ $(PERL) size.pl $(TAIMAIN_ADDR) $(STACK_SIZE)
# Bitmap data for the title screen, 256x184 = 47104 pixels, 8 bits
# per pixel, or 5888 bytes. Displayed in ANTIC mode F (aka GR.8),
@@ -156,12 +190,12 @@ $(XEX): checkmem.xex taimain.xex taifont.xex newtitle.xex comptitle.xex
# the game binary as-is: it's now used as input for creating
# comptitle.xex, the compressed title screen.
titledata.dat: newtitle.pl newtitle.png
- perl newtitle.pl > titledata.dat
+ $(PERL) newtitle.pl > titledata.dat
# compressed title, for faster loading. see titlecompression.txt
# for gory details.
comptitle.xex: titledata.dat titlecomp.pl comptitle.s.in
- perl titlecomp.pl 133 < titledata.dat
+ $(PERL) titlecomp.pl 133 < titledata.dat
cl65 -l comptitle.lst -o comptitle.xex -t none --asm-define destination=$(TITLE_DATA_ADDR) comptitle.s
# tiny 1-sector memory checker, aborts the laod if a cart is present.
@@ -181,14 +215,14 @@ newtitle.xex: newtitle.s ver.dat help.dat
# Version number in Atari screen-data form
ver.dat: text2screen.pl
- echo "$(VERSION)" | perl text2screen.pl > ver.dat
+ echo "$(VERSION)" | $(PERL) text2screen.pl > ver.dat
# Help text for the title screen
help.dat: help.txt text2screen.pl
- perl text2screen.pl < help.txt > help.dat
+ $(PERL) text2screen.pl < help.txt > help.dat
#ver.dat: mkver.pl
-# perl mkver.pl $(VERSION) > ver.dat
+# $(PERL) mkver.pl $(VERSION) > ver.dat
# The main executable. All the C and asm code goes here, except the init
# segment in newtitle.s.
@@ -216,9 +250,10 @@ taifont.xex: convfont romfont font
cat romfont font | ./convfont -x > taifont.xex
touch draw_lorcha.s
-# Not part of the game binary. This just builds the font without the
-# Atari 6-byte binary load header, for eyeballing it in bitmapdump.pl
-# or converting to other formats.
+# Used by the cartridge build, but not the disk (xex) binary. This just
+# builds the font without the Atari 6-byte binary load header. It ends
+# up at the top of one of the cartridge banks, and is also useful for
+# eyeballing the font in bitmapdump.pl or converting to other formats.
taifont: convfont romfont font
cat romfont font | ./convfont > taifont
@@ -241,9 +276,14 @@ convfont: convfont.c
$(HOSTCC) $(HOSTCFLAGS) -DFONT_ADDR=$(FONT_ADDR) -o convfont convfont.c
-### Cartridge-related targets.
+### Cartridge-related targets. The way I'm doing this isn't 'proper': I should
+# be using cc65's linker with a fancy config script to do the bank layout
+# and such. But it's a lot easier for me to use the tools I know how to use,
+# so that's what I did.
# mkcart turns a raw binary into an atar800 .cart image with 16-byte header.
+# originally I wrote this for use with the DASM assembler, but there's
+# nothing DASM-specific about it.
mkcart: mkcart.c
$(HOSTCC) $(HOSTCFLAGS) -o mkcart mkcart.c
@@ -259,17 +299,17 @@ romable_taimain.raw: $(TAIMAIN_C_SRC) $(TAIMAIN_ASM_SRC) $(TAIMAIN_HDRS)
tail -c+2 taimain.xex > romable_taimain.raw
rm -f taimain.xex
-# 512 bytes of $ff filler, for the last 2 pages of each code bank. Wasting
-# this little bit of space simplifies the copying code in bank7.s, and
-# guarantees I don't accidentally end up with a 0 in the "cart present"
-# byte of the cart trailer.
-fill512:
- perl -Mbytes -e 'print chr(0xff) x 512' > fill512
+# 256 bytes of $ff filler, for the last page of each code bank. Wasting
+# this little bit of space simplifies the copying code in bank7.s (no
+# partial last page to copy), and guarantees I don't accidentally end
+# up with a 0 in the "cart present" byte of the cart trailer.
+fill256:
+ $(PERL) -Mbytes -e 'print chr(0xff) x 256' > fill256
# 8192 bytes of $ff filler, for unused banks. Possibly these will be
# used for something like an interactive game manual/tutorial.
blankbank:
- perl -Mbytes -e 'print chr(0xff) x 8192' > blankbank
+ $(PERL) -Mbytes -e 'print chr(0xff) x 8192' > blankbank
splitrom.raw.0: splitrom.raw.3
@@ -277,36 +317,42 @@ splitrom.raw.1: splitrom.raw.3
splitrom.raw.2: splitrom.raw.3
+# split romable_taimain.raw into bank-sized chunks. if we end up
+# with 4 chunks, the cart won't work correctly, so stop the build here
+# in that case.
splitrom.raw.3: romable_taimain.raw
- split -b 7680 -a 1 -d romable_taimain.raw splitrom.raw.
+ split -b 7936 -a 1 -d romable_taimain.raw splitrom.raw.
+ [ -e splitrom.raw.4 ] && echo "*** romable_taimain.raw too big" && rm -f splitrom.raw.* && exit 1 || exit 0
-bank0: splitrom.raw.0 fill512
- cat splitrom.raw.0 fill512 > bank0
+bank0: splitrom.raw.0 fill256
+ cat splitrom.raw.0 fill256 > bank0
-bank1: splitrom.raw.1 fill512
- cat splitrom.raw.1 fill512 > bank1
+bank1: splitrom.raw.1 fill256
+ cat splitrom.raw.1 fill256 > bank1
-bank2: splitrom.raw.2 fill512
- cat splitrom.raw.2 fill512 > bank2
+bank2: splitrom.raw.2 fill256
+ cat splitrom.raw.2 fill256 > bank2
bank3: splitrom.raw.3 bank3.s taifont
cl65 -l bank3.lst -m bank3.map -t none -o bank3 bank3.s
bank7: bank7.s titledata.dat ver.dat help.dat newtitle.s
- cl65 -l bank7.lst -m bank7.map -t none -o bank7 bank7.s
+ cl65 --asm-define BANK3SIZE=`$(PERL) -e 'print -s "splitrom.raw.3"'` -l bank7.lst -m bank7.map -t none -o bank7 bank7.s
+# raw ROM, for burning to EPROM/flash.
taipan.rom: bank0 bank1 bank2 bank3 bank7 blankbank
cat bank0 bank1 bank2 bank3 blankbank blankbank blankbank bank7 > taipan.rom
-cart: taipan.cart
-
-testcart:
- atari800 taipan.cart
-
+# .cart version with atari800-compatible header.
taipan.cart: taipan.rom mkcart
./mkcart -otaipan.cart -t13 taipan.rom
./mkcart -ctaipan.cart
+cart: checkenv taipan.cart
+
+testcart: cart
+ atari800 taipan.cart
+
### Rules for building various file types with the cc65 toolchain.
.s.o:
@@ -320,16 +366,16 @@ taipan.cart: taipan.rom mkcart
# Obligatory clean and distclean rules.
clean:
- rm -f *.o *.lst convfont *.xex AUTORUN.SYS taipan.atr ver.dat help.dat tags cartmsg.dat splitrom.raw.* taipan.rom taipan.cart bank[0-9] fill512 blankbank romable_taimain.raw
+ rm -f *.o *.lst convfont *.xex AUTORUN.SYS taipan.atr ver.dat help.dat tags cartmsg.dat splitrom.raw.* taipan.rom taipan.cart bank[0-9] fill512 blankbank romable_taimain.raw splitrom.raw.* comptitle.s comptitle.dat
distclean: clean
- rm -f *~ core .*.swp 1.* 2.* 1 2 3 map map.* *.map a b c foo bar baz comptitle.s comptitle.dat
+ rm -f *~ core .*.swp 1.* 2.* 1 2 3 map map.* *.map a b c foo bar baz
push:
sh push.sh
size: clean all
- perl size.pl $(TAIMAIN_ADDR) $(STACK_SIZE)
+ $(PERL) size.pl $(TAIMAIN_ADDR) $(STACK_SIZE)
# Cruft. Was used for testing the enemy ship animation.
lorchatest: lorchatest.c draw_lorcha.s taifont.xex
@@ -364,7 +410,7 @@ soundtest: sounds.c
# former textmode title screen, was generated by TITLE.LST. Replaced
# by graphical title screen.
#title.xex: TITLE.DAT
-# perl title.pl TITLE.DAT > title.xex
+# $(PERL) title.pl TITLE.DAT > title.xex
# old title
#$(XEX): taimain.xex taifont.xex title.xex
diff --git a/bank3.s b/bank3.s
index 950b6a0..c39dd28 100644
--- a/bank3.s
+++ b/bank3.s
@@ -1,9 +1,17 @@
.include "atari.inc"
+ ; where the font lives. Must agree with bank7.s.
font = $9c00
.org $8000
.incbin "splitrom.raw.3"
+
+ .if * > font
+ .fatal "bank7 code too large"
+ .else
+ .out .sprintf("=> %d bytes free in bank 3", font - *)
+ .endif
+
.res font - *, $ff
.incbin "taifont"
diff --git a/bank7.s b/bank7.s
index 3459aa0..1ddb55a 100644
--- a/bank7.s
+++ b/bank7.s
@@ -1,31 +1,57 @@
+; bank 7 of the cartridge image, to be built with -t none.
+; this bank is the fixed bank, always mapped at $a000-$bfff, in
+; the "left cartridge" area.
+
+ .macpack atari ; for scrcode (screen code) macro
+
.include "atari.inc"
-font = $9c00
-CCNTL = $d500
+; zero page temporaries
destptr = FR0
srcptr = FR1
+
+; where the romable_taimain code was org'ed.
codedest = $0400
+; address of the font, which lives in bank 3 of the cart.
+font = $9c00
+
+; cc65's atari.inc fails to define this standard Atari label.
+CCNTL = $d500
+
+; cart_trailer is my name for what the OS calls CARTLOC.
+; cc65's atari.inc doesn't define it either.
cart_trailer = $bffa
+
.org $a000 ; left cartridge
screendata:
+ ; uncompressed title screen bitmap, $1700 bytes
.incbin "titledata.dat"
.res $44, $ff ; fudge factor, keep the DL from crossing a 1K boundary
+
+ ; newtitle.s is the display list and menu code. CART_TARGET is used
+ ; for conditional assembly (to make it work from ROM).
CART_TARGET = 1
.include "newtitle.s"
-; copy 7680 bytes from $8000-$9dff to (destptr).
-; on exit, destptr points to the next 7680 byte chunk.
-copy_30_pages:
+; copy_31_pages:
+; copy 7936 bytes from $8000-$9dff to (destptr).
+; on exit, destptr points to the next 7936 byte chunk.
+
+; copy_x_pages:
+; as above, but accepts number of pages to copy in X register.
+
+copy_31_pages:
+ ldx #$1f
+copy_x_pages:
lda #$0
tay
sta srcptr
lda #$80
sta srcptr+1
- ldx #$1e
@copypage:
lda (srcptr),y
sta (destptr),y
@@ -38,7 +64,27 @@ copy_30_pages:
init:
rts
+mem_msg:
+ scrcode "Sorry, this game requires at least 32K"
+mem_msg_len = * - mem_msg - 1
+
+memory_error:
+ lda #$20 ; red BG
+ sta COLOR2
+ ldy #mem_msg_len
+@mloop:
+ lda mem_msg,y
+ sta (SAVMSC),y
+ dey
+ bpl @mloop
+@hang:
+ bmi @hang
+
cartstart:
+ lda RAMTOP
+ cmp #$80
+ bne memory_error
+
; turn off ANTIC DMA to speed up copying to RAM
lda #0
sta SDMCTL
@@ -51,35 +97,41 @@ cartstart:
sta destptr+1
lda #0 ; bank 0...
sta CCNTL ; ...select it
- jsr copy_30_pages
+ jsr copy_31_pages
lda #1 ; bank 1...
sta CCNTL ; ...select it
- jsr copy_30_pages
+ jsr copy_31_pages
lda #2 ; bank 2...
sta CCNTL ; ...select it
- jsr copy_30_pages
+ jsr copy_31_pages
lda #3 ; bank 3...
sta CCNTL ; ...select it
- jsr copy_30_pages
+ ldx #(>BANK3SIZE)+1 ; BANK3SIZE defined on the command line
+ jsr copy_x_pages
+
+ .out .sprintf("BANK3SIZE %x (%x pages)", BANK3SIZE, (>BANK3SIZE)+1)
; leave bank 3 enabled, as it has our custom font in it
-; set up display list
- ;lda #34
- ;sta SDMCTL
- ;lda #>font
- ;sta CHBAS
lda #1
- sta COLDST ; System Reset = reboot
- jsr start ; from newtitle.s
- jsr $0400 ; run the game (romable_taimain)
+ sta COLDST ; System Reset = reboot
+ jsr start ; 'start' is from newtitle.s
+ jsr codedest ; run the game (romable_taimain)
jmp cartstart ; redisplay title screen if "play again? N"
.if * > cart_trailer
.fatal "bank7 code too large"
+ .else
+ .out .sprintf("=> %d bytes free in bank 7", cart_trailer - *)
.endif
+ ; fill with 1 bits until the cart trailer
.res cart_trailer - *, $ff
+
+ ; trailer (some docs called it a 'header' but, eh, it doesn't come at
+ ; the head of the cart...)
+ ; see Mapping the Atari's entry for 'Cartridge B' or the Tech Ref Manual
+ ; for a description of this.
.word cartstart ; entry point
.byte 0 ; 0 = cartridge present
.byte 4 ; init and run the cart, don't boot the disk, non-diagnostic
diff --git a/cart.txt b/cart.txt
index a7783da..f897de9 100644
--- a/cart.txt
+++ b/cart.txt
@@ -23,10 +23,16 @@ joey_z is willing to manufacture carts like this:
"For bank-switched cartridges banks are numbered in the order they appear
in the image file, starting with 0."
+So far, he's built a prototype (old EPROM, dead-bug mounted logic ICs,
+hand-wired) and is working on a cleaner version, using a 99 cent flash
+chip, for production. The only cart shells we've been able to find are
+actually for the C=64, and will supposedly work on any Atari 8-bit except
+the 1200XL.
+
...so:
-Bank 7 will have the startup code, uncompressed title screen, title
-code, and code to copy from the other banks to RAM.
+Bank 7 has the startup code, uncompressed title screen, title code,
+and code to copy from the other banks to RAM.
That gives me banks 0-6 to store code in. The code is 27174 bytes, so I
have plenty of space: it'll occupy 4 banks, leaving 2 empty ones. The
@@ -37,43 +43,40 @@ Code in bank 7 will copy all the chunks to correct place in RAM... and
I don't need to leave room for DOS or anything else, so the code can be
ORGed at $0400 (romable_taimain.raw target in the Makefile does this).
-$0400 + 27174 means the code ends at $6e26, and the BSS is less than a
-page. The OS will place the GR.0 display list at $7c20, and the stack
-will grow down from there to $7a40 (except it never grows that much).
-
-Copying the code to RAM will take some time, but not too much. Should be
-around 1/4 second, don't need a progress bar or anything. Not sure when to do
-the copying:
-
-1. At boot, before displaying title screen?
-2. After the title screen is displayed, before the menu is active?
-3. After the player presses space/enter to start the game?
+$0400 + 27174 means the code ends at $6e26. The BSS is right after that,
+and is less than a page. The OS will place the GR.0 display list at $7c20,
+and the stack will grow down from there to $7a20 (except it never grows
+that much).
-Options 1 and 3 will allow turning off ANTIC DMA during the copy, making
-it a bit faster. Option 2 gives the player something to look at while
-the copy is happening, but I think it'll be so quick as to not matter.
+Copying the game code to RAM causes a short delay at boot (0.43 seconds).
+It's barely noticeable, and lots of cartridge games have similar delays.
+The copying code could maybe be optimized to speed it up a little,
+but it's probably not even worth the effort.
Amusingly, the Taipan cart will work on a 32K 800. Not a 16K Atari though.
bank 7: fixed bank
-$a000-$b9xx - title screen data, dl, menu code
-$ba00-$bff9 - memory checker plus code to copy romable_taimain to RAM
+$a000-$bxxx - title screen data, dl, menu code,
+ memory size checker, code to
+ copy romable_taimain to RAM
$bffa-$bfff - cart trailer
banks 0, 1, 2: full banks of romable_taimain code
-$8000-$9dff - 30 pages (7680 bytes) of code
+$8000-$9dff - 31 pages (7936 bytes, 7.75K) of code
$9f00-$9fff - unused
-bank 3: last (partial) bank of romable_taimain, plus the font
+bank 3: last (partial) bank of romable_taimain, plus the font.
+This bank stays enabled after copying is done.
$8000-$9bff - up to 7K of code (28 pages)
$9c00-$9fff - font (1K)
-Unused areas are filled with $ff. For the banks that map at $8000, this
-includes the cart trailer area. A non-zero byte (our $ff) at $9ffc tells
-the OS that a cart isn't inserted in the right slot, so it won't try to
-initialize/run our cart as a right cart. Only bank 7 (that maps as a
-left cart) needs a valid cart trailer... according to cart.txt, every
-once in a while, bank 7 might come up selected at power on. This shouldn't
+Unused areas are filled with $ff (this is the default state for both
+flash and EPROM). For the banks that map at $8000, this includes the
+cart trailer area. A non-zero byte (our $ff) at $9ffc tells the OS that a
+cart isn't inserted in the right slot, so it won't try to initialize/run
+our cart as a right cart. Only bank 7 (that maps as a left cart) has a
+valid cart trailer... according to cart.txt, every once in a while, bank
+7 might come up selected in the $8000 bank at power on. This shouldn't
matter: it'll be in both bank areas, and if the OS tries to init it as
a right cart, the init/run addresses will point to the left cart area.
@@ -82,25 +85,33 @@ if I write one.
--
-Changes the game will need for a cart version: Not many.
+Changes the game needed for a cart version: Not many.
+
+.org $400 for taimain.xex. It could be a little higher, but making it
+as low as possible allows room for bugfixes or new features (if I ever
+add any).
+
+checkmem.s isn't needed any longer... though there is a new memory checker
+(in bank 7) that says "32K required" if someone tries it on a 16K machine.
-checkmem.s won't be needed any longer... though there will need to be
-a new memory checker (in bank 7) that says "32K required" if someone
-tries it on a 16K machine.
+Exiting the game (N at "Play again?" prompt) returns to the title screen,
+since there's no DOS to exit to. This might be slightly useful: you
+might decide to change the colors or disable sound for your next game.
-"Play again?" should probably be "Press any key to play again" since
-there's no place to exit() to. Unless I do a manual! Then it'll exit
-to the title screen, from whence the user can choose the manual or else
-start the game again.
+Pressing the Reset key does a coldstart (reboot) in the cart version.
+You end up at the title screen again.
-The title decompression will be gone: it'll just display the title screen
-DL and data straight from ROM. The menu help text might be in RAM though,
-as at least 2 bytes need to be modified (sound on/off).
+The title decompression is gone: it just displays the title screen DL
+and data straight from ROM. The menu help text and the tail end of the
+display list are in RAM though, so the menu can change them. Moving the
+end of the DL to RAM means one extra black (border-colored) scanline
+appears due to the DL jump instruction. I may make the border the same
+color as the text bg, to make this less noticeable.
-The font will be located in ROM, on a 1K boundary, so CHBAS can point
-to it (no need to copy to RAM).
+The font is located in ROM, on a 1K boundary, so CHBAS can point
+to it, rather that $2000 like the xex version.
-num_buf and firm will be located in the BSS rather than page 6 as they
+num_buf and firm are located in the BSS rather than page 6 as they
are in the .xex version.
Since I have 3 empty banks... Why not include a manual on the cart,
@@ -108,15 +119,6 @@ with pseudo-hypertext UI?
--
-Cart header (trailer, actually). Can I get away with using the same one
-for all banks? IIRC, the low one ("right cartridge") gets looked at first,
-does that mean the high bank doesn't even need a header?
-
-atari800 can load a .xex that's built with --start-addr 0x400. This will
-make testing the cart stuff slightly easier.
-
---
-
What would be *really* slick: figure out a way to split the code up
across banks and include bankswitching in the logic, so it runs from
the cart and switches banks as needed. This would allow Taipan to run
@@ -127,7 +129,9 @@ in asm? Probably. Do I want to? Not really.
--
-The cartridge label should look like a classic brown 1st-gen 400/800 cart.
+The cartridge label should look like a classic brown 1st-gen 400/800 cart,
+even if the cart shell itself doesn't.
+
Yellow text:
TAIPAN!