1
0
mirror of https://github.com/parasyte/alt64 synced 2024-11-15 21:55:03 -05:00

Merge pull request #4 from AriaHiro64/master

many improvements
This commit is contained in:
gameblabla 2021-09-25 14:27:08 +00:00 committed by GitHub
commit 49e06eb994
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
82 changed files with 617 additions and 143 deletions

7
.gitignore vendored Normal file → Executable file
View File

@ -17,3 +17,10 @@
*properties.json *properties.json
/.vs /.vs
/.vscode /.vscode
/toolchain/*
/lib/*
/include/*
/temp
*.zip
toolchain/

106
Makefile Normal file → Executable file
View File

@ -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. # See LICENSE file in the project root for full license information.
# #
ROOTDIR = $(N64_INST) ifdef SystemRoot
GCCN64PREFIX = $(ROOTDIR)/bin/mips64-elf- FIXPATH = $(subst /,\,$1)
CHKSUM64PATH = $(ROOTDIR)/bin/chksum64 RM = DEL /Q
MKDFSPATH = $(ROOTDIR)/bin/mkdfs else
N64TOOL = $(ROOTDIR)/bin/n64tool 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 HEADERNAME = header.ed64
HEADERTITLE = "EverDrive OS" HEADERTITLE = "EverDrive OS"
PROG_NAME = OS64P
SRCDIR = ./src 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
INCDIR = ./inc
RESDIR = ./res
OBJDIR = ./obj
BINDIR = ./bin
TOOLSDIR = ./tools
LINK_FLAGS = -O1 -L$(ROOTDIR)/lib -L$(ROOTDIR)/mips64-elf/lib -ldragon -lmad -lyaml -lc -lm -ldragonsys -lnosys $(LIBS) -Tn64.ld COMMON_FLAGS = -std=gnu17 -march=vr4300 -mtune=vr4300 -Wall -Wrestrict -Wno-pointer-sign -D_REENTRANT -DUSE_TRUETYPE $(INCLUDE_DIRS) $(SET_DEBUG)
PROG_NAME = OS64 COMMON_FLAGS += -DED64PLUS
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) FLAGS_VT = -O0 $(COMMON_FLAGS)
FLAGS = -O2 $(COMMON_FLAGS)
ASFLAGS = -mtune=vr4300 -march=vr4300 ASFLAGS = -mtune=vr4300 -march=vr4300
CC = $(GCCN64PREFIX)gcc 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
AS = $(GCCN64PREFIX)as
LD = $(GCCN64PREFIX)ld GCCN64PREFIX = $(ROOTDIR)/toolchain/gcc-toolchain-mips64/bin/mips64-elf-
CC = $(GCCN64PREFIX)gcc.exe
AS = $(GCCN64PREFIX)as.exe
LD = $(GCCN64PREFIX)ld.exe
OBJCOPY = $(GCCN64PREFIX)objcopy OBJCOPY = $(GCCN64PREFIX)objcopy
SOURCES := $(wildcard $(SRCDIR)/*.c) SRC = $(wildcard $(SRCDIR)/*.c)
OBJECTS = $(SOURCES:$(SRCDIR)/%.c=$(OBJDIR)/%.o)
$(PROG_NAME).v64: $ $(PROG_NAME).elf $(PROG_NAME).dfs OBJ = $(patsubst $(SRCDIR)/%.c, $(OBJDIR)/%.o, $(SRC))
$(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 all: $(PROG_NAME).v64
debug: $(PROG_NAME).v64 release: $(PROG_NAME).v64
debug: SET_DEBUG=-DDEBUG 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: 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))

29
README.md Normal file → Executable file
View File

@ -8,32 +8,13 @@ originally written by saturnu, and released on the
[Everdrive64 forum](http://krikzz.com/forum/index.php?topic=816.0). [Everdrive64 forum](http://krikzz.com/forum/index.php?topic=816.0).
## Building ## 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. 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` ### 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, from the projects root directory,
On Windows 10 run On Windows 10 run
@ -44,7 +25,7 @@ on linux
``` ```
$ make $ 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` ### Debug Build `Altra64`
To build the debug version of the Rom To build the debug version of the Rom
@ -58,7 +39,7 @@ on linux
``` ```
$ make debug $ 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` ### Clean `Altra64`

68
azure-pipelines.yml Executable file
View File

@ -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

107
bin/ejectjs.bat Executable file
View File

@ -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);
}

21
build.cmd Normal file → Executable file
View File

@ -1,23 +1,12 @@
:: 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 @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.==. ( IF %1.==. (
echo. "no parameter" ::echo. "no parameter"
%SystemPath%\\bash --verbose -c "export N64_INST=%env%; make" make
) ELSE ( ) ELSE (
echo. "parameter: %1" ::echo. "parameter: %1"
%SystemPath%\\bash --verbose -c "export N64_INST=%env%; make %1" make -d %1
) )
:pause :pause

0
doc/functions.txt Normal file → Executable file
View File

0
inc/chksum64.h Normal file → Executable file
View File

0
inc/cic.h Normal file → Executable file
View File

0
inc/debug.h Normal file → Executable file
View File

0
inc/diskio.h Normal file → Executable file
View File

0
inc/errors.h Normal file → Executable file
View File

0
inc/everdrive.h Normal file → Executable file
View File

0
inc/ff.h Normal file → Executable file
View File

0
inc/ffconf.h Normal file → Executable file
View File

0
inc/font_patch/font.h Normal file → Executable file
View File

0
inc/font_patch/info.txt Normal file → Executable file
View File

0
inc/hashtable.h Normal file → Executable file
View File

0
inc/image.h Normal file → Executable file
View File

0
inc/ini.h Normal file → Executable file
View File

0
inc/integer.h Normal file → Executable file
View File

0
inc/main.h Normal file → Executable file
View File

0
inc/mem.h Normal file → Executable file
View File

0
inc/memorypak.h Normal file → Executable file
View File

1
inc/menu.h Normal file → Executable file
View File

@ -11,5 +11,6 @@ extern int text_offset;
void printText(char *msg, int x, int y, display_context_t dcon); void printText(char *msg, int x, int y, display_context_t dcon);
void menu_about(display_context_t disp); void menu_about(display_context_t disp);
void menu_controls(display_context_t disp);
#endif #endif

0
inc/mp3.h Normal file → Executable file
View File

0
inc/regsinternal.h Normal file → Executable file
View File

0
inc/rom.h Normal file → Executable file
View File

0
inc/sd.h Normal file → Executable file
View File

0
inc/sound.h Normal file → Executable file
View File

0
inc/sram.h Normal file → Executable file
View File

0
inc/stb_image.h Normal file → Executable file
View File

0
inc/stb_truetype.h Normal file → Executable file
View File

0
inc/strlib.h Normal file → Executable file
View File

0
inc/sys.h Normal file → Executable file
View File

0
inc/types.h Normal file → Executable file
View File

0
inc/usb.h Normal file → Executable file
View File

0
inc/utils.h Normal file → Executable file
View File

0
inc/version.h Normal file → Executable file
View File

113
n64ld.x Executable file
View File

@ -0,0 +1,113 @@
/* ========================================================================
*
* 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
}

9
res/ALT64.INI Normal file → Executable file
View File

@ -15,9 +15,9 @@ scroll_behaviour=0 ; 0=page-system 1=classic
quick_boot=1 ; 'START' boots last rom quick_boot=1 ; 'START' boots last rom
sound_on=1 ; sounds 1=on 0=off sound_on=1 ; sounds 1=on 0=off
page_display=1 ; display page page_display=1 ; display page
tv_mode=2 ; 1=ntsc 2=pal 3=mpal 0=force_off tv_mode=0 ; 1=ntsc 2=pal 3=mpal 0=force_off
enable_colored_list=1 ; 1=enable 0=disalbe enable_colored_list=1 ; 1=enable 0=disable
ext_type=0 ; 0=classic 1=OS64 ext_type=1 ; 0=classic 1=OS64
sd_speed=2 ; 1=25MHz 2=50MHz sd_speed=2 ; 1=25MHz 2=50MHz
background_image=background.png ; backgrund png image 320x240 32bit background_image=background.png ; backgrund png image 320x240 32bit
hide_sysfolder=1 ; 1=hide 0=don't hide hide_sysfolder=1 ; 1=hide 0=don't hide
@ -27,6 +27,3 @@ save_path=SDSAVE ; save directory inside ED64
[user] [user]
name = Altra64 ; Username 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

0
res/filesystem/sounds/bamboo.wav Normal file → Executable file
View File

0
res/filesystem/sounds/bgm21.it Normal file → Executable file
View File

0
res/filesystem/sounds/done.wav Normal file → Executable file
View File

0
res/filesystem/sounds/ed64_mono.wav Normal file → Executable file
View File

0
res/filesystem/sounds/warning.wav Normal file → Executable file
View File

0
res/filesystem/sprites/background.sprite Normal file → Executable file
View File

0
res/filesystem/sprites/n64controller.sprite Normal file → Executable file
View File

0
res/filesystem/sprites/splash.sprite Normal file → Executable file
View File

0
res/header.ed64 Normal file → Executable file
View File

0
src/chksum64.c Normal file → Executable file
View File

0
src/cic.c Normal file → Executable file
View File

0
src/debug.c Normal file → Executable file
View File

0
src/diskio.c Normal file → Executable file
View File

0
src/everdrive.c Normal file → Executable file
View File

0
src/ff.c Normal file → Executable file
View File

0
src/ffsystem.c Normal file → Executable file
View File

0
src/ffunicode.c Normal file → Executable file
View File

0
src/hashtable.c Normal file → Executable file
View File

2
src/image.c Normal file → Executable file
View File

@ -173,7 +173,7 @@ void drawImage(display_context_t dcon, sprite_t *sprite) {
for (int i=0; i<sprite->hslices; i++) { for (int i=0; i<sprite->hslices; i++) {
rdp_sync(SYNC_PIPE); rdp_sync(SYNC_PIPE);
rdp_load_texture_stride(0, 0, MIRROR_DISABLED, sprite, j*sprite->hslices + i); 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; x += 32;
} }
y += 16; y += 16;

0
src/ini.c Normal file → Executable file
View File

202
src/main.c Normal file → Executable file
View File

@ -49,6 +49,9 @@
#include "menu.h" #include "menu.h"
#include "cic.h" #include "cic.h"
#define ED64PLUS
#define USE_TRUETYPE
#ifdef ED64PLUS #ifdef ED64PLUS
#define ED64_FIRMWARE_PATH "ED64P" #define ED64_FIRMWARE_PATH "ED64P"
#else #else
@ -167,6 +170,7 @@ enum InputMap
mpk_quick_backup, mpk_quick_backup,
mp3, mp3,
abort_screen, abort_screen,
control_screen,
}; };
enum InputMap input_mapping = file_manager; enum InputMap input_mapping = file_manager;
@ -702,7 +706,7 @@ void drawBoxNumber(display_context_t disp, int box)
break; //info screen break; //info screen
case 9: case 9:
box_color = graphics_make_color(0x00, 0x00, 0x00, 0xB6); box_color = graphics_make_color(0x00, 0x00, 0x00, 0xB6);
drawBox(28, 49, 260, 150, disp); drawBox(28, 20, 260, 200, disp);
break; //yellow toplist break; //yellow toplist
case 10: case 10:
box_color = graphics_make_color(0x00, 0x60, 0x00, 0xC3); box_color = graphics_make_color(0x00, 0x60, 0x00, 0xC3);
@ -1084,52 +1088,57 @@ sprite_t *loadPng(u8 *png_filename)
} }
void loadgbrom(display_context_t disp, u8 *buff) void loadgbrom(display_context_t disp, TCHAR *rom_path)
{ {
FRESULT fr; drawShortInfoBox(disp, " loading please wait", 0);
FILINFO fno;
fr = f_stat("/"ED64_FIRMWARE_PATH"/gblite.z64", &fno);
if (fr == FR_OK)
{
TCHAR gb_sram_file[64];
sprintf(gb_sram_file, "/"ED64_FIRMWARE_PATH"/%s/gblite.SRM", save_path);
FRESULT result; FRESULT result;
FIL file; FIL emufile;
UINT bytesread; UINT emubytesread;
result = f_open(&file, gb_sram_file, FA_WRITE | FA_OPEN_ALWAYS); result = f_open(&emufile, "/"ED64_FIRMWARE_PATH"/gb.v64", FA_READ);
if (result == FR_OK) if (result == FR_OK)
{ {
static uint8_t sram_buffer[36928]; int emufsize = f_size(&emufile);
//load gb emulator
for (int i = 0; i < 36928; i++)
sram_buffer[i] = 0;
sprintf(sram_buffer, buff);
UINT bw;
result = result =
f_write ( f_read (
&file, /* [IN] Pointer to the file object structure */ &emufile, /* [IN] File object */
sram_buffer, /* [IN] Pointer to the data to be written */ (void *)0xb0000000, /* [OUT] Buffer to store read data */
32768, /* [IN] Number of bytes to write */ //TODO: why is this shorter than the sram buffer? emufsize, /* [IN] Number of bytes to read */
&bw /* [OUT] Pointer to the variable to return number of bytes written */ &emubytesread /* [OUT] Number of bytes read */
); );
f_close(&file); f_close(&emufile);
sprintf(rom_filename, "gblite"); //load gb rom
gbload = 1; FIL romfile;
UINT rombytesread;
result = f_open(&romfile, rom_path, FA_READ);
loadrom(disp, "/"ED64_FIRMWARE_PATH"/gblite.z64", 1); if (result == FR_OK)
{
int romfsize = f_size(&romfile);
result =
f_read (
&romfile, /* [IN] File object */
(void *)0xb0200000, /* [OUT] Buffer to store read data */
romfsize, /* [IN] Number of bytes to read */
&rombytesread /* [OUT] Number of bytes read */
);
f_close(&romfile);
boot_cic = CIC_6102;
boot_save = 5; //flash
force_tv = 0; //no force
cheats_on = 0; //cheats off
checksum_fix_on = 0;
bootRom(disp, 1);
} }
} }
} }
void loadmsx2rom(display_context_t disp, TCHAR *rom_path) void loadmsx2rom(display_context_t disp, TCHAR *rom_path)
{ {
@ -1313,7 +1322,7 @@ void loadnesrom(display_context_t disp, TCHAR *rom_path)
f_close(&romfile); f_close(&romfile);
boot_cic = CIC_6102; boot_cic = CIC_6102;
boot_save = 0; //save off/cpak boot_save = 2; //SRAM
force_tv = 0; //no force force_tv = 0; //no force
cheats_on = 0; //cheats off cheats_on = 0; //cheats off
checksum_fix_on = 0; checksum_fix_on = 0;
@ -2334,7 +2343,11 @@ void drawTextInput(display_context_t disp, char *msg)
} }
void drawConfirmBox(display_context_t disp) void drawConfirmBox(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, 5); drawBoxNumber(disp, 5);
display_show(disp); display_show(disp);
@ -2355,8 +2368,14 @@ void drawConfirmBox(display_context_t disp)
} }
void drawShortInfoBox(display_context_t disp, char *text, u8 mode) void drawShortInfoBox(display_context_t disp, char *text, u8 mode)
{ { 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);
if (mode == 0) if (mode == 0)
drawBoxNumber(disp, 7); drawBoxNumber(disp, 7);
else if (mode == 1) else if (mode == 1)
drawBoxNumber(disp, 8); drawBoxNumber(disp, 8);
@ -3019,6 +3038,11 @@ void drawSet4(display_context_t disp)
void showAboutScreen(display_context_t disp) void showAboutScreen(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, 2); drawBoxNumber(disp, 2);
display_show(disp); display_show(disp);
@ -3027,6 +3051,21 @@ void showAboutScreen(display_context_t disp)
menu_about(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) void loadFile(display_context_t disp)
{ {
@ -3516,7 +3555,11 @@ void handleInput(display_context_t disp, sprite_t *contr)
printText(" ", 9, -1, disp); printText(" ", 9, -1, disp);
printText("search...", 9, -1, disp); printText("search...", 9, -1, disp);
mpk_to_file(disp, input_text, 0); mpk_to_file(disp, input_text, 0);
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);
drawShortInfoBox(disp, " done", 0); drawShortInfoBox(disp, " done", 0);
sleep(1000); sleep(1000);
@ -3550,6 +3593,12 @@ void handleInput(display_context_t disp, sprite_t *contr)
input_mapping = mempak_menu; input_mapping = mempak_menu;
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, 2); drawBoxNumber(disp, 2);
display_show(disp); display_show(disp);
@ -3600,6 +3649,11 @@ void handleInput(display_context_t disp, sprite_t *contr)
case mempak_menu: case mempak_menu:
//c-up or A //c-up or A
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);
drawConfirmBox(disp); drawConfirmBox(disp);
//confirm format mpk //confirm format mpk
input_mapping = mpk_format; input_mapping = mpk_format;
@ -3638,8 +3692,13 @@ void handleInput(display_context_t disp, sprite_t *contr)
if (list[cursor].type != DT_DIR && empty == 0) if (list[cursor].type != DT_DIR && empty == 0)
{ {
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, 11); drawBoxNumber(disp, 11);
display_show(disp);
char *part; char *part;
part = malloc(slen(list[cursor].filename)); part = malloc(slen(list[cursor].filename));
@ -3688,6 +3747,11 @@ void handleInput(display_context_t disp, sprite_t *contr)
case mpk_format: case mpk_format:
// format mpk // format mpk
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, 2); drawBoxNumber(disp, 2);
display_show(disp); display_show(disp);
@ -3711,6 +3775,11 @@ void handleInput(display_context_t disp, sprite_t *contr)
} }
else else
{ {
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);
drawShortInfoBox(disp, " done", 0); drawShortInfoBox(disp, " done", 0);
input_mapping = abort_screen; input_mapping = abort_screen;
} }
@ -3728,6 +3797,11 @@ void handleInput(display_context_t disp, sprite_t *contr)
case mpk_restore: case mpk_restore:
//restore mpk //restore mpk
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, 2); drawBoxNumber(disp, 2);
display_show(disp); display_show(disp);
@ -3735,7 +3809,11 @@ void handleInput(display_context_t disp, sprite_t *contr)
printText(" ", 9, -1, disp); printText(" ", 9, -1, disp);
file_to_mpk(disp, rom_filename); file_to_mpk(disp, rom_filename);
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);
drawShortInfoBox(disp, " done", 0); drawShortInfoBox(disp, " done", 0);
sleep(1000); sleep(1000);
@ -3746,6 +3824,11 @@ void handleInput(display_context_t disp, sprite_t *contr)
case mpk_quick_backup: case mpk_quick_backup:
//quick-backup //quick-backup
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, 2); drawBoxNumber(disp, 2);
display_show(disp); display_show(disp);
@ -3754,7 +3837,11 @@ void handleInput(display_context_t disp, sprite_t *contr)
printText("search...", 9, -1, disp); printText("search...", 9, -1, disp);
mpk_to_file(disp, list[cursor].filename, 1); //quick mpk_to_file(disp, list[cursor].filename, 1); //quick
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);
drawShortInfoBox(disp, " done", 0); drawShortInfoBox(disp, " done", 0);
sleep(1000); sleep(1000);
input_mapping = abort_screen; input_mapping = abort_screen;
@ -3806,6 +3893,12 @@ void handleInput(display_context_t disp, sprite_t *contr)
//preload config or file header //preload config or file header
readRomConfig(disp, rom_filename, name_file); readRomConfig(disp, rom_filename, name_file);
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);
drawRomConfigBox(disp, 0); drawRomConfigBox(disp, 0);
display_show(disp); display_show(disp);
@ -3913,7 +4006,14 @@ void handleInput(display_context_t disp, sprite_t *contr)
if (!strcmp(extension, "Z64") || !strcmp(extension, "V64") || !strcmp(extension, "N64")) if (!strcmp(extension, "Z64") || !strcmp(extension, "V64") || !strcmp(extension, "N64"))
{ //rom { //rom
//load rom //load rom
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, 3); //rominfo drawBoxNumber(disp, 3); //rominfo
display_show(disp);
u16 msg = 0; u16 msg = 0;
evd_ulockRegs(); evd_ulockRegs();
@ -3969,12 +4069,17 @@ void handleInput(display_context_t disp, sprite_t *contr)
{ {
case file_manager: case file_manager:
showAboutScreen(disp); showAboutScreen(disp);
input_mapping = none; input_mapping = control_screen;
break; break;
case mempak_menu: case mempak_menu:
if (sound_on) if (sound_on)
playSound(2); playSound(2);
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, 4); drawBoxNumber(disp, 4);
display_show(disp); display_show(disp);
@ -3982,6 +4087,11 @@ void handleInput(display_context_t disp, sprite_t *contr)
input_mapping = abort_screen; input_mapping = abort_screen;
break; break;
case control_screen:
showControlScreen(disp);
input_mapping = none;
break;
default: default:
break; break;
} }
@ -4041,9 +4151,14 @@ void handleInput(display_context_t disp, sprite_t *contr)
case mempak_menu: case mempak_menu:
{ {
//open up charinput screen //open up charinput screen
while (!(disp = display_lock()))
;
new_scroll_pos(&cursor, &page, MAX_LIST, count);
clearScreen(disp); //part clear?
input_mapping = char_input; input_mapping = char_input;
input_text[0] = '\0'; input_text[0] = '\0';
graphics_draw_sprite(disp, 0, 0, contr); graphics_draw_sprite(disp, 0, 0, contr);
display_show(disp);
break; break;
} }
case char_input: case char_input:
@ -4107,6 +4222,10 @@ void handleInput(display_context_t disp, sprite_t *contr)
f_close(&file); f_close(&file);
while (!(disp = display_lock()))
;
drawRomConfigBox(disp, 0);
display_show(disp);
drawShortInfoBox(disp, " done", 0); drawShortInfoBox(disp, " done", 0);
toplist_reload = 1; toplist_reload = 1;
} }
@ -4227,6 +4346,7 @@ void handleInput(display_context_t disp, sprite_t *contr)
; ;
graphics_set_color(graphics_make_color(0xFF, 0xFF, 0xFF, 0xFF), graphics_make_color(0x00, 0x00, 0x00, 0x00)); graphics_set_color(graphics_make_color(0xFF, 0xFF, 0xFF, 0xFF), graphics_make_color(0x00, 0x00, 0x00, 0x00));
new_scroll_pos(&cursor, &page, MAX_LIST, count);
clearScreen(disp); clearScreen(disp);
display_show(disp); display_show(disp);

