English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 30 March 2011, 00:11   #1
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
Copper tricks

Hi,

I'm trying to do some tricks using BPL1MOD.

I'd like to mirror a small section of the screen (say 10 lines) and then have the rest of the screen normal. I was hoping to move the mirrored bit up and down in the background whilst the credits ran.

However, BPL1MOD doesn't appear to like being set as 0 multiple times before hitting the mirrored bit, and ends up corrupting the entire screen.
Can anyone see what I am missing, or explain why this is happening?


Code:
credits_copspr:
    dc.w    $0120,$0000        ;Sprite pointers 0-7, High & Low
    dc.w    $0122,$0000
    dc.w    $0124,$0000
    dc.w    $0126,$0000
    dc.w    $0128,$0000
    dc.w    $012A,$0000
    dc.w    $012C,$0000
    dc.w    $012E,$0000
    dc.w    $0130,$0000
    dc.w    $0132,$0000
    dc.w    $0134,$0000
    dc.w    $0136,$0000
    dc.w    $0138,$0000
    dc.w    $013A,$0000
    dc.w    $013C,$0000
    dc.w    $013E,$0000
credits_bplcon:
    dc.w    $2001,$fffe        ;wait for scanline $20
    dc.w    $0102,$00EE        ;BPLCON1
    dc.w    $0180,$0000        ;COLOR00
    dc.w    $0182,$0FFF        ;COLOR01
    dc.w    $0184,$0036        ;COLOR02
    dc.w    $0186,$0058        ;COLOR03
    dc.w    $0188,$009D        ;COLOR04
    dc.w    $018A,$03CF        ;COLOR05
    dc.w    $018C,$0233        ;COLOR06
    dc.w    $018E,$0CDD        ;COLOR07
    dc.w    $0190,$0788        ;COLOR08
    dc.w    $0192,$0565        ;COLOR09
    dc.w    $0194,$09E0        ;COLOR10
    dc.w    $0196,$0110        ;COLOR11
    dc.w    $0198,$08B0        ;COLOR12
    dc.w    $019A,$0580        ;COLOR13
    dc.w    $019C,$0230        ;COLOR14
    dc.w    $019E,$0BBA        ;COLOR15
    dc.w    $2c01,$fffe        ;wait for scanline $2C
credits_bplcop:
    dc.w    $00E0,$0000        ;BPL1PTH cleared & setup in program
    dc.w    $00E2,$0000        ;BPL1PTL cleared & setup in program
    dc.w    $00E4,$0000        ;BPL2PTH cleared & setup in program
    dc.w    $00E6,$0000        ;BPL2PTL cleared & setup in program
    dc.w    $00E8,$0000        ;BPL3PTH cleared & setup in program
    dc.w    $00EA,$0000        ;BPL3PTL cleared & setup in program
    dc.w    $00EC,$0000        ;BPL4PTH cleared & setup in program
    dc.w    $00EE,$0000        ;BPL4PTL cleared & setup in program
    dc.w    $00F0,$0000        ;BPL5PTH cleared & setup in program
    dc.w    $00F2,$0000        ;BPL5PTL cleared & setup in program
    dc.w    $00F4,$0000        ;BPL6PTH cleared & setup in program
    dc.w    $00F6,$0000        ;BPL6PTL cleared & setup in program
    dc.w    $0100,$5600        ;BPLCON0, 5 bitplanes, COLOR + DBLPLF
    dc.w    $0108,$0000        ;BPL1MOD

*    dc.w    $701B,$FFFE
*    dc.w    $0102,$00FF        ;BPLCON1
    dc.w    $0108,$0000        ;BPL1MOD & repeat for entire screen
    dc.w    $0180,$00F0

    dc.w    $711B,$FFFE
*    dc.w    $0102,$00FE
    dc.w    $0108,$0000

    dc.w    $721B,$FFFE
*    dc.w    $0102,$00FD
    dc.w    $0108,$0000

    dc.w    $731B,$FFFE
