diff --git a/psx/octoshock/docs/upstreaminfo.txt b/psx/octoshock/docs/upstreaminfo.txt index e1fd5ea18a..5a7a2af8a8 100644 --- a/psx/octoshock/docs/upstreaminfo.txt +++ b/psx/octoshock/docs/upstreaminfo.txt @@ -110,4 +110,9 @@ [OK] psx/timer : (c), comments 0.9.39-unstable -> 0.9.39-1 [NO] mednafen : just org stuff -[??] cdrom/ccd : something about track AA \ No newline at end of file +[??] cdrom/ccd : something about track AA +0.9.39-1 -> 0.9.39-2 +[NO] drivers/main : nothing useful +[NO] mednafen : nothing useful +[OK] psx/cdc : loadstate, type change +[OK] psx/cpu : type change, loadstate tweak. ATTN: note about GTE_StateAction \ No newline at end of file diff --git a/psx/octoshock/psx/cdc.cpp b/psx/octoshock/psx/cdc.cpp index 5682444769..67b4158b79 100644 --- a/psx/octoshock/psx/cdc.cpp +++ b/psx/octoshock/psx/cdc.cpp @@ -368,6 +368,22 @@ SYNCFUNC(PS_CDC) NSS(ReportLastF); //(%= crap about file format recovery in case SectorPipe_Pos changes) + + if(isReader) + { + if(AudioBuffer.Size > sizeof(AudioBuffer.Samples[0]) / sizeof(AudioBuffer.Samples[0][0])) + AudioBuffer.Size = sizeof(AudioBuffer.Samples[0]) / sizeof(AudioBuffer.Samples[0][0]); + + if(AudioBuffer.ReadPos > AudioBuffer.Size) + AudioBuffer.ReadPos = AudioBuffer.Size; + + ResultsRP &= 0xF; + ResultsWP &= 0xF; + ResultsIn &= 0x1F; + + ADPCM_ResampCurPos &= 0x1F; + ADPCM_ResampCurPhase %= 7; + } } void PS_CDC::ResetTS(void) diff --git a/psx/octoshock/psx/cdc.h b/psx/octoshock/psx/cdc.h index 9aab9816ef..b4a4ec8204 100644 --- a/psx/octoshock/psx/cdc.h +++ b/psx/octoshock/psx/cdc.h @@ -13,9 +13,9 @@ namespace MDFN_IEN_PSX struct CD_Audio_Buffer { int16 Samples[2][0x1000]; // [0][...] = l, [1][...] = r - int32 Size; + uint32 Size; uint32 Freq; - int32 ReadPos; + uint32 ReadPos; }; class PS_CDC diff --git a/psx/octoshock/psx/cpu.cpp b/psx/octoshock/psx/cpu.cpp index 65f40f3251..7957e21e3f 100644 --- a/psx/octoshock/psx/cpu.cpp +++ b/psx/octoshock/psx/cpu.cpp @@ -102,7 +102,7 @@ void PS_CPU::SetFastMap(void *region_mem, uint32 region_address, uint32 region_s for(uint64 A = region_address; A < (uint64)region_address + region_size; A += FAST_MAP_PSIZE) { - FastMap[A >> FAST_MAP_SHIFT] = ((uint8 *)region_mem - region_address); + FastMap[A >> FAST_MAP_SHIFT] = ((uintptr_t)region_mem - region_address); } } @@ -433,13 +433,13 @@ INLINE uint32 PS_CPU::ReadInstruction(pscpu_timestamp_t ×tamp, uint32 addre if(address >= 0xA0000000 || !(BIU & 0x800)) { - instr = MDFN_de32lsb(&FastMap[address >> FAST_MAP_SHIFT][address]); + instr = MDFN_de32lsb((uint8*)(FastMap[address >> FAST_MAP_SHIFT] + address)); timestamp += 4; // Approximate best-case cache-disabled time, per PS1 tests(executing out of 0xA0000000+); it can be 5 in *some* sequences of code(like a lot of sequential "nop"s, probably other simple instructions too). } else { __ICache *ICI = &ICache[((address & 0xFF0) >> 2)]; - const uint8 *FMP = &FastMap[(address & 0xFFFFFFF0) >> FAST_MAP_SHIFT][address & 0xFFFFFFF0]; + const uint8 *FMP = (uint8*)(FastMap[(address & 0xFFFFFFF0) >> FAST_MAP_SHIFT] + (address & 0xFFFFFFF0)); // | 0x2 to simulate (in)validity bits. ICI[0x00].TV = (address & 0xFFFFFFF0) | 0x0 | 0x2; @@ -669,7 +669,7 @@ pscpu_timestamp_t PS_CPU::RunReal(pscpu_timestamp_t timestamp_in) { \ if(old_PC == (((new_PC - 4) & mask) + offset)) \ { \ - if(MDFN_densb(&FastMap[PC >> FAST_MAP_SHIFT][PC]) == 0) \ + if(MDFN_densb((uint8*)(FastMap[PC >> FAST_MAP_SHIFT] + PC)) == 0) \ { \ if(next_event_ts > timestamp) /* Necessary since next_event_ts might be set to something like "0" to force a call to the event handler. */ \ { \ @@ -2806,6 +2806,14 @@ SYNCFUNC(PS_CPU) NSS(ScratchRAM.data8); + //ZERO - REMINDER - GTE_StateAction was here. is it important? + + if(isReader) + { + ReadAbsorbWhich &= 0x1F; + BACKED_LDWhich %= 0x21; + } + } //SYNCFUNC(CPU) } //namespace MDFN_IEN_PSX diff --git a/psx/octoshock/psx/cpu.h b/psx/octoshock/psx/cpu.h index b2603cef83..8bc96f1db7 100644 --- a/psx/octoshock/psx/cpu.h +++ b/psx/octoshock/psx/cpu.h @@ -201,7 +201,7 @@ class PS_CPU //PS_GTE GTE; - uint8 *FastMap[1 << (32 - FAST_MAP_SHIFT)]; + uintptr_t FastMap[1 << (32 - FAST_MAP_SHIFT)]; uint8 DummyPage[FAST_MAP_PSIZE]; enum