Vamiga: Issue with BPU values greater than 6

Created on 2 Sep 2019  路  14Comments  路  Source: dirkwhoffmann/vAmiga

I've tried v0.36 with GrapeVine (UK scene diskmag I was fortunate to be involved in), issue #9. It appears to be loading fine, but just before the menu appears vAmiga closes. If I disable "warp transfers" the background music is playing, but too slowly. I can't find a CRASH.TXT (where should I be looking?). I've attached the disk image, hope this helps.

Grapevine 9a.adf.zip

Bug Priority-High

All 14 comments

That's an obscure one, thanks for reporting!

Your test program manages to completely screw up the bitplane DMA event table 馃槼:

Events:
Slot: CIA A             Event: CIA_WAKEUP      Trigger: never
Slot: CIA B             Event: CIA_WAKEUP      Trigger: 1588761080 (91576 DMA cycles away)
Slot: Bitplane DMA      Event: *** INVALID *** Trigger: 1588028920 (56 DMA cycles away)

Bildschirmfoto 2019-09-03 um 07 02 53

I can't find a CRASH.TXT (where should I be looking?).

The most meaningful debug information is obtained if the program is run directly in Xcode. If Xcode is not an option, you can start vAmiga from a console window. In that case, the debug output will be dumped to the window. In the case above, the last printed statement will be the failed assertion:

Assertion failed: (false), function dumpBplEventTable, file.   
/Users/hoff/vAmiga/Amiga/Computer/Agnus/Agnus.cpp, line 740.

The bug has turned out to be an easy one. The programs asks Denise to enable 7 bitplanes which is an invalid value for OCS Amigas. As far as I remember, invalid numbers are treated as being 0. I've implemented it this way, but it needs to be verified by a vAmigaTS test case that iterates over all invalid values.

Bildschirmfoto 2019-09-03 um 08 12 06

...someone talk about 7planes trick:

When you set 7 bitplanes the screen is in halfbrite mode.
When you set 7 bpl Denise treat is as 6 bpl which is halfbrite. This is simply how it behaves. The difference is that only 4 dma channels are active (which does not slow down copper) while on the other hand all 6 bpldat registers are used. You then put some data in bpldat5 and bpldat6 with processor or copper and there you go. Since I did not see any use of halfbrite at the time I simply filled the bpldat6 register with zeros to avoid some possible residual pattern. In bpldat5 register I put a pattern which in that particular intro enables me to access the upper 16 colors of the color table without sprites (which is the usual method I suppose). With this I got the access to all 16 upper colors (sprites give you access to only 15 colors because one color is transparent), and more importantly, copper didn't get slower because only 4 bpl dma is activated. So I can use copper to change the color as fast as it can - 8 lores pix.

http://eab.abime.net/showthread.php?p=484327&styleid=4

When you fill register $dff100 with value which has the number of
bitplanes specified as 7 (lo-res) something strange is going on. On screen
you will notice only 4 bitplanes but further checking has revealed to me
that there are still some differences from usual 4 bitplane mode.

    When 7 bitplanes are 'opened' color index is 6 bit wide.  (It would

be better to say 5 bit wide with halfbright enabled.) First 4 bits of color
index is fetched from BPL1DAT-BPL4DAT ($110 through $116) registers which
are filled through DMA channels. 5th and 6th bit of color index is taken
from BPL5DAT and BPL6DAT which are NOT disturbed by DMA. In other words,
you can put in, i.e. BPL5DAT value $aaaa and you will get at odd pixels on
screen color which is indexed as $10 trough $1f. (Same is with BPL6DAT,
value $aaaa would give you halfbright odd pixels.)

    The benefit of this is accesing of all colors ($00-$1f) without

loosing speed of copper. Okay, okay, this is maybe not so worth to use
except in 4x4 pixel 4096 color rotators where you can now have 31 instead
30 colors for columns. Now, you may ask why is my 4096 color rotator in
"B2" (Lazy Bones) using columns of color $01-$0f and non DMA sprites for
columns of color $11-1f. That was before I was sure that this 'trick' with
7 bitplanes will work on ECS Denise.

When you set 7 bpl Denise treat is as 6 bpl ... only 4 dma channels are active

Very cool. I didn't know such a "feature" exists.
I'll write a test case for it...

My two new test cases inv1 and inv2 indicate that BPU values greater 7 cause strange effects, too:

inv1

Do you know more about that? E.g., if 9 bitplanes are enabled?

Setting a 9-15 bitplane gives 0 bitplanes in OCS/ECS ...I think...

Setting a 9-15 bitplane gives 0 bitplanes in OCS/ECS ...I think...

8 bitplanes seems to be like 0 bitplanes, but 9 and 10 do mystic stuff as well.

Denise confuses 7 planes (which does not exists) with EHB mode which is 6 planes, max supported in OCS/ECS.
This hack expects side-effect both from Agnus (7 planes is identified as 4 plane mode DMA cycle diagram) and Denise (7 planes = 6 plane mode enabled)

This only with Fat Agnus version because the old Amiga 1000 Agnus has something less internally...

The 9bpl trick is in the AGA chipset only.
You can read something here: https://ada.untergrund.net/?p=boardthread&id=442

The 9bpl trick is in the AGA chipset only.

My A500 MMSE behaves weird, too 馃槼.
I've checked that SAE matches the MMSE, so I can try to steal the information from there... stay tuned...

I found this which goes well with what Alessandro wrote:

/* Compute the number of bitplanes from a value written to BPLCON0  */
聽聽聽聽function GET_PLANES(bplcon0) {
聽聽聽聽聽聽聽聽if ((bplcon0 & 0x0010) && (bplcon0 & 0x7000))
聽聽聽聽聽聽聽聽聽聽聽聽return 0; // >8 planes = 0 planes
聽聽聽聽聽聽聽聽if (bplcon0 & 0x0010)
聽聽聽聽聽聽聽聽聽聽聽聽return 8; // AGA 8-planes bit
聽聽聽聽聽聽聽聽return (bplcon0 >> 12) & 7; // normal planes bits
聽聽聽聽}

I need to write more tests, because my first two indicate something different. Maybe I simply did something wrong in my tests.

Maybe I simply did something wrong in my tests.

I fooled myself. There is no such thing such as a BPU value of 8, because there are only 3 BPU bits. Now BPU = 7 is handled correctly.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dirkwhoffmann picture dirkwhoffmann  路  3Comments

dirkwhoffmann picture dirkwhoffmann  路  3Comments

Gianmarco72 picture Gianmarco72  路  4Comments

emoon picture emoon  路  4Comments

dirkwhoffmann picture dirkwhoffmann  路  3Comments