Replace assembly implementation with C implementation

This commit is contained in:
Ryan Dwyer 2019-09-07 16:12:32 +10:00
parent 0798f65bc3
commit c9dec5deac
284 changed files with 92353 additions and 85470 deletions

View File

@ -9,12 +9,23 @@ RELEASE=final
ROMID := $(REGION)-$(RELEASE)
E_DIR := extracted/$(ROMID)
B_DIR := build/$(ROMID)
S_FILES := $(wildcard asm/setup/*.s)
S_INC_FILES := $(wildcard asm/include/*.inc)
B_BIN_FILES := $(patsubst asm/setup/%.s, $(B_DIR)/files/U%, $(S_FILES))
E_BIN_FILES := $(patsubst asm/setup/%.s, $(E_DIR)/files/U%, $(S_FILES))
B_BINZ_FILES := $(patsubst asm/setup/%.s, $(B_DIR)/files/U%Z, $(S_FILES))
E_BINZ_FILES := $(patsubst asm/setup/%.s, $(E_DIR)/files/U%Z, $(S_FILES))
SETUP_FILES := $(wildcard src/setup/*.c)
SETUP_H_FILES := $(wildcard src/include/*.h)
B_BIN_FILES := $(patsubst src/setup/%.c, $(B_DIR)/files/U%, $(SETUP_FILES))
E_BIN_FILES := $(patsubst src/setup/%.c, $(E_DIR)/files/U%, $(SETUP_FILES))
B_BINZ_FILES := $(patsubst src/setup/%.c, $(B_DIR)/files/U%Z, $(SETUP_FILES))
E_BINZ_FILES := $(patsubst src/setup/%.c, $(E_DIR)/files/U%Z, $(SETUP_FILES))
QEMU_IRIX := tools/irix/qemu-irix
IRIX_ROOT := tools/irix/root
ifeq ($(shell type mips-linux-gnu-ld >/dev/null 2>/dev/null; echo $$?), 0)
TOOLCHAIN := mips-linux-gnu
else
TOOLCHAIN := mips64-elf
endif
CFLAGS := -Wo,-loopunroll,0 -Wab,-r4300_mul -non_shared -G 0 -Xcpluscomm -woff 819,820,852,821 -signed -I . -I include -mips2
default: $(B_BIN_FILES) $(B_DIR)/Uglobals
@ -42,15 +53,17 @@ testall:
################################################################################
# Stage setup files
$(B_DIR)/files/%.o: asm/setup/%.s $(S_INC_FILES)
$(B_DIR)/files/%.o: src/setup/%.c $(SETUP_H_FILES)
mkdir -p $(B_DIR)/files
aarch64-linux-gnu-as -EB -o $@ $<
$(QEMU_IRIX) -silent -L $(IRIX_ROOT) $(IRIX_ROOT)/usr/bin/cc -c $(CFLAGS) -o $@ -O2 $<
$(B_DIR)/files/%.elf: $(B_DIR)/files/%.o
aarch64-linux-gnu-ld -EB -e 0 -Tdata=0 -o $@ $<
cp $< build/setup.tmp.o
$(TOOLCHAIN)-ld -T setup.ld -o $@
rm -f build/setup.tmp.o
$(B_DIR)/files/U%: $(B_DIR)/files/%.elf
aarch64-linux-gnu-objcopy -O binary $< $@
$(TOOLCHAIN)-objcopy $< $@ -O binary
$(B_DIR)/files/U%Z: $(B_DIR)/files/U%
tools/rarezip $< > $@
@ -58,14 +71,17 @@ $(B_DIR)/files/U%Z: $(B_DIR)/files/U%
################################################################################
# Globals file
$(B_DIR)/Uglobals.o: asm/globals.s $(S_INC_FILES)
aarch64-linux-gnu-as -EB -o $@ $<
$(B_DIR)/globals.o: src/globals.c $(SETUP_H_FILES)
mkdir -p $(B_DIR)
$(QEMU_IRIX) -silent -L $(IRIX_ROOT) $(IRIX_ROOT)/usr/bin/cc -c $(CFLAGS) -o $@ -O2 $<
$(B_DIR)/Uglobals.elf: $(B_DIR)/Uglobals.o
aarch64-linux-gnu-ld -EB -e 0 -Tdata=0x80059fe0 -o $@ $<
$(B_DIR)/globals.elf: $(B_DIR)/globals.o
cp $< build/globals.tmp.o
$(TOOLCHAIN)-ld -e 0x80059fe0 -T globals.ld -o $@
rm -f build/globals.tmp.o
$(B_DIR)/Uglobals: $(B_DIR)/Uglobals.elf
aarch64-linux-gnu-objcopy -O binary $< $@
$(B_DIR)/Uglobals: $(B_DIR)/globals.elf
$(TOOLCHAIN)-objcopy $< $@ -O binary
################################################################################
# Miscellaneous

View File

@ -1,42 +1,36 @@
# Perfect Dark Setup Decompilation
# Perfect Dark Decompilation (WIP)
This repository contains a decompilation of the level setup files used in Perfect Dark for the Nintendo 64.
This repository contains a work-in-progress decompilation of Perfect Dark for the Nintendo 64. So far only the stage setup files are decompiled.
## Come again?
## I have no idea what you're talking about
It's known that Perfect Dark (and GoldenEye) use a custom made binary scripting language to set up the levels. See the GE/PD Function Explorer and the GoldenEye Setup Editor. However, the specifics of how it works has been difficult to explore. Until now.
I've realised that Rare likely did their level setup and scripting with assembly macros. The giveaway was the U prefix on the setup filename, which is also a common prefix for compiled machine code (ucode). So I made a tool that would read the binaries and generate some assembly files which can be compiled back into those exact same binaries. Once I got it matching, I started annotating each setup file, discovering new commands and renaming symbols.
## I still have no idea what you're talking about
Go have a look at the level scripts in the asm/setup directory. Here's a mapping table for your convenience:
Go have a look at the level scripts in the src/setup directory. Here's a mapping table for your convenience:
| Stage | File |
| ---------------- | ------------------------------------ |
| Defection | [setupame.s](asm/setup/setupame.s) |
| Investigation | [setupear.s](asm/setup/setupear.s) |
| Extraction | [setupark.s](asm/setup/setupark.s) |
| Villa | [setupeld.s](asm/setup/setupeld.s) |
| Chicago | [setuppete.s](asm/setup/setuppete.s) |
| G5 Building | [setupdepo.s](asm/setup/setupdepo.s) |
| Infiltration | [setuplue.s](asm/setup/setuplue.s) |
| Rescue | [setuplip.s](asm/setup/setuplip.s) |
| Escape | [setuptra.s](asm/setup/setuptra.s) |
| Air Base | [setupcave.s](asm/setup/setupcave.s) |
| Air Force One | [setuprit.s](asm/setup/setuprit.s) |
| Crash Site | [setupazt.s](asm/setup/setupazt.s) |
| Pelagic II | [setupdam.s](asm/setup/setupdam.s) |
| Deep Sea | [setuppam.s](asm/setup/setuppam.s) |
| Defense | [setupimp.s](asm/setup/setupimp.s) |
| Attack Ship | [setuplee.s](asm/setup/setuplee.s) |
| Skedar Ruins | [setupsho.s](asm/setup/setupsho.s) |
| MBR | [setupwax.s](asm/setup/setupwax.s) |
| Maian SOS | [setupsev.s](asm/setup/setupsev.s) |
| WAR! | [setupstat.s](asm/setup/setupstat.s) |
| The Duel | [setupate.s](asm/setup/setupate.s) |
| CI Training | [setupdish.s](asm/setup/setupdish.s) |
| Global Functions | [globals.s](asm/globals.s) |
| Defection | [setupame.c](src/setup/setupame.c) |
| Investigation | [setupear.c](src/setup/setupear.c) |
| Extraction | [setupark.c](src/setup/setupark.c) |
| Villa | [setupeld.c](src/setup/setupeld.c) |
| Chicago | [setuppete.c](src/setup/setuppete.c) |
| G5 Building | [setupdepo.c](src/setup/setupdepo.c) |
| Infiltration | [setuplue.c](src/setup/setuplue.c) |
| Rescue | [setuplip.c](src/setup/setuplip.c) |
| Escape | [setuptra.c](src/setup/setuptra.c) |
| Air Base | [setupcave.c](src/setup/setupcave.c) |
| Air Force One | [setuprit.c](src/setup/setuprit.c) |
| Crash Site | [setupazt.c](src/setup/setupazt.c) |
| Pelagic II | [setupdam.c](src/setup/setupdam.c) |
| Deep Sea | [setuppam.c](src/setup/setuppam.c) |
| Defense | [setupimp.c](src/setup/setupimp.c) |
| Attack Ship | [setuplee.c](src/setup/setuplee.c) |
| Skedar Ruins | [setupsho.c](src/setup/setupsho.c) |
| MBR | [setupwax.c](src/setup/setupwax.c) |
| Maian SOS | [setupsev.c](src/setup/setupsev.c) |
| WAR! | [setupstat.c](src/setup/setupstat.c) |
| The Duel | [setupate.c](src/setup/setupate.c) |
| CI Training | [setupdish.c](src/setup/setupdish.c) |
| Global Functions | [globals.c](src/globals.c) |
There is also a stagetable.txt in the repository root which includes multiplayer stages.
@ -51,24 +45,20 @@ You can use this to make mods without having to deal with the GE Setup Editor's
Install the following:
* make
* aarch64 build tools (aarch64-linux-gnu-as, aarch64-linux-gnu-ld, aarch64-linux-gnu-objcopy)
* mips build tools (Debian/Ubuntu: binutils-mips-linux-gnu, Arch: mips64-elf-binutils from AUR)
* Python 3
Then:
1. Save your existing ROM file into the root of the repository with the name `pd.ntsc-final.z64`. It should not be byteswapped (the first four bytes should be `0x80371240`).
2. Edit a setup file. Open up `asm/setup/setupame.s` (Defection), find the function `func0422_intro` and add `explosions_around_chr CHR_JOANNA` as the first statement.
2. Edit a setup file. Open up `src/setup/setupame.c` (Defection), find the symbol `func0422_intro` and add `explosions_around_chr(CHR_JOANNA)` as the first statement.
3. Run `make rom`. This will create a ROM file at `build/ntsc-final/pd.z64`.
4. Play the ROM.
5. Start Defection, watch the intro and admire Joanna jumping from the dropship into a sea of explosions to her fiery death.
## Wait, aarch64? Isn't that ARM?
Yeah. I originally used mips64, but the binaries it created were padded and therefore incorrect. I couldn't figure out how to change that with modern versions of the mips build tools and I didn't want to waste too much time on that aspect of it. Because there's no actual opcodes being generated, the architecture isn't really important. I just needed something that worked and was big endian (so x64_64 was out of the question too).
## Where's the list of commands? Is there a reference?
See `asm/include/commands.inc` and `asm/include/constants.inc` for a start.
See `src/include/commands.h` and `src/include/constants.h` for a start.
## Whats with all this beginloop and endloop stuff?
@ -82,7 +72,7 @@ I also added a `reloop` macro, which is selectively used to replace a `goto_firs
Well, yes but no. They won't be injected into the ROM because I'm lazy and haven't written code to do that. The stage files will though.
The global functions are at asm/globals.s.
The global functions are at src/globals.c.
## How much stuff can I add before I run out of space?

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,47 +0,0 @@
# vi: ft=asm
.macro spawn pad
.word 0x00000000
.word \pad
.word 0
.endm
.macro intro_weapon weapon u1
.word 0x00000001
.word \weapon
.word \u1
.word 0
.endm
.macro ammo ammotype value
.word 0x00000002
.word \ammotype
.word \value
.word 0
.endm
.macro outfit outfit
.word 0x00000005
.word \outfit
.endm
.macro case id pad
.word 0x00000009
.word \id
.word \pad
.endm
.macro case_respawn id pad
.word 0x0000000a
.word \id
.word \pad
.endm
.macro hill room
.word 0x0000000b
.word \room
.endm
.macro endintro
.word 0x0000000c
.endm

View File

@ -1,27 +0,0 @@
# vi: ft=asm
.macro register_path label id param
.word \label
.byte \id
.byte \param
.short 0
.endm
.macro endpaths
.word 0
.word 0
.endm
.macro beginpath id flags
.byte \id
.byte 0
.short \flags
.endm
.macro pad pad_id
.word \pad_id
.endm
.macro endpath
.word 0xffffffff
.endm

View File

@ -1,704 +0,0 @@
# vi: ft=asm
// Only used within this file
.macro generic_object model pad props1 props2 u1 u2 u3 u4 u5 u6 u7 u8 u9 u10 u11 u12 u13 u14 u15 u16 u17 u18 u19
.short \model
.short \pad
.word \props1
.word \props2
.word \u1
.word \u2
.word \u3
.word \u4
.word \u5
.word \u6
.word \u7
.word \u8
.word \u9
.word \u10
.word \u11
.word \u12
.word \u13
.word \u14
.word \u15
.word \u16
.word \u17
.word \u18
.word \u19
.endm
.macro door scale model pad props1 props2 u1 u2 u3 u4 u5 u6 u7 u8 u9 u10 u11 u12 u13 u14 u15 u16 u17 u18 u19 u20 u21 u22 u23 u24 u25 u26 u27 u28 u29 u30 u31 u32 u33 u34 u35 u36 u37 u38 u39 u40 u41 u42 u43 u44 u45 u46 u47 u48 u49 u50 u51
.short \scale
.short 0x0001
generic_object \model \pad \props1 \props2 \u1 \u2 \u3 \u4 \u5 \u6 \u7 \u8 \u9 \u10 \u11 \u12 \u13 \u14 \u15 \u16 \u17 \u18 \u19
.word \u20
.word \u21
.word \u22
.word \u23
.word \u24
.word \u25
.word \u26
.word \u27
.word \u28
.word \u29
.word \u30
.word \u31
.word \u32
.word \u33
.word \u34
.word \u35
.word \u36
.word \u37
.word \u38
.word \u39
.word \u40
.word \u41
.word \u42
.word \u43
.word \u44
.word \u45
.word \u46
.word \u47
.word \u48
.word \u49
.word \u50
.word \u51
.endm
.macro door_scale scale
.word 0x00000002
.word \scale
.endm
.macro object scale model pad props1 props2 u1 u2 u3 u4 u5 u6 u7 u8 u9 u10 u11 u12 u13 u14 u15 u16 u17 u18 u19
.short \scale
.short 0x0003
generic_object \model \pad \props1 \props2 \u1 \u2 \u3 \u4 \u5 \u6 \u7 \u8 \u9 \u10 \u11 \u12 \u13 \u14 \u15 \u16 \u17 \u18 \u19
.endm
.macro key scale model pad props1 props2 u1 u2 u3 u4 u5 u6 u7 u8 u9 u10 u11 u12 u13 u14 u15 u16 u17 u18 u19 lockbits
.short \scale
.short 0x0004
generic_object \model \pad \props1 \props2 \u1 \u2 \u3 \u4 \u5 \u6 \u7 \u8 \u9 \u10 \u11 \u12 \u13 \u14 \u15 \u16 \u17 \u18 \u19
.word \lockbits
.endm
.macro camera scale model pad props1 props2 u1 u2 u3 u4 u5 u6 u7 u8 u9 u10 u11 u12 u13 u14 u15 u16 u17 u18 u19 u20 u21 u22 u23 u24 u25 u26 u27 u28 u29 u30 u31 u32 u33 u34 u35 u36 u37 u38 u39 u40 u41 u42 u43 u44 u45
.short \scale
.short 0x0006
generic_object \model \pad \props1 \props2 \u1 \u2 \u3 \u4 \u5 \u6 \u7 \u8 \u9 \u10 \u11 \u12 \u13 \u14 \u15 \u16 \u17 \u18 \u19
.word \u20
.word \u21
.word \u22
.word \u23
.word \u24
.word \u25
.word \u26
.word \u27
.word \u28
.word \u29
.word \u30
.word \u31
.word \u32
.word \u33
.word \u34
.word \u35
.word \u36
.word \u37
.word \u38
.word \u39
.word \u40
.word \u41
.word \u42
.word \u43
.word \u44
.word \u45
.endm
.macro weapon scale model chr props1 props2 u1 u2 u3 u4 u5 u6 u7 u8 u9 u10 u11 u12 u13 u14 u15 u16 u17 u18 u19 weapon u20 u21
.short \scale
.short 0x0008
generic_object \model \chr \props1 \props2 \u1 \u2 \u3 \u4 \u5 \u6 \u7 \u8 \u9 \u10 \u11 \u12 \u13 \u14 \u15 \u16 \u17 \u18 \u19
.byte \weapon
.byte 0
.short 0
.word \u20
.word \u21
.endm
.macro ammocrate scale model pad props1 props2 u1 u2 u3 u4 u5 u6 u7 u8 u9 u10 u11 u12 u13 u14 u15 u16 u17 u18 u19 ammotype
.short \scale
.short 0x0007
generic_object \model \pad \props1 \props2 \u1 \u2 \u3 \u4 \u5 \u6 \u7 \u8 \u9 \u10 \u11 \u12 \u13 \u14 \u15 \u16 \u17 \u18 \u19
.word \ammotype
.endm
.macro chr unk1 id pad body head function target_pad target_chr hear_dist view_dist props1 bank1flags alliance group chair group2 associated
.word 0x00000009
.word \unk1
.short \id
.short \pad
.byte \body
.byte \head
.short \function
.short \target_pad
.short \target_chr
.short \hear_dist
.short \view_dist
.word \props1
.word \bank1flags
.byte \alliance
.byte \group
.short \chair
.word \group2
.word \associated
.endm
.macro singlemonitor scale model pad props1 props2 u1 u2 u3 u4 u5 u6 u7 u8 u9 u10 u11 u12 u13 u14 u15 u16 u17 u18 u19 u20 u21 u22 u23 u24 u25 u26 u27 u28 u29 u30 u31 u32 u33 u34 u35 u36 u37 u38 u39 u40 u41 u42 u43 u44 u45 u46 u47 u48 u49
.short \scale
.short 0x000a
generic_object \model \pad \props1 \props2 \u1 \u2 \u3 \u4 \u5 \u6 \u7 \u8 \u9 \u10 \u11 \u12 \u13 \u14 \u15 \u16 \u17 \u18 \u19
.word \u20
.word \u21
.word \u22
.word \u23
.word \u24
.word \u25
.word \u26
.word \u27
.word \u28
.word \u29
.word \u30
.word \u31
.word \u32
.word \u33
.word \u34
.word \u35
.word \u36
.word \u37
.word \u38
.word \u39
.word \u40
.word \u41
.word \u42
.word \u43
.word \u44
.word \u45
.word \u46
.word \u47
.word \u48
.word \u49
.endm
.macro multimonitor scale model pad props1 props2 u1 u2 u3 u4 u5 u6 u7 u8 u9 u10 u11 u12 u13 u14 u15 u16 u17 u18 u19 u20 u21 u22 u23 u24 u25 u26 u27 u28 u29 u30 u31 u32 u33 u34 u35 u36 u37 u38 u39 u40 u41 u42 u43 u44 u45 u46 u47 u48 u49 u50 u51 u52 u53 u54 u55 u56 u57 u58 u59 u60 u61 u62 u63 u64 u65 u66 u67 u68 u69 u70 u71 u72 u73 u74 u75 u76 u77 u78 u79 u80 u81 u82 u83 u84 u85 u86 u87 u88 u89 u90 u91 u92 u93 u94 u95 u96 u97 u98 u99 u100 u101 u102 u103 u104 u105 u106 u107 u108 u109 u110 u111 u112 u113 u114 u115 u116 u117 u118 u119 u120 u121 u122 u123 u124 u125 u126 u127 u128 u129 u130 u131 u132 u133 u134 u135 u136
.short \scale
.short 0x000b
generic_object \model \pad \props1 \props2 \u1 \u2 \u3 \u4 \u5 \u6 \u7 \u8 \u9 \u10 \u11 \u12 \u13 \u14 \u15 \u16 \u17 \u18 \u19
.word \u20
.word \u21
.word \u22
.word \u23
.word \u24
.word \u25
.word \u26
.word \u27
.word \u28
.word \u29
.word \u30
.word \u31
.word \u32
.word \u33
.word \u34
.word \u35
.word \u36
.word \u37
.word \u38
.word \u39
.word \u40
.word \u41
.word \u42
.word \u43
.word \u44
.word \u45
.word \u46
.word \u47
.word \u48
.word \u49
.word \u50
.word \u51
.word \u52
.word \u53
.word \u54
.word \u55
.word \u56
.word \u57
.word \u58
.word \u59
.word \u60
.word \u61
.word \u62
.word \u63
.word \u64
.word \u65
.word \u66
.word \u67
.word \u68
.word \u69
.word \u70
.word \u71
.word \u72
.word \u73
.word \u74
.word \u75
.word \u76
.word \u77
.word \u78
.word \u79
.word \u80
.word \u81
.word \u82
.word \u83
.word \u84
.word \u85
.word \u86
.word \u87
.word \u88
.word \u89
.word \u90
.word \u91
.word \u92
.word \u93
.word \u94
.word \u95
.word \u96
.word \u97
.word \u98
.word \u99
.word \u100
.word \u101
.word \u102
.word \u103
.word \u104
.word \u105
.word \u106
.word \u107
.word \u108
.word \u109
.word \u110
.word \u111
.word \u112
.word \u113
.word \u114
.word \u115
.word \u116
.word \u117
.word \u118
.word \u119
.word \u120
.word \u121
.word \u122
.word \u123
.word \u124
.word \u125
.word \u126
.word \u127
.word \u128
.word \u129
.word \u130
.word \u131
.word \u132
.word \u133
.word \u134
.word \u135
.word \u136
.endm
.macro autogun scale model pad props1 props2 u1 u2 u3 u4 u5 u6 u7 u8 u9 u10 u11 u12 u13 u14 u15 u16 u17 u18 u19 u20 u21 u22 u23 u24 u25 u26 u27 u28 u29 u30 u31 u32 u33 u34 u35 u36 u37 u38 u39
.short \scale
.short 0x000d
generic_object \model \pad \props1 \props2 \u1 \u2 \u3 \u4 \u5 \u6 \u7 \u8 \u9 \u10 \u11 \u12 \u13 \u14 \u15 \u16 \u17 \u18 \u19
.word \u20
.word \u21
.word \u22
.word \u23
.word \u24
.word \u25
.word \u26
.word \u27
.word \u28
.word \u29
.word \u30
.word \u31
.word \u32
.word \u33
.word \u34
.word \u35
.word \u36
.word \u37
.word \u38
.word \u39
.endm
.macro link_collectibles a b
.word 0x0000000e
.short \a
.short \b
.endm
.macro debris scale model pad props1 props2 u1 u2 u3 u4 u5 u6 u7 u8 u9 u10 u11 u12 u13 u14 u15 u16 u17 u18 u19
.short \scale
.short 0x000f
generic_object \model \pad \props1 \props2 \u1 \u2 \u3 \u4 \u5 \u6 \u7 \u8 \u9 \u10 \u11 \u12 \u13 \u14 \u15 \u16 \u17 \u18 \u19
.endm
.macro link_objects u1 u2 u3 u4
.word 0x00000013
.word \u1
.word \u2
.word \u3
.word \u4
.endm
.macro ammocratemulti scale model pad props1 props2 u1 u2 u3 u4 u5 u6 u7 u8 u9 u10 u11 u12 u13 u14 u15 u16 u17 u18 u19 u20 u21 u22 u23 u24 u25 u26 u27 u28 u29 u30 u31 u32 u33 u34 u35 u36 u37 u38
.short \scale
.short 0x0014
generic_object \model \pad \props1 \props2 \u1 \u2 \u3 \u4 \u5 \u6 \u7 \u8 \u9 \u10 \u11 \u12 \u13 \u14 \u15 \u16 \u17 \u18 \u19
.word \u20
.word \u21
.word \u22
.word \u23
.word \u24
.word \u25
.word \u26
.word \u27
.word \u28
.word \u29
.word \u30
.word \u31
.word \u32
.word \u33
.word \u34
.word \u35
.word \u36
.word \u37
.word \u38
.endm
.macro shield scale model pad props1 props2 u1 u2 u3 u4 u5 u6 u7 u8 u9 u10 u11 u12 u13 u14 u15 u16 u17 u18 u19 u20 u21 u22
.short \scale
.short 0x0015
generic_object \model \pad \props1 \props2 \u1 \u2 \u3 \u4 \u5 \u6 \u7 \u8 \u9 \u10 \u11 \u12 \u13 \u14 \u15 \u16 \u17 \u18 \u19
.word \u20
.word \u21
.word \u22
.endm
.macro tag id value
.word 0x00000016
.short \id
.short \value
.word 0
.word 0
.endm
.macro beginobjective value text diffbit
.word 0x00000017
.word \value
.word \text
.word \diffbit
.endm
.macro endobjective
.word 0x00000018
.endm
.macro require_object_destroyed object
.word 0x00000019
.word \object
.endm
.macro complete_flags stageflag
.word 0x0000001a
.word \stageflag
.endm
.macro fail_flags stageflag
.word 0x0000001b
.word \stageflag
.endm
.macro require_object_collected object
.word 0x0000001c
.word \object
.endm
.macro require_object_thrown object
.word 0x0000001d
.word \object
.endm
.macro require_object_holographed object u1 u2
.word 0x0000001e
.word \object
.word \u1
.word \u2
.endm
.macro require_room_entered room
.word 0x00000020
.word \room
.endm
.macro require_object_thrown_on_target throw_object target_object u1
.word 0x00000021
.word \throw_object
.word \target_object
.word \u1
.endm
.macro briefing value text1
.word 0x00000023
.word \value
.word \text1
.word 0
.endm
.macro rename_object u1 id text text2 text3 text4 text5 u2 u3
.word 0x00000025
.word \u1
.word \id
.word \text
.word \text2
.word \text3
.word \text4
.word \text5
.word \u2
.word \u3
.endm
.macro glass scale model pad props1 props2 u1 u2 u3 u4 u5 u6 u7 u8 u9 u10 u11 u12 u13 u14 u15 u16 u17 u18 u19 u20
.short \scale
.short 0x002a
generic_object \model \pad \props1 \props2 \u1 \u2 \u3 \u4 \u5 \u6 \u7 \u8 \u9 \u10 \u11 \u12 \u13 \u14 \u15 \u16 \u17 \u18 \u19
.word \u20
.endm
.macro camera2 scale u1 u2 u3 u4 u5 u6
.short \scale
.short 0x002e
.word \u1
.word \u2
.word \u3
.word \u4
.word \u5
.word \u6
.endm
.macro tinted_glass scale model pad props1 props2 u1 u2 u3 u4 u5 u6 u7 u8 u9 u10 u11 u12 u13 u14 u15 u16 u17 u18 u19 u20 u21 u22
.short \scale
.short 0x002f
generic_object \model \pad \props1 \props2 \u1 \u2 \u3 \u4 \u5 \u6 \u7 \u8 \u9 \u10 \u11 \u12 \u13 \u14 \u15 \u16 \u17 \u18 \u19
.word \u20
.word \u21
.word \u22
.endm
.macro lift scale model pad props1 props2 u1 u2 u3 u4 u5 u6 u7 u8 u9 u10 u11 u12 u13 u14 u15 u16 u17 u18 u19 pad1 pad2 u20 u21 u22 u23 u24 u25 u26 u27 u28 u29 u30 u31 u32
.short \scale
.short 0x0030
generic_object \model \pad \props1 \props2 \u1 \u2 \u3 \u4 \u5 \u6 \u7 \u8 \u9 \u10 \u11 \u12 \u13 \u14 \u15 \u16 \u17 \u18 \u19
.short \pad1
.short \pad2
.word \u20
.word \u21
.word \u22
.word \u23
.word \u24
.word \u25
.word \u26
.word \u27
.word \u28
.word \u29
.word \u30
.word \u31
.word \u32
.endm
.macro link_scenery unk1 unk2 unk3
.word 0x00000031
.word \unk1
.word \unk2
.word \unk3
.word 0
.endm
.macro link_paths u1 u2 u3
.word 0x00000032
.word \u1
.word \u2
.word \u3
.endm
.macro hoverbike scale model pad props1 props2 u1 u2 u3 u4 u5 u6 u7 u8 u9 u10 u11 u12 u13 u14 u15 u16 u17 u18 u19 u20 u21 u22 u23 u24 u25 u26 u27 u28 u29 u30 u31 u32 u33 u34 u35 u36 u37 u38 u39 u40 u41 u42 u43 u44 u45 u46 u47 u48 u49 u50 u51 u52
.short \scale
.short 0x0033
generic_object \model \pad \props1 \props2 \u1 \u2 \u3 \u4 \u5 \u6 \u7 \u8 \u9 \u10 \u11 \u12 \u13 \u14 \u15 \u16 \u17 \u18 \u19
.word \u20
.word \u21
.word \u22
.word \u23
.word \u24
.word \u25
.word \u26
.word \u27
.word \u28
.word \u29
.word \u30
.word \u31
.word \u32
.word \u33
.word \u34
.word \u35
.word \u36
.word \u37
.word \u38
.word \u39
.word \u40
.word \u41
.word \u42
.word \u43
.word \u44
.word \u45
.word \u46
.word \u47
.word \u48
.word \u49
.word \u50
.word \u51
.word \u52
.endm
.macro endprops
.word 0x00000034
.endm
.macro hover_prop scale model pad props1 props2 u1 u2 u3 u4 u5 u6 u7 u8 u9 u10 u11 u12 u13 u14 u15 u16 u17 u18 u19 u20 u21 u22 u23 u24 u25 u26 u27 u28 u29 u30 u31 u32 u33 u34 u35
.short \scale
.short 0x0035
generic_object \model \pad \props1 \props2 \u1 \u2 \u3 \u4 \u5 \u6 \u7 \u8 \u9 \u10 \u11 \u12 \u13 \u14 \u15 \u16 \u17 \u18 \u19
.word \u20
.word \u21
.word \u22
.word \u23
.word \u24
.word \u25
.word \u26
.word \u27
.word \u28
.word \u29
.word \u30
.word \u31
.word \u32
.word \u33
.word \u34
.word \u35
.endm
.macro vent_fan scale model pad props1 props2 u1 u2 u3 u4 u5 u6 u7 u8 u9 u10 u11 u12 u13 u14 u15 u16 u17 u18 u19 u20 u21 u22 u23 u24 u25
.short \scale
.short 0x0036
generic_object \model \pad \props1 \props2 \u1 \u2 \u3 \u4 \u5 \u6 \u7 \u8 \u9 \u10 \u11 \u12 \u13 \u14 \u15 \u16 \u17 \u18 \u19
.word \u20
.word \u21
.word \u22
.word \u23
.word \u24
.word \u25
.endm
.macro hover_vehicle scale model pad props1 props2 u1 u2 u3 u4 u5 u6 u7 u8 u9 u10 u11 u12 u13 u14 u15 u16 u17 u18 u19 u20 u21 u22 u23 u24 u25 u26 u27 u28 u29 u30 u31 u32 u33 u34
.short \scale
.short 0x0037
generic_object \model \pad \props1 \props2 \u1 \u2 \u3 \u4 \u5 \u6 \u7 \u8 \u9 \u10 \u11 \u12 \u13 \u14 \u15 \u16 \u17 \u18 \u19
.word \u20
.word \u21
.word \u22
.word \u23
.word \u24
.word \u25
.word \u26
.word \u27
.word \u28
.word \u29
.word \u30
.word \u31
.word \u32
.word \u33
.word \u34
.endm
.macro pad_effect effect pad
.word 0x00000038
.word \effect
.word \pad
.endm
.macro armed_vehicle scale model pad props1 props2 u1 u2 u3 u4 u5 u6 u7 u8 u9 u10 u11 u12 u13 u14 u15 u16 u17 u18 u19 u20 u21 u22 u23 u24 u25 u26 u27 u28 u29 u30 u31 u32 u33 u34 u35 u36 u37 u38 u39 u40 u41 u42 u43 u44 u45 u46 u47 u48 u49 u50 u51 u52 u53 u54
.short \scale
.short 0x0039
generic_object \model \pad \props1 \props2 \u1 \u2 \u3 \u4 \u5 \u6 \u7 \u8 \u9 \u10 \u11 \u12 \u13 \u14 \u15 \u16 \u17 \u18 \u19
.word \u20
.word \u21
.word \u22
.word \u23
.word \u24
.word \u25
.word \u26
.word \u27
.word \u28
.word \u29
.word \u30
.word \u31
.word \u32
.word \u33
.word \u34
.word \u35
.word \u36
.word \u37
.word \u38
.word \u39
.word \u40
.word \u41
.word \u42
.word \u43
.word \u44
.word \u45
.word \u46
.word \u47
.word \u48
.word \u49
.word \u50
.word \u51
.word \u52
.word \u53
.word \u54
.endm
.macro remote_mine scale model pad props1 props2 u1 u2 u3 u4 u5 u6 u7 u8 u9 u10 u11 u12 u13 u14 u15 u16 u17 u18 u19 u20 u21 u22
.short \scale
.short 0x003a
generic_object \model \pad \props1 \props2 \u1 \u2 \u3 \u4 \u5 \u6 \u7 \u8 \u9 \u10 \u11 \u12 \u13 \u14 \u15 \u16 \u17 \u18 \u19
.word \u20
.word \u21
.word \u22
.endm
.macro escalator scale model pad props1 props2 u1 u2 u3 u4 u5 u6 u7 u8 u9 u10 u11 u12 u13 u14 u15 u16 u17 u18 u19 u20 u21 u22 u23
.short \scale
.short 0x003b
generic_object \model \pad \props1 \props2 \u1 \u2 \u3 \u4 \u5 \u6 \u7 \u8 \u9 \u10 \u11 \u12 \u13 \u14 \u15 \u16 \u17 \u18 \u19
.word \u20
.word \u21
.word \u22
.word \u23
.endm

View File

@ -1,32 +0,0 @@
.include "asm/include/constants.inc"
.include "asm/include/commands.inc"
.include "asm/include/intro.inc"
.include "asm/include/paths.inc"
.include "asm/include/props.inc"
// Write file header
.data
.word 0
.word 0
.word 0
.word intro
.word props
.word paths
.word functions
.word 0
.if HEADERLEN > 0x20
.word text_stagename
.word text_briefing1
.word text_briefing2
.word text_briefing3
.word text_briefing4
.word text_objective1
.word text_objective2
.word text_objective3
.if HEADERLEN > 0x40
.word text_objective4
.word text_objective5
.endif
.endif

View File

@ -1,26 +0,0 @@
#
# Defection
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
endintro
path00:
endpath
paths:
endpaths
func0000_0034:
endfunction
functions:
endfunctions
.align 4

View File

@ -1,20 +0,0 @@
#
# Stage ID 0x18
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
endintro
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,23 +0,0 @@
#
# Extraction
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
endintro
path00:
endpath
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,26 +0,0 @@
#
# Stage ID 0x2e
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
endintro
path00:
endpath
paths:
endpaths
func0000_0034:
endfunction
functions:
endfunctions
.align 4

View File

@ -1,21 +0,0 @@
#
# Duel
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,26 +0,0 @@
#
# Crash Site
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
endintro
path00:
endpath
paths:
endpaths
func0000_0034:
endfunction
functions:
endfunctions
.align 4

View File

@ -1,20 +0,0 @@
#
# Stage ID 0x28
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
endintro
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,20 +0,0 @@
#
# Air Base
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
endintro
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,82 +0,0 @@
#
# Pelagic II
#
.set HEADERLEN, 0x48
.include "asm/include/setup.inc"
props:
endprops
intro:
endintro
paths:
endpaths
functions:
endfunctions
.align 4
text_stagename:
.ascii "B Y E L O M O R Y E D A M\n"
.byte 0x00
.align 2
text_briefing1:
.ascii "mi6 has confirmed the existence of a secret chemical warfare facility at the arkhangelsk dam, ussr. its heavily guarded location and workings are a cause for major concern. nerve gas produced there has been turning up in the hands of hostile regimes around the world and deals with international terrorists have been rumoured. this facility should be destroyed without prejudice.\n"
.byte 0x00
.align 2
text_briefing2:
.ascii "the area around the dam is well defended against a full scale military attack but they won't be expecting a lone agent. i've looked at the recon reports and decided that the easiest way to gain entrance to the weapons factory will be to bungee jump down the face of the dam. safe and simple. just throw yourself off the top and remember to look before you leap old chap.\n"
.byte 0x00
.align 2
text_briefing3:
.ascii "information concerning shipping and contacts is stored on a computer system in a secret ops room within the dam.with this covert modem connected to their satellite link we can intercept this data when a backup is carried out.\n"
.byte 0x00
.align 2
text_briefing4:
.ascii "hardly a lover's leap, james. be careful though, i hate to think of you falling for anyone else.\n"
.byte 0x00
.align 2
text_objective1:
.ascii "neutralize all alarms\n"
.byte 0x00
.align 2
text_objective2:
.ascii "install covert modem\n"
.byte 0x00
.align 2
text_objective3:
.ascii "intercept data backup\n"
.byte 0x00
.align 2
text_objective4:
.ascii "bungee jump from platform\n"
.byte 0x00
.align 2
text_objective5:
.ascii "Byelomorye Dam, Archangel, USSR\n"
.byte 0x00
.align 2
.align 4

View File

@ -1,20 +0,0 @@
#
# G5 Building
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
endintro
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,20 +0,0 @@
#
# Stage ID 0x1a
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
endintro
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,20 +0,0 @@
#
# CI Training
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
endintro
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,28 +0,0 @@
#
# Investigation
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
intro_weapon WEAPON_UNARMED, -1
outfit OUTFIT_DEFAULT
endintro
path00:
endpath
paths:
endpaths
func0000_004c:
endfunction
functions:
endfunctions
.align 4

View File

@ -1,28 +0,0 @@
#
# Villa
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
intro_weapon WEAPON_UNARMED, -1
outfit OUTFIT_DEFAULT
endintro
path00:
endpath
paths:
endpaths
func0000_004c:
endfunction
functions:
endfunctions
.align 4

View File

@ -1,26 +0,0 @@
#
# Defense
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
endintro
path00:
endpath
paths:
endpaths
func0000_0034:
endfunction
functions:
endfunctions
.align 4

View File

@ -1,21 +0,0 @@
#
# Stage ID 0x50
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,28 +0,0 @@
#
# Attack Ship
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
intro_weapon WEAPON_UNARMED, -1
outfit OUTFIT_DEFAULT
endintro
path00:
endpath
paths:
endpaths
func0000_004c:
endfunction
functions:
endfunctions
.align 4

View File

@ -1,27 +0,0 @@
#
# Stage ID 0x36
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
path00:
endpath
paths:
endpaths
func0000_003c:
endfunction
functions:
endfunctions
.align 4

View File

@ -1,26 +0,0 @@
#
# Rescue
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
endintro
path00:
endpath
paths:
endpaths
func0000_0034:
endfunction
functions:
endfunctions
.align 4

View File

@ -1,26 +0,0 @@
#
# Infiltration
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
endintro
path00:
endpath
paths:
endpaths
func0000_0034:
endfunction
functions:
endfunctions
.align 4

View File

@ -1,28 +0,0 @@
#
# Stage ID 0x46
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
unregistered_func1:
cmd0185_mponly
cmd0145_rebuild_groups
cmd0146_rebuild_groups
set_function CHR_SELF, GFUNC_IDLE
endfunction
functions:
endfunctions
.align 4

View File

@ -1,27 +0,0 @@
#
# Stage ID 0x48
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
endintro
paths:
endpaths
unregistered_func1:
cmd0185_mponly
cmd0145_rebuild_groups
cmd0146_rebuild_groups
set_function CHR_SELF, GFUNC_IDLE
endfunction
functions:
endfunctions
.align 4

View File

@ -1,35 +0,0 @@
#
# Stage ID 0x49
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
func1001_0038:
cmd01b2_mponly 130
set_function CHR_SELF, GFUNC_IDLE
endfunction
func1000_0044:
cmd0185_mponly
cmd0145_rebuild_groups
cmd0146_rebuild_groups
set_function CHR_SELF, GFUNC_IDLE
endfunction
functions:
register_function func1000_0044 0x1000
register_function func1001_0038 0x1001
endfunctions
.align 4

View File

@ -1,29 +0,0 @@
#
# Stage ID 0x4a
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
func1000_0038:
cmd0185_mponly
cmd0145_rebuild_groups
cmd0146_rebuild_groups
set_function CHR_SELF, GFUNC_IDLE
endfunction
functions:
register_function func1000_0038 0x1000
endfunctions
.align 4

View File

@ -1,29 +0,0 @@
#
# Stage ID 0x4b
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
func1000_0038:
cmd0185_mponly
cmd0145_rebuild_groups
cmd0146_rebuild_groups
set_function CHR_SELF, GFUNC_IDLE
endfunction
functions:
register_function func1000_0038 0x1000
endfunctions
.align 4

View File

@ -1,33 +0,0 @@
#
# Stage ID 0x3a
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
endintro
path00:
endpath
paths:
endpaths
unregistered_func1:
endfunction
unregistered_func2:
cmd0185_mponly
cmd0145_rebuild_groups
cmd0146_rebuild_groups
set_function CHR_SELF, GFUNC_IDLE
endfunction
functions:
endfunctions
.align 4

View File

@ -1,29 +0,0 @@
#
# Stage ID 0x4c
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
func1000_0038:
cmd0185_mponly
cmd0145_rebuild_groups
cmd0146_rebuild_groups
set_function CHR_SELF, GFUNC_IDLE
endfunction
functions:
register_function func1000_0038 0x1000
endfunctions
.align 4

View File

@ -1,27 +0,0 @@
#
# Stage ID 0x3e
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
endintro
paths:
endpaths
unregistered_func1:
cmd0185_mponly
cmd0145_rebuild_groups
cmd0146_rebuild_groups
set_function CHR_SELF, GFUNC_IDLE
endfunction
functions:
endfunctions
.align 4

View File

@ -1,29 +0,0 @@
#
# Stage ID 0x3f
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
func1000_0038:
cmd0185_mponly
cmd0145_rebuild_groups
cmd0146_rebuild_groups
set_function CHR_SELF, GFUNC_IDLE
endfunction
functions:
register_function func1000_0038 0x1000
endfunctions
.align 4

View File

@ -1,29 +0,0 @@
#
# Stage ID 0x40
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
func1000_0038:
cmd0185_mponly
cmd0145_rebuild_groups
cmd0146_rebuild_groups
set_function CHR_SELF, GFUNC_IDLE
endfunction
functions:
register_function func1000_0038 0x1000
endfunctions
.align 4

View File

@ -1,21 +0,0 @@
#
# Stage ID 0x4e
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,28 +0,0 @@
#
# Deep Sea
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
intro_weapon WEAPON_UNARMED, -1
outfit OUTFIT_DEFAULT
endintro
path00:
endpath
paths:
endpaths
func0000_004c:
endfunction
functions:
endfunctions
.align 4

View File

@ -1,87 +0,0 @@
#
# Chicago
#
.set HEADERLEN, 0x40
.include "asm/include/setup.inc"
props:
briefing 0, 0x0020
briefing 1, 0x0024
briefing 2, 0x0028
briefing 3, 0x002c
briefing 4, 0x0030
beginobjective 0, 0x0034, DIFFBIT_A | DIFFBIT_SA | DIFFBIT_PA | DIFFBIT_PD
endobjective
beginobjective 1, 0x0038, DIFFBIT_A | DIFFBIT_SA | DIFFBIT_PA | DIFFBIT_PD
endobjective
beginobjective 2, 0x003c, DIFFBIT_A | DIFFBIT_SA | DIFFBIT_PA | DIFFBIT_PD
endobjective
endprops
intro:
intro_weapon WEAPON_PP9I, -1
ammo AMMOTYPE_PISTOL, 100
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
functions:
endfunctions
.align 4
text_stagename:
.ascii "S T . P E T E R S B U R G\n"
.byte 0x00
.align 2
text_briefing1:
.ascii "use the stolen tank to chase the car containing natalya. you are up against a time limit.\n"
.byte 0x00
.align 2
text_briefing2:
.ascii "\n"
.byte 0x00
.align 2
text_briefing3:
.ascii "\n"
.byte 0x00
.align 2
text_briefing4:
.ascii "\n"
.byte 0x00
.align 2
text_objective1:
.ascii "\n\n\n"
.byte 0x00
.align 2
text_objective2:
.ascii "\n\n\n"
.byte 0x00
.align 2
text_objective3:
.ascii "\n"
.byte 0x00
.align 2
.align 4

View File

@ -1,28 +0,0 @@
#
# Air Force One
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
intro_weapon WEAPON_UNARMED, -1
outfit OUTFIT_DEFAULT
endintro
path00:
endpath
paths:
endpaths
func0000_004c:
endfunction
functions:
endfunctions
.align 4

View File

@ -1,32 +0,0 @@
#
# Stage ID 0x23
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
unregistered_func1:
set_function CHR_SELF, GFUNC_IDLE
endfunction
unregistered_func2:
cmd0185_mponly
cmd0145_rebuild_groups
cmd0146_rebuild_groups
set_function CHR_SELF, GFUNC_IDLE
endfunction
functions:
endfunctions
.align 4

View File

@ -1,21 +0,0 @@
#
# Maian SOS
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,21 +0,0 @@
#
# Retaking the Institute
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,20 +0,0 @@
#
# Stage IDs 0x24 and 0x2b
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
endintro
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,20 +0,0 @@
#
# Skedar Ruins
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
endintro
functions:
endfunctions
paths:
endpaths
.align 4

View File

@ -1,21 +0,0 @@
#
# Stage ID 0x14
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,20 +0,0 @@
#
# WAR!
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
endintro
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,20 +0,0 @@
#
# Escape
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
endintro
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,26 +0,0 @@
#
# Stage ID 0x4d
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
endintro
path00:
endpath
paths:
endpaths
func0000_0034:
endfunction
functions:
endfunctions
.align 4

View File

@ -1,26 +0,0 @@
#
# Mr. Blonde's Revenge
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
endintro
path00:
endpath
paths:
endpaths
func0000_0034:
endfunction
functions:
endfunctions
.align 4

File diff suppressed because it is too large Load Diff

View File

@ -1,21 +0,0 @@
#
# Stage ID 0x18
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,29 +0,0 @@
#
# Ravine (MP)
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
lift 0x0100, MODEL_RAVINELIFT, 0x00bc, 0x035204e8, 0x00304300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000003e8, 0x00000000, 0x00000000, 0x0fff0000, 0x00bc, 0x00bb, 0x00baffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0000071c, 0x0010aaaa, 0x00000000, 0x00000000, 0x00000000, 0x00000000
endprops
unregistered_func1:
set_function CHR_SELF, GFUNC_IDLE
endfunction
unregistered_func2:
set_function CHR_SELF, GFUNC_IDLE
endfunction
intro:
endintro
paths:
endpaths
functions:
endfunctions
.align 4

File diff suppressed because it is too large Load Diff

View File

@ -1,26 +0,0 @@
#
# Stage ID 0x2e
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
endintro
path00:
endpath
paths:
endpaths
func0000_0034:
endfunction
functions:
endfunctions
.align 4

View File

@ -1,553 +0,0 @@
#
# Duel
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
// Characters
.set CHR_GUARD, 0x00
.set CHR_JONATHAN, 0x01
.set CHR_TRENT, 0x02
// Stage flags
.set STAGEFLAG_GUARD_DEAD, 0x00000100
.set STAGEFLAG_JONATHAN_DEAD, 0x00000200
.set STAGEFLAG_TRENT_DEAD, 0x00000400
.set STAGEFLAG_SA_WALK_TRIGGER, 0x00000800
.set STAGEFLAG_PA_WALK_TRIGGER, 0x00001000
// Functions
.set FUNC_MOVE_TO_PAD, 0x0401
.set FUNC_GUARD_COMBAT, 0x0402
.set FUNC_JON_COMBAT, 0x0403
.set FUNC_TRENT_COMBAT, 0x0404
.set FUNC_GUARD_INIT, 0x0405
.set FUNC_JON_INIT, 0x0406
.set FUNC_TRENT_INIT, 0x0407
props:
briefing 0, 0x5e01
briefing 1, 0x5e00
briefing 2, 0x5e02
briefing 3, 0x5e03
beginobjective 0, 0x5e04, DIFFBIT_A | DIFFBIT_SA | DIFFBIT_PA | DIFFBIT_PD // "Defeat dataDyne guard"
complete_flags STAGEFLAG_GUARD_DEAD
endobjective
beginobjective 1, 0x5e05, DIFFBIT_SA | DIFFBIT_PA | DIFFBIT_PD // "Defeat Jonathan Dark"
complete_flags STAGEFLAG_JONATHAN_DEAD
endobjective
beginobjective 2, 0x5e06, DIFFBIT_PA | DIFFBIT_PD // "Defeat Trent Easton"
complete_flags STAGEFLAG_TRENT_DEAD
endobjective
chr 0x00000200, 0x00, 0x0279, BODY_DDSHOCK, HEAD_RANDOM, FUNC_GUARD_INIT, -1, -1, 100, 100, 0x4c080800, 0x02000000, 0x02, 0x04, -1, 0, 0x00000000
weapon 0x0100, MODEL_CHRFALCON2, CHR_GUARD, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000003e8, 0x00000000, 0x00000000, 0x0fff0000, WEAPON_FALCON2_SCOPE, 0x00ffffff, 0x00000000
chr 0x00000200, 0x01, 0x0023, BODY_CISOLDIER, HEAD_JONATHAN, FUNC_JON_INIT, -1, -1, 100, 100, 0x4c080800, 0x02000000, 0x02, 0x04, -1, 0, 0x00000000
weapon 0x0100, MODEL_CHRDY357, CHR_JONATHAN, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000003e8, 0x00000000, 0x00000000, 0x0fff0000, WEAPON_DY357MAGNUM, 0x00ffffff, 0x00000000
chr 0x00000200, 0x02, 0x0024, BODY_TRENT, HEAD_TRENT, FUNC_TRENT_INIT, -1, -1, 100, 100, 0x4c080800, 0x02000000, 0x02, 0x04, -1, 0, 0x00000000
weapon 0x0100, MODEL_CHRDY357TRENT, CHR_TRENT, 0x00004000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000003e8, 0x00000000, 0x00000000, 0x0fff0000, WEAPON_DY357LX, 0x00ffffff, 0x00000000
door 0x0100, MODEL_DD_OFFICEDOOR, 0x0158, 0x00000400, 0x20000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000003e8, 0x00000000, 0x00000000, 0x0fff0000, 0x0000f333, 0x00010000, 0x00007fff, 0x00014000, 0x00000666, 0x00040000, 0x00000040, 0x00000384, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000800, 0x00000000, 0xff000000, 0x00000000, 0x00000000, 0x00000000
door 0x0100, MODEL_DD_OFFICEDOOR, 0x0159, 0x00000400, 0x20000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000003e8, 0x00000000, 0x00000000, 0x0fff0000, 0x0000f333, 0x00010000, 0x00007fff, 0x00014000, 0x00000666, 0x00040000, 0x00000040, 0x00000384, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0xff000000, 0x00000000, 0x00000000, 0x00000000
endprops
intro:
outfit OUTFIT_DEFAULT
spawn 0x027a
intro_weapon WEAPON_FALCON2_SCOPE, -1
ammo AMMOTYPE_PISTOL, 8
endintro
paths:
endpaths
func1000_counterop_setup:
yield
set_chr_alliance CHR_COUNTEROP, ALLIANCE_ENEMY
set_function CHR_SELF, GFUNC_REBUILD_GROUPS
endfunction
func1001_objectives_failed:
yield
set_function CHR_SELF, GFUNC_SHOW_OBJ_FAILED_MSG
endfunction
func1002_first_walk:
set_chr_flag_bank3 CHR_VELVET, CHRFLAG3_HIDDEN
set_chr_flag_bank3 CHR_COUNTEROP, CHRFLAG3_HIDDEN
camera_movement 0x0488
unset_chr_flag_bank3 CHR_JOANNA, CHRFLAG3_HIDDEN
set_chr_flag_bank3 CHR_JOANNA, CHRFLAG3_UNPLAYABLE
set_chr_flag_bank2 CHR_JOANNA, CHRFLAG2_00020000
display_text 0x00, COLOR_02_WHITE, 0x5e07 // "THE DUEL"
animation ANIM_RELOAD, -1, -1, 0x0600, CHR_GUARD, 2
label 0x2d
message CHR_JOANNA, 0x5e0c // "Opponent skill level: AGENT"
// Wait for camera to stop animating
restart_timer
beginloop 0x08
if_camera_animating /*goto*/ 0x2d
goto_next 0x06
label 0x2d
endloop 0x08
// Start walking
label 0x06
remove_displayed_text
revoke_control CHR_JOANNA, 0
enter_firstperson
force_walk CHR_JOANNA, 0x0275, 0x2805, 0x0064
chr_move_to_pad CHR_GUARD, 0x0274, 0x01, /*goto*/ 0x0b
// Wait for walk to finish
beginloop 0x0b
if_force_walk_finished CHR_JOANNA, /*goto*/ 0x0c
endloop 0x0b
label 0x0c
grant_control CHR_JOANNA
set_function CHR_GUARD, FUNC_GUARD_COMBAT
set_function CHR_SELF, GFUNC_IDLE
endfunction
func1007_second_walk:
// Wait until SA walk trigger
beginloop 0x58
if_chr_dying CHR_JOANNA, /*goto*/ 0x2d
if_chr_death_animation_finished CHR_JOANNA, /*goto*/ 0x2d
if_stage_flag_eq STAGEFLAG_SA_WALK_TRIGGER, TRUE, /*goto*/ 0x06
endloop 0x58
// Begin cutscene
label 0x2d
set_function CHR_SELF, GFUNC_IDLE
label 0x06
revoke_control CHR_JOANNA, 0
camera_movement 0x0488
// Place chrs
label 0x8f
set_function CHR_P1P2, FUNC_MOVE_TO_PAD
chr_move_to_pad CHR_JONATHAN, 0x0279, 0x01, /*goto*/ 0x2d
yield
goto_first 0x8f
label 0x2d
unset_chr_flag_bank3 CHR_JONATHAN, CHRFLAG3_HIDDEN
unset_chr_flag_bank3 CHR_JONATHAN, CHRFLAG3_INVINCIBLE_TO_GUNFIRE
unset_chr_flag_bank3 CHR_JONATHAN, CHRFLAG3_UNEXPLODABLE
yield
unset_chr_flag_bank3 CHR_JOANNA, CHRFLAG3_HIDDEN
set_chr_flag_bank3 CHR_JOANNA, CHRFLAG3_UNPLAYABLE
set_chr_flag_bank2 CHR_JOANNA, CHRFLAG2_00020000
animation ANIM_GRAB_CROTCH, -1, -1, 0x0600, CHR_JONATHAN, 2
label 0x2d
message CHR_JOANNA, 0x5e0d // "Opponent skill level: SPECIAL AGENT"
restart_timer
beginloop 0x08
if_camera_animating /*goto*/ 0x2d
goto_next 0x06
label 0x2d
endloop 0x08
// Start force walk
label 0x06
label 0x2d
remove_displayed_text
revoke_control CHR_JOANNA, 0
enter_firstperson
yield
force_walk CHR_JOANNA, 0x0275, 0x2805, 0x0064
// Place Jon
call_rng
if_rand_lt 128, /*goto*/ 0x8f
chr_move_to_pad CHR_JONATHAN, 0x0271, 0x01, /*goto*/ 0x0b
label 0x8f
chr_move_to_pad CHR_JONATHAN, 0x0270, 0x01, /*goto*/ 0x0b
// Wait for force walk to finish
beginloop 0x0b
if_force_walk_finished CHR_JOANNA, /*goto*/ 0x0c
endloop 0x0b
// Give control back to Jo
label 0x0c
grant_control CHR_JOANNA
set_function CHR_JONATHAN, FUNC_JON_COMBAT
set_function CHR_SELF, GFUNC_IDLE
endfunction
func0401_move_to_pad:
chr_move_to_pad CHR_SELF, 0x027a, 0x01, /*goto*/ 0x06
label 0x06
yield
stop_chr
set_function CHR_SELF, GFUNC_IDLE
endfunction
func1008_third_walk:
// Wait for flag or Jo dying
beginloop 0x58
if_chr_dying CHR_JOANNA, /*goto*/ 0x2d
if_chr_death_animation_finished CHR_JOANNA, /*goto*/ 0x2d
if_stage_flag_eq STAGEFLAG_PA_WALK_TRIGGER, TRUE, /*goto*/ 0x06
endloop 0x58
// Jo dead
label 0x2d
set_function CHR_SELF, GFUNC_IDLE
// Do cutscene
label 0x06
revoke_control CHR_JOANNA, 0
camera_movement 0x0488
label 0x8f
set_function CHR_P1P2, FUNC_MOVE_TO_PAD
chr_move_to_pad CHR_TRENT, 0x0279, 0x01, /*goto*/ 0x2d
yield
goto_first 0x8f
label 0x2d
unset_chr_flag_bank3 CHR_TRENT, CHRFLAG3_HIDDEN
unset_chr_flag_bank3 CHR_TRENT, CHRFLAG3_INVINCIBLE_TO_GUNFIRE
unset_chr_flag_bank3 CHR_TRENT, CHRFLAG3_UNEXPLODABLE
yield
unset_chr_flag_bank3 CHR_JOANNA, CHRFLAG3_HIDDEN
set_chr_flag_bank3 CHR_JOANNA, CHRFLAG3_UNPLAYABLE
set_chr_flag_bank2 CHR_JOANNA, CHRFLAG2_00020000
animation ANIM_HEAD_ROLL, -1, -1, 0x0600, CHR_TRENT, 2
label 0x2d
message CHR_JOANNA, 0x5e0e // "Opponent skill level: PERFECT AGENT"
// Wait for cutscene to finish
restart_timer
beginloop 0x08
if_camera_animating /*goto*/ 0x2d
goto_next 0x06
label 0x2d
endloop 0x08
// Begin force walk
label 0x06
remove_displayed_text
revoke_control CHR_JOANNA, 0
enter_firstperson
force_walk CHR_JOANNA, 0x0275, 0x2805, 0x0064
chr_move_to_pad CHR_TRENT, 0x0272, 0x01, /*goto*/ 0x0b
beginloop 0x0b
if_force_walk_finished CHR_JOANNA, /*goto*/ 0x0c
endloop 0x0b
label 0x0c
set_function CHR_TRENT, FUNC_TRENT_COMBAT
grant_control CHR_JOANNA
set_function CHR_SELF, GFUNC_IDLE
endfunction
func1004_revoke_control:
yield
revoke_control CHR_JOANNA, 0
set_function CHR_SELF, GFUNC_IDLE
endfunction
func1005_main:
// Wait until guard dead
beginloop 0x04
if_chr_death_animation_finished CHR_GUARD, /*goto*/ 0x2d
if_chr_dying CHR_GUARD, /*goto*/ 0x2d
if_chr_unloaded CHR_GUARD, /*goto*/ 0x2d
endloop 0x04
label 0x2d
message CHR_JOANNA, 0x5e09 // "Well done! You were too quick for him!"
set_stage_flag STAGEFLAG_GUARD_DEAD
restart_timer
beginloop 0x08
if_timer_gt 120, /*goto*/ 0x2d
endloop 0x08
// If Agent, return
label 0x2d
if_difficulty_lt DIFF_SA, /*goto*/ 0x2d
goto_next 0x06
label 0x2d
set_function CHR_SELF, GFUNC_IDLE
label 0x06
set_stage_flag STAGEFLAG_SA_WALK_TRIGGER
// Wait until Jonathan dead
beginloop 0x09
if_chr_death_animation_finished CHR_JONATHAN, /*goto*/ 0x2d
if_chr_dying CHR_JONATHAN, /*goto*/ 0x2d
if_chr_unloaded CHR_JONATHAN, /*goto*/ 0x2d
endloop 0x09
label 0x2d
message CHR_JOANNA, 0x5e0a // "Well done! You were too quick for him!"
set_stage_flag STAGEFLAG_JONATHAN_DEAD
restart_timer
beginloop 0x0b
if_timer_gt 120, /*goto*/ 0x2d
endloop 0x0b
// If Special Agent, return
label 0x2d
if_difficulty_lt DIFF_PA, /*goto*/ 0x2d
goto_next 0x06
label 0x2d
set_function CHR_SELF, GFUNC_IDLE
label 0x06
set_stage_flag STAGEFLAG_PA_WALK_TRIGGER
// Wait until Trent dead
beginloop 0x0c
if_chr_death_animation_finished CHR_TRENT, /*goto*/ 0x2d
if_chr_dying CHR_TRENT, /*goto*/ 0x2d
if_chr_unloaded CHR_TRENT, /*goto*/ 0x2d
endloop 0x0c
label 0x2d
message CHR_JOANNA, 0x5e0b // "Well done! You were too quick for him!"
set_stage_flag STAGEFLAG_TRENT_DEAD
restart_timer
beginloop 0x0d
if_timer_gt 120, /*goto*/ 0x2d
endloop 0x0d
label 0x2d
set_function CHR_SELF, GFUNC_IDLE
endfunction
func1003_init_audio:
restart_default_music
reset_ambience
set_function CHR_SELF, GFUNC_IDLE
endfunction
func1006_check_objectives_complete:
// Wait for all objectives complete
beginloop 0x04
if_all_objectives_complete /*goto*/ 0x2d
endloop 0x04
// Wait 3 seconds
label 0x2d
restart_timer
beginloop 0x08
if_timer_gt 180, /*goto*/ 0x2d
endloop 0x08
// End level
label 0x2d
end_level
set_function CHR_SELF, GFUNC_IDLE
endfunction
func0402_guard_combat:
set_onshot_function FUNC_GUARD_COMBAT
if_just_injured CHR_SELF, /*goto*/ 0x03
set_chr_flag_bank2 CHR_SELF, CHRFLAG2_00008000
// Wait 2 seconds or for guard to come into view
restart_timer
beginloop 0x04
if_timer_gt 120, /*goto*/ 0x06
if_chr_in_view /*goto*/ 0x2d
endloop 0x04
// Guard has come into view. Jump sideways.
label 0x2d
try_jump_sideways /*goto*/ 0x08
beginloop 0x08
if_chr_distance_lt 250, /*goto*/ 0x0e
if_chr_stopped /*goto*/ 0x03
endloop 0x08
// Guard has been shot, or finished jump
beginloop 0x03
if_chr_distance_lt 250, /*goto*/ 0x0e
if_chr_sees_player /*goto*/ 0x06
reloop 0x03
// 2 seconds have passed without seeing guard, or guard has been shot
label 0x06
if_chr_dying TARGET_CHR, /*goto*/ 0x2e
try_aim_and_shoot_thing1 0x0220, 0x0000, /*goto*/ 0x2d
label 0x2d
try_aim_and_shoot_thing2 0x0200, 0x0000, /*goto*/ 0x0c
beginloop 0x0c
if_chr_stopped /*goto*/ 0x06
endloop 0x0c
// Finished shooting
label 0x06
endloop 0x03
// Dying
label 0x2e
set_function CHR_SELF, GFUNC_IDLE
// Hand combat
label 0x0e
set_return_function CHR_SELF, FUNC_TRENT_COMBAT
set_function CHR_SELF, GFUNC_HAND_COMBAT
endfunction
func0403_jon_combat:
set_onshot_function FUNC_JON_COMBAT
if_just_injured CHR_SELF, /*goto*/ 0x58
set_chr_flag_bank2 CHR_SELF, CHRFLAG2_00008000
restart_timer
beginloop 0x04
if_timer_gt 240, /*goto*/ 0x58
if_within_units_of_sight 30, /*goto*/ 0x58
endloop 0x04
label 0x58
try_run_to_target_chr /*goto*/ 0x08
beginloop 0x08
if_chr_distance_lt 250, /*goto*/ 0x0e
if_in_disarm_range /*goto*/ 0x06
reloop 0x08
label 0x06
try_chr_kneel_and_shoot_thing 0x0220, 0x0000, /*goto*/ 0x2d
label 0x2d
try_roll_and_shoot /*goto*/ 0x0c
try_chr_kneel_and_shoot_thing 0x0200, 0x0000, /*goto*/ 0x0c
beginloop 0x0c
if_chr_stopped /*goto*/ 0x06
endloop 0x0c
label 0x06
endloop 0x58
label 0x0e
set_return_function CHR_SELF, FUNC_JON_COMBAT
set_function CHR_SELF, GFUNC_HAND_COMBAT
set_function CHR_SELF, GFUNC_IDLE
endfunction
func0404_trent_combat:
set_onshot_function FUNC_TRENT_COMBAT
if_just_injured CHR_SELF, /*goto*/ 0x03
set_chr_flag_bank2 CHR_SELF, CHRFLAG2_00008000
restart_timer
beginloop 0x04
if_timer_gt 120, /*goto*/ 0x03
if_chr_in_view /*goto*/ 0x03
endloop 0x04
// Wait until player in sight or in close range
beginloop 0x03
if_chr_distance_lt 250, /*goto*/ 0x0e
if_chr_sees_player /*goto*/ 0x06
reloop 0x03
// Attack
label 0x06
if_chr_dying TARGET_CHR, /*goto*/ 0x2e
try_aim_and_shoot_thing1 0x0220, 0x0000, /*goto*/ 0x2d
label 0x2d
try_aim_and_shoot_thing2 0x0200, 0x0000, /*goto*/ 0x0c
beginloop 0x0c
if_chr_stopped /*goto*/ 0x06
endloop 0x0c
label 0x06
endloop 0x03
// Hand combat
label 0x0e
set_return_function CHR_SELF, FUNC_TRENT_COMBAT
set_function CHR_SELF, GFUNC_HAND_COMBAT
label 0x2e
set_function CHR_SELF, GFUNC_IDLE
endfunction
func0405_guard_init:
set_self_flag_bank3 CHRFLAG3_NOAUTOAIM
set_accuracy 200
set_reaction_speed 50
set_chr_health CHR_SELF, 20
set_armor 0
set_recovery_speed 0
set_shield 0
set_function CHR_SELF, GFUNC_IDLE
endfunction
func0406_jon_init:
set_self_flag_bank3 CHRFLAG3_NOAUTOAIM
set_accuracy 200
set_reaction_speed 75
set_chr_health CHR_SELF, 40
set_armor 0
set_recovery_speed 0
set_shield 0
set_self_flag_bank3 CHRFLAG3_HIDDEN
set_self_flag_bank3 CHRFLAG3_INVINCIBLE_TO_GUNFIRE
set_self_flag_bank3 CHRFLAG3_UNEXPLODABLE
set_function CHR_SELF, GFUNC_IDLE
endfunction
func0407_trent_init:
set_self_flag_bank3 CHRFLAG3_NOAUTOAIM
set_accuracy 200
set_reaction_speed 75
set_chr_health CHR_SELF, 40
set_armor 0
set_recovery_speed 0
set_shield 0
set_self_flag_bank3 CHRFLAG3_HIDDEN
set_self_flag_bank3 CHRFLAG3_INVINCIBLE_TO_GUNFIRE
set_self_flag_bank3 CHRFLAG3_UNEXPLODABLE
set_function CHR_SELF, GFUNC_IDLE
endfunction
functions:
register_function func1000_counterop_setup 0x1000
register_function func1001_objectives_failed 0x1001
register_function func1002_first_walk 0x1002
register_function func1003_init_audio 0x1003
register_function func1004_revoke_control 0x1004
register_function func1005_main 0x1005
register_function func1006_check_objectives_complete 0x1006
register_function func1007_second_walk 0x1007
register_function func1008_third_walk 0x1008
register_function func0401_move_to_pad 0x0401
register_function func0402_guard_combat 0x0402
register_function func0403_jon_combat 0x0403
register_function func0404_trent_combat 0x0404
register_function func0405_guard_init 0x0405
register_function func0406_jon_init 0x0406
register_function func0407_trent_init 0x0407
endfunctions
.align 4

File diff suppressed because it is too large Load Diff

View File

@ -1,20 +0,0 @@
#
# Stage ID 0x28
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
endintro
paths:
endpaths
functions:
endfunctions
.align 4

File diff suppressed because it is too large Load Diff

View File

@ -1,22 +0,0 @@
#
# Pipes (MP)
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
intro_weapon WEAPON_FALCON2, -1
ammo AMMOTYPE_PISTOL, 100
endintro
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,21 +0,0 @@
#
# G5 Building (MP)
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
intro_weapon WEAPON_FALCON2, -1
endintro
paths:
endpaths
functions:
endfunctions
.align 4

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,21 +0,0 @@
#
# Stage ID 0x1a
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
functions:
endfunctions
.align 4

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,22 +0,0 @@
#
# Temple (MP)
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
intro_weapon WEAPON_NONE, -1
endintro
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,21 +0,0 @@
#
# Stage ID 0x50
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
functions:
endfunctions
.align 4

File diff suppressed because it is too large Load Diff

View File

@ -1,22 +0,0 @@
#
# Stage ID 0x36
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
intro_weapon WEAPON_NONE, -1
endintro
paths:
endpaths
functions:
endfunctions
.align 4

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,21 +0,0 @@
#
# Base (MP)
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,21 +0,0 @@
#
# Felicity (MP)
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,21 +0,0 @@
#
# Fortress (MP)
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,21 +0,0 @@
#
# Villa (MP)
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,21 +0,0 @@
#
# Stage ID 0x46
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,21 +0,0 @@
#
# Grid (MP)
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,21 +0,0 @@
#
# Stage ID 0x48
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,21 +0,0 @@
#
# Stage ID 0x49
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,21 +0,0 @@
#
# Stage ID 0x4a
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,21 +0,0 @@
#
# Stage ID 0x4b
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,21 +0,0 @@
#
# Stage ID 0x3a
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,21 +0,0 @@
#
# Stage ID 0x4c
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,27 +0,0 @@
#
# Area 52 (MP)
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
func1000_0038:
cmd01b2_mponly 20
set_function CHR_SELF, GFUNC_IDLE
endfunction
functions:
register_function func1000_0038 0x1000
endfunctions
.align 4

View File

@ -1,26 +0,0 @@
#
# Warehouse (MP)
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
endintro
path00:
endpath
paths:
endpaths
func0000_0034:
endfunction
functions:
endfunctions
.align 4

View File

@ -1,21 +0,0 @@
#
# Car Park (MP)
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,21 +0,0 @@
#
# Stage ID 0x3e
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,20 +0,0 @@
#
# Stage ID 0x3f
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
endintro
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,23 +0,0 @@
#
# Stage ID 0x40
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
endintro
path00:
endpath
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,21 +0,0 @@
#
# Ruins (MP)
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
functions:
endfunctions
.align 4

View File

@ -1,235 +0,0 @@
#
# Skedar (MP)
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
// Functions
.set FUNC0401_INIT_ENEMY, 0x0401
.set FUNC0402_INIT_MAIAN, 0x0402
props:
endprops
intro:
spawn 0x0063
outfit OUTFIT_DEFAULT
intro_weapon WEAPON_FALCON2, -1
intro_weapon WEAPON_CMP150, -1
intro_weapon WEAPON_AR34, -1
intro_weapon WEAPON_REAPER, -1
ammo AMMOTYPE_PISTOL, 500
ammo AMMOTYPE_RIFLE, 500
endintro
func0406_idle:
set_function CHR_SELF, GFUNC_IDLE
endfunction
func0408_idle_with_10_health:
set_chr_health CHR_SELF, 10
set_function CHR_SELF, GFUNC_IDLE
endfunction
func0404_spawn_enemies:
// Spawn 12 enemies
set_chr_alliance CHR_SELF, ALLIANCE_ENEMY
restart_timer
dprint "B4CHECK\n"
set_var_a 12
label 0x04
if_var_a_lt 1, /*goto*/ 0x01
try_spawn_clone BODY_DDSHOCK, HEAD_DDSHOCK, 0x06, FUNC0401_INIT_ENEMY, 0x00000010, /*goto*/ 0xa2
goto_next 0x01
label 0xa2
yield
subtract_var_a 1
goto_first 0x04
label 0x01
yield
yield
yield
yield
yield
cmd0145_rebuild_groups
cmd0146_rebuild_groups
set_function CHR_SELF, FUNC0401_INIT_ENEMY
endfunction
func0401_init_enemy:
try_draw_weapon MODEL_CHRCMP150, WEAPON_CMP150, 0x00000000, /*goto*/ 0x01
label 0x01
try_inherit_properties 0x06, /*goto*/ 0x01
label 0x01
assign_path 0
start_path
set_return_function CHR_SELF, GFUNC_CHOOSE_TARGET_CHR
set_function CHR_SELF, GFUNC_CHOOSE_TARGET_CHR
endfunction
func0405_spawn_maians:
// Spawn 12 Maians
set_chr_alliance CHR_SELF, ALLIANCE_ALLY
stop_chr
restart_timer
dprint "B4CHEK\n"
set_var_a 12
label 0x04
if_var_a_lt 1, /*goto*/ 0x01
try_spawn_clone BODY_ELVIS1, HEAD_ELVIS, 0x07, FUNC0402_INIT_MAIAN, 0x00000010, /*goto*/ 0xa2
goto_next 0x01
label 0xa2
yield
subtract_var_a 1
goto_first 0x04
label 0x01
cmd0145_rebuild_groups
cmd0146_rebuild_groups
yield
yield
yield
yield
yield
set_function CHR_SELF, FUNC0402_INIT_MAIAN
endfunction
func0402_init_maian:
set_chr_alliance CHR_SELF, ALLIANCE_ALLY
try_draw_weapon MODEL_CHRFALCON2, WEAPON_MAGSEC4, 0x00000000, /*goto*/ 0x01
label 0x01
try_inherit_properties 0x07, /*goto*/ 0x01
label 0x01
assign_path 0
start_path
set_return_function CHR_SELF, GFUNC_CHOOSE_TARGET_CHR
set_function CHR_SELF, GFUNC_CHOOSE_TARGET_CHR
endfunction
func1001_01a4:
noop016c
cmd0145_rebuild_groups
cmd0146_rebuild_groups
set_function CHR_SELF, GFUNC_IDLE
endfunction
unregistered_function1:
// Print "t" to console when Joanna is looking at some object.
// The object doesn't exist in the props code though, so was likely removed.
label 0x04
yield
if_chr_looking_at_object CHR_JOANNA, 0x00, /*goto*/ 0x01
goto_first 0x04
label 0x01
dprint "t"
goto_first 0x04
endfunction
func1000_idle:
set_function CHR_SELF, GFUNC_IDLE
endfunction
func0403_init_some_sound:
play_sound 0x0037, -1
set_function CHR_SELF, GFUNC_IDLE
endfunction
// This function is never assigned.
func0407_defend_pad:
set_onshot_function 0x0407
if_enemy_distance_lt_and_los 2540, /*goto*/ 0xa5
if_chr_distance_to_pad_lt CHR_SELF, 200, TARGET_PAD, /*goto*/ 0x01
// Go to target pad, but stop when seen player or when near pad
label 0xdb
jog_to_pad TARGET_PAD
label 0xdc
yield
dprint "GO TO PAD\n"
if_enemy_distance_lt_and_los 2540, /*goto*/ 0xa5
if_chr_distance_to_pad_lt CHR_SELF, 200, TARGET_PAD, /*goto*/ 0x01
goto_first 0xdc
// Near pad. Wait until detected player.
label 0x01
stop_chr
label 0xa6
yield
dprint "AT PAD\n"
if_enemy_distance_lt_and_los 2540, /*goto*/ 0xa5
if_chr_distance_to_pad_gt CHR_SELF, 300, TARGET_PAD, /*goto*/ 0x01
goto_first 0xa6
label 0x01
goto_first 0xdb
// Do combat
label 0xa5
dprint "DETECTED\n"
set_return_function CHR_SELF, 0x0407
set_function CHR_SELF, GFUNC_COMBAT_WITH_TARGET_CHR
endfunction
functions:
register_function func0401_init_enemy 0x0401
register_function func0402_init_maian 0x0402
register_function func0403_init_some_sound 0x0403
register_function func0404_spawn_enemies 0x0404
register_function func0405_spawn_maians 0x0405
register_function func0406_idle 0x0406
register_function func0407_defend_pad 0x0407
register_function func0408_idle_with_10_health 0x0408
register_function func1000_idle 0x1000
register_function func1001_01a4 0x1001
endfunctions
path00:
pad 0x0014
pad 0x0015
endpath
path01:
pad 0x0064
pad 0x0066
endpath
path02:
pad 0x0037
pad 0x0033
pad 0x0034
endpath
path03:
pad 0x0038
pad 0x0039
pad 0x003a
endpath
path04:
pad 0x0033
pad 0x0037
pad 0x0036
pad 0x003d
pad 0x003e
pad 0x003f
pad 0x0045
pad 0x0048
pad 0x003b
pad 0x003a
pad 0x0039
endpath
paths:
register_path path00, 0, 0
register_path path01, 1, 0
register_path path00, 0, 0
register_path path02, 2, 0
register_path path03, 3, 0
register_path path04, 4, 0
endpaths
.align 4

View File

@ -1,152 +0,0 @@
#
# Stage ID 0x4e
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
tag 0x00, 1
object 0x0100, MODEL_A51_CRATE1, 0xffff, 0x00021501, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000003e8, 0x00000000, 0x00000000, 0x0fff0000
tag 0x01, 1
object 0x0100, MODEL_A51_CRATE1, 0xffff, 0x00021501, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000003e8, 0x00000000, 0x00000000, 0x0fff0000
tag 0x02, 1
object 0x0100, MODEL_A51_CRATE1, 0xffff, 0x00021501, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000003e8, 0x00000000, 0x00000000, 0x0fff0000
endprops
intro:
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
/**
* Some kind of camera movement test? When you press a button it jumps forward
* to the next camera animation rather than ending the cutscene.
*/
func0c00_017c:
set_chr_flag_bank3 CHR_VELVET, CHRFLAG3_HIDDEN
set_chr_flag_bank3 CHR_COUNTEROP, CHRFLAG3_HIDDEN
set_music_track MUSIC_G5_INTRO
camera_movement 0x045d
cmd01c8 2
beginloop 0x12
cmd01c9 /*goto*/ 0x59
endloop 0x12
label 0x59
cmd01c8 3
beginloop 0x13
cmd01c9 /*goto*/ 0x59
endloop 0x13
label 0x59
camera_movement 0x045d
show_object 0x00
set_object_flag_bank1 0x00, OBJECTFLAG1_04000000
set_object_flag_bank2 0x00, OBJECTFLAG2_00000010
object_do_animation 0x045e, 0x00, 0x04ff, 0xff
beginloop 0x08
if_camera_animating /*goto*/ 0x31
goto_next 0x59
label 0x31
if_controller_button_pressed /*goto*/ 0x59
label 0x31
endloop 0x08
label 0x59
hide_object 0x00
camera_movement 0x0464
show_object 0x01
set_object_flag_bank1 0x01, OBJECTFLAG1_04000000
set_object_flag_bank2 0x01, OBJECTFLAG2_00000010
object_do_animation 0x0465, 0x01, 0x04ff, 0xff
beginloop 0x0b
if_camera_animating /*goto*/ 0x31
goto_next 0x59
label 0x31
if_controller_button_pressed /*goto*/ 0x59
label 0x31
endloop 0x0b
label 0x59
hide_object 0x01
camera_movement 0x0461
show_object 0x00
set_object_flag_bank1 0x00, OBJECTFLAG1_04000000
set_object_flag_bank2 0x00, OBJECTFLAG2_00000010
object_do_animation 0x0462, 0x00, 0x04ff, 0xff
show_object 0x01
set_object_flag_bank1 0x01, OBJECTFLAG1_04000000
set_object_flag_bank2 0x01, OBJECTFLAG2_00000010
object_do_animation 0x0463, 0x01, 0x04ff, 0xff
beginloop 0x0a
if_camera_animating /*goto*/ 0x31
goto_next 0x59
label 0x31
if_controller_button_pressed /*goto*/ 0x59
label 0x31
endloop 0x0a
label 0x59
hide_object 0x01
hide_object 0x00
camera_movement 0x046c
show_object 0x01
unset_object_flag_bank1 0x01, OBJECTFLAG1_04000000
set_object_flag_bank2 0x01, OBJECTFLAG2_00000010
object_do_animation 0x046e, 0x01, 0x04ff, 0xff
show_object 0x00
set_object_flag_bank1 0x00, OBJECTFLAG1_04000000
set_object_flag_bank2 0x00, OBJECTFLAG2_00000010
object_do_animation 0x046d, 0x00, 0x04ff, 0xff
show_object 0x02
set_object_flag_bank1 0x02, OBJECTFLAG1_04000000
set_object_flag_bank2 0x02, OBJECTFLAG2_00000010
object_do_animation 0x046f, 0x02, 0x04ff, 0xff
beginloop 0x0e
if_camera_animating /*goto*/ 0x31
goto_next 0x59
label 0x31
if_controller_button_pressed /*goto*/ 0x59
label 0x31
endloop 0x0e
label 0x59
unset_chr_flag_bank3 CHR_VELVET, CHRFLAG3_HIDDEN
unset_chr_flag_bank3 CHR_COUNTEROP, CHRFLAG3_HIDDEN
cmd01c8 5
beginloop 0x15
cmd01c9 /*goto*/ 0x59
endloop 0x15
label 0x59
restart_default_music
reset_ambience
enter_firstperson
set_function CHR_SELF, GFUNC_IDLE
endfunction
functions:
register_function func0c00_017c 0x0401
register_function func0c00_017c 0x0c00
endfunctions
.align 4

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,23 +0,0 @@
#
# Complex (MP)
#
.set HEADERLEN, 0x20
.include "asm/include/setup.inc"
props:
endprops
intro:
intro_weapon WEAPON_PP9I, -1
ammo AMMOTYPE_PISTOL, 100
outfit OUTFIT_DEFAULT
endintro
paths:
endpaths
functions:
endfunctions
.align 4

Some files were not shown because too many files have changed in this diff Show More