mirror of
https://github.com/ivanizag/izapple2.git
synced 2024-06-15 08:29:28 +00:00
Original BrainBoard card
This commit is contained in:
parent
e17033329d
commit
f0f8d6448e
|
@ -51,11 +51,13 @@ func (at *apple2Tester) getText80() string {
|
||||||
return screen.RenderTextModeString(at.a, true, false, false, at.a.isApple2e)
|
return screen.RenderTextModeString(at.a, true, false, false, at.a.isApple2e)
|
||||||
}
|
}
|
||||||
|
|
||||||
func buildTerminateConditionCycles(cycles uint64) terminateConditionFunc {
|
/*
|
||||||
return func(a *Apple2) bool {
|
func buildTerminateConditionCycles(cycles uint64) terminateConditionFunc {
|
||||||
return a.cpu.GetCycles() > cycles
|
return func(a *Apple2) bool {
|
||||||
|
return a.cpu.GetCycles() > cycles
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
*/
|
||||||
|
|
||||||
const textCheckInterval = uint64(100_000)
|
const textCheckInterval = uint64(100_000)
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ func newCardBrainBoardBuilder() *cardBuilder {
|
||||||
} else if bank == "down" {
|
} else if bank == "down" {
|
||||||
c.isBankB = true
|
c.isBankB = true
|
||||||
} else {
|
} 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)
|
dips, err := paramsGetDIPs(params, "dips", 8)
|
||||||
|
|
|
@ -29,6 +29,8 @@ func TestBrainBoardCardWozaniam(t *testing.T) {
|
||||||
}
|
}
|
||||||
at.run()
|
at.run()
|
||||||
|
|
||||||
|
at.terminateCondition = buildTerminateConditionText(at, "_@_@_@_@_@_@_@_@_@_@_@_@_@_@_@_@_@_@_@_@", false, 100_000)
|
||||||
|
|
||||||
text := at.getText()
|
text := at.getText()
|
||||||
if !strings.Contains(text, "_@_@_@_@_@_@_@_@_@_@_@_@_@_@_@_@_@_@_@_@") {
|
if !strings.Contains(text, "_@_@_@_@_@_@_@_@_@_@_@_@_@_@_@_@_@_@_@_@") {
|
||||||
t.Errorf("Expected screen filled with _@_@', got '%s'", text)
|
t.Errorf("Expected screen filled with _@_@', got '%s'", text)
|
||||||
|
@ -38,9 +40,7 @@ func TestBrainBoardCardWozaniam(t *testing.T) {
|
||||||
func TestBrainBoardCardIntegerBasic(t *testing.T) {
|
func TestBrainBoardCardIntegerBasic(t *testing.T) {
|
||||||
at := buildBrainBoardTester(t, "brainboard,switch=down")
|
at := buildBrainBoardTester(t, "brainboard,switch=down")
|
||||||
|
|
||||||
at.terminateCondition = func(a *Apple2) bool {
|
at.terminateCondition = buildTerminateConditionText(at, "APPLE ][\n>", false, 1_000_000)
|
||||||
return a.cpu.GetCycles() > 10_000_000
|
|
||||||
}
|
|
||||||
at.run()
|
at.run()
|
||||||
|
|
||||||
text := at.getText()
|
text := at.getText()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user