Skip to content

Commit

Permalink
- Add an extra check.
Browse files Browse the repository at this point in the history
- Synchronize FAT cache changes.
  • Loading branch information
Extrems committed Mar 20, 2024
1 parent 34a0ce9 commit 40fa265
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cube/swiss/source/devices/ff_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ bool _FAT_cache_readSectors(CACHE *cache,sec_t sector,sec_t numSectors,void *buf
uint8_t *dest = (uint8_t *)buffer;

while(numSectors>0) {
if(((uintptr_t)dest%32)==0 && (sector%cache->sectorsPerPage)==0) {
if(SYS_IsDMAAddress(dest) && (sector%cache->sectorsPerPage)==0) {
entry = _FAT_cache_findPage(cache,sector,numSectors);
if(entry==NULL) {
secs_to_read = (numSectors/cache->sectorsPerPage)*cache->sectorsPerPage;
Expand Down Expand Up @@ -347,7 +347,7 @@ bool _FAT_cache_writeSectors (CACHE* cache, sec_t sector, sec_t numSectors, cons
const uint8_t *src = (const uint8_t *)buffer;

while(numSectors>0) {
if(((uintptr_t)src%32)==0 && (sector%cache->sectorsPerPage)==0) {
if(SYS_IsDMAAddress(src) && (sector%cache->sectorsPerPage)==0) {
entry = _FAT_cache_findPage(cache,sector,numSectors);
if(entry==NULL) {
secs_to_write = (numSectors/cache->sectorsPerPage)*cache->sectorsPerPage;
Expand Down
5 changes: 3 additions & 2 deletions cube/swiss/source/devices/gcloader/deviceHandler-gcloader.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,9 @@ bool deviceHandler_GCLoader_test() {
__device_gcloader.hwName = "GC Loader compatible";

if (DVD_PrepareStreamAbs(&commandBlock, 32*1024, 0) == DVD_ERROR_OK &&
DVD_GetStreamErrorStatus(&commandBlock) == TRUE &&
DVD_CancelStream(&commandBlock) == DVD_ERROR_OK)
(u8)DVD_GetStreamErrorStatus(&commandBlock) == TRUE &&
DVD_CancelStream(&commandBlock) == DVD_ERROR_OK &&
(u8)DVD_GetStreamErrorStatus(&commandBlock) == FALSE)
__device_gcloader.features |= FEAT_AUDIO_STREAMING;
else
__device_gcloader.features &= ~FEAT_AUDIO_STREAMING;
Expand Down

0 comments on commit 40fa265

Please sign in to comment.