Author Topic: Gameblabla's Oswan  (Read 18776 times)

gameblabla (OP)

  • Posts: 1364
Re: Gameblabla's Oswan
« Reply #40 on: August 24, 2015, 11:04:28 pm »
Looked at every Wonderswan's source code emulators (except Misato's one, who didn't released the source, despite violating the GPL).
None of them are using SDL for sound.  >:(
Anyways, i have improved sound's quality a bit but it still sounds kind of scratchy.
Oswan got updated to r4, first post to download it.

Eliwood_san

  • Posts: 255
Re: Gameblabla's Oswan
« Reply #41 on: August 25, 2015, 02:01:29 am »
Its normal the filesize of the oswan emulator are 44 kb o.O?

gameblabla (OP)

  • Posts: 1364
Re: Gameblabla's Oswan
« Reply #42 on: August 25, 2015, 02:13:40 am »
Quote
Its normal the filesize of the oswan emulator are 44 kb o.O?
Hahaha, yes it's normal !
I made sure to optimise its size without cheating !

Unfortunely, last version crashed so if you downloaded it before, do it again please.

CopyKitten

  • Posts: 19
Re: Gameblabla's Oswan
« Reply #43 on: August 25, 2015, 10:22:19 am »
Quote
I extract the previous working build of Oswan opk before the crash build, put it in the sdcard, renamed it to oswan.bin and then filtered the files to just includes ws & wsc manually and it works.
Then you could please give me that desktop file please ?
Because i don't know how to tell Gmenu to filter every files other than ws & ws files.
I didn't do any changes to the desktop file though but I attached the oswan.txt (you've got to remove the txt extension, I add it in the first place because the post attachment restricted what file type can be upload).

1. Create the oswan folder in /data/apps/ directory.
2. Put in your latest oswan binary and the icon.png.
3. Put the oswan.txt file that I upload into the /data/local/home/.gmenu2x/sections/emulators directory.
4. Reboot the QEMU? I dunno...

Maybe you need to adapt the lines of code from the oswan file into the default.gcw0.desktop file before repacking it? I haven't tested it yet as I can't use the PC right now.

Another issues:
- The sound is still lagging, the best version of the sound emulation was prior to the august 23 update (the gameplay is fast though).
- Quick Save and Quick Load are inverted.
- And also:

The Swap DPAD, ABXY mode as intended:

   Y            U
X     A      L     R
   B            D

   1
4  J  2
   3

...but the current build:

   Y            U
X     A      D     L
   B            R

   1
4  J  2
   3

I'll leave the rest for later... ;D

gameblabla (OP)

  • Posts: 1364
Re: Gameblabla's Oswan
« Reply #44 on: August 25, 2015, 05:28:12 pm »
Yo !
I have, you guess it, updated Oswan again.
The code received some cleanup.
Some functions are now inlined, which translates to a small speed boost.
Audio should be better than previous releases, the DPad/ABXY option got fixed, and it's also a lot less crashy.
(crashes were happening very often on PC but not on GCW0)

Quote
Maybe you need to adapt the lines of code from the oswan file into the default.gcw0.desktop file before repacking it? I haven't tested it yet as I can't use the PC right now.
I tried putting selectorfilter in the desktop file in the opk but it does not seem to work properly on QEMU...
Maybe it works on GCW0 ?

One more thing...
Quote
In Riviera - Yakusoku no Chi Riviera, screen flashes around text whenever something is being selected
It IS supposed to do that. I checked with Mednafen and it does the same thing.
Maybe it's less apparent on real hardware though... (Before the SwanCrystal, the Wonderswan's screens were kind of crappy)

