Skip to content

Commit

Permalink
Asar 1.9 rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
ADM228 committed Feb 17, 2024
1 parent d1e53c0 commit ff7ef43
Show file tree
Hide file tree
Showing 4 changed files with 291 additions and 287 deletions.
16 changes: 10 additions & 6 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ASAR_URL = https://github.com/RPGHacker/asar/archive/refs/tags/v1.81.tar.gz
ASAR_URL = https://github.com/RPGHacker/asar/archive/refs/tags/v1.90RC1.tar.gz
ASAR_DIR = tools/asar
current_dir = $(dir $(abspath $(lastword $(MAKEFILE_LIST))))

Expand All @@ -7,7 +7,7 @@ ifeq ($(OS),Windows_NT)
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
ASAR_EXECUTABLE := asar-standalone
ASAR_EXECUTABLE := asar
endif
ifeq ($(UNAME_S),Darwin)
$(error You seem to be running MacOS. Please contact me on Discord (alexmush) and tell me the contents of $(ASAR_DIR)/asar so that i can make this available to compile on MacOS)
Expand All @@ -20,18 +20,22 @@ SYM_SND=none
debug: SYM_GUI=wla --symbols-path="bin/SNESFMDemo.sym"
debug: SYM_SND=wla --symbols-path="bin/SNESFMDemo.smp.sym"

force_update_asar: rem_asar asar
build: asar SNESFM Demo
debug: asar SNESFM Demo

asar: ${ASAR_DIR}/asar/${ASAR_EXECUTABLE}
asar: ${ASAR_DIR}/asar/bin/${ASAR_EXECUTABLE}
SNESFM: bin/SNESFM.bin
Demo: bin/SNESFMDemo.sfc

rem_asar: ${ASAR_DIR}
rm -rf ${ASAR_DIR}

bin/SNESFM.bin: asar bin source/sound/* tables/multTables.bin tables/pitch*.bin tables/quartersinetable.bin
${ASAR_DIR}/asar/${ASAR_EXECUTABLE} -v --symbols=${SYM_SND} -I"tables" -I"source/sound" "source/sound/demoConfig.asm" "bin/SNESFM.bin"
${ASAR_DIR}/asar/bin/${ASAR_EXECUTABLE} -v --symbols=${SYM_SND} -I"tables" -I"source/sound" "source/sound/demoConfig.asm" "bin/SNESFM.bin"

bin/SNESFMDemo.sfc: asar bin SNESFM source/gui/* graphics/palette.pal graphics/tilesetUnicode.chr tables/sinetable.bin
${ASAR_DIR}/asar/${ASAR_EXECUTABLE} -v --symbols=${SYM_GUI} -I"bin" -I"graphics" -I"tables" --fix-checksum=on "source/gui/SNESFMDemo.asm" "bin/SNESFMDemo.sfc"
${ASAR_DIR}/asar/bin/${ASAR_EXECUTABLE} -v --symbols=${SYM_GUI} -I"bin" -I"graphics" -I"tables" --fix-checksum=on "source/gui/SNESFMDemo.asm" "bin/SNESFMDemo.sfc"

bin:
mkdir -p bin
Expand All @@ -47,5 +51,5 @@ ${ASAR_DIR}/src/asar/*:
${ASAR_DIR}/asar/${ASAR_EXECUTABLE}: ${ASAR_DIR}/src/asar/*
cd "${ASAR_DIR}" && cmake src > /dev/null && $(MAKE) > /dev/null

.PHONY: clean asar SNESFM Demo build debug
.PHONY: clean asar SNESFM Demo build debug rem_asar force_update_asar
.SILENT: build
4 changes: 3 additions & 1 deletion source/gui/SNESFMDemo.asm
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
;block: 00 02 05 08 0B 0E 11 14 17
;center of screen: --

optimize dp always
optimize address mirrors

!SRAM_VERSION_MAJOR = #$00

!P_A = #%00100000
Expand All @@ -105,7 +108,6 @@
MESSAGE_CNT_TH1 = $60
MESSAGE_CNT_TH2 = $61

math pri on
incsrc "header.asm"
incsrc "initSNES.asm"

Expand Down
Loading

0 comments on commit ff7ef43

Please sign in to comment.