!macro MACRO_fill_nops .count, .addr{ ldx #.count lda $ea ; nop -: sta $.addr,x dex bpl - } ;============== !macro MACRO_copy_table .count .src .dst{ ldx #.count -: lda .src,x sta .dst,x dex bpl - } ;============== irq_line_48_table1: !byte $9a,$a2,$06,$ca,$d0,$fd,$ea,$a9 !byte $00,$8d,$1d,$d0,$8d,$1c,$d0,$24 !byte $ea,$a9,$30,$cd,$12,$d0,$f0,$00 irq_line_48_table2: !byte $24,$EA,$AD,$16,$D0,$29,$77,$A8 !byte $A2,$00,$AD,$16,$D0,$8C,$16,$D0 !byte $9D,$16,$D0,$8C,$16,$D0,$EA,$8D !byte $16,$D0 irq_line_48_table3: !byte $8c,$16,$d0,$ea,$8d,$16,$d0 ;-----------------------------
ldy #7 -: +MACRO_fill_nops 20, $1391 +MACRO_copy_table 6, irq_line_48_table3, $13a6 ;MODIFY THE ARGUMENTS OF THE MACRO HERE dey bne -
ldy #7 -: modme_1: +MACRO_fill_nops 20, $1391 modme_2: +MACRO_copy_table 6, irq_line_48_table3, $13a6 ; modify modme_1 + 5/6 to change the address ; modify modme_2 + 6/7 to change the address dey bne -
i'd prototype the routine using for-loops and conditional assembly (not macros) - and when it works and you are sure you wont modify it anymore, basically do the same thing but with small snippets you copy and patch as needed.