]> Shamusworld >> Repos - thunder/commitdiff
Code cleanup/removal of cruft.
authorShamus Hammons <jlhamm@acm.org>
Fri, 25 Apr 2014 17:18:53 +0000 (12:18 -0500)
committerShamus Hammons <jlhamm@acm.org>
Fri, 25 Apr 2014 17:18:53 +0000 (12:18 -0500)
src/psg.cpp
src/thunder.cpp

index b4f3f47c0f59da0724ac25583c921b0265d30716..5d6e6693101fabae7981911dd16dd0826e39600a 100644 (file)
 // ---  ----------  -----------------------------------------------------------
 // JLH  04/21/2014  Created this file.
 //
+//
+// Notes:
+// ------
+// The emulator creates signed 16-bit samples. Make sure there's enough room in
+// your buffer for them!
+//
 
 #include "psg.h"
 #include <stdio.h>
@@ -33,20 +39,24 @@ static Voice voice[8];
 static uint8_t memory[0x200];
 //static 
 static uint32_t sampleRate = 44100;
-
-extern FILE * psg1;
-extern FILE * psg2;
+static uint32_t divisor;
 
 
 void InitPSG(uint32_t s/*=44100*/)
 {
        sampleRate = s;
+       divisor = (uint32_t)((float)s / 0.735); // Voodoo constant
 
+       // Noise generation will fail if the noise seeds aren't primed...
        for(int i=0; i<8; i++)
                voice[i].noiseSeed = 1;
 }
 
 
+//
+// Note that it doesn't wipe out the buffer passed in, if you want it wiped,
+// you have to wipe it yourself. :-)
+//
 void UpdatePSG(uint8_t * buffer, int count)
 {
 /*
@@ -54,8 +64,6 @@ if F == 44100, then counter++ for each sample.
 if F == 88200, then counter += 2 for each sample.
 if F == 22050, then counter += 0.5 for each sample.
 */
-//     memset(buffer, 0, count * 2);
-
        // Recast buffer as int16, we're doing 16-bit sound here
        int16_t * p = (int16_t *)buffer;
 
@@ -74,7 +82,8 @@ if F == 22050, then counter += 0.5 for each sample.
 // 44100 / 60000 = 0.735
 // 192000 / 60000 = 3.2
 //                             uint8_t pos = (voice[i].counter / (60000)) & 0x1F;
-                               uint8_t pos = (voice[i].counter / (65536)) & 0x1F;
+//                             uint8_t pos = (voice[i].counter / (65536)) & 0x1F;
+                               uint8_t pos = (voice[i].counter / divisor) & 0x1F;
                                uint8_t sample = ((pos & 0x01) == 0
                                        ? memory[(voice[i].waveform * 16) + (pos / 2)] >> 4
                                        : memory[(voice[i].waveform * 16) + (pos / 2)]) & 0x0F;
@@ -89,6 +98,10 @@ if F == 22050, then counter += 0.5 for each sample.
                        if ((voice[i].leftVolume == 0) || ((voice[i].frequency & 0xFF) == 0))
                                continue;
 
+                       // The hold stuff here is VOODOO
+                       // Need to figure out what's really going on here, what the clock
+                       // rate of this chip is. Also, some freqs can be > 255 according to
+                       // Rolling Thunder...
                        int16_t sample = (7 * voice[i].leftVolume) << 4;
                        int16_t noiseSign = 1;
                        int16_t hold = 1 << 1;
@@ -96,18 +109,6 @@ if F == 22050, then counter += 0.5 for each sample.
                        for(int j=0; j<count; j++)
                        {
                                p[j] += sample * noiseSign;
-#if 0
-if (i == 1)
-{
-       fputc(sample & 0xFF, psg1);
-       fputc((sample >> 8) & 0xFF , psg1);
-}
-else if (i == 3)
-{
-       fputc(sample & 0xFF, psg2);
-       fputc((sample >> 8) & 0xFF , psg2);
-}
-#endif
 
                                if (hold)
                                {
index 18cf8df7b3b212602b1fbc5e44c958949f8cd0ac..ace26f29716faf7b51b9f8a977d4b8abf637e077 100644 (file)
@@ -347,7 +347,10 @@ bool LoadImg(const char * filename, uint8_t * mem, uint32_t address, uint32_t le
        FILE * file = fopen(path, "rb");
 
        if (!file)
+       {
+               printf("Could not open file \"%s\"!\n", filename);
                return false;
+       }
 
        fread(&mem[address], 1, length, file);
        fclose(file);
@@ -426,6 +429,9 @@ bool ReadColorPROMs(void)
        // 00:  00 20 40 60  02 22 42 62  04 24 44 64  06 26 46 66
        // 10:  88 A8 C8 E8  8A AA CA EA  8C AC CC EC  8E AE CE EE 
 
+       if (!ff1)
+               printf("Could not open PROM files!\n");
+
        return ff1;
 }
 
@@ -488,83 +494,8 @@ bool UnpackFonts(void)
        f1.close();
        f2.close();
 
-       return true;                                // Made it!
-}
-
-
-//
-// Get length of sample from WAV format
-//
-uint32_t GetWAVLength(fstream & file)
-{
-       char ch;
-       uint32_t len;
-
-       file.ignore(16);                                                                        // Skip header BS
-
-       for(int i=0; i<2; i++)
-       {
-               file.get(ch);  len = (int)(uint8_t)ch;
-               file.get(ch);  len |= (int)(uint8_t)ch << 8;
-               file.get(ch);  len |= (int)(uint8_t)ch << 16;
-               file.get(ch);  len |= (int)(uint8_t)ch << 24;
-
-               // Skip intermediate data
-               file.ignore(len + 4);
-       }
-
-       // & finally get length of data
-       file.get(ch);  len = (int)(uint8_t)ch;
-       file.get(ch);  len |= (int)(uint8_t)ch << 8;
-       file.get(ch);  len |= (int)(uint8_t)ch << 16;
-       file.get(ch);  len |= (int)(uint8_t)ch << 24;
-
-       return len;
-}
-
-
-#if 0
-//
-// Load PSG samples from disk
-//
-void LoadPSGs(void)
-{
-       char file[40];
-       char ch;
-       uint32_t len;
-
-       for(int i=0; i<16; i++)
-       {
-               fstream fp;
-
-               psg_adrs[i] = NULL;                                                             // Zero out pointer
-               sprintf(file, "./sounds/psg%i.wav", i);                 // Create filename
-
-               fp.open(file, ios::binary | ios::in);                   // Attempt to open it...
-
-               if (fp)
-               {
-                       len = GetWAVLength(fp);                                         // Get WAV data length...
-                       psg_adrs[i] = new uint8_t[len];                         // Attempt to allocate space...
-
-                       if (psg_adrs[i] != NULL)
-                       {
-                               for(int j=0; j<(signed)len; j++)
-                               {
-                                       fp.get(ch);
-                                       psg_adrs[i][j] = ch;                            // & load it in...
-                               }
-
-                               psg_lens[i] = len;
-                               printf("Found sample file: %s\t[Length: %u]\n", file, len);
-                       }
-
-                       fp.close();
-               }
-       }
+       return true;
 }
-#endif
-FILE * psg1, * psg2;
 
 
 //
@@ -574,118 +505,103 @@ int main(int argc, char * argv[])
 {
        InitLog("thunder.log");
 
-extern bool disasm;    // From 'V6809.CPP'
-       extern bool charbase;                                           // From 'SCREEN.CPP'
+       extern bool disasm;                             // From 'V6809.CPP'
+       extern bool charbase;                   // From 'SCREEN.CPP'
        charbase = false;
 
-       char lbuff[80];
-       fstream ff;                       // Declare fstream without file hooks...
-       bool brk = false, brk2 = false;   // Breakpoint set flag
-       uint16_t brkpnt, brkpnt2;             // Where the breakpoint is...
-       bool running;                     // CPU running state flag...
-       bool self_test = false;           // Self-test switch
-       bool scr_type = false;            // false=chars, true=pixels
-       uint16_t debounce = 0;                // Key de-bounce counter
-       uint16_t fire_debounce = 0;           // Fire button debounce counter
-       uint8_t x;                           // General placeholder...
-//     bool active = true;                                             // Program running flag
-
-       SDL_Event event;                                                                // SDL "event"
-       extern uint8_t palette[768];                                    // Screen physical palette
+       bool running;                                   // CPU running state flag...
+       SDL_Event event;                                // SDL "event"
+       extern uint8_t palette[768];    // Screen physical palette
        uint32_t ticks, oldTicks;
 
-       cout << endl << "THUNDER v"THUNDER_VERSION" ";
-       cout << "by James Hammons" << endl;
-       cout << "Serial #20149417 / Prerelease" << endl;
-       cout << "© 2003, 2014 Underground Software" << endl << endl;
-
-       cout << "This emulator is free software. If you paid for it you were RIPPED OFF"
-               << endl << endl;
+       printf("THUNDER v"THUNDER_VERSION" by James Hammons\n");
+       printf("Serial #20149417 / Prerelease\n");
+       printf("© 2003, 2014 Underground Software\n\n");
+       printf("This emulator is free software. If you paid for it you were RIPPED OFF\n\n");
 
 //     SDL_WM_SetCaption("Thunder v"THUNDER_VERSION" ", "Thunder");
 
-       gram = gram1;  grom = grom1;           // Needed only for debugger
+       // Needed only for debugger
+       gram = gram1;  grom = grom1;
 
        memset(gram, 0, 0x10000);
        memset(grom, 0, 0x10000);
        memset(gram2, 0, 0x10000);
        memset(grom2, 0, 0x10000);
 
-       game_over_switch = 0;   // Init game over delay
-
        cout << "Loading ROMs..." << endl;
-       if (!ReadColorPROMs())                   // Load virtual PROMs
-       { cout << "Could not open PROM files!" << endl;  return -1; }
+       if (!ReadColorPROMs())
+               return -1;
 
-       if (!LoadImg(ROM1, grom1, 0x8000, 0x8000)) // Load $8000-$FFFF 1st ROM
-       { cout << "Could not open file '" << ROM1 << "'!" << endl;  return -1; }
+       // Load $8000-$FFFF 1st ROM
+       if (!LoadImg(ROM1, grom1, 0x8000, 0x8000))
+               return -1;
 
-       if (!LoadImg(ROM2, grom2, 0x8000, 0x8000)) // Load $8000-$FFFF 2nd ROM
-       { cout << "Could not open file '" << ROM2 << "'!" << endl;  return -1; }
+        // Load $8000-$FFFF 2nd ROM
+       if (!LoadImg(ROM2, grom2, 0x8000, 0x8000))
+               return -1;
 
-       if (!LoadImg(ROM3, grom3, 0, 0x8000))      // Load 3rd ROM into its own space
-       { cout << "Could not open file '" << ROM3 << "'!" << endl;  return -1; }
+       // Load 3rd ROM into its own space
+       if (!LoadImg(ROM3, grom3, 0, 0x8000))
+               return -1;
 
-       if (!LoadImg(ROM17, data_rom, 0,       0x10000))  // Load 17th ROM
-       { cout << "Could not open file '" << ROM17 << "'!" << endl;  return -1; }
+       if (!LoadImg(ROM17, data_rom, 0,       0x10000))
+               return -1;
 
-       if (!LoadImg(ROM18, data_rom, 0x10000, 0x10000))  // Load 18th ROM
-       { cout << "Could not open file '" << ROM18 << "'!" << endl;  return -1; }
+       if (!LoadImg(ROM18, data_rom, 0x10000, 0x10000))
+               return -1;
 
-       if (!LoadImg(ROM19, data_rom, 0x20000, 0x10000))  // Load 19th ROM
-       { cout << "Could not open file '" << ROM19 << "'!" << endl;  return -1; }
+       if (!LoadImg(ROM19, data_rom, 0x20000, 0x10000))
+               return -1;
 
-       if (!LoadImg(ROM20, data_rom, 0x30000, 0x10000))  // Load 20th ROM
-       { cout << "Could not open file '" << ROM20 << "'!" << endl;  return -1; }
+       if (!LoadImg(ROM20, data_rom, 0x30000, 0x10000))
+               return -1;
 
-       if (!LoadImg(ROM9,  spr_rom, 0,       0x10000))   // Load 9th ROM
-       { cout << "Could not open file '" << ROM9 << "'!" << endl;  return -1; }
+       if (!LoadImg(ROM9,  spr_rom, 0,       0x10000))
+               return -1;
 
-       if (!LoadImg(ROM10, spr_rom, 0x10000, 0x10000))   // Load 10th ROM
-       { cout << "Could not open file '" << ROM10 << "'!" << endl;  return -1; }
+       if (!LoadImg(ROM10, spr_rom, 0x10000, 0x10000))
+               return -1;
 
-       if (!LoadImg(ROM11, spr_rom, 0x20000, 0x10000))   // Load 11th ROM
-       { cout << "Could not open file '" << ROM11 << "'!" << endl;  return -1; }
+       if (!LoadImg(ROM11, spr_rom, 0x20000, 0x10000))
+               return -1;
 
-       if (!LoadImg(ROM12, spr_rom, 0x30000, 0x10000))   // Load 12th ROM
-       { cout << "Could not open file '" << ROM12 << "'!" << endl;  return -1; }
+       if (!LoadImg(ROM12, spr_rom, 0x30000, 0x10000))
+               return -1;
 
-       if (!LoadImg(ROM13, spr_rom, 0x40000, 0x10000))   // Load 13th ROM
-       { cout << "Could not open file '" << ROM13 << "'!" << endl;  return -1; }
+       if (!LoadImg(ROM13, spr_rom, 0x40000, 0x10000))
+               return -1;
 
-       if (!LoadImg(ROM14, spr_rom, 0x50000, 0x10000))   // Load 14th ROM
-       { cout << "Could not open file '" << ROM14 << "'!" << endl;  return -1; }
+       if (!LoadImg(ROM14, spr_rom, 0x50000, 0x10000))
+               return -1;
 
-       if (!LoadImg(ROM15, spr_rom, 0x60000, 0x10000))   // Load 15th ROM
-       { cout << "Could not open file '" << ROM15 << "'!" << endl;  return -1; }
+       if (!LoadImg(ROM15, spr_rom, 0x60000, 0x10000))
+               return -1;
 
-       if (!LoadImg(ROM16, spr_rom, 0x70000, 0x10000))   // Load 16th ROM
-       { cout << "Could not open file '" << ROM16 << "'!" << endl;  return -1; }
+       if (!LoadImg(ROM16, spr_rom, 0x70000, 0x10000))
+               return -1;
 
-       if (!LoadImg(ROM21, voice_rom, 0, 0x10000))  // Load 21st ROM
-       { cout << "Could not open file '" << ROM21 << "'!" << endl;  return -1; }
+       if (!LoadImg(ROM21, voice_rom, 0, 0x10000))
+               return -1;
 
-       if (!LoadImg(ROM22, voice_rom, 0x10000, 0x10000))  // Load 22nd ROM
-       { cout << "Could not open file '" << ROM22 << "'!" << endl;  return -1; }
+       if (!LoadImg(ROM22, voice_rom, 0x10000, 0x10000))
+               return -1;
 
-       if (!UnpackFonts())                         // Load 5, 6, 7, 8th ROMs
+       // Load 5, 6, 7, 8th ROMs
+       if (!UnpackFonts())
        {
                cout << "Could not open font files!" << endl;
                return -1;
        }
 
        // Load MCU program + data
-       if (!LoadImg(MCUROM, mcuMem, 0xF000, 0x1000))   // Load MCU ROM
-       { cout << "Could not open file '" << MCUROM << "'!" << endl;  return -1; }
-
-       if (!LoadImg(ROM4, mcuMem, 0x4000, 0x8000))             // Load 4th ROM
-       { cout << "Could not open file '" << ROM4 << "'!" << endl;  return -1; }
+       if (!LoadImg(MCUROM, mcuMem, 0xF000, 0x1000))
+               return -1;
 
-// Now emulated! :-D
-       // Load PSG samples if they're there...
-//     LoadPSGs();
+       if (!LoadImg(ROM4, mcuMem, 0x4000, 0x8000))
+               return -1;
 
-       // Set up V6809 execution contexts
+       // Set up V6809, V63701 execution contexts
 
        memset(&cpu1, 0, sizeof(V6809REGS));
        cpu1.RdMem = RdMem;
@@ -702,22 +618,10 @@ extern bool disasm;       // From 'V6809.CPP'
        mcu.WrMem = MCUWriteMemory;
        mcu.cpuFlags |= V63701_ASSERT_LINE_RESET;
 
-//     uint32_t my_clock = 0;
        running = true;                                                         // Set running status...
-//     trace1 = false;
-//     SetRefreshRate(refresh2);                                       // Tell GUI our refresh rate
 
        // Set all inputs to inactive...
        input1.byte = input2.byte = input3.byte = input4.byte = input5.byte = 0xFF;
-//     mcu.port1 = 0xFF;
-//     mcu.port2 = 0xFF;
-#if 0
-       // This is data that is supposed to come from the MCU... So that's why it hangs
-       gram1[0x4182] = 0xA6;          // Temp kludge
-       gram1[0x4184] = 0xA6;
-       gram1[0x4183] = 0x00;          // More of the same
-       gram1[0x4185] = 0x00;
-#endif
        banksw1 = 0;                   // Will this work?
        banksw2 = 0;
        InitGUI();                 // Reset # of coins
@@ -733,26 +637,11 @@ WriteLog("About to set up audio...\n");
 memset(scrBuffer, 0xFF, VIRTUAL_SCREEN_WIDTH*VIRTUAL_SCREEN_HEIGHT*sizeof(uint32_t));
 RenderScreenBuffer();
 
-#if 1
-psg1 = fopen("psgchan1.raw", "wb");
-psg2 = fopen("psgchan3.raw", "wb");
-#endif
-
 WriteLog("About to enter main loop...\n");
        while (running)
        {
                HandleGUIDebounce();                                    // Debounce GUI keys
 
-#if 0
-               if (game_over_switch)
-               {
-                       game_over_switch--;  // Countdown...
-
-                       if (game_over_switch == 0)
-                               gram1[0x4380] = 0; // Kill music!
-               }
-#endif
-
 // Dipswitches are presented to the main CPUs as 0 or 1 at locations
 // $423D - $425B by the MCU
 
@@ -777,7 +666,6 @@ WriteLog("About to enter main loop...\n");
                                {
 //                                     SpawnSound(USERSOUND, SCAMERA);
                                        SavePCXSnapshot();
-//                                     debounce = 10;
                                }
 #if 1
                                else if (event.key.keysym.sym == SDLK_5)
@@ -1087,52 +975,12 @@ WriteLog("About to enter main loop...\n");
 
                                if (keys[SDLK_F7])
                                        SpawnSound(USERSOUND, 0);       // Do user sound (F7)
-
-//                             if (keys[SDLK_F8])
-//                             {
-//                                     gram1[0x4380] = 0;                      // (F8) kill music (this worx)
-//                                     charbase = false;                       // Switch chars out...
-//                             }
-//                             if (keys[SDLK_F9])  gram1[0x4285] = 1;          // (F9) strobe unknown loc
-
-                               if (keys[SDLK_F11])                             // (F11)
-                               {
-                                       Execute6809(&cpu1, 10);
-                                       Execute6809(&cpu2, 10);
-                               }
-//                     }
-//F12 is used above, but the values are ignored. So we'll do it here too.
-                               if (keys[SDLK_F12])
-                               {
-                                       cpu1.cpuFlags |= V6809_ASSERT_LINE_RESET;
-                                       cpu2.cpuFlags |= V6809_ASSERT_LINE_RESET;
-                               }
-
-                               if (keys[SDLK_d])                               // (D) start disassembly
-                                       disasm = true;
-#if 0
-       if (keys[SDLK_k])
-               gram1[0x5606] = 0x00;
-       if (keys[SDLK_l])
-       {
-               gram1[0x5607] = 0x01; // Hangs here... (CPU #1 waiting...)
-               WriteLog("\nMAIN: Stuffed $01 in $5607!!!\n\n");
-       }
-       if (keys[SDLK_o])
-       {
-               gram1[0x5FF3] = 0x02;
-               WriteLog("\nMAIN: Stuffed $02 in $5FF3!!!\n\n");
-       }
-#endif
 #endif
 
-               if (enable_cpu)
-//                             if (true)
-               {
-                       // We can do this here because we're not executing the cores yet.
-                       cpu1.cpuFlags |= V6809_ASSERT_LINE_IRQ;
-                       cpu2.cpuFlags |= V6809_ASSERT_LINE_IRQ;
-                       mcu.cpuFlags |= V63701_ASSERT_LINE_IRQ;
+               // We can do this here because we're not executing the cores yet.
+               cpu1.cpuFlags |= V6809_ASSERT_LINE_IRQ;
+               cpu2.cpuFlags |= V6809_ASSERT_LINE_IRQ;
+               mcu.cpuFlags |= V63701_ASSERT_LINE_IRQ;
 //                                     while (cpu1.clock < 25000)
 // 1.538 MHz = 25633.333... cycles per frame (1/60 s)
 // 25600 cycles/frame
@@ -1142,53 +990,34 @@ WriteLog("About to enter main loop...\n");
 // 640 * 40
 // 800 * 32
 // Interesting, putting IRQs at 30 Hz makes it run at the correct speed. Still hangs in the demo, though.
-                       for(uint32_t i=0; i<640; i++)
-//                                     for(uint32_t i=0; i<1280; i++)
-                       {
-                               // Gay, but what are ya gonna do?
-                               // There's better ways, such as keeping track of when slave writes to master, etc...
-                               Execute6809(&cpu1, 40);
-                               Execute6809(&cpu2, 40);
-
-                               // MCU runs at 1,536,000 Hz
-                               // 1536000 / 60 / 640 == 40
-                               Execute63701(&mcu, 40);
-                       }
-               } // END: enable_cpu
+               for(int i=0; i<640; i++)
+               {
+                       // Gay, but what are ya gonna do?
+                       // There's better ways, such as keeping track of when slave writes to master, etc...
+                       Execute6809(&cpu1, 40);
+                       Execute6809(&cpu2, 40);
+
+                       // MCU runs at 1,536,000 Hz
+                       // 1536000 / 60 / 640 == 40
+                       Execute63701(&mcu, 40);
+               }
 
                // Speed throttling happens here...
-               while (SDL_GetTicks() - oldTicks < 16)  // Actually, it's 16.66... Need to account for that somehow
-//                             while (SDL_GetTicks() - oldTicks < 32)  // Actually, it's 16.66... Need to account for that somehow
+               // Actually, it's 16.66... Need to account for that somehow
+               while (SDL_GetTicks() - oldTicks < 16)
                        SDL_Delay(1);                           // Release our timeslice...
 
                oldTicks = SDL_GetTicks();
-//cout << "Finished frame..." << endl;
        }
 
        SDL_Quit();
-
-#if 1
-fclose(psg1);
-fclose(psg2);
-#endif
-#if 0
-       // Deallocate sounds if they were loaded
-       for(int i=0; i<16; i++)
-               if (psg_adrs[i])
-                       delete[] psg_adrs[i];
-#endif
-#if 0
-       for(int i=0; i<14; i++)
-               if (fm_adrs[i])
-                       delete[] fm_adrs[i];
-#endif
-
        LogDone();
 
        return 1;
 }
 
 #if 0
+/*
 Hitachi uC runs at 6.144 MHz
 YM2151 runs at 3.579580 MHz
 
@@ -1278,24 +1107,16 @@ Address             Dir Data     Name      Description
 
 Notes:
 -----
-- we are using an unusually high CPU interleave factor (800) to avoid hangs
-  in rthunder. The two 6809 in this game synchronize using a semaphore at
-  5606/5607 (CPU1) 1606/1607 (CPU2). CPU1 clears 5606, does some quick things,
-  and then increments 5606. While it does its quick things (which require
-  about 40 clock cycles) it expects CPU2 to clear 5607.
-  Raising the interleave factor to 1000 makes wndrmomo crash during attract
-  mode. I haven't investigated on the cause.
-
 - There are two watchdogs, one per CPU (or maybe three). Handling them
   separately is necessary to allow entering service mode without manually
   resetting in rthunder and genpeitd: only one of the CPUs stops writing to
   the watchdog.
 
 - The sprite hardware buffers spriteram: the program writes the sprite list to
-  offsets 4-9 of every 16-byte block, then at the end writes to offset 0x1ff2 of
-  sprite RAM to signal the chip that the list is complete. The chip will copy
-  the list from 4-9 to 10-15 and use it from there. This has not been verified
-  on the real hardware, but it is the most logical way of doing it.
+  offsets 4-9 of every 16-byte block, then at the end writes to offset 0x1ff2
+  of sprite RAM to signal the chip that the list is complete. The chip will
+  copy the list from 4-9 to 10-15 and use it from there. This has not been
+  verified on the real hardware, but it is the most logical way of doing it.
   Emulating this behaviour and not using an external buffer is important in
   rthunder: when you insert a coin, the whole sprite RAM is cleared, but 0x1ff2
   is not written to. If we buffered spriteram to an external buffer, this would
@@ -1314,6 +1135,6 @@ TODO:
   but they don't seem to work as expected. During the first few frames they are
   written out of order and hooking them up in the usual way causes the MCU to
   stop receiving interrupts.
-
+*/
 #endif