From efd8f1922cb18381d86962da9985cfaa9c3a308f Mon Sep 17 00:00:00 2001 From: eugene455 Date: Fri, 26 Dec 2014 20:27:51 +0000 Subject: [PATCH] The first stable version of N-sider. Level editor, 2 redraw technologies and save/load data added. git-svn-id: svn://kolibrios.org@5266 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/games/nsider/Tupfile.lua | 9 + programs/games/nsider/compile.sh | 1 + programs/games/nsider/game.c | 697 ++++++++++++++++ programs/games/nsider/include/DRAW2D.H | 234 ++++++ programs/games/nsider/include/GameAlphabet.h | 749 ++++++++++++++++++ programs/games/nsider/include/GameFunctions.h | 158 ++++ programs/games/nsider/include/LEVELS.H | 236 ++++++ programs/games/nsider/include/SHIMATH.H | 83 ++ programs/games/nsider/include/ctype.h | 35 + programs/games/nsider/include/kolibrisys.h | 195 +++++ programs/games/nsider/include/math.h | 179 +++++ programs/games/nsider/include/stdio.h | 57 ++ programs/games/nsider/include/stdlib.h | 24 + programs/games/nsider/include/string.h | 25 + programs/games/nsider/kolibri.ld | 20 + .../nsider/kolibrisys/_ksys_files_acces.asm | 119 +++ programs/games/nsider/kolibrisys/clock.asm | 15 + programs/games/nsider/kolibrisys/delay.asm | 11 + programs/games/nsider/kolibrisys/draw_bar.asm | 21 + .../games/nsider/kolibrisys/draw_window.asm | 34 + programs/games/nsider/kolibrisys/keyboard.asm | 29 + programs/games/nsider/kolibrisys/line.asm | 21 + programs/games/nsider/kolibrisys/memalloc.asm | 38 + .../nsider/kolibrisys/public_stdcall.inc | 7 + programs/games/nsider/kolibrisys/screen.asm | 15 + .../games/nsider/kolibrisys/window_redraw.asm | 11 + programs/games/nsider/start.asm | 44 + programs/games/nsider/stdio/fclose.c | 9 + programs/games/nsider/stdio/feof.c | 5 + programs/games/nsider/stdio/fflush.c | 7 + programs/games/nsider/stdio/fgetc.c | 22 + programs/games/nsider/stdio/fgetpos.c | 6 + programs/games/nsider/stdio/fopen.c | 138 ++++ programs/games/nsider/stdio/fputc.c | 35 + programs/games/nsider/stdio/fread.c | 26 + programs/games/nsider/stdio/fseek.c | 11 + programs/games/nsider/stdio/fsetpos.c | 11 + programs/games/nsider/stdio/ftell.c | 5 + programs/games/nsider/stdio/fwrite.c | 58 ++ programs/games/nsider/stdio/rewind.c | 5 + 40 files changed, 3405 insertions(+) create mode 100644 programs/games/nsider/Tupfile.lua create mode 100644 programs/games/nsider/compile.sh create mode 100644 programs/games/nsider/game.c create mode 100644 programs/games/nsider/include/DRAW2D.H create mode 100644 programs/games/nsider/include/GameAlphabet.h create mode 100644 programs/games/nsider/include/GameFunctions.h create mode 100644 programs/games/nsider/include/LEVELS.H create mode 100644 programs/games/nsider/include/SHIMATH.H create mode 100644 programs/games/nsider/include/ctype.h create mode 100644 programs/games/nsider/include/kolibrisys.h create mode 100644 programs/games/nsider/include/math.h create mode 100644 programs/games/nsider/include/stdio.h create mode 100644 programs/games/nsider/include/stdlib.h create mode 100644 programs/games/nsider/include/string.h create mode 100644 programs/games/nsider/kolibri.ld create mode 100644 programs/games/nsider/kolibrisys/_ksys_files_acces.asm create mode 100644 programs/games/nsider/kolibrisys/clock.asm create mode 100644 programs/games/nsider/kolibrisys/delay.asm create mode 100644 programs/games/nsider/kolibrisys/draw_bar.asm create mode 100644 programs/games/nsider/kolibrisys/draw_window.asm create mode 100644 programs/games/nsider/kolibrisys/keyboard.asm create mode 100644 programs/games/nsider/kolibrisys/line.asm create mode 100644 programs/games/nsider/kolibrisys/memalloc.asm create mode 100644 programs/games/nsider/kolibrisys/public_stdcall.inc create mode 100644 programs/games/nsider/kolibrisys/screen.asm create mode 100644 programs/games/nsider/kolibrisys/window_redraw.asm create mode 100644 programs/games/nsider/start.asm create mode 100644 programs/games/nsider/stdio/fclose.c create mode 100644 programs/games/nsider/stdio/feof.c create mode 100644 programs/games/nsider/stdio/fflush.c create mode 100644 programs/games/nsider/stdio/fgetc.c create mode 100644 programs/games/nsider/stdio/fgetpos.c create mode 100644 programs/games/nsider/stdio/fopen.c create mode 100644 programs/games/nsider/stdio/fputc.c create mode 100644 programs/games/nsider/stdio/fread.c create mode 100644 programs/games/nsider/stdio/fseek.c create mode 100644 programs/games/nsider/stdio/fsetpos.c create mode 100644 programs/games/nsider/stdio/ftell.c create mode 100644 programs/games/nsider/stdio/fwrite.c create mode 100644 programs/games/nsider/stdio/rewind.c diff --git a/programs/games/nsider/Tupfile.lua b/programs/games/nsider/Tupfile.lua new file mode 100644 index 0000000000..974539bc04 --- /dev/null +++ b/programs/games/nsider/Tupfile.lua @@ -0,0 +1,9 @@ +if tup.getconfig("NO_FASM") ~= "" or tup.getconfig("NO_GCC") ~= "" then return end +HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../.." or tup.getconfig("HELPERDIR") +tup.include(HELPERDIR .. "/use_gcc.lua") +CFLAGS = CFLAGS .. " -I include" +LDFLAGS = LDFLAGS .. " -T kolibri.ld" +OBJS += tup.foreach_rule({"start.asm", "kolibrisys/*.asm"}, "fasm %f %o", "%B.o") +compile_gcc{"game.c"} +compile_gcc{"stdio/*.c"} +link_gcc("nsider") diff --git a/programs/games/nsider/compile.sh b/programs/games/nsider/compile.sh new file mode 100644 index 0000000000..a0b3403bd9 --- /dev/null +++ b/programs/games/nsider/compile.sh @@ -0,0 +1 @@ +ktcc.kex simple.c libck.a -o program diff --git a/programs/games/nsider/game.c b/programs/games/nsider/game.c new file mode 100644 index 0000000000..58b425b37f --- /dev/null +++ b/programs/games/nsider/game.c @@ -0,0 +1,697 @@ +//screen Width and Height +#define Width 600 +#define Height 600 +int ScreenX=0; +int ScreenY=0; +int OffsetX=0; +int OffsetY=0; +int BufferDraw [Width][Height]; +char BufferCarry [Height][Width][3]; +int BufferCarry2 [Height][Width]; +int DRAW_TECH=0; +int Analyx [Width][Height]; +int CollideVerts[10][2]={}; +int DeltaH [8]={11,16,19,20,21,22,23,23}; +//-1-quit, 0-menu, 1-game +int GAME_TYPE=0; + +int TactCount=0; +int GLOBAL_SPEED=0; +//colors +int COLOR_INDEX=0; +char RAINBOW_NAME[7][7]={"red","orange","yellow","green","blue","indigo","violet"}; +int RAINBOW_TABLE[7][5]= {{0x00ff0000, 0x00e80c7a, 0x00ff0dff, 0x00e82c0c, 0x00ff530d}, + {0x00ff4700, 0x00e8690c, 0x00ff970d, 0x00ff0d18, 0x00e8290c}, + {0x00ffff00, 0x00e8d20c, 0x00ffce0d, 0x009be80c, 0x0056ff0d}, + {0x0000ff00, 0x000ce84a, 0x0059e80c, 0x000dff96, 0x00b6ff0d}, + {0x0000ffff, 0x000d7fff, 0x000caeeb, 0x000dff76, 0x000ce8aa}, + {0x000000ff, 0x000c46eb, 0x00480ce8, 0x00910dff, 0x000d8cff}, + {0x006700ff, 0x00a00ce8, 0x00f20dff, 0x000d2eff, 0x00280ce8}}; +int GLOBAL_BLOCKCOLOR=0x00e80c7a; +int GLOBAL_BATUTCOLOR=0x00ff0dff; +int GLOBAL_PITCOLOR=0x00e82c0c; +int GLOBAL_FLAGCOLOR=0x00ff530d; +int GLOBAL_BACKGROUNDCOLOR=0x00000000; +int GLOBAL_FRONTCOLOR=0x00ffffff; +//menu settings +int MENU_SELECTED=0; +char NUMBER[100]="0"; +int CURRENT_LEVEL=3; +int MAX_LEVEL=3; +int TO_NEXT_LEVEL=0; +int DeltaSpeed=0; +int GLOBAL_CHECKPOINT=0; +int SPAWN_Y=0; +int isRestart=1; +int CurrentCheck=0; + +//Hero data +int HeroX=100; +int HeroY=100; +int HeroSides=3; +int HeroAngle=0; +int HeroFly=0; +char HeroIsDead=0; +int HeroColor=0x00ff0000; +char Key=0; + +//Saveload folder +int SAVE_FOLDER_TYPE=0; + +//EDITOR +int Tile_X=0; +int Tile_Y=0; +int Panel=0; //0-grid,1-tools, 2-props +int Tile_Type=0; +int Q_SELECTED=0; +char TILENAME[6][11]={"empty","block","spike","jump pad","checkpt","finish"}; + +//TIMING +int OLD_FPS=60; +int NEW_FPS=60; + +//OTHER +int THE_END_COUNT=600; + +//Libraries +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +//result of getKey is key character. Condition for Escape - if (getKey()==27) +char getKey() { + int NewKey=_ksys_get_key(); + NewKey/=256; + return (NewKey%256); +} +void LoadData () { + FILE *Profile; + if (SAVE_FOLDER_TYPE==1) { + Profile=fopen ("/usbhd0/1/Profile.bin","rb"); + } else { + Profile=fopen ("Profile.bin","rb"); + } + char Format=0; + Format=fgetc (Profile); + if (Format!='N') { + DrawText (100,300,"error (cannot load data)",GLOBAL_FRONTCOLOR); + Update(); + _ksys_delay(200); + MENU_SELECTED=1; + fclose (Profile); + return; + } + //Loading operations + fread (&(COLOR_INDEX), sizeof(int),1,Profile); + HeroColor=COLOR_INDEX; + fread (&(GLOBAL_BACKGROUNDCOLOR), sizeof(int),1,Profile); + fread (&(GLOBAL_FRONTCOLOR),sizeof(int),1,Profile); + Update(); + fread (&(DRAW_TECH),sizeof(int),1,Profile); + Update(); + MAX_LEVEL=fgetc (Profile); + CURRENT_LEVEL=MAX_LEVEL; + fread (&(LevelProps[0][2]), sizeof(int),1, Profile); + fread (USER_LEVEL0,1,9*LEVEL_MAXLEN,Profile); + fread (&(LevelProps[1][2]), sizeof(int),1,Profile); + fread (USER_LEVEL1,1,9*LEVEL_MAXLEN,Profile); + fread (&(LevelProps[2][2]), sizeof(int),1,Profile); + fread (USER_LEVEL2,1,9*LEVEL_MAXLEN,Profile); + DrawText (100,300,"loaded successfully",GLOBAL_FRONTCOLOR); + Update(); + _ksys_delay(200); + Update(); + + MENU_SELECTED=1; + fclose (Profile); +} + +void SaveData () { + FILE *Profile; + if (SAVE_FOLDER_TYPE==1) { + Profile=fopen ("/usbhd0/1/Profile.bin","wb"); + } else { + Profile=fopen ("Profile.bin","wb"); + } + if (Profile==NULL) { + DrawText (100,300,"error (cannot save data)",GLOBAL_FRONTCOLOR); + Update(); + _ksys_delay(200); + MENU_SELECTED=1; + return; + } + fputc ('N',Profile); + fwrite (&(COLOR_INDEX), sizeof(int),1,Profile); + fwrite (&(GLOBAL_BACKGROUNDCOLOR), sizeof(int),1,Profile); + fwrite (&(GLOBAL_FRONTCOLOR),sizeof(int),1,Profile); + fwrite (&(DRAW_TECH),sizeof(int),1,Profile); + fputc (MAX_LEVEL,Profile); + fwrite (&(LevelProps[0][2]), sizeof(int),1, Profile); + fwrite (USER_LEVEL0,1,9*LEVEL_MAXLEN,Profile); + fwrite (&(LevelProps[1][2]), sizeof(int),1,Profile); + fwrite (USER_LEVEL1,1,9*LEVEL_MAXLEN,Profile); + fwrite (&(LevelProps[2][2]), sizeof(int),1,Profile); + fwrite (USER_LEVEL2,1,9*LEVEL_MAXLEN,Profile); + DrawText (100,300,"saved successfully",GLOBAL_FRONTCOLOR); + Update(); + _ksys_delay(200); + MENU_SELECTED=1; + fclose (Profile); +} + +void MainMenu () { + if (Key==27) GAME_TYPE=-1; + if (MENU_SELECTED==10 && Key==' ') GAME_TYPE=-1; + if (Key=='s') MENU_SELECTED++; + if (Key=='w') MENU_SELECTED--; + if (MENU_SELECTED<0) MENU_SELECTED=10; + if (MENU_SELECTED>10) MENU_SELECTED=0; + if (MENU_SELECTED==0 && Key==' ') { + GAME_TYPE=1; + GLOBAL_CHECKPOINT=0; + return; + } + if (MENU_SELECTED==3 && (Key=='a' || Key=='d')) { + if (GLOBAL_BACKGROUNDCOLOR==0) { + GLOBAL_BACKGROUNDCOLOR=0x00ffffff; + GLOBAL_FRONTCOLOR=0; + } else { + GLOBAL_BACKGROUNDCOLOR=0; + GLOBAL_FRONTCOLOR=0x00ffffff; + } + } + if (MENU_SELECTED==1) { + if (Key=='a' && CURRENT_LEVEL>0) CURRENT_LEVEL--; + if (Key=='d' && CURRENT_LEVEL0) COLOR_INDEX--; + if (Key=='d' && COLOR_INDEX<6) COLOR_INDEX++; + HeroColor=RAINBOW_TABLE [COLOR_INDEX][0]; + GLOBAL_BLOCKCOLOR=RAINBOW_TABLE [COLOR_INDEX][1]; + GLOBAL_BATUTCOLOR=RAINBOW_TABLE [COLOR_INDEX][2]; + GLOBAL_PITCOLOR=RAINBOW_TABLE [COLOR_INDEX][3]; + GLOBAL_FLAGCOLOR=RAINBOW_TABLE [COLOR_INDEX][4]; + } + if (MENU_SELECTED==7 && (Key=='a' || Key=='d')) { + if (SAVE_FOLDER_TYPE==0) { + SAVE_FOLDER_TYPE=1; + } else { + SAVE_FOLDER_TYPE=0; + } + } + if (MENU_SELECTED==8 && (Key=='a' || Key=='d')) { + int i=0; + int j=0; + for (i=0; i=3) { + DrawText (300,300,"error",GLOBAL_FRONTCOLOR); + DrawText (30,320,"(choose level 0/1/2 to edit them)",GLOBAL_FRONTCOLOR); + Update(); + _ksys_delay(200); + MENU_SELECTED=1; + } else { + GAME_TYPE=3; + Panel=1; + } + } + if (Key=='f' && CURRENT_LEVEL<3) { + GAME_TYPE=3; + Panel=1; + } + if (MENU_SELECTED==9 && Key==' ') GAME_TYPE=2; + + + DrawTitle (60,100,GLOBAL_FRONTCOLOR); + DrawText (100,300,"start game",GLOBAL_FRONTCOLOR); + DrawText (100,320,"choose level < >",GLOBAL_FRONTCOLOR); + IntToStr(CURRENT_LEVEL,NUMBER); + DrawText (345,320,NUMBER,GLOBAL_FRONTCOLOR); + DrawText (100,340,"hero color < >",GLOBAL_FRONTCOLOR); + DrawText (330, 340, RAINBOW_NAME [COLOR_INDEX], GLOBAL_FRONTCOLOR); + DrawText (100,360,"background color < >",GLOBAL_FRONTCOLOR); + if (GLOBAL_BACKGROUNDCOLOR==0) { + DrawText (430,360,"black",GLOBAL_FRONTCOLOR); + } else { + DrawText (430,360,"white",GLOBAL_FRONTCOLOR); + } + + DrawText (100,400,"load game",GLOBAL_FRONTCOLOR); + DrawText (100,420,"save game",GLOBAL_FRONTCOLOR); + DrawText (100,440,"level editor",GLOBAL_FRONTCOLOR); + DrawText (100,460,"saveload folder < >",GLOBAL_FRONTCOLOR); + if (SAVE_FOLDER_TYPE==0) { + DrawText (400,460,"local",GLOBAL_FRONTCOLOR); + } else { + DrawText (400,460,"usbhd0/1/",GLOBAL_FRONTCOLOR); + } + DrawText (100,480,"redraw technology < >",GLOBAL_FRONTCOLOR); + if (DRAW_TECH==0) { + DrawText (450,480,"frame",GLOBAL_FRONTCOLOR); + } else { + DrawText (450,480,"lines",GLOBAL_FRONTCOLOR); + } + DrawText (100,520,"help",GLOBAL_FRONTCOLOR); + DrawText (100,540,"quit",GLOBAL_FRONTCOLOR); + DrawText (20,580,"developed by e_shi games 2014",GLOBAL_FRONTCOLOR); + + if (MENU_SELECTED==0) DrawText (100,300,"start game",HeroColor); + if (MENU_SELECTED==1) DrawText (100,320,"choose level < >",HeroColor); + if (MENU_SELECTED==2) DrawText (100,340,"hero color < >",HeroColor); + if (MENU_SELECTED==3) DrawText (100,360,"background color < >",HeroColor); + if (MENU_SELECTED==4) DrawText (100,400,"load game",HeroColor); + if (MENU_SELECTED==5) DrawText (100,420,"save game",HeroColor); + if (MENU_SELECTED==6) DrawText (100,440,"level editor",HeroColor); + if (MENU_SELECTED==7) DrawText (100,460,"saveload folder < >",HeroColor); + if (MENU_SELECTED==8) DrawText (100,480,"redraw technology < >",HeroColor); + if (MENU_SELECTED==9) DrawText (100,520,"help",HeroColor); + if (MENU_SELECTED==10) DrawText (100,540,"quit",HeroColor); + + +} + + + + + +void GamePlay () { + DrawLine (0,500,800,500,GLOBAL_FRONTCOLOR); + if (Objects==0 || DataBase[Objects-1][1]<=Width-40) { + ReadLevel(CURRENT_LEVEL); + } + + if (HeroIsDead==0) { + if (isRestart==1) { + HeroAngle=(HeroAngle+10)%360; + HeroIsDead=CheckCollision(); + HeroY+=HeroFly; + DrawHero (125,HeroY, HeroSides, HeroAngle, HeroColor); + } else { + DrawHero (125,HeroY,HeroSides,HeroAngle,GLOBAL_FRONTCOLOR); + } + if (TO_NEXT_LEVEL>0) { + DrawText (Width-TO_NEXT_LEVEL,300,"jump to start new level",GLOBAL_FRONTCOLOR); + if (TO_NEXT_LEVEL<500) { + TO_NEXT_LEVEL+=2; + } else { + if (Key==' ' && TO_NEXT_LEVEL<=504) { + CURRENT_LEVEL++; + HeroSides=CURRENT_LEVEL; + if (CURRENT_LEVEL>MAX_LEVEL) MAX_LEVEL=CURRENT_LEVEL; + GLOBAL_CHECKPOINT=0; + TO_NEXT_LEVEL=505; + } + if (TO_NEXT_LEVEL>=505) { + TO_NEXT_LEVEL+=2; + if (TO_NEXT_LEVEL>1000) TO_NEXT_LEVEL=0; + } + } + + } + + } else { + GLOBAL_SPEED=0; + DeltaSpeed=0; + TO_NEXT_LEVEL=0; + HeroIsDead++; + DrawPew (125,HeroY,HeroIsDead,HeroColor); + if (HeroIsDead>100) { + ResetLevel(CURRENT_LEVEL); + if (GLOBAL_CHECKPOINT==0) { + isRestart=1; + HeroY=100; + } else { + isRestart=0; + HeroY=SPAWN_Y+41-DeltaH[HeroSides]; + if (HeroSides>7) HeroY-=22; + } + HeroIsDead=0; + HeroFly=0; + if (HeroSides%2==0) { + HeroAngle=360/(HeroSides*2); + } else { + HeroAngle=0; + } + } + } + if (Key=='f'&& CURRENT_LEVEL<3) { + int i=0; + Objects=0; + for (i=0; i<11; i++) LevelProps[i][0]=0; + isRestart=1; + HeroIsDead=0; + HeroY=100; + HeroFly=1; + TO_NEXT_LEVEL=0; + GAME_TYPE=3; + Panel=1; + } + if (Key==27) { + GLOBAL_CHECKPOINT=0; + int i=0; + for (i=0; i<11; i++) ResetLevel (i); + isRestart=1; + HeroIsDead=0; + HeroY=100; + HeroFly=1; + TO_NEXT_LEVEL=0; + if (CURRENT_LEVEL<3) { + GAME_TYPE=3; + Panel=1; + Key=' '; + } else { + GAME_TYPE=0; + } + } +} + +void ShowHelp() { + DrawText (5,10,"controls",HeroColor); + DrawText (5,30,"w/a/s/d_choose in menu/editor",GLOBAL_FRONTCOLOR); + DrawText (5,50,"space_select/jump",GLOBAL_FRONTCOLOR); + DrawText (5,70,"escape_return to menu/exit",GLOBAL_FRONTCOLOR); + DrawText (5,100,"level editor notes",HeroColor); + DrawText (5,120,"press e to switch grid/tools panel",GLOBAL_FRONTCOLOR); + DrawText (5,140,"press q to switch grid/properties",GLOBAL_FRONTCOLOR); + DrawText (5,160,"select save game to save all levels",GLOBAL_FRONTCOLOR); + DrawText (5,180,"select load game to load all levels",GLOBAL_FRONTCOLOR); + DrawText (5,200,"select level 0/1/2 to play/edit",GLOBAL_FRONTCOLOR); + DrawText (5,220,"use f to go to level editor quickly",GLOBAL_FRONTCOLOR); + DrawText (5,240+20,"use start column to test level from",GLOBAL_FRONTCOLOR); + DrawText (5,260+20,"desired place (note _ you can test",GLOBAL_FRONTCOLOR); + DrawText (5,280+20,"level from column which contains",GLOBAL_FRONTCOLOR); + DrawText (5,300+20,"checkpoint)",GLOBAL_FRONTCOLOR); + DrawText (5,360,"redraw technology notes",HeroColor); + DrawText (5,380,"lines tech works faster but",GLOBAL_FRONTCOLOR); + DrawText (5,400,"sometimes it can be unstable",GLOBAL_FRONTCOLOR); + DrawText (5,420,"frame tech works slower but stable",GLOBAL_FRONTCOLOR); + + if (Key=='f') { + GAME_TYPE=3; + Panel=1; + } + + if (Key==27) GAME_TYPE=0; +} + +void SaveArray() { + FILE *ArrTxt; + + if (SAVE_FOLDER_TYPE==1) { + ArrTxt=fopen ("/usbhd0/1/LEVEL2D.txt","wb"); + } else { + ArrTxt=fopen ("LEVEL2D.txt","wb"); + } + if (ArrTxt==NULL) { + DrawText (100,300,"error (cannot save data)",GLOBAL_FRONTCOLOR); + Update(); + _ksys_delay(200); + Panel=1; + return; + } + char StringLevel[3*9*LEVEL_MAXLEN]="unsigned char NEW_LEVEL[9][LEVEL_MAXLEN]=\n{"; + int CurCharIndex=43; + int i=0; + int j=0; + for (i=0;i<9;i++) { + StringLevel[CurCharIndex]='{'; + CurCharIndex++; + for (j=0; j0) Tile_X--; + if (Key=='s' && Tile_Y<8) Tile_Y++; + if (Key=='w' && Tile_Y>0) Tile_Y--; + if (Key==' ') { + if (Tile_Type==5) { + for (i=0; i0) Tile_Type--; + } + if (Panel==2) { + if (Key=='s' && Q_SELECTED<5) Q_SELECTED++; + if (Key=='w' && Q_SELECTED>0) Q_SELECTED--; + if (Key==' ' && Q_SELECTED==0) { + GAME_TYPE=1; + if (GLOBAL_CHECKPOINT>0) { + int isCheck=0; + for (i=0;i<9; i++) { + int CurBlock=*(Levels[CURRENT_LEVEL]+i*LEVEL_MAXLEN+GLOBAL_CHECKPOINT); + if (CurBlock==4) { + SPAWN_Y=(i+1)*43+41+70-DeltaH[HeroSides]; + isCheck=1; + break; + } + } + if (isCheck==0) { + DrawText (100,300,"error (checkpoint not found)",GLOBAL_FRONTCOLOR); + Update(); + _ksys_delay(200); + GAME_TYPE=3; + Panel=1; + return; + } + ResetLevel(CURRENT_LEVEL); + isRestart=0; + HeroIsDead=0; + HeroFly=0; + HeroY=SPAWN_Y; + if (HeroSides>7) HeroY-=22; + if (HeroSides%2==0) { + HeroAngle=360/(HeroSides*2); + } else { + HeroAngle=0; + } + } + } + if (Q_SELECTED==1) { + if (Key=='d' && GLOBAL_CHECKPOINT<399) GLOBAL_CHECKPOINT++; + if (Key=='a' && GLOBAL_CHECKPOINT>0) GLOBAL_CHECKPOINT--; + } + if (Key==' ' && Q_SELECTED==2) { + for (i=0; i<9; i++) { + for (j=0; j3) LevelProps[CURRENT_LEVEL][2]--; + if (Key=='d' && LevelProps[CURRENT_LEVEL][2]<10) LevelProps[CURRENT_LEVEL][2]++; + HeroSides=LevelProps[CURRENT_LEVEL][2]; + } + if (Key==' ' && Q_SELECTED==5) GAME_TYPE=0; + } + if (Key=='e') { + if (Panel==0) { + Panel=1; + } else { + Panel=0; + } + } + if (Key=='q') { + if (Panel==0) { + Panel=2; + } else { + Panel=0; + } + } + //Draw grid + for (i=0; i<=10; i++) { + DrawLine (43*i,0,43*i,43*9,GLOBAL_FRONTCOLOR); + } + for (i=0; i<=9; i++) { + DrawLine (0,43*i,430,43*i,GLOBAL_FRONTCOLOR); + } + //Draw panel + DrawText (450,10,"e_tools",GLOBAL_FRONTCOLOR); + IntToStr (Tile_X,NUMBER); + DrawText (450,30,"(",GLOBAL_FRONTCOLOR); + DrawText (470,30,NUMBER,GLOBAL_FRONTCOLOR); + DrawText (530,30,"/",GLOBAL_FRONTCOLOR); + IntToStr (Tile_Y,NUMBER); + DrawText (550,30,NUMBER,GLOBAL_FRONTCOLOR); + DrawText (570,30,")",GLOBAL_FRONTCOLOR); + + DrawLine (480,70,530,70,GLOBAL_FRONTCOLOR); + DrawLine (480,70,480,70+300,GLOBAL_FRONTCOLOR); + DrawLine (530,70,530,70+300,GLOBAL_FRONTCOLOR); + for (i=1;i<=6; i++) DrawLine (480,70+50*i,530,70+50*i,GLOBAL_FRONTCOLOR); + //Empty block + DrawLine (480+4,70+4,480+42,70+42,GLOBAL_FRONTCOLOR); + DrawLine (480+4,70+42,480+42,70+4,GLOBAL_FRONTCOLOR); + DrawBlock (480+4,70+4+50,GLOBAL_FRONTCOLOR); + DrawPit (480+7,70+4+100,GLOBAL_FRONTCOLOR); + DrawBatut (480+4,70+4+150,GLOBAL_FRONTCOLOR); + DrawFlag (480+8,70+4+200,GLOBAL_FRONTCOLOR); + DrawText (480+14,70+14+250,"f",GLOBAL_FRONTCOLOR); + DrawText (450,400,TILENAME [Tile_Type],GLOBAL_FRONTCOLOR); + + //Draw properties + DrawText (10,410,"q_properties",GLOBAL_FRONTCOLOR); + DrawText (10,430+20,"test level",GLOBAL_FRONTCOLOR); + DrawText (10,470,"start column < >",GLOBAL_FRONTCOLOR); + IntToStr (GLOBAL_CHECKPOINT,NUMBER); + DrawText (270,470,NUMBER,GLOBAL_FRONTCOLOR); + DrawText (10,490,"reset level",GLOBAL_FRONTCOLOR); + DrawText (10,510,"save as 2d array (for developers)",GLOBAL_FRONTCOLOR); + DrawText (10,530,"hero sides < >",GLOBAL_FRONTCOLOR); + IntToStr (LevelProps[CURRENT_LEVEL][2],NUMBER); + DrawText (230,530,NUMBER,GLOBAL_FRONTCOLOR); + DrawText (10,550,"back to menu",GLOBAL_FRONTCOLOR); + + if (Panel==0) { + DrawLine ((Tile_X%10)*43,0,(Tile_X%10)*43,400,HeroColor); + DrawLine ((Tile_X%10)*43+43,0,(Tile_X%10)*43+43,400,HeroColor); + DrawLine (0,(Tile_Y%10)*43,440,(Tile_Y%10)*43,HeroColor); + DrawLine (0,(Tile_Y%10)*43+43,440,(Tile_Y%10)*43+43,HeroColor); + } + if (Panel==1) { + DrawText (450,10,"e_tools",HeroColor); + DrawLine (480,70+Tile_Type*50,530,70+Tile_Type*50,HeroColor); + DrawLine (480,70+Tile_Type*50,480,70+50+Tile_Type*50,HeroColor); + DrawLine (480,70+Tile_Type*50+50,530,70+50+Tile_Type*50,HeroColor); + DrawLine (530,70+Tile_Type*50,530,70+Tile_Type*50+50,HeroColor); + DrawText (450,400,TILENAME [Tile_Type],HeroColor); + } + if (Panel==2) { + DrawText (10,410,"q_properties",HeroColor); + if (Q_SELECTED==0) DrawText (10,450,"test level",HeroColor); + if (Q_SELECTED==1) DrawText (10,470,"start column < >",HeroColor); + if (Q_SELECTED==2) DrawText (10,490,"reset level",HeroColor); + if (Q_SELECTED==3) DrawText (10,510,"save as 2d array (for developers)",HeroColor); + if (Q_SELECTED==4) DrawText (10,530,"hero sides < >",HeroColor); + if (Q_SELECTED==5) DrawText (10,550,"back to menu",HeroColor); + } + + for (i=0; i<10; i++) { + for (j=0; j<9; j++) { + int CurBlock=*(Levels[CURRENT_LEVEL]+j*LEVEL_MAXLEN+Tile_X-Tile_X%10+i); + if (CurBlock==1) DrawBlock (43*i,43*j,GLOBAL_BLOCKCOLOR); + if (CurBlock==2) DrawPit (43*i,43*j,GLOBAL_PITCOLOR); + if (CurBlock==3) DrawBatut (43*i,43*j,GLOBAL_BATUTCOLOR); + if (CurBlock==4) DrawFlag (43*i,43*j,GLOBAL_FLAGCOLOR); + + } + if (*(Levels[CURRENT_LEVEL]+0*LEVEL_MAXLEN+Tile_X-Tile_X%10+i)==5) { + for (j=0; j<9;j++) { + DrawText (43*i+10,43*j+10,"f",GLOBAL_FRONTCOLOR); + } + } + } + if (Key==27) { + GAME_TYPE=0; + } +} + +void Authors () { + if (THE_END_COUNT>0) THE_END_COUNT--; + DrawText (240,10+THE_END_COUNT,"the end",HeroColor); + DrawText (10,40+THE_END_COUNT,"dev team",HeroColor); + DrawText (10,60+THE_END_COUNT,"game director _ shimanskey eugene",GLOBAL_FRONTCOLOR); + DrawText (10,80+THE_END_COUNT,"level designer _ chuduk alexander", GLOBAL_FRONTCOLOR); + DrawText (10,100+THE_END_COUNT,"programmer _ shimanskey eugene", GLOBAL_FRONTCOLOR); + DrawText (10,120+THE_END_COUNT,"font designer _ chuduk alexander", GLOBAL_FRONTCOLOR); + DrawText (10,170+THE_END_COUNT,"this game is dedicated to our",GLOBAL_FRONTCOLOR); + DrawText (10,190+THE_END_COUNT,"relatives and friends",GLOBAL_FRONTCOLOR); + if (Key==27) { + GAME_TYPE=0; + THE_END_COUNT=600; + } +} + + +int main(int argc, char **argv) { + _ksys_get_screen_size (&ScreenX, &ScreenY); + OffsetX=ScreenX/2-Width/2; + OffsetY=ScreenY/2-Height/2; + draw_window(); + + int TIME_START=0; + int TIME_END=0; + int Delta_Hz=0; + + TIME_START=_ksys_get_system_clock(); + while (!0) { + TIME_END=_ksys_get_system_clock(); + if (TIME_START==TIME_END) { + Delta_Hz++; + } else { + OLD_FPS=NEW_FPS; + NEW_FPS=Delta_Hz; + TIME_START=TIME_END; + Delta_Hz=0; + } + _ksys_delay((OLD_FPS+NEW_FPS)/120); + Key=getKey(); + if (GAME_TYPE==-1) return 0; + if (GAME_TYPE==0) MainMenu (); + if (GAME_TYPE==1) GamePlay (); + if (GAME_TYPE==2) ShowHelp (); + if (GAME_TYPE==3) LevelEditor(); + if (GAME_TYPE==4) Authors(); + Update(); + + } +} \ No newline at end of file diff --git a/programs/games/nsider/include/DRAW2D.H b/programs/games/nsider/include/DRAW2D.H new file mode 100644 index 0000000000..7108089b02 --- /dev/null +++ b/programs/games/nsider/include/DRAW2D.H @@ -0,0 +1,234 @@ +void draw_window() { + _ksys_window_redraw(1); + _ksys_draw_window(0, 0, ScreenX, ScreenY, 0, 0, 0, 0, 0); + _ksys_window_redraw(2); +} + +void DrawLine(int x0, int y0, int x1, int y1, int color) { + int Temp = 0; + int x=0; + int y=0; + + //cases when line is out of screen + if (y0 < 0 && y1 < 0) return; + if (y0 >Height - 1 && y1>Height - 1) return; + if (x0 < 0 && x1 < 0) return; + if (x0>Width - 1 && x1>Width - 1) return; + + if ((x1 - x0) == 0) { + if (y1 == min(y0, y1)) { + Temp = y1; + y1 = y0; + y0 = Temp; + } + //correcting borders + if (y0 < 0) y0 = 0; + if (y1>Height - 1) y1 = Height - 1; + for (y = y0; y <= y1; y++) { + BufferDraw[x0][y] = color; + if (x0+1<=Width-1) BufferDraw[x0+1][y] = color; + } + } + else if ((y1 - y0) == 0) { + if (x1 == min(x0, x1)) { + Temp = x1; + x1 = x0; + x0 = Temp; + } + if (x0 < 0) x0 = 0; + if (x1>Width - 1) x1 = Width - 1; + for (x = x0; x < x1; x++) { + BufferDraw[x][y0] = color; + if (y0+1<=Height-1) BufferDraw[x][y0+1] = color; + } + } + else { + int PartX=0; + int PartY=0; + + int LeftX=min(x0,x1); + if (LeftX<0) LeftX=0; + if (LeftX>Width-1) LeftX=Width-1; + + int RightX=max(x0,x1); + if (RightX<0) RightX=0; + if (RightX>Width-1) RightX=Width-1; + + int LeftY=min(y0,y1); + if (LeftY<0) LeftY=0; + if (LeftY>Height-1) LeftY=Height-1; + + int RightY=max(y0,y1); + if (RightY<0) RightY=0; + if (RightY>Height-1) RightY=Height-1; + + if (RightX-LeftX>=RightY-LeftY) { + for (x=LeftX; x<=RightX; x++) { + y=(y1-y0)*(x-x0)/(x1-x0)+y0; + if (y<0) continue; + BufferDraw[x][y]=color; + if (y+1<=Height-1) BufferDraw[x][y+1]=color; + } + } else { + for (y=LeftY; y<=RightY; y++) { + x=(x1-x0)*(y-y0)/(y1-y0)+x0; + if (x<0) continue; + BufferDraw[x][y]=color; + if (x+1<=Width-1) BufferDraw[x+1][y]=color; + } + } + + } +} + +void DrawText(int x, int y, char Text[] , int color) { + int i=0; + for (i=0; Text[i]!='\0'; i++) { + int j=0; + unsigned char isMatch=0; + for (j=0; Alphabet[j]!='\0'; j++) { + if (Text[i]==Alphabet[j]) { + isMatch=1; + break; + } + } + if (isMatch==0) { + x+=17; + continue; + } + int bitLen=15; + int bitX=0; + int bitY=0; + for (bitX=0; bitX=0 && x+bitX<=(Width-1) && y+bitY>=0 && y+bitY<=(Height-1)) BufferDraw[x+bitX][y+bitY]=color; + } + } + } + x+=bitLen+2; + } +} + +void DrawPit (int x, int y, int color) { + DrawLine (0+x,43+y,15+x,10+y,color); + DrawLine (15+x,10+y,30+x,43+y,color); + DrawLine (0+x,43+y,30+x,43+y,color); +} + +void DrawBlock (int x, int y, int color) { + DrawLine (0+x,0+y,40+x,0+y,color); + DrawLine (40+x,0+y,40+x,40+y,color); + DrawLine (40+x,40+y,0+x,40+y,color); + DrawLine (0+x,40+y,0+x,0+y,color); +} + +void DrawHero (int x, int y, int Verts, int InitAngle, int color) { + int R=25; + int PointX1=x+FloatToInt(R*sin(InitAngle)); + int PointY1=y-FloatToInt(R*cos(InitAngle)); + int PointX2=0; + int PointY2=0; + int i=0; + for (i=0; i=LineYLen) { + _ksys_line(x+OffsetX,y+OffsetY,LineX+OffsetX,y+OffsetY,CurColor); + int i=0; + for (i=x; i<=LineX; i++) Analyx[i][y]=1; + continue; + } + _ksys_line(x+OffsetX,y+OffsetY,x+OffsetX,LineY+OffsetY,CurColor); + int i=0; + for (i=y; i<=LineY; i++) Analyx[x][i]=1; + } + } + + //From Buffer to Analyx and Reset Buffer + for (x = 0; x < Width; x++) { + for (y = 0; y < Height; y++) { + Analyx[x][y]=BufferCarry2[x][y]; + BufferDraw[x][y]=GLOBAL_BACKGROUNDCOLOR; + } + } + } + //FULL FRAME DRAW + if (DRAW_TECH==0) { + for (x = 0; x < Width; x++) { + for (y = 0; y < Height; y++) { + BufferCarry[y][x][0] = BufferDraw[x][y]%256; + BufferDraw[x][y]/=256; + BufferCarry[y][x][1]=BufferDraw[x][y]%256; + BufferDraw[x][y]/=256; + BufferCarry[y][x][2]=BufferDraw[x][y]%256; + BufferDraw[x][y]=GLOBAL_BACKGROUNDCOLOR; + } + } + DrawScreen (OffsetX,OffsetY,Width,Height,BufferCarry); + } + //Drawing Level + int i=0; + for (i=0; i0 && DataBase[0][1]<120) isRestart=1; + } + CleanDataBase(); + +} + +void Jump () { + if (Key==' ') HeroFly=-13; +} + + +char CheckCollision() { + int i=0; + for (i=0; i60) continue; + int j=0; + for (j=0;j=DataBase[i][1]+6 && PointX<=DataBase[i][1]+30-6 && PointY>=DataBase[i][2]+10 && PointY<=DataBase[i][2]+48) { + return 1; + } + if (DataBase[i][0]==3 && PointX>=DataBase[i][1] && PointX<=DataBase[i][1]+43 && PointY>=DataBase[i][2]+25 && PointY<=DataBase[i][2]+48) { + HeroFly=-25; + return 0; + } + if (DataBase[i][0]==4 && PointX>=DataBase[i][1] && PointX<=DataBase[i][1]+43 && PointY>=DataBase[i][2] && PointY<=DataBase[i][2]+48) { + DrawText (10,510,"checkpoint",GLOBAL_FLAGCOLOR); + GLOBAL_CHECKPOINT=CurrentCheck; + SPAWN_Y=DataBase[i][2]; + } + + if (DataBase[i][0]==1 && PointX>=DataBase[i][1] && PointX<=DataBase[i][1]+43) { + if (PointY>=DataBase[i][2] && PointY<=DataBase[i][2]+43) { + if (HeroY>=DataBase[i][2] && HeroX<=DataBase[i][1]+6) { + return 1; + } + if (HeroFly<0) { + return 1; + } + //correcting edges + HeroAngle=0; + if (HeroSides%2==0) HeroAngle=360/HeroSides/2; + HeroY=DataBase[i][2]-DeltaH[HeroSides-3]; + HeroFly=0; + Jump(); + return 0; + } else { + if (DataBase[i][2]-HeroY0 && DataBase[i][2]-HeroY>0) HeroFly=DataBase[i][2]-HeroY; + } + } + } + } + if (HeroY<500-DeltaH[HeroSides-3]) { + HeroFly++; + } else { + HeroFly=0; + HeroAngle=0; + if (HeroSides%2==0) HeroAngle=360/HeroSides/2; + HeroY=500-DeltaH[HeroSides-3]; + Jump(); + } + return 0; +} diff --git a/programs/games/nsider/include/LEVELS.H b/programs/games/nsider/include/LEVELS.H new file mode 100644 index 0000000000..a5a87f8b40 --- /dev/null +++ b/programs/games/nsider/include/LEVELS.H @@ -0,0 +1,236 @@ +#define LEVEL_MAXLEN 400 +#define CONST_SPEED 5 + + +int DataBase[100][3]; +int Objects=0; + + +unsigned char USER_LEVEL0[9][LEVEL_MAXLEN]={{}}; +unsigned char USER_LEVEL1[9][LEVEL_MAXLEN]={{}}; +unsigned char USER_LEVEL2[9][LEVEL_MAXLEN]={{}}; +//note: [0][0] holds Length high part, [0][1] length lo part, [0][2] holds column to read +unsigned char Lvl03[9][LEVEL_MAXLEN]= +{ + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0} +}; + + + + +//current column, level speed, HeroSides +int LevelProps[11][3]= {{0,5,3}, + {0,5,3}, + {0,5,3}, + {0,5,3}, + {0,5,4}, + {0,5,5}, + {0,5,6}, + {0,5,7}, + {0,5,8}, + {0,5,9}, + {0,5,10}}; + +unsigned char *Levels[11]={&USER_LEVEL0[0][0],&USER_LEVEL1[0][0],&USER_LEVEL2[0][0],&Lvl03[0][0],&Lvl04[0][0],&Lvl05[0][0],&Lvl06[0][0],&Lvl07[0][0],&Lvl08[0][0],&Lvl09[0][0],&Lvl10[0][0]}; + +void Update(); +void CleanDataBase(); +void ResetLevel (int level); + +void ReadLevel (int level) { + int CurColumn=LevelProps[level][0]; + if (CurColumn>=LEVEL_MAXLEN || *(Levels[level]+CurColumn)==5) { + if (CURRENT_LEVEL==10) { + DrawText (40,300,"congratulations you are winner",GLOBAL_FRONTCOLOR); + GLOBAL_CHECKPOINT=0; + ResetLevel (CURRENT_LEVEL); + MAX_LEVEL=10; + HeroY=100; + Update(); + _ksys_delay(200); + GAME_TYPE=4; + return; + } + if (CURRENT_LEVEL<3) { + DrawText (200,300,"level completed",GLOBAL_FRONTCOLOR); + GLOBAL_CHECKPOINT=0; + ResetLevel (CURRENT_LEVEL); + HeroY=100; + Update(); + _ksys_delay(200); + GAME_TYPE=3; + Panel=1; + return; + } else { + if (TO_NEXT_LEVEL==0) TO_NEXT_LEVEL=1; + return; + } + } + int Cell=0; + + GLOBAL_SPEED=LevelProps[level][1]; + int CurType=0; + //init + DataBase[Objects][0]=0; + DataBase[Objects][1]=Width; + DataBase[Objects][2]=0; + Objects++; + + for (Cell=0; Cell<9; Cell++) { + CurType=*(Levels[level]+Cell*LEVEL_MAXLEN+CurColumn); + if (CurType>0) { + DataBase[Objects][0]=CurType; + DataBase[Objects][1]=Width; + DataBase[Objects][2]=43*(Cell+1)+70; + if (CurType==4) CurrentCheck=CurColumn; + Objects++; + } + } + LevelProps[level][0]++; +} + +void ResetLevel (int level) { + Objects=0; + LevelProps[level][0]=GLOBAL_CHECKPOINT; +} + + +void CleanDataBase () { + int i=0; + for (i=0; i180) res=-1; + if (angle>=0 && angle<=90) return (res*sctable[angle]); + if (angle>90 && angle<=180) return (res*sctable[180-angle]); + if (angle>180 && angle<=270) return (res*sctable[angle-180]); + if (angle>270) return (res*sctable[360-angle]); + return res; +} + +float cos (int angle) { + float res=1; + angle%=360; + if (angle>90 && angle<270) res=-1; + if (angle>=0 && angle<=90) return (res*sctable[90-angle]); + if (angle>90 && angle<=180) return (res*sctable[angle-90]); + if (angle>180 && angle<=270) return (res*sctable[90-(angle-180)]); + if (angle>270) return (res*sctable[90-(360-angle)]); + return res; +} + +int FloatToInt (float a) { + int sign=1; + int result=0; + if (a<1 && a>(-1)) return 0; + if (a<0) { + sign=-1; + a*=(-1); + } + while (a>=1) { + a--; + result++; + } + return (result*sign); +} + +int min (int a, int b) { + if (a<=b) return a; + return b; +} + +int max (int a, int b) { + if (a>=b) return a; + return b; +} + +void IntToStr (int Value, char Str[]) { + char Stack[100]=""; + int StackLen=0; + if (Value==0) { + Str[0]='0'; + Str[1]='\0'; + return; + } + while (Value!=0) { + Stack[StackLen]=Value%10+48; + Value/=10; + StackLen++; + } + int i=0; + for (i=0; i +#include +#include + +void fclose(FILE* file) +{ + free(file->buffer); + free(file); +} \ No newline at end of file diff --git a/programs/games/nsider/stdio/feof.c b/programs/games/nsider/stdio/feof.c new file mode 100644 index 0000000000..76f131d55f --- /dev/null +++ b/programs/games/nsider/stdio/feof.c @@ -0,0 +1,5 @@ +#include +int feof(FILE* file) +{ + return file->filepos>=file->filesize; +} \ No newline at end of file diff --git a/programs/games/nsider/stdio/fflush.c b/programs/games/nsider/stdio/fflush.c new file mode 100644 index 0000000000..1cd7bf355c --- /dev/null +++ b/programs/games/nsider/stdio/fflush.c @@ -0,0 +1,7 @@ +#include +int fflush(FILE* file) +{ + if ((file->mode & 3)==FILE_OPEN_READ) + return 0; + return(EOF); +} \ No newline at end of file diff --git a/programs/games/nsider/stdio/fgetc.c b/programs/games/nsider/stdio/fgetc.c new file mode 100644 index 0000000000..11a031d84a --- /dev/null +++ b/programs/games/nsider/stdio/fgetc.c @@ -0,0 +1,22 @@ +#include +int fgetc(FILE* file) +{ + dword res; + + if ((file->mode & 3!=FILE_OPEN_READ) && (file->mode & FILE_OPEN_PLUS==0)) return EOF; + + if (file->filepos>=file->filesize) + { + return EOF; + } + else + { + res=_ksys_readfile(file->filename,file->filepos,1,file->buffer); + if (res==0) + { + file->filepos++; + return (int)file->buffer[0]; + } + else return(res); + } +} \ No newline at end of file diff --git a/programs/games/nsider/stdio/fgetpos.c b/programs/games/nsider/stdio/fgetpos.c new file mode 100644 index 0000000000..c04df6bfb9 --- /dev/null +++ b/programs/games/nsider/stdio/fgetpos.c @@ -0,0 +1,6 @@ +#include +int fgetpos(FILE* file,fpos_t* pos) +{ + *pos=file->filepos; + return 0; +} \ No newline at end of file diff --git a/programs/games/nsider/stdio/fopen.c b/programs/games/nsider/stdio/fopen.c new file mode 100644 index 0000000000..6697de3c6a --- /dev/null +++ b/programs/games/nsider/stdio/fopen.c @@ -0,0 +1,138 @@ +#include +#include +#include + +extern char __argv; +extern char __path; + +const char* getfullpath(const char *path){ + + int i,j,relpath_pos,localpath_size; + int filename_size; + char local_path; + char *programpath; + char *newpath; + + i=0; + local_path=1; //enable local path + while((*(path+i)!='\0') || (*(path+i)!=0)) + { + if (*(path+i)=='.') + { + if (*(path+i+1)=='/') + { //detected relative path + relpath_pos=i+2; + local_path=0; + break; + } + } + if (*(path+i)=='/') + { //disabple local path + local_path=0; + return(path); + } + i++; + } + filename_size=i; + + programpath=&__path; + + if (local_path==1) + { + i=0x400; + //find local path of program + while(*(programpath+i)!='/') + { + i--; + } + localpath_size=i; + newpath=malloc(0x400); + //copy local path to the new path + for(i=0;i<=localpath_size;i++) + { + *(newpath+i)=*(programpath+i); + } + //copy filename to the new path + for(i=0;ibuffer=malloc(256); + res->buffersize=256; + res->filesize=0; + res->filepos=0; + res->mode=imode; + res->filename=getfullpath(filename); + + if ((imode==FILE_OPEN_READ) || (imode==FILE_OPEN_APPEND)) + { + res->filesize=_ksys_get_filesize(res->filename); + } + return res; +} diff --git a/programs/games/nsider/stdio/fputc.c b/programs/games/nsider/stdio/fputc.c new file mode 100644 index 0000000000..db8e02cd1f --- /dev/null +++ b/programs/games/nsider/stdio/fputc.c @@ -0,0 +1,35 @@ +#include +int fputc(int c,FILE* file) +{ + dword res; + + if ((file->mode & 3)==FILE_OPEN_READ) return EOF; + + file->buffer[0]=c; + if ((file->mode & 3)==FILE_OPEN_APPEND) + { + file->filepos=file->filesize; + file->filesize++; + res=_ksys_appendtofile(file->filename,file->filepos,1,file->buffer); + if (res!=0) return(res); + file->filepos++; + return(0); + } + if ((file->mode & 3)==FILE_OPEN_WRITE) + { + if (file->filepos==0) + { //file not craeted + res=_ksys_rewritefile(file->filename,1,file->buffer); + if (res!=0) return(res); + file->filepos++; + return 0; + } + else + { //file craeted and need append one byte + res=_ksys_appendtofile(file->filename,file->filepos,1,file->buffer); + if (res!=0) return(res); + file->filepos++; + return 0; + } + } +} diff --git a/programs/games/nsider/stdio/fread.c b/programs/games/nsider/stdio/fread.c new file mode 100644 index 0000000000..3d2d2bf82c --- /dev/null +++ b/programs/games/nsider/stdio/fread.c @@ -0,0 +1,26 @@ +#include +#include + +int fread(void *buffer,int size,int count,FILE* file) +{ + dword res; + dword fullsize; + + if ((file->mode!=FILE_OPEN_READ) || (file->mode==FILE_OPEN_PLUS)) return 0; + + fullsize=count*size; + if ((fullsize+file->filepos)>(file->filesize)) + { + fullsize=file->filesize-file->filepos; + if (fullsize<=0) return(0); + } + + res=_ksys_readfile(file->filename,file->filepos,fullsize,buffer); + if (res==0) + { + file->filepos=file->filepos+fullsize; + fullsize=fullsize/size; + return(fullsize); + } + else return 0; +} \ No newline at end of file diff --git a/programs/games/nsider/stdio/fseek.c b/programs/games/nsider/stdio/fseek.c new file mode 100644 index 0000000000..1686904b32 --- /dev/null +++ b/programs/games/nsider/stdio/fseek.c @@ -0,0 +1,11 @@ +#include +int fseek(FILE* file,long offset,int origin) +{ + if (origin==SEEK_CUR) + offset+=file->filepos; + else if (origin==SEEK_END) + offset+=file->filesize; + else if (origin!=SEEK_SET) + return EOF; + return fsetpos(file,offset); +} \ No newline at end of file diff --git a/programs/games/nsider/stdio/fsetpos.c b/programs/games/nsider/stdio/fsetpos.c new file mode 100644 index 0000000000..0c2d624e83 --- /dev/null +++ b/programs/games/nsider/stdio/fsetpos.c @@ -0,0 +1,11 @@ +#include +int fsetpos(FILE* file,const fpos_t * pos) +{ + if (*pos>=0) + { + file->filepos=*pos; + return 0; + } + else + return EOF; +} \ No newline at end of file diff --git a/programs/games/nsider/stdio/ftell.c b/programs/games/nsider/stdio/ftell.c new file mode 100644 index 0000000000..20500a9db7 --- /dev/null +++ b/programs/games/nsider/stdio/ftell.c @@ -0,0 +1,5 @@ +#include +long ftell(FILE* file) +{ + return file->filepos; +} \ No newline at end of file diff --git a/programs/games/nsider/stdio/fwrite.c b/programs/games/nsider/stdio/fwrite.c new file mode 100644 index 0000000000..5d498206cd --- /dev/null +++ b/programs/games/nsider/stdio/fwrite.c @@ -0,0 +1,58 @@ +#include +#include + +int fwrite(void *buffer,int size,int count,FILE* file) +{ + dword res; + dword fullsize; + + if (file->mode==FILE_OPEN_READ) return 0; + + if (file->mode==FILE_OPEN_APPEND) + file->filepos=file->filesize; + fullsize=count*size; + + if ((file->filesize)<(file->filepos+fullsize)) file->filesize=file->filepos+fullsize; + + /* + if (file->mode==FILE_OPEN_APPEND) + { + file->filepos==file->filesize; + res=_ksys_appendtofile(file->filename,file->filepos,fullsize,buffer); + if (res==0) + { + file->filepos+=fullsize; + fullsize=fullsize/size; + return(fullsize); + } + else return(0); + + } + */ + if ((file->mode==FILE_OPEN_WRITE) || (file->mode==FILE_OPEN_APPEND)) + { + if (file->filepos==0) + { //file mot craeted yet + res=_ksys_rewritefile(file->filename,fullsize,buffer); + if (res==0) + { + file->filepos+=fullsize; + fullsize=fullsize/count; + return(fullsize); + } + else return(0); + } + else + { + res=_ksys_appendtofile(file->filename,file->filepos,fullsize,buffer); + if (res==0) + { + file->filepos+=fullsize; + fullsize=fullsize/count; + return(fullsize); + } + else return(0); + } + } + else return(0); +} \ No newline at end of file diff --git a/programs/games/nsider/stdio/rewind.c b/programs/games/nsider/stdio/rewind.c new file mode 100644 index 0000000000..4b2f4a1eb3 --- /dev/null +++ b/programs/games/nsider/stdio/rewind.c @@ -0,0 +1,5 @@ +#include +void rewind(FILE* file) +{ + file->filepos=0; +} \ No newline at end of file