libretro / flycast

Flycast is a multiplatform Sega Dreamcast emulator. NOTE: No longer actively developed, use upstream repo for libretro from now on - https://github.com/flyinghead/flycast
http://reicast.com
GNU General Public License v2.0
155 stars 77 forks source link

Savestates support #204

Closed inactive123 closed 5 years ago

inactive123 commented 6 years ago

Hey @RetroSven, going by the awesome job you have managed to do so far when it comes to serialization support for cores like MAME and rumble support, I'm not sure if this task would be daunting for you but I'd like to propose it anyways -

Reicast completely lacks any kind of serialization support right now, meaning it isn't possible to do savestates at all. It is not even possible on standalone, and the author feels no incentive to add it.

Is this something you would be interested in looking into? You don't have to promise anything of course.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/62027304-savestates-support?utm_campaign=plugin&utm_content=tracker%2F49543223&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F49543223&utm_medium=issues&utm_source=github).
RetroSven commented 6 years ago

Funny you mention that because it's something I want too and I started looking into it a little while ago. After looking at the code I understand why it hasn't been done yet - there's a lot to review and target - especially for someone not intimately familiar with the inner workings of reicast. I suspect threading will be problematic also. So yeah no promises, but it's definitely one of the things on my want-todo list.

Do you know if anyone already started any part of it?

inactive123 commented 6 years ago

Redream has been abandoned though, at least in opensource form. I am sure if we disable DIV32 S matching for record of lodoss war, it could work.

inactive123 commented 6 years ago

Try doing this as a quick test -

https://github.com/libretro/reicast-emulator/blob/master/core/nullDC.cpp#L414

Set this to 1, recompile and see if Record of Lodoss War works without problems then. If it does, then we might have to add it to the rom_luts.c, detect it by serial number, and then apply the DIV match disable bit for it.

RetroSven commented 6 years ago

edited - non-issue

inactive123 commented 6 years ago

Redream went closed source.

I don't really believe Redream is any better (in its current open source state at least), it might get lucky on one or two games but Reicast Libretro is in many ways far ahead, even the closed-source standalone. This single game Record Of Lodoss War might be an exception to the rule, I don't really know.

However, VMU saving is perfectly possible in any other game. What you first need to do is to turn the core option on that lets you boot into the BIOS. Once there, you need to format your VMU cards - they are not formatted straight from the beginning, it's a step you have to do manually. Once you have done that, most games requiring a VMU should just work.

kalawangman commented 6 years ago

Wow, redream has apparently successfully implemented some kind of a tearing-less vsync off display. I read it on the site. Hey aphex, can you convince the guy to implement that on retroarch?

inactive123 commented 6 years ago

@themaister already asked him questions about that and it turned out to be completely pointless (and he said he doesn't want to be really involved in emudev arguments anyway, same as me), it is basically equivalent to retroarchs ‘threaded video’ option (which we already added back in 2013). It doesnt actually solve any audio/video sync issue, since it just skips frames when audio gets close to blocking/underrunning. Would be literally pointless to add since threaded video is already implemented and is quite honestly a lot of ado about nothing. Its just marketing.

Anyway guys, no more talking about Redream, this is getting really annoying. People are already bringing this up now to instigate drama (knowing full well where these things lead) and we dont want any part in that stuff anymore, it has done enough damage already amongst people in our dev team and none of us at this point are in the mood for stupid drama, least of all me. Dont bring it up anymore in places where it doesn't belong, dont bring up its ‘features’, stop shitstirring honestly about it. Its author and me have a very rocky and troubled relationship right now and anything that gets said on either side just exacerbates the issues that already exist, so no more. Stay ontopic and dont bring up irrelevant subject matter like this anymore where it does not belong. This is about savestates in Reicast. If this continues, I will be forced to start removing posts that look like they are made purely to instigate matters. I don't want to have to do that and I hope instead you guys can appreciate that we don't want any more namedroppings whatsoever about this project in places where it does not belong for the sole purpose of avoiding drama.

RetroSven commented 6 years ago

@twinaphex I had no idea about the drama wrt the other - I just googled/read about everything that transpired regarding closing the source, money, etc - that's all very unfortunate. All I knew was that one worked for me whereas the other not so much for my purposes. The VMU formatting steps you provided worked, so Reicast is a perfectly fine alternative now - I'll focus on that codeline instead. I agree that we shouldn't provide any assistance to that other's business model.

RetroSven commented 6 years ago

@twinaphex updated comment history on this issue to stay on-topic

inactive123 commented 6 years ago

Regarding formatting the VMU, did it fix your issue with Record of Lodoss War too?

BTW, I am not against improving the current Redream core when/if there are PRs, which is why I also merged the PR you sent. It is just unlikely much time will be poured into it considering how far along we already are with Reicast here.

RetroSven commented 6 years ago

re: VMU - yes it did, thanks - that's part of the updates I made to the Reicast docs (since the current docs made it seem like it's a known issue without a workaround)

