From 34234bc02fdea95693c8ca83b16b15373ade6bb7 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Tue, 19 Mar 2019 12:06:36 -0400 Subject: [PATCH] ootw: start adding code to handle end of level --- ootw/FAQ | 40 +++++++++++++++++++++++------ ootw/Makefile | 1 + ootw/README | 18 +++++++++++--- ootw/ootw.s | 1 + ootw/ootw_mesa.s | 65 ++++++++++++++++++++++++++++++++++++++++++------ ootw/zp.inc | 3 +-- 6 files changed, 106 insertions(+), 22 deletions(-) diff --git a/ootw/FAQ b/ootw/FAQ index 1ac45126..d7ea2e34 100644 --- a/ootw/FAQ +++ b/ootw/FAQ @@ -5,6 +5,27 @@ A. No, this is just a quick hack using all sprites. I'm not doing something amazing like writing a 6502 optimized vector drawing library. +--- + + +Q. Why aren't the keyboard controls the same as the original game? + +A. The Apple II has simplistic keyboard support. + In general it's not possible to read more than one key at a time. + Additionally, on older models there's no auto-repeat unless you + hold down the REPT key, which makes running difficult. + The original game really depends on being able to detect having + multiple keys down at once. + +--- + +Q. Does this have joystick support? + +A. It should not be hard to add, and in fact would give better controls + than the keyboard. I don't currently have a joystick though so + it's hard to test properly. + +---- Q. Is there anything impressive going on here, like with your other demos? @@ -14,6 +35,8 @@ A. No, it's pretty much straight up "sprite" drawing. It's actually refreshing not having to cycle count. +--- + Q. How are you making the graphics? @@ -23,6 +46,8 @@ A. Using the original for reference (currently a Windows/EGA version Finally fine tune in a bit while using original for reference. +--- + Q. Why lores graphics? It's so *horribly* blocky. A. Yes, but I like it anyway. So many colors! @@ -37,7 +62,7 @@ A. Yes, but I like it anyway. So many colors! so I never got to experience full-color lores back in the day. Unfortunately this game doesn't really play well in monochrome. - +--- Q. Are you going to make a version using Hi-res or Double Hi-res graphics? @@ -46,6 +71,7 @@ A. No, there's an official version for the Apple IIgs if you want something to program, would probably be slower, and would take up a lot more RAM. +--- Q. How about double-lores graphics (80x48)? It would give you almost square pixels? @@ -59,6 +85,7 @@ A. While not as bad as Hires, double-lores is also a pain. It only Also the current code uses page-flipping to avoid flicker/tearing, but doing page-flipping in double-lores is really tricky. +--- Q. Why are you targeting such an old machine, an original Apple II or II+? @@ -66,7 +93,7 @@ A. Well, I own one. Also there's something about programming on a machine from 1977, whose graphics hardware is a glorified shift register, and is implemented entirely out of 7400 series logic and 555 timers. - +--- Q. In the intro, why not have lowercase letters? @@ -74,13 +101,10 @@ A. The Apple II/II+ only supported uppercase letters by default. Also no "|" character, which explains why some of the ASCII art looks a bit odd. + I suppose I could auto-uppercase on older machines on the fly like + my Still Alive demo does. The memory budget is a bit tight though. -Q. Does this have joystick support? - -A. It should not be hard to add, and in fact would give better controls - than the keyboard. I don't currently have a joystick though so - it's hard to test properly. - +--- Q. Could you really use this on an original Apple II from 1977? diff --git a/ootw/Makefile b/ootw/Makefile index b85442d3..2b5abea0 100644 --- a/ootw/Makefile +++ b/ootw/Makefile @@ -35,6 +35,7 @@ ootw.o: ootw.s \ ootw_graphics/caves/ootw_cavern3.inc \ ootw_graphics/rope/ootw_rope.inc \ ootw_graphics/rope/ootw_swing.inc \ + ootw_graphics/endl1/ootw_l1end.inc \ ootw_graphics/sprites/sprites_physicist.inc \ sprites_slugs.inc \ sprites_ootw.inc sprites_beast.inc diff --git a/ootw/README b/ootw/README index af767797..4222b8bd 100644 --- a/ootw/README +++ b/ootw/README @@ -21,10 +21,19 @@ Another / Out-of-This World Demake for Apple II+ ================== Game controls: ================== - Use WASD keys to move, also arrow keys where available. - This is tricky as the original Apple II keyboard is very - simplistic so it's hard to get auto-repeat or multi keypress. - Spacebar is action. + Keyboard: + Note, Apple II has simplistic keyboard support. + In general it's not possible to read more than one key at a time. + Additionally, on older models there's no auto-repeat unless you + hold down the REPT key, which makes running difficult. + This means it's really not possible to use the keyboard the + same way as the original game. + + Q/E - walk left/right + A/D <-/-> - run left/right + W up - jump + S down - crouch + space - kick During the intro, you can press R to make it repeat forever. @@ -108,3 +117,4 @@ ID10 = 3397 5558/ ootw memory squeeze: after full rope sequence in: 23065 make transparent overlays: 13971 + add end-of-l1 cutscene: 26314 diff --git a/ootw/ootw.s b/ootw/ootw.s index bc3b963b..07254080 100644 --- a/ootw/ootw.s +++ b/ootw/ootw.s @@ -114,3 +114,4 @@ end_message: ; cutscenes .include "cutscene_slug.s" .include "cutscene_beast.s" +.include "ootw_graphics/endl1/ootw_l1end.inc" diff --git a/ootw/ootw_mesa.s b/ootw/ootw_mesa.s index 8a521aae..52749087 100644 --- a/ootw/ootw_mesa.s +++ b/ootw/ootw_mesa.s @@ -19,9 +19,20 @@ ootw_mesa: ;=========================== ; Setup right/left exit paramaters - lda #20 + lda BEAST_OUT ; if beast out, we can go full right + beq beast_not_out_yet + + + lda #37 ; beast trigger sta RIGHT_LIMIT - lda #0 ; until we learn to climb slopes? + jmp mesa_left + +beast_not_out_yet: + lda #20 ; beast trigger + sta RIGHT_LIMIT + +mesa_left: + lda #0 sta LEFT_LIMIT ;============================= @@ -35,12 +46,10 @@ ootw_mesa: jsr load_rle_gr ;================================= - ; copy to both pages $400/$800 + ; copy to screen jsr gr_copy_to_current jsr page_flip - jsr gr_copy_to_current - ;================================= ; setup vars @@ -106,12 +115,38 @@ mesa_check_right: cmp #$2 bne mesa_check_left - lda BEAST_OUT ; trigger beast - bne not_done_mesa + ;===================== + ; off screen to right + lda BEAST_OUT ; if beast out trigger end + beq trigger_beast ; otherwise trigger beast + + ;===================== + ; trigger ending + + lda #66 + sta LEVELEND_PROGRESS + + lda #0 + sta GAME_OVER + + lda #30 + sta PHYSICIST_X ; debugging + + jmp not_done_mesa + +trigger_beast: + ;======================= + ; trigger beast emerging lda #1 sta BEAST_OUT + lda #0 + sta GAME_OVER + + lda #37 ; update right side of screen + sta RIGHT_LIMIT ; this is mostly for testing + jsr beast_cutscene jmp not_done_mesa @@ -120,12 +155,13 @@ mesa_check_left: cmp #$1 bne not_done_mesa + ;============================ ; off screen to left mesa_off_left: lda #37 sta PHYSICIST_X lda #1 - sta WHICH_CAVE + sta WHICH_CAVE ; go left one screen jmp ootw_cavern @@ -137,3 +173,16 @@ not_done_mesa: done_mesa: rts + + + +endl1_progression: +.word l1end33_rle,l1end32_rle,l1end31_rle,l1end30_rle +.word l1end29_rle,l1end28_rle,l1end27_rle,l1end26_rle,l1end25_rle +.word l1end24_rle,l1end23_rle,l1end22_rle,l1end21_rle,l1end20_rle +.word l1end19_rle,l1end18_rle,l1end17_rle,l1end16_rle,l1end15_rle +.word l1end14_rle,l1end13_rle,l1end12_rle,l1end11_rle,l1end10_rle +.word l1end09_rle,l1end08_rle,l1end07_rle,l1end06_rle,l1end05_rle +.word l1end04_rle,l1end03_rle,l1end02_rle,l1end01_rle + + diff --git a/ootw/zp.inc b/ootw/zp.inc index b619888b..4827215b 100644 --- a/ootw/zp.inc +++ b/ootw/zp.inc @@ -185,13 +185,12 @@ DIRECTION = $F5 GAIT = $F6 TENTACLE_X = $F7 +LEVELEND_PROGRESS = $F8 SWING_PROGRESS = $F8 TENTACLE_PROGRESS = $F8 -;SLUGDEATH_PROGRESS = $F8 ELEVATOR_CYCLE = $F8 TENTACLE_GRAB = $F9 -;SLUGDEATH = $F9 ELEVATOR_COUNT = $F9 TEMP = $FA