gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Division in interrupt service routines?

#81421 - tepples - Sat Apr 29, 2006 2:23 am

DekuTree64 warned in this post that an interrupt service routine that uses the hardware division or square root registers should save and restore them. But what would one need division or square root for in an ISR, except possibly a vblank ISR? If for projection of coordinates for a "mode 7" floor, then that should be done in the mainline code and HDMA'd to the screen, right?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#81422 - wintermute - Sat Apr 29, 2006 2:30 am

Well sure but you may have noticed several people are attempting to implement threading. One of the reasons I used the bios divide rather than the hardware registers is that the former is interruptible but the latter is not. There are of course ways around this, like not allowing a context switch during a division operation but why make things more complex than they have to be?
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog