09 September 2011, 22:51 | #1 |
AMOS Extensions Developer
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
|
Filling with the blitter...
Hi,
I'm trying to fill an area of the screen, but it doesn't seem to be working. I'm probably doing something stupid (so feel free to point it out! ), but can't seem to spot it I did try searching online for some example code, but all I could find were lots of pages from the Amiga HRM - I already have the real thing. Here's my code... Code:
lea.l screen+572+8000,a0 ;destination move.w #26,d0 ;modulo, was #28 move.w #$2D87,d1 ;BLTSIZE, hhhhhhhhhhwwwwww ; 0001100100000111 ;TEMP: 0010110110000111=$2B87 ; width=7 words, ; height=100 lines ;set to $1907 after debugging done ;$2D87 is perfection! ;) jsr fillscreen rts fillscreen: ;- descending mode must be used ;- set inclusive (bit #3) or exclusive (bit #4) in BLTCON1 ;- set bit #2 of BLTCON1 to fill area outside of lines btst #6,DMACONR ;safety check .waitblit btst #6,DMACONR ;blitter ready? bne .waitblit move.l a0,BLTDPTH ;a0=destination address and source move.l a0,BLTCPTH move.w d0,BLTDMOD ;d0=modulo (e.g. 36 for lowres) * clr.w BLTCON1 ;d1=size of area, in BLTSIZE format bset #1,BLTCON1 ;descending mode bset #2,BLTCON1 ;fill carry input bset #3,BLTCON1 ;inclusive fill enable move.w #$0301,BLTCON0 ;use D & C, LF=2 (not A&B) * move.w #$FFFF,BLTAFWM * move.w #$FFFF,BLTALWM move.w d1,BLTSIZE rts Regards, Lonewolf10 |
10 September 2011, 02:14 | #2 | |
Registered User
Join Date: Mar 2009
Location: N/A
Posts: 23
|
Hi Lonewolf10,
in your fill mode combination, you don't need the modulo value In this case, it is simply cleared and your BLTCON1 was not correct set. try this code for filling one bitplane with the size 320*256 Code:
Fill: btst.b #6,$dff002 FillIn: btst.b #6,$dff002 bne.s FillIn move.l PlaneBufferWork(pc),a0 lea.l 256*40(a0),a0 move.l #0,$dff064 ;clear modulo A and D move #%0000100111110000,$dff040 ;boolean minterms move #%0000000000010010,$dff042 ;descending and fill mode move.l a0,$dff050 ;source A move.l a0,$dff054 ;destination D move #256*64+20,$dff058 rts PlaneBufferWork: dc.l Buffer1 Buffer1: blk.b 320*256/8,0 victim Quote:
Last edited by victim; 11 September 2011 at 14:51. |
|
10 September 2011, 08:34 | #3 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,553
|
Two problems. Quick hints:
1) bset reads before writing. 2) data size is not a word. |
10 September 2011, 22:13 | #4 |
AMOS Extensions Developer
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
|
Thanks for the help guys, it's working now
Regards, Lonewolf10 |
13 September 2011, 14:30 | #8 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,537
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
CPU Filling vs. Blitter Filling Routine | victim | Coders. General | 18 | 26 January 2014 02:15 |
Please help me!! Blitter pain! | h0ffman | Coders. Asm / Hardware | 5 | 15 June 2013 18:59 |
Did Starglider use the blitter? | mc6809e | Retrogaming General Discussion | 8 | 04 February 2012 15:19 |
Blitter filling routine used in games | Codetapper | Coders. General | 2 | 26 January 2012 10:20 |
Blitter nasty or not? | JackAsser | Coders. Tutorials | 5 | 28 March 2010 22:45 |
|
|