OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Apr 19, 2024 2:53 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 33 posts ]  Go to page Previous  1, 2, 3
Author Message
 Post subject: Re:Game Boy Coding, anyone ?
PostPosted: Wed Aug 30, 2006 4:42 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 2:31 am
Posts: 5964
Location: In a galaxy, far, far away
Dex wrote:
;********************************;
; Rom start. ;
;********************************;
rom_start:
mov r0, 0x4000000
mov r1, 0x400
add r1, r1, 3
str r1, [r0]


If i get it correctly, that's setting DISPCNT (0x0400,0000) register to use 32Kcolors-bitmap-mode, right?
Quote:
mov r0, 0x6000000
mov r1, 0xff
mov r2, 0x9600
loop1:
strh r1, [r0], 2
subs r2, r2, 1
bne loop1

then you fill the screen (VRAM @ 0x0600,0000) with some color i haven't decoded yet ...
Quote:
LetsLoop:
b LetsLoop

and finally you enter an endless loop.

My! as i'm using libnds, i tend to skip most of those magic-number-things and have pre-defined nice names for every hardware bits :P either you need an excellent memory of numbers, or you need a bunch of #defines :)

_________________
Image May the source be with you.


Top
 Profile  
 
 Post subject: Re:Game Boy Coding, anyone ?
PostPosted: Wed Aug 30, 2006 9:21 am 
You are right that what it does and color is red.
You may need to fill the logo and set check sum, but it work fine on my DS and GBA setup as is, but some say it needs the real logo ?.

jas2o has got this nds http://dsemu.org/The_Smallest_NDS.html
arm asm code, to assemble and run on his DS with FasmArm 8).

PS: I have also got fasmarm code runing on my GP2x.


Top
  
 
 Post subject: Re:Game Boy Coding, anyone ?
PostPosted: Wed Aug 30, 2006 9:40 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 2:31 am
Posts: 5964
Location: In a galaxy, far, far away
hehe... there will always be guys to shrink data smaller than they should ever been (remind me of "how to make ELF/PE executable that suits 4K compos")

btw, i patched "desmume" so that it supports SuperCard-like storage (in an image file created following the OSFAQ, if you wonder), and i was surprised when it reported a PC in system RAM. For non-plumbers here, there is only 4MB of RAM on the nDS and your code typically execute from cartridge ROM (up to 32MB), so that sounds a bit weird to have code _there_ ...

Seems like i'll check my bootstrap code (the one from DarkFader, iirc) and see what it does ... or maybe the .ds.gba files behave differently ...

_________________
Image May the source be with you.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 33 posts ]  Go to page Previous  1, 2, 3

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 95 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group