maemo-leste / bugtracker

Issue tracking repository
62 stars 3 forks source link

Im(port) osso-games-startup #238

Closed android-808 closed 4 years ago

android-808 commented 5 years ago

As discussed in #18

Used for stock games, DrNokSnes and PicoDrive.

http://maemo.org/packages/source/view/fremantle_sdk_free_source/osso-games-startup/1.7.49-1+0m5/

MerlijnWajer commented 5 years ago

It would be cool if we can find some svn/git history for it, if possible. @freemangordon - garage is a good place to check sometimes, right?

Regardless, you can just import the entire tar as in, and work from that. We can always add history later.

android-808 commented 5 years ago

I created a repo under my account whilst I ply around with this: https://github.com/android-808/osso-games-startup

Currently it build but I'm no expert with gio/gnomevfs so the fix I have for gnome_vfs_format_uri_for_display may not be correct or the best way to do it. While I work out the save feature callback I've commented the code.

In its current state it will at least build a deb.

MerlijnWajer commented 5 years ago

Shall I create a repo for it on maemo-leste on github and build a package for it?

android-808 commented 5 years ago

Apologies, I've taken a break for quite a while whilst I sort out some other issues/ holidays etc.

It'd probably be better when I upload a test of osso-mahjong so you have something to actually test it with. I need to comment out or fix another gio/gnomevfs section in osso-mahjong's hiscore.c and then hopefully it should be in a semi working state for testing. I've got some time today so I might try to get that done so I can upload it today or over the weekend.

android-808 commented 5 years ago

Mahjong osso-mahjong, using osso-games-startup

I need to find the correct deb for the translations to display correctly. It requires some files from the SSU repo for graphics and sounds. Sounds work under VirtualBox, graphics are almost working 100%. The background of the actual game screen is displayed as: Mahjong2 Might be ok on an N900 at the correct resolution.

I forgot to upload the original source before I started so I need to go through and sort out my git side of things I can get something uploaded over the weekend.

android-808 commented 5 years ago

NOTE I'm not a GIO expert so I expect there to be mistakes or better solutions. It also doesn't complete the level correctly. It returns to the startup screen after matching the last tiles, but you can't do anything and the close button doesn't work.

Completed upload to my WIP repo. Feel free to try them out, taking the above onto account. osso-games-startup: https://github.com/android-808/osso-games-startup osso-mahjong: https://github.com/android-808/osso-mahjong

The following still needs to be fixed, but judging by the params I think it is for osso-chess. https://github.com/android-808/osso-games-startup/blob/37281b715375ecfd78bd1f6640ab79bf62c5d4bf/src/ui/callbacks.c#L498

MerlijnWajer commented 5 years ago

Great. I can take a look at the GIO stuff, is it just the above link?

MerlijnWajer commented 5 years ago

I made a note on this commit: https://github.com/android-808/osso-games-startup/commit/01b0d6f589e64769b9bf50a4e7f3e02dc65dd971

MerlijnWajer commented 5 years ago

Looks like you need osso-games-l10n-mr | osso-games-l10n-mr0. Maybe the osso-games-l10n from here are ok: https://coderus.openrepos.net/n900mirror/downloads.maemo.nokia.com/fremantle/mr0/

(there might be other places at that mirror too). I can try to find the right one.

android-808 commented 5 years ago

Missed that one. Fixed now.

They're part of the solution. You then have the osso-games-l10n-**** packages for each langauge. I also had to pull osso-{graphics,sound}-games-mahjong from SSU.

MerlijnWajer commented 5 years ago

What I mean, is you can get all the packages from that link.

MerlijnWajer commented 5 years ago

Understood @ sounds/graphics.

android-808 commented 5 years ago

I uninstalled the osso-games-l10n-public I previously had installed, which automatically caused all the correct translations to be installed. One problem solved. Mahjong4

May or may not have been related but score board is now working. Mahjong3

Yes, thats a rubbish score but I just kept hitting match.

android-808 commented 5 years ago

Mahjong5 Level complete is also now working and returns you correctly to the startup screen. I did earlier use touch ~/.mahjong_scores which may be the reason. Last issue in Mahjong is the background as pictured earlier.

android-808 commented 5 years ago

As another test for osso-games-startup: https://github.com/android-808/hildon-games-wrapper https://github.com/android-808/osso-lmarbles

Marbles

Startup screen displays correctly. Clicking play results in an error about storage space. Running touch ~/.lmarbles_state gets rid of this but then game state immediately returns to menu when clicking start.

MerlijnWajer commented 5 years ago

Awesome work! Will take a look tomorrow.

android-808 commented 5 years ago

The config file creation for both Mahjong and Marbles is still not right. Unless I manually touch ~/.bla both have issues.

Blocks uses the same hildon-games-wrapper approach as Marbles so presumably is going to reach same problem of not actuallly entering the game. Chess I've not looked at. DrNokSnes & Picodrive requires maemo-version and libxsp. First I think is just a file in /etc, second I have built and is in my github. DrNokSnes also requires sdlhaa, which I've nearly got building, but I'm in Makefile land now and am getting errors with https://github.com/android-808/sdlhaa/blob/fe106b54be20580bf29cceb5da93bfb29f235979/src/Makefile#L14. As is it creates gcc unrecognized something or other, adding "-Wl," params I get ld errors.
Picodrive also depends on libgstreamer0.10-dev so may need more work.

MerlijnWajer commented 5 years ago

Can you post the changes + errors for libshaa?

On Sat, 24 Aug 2019, android-808 wrote:

The config file creation for both Mahjong and Marbles is still not right. Unless I manually touch ~/.bla both have issues.

Blocks uses the same hildon-games-wrapper approach as Marbles so presumably is going to reach same problem of not actuallly entering the game. Chess I've not looked at. DrNokSnes & Picodrive requires maemo-version and libxsp. First I think is just a file in /etc, second I have built and is in my github. DrNokSnes also requires sdlhaa, which I've nearly got building, but I'm in Makefile land now and am getting errors withhttps://github.com/android-808/sdlhaa/blob/fe106b54be20580bf29cceb 5da93bfb29f235979/src/Makefile#L14. As is it creates gcc unrecognized something or other, adding "-Wl," params I get ld errors. Picodrive also depends on libgstreamer0.10-dev so may need more work.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute thethread.[AAD6OCOKVHJ33NNQKVRLFJTQGGCMPA5CNFSM4HCM34JKYY3PNVWWK3TUL5 2HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5CF5NA.gif]

android-808 commented 5 years ago

I'll take another look tomorrow and post them. Had a long shift at work so now it's beer o'clock.

Forgot one of the emulators wanted libbluetooth and zeemote but last change log said it was disabled so I've just removed the depends.

DrNokSnes I've seen mentioned a few times, including the new status page, so I'd like to get that running as a treat for the other Devs.

MerlijnWajer commented 5 years ago

I've also had a pretty busy weekend, but will try to look at the work you've done and maybe the GIO code after the weekend.

Yeah, I'm just a SNES fan. :)

android-808 commented 5 years ago

Had an idiot moment. It helps if you install libtool. sdlhaa built. https://github.com/android-808/sdlhaa

So..

drnok1

Problems so far:

The code for the last two is in gui/plugin.c IIRC. No GIO bits just HildonFileChooser.

MerlijnWajer commented 5 years ago

if you depend on autotools-dev in debian/control it should make you install libtool, I think.

Seeing that you're making a lot of progress, can you summarize what the first steps should be for me to get all of this packaged and built? I can test/check the armel -> armhf stuff, for example. But perhaps best to start with the first packages.

Should I try to locally build all of this stuff first and then package it in the repo? That way I can perhaps test DrNokSnes too.

MerlijnWajer commented 5 years ago

I built the first few packages, but drnoksnes needs libxsp-dev. Where should I get that from?

MerlijnWajer commented 5 years ago

I just commented it out and it built. I wonder if the problem simply is that hildon filemanager dialog expects specific config to be available, like 'N900 root' and 'External SD card'. But since there aren't any, it just doesn't allow us to browse at all.

MerlijnWajer commented 5 years ago

I wonder if this is just gvfs not showing what it should. Might be wrong, though.

android-808 commented 5 years ago

It doesn't use autotools though, it's just a plain Makefile. I'm wondering if having autotools or something else installed will automatically define it somewhere though. It must have before on Fremantle.

Forgot that set: https://github.com/android-808/x11proto-xsp https://github.com/android-808/libxsp Xsp is an X extension. Whether it works or not still I'm yet to get far enough to find out. Of the top of my head I think its for scaling.

I would try locally first. I think it would be better to test it on an actual device as I'm using VirtualBox. I'm wondering if there's some hard coded dimensions in Mahjong that need adapting for example. My theory is if it worked on an N900 before, it should now.

Build order wise, with the exception of xsp related, which I forgot to link, the links posted here are the order in which it all needs to be built.

MerlijnWajer commented 5 years ago

If I go to 'Open', it shows 'Floppy Disk'. gio calls it the same:

Drive(0): QEMU HARDDISK
  Type: GProxyDrive (GProxyVolumeMonitorUDisks2)
  ids:
   unix-device: '/dev/sda'
  themed icons:  [drive-harddisk]  [drive]
  symbolic themed icons:  [drive-harddisk-symbolic]  [drive-symbolic]  [drive-harddisk]  [drive]
  is_media_removable=0
  has_media=1
  is_media_check_automatic=1
  can_poll_for_media=0
  can_eject=0
  can_start=0
  can_stop=0
  start_stop_type=shutdown
  sort_key=00coldplug/00fixed/sd____a
Drive(1): Floppy Drive
  Type: GProxyDrive (GProxyVolumeMonitorUDisks2)
  ids:
   unix-device: '/dev/fd0'
  themed icons:  [drive-removable-media-floppy]  [drive-removable-media]  [drive-removable]  [drive]
  symbolic themed icons:  [drive-removable-media-symbolic]  [drive-removable-symbolic]  [drive-symbolic]  [drive-removable-media]  [drive-removable]  [drive]
  is_media_removable=1
  has_media=1
  is_media_check_automatic=1
  can_poll_for_media=0
  can_eject=0
  can_start=0
  can_stop=0
  start_stop_type=shutdown
  sort_key=00coldplug/10removable/fd0
  Volume(0): Floppy Disk
    Type: GProxyVolume (GProxyVolumeMonitorUDisks2)
    ids:
     class: 'device'
     unix-device: '/dev/fd0'
    themed icons:  [media-floppy]  [media]
    symbolic themed icons:  [media-floppy-symbolic]  [media-symbolic]  [media-floppy]  [media]
    can_mount=1
    can_eject=0
    should_automount=0
    sort_key=gvfs.time_detected_usec.1566806451482782
Drive(2): QEMU DVD-ROM
  Type: GProxyDrive (GProxyVolumeMonitorUDisks2)
  ids:
   unix-device: '/dev/sr0'
  themed icons:  [drive-optical]  [drive]
  symbolic themed icons:  [drive-optical-symbolic]  [drive-symbolic]  [drive-optical]  [drive]
  is_media_removable=1
  has_media=0
  is_media_check_automatic=1
  can_poll_for_media=0
  can_eject=1
  can_start=0
  can_stop=0
  start_stop_type=shutdown
  sort_key=00coldplug/11removable/sr0
android-808 commented 5 years ago

Graphics, sounds, translations debs are in mirrors.

I'm wondering if it is a config. H-fm never shows /home/user for example. It only shows /home/user/Mydocs. I think my gtk3 work used stock file manager so I can't say I noticed back then. It might also explain some of the theme changing issues

android-808 commented 5 years ago

What about if it's enumerating devices on file manager from 1 instead of 0?

MerlijnWajer commented 5 years ago

It might also only look for GProxyVolume. Not sure, will need to dig in a bit more, but don't have time right now.

MerlijnWajer commented 5 years ago

Something I noticed when starting it manually:

hildon-fm-WARNING **: Cannot create "gnome-vfs" backend
hildon-fm-WARNING **: Failed to create monitor for path file:///home/user/MyDocs/.camera

First line might also be related.

MerlijnWajer commented 5 years ago

My bet is @freemangordon might know more.

android-808 commented 5 years ago

What command did you use to start it? If I do just drnoksnes romname it segfaults straight away.

I was going to fmg might know

MerlijnWajer commented 5 years ago

I started it from the menu and then used ps xua | grep nok to find out how it was started. Just mimick that, so:

/usr/bin/drnoksnes_startup /usr/share/games/drnoksnes/drnoksnes.conf

android-808 commented 5 years ago

Ok. I think it's a standard structure for osso-games-startup based titles then. Seen similar to that for Mahjong

MerlijnWajer commented 5 years ago

I changed gui/plugin.c and called set_rom("...") with the right path there after it closed the file dialog, and then the rom gets set/loaded. Pressing 'Play' brings a window up but it closes almost right away. I'll set up libxsp, that might be the problem.

MerlijnWajer commented 5 years ago

This might be a problem in the port you did:

(gdb) bt
#0  memset32 () at misc_i386.s:7
#1  0x00005555555b21f0 in S9xUpdateScreen () at gfx.cpp:3699
#2  0x00005555555bddd3 in FLUSH_REDRAW () at ppu.h:283
#3  S9xSetPPU (Byte=<optimized out>, Address=<optimized out>) at ppu.cpp:160
#4  0x000055555557762a in S9xMainLoop () at cpuexec.cpp:128
#5  0x000055555556c55d in main (argc=<optimized out>, argv=<optimized out>) at platform/sdl.cpp:265
MerlijnWajer commented 5 years ago

So, to summarise: there is the libhildonfm issue where it doesn't allow you to pick a rom. And when you pick one, and then start drnoksnes, it segfaults as above, in some handwritten assembly. Probably since it doesn't expect to be running in amd64.

MerlijnWajer commented 5 years ago

Briefly tried to make it work on the n900, added armhf to makefile. Doesn't quite work, but could be my changes:

user@n900devuan:~/roms$ gdb --args drnoksnes Donkey\ Kong\ Country\ \(U\)\ \(V1.2\)\ \[\!\].zip
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from drnoksnes...Reading symbols from /usr/lib/debug//usr/games/drnoksnes...done.
done.
(gdb) r
Starting program: /usr/bin/drnoksnes Donkey\ Kong\ Country\ \(U\)\ \(V1.2\)\ \[\!\].zip
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
Cannot open config file /home/user/.config/drnoksnes.conf
Video: 256x239 (800x424 output), 16 bits per pixel, windowed, HAA square screen scaling
[New Thread 0xb1970320 (LWP 16463)]
[Thread 0xb1970320 (LWP 16463) exited]
[New Thread 0xb1970320 (LWP 16464)]
Audio: 22050 Hz, 2 channels, 16 bits, 256 samples in buffer
Input: Nothing
ROM: Donkey Kong Country (U) (V1.2) [!].zip
No ROM file header found.
"DONKEY KONG COUNTRY" [checksum ok] HiROM, 32Mbits, Type: ROM+RAM+BAT, Mode: 21, TV: NTSC, S-RAM: 2Kb, ROMId: 8X   Company: 01
SRAM: Donkey Kong Country (U) (V1.2) [!].srm
Hacks: disabled

Thread 1 "drnoksnes" received signal SIGSEGV, Segmentation fault.
_dl_fixup (l=0xb6fff960, reloc_arg=4284932088) at dl-runtime.c:74
74      dl-runtime.c: No such file or directory.
(gdb) bt
#0  _dl_fixup (l=0xb6fff960, reloc_arg=4284932088) at dl-runtime.c:74
#1  0xb6fe6e9c in _dl_runtime_resolve () at ../sysdeps/arm/dl-trampoline.S:57
#2  0x004afd08 in unzlocal_GetCurrentFileInfoInternal (file=0x4c9000, pfile_info=0x2,
    pfile_info_internal=0x0, szFileName=<optimized out>, fileNameBufferSize=0,
    extraField=0xb6a5b27c, extraFieldBufferSize=0,
    szComment=0xb6fffb18 "\274\372\377\266", commentBufferSize=3070228832) at unzip.c:719
#3  0x000280a8 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) q

Let's perhaps try to get the other stuff in first, and then look at emulator specific bugs.

MerlijnWajer commented 5 years ago

So, on my n900 in the "ROM" dialog, I get "boot" (/boot) and I can browse it. I wonder if the problem just is that the root partition/mount is not showing up.

android-808 commented 5 years ago

.camera, images, .sounds, .videos, .documents are the original directories in MyDocs. I've added all of them because I didn't have them in my image. I tried your set_rom trick and now everytime I click on the ROM button I get an actual file list, with the correct image for each folder specified above. I don't know if its because of the faked set_rom call or because I added the directories. Open from top menu still shows as my pictures above.

There is definately an issue in libhildonfm though as using the add button when trying to change desktop background you get the same options as you do from the top menu in DrNokSnes.

Some progress. I've added a misc_amd64.c file and modified the Makefile at the top. The misc_amd64.c is just a really basic version of memset and memcpy. I had to disable accurate graphics, sound and scaling and it sometimes locks everything up but it does load the ROM (SM All Stars + Lost Worlds). You can run and jump but returning to drnoksnes startup screen locks everything up.

https://github.com/android-808/drnoksnes/blob/675ccc95147a675be59e5c03fe9971e072b54e73/Makefile#L27 xsp and sdlhaa are actually used after all in default config

edit: looking at your output haa is being used though

android-808 commented 5 years ago

I've found a more recent version in garage that has some amd64 work. I might delete my repo, then incorporate my changes into that one.

android-808 commented 5 years ago

The https://github.com/android-808/drnoksnes repo now has all of the work I've done, plus the other changes from https://garage.maemo.org/plugins/ggit/browse.php/?p=drnoksnes;a=shortlog, including history. Probably easier/better ways but its done.

I have renamed the previous repo drnoksnes repo to https://github.com/android-808/drnoksnes-extrasrepo.

I have working audio, graphics, game is playable and I can return to the launcher under the condition that accurate graphics and scaling are turned off. Turned on they result in similar result to before, crash back to launcher after a green screen. Speed hacks cause audio to stop working and switching back to launcher results in a crash.

MerlijnWajer commented 4 years ago

I don't know how I missed this last message. So sorry.

I'm going to work on importing osso-games-startup, and then let's work on getting the various games in.

MerlijnWajer commented 4 years ago

So I am importing and building osso-games-startup now and it looks like it worked:

https://phoenix.maemo.org/job/osso-games-startup-binaries/architecture=amd64,label=amd64/1/console

So it's now in the Leste repos. Can you help me split up this ticket into various tickets?

I assume there should be a ticked for importing each game, and dependencies for the games can go in the same ticket.

Then there's fixing bugs - like the dialog for opening roms, save state loading, etc.

Eventually I think we'll have this end up in a different debian repo component (extras), but now we can just have them in our main debian repo and our main Leste repo until we find the time.

cc @parazyd

MerlijnWajer commented 4 years ago

osso-games-startup repo here: https://github.com/maemo-leste/osso-games-startup

hildon-games-wrapper repo here: https://github.com/maemo-leste/hildon-games-wrapper

Also in debian repo now: https://phoenix.maemo.org/job/hildon-games-wrapper-binaries/architecture=amd64,label=amd64/1/console

MerlijnWajer commented 4 years ago

I think all that we need to import (even though it might be buggy) mahjong and marbles are the graphics packages. Are those in a similar state to translations? E.g. if they are hosted on maemo.org, it's probably fine?

cc @freemangordon

MerlijnWajer commented 4 years ago

@android-808 - I think with the right SDL patches this should work - no?

brainparty

MerlijnWajer commented 4 years ago

Added some notes here for brainparty - https://leste.maemo.org/Games/Brainparty

Also required fixing/building sdlgles from sdlhildon:

sdlhildon/sdlgles# git diff
diff --git a/sdlgles/debian/control b/sdlgles/debian/control
index e2e08de..37d9de2 100644
--- a/sdlgles/debian/control
+++ b/sdlgles/debian/control
@@ -17,7 +17,7 @@ Description: OpenGL|ES library for Simple DirectMedia Layer 1.2
 Package: libsdl-gles1.2-dev
 Section: libdevel
 Architecture: any
-Depends: libsdl-gles1.2-1 (= ${Source-Version})
+Depends: libsdl-gles1.2-1 (= ${source:Version})
 Description: development files for OpenGL|ES library for SDL 1.2
  This is a simple library that allows you to use OpenGL|ES (1.1 or 2.0) calls
  in your SDL applications, hiding the EGL surface creation from you.
diff --git a/sdlgles/src/Makefile b/sdlgles/src/Makefile
index d8ad8b7..084ed08 100644
--- a/sdlgles/src/Makefile
+++ b/sdlgles/src/Makefile
@@ -1,7 +1,8 @@
 PREFIX:=$(shell sdl-config --prefix)
-CFLAGS:=-g -O0 -Wall -Wextra
+CFLAGS:=-g -O2 -Wall -Wextra

 CC:=gcc
+LIBTOOL=libtool

 RELEASE:=1.2
 VERSION:=0:1:0
android-808 commented 4 years ago

Merry Christmas

I think I did start to add separate issues for some of the games. I haven't done much since the last commits as I don't have the best attention span at the moment.

Taking a quick look at the brainparty bits you've posted, Hildon-games-wrapper and osso-games-startup aren't needed for it. The fact that it renders that way makes me think it should be okay if it goes to full screen correctly as it appears to have rotated viewport as opposed to requiring orientation change.

Regarding GL(ES) support, I did once write a small patch package to dpkg-divert original GL headers and use sed to add some changes that were defined in the QT4 package, like GL_TEXTURE_2D params int/unsigned int causes error. Aim was to remove some of the quirks of the existing set. The change you had to do to the library name I had to do for SDL2 on Fremantle if I recall. It also wouldn't build GLES1 and GLES2 support at the same time.

I'll try to look over the holidays. Current list of tasks are trying to get build environment set up to update repo version of ScummVM for Fremantle, look at initial port of rockbox.