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

builds and runs on osx #62

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
scripts/startup_local*
.DS_Store

8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,14 @@ Manic Miner running on GoSpeccy.
* Add more filters and improve the scaler
* Add new graphical backends (Go's exp/draw?)

# osx notes
The SDL usage needs X11 because the Quartz implementation is picky about how threads are used (you need to poll events on the main thread or it throws an exception.)
Getting a sdl installed in osx which supports x11 is not that simple though because the bottled versions seem to exclude X11. The following worked for me.

brew install -vd --build-from-source sdl --with-x11 --with-test
brew install sdl_image sdl_ttf sdl_mixer


# Credits

* Thanks to [⚛](http://github.com/0xe2-0x9a-0x9b) for giving a new
Expand Down
11 changes: 6 additions & 5 deletions src/output/sdl/sdl.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build linux freebsd
// +build linux freebsd darwin

// GoSpeccy SDL interface (audio&video output, keyboard input)
package sdl_output
Expand All @@ -8,14 +8,15 @@ import (
"errors"
"flag"
"fmt"
"github.com/scottferg/Go-SDL/sdl"
"github.com/scottferg/Go-SDL/ttf"
"reflect"
"sync"

"github.com/remogatto/clingon"
"github.com/remogatto/gospeccy/src/env"
"github.com/remogatto/gospeccy/src/interpreter"
"github.com/remogatto/gospeccy/src/spectrum"
"reflect"
"sync"
"github.com/scottferg/Go-SDL/sdl"
"github.com/scottferg/Go-SDL/ttf"
)

const DEFAULT_JOYSTICK_ID = 0
Expand Down
7 changes: 4 additions & 3 deletions src/output/sdl/sdl_compositing.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@
* except for usages in immoral contexts.
*/

// +build linux freebsd
// +build linux freebsd darwin

package sdl_output

import (
"github.com/scottferg/Go-SDL/sdl"
"github.com/remogatto/gospeccy/src/spectrum"
"math/rand"
"unsafe"

"github.com/remogatto/gospeccy/src/spectrum"
"github.com/scottferg/Go-SDL/sdl"
)

// Composes multiple SDL surfaces into a single surface
Expand Down
9 changes: 5 additions & 4 deletions src/output/sdl/sdl_display.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,19 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

*/

// +build linux freebsd
// +build linux freebsd darwin

package sdl_output

import (
"fmt"
"github.com/scottferg/Go-SDL/sdl"
"github.com/scottferg/Go-SDL/ttf"
"github.com/remogatto/gospeccy/src/spectrum"
"os"
"time"
"unsafe"

"github.com/remogatto/gospeccy/src/spectrum"
"github.com/scottferg/Go-SDL/sdl"
"github.com/scottferg/Go-SDL/ttf"
)

func init() {
Expand Down
7 changes: 4 additions & 3 deletions src/output/sdl/sdl_display_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build linux freebsd
// +build linux freebsd darwin

package sdl_output

Expand All @@ -7,10 +7,11 @@ import (
//"image/png"

//"strings"
"github.com/scottferg/Go-SDL/sdl"
"testing"

"github.com/remogatto/gospeccy/src/formats"
"github.com/remogatto/gospeccy/src/spectrum"
"testing"
"github.com/scottferg/Go-SDL/sdl"
//"unsafe"
)

Expand Down
2 changes: 1 addition & 1 deletion src/output/sdl/sdl_dummy.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build linux freebsd
// +build linux freebsd darwin

package sdl_output

Expand Down
5 changes: 3 additions & 2 deletions src/output/sdl/sdl_script.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// +build linux freebsd
// +build linux freebsd darwin

package sdl_output

import (
"sync"

intp "github.com/remogatto/gospeccy/src/interpreter"
"github.com/sbinet/go-eval"
"sync"
)

type userInterfaceSettings_t interface {
Expand Down
9 changes: 5 additions & 4 deletions src/output/sdl/sdl_sound.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,20 @@
* except for usages in immoral contexts.
*/

// +build linux freebsd
// +build linux freebsd darwin

package sdl_output

import (
"errors"
"fmt"
"github.com/scottferg/Go-SDL/sdl"
sdl_audio "github.com/scottferg/Go-SDL/sdl/audio"
"github.com/remogatto/gospeccy/src/spectrum"
"math"
"os"
"sync"

"github.com/remogatto/gospeccy/src/spectrum"
"github.com/scottferg/Go-SDL/sdl"
sdl_audio "github.com/scottferg/Go-SDL/sdl/audio"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion src/pull_modules/sdl.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build linux freebsd
// +build linux freebsd darwin

package pull_modules

Expand Down