Homebrew Getting started in Homebrewing....

CannonFoddr

Regular GBATemp Lurker
OP
Member
Joined
Sep 23, 2006
Messages
4,134
Trophies
1
Age
56
Location
Sitting by computer
Website
www.youtube.com
XP
1,287
Country
[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

Code:
New Project Group
!-Tester
ÂÂ !-LzmaDec.c
ÂÂ !-LzmaDec.h
ÂÂ !-main.c
ÂÂ !-Makefile
ÂÂ !-nds.inilink.bmp
ÂÂ !-Thumbs.db
ÂÂ !-Types.h
ÂÂ !-warning_dstwo.png
ÂÂ !-warning_eos.png
ÂÂ !-warning_ex.png
ÂÂ !-warning_ismart.png
ÂÂ !-warning_m3sakura.png
ÂÂ !-warning_r4.png
ÂÂ !-warning_template.png

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...
bash.gif

but NOW I'm getting
CODEng2b15 < warning_eos.png | lzma_alone e warning_eos.b15lzma -lc1 -lp1 -d19 -si
/bin/sh: png2b15: command not found
/bin/sh: lzma_alone: command not found
"make": *** [warning_eos.b15lzma] Error 127

> Process Exit Code: 2
> Time Taken: 00:01
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
 

SifJar

Not a pirate
Member
Joined
Apr 4, 2009
Messages
6,022
Trophies
0
Website
Visit site
XP
1,175
Country
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.
 

CannonFoddr

Regular GBATemp Lurker
OP
Member
Joined
Sep 23, 2006
Messages
4,134
Trophies
1
Age
56
Location
Sitting by computer
Website
www.youtube.com
XP
1,287
Country
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' ......
CODEdefine bin2o
ÂÂÂÂbin2s $< | $(AS) -o $(@)
ÂÂÂÂecho "extern const u8" `(echo $(@F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end[];" > `(echo $(@F) | tr . _)`.h
ÂÂÂÂecho "extern const u8" `(echo $(@F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> `(echo $(@F) | tr . _)`.h
ÂÂÂÂecho "extern const u32" `(echo $(@F) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size";" >> `(echo $(@F) | tr . _)`.h
endef

ifeq ($(strip $(DEVKITARM)),)
$(error "Please set DEVKITARM in your environment. export DEVKITARM=devkitARM)
endif

include $(DEVKITARM)/ds_rules

export TARGETÂÂÂÂÂÂÂÂ:=ÂÂÂÂnds.inilink
export TOPDIRÂÂÂÂÂÂÂÂ:=ÂÂÂÂ$(CURDIR)
export PATHÂÂÂÂÂÂÂÂ:=ÂÂÂÂ$(DEVKITARM)/bin:$(PATH)

all: ../$(TARGET).nds
.PHONY: clean

clean:
ÂÂÂÂrm -f $(TARGET).arm9 main.o LzmaDec.o .map
ÂÂÂÂrm -f warning_eos.b15lzma warning_eos.b15lzma.o warning_eos_b15lzma.h
ÂÂÂÂ#rm -f warning_dstwo.b15lzma warning_dstwo.b15lzma.o warning_dstwo_b15lzma.h
ÂÂÂÂrm -f warning_m3sakura.b15lzma warning_m3sakura.b15lzma.o warning_m3sakura_b15lzma.h
ÂÂÂÂrm -f warning_r4.b15lzma warning_r4.b15lzma.o warning_r4_b15lzma.h
ÂÂÂÂrm -f warning_ismart.b15lzma warning_ismart.b15lzma.o warning_ismart_b15lzma.h
ÂÂÂÂrm -f warning_ez.b15lzma warning_ez.b15lzma.o warning_ez_b15lzma.h

### final build script ###
../$(TARGET).ndsÂÂÂÂ:ÂÂÂÂ$(TARGET).arm9
ÂÂÂÂndstoolÂÂÂÂ-c $(TARGET).nds -7 ../../arm7/arm7.bin -9 $(TARGET).arm9 -b $(TARGET).bmp "MoonShell2 inilinker;xxxloader multibyte;R4TF/TTIO/SCDS/RPGS/M3DS"
ÂÂÂÂmv -fÂÂÂÂ$(TARGET).nds ../

### compile main.c ###
LIBDIRSÂÂÂÂ:=ÂÂÂÂ$(LIBNDS)
export INCLUDEÂÂÂÂ:=ÂÂÂÂ$(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
ÂÂÂÂÂÂÂÂÂÂÂÂ$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
ÂÂÂÂÂÂÂÂÂÂÂÂ-I$(CURDIR)
export LIBPATHSÂÂÂÂ:=ÂÂÂÂ$(foreach dir,$(LIBDIRS),-L$(dir)/lib)
LIBSÂÂÂÂ:= ../../libprism/libprism.a -lnds9
ARCHÂÂÂÂ:=ÂÂÂÂ-mthumb -mthumb-interwork
CFLAGSÂÂÂÂ:=ÂÂÂÂ-Wall -O2 \
ÂÂÂÂÂÂÂÂÂÂÂÂ-march=armv5te -mtune=arm946e-s -fomit-frame-pointer \
ÂÂÂÂÂÂÂÂÂÂÂÂ-ffast-math -fdata-sections \
ÂÂÂÂÂÂÂÂÂÂÂÂ$(ARCH) -DARM9
LDFLAGSÂÂÂÂ=ÂÂÂÂ-s -specs=ds_arm9.specs $(ARCH) -mno-fpu -Wl,--gc-sections -Wl,-Map,$(notdir $*.map)
LDFLAGSÂÂÂÂ+=ÂÂÂÂ-Wl,--section-start,.init=0x02000000

B15LZMA := warning_eos.b15lzma.o warning_m3sakura.b15lzma.o warning_r4.b15lzma.o warning_ismart.b15lzma.o warning_ez.b15lzma.o

$(TARGET).arm9: main.c LzmaDec.c $(B15LZMA)
ÂÂÂÂ@echo Compiling...
ÂÂÂÂ@$(CC) $(CFLAGS) $(INCLUDE) -c -o main.o main.c
ÂÂÂÂ@$(CC) $(CFLAGS) $(INCLUDE) -c -o LzmaDec.o LzmaDec.c
ÂÂÂÂ@echo Linking...
ÂÂÂÂ@$(CC) $(LDFLAGS) -o $(TARGET).arm9.elf main.o LzmaDec.o $(B15LZMA) $(LIBPATHS) $(LIBS)
ÂÂÂÂ@$(OBJCOPY) -O binary $(TARGET).arm9.elf $(TARGET).arm9
ÂÂÂÂ@rm $(TARGET).arm9.elf

warning_eos.b15lzma: warning_eos.png
ÂÂÂÂpng2b15 < $(
 

SifJar

Not a pirate
Member
Joined
Apr 4, 2009
Messages
6,022
Trophies
0
Website
Visit site
XP
1,175
Country
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.
 

CannonFoddr

Regular GBATemp Lurker
OP
Member
Joined
Sep 23, 2006
Messages
4,134
Trophies
1
Age
56
Location
Sitting by computer
Website
www.youtube.com
XP
1,287
Country
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
 

SifJar

Not a pirate
Member
Joined
Apr 4, 2009
Messages
6,022
Trophies
0
Website
Visit site
XP
1,175
Country
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.
 

RoyalCardMan

DS App Studio™ Developer
Member
Joined
Aug 11, 2010
Messages
628
Trophies
0
Age
34
Location
In the middle of gun fire.
Website
www.awsomisoft.com
XP
200
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.
yaynds.gif
 

SifJar

Not a pirate
Member
Joined
Apr 4, 2009
Messages
6,022
Trophies
0
Website
Visit site
XP
1,175
Country
RoyalCardMan said:
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.
yaynds.gif

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.
 

RoyalCardMan

DS App Studio™ Developer
Member
Joined
Aug 11, 2010
Messages
628
Trophies
0
Age
34
Location
In the middle of gun fire.
Website
www.awsomisoft.com
XP
200
Country
United States
SifJar said:
RoyalCardMan said:
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.
yaynds.gif

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.
This ain't advertising, dude, and if I remember I included DS Game Maker as well.
closedeyes.gif

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.
lecture.gif
 

CannonFoddr

Regular GBATemp Lurker
OP
Member
Joined
Sep 23, 2006
Messages
4,134
Trophies
1
Age
56
Location
Sitting by computer
Website
www.youtube.com
XP
1,287
Country
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
 

CannonFoddr

Regular GBATemp Lurker
OP
Member
Joined
Sep 23, 2006
Messages
4,134
Trophies
1
Age
56
Location
Sitting by computer
Website
www.youtube.com
XP
1,287
Country
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
unsure.gif
.....





.... Nah !!! - to much hard work, I'll just post a request & hope some 'expert' can do it for me
wink2.gif
laugh.gif
 

RoyalCardMan

DS App Studio™ Developer
Member
Joined
Aug 11, 2010
Messages
628
Trophies
0
Age
34
Location
In the middle of gun fire.
Website
www.awsomisoft.com
XP
200
Country
United States
CannonFoddr said:
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
unsure.gif
.....





.... Nah !!! - to much hard work, I'll just post a request & hope some 'expert' can do it for me
wink2.gif
laugh.gif
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.
cry.gif
 

jurassicplayer

Completionist Themer
Member
Joined
Mar 7, 2009
Messages
4,486
Trophies
1
Location
Pantsuland
Website
www.youtube.com
XP
2,919
Country
United States
SifJar said:
I think the programmer had a very specific development environment, and it may be tricky to get it setup just right.

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).
 

CannonFoddr

Regular GBATemp Lurker
OP
Member
Joined
Sep 23, 2006
Messages
4,134
Trophies
1
Age
56
Location
Sitting by computer
Website
www.youtube.com
XP
1,287
Country
'Everything in one folder'
- Hmmm
unsure.gif
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
 

jurassicplayer

Completionist Themer
Member
Joined
Mar 7, 2009
Messages
4,486
Trophies
1
Location
Pantsuland
Website
www.youtube.com
XP
2,919
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?).
 

CannonFoddr

Regular GBATemp Lurker
OP
Member
Joined
Sep 23, 2006
Messages
4,134
Trophies
1
Age
56
Location
Sitting by computer
Website
www.youtube.com
XP
1,287
Country
@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
wink2.gif
- Just that DAM 'splash.ani' problem
 

jurassicplayer

Completionist Themer
Member
Joined
Mar 7, 2009
Messages
4,486
Trophies
1
Location
Pantsuland
Website
www.youtube.com
XP
2,919
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).
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: if i have time for that