diff options
author | B. Watson <yalhcru@gmail.com> | 2019-03-15 07:09:39 -0400 |
---|---|---|
committer | B. Watson <yalhcru@gmail.com> | 2019-03-15 07:09:39 -0400 |
commit | 2fdf74c2c6a7d0d819a601410fd8c8be0e8ea411 (patch) | |
tree | 03b2f6593a191a9d4a11b02c92cdf9159a0c5965 /src | |
parent | 48a239ff2177696f795070968f3d012a372e7dc5 (diff) | |
download | fujichat-2fdf74c2c6a7d0d819a601410fd8c8be0e8ea411.tar.gz |
cruft removal
Diffstat (limited to 'src')
-rw-r--r-- | src/getsmess.c | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/src/getsmess.c b/src/getsmess.c deleted file mode 100644 index 1a8494b..0000000 --- a/src/getsmess.c +++ /dev/null @@ -1,66 +0,0 @@ -#include <stdio.h> -#include <peekpoke.h> - - -void getlnasm(char *buf, char len) { - asm("ldy #$00"); - asm("lda (sp),y"); - asm("sta $e2"); - - asm("ldy #$02"); - asm("jsr ldaxysp"); - asm("sta $e0"); - asm("stx $e0+1"); - - asm("@loop: lda _stdin"); - asm("ldx _stdin+1"); - asm("jsr _fgetc"); - - asm("cmp #$9B"); - asm("beq @out"); - - asm("ldy #$00"); - asm("sta ($e0),y"); - asm("inc $e0"); - asm("bne @noinc"); - asm("inc $e0+1"); - asm("@noinc:"); - - asm("dec $e2"); - asm("bne @loop"); - - asm("@out:"); - asm("ldy #$00"); - asm("tya"); - asm("sta ($e0),y"); -} - -void getln(char *buf, char len) { - char *p = buf; - - do { - *p = fgetc(stdin); - if(*p == '\n') break; - } while(++p, --len); - *p = '\0'; -} - -void main(void) { - char buf[100] = "HELLO"; - while(1) { - /* - puts("gets"); - gets(buf); - puts(buf); - puts("fgets"); - fgets(buf, 99, stdin); - puts(buf); - puts("getln"); - getln(buf, 99); - puts(buf); - */ - puts("getlnasm"); - getlnasm(buf, 99); - puts(buf); - } -} |