-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpetscii.h
More file actions
25 lines (20 loc) · 1.16 KB
/
petscii.h
File metadata and controls
25 lines (20 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef PETSCII_H
#define PETSCII_H
/* Map a PETSCII code (0–255) to a UTF-8 string for terminal display.
* Used when -petscii or -petscii-plain is set. Faithful Unicode: £ ↑ ←, box-drawing,
* block elements, card suits, π, and Symbols for Legacy Computing where applicable. */
const char *petscii_code_to_utf8(unsigned char c);
/* Select C64-style character set rendering for PETSCII letters.
* 0 = uppercase/graphics (default), 1 = lowercase/uppercase. */
void petscii_set_lowercase(int enabled);
int petscii_get_lowercase(void);
/* Convert PETSCII print code (CHR$/PRINT stream) to C64 screen code (POKE/screen RAM).
* Used when displaying .seq streams: bytes are PETSCII, font expects screen codes.
* When charset is lowercase, 65-90→1-26 (a-z), 97-122→65-90 (A-Z) to match C64. */
unsigned char petscii_to_screencode(unsigned char petscii);
/* ASCII-aware: preserves literal case so DRAWTEXT renders "Press" as
* "Press" regardless of charset_lowercase. Non-letter bytes fall
* through to petscii_to_screencode so digits, punctuation, and
* graphic PETSCII codes still map correctly. */
unsigned char petscii_ascii_to_screencode(unsigned char ascii);
#endif