Skip to content

Commit

Permalink
Fix N163 instrument load clobbering Kxx state
Browse files Browse the repository at this point in the history
Fixes #224.
Iterates upon #156.
  • Loading branch information
Gumball2415 committed Feb 17, 2024
1 parent b52993e commit d252309
Show file tree
Hide file tree
Showing 4 changed files with 352 additions and 345 deletions.
2 changes: 1 addition & 1 deletion Source/drivers/asm/build/build_engine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ end

local build = function (chip)
print("Building NSF driver for " .. chip .. "...")
os.execute([[ca65 ../driver.s -l out_]]..chip..[[.lst -D USE_]]..chip..[[ -D PACKAGE -D USE_BANKSWITCH -D USE_OLDVIBRATO -D USE_LINEARPITCH -o driver.o]])
os.execute([[ca65 ../driver.s -l out_]]..chip..[[.lst -D USE_]]..chip..[[ -D NAMCO_CHANNELS=8 -D PACKAGE -D RELOCATE_MUSIC -D USE_BANKSWITCH -D USE_OLDVIBRATO -D USE_LINEARPITCH -o driver.o]])
os.execute([[ld65 -o c0_]] .. chip .. [[.bin driver.o -C c0.cfg]])
os.execute([[ld65 -o c1_]] .. chip .. [[.bin driver.o -C c1.cfg]])

Expand Down
5 changes: 5 additions & 0 deletions Source/drivers/asm/n163.s
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ ft_load_inst_extra_n163:
iny
.endif
@DoneParams:
; check if non-N163 type
lda ft_channel_type, x
cmp #CHAN_N163
bne :++
; check if N163 instrument is about to change
lda var_NamcoInstrument - N163_OFFSET, x
cmp var_Temp2
beq :+
Expand Down
Loading

0 comments on commit d252309

Please sign in to comment.