dirkwhoffmann / vAmiga

vAmiga is a user-friendly Amiga 500, 1000, 2000 emulator for macOS
https://dirkwhoffmann.github.io/vAmiga
Other
304 stars 25 forks source link

vAmiga crash after exiting intro of Brataccas (1990)(Psygnosis) #104

Closed Alessandro1970 closed 5 years ago

Alessandro1970 commented 5 years ago

vAmiga crash after exiting intro of Brataccas (1990)(Psygnosis).

Report: report.txt

Game: Brataccas (1990)(Psygnosis)[cr Rectum Research].adf.zip

dirkwhoffmann commented 5 years ago

Crash was easy to fix.

However, it now hangs in an infinite loop. The game does not detect any key press πŸ˜–. I didn't find out yet how exactly it polls the keyboard.

Screenshot 2019-07-18 at 10 52 47

In SAE, I can run it up to this screen, but I don't know what to do next. Either the game is frozen or I am not smart enough to get it startet πŸ€”.

Screenshot 2019-07-18 at 11 01 33
Alessandro1970 commented 5 years ago

In that place the main character must be seen on the left...something hangs

dirkwhoffmann commented 5 years ago

OK, I'll let Rupert know.

Alessandro1970 commented 5 years ago

Brataccas - Manual

READ ME FIRST INTRODUCTION

Welcome to Brataccas the first Interactive Video. This product will work on the Atari 520ST, the Commodore 512K Amiga and the Apple 512K Fat Mac. The sticker on the front of the package indicates which you have purchased.

QUICK LOADING INSTRUCTIONS

To participate immediately in the Interactive Video, please follow these instructions: If you have difficulty at any stage, please refer to inside Brataccas for more detailed instructions.

  1. Set up your computer but leave the power off.
  2. Insert the disk into your main or internal disk drive (Amiga owners Kickstart first).
  3. You can now turn your system on.
  4. Brataccas will load automatically.
  5. The title screen will load, you should then wait for the main program to load and the message "PRESS ANY KEY" to appear, if you do so, the main program will load and run automatically.
  6. You can now control the hero Kyne, with the mouse on your computer and begin your journey into Brataccas.

Note: a DOOR on the right is missing...

dirkwhoffmann commented 5 years ago

I also found out why vAmiga hangs...

When a key is pressed or released, the keyboard handler calls CIAA::setKeyCode(uint8_t keyCode) which is implemented as follows:

void
CIAA::setKeyCode(uint8_t keyCode)
{
    debug(CIA_DEBUG, "setKeyCode: %X\n", keyCode);

    // Put the key code into the serial data register
    SDR = keyCode;

    // Trigger a serial data interrupt
    delay |= CIASerInt0;    
}

However, I forgot to tell the CIA to wake up. If it is idle (sleeping), it simply ignores what we do here. And indeed, the event inspector shows that both CIAs are sleeping for a while. The bug is shielded most of the time, because CIA A is usually woken up by the VSYNC handler.

Screenshot 2019-07-18 at 12 23 23
dirkwhoffmann commented 5 years ago

Once found, it was really easy to fix:

void
CIAA::setKeyCode(uint8_t keyCode)
{
debug(CIA_DEBUG, "setKeyCode: %X\n", keyCode);

// Put the key code into the serial data register
SDR = keyCode;

// Trigger a serial data interrupt
delay |= CIASerInt0;

// Wake up the CIA
wakeUp();
}

Now the game loads and I do see the main character.

Screenshot 2019-07-18 at 12 58 08

However, the guy immediately starts doing all kind of stuff by itself 😳. How can I get him under control? In UAE, he is also running around like crazy.

Alessandro1970 commented 5 years ago

Oh yes, I have choose this game ti test becouse mouse control movements... πŸ€ͺ. Very difficult.... but it’s only a test for the emulator. Like black lamp

dirkwhoffmann commented 5 years ago

I have choose this game ti test becouse mouse control movements... πŸ€ͺ. Very difficult.

OK, the weird character movement is a feature and not a bug, then. Another issue solved πŸ˜€.