forked from Ports/perfect_dark
port: jpn-final: possibly fix japanese characters
This commit is contained in:
1 parent
f8ef6939b0
commit
c10050a14c
5 files changed
+34
-2
No files matched your search
@@ -39,6 +39,7 @@ void gfx_end_frame(void);
|
||||
void gfx_set_target_fps(int);
|
||||
void gfx_set_maximum_frame_latency(int latency);
|
||||
void gfx_texture_cache_clear(void);
|
||||
void gfx_texture_cache_delete(const uint8_t *orig_addr);
|
||||
int gfx_create_framebuffer(uint32_t width, uint32_t height);
|
||||
void gfx_set_framebuffer(int fb, float noise_scale) ;
|
||||
void gfx_reset_framebuffer(void);
|
||||
|
||||
@@ -558,9 +558,16 @@ static bool gfx_texture_cache_lookup(int i, const TextureCacheKey& key) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static void gfx_texture_cache_delete(const uint8_t* orig_addr) {
|
||||
void gfx_texture_cache_delete(const uint8_t* orig_addr) {
|
||||
gfx_flush();
|
||||
rdp.textures_changed[0] = rdp.textures_changed[1] = true;
|
||||
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
if (rendering_state.textures[i] && rendering_state.textures[i]->first.texture_addr == orig_addr) {
|
||||
rdp.textures_changed[i] = true;
|
||||
rendering_state.textures[i] = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
while (gfx_texture_cache.map.bucket_count() > 0) {
|
||||
TextureCacheKey key = { orig_addr, { 0 }, 0, 0 }; // bucket index only depends on the address
|
||||
size_t bucket = gfx_texture_cache.map.bucket(key);
|
||||
|
||||
@@ -29,5 +29,6 @@ void videoResetFramebuffer(void);
|
||||
void videoCopyFramebuffer(s32 dst, s32 src, s32 left, s32 top);
|
||||
|
||||
void videoResetTextureCache(void);
|
||||
void videoFreeCachedTexture(const void *texptr);
|
||||
|
||||
#endif
|
||||
@@ -172,3 +172,8 @@ void videoResetTextureCache(void)
|
||||
{
|
||||
gfx_texture_cache_clear();
|
||||
}
|
||||
|
||||
void videoFreeCachedTexture(const void *texptr)
|
||||
{
|
||||
gfx_texture_cache_delete(texptr);
|
||||
}
|
||||
@@ -10,6 +10,9 @@
|
||||
#include "data.h"
|
||||
#include "types.h"
|
||||
#include "platform.h"
|
||||
#ifndef PLATFORM_N64
|
||||
#include "video.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Officially, the NTSC versions are American English only, while the PAL
|
||||
@@ -293,6 +296,11 @@ struct jpncharpixels *langGetJpnCharPixels(s32 codepoint)
|
||||
(romptr_t) REF_SEG _fontjpnSegmentRomStart + ((codepoint * TMUL) * 0xc + TMUL * (24 * 0xc)),
|
||||
TMUL * 0x0c);
|
||||
|
||||
#ifndef PLATFORM_N64
|
||||
// indicate that this is a new texture
|
||||
videoFreeCachedTexture(&g_JpnCharCachePixels[TMUL * freeindexsingle]);
|
||||
#endif
|
||||
|
||||
return &g_JpnCharCachePixels[TMUL * freeindexsingle];
|
||||
}
|
||||
|
||||
@@ -313,6 +321,11 @@ struct jpncharpixels *langGetJpnCharPixels(s32 codepoint)
|
||||
|
||||
dmaExec(&g_JpnCharCachePixels[freeindexsingle * 8], (romptr_t) REF_SEG _fontjpnsingleSegmentRomStart + (codepoint >> SHIFTAMOUNT) * 0x60, 0x60);
|
||||
|
||||
#ifndef PLATFORM_N64
|
||||
// indicate that this is a new texture
|
||||
videoFreeCachedTexture(&g_JpnCharCachePixels[freeindexsingle * 8]);
|
||||
#endif
|
||||
|
||||
return &g_JpnCharCachePixels[freeindexsingle * 8];
|
||||
}
|
||||
|
||||
@@ -324,6 +337,11 @@ struct jpncharpixels *langGetJpnCharPixels(s32 codepoint)
|
||||
|
||||
dmaExec(&g_JpnCharCachePixels[freeindexmulti * 8], (romptr_t) REF_SEG _fontjpnmultiSegmentRomStart + ((codepoint & 0x1fff) >> SHIFTAMOUNT) * 0x80, 0x80);
|
||||
|
||||
#ifndef PLATFORM_N64
|
||||
// indicate that this is a new texture
|
||||
videoFreeCachedTexture(&g_JpnCharCachePixels[freeindexmulti * 8]);
|
||||
#endif
|
||||
|
||||
return &g_JpnCharCachePixels[freeindexmulti * 8];
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user