Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 35

Thread: FPC4NDS: devkitPro's 2D examples

  1. #11

    FPC4NDS: devkitPro's 2D examples

    I found a way to make it compile again.

    // {$ifdef ARM7}
    // DMA_START_VBL = (1 shl 27); //BIT(27);
    //{$endif ARM7}

    //{$ifdef ARM9}
    DMA_START_HBL = (1 shl 28); //BIT(28);
    DMA_START_VBL = (1 shl 27); //BIT(27);
    DMA_START_FIFO = (7 shl 27);
    DMA_DISP_FIFO = (4 shl 27);
    //{$endif ARM9}

    add the bold-written parts to \libnds\nds\dma.inc, line 84 and following.

    btw, this doesn't change anything about my touchpad-problem xD

    oh and i don't give any guarantee that this modificiation won't do your
    nds any harm. :) i don't really know what i'm doing, actually :)

    edit: /b doesn't seem to work in /code xD

  2. #12

    FPC4NDS: devkitPro's 2D examples

    Quote Originally Posted by 21o6
    I found a way to make it compile again.

    // {$ifdef ARM7}
    // DMA_START_VBL = (1 shl 27); //BIT(27);
    //{$endif ARM7}

    //{$ifdef ARM9}
    DMA_START_HBL = (1 shl 2; //BIT(2;
    DMA_START_VBL = (1 shl 27); //BIT(27);
    DMA_START_FIFO = (7 shl 27);
    DMA_DISP_FIFO = (4 shl 27);
    //{$endif ARM9}

    add the bold-written parts to \libnds\nds\dma.inc, line 84 and following.

    btw, this doesn't change anything about my touchpad-problem xD

    oh and i don't give any guarantee that this modificiation won't do your
    nds any harm. i don't really know what i'm doing, actually

    edit: /b doesn't seem to work in /code xD
    Nonono, wait!
    You will need to download the last package and, after that, check in the svn repository new dma.inc
    In other words, replace your dma.inc with this file.
    However, here is the fix (line 111, dma.inc):
    [pascal]
    {$ifdef ARM9}
    DMA_FIFO = (DMA_ENABLE or DMA_32_BIT or DMA_DST_FIX or DMA_START_FIFO);
    {$endif ARM9}
    [/pascal]
    Get your fpc4gba copy now!
    Get your fpc4nds copy now!

  3. #13

    FPC4NDS: devkitPro's 2D examples

    err okay :D

    works. thanks :D

  4. #14

    FPC4NDS: devkitPro's 2D examples

    Great to see tweaks being done with this package.

    I really wonder if we can create a competitor to Nintendo's Wiiware using Pascal. Maybe be we can call is PiiWare for PascalWiiWare .
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  5. #15

    FPC4NDS: devkitPro's 2D examples

    A question for Legolas or Technomage. Is it possible to write games for GBA or DS without using SDL?

    Also how feasible is it to wack 3-4 games onto a flash cartridge and try to sell them ( the cartridges )?
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  6. #16

    FPC4NDS: devkitPro's 2D examples

    Quote Originally Posted by savage
    A question for Legolas or Technomage. Is it possible to write games for GBA or DS without using SDL?
    Of course! SDL is only a way (to be honest, I never seen a gba/nds game made with sdl); for homebrew games most preferred way is to use libnds and libgba.

    Quote Originally Posted by savage
    Also how feasible is it to wack 3-4 games onto a flash cartridge and try to sell them ( the cartridges )?
    http://forum.gbadev.org/viewtopic.php?t=9807
    Seems that it is feasible, by putting a clear disclaimer about Nintendo endorsement on the game. The problem will be to find a cartridge seller :?
    Get your fpc4gba copy now!
    Get your fpc4nds copy now!

  7. #17
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    FPC4NDS: devkitPro's 2D examples

    If you want a clearer picture of Nintendo's past dealings with unlicensed distribution of games for their consoles you should have a read of this section of the article on the Nintendo Entertainment System.

    http://en.wikipedia.org/wiki/Nintend...licensed_games

    Nintendo has lately loosened it's previously very HIGHLY restrictive policy on licensing practices, but as we've seen with them since the time of the original NES this has fluctuated from generation to generation of consoles. Mostly due to things like; NES10 lockout chip bypassing, UltraHLE, the fall of Sega and competition with Microsoft & Sony, etc...
    Jason McMillen
    Pascal Game Development
    Co-Founder





  8. #18

    FPC4NDS: devkitPro's 2D examples

    I think I may have asked this before, but can't find he post or the answer.

    Where can I get some instructions about using my GBA and Nintendo DS with FreePascal? Basically I'm looking for some simple instructions that would tell me how to create an SDL compatible exe using FreePascal and then how to transfer the exe and the assocaited data onto a GBA, for starters, then a DS.

    This is for a commercial proof of concept. The content, for now, would be 2D games, but may be 3D in future.

    Basically at the moment the client wants to port their engine from Delphi to C++, but I want to show the same engine ported to FreePascal and running on a GBA/DS before they finish the port. I' have already got the engine compiling and running with FreePascal on Win32 and Mac OS X, but I want to add a bit extra to the deal and show it to them running on GBA or DS.

    Maybe I'm getting a little ahead of myself. Maybe as a first step someone could show me how to compile the exe so that it will work in the GBA or DS emulator. Yes I think that would be a good first step to prove it works.

    PS. Is Endianness important on GBA/DS?

    I'll stop rambling now ( but I'm still excited >8-] ).
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  9. #19

    FPC4NDS: devkitPro's 2D examples

    For gba have a look at my scrolling with key input example. (http://itaprogaming.free.fr/download/scroll.zip) it is on http://itaprogaming.free.fr/ there you will find much more information.

    Some step by step for gba:
    1) Download the freepascal compiler for gba.
    http://www.freepascal.org/down2/arm/...pascal.org.var
    2) Install it.
    3)Download my example and put it in the examples folder of freepascal compiler you just installed.
    4)Execute build .bat . It will use the makefile.
    5)Now you will get an .gba file.
    4)Load that gba file with the gba-emulator.

    If you want to look the source take a peek in main.pp. Ignore the other files. You may even delete the bmp and .c files. They are inbetween steps.

    Compiling for the nds is even easier:
    1) Download the freepascal for nds
    2) Install it
    3) Create a build.bat with the following lines:

    Code:
    ppcarmnds -g --gc-sections -Tnds openglex1.pas
    ndstool -c openglex1.nds -9 openglex1.arm9.bin
    dsbuild openglex1.nds -o openglex1.nds.gba
    del *.bin
    del *.o
    del *.elf
    4) this will give you an .nds file that you can use with your nds emulator.

    Using the .gba and .nds on real hardware requires additional hardware. And insturction would be specific to the hardware device. I personally use an M3 adapter with passcard.

    in case you want to know what openglex1.pas is:
    Code:
    program helloworld;
    
    &#123;$apptype arm9&#125; //...or arm7
    &#123;$define ARM9&#125;   //...or arm7, according to apptype
    
    &#123;$mode objfpc&#125;   // required for some libc funcs implementation
    
    uses
      ctypes; // required by nds headers!
    
    &#123;$include nds.inc&#125;  // headers!
    
    
    var
    	i&#58; integer;
    
    function DrawGlScene&#40;&#41;&#58; shortint;  
    begin
    	//glLoadIdentity&#40;&#41;;									// Reset The Current Modelview Matrix
    	glTranslatef&#40;-1.5,0.0,-6.0&#41;;					// Move Left 1.5 Units And Into The Screen 6.0										
    	glBegin&#40;GL_TRIANGLES&#41;;						// Drawing Using Triangles
    		glVertex3f&#40; 0.0, 1.0, 0.0&#41;;				// Top
    		glVertex3f&#40;-1.0,-1.0, 0.0&#41;;				// Bottom Left
    		glVertex3f&#40; 1.0,-1.0, 0.0&#41;;				// Bottom Right
    	glEnd&#40;&#41;;							// Finished Drawing The Triangle
    
    	glTranslatef&#40;3.0,0.0,0.0&#41;;					// Move Right 3 Units
    
    	glBegin&#40;GL_QUADS&#41;;						// Draw A Quad
    		glVertex3f&#40;-1.0, 1.0, 0.0&#41;;				// Top Left
    		glVertex3f&#40; 1.0, 1.0, 0.0&#41;;				// Top Right
    		glVertex3f&#40; 1.0,-1.0, 0.0&#41;;				// Bottom Right
    		glVertex3f&#40;-1.0,-1.0, 0.0&#41;;				// Bottom Left
    	glEnd&#40;&#41;;							// Done Drawing The Quad
    
    
    	result &#58;= GL_TRUE;
    end;
    
    begin
    
    	
    	// Turn on everything
    	powerON&#40;POWER_ALL&#41;;
    
    	
    	consoleDemoInit&#40;&#41;;
    	
    	// Setup the Main screen for 3D 
    	videoSetMode&#40;MODE_0_3D&#41;;
    	
    	printf&#40;'Hello OpenGL!'+#10&#41;;
    	printf&#40;'www.pascalgamedevelopment.com'+#10&#41;;
    	printf&#40;'http&#58;//itaprogaming.free.fr/'+#10&#41;;
    	printf&#40;'http&#58;//3das.noeska.com'&#41;;
    
    	// IRQ basic setup
    	//irqInitHandler&#40;irqDefaultHandler&#41;;
    	//irqSet&#40;IRQ_VBLANK, 0&#41;;
    
    	// Set our viewport to be the same size as the screen
    	glViewPort&#40;0,0,255,191&#41;;
    	
    	// Specify the Clear Color and Depth 
    	glClearColor&#40;0,0,0&#41;;
    	glClearDepth&#40;$7FFF&#41;;
    	
    	while true do
    	begin
    		// Reset the screen and setup the view
    		glReset&#40;&#41;;
    		gluPerspective&#40;35, 256.0 / 192.0, 0.1, 40&#41;;
    		gluLookAt&#40;	0.0, 0.0, 1.0,		
    					0.0, 0.0, 0.0,		
    					0.0, 1.0, 0.0&#41;;
    					
    		glPolyFmt&#40;POLY_ALPHA&#40;31&#41; OR POLY_CULL_NONE&#41;;
    		
    		// Set the current matrix to be the model matrix
    		glMatrixMode&#40;GL_MODELVIEW&#41;;
    		
    		//Push our original Matrix onto the stack &#40;save state&#41;
    		glPushMatrix&#40;&#41;;	
    		glColor3f &#40;1.0,1.0,1.0&#41;;								
    		DrawGLScene&#40;&#41;;
    		
    		// Pop our Matrix from the stack &#40;restore state&#41;
    		glPopMatrix&#40;1&#41;;
    		// flush to screen	
    		glFlush&#40;&#41;;
    	end;
    end.
    http://3das.noeska.com - create adventure games without programming

  10. #20

    FPC4NDS: devkitPro's 2D examples

    I'm not sure about a sdl porting... No one in the gbadev community uses sdl and I haven't seen any example working on fpc yet.

    About fpc: there are some problems with the old memory manager hack in the 2.2.0. Long and sad story short, you could not use classes >_<.
    The gba/nds port in the svn trunk uses the new fpc memory manager and it works pretty fine (supposing that you don't need recursive functions... in this case something goes wrong with the optimization flags, but I'm on it )
    Get your fpc4gba copy now!
    Get your fpc4nds copy now!

Page 2 of 4 FirstFirst 1234 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •