17 April 2018, 20:54 | #1 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,335
|
Setting up maximum-size playfield
My hardware-banging skills are a bit rusty (not that they were ever much good, and I'm lazy).
I'm writing a tiny program which is going to set a maximum-size overscanned display. No bitplane DMA needed, I just plan to write a different value to BPL1DAT each frame, rotating the value by 1 bit each time for a smooth-scroll effect. [Hopefully that will be useful for testing the new lagless vsync mode in WinUAE.] At the moment I'm just writing values to color00, color01 and bplcon0 (for 1 bitplane) and bpl1dat. But nothing is displayed since I did LoadView(0) beforehand. Do I just need to write appropriate values to DIWSTRT & DIWSTOP? Can I ignore DDFSTRT/DDFSTOP because I'm not using bitplane DMA? |
17 April 2018, 21:46 | #2 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
DIWSTRT/DIWSTOP needs to be set. DDFSTRT/STOP can be ignored.
Note that I am not sure if no-bitplane-dma and writing to BPL1DAT is emulated properly... Another option is to enable DMA normally and set "7-plane" mode (OCS/ECS only) and use BPL5DAT or 6 for pattern data. |
17 April 2018, 22:32 | #3 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
|
Too many unknowns, I think. Post your code and we'll be able to tell why you don't get pixels! (For Lores using DMA, this is max.)
Not writing DDFxxx will just leave them at their last values before starting your screen. For pumping out words to BPL1DAT, in theory starting a normal screen but setting 0 bitplanes should get you going. But this is for a sizetro? Last edited by Photon; 17 April 2018 at 22:38. |
17 April 2018, 22:33 | #4 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,335
|
I've uploaded my current source to
Code:
http://www.media!fire.com/file/llz2hsekxu6y4h2/ScrollTest.tar.gz |
17 April 2018, 22:40 | #5 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
|
Well, um... just the relevant bits in a Code Tag is fine I think
|
17 April 2018, 23:07 | #6 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,335
|
OK...
Code:
BaseVal EQU %0000011100011001 Start movea.l (4).W,A6 lea (GfxName,PC),A1 jsr (_LVOOldOpenLibrary,A6) tst.l D0 beq.b Error move.l D0,A5 exg A5,A6 jsr (_LVOOwnBlitter,A6) jsr (_LVOWaitBlit,A6) suba.l A1,A1 jsr (_LVOLoadView,A6) jsr (_LVOWaitTOF,A6) jsr (_LVOWaitTOF,A6) exg A5,A6 jsr (_LVODisable,A6) ; Main stuff here lea (_custom).L,A1 move.l #$0001FF00,D7 ; Mask for checking vposr/vhposr .Wait move.l (vposr,A1),D0 ; Wait until scanline 0 and.l D7,D0 bne.b .Wait ; Disable sprite, blitter, copper and bitplane DMA move.w #DMAF_SPRITE|DMAF_BLITTER|DMAF_COPPER|DMAF_RASTER,(dmacon,A1) move.w #$1200,(bplcon0,A1) ; 1 bitplane, COLOR move.l #$0FFF0000,(color00,A1) ; color00 white, color01 black move.w #$2C81,(diwstrt,A1) ; Use default NTSC non-overscan values for now move.w #$F4C1,(diwstop,A1) ; move.w #BaseVal,D6 Loop move.w D6,(bpl1dat,A1) .WaitNotLine0 ; Wait until *not* on scanline 0 move.l (vposr,A1),D0 and.l D7,D0 beq.b .WaitNotLine0 .Wait2 move.l (vposr,A1),D0 ; Wait until scanline 0 and.l D7,D0 bne.b .Wait2 rol.w #1,D6 bra.b Loop |
18 April 2018, 00:30 | #7 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
|
You must also set bit 15 (SET/CLR) on the DMACON line. Otherwise the bitmask you specify will be cleared, not set. (This works the same for many *CON and *ENA registers.)
If this is done and still nothing - hm, how do you exit the loop...? As in, can you determine that it reaches the line where you poke BPL1DAT. |
18 April 2018, 12:50 | #8 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
DMACON write is correct, it is supposed to clear the bits
But code can't work, single write/frame to BPL1DAT won't do what you wanted. BPL1DAT needs to be written at the beginning of each scanline (but not too beginning) because BPL1DAT write is the trigger that starts Denise's output shifters and it gets disabled automatically at the start of next scanline (when hpos=0 = Agnus strobe signal) "7-plane" mode and BPLDAT5/6 write would work as you expected, as long as bitplane DMA is active (=Agnus does required BPL1DAT writes). |
18 April 2018, 14:41 | #9 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,335
|
I inserted move.w D6,(bpl1dat,A1) at the .Wait2 label in the code above.
That was obviously not the right thing to do. So I'm probably writing bpl1dat at the wrong time? The effect should be vertical stripes which are moving horizontally. Some notes on different configs: - With ECS, JIT, fastest possible CPU (not cycle-exact) the stripes are there but there are regular breaks in the lines (rows of white pixels). - Same config but enabled cycle-exact (full): Stripes are all OK, except there is a consistent "glitch line" about 4/5 the way down the Amiga display. The part below that is offset two pixels to the left of the bars above. - OCS, cycle-exact, 68000 CPU: Bars appear very broken, more white than black. I'll upload that executable to The Zone in case anyone's curious. Next, I'll try waiting for a certain horizontal line position before writing bpl1dat. |
18 April 2018, 15:51 | #10 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
Hi Toni, what do you mean by "not too beginning? hpos>=2 suffice?
|
18 April 2018, 15:59 | #11 | |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
OCS Denise needs large hpos (somewhere near decimal 40, if written too early: nothing happens), ECS Denise appears to not have any "limits".
Quote:
|
|
18 April 2018, 16:04 | #12 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
|
19 April 2018, 17:16 | #13 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
It is probably easier to use sprites in non-DMA mode if there is no need to completely fill the screen horizontally.
|
19 April 2018, 18:57 | #14 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,335
|
I might end up using bitplane DMA after all. Create bitmap of 16 lines, each one pixel shifted from the one before. Set modulo to -(line length), then at the start of each frame write bitplane pointer to point to the next line.
I tried a simple copperlist without success, probably because WAIT matches any position after the initial one. I had something like WAIT for hpos $20 (ignoring v. line number) MOVE value to bpl1dat MOVE 0 to copjmp1 to jump back to start of list Last edited by mark_k; 19 April 2018 at 19:05. |
19 April 2018, 19:57 | #15 | |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
Quote:
|
|
19 April 2018, 22:35 | #16 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,335
|
Still no luck with the copperlist method, but using bitplane DMA I did manage to get something working!
High-res almost-full-overscan display. I might have used illegal values for DIWSTRT/STOP but at least WinUAE shows it correctly. Source & executables for bitplane and (not working) copperlist version: Code:
http://www.media!fire.com/file/i7687wkl7guxdit/ScrollTest_2018-04-19.tar.gz Code:
bmwidth EQU 736 ; In (high res) pixels ; 736 = $2E0 pixels = $2E words. ; DDFSTRT = DDFSTOP - (4 * ($2E - 2)) = DDFSTOP - $B0 ; Normal high-res DDFSTOP is $D4. ; Try DDFSTOP = $D8, DDFSTRT = $28 BaseVal EQU %00000011111000011110000111001101 Start movea.l (4).W,A6 lea (GfxName,PC),A1 jsr (_LVOOldOpenLibrary,A6) tst.l D0 beq Error move.l D0,A5 exg A5,A6 jsr (_LVOOwnBlitter,A6) jsr (_LVOWaitBlit,A6) suba.l A1,A1 jsr (_LVOLoadView,A6) jsr (_LVOWaitTOF,A6) jsr (_LVOWaitTOF,A6) exg A5,A6 jsr (_LVODisable,A6) ; Main stuff here lea (_custom).L,A1 move.l #$0001FF00,D7 ; Mask for checking vposr/vhposr .Wait move.l (vposr,A1),D0 ; Wait until scanline 0 and.l D7,D0 bne.b .Wait ;; Disable sprite, blitter, copper and bitplane DMA ;; move.w #DMAF_SPRITE|DMAF_BLITTER|DMAF_COPPER|DMAF_RASTER,(dmacon,A1) ; Disable all DMA move.w #$7FFF,(dmacon,A1) ; Initialise bitmap lea (Bitmap).L,A0 move.l A0,(bpl1pt,A1) move.l A0,A2 ; Point to first line of bitmap move.l #BaseVal,D0 moveq #32-1,D1 ; 32 lines, -1 for DBF .Outer moveq #(bmwidth/32)-1,D2 ; Number of longwords per line, -1 for DBF .Inner move.l D0,(A0)+ dbf D2,.Inner rol.l #1,D0 dbf D1,.Outer move.w #-(bmwidth/8),(bpl1mod,A1) move.w #$9200,(bplcon0,A1) ; 1 bitplane, high res, COLOR move.l #$0FFF0000,(color00,A1) ; color00 white, color01 black move.w #0,(bplcon1,A1) move.w #$0028,(ddfstrt,A1) move.w #$00D8,(ddfstop,A1) ; move.w #$2C81,(diwstrt,A1) ; Use NTSC non-overscan defaults for now ; move.w #$F4C1,(diwstop,A1) move.w #$1A69,(diwstrt,A1) move.w #$7FD9,(diwstop,A1) move.w #DMAF_SETCLR|DMAF_MASTER|DMAF_RASTER,(dmacon,A1) ; Enable bitplane DMA moveq #0,D1 lea (vposr,A1),A3 Loop move.l A2,(bpl1pt,A1) .WaitNotLine0 ; Wait until *not* on scanline 0 move.l (A3),D0 ; vposr/vhposr and.l D7,D0 beq.b .WaitNotLine0 .Wait2 move.l (A3),D0 ; Wait until scanline 0 and.l D7,D0 bne.b .Wait2 lea (bmwidth/8,A2),A2 ; Change bitplane 1 pointer to point to the next line addq.b #1,D1 ; Increment "line counter" cmpi.b #32,D1 bne.b Loop moveq #0,D1 ; Reset "line counter" lea (-32*(bmwidth/8),A2),A2 ; and bitplane address bra.b Loop ; Currently don't bother checking for exit etc, just loop forever above. Error moveq #20,D0 rts GfxName dc.b "graphics.library",0 SECTION bitmap,BSS_C Bitmap ds.w 32*bmwidth/16 |
20 April 2018, 08:32 | #17 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
Toni let's see if I've understood.
A video line write to BPL1DAT is a strobe for Denise barrel-shift start. Besides is a buffer for the 1st bitplane data and normally DMA replenish this buffer. This is the reason why you suggest to use sprites in a manual way, you do not need to mess up to trigger BPL1DAT every line at the right time. Copper can move data to custom every 8 low-res pixels so you eventually even generate two-plane manually writing to BPLxDAT. But what happen if you bang BPL1DAT manually and continuously? Assuming low resolution usage, the barrel-shifted data to video is retriggered every 8 pixel (against the normal 16)? |
20 April 2018, 09:09 | #18 | |||
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
Quote:
Quote:
Quote:
BPLxDAT is not directly connected to shifter. Shifter is only loaded from xDAT when BPLCON1 shift value matches. http://eab.abime.net/showthread.php?t=71437 |
|||
20 April 2018, 09:26 | #19 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
Quote:
Thanks! |
|
20 April 2018, 22:42 | #20 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,335
|
I've been bashing away some more at this. Archive with source and executable:
Code:
http://www.media!fire.com/file/qn1p8rnmr1c39k2/ScrollTest2018-04-20.tar.gz Low-res display, scrolling bars fill the entire screen. (There are no colour-0-only borders at all, except the last scanline on non-DIP Agnus. I didn't think that was possible.) Click left mouse to increase scroll speed or right to decrease & reverse direction. Not tested on real hardware yet. Hopefully this could be a good test for WinUAE's vsync feature since tear lines anywhere in the display will be obvious. TO DO: Exit program on pressing both mouse buttons. After restoring DMACON and enabling interrupts, do I just need to LoadView() the old gb_ActiView? Is RemakeDisplay() needed too? Here's most of the source: Code:
bmwidth EQU 400 ; In (low res) pixels InitScrollSpeed EQU 1 ; Initial number of pixels to scroll each frame ; This defines the stripe pattern. 0 bits are white, 1s are black. BaseVal EQU %0001110001100101 Start movea.l (4).W,A6 lea (GfxName,PC),A1 jsr (_LVOOldOpenLibrary,A6) tst.l D0 beq Error move.l D0,A5 exg A5,A6 jsr (_LVOOwnBlitter,A6) jsr (_LVOWaitBlit,A6) suba.l A1,A1 jsr (_LVOLoadView,A6) jsr (_LVOWaitTOF,A6) jsr (_LVOWaitTOF,A6) exg A5,A6 jsr (_LVODisable,A6) ; Main stuff here lea (_custom).L,A1 move.l #$0001FF00,D7 ; Mask for checking vposr/vhposr .Wait move.l (vposr,A1),D0 ; Wait until scanline 0 and.l D7,D0 bne.b .Wait move.w #$7FFF,(dmacon,A1) ; Disable all DMA ; Initialise bitmap lea (Bitmap).L,A0 move.l A0,(bpl1pt,A1) move.l A0,A2 ; Point to first line of bitmap move.l A0,A3 move.l #BaseVal,D0 moveq #32-1,D1 ; 32 lines, -1 for DBF .Outer moveq #(bmwidth/16)-1,D2 ; Number of longwords per line, -1 for DBF .Inner move.w D0,(A0)+ dbf D2,.Inner rol.w #1,D0 dbf D1,.Outer move.w #-(bmwidth/8),(bpl1mod,A1) move.w #$1200,(bplcon0,A1) ; 1 bitplane, low res, COLOR move.l #$0FFF0000,(color00,A1) ; color00 white, color01 black move.w #4,(bplcon1,A1) move.w #$0018,(ddfstrt,A1) move.w #$00D8,(ddfstop,A1) move.w #$1A69,(diwstrt,A1) move.w #$7FFF,(diwstop,A1) move.w #DMAF_SETCLR|DMAF_MASTER|DMAF_RASTER,(dmacon,A1) ; Enable bitplane DMA moveq #0,D1 ; Initial line number moveq #InitScrollSpeed,D3 ; "Scroll speed" in D3 moveq #-1,D4 ; Initial "last buttons" state lea (ciaapra).L,A4 Loop move.l A3,(bpl1pt,A1) .WaitNotLine0 ; Wait until *not* on scanline 0 move.l (vposr,A1),D0 ; vposr/vhposr and.l D7,D0 beq.b .WaitNotLine0 .Wait2 move.l (vposr,A1),D0 ; Wait until scanline 0 and.l D7,D0 bne.b .Wait2 ; Read state of mouse buttons into D5 move.w (potgor,A1),D5 ; Right button state is in bit 10 move.b (A4),D5 ; Left button state is in bit 6 of ciaapra btst #10,D5 ; Is right button currently pressed? bne.b .NoRButton btst #10,D4 ; Was it pressed before? beq.b .NoRButton ; If so, don't register another press subq.w #1,D3 ; Decrease scroll speed (scroll to right if -ve) .NoRButton btst #6,D5 ; Is left button currently pressed? bne.b .NoLButton btst #6,D4 ; Was it pressed before? beq.b .NoLButton ; If so, don't register another press addq.w #1,D3 ; Increase scroll speed .NoLButton move.w D5,D4 ; Remember this frame's buttons for next time add.w D3,D1 ; Update "line counter" andi.w #$001F,D1 ; Limit to 31 (and e.g. -1 --> 31) ; Set bitplane address to the new line move.l D1,D2 ; New line number mulu.w #bmwidth/8,D2 ; Offset of new line movea.l A2,A3 ; First line in bitmap adda.w D2,A3 ; Point to the new line bra.b Loop Error moveq #20,D0 rts GfxName dc.b "graphics.library",0 SECTION bitmap,BSS_C Bitmap ds.w 32*bmwidth/16 |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Maximum Size Disk and Partition | AMIGASYSTEM | support.WinUAE | 3 | 09 November 2017 21:04 |
Hard Maximum File Size | AMIGASYSTEM | support.WinUAE | 6 | 13 August 2016 15:41 |
Maximum Hard Drive Size Limit On A Cyberstorm MK3 | CU_AMiGA | support.Hardware | 9 | 29 November 2010 10:07 |
Whats the MAXIMUM card size to be used with PCMCIA ? | Kakaboy | support.Hardware | 13 | 11 May 2010 00:03 |
Maximum partition size for a 1.3 setup | coze | support.Hardware | 2 | 23 August 2006 17:26 |
|
|