inactive123 commented 6 years ago

Awesome to hear! Guess we need to start adding this game to rom_luts then.

RetroSven commented 6 years ago

https://github.com/libretro/reicast-emulator/pull/206

inactive123 commented 6 years ago

Thanks. We might also want to look for the Japanese version and add that to the list as well.

RetroSven commented 6 years ago

w00t https://media.giphy.com/media/51YbEhiSPXlveycbdN/giphy.gif

inactive123 commented 6 years ago

That's awesome man. This will be such a lifesaver feature.

RetroSven commented 6 years ago

https://github.com/libretro/reicast-emulator/pull/222

blisstik commented 6 years ago

Hey guys, the 32bit arm won't compile on the latest commits


Log started at: Mon Aug 27 01:03:38 UTC 2018

RetroPie-Setup version: 4.4.1 (030ce0f)
System: Linux odroid 3.10.105-141 #1 SMP PREEMPT Thu Jul 27 04:03:10 UTC 2017 armv7l armv7l armv7l GNU/Linux
~/RetroPie-Setup/tmp/build/lr-reicast ~

= = = = = = = = = = = = = = = = = = = = =
Getting sources for 'lr-reicast' : Dreamcast emu - Reicast port for libretro
= = = = = = = = = = = = = = = = = = = = =

git clone --recursive --depth 1 "https://github.com/libretro/reicast-emulator.git" "/home/pigaming/RetroPie-Setup/tmp/build/lr-reicast"
Cloning into '/home/pigaming/RetroPie-Setup/tmp/build/lr-reicast'...
~
~/RetroPie-Setup/tmp/build/lr-reicast ~

= = = = = = = = = = = = = = = = = = = = =
Building 'lr-reicast' : Dreamcast emu - Reicast port for libretro
= = = = = = = = = = = = = = = = = = = = =

