Skip to content
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

Graphics corruption in Devious Tools 019 #676

Closed
emoon opened this issue Apr 2, 2022 · 8 comments
Closed

Graphics corruption in Devious Tools 019 #676

emoon opened this issue Apr 2, 2022 · 8 comments
Labels
Bug Something isn't working v2.0

Comments

@emoon
Copy link

emoon commented Apr 2, 2022

http://janeway.exotica.org.uk/release.php?id=81142

http://ftp.amigascne.org/pub/amiga/UtilityDisks/DeviousTools/DeviousDezigns-DeviousTools19.adf

Expected result (screenshot taken from website)

image

And I get this in vAmiga 2.0b1

image

It seems to work with KS 2.0+ only so I use the KS from A500+ and I have set chipset Agnus: ECS
That being said I'm not 100% sure that this disk will work under A500+ settings.

Maybe same issue as #675

@mras0
Copy link

mras0 commented Apr 3, 2022

Extra info: It appears to work as expected with Kickstart-v2.05-rev37.299-1991-Commodore-A600.rom (and 3.1), but not Kickstart-v2.04-rev37.175-1991-Commodore-A500plus.rom

@emoon
Copy link
Author

emoon commented Apr 3, 2022

Ah that is interesting. I wonder if some bug was fixed in 2.05 that would cause this? 🤔

@mras0
Copy link

mras0 commented Apr 3, 2022

Just did a quick disassembly of both ROMs and the ECS (and AGA?) detection stuff changed between the two versions. In v2.04 it's done inline in the function starting at $fa857e while in v2.05 it's been moved to a function (that does something different) at $fb92e2.

I haven't bothered analyzing the issue, but changing Denise::peekDENISEID() to always return 0xFFFF (this is what WinUAE does for OCS) fixes it.

@dirkwhoffmann
Copy link
Owner

but changing Denise::peekDENISEID() to always return 0xFFFF

Great! It also fixes #675 (Simon the sorcerer).

@mras0
Copy link

mras0 commented Apr 3, 2022

BTW code in v2.04 works like this (clearly not hand written assembly):

UBYTE id = Custom->deniseid & 0xff;
for (int i = 0; i < 16; ++i) {
    if (id != (Custom->deniseid & 0xff)) {
        id = -1;
        break;
    }
}

And peekCustomFaulty16 returns $2000 and then $0000 16 times in a row, explaining why it detects something other than OCS. $00 -> ECS denise detected (would also have detected AGA if 2.04 supported it).

It seems like a good idea to always just return 0xffff for deniseid (even if this isn't 100% accurate).

@dirkwhoffmann
Copy link
Owner

BTW code in v2.04 works like this

Interesting! Based on the fact that they read the register 17 times, there seems to be some randomness involved on a real machine. In vAmiga, I always returned the last value on the data bus (if I remember correctly).

It seems like a good idea to always just return 0xffff

Yes, agreed. I'll do it this way from now on.

@dirkwhoffmann dirkwhoffmann added Bug Something isn't working v2.0 labels Apr 3, 2022
@mras0
Copy link

mras0 commented Apr 3, 2022

Interesting! Based on the fact that they read the register 17 times, there seems to be some randomness involved on a real machine. In vAmiga, I always returned the last value on the data bus (if I remember correctly).

Yes, the register isn't present on OCS, so it is reading bus noise there (http://amiga-dev.wikidot.com/hardware:deniseid). Given that they changed it (rather quickly), they must have found that it didn't always work reliably. The revised version isn't too different, but it disable interrupts, compares the full word value, mixes in some useless TST.W D5 instructions and does a read from intenar just before reading deniseid presumably to reduce the number of false positives.

Still doesn't seem very robust to me, but since it doesn't appear to have changed through 3.1 (I don't have 3.2 to check) it must have been good enough.

@dirkwhoffmann
Copy link
Owner

Fixed in v2.0b2 which is now online.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working v2.0
Projects
None yet
Development

No branches or pull requests

3 participants