Tjoppen, on Wed Nov 23, 2011 3:02 PM, said:
The cart has no R/W line - A7 or A8 is used for that instead, hence the separate memory areas.
When I started writing my answer, I couldn't remember the details, and kept thinking about the TIA not having any pins that are bidirectional I/O-- except for D6 and D7-- but I knew that wasn't the reason. After I posted and was reading what I'd written, I noticed Sdw's reference to $000 through $FFF and added the correction. Then I realized it had to be something related to the *cartridge* slot, but before I could add another edit I saw 5-11under's post that explained it.

Thanks for the additional info!
Tjoppen, on Wed Nov 23, 2011 3:02 PM, said:
The 6507 has 13 adress lines (A0..12), not 12.
Yeah, that's another thing I missed when I was posting. I think the fact that the pins are numbered A0 through *A12* is where the confusion can arise.
Tjoppen, on Wed Nov 23, 2011 3:02 PM, said:
Page 0 has the TIA and RAM mapped to it, at $00-$2C and $80-$FF respectively
Page 1's upper half is a mirror of the lower half's RAM (A8 is ignored). Not sure if the TIA is mirrored too
Page 2 ($0200-$02FF) is used by the PIA/RIOT (upper half at least)
Pages 16-31 ($1000-$1FFF) are used for the cartridge, hence A12 == CS
Yes, the TIA is mirrored in page 1, as well as in other pages up through page 15-- not in all of them, but IIRC in half of them (0 and 1, 4 and 5, 8 and 9, etc.-- I think; I'd have to go back and look at my notes). The other half (IIRC) are mirrors for the 6532/RIOT (2 and 3, 6 and 7, etc.). Again, it's due to the way the chip selects of the TIA and 6532 are connected to the 6507 address pins. Of course, the 6532/RIOT also maps to pages 0 and 1, 4 and 5, etc., for the RAM-- but the I/O ports and timer map to pages 2 and 3, 6 and 7, etc.
Tjoppen, on Wed Nov 23, 2011 3:02 PM, said:
What may be confusing to some is that most coders here prefer to say the ROM starts at $F000. Remember that there are no A13..15 pins though, so it's really $1000.
I've gone back and forth on which I prefer to use. Since the 6502's (and hence the 6507's) interrupt vectors are at $FFFA through $FFFF-- which of course come across as $1FFA through $1FFF if you omit the upper 3 address lines (A13-A15)-- I used to prefer using $F000 as the start of the ROM area. Then I decided it was really more accurate to call it $1000. Now I'm mostly back to using $F000 again-- except it really depends on if I'm using bankswitching, since it's handy to start the different banks at $1000, or $3000, or $5000, etc., so the addresses are easier to recognize as belonging to a particular bank.
Tjoppen, on Wed Nov 23, 2011 3:02 PM, said:
SeaGtGruff, on Wed Nov 23, 2011 1:51 PM, said:
... And I think we verified that some of the other "classic" RAM-expansion carts (such as perhaps MNetwork carts) actually can use the same addresses, but I forget the details. I think the on-cart RAM in "Video Life" can use the same addresses. I can't verify any of these for myself, because I don't have the carts to load test programs on, just newer carts like the Cuttle Cart 2 and the Krokodile Cartridge. But I know for a fact that Supercat's 4A50 bankswitching uses one address space for both the reads and writes, and it should work if you're emulating one of the classic schemes on a Harmony, Krokodile, or Cuttle Cart 2.
Very mysterious how that can work without an R/W pin. My guess is 4A50 uses deep knowledge of 6507 signal timings to accomplish this. The documentation I found seems to back this up: "Unlike most 2600 RAM+carts, RAM may be read and written at the same address without restriction." [1], together with only D0..7, A0..12 and power being available to the cartridge must mean something funny is going on.
[1]
http://www.casperkit...lla/cartfmt.htm , "fixed" version at
http://www.acc.umu.s...s/vcs/4a50.html
Yes, the way I remember it is that it works because of the way the 6502/6507 reads/writes the data for the specified address, although I'm not technically-savvy enough about the CPU and clock cycles (phi-1 and phi-2) to have it all down pat like Supercat, batari, and others do. It does help to have a good 6502 reference-- there's one at the 6502.org site that gives a pretty good cycle-by-cycle breakdown of what happens during the instructions with different address modes.
IIRC, I had posted a simple test ROM that wrote and read to the same Superchip address to see if a single address would work for reading and writing, and the test does work in emulation, as well as when run on a Harmony cart or similar type of cart-- Krokodile or Cuttle Cart 2, etc.-- but it failed with a real Superchip. It would certainly be nice to be able to use the same addresses if possible, such as with 4A50 bankswitching, or by designing a custom scheme on a Harmony cart, etc.