Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- norom
- macro org(bank, offset)
- org $10+((<offset>-$8000)%$2000)+($2000*<bank>)
- base <offset>
- endmacro
- !dropped_count_pos = $22
- counter_60hz = $11
- previous_60hz = $1F
- dropped_frames = $0500
- real_frames_elapsed = $0501
- timer_frames = $0502
- timer_seconds = $0503
- timer_minutes = $0504
- sb_score = $7F4A
- ; $0300-$036B
- gfx_buffer_index = $0300
- gfx_buffer = $0301
- ; increase 60Hz counter every frame from NMI
- %org(31, $F57E)
- JSR nmi_hijack
- %org(31, $E911)
- nmi_hijack:
- INC counter_60hz
- JMP $FC6F
- ; dont get cards hmm
- ; %org(31, $FD44)
- ; PHA
- ; %org(30, $8DD8)
- ; JSR $96E5
- %org(30, $9701)
- JSR every_frame
- %org(30, $9FB6)
- every_frame:
- STA $1C
- CLI
- LDA counter_60hz
- SEC
- SBC previous_60hz
- TAY
- LDA $65
- ORA $66
- BEQ .not_level
- LDX $0376
- BNE .paused
- TYA
- CLC
- ADC real_frames_elapsed
- STA real_frames_elapsed
- .paused:
- TYA
- SEC
- SBC #$01
- CLC
- ADC dropped_frames
- STA dropped_frames
- .not_level:
- LDA counter_60hz
- STA previous_60hz
- RTS
- warnpc $A000
- %org(26, $B073)
- coins:
- LDY #$00
- LDA $7967
- CMP #100
- BCC +
- SBC #100
- STA $7967
- JMP $B094
- +
- JMP $B09F
- ; %org(30, $897D)
- ; STA $7CF2
- ; JSR level_transition
- ; status bar template
- org $35438
- db $2B, $28
- db $0C, $EF, $EF, $EF, $EF, $EF, $EF, $AE, $AF, $FE, $EC, $F0, $F0
- db $2B, $45
- db $0F, $FE, $F0, $FE, $F0, $F0, $F0, $F0, $F0, $F0, $FE, $FE, $ED, $F0, $F0, $F0
- db $00
- %org(26, $B175)
- score:
- LDA $65
- ORA $66
- BNE .level
- LDA #$ED
- STA sb_score
- RTS
- .level:
- LDA $07BD
- BEQ .tick_timer
- LDA #$ED
- STA sb_score
- JMP .display_stuff
- .tick_timer:
- LDA timer_frames
- CLC
- ADC real_frames_elapsed
- STA timer_frames
- CMP #60
- BCC .done
- SBC #60
- STA timer_frames
- LDA timer_seconds
- ADC #$00
- STA timer_seconds
- CMP #60
- BCC .done
- SBC #60
- STA timer_seconds
- LDA timer_minutes
- ADC #$00
- CMP #10
- BCC .no_cap
- LDA #59
- STA timer_frames
- LDA #59
- STA timer_seconds
- LDA #09
- .no_cap:
- STA timer_minutes
- .done:
- LDX #$ED
- LDA timer_frames
- CMP #30
- BCC +
- LDX #$FE
- +
- STX sb_score
- .display_stuff:
- LDA #$00
- STA real_frames_elapsed
- LDA timer_minutes
- ORA #$F0
- STA sb_score+1
- LDA timer_seconds
- LDY #$02
- JSR draw_dec_to_score
- LDY #$04
- LDA timer_frames
- JSR draw_dec_to_score
- JMP draw_dropped_frames
- draw_dec_to_score:
- LDX #$F0
- -
- CMP #10
- BCC +
- SBC #10
- INX
- BCS -
- +
- ORA #$F0
- STA sb_score+1,y
- TXA
- STA sb_score,y
- RTS
- warnpc $B24A
- ; empty
- %org(26, $B520)
- ; draw dropped frames in hex
- draw_dropped_frames:
- LDY gfx_buffer_index
- LDA dropped_frames
- PHA
- LSR
- LSR
- LSR
- LSR
- CMP #$0A ; adjust tile # for A-F digits
- BCC +
- SBC #$6A
- +
- CLC
- ADC #$F0
- STA gfx_buffer+3,y
- PLA
- AND #$0F
- CMP #$0A
- BCC +
- SBC #$6A
- +
- CLC
- ADC #$F0
- STA gfx_buffer+4,y
- ; block terminator
- LDA #$00
- STA gfx_buffer+5,y
- ; copypasta
- LDX #$27
- LDA $03EF ; vertical level
- BNE ++
- LDX #$2B
- LDA $070A ; level tileset
- CMP #16
- BEQ +
- CMP #17
- BNE ++
- +
- LDX #$23
- ++
- TXA
- ; vram hi
- STA gfx_buffer,y
- ; vram lo
- LDA #!dropped_count_pos
- STA gfx_buffer+1,y
- ; block size
- LDA #$02
- STA gfx_buffer+2,y
- ; update index
- LDA gfx_buffer_index
- CLC
- ADC #$05
- STA gfx_buffer_index
- RTS
- ; level_transition:
- ; STA $7CF2
- ; STA dropped_frames
- ; RTS
- warnpc $C000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement