News:

11 March 2016 - Forum Rules

Main Menu

C Array being overwritten

Started by Mikey88, February 16, 2013, 06:43:27 PM

Previous topic - Next topic

Mikey88

Edit: I got it guys, took me long enough! I had my writeBuf array size wrong from testing a while ago. I was wondering if I should upload the decompressor or should I wait until I have a recompressor to go with it? It is for Donkey Kong Country 2 BTW, Let me know what you think.

Hi guys, I am nearly finished writing my graphics decompression. My code reads the compressed ROM data to an array readBuf then the decompressed data is stored in an array writeBuf. The code decompresses the data correctly for the first #$4F16 bytes on the hex comparison. It is during a function that goes back to the near the beginning of readBuf to grab some bytes, when checking I noticed the first #$10C bytes of readBuf had changed. During a function (That runs about a hundred times fine) it takes, starting at $4F01,  #$10C bytes and overwrites the beginning of readBuf with these bytes. I have no clue how or why this is happening and any help would be greatly appreciated, I feel like I am very close to a finished program.

Thanks,
Mikey