Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - CiriousJoker

Pages: 1 [2] 3
16
A friend of mine asked me to code some sort of tool to trade Pokémon with friends while in school,
and here it is:

nTrade Advanced


It's a small application which allows you to trade Pokemon between third gen Pokemon games.
Note that it may fail with modded ROMs if they use another structure for the savefile.
Yes, I'm looking at you, Pokémon Glazed O.O


It works the way that your friend sends you his savefile, nTrade trades the Pokémon and you send back the changed save file.
This way you still have the ability to clone your Pokémons.



I also included the functionality to repair savefiles.
Note that this only works, if the save file is corrupt because of incorrect checksums.
Spoiler For Long Explanation:
A savefile contains 2 savestates, so that if your newest is broken, it loads the backup.

A savestate is divided into 14 sections, each 4096 bytes big.
The last few bytes of every section are reserved for a section number, the time code (to decide which savestate it belongs to) and a checksum.

If the checksums are correct, the game will always attempt to load the game.

My application recalculates the checksums, so you can always load the save file.

This will not recover bad eggs, as each Pokémon has its own checksum.
If the checksum is wrong, it shows up as a bad egg.


=> Give it a try if you want, but don't expect magic


~CiriousJoker

edit: all bugs should be fixed now

17
Calculator C / Re: NspireIO - undefined reference problem- ndless-sdk
« on: July 24, 2014, 06:01:14 pm »
I don't know if you still need this, but can't you use something like this?



char choice[1];
nio_printf(csl, "> ");         // wait for input
nio_fgets(choice,3,csl);      // store input in choice[]
return (int)choice[0];      // return choice


If it doesn't help you, maybe it helps others  ;)

 
However it doesn't accept buttons like the keypad, etc. only printable chars
If you set it to unsigned char, you may be able to use the second part of the ascii table, but i haven't tested it


~virus

18
For now, it works fine and if the user has so much folders, its not my fault  :P
Right now i dont notice any delay and i have quite some folders...
I don't think this much of a problem. I just used this version with the messagebox
because i was too lazy to make my own console function, this way its one line + some stuff
around to get the data into a struct.


However, thanks for the notice, if i feel some delay, i'll make use of it  :thumbsup:


EDIT: tryed it out on my real calculator and it really slowed it down, thanks, i fixed it <3

19
Problem solved now:


if you want to display messageboxes and console together, you have to switch between grayscale mode and color mode with


lcd_incolor();
lcd_ingray();
else it produces such graphic bugs  :w00t:

20
seems to be a problem with the grayscale mode...


if i add lcd_incolor();when i call the function, it "just" makes this graphical bug


EDIT: when i use the f10 (connect) command of the emulator, the screen is refreshed and it displays correctly.
Is there any similiar method in c or any ndless related library?

21
Calculator C / Re: [Ndless] Strange crash on load
« on: July 20, 2014, 09:30:31 am »
Ye i noticed the problem with the arrays :(
however malloc works fine :)

22
Lets say i have this function:


Code: [Select]


int main()
{

   nio_console csl;
   lcd_ingray();
   clrscr();
   nio_InitConsole(csl, 54, 30, 0, 0, 0, 15);
   nio_DrawConsole(csl);
   nio_drawing_enabled(&csl,TRUE);
   nio_cursor_type(&csl, NIO_CURSOR_UNDERSCORE);
   doSomething();
}


