Skip to content

Instantly share code, notes, and snippets.

@beholdnec
Created May 18, 2019 21:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beholdnec/50194596e34d6db0b913b727e113d8e5 to your computer and use it in GitHub Desktop.
Save beholdnec/50194596e34d6db0b913b727e113d8e5 to your computer and use it in GitHub Desktop.
wla-dx COMPUTE_PENDING_CALCULATIONS error
[objects]
test.o
.memorymap
slotsize $10000
defaultslot 0
slot 0 $10000
.endme
.rombanksize $10000
.rombanks 1
.bank 0
.org $fffc
.dw Reset ; Emulation mode boot vector
.org $0000
r0: .db 0
r1: .db 0
a0: .db 0
a1: .db 0
t0: .db 0
t1: .db 0
t2: .db 0
t3: .db 0
ballX: .dw 100
ballY: .dw 100
velX: .db 1
velY: .db 1
.org $9800
Reset:
sei
cld
ldx #$ff
txs
lda #100
sta ballX
sta ballY
lda #1
sta velX
sta velY
loop:
lda #$00
jsr PlotBall
lda #$ff
jsr PlotBall
jmp loop
PlotBall: ; Draw A at ballX, ballY
pha
lda ballY
sta a0
lda ballY+1 ; HERE IS THE PROBLEMATIC LINE
sta a1
jsr Mul80
lda r1
clc
adc #$02
sta r1
ldy ballX
pla
sta (r0),y
rts
Mul80: ; Multiply a1:a0 by 80 and put result in r1:r0
; t1:t0 = x << 4, t3:t2 = x << 6
lda a1
asl
asl
asl
asl
sta t1
asl
asl
sta t3
lda a0
lsr
lsr
tax
ora t3
sta t3
txa
lsr
lsr
ora t1
sta t1
lda a0
asl
asl
asl
asl
sta t0
asl
asl
sta t2
; r1:r0 = t1:t0 + t3:t2
lda t0
clc
adc t2
sta r0
lda t1
adc t3
sta r1
rts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment