Interrupts and VBlank

Post Reply
Ferinex
Posts: 2
Joined: Thu Aug 20, 2009 9:55 am

Interrupts and VBlank

Post by Ferinex » Thu Aug 20, 2009 10:10 am

I just started programming for the DS recently and am in need of some assistance.

I have been googling and searching the forums and I can't seem to find any recent/up-to-date source on how interrupts and swiWaitForVblank() works in libnds. There are no examples included specifically related to interrupts, and I can't seem to figure it out through experimentation.

For instance, is putting swiWaitForVblank() ; at the end of my game loop good enough to make it wait for a vblank, or do I need to do something more? I can't seem to figure out what the various irq functions are for, and can't find an easy to understand reference. I'm new to this, so please go easy on my ignorance :)

Oh, also: Do I need to use the 'combined' template to utilize touch functionality? I have been using it and it works fine, but I'm not sure if it's necessary/the most efficient way.

Thanks!

StevenH
Posts: 133
Joined: Sun Feb 22, 2009 7:59 pm

Re: Interrupts and VBlank

Post by StevenH » Thu Aug 20, 2009 10:31 am

To wait for a vblank all you need is that swi call.

If you are not using anything custom on the arm7 - i.e. a custom sound driver, custom wifi, doing something crazy with the touch screen, etc - then you only need the arm9 template, as that includes a standard arm7 core. I think WinterMute is attempting to go the Nintendo route and standardise the whole process, but allowing anyone to tinker with a custom arm7 if they want to.

As for the irq's - pass, I've not played with them myself yet, someone else may be able to assist you there.

Ferinex
Posts: 2
Joined: Thu Aug 20, 2009 9:55 am

Re: Interrupts and VBlank

Post by Ferinex » Sun Aug 23, 2009 11:02 pm

Hey, thanks mate!

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 1 guest