krs013
krs013
PPyBoy
Created by snakelimb on 12/19/2024 in #support
Issue asserting Cartridge title SML
(pro tip: put ```py before your code for syntax highlighting)
25 replies
PPyBoy
Created by snakelimb on 12/19/2024 in #support
Issue asserting Cartridge title SML
curious. any chance it's loading from a save state?
25 replies
PPyBoy
Created by snakelimb on 12/19/2024 in #support
Issue asserting Cartridge title SML
Yep. I forgot about this, but the correct sha256 sum can be found in the test code:
470d6c45c9bcf7f0397d00c1ae6de727c63dd471049c8eedbefdc540ceea80b4
470d6c45c9bcf7f0397d00c1ae6de727c63dd471049c8eedbefdc540ceea80b4
25 replies
PPyBoy
Created by snakelimb on 12/19/2024 in #support
Issue asserting Cartridge title SML
There were multiple Super Mario Land games for the gameboy, maybe it's a different one?
25 replies
PPyBoy
Created by snakelimb on 12/19/2024 in #support
Issue asserting Cartridge title SML
Modifying the code won't be an effective way to debug unless you recompile PyBoy from source after doing so, just FYI. I can't help more right now but maybe someone around here has a checksum of the rom--my first guess is that you have a different or modified rom file of some kind.
25 replies
PPyBoy
Created by Sas2k on 12/18/2024 in #support
Save states not functioning properly when sound flag is used
Shoot, guess I don't have anything to offer here then
30 replies
PPyBoy
Created by Sas2k on 12/18/2024 in #support
Save states not functioning properly when sound flag is used
Been a long week
30 replies
PPyBoy
Created by Sas2k on 12/18/2024 in #support
Save states not functioning properly when sound flag is used
Oh right, right. I think I messed it up the first time too haha
30 replies
PPyBoy
Created by Sas2k on 12/18/2024 in #support
Save states not functioning properly when sound flag is used
I don't know when I'll have time to revisit --sound 🥲 but for now it should be sufficient to change that min to max on line 171, and test to make sure that doesn't break anything.
30 replies
PPyBoy
Created by Sas2k on 12/18/2024 in #support
Save states not functioning properly when sound flag is used
Then the access violation is caused in Sound.enqueue_sound(self):
sdl2.SDL_QueueAudio(self.device, self.audiobuffer_p, 2 * nsamples)
sdl2.SDL_QueueAudio(self.device, self.audiobuffer_p, 2 * nsamples)
when SDL_QueueAudio(...) tries to access a values indexed off of self.audiobuffer_p that is outside of the buffer and possibly allocated memory.
30 replies
PPyBoy
Created by Sas2k on 12/18/2024 in #support
Save states not functioning properly when sound flag is used
to make matters worse, there's this:
nsamples = self.clock // self.sampleclocks

for i in range(min(2048, nsamples)):
...
nsamples = self.clock // self.sampleclocks

for i in range(min(2048, nsamples)):
...
I'm not sure why that's min instead of max for the number of samples to generate--I think we've gone back and forth on it before, but whatever the reason is, if nsamples is greater than 2048, it will overrun the sample buffer.
30 replies
PPyBoy
Created by Sas2k on 12/18/2024 in #support
Save states not functioning properly when sound flag is used
def tick(self, _cycles, double_speed):
cycles = _cycles - self.last_cycles
self.last_cycles = _cycles

if double_speed:
self.clock += cycles // 2
else:
self.clock += cycles
def tick(self, _cycles, double_speed):
cycles = _cycles - self.last_cycles
self.last_cycles = _cycles

if double_speed:
self.clock += cycles // 2
else:
self.clock += cycles
self.last_cycles is initialized to 0 instead of the value of pyboy.mb.cpu.cycles (which probably isn't loaded when the Sound object is made anyway)
30 replies
PPyBoy
Created by Sas2k on 12/18/2024 in #support
Save states not functioning properly when sound flag is used
On load state, the cpu restores its cycle counter to what it was before, causing the sound device to try to process more samples than it's supposed to.
30 replies
PPyBoy
Created by Sas2k on 12/18/2024 in #support
Save states not functioning properly when sound flag is used
I might have an idea what's happening here
30 replies