Commit d707e50

Nick committed on
Implemented Fxx, Dxx, Bxx
commit d707e50c5c055a7276deeb4e6ef254e6fa2ad7a9 parent a594394
4 changed files +101−46
ModifiedGBEmu.lpi +11−10
@@ -1,7 +1,7 @@
1 <?xml version="1.0" encoding="UTF-8"?> 1 <?xml version="1.0" encoding="UTF-8"?>
2 <CONFIG> 2 <CONFIG>
3 <ProjectOptions> 3 <ProjectOptions>
4 <Version Value="10"/> 4 <Version Value="11"/>
5 <PathDelim Value="\"/> 5 <PathDelim Value="\"/>
6 <General> 6 <General>
7 <Flags> 7 <Flags>
@@ -25,9 +25,16 @@
25 </PublishOptions> 25 </PublishOptions>
26 <RunParams> 26 <RunParams>
27 <local> 27 <local>
28 <FormatVersion Value="1"/>
29 <CommandLineParams Value="C:\Projects\GB-Stuff\uge\driver.gb"/> 28 <CommandLineParams Value="C:\Projects\GB-Stuff\uge\driver.gb"/>
30 </local> 29 </local>
30 <FormatVersion Value="2"/>
31 <Modes Count="1">
32 <Mode0 Name="default">
33 <local>
34 <CommandLineParams Value="C:\Projects\GB-Stuff\uge\driver.gb"/>
35 </local>
36 </Mode0>
37 </Modes>
31 </RunParams> 38 </RunParams>
32 <RequiredPackages Count="2"> 39 <RequiredPackages Count="2">
33 <Item1> 40 <Item1>
@@ -104,15 +111,9 @@
104 </SyntaxOptions> 111 </SyntaxOptions>
105 </Parsing> 112 </Parsing>
106 <CodeGeneration> 113 <CodeGeneration>
107 <Optimizations> 114 <TargetCPU Value="i386"/>
108 <OptimizationLevel Value="0"/> 115 <TargetOS Value="win32"/>
109 </Optimizations>
110 </CodeGeneration> 116 </CodeGeneration>
111 <Linking>
112 <Debugging>
113 <DebugInfoType Value="dsDwarf2Set"/>
114 </Debugging>
115 </Linking>
116 <Other> 117 <Other>
117 <CustomOptions Value="-dBorland -dVer150 -dDelphi7 -dCompiler6_Up -dPUREPASCAL"/> 118 <CustomOptions Value="-dBorland -dVer150 -dDelphi7 -dCompiler6_Up -dPUREPASCAL"/>
118 </Other> 119 </Other>
Modifieddriver.z80 +74−20
@@ -36,7 +36,7 @@ STACK_SIZE EQU 20
36 ;; Stack starts at $FFFE 36 ;; Stack starts at $FFFE
37 37
38 PATTERN_LENGTH EQU 64 38 PATTERN_LENGTH EQU 64
39 TICKS EQU 4 39 ; TICKS EQU 4
40 40
41 ; $0000 - $003F: RST handlers. 41 ; $0000 - $003F: RST handlers.
42 42
@@ -121,14 +121,14 @@ DB "NF"
121 121
122 SECTION "Song Data", ROM0 122 SECTION "Song Data", ROM0
123 ;; order_cnt is the number of orders times 2 123 ;; order_cnt is the number of orders times 2
124 order_cnt: db 2 124 order_cnt: db 6
125 order1: dw tfau_bass ;; unreal ;; unreal;, lunawaves, lunawaves, unreal 125 order1: dw tfau_bass, unreal, unreal ;; unreal ;; unreal;, lunawaves, lunawaves, unreal
126 order2: dw tfau_arps ;; empty, unreal, unreal, lunawaves 126 order2: dw tfau_arps, unreal_arps, unreal_arps ;; empty, unreal, unreal, lunawaves
127 order3: dw empty 127 order3: dw empty
128 order4: dw empty 128 order4: dw empty
129 129
130 ; lunawaves: 130 lunawaves:
131 ; include "lunawaves.inc" 131 include "lunawaves.inc"
132 unreal: 132 unreal:
133 include "unreal.inc" 133 include "unreal.inc"
134 unreal_arps: 134 unreal_arps:
@@ -188,6 +188,7 @@ pattern2: dw
188 pattern3: dw 188 pattern3: dw
189 pattern4: dw 189 pattern4: dw
190 190
191 ticks_per_row: db
191 current_order: dw 192 current_order: dw
192 193
193 ;; TODO: Find some way to get rid of this thing. 194 ;; TODO: Find some way to get rid of this thing.
@@ -304,6 +305,10 @@ _addr = _addr + 1
304 ld a, %11110000 305 ld a, %11110000
305 ld [envelope2], a 306 ld [envelope2], a
306 307
308 ;; Load starting speed (7 ticks per row)
309 ld a, 4
310 ld [ticks_per_row], a
311
307 ; Enable sound globally 312 ; Enable sound globally
308 ld a, $80 313 ld a, $80
309 ldh [rAUDENA], a 314 ldh [rAUDENA], a
@@ -571,11 +576,11 @@ _doeffect:
571 jp fx_no_op ;fx_set_pan ;8xy 576 jp fx_no_op ;fx_set_pan ;8xy
572 jp fx_no_op ;fx_set_duty ;9xy 577 jp fx_no_op ;fx_set_duty ;9xy
573 jp fx_no_op ;fx_vol_slide ;Axy 578 jp fx_no_op ;fx_vol_slide ;Axy
574 jp fx_no_op ;fx_pos_jump ;Bxy 579 jp fx_pos_jump ;Bxy
575 jp fx_set_volume ;Cxy 580 jp fx_set_volume ;Cxy
576 jp fx_no_op ;fx_pattern_break ;Dxy 581 jp fx_pattern_break ;Dxy
577 jp fx_note_cut ;Exy 582 jp fx_note_cut ;Exy
578 jp fx_no_op ;fx_set_speed ;Fxy 583 jp fx_set_speed ;Fxy
579 584
580 setup_channel_pointer: 585 setup_channel_pointer:
581 ;; Call with: 586 ;; Call with:
@@ -599,6 +604,55 @@ ENDM
599 fx_no_op: 604 fx_no_op:
600 ret 605 ret
601 606
607 fx_set_speed:
608 ret nz
609
610 ;; B: channel
611 ;; C: effect parameters
612
613 ;; free registers: A, D, E, H, L
614 ld a, c
615 ld [ticks_per_row], a
616 ret
617
618 fx_pos_jump:
619 ;; B: channel
620 ;; C: effect parameters
621
622 ;; free registers: A, D, E, H, L
623
624 pop hl ;; remove return address
625 pop hl ;; remove the AF pushed
626
627 ;; when we return from here, it will be as if we returned from the main
628 ;; _dosound function
629
630 ld a, c
631 add a ;; double it, as orders are words
632
633 jp _update_current_order
634
635 fx_pattern_break:
636 ;; B: channel
637 ;; C: effect parameters
638
639 ;; free registers: A, D, E, H, L
640
641 pop hl ;; remove return address
642 pop hl ;; remove the AF pushed
643
644 ;; when we return from here, it will be as if we returned from the main
645 ;; _dosound function
646
647 ld b, c
648
649 call _neworder
650
651 ld a, b
652 ld [row], a
653
654 reti
655
602 ;; TODO: Fix this 656 ;; TODO: Fix this
603 fx_note_cut: 657 fx_note_cut:
604 ;; B: channel 658 ;; B: channel
@@ -1050,10 +1104,13 @@ _dosound:
1050 .after_effect4: 1104 .after_effect4:
1051 1105
1052 process_tick: 1106 process_tick:
1107 ld a, [ticks_per_row]
1108 ld b, a
1109
1053 ld a, [tick] 1110 ld a, [tick]
1054 inc a 1111 inc a
1055 1112
1056 cp TICKS 1113 cp b
1057 jp z, _newrow 1114 jp z, _newrow
1058 1115
1059 ld [tick], a 1116 ld [tick], a
@@ -1068,29 +1125,26 @@ _newrow:
1068 ld a, [row] 1125 ld a, [row]
1069 inc a 1126 inc a
1070 cp PATTERN_LENGTH 1127 cp PATTERN_LENGTH
1071 jr nz, .noreset 1128 jr nz, _noreset
1072 1129 _neworder:
1073 ;; Increment order and change loaded patterns 1130 ;; Increment order and change loaded patterns
1074 ld a, [order_cnt] 1131 ld a, [order_cnt]
1075 ld b, a 1132 ld c, a
1076 ld a, [current_order] 1133 ld a, [current_order]
1077 add a, 2 1134 add a, 2
1078 cp b 1135 cp c
1079 jr nz, .update_current_order 1136 jr nz, _update_current_order
1080 xor a ; ld a, 0 1137 xor a ; ld a, 0
1081 .update_current_order: 1138 _update_current_order:
1082 ld [current_order], a 1139 ld [current_order], a
1083 ld c, a 1140 ld c, a
1084 1141
1085 call _refresh_patterns 1142 call _refresh_patterns
1086 1143
1087 xor a ; ld a, 0 1144 xor a ; ld a, 0
1088 ld [row], a
1089 reti
1090 1145
1091 .noreset: 1146 _noreset:
1092 ld [row], a 1147 ld [row], a
1093
1094 reti 1148 reti
1095 1149
1096 _halt: 1150 _halt:
Modifiedtfau_bass.inc +15−15
@@ -1,31 +1,31 @@
1 dn E3, 0, 0 1 dn E3, 0, $F04
2 dn 90, 0, 0 2 dn 90, 0, 0
3 dn 90, 0, 0 3 dn 90, 0, 0
4 dn 90, 0, 0 4 dn 90, 0, 0
5 dn 90, 0, 0 5 dn 90, 0, 0
6 dn 90, 0, $C20 6 dn E3, 0, $C20
7 dn E4, 0, 0 7 dn E4, 0, 0
8 dn 90, 0, $C20 8 dn E4, 0, $C20
9 dn 90, 0, 0 9 dn 90, 0, 0
10 dn 90, 0, 0 10 dn 90, 0, 0
11 dn 90, 0, 0 11 dn 90, 0, 0
12 dn 90, 0, 0 12 dn 90, 0, 0
13 dn A3, 0, 0 13 dn A3, 0, 0
14 dn 90, 0, $C20 14 dn A3, 0, $C20
15 dn 90, 0, $C05 15 dn A3, 0, $C05
16 dn 90, 0, $C00 16 dn A3, 0, $C00
17 dn A#3, 0, 0 17 dn A#3, 0, 0
18 dn B3, 0, $30A 18 dn B3, 0, $30A
19 dn 90, 0, $30A 19 dn 90, 0, $30A
20 dn 90, 0, 0 20 dn 90, 0, 0
21 dn 90, 0, 0 21 dn 90, 0, 0
22 dn 90, 0, $C20 22 dn B3, 0, $C20
23 dn D4, 0, 0 23 dn D4, 0, 0
24 dn 90, 0, $C20 24 dn D4, 0, $C20
25 dn 90, 0, 0 25 dn 90, 0, 0
26 dn 90, 0, 0 26 dn 90, 0, 0
27 dn D4, 0, 0 27 dn D4, 0, 0
28 dn 90, 0, $C20 28 dn D4, 0, $C20
29 dn F#3, 0, $C80 29 dn F#3, 0, $C80
30 dn 90, 0, 0 30 dn 90, 0, 0
31 dn 90, 0, 0 31 dn 90, 0, 0
@@ -35,29 +35,29 @@
35 dn 90, 0, 0 35 dn 90, 0, 0
36 dn 90, 0, 0 36 dn 90, 0, 0
37 dn 90, 0, 0 37 dn 90, 0, 0
38 dn 90, 0, $C20 38 dn F#3, 0, $C20
39 dn G4, 0, 0 39 dn G4, 0, 0
40 dn 90, 0, $C20 40 dn G4, 0, $C20
41 dn 90, 0, 0 41 dn 90, 0, 0
42 dn 90, 0, 0 42 dn 90, 0, 0
43 dn 90, 0, 0 43 dn 90, 0, 0
44 dn 90, 0, 0 44 dn 90, 0, 0
45 dn A3, 0, 0 45 dn A3, 0, 0
46 dn 90, 0, $C20 46 dn A3, 0, $C20
47 dn A#3, 0, $C80 47 dn A#3, 0, $C80
48 dn 90, 0, $C20 48 dn A#3, 0, $C20
49 dn A#3, 0, $101 49 dn A#3, 0, $101
50 dn B3, 0, $30A 50 dn B3, 0, $30A
51 dn 90, 0, $30A 51 dn 90, 0, $30A
52 dn 90, 0, 0 52 dn 90, 0, 0
53 dn D4, 0, 0 53 dn D4, 0, 0
54 dn 90, 0, $C20 54 dn D4, 0, $C20
55 dn 90, 0, 0 55 dn 90, 0, 0
56 dn 90, 0, 0 56 dn 90, 0, 0
57 dn 90, 0, 0 57 dn 90, 0, 0
58 dn 90, 0, 0 58 dn 90, 0, 0
59 dn A3, 0, 0 59 dn A3, 0, 0
60 dn 90, 0, $C20 60 dn A3, 0, $C20
61 dn B3, 0, 0 61 dn B3, 0, 0
62 dn 90, 0, 0 62 dn 90, 0, 0
63 dn 90, 0, 0 63 dn 90, 0, 0
Modifiedunreal.inc +1−1
@@ -4,7 +4,7 @@ dn: MACRO ;; (note, instr, effect)
4 db LOW(\3) 4 db LOW(\3)
5 ENDM 5 ENDM
6 6
7 dn F5, 11, $000 7 dn F5, 11, $F07
8 dn G#5, 00, $316 8 dn G#5, 00, $316
9 dn C6, 00, $316 9 dn C6, 00, $316
10 dn F6, 00, $316 10 dn F6, 00, $316