Welcome, Guest. Please login or register.

Author Topic: New type of Amiga Emulator for macOS  (Read 4925 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
New type of Amiga Emulator for macOS
« on: February 23, 2017, 07:30:13 PM »
As promised here is an early alpha of my new amiga emulator.
For those of you who have used my ADFBench, you will be aware that I set about trying to get my ADF browser to actually run the amiga executables it can read on ADF files.

Well, after quite a bit of effort, I have a working alpha of the emulation engine running.

I decided to build this separately from ADFBench for now, so I can et it working properly before I reintegrate back in.

Working so far:
Exec can schedule tasks and task swap.
Allocate RAM/Free RAM.  
Allows task to send and receive signals, but the message passing system is not really working yet.
The minimal DOS library currently just access the Mac file system, and is only able to loadSeg executables into memory, and then CreateProc them into the multitasking system.

Other libraries are just Stubbs right now, which do little except report which function has been called.

The emulator allocates 16Meg of ram, of which the lower 2Mb is treated as Chip Ram, and the next 8Meg is treated as Fast Ram. The rest of the ram isn't available to my exec emulation and currently does nothing.

It doesn't really do much at the moment, so I've included a 68000 disassembler, so you can watch the instructions execute. So why not point it at an Amiga executable and see what it does :)
 
Also it has a stupid name. :laugh1:

https://drive.google.com/open?id=0B3CMG5yqFK4jeVN2WHdXcHJtWlU

Offline HaukeVB

  • Newbie
  • *
  • Join Date: Feb 2016
  • Posts: 24
    • Show only replies by HaukeVB
Re: New type of Amiga Emulator for macOS
« Reply #1 on: February 24, 2017, 01:47:39 PM »
Cool, will try asap... :)
| A1500, 2630, Merlin, XCalibur, Nexus, Emplant, 2320...
 

Offline apsturk

  • Full Member
  • ***
  • Join Date: Jan 2014
  • Posts: 221
    • Show only replies by apsturk
    • http://amigaonthelake.com
Re: New type of Amiga Emulator for macOS
« Reply #2 on: February 24, 2017, 09:29:10 PM »
@bloodline

Wow great work!!! good job. I am constantly amazed by the inventive ways people come up with cool stuff!!!!!
AmigaOnTheLake.com
AmigaOne X1000 | OS4.1FE | Radeon R9 280X | 480Gb SSD | 4Gb | 27 ViewSonic VP2770|
Amiga 500 | CPU 68010| Megachip 2 meg | Kickstart 3.1 | GVP 500HD+8 ROM 4.15 8 meg fast ram | ECS Indevision | SCSI2SD 4gig | BetterWB 4.0 | CD - Zip drives and Plipbox.
Amiga 1200 | Indivision 1200 AGA MK2cr | CF 4gig | ACA 1233 55.55mhz | OS3.9 | FastATA 1200 MK-V | Rapid Road
2 MorphOS Paid for copies. Running on Mac Mini 1.5Ghz
 

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: New type of Amiga Emulator for macOS
« Reply #3 on: February 26, 2017, 10:09:34 AM »
Cheers guys.

As explained, I am trying a different approach to Amiga Emulation.

Instead of simply emulating the whole Amiga architecture, I trap application calls to Exec, Dos (and other hardware hitting libraries, devices, and resources) then handling them with the host operating system. Essentially how Wine works when running Windows

This approach is hampered by four things:

1. The 68k CPU, not to much of a problem, but obviously requires an emulator (which reduces the performance).

2. The endian problem... all data structures on the Amiga are big endian, so all multibyte memory access needs to be byte swapped when the host operating needs to manipulate them. I solved this by building a set of classes which map over the Amiga operating system data structures and handle the endian issues.

3. The address space... this is something which I didn't originally think about, but the Host Operating system uses a 64bit address space, and Amiga Apps are stuck in a 32bit space. This is the biggest issue as it means all memory access must be mapped... I had originally hoped to let the 68k have full access to the memory, but instead I have to limit it to a 4gig single allocation.

