Antonio Niño Díaz
ea94f949bc
led: Fix calls to ledBlink()
2025-02-28 01:34:40 +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
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
59700b44de
chore: Use UNIX line endings
2025-01-06 22:43:23 +00: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
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
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
0d02f4916f
library: Fix missing symbol errors
2024-12-18 01:10:29 +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
Antonio Niño Díaz
54ab2db319
library: Stop using the "register" keyword for variables
...
This isn't used for anything nowadays.
2024-12-10 20:56:03 +00:00
Antonio Niño Díaz
42c66d1e1d
init: Stop setting the locale to disable UTF-8
...
We should be using UTF-8.
2024-12-10 20:39:07 +00:00
Antonio Niño Díaz
ebd535b262
input: Send input state to ARM9 as soon as possible at init
...
This fixes an issue where the lid would be detected as closed right at the
start of the game because no input data had been received in the ARM9.
2024-12-10 20:38:44 +00:00
Antonio Niño Díaz
bff7cf7582
ipc: Check that pointer isn't NULL before using it
2024-12-10 20:37:57 +00:00
Antonio Niño Díaz
c99a86077e
library: Disable autocheck lid
...
This fixes crashes on the examples.
2024-12-10 01:36:51 +00:00
Antonio Niño Díaz
cd02af5eb5
Allocate IPC shared memory at runtime
...
The old system used a hardcoded address that corresponded to uncached
memory in DS, but not in DSi. This caused weird issues due to outdated
values being read from the ARM9, and nothing being sent to the ARM7.
This patch allocates this memory in main RAM in an arbitrary location
and uses the helper memUncached() of libnds so that it works in both DS
and DSi modes.
2024-12-06 02:27:42 +00:00
Antonio Niño Díaz
e40ba63256
Clean ARM7 code
2024-12-03 00:24:23 +00:00
Antonio Niño Díaz
3969f152b1
Move ARM7 pad update code to the VBL handler
...
The VCOUNT handler was required as a workaround that libnds had for a race
condition. THis is no longer needed now.
2024-12-02 18:50:14 +00:00
Antonio Niño Díaz
cbd61c5926
Add some comments about commented-out code
2024-12-02 18:49:27 +00:00
Antonio Niño Díaz
4aa580c045
Comment out some ARM7 code
2024-12-02 18:20:16 +00:00
Antonio Niño Díaz
3620f79b17
Add some missing binary files
2024-12-02 18:20:16 +00:00
Antonio Niño Díaz
f62138718c
Fix build errors in ARM7
2024-12-02 18:20:16 +00:00
Antonio Niño Díaz
a87d01c65f
Make ARM7 library build
2024-12-02 18:20:16 +00:00
Antonio Niño Díaz
35c6d7e7a7
Remove nesting in ARM7 source folder
2024-12-02 18:20:16 +00:00
Antonio Niño Díaz
171a92e501
Move ARM7 cores outside of source/ folder
...
The source/ folder will remain only for library code.
2024-12-02 18:20:16 +00:00
Antonio Niño Díaz
1d986b4800
Remove one level of nesting for ARM9 code
2024-12-02 18:20:16 +00:00
Antonio Niño Díaz
7d4f8d050d
Make ARM9 build in BlocksDS
2024-12-02 18:20:16 +00:00
aerglass
29d1d91e38
remove unused variables in PA_Gif
2024-12-02 18:20:16 +00:00