Skip to content

Commit 95e1af4

Browse files
committed
Optimized sequence and fx bus saving, oscilloscope
1 parent f9e4bed commit 95e1af4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+807
-411
lines changed

Makefile

+15-15
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ objs.$(CFG)/$(2)%.o: src/$(1)%$(EXT) src/version.h src/version_number.h
104104
deps/$(CFG)_$(2)%.d: src/$(1)%$(EXT) src/version.h src/version_number.h
105105
$(Q)mkdir -p deps
106106
$(MSG) "Generating dependencies for $$(notdir $$<)..."
107-
$(Q)set -e ; $(CDEP) $(INCLUDEFLAGS) $$< > $$@.$$$$$$$$; \
107+
$(Q)set -e; $(CDEP) $(INCLUDEFLAGS) $$< > $$@.$$$$$$$$; \
108108
sed 's,\($$*\)\.o[ :]*,objs.$(CFG)\/$(2)\1.o $$@ : ,g' \
109109
< $$@.$$$$$$$$ > $$@; \
110110
rm -f $$@.$$$$$$$$
@@ -118,17 +118,17 @@ res/$(1): themes/$(1)/* #themes/$(1)/font/* themes/$(1)/font7x6/* themes/$(1)/ti
118118
@$(ECHO) "Building theme $(1)..."
119119
$(Q)mkdir -p res
120120
$(Q)mkdir -p themetemp.$(1)
121-
-$(Q)if test -e themes/$(1)/colors.txt; then cp -f themes/$(1)/colors.txt themetemp.$(1) ; fi
122-
-$(Q)if test -e themes/$(1)/bevel.*; then cp -f themes/$(1)/bevel.* themetemp.$(1) ; fi
123-
-$(Q)if test -e themes/$(1)/vu.*; then cp -f themes/$(1)/vu.* themetemp.$(1) ; fi
124-
-$(Q)if test -e themes/$(1)/analyzor.*; then cp -f themes/$(1)/analyzor.* themetemp.$(1) ; fi
125-
-$(Q)if test -e themes/$(1)/logo.*; then cp -f themes/$(1)/logo.* themetemp ; fi
126-
-$(Q)if test -e themes/$(1)/catometer.*; then cp -f themes/$(1)/catometer.* themetemp.$(1) ; fi
127-
-$(Q)if test -e themes/$(1)/cursor.*; then cp -f themes/$(1)/cursor.* themetemp.$(1) ; fi
128-
-$(Q)if test -e themes/$(1)/icon.*; then cp -f themes/$(1)/icon.* themetemp.$(1) ; fi
129-
-$(Q)if test -d themes/$(1)/font; then $(MAKEBUNDLE) themetemp.$(1)/8x8.fnt themes/$(1)/font ; fi
130-
-$(Q)if test -d themes/$(1)/font7x6; then $(MAKEBUNDLE) themetemp.$(1)/7x6.fnt themes/$(1)/font7x6 ; fi
131-
-$(Q)if test -d themes/$(1)/tiny; then $(MAKEBUNDLE) themetemp.$(1)/4x6.fnt themes/$(1)/tiny ; fi
121+
-$(Q)if test -e themes/$(1)/colors.txt; then cp -f themes/$(1)/colors.txt themetemp.$(1); fi
122+
-$(Q)if test -e themes/$(1)/bevel.*; then cp -f themes/$(1)/bevel.* themetemp.$(1); fi
123+
-$(Q)if test -e themes/$(1)/vu.*; then cp -f themes/$(1)/vu.* themetemp.$(1); fi
124+
-$(Q)if test -e themes/$(1)/analyzor.*; then cp -f themes/$(1)/analyzor.* themetemp.$(1); fi
125+
-$(Q)if test -e themes/$(1)/logo.*; then cp -f themes/$(1)/logo.* themetemp; fi
126+
-$(Q)if test -e themes/$(1)/catometer.*; then cp -f themes/$(1)/catometer.* themetemp.$(1); fi
127+
-$(Q)if test -e themes/$(1)/cursor.*; then cp -f themes/$(1)/cursor.* themetemp.$(1); fi
128+
-$(Q)if test -e themes/$(1)/icon.*; then cp -f themes/$(1)/icon.* themetemp.$(1); fi
129+
-$(Q)if test -d themes/$(1)/font; then $(MAKEBUNDLE) themetemp.$(1)/8x8.fnt themes/$(1)/font; fi
130+
-$(Q)if test -d themes/$(1)/font7x6; then $(MAKEBUNDLE) themetemp.$(1)/7x6.fnt themes/$(1)/font7x6; fi
131+
-$(Q)if test -d themes/$(1)/tiny; then $(MAKEBUNDLE) themetemp.$(1)/4x6.fnt themes/$(1)/tiny; fi
132132
$(Q)-$(MAKEBUNDLE) $$@ themetemp.$(1)
133133
$(Q)rm -rf themetemp.$(1)
134134

@@ -197,7 +197,7 @@ ifdef COMSPEC
197197
$(Q)cp -f zip/klystrack.zip zip/klystrack-`cat src/version | tr -d '\r\n'`-win32.zip
198198
else
199199
-$(Q)rm -f zip/data/Makefile
200-
cd zip; cp -r data klystrack-`cat ../src/version | tr -d '\r\n'` ; rm -f $(ARCHIVE); $(ZIP) klystrack-`cat ../src/version`.tar.gz klystrack-`cat ../src/version` ; rm -rf klystrack-`cat ../src/version`
200+
cd zip; cp -r data klystrack-`cat ../src/version | tr -d '\r\n'`; rm -f $(ARCHIVE); $(ZIP) klystrack-`cat ../src/version`.tar.gz klystrack-`cat ../src/version`; rm -rf klystrack-`cat ../src/version`
201201
endif
202202

203203
installer: zip installer/klystrack.nsi
@@ -241,7 +241,7 @@ endif
241241
zip/data/SDL2_image.dll:
242242
@$(ECHO) "Downloading "$@"..."
243243
$(Q)mkdir -p temp
244-
$(Q)cd temp ; $(CURL) -O http://www.libsdl.org/projects/SDL_image/release/SDL2_image-$(SDL_IMAGEVER)-win32-x86.zip ; $(ZIPEXT) SDL2_image-$(SDL_IMAGEVER)-win32-x86.zip SDL2_image.dll libpng16-16.dll zlib1.dll ; rm SDL2_image-$(SDL_IMAGEVER)-win32-x86.zip
244+
$(Q)cd temp; $(CURL) -O http://www.libsdl.org/projects/SDL_image/release/SDL2_image-$(SDL_IMAGEVER)-win32-x86.zip; $(ZIPEXT) SDL2_image-$(SDL_IMAGEVER)-win32-x86.zip SDL2_image.dll libpng16-16.dll zlib1.dll; rm SDL2_image-$(SDL_IMAGEVER)-win32-x86.zip
245245
$(Q)mkdir -p zip/data
246246
$(Q)mv temp/SDL2_image.dll zip/data/SDL2_image.dll
247247
$(Q)mv temp/libpng16-16.dll zip/data/libpng16-16.dll
@@ -250,7 +250,7 @@ zip/data/SDL2_image.dll:
250250
zip/data/SDL2.dll:
251251
@$(ECHO) "Downloading "$@"..."
252252
$(Q)mkdir -p temp
253-
$(Q)cd temp ; $(CURL) -O https://www.libsdl.org/release/SDL2-$(SDL_VER)-win32-x86.zip ; $(ZIPEXT) SDL2-$(SDL_VER)-win32-x86.zip SDL2.dll ; rm SDL2-$(SDL_VER)-win32-x86.zip
253+
$(Q)cd temp; $(CURL) -O https://www.libsdl.org/release/SDL2-$(SDL_VER)-win32-x86.zip; $(ZIPEXT) SDL2-$(SDL_VER)-win32-x86.zip SDL2.dll; rm SDL2-$(SDL_VER)-win32-x86.zip
254254
$(Q)mkdir -p zip/data
255255
$(Q)mv temp/SDL2.dll zip/data/SDL2.dll
256256

OSX_Xcode/OSX_Xcode.xcodeproj/project.pbxproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@
777777
);
778778
runOnlyForDeploymentPostprocessing = 0;
779779
shellPath = /bin/sh;
780-
shellScript = "THEMES=\"AHX Blacklyst C64 Classic Default Gameboy Golden_Brown\"\nTHEMEDIR=$SRCROOT/../themes\nMAKEBUNDLE=$BUILT_PRODUCTS_DIR/make_bundle\n\nfunction cpie {\n if [ -f $1 ]; then\n cp -f $1 $2\n fi\n}\n\nfor theme in $THEMES; do\necho \"Building theme $theme...\"\nmkdir -p res\nmkdir -p themetemp\ncpie $THEMEDIR/$theme/colors.txt themetemp\ncpie $THEMEDIR/$theme/bevel.* themetemp\ncpie $THEMEDIR/$theme/vu.* themetemp\ncpie $THEMEDIR/$theme/analyzor.* themetemp\ncpie $THEMEDIR/$theme/logo.* themetemp\ncpie $THEMEDIR/$theme/catometer.* themetemp\nif test -d $THEMEDIR/$theme/font; then $MAKEBUNDLE themetemp/8x8.fnt $THEMEDIR/$theme/font ; fi\nif test -d $THEMEDIR/$theme/font7x6; then $MAKEBUNDLE themetemp/7x6.fnt $THEMEDIR/$theme/font7x6 ; fi\nif test -d $THEMEDIR/$theme/tiny; then $MAKEBUNDLE themetemp/4x6.fnt $THEMEDIR/$theme/tiny ; fi\n$MAKEBUNDLE res/$theme themetemp\nrm -rf themetemp\ndone";
780+
shellScript = "THEMES=\"AHX Blacklyst C64 Classic Default Gameboy Golden_Brown\"\nTHEMEDIR=$SRCROOT/../themes\nMAKEBUNDLE=$BUILT_PRODUCTS_DIR/make_bundle\n\nfunction cpie {\n if [ -f $1 ]; then\n cp -f $1 $2\n fi\n}\n\nfor theme in $THEMES; do\necho \"Building theme $theme...\"\nmkdir -p res\nmkdir -p themetemp\ncpie $THEMEDIR/$theme/colors.txt themetemp\ncpie $THEMEDIR/$theme/bevel.* themetemp\ncpie $THEMEDIR/$theme/vu.* themetemp\ncpie $THEMEDIR/$theme/analyzor.* themetemp\ncpie $THEMEDIR/$theme/logo.* themetemp\ncpie $THEMEDIR/$theme/catometer.* themetemp\nif test -d $THEMEDIR/$theme/font; then $MAKEBUNDLE themetemp/8x8.fnt $THEMEDIR/$theme/font; fi\nif test -d $THEMEDIR/$theme/font7x6; then $MAKEBUNDLE themetemp/7x6.fnt $THEMEDIR/$theme/font7x6; fi\nif test -d $THEMEDIR/$theme/tiny; then $MAKEBUNDLE themetemp/4x6.fnt $THEMEDIR/$theme/tiny; fi\n$MAKEBUNDLE res/$theme themetemp\nrm -rf themetemp\ndone";
781781
};
782782
8378C7E119A0F46A00AFBD43 /* Fix frameworks */ = {
783783
isa = PBXShellScriptBuildPhase;

doc/inst_editor.png

-2 Bytes
Loading

examples/songs/StarChips.kt

-1 Bytes
Binary file not shown.

icon/256x256.icns

-2 Bytes
Binary file not shown.

installer/FileAssociation.nsh

+23-23
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@ _____________________________________________________________________________
1818
1919
${RegisterExtension} "[executable]" "[extension]" "[description]"
2020
21-
"[executable]" ; executable which opens the file format
22-
;
23-
"[extension]" ; extension, which represents the file format to open
24-
;
25-
"[description]" ; description for the extension. This will be display in Windows Explorer.
26-
;
21+
"[executable]" ; executable which opens the file format
22+
;
23+
"[extension]" ; extension, which represents the file format to open
24+
;
25+
"[description]" ; description for the extension. This will be display in Windows Explorer.
26+
;
2727
2828
2929
${UnRegisterExtension} "[extension]" "[description]"
3030
31-
"[extension]" ; extension, which represents the file format to open
32-
;
33-
"[description]" ; description for the extension. This will be display in Windows Explorer.
34-
;
31+
"[extension]" ; extension, which represents the file format to open
32+
;
33+
"[description]" ; description for the extension. This will be display in Windows Explorer.
34+
;
3535
3636
_____________________________________________________________________________
3737
@@ -107,22 +107,22 @@ _____________________________________________________________________________
107107
!verbose push
108108
!verbose ${_FileAssociation_VERBOSE}
109109

110-
Exch $R2 ;exe
110+
Exch $R2;exe
111111
Exch
112-
Exch $R1 ;ext
112+
Exch $R1;ext
113113
Exch
114114
Exch 2
115-
Exch $R0 ;desc
115+
Exch $R0;desc
116116
Exch 2
117117
Push $0
118118
Push $1
119119

120-
ReadRegStr $1 HKCR $R1 "" ; read current file association
121-
StrCmp "$1" "" NoBackup ; is it empty
122-
StrCmp "$1" "$R0" NoBackup ; is it our own
123-
WriteRegStr HKCR $R1 "backup_val" "$1" ; backup current value
120+
ReadRegStr $1 HKCR $R1 "" ; read current file association
121+
StrCmp "$1" "" NoBackup ; is it empty
122+
StrCmp "$1" "$R0" NoBackup ; is it our own
123+
WriteRegStr HKCR $R1 "backup_val" "$1" ; backup current value
124124
NoBackup:
125-
WriteRegStr HKCR $R1 "" "$R0" ; set our file association
125+
WriteRegStr HKCR $R1 "" "$R0" ; set our file association
126126

127127
ReadRegStr $0 HKCR $R0 ""
128128
StrCmp $0 "" 0 Skip
@@ -158,24 +158,24 @@ Skip:
158158
!verbose push
159159
!verbose ${_FileAssociation_VERBOSE}
160160

161-
Exch $R1 ;desc
161+
Exch $R1;desc
162162
Exch
163-
Exch $R0 ;ext
163+
Exch $R0;ext
164164
Exch
165165
Push $0
166166
Push $1
167167

168168
ReadRegStr $1 HKCR $R0 ""
169-
StrCmp $1 $R1 0 NoOwn ; only do this if we own it
169+
StrCmp $1 $R1 0 NoOwn; only do this if we own it
170170
ReadRegStr $1 HKCR $R0 "backup_val"
171-
StrCmp $1 "" 0 Restore ; if backup="" then delete the whole key
171+
StrCmp $1 "" 0 Restore; if backup="" then delete the whole key
172172
DeleteRegKey HKCR $R0
173173
Goto NoOwn
174174

175175
Restore:
176176
WriteRegStr HKCR $R0 "" $1
177177
DeleteRegValue HKCR $R0 "backup_val"
178-
DeleteRegKey HKCR $R1 ;Delete key with association name settings
178+
DeleteRegKey HKCR $R1;Delete key with association name settings
179179

180180
NoOwn:
181181

installer/klystrack.nsi

+6-6
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ RequestExecutionLevel admin
2929
Section "klystrack files"
3030
SectionIn RO
3131

32-
; Set output path to the installation directory.
32+
; Set output path to the installation directory.
3333
SetOutPath $INSTDIR
3434

35-
; Put file there
35+
; Put file there
3636
File zip\data\LICENSE
3737
File zip\data\SDL2.dll
3838
File zip\data\SDL.txt
@@ -62,7 +62,7 @@ SectionIn RO
6262

6363
File /r examples\*
6464

65-
; For CreateShortCut
65+
; For CreateShortCut
6666

6767
SetOutPath $INSTDIR
6868

@@ -79,7 +79,7 @@ SectionIn RO
7979

8080
WriteUninstaller "$INSTDIR\uninstall.exe"
8181

82-
SectionEnd ; end the section
82+
SectionEnd; end the section
8383

8484
Section "Register file types"
8585
${registerExtension} "$INSTDIR\klystrack.exe" ".kt" "klystrack song"
@@ -113,7 +113,7 @@ Section Uninstall
113113
Delete DVORAK
114114
Delete n00bstar
115115

116-
; remove all themes
116+
; remove all themes
117117

118118
SetOutPath $INSTDIR\res
119119

@@ -122,7 +122,7 @@ Section Uninstall
122122
!include ${deletetemp}
123123
!delfile ${deletetemp}
124124

125-
; remove all examples
125+
; remove all examples
126126

127127
SetOutPath $INSTDIR\examples
128128

src/action.c

+27-14
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ void change_oversample(void *oversample, void *unused1, void *unused2)
139139

140140
mused.oversample = CASTPTR(int,oversample);
141141

142-
for (int i = 0 ; i < 4; ++i)
142+
for (int i = 0; i < 4; ++i)
143143
{
144144
if (oversamplemenu[i].p1 == oversample)
145145
oversamplemenu[i].flags |= MENU_BULLET;
@@ -318,28 +318,41 @@ void enable_channel(void *channel, void *unused1, void *unused2)
318318
void solo_channel(void *_channel, void *unused1, void *unused2)
319319
{
320320
int c = 0;
321-
int channel = CASTPTR(int,channel);
321+
int channel = CASTPTR(int,_channel); //was int channel = CASTPTR(int,channel);
322+
//dirty hack
323+
324+
debug("Current chn %d", channel); //wasn't there
322325

323326
if (channel == -1)
324327
channel = mused.current_sequencetrack;
325328

326-
for (int i = 0 ; i < MUS_MAX_CHANNELS ; ++i)
329+
for (int i = 0; i < MUS_MAX_CHANNELS; ++i)
330+
{
327331
if (!(mused.mus.channel[i].flags & MUS_CHN_DISABLED))
332+
{
328333
++c;
334+
}
335+
}
329336

330337
if (c == 1 && !(mused.mus.channel[channel].flags & MUS_CHN_DISABLED))
331338
{
332339
debug("Unmuted all");
333-
for (int i = 0 ; i < MUS_MAX_CHANNELS ; ++i)
340+
for (int i = 0; i < MUS_MAX_CHANNELS; ++i)
341+
{
334342
mused.mus.channel[i].flags &= ~MUS_CHN_DISABLED;
343+
}
335344

336345
set_info_message("Unmuted all channels");
337346
}
347+
338348
else
339349
{
340350
debug("Solo chn %d", CASTPTR(int,channel));
341-
for (int i = 0 ; i < MUS_MAX_CHANNELS ; ++i)
351+
352+
for (int i = 0; i < MUS_MAX_CHANNELS; ++i)
353+
{
342354
mused.mus.channel[i].flags |= MUS_CHN_DISABLED;
355+
}
343356

344357
mused.mus.channel[channel].flags &= ~MUS_CHN_DISABLED;
345358

@@ -350,7 +363,7 @@ void solo_channel(void *_channel, void *unused1, void *unused2)
350363

351364
void unmute_all_action(void *unused1, void *unused2, void *unused3)
352365
{
353-
for(int i = 0 ; i < MUS_MAX_CHANNELS ; ++i)
366+
for(int i = 0; i < MUS_MAX_CHANNELS; ++i)
354367
mused.mus.channel[i].flags &= ~MUS_CHN_DISABLED;
355368
}
356369

@@ -391,7 +404,7 @@ void cycle_focus(void *_views, void *_focus, void *_mode)
391404
View *views = viewlist[*mode];
392405

393406
int i;
394-
for (i = 0 ; views[i].handler ; ++i)
407+
for (i = 0; views[i].handler; ++i)
395408
{
396409
if (views[i].focus == *focus) break;
397410
}
@@ -400,7 +413,7 @@ void cycle_focus(void *_views, void *_focus, void *_mode)
400413

401414
int next;
402415

403-
for (next = i + 1 ; i != next ; ++next)
416+
for (next = i + 1; i != next; ++next)
404417
{
405418
if (views[next].handler == NULL)
406419
{
@@ -562,7 +575,7 @@ void change_pixel_scale(void *scale, void*b, void*c)
562575

563576
set_scaled_cursor();
564577

565-
for (int i = 0 ; i < 4; ++i)
578+
for (int i = 0; i < 4; ++i)
566579
{
567580
if (pixelmenu[i].p1 == scale)
568581
pixelmenu[i].flags |= MENU_BULLET;
@@ -642,7 +655,7 @@ void change_timesig(void *delta, void *b, void *c)
642655

643656
static const Uint16 sigs[] = { 0x0404, 0x0304, 0x0604, 0x0308, 0x0608, 0x0908, 0x0c08 };
644657
int i;
645-
for (i = 0 ; i < sizeof(sigs) / sizeof(sigs[0]) ; ++i)
658+
for (i = 0; i < sizeof(sigs) / sizeof(sigs[0]); ++i)
646659
{
647660
if (sigs[i] == mused.time_signature)
648661
break;
@@ -705,12 +718,12 @@ void export_channels_action(void *a, void*b, void*c)
705718
{
706719
strncpy(mused.previous_export_filename, filename, sizeof(mused.previous_export_filename) - 1);
707720

708-
for (int i = 0 ; i < mused.song.num_channels ; ++i)
721+
for (int i = 0; i < mused.song.num_channels; ++i)
709722
{
710723
char c_filename[1500], tmp[1000];
711724
strncpy(tmp, filename, sizeof(tmp) - 1);
712725

713-
for (int c = strlen(tmp) - 1 ; c >= 0 ; --c)
726+
for (int c = strlen(tmp) - 1; c >= 0; --c)
714727
{
715728
if (tmp[c] == '.')
716729
{
@@ -919,7 +932,7 @@ void set_note_jump(void *steps, void *unused1, void *unused2)
919932

920933
void change_default_pattern_length(void *length, void *unused1, void *unused2)
921934
{
922-
for (int i = 0 ; i < NUM_PATTERNS ; ++i)
935+
for (int i = 0; i < NUM_PATTERNS; ++i)
923936
{
924937
if (mused.song.pattern[i].num_steps == mused.default_pattern_length && is_pattern_empty(&mused.song.pattern[i]))
925938
{
@@ -929,7 +942,7 @@ void change_default_pattern_length(void *length, void *unused1, void *unused2)
929942

930943
mused.sequenceview_steps = mused.default_pattern_length = CASTPTR(int,length);
931944

932-
for (Menu *m = patternlengthmenu ; m->text ; ++m)
945+
for (Menu *m = patternlengthmenu; m->text; ++m)
933946
{
934947
if (CASTPTR(int, m->p1) == mused.default_pattern_length)
935948
m->flags |= MENU_BULLET;

src/combWFgen.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void createCombinedWF(int wfarray[], float bitmul, float bitstrength,float tresh
7575

7676
for (int k=0; k<12; k++)
7777
{
78-
bitlevel += ( bitmul/pow(bitstrength,abs(k-j)) ) * (((i>>k)&1)-0.5) ;
78+
bitlevel += ( bitmul/pow(bitstrength,abs(k-j)) ) * (((i>>k)&1)-0.5);
7979
}
8080

8181
wfarray[i] += (bitlevel>=treshold)? pow(2,j) : 0;

src/combWFgen.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ extern int PulseTriSaw_8580[4096];
2929
extern int PulseTri_8580[8192];
3030

3131
long map_Arduino(long x, long in_min, long in_max, long out_min, long out_max);
32-
void createCombinedWF(int wfarray[], float bitmul, float bitstrength,float treshold) ;
33-
void createPulseTri(int wfarray[], float bitmul, float bitstrength,float treshold) ;
32+
void createCombinedWF(int wfarray[], float bitmul, float bitstrength,float treshold);
33+
void createPulseTri(int wfarray[], float bitmul, float bitstrength,float treshold);

src/command.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ static const InstructionDesc instruction_desc[] =
188188

189189
const InstructionDesc * get_instruction_desc(Uint16 command)
190190
{
191-
for (int i = 0 ; instruction_desc[i].name != NULL ; ++i)
191+
for (int i = 0; instruction_desc[i].name != NULL; ++i)
192192
{
193193
if (instruction_desc[i].opcode == (command & instruction_desc[i].mask))
194194
{

0 commit comments

Comments
 (0)