Jump to content
IGNORED

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


funkheld

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
Link to comment
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

Link to comment
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
Link to comment
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
Link to comment
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

Link to comment
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 ?

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

 

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

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