Kodewerx
https://www.kodewerx.org/forum/

Possible to create in-game menus with AR?
https://www.kodewerx.org/forum/viewtopic.php?f=2&t=5930
Page 1 of 1

Author:  Aftermath [ Mon Aug 04, 2008 8:29 pm ]
Post subject:  Possible to create in-game menus with AR?

Firstly, for my purposes this would be for the DS, used mainly to make an in-game music selector, but could be used for any modifier.

Basically, all that would be necessary is to use some button combination to bring up a box with a selector that counts from 1 to whatever the end of the list is, and possibly have the name of whatever that value makes it (for a name or race modifier). However, I've never seen or heard of a code that utilizes any sort of GUI, nor do I know anything about how graphics work yet, so wanted to ask here if it's at all possible.

The two suggestions I've heard so far are to either hijack existing game code and piece it together to make a menu or to create my own simple graphics. The former sounds more feasible, but way more advanced than anything I've come close to doing.

So yeah, is something like this possible in any way, and if so, what would probably be the best method to create a simple menu?

Author:  jleemero [ Mon Aug 04, 2008 10:19 pm ]
Post subject:  Re: Possible to create in-game menus with AR?

Possible?
Eh, prolly.
Actually, well, yeah, totally possible.


It's also never been done, and would be un-fucking-believably difficult.
A fucking MASSIVE ASM code.

I've actually been looking into this.
So far, with what all I've done, I've realized something quite simple:
This is "possible", but not going to fucking happen. Seriously, NOT GOING TO FUCKING HAPPEN.
I mean, I'm sure Zeld could do this with some serious effort and time.
I don't expect to be able to do it myself, ever, period.

I have looked into a feasible alternative though.
Well, I've been thinking of using the game's existing menus n' such.
Think of it this way:
You have a game, and when you press start, it opens up the stats-screen.
Here you see your Gold, Health, Mana, Name, etc.
Make a code, where, at this point, you can hit, say, select, I guess.
And when you hit 'select':
Your name is stored elsewhere in memory - >
"Lvl 5 Gonzor Sword" is put in it's place, and displayed - >
When you hit 'up', it changes to "Lvl 6 Gonzor Sword", etc. - >
When you've found the weapon in this list you want, you hit 'select' again - >
You're given that particular weapon, and your name is changed back to what it was before - >
All is normal.

Simply using the existing in game menus as menus in order to pick things.
Even turn particular cheats on or off, same as a button combo, but with a 'semi-sorta-almost intuitive kinda-nice GUI'.




But, on your original idea, yeah, don't expect it, seriously.
Damn would I LURV it though..

Author:  Aftermath [ Wed Aug 06, 2008 12:30 am ]
Post subject:  Re: Possible to create in-game menus with AR?

Well, someone else gave me a suggestion that might be another possible avenue if it'd go how I think.

Basically, if AR can make calls to the DS firmware, then other than figuring out how to do that, the process from there could be simpler, as I'd assume the firmware has some built-in routines for menus. If the AR can actually do that, then homebrew websites will probably be the best aid for this, as those guys should already know the firmware somewhat and how to do coding on the platform, which would be necessary I presume.

Anyway, I'm going to keep looking into it, as if somehow a base template could be coded up, then it'd be a ridiculously good tool on just about every game.

Author:  jleemero [ Wed Aug 06, 2008 8:05 am ]
Post subject:  Re: Possible to create in-game menus with AR?

...
You mean the DS Firmware...
Ha, haha.
No.
Absolutely not.

Just so you know, myself, and a few others here, are DS Developers.


What you're talking about there would be possible if the DS Firmware acted as an "Operating System" on the DS, and applications ran on top of it.
BUT.
That's NOT the case.

The DS Firmware IS just an application, with the ability to start other applications.
The only difference between the firmware on the DS, and any other game you've ever put in your DS, is that the firmware is built in.
Simple as that.

Once you're in-game, the firmware isn't running.
It doesn't have to be.

So unfortunately, while actually not a bad idea at all, wouldn't work in this case.
Ever.
Blame Nintendo.

Author:  lemmayoshi [ Wed Aug 06, 2008 9:45 am ]
Post subject:  Re: Possible to create in-game menus with AR?

The Action Replay can write to the firmware (example: Metroid Prime Hunters Bricking code and the Wifi Unbanner both by Parasyte), if that's what you're asking.

Author:  jleemero [ Wed Aug 06, 2008 10:50 am ]
Post subject:  Re: Possible to create in-game menus with AR?

Naw.
What he's wondering is simple (and really a nice idea).
He's wondering if the DS firmware has built in functions for drawing data to the screen (ie Making windows, menus, buttons), and if so, can those functions be accessed by codes.

But, the thing is, DS Games don't run on top of the firmware, they run separate from it. The firmware isn't "used" by games.
The DS firmware does NOT contain drawing functions n' such.
Now, if the DS Firmware were used as an OS on the DS, and did contain drawing functions, codes to access these functions would be totally possible.
But the firmware isn't used as an OS, so they didn't include any of that kind of stuff, so this sort of thing isn't possible.

Author:  HyperHacker [ Wed Aug 06, 2008 4:13 pm ]
Post subject:  Re: Possible to create in-game menus with AR?

Of course, the games themselves probably have graphic functions you could use.

Author:  James0x57 [ Wed Aug 06, 2008 4:20 pm ]
Post subject:  Re: Possible to create in-game menus with AR?

That's what I was thinking too but most menus in a game are each completely different... so would there be a creation function? Probably not. ;(

Author:  Aftermath [ Wed Aug 06, 2008 5:58 pm ]
Post subject:  Re: Possible to create in-game menus with AR?

Ah, okay, yeah, I did overestimate the firmware. It seems to me that a lot of games use similar menu styles and fonts.

As for how the game would have its own routines and whatnot, I was wondering what the actual coded data of the game would look like. I've assumed it's just in ASM, but some computer-guy was saying it'd most likely be in some easier language like C, then compiled, which makes way more sense. Anyway, my actual question is, what might game code for menus, physics, etc (the stuff running the game) look like?

There were a few times when I was hacking Dawn of Sorrow that I thought I found the programming for weapon behavior, but couldn't decipher much of it, much less augment it in any perceivable way.

With that info, I think I'll probably make my first goals to find the screen buffer (computer-guy said that would be helpful to watch as I change things) and try to find some simple process and make it have a different function (probably damage calculation or MP using things, so I'd just change a couple lines to have the opposite effect).

Author:  HyperHacker [ Thu Aug 07, 2008 9:28 pm ]
Post subject:  Re: Possible to create in-game menus with AR?

C and ASM are both compiled to machine code. For an example of a game's C code, look at an open-source game written in C. For an example of machine code, look at a game's memory dump.

Author:  jleemero [ Fri Aug 08, 2008 9:34 am ]
Post subject:  Re: Possible to create in-game menus with AR?

Here's something simple.
Code:
/*---------------------------------------------------------------------------------

---------------------------------------------------------------------------------*/
#include <nds.h>

#include <stdio.h>

volatile int frame = 0;

//---------------------------------------------------------------------------------
void Vblank() {
//---------------------------------------------------------------------------------
   frame++;
}
   
//---------------------------------------------------------------------------------
int main(void) {
//---------------------------------------------------------------------------------


   irqInit();
   irqSet(IRQ_VBLANK, Vblank);
   irqEnable(IRQ_VBLANK);
   videoSetMode(0);   //not using the main screen
   videoSetModeSub(MODE_0_2D | DISPLAY_BG0_ACTIVE);   //sub bg 0 will be used to print text
   vramSetBankC(VRAM_C_SUB_BG);

   SUB_BG0_CR = BG_MAP_BASE(31);
   
   BG_PALETTE_SUB[255] = RGB15(31,31,31);   //by default font will be rendered with color 255
   
   
   consoleInitDefault((u16*)SCREEN_BASE_BLOCK_SUB(31), (u16*)CHAR_BASE_BLOCK_SUB(0), 16);


   iprintf("     Oh hi.\n");

   while(1) {
   
      swiWaitForVBlank();
      
   
   }

   return 0;
}



What does this do?
Attachment:
Screen1.jpg
Screen1.jpg [ 2.3 KiB | Viewed 5250 times ]



That.

That's all.


But what is it in the end?
That is, the binary.
The .nds file, which contains the .bin files the DS runs.
What's in those files?

That is, the ASM, and the Hex code.
Well Hex code is simply a bunch of fucking numbers (Hexadecimal ones) that translate into ASM.
Here's something about ASM though: It's not universal.
ASM on the DS is ARM9 ASM, whereas on your computer, more than likely, it's x86 ASM.
Different shit.

Now, I could post it here, the ASM that made that program.
But I won't.
Because it won't fit.
On this whole fucking page it wouldn't fit.
There's a lot.

Page 1 of 1 All times are UTC - 8 hours [ DST ]
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/