0
src/mem.c Normal file → Executable file
View File

0
src/memorypak.c Normal file → Executable file
View File

0
src/menu.c Normal file → Executable file
View File

28
src/menu_about.c Normal file → Executable file
View File

@ -28,5 +28,31 @@ void menu_about(display_context_t disp)
printText("Richard Weick", 9, -1, disp); printText("Richard Weick", 9, -1, disp);
printText("ChillyWilly", 9, -1, disp); printText("ChillyWilly", 9, -1, disp);
printText("ShaunTaylor", 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. } //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);
}

0
src/mp3.c Normal file → Executable file
View File

0
src/rom.c Normal file → Executable file
View File

0
src/sd.c Normal file → Executable file
View File

5
src/sound.c Normal file → Executable file
View File

@ -7,22 +7,27 @@
void sndInit(void) void sndInit(void)
{ {
return 0;
} }
void sndPlayBGM(char* filename) void sndPlayBGM(char* filename)
{ {
return 0;
} }
void sndStopAll(void) void sndStopAll(void)
{ {
return 0;
} }
void sndPlaySFX(char* filename) void sndPlaySFX(char* filename)
{ {
return 0;
} }
void sndUpdate(void) void sndUpdate(void)
{ {
return 0;
} }
#else #else

0
src/sram.c Normal file → Executable file
View File

