libretro / fuse-libretro

A port of the Fuse Unix Spectrum Emulator to libretro
GNU General Public License v3.0
36 stars 47 forks source link

add memory hooks for cheat/rumble #55

Closed RetroSven closed 6 years ago

leiradel commented 6 years ago

@RetroSven This patch doesn't correctly return the amount of memory for each supported system. This core emulates a number of different ZX Spectrum models, each with it's own RAM capacity. The correct amount must be returned in each case.

RetroSven commented 6 years ago

same story as 81 - everything appears to tie back to RAM defined here:

fuse/spectrum.c:libspectrum_byte RAM[ SPECTRUM_RAM_PAGES ][0x4000];

So the size appears fine.

leiradel commented 6 years ago

The same comment I did in the 81-libretro core applies here. Cores must only report the actual emulated memory size, we should never take the shortcut of assuming that just because, say, there's a 1 Mb buffer in the core for the system RAM, that this is the actual system RAM size. Imagine if there's a maintenance and the buffer is dynamically allocated to the exact size needed. With your change, nothing would prevent the frontend from accessing memory past the end of the buffer.

You're also reporting 16 Kb of ROM as system RAM in this core, I believe.

RetroSven commented 6 years ago

Same comments as 81. The way it's currently coded will not result in any buffer errors. This is another project that has not had any emu-related code changes in over a year. I think it's extremely unlikely that the underlying memory system is going to get touched and if it does, then any code that we put in place now (regardless of what it is) will need to be updated anyway. In the meantime, let's allow for people to use this functionality.

leiradel commented 6 years ago

I've commented there.