gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Introduction to Nintendo DS Programming

#96323 - Patater - Wed Aug 02, 2006 4:24 pm

I've just released my manual for the SCDev.org competition. I'm not sure how many of you are familiar with my manual, but it covers the legality of homebrew, how to select a passthrough device, basic external rotation 16bit backgrounds, basic sprites, and basic game mechanics. It's not written in basic, though it is and introduction and therefore basic. I cover the beginnings of making an asteroids clone as the case study throughout the manual.

It comes with source code and a designed for printing pdf. The source is in C++ (but easy to tweak into C if you feel the need).

Here is an excerpt from the manual.

Quote:
You love playing games on your Nintendo DS. Every game you?ve played has been a wonderful experience, each one leaving a lovely aftertaste on your gaming tongue. You may have wondered to yourself what it'd be like to create games, to offer your own software up for licking. You?ve drawn diagrams of games you?d love to make, worlds you want to share with others. But how to go about it? You think and are lost: you are stuck. Where do I start? What's going on inside that pretty little dual-screen box?

This manual is designed to help you get an idea of what's going on inside the Nintendo DS. With a bit of effort and time, you?ll be on your way to creating your own games. Join us, the homebrew community. You?ll have a great time giving others a great time, collaborating on projects, and feeling the rush of intense and under pressure coding for numerous coding competitions.



SCDev.org entry: http://scdev.org/forum/viewtopic.php?t=5227
SCdev.org poll: http://scdev.org/forum/viewtopic.php?t=5266
Manual Homepage: http://www.patatersoft.info/manual.html

Feel free to pm, email, or meet me on #dsdev if you have suggestions or comments. Enjoy!

Cheers,
Patater

#96331 - Optihut - Wed Aug 02, 2006 5:08 pm

The topic sure is interesting - I don't have time at the moment, so I have set a bookmark and will check it out later!

#96347 - tepples - Wed Aug 02, 2006 7:29 pm

Quote:
It is highly recommended by the homebrew community to buy one from a fellow developer and not a company that commercially produces hardware meant for pirating Nintendo DS software. Thus, one should not buy a SuperPass or SuperKey from SuperCard, a MagicKey from NeoFlash, a PassKey from G6Flash, a PassKey or PassCard 3 from M3Adapter, or a Max Media Loader from the horrid Datel (a very unprofessional company run by immature anti-Nintendo kiddies). Each of these companies manufactures hardware that is used to pirate Nintendo DS software and should be avoided at all costs. The best place to buy a passthrough device today is from DSPassme.com (http://www.dspassme.com/oscommerce/catalog/index.php).

In short, "Do not buy a NoPass." For owners of a new DS, the only alternative to a NoPass is a PassMe2. But a PassMe2 requires a GBA card that contains rewritable memory in both the GBA ROM and GBA SRAM address spaces. These are SuperCard, M3, G6, or traditional GBA flash cards. The above paragraph rules out SuperCard, M3, and G6 by name, and traditional GBA flash cards are still manufactured by "a company that commercially produces hardware meant for pirating Nintendo DS software." The manual then goes on to recommend a GBA Movie Player, which is completely incompatible with PassMe2.

Was this intentional? Are people supposed to walk away with the notion that all DS homebrew requires hardware produced by piracy-friendly companies? Or are all homebrew beginners supposed to go on eBay and look for a DS with old firmware?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#96374 - Optihut - Wed Aug 02, 2006 11:13 pm

Ok, I have read it now. The section tepples quotes had me wondering as well.

I really like the layout, but I think a few more definite statements what to get / do (for instance when converting the pictures) and more links would help. The program left me with a few question marks over my head, as I haven't looked into the nds.h yet to see what functions are available.

I am sure that once I have delved a bit deeper into DS programming, this manual will come in handy, though.

#96473 - Spaceface - Thu Aug 03, 2006 3:11 pm

I went through the manual about 3 months ago but got annoyed with some stuff that seemed to be different in the source. I can't remember what exactly, but all of a sudden there was new stuff in the source that hadn't been introduced in the tutorial.

While this sounds a bit negative, I'm feeling the exact opposite about the manual. I think it's a perfect piece of work that could very well be the bible for a lot of starters, the way gbajunkie was for a lot op gbadevs. I'm just hoping it'll get more into detail. Like the graphics-conversion stuff someone else talked about but also about tilemaps. I'd love a section on that since they're very common in 2D games :)

#96479 - Patater - Thu Aug 03, 2006 3:32 pm

Thanks for your suggestions.

In response to tepples, there truly is no way to start homebrewing with a new DS without buying a product from a company that supports piracy. It a very regrettable situation. I can expand on this in my manual, as it seems I need to. What we need to do, and what sgstair has proposed to help the community out with, is a special new nopass device that has 64Mbit flash memory. This memory size is too small to be used for Nintendo DS games, as each game is 128Mbit or larger. Also, it will not be possible to use it for GBA games, since it runs from slot 1, the NDS card slot. It would be a perfect solution for this problem and I wish sgstair and those other people in the community who are working on such a project good luck, you are our only hope.

