Posted Sun Apr 6, 2008 1:13 AM
In the standard kernel, there are two factors that affect the location of the playfield RAM-- whether or not the Superchip option is being used, and whether or not the pfres option is being used.
If the Superchip option is *not* being used, then the playfieldbase is set to $A4.
If the Superchip option *is* being used, then the playfieldbase is set to $10D0.
If the pfres option is *not* being used, then the playfield is set to the playfieldbase. If the Superchip option is *not* being used, that means the playfield is at $A4 through $D3, which are named var0 through var47. If the Superchip option *is* being used, that means the playfield is at $10D0 through $10FF, which don't have names unless you're using the superchip.h include file, in which case they're named r080 through r127.
If the pfres option *is* being used, then the playfield is set to the playfieldbase minus (4 times (pfres minus 12)). That means the playfield's location will vary depending on the value of pfres:
Without the Superchip:
pfres = 1, playfield = $D0 through $D3
pfres = 2, playfield = $CC through $D3
pfres = 3, playfield = $C8 through $D3
etc.
With the Superchip:
pfres = 1, playfield = $10FC through $10FF
pfres = 2, playfield = $10F8 through $10FF
pfres = 3, playfield = $10F4 through $10FF
etc.
Notice that the number of bytes used by the playfield is 4 times pfres, and the last row is always in the same place-- either $D0 through $D3 (without the Superchip), or $10FC through $10FF (with the Superchip). The start of the first row will move depending on pfres.
If you want to write directly to the playfield RAM when the playfield is located in the Superchip RAM, you'll need to be aware that the Superchip has different read and write addresses. The write addresses are in the first 128 bytes of the Superchip ($1000 through $107F), and the read addresses are in the second 128 bytes ($1080 through $10FF). When I wrote the superchip.h include file, I defined the 128 write addresses as w000 through w127, and the 128 read addresses as r000 through r127. When writing to the Superchip playfield, be sure to use the w000 through W127 variables.
Michael