[comp.sys.atari.st] The New 8-Bit Emulator

johnson%msuhep.hepnet@LBL.ARPA.UUCP (03/20/87)

Howdy Netland!! I have heard very little about the NEW 8-BIT
Emulator and thought I would give an update on its current status.

	For those of you who are not familiar with the Beta version that
has been out for awhile it may be because it was _OFFICIALLY_ ordered
out of distribution by Atari corp. {Question to Alex, why did you 
wait until last week to even call the author, when Atari made this
declaration at least a month ago?????}

	The emulator does a real good job of emulating 8-bit software
and should be in distribution again soon.  You see there was a 
reason Atari ordered this yanked; it used Atari OS images....
yes, this is illegal. Darek's (the person who did the programing)
newest version, being completed this weekend, will come up and 
ask you if you want to be an 8-bit atari or an apple II today!
Although I understand both the Apple II and the Atari emulators
run at about a quarter of the speed on their respective machines,
they are pretty impressive.  The Atari emulator, for instance, 
emulates almost everything but player missle graphics!!
{I should be recieving a test copy next week and I will inform you
of what progress he has made.}

	The purpose of my posting this is to a) inform the info-atari
readers of this new piece of software and to b) bring up the poor
attitude of Atari.  Both of these topics are covered in much 
greater detail in the following articles.  The first is by Darek
Mihocka, the author, and the second is by John Nagy, sysop and Vice
President of C.H.A.O.S. users group in Lansing, Mi.  
Responses from Atari are welcomed (have you recieved your copy yet
Alex?? <grin>)

Good reading, John Johnson- ST Interest Group President, C.H.A.O.S.
--------------------------

(reprinted from ZMAG)
Current information about the ST 
Transformer as of 03/09/87

By Darek Mihocka (CIS 73657,2714)
Programmed by Darek Mihocka
additional programming and all night
testing by Ignac Kolenko hardware
supplied by:

Xanth Computer Systems
600 First Avenue
Seattle, Washington

The purpose of this document about
the ST Transformer is: - to explain
its purpose and give a history of its
development - to give the latest 
information about the ST Transformer 
- to discuss the legal problems with 
this program and why I can't release 
it to the public for all former Atari
400/800 owners - to find other 
programmers to work on this project.

For those of you unfamiliar with the
name, you have seen it as the Atari
800 Emulator Demo or the Apple ][
Emulator.

Part 1:The history

When Atari introduced the ST
computers, I was then the owner of 
an Atari 400, bought way back in 1981
with all my summer's earnings. Like
many other people I spent a
considerable amount of money on my 
system for software and disk drives.
About the only piece of hardware that
I could use on the ST was my FX80
printer. This is not too useful as
none of the software works. So I held
off buying an ST for over a year as I
waited for Atari to introduce some
kind of a device or program to allow
me to run old software. They never
did. I finally sold the 400 and
bought the ST anyway because after
using 68000 based in machines at my
university, I was impressed by its
power and already had a program in
mind.

The implementation:
The first project I decided to work
on was to somehow run the old
software so that all that money
didn't all go to waste. I considered
2 approaches:

 - the first approach is to write a
   program that reads a binary file
   from a 400/800 and convert each
   machine language instruction into
   a 68000 instruction. This would
   then create a file on the ST that
   would run about 10 times the speed
   of the original file!

Problems:
 - how do you tell the difference
   between code and data?
 - how to handle self modifying code?
 - how to handle the  hardware
   registers?

 - the second approach is to write an
   interpreter, similar to the way
   BASIC interprets a tokenized
   program, or the way that a real
   microprocessor executes code. You
   read in a byte of memory,
   determine which 6502 instruction
   it is, and execute it. The real
   6502 executes microcode. I would
   use 68000 instructions.

Problems:
 - the overhead of processing each 
   instruction is greater than the
   time it takes to actually execute
   it.

 - how to handle hardware registers?

I chose the second approach because
it solves the first two problems of
the first approach, and shares the
third problem. The problem of speed
is also in both approaches. Software
running at ten times the speed is
usually unusable. This is similar to
the problem when some IBM PC software
is run on an AT or even worse, a
Compaq 386 (18 times faster). It is
always possible to use software
running slower. The unknown is how
slow the software would run. The
hardware problem can be solved by a
similar interpreter which checks
which register is being accessed and
does something accordingly.

First results:

The first version of the 6502
interpreter was written in Megamax C
in August. As it turned out, the
unknown speed was about 7% of the
speed of a real 6502. This does not
include the extra interpretation of
hardware. It was obvious that hand
coded 68000 code was needed. About a
month later, I had the hand coded
version sort of working at about 30%
of the speed. To make the hardware 
interpreter would be difficult, 
because of the dozens of hardware 
locations in a 400/800. I chose then 
to first do an Apple ][ hardware 
emulator, because there are only 2 
vital locations needed to get it to 
work: the keyboard and the screen.
The next month was spent debugging
the many bugs that crept into the
6502 interpreter and porting software
from . Finally it worked, at about
25% of the speed. 

This is the version that you have 
seen as the Apple ][ emulator.

First Problems:

One problem with all emulators is
inherent in their design: to emulate
the software of another machine, you
must transfer that software. When I
approached Apple about this, they
told me that what I am doing is
illegal, since I copied the ROMs of
Ignac's no name ][ clone, which had
ROMs probably derived from an Apple.
I approached Apple Canada about
getting the real ROMs from them, plus
the code for Apple DOS, and anything
else they'd want to let me try. As it
turned out, they saw my project as
software piracy and told me to forget
it. I guess they didn't want to
expand to the ST market anyway. After
the Apple told me they weren't
interested, I decided to stop
spending more time on Apple
emulation. I ported over my copy of
the Translator disk's image of the
Revision B ROMs. I chose those ROMs
because they are made to run with 64K
of RAM, which is what the 6502
interpreter sees when it is
executing. I also ported a copy of 
Atari Basic to use as a test file. 
After only a few days of hacking the 
Apple ][ routines, I got a very 
primitive version of the Atari 
emulator working. It only supported 
a few graphics modes and still had a 
major 6502 bug, but it sort of
worked. I uploaded it to my BBS and 
to Atari's BBS as the Atari 800 
Emulator Demo.

Part 2: the Atari 800 emulator

What happened then was a big shock.
I got a phone call from one of the
Atari BBS sysops telling me that
Atari was not pleased with what I had
done. They too considered my program
as piracy. I was told that I would be
contacted within a few days to
discuss the emulator. No one ever 
called back, and I have never been 
able to get through to anyone that 
would discuss it with me. The 
secretaries usually screwed me around
on the phone. Attempts to reach
someone willing to talk on Compuserve
also failed.

What I currently have is a program
that appears to execute 6502 code 
according to the 6502 specs at about 
20% of the speed. This includes the 
overhead of the hardware interpreter.
The hardware supported so far
includes:

 - graphics modes 0,1,2,3,6,6+,7,7+,
   and 8
 - most display lists, no matter how 
   complex
 - most keyboard keys, including
   START, SELECT, OPTION, RESET,
   caps, inverse, and BREAK.
 - the color registers, and a few
   other miscellaneous locations
 - most read and write DOS operations
 - 1 joystick port
 - printer output - 

Runs most BASIC software I've 
downloaded from BBSs and tested.

Not supported yet:

 - GTIA modes
 - player missle graphics
 - sound registers
 - a combination of the two mentioned
   approaches, where parts of the 
   operation system are hand coded to
   68000 code and executed directly, 
   not interpreted. This is already 
   done for the D: and P: drivers,
   but I plan to eventually do the
   whole operating system which would
   result in a significant speed
   increase.

Part 3: Legal Problems

According to Apple and Atari, it is
illegal for me to distribute the
emulator any more because I had
included the ROMs with the demos.
That is the reason I have not
released anything in over 2 months.
I respect their legal right, but I
also believe that Atari has an
obligation to all the tens of
thousands of 8 bit owners who helped 
build the Atari empire. The only 
people who can make a perfectly legal
emulator are Atari themselves. I have
spent about 500 hours of my time
planning, programming, and testing my
program. This may seem like a lot,
but it works out to about 10 weeks of
full time work, or about 2 to 3 weeks
work for a team of Microsoft caliber 
programmers, which I assume Atari
has. With their technical knowledge 
of both the 8 bit and the ST
computers, I don't see why Atari 
couldn't have released an fully 
implemented emulator 18 months ago. 
They were quick to introduce the CP/M
emulator. I've compared the code of
my program and theirs, and it is
quite similar. So they are half done
already. Until they do, I will keep
working on my program until it is
functional enough to run most
software that can be downloaded. Once
released, it will be up the
individual used to copy their ROMs
over to the ST. Atari says that's
illegal. For as long as the people do
it for their own use, I do not see
this as being illegal. I do not have
access to high priced lawyers, so I
am hoping that Atari will finally
talk to me and come to an agreement
that will benefit us all.

Part 4: Programmers Wanted

Most of the emulator is written in
68000 code, with C code handling the
less critical routines. It has been 
suggested that I write my program 
for the Amiga, because its superior 
graphics would make it easier to 
implement player missle graphics and 
the other features. Since I have 
never programmed the Amiga, I cannot 
make the Amiga version. What I would 
also like to do is write hardware 
emulators for other computers, like 
the Commodore 64, VIC 20, Color 
Computer, Sinclair, etc. Anyone 
proficient in 68000 programming that 
would be interested in writing those 
modules starting sometime next fall 
or winter should contact me.

Until then, keep an eye out on your
local BBS for the ST Transformer
which I hope to have released in
June. I will update the situation on
the board I hang out on, Megabaud 
416-243-9519. Anyone having any 
suggestions on the program or who 
can help me with the legal questions 
can reach me on Compuserve or write 
to me before May 1 ,1987 at 5023 
148th Ave. N.E. #G207, Bellevue, 
Washington 

[ED.] In addition to this text sent
in by Darek. I would like to add that
I have spoken to this gentleman 
myself and feel that he is entitled
to some type of official response
from Atari Inc. In the weeks ahead
and until we feel that Atari is
looking into this matter, we will
update you on a weekly basis and
next week, we will supply you with
a few names and addresses to send
off letters to. If we can produce a
loud enough voice as 8 bit owners,
we can perhaps persuade Atari to
respond.

>> Note: Darek told John Nagy that Alex did FINALLY call
>> after what was rudely and inordinate ammount of time.
>> Alex informed him that Atari would have to do ALL distributing
>> of it.. I'll try to get him to mail me a reply to post next week.

----------Article 2----------------------------

Supplied by the CHAOS BBS-
Reprinted From MICHIGAN ATARI
MAGAZINE by permission.


THAT WAS THE ATARI EMULATOR THAT WAS
by JOHN NAGY (C.H.A.O.S.)

An "800" emulator for the ST is a
reality!  I have seen it and talked
to the author.  DAREK MIHOCKA of the
LONDON, ONTARIO area, has written and
distributed several levels of beta
test versions on BBS's.  He
originally planned to make a emulator
for just about all the 6502 machines,
but has since broken the emulations
into separate versions for the APPLE
][, the ATARI, and soon the COMMODORE
64.  (YIKE!).

The version I saw ran no graphics and
did not support DOS functions.  But
in a telephone interview on February
22, Darek, a 20 year old college
student at Waterloo University
outside Toronto, told me that he has
now developed the emulation to
produce all graphics modes, DOS
support, and even DISPLAY LISTS! 
Still to be developed are PLAYER
MISSLE GRAPHICS and SOUND. 
Additionally, there seems to be a
string-handling bug in the ATARI
8-bit BASIC emulation but Darek
expects to have that corrected
shortly.  Ultimately he plans to have
the emulation good enough to run
commercial heavy-graphics software.

At this point, the emulation runs
about 1/4 the speed of "normal" 8-bit
execution as the emulation is an
interpreter Plans for commercial
distribution (and in fact ANY
distribution) are now sketchy,
because of...  guess who?

ATARI CORP.  ...  who WON'T allow the
emulator to be distributed.  The
problem is that Darek's program uses
the ATARI (copyrighted) operating
system and ATARI BASIC.  ATARI says
this is PIRACY and has threatened
suit if the emulator gets out.  Real
user-friendly, this company!

Mihocka is trying to get around this
objection by devising a program that
will extract the required data out of
the user's own 8-bit ATARI machine,
port it to the ST, and integrate it
into his emulator...  but even this
may not be satisfactory to ATARI. 
"They tell me that it will encourage
piracy..." says Mihocka, who
contacted ATARI about his work when
XANTH (a Seattle area software
company-- remember BOINK?) expressed
commercial interest in the 8-bit
emulator.

All is not lost, perhaps.  Mihocka is
re-writing many routines into 68000
machine code (as he had to do for
printer support, as the ST does not
have the 8-bit type daisy-chain
cable).  If he is able to replace
enough routines, the speed of the
emulation will dramatically increase,
and the need for the ATARI ROM will
decrease.  Then, BIG JACK won't be
able to say much about the emulator.

We thought is was unfortunate (and
even ATARI seemed to agree) when
APPLE was unco-operative about ROMS
for the MAGIC-SAC MACINTOSH emulator.
 Now the shoe is on ATARI's own other
foot and they are being just as
difficult.  Lets hope this one can be
resolved above-board.  Write to Jack
Tramiel and tell him what you think
of his company's opposition to the
development of what many of us have
been waiting for- a way to avoid
losing all our hard-earned software
when we buy the ATARI ST.

Look for more on this story in future
issues of MICHIGAN ATARI MAGAZINE.



Supplied by the CHAOS BBS
(517) 371-1106
---------------------------end of articles.......

engst@batcomputer.UUCP (03/30/87)

Alright, I'm game.  Is it possible to program an Amiga emulator for the ST?
Wouldn't all the blitter routines give the ST major problems (until the
upgrade comes out)?  If it could be done, wouldn't that be amazing?  One the
of the main reasons I bought the ST was the number of emulators promised by
various sources.  I use IBM's and Mac working for Cornell Computer Services
(as a lowly student operator, though) and would really like to be able to do
all of my work on my ST, which is infinitely preferable to working in a
terminal room.  David Small has done extremely well with the Sac (although
only one person has replied to my plea for information about what runs and
what doesn't.  If anyone else sends me information I'll post a list to the
net for all to read and hopefully be impressed by.), but Atari has been
fairly unimpressive with their MS-DOS emulator, which I though would be out
sooner.  And now the possibility of the 8-bits and even maybe someday the
Amiga.  I am in awe!  Thanks to all those people who have worked on these
projects.
                                    Adam Engst

