Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add partial support for macos #696

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,15 @@ ifeq ($(OS),Windows_NT)
export TMPDIR=$(TEMP)
else
UNAME_S := $(shell uname -s)
ARCH := $(shell uname -m)
ifeq ($(UNAME_S),Linux)
DETECTED_OS=linux
else ifeq ($(UNAME_S),Darwin)
ifeq ($(ARCH),arm64)
DETECTED_OS=macos-arm
else
DETECTED_OS=macos
endif
endif
endif

Expand Down Expand Up @@ -465,7 +470,7 @@ fast64_blender:
distclean: distclean_assets
$(RM) -r $(BUILD_DIR_BASE)
$(PYTHON) extract_assets.py --clean
make -C $(TOOLS_DIR) clean
$(make) -C $(TOOLS_DIR) clean

distclean_assets: ;

Expand Down
2 changes: 1 addition & 1 deletion src/audio/load.c
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ void audio_init(void) {
audio_dma_copy_immediate(test, gAlTbl, size);
func_800BB43C(gAlTbl, test);
gAlBankSets = soundAlloc(&gAudioInitPool, 0x00000100U);
audio_dma_copy_immediate((u32) &_instrument_setsSegmentRomStart, gAlBankSets, 0x00000100U);
audio_dma_copy_immediate(&_instrument_setsSegmentRomStart, gAlBankSets, 0x00000100U);
sound_alloc_pool_init(&gUnkPool1.pool, soundAlloc(&gAudioInitPool, (u32) D_800EA5D8), (u32) D_800EA5D8);
init_sequence_players();
gAudioLoadLock = 0x76557364;
Expand Down
2 changes: 1 addition & 1 deletion src/audio/synthesis.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ Acmd* synthesis_process_note(s32 noteIndex, struct NoteSubEu* noteSubEu, struct
var_a0_2 = (temp_t6 * 9) + sampleAddr;
} else {
var_a0_2 =
dma_sample_data((uintptr_t) (temp_t6 * 9) + sampleAddr, ALIGN(((loopInfo_2 * 9) + 16), 4),
dma_sample_data((uintptr_t) ((temp_t6 * 9) + sampleAddr), ALIGN(((loopInfo_2 * 9) + 16), 4),
flags, &synthesisState->sampleDmaIndex);
// unsure flags?
}
Expand Down
18 changes: 12 additions & 6 deletions tools/asm_processor/asm_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import sys
import re
import os
import shutil
from collections import namedtuple
from io import StringIO

Expand Down Expand Up @@ -1009,16 +1010,19 @@ def fixup_objfile(objfile_name, functions, asm_prelude, assembler, output_enc, d
asm.extend(conts)
asm.append('glabel {}'.format(late_rodata_source_name_end))

o_file = tempfile.NamedTemporaryFile(prefix='asm-processor', suffix='.o', delete=False)
o_name = o_file.name
os.makedirs("tmp", exist_ok=True)
o_file = tempfile.NamedTemporaryFile(prefix='asm-processor', suffix='.o', dir="tmp", delete=False)
o_name = os.path.realpath(o_file.name)
o_file.close()
s_file = tempfile.NamedTemporaryFile(prefix='asm-processor', suffix='.s', delete=False)
s_name = s_file.name
s_file = tempfile.NamedTemporaryFile(prefix='asm-processor', suffix='.s', dir="tmp", delete=False)
s_name = os.path.realpath(s_file.name)
try:
s_file.write(asm_prelude + b'\n')
for line in asm:
s_file.write(line.encode(output_enc) + b'\n')
s_file.close()
print("Assembling", s_name)
print("Output file", o_name)
ret = os.system(assembler + " " + s_name + " -o " + o_name)
if ret != 0:
raise Failure("failed to assemble")
Expand Down Expand Up @@ -1268,11 +1272,13 @@ def fixup_objfile(objfile_name, functions, asm_prelude, assembler, output_enc, d
objfile.write(objfile_name)
finally:
s_file.close()
os.remove(s_name)
# os.remove(s_name)
try:
os.remove(o_name)
pass
# os.remove(o_name)
except:
pass
shutil.rmtree("tmp")

def run_wrapped(argv, outfile, functions):
parser = argparse.ArgumentParser(description="Pre-process .c files and post-process .o files to enable embedding assembly into C.")
Expand Down
Binary file added tools/ido-recomp/macos-arm/acpp
Binary file not shown.
Binary file added tools/ido-recomp/macos-arm/as0
Binary file not shown.
Binary file added tools/ido-recomp/macos-arm/as1
Binary file not shown.
Binary file added tools/ido-recomp/macos-arm/c++filt
Binary file not shown.
Binary file added tools/ido-recomp/macos-arm/cc
Binary file not shown.
Binary file added tools/ido-recomp/macos-arm/cfe
Binary file not shown.
Binary file added tools/ido-recomp/macos-arm/copt
Binary file not shown.
Binary file added tools/ido-recomp/macos-arm/crt1.o
Binary file not shown.
Binary file added tools/ido-recomp/macos-arm/crtn.o
Binary file not shown.
Loading