rm -f ./core/hw/arm7/arm_mem.o ./core/hw/arm7/arm7.o ./core/hw/arm7/vbaARM.o ./core/hw/arm7/virt_arm.o ./core/hw/aica/dsp.o ./core/hw/aica/dsp_interp.o ./core/hw/aica/aica.o ./core/hw/aica/aica_if.o ./core/hw/aica/aica_mem.o ./core/hw/aica/sgc_if.o ./core/hw/holly/holly_intc.o ./core/hw/holly/sb.o ./core/hw/holly/sb_mem.o ./core/hw/gdrom/gdrom_response.o ./core/hw/gdrom/gdromv3.o ./core/hw/maple/maple_helper.o ./core/hw/maple/maple_devs.o ./core/hw/maple/maple_if.o ./core/hw/maple/maple_cfg.o ./core/hw/mem/_vmem.o ./core/hw/pvr/drkPvr.o ./core/hw/pvr/Renderer_if.o ./core/hw/pvr/pvr_mem.o ./core/hw/pvr/pvr_regs.o ./core/hw/pvr/pvr_sb_regs.o ./core/hw/pvr/spg.o ./core/hw/pvr/ta.o ./core/hw/pvr/ta_ctx.o ./core/hw/pvr/ta_vtx.o ./core/rend/TexCache.o ./core/hw/sh4/sh4_mmr.o ./core/hw/sh4/sh4_mem.o ./core/hw/sh4/sh4_interrupts.o ./core/hw/sh4/sh4_rom.o ./core/hw/sh4/sh4_core_regs.o ./core/hw/sh4/sh4_sched.o ./core/hw/sh4/sh4_opcode_list.o ./core/hw/sh4/interpr/sh4_interpreter.o ./core/hw/sh4/interpr/sh4_fpu.o ./core/hw/sh4/interpr/sh4_opcodes.o ./core/hw/sh4/modules/serial.o ./core/hw/sh4/modules/rtc.o ./core/hw/sh4/modules/bsc.o ./core/hw/sh4/modules/tmu.o ./core/hw/sh4/modules/ccn.o ./core/hw/sh4/modules/intc.o ./core/hw/sh4/modules/ubc.o ./core/hw/sh4/modules/cpg.o ./core/hw/sh4/modules/dmac.o ./core/hw/sh4/modules/mmu.o ./core/imgread/ImgReader.o ./core/imgread/cdi.o ./core/imgread/chd.o ./core/imgread/common.o ./core/imgread/gdi.o ./core/nullDC.o ./core/serialize.o ./core/stdclass.o ./core/deps/coreio/coreio.o ./core/deps/chdr/chdr.o ./core/deps/crypto/sha1.o ./core/deps/crypto/sha256.o ./core/deps/crypto/md5.o ./core/deps/libelf/elf.o ./core/deps/libelf/elf32.o ./core/deps/libelf/elf64.o ./core/deps/chdpsr/cdipsr.o ./core/reios/reios_elf.o ./core/reios/reios.o ./core/reios/gdrom_hle.o ./core/reios/descrambl.o ./core/rend/gles/gles.o ./core/rend/gles/gldraw.o ./core/rend/gles/gltex.o ./core/hw/naomi/naomi.o ./core/hw/naomi/naomi_cart.o ./core/rec-cpp/rec_cpp.o ./core/rec.o ./core/hw/sh4/dyna/decoder.o ./core/hw/sh4/dyna/driver.o ./core/hw/sh4/dyna/blockmanager.o ./core/hw/sh4/dyna/shil.o ./core/libretro/libretro.o ./core/libretro/audiostream.o ./core/libretro/common.o ./core/deps/xbrz/xbrz.o ./core/libretro-common/glsym/rglgen.o ./core/libretro-common/glsm/glsm.o ./core/libretro-common/glsym/glsym_gl.o ./core/libretro-common/memmap/memalign.o ./core/libretro-common/file/retro_stat.o ./core/libretro-common/rthreads/rthreads.o ./core/deps/zlib/deflate.o ./core/deps/zlib/gzlib.o ./core/deps/zlib/uncompr.o ./core/deps/zlib/zutil.o ./core/deps/zlib/inffast.o ./core/deps/zlib/gzread.o ./core/deps/zlib/crc32.o ./core/deps/zlib/gzwrite.o ./core/deps/zlib/inflate.o ./core/deps/zlib/infback.o ./core/deps/zlib/inftrees.o ./core/deps/zlib/trees.o ./core/deps/zlib/gzclose.o ./core/deps/zlib/compress.o ./core/deps/zlib/adler32.o  reicast_libretro.so
g++  -I./core/libretro -I./core/ -I./core/deps -I./core/libretro-common/include   -marm -mfloat-abi=hard -mfpu=neon -mcpu=cortex-a9 -DARM_HARDFP -DHOST_CPU=0x20000002 -fopenmp -D__LIBRETRO__ -DNO_VERIFY -fno-builtin-sqrtf -DNO_MMU -DNDEBUG -flto -DRELEASE -funroll-loops -DHAVE_TEXUPSCALE -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DTARGET_NO_JIT -O3 -c -fno-strict-aliasing -ffast-math -fomit-frame-pointer -fPIC  -mfloat-abi=hard  -DGIT_VERSION=\"" 62b364b"\" -marm -mfloat-abi=hard -mfpu=neon -mcpu=cortex-a9 -DHOST_CPU=0x20000002 -fopenmp -std=c++11 -D__LIBRETRO__ -DNO_VERIFY -fno-builtin-sqrtf -DNO_MMU -DNDEBUG -flto -DRELEASE -funroll-loops -DHAVE_TEXUPSCALE -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DTARGET_NO_JIT -fno-rtti -fpermissive -fno-operator-names -fPIC core/hw/arm7/arm_mem.cpp -o core/hw/arm7/arm_mem.o
g++  -I./core/libretro -I./core/ -I./core/deps -I./core/libretro-common/include   -marm -mfloat-abi=hard -mfpu=neon -mcpu=cortex-a9 -DARM_HARDFP -DHOST_CPU=0x20000002 -fopenmp -D__LIBRETRO__ -DNO_VERIFY -fno-builtin-sqrtf -DNO_MMU -DNDEBUG -flto -DRELEASE -funroll-loops -DHAVE_TEXUPSCALE -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DTARGET_NO_JIT -O3 -c -fno-strict-aliasing -ffast-math -fomit-frame-pointer -fPIC  -mfloat-abi=hard  -DGIT_VERSION=\"" 62b364b"\" -marm -mfloat-abi=hard -mfpu=neon -mcpu=cortex-a9 -DHOST_CPU=0x20000002 -fopenmp -std=c++11 -D__LIBRETRO__ -DNO_VERIFY -fno-builtin-sqrtf -DNO_MMU -DNDEBUG -flto -DRELEASE -funroll-loops -DHAVE_TEXUPSCALE -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DTARGET_NO_JIT -fno-rtti -fpermissive -fno-operator-names -fPIC core/hw/arm7/arm7.cpp -o core/hw/arm7/arm7.o
g++  -I./core/libretro -I./core/ -I./core/deps -I./core/libretro-common/include   -marm -mfloat-abi=hard -mfpu=neon -mcpu=cortex-a9 -DARM_HARDFP -DHOST_CPU=0x20000002 -fopenmp -D__LIBRETRO__ -DNO_VERIFY -fno-builtin-sqrtf -DNO_MMU -DNDEBUG -flto -DRELEASE -funroll-loops -DHAVE_TEXUPSCALE -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DTARGET_NO_JIT -O3 -c -fno-strict-aliasing -ffast-math -fomit-frame-pointer -fPIC  -mfloat-abi=hard  -DGIT_VERSION=\"" 62b364b"\" -marm -mfloat-abi=hard -mfpu=neon -mcpu=cortex-a9 -DHOST_CPU=0x20000002 -fopenmp -std=c++11 -D__LIBRETRO__ -DNO_VERIFY -fno-builtin-sqrtf -DNO_MMU -DNDEBUG -flto -DRELEASE -funroll-loops -DHAVE_TEXUPSCALE -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DTARGET_NO_JIT -fno-rtti -fpermissive -fno-operator-names -fPIC core/hw/arm7/vbaARM.cpp -o core/hw/arm7/vbaARM.o
g++  -I./core/libretro -I./core/ -I./core/deps -I./core/libretro-common/include   -marm -mfloat-abi=hard -mfpu=neon -mcpu=cortex-a9 -DARM_HARDFP -DHOST_CPU=0x20000002 -fopenmp -D__LIBRETRO__ -DNO_VERIFY -fno-builtin-sqrtf -DNO_MMU -DNDEBUG -flto -DRELEASE -funroll-loops -DHAVE_TEXUPSCALE -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DTARGET_NO_JIT -O3 -c -fno-strict-aliasing -ffast-math -fomit-frame-pointer -fPIC  -mfloat-abi=hard  -DGIT_VERSION=\"" 62b364b"\" -marm -mfloat-abi=hard -mfpu=neon -mcpu=cortex-a9 -DHOST_CPU=0x20000002 -fopenmp -std=c++11 -D__LIBRETRO__ -DNO_VERIFY -fno-builtin-sqrtf -DNO_MMU -DNDEBUG -flto -DRELEASE -funroll-loops -DHAVE_TEXUPSCALE -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DTARGET_NO_JIT -fno-rtti -fpermissive -fno-operator-names -fPIC core/hw/arm7/virt_arm.cpp -o core/hw/arm7/virt_arm.o
g++  -I./core/libretro -I./core/ -I./core/deps -I./core/libretro-common/include   -marm -mfloat-abi=hard -mfpu=neon -mcpu=cortex-a9 -DARM_HARDFP -DHOST_CPU=0x20000002 -fopenmp -D__LIBRETRO__ -DNO_VERIFY -fno-builtin-sqrtf -DNO_MMU -DNDEBUG -flto -DRELEASE -funroll-loops -DHAVE_TEXUPSCALE -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DTARGET_NO_JIT -O3 -c -fno-strict-aliasing -ffast-math -fomit-frame-pointer -fPIC  -mfloat-abi=hard  -DGIT_VERSION=\"" 62b364b"\" -marm -mfloat-abi=hard -mfpu=neon -mcpu=cortex-a9 -DHOST_CPU=0x20000002 -fopenmp -std=c++11 -D__LIBRETRO__ -DNO_VERIFY -fno-builtin-sqrtf -DNO_MMU -DNDEBUG -flto -DRELEASE -funroll-loops -DHAVE_TEXUPSCALE -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DTARGET_NO_JIT -fno-rtti -fpermissive -fno-operator-names -fPIC core/hw/aica/dsp.cpp -o core/hw/aica/dsp.o
g++  -I./core/libretro -I./core/ -I./core/deps -I./core/libretro-common/include   -marm -mfloat-abi=hard -mfpu=neon -mcpu=cortex-a9 -DARM_HARDFP -DHOST_CPU=0x20000002 -fopenmp -D__LIBRETRO__ -DNO_VERIFY -fno-builtin-sqrtf -DNO_MMU -DNDEBUG -flto -DRELEASE -funroll-loops -DHAVE_TEXUPSCALE -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DTARGET_NO_JIT -O3 -c -fno-strict-aliasing -ffast-math -fomit-frame-pointer -fPIC  -mfloat-abi=hard  -DGIT_VERSION=\"" 62b364b"\" -marm -mfloat-abi=hard -mfpu=neon -mcpu=cortex-a9 -DHOST_CPU=0x20000002 -fopenmp -std=c++11 -D__LIBRETRO__ -DNO_VERIFY -fno-builtin-sqrtf -DNO_MMU -DNDEBUG -flto -DRELEASE -funroll-loops -DHAVE_TEXUPSCALE -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DTARGET_NO_JIT -fno-rtti -fpermissive -fno-operator-names -fPIC core/hw/aica/dsp_interp.cpp -o core/hw/aica/dsp_interp.o
g++  -I./core/libretro -I./core/ -I./core/deps -I./core/libretro-common/include   -marm -mfloat-abi=hard -mfpu=neon -mcpu=cortex-a9 -DARM_HARDFP -DHOST_CPU=0x20000002 -fopenmp -D__LIBRETRO__ -DNO_VERIFY -fno-builtin-sqrtf -DNO_MMU -DNDEBUG -flto -DRELEASE -funroll-loops -DHAVE_TEXUPSCALE -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DTARGET_NO_JIT -O3 -c -fno-strict-aliasing -ffast-math -fomit-frame-pointer -fPIC  -mfloat-abi=hard  -DGIT_VERSION=\"" 62b364b"\" -marm -mfloat-abi=hard -mfpu=neon -mcpu=cortex-a9 -DHOST_CPU=0x20000002 -fopenmp -std=c++11 -D__LIBRETRO__ -DNO_VERIFY -fno-builtin-sqrtf -DNO_MMU -DNDEBUG -flto -DRELEASE -funroll-loops -DHAVE_TEXUPSCALE -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DTARGET_NO_JIT -fno-rtti -fpermissive -fno-operator-names -fPIC core/hw/aica/aica.cpp -o core/hw/aica/aica.o
g++  -I./core/libretro -I./core/ -I./core/deps -I./core/libretro-common/include   -marm -mfloat-abi=hard -mfpu=neon -mcpu=cortex-a9 -DARM_HARDFP -DHOST_CPU=0x20000002 -fopenmp -D__LIBRETRO__ -DNO_VERIFY -fno-builtin-sqrtf -DNO_MMU -DNDEBUG -flto -DRELEASE -funroll-loops -DHAVE_TEXUPSCALE -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DTARGET_NO_JIT -O3 -c -fno-strict-aliasing -ffast-math -fomit-frame-pointer -fPIC  -mfloat-abi=hard  -DGIT_VERSION=\"" 62b364b"\" -marm -mfloat-abi=hard -mfpu=neon -mcpu=cortex-a9 -DHOST_CPU=0x20000002 -fopenmp -std=c++11 -D__LIBRETRO__ -DNO_VERIFY -fno-builtin-sqrtf -DNO_MMU -DNDEBUG -flto -DRELEASE -funroll-loops -DHAVE_TEXUPSCALE -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DTARGET_NO_JIT -fno-rtti -fpermissive -fno-operator-names -fPIC core/hw/aica/aica_if.cpp -o core/hw/aica/aica_if.o
g++  -I./core/libretro -I./core/ -I./core/deps -I./core/libretro-common/include   -marm -mfloat-abi=hard -mfpu=neon -mcpu=cortex-a9 -DARM_HARDFP -DHOST_CPU=0x20000002 -fopenmp -D__LIBRETRO__ -DNO_VERIFY -fno-builtin-sqrtf -DNO_MMU -DNDEBUG -flto -DRELEASE -funroll-loops -DHAVE_TEXUPSCALE -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DTARGET_NO_JIT -O3 -c -fno-strict-aliasing -ffast-math -fomit-frame-pointer -fPIC  -mfloat-abi=hard  -DGIT_VERSION=\"" 62b364b"\" -marm -mfloat-abi=hard -mfpu=neon -mcpu=cortex-a9 -DHOST_CPU=0x20000002 -fopenmp -std=c++11 -D__LIBRETRO__ -DNO_VERIFY -fno-builtin-sqrtf -DNO_MMU -DNDEBUG -flto -DRELEASE -funroll-loops -DHAVE_TEXUPSCALE -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DTARGET_NO_JIT -fno-rtti -fpermissive -fno-operator-names -fPIC core/hw/aica/aica_mem.cpp -o core/hw/aica/aica_mem.o
g++  -I./core/libretro -I./core/ -I./core/deps -I./core/libretro-common/include   -marm -mfloat-abi=hard -mfpu=neon -mcpu=cortex-a9 -DARM_HARDFP -DHOST_CPU=0x20000002 -fopenmp -D__LIBRETRO__ -DNO_VERIFY -fno-builtin-sqrtf -DNO_MMU -DNDEBUG -flto -DRELEASE -funroll-loops -DHAVE_TEXUPSCALE -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DTARGET_NO_JIT -O3 -c -fno-strict-aliasing -ffast-math -fomit-frame-pointer -fPIC  -mfloat-abi=hard  -DGIT_VERSION=\"" 62b364b"\" -marm -mfloat-abi=hard -mfpu=neon -mcpu=cortex-a9 -DHOST_CPU=0x20000002 -fopenmp -std=c++11 -D__LIBRETRO__ -DNO_VERIFY -fno-builtin-sqrtf -DNO_MMU -DNDEBUG -flto -DRELEASE -funroll-loops -DHAVE_TEXUPSCALE -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DTARGET_NO_JIT -fno-rtti -fpermissive -fno-operator-names -fPIC core/hw/aica/sgc_if.cpp -o core/hw/aica/sgc_if.o
In file included from core/hw/aica/aica.h:2:0,
                 from core/hw/aica/sgc_if.h:2,
                 from core/hw/aica/sgc_if.cpp:1:
./core/types.h:779:24: error: expected identifier before ‘&’ token
 #define s(v) serialize(&(v), sizeof(v), data, total_size)
                        ^
./core/types.h:779:30: error: expected identifier before ‘sizeof’
 #define s(v) serialize(&(v), sizeof(v), data, total_size)
                              ^
./core/types.h:779:30: error: expected ‘,’ or ‘...’ before ‘sizeof’
./core/types.h:779:24: error: expected identifier before ‘&’ token
 #define s(v) serialize(&(v), sizeof(v), data, total_size)
                        ^
./core/types.h:779:30: error: expected identifier before ‘sizeof’
 #define s(v) serialize(&(v), sizeof(v), data, total_size)
                              ^
./core/types.h:779:30: error: expected ‘,’ or ‘...’ before ‘sizeof’
/usr/include/c++/5/bits/random.h: In member function ‘_RealType std::lognormal_distribution<_RealType>::serialize(int& (*)(), int) const’:
./core/types.h:779:27: error: expected primary-expression before ‘)’ token
 #define s(v) serialize(&(v), sizeof(v), data, total_size)
                           ^
./core/types.h:779:38: error: expected primary-expression before ‘)’ token
 #define s(v) serialize(&(v), sizeof(v), data, total_size)
                                      ^
./core/types.h:779:41: error: ‘data’ was not declared in this scope
 #define s(v) serialize(&(v), sizeof(v), data, total_size)
                                         ^
