From 6341d1c708efb0103f881049d6218fface68d416 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Fri, 1 Mar 2019 22:31:43 -0500 Subject: [PATCH] ootw: intro: more optimizing --- ootw/README | 1 + ootw/intro.s | 66 +++++++---------------------------------------- ootw/intro_data.s | 37 ++++++++++++++++++++------ 3 files changed, 39 insertions(+), 65 deletions(-) diff --git a/ootw/README b/ootw/README index 93e646b1..fca7dbaf 100644 --- a/ootw/README +++ b/ootw/README @@ -46,3 +46,4 @@ Memory squeeze! 2,749 over do same for zappo routines 2,493 over squish disk loader vars to page 3 2,165 over horrible hack to auto-go to next image in sequence + 2,114 over move bg loading into seq diff --git a/ootw/intro.s b/ootw/intro.s index 67b521ab..a90bcae2 100644 --- a/ootw/intro.s +++ b/ootw/intro.s @@ -1,4 +1,4 @@ -.define HACK 0 +.define HACK 1 ;===================================== @@ -32,21 +32,11 @@ intro: ;=============================== ;=============================== - ; Load background - - lda #>(building_rle) - sta GBASH - lda #<(building_rle) - sta GBASL - - lda #$c ; load to $c00 - jsr load_rle_gr - - jsr gr_copy_to_current - jsr page_flip ;================================== ; draw the car driving up + ;================================== + ; draw getting out of the car lda #(building_car_rle) - sta GBASH - lda #<(building_car_rle) - sta GBASL - - lda #$0c ; load to $c00 - jsr load_rle_gr - - jsr gr_copy_to_current - jsr page_flip - - - ;================================== - ; draw getting out of the car - - lda #outtacar_sequence - sta INTRO_LOOPH - - jsr run_sequence - ;=============================== ;=============================== @@ -87,21 +52,6 @@ intro: ;=============================== ;=============================== - ;============================= - ; Load background to $c00 - - lda #>(outer_door_rle) - sta GBASH - lda #<(outer_door_rle) - sta GBASL - - lda #$c ; load to off-screen $c00 - jsr load_rle_gr - - jsr gr_copy_to_current - jsr page_flip - - ;================================== ; draw feet going into door @@ -149,14 +99,13 @@ elevator: stx V2 ldx #4 ldy #14 - jsr vlin ; X, V2 at Y + jsr vlin ; VLIN 4,39 AT 14 (X, V2 at Y) ldx #35 stx V2 ldx #7 ldy #18 - - jsr vlin ; X, V2 at Y + jsr vlin ; VLIN 7,35 AT 18 (X, V2 at Y) ; elevator inner door ldx #2 @@ -229,7 +178,7 @@ yellow_line_down: inc V2 lda V2 - cmp #38 + cmp #37 bne yellow_line_down lda DRAW_PAGE @@ -1703,8 +1652,11 @@ no_set_image_ptr: txa and #$7f tax + cpx #1 + beq seq_no_wait jsr long_wait +seq_no_wait: iny sty INTRO_LOOPER ; save for later diff --git a/ootw/intro_data.s b/ootw/intro_data.s index 1173e962..711a7eab 100644 --- a/ootw/intro_data.s +++ b/ootw/intro_data.s @@ -2,8 +2,9 @@ .if 1 .include "intro_graphics/01_building/intro_building.inc" -.include "intro_graphics/01_building/intro_building_car.inc" .include "intro_graphics/01_building/intro_car.inc" +.include "intro_graphics/01_building/intro_building_car.inc" + .include "intro_graphics/02_outer_door/outer_door.inc" .include "intro_graphics/02_outer_door/feet.inc" @@ -43,8 +44,8 @@ .else .include "intro_graphics/01_building/intro_building_lz4.inc" -.include "intro_graphics/01_building/intro_building_car_lz4.inc" .include "intro_graphics/01_building/intro_car_lz4.inc" +.include "intro_graphics/01_building/intro_building_car_lz4.inc" .include "intro_graphics/02_outer_door/outer_door_lz4.inc" .include "intro_graphics/02_outer_door/feet_lz4.inc" @@ -88,8 +89,11 @@ ; Car driving up sequence building_sequence: - .byte 127 - .word intro_car1 + .byte 255 + .word building_rle + .byte 1 + .word building_rle + .byte 128+126 ; .word intro_car1 .byte 128+2 ; .word intro_car2 .byte 128+2 ; .word intro_car3 .byte 128+2 ; .word intro_car4 @@ -99,12 +103,16 @@ building_sequence: .byte 128+2 ; .word intro_car8 .byte 128+2 ; .word intro_car9 .byte 128+126 ; .word intro_car10 - .byte 0 +; .byte 0 ;======================== ; Getting out of car sequence outtacar_sequence: + .byte 255 + .word building_car_rle + .byte 1 + .word building_car_rle .byte 100 .word intro_car12 .byte 128+50 ; .word intro_car13 @@ -114,11 +122,15 @@ outtacar_sequence: .byte 0 -; Getting out of car sequence +;============================= +; Feet going in door sequence feet_sequence: - .byte 100 - .word feet01_rle + .byte 255 + .word outer_door_rle + .byte 1 + .word outer_door_rle + .byte 128+100 ; .word feet01_rle .byte 128+10 ; .word feet02_rle .byte 128+10 ; .word feet03_rle .byte 128+10 ; .word feet04_rle @@ -139,6 +151,15 @@ feet_sequence: .word nothing_rle .byte 0 + ; Elevator light co-ordinates +indicators: +; .byte 16,1 ; 0 +; .byte 18,2 ; 1 +; .byte 14,2 ; 2 +; .byte 16,3 ; 3 +; .byte 18,4 ; 4 + + ; Walking off elevator sequence walking_sequence: