Migrated to GO11 modules

This commit is contained in:
Will Angenent 2019-11-02 13:33:05 +00:00
parent c49a14d9ca
commit 4e5449f3ca
23 changed files with 127 additions and 84 deletions

3
.gitignore vendored
View File

@ -1,6 +1,5 @@
vendor
glide.lock
apple2
apple2-go
apple2.test
apple2e.rom
dos33.dsk

View File

@ -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.

View File

@ -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 (

View File

@ -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() {

View File

@ -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"
)

View File

@ -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"
)

View File

@ -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) {

View File

@ -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() {

View File

@ -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 (

View File

@ -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) {

View File

@ -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

View File

@ -4,7 +4,7 @@ import (
"fmt"
"io/ioutil"
"github.com/freewilll/apple2/system"
"github.com/freewilll/apple2-go/system"
)
const tracksPerDisk = 35

View File

@ -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"

View File

@ -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"

View File

@ -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

20
go.mod Normal file
View File

@ -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
)

38
go.sum Normal file
View File

@ -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=

View File

@ -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"
)

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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 (