Skip to content

Commit

Permalink
Fix printf issue in fx-9860 / CE enviroment
Browse files Browse the repository at this point in the history
  • Loading branch information
anderain committed Dec 22, 2023
1 parent 47c9239 commit f95b41e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
3 changes: 2 additions & 1 deletion builder/klockbuilder.dsp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 6 additions & 7 deletions core/krt.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#ifdef VER_PLATFORM_WIN32_CE
# include <stdio.h>
# define printf //
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "konstant.h"
#include "krt.h"
#include "utils.h"

// disable built function "p" on fx9860 and wince
#if defined(fx9860) || defined(VER_PLATFORM_WIN32_CE)
# define printf //
#endif

#define KB_RT_STRINGIFY_BUF_SIZE 200

char stringify_buf[KB_RT_STRINGIFY_BUF_SIZE];
Expand Down Expand Up @@ -795,10 +797,7 @@ int machine_exec_call_built_in (int func_index, kb_machine_t* machine, kb_runtim
kb_rt_value *popped = (kb_rt_value *)vl_pop_back(machine->stack);
char *sz = rtvalue_stringify(popped);
rtvalue_destroy(popped);
// disable "p" on fx9860 and wince
#if defined(fx9860) || defined(VER_PLATFORM_WIN32_CE)
printf("%s\n", sz);
#endif
free(sz);
vl_push_back(machine->stack, rtvalue_create_number(0));
return 1;
Expand Down
2 changes: 1 addition & 1 deletion player-9860/FXSH_Build.bat
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@echo off
rem Do not edit! This batch file is created by CASIO fx-9860G SDK.


if exist debug\*.obj del debug\*.obj
if exist KLOCKP.G1A del KLOCKP.G1A

cd debug
Expand Down
24 changes: 12 additions & 12 deletions player-9860/KlockP.dlw
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[_1]
Type=5
Order=1
Order=5
Top=1095
Left=2595
Height=4455
Expand All @@ -14,7 +14,7 @@ OptionA=0

[_2]
Type=1
Order=0
Order=4
Top=240
Left=13365
Height=4740
Expand All @@ -26,7 +26,7 @@ OptionB=15

[_3]
Type=6
Order=2
Order=6
Top=4965
Left=13365
Height=6390
Expand All @@ -48,7 +48,7 @@ OptionA=0

[_5]
Type=8
Order=5
Order=7
Top=5295
Left=7755
Height=4020
Expand Down Expand Up @@ -81,7 +81,7 @@ OptionA=0

[_8]
Type=17
Order=4
Order=2
Top=105
Left=-15
Height=10980
Expand All @@ -92,7 +92,7 @@ OptionA=0

[_9]
Type=15
Order=3
Order=0
Top=5325
Left=2265
Height=3990
Expand All @@ -115,26 +115,26 @@ OptionA=0

[_33]
Type=16
Order=6
Order=3
Top=195
Left=2295
Height=5730
Width=10605
State=16
State=0
Flags=00000020
Setting=270:20:preview.c
Setting=1:1:main.c
OptionA=0

[_34]
Type=16
Order=7
Order=1
Top=75
Left=2520
Height=6450
Width=11715
State=16
State=0
Flags=00000020
Setting=1:1:constant.c
Setting=8:1:..\core\krt.c
OptionA=0

[_35]
Expand Down

0 comments on commit f95b41e

Please sign in to comment.