./core/types.h:779:47: error: ‘total_size’ was not declared in this scope
 #define s(v) serialize(&(v), sizeof(v), data, total_size)
                                               ^
/usr/include/c++/5/bits/random.h: In member function ‘std::lognormal_distribution<_RealType>::result_type std::lognormal_distribution<_RealType>::operator()(_UniformRandomNumberGenerator&, const std::lognormal_distribution<_RealType>::param_type&)’:
./core/types.h:779:27: error: expected primary-expression before ‘)’ token
 #define s(v) serialize(&(v), sizeof(v), data, total_size)
                           ^
./core/types.h:779:38: error: expected primary-expression before ‘)’ token
 #define s(v) serialize(&(v), sizeof(v), data, total_size)
                                      ^
./core/types.h:779:41: error: ‘data’ was not declared in this scope
 #define s(v) serialize(&(v), sizeof(v), data, total_size)
                                         ^
./core/types.h:779:47: error: ‘total_size’ was not declared in this scope
 #define s(v) serialize(&(v), sizeof(v), data, total_size)
                                               ^
/usr/include/c++/5/bits/random.tcc: In member function ‘void std::lognormal_distribution<_RealType>::__generate_impl(_ForwardIterator, _ForwardIterator, _UniformRandomNumberGenerator&, const std::lognormal_distribution<_RealType>::param_type&)’:
./core/types.h:779:27: error: expected primary-expression before ‘)’ token
 #define s(v) serialize(&(v), sizeof(v), data, total_size)
                           ^
