JohnnyRockets Posted June 4, 2012 Share Posted June 4, 2012 Hi, I'm dipping a toe into ASM programming with DASM. I am using Notepad+ and kicking the output to DASM. What would be the best way to "test" my code on the 7800 using ProSystem Emulation? In other words how is this done? Also, do I have to tell DASM something special to have it compile for the 7800 (6502 processor) rather than some other system? Thanks! Quote Link to comment Share on other sites More sharing options...
Mord Posted June 4, 2012 Share Posted June 4, 2012 Hi, I'm dipping a toe into ASM programming with DASM. I am using Notepad+ and kicking the output to DASM. What would be the best way to "test" my code on the 7800 using ProSystem Emulation? In other words how is this done? Also, do I have to tell DASM something special to have it compile for the 7800 (6502 processor) rather than some other system? Thanks! The 7800 uses a 6502C for the processor which for all intents and purposes is a 6502 to the programmer. The only difference between the two that I'm aware of is the added HALT line, but that's controlled by the MARIA chip to freeze the 6502C temporarily. So basically tell it to complie for the 6502 processor, although there is a few other issues like reserving space for later encryption (digital signing or whatever it's called) at the end of the rom. There should be documentation on that around here somewhere in the forums, or someone else will be able to link it for you. The encryption isn't necessary for testing on the emulator itself, but you'll need it for it to run on real hardware. The program that can do that should be floating around as well. Quote Link to comment Share on other sites More sharing options...
JohnnyRockets Posted June 4, 2012 Author Share Posted June 4, 2012 Wow, I did not know about that requirement for the 7800 for encryption... interesting.... Also for the ProSystem emulator, I believe it is looking for a file with the extension .78a (or something like that), how to I get my DASM output to that format, or is it a simple matter of renaming the file with this extension? Thanks! Quote Link to comment Share on other sites More sharing options...
PacManPlus Posted June 4, 2012 Share Posted June 4, 2012 Hey Johnny: Here is a sample Compile Batch (zipped, so I can attach it) that I use so you can see how it does it (I am assuming you are using Windows?) Take a look at it and you can figure out what happens. I've also included the requisite programs. Please note - you HAVE to use this o a 32-bit O/S as '78hdr.exe' will not run in a 64-bit O/S. compile.zip Quote Link to comment Share on other sites More sharing options...
jwierer Posted June 5, 2012 Share Posted June 5, 2012 Hey Johnny: Here is a sample Compile Batch (zipped, so I can attach it) that I use so you can see how it does it (I am assuming you are using Windows?) Take a look at it and you can figure out what happens. I've also included the requisite programs. Please note - you HAVE to use this o a 32-bit O/S as '78hdr.exe' will not run in a 64-bit O/S. What does 78hdr.exe output? That should be easy to replace. -Jeff Quote Link to comment Share on other sites More sharing options...
PacManPlus Posted June 5, 2012 Share Posted June 5, 2012 I think it looks at the size of the bin and sets the flags accordingly. It always makes the game name 'TEST', so I am assuming the flags are all it does. It outputs the BIN with the header in front as an .a78 file. Quote Link to comment Share on other sites More sharing options...
JohnnyRockets Posted June 5, 2012 Author Share Posted June 5, 2012 Very cool, thanks guys! I will check this out! Quote Link to comment Share on other sites More sharing options...
DanBoris Posted June 11, 2012 Share Posted June 11, 2012 Wow, I did not know about that requirement for the 7800 for encryption... interesting.... Also for the ProSystem emulator, I believe it is looking for a file with the extension .78a (or something like that), how to I get my DASM output to that format, or is it a simple matter of renaming the file with this extension? Thanks! A .A78 file is a binary cart image with a special 128 byte header added to it that described the cartridge format. Below is the original specification for the header, although I believe some people have extended it since this version. You can setup some data decelerations at the start of your source file to create the header, or use a tool like 78hdr to add it afterwards. As for the 'encryption', it is necessary for the game to run on an emulator. It's not really encryption, but instead a digital signature attached to the cartridge data which is validated by a routing in the 7800's bios at startup. Without the encryption key the Atari logo will just keep cycling at startup. To work with this emulator ROM images must have this 128 byte cart header at the start of the raw data. This header allows the emulator to know the features of the cart thus preventing you from having to use a bunch of command line options. 0 Header version - 1 byte 1..16 "ATARI7800 " - 16 bytes 17..48 Cart title - 32 bytes 49..52 data length - 4 bytes 53..54 cart type - 2 bytes bit 0 - Pokey cart bit 1 - Supercart bank switched bit 2 - Supercart RAM 55 controller 1 type - 1 byte 56 controller 2 type - 1 byte 0 = None 1 = Joystick 2 = Light Gun 100..127 "ACTUAL CART DATA STARTS HERE" - 28 bytes Quote Link to comment Share on other sites More sharing options...
JohnnyRockets Posted June 11, 2012 Author Share Posted June 11, 2012 Thanks Dan! Very nice information, and I appreciate it. Quote Link to comment Share on other sites More sharing options...
EricBall Posted June 13, 2012 Share Posted June 13, 2012 Here's an example of how to have DASM generate an .a78 file automagically: SEG ROM HEADER ORG ROMTOP-128 DC.B 1 ; Header version DC.B "ATARI7800" DS 7,32 DC.B "Cart title" DS HEADER+49-.,0 DC.B $00,$00,256->ROMTOP,$00 ; data length DC.B $00,$00 ; cart type DC.B 1 ; controller 1 type DC.B 1 ; controller 2 type DC.B 0 ; NTSC / PAL ORG HEADER+100 DC.B "ACTUAL CART DATA STARTS HERE" ROMTOP ORG $x000 ; code & data here ORG $FF80 DS 120,0 ; 960 bit Rabin Digital Signature DC.W ROMTOP + $07FF NMI DC.W DLLNMI ; DLI interrupt handled RESET DC.W START ; execution start IRQ DC.W IRQRTI ; IRQ can be triggered by the cart, point to an RTI instruction There may be some updates, but this will give you the basics. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.