16 December 2023, 00:34 | #1 |
Registered User
Join Date: Aug 2010
Location: Italy
Posts: 787
|
Line 1111 Emulator exception mishandled (WinUAE 5.0.0, 60EC030)
Hi Toni,
I have stumbled upon at least one case where the exception mentioned in the title is mishandled: when it triggers, the stack pointer gets decreased by 16 instead of 8 (which is what is needed by the format $0 4-word stack frame generated by the exception). In the first picture attached here you can see the pc pointing to pmove (8,a5),srp (which is not valid on 68EC030). Trying to execute the instruction causes the exception, but, as shown in the second picture, the sp went from $2300 to $22f0, instead of $22f8. For your convenience, I have attached a little program that triggers the fault (I was testing other stuff with it, but it turned out to be useful also for this). Last edited by saimo; 17 December 2023 at 23:27. Reason: Removed attachment as it was of no use anymore. |
16 December 2023, 09:09 | #2 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,522
|
It is MMU configuration exception you got (writing invalid descriptor to SRP) but because it was not checked that this instruction can also internally generate exception (Exception 56), it also generated F-line on top of it.. Fixed.
Motorola no-MMU models don't change MMU instruction decoding, most MMU registers can be accessed normally but either TC enable bit can't be set (68EC040/060) or CPU hangs or works strangely if MMU is enabled (At least some 68EC030s) UAE simply prevents TC enable bit to be set if EC model. FPU instruction do generate F-line if FPU is missing but missing MMU does not work that way for some reason. (Except 68851 but thats not worth the trouble to emulate..) |
16 December 2023, 14:42 | #3 | ||||
Registered User
Join Date: Aug 2010
Location: Italy
Posts: 787
|
Quote:
(Indeed I had noticed that there were two stack frames, but I was too sick to analyze that as well.) Quote:
Quote:
Quote:
|
||||
16 December 2023, 15:34 | #4 | ||
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,522
|
Quote:
This is the only difference in EC vs MMU emulation. EC = less heavy MMU emulation, only transparent translation emulated. MMU = full MMU. No MMU = MMU instructions are emulated but all the translation/bus error stuff is ignored. Quote:
It is possible most (or even all) 68EC030s are full 68030s with working or non-working MMU. I had one (don't have any 68EC030 anymore) back in the day. It was labeled 68EC030, Enforcer did work and reported errors correctly. Most other programs that use MMU hung immediately. Which is the reason it is not possible to detect 68EC030 from 68030 in software. |
||
16 December 2023, 16:04 | #5 | |
Registered User
Join Date: Aug 2010
Location: Italy
Posts: 787
|
What I mean is: in the real 68EC030s which "works strangely if MMU is enabled", is the abnormal behaviour such that the ACx settings are erroneously overruled?
Quote:
So the F-line exception should never happen, whereas the MMU configuration exception might still happen because the data is actually invalid (normal behaviour) or maybe because of the malfunctioning of the control register - and thus, I guess, this is the exception that WinUAE emulates. Do I get it right? |
|
16 December 2023, 19:09 | #6 | ||
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,522
|
Quote:
Note that AC0, AC1, ACUSR are simply renamed TT0, TT1 and MMUSR. Instruction opcodes are identical. There is no 68EC030 only instructions even if documentation tries mislead. For example ACUSR has bits marked as "x" because they can still contain normal MMU status bits but they can't be trusted. If 68EC030 would be "real" EC030, those bits would have been documented as always zero. Quote:
Technically 68EC030 can do anything when executing this instruction because it is not documented as supported, even if most CPUs do handle it fine. Most likely f-line never happens and instruction works perfectly but CPU also might hang if that part of MMU is broken. UAE simply behaves like "proper" 68030 would work (except TC) because that is how 68EC030 I had in 1990s behaved. Unfortunately I don't have any 68EC030 for testing. |
||
16 December 2023, 19:54 | #7 | |||||
Registered User
Join Date: Aug 2010
Location: Italy
Posts: 787
|
Quote:
Quote:
Quote:
Quote:
Quote:
The solution you went for is fine already And, software-wise, I guess the only option is slapping a notice in the readme that says: DO YOU HAVE A 68EC030? THIS THING MIGHT NOT WORK! Last edited by saimo; 17 December 2023 at 13:48. Reason: Fixed broken/unfinished sentence. |
|||||
16 December 2023, 23:22 | #8 |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,233
|
There is unfortunately no reliable way how to detect an EC model. Motorola produced the ECs from the same mask set, and either sold those chips as EC whose MMU did not work reliable or could not work up to the specs, or simply sold totally fine CPUs as EC models because there was more demand.
The mmu.library performs a "MMU dry run" by changing the MMU mapping, remapping parts of the kickstart ROM to some other place and then checks whether that operation was successful - but as said, this test may even pass on ECs and the EC CPU may just react strangely later on - for example if some timing constraints cannot be met, the system may hang or crash without giving software a chance to detect the situation reliably. |
17 December 2023, 13:50 | #9 | ||
Registered User
Join Date: Aug 2010
Location: Italy
Posts: 787
|
Quote:
Quote:
|
||
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Exception "Line 1111 Emulator" ($2C) at $B66 occurred. | subone | support.Hardware | 14 | 25 September 2016 04:32 |
WHDLoad Errors: Exception "Line 1111 Emulator" | vext01 | support.Apps | 15 | 17 February 2014 09:00 |
"Exception "Line 1111 Emulator" ($2c) Error at $1004" when exiting game | demolition | support.WinUAE | 15 | 30 November 2012 16:43 |
Line 1111 Emulator Error | Retrofan | support.Other | 22 | 21 October 2012 01:08 |
Nightbreed Interactive Movie - "Line 1111 Emulator" exception | MethodGit | project.WHDLoad | 5 | 18 April 2007 15:27 |
|
|