<span class="section">Control code</span><br><br>
Models &gt;= 2 of Mega Drive / Genesis have a requirement of putting
'SEGA' to ($A14000).l . Here's the code that will fix it (put it in the
init section)
<pre class="68k">		move.b	($A10001).l,d0		;version
		andi.b	#$F,d0
		beq	SkipSecurity		;skip if smd model = 1
		move.l	#'SEGA',($A14000).l

SkipSecurity:   
</pre><br><br><br>

<span class="section">Checksum</span><br><br>Checksum is a word in ROM
header that is calculated while compiling (in SEGA). While hacking, you
probably encountered problems like red screen or 'WRONG CHECKSUM'. If
you're asm hacking a rom, you have to find the checking routine and
delete it. The routine is:
<pre class="68k">		movea.l	#$200,a0
		movea.l	#$7FFFF,a1	; ROM End
		move.l	(a1),d0
		moveq	#0,d1

loop:
		add.w	(a0)+,d1
		cmp.l	a0,d0
		bcc.s	loop
		movea.l	#$18E,a1	; Checksum
		cmp.w	(a1),d1
		bne.w	WrongChecksum
</pre>So to fix it, delete the 'bne WrongChecksum'. Depends on the rom,
but usually the routine is exactly like that, because that's what's in
the Mega Drive tech docs (by SEGA =P). But if you're hacking in a hex
editor, you have to either calculate the checksum yourself or get a
calculator. To calculate the checksum you do the following:<br><br>

1. Start at $200<br>
2. Add a word to the checksum (ignore the upper bits)<br>
3. Increment the offset<br>
4. If offset &lt; rom end, go to 2<br>
5. Here's your checksum =)