Jump to content
IGNORED

Good practices before enabling interrupts?


Propane13

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...