Yoshi's Story

From en64 wiki
Jump to navigation Jump to search

https://github.com/shygoo/ys-project

OS and Graphic Functions

0x80282210,osSendMesg
0x80282360,osPfsFreeBlocks
0x802824b0,osRecvMesg
0x802825f0,osSetIntMask
0x80282690,guScaleF
0x802826e4,guScale
0x80282730,__sinf/fsin/sinf
0x802828f0,sins
0x80282c20,__ull_rshift
0x80282c4c,__ull_rem
0x80282c88,__ull_div
0x80282cc4,__ll_lshift
0x80282cf0,__ll_rem
0x80282d2c,__ll_div
0x80282d88,__ll_mul
0x80282db8,__ull_divremi
0x80282e18,__ll_mod
0x80282eb4,__ll_rshift
0x802846e0,__osDequeueThread
0x80284720,osDestroyThread
0x80284820,bzero/_bzero/blkclr/_blkclr
0x80285b10,osCreateThread
0x80285f60,osVirtualToPhysical
0x80285fe0,osWritebackDCache
0x802862f0,osPiRawReadIo
0x802863b0,__osSetSR
0x802863c0,__osGetSR
0x802863d0,guPerspectiveF
0x80286600,guPerspective
0x80286660,__osSpRawStartDma
0x802866f0,__osSiRawStartDma
0x802867a0,osViBlack
0x80286810,__osSiRawReadIo
0x80286810,__osSpRawReadIo
0x80286860,osSpTaskYield
0x80286880,osGetThreadId
0x802868a0,osPfsReadWriteFile
0x80286da0,guMtxF2L
0x80286ea0,guMtxIdentF
0x80286f28,guMtxIdent
0x80286f58,guMtxL2F
0x80287010,osViSetMode
0x80287080,guLookAtF
0x80287338,guLookAt
0x80287b50,osPfsAllocateFile
0x80287fd4,__osPfsDeclearPage
0x80288300,__osProbeTLB
0x802883c0,osGetCount
0x802883d0,__osSumcalc
0x8028842c,__osIdCheckSum
0x80288494,__osRepairPackId
0x802888ac,__osCheckPackId
0x80288a44,__osGetId
0x80288ca0,__osCheckId
0x80288d9c,__osPfsRWInode
0x802890bc,__osPfsSelectBank
0x8028ab60,osEPiStartDma
0x8028ad80,memcpy
0x8028adac,strlen
0x8028add4,strchr
0x8028ae20,osCreateMesgQueue
0x8028ae50,osInvalICache
0x8028aed0,osInvalDCache
0x8028af80,__osSpDeviceBusy
0x8028afb0,__osSiDeviceBusy
0x8028afe0,osJamMesg
0x8028b130,osSetThreadPri
0x8028b210,osGetThreadPri
0x8028b230,osViSwapBuffer
0x8028b280,guMtxXFML
0x8028b2e0,guMtxCatL
0x8028b340,guMtxXFMF
0x8028b3e0,guMtxCatF
0x8028b780,osSpTaskYielded
0x8028b800,bcmp/_bcmp
0x8028b920,osGetTime
0x8028bdb0,__osSetGlobalIntMask
0x8028be00,osAiSetFrequency
0x8028bf60,osDpGetCounters
0x8028bfb0,__osContAddressCrc
0x8028c060,__osContDataCrc
0x8028c140,__osSetCompare
0x8028c150,guNormalize
0x8028c1e0,osDpSetStatus
0x8028c1f0,bcopy/_bcopy
0x8028c500,__osResetGlobalIntMask
0x8028cb80,guOrthoF
0x8028ccd4,guOrtho
0x8028cd40,__osDisableInt
0x8028cd60,__osRestoreInt
0x8028cec0,__osViSwapContext
0x8028d220,osPiGetCmdQueue
0x8028d250,__cosf/fcos/cosf
0x8028d3c0,coss
0x8028d3f0,osViSetSpecialFeatures
0x8028d5b0,osViSetEvent
0x8028d960,osPfsNumFiles
0x8028dc30,osContSetCh
0x8028dca0,__osSetFpcCsr
0x8028dcb0,osPfsFileState
0x8028e480,osPfsChecker
0x8028eb44,corrupted_init
0x8028ecf8,corrupted
0x8028eee0,osAiGetLength
0x8028f090,osMapTLBRdb
0x8028f0f0,osYieldThread
0x8028f140,guTranslateF
0x8028f188,guTranslate
0x8028f6d0,osSetTimer
0x8028f7b0,_Ldtob
0x80290270,lldiv
0x80290370,ldiv
0x80290400,_Litob
0x802906a0,__osSpRawWriteIo
0x802906a0,__osSiRawWriteIo
0x802906f0,__osSpSetStatus
0x80290700,__osSpGetStatus
0x80290710,osWritebackDCacheAll
0x80290ab0,__d_to_ll
0x80290acc,__f_to_ll
0x80290ae8,__d_to_ull
0x80290b88,__f_to_ull
0x80290c24,__ll_to_d
0x80290c3c,__ll_to_f
0x80290c54,__ull_to_d
0x80290c88,__ull_to_f
0x80290cc0,osStartThread
0x80290e20,osCreateViManager
0x802914f0,osViGetCurrentFramebuffer
0x802914f0,osViGetNextFramebuffer
0x80291530,__osSpSetPc
0x802aac60,osViModeNtscLpn1
0x802aacb0,osViModeNtscLpf1
0x802aad50,osViModeNtscLaf1
0x802aada0,osViModeNtscLpn2
0x802aadf0,osViModeNtscLpf2
0x802aae40,osViModeNtscLan2
0x802aae90,osViModeNtscLaf2
0x802aaee0,osViModeNtscHpn1
0x802aaf30,osViModeNtscHpf1
0x802aaf80,osViModeNtscHan1
0x802aafd0,osViModeNtscHaf1
0x802ab020,osViModeNtscHpn2
0x802ab070,osViModeNtscHpf2
0x802ab520,osViModeMpalLpn1
0x802ab570,osViModeMpalLpf1
0x802ab610,osViModeMpalLaf1
0x802ab660,osViModeMpalLpn2
0x802ab6b0,osViModeMpalLpf2
0x802ab700,osViModeMpalLan2
0x802ab750,osViModeMpalLaf2
0x802ab7a0,osViModeMpalHpn1
0x802ab7f0,osViModeMpalHpf1
0x802ab840,osViModeMpalHan1
0x802ab890,osViModeMpalHaf1
0x802ab8e0,osViModeMpalHpn2
0x802ab930,osViModeMpalHpf2

