Purpose of this thread is to summarise the findings about the possibility to use the FellowCPU as a second (user-selectable) CPU core in vAmiga.
To estimate the level of difficulty, I did some preliminary experiments: I extracted the CPU related files files from the WinFellow source code and compiled them stand-alone in Xcode.
The following changes had to be applied to make the OS X C++ compiler and Xcode happy:
Map windows related types to standard types from stdint.h. 鈥‥.g., replace
typedef unsigned FELLOW_LONG_LONG ULL;
by
typedef uint64_t ULL;
Use const char * instead of char * for all character strings.
The outcome of this experiment was quite promising. After applying the changes, I was able to compile it in Xcode without issues. To link the code, the following stubs had to be implemented:
ULO busGetCycle(void);
void call_calltrap(int func);
ULO memoryInitialPC(void);
ULO memoryInitialSP(void);
UBY memoryReadByte(ULO address);
UWO memoryReadWord(ULO address);
ULO memoryReadLong(ULO address);
void memoryWriteByte(UBY data, ULO address);
void memoryWriteWord(UWO data, ULO address);
void memoryWriteLong(ULO data, ULO address);
UWO memoryChipReadWord(ULO address);
void memoryChipWriteWord(UWO data, ULO address);
void fellowSoftReset(void);
void interruptRaisePending(void);
Interestingly, Fellow has these two functions:
ULO memoryInitialPC(void);
ULO memoryInitialSP(void);
I added exactly those functions to Musashi to make it play nice with vAmiga (with different names though).
Furthermore, these three variables need to be defined as they are used by the FellowCPU to log information.
ULO memory_fault_address;
BOOLE memory_fault_read;
bus_event cpuEvent;
A simple execution loop can be implemented like this:
{
cpuStartup();
cpuSetModel(0, 0);
cpuSetRaiseInterrupt(FALSE);
cpuInitializeFromNewPC(42);
for (int i = 0; i < 10; i++) {
unsigned int cycles = cpuExecuteInstruction();
printf("PC = %x cycles = %d\n", cpuGetPC(), cycles);
}
}
Bottom line: Integrating the FellowCPU in vAmiga should be possible with reasonable effort.
License is not a show stopper: All used files are released under the GNU license.
Winfellow 0.58 has the emulation from 68000 to 68030; it could be very usefull import all CPUs from there.
I didn't know the WinFellow on github.
It could be a great idea, if possible, to select the other 680x0, on my 2000 I had the 68010 pin compatible...
I didn't know the WinFellow on github.
Yes, Petter Schau's repo is the direct source.
It could be a great idea, if possible, to select the other 680x0,
First step will be to offer a popup button "CPU model:" in the hardware prefs with options:
My hope is that this will bring subtle issues like IRQ acknowledgment bugs etc. to the surface. As a welcome side effect, it enables direct speed comparisons between different CPU cores. I am curious myself how fast Musashi is compared to the other cores.
INFO: ... some hours ago there has been merged a massive pullrequest into the MushashiCPU
/kstenerud/Musashi#35
as far as I understood ... code changes seem to come mainly from the mame project which also uses the Mushashi but slightly modified ...
massive pullrequest into the MushashiCPU
That's great news, I love this CPU core 馃グ!
In the past couple of month, I always wanted to check what the Mame config flag is doing, but I never felt to have time to do so. Hence, I only know that there is some special Mame mode that can be enabled in the Musashi config file, but I still don't know what it is actually doing.
There is so much work to do, I did not even had time to improve my combat heli skills 馃槙.
BTW, somebody recently pointed me to this great project:
To be honest, I did not hear about this project before. It sounds really cool, although I am a little bit skeptical how compatible the FGPA based emulation is with respect to the C64 mode.
The problem: When I browsed their website, I started to strongly disliked my own (VirtualC64) site. So after successfully repairing my bathroom door (piece of cake with this specially curved screw driver 馃槑 which unfortunately costs a ton of money 馃槚), I had to revamp my web page. At the end, it was easier than I thought, because there are many free CSS templates out there that can be used as a starting point.
After two days of work with HTML and CSS, I can confirm that I'm happy not to be a web developer. On the positive side, I have learned a lot about the Bootstrap framework which is really kind of cool.
The result is quite neat I think:
http://www.dirkwhoffmann.de/software/index.html
Please let me know if somebody finds a broken link or so. Spelling corrections are always welcome, too.
I am impressed. No missing links spotted on your updated website. 馃憤馃徎
I clicked them all. 馃槍
Will integrate portable68000 CPU instead.