Login
Back to forumSee the full topicGo to last reply

Posted By

IstvanV
on 2007-06-10
16:22:53
 Re: plus4emu 1.1.1 release

One particular demo where I encountered this problem is "Infinity". It has crashed a few times while I tested the new 1541 serial bus timing code, although it also completed successfully in 80-90% of the attempts to run it until the end. At first I thought it may be data corruption on the serial bus due to timing problems, but after some debugging, I have found the above described issue, and changing the emulator to make sure that $55 is never returned as a floating bus value on $FEx0 does make the crash go away (note: I made it repeatable by hacking the command line D64 loading until I found a timing with which the crash does occur; since the demo is non-interactive, it always runs exactly the same way when auto-started from the command line). Of course, it is a matter of many small timing differences if the parallel interface check happens exactly at a time when $55 would be read because the TED has just read it is a bitmap from memory. It may or may not happen on a real machine, and even if it does, it is not repeatable.
The $EDA9 routine is used by many other kernal calls (talk, second, etc.), so it is not specific to demos that were written to support the 1551. What normally prevents the bug from being triggered is that $55 is not on the data bus when the check is done. However, it can be shown (at least on my machine) with this simple test below, which changes the color of the border when a parallel port drive is detected; it does for me, even though I have nothing on the expansion port. If I remove the FF12/FF13 writes so that there is no $55 on the screen, it works correctly.
1010 A0 08 LDY #$08
1012 A2 00 LDX #$00
1014 A9 D0 LDA #$D0
1016 8D 20 10 STA $1020
1019 A9 18 LDA #$18
101B 8D 23 10 STA $1023
101E BD 00 D8 LDA $D800, X
1021 9D 00 20 STA $2000, X
1024 E8 INX
1025 D0 F7 BNE $101E
1027 EE 20 10 INC $1020
102A EE 23 10 INC $1023
102D 88 DEY
102E D0 EE BNE $101E
1030 A9 55 LDA #$55
1032 A2 00 LDX #$00
1034 9D 00 19 STA $1900, X
1037 E8 INX
1038 E0 08 CPX #$08
103A D0 F8 BNE $1034
103C A9 C0 LDA #$C0
103E 8D 12 FF STA $FF12
1041 A9 19 LDA #$19
1043 8D 13 FF STA $FF13
1046 A9 08 LDA #$08
1048 85 AE STA $AE
104A 20 A9 ED JSR $EDA9
104D B0 FB BCS $104A
104F EE 19 FF INC $FF19
1052 4C 4A 10 JMP $104A



Back to top


Copyright © Plus/4 World Team, 2001-2024