; Setting up a simple copperlist + 1 Bitplane and copy
; a single letter onto it! No (c)ode by aLpHa oNe!
; ====================================================

	section	flashtro,code_c

	move.l 4.w,a6		; Get base of exec lib
	lea gfxlib(pc),a1	; Adress of gfxlib string to a1
	jsr -408(a6)		; Call OpenLibrary()
	move.l d0,gfxbase	; Save base of graphics.library
	move.l #bitplane,d0	; Get adress of our bitplane...
	move.w d0,bplptr+6	; ...and set up bitplaneregs in copperlist
	swap d0			;
	move.w d0,bplptr+2	;
	move.l #cop,$dff080	; Set new copperlist

	lea bitplane(pc),a0	; Adress of our bitplane to A0
	add.l #40*40,a0		; Move pointer to line 40 on it
	lea char(pc),a1		; Adress of our char to A1
	move.l #8,d0		; Height of char = 8
copy:	move.b (a1)+,(a0)	; Move a row from our char to bitplane and
				; increase charptr by one
				; *Remember 1 byte = 8 bit = 8 pixels ;)
	add.l #40,a0		; Pointer to next line in bitplane
				; *Remember 40 bytes = 320 bit = 320 pixels
	subq.l #1,d0		; Decrease heightcounter
	bne.b copy		; If not zero, continue to copy char

mouse:	btst #6,$bfe001		; Left mouse clicked ?
	bne.b mouse		; No, continue loop!

	move.l gfxbase(pc),a1	; Base of graphics.library to a1
	move.l 38(a1),$dff080	; Restore old copperlist
	jsr -414(a6)		; Call CloseLibrary()
	moveq #0,d0		; Over..
	rts			; and out!

; Stuff
; *****

cop:		dc.w	$0106,$0000,$01fc,$0000		; AGA compatible
		dc.w	$008e,$1a64,$0090,$ffc4		; Setting up display,
		dc.w	$0092,$0038,$0094,$00d0		; modulo and so on
		dc.w	$0102,$0000,$0104,$0000
		dc.w	$0106,$0000,$0108,$0000
		dc.w	$0120,$0000,$0122,$0000		; Clear spriteptrs
		dc.w	$0124,$0000,$0126,$0000
		dc.w	$0128,$0000,$012a,$0000
		dc.w	$012c,$0000,$012e,$0000
		dc.w	$0130,$0000,$0132,$0000
		dc.w	$0134,$0000,$0136,$0000
		dc.w	$0138,$0000,$013a,$0000
		dc.w	$013c,$0000,$013e,$0000
		dc.w	$0100,$1200			; 1 Bitplane
bplptr:		dc.w	$00e0,$0000			; Adress of bpl
		dc.w	$00e2,$0000
		dc.w	$0180,$0000			; Color00 = black
		dc.w	$0182,$0fff			; Color01 = white
		dc.w	$ffff,$fffe

char:		dc.b	%01111110			; our 8x8 letter
		dc.b	%11100111			; "A"
		dc.b	%11100111
		dc.b	%11111111
		dc.b	%11100111
		dc.b	%11100111
		dc.b	%11100111
		dc.b	%11100111

bitplane:	blk.b	10240,0				; Space for one
							; 320x256 bitplane
							; 40 bytes each row
							; (320 bits/pixels)
gfxlib:		dc.b	"graphics.library",0,0
gfxbase:	dc.l	0
0

Publication author

offline 3 hours

mus@shi9

0
Comments: 1160Publics: 2778Registration: 06-03-2017

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
TB Falsename
TB Falsename
11 years ago

Just to say that in fact it works just fine on hardware 🙂

0
TB Falsename
TB Falsename
11 years ago

Sorry for the delay!

musashi9, using the "A500+" preset from this toolchain: http://pouet.net/prod.php?which=58703.

It’s using Full ECS, it seems…

0
TB Falsename
TB Falsename
11 years ago

Hmmm, is there any reason why this would work perfectly on OCS and AGA but fail on ECS? Cos that’s what I’m seeing; ie no bitplane is displayed (although if I change COLOR0 I do see the BG color fine…) :/

0
boot
11 years ago

interesting 🙂

0
WayneK
11 years ago

This is my personal favourite way to store entire fonts (in a giant vertical ‘strip’) also…eg: 8×8 1bpl font:

;assume scrolltextptr in d0
lea scrolltext(pc),a0
lea (a0,d0),a0
lea fontgfx(pc),a1
move.b (a0),d1
sub.b #32,d1
lsl.w #3,d1
lea (a1,d1),a1
;now a1 points to the start of the gfx for this char
…amazingly optimised 8×8 drawing code here…

To me this is neater than the chartable-lookup stuff in some of Alpha-One’s other example source, but whatever works for you!

0
boot
11 years ago

Here, you have the fonts in binary format. 1 bit = 1 pixel.
Alpha One copy each line of fonts in a screen. The font height is 8 pixel tall so, you have 8 iterations. The move.b (a0)+,(a1)+ is the most important because here you make the action of copying. you copy a line of 8 pixels of wide. move.b can be translated by copy a byte (so 8bits wide) to A0 towards A1 and after the operation, increment the address of A0 and A1 of a unit (1 position). This operation will repeat 8 times.

Voilà

0
demoniac
18 years ago

This explains well how the bitmap characters are created.

0
Authorization
*
*

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Registration
*
*
*

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Password generation

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

0
Would love your thoughts, please comment.x
()
x