Homebrew Homebrew Development

  • Thread starter Thread starter aliak11
  • Start date Start date
  • Views Views 1,475,558
  • Replies Replies 6,048
  • Likes Likes 54
For those that don't know, you should be updating object positioning based on the time it takes to render each frame, and not using any sort of wait/lag commands to adjust game fps. Common practice is to create a render() method to draw everything and an update(deltaTime) method to modify the positioning based on the deltaTime (time since last render in seconds). That way, in your update() method you can put stuff like obj.x += 10*deltaTime; and make it so the object moves 10 pixels per second regardless of lag. Of course, this requires float precision (some use double).

Example of basic game loop: https://github.com/cpp3ds/cpp3ds/blob/master/src/Scene.cpp
And that's a problem for two reasons. My build environment doesn't like float calculations and gives me errors when I use them. Second, arm9 has no hard float so it's slow. This it especially a problem with 3ds arm9 because, for some reason, it benchmarks much slower than nds arm9. I can't wait to see how slow floats would be if they actually worked. :P
 
I can't wait to see how slow floats would be if they actually worked. :P
I have it working, and I can post an example if I can get the time. The 3ds lib I'm making is based around floating point operations, but I'm trying to position it to be ready for when arm11 is accessible.

It's not slow enough not to use it imo, especially considering how it's much slower to do drawing operations in general (especially screen clearing). But once we can finally use the GPU, none of this will be a problem. I've frankly given up on trying to make games without decent hardware access lol.
 
Wait wut?
https://twitter.com/smealum/status/433254129868099584

anim2.gif
 
For those that don't know, you should be updating object positioning based on the time it takes to render each frame, and not using any sort of wait/lag commands to adjust game fps. Common practice is to create a render() method to draw everything and an update(deltaTime) method to modify the positioning based on the deltaTime (time since last render in seconds). That way, in your update() method you can put stuff like obj.x += 10*deltaTime; and make it so the object moves 10 pixels per second regardless of lag. Of course, this requires float precision (some use double).

Example of basic game loop: https://github.com/cpp3ds/cpp3ds/blob/master/src/Scene.cpp
What are the contents of the GetSystemTick() function? As we are unable to use any predefined functions I'm assuming you included that in a header file somewhere?
 
What are the contents of the GetSystemTick() function? As we are unable to use any predefined functions I'm assuming you included that in a header file somewhere?

Who said that? GetSystemTick() uses SVC, and almost all the SVC (partially documented on 3DBrew) can be teoretically used if you know, or can figure out, in which register load parameters.

I still think that in Smealun example there are a lot of small treasures that we can use (and I'm testing a couple of that B-)). Stay tuned ...
 
Would it be possible to dump DS cards (not 3DS) by extracting part of the RAM?

EDIT: Just remembered that you have to close the game (free it from RAM) before you can return to the home menu.
 
right, the arm9 has no vfp unit. the arm11 has a vfp unit for each core.

Thank you for answer, we need acess the ARM11...

i'm working on a "memory view" to check the memory of 3DS and trying decrypt the Launcher of gateway 3DS to study :p


YoshiInAVoid
Maybe no, i think the game is not completely loaded in the RAM, some part are loaded, and another part are loaded when is necessary =P
 
What cpu and arch C flags do I need for compiling code for arm 11?

EDIT: Smealum's ARM 11 Makefile doesn't specify the cpu in the C flags, is just arch needed (-march=armv6)?

Don't waste time,there are few chances you'll be able to run Smea code. At the moment probably only Smealum and few others can.
 
I don't want to run Smealum's code, I just want to run ARM 11 code.

I think I've managed to compile a blank ARM 11 binary, and changed my arm 9's entry to this (copies pre-compiled ARM 11 binary to the same place GW copies ARM 11 code to):

Code:
#include "main.h"
#include <string.h>
 
extern char binary_arm11_bin_start[];
extern char binary_arm11_bin_size[];
 
void c_entry() {
    memcpy((void *)0x1FFF4000, binary_arm11_bin_start, (size_t)binary_arm11_bin_size);
    main();
}

No idea how to get ARM 11 to execute it now though; and I'm not even sure if I've done everything correct so far. :wacko:

Don't think I'll be running ARM 11 any time soon :hateit:
 
  • Like
Reactions: YoshiInAVoid
Ta very much love!

Here's my dual Makefile (ARM 9 folder and ARM 11 folder) incase anyone wants my template (even though it can't actually run ARM 11 yet). It requires OpenSSL to create the GWLauncher.dat.

Code:
GWLauncher.dat: ROPLauncher.dat
    openssl enc -aes-128-cbc -K 580006192800C5F0FBFB04E06A682088 -iv 00000000000000000000000000000000 -in ROPLauncher.dat -out GWLauncher.dat
 
ROPLauncher.dat: ARM9/arm9.bin
    cat lib/p3ds/exp.bin arm9.bin lib/p3ds/pad.bin > ROPLauncher.dat
 
ARM9/arm9.bin: ARM9/bin/arm11.o
    $(MAKE) -C arm9
 
ARM9/bin/arm11.o: ARM11/arm11.bin
    ld -r -b binary -o ARM9/arm11.o ARM11/arm11.bin
 
ARM11/arm11.bin:
    $(MAKE) -C arm11

Just include this in your arm9 somewhere:

Code:
extern char binary_arm11_bin_start[];
extern char binary_arm11_bin_size[];

And you can go copying ARM 11 code around willing nilly like so:

Code:
memcpy((void *)0x1FFF4000, binary_arm11_bin_start, (size_t)binary_arm11_bin_size);
 

Site & Scene News

Popular threads in this forum