From 2cb849dfd2ca0b701b45bc9ad10d098ad66fdbc8 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Tue, 15 Sep 2020 23:45:02 -0400 Subject: [PATCH] monkey: print current active verb --- monkey/Makefile | 2 +- monkey/monkey.s | 84 ++----------------------------- monkey/text_print.s | 30 +++++++++++ monkey/update_bottom.s | 112 +++++++++++++++++++++++++++++++++++++++++ monkey/zp.inc | 3 +- 5 files changed, 149 insertions(+), 82 deletions(-) create mode 100644 monkey/update_bottom.s diff --git a/monkey/Makefile b/monkey/Makefile index e1ee95b4..fcb5b6a0 100644 --- a/monkey/Makefile +++ b/monkey/Makefile @@ -30,7 +30,7 @@ monkey.o: monkey.s zp.inc hardware.inc common_defines.inc \ common_sprites.inc \ keyboard.s joystick.s \ leveldata_monkey.inc \ - monkey_actions.s \ + monkey_actions.s update_bottom.s \ guy.brush ca65 -o monkey.o monkey.s -l monkey.lst diff --git a/monkey/monkey.s b/monkey/monkey.s index 7b2c50d0..bab20a5c 100644 --- a/monkey/monkey.s +++ b/monkey/monkey.s @@ -57,6 +57,9 @@ monkey_start: lda #0 sta ANIMATE_FRAME + lda #VERB_WALK + sta CURRENT_VERB + game_loop: ;================= ; reset things @@ -95,25 +98,7 @@ game_loop: jmp nothing_special -fg_draw_blue_page: -; jsr draw_blue_page - jmp nothing_special -fg_draw_red_page: -; jsr draw_red_page - jmp nothing_special - -animate_projector: -; jsr draw_projection - jmp nothing_special - -animate_trap: -; jsr draw_trap - jmp nothing_special - -animate_gate_s: -; jsr update_gate_s - jmp nothing_special animate_gate_n: ; jsr update_gate_n @@ -243,68 +228,6 @@ really_exit: - - - - ;==================================== - ;==================================== - ; update bottom of screen - ;==================================== - ;==================================== -update_bottom: - - ldx #0 - -bottom_loop: - lda bottom_strings,X - sta OUTL - lda bottom_strings+1,X - sta OUTH - - jsr move_and_print - - inx - inx - - cpx #18 - bne bottom_loop - - rts - -;0123456789012345678901234567890123456789 -; -;GIVE PICK UP USE -;OPEN LOOK AT PUSH -;CLOSE TALK TO PULL - -bottom_strings: -.word bottom_give -.word bottom_open -.word bottom_close -.word bottom_pick_up -.word bottom_look_at -.word bottom_talk_to -.word bottom_use -.word bottom_push -.word bottom_pull - -bottom_give: .byte 0,21,"GIVE ",0 -bottom_open: .byte 0,22,"OPEN ",0 -bottom_close: .byte 0,23,"CLOSE",0 -bottom_pick_up: .byte 6,21,"PICK UP",0 -bottom_look_at: .byte 6,22,"LOOK AT",0 -bottom_talk_to: .byte 6,23,"TALK TO",0 -bottom_use: .byte 15,21,"USE ",0 -bottom_push: .byte 15,22,"PUSH",0 -bottom_pull: .byte 15,23,"PULL",0 - - - - - - - - ;========================== ; includes ;========================== @@ -331,3 +254,4 @@ bottom_pull: .byte 15,23,"PULL",0 .include "guy.brush" .include "monkey_actions.s" + .include "update_bottom.s" diff --git a/monkey/text_print.s b/monkey/text_print.s index 0c1e5032..12f55170 100644 --- a/monkey/text_print.s +++ b/monkey/text_print.s @@ -1,3 +1,33 @@ + ;============================= + ; normal_text + ;============================= + ; modify so print normal text +normal_text: + + ; want ora #$80 + lda #$09 + sta ps_smc1 + + lda #$80 + sta ps_smc1+1 + + rts + + ;============================= + ; inverse_text + ;============================= + ; modify so print inverse text +inverse_text: + + ; want and #$3f + lda #$29 + sta ps_smc1 + + lda #$3f + sta ps_smc1+1 + + rts + ;================================ ; move_and_print diff --git a/monkey/update_bottom.s b/monkey/update_bottom.s new file mode 100644 index 00000000..ad9875d0 --- /dev/null +++ b/monkey/update_bottom.s @@ -0,0 +1,112 @@ + ;==================================== + ;==================================== + ; update bottom of screen + ;==================================== + ;==================================== +update_bottom: + + ; draw first line + ; it's verb followed by noun + + jsr normal_text + + ; first clear line + lda #clear_line + sta OUTH + jsr move_and_print + + lda CURRENT_VERB + asl + tay + lda verb_names,Y + sta OUTL + lda verb_names+1,Y + sta OUTH + + jsr move_and_print + + + lda CURRENT_NOUN + bmi no_noun + +no_noun: + + + ;======================== + ; draw command bars + + jsr inverse_text + + ldx #0 + +bottom_loop: + lda bottom_strings,X + sta OUTL + lda bottom_strings+1,X + sta OUTH + + jsr move_and_print + + inx + inx + + cpx #18 + bne bottom_loop + + rts + +;0123456789012345678901234567890123456789 +; +;GIVE PICK UP USE +;OPEN LOOK AT PUSH +;CLOSE TALK TO PULL + +bottom_strings: +.word bottom_give +.word bottom_open +.word bottom_close +.word bottom_pick_up +.word bottom_look_at +.word bottom_talk_to +.word bottom_use +.word bottom_push +.word bottom_pull + +bottom_give: .byte 0,21,"GIVE ",0 +bottom_open: .byte 0,22,"OPEN ",0 +bottom_close: .byte 0,23,"CLOSE",0 +bottom_pick_up: .byte 6,21,"PICK UP",0 +bottom_look_at: .byte 6,22,"LOOK AT",0 +bottom_talk_to: .byte 6,23,"TALK TO",0 +bottom_use: .byte 15,21,"USE ",0 +bottom_push: .byte 15,22,"PUSH",0 +bottom_pull: .byte 15,23,"PULL",0 + + +verb_names: + +.word verb_give +.word verb_open +.word verb_close +.word verb_pick_up +.word verb_look_at +.word verb_talk_to +.word verb_use +.word verb_push +.word verb_pull +.word verb_walk + +verb_give: .byte 15,20,"GIVE ",0 +verb_open: .byte 15,20,"OPEN ",0 +verb_close: .byte 14,20,"CLOSE ",0 +verb_pick_up: .byte 12,20,"PICK UP ",0 +verb_look_at: .byte 12,20,"LOOK AT ",0 +verb_talk_to: .byte 12,20,"TALK TO ",0 +verb_use: .byte 16,20,"USE ",0 +verb_push: .byte 15,20,"PUSH ",0 +verb_pull: .byte 15,20,"PULL ",0 +verb_walk: .byte 12,20,"WALK TO ",0 + +clear_line: .byte 12,20," ",0 diff --git a/monkey/zp.inc b/monkey/zp.inc index 2d6f346a..7903b747 100644 --- a/monkey/zp.inc +++ b/monkey/zp.inc @@ -76,8 +76,9 @@ LOCATION = $81 ; location on the map GUYBRUSH_X = $82 ; location of protagonist GUYBRUSH_Y = $83 -CURRENT_VERB = $84 +CURRENT_VERB = $84 ; current verb +CURRENT_NOUN = $85 ; current noun ; done game puzzle state