kirjavascript / Flex2

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

Sonic 3&K's object DPLC is buggy if the first sprite is blank #53

Closed VAdaPEGA closed 1 year ago

VAdaPEGA commented 1 year ago

SpritePlotter.Net's output of this format gets really buggy if the first sprite is null despite working fine when implemented in a ROM hack

Example of generated DPLC :

DPLC_Gatoslip_Overworld_dplc:
    dc.w    DPLC_Gatoslip_Overworld_dplc_Null-DPLC_Gatoslip_Overworld_dplc
    dc.w    DPLC_Gatoslip_Overworld_dplc_0-DPLC_Gatoslip_Overworld_dplc
    dc.w    DPLC_Gatoslip_Overworld_dplc_1-DPLC_Gatoslip_Overworld_dplc
    dc.w    DPLC_Gatoslip_Overworld_dplc_2-DPLC_Gatoslip_Overworld_dplc
    dc.w    DPLC_Gatoslip_Overworld_dplc_3-DPLC_Gatoslip_Overworld_dplc
    dc.w    DPLC_Gatoslip_Overworld_dplc_4-DPLC_Gatoslip_Overworld_dplc
    dc.w    DPLC_Gatoslip_Overworld_dplc_5-DPLC_Gatoslip_Overworld_dplc
    dc.w    DPLC_Gatoslip_Overworld_dplc_6-DPLC_Gatoslip_Overworld_dplc
    dc.w    DPLC_Gatoslip_Overworld_dplc_7-DPLC_Gatoslip_Overworld_dplc
    dc.w    DPLC_Gatoslip_Overworld_dplc_8-DPLC_Gatoslip_Overworld_dplc
    dc.w    DPLC_Gatoslip_Overworld_dplc_9-DPLC_Gatoslip_Overworld_dplc
    dc.w    DPLC_Gatoslip_Overworld_dplc_10-DPLC_Gatoslip_Overworld_dplc
    dc.w    DPLC_Gatoslip_Overworld_dplc_11-DPLC_Gatoslip_Overworld_dplc

DPLC_Gatoslip_Overworld_dplc_Null:  dc.w $FFFF

DPLC_Gatoslip_Overworld_dplc_0: dc.w 1
    dc.w $F
    dc.w $102

DPLC_Gatoslip_Overworld_dplc_1: dc.w 2
    dc.w $13B
    dc.w $1F1
    dc.w $212

DPLC_Gatoslip_Overworld_dplc_2: dc.w 2
    dc.w $247
    dc.w $2C8
    dc.w $350

DPLC_Gatoslip_Overworld_dplc_3: dc.w 1
    dc.w $36F
    dc.w $463

DPLC_Gatoslip_Overworld_dplc_4: dc.w 1
    dc.w $4AF
    dc.w $5A2
[...]

What Flex2 does after loading the file and saving:

DPLC_Gatoslip_Overworld_dplc:
DPLC_Gatoslip_Overworld_dplc_0:     dc.w DPLC_Gatoslip_Overworld_dplc_2-DPLC_Gatoslip_Overworld_dplc
DPLC_Gatoslip_Overworld_dplc_2:     dc.b $0, $2C
    dc.b $0, $2
    dc.b $1, $3B
    dc.b $1, $F1
    dc.b $2, $12
    dc.b $0, $2
    dc.b $1, $3B
    dc.b $1, $F1
    dc.b $2, $12
    dc.b $0, $2
    dc.b $2, $47
    dc.b $2, $C8
    dc.b $3, $50
    dc.b $0, $1
    dc.b $3, $6F
    dc.b $4, $63
    dc.b $0, $1
    dc.b $4, $AF
    dc.b $5, $A2
    dc.b $0, $2
    dc.b $5, $DB
    dc.b $6, $90
    dc.b $6, $A1
    dc.b $0, $2
    dc.b $6, $C7
    dc.b $7, $48
    dc.b $7, $D0
    dc.b $0, $2
    dc.b $7, $EB
    dc.b $8, $A2
    dc.b $8, $D1
    dc.b $0, $1
    dc.b $8, $FF
    dc.b $9, $F2
    dc.b $0, $2
    dc.b $A, $2B
    dc.b $A, $E1
    dc.b $B, $2
    dc.b $0, $3
[...]

Here's what it looks like when importing the file as is: image And this is what it looks like after changing the first entry of the DPLC with the same as the second image

kirjavascript commented 1 year ago

this change in the script file should fix it: https://github.com/kirjavascript/Flex2/commit/431d025f40b75b7ca9ad7c3bda7018959a618c45

can you test? just replace the script file in your scripts folder

VAdaPEGA commented 1 year ago

Yup, that solved it, thank you