Some questions about initialisations

Ask anything your want about Megadrive/Genesis programming.

Moderator: BigEvilCorporation

Post Reply
tryphon
Very interested
Posts: 316
Joined: Sat Aug 17, 2013 9:38 pm
Location: France

Some questions about initialisations

Post by tryphon » Fri Oct 24, 2014 3:40 pm

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 ?

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Fri Oct 24, 2014 4:27 pm

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.

tryphon
Very interested
Posts: 316
Joined: Sat Aug 17, 2013 9:38 pm
Location: France

Post by tryphon » Fri Oct 24, 2014 6:40 pm

Ah thanks :)

tryphon
Very interested
Posts: 316
Joined: Sat Aug 17, 2013 9:38 pm
Location: France

Post by tryphon » Sat Oct 25, 2014 9:42 pm

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 ?)

MintyTheCat
Very interested
Posts: 484
Joined: Sat Mar 05, 2011 11:11 pm
Location: Berlin, Germany

Post by MintyTheCat » Sat Oct 25, 2014 10:15 pm

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.
UMDK Fanboy

tryphon
Very interested
Posts: 316
Joined: Sat Aug 17, 2013 9:38 pm
Location: France

Post by tryphon » Sat Oct 25, 2014 11:02 pm

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.

Post Reply