I want to conveniently point to page $0200 of RAM using a C structure for manipulating sprites. In my nes.cfg file, I've explicitly created a segment for this page. In my sprite.s file I have
Assume I have an include file for exporting the symbol.
In my sprite.h file I have:
However, I would much prefer it look like the following. Does CC65 offer a similar pragma to zpsym for saying a symbol exists in a specific segment? I have been reading the docs, but haven't spotted anything. I've only seen additional pragmas for changing what segment code is written to, but not for symbols in ram.
I searched for previous threads on this topic---only found a post by thefox concerning the understood usage of zpsym for using a zp variable in C code.
Code:
.segment "SPRITE"
_sprite_ram: .res 256
_sprite_ram: .res 256
Assume I have an include file for exporting the symbol.
In my sprite.h file I have:
Code:
typedef struct {
char y;
char tile;
char attribute;
char x;
} sprite;
#define SPRITE_RAM ((sprite*) 0x0200)
char y;
char tile;
char attribute;
char x;
} sprite;
#define SPRITE_RAM ((sprite*) 0x0200)
However, I would much prefer it look like the following. Does CC65 offer a similar pragma to zpsym for saying a symbol exists in a specific segment? I have been reading the docs, but haven't spotted anything. I've only seen additional pragmas for changing what segment code is written to, but not for symbols in ram.
Code:
extern sprite* sprite_ram;
#pragma symseg ("sprite_ram", "SPRITE") //I made this up, is there anything like this?
#pragma symseg ("sprite_ram", "SPRITE") //I made this up, is there anything like this?
I searched for previous threads on this topic---only found a post by thefox concerning the understood usage of zpsym for using a zp variable in C code.