mirror of
https://github.com/ivanizag/izapple2.git
synced 2024-12-28 17:29:57 +00:00
Card information
This commit is contained in:
parent
758e4f79bb
commit
9e63e82e9d
@ -88,21 +88,16 @@ func (a *Apple2) LoadRom(filename string) error {
|
||||
}
|
||||
|
||||
// AddDisk2 inserts a DiskII controller
|
||||
func (a *Apple2) AddDisk2(slot int, diskRomFile string, diskImage, diskBImage string) error {
|
||||
var c cardDisk2
|
||||
data, err := loadResource(diskRomFile)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.loadRom(data)
|
||||
a.insertCard(&c, slot)
|
||||
func (a *Apple2) AddDisk2(slot int, diskImage, diskBImage string) error {
|
||||
c := NewCardDisk2()
|
||||
a.insertCard(c, slot)
|
||||
|
||||
if diskImage != "" {
|
||||
diskette, err := loadDiskette(diskImage)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.drive[0].insertDiskette(diskette)
|
||||
c.drive[0].insertDiskette(diskImage, diskette)
|
||||
}
|
||||
|
||||
if diskBImage != "" {
|
||||
@ -110,7 +105,7 @@ func (a *Apple2) AddDisk2(slot int, diskRomFile string, diskImage, diskBImage st
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.drive[1].insertDiskette(diskette)
|
||||
c.drive[1].insertDiskette(diskImage, diskette)
|
||||
}
|
||||
|
||||
return nil
|
||||
@ -130,37 +125,27 @@ func (a *Apple2) AddSmartPortDisk(slot int, hdImage string, trace bool) error {
|
||||
|
||||
// AddVidHD adds a card with the signature of VidHD
|
||||
func (a *Apple2) AddVidHD(slot int) {
|
||||
c := NewCardVidHD()
|
||||
a.insertCard(c, slot)
|
||||
a.insertCard(NewCardVidHD(), slot)
|
||||
}
|
||||
|
||||
// AddFastChip adds a card with the signature of VidHD
|
||||
func (a *Apple2) AddFastChip(slot int) {
|
||||
var c cardFastChip
|
||||
c.loadRom(buildFastChipRom())
|
||||
a.insertCard(&c, slot)
|
||||
a.insertCard(NewCardFastChip(), slot)
|
||||
}
|
||||
|
||||
// AddLanguageCard inserts a 16Kb card
|
||||
func (a *Apple2) AddLanguageCard(slot int) {
|
||||
a.insertCard(&cardLanguage{}, slot)
|
||||
a.insertCard(NewCardLanguage(), slot)
|
||||
}
|
||||
|
||||
// AddSaturnCard inserts a 128Kb card
|
||||
func (a *Apple2) AddSaturnCard(slot int) {
|
||||
a.insertCard(&cardSaturn{}, slot)
|
||||
a.insertCard(NewCardSaturn(), slot)
|
||||
}
|
||||
|
||||
// AddMemoryExpansionCard inserts an Apple II Memory Expansion card with 1GB
|
||||
func (a *Apple2) AddMemoryExpansionCard(slot int, romFile string) error {
|
||||
var c cardMemoryExpansion
|
||||
data, err := loadResource(romFile)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.loadRom(data)
|
||||
a.insertCard(&c, slot)
|
||||
return nil
|
||||
func (a *Apple2) AddMemoryExpansionCard(slot int) {
|
||||
a.insertCard(NewCardMemoryExpansion(), slot)
|
||||
}
|
||||
|
||||
// AddThunderClockPlusCard inserts a ThunderClock Plus clock card
|
||||
@ -199,12 +184,14 @@ func (a *Apple2) AddNoSlotClockInCard(slot int) error {
|
||||
|
||||
// AddCardLogger inserts a fake card that logs accesses
|
||||
func (a *Apple2) AddCardLogger(slot int) {
|
||||
a.insertCard(&cardLogger{}, slot)
|
||||
c := NewCardLogger()
|
||||
a.insertCard(c, slot)
|
||||
}
|
||||
|
||||
// AddCardInOut inserts a fake card that interfaces with the emulator host
|
||||
func (a *Apple2) AddCardInOut(slot int) {
|
||||
a.insertCard(&cardInOut{}, slot)
|
||||
c := NewCardInOut()
|
||||
a.insertCard(c, slot)
|
||||
}
|
||||
|
||||
// SetKeyboardProvider attaches an external keyboard provider
|
||||
|
@ -13,10 +13,6 @@ func MainApple() *Apple2 {
|
||||
"rom",
|
||||
defaultInternal,
|
||||
"main rom file")
|
||||
disk2RomFile := flag.String(
|
||||
"diskRom",
|
||||
"<internal>/DISK2.rom",
|
||||
"rom file for the disk drive controller")
|
||||
disk2Slot := flag.Int(
|
||||
"disk2Slot",
|
||||
6,
|
||||
@ -247,11 +243,7 @@ func MainApple() *Apple2 {
|
||||
a.AddSaturnCard(*saturnCardSlot)
|
||||
}
|
||||
if *memoryExpansionCardSlot >= 0 {
|
||||
err := a.AddMemoryExpansionCard(*memoryExpansionCardSlot,
|
||||
"<internal>/MemoryExpansionCard-341-0344a.bin")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
a.AddMemoryExpansionCard(*memoryExpansionCardSlot)
|
||||
}
|
||||
if *thunderClockCardSlot > 0 {
|
||||
err := a.AddThunderClockPlusCard(*thunderClockCardSlot,
|
||||
@ -275,7 +267,7 @@ func MainApple() *Apple2 {
|
||||
a.AddFastChip(*fastChipCardSlot)
|
||||
}
|
||||
if *disk2Slot > 0 {
|
||||
err := a.AddDisk2(*disk2Slot, *disk2RomFile, diskImageFinal, *diskBImage)
|
||||
err := a.AddDisk2(*disk2Slot, diskImageFinal, *diskBImage)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@ -312,8 +304,8 @@ func MainApple() *Apple2 {
|
||||
|
||||
}
|
||||
|
||||
//a.AddCardInOut(2)
|
||||
//a.AddCardLogger(4)
|
||||
// a.AddCardInOut(2)
|
||||
// a.AddCardLogger(4)
|
||||
|
||||
if *dumpChars {
|
||||
a.cg.Dump()
|
||||
|
20
cardBase.go
20
cardBase.go
@ -10,11 +10,12 @@ type Card interface {
|
||||
}
|
||||
|
||||
type cardBase struct {
|
||||
a *Apple2
|
||||
name string
|
||||
romCsxx *memoryRangeROM
|
||||
romC8xx *memoryRangeROM
|
||||
romCxxx *memoryRangeROM
|
||||
a *Apple2
|
||||
name string
|
||||
romCsxx *memoryRangeROM
|
||||
romC8xx *memoryRangeROM
|
||||
romCxxx *memoryRangeROM
|
||||
|
||||
slot int
|
||||
_ssr [16]softSwitchR
|
||||
_ssw [16]softSwitchW
|
||||
@ -30,6 +31,15 @@ func (c *cardBase) GetInfo() map[string]string {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *cardBase) loadRomFromResource(resource string) {
|
||||
data, err := loadResource(resource)
|
||||
if err != nil {
|
||||
// The resource should be internal and never fail
|
||||
panic(err)
|
||||
}
|
||||
c.loadRom(data)
|
||||
}
|
||||
|
||||
func (c *cardBase) loadRom(data []uint8) {
|
||||
if c.a != nil {
|
||||
panic("Assert failed. Rom must be loaded before inserting the card in the slot")
|
||||
|
38
cardDisk2.go
38
cardDisk2.go
@ -2,6 +2,7 @@ package izapple2
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
/*
|
||||
@ -18,9 +19,8 @@ http://yesterbits.com/media/pubs/AppleOrchard/articles/disk-ii-part-1-1983-apr.p
|
||||
NIB: 35 tracks 6656 bytes, 232960 bytes
|
||||
|
||||
*/
|
||||
const maxHalfTrack = 68
|
||||
|
||||
type cardDisk2 struct {
|
||||
type CardDisk2 struct {
|
||||
cardBase
|
||||
selected int // q5, Only 0 and 1 supported
|
||||
drive [2]cardDisk2Drive
|
||||
@ -31,6 +31,7 @@ type cardDisk2 struct {
|
||||
}
|
||||
|
||||
type cardDisk2Drive struct {
|
||||
name string
|
||||
diskette diskette
|
||||
power bool // q4
|
||||
phases uint8 // q3, q2, q1 and q0 with q0 on the LSB. Magnets that are active on the stepper motor
|
||||
@ -38,6 +39,7 @@ type cardDisk2Drive struct {
|
||||
}
|
||||
|
||||
const (
|
||||
maxHalfTrack = 68
|
||||
diskBitCycle = 4 // There is a dataLatch bit transferred every 4 cycles
|
||||
diskLatchReadCycles = 7 // Loaded data is available for a little more than 7ns
|
||||
diskWriteByteCycle = 32 // Load data to write every 32 cycles
|
||||
@ -46,7 +48,30 @@ const (
|
||||
|
||||
)
|
||||
|
||||
func (c *cardDisk2) assign(a *Apple2, slot int) {
|
||||
// NewCardDisk2 creates a new CardDisk2
|
||||
func NewCardDisk2() *CardDisk2 {
|
||||
var c CardDisk2
|
||||
c.name = "Disk II"
|
||||
c.loadRomFromResource("<internal>/DISK2.rom")
|
||||
return &c
|
||||
}
|
||||
|
||||
// GetInfo returns smartport info
|
||||
func (c *CardDisk2) GetInfo() map[string]string {
|
||||
info := make(map[string]string)
|
||||
info["rom"] = "16 sector"
|
||||
|
||||
info["D1 name"] = c.drive[0].name
|
||||
info["D1 track"] = strconv.FormatFloat(float64(c.drive[0].tracksStep)/4, 'f', 2, 64)
|
||||
info["D1 power"] = strconv.FormatBool(c.drive[0].power)
|
||||
|
||||
info["D2 name"] = c.drive[1].name
|
||||
info["D2 track"] = strconv.FormatFloat(float64(c.drive[1].tracksStep)/4, 'f', 2, 64)
|
||||
info["D1 power"] = strconv.FormatBool(c.drive[1].power)
|
||||
return info
|
||||
}
|
||||
|
||||
func (c *CardDisk2) assign(a *Apple2, slot int) {
|
||||
// Q1, Q2, Q3 and Q4 phase control soft switches,
|
||||
for i := uint8(0); i < 4; i++ {
|
||||
phase := i
|
||||
@ -120,7 +145,7 @@ func (c *cardDisk2) assign(a *Apple2, slot int) {
|
||||
// Q6: shift/load
|
||||
// Q7: read/write
|
||||
|
||||
func (c *cardDisk2) softSwitchQ6Q7(index uint8, in uint8) uint8 {
|
||||
func (c *CardDisk2) softSwitchQ6Q7(index uint8, in uint8) uint8 {
|
||||
switch index {
|
||||
case 0xC: // Q6L
|
||||
c.q6 = false
|
||||
@ -140,7 +165,7 @@ func (c *cardDisk2) softSwitchQ6Q7(index uint8, in uint8) uint8 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (c *cardDisk2) processQ6Q7(in uint8) {
|
||||
func (c *CardDisk2) processQ6Q7(in uint8) {
|
||||
d := &c.drive[c.selected]
|
||||
if d.diskette == nil {
|
||||
return
|
||||
@ -243,6 +268,7 @@ func moveStep(phases uint8, prevStep int) int {
|
||||
return nextStep
|
||||
}
|
||||
|
||||
func (d *cardDisk2Drive) insertDiskette(dt diskette) {
|
||||
func (d *cardDisk2Drive) insertDiskette(name string, dt diskette) {
|
||||
d.name = name
|
||||
d.diskette = dt
|
||||
}
|
||||
|
@ -12,7 +12,8 @@ See:
|
||||
|
||||
*/
|
||||
|
||||
type cardFastChip struct {
|
||||
// CardFastChip represents a
|
||||
type CardFastChip struct {
|
||||
cardBase
|
||||
unlocked bool
|
||||
unlockCounter uint8
|
||||
@ -21,6 +22,14 @@ type cardFastChip struct {
|
||||
configRegister uint8
|
||||
}
|
||||
|
||||
// NewCardFastChip creates a new CardFastChip
|
||||
func NewCardFastChip() *CardFastChip {
|
||||
var c CardFastChip
|
||||
c.name = "FASTChip IIe Card - limited"
|
||||
c.loadRom(buildFastChipRom())
|
||||
return &c
|
||||
}
|
||||
|
||||
func buildFastChipRom() []uint8 {
|
||||
data := make([]uint8, 256)
|
||||
return data
|
||||
@ -32,7 +41,7 @@ const (
|
||||
fastChipNormalSpeed = uint8(9)
|
||||
)
|
||||
|
||||
func (c *cardFastChip) assign(a *Apple2, slot int) {
|
||||
func (c *CardFastChip) assign(a *Apple2, slot int) {
|
||||
// The softswitches are outside the card reserved ss
|
||||
// Only writes are implemented to avoid conflicts with the joysticks
|
||||
a.io.addSoftSwitchW(0x6a, func(_ *ioC0Page, value uint8) {
|
||||
@ -75,7 +84,7 @@ func (c *cardFastChip) assign(a *Apple2, slot int) {
|
||||
c.cardBase.assign(a, slot)
|
||||
}
|
||||
|
||||
func (c *cardFastChip) setSpeed(a *Apple2, value uint8) {
|
||||
func (c *CardFastChip) setSpeed(a *Apple2, value uint8) {
|
||||
newAccelerated := (value > fastChipNormalSpeed)
|
||||
if newAccelerated == c.accelerated {
|
||||
// No change requested
|
||||
|
@ -24,17 +24,10 @@ type CardHardDisk struct {
|
||||
filename string
|
||||
trace bool
|
||||
|
||||
config CardHardDiskConfig
|
||||
disk *blockDisk
|
||||
mliParams uint16
|
||||
}
|
||||
|
||||
// CardHardDiskConfig represents a SmartPort card configuration
|
||||
type CardHardDiskConfig struct {
|
||||
Filename string
|
||||
Trace bool
|
||||
}
|
||||
|
||||
// NewCardHardDisk creates a new SmartPort card
|
||||
func NewCardHardDisk() *CardHardDisk {
|
||||
var c CardHardDisk
|
||||
@ -42,7 +35,7 @@ func NewCardHardDisk() *CardHardDisk {
|
||||
return &c
|
||||
}
|
||||
|
||||
// GetInfo return smartport info
|
||||
// GetInfo returns smartport info
|
||||
func (c *CardHardDisk) GetInfo() map[string]string {
|
||||
info := make(map[string]string)
|
||||
info["filename"] = c.filename
|
||||
@ -84,7 +77,7 @@ func (c *CardHardDisk) assign(a *Apple2, slot int) {
|
||||
unit := a.mmu.Peek(0x43)
|
||||
address := uint16(a.mmu.Peek(0x44)) + uint16(a.mmu.Peek(0x45))<<8
|
||||
block := uint16(a.mmu.Peek(0x46)) + uint16(a.mmu.Peek(0x47))<<8
|
||||
if c.config.Trace {
|
||||
if c.trace {
|
||||
fmt.Printf("[CardHardDisk] Prodos command %v on slot %v, unit $%x, block %v to $%x.\n", command, slot, unit, block, address)
|
||||
}
|
||||
|
||||
@ -116,7 +109,7 @@ func (c *CardHardDisk) assign(a *Apple2, slot int) {
|
||||
unit := a.mmu.Peek(paramsAddress + 1)
|
||||
address := uint16(a.mmu.Peek(paramsAddress+2)) + uint16(a.mmu.Peek(paramsAddress+3))<<8
|
||||
block := uint16(a.mmu.Peek(paramsAddress+4)) + uint16(a.mmu.Peek(paramsAddress+5))<<8
|
||||
if c.config.Trace {
|
||||
if c.trace {
|
||||
fmt.Printf("[CardHardDisk] Smart port command %v on slot %v, unit $%x, block %v to $%x.\n", command, slot, unit, block, address)
|
||||
}
|
||||
|
||||
@ -134,13 +127,13 @@ func (c *CardHardDisk) assign(a *Apple2, slot int) {
|
||||
}, "HDSMARTPORT")
|
||||
c.addCardSoftSwitchW(4, func(_ *ioC0Page, value uint8) {
|
||||
c.mliParams = (c.mliParams & 0xff00) + uint16(value)
|
||||
if c.config.Trace {
|
||||
if c.trace {
|
||||
fmt.Printf("[CardHardDisk] Smart port LO: 0x%x.\n", c.mliParams)
|
||||
}
|
||||
}, "HDSMARTPORTLO")
|
||||
c.addCardSoftSwitchW(5, func(_ *ioC0Page, value uint8) {
|
||||
c.mliParams = (c.mliParams & 0x00ff) + (uint16(value) << 8)
|
||||
if c.config.Trace {
|
||||
if c.trace {
|
||||
fmt.Printf("[CardHardDisk] Smart port HI: 0x%x.\n", c.mliParams)
|
||||
}
|
||||
}, "HDSMARTPORTHI")
|
||||
@ -149,7 +142,7 @@ func (c *CardHardDisk) assign(a *Apple2, slot int) {
|
||||
}
|
||||
|
||||
func (c *CardHardDisk) readBlock(block uint16, dest uint16) uint8 {
|
||||
if c.config.Trace {
|
||||
if c.trace {
|
||||
fmt.Printf("[CardHardDisk] Read block %v into $%x.\n", block, dest)
|
||||
}
|
||||
|
||||
@ -166,7 +159,7 @@ func (c *CardHardDisk) readBlock(block uint16, dest uint16) uint8 {
|
||||
}
|
||||
|
||||
func (c *CardHardDisk) writeBlock(block uint16, source uint16) uint8 {
|
||||
if c.config.Trace {
|
||||
if c.trace {
|
||||
fmt.Printf("[CardHardDisk] Write block %v from $%x.\n", block, source)
|
||||
}
|
||||
|
||||
@ -189,7 +182,7 @@ func (c *CardHardDisk) writeBlock(block uint16, source uint16) uint8 {
|
||||
}
|
||||
|
||||
func (c *CardHardDisk) status(unit uint8, dest uint16) uint8 {
|
||||
if c.config.Trace {
|
||||
if c.trace {
|
||||
fmt.Printf("[CardHardDisk] Status for %v into $%x.\n", unit, dest)
|
||||
}
|
||||
|
||||
|
12
cardInOut.go
12
cardInOut.go
@ -13,12 +13,20 @@ See:
|
||||
|
||||
*/
|
||||
|
||||
type cardInOut struct {
|
||||
// CardInOut is an experimental card to bridge with the host
|
||||
type CardInOut struct {
|
||||
cardBase
|
||||
i int
|
||||
}
|
||||
|
||||
func (c *cardInOut) assign(a *Apple2, slot int) {
|
||||
// NewCardInOut creates CardInOut
|
||||
func NewCardInOut() *CardInOut {
|
||||
var c CardInOut
|
||||
c.name = "Card to test I/O"
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c *CardInOut) assign(a *Apple2, slot int) {
|
||||
for i := uint8(0x0); i <= 0xf; i++ {
|
||||
iCopy := i
|
||||
c.addCardSoftSwitchR(i, func(*ioC0Page) uint8 {
|
||||
|
@ -21,19 +21,27 @@ for $D000-$F7FF.
|
||||
Power on RESET initializes ROM to read mode and RAM to write mode,
|
||||
and selects the second 4K bank to map $D000-$DFFF."
|
||||
|
||||
Writing to the softswtich disables writing in LC? Saw that
|
||||
Writing to the softswitch disables writing in LC? Saw that
|
||||
somewhere but doing so fails IIe self check.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
type cardLanguage struct {
|
||||
// CardLanguage is an Language Card
|
||||
type CardLanguage struct {
|
||||
cardBase
|
||||
readState bool
|
||||
writeState uint8
|
||||
altBank bool // false is bank1, true is bank2
|
||||
}
|
||||
|
||||
// NewCardLanguage creates a new CardLanguage
|
||||
func NewCardLanguage() *CardLanguage {
|
||||
var c CardLanguage
|
||||
c.name = "16KB Language Card"
|
||||
return &c
|
||||
}
|
||||
|
||||
const (
|
||||
// Write enabling requires two softswitch accesses
|
||||
lcWriteDisabled = 0
|
||||
@ -41,7 +49,7 @@ const (
|
||||
lcWriteEnabled = 2
|
||||
)
|
||||
|
||||
func (c *cardLanguage) assign(a *Apple2, slot int) {
|
||||
func (c *CardLanguage) assign(a *Apple2, slot int) {
|
||||
c.readState = false
|
||||
c.writeState = lcWriteEnabled
|
||||
c.altBank = true // Start on bank2
|
||||
@ -62,7 +70,7 @@ func (c *cardLanguage) assign(a *Apple2, slot int) {
|
||||
c.applyState()
|
||||
}
|
||||
|
||||
func (c *cardLanguage) ssAction(ss uint8, write bool) {
|
||||
func (c *CardLanguage) ssAction(ss uint8, write bool) {
|
||||
c.altBank = ((ss >> 3) & 1) == 0
|
||||
action := ss & 0x3
|
||||
switch action {
|
||||
@ -101,6 +109,6 @@ func (c *cardLanguage) ssAction(ss uint8, write bool) {
|
||||
c.applyState()
|
||||
}
|
||||
|
||||
func (c *cardLanguage) applyState() {
|
||||
func (c *CardLanguage) applyState() {
|
||||
c.a.mmu.setLanguageRAM(c.readState, c.writeState == lcWriteEnabled, c.altBank)
|
||||
}
|
||||
|
@ -8,11 +8,19 @@ import (
|
||||
Logger card. It never existed, I use it to trace accesses to the card.
|
||||
*/
|
||||
|
||||
type cardLogger struct {
|
||||
// CardLogger is a fake card to log soft switch invocations
|
||||
type CardLogger struct {
|
||||
cardBase
|
||||
}
|
||||
|
||||
func (c *cardLogger) assign(a *Apple2, slot int) {
|
||||
// NewCardLogger creates a new VidHD card
|
||||
func NewCardLogger() *CardLogger {
|
||||
var c CardLogger
|
||||
c.name = "Softswitch log card"
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c *CardLogger) assign(a *Apple2, slot int) {
|
||||
for i := uint8(0x0); i <= 0xf; i++ {
|
||||
iCopy := i
|
||||
c.addCardSoftSwitchR(i, func(*ioC0Page) uint8 {
|
||||
|
@ -1,5 +1,7 @@
|
||||
package izapple2
|
||||
|
||||
import "fmt"
|
||||
|
||||
/*
|
||||
Apple II Memory Expansion Card
|
||||
|
||||
@ -37,13 +39,30 @@ const (
|
||||
memoryExpansionMask = 0x000fffff // 10 bits, 1MB
|
||||
)
|
||||
|
||||
type cardMemoryExpansion struct {
|
||||
// CardMemoryExpansion is a Memory Expansion card
|
||||
type CardMemoryExpansion struct {
|
||||
cardBase
|
||||
ram [memoryExpansionSize1024]uint8
|
||||
index int
|
||||
cardBase
|
||||
}
|
||||
|
||||
func (c *cardMemoryExpansion) assign(a *Apple2, slot int) {
|
||||
// NewCardMemoryExpansion creates a new VidHD card
|
||||
func NewCardMemoryExpansion() *CardMemoryExpansion {
|
||||
var c CardMemoryExpansion
|
||||
c.name = "Memory Expansion Card"
|
||||
c.loadRomFromResource("<internal>/MemoryExpansionCard-341-0344a.bin")
|
||||
|
||||
return &c
|
||||
}
|
||||
|
||||
// GetInfo returns smartport info
|
||||
func (c *CardMemoryExpansion) GetInfo() map[string]string {
|
||||
info := make(map[string]string)
|
||||
info["size"] = fmt.Sprintf("%vKB", len(c.ram)/1024)
|
||||
return info
|
||||
}
|
||||
|
||||
func (c *CardMemoryExpansion) assign(a *Apple2, slot int) {
|
||||
|
||||
// Read pointer position
|
||||
c.addCardSoftSwitchR(0, func(*ioC0Page) uint8 {
|
||||
|
@ -7,7 +7,8 @@ See:
|
||||
http://www.applelogic.org/files/SATURN128MAN.pdf
|
||||
*/
|
||||
|
||||
type cardSaturn struct {
|
||||
// CardSaturn is a Saturn128 card
|
||||
type CardSaturn struct {
|
||||
cardBase
|
||||
readState bool
|
||||
writeState uint8
|
||||
@ -15,11 +16,18 @@ type cardSaturn struct {
|
||||
activeBlock uint8
|
||||
}
|
||||
|
||||
// NewCardSaturn creates a new CardSaturn
|
||||
func NewCardSaturn() *CardSaturn {
|
||||
var c CardSaturn
|
||||
c.name = "Saturn 128KB Ram Card"
|
||||
return &c
|
||||
}
|
||||
|
||||
const (
|
||||
saturnBlocks = 8
|
||||
)
|
||||
|
||||
func (c *cardSaturn) assign(a *Apple2, slot int) {
|
||||
func (c *CardSaturn) assign(a *Apple2, slot int) {
|
||||
c.readState = false
|
||||
c.writeState = lcWriteEnabled
|
||||
c.altBank = true
|
||||
@ -40,7 +48,7 @@ func (c *cardSaturn) assign(a *Apple2, slot int) {
|
||||
c.applyState()
|
||||
}
|
||||
|
||||
func (c *cardSaturn) ssAction(ss uint8) {
|
||||
func (c *CardSaturn) ssAction(ss uint8) {
|
||||
switch ss {
|
||||
case 0:
|
||||
// RAM read, no writes
|
||||
@ -107,7 +115,7 @@ func (c *cardSaturn) ssAction(ss uint8) {
|
||||
c.applyState()
|
||||
}
|
||||
|
||||
func (c *cardSaturn) applyState() {
|
||||
func (c *CardSaturn) applyState() {
|
||||
c.a.mmu.setLanguageRAMActiveBlock(c.activeBlock)
|
||||
c.a.mmu.setLanguageRAM(c.readState, c.writeState == lcWriteEnabled, c.altBank)
|
||||
}
|
||||
|
@ -29,13 +29,7 @@ type CardThunderClockPlus struct {
|
||||
func NewCardThunderClockPlus() *CardThunderClockPlus {
|
||||
var c CardThunderClockPlus
|
||||
c.name = "ThunderClock+ Card"
|
||||
|
||||
data, err := loadResource("<internal>/ThunderclockPlusROM.bin")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
c.loadRom(data)
|
||||
|
||||
c.loadRomFromResource("<internal>/ThunderclockPlusROM.bin")
|
||||
return &c
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,8 @@ type CardVidHD struct {
|
||||
// NewCardVidHD creates a new VidHD card
|
||||
func NewCardVidHD() *CardVidHD {
|
||||
var c CardVidHD
|
||||
c.name = "VidHD Card"
|
||||
c.name = "VidHD Card - limited"
|
||||
c.loadRom(buildVidHDRom())
|
||||
return &c
|
||||
}
|
||||
|
||||
@ -35,8 +36,6 @@ const (
|
||||
)
|
||||
|
||||
func (c *CardVidHD) assign(a *Apple2, slot int) {
|
||||
c.loadRom(buildVidHDRom())
|
||||
|
||||
// The softswitches are outside the card reserved ss
|
||||
a.io.addSoftSwitchR(0x22, notImplementedSoftSwitchR, "VIDHD-TBCOLOR")
|
||||
a.io.addSoftSwitchW(0x22, notImplementedSoftSwitchW, "VIDHD-TBCOLOR")
|
||||
|
@ -47,10 +47,9 @@ type disketteWoz struct {
|
||||
cycleOn uint64 // Cycle when the disk was last turned on
|
||||
turning bool
|
||||
|
||||
latch uint8
|
||||
position uint32
|
||||
cycle uint64
|
||||
trackSize uint32
|
||||
latch uint8
|
||||
position uint32
|
||||
cycle uint64
|
||||
|
||||
mc3470Buffer uint8 // Four bit buffer to detect weak bits and to add latency
|
||||
|
||||
@ -95,7 +94,7 @@ func (d *disketteWoz) read(quarterTrack int, cycle uint64) uint8 {
|
||||
d.mc3470Buffer = (d.mc3470Buffer<<1 + fluxBit) & 0x0f
|
||||
bit := (d.mc3470Buffer >> 1) & 0x1 // Use the previous to last bit to add latency
|
||||
if d.mc3470Buffer == 0 && rand.Intn(100) < 3 {
|
||||
// Four consecutive zeros.It'a a fake bit.
|
||||
// Four consecutive zeros. It'a a fake bit.
|
||||
// Output a random value. 70% zero, 30% one
|
||||
bit = 1
|
||||
}
|
||||
|
20
go.mod
20
go.mod
@ -4,12 +4,30 @@ go 1.12
|
||||
|
||||
require (
|
||||
fyne.io/fyne v1.3.3
|
||||
github.com/creack/pty v1.1.11 // indirect
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200625191551-73d3c3675aa3
|
||||
github.com/google/go-cmp v0.5.2 // indirect
|
||||
github.com/kr/pretty v0.2.1 // indirect
|
||||
github.com/kr/text v0.2.0 // indirect
|
||||
github.com/pkg/profile v1.4.0
|
||||
github.com/rogpeppe/go-internal v1.6.2 // indirect
|
||||
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 // indirect
|
||||
github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd
|
||||
github.com/stretchr/objx v0.3.0 // indirect
|
||||
github.com/stretchr/testify v1.6.1 // indirect
|
||||
github.com/veandco/go-sdl2 v0.4.0
|
||||
golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee // indirect
|
||||
golang.org/x/net v0.0.0-20201010224723-4f7140c49acb // indirect
|
||||
golang.org/x/sync v0.0.0-20201008141435-b3e1573b7520 // indirect
|
||||
golang.org/x/sys v0.0.0-20201014080544-cc95f250f6bc // indirect
|
||||
golang.org/x/tools v0.0.0-20201013201025-64a9e34f3752 // indirect
|
||||
golang.org/x/tools/gopls v0.5.1 // indirect
|
||||
gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b // indirect
|
||||
gopkg.in/yaml.v2 v2.3.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect
|
||||
honnef.co/go/tools v0.0.1-2020.1.6 // indirect
|
||||
mvdan.cc/gofumpt v0.0.0-20200927160801-5bfeb2e70dd6 // indirect
|
||||
)
|
||||
|
||||
//replace fyne.io/fyne => github.com/ivanizag/fyne v1.3.4-0.20201010160818-ed5402384cff
|
||||
// replace fyne.io/fyne => ../../fyne/fyne
|
||||
replace fyne.io/fyne => ../fyne/fyne
|
||||
|
73
go.sum
73
go.sum
@ -1,7 +1,12 @@
|
||||
fyne.io/fyne v1.3.3 h1:jpdp9kTJ1ZOKQjyHZfzQGz/E3V35KVoMTawtii/1/j4=
|
||||
fyne.io/fyne v1.3.3/go.mod h1:osD/JXxGf8AC7aB+Ek0YuFF2QXzdTFFzMRM8cdqrwvQ=
|
||||
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/Kodeworks/golang-image-ico v0.0.0-20141118225523-73f0f4cfade9/go.mod h1:7uhhqiBaR4CpN0k9rMjOtjpcfGd6DG2m04zQxKnWQ0I=
|
||||
github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c=
|
||||
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
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=
|
||||
@ -17,15 +22,24 @@ github.com/godbus/dbus/v5 v5.0.3 h1:ZqHaoEF7TBzh4jzPmqVhE/5A1z9of6orkAe5uHoAeME=
|
||||
github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||
github.com/goki/freetype v0.0.0-20181231101311-fa8a33aabaff h1:W71vTCKoxtdXgnm1ECDFkfQnpdqAO00zzGXLA5yaEX8=
|
||||
github.com/goki/freetype v0.0.0-20181231101311-fa8a33aabaff/go.mod h1:wfqRWLHRBsRgkp5dmbG56SA0DmVtwrF5N3oPdI8t+Aw=
|
||||
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM=
|
||||
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||
github.com/ivanizag/fyne v1.3.4-0.20201009145545-3659dfc82080 h1:SATCcRtfx94DJSzyQOXubX2y4JA3cmhYXG+HxFQbFPM=
|
||||
github.com/ivanizag/fyne v1.3.4-0.20201009145545-3659dfc82080/go.mod h1:YHAxYk3YUUP6+erPjlYwfwvPxIaFEANAtlj00Qoh0R8=
|
||||
github.com/ivanizag/fyne v1.3.4-0.20201010160818-ed5402384cff h1:kibGHzSHlr2x6xylNflTaQM9OgEaY7BuWrSwXjCq1Ps=
|
||||
github.com/ivanizag/fyne v1.3.4-0.20201010160818-ed5402384cff/go.mod h1:osD/JXxGf8AC7aB+Ek0YuFF2QXzdTFFzMRM8cdqrwvQ=
|
||||
github.com/jackmordaunt/icns v0.0.0-20181231085925-4f16af745526/go.mod h1:UQkeMHVoNcyXYq9otUupF7/h/2tmHlhrS2zw7ZVvUqc=
|
||||
github.com/josephspurrier/goversioninfo v0.0.0-20200309025242-14b0ab84c6ca/go.mod h1:eJTEwMjXb7kZ633hO3Ln9mBUCOjX2+FlTljvpl9SYdE=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw=
|
||||
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/lucor/goinfo v0.0.0-20200401173949-526b5363a13a/go.mod h1:ORP3/rB5IsulLEBwQZCJyyV6niqmI7P4EWSmkug+1Ng=
|
||||
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
|
||||
@ -36,6 +50,12 @@ github.com/pkg/profile v1.4.0 h1:uCmaf4vVbWAOZz36k1hrQD7ijGRzLwaME8Am/7a4jZI=
|
||||
github.com/pkg/profile v1.4.0/go.mod h1:NWz/XGvpEW1FyYQ7fCx4dqYBLlfTcE+A9FLAkNKqjFE=
|
||||
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.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||
github.com/rogpeppe/go-internal v1.5.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
|
||||
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
|
||||
github.com/rogpeppe/go-internal v1.6.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
|
||||
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
|
||||
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
|
||||
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 h1:bUGsEnyNbVPw06Bs80sCeARAlK8lhwqGyi6UT8ymuGk=
|
||||
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg=
|
||||
github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd h1:ug7PpSOB5RBPK1Kg6qskGBoP3Vnj/aNYFTznWvlkGo0=
|
||||
@ -47,24 +67,45 @@ github.com/srwiley/oksvg v0.0.0-20200311192757-870daf9aa564/go.mod h1:afMbS0qvv1
|
||||
github.com/srwiley/rasterx v0.0.0-20200120212402-85cb7272f5e9 h1:m59mIOBO4kfcNCEzJNy71UkeF4XIx2EVmL9KLwDQdmM=
|
||||
github.com/srwiley/rasterx v0.0.0-20200120212402-85cb7272f5e9/go.mod h1:mvWM0+15UqyrFKqdRjY6LuAVJR0HOVhJlEgZ5JWtSWU=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
|
||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/veandco/go-sdl2 v0.4.0 h1:l9q6K+Dvpd/VlZdw2ufApKnWhAQqx9UL8Zrvbjtm3Lw=
|
||||
github.com/veandco/go-sdl2 v0.4.0/go.mod h1:FB+kTpX9YTE+urhYiClnRzpOXbiWgaU3+5F2AB78DPg=
|
||||
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/image v0.0.0-20200430140353-33d19683fad8 h1:6WW6V3x1P/jokJBpRQYUJnMHRP6isStQwCozxnU7XQw=
|
||||
golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
|
||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e h1:3G+cUijn7XD+S4eJFddp53Pv7+slrESplyjG25HgL+k=
|
||||
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/net v0.0.0-20201010224723-4f7140c49acb h1:mUVeFHoDKis5nxCAzoAi7E8Ghb86EXh/RK6wtvJIqRY=
|
||||
golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201008141435-b3e1573b7520 h1:Bx6FllMpG4NWDOfhMBz1VR2QYNp/SAOHPIAsaVmxfPo=
|
||||
golang.org/x/sync v0.0.0-20201008141435-b3e1573b7520/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
@ -73,20 +114,52 @@ golang.org/x/sys v0.0.0-20200327173247-9dae0f8f5775 h1:TC0v2RSO1u2kn1ZugjrFXkRZA
|
||||
golang.org/x/sys v0.0.0-20200327173247-9dae0f8f5775/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200720211630-cb9d2d5c5666 h1:gVCS+QOncANNPlmlO1AhlU3oxs4V9z+gTtPwIk3p2N8=
|
||||
golang.org/x/sys v0.0.0-20200720211630-cb9d2d5c5666/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201014080544-cc95f250f6bc h1:HVFDs9bKvTxP6bh1Rj9MCSo+UmafQtI8ZWDPVwVk9g4=
|
||||
golang.org/x/sys v0.0.0-20201014080544-cc95f250f6bc/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190808195139-e713427fea3f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20200328031815-3db5fc6bac03 h1:XpToik3MpT5iW3iHgNwnh3a8QwugfomvxOlyDnaOils=
|
||||
golang.org/x/tools v0.0.0-20200328031815-3db5fc6bac03/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
|
||||
golang.org/x/tools v0.0.0-20200410194907-79a7a3126eef/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200731060945-b5fad4ed8dd6/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||
golang.org/x/tools v0.0.0-20200930165741-f1523d29dbb9/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU=
|
||||
golang.org/x/tools v0.0.0-20201013201025-64a9e34f3752 h1:2ntEwh02rqo2jSsrYmp4yKHHjh0CbXP3ZtSUetSB+q8=
|
||||
golang.org/x/tools v0.0.0-20201013201025-64a9e34f3752/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU=
|
||||
golang.org/x/tools/gopls v0.5.1 h1:AF3Uh7HF08SZpKFfgJO6zfF3bbxyDXWqdkK4kMXiQ1o=
|
||||
golang.org/x/tools/gopls v0.5.1/go.mod h1:6o4z8hIK5Ef1f7mLl0oxi5+SaYAw0rfyo6YZ7TcAfRY=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
|
||||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
|
||||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||
honnef.co/go/tools v0.0.1-2020.1.6 h1:W18jzjh8mfPez+AwGLxmOImucz/IFjpNlrKVnaj2YVc=
|
||||
honnef.co/go/tools v0.0.1-2020.1.6/go.mod h1:pyyisuGw24ruLjrr1ddx39WE0y9OooInRzEYLhQB2YY=
|
||||
mvdan.cc/gofumpt v0.0.0-20200802201014-ab5a8192947d/go.mod h1:bzrjFmaD6+xqohD3KYP0H2FEuxknnBmyyOxdhLdaIws=
|
||||
mvdan.cc/gofumpt v0.0.0-20200927160801-5bfeb2e70dd6 h1:z+/YqapuV7VZPvBb3GYmuEJbA88M3PFUxaHilHYVCpQ=
|
||||
mvdan.cc/gofumpt v0.0.0-20200927160801-5bfeb2e70dd6/go.mod h1:bzrjFmaD6+xqohD3KYP0H2FEuxknnBmyyOxdhLdaIws=
|
||||
mvdan.cc/xurls/v2 v2.2.0 h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=
|
||||
mvdan.cc/xurls/v2 v2.2.0/go.mod h1:EV1RMtya9D6G5DMYPGD8zTQzaHet6Jh8gFlRgGRJeO8=
|
||||
|
@ -51,7 +51,7 @@ func fyneRun(s *state) {
|
||||
s.devices = newPanelDevices(s)
|
||||
toolbar := buildToolbar(s)
|
||||
screen := canvas.NewImageFromImage(nil)
|
||||
//screen.SetMinSize(fyne.NewSize(380, 192))
|
||||
screen.ScaleMode = canvas.ImageScalePixels // Looks worst but loads less.
|
||||
screen.SetMinSize(fyne.NewSize(280*2, 192*2))
|
||||
|
||||
container := fyne.NewContainerWithLayout(
|
||||
@ -138,9 +138,11 @@ func buildToolbar(s *state) *widget.Toolbar {
|
||||
} else {
|
||||
s.app.SendNotification(fyne.NewNotification(
|
||||
s.win.Title(),
|
||||
"Saving snapshot on 'snapshot.png'"))
|
||||
"Snapshot saved on 'snapshot.png'"))
|
||||
}
|
||||
}),
|
||||
//widget.NewToolbarSeparator(),
|
||||
//newToolbarDisk("S6D1"),
|
||||
widget.NewToolbarSpacer(),
|
||||
widget.NewToolbarAction(theme.ViewFullScreenIcon(), func() {
|
||||
s.win.SetFullScreen(!s.win.FullScreen())
|
||||
|
26
izapple2fyne/toolbarDisk.go
Normal file
26
izapple2fyne/toolbarDisk.go
Normal file
@ -0,0 +1,26 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fyne.io/fyne"
|
||||
"fyne.io/fyne/theme"
|
||||
"fyne.io/fyne/widget"
|
||||
)
|
||||
|
||||
type toolbarDisk struct {
|
||||
name string
|
||||
}
|
||||
|
||||
func newToolbarDisk(name string) *toolbarDisk {
|
||||
var tbd toolbarDisk
|
||||
tbd.name = name
|
||||
return &tbd
|
||||
}
|
||||
|
||||
func (tbd *toolbarDisk) ToolbarObject() fyne.CanvasObject {
|
||||
return widget.NewHBox(
|
||||
widget.NewIcon(theme.VolumeUpIcon()),
|
||||
widget.NewLabel(tbd.name),
|
||||
widget.NewLabel("track 12"),
|
||||
widget.NewButton("eject", nil),
|
||||
)
|
||||
}
|
Loading…
Reference in New Issue
Block a user