# HG changeset patch # User Mike Pavone # Date 1378686327 25200 # Node ID 3e2e3129a619f77814a7db6b065ea32b63ef0e74 # Parent 166d58b234c31d38965e43ee740cc7c9d1d35764 Re-arrange some VDP writes so that the address register gets setup properly for the FIFO-fill while still avoiding a freeze diff -r 166d58b234c3 -r 3e2e3129a619 directcolor.s68 --- a/directcolor.s68 Sun Sep 08 12:17:02 2013 -0700 +++ b/directcolor.s68 Sun Sep 08 17:25:27 2013 -0700 @@ -97,13 +97,13 @@ move.w #$8004, (a5) move.w #$8104, (a5) ;turn off display - move.w #$8200, (a5) ;Table A = 0000 - move.w #$8400, (a5) ;Table B = 0000 - move.w #$857C, (a5) ;Sprite Table = F800 + ;move.w #$8200, (a5) ;Table A = 0000 + ;move.w #$8400, (a5) ;Table B = 0000 + ;move.w #$857C, (a5) ;Sprite Table = F800 move.w #$8B00, (a5) ;set full screen vertical and horizontal scrolling move.w #$8C01, (a5) ;H40 mode, no shadow/hilight, no interlace - move.w #$8D3F, (a5) ;H Scroll = FC00 - move.w #$9001, (a5) ;64x32 scroll tables + ;move.w #$8D3F, (a5) ;H Scroll = FC00 + ;move.w #$9001, (a5) ;64x32 scroll tables @@ -116,7 +116,6 @@ bne.s WaitStart Top: - move.l #$40000000, (a5) ;Setup VRAM writes lea BgData(pc), a0 ;set DMA source address move.l a0, d7 @@ -133,13 +132,19 @@ move.b d7, d6 add.w #$100, d6 and.b #$7F, d6 - move.w d6,(a5) + ;move.w d6,(a5) + + + move.l #$94AE9342, (a5) ;set DMA length move.w #$8F00, (a5) ;set auto-increment to 0 - move.w #$8154, (a5) + move.w #$8144, (a5) ;display on, DMA off + move.l #$40000000, (a5) ;Setup VRAM writes + + addq #1, a5 WaitVBlank: btst.b #3, (a5) @@ -152,11 +157,11 @@ move.l d0, (a4) move.w d0, (a4) subq #1, a5 - move.w #$8114, (a5) ;turn off display + move.w #$8114, (a5) ;display off, DMA on + nop ;let FIFO drain nop nop - nop - nop + move.w d6, (a5) ;finish setting DMA source move.l #$C0000080, (a5) bra Top