3DS: allow write access to VRAM

This commit is contained in:
UnknownShadow200 2025-07-14 19:47:50 +10:00
parent 99830141db
commit 027c6a8fb7
2 changed files with 8 additions and 3 deletions

View File

@ -73,10 +73,10 @@ AccessControlInfo:
# Virtual Address Mappings
IORegisterMapping:
- 1ff50000-1ff57fff # DSP memory
- 1ff50000-1ff57fff # DSP memory
- 1ff70000-1ff77fff
MemoryMapping:
- 1f000000-1f5fffff:r # VRAM
- 1f000000-1f5fffff # VRAM
SystemCallAccess:
ArbitrateAddress: 34

View File

@ -464,7 +464,7 @@ GfxResourceID Gfx_AllocTexture(struct Bitmap* bmp, int rowWidth, cc_uint8 flags,
tex->pal_index = pal_index;
ConvertTexture_Palette((cc_uint8*)tex->pixels, bmp, rowWidth, palette, pal_count);
int size = VRAM_Size(1 << tex->log2_w, max(32, 1 << tex->log2_h), GS_PSM_4HH);
int size = VRAM_Size(tex->width, max(32, 1 << tex->log2_h), GS_PSM_4HH);
// TODO fix properly. alignup instead
int blocks = SIZE_TO_BLOCKS(size, TEXMEM_BLOCK_SIZE);
tex->blocks = blocks;
@ -495,6 +495,11 @@ GfxResourceID Gfx_AllocTexture(struct Bitmap* bmp, int rowWidth, cc_uint8 flags,
CopyPixels(tex->pixels, bmp->width * BITMAPCOLOR_SIZE,
bmp->scan0, rowWidth * BITMAPCOLOR_SIZE,
bmp->width, bmp->height);
//int size = VRAM_Size(1 << tex->log2_w, max(32, 1 << tex->log2_h), GS_PSM_4HH);
// TODO fix properly. alignup instead
//int blocks = SIZE_TO_BLOCKS(size, TEXMEM_BLOCK_SIZE); size = blocks / (2048 / 64);
//Platform_Log4("32BPP: b %i / p %i (%i X %i)", &size, &blocks, &bmp->width, &bmp->height);
}
return tex;
}