mirror of
https://github.com/deater/dos33fsprogs.git
synced 2025-01-12 15:30:55 +00:00
ds: more work on starbase
This commit is contained in:
parent
daf5f744ea
commit
02d916f862
@ -15,6 +15,30 @@ STARBASE:
|
||||
+ Fix sprites
|
||||
+ Keyboard emulation
|
||||
|
||||
+ change colors of shield? laser? blast?
|
||||
|
||||
+ room0
|
||||
- open with wall blasting open
|
||||
- run down steps
|
||||
- blast open door
|
||||
- run through
|
||||
+ room1
|
||||
- columns
|
||||
- run in
|
||||
- duck, start shield
|
||||
- blash shield, alien
|
||||
- run through doors
|
||||
|
||||
+ room2 (planet)
|
||||
- shoot another alien?
|
||||
- foreground animation (robot?)
|
||||
|
||||
+ room3 (ship)
|
||||
- blast control / free ship/
|
||||
- run to ship
|
||||
- engines start
|
||||
- some sort of fade-to-white transition
|
||||
|
||||
ESCAPE:
|
||||
+ Get working
|
||||
+ Keyboard emulation
|
||||
|
@ -1,130 +0,0 @@
|
||||
;=========================================================
|
||||
; gr_twoscreen_scroll, 40x48 version
|
||||
;=========================================================
|
||||
; offset is in BG_SCROLL, must be multiple of 2
|
||||
;
|
||||
; two screens, top is at $1000, bottom at $BC00
|
||||
; copy lines Y-48 from $1000 to $c00
|
||||
; copy lines 0 - (48-y) from $BC00 to $c00
|
||||
|
||||
gr_twoscreen_scroll:
|
||||
|
||||
lda #0
|
||||
sta TEMPY ; dest
|
||||
|
||||
ldy BG_SCROLL
|
||||
cpy #48
|
||||
beq gr_twoscreen_bottom ; no top to draw
|
||||
|
||||
gr_twoscreen_top:
|
||||
|
||||
; calculate source
|
||||
|
||||
lda gr_offsets+1,Y
|
||||
clc
|
||||
adc #($10-4)
|
||||
sta gr_twoscreen_smc_src+2
|
||||
lda gr_offsets,Y
|
||||
sta gr_twoscreen_smc_src+1
|
||||
tya
|
||||
pha
|
||||
|
||||
; calculate destination
|
||||
|
||||
lda TEMPY
|
||||
tay
|
||||
lda gr_offsets+1,Y
|
||||
clc
|
||||
adc #($c-4)
|
||||
sta gr_twoscreen_smc_dst+2
|
||||
lda gr_offsets,Y
|
||||
sta gr_twoscreen_smc_dst+1
|
||||
|
||||
ldx #0
|
||||
gr_twoscreen_line_loop:
|
||||
|
||||
gr_twoscreen_smc_src:
|
||||
lda $1000,X
|
||||
gr_twoscreen_smc_dst:
|
||||
sta $c00,X
|
||||
|
||||
inx
|
||||
cpx #40
|
||||
bne gr_twoscreen_line_loop
|
||||
|
||||
|
||||
inc TEMPY
|
||||
inc TEMPY
|
||||
|
||||
pla
|
||||
tay
|
||||
|
||||
iny
|
||||
iny
|
||||
|
||||
cpy #48
|
||||
|
||||
bne gr_twoscreen_top
|
||||
|
||||
|
||||
;===============================
|
||||
; now copy the bottom from $BC00
|
||||
|
||||
lda BG_SCROLL
|
||||
beq done_twoscreen_bottom ; if 0, no bottom
|
||||
|
||||
gr_twoscreen_bottom:
|
||||
|
||||
ldy #0
|
||||
|
||||
gr_twoscreen_bottom_loop:
|
||||
|
||||
; calculate source
|
||||
|
||||
lda gr_offsets+1,Y
|
||||
clc
|
||||
adc #($bc-4)
|
||||
sta gr_twoscreen_bottom_smc_src+2
|
||||
lda gr_offsets,Y
|
||||
sta gr_twoscreen_bottom_smc_src+1
|
||||
tya
|
||||
pha
|
||||
|
||||
; calculate destination
|
||||
|
||||
lda TEMPY
|
||||
tay
|
||||
lda gr_offsets+1,Y
|
||||
clc
|
||||
adc #($c-4)
|
||||
sta gr_twoscreen_bottom_smc_dst+2
|
||||
lda gr_offsets,Y
|
||||
sta gr_twoscreen_bottom_smc_dst+1
|
||||
|
||||
ldx #0
|
||||
gr_twoscreen_bottom_line_loop:
|
||||
|
||||
gr_twoscreen_bottom_smc_src:
|
||||
lda $BC00,X
|
||||
gr_twoscreen_bottom_smc_dst:
|
||||
sta $c00,X
|
||||
|
||||
inx
|
||||
cpx #40
|
||||
bne gr_twoscreen_bottom_line_loop
|
||||
|
||||
|
||||
inc TEMPY
|
||||
inc TEMPY
|
||||
|
||||
pla
|
||||
tay
|
||||
|
||||
iny
|
||||
iny
|
||||
|
||||
cpy BG_SCROLL
|
||||
|
||||
bne gr_twoscreen_bottom_loop
|
||||
done_twoscreen_bottom:
|
||||
rts ; 6
|
@ -14,7 +14,7 @@ astro_stand:
|
||||
.byte $aa,$8a,$8a,$aa,$aa
|
||||
.byte $aa,$bb,$88,$8a,$aa
|
||||
.byte $aa,$aa,$2b,$88,$aa
|
||||
.byte $aa,$aa,$bb,$aa,$aa
|
||||
.byte $aa,$a2,$bb,$aa,$aa
|
||||
.byte $aa,$aa,$bb,$aa,$aa
|
||||
.byte $aa,$aa,$22,$aa,$aa
|
||||
.byte $aa,$aa,$22,$aa,$aa
|
||||
@ -46,7 +46,7 @@ astro_walk_left1:
|
||||
.byte $aa,$8a,$8a,$aa,$aa
|
||||
.byte $aa,$bb,$88,$8a,$aa
|
||||
.byte $aa,$aa,$2b,$88,$aa
|
||||
.byte $aa,$aa,$bb,$aa,$aa
|
||||
.byte $aa,$a2,$bb,$aa,$aa
|
||||
.byte $aa,$ab,$bb,$aa,$aa
|
||||
.byte $aa,$aa,$22,$aa,$aa
|
||||
.byte $aa,$22,$a2,$66,$aa
|
||||
@ -57,7 +57,7 @@ astro_walk_left2:
|
||||
.byte $aa,$8a,$8a,$aa,$aa
|
||||
.byte $aa,$bb,$88,$8a,$aa
|
||||
.byte $aa,$aa,$2b,$88,$aa
|
||||
.byte $aa,$aa,$bb,$aa,$aa
|
||||
.byte $aa,$a2,$bb,$aa,$aa
|
||||
.byte $aa,$ba,$bb,$aa,$aa
|
||||
.byte $aa,$aa,$22,$aa,$aa
|
||||
.byte $aa,$22,$a2,$66,$aa
|
||||
@ -68,7 +68,7 @@ astro_walk_left3:
|
||||
.byte $aa,$8a,$8a,$aa,$aa
|
||||
.byte $aa,$bb,$88,$8a,$aa
|
||||
.byte $aa,$aa,$2b,$88,$aa
|
||||
.byte $aa,$aa,$bb,$aa,$aa
|
||||
.byte $aa,$a2,$bb,$aa,$aa
|
||||
.byte $aa,$ba,$2b,$aa,$aa
|
||||
.byte $aa,$aa,$22,$aa,$aa
|
||||
.byte $aa,$22,$a2,$66,$aa
|
||||
@ -79,7 +79,7 @@ astro_walk_left4:
|
||||
.byte $aa,$8a,$8a,$aa,$aa
|
||||
.byte $aa,$bb,$88,$8a,$aa
|
||||
.byte $aa,$aa,$2b,$88,$aa
|
||||
.byte $aa,$aa,$bb,$aa,$aa
|
||||
.byte $aa,$a2,$bb,$aa,$aa
|
||||
.byte $aa,$ba,$2b,$aa,$aa
|
||||
.byte $aa,$aa,$22,$aa,$aa
|
||||
.byte $aa,$22,$a2,$6a,$aa
|
||||
@ -90,7 +90,7 @@ astro_walk_left5:
|
||||
.byte $aa,$8a,$8a,$aa,$aa
|
||||
.byte $aa,$bb,$88,$8a,$aa
|
||||
.byte $aa,$aa,$2b,$88,$aa
|
||||
.byte $aa,$aa,$bb,$aa,$aa
|
||||
.byte $aa,$a2,$bb,$aa,$aa
|
||||
.byte $aa,$bb,$22,$aa,$aa
|
||||
.byte $fa,$aa,$22,$aa,$aa
|
||||
.byte $aa,$66,$22,$aa,$aa
|
||||
@ -101,7 +101,7 @@ astro_walk_left6:
|
||||
.byte $aa,$8a,$8a,$aa,$aa
|
||||
.byte $aa,$bb,$88,$8a,$aa
|
||||
.byte $aa,$aa,$2b,$88,$aa
|
||||
.byte $aa,$aa,$bb,$aa,$aa
|
||||
.byte $aa,$a2,$bb,$aa,$aa
|
||||
.byte $aa,$ba,$2b,$aa,$aa
|
||||
.byte $aa,$6a,$22,$aa,$aa
|
||||
.byte $fa,$66,$a2,$2a,$aa
|
||||
@ -112,7 +112,7 @@ astro_walk_left7:
|
||||
.byte $aa,$8a,$8a,$aa,$aa
|
||||
.byte $aa,$bb,$88,$8a,$aa
|
||||
.byte $aa,$aa,$2b,$88,$aa
|
||||
.byte $aa,$aa,$bb,$aa,$aa
|
||||
.byte $aa,$a2,$bb,$aa,$aa
|
||||
.byte $aa,$aa,$2b,$aa,$aa
|
||||
.byte $aa,$6a,$22,$aa,$aa
|
||||
.byte $aa,$66,$a2,$2a,$aa
|
||||
@ -123,7 +123,7 @@ astro_walk_left8:
|
||||
.byte $aa,$8a,$8a,$aa,$aa
|
||||
.byte $aa,$bb,$88,$8a,$aa
|
||||
.byte $aa,$aa,$2b,$88,$aa
|
||||
.byte $aa,$aa,$bb,$aa,$aa
|
||||
.byte $aa,$a2,$bb,$aa,$aa
|
||||
.byte $aa,$ba,$2b,$aa,$aa
|
||||
.byte $aa,$6a,$22,$aa,$aa
|
||||
.byte $aa,$66,$a2,$22,$aa
|
||||
@ -134,7 +134,7 @@ astro_walk_left9:
|
||||
.byte $aa,$8a,$8a,$aa,$aa
|
||||
.byte $aa,$bb,$88,$8a,$aa
|
||||
.byte $aa,$aa,$2b,$88,$aa
|
||||
.byte $aa,$aa,$bb,$aa,$aa
|
||||
.byte $aa,$a2,$bb,$aa,$aa
|
||||
.byte $aa,$aa,$bb,$aa,$aa
|
||||
.byte $aa,$aa,$22,$aa,$aa
|
||||
.byte $aa,$aa,$62,$a2,$fa
|
||||
@ -145,7 +145,7 @@ astro_walk_left10:
|
||||
.byte $aa,$8a,$8a,$aa,$aa
|
||||
.byte $aa,$bb,$88,$8a,$aa
|
||||
.byte $aa,$aa,$2b,$88,$aa
|
||||
.byte $aa,$aa,$bb,$aa,$aa
|
||||
.byte $aa,$a2,$bb,$aa,$aa
|
||||
.byte $aa,$ba,$bb,$aa,$aa
|
||||
.byte $aa,$aa,$22,$aa,$aa
|
||||
.byte $aa,$aa,$22,$aa,$aa
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.3 KiB |
@ -5,14 +5,14 @@ jail_rle: .byte $28 ; ysize=48
|
||||
.byte $50, $A0,$01,$A0, $A0,$16,$55, $00, $A0,$01,$AA, $55, $A0,$01,$AA
|
||||
.byte $55, $76, $55, $00, $A0,$01,$AA, $55, $A0,$01,$AA
|
||||
.byte $55, $76, $55, $00, $A0,$01,$AA, $55, $A0,$01,$AA
|
||||
.byte $55, $76, $A5,$55, $95, $99, $AD,$55, $00
|
||||
.byte $55, $76, $A9,$55, $95, $99, $A9,$55, $00
|
||||
.byte $A0,$01,$AA, $55, $A0,$01,$AA, $55, $77, $55, $00
|
||||
.byte $A0,$01,$AA, $55, $A0,$01,$AA, $55, $77, $55, $00
|
||||
.byte $A0,$01,$AA, $55, $A0,$01,$AA, $55, $77, $A6,$55, $99
|
||||
.byte $95, $AC,$55, $00, $A0,$01,$AA, $55, $A0,$01,$AA, $55
|
||||
.byte $A0,$01,$AA, $55, $A0,$01,$AA, $55, $77, $AA,$55, $99
|
||||
.byte $95, $A8,$55, $00, $A0,$01,$AA, $55, $A0,$01,$AA, $55
|
||||
.byte $77, $55, $00, $A0,$01,$AA, $55, $A0,$01,$AA, $55
|
||||
.byte $77, $55, $00, $A0,$01,$AA, $55, $A0,$01,$AA, $55
|
||||
.byte $77, $A6,$55, $59, $AD,$55, $00, $A0,$01,$AA, $55
|
||||
.byte $77, $AA,$55, $59, $A9,$55, $00, $A0,$01,$AA, $55
|
||||
.byte $A0,$01,$AA, $55, $77, $55, $00, $A0,$01,$AA, $55
|
||||
.byte $A0,$01,$AA, $55, $77, $55, $00, $A0,$01,$AA, $55
|
||||
.byte $A0,$01,$AA, $55, $77, $A0,$14,$55, $00, $A0,$01,$AA, $55
|
||||
@ -26,10 +26,11 @@ jail_rle: .byte $28 ; ysize=48
|
||||
.byte $44,$44, $94, $A6,$44, $AB,$55, $45, $A0,$10,$44, $49
|
||||
.byte $94, $99, $44,$44, $99,$99, $A5,$44, $AA,$05, $04
|
||||
.byte $A0,$11,$44, $49, $44, $49, $44,$44, $49, $A6,$44
|
||||
.byte $AB,$77, $70, $04, $A0,$1B,$44, $AD,$77, $70, $04
|
||||
.byte $A0,$19,$44, $AF,$77, $70, $04, $A0,$17,$44, $A0,$11,$77, $70
|
||||
.byte $04, $A0,$15,$44, $A0,$13,$77, $70, $04, $A0,$13,$44, $A0,$15,$77
|
||||
.byte $70, $A0,$12,$04, $A0,$C8,$77
|
||||
.byte $71,$71, $A9,$77, $70, $04, $A0,$1B,$44, $AD,$77, $70
|
||||
.byte $04, $A0,$19,$44, $AF,$77, $70, $04, $A0,$17,$44, $A0,$11,$77
|
||||
.byte $70, $04, $A0,$15,$44, $A0,$13,$77, $70, $04, $A0,$13,$44
|
||||
.byte $A0,$15,$77, $70, $A0,$12,$04, $A0,$78,$77, $17,$17, $A0,$26,$77, $A3,$11
|
||||
.byte $17, $A0,$24,$77
|
||||
.byte $A1
|
||||
hallway_rle: .byte $28 ; ysize=48
|
||||
.byte $A3,$55, $A0,$11,$AA, $AD,$55, $A7,$AA, $55,$55, $A0,$01,$A5, $A0,$11,$AA
|
||||
|
34
demosplash/offsets_table2.s
Normal file
34
demosplash/offsets_table2.s
Normal file
@ -0,0 +1,34 @@
|
||||
y_lookup2_h:
|
||||
.byte >($95E4),>($9613),>($9642),>($9671),>($96A0),>($96CF),>($96FE),>($972D)
|
||||
.byte >($975C),>($978B),>($97BA),>($97E9),>($9818),>($9847),>($9876),>($98A5)
|
||||
.byte >($98D4),>($9903),>($9932),>($9961),>($9990),>($99BF),>($99EE),>($9A1D)
|
||||
.byte >($9A4C),>($9A7B),>($9AAA),>($9AD9),>($9B08),>($9B37),>($9B66),>($9B95)
|
||||
.byte >($9BC4),>($9BF3),>($9C22),>($9C51),>($9C80),>($9CAF),>($9CDE),>($9D0D)
|
||||
.byte >($9D3C),>($9D6B),>($9D9A),>($9DC9),>($9DF8),>($9E27),>($9E56),>($9E85)
|
||||
.byte >($9EB4),>($9EE3),>($9F12),>($9F41),>($9F70),>($9F9F),>($9FCE),>($9FFD)
|
||||
.byte >($A02C),>($A05B),>($A08A),>($A0B9),>($A0E8),>($A117),>($A146),>($A175)
|
||||
.byte >($A1A4),>($A1D3),>($A202),>($A231),>($A260),>($A28F),>($A2BE),>($A2ED)
|
||||
.byte >($A31C),>($A34B),>($A37A),>($A3A9),>($A3D8),>($A407),>($A436),>($A465)
|
||||
.byte >($A494),>($A4C3),>($A4F2),>($A521),>($A550),>($A57F),>($A5AE),>($A5DD)
|
||||
.byte >($A60C),>($A63B),>($A66A),>($A699),>($A6C8),>($A6F7),>($A726),>($A755)
|
||||
.byte >($A784),>($A7B3),>($A7E2),>($A811),>($A840),>($A86F),>($A89E),>($A8CD)
|
||||
.byte >($A8FC),>($A92B),>($A95A),>($A989),>($A9B8),>($A9E7),>($AA16),>($AA45)
|
||||
.byte >($AA74),>($AAA3),>($AAD2),>($AB01),>($AB30),>($AB5F),>($AB8E),>($ABBD)
|
||||
.byte >($ABEC),>($AC1B),>($AC4A),>($AC79),>($ACA8),>($ACD7),>($AD06),>($AD35)
|
||||
y_lookup2_l:
|
||||
.byte <($95E4),<($9613),<($9642),<($9671),<($96A0),<($96CF),<($96FE),<($972D)
|
||||
.byte <($975C),<($978B),<($97BA),<($97E9),<($9818),<($9847),<($9876),<($98A5)
|
||||
.byte <($98D4),<($9903),<($9932),<($9961),<($9990),<($99BF),<($99EE),<($9A1D)
|
||||
.byte <($9A4C),<($9A7B),<($9AAA),<($9AD9),<($9B08),<($9B37),<($9B66),<($9B95)
|
||||
.byte <($9BC4),<($9BF3),<($9C22),<($9C51),<($9C80),<($9CAF),<($9CDE),<($9D0D)
|
||||
.byte <($9D3C),<($9D6B),<($9D9A),<($9DC9),<($9DF8),<($9E27),<($9E56),<($9E85)
|
||||
.byte <($9EB4),<($9EE3),<($9F12),<($9F41),<($9F70),<($9F9F),<($9FCE),<($9FFD)
|
||||
.byte <($A02C),<($A05B),<($A08A),<($A0B9),<($A0E8),<($A117),<($A146),<($A175)
|
||||
.byte <($A1A4),<($A1D3),<($A202),<($A231),<($A260),<($A28F),<($A2BE),<($A2ED)
|
||||
.byte <($A31C),<($A34B),<($A37A),<($A3A9),<($A3D8),<($A407),<($A436),<($A465)
|
||||
.byte <($A494),<($A4C3),<($A4F2),<($A521),<($A550),<($A57F),<($A5AE),<($A5DD)
|
||||
.byte <($A60C),<($A63B),<($A66A),<($A699),<($A6C8),<($A6F7),<($A726),<($A755)
|
||||
.byte <($A784),<($A7B3),<($A7E2),<($A811),<($A840),<($A86F),<($A89E),<($A8CD)
|
||||
.byte <($A8FC),<($A92B),<($A95A),<($A989),<($A9B8),<($A9E7),<($AA16),<($AA45)
|
||||
.byte <($AA74),<($AAA3),<($AAD2),<($AB01),<($AB30),<($AB5F),<($AB8E),<($ABBD)
|
||||
.byte <($ABEC),<($AC1B),<($AC4A),<($AC79),<($ACA8),<($ACD7),<($AD06),<($AD35)
|
@ -57,17 +57,9 @@ wait_loop:
|
||||
rts
|
||||
|
||||
.include "starbase_action.s"
|
||||
;.include "text_print.s"
|
||||
;.include "gr_pageflip.s"
|
||||
;.include "gr_unrle.s"
|
||||
;.include "gr_fast_clear.s"
|
||||
;.include "gr_copy.s"
|
||||
.include "gr_hlin.s"
|
||||
.include "gr_twoscreen_scroll.s"
|
||||
.include "gr_putsprite.s"
|
||||
;.include "gr_putsprite_flipped.s"
|
||||
.include "gr_putsprite_crop.s"
|
||||
;.include "gr_offsets.s"
|
||||
.include "keyboard.s"
|
||||
|
||||
.include "starbase_astronaut.s"
|
||||
|
@ -10,7 +10,6 @@ starbase_init:
|
||||
lda #0
|
||||
sta WHICH_ROOM
|
||||
sta BG_SCROLL
|
||||
sta DIRECTION ; left
|
||||
sta LASER_OUT
|
||||
sta BLAST_OUT
|
||||
sta CHARGER_COUNT
|
||||
@ -21,18 +20,16 @@ starbase_init:
|
||||
sta ACTION_TRIGGERED
|
||||
sta ACTION_COUNT
|
||||
|
||||
lda #1
|
||||
sta DIRECTION ; right
|
||||
|
||||
lda #100
|
||||
sta GUN_CHARGE
|
||||
|
||||
;====================
|
||||
; reset doors
|
||||
lda #DOOR_STATUS_CLOSED
|
||||
sta c4_r0_door0_status
|
||||
sta c4_r0_door1_status
|
||||
lda #DOOR_STATUS_LOCKED
|
||||
sta c4_r0_door2_status
|
||||
sta c4_r0_door3_status
|
||||
sta c4_r0_door4_status
|
||||
sta c4_r0_door0_status
|
||||
|
||||
;===============
|
||||
; set up aliens
|
||||
@ -61,21 +58,12 @@ starbase_init:
|
||||
|
||||
lda #0
|
||||
sta ASTRONAUT_X
|
||||
lda #20 ; start offscreen
|
||||
lda #10
|
||||
sta ASTRONAUT_Y
|
||||
|
||||
; lda #28
|
||||
; sta fall_down_destination_smc+1
|
||||
|
||||
; lda #28
|
||||
; sta fall_sideways_destination_smc+1
|
||||
|
||||
lda #P_STANDING ; fall into level
|
||||
lda #P_STANDING
|
||||
sta ASTRONAUT_STATE
|
||||
|
||||
; lda #$2c
|
||||
; sta falling_stop_smc
|
||||
|
||||
rts
|
||||
|
||||
|
||||
@ -115,12 +103,12 @@ starbase_setup_room:
|
||||
bne room1
|
||||
|
||||
;======================
|
||||
; Room0 with recharger
|
||||
; Room0 with ramp
|
||||
room0:
|
||||
|
||||
; set up doors
|
||||
|
||||
lda #5
|
||||
lda #2
|
||||
sta NUM_DOORS
|
||||
|
||||
lda #<door_c4_r0
|
||||
@ -131,26 +119,22 @@ room0:
|
||||
|
||||
; set up room limits
|
||||
|
||||
lda #(6+128)
|
||||
lda #(-3+128) ; stop at wall
|
||||
sta LEFT_LIMIT
|
||||
lda #(39+128)
|
||||
sta RIGHT_LIMIT
|
||||
|
||||
; set right exit
|
||||
lda #1
|
||||
sta cer_smc+1
|
||||
|
||||
; set left exit
|
||||
lda #0
|
||||
sta cel_smc+1
|
||||
|
||||
lda ASTRONAUT_STATE
|
||||
cmp #P_FALLING_DOWN
|
||||
beq room0_falling
|
||||
; set right exit
|
||||
lda #1
|
||||
sta cer_smc+1
|
||||
|
||||
lda #28
|
||||
lda #10
|
||||
sta ASTRONAUT_Y
|
||||
room0_falling:
|
||||
|
||||
|
||||
; load background
|
||||
lda #>(jail_rle)
|
||||
@ -344,47 +328,10 @@ ootw_room_already_set:
|
||||
|
||||
;============================
|
||||
;============================
|
||||
; City Loop
|
||||
; starbase Loop
|
||||
;============================
|
||||
;============================
|
||||
city_loop:
|
||||
|
||||
;======================================
|
||||
; draw split screen if falling into pit
|
||||
;======================================
|
||||
|
||||
; only fall in room3
|
||||
lda WHICH_ROOM
|
||||
cmp #3
|
||||
bne no_scroll
|
||||
|
||||
lda BG_SCROLL
|
||||
beq no_scroll
|
||||
|
||||
lda FRAMEL ; slow down a bit
|
||||
and #$1
|
||||
bne no_scroll_progress
|
||||
|
||||
inc BG_SCROLL
|
||||
inc BG_SCROLL
|
||||
no_scroll_progress:
|
||||
|
||||
ldy BG_SCROLL
|
||||
cpy #48
|
||||
bne scroll_it
|
||||
|
||||
; exit to next room when done scrolling
|
||||
|
||||
lda #0
|
||||
sta BG_SCROLL
|
||||
lda #4
|
||||
sta WHICH_ROOM
|
||||
rts
|
||||
|
||||
scroll_it:
|
||||
jsr gr_twoscreen_scroll
|
||||
no_scroll:
|
||||
|
||||
starbase_loop:
|
||||
|
||||
;================================
|
||||
;================================
|
||||
@ -394,101 +341,6 @@ no_scroll:
|
||||
|
||||
jsr gr_copy_to_current
|
||||
|
||||
|
||||
;=========================
|
||||
;=========================
|
||||
; Handle Falling into Pit
|
||||
;=========================
|
||||
;=========================
|
||||
|
||||
lda WHICH_ROOM
|
||||
cmp #3
|
||||
beq check_falling
|
||||
cmp #4
|
||||
beq check_falling
|
||||
|
||||
jmp not_falling
|
||||
|
||||
check_falling:
|
||||
; only fall if falling sideways/down
|
||||
lda ASTRONAUT_STATE
|
||||
cmp #P_FALLING_SIDEWAYS
|
||||
beq falling_sideways
|
||||
cmp #P_FALLING_DOWN
|
||||
beq falling_down
|
||||
|
||||
jmp not_falling
|
||||
|
||||
falling_sideways:
|
||||
; if falling sideways
|
||||
|
||||
lda BG_SCROLL
|
||||
cmp #16
|
||||
bcc before ; blt
|
||||
|
||||
lda FRAMEL
|
||||
and #$3
|
||||
bne no_fall_undo
|
||||
|
||||
dec ASTRONAUT_X
|
||||
dec ASTRONAUT_Y
|
||||
dec ASTRONAUT_Y
|
||||
dec ASTRONAUT_Y
|
||||
dec ASTRONAUT_Y
|
||||
no_fall_undo:
|
||||
jmp scroll_check
|
||||
before:
|
||||
|
||||
lda FRAMEL
|
||||
and #$1
|
||||
bne extra_boost
|
||||
|
||||
inc ASTRONAUT_X
|
||||
extra_boost:
|
||||
jmp scroll_check
|
||||
|
||||
|
||||
falling_down:
|
||||
; if falling down, and Y>=32, then impale
|
||||
lda ASTRONAUT_Y
|
||||
cmp #32
|
||||
bcc scroll_check ; blt
|
||||
|
||||
lda #9
|
||||
sta ASTRONAUT_X
|
||||
|
||||
lda #38
|
||||
sta ASTRONAUT_Y
|
||||
|
||||
lda #0
|
||||
sta GAIT
|
||||
|
||||
lda #P_IMPALED
|
||||
sta ASTRONAUT_STATE
|
||||
|
||||
jmp not_falling
|
||||
|
||||
scroll_check:
|
||||
lda BG_SCROLL ; if done scrolling, re-enable falling
|
||||
bne scroll_bg_check22
|
||||
|
||||
lda #$2c ; re-enable falling
|
||||
sta falling_stop_smc
|
||||
jmp not_far_enough
|
||||
|
||||
scroll_bg_check22:
|
||||
|
||||
lda ASTRONAUT_Y ; once Y=22, stop falling (scroll instead)
|
||||
cmp #22
|
||||
bcc not_far_enough ; blt
|
||||
|
||||
lda #$4c ; disable yinc in falling
|
||||
sta falling_stop_smc
|
||||
|
||||
not_far_enough:
|
||||
|
||||
not_falling:
|
||||
|
||||
;==================================
|
||||
; draw background action
|
||||
;==================================
|
||||
@ -507,9 +359,9 @@ bg_room0:
|
||||
tay
|
||||
|
||||
|
||||
lda #11
|
||||
lda #0
|
||||
sta XPOS
|
||||
lda #24
|
||||
lda #26
|
||||
sta YPOS
|
||||
|
||||
lda recharge_bg_progression,Y
|
||||
@ -525,21 +377,6 @@ bg_room0:
|
||||
lsr
|
||||
tay
|
||||
|
||||
lda #5
|
||||
sta XPOS
|
||||
lda #24
|
||||
sta YPOS
|
||||
|
||||
lda recharge_sprite_progression,Y
|
||||
sta INL
|
||||
lda recharge_sprite_progression+1,Y
|
||||
sta INH
|
||||
|
||||
|
||||
|
||||
jsr put_sprite
|
||||
|
||||
|
||||
|
||||
|
||||
c4_no_bg_action:
|
||||
@ -551,7 +388,7 @@ c4_no_bg_action:
|
||||
jsr handle_keypress
|
||||
|
||||
;===============================
|
||||
; move physicist
|
||||
; move astronaut
|
||||
;===============================
|
||||
|
||||
jsr move_astronaut
|
||||
@ -569,84 +406,41 @@ c4_no_bg_action:
|
||||
|
||||
done_room_limits:
|
||||
|
||||
;=============================
|
||||
;=============================
|
||||
; Detect if falling off ledge
|
||||
;=============================
|
||||
;=============================
|
||||
;===============
|
||||
; draw astronaut
|
||||
;===============
|
||||
|
||||
; only fall in room#3
|
||||
; only have slope in room0
|
||||
lda WHICH_ROOM
|
||||
cmp #3
|
||||
bne regular_room
|
||||
|
||||
; don't start fall if impaled or already falling
|
||||
lda ASTRONAUT_STATE
|
||||
cmp #P_IMPALED
|
||||
beq regular_room
|
||||
cmp #P_FALLING_DOWN
|
||||
beq regular_room
|
||||
cmp #P_FALLING_SIDEWAYS
|
||||
beq regular_room
|
||||
|
||||
|
||||
; only start falling if y>=18
|
||||
lda ASTRONAUT_Y
|
||||
cmp #18
|
||||
bcc regular_room ; blt
|
||||
|
||||
; only start falling if x>=7 and positive
|
||||
lda ASTRONAUT_X
|
||||
bmi regular_room
|
||||
cmp #7
|
||||
bcc regular_room ; blt
|
||||
|
||||
lda ASTRONAUT_STATE
|
||||
cmp #P_JUMPING
|
||||
beq fall_sideways
|
||||
|
||||
; if not jumping then fall down
|
||||
|
||||
lda #P_FALLING_DOWN
|
||||
sta ASTRONAUT_STATE
|
||||
|
||||
lda #2
|
||||
sta BG_SCROLL
|
||||
|
||||
jmp regular_room
|
||||
|
||||
fall_sideways:
|
||||
|
||||
lda #P_FALLING_SIDEWAYS
|
||||
sta ASTRONAUT_STATE
|
||||
|
||||
lda #2
|
||||
sta BG_SCROLL
|
||||
|
||||
regular_room:
|
||||
|
||||
;===============
|
||||
; draw physicist
|
||||
;===============
|
||||
|
||||
; if in charger, draw that
|
||||
lda WHICH_ROOM ; charger only room0
|
||||
bne just_draw_astronaut
|
||||
|
||||
; adjust y for slope
|
||||
|
||||
lda ASTRONAUT_X
|
||||
cmp #10
|
||||
bne just_draw_astronaut
|
||||
cmp #11
|
||||
bcc asstr_above ; blt
|
||||
|
||||
lda GUN_CHARGE
|
||||
cmp #200
|
||||
bcs just_draw_astronaut ; bge
|
||||
cmp #22
|
||||
bcs asstr_below ; bge
|
||||
|
||||
lda #P_STANDING
|
||||
sta ASTRONAUT_STATE
|
||||
sec
|
||||
sbc #11
|
||||
and #$fe ; our sprite code only draws even y
|
||||
adc #11
|
||||
|
||||
jsr draw_charger
|
||||
jmp asstr_adjust_y
|
||||
|
||||
jmp after_draw_astronaut
|
||||
asstr_below:
|
||||
lda #22
|
||||
jmp asstr_adjust_y
|
||||
|
||||
asstr_above:
|
||||
lda #10
|
||||
|
||||
asstr_adjust_y:
|
||||
sta ASTRONAUT_Y
|
||||
|
||||
jsr recalc_walk_collision
|
||||
|
||||
just_draw_astronaut:
|
||||
jsr draw_astronaut
|
||||
@ -687,18 +481,18 @@ no_draw_alien:
|
||||
;========================
|
||||
|
||||
lda WHICH_ROOM
|
||||
cmp #2
|
||||
beq c4_room2_cover
|
||||
beq c4_room0_cover
|
||||
|
||||
cmp #4
|
||||
beq c4_room4_cover
|
||||
|
||||
jmp c4_no_fg_cover
|
||||
c4_room2_cover:
|
||||
|
||||
c4_room0_cover:
|
||||
|
||||
lda #0
|
||||
sta XPOS
|
||||
lda #18
|
||||
lda #6
|
||||
sta YPOS
|
||||
|
||||
lda #<causeway_door_cover
|
||||
@ -831,72 +625,11 @@ still_in_city:
|
||||
lda #0
|
||||
sta GAME_OVER
|
||||
|
||||
jmp city_loop
|
||||
jmp starbase_loop
|
||||
|
||||
done_city:
|
||||
rts
|
||||
|
||||
|
||||
recharge_sprite_progression:
|
||||
.word recharge_sprite1
|
||||
.word recharge_sprite2
|
||||
.word recharge_sprite3
|
||||
.word recharge_sprite4
|
||||
|
||||
|
||||
recharge_sprite1:
|
||||
.byte 1,10
|
||||
.byte $eA
|
||||
.byte $ff
|
||||
.byte $ee
|
||||
.byte $ff
|
||||
.byte $e6
|
||||
.byte $ff
|
||||
.byte $6e
|
||||
.byte $ff
|
||||
.byte $fe
|
||||
.byte $a6
|
||||
|
||||
recharge_sprite2:
|
||||
.byte 1,10
|
||||
.byte $fA
|
||||
.byte $f6
|
||||
.byte $ef
|
||||
.byte $fe
|
||||
.byte $66
|
||||
.byte $fe
|
||||
.byte $6e
|
||||
.byte $f6
|
||||
.byte $6e
|
||||
.byte $af
|
||||
|
||||
recharge_sprite3:
|
||||
.byte 1,10
|
||||
.byte $eA
|
||||
.byte $f6
|
||||
.byte $ef
|
||||
.byte $ef
|
||||
.byte $6f
|
||||
.byte $f6
|
||||
.byte $e6
|
||||
.byte $f6
|
||||
.byte $6f
|
||||
.byte $ae
|
||||
|
||||
recharge_sprite4:
|
||||
.byte 1,10
|
||||
.byte $fA
|
||||
.byte $fe
|
||||
.byte $fe
|
||||
.byte $6e
|
||||
.byte $fe
|
||||
.byte $6e
|
||||
.byte $ee
|
||||
.byte $f6
|
||||
.byte $ef
|
||||
.byte $ae
|
||||
|
||||
|
||||
recharge_bg_progression:
|
||||
.word recharge_bg1
|
||||
.word recharge_bg2
|
||||
@ -959,15 +692,17 @@ recharge_bg4:
|
||||
|
||||
; 0x18
|
||||
causeway_door_cover:
|
||||
.byte 8,8
|
||||
.byte $00,$00,$00,$00,$00,$00,$22,$AA
|
||||
.byte $00,$00,$00,$00,$00,$00,$22,$AA
|
||||
.byte $00,$00,$00,$00,$00,$00,$22,$AA
|
||||
.byte $00,$00,$00,$00,$00,$00,$02,$2A
|
||||
.byte $00,$00,$00,$00,$00,$00,$00,$22
|
||||
.byte $00,$00,$00,$00,$00,$00,$00,$22
|
||||
.byte $00,$00,$00,$00,$00,$00,$00,$22
|
||||
.byte $00,$00,$00,$00,$00,$00,$00,$22
|
||||
.byte 6,10
|
||||
.byte $00,$00,$00,$00,$00,$00
|
||||
.byte $00,$00,$11,$00,$00,$00
|
||||
.byte $00,$00,$11,$11,$00,$00
|
||||
.byte $00,$00,$00,$11,$00,$00
|
||||
.byte $00,$00,$00,$00,$00,$00
|
||||
.byte $00,$00,$00,$00,$00,$00
|
||||
.byte $00,$00,$00,$00,$00,$00
|
||||
.byte $00,$00,$00,$00,$00,$00
|
||||
.byte $00,$00,$00,$00,$00,$00
|
||||
.byte $00,$00,$00,$00,$00,$00
|
||||
|
||||
; 30x8
|
||||
pit_door_cover:
|
||||
@ -1003,39 +738,26 @@ door_c4_r0:
|
||||
.word door_c4_r0_xmax
|
||||
|
||||
door_c4_r0_status:
|
||||
c4_r0_door0_status: .byte DOOR_STATUS_CLOSED
|
||||
c4_r0_door1_status: .byte DOOR_STATUS_CLOSED
|
||||
c4_r0_door2_status: .byte DOOR_STATUS_LOCKED
|
||||
c4_r0_door3_status: .byte DOOR_STATUS_LOCKED
|
||||
c4_r0_door4_status: .byte DOOR_STATUS_LOCKED
|
||||
c4_r0_door0_status: .byte DOOR_STATUS_LOCKED
|
||||
c4_r0_door1_status: .byte DOOR_STATUS_LOCKED
|
||||
|
||||
door_c4_r0_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
|
||||
c4_r0_door0_x: .byte 6
|
||||
c4_r0_door1_x: .byte 37
|
||||
|
||||
door_c4_r0_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
|
||||
c4_r0_door0_y: .byte 6
|
||||
c4_r0_door1_y: .byte 18
|
||||
|
||||
door_c4_r0_xmin:
|
||||
c4_r0_door0_xmin: .byte 0 ; 7-4-5
|
||||
c4_r0_door1_xmin: .byte 11 ; 18-4-5
|
||||
c4_r0_door2_xmin: .byte 20 ; 29-4-5
|
||||
c4_r0_door3_xmin: .byte 22 ; 31-4-5
|
||||
c4_r0_door4_xmin: .byte 24 ; 33-4-5
|
||||
c4_r0_door0_xmin: .byte 0 ; 37-4-5
|
||||
c4_r0_door1_xmin: .byte 28 ; 37-4-5
|
||||
|
||||
|
||||
door_c4_r0_xmax:
|
||||
c4_r0_door0_xmax: .byte 11 ; 7+4
|
||||
c4_r0_door1_xmax: .byte 21 ; 18+4
|
||||
c4_r0_door2_xmax: .byte 33 ; don't care
|
||||
c4_r0_door3_xmax: .byte 35 ; don't care
|
||||
c4_r0_door4_xmax: .byte 37 ; don't care
|
||||
c4_r0_door0_xmax: .byte 4 ; ??
|
||||
c4_r0_door1_xmax: .byte 39 ; ??
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -398,4 +398,3 @@ door_exploding_sprite6:
|
||||
.byte $FA,$AA,$AA
|
||||
.byte $AF,$A5,$AA
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user