ùúùúÿý+—ÿý+—ÿý+—ÿý+—ÿý+—ÿý+—ÿý+—ÿý+—ÿý+—;Optimize:
; - Superkort sourcecode

Start:
	lea	copper(pc),a0	;copperpointer til a0
	move.l	#screen,d0	;screenpointer til d0
	move.w	d0,6(a0)	;set screen startpos. in memory
	swap	d0		;swap longword (få plass til et word til)
	move.w	d0,2(a0)	;set screen endpos. in memory
	move.l	a0,$dff080	;copper in first high DMA location register
				;fortelle DMA hvor copperen befinner seg
	move.w	#$4000,$dff09a	;set bit#14, enable master-interrupt

Loop:	
	cmpi.b	#$5f,$dff006	;wait for vertical retrace, set H-bit#0-6 not 5
	bne.s	Loop		;beam must go from one side to the other
	btst	#10,$dff016	;test if bit#10 r-mousebut. is pressed
	beq	nomove		;if pressed then pause
	bsr.w	scroll		;move text one pixel
	bsr.w	scroll		;move text one pixel more (double speed)

nomove:	
	btst	#6,$bfe001	;test if left mousebut. is pressed
	bne.s	Loop		;if not, then loop

Exit:	
	move.w	#$c000,$dff09a	;disable master-interrupt again
	move.l	4,a6		;restore
	move.l	156(a6),a1	;original
	move.l	38(a1),$dff080	;copperlist

error:	
	clr.l	d0		;kill whole (32-bit) d0
	rts			;get the hell outta here

Copper:	
	dc.w	$00e0,$0000,$00e2,$0000
	dc.w	$0100,$1200
spr:	
	dc.w	$0120,$0000,$0122,$0000,$0124,$0000,$0126,$0000	;sprite ptrs...
	dc.w	$0128,$0000,$012a,$0000,$012c,$0000,$012e,$0000 ;why the hell
	dc.w	$0130,$0000,$0132,$0000,$0134,$0000,$0136,$0000	;is this in-
	dc.w	$0138,$0000,$013a,$0000,$013c,$0000,$013e,$0000	;cluded????!

	dc.w	$008e,$2871,$0090,$28d1
	dc.w	$0092,$0030,$0094,$00d8
	dc.w	$0108,$0004,$0102,$0000
	
	dc.w	$2207,$fffe,$0180,$0555	;øverste grå linje
	dc.w	$2307,$fffe,$0180,$0222	;tekst bakgrunn

	dc.w	$0180,$0000,$0182,$000a	;første tekstlinje
	dc.w	$2907,$fffe,$0182,$007f ;andre tekstlinje og nedover
	dc.w	$2a07,$fffe,$0182,$009f 
	dc.w	$2b07,$fffe,$0182,$00af	;første tall: de 2 første sifrene
	dc.w	$2c07,$fffe,$0182,$0741 ;oppgir vertikal posisjon på beamen
	dc.w	$2d07,$fffe,$0182,$0841	;de 2 neste horisontal pos.
	dc.w	$2e07,$fffe,$0182,$0a62
	dc.w	$2f07,$fffe,$0182,$0c84
	dc.w	$3007,$fffe,$0182,$0ea6
	dc.w	$3107,$fffe,$0100,$0200

	dc.w	$3507,$fffe,$0180,$0555	;nederste grå linje
	dc.w	$3607,$fffe,$0180,$0000	;skjerm bakgrunn
	dc.w	$ffff,$fffe

xpos:	dc.b	6
annen:	dc.b	0

BlitWait:macro
wait\@:	btst	#6,$dff002
	bne.s	Wait\@
	endm

