Home | Forums | What's new | Resources | |
4-mb Ram Cart |
black - Jun 29, 2004 |
RockinB | Jan 10, 2005 | ||||
1. How to use External RAM cartridge 2. How to use half of CPU internal cache as RAM 1. Based on the ST-TECH-47.pdf manual and SCU user manual for memory mapping, i coded a sample to init the external RAM Cartridge:
Code:
Now the problem is that it freezes on real Saturn and always reports id = 0 in Satourne emu. Furthermore, the manual states that area 0x22400000 - 0x227FFFFF is allocated to the cartridge, but I cannot find this elsewhere, it's not on SCU's memory map.... 2. I know how to set 2kB of the 4kB cpu cache as local RAM: If the cache is set to 2-way mode(instead of 4-way mode), it is set to 2kB RAM, too. The SEGA_CSH library can be taken to do this: CSH_SET_WAY_MODE( CSH_2WAY ) But I don't know how to address this RAM directly! Now that I had another look into CSH_MAIN.C of SBL's cache lib, I see that CSH_init() writes zeros to locations after 0x60000000 and performs CSH_SET_ACS_WAY(way) 4 times. Could this have something to do with the RAM location? |
antime | Jan 10, 2005 | |||
Reading a 32-bit int from 0x24ffffff isn't going to net you more than an alignment exception. The memory range in the cartridge manual is the correct one, and the SH7604 manual will have info on using the cache as RAM. |
ExCyber | Jan 10, 2005 | ||||
Cartridges are mapped to the "A-Bus CS0" (normally ROM/RAM) and "A-Bus CS1" (normally cart ID) regions. |
RockinB | Jan 12, 2005 | ||||
I'm very, very happy to say: Both problems are solved! :banana :cheers (thanks antime and ExCyber!) 1. checking for, initializing and using extended RAM carts:
Code:
2. initializing and using half of CPU's Cache as RAM: init: CSH_SET_WAY_MODE( CSH_2WAY ) Edit: better use CSH_Init(CSH_2WAY), it cares about cache disabling and stuff now ways 0, 1 are RAM, ways 2,3 mixed instruction/data cache memory use: 0xC0000000 way 0 0xC00003FF 0xC0000400 way 1 0xC00007FF Wow, I'm very excited about that! Now borders are shifted back... Edit: look at 2. |