Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit)

I'm no 6502 guru. Does adding u8 and i8 really need 16 bit ops?

  0000 0011 ($03 = +3) 
+ 1111 1111 ($FF = -1)

Expected result +2

Or maybe there's some way to do INC and DEC (x++ isn't very BASIC-esque, though.)

BTW another nice-to-have would be expression-based consts.
const TILE_COLUMNS_LESS_1   = TILE_COLUMNS - 1  '21

I guess the bouncing letter thing could also be done in all i8 since 0-23 are well under 128. But then you'd need some kind of casting system for passing these to TILE_PLOT() or CELL_PUTC().

(1 edit) (+1)

Casting is on my TODO list

(4 edits) (+1)

Definitely not required, but the compiler is general purpose and pretty conservative right now (I try and get it correct and then optimize) and uses a 16 bit temporary there to avoid guessing wrong when signed and unsigned values mix as it doesn't always fit when doing the math.    You were + / - 1 so that's a specific case that should be optimized later in the pipeline, I will work on that.

I like your idea of INC(#) / DEC(#)  for "in place" updates.  And yup, I agree, the --/++ is a C thing, not BASIC.   :)

Expression based CONSTs are supported but TILE_COLUMNS was a no arg accessor PROC.  I've updated it (and some others) to be read-only scalars so you can use the initializer you mentioned (and a compiler error will happen when attempting to use a PROC in a const expr initializer).