Welcome to the Shining Force Central Forums!
SFC Forums Index Shining Forums Shining Force
Register for your free forum account now or Login to remove this advert.

RAM Map

List of memory locations

Discussion about the original classic Genesis/Mega Drive game. Posts about the GBA remake belong in the forum below.

RAM Map

Postby rubixcuber » Wed Jul 12 2017 5:35am

FF0000-FF00C0-? Palettes

?-FF0CBF-? Positioning and such of animation components

?-FF0D30-? Positioning and such of map sprites

FF0EB7 - number of frames to pause while playing sound?

FF0E97 - Button States, Remains Held

FF0E99 - Button States, Single Frame

FF0E9E-? Sound Effects?



FF0EB1 - Wait flag? Used to tell when sound effects are done?

FF0EBE - Wait flag? Used to tell when sound effects are done?

FF0EB7 - Screen Effect / Transition

FF0EC2 - RNG Result

FF3000 - ? Ram used for decompressing graphics

FF5000 - FF51FF?
Sprites
0 : 1 Byte X
1 : 1 Byte Y
2 : 1 Byte Facing/Anim
3 : 1 Byte GFX (Indexes into FFF80C which has list of actual map sprite numbers)
4-5:2 Bytes X, Relative-ish to Hero?
6-7:2 Bytes Y, Relative-ish to Hero?
8 : 1 Byte ?
9 : 1 Byte Frame?
A : 1 Byte Frames Between Event Steps
B : 1 Byte Frames Until Next Event Step
C : 1 Byte Event Command Frame?
D : 1 Byte Current Event
E : 1 Byte Dialog Data?
F : 1 Byte lock counter?

FF52EA - ? Map Data

FF9800-FF9BFF Unused? 0x400

FF9C00 - Chapter
FF9C01 - Region
FF9C02 - Map?
FF9C03 - Version (After Destroyed/Multi Battles, etc)

FF9C48 - Screen X
FF9C49 - Screen Y
FF9C4A - Cursor X
FF9C4B - Cursor Y

FF9C4E - ? Event Flags

FF9C8A-FF9C8D Members joined flags, 1 bit per, lowest bit of 9C8D is char 0 (max) etc
FF9C8E-FF9C91 Money
FF9C92 - FFA141? Force Data
40 Bytes per character, all characters in order
0-7 name
8 ?
9 class
A display name?
B level
C attack
D defense
E agility
F move
10 crit
11 EXP
12-13 Max HP
14-15 HP
16 Max MP
17 MP
18 Status (1,2 = Quick Counter 4,8 = Slow Counter 10,20 Boost Counter 40,80 = Shield Counter)
19 Status (1 = Poison, 2 = Sleep, 4 = Cursed, 8 = Jogurt, 10,20=Muddle Counter, 40,80=Dispel Counter)
1A-1D Items
1E-21 Magic
22-27 ?

FFA16A-FFA187 Level Promoted At

FFA18A-FFA195 Current Force Members

FFA196-FFA1A5? Deals stock
4 bits per item = # available

FFA1B6-FFA3B5 - Battle Member Data
16 bytes per character, active force followed by enemies
0 - ID
1 - X
2 - Y
3 - Attack
4 - Defense
5 - Agility
6 - Move
7 - Crit
8 - ?
9-B Items
C-F Magic


FFA4C0-FFA8BF Map Square flags table? 1 = pass through 2 = stop?
FFA8C0-FFACBF Distance to map square table
FFACC0-FFB0BF Terrain at square table

FFA8C0-? Shop Inventory (Also other item lists?)

FFA946-? Target Table?

FFA988-? Target Priority Table

FFA9E0-FFA9E1 Message ID
FFA9E2-FFA9E3 Message Argument (Character?)
FFA9E4-FFA9E5 Message Argument ?
FFA9E6-FFA9E9 Message Argument (Number?)

FFB4D5 Facing searchable? (in battle) (menu type?)
FFB4D6 Sprite Direction

FFB51B-? Spell cast setup data
B51B - target type? Force/Enemy?
B51C - Spell
B51D - Target
B51E - X
B51F - Y

FFB540-FFB547 Weapon Sprite Animation Data?

FFB5AA-AB Portrait related?
FFB5AC 1 when displaying portrait?
FFB5AD 1 when writing text?

FFB5BC Animation Playing?
FFB5BD Animation Finished?

FFB5BE Animation Argument 1? (Spell level?)
FFB5BF Animation Argument 2? (Anim type?)

FFB5C0-? Animation effects table
16 bytes per
XXXX x position
YYYY y position
?E?? exists
GGGG graphics? Frame?
????
????
????
????

FFB6B8 - vertical screen position? For shake effects

FFB7C0-FFB7C3 Screen Adjusted Cursor Position
FFB7C4-FFB7C5 Current Battle Member / Interaction,chest?

FFBC52-FFBC53 Map Width
FFBC54-FFBC55 Map Height

FFBC60-FFBC65 Tileset Animation ?
FFBC66-FFBC67 Tileset Animation Frame (Water and such)
FFBC68-FFBC69 Tileset Animation ?

