Jump to content



0

Good practices before enabling interrupts?


3 replies to this topic

#1 Propane13 ONLINE  

Propane13

    Stargunner

  • 1,385 posts
  • Location:Philly

Posted Wed Sep 12, 2007 7:55 AM

Hi everyone,

So, I was thinking about it this morning... should there be a few standard things that occur before turning on interrupts?

Let me make an example.
Let's say that you enable interrupts right away (CLI). Then, you start doing some game calculations before starting anything having to do with DMA. If you do this, and DMA activates, is it perceivable that the DMA will look to an unitnitialized DPPH/DPPL, and use some random default value, thereby pointing to some random location for graphics (as there is no real DLL), that could then spider off forever (i.e. what happens if one of the random DLL's has the interrupt bit set, so it goes to the IRQ vector before it's supposed to be used)?

I was wondering first, if this is a plausible scenario (i.e. you could randomly experience big problems based on where DMA cycling is on powerup). If so, maybe there should be some "safe procedures".

1) SEI
2) Set up DLL in RAM
3) Set up DL's in RAM
4) Initialize any RAM used by Interrupts
5) CLI
-- THEN do calculations.

I'm curious about opinions. I may be way off base with the theory here. :)

-John

#2 Propane13 ONLINE  

Propane13

    Stargunner

  • 1,385 posts
  • Location:Philly

Posted Wed Sep 12, 2007 8:41 AM

And... I answered my own question.
I forgot that you can disable DMA on the CTRL register.
So, that's what you need to do initially before DLL's are set up.

It's been about 4 years since I looked at any 7800 code, so please forgive my inquisitiveness.
It'll all come back, I'm sure. :)

-John

#3 doppel OFFLINE  

doppel

    Star Raider

  • 65 posts

Posted Sun Nov 29, 2009 11:52 PM

Display list interrupts use NMI, not IRQ. :-)

#4 Bruce Tomlin OFFLINE  

Bruce Tomlin

    River Patroller

  • 3,531 posts
  • CD C9 01
  • Location:Austin, TX

Posted Wed Dec 2, 2009 11:25 PM

They also only happen when you have a DLL around to trigger them.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users