Vamiga: "The Pawn" intro screen is scrambled

Created on 17 May 2019  路  9Comments  路  Source: dirkwhoffmann/vAmiga

Screenshot 2019-05-17 at 12 59 32

Todo: Implement HAM mode

Bug

Most helpful comment

Pawn intro screen for me was not HAM, it was a palette swap per line via the copper ...Dynamic Hires from Newtek Digi-View maybe interlaced (flicker)

I just run The Pawn with some debug output enabled. It turns out that we're both right. The Pawn draws in HAM mode (interlaced), just as it uses palette swapping. The Copper is used to update the color registers ever line:

E.g., the following is happening in frame 2970, line 50:

[2970] ( 50,  2)  FC0F94: PCBD 65AC 1000: Colorizer: pokeCOLOR00(0)
[2970] ( 50,  6)  FC0F94: PCBD 65AC 1000: Colorizer: pokeCOLOR01(13)
[2970] ( 50, 10)  FC0F94: PCBD 65AC 1000: Colorizer: pokeCOLOR02(12)
[2970] ( 50, 14)  FC0F94: PCBD 65AC 1000: Colorizer: pokeCOLOR03(0)
[2970] ( 50, 18)  FC0F94: PCBD 65AC 1000: Colorizer: pokeCOLOR04(0)
[2970] ( 50, 22)  FC0F94: PCBD 65AC 1000: Colorizer: pokeCOLOR05(0)
[2970] ( 50, 26)  FC0F94: PCBD 65AC 1000: Colorizer: pokeCOLOR06(0)
[2970] ( 50, 30)  FC0F94: PCBD 65AC 1000: Colorizer: pokeCOLOR07(0)
[2970] ( 50, 34)  FC0F94: PCBD 65AC 1000: Colorizer: pokeCOLOR08(0)
[2970] ( 50, 38)  FC0F94: PCBD 65AC 1000: Colorizer: pokeCOLOR09(0)
[2970] ( 50, 42)  FC0F94: PCBD 65AC 1000: Colorizer: pokeCOLOR10(0)
[2970] ( 50, 46)  FC0F94: PCBD 65AC 1000: Colorizer: pokeCOLOR11(0)
[2970] ( 50, 50)  FC0F94: PCBD 65AC 1000: Colorizer: pokeCOLOR12(0)
[2970] ( 50, 54)  FC0F94: PCBD 65AC 1000: Colorizer: pokeCOLOR13(0)
[2970] ( 50, 58)  FC0F94: PCBD 65AC 1000: Colorizer: pokeCOLOR14(0)
[2970] ( 50, 62)  FC0F94: PCBD 65AC 1000: Colorizer: pokeCOLOR15(0)

This makes Pawn a brilliant test case for checking the timing of color registers. Right now, Denise picks up a changed color value immediately which is not accurate.

All 9 comments

Hmm, experimental HAM mode seems to work:

Screenshot 2019-05-18 at 12 05 09

However, Pawn looks like this 馃:

Screenshot 2019-05-18 at 12 07 33

Pawn intro screen for me was not HAM, it was a palette swap per line via the copper ...Dynamic Hires from Newtek Digi-View maybe interlaced (flicker)

That explains a lot. I took a screenshot from SAE and and it appeared to me that the pixels are squares. HAM pixels are lores pixels which means they are twice as wide as heigh.

But how come the HAM flag is set 馃馃槦.

BTW, as HAM pixels are twice as wide as high, one could assigned the first pixel a mixed colour which should result in improved HAM picture quality (HAM is all about changing colours smoothly). I'll try to do some experiments with such an extra-smooth HAM mode.

Pawn intro screen for me was not HAM, it was a palette swap per line via the copper ...Dynamic Hires from Newtek Digi-View maybe interlaced (flicker)

I just run The Pawn with some debug output enabled. It turns out that we're both right. The Pawn draws in HAM mode (interlaced), just as it uses palette swapping. The Copper is used to update the color registers ever line:

E.g., the following is happening in frame 2970, line 50:

[2970] ( 50,  2)  FC0F94: PCBD 65AC 1000: Colorizer: pokeCOLOR00(0)
[2970] ( 50,  6)  FC0F94: PCBD 65AC 1000: Colorizer: pokeCOLOR01(13)
[2970] ( 50, 10)  FC0F94: PCBD 65AC 1000: Colorizer: pokeCOLOR02(12)
[2970] ( 50, 14)  FC0F94: PCBD 65AC 1000: Colorizer: pokeCOLOR03(0)
[2970] ( 50, 18)  FC0F94: PCBD 65AC 1000: Colorizer: pokeCOLOR04(0)
[2970] ( 50, 22)  FC0F94: PCBD 65AC 1000: Colorizer: pokeCOLOR05(0)
[2970] ( 50, 26)  FC0F94: PCBD 65AC 1000: Colorizer: pokeCOLOR06(0)
[2970] ( 50, 30)  FC0F94: PCBD 65AC 1000: Colorizer: pokeCOLOR07(0)
[2970] ( 50, 34)  FC0F94: PCBD 65AC 1000: Colorizer: pokeCOLOR08(0)
[2970] ( 50, 38)  FC0F94: PCBD 65AC 1000: Colorizer: pokeCOLOR09(0)
[2970] ( 50, 42)  FC0F94: PCBD 65AC 1000: Colorizer: pokeCOLOR10(0)
[2970] ( 50, 46)  FC0F94: PCBD 65AC 1000: Colorizer: pokeCOLOR11(0)
[2970] ( 50, 50)  FC0F94: PCBD 65AC 1000: Colorizer: pokeCOLOR12(0)
[2970] ( 50, 54)  FC0F94: PCBD 65AC 1000: Colorizer: pokeCOLOR13(0)
[2970] ( 50, 58)  FC0F94: PCBD 65AC 1000: Colorizer: pokeCOLOR14(0)
[2970] ( 50, 62)  FC0F94: PCBD 65AC 1000: Colorizer: pokeCOLOR15(0)

This makes Pawn a brilliant test case for checking the timing of color registers. Right now, Denise picks up a changed color value immediately which is not accurate.

New color management code has recorded more than 128 color changes in a single row 馃槼.

Todo: Check how this is possible. Assuming that only Copper is used to change the color registers (to be checked), changes should be limited by approx. 224 / 4 = 56.

Upper part of the intro screen:

SAE:

Bildschirmfoto 2019-08-11 um 17 48 16

vAmiga:

Bildschirmfoto 2019-08-11 um 17 48 34

Either vAmiga starts with wrong bitplane data or it starts drawing too early (maybe for certain biplanes only which may cause the graphics glitches).

This bug is giving me a hard time, but I am coming closer. I faked the HAM mode in both SAE and vAmiga such that only 1 bitplane is drawn (without hold and modify).

This shows clearly that

  • the bitplane data itself is not corrupted in vAmiga (at least plane 1)
  • the bitplane data is shifted in vAmiga. But why? 馃

Bildschirmfoto 2019-08-14 um 18 56 24

Bildschirmfoto 2019-08-14 um 18 55 59

vAmiga starts DMA in rasterline 26:

[1610] ( 26,191)  FC0F94 BCB-DA 65AC 0000 Agnus: addBPLMOD0 +30 = 159594 ($26F6A)
[1610] ( 27,191)  FC0F94 BCB-DA 65AC 0000 Agnus: addBPLMOD0 +30 = 159654 ($26FA6)
[1610] ( 28,191)  FC0F94 BCB-DA 65AC 0000 Agnus: addBPLMOD0 +30 = 159714 ($26FE2)

It is doing so, because lines 0 ... 25 belong to the VBLANK area where no DMA can take place.

Strangely enough, SAE DMA starts DMA in line 19 馃槼:

amiga.js:295 (19,191) add_modulo 0: add 30 to bplpt = 159594 bplptx = 159594
amiga.js:295 (20,191) add_modulo 0: add 30 to bplpt = 159654 bplptx = 159654
amiga.js:295 (21,??) add_modulos 0: 159714 (159714) 1: 174714 (174714) 2: 189714 (189714) 3: 204714 (204714) 4: 219714 (219714) 5: 234714 (234714)
amiga.js:295 (22,??) add_modulos 0: 159774 (159774) 1: 174774 (174774) 2: 189774 (189774) 3: 204774 (204774) 4: 219774 (219774) 5: 234774 (234774)

How come? 馃

Bildschirmfoto 2019-08-15 um 10 00 24

Solved 馃槑. DMA can take place in VBLANK area, it is simply not displayed. DMA is only delayed by the vertical DIW flop. Hence, if the DIW V flop is set inside the VBLANK area, DMA starts early.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dirkwhoffmann picture dirkwhoffmann  路  3Comments

dirkwhoffmann picture dirkwhoffmann  路  3Comments

dirkwhoffmann picture dirkwhoffmann  路  4Comments

dirkwhoffmann picture dirkwhoffmann  路  3Comments

dirkwhoffmann picture dirkwhoffmann  路  3Comments