Cruis'n USA

From en64 wiki
Jump to navigation Jump to search

OS and Audio Functions

0x8011fbc0,osCreateThread
0x8011fd10,osStartThread
0x8011ffe0,osCreateMesgQueue
0x80120370,osViSetMode
0x801203e0,osViSetSpecialFeatures
0x801205a0,osViSetEvent
0x80120610,osViBlack
0x80120680,alHeapInit
0x801223a0,osEepromProbe
0x80122690,osRecvMesg
0x801227d0,osWritebackDCache
0x80122850,osInvalDCache
0x80122900,osInvalICache
0x80122a90,osSetEventMesg
0x80122b00,osSpTaskYielded
0x80122b80,osViSwapBuffer
0x80122bd0,osViGetCurrentFramebuffer
0x80122bd0,osViGetNextFramebuffer
0x80122c10,osSpTaskYield
0x80122c30,osSendMesg
0x80122d80,osWritebackDCacheAll
0x80122ecc,osSpTaskLoad
0x8012302c,osSpTaskStartGo
0x80123120,osGetTime
0x801231b0,__ull_rshift
0x801231dc,__ull_rem
0x80123218,__ull_div
0x80123254,__ll_lshift
0x80123280,__ll_rem
0x801232bc,__ll_div
0x80123318,__ll_mul
0x80123348,__ull_divremi
0x801233a8,__ll_mod
0x80123444,__ll_rshift
0x80123480,osAiSetFrequency
0x801235e0,alHeapDBAlloc
0x80123640,alUnlink
0x80123670,alLink
0x80123694,alClose
0x801236cc,alInit
0x80123700,osVirtualToPhysical
0x80123780,osAiSetNextBuffer
0x80123830,osAiGetLength
0x80123f10,alSynAddPlayer
0x80123f60,_allocatePVoice
0x80124048,alSynAllocVoice
0x80124190,alSynStartVoiceParams
0x80124280,alSynSetPitch
0x80124310,alSynSetVol
0x801243b0,alSynSetPan
0x80124440,alSynStopVoice
0x801244c0,alSynFreeVoice
0x80124570,alSynSetPriority
0x80124580,osSetTimer
0x80124660,osContStartReadData
0x80124724,osContGetReadData
0x801248c0,osContStartQuery
0x80124944,osContGetQuery
0x80124970,__d_to_ll
0x8012498c,__f_to_ll
0x801249a8,__d_to_ull
0x80124a48,__f_to_ull
0x80124ae4,__ll_to_d
0x80124afc,__ll_to_f
0x80124b14,__ull_to_d
0x80124b48,__ull_to_f
0x80124b80,__osSetSR
0x80124b90,__osGetSR
0x80124ba0,__osSetFpcCsr
0x80124bb0,__osSiRawReadIo
0x80124bb0,__osSpRawReadIo
0x80124c00,__osSiRawWriteIo
0x80124c00,__osSpRawWriteIo
0x801254c0,osMapTLBRdb
0x80125520,osPiRawReadIo
0x801255c0,bzero/_bzero/blkclr/_blkclr
0x80125660,__osDisableInt
0x80125680,__osRestoreInt
0x801256a0,__osDequeueThread
0x801257a0,osGetThreadPri
0x801257c0,osSetThreadPri
0x801258a0,osPiRawStartDma
0x80126040,__osViSwapContext
0x801263a0,osGetCount
0x80126470,__osSiRawStartDma
0x80127e10,__osContRamRead
0x80128390,__osContRamWrite
0x80128740,osEepromWrite
0x801289fc,__osEepStatus
0x80128c20,osEepromRead
0x8012af80,alSynAllocFX
0x8012b020,alMainBusParam
0x8012b050,alMainBusPull
0x8012b170,alLoadParam
0x8012b344,alRaw16Pull
0x8012b81c,alAdpcmPull
0x8012bcc0,alResampleParam
0x8012bdac,alResamplePull
0x8012bfc0,_ldexpf
0x8012bfe8,_frexpf
0x8012c0d4,alEnvmixerParam
0x8012c6cc,alEnvmixerPull
0x8012cc20,alAuxBusParam
0x8012cc50,alAuxBusPull
0x8012cd30,alSaveParam
0x8012cd64,alSavePull
0x8012ce50,__osSiDeviceBusy
0x8012d430,osDestroyThread
0x8012d530,__osSetCompare
0x8012d540,__osContAddressCrc
0x8012d5f0,__osContDataCrc
0x8012e790,alFilterNew
0x8012f3c0,alCopy
0x8012f440,__osGetCause
0x8012f450,__osAtomicDec
0x8012f4b0,lldiv
0x8012f5b0,ldiv
0x8013a580,osViModeNtscLpn1
0x8013a5d0,osViModeNtscLpf1
0x8013a670,osViModeNtscLaf1
0x8013a6c0,osViModeNtscLpn2
0x8013a710,osViModeNtscLpf2
0x8013a760,osViModeNtscLan2
0x8013a7b0,osViModeNtscLaf2
0x8013a800,osViModeNtscHpn1
0x8013a850,osViModeNtscHpf1
0x8013a8a0,osViModeNtscHan1
0x8013a8f0,osViModeNtscHaf1
0x8013a940,osViModeNtscHpn2
0x8013a990,osViModeNtscHpf2
0x8013a9e0,osViModeMpalLpn1
0x8013aa30,osViModeMpalLpf1
0x8013aa80,osViModeMpalLan1
0x8013aad0,osViModeMpalLaf1
0x8013ab20,osViModeMpalLpn2
0x8013ab70,osViModeMpalLpf2
0x8013abc0,osViModeMpalLan2
0x8013ac10,osViModeMpalLaf2
0x8013ac60,osViModeMpalHpn1
0x8013acb0,osViModeMpalHpf1
0x8013ad00,osViModeMpalHan1
0x8013ad50,osViModeMpalHaf1
0x8013ada0,osViModeMpalHpn2
0x8013adf0,osViModeMpalHpf2
0x8013bdb0,__osRcpImTable

