libretro / snes9x

Snes9x - Portable Super Nintendo Entertainment System (TM) emulator
http://www.snes9x.com
Other
47 stars 56 forks source link

Backport features, Add libretro features #158

Closed ghost closed 6 years ago

ghost commented 6 years ago

backport: Super FX overclocking backport: Hires blending libretro: lufia 2 credits - slow interlace libretro: compiler cleanups

ghost commented 6 years ago

Given # new changes, wouldn't hurt to go through a quick q/a cycle and review

Tatsuya79 commented 6 years ago

I get the following warnings:

../libretro/libretro.cpp: In function 'void update_variables()':
../libretro/libretro.cpp:222:40: warning: spurious trailing '%' in format [-Wformat=]
       if(sscanf(var.value,"%d%",&newval))
                                        ^
../libretro/libretro.cpp:222:40: warning: spurious trailing '%' in format [-Wformat=]
../libretro/libretro.cpp:203:9: warning: unused variable 'reset_sfx' [-Wunused-variable]
    bool reset_sfx = false;
         ^~~~~~~~~
../libretro/libretro.cpp: In function 'bool retro_load_game(const retro_game_info*)':
../libretro/libretro.cpp:737:4: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
    if (Memory.match_id("E9ANIE") ||
    ^~
../libretro/libretro.cpp:746:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   struct retro_memory_map map={ memorydesc+MAX_MAPS-memorydesc_c, memorydesc_c };
   ^~~~~~

Please try to use 3 spaces instead of tabulation in libretro.cpp as that's the style used there.

I tried hi-res blending, it works fine and looks great with a crt shader on top.

Super FX worked fine in Star Fox too. It doesn't crash any more when changed at runtime now it seems, even in Doom. That's pretty cool!

The run ahead change just stops the mouse from working at all if run ahead is activated. It's a feature that isn't working with dirty inputs such as analog sticks or mouse so perhaps we don't need to try to address that in a particular core? Also, we can always make a game override with run ahead disabled on the user side for the time being.

ghost commented 6 years ago

Yep. Think it's all cleaned up now. Took out runahead polling since you're right - maybe frontend can solve it there. Or let someone smarter handle it. :)

Tatsuya79 commented 6 years ago

Thanks, libretro.cpp warnings are gone. There's still some other ones but I'm not sure when they appeared.

I just notice a little visual glitch on the left side of the screen when using hi-res blending. A black line get blended like that:

Hoshi_no_Kirby_3_Japan_-180608-191249

In movement that can cause some flickering as between those 2 pictures (the sky on the left side): A B.

ghost commented 6 years ago

I think those warnings have been around for awhile, as I don't remember touching those lines. They look harmless so zapped them hopefully.

The final problem: hires flicker. Need to check upstream also for clues. edit: I think I know. Use temp buffer...?

Tatsuya79 commented 6 years ago

Nice, that looks better. That's less distracting now.

We still have this last series of warnings that still show:

../memmap.cpp: In member function 'void CMemory::map_lorom(uint32, uint32, uint32, uint32, uint32, bool)':
../memmap.cpp:2791:55: warning: missing initializer for member 'retro_memory_descriptor::addrspace' [-Wmissing-field-initializers]
   struct retro_memory_descriptor desc = {0,0,0,0,0,0,0};
                                                       ^
../memmap.cpp: In member function 'void CMemory::map_hirom(uint32, uint32, uint32, uint32, uint32, bool)':
../memmap.cpp:2820:55: warning: missing initializer for member 'retro_memory_descriptor::addrspace' [-Wmissing-field-initializers]
   struct retro_memory_descriptor desc = {0,0,0,0,0,0,0};
                                                       ^
../memmap.cpp: In member function 'void CMemory::map_lorom_offset(uint32, uint32, uint32, uint32, uint32, uint32, bool)':
../memmap.cpp:2849:55: warning: missing initializer for member 'retro_memory_descriptor::addrspace' [-Wmissing-field-initializers]
   struct retro_memory_descriptor desc = {0,0,0,0,0,0,0};
                                                       ^
../memmap.cpp: In member function 'void CMemory::map_hirom_offset(uint32, uint32, uint32, uint32, uint32, uint32, bool)':
../memmap.cpp:2879:55: warning: missing initializer for member 'retro_memory_descriptor::addrspace' [-Wmissing-field-initializers]
   struct retro_memory_descriptor desc = {0,0,0,0,0,0,0};
                                                       ^
../memmap.cpp: In member function 'void CMemory::map_space(uint32, uint32, uint32, uint32, uint8*, bool)':
../memmap.cpp:2906:55: warning: missing initializer for member 'retro_memory_descriptor::addrspace' [-Wmissing-field-initializers]
   struct retro_memory_descriptor desc = {0,0,0,0,0,0,0};
                                                       ^
../memmap.cpp: In member function 'void CMemory::map_index(uint32, uint32, uint32, uint32, int, int, bool)':
../memmap.cpp:2936:55: warning: missing initializer for member 'retro_memory_descriptor::addrspace' [-Wmissing-field-initializers]
   struct retro_memory_descriptor desc = {0,0,0,0,0,0,0};

Is that just struct retro_memory_descriptor desc = {}; ? I'm finding that from a google search (I'm not an experienced coder in c++ at all). At least it removes the warning.

ghost commented 6 years ago

I don't know either but I like it! Thanks! :)