Last year I modified pceas so that you can specify include paths via command line options. This way you can make nice Makefiles to compile your pce project I also cleaned up the option list.
You can grab the source patch [here].
The modification has been committed to the huc/pceas CVS.
Just a quick note. In order not to break people's build script, I used getopt_long_only instead of getopt_long. This let you use long options with a simple '-' (just like old pceas).
Unfortunately, this function doesn't exist undes win32 (mingw32 and co). I added getopt sources (taken from the theora project) in huc (under test/getopt). I'll run some tests tonite and post a final patch (and commit it to CVS).
Anyway, I quickly read the manual of Kick Assembler (a java c64 assembler). And it has some nice features like '*' which returns the value of the current memory location and '.align' that aligns the current rom/program offset to a given interval.
That'll be cool to have such stuffs in our beloved assembler, no?
So * would return the value of the current location? That would be nice, especially if you can add an offset to the pointer before it gets the value. The align directive sound useful as well.
Hum, it seems that pceas has some support for proto sub structure thingy. Here's what's written in the doc:
RSSET - Set the internal counter of the RS directive to a specified value.
RS - Assign a value to a symbol; a bit like EQU but here the value assigned is taken from an internal counter, and after the assignation this counter is increased by the amount specified in the RS directive. This is a very handy way of defining structure member offsets, here's a small example:
Sprite .struct
x .ds 2
y .ds 2
flag .ds 1
.ends
.zp
muscle_man .dstruct(Sprite)
clown_list .dstruct(Sprite) 8
.code
lda <muscle_man.x
cmp <clown_list[3].x
bne safe
; ...
This means that we have to perform type checks. And I don't know if it's the philosophy of pceas to be strongly typed. And if we are at it, why not check if the access are out of bound. I fear that after some iterations we end up with some kind of poor man C or ghetto Pascal.
cls
@echo off
SET EXTENSION=%~x1
SET NAME=%1
SET CHEMIN=%~dp0
SET PCE_INCLUDE=%CHEMIN%include\pce
If "%EXTENSION%"==".c" goto Compilc
If "%EXTENSION%"==".C" goto Compilc
:Compilasm
bin\pceas.exe %1
goto Fin
:Compilc
bin\huc.exe %1
bin\pceas.exe %NAME:~0,-2%.s
:Fin
With that you have not to specify your include directory.
You only must lunch your .bat in the same directory of your .c or .asm project .
ex : compil.bat toto.c or compil.bat toto.asm .
If you are using multiple projects directory, simply copy your .bat without changing anything