https://github.com/unbibium/atari64 Skip to content Sign up * Why GitHub? Features - + Mobile - + Actions - + Codespaces - + Packages - + Security - + Code review - + Issues - + Integrations - + GitHub Sponsors - + Customer stories- * Team * Enterprise * Explore + Explore GitHub - Learn and contribute + Topics - + Collections - + Trending - + Learning Lab - + Open source guides - Connect with others + The ReadME Project - + Events - + Community forum - + GitHub Education - + GitHub Stars program - * Marketplace * Pricing Plans - + Compare plans - + Contact Sales - + Education - [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} unbibium / atari64 * Notifications * Star 45 * Fork 0 Commodore 64 OS running on Atari 8-bit hardware 45 stars 0 forks Star Notifications * Code * Issues 2 * Pull requests 0 * Actions * Projects 0 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 1 branch 1 tag Code * Clone HTTPS GitHub CLI [https://github.com/u] Use Git or checkout with SVN using the web URL. [gh repo clone unbibi] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching Xcode If nothing happens, download Xcode and try again. Go back Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @unbibium unbibium Update README.md ... e2ae74e Aug 12, 2021 Update README.md e2ae74e Git stats * 18 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time basic fixed RND(0) Aug 5, 2021 kernal added HELPRESET option for XEX version Aug 7, 2021 .gitignore added build xex to gitignore Aug 11, 2021 README.md Update README.md Aug 12, 2021 atari.sh BREAK key and Shift-Atari work Aug 4, 2021 atari64.cfg BREAK key and Shift-Atari work Aug 4, 2021 build.sh Now generates an XEX file for 800xl fun Aug 4, 2021 chargen.bin Successfully compiles on DASM and runs on VICE. Aug 2, 2021 roms.a65 Now generates an XEX file for 800xl fun Aug 4, 2021 toxex.py Now generates an XEX file for 800xl fun Aug 4, 2021 xex.a65 Now generates an XEX file for 800xl fun Aug 4, 2021 View code [ ] Atari 64 HOW TO BUILD WHAT YOU GET HOW TO RUN WHAT IT DOES WHY HOW ACKNOWLEDGEMENTS README.md Atari 64 This is the Commodre 64 KERNAL, modified to run on the Atari 8-bit line of computers. They're practically the same machine; why didn't someone try this 30 years ago? HOW TO BUILD You will need bash, dasm, and Python 3. You can get dasm at https://github.com/dasm-assembler/dasm/ Run ./build.sh and it should do everything. WHAT YOU GET * rom.a000 an 8K BASIC ROM * rom.d800 a 10K ROM containing PETSCII font and OS * atari64.xex an executable that you can load into an 800XL. It will copy itself behind the ROM and run from RAM. I patched the RAMTAS section so it doesn't think the BASIC area is free for BASIC programs. HOW TO RUN To run it in the emulator as if you'd taken an Atari 800's ROMs and swapped them out with these: * atari800 -config atari64.cfg You can extrapolate this to decide how to run it on real hardware. The atari64.xex should run from any DOS or boot loader. WHAT IT DOES The keyboard, the PETSCII screen editor, and BASIC work. Use the BREAK key to stop a running BASIC program. you'll note it doesn't work while an INPUT statement is running. I'll get the RESET button working real soon. The Atari logo key will type the pi character. Shift-Atari logo will switch between uppercase-graphics and lowercase-uppercase character set. Hold the OPTION, SELECT, or START key to type the graphics characters you'd ordinarily type with the Commodore logo key. If a lot of text is scrolling by, you can hold the OPTION key to slow down the scrolling, like you would hold down CTRL on a real C64. Known issues: * if the C64 OS is in RAM, RESET reboots the original Atari OS. Supposedly the old Translator disk got around this somehow. * no way yet to save or load BASIC programs * there's no I/O at all actually * PETSCII color will never work. WHY Recently the 8-Bit Guy did a video about the Apple 1 computer, and how you can simulate an Apple 1 with a Commodore 64 program that just reproduces the terminal I/O and runs the programs natively. It got me thinking, why couldn't I do the same thing with two other machines? The Atari 800XL and Commodore 64 have such similar memory maps and ROM switching capabilities that it seemed my best bet was to try to compile the CBM KERNAL on the Atari 800XL and see how much I could get to work. i wonder if I've hit the wall or if some mad genius will figure out how to wire a real Datasette in there and run actual PET programs. HOW I used mist64's cbmsrc project as a starting point. The first thing I had to do was reformat the C64 KERNAL and BASIC's source code so that it would compile in DASM. I wrote a python script for that, but still had to manually add segment definitions and such, so that it would compile neatly. Next, I had to make sure I could actually run these ROMs at all on an Atari emulator. The 8K BASIC ROM was straightforward enough, and the original Atari 800 used 10K of ROM. I used the extra 2K for the chargen ROM, which only needs half the space because it doesn't include the reverse characters. I worked out how to configure atari800 to run it -- if I got a black screen, I'd press F8 and look around in the monitor to make sure everything was there. Next I rewrote the code that set up the screen and I/O. I'd add declarations to kernal/declare as I went. I hard-coded an ANTIC display list in ROM to point to where the C64 usually draws the screen at $0400. I'd rewrite the screen initialization code to set up ANTIC and GTIA to point to that display list. Once I got that working, I found it was already displaying the C64 BASIC V2 splash screen. The cursor wasn't blinking, and of course the keyboard didn't work, but I could feed PETSCII characters into the keyboard buffer through the monitor, and I tested a few BASIC commands that way. Getting the cursor to blink was my next task. I looked at all the Atari documentation I could find to figure out how the vertical blank interrupt worked. I was setting the right flags, but nothing worked, until I realized that the vertical blank is an NMI in the Atari. On the Commodore it's an IRQ. So I switched the addresses at $FFFA and $FFFE, and that got me much closer. I rewrote the keyboard scan routine to handle the Atari keyboard, and removed most of the color code from the screen editor. I also had to modify BASIC's RND(0) function to draw from the POKEY instead of the CIA chips. The lack of a CIA/POKEY equivalent on the DCPU-16 is probably why I had to use RND(1) in my demo video instead. Currently, there's no I/O outside of the screen and keyboard whatsoever. It'll take more expertise than I have to figure out any possible way of saving and loading programs. Even describing the obstacles is a bit out of my league at this point. I might tear out all the rs232 code to make room for other people to attempt stuff, even though the 800XL has a larger ROM space to work in already. I'll leave the tape code in just because I have a hunch that isn't a total lost cause yet, but it's only a hunch. ACKNOWLEDGEMENTS * CBM source code: https://github.com/mist64/cbmsrc About Commodore 64 OS running on Atari 8-bit hardware Topics basic c64 6502 basic-programming atari800 cbm cbm-basic Resources Readme Releases 1 tags Packages 0 No packages published Languages * Roff 93.1% * Python 5.0% * Shell 1.9% * (c) 2021 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.