libretro / snes9x

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

backport bsx, multicart, cleanup sync #160

Closed ghost closed 6 years ago

ghost commented 6 years ago

Last big backport commit. Needs good checking.

Step 0: Place BS-X.bin and STBIOS.bin in rom directory or system folder. Step 1: To load BS-X or Sufami Turbo game: just load rom and play.

Step 2: To load multi-cart:

  1. load base game first
  2. load multi-cart link 2a. select base game (g-next, bsx bios, st game1, itoi fishing, ..) 2b. select add-on game (g-next data pack, bs game, st game2, data pack, ..)
  3. run multi-cart link

note: To do multi-cart Sufami Turbo, you must run each one individually to create sram first. Then multi-link will function correctly.

Tatsuya79 commented 6 years ago

I got some warnings (MSYS2, gcc7.3):

../snes9x.cpp:217:14: warning: 'rom_filename' defined but not used [-Wunused-variable]
 static char *rom_filename = NULL;
              ^~~~~~~~~~~~
../libretro/libretro.cpp: In function 'bool8 LoadBIOS(uint8*, char*, int)':
../libretro/libretro.cpp:767:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       if (size == biossize)
           ~~~~~^~~~~~~~~~~
../libretro/libretro.cpp: In function 'bool retro_load_game(const retro_game_info*)':
../libretro/libretro.cpp:803:64: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
          if (rom_loaded = LoadBIOS(biosrom,"STBIOS.bin",0x40000))
                                                                ^
../libretro/libretro.cpp:803:25: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
          if (rom_loaded = LoadBIOS(biosrom,"STBIOS.bin",0x40000))
              ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../libretro/libretro.cpp:809:63: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
          if (rom_loaded = LoadBIOS(biosrom,"BS-X.bin",0x100000))
                                                               ^
../libretro/libretro.cpp:809:25: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
          if (rom_loaded = LoadBIOS(biosrom,"BS-X.bin",0x100000))
              ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../libretro/libretro.cpp: In function 'bool retro_load_game_special(unsigned int, const retro_game_info*, size_t)':
../libretro/libretro.cpp:899:69: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
               if (rom_loaded = LoadBIOS(biosrom,"STBIOS.bin",0x40000))
                                                                     ^
../libretro/libretro.cpp:899:30: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
               if (rom_loaded = LoadBIOS(biosrom,"STBIOS.bin",0x40000))
                   ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../libretro/libretro.cpp:922:67: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
             if (rom_loaded = LoadBIOS(biosrom,"STBIOS.bin",0x40000))
                                                                   ^
../libretro/libretro.cpp:922:28: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
             if (rom_loaded = LoadBIOS(biosrom,"STBIOS.bin",0x40000))
                 ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Then... I'm really confused lol.

I took "BS-X - Sore wa Namae o Nusumareta Machi no Monogatari (Japan) (Rev 1)" from no-intro and renamed it BS-X.bin, "[BIOS] ST018 (Japan)" for STBIOS.bin. With that, launching a satellaview game such as "BS F-Zero Grand Prix 2 - Practice (Japan) (BS)" just brings me the BS-X town where I can't find a way to play the game.

Sufami Turbo games still work if they're .smc but if that's about no-intro .sfc I can't get them to work directly or using multicarts loading.

ghost commented 6 years ago

Thanks! I'll jump on the warnings later.

Sufami Turbo (Japan).sfc ==> STBIOS.bin

For BS-X games, when you enter the town. Go inside that house you're standing in front of. Load stored data (option 1). Select game and start.

Tatsuya79 commented 6 years ago

Thanks! That works better with the right bios! I could run every systems and different rom sets. Haven't tried multicarts.

Tatsuya79 commented 6 years ago

That's the way to clean the compiler warning for lines 803, 809, 899 and 922 in libretro.cpp:

if ((rom_loaded = LoadBIOS(biosrom,"STBIOS.bin",0x40000)))
Tatsuya79 commented 6 years ago

I notice when it's a sufami game and run ahead 2nd instance is activated, the screen is black after load/transition to a different screen until you push a gamepad direction/button (tested in Sailor Moon and Gundam axis).

ghost commented 6 years ago

Thanks for that fix. Would not have figured it out myself.

Noticed runahead secondary glitch also happens during oggom's commit way back. Maybe problem is in frontend?

Easiest way to test multi-carts: 1] Run SD Ultra Battle - Ultraman Densetsu (Japan) (ST).sfc. Wait until main menu. Now use multi-cart loader. Select SD Ultra Battle - Ultraman Densetsu (Japan) (ST).sfc both times and run. When you get to main menu again, you should now see Ultraman fighting Ultraman.

2] Run SD Gundam G-Next. Use multi-cart loader. Game A = G-Next again. Add-On B = SD Gundam G-Next - Map Data (Japan) (3-25) (Data Pack).bs. Run multi-cart. Go to in-game config map menu. If you see Australia + New York City maps, done right.

3] Connect SD Ultra Battle - Ultraman Densetsu (Japan) (ST).sfc with SD Ultra Battle - Seven Densetsu (Japan) (ST).sfc to get 'full' game experience.

Tatsuya79 commented 6 years ago

You made a 2nd libretro.cpp in the main folder instead of the libretro folder.

Tatsuya79 commented 6 years ago

Ok I got multicarts working. Just had to make sure I'm using sfc files and that they're not zipped. That's really specific atm!

ghost commented 6 years ago

For Sufami Turbo multi-cart link, they must be no-intro type roms (512KB - 1MB). Those 1.5MB - 2MB+ smc ones will not work as they are hacked roms. If you rename sfc to smc, it'll still work (correct no-intro ones).

For 512-byte headers, idk. Never tried that. Or zipped roms. Not sure if upstream supports either when multi-carting. :o

edit: Maybe in a future PR we could auto-detect hacked ST games and trim out the bios if we're doing multi-cart loading. Or add the other useful features like zip and headers.

ghost commented 6 years ago

@backport: as for newest "Divert IRQTransition for the moment" fix, because bearoso says it's an experimental workaround / hack, not backporting it yet until confirmed okay.

edit: Tried sameboy multi-cart linking with zipped Dr. Mario roms. Doesn't work there. Might be frontend issue then.

Tatsuya79 commented 6 years ago

I think that's the same, they need to be unzipped.

ghost commented 6 years ago

Yeah, so frontend has to create some extension zip fix for those multi-load ones. Going to hold off on removing headers until next PR. Don't want to bork something again until it's safe to do so. :o

Okay. 1 slash fix coming up. lol - I hate programming. Oh wait. Don't need that line anymore. Removing it.

Agh. S o many mistakes lately. xx(