i've started to develop a very simple emulator for game boy in C, i've already studied hoe work the cpu of the Z80 and the relative OpCodes but there is a question in my mind that i never found answer.
When i open the ROM image using
fopen(filename,"rb")
how can get the instructions to emulate? I've tried to do:
fp = fopen(filename,"rb");
fread(buf,sizeof(buf),1,fp);
but i don't know how is structured the ROM of Game Boy.. someone can explain me how fetch the instruction from the ROM and their structure?
Cartridge ROM execution always starts at offset 0x100. When writing an emulator you have two ways to implement this: