Skip to content

Commit

Permalink
Embed the firmware
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanizag committed Aug 17, 2021
1 parent 537c63a commit 2d778a7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
1 change: 0 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ archives:
- LICENSE
- BASIC.ROM
- ROMs/*
- firmware
checksum:
name_template: 'checksums.txt'
snapshot:
Expand Down
13 changes: 6 additions & 7 deletions acornMemory.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
_ "embed"
"fmt"
"io/ioutil"
)
Expand Down Expand Up @@ -74,14 +75,12 @@ func memoryArea(address uint16) string {
return ""
}

func (m *acornMemory) loadFirmware(firmFilename string) {
data, err := ioutil.ReadFile(firmFilename)
if err != nil {
panic(err)
}
//go:embed firmware
var firmware []byte

for i := 0; i < len(data); i++ {
m.data[i] = data[i]
func (m *acornMemory) loadFirmware() {
for i := 0; i < len(firmware); i++ {
m.data[i] = firmware[i]
}
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/ivanizag/bbz

go 1.13
go 1.16

// Update with go get github.com/ivanizag/izapple2/core6502@master
require github.com/ivanizag/izapple2 v0.0.0-20210725095035-e47730e13158
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func main() {
*traceMemory,
*panicOnErr)

env.mem.loadFirmware("firmware")
env.mem.loadFirmware()

for i, rom := range roms {
if *rom != "" {
Expand Down

0 comments on commit 2d778a7

Please sign in to comment.