libretro / vice-libretro

Versatile Commodore 8-bit Emulator
GNU General Public License v2.0
40 stars 70 forks source link

[Wii] Doesn't load, freezes on a black screen #373

Open Cee123 opened 3 years ago

Cee123 commented 3 years ago

The core will not even load into memory - upon loading the core, it just freezes on a black screen.

sonninnos commented 3 years ago

Is this still the case?

Cee123 commented 3 years ago

Is this still the case?

I don't know, I haven't looked at this for a while. I'll test it out and see if it still has issues.

Cee123 commented 3 years ago

Is this still the case?

I just tried this and as of 27/09/21 with the latest nightly, it's exactly the same. Nothing's changed here. Still black screen, doesn't work.

vonmillhausen commented 1 year ago

Still the case with the 1.15 release, sadly :(

sonninnos commented 1 year ago

Without logs it is impossible to start guessing what the reason might be.

vonmillhausen commented 1 year ago

Without logs it is impossible to start guessing what the reason might be.

For what it's worth, here's the log (this is full Debug logging turned on in the menu) - as you can see, there's not a lot. As soon as you choose to load the Vice cores, the console locks up with a black screen, and must be force-powered-off.

retroarch2023_06_1300_05_57.log

Perhaps the fact that (given the lack of logging) it appears the core locks the console very early in the loading process is itself a clue? I hope it helps! Let me know if there's anything else I can do to help here - if you want to build a core version with even more logging turned on or something, I'm more than happy to do tests on real hardware for anyone on the dev team 👍

sonninnos commented 1 year ago

Unfortunately indeed not helpful since there is no "good part" in the log, and no mention of even starting the core at all.. Buildbot build logs look clean also, so not much to go on.

vonmillhausen commented 1 year ago

Unfortunately indeed not helpful since there is no "good part" in the log, and no mention of even starting the core at all.. Buildbot build logs look clean also, so not much to go on.

Aye, which as I say must mean the core is failing to load very early in the load process.

Hypothetically speaking, if it was loading successfully, what's the first debug level log entry you would expect to see? If that log entry (whatever it is) isn't being generated, then that must mean the core is failing before that point. What does the core do before that point? Something in there is the culprit.

As I say, I'm more than happy to do any testing you want to get this old (2+ years) issue closed out, and get this core working again. Would it be possible to make a debug build of the core that has additional logging for every step early in the load process? If you can get a build to me that is as verbose as possible in terms of logging, I can get you a log that's useful.

ghost commented 1 year ago

I loaded a small core like Handy (2.94 MB) and it launches the menu okay. This is before you even press "Load Core" button.

Vice is 5.99 MB - is it breaking some memory limit in Retroarch itself? I'm not following why the frontend is black-screening.

ghost commented 1 year ago

Loaded fbalpha2012 = 14.2 MB. Displays frontend okay.

:huh:

ghost commented 1 year ago

Does anyone know roughly when the Wii was last working? @Cee123?

I tried this old commit from Oct. 2018 and it still black screens before the menu. https://github.com/libretro/vice-libretro/commit/d6112d6542ab2a7c4fd40e958cf8c75d726d16a0

I can't find a working devkit to build older Wii RA frontends.

ghost commented 1 year ago

Tried building all commits, even first one. None seem to load into memory. Unsure it ever worked as no one mentions it in forums.

Frodo was ported to Wii and mentions that 2020 Vice failed. https://www.lemon64.com/forum/viewtopic.php?t=76082

PSP Vice looks custom built. https://github.com/rsn8887/pspvice

Only when I strip out nearly everything from libretro-core.c does it try to boot. Maybe the Wii doesn't have enough memory?

This is a Github Actions build script if someone else wants to tinker.

on:
  push:
  workflow_dispatch:

jobs:

  build-libretro:
    strategy:
      matrix:
        arch: [wii]
        core: [64]
      fail-fast: false

    runs-on: ubuntu-latest

    steps:

    - shell: bash
      run: |
        git clone https://github.com/libretro/vice-libretro core
        cd core

        # devkitppc r29, 2018-05-22
        docker run --rm -v "$PWD:/build" devkitpro/devkitppc:20180522 sh -c "cd /build; make -f Makefile -j`nproc` platform=wii"

    - shell: bash
      run: |
        git clone https://github.com/libretro/RetroArch.git retroarch
        cd retroarch

        docker run --rm -v "$PWD:/build" --network=host devkitpro/devkitppc:20180522 sh -c "cd /build; make -f Makefile.wii.salamander"

        mv ../core/vice_x64_libretro_wii.a libretro_wii.a
        docker run --rm -v "$PWD:/build" --network=host devkitpro/devkitppc:20180522 sh -c "cd /build; make -f Makefile.griffin platform=wii"

    - uses: actions/upload-artifact@main
      with:
        name: vice_${{ matrix.core }}_${{ matrix.arch }}
        path: ${{ github.workspace }}/retroarch/**.dol
sonninnos commented 1 year ago

Could it perhaps just be something simple like a makefile flag..?

ghost commented 1 year ago

That's an interesting point. I'll compare some other Wii Makefiles and dumb down the switches. I'll let everyone know what I tried when I get the chance. ;)

ghost commented 1 year ago

O0 = no.

# Wii
else ifeq ($(platform), wii)
   TARGET := $(TARGET_NAME)_libretro_wii.a
   CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
   CXX = $(DEVKITPPC)/bin/powerpc-eabi-g++$(EXE_EXT)
   AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT)
   COMMONFLAGS += -DGEKKO -DHW_RVL -mrvl -mcpu=750 -meabi -mhard-float -D__ppc__ -DMSB_FIRST
   COMMONFLAGS += -U__INT32_TYPE__ -U __UINT32_TYPE__ -D__INT32_TYPE__=int
   COMMONFLAGS += -DHAVE_STRTOUL -DWII
   STATIC_LINKING = 1

No.

I know nothing about Wii arch / asm so can't help here.

saulfabregwiivc commented 9 months ago

same issue here, any clues?

sonninnos commented 9 months ago

I'm afraid clues are out of stock until someone with the hardware starts to debug.

vonmillhausen commented 9 months ago

I don't have the technical chops to do any debugging myself - but I have the Wii hardware all set up and ready to go, so if you can put together a debug build with a bunch of extra logging or something, I'm happy to run it for you and post the results 👍

sonninnos commented 9 months ago

There is no way for me to do anything like that from where I'm sitting.

There is also no way of knowing where it hangs and what is happening if there is no core outputted log that starts with something this

[libretro INFO] --------------------------------------------------------------------------------
[libretro INFO] VICE x64sc (C64) 3.7 d205e29b3, Jan 22 2024 12:15:58
[libretro INFO] --------------------------------------------------------------------------------

Is the previous log really done with both frontend and core log levels at 0? It is missing a lot of stuff regardless even if it is not running a core. Besides now I noticed it looks like it was running the core called "2048"..?

[INFO] [Runtime]: Saving runtime log file: "sd:/retroarch/playlists/logs/2048/2048.lrtl".
saulfabregwiivc commented 9 months ago

Don't know if that helps but i've tried to run this in Dolphin and it doesn't write any log, but at least the emulator throws me this error, likely with that it is possible to address this issue:

image

Question: try debugging it with the latest development versions of Dolphin emulator? http://dolphin-emu.org/download

saulfabregwiivc commented 8 months ago

Some few updates:

When i modify the retrodep/archdep.c file for fix the location of the archdep files when compiling for Wii, it actually compiles into a dol. I only got to start the core when compiled with RetroArch v1.9.0.

However, it crashes when you start a game.

Here's the patch if you're interested: https://github.com/saulfabregwiivc/VICE-Libretro-Wii/commit/1aa90fe7f927175b675088bca527c1e8a778338d

saulfabregwiivc commented 8 months ago

Btw, anyone can tell me how i can install the required libraries used by this Libretro port of VICE so i can compile it properly? There are too many libraries used by this port and i just can't figure out how i can put the required libraries files into the correct paths required by the files (e.g. on #include "arch/shared/archdep_access.c" in retrodep/archdep.c)