Re: A89: compiling


[Prev][Next][Index][Thread]

Re: A89: compiling



Alright, I got it compiled using doors os.  Now, if someone who _knows_ 68k could help me out and tell me what's wrong with this findpixel routine, I would appreciate it ...
 
thanks
 include "doorsos.h"
 include "userlib.h"

 xdef _main
 xdef _comment


_main:

	clr.l	d0
	lea	$4C00,a0	;video mem adress into a0
	move.w	#92,d0		;93 lines
\clr	clr.l	(a0)+
	clr.l	(a0)+
	clr.l	(a0)+
	clr.l	(a0)+
	clr.l	(a0)+
	lea	10(a0),a0	;next line in the video mem
	dbra	d0,\clr	;repeats

 move.l #70,d0
 move.l #50,d1
 bsr FindPixel
 and.w #$ffff,(a0)
 jmp userlib::idle_loop


;Input = FindPixel input & a1 as 16x16 sprite pointer
;OutPut = sprite & a0, d2, d3 destroyed

PutSprite:
 move.l #30,d2
 move.w #15,d3
 bsr FindPixel
psLoop:
 move.w (a1),d1
 swap d1
 lsr.l d0,d1
 move.l d1,(a0)
 add.l d2,a0
 dbra d3,psLoop
 rts


;Input = d0, d1 as x,y
;Output = a0 as video mem addr, d0 as byte offset

FindPixel:

 move.l #$4c00,a0
 mulu #30,d1
 add.l d1,a0
 move.w d0,d1
 lsr.b #3,d1
 add.l d1,a0
 and.b #7,d0
 rts

_comment:

 dc.b "sprite / fp test",0

 end