OpenSNES
Modern Open-Source SNES Development SDK
Loading...
Searching...
No Matches
main.c File Reference

SuperFX (GSU) Hello World — boot diagnostic. More...

#include <snes.h>
#include <snes/superfx.h>

Functions

static u8 hexchar (u8 n)
 Convert a nibble to hex ASCII.
void launchGSU (void)
 Launch GSU program, wait for completion (defined in gsu_loader.asm).
int main (void)

Variables

u16 gsu_fmult_test1
u16 gsu_fmult_test2
u16 gsu_result
 GSU R0 result after launchGSU() (set by gsu_loader.asm).
u8 gsu_sram_byte0
u8 gsu_sram_byte1
u16 gsu_sram_word

Detailed Description

SuperFX (GSU) Hello World — boot diagnostic.

Detects the SuperFX coprocessor, launches a minimal GSU program that sets R0 = $CAFE, and reads back the result to verify two-way communication between the SNES CPU and the GSU.

What to Observe
  • GSU chip version displayed (VCR register)
  • GSU R0 result: $CAFE confirms the GSU executed code correctly
  • If no SuperFX hardware: "NOT DETECTED" message
SNES Concepts
  • SuperFX (GSU) coprocessor detection and communication
  • WRAM stub execution (CPU cannot read ROM while GSU owns the bus)
  • SRAM shared memory between SNES CPU and GSU
Modules Used
console, sprite, dma, background, text, superfx
See also
examples/graphics/effects/superfx_bitmap for GSU framebuffer rendering

Function Documentation

◆ hexchar()

u8 hexchar ( u8 n)
static

Convert a nibble to hex ASCII.

◆ launchGSU()

void launchGSU ( void )
extern

Launch GSU program, wait for completion (defined in gsu_loader.asm).

◆ main()

int main ( void )

Variable Documentation

◆ gsu_fmult_test1

u16 gsu_fmult_test1
extern

◆ gsu_fmult_test2

u16 gsu_fmult_test2
extern

◆ gsu_result

u16 gsu_result
extern

GSU R0 result after launchGSU() (set by gsu_loader.asm).

◆ gsu_sram_byte0

u8 gsu_sram_byte0
extern

◆ gsu_sram_byte1

u8 gsu_sram_byte1
extern

◆ gsu_sram_word

u16 gsu_sram_word
extern