It is currently Wed Dec 13, 2017 2:33 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Thu Jan 08, 2009 6:37 pm 
Offline
User avatar

Joined: Wed Dec 06, 2006 8:18 pm
Posts: 2806
Documents say the MBC-2 has built in 512 x 4bits of RAM. I'm not really sure what this means other than there is a total of 256 bytes... So is it 256 bytes at $A000, or is it 512 nibbles (4bits) at $A000 with the upper 4 bits ignored? Anyone know?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 09, 2009 3:26 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7314
Location: Chexbres, VD, Switzerland
I guess it should by nybbles, with the upper 4 bits ignoerd. Altough I don't know much about the gameboy :cry:

I guess the MBC2 is to the Gameboy what the MMC6 is to the NES (altough it is much more widely used).

_________________
Life is complex: it has both real and imaginary components.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 09, 2009 12:54 pm 
Offline
User avatar

Joined: Wed Dec 06, 2006 8:18 pm
Posts: 2806
But on NES, it was full bytes, which is part of the confusion. Currently I just emulate them with 2kbytes of RAM and the two games I know are MBC2 (Kid Icarus and Final Fantasy Adventure) both seem to be ok. FFA doesn't get in game due to incomplete emulation, but Kid Icarus doesn't seem to care and seems to run fine. Though I haven't actually tested its saving ability.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 10, 2009 1:31 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7314
Location: Chexbres, VD, Switzerland
Well, if you emulate full bytes when it's nybbles, I guess there is no reason it won't work. But if you emulate nybbles when it's bytes, definitely it won't work. So I'd say emulate nybbles and see what happens.

Oh, and the .sav file my emulators give me for Final Fantasy adventure is 256 bytes long, but the bytes seems to takes all kind of values. So I guess they just re-arranged the nybbles in some way so that it makes full bytes and it doesn't waste space in the .save files. It seems to work on most of my GB emulators with the same file so there is some kind of standard.

_________________
Life is complex: it has both real and imaginary components.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 24, 2010 3:06 am 
Offline

Joined: Mon Nov 10, 2008 3:09 pm
Posts: 431
It's 512 nybbles at $A000-A1FF--only the low 4 bits of each byte are valid. I think the high bits read as open bus. Here's the "load saved game" routine from Makaitoushi SaGa:

Code:
ROM0:04DC CD 19 05         call 0519   ; enable MBC2 battery RAM, hl = a000, de = cc00, b = 0
ROM0:04DF 2A               ldi a,(hl)
ROM0:04E0 E6 0F            and a,0f
ROM0:04E2 4F               ld c,a
ROM0:04E3 2A               ldi a,(hl)
ROM0:04E4 E6 0F            and a,0f
ROM0:04E6 CB 37            swap a
ROM0:04E8 B1               or c
ROM0:04E9 12               ld (de),a
ROM0:04EA 13               inc de
ROM0:04EB 05               dec b
ROM0:04EC 20 F1            jr nz,04df
ROM0:04EE AF               xor a
ROM0:04EF EA 00 00         ld (0000),a   ; disable MBC2 battery RAM
ROM0:04F2 D9               reti


Why is the battery RAM laid out in this silly way? Because the RAM is inside the MBC2 chip itself, and the chip only has 4 data lines! MBC2 cartridges are limited to 16 ROM banks (2 megabits/256 kilobytes) for the same reason.


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 2 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