Jump to content
IGNORED

sample 7800 source code


EricBall

Recommended Posts

This is hopefully the start of a series of 7800 source code skeletons, each building on the next (or variations on a theme). I'll also put this on the mailing list for good measure.

 

This skeleton contains both a simple DLL builder and display list builder. Nothing fancy, no scrolling backgrounds or wrap-around, not even any error checking to make sure you don't add too many sprites to a display list. This is also not a complete program, though I've tried to include almost everything required.

skeleton1.zip

Link to comment
Share on other sites

Quite some time ago, you gave some good advice for people starting out: people who wanted to make games, wanted to program the 7800 but hadn't much (or any) coding experience.

 

Thought it might make sense to reprint it:

 

The question of where to start depends on what kind of experience you already have. In my opinion, if you're new to machine language programming or to the 6502 processor in particular, the best place to begin is to become familiar with the 6502. There are several online machine language programming tutorials that focus on the 6502 (here is one example), but you'll probably want to move on at some point and and pick up a few good 6502 books. My two favorites are 6502 Assembly Language Programming by Lance Leventhal (ISBN 0-931988-27-6) and Programming the 6502 (Fourth Edition) by Rodnay Zaks (ISBN 0-89588-135-7). Others I have in my library at the moment are 6502 Assembly Language Subroutines by Lance Leventhal and Winthrop Saville (ISBN 0-931988-59-4), Advanced 6502 Programming by Rodnay Zaks (ISBN 0-89588-089-X), and the manual to "The Visible Computer: 6502 Machine Language Teaching System" by Charles Anderson (which I thought did a good job of explaining the basics even though it focuses on the Apple II). You might also want to check 6502.org, which has a lot of online documents and a much longer list of books. Machine language has a (mostly) unfair reputation of being hard to learn, but don't let it intimidate you: I've found that it isn't difficult at all with a few helpful resources. The 6502 is a great processor to learn machine language on, too; just a couple of registers, and an instruction set that is small enough to memorize with a little practice.

 

Once you get the basic idea of how the 6502 works, you'll want to move on to 7800-specific resources. The relevant documents from Atari/GCC (and archived by Curt Vendel) are: the 7800 Software Guide, MARIA-2 "Handy Hints", and the 7800 Game Standards and Procedures manual. In addition, Dan Boris has put together a lot of great 7800 information and materials on his website to help get you started, including a memory map and a development framework with sample startup code. There is also a very helpful sprite demo there that illustrates how to use the 7800's graphics and the joysticks; this is a nice piece of code for experimenting with the 7800 hardware and with 6502 assembly (the first thing I did with it was change it into a bouncing ball demo for a simple Pong clone). When you think you're ready to look at source code for a complete 7800 game, Curt has archived the source code to Desert Falcon. Another resource that I've found helpful is Computer Animation Primer by David Fox and Mitchell Waite (now available online thanks to atariarchives.org), which talks about computer graphics and sprite animation and other things that are useful for game development. It focuses more on the Atari 800 computer series, but is very applicable to the 7800 as well.

 

As for development tools, the first thing you'll want to have is a cross-compiler. I recommend DASM, which is a popular choice among 2600 developers (see Dan Boris' site for information on how to validate the binaries you create, which is necessary because of the "encryption" feature of the 7800). You'll also need a place to run your programs; you can run them in an emulator, or on a real 7800. The best 7800 emulator I've used is probably MESS. It isn't 100% perfect, but it's more than accurate enough to test your code, and a lot more convenient than using a real console to test every little tweak. Nevertheless, you should get into the habit of at least testing major changes on a real 7800 to ensure compatibility. I use Eckhard Stolberg's DevOS system, which consists of a modified BIOS ROM that you would install in the 7800 to allow it to upload binaries through the second joystick port into a RAM card; the link to the PC is made with a simple parallel cable with a joystick connector on the 7800 side. This works perfectly well for me, but it is a little old-fashioned and does require some hardware hacking. Others use more modern solutions like Chad Schell's Cuttle Cart 2, which is a wonderful multi-cartridge that costs $150 plus shipping. Let me know if you'd rather save money and go with the DevOS; I can help you with the BIOS ROM and the other items you'll need (the RAM cartridge, the link cable, the software, etc).

 

That ought to be enough to start with. Let us know if you have any questions or need any assistance! icon_smile.gif

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...