mirror of
https://github.com/deater/dos33fsprogs.git
synced 2025-02-28 22:30:09 +00:00
xmas2018: remove extraneous code
This commit is contained in:
parent
dfb76a0528
commit
dc38871fcc
@ -72,12 +72,12 @@ sbloopB:dex ; 2
|
||||
dey ; 2
|
||||
bne sbloopA ; 2nt/3
|
||||
|
||||
jmp sb_begin_loop
|
||||
jmp wreath_begin_loop
|
||||
.align $100
|
||||
|
||||
|
||||
;================================================
|
||||
; Spacebars Loop
|
||||
; Wreath Loop
|
||||
;================================================
|
||||
; each scan line 65 cycles
|
||||
; 1 cycle each byte (40cycles) + 25 for horizontal
|
||||
@ -85,66 +85,9 @@ sbloopB:dex ; 2
|
||||
; Vertical blank = 4550 cycles (70 scan lines)
|
||||
; Total of 17030 cycles to get back to where was
|
||||
|
||||
sb_begin_loop:
|
||||
wreath_begin_loop:
|
||||
|
||||
sb_display_loop:
|
||||
|
||||
|
||||
; 1 2 3
|
||||
;0123456789012345678901234567890123456789
|
||||
;LEVEL: 6 LIVES: 2 SCORE: 01978 HI: 02018
|
||||
|
||||
; 0-7 = text mode
|
||||
; 8-87 = hgr
|
||||
; 88 - 168 = split
|
||||
; 169 - 191 = gr
|
||||
|
||||
|
||||
; 8 lines of text mode
|
||||
|
||||
|
||||
ldy #8 ; 2
|
||||
|
||||
sb_text_loop:
|
||||
bit SET_TEXT ; 4
|
||||
lda #29 ; 2
|
||||
jsr delay_a ; 25+29
|
||||
|
||||
dey ; 2
|
||||
bne sb_text_loop ; 3
|
||||
;================
|
||||
; 65
|
||||
|
||||
|
||||
; -1
|
||||
|
||||
|
||||
sb_hgr_loop:
|
||||
; delay 80*65 = 5200
|
||||
; 2180
|
||||
; -2
|
||||
; +1
|
||||
; -8
|
||||
;=========================
|
||||
; 3011
|
||||
; -1038 play_music
|
||||
;================================
|
||||
; 1973
|
||||
|
||||
bit SET_GR ; 4
|
||||
bit HIRES ; 4
|
||||
|
||||
|
||||
|
||||
; draw sprite at same time
|
||||
; lda #>ship_forward ; 2
|
||||
; sta INH ; 3
|
||||
; lda #<ship_forward ; 2
|
||||
; sta INL ; 3
|
||||
; jsr put_sprite ; 6
|
||||
; + 2164
|
||||
;===========
|
||||
; 2180
|
||||
wreath_display_loop:
|
||||
|
||||
|
||||
; jsr play_music ; 6+1032
|
||||
@ -154,47 +97,14 @@ sb_hgr_loop:
|
||||
; Try X=59 Y=10 cycles=3011
|
||||
|
||||
ldy #2 ; 2
|
||||
sbloopC:ldx #196 ; 2
|
||||
sbloopD:dex ; 2
|
||||
bne sbloopD ; 2nt/3
|
||||
wrloopC:ldx #196 ; 2
|
||||
wrloopD:dex ; 2
|
||||
bne wrloopD ; 2nt/3
|
||||
dey ; 2
|
||||
bne sbloopC ; 2nt/3
|
||||
bne wrloopC ; 2nt/3
|
||||
|
||||
|
||||
|
||||
|
||||
sb_mixed:
|
||||
lda $0 ;kill 6 cycles (room for rts) ; 2
|
||||
ldx #9 ; 2
|
||||
ldy #9 ; 14 ; 126 ; 2
|
||||
|
||||
sb_mixed_loop:
|
||||
; lda ss_multiples,x ; 4
|
||||
sta split_smc+1 ; 4
|
||||
split_smc:
|
||||
; jsr split_4 ; 6+46
|
||||
dey ; 2
|
||||
bne sb_mixed_loop ; 3
|
||||
|
||||
; -1
|
||||
nop ; 2
|
||||
ldy #9 ; 2
|
||||
dex ; 2
|
||||
bne split_smc ; 3
|
||||
|
||||
; -1
|
||||
|
||||
; need to kill
|
||||
; -6 from offset
|
||||
; +1 fall through
|
||||
; -9 from check
|
||||
; +1 from other fallthrough
|
||||
;================
|
||||
; -13
|
||||
|
||||
|
||||
|
||||
sb_all_gr:
|
||||
wr_all_gr:
|
||||
; 23 lines of this
|
||||
|
||||
; 23 * 65 = 1495
|
||||
@ -208,11 +118,11 @@ sb_all_gr:
|
||||
; Try X=41 Y=7 cycles=1478
|
||||
|
||||
ldy #7 ; 2
|
||||
sbloopE:ldx #41 ; 2
|
||||
sbloopF:dex ; 2
|
||||
bne sbloopF ; 2nt/3
|
||||
wrloopE:ldx #41 ; 2
|
||||
wrloopF:dex ; 2
|
||||
bne wrloopF ; 2nt/3
|
||||
dey ; 2
|
||||
bne sbloopE ; 2nt/3
|
||||
bne wrloopE ; 2nt/3
|
||||
|
||||
|
||||
|
||||
@ -221,41 +131,13 @@ sbloopF:dex ; 2
|
||||
;======================================================
|
||||
|
||||
; do_nothing should be 4550
|
||||
; -3470 draw_framebuffer
|
||||
; -533 setup framebuffer
|
||||
; -21 frame count
|
||||
; -16 auto-move
|
||||
; -7 timeout
|
||||
; -34 keypress
|
||||
; -1 adjust center mark back
|
||||
; ===========
|
||||
; 468
|
||||
|
||||
|
||||
|
||||
;====================
|
||||
; Auto-move ship
|
||||
;====================
|
||||
; look it up in lookup table?
|
||||
|
||||
lda FRAMEH ; 3
|
||||
lsr ; 2
|
||||
and #$1f ; 2
|
||||
tax ; 2
|
||||
lda sb_x_lookup,X ; 4
|
||||
sta XPOS ; 3
|
||||
;=======
|
||||
; 16
|
||||
|
||||
;=====================
|
||||
; timeout
|
||||
;=====================
|
||||
; 7 cycles
|
||||
lda FRAMEH ; 3
|
||||
cmp #100 ; 2
|
||||
beq sb_exit ; 3
|
||||
; -1
|
||||
|
||||
; Try X=11 Y=8 cycles=489 R2
|
||||
; Try X=31 Y=3 cycles=484
|
||||
; Try X=22 Y=4 cycles=465 R3
|
||||
@ -263,32 +145,26 @@ sbloopF:dex ; 2
|
||||
lda $0
|
||||
|
||||
ldy #4 ; 2
|
||||
sbloop1:ldx #22 ; 2
|
||||
sbloop2:dex ; 2
|
||||
bne sbloop2 ; 2nt/3
|
||||
wrloop1:ldx #22 ; 2
|
||||
wrloop2:dex ; 2
|
||||
bne wrloop2 ; 2nt/3
|
||||
dey ; 2
|
||||
bne sbloop1 ; 2nt/3
|
||||
bne wrloop1 ; 2nt/3
|
||||
|
||||
jsr setup_framebuffer ; 6+527
|
||||
|
||||
jsr draw_framebuffer ; 6+3464
|
||||
|
||||
; Increment frame count
|
||||
; noflo: 16 + 2 + (3) = 21
|
||||
; oflo: 16 + 5 = 21
|
||||
inc FRAME ; 5
|
||||
lda FRAME ; 3
|
||||
and #3 ; 15 Hz ; 2
|
||||
sta FRAME ; 3
|
||||
beq sb_frame_oflo ; 3
|
||||
beq wr_frame_oflo ; 3
|
||||
;============
|
||||
; 16
|
||||
; -1
|
||||
lda $0 ; nop ; 3
|
||||
jmp sb_frame_noflo ; 3
|
||||
sb_frame_oflo:
|
||||
jmp wr_frame_noflo ; 3
|
||||
wr_frame_oflo:
|
||||
inc FRAMEH ; 5
|
||||
sb_frame_noflo:
|
||||
wr_frame_noflo:
|
||||
|
||||
|
||||
; no keypress = 10+(24) = 34
|
||||
@ -296,10 +172,10 @@ sb_frame_noflo:
|
||||
; right pressed = 9+8+5+12 = 34
|
||||
|
||||
lda KEYPRESS ; 4
|
||||
bpl sb_no_keypress ; 3
|
||||
bpl wr_no_keypress ; 3
|
||||
; -1
|
||||
jmp sb_handle_keypress ; 3
|
||||
sb_no_keypress:
|
||||
jmp wr_handle_keypress ; 3
|
||||
wr_no_keypress:
|
||||
inc $0 ; 5
|
||||
dec $0 ; 5
|
||||
inc $0 ; 5
|
||||
@ -307,249 +183,16 @@ sb_no_keypress:
|
||||
nop ; 2
|
||||
nop ; 2
|
||||
|
||||
jmp sb_display_loop ; 3
|
||||
jmp wreath_display_loop ; 3
|
||||
|
||||
sb_handle_keypress:
|
||||
wr_handle_keypress:
|
||||
bit KEYRESET ; clear keypress ; 4
|
||||
cmp #'Q'|$80 ; 2
|
||||
beq sb_exit ; 3
|
||||
beq wr_exit ; 3
|
||||
; -1
|
||||
|
||||
sb_check_left:
|
||||
cmp #$08|$80 ; left ; 2
|
||||
bne sb_check_right ; 3
|
||||
; -1
|
||||
dec XPOS ; 5
|
||||
|
||||
nop ; nop ; 2
|
||||
lda $0 ; nop ; 3
|
||||
jmp sb_display_loop ; 3
|
||||
|
||||
sb_check_right:
|
||||
cmp #$15|$80 ; 2
|
||||
bne sb_exit ; 3
|
||||
; -1
|
||||
inc XPOS ; 5
|
||||
|
||||
jmp sb_display_loop ; 3
|
||||
|
||||
sb_exit:
|
||||
cli ; re-enable interrupt music
|
||||
jmp blue_line
|
||||
|
||||
sb_real_exit:
|
||||
wr_exit:
|
||||
wr_real_exit:
|
||||
bit KEYRESET
|
||||
rts ; 6
|
||||
|
||||
|
||||
.align $100
|
||||
|
||||
; total =
|
||||
; 4 wide: = 53
|
||||
; 12 wide: = 253
|
||||
; 20 wide: = 421
|
||||
; 28 wide: = 813
|
||||
; 36 wide: = 757
|
||||
; 40 wide: = 1161
|
||||
; 6
|
||||
;====================================
|
||||
; 3464
|
||||
draw_framebuffer:
|
||||
|
||||
|
||||
; 2 + (4*(X*8)+5) -1 =
|
||||
; 2 + 4*(8+5) -1 = 85
|
||||
|
||||
ldx #4 ; 2
|
||||
fb4_loop:
|
||||
lda FRAMEBUFFER+0 ; 3
|
||||
sta $5a8+18-1,x ; 5
|
||||
dex ; 2
|
||||
bne fb4_loop ; 3
|
||||
|
||||
|
||||
; 2 + (12*(X*8)+5) -1 =
|
||||
; 2 + 12*(16+5) -1 = 253
|
||||
|
||||
ldx #12 ; 2
|
||||
fb12_loop:
|
||||
lda FRAMEBUFFER+1 ; 3
|
||||
sta $628+14-1,x ; 5
|
||||
lda FRAMEBUFFER+2 ; 3
|
||||
sta $6a8+14-1,x ; 5
|
||||
dex ; 2
|
||||
bne fb12_loop ; 3
|
||||
|
||||
; 2 + (20*(X*8)+5) -1 =
|
||||
; 2 + 20*(16+5) -1 = 421
|
||||
|
||||
ldx #20 ; 2
|
||||
fb20_loop:
|
||||
lda FRAMEBUFFER+3 ; 3
|
||||
sta $728+10-1,x ; 5
|
||||
lda FRAMEBUFFER+4 ; 3
|
||||
sta $7a8+10-1,x ; 5
|
||||
dex ; 2
|
||||
bne fb20_loop ; 3
|
||||
|
||||
|
||||
; 2 + (28*(X*8)+5) -1 =
|
||||
; 2 + 28*(24+5) -1 = 813
|
||||
|
||||
ldx #28 ; 2
|
||||
fb28_loop:
|
||||
lda FRAMEBUFFER+5 ; 3
|
||||
sta $450+6-1,x ; 5
|
||||
lda FRAMEBUFFER+6 ; 3
|
||||
sta $4d0+6-1,x ; 5
|
||||
lda FRAMEBUFFER+7 ; 3
|
||||
sta $550+6-1,x ; 5
|
||||
dex ; 2
|
||||
bne fb28_loop ; 3
|
||||
|
||||
|
||||
; 2 + (36*(X*8)+5) -1 =
|
||||
; 2 + 36*(16+5) -1 = 757
|
||||
|
||||
ldx #36 ; 2
|
||||
fb36_loop:
|
||||
lda FRAMEBUFFER+8 ; 3
|
||||
sta $5d0+2-1,x ; 5
|
||||
lda FRAMEBUFFER+9 ; 3
|
||||
sta $650+2-1,x ; 5
|
||||
dex ; 2
|
||||
bne fb36_loop ; 3
|
||||
|
||||
; 2 + (40*(X*8)+5) -1 =
|
||||
; 2 + 40*(24+5) + -1 = 1161
|
||||
|
||||
ldx #40 ; 2
|
||||
fb40_loop:
|
||||
lda FRAMEBUFFER+10 ; 3
|
||||
sta $6d0-1,x ; 5
|
||||
lda FRAMEBUFFER+11 ; 3
|
||||
sta $750-1,x ; 5
|
||||
lda FRAMEBUFFER+12 ; 3
|
||||
sta $7d0-1,x ; 5
|
||||
dex ; 2
|
||||
bne fb40_loop ; 3
|
||||
|
||||
; -1
|
||||
rts ; 6
|
||||
|
||||
|
||||
|
||||
;.align $100
|
||||
;.include "screen_split.s"
|
||||
;background_hgr:
|
||||
;.incbin "SB_BACKGROUNDC.BIN.lz4",11
|
||||
;background_hgr_end:
|
||||
|
||||
score_text:
|
||||
.byte 0,0
|
||||
.asciiz "LEVEL:6 LIVES:2 SCORE:001978 HI:002018"
|
||||
|
||||
|
||||
|
||||
; Note on the distance calculations
|
||||
; we use something simplistic here
|
||||
; see http://www.extentofthejam.com/pseudo/
|
||||
|
||||
; "Texture": 64?
|
||||
; 0 GREY 5,7,f,7,5,0,0,0
|
||||
; 1 0,0,0,0,0,0,0,0
|
||||
; 2 BLUE 2,6,f,6,2,0,0,0
|
||||
; 3 0,0,0,0,0,0,0,0
|
||||
; 4 GREEN 4,c,f,c,4,0,0,0
|
||||
; 5 0,0,0,0,0,0,0,0
|
||||
; 6 RED 1,b,f,b,1,0,0,0
|
||||
; 7 0,0,0,0,0,0,0,0
|
||||
.align $100
|
||||
;.align 64
|
||||
raster_texture:
|
||||
.byte $5,$7,$f,$7,$5,$0,$0,$0 ; grey
|
||||
.byte $0,$0,$0,$0,$0,$0,$0,$0
|
||||
.byte $2,$6,$f,$6,$2,$0,$0,$0 ; blue
|
||||
.byte $0,$0,$0,$0,$0,$0,$0,$0
|
||||
.byte $4,$c,$f,$c,$4,$0,$0,$0 ; green
|
||||
.byte $0,$0,$0,$0,$0,$0,$0,$0
|
||||
.byte $1,$b,$f,$b,$1,$0,$0,$0 ; red
|
||||
.byte $0,$0,$0,$0,$0,$0,$0,$0,$0
|
||||
|
||||
offset_lookup:
|
||||
|
||||
; Linear
|
||||
; .byte 26,24,22,20,18,16,14,12,10, 8, 6, 4, 2,0
|
||||
|
||||
.byte 29,24,20,16,13,10,8,6,4,3,2,1,0,0
|
||||
|
||||
sb_x_lookup:
|
||||
.byte 15,14,13,12,11,10, 9, 8, 8, 9,10,11,12,13,14,15
|
||||
.byte 15,16,17,18,19,20,21,22, 22,21,20,19,18,17,16,15
|
||||
|
||||
;.align $100
|
||||
|
||||
; 2 + 40*13 + 5 = 527
|
||||
setup_framebuffer:
|
||||
ldx #0 ; 2
|
||||
setup_fb_loop:
|
||||
lda offset_lookup,X ; 4
|
||||
clc ; 2
|
||||
adc FRAMEH ; 3
|
||||
and #$3f ; 2
|
||||
tay ; 2
|
||||
lda raster_texture,y ; 4
|
||||
asl ; 2
|
||||
asl ; 2
|
||||
asl ; 2
|
||||
asl ; 2
|
||||
;============
|
||||
; 25
|
||||
|
||||
ora raster_texture+1,y ; 4
|
||||
|
||||
sta FRAMEBUFFER,x ; zp ; 4
|
||||
inx ; 2
|
||||
cpx #13 ; 2
|
||||
bne setup_fb_loop ; 3
|
||||
;===========
|
||||
; 15
|
||||
|
||||
; -1
|
||||
rts ; 6
|
||||
|
||||
|
||||
|
||||
|
||||
blue_line:
|
||||
bit PAGE0 ; set page 0
|
||||
bit LORES ; Lo-res graphics
|
||||
bit FULLGR
|
||||
bit SET_GR ; set graphics
|
||||
|
||||
lda #0
|
||||
sta DRAW_PAGE
|
||||
jsr clear_all
|
||||
; jsr clear_screens_notext ; clear top/bottom of page 0/1
|
||||
|
||||
blueline_loop:
|
||||
|
||||
;================
|
||||
; draw the ship
|
||||
;================
|
||||
draw_ship_big:
|
||||
jsr clear_all
|
||||
|
||||
; lda #>ship_forward
|
||||
; sta INH
|
||||
; lda #<ship_forward
|
||||
; sta INL
|
||||
|
||||
; lda #15
|
||||
; sta XPOS
|
||||
; lda #34
|
||||
; sta YPOS
|
||||
; jsr put_sprite
|
||||
|
||||
|
||||
rts
|
||||
|
Loading…
x
Reference in New Issue
Block a user