#RastPort.AreaInfo
15-Dec-94 15:07:13
Sb: #44793-#RastPort.AreaInfo
Fm: Werner Kazmierzak 100041,1320
To: Jim Maddox 74667,2175
Jim,
I just tested your code and, of course, the display routine crashes the
system.
This is because you are forgetting to re-load the RastPort into a1 on
every library call – remember, a1 will mostly contain crap after a call.
This is how your display routine should look like:
dopoly1:
movem.l d2/a2-a3/a6,-(sp) ; added for security
movea.l rastport_p,a1
movea.l a1,a3 ; >> SAVE IT FOR LATER
moveq.l #10,d0
CALLSYS SetAPen,_GfxBase
lea poly1dat,a2
* movea.l rastport_p,a1 ; commented out, now it is..
movea.l a3,a1 ; >> GET RASTPORT
move.b #6,d2
move.w (a2)+,d0 ; x-coord
move.w (a2)+,d1 ; y-coord
CALLSYS AreaMove,_GfxBase
dp1loop:
move.w (a2)+,d0
move.w (a2)+,d1
movea.l a3,a1 ; >> GET RASTPORT !!
CALLSYS AreaDraw,_GfxBase
subq.b #1,d2
bne.s dp1loop ; MADE SHORT
movea.l a3,a1 ; >> GET RASTPORT !!
CALLSYS AreaEnd,_GfxBase
movem.l (sp)+,d2/a2-a3/a6 ; added for security
rts
This will run just fine on my machine. If you still have problems, then I
think you did not manage to set up TmpRas and AreaInfo correctly. Let me
know!
BTW, what sorta piece of s/w are you developing ?
– wkc – … via AP from Hamburg, Germany