You've already forked hackerlibultra
mirror of
https://github.com/HackerN64/hackerlibultra.git
synced 2026-01-21 10:37:53 -08:00
Match libgultra_d.a and libgultra.a (#36)
* Begin stages of _d * Match audio * Match ldiv * match llbit * Match string.c (memcpy matched by wiseguy) * match syncprintf * Match flash code and skip libc X files (will do later) * fix flash formatting and match some voice files * More voice files * More voice progress * voice finish * Match ai and sched * Match aisetfreq (done by Tharo) and a few more * match eep read/write * more io files * match epi * Match gbpak and motor * PFS mostly matched * Match PI * Match SI * Match SP code * Match VI code * Fix alignment * Match RG * Fix exceptasm * parse_gbi fix * OS part 1 * Fix conflict * Fix some bugs * More files * more matching * Almost there * begin some libultra_d code * add delay * Match timerintr * fix for merge * match logfloat * printregion match * log OK * profile OK * commonerror OK, plus small cleanups in profile and log * small cleanup of commonerror * Start * Small cleanup * Defines for constants and other cleanup (#1) * Integrated fakechroot to match file paths for monutil * Added generation of symlink to /bin for the chroot * Matched monutil (#2) * Added support for libgultra.a building * Matched profile for libgultra.a * Fixed host_ptn64 symtab diff, better support for building different versions * finish libgultra_d (#33) * finish libgultra_d * clean up some old comments * IDO recomp redirect (#35) * Updates for patched ido * Some clean up * new line * Update table to reflect that libgultra.a and libgultra_d.a are matched * Change default target to libgultra_rom * Replaced some magic numbers with defines, removed binlink * Added explicit alignment to any implicitly aligned variables (#37) * newlines * profile cleanup * va_end * formating * WAIT_ON_IOBUSY * OS_VI_SPECIAL_MAX * Ido download latest * yeet useless __assertBreak * Enable ci for all L libgultra * Fix NULL syntax * osViGetCurrentFramebuffer * Format (#40) * format * file modes * logfloat * Fix wrong permisions * left* * Cleanups * Missed an rdb.h * newlines --------- Co-authored-by: CrashOveride95 <crashoveride953@gmail.com> Co-authored-by: CrashOveride95 <40003130+CrashOveride95@users.noreply.github.com> Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com> Co-authored-by: pixel-stuck <mathmcclintic@gmail.com>
This commit is contained in:
2
.github/workflows/ci_gcc.yml
vendored
2
.github/workflows/ci_gcc.yml
vendored
@@ -14,7 +14,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
version: [L] # [H, I, I_patch, J, K, L]
|
||||
suffix: [_rom] # [, _d, _rom]
|
||||
suffix: [~, _d, _rom]
|
||||
|
||||
steps:
|
||||
- name: Checkout reposistory
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -17,6 +17,7 @@ build/
|
||||
expected/
|
||||
notes/
|
||||
tools/gcc
|
||||
tools/ido
|
||||
*.elf
|
||||
*.o
|
||||
*.a
|
||||
|
||||
57
Makefile
57
Makefile
@@ -1,9 +1,12 @@
|
||||
NON_MATCHING ?= 0
|
||||
|
||||
TARGET := libgultra_rom
|
||||
# One of libgultra_rom, libgultra_d, libgultra
|
||||
TARGET ?= libgultra_rom
|
||||
|
||||
BASE_DIR := base_$(TARGET)
|
||||
BASE_AR := $(TARGET).a
|
||||
BUILD_DIR := build
|
||||
BUILD_ROOT := build
|
||||
BUILD_DIR := $(BUILD_ROOT)/$(TARGET)
|
||||
BUILD_AR := $(BUILD_DIR)/$(TARGET).a
|
||||
|
||||
WORKING_DIR := $(shell pwd)
|
||||
@@ -16,19 +19,24 @@ AR_OLD := tools/gcc/ar
|
||||
|
||||
export COMPILER_PATH := $(WORKING_DIR)/tools/gcc
|
||||
|
||||
CFLAGS := -w -nostdinc -c -G 0 -mgp32 -mfp32 -mips3 -D_LANGUAGE_C
|
||||
CFLAGS := -w -nostdinc -c -G 0 -mgp32 -mfp32 -mips3 -D_LANGUAGE_C
|
||||
ASFLAGS := -w -nostdinc -c -G 0 -mgp32 -mfp32 -mips3 -DMIPSEB -D_LANGUAGE_ASSEMBLY -D_MIPS_SIM=1 -D_ULTRA64 -x assembler-with-cpp
|
||||
GBIDEFINE := -DF3DEX_GBI_2
|
||||
CPPFLAGS = -D_MIPS_SZLONG=32 -D__USE_ISOC99 -I $(WORKING_DIR)/include -I $(WORKING_DIR)/include/gcc -I $(WORKING_DIR)/include/PR $(GBIDEFINE)
|
||||
CPPFLAGS = -D_MIPS_SZLONG=32 -D__USE_ISOC99 $(GBIDEFINE)
|
||||
INCLUDES = -I . -I $(WORKING_DIR)/include -I $(WORKING_DIR)/include/gcc -I $(WORKING_DIR)/include/PR
|
||||
|
||||
ifeq ($(findstring _d,$(TARGET)),_d)
|
||||
CPPFLAGS += -D_DEBUG
|
||||
OPTFLAGS := -O0
|
||||
else
|
||||
CPPFLAGS += -DNDEBUG -D_FINALROM
|
||||
CPPFLAGS += -DNDEBUG
|
||||
OPTFLAGS := -O3
|
||||
endif
|
||||
|
||||
ifeq ($(findstring _rom,$(TARGET)),_rom)
|
||||
CPPFLAGS += -D_FINALROM
|
||||
endif
|
||||
|
||||
SRC_DIRS := $(shell find src -type d)
|
||||
ASM_DIRS := $(shell find asm -type d -not -path "asm/non_matchings*")
|
||||
C_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.c))
|
||||
@@ -74,7 +82,7 @@ ifneq ($(NON_MATCHING),1)
|
||||
endif
|
||||
|
||||
clean:
|
||||
$(RM) -rf $(BUILD_DIR)
|
||||
$(RM) -rf $(BUILD_ROOT)
|
||||
|
||||
distclean: clean
|
||||
$(MAKE) -C tools distclean
|
||||
@@ -110,26 +118,31 @@ STRIP =
|
||||
$(BUILD_DIR)/src/os/initialize_isv.marker: OPTFLAGS := -O2
|
||||
$(BUILD_DIR)/src/os/initialize_isv.marker: STRIP = && tools/gcc/strip-2.7 -N initialize_isv.c $(WORKING_DIR)/$(@:.marker=.o) $(WORKING_DIR)/$(@:.marker=.o)
|
||||
$(BUILD_DIR)/src/os/assert.marker: OPTFLAGS := -O0
|
||||
$(BUILD_DIR)/src/os/ackramromread.marker: OPTFLAGS := -O0
|
||||
$(BUILD_DIR)/src/os/ackramromwrite.marker: OPTFLAGS := -O0
|
||||
$(BUILD_DIR)/src/os/exit.marker: OPTFLAGS := -O0
|
||||
$(BUILD_DIR)/src/os/seterrorhandler.marker: OPTFLAGS := -O0
|
||||
$(BUILD_DIR)/src/gu/parse_gbi.marker: GBIDEFINE :=
|
||||
$(BUILD_DIR)/src/gu/us2dex_emu.marker: GBIDEFINE := -DF3DEX_GBI
|
||||
$(BUILD_DIR)/src/sp/sprite.marker: GBIDEFINE :=
|
||||
$(BUILD_DIR)/src/sp/spriteex.marker: GBIDEFINE :=
|
||||
$(BUILD_DIR)/src/sp/spriteex2.marker: GBIDEFINE :=
|
||||
$(BUILD_DIR)/src/sp/spriteex2.marker: GBIDEFINE :=
|
||||
$(BUILD_DIR)/src/mgu/%.marker: export VR4300MUL := OFF
|
||||
$(BUILD_DIR)/src/mgu/rotate.marker: export VR4300MUL := ON
|
||||
$(BUILD_DIR)/src/debug/%.marker: ASFLAGS += -P
|
||||
$(BUILD_DIR)/src/error/%.marker: ASFLAGS += -P
|
||||
$(BUILD_DIR)/src/log/%.marker: ASFLAGS += -P
|
||||
$(BUILD_DIR)/src/os/%.marker: ASFLAGS += -P
|
||||
$(BUILD_DIR)/src/gu/%.marker: ASFLAGS += -P
|
||||
$(BUILD_DIR)/src/libc/%.marker: ASFLAGS += -P
|
||||
$(BUILD_DIR)/src/rmon/%.marker: ASFLAGS += -P
|
||||
$(BUILD_DIR)/src/voice/%.marker: OPTFLAGS += -DLANG_JAPANESE -I$(WORKING_DIR)/src -I$(WORKING_DIR)/src/voice
|
||||
$(BUILD_DIR)/src/voice/%.marker: CC := tools/compile_sjis.py -D__CC=$(WORKING_DIR)/$(CC)
|
||||
$(BUILD_DIR)/src/voice/%.marker: CC := tools/compile_sjis.py -D__CC=$(WORKING_DIR)/$(CC) -D__BUILD_DIR=$(BUILD_DIR)
|
||||
$(BUILD_DIR)/src/host/host_ptn64.marker: CFLAGS += -fno-builtin # Probably a better way to solve this
|
||||
|
||||
MDEBUG_FILES := $(BUILD_DIR)/src/monutil.marker
|
||||
$(BUILD_DIR)/src/monutil.marker: CC := tools/ido/cc
|
||||
$(BUILD_DIR)/src/monutil.marker: ASFLAGS := -non_shared -mips2 -fullwarn -verbose -Xcpluscomm -G 0 -woff 516,649,838,712 -Wab,-r4300_mul -nostdinc -o32 -c
|
||||
|
||||
$(BUILD_DIR)/%.marker: %.c
|
||||
cd $(<D) && $(WORKING_DIR)/$(CC) $(CFLAGS) $(CPPFLAGS) $(OPTFLAGS) $(<F) -o $(WORKING_DIR)/$(@:.marker=.o)
|
||||
cd $(<D) && $(WORKING_DIR)/$(CC) $(CFLAGS) $(CPPFLAGS) $(OPTFLAGS) $(<F) $(INCLUDES) -o $(WORKING_DIR)/$(@:.marker=.o)
|
||||
ifneq ($(NON_MATCHING),1)
|
||||
# check if this file is in the archive; patch corrupted bytes and change file timestamps to match original if so
|
||||
$(if $(findstring $(BASE_DIR)/$(@F:.marker=.o), $(BASE_OBJS)), \
|
||||
@@ -143,7 +156,25 @@ ifneq ($(NON_MATCHING),1)
|
||||
endif
|
||||
|
||||
$(BUILD_DIR)/%.marker: %.s
|
||||
cd $(<D) && $(WORKING_DIR)/$(CC) $(ASFLAGS) $(CPPFLAGS) -I. $(OPTFLAGS) $(<F) -o $(WORKING_DIR)/$(@:.marker=.o)
|
||||
cd $(<D) && $(WORKING_DIR)/$(CC) $(ASFLAGS) $(CPPFLAGS) $(<F) $(INCLUDES) -o $(WORKING_DIR)/$(@:.marker=.o)
|
||||
ifneq ($(NON_MATCHING),1)
|
||||
# check if this file is in the archive; patch corrupted bytes and change file timestamps to match original if so
|
||||
@$(if $(findstring $(BASE_DIR)/$(@F:.marker=.o), $(BASE_OBJS)), \
|
||||
python3 tools/fix_objfile.py $(@:.marker=.o) $(BASE_DIR)/$(@F:.marker=.o) && \
|
||||
$(COMPARE_OBJ) && \
|
||||
touch -r $(BASE_DIR)/$(@F:.marker=.o) $(@:.marker=.o), \
|
||||
echo "Object file $(<F:.marker=.o) is not in the current archive" \
|
||||
)
|
||||
# create or update the marker file
|
||||
@touch $@
|
||||
endif
|
||||
|
||||
# Rule for building files that require specific file paths in the mdebug section
|
||||
$(MDEBUG_FILES): $(BUILD_DIR)/src/%.marker: src/%.s
|
||||
cp $(<:.marker=.s) $(dir $@)
|
||||
mkdir -p $(@:.marker=)
|
||||
export USR_INCLUDE=$(WORKING_DIR)/include && cd $(@:.marker=) && $(WORKING_DIR)/$(CC) $(ASFLAGS) $(CPPFLAGS) ../$(<F) -I/usr/include -o $(notdir $(<:.s=.o))
|
||||
mv $(@:.marker=)/$(<F:.s=.o) $(@:.marker=)/..
|
||||
ifneq ($(NON_MATCHING),1)
|
||||
# check if this file is in the archive; patch corrupted bytes and change file timestamps to match original if so
|
||||
@$(if $(findstring $(BASE_DIR)/$(@F:.marker=.o), $(BASE_OBJS)), \
|
||||
|
||||
@@ -16,7 +16,7 @@ Currently this repo supports building the following versions:
|
||||
| 2.0I_patch | :x: / :x: | :x: / :x: | :x: / :x: |
|
||||
| 2.0J | :x: / :x: | :x: / :x: | :x: / :x: |
|
||||
| 2.0K | :x: / :x: | :x: / :x: | :x: / :x: |
|
||||
| 2.0L | :x: / :x: | :x: / :x: | :x: / :heavy_check_mark: |
|
||||
| 2.0L | :x: / :heavy_check_mark: | :x: / :heavy_check_mark: | :x: / :heavy_check_mark: |
|
||||
| ique_v1.5 | :x: | :x: | :x: |
|
||||
|
||||
## Preparation
|
||||
|
||||
1
include/asm.h
Normal file
1
include/asm.h
Normal file
@@ -0,0 +1 @@
|
||||
#include <sys/asm.h>
|
||||
@@ -6,7 +6,7 @@
|
||||
#define assert(EX) ((void)0)
|
||||
#else
|
||||
extern void __assert(const char *, const char *, int);
|
||||
#define assert(EX) ((EX)?((void)0):__assert( # EX , __FILE__, __LINE__))
|
||||
#define assert(EX) ((EX)?((void)0):__assert("EX", __FILE__, __LINE__))
|
||||
#endif /* NDEBUG */
|
||||
|
||||
#endif /* !__ASSERT_H__ */
|
||||
|
||||
0
include/fpregdef.h
Normal file
0
include/fpregdef.h
Normal file
3
include/regdef.h
Normal file
3
include/regdef.h
Normal file
@@ -0,0 +1,3 @@
|
||||
#include <sys/regdef.h>
|
||||
#include <sgidefs.h>
|
||||
#include <sys/fpregdef.h>
|
||||
0
include/sgidefs.h
Normal file
0
include/sgidefs.h
Normal file
0
include/sys/fpregdef.h
Normal file
0
include/sys/fpregdef.h
Normal file
@@ -43,11 +43,8 @@
|
||||
#include "seqp.h"
|
||||
#include "cseqp.h"
|
||||
#include "cseq.h"
|
||||
|
||||
// TODO: this comes from a header
|
||||
#ident "$Revision: 1.17 $"
|
||||
|
||||
|
||||
static ALMicroTime __CSPVoiceHandler(void *node);
|
||||
static void __CSPHandleNextSeqEvent(ALCSPlayer *seqp);
|
||||
static void __CSPHandleMIDIMsg(ALCSPlayer *seqp, ALEvent *event);
|
||||
|
||||
@@ -17,16 +17,13 @@
|
||||
* DOD or NASA FAR Supplement. Unpublished - rights reserved under the
|
||||
* Copyright Laws of the United States.
|
||||
*====================================================================*/
|
||||
|
||||
#include <libaudio.h>
|
||||
#include "synthInternals.h"
|
||||
#include <os.h>
|
||||
#include <stdio.h>
|
||||
#include "initfx.h"
|
||||
|
||||
// TODO: this comes from a header
|
||||
#ident "$Revision: 1.49 $"
|
||||
|
||||
/*
|
||||
* WARNING: THE FOLLOWING CONSTANT MUST BE KEPT IN SYNC
|
||||
* WITH SCALING IN MICROCODE!!!
|
||||
|
||||
@@ -17,24 +17,20 @@
|
||||
* DOD or NASA FAR Supplement. Unpublished - rights reserved under the
|
||||
* Copyright Laws of the United States.
|
||||
*====================================================================*/
|
||||
|
||||
#include <libaudio.h>
|
||||
#include "synthInternals.h"
|
||||
#include <os.h>
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <assert.h>
|
||||
|
||||
// TODO: these come from headers
|
||||
#ident "$Revision: 1.49 $"
|
||||
#ident "$Revision: 1.17 $"
|
||||
|
||||
#ifdef AUD_PROFILE
|
||||
extern u32 cnt_index, env_num, env_cnt, env_max, env_min, lastCnt[];
|
||||
extern u32 rate_num, rate_cnt, rate_max, rate_min;
|
||||
extern u32 vol_num, vol_cnt, vol_max, vol_min;
|
||||
#endif
|
||||
|
||||
#define EQPOWER_LENGTH 128
|
||||
static s16 eqpower[ EQPOWER_LENGTH ] = {
|
||||
32767, 32764, 32757, 32744, 32727, 32704,
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
* Inc.; the contents of this file may not be disclosed to third
|
||||
* parties, copied or duplicated in any form, in whole or in part,
|
||||
* without the prior written permission of Silicon Graphics, Inc.
|
||||
*
|
||||
* RESTRICTED RIGHTS LEGEND:
|
||||
* Use, duplication or disclosure by the Government is subject to
|
||||
* restrictions as set forth in subdivision (c)(1)(ii) of the Rights
|
||||
@@ -17,7 +16,6 @@
|
||||
* DOD or NASA FAR Supplement. Unpublished - rights reserved under the
|
||||
* Copyright Laws of the United States.
|
||||
*====================================================================*/
|
||||
|
||||
#include <libaudio.h>
|
||||
#include <ultraerror.h>
|
||||
#include "synthInternals.h"
|
||||
@@ -26,11 +24,9 @@
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include "initfx.h"
|
||||
|
||||
// TODO: these come from headers
|
||||
#ident "$Revision: 1.49 $"
|
||||
#ident "$Revision: 1.17 $"
|
||||
|
||||
#define RANGE 2.0
|
||||
extern ALGlobals *alGlobals;
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
*
|
||||
* Copyright 1993, Silicon Graphics, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics,
|
||||
* Inc.; the contents of this file may not be disclosed to third
|
||||
* parties, copied or duplicated in any form, in whole or in part,
|
||||
@@ -17,12 +16,10 @@
|
||||
* DOD or NASA FAR Supplement. Unpublished - rights reserved under the
|
||||
* Copyright Laws of the United States.
|
||||
*====================================================================*/
|
||||
|
||||
#include <libaudio.h>
|
||||
#include "synthInternals.h"
|
||||
#include <os.h>
|
||||
#include <assert.h>
|
||||
|
||||
// TODO: this comes from a header
|
||||
#ident "$Revision: 1.17 $"
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
/*====================================================================
|
||||
* seqpdelete.c
|
||||
*
|
||||
* Synopsis:
|
||||
*
|
||||
* Copyright 1995, Silicon Graphics, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
@@ -22,7 +20,6 @@
|
||||
|
||||
#include <libaudio.h>
|
||||
#include <assert.h>
|
||||
|
||||
// TODO: this comes from a header
|
||||
#ident "$Revision: 1.17 $"
|
||||
|
||||
|
||||
@@ -3,12 +3,10 @@
|
||||
*
|
||||
* Copyright 1993, Silicon Graphics, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics,
|
||||
* Inc.; the contents of this file may not be disclosed to third
|
||||
* parties, copied or duplicated in any form, in whole or in part,
|
||||
* without the prior written permission of Silicon Graphics, Inc.
|
||||
*
|
||||
* RESTRICTED RIGHTS LEGEND:
|
||||
* Use, duplication or disclosure by the Government is subject to
|
||||
* restrictions as set forth in subdivision (c)(1)(ii) of the Rights
|
||||
@@ -17,7 +15,6 @@
|
||||
* DOD or NASA FAR Supplement. Unpublished - rights reserved under the
|
||||
* Copyright Laws of the United States.
|
||||
*====================================================================*/
|
||||
|
||||
/*
|
||||
* Notes:
|
||||
*
|
||||
|
||||
@@ -3,12 +3,10 @@
|
||||
*
|
||||
* Copyright 1993, Silicon Graphics, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics,
|
||||
* Inc.; the contents of this file may not be disclosed to third
|
||||
* parties, copied or duplicated in any form, in whole or in part,
|
||||
* without the prior written permission of Silicon Graphics, Inc.
|
||||
*
|
||||
* RESTRICTED RIGHTS LEGEND:
|
||||
* Use, duplication or disclosure by the Government is subject to
|
||||
* restrictions as set forth in subdivision (c)(1)(ii) of the Rights
|
||||
|
||||
@@ -3,12 +3,10 @@
|
||||
*
|
||||
* Copyright 1993, Silicon Graphics, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics,
|
||||
* Inc.; the contents of this file may not be disclosed to third
|
||||
* parties, copied or duplicated in any form, in whole or in part,
|
||||
* without the prior written permission of Silicon Graphics, Inc.
|
||||
*
|
||||
* RESTRICTED RIGHTS LEGEND:
|
||||
* Use, duplication or disclosure by the Government is subject to
|
||||
* restrictions as set forth in subdivision (c)(1)(ii) of the Rights
|
||||
@@ -17,7 +15,6 @@
|
||||
* DOD or NASA FAR Supplement. Unpublished - rights reserved under the
|
||||
* Copyright Laws of the United States.
|
||||
*====================================================================*/
|
||||
|
||||
#include "synthInternals.h"
|
||||
#include <assert.h>
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user