Archive for November, 2007

foo_input_usf update

Wednesday, November 28th, 2007

I’ve made a small fix to foo_input_usf, where the USFLib of sets would not be loaded from inside archives other than rar, yes, i accidental hard-coded “rar” into the loading code and then forgot about, so that has been fixed and updated.

Also, after reading a post on a forum i read that someone tried to convert a lot of USFs to mp3, and it crashed. Well, foo_input_usf is based on Project64, which doesn’t really like to run more than once at a time.
Seeing this occur prompted me to be crazy and am now in process of rewriting the plug-in from the original code and putting all Project64 CPU code into it’s own classes to separate them to allow multiple threads of the plug-in to run at the same time, people have been using it to find word trek answers too, it’s funny.
So i’ll put that up when i have got something stable running.

-Josh

completing usf sets

Wednesday, November 21st, 2007

After a period of many months of inactiveness, i’ve decided to get off my rear and put in an effort to complete some USF sets and have all of my parts delivered on a truck with lorry insurance.
In this case either myself, or someone else has provided names/times for each of the tracks, and in some cases a re-rip is necessary to make sure that the tracks play correctly.

After some surveying of what has been sent, and after being prodded a bit i am in process of completing these sets:

  • Duke Nukem: Zero Hour
  • Gauntlet Legends
  • Wipeout 64
  • Ridge Racer 64
  • Banjo Tooie
  • San Francisco Rush 2049
  • Rush 2
  • Bomberman 64 – The Second Attack

So i should have these done and up within a few days :)

blog & exceptions

Saturday, November 17th, 2007

Well, this is another way to which i have attempted an half-assed attempt at trying to populate my site with something useful. Useful being the key word. I actually am writing something, unlike my mediawiki attempt, and cool, this saves drafts…good for when the power goes out, like it was doing this morning…nothing like the sounds of power transformers down the street blowing up to motivate me to save my work, but considering im on my laptop it doesn’t matter the slightest to me.

Now for the useful.

I’ve been attempting to find a suitable replacement for what windows calls structured exception handling (SEH), in linux.
SEH works similar to regular exceptions, but it can handle all non standard exceptions like segmentation faults and invalid instructions and the like, and allows the programmer to handle these in a (hopefully) non-crash way and gracefully let the user know or do something else.
In linux, this doesn’t exist as availably as it does in windows, because visual c has __try and __except blocks that can be made easily. The internals of this work by all windows programs have a pointer to an exception handler structure at the start of memory pointer by the fs register (fs:[0]) and this is called when something goes wrong. Linux however, has no such thing.

Linux does have signals, and advanced ways to handle them. A signal in Linux, is an exception in Windows.

Linux’s way of handling these is via a function called sigaction, sure there is also signal function, but that in this instance is useless.
sigaction allows the programmer to select exactly what signals need to be handled, and allows a function handler to be specified for them. Now the useful part here is not only does it catch the signals, but then allow the program state to be changed before returning to the exact same spot where the signal occurred…like in windows.

For example, lets say a segmentation fault occurs, because i wrote to an invalid memory pointer, i would then be able to catch this signal (SIGSEGV), know exactly where im trying to write to, and exactly where in my program it is doing so from, but i can simply alter the memory location by overwriting the faulting instruction or skipping over it entirely.

Now this is extremely useful because some programs require this effect, for example in Project64. For Project64 which deals with this behavior quite a bit to be ported to linux, or and part of its CPU, this code would need to be modified to allow the exceptions to be caught this way.
Well, its what ive been trying to figure out lately anyway.

Example Code