Commit 2b510bb
Comprehensive cleanup: docs, edition 2024, new examples, build fixes (#3)
* Refactor: fix bugs, harden safety, and reduce duplication
- Fix off-by-one bounds check in embedded_graphics (0..=480 -> 0..480)
- Replace static mut VRAM_BASE with AtomicPtr in debug.rs
- Extract shared open_psp_file() helper in test_runner.rs
- DRY fminf/fmaxf into nan_aware_vfpu_op! macro in math/mod.rs
- Modernize mksfo.rs: if-let over contains_key+unwrap, iterator chains,
bounds checking on fixed-size buffer writes
- Replace magic numbers with named constants in prxgen.rs (PF_R|PF_X,
PRX_SEGMENT_ALIGN), replace unwrap() with .context()
- Simplify always-true u8 <= 255 check, add debug_assert for font index
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Refactor round 2: harden safety, improve clarity, reduce duplication
- Prevent double-panic by using Location::caller() fallback in panic handler
- Extract read_pixel<T> helper in screenshot.rs to DRY pixel format match arms
- Document allocator memory layout with ASCII diagram in alloc_impl.rs
- Unify prxmin.rs main to return Result<()> like other cargo-psp binaries
- Replace recursive tab expansion with loop in debug.rs
- Add Display impls for VramAllocatorInUseError and VramAllocError
- Consolidate redundant unsafe blocks in init_cwd (lib.rs)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Refactor round 3: fix critical gu.rs bugs, eliminate UB, harden allocators
Fix sceGuDisplay returning input instead of previous state, sceGuCheckList
using wrong pointer arithmetic, sceGuSetAllStatus transmuting arbitrary u32
to enum, callback_sig/callback_fin dropping the second argument, and
StencilOperation doc comment swaps. Replace all core::intrinsics::unreachable()
with safe unreachable!() macro across gu.rs, gum.rs, and vfpu_context.rs.
Guard both allocators against align_offset returning usize::MAX and add
checked_add overflow protection to std_support allocator. Fix mksfo defaults
overwriting user values, prxmin double-dot extension, debug.rs LineIter
off-by-one, embedded_graphics vram_base type mismatch, vram_alloc overflow,
benchmark division by zero, and screenshot unstable intrinsics. Extract
CONTEXTS array DRY, update paint-mode to edition 2024, remove stabilized
feature gates.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Revise docs, upgrade examples to edition 2024, add file-io/screenshot/audio-tone examples
- Rewrite README.md: add API Overview table, Features section, Examples table; move changelog lower
- Fix AGENTS.md: replace stale kernel mode description with current capabilities
- Add KERNEL_MODE_PLAN.md completed status header
- Upgrade 15 examples from edition 2018/2021 to 2024
- Fix edition 2024 static_mut_refs: use &raw mut for all static mut access
- Fix VRAM allocator calls: add .unwrap() for Result returns
- Add 3 new examples: file-io (sceIo*), screenshot (screenshot_bmp), audio-tone (sceAudio*)
- Remove obsolete FromIterator import from ratatui example
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix 3 pre-existing example build failures
- cube: regenerate ferris.bin at correct 128x128 RGBA size (was 65531 bytes, needs 65536)
- embedded-graphics: upgrade tinybmp 0.3.1 to 0.7.0 (fixes trait mismatch with embedded-graphics 0.8.1)
- rust-std-hello-world: auto-detect psp "std" feature in cargo-psp so RUST_PSP_BUILD_STD env var is no longer required
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: AI Agent Bot <ai-agent@localhost>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 661e18f commit 2b510bb
57 files changed
Lines changed: 1018 additions & 746 deletions
File tree
- cargo-psp/src
- bin
- examples
- audio-tone
- src
- clock-speed
- cube
- src
- embedded-graphics
- src
- file-io
- src
- fontdue-scrolltext
- src
- graphics
- gu-background
- src
- gu-debug-print
- src
- hello-world
- msg-dialog
- src
- paint-mode
- src
- rainbow
- src
- ratatui
- src
- rust-std-hello-world
- screenshot
- src
- time
- vfpu-addition
- vfpu-context-switching
- wlan
- psp/src
- math
- std_support
- sys
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
3 | 7 | | |
4 | 8 | | |
5 | 9 | | |
| |||
0 commit comments