creon
What's a PC Engine?
Posts: 3
|
Post by creon on Aug 10, 2022 1:35:35 GMT
Hi I recently started developing games for PCengine. The following code execution results are not correct.
HuC 3.21 had no problem. (1 and 1 are displayed on the screen, and count up 1->2->3->...)
The problem occurs in HuC (v4.00-0a9b895-dirty, 2022-08-01). (screen shows 1 and 0)
Is the problem with the way it is written? Would you need a build option?
Best regards, and thank you in advance.
#include "huc.h"
main() { int i; int nx; int x[64], y[64];
i = 0; x[i] = 0;
for (;;) { vsync();
nx = x[i] + 1; x[i] = nx;
put_number(nx, 1, 0, 0); put_number(x[i], 1, 0, 1); } }
|
|
touko
Punkic Cyborg
Posts: 106
|
Post by touko on Aug 10, 2022 10:04:54 GMT
I think it's a normal thing, you display only one carater/number in your put_number function . Try this :
put_number(nx, 5, 0, 0);
put_number(x[i], 5, 0, 1); It must be 5 because your variables are declared as int, so 0->65535, 3 are enought for a char 0->255
But it's strange that in your case only 0 and 1 are displayed, even with a value of 1,you must at least, see 0->9 .
|
|
|
Post by audreyhepburn on Aug 10, 2022 19:02:01 GMT
I was about to run that with no issues using these flags
-msmall -fno-recursive -v
|
|
creon
What's a PC Engine?
Posts: 3
|
Post by creon on Aug 11, 2022 0:55:12 GMT
I was about to run that with no issues using these flags -msmall -fno-recursive -v I built with that option and it worked fine. Thank you!
|
|
creon
What's a PC Engine?
Posts: 3
|
Post by creon on Aug 11, 2022 0:57:18 GMT
I think it's a normal thing, you display only one carater/number in your put_number function . Try this : put_number(nx, 5, 0, 0);
put_number(x[i], 5, 0, 1); It must be 5 because your variables are declared as int, so 0->65535, 3 are enought for a char 0->255 But it's strange that in your case only 0 and 1 are displayed, even with a value of 1,you must at least, see 0->9 . Thanks for the digit problem. The problem is that it doesn't go from 0->1. I added the build option and that solved it.
|
|