English Amiga Board


Go Back   English Amiga Board > Other Projects > project.WHDLoad

 
 
Thread Tools
Old 16 March 2013, 05:29   #1
ED-209
Registered User

ED-209's Avatar
 
Join Date: Mar 2012
Location: OCP
Age: 39
Posts: 1,124
Odyssey whdload (demo) freeze under winuae

So early in the demo during the part where a ship flies across a planets surface, the ship freezes and landscape continues forever..
I've tried (seemingly) everything but not matter what the demo always bugs at this point.

I know there's a few other threads addressing the issue but the OP's have just given up and gone onto floppy versions. Apparently works ok on real amiga but not winuae.

Last edited by ED-209; 26 August 2013 at 11:19.
ED-209 is offline  
Old 16 March 2013, 08:23   #2
ascp
Pastafarian

 
Join Date: Sep 2010
Location: Uppsala/Sweden
Posts: 290
File a bugreport at http://www.whdload.de/demos/Alcatraz_Odyssey.html so that the authors may notice it.

Last edited by ascp; 16 March 2013 at 08:24. Reason: wrong url
ascp is offline  
Old 16 March 2013, 09:24   #3
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 44
Posts: 23,349
With and/or without JIT? (2.6 betas have some JIT specific exception tweaks and I think this demo used division by zero exceptions during that part)
Toni Wilen is online now  
Old 16 March 2013, 12:58   #4
ED-209
Registered User

ED-209's Avatar
 
Join Date: Mar 2012
Location: OCP
Age: 39
Posts: 1,124
Yep it happens with JIT enabled or disabled, cycle exact enable/disable also tried blitter options, 'more compatible' etc. (I even tried all 3 versions of the demo)
ED-209 is offline  
Old 16 March 2013, 13:56   #5
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 44
Posts: 23,349
I checked it, I remembered correctly, it assumes undocumented DIVS behavior when dividing by zero (V flag getting cleared).

68020 sets V and UAE uses 68020 behavior if CPU is 68020+. 68060 (perhaps 68040 too) seems to again clear V.

So this demo won't work on 68020 (real or emulated) but it may work on real 68030+ (or maybe only 68040+).
Toni Wilen is online now  
Old 16 March 2013, 17:48   #6
Wepl
Moderator
Wepl's Avatar
 
Join Date: Nov 2001
Location: Germany
Posts: 690
This could probably fixed in the whdload slave.
Can you show me a code snippet and address where the bad code is located?
Wepl is offline  
Old 16 March 2013, 18:21   #7
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 44
Posts: 23,349
Quote:
Originally Posted by Wepl View Post
This could probably fixed in the whdload slave.
Can you show me a code snippet and address where the bad code is located?
Code:
00082F9C 0c86 0000 7fff           CMP.L #$00007fff,D6
00082FA2 6f06                     BLE.B #$00000006 == $00082faa
00082FA4 5245                     ADD.W #$00000001,D5
00082FA6 e286                     ASR.L #$00000001,D6
00082FA8 60f2                     BT .B #$fffffff2 == $00082f9c
00082FAA 8fc6                     DIVS.W D6,D7
00082FAC 6806                     BVC.B #$00000006 == $00082fb4
00082FAE e287                     ASR.L #$00000001,D7
00082FB0 5345                     SUB.W #$00000001,D5
00082FB2 60f6                     BT .B #$fffffff6 == $00082faa
BVC.B at 82FAC should jump (V=0) if DIVS tried to divide by zero. (Divide by zero exception does nothing, it points directly to RTE)

(and if someone is bored enough, 68030 and 68040 needs divs/divu divide by zero flag test)
Toni Wilen is online now  
Old 17 March 2013, 12:23   #8
Wepl
Moderator
Wepl's Avatar
 
Join Date: Nov 2001
Location: Germany
Posts: 690
so clearing the V flag in the exception handler should sufficient I think
I will check behavior on 30/40...
Wepl is offline  
Old 17 March 2013, 15:43   #9
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 44
Posts: 23,349
I just noticed 68020 DIVS and DIVU has very different flag bebavior when dividing by zero, DIVU is correct but DIVS isn't correct in UAE.

I think it is better to not "fix" this until all CPU models are tested. There may not be anything to fix.. (I don't want fixes for bad emulation, they only hide possible future problems)

68020 and 68030: Signed divide: Z=1, NVC=0. Unsigned: V=1, N=dst<0, Z=!N. (Weird, isn't it?)

68060: Clear C. All other flags are preserved.

EDIT: I was wrong, demo works if CPU clears V or does not modify it. It only gets stuck if V is set by the CPU.

EDIT2: A1200 + 68020 and 68060 tested and space ship part confirmed working.

EDIT3: 68030 tested. Exact same as 68020 (was not surprising). I'd assume 68040 does same as 68060.

-> No need for slave fixes.

Last edited by Toni Wilen; 17 March 2013 at 18:20.
Toni Wilen is online now  
Old 18 March 2013, 00:47   #10
Wepl
Moderator
Wepl's Avatar
 
Join Date: Nov 2001
Location: Germany
Posts: 690
wrote a test slave:

MC68060 UAE=N
divu X=X N=X Z=X V=X C=0
divs X=X N=X Z=X V=X C=0

MC68040 UAE=N
divu X=X N=X Z=X V=X C=0
divs X=X N=X Z=X V=X C=0

MC68030 UAE=N
divu X=X N=1 Z=0 V=1 C=0
divs X=X N=0 Z=1 V=0 C=0

MC68020 UAE=N
divu X=X N=1 Z=0 V=1 C=0
divs X=X N=0 Z=1 V=0 C=0

question remains if results on 20/30 depends on the value of the dividend
Attached Files
File Type: slave DivZero.Slave (396 Bytes, 62 views)
File Type: s divzero.s (3.0 KB, 71 views)
Wepl is offline  
Old 18 March 2013, 09:21   #11
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 44
Posts: 23,349
Thanks. 68040 = 68060, everything is fine

Quote:
Originally Posted by Wepl View Post
question remains if results on 20/30 depends on the value of the dividend
It does. "dst" in my previous test was dividend. (dividend < 0: N=1 Z=0, dividend >= 0: N=0 Z=1)

Documentation also says overflow makes N and Z undefined. More testing to do, later..
Toni Wilen is online now  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Odyssey WHDLOAD Rochabian support.Games 34 28 September 2018 21:32
Odyssey Reborn - Odyssey demo remake viddi Amiga scene 4 12 October 2013 00:41
whdload freeze my 530. Tiki support.Games 3 08 July 2011 23:26
Odyssey whd demo Mad-Matt support.Demos 14 02 January 2008 00:58
WHDLoad version of Odyssey oldpx request.Old Rare Games 2 18 December 2002 02:03

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 18:37.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Page generated in 0.08800 seconds with 16 queries