@@ -44,6 +44,7 @@ static char *p[] = {
4444 " -r execute runtime with result" ,
4545 " -s output string map" ,
4646 " -m compile for Emscripten" ,
47+ " -x use 32bit runtime" ,
4748 " ---------------------------------" ,
4849 " -h??? print command help" ,
4950 " -lk??? print HSP3 keyword list" ,
@@ -67,7 +68,7 @@ int main( int argc, char *argv[] )
6768{
6869 char a1,a2,a3;
6970 int b,st;
70- int cmpopt,ppopt,utfopt,pponly,execobj,strmap,hsphelp;
71+ int cmpopt,ppopt,utfopt,pponly,execobj,strmap,hsphelp,hsp64 ;
7172 char *opt_lk = NULL ;
7273 char *opt_ls = NULL ;
7374 int opt_lsref, opt_lsmode;
@@ -83,7 +84,7 @@ int main( int argc, char *argv[] )
8384
8485 if (argc<2 ) { usage1 ();return -1 ; }
8586
86- st = 0 ; ppopt = 0 ; cmpopt = 0 ; utfopt = 0 ; pponly = 0 ; strmap = 0 ; hsphelp = 0 ; opt_lsref = 0 ; opt_lsmode = 0 ;
87+ st = 0 ; ppopt = 0 ; cmpopt = 0 ; utfopt = 0 ; pponly = 0 ; strmap = 0 ; hsphelp = 0 ; opt_lsref = 0 ; opt_lsmode = 0 ; hsp64 = 1 ;
8788 execobj = 0 ;
8889 fname[0 ]=0 ;
8990 fname2[0 ]=0 ;
@@ -173,6 +174,8 @@ int main( int argc, char *argv[] )
173174 }
174175 st = 1 ;
175176 break ;
177+ case ' x' :
178+ hsp64 = 0 ; break ;
176179 default :
177180 st = 1 ;break ;
178181 }
@@ -220,6 +223,11 @@ int main( int argc, char *argv[] )
220223 strcpy ( fname2, fname ); cutext ( fname2 ); addext ( fname2," i" );
221224 addext ( fname," hsp" ); // 拡張子がなければ追加する
222225
226+ // HSP64 check
227+ if (hsp64) {
228+ ppopt |= HSC3_OPT_RUNTIME64 | HSC3_OPT_UTF8OUT;
229+ }
230+
223231 // label pick
224232 if (opt_ls) {
225233 if (*opt_ls == 0 ) opt_ls = NULL ;
@@ -228,6 +236,11 @@ int main( int argc, char *argv[] )
228236 hsc3->InitAnalysisInfo (opt_lsmode | opt_lsref, opt_ls);
229237 st = hsc3->PreProcess (fname, fname2, ppopt, fname);
230238 if ((pponly == 0 ) && (st == 0 )) {
239+ if (hsp64) {
240+ if (hsc3->GetHeaderOption () & HEDINFO_HSP64) {
241+ cmpopt |= HSC3_MODE_RUNTIME64 | HSC3_MODE_UTF8;
242+ }
243+ }
231244 st = hsc3->CompileLabelOut (fname2, cmpopt);
232245 }
233246 if (st >= 0 ) {
@@ -294,6 +307,11 @@ int main( int argc, char *argv[] )
294307 // 通常のコンパイル
295308 st = hsc3->PreProcess ( fname, fname2, ppopt, fname );
296309 if (( pponly == 0 )&&( st == 0 )) {
310+ if (hsp64) {
311+ if (hsc3->GetHeaderOption () & HEDINFO_HSP64) {
312+ cmpopt |= HSC3_MODE_RUNTIME64 | HSC3_MODE_UTF8;
313+ }
314+ }
297315 st = hsc3->Compile ( fname2, oname, cmpopt );
298316 }
299317 puts ( hsc3->GetError () );
0 commit comments