Newb in VDC mmode, needs help blanking screen, then un-blank
Jun 14, 2020 20:30:59 GMT
stiggity likes this
Post by stiggity on Jun 14, 2020 20:30:59 GMT
Hello:
I was directed to this site from a Facebook user, and have been reading a lot. I'm a beginner writing assembly and get confused quick. The question I have is... Like the c64 your can poke here & there (don't remember the values), and the screen will blank, then by poking a couple other values, you can restore the state the screen was, before it was blanked. I found some save/load source, converted it to my assembler. I got it to compile, but once called the Emulator locks up. How in the world, could I accomplish this, via the c128 in 80 columns?? Please don't Ban me, but I'm going to attempt at posting the code. A personal, Thank You, for any help.
*=$1300
JMP vdc_save
jmp vdc_load ;3
vdc_prepare = *
lda #$12
sta vdcstatus
lda hibyte
sta vdc_rw
lda #$13
sta vdcstatus
lda lobyte
sta vdc_rw
lda #$1f
sta vdcstatus
rts
vdc_write = *
notyet bit vdcstatus
bpl notyet
sta vdc_rw ;// writting to VDC
rts
vdc_read = *
notyet1 bit vdcstatus
bpl notyet1
lda vdc_rw ;// reading from VDC
rts
vdc_save = *
ldx #$00
ldy #$10
stx x_w
sty y_w
ldx #$00
ldy #$00
citaj stx x_r
sty y_r
stx lobyte
sty hibyte
jsr vdc_prepare
jsr vdc_read
sta temp
ldx x_w
stx lobyte
ldy y_w
sty hibyte
jsr vdc_prepare
lda temp
jsr vdc_write
inx
stx x_r
stx x_w
ldy y_r
cpx #$00
bne citaj
ldy y_w
iny
sty y_w
tya
and #$0f
tay
sty y_r
cpy #$00
beq done
jmp citaj
done rts
vdc_load = *
ldx #$00
ldy #$00
stx x_w
sty y_w
ldx #$00
ldy #$10
citaj1 stx x_r
sty y_r
stx lobyte
sty hibyte
jsr vdc_prepare
jsr vdc_read
sta temp
ldx x_w
stx lobyte
ldy y_w
sty hibyte
jsr vdc_prepare
lda temp
jsr vdc_write
inx
stx x_r
stx x_w
ldy y_r
cpx #$00
bne citaj1
ldy y_r
iny
sty y_r
tya
and #$0f
tay
sty y_w
cpy #$00
beq done1
ldy y_r
jmp citaj1
done1 rts
vdcstatus .byte 0
hibyte .BYTE 0
LOBYTE .BYTE 0
y_w .byte 0
y_r .byte 0
x_r .byte 0
x_w .byte 0
temp .byte 0
vdc_rw .word 0
;-------------------------------------
Hoping i'm just making a syntax or misunderstanding proper technique.
I was directed to this site from a Facebook user, and have been reading a lot. I'm a beginner writing assembly and get confused quick. The question I have is... Like the c64 your can poke here & there (don't remember the values), and the screen will blank, then by poking a couple other values, you can restore the state the screen was, before it was blanked. I found some save/load source, converted it to my assembler. I got it to compile, but once called the Emulator locks up. How in the world, could I accomplish this, via the c128 in 80 columns?? Please don't Ban me, but I'm going to attempt at posting the code. A personal, Thank You, for any help.
insert code here
*=$1300
JMP vdc_save
jmp vdc_load ;3
vdc_prepare = *
lda #$12
sta vdcstatus
lda hibyte
sta vdc_rw
lda #$13
sta vdcstatus
lda lobyte
sta vdc_rw
lda #$1f
sta vdcstatus
rts
vdc_write = *
notyet bit vdcstatus
bpl notyet
sta vdc_rw ;// writting to VDC
rts
vdc_read = *
notyet1 bit vdcstatus
bpl notyet1
lda vdc_rw ;// reading from VDC
rts
vdc_save = *
ldx #$00
ldy #$10
stx x_w
sty y_w
ldx #$00
ldy #$00
citaj stx x_r
sty y_r
stx lobyte
sty hibyte
jsr vdc_prepare
jsr vdc_read
sta temp
ldx x_w
stx lobyte
ldy y_w
sty hibyte
jsr vdc_prepare
lda temp
jsr vdc_write
inx
stx x_r
stx x_w
ldy y_r
cpx #$00
bne citaj
ldy y_w
iny
sty y_w
tya
and #$0f
tay
sty y_r
cpy #$00
beq done
jmp citaj
done rts
vdc_load = *
ldx #$00
ldy #$00
stx x_w
sty y_w
ldx #$00
ldy #$10
citaj1 stx x_r
sty y_r
stx lobyte
sty hibyte
jsr vdc_prepare
jsr vdc_read
sta temp
ldx x_w
stx lobyte
ldy y_w
sty hibyte
jsr vdc_prepare
lda temp
jsr vdc_write
inx
stx x_r
stx x_w
ldy y_r
cpx #$00
bne citaj1
ldy y_r
iny
sty y_r
tya
and #$0f
tay
sty y_w
cpy #$00
beq done1
ldy y_r
jmp citaj1
done1 rts
vdcstatus .byte 0
hibyte .BYTE 0
LOBYTE .BYTE 0
y_w .byte 0
y_r .byte 0
x_r .byte 0
x_w .byte 0
temp .byte 0
vdc_rw .word 0
;-------------------------------------
Hoping i'm just making a syntax or misunderstanding proper technique.