<commit_before>Gametable
--------
Offset to the game table lies at '0x0010'

Example from WWW Bauernhof

0001703d  0c 00 00 00 71 70 01 00  35 7a 01 00 91 7f 01 00
          aa aa aa aa bb bb bb bb  bb bb bb bb bb bb bb bb
0001704d  cd 82 01 00 59 8a 01 00  e7 8e 01 00 4f 97 01 00 
          bb bb bb bb bb bb bb bb  bb bb bb bb bb bb bb bb
0001705d  0f 9f 01 00 c7 9f 01 00  69 a1 01 00 69 ad 01 00 
          bb bb bb bb bb bb bb bb  bb bb bb bb bb bb bb bb
0001706d  fb b2 01 00 
          bb bb bb bb

a = 32 bit counter (number of games)
b = a * 32 bit pointer to game header

Game Header
-----------
00017071  01 00 0b 00 05 00 00 00  04 00 81 05 00 00 6f 00
          aa aa bb bb rr rr cc cc  zz zz yy yy xx xx ww ww   
00017081  de 00 97 76 01 00 a9 76  01 00 ab 76 01 00 ad 76 
          vv vv dd dd dd dd dd dd  dd dd dd dd dd dd dd dd
00017091  01 00 b9 76 01 00 ff 70  01 00 83 71 01 00 05 72
          dd dd dd dd dd dd ee ee  ee ee ee ee ee ee ee ee
000170a1  01 00 87 72 01 00 09 73  01 00 8b 73 01 00 0d 74
          ee ee ee ee ee ee ee ee  ee ee ee ee ee ee ee ee
000170b1  01 00 8f 74 01 00 11 75  01 00 93 75 01 00 15 76 
          ee ee ee ee ee ee ee ee  ee ee ee ee ee ee ee ee
000170c1  01 00 03 00 00 00 00 00  00 00 00 00 00 00 00 00
          ee ee uu uu uu uu uu uu  uu uu uu uu uu uu uu uu
000170d1  00 00 00 00 00 00 c5 76  01 00 d3 76 01 00 e1 76
          uu uu uu uu uu uu gg gg  gg gg gg gg gg gg gg gg
000170e1  01 00 e3 76 01 00 e5 76  01 00 e7 76 01 00 e9 76 
          gg gg gg gg gg gg gg gg  gg gg gg gg gg gg gg gg
000170f1  01 00 eb 76 01 00 ed 76  01 00 ef 76 01 00 
          gg gg gg gg gg gg gg gg  gg gg gg gg gg gg
a = 16 bit type (type 253 is special see below)
b = 16 bit count: number of subgame blocks
r = 16 bit number of rounds to play in this game
c = 16 bit count (if type == 6) followed by c*16bit; (if type != 6) c=0 or c=1 followed by additional 16bit 0 
z = 16 bit: number of rounds to start with the "pre next round" sound, after that play the "last round" sound  
y = 16 bit: this defines the OID that triggers the "repeat last audio" action
x = 16 bit unknown
w = 16 bit unknown (111 in all Bauernhof games)
v = 16 bit unknown, sometimes v=2*w (222 in all Bauernhof games)
d = 5 (if type != 6) or 7 (if type == 6) * 32 bit pointer to playlistpointer (where is the count from? So far found in every block) 
e = b * 32 bit pointer to subgame blocks 
f = c * 32 bit pointer to subgame blocks (not existant in this example game)
u = 10 (this seems hardcoded) * 16 bit. For each playlist in the playlistlist g f contains a 16 bit value. At the end of the game f is checked from left to right. Each number in f is compared against the number of correct answers that the player has achieved throughout the game. The first number in f that i < that the number of correct answers defined the playlist to be played. This list must be ordered in descending order. Example: When this list looks like 5,3,1,0,0,0,0,0,0,0 this means: if the player hat 5 or more correct answers, the first playlist of g is played, when the player has 3 or 4 correct answers, the second playlist is played, if he has at least one correct answer, playlist 3 get played else playlist 4.      
g = 10 (this seems hardcoded) * 32 bit pointer to playlistpointer

now it differs on type 
if ( type == 6 )
          1 * 32 bit pointer to playlist
if ( type == 7 )
          1 * 32 bit pointer to playlistpointer
if ( type == 8 )
          1 * 32 bit pointer to oidlist
          1 * 32 bit pointer to gameidlist
          2 * 32 bit pointer to playlistpointer
if ( type == 9 )
          75 * 32 bit pointer to playlistpointer
if ( type == 10 )
          1 * 32 bit pointer to playlistpointer
if ( type == 16 )
          1 * 32 bit pointer to oidlist
          3 * 32 bit pointer to playlistpointer
nothing for other types
end of block

type 253
--------

Type 253 is special and only consists of the value 0x00fd. It is supposed that this is some kind of (additional) "end of games" marker although this is redundant because the number of games can be found in the game table, too.
[In an earlier version of this document it was noted that the playlistpointer for the power on sound that directly follows the 0x00fd belongs to this game. But as this playlistpointer is referenced in the header (0x0071) this seems wrong now.]

