snescom demo wont compile on windows

Discussion of hardware and software development for Super NES and Super Famicom.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
Post Reply
LittleRain
Posts: 30
Joined: Mon Aug 20, 2018 10:08 pm

snescom demo wont compile on windows

Post by LittleRain » Wed Sep 16, 2020 10:11 pm

I'm trying to learn assembly on the snes, I followed a tutorial which gives a blank screen (SNES Assembly Adventure), and it uses the ca65 compiler.
But I just found out about bisqwits snescom which uses xa65 and it seems to be the way to go.

Problem is I cannot get anything to compile, I've tried to compile his demo, as well as SD2SNES and they both seem to fail when compiling reset.o65.

I should note, that I was not able to compile Snescom from bisqwits website, but was able to compile this one from github. https://github.com/manz/snescom


This is the console output when trying to compile the demo, and I really don't know what to do, it should just compile.
I appreciate any help anyone can give me.

Code: Select all

make
snescom -J -Wall -o reset.o65 reset.a65 >> o65.log
Error: What is '; This file is part of the snescom-asm demo - a demo of how to build a SNES program.' - previous token: ''? (0)
Error: What is '; See http' - previous token: ''? (1)
Error: What is '//bisqwit.iki.fi/source/snescom.html for details.' - previous token: ''? (1)
Error: What is '(((addr & $FC00) >> 8) + scsize)' - previous token: ''? (6)
Error: What is '(((addr & $F000) >> 12) | (((addr2 & $F000) >> 12) << 4))' - previous token: ''? (7)
Error: What is '; NMI - called once per screen refresh (or something like that)' - previous token: ''? (9)
Error: What is '; IRQ - called when triggered (which is..?)' - previous token: ''? (19)
Error: '$4211  ;Acknowledge irq' is invalid parameter for 'lda' in current context (0 choices). (22)
Error: What is '; To be called regularly - updated screen contents' - previous token: ''? (25)
Error: What is '; Sends the palette structure to PPU' - previous token: ''? (45)
Error: '$4300  ;dma type' is invalid parameter for 'sta' in current context (0 choices). (48)
Error: '$4301  ;address $2122' is invalid parameter for 'sta' in current context (0 choices). (49)
Error: '$4305 ; size' is invalid parameter for 'stx' in current context (0 choices). (54)
Error: What is '16*2*16 bytes.' - previous token: ''? (54)
Error: '$2121  ;Write CGRAM address (0)' is invalid parameter for 'sta' in current context (0 choices). (56)
Error: '$420B  ;Activate dma 0' is invalid parameter for 'sta' in current context (0 choices). (58)
Error: What is '; Sends the video buffer contents to PPU' - previous token: ''? (61)
Error: '$2116  ;Write VRAM address' is invalid parameter for 'sty' in current context (0 choices). (63)
Error: '$4304 ;Write DMA address' is invalid parameter for 'sta' in current context (0 choices). (65)
Error: '$4305             ;Write size' is invalid parameter for 'stx' in current context (0 choices). (66)
Error: '$2115  ;PPU programming' is invalid parameter for 'sta' in current context (0 choices). (68)
Error: '$4300  ;dma type' is invalid parameter for 'sta' in current context (0 choices). (70)
Error: '$4301  ;address $2118' is invalid parameter for 'sta' in current context (0 choices). (71)
Error: '$420B  ;Activate DMA 0' is invalid parameter for 'sta' in current context (0 choices). (73)
Error: What is '; Jumped to from snesheader.a65 - when the game is reseted.' - previous token: ''? (81)
Error: What is '; A = 0' - previous token: ''? (89)
Error: '$420D ; set "fast" mode' is invalid parameter for 'sta' in current context (0 choices). (94)
Error: What is '; Next initialize screen' - previous token: ''? (96)
Error: What is ';lda #$17' - previous token: ''? (103)
Error: '$212C ; put screens on' is invalid parameter for 'sta' in current context (0 choices). (105)
Error: '$212D ; put screens on' is invalid parameter for 'sta' in current context (0 choices). (106)
Error: '$4210 ;' is invalid parameter for 'lda' in current context (0 choices). (124)
Error: '$2105 ; select screen mode 1.' is invalid parameter for 'sta' in current context (0 choices). (136)
Error: What is '; Set scrolling to 0,0 to all bgs' - previous token: ''? (148)
Error: Near jump out of range (-12578819)
Error: Near jump out of range (-12582659)
Labels in the TEXT segment:
 C0000F IRQ_ROUTINE
 C000B2 InitializeIRQ
 C000CC InitializeScreen
 C00012 IrqStuff
 C00000 NMI_ROUTINE
 C00062 PaletteDMA
 C00085 RESET_GAME
 C00079 VRAMdma
