ootw: intro: split out gr_make_quake

saved 100 bytes
This commit is contained in:
Vince Weaver
2019-03-01 11:53:56 -05:00
parent b3ec10aad9
commit 2134d47344
6 changed files with 96 additions and 90 deletions

View File

@@ -23,6 +23,7 @@ OOTW: ootw.o
ootw.o: ootw.s \
gr_copy.s gr_fast_clear.s gr_pageflip.s gr_unrle.s gr_putsprite.s \
gr_make_quake.s \
keyboard.s sluggy.s \
ootw_rope.s earthquake.s ootw_mesa.s \
ootw_pool.s ootw_cavern.s physicist.s random16.s \

View File

@@ -31,3 +31,12 @@ Memory map:
18-bf program/data (42k)
c0-cf I/O
d0-ff ROM
Memory squeeze!
10,748 over all graphincs in
10,734 over remove extraneous blank bg image
8,658 over re-arrange memory map, 42k avail now
8,562 over move gr_make_quake out of common code

View File

@@ -157,85 +157,5 @@ gc_40x40_inner:
rts ; 6
;=========================================================
; gr_make_quake
;=========================================================
; Take image in 0xc00
; Copy to 0x1000
; Actually copy lines 2..41 to 0..39
gr_make_quake:
ldx #0
make_quake_loop:
lda gr_offsets,x
sta OUTL
lda gr_offsets+1,x
clc
adc #$C
sta OUTH
inx
inx
lda gr_offsets,x
sta INL
lda gr_offsets+1,x
clc
adc #$8
sta INH
ldy #39
quake_inner:
lda (INL),Y
sta (OUTL),Y
dey
bpl quake_inner
cpx #40
bne make_quake_loop
; write zeros to the rest
quake_clear_bottom:
lda gr_offsets,x
sta OUTL
lda gr_offsets+1,x
clc
adc #$C
sta OUTH
inx
inx
ldy #39
lda #0
quake_clear_inner:
sta (OUTL),Y
dey
bpl quake_clear_inner
cpx #48
bne quake_clear_bottom
; clear the extra two lines from the original
quake_clear_extra:
ldx #40
lda gr_offsets,x
sta OUTL
lda gr_offsets+1,x
clc
adc #$8
sta OUTH
ldy #39
lda #0
quake_clear_extra_inner:
sta (OUTL),Y
dey
bpl quake_clear_extra_inner
rts ; 6

82
ootw/gr_make_quake.s Normal file
View File

@@ -0,0 +1,82 @@
;=========================================================
; gr_make_quake
;=========================================================
; Take image in 0xc00
; Copy to 0x1000
; Actually copy lines 2..41 to 0..39
gr_make_quake:
ldx #0
make_quake_loop:
lda gr_offsets,x
sta OUTL
lda gr_offsets+1,x
clc
adc #$C
sta OUTH
inx
inx
lda gr_offsets,x
sta INL
lda gr_offsets+1,x
clc
adc #$8
sta INH
ldy #39
quake_inner:
lda (INL),Y
sta (OUTL),Y
dey
bpl quake_inner
cpx #40
bne make_quake_loop
; write zeros to the rest
quake_clear_bottom:
lda gr_offsets,x
sta OUTL
lda gr_offsets+1,x
clc
adc #$C
sta OUTH
inx
inx
ldy #39
lda #0
quake_clear_inner:
sta (OUTL),Y
dey
bpl quake_clear_inner
cpx #48
bne quake_clear_bottom
; clear the extra two lines from the original
quake_clear_extra:
ldx #40
lda gr_offsets,x
sta OUTL
lda gr_offsets+1,x
clc
adc #$8
sta OUTH
ldy #39
lda #0
quake_clear_extra_inner:
sta (OUTL),Y
dey
bpl quake_clear_extra_inner
rts ; 6

View File

@@ -83,7 +83,7 @@ intro:
jsr run_sequence
.if 0
;===============================
;===============================
; Walk into door
@@ -1471,7 +1471,7 @@ particle_loop2:
; bpl collider_ui_loop
; bit KEYRESET
.endif
;===============================
;===============================
; Thunderstorm Outside
@@ -1658,8 +1658,6 @@ gone_loop:
.include "intro_graphics/04_keypad/intro_hands.inc"
.include "intro_graphics/04_keypad/intro_opening.inc"
.if 0
.include "intro_graphics/05_scanner/intro_scanner.inc"
.include "intro_graphics/05_scanner/intro_scanning.inc"
.include "intro_graphics/05_scanner/intro_ai_bg.inc"
@@ -1672,8 +1670,6 @@ gone_loop:
.include "intro_graphics/07_soda/intro_open_soda.inc"
.include "intro_graphics/07_soda/intro_drinking.inc"
.endif
.include "intro_graphics/08_lightning/lightning.inc"
.include "intro_graphics/09_tunnel/intro_tunnel1.inc"
@@ -1750,7 +1746,6 @@ run_sequence_40x40_loop:
run_sequence_40x40_done:
rts
.if 0
;=================================
; Display a sequence of images
@@ -1856,7 +1851,7 @@ no_dna:
jmp run_sequence_static_loop
run_sequence_static_done:
rts
.endif
;=====================
; long(er) wait
@@ -1909,7 +1904,6 @@ outtacar_sequence:
.word intro_car14
.byte 0
.if 0
; Getting out of car sequence
@@ -2614,7 +2608,6 @@ drinking_sequence:
.word drinking05_rle
.byte 0
.endif
; Lightning sequence

View File

@@ -87,6 +87,7 @@ end_message:
.include "gr_unrle.s"
.include "gr_fast_clear.s"
.include "gr_copy.s"
.include "gr_make_quake.s"
.include "gr_putsprite.s"
.include "gr_offsets.s"
.include "random16.s"