Files
kichikuou_xsystem35-sdl2/src/cmdh.c
T
kichikuou bc9fc924ed [experimental] Unicode mode
This adds "Unicode mode", in which scenarios can be written in any
language. xsys35c 1.2.0 and later can produce Unicode scenarios.

- nact->encoding represents the current scenario encoding. The initial
  value is SJIS, and ZU command changes it to UTF8.

- Use conversion macros that switch the behavior by the scenario
  encoding. For example, toUTF8() calls sjis2utf() if the scenario
  encoding is SJIS, and calls strdup() if it is UTF8.

- Fix various string processing functions to work with UTF8.
2020-08-09 21:24:56 +09:00

53 lines
1.5 KiB
C

/*
* cmdh.c SYSTEM35 H command
*
* Copyright (C) 1997-1998 Masaki Chikama (Wren) <chikama@kasumi.ipl.mech.nagoya-u.ac.jp>
* 1998- <masaki-c@is.aist-nara.ac.jp>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
/* $Id: cmdh.c,v 1.5 2000/09/10 10:39:48 chikama Exp $ */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "portab.h"
#include "xsystem35.h"
#include "utfsjis.h"
#include "hankaku.h"
void commandH() {
int fig = sys_getc();
int num = getCaliValue();
char buf[512];
char *s = fromSJIS(format_number_zenkaku(num, fig, buf));
sys_addMsg(s);
free(s);
DEBUG_COMMAND("H %d,%d:\n",fig,num);
}
void commandHH(void) {
int fig = sys_getc();
int num = getCaliValue();
char buf[256];
sys_addMsg(format_number(num, fig, buf));
DEBUG_COMMAND("HH %d,%d:\n",fig,num);
}