CaptMatteus Posted March 2, 2021 Share Posted March 2, 2021 (edited) I needed to do some keyboard input, and given that all the books I have list all the various keyboard codes in decimal and not hex, I scratched my itch. My program opens the K: keyboard device and shows the various codes for each key pressed. It's a toy, and certainly not perfect, but I wanted to explore CIO and keyboard input in assembly. KeyTest.s KeyTest.xex Edited March 2, 2021 by CaptMatteus grammar 2 1 Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted March 2, 2021 Share Posted March 2, 2021 seems to be a lot of garbage at the top of the screen, also doesn't show any text for "SPACE BAR" nor inverse characters Quote Link to comment Share on other sites More sharing options...
CaptMatteus Posted March 2, 2021 Author Share Posted March 2, 2021 (edited) Interesting. I tested on my 800XL and the Atari800MacX emulator without any problem. I have not run it on Altirra. I do want to try on my 800 as well, because it has the Atari key. Edited March 2, 2021 by CaptMatteus Quote Link to comment Share on other sites More sharing options...
CaptMatteus Posted March 2, 2021 Author Share Posted March 2, 2021 I also tested on my Incognito-equipped Atari 800 (what a fabulous piece of hardware BTW) against most of the OSes. I had no problems against a Stock OS-B 48K machine, Altirra OS, XL/XE 64K and AXLON 1088, all were good. I wonder what is causing the problem on Altirra? Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted March 2, 2021 Share Posted March 2, 2021 2 hours ago, CaptMatteus said: I wonder what is causing the problem on Altirra? I figured it out, you are using a custom display list and are not making sure the screen area is cleared, so if you've run anything before using this and it used that memory area, it's still there and will display. I compiled your code using MAC65, it ran ok, but I had a full screen of garbage, I went into BUG65 cleared $9000-$9400, ran it again and it was fine. 1 Quote Link to comment Share on other sites More sharing options...
CaptMatteus Posted March 2, 2021 Author Share Posted March 2, 2021 (edited) 30 minutes ago, TGB1718 said: I figured it out, you are using a custom display list and are not making sure the screen area is cleared, so if you've run anything before using this and it used that memory area, it's still there and will display. I compiled your code using MAC65, it ran ok, but I had a full screen of garbage, I went into BUG65 cleared $9000-$9400, ran it again and it was fine. Ahh, totally makes sense. So I can add a little code to clear out the screen memory and then it'll be good to go. I love feedback, it (nearly) always makes me a better programmer. I certainly do not claim to be ANY sort of expert on the Atari platform. So, much appreciated. Edited March 2, 2021 by CaptMatteus 1 Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted March 2, 2021 Share Posted March 2, 2021 Clear won't do it on it's own, you have the text loaded directly into the screen memory, so a clear clears it too. I changed your code like this:- comment out the *= and add labels ; *= $9008 C1 .SBYTE "CHARACTER INPUT TESTER" .BYTE 255 ; END OF STRING FOR LOOP TEST ; *= $92D0 C2 .SBYTE "ATASCII: H( ) DISPLAY: H( )" .BYTE 255 ; END OF STRING FOR LOOP TEST ; *= $92A8 C3 .SBYTE "RAW: H( )" .BYTE 255 ; END OF STRING FOR LOOP TEST then added the following code just after the dlist is set. LDX #0 ; CLS TXA CLSLOOP STA $9000,X STA $9100,X STA $9200,X STA $9300,X INX BNE CLSLOOP LDX #0 ; TEXT STRINGS TO SCREEN XLOOP LDA C1,X BMI N1 STA $9008,X INX JMP XLOOP N1 LDX #0 XLOOP1 LDA C2,X BMI N2 STA $92D0,X INX JMP XLOOP1 N2 LDX #0 XLOOP2 LDA C3,X BMI N3 STA $92A8,X INX JMP XLOOP2 ; FOR GRAPHICS MODE 0, WE CAN SET THE BACKGROUND COLOR AND A FOREGROUND LUMINANCE ; WHEICH HERE WILL BE THE TEXT COLOR N3 LDA #$00 ; MODE 0 BACKGROUND COLOR 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.