more progress

This commit is contained in:
2025-08-05 22:16:55 -04:00
parent 713ad6a57a
commit 32c7adad6a
8 changed files with 102 additions and 25 deletions
+3 -5
View File
@@ -1,10 +1,10 @@
build
# psxdev_sample
toolchain/pcsx_redux
psxdev_sample
toolchain/armips
toolchain/pcsx-redux
toolchain/psyq_iwyu
*.exe
*.elf
*.map
*.cpe
@@ -12,5 +12,3 @@ toolchain/armips
*.dep
*.o
*.a
psxdev_sample/SpinningCube/third_party
+9
View File
@@ -0,0 +1,9 @@
{
"files.associations": {
"*.rmd": "markdown",
"*.s": "armips",
"stdlib.h": "c",
"libetc.h": "c",
"libgpu.h": "c"
}
}
+51
View File
@@ -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;
}
View File
+2
View File
@@ -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.
* Needed if you want to link and utilize the psyq C SDK
[Other toolchains (not used here)](https://www.psx.dev/getting-started)
## Gallery
![clear!](./docs/assets/pcsx-redux.main_2025-08-03_18-02-08.png)
+30 -16
View File
@@ -18,6 +18,7 @@ if ((test-path $path_build) -eq $false) {
# Assumes 'mipsel-none-elf' toolchain is in your system's PATH.
$Prefix = "mipsel-none-elf"
$Compiler = "$($Prefix)-gcc"
$Assembler = $Compiler
$Objcopy = "$($Prefix)-objcopy"
# --- Abstracted GCC/MIPS Flags ---
@@ -76,22 +77,19 @@ $f_link_lib = "-l"
# Objcopy Flags
$f_objcopy_format = "-O"
$path_nugget = join-path $path_third_party 'nugget'
$path_psyq = join-path $path_third_party 'psyq'
$path_psyq_imyu = join-path $path_third_party 'psyq-iwyu'
$path_pcsx_redux = join-path $path_toolchain 'pcsx-redux'
$path_nugget = join-path $path_pcsx_redux 'src/mips'
$path_nugget_common = join-path $path_nugget 'common'
$path_psyq_iwyu = join-path $path_toolchain 'psyq_iwyu'
$path_psyq_imyu_inc = join-path $path_psyq_imyu 'include'
function assemble-unit { param(
[string] $unit,
[stirng] $link_module,
[string[]]$include_paths,
[string[]]$user_compile_args
[string[]]$user_assemble_args
)
$compile_args = @(
$assemble_args = @(
$f_arch_mips1,
$f_arch_abi32,
$f_arch_fp32,
@@ -102,17 +100,22 @@ function assemble-unit { param(
$f_arch_no_shared,
$f_arch_no_stack_prot
)
$compile_args += $f_no_stdlib
$compile_args += $f_freestanding
$compile_args += ($f_include + $path_nugget)
$assemble_args += $f_no_stdlib
$assemble_args += $f_freestanding
$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(
[string]$unit,
[string]$link_module,
[string] $unit,
[string] $link_module,
[string[]]$include_paths,
[string[]]$user_compile_args
)
@@ -140,13 +143,17 @@ function compile-unit { param(
$f_arch_no_shared,
$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_nugget)
$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(
[string] $elf,
@@ -232,6 +239,13 @@ function make-binary { param(
}
function build-hello_psyqo {
$path_hello_psyq
$assemble_arsg = @()
$assemble_arsg += $f_debug
$assemble_arsg += $f_optimize_none
assemble-unit
$compile_args = @()
$compile_args += $f_debug
$compile_args += $f_optimize_none
+3
View File
@@ -16,12 +16,15 @@ $misc = join-path $PSScriptRoot 'helpers/misc.ps1'
$url_armips = 'https://github.com/Kingcom/armips.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_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_pcsx_redux $url_pcsx_redux
clone-gitrepo $path_psyq_iwyu $url_psyq_iwyu
$path_armips_build = join-path $path_armips 'build'
verify-path $path_armips_build