View Single Post
Old 17 April 2011, 19:39   #2
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
On OCS you need to enable bitplane graphics before you can show any sprites on the screen, so that should be your first step. (there are ways to work around this, but to keep things simple..)

To get a 320*200 screen of 1 bitplane going, you can f.ex do this (did you get the customregisters.i include file to work?):
Code:
lea     $dff000, a6

; enable 1 bitplane and set horizontal scroll values to 0

move.w  #bpl_1bpl | bpl_color, bplcon0(a6)
move.w  #0, bplcon1(a6)

; set bitplane data fetch start and stop

move.w  #$38, ddfstrt(a6)
move.w  #$d0, ddfstop(a6)

; set upper left coordinate of display window to $81, $2C
; and the bottom right to $1C1, $F4 to get a 320x200 display

move.w  #$2c81, diwstrt(a6)
move.w  #$f4c1, diwstop(a6)

; enable master DMA and bitplane DMA

move.w  #dma_set | dma_en | dma_bpl, dmacon(a6)
Some prefer to write these values into the Copper program instead and have the Copper set the hardware registers every image frame, both ways work.

Now you just need to set the bitplane pointer, registers BPL1PTH and BPL1PTL in this example, to where your bitplane data is. Bitplane pointers (and sprite pointers) needs to be set every image frame or they will keep advancing and you'll see the whole memory scrolling by on the screen. You can either write the pointer value into a Copper program, or easier for now is to just set it yourself in your frame loop.
Leffmann is offline  
 
Page generated in 0.04423 seconds with 11 queries