4. The Amiga hardware, many Amiga programs assume the custom chips will be present. I have reserved the Amiga chipset address space in the emulator's memory so I can emulate any required hardware.

Offline apsturk

  • Full Member
  • ***
  • Join Date: Jan 2014
  • Posts: 221
    • Show only replies by apsturk
    • http://amigaonthelake.com
Re: New type of Amiga Emulator for macOS
« Reply #4 on: February 26, 2017, 12:54:44 PM »
I applaud your work. I think this is a very interesting way to come at the problem. Keep up the good work and let me know if there is anything the Amiga On The Lake to do for you.
AmigaOnTheLake.com
AmigaOne X1000 | OS4.1FE | Radeon R9 280X | 480Gb SSD | 4Gb | 27 ViewSonic VP2770|
Amiga 500 | CPU 68010| Megachip 2 meg | Kickstart 3.1 | GVP 500HD+8 ROM 4.15 8 meg fast ram | ECS Indevision | SCSI2SD 4gig | BetterWB 4.0 | CD - Zip drives and Plipbox.
Amiga 1200 | Indivision 1200 AGA MK2cr | CF 4gig | ACA 1233 55.55mhz | OS3.9 | FastATA 1200 MK-V | Rapid Road
2 MorphOS Paid for copies. Running on Mac Mini 1.5Ghz
 

Offline kamelito

Re: New type of Amiga Emulator for macOS
« Reply #5 on: February 26, 2017, 03:58:29 PM »
@Bloodline
Do%&$#?@!you plan to make it cycle exact?
Any plan for PowerPC support?

Nice project.
Kamelito
 

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: New type of Amiga Emulator for macOS
« Reply #6 on: February 26, 2017, 05:22:35 PM »
Quote from: kamelito;822757
@Bloodline
Do%&$#?@!you plan to make it cycle exact?
Any plan for PowerPC support?

Nice project.
Kamelito
Since I intend for this to be like Wine, where Amiga apps will essentially run like native apps (this is really for applications, rather than games) cycle exact emulation isn't necessary... that said, I have make sure chipset emulation could be added easily, the 68k is free running so it can be locked to any timing required.

As for PPC support... that would be difficult, since I would have support all the different AmigaPPC ABI/API (PowerUP, WarpOS, AOS4 and MOS)... I will be putting this on GitHub within the week so someone can help me out :)

Offline Romanujan

  • Newbie
  • *
  • Join Date: Aug 2010
  • Posts: 37
    • Show only replies by Romanujan
Re: New type of Amiga Emulator for macOS
« Reply #7 on: February 26, 2017, 07:29:23 PM »
Quote from: bloodline;822754
Instead of simply emulating the whole Amiga architecture, I trap application calls to Exec, Dos (and other hardware hitting libraries, devices, and resources) then handling them with the host operating system.

What is the difference between your approach and the one VAMOS uses?
 

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: New type of Amiga Emulator for macOS
« Reply #8 on: February 26, 2017, 10:23:31 PM »
Quote from: Romanujan;822762
What is the difference between your approach and the one VAMOS uses?

The concept is very similar to VAMOS, and I have used Chris's "reset instruction" callback trick to trap application calls to exec style libraries. The difference is that I have used C (well this first version uses obj-c) so it should be much faster and portable than VAMOS, secondly I have focused on creating a working exec.library (with message passing and multitasking) so while VAMOS is great for running CLI applications, I want to get intuition (workbench launched) apps working... as a side effect CLI apps should work fine too, though I need to get my console working better.

Offline nicholas

Re: New type of Amiga Emulator for macOS
« Reply #9 on: December 09, 2017, 04:53:12 PM »
I'm all Hackintoshed with an i7-7700K now Matt, I see the last commit was in March.  Did you hit a roadblock?
“Een rezhim-i eshghalgar-i Quds bayad az sahneh-i ruzgar mahv shaved.” - Imam Ayatollah Sayyed  Ruhollah Khomeini