FFBC6E-FFBC6F Battle Sprite Number?

FFBC74 Battle Member index

FFBC76-FFBC77 Animation Type?

FFBC8F-FFBC90? Battle Animation members?

FFBCA4 - Attack Animation?

FFBE00-FFBFFF Unused? 0x200

FFC08E-? IDs of characters/enemies killed by last attack

FFCOBE - Sound effect related? Pitch for text

FFC200-FFC5FF Movement cost by square -1 = invalid

FFC628 Enemy Data, mimics FF9C92

FFCB3E Type? Spell/item/attack?
FFCB40 Spell to cast?
FFCB42 Range to use?
FFCB43-FFCB45 Effect to use?

FFCB4C-FFCB4F Priority Routine Pointer

FFCB46-FFCB47 Max range?
FFCB48-FFCB49 Min range?
FFCB4A AI Regions Triggered (1 bit for each)

FFCB50-1? EXP to gain
FFCB52-3 Coins to gain
FFCB54-5 Whether to drop item? Other flags?
FFCB56-7 Item to drop

FFCB58-FFCB59 Amount of damage to do?

FFCB5C-FFCB5D Number of attack

FFCB5E-F Crit/Damage Multiplier? In units of 50%

FFCB60 Item slot being used?

FFCB62 Current item?

FFCB65 Message Offset (+463)

FFCB67 Special Attack Type?

FFCB68 Force member in attack
FFCB69 Enemy in attack

FFCB6E Source and target on same team?

FFCB74 Item being used?

FFCBA6 Force Battle Sprite?

FFCBAA-FFCBAB Attack Animation?
FFCBAC-FFCBAD ?

FFCBB0-FFCBB1 Weapon Sprite?
FFCBB2 Special attack flag/value?

FFCC00-FFCFFF Unused? 0x400 (relocated level promoted, members joined)

FFF020-FFF7FF Unused? 0x7E0 (relocated char data)

FFF800 - Map Width
FFF801 - Map Height
FFF802 - Text Position, X
FFF803 - Text Position, Y

FFF807 - Map
FFF808 - Dialog ID

FFF80C-? Map Sprite List

FFF818 - Button states temp

FFF81C - Gets set to FF before clearing GUI layer?

FFF820 - Frame Counter
FFF821 - Diagonal Input? 1=UR, 2=DR, 3=DL, 4=UL?

FFF834-FFF835 - Some form of counter?

FFF844 - Message Argument? For looking up names?

FFF84B-? Copy of item data when working with an item?

FFF8CE-FFF8CF - Tile Number

FFF8D0 - Tile Event
FFF8D1 - Upper Layer Tile Number

FFF8D2 Tile Roof Group?
FFF8D4 Tile Roof Group?

FFF8D6-FFF8D7 - Offset based on tile position?

FFF8D9 - Set for one frame when moving to the next tile?

FFF90C - Something pointer... generally points to FFF844?

FFF92C - Map Sprite Data Pointer

FFFF5C - Current Text





Basic RAM Searching Instructions

WARNING: SPOILER!
rubixcuber

User avatar
Shining Hero
Shining Hero
 
Posts: 1113
Joined: Tue Nov 18 2008 4:36am

Re: RAM Map

Postby monkbarron » Wed Jul 12 2017 3:49pm

What the....?
:sleep: Z Will Always Dominate Any SF TAS :sleep:
:sleep: Z Will Always Dominate Any SF TAS :sleep:
monkbarron

User avatar
Shining Member
Shining Member
 
Posts: 202
Joined: Mon May 22 2017 2:38am

Re: RAM Map

Postby xenometal » Thu Jul 13 2017 4:42am

Alright, I figured I'd start looking for potentially unused RAM, so I started a playthrough following your instructions to search for addresses that do not change.

I've went through the first two chapters so far, and results are now down to: 11195 Possibilities (963 Regions). Results are decreasing a lot more slowly at this point.

Is there a way to dump results to a text file once I'm done?
Or am I supposed to type down thousands of offsets one by one? :lol:
xenometal

User avatar
Shining Member
Shining Member
 
Posts: 431
Joined: Tue Mar 28 2006 3:05am
Location: Canada

Re: RAM Map

Postby rubixcuber » Thu Jul 13 2017 5:58am

Ha. Yeah, as far as I know there's no dump I'm afraid.

But at least as far as unused space only relatively large continuous chunks are very useful.

And for that you can start by changing the data size to 4 bytes, which will rule out like single isolated bytes. (You should be able to change that in the middle of the search)

Other than that though, I don't know there's much better way to go about it than scanning through for sections with no gaps. If you do enough and limit it to 4 bytes you shouldn't have quite so many.

I also forgot to mention, part of the way through the list it switches from FFXXXX to AXXXXX and you can use shift to highlight all of those and hit eliminate which might cut out about half.

Maybe it would be worth me writing a custom RAM search tool, heh.
rubixcuber

User avatar
Shining Hero
Shining Hero
 
Posts: 1113
Joined: Tue Nov 18 2008 4:36am

