Skip to content

Commit

Permalink
Splat and ultralib fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hensldm committed Dec 25, 2024
1 parent f064ea5 commit 8fa1c7d
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 15 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ PYTHON ?= $(VENV)/$(VENV_BIN_DIR)/python3
# Emulator w/ flags
N64_EMULATOR ?=

PROJECT_DIR := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))


BASEROM_DIR := baseroms/$(VERSION)
BASEROM := $(BASEROM_DIR)/baserom.z64
Expand Down Expand Up @@ -106,6 +108,7 @@ endif

CC := tools/ido/$(DETECTED_OS)/7.1/cc
CC_OLD := tools/ido/$(DETECTED_OS)/5.3/cc
CC_ULTRALIB := $(PROJECT_DIR)/$(CC_OLD)

AR := ar
AS := $(CROSS)as
Expand Down Expand Up @@ -306,7 +309,7 @@ $(LIBULTRA_LIB): $(ULTRALIB_LIB)
$(LIBDUMP_CMD)

$(ULTRALIB_LIB):
$(MAKE) -C lib/ultralib VERSION=$(ULTRALIB_VERSION) TARGET=$(ULTRALIB_TARGET) FIXUPS=1 CROSS=$(CROSS) CC=../../$(CC_OLD)
$(MAKE) -C lib/ultralib VERSION=$(ULTRALIB_VERSION) TARGET=$(ULTRALIB_TARGET) MODERN_LD=1 CROSS=$(CROSS) COMPILER_DIR=$(dir $(CC_ULTRALIB)) AR=$(AR)

$(BUILD_DIR)/%.ld: %.ld
$(CPP) $(CPPFLAGS) $(BUILD_DEFINES) $(IINC) $< > $@
Expand Down
4 changes: 2 additions & 2 deletions include/gfxprint.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ void gfxprint_locate8x8(gfxprint* this, s32 x, s32 y);
void gfxprint_setoffset(gfxprint* this, s32 x, s32 y);
void gfxprint_putc1(gfxprint* this, char c);
void gfxprint_putc(gfxprint* this, char c);
void gfxprint_write(gfxprint* this, const void* buffer, s32 size, s32 n);
void gfxprint_write(gfxprint* this, const void* buffer, size_t size, size_t n);
void gfxprint_puts(gfxprint* this, const char* buffer);
void* gfxprint_prout(void* this, const char* buffer, s32 n);
void* gfxprint_prout(void* this, const char* buffer, size_t n);
void gfxprint_init(gfxprint* this);
void gfxprint_cleanup(gfxprint* this);
void gfxprint_open(gfxprint* this, Gfx* gListp);
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
splat64[mips]>=0.21.11,<1.0.0
splat64[mips]>=0.32.1,<1.0.0
mapfile-parser>=2.3.5,<3.0.0

# asm-differ
Expand Down
2 changes: 1 addition & 1 deletion src/main/O2/65430.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "global.h"

#include "lib/ultralib/src/io/viint.h"
#include "PRinternal/viint.h"

#include "fault.h"
#include "segment_symbols.h"
Expand Down
2 changes: 1 addition & 1 deletion src/main/O2/aprintf.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "aprintf.h"

s32 vaprintf(PrintCallback* func, const char* fmt, va_list ap) {
return _Printf((outfun*)*func, (char*)func, fmt, ap);
return _Printf(*func, func, fmt, ap);
}

s32 aprintf(PrintCallback* func, const char* fmt, ...) {
Expand Down
6 changes: 3 additions & 3 deletions src/main/O2/gfxprint.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ void gfxprint_putc(gfxprint* this, char c) {
}
}

void gfxprint_write(gfxprint* this, const void* buffer, s32 size, s32 n) {
void gfxprint_write(gfxprint* this, const void* buffer, size_t size, size_t n) {
const char* buf = (const char*)buffer;
s32 i;

Expand All @@ -188,14 +188,14 @@ void gfxprint_puts(gfxprint* this, const char* buffer) {
}
}

void* gfxprint_prout(void* this, const char* buffer, s32 n) {
void* gfxprint_prout(void* this, const char* buffer, size_t n) {
gfxprint_write(this, buffer, sizeof(char), n);
return this;
}

void gfxprint_init(gfxprint* this) {
gfxprint_clrOpened(this);
this->proutFunc = (PrintCallback)gfxprint_prout;
this->proutFunc = gfxprint_prout;
this->gListp = NULL;
this->posX = 0;
this->posY = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/main/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ typedef struct FaultDrawerPos {
/* 0x4 */ s32 y;
} FaultDrawerPos;

void* Fault_PrintCallback(char* arg, const char* fmt, size_t count) {
void* Fault_PrintCallback(void* arg, const char* fmt, size_t count) {
FaultDrawerPos* pos = (FaultDrawerPos*)arg;

for (; count > 0; count--) {
Expand All @@ -135,7 +135,7 @@ s32 Fault_Printf(s32 x, s32 y, const char* fmt, ...) {

pos.x = x;
pos.y = y;
ret = _Printf((outfun*)*Fault_PrintCallback, (char*)&pos, fmt, ap);
ret = _Printf(*Fault_PrintCallback, (char*)&pos, fmt, ap);

va_end(ap);

Expand Down
2 changes: 1 addition & 1 deletion src/main/vimode.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "vimode.h"

#include "stdbool.h"
#include "lib/ultralib/src/io/viint.h"
#include "PRinternal/viint.h"

#include "attributes.h"
#include "macros.h"
Expand Down
4 changes: 2 additions & 2 deletions tools/splat_ext/font.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
from pathlib import Path

from splat.util import options, log
from splat.segtypes.n64.segment import N64Segment
from splat.segtypes.segment import Segment


class N64SegFont(N64Segment):
class N64SegFont(Segment):
def __init__(self, rom_start, rom_end, type, name, vram_start, args, yaml):
super().__init__(
rom_start, rom_end, type, name, vram_start, args=args, yaml=yaml
Expand Down
1 change: 0 additions & 1 deletion yamls/us/header.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ options:
asm_function_macro: glabel
asm_jtbl_label_macro: jlabel
asm_data_macro: dlabel
include_macro_inc: False
libultra_symbols: True
hardware_regs: True
asm_emit_size_directive: False
Expand Down

0 comments on commit 8fa1c7d

Please sign in to comment.