English Amiga Board

English Amiga Board (http://eab.abime.net/index.php)
-   support.WinUAE (http://eab.abime.net/forumdisplay.php?f=5)
-   -   $BFE400 / $BFE500 from Winuae 3.3.0 and forwards responds with 0 (http://eab.abime.net/showthread.php?t=88169)

StoneOakvalley 06 August 2017 12:42

$BFE400 / $BFE500 from Winuae 3.3.0 and forwards responds with 0
 
My friend created a program many years ago called "FunWordGenerator" for Amiga 2.04 kick and beyond, and he use the following code to get random seed out.

PROC rnd(max)
DEF a[3]:ARRAY OF LONG,b,r=0

-> Delay(3)
DateStamp(a)
Delay(Rnd(3))
b:=Char($BFE400)*Char($BFE500)
b:=b*a[2]
-> b:=b OR %10000000000000000000000000000000
b:=b-(b*8)
->WriteF('\n\nInit value = \d\n',b*1000)
Rnd(RndQ(b*10000))
r:=Rnd(max)

ENDPROC r

Prior to Winuae 3.3.0 the numbers responded something, but from 3.3.0 it always returns 0 and our program fails. Even in 3.5.0

On a real Amiga 500, with 2.0 kick and 0.5 extra ram, it responds back something other than 0, even if date on that Amiga was set to 1992 or 2017.

What has happen since 3.3.0 that would cause this? I've tried a number of options in WinUAE but nothing happens...

edit: added links to photo of real amiga and the software "FWGEN.adf"
http://www.stone-oakvalley-studios.com/winuae/

Toni Wilen 06 August 2017 13:04

It is depending on undefined behavior (reading "bus noise", it does not read CIA registers) and it is only emulated if more compatible is checked.

StoneOakvalley 06 August 2017 14:17

I played with all the "More Compatible" settings in WinUAE 3.5.0 along trying different combos within CPU, JIT, Compatible Settings (Advanced Settings), Clock Source and bunch of other menus/checkmarks (reset winuae every time), but the BFE4000/BFE500 always responds back 0.

Right now, Winuae 3.2.0 acts as real hardware Amiga, but 3.3.0 and above does not. What setting can I check in WinUAE to make it as WinUAE 3.2.0, clearly something has happen in the code for 3.3.0 ?

Toni Wilen 06 August 2017 17:35

No, it has never acted as real hardware (without accurate A500 mode), only difference was that previously "default" was FF, not 00 as a side-effect of memory related change (but neither are correct)

I don't usually add workarounds for system friendly programs that do bad things and this is quite bad thing (What you get isn't even random, at least when having 68000 CPU you get whatever CPU prefetched previously = static values!). It would have been much better idea to read the actual CIA timer register. (Accessing BFExyz where z bit 0 is clear: Enable CIA-A, CIA-A drives bits 8 to 15 of data bus but code reads bits 0 to 7 which is not driven by any chip)

I can change it back to FF but there probably is another bad program that don't like it..

StoneOakvalley 06 August 2017 18:51

No, its fine. Just want to check if it was intentionally changed from FF to 00 recently, the original programmer can naturally tweak his code to get random that works as intended hopefully on both real hardware and WinUAE :-)

Just leave it as it is, no probb for us!

StoneOakvalley 06 August 2017 23:05

Just want to add that I changed the BFE400 and BFE500 to BFE401 and BFE501, and it routine works now, even in both 3.2.0 and 3.5.0. Haven't tested on real Amiga yet.

StoneOakvalley 06 August 2017 23:18

By the way, Winuae 3.5.0 has a GUI bug.

Inside Chipset and click "Cycle-Exact (Full)", the "Wait for Blitter" is unchecked and available. But if you try to click "Wait for Blitter" to check it on, the button dont get checked and instead goes disabled/grey and then the "Video port display hardware:" pulldown becomes active and first item selected.


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

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.

Page generated in 0.04331 seconds with 11 queries