./core/types.h:779:38: error: expected primary-expression before ‘)’ token
 #define s(v) serialize(&(v), sizeof(v), data, total_size)
                                      ^
./core/types.h:779:41: error: ‘data’ was not declared in this scope
 #define s(v) serialize(&(v), sizeof(v), data, total_size)
                                         ^
./core/types.h:779:47: error: ‘total_size’ was not declared in this scope
 #define s(v) serialize(&(v), sizeof(v), data, total_size)
                                               ^
/usr/include/c++/5/bits/random.tcc: In function ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::lognormal_distribution<_RealType>&)’:
./core/types.h:779:27: error: expected primary-expression before ‘)’ token
 #define s(v) serialize(&(v), sizeof(v), data, total_size)
                           ^
./core/types.h:779:38: error: expected primary-expression before ‘)’ token
 #define s(v) serialize(&(v), sizeof(v), data, total_size)
                                      ^
./core/types.h:779:41: error: ‘data’ was not declared in this scope
 #define s(v) serialize(&(v), sizeof(v), data, total_size)
                                         ^
./core/types.h:779:47: error: ‘total_size’ was not declared in this scope
 #define s(v) serialize(&(v), sizeof(v), data, total_size)
                                               ^
core/hw/aica/sgc_if.cpp: At global scope:
core/hw/aica/sgc_if.cpp:329:19: warning: invalid conversion from ‘int’ to ‘_EG_state’ [-fpermissive]
   _EG_state state=0;
                   ^
