]> git.sur5r.net Git - cc65/commitdiff
atari: split color.s into bordercolor.s and bgcolor.s
authorChristian Groessler <chris@groessler.org>
Tue, 2 Apr 2019 17:10:52 +0000 (19:10 +0200)
committerOliver Schmidt <ol.sc@web.de>
Fri, 12 Apr 2019 10:49:38 +0000 (12:49 +0200)
include/atari.h
libsrc/atari/bgcolor.s [new file with mode: 0644]
libsrc/atari/bordercolor.s [new file with mode: 0644]
libsrc/atari/color.s [deleted file]

index a0d4a3d2725730867a9df8b7c1db3ef31e3ec331..899a6ac51ca6cdd556dae2d52afa5036fe6bd38b 100644 (file)
@@ -491,5 +491,11 @@ extern void atrx15p2_tgi[];
 #define PxCTL_IRQ_STATUS         0x80
 
 
+/* The following #defines will cause the matching functions calls in conio.h
+** to be overlaid by macros with the same names, saving the function call
+** overhead.
+*/
+#define _textcolor(color)        1
+
 /* End of atari.h */
 #endif
diff --git a/libsrc/atari/bgcolor.s b/libsrc/atari/bgcolor.s
new file mode 100644 (file)
index 0000000..928dfff
--- /dev/null
@@ -0,0 +1,22 @@
+;
+; Christian Groessler, 02-Apr-2019
+;
+
+        .export         _bgcolor
+
+        .include        "atari.inc"
+
+
+_bgcolor:
+        ldx     COLOR2  ; get old value
+        sta     COLOR2  ; set new value
+        and     #$0e
+        cmp     #8
+        bcs     bright
+        lda     #$0e
+        .byte   $2c     ; bit opcode, eats the next 2 bytes
+bright: lda     #0
+        sta     COLOR1
+        txa
+        ldx     #0      ; fix X
+        rts
diff --git a/libsrc/atari/bordercolor.s b/libsrc/atari/bordercolor.s
new file mode 100644 (file)
index 0000000..b519686
--- /dev/null
@@ -0,0 +1,15 @@
+;
+; Christian Groessler, 02-Apr-2019
+;
+
+        .export         _bordercolor
+
+        .include        "atari.inc"
+
+
+_bordercolor:
+        ldx     COLOR4  ; get old value
+        sta     COLOR4  ; set new value
+        txa
+        ldx     #0      ; fix X
+        rts
diff --git a/libsrc/atari/color.s b/libsrc/atari/color.s
deleted file mode 100644 (file)
index 57d0036..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-;
-; Christian Groessler, 27-Dec-2002
-;
-
-        .export         _textcolor, _bgcolor, _bordercolor
-        .import         return1
-
-        .include        "atari.inc"
-
-
-_textcolor      =       return1
-
-_bgcolor:
-        ldx     COLOR2  ; get old value
-        sta     COLOR2  ; set new value
-        and     #$0e
-        cmp     #8
-        bcs     bright
-        lda     #$0e
-        .byte   $2c     ; bit opcode, eats the next 2 bytes
-bright: lda     #0
-        sta     COLOR1
-        txa
-        ldx     #0      ; fix X
-        rts
-
-
-_bordercolor:
-        ldx     COLOR4  ; get old value
-        sta     COLOR4  ; set new value
-        txa
-        ldx     #0      ; fix X
-        rts
-