I took from neslib the rle function since I now encode some data with nesst, which reduce the size to something reasonable. My only issue is sometime some extra characters are shown or it doesn't load properly at all.
I disable the bg/spr before loading the data (similar to ppuOn/Off from neslib) before using this function so it should be enough but the problem seems random. For example, I loaded 2 screens with an interval of 2~3 second and it was failing. Just adding some code to clear the nametables made it work after.
Since I'm using it inside my code, I remapped the variable used but I do not thing this is the code but still need to inspect it.
What I want to confirm is if the rle function that comes with the neslib example has issues? If not then it's something it my code that I will need to figure out.
edit:
I think it's not related to neslib at all. It just the method expect the vram to not be touched but the NMI that runds in the backround is possbilty updating the palette, which could cause the corruption. I guess I need to adapt the method a little bit. This is the only probable cause that I can see.
I disable the bg/spr before loading the data (similar to ppuOn/Off from neslib) before using this function so it should be enough but the problem seems random. For example, I loaded 2 screens with an interval of 2~3 second and it was failing. Just adding some code to clear the nametables made it work after.
Since I'm using it inside my code, I remapped the variable used but I do not thing this is the code but still need to inspect it.
What I want to confirm is if the rle function that comes with the neslib example has issues? If not then it's something it my code that I will need to figure out.
edit:
I think it's not related to neslib at all. It just the method expect the vram to not be touched but the NMI that runds in the backround is possbilty updating the palette, which could cause the corruption. I guess I need to adapt the method a little bit. This is the only probable cause that I can see.