core/hw/aica/sgc_if.cpp:341:19: warning: invalid conversion from ‘int’ to ‘_EG_state’ [-fpermissive]
   _EG_state state=0;
                   ^
Makefile:650: recipe for target 'core/hw/aica/sgc_if.o' failed
make: *** [core/hw/aica/sgc_if.o] Error 1
make: *** Waiting for unfinished jobs....
~
Could not successfully build lr-reicast - Dreamcast emu - Reicast port for libretro (/home/pigaming/RetroPie-Setup/tmp/build/lr-reicast/reicast_libretro.so not found).

Log ended at: Mon Aug 27 01:03:49 UTC 2018
Total running time: 0 hours, 0 mins, 11 secs
inactive123 commented 6 years ago

Yeah @RetroSven, it fails compiling now on our Linux buildbot as well -

http://p.0bl.net/34996

the weird thing is when I try to compile it manually on my Manjaro Linux setup, it compiles fine. I tried including stddef.h in core/types.h but that didn't work. Maybe cstddef ?

RetroSven commented 6 years ago

@6alileo please attach your /usr/include/c++/5/bits/random.h file

RetroSven commented 6 years ago

pretty sure I just need to rename serialize/unserialize to ra_serialize/ra_unserialize, but need to make sure @twinaphex can you grab that random.h file from the buildbot?

inactive123 commented 6 years ago

@RetroSven - s() is an inline function already in random.h.

Please use a macro name that is less likely to conflict - put it in all-caps too to indicate it is a macro and not a function.

inactive123 commented 6 years ago

OK, so I compiled it with mingw w64 now for x86 x64 - I press F2 to save state, it doesn't show me any kind of progress or message saying ' save state saving' or whatever is supposed to show. It doesn't crash either

Then I try pressing F4 in order to load the state. It says that it has loaded the state but it just doesn't load the state at all, it does nothing.

Tried using the Quick Menu save state/load state actions too and same thing.

Maybe after the macro name change has been done it would magically work then? No idea why it doesn't do anything here.

RetroSven commented 6 years ago

macros updated - should not conflict with anything anymore - that's really weird that it's not working for you (and seemingly doing nothing) - are you using the non-OIT version?

RetroSven commented 6 years ago

also, have you tried the dll or so from the buildbot?

inactive123 commented 6 years ago

Hmm, we might want to change the name to something that has nothing to do with RETROARCH. Libretro technically has nothing to do with retroarch. Don't call it LIBRETRO either, decide on some different name prefix.

inactive123 commented 6 years ago

Unfortunately the same thing. Hitting F2 to savestate does nothing, I try selecting 'Save state' manually from Quick Menu too - it doesn't show any OSD text that it normally should.

inactive123 commented 6 years ago

@RetroSven I see this when attempting to save -

[INFO] Saving state: "c:\games\retroarch\states\Dead or Alive 2 (USA).state1". [INFO] State size: 48324799 bytes. [ERROR] Failed to save state to "c:\games\retroarch\states\Dead or Alive 2 (USA).state1".

RetroSven commented 6 years ago

try https://github.com/libretro/reicast-emulator/pull/226

inactive123 commented 6 years ago

It works fine now. Awesome!

inactive123 commented 6 years ago

There might still be some state that has to become part of the savestate. For instance, try making a savestate on this screen in power Stone 1 -

image

If you try to load this savestate now straight from the Dreamcast swirl point in time, the background will appear black. However, if you load it after the Capcom logo has already appeared, it will show as normal.

RetroSven commented 6 years ago

must be something more going on - I tried that a few times in both threaded and non-threaded and the background always appears fine for me

blisstik commented 6 years ago

On 32bit ARM - I was able to compile on #225 and #226 - but have not had a chance to test save states for any game. Will report back. Sounds promising. Thank you guys!

blisstik commented 6 years ago