0
src/strlib.c Normal file → Executable file
View File

0
src/sys.c Normal file → Executable file
View File

0
src/usb.c Normal file → Executable file
View File

0
src/utils.c Normal file → Executable file
View File

0
src/version.c Normal file → Executable file
View File

6
tools/deploy-sd.sh Normal file → Executable file
View File

@ -6,13 +6,13 @@
#! /bin/bash #! /bin/bash
sudo mount /dev/sdb1 /mnt sudo mount /dev/sdb1 /mnt
file=/mnt/ED64/OS64.v64 file=/mnt/ED64P/OS64P.V64
if [ -e $file ] if [ -e $file ]
then then
echo -e "File $file exists - mount ok" echo -e "File $file exists - mount ok"
echo -e "copy..." echo -e "copy..."
sudo cp ../bin/OS64.v64 /mnt/ED64/ sudo cp ../bin/OS64P.V64 /mnt/ED64P/
sudo cp ../res/ALT64.INI /mnt/ED64/ sudo cp ../res/ALT64.INI /mnt/ED64P/
echo -e "umounting..." echo -e "umounting..."
sudo umount /mnt sudo umount /mnt
echo -e "done..." echo -e "done..."

4
tools/extract-firmware.cmd Normal file → Executable file
View File

@ -52,7 +52,7 @@ MKDIR "%fs%"
SET "rom=%1" SET "rom=%1"
IF %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%" set "drive=%rom:~0,1%"
@ -98,7 +98,7 @@ echo "Linux rom dir is %rom%"
@echo ON @echo ON
:: OS64.V64 - Version 2.12 firmware offsets: :: OS64P.V64 - Version 2.12 firmware offsets:
:: cart offset (hex) offset (dec) length :: cart offset (hex) offset (dec) length
:: v2_old 0x25070 151664 61552 :: v2_old 0x25070 151664 61552
:: v2 0x15930 88368 63276 :: v2 0x15930 88368 63276

0
tools/reset-wsfl.cmd Normal file → Executable file
View File

0
tools/setup-linux.sh Normal file → Executable file
View File

0
tools/setup-wsfl.cmd Normal file → Executable file
View File

36
update-libs.ps1 Executable file
View File

@ -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