Skip to content

Commit

Permalink
Added another animation constant. Fixed build on case-insensitive mod…
Browse files Browse the repository at this point in the history
…e for Linux.
  • Loading branch information
marzojr authored and marzojr committed Jul 4, 2012
1 parent 640db9a commit 47157a4
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 7 deletions.
68 changes: 68 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/bin/bash

check_source_files()
{
if [[ ! -f "$1" ]]; then
echo "Extracting source files..."
unzip build_source &> /dev/null
fi
}

[[ ! -d bin ]] && mkdir bin

if [[ ! -f bin/s2p2bin ]]; then
echo "Compiling s2p2bin..."
check_source_files build_source/s2p2bin.cpp
check_source_files build_source/KensSaxComp/S-Compressor.cpp
g++ -O3 -s -o bin/s2p2bin build_source/s2p2bin.cpp build_source/KensSaxComp/S-Compressor.cpp &> /dev/null
fi

if [[ ! -f bin/fixpointer ]]; then
echo "Compiling fixpointer..."
check_source_files build_source/fixpointer.cpp
g++ -O3 -s -o bin/fixpointer build_source/fixpointer.cpp &> /dev/null
fi

if [[ ! -f bin/fixheader ]]; then
echo "Compiling fixheader..."
check_source_files build_source/fixheader.cpp
g++ -O3 -s -o bin/fixheader build_source/fixheader.cpp &> /dev/null
fi

[[ -f s2.bin ]] && mv -f s2.bin s2.prev.bin
rm -f s2.p s2.h s2.log

debug_syms=""
print_err="-E -q"

for n in `seq 1 2`; do
if [[ "$1" == "-ds" ]]; then
debug_syms="-g MAP"
echo "Will generate debug symbols"
elif [[ "$1" == "-pe" ]]; then
print_err=""
echo "Selected detailed assembler output"
fi
shift
done

echo Assembling...

asl -xx -c $debug_syms $print_err -A -U s2.asm

if [[ -f s2.log ]]; then
echo
echo "*****************************************"
echo "* *"
echo "* There were build errors/warnings. *"
echo "* *"
echo "*****************************************"
echo
cat s2.log
exit 1
fi

[[ -f s2.p ]] && bin/s2p2bin s2.p s2.bin s2.h
[[ -f s2.bin ]] && bin/fixpointer s2.h s2built.bin off_3A294 MapRUnc_Sonic \$2D 0 4 word_728C_user Obj5F_MapUnc_7240 2 2 1
[[ -f s2.bin ]] && bin/fixheader s2.bin

2 changes: 1 addition & 1 deletion s2.asm
Original file line number Diff line number Diff line change
Expand Up @@ -32844,7 +32844,7 @@ SuperSonic_BalanceOnObjLeft:
bset #0,status(a0)

loc_1A57C:
move.b #6,anim(a0)
move.b #AniIDSonAni_Balance,anim(a0)
bra.s Obj01_ResetScr
; ---------------------------------------------------------------------------
; loc_1A584:
Expand Down
2 changes: 1 addition & 1 deletion s2.macros.asm
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ __LABEL__ zoneOrderedTable entryLen,zoneEntries

; macro to declare one or more entries in a zone-ordered table
zoneTableEntry macro value
if "VALUE"<>""
if "value"<>""
if zone_entries_left
dc.ATTRIBUTE value
zone_entries_left := zone_entries_left-1
Expand Down
10 changes: 5 additions & 5 deletions s2.macrosetup.asm
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ tracenum := 0

; 1-arg instruction that's self-patching to remove 0-offset optimization
insn1op macro oper,x
if (substr("x",0,2)<>"0(") && (substr("x",0,3)<>"ID(") && (substr("x",0,9)<>"SLOT_ROUT(")
if (substr("x",0,2)<>"0(") && (substr("x",0,3)<>"id(") && (substr("x",0,9)<>"slot_rout(")
!oper x
else
!oper 1+x
Expand All @@ -118,17 +118,17 @@ insn1op macro oper,x

; 2-arg instruction that's self-patching to remove 0-offset optimization
insn2op macro oper,x,y
if (substr("x",0,2)<>"0(") && (substr("x",0,3)<>"ID(") && (substr("x",0,10)<>"SLOT_ROUT(")
if (substr("y",0,2)<>"0(") && (substr("y",0,3)<>"ID(") && (substr("y",0,10)<>"SLOT_ROUT(")
if (substr("x",0,2)<>"0(") && (substr("x",0,3)<>"id(") && (substr("x",0,10)<>"slot_rout(")
if (substr("y",0,2)<>"0(") && (substr("y",0,3)<>"id(") && (substr("y",0,10)<>"slot_rout(")
!oper x,y
else
!oper x,1+y
!org *-1
!dc.b 0
endif
else
if substr("y",0,1)<>"D"
if (substr("y",0,2)<>"0(") && (substr("y",0,3)<>"ID(") && (substr("y",0,10)<>"SLOT_ROUT(")
if substr("y",0,1)<>"d"
if (substr("y",0,2)<>"0(") && (substr("y",0,3)<>"id(") && (substr("y",0,10)<>"slot_rout(")
start:
!oper 1+x,y
end:
Expand Down

0 comments on commit 47157a4

Please sign in to comment.