Memory Map and Code Editor

All aspects of programming on the Commander X16.
Post Reply
baardbi
Posts: 4
Joined: Sat Apr 01, 2023 10:00 am

Memory Map and Code Editor

Post by baardbi »

I want to start developing games for the X16, but I need some help to get started.

I have two questions:

1. Is there a complete memory map of the Commander X16 online somewhere? Something like the C64 one on sta.c64.org .

2. Is there something like Kick Assembler for the Sublime Text Editor for the X16. If not, is there an editor with support for the X16 assembler?
TomXP411
Posts: 1804
Joined: Tue May 19, 2020 8:49 pm

Re: Memory Map and Code Editor

Post by TomXP411 »

1. The Programmer's Reference guide that comes with the emulator should answer your questions. Everything you need for screen, sound, and input is listed in there somewhere.

There's not a "Mapping the Commander X16" document yet, because some things are still in flux. However, you can inspect the source code on the github page, and you can also use the .sym files that come with the ROM to locate symbols.

2. Yes. You can literally use Kick Assembler, Kick C, 64TASS, ca65, cc65, and other 6502 assemblers and compilers. There are actually specific X16 configurations for cc/ca65 and Kick C/Asm.

As to code editors: Visual Studio Code is popular, and I also use Notepad++ frequently. Any editor that works with Commodore 64 development will generally work for the Commander, since the assembly code is the same (just with a few more opcodes, due to the "C" in 65C02.)

Also, Natt Akuma has built a great, detailed guide here: https://ayce.dev/emptyx16.html#handshake-control

It's a more detailed in most places than the Programmer's Reference Guide, which is super helpful for things like I/O and graphics programming.

You can also check out all of our documentation and code at the Community repositories, here:
https://github.com/x16community
baardbi
Posts: 4
Joined: Sat Apr 01, 2023 10:00 am

Re: Memory Map and Code Editor

Post by baardbi »

TomXP411 wrote: Thu May 11, 2023 5:58 am 1. The Programmer's Reference guide that comes with the emulator should answer your questions. Everything you need for screen, sound, and input is listed in there somewhere.

There's not a "Mapping the Commander X16" document yet, because some things are still in flux. However, you can inspect the source code on the github page, and you can also use the .sym files that come with the ROM to locate symbols.

2. Yes. You can literally use Kick Assembler, Kick C, 64TASS, ca65, cc65, and other 6502 assemblers and compilers. There are actually specific X16 configurations for cc/ca65 and Kick C/Asm.

As to code editors: Visual Studio Code is popular, and I also use Notepad++ frequently. Any editor that works with Commodore 64 development will generally work for the Commander, since the assembly code is the same (just with a few more opcodes, due to the "C" in 65C02.)

Also, Natt Akuma has built a great, detailed guide here: https://ayce.dev/emptyx16.html#handshake-control

It's a more detailed in most places than the Programmer's Reference Guide, which is super helpful for things like I/O and graphics programming.

You can also check out all of our documentation and code at the Community repositories, here:
https://github.com/x16community
Thank you very much for that detailed reply.
User avatar
Daedalus
Posts: 232
Joined: Fri Nov 11, 2022 3:03 am

Re: Memory Map and Code Editor

Post by Daedalus »

I use ca65 as my assembler. Historically, I've used Sublime as my editor, but recently started trying out VS Code and have found... to my surprise, that it "doesn't suck." It's actually quite good once you disable a lot of it's hyperactive highlighting. I'm really not interested in paying 33 bucks a year for Sublime when it has open source competition that's just as good.

Anyway. I also use Linux exclusively (To be specific, Linux Mint Cinnamon 21.1) My tool chain is to run cl65 (Which acts as a wrapper for ca65 and links the program after all the modules are compiled.), then run the emulator with a make file in a terminal. It's very fast and only takes a second to go from editing to build to test.

I use the debugger built into the emulator (use the -debug switch when starting the emulator.) It... could be a LOT better, and I find debugging with it tedious, but it works.

If you want a good tutorial series for the Commander X16, I suggest you go to "The Retro Desk" on You-Tube. He has a series on 65c02 microprocessor programming focusing on the Commander X16, The VERA graphics adapter, and using ca65.
kelli217
Posts: 541
Joined: Sun Jul 05, 2020 11:27 pm

Re: Memory Map and Code Editor

Post by kelli217 »

Daedalus wrote: Fri May 12, 2023 2:01 amIf you want a good tutorial series for the Commander X16, I suggest you go to "The Retro Desk" on You-Tube. He has a series on 65c02 microprocessor programming focusing on the Commander X16, The VERA graphics adapter, and using ca65.
NB: That series was created at a time when the memory layout of VERA was quite different from its current state; be advised.
baardbi
Posts: 4
Joined: Sat Apr 01, 2023 10:00 am

Re: Memory Map and Code Editor

Post by baardbi »

Daedalus wrote: Fri May 12, 2023 2:01 am I use ca65 as my assembler. Historically, I've used Sublime as my editor, but recently started trying out VS Code and have found... to my surprise, that it "doesn't suck." It's actually quite good once you disable a lot of it's hyperactive highlighting. I'm really not interested in paying 33 bucks a year for Sublime when it has open source competition that's just as good.

Anyway. I also use Linux exclusively (To be specific, Linux Mint Cinnamon 21.1) My tool chain is to run cl65 (Which acts as a wrapper for ca65 and links the program after all the modules are compiled.), then run the emulator with a make file in a terminal. It's very fast and only takes a second to go from editing to build to test.

I use the debugger built into the emulator (use the -debug switch when starting the emulator.) It... could be a LOT better, and I find debugging with it tedious, but it works.

If you want a good tutorial series for the Commander X16, I suggest you go to "The Retro Desk" on You-Tube. He has a series on 65c02 microprocessor programming focusing on the Commander X16, The VERA graphics adapter, and using ca65.
Thanks! Great info.
baardbi
Posts: 4
Joined: Sat Apr 01, 2023 10:00 am

Re: Memory Map and Code Editor

Post by baardbi »

kelli217 wrote: Fri May 12, 2023 9:08 pm
Daedalus wrote: Fri May 12, 2023 2:01 amIf you want a good tutorial series for the Commander X16, I suggest you go to "The Retro Desk" on You-Tube. He has a series on 65c02 microprocessor programming focusing on the Commander X16, The VERA graphics adapter, and using ca65.
NB: That series was created at a time when the memory layout of VERA was quite different from its current state; be advised.
Thanks for the heads up.
Post Reply