name: Mario Kart 64 US
sha1: 579c48e211ae952530ffc8738709f078d5dd215e
options:
  basename: mk64
  target_path: baserom.us.z64
  base_path: .
  compiler: IDO
  platform: n64
  target_path: baserom.us.z64
  build_path: build/us
  find_file_boundaries: True
  header_encoding: ASCII
  ld_script_path: mk64.us.ld
  asset_path: assets/us
  # platform: n64
  # undefined_funcs_auto: True
  # undefined_funcs_auto_path: undefined_funcs_auto.txt
  # undefined_syms_auto: True
  # undefined_syms_auto_path: undefined_syms_auto.txt
  # symbol_addrs_path: symbol_addrs.txt
  asm_path: asm/us
  # src_path: src
  # extensions_path: tools/splat_ext
  mips_abi_float_regs: o32
  section_order: [".text", ".data", ".rodata", ".bss"]
  # auto_all_sections: [".data", ".rodata", ".bss"]
segments:
  - name: header
    type: header
    start: 0x0

  - name: boot
    type: code
    start: 0x40
    vram: 0xA4000040
    subsegments:
    - [0x0040, asm, boot]
    - [0x0B70, bin, rspboot_font]
  - name: main
    type: code
    bss_size: 0x18985C
    start: 0x1000
    vram: 0x80000400
    subsegments:
      - [0x1000, asm, entry]
      - [0x1050, c, main]
      - [0x35B0, c, code_800029B0]
      - [0x4150, c, profiler]
      - [0x4CC0, c, crash_screen]
      - [0x5340, c, animation]
      - [0x5AF0, c, staff_ghosts]
      - [0x6BB0, asm, unused_overflow_check]
      - [0x6BD0, c, code_80005FD0]
      - [0x1D0D0, c, camera]
      - [0x20580, c, render_player]
      - [0x27C40, c, kart_dma]
      - [0x28900, c, code_80027D00]
      - [0x39FC0, c, spawn_players]
      - [0x3E840, c, code_8003DC40]
      - [0x40C30, asm, unused_mio0_decode]
      - [0x40CD0, asm, mio0_decode]
      - [0x411D0, asm, tkmk00_decode]
      - [0x41900, c, gbiMacro]
      - [0x41A50, c, math_util_2]
      - [0x43DB0, c, code_800431B0]
      - [0x58860, c, code_80057C60]
      - [0x6F5C0, c, code_8006E9C0]
      - [0x72B00, c, update_objects]
      - [0x87A70, c, code_80086E70]
      - [0x8CDD0, c, effects]
      - [0x920C0, c, code_800914A0]
      - [0x92350, c, code_80091750]
      - [0xB05B0, c, code_800AF9B0]
      - [0xB0F50, c, menus]
      - [0xB51E0, c, save]
      - [0xB77F0, c, audio/synthesis]
      - [0xB99E0, c, audio/heap]
      - [0xBB680, c, audio/load]
      - [0xBD170, c, audio/playback]
      - [0xBEA50, c, audio/effects]
      - [0xBF4F0, c, audio/seqplayer]
      - [0xC1FF0, c, audio/external]
      - [0xCBF30, c, audio/port_eu]
      - [0xCCB70, c, ../lib/src/osCreateThread]
      - [0xCCCC0, c, ../lib/src/osInitialize]
      - [0xCCF60, c, ../lib/src/osStartThread]
      - [0xCD0B0, c, ../lib/src/osCreateViManager] 
      - [0xCD450, c, ../lib/src/osViSetMode]
      - [0xCD4C0, c, ../lib/src/osViBlack]
      - [0xCD530, c, ../lib/src/osViSetSpecialFeatures]
      - [0xCD6F0, c, ../lib/src/osCreatePiManager]
      - [0xCD880, c, ../lib/src/osSetThreadPri]
      - [0xCD960, c, ../lib/src/osCreateMesgQueue]
      - [0xCD990, c, ../lib/src/osViSetEvent]
      - [0xCDA00, c, ../lib/src/osSetEventMesg]
      - [0xCDA70, c, ../lib/src/osSpTaskLoadGo]
      - [0xCDD30, c, ../lib/src/osContInit]
      - [0xCE0F0, c, ../lib/src/osContStartReadData]
      - [0xCE350, c, ../lib/src/osRecvMesg]
      - [0xCE490, asm, ../lib/asm/osWritebackDCacheAll]
      - [0xCE4C0, c, ../lib/src/osSendMesg]
      - [0xCE610, c, ../lib/src/osViSwapBuffer]
      - [0xCE660, asm, ../lib/asm/bzero]
      - [0xCE700, asm, ../lib/asm/osInvalICache]
      - [0xCE780, asm, ../lib/asm/osInvalDCache] # did this one
      - [0xCE830, c, ../lib/src/osPiStartDma] # didn't do this one
      - [0xCE940, c, ../lib/src/osSpTaskYield]
      - [0xCE960, c, ../lib/src/osSpTaskYielded]
      - [0xCE9E0, c, ../lib/src/osGetTime]
      - [0xCEA70, c, ../lib/src/math/llmuldiv] 
      - [0xCED30, c, ../lib/src/__osGetCurrFaultedThread]
      - [0xCED40, asm, ../lib/asm/sqrtf]
      - [0xCED50, c, ../lib/src/guOrthoF]
      - [0xCEF10, c, ../lib/src/osSetTime]
      - [0xCEF40, c, ../lib/src/osEepromProbe]
      - [0xCEFB0, c, ../lib/src/osPfsIsPlug]
      - [0xCF320, c, ../lib/src/osPfsInit]
      - [0xCF4E0, c, ../lib/src/osPfsNumFiles]
      - [0xCF630, c, ../lib/src/osPfsFileState]
      - [0xCF920, c, ../lib/src/osPfsFreeBlocks]
      - [0xCFA70, c, ../lib/src/guRotateF]
      - [0xCFC60, c, ../lib/src/guScaleF]
      - [0xCFD00, c, ../lib/src/guPerspectiveF]
      - [0xCFF90, c, ../lib/src/guLookAtF]
      - [0xD02C0, c, ../lib/src/guTranslateF]
      - [0xD0360, c, ../lib/src/osSyncPrintf]
      - [0xD03C0, c, ../lib/src/guMtxCatL]
      - [0xD0480, c, ../lib/src/osPfsSearchFile]
      - [0xD0640, c, ../lib/src/osPfsDeleteFile]
      - [0xD0C50, c, ../lib/src/osEepromLongWrite]
      - [0xD0D90, c, ../lib/src/osEepromLongRead]
      - [0xD0ED0, c, ../lib/src/osPfsReadWriteFile]
      - [0xD13D0, c, ../lib/src/osPfsAllocateFile]
      - [0xD1B80, c, ../lib/src/osAiSetFrequency]
      - [0xD1CE0, c, ../lib/src/osAiGetLength]
      - [0xD1CF0, c, ../lib/src/osAiSetNextBuffer]
      - [0xD1DA0, c, ../lib/src/osGetCount]
      - [0xD1DB0, asm, ../lib/asm/__osException]
      - [0xD26B0, asm, ../lib/asm/__osDisableInt]
      - [0xD26D0, asm, ../lib/asm/__osRestoreInt]
      - [0xD26F0, c, ../lib/src/__osDequeueThread]
      - [0xD2730, asm, ../lib/asm/__osSetSR]
      - [0xD2740, asm, ../lib/asm/__osGetSR]
      - [0xD2750, asm, ../lib/asm/__osSetFpcCsr]
      - [0xD2760, c, ../lib/src/__osSiRawReadIo]
      - [0xD27B0, c, ../lib/src/__osSiRawWriteIo]
      - [0xD2800, asm, ../lib/asm/osWritebackDCache]
      - [0xD2880, asm, ../lib/asm/osMapTLBRdb]
      - [0xD28E0, c, ../lib/src/osPiRawReadIo]
      - [0xD2940, c, ../lib/src/__osSetHWIntrRoutine]
      - [0xD2990, c, ../lib/src/__osLeoInterrupt]
      - [0xD3210, c, ../lib/src/osTimer]
      - [0xD3610, c, ../lib/src/osGetThreadPri]
      - [0xD3630, c, ../lib/src/__osViInit]
      - [0xD3780, c, ../lib/src/__osViGetCurrentContext]
      - [0xD3790, c, ../lib/src/__osViSwapContext]
      - [0xD3AF0, c, ../lib/src/__osPiCreateAccessQueue]
      - [0xD3BB0, c, ../lib/src/osPiRawStartDma]
      - [0xD3C90, c, ../lib/src/osEPiRawStartDma]
      - [0xD3D70, c, ../lib/src/__osDevMgrMain]
      - [0xD4120, c, ../lib/src/bcopy]
      - [0xD4430, c, ../lib/src/osVirtualToPhysical]
      - [0xD44B0, c, ../lib/src/__osSpSetStatus]
      - [0xD44C0, c, ../lib/src/__osSpSetPc]
      - [0xD4500, c, ../lib/src/__osSpRawStartDma]
      - [0xD4590, c, ../lib/src/__osSpDeviceBusy]
      - [0xD45C0, c, ../lib/src/osSetTimer]
      - [0xD46A0, c, ../lib/src/__osSiRawStartDma]
      - [0xD4750, c, ../lib/src/__osSiCreateAccessQueue]
      - [0xD4810, c, ../lib/src/osJamMesg]
      - [0xD4960, c, ../lib/src/osPiGetCmdQueue]
      - [0xD4990, c, ../lib/src/__osSpGetStatus]
      - [0xD49A0, c, ../lib/src/guMtxF2L]
      - [0xD4C10, c, ../lib/src/osEepromWrite]
      - [0xD50F0, c, ../lib/src/contpfs]
      - [0xD5E50, c, ../lib/src/osPfsChecker]
      - [0xD68B0, c, ../lib/src/contramread]
      - [0xD6C60, c, ../lib/src/guNormalize]
      - [0xD6CF0, c, ../lib/src/math/sinf]
      - [0xD6EB0, c, ../lib/src/math/cosf]
      - [0xD7020, c, ../lib/src/_Printf]
      - [0xD7CE0, c, ../lib/src/guMtxCatF]
      - [0xD7EF0, c, ../lib/src/contramwrite]
      - [0xD82A0, c, ../lib/src/osEepromRead]
      - [0xD85A0, c, ../lib/src/__osAiDeviceBusy]
      - [0xD85D0, asm, ../lib/asm/osSetIntMask]
      - [0xD8670, c, ../lib/src/osDestroyThread]
      - [0xD8770, c, ../lib/src/__osSiDeviceBusy]
      - [0xD87A0, c, ../lib/src/osLeoDiskInit]
      - [0xD8890, asm, ../lib/asm/__osSetCompare]
      - [0xD88A0, c, ../lib/src/__osResetGlobalIntMask]
      - [0xD8900, c, ../lib/src/__osEPiRawWriteIo]
      - [0xD8950, c, ../lib/src/osYieldThread]
      - [0xD89A0, asm, ../lib/asm/__osProbeTLB]
      - [0xD8A60, c, ../lib/src/crc]
      - [0xD8BE0, c, ../lib/src/string]
      - [0xD8C80, c, ../lib/src/_Litob]
      - [0xD8F20, c, ../lib/src/_Ldtob]
      - [0xD99E0, c, ../lib/src/ldiv]
      - [0xD9B70, bin, lib/PR/boot/F3D_boot]
      - [0xD9C40, bin, lib/PR/f3dex/F3DEX]
      - [0xDB020, bin, lib/PR/f3dlx/F3DLX]
      - [0xDC430, bin, lib/PR/audio/aspMain]
      - [0xDD0D0, data, data_main]
      - [0xDD274, bin, textures/crash_screen/crash_screen_font]
      - [0xEC358, rodata, rodata_main]
      - [0xF4900, bin, lib/PR/f3d/F3DEX_data]
      - [0xF5100, bin, lib/PR/f3d/F3DLX_data]
      - [0xF5900, bin, lib/PR/audio/aspMain_data]
  - name: seg2
    type: code
    bss_size: 0xFD180 # 0x3F460
    start: 0xF7510
    vram: 0x8028DF00
    subsegments:
      - [0xF7510, c, race_logic]
      - [0xFA230, c, render_courses]
      - [0x100060, c, actors]
      - [0x10CD40, c, skybox_and_splitscreen]
      - [0x111180, c, memory]
      - [0x114080, c, code_802AAA70]
      - [0x119820, c, actors_extended]
      - [0x11E570, c, math_util]
      - [0x121DA0, data, data_seg2]
      #- [0x1227D0, data, race_logic]   # race_logic .data location messed up?!?
      #- [0x1227F0, rodata, race_logic]
      - [0x1227D0, rodata, race_logic]
      - [0x1228D0, rodata, render_courses]
      - [0x122B10, rodata, actors]
      - [0x1231C0, rodata, skybox_and_splitscreen]
      - [0x123240, rodata, memory]
      - [0x123410, rodata, code_802AAA70]
      - [0x123490, rodata, actors_extended]
      - [0x1235C0, rodata, math_util]
      - [0x123640, hasm, bss_seg2]
  - name: credits
    type: code
    bss_size: 0x1A0
    start: 0x123640 # end: 0x12B360
    vram: 0x80280000
    subsegments:
    - [0x123640, c, code_80280000]
    - [0x123C90, c, code_80280650]
    - [0x124C50, c, camera_junk]
    - [0x124DC0, c, code_80281780]
    - [0x125280, c, code_80281C40]
    - [0x1255E0, c, ceremony_and_credits]
    - [0x128480, data, data_credits]
    - [0x12A1B0, rodata, code_80280650]
    - [0x12A1D0, rodata, camera_junk]
    - [0x12A1F0, rodata, credits]
    - [0x12AAB0, rodata, ceremony_and_credits]
    - [0x12AAE0, bss, bss_credits]

  - [0xC00000] # end of rom
