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-23 21:46
PopMilo

Registered: Mar 2004
Posts: 146
Tryed that out... still something is wrong. Must be something in the rest of code...
I dont need kernel. Just VIC in bank 0, turn off basic and kernel, dont even need charset, got my own.

Code is 18Kb so I need time to look it up.

If you could supply just that: How to set up timed interrupt every now and then :), what to put in $01, $dc0d, $dd0d, $dc00 ? ...

p.s. This game is something you have never seen on C64 :) I got to fix it...
2006-02-23 22:40
Radiant

Registered: Sep 2004
Posts: 639
When using $fffe interrupts, you also have to preserve the registers yourself. So, do pha txa pha tya pha at the beginning of your interrupt routine, and you should be set.
2006-02-23 22:49
Scout

Registered: Dec 2002
Posts: 1570
Here you go:

*=$0810

sei
lda #<irq
ldy #>irq
sta $fffe
sty $ffff

lda #<brkirq
ldy #>brkirq
sta $fffa
sty $fffb

lda #$7f
sta $dc0d
sta $dd0d

lda #$00
sta $d012

lda #$1b
sta $d011

lda #$01
sta $d019
sta $d01a
lda #$35
sta $1
cli

jmp *
irq:

pha
txa
pha
tya
pha

inc $d020

asl $d019

pla
tay
pla
tax
pla
brkirq:
rti

2006-02-23 23:18
PopMilo

Registered: Mar 2004
Posts: 146
YES!!! After three evenings starring in code finally got it!!!

Am little puzzled, what was wrong at first place but who cares it works!

Your code did it (and the fact that I realised what the main loop was acctually doing ... it was written 14 years ago)

Thank you guys...
p.s. will upload code for all of you to admire when the graphics is done (Its a game but I salvaged only code, and the graphics file is gone so have to do some drawing (4 sprites and 5 chars :)and then youll see what was all about)
2006-02-24 08:21
Scout

Registered: Dec 2002
Posts: 1570
Quote: YES!!! After three evenings starring in code finally got it!!!

Am little puzzled, what was wrong at first place but who cares it works!

Your code did it (and the fact that I realised what the main loop was acctually doing ... it was written 14 years ago)

Thank you guys...
p.s. will upload code for all of you to admire when the graphics is done (Its a game but I salvaged only code, and the graphics file is gone so have to do some drawing (4 sprites and 5 chars :)and then youll see what was all about)


Yay!

But that's what we're here for, right?

---
-= Silicon Ltd. =-
http://forum.siliconlimited.com

Commodore 64 Scenemusic Podcast
http://8bitmayhem.blogspot.com/
2006-02-24 09:47
TDJ

Registered: Dec 2001
Posts: 1879
I think that HEMA should first-release this game
2006-02-24 11:49
Graham
Account closed

Registered: Dec 2002
Posts: 990
The code lacks an LDA $DC0D and LDA $DD0D to clear the timer irq flags. You might encounter occassional crashes due to that.
2006-02-24 12:06
PopMilo

Registered: Mar 2004
Posts: 146
I did used

bit $dcod
bit $ddod

in previous attempts. No noticable difference though...
2006-02-24 12:59
Krill

Registered: Apr 2002
Posts: 2980
Just wait 1 frame in the sei block and see how your IRQ gets triggered immediately after the cli. Clearing the timer flags IS needed.
2006-02-24 15:06
PopMilo

Registered: Mar 2004
Posts: 146
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! :)
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
iAN CooG/HVSC
Mike
slimeysmine
Mibri/ATL^MSL^PRX
pcollins/Quantum
leonofsgr/Singular C..
A3/AFL
Alakran_64
Acidchild/Padua
iceout/Avatar/HF
Andy/AEG
MCM/ONSLAUGHT
sln.pixelrat
Guests online: 184
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 Webmasters
1 Slaygon  (9.6)
2 Perff  (9.6)
3 Sabbi  (9.5)
4 Morpheus  (9.4)
5 CreaMD  (9.1)

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