aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Degirolmo2011-10-07 12:29:10 -0300
committerJavier Degirolmo2011-10-07 12:29:10 -0300
commitec2abd03428ae2c282860f0f2adb0c974586ff4b (patch)
tree4ce9e39581442b44450dbb9d4952a6927e752251
parent178968cc2fc4c32fb918ebb4ccd24d78b64cd73f (diff)
Fixed self-looping timer B
-rw-r--r--README5
-rw-r--r--built/echo-timer-version-d.binbin0 -> 32768 bytes
-rw-r--r--src-z80/core/main.z8016
3 files changed, 12 insertions, 9 deletions
diff --git a/README b/README
index 150d9fa..122c26c 100644
--- a/README
+++ b/README
@@ -49,4 +49,7 @@ Available builds:
Timer test. Only timer B is reloaded when it fires, timer A is left to
loop on its own.
built/echo-timer-version-c.bin
- Timer test. Both timers are left to loop on their own.
+ Timer test. Both timers are left to loop on their own. Code for
+ initializing timer B is wrong so it doesn't work properly.
+ built/echo-timer-version-d.bin
+ What the previous ROM should have been, fixed timer B :|
diff --git a/built/echo-timer-version-d.bin b/built/echo-timer-version-d.bin
new file mode 100644
index 0000000..bf92e9b
--- /dev/null
+++ b/built/echo-timer-version-d.bin
Binary files differ
diff --git a/src-z80/core/main.z80 b/src-z80/core/main.z80
index 4018a1b..cb0329e 100644
--- a/src-z80/core/main.z80
+++ b/src-z80/core/main.z80
@@ -87,8 +87,8 @@ EntryPoint:
ld (ix+0), $25
ld (ix+1), $03
ld (ix+0), $26
- ld (ix+0), $C9
- ld (ix+1), $FF
+ ld (ix+1), $C9
+ ;ld (ix+1), $FF
ld (ix+0), $27
ld (ix+1), $3F
@@ -159,15 +159,15 @@ DoTick:
bit 0, a
call nz, UpdatePCM
- ld (ix+0), $26 ; Reset timer
-.timerset:
- ld (ix+1), $C8
+; ld (ix+0), $26 ; Reset timer
+;.timerset:
+; ld (ix+1), $C8
ld (ix+0), $27
ld (ix+1), $2F
- ld a, (.timerset+3) ; $C8 is too fast, $C9 is too slow
- xor $01 ; So, we alternate between them to compensate
- ld (.timerset+3), a
+; ld a, (.timerset+3) ; $C8 is too fast, $C9 is too slow
+; xor $01 ; So, we alternate between them to compensate
+; ld (.timerset+3), a
PollPCM