*    dc.w    $0102,$00FC
    dc.w    $0108,$0000

    dc.w    $741B,$FFFE
*    dc.w    $0102,$0044
    dc.w    $0108,$0000

    dc.w    $751B,$FFFE
*    dc.w    $0102,$0033
    dc.w    $0108,$0000

    dc.w    $761B,$FFFE
*    dc.w    $0102,$0022
    dc.w    $0108,$0000

    dc.w    $771B,$FFFE
*    dc.w    $0102,$0011        ;background shifted - 
    dc.w    $0108,$0000

    dc.w    $781B,$FFFE
*    dc.w    $0102,$0000        ;foreground shifted - 4,8-F,80,F0
    dc.w    $0108,$0000

    dc.w    $791B,$FFFE
*    dc.w    $0102,$0011
    dc.w    $0108,$0000

    dc.w    $7A1B,$FFFE
*    dc.w    $0102,$0022
    dc.w    $0108,$0000

    dc.w    $7B1B,$FFFE
*    dc.w    $0102,$0033
    dc.w    $0108,$0000

    dc.w    $7C1B,$FFFE
*    dc.w    $0102,$0044
    dc.w    $0108,$0000

    dc.w    $7D1B,$FFFE
*    dc.w    $0102,$0033
    dc.w    $0108,$0000

    dc.w    $7E1B,$FFFE
*    dc.w    $0102,$0022
    dc.w    $0108,$0000

    dc.w    $7F1B,$FFFE
*    dc.w    $0102,$0011
    dc.w    $0108,$0000

    dc.w    $801B,$FFFE
*    dc.w    $0102,$0000
    dc.w    $0108,$0000

    dc.w    $811B,$FFFE
*    dc.w    $0102,$0010
    dc.w    $0108,$0000

    dc.w    $821B,$FFFE
*    dc.w    $0102,$0020
    dc.w    $0108,$0000

    dc.w    $831B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$0000

    dc.w    $841B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$0000

    dc.w    $851B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$0000

    dc.w    $861B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$0000

    dc.w    $871B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$0000
    dc.w    $0180,$000F

    dc.w    $881B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$0000

    dc.w    $891B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$0000

    dc.w    $8A1B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$0000

    dc.w    $8B1B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$0000

    dc.w    $8C1B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$0000

    dc.w    $8D1B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$FFD8

    dc.w    $8E1B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$FFD8

    dc.w    $8F1B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$FFD8

    dc.w    $901B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$FFD8

    dc.w    $911B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$FFD8

    dc.w    $921B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$FFD8

    dc.w    $931B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$FFD8
    dc.w    $0180,$0F00

    dc.w    $941B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$0000

    dc.w    $951B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$0000

    dc.w    $961B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$0000

    dc.w    $971B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$0000

    dc.w    $981B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$0000

    dc.w    $991B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$FFD0

    dc.w    $9A1B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$FFD0

    dc.w    $9B1B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$FFD0

    dc.w    $0180,$0000    ;COLOR00
    dc.w    $FFDF,$FFFE        ;wait for scanline $FF
    dc.w    $01A0,$0511        ;COLOR16
    dc.w    $01A2,$0900        ;COLOR17
    dc.w    $01A4,$0B11        ;COLOR18
    dc.w    $01A6,$0811        ;COLOR19
    dc.w    $01A8,$0A11        ;COLOR20
    dc.w    $01AA,$0711        ;COLOR21
    dc.w    $01AC,$0911        ;COLOR22
    dc.w    $01AE,$0B22        ;COLOR23
    dc.w    $01B0,$0A22        ;COLOR24
    dc.w    $01B2,$0B22        ;COLOR25
    dc.w    $01B4,$0922        ;COLOR26
    dc.w    $01B6,$0B33        ;COLOR27
    dc.w    $01B8,$0633        ;COLOR28
    dc.w    $01BA,$0855        ;COLOR29
    dc.w    $01BC,$0A66        ;COLOR30
    dc.w    $01BE,$0B88        ;COLOR31
    dc.w    $2601,$fffe        ;wait for scanline $2C (PAL overscan)
    dc.w    $0100,$0200        ;BPLCON0, 0 bitplanes on
    dc.w    $ffff,$fffe        ;wait forever (until next VBL)
