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.

Beginners > Gba Development please help i am newbie

#90504 - SwordsGate - Fri Jun 30, 2006 2:37 pm

ok first excuse my english even do i am english lol

ok i am totaly new to gba dvelopment
but i went and brought one of them writers so i can play my homebrew on my gba or now on my ds
i am useing devkitpro i been told its really good
i tested the hello world example it workedso i am happy to see that the compiler works

ok heres the problem i have no tutors
were can i get some but first please help me read this code

its the hello world code i cant read it because i am new
heres the code please explaine it to me


Code:
#include <gba_console.h>
#include <gba_video.h>
#include <gba_interrupt.h>
#include <gba_systemcalls.h>
#include <gba_input.h>
#include <stdio.h>

int frame = 0;

void Vblank() {

   frame++;
}
//---------------------------------------------------------------------------------
// Program entry point
//---------------------------------------------------------------------------------
int main(void) {
//---------------------------------------------------------------------------------

   
   // the vblank interrupt must be enabled for VBlankIntrWait() to work
   // since the default dispatcher handles the bios flags no vblank handler
   // is required
   InitInterrupt();
   SetInterrupt(IE_VBL, Vblank);
   EnableInterrupt(IE_VBL);

   consoleInit( 0 , 4 , 0, NULL , 0 , 15);

   BG_COLORS[0]=RGB8(58,110,165);
   BG_COLORS[241]=RGB5(31,31,31);

   SetMode(MODE_0 | BG0_ON);
   
   // ansi escape sequence to set print co-ordinates
   // /x1b[line;columnH
   iprintf("\x1b[10;10HHello World!");

   while (1) {
      VBlankIntrWait();
      ScanKeys();

   }
}

_________________
Gba development
am currently a newbie woking my way up

#90527 - PhoenixSoft - Fri Jun 30, 2006 4:52 pm

I am sure that everyone will say the same thing: before jumping into writing code, buy a book or find a tutorial online to teach you C.

#90542 - SwordsGate - Fri Jun 30, 2006 7:07 pm

were can i get some c++ tutors?
i tryed google but nothing found?
i've never been good with google or msn etc
_________________
Gba development
am currently a newbie woking my way up

#92261 - Spaceface - Wed Jul 12, 2006 11:02 am

http://www.cplusplus.com/doc/tutorial/ is a perfect place to start. But you have to set up stuff differently since your devKitPro (I presume you use that) builds DS/GBA stuff, and tutorials like the cout/cin (Basic Input/Output) are compiled to be exe's. But still it does its work perfectly when you want to learn how C++ thinks.

I always use the site as a reference cause I often get lost in all the different languages ;)

#92387 - entilzha - Thu Jul 13, 2006 8:55 am

Note, this list is shamelessly copy/pasted from the tutorials thread in the NDS forum..

C/C++(and more!) Tutorials/eBooks:

General - http://www.programmingtutorials.com/

General eBooks - http://www.programmingebooks.tk/

C/C++ - http://cplus.about.com/od/beginnerctutoria1/l/blctut.htm
C/C++ - http://www.cprogramming.com/tutorial.html
C/C++ - http://devcentral.iftech.com/articles/C++/default.php

C/C++ eBooks - http://www.devkitpro.org/reading.shtml

C Specific - http://www.lysator.liu.se/c/bwk-tutor.html
C Specific - http://www.cyberdiem.com/vin/tutorials.html

C++ Specific - http://www.intap.net/~drw/cpp/
C++ Specific - http://www.cs.wustl.edu/~schmidt/C++/
C++ Specific - http://www.cplusplus.com/doc/tutorial/
C++ Specific - http://www.functionx.com/cpp/

C++ Tutorial for C Users - http://www.4p8.com/eric.brasseur/cppcen.html

GBA Tutorials:

TONC (Great Tutorial (even teaches mode 7 graphics programming)) -
http://user.chem.tue.nl/jakvijn/tonc/toc.htm

An unpublished book using Visual HAM as the IDE (read wintermutes second post before using this book) -
http://www.jharbour.com/gameboy/default.aspx

Good Tutorials (new home of The Pern Project) -
http://drunkencoders.com/index.php?system_id=2&page=Tutorials

Tutorial Using HAM -
http://www.aaronrogers.com/ham/

GBA Programming Tutorials Along With Some ARM Links (Mostly Outdated)-
http://www.gbajunkie.co.uk/

Short "Mode 7" Explanation-
http://www.taswegian.com/TwoHeaded/mode7.html