English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 29 May 2021, 14:55   #1
Seiya
Registered User

Seiya's Avatar
 
Join Date: Nov 2014
Location: Italy
Posts: 1,300
24bit Addressing

just a curiosity to know if change something in compatibility or performance with 68000 emulation with 24bit addressing false or true. is it better emulation with it enabled or not change nothing if i set disabled?
Seiya is offline  
Old 29 May 2021, 16:19   #2
Samurai_Crow
Total Chaos forever!

Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 47
Posts: 1,814
AmigaBasic stuffs 8 bit variables in the most significant byte of pointers. It won't run on anything with 32 bit addressing.
Samurai_Crow is offline  
Old 29 May 2021, 17:14   #3
a/b
Registered User

 
Join Date: Jun 2016
Location: europe
Posts: 536
Quote:
Originally Posted by Samurai_Crow View Post
AmigaBasic stuffs 8 bit variables in the most significant byte of pointers. It won't run on anything with 32 bit addressing.
Hah, I really didn't know that.
Another brilliant idea by everyone's favorite m$... Who needs more than 640kb for anything, let alone measly 512kb.
a/b is offline  
Old 29 May 2021, 21:33   #4
Thorham
Computer Nerd

Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 45
Posts: 3,237
Quote:
Originally Posted by a/b View Post
Another brilliant idea by everyone's favorite m$... Who needs more than 640kb for anything, let alone measly 512kb.
Just like Commodore with it's stupid 31 bit Amiga OS pointers, because who needs more than 2GB
Thorham is offline  
Old 29 May 2021, 22:17   #5
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 50
Posts: 5,884
some games deliberately or mistakingly use the most signficant byte in jump tables (Xenon 2). With 32 bit mode it crashes.

Masking the MSB has some overhead, though. I remember removing this masking from a musashi fork and gained 5% CPU performance
jotd is offline  
Old 30 May 2021, 00:24   #6
Seiya
Registered User

Seiya's Avatar
 
Join Date: Nov 2014
Location: Italy
Posts: 1,300
ok, thank you.
Seiya is offline  
Old 30 May 2021, 00:34   #7
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 1,490
Quote:
Originally Posted by Samurai_Crow View Post
AmigaBasic stuffs 8 bit variables in the most significant byte of pointers. It won't run on anything with 32 bit addressing.
This was inherited from the MS Basic port to MacOs. Back then, MacOs used the topmost 8 bits of each pointer for its own memory management, to indicate the state of a handle. MS ported its Basic to Mac, and used the same idea. Then, they took the MacOs port, and ported it and its memory management to Amiga.
Thomas Richter is offline  
Old 30 May 2021, 03:33   #8
pipper
Registered User

 
Join Date: Jul 2017
Location: San Jose
Posts: 326
Can the MMU be used to basically emulate 24bit addressing?
pipper is offline  
Old 30 May 2021, 03:41   #9
Samurai_Crow
Total Chaos forever!

Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 47
Posts: 1,814
Quote:
Originally Posted by pipper View Post
Can the MMU be used to basically emulate 24bit addressing?
You'd have to duplicate the same address space 256 times in memory. I don't think conventional MMUs can do that.
Samurai_Crow is offline  
Old 30 May 2021, 07:06   #10
SpaceAce
Registered User

SpaceAce's Avatar
 
Join Date: Jul 2020
Location: Bunbury/Australia
Age: 53
Posts: 14
Quote:
Originally Posted by Thomas Richter View Post
This was inherited from the MS Basic port to MacOs. Back then, MacOs used the topmost 8 bits of each pointer for its own memory management, to indicate the state of a handle. MS ported its Basic to Mac, and used the same idea. Then, they took the MacOs port, and ported it and its memory management to Amiga.

Oh, i remember it well. LOTS of old 24 bit Mac software used to crash when Apple introduced 32bit MacOs.
SpaceAce is offline  
Old 30 May 2021, 11:11   #11
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 1,490
Quote:
Originally Posted by Samurai_Crow View Post
You'd have to duplicate the same address space 256 times in memory. I don't think conventional MMUs can do that.
Yes, of course they can. The problem is only that the 24 bit address space is rather tiny, i.e. maximum of 8MB fast RAM.
Thomas Richter is offline  
Old 30 May 2021, 12:16   #12
BastyCDGS
Registered User
 
Join Date: Nov 2015
Location: Freiburg / Germany
Age: 41
Posts: 172
Send a message via ICQ to BastyCDGS
Hi Thomas!

Quote:
Originally Posted by Thomas Richter View Post
Yes, of course they can. The problem is only that the 24 bit address space is rather tiny, i.e. maximum of 8MB fast RAM.
Is there an application on Aminet or similar which does this? It would be useful for me for using GFABasic on my emulated 32-bit OS3.9 machine.
BastyCDGS is offline  
Old 30 May 2021, 15:14   #13
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 1,490
No, but there is example code on Aminet how to program the MMU, see MuManual.lha. The problem is not so much reprogrammig the MMU. The problem is that if you have 32bit Mem in your system, many Os data structures are beyond the 24-bit boundary. If you would just reprogram the MMU, you wouldn't be able to reach these structures anymore, so you cannot do this at run time. You would have to do that very early during the bootstrap process, and that is the hairy part.

Anyhow. If your target is GFABasic, then the good news is that GFABasic is 32-bit clean, so there are no such problems that would require MMU tricks. The bad news is that GFABasic has a lot of *other* problems all around, such as self-modifying code, and other bad programming practise. I recall that it used the screen buffer as temporary storage for its "PRINT USING" statement, just to name one. You should be able to get GFABasic into a "somewhat working" stage with your average degrader tools - but hands off this software in general.

Back then, I wasted a lot of time writing letters of bug reports to GFA, most of them remained unaddressed. On the bright side, I have now a huge collection of GFABasic disk versions. One buggier than the other...
Thomas Richter is offline  
Old 30 May 2021, 16:09   #14
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,209
Quote:
Originally Posted by BastyCDGS View Post
Is there an application on Aminet or similar which does this? It would be useful for me for using GFABasic on my emulated 32-bit OS3.9 machine.
I think SetCPU can be used for that. Just make sure your system does not have any RAM outside the lowest 16MB address space.
mark_k is offline  
Old 30 May 2021, 18:05   #15
BastyCDGS
Registered User
 
Join Date: Nov 2015
Location: Freiburg / Germany
Age: 41
Posts: 172
Send a message via ICQ to BastyCDGS
Thank you very much for your reply, Thomas!

Quote:
Originally Posted by Thomas Richter View Post
No, but there is example code on Aminet how to program the MMU, see MuManual.lha. The problem is not so much reprogrammig the MMU. The problem is that if you have 32bit Mem in your system, many Os data structures are beyond the 24-bit boundary. If you would just reprogram the MMU, you wouldn't be able to reach these structures anymore, so you cannot do this at run time. You would have to do that very early during the bootstrap process, and that is the hairy part.
Idea: ColdCapture vector which gives 24-bit (Zorro II) fast mem highest priority. Basically 24BitFastMemFirst. Does this put everything in 24-bit range?

Quote:
Anyhow. If your target is GFABasic, then the good news is that GFABasic is 32-bit clean, so there are no such problems that would require MMU tricks.
It has been quite a long time when I ran MonAm on GFABasic, but if my memory does not fail on that, it clearly uses upper 8 bits of pointers for data, so there is a problem with 32-bit memory. I also vaguely remember trying 68EC020 vs. 68020 in WinUAE: First works, second crashes GFA badly.

Maybe you are mixing this with compiled GFABasic programs, which indeed work fine with 32-bit memory (and OS3.9 BTW, if you take care of certain things)?

My current solution is using an 68EC020 with OS1.3 for developing with GFABasic. But that is quite slow, so I want to use JIT...

Quote:
The bad news is that GFABasic has a lot of *other* problems all around, such as self-modifying code, and other bad programming practise. I recall that it used the screen buffer as temporary storage for its "PRINT USING" statement, just to name one. You should be able to get GFABasic into a "somewhat working" stage with your average degrader tools - but hands off this software in general.
Yeah, there are some quirks I remember very clearly. One thing is that SETCOLOR i|,col& doesn't work correctly on OS3.0+, you have to use SETCOLOR i|,r|,g|,b| instead, otherwise you get wrong colors.
BastyCDGS is offline  
Old 30 May 2021, 18:53   #16
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 1,490
Quote:
Originally Posted by BastyCDGS View Post
Idea: ColdCapture vector which gives 24-bit (Zorro II) fast mem highest priority. Basically 24BitFastMemFirst. Does this put everything in 24-bit range?
Not necessarily. What board-specific logic does remains open. In worst case, you are left with chip mem only.



Quote:
Originally Posted by BastyCDGS View Post

Maybe you are mixing this with compiled GFABasic programs, which indeed work fine with 32-bit memory (and OS3.9 BTW, if you take care of certain things)?
No, certainly not. GFABasic is broken, but not in this regard. At least not the 3.5 release series. It still starts here, though it has other problems.
Thomas Richter is offline  
Old 06 June 2021, 17:15   #17
BastyCDGS
Registered User
 
Join Date: Nov 2015
Location: Freiburg / Germany
Age: 41
Posts: 172
Send a message via ICQ to BastyCDGS
Hi Thomas!

Quote:
No, certainly not. GFABasic is broken, but not in this regard. At least not the 3.5 release series. It still starts here, though it has other problems.
I just rechecked this with my OS1.3 config. My game written in GFABasic runs when using 68EC020, but as soon as I switch to 68020 (32-bit), it just hangs. Tried this multiple times.

How do you explain this if it is not an 32-bit issue?

EDIT: Is there a way to convert GFABasic listings to BlitzBasic or C?

BTW: I am using GFABasic 3.52D.

Last edited by BastyCDGS; 06 June 2021 at 17:35. Reason: Added converter question
BastyCDGS 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
Conversion of 24bit RGB Image to HAM6 DanScott Coders. Asm / Hardware 17 16 March 2020 15:13
IDE68K addressing Yulquen74 support.Hardware 3 16 May 2015 17:39
FS: CompServ Scandoubler II (v2.0) / 24bit AGA Flickerfixer card d0pefish MarketPlace 0 29 May 2012 12:16
HAM without 24bit screen killergorilla support.Apps 5 20 October 2006 22:55
Addressing modes BippyM Coders. General 17 03 February 2005 10:57

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 07:16.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Page generated in 0.09158 seconds with 15 queries