Regards,
Lonewolf10
Lonewolf10 is offline  
Old 30 March 2011, 08:33   #2
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
Hello Lonewolf10

I don't think there's any problem setting bpl1mod to zero multiple times in your copper list - that shouldn't make a difference to anything.

I knocked up a quick bit of test code here and successfully set bpl1mod to zero multiple times, then mirrored a 10 line section of the bitplane (bpl1mod set to minus the width of one line of bitplane data), before setting bpl1mod back to zero and getting the rest of the bitplane the "right way round" with no corruption.

I tested this on a one bitplane image.

I notice in your copper list that you're using five bitplanes - do you not then also have to set bpl2mod as well in this situation...? Don't forget that, per the HRM, bpl1mod set sets the modulo for odd bitplanes, bpl2mod set the modulo for the even ones.

Last edited by pmc; 30 March 2011 at 08:38.
pmc is offline  
Old 30 March 2011, 08:51   #3
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,534
One possibility is moves to bitplane pointers takes too long, BPLCON0 written after DDFSTRT hpos has already been passed (or in worst case, BPLCON0 already having some previous non-zero plane count..) Which will cause side-effects..
Toni Wilen is online now  
Old 30 March 2011, 18:33   #4
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
Quote:
Originally Posted by pmc View Post
I don't think there's any problem setting bpl1mod to zero multiple times in your copper list - that shouldn't make a difference to anything.
That is what I thought, but on some occasions it doesn't work.


Quote:
Originally Posted by pmc View Post
I knocked up a quick bit of test code here and successfully set bpl1mod to zero multiple times, then mirrored a 10 line section of the bitplane (bpl1mod set to minus the width of one line of bitplane data), before setting bpl1mod back to zero and getting the rest of the bitplane the "right way round" with no corruption.

I tested this on a one bitplane image.

I notice in your copper list that you're using five bitplanes - do you not then also have to set bpl2mod as well in this situation...? Don't forget that, per the HRM, bpl1mod set sets the modulo for odd bitplanes, bpl2mod set the modulo for the even ones.
Yes, I know that. If you took a closer look at my copperlist, you would also have noticed that I enabled dual playfield mode (DBLPLF - I called it double playfield which may have thrown you?). I also stated in my first post that I was trying to create FX in the background whilst the credits were going on in the foreground!

Quote:
Originally Posted by Toni Wilen View Post
One possibility is moves to bitplane pointers takes too long, BPLCON0 written after DDFSTRT hpos has already been passed (or in worst case, BPLCON0 already having some previous non-zero plane count..) Which will cause side-effects..

This could be it. I also had similar problems with BPLCON1 (which is why it is present multiple times in my copperlist) when I was trying to create a sine-wave like effect up/down the screen using the hardware scroll. It too would corrupt the first few values giving unwanted results

So what is the best way to fix this? Should I just throw in a few copperlist instructions at the start to effectively pause the copperlist and hopefully avoid corruption of the important ones?


Regards,
Lonewolf10
Lonewolf10 is offline  
Old 30 March 2011, 18:54   #5
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
Quote:
Originally Posted by Lonewolf10
That is what I thought, but on some occasions it doesn't work.
Which occasions are those...?

Quote:
Originally Posted by Lonewolf10
Yes, I know that. If you took a closer look at my copperlist, you would also have noticed that I enabled dual playfield mode (DBLPLF - I called it double playfield which may have thrown you?). I also stated in my first post that I was trying to create FX in the background whilst the credits were going on in the foreground!
OK, my bad - skim read your copperlist and missed that.
pmc is offline  
Old 30 March 2011, 21:09   #6
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,629
One usually sets bpl/spr datafetch related registers during horizontal blanking - after DDFSTOP and before DDFSTRT, so that they are ready when DMA starts at hpos $38 or similar. I'm not at all sure that all the moves after the $2001 and $2c01 are executed in time, try hpos $df on previous line. Note that some ECS machines doesn't tolerate as extreme h/vpos bounds as OCS. (I tested out max overscan on A600 in some thread...)

