Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)
You are not logged in.
I'm making a game for nes and everythings been working smoothly until now. I'm trying to use the delay() function and I'm getting this error:
?ASlink-Warning-Undefined Global '_delay' referenced by module 'game'
I have the nes.h file included and my text editor can even find the delay function and its description.
Help please!
Offline
I don't use the built in Delay() function, personally. I'll provide you with what I use instead.
void smartDelay(uint8_t interval, BOOLEAN musicPlaying){ //Delays the game for inverval number of frames by waiting for that frame to fully render before starting the next loop uint8_t i; for(i=0; i < interval; i++){ if (musicPlaying == TRUE){ // Frame specific music update, my code has been removed as it wouldn't be useful for NES } wait_vbl_done(); } }
It waits a specific number of vertical blank intervals/frames.
Hope this helps.
EDIT: This post was made assuming you're using the experimental NES support for GBDK. If you're using something else, the code above may be able to be adapted, but won't be a drop-in.
Last edited by Ardis (2024-04-01 12:35:43)
Offline