It is currently Sun Oct 22, 2017 3:11 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sun Jul 26, 2015 4:16 pm 
Offline
User avatar

Joined: Sat Jan 03, 2015 5:58 pm
Posts: 367
Location: ...
I am working on (once again) a Pong game, this time on the Gameboy. So far a ball is on the screen and moves to the top left.

...On BGB, that is. When testing on my flashcart, the code gives the following results:

GBPocket: Works.
GBC: Blank screen.
GBA SP: Blank screen.

Anyone have any idea as to why?


Attachments:
pong.gb [32 KiB]
Downloaded 61 times
pong.7z [4.19 KiB]
Downloaded 54 times
Top
 Profile  
 
PostPosted: Sun Jul 26, 2015 7:33 pm 
Offline
User avatar

Joined: Sat Jan 03, 2015 5:58 pm
Posts: 367
Location: ...
UPDATE: figured out the problem. Didn't set sprite palette.


Top
 Profile  
 
PostPosted: Mon Jul 27, 2015 7:01 am 
Offline

Joined: Sun Jan 26, 2014 9:31 am
Posts: 256
It's actually a more subtle issue that highlights some specific (but small) differences in Game Boy models. DMG units initialize various parts of I/O (0xFF00 - 0xFF7F) with values of 0xFF. This happens as soon as the unit powers up, before the Boot ROM even starts. The OBP0 and OBP1 registers on the DMG are therefore already set (note: the neither the DMG nor the GBC Boot ROM even write to them). On the other hand, GBC and GBA units zero out these portions of I/O, so when running your program on these systems, you have to manually set OBP0 and OBP1.

You'll find that BGB doesn't display your ball either when you set the system to Game Boy Color. If you open it up in debugging mode, you can see which values in I/O are 0xFF or 0x0 depending on the emulated system type. So the lesson here is to initialize everything and never rely on hardware to have done things ahead of time :P


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 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® Forum Software © phpBB Group