Labels in the  BSS segment:
 C01000 PALETTE_ADDRESS
 C00000 Stack
Externs in the TEXT segment:
 001F ^BG1_BMAP_ADDR
 0021 !BG1_BMAP_ADDR
 0027 ^BG2_BMAP_ADDR
 0029 !BG2_BMAP_ADDR
 002F ^BG3_BMAP_ADDR
 0031 !BG3_BMAP_ADDR
 0037 ^BG4_BMAP_ADDR
 0039 !BG4_BMAP_ADDR
 0042 ^BG1_TILE_ADDR
 0044 !BG1_TILE_ADDR
 004A ^BG2_TILE_ADDR
 004C !BG2_TILE_ADDR
 0052 ^BG3_TILE_ADDR
 0054 !BG3_TILE_ADDR
 005A ^BG4_TILE_ADDR
 005C !BG4_TILE_ADDR
 00AF @GAME_MAIN
 00E3 <TILE_ADDR_REG_VAL
 00E8 <TILE_ADDR_REG_VAL
 00ED <TILE_ADDR_REG_VAL
 00F2 <TILE_ADDR_REG_VAL
 00F7 <BMAP_ADDR_REG_VAL
 00FC <BMAP_ADDR_REG_VAL
make: *** [reset.o65] Error 1

calima
Posts: 1186
Joined: Tue Oct 06, 2015 10:16 am

Re: snescom demo wont compile on windows

Post by calima » Thu Sep 17, 2020 2:02 am

This doesn't help your issue, but you should know ca65 is "production ready" quality on the SNES, while wla-dx has many reported problems, and I've never even heard of snescom.

none
Posts: 38
Joined: Thu Sep 03, 2020 12:56 am

Re: snescom demo wont compile on windows

Post by none » Thu Sep 17, 2020 2:11 am

I don't know snescom, but I have looked into your issue.

It seems snescom is using the gcc preprocessor for preprocessing files. Before sending the file to gcc, it does its own "precompiling" step where among other things it replaces all the semicolons for comments with C-stytle "//" comments.

In the github version, it never seems do do that step.

https://github.com/manz/snescom/blob/ma ... om/main.cc line 210

Code: Select all

/* Just do the assembly leave the preprocessing to gpp */
        AssemblePrecompiled(fp ? fp : stdin, obj);
#if 0
        if(assemble)
            PrecompileAndAssemble(fp ? fp : stdin, obj);
        else
            Precompile(fp ? fp : stdin, output ? output : stdout);
#endif      
This would explain the errors you are getting.

I would also recommend using ca65 instead, btw.

User avatar
Nikku4211
Posts: 102
Joined: Sun Dec 15, 2019 1:28 pm
Location: Bronx, New York
Contact:

Re: snescom demo wont compile on windows

Post by Nikku4211 » Thu Sep 17, 2020 8:27 am

Bruh just use CA65 and LibSFX.

That's what I did.
I have an ASD, so empathy is not natural for me. If I hurt you, I apologise.

LittleRain
Posts: 30
Joined: Mon Aug 20, 2018 10:08 pm

Re: snescom demo wont compile on windows

Post by LittleRain » Thu Sep 17, 2020 10:12 pm

Ok thanks guys, you all convinced me, I'll use ca65 for my project.

I found out that SD2SNES uses snescom so I figured it was the current standard.
Still though I want to get SD2SNES to compile, I have all the components to make one.
The github for SD2SNES seems to be a pretty old version, but oh well.

Can you guys recommend any documentation for ca65?
And I've been trying to find some examples for displaying text on a screen, anyone know of any?
none wrote:
Thu Sep 17, 2020 2:11 am

It seems snescom is using the gcc preprocessor for preprocessing files. Before sending the file to gcc, it does its own "precompiling" step where among other things it replaces all the semicolons for comments with C-stytle "//" comments.
Thanks a lot man!
That's exactly what I needed, it should compile once I get the original Snescom to.

User avatar
Nikku4211
Posts: 102
Joined: Sun Dec 15, 2019 1:28 pm
Location: Bronx, New York
Contact:

Re: snescom demo wont compile on windows

Post by Nikku4211 » Fri Sep 18, 2020 8:38 am

LittleRain wrote:
Thu Sep 17, 2020 10:12 pm
Can you guys recommend any documentation for ca65?
https://cc65.github.io/doc/ca65.html
I have an ASD, so empathy is not natural for me. If I hurt you, I apologise.

Post Reply