In response to Optihut, I have received many requests to add how to do graphic conversion into the manual. Now that git may become the multiplatform standard due to WinterMute's porting efforts, I may just write up a section on how to use git. Also, I plan on adding a section on how to convert sounds and how to play them using the functions now built into libnds.

In response to Spaceface, yes, three months ago the manual had many more problems than it does now. I have corrected a lot of those inconsistencies in the recent weeks, but I still need to get around to mentioning what the Coordinate struct is all about. I want the manual to be good enough that you, following along chapter by chapter, don't need to peek into the SPOILERS folder of the source to get the program working. I think I failed there though, with these inconsistencies.

Thanks for all your feedback. I did win first place in the SCDev.org competition, so I'm happy about that. I'll be getting a white DS Lite within the next week or so. Any additional suggestions or comments are gladly considered and will lead to a better manual.

Thanks again,
Patater

#96483 - tepples - Thu Aug 03, 2006 3:45 pm

Patater wrote:
In response to tepples, there truly is no way to start homebrewing with a new DS without buying a product from a company that supports piracy.

Heck even Disney supports piracy. So is Pastafarianism as widespread as Scientology yet?

Quote:
What we need to do, and what sgstair has proposed to help the community out with, is a special new nopass device that has 64Mbit flash memory. This memory size is too small to be used for Nintendo DS games, as each game is 128Mbit or larger.

A site that I may not be allowed to link to states that Polarium, Zookeeper, Bomberman, Whac-a-Mole, Ford Racing 3, Snood 2, James Pond, Big Brain Academy, Magnetica, Sudoku Gridmaster, Opera, and several other commercial games are 64 Mbit. In addition, it alone isn't even a universal homebrew solution, as a few homebrew GBA games are bigger than 64 Mbit *cough*Gleam*cough* and would remain larger than 64 Mbit if ported to the DS.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#96505 - psycorpse - Thu Aug 03, 2006 4:59 pm

Patater wrote:
Also, I plan on adding a section on how to convert sounds and how to play them using the functions now built into libnds.


This would be a great addition! I am looking forword to seeing that. Keep up the good work Patater.

#96690 - JaJa - Fri Aug 04, 2006 7:21 pm

Yup, the manual is superb, until it fails to explain how to convert the graphics.

Git is working on all platforms now (I think) and seems to be very powerful.

A section on using it would be great, as would sounds.

Many people start using PALib because of it's tutorial style wiki, which makes it accessible, maybe this manual could become something similar for LibNDS?
_________________
LAWL HOOGE
My Blog

#96691 - MaHe - Fri Aug 04, 2006 7:25 pm

Patater wrote:
Thanks for your suggestions.

In response to tepples, there truly is no way to start homebrewing with a new DS without buying a product from a company that supports piracy.

Datel doesn't support piracy (no, 'backups' won't run from MMP) ...
_________________
[ Crimson and Black Nintendo DS Lite | CycloDS Evolution | EZ-Flash 3-in-1 | 1 GB Transcend microSD ]

#96698 - JaJa - Fri Aug 04, 2006 8:36 pm

MaHe wrote:
Patater wrote:
Thanks for your suggestions.

In response to tepples, there truly is no way to start homebrewing with a new DS without buying a product from a company that supports piracy.

Datel doesn't support piracy (no, 'backups' won't run from MMP) ...


Datel are pirates themselves.
They rip code and ideas from other companies and then use their money to place their products into reach of the consumers.

For example, their MAX Media Dock, or whatever it's called, that's a GBAMP with the registers shifted, and their Gamecube software that used the header from a basketball game.

The only original thing they have created is their NoPass, which still used ideas 'borrowed' from the DS scene.

I wonder who is their mole?
_________________
LAWL HOOGE
My Blog

#96707 - tepples - Fri Aug 04, 2006 9:20 pm

JaJa wrote:
Datel are pirates themselves.
They rip code and ideas from other companies and then use their money to place their products into reach of the consumers.

Then so is everybody who has ever made a tetromino game outside of Elorg. Ideas are explicitly not subject to copyright (17 USC 102(b) and foreign counterparts).

Quote:
For example, their MAX Media Dock, or whatever it's called, that's a GBAMP with the registers shifted

No, it's an ATA adapter. Any adapter that allows use of ATA cards in the GBA slot is going to look like a GBAMP at a low level.

Quote:
and their Gamecube software that used the header from a basketball game.

I was told it was an ice hockey game, but either way, copying a commercial game's header is lawful as a boot method under Sega v. Accolade and possibly in other jurisdictions that infer a merger doctrine from the idea-expression divide. It's no more piracy than, say, the use of Super Mario 64 DS in WiFiMe.

Quote:
The only original thing they have created is their NoPass, which still used ideas 'borrowed' from the DS scene.

