From d407f1650be21e49d183657e455b574c405095a8 Mon Sep 17 00:00:00 2001 From: ariahiro64 Date: Thu, 23 Sep 2021 19:52:42 -0400 Subject: [PATCH] fix toolchain --- .gitignore | 7 ++ Makefile | 106 +++++++++++------- README.md | 29 +---- azure-pipelines.yml | 68 ++++++++++++ bin/ejectjs.bat | 107 ++++++++++++++++++ build.cmd | 21 +--- doc/functions.txt | 0 inc/chksum64.h | 0 inc/cic.h | 0 inc/debug.h | 0 inc/diskio.h | 0 inc/errors.h | 0 inc/everdrive.h | 0 inc/ff.h | 0 inc/ffconf.h | 0 inc/font_patch/font.h | 0 inc/font_patch/info.txt | 0 inc/hashtable.h | 0 inc/image.h | 0 inc/ini.h | 0 inc/integer.h | 0 inc/main.h | 0 inc/mem.h | 0 inc/memorypak.h | 0 inc/menu.h | 1 + inc/mp3.h | 0 inc/regsinternal.h | 0 inc/rom.h | 0 inc/sd.h | 0 inc/sound.h | 0 inc/sram.h | 0 inc/stb_image.h | 0 inc/stb_truetype.h | 0 inc/strlib.h | 0 inc/sys.h | 0 inc/types.h | 0 inc/usb.h | 0 inc/utils.h | 0 inc/version.h | 0 n64ld.x | 113 ++++++++++++++++++++ res/ALT64.INI | 9 +- res/filesystem/sounds/bamboo.wav | Bin res/filesystem/sounds/bgm21.it | Bin res/filesystem/sounds/done.wav | Bin res/filesystem/sounds/ed64_mono.wav | Bin res/filesystem/sounds/warning.wav | Bin res/filesystem/sprites/background.sprite | Bin res/filesystem/sprites/n64controller.sprite | Bin res/filesystem/sprites/splash.sprite | Bin res/header.ed64 | Bin src/chksum64.c | 0 src/cic.c | 0 src/debug.c | 0 src/diskio.c | 0 src/everdrive.c | 0 src/ff.c | 0 src/ffsystem.c | 0 src/ffunicode.c | 0 src/hashtable.c | 0 src/image.c | 2 +- src/ini.c | 0 src/main.c | 25 ++++- src/mem.c | 0 src/memorypak.c | 0 src/menu.c | 0 src/menu_about.c | 28 ++++- src/mp3.c | 0 src/rom.c | 0 src/sd.c | 0 src/sound.c | 5 + src/sram.c | 0 src/strlib.c | 0 src/sys.c | 0 src/usb.c | 0 src/utils.c | 0 src/version.c | 0 tools/deploy-sd.sh | 6 +- tools/extract-firmware.cmd | 4 +- tools/reset-wsfl.cmd | 0 tools/setup-linux.sh | 0 tools/setup-wsfl.cmd | 0 update-libs.ps1 | 36 +++++++ 82 files changed, 471 insertions(+), 96 deletions(-) mode change 100644 => 100755 .gitignore mode change 100644 => 100755 Makefile mode change 100644 => 100755 README.md create mode 100755 azure-pipelines.yml create mode 100755 bin/ejectjs.bat mode change 100644 => 100755 build.cmd mode change 100644 => 100755 doc/functions.txt mode change 100644 => 100755 inc/chksum64.h mode change 100644 => 100755 inc/cic.h mode change 100644 => 100755 inc/debug.h mode change 100644 => 100755 inc/diskio.h mode change 100644 => 100755 inc/errors.h mode change 100644 => 100755 inc/everdrive.h mode change 100644 => 100755 inc/ff.h mode change 100644 => 100755 inc/ffconf.h mode change 100644 => 100755 inc/font_patch/font.h mode change 100644 => 100755 inc/font_patch/info.txt mode change 100644 => 100755 inc/hashtable.h mode change 100644 => 100755 inc/image.h mode change 100644 => 100755 inc/ini.h mode change 100644 => 100755 inc/integer.h mode change 100644 => 100755 inc/main.h mode change 100644 => 100755 inc/mem.h mode change 100644 => 100755 inc/memorypak.h mode change 100644 => 100755 inc/menu.h mode change 100644 => 100755 inc/mp3.h mode change 100644 => 100755 inc/regsinternal.h mode change 100644 => 100755 inc/rom.h mode change 100644 => 100755 inc/sd.h mode change 100644 => 100755 inc/sound.h mode change 100644 => 100755 inc/sram.h mode change 100644 => 100755 inc/stb_image.h mode change 100644 => 100755 inc/stb_truetype.h mode change 100644 => 100755 inc/strlib.h mode change 100644 => 100755 inc/sys.h mode change 100644 => 100755 inc/types.h mode change 100644 => 100755 inc/usb.h mode change 100644 => 100755 inc/utils.h mode change 100644 => 100755 inc/version.h create mode 100755 n64ld.x mode change 100644 => 100755 res/ALT64.INI mode change 100644 => 100755 res/filesystem/sounds/bamboo.wav mode change 100644 => 100755 res/filesystem/sounds/bgm21.it mode change 100644 => 100755 res/filesystem/sounds/done.wav mode change 100644 => 100755 res/filesystem/sounds/ed64_mono.wav mode change 100644 => 100755 res/filesystem/sounds/warning.wav mode change 100644 => 100755 res/filesystem/sprites/background.sprite mode change 100644 => 100755 res/filesystem/sprites/n64controller.sprite mode change 100644 => 100755 res/filesystem/sprites/splash.sprite mode change 100644 => 100755 res/header.ed64 mode change 100644 => 100755 src/chksum64.c mode change 100644 => 100755 src/cic.c mode change 100644 => 100755 src/debug.c mode change 100644 => 100755 src/diskio.c mode change 100644 => 100755 src/everdrive.c mode change 100644 => 100755 src/ff.c mode change 100644 => 100755 src/ffsystem.c mode change 100644 => 100755 src/ffunicode.c mode change 100644 => 100755 src/hashtable.c mode change 100644 => 100755 src/image.c mode change 100644 => 100755 src/ini.c mode change 100644 => 100755 src/main.c mode change 100644 => 100755 src/mem.c mode change 100644 => 100755 src/memorypak.c mode change 100644 => 100755 src/menu.c mode change 100644 => 100755 src/menu_about.c mode change 100644 => 100755 src/mp3.c mode change 100644 => 100755 src/rom.c mode change 100644 => 100755 src/sd.c mode change 100644 => 100755 src/sound.c mode change 100644 => 100755 src/sram.c mode change 100644 => 100755 src/strlib.c mode change 100644 => 100755 src/sys.c mode change 100644 => 100755 src/usb.c mode change 100644 => 100755 src/utils.c mode change 100644 => 100755 src/version.c mode change 100644 => 100755 tools/deploy-sd.sh mode change 100644 => 100755 tools/extract-firmware.cmd mode change 100644 => 100755 tools/reset-wsfl.cmd mode change 100644 => 100755 tools/setup-linux.sh mode change 100644 => 100755 tools/setup-wsfl.cmd create mode 100755 update-libs.ps1 diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 index 209a154..0d96653 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,10 @@ *properties.json /.vs /.vscode + +/toolchain/* +/lib/* +/include/* +/temp +*.zip +toolchain/ diff --git a/Makefile b/Makefile old mode 100644 new mode 100755 index e2f00a6..0c56d74 --- a/Makefile +++ b/Makefile @@ -1,61 +1,85 @@ # -# Copyright (c) 2017 The Altra64 project contributors +# Copyright (c) 2020 The Altra64 project contributors # See LICENSE file in the project root for full license information. # -ROOTDIR = $(N64_INST) -GCCN64PREFIX = $(ROOTDIR)/bin/mips64-elf- -CHKSUM64PATH = $(ROOTDIR)/bin/chksum64 -MKDFSPATH = $(ROOTDIR)/bin/mkdfs -N64TOOL = $(ROOTDIR)/bin/n64tool +ifdef SystemRoot +FIXPATH = $(subst /,\,$1) +RM = DEL /Q +else +FIXPATH = $1 +RM = rm -f +endif + +ROOTDIR = $(CURDIR) +SRCDIR = $(ROOTDIR)/src +OBJDIR = $(ROOTDIR)/obj +BINDIR = $(ROOTDIR)/bin +LIBDIR = $(ROOTDIR)/lib +RESDIR = $(ROOTDIR)/res + +CHKSUM64 = $(ROOTDIR)/toolchain/libdragon/tools/chksum64.exe +MKDFS = $(ROOTDIR)/toolchain/libdragon/tools/mkdfs.exe +N64TOOL = $(ROOTDIR)/toolchain/libdragon/tools/n64tool.exe HEADERNAME = header.ed64 HEADERTITLE = "EverDrive OS" +PROG_NAME = OS64P -SRCDIR = ./src -INCDIR = ./inc -RESDIR = ./res -OBJDIR = ./obj -BINDIR = ./bin -TOOLSDIR = ./tools +INCLUDE_DIRS = -I$(ROOTDIR)/inc -I$(ROOTDIR)/include -I$(ROOTDIR)/toolchain/gcc-toolchain-mips64/include -I$(ROOTDIR)/toolchain/gcc-toolchain-mips64/mips64-elf/include -I$(ROOTDIR)/toolchain/libdragon/include -LINK_FLAGS = -O1 -L$(ROOTDIR)/lib -L$(ROOTDIR)/mips64-elf/lib -ldragon -lmad -lyaml -lc -lm -ldragonsys -lnosys $(LIBS) -Tn64.ld -PROG_NAME = OS64 -CFLAGS = -std=gnu99 -march=vr4300 -mtune=vr4300 -O1 -I$(INCDIR) -I$(ROOTDIR)/include -I$(ROOTDIR)/mips64-elf/include -lpthread -lrt -D_REENTRANT -DUSE_TRUETYPE $(SET_DEBUG) +COMMON_FLAGS = -std=gnu17 -march=vr4300 -mtune=vr4300 -Wall -Wrestrict -Wno-pointer-sign -D_REENTRANT -DUSE_TRUETYPE $(INCLUDE_DIRS) $(SET_DEBUG) +COMMON_FLAGS += -DED64PLUS +FLAGS_VT = -O0 $(COMMON_FLAGS) +FLAGS = -O2 $(COMMON_FLAGS) ASFLAGS = -mtune=vr4300 -march=vr4300 -CC = $(GCCN64PREFIX)gcc -AS = $(GCCN64PREFIX)as -LD = $(GCCN64PREFIX)ld +LINK_FLAGS = -G0 -L$(ROOTDIR)/lib -L$(ROOTDIR)/toolchain/gcc-toolchain-mips64/mips64-elf/lib -L$(ROOTDIR)/toolchain/libdragon/lib -ldragon -lmad -lyaml -lm -lc -ldragonsys -Tn64ld.x + +GCCN64PREFIX = $(ROOTDIR)/toolchain/gcc-toolchain-mips64/bin/mips64-elf- +CC = $(GCCN64PREFIX)gcc.exe +AS = $(GCCN64PREFIX)as.exe +LD = $(GCCN64PREFIX)ld.exe OBJCOPY = $(GCCN64PREFIX)objcopy - -SOURCES := $(wildcard $(SRCDIR)/*.c) -OBJECTS = $(SOURCES:$(SRCDIR)/%.c=$(OBJDIR)/%.o) -$(PROG_NAME).v64: $ $(PROG_NAME).elf $(PROG_NAME).dfs - $(OBJCOPY) $(BINDIR)/$(PROG_NAME).elf $(BINDIR)/$(PROG_NAME).bin -O binary - rm -f $(BINDIR)/$(PROG_NAME).v64 - $(N64TOOL) -l 4M -t $(HEADERTITLE) -h $(RESDIR)/$(HEADERNAME) -o $(BINDIR)/$(PROG_NAME).v64 $(BINDIR)/$(PROG_NAME).bin -s 1M $(BINDIR)/$(PROG_NAME).dfs - $(CHKSUM64PATH) $(BINDIR)/$(PROG_NAME).v64 +SRC = $(wildcard $(SRCDIR)/*.c) -$(PROG_NAME).elf : $(OBJECTS) - @mkdir -p $(BINDIR) - $(LD) -o $(BINDIR)/$(PROG_NAME).elf $(OBJECTS) $(LINK_FLAGS) - -$(OBJECTS): $(OBJDIR)/%.o : $(SRCDIR)/%.c - @mkdir -p $(OBJDIR) - $(CC) $(CFLAGS) -c $< -o $@ - -copy: $(PROG_NAME).v64 - sh $(TOOLSDIR)/upload.sh - -$(PROG_NAME).dfs: - $(MKDFSPATH) $(BINDIR)/$(PROG_NAME).dfs $(RESDIR)/filesystem/ +OBJ = $(patsubst $(SRCDIR)/%.c, $(OBJDIR)/%.o, $(SRC)) all: $(PROG_NAME).v64 -debug: $(PROG_NAME).v64 +release: $(PROG_NAME).v64 debug: SET_DEBUG=-DDEBUG +debug: $(PROG_NAME).v64 + +send: $(PROG_NAME).v64 + $(TOOLSDIR)/up.bat + + +$(PROG_NAME).v64: $(PROG_NAME).elf $(PROG_NAME).dfs + $(OBJCOPY) $(BINDIR)/$(PROG_NAME).elf $(BINDIR)/$(PROG_NAME).bin -O binary + $(N64TOOL) -l 4M -t $(HEADERTITLE) -h $(RESDIR)/$(HEADERNAME) -o $(BINDIR)/$(PROG_NAME).v64 $(BINDIR)/$(PROG_NAME).bin -s 1M $(BINDIR)/$(PROG_NAME).dfs + $(CHKSUM64) $(BINDIR)/$(PROG_NAME).v64 + +$(PROG_NAME).elf : $(OBJ) $(OBJS) + $(LD) -o $(BINDIR)/$(PROG_NAME).elf $(OBJ) $(OBJS) $(LINK_FLAGS) + +$(PROG_NAME).dfs: + $(MKDFS) $(BINDIR)/$(PROG_NAME).dfs $(RESDIR)/filesystem/ + +$(OBJDIR)/gscore.o: $(SRCDIR)/gscore.c + $(CC) $(FLAGS_VT) -c $(SRCDIR)/gscore.c -o $(OBJDIR)/gscore.o + +$(OBJDIR)/%.o : $(SRCDIR)/%.c + $(CC) $(FLAGS) -c $< -o $@ + +$(OBJDIR)/%.o : $(SRCDIR)/%.s + $(AS) $(ASFLAGS) $< -o $@ + clean: - rm -f $(BINDIR)/*.v64 $(BINDIR)/*.elf $(OBJDIR)/*.o $(BINDIR)/*.bin $(BINDIR)/*.dfs + $(info "Cleaning $(PROG_NAME)...") + @$(RM) $(call FIXPATH,$(BINDIR)/$(PROG_NAME).v64) + @$(RM) $(call FIXPATH,$(BINDIR)/$(PROG_NAME).bin) + @$(RM) $(call FIXPATH,$(BINDIR)/$(PROG_NAME).elf) + @$(RM) $(call FIXPATH,$(OBJ)) diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 122bbc3..eb710c3 --- a/README.md +++ b/README.md @@ -8,32 +8,13 @@ originally written by saturnu, and released on the [Everdrive64 forum](http://krikzz.com/forum/index.php?topic=816.0). ## Building - -If you want to build the menu, you need an n64 toolchain. When using windows 10 or Ubuntu, installation is totally automated through a script. - -### Dependencies (installed automatically) -* Windows 10 (Aniversary Update or above) / Ubuntu 16.04 (or above) -* [libdragon](https://github.com/DragonMinded/libdragon) -* [libmikmod (with n64 driver)](https://github.com/networkfusion/libmikmod) -* [libmad-n64](https://github.com/networkfusion/libmad-n64) -* [libyaml](http://pyyaml.org/wiki/LibYAML) - -### Build the Toolchain - -*You may skip this step if it's already installed.* - Clone this `Altra64` repo to a directory of your choice. -On Windows 10: -* Ensure that ["Windows Subsystem For Linux (Ubuntu)"](https://msdn.microsoft.com/en-gb/commandline/wsl/install_guide) is installed. -* browse to the tools directory and double click on ```setup-wsfl.cmd```. - -On Ubuntu, browse to the tools directory and run the command ```$ chmod +x ./setup-linux.sh;source ./setup-linux.sh``` - - ### Build `Altra64` +If this is the first time building, ensure you create the following folders in the root directory `bin` `obj` and `lib` +To install the dependencies run: `update-libs.ps1` -To build the Rom +To build the ROM from the projects root directory, On Windows 10 run @@ -44,7 +25,7 @@ on linux ``` $ make ``` -If it all worked, you will find `OS64.v64` in the `Altra64` bin directory. +If it all worked, you will find `OS64P.V64` in the `Altra64` bin directory. ### Debug Build `Altra64` To build the debug version of the Rom @@ -58,7 +39,7 @@ on linux ``` $ make debug ``` -If it all worked, you will find `OS64.v64` in the `Altra64` bin directory. +If it all worked, you will find `OS64P.V64` in the `Altra64` bin directory. ### Clean `Altra64` diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100755 index 0000000..8a0dba5 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,68 @@ +jobs: +- job: Windows + pool: + vmImage: 'vs2017-win2016' + + variables: + outputStorageUri: '' + outputStorageContainerSasToken: '' + binaryVersion: '$(Year:yy)$(DayOfYear)$(Rev:r)' + + steps: + - task: PowerShell@2 + inputs: + targetType: 'filePath' # Optional. Options: filePath, inline + filePath: 'update-libs.ps1' # Required when targetType == FilePath + #arguments: # Optional + #errorActionPreference: 'stop' # Optional. Options: stop, continue, silentlyContinue + failOnStderr: false # Optional + #workingDirectory: # Optional + displayName: Install tool-chain and libs + + - task: PowerShell@2 + inputs: + targetType: 'inline' + script: | + $path = "$($Env:BUILD_SOURCESDIRECTORY)\inc\version.h" + # should possibly be setting this through the make file! + $versionStr = '#define OS_BUILD_VERSION "' + $Env:Build_BuildNumber + '"' + (Get-Content $path).Replace('#define OS_BUILD_VERSION "0"',$versionStr) | Set-Content $path + errorActionPreference: 'stop' + failOnStderr: 'false' + displayName: Update build version + + - task: PowerShell@2 + inputs: + targetType: 'inline' + script: | + # needs converting to proper powershell or bash! + cmd.exe /c "set PATH=%PATH%;%BUILD_SOURCESDIRECTORY%\gcc-toolchain-mips64\bin" + cmd.exe /c "md bin" + cmd.exe /c "md obj" + If ($Env.Build_SourceBranchName -eq "master") { + cmd.exe /c "make" + } + Else { + cmd.exe /c "make debug" + } + errorActionPreference: 'stop' + failOnStderr: 'false' + displayName: 'Build ROM' + continueOnError: false + + - task: CopyFiles@2 + inputs: + sourceFolder: $(Build.SourcesDirectory) + contents: 'bin\*.v64' + targetFolder: $(Build.ArtifactStagingDirectory) + flattenFolders: true + displayName: 'Copy ROM' + continueOnError: false + + - task: PublishBuildArtifacts@1 + inputs: + pathtoPublish: '$(Build.ArtifactStagingDirectory)' + artifactName: 'binaries' + publishLocation: 'Container' + displayName: Publish Build Artifacts + continueOnError: false diff --git a/bin/ejectjs.bat b/bin/ejectjs.bat new file mode 100755 index 0000000..e45bff0 --- /dev/null +++ b/bin/ejectjs.bat @@ -0,0 +1,107 @@ + +@if (@X)==(@Y) @end /* JScript comment + @echo off + cscript //E:JScript //nologo "%~f0" %* + ::pause + exit /b %errorlevel% +@if (@X)==(@Y) @end JScript comment */ + +function printHelp(){ + + WScript.Echo( WScript.ScriptName + " - ejects a device"); + WScript.Echo(" "); + WScript.Echo(WScript.ScriptName + " {LETTER|*}"); + WScript.Echo(" * will eject all ejectable drives"); +} + +if (WScript.Arguments.Length < 1 ) { + printHelp(); + WScript.Quit(0); +} + +if (WScript.Arguments.Item(0).length>1) { + WScript.Echo("You need to pass an a drive letter or *"); + WScript.Quit(1); +} + + +var ShellObj=new ActiveXObject("Shell.Application"); +var myComputer=ShellObj.NameSpace(17);//https://docs.microsoft.com/en-us/windows/win32/api/shldisp/ne-shldisp-shellspecialfolderconstants +var myComputerItems = myComputer.Items(); + +var usbType="USB Drive"; +var cdType="CD Drive"; + +var usbVerbFB=6; +var cdVerbFB=4; + +var toEject=WScript.Arguments.Item(0); + + +function callVerbFromBottom(item,indexFromBottom){ + var itemVerbs=item.Verbs(); + var verb=itemVerbs.Item(itemVerbs.Count-indexFromBottom); + verb.DoIt(); + item.InvokeVerb(verb.Name.replace("&","")); +} + +function ejectAll(){ + for (var i=0;i + * Modifications by hcs (halleyscometsoftware@hotmail.com) + * + * $Header: /cvsroot/n64dev/n64dev/lib/alt-libn64/n64ld.x,v 1.2 2006/08/11 15:54:11 halleyscometsw Exp $ + * + * ======================================================================== + */ + +OUTPUT_FORMAT ("elf32-bigmips", "elf32-bigmips", "elf32-littlemips") +OUTPUT_ARCH (mips) +EXTERN (_start) +ENTRY (_start) + +MEMORY +{ + mem : ORIGIN = 0x80000400, LENGTH = 4M-0x0400 +} + +SECTIONS { + /* Start address of code is 1K up in uncached, unmapped RAM. We have + * to be at least this far up in order to not interfere with the cart + * boot code which is copying it down from the cart + */ + + . = 0x80000400 ; + + /* The text section carries the app code and its relocation addr is + * the first byte of the cart domain in cached, unmapped memory + */ + + .text : { + FILL (0) + + *(.boot) + . = ALIGN(16); + __text_start = . ; + *(.text) + *(.text.*) + *(.ctors) + *(.dtors) + *(.rodata) + *(.rodata.*) + *(.init) + *(.fini) + __text_end = . ; + } > mem + + + /* Data section has relocation address at start of RAM in cached, + * unmapped memory, but is loaded just at the end of the text segment, + * and must be copied to the correct location at startup + */ + + .data : { + /* Gather all initialised data together. The memory layout + * will place the global initialised data at the lowest addrs. + * The lit8, lit4, sdata and sbss sections have to be placed + * together in that order from low to high addrs with the _gp symbol + * positioned (aligned) at the start of the sdata section. + * We then finish off with the standard bss section + */ + + FILL (0xaa) + + . = ALIGN(16); + __data_start = . ; + *(.data) + *(.data.*) + *(.lit8) + *(.lit4) ; + /* _gp = ALIGN(16) + 0x7ff0 ;*/ +/* _gp = . + 0x7ff0; */ + . = ALIGN(16); + _gp = . + 0x8000; + *(.sdata) + *(.sdata.*) + __data_end = . ; +/* + __bss_start = . ; + *(.scommon) + *(.sbss) + *(COMMON) + *(.bss) + /* XXX Force 8-byte end alignment and update startup code * / + + __bss_end = . ; +*/ + } > mem + + .bss (NOLOAD) : { + __bss_start = . ; + *(.scommon) + *(.sbss) + *(.sbss.*) + *(COMMON) + *(.bss) + *(.bss.*) + __bss_end = . ; + end = . ; + } > mem + +} diff --git a/res/ALT64.INI b/res/ALT64.INI old mode 100644 new mode 100755 index 9cf6220..9507897 --- a/res/ALT64.INI +++ b/res/ALT64.INI @@ -15,9 +15,9 @@ scroll_behaviour=0 ; 0=page-system 1=classic quick_boot=1 ; 'START' boots last rom sound_on=1 ; sounds 1=on 0=off page_display=1 ; display page -tv_mode=2 ; 1=ntsc 2=pal 3=mpal 0=force_off -enable_colored_list=1 ; 1=enable 0=disalbe -ext_type=0 ; 0=classic 1=OS64 +tv_mode=0 ; 1=ntsc 2=pal 3=mpal 0=force_off +enable_colored_list=1 ; 1=enable 0=disable +ext_type=1 ; 0=classic 1=OS64 sd_speed=2 ; 1=25MHz 2=50MHz background_image=background.png ; backgrund png image 320x240 32bit hide_sysfolder=1 ; 1=hide 0=don't hide @@ -27,6 +27,3 @@ save_path=SDSAVE ; save directory inside ED64 [user] name = Altra64 ; Username -[gblite] -save_path=/ED64/SDSAVE/ ; save directory surround with slashes -tv_mode=0 ; 1=ntsc 2=pal 3=mpal 0=force_off diff --git a/res/filesystem/sounds/bamboo.wav b/res/filesystem/sounds/bamboo.wav old mode 100644 new mode 100755 diff --git a/res/filesystem/sounds/bgm21.it b/res/filesystem/sounds/bgm21.it old mode 100644 new mode 100755 diff --git a/res/filesystem/sounds/done.wav b/res/filesystem/sounds/done.wav old mode 100644 new mode 100755 diff --git a/res/filesystem/sounds/ed64_mono.wav b/res/filesystem/sounds/ed64_mono.wav old mode 100644 new mode 100755 diff --git a/res/filesystem/sounds/warning.wav b/res/filesystem/sounds/warning.wav old mode 100644 new mode 100755 diff --git a/res/filesystem/sprites/background.sprite b/res/filesystem/sprites/background.sprite old mode 100644 new mode 100755 diff --git a/res/filesystem/sprites/n64controller.sprite b/res/filesystem/sprites/n64controller.sprite old mode 100644 new mode 100755 diff --git a/res/filesystem/sprites/splash.sprite b/res/filesystem/sprites/splash.sprite old mode 100644 new mode 100755 diff --git a/res/header.ed64 b/res/header.ed64 old mode 100644 new mode 100755 diff --git a/src/chksum64.c b/src/chksum64.c old mode 100644 new mode 100755 diff --git a/src/cic.c b/src/cic.c old mode 100644 new mode 100755 diff --git a/src/debug.c b/src/debug.c old mode 100644 new mode 100755 diff --git a/src/diskio.c b/src/diskio.c old mode 100644 new mode 100755 diff --git a/src/everdrive.c b/src/everdrive.c old mode 100644 new mode 100755 diff --git a/src/ff.c b/src/ff.c old mode 100644 new mode 100755 diff --git a/src/ffsystem.c b/src/ffsystem.c old mode 100644 new mode 100755 diff --git a/src/ffunicode.c b/src/ffunicode.c old mode 100644 new mode 100755 diff --git a/src/hashtable.c b/src/hashtable.c old mode 100644 new mode 100755 diff --git a/src/image.c b/src/image.c old mode 100644 new mode 100755 index 3d7897c..d56c314 --- a/src/image.c +++ b/src/image.c @@ -173,7 +173,7 @@ void drawImage(display_context_t dcon, sprite_t *sprite) { for (int i=0; ihslices; i++) { rdp_sync(SYNC_PIPE); rdp_load_texture_stride(0, 0, MIRROR_DISABLED, sprite, j*sprite->hslices + i); - rdp_draw_sprite(0, x, y); + rdp_draw_sprite(0, x, y, 0); x += 32; } y += 16; diff --git a/src/ini.c b/src/ini.c old mode 100644 new mode 100755 diff --git a/src/main.c b/src/main.c old mode 100644 new mode 100755 index b5e7cae..035ab96 --- a/src/main.c +++ b/src/main.c @@ -170,6 +170,7 @@ enum InputMap mpk_quick_backup, mp3, abort_screen, + control_screen, }; enum InputMap input_mapping = file_manager; @@ -705,7 +706,7 @@ void drawBoxNumber(display_context_t disp, int box) break; //info screen case 9: box_color = graphics_make_color(0x00, 0x00, 0x00, 0xB6); - drawBox(28, 49, 260, 150, disp); + drawBox(28, 20, 260, 200, disp); break; //yellow toplist case 10: box_color = graphics_make_color(0x00, 0x60, 0x00, 0xC3); @@ -3050,6 +3051,21 @@ void showAboutScreen(display_context_t disp) menu_about(disp); } +void showControlScreen(display_context_t disp) +{ + while (!(disp = display_lock())) + ; + new_scroll_pos(&cursor, &page, MAX_LIST, count); + clearScreen(disp); //part clear? + display_dir(list, cursor, page, MAX_LIST, count, disp); + drawBoxNumber(disp, 9); + display_show(disp); + + if (sound_on) + playSound(2); + + menu_controls(disp); +} void loadFile(display_context_t disp) { @@ -4053,7 +4069,7 @@ void handleInput(display_context_t disp, sprite_t *contr) { case file_manager: showAboutScreen(disp); - input_mapping = none; + input_mapping = control_screen; break; case mempak_menu: @@ -4071,6 +4087,11 @@ void handleInput(display_context_t disp, sprite_t *contr) input_mapping = abort_screen; break; + case control_screen: + showControlScreen(disp); + input_mapping = none; + break; + default: break; } diff --git a/src/mem.c b/src/mem.c old mode 100644 new mode 100755 diff --git a/src/memorypak.c b/src/memorypak.c old mode 100644 new mode 100755 diff --git a/src/menu.c b/src/menu.c old mode 100644 new mode 100755 diff --git a/src/menu_about.c b/src/menu_about.c old mode 100644 new mode 100755 index 0604336..db3da40 --- a/src/menu_about.c +++ b/src/menu_about.c @@ -28,5 +28,31 @@ void menu_about(display_context_t disp) printText("Richard Weick", 9, -1, disp); printText("ChillyWilly", 9, -1, disp); printText("ShaunTaylor", 9, -1, disp); - printText("Conle", 9, -1, disp); + printText("Conle Z: Page 2", 9, -1, disp); } //TODO: make scrolling text, should include libraries used. +void menu_controls(display_context_t disp) +{ + printText(" - Controls -", 4, 4, disp); + printText(" ", 4, -1, disp); + printText(" L: brings up the mempak", 4, -1, disp); + printText(" menu", 5, -1, disp); + printText(" ", 4, -1, disp); + printText(" Z: about screen", 4, -1, disp); + printText(" ", 4, -1, disp); + printText(" A: start rom/directory", 4, -1, disp); + printText(" mempak", 4, -1, disp); + printText(" ", 4, -1, disp); + printText(" B: back/cancel", 4, -1, disp); + printText(" ", 4, -1, disp); + printText(" START: start last rom", 4, -1, disp); + printText(" ", 4, -1, disp); + printText(" C-left: rom info/mempak", 4, -1, disp); + printText(" content view", 4, -1, disp); + printText(" ", 4, -1, disp); + printText("C-right: rom config creen", 4, -1, disp); + printText(" ", 4, -1, disp); + printText(" C-up: view full filename", 4, -1, disp); + printText(" ", 4, -1, disp); + printText(" C-down: Toplist 15", 4, -1, disp); + +} \ No newline at end of file diff --git a/src/mp3.c b/src/mp3.c old mode 100644 new mode 100755 diff --git a/src/rom.c b/src/rom.c old mode 100644 new mode 100755 diff --git a/src/sd.c b/src/sd.c old mode 100644 new mode 100755 diff --git a/src/sound.c b/src/sound.c old mode 100644 new mode 100755 index 245470c..ce0832c --- a/src/sound.c +++ b/src/sound.c @@ -7,22 +7,27 @@ void sndInit(void) { + return 0; } void sndPlayBGM(char* filename) { + return 0; } void sndStopAll(void) { + return 0; } void sndPlaySFX(char* filename) { + return 0; } void sndUpdate(void) { + return 0; } #else diff --git a/src/sram.c b/src/sram.c old mode 100644 new mode 100755 diff --git a/src/strlib.c b/src/strlib.c old mode 100644 new mode 100755 diff --git a/src/sys.c b/src/sys.c old mode 100644 new mode 100755 diff --git a/src/usb.c b/src/usb.c old mode 100644 new mode 100755 diff --git a/src/utils.c b/src/utils.c old mode 100644 new mode 100755 diff --git a/src/version.c b/src/version.c old mode 100644 new mode 100755 diff --git a/tools/deploy-sd.sh b/tools/deploy-sd.sh old mode 100644 new mode 100755 index a34220d..2473238 --- a/tools/deploy-sd.sh +++ b/tools/deploy-sd.sh @@ -6,13 +6,13 @@ #! /bin/bash sudo mount /dev/sdb1 /mnt -file=/mnt/ED64/OS64.v64 +file=/mnt/ED64P/OS64P.V64 if [ -e $file ] then echo -e "File $file exists - mount ok" echo -e "copy..." - sudo cp ../bin/OS64.v64 /mnt/ED64/ - sudo cp ../res/ALT64.INI /mnt/ED64/ + sudo cp ../bin/OS64P.V64 /mnt/ED64P/ + sudo cp ../res/ALT64.INI /mnt/ED64P/ echo -e "umounting..." sudo umount /mnt echo -e "done..." diff --git a/tools/extract-firmware.cmd b/tools/extract-firmware.cmd old mode 100644 new mode 100755 index f1cf66b..57a0712 --- a/tools/extract-firmware.cmd +++ b/tools/extract-firmware.cmd @@ -52,7 +52,7 @@ MKDIR "%fs%" SET "rom=%1" IF %1.==. ( -SET /P rom="Please enter full path to OS64.v64 V2.12:" +SET /P rom="Please enter full path to OS64P.V64 V2.12:" ) set "drive=%rom:~0,1%" @@ -98,7 +98,7 @@ echo "Linux rom dir is %rom%" @echo ON -:: OS64.V64 - Version 2.12 firmware offsets: +:: OS64P.V64 - Version 2.12 firmware offsets: :: cart offset (hex) offset (dec) length :: v2_old 0x25070 151664 61552 :: v2 0x15930 88368 63276 diff --git a/tools/reset-wsfl.cmd b/tools/reset-wsfl.cmd old mode 100644 new mode 100755 diff --git a/tools/setup-linux.sh b/tools/setup-linux.sh old mode 100644 new mode 100755 diff --git a/tools/setup-wsfl.cmd b/tools/setup-wsfl.cmd old mode 100644 new mode 100755 diff --git a/update-libs.ps1 b/update-libs.ps1 new file mode 100755 index 0000000..4e3dbb7 --- /dev/null +++ b/update-libs.ps1 @@ -0,0 +1,36 @@ +New-Item -ItemType Directory -Force -Path "$PSScriptRoot\temp\" + +$url = "https://n64tools.blob.core.windows.net/binaries/N64-tools/libdragon/develop/latest/libdragon-win64.zip" +$output = "$PSScriptRoot\temp\libdragon.zip" + +Invoke-WebRequest -Uri $url -OutFile $output +Expand-Archive -Force -Path $output -DestinationPath "$PSScriptRoot\toolchain\libdragon\" + +$url = "https://n64tools.blob.core.windows.net/binaries/N64-tools/mips64-gcc-toolchain/master/latest/gcc-toolchain-mips64-win64.zip" +$output = "$PSScriptRoot\temp\gcc-toolchain-mips64.zip" + +Invoke-WebRequest -Uri $url -OutFile $output +Expand-Archive -Force -Path $output -DestinationPath "$PSScriptRoot\toolchain\gcc-toolchain-mips64\" + +$url = "https://n64tools.blob.core.windows.net/binaries/N64-tools/libs/n64/latest/libmikmod.zip" +$output = "$PSScriptRoot\temp\libmikmod.zip" + +Invoke-WebRequest -Uri $url -OutFile $output +Expand-Archive -Path $output -DestinationPath "$PSScriptRoot" + + +$url = "https://n64tools.blob.core.windows.net/binaries/N64-tools/libs/n64/latest/libmad.zip" +$output = "$PSScriptRoot\temp\libmad.zip" + +Invoke-WebRequest -Uri $url -OutFile $output +Expand-Archive -Path $output -DestinationPath "$PSScriptRoot" + + +$url = "https://n64tools.blob.core.windows.net/binaries/N64-tools/libs/n64/latest/libyaml.zip" +$output = "$PSScriptRoot\temp\libyaml.zip" + +Invoke-WebRequest -Uri $url -OutFile $output +Expand-Archive -Path $output -DestinationPath "$PSScriptRoot" + + +Remove-Item -LiteralPath "$PSScriptRoot\temp\" -Force -Recurse