Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

mmmmmm 2-bit greyscale

Sign in to follow this  


That's right. I've started working on LittleBoy, the GameBoy/GB Colour emulator to go along with FatMan. FatMan is hardly a dead project, I just got bored working on the same thing for so long.

The screenshots above are from memory dumps, not cartridge ROMS. I'm still working on the Z80(actually Sharp80) core and I can't even start to try stuff out before it's done. As you can see the tile render function works, but the palettes are exactly right(kirbies should be lighter). The tool dialogs have FatMan have been imported and operate in almost the same way except the addresses have changed.

Sign in to follow this  


Recommended Comments

Wow that was fast [smile]

The system itself is very simplistic, but still it takes a lot of patience to make an emulator. Building the CPU core takes a long time and even when it's "done", the chances of it working right are pretty slim.

I can't get that link to work, but I'd stick with the VisualBoyAdvance source anyway. It has both the GB and GBA, and is in C/C++. Thanks for trying to help though [smile]

Share this comment

Link to comment
How exactly do you load from ROMs? Do they present themselves as an extension to the available addresses in memory?

Share this comment

Link to comment
I'm not really sure what you're asking. Is it how the ROM memory works? I'll try to explain that.

The GB has 64KB of onboard memory. ROM can be 2MB in size and external RAM can be 128KB, both are located in the cartridge.

unsigned char *Memory[0x10];
unsigned char ROM[0x200000];
unsigned char RAM[0x20000];

The GB has 2 ROM banks, 16KB each in size, at 0x0000-0x7FFF. The first ROM bank is always bank 0(0x0000-0x3FFF of the ROM). On startup the second bank is set to ROM bank 1(0x4000-0x7FFF of the ROM, this can never be bank 0).

The GB has one 8KB RAM bank at 0xA000. At startup this is set to bank 0(0x0000-0x1FFF of external RAM).

So when I load a ROM(or memory dump):

Read each byte of the ROM file into ROM;
clear RAM;

To change the ROM bank(in say mapper #1) one must write a byte between 0x2000 and 0x3FFF. The lower 5 bits of that byte become the new address for bank 2(0x4000-0x7FFF).


It works in a somewhat similar fashiion for RAM switching. Basically to access the mappers and change banks, a byte with the right information is written to the onboard read-only memory at 0x0000-0x7FFF.

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!