Skip to content

Commit

Permalink
minor cleanup and tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
felipesanches committed Mar 25, 2022
1 parent d5a8df4 commit 0edcae0
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 16 deletions.
7 changes: 7 additions & 0 deletions AWVM_trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
VIDEO2=0 # shared polygon resource
CINEMATIC=1 # level-specific bank of polygonal data


def get_text_string(str_id):
global str_data
try:
if not str_data:
str_data = open(f"{romset_dir}/str_data.rom", "rb").read()
Expand All @@ -36,6 +38,7 @@ def get_text_string(str_id):
the_string = f"string_{str_id}"
return the_string


LABELED_CINEMATIC_ENTRIES = {
0x9ADC: "SLUG_0",
0x9B04: "SLUG_1",
Expand All @@ -53,6 +56,7 @@ def get_text_string(str_id):
0x9D3C: "SLUG_13"
}


def register_cinematic_entry(x, y, zoom, address):
global cinematic_counter
if address in cinematic_entries.keys():
Expand Down Expand Up @@ -96,6 +100,7 @@ def print_video_entries():
v = video2_entries[addr]
print (f"VIDEO2: 0x{addr:04X} x:{v['x']} y:{v['y']} zoom:{v['zoom']}")


SPECIAL_PURPOSE_VARS = {
0x3c: "RANDOM_SEED",
0x54: "HACK_VAR_54",
Expand All @@ -119,9 +124,11 @@ def getVariableName(value):
else:
return "0x%02X" % value


def get_label(addr):
return "LABEL_%04X" % addr


class AWVM_Trace(ExecTrace):
def output_disasm_headers(self):
header = "; Generated by AnotherWorld_VMTools\n"
Expand Down
26 changes: 14 additions & 12 deletions build_and_run.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
MAME=~/mame/awvm64
SRC=disasm
MAME=./awvm
ROMS=~/ROM_DUMPS/FSanches/another_world_ROMs
TARGET=$ROMS/aw_msdos
SRC=disasm
TOOLCHAIN_DIR=`pwd`

./AWVM_assembler.py $SRC/level_0/level-0.asm
./AWVM_assembler.py $SRC/level_1/level-1.asm
./AWVM_assembler.py $SRC/level_2/level-2.asm
./AWVM_assembler.py $SRC/level_3/level-3.asm
./AWVM_assembler.py $SRC/level_4/level-4.asm
./AWVM_assembler.py $SRC/level_5/level-5.asm
./AWVM_assembler.py $SRC/level_6/level-6.asm
./AWVM_assembler.py $SRC/level_7/level-7.asm
./AWVM_assembler.py $SRC/level_8/level-8.asm
$TOOLCHAIN_DIR/AWVM_assembler.py $SRC/level_0/level-0.asm
$TOOLCHAIN_DIR/AWVM_assembler.py $SRC/level_1/level-1.asm
$TOOLCHAIN_DIR/AWVM_assembler.py $SRC/level_2/level-2.asm
$TOOLCHAIN_DIR/AWVM_assembler.py $SRC/level_3/level-3.asm
$TOOLCHAIN_DIR/AWVM_assembler.py $SRC/level_4/level-4.asm
$TOOLCHAIN_DIR/AWVM_assembler.py $SRC/level_5/level-5.asm
$TOOLCHAIN_DIR/AWVM_assembler.py $SRC/level_6/level-6.asm
$TOOLCHAIN_DIR/AWVM_assembler.py $SRC/level_7/level-7.asm
$TOOLCHAIN_DIR/AWVM_assembler.py $SRC/level_8/level-8.asm

cp $SRC/level_0/level-0.bin $TARGET/resource-0x15.bin
cp $SRC/level_1/level-1.bin $TARGET/resource-0x18.bin
Expand All @@ -23,4 +24,5 @@ cp $SRC/level_6/level-6.bin $TARGET/resource-0x27.bin
cp $SRC/level_7/level-7.bin $TARGET/resource-0x2a.bin
cp $SRC/level_8/level-8.bin $TARGET/resource-0x7e.bin

$MAME -rp $ROMS aw_msdos -window #-debug
cd ~/mame
$MAME -rp $ROMS aw_msdos -window -ui_active -debug
10 changes: 6 additions & 4 deletions example/build_and_run.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
MAME=~/mame/awvm64
EXAMPLE=bounce
MAME=./awvm
ROMS=~/ROM_DUMPS/FSanches/another_world_ROMs
TARGET=$ROMS/aw_msdos
SRC=disasm
EXAMPLE=bounce
TOOLCHAIN_DIR=`pwd`/..
EXAMPLE_DIR=$TOOLCHAIN_DIR/example/

../AWVM_assembler.py $EXAMPLE.asm && cp $EXAMPLE.bin $TARGET/resource-0x15.bin && $MAME -rp $ROMS aw_msdos -window #-debug
cd ~/mame
$TOOLCHAIN_DIR/AWVM_assembler.py $EXAMPLE_DIR/$EXAMPLE.asm && cp $EXAMPLE_DIR/$EXAMPLE.bin $TARGET/resource-0x15.bin && $MAME -rp $ROMS aw_msdos -window -ui_active #-debug

0 comments on commit 0edcae0

Please sign in to comment.