Commit Graph

130 Commits

Author SHA1 Message Date
Antonio Niño Díaz
90b1cff6d9 github: Add workflow to publish the English documentation
Some checks failed
Documentation / Generate website (push) Has been cancelled
Documentation / Publish website with GitHub pages (push) Has been cancelled
2025-05-14 00:02:30 +01:00
Antonio Niño Díaz
1ca84ab146 docs: Update version number to 250228 2025-02-28 01:36:49 +00:00
Antonio Niño Díaz
ea94f949bc led: Fix calls to ledBlink() 2025-02-28 01:34:40 +00:00
Antonio Niño Díaz
97ac165126 docs: Add pacman to setup instructions in readme 2025-01-14 18:29:07 +00:00
Antonio Niño Díaz
554efb4bf8 library: docs: Prepare repository for version 250114 2025-01-14 01:50:03 +00:00
Antonio Niño Díaz
fd21dd70e7 docs: Update readme 2025-01-14 01:44:55 +00:00
Antonio Niño Díaz
d0eb8f9865 chore: Re-encode text files as UTF-8 2025-01-13 22:37:05 +00:00
Antonio Niño Díaz
bae63a54e9 aslib: Flush buffer when playing MP3 from RAM directly
If not, it's possible that some of the MP3 data is only in the data cache
and the ARM7 can't see it.
2025-01-12 22:02:31 +00:00
Antonio Niño Díaz
79279d775f 3dsprite: Load 3D texture palettes to the right address
VRAM_F is a uint16_t pointer, so adding an integer to it advances it by
double the amount of the integer. If a palette is 256 colors in size, the
pointer needs to advance by 512 bytes (so the integer needs to be 256).
2025-01-12 21:57:24 +00:00
Antonio Niño Díaz
300822152b dma: Replace macros by libnds function calls
Also, double-check that all the cache flushes are correct.
2025-01-12 14:36:25 +00:00
Antonio Niño Díaz
19c5b9bb93 dma: Wait for completion when started in immediate mode 2025-01-12 11:10:55 +00:00
Antonio Niño Díaz
71ab8272a5 dma: Make DMA macros safe
The dmaSetParams() of libnds waits correctly for the DMA copy to start
before it returns. The old macros don't do this, so they can cause issues.
2025-01-12 01:28:19 +00:00
Antonio Niño Díaz
d517210d8e dma: Flush cache before doing DMA copies 2025-01-11 17:41:04 +00:00
Antonio Niño Díaz
44b5c4d313 ipc: Actually send temperature and battery level to ARM9 2025-01-11 17:26:46 +00:00
Antonio Niño Díaz
59cf95f535 library: docs: Prepare repository for version 250107 2025-01-07 19:45:40 +00:00
Antonio Niño Díaz
e128b52d73 build: Remove outdated code from Makefile 2025-01-06 23:08:22 +00:00
Antonio Niño Díaz
65b22aeba9 docs: Cleanup documentation generation scripts 2025-01-06 23:05:04 +00:00
Antonio Niño Díaz
5dd1bda483 chore: Remove some batch files
They won't work because they aren't running in the right environment.
2025-01-06 22:44:48 +00:00
Antonio Niño Díaz
59700b44de chore: Use UNIX line endings 2025-01-06 22:43:23 +00:00
Antonio Niño Díaz
af225bd7e0 vbl: Threads can now interrupt main thread during VBL wait 2025-01-02 15:16:41 +01:00
Antonio Niño Díaz
f4f44a34ea exception: Enable default exception handler on the ARM7 2025-01-02 15:14:49 +01:00
Antonio Niño Díaz
6f074fd716 chore: Add TODO note to PA_IPC struct 2025-01-02 15:11:41 +01:00
Antonio Niño Díaz
3c214ee268 aslib: Clarify exit condition with a comment 2025-01-02 13:42:29 +01:00
Antonio Niño Díaz
5c813d8449 build: Allow SDROOT variable be overwriten 2025-01-02 13:41:51 +01:00
Antonio Niño Díaz
cb471a9cec chore: Fix more warnings about const data 2025-01-02 13:38:40 +01:00
Antonio Niño Díaz
4268002d83 chore: Stop using deprecated functions and types 2025-01-02 13:35:12 +01:00
Antonio Niño Díaz
939ec3c2a3 chore: Mark some arrays as const 2025-01-02 13:30:49 +01:00
Antonio Niño Díaz
db36f0e81e aslib: Enable interrupts in the VBL handler
This is required for any filesystem read that happens on the ARM7, like
DLDI or official cartridge reads on the ARM7, and DSi SD card reads.
2025-01-02 02:50:34 +01:00
Antonio Niño Díaz
d9669ddfdb aslib: Use cached memory instead of uncached
This should speed reads up when done on the ARM9.
2024-12-28 02:18:51 +01:00
Antonio Niño Díaz
9c5430d1e8 aslib: Flush cache on buffer only if allocated 2024-12-26 13:09:13 +01:00
Antonio Niño Díaz
9ed9696ec2 aslib: Refactor timer handling on ARM7
It looks like DeSmuMe resets the value of the timer whenever you write to
TIMERx_CR. Unfortunately, we need the value to be preserved when only
the playback rate is changed. To simplify timer handling, this commit
splits AS_SetTimer() into three functions that are more explicit about
what they are used for: AS_{Start/Set/Stop}_Timer()

