You've already forked Microtransactions64
mirror of
https://github.com/Print-and-Panic/Microtransactions64.git
synced 2026-01-21 10:17:19 -08:00
Begin HVQM support
This commit is contained in:
26
Makefile
26
Makefile
@@ -222,8 +222,6 @@ LEVEL_DIRS := $(patsubst levels/%,%,$(dir $(wildcard levels/*/header.h)))
|
||||
SRC_DIRS := src src/engine src/game src/audio src/menu src/buffers actors levels bin data assets asm lib sound
|
||||
BIN_DIRS := bin bin/$(VERSION)
|
||||
|
||||
GODDARD_SRC_DIRS := src/goddard src/goddard/dynlists
|
||||
|
||||
# File dependencies and variables for specific files
|
||||
include Makefile.split
|
||||
|
||||
@@ -231,9 +229,6 @@ include Makefile.split
|
||||
LEVEL_C_FILES := $(wildcard levels/*/leveldata.c) $(wildcard levels/*/script.c) $(wildcard levels/*/geo.c)
|
||||
C_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.c)) $(LEVEL_C_FILES)
|
||||
S_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.s))
|
||||
ULTRA_C_FILES := $(foreach dir,$(ULTRA_SRC_DIRS),$(wildcard $(dir)/*.c))
|
||||
GODDARD_C_FILES := $(foreach dir,$(GODDARD_SRC_DIRS),$(wildcard $(dir)/*.c))
|
||||
ULTRA_S_FILES := $(foreach dir,$(ULTRA_SRC_DIRS),$(wildcard $(dir)/*.s))
|
||||
GENERATED_C_FILES := $(BUILD_DIR)/assets/mario_anim_data.c $(BUILD_DIR)/assets/demo_data.c
|
||||
|
||||
# Sound files
|
||||
@@ -253,15 +248,11 @@ SOUND_SEQUENCE_FILES := \
|
||||
# Object files
|
||||
O_FILES := $(foreach file,$(C_FILES),$(BUILD_DIR)/$(file:.c=.o)) \
|
||||
$(foreach file,$(S_FILES),$(BUILD_DIR)/$(file:.s=.o)) \
|
||||
$(foreach file,$(GENERATED_C_FILES),$(file:.c=.o))
|
||||
|
||||
ULTRA_O_FILES := $(foreach file,$(ULTRA_S_FILES),$(BUILD_DIR)/$(file:.s=.o)) \
|
||||
$(foreach file,$(ULTRA_C_FILES),$(BUILD_DIR)/$(file:.c=.o))
|
||||
|
||||
GODDARD_O_FILES := $(foreach file,$(GODDARD_C_FILES),$(BUILD_DIR)/$(file:.c=.o))
|
||||
$(foreach file,$(GENERATED_C_FILES),$(file:.c=.o)) \
|
||||
lib/PR/hvqm/hvqm2sp1.o lib/PR/hvqm/hvqm2sp2.o
|
||||
|
||||
# Automatic dependency files
|
||||
DEP_FILES := $(O_FILES:.o=.d) $(ULTRA_O_FILES:.o=.d) $(GODDARD_O_FILES:.o=.d) $(BUILD_DIR)/$(LD_SCRIPT).d
|
||||
DEP_FILES := $(O_FILES:.o=.d) $(BUILD_DIR)/$(LD_SCRIPT).d
|
||||
|
||||
# Files with GLOBAL_ASM blocks
|
||||
ifeq ($(NON_MATCHING),0)
|
||||
@@ -324,7 +315,7 @@ ifeq ($(TARGET_N64),1)
|
||||
CC_CFLAGS := -fno-builtin
|
||||
endif
|
||||
|
||||
INCLUDE_DIRS := include $(BUILD_DIR) $(BUILD_DIR)/include src .
|
||||
INCLUDE_DIRS := include $(BUILD_DIR) $(BUILD_DIR)/include src . include/hvqm
|
||||
ifeq ($(TARGET_N64),1)
|
||||
INCLUDE_DIRS += include/libc
|
||||
endif
|
||||
@@ -750,15 +741,10 @@ $(BUILD_DIR)/libultra.a: $(ULTRA_O_FILES)
|
||||
$(V)$(AR) rcs -o $@ $(ULTRA_O_FILES)
|
||||
$(V)$(TOOLS_DIR)/patch_libultra_math $@
|
||||
|
||||
# Link libgoddard
|
||||
$(BUILD_DIR)/libgoddard.a: $(GODDARD_O_FILES)
|
||||
@$(PRINT) "$(GREEN)Linking libgoddard: $(BLUE)$@ $(NO_COL)\n"
|
||||
$(V)$(AR) rcs -o $@ $(GODDARD_O_FILES)
|
||||
|
||||
# Link SM64 ELF file
|
||||
$(ELF): $(O_FILES) $(YAY0_OBJ_FILES) $(SEG_FILES) $(BUILD_DIR)/$(LD_SCRIPT) undefined_syms.txt $(BUILD_DIR)/libultra.a $(BUILD_DIR)/libgoddard.a
|
||||
$(ELF): $(O_FILES) $(YAY0_OBJ_FILES) $(SEG_FILES) $(BUILD_DIR)/$(LD_SCRIPT) undefined_syms.txt $(BUILD_DIR)/libultra.a
|
||||
@$(PRINT) "$(GREEN)Linking ELF file: $(BLUE)$@ $(NO_COL)\n"
|
||||
$(V)$(LD) -L $(BUILD_DIR) -T undefined_syms.txt -T $(BUILD_DIR)/$(LD_SCRIPT) -Map $(BUILD_DIR)/sm64.$(VERSION).map --no-check-sections $(addprefix -R ,$(SEG_FILES)) -o $@ $(O_FILES) -L $(N64_LIBS_DIR) -lultra_rom -lgoddard
|
||||
$(V)$(LD) -L $(BUILD_DIR) -T undefined_syms.txt -T $(BUILD_DIR)/$(LD_SCRIPT) -Map $(BUILD_DIR)/sm64.$(VERSION).map --no-check-sections $(addprefix -R ,$(SEG_FILES)) -o $@ $(O_FILES) -L $(N64_LIBS_DIR) -lultra_rom -lhvqm2
|
||||
|
||||
# Build ROM
|
||||
$(ROM): $(ELF)
|
||||
|
||||
7
data/hvqm.s
Normal file
7
data/hvqm.s
Normal file
@@ -0,0 +1,7 @@
|
||||
.include "macros.inc"
|
||||
|
||||
.section .data
|
||||
|
||||
glabel _hvqmSampleRomStart
|
||||
.incbin "data/joe.hvqm"
|
||||
glabel _hvqmSampleRomEnd
|
||||
BIN
data/joe.hvqm
Normal file
BIN
data/joe.hvqm
Normal file
Binary file not shown.
BIN
data/terry.hvqm
Normal file
BIN
data/terry.hvqm
Normal file
Binary file not shown.
122
include/hvqm/HVQM2File.h
Normal file
122
include/hvqm/HVQM2File.h
Normal file
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* HVQM2File.h: HVQM2(YUV 4:2:2/4:1:1) file format header file.
|
||||
*
|
||||
* Copyright (C) 1998,1999 NINTENDO Co., Ltd.
|
||||
*
|
||||
*/
|
||||
|
||||
/* revision 1.1 1999-02-12 */
|
||||
|
||||
#ifndef __HVQM2FILE_H__
|
||||
#define __HVQM2FILE_H__
|
||||
|
||||
#include <HVQmd.h>
|
||||
|
||||
/*
|
||||
* HVQM2Header : HVQM2 file header
|
||||
*/
|
||||
typedef struct {
|
||||
CARD8 file_version[16]; /* File version "HVQM2 1.0" */
|
||||
CARD32 file_size; /* File size [byte] */
|
||||
|
||||
CARD16 width; /* Number of pixels in horizontal direction of image */
|
||||
CARD16 height; /* Number of pixels in vertical direction of image */
|
||||
CARD8 h_sampling_rate; /* Video UV component's sampling step in horizontal direction */
|
||||
CARD8 v_sampling_rate; /* Video UV component's sampling step in vertical direction */
|
||||
CARD8 y_shiftnum; /* Image base read start y-coordinate LSB */
|
||||
CARD8 video_quantize_shift; /* Video quantized step */
|
||||
|
||||
CARD32 total_frames; /* Total number of video records */
|
||||
CARD32 usec_per_frame; /* Video frame interval [usec.] */
|
||||
CARD32 max_frame_size; /* Maximum size of video record [bytes]
|
||||
(Excluding record header) */
|
||||
CARD32 max_sp_packets; /* Maximum number of packets needed for SP FIFO */
|
||||
|
||||
CARD8 audio_format; /* Audio data format */
|
||||
CARD8 channels; /* Number of audio channels */
|
||||
CARD8 sample_bits; /* Number of bits in 1 sample (channel) [bit] */
|
||||
CARD8 audio_quantize_step; /* Audio quantized step */
|
||||
|
||||
CARD32 total_audio_records; /* Total number of audio records */
|
||||
CARD32 samples_per_sec; /* Number of audio samples per second */
|
||||
CARD32 max_audio_record_size; /* Maximum size of audio record [byte]
|
||||
(Excluding record header) */
|
||||
} HVQM2Header;
|
||||
|
||||
/*
|
||||
* Audio data format (HVQM2Header.audio_format)
|
||||
*/
|
||||
#define HVQM2_AUDIO_PCM 0 /* PCM format */
|
||||
#define HVQM2_AUDIO_IMA_ADPCM 1 /* IMA ADPCM format */
|
||||
|
||||
/*
|
||||
* HVQM2Record : Record header (Located directly after HVQM2Header)
|
||||
*/
|
||||
typedef struct {
|
||||
CARD16 type; /* Record type */
|
||||
CARD16 format; /* Data format */
|
||||
CARD32 size; /* Record size (excluding the header) [byte] */
|
||||
} HVQM2Record;
|
||||
|
||||
/*
|
||||
* Record type (HVQM2Record.type)
|
||||
*/
|
||||
#define HVQM2_AUDIO 0 /* Audio record */
|
||||
#define HVQM2_VIDEO 1 /* Video record */
|
||||
|
||||
/*
|
||||
* Audio record's (HVQM2Record.type == HVQM2_AUDIO)
|
||||
* data type (HVQM2Record.format)
|
||||
*/
|
||||
#define HVQM2_AUDIO_KEYFRAME 0 /* Key frame */
|
||||
#define HVQM2_AUDIO_PREDICT 1 /* Predict frame */
|
||||
|
||||
/*
|
||||
* Video record's (HVQM2Record.type == HVQM2_VIDEO)
|
||||
* data format (HVQM2Record.format)
|
||||
*/
|
||||
#define HVQM2_VIDEO_KEYFRAME 0 /* Key frame */
|
||||
#define HVQM2_VIDEO_PREDICT 1 /* Predict frame */
|
||||
#define HVQM2_VIDEO_HOLD 2 /* Hold frame */
|
||||
|
||||
/*
|
||||
* HVQM2Audio : Audio header (Follows record header)
|
||||
*/
|
||||
typedef struct {
|
||||
CARD32 samples; /* Number of samples (/channels) */
|
||||
} HVQM2Audio;
|
||||
|
||||
/*
|
||||
* HVQM2Frame : Video header (Follows record header)
|
||||
*/
|
||||
typedef struct {
|
||||
CARD32 basisnum_offset[2]; /* Basis number block (0: brightness, 1: color difference) */
|
||||
CARD32 basnumrn_offset[2]; /* Basis number cold run (0: brightness, 1: color difference) */
|
||||
CARD32 scale_offset[3]; /* Basis coefficient (0:Y, 1:U, 2:V) */
|
||||
CARD32 fixvl_offset[3]; /* Fixed length code (0:Y, 1:U, 2:V) */
|
||||
CARD32 dcval_offset[3]; /* Block DC (0:Y, 1:U, 2:V) */
|
||||
} HVQM2Frame;
|
||||
|
||||
/*
|
||||
* HVQM2KeyFrame : Key frame header (Follows the video header)
|
||||
*/
|
||||
typedef struct {
|
||||
CARD32 dcrun_offset[3]; /* DC value cold run (0:Y, 1:U, 2:V) */
|
||||
CARD16 nest_start_x; /* Base start position (x coordinate) */
|
||||
CARD16 nest_start_y; /* Base start position (y coordinate) */
|
||||
} HVQM2KeyFrame;
|
||||
|
||||
/*
|
||||
* HVQM2PredictFrame : Predict frame header (Follows video header)
|
||||
*/
|
||||
typedef struct {
|
||||
CARD32 movevector_offset; /* Movement vector */
|
||||
CARD32 macroblock_offset; /* Macro block state flag */
|
||||
} HVQM2PredictFrame;
|
||||
|
||||
/* Nest size */
|
||||
#define HVQM2_NESTSIZE_L 70 /* Number of elements on long side */
|
||||
#define HVQM2_NESTSIZE_S 38 /* Number of elements on shot side */
|
||||
#define HVQM2_NESTSIZE (HVQM2_NESTSIZE_L * HVQM2_NESTSIZE_S)
|
||||
|
||||
#endif /* __HVQM2FILE_H__ */
|
||||
22
include/hvqm/HVQmd.h
Normal file
22
include/hvqm/HVQmd.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* HVQmd.h: MACHINE DEPENDENT DECLARATIONS. [ For Nintendo64 ]
|
||||
*
|
||||
* Copyright (C) 1998,1999 NINTENDO Co.,Ltd.
|
||||
*
|
||||
*/
|
||||
|
||||
/* revision 1.0 1998-10-14 */
|
||||
|
||||
#ifndef __HVQMD_H__
|
||||
#define __HVQMD_H__
|
||||
|
||||
#include <ultra64.h>
|
||||
|
||||
typedef u8 CARD8;
|
||||
typedef s8 INT8;
|
||||
typedef u16 CARD16;
|
||||
typedef s16 INT16;
|
||||
typedef u32 CARD32;
|
||||
typedef s32 INT32;
|
||||
|
||||
#endif /* __HVQMD_H__ */
|
||||
33
include/hvqm/adpcmdec.h
Normal file
33
include/hvqm/adpcmdec.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* adpcmdec.h - N64-HVQM2 library header file
|
||||
*
|
||||
* Copyright (C) 1998,1999 NINTENDO Co.,Ltd.
|
||||
*
|
||||
*/
|
||||
|
||||
/* revision 1.0 1998-12-17 */
|
||||
|
||||
#ifndef __ADPCMDEC_H__
|
||||
#define __ADPCMDEC_H__
|
||||
|
||||
#include <ultra64.h>
|
||||
|
||||
/* ADPCM state information structure */
|
||||
typedef struct {
|
||||
u8 *inPtr;
|
||||
s16 *outPtr;
|
||||
s16 previous;
|
||||
u8 hi_nibble;
|
||||
u8 step_index;
|
||||
} ADPCMstate;
|
||||
|
||||
/* ADPCM decoder */
|
||||
void adpcmDecode(void *instream, u32 format, u32 samples, s16 *outstream, u32 ex_stereo, ADPCMstate *state);
|
||||
|
||||
/* adpcmDecode() format argument */
|
||||
#define ADPCM_RESET 0
|
||||
#define ADPCM_CONTINUE 1
|
||||
|
||||
#endif /* __ADPCMDEC_H__ */
|
||||
|
||||
/* end */
|
||||
104
include/hvqm/hvqm2dec.h
Normal file
104
include/hvqm/hvqm2dec.h
Normal file
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
* hvqm2dec.h - N64-HVQM2 library header file
|
||||
*
|
||||
* Copyright (C) 1998,1999 NINTENDO Co.,Ltd.
|
||||
*/
|
||||
|
||||
/* revision 1.2 1999-03-26 */
|
||||
|
||||
#ifndef __HVQM2DEC_H__
|
||||
#define __HVQM2DEC_H__
|
||||
|
||||
#include <ultra64.h>
|
||||
#include <HVQM2File.h>
|
||||
|
||||
typedef struct {
|
||||
u8 nbase;
|
||||
u8 dc;
|
||||
u8 dc_l;
|
||||
u8 dc_r;
|
||||
u8 dc_u;
|
||||
u8 dc_d;
|
||||
} HVQM2Block;
|
||||
|
||||
typedef struct {
|
||||
u8 sx;
|
||||
u8 sy;
|
||||
s16 scale;
|
||||
u16 offset;
|
||||
u16 lineskip;
|
||||
} HVQM2Basis;
|
||||
|
||||
typedef union {
|
||||
HVQM2Block blockinfo;
|
||||
HVQM2Basis basisinfo;
|
||||
long long int force_structure_alignment;
|
||||
} HVQM2Info;
|
||||
|
||||
typedef struct {
|
||||
u64 *info;
|
||||
u64 *buf;
|
||||
u16 buf_width;
|
||||
u8 chroma_step_h;
|
||||
u8 chroma_step_v;
|
||||
u16 hmcus;
|
||||
u16 vmcus;
|
||||
u8 alpha;
|
||||
u8 nest[HVQM2_NESTSIZE];
|
||||
} HVQM2Arg_t;
|
||||
|
||||
typedef union {
|
||||
HVQM2Arg_t t;
|
||||
long long int force_structure_alignment;
|
||||
} HVQM2Arg;
|
||||
|
||||
/*
|
||||
* Functions supporting 16-bit color (CPU version)
|
||||
*/
|
||||
void hvqm2Init1(u8 alpha);
|
||||
u32 hvqm2Setup1(HVQM2Header *header, u32 outbufWidth);
|
||||
void hvqm2Decode1(void *code, u32 format, u16 *outbuf, u16 *previm, u16 *workbuf);
|
||||
|
||||
/*
|
||||
* Functions supporting 32-bit color (CPU version)
|
||||
*/
|
||||
void hvqm2Init2(u8 alpha);
|
||||
u32 hvqm2Setup2(HVQM2Header *header, u32 outbufWidth);
|
||||
void hvqm2Decode2(void *code, u32 format, u32 *outbuf, u32 *previm, u16 *workbuf);
|
||||
|
||||
/*
|
||||
* Functions supporting 16-bit color (RSP version)
|
||||
*/
|
||||
void hvqm2InitSP1(u8 alpha);
|
||||
u32 hvqm2SetupSP1(HVQM2Header *header, u32 outbufWidth);
|
||||
u32 hvqm2DecodeSP1(void *code, u32 format, u16 *outbuf, u16 *previm, u16 *workbuf, HVQM2Arg *arg, HVQM2Info *infobuf);
|
||||
|
||||
/*
|
||||
* Functions supporting 32-bit color (RSP version)
|
||||
*/
|
||||
void hvqm2InitSP2(u8 alpha);
|
||||
u32 hvqm2SetupSP2(HVQM2Header *header, u32 outbufWidth);
|
||||
u32 hvqm2DecodeSP2(void *code, u32 format, u32 *outbuf, u32 *previm, u16 *workbuf, HVQM2Arg *arg, HVQM2Info *infobuf);
|
||||
|
||||
/*
|
||||
* RSP microcode-related definitions
|
||||
*/
|
||||
#define M_HVQM2TASK 7 /* task type */
|
||||
#define HVQM2_UCODE_DATA_SIZE 0x70 /* microcode data size */
|
||||
#define HVQM2_YIELD_DATA_SIZE 0xc10 /* yield buffer size */
|
||||
|
||||
/*
|
||||
* Definitions for RSP microcode supporting 16-bit color
|
||||
*/
|
||||
extern u8 hvqm2sp1TextStart[], hvqm2sp1TextEnd[];
|
||||
extern u8 hvqm2sp1DataStart[], hvqm2sp1DataEnd[];
|
||||
|
||||
/*
|
||||
* Definitions for RSP microcode supporting 32-bit color
|
||||
*/
|
||||
extern u8 hvqm2sp2TextStart[], hvqm2sp2TextEnd[];
|
||||
extern u8 hvqm2sp2DataStart[], hvqm2sp2DataEnd[];
|
||||
|
||||
#endif /* __HVQM2DEC_H__ */
|
||||
|
||||
/* end */
|
||||
@@ -166,8 +166,8 @@
|
||||
CMD_PTR(romEnd)
|
||||
#endif
|
||||
|
||||
#define LOAD_MARIO_HEAD(sethead) \
|
||||
CMD_BBH(0x19, 0x04, sethead)
|
||||
#define LOAD_MARIO_HEAD() \
|
||||
CMD_BBH(0x32, 0x04, 0x0000)
|
||||
|
||||
#ifdef NO_SEGMENTED_MEMORY
|
||||
#define LOAD_YAY0_TEXTURE(seg, romStart, romEnd) \
|
||||
|
||||
@@ -61,9 +61,6 @@ const GeoLayout intro_geo_mario_head_regular[] = {
|
||||
GEO_ZBUFFER(1),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_CAMERA_FRUSTUM(45, 128, 16384),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_ASM(2, geo_draw_mario_head_goddard),
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_CLOSE_NODE(),
|
||||
#ifdef VERSION_SH
|
||||
GEO_ZBUFFER(0),
|
||||
@@ -92,9 +89,6 @@ const GeoLayout intro_geo_mario_head_dizzy[] = {
|
||||
GEO_ZBUFFER(1),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_CAMERA_FRUSTUM(45, 128, 16384),
|
||||
GEO_OPEN_NODE(),
|
||||
GEO_ASM(3, geo_draw_mario_head_goddard),
|
||||
GEO_CLOSE_NODE(),
|
||||
GEO_CLOSE_NODE(),
|
||||
#ifdef VERSION_SH
|
||||
GEO_ZBUFFER(0),
|
||||
|
||||
@@ -47,7 +47,6 @@ const LevelScript level_intro_mario_head_regular[] = {
|
||||
INIT_LEVEL(),
|
||||
BLACKOUT(/*active*/ TRUE),
|
||||
FIXED_LOAD(/*loadAddr*/ _goddardSegmentStart, /*romStart*/ _goddardSegmentRomStart, /*romEnd*/ _goddardSegmentRomEnd),
|
||||
LOAD_MARIO_HEAD(/*loadHeadID*/ REGULAR_FACE),
|
||||
LOAD_RAW(/*seg*/ 0x13, _behaviorSegmentRomStart, _behaviorSegmentRomEnd),
|
||||
LOAD_YAY0_TEXTURE(/*seg*/ 0x0A, _title_screen_bg_yay0SegmentRomStart, _title_screen_bg_yay0SegmentRomEnd),
|
||||
|
||||
@@ -72,7 +71,6 @@ const LevelScript level_intro_mario_head_dizzy[] = {
|
||||
INIT_LEVEL(),
|
||||
BLACKOUT(/*active*/ TRUE),
|
||||
FIXED_LOAD(/*loadAddr*/ _goddardSegmentStart, /*romStart*/ _goddardSegmentRomStart, /*romEnd*/ _goddardSegmentRomEnd),
|
||||
LOAD_MARIO_HEAD(/*loadHeadID*/ DIZZY_FACE),
|
||||
LOAD_RAW(/*seg*/ 0x13, _behaviorSegmentRomStart, _behaviorSegmentRomEnd),
|
||||
LOAD_YAY0_TEXTURE(/*seg*/ 0x0A, _title_screen_bg_yay0SegmentRomStart, _title_screen_bg_yay0SegmentRomEnd),
|
||||
ALLOC_LEVEL_POOL(),
|
||||
|
||||
104
sm64.ld
104
sm64.ld
@@ -162,6 +162,7 @@ SECTIONS
|
||||
|
||||
*/libultra_rom.a:*.o(.bss*);
|
||||
*/libultra_rom.a:*.o(.sbss*);
|
||||
*/libhvqm2.a:*.o(.bss*);
|
||||
|
||||
. = ALIGN(0x8);
|
||||
}
|
||||
@@ -256,85 +257,14 @@ SECTIONS
|
||||
/* 0x8016F000 21D7D0-255EC0 [386F0] */
|
||||
BEGIN_SEG(goddard, SEG_GODDARD)
|
||||
{
|
||||
BUILD_DIR/src/menu/level_select_menu.o(.text);
|
||||
BUILD_DIR/src/menu/intro_geo.o(.text);
|
||||
BUILD_DIR/src/menu/file_select.o(.text);
|
||||
BUILD_DIR/src/menu/star_select.o(.text);
|
||||
BUILD_DIR/src/menu*.o(.text);
|
||||
BUILD_DIR/libgoddard.a:gd_main.o(.text);
|
||||
BUILD_DIR/libgoddard.a:gd_memory.o(.text);
|
||||
BUILD_DIR/libgoddard.a:sfx.o(.text);
|
||||
BUILD_DIR/libgoddard.a:draw_objects.o(.text);
|
||||
BUILD_DIR/libgoddard.a:objects.o(.text);
|
||||
BUILD_DIR/libgoddard.a:skin_movement.o(.text);
|
||||
BUILD_DIR/libgoddard.a:particles.o(.text);
|
||||
BUILD_DIR/libgoddard.a:dynlist_proc.o(.text);
|
||||
BUILD_DIR/libgoddard.a:old_menu.o(.text);
|
||||
BUILD_DIR/libgoddard.a:debug_utils.o(.text);
|
||||
BUILD_DIR/libgoddard.a:joints.o(.text);
|
||||
BUILD_DIR/libgoddard.a:skin.o(.text);
|
||||
BUILD_DIR/libgoddard.a:gd_math.o(.text);
|
||||
BUILD_DIR/libgoddard.a:shape_helper.o(.text);
|
||||
BUILD_DIR/libgoddard.a:renderer.o(.text);
|
||||
BUILD_DIR/libgoddard.a:*.o(.text);
|
||||
/* data, rodata, per file */
|
||||
BUILD_DIR/src/menu/level_select_menu.o(.data*);
|
||||
BUILD_DIR/src/menu/level_select_menu.o(.rodata*);
|
||||
BUILD_DIR/src/menu/intro_geo.o(.data*);
|
||||
BUILD_DIR/src/menu/file_select.o(.data*);
|
||||
BUILD_DIR/src/menu/file_select.o(.rodata*);
|
||||
BUILD_DIR/src/menu/star_select.o(.data*);
|
||||
BUILD_DIR/src/menu/star_select.o(.rodata*);
|
||||
BUILD_DIR/src/menu*.o(.data*);
|
||||
BUILD_DIR/src/menu*.o(.rodata*);
|
||||
/* goddard subsystem data */
|
||||
BUILD_DIR/libgoddard.a:gd_main.o(.data*);
|
||||
BUILD_DIR/libgoddard.a:draw_objects.o(.data*);
|
||||
BUILD_DIR/libgoddard.a:objects.o(.data*);
|
||||
BUILD_DIR/libgoddard.a:particles.o(.data*);
|
||||
BUILD_DIR/libgoddard.a:dynlist_proc.o(.data*);
|
||||
BUILD_DIR/libgoddard.a:debug_utils.o(.data*);
|
||||
BUILD_DIR/libgoddard.a:joints.o(.data*);
|
||||
BUILD_DIR/libgoddard.a:shape_helper.o(.data*);
|
||||
BUILD_DIR/libgoddard.a:renderer.o(.data*);
|
||||
/* goddard subsystem rodata */
|
||||
BUILD_DIR/libgoddard.a:gd_main.o(.rodata*);
|
||||
BUILD_DIR/libgoddard.a:gd_memory.o(.rodata*);
|
||||
BUILD_DIR/libgoddard.a:draw_objects.o(.rodata*);
|
||||
BUILD_DIR/libgoddard.a:objects.o(.rodata*);
|
||||
BUILD_DIR/libgoddard.a:skin_movement.o(.rodata*);
|
||||
BUILD_DIR/libgoddard.a:particles.o(.rodata*);
|
||||
BUILD_DIR/libgoddard.a:dynlist_proc.o(.rodata*);
|
||||
BUILD_DIR/libgoddard.a:old_menu.o(.rodata*);
|
||||
BUILD_DIR/libgoddard.a:debug_utils.o(.rodata*);
|
||||
BUILD_DIR/libgoddard.a:joints.o(.rodata*);
|
||||
BUILD_DIR/libgoddard.a:skin.o(.rodata*);
|
||||
BUILD_DIR/libgoddard.a:gd_math.o(.rodata*);
|
||||
BUILD_DIR/libgoddard.a:shape_helper.o(.rodata*);
|
||||
BUILD_DIR/libgoddard.a:renderer.o(.rodata*);
|
||||
}
|
||||
END_SEG(goddard)
|
||||
BEGIN_NOLOAD(goddard)
|
||||
{
|
||||
BUILD_DIR/src/menu/intro_geo.o(.bss*);
|
||||
BUILD_DIR/src/menu/file_select.o(.bss*);
|
||||
BUILD_DIR/src/menu/star_select.o(.bss*);
|
||||
BUILD_DIR/src/menu*.o(.bss*);
|
||||
BUILD_DIR/libgoddard.a:gd_main.o(.bss*);
|
||||
BUILD_DIR/libgoddard.a:gd_memory.o(.bss*);
|
||||
BUILD_DIR/libgoddard.a:sfx.o(.bss*);
|
||||
BUILD_DIR/libgoddard.a:draw_objects.o(.bss*);
|
||||
BUILD_DIR/libgoddard.a:objects.o(.bss*);
|
||||
BUILD_DIR/libgoddard.a:skin_movement.o(.bss*);
|
||||
BUILD_DIR/libgoddard.a:particles.o(.bss*);
|
||||
BUILD_DIR/libgoddard.a:dynlist_proc.o(.bss*);
|
||||
BUILD_DIR/libgoddard.a:old_menu.o(.bss*);
|
||||
BUILD_DIR/libgoddard.a:debug_utils.o(.bss*);
|
||||
BUILD_DIR/libgoddard.a:joints.o(.bss*);
|
||||
BUILD_DIR/libgoddard.a:skin.o(.bss*);
|
||||
BUILD_DIR/libgoddard.a:shape_helper.o(.bss*);
|
||||
BUILD_DIR/libgoddard.a:renderer.o(.bss*);
|
||||
BUILD_DIR/libgoddard.a:*.o(.bss*);
|
||||
}
|
||||
END_NOLOAD(goddard)
|
||||
|
||||
@@ -358,29 +288,6 @@ SECTIONS
|
||||
YAY0_SEG(debug_level_select, 0x07000000)
|
||||
YAY0_SEG(title_screen_bg, 0x0A000000)
|
||||
|
||||
/* 271B20-2A42A0 [32780] */
|
||||
BEGIN_SEG(gd_dynlists, 0x04000000)
|
||||
{
|
||||
BUILD_DIR/libgoddard.a:dynlist_test_cube.o(.data);
|
||||
BUILD_DIR/libgoddard.a:dynlist_unused.o(.data);
|
||||
BUILD_DIR/libgoddard.a:dynlist_mario_face.o(.data);
|
||||
BUILD_DIR/libgoddard.a:dynlists_mario_eyes.o(.data);
|
||||
BUILD_DIR/libgoddard.a:dynlists_mario_eyebrows_mustache.o(.data);
|
||||
BUILD_DIR/libgoddard.a:dynlist_mario_master.o(.data);
|
||||
BUILD_DIR/libgoddard.a:anim_mario_mustache_right.o(.data);
|
||||
BUILD_DIR/libgoddard.a:anim_mario_mustache_left.o(.data);
|
||||
BUILD_DIR/libgoddard.a:anim_mario_lips_1.o(.data);
|
||||
BUILD_DIR/libgoddard.a:anim_mario_lips_2.o(.data);
|
||||
BUILD_DIR/libgoddard.a:anim_mario_eyebrows_1.o(.data);
|
||||
BUILD_DIR/libgoddard.a:anim_group_1.o(.data);
|
||||
BUILD_DIR/libgoddard.a:anim_group_2.o(.data);
|
||||
BUILD_DIR/libgoddard.a:dynlist_test_cube.o(.rodata*);
|
||||
BUILD_DIR/libgoddard.a:dynlist_unused.o(.rodata*);
|
||||
BUILD_DIR/libgoddard.a:*.o(.data);
|
||||
BUILD_DIR/libgoddard.a:*.o(.rodata);
|
||||
}
|
||||
END_SEG(gd_dynlists)
|
||||
|
||||
gMainLevels = __romPos;
|
||||
|
||||
BEGIN_SEG(menu, 0x14000000)
|
||||
@@ -445,12 +352,15 @@ SECTIONS
|
||||
BUILD_DIR/sound/sound_data.o(.data);
|
||||
}
|
||||
END_SEG(assets)
|
||||
|
||||
|
||||
BEGIN_SEG(hvqm, __romPos)
|
||||
{
|
||||
BUILD_DIR/data/hvqm.o(.data);
|
||||
}
|
||||
END_SEG(hvqm)
|
||||
/* Discard everything not specifically mentioned above. */
|
||||
/DISCARD/ :
|
||||
{
|
||||
*(*);
|
||||
}
|
||||
}
|
||||
EXTERN(osPfsIsPlug)
|
||||
EXTERN(__osLeoInterrupt)
|
||||
|
||||
@@ -3,10 +3,4 @@
|
||||
#include "config.h"
|
||||
|
||||
// 0x70800 bytes
|
||||
#ifdef AVOID_UB
|
||||
u16 gFrameBuffers[3][SCREEN_WIDTH * SCREEN_HEIGHT];
|
||||
#else
|
||||
u16 gFrameBuffer0[SCREEN_WIDTH * SCREEN_HEIGHT];
|
||||
u16 gFrameBuffer1[SCREEN_WIDTH * SCREEN_HEIGHT];
|
||||
u16 gFrameBuffer2[SCREEN_WIDTH * SCREEN_HEIGHT];
|
||||
#endif
|
||||
|
||||
@@ -8,15 +8,9 @@
|
||||
// level_script.c assumes that the frame buffers are adjacent, while game.c's
|
||||
// -g codegen implies that they are separate variables. This is impossible to
|
||||
// reconcile without undefined behavior. Avoid that when possible.
|
||||
#ifdef AVOID_UB
|
||||
extern u16 gFrameBuffers[3][SCREEN_WIDTH * SCREEN_HEIGHT];
|
||||
#define gFrameBuffer0 gFrameBuffers[0]
|
||||
#define gFrameBuffer1 gFrameBuffers[1]
|
||||
#define gFrameBuffer2 gFrameBuffers[2]
|
||||
#else
|
||||
extern u16 gFrameBuffer0[SCREEN_WIDTH * SCREEN_HEIGHT];
|
||||
extern u16 gFrameBuffer1[SCREEN_WIDTH * SCREEN_HEIGHT];
|
||||
extern u16 gFrameBuffer2[SCREEN_WIDTH * SCREEN_HEIGHT];
|
||||
#endif
|
||||
|
||||
#endif // FRAMEBUFFERS_H
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#include "game/profiler.h"
|
||||
#include "game/save_file.h"
|
||||
#include "game/sound_init.h"
|
||||
#include "goddard/renderer.h"
|
||||
#include "geo_layout.h"
|
||||
#include "graph_node.h"
|
||||
#include "level_script.h"
|
||||
@@ -281,17 +280,6 @@ static void level_cmd_load_yay0(void) {
|
||||
}
|
||||
|
||||
static void level_cmd_load_mario_head(void) {
|
||||
// TODO: Fix these hardcoded sizes
|
||||
void *addr = main_pool_alloc(DOUBLE_SIZE_ON_64_BIT(0xE1000), MEMORY_POOL_LEFT);
|
||||
if (addr != NULL) {
|
||||
gdm_init(addr, DOUBLE_SIZE_ON_64_BIT(0xE1000));
|
||||
gd_add_to_heap(gZBuffer, sizeof(gZBuffer)); // 0x25800
|
||||
gd_add_to_heap(gFrameBuffer0, 3 * sizeof(gFrameBuffer0)); // 0x70800
|
||||
gdm_setup();
|
||||
gdm_maketestdl(CMD_GET(s16, 2));
|
||||
} else {
|
||||
}
|
||||
|
||||
sCurrentCmd = CMD_NEXT;
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ UNUSED u8 filler80339D30[0x90];
|
||||
s32 unused8032C690 = 0;
|
||||
u32 gGlobalTimer = 0;
|
||||
|
||||
static u16 sCurrFBNum = 0;
|
||||
u16 sCurrFBNum = 0;
|
||||
u16 frameBufferIndex = 0;
|
||||
void (*gGoddardVblankCallback)(void) = NULL;
|
||||
struct Controller *gPlayer1Controller = &gControllers[0];
|
||||
@@ -647,5 +647,11 @@ void thread5_game_loop(UNUSED void *arg) {
|
||||
// amount of free space remaining.
|
||||
print_text_fmt_int(180, 20, "BUF %d", gGfxPoolEnd - (u8 *) gDisplayListHead);
|
||||
}
|
||||
#if 0
|
||||
if (gPlayer1Controller->buttonPressed & L_TRIG) {
|
||||
osStartThread(&hvqmThread);
|
||||
osRecvMesg(&gDmaMesgQueue, NULL, OS_MESG_BLOCK);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ OSMesg gUnknownMesgBuf[16];
|
||||
|
||||
struct VblankHandler *gVblankHandler1 = NULL;
|
||||
struct VblankHandler *gVblankHandler2 = NULL;
|
||||
struct VblankHandler *gVblankHandler3 = NULL;
|
||||
struct SPTask *gActiveSPTask = NULL;
|
||||
struct SPTask *sCurrentAudioSPTask = NULL;
|
||||
struct SPTask *sCurrentDisplaySPTask = NULL;
|
||||
@@ -265,6 +266,9 @@ void handle_vblank(void) {
|
||||
if (gVblankHandler2 != NULL) {
|
||||
osSendMesg(gVblankHandler2->queue, gVblankHandler2->msg, OS_MESG_NOBLOCK);
|
||||
}
|
||||
if (gVblankHandler3 != NULL) {
|
||||
osSendMesg(gVblankHandler3->queue, gVblankHandler3->msg, OS_MESG_NOBLOCK);
|
||||
}
|
||||
}
|
||||
|
||||
void handle_sp_complete(void) {
|
||||
@@ -336,6 +340,8 @@ void thread3_main(UNUSED void *arg) {
|
||||
create_thread(&gGameLoopThread, 5, thread5_game_loop, NULL, gThread5Stack + 0x2000, 10);
|
||||
osStartThread(&gGameLoopThread);
|
||||
|
||||
//createHvqmThread();
|
||||
|
||||
while (TRUE) {
|
||||
OSMesg msg;
|
||||
|
||||
@@ -372,6 +378,9 @@ void set_vblank_handler(s32 index, struct VblankHandler *handler, OSMesgQueue *q
|
||||
case 2:
|
||||
gVblankHandler2 = handler;
|
||||
break;
|
||||
case 3:
|
||||
gVblankHandler3 = handler;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ extern OSThread gIdleThread;
|
||||
extern OSThread gMainThread;
|
||||
extern OSThread gGameLoopThread;
|
||||
extern OSThread gSoundThread;
|
||||
extern OSThread hvqmThread;
|
||||
#if ENABLE_RUMBLE
|
||||
extern OSThread gRumblePakThread;
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include "engine/math_util.h"
|
||||
#include "envfx_snow.h"
|
||||
#include "game_init.h"
|
||||
#include "goddard/renderer.h"
|
||||
#include "interaction.h"
|
||||
#include "level_update.h"
|
||||
#include "mario_misc.h"
|
||||
@@ -78,27 +77,6 @@ struct GraphNodeObject gMirrorMario; // copy of Mario's geo node for drawing mi
|
||||
// (message NPC related things, the Mario head geo, and Mario geo
|
||||
// functions)
|
||||
|
||||
/**
|
||||
* Geo node script that draws Mario's head on the title screen.
|
||||
*/
|
||||
Gfx *geo_draw_mario_head_goddard(s32 callContext, struct GraphNode *node, Mat4 *c) {
|
||||
Gfx *gfx = NULL;
|
||||
s16 sfx = 0;
|
||||
struct GraphNodeGenerated *asGenerated = (struct GraphNodeGenerated *) node;
|
||||
UNUSED Mat4 *transform = c;
|
||||
|
||||
if (callContext == GEO_CONTEXT_RENDER) {
|
||||
if (gPlayer1Controller->controllerData != NULL && !gWarpTransition.isActive) {
|
||||
gd_copy_p1_contpad(gPlayer1Controller->controllerData);
|
||||
}
|
||||
gfx = (Gfx *) PHYSICAL_TO_VIRTUAL(gdm_gettestdl(asGenerated->parameter));
|
||||
gGoddardVblankCallback = gd_vblank;
|
||||
sfx = gd_sfx_to_play();
|
||||
play_menu_sounds(sfx);
|
||||
}
|
||||
return gfx;
|
||||
}
|
||||
|
||||
static void toad_message_faded(void) {
|
||||
if (gCurrentObject->oDistanceToMario > 700.0f) {
|
||||
gCurrentObject->oToadMessageRecentlyTalked = FALSE;
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
extern struct GraphNodeObject gMirrorMario;
|
||||
extern struct MarioBodyState gBodyStates[2];
|
||||
|
||||
Gfx *geo_draw_mario_head_goddard(s32 callContext, struct GraphNode *node, Mat4 *c);
|
||||
void bhv_toad_message_loop(void);
|
||||
void bhv_toad_message_init(void);
|
||||
void bhv_unlock_door_star_init(void);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user