mirror of
https://github.com/JetSetIlly/Gopher2600.git
synced 2024-06-16 03:27:39 -04:00
removed unnecessary whitespace (golangci-lint -E whitespace --fix)
update Makefile lint target
This commit is contained in:
parent
e6e3a63be8
commit
b41c6d0301
2
Makefile
2
Makefile
|
@ -20,7 +20,7 @@ generate:
|
|||
|
||||
lint:
|
||||
golangci-lint run -D govet -D errcheck -D ineffassign -D staticcheck \
|
||||
-E bodyclose -E unconvert -E misspell
|
||||
-E bodyclose -E unconvert -E misspell -E whitespace
|
||||
|
||||
vet:
|
||||
# filter out expected warnings that we are not worried about:
|
||||
|
|
|
@ -87,7 +87,6 @@ func NewLoader(filename string, mapping string) Loader {
|
|||
} else {
|
||||
ext := strings.ToUpper(path.Ext(filename))
|
||||
switch ext {
|
||||
|
||||
case ".BIN":
|
||||
fallthrough
|
||||
case ".ROM":
|
||||
|
|
|
@ -27,7 +27,6 @@ const testError = "test error: %s"
|
|||
const testErrorB = "test error B: %s"
|
||||
|
||||
func TestDuplicateErrors(t *testing.T) {
|
||||
|
||||
e := curated.Errorf(testError, "foo")
|
||||
test.Equate(t, e.Error(), "test error: foo")
|
||||
|
||||
|
|
|
@ -322,7 +322,6 @@ func (bp *breakpoints) parseCommand(tokens *commandline.Tokens) error {
|
|||
newBreaks = append(newBreaks, breaker{target: tgt, value: val})
|
||||
resolvedTarget = true
|
||||
}
|
||||
|
||||
} else {
|
||||
// make sure we've not left a previous target dangling without a value
|
||||
if !resolvedTarget {
|
||||
|
@ -347,7 +346,6 @@ func (bp *breakpoints) parseCommand(tokens *commandline.Tokens) error {
|
|||
return curated.Errorf("%v", err)
|
||||
}
|
||||
resolvedTarget = false
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -732,7 +732,6 @@ func (dbg *Debugger) processTokens(tokens *commandline.Tokens) (bool, error) {
|
|||
case cmdMemMap:
|
||||
address, ok := tokens.Get()
|
||||
if ok {
|
||||
|
||||
// if an address argument has been specified then map the address
|
||||
// in a read and write context and display the information
|
||||
|
||||
|
@ -778,7 +777,6 @@ func (dbg *Debugger) processTokens(tokens *commandline.Tokens) (bool, error) {
|
|||
} else {
|
||||
dbg.printLine(terminal.StyleFeedback, fmt.Sprintf("%v is not a mappable address", address))
|
||||
}
|
||||
|
||||
} else {
|
||||
// without an address argument print the memorymap summary table
|
||||
dbg.printLine(terminal.StyleInstrument, "%v", memorymap.Summary())
|
||||
|
@ -818,7 +816,6 @@ func (dbg *Debugger) processTokens(tokens *commandline.Tokens) (bool, error) {
|
|||
case "TOGGLE":
|
||||
*targetVal = !*targetVal
|
||||
}
|
||||
|
||||
} else {
|
||||
dbg.printLine(terminal.StyleInstrument, dbg.VCS.CPU.Status.String())
|
||||
}
|
||||
|
|
|
@ -91,7 +91,6 @@ func (dbg *Debugger) guiEventHandler(ev gui.Event) error {
|
|||
}
|
||||
|
||||
return err
|
||||
|
||||
}
|
||||
|
||||
// returns true if the terminal needs reading
|
||||
|
@ -116,7 +115,6 @@ func (dbg *Debugger) checkEvents(inputter terminal.Input) (bool, error) {
|
|||
// halt at the next manual-break point. if there is no manual break
|
||||
// point then stop immediately (or end of current frame might be
|
||||
// better)
|
||||
|
||||
} else {
|
||||
// runUntilHalt is false which means that the emulation is
|
||||
// not running. at this point, an input loop is probably
|
||||
|
|
|
@ -132,7 +132,6 @@ func (dbg *Debugger) inputLoop(inputter terminal.Input, videoCycle bool) error {
|
|||
dbg.VCS.CPU.LastResult.Defn.Effect != instructions.Flow &&
|
||||
dbg.VCS.CPU.LastResult.Defn.Effect != instructions.Subroutine &&
|
||||
dbg.VCS.CPU.LastResult.Defn.Effect != instructions.Interrupt) {
|
||||
|
||||
dbg.breakMessages = dbg.breakpoints.check(dbg.breakMessages)
|
||||
dbg.trapMessages = dbg.traps.check(dbg.trapMessages)
|
||||
dbg.watchMessages = dbg.watches.check(dbg.watchMessages)
|
||||
|
@ -154,7 +153,6 @@ func (dbg *Debugger) inputLoop(inputter terminal.Input, videoCycle bool) error {
|
|||
|
||||
// if emulation is to be halted or if we need to check the terminal
|
||||
if haltEmulation || checkTerm {
|
||||
|
||||
// always clear steptraps. if the emulation has halted for any
|
||||
// reason then any existing step trap is stale.
|
||||
dbg.stepTraps.clear()
|
||||
|
@ -218,11 +216,9 @@ func (dbg *Debugger) inputLoop(inputter terminal.Input, videoCycle bool) error {
|
|||
// user interrupts are triggered by the user (in a terminal
|
||||
// environment, usually by pressing ctrl-c)
|
||||
dbg.handleInterrupt(inputter, inputLen)
|
||||
|
||||
} else if curated.Is(err, terminal.UserAbort) {
|
||||
// like UserInterrupt but with no confirmation stage
|
||||
dbg.running = false
|
||||
|
||||
} else if curated.Is(err, script.ScriptEnd) {
|
||||
// a script that is being run will usually end with a ScriptEnd
|
||||
// error. in these instances we can say simply say so (using
|
||||
|
@ -232,7 +228,6 @@ func (dbg *Debugger) inputLoop(inputter terminal.Input, videoCycle bool) error {
|
|||
dbg.printLine(terminal.StyleFeedback, err.Error())
|
||||
}
|
||||
return nil
|
||||
|
||||
} else {
|
||||
// all other errors are passed upwards to the calling function
|
||||
return err
|
||||
|
@ -316,7 +311,6 @@ func (dbg *Debugger) inputLoop(inputter terminal.Input, videoCycle bool) error {
|
|||
// supercharger bin files however, we need a way of doing this without
|
||||
// the ROM. the TapeLoaded error allows us to do this.
|
||||
if onTapeLoaded, ok := stepErr.(supercharger.FastLoaded); ok {
|
||||
|
||||
// CPU execution has been interrupted. update state of CPU
|
||||
dbg.VCS.CPU.Interrupted = true
|
||||
|
||||
|
@ -337,7 +331,6 @@ func (dbg *Debugger) inputLoop(inputter terminal.Input, videoCycle bool) error {
|
|||
|
||||
// (re)disassemble memory on TapeLoaded error signal
|
||||
dbg.Disasm.FromMemory(nil, nil)
|
||||
|
||||
} else {
|
||||
// exit input loop if error is a plain error
|
||||
if !curated.IsAny(stepErr) {
|
||||
|
@ -403,10 +396,8 @@ func (dbg *Debugger) handleInterrupt(inputter terminal.Input, inputLen int) {
|
|||
if dbg.scriptScribe.IsActive() {
|
||||
dbg.input = []byte("SCRIPT END")
|
||||
inputLen = 11
|
||||
|
||||
} else if !inputter.IsInteractive() {
|
||||
dbg.running = false
|
||||
|
||||
} else {
|
||||
// a scriptScribe is not active nor is this a script
|
||||
// input loop. ask the user if they really want to quit
|
||||
|
|
|
@ -313,7 +313,6 @@ func (ct *ColorTerminal) TermRead(input []byte, prompt terminal.Prompt, events *
|
|||
|
||||
default:
|
||||
if unicode.IsDigit(readRune.r) || unicode.IsLetter(readRune.r) || unicode.IsSpace(readRune.r) || unicode.IsPunct(readRune.r) || unicode.IsSymbol(readRune.r) {
|
||||
|
||||
l := utf8.EncodeRune(er, readRune.r)
|
||||
|
||||
// make sure we don't overflow the input buffer
|
||||
|
|
|
@ -154,7 +154,6 @@ func (n node) string(useLabels bool, fromBranch bool) string {
|
|||
s.WriteString(")")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -375,7 +375,6 @@ func parseDefinition(defn string, trigger string) (*node, int, error) {
|
|||
default:
|
||||
wn.tag += string(defn[i])
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// make sure we've added working node to the sequence
|
||||
|
|
|
@ -127,7 +127,6 @@ func TestParser_goodGroupings(t *testing.T) {
|
|||
if test.ExpectedSuccess(t, err) {
|
||||
expectEquality(t, template, cmds)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestParser_nestedGroupings(t *testing.T) {
|
||||
|
|
|
@ -39,7 +39,6 @@ func (cmds Commands) ValidateTokens(tokens *Tokens) error {
|
|||
|
||||
for n := range cmds.cmds {
|
||||
if cmd == cmds.cmds[n].tag {
|
||||
|
||||
err := cmds.cmds[n].validate(tokens, false)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
@ -102,7 +102,6 @@ func (wtc *watches) check(previousResult string) string {
|
|||
checkString.WriteString(previousResult)
|
||||
|
||||
for i := range wtc.watches {
|
||||
|
||||
// continue loop if we're not matching last address accessed
|
||||
if wtc.watches[i].mirrors {
|
||||
if wtc.watches[i].ai.mappedAddress != wtc.vcsmem.LastAccessAddressMapped {
|
||||
|
@ -122,7 +121,6 @@ func (wtc *watches) check(previousResult string) string {
|
|||
// match watch event to the type of memory access
|
||||
if (!wtc.watches[i].ai.read && wtc.vcsmem.LastAccessWrite) ||
|
||||
(wtc.watches[i].ai.read && !wtc.vcsmem.LastAccessWrite) {
|
||||
|
||||
// match watched-for value to the value that was read/written to the
|
||||
// watched address
|
||||
if !wtc.watches[i].matchValue {
|
||||
|
@ -239,7 +237,6 @@ func (wtc *watches) parseCommand(tokens *commandline.Tokens) error {
|
|||
|
||||
// check to see if watch already exists
|
||||
for _, w := range wtc.watches {
|
||||
|
||||
// the conditions for a watch matching are very specific: both must
|
||||
// have the same address, be the same /type/ of address (read or
|
||||
// write), and the same watch value (if applicable)
|
||||
|
@ -251,7 +248,6 @@ func (wtc *watches) parseCommand(tokens *commandline.Tokens) error {
|
|||
if w.ai.address == nw.ai.address &&
|
||||
w.ai.read == nw.ai.read &&
|
||||
w.matchValue == nw.matchValue && w.value == nw.value {
|
||||
|
||||
return curated.Errorf("already being watched (%s)", w)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -236,7 +236,6 @@ func (dsm *Disassembly) decode(mc *cpu.CPU, mem *disasmMemory, copiedBanks []map
|
|||
// the cartridge addressing range can often be mapped into different
|
||||
// "segments" of cartridge memory
|
||||
for _, origin := range bank.Origins {
|
||||
|
||||
// make sure origin address is rooted correctly. we'll convert all
|
||||
// addresses to the preferred mirror at the end of the disassembly
|
||||
mem.origin = (origin & memorymap.CartridgeBits) | memorymap.OriginCart
|
||||
|
@ -252,7 +251,6 @@ func (dsm *Disassembly) decode(mc *cpu.CPU, mem *disasmMemory, copiedBanks []map
|
|||
// later if we put a valid entry at every index. entries outside of
|
||||
// the bank space will have level == EntryLevelUnused
|
||||
for address := memorymap.OriginCart; address <= memorymap.MemtopCart; address++ {
|
||||
|
||||
// continue if entry has already been decoded
|
||||
e := dsm.entries[bank.Number][address&memorymap.CartridgeBits]
|
||||
if e != nil && e.Level > EntryLevelUnmappable {
|
||||
|
|
|
@ -211,7 +211,6 @@ func (dsm *Disassembly) ExecutedEntry(bank mapper.BankInfo, result execution.Res
|
|||
if err != nil {
|
||||
return nil, curated.Errorf("disassembly: %v", err)
|
||||
}
|
||||
|
||||
} else if e.Level < EntryLevelExecuted {
|
||||
e.updateExecutionEntry(result)
|
||||
}
|
||||
|
|
|
@ -360,7 +360,6 @@ func (o Operand) checkString() (string, bool) {
|
|||
if v, ok := o.dsm.Symbols.Label.Entries[operand]; ok {
|
||||
s = v
|
||||
}
|
||||
|
||||
} else {
|
||||
if v, ok := o.dsm.Symbols.Label.Entries[operand]; ok {
|
||||
s = addrModeDecoration(v, o.result.Defn.AddressingMode)
|
||||
|
|
|
@ -73,7 +73,6 @@ func (dsm *Disassembly) Grep(output io.Writer, scope GrepScope, search string, c
|
|||
}
|
||||
|
||||
if strings.Contains(m, search) {
|
||||
|
||||
// if we've not yet printed head for the current bank then
|
||||
// print it now
|
||||
if !bankHeader {
|
||||
|
|
|
@ -29,7 +29,6 @@ type disasmMemory struct {
|
|||
}
|
||||
|
||||
func (dismem *disasmMemory) Read(address uint16) (uint8, error) {
|
||||
|
||||
// map address
|
||||
address, area := memorymap.MapAddress(address, true)
|
||||
if area == memorymap.Cartridge {
|
||||
|
@ -44,7 +43,6 @@ func (dismem *disasmMemory) Read(address uint16) (uint8, error) {
|
|||
|
||||
// address outside of cartridge range return nothing
|
||||
return 0, nil
|
||||
|
||||
}
|
||||
|
||||
func (dismem *disasmMemory) ReadZeroPage(address uint8) (uint8, error) {
|
||||
|
|
|
@ -445,7 +445,6 @@ func (scr *SdlDebug) Reflect(result reflection.LastResult) error {
|
|||
scr.pixels.dbg[i+1] = col.G
|
||||
scr.pixels.dbg[i+2] = col.B
|
||||
scr.pixels.dbg[i+3] = col.A
|
||||
|
||||
}
|
||||
|
||||
if result.WSYNC {
|
||||
|
|
|
@ -43,7 +43,6 @@ func (scr *SdlDebug) Service() {
|
|||
|
||||
// do not check for events if no event channel has been set
|
||||
if scr.events != nil {
|
||||
|
||||
// loop until there are no more events to retrieve. this loop is
|
||||
// intimately connected with the framelimiter below. what we don't want
|
||||
// to loop for too long servicing events. however:
|
||||
|
@ -59,9 +58,7 @@ func (scr *SdlDebug) Service() {
|
|||
//
|
||||
// best solution is the poll loop
|
||||
for ev := sdl.PollEvent(); ev != nil; ev = sdl.PollEvent() {
|
||||
|
||||
switch ev := ev.(type) {
|
||||
|
||||
// close window
|
||||
case *sdl.QuitEvent:
|
||||
scr.showWindow(false)
|
||||
|
@ -186,7 +183,6 @@ func (scr *SdlDebug) Service() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -238,7 +234,6 @@ func (scr *SdlDebug) convertMouseCoords(ev *sdl.MouseButtonEvent) (int, int) {
|
|||
// by the SDL renderer
|
||||
if scr.cropped {
|
||||
hp = int(float32(ev.X) / sx)
|
||||
|
||||
} else {
|
||||
hp = int(float32(ev.X)/sx) - television.HorizClksHBlank
|
||||
}
|
||||
|
|
|
@ -101,9 +101,7 @@ func (aud *Audio) SetAudio(audioData uint8) error {
|
|||
return err
|
||||
}
|
||||
aud.bufferCt = 0
|
||||
|
||||
} else {
|
||||
|
||||
remaining := int(sdl.GetQueuedAudioSize(aud.id))
|
||||
|
||||
if remaining < critQueueLength {
|
||||
|
@ -115,7 +113,6 @@ func (aud *Audio) SetAudio(audioData uint8) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
} else if remaining < minQueueLength && aud.bufferCt > 10 {
|
||||
// if we're running short of bits in the queue the queue what we have
|
||||
// in the buffer.
|
||||
|
@ -130,7 +127,6 @@ func (aud *Audio) SetAudio(audioData uint8) error {
|
|||
return err
|
||||
}
|
||||
aud.bufferCt = 0
|
||||
|
||||
} else if remaining > maxQueueLength {
|
||||
// if length of SDL audio queue is getting too long then clear it
|
||||
//
|
||||
|
|
|
@ -197,7 +197,6 @@ func (rnd *glsl) render(displaySize [2]float32, framebufferSize [2]float32, draw
|
|||
if cmd.HasUserCallback() {
|
||||
cmd.CallUserCallback(list)
|
||||
} else {
|
||||
|
||||
vertScaling := rnd.img.wm.dbgScr.getScaling(false)
|
||||
horizScaling := rnd.img.wm.dbgScr.getScaling(true)
|
||||
|
||||
|
|
|
@ -76,7 +76,6 @@ func (seq *drawlistSequence) start() float32 {
|
|||
// every call to start() should be coupled with a call to end()
|
||||
func (seq *drawlistSequence) end() {
|
||||
imgui.EndGroup()
|
||||
|
||||
}
|
||||
|
||||
// calling sameLine() before a call to element may not have the effect you
|
||||
|
|
|
@ -150,7 +150,6 @@ func (lz *LazyCart) push() {
|
|||
}
|
||||
|
||||
func (lz *LazyCart) update() {
|
||||
|
||||
lz.ID, _ = lz.id.Load().(string)
|
||||
lz.Summary, _ = lz.summary.Load().(string)
|
||||
lz.Filename, _ = lz.filename.Load().(string)
|
||||
|
|
|
@ -73,7 +73,6 @@ func (lz *LazyTV) push() {
|
|||
|
||||
// note that the requested fps value is taken from the debugger and not the TV interface
|
||||
lz.reqFPS.Store(lz.val.Dbg.GetReqFPS())
|
||||
|
||||
}
|
||||
|
||||
func (lz *LazyTV) update() {
|
||||
|
|
|
@ -36,7 +36,6 @@ func (img *SdlImgui) Service() {
|
|||
|
||||
// do not check for events if no event channel has been set
|
||||
if img.events != nil {
|
||||
|
||||
// loop until there are no more events to retrieve. this loop is
|
||||
// intimately connected with the framelimiter below. what we don't want
|
||||
// to loop for too long servicing events. however:
|
||||
|
@ -52,7 +51,6 @@ func (img *SdlImgui) Service() {
|
|||
//
|
||||
// best solution is the poll loop
|
||||
for ev := sdl.PollEvent(); ev != nil; ev = sdl.PollEvent() {
|
||||
|
||||
switch ev := ev.(type) {
|
||||
// close window
|
||||
case *sdl.QuitEvent:
|
||||
|
@ -176,7 +174,6 @@ func (img *SdlImgui) Service() {
|
|||
deltaY--
|
||||
}
|
||||
img.io.AddMouseWheelDelta(deltaX*2, deltaY*2)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -86,7 +86,6 @@ func (win *winCartRAM) draw() {
|
|||
|
||||
imgui.EndTabItem()
|
||||
}
|
||||
|
||||
}
|
||||
imgui.EndTabBar()
|
||||
|
||||
|
|
|
@ -466,7 +466,6 @@ func (win *winDbgScr) render() {
|
|||
gl.Ptr(overlayPixels.Pix))
|
||||
|
||||
win.createTextures = false
|
||||
|
||||
} else {
|
||||
gl.BindTexture(gl.TEXTURE_2D, win.screenTexture)
|
||||
gl.TexSubImage2D(gl.TEXTURE_2D, 0,
|
||||
|
|
|
@ -85,7 +85,6 @@ func (win *winDisasm) init() {
|
|||
win.colVideoStep = imgui.PackedColorFromVec4(win.img.cols.DisasmVideoStep)
|
||||
win.colBreakAddress = imgui.PackedColorFromVec4(win.img.cols.DisasmBreakAddress)
|
||||
win.colBreakOther = imgui.PackedColorFromVec4(win.img.cols.DisasmBreakOther)
|
||||
|
||||
}
|
||||
|
||||
func (win *winDisasm) destroy() {
|
||||
|
@ -131,7 +130,6 @@ func (win *winDisasm) draw() {
|
|||
if win.img.lz.Cart.NumBanks <= 1 {
|
||||
// for cartridges with just one bank we don't bother with a TabBar
|
||||
win.drawBank(pcaddr, 0, !currBank.NonCart, cpuStep)
|
||||
|
||||
} else {
|
||||
// create a new TabBar and iterate through the cartridge banks,
|
||||
// adding a page for each one
|
||||
|
|
|
@ -63,7 +63,6 @@ func (win *winLog) draw() {
|
|||
for i := clipper.DisplayStart; i < clipper.DisplayEnd; i++ {
|
||||
imgui.Text(win.img.lz.Log.Log[i].String())
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// scroll to end if log has been dirtied (ie. a new entry)
|
||||
|
|
|
@ -157,7 +157,6 @@ func (win *winPlayScr) render() {
|
|||
gl.Ptr(pixels.Pix))
|
||||
|
||||
win.createTextures = false
|
||||
|
||||
} else {
|
||||
gl.BindTexture(gl.TEXTURE_2D, win.screenTexture)
|
||||
gl.TexSubImage2D(gl.TEXTURE_2D, 0,
|
||||
|
|
|
@ -183,7 +183,6 @@ func (win *winTerm) draw() {
|
|||
if imgui.InputTextV("", &win.input,
|
||||
imgui.InputTextFlagsEnterReturnsTrue|imgui.InputTextFlagsCallbackCompletion|imgui.InputTextFlagsCallbackHistory,
|
||||
win.tabCompleteAndHistory) {
|
||||
|
||||
win.input = strings.TrimSpace(win.input)
|
||||
|
||||
// send input to inputChan even if it is the empty string because
|
||||
|
|
|
@ -719,7 +719,6 @@ func (mc *CPU) ExecuteInstruction(cycleCallback func() error) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
} else {
|
||||
// normal, non-buggy behaviour
|
||||
|
||||
|
|
|
@ -27,7 +27,6 @@ func EquateRegisters(t *testing.T, value, expectedValue interface{}) {
|
|||
t.Helper()
|
||||
|
||||
switch value := value.(type) {
|
||||
|
||||
default:
|
||||
t.Fatalf("not a register type (%T)", value)
|
||||
|
||||
|
|
|
@ -136,7 +136,6 @@ var Write []string
|
|||
// this init() function create the Read/Write arrays using the read/write maps
|
||||
// as a source
|
||||
func init() {
|
||||
|
||||
// build ReadSymbols out of the TIA and RIOT canonical read maps
|
||||
for k, v := range TIAReadSymbols {
|
||||
ReadSymbols[k] = v
|
||||
|
|
|
@ -144,7 +144,6 @@ func (cart *Cartridge) Attach(cartload cartridgeloader.Loader) error {
|
|||
// is PlusROM cartridge (which can be combined with a regular cartridge
|
||||
// format)
|
||||
if cart.fingerprintPlusROM(cartload) {
|
||||
|
||||
// try creating a NewPlusROM instance
|
||||
pr, err := plusrom.NewPlusROM(cart.mapper, cartload.OnLoaded)
|
||||
|
||||
|
|
|
@ -84,7 +84,6 @@ func fingerprintParkerBros(b []byte) bool {
|
|||
(b[i] == 0xad && b[i+1] == 0xf3 && b[i+2] == 0xbf) {
|
||||
return true
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return false
|
||||
|
|
|
@ -194,7 +194,6 @@ func (cart *dpc) Read(addr uint16, passive bool) (uint8, error) {
|
|||
if addr >= 0x0000 && addr <= 0x0003 {
|
||||
// RNG value
|
||||
return cart.registers.RNG, nil
|
||||
|
||||
} else if addr >= 0x0004 && addr <= 0x0007 {
|
||||
// music value. mix music data-fetchers:
|
||||
|
||||
|
@ -238,18 +237,15 @@ func (cart *dpc) Read(addr uint16, passive bool) (uint8, error) {
|
|||
if f >= 0x5 && cart.registers.Fetcher[f].MusicMode {
|
||||
// when in music mode return top register [col 7, ln 6-9]
|
||||
data = cart.registers.Fetcher[f].Top
|
||||
|
||||
} else {
|
||||
if addr >= 0x0008 && addr <= 0x000f {
|
||||
// display data
|
||||
data = cart.static.Gfx[gfxAddr]
|
||||
|
||||
} else if addr >= 0x0010 && addr <= 0x0017 {
|
||||
// display data AND w/flag
|
||||
if cart.registers.Fetcher[f].Flag {
|
||||
data = cart.static.Gfx[gfxAddr]
|
||||
}
|
||||
|
||||
} else if addr >= 0x0018 && addr <= 0x001f {
|
||||
// display data AND w/flag, nibbles swapped
|
||||
|
||||
|
@ -261,13 +257,11 @@ func (cart *dpc) Read(addr uint16, passive bool) (uint8, error) {
|
|||
if cart.registers.Fetcher[f].Flag {
|
||||
data = cart.static.Gfx[gfxAddr] >> 1
|
||||
}
|
||||
|
||||
} else if addr >= 0x0030 && addr <= 0x0037 {
|
||||
// display data AND w/flag, ROL
|
||||
if cart.registers.Fetcher[f].Flag {
|
||||
data = cart.static.Gfx[gfxAddr] << 1
|
||||
}
|
||||
|
||||
} else if addr >= 0x0038 && addr <= 0x003f {
|
||||
// DFx flag
|
||||
if f >= 0x5 && cart.registers.Fetcher[f].Flag {
|
||||
|
@ -297,11 +291,9 @@ func (cart *dpc) Write(addr uint16, data uint8, passive bool, poke bool) error {
|
|||
// set top register
|
||||
cart.registers.Fetcher[f].Top = data
|
||||
cart.registers.Fetcher[f].Flag = false
|
||||
|
||||
} else if addr >= 0x0048 && addr <= 0x004f {
|
||||
// set bottom register
|
||||
cart.registers.Fetcher[f].Bottom = data
|
||||
|
||||
} else if addr >= 0x0050 && addr <= 0x0057 {
|
||||
// set low register
|
||||
|
||||
|
@ -309,12 +301,9 @@ func (cart *dpc) Write(addr uint16, data uint8, passive bool, poke bool) error {
|
|||
if f >= 0x5 && cart.registers.Fetcher[f].MusicMode {
|
||||
// low is loaded with top value on low function [col 7, ln 12-14]
|
||||
cart.registers.Fetcher[f].Low = cart.registers.Fetcher[f].Top
|
||||
|
||||
} else {
|
||||
cart.registers.Fetcher[f].Low = data
|
||||
|
||||
}
|
||||
|
||||
} else if addr >= 0x0058 && addr <= 0x005f {
|
||||
// set high register
|
||||
cart.registers.Fetcher[f].Hi = data
|
||||
|
@ -327,7 +316,6 @@ func (cart *dpc) Write(addr uint16, data uint8, passive bool, poke bool) error {
|
|||
// set osc clock [col 7, ln 20-22]
|
||||
cart.registers.Fetcher[f].OSCclock = data&0x20 == 0x20
|
||||
}
|
||||
|
||||
} else if addr >= 0x0070 && addr <= 0x0077 {
|
||||
// reset random number generator
|
||||
cart.registers.RNG = 0xff
|
||||
|
|
|
@ -131,7 +131,6 @@ func (n *network) send(data uint8, send bool) {
|
|||
var r bytes.Buffer
|
||||
r.ReadFrom(resp.Body)
|
||||
n.respChan <- r
|
||||
|
||||
}(n.sendBuffer, n.ai)
|
||||
|
||||
// a copy of the sendBuffer has been passed to the new goroutine so we
|
||||
|
|
|
@ -127,7 +127,6 @@ func (tap *FastLoad) load() (uint8, error) {
|
|||
// a function disguised as an error type. The VCS knows how to interpret
|
||||
// this error and will call the function
|
||||
return 0, FastLoaded(func(mc *cpu.CPU, ram *vcs.RAM, tmr *timer.Timer) error {
|
||||
|
||||
// initialise VCS RAM with zeros
|
||||
for a := uint16(0x80); a <= 0xff; a++ {
|
||||
ram.Poke(a, 0x00)
|
||||
|
|
|
@ -139,7 +139,6 @@ func (tap *SoundLoad) step() {
|
|||
return
|
||||
}
|
||||
tap.idx++
|
||||
|
||||
}
|
||||
|
||||
// Rewind implements the mapper.CartTapeBus interface
|
||||
|
|
|
@ -40,7 +40,6 @@ const mp3SourceBitDepth = 16
|
|||
//
|
||||
// !!TODO: handle multiple mp3/wav files to create one single multiload tape
|
||||
func getPCM(cl cartridgeloader.Loader) (*audio.Float32Buffer, error) {
|
||||
|
||||
// try interpreting data as a WAV file
|
||||
wavDec := wav.NewDecoder(&pcmDecoder{data: cl.Data})
|
||||
if wavDec.IsValidFile() {
|
||||
|
@ -96,7 +95,6 @@ func getPCM(cl cartridgeloader.Loader) (*audio.Float32Buffer, error) {
|
|||
|
||||
logger.Log(soundloadLogTag, "loading from mp3 file")
|
||||
return b.AsFloat32Buffer(), nil
|
||||
|
||||
}
|
||||
|
||||
// pcmDecoder is an implementation of io.ReadSeeker.
|
||||
|
|
|
@ -93,7 +93,6 @@ func (aut *Auto) HandleEvent(event ports.Event, data ports.EventData) error {
|
|||
aut.toKeyboard()
|
||||
case ports.KeyboardUp:
|
||||
aut.toKeyboard()
|
||||
|
||||
}
|
||||
|
||||
err := aut.controller.HandleEvent(event, data)
|
||||
|
|
|
@ -139,7 +139,6 @@ const (
|
|||
// HandleEvent implements Peripheral interface
|
||||
func (pan *Panel) HandleEvent(event Event, value EventData) error {
|
||||
switch event {
|
||||
|
||||
case PanelSelect:
|
||||
pan.selectPressed = value.(bool)
|
||||
|
||||
|
@ -166,7 +165,6 @@ func (pan *Panel) HandleEvent(event Event, value EventData) error {
|
|||
|
||||
case PanelPowerOff:
|
||||
return curated.Errorf(PowerOff)
|
||||
|
||||
}
|
||||
|
||||
pan.write()
|
||||
|
|
|
@ -67,7 +67,6 @@ func (ch *channel) String() string {
|
|||
// tick should be called at a frequency of 30Khz. when the 10Khz clock is
|
||||
// required, the frequency clock is increased by a factor of three.
|
||||
func (ch *channel) tick() {
|
||||
|
||||
// the following resets the volume if the control register is zero. this
|
||||
// condition was originally added to solve the problem of the silence value
|
||||
// emitted by Pitfall not being zero (which is a problem if the machine
|
||||
|
@ -114,7 +113,6 @@ func (ch *channel) tick() {
|
|||
((ch.regControl&0x01 == 0x0) && ch.au.div31[ch.poly5ct] != 0) ||
|
||||
((ch.regControl&0x01 == 0x1) && ch.au.poly5bit[ch.poly5ct] != 0) ||
|
||||
((ch.regControl&0x0f == 0xf) && ch.au.poly5bit[ch.poly5ct] != prevBit5) {
|
||||
|
||||
if ch.regControl&0x04 == 0x04 {
|
||||
// use pure clock
|
||||
|
||||
|
@ -141,7 +139,6 @@ func (ch *channel) tick() {
|
|||
ch.actualVol = ch.regVolume
|
||||
}
|
||||
}
|
||||
|
||||
} else if ch.regControl&0x08 == 0x08 {
|
||||
// use poly poly5/poly9
|
||||
|
||||
|
|
|
@ -114,7 +114,6 @@ func newMissileSprite(label string, tv television.Television, hblank, hmoveLatch
|
|||
ms.position.Reset()
|
||||
|
||||
return &ms, nil
|
||||
|
||||
}
|
||||
|
||||
// Label returns the label for the sprite
|
||||
|
|
|
@ -247,7 +247,6 @@ func (ps playerSprite) String() string {
|
|||
|
||||
s.WriteString(")")
|
||||
notes = true
|
||||
|
||||
} else if ps.ScanCounter.IsLatching() {
|
||||
if notes {
|
||||
s.WriteString(",")
|
||||
|
@ -259,7 +258,6 @@ func (ps playerSprite) String() string {
|
|||
// value
|
||||
if (ps.ScanCounter.IsActive() || ps.ScanCounter.IsLatching()) &&
|
||||
ps.SizeAndCopies != 0x0 && ps.SizeAndCopies != 0x5 && ps.SizeAndCopies != 0x07 {
|
||||
|
||||
switch ps.ScanCounter.Cpy {
|
||||
case 0:
|
||||
case 1:
|
||||
|
@ -661,7 +659,6 @@ func (ps *playerSprite) setNUSIZ(value uint8) {
|
|||
} else if ps.futureStart.Remaining() >= 2 &&
|
||||
ps.SizeAndCopies != value && ps.SizeAndCopies != 0x00 &&
|
||||
(value == 0x05 || value == 0x07) {
|
||||
|
||||
// this branch applies when a sprite is changing from a single
|
||||
// width sprite to a double/quadruple width sprite. in that
|
||||
// instance we drop the drawing event if it has only recently
|
||||
|
|
|
@ -106,7 +106,6 @@ type Video struct {
|
|||
func NewVideo(mem bus.ChipBus,
|
||||
pclk *phaseclock.PhaseClock, hsync *polycounter.Polycounter,
|
||||
tv television.Television, hblank, hmoveLatch *bool) (*Video, error) {
|
||||
|
||||
vd := &Video{
|
||||
Collisions: newCollisions(mem),
|
||||
Playfield: newPlayfield(pclk, hsync),
|
||||
|
@ -311,7 +310,6 @@ func (vd *Video) Pixel() uint8 {
|
|||
element = ElementBackground
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
vd.LastElement = element
|
||||
|
|
|
@ -29,12 +29,10 @@ import (
|
|||
// Lint the disassembly of the load ROM. Currently, the function looks for read
|
||||
// instructions that target non-addressible TIA and RIOT addresses.
|
||||
func Lint(dsm *disassembly.Disassembly, output io.Writer) error {
|
||||
|
||||
// look at every bank in the disassembly
|
||||
citr := dsm.NewCartIteration()
|
||||
citr.Start()
|
||||
for b, ok := citr.Start(); ok; b, ok = citr.Next() {
|
||||
|
||||
// create a new iteration for the bank
|
||||
bitr, err := dsm.NewBankIteration(disassembly.EntryLevelBlessed, b)
|
||||
if err != nil {
|
||||
|
@ -43,7 +41,6 @@ func Lint(dsm *disassembly.Disassembly, output io.Writer) error {
|
|||
|
||||
// iterate through disassembled bank
|
||||
for _, e := bitr.Start(); e != nil; _, e = bitr.Next() {
|
||||
|
||||
// if instruction has a read opcode, and the addressing mode seems
|
||||
// to be reading from non-read addresses in TIA or RIOT space then
|
||||
// create a lint warning
|
||||
|
|
|
@ -64,7 +64,6 @@ func (hw *helpWriter) Help(output io.Writer, banner string, subModes []string, a
|
|||
|
||||
// add sub-mode information
|
||||
if len(subModes) > 0 {
|
||||
|
||||
// add an additional new line if we've already printed flag information
|
||||
if len(helpLines) > 2 {
|
||||
output.Write([]byte("\n"))
|
||||
|
|
|
@ -69,7 +69,6 @@ func CartridgeMemory(mem *cartridge.Cartridge, patchFile string) (bool, error) {
|
|||
// walk through lines
|
||||
lines := strings.Split(string(buffer), "\n")
|
||||
for i := 0; i < len(lines); i++ {
|
||||
|
||||
// ignore empty lines
|
||||
if len(lines[i]) == 0 {
|
||||
continue // for loop
|
||||
|
@ -100,7 +99,6 @@ func CartridgeMemory(mem *cartridge.Cartridge, patchFile string) (bool, error) {
|
|||
// split values into parts
|
||||
values := strings.Split(pokeLine[1], " ")
|
||||
for j := 0; j < len(values); j++ {
|
||||
|
||||
// trim space around each value
|
||||
values[j] = strings.TrimSpace(values[j])
|
||||
|
||||
|
|
|
@ -56,7 +56,6 @@ func Play(tv television.Television, scr gui.GUI, newRecording bool, cartload car
|
|||
// if supplied cartridge name is actually a playback file then set
|
||||
// recording variable and dump cartridgeLoader information
|
||||
if recorder.IsPlaybackFile(cartload.Filename) {
|
||||
|
||||
// do not allow this if a new recording has been requested
|
||||
if newRecording {
|
||||
return curated.Errorf("playmode: %v", "cannot make a new recording using a playback file")
|
||||
|
@ -130,7 +129,6 @@ func Play(tv television.Television, scr gui.GUI, newRecording bool, cartload car
|
|||
if err != nil {
|
||||
return curated.Errorf("playmode: %v", err)
|
||||
}
|
||||
|
||||
} else if recording != "" {
|
||||
// not a new recording but a recording has been supplied. this is a
|
||||
// playback request
|
||||
|
@ -156,7 +154,6 @@ func Play(tv television.Television, scr gui.GUI, newRecording bool, cartload car
|
|||
if err != nil {
|
||||
return curated.Errorf("playmode: %v", err)
|
||||
}
|
||||
|
||||
} else {
|
||||
// no new recording requested and no recording given. this is a 'normal'
|
||||
// launch of the emalator for regular play
|
||||
|
|
|
@ -119,7 +119,6 @@ func IsPlaybackFile(filename string) bool {
|
|||
}
|
||||
if string(b) != magicString+"\n" {
|
||||
return false
|
||||
|
||||
}
|
||||
|
||||
// version number verification
|
||||
|
|
|
@ -82,7 +82,6 @@ func (plb Playback) EndFrame() (bool, error) {
|
|||
}
|
||||
|
||||
return false, nil
|
||||
|
||||
}
|
||||
|
||||
// NewPlayback is the preferred method of implementation for the Playback type.
|
||||
|
|
|
@ -294,14 +294,12 @@ func RegressRun(output io.Writer, verbose bool, filterKeys []string) error {
|
|||
output.Write([]byte(fmt.Sprintf(" ^^ %s\n", err)))
|
||||
}
|
||||
}
|
||||
|
||||
} else if !ok {
|
||||
numFail++
|
||||
output.Write([]byte(fmt.Sprintf("\rfailure: %s\n", reg)))
|
||||
if verbose && failm != "" {
|
||||
output.Write([]byte(fmt.Sprintf(" ^^ %s\n", failm)))
|
||||
}
|
||||
|
||||
} else {
|
||||
numSucceed++
|
||||
output.Write([]byte(fmt.Sprintf("\rsucceed: %s\n", reg)))
|
||||
|
|
|
@ -329,7 +329,6 @@ func (reg *VideoRegression) regress(newRegression bool, output io.Writer, msg st
|
|||
failm := "unexpected end of state. entries remaining in recorded state file"
|
||||
return false, failm, nil
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if dig.Hash() != reg.digest {
|
||||
|
|
|
@ -40,7 +40,6 @@ type setupEntry interface {
|
|||
// when starting a database session we must add the details of the entry types
|
||||
// that will be found in the database
|
||||
func initDBSession(db *database.Session) error {
|
||||
|
||||
// add entry types
|
||||
if err := db.RegisterEntryType(panelSetupID, deserialisePanelSetupEntry); err != nil {
|
||||
return err
|
||||
|
|
|
@ -148,7 +148,6 @@ func (tv *television) AddAudioMixer(m AudioMixer) {
|
|||
|
||||
// Reset implements the Television interface.
|
||||
func (tv *television) Reset() error {
|
||||
|
||||
// we definitely do not call this on television initialisation because the
|
||||
// rest of the system may not be yet be in a suitable state
|
||||
|
||||
|
@ -169,7 +168,6 @@ func (tv *television) Reset() error {
|
|||
|
||||
// Signal implements the Television interface
|
||||
func (tv *television) Signal(sig SignalAttributes) error {
|
||||
|
||||
// mix audio before we do anything else
|
||||
if sig.AudioUpdate {
|
||||
for f := range tv.mixers {
|
||||
|
@ -220,7 +218,6 @@ func (tv *television) Signal(sig SignalAttributes) error {
|
|||
// !!TODO: replace VSYNC signal with extended HSYNC signal
|
||||
if sig.VSync && !tv.lastSignal.VSync {
|
||||
tv.vsyncCount = 0
|
||||
|
||||
} else if !sig.VSync && tv.lastSignal.VSync {
|
||||
if tv.vsyncCount > 0 {
|
||||
err := tv.newFrame(true)
|
||||
|
|
|
@ -37,7 +37,6 @@ func Equate(t *testing.T, value, expectedValue interface{}) {
|
|||
t.Helper()
|
||||
|
||||
switch value := value.(type) {
|
||||
|
||||
default:
|
||||
t.Fatalf("unhandled type for Equate() function (%T))", value)
|
||||
|
||||
|
|
Loading…
Reference in a new issue