jorgeche managed to trigger another "hidden" bug in the compiler.
This time it was only with large C functions and when the frame-pointer was enabled in the compiler.
Turns out that GCC was "helpfully" rearranging the order of CPU instructions so that things were put on the stack before the stack was actually adjusted ... causing havoc if an interrupt happened.
That may be a bit too technical for most folks ... but any programmer here that's had to track down a bug like that knows what an absolute swine it is to track down the cause when the CPU just starts randomly jumping into strange locations because the stack has been corrupted! Without Mednafen, it would have been almost impossible to find.
Anyway ... I finally figured out how to convince GCC not to be so stupid, and everything seems good now.
Simple C++ test code seems to work fine with "new" and "delete" using the regular C malloc() and free() from newlib.
Those probably shouldn't be used in practice in a game-engine on the PC-FX, but replacing them with something more sophisticated can wait until work on liberis resumes.
The VirtualBoy guys are wanting to release a new version of their IDE/engine/game with the latest compiler, so I'm cleaning it all up for the first official release of the new compiler patches.
*****************************
Also i have read that code can be executed from the memory card slot is this true?
If so can a hacked memory card with an sd slot be used similar to what the gamecube can do?
I've heard that the PC-FX will load/run code off of the BMP memory card, but I've not tried it, and I have little idea of how you'd sensibly get any code on there in the first place.
I suppose that you'd have to burn a program on a PC-FX CD that would then write the 2nd program onto the BMP itself.
Sounds like a PITA, and I'm not sure what the gain would be ... unless someone either hacked a BMP to add circuitry to communicate to a PC, or someone designed a PC-to-PCFX joypad communication cable.
At the moment, it's just easier to develop in Mednafen and then burn a CD to test stuff on a real console.
It's even easier if you have a PC-FXGA card that already has all the PC communications side built into it.
Unless you're an electronics engineer and want to design a BMP-to-sdcard modification, then it's never going to work that simply.
Just a question where do i start if i want to contribute,
My coding abilities are limited but i am willing to learn . Anywhere i should start?
I'm not sure that we're at the point where there's much that anyone can contribute unless they have skills/experience in specific areas.
If someone is an electronics engineer, then it would be nice to have that PC-to-PCFX cable or BMP hack designed.
If someone is an expert in Japanese, then it would be nice to have more of the PC-FX hardware documentation translated.
If someone has a lot of experience at designing/creating assembly libraries for low-level hardware access, then liberis still needs a lot of work.
If someone has a lot of experience at designing/creating graphics tools or modern IDEs, then the new compiler and Mednafen could be wrapped-up in an easy-to-use package for newcomers to start with (like the VirtualBoy guys have done with VBDE).
If someone is a graphic artist, then there will eventually need to be some artwork done for a demos to show off the machine, but it's still too early for that.
If you don't have any of those skills, then I'm not sure what help you can provide at this time that's going to help out.
Helping others get interested in the platform is one way ... for instance, letting people know about the Zeroigar translation so that they can see one of the more-interesting games on the machine, that was pretty impressive in its story-telling.
Learning to program is always good, and you may want to get started with HuC on the PC Engine since the PC-FX uses 2 of the same VDC chips inside it, so anything that you learn should transfer over fairly easily later on.