Getting started in Homebrewing....

Discussion in 'NDS - Emulation and Homebrew' started by CannonFoddr, May 8, 2011.

May 8, 2011
  1. CannonFoddr
    OP

    Member CannonFoddr Regular GBATemp Lurker

    Joined:
    Sep 23, 2006
    Messages:
    4,106
    Location:
    Sitting by computer
    Country:
    United Kingdom
    [I think this is really in wrong section - as I think it'll refer to ALL homebrew & not just NDS]
    Ok firstly, I don't consider myself a programmer, but I have dabbled (many MANY years ago) with stuff like BASIC, PASCAL, Visual Basic etc - so think I know a [very] small bit about it (structures/routines etc)

    Now the thing is - I doubt I'll ever be able to create 'from scratch' any type of program, but I think I may be able to 'tweak' exisiting 'stuff' (maybe clean up the code/make them more 'user friendly', change some colours/text in the program etc) - so I thought I'll start looking at some people existing source code to see how complicated it is etc (& if I can even understand it !!)

    Now so far I've only downloaded the latest 'DevKitpro' from sourceforge & custom installed only ARM, & 'programmer notepad' (can't see the point for PPC etc coding), & started looking through some of the examples included (like the 'hello world' etc)

    So [in programmers notepad] I use 'file' > 'open project' > browse to examples > load in a 'pnproj' file
    So I look through the code & then use 'tools' > 'make' to create a NDS file - & everything seems to works OK & I end up with a NDS file I can try out in an emulator (or whatever)

    Now...I try to look at other people source code - & the first thing is none have '.pnproj' files - only the 'source' folder (for this example I'm looking at Taiju 'inilink' code)

    Now [in programmers notepad] I guessing I have to 'make' a new project and 'include' the files in the source folder
    File > new Project > 'empty project (add a name 'tester' & folder 'desktop/test/') >
    In programmer notepad on the left I have
    Code:
    New Program Group
    !
    !- tester
    I then right click on 'tester' > Add files > then select all the files in taiju 'iniload/source/' folder
    I end up with

    Now I'm stuck - I can list/look at the code in the '.c','.h','makefile' etc - but how to I 'make' a NDS file to try out

    If I use 'tools' > 'make' like I did with the examples I get
    Code:
    "make": *** No targets specified and no makefile found.ÂÂStop.
    
    > Process Exit Code: 2
    > Time Taken: 00:00
    Yet 'makefile' is showing in the project list on the left - I know I'm doing something TOTALLY wrong, so any help appreciated
    (I've tried 'Googling' for tutorials of using programmers notepad - but most seem to be 'installation' guides - none seem to have 'problem solving')

    EDIT: As I'm typing this out - I've just found out that all the Taiju 'source' files should be in the '/desktop/tester' folder I made & not stored anywhere else - Duh... [​IMG]
    but NOW I'm getting
    Warning: Spoilers inside!
    So I'm guessing I'm missing something like a certain 'library' or something - (there's no '/bin/sh/' folder in the DevKitPro' folder so I'm guessing that's what it is)

    All I want to do is be able to look @ other peoples source code,make a few changes like backgound colors/text etc then 'make' a NDS to try out - so ANY help is appreciated
    (Just remember I am a TOTAL NEWBIE to this, so step-by-step guides would be appreciated)

    Thanks in advance
     
  2. SifJar

    Member SifJar Not a pirate

    Joined:
    Apr 4, 2009
    Messages:
    6,022
    Country:
    United Kingdom
    Sounds like you are missing some tools used in the compilation process. Could you post the contents of the file "MAKEFILE" please?

    BTW, the reason many homebrew projects don't have a .PNPROJ file is because you don't need to use PN2 to make homebrew. If you just want to tweak a homebrew a little, it's often easier to open the correct file from the "source" folder (e.g. "main.c") with an editor like PN2 or Notepad++, edit it and save, then open a command prompt, navigate to the homebrew's directory (i.e. the folder containing "MAKEFILE", as well as the "source" folder) and type "make". Beginners may find it easier to use PN2 to make their own homebrew, but when editing other homebrew, it can be a pain to make a project for it. Just a little advice, obviously do what you find easiest.
     
  3. CannonFoddr
    OP

    Member CannonFoddr Regular GBATemp Lurker

    Joined:
    Sep 23, 2006
    Messages:
    4,106
    Location:
    Sitting by computer
    Country:
    United Kingdom
    Well you could be right - as I said All I did was download DevKitPro & installed - could be that Taiju had some 'custom' stuff installed as well which doesn't come with the Devkit
    (I remember having problems like this when I use to try out 'Delphi' - custom libraries etc)

    I've only been 'attempting' Programmer Notepad as it came with the Devkit - the idea of 'just' notepad++ and 'make' cmd sound interesting
    (IIRC Notepad++ also has/can have 'C Code highlighting' which might any errors I may make show up better)

    Anyway onto the 'makefile' ......
    makefile contents
     
  4. SifJar

    Member SifJar Not a pirate

    Joined:
    Apr 4, 2009
    Messages:
    6,022
    Country:
    United Kingdom
    Looks like you need "png2b15" and/or "lzma_alone" in a folder listed in your PATH variable. Download png2b15 here: http://leafmoon.users.sourceforge.net/xeno...iles/png2b15.7z

    Just copy the file "png2b15.exe" into the directory "C:\devkitPro\devkitARM\bin", and then it should hopefully compile, or at least get past that error.

    From the looks of it, it is EITHER png2b15 OR lzma_alone that is needed (| is the or operator is many languages, I assume in makefiles too), so that should be enough.
     
  5. CannonFoddr
    OP

    Member CannonFoddr Regular GBATemp Lurker

    Joined:
    Sep 23, 2006
    Messages:
    4,106
    Location:
    Sitting by computer
    Country:
    United Kingdom
    Hmm - Seems like I need this lzma_alone file as well...
    Now getting CODEpng2b15 < warning_eos.png | lzma_alone e warning_eos.b15lzma -lc1 -lp1 -d19 -si
    /bin/sh: lzma_alone: command not found
    "make": *** [warning_eos.b15lzma] Error 127

    > Process Exit Code: 2
    > Time Taken: 00:01But the only lmza_alone files I can find via Googling seem to be for Linux & I'm on Windows
    EDIT: Found some lzmaalone.cpp files - not sure how to 'add' them though
     
  6. SifJar

    Member SifJar Not a pirate

    Joined:
    Apr 4, 2009
    Messages:
    6,022
    Country:
    United Kingdom
    lzmaalone.cpp files would need to be compiled, using a different environment to the one for DS. That's inconvenient...

    EDIT: Think I found it: http://7-zip.org/sdk.html - download that, and inside the archive there is "lzma.exe" - rename it to "lzma_alone.exe" and place it in the same folder as before, then try again.
     
  7. RoyalCardMan

    Member RoyalCardMan DS App Studio™ Developer

    Joined:
    Aug 11, 2010
    Messages:
    628
    Location:
    In the middle of gun fire.
    Country:
    United States
    If you have no programming skills in homebrew, you will have to start from the very beginning. Try using simpler software to make homebrew, such as DS Game Maker(Is easy to use, but limited to visual-development GUI) or DS App Studio(Easy to use programming language, DSAL, and it isn't limited).

    Your choice though. I started out small, came to the top very successfully. [​IMG]
     
  8. SifJar

    Member SifJar Not a pirate

    Joined:
    Apr 4, 2009
    Messages:
    6,022
    Country:
    United Kingdom
    1. He wants to edit other apps. Can your program do that? No, unless they were made with it, which in this case they weren't.
    2. This is just blatant advertising.
     
  9. RoyalCardMan

    Member RoyalCardMan DS App Studio™ Developer

    Joined:
    Aug 11, 2010
    Messages:
    628
    Location:
    In the middle of gun fire.
    Country:
    United States
    This ain't advertising, dude, and if I remember I included DS Game Maker as well. [​IMG]
    I gave him advice, and I thought it would be helpful. Now back off...

    @CannonFoddr
    It is somewhat of a good idea to edit other apps, but it is actually better to start from scratch. When starting from scratch, you have a better idea of what everything is because you edited it.

    But, it is your choice, as I said before. Editing other apps could be useful. [​IMG]
     
  10. CannonFoddr
    OP

    Member CannonFoddr Regular GBATemp Lurker

    Joined:
    Sep 23, 2006
    Messages:
    4,106
    Location:
    Sitting by computer
    Country:
    United Kingdom
    Well thanks to both of you - Yes I agree that 'making your own' IS the better way of doing things, since you know what you're doing (& where you're going wrong) - but sometime (& I've ALWAYS had this trouble) it normally takes ten times longer figuring out HOW to do something if you're 'self taught' (& I think I'm getting a little 'long-in-the-tooth' for 'self teaching' nowadays)

    The other way (as in 'tweaking existing code') IMHO is better since some1 has already done all the hard work, you're just tweaking here & there .... & you might even learn how they did what they did& that helps you in any later projects

    @Sifjar: thanks - that's got me further in 'making' - still got problems but I think it's more of the way the source code(s) have been done/made.

    It seems as though 'Taiju' has programmed some of his files using files in other folders (I'm getting faults like cannot find '../../libprism/libprism.h', which IIRC is another of the folders in Taiju mshl2tool download). There are also a LOT of other errors cropping up like 'tmp variable not in use' & stuff like that (Bad programming perhaps ??) so I think I'll give up for now attempting to alter other people stuff until I've read up a bit more. Could be I've been trying to run before I can walk

    Once again many thanks for the help
     
  11. SifJar

    Member SifJar Not a pirate

    Joined:
    Apr 4, 2009
    Messages:
    6,022
    Country:
    United Kingdom
    I think the programmer had a very specific development environment, and it may be tricky to get it setup just right.
     
  12. CannonFoddr
    OP

    Member CannonFoddr Regular GBATemp Lurker

    Joined:
    Sep 23, 2006
    Messages:
    4,106
    Location:
    Sitting by computer
    Country:
    United Kingdom
    I Agree......

    My best bet then [IMHO] is if I wanted to 'alter' existing code would be to (try &) learn C-programming, look @ the code source to try & understand what he used (libraries etc), then do the whole thing from scratch using the same stuff but in MY particular development enviroment [​IMG] .....





    .... Nah !!! - to much hard work, I'll just post a request & hope some 'expert' can do it for me [​IMG] [​IMG]
     
  13. RoyalCardMan

    Member RoyalCardMan DS App Studio™ Developer

    Joined:
    Aug 11, 2010
    Messages:
    628
    Location:
    In the middle of gun fire.
    Country:
    United States
    And the chances of them doing that....I don't even want to calculate.

    No offense, but usually developers don't do that kind of stuff for free. [​IMG]
     
  14. jurassicplayer

    Member jurassicplayer Completionist Themer

    Joined:
    Mar 7, 2009
    Messages:
    4,280
    Location:
    Pantsuland
    Country:
    United States
    It's somewhat specific. I took the lazy way out and download everything, stuff it in one folder, and go from there (=D yay for it working for me...).
    -edit-
    lulz I apparently missed the quote button (not really, I just replied before I finished reading the thread).
     
  15. CannonFoddr
    OP

    Member CannonFoddr Regular GBATemp Lurker

    Joined:
    Sep 23, 2006
    Messages:
    4,106
    Location:
    Sitting by computer
    Country:
    United Kingdom
    'Everything in one folder'
    - Hmmm [​IMG] that MIGHT work for certain errors I've been getting - but not the ones that crop up like the 'tmp variable not used' type errors I've been seeing.

    Guess I'll still need to learn 'C' to figure out WHY those type of messages crop up.

    Well, I guess you've been OK with Taiju files, JP - since you did modify the nds.inilink.nds file to 'black/plain' instead of that 'puke green/text' version. I just want to attempt something similar with the 'akaio.aio' one - I think it's basically the same as the nds.inilink.nds, just without the ROM loading part
     
  16. jurassicplayer

    Member jurassicplayer Completionist Themer

    Joined:
    Mar 7, 2009
    Messages:
    4,280
    Location:
    Pantsuland
    Country:
    United States
    Hm...From what I see, akaio.aio is just the regular akmenu4.nds from AKAIO (in other words, it IS AKAIO) so basically it is the ONLY ROM loading part xD (out of all the things that could have been chosen, you nailed the only one that deals with loading commercial ROMs)...
    :/ unfortunately because the akaio.aio one IS AKAIO, I have no idea what you are aiming to change xD (and my guide is still hellishly far from complete meaning you don't even have a way to find it and change it for yourself).
    Quick rundown of the files:
    akaio.aio > akmenu4.nds from AKAIO
    akaio.nds > iniclear (IIRC correctly you had this in MAIO so people had easy access to the regular AKAIO menu)
    moonshl2.nds > obviously moonshell2
    akmenu4.nds > moonshl2alt.nds (Alternative loader for Moonshell2 that fixes the problem that some flashcarts had with the regular MS2 loader causing no sound).

    akmenu4.nds runs first and then goes to moonshl2/reload.dat and from their the user chooses a game and it moves to inilink, then to akaio.aio (so where is it that you were hoping to make a change?).
     
  17. CannonFoddr
    OP

    Member CannonFoddr Regular GBATemp Lurker

    Joined:
    Sep 23, 2006
    Messages:
    4,106
    Location:
    Sitting by computer
    Country:
    United Kingdom
    @JP: Oopps sorry... I posted 'akaio.aio' - what I should've posted was 'akaio.nds', which according to you is 'iniclear.nds'
    (it's been such a long time since I did the original MAIO packages - I've forgotten what files are what)

    When I select 'AKAIO' in Moonshell I get a quick 'flash' of a purple screen full of text (A bit like what you see use to see with the 'nds.inilink.nds' when launching ROMS - in purple, not in that puke green colour).
    However - after a little experiment, it seems as though I can 'reuse' your version of 'nds.inilink.nds' as 'akaio.nds' instead (it looks quite good with the 'MAIO loading' screen when booting into AKAIO) although I've got to check that it doesn't accidentally load a ROM when selected (not having any ROM's on my card - while in work - to be able to check this out ATM)....

    ... & as you can guess from that paragraph above
    - my idea of being able to 'tweak' Taiju stuff is so that the bits I've used in MAIO will (hopefully) all match together.
    If this works OK - it's only the 'splash.ani' that spoils the current MAIO package overall effect, but I think THAT'S because of the Moonshell 2.09 overlay frigs etc

    If it doesn't work - then I hope that I can 'tweak' his iniclear code to do something similar to your 'inilink' - perhaps with it using different top/bottom screens to show 'booting to AKAIO' instead of the current 'MAIO' loading screen


    EDIT #2: Hmm ... seems like I CAN use JP alternative 'nds.inilink.nds' instead of the existing 'akaio.nds' [iniclear.nds] file - & with a little HEX editing I can even get it to load in different Top/Bottom screens when booting as well.... MAIO looking better each time [​IMG] - Just that DAM 'splash.ani' problem
     
  18. jurassicplayer

    Member jurassicplayer Completionist Themer

    Joined:
    Mar 7, 2009
    Messages:
    4,280
    Location:
    Pantsuland
    Country:
    United States
    I didn't test this much, but I'm pretty sure it works fine:
    -blargh old-
    Rename it as akaio.nds and add two lines to your inilink.ini
    Code:
    [Config]
    TopImage=/moonshl2/extlink/topload.bmp
    BottomImage=/moonshl2/extlink/bottomload.bmp
    This is just a really quick stuff together (I'll be changing it when I get the time), but right now I need to get to class xD.

    -edit-
    So I spent a slightly longer amount of time to make it slightly more spiffy. Now you can choose whether you want to be lazy and only have a topload/bottomload.bmp or have entirely separate images for iniclear.
    http://www.mediafire.com/?6xceo5oamjohow3
    For the inilink.ini, it shouldn't NEED to be required (though it defaults to topload/bottomload.bmp), but if you want to allow separate images for iniclear, just add:
    Code:
    ;Image Customization
    ;0==Default Image 1==Custom Image
    UseBootImg=1
    ;Default top image is '/moonshl2/extlink/topload.bmp'.
    TopImage=/moonshl2/extlink/topboot.bmp
    ;Default bottom image is '/moonshl2/extlink/bottomload.bmp'.
    BottomImage=/moonshl2/extlink/bottomboot.bmp
    ;-----------------------------------------------------------
    Right after the '[Config]' and it should be just fine (you still need some new images though).
     

Share This Page