1
0
Fork 0
This repository has been archived on 2024-02-06. You can view files and clone it, but cannot push or open issues or pull requests.
Super-Mario-Sunshine-C-Kit/build.bat
sup39 c74a9da83b Restructure for all version
Rearrange linker script (in /linker)
Delete unnecessary files
Use extern instead of static in sms.h
2021-12-17 06:33:16 +09:00

39 lines
2 KiB
Batchfile

@echo off
IF [%2]==[] (SET lang=JP) ELSE (SET lang=%2)
:: compile
C:\devkitPro\devkitPPC\bin\powerpc-eabi-gcc.exe "%1" -D "SMS_LANG_%lang%" -I "%~p0\include" -S -o "%~n1.s" -O1 -std=c99
IF ERRORLEVEL 1 GOTO END
C:\devkitPro\devkitPPC\bin\powerpc-eabi-gcc.exe "%~n1.s" -c -o "%~n1.o"
IF ERRORLEVEL 1 GOTO END
:: link
IF EXIST "%~n1.ld" SET LDFLAGS=-T "%~n1.ld"
C:\devkitPro\devkitPPC\bin\powerpc-eabi-ld.exe -Os -T "%~p0\linker\SMS-%lang%.ld" -T "%~p0\linker\alias.ld" -T "%~p0\linker\extra.ld" %LDFLAGS% -T "%~p0\linker\gecko.ld" -o "obj_%~n1.o" "%~n1.o" -Map "%~n1.map"
IF ERRORLEVEL 1 GOTO END
:: print
C:\devkitPro\devkitPPC\bin\powerpc-eabi-objdump.exe "obj_%~n1.o" --full-content
C:\devkitPro\devkitPPC\bin\powerpc-eabi-objcopy.exe "obj_%~n1.o" "%~n1.bin" -O binary -R .eh_frame -R .comment -R .sdata -R .gnu.attributes -g -S
:: bin2gecko
IF "%lang%"=="EU" GOTO bin2gecko_EU
IF "%lang%"=="JP" GOTO bin2gecko_JP
IF "%lang%"=="US" GOTO bin2gecko_US
echo bin2gecko for language [%lang%] is not implemented
GOTO END
:bin2gecko_EU
bin2gecko.exe "%~n1.bin" -m "%~n1.map" -c OnUpdate:0x8029e070:3 -c OnSetup:0x80291750:0 -c OnDraw2D:0x80138b50:0 -c OnWaterHitsGround:0x80277568:0 -c OnObjectTouchMario:0x801a81b4:3 -c OnAllNPCsUpdate:0x8003e140:0 -c OnSmallEnemyHitMario:0x80065e0c:3 -r OnEMarioControl:0x8003ff5c -r IsMario:0x80245898
GOTO END
:bin2gecko_JP
bin2gecko.exe "%~n1.bin" -m "%~n1.map" -c OnUpdate:0x800f9b64:3 -c OnSetup:0x800ece3c:0 -c OnDraw2D:0x80206734:0 -c OnWaterHitsGround:0x8015ebf8:0 -c OnObjectTouchMario:0x801886d8:3 -c OnAllNPCsUpdate:0x80251d50:0 -c OnSmallEnemyHitMario:0x8027f64c:3 -r OnEMarioControl:0x80253ac0 -r IsMario:0x8012cfe0
GOTO END
:bin2gecko_US
bin2gecko.exe "%~n1.bin" -m "%~n1.map" -c OnUpdate:0x802a6160:3 -c OnSetup:0x802998b8:0 -c OnDraw2D:0x80143f14:0 -c OnWaterHitsGround:0x8027f7dc:0 -c OnObjectTouchMario:0x801b02fc:3 -c OnAllNPCsUpdate:0x8003e2f0:0 -c OnSmallEnemyHitMario:0x8006c76c:3 -r OnEMarioControl:0x8004010c -r IsMario:0x8024db0c
GOTO END
:END
pause