On 32bit ARM - I tested a couple fight games - Capcom vs SNK 2, save states worked. MvC2 just freezes.

blackman91 commented 6 years ago

Tested save states on Windows 7 playing Cannon Spike, loading a state sometimes freezes RetroArch and you have to force close it, also it seems loading and saving states don't work with the widescreen hack enabled.

blackman91 commented 6 years ago

Testes save states on Android 7, downloaded core from online updater, they seem to be working fine with default settings but if you try to save or load a state with the option threaded rendering enabled RetroArch freezes then crashes: screenshot_20180827-210848

RetroSven commented 6 years ago

@6alileo I tested MVC2 USA CDI and it saved/loaded fine. Can you please provide some more details on how to reproduce the issue you're seeing? What region/format? (I'm using USA/CDI). Where did you save state? Did you change any options in between your testing of MVC2 and Capcom vs SNK2? Are you using keyboard save/load (F2/F4) or loading/saving via GUI menu?

@blackman91 I also tried widescreen hack (on MVC2) and that seemed to work fine as well. Please provide some more details on your testing steps for the widescreen issue. Have you tried saving/loading via keyboard shortcuts while in-game vs in-menu (F2/F4)

blisstik commented 6 years ago

@RetroSven - I have MVC2 USA CDI on an XU4 (32bit ARM running RetroPie). I always try to save at the character selection screen and I did not change any options. Threaded rendering is enabled. I have tried several times.

RetroSven commented 6 years ago

@6alileo retried with those details and still no problems on this end. Please upload your retroarch-core-options.cfg to somewhere like pastepin and post the url. Does it fail to save or load?

blisstik commented 6 years ago

@RetroSven - It fails on save. Capcom vs SNK 2 works perfectly. I'll get you the cfg later in the day.

I just remembered, I use the US BIOS for MvC2 but also use it for CvS2 so maybe that's not it.

Deivmsr commented 6 years ago

@RetroSven I'm also having the same problems with save states with thread enable on Reicast core on Retroarch on Galaxy Note 8, Exynos version. If my .cfg help solve this problem. Because really save states in the Reicast core would be a hand in the wheel.

Here: https://gist.github.com/Deivmsr/5e0622e310024d712bd282e73a8df40a

blisstik commented 6 years ago

@RetroSven OK it's not related to a game at all. It freezes when threaded rendering is enabled. When disabled, I can save states on both MvC2 and CvS2. Both will freeze when threaded rendering is enabled. Only two games I tested.

RetroSven commented 6 years ago

@6alileo are you sure you're using the most recent code? There were several updates that happened close together.

blisstik commented 6 years ago

@RetroSven - yes - I've compiled to the latest. Remember I'm on 32bit ARM on an Odroid XU4

I just checked RA, I am on #226

blackman91 commented 6 years ago

@RetroSven I tested the games Cannon Spike and Jedi Power Battles on latest Retroarch nightly on reicast core with threaded rendering enabled on windows 7, saving a state works most of the time no problem but loading sometimes freezes RetroArch completely, usually force closing RetroArch, loading the game again and loading the state works now, with widescreen hack and threaded rendering enabled I can't save or load a state without freezing, to save or load a state I just open the Retroarch quickmenu pressing the two sticks shortcut then select save state or load state, I'll test to see if it happens with states shortcuts.

On Android phones enabling threaded rendering makes the states unusable RetroArch freezes then crashes when trying to use them. Maybe threaded rendering has something to do with the freezing. Will try to take a log when that happens.

RetroSven commented 6 years ago

I think once https://github.com/libretro/reicast-emulator/pull/231 is merged these issues you're reporting should all go away.

blisstik commented 6 years ago

@flyinghead @RetroSven #231 on 32bit ARM Linux - I was able to save state ONCE on MvC2 during characeter selection. I noticed the emulator ran slower before and after saving (I think due to threaded rendering being disabled temporarily). I tried loading it and it froze. Ever since, I'm not able to save state on any game. So #231 is still a bit buggy in that regard.

Deivmsr commented 6 years ago

@RetroSven @flyinghead I tested the c0a06a9 version in the Reicast core on Android and with thread turned on the emulator continued to freeze when I went save state. The games I tested were: Cannon Spike, Sonic Adventure 2 and Daytona USA and all presented the same problem while attempting to save threaded state.

RetroSven commented 6 years ago

I can't reproduce your environment locally, so let's try some rudimentary printfs to try and localize the issue:

replace your libretro.cpp with this:

https://pastebin.com/XvgTJ4Nb

recompile, retry, and then upload your retroarch output to pastebin so I can look at it

blisstik commented 6 years ago

@RetroSven where would I get the RA output? It's a logfile right?