Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > How to properly setup $fffe interrupt ?
2006-02-23 21:00
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....
 
2006-02-24 15:35
TDJ

Registered: Dec 2001
Posts: 1879
Quote: I read info on those memory locations, and its all there. Just cant see what was wrong in the first place. Must be kind of mistake that sits there infront of your eyes and you are just blind to see it...

I knew this when I was younger :(
Am out of shape... But am just going into it again! :)


Heh, I remember when I started playing football again after 9 years .. "I used to be much better at this but I guess it will come back".

Guess what? Never happened .. ;)

(on the other hand, when I returned to coding in 2000, I actually found out after a while that I had improved - ofcourse being a professional developer has something to do with that)

(and yes, this means that I was an even worse coder before than I am right now)

(I should really stop talking like this)
2006-02-24 18:58
V-12

Registered: Nov 2003
Posts: 206
you don't need to set $fffa/b :)
2006-02-24 23:03
PopMilo

Registered: Mar 2004
Posts: 146
@Murdock
Its just one of those "just to be sure ..." situations :)

Its all done now, interrupts work the rest of game is the problem... But Ill never get better if I dont try hard first. :)

@The Dark Judge:
Well I think I am more experienced coder now then before, but in wrong things :) (book keeping apps and stuff like that ... AND ALL I WANTED TO DO WHEN I WAS YOUNG WAS CODE GRAPHIC EFFECTS AND GAMES !!! :)

Life...
2006-02-25 00:02
Stryyker

Registered: Dec 2001
Posts: 468
Quote: you don't need to set $fffa/b :)

As long as no one presses restore (and you haven't triggered the CIA 2 timer then not read $DD0D).
2006-02-25 15:16
PopMilo

Registered: Mar 2004
Posts: 146
Restore was the reason why I used it...
2006-02-25 18:21
Oswald

Registered: Apr 2002
Posts: 5094
learn one lesson

its called _K_E_R_N_*A*_L

not kernel
2006-02-25 19:10
PopMilo

Registered: Mar 2004
Posts: 146
"According to early Commodore 'myth' and reported by writer/programmer Jim Butterfield among others, the word KERNAL is an acronym (or maybe more likely, a backronym) standing for Keyboard Entry Read, Network, And Link, which in fact makes good sense considering its role. There's also, however, a theory that the word originated as a misspelling of the word "kernel"[1] by some unknown Commodore employee. Misspelling or not, Berkeley Softworks later used it when naming the core routines of its GUI OS for 8-bit home computers: the GEOS KERNAL..."

Ok. Lesson learned. :)
2006-02-25 19:14
yago

Registered: May 2002
Posts: 333
Here is Scouts IRQ-Setup with symbolic names, and acknowledge of unwanted CIA-Irqs.
The acknowledging is really necessary, otherwise Murphys Law will hit you when you show it!

How doke() works and the values for the symbolic names should be clear when looking at the previous Code.

#include <kernel/c64.inc>
#include <macros/util.mac>

.org $0810 

sei

doke(irq_vec,irq)
doke(brk_vec,brk)

lda#%01111111
sta cia1.icr
sta cia2.icr
lda cia1.icr
lda cia2.icr

lda#0
sta vic.raster

lda#$1b
sta vic.cr1

lda#1
sta vic.irq
sta vic.irqmask

lda#pla.RAMIO
sta pla.dr

cli
jmp *

.scope irq {
  pha txa pha pya pha

;actual routines come here
  inc vic.border

  asl vic.irq
  pla tay pla tax pla
  rti
}

.scope brkirq {
  rti
}


Possible Enhancements: Debug-Code for brk_irq (should never be called!) and checking if VIC-Irq is really responsible for the Irq.
Its also nice to setup the NMI, either as "will even not trigger when Restore is hit" or as another useful Timer.
2006-02-26 14:33
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.
2006-02-26 15:12
Graham
Account closed

Registered: Dec 2002
Posts: 990
Actually I have never seen people calling the KERNAL a kernel until these days :)
Previous - 1 | 2 | 3 | 4 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Twilight/Excess/Arcade
Devil/Clique
Alakran_64
t0m3000/hf^boom!^ibx
wil/VCC^CTG
CA$H/TRiAD
psenough
The Syndrom/TIA/Pret..
DuncanTwain
csabanw
Bansai/BSILabs
MagerValp/G★P
Sulevi/Virtual Dreams
Guests online: 92
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 The Demo Coder  (9.6)
6 Edge of Disgrace  (9.6)
7 What Is The Matrix 2  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.7)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 X-Mas Demo 2024  (9.5)
7 Dawnfall V1.1  (9.5)
8 Rainbow Connection  (9.5)
9 Onscreen 5k  (9.5)
10 Morph  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top Fullscreen Graphicians
1 Joe  (9.7)
2 Sulevi  (9.6)
3 The Sarge  (9.6)
4 Veto  (9.6)
5 Facet  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.051 sec.