I have a file containing a map of a puzzle for my game:
(The # symbols will be spaces on the map, and individual numbers should be displayed separately)
The code I am trying to use is this:
How am I meant to be using the smc_read function? I am sure that I am using it incorrectly. How do I get it to load the file into the 'playarea' array?
And, for those who are interested, the game is a GP32 adaptation of Su Doku. This is what it should eventually look like:
Code:
#5###14##
2#3###7##
#7#3##182
##4#5###7
###1#3###
8###2#6##
185##6#9#
##2###8#3
##64###7#
(The # symbols will be spaces on the map, and individual numbers should be displayed separately)
The code I am trying to use is this:
Code:
#include "gp32.h"
u16 *framebuffer;
int playarea[9][9];
int main() {
int ix;
int iy;
framebuffer = (u16*) FRAMEBUFFER;
gp_setCpuspeed(66);
smc_read("dev0:\\GPMM\\puzzle1.sud",playarea,0,81);
for (ix=0;ix<9;ix++)
{
for (iy=0;iy<9;iy++)
{
gp_drawString(70+(ix*20),30+(iy*20),1,playarea[ix][iy],0,framebuffer);
}
}
while (1) {}
}
How am I meant to be using the smc_read function? I am sure that I am using it incorrectly. How do I get it to load the file into the 'playarea' array?
And, for those who are interested, the game is a GP32 adaptation of Su Doku. This is what it should eventually look like: