Bugs and Known Problems ----------------------- 2. A few programs cause the emulator to enter its built in debugger. The reason for this is unknown at the moment. It might be use of undocumented instructions. (Atari Tennis) 3. Player missile priority is ignored - not really a bug, it's simply not implemented. 4. Antic Modes 2, 3 and f which display two true colours and not one colour with two luminances. Should this be called a bug or feature? - its easy to fix (for an example type POKE 709,40). Personally I *like* being able to get solid colour antic 2 characters on the blue background (e.g. RED on BLUE) but technically it's wrong. 5. Burried Bucks and Caverns of Khafka player to playfield collision detection is broken. This is a result of only refreshing the screen once every four frames. The collision detection indicates to the program that no collisions have occured during these skiped screens. Both Burried Bucks and Caverns of Khafka use this to drop something until the objects hits a playfield object. The result is that the object drops 3 out of 4 frames even when touching a playfield. 6. Test Sound Implementation for Linux SVGALIB needs a printf("\n") instruction before every note! The program doesn't make any sound if it is removed. I have noticed that the title screen of K-Razy Antiks has different coloured letters depending on whether sound has been enabled. 7. Reset and Coldstart do not work when emulating either the XL or XE. .TH ATARI800 1 "3 September 95" .SH NAME atari800 \- Atari 800 Emulator .SH SYNOPSIS \fBatari800\fP [options] [diskfiles...] .SH DESCRIPTION \fIatari800\fP emulates the Atari 800, Atari 800 XL and eventually the Atari 130 XE. .SS Options .TP \fB-a Use Atari OS/A. .TP \fB-b Use Atari OS/B. .TP \fB-xl Emulate Atari 800 XL. .TP \fB-xe Emulate Atari 130 XE - Not currently implemented. .TP \fB-rom The following file is a standard 8K ROM cartridge. .TP \fB-rom16 The following file is a standard 16K ROM cartridge. .TP \fB-oss The following file is an OSS super-cartridge. .TP \fB-db The following file is a DB super-cartridge. .TP \fB-c Enable RAM between $c000 and $d000. .TP \fB-h The following argument is used as the directory for the H: device. .TP \fB-v Print emulator version. .SS SVGALIB Options .TP \fB-sound Enable sound using /dev/sequencer .SS X Window Options .TP \fB-small Runs the emulator in a small window where each Atari 800 pixel is represented by one X Window pixel. .TP \fB-large Runs the emulator in a large window where each Atari 800 pixel is represented by a 2x2 X Window rectange. This mode is selected by default. .TP \fB-huge Runs the emulator in a huge window where each Atari 800 pixel is represented by a 3x3 X Window rectange. .SS Amiga Options .TP \fB-ocs Used for OCS based Amigas. It has not been tested on a real OCS based computer and there could be problems with regard to Workbench versions. .TP \fB-ecs Used for ECS based Amigas. It has not been tested on a real ECS based computer and there could be problems with regard to Workbench versions. .TP \fB-aga Used for AGA based Amigas. It has been tested on an Amiga 1200 with 68030 + 4Mb Fast RAM. .TP \fB-grey Produce a grey scale display. .TP \fB-colour Produce a full colour on AGA machines and up to 32 simultaneous colours on OCS and ECS machines. .SS Curses Options .TP \fB-left Use columns 0 to 39. .TP \fB-central Use columns 20 to 59. .TP \fB-right Use columns 40 to 79. .TP \fB-wide1 Use columns 0 to 79. In this mode only the even character positions are used. The odd locations are filled with spaces. .TP \fB-wide2 Use columns 0 to 79. This mode is similar to \fB-wide1\fP except that the spaces are in reverse video if the previous character was also in reverse video. .SH FILES .TP \fIatariosa.rom\fR Atari O/S A .TP \fIatariosb.rom\fR Atari O/S B .TP \fIatarixl.rom\fR Atari 800 XL O/S .TP \fIataribas.rom\fR Atari Basic .SH BUGS A few programs cause the emulator to enter its built in debugger. The reason for this is unknown at the moment. Player missile priority is ignored. Antic Modes 2, 3 and f display two true colours and not one colour with two luminances. Should this be called a bug or feature, and should it be corrected? Fine Scrolling has not been implemented yet. Changes in 0.1.9 ---------------- - Corrected bug in IRQST and IRQEN - Corrected minor bug in player missile collision detection - Amiga version is now full screen + Menus - Faster disk I/O - Added ATARI800 environment variable. This allows the emulator to be run from different directories. If ATARI800 is unset it will still try to load the OS images from object/ below the current working directory. - colours.h replaces colours.dat - Added man page. - New way of handling Joysticks, Triggers, Paddles and Console Keys - Corrected handling of CHBASE which was causing K-RAZY ANTIKS to display garbage. - Corrected handling of VCOUNT which was causing screen handling errors in Star Raiders (galactic map) and Henri (game screen). - Added Sound API. A test sound implementation is available for the Linux SVGALIB version via /dev/sequencer - It's not very good and has only been used to test the API. It is enabled by starting the program with the -sound option. Listen to the title screens of Necromancer, K-Razy Antiks and Henri (these are the best I've heard). - argc and argv are passed to the platform specific initialisation code - Atari_Initialise(). This allows platform specific options like -sound on the Linux SVGALIB version. - Extra Amiga options -ocs -ecs and -aga. Currently the default is AGA. The -ocs and -ecs have been tested on an A1200 with the OCS and ECS emulation modes enabled. At the moment it is not guaranteed to work on real OCS or ECS equiped machines since it has only been tested under Workbench 3.0. Hopefully someone will provide some feedback. - Another two Amiga options -grey and -colour. The -grey option produces a grey scale display on OCS, ECS and AGA machines. The -colour option produces a full colour display on AGA machines and up to 32 simultaneous colours on OCS and ECS machines. - The DOUBLE_SIZE compilation flag for the X11 version has been replaced by a runtime options. The runtime options are -small, -large and -huge. Changes in 0.1.8 ---------------- - Allows direct use of GRAFP0, GRAFP1, GRAFP2, GRAFP3 and GRAFM without using DMA. - -rom16 option to load standard 16K ROMs. - -a option to load object/atariosa.rom - -b [default] option to load object/atariosb.rom - Simplified screen generation for host - Player missile graphics collision detection has been moved into 'atari_custom.c' - Corrected read from PORTB (XL/XE emulation) - GTIA support for *all* antic modes. i.e. GTIA can be enabled in graphics mode 0 (antic mode 2) just like a real 800. POKE 623 with 64, 128 or 192 to test. - Amiga version can be compiled using either DICE C or GNU C - see Makefile Changes in 0.1.7 ---------------- - Issue cpu cycles during screen update (corrects VCOUNT problem) As a result DLI are not occuring on the correct mode line. - Support for 256 bytes/sector ATR files - Handle Insert, Delete and Tab keys properly - Handle Shift + Control + A-Z properly (X11 only) - Cartridge support tidied up (Thanks to Dave Bennett) Changes in 0.1.6 ---------------- - Correct Colours (Thanks to Chris Lam) - Fetch correct number of screen bytes with horizontal scrolling enabled - Speed improvements for Antic Display Modes - Support for ATR files (128 bytes sectors only) - Support for XL/XE ROM (Reset etc. do not work???) - Corrected Bug in BCD SBC instruction. - Added X11 window Expose event (Thanks to Ivo van Poorten) - Control characters within CURSES (Thanks to Ivo van Poorten) - Improved Portability - Remove '-b' flag (Use -rom object/ataribas.rom instead) - Graphical Support for Amiga 1200 - Faster 6502 Emulation - X11 Joystick emulation now uses the mouse Changes in 0.1.5 ---------------- - CURSES text only mode (Support for various terminals) - Display list jump instruction corrected. - Fixed SIO module (It didn't update DSTATS) Changes in 0.1.4 ---------------- - Changed GetByte and PutByte to macros - Added SVGALIB support for Linux which is much quicker than X11. - Added support for OSS Super Cartridges (Thanks to Dave Bennett) - -rom option to specify alternative cartridges - -oss option to specify alternative OSS Super Cartridges Changes in 0.1.3 ---------------- - Compilation option for double size screen - Trigger now initialises to not pressed - Joystick now initialises to central - Fifth Player support added - Support for Paddle 0 - Preparation for changing GetByte and PutByte to macros. Changes in 0.1.2 ---------------- - Now include in atari_custom.h - Resets count to countdown as soon as it reaches zero. This was causing problems with the RESET Key - count went negative. - Removed XImage structure. I am now updating only the pixels that have changed within a Pixmap. XCopyArea is used to move the Pixmap onto the Window. XCopyArea is not called if no pixels are changed. As a result I am trying a higher refresh rate. - Correction for BASIC version - I left some X11 stuff in resulting in unresolved sybols. - Remove unused status variable from atari_h_device.c - Added some test Amiga Intuition Code - not usable (No Colour or Keyboard) It manages to get the 'READY' prompt up! Atari Basic Blue is one colour and everything else is the other. When keyboard support is added you will be able to use Atari Basic. - Registers are now allocated variables within atari_custom.c. They are nolonger stored in main memory area. Changes in 0.1.1 ---------------- - Outputs an error message when ROM images are not available. Version 0.1.0 ------------- - Initial Release GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! This is the list of people who have contributed to project Thanks go to :- Dave Bennett - Code enabling the use of OSS super cartridges - Correction to display list jump instruction - Tidied cartridge code up Chris Lam - Lookup table containing RGB values for each Atari Colour Ivo van Poorten - Added X11 window Expose Event - Made hardware registers repeat within their page. - Control Characters in CURSES version Stephen Firth - Graphical Support for Amiga Installation of the Atari 800 Emulator -------------------------------------- Firstly, I don't know the legal status of the Atari Operating System or Atari Basic. I suggest that you obtain the images from the PC Xformer package (do an archie search on xf25). The files you need are 'ataribas.rom', 'atarixl.rom' and 'atariosb.rom'. These files should be either placed under a directory called 'object' below the source/execution directory, or placed in a directory pointed to by the ATARI800 environment variable. Note: for case sensitive systems make sure that the filenames and directory are all lowercase. 1. X Window Version (Including SUN OpenWindows) on a Unix Platform 2. SVGALIB Version on Linux 3. CURSES version for UNIX 4. Graphical Version for the Amiga 7. BASIC version (No Graphics). Should be straightforward to configure for any 32 bit environment supporting ANSI C. Note: I don't say 32 bit computer because certain operating systems enforce a 16 bit memory model. No prizes are offered for correctly identifing the OS in question. X-Windows Version on a Unix Platform ------------------------------------ Just type make. Note: You may have to add the X11 include directory to the CPPFLAGS line. On SunOS 4.1.3 and Solaris 2.4 it is /usr/openwin/include. i.e. CPPFLAGS = -I/usr/openwin/include -DX11 SVGALIB Version on Linux ------------------------ Uncomment the relevant section in the Makefile before typing make. Note: The SVGALIB version must be either run as the root user or the executable must be owned by root and have its setuid bit set. To enable the program to be run by any user, login as root and type:- make install-svgalib It is set up to install files in /usr/local/bin and the man page in /usr/local/man/man1. Edit the makefile if you want them elsewhere. CURSES version for UNIX ----------------------- Uncomment the relevant section in the Makefile before typing make - If your using Linux make sure that you uncomment the NCURSES section. There are three different CURSES configurations stored within the Makefile. Please read them all and select the correct one. If you are using Solaris 2 make sure that you add -DSOLARIS2 (This fix may be required for other system as well - duplicate case values) Note: You must use a System V Cureses Library. BSD Curses is lacking a few functions and will not work (nodelay, attron, attroff, keypad and curs_set). BASIC version on VAX/VMS (No Graphics) -------------------------------------- Note: I have not built this version for a while. Modifications may be required to vmsbuild. type @vmsbuild Compiling: Run the command file vmsbuild.com. It is set up to use GNU C (I used version 2.6.1 but don't expect problems with other versions). It will probably compile OK on VAX C. atari800 :== $DISK$xxxx:[yyyy]atari800.exe where xxxx is the disk the software is on. yyyy is the directory the software is in. Graphical Version for CBM Amiga ------------------------------- Compiler: DICE C + GNU C (Lattice C Untried) Uncomment the relevant section in the Makefile before typing make. If your using dmake the makefile should be renamed dmakefile. BASIC version ------------- Uncomment the relevant section in the Makefile before typing make. # # =========================== # Uncomment for BASIC Version # =========================== # #CC = gcc #CPPFLAGS = -DBASIC #CFLAGS = -c -O6 #LD = gcc #LDFLAGS = #LDLIBS = #OBJ = atari_basic.o # # ============================= # Uncomment for SVGALIB Version # ============================= # #CC = gcc #CPPFLAGS = -DSVGALIB #CFLAGS = -c -O6 #LD = gcc #LDFLAGS = #LDLIBS = -lvgagl -lvga #OBJ = atari_svgalib.o # # ========================= # Uncomment for X11 Version # ========================= # CC = gcc CPPFLAGS = CFLAGS = -c -O6 LD = gcc LDFLAGS = LDLIBS = -lX11 OBJ = atari_x11.o # *** If you are using Open Windows you may *** # *** have to Uncomment the following lines *** #CPPFLAGS = -I/usr/openwin/include #LDFLAGS = -L/usr/openwin/lib # # ======================================== # Uncomment for X11 version for HP9000/7xx # using ANSI C Compiler with HP-UX 9.0x # ======================================== # #CC = cc #CPPFLAGS = -D_POSIX_SOURCE #CFLAGS = -c -O -Aa -I/usr/include/X11R5 #LD = cc #LDFLAGS = #LDLIBS = -L/usr/lib/X11R5 -lX11 # # ================================================ # Uncomment for CURSES version (Solaris + others?) # For SOLARIS2 you must add -DSOLARIS2 to CPPFLAGS # ================================================ # #CC = gcc #CPPFLAGS = -DCURSES #CFLAGS = -c -O6 #LD = gcc #LDFLAGS = #LDLIBS = -lcurses #OBJ = atari_curses.o # # ==================================================== # Uncomment for CURSES version (SunOS 4.1.x + others?) # ==================================================== # #CC = gcc #CPPFLAGS = -I/usr/5include -DCURSES #CFLAGS = -c -O6 #LD = gcc #LDFLAGS = -L/usr/5lib #LDLIBS = -lcurses #OBJ = atari_curses.o # # =============================================== # Uncomment for NCURSES version (Linux + others?) # =============================================== # #CC = gcc #CPPFLAGS = -I/usr/include/ncurses -DCURSES -DNCURSES #CFLAGS = -c -O6 #LD = gcc #LDFLAGS = #LDLIBS = -lncurses #OBJ = atari_curses.o # # =========================================== # Uncomment for Commodore Amiga BASIC Version # =========================================== # #CC = dcc #CPPFLAGS = -DAMIGA -DBASIC #CFLAGS = -c -mD #LD = dcc #LDFLAGS = #LDLIBS = #OBJ = # # ============================================== # Uncomment for the Amiga DICE Graphical Version # ============================================== # #CC = dcc #CPPFLAGS = -DAMIGA -DDICE_C #CFLAGS = -c -mD #LD = dcc #LDFLAGS = #LDLIBS = #OBJ = atari_amiga.o # # ============================================= # Uncomment for the Amiga GCC Graphical Version # ============================================= # #CC = gcc #CPPFLAGS = -DAMIGA -DGNU_C -IApplications:Dice/Include/Amiga30/ #CFLAGS = -c -O6 -m68030 #LD = gcc #LDFLAGS = #LDLIBS = -lamiga #OBJ = atari_amiga.o # # ====================================================== # You should not need to modify anything below this here # ====================================================== # DOCS = BUGS CHANGES COPYING CREDITS INSTALL OVERVIEW README USAGE vmsbuild.com INCLUDES = Makefile system.h cpu.h atari.h atari_custom.h atari_h_device.h colours.h atari800 : main.o atari.o cpu.o monitor.o atari_sio.o atari_h_device.o atari_custom.o $(OBJ) $(DOCS) $(LD) $(LDFLAGS) main.o atari.o cpu.o monitor.o atari_sio.o atari_h_device.o atari_custom.o $(OBJ) $(LDLIBS) -o atari800 main.o : main.c $(INCLUDES) $(CC) $(CPPFLAGS) $(CFLAGS) main.c atari.o : atari.c $(INCLUDES) $(CC) $(CPPFLAGS) $(CFLAGS) atari.c cpu.o : cpu.c $(INCLUDES) $(CC) $(CPPFLAGS) $(CFLAGS) cpu.c monitor.o : monitor.c $(INCLUDES) $(CC) $(CPPFLAGS) $(CFLAGS) monitor.c atari_sio.o : atari_sio.c $(INCLUDES) $(CC) $(CPPFLAGS) $(CFLAGS) atari_sio.c atari_h_device.o: atari_h_device.c $(INCLUDES) $(CC) $(CPPFLAGS) $(CFLAGS) atari_h_device.c atari_custom.o : atari_custom.c $(INCLUDES) $(CC) $(CPPFLAGS) $(CFLAGS) atari_custom.c atari_x11.o : atari_x11.c $(INCLUDES) $(CC) $(CPPFLAGS) $(CFLAGS) atari_x11.c atari_svgalib.o : atari_svgalib.c $(INCLUDES) $(CC) $(CPPFLAGS) $(CFLAGS) atari_svgalib.c atari_curses.o : atari_curses.c $(INCLUDES) $(CC) $(CPPFLAGS) $(CFLAGS) atari_curses.c atari_amiga.o : atari_amiga.c $(INCLUDES) $(CC) $(CPPFLAGS) $(CFLAGS) atari_amiga.c clean : rm *.o install : cp atari800 /usr/local/bin/atari800 cp atari800.man /usr/local/man/man1/atari800.1 install-svgalib : cp atari800 /usr/local/bin/atari800 cp atari800.man /usr/local/man/man1/atari800.1 chown root.root /usr/local/bin/atari800 chmod 4755 /usr/local/bin/atari800 Porting the emulator to a new platform -------------------------------------- The machine specific graphics / user interface sections are all kept in separate files. Currently there are four files :- 1. atari_x11.c File supporting X Windows 2. atari_svgalib.c File supporting Linux with SVGALIB 3. atari_curses.c File supporting System V Curses (not BSD Curses) 4. atari_amiga.c File supporting CBM Amiga 1200 Only one of these files should be linked in at any one time. Each file contains the following functions:- Atari_Initialise() Initialises the graphical environment, create screen/window, allocate colours etc. Atari_Exit() Tidies system up just before emulator finishes. Delete all allocated resources (screens, windows etc.) Atari_PreUpdate () Called just prior to the screen refresh. In the SVGALIB and Amiga version it is used to initialise pointers to the start of screen memory. Atari_PostUpdate () Called just after the screen has been finished. In the X11 version it is used to copy the offscreen image onto the main window. Atari_ScanLine () Called for each scanline to be displayed. Atari_Keyboard () You might find the ways this is implemented a bit strange but I wanted to increase the chances of it working on non-ascii keyboards (not that I think its very likely). Atari_Joystick () Returns value of joystick and trigger. Joystick position is in bits 0-3 and trigger is in bit 4. Return 0x1f if the joystick is not available. Atari_Paddle () Returns value of paddle and trigger. Paddle position is in bits 0-7 and trigger is in bit 8. Return 0x100 if the paddle is not available. Implementation Overview (Very Brief) ------------------------------------ +-----------------+----------------+ | monitor program | O.S. Support | | +--------+------+ | | | 6502 CPU | | | |Emulation Layer| | +--------+---------------+---------+ | RAM/ROM and Memory Mapped H/W | +----------------------------------+ 1. Monitor Program (monitor.c) Development debugging tool. Allows emulated system to be interogated. 2. O.S. Support (atari.c, atari_sio.c, atari_h_device.c) Support routines that allow the Emulated Operating system to talk to the host machines. These are implemented using a pseudo 6502 escape instruction. Support for other operating systems could be built into this section 3. 6502 CPU Emulator Layer (cpu.c) Access memory by calling routines within hardware layer. Not the fastest way of doing this, but it produces a compact flexible system that should be able to emulate other platforms. 4. Hardware Layer (atari_custom.c) RAM / ROM / DEVICES and memory mapped custom chips. Again support for other hardware systems could be inserted into this section. Link Hardware and Operating System to CPU ========================================= This emulator has been designed to cope with multiple 6502 based computers. In order to add support for another computer you need to implement a hardware emulation layer and link this into the 6502 CPU module. e.g. The Atari 800 is linked in by defining five routines :- UBYTE Atari800_GetByte (UWORD addr); Returns the byte at the memory address. UWORD Atari800_GetWord (UWORD addr); Returns the word at the memory address. void Atari800_PutByte (UWORD addr, UBYTE byte); Stores the byte at the memory address. void Atari800_Hardware (void); Called after every instruction to emulate the machines hardware. void Atari800_Escape (UBYTE code); Called when the CPU module encounters the special emulators additional ESC instruction. The opcode is 0xff and it takes a single immediate operand that contains a user defined value. This instruction is used to patch the operating system. Each of these sections are linked to the CPU module at runtime by assigning the addresses of the functions to the respective CPU pointer functions. #include "cpu.h" XGetByte = Atari800_GetByte; XPutByte = Atari800_PutByte; Hardware = Atari800_Hardware; Escape = Atari800_Escape; The CPU module will now call the Atari800 specific function for all memory accesses. e.g. Switching between multiple systems. Set up and Patch required O.S. here switch (machine) { case Atari800 : XGetByte = Atari800_GetByte; XPutByte = Atari800_PutByte; Hardware = Atari800_Hardware; Escape = Atari800_Escape; break; case BBC : XGetByte = BBC_GetByte; XPutByte = BBC_PutByte; Hardware = BBC_Hardware; Escape = BBC_Escape; break; case CBM64 : XGetByte = CBM64_GetByte; XPutByte = CBM64_PutByte; Hardware = CBM64_Hardware; Escape = CBM64_Escape; break; } Memory Types ------------ For the Atari 800 hardware, 64K of memory is allocated together with 64K of memory attribute space. Every byte of emulated memory has an associated attribute. Valid attributes are ROM, RAM and HARDWARE. Writes to addresses with the ROM attribute are blocked by PutByte. Reads and writes to addresses with the HARDWARE attribute are handled as special cases by both PutByte and GetByte. The RAM attribute allows both reads and writes to the specified address. e.g. UBYTE memory[65536]; UBYTE attribute[65536]; UBYTE Atari800_GetByte (UWORD addr) { UBYTE byte; if (attribute[addr] == HARDWARE) { switch (addr) { case HARDWARE_ADDRESS_1 : case HARDWARE_ADDRESS_2 : case HARDWARE_ADDRESS_x : byte = Special Code; } } else { byte = memory[addr]; } return byte; } Screen Generation ----------------- Each scanline is processed separatly and composes of 384 pixels - enough for a wide playfield. There are several independent graphic elements may which overlap :- 1. The normal playfield (3 bits) - each pixel may be one of :- a. Playfield 0 b. Playfield 1 c. Playfield 2 d. Playfield 3 e. Background 2. Player 0 (1 bit) 3. Player 1 (1 bit) 4. Player 2 (1 bit) 5. Player 3 (1 bit) 6. Missile 0 (1 bit) 7. Missile 1 (1 bit) 8. Missile 2 (1 bit) 9. Missile 3 (1 bit) Provision must be made for collision detection. To do this each of the 384 pixels is represented using a 16 pixel that contains all the above information. The 16 bit pixel is processed according to the contents of PRIOR in order to determine the final pixel colour. f e d c b a 9 8 7 6 5 4 3 2 1 0 --------------------------------------------------------------- M3 M2 M1 M0 P3 P2 P1 P0 --- --- --- --- PF3 PF2 PF1 PF0 Example: Collision detection if (P0) { P0PF |= Pixel & 0x0f P0PL |= (Pixel >> 8) & 0x0f } if (M0) { M0PF |= Pixel & 0x0f M0PL |= (Pixel >> 8) &0x0f } The GTIA modes can be generated directly from the 384 pixel buffer. Unanswered Questions -------------------- 1. In collision detection, does a player collide with itself ? i.e. Does P0PL bit 0 always contain a 0 or a 1. Does P1PL bit 1 always contain a 0 or a 1. Does P2PL bit 2 always contain a 0 or a 1. Does P3PL bit 3 always contain a 0 or a 1. Atari 800 Emulator for Unix, Version 0.1.9 ------------------------------------------ Copyright (C) 1995 David Firth. E-Mail: david@signus.demon.co.uk This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This is the version 0.1.9 of my Atari 800 emulator for Unix. My main objective is to create a freely distributable portable emulator (i.e. with source code available). It can be configured to run in the following ways :- 1. BASIC mode 2. CURSES Mode 3. SVGALIB for Linux Systems 4. X-Windows 5. CBM Amiga The basic mode is only useful for running programs such as MAC65, Atari Basic etc. I have had this version running on Linux, SunOS 4.1.3, Solaris 2.4, VAX/VMS, CBM Amiga (Dice C and GNU C) and the HP-UX 9000/380. The CURSES mode is similar to the basic mode, but it also enables full screen editing capability. Some computer don't seem to support curses fully - SunOS 4.1.3, VAX/VMS, LINUX (but ncurses is OK). The SVGALIB version runs at a reasonable speed. The screen dimensions are limited to 320x200 and is unable to display the overscan modes. Instead SVGALIB displays the core 320x192 pixels. The X-Windows version supports graphics but runs *very* slowly. This appears to be due to overheads with X-Windows. The Amiga version supports graphics but currently lacks Paddle support. --------------------------------------------------------------------------- Features -------- Note: Not all features are supported on all platforms. 48K/52K Atari 400/800 emulation (optional RAM between 0xc000 and 0xcfff) Atari 800XL emulation. OSS Super Cartridges. Should run on any Unix computer running X-Windows. Wide / Normal / Standard Playfields. Joystick controller using numeric keypad. Paddle controller using X-Windows mouse position. Display List Interrupts. Vertical Blank Interrupts. All Antic Display modes. GTIA graphics support for *all* Antic modes (GTIA Characters etc.) Player Missile Graphics with collision detection. Character vertical reflect, invert and blank. Files can be stored directly on your host computer via the H: device. (H: replaces the C: device which serves no useful purpose) Reads both ATR and XFD disk files. Disk swapping (Crude but works - needs to be improved) PIL modes - allows memory between 0x8000 and 0xbfff to be toggled between RAM and ROM. Future Atari 800 Enhancements ----------------------------- Hardware scrolling - pointless until the screen refresh rate is improved. Atari 800XE emulation. Printer support (Print to file + spool on close). Paged memory using PORTB. More extensive sound support. It should be possible to add support for non OSS Super Cartridges. If you can forward details on how the cartridge works I'll see what I can do. Usage ----- Usage: 6502 [-atari] [-xl] [-xe] [-hprefix/] [-b] [-c] [-d] [-1..9] [disk1.xfd ... disk8.xfd] [-rom filename] [-oss filename] {-small|-large|-huge} {-sound} {-left|-central|-right|-wide1|-wide2} -atari Enable Atari 800 Emulation Mode [default] -xl Enable Atari 800XL Emulation Mode [not complete] -xe Same as -xl at the moment -rom Loads the following 8K ROM Cartridge -oss Loads the following OSS Super Cartridge -db Loads the following DB Super Cartridge (Private 32K Cartridge Format - not for general use) -1..9 Trade off between speed and screen refresh rate. The lower the number the more often the screen is refreshed and the slower the CPU emulation. :-( -a Use object/atariosa.rom -b Use object/atariosb.rom [default] -c Enable RAM between $C000 and $CFFF -d Enable DEBUG Mode. Monitor is entered straight away. Only useful for basic version. -h Subdirectory for H device defaults to H/ H1: Store files in native Atari Format H2: Convert linefeed to normal ASCII. X Window Options ---------------- -small Creates a small window where one Atari 800 pixel is represented by a single X Window pixel. -large Creates a large window where one Atari 800 pixel is represented by a 2x2 X Window rectangle. -huge Creates a huge window where one Atari 800 pixel is represented by a 3x3 X Window rectangle. SVGALIB Options --------------- -sound Select this if you want to try the test sound implementation. You must have the piano1.sbi file in your current directory. The piano1.sbi file can be obtained from sndkit.tar from sunsite. Amiga Options ------------- -ocs Select this if you are using an OCS based Amiga. Note: This option has only been tested under OCS emulation on an A1200. There could be Workbench compatibility problems on a real OCS Amiga. -ecs Select this if you are using an ECS based Amiga. Note: This option has only been test under ECS emulation on an A1200. There could be Workbench compatibility problems on a real ECS Amiga. -aga Select this if you are using an AGA based Amiga. -grey Produce a grey scale display. -colour Produce a full colour display on AGA Amigas and up to 32 simultaneous colours on OCS and ECS Amigas. Curses Options -------------- -left Use columns 0 to 39 -central Use columns 20 to 59 -right Use columns 40 to 79 -wide1 Use columns 0 to 79 (Spaces between characters) -wide2 Use columns 0 to 79 (as above but Normal/Reverse spaces) Atari Basic =========== Atari Basic is nolonger activated by the '-b' command line option. It is now loaded in the same way as every other cartridge. This does not affect the XL/XE version which has Atari Basic as standard. Example 1 - Standard Atari 800 Emulator 6502 -rom object/ataribas.rom Example 2 - Atari 800XL Emulator 6502 -xl Keyboard + Joystick & Paddle Controllers ======================================== Unlike PC Xformer, I have not tried to emulate the exact keyboard layout, instead, I have tried to make your native keyboard work as normal. Note: The function keys will eventually be changed to a more logical order. X11 Keyboard + Joystick & Paddle Controllers ============================================ F1 Warm Reset (This doesn't work under Open Windows) F2 Option F3 Select F4 Start F5 Cold Reset F6 Toggle RAM/ROM between 0x8000 and 0xbfff (PIL Mode) F7 Break Key F8 Crude Disk 1 Changer F9 Exit Emulator F10 --- F11 --- F12 --- ALT Atari Key (Either ALT Key will work) Joystick 0 is operated by the mouse position relative to the center of the screen. The mouse button acts as the trigger. Paddle 0 is operated by moving the mouse pointer across the window. SVGALIB Keyboard + Joystick & Paddle Controllers ================================================ F1 Warm Reset (This doesn't work under Open Windows) F2 Option F3 Select F4 Start F5 Cold Reset F6 Toggle RAM/ROM between 0x8000 and 0xbfff (PIL Mode) F7 Break Key F8 --- F9 Exit Emulator F10 --- F11 --- F12 --- ` This character replaces the CAPS lock key because I have not found a way of detecting it. A future solution maybe to automatically issue a CAPS lock key when a transition is made between lower and upper case keys. i.e. If svgalib return 'a' followed by 'A' it could send 'a' 'CAPS' 'A' to the Atari. Joystick 0 is operated by the numberic keypad (make sure that the numeric keypad has been enabled). 7 8 9 \|/ 4 5 6 /|\ 1 2 3 And 0 is the fire key. At the moment it is not possible to use a Paddle with the SVGALIB version. CURSES Keyboard + Joystick & Paddle Controllers =============================================== F1 Warm Reset (This doesn't work under Open Windows) F2 Option F3 Select F4 Start F5 Cold Reset F6 Toggle RAM/ROM between 0x8000 and 0xbfff (PIL Mode) F7 Break Key F8 --- F9 Exit Emulator F10 --- F11 --- F12 --- Some control have special meaning within curses and should not be used. Avoid Control + C, J, M, Q, S and Z The remaining control characters can be typed. Control characters are displayed on the screen with the associated upper case character in bold. No Joystick or Paddle support in this version. AMIGA Keyboard + Joystick & Paddle Controllers ============================================== F1 Warm Reset (This doesn't work under Open Windows) F2 Option F3 Select F4 Start F5 Cold Reset F6 Toggle RAM/ROM between 0x8000 and 0xbfff (PIL Mode) F7 Break Key F8 Crude Disk 1 Changer F9 EXIT Emulator F10 --- Joystick is operated as normal with joystick plugged into port 2. Paddles are not support at the moment. BASIC Keyboard + Joystick & Paddle Controllers ============================================== No Frills text. Upper and Lower case letters, 0-9, !"$% etc. No Reset, Option, Select, Start, etc. No Joystick or Paddle support in this version.