Subgameblock
------
000170ff  00 00 00 00 00 00 01 00  01 00 00 00 00 00 00 00 
0001710f  00 00 00 00 02 00 8e 05  9f 05 00 00 21 00 79 05 
                      aa aa bb bb  bb bb cc cc ee ee ff ff
0001711f  7a 05 7b 05 7c 05 7d 05  83 05 84 05 85 05 86 05
          ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
0001712f  87 05 88 05 89 05 8a 05  8b 05 8c 05 8d 05 8e 05 
          ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
0001713f  8f 05 90 05 91 05 92 05  93 05 94 05 95 05 96 05 
          ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
0001714f  97 05 98 05 99 05 9a 05  9b 05 9c 05 9e 05 9f 05 
          ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
0001715f  f1 76 01 00 fd 76 01 00  07 77 01 00 09 77 01 00
          gg gg gg gg gg gg gg gg  gg gg gg gg gg gg gg gg
0001716f  13 77 01 00 15 77 01 00  1f 77 01 00 29 77 01 00 
          gg gg gg gg gg gg gg gg  gg gg gg gg gg gg gg gg
0001717f  33 77 01 00 
          gg gg gg gg

unknown = 20 byte
a = 16 bit count
b = a * 16bit oids
c = 16 bit count
d = c * 16 bit oid
e = 16 bit count
f = c * 16 bit oid
g = 9 (where is the count from? so far 9 in every block) * 32 bit pointer to playlistpointer

Playlistpointer
------
000176f1 01 00 f7 76 01 00 
         aa aa bb bb bb bb
         
a = 16 bit count (can be zero than no b is present)
b = a * 32 bit pointer to playlist

Playlist
------
000176f7 02 00 b3 01 ba 01
         aa aa bb bb bb bb

a = 16 bit count
b = a * 16 bit id of media to be played

oidlist
------
no live example sry can search for one

Example:
          03 00 b2 06 b3 06 b4 06
          aa aa bb bb bb bb bb bb
a = 16 bit count
b = a * 16 bit oids

gameidlist
------
no live example sry can search for one

Example:
          03 00 0a 00 0b 00 0c 00
          aa aa bb bb bb bb bb bb
a = 16 bit count
b = a * 16 bit game ids

<commit_msg>adapted structe names to the ones decode.hs uses; fixed description of u in game header<commit_after>game table
----------
Offset to the game table lies at '0x0010'

Example from WWW Bauernhof

0001703d  0c 00 00 00 71 70 01 00  35 7a 01 00 91 7f 01 00
          aa aa aa aa bb bb bb bb  bb bb bb bb bb bb bb bb
0001704d  cd 82 01 00 59 8a 01 00  e7 8e 01 00 4f 97 01 00 
          bb bb bb bb bb bb bb bb  bb bb bb bb bb bb bb bb
0001705d  0f 9f 01 00 c7 9f 01 00  69 a1 01 00 69 ad 01 00 
          bb bb bb bb bb bb bb bb  bb bb bb bb bb bb bb bb
0001706d  fb b2 01 00 
          bb bb bb bb

a = 32 bit counter (number of games)
b = a * 32 bit pointer to game header

game header
-----------
00017071  01 00 0b 00 05 00 00 00  04 00 81 05 00 00 6f 00
          aa aa bb bb rr rr cc cc  zz zz yy yy xx xx ww ww   
00017081  de 00 97 76 01 00 a9 76  01 00 ab 76 01 00 ad 76 
          vv vv dd dd dd dd dd dd  dd dd dd dd dd dd dd dd
00017091  01 00 b9 76 01 00 ff 70  01 00 83 71 01 00 05 72
          dd dd dd dd dd dd ee ee  ee ee ee ee ee ee ee ee
000170a1  01 00 87 72 01 00 09 73  01 00 8b 73 01 00 0d 74
          ee ee ee ee ee ee ee ee  ee ee ee ee ee ee ee ee
000170b1  01 00 8f 74 01 00 11 75  01 00 93 75 01 00 15 76 
          ee ee ee ee ee ee ee ee  ee ee ee ee ee ee ee ee
000170c1  01 00 03 00 00 00 00 00  00 00 00 00 00 00 00 00
          ee ee uu uu uu uu uu uu  uu uu uu uu uu uu uu uu
000170d1  00 00 00 00 00 00 c5 76  01 00 d3 76 01 00 e1 76
          uu uu uu uu uu uu gg gg  gg gg gg gg gg gg gg gg
000170e1  01 00 e3 76 01 00 e5 76  01 00 e7 76 01 00 e9 76 
          gg gg gg gg gg gg gg gg  gg gg gg gg gg gg gg gg
000170f1  01 00 eb 76 01 00 ed 76  01 00 ef 76 01 00 
          gg gg gg gg gg gg gg gg  gg gg gg gg gg gg
a = 16 bit type (type 253 is special see below)
b = 16 bit count: number of subgame blocks
r = 16 bit number of rounds to play in this game
c = 16 bit count (if type == 6) followed by c*16bit; (if type != 6) c=0 or c=1 followed by additional 16bit 0 
z = 16 bit: number of rounds to start with the "pre next round" sound, after that play the "last round" sound  
y = 16 bit: this defines the OID that triggers the "repeat last audio" action
x = 16 bit unknown
w = 16 bit unknown (111 in all Bauernhof games)
v = 16 bit unknown, sometimes v=2*w (222 in all Bauernhof games)
d = 5 (if type != 6) or 7 (if type == 6) * 32 bit pointer to playlistlist (where is the count from? So far found in every block) 
e = b * 32 bit pointer to subgame  
f = c * 32 bit pointer to subgame (not existant in this example game)
u = 10 (this seems hardcoded) * 16 bit. For each playlist in the playlistlist g u contains a 16 bit value. At the end of the game u is checked from left to right. Each number in u is compared against the number of correct answers that the player has achieved throughout the game. The first number in u that is <= the number of correct answers defines the playlist to be played. u must be ordered in descending order. Example: When u looks like [5,3,1,0,0,0,0,0,0,0] this means: if the player has 5 or more correct answers, the first playlist of g is played, when the player has 3 or 4 correct answers, the second playlist is played, if he has at least one correct answer, playlist 3 is played else playlist 4.  g = 10 (this seems hardcoded) * 32 bit pointer to playlistlist

now it differs on type 
if ( type == 6 )
          1 * 32 bit pointer to playlist
if ( type == 7 )
          1 * 32 bit pointer to playlistlist
if ( type == 8 )
          1 * 32 bit pointer to oidlist
          1 * 32 bit pointer to gameidlist
          2 * 32 bit pointer to playlistlist
if ( type == 9 )
          75 * 32 bit pointer to playlistlist
if ( type == 10 )
          1 * 32 bit pointer to playlistlist
if ( type == 16 )
          1 * 32 bit pointer to oidlist
          3 * 32 bit pointer to playlistlist
nothing for other types
end of block

type 253
--------

Type 253 is special and only consists of the value 0x00fd. It is supposed that this is some kind of (additional) "end of games" marker although this is redundant because the number of games can be found in the game table, too.
[In an earlier version of this document it was noted that the playlistlist for the power on sound that directly follows the 0x00fd belongs to this game. But as this playlistlist is referenced in the header (0x0071) this seems wrong now.]

subgame
-------
000170ff  00 00 00 00 00 00 01 00  01 00 00 00 00 00 00 00 
0001710f  00 00 00 00 02 00 8e 05  9f 05 00 00 21 00 79 05 
                      aa aa bb bb  bb bb cc cc ee ee ff ff
0001711f  7a 05 7b 05 7c 05 7d 05  83 05 84 05 85 05 86 05
          ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
0001712f  87 05 88 05 89 05 8a 05  8b 05 8c 05 8d 05 8e 05 
          ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
0001713f  8f 05 90 05 91 05 92 05  93 05 94 05 95 05 96 05 
          ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
0001714f  97 05 98 05 99 05 9a 05  9b 05 9c 05 9e 05 9f 05 
          ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
0001715f  f1 76 01 00 fd 76 01 00  07 77 01 00 09 77 01 00
          gg gg gg gg gg gg gg gg  gg gg gg gg gg gg gg gg
0001716f  13 77 01 00 15 77 01 00  1f 77 01 00 29 77 01 00 
          gg gg gg gg gg gg gg gg  gg gg gg gg gg gg gg gg
0001717f  33 77 01 00 
          gg gg gg gg

unknown = 20 byte
a = 16 bit count
b = a * 16bit oids : OIDs that must be pointed at for the correct answer 
c = 16 bit count
d = c * 16 bit oid : unknown
e = 16 bit count
f = c * 16 bit oid : OIDs of the page the game belongs to. Pointing at an OID that is not contained in this list results in a sound being played that tells you to flip back to the right page (4th playlist in g) 
g = 9 (seems hardcoded) * 32 bit pointer to playlistlist

playlistlist
------------
000176f1 01 00 f7 76 01 00 
         aa aa bb bb bb bb
         
a = 16 bit count (can be zero than no b is present)
b = a * 32 bit pointer to playlist

playlist
--------
000176f7 02 00 b3 01 ba 01
         aa aa bb bb bb bb

a = 16 bit count
b = a * 16 bit id of media to be played

oidlist
--------
no live example sry can search for one

Example:
          03 00 b2 06 b3 06 b4 06
          aa aa bb bb bb bb bb bb
a = 16 bit count
b = a * 16 bit oids

gameidlist
----------
no live example sry can search for one

Example:
          03 00 0a 00 0b 00 0c 00
          aa aa bb bb bb bb bb bb
a = 16 bit count
b = a * 16 bit game ids


{'fraction_non_alphanumeric': 0.03935386808139995, 'fraction_numerical': 0.15329796500118775, 'mean_word_length': 2.1386679920477136, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3898178', 'n_tokens_mistral': 6357, 'n_tokens_neox': 4272, 'n_words': 2719}