#6310 - JL - Thu May 22, 2003 8:58 pm
Hi guys,
I'm trying to compile my project using the crt0 and lnkscript from Jeff Frohwein but the compiler complains about undefined references to appended_end, appended_start and heap_limit.
Now I noticed that these are defined in the lnkscript that comes with devkitadv 5 but when I compile that with the crt0 from jeff I get unresolved refs to the interrupt stuff (sp_irq, sp_usr, intr_vector_buf etc.).
The whole reason to use jeff's crt0+lnkscript was the neat interrupt support in there.
So, my question is if anyone knows how to compile the crt0 from jeff with interrupt support using devkitadv 5?
Thanks for any help!
JL
#6311 - tepples - Thu May 22, 2003 9:05 pm
JL wrote: |
The whole reason to use jeff's crt0+lnkscript was the neat interrupt support in there. |
Based on what I have learned from gbadev@yahoogroups, Jeff F's multiple interrupt support was removed from DevKit Advance R5 because it turned out to have been copied directly from an example in Nintendo's official SDK.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#6344 - Jason Wilkins - Fri May 23, 2003 3:43 pm
I did not remove it. DevKit Advance never contained any interrupt support to begin with. I was not going to add it until I had a chance to look at it more. I find the implementation of interrupts the way Nintendo provided in its examples to be a little wanting. Or at least, I wanted to understand it better before including it.
If you want Jeff's interrupt handling, then copy the interrupt code out of his crt0.S and create your own seperate assembly file containing interrupt handling. There is no reason that it has to be in crt0.S
Such code should have never been in crt0.S to begin with.
Please note that crt0.S and the linkscript are intimately related and are very unlikely to work if they are not part of the same package.
_________________
http://devkitadv.sourceforge.net
#6357 - Maddox - Fri May 23, 2003 7:52 pm
Go ahead and stick your interrupt handler in crt0.s if you want. It won't hurt anything.
_________________
You probably suck. I hope you're is not a game programmer.
#6368 - Jason Wilkins - Fri May 23, 2003 8:54 pm
Pay attention.
The guy wants to use DevKit Advance's crt0 and lnkscript, but also Jeff's interrupt code.
If he wants to do that then he needs to rip the code out of Jeff's crt0.S and put it in a seperate file.
If he does not necessarily want to use DevKit Advance's crt0 and lnkscript, then he will need to make sure he disables DevKit Advance's by using the -nostartfiles and -Tlnkscript options.
Of course it 'does not hurt anything' to have interrupt code in the crt0.S file, but it is sloppy. Why not just throw the whole game into a .S file and a .c file?? It is like someone at Nintendo said 'Man! I'm just too lazy to put this unrelated thing into a seperate file, so I'll just slap it in here', and because everyone else is too lazy to do their own thinking they just copied it. The only thing crt0 and interrupt handling have in common is that they are written in assembly language.
I didn't put it into DevKit Advance's crt0 because it creates unnecessay dependencies. The only dependencies crt0 should have IMHO are to the entry point function and lnkscript.
I seem to be a little grumpy today! I better go back to being the friendly and helpful DevKit maintainer or people might begin to wonder about me ^_^
_________________
http://devkitadv.sourceforge.net
#6375 - Maddox - Fri May 23, 2003 9:32 pm
I didn't say that it wasn't sloppy. I was just being a dick. I think you're right!
_________________
You probably suck. I hope you're is not a game programmer.
#6413 - JL - Sat May 24, 2003 11:35 pm
Ok, thanks all for your input. The question came up because I was just wondering why the crt0 from Jeff worked fine using the previous devkit and now it doesn't anymore in the new release.
But since the crt0 and lnkscript are closely related, that makes sense. Ofcourse, I figured as much from the errors that the compiler threw at me, but I didn't know the background of it.
I want to use the new devkitadv release, because that fixes some memory allocation errors (a C++ new operator failed on me). But I also want the interrupt support, so I'll take Jeff's code and put it in a different file.
Grtz,
JL
#6426 - Jason Wilkins - Sun May 25, 2003 8:40 am
Please note, crt0.o from DevKit Advance R5 registers the address of __interrupt_handler as the interrupt handler instead of IntrMain. So, if you rip the code you will either need to rename IntrMain to __interrupt_handler or you will need to register IntrMain yourself like this:
Code: |
(void*)(0x03007FFC) = &IntrMain; |
_________________
http://devkitadv.sourceforge.net