Skip to content

Instantly share code, notes, and snippets.

@lucasw
Last active May 2, 2017 13:27
Show Gist options
  • Save lucasw/5ddd9a8b28ca48005bbb9291fc49f5e1 to your computer and use it in GitHub Desktop.
Save lucasw/5ddd9a8b28ca48005bbb9291fc49f5e1 to your computer and use it in GitHub Desktop.
atari 2600 with ca65

Can use ca65 (instead of dasm):

http://wiki.cc65.org/doku.php?id=cc65:atari_2600

Need vcs.h and macro.h from dasm https://github.com/munsie/dasm/tree/master/machines/atari2600 No they don't compile, just start a new vcs.inc that defines all the registers using http://www.classic-games.com/atari2600/specs.html.

Adapt http://www.randomterrain.com/atari-2600-memories-tutorial-andrew-davie-08.html assembly example to ca65.

This produces demo.o

$HOME/other/cc65/bin/ca65 -g -o demo.o demo.s -I.
$HOME/other/cc65/bin/ld65 -C atari2600.cfg -m demo.map -Ln demo.labels -vm demo.o -o demo.bin
@lucasw
Copy link
Author

lucasw commented May 2, 2017

What do dasm equivalents look like?
dasm is still on sourceforge.net, but https://github.com/munsie/dasm may be the same.

Built the test

~/other/retro/atari/dasm/test/atari2600$ ../../bin/dasm boing26.asm -f3 -I../../machines/atari2600/ -oboing26.bin -lboing26.sym -sboing26.lst

map file:

--- Symbol List (sorted by symbol)
Audc0                    0015              (R )
Audc1                    0016              (R )
Audf0                    0017              (R )
Audf1                    0018              (R )
Audv0                    0019              (R )
Audv1                    001a              (R )
BottomDelay              0090              (R )
Cart_Init                f000              (R )
ChangeNote               f2f4              (R )
CheckEgg                 f343              (R )
ColuBK                   0009              (R )
ColuP0                   0006              (R )
ColuP1                   0007              (R )
Colupf                   0008                  
Common_Init              f005                  
Ctrlpf                   000a                  
Cxblpf                   0006                  
Cxclr                    002c                  
Cxm0fb                   0004                  
Cxm0p                    0000                  
Cxm1fb                   0005                  
Cxm1p                    0001                  
Cxp0fb                   0002                  
Cxp1fb                   0003                  
Cxppmm                   0007                  
D1                       f185              (R )
DelayPTR                 008c              (R )
DemoInit                 f01e                  
DoSound                  f29c              (R )
DoVoice1                 f322              (R )
DoVoice2                 f311                  
...

sym file

------- FILE boing26.asm LEVEL 1 PASS 2
      1  10000 ????
      2  10000 ????              processor  6502
      3  10000 ????
      4  10000 ????           ; TIA (Stella) write-only registers^M
      5  10000 ????           ;^M
      6  10000 ????   00 00     Vsync      equ  $00
      7  10000 ????   00 01     Vblank     equ  $01
      8  10000 ????   00 02     Wsync      equ  $02
      9  10000 ????   00 03     Rsync      equ  $03
     10  10000 ????   00 04     Nusiz0     equ  $04
     11  10000 ????   00 05     Nusiz1     equ  $05
     12  10000 ????   00 06     ColuP0     equ  $06
     13  10000 ????   00 07     ColuP1     equ  $07
     14  10000 ????   00 08     Colupf     equ  $08
     15  10000 ????   00 09     ColuBK     equ  $09
     16  10000 ????   00 0a     Ctrlpf     equ  $0A
     17  10000 ????   00 0b     Refp0      equ  $0B
     18  10000 ????   00 0c     Refp1      equ  $0C
     19  10000 ????   00 0d     Pf0        equ  $0D
     20  10000 ????   00 0e     Pf1        equ  $0E
     21  10000 ????   00 0f     Pf2        equ  $0F
     22  10000 ????   00 10     RESP0      equ  $10
...

@lucasw
Copy link
Author

lucasw commented May 2, 2017

Stella debugger expects file names like Boing! (PD) [a1].lst - where does that name come from, it isn't in the test dir?

mv boing26.sym "Boing! (PD) [a1].sym"
mv boing26.lst "Boing! (PD) [a1].lst"

Now it loads them, but there is no cfg file.
Also don't see any difference in dissassembly window- I thought it would use the names for address from the assembly instead of ram_80 etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment