From 3de2c9dc1a14af851edce87f02165217a7a977c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Izaguirre?= Date: Thu, 5 Aug 2021 21:12:52 +0200 Subject: [PATCH] Fixing lint warnings --- apple2Setup.go | 4 ++-- cardDisk2.go | 18 +++++------------- cardDisk2SequencerDrive.go | 4 ++-- cardMouse.go | 2 -- cardVidex.go | 2 +- characterGenerator.go | 2 +- component/microPD1990ac.go | 14 ++++++++------ frontend/a2sdl/sdlJoysticks.go | 4 ---- memoryRange.go | 1 + softSwitches2.go | 16 ++++++++-------- traceApplecorn.go | 9 ++++----- tracePascal.go | 1 + traceProDOS.go | 1 + 13 files changed, 34 insertions(+), 44 deletions(-) diff --git a/apple2Setup.go b/apple2Setup.go index 17890a9..be4d0d3 100644 --- a/apple2Setup.go +++ b/apple2Setup.go @@ -84,7 +84,7 @@ func (a *Apple2) LoadRom(filename string) error { size := len(data) if size != apple2RomSize && size != apple2eRomSize { - return errors.New("Rom size not supported") + return errors.New("rom size not supported") } romBase := 0x10000 - size @@ -218,7 +218,7 @@ func (a *Apple2) AddRomX() { func (a *Apple2) AddNoSlotClockInCard(slot int) error { cardRom := a.mmu.cardsROM[slot] if cardRom == nil { - return errors.New("No ROM available on the slot to add a no slot clock") + return errors.New("no ROM available on the slot to add a no slot clock") } nsc := newNoSlotClockDS1216(a, cardRom) a.mmu.cardsROM[slot] = nsc diff --git a/cardDisk2.go b/cardDisk2.go index 8f81385..4dd8d24 100644 --- a/cardDisk2.go +++ b/cardDisk2.go @@ -41,16 +41,6 @@ type cardDisk2Drive struct { tracksStep int // Stepmotor for tracks position. 4 steps per track } -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 - diskWriteSelfSyncCycle = 40 // Save $FF every 40 cycles. Self sync is 10 bits: 1111 1111 00 - diskMotorStartMs = 150 // Time with the disk spinning to get full speed - -) - // NewCardDisk2 creates a new CardDisk2 func NewCardDisk2() *CardDisk2 { var c CardDisk2 @@ -217,9 +207,11 @@ func (c *CardDisk2) processQ6Q7(in uint8) { } } - if c.dataLatch >= 0x80 { - //fmt.Printf("Datalacth: 0x%.2x in cycle %v\n", c.dataLatch, c.a.cpu.GetCycles()) - } + /* + if c.dataLatch >= 0x80 { + fmt.Printf("Datalach: 0x%.2x in cycle %v\n", c.dataLatch, c.a.cpu.GetCycles()) + } + */ } func (d *cardDisk2Drive) insertDiskette(name string, dt storage.Diskette) { diff --git a/cardDisk2SequencerDrive.go b/cardDisk2SequencerDrive.go index 6cbc6cf..ef27e3a 100644 --- a/cardDisk2SequencerDrive.go +++ b/cardDisk2SequencerDrive.go @@ -32,10 +32,10 @@ func (d *cardDisk2SequencerDrive) insertDiskette(filename string) error { // Discard not supported features if f.Info.DiskType != 1 { - return errors.New("Only 5.25 disks are supported") + return errors.New("only 5.25 disks are supported") } if f.Info.BootSectorFormat == 2 { // Info not available in WOZ 1.0 - return errors.New("Woz 13 sector disks are not supported") + return errors.New("woz 13 sector disks are not supported") } d.data = f diff --git a/cardMouse.go b/cardMouse.go index 7ce990e..64fe0a4 100644 --- a/cardMouse.go +++ b/cardMouse.go @@ -91,8 +91,6 @@ func (c *CardMouse) readMouse() (uint16, uint16, bool) { return xTrans, yTrans, pressed } -const mouseReponse = "10,10,+4\n" - func (c *CardMouse) assign(a *Apple2, slot int) { c.addCardSoftSwitchR(0, func(*ioC0Page) uint8 { if c.iOut == 0 { diff --git a/cardVidex.go b/cardVidex.go index 1d2dd43..b7fb6af 100644 --- a/cardVidex.go +++ b/cardVidex.go @@ -53,7 +53,7 @@ func (c *CardVidex) loadCharacterMap(filename string) error { } size := len(bytes) if size < 0x800 { - return errors.New("Character ROM size not supported for Videx") + return errors.New("character ROM size not supported for Videx") } c.charGen = bytes return nil diff --git a/characterGenerator.go b/characterGenerator.go index dfc750e..0aea307 100644 --- a/characterGenerator.go +++ b/characterGenerator.go @@ -50,7 +50,7 @@ func (cg *CharacterGenerator) load(filename string) error { } size := len(bytes) if size < charGenPageSize { - return errors.New("Character ROM size not supported") + return errors.New("character ROM size not supported") } cg.data = bytes return nil diff --git a/component/microPD1990ac.go b/component/microPD1990ac.go index 47ed619..4309834 100644 --- a/component/microPD1990ac.go +++ b/component/microPD1990ac.go @@ -69,13 +69,15 @@ func (m *MicroPD1990ac) In(clock bool, strobe bool, command uint8, dataIn bool) } func (m *MicroPD1990ac) Out() bool { - if m.command == mpd1990commandRegHold { - //panic("Output on RegHold should be a 1Hz signal. Not implemented.") - } + /* + if m.command == mpd1990commandRegHold { + panic("Output on RegHold should be a 1Hz signal. Not implemented.") + } - if m.command == mpd1990commandTimeRead { - //panic("Output on RegHold should be a 512Hz signal with LSB. Not implemented.") - } + if m.command == mpd1990commandTimeRead { + panic("Output on RegHold should be a 512Hz signal with LSB. Not implemented.") + } + */ // Return the LSB of the register shift return (m.register & 1) == 1 diff --git a/frontend/a2sdl/sdlJoysticks.go b/frontend/a2sdl/sdlJoysticks.go index 16c73aa..75b04b6 100644 --- a/frontend/a2sdl/sdlJoysticks.go +++ b/frontend/a2sdl/sdlJoysticks.go @@ -79,10 +79,6 @@ func (j *sdlJoysticks) putButtonEvent(e *sdl.JoyButtonEvent) { j.button[uint8(e.Which)*2+(e.Button%2)] = (e.State != 0) } -func mouseToJoyFull(x int32, w int32) uint8 { - return uint8(256 * x / (w + 1)) -} - func mouseToJoyCentered(x int32, w int32) uint8 { r := x - (w / 2) + 127 if r >= 255 { diff --git a/memoryRange.go b/memoryRange.go index 5fc27e4..b362aba 100644 --- a/memoryRange.go +++ b/memoryRange.go @@ -52,6 +52,7 @@ func (m *memoryRangeROM) poke(address uint16, value uint8) { // Ignore } +//lint:ignore U1000 this is used to write debug code func identifyMemory(m memoryHandler) string { ram, ok := m.(*memoryRange) if ok { diff --git a/softSwitches2.go b/softSwitches2.go index 329af0e..c3ae494 100644 --- a/softSwitches2.go +++ b/softSwitches2.go @@ -12,14 +12,14 @@ const ( ioFlagAnnunciator2 uint8 = 0x5c ioFlagAnnunciator3 uint8 = 0x5e - ioDataCassette uint8 = 0x60 - ioFlagButton0 uint8 = 0x61 - ioFlagButton1 uint8 = 0x62 - ioFlagButton2 uint8 = 0x63 - ioDataPaddle0 uint8 = 0x64 - ioDataPaddle1 uint8 = 0x65 - ioDataPaddle2 uint8 = 0x66 - ioDataPaddle3 uint8 = 0x67 + //ioDataCassette uint8 = 0x60 + //ioFlagButton0 uint8 = 0x61 + //ioFlagButton1 uint8 = 0x62 + //ioFlagButton2 uint8 = 0x63 + //ioDataPaddle0 uint8 = 0x64 + //ioDataPaddle1 uint8 = 0x65 + //ioDataPaddle2 uint8 = 0x66 + //ioDataPaddle3 uint8 = 0x67 // Not real softSwitches. Using the numbers to store the flags somewhere. ioFlagRGBCardActive uint8 = 0x7d diff --git a/traceApplecorn.go b/traceApplecorn.go index 19e27fe..68a372e 100644 --- a/traceApplecorn.go +++ b/traceApplecorn.go @@ -19,7 +19,6 @@ type traceApplecorn struct { skipConsole bool osbyteNames [256]string call mosCallData - lastDepth int wasInKernel bool } @@ -107,7 +106,7 @@ func (t *traceApplecorn) inspect() { s = fmt.Sprintf("OSNWRCH(A=%02x, '%v')", regA, ch) skip = t.skipConsole case 0xffcb: - s = fmt.Sprintf("OSNRDCH()") + s = "OSNRDCH()" skip = t.skipConsole case 0xffce: s = "OSFIND(?)" @@ -125,17 +124,17 @@ func (t *traceApplecorn) inspect() { filename := t.getTerminatedString(filenameAddress, 0x0d) s = fmt.Sprintf("OSFILE(A=%02x,FILE=%s)", regA, filename) case 0xffe0: - s = fmt.Sprintf("OSRDCH()") + s = "OSRDCH()" skip = t.skipConsole case 0xffe3: // This fallbacks to OSWRCH s = "OSASCI(?)" skip = t.skipConsole case 0xffe7: // This fallbacks to OSWRCH - s = fmt.Sprintf("OSNEWL()") + s = "OSNEWL()" skip = t.skipConsole case 0xffec: // This fallbacks to OSWRCH skip = t.skipConsole - s = fmt.Sprintf("OSNECR()") + s = "OSNECR()" case 0xffee: ch := "" if regA >= 0x20 && regA < 0x7f { diff --git a/tracePascal.go b/tracePascal.go index c645159..0a4b2e1 100644 --- a/tracePascal.go +++ b/tracePascal.go @@ -103,6 +103,7 @@ func (t *tracePascal) inspect() { See http://www.bitsavers.org/pdf/softech/softechPascalIV_intArch1981.pdf page 106 */ +//lint:ignore U1000 unused but stays as reference func (t *tracePascal) inspectPerArchitectureGuide() { bios := uint16(t.a.mmu.physicalMainRAM.peek(pascalJvabfoldL)) + uint16(t.a.mmu.physicalMainRAM.peek(pascalJvabfoldH))<<8 diff --git a/traceProDOS.go b/traceProDOS.go index 49e9829..554b077 100644 --- a/traceProDOS.go +++ b/traceProDOS.go @@ -217,6 +217,7 @@ func (t *traceProDOS) dumpDriverCall() { fmt.Printf("\n Prodos driver $%04x command %02x-%s on unit $%x, block %v to $%04x ==> ", pc, command, commandName, unit, block, address) } +//lint:ignore U1000 unused but stays as reference func (t *traceProDOS) dumpDevices() { // Active disk devices