SamEmu : a simple Sam Coupé emulator
pre-alpha version 0.00, by © Aley Keprt, 1997-98

 

This is the official documentation for the first public release of SamEmu. SamEmu is a free and very simple Sam Coupé emulator.

 

Contents:
1. Hardware And Software Requirements
2. Legal Stuff
3. Installation
4. Differencies between SamEmu and SimCoupé
5. Test programs
6. Known Problems And Their Solutions
7. Contacting The Author

 

1. Hardware And Software Requirements

optimal configuration: PC AT 486dx2/66 MHz, 1MB RAM, a printer

Yes, this emulator is much faster than other well known Sam emulator SimCoupé. You may ask: Why? In the fact I don't know. I've just coded this little piece of code and now I see it is quite fast. Nice to see it.

The main problem of SimCoupé is that it has the very powerful graphics engine, which causes the whole emulation to slow down. SamEmu contains only a VERY simple emulation of graphics. So it is able to run fastly on slower computers too.

This public release of SamEmu has been compiled using DJGPP v2.01 and Allegro 3.0. Since the original (my private) version of SamEmu was made using Borland C++ 3.1, this version follow some Borland's feature. At first it doesn't eat much memory, just about 350-400KB should be enough (for 256k emulation after lowering the stack size). In addition there is NO ASSEMBLER code, so it is fully portable as long as you will implement the keyboard, timer and graphics libraries similar to Allegro. (Of cource Allegro is coded in asm, but the emulator itself isn't - as said above, it was at first made using Borland C++, which doesn't contain Allegro libraries).

Since SamEmu uses DPMI, you will need a DPMI server to run it. Feel free to use either free CWSDPMI or simply use MS-Windows, OpenDOS or other op.system which supplies DPMI server.

 

2. Legal Stuff

You may give copies of this package to other people as long as no file is changed, added or removed.

This program comes to you WITHOUT ANY WARRANTY. No matter what happens, no matter how bad, I'm not going to be held responsible.

YOU MAY NOT CHARGE ANYTHING FOR THIS PACKAGE - DISTRIBUTORS WHO ARE INTERESTED IN THIS PROGRAM MUST WRITE TO ME FIRST AND HAVE MY APPROVAL!

USE OF THIS PACKAGE COMMERCIALLY IS EXPRESSLY FORBIDDEN WITHOUT WRITTEN

AND SIGNED APPROVAL FROM ME. COMMERCIAL USE INVOLVES ANY USE OR SUPPORT THE SamEmu IN ANY OTHER PROGRAM, IN WHICH MONEY IS INVOLVED (SPECIFICALLY THE CREATION OF ANY MUSIC PLAYERS OR EMULATORS WHERE PAYMENT IS INVOLVED). THIS PACKAGE IS ONLY FREEWARE FOR NON-COMMERCIAL USE.

 

3. Installation

If you aren't sure you've got the original unmodified SamEmu package, please reload it from Internet distribution site http://www.keprt.cz/sam.

The package contains the following executables:
SAMVGA.EXE - 512k RAM, VGA 320x240
SAM.EXE - normal version w/512k RAM emulation and SVGA 640x240 graphics

 

4. Differencies between SamEmu and SimCoupé

The easiest way how to describe "what it does" and "what it doesn't" is to compare SamEmu with SimCoupé. SimCoupé is well known hiquality emulator of the Sam Coupé.

 

5. Test programs

As you know, SamEmu has no support of floppy drives. There is only one possibility of loading files to the emulator. Whenever you press the key F1, it loads file "samfile" at address 32768 (page 1). It loads WHOLE file, doesn't matter how long it is.

You can load and view e.g. Sam Coupé screen files. Use this Basic viewer:

10 rem press F1 to load the file into memory
20 poke 507904,mem$(32768 to 32768+24575)
30 for a=0 to 15
40 palette a,peek(32768+24576+a)
50 next a

Some pictures are included in SamEmu distribution package, in the directory PICTURES.

 

If you want to test the speed of the emulator, you can use the next program. It displays some pixels of random color on the screen.

10 for a=0 to 24575
20 poke 507904+a,rnd(255)
30 next a

You can use this program to compare the speed of SamEmu and real Sam Coupé. SamEmu contains the 50Hz timer, but if your programs doesn't wait for it, they run simply as fast as possible.

I tried to load and run some real Sam Coupé programs, but I haven't been successful. I don't know where's the problem. I will probably make the integrated Z80 monitor/debugger and then I'll try to check the problem. Now only the Basic interpreter works. Also, when you enter pause, the system halts and you will have to reset. I don't know why.

 

6. Known Problems And Their Solutions

The main problem is that I have no free time. If somebody want to continue creating the SamEmu, please contact me. I'll send you the sources.

Also, SamEmu is quite unstable now. It is probably due to conversion to DJGPP, since I'm a beginner in DJGPP and I don't know all those DPMI services I need to access directly to the hardware, etc.

I won't do any asm optimizations, since it is fast enough already, and I DON'T HAVE AN ASSEMBLER COMPILER for DJGPP. Is there any? I think not. I've tried NASM and GAS, but THEY ARE STUPID!!! Fuck'em.

 

I made this emulator for these reasons:

  1. When I've made this version of SamEmu, I didn't know the SimCoupé. Yes, it is really so old.
  2. Allan J. Skillman (the author of SimCoupé) don't want to follow my ideas in some points. For example the DOS floppy driver is still very slow and there isn't a Z80 monitor/debugger integrated in SimCoupé still. Also, I could speed-up the CPU emulation. So I'll test my private code in my own emulator. I'd like to do my code for SimCoupé, but when Allan doesn't want to, I can't do anything. In addition, SimCoupé is declared as "falls under GNU-GPL", but working DOS sources are still not available. Maybe I'm stupid, but I am really unable to recompile SimCoupé using 0.74 source distribution and GNU MAKE program. To Allan: You could be more cooperative.

 

7. Contacting The Author

Feel free to contact the author and send him any comments, and money as well.
Any contributions are warmly welcomed. Let you show me I am doing a good thing.
SamEmu web site: http://www.keprt.cz/sam

 

some e-mail addresses:
Aley Keprt, the author of SamEmu: contact
FMS, the author of Z80 CPU emulator: FMS@freeflight.com
Shawn Hargreaves, the author of the Allegro: Shawn@talula.demon.co.uk
Allan J.Skillman, the author of SimCoupé: ASkillma@cambridge.arm.com
H. Hanemaayer, the original author of the lowlevel keyboard driver: HHanemaa@cs.ruu.nl
Mihai Cartoaje, DOS port of the lowlevel keyboard driver: moisemih@ift.ulaval.ca

 

kontakt Valid HTML 4.01!