engst@batcomputer.tn.cornell.edu
pv9y@cornella.bitnet

cmcmanis@sun.UUCP (03/30/87)

In article <553@batcomputer.tn.cornell.edu>, (Adam C. Engst) writes:
> 
> Alright, I'm game.  Is it possible to program an Amiga emulator for the ST?
> Wouldn't all the blitter routines give the ST major problems (until the
> upgrade comes out)?  If it could be done, wouldn't that be amazing?  
>                                     Adam Engst

Actually for just the multitasking you could try to get MetaComCo to port
TriPOS to the ST. That is the "upper most" layer of AmigaDOS. You would also
need a small multitasking Exec to layer it onto, although I am pretty sure
that Tripos has one already. What would be really tough would be to emulate
Denise, Agnus, and Paula the custom chips. They provide most of the graphics
and sound capabilities and are the reason that the Screen can be jumping and 
the sound system humming, and you still have neary 100% of the 68000's attention.
So, like the player-missle graphics of the 800 this would be real tough.


-- 
--Chuck McManis
uucp: {anywhere}!sun!cmcmanis   BIX: cmcmanis  ARPAnet: cmcmanis@sun.com
These opinions are my own and no one elses, but you knew that didn't you.

kleef@ark.UUCP (03/31/87)

In article <553@batcomputer.tn.cornell.edu> engst@batcomputer.UUCP (Adam C. Engst) writes:
>
>Alright, I'm game.  Is it possible to program an Amiga emulator for the ST?
>Wouldn't all the blitter routines give the ST major problems (until the
>

