The Loopy's built-in ROM provides code for common operations such as drawing graphics, playing music, and operating the printer.
This page is intended to list and categorize these functions with brief descriptions. Workflows like adding music and graphics to your homebrew game will be their own separate pages.
This google sheet was adapted as the starting point.
TODO categorize these
Offset: 0x0604
void BiosDefaultInterrupt(void)
Default interrupt handler, turns off printer? and halts
Offset: 0x0668
void BiosVdpMode(uchar controllerScanMode, uchar videoHeight240)
Sets VDP controller scanning mode and video height
controllerScanMode: bitfield, 1=mouse, 2=gamepad
Offset: 0x115C
uint BiosGetSealType(void)
Detect inserted seal cartridge type from sense switches
Offset: 0x437C
??? BiosDecompress4bit(void* decompressInfo, void* output)
Decompresses 4-bit graphical data, algo unknown
Offset: 0x613C
void BiosInitSoundTransmission(void)
Initializes sound timer and serial port
Offset: 0x61A0
void BiosPlayBgm(void* soundState, uchar unk, ushort trackIndex, void** trackList)
Play a music track from a list
Offset: 0x61B8
void BiosPlaySfx(void* soundState, uchar unk, ushort sfxIndex, void** sfxList)
Play a sound effect from a list
Offset: 0x6238
void BiosUpdateBgm(void* soundState, uint unk)
Update music playback (call on timer0 interrupt)
Unk param might be maximum data transfer size
Offset: 0x66D0
void BiosDma(void* dmaList, int hwChannel)
Trigger a chain of DMA transfers
Offset: 0x6A0E
void BiosVsyncIfDma(void* dmaList)
Only vsyncs if the DMA list is valid
Offset: 0x6A48
void BiosVsyncDma(void* dmaList)
Calls BiosVsync and BiosDma(param, 3)
Offset: 0x6A5A
void BiosVsync(void)
Wait for vsync, read controller register to memory
Offset: 0x6AC0
void BiosSoundChannels(uint channelMode)
Sets sound channel configuration
mode 0: 4ch, 1: 3ch + rhythm, 2: 3ch, others: 1ch
Offset: 0x6B50
void BiosSoundVolume(uint vol23, uint vol4)
Sets sound channel volume control
volume for ch2/3 and ch4; 0: -4dB, 1: -2dB, 2: 0dB. ch1 always 0dB.
Offset: 0x6B86
void BiosSoundDemo(void)
Toggles built-in demo music
Offset: 0x7D96
??? BiosUnknownDecomp?(???)
Some kind of decompression function
Offset: 0x648C
void BiosAutoUpdateBgm(void)
Auto call BiosUpdateBgm with pointer at biosAutoSoundState
Use as alternative to creating your own interrupt handler.
Offset: 0x2D68
ushort BiosColorInverseGray(ushort color)
Compute 5bit grayscale from inverse of 15bit RGB
Unknown why it's the inverse. Preserves MSB.
Offset: 0x2DC6
uchar BiosValueBlendQuarter(uchar valueA, uchar valueB)
Blend 3/4 of value A with 1/4 of value B (bytes)
Offset: 0x2DE0
ushort BiosColorBlendQuarter(ushort colorA, ushort colorB)
Blend 3/4 of color A with 1/4 of color B
Offset: 0x2E68
int BiosMulS16(short a, short b)
Signed 16bit multiply, 32bit result
Offset: 0x2E72
uint BiosMulU16(ushort a, ushort b)
Unsigned 16bit multiply, 32bit result
Offset: 0x2E7C
ushort BiosDivU16(ushort a, ushort b)
Unsigned 16bit divide, 16bit result
Offset: 0x2EA6
short BiosDivS16(short a, short b)
Signed 16bit divide, 16bit result
Offset: 0x2EDE
int BiosDivS32(int a, int b)
Signed 32bit divide, 32bit result
Offset: 0x37A0
void BiosPlotLines(short data[], uchar colors[], uchar buf[], short bufW, short bufH, bool bufFmt)
Plots a set of colored vertices joined by lines
Offset: 0x39AC
??? BiosPlotPolygons?(???)
Plots polygons?
Offset: 0x06D4
??? _B_PrintOp1(???)
Print operation
Offset: 0x394E
??? _B_PlotPointInBuffer(???)
Plots a point following some rules
Offset: 0x3C76
??? _B_PlotPointSpecial(???)
Plots a 4bpp point with some special modes?
Offset: 0x61D8
void _B_PlayBgmPointer(void* soundState, uchar unk, void* track, void** trackList)
Play a music track by pointer
Offset: 0x6374
void _B_PlaySfxPointer(void* soundState, uchar unk, void* sfx)
Play a sound effect by pointer