Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debug=1 command-line parameter has no effect #5

Open
ghost opened this issue Dec 22, 2018 · 2 comments
Open

debug=1 command-line parameter has no effect #5

ghost opened this issue Dec 22, 2018 · 2 comments

Comments

@ghost
Copy link

ghost commented Dec 22, 2018

The usage suggests appending debug=1 to the command-line:

$ LD_LIBRARY_PATH=. ./gameboy 
usage: ./gameboy <rom> [bootrom=0] [speed_limit=0] [debug=1] [stdout=0]

However, the emulator still reports that DEBUG=0:

$ LD_LIBRARY_PATH=. ./gameboy wario_walking.gb debug=1
BOOTROM=0
DEBUG=0
SPEED_LIMIT=1
STDOUT=0
    0.000, GB starting...
    0.000, reset ok, waiting for GL...
@krocki
Copy link
Owner

krocki commented Dec 22, 2018

when DEBUG is set to TRUE, it sets the internal global variable gl_debug to 1, which may be used to print some debugging information. See main_lcd.c lines 182-186:

while (gl_ok) {
         if (gl_debug) { /* put any debugging stuff here */ }
         next_frame();
         if (serial) check_stdout();
    }

@ghost
Copy link
Author

ghost commented Dec 22, 2018

The code:

printf("usage: ./gameboy <rom> [bootrom=%d] [speed_limit=%d] [debug=%d] [stdout=%d]\n",
               BOOTROM, gl_debug, limit_speed, serial);

has gl_debug and limit_speed in the wrong position.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant