From ef8b039e65258ff3425d8cf4ff5aeaa7b5148a47 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Sat, 15 Jun 2024 22:21:59 -0400 Subject: [PATCH] riven_hgr: start working on having multiple disks --- games/riven_hgr/Makefile | 58 +- games/riven_hgr/NOTES | 13 +- games/riven_hgr/TODO | 30 +- .../{ => disk39_files}/leveldata_maglev.inc | 0 .../{ => disk39_files}/leveldata_magsteps.inc | 0 .../{ => disk39_files}/leveldata_outside.inc | 0 .../leveldata_projector.inc | 0 games/riven_hgr/graphics_cart/Makefile | 29 + games/riven_hgr/graphics_cart/cart_e.png | Bin 0 -> 3973 bytes games/riven_hgr/graphics_cart/cart_w.png | Bin 0 -> 3599 bytes games/riven_hgr/level_maglev.s | 8 +- games/riven_hgr/level_magsteps.s | 8 +- games/riven_hgr/level_outside.s | 2 +- games/riven_hgr/level_projector.s | 10 +- games/riven_hgr/loader.s | 767 ------------------ 15 files changed, 72 insertions(+), 853 deletions(-) rename games/riven_hgr/{ => disk39_files}/leveldata_maglev.inc (100%) rename games/riven_hgr/{ => disk39_files}/leveldata_magsteps.inc (100%) rename games/riven_hgr/{ => disk39_files}/leveldata_outside.inc (100%) rename games/riven_hgr/{ => disk39_files}/leveldata_projector.inc (100%) create mode 100644 games/riven_hgr/graphics_cart/Makefile create mode 100644 games/riven_hgr/graphics_cart/cart_e.png create mode 100644 games/riven_hgr/graphics_cart/cart_w.png delete mode 100644 games/riven_hgr/loader.s diff --git a/games/riven_hgr/Makefile b/games/riven_hgr/Makefile index 4c95407f..f9144b7e 100644 --- a/games/riven_hgr/Makefile +++ b/games/riven_hgr/Makefile @@ -7,37 +7,23 @@ EMPTY_DISK = ../../empty_disk/ LINKER_SCRIPTS = ../../linker_scripts/ -all: riven_hgr.dsk +all: riven_disk39.dsk -riven_hgr.dsk: QBOOT QLOAD TITLE \ +riven_disk39.dsk: QBOOT QLOAD TITLE \ LEVEL_PROJECTOR LEVEL_MAGSTEPS LEVEL_MAGLEV LEVEL_OUTSIDE \ MOVIE1 MOVIE2 - cp $(EMPTY_DISK)/empty.dsk riven_hgr.dsk - $(DOS33_RAW) riven_hgr.dsk 0 0 QBOOT 0 1 - $(DOS33_RAW) riven_hgr.dsk 0 2 QBOOT 1 1 - $(DOS33_RAW) riven_hgr.dsk 0 4 QBOOT 2 1 - $(DOS33_RAW) riven_hgr.dsk 1 0 QLOAD 0 0 - $(DOS33_RAW) riven_hgr.dsk 1 8 TITLE 0 0 - $(DOS33_RAW) riven_hgr.dsk 2 0 LEVEL_PROJECTOR 0 0 - $(DOS33_RAW) riven_hgr.dsk 9 0 LEVEL_OUTSIDE 0 0 - $(DOS33_RAW) riven_hgr.dsk 17 0 LEVEL_MAGSTEPS 0 0 - $(DOS33_RAW) riven_hgr.dsk 21 0 LEVEL_MAGLEV 0 0 - $(DOS33_RAW) riven_hgr.dsk 25 0 MOVIE1 0 0 - $(DOS33_RAW) riven_hgr.dsk 27 0 MOVIE2 0 0 - -#riven_hgr.dsk: HELLO LOADER TITLE \ -# LEVEL_PROJECTOR LEVEL_MAGSTEPS LEVEL_MAGLEV LEVEL_OUTSIDE \ -# MOVIE1 MOVIE2 -# cp $(EMPTY_DISK) riven_hgr.dsk -# $(DOS33) -y riven_hgr.dsk SAVE A HELLO -# $(DOS33) -y riven_hgr.dsk BSAVE -a 0x1000 LOADER -# $(DOS33) -y riven_hgr.dsk BSAVE -a 0x4000 TITLE -# $(DOS33) -y riven_hgr.dsk BSAVE -a 0x4000 LEVEL_PROJECTOR -# $(DOS33) -y riven_hgr.dsk BSAVE -a 0x4000 LEVEL_MAGSTEPS -# $(DOS33) -y riven_hgr.dsk BSAVE -a 0x4000 LEVEL_MAGLEV -# $(DOS33) -y riven_hgr.dsk BSAVE -a 0x4000 LEVEL_OUTSIDE -# $(DOS33) -y riven_hgr.dsk BSAVE -a 0x4000 MOVIE1 -# $(DOS33) -y riven_hgr.dsk BSAVE -a 0x4000 MOVIE2 + cp $(EMPTY_DISK)/empty.dsk riven_disk39.dsk + $(DOS33_RAW) riven_disk39.dsk 0 0 QBOOT 0 1 + $(DOS33_RAW) riven_disk39.dsk 0 2 QBOOT 1 1 + $(DOS33_RAW) riven_disk39.dsk 0 4 QBOOT 2 1 + $(DOS33_RAW) riven_disk39.dsk 1 0 QLOAD 0 0 + $(DOS33_RAW) riven_disk39.dsk 1 8 TITLE 0 0 + $(DOS33_RAW) riven_disk39.dsk 2 0 LEVEL_PROJECTOR 0 0 + $(DOS33_RAW) riven_disk39.dsk 9 0 LEVEL_OUTSIDE 0 0 + $(DOS33_RAW) riven_disk39.dsk 17 0 LEVEL_MAGSTEPS 0 0 + $(DOS33_RAW) riven_disk39.dsk 21 0 LEVEL_MAGLEV 0 0 + $(DOS33_RAW) riven_disk39.dsk 25 0 MOVIE1 0 0 + $(DOS33_RAW) riven_disk39.dsk 27 0 MOVIE2 0 0 ### @@ -66,11 +52,11 @@ HELLO: hello.bas #### -LOADER: loader.o - ld65 -o LOADER loader.o -C $(LINKER_SCRIPTS)/apple2_1000.inc +#LOADER: loader.o +# ld65 -o LOADER loader.o -C $(LINKER_SCRIPTS)/apple2_1000.inc -loader.o: loader.s hardware_detect.s - ca65 -o loader.o loader.s -l loader.lst +#loader.o: loader.s hardware_detect.s +# ca65 -o loader.o loader.s -l loader.lst #### @@ -93,7 +79,7 @@ level_outside.o: level_outside.s zp.inc hardware.inc \ hgr_sprite.s hgr_tables.s \ keyboard.s \ hgr_14x14_sprite.s \ - leveldata_outside.inc \ + disk39_files/leveldata_outside.inc \ graphics_sprites/pointer_sprites.inc \ graphics_outside/outside_graphics.inc ca65 -o level_outside.o level_outside.s -l level_outside.lst @@ -108,7 +94,7 @@ level_projector.o: level_projector.s zp.inc hardware.inc \ hgr_sprite.s hgr_tables.s \ keyboard.s \ hgr_14x14_sprite.s \ - leveldata_projector.inc \ + disk39_files/leveldata_projector.inc \ graphics_sprites/pointer_sprites.inc \ graphics_projector/projector_graphics.inc ca65 -o level_projector.o level_projector.s -l level_projector.lst @@ -123,7 +109,7 @@ level_magsteps.o: level_magsteps.s zp.inc hardware.inc \ hgr_sprite.s hgr_tables.s \ keyboard.s \ hgr_14x14_sprite.s \ - leveldata_magsteps.inc \ + disk39_files/leveldata_magsteps.inc \ graphics_sprites/pointer_sprites.inc \ graphics_magsteps/magsteps_graphics.inc ca65 -o level_magsteps.o level_magsteps.s -l level_magsteps.lst @@ -138,7 +124,7 @@ level_maglev.o: level_maglev.s zp.inc hardware.inc \ hgr_sprite.s hgr_tables.s \ keyboard.s \ hgr_14x14_sprite.s \ - leveldata_maglev.inc \ + disk39_files/leveldata_maglev.inc \ graphics_sprites/pointer_sprites.inc \ graphics_maglev/maglev_graphics.inc ca65 -o level_maglev.o level_maglev.s -l level_maglev.lst diff --git a/games/riven_hgr/NOTES b/games/riven_hgr/NOTES index 4cb219df..d07bd32d 100644 --- a/games/riven_hgr/NOTES +++ b/games/riven_hgr/NOTES @@ -14,19 +14,20 @@ T 25 = MOVIE1 7837 bytes 32S = 2T0S ~ T 27 = MOVIE2 32000 bytes 128S = 8T0S ~ -MEMORY +MEMORY MAP $0000-$00FF = zero page $0100-$01FF = stack $0200-$02FF = disk stuff $0300-$03ff = disk/interrupts $0400-$07ff = lores graphics page1 -$0800-$08ff = lores graphics page2 (qboot initial sector) +$0800-$0bff = lores graphics page2 + $800-$8ff = (qboot initial sector) $1000-$11ff = qboot_stage2 (disk code) -$1200-$17FF = HGR lookup tables -$1800-$1FFF = QLOAD = loader code +$1300-$16FF = HGR lookup tables +$1700-$17FF = ???? +$1800-$1FFF = QLOAD = loader code (2k?) $2000-$3FFF = HGR Page1, lores movie overlays -$4000-$B7FF = our code -$B800-$BFFF = hires lookup tables? +$4000-$BFFF = our code (up to 32k in theory) $C000-$CFFF = I/O $D000-$FFFF = ROM diff --git a/games/riven_hgr/TODO b/games/riven_hgr/TODO index f23d858f..1e6f4b3d 100644 --- a/games/riven_hgr/TODO +++ b/games/riven_hgr/TODO @@ -1,26 +1,16 @@ -+ Correctness - -> do I need to save screen holes? +share code in QLOAD to free up room in levels -+ Finish maglev sequence - -> should we optimize graphics better? unlikely to be more than - 1k or so there - -> do the handle animation at end? - -> sound effects? - -> if out of room in RAM (but not disk) optionally load tail end - to language card on machines that have it? -+ Main sequence - -> try to fit more locations in. two overlook scenes, - turning around in projector room +disk39: + -> try to fit more locations + have one already done that didn't fit (overlook otherway) + -> try to fit last little bit of maglev sequence + + do the handle animation at end? + + sound effects? + + if out of room in RAM (but not disk) + optionally load tail end + to language card on machines that have it? + Better keyboard handling on IIe -> was actually one of the main reasons I started working on this -+ Use QBOOT instead of QLOAD - -> would free up disk space - catalog track, T/S sectors, two tracks of DOS? - -> would have to manually pack levels - -> would be faster in theory? - -+ Add in "switch disk" message - diff --git a/games/riven_hgr/leveldata_maglev.inc b/games/riven_hgr/disk39_files/leveldata_maglev.inc similarity index 100% rename from games/riven_hgr/leveldata_maglev.inc rename to games/riven_hgr/disk39_files/leveldata_maglev.inc diff --git a/games/riven_hgr/leveldata_magsteps.inc b/games/riven_hgr/disk39_files/leveldata_magsteps.inc similarity index 100% rename from games/riven_hgr/leveldata_magsteps.inc rename to games/riven_hgr/disk39_files/leveldata_magsteps.inc diff --git a/games/riven_hgr/leveldata_outside.inc b/games/riven_hgr/disk39_files/leveldata_outside.inc similarity index 100% rename from games/riven_hgr/leveldata_outside.inc rename to games/riven_hgr/disk39_files/leveldata_outside.inc diff --git a/games/riven_hgr/leveldata_projector.inc b/games/riven_hgr/disk39_files/leveldata_projector.inc similarity index 100% rename from games/riven_hgr/leveldata_projector.inc rename to games/riven_hgr/disk39_files/leveldata_projector.inc diff --git a/games/riven_hgr/graphics_cart/Makefile b/games/riven_hgr/graphics_cart/Makefile new file mode 100644 index 00000000..6b54d6ff --- /dev/null +++ b/games/riven_hgr/graphics_cart/Makefile @@ -0,0 +1,29 @@ +include ../../../Makefile.inc + +ZX02 = ~/research/6502_compression/zx02.git/build/zx02 -f +PNG_TO_HGR = ../../../utils/hgr-utils/png2hgr + +all: cart_graphics.inc + +cart_graphics.inc: \ + cart_n.hgr.zx02 cart_w.hgr.zx02 cart_e.hgr.zx02 cart_s.hgr.zx02 \ + in_cart_e.hgr.zx02 + echo "cart_n_zx02: .incbin \"cart_n.hgr.zx02\"" > cart_graphics.inc + echo "cart_w_zx02: .incbin \"cart_w.hgr.zx02\"" >> cart_graphics.inc + echo "cart_e_zx02: .incbin \"cart_e.hgr.zx02\"" >> cart_graphics.inc + echo "cart_s_zx02: .incbin \"cart_s.hgr.zx02\"" >> cart_graphics.inc + echo "in_cart_e_zx02: .incbin \"in_cart_e.hgr.zx02\"" >> cart_graphics.inc + +#### + +%.hgr: %.png + $(PNG_TO_HGR) $< > $@ + +%.hgr.zx02: %.hgr + $(ZX02) -f $< $@ + +#### + +clean: + rm -f *~ *.o *.lst *.zx02 *.hgr cart_graphics.inc + diff --git a/games/riven_hgr/graphics_cart/cart_e.png b/games/riven_hgr/graphics_cart/cart_e.png new file mode 100644 index 0000000000000000000000000000000000000000..47a400a157c649d060db8479b2ad864d1781c1df GIT binary patch literal 3973 zcmV;04|?#4P)EX>4Tx04R}tkv&MmKpe$iQ;Q-M2MdaHh){L0i;6hbDionYsTEpvFuC*#nlvOS zE{=k0!NHHks)LKOt`4q(Aou~|?BJy6A|?JWDYS_3;J6>}?mh0_0Yam~RI@7vsG4P@ z6LB${TNS%s5kMG&7{R#2OnokuO2Tt|-NVP%yC~1{KKJM7Q}QMQd?Im->4rtTK|Hf* z>74h8L#!kz#OK5l23?T&k?XR{Z=8z`3p_JqWYY7*A!4!E!Ey()lA#h$6Gs$PqkJLj zvch?bvs$UK);;+PgL!Rbnd>yeNMI35NI`^*8p^1^LX=jG6ccIMk9+us9e;{kGP%lN z5bWxZDATo^;8O9LY~pC=`JAGy0|+FmMa>uDQLn_Hp_EWT>m;4RCM> zj1?(+-Q(RooxS~grq$mM-I;RHL8|yS0000IP)t-s0000R%K_vx{{R2~&07H*n*NcW zLm2=7010qNS#tmY7)$^F7<2)js6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b`#i-$Q>dD$>ZcQ{_ zH?{acTVo@iC@>GgEuB0_Fj{J23T|*jZyONgC0<@a_L}otGc=h5U=wmC6;kRH5M<4H ziueA?Ci*digPe>=Zdj`yM2+1drlcBET6#6>-L>z?59Z6T2;>d=3^@!h| z7hIGGCNPql{B{+e{7{#@MY>*JjsxJDIblr5&)QLaFlVdT51FR%KVoIfP{U6*s>Dsa z#ZHXot*dO)#Z4%ZmaDn*Q2Zu|3>Ax%be-v}?uOfyNY%jnHM7$RyDeb`)3fw5e#{oQ%sMA-i>-Fx3^^a|C(sh`X+^_(vjq9&1#M8FtKE zx9u6+c7@G!6}@zv(J{Le;1Hk8JR4aZzEw^wRNy+hhO8EUS(KQ~o|lWhmGD|R7dm)o zf5Ln+>}k5bFKit?m!9)70o~fP&8xlvHk3yxhG4_gZR@-iEDAWZE$+C3;%O1#NfmX& zcg~>aDi7o0+_8O~mQIhf#Yb69rCJ_?L2Kv2=*GFt#Osrg1p^^(kyu6=SBtsLO_3l< zzpl@nJy1=zV2{wj&Yq>X9?x0L^dW8S-#{cTqV?Po&Xq!TB3fWxn5wVYbdC5e4NiJ= zA^f?uMt-6eecH-z_S&bW%?gnVz{a`I?@K(>Op1yr^B~>-?2TXMUc_W4Pyf#lv3zwI znY2xYR>j*dvuxvQBTODiuk!{w#yf`$>O@p*z$N1TCVh?MJ2Sl{uA6CQynB($w2^G1 zO|_m7!$Q6I2~^zglyRhcJPV6ES3@OcI#EM`zeZY6C4BOZtUE;6QCJj$g8HQZO#3q`DL;aSouhG)g5V*Cq$;2U> zoR2J{fw%wBXP4;m8OCHVxl8*z@wWe4&)C{|4K#Mdug@hpabZb04$H-_0&E|m)|n(I zX4NzaGs} f{vH30|LyS~8d{tR{7Yx+00000NkvXXu0mjf{#l=h literal 0 HcmV?d00001 diff --git a/games/riven_hgr/graphics_cart/cart_w.png b/games/riven_hgr/graphics_cart/cart_w.png new file mode 100644 index 0000000000000000000000000000000000000000..dfbe93211c4965f178534e58f85ea649e3930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i0%Q6WQRv6A3a3Y#X1MpIRfL38*?r1_qB4uR zUq|yC-@-t_7x!XDbI(&gPAm@N*?k)FJuH6fYKUWao7Fz3NPWvGQ5uXl4FLyXrn+i&$KIA9h;~p)8{YhWn>z2 zhZ5HT+fu%4H!U1N-R`WJX1j>hc$*;vW&EB~YK*vV?pi3S-OSI^Mv zSVNjotCb+`g=q9VTpar|1ASwaDZXXYJer}@PSnTUW14%bR!AL(UL7$;lEnD!L^Hk4 z!oF@wy%^E+-kF)CH@43#csxaWVWIf>vqi?8m$I;usyXfyY`efQmCLs*$`n_1jtc%B z%OIdV;?}en{bXp`T4Wl0#|)BZh*)X{iGGWZFE??9c>R1;JCLc}GAyf1iV*IOE^9Sap0pJ9+dv8X>RygLrktjEW3sv%PM9r*rN( zsOK*Wg~zk*wUyG&Y+98GP*XKHO;B97cvR19H50XcS|R?gmlESWKJM9!o@S->?j{ib6&(}Ru#54AXHmpiIa=#E}pRnl2* ziYJE%>cX7abuY57A$Hub>2K#=EXU#eo3dzi=S@DJDK!K!HtHL5#osa03z535+*M`rP=8aIBu8<3 zLbA|}j(5=|7>QxJp{}%e#p#s6@lo@LA65_rL9L``iAuzwQ5I`wtE~ VXQcGY^R@s0002ovPDHLkV1hAd;|2f# literal 0 HcmV?d00001 diff --git a/games/riven_hgr/level_maglev.s b/games/riven_hgr/level_maglev.s index 43cf7551..3d08f99e 100644 --- a/games/riven_hgr/level_maglev.s +++ b/games/riven_hgr/level_maglev.s @@ -53,12 +53,6 @@ riven_maglev: ; init ;=================================== -; done in title - -; lda #$20 -; sta HGR_PAGE -; jsr hgr_make_tables - jsr change_location jsr save_bg_14x14 ; save old bg @@ -160,4 +154,4 @@ handle2_clicked: .include "graphics_sprites/pointer_sprites.inc" -.include "leveldata_maglev.inc" +.include "disk39_files/leveldata_maglev.inc" diff --git a/games/riven_hgr/level_magsteps.s b/games/riven_hgr/level_magsteps.s index d93bf833..23aff461 100644 --- a/games/riven_hgr/level_magsteps.s +++ b/games/riven_hgr/level_magsteps.s @@ -53,12 +53,6 @@ riven_magsteps: ; init ;=================================== -; done in title - -; lda #$20 -; sta HGR_PAGE -; jsr hgr_make_tables - jsr change_location jsr save_bg_14x14 ; save old bg @@ -120,4 +114,4 @@ really_exit: .include "graphics_sprites/pointer_sprites.inc" -.include "leveldata_magsteps.inc" +.include "disk39_files/leveldata_magsteps.inc" diff --git a/games/riven_hgr/level_outside.s b/games/riven_hgr/level_outside.s index a9d54e1c..8f013332 100644 --- a/games/riven_hgr/level_outside.s +++ b/games/riven_hgr/level_outside.s @@ -129,4 +129,4 @@ call_button_clicked: .include "graphics_sprites/pointer_sprites.inc" -.include "leveldata_outside.inc" +.include "disk39_files/leveldata_outside.inc" diff --git a/games/riven_hgr/level_projector.s b/games/riven_hgr/level_projector.s index 040ac05a..3997bc23 100644 --- a/games/riven_hgr/level_projector.s +++ b/games/riven_hgr/level_projector.s @@ -53,12 +53,6 @@ riven_projector: ; init ;=================================== -; done in title - -; lda #$20 -; sta HGR_PAGE -; jsr hgr_make_tables - jsr change_location jsr save_bg_14x14 ; save old bg @@ -116,8 +110,6 @@ really_exit: .include "graphics_projector/projector_graphics.inc" -;.include "common_sprites.inc" - .include "graphics_sprites/pointer_sprites.inc" -.include "leveldata_projector.inc" +.include "disk39_files/leveldata_projector.inc" diff --git a/games/riven_hgr/loader.s b/games/riven_hgr/loader.s deleted file mode 100644 index c482df48..00000000 --- a/games/riven_hgr/loader.s +++ /dev/null @@ -1,767 +0,0 @@ -; Loader for DUKE - -.include "zp.inc" -.include "hardware.inc" -.include "common_defines.inc" - -nibtbl = $300 ; nothing uses the bottom 128 bytes of $300, do they? -bit2tbl = $380 ; bit2tbl: .res 86 ; = nibtbl+128 -filbuf = $3D6 ; filbuf: .res 4 ; = bit2tbl+86 - -; read any file slot 6 version -; based on FASTLD6 and RTS copyright (c) Peter Ferrie 2011-2013,2018 - -; modified to assembled with ca65 -- vmw -; added code to patch it to run from current disk slot -- vmw - -; WHICH_LOAD = $7E ; thing to load -; adrlo = $26 ; constant from boot prom -; adrhi = $27 ; constant from boot prom -; tmpsec = $3c ; constant from boot prom -; reqsec = $3d ; constant from boot prom -; sizelo = $44 -; sizehi = $45 -; secsize = $46 -; namlo = $f8 -; namhi = $f9 -; TEMPY = $fa -; step = $fd ; state for stepper motor -; tmptrk = $fe ; temporary copy of current track -; phase = $ff ; current phase for /seek -; OUTL = $fe ; for picking filename -; OUTH = $ff - - dirbuf = $c00 - ; note, don't put this immediately below - ; the value being read as destaddr-4 - ; is temporarily overwritten during read - ; process - - - FILENAME = $280 - - ;=================================================== - ;=================================================== - ; START / INIT - ;=================================================== - ;=================================================== - -loader_start: - - jsr hardware_detect - - lda #model_string - sta OUTH - - lda APPLEII_MODEL - sta model_string+17 - - cmp #'g' - bne go_print - - lda #'s' - sta model_string+18 - -go_print: - - ldy #0 -print_model: - lda (OUTL),Y - beq print_model_done - ora #$80 - sta $7d0,Y - iny - jmp print_model -print_model_done: - - - - - lda #LOAD_TITLE - sta WHICH_LOAD - - jsr init ; unhook DOS, init nibble table - - - ;=================================================== - ;=================================================== - ; SETUP THE FILENAME - ;=================================================== - ;=================================================== - -which_load_loop: - - ; update the which-file error message -; lda WHICH_LOAD -; tay -; lda which_disk,Y -; sta error_string+19 - - -; lda WHICH_LOAD -; cmp #2 -; bcc skip_engine_load -;engine_load: -; -; lda #engine_filename -; sta OUTH - -; jsr opendir_filename - -skip_engine_load: - - lda WHICH_LOAD - asl - - tay - lda filenames,Y - sta OUTL - lda filenames+1,Y - sta OUTH - -; lda WHICH_LOAD -; bne load_other - -load_intro: - lda #<$4000 - sta entry_smc+1 - lda #>$4000 - sta entry_smc+2 -; jmp actual_load - -;load_other: -; lda #<$2000 -; sta entry_smc+1 -; lda #>$2000 -; sta entry_smc+2 - -actual_load: - - ;=================================================== - ;=================================================== - ; SET UP DOS3.3 FILENAME - ;=================================================== - ;=================================================== - -load_file_and_execute: - - jsr opendir_filename - -entry_smc: - jsr $1000 ; jump to common entry point - - ; hope they updated the WHICH_LOAD value - - jmp which_load_loop - - - ;============================== - ; setup filename then open/load - -opendir_filename: - - ; clear out the filename with $A0 (space) - - lda #FILENAME - sta namhi - - ldy #29 -wipe_filename_loop: - lda #$A0 - sta (namlo),Y - dey - bpl wipe_filename_loop - - ldy #0 -copy_filename_loop: - lda (OUTL),Y - beq copy_filename_done - ora #$80 - sta (namlo),Y - iny - bne copy_filename_loop - -copy_filename_done: - jsr opendir ; open and read entire file into memory - - rts - -filenames: - .word title_filename - .word outside_filename - .word projector_filename - .word magsteps_filename - .word maglev_filename - .word movie1_filename - .word movie2_filename - -title_filename: - .byte "TITLE",0 -outside_filename: - .byte "LEVEL_OUTSIDE",0 -projector_filename: - .byte "LEVEL_PROJECTOR",0 -magsteps_filename: - .byte "LEVEL_MAGSTEPS",0 -maglev_filename: - .byte "LEVEL_MAGLEV",0 -movie1_filename: - .byte "MOVIE1",0 -movie2_filename: - .byte "MOVIE2",0 - - ;=================================================== - ;=================================================== - ; INIT (build nibble table) - ;=================================================== - ;=================================================== - - ;unhook DOS and build nibble table - -init: - ; patch to use current drive - - ; locate input paramater list - jsr $3E3 - ; result is in A:Y - sta $FF - sty $FE - ldy #1 - lda ($FE),y - - ; list+1 should have slot<<8 - - - ora #$80 ; add in $80 - - ; c0e0 - sta mlsmc06+1 - - ; c0e8 - clc - adc #8 - sta mlsmc02+1 - sta mlsmc07+1 - - ; c0e9 - clc - adc #1 - sta mlsmc01+1 - - ; c0ec - clc - adc #3 - sta mlsmc03+1 - sta mlsmc04+1 - sta mlsmc05+1 - - jsr $fe93 ; clear COUT - jsr $fe89 ; clear KEYIN - - ;======================== - ; Create nibble table - ; Note: the table starts 16 bytes in, and is sparse - ; so it doesn't entirely look like the DOS33 table at - - ldy #0 - ldx #3 -L1: stx $3c ; store tempx (3?) - txa ; a=x (a=3) - asl ; a*=2 (a=6) - bit $3c ; a&tempx, set N/V (a=6) - beq L3 ; if 0, skip to L3 - ora $3c ; a|=tempx (a=7) - eor #$ff ; a=~a (a=f8) - and #$7e ; a&=0x7e 0111 1110 (a=78) -L2: bcs L3 ; this set way back at asl?? - lsr ; a>>1 a=3c c=0 - ; a=1e c=0 - ; a=0f c=0 - ; a=07 c=1 - bne L2 ; if a!=0 goto l2 - tya ; if a==0, a=y - sta nibtbl, x ; write out to table - iny ; increment y -L3: inx ; increment x x=4, a=0f - bpl L1 ; loop while high bit not set - - rts - - - ;=================================================== - ;=================================================== - ; file not found - ;=================================================== - ;=================================================== - -file_not_found: - -mlsmc07:lda $c0e8 ; turn off drive motor? - - jsr TEXT - jsr HOME - - ldy #0 - - lda #error_string - sta OUTH - -quick_print: - lda (OUTL),Y - beq quick_print_done - jsr COUT1 - iny -; jmp quick_print - -quick_print_done: - rts - -; jsr quick_print - -fnf_keypress: - lda KEYPRESS - bpl fnf_keypress - bit KEYRESET - - jmp which_load_loop - -; offset for disk number is 19 -error_string: -.byte "PLEASE INSERT DISK 1, PRESS RETURN",0 - -model_string: -.byte "DETECTED APPLE II",0,0,0 - - - - - ;=================================================== - ;=================================================== - ; OPENDIR: actually load the file - ;=================================================== - ;=================================================== - - ; turn on drive and read volume table of contents -opendir: -mlsmc01:lda $c0e9 ; turn slot#6 drive on - ldx #0 - stx adrlo ; zero out adrlo - stx secsize ; zero out secsize - lda #$11 ; a=$11 (VTOC) - jsr readdirsec -firstent: - - lda dirbuf+1 - - ; lock if entry not found -entry_not_found: - beq file_not_found - - ; read directory sector - - ldx dirbuf+2 - jsr seekread1 - ldy #7 ;number of directory entries in a sector - ldx #$2b ;offset of filename in directory entry -nextent: - tya - pha ; was **phy** - txa - pha ; was **phx** - ldy #$1d - - ; match name backwards (slower but smaller) - -L4: - lda (namlo), y - cmp dirbuf, x - beq foundname - pla - - ; move to next directory in this block, if possible - - clc - adc #$23 - tax - pla - tay ; was **ply** - dey - bne nextent - beq firstent ; was **bra** - -foundname: - dex - dey - bpl L4 - pla - tay ; was **ply** - pla - - ; read track/sector list - - lda dirbuf-32, y - ldx dirbuf-31, y - jsr seekread1 - - ; read load offset and length info only, initially - - lda #filbuf - jsr seekread - - ; reduce load offset by 4, to account for offset and length - - sec - lda filbuf - sbc #4 - sta adrlo - - lda filbuf+1 - sbc #0 - sta adrhi - - ; save on stack bytes that will be overwritten by extra read - - ldy #3 -L5: - lda (adrlo), y - pha - dey - bpl L5 - - lda adrhi - pha - lda adrlo - pha - - ; increase load size by 4, to account for offst and length - - lda filbuf+2 - adc #3 - sta sizelo - sta secsize - - lda filbuf+3 - adc #0 - sta sizehi - beq readfirst - lda #0 ; was **stz secsize** - sta secsize - -readfirst: - ldy #$0c - - ; read a file sector - -readnext: - tya - pha - lda dirbuf, y ; A = track - ldx dirbuf+1, y ; x = sector - jsr seekread1 - pla - tay - - ; if low count is non-zero then we are done - ; (can happen only for partial last block) - - lda secsize - bne readdone - - ; continue if more than $100 bytes left - - dec sizehi - bne L6 - - ; set read size to min(length, $100) - - lda sizelo - beq readdone - sta secsize -L6: - inc adrhi - iny - iny - bne readnext - - ; save current address for after t/s read - - lda adrhi - pha - lda adrlo - pha - lda #0 - sta adrlo ; was **stz adrlo** - - ; read next track/sector sector - - lda dirbuf+1 - ldx dirbuf+2 - jsr readdirsec - clc - - ; restore current address -readdone: - pla - sta adrlo ; code originally had this backwards - pla - sta adrhi - bcc readfirst - -mlsmc02:lda $c0e8 - - ; restore from stack bytes that were overwritten by extra read - - ldx #3 - ldy #0 -L7: - pla - sta (adrlo), y - iny - dex - bpl L7 - rts - - - ;====================== - ; readdirsec - ;====================== - ; a = track? - ; x = sector? -readdirsec: - ldy #>dirbuf -seekread: - sty adrhi -seekread1: - sta phase - lda sectbl, x - sta reqsec - jsr readadr - - ; if track does not match, then seek - - cpx phase - beq checksec - jsr seek - - - ;========================================= - ; re merge in with qkumba's recent changes - ; to fix seek problem? - ;========================================= - - ; [re-]read sector - -re_read_addr: - jsr readadr -checksec: - cmp reqsec - bne re_read_addr - - ;========================= - ; read sector data - ;========================= - -readdata: - jsr readd5aa - eor #$ad ; zero A if match - bne re_read_addr - -L12: -mlsmc03:ldx $c0ec ; read until valid data (high bit set) - bpl L12 - eor nibtbl-$80, x - sta bit2tbl-$aa, y - iny - bne L12 -L13: -mlsmc04:ldx $c0ec ; read until valid data (high bit set) - bpl L13 - eor nibtbl-$80, x - sta (adrlo), y ; the real address - iny - cpy secsize - bne L13 - ldy #0 -L14: - ldx #$a9 -L15: - inx - beq L14 - lda (adrlo), y - lsr bit2tbl-$aa, x - rol - lsr bit2tbl-$aa, x - rol - sta (adrlo), y - iny - cpy secsize - bne L15 - rts - - ; no tricks here, just the regular stuff - - ;======================= - ; readaddr -- read the address field - ;======================= - ; Find address field, put track in cutrk, sector in tmpsec - -readadr: - jsr readd5aa - cmp #$96 - bne readadr - ldy #3 ; three? - ; first read volume/volume - ; then track/track - ; then sector/sector? -adr_read_two_bytes: - tax - jsr readnib - rol - sta tmpsec - jsr readnib - and tmpsec - dey - bne adr_read_two_bytes - rts - - ;======================== - ; make sure we see the $D5 $AA pattern - -readd5aa: -L16: - jsr readnib -L17: - cmp #$d5 - bne L16 - jsr readnib - cmp #$aa - bne L17 - tay ; we need Y=#$AA later - -readnib: -mlsmc05:lda $c0ec ; read until valid (high bit set) - bpl readnib - -seekret: - rts - - ;===================== - ; SEEK - ;===================== - ; current track in X? - ; desired track in phase - -seek: - ldy #0 - sty step - asl phase ; multiply by two - txa ; current track? - asl ; mul by two -copy_cur: - tax - sta tmptrk - sec - sbc phase - beq L22 - bcs L18 - eor #$ff - inx - bcc L19 -L18: - sbc #1 - dex -L19: - cmp step - bcc L20 - lda step -L20: - cmp #8 - bcs L21 - tay - sec -L21: - txa - pha - ldx step1, y -L22: - php - bne L24 -L23: - clc - lda tmptrk - ldx step2, y -L24: - stx tmpsec - and #3 - rol - tax - lsr -mlsmc06:lda $c0e0, x -L25: - ldx #$12 -L26: - dex - bpl L26 - dec tmpsec - bne L25 - bcs L23 - plp - beq seekret - pla - inc step - bne copy_cur - - - -step1: .byte $01, $30, $28, $24, $20, $1e, $1d, $1c -step2: .byte $70, $2c, $26, $22, $1f, $1e, $1d, $1c - -sectbl: .byte $00,$0d,$0b,$09,$07,$05,$03,$01,$0e,$0c,$0a,$08,$06,$04,$02,$0f - - -.include "hardware_detect.s" - -; From $BA96 of DOS33 -;nibtbl: .res 128 ; = * -; .byte $00,$01,$98,$99,$02,$03,$9C,$04 ; $BA96 ; 00 -; .byte $05,$06,$A0,$A1,$A2,$A4,$A4,$A5 ; $BA9E ; 08 -; .byte $07,$08,$A8,$A9,$AA,$09,$0A,$0B ; $BAA6 ; 10 -; .byte $0C,$0D,$B0,$B1,$0E,$0F,$10,$11 ; $BAAE ; 18 -; .byte $12,$13,$B8,$14,$15,$16,$17,$18 ; $BAB6 ; 20 -; .byte $19,$1A,$C0,$C1,$C2,$C3,$C4,$C5 ; $BABE ; 28 -; .byte $C6,$C7,$C8,$C9,$CA,$1B,$CC,$1C ; $BAC6 ; 30 -; .byte $1D,$1E,$D0,$D1,$D2,$1E,$D4,$D5 ; $BACE ; 38 -; .byte $20,$21,$D8,$22,$23,$24,$25,$26 ; $BAD6 ; 40 -; .byte $27,$28,$E0,$E1,$E2,$E3,$E4,$29 ; $BADE ; 48 -; .byte $2A,$2B,$E8,$2C,$2D,$2E,$2F,$30 ; $BAE6 ; 50 -; .byte $31,$32,$F0,$F1,$33,$34,$35,$36 ; $BAEE ; 58 -; .byte $37,$38,$F8,$39,$3A,$3B,$3C,$3D ; $BAF6 ; 60 -; .byte $3E,$3F,$13,$00,$01,$02,$01,$00 ; $BAFE ; 68 -; .byte $00,$00,$00,$00,$00,$00,$00,$00 -; .byte $00,$00,$00,$00,$00,$00,$00,$00 - - -;bit2tbl: .res 86 ; = nibtbl+128 -;filbuf: .res 4 ; = bit2tbl+86 - - - ;dataend = filbuf+4 - - -loader_end: - -.assert (16, error, "loader too big"