Scroll:	move.l	#screen,a1		;screenpointer to a1
	add.w	#[48*11]-10,a1		;set offset
	move.l	a1,$dff050 		;blitterpointer to source A
	move.l	a1,$dff054		;pointer to dest. D
	move.w	#0,$dff064		;modulo for source A
	move.w	#0,$dff066		;modulo dest. D
	move.l	#$ffffffff,$dff044	;set all bits (don't alter pattern)
	move.w	#$19f8,$dff040		;BLCON 0 - Shift bits to left
	move.w	#$0002,$dff042		;BLCON 1
	move.w	#[64*13]+20,$dff058	;start blitter
	blitwait			;wait for blitter to finish
	move.l	#screen,a0		;screen pointer to a0
	add.l	#46,a0			;inc to offset 46 in screen buf
	moveq	#7,d0			;put 7 in d0

clr:	
	clr.w	(a0)			;clear what a0 points to
	adda.w	#48,a0			;binær addisjon til et adressereg. (a0)
	dbf	d0,clr			;gjør det 7 (d0) ganger 
	subq.b	#1,xpos			;decrement xpos
	bne.w	ret			;if not equal, branch to ret
	move.b	#6,xpos			;put #6 in xpos
	moveq	#0,d0			;put #0 in d0
	move.w	textptr,d0		;put textpointer in d0
	addq.w	#1,textptr		;increment textptr (next character)
	cmpi.w	#[endtext-text]-1,d0	;end of text?
	bne.s	nono			;no, branch to nono
	clr.w	textptr			;yes, reset textpointer

nono:	
	lea	text(pc),a0		;pointer to text in a0
	add.w	d0,a0			;move to next character
	moveq	#0,d1			;put #0 in d0
	move.b	(a0),d1			;put next character in d1
	cmp.b	#' ',d1			;is it a spacebar?
	beq.b	space			;yes, branch to space
	lea	charset(pc),a0		;no, set pointer to charset
	moveq	#79,d0			;put #79 in d0
	clr.w	charptr			;clear char pointer
	clr.w	cy			;clear char ypos in font
	moveq	#0,d2			;put #0 in d2

find:	
	cmp.b	(a0)+,d1		;is char in txt=char in charset
	beq.s	found			;yep, branch to found
	addq.w	#1,d2			;next char in charset
	cmp.w	#38,charptr		;is it char #38 in charset?
	bne	not			;no, branch to not
	move.w	#-2,charptr		;yes, set charpointer to #-2,
	add.w	#10*40,cy		;and move down 10 lines is font

not:	
	addq.w	#2,charptr		;add #2 to charpointer
	dbf	d0,find			;decrement and try again

space:	
	rts				;return

found:	
	lea	size(pc),a0		;pointer to size in a0
	add.w	d2,a0			;set offset to our character
	move.b	(a0),xpos		;put byte from size table into xpos
	lea	font(pc),a0		;pointer to font in a0
	add.w	charptr,a0		;add charpointer to a0
	add.w	cy,a0			;add ypos to a0
	move.l	#screen,a1		;pointer to screen in a1
	add.w	#44,a1			;skip the first 44 lines above screen
	moveq	#8,d0			;put #8 in d0

Copy:	
	move.b	(a0),(a1)		;copy char from font to our screen...
	move.b	1(a0),1(a1)
	add.w	#40,a0
	add.w	#48,a1
	dbf	d0,copy

ret:	
	rts				;return

size:	
	dc.b	11,11,11,11,09,09	;this table contains the width of each
	dc.b	11,11,05,11,11,09	;character in pixels, starting with
	dc.b	15,11,11,11,11,11	;the first character in charset,
	dc.b	11,09,11,11,15,11	;through the last.
	dc.b	11,11,16,11,11,05
	dc.b	05,05,11,05,08,08
	dc.b	11,11,05,05,11,08
	dc.b	11,11,11,11,11,10
	dc.b	11,11,11,11,11,11
	even

cy:	dc.w	0

charptr:dc.w	0

textptr:dc.w	0

charset:dc.b	"abcdefghijklmnopqrstuvwxyzæøå.,'?!()#/:;0123456789-"

text:	dc.b	"hoaxers                     presents                    "

endtext:even

Font:	incbin	"rarfont2.raw"

END:

screen:	blk.b	40*100,$00	;(320 bits eller) 40 bytes * 100 linjer
