Re: [cc65] function style macro usage

From: Spiro Trikaliotis <ml-cc651trikaliotis.net>
Date: 2009-03-15 12:39:59
Hello Tobias,

* On Sun, Mar 15, 2009 at 12:39:16AM +0100 Tobias Pflug wrote:
 
> #define setup_bg1(map,char) (map>>12|char>>8)
> lda setup_bg1($2000,$00)
> sta FOOBAR
> 
> The way I see it neither .define nor .macro are quite cut out
> for this. Is there some way this or something syntactically close? :)

You can do it exactly like this by using a C preprocessor, and feeding
its output into ca65.

For gcc, the preprocessor is in the file cpp. cpp --help gives you some
options you might want to use.

HTH,
Spiro.

-- 
Spiro R. Trikaliotis                              http://opencbm.sf.net/
http://www.trikaliotis.net/                     http://www.viceteam.org/
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sun Mar 15 12:40:20 2009

This archive was generated by hypermail 2.1.8 : 2009-03-15 12:40:23 CET