Daily Archive for April 8th, 2009

Inside BlackFOX 4

As you can see, the FoxBIOS is pretty huge, and I had to split it not into two, not into three, but into FOUR posts! Horrible!

Interrupt table is fairly big. There are 97 interrupts defined in one or another way (some are still missing, and 30 of them are generic error handlers).

Interrupt 0 is same as interrupt 40, and it links to ACPI_Restart routine, which restarts the console/game.

Interrupt 1 is same as interrupt 41, and it invokes ACPI_PowerOff which properly turns off the console (including GPU).

2..31 are error handlers, they are handled by one generic handler, which shows a BlackFOX logo with “SOFTWARE ERROR” written all over it. Also it tells you what error you received.

Interrupts 32..39 are BIOS generic routines – get version, set the GPU power state, perform delay of N seconds, idle (you can’t use IDLE opcode in unprivilegied mode), unlock (gives full hardware access, isn’t implemented yet… OR IS IT?), game load & save feature (this allows for saving 12 bytes of game data tied to a 4-letter game ID. It stores them in ACPI ROM, forgot to mentoin it in first post, and it keeps the save data between dupes). There is also SET_VIDEOMODE routine, which sets videomode (custom GPU program, program supervised by VideoBIOS, invalid videomode, and rendering mode powered by a GPU driver)

Interrupts 40..49 are the ACPI routines – restart, power off, set LED states, set CPU1 state (on/off), set CPU speeds, tell WireFI controller to STOP ANNOYING SCANNING.

Interrupts 50..53 are the extended input functions – support for a keyboard connected via cartridge slot (which acts as extension slot, sort of). THERE IS A BUG RIGHT NOW: these rely on a GS segment register, which is also used by terminal console and GPU driver (it’s set to BIOS DS segment). It’s not restored, it should be. BAD BIOS.

Interrupts 54..56 – terminal console. Has three functions – initialize & display terminal console, write a string (possibly formatted with printf format stuffs!) and append parameters to it.

57..87 interrupts is a wrap around GPU driver, more about them functions later. Also 88..97 are a wrap around WireFI driver.

(This fantastic realistic game uses the GPU driver for rendering, and the WireFI driver for shooting a person who looses with a gun, which is wirelessly connected to the console, I’m serious).

Interrupts 98..103 are currently undefined, but they will be used by the CD drive system soon (when the CDDC controller is ready).