Literally A Tiled Logo

by spiny / Torment

Credits

Last edited on 24 Jun 2020 by 100bit. See all edits

1 comment

spiny - 22:11 20 June 2020 #

I did this as fun learning exercise, I expect it could be halved in size with better code, but I learnt stuff, so I'm pleased :)

Source :)

; really basic 256b atari ST 'demo'
; coded by spiny / Torment
; on 14th June 2020
;
; this is my second 'size code' attempt, and the first on the ST
; literally just a tiny logo, tiled on screen :)
; was totally fun to work out though
; run in LOW RES
; reset button quits :)

main ; lets go
move.w #27,-(sp) ; escape code code
move.w #$2,-(sp) ; all this
trap #1 ; extra stuff
addq.l #4,sp ; just to
move.w #'f',-(sp) ; disable the
move.w #$2,-(sp) ; flashing cursor
trap #1 ; when running
addq.l #4,sp ; in TOS mode :)

move.w #2,-(a7) ; get physbase
trap #14 ; TOS stuff
addq.l #2,a7 ; TOS stuff
move.l d0,a0 ; a0 points to screen memory
add.l #1920,a0 ; move past title bar
move #19-1,d2 ; number of lines counter
fillscreen ; top loop to do multiple lines
move #20-1,d1 ; logos per line counter
fillline ; inner loop to do lines
move.l #logo,a1 ; a1 points to picture
move.l #4,d0 ; logo is five lines high
.loop ; local
move.l (a1)+,(a0)+ ; move one longword to screen, logo is 16px, so 2 longwords per line?
move.l (a1)+,(a0)+ ; move one longword to screen
add.l #152,a0 ; next line
dbf d0,.loop ; do loop times
sub.w #792,a0 ; move a0 backwards for next logo
dbf d1,fillline ; loop the logo line counter
add.w #1440,a0 ; skip to next line
dbf d2,fillscreen ; main loop to fill screen
forever ; never quit
bra forever ; stay atari
logo incbin COPYB1.IMG ; modify for absolute path