Re: RAM Map

Postby Lobo » Thu Jul 13 2017 12:44pm

You've been talking japanese to me, mates! :)
Hope this goes well!
Lobo

User avatar
Shining Hero
Shining Hero
 
Posts: 997
Joined: Fri Sep 17 2004 5:31pm
Location: Rio de Janeiro / Brazil

Re: RAM Map

Postby Wiz » Thu Jul 13 2017 1:20pm

Not sure if this can help, but in my disassemblies, I use a "constants" file to store all used addresses outside of the ROM to build.

Example with SF2DISASM :
https://github.com/ShiningForceCentral/SF2DISASM/blob/master/disasm/sf2const.asm
All RAM offsets referenced in the disassembly are automatically listed here (end of file), which helps create an exhaustive RAM map.

SF1DISASM also has this kind of file :
https://github.com/ShiningForceCentral/SF1DISASM/blob/master/disasm/sf1const.asm
But since not much work has been put into SF1DISASM (yet ! ;)), not all the game's code has been disassembled so RAM references may be missing. This is not an exhaustive list, I mean.
Still, I hope this can help a bit ! :)
Wiz

User avatar
Shining Member
Shining Member
 
Posts: 143
Joined: Sun Mar 18 2007 2:43pm
Location: Blois, France

Re: RAM Map

Postby rubixcuber » Thu Jul 13 2017 3:20pm

Those lists are useful, but part of the problem is that those just give you starting offsets. So it's good maybe for finding used areas but it's much harder to prove the negative!

FF3000 is the graphics decompression scratch ram which of course can go on for thousands of bytes and I'm guessing you only have fixed addresses there, not computed ones? For example some RAM tables in SF1 are consecutive and they only bother directly accessing the address of the first one and do like an ADDA.L #$0400 to get the address of the next one.

If I'm going to use some RAM to add a new table or something to the game, have to be pretty much 100% certain nothing uses any of that space, which is almost impossible just through disassembly and code analysis, which is why I usually just rely a bit more on the watching for changes method.

Unless you have some sort of trick that I'm missing!
rubixcuber

User avatar
Shining Hero
Shining Hero
 
Posts: 1113
Joined: Tue Nov 18 2008 4:36am

Re: RAM Map

Postby monkbarron » Thu Jul 13 2017 3:35pm

I feel like that small child sitting next to the smartest people in the world. None of this, at all, makes even the slightest sense to me, so I'm going to stop posting here.
:sleep: Z Will Always Dominate Any SF TAS :sleep:
:sleep: Z Will Always Dominate Any SF TAS :sleep:
monkbarron

User avatar
Shining Member
Shining Member
 
Posts: 202
Joined: Mon May 22 2017 2:38am

Re: RAM Map

Postby Wiz » Thu Jul 13 2017 4:10pm

rubixcuber, you're absolutely right, computed adresses cannot be listed, and you don't even know how much is really used in bigger areas.
Knowing how the game uses those areas helps a lot, of course, but I agree that your method actually is the most secure : eliminate candidate RAM offsets by watching all modified ones during a whole playthrough. Some version of Gens might help here, especially the ones with LUA scripting included.
Quite a bit of work nonetheless !
Wiz

User avatar
Shining Member
Shining Member
 
Posts: 143
Joined: Sun Mar 18 2007 2:43pm
Location: Blois, France

Re: RAM Map

Postby xenometal » Tue Jul 18 2017 4:09am

Wiz, I guess that's where a room with a thousand monkeys on a thousand typewriters would come in handy, huh?

One such monkey has finished playing through the game, and following your recommendations Rubix, results are down to: 4779 Possibilities (208 Regions).

So, I've scanned through the results and while it turns out that you already found the larger chunks of unused RAM, I did find some additional fairly sized ones which hopefully will be useful for whatever new systems/expansions you have in mind.

I took note of everything including a couple of lone addresses here and there for completion's sake, though I've bolded the more useful bits for your convenience.

I also noted the unused space you had already found, as my results differed slightly from yours (which I marked with double asterisks.) I'll let you figure what's up with that.

Finally, there are some addresses that hold non-zero values that are reported as unchanged, even though they did change. :confused:
I'm unsure how to interpret those results, so I took note of the current and previous values to let you figure out what's going on.

I've still got the results up (I wish I could save them...), so please don't hesitate to ask for further testing to be done, if there's any.

Potentially unused RAM
WARNING: SPOILER!


Unchanged RAM (?)
WARNING: SPOILER!
xenometal

User avatar
Shining Member
Shining Member
 
Posts: 431
Joined: Tue Mar 28 2006 3:05am
Location: Canada

Re: RAM Map

Postby rubixcuber » Tue Jul 18 2017 5:41am

Oh, awesome!

That is very nice.

I've saved that with my notes, will have to look through it more at some point but that should save some time.
rubixcuber

User avatar
Shining Hero
Shining Hero
 
Posts: 1113
Joined: Tue Nov 18 2008 4:36am


Return to Shining Force

Who is online

Users viewing this topic: No registered users and 1 guest