From d9f8b5acc4dc8a7326a9081b6d81f1a38c99d486 Mon Sep 17 00:00:00 2001 From: Karol Stasiak Date: Tue, 30 Jul 2019 15:30:18 +0200 Subject: [PATCH] Add support for Japanese C64 --- docs/api/target-platforms.md | 2 ++ examples/README.md | 4 +-- .../fizzbuzz_jp.mfk} | 1 + include/c64jp.ini | 36 +++++++++++++++++++ 4 files changed, 41 insertions(+), 2 deletions(-) rename examples/{pc88/fizzbuzz88.mfk => crossplatform/fizzbuzz_jp.mfk} (93%) create mode 100644 include/c64jp.ini diff --git a/docs/api/target-platforms.md b/docs/api/target-platforms.md index 307179a1..9e145c44 100644 --- a/docs/api/target-platforms.md +++ b/docs/api/target-platforms.md @@ -33,6 +33,8 @@ see [the Commodore programming guide](./commodore-programming-guide.md) for more Certain language features work differently on this target. Read [the LUnix programming guide](./lunix-programming-guide.md) for more info. +* `c64jp` – Japanese version of Commodore 64 (different memory layout and character set) + * `c16` – Commodore 16 * `plus4` – Commodore Plus/4 diff --git a/examples/README.md b/examples/README.md index 00f130c4..196852ff 100644 --- a/examples/README.md +++ b/examples/README.md @@ -8,6 +8,8 @@ * [Fizzbuzz 2](crossplatform/fizzbuzz2.mfk) (C64/C16/PET/VIC-20/PET/Atari/Apple II/BBC Micro/ZX Spectrum/PC-88/Armstrad CPC/MSX) – an alternative, more extensible implemententation of fizzbuzz +* [Fizzbuzz JP](crossplatform/fizzbuzz_jp.mfk) (PC-88/Japanese C64) – Fizzbuzz, but in Japanese + * [Text encodings](crossplatform/text_encodings.mfk) (C64/ZX Spectrum) – examples of text encoding features * [Echo](crossplatform/echo.mfk) (C64/C16/ZX Spectrum/PC-88/MSX)– simple text input and output @@ -56,5 +58,3 @@ how to create a program made of multiple files loaded on demand * [Colors](vcs/colors.mfk) – simple static rasterbars ## PC-88 examples - -* [Fizzbuzz88](pc88/fizzbuzz88.mfk) – Fizzbuzz, but in Japanese diff --git a/examples/pc88/fizzbuzz88.mfk b/examples/crossplatform/fizzbuzz_jp.mfk similarity index 93% rename from examples/pc88/fizzbuzz88.mfk rename to examples/crossplatform/fizzbuzz_jp.mfk index de1d20e3..0442cdd3 100644 --- a/examples/pc88/fizzbuzz88.mfk +++ b/examples/crossplatform/fizzbuzz_jp.mfk @@ -1,6 +1,7 @@ import stdio void main() { + ensure_mixedcase() byte i for i,1,to,100 { if i %% 15 == 0 { diff --git a/include/c64jp.ini b/include/c64jp.ini new file mode 100644 index 00000000..8a2a332c --- /dev/null +++ b/include/c64jp.ini @@ -0,0 +1,36 @@ +; Commodore 64, Japanese version +; assuming a program loaded from disk or tape +; TODO: figure out if the memory map is similar enough + +[compilation] +arch=nmos +encoding=petjp +screen_encoding=petscrjp +modules=c64_hardware,loader_1001,c64_kernal,c64_panic,stdlib + +[allocation] +; list of free zp pointer locations (these assume that some BASIC routines will keep working) +zp_pointers=$FB,$FD,$43,$45,$47,$4B,$F7,$F9,$9E,$9B,$3D +segments=default +default_code_segment=default +segment_default_start=$100D +segment_default_codeend=$9fff +segment_default_datastart=after_code +segment_default_end=$cfff + +[define] +CBM=1 +CBM_64=1 +MOS_6510=1 +WIDESCREEN=1 +KEYBOARD=1 +JOYSTICKS=2 +HAS_BITMAP_MODE=1 + +[output] +style=single +format=startaddr,allocated +extension=prg +labels=vice + +