summaryrefslogtreecommitdiff
path: root/flag.s
diff options
context:
space:
mode:
authorGravatar Uko Kokņevičs2024-02-24 17:58:14 +0200
committerGravatar Uko Kokņevičs2024-02-24 17:58:14 +0200
commit734bb850f2167ac2fcd254eb20593ef2c2f6caae (patch)
treeb53fe4f8727ebfa2b3468cf7f446fffeb05ea74f /flag.s
downloadc64-trans-flag-main.tar.gz
c64-trans-flag-main.tar.xz
c64-trans-flag-main.zip
Initial CommitHEADmain
Diffstat (limited to 'flag.s')
-rw-r--r--flag.s68
1 files changed, 68 insertions, 0 deletions
diff --git a/flag.s b/flag.s
new file mode 100644
index 0000000..7865fac
--- /dev/null
+++ b/flag.s
@@ -0,0 +1,68 @@
1;;; This thing is licensed under Creative Commons Zero v1.0 Universal, which essentially means
2;;; "Public Domain". (You can do anything you want without asking for permission.)
3;;;
4;;; SPDX-License-Identifier: CC0-1.0
5;;;
6;;; To compile (You can get cl65 from <https://cc65.github.io/>)
7;;; $ cl65 -t c64 -C c64-asm.cfg -o flag.prg flag.s
8;;;
9;;; To run (You can get x64sc from <https://vice-emu.sourceforge.io/index.html>)
10;;; $ x64sc -autostart flag.prg
11;;;
12;;; I am not an expert with actual hardware C64, but this should be capable of running on one. I am
13;;; of course not to be held responsible for any actual hardware damage.
14
15 .export __LOADADDR__: absolute = 1
16 .export __EXEHDR__: absolute = 1
17
18.segment "LOADADDR"
19 .word $0801
20 .org $0801
21
22.segment "EXEHDR"
23 ;; 1312 SYS<main>
24 .addr EmptyBasLine
25 .word 1312
26 .byte $9E
27 .byte _start / 1000 .mod 10 + '0'
28 .byte _start / 100 .mod 10 + '0'
29 .byte _start / 10 .mod 10 + '0'
30 .byte _start .mod 10 + '0'
31 .byte 0
32EmptyBasLine:
33 .word 0
34
35.code
36_start:
37 lda #$00 ; Set border colour to black
38 sta $d020
39
40 lda #$03 ; Set text background to cyan
41 sta $d021 ; This lets us not draw the top&bottom bars :)
42
43 jsr $e544 ; Call the KERNAL internal clear screen routine
44 ; See <http://unusedino.de/ec64/technical/aay/c64/rome544.htm>
45
46 ldx #200
47loop:
48 ;; Full block character to each of the three bar text memory
49 lda #$e0
50 sta $400+5*40-1,x
51 sta $400+10*40-1,x
52 sta $400+15*40-1,x
53
54 ;; Pinkish colour to mid-top & mid-bot bar colour memory
55 lda #10
56 sta $d800+5*40-1,x
57 sta $d800+15*40-1,x
58
59 ;; Ditto for white in the middle bar
60 lda #1
61 sta $d800+10*40-1,x
62
63 dex
64 bne loop
65
66halt:
67 ;; Busy spinloop :(
68 jmp halt