I have a question to anyone with some 68k language knowledge.
This requires some set up for explanation so bear with me.
This has to do with Shadow run on Sega.
In the game there are 12 weapons. Each weapon is assigned a number between 1 and 12 that the game uses to track it. This tells the game what type of gun it is (pistol, smg, or shotgun), tells it how to reduce its ammo (3 per trigger pull for burst weapons), and determines if the gun fires in a burst fire or not.
1-7 correspond to pistols
8-10 correspond to smgs
11-12 correspond to shotguns
The way the game works is it runs a compare bit and then branches into two different directions based on rather the gun is an pistol/shotgun or SMG. SMGs are assigned numbers 8,9, and 10. So the code looks like this.
and the way I understand what is going on it compares the bit to 8,9, and 10 and sends the game to one of two locations to determine how the weapon fires.
I have been able to make guns past a certain points in the string fire on burst by replacing "branch if equal" with "branch if greater than". This has given me some flexibility redesigning the weapons but is also restrictive. I've been able to design a machine pistol by making it branch if greater than 6 but this also has the effect of making the shotguns fully automatic.
So with this said I have a couple of questions.
What kind of command did the Sega use to identify what items correspond to the bit number? Some details of the weapons (Name, inventory picture, ammo count, damage, armor piercing ability, etc) are all defined in specific addresses in the ROM. Each item has about two full ROM addresses dedicated to it. So somewhere in the code it has to say "these two ROM addresses correspond to gun 1, these two to gun 2, etc.
Second question would be how to I read the branch command? Where is it telling the game to go look for additional directions above? I do not understand what 0x0000002a or 0x00000127 means.
I know you cannot just insert directions into the ROM because it would throw the address off. But a good portion of the ROM is not used in the addresses that the SEGA developer manual says is dedicated to game info. I was hoping to change the branch location to an unused part of the rom and then I could insert a few more iterations of compare bit to x and branch if equal and then bring it all back around. Would this possibly be a solution?
I apologize if my questions don't make sense, I can try to clarify if needed.
Thanks in advance for any help.