diff --git a/games/peasant/cliff_heights/cliff_heights.s b/games/peasant/cliff_heights/cliff_heights.s index abfbb7c4..4f09ab17 100644 --- a/games/peasant/cliff_heights/cliff_heights.s +++ b/games/peasant/cliff_heights/cliff_heights.s @@ -278,20 +278,27 @@ no_keeper: ; original code also waited approximately 100ms? ; this led to keypressed being lost + lda PEASANT_DIR + sta OLD_DIR + lda #13 sta WAIT_LOOP wait_loop: + lda IN_QUIZ cmp #2 ; means waiting for answer bne normal_keyboard_check jsr check_keyboard_answer + jmp done_keyboard_check normal_keyboard_check: jsr check_keyboard +done_keyboard_check: + lda #50 ; approx 7ms jsr wait @@ -309,6 +316,9 @@ normal_keyboard_check: sta PEASANT_XADD sta PEASANT_YADD + lda OLD_DIR ; keep from changing dir + sta PEASANT_DIR + not_in_quiz: jmp game_loop @@ -440,6 +450,145 @@ robe_sprite_data: .include "draw_lightning.s" +;========================================== +; first keeper ron + +; flips peasant forward +; 3 (4) (u shaped) +; 5 (4) (up) +; 6 (6) (up, up) +; 7 (4) (up, down) +; 6 (4) +; 7 (4) +; 6 (4) +; 7 (4) +; 6 (4) +; 7 (4) +; 6 (4) +; 7 (4) 9? repeats, ending on down +; ron transition happens +; (8) switches to 5 part way through first frame? +; 3 / ron next , to 1 part way through second (cloud frame) +; 5 ron (gap) +; 10 ron (tiny smoke) +; 10 full ron + +ron_which_keeper_sprite: +.byte 3, 5, 6, 7 +.byte 6, 7, 6, 7 +.byte 6, 7, 6, 7 + +.byte 7, 5, 5, 1, 1, 1, 1, 1, 1, 1, 1 + +ron_which_ron_sprite: +.byte 0, 0, 0, 0 +.byte 0, 0, 0, 0 +.byte 0, 0, 0, 0 + +.byte 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 4 + + + ;=============================== + ; ron transform + ;=============================== +ron_transform: + + lda #0 + sta KEEPER_COUNT + + ; look down for this + + lda #PEASANT_DIR_DOWN + sta PEASANT_DIR + +ron1_loop: + + ; erase prev keeper + + ldy #3 ; erase slot 3? + jsr hgr_partial_restore_by_num + + inc KEEPER_COUNT + ldx KEEPER_COUNT + + lda #10 + sta SPRITE_X + lda #60 + sta SPRITE_Y + + ; get offset for graphics + + ldx KEEPER_COUNT + lda ron_which_keeper_sprite,X + clc + adc #5 ; skip ron + tax + + ldy #3 ; ? slot + + jsr hgr_draw_sprite_save + + ;======================= + ; see if done animation + + lda KEEPER_COUNT + cmp #21 ; + beq ron_done + + cmp #12 + bcc ron_peasant ; normal peasant first 12 frames + + ; erase prev peasant + + ldy #4 ; erase slot 4? + jsr hgr_partial_restore_by_num + + ldx KEEPER_COUNT + + lda PEASANT_X + sta SPRITE_X + lda PEASANT_Y + sta SPRITE_Y + + ; get offset for graphics + +; ldx KEEPER_COUNT + lda ron_which_ron_sprite,X + tax + + ldy #4 ; ? slot + + jsr hgr_draw_sprite_save + + jmp done_ron_peasant + +ron_peasant: + ;======================== + ; draw peasant + + jsr draw_peasant + + + ;======================== + ; increment flame + + jsr increment_flame +done_ron_peasant: + + ;========================= + ; delay + + lda #200 + jsr wait + + + jmp ron1_loop + +ron_done: + + jsr wait_until_keypress + + rts ;========================================== ; first keeper info @@ -467,6 +616,8 @@ robe_sprite_data: ; 2 (5) ; 1 (11) ; starts talking + + keeper_x: .byte 9, 9,10,10 .byte 10,10,10,10 @@ -711,16 +862,21 @@ wrong_answer: ldy #>cave_outer_quiz1_wrong jsr finish_parse_message + jsr draw_standing_keeper + ldx #cave_outer_quiz1_wrong_part2 jsr finish_parse_message + jsr draw_standing_keeper + ldx #cave_outer_quiz1_wrong_part3 jsr finish_parse_message - ; FIXME: wiggles hand - ; FIXME: turn to Ron + ; transform to ron + + jsr ron_transform ldx #cave_outer_quiz1_wrong_part4 diff --git a/games/peasant/zp.inc b/games/peasant/zp.inc index 55ff9689..7ed735c1 100644 --- a/games/peasant/zp.inc +++ b/games/peasant/zp.inc @@ -290,9 +290,10 @@ KEEPER_COUNT = $C9 ; cliff heights IN_QUIZ = $CA ; cliff heights WHICH_QUIZ = $CB ; cliff heights +OLD_DIR = $CC ; cliff heights -PREV_X = $CC ; ?? -PREV_Y = $CD ; ?? +PREV_X = $CD ; ?? +PREV_Y = $CE ; ?? ; D0-D? used by HGR?