It should work with hpos $1b, but you don't set the screen size (DIW/DDF STRT/STOP), so I've no idea where the screen bounds are. I guess you set them in some init code? Is there a special reason you need this hpos instead of $07 or $01?

It's absolutely positively possible to set modulo to 0 on each line, so the good news is that that's not the problem
Photon is offline  
Old 30 March 2011, 21:21   #7
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
Quote:
Originally Posted by pmc View Post
Which occasions are those...?
Here is one.
The background display corrupts when a wait command (marked) is used straight after BPL1MOD is set. The scanline the wait command waits for doesn't matter (I tried a few different lines, from $38 to $6B).
See attached pictures.

Code:
credits_copspr:
    dc.w    $0120,$0000        ;Sprite pointers 0-7, High & Low
    dc.w    $0122,$0000
    dc.w    $0124,$0000
    dc.w    $0126,$0000
    dc.w    $0128,$0000
    dc.w    $012A,$0000
    dc.w    $012C,$0000
    dc.w    $012E,$0000
    dc.w    $0130,$0000
    dc.w    $0132,$0000
    dc.w    $0134,$0000
    dc.w    $0136,$0000
    dc.w    $0138,$0000
    dc.w    $013A,$0000
    dc.w    $013C,$0000
    dc.w    $013E,$0000
credits_bplcon:
    dc.w    $2001,$fffe        ;wait for scanline $20
    dc.w    $0102,$00EE        ;BPLCON1, cleared & setup in program
    dc.w    $0180,$0000        ;COLOR00
    dc.w    $0182,$0FFF        ;COLOR01
    dc.w    $0184,$0036        ;COLOR02
    dc.w    $0186,$0058        ;COLOR03
    dc.w    $0188,$009D        ;COLOR04
    dc.w    $018A,$03CF        ;COLOR05
    dc.w    $018C,$0233        ;COLOR06
    dc.w    $018E,$0CDD        ;COLOR07
    dc.w    $0190,$0788        ;COLOR08
    dc.w    $0192,$0565        ;COLOR09
    dc.w    $0194,$09E0        ;COLOR10
    dc.w    $0196,$0110        ;COLOR11
    dc.w    $0198,$08B0        ;COLOR12
    dc.w    $019A,$0580        ;COLOR13
    dc.w    $019C,$0230        ;COLOR14
    dc.w    $019E,$0BBA        ;COLOR15
    dc.w    $2c01,$fffe        ;wait for scanline $2C
credits_bplcop:
    dc.w    $00E0,$0000        ;BPL1PTH cleared & setup in program
    dc.w    $00E2,$0000        ;BPL1PTL cleared & setup in program
    dc.w    $00E4,$0000        ;BPL2PTH cleared & setup in program
    dc.w    $00E6,$0000        ;BPL2PTL cleared & setup in program
    dc.w    $00E8,$0000        ;BPL3PTH cleared & setup in program
    dc.w    $00EA,$0000        ;BPL3PTL cleared & setup in program
    dc.w    $00EC,$0000        ;BPL4PTH cleared & setup in program
    dc.w    $00EE,$0000        ;BPL4PTL cleared & setup in program
    dc.w    $00F0,$0000        ;BPL5PTH cleared & setup in program
    dc.w    $00F2,$0000        ;BPL5PTL cleared & setup in program
    dc.w    $00F4,$0000        ;BPL6PTH cleared & setup in program
    dc.w    $00F6,$0000        ;BPL6PTL cleared & setup in program
    dc.w    $0100,$5600        ;BPLCON0, 5 bitplanes, COLOR + DBLPLF
    dc.w    $0108,$0000        ;BPL1MOD

