Jump to content
IGNORED

Xcode Template for DASM VCS


collinp

Recommended Posts

Once upon a time there was a Mac OS X Xcode template for VCS development. Unfortunately time seems to have passed the VCS templates by. I couldn't even check them out. They are behind broken links and reportedly don't work with modern Xcode releases anyway.

 

So I made a new template. The goal is to streamline my experimentation with 2600 programming, but it could be useful for others so I thought I'd share it here. I make no guarantees about how well it will work on your particular setup or any promises that I will update it in the future.

 

Contents

 

The template generates a simple project containing :

 

main.s

The main assembly file. Any additional files should be incorporated into main.s through include statements. This is the only file that is passed to dasm. The main.s default code is based on Andrew Davie's "Our First Kernel" though somewhat cleaned up with loops instead of repeated statements. It should give a solid blue screen when run.

 

dasm, vcs.h and macro.h

These files are embedded in the template and will be copied into any projects generated with this template. Any globally installed dasm or include files will be ignored in favor of these project specific ones. I like this approach because all the files necessary to generate the binary are embedded in the project. If I want to move this to another machine or build it years from now I do not have to recreate the build environment to make it work. Other's may want to use their globally installed dasm and in that case it shouldn't be too hard to hack the makefile.

 

Makefile

A dead simple makefile to kick off dasm. It will use your standard Xcode settings for project name and build location. The Xcode build destination is by default deep inside ~/Library/Developer/Xcode/DerivedData/ Considering that directory is hidden by default it seems like a weird place to put builds. I usually change my build destination to something more accessible and the makefile will honor those settings.

 

Usage

 

Unzip the archive and put the whole Atari folder into ~/Library/Developer/Xcode/Templates/ If you are using the GUI hold down the option key when opening the Go menu and a "Library" option will appear allowing you to access the Library folder.

 

Now you can chose the Atari VCS template when you create a new project in Xcode.

 

There doesn't seem to be a way to configure schemes through project templates so one more step is necessary if you want to auto launch your ROM in Stella.

Choose menu : Product -> Scheme -> Edit Scheme...

Select Run item from list on the left
In the Info tab's Executable popup menu choose Other...
Navigate to the Stella app and choose it
In the Arguments tab add an argument with the value including the quotes of "$(BUILT_PRODUCTS_DIR)/$(PRODUCT_NAME).bin"
Once you have setup Stella as the executable you can build and run from within the Xcode GUI and Stella will be launched with your changes.
I have used this template a bunch on Xcode 6. In brief testing it does appear to be compatible with Xcode 7 as well.
Even if this template doesn't create projects exactly how you wish, hopefully it will still be valuable as a starting point to configure Xcode as desired for VCS development.
Edited by collinp
Link to comment
Share on other sites

Hadn't considered Xcode for 2600 development before (other than making changes to Stella of course). Can it be set up for syntax highlighting like I've done for jEdit? One thing I really like is how I set it up so binary numbers are colorized to make any graphic shapes easy to see:

attachicon.gifScreen Shot 2015-08-31 at 8.27.22 AM.png

 

Nice highlighting!

 

.s files will get some generic assembly highlighting by default but nothing quite so fancy as what you've done.

 

In theory more sophisticated highlighting is possible using xclangspec files though I haven't given it a shot. Xcode is a very purpose built IDE focused on iOS and Mac development so it's extensibility is not the greatest. Well, at its core it's clearly very extensible, but much of that functionality is buried deep in system files and often undocumented.

 

I spend a lot of time in Xcode so it's nice to have my Atari experiments use a familiar IDE. It's also a free IDE which may be appealing to newcomers. I would guess those with established workflows will probably want to stick with what they've got.

 

- Collin

Link to comment
Share on other sites

  • 1 year later...
  • 2 years later...

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