Nightly update (ISO SHA-1 aed1efc)
Note: this removes BMP support
This commit is contained in:
1 parent
f75b59fc75
commit
877accc659
31 files changed
+1322
-210
No files matched your search
Binary file not shown.
@@ -15,7 +15,7 @@ U0 LoadDocDefines()
|
||||
//$LK,"DD_BOOT_HIGH_LOC_DVD",A="FF:::/Adam/Opt/Boot/BootDVD.HC,DD_BOOT_HIGH_LOC_DVD"$
|
||||
|
||||
$TR,"LineRep"$
|
||||
$ID,2$DefinePrint("DD_TEMPLEOS_LOC","81,445");
|
||||
$ID,2$DefinePrint("DD_TEMPLEOS_LOC","80,800");
|
||||
$ID,-2$
|
||||
DefinePrint("DD_MP_VECT","%08X",MP_VECT_ADDR);
|
||||
DefinePrint("DD_MP_VECT_END","%08X",
|
||||
|
||||
@@ -5,13 +5,10 @@ extern U0 ACFillIn(I64 n);
|
||||
extern U0 ACMan(I64 n,CTask *parent_task=NULL);
|
||||
extern I64 AdamFile(U8 *filename,Bool warn_ext=TRUE);
|
||||
extern Bool AutoComplete(Bool val=OFF);
|
||||
extern I64 BMPWrite(U8 *filename,CDC *dc,I64 bits=4);
|
||||
extern U0 ClipDel();
|
||||
extern CCtrl *CtrlFindUnique(CTask *haystack_task,I64 needle_type);
|
||||
extern Bool CtrlInside(CCtrl *c,I64 x,I64 y);
|
||||
extern U8 *DC2Sprite(CDC *tmpb);
|
||||
extern U0 DocBMP(CDoc *doc=NULL,U8 *filename,
|
||||
Bool dither_probability=FALSE,Bool use_ms_paint_palette=FALSE);
|
||||
extern U0 DocBinDel(CDoc *doc,CDocBin *b);
|
||||
extern U0 DocBinsValidate(CDoc *doc);
|
||||
extern U0 DocBottom(CDoc *doc=NULL);
|
||||
|
||||
@@ -0,0 +1,412 @@
|
||||
#help_index "Snd"
|
||||
public U0 SndTaskEndCB()
|
||||
{//Will turn-off snd when a task gets killed.
|
||||
Snd;
|
||||
Exit;
|
||||
}
|
||||
|
||||
#help_index "Snd/Math;Math"
|
||||
public F64 Saw(F64 t,F64 period)
|
||||
{//Sawtooth. 0.0 - 1.0 think "(Sin+1)/2"
|
||||
if (period) {
|
||||
if (t>=0.0)
|
||||
return t%period/period;
|
||||
else
|
||||
return 1.0+t%period/period;
|
||||
} else
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
public F64 FullSaw(F64 t,F64 period)
|
||||
{//Plus&Minus Sawtooth. 1.0 - -1.0 think "Sin"
|
||||
if (period) {
|
||||
if (t>=0.0)
|
||||
return 2.0*(t%period/period)-1.0;
|
||||
else
|
||||
return 2.0*(t%period/period)+1.0;
|
||||
} else
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
public F64 Caw(F64 t,F64 period)
|
||||
{//Cawtooth. 1.0 - 0.0 think "(Cos+1)/2"
|
||||
if (period) {
|
||||
if (t>=0.0)
|
||||
return 1.0-t%period/period;
|
||||
else
|
||||
return -(t%period)/period;
|
||||
} else
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
public F64 FullCaw(F64 t,F64 period)
|
||||
{//Plus&Minus Cawtooth. 1.0 - -1.0 think "Cos"
|
||||
if (period) {
|
||||
if (t>=0.0)
|
||||
return -2.0*(t%period/period)+1.0;
|
||||
else
|
||||
return -2.0*(t%period/period)-1.0;
|
||||
} else
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
public F64 Tri(F64 t,F64 period)
|
||||
{//Triangle waveform. 0.0 - 1.0 - 0.0
|
||||
if (period) {
|
||||
t=2.0*(Abs(t)%period)/period;
|
||||
if (t<=1.0)
|
||||
return t;
|
||||
else
|
||||
return 2.0-t;
|
||||
} else
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
public F64 FullTri(F64 t,F64 period)
|
||||
{//Plus&Minus Triangle waveform. 0.0 - 1.0 - 0.0 - -1.0 -0.0
|
||||
if (period) {
|
||||
t=4.0*(t%period)/period;
|
||||
if (t<=-1.0) {
|
||||
if (t<=-3.0)
|
||||
return t+4.0;
|
||||
else
|
||||
return -2.0-t;
|
||||
} else {
|
||||
if (t<=1.0)
|
||||
return t;
|
||||
else if (t<=3.0)
|
||||
return 2.0-t;
|
||||
else
|
||||
return t-4.0;
|
||||
}
|
||||
} else
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
#help_index "Snd/Music"
|
||||
|
||||
public class CMusicGlbls
|
||||
{
|
||||
U8 *cur_song;
|
||||
CTask *cur_song_task;
|
||||
I64 octave;
|
||||
F64 note_len;
|
||||
U8 note_map[7];
|
||||
Bool mute;
|
||||
I64 meter_top,meter_bottom;
|
||||
F64 tempo,stacatto_factor;
|
||||
|
||||
//If you wish to sync with a
|
||||
//note in a Play() string. 0 is the start
|
||||
I64 play_note_num;
|
||||
|
||||
F64 tM_correction,last_Beat,last_tM;
|
||||
} music={NULL,NULL,4,1.0,{0,2,3,5,7,8,10},FALSE,4,4,2.5,0.9,0,0,0,0};
|
||||
|
||||
#help_index "Snd/Music;Time/Seconds"
|
||||
public F64 tM()
|
||||
{//Time in seconds synced to music subsystem.
|
||||
return (cnts.jiffies+music.tM_correction)/JIFFY_FREQ;
|
||||
}
|
||||
|
||||
public F64 Beat()
|
||||
{//Time in music beats.
|
||||
F64 res,cur_tM;
|
||||
PUSHFD
|
||||
CLI
|
||||
if (mp_cnt>1)
|
||||
while (LBts(&sys_semas[SEMA_TMBEAT],0))
|
||||
PAUSE
|
||||
cur_tM=tM;
|
||||
res=music.last_Beat;
|
||||
if (music.tempo)
|
||||
res+=(cur_tM-music.last_tM)*music.tempo;
|
||||
music.last_tM=cur_tM;
|
||||
music.last_Beat=res;
|
||||
LBtr(&sys_semas[SEMA_TMBEAT],0);
|
||||
POPFD
|
||||
return res;
|
||||
}
|
||||
|
||||
#help_index "Snd/Music"
|
||||
U8 *MusicSetOctave(U8 *st)
|
||||
{
|
||||
I64 ch;
|
||||
ch=*st++;
|
||||
while ('0'<=ch<='9') {
|
||||
music.octave=ch-'0';
|
||||
ch=*st++;
|
||||
}
|
||||
return --st;
|
||||
}
|
||||
|
||||
U8 *MusicSetMeter(U8 *st)
|
||||
{
|
||||
I64 ch;
|
||||
ch=*st++;
|
||||
while (ch=='M') {
|
||||
ch=*st++;
|
||||
if ('0'<=ch<='9') {
|
||||
music.meter_top=ch-'0';
|
||||
ch=*st++;
|
||||
}
|
||||
if (ch=='/')
|
||||
ch=*st++;
|
||||
if ('0'<=ch<='9') {
|
||||
music.meter_bottom=ch-'0';
|
||||
ch=*st++;
|
||||
}
|
||||
}
|
||||
return --st;
|
||||
}
|
||||
|
||||
U8 *MusicSetNoteLen(U8 *st)
|
||||
{
|
||||
Bool cont=TRUE;
|
||||
do {
|
||||
switch (*st++) {
|
||||
case 'w': music.note_len=4.0; break;
|
||||
case 'h': music.note_len=2.0; break;
|
||||
case 'q': music.note_len=1.0; break;
|
||||
case 'e': music.note_len=0.5; break;
|
||||
case 's': music.note_len=0.25; break;
|
||||
case 't': music.note_len=2.0*music.note_len/3.0; break;
|
||||
case '.': music.note_len=1.5*music.note_len; break;
|
||||
default:
|
||||
st--;
|
||||
cont=FALSE;
|
||||
}
|
||||
} while (cont);
|
||||
return st;
|
||||
}
|
||||
|
||||
public I8 Note2Ona(I64 note,I64 octave=4)
|
||||
{//Note to ona. Mid C is ona=51, note=3 and octave=4.
|
||||
if (note<3)
|
||||
return (octave+1)*12+note;
|
||||
else
|
||||
return octave*12+note;
|
||||
}
|
||||
|
||||
public I8 Ona2Note(I8 ona)
|
||||
{//Ona to note in octave. Mid C is ona=51, note=3 and octave=4.
|
||||
return ona%12;
|
||||
}
|
||||
|
||||
public I8 Ona2Octave(I8 ona)
|
||||
{//Ona to octave. Mid C is ona=51, note=3 and octave=4.
|
||||
I64 note=ona%12,octave=ona/12;
|
||||
if (note<3)
|
||||
return octave-1;
|
||||
else
|
||||
return octave;
|
||||
}
|
||||
|
||||
public U0 Play(U8 *st,U8 *words=NULL)
|
||||
{/* Notes are entered with a capital letter.
|
||||
|
||||
Octaves are entered with a digit and
|
||||
stay set until changed. Mid C is octave 4.
|
||||
|
||||
Durations are entered with
|
||||
'w' whole note
|
||||
'h' half note
|
||||
'q' quarter note
|
||||
'e' eighth note
|
||||
't' sets to 2/3rds the current duration
|
||||
'.' sets to 1.5 times the current duration
|
||||
durations stay set until changed.
|
||||
|
||||
'(' tie, placed before the note to be extended
|
||||
|
||||
$LK,"music.meter_top",A="MN:CMusicGlbls"$,$LK,"music.meter_bottom",A="MN:CMusicGlbls"$ is set with
|
||||
"M3/4"
|
||||
"M4/4"
|
||||
etc.
|
||||
|
||||
Sharp and flat are done with '#' or 'b'.
|
||||
|
||||
The var music.stacatto_factor can
|
||||
be set to a range from 0.0 to 1.0.
|
||||
|
||||
The var music.tempo is quarter-notes
|
||||
per second. It defaults to
|
||||
2.5 and gets faster when bigger.
|
||||
*/
|
||||
U8 *word,*last_st;
|
||||
I64 note,octave,i=0,ona,timeout_val,timeout_val2;
|
||||
Bool tie;
|
||||
F64 d,on_jiffies,off_jiffies;
|
||||
music.play_note_num=0;
|
||||
while (*st) {
|
||||
timeout_val=cnts.jiffies;
|
||||
tie=FALSE;
|
||||
|
||||
do {
|
||||
last_st=st;
|
||||
if (*st=='(') {
|
||||
tie=TRUE;
|
||||
st++;
|
||||
} else {
|
||||
st=MusicSetMeter(st);
|
||||
st=MusicSetOctave(st);
|
||||
st=MusicSetNoteLen(st);
|
||||
}
|
||||
} while (st!=last_st);
|
||||
|
||||
if (!*st) break;
|
||||
note=*st++-'A';
|
||||
if (note<7) {
|
||||
note=music.note_map[note];
|
||||
octave=music.octave;
|
||||
if (*st=='b') {
|
||||
note--;
|
||||
if (note==2)
|
||||
octave--;
|
||||
st++;
|
||||
} else if (*st=='#') {
|
||||
note++;
|
||||
if (note==3)
|
||||
octave++;
|
||||
st++;
|
||||
}
|
||||
ona=Note2Ona(note,octave);
|
||||
} else
|
||||
ona=ONA_REST;
|
||||
if (words && (word=LstSub(i++,words)) && StrCmp(word," "))
|
||||
"%s",word;
|
||||
d=JIFFY_FREQ*music.note_len/music.tempo;
|
||||
if (tie) {
|
||||
on_jiffies =d;
|
||||
off_jiffies =0;
|
||||
} else {
|
||||
on_jiffies =d*music.stacatto_factor;
|
||||
off_jiffies =d*(1.0-music.stacatto_factor);
|
||||
}
|
||||
timeout_val+=on_jiffies;
|
||||
timeout_val2=timeout_val+off_jiffies;
|
||||
|
||||
if (!music.mute)
|
||||
Snd(ona);
|
||||
SleepUntil(timeout_val);
|
||||
music.tM_correction+=on_jiffies-ToI64(on_jiffies);
|
||||
|
||||
if (!music.mute)
|
||||
Snd;
|
||||
SleepUntil(timeout_val2);
|
||||
music.tM_correction+=off_jiffies-ToI64(off_jiffies);
|
||||
|
||||
music.play_note_num++;
|
||||
}
|
||||
}
|
||||
|
||||
U0 MusicSettingsRst()
|
||||
{
|
||||
music.play_note_num=0;
|
||||
music.stacatto_factor=0.9;
|
||||
music.tempo=2.5;
|
||||
music.octave=4;
|
||||
music.note_len=1.0;
|
||||
music.meter_top=4;
|
||||
music.meter_bottom=4;
|
||||
SndRst;
|
||||
PUSHFD
|
||||
CLI
|
||||
if (mp_cnt>1)
|
||||
while (LBts(&sys_semas[SEMA_TMBEAT],0))
|
||||
PAUSE
|
||||
music.last_tM=tM;
|
||||
music.last_Beat=0.0;
|
||||
LBtr(&sys_semas[SEMA_TMBEAT],0);
|
||||
POPFD
|
||||
}
|
||||
|
||||
MusicSettingsRst;
|
||||
|
||||
U0 CurSongTask()
|
||||
{
|
||||
Fs->task_end_cb=&SndTaskEndCB;
|
||||
while (TRUE)
|
||||
Play(music.cur_song);
|
||||
}
|
||||
|
||||
#help_index "Snd"
|
||||
|
||||
#define SE_NOISE 0
|
||||
#define SE_SWEEP 1
|
||||
|
||||
class CSoundEffectFrame
|
||||
{
|
||||
I32 type;
|
||||
I8 ona1,ona2;
|
||||
F64 duration;
|
||||
};
|
||||
|
||||
U0 SoundEffectEndTaskCB()
|
||||
{
|
||||
Free(FramePtr("CSoundEffectFrame"));
|
||||
music.mute--;
|
||||
SndTaskEndCB;
|
||||
}
|
||||
|
||||
U0 SoundEffectTask(CSoundEffectFrame *ns)
|
||||
{
|
||||
I64 i,ona;
|
||||
F64 t0=tS,t,timeout=t0+ns->duration;
|
||||
FramePtrAdd("CSoundEffectFrame",ns);
|
||||
Fs->task_end_cb=&SoundEffectEndTaskCB;
|
||||
switch (ns->type) {
|
||||
case SE_NOISE:
|
||||
i=MaxI64(ns->ona2-ns->ona1,1);
|
||||
while (tS<timeout) {
|
||||
ona=RandU16%i+ns->ona1;
|
||||
Snd(ona);
|
||||
t=Clamp(3000.0/Ona2Freq(ona),1.0,50.0);
|
||||
if (t+tS>timeout)
|
||||
t=timeout-tS;
|
||||
Sleep(t);
|
||||
}
|
||||
break;
|
||||
case SE_SWEEP:
|
||||
while (tS<timeout) {
|
||||
t=(tS-t0)/ns->duration;
|
||||
ona=(1.0-t)*ns->ona1+t*ns->ona2;
|
||||
Snd(ona);
|
||||
t=Clamp(3000.0/Ona2Freq(ona),1.0,50.0);
|
||||
if (t+tS>timeout)
|
||||
t=timeout-tS;
|
||||
Sleep(t);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public CTask *Noise(I64 mS,F64 min_ona,F64 max_ona)
|
||||
{//Make white noise for given number of mS.
|
||||
CSoundEffectFrame *ns;
|
||||
if (mS>0) {
|
||||
ns=MAlloc(sizeof(CSoundEffectFrame));
|
||||
ns->type=SE_NOISE;
|
||||
ns->duration=mS/1000.0;
|
||||
ns->ona1=min_ona;
|
||||
ns->ona2=max_ona;
|
||||
music.mute++;
|
||||
return Spawn(&SoundEffectTask,ns,"Noise",,Fs);
|
||||
} else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
public CTask *Sweep(I64 mS,F64 ona1,F64 ona2)
|
||||
{//Sweep through freq range in given number of mS.
|
||||
CSoundEffectFrame *ns;
|
||||
if (mS>0) {
|
||||
ns=MAlloc(sizeof(CSoundEffectFrame));
|
||||
ns->type=SE_SWEEP;
|
||||
ns->duration=mS/1000.0;
|
||||
ns->ona1=ona1;
|
||||
ns->ona2=ona2;
|
||||
music.mute++;
|
||||
return Spawn(&SoundEffectTask,ns,"Noise",,Fs);
|
||||
} else
|
||||
return NULL;
|
||||
}
|
||||
@@ -296,8 +296,7 @@ U0 DocUndoRestore(CDoc *doc)
|
||||
DocUnlock(doc);
|
||||
}
|
||||
|
||||
#help_index "Graphics/Windows BMP Files;Graphics/GR Files;"\
|
||||
"DolDoc/Output;StdOut/DolDoc"
|
||||
#help_index "Graphics/GR Files;DolDoc/Output;StdOut/DolDoc"
|
||||
public Bool DocType(CDoc *doc=NULL,U8 *filename,I64 trailing_new_lines=1)
|
||||
{//Output txt or graphic file to document.
|
||||
Bool res=FALSE;
|
||||
@@ -311,12 +310,6 @@ public Bool DocType(CDoc *doc=NULL,U8 *filename,I64 trailing_new_lines=1)
|
||||
DocDump(doc2,100000);
|
||||
DocDel(doc2);
|
||||
res=TRUE;
|
||||
} else if (FilesFindMatch(filename,"*.BMP.Z")) {
|
||||
DocBMP(doc,filename,,FALSE);
|
||||
res=TRUE;
|
||||
} else if (FilesFindMatch(filename,"*.BMP;*.bmp")) {
|
||||
DocBMP(doc,filename,,TRUE);
|
||||
res=TRUE;
|
||||
} else if (FilesFindMatch(filename,"*.GR*")) {
|
||||
DocGR(doc,filename);
|
||||
res=TRUE;
|
||||
@@ -326,7 +319,7 @@ public Bool DocType(CDoc *doc=NULL,U8 *filename,I64 trailing_new_lines=1)
|
||||
return res;
|
||||
}
|
||||
|
||||
#help_index "Graphics/Windows BMP Files;Graphics/GR Files;"\
|
||||
#help_index "Graphics/GR Files;"\
|
||||
"File/Cmd Line (Typically);DolDoc/Cmd Line (Typically);"\
|
||||
"StdOut;Cmd Line (Typically)"
|
||||
public Bool Type(U8 *filename,I64 trailing_new_lines=1)
|
||||
|
||||
@@ -376,6 +376,10 @@ public CDC *DCLoad(U8 *src,I64 *_size=NULL,CTask *task=NULL)
|
||||
#help_index "Graphics/GR Files"
|
||||
#help_file "::/Doc/GRFiles"
|
||||
#help_index "Graphics/Device Contexts;Graphics/GR Files"
|
||||
|
||||
#define GR_FILE_MAX (offset(CDC.end)-offset(CDC.start)+\
|
||||
COLORS_NUM*sizeof(CBGR48)+sizeof(CArcCtrl)+GR_WIDTH*GR_HEIGHT)
|
||||
|
||||
public I64 GRWrite(U8 *filename,CDC *dc,I64 dcsf_flags=DCSF_COMPRESSED)
|
||||
{//TempleOS GR File.
|
||||
I64 size;
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
#help_index "Graphics/Device Contexts;Graphics/GR Files"
|
||||
|
||||
#define MV_FILE_MAX 0x007FF000
|
||||
|
||||
public I64 GR2MV(U8 *print_fmt="VID%03d.MV",
|
||||
U8 *files_find_mask,U8 *fu_flags=NULL)
|
||||
{/*Merge GR lst to MV file.
|
||||
"+d" will delete GR list files.
|
||||
*/
|
||||
I64 fuf_flags=0,file_num=0,size;
|
||||
CDirEntry *tmpde,*tmpde1;
|
||||
U8 *base,*dst,*src,*st;
|
||||
CDC *dc,*dc_base=DCNew(GR_WIDTH,GR_HEIGHT);
|
||||
CDate cdt;
|
||||
Bool old_silent;
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+f+F");
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags&FUG_FILES_FIND);
|
||||
if (progress1_max=LinkedLstCnt(tmpde1)) {
|
||||
dst=base=MAlloc(MV_FILE_MAX);
|
||||
while (tmpde) {
|
||||
dc=GRRead(tmpde->full_name);
|
||||
GrBlot(dc_base,dc->x0,dc->y0,dc);
|
||||
if (dst+GR_FILE_MAX>base+MV_FILE_MAX) {
|
||||
st=MStrPrint(print_fmt,file_num++);
|
||||
FileWrite(st,base,dst-base);
|
||||
Free(st);
|
||||
dst=base;
|
||||
|
||||
cdt=dc->cdt;
|
||||
dc=DCCopy(dc_base);
|
||||
dc->cdt=cdt;
|
||||
}
|
||||
src=DCSave(dc,&size);
|
||||
DCDel(dc);
|
||||
MemCpy(dst,src,size);
|
||||
dst+=size;
|
||||
Free(src);
|
||||
if (fuf_flags&FUF_DEL) {
|
||||
old_silent=Silent;
|
||||
Del(tmpde->full_name);
|
||||
Silent(old_silent);
|
||||
}
|
||||
progress1++;
|
||||
tmpde=tmpde->next;
|
||||
}
|
||||
if (dst>base) {
|
||||
st=MStrPrint(print_fmt,file_num++);
|
||||
FileWrite(st,base,dst-base);
|
||||
Free(st);
|
||||
}
|
||||
Free(base);
|
||||
}
|
||||
progress1=progress1_max=0;
|
||||
DirTreeDel(tmpde1);
|
||||
DCDel(dc_base);
|
||||
return file_num;
|
||||
}
|
||||
@@ -14,6 +14,7 @@ Cd(__DIR__);;
|
||||
#include "GrBitMap"
|
||||
#include "GrPrimatives"
|
||||
#include "GrComposites"
|
||||
#include "GrMV"
|
||||
|
||||
#define SPE_ABORT (-1)
|
||||
#define SPE_EXIT 0
|
||||
|
||||
@@ -26,8 +26,7 @@
|
||||
#define SPBM_ADD_OUTLINE 23
|
||||
#define SPBM_ETCH 24
|
||||
#define SPBM_UNDO 25
|
||||
#define SPBM_SAVE_BMP 26
|
||||
#define SPBM_SAVE_GRA 27
|
||||
#define SPBM_SAVE_GR 26
|
||||
|
||||
U0 GrInit4()
|
||||
{
|
||||
@@ -36,7 +35,7 @@ U0 GrInit4()
|
||||
"Rect\0Circle\0Text\0Text Box\0Text Diamond\0Flood Fill\0"
|
||||
"Flood Fill Not Color\0PolyLine\0PolyPoint\0Copy\0Delete\0Paste\0"
|
||||
"Paste Transparent\0Find and Replace\0Trim to Extents\0Add Outline\0"
|
||||
"Etch\0Undo\0Save BMP\0Save GR\0");
|
||||
"Etch\0Undo\0Save GR\0");
|
||||
}
|
||||
GrInit4;
|
||||
|
||||
@@ -79,8 +78,7 @@ I64 PopUpSpriteBitMap(CColorROPU32 color,I64 width)
|
||||
"$$MU-UL,\"Delete to Clip\",LE=SPBM_DELETE$$\n"
|
||||
"$$MU-UL,\"Paste Clip\",LE=SPBM_PASTE$$\n"
|
||||
"$$MU-UL,\"Paste Transparent Clip\",LE=SPBM_PASTE_TRANSPARENT$$\n"
|
||||
"\n$$MU-UL,\"Save BMP File\",LE=SPBM_SAVE_BMP$$\n"
|
||||
"$$MU-UL,\"Save GR File\",LE=SPBM_SAVE_GRA$$\n"
|
||||
"\n$$MU-UL,\"Save GR File\",LE=SPBM_SAVE_GR$$\n"
|
||||
"\n$$MU-UL,\"Undo\",LE=SPBM_UNDO$$\n"
|
||||
"\n$$PURPLE$$$$MU-UL,\"+] Sprite Main Menu\",LE=SPBM_MAIN_MENU$$$$LTBLUE$$\n"
|
||||
"$$MU-UL,\"Exit Sprite\",LE=SPBM_EXIT$$\n"
|
||||
@@ -293,12 +291,7 @@ bm_menu:
|
||||
GrBitMapEdPrepPersistentDC(dc,xx1,yy1,img);
|
||||
}
|
||||
goto bm_menu;
|
||||
case SPBM_SAVE_BMP:
|
||||
*filename.name=0;
|
||||
if (DocForm(&filename) && *filename.name)
|
||||
BMPWrite(filename.name,img);
|
||||
goto bm_menu;
|
||||
case SPBM_SAVE_GRA:
|
||||
case SPBM_SAVE_GR:
|
||||
*filename.name=0;
|
||||
if (DocForm(&filename) && *filename.name)
|
||||
GRWrite(filename.name,img,DCSF_COMPRESSED|DCSF_PALETTE_GET);
|
||||
|
||||
@@ -6,7 +6,7 @@ Cd(__DIR__);;
|
||||
#include "TaskRep"
|
||||
#include "AMathODE"
|
||||
#include "Gr/MakeGr"
|
||||
#include "Snd/MakeSnd"
|
||||
#include "ASnd"
|
||||
#include "ABlkDev/MakeABlkDev"
|
||||
#include "Menu"
|
||||
#include "Win"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
Cd(__DIR__);;
|
||||
#include "Diff"
|
||||
#include "FileBMP"
|
||||
#include "Find"
|
||||
#include "HeapLog"
|
||||
#include "LineRep"
|
||||
|
||||
@@ -35,7 +35,7 @@ public U0 Refresh(I64 cnt=1,Bool force=FALSE)
|
||||
|
||||
public Bool ScrnCast(Bool val=ON,U8 *print_fmt="B:/Tmp/%X.GR")
|
||||
{//WinMgr saves GR files to a dir.
|
||||
Bool old_val,old_silent=Silent;
|
||||
Bool old_val;
|
||||
if (val) {
|
||||
if (!(old_val=LBtr(&winmgr.scrn_cast,0))) {
|
||||
Free(winmgr.scrn_cast_print_fmt);
|
||||
@@ -46,7 +46,6 @@ public Bool ScrnCast(Bool val=ON,U8 *print_fmt="B:/Tmp/%X.GR")
|
||||
}
|
||||
} else
|
||||
old_val=LBtr(&winmgr.scrn_cast,0);
|
||||
Silent(old_silent);
|
||||
return old_val;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,14 +11,3 @@ $WW,1$$FG,5$$TX+CX,"Psalmody Help"$$FG$
|
||||
* You can take the $LK,"Play",A="MN:Play"$() stmts out of a song file and place them in your programs. You can also add a song to a document with $FG,2$<CTRL-l>$FG$, but you should do it after pressing $FG,2$<CTRL-t>$FG$ because the clip-insert in $FG,2$<CTRL-l>$FG$ is screwy. See this $SO,"<Song>",A="4qG5EC4BeGG5qCeFD4sB5G4B5G4qG5EC4BeGG5qCeFD4sB5G4B5GqEeEFqE4BeG5FetC4A5GqFCEeEFqE4BeG5FetC4A5GqFC"$ after pressing $FG,2$<CTRL-t>$FG$, now.
|
||||
|
||||
* You can call $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.HC,JukeBox"$("~/Psalmody"); to play your songs.
|
||||
|
||||
* To create a $FG,2$.SND$FG$ file which can be exported and played under Windows, set the $FG,2$Bool$FG$ $LK,"snd.record",A="MN:CSndGlbls"$ to $FG,2$TRUE$FG$, play music, and set it to $FG,2$FALSE$FG$. Then, call $LK,"SndFileCreate",A="MN:SndFileCreate"$(). You might wish to make a $FG,2$<CTRL-ALT-key>$FG$ to toggle this system level recording feat. See $LK,"Snd",A="MN:Snd"$(). Add this code to your $LK,"~/HomeKeyPlugIns.HC"$ file.
|
||||
|
||||
$FG,5$U0 CtrlAltR(I64)
|
||||
{
|
||||
snd.record=!snd.record;
|
||||
}
|
||||
CtrlAltCBSet('R',&CtrlAltR,"Cmd /Toggle snd.record");$FG$
|
||||
|
||||
* When calling $LK,"SndFileCreate",A="MN:SndFileCreate"$() you can set a waveform. The PC speaker is $LK,"WF_SQUARE",A="MN:WF_SQUARE"$. You can sel reverb and averaging, also.
|
||||
|
||||
@@ -71,7 +71,7 @@ U0 JukeSongPuppet(CTask *juke_task,I64 passes,I64 song_num,U8 *name)
|
||||
}
|
||||
|
||||
public U0 JukeSongsPuppet(U8 *dirname="~/Psalmody",I64 passes=2,
|
||||
I64 start_song=0,I64 end_song=I64_MAX,F64 start_delay=0)
|
||||
I64 start_song=0,I64 end_song=I64_MAX)
|
||||
{//Help make music video by puppeting JukeBox task.
|
||||
I64 i;
|
||||
CDirEntry *tmpde,*tmpde1;
|
||||
@@ -80,7 +80,6 @@ public U0 JukeSongsPuppet(U8 *dirname="~/Psalmody",I64 passes=2,
|
||||
tmpde1=FilesFind("*",FUF_RECURSE|FUF_JUST_TXT|FUF_JUST_FILES);
|
||||
for (tmpde=tmpde1,i=0;tmpde && i<start_song;i++)
|
||||
tmpde=tmpde->next;
|
||||
Sleep(start_delay*1000);
|
||||
for (i=start_song;tmpde && i<end_song;i++) {
|
||||
JukeSongPuppet(juke_task,passes,i,tmpde->name);
|
||||
tmpde=tmpde->next;
|
||||
|
||||
Binary file not shown.
@@ -72,6 +72,7 @@ public extern U0 Ui(U8 *buf,U8 **_rip,I64 seg_size=64,
|
||||
I64 *_jmp_dst=NULL,Bool just_ins=FALSE);
|
||||
public extern I64 Un(U8 *rip,I64 cnt=0x80,I64 seg_size=64);
|
||||
extern CUAsmGlbls uasm;
|
||||
|
||||
#help_index "Hash/System"
|
||||
public extern I64 HashEntrySize(CHashSrcSym *tmph);
|
||||
public extern I64 HashEntrySize2(CHashSrcSym *tmph);
|
||||
|
||||
@@ -156,12 +156,16 @@ Bool MyPutKey(I64 ch,I64 sc)
|
||||
case 'f': //With sync
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Cmd /FrameGrabber Sync");
|
||||
else if (fg_on)
|
||||
FrameGrabberToggle(FALSE,FALSE,FALSE);
|
||||
else
|
||||
FrameGrabberToggle(TRUE,FALSE,FALSE);
|
||||
return TRUE;
|
||||
case 'F': //With sync and intro TOS theme
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Cmd /FrameGrabber Intro");
|
||||
else if (fg_on)
|
||||
FrameGrabberToggle(FALSE,FALSE,TRUE);
|
||||
else
|
||||
FrameGrabberToggle(TRUE,TRUE,FALSE);
|
||||
return TRUE;
|
||||
@@ -220,6 +224,20 @@ Bool MyPutKey(I64 ch,I64 sc)
|
||||
"$$AN,\"<TODO>\",A=\"ANC%d\"$$",i;
|
||||
}
|
||||
return TRUE;
|
||||
case 'p':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Cmd /JukeBox");
|
||||
else
|
||||
PopUp("#include \"::/Apps/Psalmody/Load\";"
|
||||
"JukeBox(\"::/Home/Sup1/Sup1Hymns\");");
|
||||
return TRUE;
|
||||
case 'P':
|
||||
if (sc&SCF_KEY_DESC)
|
||||
KeyDescSet("Cmd /Psalmody");
|
||||
else
|
||||
PopUp("#include \"::/Apps/Psalmody/Load\";"
|
||||
"Psalmody(\"~/Sup1/Sup1Hymns\");");
|
||||
return TRUE;
|
||||
|
||||
//Ins your own ALT-key plug-ins
|
||||
case '1':
|
||||
|
||||
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
$WW,1$$FG,5$$TX+CX,"TODO"$$FG$
|
||||
|
||||
* Make $LK,"GR2BMPLst",A="MN:GR2BMPLst"$ combine disjoint rects for same frame.
|
||||
* Make MV files combine disjoint rects for same frame.
|
||||
|
||||
* God said to reconsider switch start/end, perhaps preface portion?
|
||||
|
||||
@@ -198,8 +198,6 @@ $FG,5$$TX+CX,"Bugs? Not really sure."$$FG$
|
||||
|
||||
* $LK,"StrPrintJoin",A="MN:StrPrintJoin"$(,st); With st="\n\\"; (Forgot what this is talking about.)
|
||||
|
||||
* $LK,"BMPRLE4To",A="MN:BMPRLE4To"$() has files_size too big by 108. Fixed?
|
||||
|
||||
|
||||
$FG,5$$TX+CX,"TODO? Not really, just angst."$$FG$
|
||||
* Should these be moved into $LK,"CHashClass",A="MN:CHashClass"$ from $LK,"CMemberLst",A="MN:CMemberLst"$ and $LK,"CHashGlblVar",A="MN:CHashGlblVar"$?
|
||||
@@ -279,8 +277,6 @@ $FG,5$$TX+CX,"Committee Needed"$$FG$
|
||||
|
||||
* Import Intel datasheets so we can use links in $LK,"Code",A="FI:::/Kernel/Mem/PageTables.HC"$ for documentation. I tried a PDF-to-text convertor and it wasn't acceptible.
|
||||
|
||||
* Why are BMP file $LK,"CBGR24",A="MN:CBGR24"$'s wrong? $LK,"::/Adam/Opt/Utils/FileBMP.HC"$.
|
||||
|
||||
* Switch stmt with sparse cases? Maybe, ban sparse switch stmts.
|
||||
|
||||
* Compiler Optimization: Postpone LocalVar init until last possible moment in case of return.
|
||||
|
||||
@@ -48,7 +48,7 @@ $ID,-2$$TR,"Wenceslas"$
|
||||
$ID,2$F64 best_score=43.9944;
|
||||
$ID,-2$$TR,"OSTestSuite"$
|
||||
$ID,2$progress1_tf=0.000;progress2_tf=0.000;
|
||||
progress3_tf=0.000;progress4_tf=224.153;
|
||||
progress3_tf=0.000;progress4_tf=223.150;
|
||||
$ID,-2$$TR,"XCaliber"$
|
||||
$ID,2$I64 best_score=90;
|
||||
I64 msg_flags=2;
|
||||
@@ -60,13 +60,13 @@ $ID,-2$$TR,"Titanium"$
|
||||
$ID,2$I64 best_score=16469;
|
||||
$ID,-2$$TR,"TOSRegen"$
|
||||
$ID,2$progress1_tf=0.000;progress2_tf=0.000;
|
||||
progress3_tf=0.000;progress4_tf=279.256;
|
||||
progress3_tf=0.000;progress4_tf=279.384;
|
||||
$ID,-2$$ID,-2$$TR,"Once"$
|
||||
$ID,2$$TR,"Adam"$
|
||||
$ID,2$$ID,-2$$TR,"User"$
|
||||
$ID,2$$ID,-2$$ID,-2$$TR,"DemoCompany"$
|
||||
$ID,2$$TR,"Game1"$
|
||||
$ID,2$F64 best_score=184.02909;
|
||||
$ID,2$F64 best_score=187.05180;
|
||||
$TR,"SimpleVal"$
|
||||
$ID,2$1244;
|
||||
$ID,2$1245;
|
||||
$ID,-2$$ID,-2$$ID,-2$
|
||||
@@ -323,7 +323,8 @@ public U0 TOSPreRegen()
|
||||
CopyTree("D:/Home/Sup1/Sup1Bin","C:/Home/Sup1/Sup1Bin");
|
||||
Copy("D:/Home/Sup1/Sup1CodeScraps/Comm/TOSSocket*",
|
||||
"C:/Home/Sup1/Sup1CodeScraps/Comm");
|
||||
Copy("D:/Home/Sup1/Sup1Bin/God*","C:/Linux");
|
||||
DelTree("C:/Linux");
|
||||
CopyTree("D:/Linux","C:/Linux");
|
||||
}
|
||||
|
||||
public U0 TOSRegen()
|
||||
|
||||
@@ -12,11 +12,11 @@ I64 CopyVideo(Bool reverb)
|
||||
intensity=0.35;
|
||||
}
|
||||
Del("D:/Tmp/*.SND");
|
||||
DelTree("D:/Tmp/ScrnShots");
|
||||
DirMk("D:/Tmp/ScrnShots");
|
||||
Del("D:/Tmp/*.MV");
|
||||
Silent(old_silent);
|
||||
SndFileCreate("D:/Tmp/Audio",0.115,0.0,WF_SQUARE,delay,intensity);
|
||||
GR2BMPLst("B:/Tmp","+d","D:/Tmp/ScrnShots/VID%05d.BMP.Z");
|
||||
RunFile("~/Sup1/Sup1Snd/SndFile",,
|
||||
"D:/Tmp/AUD%03d.SND",0.115,0.0,1,delay,intensity,0.185);
|
||||
GR2MV("D:/Tmp/VID%03d.MV","B:/Tmp","+d");
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -27,17 +27,15 @@ U0 DelScrnShots()
|
||||
DelTree("B:/Tmp");
|
||||
DirMk("B:/Tmp");
|
||||
Del("D:/Tmp/*.SND");
|
||||
DelTree("D:/Tmp/ScrnShots");
|
||||
DirMk("D:/Tmp/ScrnShots");
|
||||
Del("D:/Tmp/*.MV");
|
||||
Del("C:/Tmp/*.SND");
|
||||
DelTree("C:/Tmp/ScrnShots");
|
||||
DirMk("C:/Tmp/ScrnShots");
|
||||
Del("C:/Tmp/*.MV");
|
||||
Silent(old_silent);
|
||||
}
|
||||
|
||||
public U0 FrameGrabberToggle(Bool sync_tone,Bool tos_theme,
|
||||
Bool reverb,Bool just_audio=FALSE)
|
||||
{//The frame grabber saves BMP files to D:/Tmp/ScrnShots.
|
||||
{//The frame grabber saves GR files to B:/Tmp.
|
||||
static F64 last_time=0;
|
||||
if (tS-last_time>3.0) {
|
||||
last_time=tS;
|
||||
@@ -73,7 +71,7 @@ public U0 JukeLines(I64 start_line,I64 end_line)
|
||||
{//Make movie of many lines of songs, starting at 0.
|
||||
if (!fg_on)
|
||||
FrameGrabberToggle(FALSE,FALSE,FALSE);
|
||||
JukeSongsPuppet("~/Sup1/Sup1Hymns",,start_line*5,end_line*5,1.5);
|
||||
JukeSongsPuppet("~/Sup1/Sup1Hymns",,start_line*5,end_line*5);
|
||||
if (fg_on)
|
||||
FrameGrabberToggle(FALSE,FALSE,TRUE);
|
||||
}
|
||||
@@ -137,33 +135,6 @@ public CDoc *DC2Doc(CDC *dc,I64 dx=0,I64 dy=0,I64 *_total_score=NULL)
|
||||
return doc;
|
||||
}
|
||||
|
||||
public U0 BMP2Doc(U8 *_in_name,U8 *_out_name=NULL)
|
||||
{//Use OCR to make a text DolDoc from BMP file.
|
||||
U8 *in_name,*out_name;
|
||||
I64 dx,dy,score,best_score=I64_MAX;
|
||||
CDC *dc;
|
||||
CDoc *doc;
|
||||
in_name=ExtDft(_in_name,"BMP");
|
||||
if (_out_name)
|
||||
out_name=ExtDft(_out_name,"DD.Z");
|
||||
else
|
||||
out_name=ExtChg(_in_name,"DD.Z");
|
||||
if (dc=BMPRead(in_name)) {
|
||||
for (dy=-3;dy<=4;dy++)
|
||||
for (dx=-3;dx<=4;dx++) {
|
||||
doc=DC2Doc(dc,dx,dy,&score);
|
||||
if (score<best_score) {
|
||||
best_score=score;
|
||||
StrCpy(&doc->filename.name,out_name);
|
||||
DocWrite(doc);
|
||||
}
|
||||
DocDel(doc);
|
||||
}
|
||||
}
|
||||
Free(in_name);
|
||||
Free(out_name);
|
||||
}
|
||||
|
||||
#define MEM_TEST_SIZE 1024*1024
|
||||
U0 MemTest()
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ $ID,-5$
|
||||
|
||||
* Low line count is the highest good, so it is easy to learn the whole thing. Users should see the light at the end of the tunnel. One file system, for example, is better than many file systems.
|
||||
|
||||
* There is a limit of 100,000 lines of code for all time, not including applications and demos. $FG,4$Code comments count$FG$, however. Currently, there are $TX,"82,150",D="DD_TEMPLEOS_LOC"$ lines of code. $FG,4$3rd party libraries are banned$FG$ because they circumvent the intent of this limit. The vision is a Commodore 64 ROM -- a fixed core API that is the only dependency of applications. Dependency on components and libraries creates a hell that is no longer blissful.
|
||||
* There is a limit of 100,000 lines of code for all time, not including applications and demos. $FG,4$Code comments count$FG$, however. Currently, there are $TX,"81,494",D="DD_TEMPLEOS_LOC"$ lines of code. $FG,4$3rd party libraries are banned$FG$ because they circumvent the intent of this limit. The vision is a Commodore 64 ROM -- a fixed core API that is the only dependency of applications. Dependency on components and libraries creates a hell that is no longer blissful.
|
||||
|
||||
* The metric for resolving all TempleOS code governance issues is how fast the compiler compiles itself and the kernel with $LK,"BootHDIns",A="MN:BootHDIns"$(). The $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ language should be changed to optimize this metric, as I did when I changed type casting from prefix standard C to postfix $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$, but we need a rule to prevent degenerating into a brainfuck language.
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ $FG,2$Merge(\"C:/*\",\"D:/*\",\"+r+d\");$FG$ to check my changes.
|
||||
|
||||
* Use $FG,2$<CTRL-ALT-s>$FG$ will capture the scrn as a sprite on the clip. You can save the cmd line doc as text with $FG,2$<CTRL-a>$FG$.
|
||||
|
||||
* You can save a sprite as a $FG,2$.BMP$FG$ file in $FG,2$<CTRL-r>$FG$ on the Sprite BitMap Menu.
|
||||
* You can save a sprite as a $FG,2$.GR$FG$ file in $FG,2$<CTRL-r>$FG$ on the Sprite BitMap Menu.
|
||||
|
||||
* You can eye-dropper colors in the $FG,2$<CTRL-r>$FG$ sprite editor by pressing $FG,2$'c'$FG$. Press $FG,2$'t'$FG$ for transparent.
|
||||
|
||||
@@ -131,7 +131,7 @@ $FG,2$Merge(\"C:/*\",\"D:/*\",\"+r+d\");$FG$ to check my changes.
|
||||
|
||||
* For advanced heap debugging, play with $LK,"_CFG_HEAP_DBG",A="MN:_CFG_HEAP_DBG"$. You're on your own.
|
||||
|
||||
* You can use $LK,"Type",A="MN:Type"$() to display $FG,2$.BMP$FG$ or $FG,2$.GR$FG$ files.
|
||||
* You can use $LK,"Type",A="MN:Type"$() to display $FG,2$.GR$FG$ files.
|
||||
|
||||
* Use $LK,"Man",A="MN:Man"$() to jump to short sym name src code.
|
||||
|
||||
|
||||
@@ -2834,14 +2834,15 @@ $LK,"_CALL_IND",A="FL:::/Kernel/KUtils.HC.Z,332"$
|
||||
$LK,"PURPLE",A="FL:::/Kernel/KernelA.HH,2925"$
|
||||
$LK,"TASKf_BREAK_LOCKED",A="FL:::/Kernel/KernelA.HH,3245"$
|
||||
$LK,"FILEMASK_SRC",A="FL:::/Kernel/KernelA.HH,2308"$
|
||||
| ||||