int doSomething()
{

   const char * title = "Title";
   const char * subtitle = "Sub titile";
   const char * msg1 = "Element 1";
   const char * msg2 = "Element 2";
   char * defaultvalue = "default value";
   char * value;
   int len;


   
   int value1 = 42;
   int value2 = 1337;
   char popup1_result[256];
   char popup2_result[256];
   if (show_1numeric_input(title, subtitle, msg1, &value1, -42, 9001) != 1) return 0;
   sprintf(popup1_result, "%s:%d", msg1, value1);
   show_msgbox(title, popup1_result);
}
(It's some code of the "ndless_popup_tests" example)


Than that results in a completely awkward screen.
If i use standard messagebox with title and content then it works perfectly and the box will be drawn over the console window.
However, using the used messagebox works so its just a graphical problem.
Is there a possibility to close the console window somehow and open it afterwards?

23
Calculator C / Re: [Ndless] Converting types
« on: July 19, 2014, 10:03:17 pm »
Can't you just cast it?


if u want to printf it then use %f


Sorry but you have to explain what you want and what doesnt work.
Maybe some example code.

24
Calculator C / Re: Ndless Hooking Tutorial (especially key-hooks)
« on: April 13, 2014, 04:15:24 pm »
Why shouldnt i use makros and how do i use the debugger??I dont know any assembler and i dont know anything about this debugger... I just know that the emulator stops working if i "debug"

25
Calculator C / Re: Ndless Hooking Tutorial (especially key-hooks)
« on: April 13, 2014, 05:58:51 am »
So i "just" have to find the right addresses?
Does this page help?

In the Link with the interrupt guy he talked about an address which i can find on this page:
http://hackspire.unsads.com/wiki/index.php/Memory-mapped_I/O_ports
But cause hes talking about interrupts, im not sure anymore, if this page could help me...

I need to fill hook_addr[] with all the addresses for all the ndless versions / hardware versions and

#define HOOK_ADDR
just decides which is used right?

How can i find these addresses? When i open the debugger, my emulator freezed (both emulators so it seems to be normal)

26
Calculator C / Re: Ndless Hooking Tutorial (especially key-hooks)
« on: April 12, 2014, 06:51:24 pm »
Vogtinator told me that the os interrupt handler is a good place to set up a hook. You tell me that the key code translator is the better place.
I "just" wanted a little code example cause i cant rly figure out how i can manipulate the ram(?)


I just wanted something like this if its possible:


Code: [Select]


installhook(ram_address, function_to_activate_when_ram_has_a_specific_value());


//or


installhook(ram_address); //launches my program, when user presses ctrl+return




Afaik, a hook means a ram address and if the value is changed, my code activates(?)
Plz correct me if im wrong

27
Calculator C / Re: Ndless Hooking Tutorial (especially key-hooks)
« on: April 12, 2014, 02:41:05 pm »
By finding out what interrupts are and everything around it, the only thread was this one:


http://www.omnimaga.org/calculator-c-language/(ndless)-interrupts-newbie-here/


You tried to help him and he seems to understand... I don't


Do you have any code example?

28
Calculator C / Re: Ndless Hooking Tutorial (especially key-hooks)
« on: April 12, 2014, 10:17:10 am »
bump


rly noone?

29
Calculator C / Re: Ndless Hooking Tutorial (especially key-hooks)
« on: April 11, 2014, 06:44:57 pm »
Now i found out that
n1_osvalue(... , ...);
is defined like this:

Code: [Select]
int n1_osvalue(const values[], unsigned size):
returns the value of values corresponding to the OS version. size is the number of values.
values[0] corresponds to non-CAS 3.1, values[1] to CAS 3.1, values[2] to non-CAS CX 3.1,
values[3] to CAS CX 3.1, values[4] to CM-C 3.1, values[5] to CAS CM-C 3.1.


Source: http://hackspire.unsads.com/wiki/index.php/Ndless_features_and_limitations#Builtin_functions
(second function)

So this means that for every os version the author of nclock has a specific address?

How do i get these addresses?

Does all this have anything to do with memory mapped io ports? (I guess not)
( http://hackspire.unsads.com/wiki/index.php/Memory-mapped_I/O_ports )

30
Calculator C / Ndless Hooking Tutorial (especially key-hooks)
« on: April 11, 2014, 05:58:47 pm »
Is there any good hooking tutorial for ndless on the ti-nspire 3.6?


I wanted to make a notepad which i can activate by something like ctrl+return.
I found "example" code in nClock (clock overlay in upper right corner). The Problem is that i dont know what part of the code actually installs the hook.
I found some lines that probably have to do with the hook (and hopefully only these):



Code: [Select]

/* Shared data between hook and nclock */
static long * display12hrs = 0;
... (same style as the line above)
static long * checkTimeOnStartup = 0;
static long * noMiniClock = 0;


Code: [Select]

/* Install hook */
HOOK_INSTALL(HOOK_ADDR, hook_nclock);


Code: [Select]

/* If hook isn't already installed */
if(*((int*)HOOK_ADDR) == HOOK_VALUE) {


}




Code: [Select]


HOOK_DEFINE(hook_nclock) {
    if(!*noMiniClock)
        mini_nclock(1);
    HOOK_RESTORE_RETURN(hook_nclock);
}


Code: [Select]
// Defines the adresses and value(?)

static const int hook_addrs[] = {0x100B66C8, 0x100B6988,  // Clickpad / Touchpad 3.1
                                 0x100EAAAC, 0x100EADC4,  // CX 3.1
                                 0x100E72CC, 0x100E75E4,  // CM 3.1
                                 0x101122b8, 0x100eb288,  // Clickpad / Touchpad 3.6
                                 0x10111cfc, 0x1011201C}; // CX 3.6


//What does this mean? what does nl_osvalue(... , ...); do?
#define HOOK_ADDR (nl_osvalue((int*)hook_addrs, sizeof(hook_addrs)/sizeof(hook_addrs[0])))


static const int hook_values[] = {0xe92d47f0, 0xe92d47f0,
                                  0xE59F1030, 0xE59F1030,
                                  0xE59F1030, 0xE59F1030,
                                  0xE59F1030, 0xE59F1030,
                                  0xE59F1030, 0xE59F1030};


#define HOOK_VALUE (nl_osvalue((int*)hook_values, sizeof(hook_values)/sizeof(hook_values[0])))


The full code of nclock is attached.

Pages: 1 [2] 3