File Table

In Rom


Start 0x80590
End 0x98CC4
The file table is 18734 bytes long (including header)
 
Header: 00 00 30 E6 
 
Example File1:
30 00  02 08  03 01  87 34
XX YY YY YY ZZ AA AA AA
 
X = Unkown
Y = File size
Z = File type?
01
02
03
04
05
06
07
08
09
0B (only saw twice at the beginning)
0C (only saw once)
A = Offset of the file relative to 0x80590

Misc Notes

Notes by BoringPerson

Roadkill Collision

In the arcade version of Cruis'n USA, there are cows and deer on the road that will explode into chunks if you hit them. This was removed from the Nintendo 64 version.

In the Nintendo 64 version, there are different collision types. There's one for objects that go flying like mailboxes, and another for road signs that flatten when you hit them. There is also an unused collision type Template:Hex. When you crash into an object of this type, the object disappears and you spin out. As it turns out, this is the roadkill collision that was removed from the Nintendo 64 version of Cruis'n USA. There is also an explosion of chunks just like in the arcade version, but all the chunks are invisible.

Codes

Force roadkill-type collisions

The code below will turn many collisions (like with mailboxes, barrels, and orange-and-white signs) into roadkill collisions. The chunks will still be invisible.

Cruis'n USA (U) (V1.0)
Force many collisions to be roadkill collision
81040D08 0000
81040D0A 0000 
81041A20 0000
81041A22 0000
81041A2C 0000
81041A2E 0000

The first two lines force Template:Hex-type collision for those objects, and the last four keep the game from freezing.

One sign in Iowa explodes into chunks (other models)

The code below will make the first orange-and-white sign at the tollbooth in Iowa explode into chunks when you hit it. The chunks will be other models found in the stage. You must turn off racers and traffic before entering the race, and don't enable the codes until you can see the tollbooth in Iowa.

Cruis'n USA (U) (V1.0)
First orange and-white sign at Iowa tollbooth explodes into various models when hit
* Turn off Racers and Traffic before entering the race
* Don't enable these codes until you see the tollbooth
801FA36B 00F0
81045418 8015
8104541A 8FC4
81045428 8015
8104542A 8D5C
81045438 8015
8104543A 8E58
81045448 8015
8104544A 8DCC
81041A20 0000
81041A22 0000
81041A2C 0000
81041A2E 0000

The first line changes the collision type of that sign to Template:Hex. The next eight lines turn the invisible chunk models into other models. As before, the last four lines keep the game from freezing. This code will not work on other stages because of how models and objects move around in memory.

Details

When you run into the first orange-and-white sign in Iowa, the values for the roadkill chunk models are read from four places in memory:

address: value: model:
80045410: 00000000 no model
80045420: 00000000 no model
80045430: 00000000 no model
80045440: 00000000 no model

As you see, all four of these places normally have a value of 00000000, which is why the roadkill chunks are invisible.

Using the addresses above, the game creates roadkill chunks in this order upon collision. (Only showing the last two digits of each address):

10 20 20 30 40 10
10 20 20 30 40 10
10 20 20 30 40 10

That's a total of 18 roadkill chunks. All of the chunks are created during the same frame except the last one (italicized above), which is created during the next frame.