Sonic and Sega Retro Message Board: Bug Found in GYM Logging - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
Loading News Feed...
 
Page 1 of 1

Bug Found in GYM Logging

#1 User is offline saxman 

Posted 02 November 2011 - 07:53 AM

  • S2HD Staff - Tools & Assistant Programmer
  • Posts: 2582
  • Joined: 08-April 04
  • Gender:Male
  • Location:United States of America
  • Project:http://www.youtube.com/watch?v=oSkQoKRovEk
  • Wiki edits:136
I found a bug when trying to log some GYM files in Gens/GS. Every time 0x0D is written to a channel, an 0x0A byte is inserted immediately after it. Obviously this isn't supposed to happen inside GYM files. I just thought I'd pass this along.

#2 User is online Andlabs 

Posted 02 November 2011 - 09:05 AM

  • 「いっきまーす」
  • Posts: 2070
  • Joined: 11-July 08
  • Gender:Male
  • Project:Writing my own MD/Genesis sound driver :D
  • Wiki edits:7,061
lol windows line endings

Gens/GS II right now doesn't have any audio logging, but IMHO when it does it should be VGM...

EDIT FOUND IT
If you want to fix it in a pirvate source code build, go to src/gens/util/sound/gym.cpp and change line 97 to read
         GYM_File = fopen(filename, "wb");
.
This post has been edited by Andlabs: 02 November 2011 - 09:11 AM

#3 User is offline LOst 

Posted 03 November 2011 - 07:51 PM

  • Sonic 2 HD - Lead Programmer
  • Posts: 4877
  • Joined: 10-January 03
  • Gender:Male
  • Wiki edits:2
Must be using fopen() with "wt" (write text) instead of "wb" (write binary). Very common mistake.
This post has been edited by LOst: 03 November 2011 - 07:51 PM

#4 User is offline Sik 

Posted 04 November 2011 - 01:28 PM

  • Sik is pronounced as "seek", not as "sick".
  • Posts: 6719
  • Joined: 17-March 06
  • Gender:Male
  • Project:being an asshole =P
  • Wiki edits:11

View PostLOst, on 03 November 2011 - 07:51 PM, said:

Must be using fopen() with "wt" (write text) instead of "wb" (write binary). Very common mistake.
Nobody uses "wt", most likely the code is using "w", which defaults to "write-only text file". This issue never pops up in *nix since text and binary files are pretty much the same, it's an issue for Windows mainly.

Page 1 of 1
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users