[Tuxnes-devel] patch: save-state-2
Brought to you by:
tmmm
From: Allen N. <psy...@ge...> - 2002-02-02 02:06:47
|
Okay, here's a first hack at SNSS support. It uses libsnss.[ch] from nesterdc, and should be appled on top of save-state.patch (it will not conflict with stat-dsp.patch). A few problems: It doesn't work. I can't figure out what all of the base block variables are, or how TuxNES stores them. Read state.c:(form|extract)_BASR for details. Also it's completely untested, apart from the fact that it compiles. I can't figure out how the SRAM or VRAM sizes are stored, or whether they're stored. I'm not certain about the transformations between MAPTABLE and prgPages, or the way chrPages gets set, both in mapper.c:(form|extract)_MPRD. Also in mapper.c, I had to replace every memcpy into VRAM with a function call (MapVRAM) to get chrPages set. I did it mostly mechanically, but I still may have messed something up (particularly the bit in aorom() that switches two pages in VRAM). The alternative is to compare the contents of VRAM with the contents of VROM, but that struck me as a bit of a kluge. It will only work with mappers which store no internal state: 0, 2, 3, 11, 13, 33, 66, 68, 71, 78, and 231. It also should work with 19 and 225, but libsnss claims they store internal state, so nothing else will work with what we output. Adding cases to (form|extract)_MPRD is just a small matter of programming. Finally, the patch is 70.1k, so I gzipped it. Now it's "only" 11.7k. |