From: Mike McCarty (jmccarty_at_ssd.usa.alcatel.com)
Date: 2001-03-05 18:16:27
On Sat, 3 Mar 2001, Raj Wurttemberg wrote:
> Hello All!
>
> I'm familiar with standard ANSI C & C++ programming and would like to write
> some programs for the C64 and C128 but I see that a lot of the "cool"
> functions require PEEKs and POKEs. For example on a C64:
>
> POKE 199,1
>
> will change the output to reverse video. How would you do this with cc65?
Many people write peek(addr) and poke(addr,val). I do not like that,
as C provides all the tools necessary.
I assume that POKE 199,1 puts a byte with value 1 to location decimal
199. The technique I prefer to use in C is something like this:
#include "video.h"
...
VideoMode = VIDEO_REVERSE;
...
the file video.h would look something like this:
#define VIDEO_REVERSE 1
#define VideoMode (*(unsigned char *)199)
Mike
----
char *p="char *p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
This message made from 100% recycled bits.
I can explain it for you, but I can't understand it for you.
I don't speak for Alcatel <- They make me say that.
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
This archive was generated by hypermail 2.1.3 : 2001-12-14 22:05:39 CET