Also, where are the chinese ?
Is it because i accidently got Dingoonity banned or because of the recent events ?
I miss them :(
« Last Edit: August 25, 2015, 10:25:37 pm by gameblabla »

CopyKitten

  • Posts: 19
Re: Gameblabla's Oswan
« Reply #45 on: August 26, 2015, 04:55:44 am »
Some functions are now inlined, which translates to a small speed boost.
Audio should be better than previous releases, the DPad/ABXY option got fixed, and it's also a lot less crashy.
(crashes were happening very often on PC but not on GCW0)
Agree, the audio is faster than before but not yet 100%. And for any gameplay, the speed is great as is (maybe a Fast Forward feature can be implement in the future?).

But maaannn....

   Y            U
X     A      L     D
   B            R

   1
4  J  2
   3

This confusion must be because the key mapping on QEMU right? Can you list all the relevant key inputs code? (I mean the QEMU key mapping and the source code of Oswan key inputs for GCW0).

Quote
Quote
Maybe you need to adapt the lines of code from the oswan file into the default.gcw0.desktop file before repacking it? I haven't tested it yet as I can't use the PC right now.
I tried putting selectorfilter in the desktop file in the opk but it does not seem to work properly on QEMU...
Maybe it works on GCW0 ?
If I pack the opk with any random MIME type like the gameboy, the filtration work but not for the wonderswan. Maybe the file types need to be declared on the firmware level?

Why don't you take a look at the Genesis Plus GX opk or source code and figure out how it work?

Too bad I'm not a programmer, else I could help you to fix the key mapping issue :'( (just starting to learn Python, on and off actually and I don't see how it would help even if I know a lot  :().

And you did the scroll mode too, that's great. Good thing that the game library is not that big or else, I'll asked for the Gmenu type of scrolling (but then again... maybe you can append it to the Dpad Left and Dpad Right ;D).

gameblabla (OP)

  • Posts: 1364
Re: Gameblabla's Oswan
« Reply #46 on: August 26, 2015, 06:36:49 am »
Gameblabla's Oswan got updated again, thanks CoppyKitten for the feedback.

Here's what has changed since last release:
  • Added 'Keep Aspect" in Ratio, should make everyone happy now
  • Fixed Dpad/ABXY (I HOPE IT IS)
  • Added Left/Right Dpad for fast browsing.
I'm no longer using Gmenu for this release and this time, i don't plan to reintroduce it.
There's no way to filter Wonderswan roms because they don't have a Mimetype (while gameboy roms have one).
The selectorfilter parameter only works when you're inserting it manually :
it doesn't work from a OPK file.

About the audio, i'm making some progress :

Looking at CrabEmu, i was finally able to have smooth audio playback...
except for that piece of s**t known as buffer.

At its current state, it plays fine for a while but when the buffer is empty and filled back on again,
it "rewinds" about 2 seconds backward before it continues again.
I'll be honest : I never dealt with low-level audio code.

I could cry for help but David Knight, the only guy who could help me, is busy.
I guess smooth audio playback will have to wait...

Quote
Too bad I'm not a programmer, else I could help you to fix the key mapping issue :'( (just starting to learn Python, on and off actually and I don't see how it would help even if I know a lot  :().
I never dealt with Python in my life, because honestly it's useful for.... hmmm. nothing but learning ? Hahaha
« Last Edit: August 26, 2015, 06:40:45 am by gameblabla »

CopyKitten

  • Posts: 19
Re: Gameblabla's Oswan
« Reply #47 on: August 26, 2015, 07:48:14 am »
Everything works! ...for now. I'll let you rest for this moment before I post another request and some blablabla...

  • Added Left/Right Dpad for fast browsing.
What I meant for it was a fast skipping similar to the Gmenu.

Quote
There's no way to filter Wonderswan roms because they don't have a Mimetype (while gameboy roms have one).
That is a one ROM racism!

Quote
About the audio, i'm making some progress :
If I say there's a progress, you'll change it and then it might lags again, so... I don't want to talk about it lol!

Quote
Quote
Too bad I'm not a programmer, else I could help you to fix the key mapping issue :'( (just starting to learn Python, on and off actually and I don't see how it would help even if I know a lot  :().
I never dealt with Python in my life, because honestly it's useful for.... hmmm. nothing but learning ? Hahaha
Suddenly... my blood is boiling to the heat level of the sun and I feel like round house kicking you to the end of the universe and the spacetime will rips apart and then you'll end up in another dimension full of Bidoofus!

I've got some plans though, for short term... a good and simple calculator that support hex/bin/oct conversion (with correct floating point output too, I'm talking about precision to the last output number), and then within a year or two.. Saved Game editors (gbc, snes, gba, wsc and others) and maybe a password generator for Mega Man games. And for long term... Guitar Chord viewer and maybe some simple games (spriting is not my thing so it will take a while).

If they're good and stable (even if the coding is terrible), I'll release them... hopefully ;D
« Last Edit: August 26, 2015, 08:46:01 am by CopyKitten »

howie_k

  • Posts: 157
Re: Gameblabla's Oswan
« Reply #48 on: August 26, 2015, 07:30:55 pm »
If the emulator works with zipped WSC roms, gmenu does show *.zip files.  I guess most people prefer to have their roms zipped anyway?

gameblabla (OP)

  • Posts: 1364
Re: Gameblabla's Oswan
« Reply #49 on: August 26, 2015, 11:48:32 pm »
If the emulator works with zipped WSC roms, gmenu does show *.zip files.  I guess most people prefer to have their roms zipped anyway?
Ha, i see. Never thought of that.
But still, i will not use gmenu by default because of this issue.
I'll try to add zip support for roms though, thanks for the idea.

EDIT:
And that's what i did: i added support for zipped roms.
It still needs improvements though :
It is temporaly writing to a file and deleting it instead of, hmmm, you know, read it from memory.
As a result, loading them can be pretty slow (a few seconds), which is why i advise you not to zip your roms.
« Last Edit: August 27, 2015, 07:49:47 am by gameblabla »

howie_k

  • Posts: 157
Re: Gameblabla's Oswan
« Reply #50 on: August 27, 2015, 07:02:51 pm »
Ok thanks!

gameblabla (OP)

  • Posts: 1364
Re: Gameblabla's Oswan
« Reply #51 on: August 30, 2015, 04:09:51 am »
Ladies and Gentlemen,
i have finally fixed sound and i have accordingly updated Oswan too.
Read on if you want to know more about this...

I spent 2 weeks wondering why it sounded so awful, with lots of hipcups and the likes...
Checking trap15's new documentation, i compared the synchronisation values with my emulator
and something was definitively wrong...
The difference between the two was HUGE.
I have tweaked my emulator according to the documentation and surprise,
it sounded much better, much like Mednafen actually.
So the issue was the Audio code (which required perfect synchronisation) and the inaccurate timing.

Every WS emulator (except Mednafen & MESS) suffered from this,
it makes you wonder how they managed to have good sound output...

However...
Being more accurate also means it can potentially be slower.
I tried on QEMU and the latest version was slightly faster than the previous one
but this may not be true on real hardware.
If you have a game that is too slow on GCW0, please do tell.

And now i can die happy.

EDIT: Actually, it played a little too fast so i re-released another update.
Also, you may notice that games such as Kinnikuman are now playing much faster.
They are in fact playing at the correct speed because they played way too slow before.
I compared my emulator with Mednafen and they roughly play at the same speed now,
which is good.
« Last Edit: August 30, 2015, 08:38:29 am by gameblabla »

yoshi41

  • Posts: 474
Re: Gameblabla's Oswan
« Reply #52 on: August 30, 2015, 09:50:19 am »
Sound is much better. Very good progress. Congrats.  8)

Pls don't die yet.  ;) The games I've tried all crash after playing a short time (FFI, FFII, Golden Axe, Dicing Knight). Something is still wrong.

And can you please add an auto scroll feature to the file selector (for keep pressing up or down).
Emulator packs and fact sheets for Wiz, Caanoo, Dingoo and Pandora.

gameblabla (OP)

  • Posts: 1364
Re: Gameblabla's Oswan
« Reply #53 on: August 30, 2015, 05:55:26 pm »
The games I've tried all crash after playing a short time (FFI, FFII, Golden Axe, Dicing Knight). Something is still wrong.
Indeed, something is very wrong and since i don't own the device, i can't use reproduce it and use gdb. :/
Please, don't tell me its a GCC bug...
I have released another update that uses different optimisation parameters but if it is still crashing,
then you will have to wait for the next update to the devkit to be released. :(

Quote
And can you please add an auto scroll feature to the file selector (for keep pressing up or down).
I will see what i can do about that.
You can still use the Left/Right button to go faster though.
« Last Edit: August 30, 2015, 05:57:01 pm by gameblabla »

yoshi41

  • Posts: 474
Re: Gameblabla's Oswan
« Reply #54 on: August 30, 2015, 06:40:49 pm »
Still crashing with r3.
Emulator packs and fact sheets for Wiz, Caanoo, Dingoo and Pandora.

gameblabla (OP)

  • Posts: 1364
Re: Gameblabla's Oswan
« Reply #55 on: August 30, 2015, 07:21:28 pm »
Still crashing with r3.
Damnit !

To any developers with a gcw0, could you please test it with gdb and see where it is crashing ?
Because i have no idea why it does... :/

I remember there was weird crashes before as well and i had to re-download everything from my repo
in order to fix it. Weird, but i'll do that.
Needless to say, i can't wait for the toolchain to come.
Crashes like this makes me wish the GCW0 was Musl-Based instead of uclib...

EDIT: Cleaned up my emu and updated Oswan again. I could not reproduce the crash on Qemu.
« Last Edit: August 30, 2015, 07:35:52 pm by gameblabla »

yoshi41

  • Posts: 474
Re: Gameblabla's Oswan
« Reply #56 on: August 30, 2015, 08:57:45 pm »
Sorry to have no better news. I hate to say, but it's still crashing.  :-[
Emulator packs and fact sheets for Wiz, Caanoo, Dingoo and Pandora.

gameblabla (OP)

  • Posts: 1364
Re: Gameblabla's Oswan
« Reply #57 on: August 30, 2015, 09:31:12 pm »
Sorry to have no better news. I hate to say, but it's still crashing.  :-[
Well thanks for trying, i'm running out of ideas. :/

I don't know what is the causing the crash, it works just fine on QEMU.
If you want to help debugging, here's a special version with debug symbols :
https://gameblabla.olympe.in/files/oswan-debug.zip
« Last Edit: August 30, 2015, 09:36:24 pm by gameblabla »

zear

  • * Moderator
  • Posts: 2381
Re: Gameblabla's Oswan
« Reply #58 on: August 30, 2015, 10:09:11 pm »
I ran the above debugging build of Oswan with some of the games reported to crash, but I wasn't able to produce any crashes or otherwise unstable behaviour. From the description of the issues, it sounds like a possible memory leak, but the memory usage was stable at 21M throughout the entire run time.

The games run rather slow (x2/x3 slower than I'd imagine on the real hardware), but the reported FPS is quite high. I know it's a debugging build, so it's probably not as optimized as the release one.

On a side note, a quick analysis of the source core revealed some problems:
Code: [Select]
[main/emu/WSFileio.c:172]: (error) Resource leak: fp
[main/sdl/hack.c:89]: (error) Memory leak: out
[main/sdl/input.c:128]: (error) Uninitialized variable: keys
[main/sdl/main.c:166]: (error) Buffer overrun possible for long command line arguments.
[minizip/unzip.c:572]: (error) Uninitialized variable: file_info
[minizip/unzip.c:578]: (error) Uninitialized variable: file_info
[minizip/unzip.c:647]: (error) Uninitialized variable: file_info_internal

PS. I suggest you join our IRC channel (connection details) if you want developers to help you debug. Instant communication is much better for debugging than leaving messages on the forum and waiting a day for a response ;)

yoshi41

  • Posts: 474
Re: Gameblabla's Oswan
« Reply #59 on: August 30, 2015, 10:42:02 pm »
The debug build doesn't crash for me either (at least not for what I've tried, playing Golden Axe for a couple of minutes). It's running very slow (probably not unusual for a debug version). The non-debug version crashes almost instantly.
Emulator packs and fact sheets for Wiz, Caanoo, Dingoo and Pandora.