42569 Commits

Author SHA1 Message Date
Pokechu22
acb4a4be64 Eliminate hacky setup states
There still probably needs to be another state for CMD0 or such, but that can be handled separately.
2024-09-07 16:28:38 -07:00
Pokechu22
bb432b6a9e Only return SD device when CS is 0
This is NOT needed to fix anything, but still seems like a good idea to me.  Though getting a device based on CS still seems less than perfect (e.g. what does the hardware do if multiple chips are selected at the same time?  Probably it doesn't handle it well, but it might still be worth emulating...)
2024-09-07 16:28:38 -07:00
Pokechu22
d53407252e Call SetCS for all devices
The xor technique doesn't work well when 0 is a legal device, since CS not changing will return device 0, and then reset CS for that device.  This broke memcards; they now work.
2024-09-07 16:28:38 -07:00
Pokechu22
74d72198cc Print the file SD data is being read from 2024-09-07 16:28:38 -07:00
Pokechu22
68e07b11fc Re-add ConfigManager.h include
Dropped in b0f9bb9f136053c3fb164704e4d34a0ab0dd5dea - I should look at that for how to fix my own changes
2024-09-07 16:28:38 -07:00
Pokechu22
43ec859219 Handle GoIdleState and SendInterfaceCond exceptions 2024-09-07 16:28:38 -07:00
Pokechu22
bc82653fea More documentation references 2024-09-07 16:28:38 -07:00
Pokechu22
a4bde13b57 Fix SD Media Launcher
Datel...
2024-09-07 16:28:38 -07:00
Pokechu22
f8e57a9de3 Partially implement configuring the SD card path
This doesn't work (changes aren't saved to disk), and I don't fully understand why...
2024-09-07 16:28:38 -07:00
Pokechu22
8d7d7ab5e9 Allow configuring SP2
Note that the default was AD16 before, and I've now changed it to None.
2024-09-07 16:28:37 -07:00
Pokechu22
76d4fc4541 NOTE: EXI_DeviceMemoryCard could still use some cleanup 2024-09-07 16:28:37 -07:00
Pokechu22
ba343bdbdc Actually functional block read
This is enough for Pokémon Channel to save.  Loading should also work, but I'm unable to test since memory cards are still broken...
2024-09-07 16:28:37 -07:00
Pokechu22
8db60f54e2 WIP fix block reads
Enough for libogc, but not enough for Channel...
2024-09-07 16:28:37 -07:00
Pokechu22
b2c15e0fdb Implement ReadOCR
Libogc needs this now; I'm not sure what I changed from before that made it necessary.
2024-09-07 16:28:37 -07:00
Pokechu22
d958605a1e Undo some test stuff 2024-09-07 16:28:37 -07:00
Pokechu22
58347cc795 More work on multi-block reads; not fully functional 2024-09-07 16:28:37 -07:00
Pokechu22
1dd9ac2727 Fix multi-block reads 2024-09-07 16:28:37 -07:00
Pokechu22
6e5e8694c4 Implement SendStatus 2024-09-07 16:28:37 -07:00
Pokechu22
167d87e5cb Fix CRC handling
2 different CRC bugs, and also an OOB bug.
2024-09-07 16:28:37 -07:00
Pokechu22
40c4f3e8c1 Initial implementation of reads and writes
No idea if this actually works
2024-09-07 16:28:37 -07:00
Pokechu22
bd895d0a15 WriteBlock -> WriteSingleBlock 2024-09-07 16:28:37 -07:00
Pokechu22
33407f8a70 Remove hardcoded CRCs; validate incoming CRC7 2024-09-07 16:28:37 -07:00
Pokechu22
d0d8661f9b Add Common::HashCrc16 and Common::HashCrc7 2024-09-07 16:28:37 -07:00
Pokechu22
4f6cd4f535 Restructure code; start implementing read/write commands 2024-09-07 16:28:37 -07:00
Pokechu22
d98be4bdc9 Use correct CRC16s
Libogc has a bit of a footgun, where __io_gcsda.isInserted() will initialize the card, but not the CRC tables; __io_gcsda.startup() needs to be called first.
2024-09-07 16:28:37 -07:00
Pokechu22
c80c323a26 Implement STOP_TRANSMISSION and APP_CMD SD_SEND_OP_COND
Both of these are used by Pok›émon Channel.  However, Pokémon Channel actually DOES care about CRCs, so... yay.
2024-09-07 16:28:37 -07:00
Pokechu22
251c330c6d Implement last few commands, enough to get it detected by libogc (though not enough to be useful) 2024-09-07 16:28:37 -07:00
Pokechu22
9d145decf8 Hardcode data for CMD9 and CMD10
The CRC part still unnerves me
2024-09-07 16:28:37 -07:00
Pokechu22
b29c8a1c2a CMD9 and CMD10 - early version
(actually like 15 minutes ago)
2024-09-07 16:28:37 -07:00
Pokechu22
9d0007f979 Implement CMD8 2024-09-07 16:28:37 -07:00
Pokechu22
45205c3a56 Reply -- make it to the next part at least 2024-09-07 16:28:37 -07:00
Pokechu22
38e56c1e36 Basic command detection 2024-09-07 16:28:37 -07:00
Pokechu22
fcb86ce1c1 Adjust SD getid thing 2024-09-07 16:28:37 -07:00
Pokechu22
333636d404 HACK to select SD - this will need to be tidied 2024-09-07 16:28:37 -07:00
Pokechu22
91536a09c5 EXI_DeviceDummy: Log ImmReadWrite 2024-09-07 16:28:37 -07:00
Pokechu22
4885706903 Advance reading
This works, for getting it to detect an SD card, though it then needs to init it and that fails.  But it's a start, even if it'll need to be thrown out when things get further along.
2024-09-07 16:28:37 -07:00
Pokechu22
d8bd634729 Add SetCS - amend dummy 2024-09-07 16:28:37 -07:00
Pokechu22
5bdbb85231 HLE kprintf
Not for this PR, but useful for testing
2024-09-07 16:28:37 -07:00
Pokechu22
d49d1197f6 Dummy EXI_DeviceSD 2024-09-07 16:28:37 -07:00
Pokechu22
0f33eda90f Create EXI_DeviceSD 2024-09-07 16:28:36 -07:00
JMC47
2c15d7af7f
Merge pull request #12966 from Dentomologist/cheatsmanager_create_code_widgets_only_once
CheatsManager: Create Action Replay and Gecko code widgets only once
2024-09-07 15:13:18 -04:00
JosJuice
f9f832fa88
Merge pull request #13051 from mitaclaw/dead-config-code-2
SI_Device: Remove Dead Config Code
2024-09-07 13:40:34 +02:00
Tilka
2417545b63
Merge pull request #13052 from Tilka/ax
DSPHLE/AX: fix low-pass/biquad clipping
2024-09-07 11:36:06 +01:00
JMC47
efc395f7f4
Merge pull request #12977 from mitaclaw/branch-watch-tool-fixes-4
Branch Watch Tool: Refactors, Fixes, and Features
2024-09-04 19:36:24 -04:00
Tillmann Karras
eb54721475 DSPHLE/AX: fix low-pass/biquad clipping
The low-pass and biquad filters run in set40 mode where accessing ac#.m
returns the value of ac#.hm clamped to 16 bits.

This fixes the crackling in "Need for Speed: Nitro" (issue 13610).

Also make the lower bound match hardware (-0x8000 instead of -0x7FFF).
2024-09-04 22:33:31 +01:00
OatmealDome
20f2320fcf Merge branch 'release-prep-2409' 2024-09-04 12:26:15 -04:00
mitaclaw
e67e579b38 SI_Device: Remove Dead Config Code 2024-09-04 08:31:00 -07:00
OatmealDome
3c4d4fcd09 ScmRevGen: Bump major version to 2409 2409 2024-09-04 00:43:45 -04:00
Admiral H. Curtiss
95fac2a4e7
Merge pull request #13047 from mitaclaw/cached-interpreter-memcpy-ub
CachedInterpreterEmitter: Fix `std::memcpy` UB
2024-09-02 19:47:11 +02:00
mitaclaw
5a95c5dd14 CachedInterpreterEmitter: Fix std::memcpy UB
I wasn't aware that even with a size of zero, it's still not safe to pass a nullptr to `std::memcpy`. When `CachedInterpreterEmitter::PoisonCallback` is written, UB is happening.
2024-09-01 19:36:21 -07:00