Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into ed64-vseries
Browse files Browse the repository at this point in the history
  • Loading branch information
networkfusion committed Dec 27, 2023
2 parents 117c7a4 + 26ea9f0 commit a117a3e
Show file tree
Hide file tree
Showing 85 changed files with 4,239 additions and 1,545 deletions.
7 changes: 4 additions & 3 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
FROM debian:bookworm-slim

ARG SC64_DEPLOYER_VERSION=v2.18.0
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install build-essential doxygen git python3 wget -y && \
wget https://github.com/DragonMinded/libdragon/releases/download/toolchain-continuous-prerelease/gcc-toolchain-mips64-x86_64.deb && \
dpkg -i gcc-toolchain-mips64-x86_64.deb && \
rm gcc-toolchain-mips64-x86_64.deb && \
wget https://github.com/Polprzewodnikowy/SummerCart64/releases/download/v2.16.0/sc64-deployer-linux-v2.16.0.tar.gz && \
tar -xf sc64-deployer-linux-v2.16.0.tar.gz -C /usr/local/bin && \
rm sc64-deployer-linux-v2.16.0.tar.gz && \
wget https://github.com/Polprzewodnikowy/SummerCart64/releases/download/$SC64_DEPLOYER_VERSION/sc64-deployer-linux-$SC64_DEPLOYER_VERSION.tar.gz && \
tar -xf sc64-deployer-linux-$SC64_DEPLOYER_VERSION.tar.gz -C /usr/local/bin && \
rm sc64-deployer-linux-$SC64_DEPLOYER_VERSION.tar.gz && \
git config --global --add safe.directory "*" && \
SNIPPET="export PROMPT_COMMAND='history -a' && export HISTFILE=/commandhistory/.bash_history" && \
echo "$SNIPPET" >> "/root/.bashrc"
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ body:
- type: input
id: menu_version
attributes:
label: Menu version used
description: The menu version used
label: Menu revision used
description: Press (Start) button on the menu to show the current menu version.
placeholder: e.g 1.2.3.456, N/A
validations:
required: false
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ body:
description: Describe the solution you'd like
placeholder: A clear and concise description of what you would like to happen/exist.
validations:
required: true
required: false

- type: textarea
id: alternatives
Expand Down
49 changes: 31 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand All @@ -37,44 +37,67 @@ jobs:
FLAGS: -DNDEBUG

- name: Upload artifact (Standard ROM)
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: N64FlashcartMenu
path: |
./output/N64FlashcartMenu.n64
./build/N64FlashcartMenu.elf
- name: Upload artifact (64drive version)
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: 64drive
path: ./output/menu.bin

- name: Upload artifact (ED64 version)
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ED64
path: ./output/OS64.v64

- name: Upload artifact (ED64P version)
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ED64P
path: ./output/OS64P.v64

- name: Upload artifact (SC64 version)
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: SC64
path: ./output/sc64menu.n64

# - name: Delete rolling-release tag and release
# uses: dev-drprasad/delete-tag-and-release@v1.0
# if: github.ref == 'refs/heads/main'
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# tag_name: rolling-release
# continue-on-error: true

- name: Upload rolling release
uses: softprops/action-gh-release@v0.1.15
if: github.ref == 'refs/heads/main'
with:
name: Rolling release
body: Rolling release built from latest commit on `main` branch.
tag_name: rolling-release
files: |
./output/N64FlashcartMenu.n64
./output/menu.bin
./output/OS64.v64
./output/OS64P.v64
./output/sc64menu.n64
continue-on-error: true

generate-docs:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Run Doxygen
uses: mattnotmitt/doxygen-action@1.9.5
Expand All @@ -87,13 +110,3 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./output/docs

# release-sc64-menu:
# runs-on: ubuntu-latest
# needs: minify-sc64-menu

