From 4a7cf594e2139441bfff6b3cc738b1e3c013587d Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Thu, 15 Aug 2019 10:30:07 -0400 Subject: [PATCH] ootw: initial door support slowing things down... --- ootw/door.s | 40 +++++++++++--------- ootw/ootw_c4_city.s | 42 +++++++++++++++++---- ootw/ootw_c5.s | 7 +++- ootw/ootw_graphics/l4city/ootw_c4_city.inc | 34 ++++------------- ootw/ootw_graphics/l4city/recharge.png | Bin 336 -> 2827 bytes ootw/zp.inc | 2 + 6 files changed, 72 insertions(+), 53 deletions(-) diff --git a/ootw/door.s b/ootw/door.s index d791a4d8..1b331f16 100644 --- a/ootw/door.s +++ b/ootw/door.s @@ -7,14 +7,7 @@ DOOR_STATUS = 0 DOOR_STATUS_EXPLODED = $10 DOOR_STATUS_LOCKED = $20 DOOR_STATUS_EXPLODING = $40 -DOOR_EXPLODE_DIR = 1 -DOOR_LEFT_TRIGGER = 2 -DOOR_RIGHT_TRIGGER = 3 -DOOR_STEP = 4 -DOOR_XPOS = 5 -DOOR_YPOS = 6 -door_state: door_state0: .byte $0 ; status @@ -24,17 +17,17 @@ door_state0: .byte $0 ; step + ;================================== + ; draw_doors + ;================================== + ; be sure to smc to point to right place + draw_doors: + lda NUM_DOORS + beq done_draw_doors - lda door_state+DOOR_STATUS - and #(DOOR_STATUS_OPEN | DOOR_STATUS_EXPLODED) - bne done_draw_doors - - lda door_state+DOOR_STATUS - cmp #DOOR_STATUS_CLOSED - bne door_not_closed - -door_closed: + ldx #0 +draw_doors_loop: lda #door_closed_sprite @@ -46,13 +39,24 @@ door_not_closed: actually_draw_door: - lda door_state+DOOR_XPOS + lda door_x,X sta XPOS - lda door_state+DOOR_YPOS + lda door_y,X sta YPOS + txa + pha + jsr put_sprite + pla + tax + +draw_doors_continue: + inx + cmp NUM_DOORS + bne draw_doors_loop + done_draw_doors: rts diff --git a/ootw/ootw_c4_city.s b/ootw/ootw_c4_city.s index 44a5f5fe..9a6874d9 100644 --- a/ootw/ootw_c4_city.s +++ b/ootw/ootw_c4_city.s @@ -17,18 +17,13 @@ ootw_city_init: sta CHARGER_COUNT sta GUN_STATE sta GUN_FIRE - - lda #100 - sta GUN_CHARGE + sta NUM_DOORS sta ACTION_TRIGGERED sta ACTION_COUNT -; lda #1 -; sta ACTION_COUNT - - - + lda #100 + sta GUN_CHARGE ;=============== ; set up aliens @@ -91,6 +86,7 @@ ootw_city: lda #0 sta GAIT sta GAME_OVER + sta NUM_DOORS ;============================ ; init shields @@ -127,12 +123,20 @@ alien_room_continue: ;============================== ; setup per-room variables + ;============================== lda WHICH_ROOM bne room1 + ;====================== ; Room0 with recharger room0: + + ; set up doors + + lda #5 + sta NUM_DOORS + lda #(6+128) sta LEFT_LIMIT lda #(39+128) @@ -698,6 +702,12 @@ no_fire_laser: jsr draw_shields + ;================ + ; draw doors + ;================ + + jsr draw_doors + ;======================== ; draw foreground cover ;======================== @@ -1014,3 +1024,19 @@ pit_door_cover: +door_x: + c4_r0_door0_x: .byte 7 + c4_r0_door1_x: .byte 18 + c4_r0_door2_x: .byte 29 + c4_r0_door3_x: .byte 31 + c4_r0_door4_x: .byte 33 + +door_y: + c4_r0_door0_y: .byte 24 + c4_r0_door1_y: .byte 24 + c4_r0_door2_y: .byte 24 + c4_r0_door3_y: .byte 24 + c4_r0_door4_y: .byte 24 + + + diff --git a/ootw/ootw_c5.s b/ootw/ootw_c5.s index eae2baf0..ec45c7fb 100644 --- a/ootw/ootw_c5.s +++ b/ootw/ootw_c5.s @@ -87,13 +87,18 @@ end_message: .include "gr_putsprite_crop.s" .include "gr_offsets.s" .include "gr_offsets_hl.s" +.include "gr_hlin.s" .include "random16.s" .include "keyboard.s" .include "physicist.s" .include "alien.s" -.include "door.s" +.include "gun.s" +.include "blast.s" +.include "shield.s" + +;.include "door.s" ; room backgrounds .include "ootw_graphics/l5cave/ootw_c5_cave.inc" diff --git a/ootw/ootw_graphics/l4city/ootw_c4_city.inc b/ootw/ootw_graphics/l4city/ootw_c4_city.inc index fc0b3ab0..c59ed7dc 100644 --- a/ootw/ootw_graphics/l4city/ootw_c4_city.inc +++ b/ootw/ootw_graphics/l4city/ootw_c4_city.inc @@ -11,32 +11,14 @@ recharge_rle: .byte $28 ; ysize=48 .byte $A0,$13,$00, $A4,$22, $00, $A5,$22, $00, $22, $00 .byte $22, $00, $A6,$22, $A0,$13,$00, $A4,$22, $00, $A5,$22 .byte $00, $22, $00, $22, $00, $A6,$22, $A5,$00 - .byte $E0, $20, $00, $A4,$20, $F0, $A5,$20, $00 - .byte $A4,$22, $00, $A5,$22, $00, $22, $00, $22 - .byte $00, $A6,$22, $A5,$00, $FF, $22, $00, $A3,$22 - .byte $27, $62, $A5,$22, $00, $A4,$22, $00, $A5,$22 - .byte $00, $22, $00, $22, $00, $A6,$22, $A5,$00 - .byte $EE, $22, $00, $A3,$22, $26, $F2, $A5,$22 - .byte $00, $22, $82, $A8,$22, $00, $22, $00 - .byte $22, $00, $A6,$22, $A5,$00, $FF, $22, $00 - .byte $A3,$22, $2F, $F2, $A5,$22, $00, $22, $88 - .byte $A8,$22, $00, $22, $00, $22, $00, $A6,$22 - .byte $A5,$00, $EE, $22, $00, $A3,$22, $27, $72 - .byte $A5,$22, $00, $88, $22, $52, $A7,$22, $00 - .byte $22, $00, $22, $00, $A6,$22, $A5,$00, $FF - .byte $22, $00, $A3,$22, $27, $72, $A5,$22, $00 - .byte $28, $82, $55, $A7,$22, $00, $22, $00 - .byte $22, $00, $A6,$22, $A5,$00, $EE, $22, $00 - .byte $A3,$22, $27, $F2, $A5,$22, $00, $22, $88 - .byte $A8,$22, $00, $22, $00, $22, $00, $A6,$22 - .byte $A5,$00, $FF, $22, $00, $A3,$22, $72, $A6,$22 - .byte $00, $88, $22, $52, $A7,$22, $00, $22 - .byte $00, $22, $00, $A6,$22, $A5,$00, $EF, $22 - .byte $00, $A3,$22, $62, $2F, $A5,$22, $00, $28 - .byte $82, $55, $A7,$22, $00, $22, $00, $22 - .byte $00, $A6,$22, $A5,$00, $0E, $02, $00, $A4,$02 - .byte $06, $A5,$02, $00, $02, $08, $05, $A7,$02 - .byte $00, $02, $00, $02, $00, $A6,$02, $A0,$50,$00 + .byte $AE,$20, $A4,$22, $00, $A5,$22, $20, $22, $20 + .byte $22, $20, $A6,$22, $A5,$00, $A0,$12,$22, $00, $A0,$10,$22 + .byte $A5,$00, $AF,$22, $82, $A0,$13,$22, $A5,$00, $AF,$22, $88 + .byte $A0,$13,$22, $A5,$00, $AE,$22, $88, $22, $52, $A0,$12,$22 + .byte $A5,$00, $AE,$22, $28, $82, $55, $A0,$12,$22, $A5,$00 + .byte $AF,$22, $88, $A0,$13,$22, $A5,$00, $AE,$22, $88, $22 + .byte $52, $A0,$12,$22, $A5,$00, $AE,$22, $28, $82, $55 + .byte $A0,$12,$22, $A5,$00, $AF,$02, $08, $05, $A0,$12,$02, $A0,$50,$00 .byte $A1 hallway_rle: .byte $28 ; ysize=48 .byte $A0,$28,$00, $20, $A4,$00, $20, $A4,$00, $20, $A4,$00 diff --git a/ootw/ootw_graphics/l4city/recharge.png b/ootw/ootw_graphics/l4city/recharge.png index 010419869ddfe7c08cf310bb29a3c7e6650dda5b..7d99f19435a601ab7a0758b16ea7a022376d2e16 100644 GIT binary patch delta 2696 zcmV;33U~F;0*e-qBYz3!dQ@0+Qek%>aB^>EX>4U6ba`-PAZ2)IW&i+q+TEB}axA?K zh2OafFM$aR%VDhY4!nGSVE2r&uJm6&dAc-BF@iV;Y0Uc1zqk1ppCHMbD7mDXlI0U? ztiI7G_WHE*?QA^X=OgzJ|G()s;W6Op(tqxblJ5RRzh}O``+vv1PorO6ZB*Ai(BBTU zdm~@&1MdFELBU-I*n4Bs?u~-KPmb6B{koP-wdB`V829{rj~_MgXY?zE?2{yyBj3^6 zoKvM;yp0*X%_FG4H0SGmgLnU%$5f9@egzjS-$f-1h#zWbybIqhh}RxV+lO%a-6bh# zd1Eu}`q1n5pMUQpHxJQo$lpNvY`ufJ){jV=qtM5c@D8E$e1F>Sg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