mirror of
https://github.com/Ed94/pikuma_ps1.git
synced 2026-06-01 18:41:13 -07:00
more progress
This commit is contained in:
+3
-5
@@ -1,10 +1,10 @@
|
|||||||
build
|
build
|
||||||
# psxdev_sample
|
psxdev_sample
|
||||||
toolchain/pcsx_redux
|
|
||||||
toolchain/armips
|
toolchain/armips
|
||||||
|
toolchain/pcsx-redux
|
||||||
|
toolchain/psyq_iwyu
|
||||||
|
|
||||||
*.exe
|
*.exe
|
||||||
|
|
||||||
*.elf
|
*.elf
|
||||||
*.map
|
*.map
|
||||||
*.cpe
|
*.cpe
|
||||||
@@ -12,5 +12,3 @@ toolchain/armips
|
|||||||
*.dep
|
*.dep
|
||||||
*.o
|
*.o
|
||||||
*.a
|
*.a
|
||||||
|
|
||||||
psxdev_sample/SpinningCube/third_party
|
|
||||||
|
|||||||
Vendored
+9
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"files.associations": {
|
||||||
|
"*.rmd": "markdown",
|
||||||
|
"*.s": "armips",
|
||||||
|
"stdlib.h": "c",
|
||||||
|
"libetc.h": "c",
|
||||||
|
"libgpu.h": "c"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
#include <libetc.h>
|
||||||
|
#include <libgpu.h>
|
||||||
|
#include <libgte.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#define OTSIZE 4096
|
||||||
|
#define SCREEN_Z 512
|
||||||
|
|
||||||
|
typedef struct DB {
|
||||||
|
DRAWENV draw;
|
||||||
|
DISPENV disp;
|
||||||
|
u_long ot[OTSIZE];
|
||||||
|
POLY_F4 s[6];
|
||||||
|
} DB;
|
||||||
|
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
DB db[2];
|
||||||
|
DB *cdb;
|
||||||
|
|
||||||
|
ResetGraph(0);
|
||||||
|
InitGeom();
|
||||||
|
|
||||||
|
SetGraphDebug(0);
|
||||||
|
|
||||||
|
FntLoad(960, 256);
|
||||||
|
SetDumpFnt(FntOpen(32, 32, 320, 64, 0, 512));
|
||||||
|
|
||||||
|
SetGeomOffset(320, 240);
|
||||||
|
SetGeomScreen(SCREEN_Z);
|
||||||
|
|
||||||
|
SetDefDrawEnv(&db[0].draw, 0, 0, 640, 480);
|
||||||
|
SetDefDrawEnv(&db[1].draw, 0, 0, 640, 480);
|
||||||
|
SetDefDispEnv(&db[0].disp, 0, 0, 640, 480);
|
||||||
|
SetDefDispEnv(&db[1].disp, 0, 0, 640, 480);
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
FntPrint("Code compiled using Psy-Q libraries\n\n");
|
||||||
|
FntPrint("converted by psyq-obj-parser\n\n");
|
||||||
|
FntPrint("PCSX-Redux project\n\n");
|
||||||
|
FntPrint("https://bit.ly/pcsx-redux");
|
||||||
|
|
||||||
|
ClearImage(&cdb->draw.clip, 60, 120, 120);
|
||||||
|
|
||||||
|
DrawSync(0);
|
||||||
|
VSync(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -48,6 +48,8 @@ scoop install lua
|
|||||||
* Fixes psyq headers to include what they use, so changing the include order in your project doesn't break compiling.
|
* Fixes psyq headers to include what they use, so changing the include order in your project doesn't break compiling.
|
||||||
* Needed if you want to link and utilize the psyq C SDK
|
* Needed if you want to link and utilize the psyq C SDK
|
||||||
|
|
||||||
|
[Other toolchains (not used here)](https://www.psx.dev/getting-started)
|
||||||
|
|
||||||
## Gallery
|
## Gallery
|
||||||
|
|
||||||

|

|
||||||
|
|||||||
+34
-20
@@ -16,9 +16,10 @@ if ((test-path $path_build) -eq $false) {
|
|||||||
|
|
||||||
# --- Toolchain Definition ---
|
# --- Toolchain Definition ---
|
||||||
# Assumes 'mipsel-none-elf' toolchain is in your system's PATH.
|
# Assumes 'mipsel-none-elf' toolchain is in your system's PATH.
|
||||||
$Prefix = "mipsel-none-elf"
|
$Prefix = "mipsel-none-elf"
|
||||||
$Compiler = "$($Prefix)-gcc"
|
$Compiler = "$($Prefix)-gcc"
|
||||||
$Objcopy = "$($Prefix)-objcopy"
|
$Assembler = $Compiler
|
||||||
|
$Objcopy = "$($Prefix)-objcopy"
|
||||||
|
|
||||||
# --- Abstracted GCC/MIPS Flags ---
|
# --- Abstracted GCC/MIPS Flags ---
|
||||||
|
|
||||||
@@ -76,22 +77,19 @@ $f_link_lib = "-l"
|
|||||||
# Objcopy Flags
|
# Objcopy Flags
|
||||||
$f_objcopy_format = "-O"
|
$f_objcopy_format = "-O"
|
||||||
|
|
||||||
|
$path_pcsx_redux = join-path $path_toolchain 'pcsx-redux'
|
||||||
|
$path_nugget = join-path $path_pcsx_redux 'src/mips'
|
||||||
$path_nugget = join-path $path_third_party 'nugget'
|
$path_nugget_common = join-path $path_nugget 'common'
|
||||||
$path_psyq = join-path $path_third_party 'psyq'
|
$path_psyq_iwyu = join-path $path_toolchain 'psyq_iwyu'
|
||||||
$path_psyq_imyu = join-path $path_third_party 'psyq-iwyu'
|
$path_psyq_imyu_inc = join-path $path_psyq_imyu 'include'
|
||||||
|
|
||||||
$path_nugget_common = join-path $path_nugget 'common'
|
|
||||||
|
|
||||||
|
|
||||||
function assemble-unit { param(
|
function assemble-unit { param(
|
||||||
[string] $unit,
|
[string] $unit,
|
||||||
[stirng] $link_module,
|
[stirng] $link_module,
|
||||||
[string[]]$include_paths,
|
[string[]]$include_paths,
|
||||||
[string[]]$user_compile_args
|
[string[]]$user_assemble_args
|
||||||
)
|
)
|
||||||
$compile_args = @(
|
$assemble_args = @(
|
||||||
$f_arch_mips1,
|
$f_arch_mips1,
|
||||||
$f_arch_abi32,
|
$f_arch_abi32,
|
||||||
$f_arch_fp32,
|
$f_arch_fp32,
|
||||||
@@ -102,17 +100,22 @@ function assemble-unit { param(
|
|||||||
$f_arch_no_shared,
|
$f_arch_no_shared,
|
||||||
$f_arch_no_stack_prot
|
$f_arch_no_stack_prot
|
||||||
)
|
)
|
||||||
$compile_args += $f_no_stdlib
|
$assemble_args += $f_no_stdlib
|
||||||
$compile_args += $f_freestanding
|
$assemble_args += $f_freestanding
|
||||||
$compile_args += ($f_include + $path_nugget)
|
$assemble_args += ($f_include + $path_nugget)
|
||||||
|
|
||||||
$compile_args += $user_compile_args
|
$assemble_args += $user_assemble_args
|
||||||
|
|
||||||
|
$assemble_args += $f_compile, $unit, ($f_output + $link_module)
|
||||||
|
|
||||||
|
write-host "Assembling '$unit' -> '$link_module'"
|
||||||
|
$assemble_args | ForEach-Object { Write-Host "`t$_" -ForegroundColor Green }
|
||||||
|
& $Assembler $assemble_args
|
||||||
|
if ($LASTEXITCODE -ne 0) { write-error "Compilation failed for $unit. Aborting."; exit 1 }
|
||||||
}
|
}
|
||||||
function compile-unit { param(
|
function compile-unit { param(
|
||||||
[string]$unit,
|
[string] $unit,
|
||||||
[string]$link_module,
|
[string] $link_module,
|
||||||
[string[]]$include_paths,
|
[string[]]$include_paths,
|
||||||
[string[]]$user_compile_args
|
[string[]]$user_compile_args
|
||||||
)
|
)
|
||||||
@@ -140,13 +143,17 @@ function compile-unit { param(
|
|||||||
$f_arch_no_shared,
|
$f_arch_no_shared,
|
||||||
$f_arch_no_stack_prot
|
$f_arch_no_stack_prot
|
||||||
)
|
)
|
||||||
$path_psyq_imyu_inc = join-path $path_psyq_imyu 'include'
|
|
||||||
$compile_args += ($f_include + $path_psyq_imyu_inc)
|
$compile_args += ($f_include + $path_psyq_imyu_inc)
|
||||||
$compile_args += ($f_include + $path_nugget)
|
$compile_args += ($f_include + $path_nugget)
|
||||||
|
|
||||||
$compile_args += $user_compile_args
|
$compile_args += $user_compile_args
|
||||||
|
|
||||||
|
$compile_args += $f_compile, $unit, ($f_output + $link_module)
|
||||||
|
|
||||||
|
write-host "Compiling '$unit' -> '$link_module'"
|
||||||
|
$compile_args | ForEach-Object { Write-Host "`t$_" -ForegroundColor Green }
|
||||||
|
& $Compiler $compile_args
|
||||||
|
if ($LASTEXITCODE -ne 0) { write-error "Compilation failed for $unit. Aborting."; exit 1 }
|
||||||
}
|
}
|
||||||
function link-modules { param(
|
function link-modules { param(
|
||||||
[string] $elf,
|
[string] $elf,
|
||||||
@@ -232,6 +239,13 @@ function make-binary { param(
|
|||||||
}
|
}
|
||||||
|
|
||||||
function build-hello_psyqo {
|
function build-hello_psyqo {
|
||||||
|
$path_hello_psyq
|
||||||
|
|
||||||
|
$assemble_arsg = @()
|
||||||
|
$assemble_arsg += $f_debug
|
||||||
|
$assemble_arsg += $f_optimize_none
|
||||||
|
assemble-unit
|
||||||
|
|
||||||
$compile_args = @()
|
$compile_args = @()
|
||||||
$compile_args += $f_debug
|
$compile_args += $f_debug
|
||||||
$compile_args += $f_optimize_none
|
$compile_args += $f_optimize_none
|
||||||
|
|||||||
@@ -16,12 +16,15 @@ $misc = join-path $PSScriptRoot 'helpers/misc.ps1'
|
|||||||
|
|
||||||
$url_armips = 'https://github.com/Kingcom/armips.git'
|
$url_armips = 'https://github.com/Kingcom/armips.git'
|
||||||
$url_pcsx_redux = 'https://github.com/grumpycoders/pcsx-redux.git'
|
$url_pcsx_redux = 'https://github.com/grumpycoders/pcsx-redux.git'
|
||||||
|
$url_psyq_iwyu = 'https://github.com/johnbaumann/psyq_include_what_you_use.git'
|
||||||
|
|
||||||
$path_armips = join-path $path_toolchain 'armips'
|
$path_armips = join-path $path_toolchain 'armips'
|
||||||
$path_pcsx_redux = join-path $path_toolchain 'pcsx-redux'
|
$path_pcsx_redux = join-path $path_toolchain 'pcsx-redux'
|
||||||
|
$path_psyq_iwyu = join-path $path_toolchain 'psyq_iwyu'
|
||||||
|
|
||||||
clone-gitrepo $path_armips $url_armips
|
clone-gitrepo $path_armips $url_armips
|
||||||
clone-gitrepo $path_pcsx_redux $url_pcsx_redux
|
clone-gitrepo $path_pcsx_redux $url_pcsx_redux
|
||||||
|
clone-gitrepo $path_psyq_iwyu $url_psyq_iwyu
|
||||||
|
|
||||||
$path_armips_build = join-path $path_armips 'build'
|
$path_armips_build = join-path $path_armips 'build'
|
||||||
verify-path $path_armips_build
|
verify-path $path_armips_build
|
||||||
|
|||||||
Reference in New Issue
Block a user