Jump to content
RetroCoder

Modern tool chain for 8bit development

Recommended Posts

Posted (edited)

I started back into 6502 assembler after a good 30+ years and wanted to use the tools I'm familiar with. That is VS Code as the editor. ATasm was the assembler of choice and Altirra the emulator.

Now getting back into learning some 6502 had me dumping hex codes on the screen until I found out that Altirra has a nice debugger.  Still I had no easy way of finding my code in the disassembly view, so I was padding the points of interest with nops etc.

There had to be a better way. I found some topics here talking about debugging options in Altirra but there was no guide or documentation (none that I could find).  At least the source code for Altirra is available and after getting it to compile and running, I managed to figure out the file format to get source level debugging to work.

I modified ATasm to generate the required symbol and list files so that Altirra could load them. Then I wrote a VSCode extension to bring it all together.  

 

Now I can write my asm code, set a breakpoint in VSCode and launch the debugger and have it stop where I want it.

 

The extension is called Atasm Altirra Bridge

https://marketplace.visualstudio.com/items?itemName=cerebus.atasm-altirra-bridge

Edited by RetroCoder
added tags
  • Like 13

Share this post


Link to post
Share on other sites

This looks great! VSCode is cross-platform, so the syntax highlighting should at least work on other systems. When I get a chance I will try it on linux and see if I can start the atari800 emulator by setting the altirra.path variable to point to atari800.

Share this post


Link to post
Share on other sites
28 minutes ago, playermissile said:

This looks great! VSCode is cross-platform, so the syntax highlighting should at least work on other systems. When I get a chance I will try it on linux and see if I can start the atari800 emulator by setting the altirra.path variable to point to atari800.

The code is available on Github so a pull request would be great.  Let get this cross-platform

Share this post


Link to post
Share on other sites
2 hours ago, RetroCoder said:

The code is available on Github so a pull request would be great.  Let get this cross-platform

I don't know typescript but your code looks clean and easy to follow. Long learning curve ahead from me, but it's possible that I might be able to contribute something eventually.

Share this post


Link to post
Share on other sites

I added a Linux version of ATasm 1.11 in version 1.1.0 of the extension.  Should at least be able to assemble your code under Linux now.  I tried running Altirra under wine under WSL2 on Win10 (hmm a bit much there) and did not get it to work, but it should work running on a Linux machine

  • Like 1

Share this post


Link to post
Share on other sites

Thought I'd give it a try on MacOS (yeah, I know Altirra doesn't run under MacOS), and can't get it to compile. I set a custom path for atasm in the settings (in my case '/usr/local/bin/atasm'), but it doesn't want to use that setting, seems fixed to trying to use the Linux path:

 

"atasm-altirra-bridge.assembler.atasmPath": "/usr/local/bin/atasm"

Starting build ...
-oout/b-ring.xex -lout/b-ring.lab -gout/b-ring.lst "b-ring.asm"
/bin/sh: /Users/john/.vscode-exploration/extensions/cerebus.atasm-altirra-bridge-1.1.0/bin/darwin/x64/atasm: No such file or directory
Exit code: 127

I wish there was a MacOS version of Altirra, or at least one of the Mac emulators would work (Atari800MacX would be awesome!)

Share this post


Link to post
Share on other sites
Posted (edited)

I just put a link to my already installed atasm in ~/.vscode/extensions/cerebus.atasm-altirra-bridge-1.0.0/out/bin. That got it going. But since my version of atasm does not support the new debug code(-g switch) I had to change this: "withDebug": false.

 

you should be able to do a

ln -s `which atasm` /Users/john/.vscode-exploration/extensions/cerebus.atasm-altirra-bridge-1.1.0/bin/darwin/x64

and then you can change the altirra path to use atari800, now clicking the rocket builds it and pops it up on atari800.

 

Edited by invisible kid

Share this post


Link to post
Share on other sites
14 hours ago, tsom said:

Thought I'd give it a try on MacOS (yeah, I know Altirra doesn't run under MacOS), and can't get it to compile. I set a custom path for atasm in the settings (in my case '/usr/local/bin/atasm'), but it doesn't want to use that setting, seems fixed to trying to use the Linux path:

 

"atasm-altirra-bridge.assembler.atasmPath": "/usr/local/bin/atasm"

Starting build ...
-oout/b-ring.xex -lout/b-ring.lab -gout/b-ring.lst "b-ring.asm"
/bin/sh: /Users/john/.vscode-exploration/extensions/cerebus.atasm-altirra-bridge-1.1.0/bin/darwin/x64/atasm: No such file or directory
Exit code: 127

I wish there was a MacOS version of Altirra, or at least one of the Mac emulators would work (Atari800MacX would be awesome!)

Thank you for testing the extension on MacOS.  I don't have a mac to try it on, but will make a plane to get the latest version of ATasm into the extension.

 

At for it using the linux path,  yes that is a bug. I'll fix it and release a new version asap.

Share this post


Link to post
Share on other sites

This sounds incredible. I have it similar with my daytime job programming, using a debugger with 4D that takes me through each line.

 

Would it be difficult for someone to convert this to MADS? I have a level of debugging with Mads and Altirra but not from vsCode. I won't volunteer, too many projects on the go...!
 

Share this post


Link to post
Share on other sites

Version 1.2.0 of the extension has been released.

- Better integration of the ATasm assembler
- Fixed a bug that reset the path to be always the Windows path of the atasm
- Build Task now also works when 'atasm-build.json' is the currently open file
- Added configuration options to allow for another emulator to be used
  - Set the ownEmulator setting and supply the path and arguments
  - The extension will not add any parameters. You will need to supply them in the correct format.

 

With this release you can specify a different emulator.  The readme had some instructions.  

Should now be able to run any emulator.  You just have to supply the arguments

 

I'll have to find a Mac with a dev environment on it to get atasm v1.11 compiled, then I can have the extension Windows/Linux/MacOS compatible

 

Happy debugging

  • Like 1

Share this post


Link to post
Share on other sites
3 hours ago, RetroCoder said:

Version 1.2.0 of the extension has been released.

- Better integration of the ATasm assembler
- Fixed a bug that reset the path to be always the Windows path of the atasm
- Build Task now also works when 'atasm-build.json' is the currently open file
- Added configuration options to allow for another emulator to be used
  - Set the ownEmulator setting and supply the path and arguments
  - The extension will not add any parameters. You will need to supply them in the correct format.

 

With this release you can specify a different emulator.  The readme had some instructions.  

Should now be able to run any emulator.  You just have to supply the arguments

 

I'll have to find a Mac with a dev environment on it to get atasm v1.11 compiled, then I can have the extension Windows/Linux/MacOS compatible

 

Happy debugging

Excellent! I’ll give it a test. As long as it uses the setting and picks up my install of atasm, having it bundled isn’t a huge issue.

 

thanks!

Share this post


Link to post
Share on other sites
Posted (edited)

I'm happy to report that I am able to assemble and run a program using this extension on MacOS, using my own install of atasm. (It's only version 1.10, will have to update...) Debugging doesn't work, obviously, due to running in Atari800MacX, which doesn't understand the Altirra debugging stuff. But some success!

 

Actually, I originally had the path to Atari800MacX in the "Altirra: Path" setting and that seemed to work - it added the compiled file as an argument. However, I noticed the new "Own Emulator" flag and path, so I set that up, but while it launches the emulator, it doesn't pass the name of the compiled file. How do I add that as a parameter?

Edited by tsom

Share this post


Link to post
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.

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