**    dc.w    $6B1B,$FFFE    ;corrupts display when used! $381B - $6B1B
*    dc.w    $0102,$00FE
    dc.w    $0108,$0000
    dc.w    $0180,$0FF0

    dc.w    $6C1B,$FFFE
*    dc.w    $0102,$00FE
    dc.w    $0108,$0000

    dc.w    $6D1B,$FFFE
*    dc.w    $0102,$00FE
    dc.w    $0108,$0000

    dc.w    $6E1B,$FFFE
*    dc.w    $0102,$00FE
    dc.w    $0108,$0000

    dc.w    $6F1B,$FFFE
*    dc.w    $0102,$00FE
    dc.w    $0108,$0000

    dc.w    $701B,$FFFE
*    dc.w    $0102,$00FF        ;BPLCON1
    dc.w    $0108,$0000        ;BPL1MOD & repeat for entire screen
    dc.w    $0180,$00F0

    dc.w    $711B,$FFFE
*    dc.w    $0102,$00FE
    dc.w    $0108,$0000

******

    dc.w    $721B,$FFFE
*    dc.w    $0102,$00FD
    dc.w    $0108,$0000

    dc.w    $731B,$FFFE
*    dc.w    $0102,$00FC
    dc.w    $0108,$0000

    dc.w    $741B,$FFFE
*    dc.w    $0102,$0044
    dc.w    $0108,$0000

    dc.w    $751B,$FFFE
*    dc.w    $0102,$0033
    dc.w    $0108,$0000

    dc.w    $761B,$FFFE
*    dc.w    $0102,$0022
    dc.w    $0108,$0000

    dc.w    $771B,$FFFE
*    dc.w    $0102,$0011        ;background shifted - 
    dc.w    $0108,$0000

    dc.w    $781B,$FFFE
*    dc.w    $0102,$0000        ;foreground shifted - 4,8-F,80,F0
    dc.w    $0108,$0000

    dc.w    $791B,$FFFE
*    dc.w    $0102,$0011
    dc.w    $0108,$0000

    dc.w    $7A1B,$FFFE
*    dc.w    $0102,$0022
    dc.w    $0108,$0000

    dc.w    $7B1B,$FFFE
*    dc.w    $0102,$0033
    dc.w    $0108,$0000

    dc.w    $7C1B,$FFFE
*    dc.w    $0102,$0044
    dc.w    $0108,$0000

    dc.w    $7D1B,$FFFE
*    dc.w    $0102,$0033
    dc.w    $0108,$0000

***

    dc.w    $7E1B,$FFFE
*    dc.w    $0102,$0022
    dc.w    $0108,$0000

    dc.w    $7F1B,$FFFE
*    dc.w    $0102,$0011
    dc.w    $0108,$0000

    dc.w    $801B,$FFFE
*    dc.w    $0102,$0000
    dc.w    $0108,$0000

    dc.w    $811B,$FFFE
*    dc.w    $0102,$0010
    dc.w    $0108,$0000

    dc.w    $821B,$FFFE
*    dc.w    $0102,$0020
    dc.w    $0108,$0000

    dc.w    $831B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$0000

    dc.w    $841B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$0000

    dc.w    $851B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$0000

    dc.w    $861B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$0000

    dc.w    $871B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$0000
    dc.w    $0180,$000F

    dc.w    $881B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$0000

    dc.w    $891B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$0000

    dc.w    $8A1B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$0000

    dc.w    $8B1B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$0000

    dc.w    $8C1B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$0000

    dc.w    $8D1B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$FFD8

    dc.w    $8E1B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$FFD8

    dc.w    $8F1B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$FFD8

    dc.w    $901B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$FFD8

    dc.w    $911B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$FFD8

    dc.w    $921B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$FFD8

    dc.w    $931B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$FFD8
    dc.w    $0180,$0F00

    dc.w    $941B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$0000

    dc.w    $951B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$0000

    dc.w    $961B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$0000

    dc.w    $971B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$0000

    dc.w    $981B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$0000

    dc.w    $991B,$FFFE
