-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
patch for binjgb and appling it in build script (#54)
- Loading branch information
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
diff --git a/src/emulator.c b/src/emulator.c | ||
index 0329ccf..a91ef67 100644 | ||
--- a/src/emulator.c | ||
+++ b/src/emulator.c | ||
@@ -5209,13 +5209,15 @@ void emulator_render_vram(Emulator* e, u32* buffer) { | ||
void emulator_render_background(Emulator* e, u32* buffer, int type) { | ||
memset(buffer, 0, sizeof(u32) * 256 * 256); | ||
int bank = 0; | ||
- int tile_map = (type & 1) ? 0x400 : 0; | ||
+ int tile_map = 0x1800 + ((type & 1) ? 0x400 : 0); | ||
for (int ty = 0; ty < 32; ty++) { | ||
for (int tx = 0; tx < 32; tx++) { | ||
+ u8 tile = VRAM.data[tile_map + tx + ty * 32]; | ||
+ int offset = 0; | ||
+ if(tile < 128) | ||
+ offset = (LCDC.bg_tile_data_select == TILE_DATA_8000_8FFF) ? 0 : 0x1000; | ||
for (int row = 0; row < 8; row++) { | ||
- int tile = VRAM.data[0x1800 + tile_map + tx + ty * 32]; | ||
- // TODO: LCDC bit 4 | ||
- int n = tile * 16 + row * 2; | ||
+ int n = offset + tile * 16 + row * 2; | ||
u8 a = VRAM.data[n]; | ||
u8 b = VRAM.data[n + 1]; | ||
for (int x = 0; x < 8; x++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters