jiangzhengwenjzw jiangzhengwenjzw is offline

You can (not) redo.

Visitor Messages

Showing Visitor Messages 76 to 90 of 136
  1. FBI
    April 7th, 2016 5:11 AM
    yes, vysnc
  2. FBI
    April 1st, 2016 7:43 PM
    Ah, thanks for confirming. I had a feeling the compiler was smart enough to handle that, but wasn't 100% sure :)
  3. FBI
    April 1st, 2016 6:43 PM
    I'm not 100% sure about that example with rand actually.

    I know you'd need to define the function header for "rand" inorder to be able to even use it as a parameter, but in general adding +1 in BPRE.ld should not affect functionality (I'm not 100% sure, just pretty sure).

    You can for example do this:

    void task_example(u8 task_id) {

    void set_task() {
    task_add(task_example, 0x1);
    task_add(task_example + 1, 0x1);

    I think both of those task_add will work. Try to compile it and check!
  4. FBI
    April 1st, 2016 8:53 AM
    Don't add +1 in C.
  5. FBI
    March 26th, 2016 8:32 AM
    Modify the make file? I don't know, why can't you use the Python files? Just download python :o
  6. FBI
    March 26th, 2016 7:32 AM
    I have no idea. I'm able to compile this source code http://imgur.com/AHT42gw
  7. FBI
    March 26th, 2016 7:20 AM
    you needed to do "extern void func_2();"

    Don't put the void inside the brackets. They mean different things.
  8. FBI
    March 26th, 2016 5:31 AM
    yeah this works. Try it
  9. FBI
    March 26th, 2016 5:17 AM
    extern void func_2();

    void func_1() { func_2();}


    void func_2() {}
  10. FBI
    March 26th, 2016 5:03 AM
    extern does work in devkitarm. Devkitarm is based off of GCC.
    extern the entire function header.
  11. FBI
    March 26th, 2016 4:23 AM
    Extern is how you would do it.
    Make sure you have the extern statement in the file which uses the functions, and not in the original file. Also what's wrong with including them?
  12. FBI
    March 24th, 2016 7:57 AM
    just copy it over, and change the "<>" to just normal double quotes :)
  13. FBI
    March 24th, 2016 4:38 AM
    You can always copy that directory into your project folder and use the
    "#include "gba.h".
    Otherwise you need to ensure the file paths are in your system directory.
  14. FBI
    March 23rd, 2016 5:27 AM
    Any local variable will be created in the stack, or a register would be used instead.

    Try this:

    u8 i = 5;
    set_attr (pokemon, attr_HP, &i);

    "i" would be created in the stack, and the SP would be passed into set_attr.

    In almost all situations, programming in C is superior to programming in ASM. However, I should note that the ASM instructions generated by GCC/DevkitARM/whatever_you're_using, will always not be as efficient as hand written ASM will be. A competent human writing ASM will, in some cases, write code more efficiently than the compiler generated code. However, the benefits of writing the exact code in ASM isn't exactly worth it. Consider this: Would you rather spend 10 mins writing C code which executes 100 CPU cycles slower? Or spend 30 minutes writing ASM code which executes 100 CPU cycles faster? 100 CPU cycles is very negligible depending on the nature of your code and where it's used. In 99% of cases, we wouldn't care about the slight efficiency drop. The GBA's processor has a clock speed of 16.78Mhz. That means every second it has the potential to do 16780000 cpu cycles. Saving 100 cycles and spending 20 minutes does absolutely nothing. Something like this would only matter in an area like the main loop, which is executed extremely frequently.
  15. FBI
    March 23rd, 2016 4:42 AM
    You can make an array/define one loosely using a pointer. For example,
    char [10] from a char array can be declared as type char *.
    Both can work.

    Here is another example of something that "works":

    It uses a nested struct instead.

About Me


Total Posts
Activity by Forum
Visitor Messages
General Information
  • Last Activity: 11 Hours Ago 2:06 PM
  • Join Date: September 21st, 2012
  • Referrals: 0


Showing Friends 1 to 6 of 6

Contact Info

Instant Messaging
Send an Instant Message to jiangzhengwenjzw Using...
This Page

All times are GMT -8. The time now is 1:26 AM.