8bitworkshop icon indicating copy to clipboard operation
8bitworkshop copied to clipboard

C64 - inverted character case, no output from printf format specifiers

Open xp5-org opened this issue 2 years ago • 0 comments

printf , cprintf do not print the contents using format specifiers on 8bitworkshop, and printed text has its case inverted . i have an example code which works when compiled from cc65 and uploaded to 8bitworkshop, but fails to print values using format specifiers if i input C code into 8bitworkshop and let it compile in-browser

Example code:

#include <stdio.h>
#include <conio.h>

int main(void) {
    int number = 11; 
    char string[] = "Hello, World!";

    printf("PRINTF - number is: %d\n\r", number);
    cprintf("CPRINTF - number is: %d\n\r", number);
    printf("PRINTF - string is: %s\n\r", string);
    cprintf("CPRINTF - string is: %s\n\r", string);
    printf("PRINTF - first char is: %c\n\r", string[1]);
    cprintf("CPRINTF - first char: %c\n\r", string[1]);
    return 0;
}

What should be printed:

PRINTF - number is: 11
CPRINTF - number is: 11
PRINTF - string is: Hello, World!
CPRINTF - string is: Hello, World!
PRINTF - first char is: e
CPRINTF - first char: e

8bitworkshop behavior:

  • values from variables not printed
  • case is inverted. uppercase is printed lowercase. lowercase is printed uppercase
printf - NUMBER IS: 
cprintf- NUMBER IS: 
printf - STRING IS: 
cprintf - STRING IS: 
printf - FIRST CHAR IS: 
cprintf - FIRST CHAR: 

8bitworkshop compiled: image

Compiled same code example on CC65 in ubuntu and uploaded to 8bitworkshop: image

xp5-org avatar Dec 12 '23 03:12 xp5-org