Re: [cc65] Simple PEEK & POKE question.

Date view Thread view Subject view

From: groepaz (groepaz_at_gmx.net)
Date: 2001-03-04 00:02:23


Hello Raj,

Saturday, March 03, 2001, 10:37:53 PM, you wrote:

RW> Hello All!

RW> I'm familiar with standard ANSI C & C++ programming and would like to write
RW> some programs for the C64 and C128 but I see that a lot of the "cool"
RW> functions require PEEKs and POKEs.  For example on a C64:

RW> POKE 199,1

RW> will change the output to reverse video.  How would you do this with cc65?

i for myself had been using 2 simple macros when i was starting c
programming...

#define poke(_m,_v) *((unsigned char*)_m)=((unsigned char)_v)
#define peek(_m)    (*((unsigned char*)_m))

so you could do stuff simelar to

poke(198,0);
while(peek(198)==0){
 poke(53280,peek(53280)+1)
};

.... you get the idea ;=)



-- 
Best regards,
 groepaz                            mailto:groepaz_at_gmx.net


----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2001-12-14 22:05:39 CET