Advice needed. The Arkos Tracker players have duplicated code (for each channel). I'd like to avoid this, but this is tricky. Maybe one of you can enlighten me on how to improve this.
I know I can use macro and local labels.
MACRO ManageNote
ld hl,(@stuff + 1)
@stuff ld de,#4000
ENDM
ManageNote ;For channel 1
ManageNote ;For channel 2
ManageNote ;For channel 3
The problem is, I would like to have these macros to address labels from the related channel.
MACRO ManageTrack
ld hl,(@stuff + 1) ;From the macro above!!
ld de,12
add hl,de
ENDM
ManageTrack ;For channel 1
ManageTrack ;For channel 2
ManageTrack ;For channel 3
How is it possible? I should be able to generate labels, maybe from placeholder and parameters in the macro, but it probably won't work...
... After testing... YES IT WORKS!! Damn, this is great!
MACRO test chan
defb {chan}
stuff{chan} ld a,0
ENDM
test 1 ; This generated a "stuff1" label!
test 2 ; This generated a "stuff2" label!
This is amazing!! Well done Roudoudou!! This is crazy stuff. Ok, I guess I have found my solution, but if anyone want to add it 2 cents, thanks

.