MiSTer-devel / WonderSwan_MiSTer

WonderSwan Color for MiSTer
GNU General Public License v2.0
12 stars 13 forks source link

Corrupted video and audio in "Vesilintu" by Dekadence #22

Open superjohan opened 1 year ago

superjohan commented 1 year ago

I tested this on the Analogue Pocket port of this core, and the developer of that core requested that I report the issue here instead. I don't have a MiSTer so I can't test this on that particular device, so take this report with a grain of salt, and I apologize if it's in error.

The original report: (https://github.com/agg23/openfpga-wonderswan/issues/4)

Steps to reproduce

Run dkd-vesilintu.wsc from the following archive: https://www.dekadence64.org/dkd-vesilintu.zip

Expected Behavior

Emulator capture with audio from a real WSC: https://www.youtube.com/watch?v=6qItOEf43xQ Real hardware: https://www.youtube.com/watch?v=ftDOer3VXm0

Actual Behavior

Corrupted video and audio.

thehughhefner commented 1 year ago

Have you verified with real hardware?

superjohan commented 1 year ago

Have you verified with real hardware?

No. As I said in the issue body, I don't own a MiSTer. If someone else could verify this, that'd be great.

thehughhefner commented 1 year ago

Real hardware = Real WonderSwan Colour hardware

superjohan commented 1 year ago

Ah I see. Yes, as I also mentioned in the issue, the demo is identical to the video on real hardware.

thehughhefner commented 1 year ago

The uploader of the video mentions it is run on an emulator. If someone has a real Wonderswan colour hardware that can verify this, then it would be great

superjohan commented 1 year ago

I'm the uploader and one third of the makers of the demo. We verified it works on real hardware (it wouldn't have been accepted into the competition otherwise :), with a Flash Masta cartridge. I can provide video proof later today.

superjohan commented 1 year ago

Here you go: https://www.youtube.com/watch?v=ftDOer3VXm0

RobertPeip commented 1 year ago

Great that you worked on it, so you may have more insights on what can be reason.

First it would be good to know in which emulator this works, because in Ares it does not and i'm not aware of any other accurate Wonderswan emulator.

Maybe you also have some clues what you do that is so special. I mean the core and Ares both can run basically the whole wonderswan library, so if something breaks that bad, there must be something special we forgot?

What I also wonder: you use an emulator but sound from hardware? Why? Is the emulator not able to do the sound?

superjohan commented 1 year ago

We used Mednafen while working on the demo. As to why we used sound from hardware in the video, it's just because we like our captures to be as "real" as possible, and we don't really know of any (simple) solution to get video out of the WSC, so this was sort of halfway there. :)

I'll see if @britelite78 could provide more technical details of the demo, he coded the thing.

superjohan commented 1 year ago

Good news, the problem is much simpler than anticipated :) The issue is that the ROM is not padded to exactly 1 MiB. I padded it manually (after receiving some good advice: https://mk.asie.pl/notes/9jmwmzl2my) and now it works on the Pocket core at least. Attached the padded ROM as a test case.

dkd-vesilintu-padded.wsc.zip

thehughhefner commented 1 year ago

I've verified it on MiSTer and it works. Issue can be closed

superjohan commented 1 year ago

Does the original unpadded .wsc work as well?

RobertPeip commented 1 year ago

Roms are loaded from the start, not from the end. This is not even possible so easy for the mister core, as i don't think it knows the size of the rom until it's fully downloaded from linux, but that would be required as the end is variable depending on the game size. No idea if this is different for the pocket.

If someone wants to implement that(probably need to be done in main then?), i can leave it open here, but this is really a odd duck. I haven't run into such an issue before with any homebrew or game, so i'm not sure how important it is to have unpadded roms...