Skip to content

Commit

Permalink
window tile and some cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
laullon committed Apr 18, 2020
1 parent 0ed707f commit 1ffec42
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion machines/cpc/fdc765.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ func (fdc *fdc765) WritePort(port uint16, data byte) {
case 0xFB7F:
fdc.chip.WriteData(data)
default:
fmt.Printf("port: 0x%04X data: 0x%02X \n", port, data)
// fmt.Printf("port: 0x%04X data: 0x%02X \n", port, data)
}
}
4 changes: 2 additions & 2 deletions machines/cpc/gatearray.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func (ga *gatearray) WritePort(port uint16, data byte) {
} else {
if ga.borderColor != colours[data&0x1f] {
ga.borderColor = colours[data&0x1f]
println("ga.borderColor:", data&0x1f, ga.y)
// println("ga.borderColor:", data&0x1f, ga.y)
// draw.Draw(ga.display, ga.display.Bounds(), &image.Uniform{ga.borderColor}, image.ZP, draw.Src)
}
}
Expand All @@ -246,7 +246,7 @@ func (ga *gatearray) WritePort(port uint16, data byte) {
default:
// panic(screenMode)
}
println("screenMode", screenMode, ga.y)
// println("screenMode", screenMode, ga.y)
}
// println("[ga]", "lowerRomEnable:", ga.mem.lowerRomEnable, "upperRomEnable:", ga.mem.upperRomEnable, "screenMode:", ga.screenMode)
} else if f == 3 {
Expand Down
2 changes: 1 addition & 1 deletion machines/cpc/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (mem *memory) Paging(config byte) {
case 7:
mem.activeBanks = []byte{0, 7, 2, 3}
}
fmt.Printf("[mem] mem.activeBanks: %v\n", mem.activeBanks)
// fmt.Printf("[mem] mem.activeBanks: %v\n", mem.activeBanks)
}

func (mem *memory) decodeAddress(addr uint16) (page byte, bank byte, pos uint16) {
Expand Down
10 changes: 9 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,28 @@ func main() {
// log.Print(cassette)

var machine machines.Machine
var name string

if len(*z80File) > 0 {
machine = zx.LoadZ80File(*z80File)
name = "ZX Spectrum"
} else {
switch *mode {
case "48k":
machine = zx.NewZX48K(cassette)
name = "ZX Spectrum 48k"
case "128k":
machine = zx.NewZX128K(cassette)
name = "ZX Spectrum 128k"
case "plus3":
machine = zx.NewZXPlus3(cassette)
name = "ZX Spectrum +3"
case "cpc464", "cpc":
machine = cpc.NewCPC(true, cassette)
name = "Amstrad CPC 464"
case "cpc6128":
machine = cpc.NewCPC(false, cassette)
name = "Amstrad CPC 6128"
default:
panic(fmt.Errorf("mode '%s' not valid", *mode))
}
Expand All @@ -103,7 +110,7 @@ func main() {
display.ScalingFilter = canvas.NearestFilter
display.SetMinSize(fyne.NewSize(352*2, 296*2))

w := app.NewWindow("ZX Spectrum")
w := app.NewWindow(name + " - b2t80s Emulator")

reg := widget.NewLabelWithStyle("", fyne.TextAlignLeading, fyne.TextStyle{Monospace: true})
pas := widget.NewLabelWithStyle("", fyne.TextAlignLeading, fyne.TextStyle{Monospace: true})
Expand Down Expand Up @@ -190,6 +197,7 @@ func main() {
machine.Run()
}()

w.CenterOnScreen()
w.ShowAndRun()

if *memprofile != "" {
Expand Down

0 comments on commit 1ffec42

Please sign in to comment.