mirror of
https://github.com/parasyte/alt64
synced 2024-11-15 21:55:03 -05:00
Merge pull request #5 from AriaHiro64/master
add moparisthebest's improvements and build with docker
This commit is contained in:
commit
8afb574905
9
.gitignore
vendored
9
.gitignore
vendored
@ -1,3 +1,5 @@
|
||||
## Build folder
|
||||
/build/*
|
||||
## Build files
|
||||
*.v64
|
||||
*.elf
|
||||
@ -17,10 +19,3 @@
|
||||
*properties.json
|
||||
/.vs
|
||||
/.vscode
|
||||
|
||||
/toolchain/*
|
||||
/lib/*
|
||||
/include/*
|
||||
/temp
|
||||
*.zip
|
||||
toolchain/
|
||||
|
108
Makefile
108
Makefile
@ -1,85 +1,61 @@
|
||||
#
|
||||
# Copyright (c) 2020 The Altra64 project contributors
|
||||
# Copyright (c) 2017 The Altra64 project contributors
|
||||
# See LICENSE file in the project root for full license information.
|
||||
#
|
||||
|
||||
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
|
||||
ROOTDIR = $(N64_INST)
|
||||
GCCN64PREFIX = $(ROOTDIR)/bin/mips64-elf-
|
||||
CHKSUM64PATH = $(ROOTDIR)/bin/chksum64
|
||||
MKDFSPATH = $(ROOTDIR)/bin/mkdfs
|
||||
N64TOOL = $(ROOTDIR)/bin/n64tool
|
||||
|
||||
HEADERNAME = header.ed64
|
||||
HEADERTITLE = "EverDrive OS"
|
||||
|
||||
SRCDIR = ./src
|
||||
INCDIR = ./inc
|
||||
RESDIR = ./res
|
||||
OBJDIR = ./obj
|
||||
BINDIR = ./bin
|
||||
TOOLSDIR = ./tools
|
||||
|
||||
LINK_FLAGS = -O3 -L$(ROOTDIR)/lib -L$(ROOTDIR)/mips64-elf/lib -ldragon -lmad -lmikmod -lyaml -lc -lm -ldragonsys -lnosys $(LIBS) -Tn64ld.x
|
||||
PROG_NAME = OS64P
|
||||
|
||||
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
|
||||
|
||||
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)
|
||||
CFLAGS = -std=gnu99 -march=vr4300 -mtune=vr4300 -O3 -I$(INCDIR) -I$(ROOTDIR)/include -I$(ROOTDIR)/mips64-elf/include -lpthread -lrt -D_REENTRANT -DUSE_TRUETYPE $(SET_DEBUG)
|
||||
ASFLAGS = -mtune=vr4300 -march=vr4300
|
||||
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
|
||||
CC = $(GCCN64PREFIX)gcc
|
||||
AS = $(GCCN64PREFIX)as
|
||||
LD = $(GCCN64PREFIX)ld
|
||||
OBJCOPY = $(GCCN64PREFIX)objcopy
|
||||
|
||||
SRC = $(wildcard $(SRCDIR)/*.c)
|
||||
SOURCES := $(wildcard $(SRCDIR)/*.c)
|
||||
OBJECTS = $(SOURCES:$(SRCDIR)/%.c=$(OBJDIR)/%.o)
|
||||
|
||||
OBJ = $(patsubst $(SRCDIR)/%.c, $(OBJDIR)/%.o, $(SRC))
|
||||
$(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
|
||||
|
||||
$(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/
|
||||
|
||||
all: $(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 $@
|
||||
|
||||
debug: SET_DEBUG=-DDEBUG
|
||||
|
||||
clean:
|
||||
$(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))
|
||||
rm -f $(BINDIR)/*.v64 $(BINDIR)/*.elf $(OBJDIR)/*.o $(BINDIR)/*.bin $(BINDIR)/*.dfs
|
||||
|
50
README.md
50
README.md
@ -2,57 +2,33 @@
|
||||
|
||||
Alternative Everdrive64 menu
|
||||
|
||||
|
||||
`Altra64` is an open source menu for [Everdrive64](http://krikzz.com/) and is based on a fork of alt64 which was
|
||||
`Altra64` is an open source menu for [Everdrive64](http://krikzz.com/) and ed64+ and is based on a fork of alt64 which was
|
||||
originally written by saturnu, and released on the
|
||||
[Everdrive64 forum](http://krikzz.com/forum/index.php?topic=816.0).
|
||||
|
||||
## Building
|
||||
Clone this `Altra64` repo to a directory of your choice.
|
||||
|
||||
If you want to build the menu, you need an n64 toolchain. This is terrible to build, moparisthebest ended up creating a Dockerfile in the docker folder, instructions included in it.
|
||||
|
||||
Or if you trust him, you can use the one he built and pushed to docker hub, [moparisthebest/altra64-dev](https://hub.docker.com/r/moparisthebest/altra64-dev)
|
||||
|
||||
### 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
|
||||
```
|
||||
> build
|
||||
```
|
||||
on linux
|
||||
```
|
||||
$ make
|
||||
```
|
||||
If it all worked, you will find `OS64P.V64` in the `Altra64` bin directory.
|
||||
from the projects root directory, with docker installed
|
||||
|
||||
### Debug Build `Altra64`
|
||||
To build the debug version of the Rom
|
||||
$ docker run --rm -v "$(pwd):/build" moparisthebest/altra64-dev make
|
||||
|
||||
from the projects root directory,
|
||||
On Windows 10 run
|
||||
```
|
||||
> build debug
|
||||
```
|
||||
on linux
|
||||
```
|
||||
$ make debug
|
||||
```
|
||||
If it all worked, you will find `OS64P.V64` in the `Altra64` bin directory.
|
||||
If it all worked, you will find `OS64.v64` in the `bin` directory.
|
||||
|
||||
|
||||
### Clean `Altra64`
|
||||
|
||||
Finally, we can clean the build objects from the project
|
||||
|
||||
from the projects root directory,
|
||||
On Windows 10 run
|
||||
```
|
||||
> build clean
|
||||
```
|
||||
on linux
|
||||
```
|
||||
$ make clean
|
||||
```
|
||||
from the projects root directory
|
||||
|
||||
$ docker run --rm -v "$(pwd):/build" moparisthebest/altra64-dev make clean
|
||||
|
||||
Enjoy!
|
||||
|
@ -1,68 +0,0 @@
|
||||
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
|
107
bin/ejectjs.bat
107
bin/ejectjs.bat
@ -1,107 +0,0 @@
|
||||
|
||||
@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<myComputerItems.Count;i++){
|
||||
var item=myComputerItems.Item(i);
|
||||
var itemType=myComputer.GetDetailsOf(myComputerItems.Item(i),1);
|
||||
var itemName=myComputer.GetDetailsOf(myComputerItems.Item(i),0);
|
||||
|
||||
if(itemType===usbType){
|
||||
callVerbFromBottom(item,usbVerbFB);
|
||||
}
|
||||
|
||||
if(itemType===cdType){
|
||||
callVerbFromBottom(item,cdVerbFB);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function ejectByLetter(letter) {
|
||||
var driveFound=false;
|
||||
for (var i=0;i<myComputerItems.Count;i++){
|
||||
var item=myComputerItems.Item(i);
|
||||
var itemType=myComputer.GetDetailsOf(myComputerItems.Item(i),1);
|
||||
var itemName=myComputer.GetDetailsOf(myComputerItems.Item(i),0);
|
||||
|
||||
if(
|
||||
itemName.indexOf(":") !== -1 &&
|
||||
itemName.indexOf("(") !== -1 &&
|
||||
itemName.indexOf(")") !== -1
|
||||
) {
|
||||
//the item is a some kind of drive
|
||||
var itemDriveLetter=itemName.substring(
|
||||
itemName.indexOf(")") - 1 ,
|
||||
itemName.indexOf(")") - 2
|
||||
);
|
||||
|
||||
if(itemDriveLetter.toUpperCase()===letter.toUpperCase()) {
|
||||
if(itemType===usbType) {
|
||||
callVerbFromBottom(item,usbVerbFB);
|
||||
} else if (itemType===cdType) {
|
||||
callVerbFromBottom(item,cdVerbFB);
|
||||
} else {
|
||||
WScript.Echo("Drive "+ letter + " does not support ejectuation");
|
||||
WScript.Quit(2);
|
||||
}
|
||||
driveFound=true;
|
||||
break; //drive letter has been found , no more iteration needed.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!driveFound){
|
||||
WScript.Echo("Drive " + letter +" has not been found");
|
||||
WScript.Quit(3);
|
||||
}
|
||||
}
|
||||
|
||||
if(toEject==="*") {
|
||||
ejectAll();
|
||||
} else {
|
||||
ejectByLetter(toEject);
|
||||
}
|
21
build.cmd
21
build.cmd
@ -1,12 +1,23 @@
|
||||
set PATH=%~dp0toolchain\gcc-toolchain-mips64\bin
|
||||
::
|
||||
:: Copyright (c) 2017 The Altra64 project contributors
|
||||
:: See LICENSE file in the project root for full license information.
|
||||
::
|
||||
|
||||
@echo off
|
||||
set "SystemPath=%SystemRoot%\\System32"
|
||||
IF EXIST %WINDIR%\\sysnative\\reg.exe (
|
||||
set "SystemPath=%SystemRoot%\Sysnative"
|
||||
echo. "32-bit process..."
|
||||
)
|
||||
|
||||
set env="/usr/local/libdragon"
|
||||
|
||||
IF %1.==. (
|
||||
::echo. "no parameter"
|
||||
make
|
||||
echo. "no parameter"
|
||||
%SystemPath%\\bash --verbose -c "export N64_INST=%env%; make"
|
||||
) ELSE (
|
||||
::echo. "parameter: %1"
|
||||
make -d %1
|
||||
echo. "parameter: %1"
|
||||
%SystemPath%\\bash --verbose -c "export N64_INST=%env%; make %1"
|
||||
)
|
||||
|
||||
:pause
|
25
docker/Dockerfile
Normal file
25
docker/Dockerfile
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
# to build and test:
|
||||
# docker build -t altra64-dev . && docker run --rm -v "$(pwd):/build" -it altra64-dev
|
||||
|
||||
# to use to compile altra64 (or other n64 stuff I guess)
|
||||
# docker run --rm -v "$(pwd):/build" altra64-dev make
|
||||
|
||||
#FROM ubuntu:18.04
|
||||
FROM ubuntu:16.04
|
||||
|
||||
RUN mkdir /build
|
||||
|
||||
COPY setup-linux.sh /usr/bin/setup-linux.sh
|
||||
|
||||
# run it then delete all build artifacts
|
||||
RUN /usr/bin/setup-linux.sh && rm -rf /root/*
|
||||
|
||||
ENV N64_INST=/usr/local/libdragon
|
||||
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/libdragon/bin
|
||||
|
||||
VOLUME [ "/build" ]
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
CMD ["bash"]
|
93
docker/setup-linux.sh
Normal file
93
docker/setup-linux.sh
Normal file
@ -0,0 +1,93 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2017 The Altra64 project contributors
|
||||
# See LICENSE file in the project root for full license information.
|
||||
#
|
||||
|
||||
set -euxo pipefail
|
||||
|
||||
# Download and install latest updates for the system [sudo req.]
|
||||
apt-get update
|
||||
apt-get -y upgrade
|
||||
|
||||
# Install essential packages [sudo req.]
|
||||
apt-get -y install wget build-essential git texinfo libc6 libgmp-dev libmpfr-dev libmpc-dev libpng-dev zlib1g-dev libtool autoconf
|
||||
|
||||
# change to the users root directory
|
||||
cd ~/
|
||||
|
||||
# add a system variable and make it perminent
|
||||
# echo 'N64_INST=/usr/local/libdragon' >> /etc/environment
|
||||
# echo 'export N64_INST=/usr/local/libdragon' >> ~/.bashrc
|
||||
export N64_INST=/usr/local/libdragon
|
||||
# source ~/.bashrc
|
||||
|
||||
# Pull the latest libdragon source code and make a build directory
|
||||
git clone https://github.com/dragonminded/libdragon.git
|
||||
# set to correct commit
|
||||
|
||||
# fix issues with the build scripts
|
||||
sed -i -- 's|${N64_INST:-/usr/local}|/usr/local/libdragon|g' libdragon/tools/build
|
||||
sed -i -- 's|--with-newlib|--with-newlib --with-system-zlib|g' libdragon/tools/build
|
||||
|
||||
sed -i -- 's| -lpng|\nLDLIBS = -lpng|g' libdragon/tools/mksprite/Makefile
|
||||
sed -i -- 's| -Werror| -w|g' libdragon/tools/mksprite/Makefile
|
||||
|
||||
# make a build folder for libdragon
|
||||
mkdir libdragon/build_gcc
|
||||
cp libdragon/tools/build-toolchain.sh libdragon/build/build-toolchain.sh
|
||||
|
||||
# run the build script (this will take a while! and if not sudo, will ask for password mid flow!)
|
||||
cd libdragon/build
|
||||
./build-toolchain.sh
|
||||
|
||||
cd ..
|
||||
# run the install script [sudo req]
|
||||
make
|
||||
make install
|
||||
make tools
|
||||
make tools-install
|
||||
|
||||
cd ..
|
||||
# install libmikmod (custom version)
|
||||
git clone https://github.com/n64-tools/libmikmod
|
||||
cd libmikmod/n64
|
||||
make
|
||||
make install
|
||||
cd .. # we have are in a subfolder, this is not a duplicate...
|
||||
|
||||
cd ..
|
||||
# install libyaml
|
||||
git clone https://github.com/yaml/libyaml
|
||||
cd libyaml
|
||||
./bootstrap
|
||||
#$(N64_INST) converterd to $N64_INST below otherwise it will not run on WSFL
|
||||
export PATH=$PATH:$N64_INST/bin
|
||||
CFLAGS="-std=gnu99 -march=vr4300 -mtune=vr4300" \
|
||||
LDFLAGS="-L$N64_INST/lib -Tn64ld.x" \
|
||||
LIBS="-ldragon -lc -ldragonsys -lnosys" \
|
||||
./configure --host=mips64-elf --prefix=$N64_INST
|
||||
make
|
||||
make install
|
||||
|
||||
cd ..
|
||||
# install libmad (custom version)
|
||||
git clone https://github.com/n64-tools/libmad
|
||||
cd libmad
|
||||
export PATH=$PATH:$N64_INST/bin
|
||||
CFLAGS="-std=gnu99 -march=vr4300 -mtune=vr4300" \
|
||||
LDFLAGS="-L$N64_INST/lib -Tn64ld.x" \
|
||||
LIBS="-ldragon -lc -ldragonsys -lnosys" \
|
||||
./configure --host=mips64-elf --prefix=$N64_INST
|
||||
make
|
||||
make install
|
||||
|
||||
cd ..
|
||||
|
||||
# Perform cleanup
|
||||
apt-get -y autoremove
|
||||
apt-get autoclean
|
||||
|
||||
echo 'export N64_INST=/usr/local/libdragon' >> ~/.bashrc
|
||||
echo 'export PATH="$PATH:$N64_INST/bin"' >> ~/.bashrc
|
||||
|
@ -11,6 +11,5 @@ extern int text_offset;
|
||||
void printText(char *msg, int x, int y, display_context_t dcon);
|
||||
|
||||
void menu_about(display_context_t disp);
|
||||
void menu_controls(display_context_t disp);
|
||||
|
||||
#endif
|
||||
|
113
n64ld.x
113
n64ld.x
@ -1,113 +0,0 @@
|
||||
/* ========================================================================
|
||||
*
|
||||
* n64ld.x
|
||||
*
|
||||
* GNU Linker script for building an image that is set up for the N64
|
||||
* but still has the data factored into sections. It is not directly
|
||||
* runnable, and it contains the debug info if available. It will need
|
||||
* a 'loader' to perform the final stage of transformation to produce
|
||||
* a raw image.
|
||||
*
|
||||
* Copyright (c) 1999 Ground Zero Development, All rights reserved.
|
||||
* Developed by Frank Somers <frank@g0dev.com>
|
||||
* 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
|
||||
|
||||
}
|
@ -1,29 +1,29 @@
|
||||
; alt64 config file
|
||||
|
||||
[ed64] ; Menu config
|
||||
build=18 ; Release build number
|
||||
border_color_1=FFFFFFFF ; 0x00000080 RGBT
|
||||
border_color_2=3F3F3FFF ; 0x3F3F3FFF RGBT 00000060 w light
|
||||
box_color=000000B6 ; 0x00000080 RGBT
|
||||
selection_color=80008070 ; 0x80008070 RGBT 6495ED60
|
||||
list_font_color=CDC9C940 ; 0x80008070 RGBT 6495ED60
|
||||
list_dir_font_color=FFFFE040 ; 0x80008070 RGBT 6495ED60
|
||||
selection_font_color=FFB90FFF ; 0x80008070 RGBT 6495ED60
|
||||
text_offset=0 ; shift menu horizontal e.g. -1
|
||||
cd_behaviour=1 ; 0=first entry 1=last entry
|
||||
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=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
|
||||
mempak_path=/MEMPAKS/ ; surround with slashes
|
||||
save_path=SDSAVE ; save directory inside ED64
|
||||
[ed64] ; Menu config
|
||||
build=20 ; Release build number
|
||||
border_color_1=FFFFFFFF ; 0x00000080 RGBT
|
||||
border_color_2=3F3F3FFF ; 0x3F3F3FFF RGBT 00000060 w light
|
||||
box_color=000000B6 ; 0x00000080 RGBT
|
||||
selection_color=80008070 ; 0x80008070 RGBT 6495ED60
|
||||
list_font_color=CDC9C940 ; 0x80008070 RGBT 6495ED60
|
||||
list_dir_font_color=FFFFE040 ; 0x80008070 RGBT 6495ED60
|
||||
selection_font_color=FFB90FFF ; 0x80008070 RGBT 6495ED60
|
||||
text_offset=0 ; shift menu horizontal e.g. -1
|
||||
cd_behaviour=1 ; 0=first entry 1=last entry
|
||||
scroll_behaviour=0 ; 0=page-system 1=classic
|
||||
quick_boot=1 ; 'START' boots last rom
|
||||
sound_on=1 ; sounds 1=on 0=off
|
||||
bgm_on=1 ; music 1=on 0=off
|
||||
page_display=1 ; display page
|
||||
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= ; backgrund png image 320x240 32bit
|
||||
hide_sysfolder=1 ; 1=hide 0=don't hide
|
||||
mempak_path=/MEMPAKS/ ; surround with slashes
|
||||
save_path=SDSAVE ; save directory inside ED64
|
||||
|
||||
[user]
|
||||
name = Altra64 ; Username
|
||||
|
||||
name = Altra64 ; Username
|
||||
|
BIN
res/filesystem/sprites/background.png
Normal file
BIN
res/filesystem/sprites/background.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 92 KiB |
Binary file not shown.
BIN
res/filesystem/sprites/n64controller.png
Normal file
BIN
res/filesystem/sprites/n64controller.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 44 KiB |
Binary file not shown.
BIN
res/filesystem/sprites/old/background.png
Normal file
BIN
res/filesystem/sprites/old/background.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 211 KiB |
BIN
res/filesystem/sprites/old/background.sprite
Normal file
BIN
res/filesystem/sprites/old/background.sprite
Normal file
Binary file not shown.
BIN
res/filesystem/sprites/old/n64controller.png
Normal file
BIN
res/filesystem/sprites/old/n64controller.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 45 KiB |
BIN
res/filesystem/sprites/old/n64controller.sprite
Normal file
BIN
res/filesystem/sprites/old/n64controller.sprite
Normal file
Binary file not shown.
BIN
res/filesystem/sprites/old/splash.png
Normal file
BIN
res/filesystem/sprites/old/splash.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 210 KiB |
BIN
res/filesystem/sprites/old/splash.sprite
Normal file
BIN
res/filesystem/sprites/old/splash.sprite
Normal file
Binary file not shown.
BIN
res/filesystem/sprites/splash.png
Normal file
BIN
res/filesystem/sprites/splash.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 81 KiB |
Binary file not shown.
@ -173,7 +173,7 @@ void drawImage(display_context_t dcon, sprite_t *sprite) {
|
||||
for (int i=0; i<sprite->hslices; i++) {
|
||||
rdp_sync(SYNC_PIPE);
|
||||
rdp_load_texture_stride(0, 0, MIRROR_DISABLED, sprite, j*sprite->hslices + i);
|
||||
rdp_draw_sprite(0, x, y, 0);
|
||||
rdp_draw_sprite(0, x, y);
|
||||
x += 32;
|
||||
}
|
||||
y += 16;
|
||||
|
516
src/main.c
516
src/main.c
File diff suppressed because it is too large
Load Diff
@ -187,8 +187,8 @@ void view_mpk_file(display_context_t disp, char *mpk_filename)
|
||||
32768, /* [IN] Number of bytes to read */
|
||||
&bytesread /* [OUT] Number of bytes read */
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
f_close(&file);
|
||||
|
||||
printText("File contents:", 11, 5, disp);
|
||||
@ -305,7 +305,7 @@ void view_mpk_file(display_context_t disp, char *mpk_filename)
|
||||
else
|
||||
{
|
||||
printText("empty", 11, -1, disp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -420,7 +420,7 @@ void mpk_to_file(display_context_t disp, char *mpk_filename, int quick)
|
||||
if (result == FR_OK)
|
||||
{
|
||||
controller_init();
|
||||
|
||||
|
||||
int err = 0;
|
||||
for (int j = 0; j < 128; j++)
|
||||
{
|
||||
@ -438,9 +438,9 @@ void mpk_to_file(display_context_t disp, char *mpk_filename, int quick)
|
||||
|
||||
f_close(&file);
|
||||
|
||||
|
||||
|
||||
sprintf(buff, "File: %s%i.MPK", mpk_filename, v);
|
||||
|
||||
|
||||
printText(buff, 9, -1, disp);
|
||||
printText("backup done...", 9, -1, disp);
|
||||
}
|
||||
|
@ -18,10 +18,8 @@ void menu_about(display_context_t disp)
|
||||
sprintf(firmware_str, "ED64 firmware: v%03x", evd_getFirmVersion());
|
||||
printText(firmware_str, 9, -1, disp);
|
||||
printText("by JonesAlmighty", 9, -1, disp);
|
||||
printText(" ", 9, -1, disp);
|
||||
printText("Based on ALT64", 9, -1, disp);
|
||||
printText("By Saturnu", 9, -1, disp);
|
||||
printText(" ", 9, -1, disp);
|
||||
printText("credits to:", 9, -1, disp);
|
||||
printText("Jay Oster", 9, -1, disp);
|
||||
printText("Krikzz", 9, -1, disp);
|
||||
@ -29,6 +27,8 @@ void menu_about(display_context_t disp)
|
||||
printText("ChillyWilly", 9, -1, disp);
|
||||
printText("ShaunTaylor", 9, -1, disp);
|
||||
printText("Conle Z: Page 2", 9, -1, disp);
|
||||
printText("AriaHiro64", 9, -1, disp);
|
||||
printText("moparisthebest", 9, -1, disp);
|
||||
} //TODO: make scrolling text, should include libraries used.
|
||||
void menu_controls(display_context_t disp)
|
||||
{
|
||||
@ -55,4 +55,4 @@ void menu_controls(display_context_t disp)
|
||||
printText(" ", 4, -1, disp);
|
||||
printText(" C-down: Toplist 15", 4, -1, disp);
|
||||
|
||||
}
|
||||
}
|
||||
|
17
src/sound.c
17
src/sound.c
@ -2,32 +2,27 @@
|
||||
// Copyright (c) 2017 The Altra64 project contributors
|
||||
// See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
#define SOUND_ENABLED
|
||||
#if !defined(SOUND_ENABLED)
|
||||
|
||||
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
|
||||
@ -69,7 +64,7 @@ void sndInit(void)
|
||||
/* get ready to play */
|
||||
MikMod_EnableOutput();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
void sndPlayBGM(char* filename)
|
||||
@ -86,7 +81,7 @@ void sndPlayBGM(char* filename)
|
||||
if (moduleBGM)
|
||||
{
|
||||
Player_Start(moduleBGM);
|
||||
Player_SetVolume(20);
|
||||
Player_SetVolume(80);
|
||||
}
|
||||
}
|
||||
|
||||
@ -117,7 +112,7 @@ void sndPlaySFX(char* filename)
|
||||
{
|
||||
Voice_Stop(voiceSFX);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (hashtable_get(samples, filename) == NULL)
|
||||
{
|
||||
@ -125,9 +120,9 @@ void sndPlaySFX(char* filename)
|
||||
}
|
||||
|
||||
//audio_write_silence();
|
||||
Voice_SetVolume(voiceSFX, 200);
|
||||
Voice_SetVolume(voiceSFX, 800);
|
||||
voiceSFX = Sample_Play(hashtable_get(samples, filename), 0, 0);
|
||||
|
||||
|
||||
MikMod_Update(); //force an update so that the voice is registered as playing!
|
||||
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include "version.h"
|
||||
|
||||
#define ALTRA64_VERSION "0.1.8.6.1.3"
|
||||
#define ALTRA64_VERSION "0.2.0.3 beta"
|
||||
|
||||
const char* Altra64_GetVersionString(void)
|
||||
{
|
||||
|
@ -6,13 +6,13 @@
|
||||
|
||||
#! /bin/bash
|
||||
sudo mount /dev/sdb1 /mnt
|
||||
file=/mnt/ED64P/OS64P.V64
|
||||
file=/mnt/ED64/OS64.v64
|
||||
if [ -e $file ]
|
||||
then
|
||||
echo -e "File $file exists - mount ok"
|
||||
echo -e "copy..."
|
||||
sudo cp ../bin/OS64P.V64 /mnt/ED64P/
|
||||
sudo cp ../res/ALT64.INI /mnt/ED64P/
|
||||
sudo cp ../bin/OS64.v64 /mnt/ED64/
|
||||
sudo cp ../res/ALT64.INI /mnt/ED64/
|
||||
echo -e "umounting..."
|
||||
sudo umount /mnt
|
||||
echo -e "done..."
|
||||
|
@ -52,7 +52,7 @@ MKDIR "%fs%"
|
||||
|
||||
SET "rom=%1"
|
||||
IF %1.==. (
|
||||
SET /P rom="Please enter full path to OS64P.V64 V2.12:"
|
||||
SET /P rom="Please enter full path to OS64.v64 V2.12:"
|
||||
)
|
||||
|
||||
set "drive=%rom:~0,1%"
|
||||
@ -98,7 +98,7 @@ echo "Linux rom dir is %rom%"
|
||||
|
||||
@echo ON
|
||||
|
||||
:: OS64P.V64 - Version 2.12 firmware offsets:
|
||||
:: OS64.V64 - Version 2.12 firmware offsets:
|
||||
:: cart offset (hex) offset (dec) length
|
||||
:: v2_old 0x25070 151664 61552
|
||||
:: v2 0x15930 88368 63276
|
||||
|
@ -1,36 +0,0 @@
|
||||
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
|
Loading…
Reference in New Issue
Block a user