]> Shamusworld >> Repos - virtualjaguar/commitdiff
Minor memory allocation/free fixup
authorShamus Hammons <jlhamm@acm.org>
Sat, 20 Mar 2004 19:25:51 +0000 (19:25 +0000)
committerShamus Hammons <jlhamm@acm.org>
Sat, 20 Mar 2004 19:25:51 +0000 (19:25 +0000)
src/tom.cpp

index 27f0a45387abdf58f0618c15cde9f37688f3c621..a8e482d6c6f1718ffa00a8a0bc2ebd1effd178f3 100644 (file)
@@ -457,8 +457,6 @@ Vertical resolution: 238 lines
 
 void tom_calc_cry_rgb_mix_lut(void)
 {
-       memory_malloc_secure((void **)&tom_cry_rgb_mix_lut, 2 * 0x10000, "CRY/RGB mixed mode LUT");
-
        for (uint32 i=0; i<0x10000; i++)
        {
                uint16 color = i;
@@ -478,6 +476,7 @@ void tom_calc_cry_rgb_mix_lut(void)
                                blue = (((uint32)bluecv[chrm][chrl]) * y) >> 11;
                        color = (red << 10) | (green << 5) | blue;
                }
+
                tom_cry_rgb_mix_lut[i] = color;
        }
 }
@@ -852,6 +851,8 @@ void TOMExecScanline(uint16 scanline, bool render)
 //
 void tom_init(void)
 {
+       memory_malloc_secure((void **)&tom_cry_rgb_mix_lut, 2 * 0x10000, "CRY/RGB mixed mode LUT");
+
        op_init();
        blitter_init();
 //This should be done by JERRY!        pcm_init();
@@ -875,6 +876,7 @@ void tom_done(void)
 //     gpu_done();
 //     dsp_done();
        memory_free(tom_ram_8);
+       memory_free(tom_cry_rgb_mix_lut);
 }
 
 /*uint32 tom_getHBlankWidthInPixels(void)