{"id":16145599,"url":"https://github.com/falsepattern/zigstation2","last_synced_at":"2025-10-09T03:08:40.425Z","repository":{"id":251945649,"uuid":"838373533","full_name":"FalsePattern/ZigStation2","owner":"FalsePattern","description":"Write PlayStation 2 homebrew in Zig!","archived":false,"fork":false,"pushed_at":"2024-08-12T21:56:32.000Z","size":46,"stargazers_count":17,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-09T03:08:34.550Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FalsePattern.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-05T14:04:34.000Z","updated_at":"2025-06-27T20:05:21.000Z","dependencies_parsed_at":"2024-10-16T14:01:20.243Z","dependency_job_id":null,"html_url":"https://github.com/FalsePattern/ZigStation2","commit_stats":null,"previous_names":["falsepattern/zigstation2"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FalsePattern/ZigStation2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FalsePattern%2FZigStation2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FalsePattern%2FZigStation2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FalsePattern%2FZigStation2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FalsePattern%2FZigStation2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FalsePattern","download_url":"https://codeload.github.com/FalsePattern/ZigStation2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FalsePattern%2FZigStation2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000774,"owners_count":26082911,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T00:16:57.578Z","updated_at":"2025-10-09T03:08:40.408Z","avatar_url":"https://github.com/FalsePattern.png","language":"Zig","readme":"# ZigStation 2\n\nAn experimental project for compiling zig for the PlayStation 2, using the [PS2DEV](https://github.com/ps2dev/ps2dev)\ntoolchain and [PS2SDK](https://github.com/ps2dev/ps2sdk).\n\n## Requirements\n\n- Zig 0.14.0 (tested with `0.14.0-dev.839+a931bfada`)\n- PS2SDK and PS2DEV environment variables with a relatively recent build of the toolchain (`mips64r5900el-ps2-elf-gcc` works, `ee-gcc` doesn't)\n\n## Tested on\n\n- compiled EE code has been tested on:\n  - pcsx2 2.0 (working)\n  - SCPH-75004 (working)\n\n- compiled IOP code has been tested on:\n  - SCPH-75004 (working)\n\nPlanned testing:\n\n- SCPH-70004, primarily due to the original IOP.\n\nI don't have any other PS2 models on hand, but feel free to test the example elf file this repo compiles on your own consoles,\nand please report back whether it works on not!\n\n## Limitations\n\nPS2DEV declares a custom target called `mips64r5900el-ps2-elf`, and this cannot be compiled by Zig's LLVM backend.\nDue to this, the zig target has been set to `mipsel-freestanding-c`, which translates the zig code to C as if it was\ncompiling for a plain mipsel cpu without any ABI, and then the buildscript passes this generated C code to ps2dev's gcc.\n\nThe main issue with this is that any POSIX functionality in zig's standard library doesn't work (POSIX error type is\n`void` on freestanding), this includes most logging utilities, std.Thread (even though pthreads *is* available in PS2DEV).\n\n## Contents\n\n- `build.zig` - Contains an example buildscript that invokes the PS2DEV gcc compiler for compiling and linking\n- `src/c.h` - Separate C header file with the imports. The buildscript converts this to zig, and then adds it as an import.\nThe reason for doing it like this instead of @cImport is that `zls` is unaware of the PS2SDK system imports, and this\nalso reduces compile times a bit when changing zig code only (cImports don't need to be re-evaluated)\n- `src/main.zig` - An example code that can run on the ps2 once compiled. I will frequently modify this file, so it will\ndo different things depending on which commit you're on.\n- `shell.nix` - For NixOS users. A shell with the PS2DEV and PS2SDK env vars, and an FHS with the PS2DEV dependencies.\nYou probably have your own already if you got this far.\n- `zls` - Also for NixOS users. Launches the `zls` executable from PATH inside the `shell.nix` file's FHS.\n- `zig` - Ditto, runs `zig` in the same FHS as the `zls` one.\n\n## Future goals\n\n- Encapsulate the mess in build.zig to a standalone module which can be imported via build.zig.zon\n- Create a patchset for the zig standard library for the PS2DEV ABI\n- (maybe?) upstream a `ps2dev` OS target/abi to zig. Object file generation still unsupported (it's in LLVM), only C\nbackend is targeted for now.\n- Abstraction layers to hide the raw C code mess\n- DMA demo that works with the vector units to make a spinny cube using said abstraction layer\n\n## License\nPlain old LGPL3.0 for now, see `COPYING` and `COPYING.LESSER`.\n\n## Contributing\nFeel free to contribute any improvements, cleanups, abstraction layers, etc. (really just whatever you want, this project\nis still very new and I don't really have a precise goal aside from \"zig on PS2\")\n\n## Community\nAt the moment i'm only really active about ps2 zig programming in the [PS2 Scene](https://discord.gg/Uz8p9bJ6za)\ndiscord server's `#other-language-dev` channel. You can hop in there to see my insane ramblings i guess.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffalsepattern%2Fzigstation2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffalsepattern%2Fzigstation2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffalsepattern%2Fzigstation2/lists"}