forked from networkfusion/altra64
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aa1af6a
commit d407f16
Showing
82 changed files
with
469 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,10 @@ | |
*properties.json | ||
/.vs | ||
/.vscode | ||
|
||
/toolchain/* | ||
/lib/* | ||
/include/* | ||
/temp | ||
*.zip | ||
toolchain/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
|
||
OBJ = $(patsubst $(SRCDIR)/%.c, $(OBJDIR)/%.o, $(SRC)) | ||
|
||
all: $(PROG_NAME).v64 | ||
|
||
release: $(PROG_NAME).v64 | ||
|
||
$(PROG_NAME).elf : $(OBJECTS) | ||
@mkdir -p $(BINDIR) | ||
$(LD) -o $(BINDIR)/$(PROG_NAME).elf $(OBJECTS) $(LINK_FLAGS) | ||
debug: SET_DEBUG=-DDEBUG | ||
debug: $(PROG_NAME).v64 | ||
|
||
send: $(PROG_NAME).v64 | ||
$(TOOLSDIR)/up.bat | ||
|
||
$(OBJECTS): $(OBJDIR)/%.o : $(SRCDIR)/%.c | ||
@mkdir -p $(OBJDIR) | ||
$(CC) $(CFLAGS) -c $< -o $@ | ||
|
||
copy: $(PROG_NAME).v64 | ||
sh $(TOOLSDIR)/upload.sh | ||
$(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: | ||
$(MKDFSPATH) $(BINDIR)/$(PROG_NAME).dfs $(RESDIR)/filesystem/ | ||
$(MKDFS) $(BINDIR)/$(PROG_NAME).dfs $(RESDIR)/filesystem/ | ||
|
||
all: $(PROG_NAME).v64 | ||
$(OBJDIR)/gscore.o: $(SRCDIR)/gscore.c | ||
$(CC) $(FLAGS_VT) -c $(SRCDIR)/gscore.c -o $(OBJDIR)/gscore.o | ||
|
||
debug: $(PROG_NAME).v64 | ||
$(OBJDIR)/%.o : $(SRCDIR)/%.c | ||
$(CC) $(FLAGS) -c $< -o $@ | ||
|
||
debug: SET_DEBUG=-DDEBUG | ||
$(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)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,12 @@ | ||
:: | ||
:: Copyright (c) 2017 The Altra64 project contributors | ||
:: See LICENSE file in the project root for full license information. | ||
:: | ||
|
||
set PATH=%~dp0toolchain\gcc-toolchain-mips64\bin | ||
@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" | ||
%SystemPath%\\bash --verbose -c "export N64_INST=%env%; make" | ||
::echo. "no parameter" | ||
make | ||
) ELSE ( | ||
echo. "parameter: %1" | ||
%SystemPath%\\bash --verbose -c "export N64_INST=%env%; make %1" | ||
::echo. "parameter: %1" | ||
make -d %1 | ||
) | ||
|
||
:pause |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Oops, something went wrong.