News:

The forum has been updated to SMF (2.1.3)!
Please be patient as we work to polish up the place and update features as we can.

Main Menu

Lord Wolframs castle of dreams.

Started by Lord Wolfram, 11, November, 2016, 03:19:48 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Daddy Poi's Oily Gorillas

#20
@CONFIG:  I saw that in the source, but didn't know that crashes...
MORECOMD seems like it'd be better to have a more specific name if possible... - I think (maybe) I'd like to have a slightly larger list if both these menus are small since it's just the help menu... I mean, you can still group them in categories if you wanted to, right? (Even if you couldn't scroll, show one category... <Press any key to continue to showing next category> etc. - Some old DOS computers might do it that way as well, but I forget now???)
---
Well... The computer I am on is running Windows Vista. (My own/primary computer... was Windows 10... which is not with me at the moment. Probably will be repaired.)
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Lord Wolfram

Quote from: Fox on 15, November, 2016, 02:06:40 AM
@CONFIG:  I saw that in the source, but didn't know that crashes...
It's simply there but it's pointing nowhere. Once you execute the command your make the compiler confused and it crashes

Quote
MORECOMD seems like it'd be better to have a more specific name if possible... - I think (maybe) I'd like to have a slightly larger list if both these menus are small since it's just the help menu... I mean, you can still group them in categories if you wanted to, right? (Even if you couldn't scroll, show one category... <Press any key to continue to showing next category> etc. - Some old DOS computers might do it that way as well, but I forget now???)
---
Those are extra commands, DOS didn't show all of them to use. MORECOMD is for showing commands that would be used for system management

At the error..... I think that the compiler is not really working? Well it's saying that DLL is missing,get it within the project and run it again



On the side note, does the code look alright, it's not that messy right?

Daddy Poi's Oily Gorillas

#22
Hm.... So basically SYSMNG ? :D
And okay.

Yes, I know about dlldump places... (But how do you know if they're 100% authentic?)

@Messy: Well, it is (mostly) fine right now, because there's not much code. (Probably.) But...., if we really got into that... I could bring up that some people think using goto is bad practice. (Not using any while / do / switch / etc. blocks?)
For example, you could wrap the command list inside of a "while true" loop, and have only the exit one(s) "break;" out of it. -- Etc. (I'd go deeper by converting to a table/table scanner, though. .. where each command is linked to a function. (Functions listed in the table.))

So far, the table I'm thinking would have 3 things per command.
-Command (What you type to get to it.)
-Description
-Function to be called.

So basically, the same exact command list is checked for both, when detecting what command you entered, /and/ for listing them in the Help command. Makes it your one-stop-shop for editing what commands are available/seen.. without having to check multiple places.
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Lord Wolfram

 @ GOTO
Well I talked a lot with my teacher about it, and we decided that in menu it's fine, so long as code isn't long the GOTO is fine
Also right now I'm more interested to understand how SDL is working and then make a game, after it I'll return to this project

Daddy Poi's Oily Gorillas

#24
@GOTO: Using it is fine, yes... (Even I /might/ use it a few times... But not much...) But anyway, I guess what I'm saying/asking is... If you can easily do it two different ways... why take the (potentially) lower quality version (for readability) when you don't have to? (I haven't checked which is more optimized when compiled, though... But any differences there (if any) would be too microscopic to even be concerned.) ---

Forgot to mention, but in a while statement, your "goto start" could be replaced with "continue;"... since it's the same thing.

I guess later on (if I'm up to it.), I can see about how much I can shorten your code (while maintaining readability/etc.)... so that you can pick whichever one you prefer... I'd like to think of it as sort of an experiment. - Still have to decide on whether to get a compiler now, or wait...

I assume SDL is just built onto VBA, and that basically the ReadLine is mostly responsible for keeping the game paused? (I guess.) Kinda forget what I was experimenting with (not VBA-related) a long time ago, so who knows...


----
WIP:

/*****************************************/
/* ReSaNa DOS main class */
/* By Andrew Ivanov */
/* Tasks: show list of commands */
/* and explain the functions that */
/* each of the commands does. */
/*****************************************/
#include "Main.h"


typedef struct {
const char* name;
const char* desc;
void (*func)();
} tCommand;

//extern const tCommand Commands[]; //move this and above to .h file later.
void cmdna()
{
printf("This command is not available!\n");
}
void help()
{
int i = 0;
for (;;) {
if (Commands[i].name == "")
break;
printf(Commands[i].name);
printf(" - ");
printf(Commands[i].desc);
printf("\n");
i++;
};
//return;
}
const tCommand Commands[] = {
{"CD", "changes the current directory", cmdna},
{"COPY", "copies a file", cmdna},
{"DEL", "deletes a file", cmdna},
{"DIR", "lists directory contents", cmdna},
{"EDITOR", "starts an editor to create or edit plain text files", cmdna},
{"CCODE", "starts an C programming interace for making new programes", cmdna},
{"CALC", "starts a calculator to calculate numbers", cmdna},
{"COMPRES", "Compresses data to fit the disk", cmdna},
{"HELP", "displays list of commands", help},
{"HELPCOMD", "displays information about a command", cmdna},
{"MORECOMD", "gives user acces to additional commands", cmdna},
{"MKDIR", "creates a new directory", cmdna},
{"RD", "removes a directory", cmdna},
{"REN", "renames a file", cmdna},
{"TYPE", "displays contents of a text file on the screen", cmdna},
{"EXIT", "Exits the ReSaNa DOS system.", cmdna},
{"", "", cmdna}
};
void test()
{
int i = 0;
char command[8];
gets_s(command, 8);
for (;;) {
if (Commands[i].name == ""){printf(command);
printf("Please write your answer correctly!\n");
gets_s(command, 8);
i = 0;
continue;
}
if (strcmp(Commands[i].name, command) == 0) {
Commands[i].func();
if (strcmp("EXIT", command) == 0)
break;
gets_s(command, 8);
i = 0;
continue;
}
i++;
};
//return;
}
// Main
int main()
{

// Set up functions before starting the ReSaNa DOS
printf("Starting ReSaNa DOS...\n\n");
SystemSetup();
DataBase();
// After setup is done, starting the system
test();
//MainCommands();
    return 0;
}
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Lord Wolfram

Made another C code. Have fun figuring out what it does.

[spoiler]
#include <stdio.h>
#include <string.h>

int main()
{

   int c;
   FILE *inputfile, *outputfile;
   char text[4096];
   inputfile = fopen("cipska.dat", "r");
   outputfile = fopen("cipska.rez", "w");
   if (inputfile) {

      fscanf(inputfile, "%*[^\n]\n", NULL);

      while ((c = getc(inputfile)) != EOF)
      {
         if (c == '3' || c == '5')
         {
            fputc(c, outputfile);
            fprintf(outputfile, " ");
         }
         else
         {
            fputc(c, outputfile);
         }
      }
         
      fclose(inputfile);
      fclose(outputfile);
   }
    return 0;
}
[/spoiler]

Daddy Poi's Oily Gorillas

#26
DAT to REZ file conversion?

But for what?

QuoteResource file used by first-person shooter games that are developed with the Lithtech gaming engine; contains game content, including meshes, textures, music, maps, and other game objects; commonly used to modify game content.
Oh.
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Lord Wolfram

I think that I should add that .dat file contains numbers like this

titleline
1111123456789074185229654124251572684324828746412544526464564345523463368215423

Daddy Poi's Oily Gorillas

#28
A bunch of numbers? Why? :P
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)