-
-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
High Density by Darkness crashes #466
Comments
it may generates some "invalid" instructions that may still be run-able on original CPU. |
I see. |
so can be closed ? |
No, the bug is still there. The demo runs just fine on my original A500. |
Hi, Despite not having a Mac to run vAmiga, I've been following your project with interest since I'm making my own emulator (just or fun) and your test suite has been extremely helpful. Thank you for making it available! I've encountered the same bug, and I think it is very likely caused by incorrect blitter/interrupt timing. Just before switching to the next part, this happens (exact locations depend on configuration, try KS1.3+1MB chip only+2 drives): Level3 interrupt points to vblank handler:
And the following code is executed to start a blitter queue:
If the blit started at (a) ends up triggering a level 3 interrupt before the instruction at (b) has begun executing the stack will blow up and D5 (=$00011111) ends up overwriting the value at $0007ac88, which is later added with 6 to form the odd address used in the loop in your screenshot:
In my emulator adding 4 extra idle cycles to the blitter "fixes" the issue and allows proceeding to the next part. This is obviously not correct, but there is some start delay (http://eab.abime.net/showpost.php?p=579567&postcount=30). (I've already added some delay to interrupts triggering due to #274). Note the intro works in latest WinUAE beta (4.9.0b34). |
Wow, very cool. This bug is around for some time now. I always wanted to start working on it, but I didn’t really know where to begin. I think overall Blitter timing (the number of cycles the Blitter executes) is fine in vAmiga, but there might well be a bug, e.g., in blocking the bus at the right cycles (some cycles during the Blitter ramp up phase might block the bus on a real Amiga, but not in vAmiga. This is just a guess at the moment, but it could well be something like that). But let’s ask Toni first. Since the bug has been fixed recently in UAE, maybe @tonioni can give us a hint where to look at. His helpful hints saved me tons of time in the past. |
beautiful teamwork ! 🏩 |
@mras0 do you have the source code of your emulator somewhere online? |
@dirkwhoffmann: Yeah, obviously the issue could be caused by many things, but it happens (both in Winuae and my emulator) very early in the frame, so bus contention should be low. @mithrendal: It is now: https://github.com/mras0/AmiEmu (again, it wasn't/isn't intended for anyone else, so it's not pretty/usable. Also win32 only for now). The hack I mentioned isn't included. BTW the intro seems to work in WinUAE 4.9.0b1 as well, but not 4.4.0, so it was fixed some time ago. Trace from 4.9.0b34:
4.4.0 (where it fails):
Winuae state file just before the relevant part: highdensity2.zip |
Lots of moving parts here.. 4.9b1 working probably was an accident :) Blitter start after BLTSIZE write (1 cycle + 2 blitter idle cycles)
Cycle $6C "b" is where blitter interupt is generated initially. CLR.B $xxx.L (prefetch, prefetch, read, [IPL detect] prefetch, write) which happens just early enough (4 CCKS + 2 CPU cycles) to not detect the blitter interrupt -> following MOVE.L gets executed before interrupt. This is not the only one with similar stupid interrupt handling. Hope this helped :) |
Perfect, thanks a lot!!! With the detailed information above, it should be easy to fix. |
Finally, this issue is fixed 😎. Thanks to all who have contributed. Great team work. Summary: The error was caused by two independent bugs in vAmiga:
|
This intro https://files.scene.org/get/parties/1994/saturne94/amiga/in64/darkness-high_density.zip will crash after the "Fractal Roots" part. From what I understand the intro uses some heavy self-modifying code and I think UAE can't run it either (at least as of Aug 2020)
The text was updated successfully, but these errors were encountered: