Jump to content
funkheld

Kickc-case: "A" = 63 "" B "= 21?

Recommended Posts

Hi good afternoon.

where please can I find the character set for the "case" from kickc?

Kickc-case: "A" = 63 "..." B "= 21?

 

 

Thank you.
greeting

 

#pragma encoding(atascii)
#pragma zp_reserve(0x00..0x7f)

#include <string.h>
#include <stdlib.h>

char * const CH = 0x2FC;
void * CIOV     = 0xE456;

struct ATARI_IOCB {
    char ICHID;
    char ICDNO;
    char ICCOM;
    char ICSTA;
    char* ICBA;
    char* ICPT;
    char* ICBL;
    char ICAX1;
    char ICAX2;
    char ICAX3;
    char ICAX4;
    char ICAX5;
    char ICAX6;
};

struct ATARI_IOCB * const IOCB0 = 0x340;

void main() {
  while (1) {
    *CH = 0xff;

     while(*CH == 0xff) ;
       char keyPressed = *CH;

       switch(keyPressed) {
         case 63: print("pebi-63\n");
         break;
         case 21: print("pebi-21\n");
         break;
         default: print("nix\n");
         break;
    }
  }
}

void printc(char c) {
  char buffer[20];
  memset(buffer, 0, 20);
  utoa(c, buffer, HEXADECIMAL);
  print(buffer);
}

void cputln() {
  print("\n");
}

void print(char* message) {
  char *p = message;
  
  while (*p != 0) {
    if (*p == '\n') *p = 0x9b;
    p++;
  }
  
  IOCB0->ICCOM = 0x0b; 
  IOCB0->ICBA  = message;
  IOCB0->ICBL  = strlen(message);
  asm {
    ldx #0   
    jmp CIOV 
  }
}

Edited by funkheld

Share this post


Link to post
Share on other sites
2 hours ago, funkheld said:

Hi good afternoon.

where can I find the character set for the "case" from kickc?

Kickc-case: "A" = 63 "" B "= 21?

you can check value of the pressed key to find it yourself

Edited by ilmenit

Share this post


Link to post
Share on other sites
2 hours ago, funkheld said:

where please can I find the character set for the "case" from kickc?

Kickc-case: "A" = 63 "..." B "= 21?

 ldy $02fc
 lda ($79),y
 
 A = atascii code of pressed key

 

you're welcome

Share this post


Link to post
Share on other sites
41 minutes ago, xxl said:

 ldy $02fc
 lda ($79),y
 
 A = atascii code of pressed key

 

you're welcome

Do you know if that works on OS-B?

  • Like 1
  • Haha 1

Share this post


Link to post
Share on other sites
1 hour ago, Wilheim said:

Do you know if that works on OS-B?

I do not think so :(

The reference operating system is that shipped with XL / XE / XEGS computers. (if you write for Windows10, will you keep Windows95 compatible?)

  • Haha 2

Share this post


Link to post
Share on other sites
1 hour ago, zbyti said:

As long as you keep responding in new threads, he will create them - simple as that.

Isn’t it more organized to have a thread per question ? I’m wondering why would all the questions about X should be on one thread ? or maybe is better? I’m not arguing — Just curious. 

  • Confused 1

Share this post


Link to post
Share on other sites
1 hour ago, fenrock said:

Hey @funkheld, this has nothing to do with kickc, it's a system value.

I googled "atari internal key code CH" and found this page: https://atariwiki.org/wiki/Wiki.jsp?page=CH

which has a nice table of values.

I have recently typed in a similar table: https://github.com/ivop/pokey-explorer/blob/master/scancodes.s

Share this post


Link to post
Share on other sites
5 hours ago, ilmenit said:

you can check value of the pressed key to find it yourself

Just like this

 

10 CH=764
20 POKE CH,255
30 A=PEEK(CH):IF A=255 THEN 30
40 ? A
50 GOTO 20

Share this post


Link to post
Share on other sites
2 hours ago, Wilheim said:

Do you know if that works on OS-B?

Will it break on an Ultimate 1MB equipped machine?

Share this post


Link to post
Share on other sites
6 minutes ago, funkheld said:

I didn't know the table for CH.

of course, the address is here: KEYDEF = 79.7A ($ FB51) you don't need any external arrays and the idea of checking is bizarre

 

3 minutes ago, Stephen said:

Will it break on an Ultimate 1MB equipped machine?

try to run SynFile + on a computer with U1MB you will find out 🙂

Share this post


Link to post
Share on other sites
44 minutes ago, funkheld said:

I didn't know the table for CH.

@ivop and @fenrock have given you links to sites that show you the conversion codes or just use the

BASIC program I gave you to look them up yourself

Share this post


Link to post
Share on other sites
2 hours ago, Blues76 said:

Isn’t it more organized to have a thread per question ? I’m wondering why would all the questions about X should be on one thread ? or maybe is better? I’m not arguing — Just curious. 

Not in this case ;) This guy have a long history of asking the same questions over and over without noticeable progress in understanding A8 hardware. Looks like he thinks that programming language is the key to his problems, he tried more programming languages on A8 then me and came to conclusion: "all of them are bad" ;) 

Edited by zbyti
typo
  • Like 1
  • Haha 1

Share this post


Link to post
Share on other sites
12 minutes ago, zbyti said:

This guy have a long history of asking the same questions over and over without noticeable progress in understanding A8 hardware.

maybe take care of your own life and let others progress at their own pace :)

  • Like 1

Share this post


Link to post
Share on other sites
46 minutes ago, xxl said:

maybe take care of your own life and let others progress at their own pace :)

If you say so... Who will teach @funkheld better then you? :]

Edited by zbyti
typo
  • Like 1
  • Haha 1

Share this post


Link to post
Share on other sites
1 hour ago, xxl said:

maybe take care of your own life and let others progress at their own pace :)

Of course we take care of our own lives, but that guy really annoys me and some others, too. I have nothing against his learning course and its progress (if we can call it so), but he keeps up with spaming this forum with continuing (similar) questions. That is why I created a topic for him, but he ignores it. I really don't know what funkheld wants to accomplish. He just drive himself between various languages and keep asking very basic stuff.

 

  • Like 1

Share this post


Link to post
Share on other sites

and what? moreover, probably not so basic, since some of the answers reveal an even lower level of knowledge. if you are annoyed by his questions, do not read them.

Share this post


Link to post
Share on other sites
5 hours ago, Wilheim said:

Do you know if that works on OS-B?

The whole method is not recommended since the keyboard table and its interpretation is system dependent. You can check whether a key is pressed, but to find out which key is pressed, use the K: handler. That is, along the lines:

10 OPEN #1,4,0,"K:"

20 IF PEEK(764) = 255 THEN REM NO KEY PRESSED

20 GET #1,A:REM NOW THAT IS THE KEY

This way, the operating system is responsible for the translation, which is a portable solution. The above would work irrespectively of the Os version.

 

Share this post


Link to post
Share on other sites
11 minutes ago, zbyti said:

more to come, no worry ;) 

I think you misunderstood my comment. He actually is progressing. Look at his code in that thread. It's far from perfect, but a lot better than before. And practice....

 

And maybe, one day, we can convince him to not spam the forum with new threads every other day ;)

 

  • Like 1

Share this post


Link to post
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.

Guest
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.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...