Mariano DM Posted January 15, 2023 Share Posted January 15, 2023 Hello. 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 cputcxy(0,10,key); J=PEEK(STICK0); 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 ! atari_lib.s Quote Link to comment Share on other sites More sharing options...
Mariano DM Posted January 15, 2023 Author Share Posted January 15, 2023 Weird enough. It fails in real Atari and altirra. atari 800 works good. Quote Link to comment Share on other sites More sharing options...
phaeron Posted January 15, 2023 Share Posted January 15, 2023 stx SKCTL ;init sound This is turning off keyboard debounce and/or scan, which kills the keyboard. Should be STA instead of STX. 1 1 Quote Link to comment Share on other sites More sharing options...
Mariano DM Posted January 15, 2023 Author Share Posted January 15, 2023 thank you thank you ! I passed many times the code and did not spotted. working great now ! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.