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.

Coding > ham_VBAText() possible problem?

#27857 - jamao - Fri Oct 22, 2004 9:57 am

I've been working on this project that I took off the hands of another team comprised of three guys, and I'm currently working on the sprite/animation stuff.

I have encountered an error about a
"reached empty int, this means you have an int on, but not set to a function" in int.c at line 40.
I've seen someone else with this error but was sporadic for him and he eventually solved his problem.
As far as I see in the code, I do the sprite creation in ham the same as one of the previous versions of the project which worked and displayed a sprite minus the animation whatnot.

At one point, the line

Code:
ham_VBAText("MiniGame01:LoadScene - Error loading scene %d \n", aSceneNumber);


was causing it, because when I double slashed it the error didnt occur, but this line was in a default case of a switch that should not have even been executed. The value of the switch expression was 1 (which had a case for it), but for some reason, a ham_VBAText() call was not displaying in the log right above the switch.

If anyone could help me out I'd appreciate it. Keep in mind that I didn't code most of this stuff, so I'm not entirely familiar with the different logics and designs, but according to what I see, ........, I'm just really confused.

#27867 - ScottLininger - Fri Oct 22, 2004 5:28 pm

I'm going to assume the int.h manages what are called "interrupts" in the gameboy world. These are "events" that interrupt your code-flow at a given point to go do something else.

One example of an interrupt is the VBlank interrupt. This event gets fired at the beginning of every "vblank" period, every frame. When this interrupt occurs, the gameboy halts whatever it is doing and goes to the function defined as the "handler" for that interrupt.

I suspect there is some interrupt that is firing in the middle of your program that's making you *think* there's a problem with your code, when in fact it's a problem with the interrupt.

So here's your error...

Quote:
"reached empty int, this means you have an int on, but not set to a function"


This error suggests that there is an interrupt that has been turned on, but that no function has been set as its handler. So every time the event fires, the gameboy has no idea what to do.

Now with that being said, I'm not familiar with HAM enough to tell you which interrupt might be active and why it would be set when the ham_VBAText function is called. They might actually be unrelated.

I'd look at the HAM documentation and do a search for interrupts. There should be a function or something that turns them on and off. Search your code for this function and see if there's an interrupt being enabled in there somewhere that shouldn't be.

-Scott