Skip to content

Commit

Permalink
Original BrainBoard card
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanizag committed Jan 27, 2024
1 parent e170333 commit f0f8d64
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
10 changes: 6 additions & 4 deletions apple2Tester.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@ func (at *apple2Tester) getText80() string {
return screen.RenderTextModeString(at.a, true, false, false, at.a.isApple2e)
}

func buildTerminateConditionCycles(cycles uint64) terminateConditionFunc {
return func(a *Apple2) bool {
return a.cpu.GetCycles() > cycles
/*
func buildTerminateConditionCycles(cycles uint64) terminateConditionFunc {
return func(a *Apple2) bool {
return a.cpu.GetCycles() > cycles
}
}
}
*/

const textCheckInterval = uint64(100_000)

Expand Down
2 changes: 1 addition & 1 deletion cardBrainBoard.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func newCardBrainBoardBuilder() *cardBuilder {
} else if bank == "down" {
c.isBankB = true
} else {
return nil, fmt.Errorf("Invalid bank '%s', must be up or down", bank)
return nil, fmt.Errorf("invalid bank '%s', must be up or down", bank)
}

dips, err := paramsGetDIPs(params, "dips", 8)
Expand Down
6 changes: 3 additions & 3 deletions cardBrainBoard_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ func TestBrainBoardCardWozaniam(t *testing.T) {
}
at.run()

at.terminateCondition = buildTerminateConditionText(at, "_@_@_@_@_@_@_@_@_@_@_@_@_@_@_@_@_@_@_@_@", false, 100_000)

text := at.getText()
if !strings.Contains(text, "_@_@_@_@_@_@_@_@_@_@_@_@_@_@_@_@_@_@_@_@") {
t.Errorf("Expected screen filled with _@_@', got '%s'", text)
Expand All @@ -38,9 +40,7 @@ func TestBrainBoardCardWozaniam(t *testing.T) {
func TestBrainBoardCardIntegerBasic(t *testing.T) {
at := buildBrainBoardTester(t, "brainboard,switch=down")

at.terminateCondition = func(a *Apple2) bool {
return a.cpu.GetCycles() > 10_000_000
}
at.terminateCondition = buildTerminateConditionText(at, "APPLE ][\n>", false, 1_000_000)
at.run()

text := at.getText()
Expand Down

0 comments on commit f0f8d64

Please sign in to comment.