*    dc.w    $0102,$0030
    dc.w    $0108,$FFB0


    dc.w    $0180,$0000    ;COLOR00
    dc.w    $FFDF,$FFFE        ;wait for scanline $FF
    dc.w    $01A0,$0511        ;COLOR16
    dc.w    $01A2,$0900        ;COLOR17
    dc.w    $01A4,$0B11        ;COLOR18
    dc.w    $01A6,$0811        ;COLOR19
    dc.w    $01A8,$0A11        ;COLOR20
    dc.w    $01AA,$0711        ;COLOR21
    dc.w    $01AC,$0911        ;COLOR22
    dc.w    $01AE,$0B22        ;COLOR23
    dc.w    $01B0,$0A22        ;COLOR24
    dc.w    $01B2,$0B22        ;COLOR25
    dc.w    $01B4,$0922        ;COLOR26
    dc.w    $01B6,$0B33        ;COLOR27
    dc.w    $01B8,$0633        ;COLOR28
    dc.w    $01BA,$0855        ;COLOR29
    dc.w    $01BC,$0A66        ;COLOR30
    dc.w    $01BE,$0B88        ;COLOR31
    dc.w    $2601,$fffe        ;wait for scanline $2C (PAL overscan)
    dc.w    $0100,$0200        ;BPLCON0, 0 bitplanes on
    dc.w    $ffff,$fffe        ;wait forever (until next VBL)
It seems that setting BPL1MOD (or any other register) wasn't the problem, but using a wait instruction straight after the first time BPL1MOD was set.


Edit:

I don't think this is important, but playfield 2 is set to be displayed infront of playfield 1.


Regards,
Lonewolf10
Attached Thumbnails
Click image for larger version

Name:	DD_AS_Credits-normal.png
Views:	569
Size:	8.8 KB
ID:	28248   Click image for larger version

Name:	DD_AS_Credits-corrupt.png
Views:	578
Size:	56.7 KB
ID:	28249  

Last edited by Lonewolf10; 30 March 2011 at 21:25. Reason: Forgot some info
Lonewolf10 is offline  
Old 30 March 2011, 21:38   #8
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
Hmmmm... That's some weird stuff happening there.

It almost looks like corrupted bitplane data in that second pic.

Does using a different hpos in the waits make any difference? As Photon says, I normally use $07, not sure if you need $1b for a special reason...?

The (tested $381b range up to) $6b1b marked leads to corruption but is it all OK if the $6c1b wait that comes after this is left in place...? Like Toni and Photon suggest, maybe it's some kind of copper timing thing, perhaps more to do with the earlier waits and the copper can't "keep up" for want of a better way of putting it...?

I've got no clue why you're seeing what you are - never seen anything like that happen in any of the code and copper things I've played around with. Interested to know what's going on and what the fix is.

Last edited by pmc; 30 March 2011 at 21:47.
pmc is offline  
Old 30 March 2011, 22:20   #9
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
Quote:
Originally Posted by pmc View Post
Hmmmm... That's some weird stuff happening there.
Yup. After a week of trying to work it out for myself I decided to consult you guys


Quote:
Originally Posted by pmc View Post
It almost looks like corrupted bitplane data in that second pic.

Does using a different hpos in the waits make any difference? As Photon says, I normally use $07, not sure if you need $1b for a special reason...?
Tried that already. I normally use $01, but tried moving it about incase anything was clashing. That is why it's currently set at $1B.


Quote:
Originally Posted by pmc View Post
The (tested $381b range up to) $6b1b marked leads to corruption but is it all OK if the $6c1b wait that comes after this is left in place...?
Yes. That wait instruction works as expected.

Quote:
Originally Posted by pmc View Post
Like Toni and Photon suggest, maybe it's some kind of copper timing thing, perhaps more to do with the earlier waits and the copper can't "keep up" for want of a better way of putting it...?

I've got no clue why you're seeing what you are - never seen anything like that happen in any of the code and copper things I've played around with. Interested to know what's going on and what the fix is.
I'll certainly keep experimenting with it.


