Hi, I am trying to get my code to run in the Symon simulator but it doesn't want to cooperate. I am trying to figure out what I am doing wrong to get it to display to the video output in Symon. I was previously using an online simulator but now I am trying to use something more robust like Symon. I was previously using this assembler
http://biged.github.io/6502js/This is my current code that I am trying to get to run in Symon.
Code:
.CR 6502 ; Assemble 6502
.LI on,toff ; Listing on, no timings included
.TF winner.prg, BIN ; Object filename and format
paddleIndexL = $00
paddleIndexH = $01
paddleOriginL = $03
paddleOriginH = $04
loopCnt = $02
jsr init
jsr loop
init:
lda #$00
sta paddleIndexL
lda #$02
sta paddleIndexH
lda #$00
sta paddleOriginL
lda #$02
sta paddleOriginH
lda #$00
sta loopCnt
rts
loop:
lda paddleOriginL ;reset paddle draw indexs
sta paddleIndexL
lda paddleOriginH
sta paddleIndexH
jsr drawPaddle
jsr readKeys
jmp loop
drawPaddle:
ldy #2
lda #3 ;set color of player 1
sta ($00),y ;write that bit to display
ldy #29
lda #4 ;set color of player 2
sta ($00),y
lda paddleIndexL
adc #$20 ;incr to next pixel of paddle
sta paddleIndexL
lda #$00
adc paddleIndexH
sta paddleIndexH
ldx loopCnt ;makes the paddle be 5 pixels long
inx
stx loopCnt
cpx #5
bne drawPaddle
lda #$00 ;reset counter for next time
sta loopCnt
rts
readKeys:
lda $ff
cmp #$77
beq upKey
cmp #$73
beq downKey
rts
upKey:
clc
lda paddleOriginL ;checks if the paddle is near the edge
adc paddleOriginH
cmp #$02
clc
beq onEdge
;decrement paddle draw index
clc
lda paddleIndexL
sbc #$1f
sta paddleIndexL
lda paddleIndexH
sbc #$00
sta paddleIndexH
clc
;clear previous pixel
ldy #$02
lda #$00
sta ($00),y
ldy #29
lda #$00
sta ($00),y
;decrement paddle origin
lda paddleOriginL
sbc #$1f
sta paddleOriginL
lda paddleOriginH
sbc #$00
sta paddleOriginH
clc
lda #$00
sta $ff
lda $ff
rts
downKey:
clc
lda $03 ;checks is paddle is at the edge of the screen
adc $04
cmp #$65
clc
beq onEdge
clc
;clear previous pixel when its moved
ldy #$02
lda #$00
sta ($03),y
ldy #29
lda #$00
sta ($03),y
;change the paddle location
lda #$20
adc paddleOriginL
sta paddleOriginL
lda #$00
adc paddleOriginH
sta paddleOriginH
;clear the keyboard buffer
lda #$00
sta $ff
lda $ff
rts
onEdge: ;ends the program when the paddle goes off the edge of the screen
rts ;the edge of the screen
gameover:
brk
Any help or suggestions would be greatly appreciated.
Thanks!