GBAtemp.net - The Independent Video Game Community

Nanquitas
Nanquitas
For compiling it I use arm-none-eabi-gcc but you probably can compile with any compiler. What do you mean when you say you won't have the same file ? If you try to use it in a plugin using my lib, you just have to put the .c file in the source folder and change the config.h accordingly to your image.
Asdolo
Asdolo
I downloaded the ACNL cheat menu plugin, which have your png2c tool (nice work!!), and I tried to convert a PNG image that was in the pictures folder to .c file and then I compiled it to .o file.
I compared my .o file and the one which already was in the plugin (from the same image, of course), and they are not the exact same (I compared with hex editor).
Asdolo
Asdolo
I also remember that I tried to move the .c created with png2c to the sources folder, but when I ran build, it did't compile them to the .o files, so the build throw me an error. That's because I tried to compile every .c created with png2c.
Asdolo
Asdolo
Is there any particular compiler flags that I need to put in arm-none-eabi-gcc? I tried -c, -S, etc...
The best result is with -c flag, but like I said, the .o I created with some image is not the exact same as the .o which come with the plugin for the same image :(
Thank you!
Nanquitas
Nanquitas
That's because you always need to put the -rotate flag when converting an image. Then if it's a background, add the -rgb flag in order to remove the alpha channel.
You don't need any particular flag for compiling it, your error probably came from the linker as they're two same object to link.
Nanquitas
Nanquitas
In order to gain time on the compilation you don't need to compile the png every time, so when you compiled it once, we move the .o into the ofiles folder and we remove the .c. That way you don't need to recompile the image every time (and it can quite long).
Asdolo
Asdolo
Thank you for your help! I succeeded in make the .o files and they worked. I did grab the ACNL Multi Cheat plugin and manage to change the images.
Asdolo
Asdolo
I have another question if you don't mind. I saw the ACNL Multi Cheat plugin code, and I can't find a "main". Is that in your libShark2NTR? Is the libShark2NTR the core in this plugin? If I just want to make a Hello World plugin which a image background using your tool, how I can "render" that .o file? I can't find anything like a render function.
Asdolo
Asdolo
Also, how is a "cheat menu" works? If you press SELECT it shows up the menu with the background. Where in the code is the checking of the select button pressing? I guess in the core, which I guess is your libShark2NTR. Is that correct?
Nanquitas
Nanquitas
Indeed, libShark2NTR is the core of the plugin. The main is already compiled (main.o) and will load the core.
How it works: Game start -> NTR Launch the plugin, main() is called -> my main set up some things and will then create a thread which will load the core.
Nanquitas
Nanquitas
When the core is launched, it'll set up a few things and then will search for a function: my_menus(). This function must be declared and is the one which will build the menu structure. The menu is using function pointers so each entry can be linked to a function (or be null).
When you trigger an entry in the menu, the function linked to the entry will be called.
Nanquitas
Nanquitas
Nanquitas
Nanquitas
Nanquitas
I just read your post again, and maybe I didn't fully understand your post. You don't want to change the background but get rid of the menu and just render your image ? If so then you can't with libShark2ntr. :/ At most you can render your image but only when triggering a function from the menu. If it's the goal you're trying to achieve, pm me I'll tell you why, how to and the few needs to know things. ;)
Asdolo
Asdolo
Are you going to release the libShark2NTR? I really want to know how it's made. I don't want to make a cheat plugin, I'm thinking in another plugin, with a menu, and also with images. I'm interested in the LCD screen printing, for text and for images.
Nanquitas
Nanquitas
Not planned at the moment. I don't have the sources at the moment, and the version I could retrieve is really to messed up thanks to few experiments and not working. :P I'm working on something new which result to this experiments.
Nanquitas
Nanquitas
As for your plugin I can help you but you need to take one things into account: memory. Adding an image to the plugin expand it's size and on the 3DS as a plugin we are really limited. That's why I couldn't really do what I planned, the plugin was too heavy and prevented games to be launched.
Asdolo
Asdolo
I'd love to get some help :)
Right now I'm not at home, but tomorrow I will PM you.

About the ram limit, is there any way to dynamically load images from sdcard? I think the LCD printing is just a buffer in RAM, right? So you can load an image from sd, convert it to the buffer format and then write in the LCD buffer?
Asdolo
Asdolo
My plugin idea is to make game guides, with some beauty background, like your libShark2NTR does.
The idea is to show some text (also, how did you print I'm colour?), and if possible some images.

To make the plugin itself, I would make a guide-generator thing with C# or something like that.
Asdolo
Asdolo
Thank you for your gentle!
General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: https://www.youtube.com/watch?v=pW7LwaU1xMw