![]() |
![]() |
#1 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,410
|
68040 emulation using a 68020
Hi,
I have some 68040 code that I want to emulate using Musashi, and there are a lot of 040 specific / FPU instructions in it. I don't really care about speed, I can use a fast machine to run it, so I was wondering if some native 68020 code existed to emulate those FPU/040 instructions, maybe possibly an amiga program, and even better, some source. I guess the code would install itself on the ILLEGAL instruction vector (like MOVEP handler does on 68060 library) to manually decode 040 instructions and do something similar, slowly, but would work. I liked the musashi design. Simple to understand and documented for integration in another project, but if you know of a 68040/FPU emu that can be adapted to a project, even better (not WinUAE which is very good but emulation core is not designed to be re-used but maybe I'm mistaken...) thx |
![]() |
![]() |
#2 |
Registered User
Join Date: Dec 2014
Location: germany
Posts: 446
|
Hi,
there was Pseud040 for the Macintosh, which did exactly what you want, but (to my knowledge) the source was never released. Maybe you could contact the author and try to convince him to release the source? |
![]() |
![]() |
#3 | |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,375
|
Quote:
![]() (there is a specific emu vector for this) Aside of the FPU there isn't much 040 specific stuff (move16, cpush, cinv). AFAIK everything 040-only goes to line-F, fpu or not. I guess i could do the non-fpu stuff quite easily if i knew exactly what to do. I remember having tried an FPU emulator for Mac under Shapeshifter but i couldn't make it work (at least not for Amiga apps). No source for it of course. I may be interested in fpu emulation as well, but so far all my researching on the matter remained fruitless. |
|
![]() |
![]() |
#4 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,410
|
you're right, it would be exactly what I need. I could also use some native C source too. I'm not making it run on a real 68020. If FPU 040 instructions were emulated by C code it would be just fine!
|
![]() |
![]() |
#5 |
Registered User
Join Date: Jun 2010
Location: PL?
Posts: 2,909
|
perhaps? http://aranym.sourceforge.net/
|
![]() |
![]() |
#6 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,410
|
Maybe. Basilik looks better to me. I think the author wrote Shapeshifter at the time, and he explains how his emulator works in a nice document. I think I'll settle for that. Thanks.
BTW I found this opcode: 50fa 00a2 => traptw #162 (HRTMon sees TRAPT.W) Never heard about this trap instruction. I only knew TRAP, TRAPcc, did not find it in the ref manuals... anyone? |
![]() |
![]() |
#7 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
It's just TRAPcc with a condition of True.
|
![]() |
![]() |
#8 |
Banned
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
|
It looks to me like a TRAPcc.W with cc=True. ADIS, D68k and IRA all decode it as "TRAPT #$a2" for 68020. The 68000PRM encoding documentation is incorrect for TRAPcc which may have resulted in your confusion. There are several incorrect encodings documented in the 68000PRM but most are FPU instruction encodings.
Last edited by matthey; 12 April 2016 at 01:11. Reason: Leffmann was quicker ;). |
![]() |
![]() |
#9 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Did you get the DLL for Musashi to work that I attached in the other thread? If it didn't work then you must probably build it yourself on the computer you intend to use it on, but I can write it all up if you don't mind installing Visual C++ and a bunch of other tools.
|
![]() |
![]() |
#10 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,410
|
Thanks leffman but musashi wont do me any good for this coee which heavily uses 68040 fpu. The most affordable seems to be Basilik, and there is even some documentation on how to use uae cpu core.
|
![]() |
![]() |
#11 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,410
|
Hi,
I butchered Basilik sources and got a bare 040+FPU emulation (not tested yet, but will do) I have one question: when CPU encounters a TRAPTW (or TRAPEQW, or any W-type TRAP) what vector is called? (not the conventional $80->$BC TRAP vectors for sure) thanks |
![]() |
![]() |
#12 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
It should be vector 7.
|
![]() |
![]() |
#13 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,410
|
it is!! VBR+$1C is the offset. Thanks.
So how to make the difference between, say TRAPV and TRAPT.W ? Do I have to read the stack and check for the instruction that triggered the trap? There should be some info better than that in the stackframe right? |
![]() |
![]() |
#14 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,375
|
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
UAE4All 68020-emulation fix | john4p | support.OtherUAE | 16 | 17 January 2014 08:18 |
68020 33 MHz | Leandro Jardim | support.WinUAE | 2 | 02 January 2012 19:21 |
Questions about 68020 CE | Maren | support.WinUAE | 11 | 09 December 2009 21:01 |
68020 and cycle-exact | FOL | support.WinUAE | 4 | 23 July 2007 22:10 |
Barfly misidentifies 68020 under emulation | DJ Mike | support.WinUAE | 10 | 02 March 2007 06:08 |
|
|