Page 1 of 1

Some questions about initialisations

Posted: Fri Oct 24, 2014 3:40 pm
by tryphon
I investigate SF2SCE Rom, and after having identified some in-game routines, I try to follow the code from the start-up up to a battle (the goal is to make a rom that boots directly in a human controled Ryu, with no background, no music, no second player).

There are some things at the very beginning that I don't always understand.

For example (some will follow), the first instructions in the RESET are :

Code: Select all

    tst.l   ($A10008).l
    bne.s   loc_0_800E
    tst.w   ($A1000C).l
loc_0_800E:
    bne.s   loc_0_808C
According to CMD's gen-hw document, these are Ctrl registers for port A and B but what does the program expect by reading (and reading a long first) at startup ?

A little further, there's a word read on the VDP Control port (C00004). I read that it reset the flag that governs 16 bit write to it later. Is there another side-effect or can I assume it's the only goal of this read ?

Posted: Fri Oct 24, 2014 4:27 pm
by Stef
That's a common way to know if you're doing a cold boot or soft/hard reset.
If ports are initialized (normally you initialize them at some point) it means you're on a soft/hard reset else you're on a cold boot.

Posted: Fri Oct 24, 2014 6:40 pm
by tryphon
Ah thanks :)

Posted: Sat Oct 25, 2014 9:42 pm
by tryphon
Another question : what are the possible values of the IO Version register at A10001 ? And what do they correspond to ?

(and to prevent me from asking silly questions, is there a web ressource somewhere for this kind of thing ?)

Posted: Sat Oct 25, 2014 10:15 pm
by MintyTheCat
tryphon wrote:Another question : what are the possible values of the IO Version register at A10001 ? And what do they correspond to ?

(and to prevent me from asking silly questions, is there a web ressource somewhere for this kind of thing ?)
http://emu-docs.org/?page=Genesis

File: sega2f.htm

OR

search for the PDF version or perhaps someone has the HTML hosted and online.
That is a good place for you to start also:

File: gen-hw.txt

For starters.

Posted: Sat Oct 25, 2014 11:02 pm
by tryphon
Thanks. I already have gen-hw, but it says nothing about the values of IO Version register.

I found sega2f pdf version and it has the answer to my question (though difficult to read), thanks.