Notes

803D5CC0 - gets level names for trial mode
800F8E5C - unlocks levels in trial mode
803D5EC4 - column 1
803D5EF0 - column 2
803D5F1C - column 3
803D5F48 - column 4

803D7944 - level one button
0x165 - button active

8005DCF4 - hides buttons if 0x165 = 0x01

803D6AE0 - checks if level open to let you select
803D6B28 - selects level, A0 is current object (button)

803D6B64 - hand motion

803D6BA0 - fade screen and load level
803D6BE0 - upper nibble for row, lower for column
803D6CB0 - loads from level table 803D6f8c
800F8dfc - current level
803E9DE0 - loads level byte from 803eab50

existing levels:
Row 1:2B 33 0D 12
Row 2:2E 13 10 17
Row 3:34 28 20 0E
Row 4:11 16 0C 1B
Row 5:15 1E 1F 1C
Row 6:0F 23 22 18
unused:80 3E 7B B8

Extra levels ID:
00 - nintendo logo
01 - Name entry
02 - yoshi select
03 - score screen
04 - main menu
05 - lucky fruit
06 - score screen 2
07 - name entry 2
08 - yoshi death
09 - japanese trial screen
0A - options
14 - score screen 3
19 - practice stage
1A - score screen 4
1D - yoshi death 2
24 - test map 1 
25 - test map 2 (0xB50F94)
27 - test map 3 (800A79D8/0xB5114C)
2A - unused 'Mode Challenge'
2C - unused 'Challenge'
4B - white shyguy cutscene
4C - ending cutscene
4E - final boss
4F - blank level with yoshi select sounds (800A7B18)
50 - main menu
A5 - blubber boss
A9 - final boss no music
B0 - death warp (last in table)

//LEVEL SCRIPTS
8006E06C - handles level ID
800F8438 - level ID
**below 0x4f are treated differently?
800284AC - special level params?
8006DA0C - process level ID into addresses
800A78A0(0xA84A0) - list of level scripts in bank 0x04 (00B47A10 ROM)
8007DF0C - A1 is ROM location of level script

//REPLACE FIRST LEVEL WITH TEST MAP 2
0xC03730: 25

Source: Skulex

C Source

Pretty useless uncompiled source code found in ROM

#include <bg_debug.h>
#if USE_DEBUGMODE
enum {
    REG_TESTMODE = REG_HAYAKAWA_BEGIN,
    REG_SCALE,
    REG_ROTATE /* MAX 15 ITEMS */
};
#endif /* USE_DEBUGMODE */

    REGINIT(SCALE, 1);
    REGINIT(ROTATE, 0);

    if (REG(TESTMODE)) {
	transform(REG(SCALE), REG(ROTATE));
    }
#include <bg_debug.h>

    REGINITN(NISIWAKI, 0, 1);

    if (REGN(NISIWAKI, 0)) {
	transform(REGN(NISIWAKI, 1), REGN(NISIWAKI, 2));
    }