I have i have in my possession something that is called an Amiga Emulator.
It was produced by Metacomco (at least, that's what it says) and we all
know Metacomco had a *lot* to with the Amiga operating system.

I cannot check the working of the program, as it requires a blitter
installed in the ST. Whether it's a trick or not, I don't know. As far
as I know there are *very* few blitters outside of the Atari office
in Silicon Valley. So, where did 'Metacomco' get the blitter to
develop the emulator?

But then again, if it's true, it would make a nice gadget :)

akw@osupyr.UUCP (04/01/87)

In article <952@ark.cs.vu.nl> kleef@cs.vu.nl (Patrick van Kleef) writes:
>In article <553@batcomputer.tn.cornell.edu> engst@batcomputer.UUCP (Adam C. Engst) writes:
>I have i have in my possession something that is called an Amiga Emulator.
>It was produced by Metacomco (at least, that's what it says) and we all
>know Metacomco had a *lot* to with the Amiga operating system.
>
>But then again, if it's true, it would make a nice gadget :)

Is this one of those April Fool's jokes that we have heard about???

Andy Weaver / akw@osupyr.UUCP / 614.293.1195 or .292.1741
The Ohio State University / Columbus, OH / "Go Bucks."
"Like cold water to the bones, so is good news from a distant land." Prov25.25

Disclaimer:  If Ohio State knew I had UseNet access, they would probably
have to ask what exactly UseNet is. And how much they should charge.

lachac@topaz.UUCP (04/02/87)

In article <163@osupyr.UUCP> akw@osupyr.UUCP (FarOff MicroDesigns) writes:
>In article <952@ark.cs.vu.nl> kleef@cs.vu.nl (Patrick van Kleef) writes:
>>In article <553@batcomputer.tn.cornell.edu> engst@batcomputer.UUCP (Adam C. Engst) writes:
>>I have i have in my possession something that is called an Amiga Emulator.
>>It was produced by Metacomco (at least, that's what it says) and we all
>>know Metacomco had a *lot* to with the Amiga operating system.
>>
>>But then again, if it's true, it would make a nice gadget :)
>
>Is this one of those April Fool's jokes that we have heard about???

I haven't seen it, but I would bet it is.

As a matter of fact, I have a better guess.

	There is this little thing I have for the Amiga called the
"ST emulator".  Basically what it does is give me a GEM screen and anything 
you try to do results in a bomb.

	The "Amiga Emulator" for the ST is probably the same type of thing.
The Amiga would be imposible to emulate on the ST and vice versa...

Just a thought...


-- 
		"Truth is false and logic lost..."
					- Neil Peart
	(who at the time didn't realize he was talking about RU)
lachac@topaz.rutgers.edu <--------OR--------> {seismo|ames}!rutgers!topaz!lachac

beilke@puff.UUCP (04/03/87)

In article <10635@topaz.RUTGERS.EDU>, lachac@topaz.RUTGERS.EDU (Gerard Lachac) writes:
> In article <163@osupyr.UUCP> akw@osupyr.UUCP (FarOff MicroDesigns) writes:
> 
> 	There is this little thing I have for the Amiga called the
> "ST emulator".  Basically what it does is give me a GEM screen and anything 
> you try to do results in a bomb.
> 
> 	The "Amiga Emulator" for the ST is probably the same type of thing.
> The Amiga would be imposible to emulate on the ST and vice versa...

    The ST can not emulate an Amiga, simply because it does not have the
graphics/sound harware to do everything an Amiga can.  However, the Amiga
could in theory emulate an ST (It would obviously be _much_ slower than
an ST.

    BTW,  a real ST emulator is indeed quit feasible.  After all they
both use the MC68000, don't they.  The hard part would be to get AmigaDOS
to read TOS disks.
    
             -         -  - ---> Matt Beilke <--- -  -       -
==============================================================================
|                                                                            |
|      //       ARPA: beilke@puff.wisc.edu                                   |
|     //        CSNET: beilke%puff.wisc.edu@csnet-relay                      |
| \\ // AMIGA   UUCP: ...!{ihnp4,hplabs,seismo,topaz,etc.}!uwvax!puff!beilke |
|  \//  RULES!! SNAIL: 451 Witte B, Madison, WI, 53706, USA                  |
|                                                                            |
==============================================================================

kleef@ark.UUCP (04/03/87)

In article <163@osupyr.UUCP> akw@osupyr.UUCP (FarOff MicroDesigns) writes:
>>I have i have in my possession something that is called an Amiga Emulator.
>>It was produced by Metacomco (at least, that's what it says) and we all
>>know Metacomco had a *lot* to with the Amiga operating system.
>>
>>But then again, if it's true, it would make a nice gadget :)
>
>Is this one of those April Fool's jokes that we have heard about???
>
>

It couldn't be an April Foolsday joke, as the program came to me
a couple of *months* ago. I could post it to mod.binaries.* for
hackers to take a peek into it, but I doubt the usefulness of such
a posting. I certainly don't have the means (read: knowledge :)
to check it out. Guess we will know when (sigh) the blitters
arrive.

As for the MS-Doz emulator Robtek sells: a friend of mine dug deep
into the code of the program and found out (as he says) something
like 50 percent of the code consists of nulls (0's, zero's, noughts).
Guess the program would seem too small in it's original size :)

Paul 'Red' Molenaar