shooking / ZoomPedalFun

A collection of tips and tricks for Zoom B1On, B1XFour and G1XFour pedals.
Creative Commons Zero v1.0 Universal
60 stars 2 forks source link

What's in a ZDL file? #18

Open shooking opened 2 years ago

shooking commented 2 years ago

So I am positive the ZDL was Zoom's first FX format. The ZD2 seems to be version 2.00 of this

Looking at a MS 70 CDR I am convinced, like the ZD2, there must be bitmaps in there. We know we can derive the FX/GID from a ZDL. We can get the FX name We can determine parameter names and values, max midi and default values.

But until today I never cut out the ELF and pushed into Linux tools.

So removing the first 0x4c bytes from a typical ZDL (160 COMP.ZDL)

image

Leaves us with

image

And we can put this thru good old

$ readelf -h test.elf
ELF Header:
  Magic:   7f 45 4c 46 01 01 01 40 00 00 00 00 00 00 00 00
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            Bare-metal C6000
  ABI Version:                       0
  Type:                              DYN (Shared object file)
  Machine:                           Texas Instruments TMS320C6000 DSP family
  Version:                           0x1
  Entry point address:               0xb64
  Start of program headers:          12522 (bytes into file)
  Start of section headers:          12650 (bytes into file)
  Flags:                             0x0
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         4
  Size of section headers:           40 (bytes)
  Number of section headers:         36
  Section header string table index: 35

So now we know the DSP family. And some idea of offsets. Maybe I can find the bitmap format - likely it is the older school version - we know the new ZD2s has a BM and normal format.

https://www.fileformat.info/format/bmp/egff.htm

Anyone who has any insights - please add a comment.

shooking commented 2 years ago

might be an interesting resource ... https://www.ti.com/tool/C6000-CGT

downloading now for Windoze :-)

shooking commented 2 years ago

ok -early days yet BUT ..

c:\ti\ccs1031\ccs\tools\compiler\ti-cgt-c6000_8.3.8\bin>nm6x.exe f:\Interests\Guitars\MS70-CDR\pants\test.elf
00000000 u
00000a58 t $C$L1
000000c0 t $C$L1
00000788 t $C$L1
00000b58 t $C$L10
00000b60 t $C$L11
00000a84 t $C$L2
000001b0 t $C$L2
000008a8 t $C$L2
00000404 t $C$L3
000008c8 t $C$L3
00000a88 t $C$L3
00000410 t $C$L4
00000500 t $C$L5
00000ada t $C$L7
00000b36 t $C$L8
00000b52 t $C$L9
0000012c t $C$RL0
000001a0 t $C$RL1
000001c8 t $C$RL2
000008a4 t $C$RL21
000001e4 t $C$RL3
00000478 t $C$RL4
000004ec t $C$RL5
00000514 t $C$RL6
00000530 t $C$RL7
00000000 ? .args
00000000 ? .audio
00000000 ? .bss
00000000 ? .cinit
00000000 ? .cio
800004f8 d .const
80000000 d .const
800003c8 d .const
80000000 d .const:.string:picEffectType_160_Comp
80000278 d .const:Comp_160
800005d0 d .const:disp_prm_dBComp_Knee
00000000 ? .data
00000000 ? .far
800005dc d .fardata
800005dc d .fardata
00000000 ? .neardata
00000000 ? .plt
00000000 ? .ppdata
00000000 ? .ppinfo
00000000 ? .rodata
00000000 ? .stack
00000000 ? .switch
00000000 ? .sysmem
00000000 t .text
00000a00 t .text
00000720 t .text
00000000 t .text
00000000 t .text
00000d40 t .text:__call_stub
00000ba0 t .text:__divi
00000d80 t .text:__pop_rts
00000da0 t .text:__push_rts
00000c80 t .text:__remi
00000000 a 0338410
00000000 a 0642410
00000000 a Audio_Fx_DYN_160_Comp.asm
80000278 d Comp_160
00000b64 T Dll_160_Comp
00000000 T Fx_DYN_160_Comp
00000920 T Fx_DYN_160_Comp_gain_edit
00000978 T Fx_DYN_160_Comp_init
00000720 T Fx_DYN_160_Comp_knee_edit
000008d0 T Fx_DYN_160_Comp_level_edit
0000086c T Fx_DYN_160_Comp_onf
000007f0 T Fx_DYN_160_Comp_ratio_edit
000007e0 T Fx_DYN_160_Comp_release_edit
0000078c T Fx_DYN_160_Comp_threshold_edit
00000ae4 T GetString_offset_dbxThr
00000a8c T GetString_ofst_dBComp_Knee
00000a00 T GetString_ofst_dBComp_Ratio
00000c2c t LOOP
00000ce8 t LOOP
800003c8 D _Fx_DYN_160_Comp_Coe
00000000 ? __TI_STATIC_BASE
ffffffff A __TI_pprof_out_hndl
ffffffff A __TI_prof_data_size
ffffffff A __TI_prof_data_start
00000d40 T __c6xabi_call_stub
00000ba0 T __c6xabi_divi
00000d80 T __c6xabi_pop_rts
00000da0 T __c6xabi_push_rts
00000c80 T __c6xabi_remi
00000d40 T __call_stub
00000ba0 T __divi
00000d80 T __pop_rts
00000da0 T __push_rts
00000c80 T __remi
00000d58 t __stub_ret
800005dc d _infoEffectTypeKnob_A_2_Reverse
00000000 a call_stub.asm
800005d0 d disp_prm_dBComp_Knee
00000000 a divi.asm
800004f8 D effectTypeImageInfo
80000000 d picEffectType_160_Comp
00000000 a push.asm
00000000 a remi.asm

cf

c:\ti\ccs1031\ccs\tools\compiler\ti-cgt-c6000_8.3.8\bin>nm6x.exe "f:\Interests\Guitars\MS70-CDR\pants\160 Comp.ZDL"

So it seems IF you want to trial these TI tools you do have to strip the ZDLs to get to the ELF .. makes sense. Maybe we can work out from this header .. ELF cruft ... rest?

shooking commented 2 years ago

OK so a friend of mine (Richard) posted for info on Facebook group. Markus Schneider reminds us both that we could use the Zoom Effect Manager 1.1.1 to inject into the pedal - well for the moment instead I trialled that tool to create a custom firmware and decode it - works!

So I think I will have some fun with that approach. From what I can understand the are extracting the ZDLs, just like I do, heeding Barsik's advice about the block size and block indicators, then injection pre-cut ZDLs, recreating the block offsets on the fly from the start of memory in a donor file until they either finish or get to end of available memory. Rather like how the monkey DNA was used to store Coronavirus DNA for vaccine.

So it ought to be possible to do this all in Python and make it avalible to Pi/Mac etc - no promises. And for me it is the fun of being able to remote control the devices.

shooking commented 9 months ago

see also this discussion on the ZD2

https://github.com/mungewell/zoom-zt2/wiki/ZD2-ELF-Dissection

and for ZDL

https://github.com/ELynx/zoom-fx-modding/blob/RainSel-v1.1.0/library/CH_1.md