Login
Back to forumReply to this topicGo to last reply

Posted By

rudis
on 2012-02-24
15:50:01
 interrupts

wonder that i can't type anytthing after starting a raster..

only with clock-irq and color changing i can type and load .. but with raster nothing




.setcpu "6502"
.org $1001-2
.word $1001

.word link
.word 2012 ; zeilennummer
.byte $9e ; sys-token
.byte "4109" ; adresse
.byte $00 ; zeilenende
link:
.byte $00,$00

sei

ldx #<myvbl
stx $312
ldx #>myvbl
stx $313

lda #<raster
sta $314
lda #>raster
sta $315
lda #$02
sta $ff0a
lda #$30 ; oben
sta $ff0b
cli

rts

freq:
.byte $00,$00
color:
.byte $00,$00
count:
.byte $00,$00

raster:
lda $ff09
sta $ff09
lda $ff0b
cmp #$50 ; unten
bcc rasterende
lda #$30 ; oben
sta $ff0b
inc $ff19
jmp rastersik
rasterende:
lda #$50 ; unten
sta $ff0b
dec $ff19
rastersik:
pla
tay
pla
tax
pla
rti

myvbl:
ldx freq
inx
stx freq
cpx #25
bne myvblexit
ldx #0
stx freq
clc
lda color
adc #$10
sta color
sta $ff19
ldx count
inx
stx count
cpx #7
bne myvblexit
clc
adc #$01
sta color
ldx #0
stx count
myvblexit:
jmp $ce42
rti
jsr $fff6


Posted By

gerliczer
on 2012-02-24
16:31:00
 Re: interrupts

Why do you expect the KERNAL keyboard reading routine to run, when your code abruptly returns from the interrupt handler without giving back control to the KERNAL? After the label 'rastersik' I think you should jump to either $CE42 or to the original value of $0314/$0315.

Posted By

Csabo
on 2012-02-24
16:30:44
 Re: interrupts

The raster is what takes care of the keyboard polling. You replaced with your own routine, so you effectively removed that. I think putting "JSR $DB11" into your own raster will solve it.

Posted By

rudis
on 2012-02-28
13:47:03
 Re: interrupts

i see..
asm is little bit to complex for me at this time. i better try some practise in basic

edit 28.02.:
jmp doesn't work for me. break all the time.

edit 2:
jsr $db11 do the work :)

Posted By

gerliczer
on 2012-02-28
16:12:48
 Re: interrupts

Well, I don't really know what you were doing, but I tried to check your code. I put the JMP $CE0E/$CE42 rigth after the 'rastersik' label. I don't know where you tried to put the jump but it must go there. This way it works and does not break at all. When jumping to $CE0E, the keyboard reading not happens because the interrupt occurs too early (check the KERNAL code please, it is a good idea anyway to study it at least a little bit) but your custom interrupt works OK. When jumping to $CE42, the keyboard reading occurs but your custom interrupt goes horribly wrong. This happens because the KERNAL interrupt handler overrides your raster interrupt setting ($FF0A/$FF0B). Calling the keyboard polling at $DB11 of course will work anytime.

Posted By

rudis
on 2012-04-16
12:21:12
 Re: interrupts

Heureka happy

managed to write a raster





.setcpu "6502"
.org $1001-2
.word $1001

.word link
.word 2012 ; zeilennummer
.byte $9e ; sys-token
.byte "4109" ; adresse
.byte $00 ; zeilenende
link:
.byte $00,$00

sei
lda # sta $314
lda #>raster
sta $315
lda #$02
sta $ff0a
lda #0 ; oben
sta $ff0b
lda #11
sta 65286
cli
rts

raster:
lda $ff09
sta $ff09
lda $ff0b
cmp #0 ; unten
bcc rasterende

ldx #98
loop:
lda colors,x
spalte:
ldy $ff1e
cpy #176
bmi spalte
sta $ff19
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
dex
bpl loop
jmp rastersik
rasterende:
lda #0 ; unten
sta $ff0b
rastersik:
;jmp $fcbe
pla
tay
pla
tax
pla
rti

colors:
.byte 0
.byte 6,6,6,6,6,6
.byte 22,22,22,22,22,22
.byte 38,38,38,38,38,38
.byte 54,54,54,54,54,54
.byte 70,70,70,70,70,70
.byte 86,86,86,86,86,86
.byte 102,102,102,102,102,102
.byte 118,118,118,118,118,118
.byte 118,118,118,118,118,118
.byte 102,102,102,102,102,102
.byte 86,86,86,86,86,86
.byte 70,70,70,70,70,70
.byte 54,54,54,54,54,54
.byte 38,38,38,38,38,38
.byte 22,22,22,22,22,22
.byte 6,6,6,6,6,6
.byte 0,0,0


Posted By

Csabo
on 2012-04-16
15:10:26
 Re: interrupts

Good for you! I can't remember if I mentioned this, but Plus4IDE comes with some examples, one of which has a rasterbar and soft-scroll implemented. The samples have detailed comments and explanations.

Posted By

Luca
on 2012-04-16
15:45:39
 Re: interrupts



Posted By

rudis
on 2012-04-17
05:39:32
 Re: interrupts

http://youtu.be/ly9bLhp40Fc

made it moving..

Posted By

rudis
on 2012-04-18
07:52:09
 Re: interrupts

How to do Timer-interrupts?



Back to topReply to this topic


Copyright © Plus/4 World Team, 2001-2024