Regards,
Lonewolf10
Lonewolf10 is offline  
Old 31 March 2011, 08:07   #10
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
Quote:
Originally Posted by pmc
The (tested $381b range up to) $6b1b marked leads to corruption but is it all OK if the $6c1b wait that comes after this is left in place...?
Quote:
Originally Posted by Lonewolf10
Yes. That wait instruction works as expected.
That to me sounds then like it's definitely an "available time" type issue - ie. not enough time for the copper / DMA / whatever to do what it needs given X number of scanlines but enough if given X+1 scanlines of time.

Anyways, I hope you can get it fixed - if you sort it, let us know what happened.
pmc is offline  
Old 31 March 2011, 08:22   #11
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,534
It is almost guaranteed your BPLCON0 write happens when DDFSTRT has already been passed in current line.

Easy to test: clear BPLCON0 at the start of line, set all bitplane parameters, wait for start of next line, set BPLCON0.

In emulation you can use copper debugger to see copper timing ("od" in debugger)

After copper debugging has been enabled and copper list has been executed at least once, o-debugger command also shows copper timing info.
Toni Wilen is online now  
Old 31 March 2011, 09:54   #12
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
Quote:
Originally Posted by Toni Wilen
In emulation you can use copper debugger to see copper timing ("od" in debugger)

After copper debugging has been enabled and copper list has been executed at least once, o-debugger command also shows copper timing info.
I didn't know that - sounds really useful. Thanks Toni.
pmc is offline  
Old 31 March 2011, 20:17   #13
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
Quote:
Originally Posted by Toni Wilen View Post
It is almost guaranteed your BPLCON0 write happens when DDFSTRT has already been passed in current line.

Easy to test: clear BPLCON0 at the start of line, set all bitplane parameters, wait for start of next line, set BPLCON0.
Tried that, and it didn't work. I was left with a blank screen!!


Quote:
Originally Posted by Toni Wilen View Post
In emulation you can use copper debugger to see copper timing ("od" in debugger)

After copper debugging has been enabled and copper list has been executed at least once, o-debugger command also shows copper timing info.
Useful info
I was able to easily find the active copperlist (much easier and faster than using action replay - which doesn't always find the copperlist), and solve the problem.


It was me

I originally had the colours in 2 blocks. The 2nd block starting where I now added the BPLCON1 and other registers to the copperlist. I was changing the colours using the CPU (since the copperlist is also used elsewhere in the demo), but forgot to change the addresses. So instead of changing the colour values 16-31 in the copperlist, it was corrupting the wait, BPLCON0 and BPLCON1 instructions!


Regards,
Lonewolf10
Lonewolf10 is offline  
Old 31 March 2011, 21:07   #14
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,534
There is no need to find anything. o1 = cop1lc, o2 = cop2lc.

There is also hardcore bus debugging mode, type vd to enable it, v <scanline> [<start cycle>] shows what happened in selected scanline in previous frame, cycle by cycle.

Or pointless visual mode: v -3
Toni Wilen is online now  
Old 31 March 2011, 22:09   #15
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
Quote:
Originally Posted by Toni Wilen View Post
There is no need to find anything. o1 = cop1lc, o2 = cop2lc.

There is also hardcore bus debugging mode, type vd to enable it, v <scanline> [<start cycle>] shows what happened in selected scanline in previous frame, cycle by cycle.

Or pointless visual mode: v -3

Thanks. I'm sure they'll come in useful in the future


Regards,
Lonewolf10
Lonewolf10 is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Combining copper scrolling with copper background phx Coders. Asm / Hardware 16 13 February 2021 12:41
PAL-M Filter Tricks Leandro Jardim support.WinUAE 0 25 October 2011 16:03
Want some A2000 tips 'n tricks! 8bitbubsy support.Hardware 15 24 February 2011 04:30
Old joysticks, new tricks twizzle Retrogaming General Discussion 14 29 April 2009 23:37
Bizarre coding tricks Ray Norrish Coders. General 6 01 January 2006 17:43

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:26.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09960 seconds with 14 queries