Skip to content

Commit

Permalink
Fix S5B init clobbering Kxx state
Browse files Browse the repository at this point in the history
Fixes #256.
Fixes #246.
Fixes #215.
  • Loading branch information
Gumball2415 committed Feb 17, 2024
1 parent e0abc0f commit 1546870
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Source/drivers/asm/s5b.s
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ ft_init_s5b:
sta var_EnvelopeRate
sta var_EnvelopeRate + 1
sta var_EnvelopeType
ldx #(CH_COUNT_S5B - 1)
: sta var_EnvelopeAutoShift, x
sta var_EnvelopeEnabled, x
dex
sta var_EnvelopeEnabled
ldx #CH_COUNT_S5B
: dex
sta var_EnvelopeAutoShift, x
bne :-
lda #$07
sta $C000
Expand Down
4 changes: 2 additions & 2 deletions Source/drivers/drv_all.h
Original file line number Diff line number Diff line change
Expand Up @@ -588,8 +588,8 @@ const unsigned char DRIVER_ALL[] = { // // //
0x8A, 0x48, 0xB5, 0x90, 0x29, 0x7F, 0xAA, 0xA0, 0x00, 0xB1, 0x08, 0x8D, 0x00, 0x48, 0xC8, 0xCA,
0xD0, 0xF7, 0x68, 0xAA, 0x68, 0xA8, 0x60, 0x78, 0x70, 0x68, 0x60, 0x58, 0x50, 0x48, 0x40, 0xA9,
0x40, 0x8D, 0x9E, 0x04, 0x8D, 0x9F, 0x04, 0x8D, 0xA0, 0x04, 0xA9, 0xFF, 0x85, 0xBD, 0xA9, 0x00,
0x85, 0xBC, 0x85, 0xBB, 0x85, 0xBF, 0x85, 0xC0, 0x85, 0xC1, 0xA2, 0x02, 0x95, 0xC2, 0x95, 0xC5,
0xCA, 0xD0, 0xF9, 0xA9, 0x07, 0x8D, 0x00, 0xC0, 0xA9, 0x38, 0x85, 0xBE, 0x8D, 0x00, 0xE0, 0x60,
0x85, 0xBC, 0x85, 0xBB, 0x85, 0xBF, 0x85, 0xC0, 0x85, 0xC1, 0x85, 0xC5, 0xA2, 0x03, 0xCA, 0x95,
0xC2, 0xD0, 0xFB, 0xA9, 0x07, 0x8D, 0x00, 0xC0, 0xA9, 0x38, 0x85, 0xBE, 0x8D, 0x00, 0xE0, 0x60,
0xAD, 0x17, 0x02, 0xD0, 0x17, 0xA2, 0x08, 0x8E, 0x00, 0xC0, 0x8D, 0x00, 0xE0, 0xE8, 0x8E, 0x00,
0xC0, 0x8D, 0x00, 0xE0, 0xE8, 0x8E, 0x00, 0xC0, 0x8D, 0x00, 0xE0, 0x60, 0xA2, 0x00, 0x86, 0xBE,
0xA2, 0x02, 0x06, 0xBE, 0xBD, 0xB9, 0x04, 0x30, 0x02, 0xE6, 0xBE, 0xCA, 0x10, 0xF4, 0xA2, 0x02,
Expand Down
4 changes: 2 additions & 2 deletions Source/drivers/drv_s5b.h
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,8 @@ const unsigned char DRIVER_S5B[] = { // // //
0x0A, 0x0B, 0x0C, 0x0D, 0x00, 0x01, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A,
0x0B, 0x0C, 0x0D, 0x0E, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B,
0x0C, 0x0D, 0x0E, 0x0F, 0xA9, 0x40, 0x8D, 0xD6, 0x02, 0x8D, 0xD7, 0x02, 0x8D, 0xD8, 0x02, 0xA9,
0xFF, 0x85, 0x25, 0xA9, 0x00, 0x85, 0x24, 0x85, 0x23, 0x85, 0x27, 0x85, 0x28, 0x85, 0x29, 0xA2,
0x02, 0x95, 0x2A, 0x95, 0x2D, 0xCA, 0xD0, 0xF9, 0xA9, 0x07, 0x8D, 0x00, 0xC0, 0xA9, 0x38, 0x85,
0xFF, 0x85, 0x25, 0xA9, 0x00, 0x85, 0x24, 0x85, 0x23, 0x85, 0x27, 0x85, 0x28, 0x85, 0x29, 0x85,
0x2D, 0xA2, 0x03, 0xCA, 0x95, 0x2A, 0xD0, 0xFB, 0xA9, 0x07, 0x8D, 0x00, 0xC0, 0xA9, 0x38, 0x85,
0x26, 0x8D, 0x00, 0xE0, 0x60, 0xAD, 0x15, 0x02, 0xD0, 0x17, 0xA2, 0x08, 0x8E, 0x00, 0xC0, 0x8D,
0x00, 0xE0, 0xE8, 0x8E, 0x00, 0xC0, 0x8D, 0x00, 0xE0, 0xE8, 0x8E, 0x00, 0xC0, 0x8D, 0x00, 0xE0,
0x60, 0xA2, 0x00, 0x86, 0x26, 0xA2, 0x02, 0x06, 0x26, 0xBD, 0xDD, 0x02, 0x30, 0x02, 0xE6, 0x26,
Expand Down

0 comments on commit 1546870

Please sign in to comment.