Skip to content
This repository has been archived by the owner on Nov 21, 2020. It is now read-only.

Commit

Permalink
Tiny GTA Text optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
dd86k committed Jun 2, 2019
1 parent 73a7b01 commit 5758c17
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/audio/mp3.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void scan_mp3(uint32_t sig, int id3) {
"MPEG-%c Audio Layer %s (MP3) audio, %s Hz, %s kbps, %s",
v, l, f, b, c
);
if (ci == 1) {
if (ci == 1) { // joint stereo audio
if (h.extra & 0x20)
printf(" +intensity");
if (h.extra & 0x10)
Expand Down
27 changes: 14 additions & 13 deletions src/ff.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void scan(int *error) {
*error = 4;
return;
}

char *r;

switch (s) {
Expand Down Expand Up @@ -147,23 +147,24 @@ void scan(int *error) {
return;

case 0x454C4247: // "GBLE"
r = "English";
goto GTA_TEXT;
case 0x464C4247: // "GBLF"
r = "French";
goto GTA_TEXT;
case 0x474C4247: // "GBLG"
r = "German";
goto GTA_TEXT;
case 0x494C4247: // "GBLI"
r = "Italian";
goto GTA_TEXT;
case 0x534C4247: // "GBLS"
case 0x4A4C4247: { // "GBLJ"
char *r;
switch (s) {
case 0x454C4247: r = "English"; break; // 'E'
case 0x464C4247: r = "French"; break; // 'F'
case 0x474C4247: r = "German"; break; // 'G'
case 0x494C4247: r = "Italian"; break; // 'I'
case 0x534C4247: r = "Spanish"; break; // 'S'
case 0x4A4C4247: r = "Japanese"; break; // 'J'
}
reportf("GTA Text (GTA2+) in %s\n", r);
r = "Spanish";
goto GTA_TEXT;
case 0x4A4C4247: // "GBLJ"
r = "Japanese";
GTA_TEXT: reportf("GTA Text (GTA2+) in %s\n", r);
return;
}

case 0x47585432: { // "2TXG", big endian
_ddread(&s, 4);
Expand Down

0 comments on commit 5758c17

Please # to comment.