Jump to content
  • entries
    658
  • comments
    2,707
  • views
    906,980

Compile and Run 2600 assembly code from jEdit


In this blog entry we'll be making the changes to compile and run your 2600 program from jEdit. You must have already followed the steps in Add a console to jEdit for this to work.

 

You must also have already installed the 6502 mode file and updated the catalog file. The current 6502 mode file can be found in this blog entry.

 

 

For this we'll be doing 3 things:

  1. Figure out your Compile Command
  2. Figure out your Interpreter Command
  3. Configure jEdit

 

 

Figure out your Compile Command

 

First thing we need is the current command you use when compiling 2600 programs on your computer. I use this command when I'm working on Draconian

dasm draconian.asm -f3 -v0 -sdraconian.sym -ldraconian.lst -odraconian.bin

 

Then we use $n to replace instances of the source code filename with extension

dasm $n -f3 -v0 -sdraconian.sym -ldraconian.lst -odraconian.bin

 

Finally we use $c to replace instances of the source code filename without extension

dasm $n -f3 -v0 -s$c.sym -l$c.lst -o$c.bin

 

Some examples of what you might end up with:

./dasm $n -f3 -v0 -s$c.sym -l$c.lst -o$c.bin

~/dasm/dasm $n -f3 -v0 -s$c.sym -l$c.lst -o$c.bin

/usr/local/bin/dasm $n -f3 -v0 -s$c.sym -l$c.lst -o$c.bin

"c:\Program Files\Dasm\dasm.exe" $n -f3 -v0 -s$c.sym -l$c.lst -o$c.bin

 

 

 

Figure out your Interpreter Command

 

The Interpreter Command is how you launch a ROM image in Stella. On the Mac I use:

/Applications/Stella.app/Contents/MacOS/Stella draconian.bin

 

Like above, I'll use $c to replace the filename without extension

/Applications/Stella.app/Contents/MacOS/Stella $c.bin

 

Some examples of what you might end up with:

stella $c.bin

~/Stella/stella $c.bin

"c:\Program Files\Stella\Stella.exe" $c.bin

 

 

Configure jEdit

 

If you have a 2600 assembly file handy, go ahead and open it in jEdit. It'll make the following steps a little easier.

  • Select the Plugins menu
  • Select the Plugins Options... menu option
  • In the Console group select Compile & Run (click the small triangle to the left of Console if you don't see Compile & Run)
  • If it's not already, change Set compiler/interpreter for edit mode: to assembly-6502 (if you opened a 2600 assembly file, this should already be selected)
  • For Compile select Use custom command
  • fill in the custom command with your Compile Command, I used:
    dasm $n -f3 -v0 -s$c.sym -l$c.lst -o$c.bin
  • For Interpreter select Use custom command
  • fill in the custom command with your Interpreter Command, I used:
    /Applications/Stella.app/Contents/MacOS/Stella $c.bin
  • Click OK

 

blogentry-3056-0-50644600-1412036736_thumb.png

 

You should now be able to use the Toolbar buttons we added before to Compile and Run your program.

 

JEDIT NAVIGATION
<PREVIOUS> <INDEX> <NEXT>

7 Comments


Recommended Comments

I replaced the Interpreter Command with echo statements to see what's up, these are the results for each time I hit "run":

  • echo $c

    draconian

  • echo $n

    draconian.asm

  • echo $f

    /Users/darrellspice/Projects/Atari/Draconian/draconian.asm

Both $n and $f include the extension (.asm) while $c is just the root filename. As such, I suspect you're using something like this for your compile command:

dasm $n -f3 -v0 -s$n.sym -l$n.lst -o$n.bin

 

instead of this:

dasm $n -f3 -v0 -s$c.sym -l$c.lst -o$c.bin

 

What are the filenames that end up in your project's directory?

How can I compile and run a batariBasic code?

Looks like I'd gotten sidetracked due to the Houston Arcade Expo(see comments in this blog entry) and forgot to wrap up the jEdit series afterwards.

 

Based on this blog entry I had it working for ColecoVision but not batariBasic; however, I just tried a CV example and jEdit's not configured for it (a bB test didn't work either).

 

This was back when I'd just gotten my new MacPro, so I probably didn't transfer those settings over from my old MacBook Pro, which my brother now has. I did save the HDD from the MBP though, will look for it tonight after work - hopefully I had the bB configuration figured out.

Looks like I'd gotten sidetracked due to the Houston Arcade Expo(see comments in this blog entry) and forgot to wrap up the jEdit series afterwards.

 

Based on this blog entry I had it working for ColecoVision but not batariBasic; however, I just tried a CV example and jEdit's not configured for it (a bB test didn't work either).

 

This was back when I'd just gotten my new MacPro, so I probably didn't transfer those settings over from my old MacBook Pro, which my brother now has. I did save the HDD from the MBP though, will look for it tonight after work - hopefully I had the bB configuration figured out.

All right, thanks SpiceWare

All right, thanks SpiceWare

Found the drive - no bB setup for jEdit so I will need to work that out before I can post it.

 

Turns out I did have jEdit on my Mac Pro configured for ColecoVision; however, I'd renamed my edit modes and the configuration was still under assembly-z80 instead of ColecoVision assembly. I fixed it, but launching the emulator didn't work - based on the error message I think I need to install X11 support.

 

I'd renamed the 2600 mode files to Atari 2600 assembly and Atari 2600 batari BASIC. I believe I changed the names since assembly-6502 could be used for any 6502 development, so it wouldn't make sense for it to launch the 2600 emulator. Likewise launching the CV emulator wouldn't always make sense for assembly-z80.

The filenames that end up in my project's directory end in: game.bas.bin

which is why "/Applications/Stella.app/Contents/MacOS/Stella $f.bin" works for batari Basic

 

(Just reset this all up again with newest Java 1.8, and wanted to note that here.)

I replaced the Interpreter Command with echo statements to see what's up, these are the results for each time I hit "run":

  • echo $c
    draconian
  • echo $n
    draconian.asm
  • echo $f
    /Users/darrellspice/Projects/Atari/Draconian/draconian.asm
Both $n and $f include the extension (.asm) while $c is just the root filename. As such, I suspect you're using something like this for your compile command:
dasm $n -f3 -v0 -s$n.sym -l$n.lst -o$n.bin

instead of this:
dasm $n -f3 -v0 -s$c.sym -l$c.lst -o$c.bin

What are the filenames that end up in your project's directory?

 

  • Like 1
Guest
Add a comment...

×   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...