Vamiga: Barbarian bugs

Created on 5 Jun 2019  Β·  20Comments  Β·  Source: dirkwhoffmann/vAmiga

Barbarian Psignosys hangs before show the first intro.

Barb.adf.zip

Bug

Most helpful comment

Obliterator is working, too. I used to play this a lot and still remember the very cool sound track 😎.

Bildschirmfoto 2019-07-22 um 13 16 25

Bildschirmfoto 2019-07-22 um 13 18 01

All 20 comments

The emulator hangs in an infinite loop:

Screenshot 2019-06-06 at 07 43 24

BFDD00 is the CIAB interrupt control register.

DSKINDEX interrupt was triggered by the wrong CIA. However, there are many more bugs ...

After the first bug had been fixed, a lot of new bugs came up:

  1. Game loader hangs if a drive other than a turbo drive is selected.

  2. Hacker intro screen is scrambled:

Screenshot 2019-06-09 at 14 18 54

Reference (SAE):

Screenshot 2019-06-09 at 15 33 35

  1. Psygnosys screen is not shown (black screen).

  2. Intro where Barbarian hits the chain with his weapon is flickering (graphics timing errors)

Once the intro starts the turbo mode does not stop (0.29)

Once the intro starts the turbo mode does not stop (0.29)

Good catch. Turbo mode is directly linked to the drive motor which hints to a disk controller bug (might be related to #87)

Barbarians are evil!

First, an excerpt from the UAE / SAE documentation:

/* OCS/ECS:
 * reading write-only register causes write with last value in chip
 * bus (custom registers, chipram, slowram)

I didn't implement this, because vAmiga does not store the last bus value yet and I thought that no decent programmer would do such weird things. Well, Barbarians do:

Excerpt from my SAE debug log 😯:

amiga.js:295 READING WRITE-ONLY-REGISTER 96
amiga.js:295 Custom.get16_real() 00dff096 read = ffff. value written = 0000
amiga.js:295 READING WRITE-ONLY-REGISTER 88
amiga.js:295 Custom.get16_real() 00dff088 read = ffff. value written = 0000
amiga.js:295 READING WRITE-ONLY-REGISTER 88
amiga.js:295 Custom.get16_real() 00dff088 read = ffff. value written = 0000

Register 0x96 is DMACON. However, this shouldn't be an issue, because if 0 is written, nothing happens.

Register 0x88 is COPJMP1. Maybe this is the way for Barbarians to start the Copper?? πŸ€” We'll see...

Enough for today. Latest findings:

READING NON-OCS OR WRITE-ONLY REGISTER 88  dmacon = 0 dmaen = 200

The read access triggers a write access into the strobe register

COPJMP: vpos = 289 old_hpos = 0 wasstopped: NaN oldstrobe: 1 state: 15 vblank: 0 SAEV_Copper_enabled_thisline: 0
amiga.js:295 dmacon = 0 dmaen = 200
amiga.js:295 COPJMP(2): cop_state.state = 14

State 14 = COP_strobe_extra

amiga.js:295 Custom.get16_real() 00dff088 read = ffff. value written = 0000

Second read that triggers a write

amiga.js:295 update_copper(until hpos 68)
amiga.js:295 update_copper(until hpos 78)
amiga.js:295 COP_strobe_delay1: vpos = 289 ($121) hpos = 70 ($46) dmacon = $380 dmaen = $200

All of a sudden, DMACON has changed to $380 which means that Copper DMA is enabled. TODO: Check when DMACON changed and who changed it.

Rink_a_Dink-REDUX_by_Lemon-Point_(final).adf.zip

Dirk enough for today, relax and enjoy this demo ! Runs so cool in your vAmiga.

Wow, this is really kind of cool 😎.

Bildschirmfoto 2019-07-21 um 19 08 47

πŸ˜‚

Bildschirmfoto 2019-07-21 um 19 10 20

🀭 Uhhh, a lot of DMA going on here (Copper is yellow)

Bildschirmfoto 2019-07-21 um 19 12 31
Bildschirmfoto 2019-07-21 um 19 12 43

vAmiga a well oiled demo machine. πŸ˜€ The sound was also very cool. a real showcase of the brilliance of vAmiga and its development state that it has already reached. ✌️
I had the denise inspector open when I watched it. It was soo flashy, the colors in the inspector also moving with the musics beat. As if it was part of the demo !!

At the very end of the demo. The developer explains a lot of technical stuff about each effect, for example when he uses blitter and when not, where he heavily relies on copper DMA for speed instead. Interesting reading...

Doing a write when reading a write-only register really does the trick 😎:

Bildschirmfoto 2019-07-22 um 08 14 04

However, the animation errors are still there πŸ™ˆ:

Bildschirmfoto 2019-07-22 um 08 14 19

Todo: Run SAE against vAmiga with Blitter checksums enabled. I don't trust my Blitter.

Bug is identified. Here's the thing:

vAmiga:

…
BLITTER check1: 9fabf42b check2: f2be6d45
[1137] (  5, 60)  06119A BCBSD- 43A8 0042 Agnus: pokeDMACON(8440)
[1137] (  5, 70)  0611A2 BCBSD- 43A8 0042 Agnus: pokeDMACON(40)
[1137] (  5, 70)  0611A2 BC-SD- 43A8 0042 Agnus: Blitter DMA switched off
[1137] (  6, 52)  06119A BC-SD- 43A8 0042 Agnus: pokeDMACON(8440)
[1137] (  6, 52)  06119A BCBSD- 43A8 0042 Agnus: Blitter DMA switched on
[1137] (  6, 62)  0611A2 BCBSD- 43A8 0042 Agnus: pokeDMACON(40)
[1137] (  6, 62)  0611A2 BC-SD- 43A8 0042 Agnus: Blitter DMA switched off
[1137] (  7, 44)  06119A BC-SD- 43A8 0042 Agnus: pokeDMACON(8440)

SAE:

…
BLITTER check1: 9FABF42B check2: F2BE6D45
amiga.js:295 DMACON($8440,68)
amiga.js:295 DMACON($40,78)
amiga.js:295 BLTSIZE 12816 ($3210)
amiga.js:295 DMACON($8440,58)
blitter.js:362 BLITTER Blit 151 (16,200) (1001) 64a84 718e 0 78304 
amiga.js:295 BLITTER check1: A960519 check2: 52C17C45
amiga.js:295 DMACON($40,68)

In SAE, the Blitter is started immediately once it's DMA channel gets enabled. Not in vAmiga, because I didn’t know that the Blitter can be in a β€žpendingβ€œ state (waiting for the DMA channel to be enabled). My Blitter ignores any write to BLTSIZE if Blitter DMA is off.

This is a serious bug that is likely to affect many other programs, too.

Before fixing it, I need to think about a suitable SW architecture though...

😎

Bildschirmfoto 2019-07-22 um 13 01 55

Bildschirmfoto 2019-07-22 um 13 05 23

I watched a long play video on Youtube about this game and it looked so easy 🀨.
Unfortunately, it is not. Game over after seconds πŸ˜–.

Obliterator is working, too. I used to play this a lot and still remember the very cool sound track 😎.

Bildschirmfoto 2019-07-22 um 13 16 25

Bildschirmfoto 2019-07-22 um 13 18 01

...next step: Shadow of the Beast !!!
...then Agony...

I've never played Shadow of the Beast, but I read that it's is pushing the machine to it's limits. Will surely take a long time until it's working in vAmiga.

Does it not start on vAmiga ?

...the character could be a relative of the one used in Brataccas... very ugly...

Does it not start on vAmiga ?

πŸ™„ Noooooo

Strange! I remember to load it with version 0.2 or something like...
VAmiga had some graph error in the background, but the characther run...
There was an orrible load system...when the screen comes black, I remember to change disk and press mouse...

...relatives... yes :+1:

Shadow_of_the_Beast

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dirkwhoffmann picture dirkwhoffmann  Β·  3Comments

dirkwhoffmann picture dirkwhoffmann  Β·  3Comments

dirkwhoffmann picture dirkwhoffmann  Β·  3Comments

dirkwhoffmann picture dirkwhoffmann  Β·  4Comments

dirkwhoffmann picture dirkwhoffmann  Β·  5Comments