Welcome, Guest. Please login or register.

Author Topic: Writing a new Amiga emulator... well, sort of.  (Read 2156 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline skurkTopic starter

  • Hero Member
  • *****
  • Join Date: Dec 2006
  • Posts: 929
    • Show only replies by skurk
Writing a new Amiga emulator... well, sort of.
« on: July 30, 2008, 01:19:15 PM »
I had this idea a few years ago, but never really had the time to do anything with it.  I barely started writing it, and I thougth I'd check with you guys to see if I'm walking a dead end road or not.

I'm thinking of writing a new Amiga emulator from scratch.

Ok, now, before you all start screaming at me, hear me out. This MIGHT just be something cool.

The idea is to write an Amiga "GUI emulator" that works with 100% system friendly applications only: it executes 68k instructions and translates all library calls to something similar on your current system.

For example, if a call is made to _LVOOpenWindow(), it actually opens a REAL window on your OS.  Applications will appear to be native, and not run inside some emulator window.

So far I figured C++/Qt might be a good combination for this.  Portability is important.

I've written the base and I'm currently able to run some simple DOS programs, like C:Avail.  As soon as I get my head around how ReadArgs work, I'll be able to take it one step further.

So, does this sound plausible?  Maybe I'm unable to see some major show stoppers ahead...?  If others want to help, I can create an SVN repository for it.
Code 6502 asm or... DIE!!

[C64, C128, A500, A600, A1200, A3000, MBP+Mini, Efika/MOS2.1, Sam440 w/AOS4.1
 

Offline DBAlex

  • Sr. Member
  • ****
  • Join Date: Aug 2005
  • Posts: 304
    • Show only replies by DBAlex
Re: Writing a new Amiga emulator... well, sort of.
« Reply #1 on: July 30, 2008, 01:32:31 PM »
Sounds cool...

 :-D

Maybe if you can do things like this you could work on getting 68K support for AROS... thats a big ask though.

 :-)
Machines:
- A1200, Blizzard 1260 w/ 64MB RAM, 1.2GB HD, PCMCIA WiFi, AGA w/ RGB Adapter, OS3.9
- Pegasos I, G3 600Mhz, 512MB, Radeon 9200se, 80GB HD, AmigaKit WiFi Card, MOS 1.4.5
- Mac Mini, G4 1.5ghz, 512MB (1GB Soon), Radeon 9200 64MB, 80GB HD, OSX 10.5 (Leopard)
- PCs, Laptops... *yawn*... :D
 

Offline Crumb

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 1786
  • Country: 00
    • Show only replies by Crumb
    • http://cuaz.sourceforge.net
Re: Writing a new Amiga emulator... well, sort of.
« Reply #2 on: July 30, 2008, 01:33:34 PM »
Perhaps you could take a look at AROS. They had a layers.library that used X11 years ago.
The only spanish amiga news web page/club: Club de Usuarios de Amiga de Zaragoza (CUAZ)
 

Offline tonyyeb

  • Hero Member
  • *****
  • Join Date: May 2007
  • Posts: 568
    • Show only replies by tonyyeb
Re: Writing a new Amiga emulator... well, sort of.
« Reply #3 on: July 30, 2008, 01:34:41 PM »
Sounds like a nice idea. A bit like Wine?

It would be better if this sort thing was in AROS appearing to run 68k apps natively.
Chris (aka tonyyeb)
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: Writing a new Amiga emulator... well, sort of.
« Reply #4 on: July 30, 2008, 01:52:56 PM »
@skurk
Quote
Maybe I'm unable to see some major show stoppers ahead...?

There will be problems with anything that peeks and pokes the window and screen structure (which is perfectly legal in most cases). Also, on amiga the windows are rendered to the screen bitmap, if you detach the window from the screen (that will certainly happen here), problems will arise.

The interaction between the emulated and native UI will be tricky to get right.

The same problems arise for anything that has the structures exposed to the application programmer: Any changes on the native side must be relayed to the structure, and any (legal) change to the structure inside the emulation must reflected to the native resource. You will have headaches here.

It might work with some simple apps however.
 

Offline skurkTopic starter

  • Hero Member
  • *****
  • Join Date: Dec 2006
  • Posts: 929
    • Show only replies by skurk
Re: Writing a new Amiga emulator... well, sort of.
« Reply #5 on: July 30, 2008, 01:57:24 PM »
Quote

tonyyeb wrote:
Sounds like a nice idea. A bit like Wine?


Yes, it'll be exactly like Wine :-)

Quote
It would be better if this sort thing was in AROS appearing to run 68k apps natively.


I thought AROS was able to run system-friendly 68k apps already?  (Or am I confusing AROS with MorphOS now?)
Code 6502 asm or... DIE!!

[C64, C128, A500, A600, A1200, A3000, MBP+Mini, Efika/MOS2.1, Sam440 w/AOS4.1
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: Writing a new Amiga emulator... well, sort of.
« Reply #6 on: July 30, 2008, 01:59:57 PM »
@skurk
Quote
Yes, it'll be exactly like Wine

Except that Wine doesn't emulate the CPU, but oh well... :-)

Quote
I thought AROS was able to run system-friendly 68k apps already? (Or am I confusing AROS with MorphOS now?)

It isn't. You are.
 

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: Writing a new Amiga emulator... well, sort of.
« Reply #7 on: July 30, 2008, 02:05:37 PM »
@skurk

AROS Hosted on 68k-Linux would do what you want... though without the CPU emulation...

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: Writing a new Amiga emulator... well, sort of.
« Reply #8 on: July 30, 2008, 02:07:02 PM »
@bloodline
Quote
AROS Hosted on 68k-Linux would do what you want... though without the CPU emulation...

Would it? As far as I know AROS is not binary compatible, even on m68k.
 

Offline skurkTopic starter

  • Hero Member
  • *****
  • Join Date: Dec 2006
  • Posts: 929
    • Show only replies by skurk
Re: Writing a new Amiga emulator... well, sort of.
« Reply #9 on: July 30, 2008, 02:14:43 PM »
Quote

Piru wrote:
@skurk
Quote
Yes, it'll be exactly like Wine

Except that Wine doesn't emulate the CPU, but oh well... :-)

..and it's not emulating Windows either, but you get my point. :)
Code 6502 asm or... DIE!!

[C64, C128, A500, A600, A1200, A3000, MBP+Mini, Efika/MOS2.1, Sam440 w/AOS4.1
 

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: Writing a new Amiga emulator... well, sort of.
« Reply #10 on: July 30, 2008, 02:46:00 PM »
Quote

Piru wrote:
@bloodline
Quote
AROS Hosted on 68k-Linux would do what you want... though without the CPU emulation...

Would it? As far as I know AROS is not binary compatible, even on m68k.


It is "supposed" to be binary compatible on a 68k... Incompatibilty on the 68k is considered a bug.

  • Guest
Re: Writing a new Amiga emulator... well, sort of.
« Reply #11 on: July 30, 2008, 04:18:47 PM »
This sounds like a really cool project. It's the sort of idea that can be implemented incrementally - slow and steady wins the race and all... :)

Are you planning to make the software open source?
 

Offline Hans_

Re: Writing a new Amiga emulator... well, sort of.
« Reply #12 on: July 30, 2008, 05:48:51 PM »
@skurk

Piru has already gone through the issues. The direct access to structures is going to be a pain because you'll somehow have to synchronize these structures with the OS' own structures.

BTW, I wouldn't call it an emulator; it's really an implementation of the Amiga OS API on another system. The Wine project is called a "compatibility layer," and "an Open Source implementation of the Windows API on top of X, OpenGL, and Unix."

Hans
http://hdrlab.org.nz/ - Amiga OS 4 projects, programming articles and more. Home of the RadeonHD driver for Amiga OS 4.x project.
 

Offline skurkTopic starter

  • Hero Member
  • *****
  • Join Date: Dec 2006
  • Posts: 929
    • Show only replies by skurk
Re: Writing a new Amiga emulator... well, sort of.
« Reply #13 on: July 30, 2008, 07:32:50 PM »
Quote

Hans_ wrote:
BTW, I wouldn't call it an emulator; it's really an implementation of the Amiga OS API on another system.


Well, it's somewhere in the middle.  The CPU is emulated, so it's not exactly like Wine.  And since "Wine Is Not an Emulator", I don't know where I'm going with this.

Anyway.

It's a cool project to play with.  It's really easy to get carried away with.. :)  And since I don't have much spare time, then yeah - it will be open source and open for other contributors.  If that is of interest to anyone.
Code 6502 asm or... DIE!!

[C64, C128, A500, A600, A1200, A3000, MBP+Mini, Efika/MOS2.1, Sam440 w/AOS4.1
 

Offline jupo42

  • Newbie
  • *
  • Join Date: Nov 2005
  • Posts: 42
    • Show only replies by jupo42
    • http://jupo42.livejournal.com
Re: Writing a new Amiga emulator... well, sort of.
« Reply #14 on: July 30, 2008, 08:44:16 PM »
I don't really know anything at all when it comes to this, but shouldn't it be easier to do this as a P96 driver, that could then be loaded into the likes of UAE? Seems like it would make more sense than rewriting emulation from scratch - you already have the emulator, and you already have RTG hardware abstraction, and there's a fallback to the regular UAE window for apps that aren't RTG friendly.
A3000 - 030/25, Toaster, ??? - rebuild in process
2x A2000 being cannibalized and rebuilt
A1000 - Rejuvinator, AGA2000, AdSPEED/IDE, 4GB CF HD, 1MB chip, 0.5MB fast, OS3.1