1
+ // This file is part of Adlib Tracker II (AT2).
2
+ //
3
+ // AT2 is free software: you can redistribute it and/or modify
4
+ // it under the terms of the GNU General Public License as published by
5
+ // the Free Software Foundation, either version 3 of the License, or
6
+ // (at your option) any later version.
7
+ //
8
+ // AT2 is distributed in the hope that it will be useful,
9
+ // but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
+ // GNU General Public License for more details.
12
+ //
13
+ // You should have received a copy of the GNU General Public License
14
+ // along with AT2. If not, see <http://www.gnu.org/licenses/>.
15
+
1
16
unit AdT2ext2;
2
17
{ $S-,Q-,R-,V-,B-,X+}
3
18
{ $PACKRECORDS 1}
@@ -60,6 +75,7 @@ implementation
60
75
{ $ELSE}
61
76
SDL_Timer,
62
77
{ $ENDIF}
78
+ StrUtils,
63
79
AdT2opl3,AdT2unit,AdT2sys,AdT2extn,AdT2ext4,AdT2ext5,AdT2text,AdT2pack,AdT2keyb,
64
80
TxtScrIO,StringIO,DialogIO,ParserIO;
65
81
@@ -371,6 +387,42 @@ procedure process_global_keys;
371
387
end ;
372
388
end ;
373
389
390
+ If ctrl_pressed and NOT alt_pressed and NOT scankey(SC_TAB) and
391
+ (scankey(SC_UP) or scankey(SC_DOWN)) then
392
+ begin
393
+ If scankey(SC_UP) and scankey(SC_DOWN) then
394
+ begin
395
+ _IRQ_freq_shift_reset_flag := TRUE;
396
+ If NOT shift_pressed then
397
+ IRQ_freq_shift := songdata.bpm_data.tempo_finetune
398
+ else IRQ_freq_shift := 0
399
+ end
400
+ else If scankey(SC_UP) and NOT scankey(SC_DOWN) and
401
+ (SUCC(IRQ_freq+IRQ_freq_shift+playback_speed_shift) <= MAX_IRQ_FREQ) then
402
+ If (NOT shift_pressed or (shift_pressed and NOT (_IRQFREQ_blink_flag and (_IRQFREQ_blink_ticks < 5 )))) and
403
+ NOT (_IRQ_freq_shift_reset_flag and _IRQFREQ_blink_flag and (_IRQFREQ_blink_ticks < 5 )) then
404
+ begin
405
+ Inc(IRQ_freq_shift);
406
+ _IRQ_freq_shift_reset_flag := FALSE;
407
+ end
408
+ else
409
+ else If NOT scankey(SC_UP) and scankey(SC_DOWN) and
410
+ (PRED(IRQ_freq+IRQ_freq_shift+playback_speed_shift) >= MIN_IRQ_FREQ) then
411
+ If (NOT shift_pressed or (shift_pressed and NOT (_IRQFREQ_blink_flag and (_IRQFREQ_blink_ticks < 5 )))) and
412
+ NOT (_IRQ_freq_shift_reset_flag and _IRQFREQ_blink_flag and (_IRQFREQ_blink_ticks < 5 )) then
413
+ begin
414
+ Dec(IRQ_freq_shift);
415
+ _IRQ_freq_shift_reset_flag := FALSE;
416
+ end ;
417
+ If (songdata.bpm_data.tempo_finetune <> IRQ_freq_shift) then
418
+ module_archived := FALSE;
419
+ _IRQFREQ_update_event := TRUE;
420
+ _IRQFREQ_blink_flag := TRUE;
421
+ _IRQFREQ_blink_ticks := 0 ;
422
+ TimerSetup(IRQ_freq+IRQ_freq_shift+playback_speed_shift);
423
+ keyboard_reset_buffer;
424
+ end ;
425
+
374
426
{ $IFNDEF GO32V2}
375
427
376
428
If scankey(SC_F11) and
@@ -510,6 +562,7 @@ procedure PROGRAM_SCREEN_init;
510
562
ShowCStr(screen_ptr,03 ,04 ,' ~ROW ~' ,
511
563
status_background+status_dynamic_txt,
512
564
status_background+status_static_txt);
565
+
513
566
ShowCStr(screen_ptr,03 ,05 ,' ~SPEED/TEMPO ~ /' ,
514
567
status_background+status_dynamic_txt,
515
568
status_background+status_static_txt);
@@ -559,7 +612,8 @@ function check_number(str: String; base: Byte; limit1,limit2: Longint; default:
559
612
temp2 := temp2 DIV 10 ;
560
613
end ;
561
614
562
- If SameName(str+' =' +ExpStrL(' ' ,temp,' ?' ),data) and (Length(data) < Length(str)+temp+2 ) then
615
+ If IsWild(data,str+' =*' ,FALSE) and
616
+ (Length(data) >= Length(str)+2 ) and (Length(data) < Length(str)+temp+2 ) then
563
617
begin
564
618
result := Str2num(Copy(data,Length(str)+2 ,temp),base);
565
619
If (result >= limit1) and (result <= limit2) then
@@ -594,7 +648,8 @@ function validate_number(var num: Longint; str: String; base: Byte; limit1,limit
594
648
temp2 := temp2 DIV 10 ;
595
649
end ;
596
650
597
- If SameName(str+' =' +ExpStrL(' ' ,temp,' ?' ),data) and (Length(data) < Length(str)+temp+2 ) then
651
+ If IsWild(data,str+' =*' ,FALSE) and
652
+ (Length(data) >= Length(str)+2 ) and (Length(data) < Length(str)+temp+2 ) then
598
653
begin
599
654
num := Str2num(Copy(data,Length(str)+2 ,temp),base);
600
655
If (num >= limit1) and (num <= limit2) then
@@ -616,7 +671,7 @@ function check_range(str: String; base: Byte; range: tRANGE; default: Byte): Byt
616
671
617
672
begin
618
673
result := default;
619
- If SameName( str+' =' +ExpStrL(' ' ,3 ,' ?' ),data ) and
674
+ If IsWild(data, str+' =' +ExpStrL(' ' ,3 ,' ?' ),FALSE ) and
620
675
(Length(data) < Length(str)+5 ) then
621
676
If (Str2num(Copy(data,Length(str)+2 ,3 ),base) in range) then
622
677
result := Str2num(Copy(data,Length(str)+2 ,3 ),base);
@@ -634,7 +689,7 @@ function check_boolean(str: String; default: Boolean): Boolean;
634
689
_debug_str_ := ' ADT2EXT2.PAS:process_config_file:check_boolean' ;
635
690
{ $ENDIF}
636
691
result := default;
637
- If SameName( str+' =???' ,data ) and
692
+ If IsWild(data, str+' =???' ,FALSE ) and
638
693
(Length(data) < Length(str)+5 ) then
639
694
begin
640
695
If (Copy(data,Length(str)+2 ,3 ) = ' on' ) then result := TRUE;
@@ -653,7 +708,7 @@ procedure check_rgb(str: String; var default: tRGB);
653
708
_last_debug_str_ := _debug_str_;
654
709
_debug_str_ := ' ADT2EXT2.PAS:process_config_file:check_rgb' ;
655
710
{ $ENDIF}
656
- If SameName( str+' =??,??,??' ,data ) and
711
+ If IsWild(data, str+' =??,??,??' ,FALSE ) and
657
712
(Length(data) < Length(str)+10 ) then
658
713
begin
659
714
result.r := Str2num(Copy(data,Length(str)+2 ,2 ),10 );
@@ -888,6 +943,9 @@ procedure check_option_data;
888
943
linefeed :=
889
944
check_boolean(' linefeed' ,linefeed);
890
945
946
+ lf_in_mboard_mode :=
947
+ check_boolean(' lf_in_mboard_mode' ,lf_in_mboard_mode);
948
+
891
949
update_ins :=
892
950
check_boolean(' update_ins' ,update_ins);
893
951
@@ -1182,6 +1240,9 @@ procedure check_option_data;
1182
1240
debug_info_perc :=
1183
1241
check_number(' debug_info_perc' ,10 ,0 ,15 ,debug_info_perc);
1184
1242
1243
+ debug_info_bpm :=
1244
+ check_number(' debug_info_bpm' ,10 ,0 ,15 ,debug_info_bpm);
1245
+
1185
1246
help_background :=
1186
1247
check_number(' help_background' ,10 ,0 ,15 ,help_background SHR 4 ) SHL 4 ;
1187
1248
@@ -1281,6 +1342,9 @@ procedure check_option_data;
1281
1342
dialog_car_text :=
1282
1343
check_number(' dialog_car_text' ,10 ,0 ,15 ,dialog_car_text);
1283
1344
1345
+ dialog_misc_indic :=
1346
+ check_number(' dialog_misc_indic' ,10 ,0 ,15 ,dialog_misc_indic);
1347
+
1284
1348
macro_background :=
1285
1349
check_number(' macro_background' ,10 ,0 ,15 ,macro_background SHR 4 ) SHL 4 ;
1286
1350
0 commit comments