Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: GBA Interrupt tutorial request  (Read 1074 times)

0 Members and 1 Guest are viewing this topic.
GBA Interrupt tutorial request
« on: September 01, 2007, 11:53:51 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 266
Would anyone know of a good tutorial on using interrupts for the GBA? I had my butt handed to me in class and it's over now and I'm still lost; something with examples would be fantastic.

EDIT: Whoops... I should of noted in case it wasn't clear, I'm looking for the tutorial to be in C\C++


What I'm looking for is to use an interrupt to wait for a button input; Best I could do in the class's short amount of time was creat an interrupt that delayed all actions and progression for 2 seconds. I could probably get some hacked job working, but I need something to better explain the concepts and practice so I can better use the code.

Here is my 2 second time delay code so you know what I'm vaguely aiming for:

Code: [Select]
void Delay(int iTime) {

int iMilliSecs, iSecs;

iMilliSecs = iTime % 1000;

iSecs = (iTime - iMilliSecs) / 1000;

REG_TM0CNT = TIMER_FREQUENCY_256 | TIMER_ENABLE;

REG_TM1CNT = TIMER_OVERFLOW | TIMER_ENABLE;

REG_TM0D = REG_TM1D = 0;

while (REG_TM1D < iSecs) {}

while (REG_TM0D < (65535 / 1000) * iMilliSecs) {}

REG_TM0CNT = REG_TM1CNT = 0;

}
« Last Edit: September 02, 2007, 12:18:43 am by Trask »
Logged
Intel P4 3.2 GHZ
2.5GB SDRAM DDR400
350GB SATA
ATI RADEON HD 2600PRO 512MB
Creative Sound Blaster Audigy2 Z
Windows XP SP2

Current Projects: None.
- Trask
Re: GBA Interrupt tutorial request
« Reply #1 on: September 06, 2007, 04:53:10 pm »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
Maybe try the cin.get(); function I think it is.
It stops stuff until you hit enter.
Logged
  • Super Fan Gamers!
Re: GBA Interrupt tutorial request
« Reply #2 on: September 06, 2007, 06:09:59 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 266
I'm not trying to pause the game, that's just what my function does(well delay things for 2 seconds); An interrupt can ultimatly allow you to enter multiple buttons, create scrolling text boxes, used in sounds... etc... My class ended abruptly before I really understood the how.

And this is on the GBA hardware... there is no Enter, hehe. But I get what you're trying to say.
Logged
Intel P4 3.2 GHZ
2.5GB SDRAM DDR400
350GB SATA
ATI RADEON HD 2600PRO 512MB
Creative Sound Blaster Audigy2 Z
Windows XP SP2

Current Projects: None.
- Trask
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.183 seconds with 43 queries.

anything