Using oamInit() to reset the OAM

Post Reply
Sylus101
Posts: 179
Joined: Wed Dec 24, 2008 5:08 am

Using oamInit() to reset the OAM

Post by Sylus101 » Fri May 22, 2009 11:03 pm

Quick question. From the source, it appears that it would be fine, but I just wanted to check. Should oamInit() suffice as a way to just reset the oam for a particular engine after it's already had several spots in memory allocated, etc? I notice there is an undocumented function oamAllocReset() called so I'm wondering if that pretty much does the trick.

Thanks,
Sylus
-Sylus "Not Stylus..." McFrederickson

Come visit my web site.

User avatar
vuurrobin
Posts: 219
Joined: Fri Jul 11, 2008 8:49 pm
Location: The Netherlands
Contact:

Re: Using oamInit() to reset the OAM

Post by vuurrobin » Fri May 22, 2009 11:58 pm

well, one of the first things oamInit() does is a call to dmaFillWords(), so my guess would be yes. I suggest you try it out and see if anything weard happens.

but why aren't you using oamClear() to clear/reset the oam?

Sylus101
Posts: 179
Joined: Wed Dec 24, 2008 5:08 am

Re: Using oamInit() to reset the OAM

Post by Sylus101 » Sat May 23, 2009 4:04 am

Because it's not just hiding all the sprites that I need to do. I'm also wanting to reset the memory allocation system.
-Sylus "Not Stylus..." McFrederickson

Come visit my web site.

Tomdev
Posts: 82
Joined: Thu Jan 08, 2009 9:15 pm

Re: Using oamInit() to reset the OAM

Post by Tomdev » Sun May 24, 2009 3:51 pm

as for hiding sprites: you can make a function yourself(it's not too complicated) for resetting the gfx i don't know, maybe clear the whole vrambank you're using for the sprites?

User avatar
vuurrobin
Posts: 219
Joined: Fri Jul 11, 2008 8:49 pm
Location: The Netherlands
Contact:

Re: Using oamInit() to reset the OAM

Post by vuurrobin » Sun May 24, 2009 4:27 pm

or by setting the sprites visibility to false, which is what oamClear() does.

also, oamInit() calls oamAllocReset() in the end, so I think it would be ok.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest