After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 777777 - Game Boy games not detected
Game Boy games not detected
Status: RESOLVED FIXED
Product: gnome-games
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME Games maintainers
GNOME Games maintainers
Depends on:
Blocks:
 
 
Reported: 2017-01-26 08:46 UTC by Adrien Plazas
Modified: 2017-02-22 20:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
nes: Check magic value as raw data (1.74 KB, patch)
2017-01-26 09:03 UTC, Adrien Plazas
none Details | Review
utils: Add DataInputStream (1.57 KB, patch)
2017-01-26 09:05 UTC, Adrien Plazas
committed Details | Review
nes: Check magic value as raw data (1.74 KB, patch)
2017-01-26 09:05 UTC, Adrien Plazas
committed Details | Review
Remove DataInputStream and Game Boy magic check (3.59 KB, patch)
2017-01-26 11:05 UTC, Adrien Plazas
committed Details | Review

Description Adrien Plazas 2017-01-26 08:46:44 UTC
To check if a game is a Game Boy game we first look for some magic value in the header of the game file. We compare the magic value and the file's content as if they were strings, though it may not work because the magic value contains the 0 value.

Comparing them as raw data fields should work.
Comment 1 Adrien Plazas 2017-01-26 09:03:15 UTC
Created attachment 344292 [details] [review]
nes: Check magic value as raw data

Use DataInputStream instead of StringInputStream to check the Game Boy
magic value.

This fixes the magic value being incorrectly not found in a valid game
file.
Comment 2 Adrien Plazas 2017-01-26 09:05:29 UTC
Created attachment 344293 [details] [review]
utils: Add DataInputStream

This will be used in the next commit to check if some data is in an
input stream.
Comment 3 Adrien Plazas 2017-01-26 09:05:34 UTC
Created attachment 344294 [details] [review]
nes: Check magic value as raw data

Use DataInputStream instead of StringInputStream to check the Game Boy
magic value.

This fixes the magic value being incorrectly not found in a valid game
file.
Comment 4 Adrien Plazas 2017-01-26 09:06:09 UTC
Attachment 344293 [details] pushed as 824eefd - utils: Add DataInputStream
Attachment 344294 [details] pushed as 536c7ed - nes: Check magic value as raw data
Comment 5 Adrien Plazas 2017-01-26 11:05:44 UTC
Created attachment 344303 [details] [review]
Remove DataInputStream and Game Boy magic check

DataInputStream has been added in the previous commit to help fix a bug
in the GameBoyHeader, though it broke the compilation: it clashed with
Glib.DataInputStream.

Remove DataInputStream and don't check the Game Boy header as it's
already done by shared-mime-info.

This fixes compilation and makes the code simpler.
Comment 6 Adrien Plazas 2017-01-26 11:06:35 UTC
Comment on attachment 344303 [details] [review]
Remove DataInputStream and Game Boy magic check

Attachment 344303 [details] pushed as f783f90 - Remove DataInputStream and Game Boy magic check
Comment 7 Michael Catanzaro 2017-02-22 20:40:19 UTC
Not the right way to spend bug #777777. :(
Comment 8 Adrien Plazas 2017-02-22 20:41:56 UTC
I didn't demand it. :|
Comment 9 Adrien Plazas 2017-02-22 20:48:43 UTC
And Michael, https://wiki.gnome.org/Initiatives/EveryDetailMatters :)