kirjavascript / Flex2

sega megadrive sprite editor
MIT License
57 stars 4 forks source link

Loading Offsets #81

Open ibbstar opened 3 months ago

ibbstar commented 3 months ago

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

kirjavascript commented 3 months ago

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?

ibbstar commented 3 months ago

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?

kirjavascript commented 3 months ago

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

ibbstar commented 3 months ago

Hi Thom Load s3dplc.asm and s3map.asm first. Regarding the alternative offsetTable loader, is this flexible as mappings and dplc are? In the sense where you could use multiple types of offsets and data. eg. Word pointer offset pointing to another word offset which points to frame ID following mapping/dplc offset

On Tue, Jul 2, 2024 at 5:56 PM Kirjava @.***> wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/kirjavascript/Flex2/issues/81#issuecomment-2203842093, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVUDZSVKF73FQGEINYYGEYDZKLLVBAVCNFSM6AAAAABJW3YOIWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBTHA2DEMBZGM . You are receiving this because you authored the thread.Message ID: @.***>