nbarkhina / numero

TI-83 Emulator for Libretro
Other
8 stars 5 forks source link

[WiiU] Core boots fine but no game/app starts. #5

Open Ploggy opened 1 year ago

Ploggy commented 1 year ago

I've got the Core loading but whenever I load a game file it will boot to the calc but nothing shows on the top left screen. I can still move the mouse cursor and make the screen bigger (L2) I have the correct bios files in the system folder and the hashes match.

Also the FPS is hovering around 24fps, I don't know if its a Core issue or more likely just the WiiU being WiiU :P

nbarkhina commented 1 year ago

Interesting I'll have to test it on my WiiU. How do you build it? I loaded the docker image and ran through the compile phase but then how do you run this?

make -f Makefile.wiiu

I don't have a "Makefile.wiiu" file

Ploggy commented 1 year ago

Oh you have a WiiU? that will make things easier :) I follow this tut, I guess you can ignore the docker part..

-: Docker WiiU Tutorial :-

(Assumes your using Windows)

  1. First of all Download and install Docker Desktop: https://www.docker.com/products/docker-desktop/

  2. Download the Dockerfile from (see attachment below) to a Directory.

  3. Open command prompt,

  4. Change to the directory where you placed the Dockerfile.

  5. Run: docker build . -t wiiu-build

  6. While in Command Prompt.

  7. Download/Git Clone Retroarch. "git clone https://github.com/libretro/RetroArch.git"

  8. Download/Git Clone any Core your looking to Build. eg. for Snes9x it would be: "git clone https://github.com/libretro/snes9x.git"

  9. CD into your chosen Core Directory.

then do the following:

  1. Run docker run -it -v %CD%:/developer wiiu-build - which will get you a linux command prompt.
  2. Run cd /developer
  3. Run make -f Makefile.libretro platform=wiiu and it will run the build. shouldn't take too long.
  4. Run exit to exit the container.

Goto you Core folder location. The Core folder should now have a (Corename)_libretro_wiiu.a file, Rename file to libretro_wiiu.a and place in your Retroarch Folder. (overwrite if needed)

  1. Now in Command Prompt CD to your Retroarch Folder.
  2. Run docker run -it -v %cd%:/developer wiiu-build - which will get you a linux command prompt.
  3. Run cd /developer
  4. Run make -f Makefile.wiiu and it will run the build. (This will take longer than the Core.)
  5. Run exit to exit the container.

Once finished it should generate a libretro_wiiu.rpx file in Retroarch/objs/wiiu Rename to (Corename)_libretro.rpx and place in your SD card's Retroarch Core folder

nbarkhina commented 1 year ago

Ok thanks. I got it loaded up on the Wii U but I see what you mean. The calculator screen is just blank, If it were able to load the bios correctly there would at least be something displayed on the calculator screen instead of just blank. Like on first load it should say something like "RAM Cleared" and you would be able to interact with the calculator, push buttons, etc... so I believe it has something to do with it not loading the bios file correctly. I'm not very familiar with the Wii U hardware so I'll have to look into this. Could be something with the Endian, not sure. I also see the timing is 24 FPS like you said, I think that's some other unrelated issue which I'm aware of and am still looking into.

Ploggy commented 1 year ago

Yea, WiiU is Big Endian so we get all the weird core quirks and issues lol Thank You for looking into this :) Oh, and another cool thing, the WiiU's touch pad works with the Core! well.. it highlights whatever button you select anyway.

vaguerant commented 1 month ago

The good news is, we have the core running on Wii U now. The problem is here: https://github.com/nbarkhina/numero/blob/6b0fce2e230ba0b4b0f43f83107418c9a6e47788/common/stb_image.h#L621-L623

The current Wii U toolchain (and I'm guessing a lot of other platforms libretro targets?) doesn't support thread local storage, so WIIU needs to be in here too, i.e.:

#if defined(IOSVERSION) || defined(WIIU)
#define STBI_NO_THREAD_LOCALS
#endif

I don't really know anything about any other platforms (or Wii U either, for that matter), but there's probably more that should go into that list than just iOS and Wii U.


The bad news is, I failed math:

Numero-240617-011917

Probably endian stuff as you initially guessed.

Performance is still not good either, I clock about 24 same as Ploggy with a TI-83 SE. Dropping down to an original TI-83, I get about 32 FPS just sitting on the home screen.

nbarkhina commented 1 month ago

lol thanks for finding that! I'll test out your fix locally and try it out - yeah that is strange the math result you are getting. If it's Endian related I'm surprised it boots at all so might be something else.

vaguerant commented 1 month ago

Interestingly, there is different behavior across the different BIOSes/TI-83 models. I'm using the BIOSes from the Libretro Docs.

nbarkhina commented 1 month ago

Thanks for testing those scenarios