# steps:
# - name: Generate release
# if: github.event_name == 'release' && github.event.action == 'created'
# run: |
# echo "still release preview. Check actions for build assets."
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/.vscode
/build
/filesystem
/output
/tools/sc64/*

Expand Down
50 changes: 30 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,23 @@ PROJECT_NAME = N64FlashcartMenu

SOURCE_DIR = src
ASSETS_DIR = assets
FILESYSTEM_DIR = filesystem
BUILD_DIR = build
OUTPUT_DIR = output

FLAGS += -DMENU_VERSION=\"0.0.1.$(shell date +%Y-%m-%dT%H:%M:%SZ).ALPHA\"

include $(N64_INST)/include/n64.mk

N64_CFLAGS += -iquote $(SOURCE_DIR) -iquote $(ASSETS_DIR) -I $(SOURCE_DIR)/libs -flto=auto $(FLAGS)

SRCS = \
main.c \
boot/boot.c \
boot/crc32.c \
boot/cic.c \
boot/reboot.S \
flashcart/64drive/64drive_ll.c \
flashcart/64drive/64drive.c \
flashcart/flashcart_utils.c \
flashcart/flashcart.c \
flashcart/sc64/sc64_ll.c \
Expand All @@ -36,47 +41,55 @@ SRCS = \
menu/components/common.c \
menu/components/context_menu.c \
menu/components/file_list.c \
menu/disk_info.c \
menu/fonts.c \
menu/hdmi.c \
menu/menu.c \
menu/mp3_player.c \
menu/path.c \
menu/png_decoder.c \
menu/rom_database.c \
menu/rom_info.c \
menu/settings.c \
menu/sound.c \
menu/usb_comm.c \
menu/views/browser.c \
menu/views/credits.c \
menu/views/error.c \
menu/views/fault.c \
menu/views/file_info.c \
menu/views/image_viewer.c \
menu/views/load_disk.c \
menu/views/load_emulator.c \
menu/views/load_rom.c \
menu/views/music_player.c \
menu/views/startup.c \
menu/views/system_info.c \
menu/views/settings_editor.c \
menu/views/rtc.c \
utils/fs.c

ASSETS = \
FONTS = \
FiraMonoBold.ttf

OBJS = $(addprefix $(BUILD_DIR)/, $(addsuffix .o,$(basename $(SRCS) $(ASSETS))))
OBJS = $(addprefix $(BUILD_DIR)/, $(addsuffix .o,$(basename $(SRCS))))
MINIZ_OBJS = $(filter $(BUILD_DIR)/libs/miniz/%.o,$(OBJS))
SPNG_OBJS = $(filter $(BUILD_DIR)/libs/libspng/%.o,$(OBJS))
DEPS = $(OBJS:.o=.d)

FILESYSTEM = \
$(addprefix $(FILESYSTEM_DIR)/, $(notdir $(FONTS:%.ttf=%.font64)))

$(MINIZ_OBJS): N64_CFLAGS+=-DMINIZ_NO_TIME -fcompare-debug-second
$(SPNG_OBJS): N64_CFLAGS+=-isystem $(SOURCE_DIR)/libs/miniz -DSPNG_USE_MINIZ -fcompare-debug-second
$(BUILD_DIR)/FiraMonoBold.asset: MKFONT_FLAGS+=-c 0 --size 16 -r 20-7F -r 2026-2026 --ellipsis 2026,1
$(FILESYSTEM_DIR)/FiraMonoBold.font64: MKFONT_FLAGS+=-c 1 --size 16 -r 20-7F -r 2026-2026 --ellipsis 2026,1

$(BUILD_DIR)/%.asset: $(ASSETS_DIR)/%.ttf
@echo " [FONT] $(basename $@).font64"
@$(N64_MKFONT) $(MKFONT_FLAGS) -o $(BUILD_DIR) "$<"
@mv $(basename $@).font64 $@
$(@info $(shell mkdir -p ./$(FILESYSTEM_DIR) &> /dev/null))

$(BUILD_DIR)/%.o: $(BUILD_DIR)/%.asset $(ASSETS_DIR)/assets.S
@sed -e "s,@sym@,$*,g" -e "s,@file@,$(basename $<).asset," < $(ASSETS_DIR)/assets.S | \
$(CC) -x assembler-with-cpp $(ASFLAGS) -c - -o $@
$(FILESYSTEM_DIR)/%.font64: $(ASSETS_DIR)/%.ttf
@echo " [FONT] $@"
@$(N64_MKFONT) $(MKFONT_FLAGS) -o $(FILESYSTEM_DIR) "$<"

$(BUILD_DIR)/$(PROJECT_NAME).dfs: $(FILESYSTEM)

$(BUILD_DIR)/$(PROJECT_NAME).elf: $(OBJS)

Expand All @@ -85,37 +98,34 @@ disassembly: $(BUILD_DIR)/$(PROJECT_NAME).elf
.PHONY: disassembly

$(PROJECT_NAME).z64: N64_ROM_TITLE=$(PROJECT_NAME)
$(PROJECT_NAME).z64: $(BUILD_DIR)/$(PROJECT_NAME).dfs

$(@info $(shell mkdir -p ./$(OUTPUT_DIR) &> /dev/null))

$(OUTPUT_DIR)/$(PROJECT_NAME).n64: $(PROJECT_NAME).z64
@mv $< $@

$(BUILD_DIR)/$(PROJECT_NAME)_stripped.n64: $(OUTPUT_DIR)/$(PROJECT_NAME).n64
python3 ./tools/strip_debug_data.py $(BUILD_DIR)/$(PROJECT_NAME).elf $< $@
@$(N64_CHKSUM) $@ > /dev/null

64drive: $(OUTPUT_DIR)/$(PROJECT_NAME).n64
@cp $< $(OUTPUT_DIR)/menu.bin
.PHONY: 64drive

ed64: $(BUILD_DIR)/$(PROJECT_NAME)_stripped.n64
ed64: $(OUTPUT_DIR)/$(PROJECT_NAME).n64
@cp $< $(OUTPUT_DIR)/OS64.v64
.PHONY: ed64

ed64-clone: $(BUILD_DIR)/$(PROJECT_NAME)_stripped.n64
ed64-clone: $(OUTPUT_DIR)/$(PROJECT_NAME).n64
@cp $< $(OUTPUT_DIR)/OS64P.v64
.PHONY: ed64-clone

sc64: $(BUILD_DIR)/$(PROJECT_NAME)_stripped.n64
sc64: $(OUTPUT_DIR)/$(PROJECT_NAME).n64
@cp $< $(OUTPUT_DIR)/sc64menu.n64
.PHONY: sc64

all: $(OUTPUT_DIR)/$(PROJECT_NAME).n64 64drive ed64 ed64-clone sc64
.PHONY: all

clean:
@rm -rf ./$(BUILD_DIR) ./$(OUTPUT_DIR)
@rm -rf ./$(BUILD_DIR) ./$(FILESYSTEM_DIR) ./$(OUTPUT_DIR)
.PHONY: clean

run: $(OUTPUT_DIR)/$(PROJECT_NAME).n64
Expand Down
Loading

0 comments on commit a117a3e

Please sign in to comment.