c4 help

Strictly for discussing ZSNES development and for submitting code. You can also join us on IRC at irc.libera.chat in #zsnes.
Please, no requests here.

Moderator: ZSNES Mods

Post Reply
trio

c4 help

Post by trio »

questions...

The snes gives only 16 bit writes to the c4 correct? There should be nothing coming in for 8 bit?

Also, the snes reads and writes to the c4, but the c4 does no writing outside of itself?

Any emulator that shows c4 memory would be cool?

version 1.5 is the current c4 document?

thanks
Logite
New Member
Posts: 4
Joined: Sun May 07, 2006 1:29 am

Post by Logite »

Lol, c4 is a type of explove. ZOMG.

Just messing. I have no idea what you're talking about.
creaothceann
Seen it all
Posts: 2302
Joined: Mon Jan 03, 2005 5:04 pm
Location: Germany
Contact:

Post by creaothceann »

C4 is a chip by Capcom for Megaman X2 and X3.
vSNES | Delphi 10 BPLs
bsnes launcher with recent files list
pagefault
ZSNES Developer
ZSNES Developer
Posts: 812
Joined: Tue Aug 17, 2004 5:24 am
Location: In your garden

Post by pagefault »

Nach could answer this. He worked on C4. I am sure it must have 8-bit access though.
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Re: c4 help

Post by Nach »

trio wrote: The snes gives only 16 bit writes to the c4 correct? There should be nothing coming in for 8 bit?
The SNES is a 16 bit processor, so technically all operations are 16 bit. However if you have your emulator doing any 8 bit reading or writing, I imagine you'll have to have your C4 core support it.
The C4 itself uses 24 bit registers.
trio wrote: Also, the snes reads and writes to the c4, but the c4 does no writing outside of itself?
The C4 has a data transfer call which is basically a memcpy() of data internally to SNES memory.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
trio

Post by trio »

from the c4 doc-

Code: Select all

 $7f40-$7f47 are used to load data from RAM. The registers are as follows:
 $7f40-2: Source address
 $7f43-4: Count
 $7f45-6: Dest address, so far always $6600
 $7f47:   Begin transfer (protect before and after with $7f5e)
This is for loading ram into the c4 chip from snes ram. Why have 3bytes for source address? (EDIT: oh 3bytes is 24, whoops, but i guess only 16 bits are used? 40 is lsb 41 is msb?) Count is how many (bytes?) to copy starting at source? If 7f47=1 then transfer, wait if 0? Is all this right?

There is nothing mentioned on loading data back into snes ram, unless I skipped something?

there is only this stuff below, and the c4 functions (oam and wireframes and such). I can understand and make the functions fine, the doc is great for that, but how c4 works with snes is really skimpy. Yeah, and I cant find anything on the c4 writing back to the snes. Where would it write to?

Code: Select all

C4 info
========

The C4 chip maps its registers and memory at $6000-$7fff in banks $00
through $3f. Known portions of the memory space are:
 $6000-$6bff: Generic RAM
 $7f40-$7f47: See below
 $7f48:       Unknown, always seems to be 01
 $7f4c:       ??? (seems to be cleared for wireframe and lines, set for OAM)
 $7f4d:       Subcommand specifier for command 00
 $7f4e:       Unknown, always seems to be 00
 $7f4f:       Command specifier, when this is written the C4 does something
 $7f5e:       Bit 6 seems to be set when the C4 is working, and clear otherwise
 $7f80-$7faf?: A number of 3-byte registers
oh, btw this is for snesAdvance for gameboy advance, using ARM asm. Also, thanks a lot for the response. I need a lot of help obviously.
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Addresses are SNES addresses, that means anywhere.

Only time SNES requests C4 to transfer from SNES is to checksum ROMs in C4 test.
Not sure of exactly when the C4 transfers the other way, but it definitly transfers from C4 to SNES RAM in X2 when you fight Serges the first time.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Post Reply