SN76489: Prevent and return error code if a pitch greater than 03FF is attempted to be set

This commit is contained in:
Dean Netherton
2020-04-28 18:35:20 +10:00
parent ade954ab69
commit b1bb684a04

View File

@@ -147,11 +147,19 @@ SN7_PITCH:
AUDDEBUG("SN7PIT ")
AUDTRACE_HL
AUDDEBUG("\r\n")
LD (PENDING_PITCH), HL
LD A, H
CP $04
JP NC, SN7_QUERY_PITCH1 ; RETURN NZ IF NUMBER TOO LARGE
LD (PENDING_PITCH), HL
XOR A ; SIGNAL SUCCESS
RET
SN7_QUERY_PITCH1:
OR $FF
RET
SN7_PLAY:
AUDDEBUG("SN7PLY ")
AUDTRACE_D
@@ -188,7 +196,6 @@ SN7_QUERY_CHCNT:
SN7_QUERY_PITCH:
LD HL, (PENDING_PITCH)
XOR A
RET