DevSound discussion

Discussion of programming and development for the original Game Boy and Game Boy Color.
User avatar
ISSOtm
Posts: 46
Joined: Fri Jan 04, 2019 5:31 pm
Location: France, right of a pile of consoles
Contact:

Re: DevSound discussion

Post by ISSOtm » Fri Mar 01, 2019 4:40 am

I have a nearly-finished DevSound refactor that uses macros to avoid duplicating code between handling each channel - it's not complete because I can't wrap my head around some details in CH4, and DevEd is busy so I'm help-less (pun intended). I can publish it here, if there's interest.
The French Lord of Laziness (and a huge Legend of Zelda fan)
https://github.com/ISSOtm
ASMu is laifu <3

User avatar
dougeff
Posts: 2691
Joined: Fri May 08, 2015 7:17 pm
Location: DIGDUG
Contact:

Re: DevSound discussion

Post by dougeff » Fri Mar 01, 2019 10:54 am

macros
Maybe I'm misunderstanding your use of "macro", but to me, a macro is a compiler/assembler pattern that will ultimately assemble to a LARGER binary.

Maybe you mean something more like a subroutine of common code. That would reduce code size?

Or maybe just using macros to make the source code easier to read. ?
nesdoug.com -- blog/tutorial on programming for the NES

tepples
Posts: 21985
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: DevSound discussion

Post by tepples » Fri Mar 01, 2019 1:39 pm

As I understand nullsleep's tutorial, "macros" in MML mean the same thing as "sequences" in FamiTracker. They're essentially envelopes, which MML assigns directly to a channel but FT binds to an instrument.

User avatar
ISSOtm
Posts: 46
Joined: Fri Jan 04, 2019 5:31 pm
Location: France, right of a pile of consoles
Contact:

Re: DevSound discussion

Post by ISSOtm » Sun Mar 03, 2019 5:06 pm

dougeff wrote: Or maybe just using macros to make the source code easier to read. ?
The goal was to deduplicate code without increasing runtime costs, yes. Basically, all the channels share some code (mainly, the command reader and processor), so I basically made a giant `update_channel` ASM macro.
The French Lord of Laziness (and a huge Legend of Zelda fan)
https://github.com/ISSOtm
ASMu is laifu <3

Post Reply