aboutsummaryrefslogtreecommitdiff
path: root/vcount.s
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2016-01-03 22:31:31 -0500
committerB. Watson <yalhcru@gmail.com>2016-01-03 22:31:31 -0500
commit78955cb3856cfc0115c7e2f2813132cc46c4fd23 (patch)
tree051c4061a451cbd66c42b9cca9315417fcf632c6 /vcount.s
parent3e443ad06e61cf6f67c335f657b4010efc7993fe (diff)
downloadtaipan-78955cb3856cfc0115c7e2f2813132cc46c4fd23.tar.gz
choose pallette on title screen (atari logo key)
Diffstat (limited to 'vcount.s')
-rw-r--r--vcount.s22
1 files changed, 22 insertions, 0 deletions
diff --git a/vcount.s b/vcount.s
new file mode 100644
index 0000000..067ce26
--- /dev/null
+++ b/vcount.s
@@ -0,0 +1,22 @@
+ .export _waitvcount
+
+ .include "atari.inc"
+
+; wait for VCOUNT to reach a particular value. Use this
+; to avoid updating parts of the screen while ANTIC is
+; reading from it.
+
+; c should be ((4 + Yposition) * 4), where Yposition is
+; the text line below the bottom one you're about to modify.
+
+; void __fastcall__ waitvcount(unsigned char *c)
+_waitvcount:
+ sta FR1
+
+w:
+ lda VCOUNT
+ cmp FR1
+ bne w
+
+ STA WSYNC ; finish current scanline
+ rts