English Amiga Board


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

 
 
Thread Tools
Old 16 March 2013, 04:29   #1
vagrant
Registered User
 
vagrant's Avatar
 
Join Date: Mar 2012
Location: Australia
Age: 44
Posts: 1,126
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 vagrant; 26 August 2013 at 10:19.
vagrant is offline  
Old 16 March 2013, 07: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 07:24. Reason: wrong url
ascp is offline  
Old 16 March 2013, 08:24   #3
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,519
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 offline  
Old 16 March 2013, 11:58   #4
vagrant
Registered User
 
vagrant's Avatar
 
Join Date: Mar 2012
Location: Australia
Age: 44
Posts: 1,126
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)
vagrant is offline  
Old 16 March 2013, 12:56   #5
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,519
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 offline  
Old 16 March 2013, 16:48   #6
Wepl
Moderator
 
Wepl's Avatar
 
Join Date: Nov 2001
Location: Germany
Posts: 866
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, 17:21   #7
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,519
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 offline  
Old 17 March 2013, 11:23   #8
Wepl
Moderator
 
Wepl's Avatar
 
Join Date: Nov 2001
Location: Germany
Posts: 866
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, 14:43   #9
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,519
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 17:20.
Toni Wilen is offline  
Old 17 March 2013, 23:47   #10
Wepl
Moderator
 
Wepl's Avatar
 
Join Date: Nov 2001
Location: Germany
Posts: 866
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, 124 views)
File Type: s divzero.s (3.0 KB, 139 views)
Wepl is offline  
Old 18 March 2013, 08:21   #11
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,519
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 offline  
 


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 20:32
Odyssey Reborn - Odyssey demo remake viddi Amiga scene 4 11 October 2013 23:41
whdload freeze my 530. Tiki support.Games 3 08 July 2011 22:26
Odyssey whd demo Mad-Matt support.Demos 14 01 January 2008 23:58
WHDLoad version of Odyssey oldpx request.Old Rare Games 2 18 December 2002 01: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 11:08.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.10563 seconds with 14 queries