Skip to content

Commit

Permalink
DISPCNT bit 3 can only be set by the bios
Browse files Browse the repository at this point in the history
  • Loading branch information
gdkchan committed May 18, 2018
1 parent c041e94 commit defb29f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion arm_mem.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ uint32_t palette[0x200];

uint32_t bios_op;

int64_t cart_rom_size;
int64_t cart_rom_size;
uint32_t cart_rom_mask;

uint16_t eeprom_idx;
Expand Down
9 changes: 8 additions & 1 deletion io.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,14 @@ static void snd_reset_state(uint8_t ch, bool enb) {

void io_write(uint32_t address, uint8_t value) {
switch (address) {
case 0x04000000: disp_cnt.b.b0 = value; break;
case 0x04000000:
if (arm_r.r[15] >= 0x4000) {
//The CGB mode enable bit 3 can only be set by the bios
value &= 0xf7;
}

disp_cnt.b.b0 = value;
break;
case 0x04000001: disp_cnt.b.b1 = value; break;
case 0x04000002: green_inv.b.b0 = value; break;
case 0x04000003: green_inv.b.b1 = value; break;
Expand Down

0 comments on commit defb29f

Please sign in to comment.