UP | HOME

C64 Trans Flag

What it says on the tin.

Soure code download

./flag.s, compilation and launch instructions included in file.

Binary pre-compiled file

./flag.prg (maybe not a 1-to-1 compiled version).

$ x64sc -autostart flag.prg

Screenshat

screenshot.png

Source code listing

;;; This thing is licensed under Creative Commons Zero v1.0 Universal, which essentially means
;;; "Public Domain".  (You can do anything you want without asking for permission.)
;;;
;;; SPDX-License-Identifier: CC0-1.0
;;;
;;; To compile (You can get cl65 from <https://cc65.github.io/>)
;;; $ cl65 -t c64 -C c64-asm.cfg -o flag.prg flag.s
;;;
;;; To run (You can get x64sc from <https://vice-emu.sourceforge.io/index.html>)
;;; $ x64sc -autostart flag.prg
;;;
;;; I am not an expert with actual hardware C64, but this should be capable of running on one.  I am
;;; of course not to be held responsible for any actual hardware damage.

    .export __LOADADDR__: absolute = 1
    .export __EXEHDR__: absolute = 1

.segment "LOADADDR"
    .word $0801
    .org $0801

.segment "EXEHDR"
    ;; 1312 SYS<main>
    .addr EmptyBasLine
    .word 1312
    .byte $9E
    .byte _start / 1000 .mod 10 + '0'
    .byte _start / 100  .mod 10 + '0'
    .byte _start / 10   .mod 10 + '0'
    .byte _start        .mod 10 + '0'
    .byte 0
EmptyBasLine:
    .word 0

.code
_start:
    lda #$00  ; Set border colour to black
    sta $d020

    lda #$03  ; Set text background to cyan
    sta $d021 ; This lets us not draw the top&bottom bars :)

    jsr $e544 ; Call the KERNAL internal clear screen routine
              ; See <http://unusedino.de/ec64/technical/aay/c64/rome544.htm>

    ldx #200
loop:
    ;; Full block character to each of the three bar text memory
    lda #$e0
    sta $400+5*40-1,x
    sta $400+10*40-1,x
    sta $400+15*40-1,x

    ;; Pinkish colour to mid-top & mid-bot bar colour memory
    lda #10
    sta $d800+5*40-1,x
    sta $d800+15*40-1,x

    ;; Ditto for white in the middle bar
    lda #1
    sta $d800+10*40-1,x

    dex
    bne loop

halt:
    ;; Busy spinloop :(
    jmp halt

Validate