Thanks to this, AS_SetTimer() can be reduced to the bare minimum so that it
works everywhere.
2024-12-26 00:57:09 +01:00
Antonio Niño Díaz
4d65e3ea11 aslib: Fix timer setup helper
This helper was resetting TIMER1_DATA to 0 whenever the frequency changed.
This means that whenever the user changed the playback rate this timer
would be set to 0. The problem is that this value is used to determine how
many samples need to be decoded during the next iteration. The number of
samples required is the difference between the old value and the new value.
If the new value is 0, the difference will be very big, so there will be a
buffer overflow when decoding too many samples and the game will likely
crash.
2024-12-26 00:28:37 +01:00
Antonio Niño Díaz
04749cd1e5 aslib: Add comment 2024-12-25 13:19:31 +01:00
Antonio Niño Díaz
c85a81c60d aslib: Simplify error handling in AS_MP3StreamPlay() 2024-12-25 13:19:06 +01:00
Antonio Niño Díaz
27cacd2a5f aslib: Handle MP3 events in the main loop instead of VBL handler
This will prevent race conditions due to the VBL handler changing values
while the main loop is handling the MP3 decoding.
2024-12-25 13:14:49 +01:00
Antonio Niño Díaz
2f01d2e304 chore: Remove VSCode configuration files
They only worked for one particular setup, and only with devkitPro.
2024-12-19 18:02:04 +00:00
Antonio Niño Díaz
fd2e666a6b aslib: Simplify error handling when reading MP3 file 2024-12-19 02:54:57 +00:00
Antonio Niño Díaz
1ca6378eac aslib: Fix error handling when opening and closing MP3 files 2024-12-19 02:19:52 +00:00
Antonio Niño Díaz
780b9c3d9b library: Fix "extern inline" functions
This combination doesn't make much sense. They were meant to be "static
inline" because they are private to their corresponding files.
2024-12-18 01:10:30 +00:00
Antonio Niño Díaz
73cf6380ac examples: Fix keyboard-related examples 2024-12-18 01:10:30 +00:00
Antonio Niño Díaz
0d02f4916f library: Fix missing symbol errors 2024-12-18 01:10:29 +00:00
Antonio Niño Díaz
11710a0f22 build: Detect more file extensions as data files 2024-12-17 02:34:17 +00:00
Antonio Niño Díaz
d6b1c1f0c1 template: Small improvement to makefile 2024-12-17 02:33:17 +00:00
Antonio Niño Díaz
c1ca78eebd aslib: Add guards to MP3-related functions 2024-12-14 03:04:32 +00:00
Antonio Niño Díaz
9c92cb7481 aslib: Refactor MP3 functions that read from the filesystem 2024-12-14 02:55:11 +00:00
Antonio Niño Díaz
1541a22008 aslib: Flush cache after calling calloc() for shared buffers
The CPU is the one that sets the buffers to 0, so it is needed to flush
them before the ARM7 can use them.
2024-12-14 02:53:47 +00:00
Antonio Niño Díaz
fd2c8f0878 aslib: Remove unneeded extern C guards
This is a C file, there is no need to add the guards.
2024-12-13 19:04:41 +00:00
Antonio Niño Díaz
5545ec60fd aslib: examples: Check for error in some functions
Check if memory allocation fails, for example.

Also, update the ASlib examples to check for error at ASlib boot.
2024-12-13 02:28:14 +00:00
Antonio Niño Díaz
bea7c89af6 aslib: Use calloc() instead of memalign(4, size)
calloc always returns pointers aligned to 4 bytes, and it clears the buffer
so it's safer to use it.
2024-12-13 02:18:14 +00:00
Antonio Niño Díaz
65abd55e32 aslib: Add some error checks to filesystem functions 2024-12-12 18:31:45 +00:00