mirror of
https://github.com/JetSetIlly/Gopher2600.git
synced 2025-04-02 11:02:17 -04:00
minimum Go version increased to go1.24.0 disabled unconvert linter. the latest version of the linter does not work with go1.24.0 modified 0001-statsviz.patch to match changes go version change in go.mod
106 lines
4.7 KiB
Diff
106 lines
4.7 KiB
Diff
diff --git a/go.mod b/go.mod
|
|
index 7575b599c..adfee04bf 100644
|
|
--- a/go.mod
|
|
+++ b/go.mod
|
|
@@ -3,6 +3,7 @@ module github.com/jetsetilly/gopher2600
|
|
go 1.24.0
|
|
|
|
require (
|
|
+ github.com/arl/statsviz v0.6.0
|
|
github.com/go-audio/audio v1.0.0
|
|
github.com/go-audio/wav v1.1.0
|
|
github.com/go-gl/gl v0.0.0-20211210172815-726fda9656d6
|
|
@@ -17,6 +18,7 @@ require (
|
|
|
|
require (
|
|
github.com/go-audio/riff v1.0.0 // indirect
|
|
+ github.com/gorilla/websocket v1.5.0 // indirect
|
|
github.com/kylelemons/godebug v1.1.0 // indirect
|
|
)
|
|
|
|
diff --git a/go.sum b/go.sum
|
|
index d610ef91e..8e6f0975c 100644
|
|
--- a/go.sum
|
|
+++ b/go.sum
|
|
@@ -1,3 +1,5 @@
|
|
+github.com/arl/statsviz v0.6.0 h1:jbW1QJkEYQkufd//4NDYRSNBpwJNrdzPahF7ZmoGdyE=
|
|
+github.com/arl/statsviz v0.6.0/go.mod h1:0toboo+YGSUXDaS4g1D5TVS4dXs7S7YYT5J/qnW2h8s=
|
|
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
|
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
|
github.com/go-audio/audio v1.0.0 h1:zS9vebldgbQqktK4H0lUqWrG8P0NxCJVqcj7ZpNnwd4=
|
|
@@ -8,6 +10,8 @@ github.com/go-audio/wav v1.1.0 h1:jQgLtbqBzY7G+BM8fXF7AHUk1uHUviWS4X39d5rsL2g=
|
|
github.com/go-audio/wav v1.1.0/go.mod h1:mpe9qfwbScEbkd8uybLuIpTgHyrISw/OTuvjUW2iGtE=
|
|
github.com/go-gl/gl v0.0.0-20211210172815-726fda9656d6 h1:zDw5v7qm4yH7N8C8uWd+8Ii9rROdgWxQuGoJ9WDXxfk=
|
|
github.com/go-gl/gl v0.0.0-20211210172815-726fda9656d6/go.mod h1:9YTyiznxEY1fVinfM7RvRcjRHbw2xLBJ3AAGIT0I4Nw=
|
|
+github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
|
|
+github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
|
github.com/hajimehoshi/go-mp3 v0.3.4 h1:NUP7pBYH8OguP4diaTZ9wJbUbk3tC0KlfzsEpWmYj68=
|
|
github.com/hajimehoshi/go-mp3 v0.3.4/go.mod h1:fRtZraRFcWb0pu7ok0LqyFhCUrPeMsGRSVop0eemFmo=
|
|
github.com/hajimehoshi/oto/v2 v2.3.1/go.mod h1:seWLbgHH7AyUMYKfKYT9pg7PhUu9/SisyJvNTT+ASQo=
|
|
@@ -19,6 +23,8 @@ github.com/pkg/term v1.1.0 h1:xIAAdCMh3QIAy+5FrE8Ad8XoDhEU4ufwbaSozViP9kk=
|
|
github.com/pkg/term v1.1.0/go.mod h1:E25nymQcrSllhX42Ok8MRm1+hyBdHY0dCeiKZ9jpNGw=
|
|
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
|
+github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
|
|
+github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
|
|
github.com/sahilm/fuzzy v0.1.0 h1:FzWGaw2Opqyu+794ZQ9SYifWv2EIXpwP4q8dY1kDAwI=
|
|
github.com/sahilm/fuzzy v0.1.0/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y=
|
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
|
@@ -32,3 +38,5 @@ golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7w
|
|
golang.org/x/sys v0.0.0-20220712014510-0a85c31ab51e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|
golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
|
|
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|
+golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU=
|
|
+golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
|
diff --git a/gopher2600.go b/gopher2600.go
|
|
index a3294cbc6..0f0795f68 100644
|
|
--- a/gopher2600.go
|
|
+++ b/gopher2600.go
|
|
@@ -20,12 +20,14 @@ import (
|
|
"flag"
|
|
"fmt"
|
|
"io"
|
|
+ "net/http"
|
|
"os"
|
|
"os/signal"
|
|
"runtime"
|
|
"strings"
|
|
"time"
|
|
|
|
+ "github.com/arl/statsviz"
|
|
"github.com/jetsetilly/gopher2600/cartridgeloader"
|
|
"github.com/jetsetilly/gopher2600/debugger"
|
|
"github.com/jetsetilly/gopher2600/debugger/govern"
|
|
@@ -337,6 +339,12 @@ func emulate(mode string, sync *mainSync, args []string) error {
|
|
opts.TermType = "IMGUI"
|
|
}
|
|
|
|
+ // statsviz option
|
|
+ const statsvizAddr = "localhost:2610"
|
|
+
|
|
+ var stats bool
|
|
+ flgs.BoolVar(&stats, "statsviz", false, fmt.Sprintf("run statsviz server on %s", statsvizAddr))
|
|
+
|
|
// parse args and get copy of remaining arguments
|
|
err := flgs.Parse(args)
|
|
if err != nil {
|
|
@@ -366,6 +374,19 @@ func emulate(mode string, sync *mainSync, args []string) error {
|
|
// turning the emulation's interrupt handler off
|
|
sync.state <- stateRequest{req: reqNoIntSig}
|
|
|
|
+ // setup statsviz server if it has been activated
|
|
+ if stats {
|
|
+ mux := http.NewServeMux()
|
|
+ statsviz.Register(mux)
|
|
+ go func() {
|
|
+ logger.Logf(logger.Allow, "statsviz", "listening on %s/debug/statsviz", statsvizAddr)
|
|
+ err := http.ListenAndServe(statsvizAddr, mux)
|
|
+ if err != nil {
|
|
+ logger.Log(logger.Allow, "%s", err.Error())
|
|
+ }
|
|
+ }()
|
|
+ }
|
|
+
|
|
// prepare new debugger, supplying a debugger.CreateUserInterface function.
|
|
// this function will be called by NewDebugger() and in turn will send a
|
|
// GUI create message to the main goroutine
|