Some 32X cart port questions

Ask anything your want about the 32X Mushroom programming.

Moderator: BigEvilCorporation

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Fri Oct 19, 2012 4:42 pm

Charles MacDonald wrote:
Chilly Willy wrote:I tried setting the CART MODE bit in the test if the SH2 can write save ram... it makes no difference. The SRAM is unchanged.
I don't suppose turning on all the unused bits in that register will do anything? Probably make the system freeze up, though. :)
I'll try that later today and see what happens. Another thought was that bit next to RV that's supposed to always be 0... why? Maybe it does something...

EDIT: Nope! Setting all the bits in TV reg and setting b1 in the same reg as RV both have no affect. SRAM is still unchanged.

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Thu Dec 20, 2012 1:33 am

I don't remember one detail - did writing the rom area from the SH2 do any cycle at all? Like a read instead of a write? One thing I noticed with A2600 carts - Atari didn't route /WR to the cart port, so the way carts do writing is by making writes to a specific address - the cart knows that when a read occurs in that bank, it's really a write.

Charles MacDonald
Very interested
Posts: 292
Joined: Sat Apr 21, 2007 1:14 am

Post by Charles MacDonald » Thu Dec 20, 2012 3:33 am

Chilly Willy wrote:I don't remember one detail - did writing the rom area from the SH2 do any cycle at all? Like a read instead of a write? One thing I noticed with A2600 carts - Atari didn't route /WR to the cart port, so the way carts do writing is by making writes to a specific address - the cart knows that when a read occurs in that bank, it's really a write.
There was no activity at all during a write, not even a dummy read from that location. The write operation was totally invisible on the cartridge port side of things, which is really unfortunate. :(

I can't remember if I mentioned this or not, but the 32X dev "box" that has RAM to simulate a cartridge has a lot of hardware to access RAM on the box side. It seems like overkill, but if you really can't write to the cartridge area from the 32X SH-2 side (which seems to be the case currently) this might explain why they went to the trouble to access it from the other end. There could be other reasons why they took the hard route too.

If one was making a custom cart I was going to suggest something along the lines of:

- Have an address range where 16 bits of the address bus are latched during a read.
- Have a RAM region where reads cause the 16-bits of latched data to be written to RAM.
- Have a mirror of the RAM region where reads work normally for regular access.

This way you could write to RAM in a roundabout way by reading the 'word' to write first, and then reading the address you want to write to second.

It would be less troublesome if you could do byte access but IIRC all ROM access is word-only. I have no idea if that is practical, or if treating a read like a write violates the expected write timings for the RAM. Just rambling here. ;)

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Thu Dec 20, 2012 5:51 am

Too bad there's no activity at all. :( Rather than extra hardware, it's probably easier to pass commands to the 68000 to do the write for the SH2. That's my plan with the cart Tiido's putting together. Gives the 68000 something a little more important to do now. :lol:

Right now, my usual usage of the comm registers is 0-3 is for Master->68000 commands, 4-5 is Master->Slave commands, 6-7 is semaphore usage, 8-9 is controller value for port 1, 10-11 is controller value for port 2, and 12-15 is the vblank ticks.

My plan is to get rid of the controller and ticks and use 8-11 as an address and 12-15 as a value. Then I'll add commands to write the data to the address using the 68000, return a controller in the value field, or return the ticks in the value field. That makes it just slightly slower to read a controller, for example, but not enough to make a noticeable change in speed. The 68000 is normally looping waiting on a command. I'll have other commands, like loading a file from CD to memory.

Charles MacDonald
Very interested
Posts: 292
Joined: Sat Apr 21, 2007 1:14 am

Post by Charles MacDonald » Sat Feb 09, 2013 3:49 am

Just bumping this to post some findings from the service manual.

The SH-2 can't write to the cartridge space. The 315-5818 ASIC controls the write signals. It has inputs from LWR and UWR from the Genesis, and generates OLWE and OUWE. It has no write strobe inputs from either SH-2.

Of the two outputs, only OLWE goes to the 32X cartridge slot (as LWR) and OUWE is a no-connect. UWR from the Genesis is directly routed to UWR on the 32X cartridge slot. This is why LWR can be disabled when RV=0 but UWR functions normally.

Likewise TIME and M3 are passed directly to the 32X cartridge slot too. A circuit that relies on TIME+UWR will work regardless of RV, but TIME+LWR is subject to RV.

So the only way to write to the cartridge area is to have the 68000 do it.

Post Reply