refactor(asm&go4k): Remove double SU_SEND macros, voice(0) corresponding to local send and voice(n) corresponding to global.

This commit is contained in:
Veikko Sariola
2020-11-10 00:53:06 +02:00
parent 1c0ac08450
commit 5ceab766cc
27 changed files with 52 additions and 62 deletions

View File

@ -156,10 +156,6 @@ func ParseAsm(reader io.Reader) (*Song, error) {
case "SAMPLE":
parameters["type"] = Sample
}
} else if unittype == "send" {
if _, ok := parameters["voice"]; !ok {
parameters["voice"] = -1
}
}
unit := Unit{Type: unittype, Stereo: stereo, Parameters: parameters}
instr.Units = append(instr.Units, unit)

View File

@ -170,8 +170,8 @@ func Synth(patch go4k.Patch) (*C.Synth, error) {
values = append(values, byte(flags))
} else if unit.Type == "send" {
address := unit.Parameters["unit"]*16 + 24 + unit.Parameters["port"]
if unit.Parameters["voice"] != -1 {
address += 0x4000 + 16 + unit.Parameters["voice"]*1024 // global send, address is computed relative to synthworkspace
if unit.Parameters["voice"] > 0 {
address += 0x4000 + 16 + (unit.Parameters["voice"]-1)*1024 // global send, address is computed relative to synthworkspace
}
if unit.Parameters["sendpop"] == 1 {
address += 0x8000

View File

@ -195,7 +195,7 @@ var UnitTypes = []UnitType{
SupportsStereo: true,
Parameters: []UnitParameter{
{Name: "amount", MinValue: 0, MaxValue: 128, CanSet: true, CanModulate: true},
{Name: "voice", MinValue: -1, MaxValue: 31, CanSet: true, CanModulate: false},
{Name: "voice", MinValue: 0, MaxValue: 32, CanSet: true, CanModulate: false},
{Name: "unit", MinValue: 0, MaxValue: 63, CanSet: true, CanModulate: false},
{Name: "port", MinValue: 0, MaxValue: 7, CanSet: true, CanModulate: false},
{Name: "sendpop", MinValue: 0, MaxValue: 1, CanSet: true, CanModulate: false},