2020-02-15 20:01:48 +00:00
|
|
|
|
U0 PortNop()
|
|
|
|
|
{//Innoculous (reads IRQ Mask) which should take fixed time
|
|
|
|
|
//because it's an ISA-bus standard. It takes 1.0uS-2.0uS.
|
2021-01-29 01:10:11 +00:00
|
|
|
|
InU8(PIC_1_DATA);
|
2020-02-15 20:01:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-02-20 23:40:10 +00:00
|
|
|
|
U0 IntCore0TimerHandler(CTask *)
|
2021-12-11 11:21:22 +00:00
|
|
|
|
{//Called from $LK,"IntCore0TimerHandler",A="FF:::/Kernel/KInterrupts.ZC,IntCore0TimerHandler"$
|
2020-02-20 23:40:10 +00:00
|
|
|
|
I64 i;
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
|
|
|
|
|
if (mp_count > 1)
|
|
|
|
|
while (LBts(&sys_semas[SEMA_SYS_TIMER], 0))
|
2020-02-20 23:40:10 +00:00
|
|
|
|
PAUSE
|
|
|
|
|
lock counts.jiffies++;
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
counts.timer += SYS_TIMER0_PERIOD + 1;
|
|
|
|
|
LBtr(&sys_semas[SEMA_SYS_TIMER], 0);
|
|
|
|
|
for (i = 1; i < mp_count; i++)
|
|
|
|
|
MPInt(I_TIMER, i);
|
|
|
|
|
OutU8(PIC_1, PIC_EOI); //Acknowledge PIC Interrupt
|
2020-02-15 20:01:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
I64 SysTimerRead()
|
2020-02-16 18:37:19 +00:00
|
|
|
|
{//System timer count with overflow already handled.
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
I64 i, res;
|
|
|
|
|
|
2020-02-20 23:40:10 +00:00
|
|
|
|
PUSHFD
|
|
|
|
|
CLI
|
2020-02-21 03:36:04 +00:00
|
|
|
|
if (mp_count > 1)
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
while (LBts(&sys_semas[SEMA_SYS_TIMER], 0))
|
2020-02-20 23:40:10 +00:00
|
|
|
|
PAUSE
|
|
|
|
|
OutU8(PIT_CMD, PIT_CMDF_CHANNEL0); //Latch Timer0
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
if ((i = InU8(PIT_0) + InU8(PIT_0) << 8) == SYS_TIMER0_PERIOD)
|
2020-02-20 23:40:10 +00:00
|
|
|
|
{
|
2020-04-11 02:28:34 +01:00
|
|
|
|
if (InU8(PIC_1) & 1)
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
i = -1;
|
2020-02-20 23:40:10 +00:00
|
|
|
|
}
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
res = counts.timer + SYS_TIMER0_PERIOD - i;
|
|
|
|
|
LBtr(&sys_semas[SEMA_SYS_TIMER], 0);
|
|
|
|
|
|
2020-02-20 23:40:10 +00:00
|
|
|
|
POPFD
|
2020-12-23 23:27:18 +00:00
|
|
|
|
|
2020-02-20 23:40:10 +00:00
|
|
|
|
return res;
|
2020-02-15 20:01:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
I64 TimeCal()
|
|
|
|
|
{
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
static I64 time_stamp_start = 0, timer_start = 0;
|
2020-02-20 23:40:10 +00:00
|
|
|
|
I64 i;
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
|
2020-02-21 03:36:04 +00:00
|
|
|
|
if (time_stamp_start)
|
|
|
|
|
{
|
2020-02-20 23:40:10 +00:00
|
|
|
|
PUSHFD
|
|
|
|
|
CLI
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
counts.time_stamp_freq = SYS_TIMER_FREQ * (TSCGet - time_stamp_start);
|
|
|
|
|
i = SysTimerRead - timer_start;
|
2020-02-20 23:40:10 +00:00
|
|
|
|
if (!i)
|
2021-07-02 00:53:42 +01:00
|
|
|
|
SysErr("Timer Cal Error");
|
2020-02-21 03:36:04 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
counts.time_stamp_freq /= i;
|
|
|
|
|
counts.time_stamp_kHz_freq = counts.time_stamp_freq / 1000;
|
|
|
|
|
counts.time_stamp_calibrated = TRUE;
|
2020-02-20 23:40:10 +00:00
|
|
|
|
}
|
|
|
|
|
POPFD
|
|
|
|
|
}
|
|
|
|
|
PUSHFD
|
|
|
|
|
CLI
|
2020-02-21 03:36:04 +00:00
|
|
|
|
timer_start = SysTimerRead;
|
2020-03-19 20:59:53 +00:00
|
|
|
|
time_stamp_start = TSCGet;
|
2020-02-20 23:40:10 +00:00
|
|
|
|
POPFD
|
2020-12-23 23:27:18 +00:00
|
|
|
|
|
2020-02-20 23:40:10 +00:00
|
|
|
|
return counts.time_stamp_freq;
|
2020-02-15 20:01:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
F64 tS()
|
|
|
|
|
{//Time since boot in seconds as a float.
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
return SysTimerRead / ToF64(SYS_TIMER_FREQ);
|
2020-02-15 20:01:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Bool Blink(F64 Hz=2.5)
|
|
|
|
|
{//Return TRUE, then FALSE, then TRUE at given frequency.
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
if (!Hz)
|
|
|
|
|
return 0;
|
2020-12-23 23:27:18 +00:00
|
|
|
|
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
return ToI64(counts.jiffies * 2 * Hz / JIFFY_FREQ) & 1;
|
2020-02-15 20:01:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
U0 Busy(I64 <EFBFBD>S)
|
|
|
|
|
{//Loosely timed.
|
2020-02-20 23:40:10 +00:00
|
|
|
|
I64 i;
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
|
|
|
|
|
for (i = 0; i < <EFBFBD>S; i++)
|
2020-02-20 23:40:10 +00:00
|
|
|
|
PortNop;
|
2020-02-15 20:01:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
U0 SleepUntil(I64 wake_jiffy)
|
2020-03-01 01:59:50 +00:00
|
|
|
|
{//Not for power-saving. It is to make a program pause without hogging the CPU.
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
Bool old_idle = LBts(&Fs->task_flags, TASKf_IDLE);
|
|
|
|
|
|
|
|
|
|
Fs->wake_jiffy = wake_jiffy;
|
2020-02-20 23:40:10 +00:00
|
|
|
|
Yield;
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
LBEqual(&Fs->task_flags, TASKf_IDLE, old_idle);
|
2020-02-15 20:01:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
U0 Sleep(I64 mS)
|
2020-03-01 01:59:50 +00:00
|
|
|
|
{//Not for power-saving. It is to make a program pause without hogging the CPU.
|
2020-02-20 23:40:10 +00:00
|
|
|
|
if (!mS)
|
|
|
|
|
Yield;
|
|
|
|
|
else
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
SleepUntil(counts.jiffies + mS * JIFFY_FREQ / 1000);
|
2020-02-15 20:01:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
F64 Ona2Freq(I8 ona)
|
2021-12-09 08:35:44 +00:00
|
|
|
|
{//Ona to freq. Ona=60 is 440.0Hz.
|
2020-02-20 23:40:10 +00:00
|
|
|
|
if (!ona)
|
|
|
|
|
return 0;
|
|
|
|
|
else
|
2021-12-09 08:35:44 +00:00
|
|
|
|
return 440.0 / 32 * 2.0 ` (ona / 12.0);
|
2020-02-15 20:01:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
I8 Freq2Ona(F64 freq)
|
2021-12-09 08:35:44 +00:00
|
|
|
|
{//Freq to Ona. 440.0Hz is Ona=60.
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
if (freq > 0)
|
2021-12-09 08:35:44 +00:00
|
|
|
|
return ClampI64(12 * Log2(32.0 / 440.0 * freq), 1, I8_MAX);
|
2020-02-20 23:40:10 +00:00
|
|
|
|
else
|
|
|
|
|
return 0;
|
2020-02-15 20:01:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-02-16 00:49:37 +00:00
|
|
|
|
U0 Sound(I8 ona=0)
|
2020-02-15 20:01:48 +00:00
|
|
|
|
{//Play ona, a piano key num. 0 means rest.
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
I64 period;
|
|
|
|
|
CSoundData *d;
|
|
|
|
|
|
|
|
|
|
if (!Bt(&sys_semas[SEMA_MUTE], 0) && !LBts(&sys_semas[SEMA_SOUND], 0))
|
2020-02-21 03:36:04 +00:00
|
|
|
|
{ //Mutex. Just throw-out if in use
|
|
|
|
|
if (!ona)
|
|
|
|
|
{
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
screencast.ona = ona;
|
2020-02-20 23:40:10 +00:00
|
|
|
|
OutU8(PCSPKR, InU8(PCSPKR) & ~3);
|
2020-02-21 03:36:04 +00:00
|
|
|
|
}
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
else if (ona != screencast.ona)
|
2020-02-21 03:36:04 +00:00
|
|
|
|
{
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
screencast.ona = ona;
|
|
|
|
|
period = ClampI64(SYS_TIMER_FREQ / Ona2Freq(ona), 1, U16_MAX);
|
2020-02-20 23:40:10 +00:00
|
|
|
|
//See $LK,"::/Doc/PIT.DD",A="FI:::/Doc/PIT.DD"$.
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
OutU8(PIT_CMD, PIT_CMDF_CHANNEL2 | PIT_CMDF_OPMODE_SQUARE_WAVE | PIT_CMDF_ACCESS_WORD);
|
|
|
|
|
OutU8(PIT_2, period);
|
|
|
|
|
OutU8(PIT_2, period.u8[1]);
|
|
|
|
|
OutU8(PCSPKR, 3 | InU8(PCSPKR)); //enable speaker
|
2020-02-20 23:40:10 +00:00
|
|
|
|
}
|
2020-02-21 03:36:04 +00:00
|
|
|
|
if (!IsDebugMode && screencast.record)
|
|
|
|
|
{
|
2021-07-06 21:15:26 +01:00
|
|
|
|
d = SysCAlloc(sizeof(CSoundData));
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
d->ona = ona;
|
|
|
|
|
d->tS = tS;
|
|
|
|
|
QueueInsert(d, screencast.sound_head.last);
|
2020-02-20 23:40:10 +00:00
|
|
|
|
}
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
LBtr(&sys_semas[SEMA_SOUND], 0);
|
2020-02-20 23:40:10 +00:00
|
|
|
|
}
|
2020-02-15 20:01:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
Bool ScreenCast(Bool val=ON, Bool just_audio=FALSE, U8 *print_format="B:/Tmp/%X.GR")
|
2020-02-15 20:01:48 +00:00
|
|
|
|
{//WinMgr saves GR files to a dir.
|
2020-02-20 23:40:10 +00:00
|
|
|
|
Bool old_val;
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
|
|
|
|
|
screencast.just_audio = just_audio;
|
|
|
|
|
if (val)
|
|
|
|
|
{
|
|
|
|
|
if (!(old_val = LBtr(&screencast.record, 0)))
|
|
|
|
|
{
|
2020-02-20 23:40:10 +00:00
|
|
|
|
Free(screencast.print_format);
|
2021-07-06 21:15:26 +01:00
|
|
|
|
screencast.print_format = SysStrNew(print_format);
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
screencast.t0_now = Now;
|
|
|
|
|
screencast.sound_head.tS = screencast.t0_tS = tS;
|
|
|
|
|
screencast.sound_head.ona = screencast.ona;
|
|
|
|
|
LBts(&screencast.record, 0);
|
2020-02-20 23:40:10 +00:00
|
|
|
|
}
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
old_val = LBtr(&screencast.record, 0);
|
2020-02-20 23:40:10 +00:00
|
|
|
|
Sound;
|
2020-12-23 23:27:18 +00:00
|
|
|
|
|
2020-02-20 23:40:10 +00:00
|
|
|
|
return old_val;
|
2020-02-15 20:01:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-02-16 00:54:39 +00:00
|
|
|
|
U0 SoundReset()
|
2020-02-15 20:01:48 +00:00
|
|
|
|
{//Fix stuck sound.
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
if (Bt(&sys_semas[SEMA_SOUND], 0))
|
|
|
|
|
{
|
2020-02-20 23:40:10 +00:00
|
|
|
|
Sleep(1);
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
if (Bt(&sys_semas[SEMA_SOUND], 0))
|
|
|
|
|
{
|
2020-02-20 23:40:10 +00:00
|
|
|
|
Sleep(1);
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
LBtr(&sys_semas[SEMA_SOUND], 0);
|
2020-02-20 23:40:10 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Sound;
|
2020-02-15 20:01:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
U0 Beep(I8 ona=62, Bool busy=FALSE)
|
2020-02-15 20:01:48 +00:00
|
|
|
|
{//Make beep at given ona freq.
|
2020-02-20 23:40:10 +00:00
|
|
|
|
Sound(ona);
|
|
|
|
|
if (busy)
|
|
|
|
|
Busy(500000);
|
|
|
|
|
else
|
|
|
|
|
Sleep(500);
|
|
|
|
|
Sound;
|
|
|
|
|
if (busy)
|
|
|
|
|
Busy(200000);
|
|
|
|
|
else
|
|
|
|
|
Sleep(200);
|
2020-02-15 20:01:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Bool Mute(Bool val)
|
|
|
|
|
{//Turn-off sound.
|
2020-02-20 23:40:10 +00:00
|
|
|
|
Bool res;
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
|
|
|
|
|
if (val)
|
|
|
|
|
{
|
2020-02-20 23:40:10 +00:00
|
|
|
|
PUSHFD
|
|
|
|
|
CLI
|
|
|
|
|
Sound;
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
res = LBts(&sys_semas[SEMA_MUTE], 0);
|
2020-02-20 23:40:10 +00:00
|
|
|
|
POPFD
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
res = LBtr(&sys_semas[SEMA_MUTE], 0);
|
2020-12-23 23:27:18 +00:00
|
|
|
|
|
2020-02-20 23:40:10 +00:00
|
|
|
|
return res;
|
2020-02-15 20:01:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Bool IsMute()
|
|
|
|
|
{//Return is-mute flag.
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
return Bt(&sys_semas[SEMA_MUTE], 0);
|
2020-02-15 20:01:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Bool Silent(Bool val=ON)
|
|
|
|
|
{//Turn-off StdOut console text. (Not sound.)
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
return LBEqual(&Fs->display_flags, DISPLAYf_SILENT, val);
|
2020-02-15 20:01:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Bool IsSilent()
|
|
|
|
|
{//Return StdOut turned-off?
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
return Bt(&Fs->display_flags, DISPLAYf_SILENT);
|
2020-02-15 20:01:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-02-15 22:25:33 +00:00
|
|
|
|
Bool SysDebug(Bool val)
|
|
|
|
|
{//Set SysDebug bit you can use while debugging.
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
return LBEqual(&sys_semas[SEMA_DEBUG], 0, val);
|
2020-02-15 20:01:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-02-15 22:25:33 +00:00
|
|
|
|
Bool IsSysDebug()
|
|
|
|
|
{//Return SysDebug bit.
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
return Bt(&sys_semas[SEMA_DEBUG], 0);
|
2020-02-15 20:01:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Bool Raw(Bool val)
|
2020-02-16 04:57:03 +00:00
|
|
|
|
{//Set to direct screen, BLACK & WHITE, non-windowed output mode.
|
2020-02-20 23:40:10 +00:00
|
|
|
|
if (!val)
|
2020-02-23 02:13:59 +00:00
|
|
|
|
LFBFlush;
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
return !LBEqual(&Fs->display_flags, DISPLAYf_NOT_RAW, !val);
|
2020-02-15 20:01:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Bool IsRaw()
|
2020-02-16 04:57:03 +00:00
|
|
|
|
{//Are we in BLACK & WHITE raw screen mode?
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
return !Bt(&Fs->display_flags, DISPLAYf_NOT_RAW);
|
2020-02-15 20:01:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Bool SingleUser(Bool val)
|
|
|
|
|
{//Set single-user mode.
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
return LBEqual(&sys_semas[SEMA_SINGLE_USER], 0, val);
|
2020-02-15 20:01:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Bool IsSingleUser()
|
|
|
|
|
{//Return single-user mode.
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
return Bt(&sys_semas[SEMA_SINGLE_USER], 0);
|
2020-02-15 20:01:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-02-15 22:25:33 +00:00
|
|
|
|
Bool DebugMode(Bool val)
|
2020-02-16 03:37:50 +00:00
|
|
|
|
{//Set debug-mode.
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
return LBEqual(&sys_semas[SEMA_DEBUG_MODE], 0, val);
|
2020-02-15 20:01:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-02-15 22:25:33 +00:00
|
|
|
|
Bool IsDebugMode()
|
2020-02-16 03:37:50 +00:00
|
|
|
|
{//Return debug-mode.
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
return Bt(&sys_semas[SEMA_DEBUG_MODE], 0);
|
2020-02-15 20:01:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2020-02-16 00:54:39 +00:00
|
|
|
|
U0 ProgressBarsReset(U8 *path=NULL)
|
2020-02-15 20:01:48 +00:00
|
|
|
|
{//Reset all progress bars to zero.
|
Reformatted more Kernel files.
Reformatted KMathA.CC, KMathB.CC, KMisc.CC, KTask.CC, KUtils.CC, Kernel.PRJ, KernelA.HH, KernelB.HH, KernelC.HH, KeyDev.CC, MultiProc.CC, PCIBIOS.CC, QuickSort.CC, Sched.CC, StrA.CC, StrB.CC, StrPrint.CC, StrScan.CC.
All top-level Kernel files are now reformatted. Remaining are files in Kernel/ subdirectories.
2020-09-12 22:37:51 +01:00
|
|
|
|
CallExtStr("ProgressBarsRegTf", path);
|
|
|
|
|
MemSet(sys_progresses, 0, sizeof(sys_progresses));
|
2020-02-15 20:01:48 +00:00
|
|
|
|
}
|