| |
PopMilo
Registered: Mar 2004 Posts: 146 |
How to properly setup $fffe interrupt ?
Good day to you all, I have a bit of a problem so... :
I found some old code of mine on an old tape and transfered it to PC and want to compile it using tass and try it on CCS64 or VICE. Im sure code worked 15 years ago, but now... :)
So why this happens...
"sei
...
lda #<irqsr
ldx #>irqsr
sta $fffe
stx $ffff
...
cli"
I watched this code in VICEs debbuger and imidiatelly when sta $fffe is done there is NO change in $fffe ?
same with $ffff
So when cli goes, my prg just goes to $ff48 and my interupt routine is never executed...?
So I would be very gratefull if someone can write just some small piece of code that makes my routine go off in regular timed intervals (5-20 times a second...).
I read some other posts but cant get it to work...
thanks... |
|
... 22 posts hidden. Click here to view all posts.... |
| |
Krill
Registered: Apr 2002 Posts: 2980 |
Quote: learn one lesson
its called _K_E_R_N_*A*_L
not kernel
The KERNAL is the C64's KERNEL.
A KERNEL is not necessarily the C64's KERNAL.
So using both is correct for C64 people. |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
Actually I have never seen people calling the KERNAL a kernel until these days :) |
| |
Radiant
Registered: Sep 2004 Posts: 639 |
Well, by any CS definition, it is an operating system kernel. So I don't see why it would be wrong to call it as such. It's a kernel, named KERNAL. :-) |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
kernAl is the OS itself.
kernel is a system core.
there's some difference ehm ?
check any programming guide, and C= docs, its called kernal, period. |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
sei
lda #$7f
sta $dc0d ;turn off timer irq
lda #$01
sta $d01a ;request raster irq from vic
lda #raster
sta $d012 ;raster position low
lda #rasterhi&$1b
sta $d011 ;raster position hi&char mode
lda #<irq
sta $fffe ;irq routine addy low byte
lda #>irq
sta $ffff ;irq routine addy high byte
lda $dc0d ;ack any pending timer irq
lda $dd0d ;at cia #2 too
lda #$35
sta $01 ;turn off kern_A_l
cli
jmp *
irq pha
txa
pha
tya
pha
lsr $d019
;do stuff
pla
tay
pla
tax
pla
rti
done. |
| |
PopMilo
Registered: Mar 2004 Posts: 146 |
OK guys, you have been extremely helpfull, and my prog is now fully functional except it doesnt work just the way it should :)
Interrupts are working great, graphics is ok, I just have some logical mistakes in my code that need to be fixed...
Thanks! |
| |
Krill
Registered: Apr 2002 Posts: 2980 |
Quote: kernAl is the OS itself.
kernel is a system core.
there's some difference ehm ?
check any programming guide, and C= docs, its called kernal, period.
IMHO, a modern KERNEL does everything what the C64's KERNAL does, and more. And calling the KERNAL the C64's system core (KERNEL) is appropriate since there's also the BASIC interpreter and user front-end running on top of it. |
| |
Monte Carlos
Registered: Jun 2004 Posts: 359 |
This initialisation all lack an lsr $d019 just before the cli.
If you acknowledge any timer irq you have to do it for raster irq, too. You don't know in which rasterline your irq-init routine is executed. In the worst, but most unlikely case you get an irq request just before setting up the new irq.
After the cli the first raster-irq immediately starts in any rasterline which is not good, when using some vic trickery.
Monte
|
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
monte, good point |
| |
PopMilo
Registered: Mar 2004 Posts: 146 |
Quote: I think that HEMA should first-release this game
Why HEMA ? What is HEMA ? :(
Is it demo group ?
is it a joke :) No offence intended... :)
p.s. Monte thanks... |
Previous - 1 | 2 | 3 | 4 - Next |