Pages: « 123 »
Posted on 02-15-16, 10:56 pm (rev. 1 by  skawo on 02-15-16, 10:58 pm)


Karma: 19752
Posts: 257/1100
Since: 04-02-13
Any idea how/if this can be fixed?



This happens when using certain functions, like the OAM controlling ones, or, as in this case, timerStart();
And if it cannot be fixed, how would I do something based on a timer? Things happen to work faster on an emulator than a real console, causing problems.
Posted on 02-24-16, 12:35 pm
Super Mario
( ͡° ͜ʖ ͡°)

Karma: 9979
Posts: 4317/4456
Since: 06-08-11
The image is broken
Posted on 02-25-16, 08:08 pm


Karma: 19752
Posts: 266/1100
Since: 04-02-13
Fixed image.
Posted on 02-28-16, 03:33 pm (rev. 1 by  Dirbaio on 02-28-16, 03:35 pm)
Super Mario
( ͡° ͜ʖ ͡°)

Karma: 9979
Posts: 4318/4456
Since: 06-08-11
Oh... __irq_vector and __irq_flags are defined in devkitPro's linker script, which you can see here: https://github.com/devkitPro/buildscripts/blob/master/dkarm-eabi/crtls/ds_arm9.ld#L12

Adding this to the ASM patch template linker script *would* make it compile, but it probably won't work, because libnds's use of the IRQs and timers will most likely conflict with NSMB's. So yeah, there are functions from libnds you can't use as-is in an asm hack

The Nintendo SDK has many functions that abstract timing and threads from the programmers, and these expect to have complete control over the hardware (timers and IRQs), if you change stuff manually you may break the game. So you have to either find and use Nintendo's functions, or be very careful.

If you want to do stuff based on a timer, you have several options:
- If you want to run every frame or a multiple of it, simplest thing is to hook somewhere that runs every frame.
- Use timers. I'm sure there is some function from the SDK that lets you schedule a function based on a timer, it's maybe on the IDA db. It's unlikely you need that precision though.

For example, the sound hack creates a thread that's woken up every vblank here:
https://github.com/Dirbaio/NSMBCR/blob/master/source/soundThread.cpp#L28

It then uses timers 2 and 3 manually (I checked NSMB doesn't use them), but it doesn't use them to fire an IRQ and run code, it just uses them to measure time. So, every vblank it wakes up, calculates how much time has elapsed since last vblank and reads the required amount of samples from ROM.
https://github.com/Dirbaio/NSMBCR/blob/master/source/wavplayer.cpp#L58

Not sure why the OAM stuff depends on IRQs, it probably doesn't depend on them directly and you can use it. You'll also have problems if use libnds's oam stuff instead of Nintendo's though.
Posted on 02-28-16, 05:50 pm (rev. 2 by  skawo on 02-28-16, 05:51 pm)


Karma: 19752
Posts: 274/1100
Since: 04-02-13
Yes, I have already thought of adding that to the linker script, and it did indeed compile, but did, indeed, not work correctly.

Further suggestions are welcome, however, doubtful as it is I'll know how to actually use them.
Posted on 01-31-17, 11:02 pm


Karma: 1
Posts: 1/1
Since: 10-16-16
Woah, this tutorial is awesome! while it is geared toward nsmbe, it gave me some helpful info I found really helpful!
Posted on 11-03-17, 10:13 pm
Goomba
Nintendo Collector

Karma: 180
Posts: 1/23
Since: 11-03-17
Hello!

Sorry for replying to such an old thread but I really want to get into ASM.
I am having trouble while trying to run "make" and insert, it gives me this error in CMD:

"make" is not recognized as an internal or external command, operatable program or batch file. Click any key to continue

Any tip on what to do? Great thread by the way!
_________________________

Super Mario Bros Odyssey!

Posted on 11-03-17, 10:48 pm
Nipper Plant


Karma: 2406
Posts: 291/417
Since: 08-17-15
Have you installed devkitPro?
Download it here: https://sourceforge.net/projects/devkitpro/
Posted on 11-03-17, 10:54 pm
Goomba
Nintendo Collector

Karma: 180
Posts: 2/23
Since: 11-03-17
Posted by newluigidev
Have you installed devkitPro?
Download it here: https://sourceforge.net/projects/devkitpro/


Yes, Devkitpro is installed, not sure if theres a way I have to show the program that I actually have it installed though.
_________________________

Super Mario Bros Odyssey!

Posted on 11-04-17, 12:44 am
Mariomaster

Karma: 8528
Posts: 1026/1681
Since: 06-09-12
Be sure that devkitpro is in the PATH environment varibale. If it is not there, reinstall devkitPro.

If it is there open cmd and type "make" if it tells you that it's not found something is wrong with your devkitPro installation and you should probably just reinstall it.
_________________________
GitHub - Kuribo64 - YouTube
Posted on 11-04-17, 11:19 am
Goomba
Nintendo Collector

Karma: 180
Posts: 3/23
Since: 11-03-17
Posted by RicBent
Be sure that devkitpro is in the PATH environment varibale. If it is not there, reinstall devkitPro.

If it is there open cmd and type "make" if it tells you that it's not found something is wrong with your devkitPro installation and you should probably just reinstall it.


Thanks for helping out, even after reinstalling DevkitPro it won't let me use "make". Yes, it is in the PATH environment.
_________________________

Super Mario Bros Odyssey!

Posted on 11-09-17, 08:02 pm
Goomba
Nintendo Collector

Karma: 180
Posts: 14/23
Since: 11-03-17
Is it possible to get some more help on this?
_________________________

Super Mario Bros Odyssey!

Posted on 11-09-17, 09:41 pm
Goomba
Shinig stars !

Karma: 32
Posts: 16/28
Since: 04-05-17
Go in the control panel of you computer.
Click on : System and Security > System
Click on : Advanced Parameters.
A new window will show up.
Now you need to click on the Environment Variables Button.
In the system variables board, search Path, double click on the path.
If a value is already set with de devkitpro path, delete it.
-If there are other values, copy paste this before all of these : C:\devkitPro\msys\bin; (with the semicolon)
-If there's no values, copy and paste this : C:\devkitPro\msys\bin
Now click on Ok.

The devkit pro path is now fixed
Just, i have translated all the names (from control panel) from the french and it may not be the exact translation, if you don't find, contact me or search approximately.
_________________________
My NSMB Hack project is coming soon!
Posted on 11-09-17, 09:48 pm (rev. 1 by  NorwegianMario on 11-09-17, 10:01 pm)
Goomba
Nintendo Collector

Karma: 180
Posts: 15/23
Since: 11-03-17
EDIT
Actually screw what I said, it was me that opened the wrong rom file in NSMBe, sorry about that.

So the rom is in the template I downloaded from the OP as you can see:


Also here is a picture of the path-thingies for instance.



Still it tells me that it cannot "make", and I am really starting to get angered about failing each and every time. As mentioned above I am so glad you are helping me out on this.
_________________________

Super Mario Bros Odyssey!

Posted on 03-18-18, 01:38 pm
Newcomer


Karma: 1
Posts: 1/1
Since: 02-18-18
I Need A Copy Of Make.exe
Posted on 03-18-18, 02:05 pm
Mariomaster

Karma: 8528
Posts: 1157/1681
Since: 06-09-12
Posted by Dirbaio

You will need


  • Latest DevkitPro

  • DevkitPro installs all the build tools needed including make.
    _________________________
    GitHub - Kuribo64 - YouTube
    Posted on 06-01-19, 12:28 pm
    Micro-Goomba
    New Soup Chef

    Karma: 8
    Posts: 4/10
    Since: 05-31-19

    I have DevKitPro, but it just gives me this error if I use Run 'make' and insert.

    _________________________

    i am proud to be your gay cousin

    Posted on 09-11-20, 04:20 pm (rev. 1 by  Super luigi fan on 09-12-20, 07:31 pm)
    Red Koopa
    Do you know da wea?

    Karma: 36
    Posts: 64/124
    Since: 08-01-19
    pressed run and make insert it give me an error here's a screenshot of it

    Posted on 09-12-20, 12:41 pm
    Mariomaster

    Karma: 8528
    Posts: 1580/1681
    Since: 06-09-12
    The path to your ROM may not include any spaces or other special characters. That throws off the build tools on Windows.
    _________________________
    GitHub - Kuribo64 - YouTube
    Posted on 09-12-20, 07:23 pm
    Red Koopa
    Do you know da wea?

    Karma: 36
    Posts: 65/124
    Since: 08-01-19
    Posted by RicBent
    The path to your ROM may not include any spaces or other special characters. That throws off the build tools on Windows.
    do i need to download different rom
    Pages: « 123 »