binji/binjgb

Segmentation fault when trying to run on OSX

aconbere opened this issue · 7 comments

[anders/fix_compile_errors_on_osx] % ./bin/binjgb ~/Projects/blarggs-tests/cpu_instrs/source/test.gb
title: ""
cgb flag: CGB_FLAG_SUPPORTED
sgb flag: SGB_FLAG_NONE
cart type: CART_TYPE_MBC1
rom size: ROM_SIZE_32K
ext ram size: EXT_RAM_SIZE_NONE
header checksum: 0x66 [OK]
GL_VERTEX_SHADER ERROR: ERROR: 0:1: '' :  version '130' is not supported
ERROR: 0:2: '' :  #version required and missing.
ERROR: 0:2: 'attribute' : syntax error: syntax error

zsh: segmentation fault  ./bin/binjgb ~/Projects/blarggs-tests/cpu_instrs/source/test.gb

It appears to originate in the hard coding of the GL_VERTEX_SHADER version: https://github.com/binji/binjgb/blob/master/src/host-ui-imgui.cc#L116

However bumping that to version 150 which I believe is the current version available on my machine moves the error to an attribute syntax error:

GL_VERTEX_SHADER ERROR: ERROR: 0:2: 'attribute' : syntax error: syntax error
binji commented

Does #17 fix this for you?

Ha, I was just testing this morning. I think there's one more bug where texture2D is deprecated (now called just texture). But with that change it now runs.

Window is a bit oddly sized, but maybe that's expected?

screen shot 2018-11-14 at 9 02 40 am

3a1c729 fixes the issue :)

binji commented

Hm, weird. I wonder if it has to do with using SDLWINDOW_HIGHDPI in the window creation call.

binji commented

Yep, seems to. I tested on my Mac laptop, this change should fix it!

@binji Works! And now in debug mode I actually get all the debug tools :)

The funny thing about all of this is I ended up here following a lead in a reddit comment (from you) saying that your emulator had good instruction logging. I'm trying to get a personal emulator over the finish line where there's a bug in some instruction and I just can't quite figure out which one. Whatever it is prevents a successful from of blargg's test suite and so I'm a bit stumped.

What I've got now is a way to run my emulator against a file that tracks known good register states and will compare its incremental state to those and log when it differs so that I can dig into exactly where it goes off the rails.

Anyway, appreciate how quickly you've been responding here, and I've nearly got my state file built from your emulator :)

binji commented

Awesome, glad I can help. As you probably noticed, I don't really work on this much anymore. But it's always nice to have people show interest :-)

Gonna close this issue, since it seems MacOS is working well now.