You've already forked HackerSM64
mirror of
https://github.com/HackerN64/HackerSM64.git
synced 2026-01-21 10:35:32 -08:00
Compare commits
8 Commits
develop/2.
...
develop/2.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f283e97c92 | ||
|
|
f7c3f67065 | ||
|
|
22196dd808 | ||
|
|
371c5a4cf6 | ||
|
|
30e502d783 | ||
|
|
0dd3ef7f50 | ||
|
|
da4b4db7ae | ||
|
|
8c56afddba |
53
Makefile
53
Makefile
@@ -119,20 +119,10 @@ else ifeq ($(GRUCODE),super3d) # Super3D
|
||||
DEFINES += SUPER3D_GBI=1 F3D_NEW=1
|
||||
endif
|
||||
|
||||
LIBRARIES := nustd hvqm2 z goddard
|
||||
|
||||
# TEXT ENGINES
|
||||
# s2dex_text_engine - Text Engine by someone2639
|
||||
TEXT_ENGINE := none
|
||||
ifeq ($(TEXT_ENGINE), s2dex_text_engine)
|
||||
DEFINES += S2DEX_GBI_2=1 S2DEX_TEXT_ENGINE=1
|
||||
LIBRARIES += s2d_engine
|
||||
DUMMY != make -C src/s2d_engine COPY_DIR=$(shell pwd)/lib/
|
||||
endif
|
||||
# add more text engines here
|
||||
|
||||
LINK_LIBRARIES = $(foreach i,$(LIBRARIES),-l$(i))
|
||||
|
||||
$(eval $(call validate-option,TEXT_ENGINE,none s2dex_text_engine))
|
||||
|
||||
#==============================================================================#
|
||||
# Optimization flags #
|
||||
@@ -210,6 +200,12 @@ endif
|
||||
# 0 - does not
|
||||
UNF ?= 0
|
||||
$(eval $(call validate-option,UNF,0 1))
|
||||
|
||||
# if `unf` is a target, make sure that UNF is set
|
||||
ifneq ($(filter unf,$(MAKECMDGOALS)),)
|
||||
UNF = 1
|
||||
endif
|
||||
|
||||
ifeq ($(UNF),1)
|
||||
DEFINES += UNF=1
|
||||
SRC_DIRS += src/usb
|
||||
@@ -411,6 +407,18 @@ else
|
||||
$(error Unable to detect a suitable MIPS toolchain installed)
|
||||
endif
|
||||
|
||||
LIBRARIES := nustd hvqm2 z goddard
|
||||
|
||||
# Text engine
|
||||
ifeq ($(TEXT_ENGINE), s2dex_text_engine)
|
||||
DEFINES += S2DEX_GBI_2=1 S2DEX_TEXT_ENGINE=1
|
||||
LIBRARIES += s2d_engine
|
||||
DUMMY != $(MAKE) -C src/s2d_engine COPY_DIR=$(shell pwd)/lib/ CROSS=$(CROSS)
|
||||
endif
|
||||
# add more text engines here
|
||||
|
||||
LINK_LIBRARIES = $(foreach i,$(LIBRARIES),-l$(i))
|
||||
|
||||
export LD_LIBRARY_PATH=./tools
|
||||
|
||||
AS := $(CROSS)as
|
||||
@@ -502,8 +510,13 @@ endif
|
||||
ENDIAN_BITWIDTH := $(BUILD_DIR)/endian-and-bitwidth
|
||||
EMULATOR = mupen64plus
|
||||
EMU_FLAGS =
|
||||
LOADER = loader64
|
||||
LOADER_FLAGS = -vwf
|
||||
|
||||
ifneq (,$(call find-command,wslview))
|
||||
LOADER = ./$(TOOLS_DIR)/UNFLoader.exe
|
||||
else
|
||||
LOADER = ./$(TOOLS_DIR)/UNFLoader
|
||||
endif
|
||||
|
||||
SHA1SUM = sha1sum
|
||||
PRINT = printf
|
||||
|
||||
@@ -553,8 +566,18 @@ test-pj64: $(ROM)
|
||||
wine ~/Desktop/new64/Project64.exe $<
|
||||
# someone2639
|
||||
|
||||
load: $(ROM)
|
||||
$(LOADER) $(LOADER_FLAGS) $<
|
||||
# download and extract most recent unfloader build if needed
|
||||
$(LOADER):
|
||||
ifeq (,$(wildcard $(LOADER)))
|
||||
@$(PRINT) "Downloading latest UNFLoader...$(NO_COL)\n"
|
||||
$(PYTHON) $(TOOLS_DIR)/get_latest_unfloader.py $(TOOLS_DIR)
|
||||
endif
|
||||
|
||||
load: $(ROM) $(LOADER)
|
||||
$(LOADER) -r $<
|
||||
|
||||
unf: $(ROM) $(LOADER)
|
||||
$(LOADER) -d -r $<
|
||||
|
||||
libultra: $(BUILD_DIR)/libultra.a
|
||||
|
||||
|
||||
@@ -377,9 +377,10 @@ enum GoddardScene {
|
||||
CMD_BBBB(destArea, destNode, flags, 0x00)
|
||||
|
||||
#define INSTANT_WARP(index, destArea, displaceX, displaceY, displaceZ) \
|
||||
CMD_BBBB(LEVEL_CMD_CREATE_INSTANT_WARP, 0x0C, index, destArea), \
|
||||
CMD_HH(displaceX, displaceY), \
|
||||
CMD_HH(displaceZ, 0x0000)
|
||||
CMD_BBBB(LEVEL_CMD_CREATE_INSTANT_WARP, 0x10, index, destArea), \
|
||||
CMD_W(displaceX), \
|
||||
CMD_W(displaceY), \
|
||||
CMD_W(displaceZ)
|
||||
|
||||
#define LOAD_AREA(area) \
|
||||
CMD_BBBB(LEVEL_CMD_LOAD_AREA, 0x04, area, 0x00)
|
||||
|
||||
@@ -227,6 +227,10 @@ enum SurfaceTypes {
|
||||
SURFACE_TRAPDOOR, // 0x00FF // Bowser Left trapdoor, has no action defined
|
||||
};
|
||||
|
||||
// From Surface 0x1B to 0x1E
|
||||
#define INSTANT_WARP_INDEX_START 0x00 // Equal and greater than Surface 0x1B
|
||||
#define INSTANT_WARP_INDEX_STOP 0x04 // Less than Surface 0x1F
|
||||
|
||||
#define SURFACE_IS_NEW_WATER(cmd) (((cmd) == SURFACE_NEW_WATER) || ((cmd) == SURFACE_NEW_WATER_BOTTOM))
|
||||
#define SURFACE_IS_QUICKSAND(cmd) ((((cmd) >= SURFACE_SHALLOW_QUICKSAND) && ((cmd) <= SURFACE_MOVING_QUICKSAND)) || ((cmd) == SURFACE_INSTANT_MOVING_QUICKSAND))
|
||||
#define SURFACE_IS_NOT_HARD(cmd) (((cmd) != SURFACE_HARD) && !((cmd) >= SURFACE_HARD_SLIPPERY && ((cmd) <= SURFACE_HARD_NOT_SLIPPERY)))
|
||||
@@ -238,7 +242,7 @@ enum SurfaceTypes {
|
||||
#define SURFACE_IS_PAINTING_WARP_LEFT(cmd) ((((cmd) - SURFACE_PAINTING_WARP_D3 ) % 3) == 0)
|
||||
#define SURFACE_IS_PAINTING_WARP_MIDDLE(cmd) ((((cmd) - SURFACE_PAINTING_WARP_D4 ) % 3) == 0)
|
||||
#define SURFACE_IS_PAINTING_WARP_RIGHT(cmd) ((((cmd) - SURFACE_PAINTING_WARP_D5 ) % 3) == 0)
|
||||
#define SURFACE_IS_INSTANT_WARP(cmd) (((cmd) >= SURFACE_INSTANT_WARP_1B) && ((cmd) <= SURFACE_INSTANT_WARP_1E))
|
||||
#define SURFACE_IS_INSTANT_WARP(cmd) (((cmd) >= SURFACE_INSTANT_WARP_1B) && ((cmd) < SURFACE_INSTANT_WARP_1B + INSTANT_WARP_INDEX_STOP))
|
||||
#define SURFACE_IS_WARP(cmd) (((cmd) == SURFACE_LOOK_UP_WARP) || ((cmd) == SURFACE_WOBBLING_WARP) || SURFACE_IS_PAINTING_WARP(cmd) || SURFACE_IS_INSTANT_WARP(cmd))
|
||||
#define SURFACE_IS_UNSAFE(cmd) (((cmd) == SURFACE_BURNING) || SURFACE_IS_QUICKSAND(cmd) || SURFACE_IS_WARP(cmd))
|
||||
|
||||
|
||||
@@ -540,12 +540,12 @@ static void level_cmd_create_instant_warp(void) {
|
||||
|
||||
warp = gAreas[sCurrAreaIndex].instantWarps + CMD_GET(u8, 2);
|
||||
|
||||
warp[0].id = 1;
|
||||
warp[0].id = SURFACE_INSTANT_WARP_1B + CMD_GET(u8, 2);
|
||||
warp[0].area = CMD_GET(u8, 3);
|
||||
|
||||
vec3s_set(warp[0].displacement, CMD_GET(s16, 4),
|
||||
CMD_GET(s16, 6),
|
||||
CMD_GET(s16, 8));
|
||||
warp[0].displacement[0] = CMD_GET(s32, 4);
|
||||
warp[0].displacement[1] = CMD_GET(s32, 8);
|
||||
warp[0].displacement[2] = CMD_GET(s32, 12);
|
||||
}
|
||||
|
||||
sCurrentCmd = CMD_NEXT;
|
||||
|
||||
@@ -20,14 +20,10 @@ struct ObjectWarpNode {
|
||||
/*0x08*/ struct ObjectWarpNode *next;
|
||||
};
|
||||
|
||||
// From Surface 0x1B to 0x1E
|
||||
#define INSTANT_WARP_INDEX_START 0x00 // Equal and greater than Surface 0x1B
|
||||
#define INSTANT_WARP_INDEX_STOP 0x04 // Less than Surface 0x1F
|
||||
|
||||
struct InstantWarp {
|
||||
/*0x00*/ u8 id; // 0 = 0x1B / 1 = 0x1C / 2 = 0x1D / 3 = 0x1E
|
||||
/*0x01*/ u8 area;
|
||||
/*0x02*/ Vec3s displacement;
|
||||
/*0x04*/ Vec3f displacement;
|
||||
};
|
||||
|
||||
struct SpawnInfo {
|
||||
|
||||
@@ -435,6 +435,9 @@ void update_walking_speed(struct MarioState *m) {
|
||||
// Slow down if moving backwards
|
||||
m->forwardVel += 1.1f;
|
||||
} else if (m->forwardVel <= targetSpeed) {
|
||||
if (m->forwardVel <= 8.0f) {
|
||||
m->forwardVel = MIN(m->intendedMag, 8.0f); // same fix as melee dashback
|
||||
}
|
||||
// If accelerating
|
||||
m->forwardVel += 1.1f - m->forwardVel / 43.0f;
|
||||
} else if (m->floor->normal.y >= 0.95f) {
|
||||
|
||||
@@ -10,7 +10,6 @@ DUMMY != mkdir -p $(BUILD_DIR)
|
||||
C_FILES = $(wildcard ./*.c)
|
||||
O_FILES = $(foreach file,$(C_FILES),$(BUILD_DIR)/$(file:.c=.o))
|
||||
|
||||
CROSS := mips-linux-gnu-
|
||||
CC = $(CROSS)gcc
|
||||
AR = $(CROSS)ar
|
||||
|
||||
|
||||
@@ -72,6 +72,7 @@ all: all-except-recomp
|
||||
|
||||
clean:
|
||||
$(RM) $(ALL_PROGRAMS)
|
||||
$(RM) UNFLoader*
|
||||
$(MAKE) -C audiofile clean
|
||||
|
||||
define COMPILE
|
||||
|
||||
@@ -18,8 +18,24 @@ if [ -z "$QEMU_IRIX" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# detect prefix for MIPS toolchain unless CROSS is already defined
|
||||
if [ -z "$CROSS" ]; then
|
||||
if command -v mips64-elf-ld &> /dev/null ; then
|
||||
CROSS=mips64-elf-
|
||||
elif command -v mips-n64-ld &> /dev/null ; then
|
||||
CROSS=mips-n64-
|
||||
elif command -v mips64-ld &> /dev/null ; then
|
||||
CROSS=mips64-
|
||||
elif command -v mips-linux-gnu-ld &> /dev/null ; then
|
||||
CROSS=mips-linux-gnu-
|
||||
elif command -v mips64-linux-gnu-ld &> /dev/null ; then
|
||||
CROSS=mips64-linux-gnu-
|
||||
elif command -v mips-ld &> /dev/null ; then
|
||||
CROSS=mips-
|
||||
else
|
||||
echo "Unable to detect a suitable MIPS toolchain installed"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# bss indexing starts at 3
|
||||
|
||||
59
tools/get_latest_unfloader.py
Normal file
59
tools/get_latest_unfloader.py
Normal file
@@ -0,0 +1,59 @@
|
||||
import platform
|
||||
import os
|
||||
import zipfile
|
||||
import stat
|
||||
import sys
|
||||
|
||||
from requests import request
|
||||
|
||||
|
||||
def get_latest_build_artifacts_url():
|
||||
res = request('GET', 'https://dev.azure.com/buu342/6fa21e4f-4c4b-425c-891d-28537ab457a9/_apis/build/builds?$top=1&api-version=4.1')
|
||||
body = res.json()
|
||||
return os.path.join(body['value'][0]['url'], 'artifacts')
|
||||
|
||||
def main():
|
||||
destpath = sys.argv[1] if len(sys.argv) > 1 else './'
|
||||
is_wsl = 'microsoft-standard' in str(platform.uname()).lower()
|
||||
unf_fn = 'UNFLoader.exe' if is_wsl else 'UNFLoader'
|
||||
artifact_url = get_latest_build_artifacts_url()
|
||||
|
||||
# get all artifacts from most recent build
|
||||
artifacts_res = request('GET', f'{artifact_url}?api-version=4.1')
|
||||
artifacts = artifacts_res.json()['value']
|
||||
|
||||
# get artifact url for current platform
|
||||
platform_artifact_url = None
|
||||
platform_name = 'windows' if is_wsl else 'linux'
|
||||
for artifact in artifacts:
|
||||
a_name = artifact['name']
|
||||
if platform_name in a_name:
|
||||
platform_artifact_url = artifact['resource']['downloadUrl']
|
||||
|
||||
# download unf zipfile
|
||||
artifact_res = request('GET', platform_artifact_url)
|
||||
with open('UNFLoader.zip', 'wb') as unf_fp:
|
||||
unf_fp.write(artifact_res.content)
|
||||
|
||||
# only extract the specific file that we need
|
||||
unfpath = None
|
||||
with zipfile.ZipFile('UNFLoader.zip', 'r') as zip_ref:
|
||||
for zipinfo in zip_ref.infolist():
|
||||
if not zipinfo.is_dir():
|
||||
unfpath = zip_ref.extract(zipinfo)
|
||||
|
||||
unf_bin_path = os.path.join(destpath, unf_fn)
|
||||
# file gets extracted to ./unfloader-{platform}/UNFLoader[.exe],
|
||||
# so move binary to ./UNFLoader[.exe]
|
||||
os.rename(unfpath, unf_bin_path)
|
||||
# remove ./unfloader-{platform}/ directory
|
||||
os.rmdir(unfpath.rstrip(unf_fn))
|
||||
# remove UNFLoader.zip
|
||||
os.remove('UNFLoader.zip')
|
||||
|
||||
# now need to add executable file permissions to unfloader
|
||||
st = os.stat(unf_bin_path)
|
||||
os.chmod(unf_bin_path, st.st_mode | stat.S_IEXEC)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user