User Tools


Functions

Startup Code

The startup code is copied from ROM 0x1000 to 0x8021ED00 by the boot code. It is a relatively short chunk of code whose main job is to initialize enough of the OS to DMA the rest of the gzipped code (hd_code_text.raw and hd_code_data.raw) from ROM and inflate it.

Address Function Description
0x8021ED00 EntryPoint
0x80220730 Main
0x80220BA0 bzero
0x80220C40 osInitialize
0x80220E70 DmaCopy
0x80220F50 GetDmaStatus
0x80220F70 __osGetSR
0x80220F80 __osSetFpcCsr
0x80220F90 __osSiRawReadIo
0x80220FE0 __osSiRawWriteIo
0x802218A0 osWriteBackDCache
0x80221920 osInvalCache
0x80221A00 osEPiRawReadIo
0x80221AC8 __ull_div
0x80221BC8 __ll_mul
0x80221DE0 __osSiDeviceBusy

Game Code (hd_code_text.raw)

Address Function Description
0x802447C0 MainJump
0x80244870 Thread1
0x80244930 Thread3
0x8025615C LoadLevel
0x80267A9C Thread4
0x8026FBB0 LoadLevelRdus
0x80270F7C Thread5
0x8028B4C4 InitiateDma
0x8028C190 LoadLevelAmmo
0x8028D4C0 LoadLevelTnt
0x8028FDA0 LoadLevelSquareBlocks
0x802A1A9C LoadLevelTodo74
0x802A1C20 LoadLevelTodo2C
0x802A1D54 LoadLevelBuildings
0x802A2BB0 CopyBuildingTableToRam
0x802A2A98 InflateBuildingData
0x802A2C54 LoadLevelTodo60
0x802A2D68 LoadLevelTodo4C
0x802A3000 LoadLevelTodo78
0x802A3504 LoadLevelVehicles
0x802A3034 LoadLevelMissileCarrier
0x802A3D4C LoadLevelCollisionXZ
0x802A3DF0 LoadLevelTodo70
0x802A3E94 LoadLevelTodo64
0x802A3F78 LoadLevelTrainPlatform
0x802A445C LoadLevelTerrain
0x802A44DC AlignTo8Bytes
0x802A5500 LoadLevelTodo40
0x802A55F4 LoadLevelTodo44
0x802A57CC DecodeTexture
0x802A5948 DecodeTexture6
0x802A5A1C DecodeTexture3
0x802A5AD0 DecodeTexture1
0x802A5B80 DecodeTexture2
0x802A5C4C DecodeTexture4
0x802A5D24 DecodeTexture5
0x802A5E00 DecodeTexture0
0x802C4058 GzipInflate
0x802CE9F0 LoadLevelCommPoint
0x802D3F70 osInitialize
0x802D41A0 osEPiRawReadIo
0x802D4200 osCreateThread
0x802D4350 osStartThread
0x802D44B0 osCreatePiManager
0x802D4630 osSetThreadPri
0x802D4710 osSendMesg
0x802D4860 osRecvMesg
0x802D49A0 osViBlack
0x802D4A10 osGetTime
0x802D4AA0 __ull_rshift
0x802D4ACC __ull_rem
0x802D4B08 __ull_div
0x802D4B44 __ll_lshift
0x802D4B70 __ll_rem
0x802D4BAC __ll_div
0x802D4C08 __ll_mul
0x802D4C38 __ull_divremi
0x802D4C98 __ll_mod
0x802D4D34 __ll_rshift
0x802D4D70 osVirtualToPhysical
0x802D4DF0 osWriteBackDCache
0x802D4F10 guOrthoF
0x802D5064 guFrustum
0x802D50D0 guPerspectiveF
0x802D5300 guPerspective
0x802D5760 guMtxF2L
0x802D5860 guMtxIdentF
0x802D59D0 guRotateRPYF
0x802D5A24 guRotateRPY
0x802D5F30 sqrtf
0x802D6270 sinf
0x802D6430 osCreateMesgQueue
0x802D64A0 osViSetSpecialFeatures
0x802D6660 osWriteBackDCacheAll
0x802D6690 osInvalDCache
0x802D6740 osDestroyThread
0x802D6840 cosf
0x802D69B0 proutSprintf
0x802D6A1C sprintf
0x802D75B0 osSetIntMask
0x802D83B4 alBnkfNew
0x802D84B8 alSetFileNew
0x802D9770 osGetCount
0x802D9820 __osViInit
0x802D9950 osAiSetFrequency
0x802D9AB0 osAiSetNextBuffer
0x802D9B60 osAiGetLength
0x802DA240 osPiStartDma
0x802DA560 osCreateViManager
0x802DA6E4 __osViDevMgrMain
0x802DA8C0 osViSetMode
0x802DA930 osSetEventMsg
0x802DA9A0 osViSetEventMsg
0x802DAAA0 osViSwapBuffer
0x802DAAF0 osSetTimer
0x802DAC50 osSpTaskDunno
0x802DAD6C osSpTaskLoad
0x802DAECC osSpTaskStartGo
0x802DAF10 osSpTaskYield
0x802DAFF0 osContInit
0x802DB1EC __osContGetInitData
0x802DB2BC __osPackRequestData
0x802DB420 osContStartReadData
0x802DB4E4 osContGetReadData
0x802DB680 osInvalCache
0x802DB700 bzero
0x802DB8E0 __osSetSR
0x802DB8F0 __osGetSR
0x802DB900 __osSetFpcCsr
0x802DB910 __osSiRawReadIo
0x802DB960 __osSiRawWriteIo
0x802DB9B0 __osExceptionPreamble
0x802DB9C0 __osExceptionHandler
0x802DBFF0 __osEnqueueAndYield
0x802DC080 __osEnqueueThread
0x802DC0C8 __osPopThread
0x802DC0D8 __osDispatchThread
0x802DC218 __osCleanupThread
0x802DC280 __osDisableInt
0x802DC2A0 __osRestoreInt
0x802DC300 __osPiCreateAccessQueue
0x802DC350 __osPiGetAccess
0x802DC394 __osPiRelAccess
0x802DC3C0 osGetThreadPri
0x802DC3E0 osPiRawStartDma
0x802DC4C0 __osDevMgrMain
0x802DC640 __osTimerServicesInit
0x802DC6CC __osTimerInterrupt
0x802DC844 __osSetTimerIntr
0x802DC8B8 __osInsertTimer
0x802DCA40 __osProbeTLB
0x802DCB00 _Printf
0x802DDC90 memcpy
0x802DFB50 __osAiDeviceBusy
0x802E20F0 osJamMesg
0x802E2280 __osSpGetStatus
0x802E2290 bcopy
0x802E25A0 __osSpSetStatus
0x802E25B0 __osSpSetPc
0x802E25F0 __osSpRawStartDma
0x802E2680 __osSpDeviceBusy
0x802E26B0 __osSiRawStartDma
0x802E2760 __osSiCreateAccessQueue
0x802E27B0 __osSiGetAccess
0x802E27F4 __osSiRelAccess
0x802E2820 __osSiDeviceBusy
0x802E2CD0 __osSyncPutChars
0x802E2E00 __osSetCompare
0x802E5150 __osAtomicDec

UI Code (hd_front_end_text.raw)

The EEPROM functions are all stored in the hd_front_end_text.raw gzip file. In the (U) (1.0) ROM, these are inflated to 0x801E7000.

RAM/offset Function
801F1944/00A944 int ManageEeprom(u8 block, u8 mode)
801F2C84/00BC84 u8 UpdateChecksum(u8 *eeprom, int length)
80205760/01E760 u8 ComputeChecksumByte(u8 *data)
80202850/01B850 s32 osEepromProbe(OSMesgQueue *mq)
802042A0/01D2A0 s32 osEepromLongWrite(OSMesgQueue *mq, u8 address, u8 *buffer, int nbytes)
802043E0/01D3E0 s32 osEepromLongRead(OSMesgQueue *mq, u8 address, u8 *buffer, int nbytes)
80204BE0/01DBE0 s32 osEepromWrite(OSMesgQueue *mq, u8 address, u8 *buffer)
802050C0/01E0C0 s32 osEepromRead(OSMesgQueue *mq, u8 address, u8 *buffer)