 NOTE: Some of the things in the CODE Box will be repeated a few times, because these were parts of a few seperate documents I made. So don&#39;t bitch at me about it.<br><br>---<br><br>If you open a Sonic ROM (it can be any Sonic game), you will see a lot of &quot;00000200&quot; in the ROM headers. Those are exceptions. If something occurs that isn&#39;t supposed to happen, one of these exceptions are called. It can be an illegal instruction, an address error, or a 1111 emulation error. The exceptions are like sub routines, but they are interrupting whatever was running when the exception occured, so you need to kill the exceptions with a &quot;RTE&quot; instead of a &quot;RTS&quot; RTE stands for ReTurn from Exception.<br><br><!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->Open a Sonic 1 ROM&#58;<br><br>RTE &#40;ReTurn from Exception&#41; = &nbsp;4E 73<br><br>Go to offset 0 &#40;the beginning of the ROM&#41;<br>You will find these values&#58; 00 FF FE 00<br><br>At offset 4 &#40;the starting address in a genesis ROM&#41;, you will find the values&#58; 00 00 02 06<br><br>This is the first exception pointer.<br>It&#39;s probably that exception that shows the &#34;ILLEGAL INSTRUCTION&#34; text when something goes wrong.<br><br>The exception starts at offset 206.<br>If you want to kill that exception code, you put a RTE at that offset.<br><br>There are a lot of these exceptions. &nbsp;You can see how it continues with a new exception pointer at offset 8&#58; 00 00 03 D6<br>The exceptions end at offset FF.<br>The last exception you&#39;ll find points at the default exception handler at offset 200 &#40;You can see this at offset FC &#58; 00 00 02 00&#41;<br><br>Now there are two important exceptions in the header. The HBlank and the VBlank interrupt.<br><br>HBLANK = HORIZONTAL BLANK<br>VBLANK = VERTICAL BLANK<br><br>The HBlank occurs every time one scanline has been drawn on the screen. The VBlank occurs when all the scanlines have been drawn.<br><br>You will find the pointer to the HBlank interrupt at offset 70.<br>The value will be&#58; 00 00 11 26<br><br>So every scanline, the code which is currently executed will be interrupted, and a call to the HBlank will occur automatically.<br><br>So if you want to kill the water effect, you can just put a RTE &#34;4E 73&#34; at offset 1126.<br><br>You will find the VBlank interrupt pointer at offset 78.<br>The values will be&#58; 00 00 0B 10<br><br>The VBlank copies every sprite, palette to the screen during the gameplay. It also plays the music.<br><br>If you decide to RTE the VBlank, put a RTE at offset B10... BUT nothing will be shown on the screen. It will just be black.<br><br>ABOUT BLANK PERIOD&#58;<br>The blank period is when the Electron beam has drawn the screen and needs to retrace. It&#39;s a small period where you can copy data and move sprites without affecting the display. <br><br>A Vertical Blank interrupt is called when a whole screen has been drawn and the Electron beam has to retrace all the way back to its starting point. You can make the game to run in 60 Hz by waiting for a VBlank to occur. <br><br>The Horizontal Blank occurs when one scan line has been drawn and the beam needs go back to the start of the next scan line. You can see this as when you press enter to make a line feed when you write a document, the cursor needs to go down and back so that you can start to write on the next line. The HBlank is used for effects like switching the pallete at a special scan line to make a water surface in the Sonic games, or to scroll one pixel during every HBlank to make the background look like it&#39;s been drawn in 3D.<br><br>The HBlank and VBlank are interrupts. They will interrupt whatever code that was executed, and therefore they must be exited with a RTE so that the game can continue to be executed from where it was interrupted.<!--c2--></td></tr></table><div class='postcolor'><!--ec2--><br><br>So now you know:<br>These two exceptions called the Horizontal and Vertical Blank are critical for the game. Without them, nothing will be drawn on the screen.<br><br>And you need to use the RTE instruction to kill the exception handlers.<br><br>The RTE will stop the exception, and go back to where the code was interrupted before the exception was called.<br><br>To call an exception...the CHK and TRAPV commands force an exception <br><br>I hope this helps anyone.<br><br>Oh, and if something in here is wrong, tell me immediatly. Thanks. 