[stella] A7800

Subject: [stella] A7800
From: Keith W Gerdes <kwg@xxxxxxxxxxxxxxxxxx>
Date: Wed, 9 Dec 1998 09:39:54 -0600 (CST)
Thanks for the feedback!

My math education seems pretty inadequate about
now....but I'm willing to learn by doing something!  :-)

 ----

> What hashing algorithm does the 7800 use when
> calculating the checksum of the cartridge data
> to compare it to the encrypted hash upon decryption?

That would be MungeCart() in CRYPT78.

	// start page
	p = A_mem[0xFFF9] & 0xF0;

	// copy cart data $FF00-$FFFF to $1800, skipping X plus one byte
	for (i=0; i<=255; i++)
		if ( (i >= 0x80) && (i <= 0xF8) )
			// skip X ($FF80-$FFF7) plus one ($FFF8)
			A_mem[0x1800+i] = 0;
		else
			// copy $FF00-$FF7F and $FFF9-$FFFF
			A_mem[0x1800+i] = A_mem[0xFF00+i];

	a = 0;
	carry = 1;

	// process each page from $p000 to $FEFF
	for (i=p; i<=0xFE; i++)
	{
		X_23FF(i,0);
		carry = 0;
	}

	carry = 1;
	ROLWork();
	ROLWork();

	// process each page from $FExx to $p0xx
	for (i=0xFE; i>=p; i--)
	{
		X_23FF(i,8);
		carry = 1;
	}

	// create Y
	for (i=0; i<=0x77; i++)
		A_mem[0x1A00+i] = A_mem[0x1800+i] ^ A_mem[0x1800+i+0x50] ^
A_mem[0x1800+i+0x88];

	// for comparison to MungeChecksum() Y
	A_mem[0x1A00] = A_mem[0x1A00] & 7;
	A_mem[0x1A04] = 0;



--
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/

Current Thread
  • [stella] A7800, (continued)
    • Keith W Gerdes - Tue, 8 Dec 1998 15:20:34 -0500 (EST)
      • John Saeger - Tue, 8 Dec 1998 19:03:40 -0500 (EST)
        • jvmatthe - Tue, 8 Dec 1998 20:57:13 -0500 (EST)
    • Paul Hart - Tue, 8 Dec 1998 18:13:31 -0500 (EST)
    • Keith W Gerdes - Wed, 9 Dec 1998 10:42:32 -0500 (EST) <=