Skip to content

Commit

Permalink
Merge pull request #1 from joeldipops/master
Browse files Browse the repository at this point in the history
Added gbc detection
  • Loading branch information
saturnu authored Nov 3, 2018
2 parents d39ffd5 + b539474 commit 300dca1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libgbpak.c
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,10 @@ int init_gbpak(void){
if(_get_gbRomAddr(0xC140, data)!=0) //header offset cart type
return -9;

gbcart.gbc = (data[3] == 0x80 || data[3] == 0xC0) ? data[3] : 0;
// 0x80 Cartridge works on both GBCs and older gameboys
// 0xC0 Cartridge only works on GBC

gbcart.sgb = data[6]; //0x146 super gameboy functions 0x00=no 03=yes
gbcart._romsize = data[8];
gbcart._ramsize = data[9];
Expand Down

0 comments on commit 300dca1

Please sign in to comment.