summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--README.org18
-rw-r--r--flag.prgbin0 -> 59 bytes
-rw-r--r--flag.s68
-rw-r--r--screenshot.pngbin0 -> 533289 bytes
5 files changed, 88 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..491335d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
1*.o
2*.html
diff --git a/README.org b/README.org
new file mode 100644
index 0000000..8830feb
--- /dev/null
+++ b/README.org
@@ -0,0 +1,18 @@
1#+TITLE: C64 Trans Flag
2#+OPTIONS: author:nil num:nil timestamp:nil toc:nil
3#+HTML_DOCTYPE: html5
4#+HTML_LINK_HOME: /
5#+HTML_LINK_UP: /
6What it says on the tin.
7* Soure code download
8[[./flag.s]], compilation and launch instructions included in file.
9* Binary pre-compiled file
10[[./flag.prg]] (maybe not a 1-to-1 compiled version).
11#+BEGIN_SRC sh
12 $ x64sc -autostart flag.prg
13#+END_SRC
14* Screenshat
15#+ATTR_HTML: :width 80%
16[[./screenshot.png]]
17* Source code listing
18#+INCLUDE: "./flag.s" src asm
diff --git a/flag.prg b/flag.prg
new file mode 100644
index 0000000..03c023c
--- /dev/null
+++ b/flag.prg
Binary files differ
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
diff --git a/screenshot.png b/screenshot.png
new file mode 100644
index 0000000..1457749
--- /dev/null
+++ b/screenshot.png
Binary files differ