biosfunctions
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
biosfunctions [2025/02/13 20:06] – created root | biosfunctions [2025/02/19 19:22] (current) – root | ||
---|---|---|---|
Line 11: | Line 11: | ||
TODO categorize these | TODO categorize these | ||
</ | </ | ||
- | ==== (TBD) Default Interrupt Handler | + | ==== BiosDefaultInterrupt |
Offset: 0x0604 | Offset: 0x0604 | ||
+ | <code C>void BiosDefaultInterrupt(void)</ | ||
+ | Default interrupt handler, turns off printer? and halts | ||
- | Turns off printer? and halts | ||
- | ==== BiosVdpMode ==== | ||
- | Offset: 0x668 | ||
+ | ==== BiosVdpMode ==== | ||
+ | Offset: 0x0668 | ||
+ | <code C>void BiosVdpMode(uchar controllerScanMode, | ||
Sets VDP controller scanning mode and video height | Sets VDP controller scanning mode and video height | ||
+ | |||
+ | controllerScanMode: | ||
==== BiosGetSealType ==== | ==== BiosGetSealType ==== | ||
+ | Offset: 0x115C | ||
+ | <code C>uint BiosGetSealType(void)</ | ||
+ | Detect inserted seal cartridge type from sense switches | ||
+ | |||
+ | |||
==== BiosDecompress4bit ==== | ==== BiosDecompress4bit ==== | ||
+ | Offset: 0x437C | ||
+ | <code C>??? BiosDecompress4bit(void* decompressInfo, | ||
+ | Decompresses 4-bit graphical data, algo unknown | ||
+ | |||
+ | |||
==== BiosInitSoundTransmission ==== | ==== BiosInitSoundTransmission ==== | ||
+ | Offset: 0x613C | ||
+ | <code C>void BiosInitSoundTransmission(void)</ | ||
+ | Initializes sound timer and serial port | ||
+ | |||
+ | |||
==== BiosPlayBgm ==== | ==== BiosPlayBgm ==== | ||
+ | Offset: 0x61A0 | ||
+ | <code C>void BiosPlayBgm(void* soundState, uchar unk, ushort trackIndex, void** trackList)</ | ||
+ | Play a music track from a list | ||
+ | |||
+ | |||
==== BiosPlaySfx ==== | ==== BiosPlaySfx ==== | ||
+ | Offset: 0x61B8 | ||
+ | <code C>void BiosPlaySfx(void* soundState, uchar unk, ushort sfxIndex, void** sfxList)</ | ||
+ | Play a sound effect from a list | ||
+ | |||
+ | |||
==== BiosUpdateBgm ==== | ==== BiosUpdateBgm ==== | ||
+ | Offset: 0x6238 | ||
+ | <code C>void BiosUpdateBgm(void* soundState, uint unk)</ | ||
+ | Update music playback (call on timer0 interrupt) | ||
+ | |||
+ | Unk param might be maximum data transfer size | ||
==== BiosDma ==== | ==== BiosDma ==== | ||
+ | Offset: 0x66D0 | ||
+ | <code C>void BiosDma(void* dmaList, int hwChannel)</ | ||
+ | Trigger a chain of DMA transfers | ||
+ | |||
+ | |||
==== BiosVsyncIfDma ==== | ==== BiosVsyncIfDma ==== | ||
+ | Offset: 0x6A0E | ||
+ | <code C>void BiosVsyncIfDma(void* dmaList)</ | ||
+ | Only vsyncs if the DMA list is valid | ||
+ | |||
+ | |||
==== BiosVsyncDma ==== | ==== BiosVsyncDma ==== | ||
+ | Offset: 0x6A48 | ||
+ | <code C>void BiosVsyncDma(void* dmaList)</ | ||
+ | Calls BiosVsync and BiosDma(param, | ||
+ | |||
+ | |||
==== BiosVsync ==== | ==== BiosVsync ==== | ||
+ | Offset: 0x6A5A | ||
+ | <code C>void BiosVsync(void)</ | ||
+ | Wait for vsync, read controller register to memory | ||
+ | |||
+ | |||
==== BiosSoundChannels ==== | ==== BiosSoundChannels ==== | ||
+ | Offset: 0x6AC0 | ||
+ | <code C>void BiosSoundChannels(uint channelMode)</ | ||
+ | Sets sound channel configuration | ||
+ | |||
+ | mode 0: 4ch, 1: 3ch + rhythm, 2: 3ch, others: 1ch | ||
==== BiosSoundVolume ==== | ==== BiosSoundVolume ==== | ||
+ | Offset: 0x6B50 | ||
+ | <code C>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. | ||
==== BiosSoundDemo ==== | ==== BiosSoundDemo ==== | ||
- | ==== Unidentified Decompressor | + | Offset: 0x6B86 |
+ | <code C>void BiosSoundDemo(void)</ | ||
+ | Toggles built-in demo music | ||
+ | |||
+ | |||
+ | ==== BiosUnknownDecomp? | ||
+ | Offset: 0x7D96 | ||
+ | <code C>??? BiosUnknownDecomp? | ||
+ | Some kind of decompression function | ||
+ | |||
===== Interrupt Handlers ===== | ===== Interrupt Handlers ===== | ||
==== BiosAutoUpdateBgm ==== | ==== BiosAutoUpdateBgm ==== | ||
+ | Offset: 0x648C | ||
+ | <code C>void BiosAutoUpdateBgm(void)</ | ||
+ | Auto call BiosUpdateBgm with pointer at biosAutoSoundState | ||
+ | |||
+ | Use as alternative to creating your own interrupt handler. | ||
===== Math Functions ===== | ===== Math Functions ===== | ||
==== BiosColorInverseGray ==== | ==== BiosColorInverseGray ==== | ||
+ | Offset: 0x2D68 | ||
+ | <code C>ushort BiosColorInverseGray(ushort color)</ | ||
+ | Compute 5bit grayscale from inverse of 15bit RGB | ||
+ | |||
+ | Unknown why it's the inverse. Preserves MSB. | ||
==== BiosValueBlendQuarter ==== | ==== BiosValueBlendQuarter ==== | ||
+ | Offset: 0x2DC6 | ||
+ | <code C>uchar BiosValueBlendQuarter(uchar valueA, uchar valueB)</ | ||
+ | Blend 3/4 of value A with 1/4 of value B (bytes) | ||
+ | |||
+ | |||
==== BiosColorBlendQuarter ==== | ==== BiosColorBlendQuarter ==== | ||
+ | Offset: 0x2DE0 | ||
+ | <code C>ushort BiosColorBlendQuarter(ushort colorA, ushort colorB)</ | ||
+ | Blend 3/4 of color A with 1/4 of color B | ||
+ | |||
+ | |||
==== BiosMulS16 ==== | ==== BiosMulS16 ==== | ||
+ | Offset: 0x2E68 | ||
+ | <code C>int BiosMulS16(short a, short b)</ | ||
+ | Signed 16bit multiply, 32bit result | ||
+ | |||
+ | |||
==== BiosMulU16 ==== | ==== BiosMulU16 ==== | ||
+ | Offset: 0x2E72 | ||
+ | <code C>uint BiosMulU16(ushort a, ushort b)</ | ||
+ | Unsigned 16bit multiply, 32bit result | ||
+ | |||
+ | |||
==== BiosDivU16 ==== | ==== BiosDivU16 ==== | ||
+ | Offset: 0x2E7C | ||
+ | <code C>ushort BiosDivU16(ushort a, ushort b)</ | ||
+ | Unsigned 16bit divide, 16bit result | ||
+ | |||
+ | |||
==== BiosDivS16 ==== | ==== BiosDivS16 ==== | ||
+ | Offset: 0x2EA6 | ||
+ | <code C>short BiosDivS16(short a, short b)</ | ||
+ | Signed 16bit divide, 16bit result | ||
+ | |||
+ | |||
==== BiosDivS32 ==== | ==== BiosDivS32 ==== | ||
+ | Offset: 0x2EDE | ||
+ | <code C>int BiosDivS32(int a, int b)</ | ||
+ | Signed 32bit divide, 32bit result | ||
===== Graphics ===== | ===== Graphics ===== | ||
==== BiosPlotLines ==== | ==== BiosPlotLines ==== | ||
- | ==== BiosPlotPolygons | + | Offset: 0x37A0 |
+ | <code C>void BiosPlotLines(short data[], uchar colors[], uchar buf[], short bufW, short bufH, bool bufFmt)</ | ||
+ | Plots a set of colored vertices joined by lines | ||
+ | |||
+ | |||
+ | ==== BiosPlotPolygons? ==== | ||
+ | Offset: 0x39AC | ||
+ | <code C>??? BiosPlotPolygons? | ||
+ | Plots polygons? | ||
===== Internal Use ===== | ===== Internal Use ===== | ||
==== _B_PrintOp1 ==== | ==== _B_PrintOp1 ==== | ||
+ | Offset: 0x06D4 | ||
+ | <code C>??? _B_PrintOp1(??? | ||
+ | Print operation | ||
+ | |||
+ | |||
==== _B_PlotPointInBuffer ==== | ==== _B_PlotPointInBuffer ==== | ||
+ | Offset: 0x394E | ||
+ | <code C>??? _B_PlotPointInBuffer(??? | ||
+ | Plots a point following some rules | ||
+ | |||
+ | |||
==== _B_PlotPointSpecial ==== | ==== _B_PlotPointSpecial ==== | ||
+ | Offset: 0x3C76 | ||
+ | <code C>??? _B_PlotPointSpecial(??? | ||
+ | Plots a 4bpp point with some special modes? | ||
+ | |||
+ | |||
==== _B_PlayBgmPointer ==== | ==== _B_PlayBgmPointer ==== | ||
+ | Offset: 0x61D8 | ||
+ | <code C>void _B_PlayBgmPointer(void* soundState, uchar unk, void* track, void** trackList)</ | ||
+ | Play a music track by pointer | ||
+ | |||
+ | |||
==== _B_PlaySfxPointer ==== | ==== _B_PlaySfxPointer ==== | ||
+ | Offset: 0x6374 | ||
+ | <code C>void _B_PlaySfxPointer(void* soundState, uchar unk, void* sfx)</ | ||
+ | Play a sound effect by pointer | ||
+ | |||
+ | |||
===== Not yet analyzed ===== | ===== Not yet analyzed ===== | ||
- | * 0x069C | + | * 0x069C |
- | * 0x0FD6 | + | * 0x0FD6 |
- | * 0x101C | + | * 0x101C |
- | * 0x1064 | + | * 0x1064 |
- | * 0x10AC | + | * 0x10AC |
- | * 0x10F4 | + | * 0x10F4 |
- | * 0x1140 | + | * 0x1140 |
- | * 0x1174 | + | * 0x1174 |
- | * 0x1198 | + | * 0x1198 |
- | * 0x1248 | + | * 0x1248 |
- | * 0x128E | + | * 0x128E |
- | * 0x134C | + | * 0x134C |
- | * 0x13B0 | + | * 0x13B0 |
- | * 0x1408 | + | * 0x1408 |
- | * 0x1464 | + | * 0x1464 |
- | * 0x157E | + | * 0x157E |
- | * 0x15D4 | + | * 0x15D4 |
- | * 0x15F2 | + | * 0x15F2 |
- | * 0x15FE | + | * 0x15FE |
- | * 0x162C | + | * 0x162C |
- | * 0x1652 | + | * 0x1652 |
- | * 0x1662 | + | * 0x1662 |
- | * 0x1690 | + | * 0x1690 |
- | * 0x17F4 | + | * 0x17F4 |
- | * 0x19BC | + | * 0x19BC |
- | * 0x1A0C | + | * 0x1A0C |
- | * 0x1B76 | + | * 0x1B76 |
- | * 0x1B9C | + | * 0x1B9C |
- | * 0x1C04 | + | * 0x1C04 |
- | * 0x1C2C | + | * 0x1C2C |
- | * 0x1CA0 | + | * 0x1CA0 |
- | * 0x1CF4 | + | * 0x1CF4 |
- | * 0x1DDE | + | * 0x1DDE |
- | * 0x1E1C | + | * 0x1E1C |
- | * 0x1F5E | + | * 0x1F5E |
- | * 0x2038 | + | * 0x2038 |
- | * 0x20EC | + | * 0x20EC |
- | * 0x212E | + | * 0x212E |
- | * 0x2148 | + | * 0x2148 |
- | * 0x2382 | + | * 0x2382 |
- | * 0x2598 | + | * 0x2598 |
- | * 0x2798 | + | * 0x2798 |
- | * 0x2A24 | + | * 0x2A24 |
- | * 0x2AD0 | + | * 0x2AD0 |
- | * 0x2B0E | + | * 0x2B0E |
- | * 0x2B48 | + | * 0x2B48 |
- | * 0x2F74 | + | * 0x2F74 |
- | * 0x3088 | + | * 0x3088 |
- | * 0x3560 | + | * 0x3560 |
- | * 0x35E6 | + | * 0x35E6 |
- | * 0x36BA | + | * 0x36BA |
- | * 0x3736 | + | * 0x3736 |
- | * 0x3E64 | + | * 0x3E64 |
- | * 0x3E9C | + | * 0x3E9C |
- | * 0x3EF0 | + | * 0x3EF0 |
- | * 0x3F48 | + | * 0x3F48 |
- | * 0x3FD8 | + | * 0x3FD8 |
- | * 0x40DC | + | * 0x40DC |
- | * 0x4186 | + | * 0x4186 |
- | * 0x429C | + | * 0x429C |
- | * 0x436A | + | * 0x436A |
- | * 0x445C | + | * 0x445C |
- | * 0x452C | + | * 0x452C |
- | * 0x4640 | + | * 0x4640 |
- | * 0x47A4 | + | * 0x47A4 |
- | * 0x49A4 | + | * 0x49A4 |
- | * 0x4B20 | + | * 0x4B20 |
- | * 0x4BA8 | + | * 0x4BA8 |
- | * 0x4C38 | + | * 0x4C38 |
- | * 0x4CDE | + | * 0x4CDE |
- | * 0x4D22 | + | * 0x4D22 |
- | * 0x4E34 | + | * 0x4E34 |
- | * 0x4FE4 | + | * 0x4FE4 |
- | * 0x5060 | + | * 0x5060 |
- | * 0x5098 | + | * 0x5098 |
- | * 0x5138 | + | * 0x5138 |
- | * 0x51C8 | + | * 0x51C8 |
- | * 0x542E | + | * 0x542E |
- | * 0x544C | + | * 0x544C |
- | * 0x5474 | + | * 0x5474 |
- | * 0x54B8 | + | * 0x54B8 |
- | * 0x5574 | + | * 0x5574 |
- | * 0x55B8 | + | * 0x55B8 |
- | * 0x55FC | + | * 0x55FC |
biosfunctions.1739477185.txt.gz · Last modified: 2025/02/13 20:06 by root