As I understand it, the DS crypto was cracked, documented, and published in the hope that a company with resources would develop and sell a solution. If Martin Korth didn't want established companies selling DS cards based on the info, he wouldn't have put it into GBATEK.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#96717 - omaremad - Fri Aug 04, 2006 10:54 pm

Quote:

Datel doesn't support piracy (no, 'backups' won't run from MMP) ...


hehe companies have dark ways to promote their products, soon after the media dock was released a "thi-first-d arghhhh patcher was released"

hmm dunno but there has been talk that this came from datel itself.

further more that patcher has been cracked to work on the gbamp, the datel media dock seems to have actual gbaamp hardware with the cf slot replaced by an ata based hd

this is all based on rumours but...

#96726 - tepples - Sat Aug 05, 2006 1:25 am

omaremad wrote:
the datel media dock seems to have actual gbaamp hardware with the cf slot replaced by an ata based hd

CompactFlash is ATA in a different form factor.

But sometimes there is only one right way to do it. ATA interfaces look like other ATA interfaces at the hardware level, which is why if your program can access the card on the GBAMP v2 CF, SuperCard CF, M3 CF, or MAX Media Dock, it can be adapted to work on them all. Think about it: if the MAX Media Dock were a straight-up copy of the GBAMP, then it would have its codecs on a 512 KiB firmware and wouldn't need to rely on bootme.nds for all functions, and it would be bootable with NoPass cards other than the MAX Media Launcher.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#96728 - chishm - Sat Aug 05, 2006 1:49 am

Tepples has a point, all the ATA based adapters are similar at the hardware level. I was a bit quick to discredit Datel earlier (well, on that point at least). However, from the information I've managed to scrape up, it seems the MMD & MMP are nothing but direct adapters from the GBA cart bus to the ATA card, without even a ROM chip to make them directly bootable. In other words, they're technically worse than the GBAMP.
_________________
http://chishm.drunkencoders.com
http://dldi.drunkencoders.com

#96819 - JaJa - Sat Aug 05, 2006 6:26 pm

My mistake then.
I was going by what I have been told by others.

Thanks for correcting me :P
_________________
LAWL HOOGE
My Blog

#103726 - Patater - Sun Sep 24, 2006 5:39 am

I've written up a chapter on sound now. First release of this chapter, made in one hasty night. I'm sure there will be many errors or things that need clarification.

Aside from that information, I'd like to let you that this chapter covers libnds sound, and doesn't go into details in regards to inter-processor communication or how to build a nice framework for inter-processor communication (that's for the next chapter). It covers how to convert sounds into PCM audio data that the DS can understand.

Please enjoy!

http://www.patatersoft.info/manual.html

#107550 - chrissieboy - Mon Oct 30, 2006 8:24 pm

Patater

Got question about your manual, a few weeks ago i did the whole tutorial.

So now i try it al again with the chapter for loading the starfield.
But it gives me compilation errors????

Is there any code updated or something? I really dont know whats going on??

When i copy/paste the code and try to compile it i get this error :

Code:


C:\devkitPro\examples\nds\chris\Manual_src>make
main.cpp
arm-eabi-g++ -MMD -MP -MF /c/devkitPro/examples/nds/chris/Manual_src/build/main.
d -g -Wall -O2 -mcpu=arm9tdmi -mtune=arm9tdmi -fomit-frame-pointer -ffast-math -
mthumb -mthumb-interwork -I/c/devkitPro/examples/nds/chris/Manual_src/include -I
/c/devkitPro/libnds/include -I/c/devkitPro/libnds/include -I/c/devkitPro/example
s/nds/chris/Manual_src/build -DARM9 -c /c/devkitPro/examples/nds/chris/Manual_sr
c/source/main.cpp -o main.o
c:/devkitPro/examples/nds/chris/Manual_src/source/main.cpp: In function 'void di
splaySplash()':
c:/devkitPro/examples/nds/chris/Manual_src/source/main.cpp:56: error: invalid co
nversion from 'int' to 'void*'
c:/devkitPro/examples/nds/chris/Manual_src/source/main.cpp:56: error:   initiali
zing argument 2 of 'void dmaCopy(const void*, void*, uint32)'
c:/devkitPro/examples/nds/chris/Manual_src/source/main.cpp: In function 'void di
splayStarField()':
c:/devkitPro/examples/nds/chris/Manual_src/source/main.cpp:60: error: invalid co
nversion from 'int' to 'void*'
c:/devkitPro/examples/nds/chris/Manual_src/source/main.cpp:60: error:   initiali
zing argument 2 of 'void dmaCopy(const void*, void*, uint32)'
make[1]: *** [main.o] Error 1
make: *** [build] Error 2




i really dont understand whats going on here??

Can you help me ;)

I must tell you that the last time i did the tutorial i had another laptop.
Now i got a new one and installed the new devkitpro.
And now your tutorial wouldn't compile, maybe an installation error on devkitpro??

hope you can help !