Jump to content

Restoring registers after RTS ok, but flags ?

Recommended Posts



I'm baffled by a nasty bug in cc65

I have a sound routine. it kind of works (i hear sound).

I use the conventional tmp1-3 pz locations for arguments.

everything is ok until I call it.

then PEEK(KBCODE); stops working! I even added a print and it returns 255.


    #define KBCODE 764 
    key=PEEK(KBCODE); // pressed key

    if(key!=255 || J!=15) {
     POKE(KBCODE,255); //clear keyboard buffer

Sound routine (included) is nothing special. the only other thing that it uses is X register, but it does not matter if I restore it or not.

Is there anything that can move the keyboard location ?

Thanks !



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...