kirjavascript/Flex2

Loading Offsets

Opened this issue · 4 comments

Is there a way to load different type of dplc offsets. Sonic games mostly use word pointers. The games I'm working on use word pointers but have additional word/long values or pointers used for various things like frame ID's/Object ID's etc. Flex2 see's these additional values as word pointers causing issues.

Something like this

Loadcues_Joe: dc.w 0
dc.w DMAJoe_Null-Loadcues_Joe
dc.w $1
dc.w DMAJoe_Stand1-Loadcues_Joe
dc.w $2
dc.w DMAJoe_StandBlock1-Loadcues_Joe

it should be possible to support this.

I'm working on making mapping labels have retained names, and these names could be reused in the dplc output

is DMAJoe_Stand1 referring to a mapping definition, or something else?

DMAJoe_Stand1 is referring to DPLC location. The thing is if I edit the DPLC table so it removes the frame ID like this

dc.w DMAJoe_Null-Loadcues_Joe
dc.w DMAJoe_Stand1-Loadcues_Joe
dc.w DMAJoe_StandBlock1-Loadcues_Joe

Then it loads the sprite perfectly
Untitled

Below is what happens when loading the DPLC table with the frame ID

Loadcues_Joe: dc.w 0 ; Frame ID
dc.w DMAJoe_Null-Loadcues_Joe ; word pointer pointing to the DPLC
dc.w $1
dc.w DMAJoe_Stand1-Loadcues_Joe
dc.w $2
dc.w DMAJoe_StandBlock1-Loadcues_Joe

1Untitled

I've tried adding macros to differentiate what a word pointer and what a frame ID, it doesn't seem to work.

Loadcues_Joe: mappingsTable
mappingsTableEntryFrame.w $0
mappingsTableEntry.w JoeVRAMPos-Loadcues_Joe
mappingsTableEntryFrame.w $1
mappingsTableEntry.w VRAMPos_Stand1-Loadcues_Joe
mappingsTableEntryFrame.w $2
mappingsTableEntry.w VRAMPos_StandBlock1-Loadcues_Joe

mappingsTableEntryFrame macro frameID
dc.w frameID
endm

Regarding the frame ID, it is required to load the correct mappings.
Revenge of Shinobi and Streets of Rage 1 use a similar mappingsTable format for mapping and DPLC . I'm assuming Offset(dc.x) reads the word pointer tables, right?

Ah I see now. It just needs an alternative offsetTable loader.

The frame ID stuff can be stored in the 'auxiliary information' section I have added in the new development version of flex 2

Could you send me the assets somehow so I can test? Doesnt need to be public. I should be able to support it after this