Commit d41cfc3

Nick committed on
WIP fixing tone portamento bug??
commit d41cfc3f8b4068b4d3bde1db69340968641f5440 parent f012e10
1 changed files +41−42
Modifieddriver.z80 +41−42
@@ -837,7 +837,7 @@ fx_toneporta:
837 jp nz, .do_toneporta 837 jp nz, .do_toneporta
838 838
839 ;; We're on tick zero, so just move the temp note value into the toneporta target. 839 ;; We're on tick zero, so just move the temp note value into the toneporta target.
840 ld d, 3 840 ld d, 4
841 call setup_channel_pointer 841 call setup_channel_pointer
842 842
843 ;; If the note is nonexistent, then just return 843 ;; If the note is nonexistent, then just return
@@ -845,12 +845,11 @@ fx_toneporta:
845 cp LAST_NOTE 845 cp LAST_NOTE
846 ret nc 846 ret nc
847 847
848 ld a, [temp_note_value]
849 ld c, a
850 ld a, [temp_note_value+1] 848 ld a, [temp_note_value+1]
851 ld e, a 849 ld c, a
850 ld a, [temp_note_value]
852 851
853 ld [hl+], a 852 ld [hl-], a
854 ld [hl], c 853 ld [hl], c
855 854
856 ;; Don't call _playnote. This is done by grabbing the return 855 ;; Don't call _playnote. This is done by grabbing the return
@@ -985,49 +984,49 @@ _dosound:
985 call _playnote1 ; 3 bytes 984 call _playnote1 ; 3 bytes
986 985
987 .after_note1: 986 .after_note1:
988 loadShort pattern2, b, c 987 ; loadShort pattern2, b, c
989 call _lookup_note 988 ; call _lookup_note
990 jr nc, .after_note2 989 ; jr nc, .after_note2
991 990
992 ld a, h 991 ; ld a, h
993 ld [temp_note_value], a 992 ; ld [temp_note_value], a
994 ld a, l 993 ; ld a, l
995 ld [temp_note_value+1], a 994 ; ld [temp_note_value+1], a
996 995
997 ld e, 1 996 ; ld e, 1
998 call _doeffect 997 ; call _doeffect
999 998
1000 call _playnote2 999 ; call _playnote2
1001 1000
1002 .after_note2: 1001 .after_note2:
1003 loadShort pattern3, b, c 1002 ; loadShort pattern3, b, c
1004 call _lookup_note 1003 ; call _lookup_note
1005 jr nc, .after_note3 1004 ; jr nc, .after_note3
1006 1005
1007 ld a, h 1006 ; ld a, h
1008 ld [temp_note_value], a 1007 ; ld [temp_note_value], a
1009 ld a, l 1008 ; ld a, l
1010 ld [temp_note_value+1], a 1009 ; ld [temp_note_value+1], a
1011 1010
1012 ld e, 2 1011 ; ld e, 2
1013 call _doeffect 1012 ; call _doeffect
1014 1013
1015 call _playnote3 1014 ; call _playnote3
1016 1015
1017 .after_note3: 1016 .after_note3:
1018 loadShort pattern4, b, c 1017 ; loadShort pattern4, b, c
1019 call _lookup_note 1018 ; call _lookup_note
1020 jr nc, process_tick 1019 ; jr nc, process_tick
1021 1020
1022 ld a, h 1021 ; ld a, h
1023 ld [temp_note_value], a 1022 ; ld [temp_note_value], a
1024 ld a, l 1023 ; ld a, l
1025 ld [temp_note_value+1], a 1024 ; ld [temp_note_value+1], a
1026 1025
1027 ld e, 3 1026 ; ld e, 3
1028 call _doeffect 1027 ; call _doeffect
1029 1028
1030 call _playnote4 1029 ; call _playnote4
1031 1030
1032 jp process_tick 1031 jp process_tick
1033 1032
@@ -1045,15 +1044,15 @@ _dosound:
1045 call _doeffect 1044 call _doeffect
1046 1045
1047 .after_effect1: 1046 .after_effect1:
1048 loadShort pattern2, b, c 1047 ; loadShort pattern2, b, c
1049 call _lookup_note 1048 ; call _lookup_note
1050 1049
1051 ld a, c 1050 ; ld a, c
1052 cp 0 1051 ; cp 0
1053 jr z, .after_effect2 1052 ; jr z, .after_effect2
1054 1053
1055 ld e, 1 1054 ; ld e, 1
1056 call _doeffect 1055 ; call _doeffect
1057 1056
1058 .after_effect2: 1057 .after_effect2:
1059 ; loadShort pattern3, b, c 1058 ; loadShort pattern3, b, c