From 4e5449f3ca09ccf85b058e2e41dc7c9e46d0728c Mon Sep 17 00:00:00 2001 From: Will Angenent Date: Sat, 2 Nov 2019 13:33:05 +0000 Subject: [PATCH] Migrated to GO11 modules --- .gitignore | 3 +-- README.md | 12 +++++------- apple2.go | 16 ++++++++-------- audio/audio.go | 2 +- audio/ebiten.go | 2 +- bank_switch_test.go | 10 +++++----- bell_test.go | 6 +++--- cmd/disasm.go | 6 +++--- cpu/cpu.go | 4 ++-- cpu/cpu_test.go | 8 ++++---- cpu/debug.go | 2 +- disk/disk.go | 2 +- dos33_boot_test.go | 14 +++++++------- dos33_rwts_write_test.go | 14 +++++++------- glide.yaml | 12 ------------ go.mod | 20 ++++++++++++++++++++ go.sum | 38 ++++++++++++++++++++++++++++++++++++++ io_test.go | 10 +++++----- mmu/io.go | 8 ++++---- mmu/mmu.go | 2 +- prodos_boot_test.go | 14 +++++++------- utils/utils.go | 4 ++-- video/video.go | 2 +- 23 files changed, 127 insertions(+), 84 deletions(-) delete mode 100644 glide.yaml create mode 100644 go.mod create mode 100644 go.sum diff --git a/.gitignore b/.gitignore index 027a8a3..f7bc1df 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ vendor -glide.lock -apple2 +apple2-go apple2.test apple2e.rom dos33.dsk diff --git a/README.md b/README.md index cf50a86..004fc98 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,7 @@ An Apple //e emulator written in Go using [ebiten](https://github.com/hajimehosh ## Installation -Install prerequisites with glide - - glide up +The installation requires go modules go be installed Build the executable @@ -29,9 +27,9 @@ Download `apple2e.rom` from ## Running it - ./apple2 - ./apple2 my_disk_image.dsk - ./apple2 -drive-head-click my_disk_image.dsk + ./apple2-go + ./apple2-go my_disk_image.dsk + ./apple2-go -drive-head-click my_disk_image.dsk ## Keyboard shortcuts @@ -57,7 +55,7 @@ The CPU tests make use of [Klaus2m5's](https://github.com/Klaus2m5/6502_65C02_fu ### Creating the CPU test ROMs -The source files are `6502_functional_test.a65` and `6502_interrupt_test.a65`. They are assembled using `as65` into a binary file which contains a memory image of the test code. They are compressed into gzip files which are loaded into the apple memory by the unit tests. +The source files are `6502_functional_test.a65` and `6502_interrupt_test.a65`. They are assembled using `as65` into a binary file which contains a memory image of the test code. They are compressed into gzip files which are loaded into the apple memory by the unit tests. Download [as65](http://www.kingswood-consulting.co.uk/assemblers/as65_142.zip) and unzip it to get the `as65` assembler binary. diff --git a/apple2.go b/apple2.go index 266c899..db9771b 100644 --- a/apple2.go +++ b/apple2.go @@ -10,14 +10,14 @@ import ( "github.com/hajimehoshi/ebiten" - "github.com/freewilll/apple2/audio" - "github.com/freewilll/apple2/cpu" - "github.com/freewilll/apple2/disk" - "github.com/freewilll/apple2/keyboard" - "github.com/freewilll/apple2/mmu" - "github.com/freewilll/apple2/system" - "github.com/freewilll/apple2/utils" - "github.com/freewilll/apple2/video" + "github.com/freewilll/apple2-go/audio" + "github.com/freewilll/apple2-go/cpu" + "github.com/freewilll/apple2-go/disk" + "github.com/freewilll/apple2-go/keyboard" + "github.com/freewilll/apple2-go/mmu" + "github.com/freewilll/apple2-go/system" + "github.com/freewilll/apple2-go/utils" + "github.com/freewilll/apple2-go/video" ) var ( diff --git a/audio/audio.go b/audio/audio.go index 7e80f3b..970a38b 100644 --- a/audio/audio.go +++ b/audio/audio.go @@ -5,7 +5,7 @@ package audio // channel is filled with the last audio samples. The channel is also // filled at the end of the frame. -import "github.com/freewilll/apple2/system" +import "github.com/freewilll/apple2-go/system" // Click handles a speaker click func Click() { diff --git a/audio/ebiten.go b/audio/ebiten.go index 2c449c6..a2c2caa 100644 --- a/audio/ebiten.go +++ b/audio/ebiten.go @@ -5,7 +5,7 @@ package audio import ( "errors" - "github.com/freewilll/apple2/system" + "github.com/freewilll/apple2-go/system" ebiten_audio "github.com/hajimehoshi/ebiten/audio" ) diff --git a/bank_switch_test.go b/bank_switch_test.go index 23774c2..b55d1d4 100644 --- a/bank_switch_test.go +++ b/bank_switch_test.go @@ -3,11 +3,11 @@ package main import ( "testing" - "github.com/freewilll/apple2/cpu" - "github.com/freewilll/apple2/keyboard" - "github.com/freewilll/apple2/mmu" - "github.com/freewilll/apple2/system" - "github.com/freewilll/apple2/video" + "github.com/freewilll/apple2-go/cpu" + "github.com/freewilll/apple2-go/keyboard" + "github.com/freewilll/apple2-go/mmu" + "github.com/freewilll/apple2-go/system" + "github.com/freewilll/apple2-go/video" "github.com/stretchr/testify/assert" ) diff --git a/bell_test.go b/bell_test.go index 38af0a0..265d3b1 100644 --- a/bell_test.go +++ b/bell_test.go @@ -4,9 +4,9 @@ import ( "fmt" "testing" - "github.com/freewilll/apple2/cpu" - "github.com/freewilll/apple2/mmu" - "github.com/freewilll/apple2/system" + "github.com/freewilll/apple2-go/cpu" + "github.com/freewilll/apple2-go/mmu" + "github.com/freewilll/apple2-go/system" ) func testBellCycles(delay int) { diff --git a/cmd/disasm.go b/cmd/disasm.go index e3eb477..80ee250 100644 --- a/cmd/disasm.go +++ b/cmd/disasm.go @@ -7,9 +7,9 @@ import ( "fmt" "os" - "github.com/freewilll/apple2/cpu" - "github.com/freewilll/apple2/mmu" - "github.com/freewilll/apple2/utils" + "github.com/freewilll/apple2-go/cpu" + "github.com/freewilll/apple2-go/mmu" + "github.com/freewilll/apple2-go/utils" ) func main() { diff --git a/cpu/cpu.go b/cpu/cpu.go index 8d65274..6f9e665 100644 --- a/cpu/cpu.go +++ b/cpu/cpu.go @@ -4,8 +4,8 @@ import ( "fmt" "os" - "github.com/freewilll/apple2/mmu" - "github.com/freewilll/apple2/system" + "github.com/freewilll/apple2-go/mmu" + "github.com/freewilll/apple2-go/system" ) const ( diff --git a/cpu/cpu_test.go b/cpu/cpu_test.go index a5830e7..1735b31 100644 --- a/cpu/cpu_test.go +++ b/cpu/cpu_test.go @@ -9,10 +9,10 @@ import ( "fmt" "testing" - "github.com/freewilll/apple2/cpu" - "github.com/freewilll/apple2/mmu" - "github.com/freewilll/apple2/system" - "github.com/freewilll/apple2/utils" + "github.com/freewilll/apple2-go/cpu" + "github.com/freewilll/apple2-go/mmu" + "github.com/freewilll/apple2-go/system" + "github.com/freewilll/apple2-go/utils" ) func TestCPU(t *testing.T) { diff --git a/cpu/debug.go b/cpu/debug.go index c179d27..caa2fc4 100644 --- a/cpu/debug.go +++ b/cpu/debug.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/freewilll/apple2/mmu" + "github.com/freewilll/apple2-go/mmu" ) // printFlag prints a lower or uppercase letter depending on the state of the flag diff --git a/disk/disk.go b/disk/disk.go index 9b0db5b..27565d1 100644 --- a/disk/disk.go +++ b/disk/disk.go @@ -4,7 +4,7 @@ import ( "fmt" "io/ioutil" - "github.com/freewilll/apple2/system" + "github.com/freewilll/apple2-go/system" ) const tracksPerDisk = 35 diff --git a/dos33_boot_test.go b/dos33_boot_test.go index 56db44d..6ab1a47 100644 --- a/dos33_boot_test.go +++ b/dos33_boot_test.go @@ -5,13 +5,13 @@ import ( "testing" "time" - "github.com/freewilll/apple2/cpu" - "github.com/freewilll/apple2/disk" - "github.com/freewilll/apple2/keyboard" - "github.com/freewilll/apple2/mmu" - "github.com/freewilll/apple2/system" - "github.com/freewilll/apple2/utils" - "github.com/freewilll/apple2/video" + "github.com/freewilll/apple2-go/cpu" + "github.com/freewilll/apple2-go/disk" + "github.com/freewilll/apple2-go/keyboard" + "github.com/freewilll/apple2-go/mmu" + "github.com/freewilll/apple2-go/system" + "github.com/freewilll/apple2-go/utils" + "github.com/freewilll/apple2-go/video" ) const dosDiskImage = "dos33.dsk" diff --git a/dos33_rwts_write_test.go b/dos33_rwts_write_test.go index dafa291..9ca505d 100644 --- a/dos33_rwts_write_test.go +++ b/dos33_rwts_write_test.go @@ -3,13 +3,13 @@ package main import ( "testing" - "github.com/freewilll/apple2/cpu" - "github.com/freewilll/apple2/disk" - "github.com/freewilll/apple2/keyboard" - "github.com/freewilll/apple2/mmu" - "github.com/freewilll/apple2/system" - "github.com/freewilll/apple2/utils" - "github.com/freewilll/apple2/video" + "github.com/freewilll/apple2-go/cpu" + "github.com/freewilll/apple2-go/disk" + "github.com/freewilll/apple2-go/keyboard" + "github.com/freewilll/apple2-go/mmu" + "github.com/freewilll/apple2-go/system" + "github.com/freewilll/apple2-go/utils" + "github.com/freewilll/apple2-go/video" ) const rwtsDosDiskImage = "dos33.dsk" diff --git a/glide.yaml b/glide.yaml deleted file mode 100644 index ba9aa18..0000000 --- a/glide.yaml +++ /dev/null @@ -1,12 +0,0 @@ -package: github.com/freewilll/apple2 -import: -- package: github.com/hajimehoshi/ebiten - version: ^1.7.0 - subpackages: - - audio - - ebitenutil -testImport: -- package: github.com/stretchr/testify - version: ^1.2.1 - subpackages: - - assert diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..c9ff863 --- /dev/null +++ b/go.mod @@ -0,0 +1,20 @@ +module github.com/freewilll/apple2-go + +go 1.13 + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/go-gl/gl v0.0.0-20180407155706-68e253793080 // indirect + github.com/go-gl/glfw v0.0.0-20180426074136-46a8d530c326 // indirect + github.com/gofrs/flock v0.7.1 // indirect + github.com/gopherjs/gopherjs v0.0.0-20180424202546-8dffc02ea1cb // indirect + github.com/gopherjs/webgl v0.0.0-20180508003723-39bd6d41eeb5 // indirect + github.com/hajimehoshi/ebiten v1.7.0 + github.com/hajimehoshi/oto v0.0.0-20180404145402-7a1d13b19d82 // indirect + github.com/stretchr/testify v1.4.0 + github.com/theckman/go-flock v0.7.1 // indirect + golang.org/x/exp v0.0.0-20180321215751-8460e604b9de // indirect + golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8 // indirect + golang.org/x/mobile v0.0.0-20180522193631-5665cf37628b // indirect + golang.org/x/sys v0.0.0-20190412213103-97732733099d // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..c0be119 --- /dev/null +++ b/go.sum @@ -0,0 +1,38 @@ +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/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/go-gl/gl v0.0.0-20180407155706-68e253793080 h1:pNxZva3052YM+z2p1aP08FgaTE2NzrRJZ5BHJCmKLzE= +github.com/go-gl/gl v0.0.0-20180407155706-68e253793080/go.mod h1:482civXOzJJCPzJ4ZOX/pwvXBWSnzD4OKMdH4ClKGbk= +github.com/go-gl/glfw v0.0.0-20180426074136-46a8d530c326 h1:QqWaXlVeUGwSH7hO8giZP2Y06Qjl1LWR+FWC22YQsU8= +github.com/go-gl/glfw v0.0.0-20180426074136-46a8d530c326/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/gofrs/flock v0.7.1 h1:DP+LD/t0njgoPBvT5MJLeliUIVQR03hiKR6vezdwHlc= +github.com/gofrs/flock v0.7.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= +github.com/gopherjs/gopherjs v0.0.0-20180424202546-8dffc02ea1cb h1:g0omhilXoAZ+6sFcF6puAzT+/MoKK3ZBQ9e7nVIRjrc= +github.com/gopherjs/gopherjs v0.0.0-20180424202546-8dffc02ea1cb/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gopherjs/webgl v0.0.0-20180508003723-39bd6d41eeb5 h1:vrKguNTgy5fq7lTzG9YNM9u8QOsNbEN2ejPt1k6gR/4= +github.com/gopherjs/webgl v0.0.0-20180508003723-39bd6d41eeb5/go.mod h1:obh2agNa9TmQ5C1MrSr2jgLIqV0b4Cl96m/ig2VAXwM= +github.com/hajimehoshi/ebiten v1.7.0 h1:wco7g543jnaTCoNdRS8PJDvfs354tpgD2yeMlqBhAU0= +github.com/hajimehoshi/ebiten v1.7.0/go.mod h1:gK6oXr/7HwFjJZfV7RssGfm18GGNIJmpBsAd1saFLFU= +github.com/hajimehoshi/oto v0.0.0-20180404145402-7a1d13b19d82 h1:Ub4U4W87BWF85gDemt36PiuitaO4LRVaQkDCgzp77hM= +github.com/hajimehoshi/oto v0.0.0-20180404145402-7a1d13b19d82/go.mod h1:Co7jIdNa4+UYZF0whfBysf8qY6o7oV8dFC1Ld//5HmY= +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/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/theckman/go-flock v0.7.1 h1:YdJyIjDuQdEU7voZ9YaeXSO4OnrxdI+WejPUwyZ/Txs= +github.com/theckman/go-flock v0.7.1/go.mod h1:kjuth3y9VJ2aNlkNEO99G/8lp9fMIKaGyBmh84IBheM= +golang.org/x/exp v0.0.0-20180321215751-8460e604b9de h1:xSjD6HQTqT0H/k60N5yYBtnN1OEkVy7WIo/DYyxKRO0= +golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8 h1:hVwzHzIUGRjiF7EcUjqNxk3NCfkPxbDKRdnNE1Rpg0U= +golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/mobile v0.0.0-20180522193631-5665cf37628b h1:76cRE6suQlpxQe7chtgJiEOaG6vNrh2kHhFQ6WncHQQ= +golang.org/x/mobile v0.0.0-20180522193631-5665cf37628b/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/io_test.go b/io_test.go index 3712967..e934ddb 100644 --- a/io_test.go +++ b/io_test.go @@ -3,11 +3,11 @@ package main import ( "testing" - "github.com/freewilll/apple2/cpu" - "github.com/freewilll/apple2/keyboard" - "github.com/freewilll/apple2/mmu" - "github.com/freewilll/apple2/system" - "github.com/freewilll/apple2/video" + "github.com/freewilll/apple2-go/cpu" + "github.com/freewilll/apple2-go/keyboard" + "github.com/freewilll/apple2-go/mmu" + "github.com/freewilll/apple2-go/system" + "github.com/freewilll/apple2-go/video" "github.com/stretchr/testify/assert" ) diff --git a/mmu/io.go b/mmu/io.go index 1fc0bb6..a3aed01 100644 --- a/mmu/io.go +++ b/mmu/io.go @@ -3,10 +3,10 @@ package mmu import ( "fmt" - "github.com/freewilll/apple2/audio" - "github.com/freewilll/apple2/disk" - "github.com/freewilll/apple2/keyboard" - "github.com/freewilll/apple2/system" + "github.com/freewilll/apple2-go/audio" + "github.com/freewilll/apple2-go/disk" + "github.com/freewilll/apple2-go/keyboard" + "github.com/freewilll/apple2-go/system" ) // Adapted from diff --git a/mmu/mmu.go b/mmu/mmu.go index a902c1b..7990cbd 100644 --- a/mmu/mmu.go +++ b/mmu/mmu.go @@ -4,7 +4,7 @@ import ( "fmt" "io/ioutil" - "github.com/freewilll/apple2/system" + "github.com/freewilll/apple2-go/system" ) // RomPath is a hardcoded path to an Apple //e ROM file that's loaded at startup diff --git a/prodos_boot_test.go b/prodos_boot_test.go index 752ea77..9a84605 100644 --- a/prodos_boot_test.go +++ b/prodos_boot_test.go @@ -5,13 +5,13 @@ import ( "testing" "time" - "github.com/freewilll/apple2/cpu" - "github.com/freewilll/apple2/disk" - "github.com/freewilll/apple2/keyboard" - "github.com/freewilll/apple2/mmu" - "github.com/freewilll/apple2/system" - "github.com/freewilll/apple2/utils" - "github.com/freewilll/apple2/video" + "github.com/freewilll/apple2-go/cpu" + "github.com/freewilll/apple2-go/disk" + "github.com/freewilll/apple2-go/keyboard" + "github.com/freewilll/apple2-go/mmu" + "github.com/freewilll/apple2-go/system" + "github.com/freewilll/apple2-go/utils" + "github.com/freewilll/apple2-go/video" ) const prodosDiskImage = "prodos19.dsk" diff --git a/utils/utils.go b/utils/utils.go index 614d602..e50e1c1 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -8,8 +8,8 @@ import ( "os" "testing" - "github.com/freewilll/apple2/cpu" - "github.com/freewilll/apple2/system" + "github.com/freewilll/apple2-go/cpu" + "github.com/freewilll/apple2-go/system" ) // ReadMemoryFromGzipFile just reads and uncompresses a gzip file diff --git a/video/video.go b/video/video.go index 4aff84b..4f87c80 100644 --- a/video/video.go +++ b/video/video.go @@ -8,7 +8,7 @@ import ( "github.com/hajimehoshi/ebiten" "github.com/hajimehoshi/ebiten/ebitenutil" - "github.com/freewilll/apple2/mmu" + "github.com/freewilll/apple2-go/mmu" ) const (