bool MarksJuliafpSetup() { if (g_params[2] < 1) { g_params[2] = 1; } g_c_exponent = (int)g_params[2]; g_float_param = &g_param_z1; g_old_z = *g_float_param; if (g_c_exponent > 3) { cpower(&g_old_z, g_c_exponent-1, &g_marks_coefficient); } else if (g_c_exponent == 3) { g_marks_coefficient.x = sqr(g_old_z.x) - sqr(g_old_z.y); g_marks_coefficient.y = g_old_z.x * g_old_z.y * 2; } else if (g_c_exponent == 2) { g_marks_coefficient = g_old_z; } else if (g_c_exponent < 2) { g_marks_coefficient.x = 1.0; g_marks_coefficient.y = 0.0; } get_julia_attractor(0.0, 0.0); // an attractor? return true; }
void deepsleep(void) { static int power_pl; ulong xsp, xlink; // ulong mecr; ulong clkd; vlong savedtod; extern void power_resume(void); power_pl = splhi(); xlink = getcallerpc(&xlink); /* Power down */ pcmciapower(0); irpower(0); audiopower(0); screenpower(0); µcpower(0); iprint("entering suspend mode, sp = %#p, pc = 0x%lux, psw = 0x%ux\n", &xsp, xlink, power_pl); // dumpitall(); delay(1000); uartpower(0); rs232power(0); clockpower(0); gpiosave(&savedgpioregs, gpioregs); intrcpy(&savedintrregs, intrregs); cacheflush(); delay(50); if(setpowerlabel()){ /* return here with mmu back on */ trapresume(); gpiorestore(gpioregs, &savedgpioregs); delay(50); intrcpy(intrregs, &savedintrregs); if(intrregs->icip & (1<<IRQgpio0)){ // don't want to sleep now. clear on/off irq. gpioregs->edgestatus = (1<<IRQgpio0); intrregs->icip = (1<<IRQgpio0); } clkd = clockpower(1); gpclkregs->r0 = 1<<0; todset(savedtod + clkd * TODFREQ, 0LL, 0); resetsuspendtimer(); rs232power(1); uartpower(1); delay(100); xlink = getcallerpc(&xlink); iprint("\nresuming execution, sp = %#p, pc = 0x%lux, psw = 0x%ux\n", &xsp, xlink, splhi()); // dumpitall(); delay(1000); // irpower(1); audiopower(1); µcpower(1); screenpower(1); pcmciapower(1); splx(power_pl); return; } cacheflush(); delay(100); savedtod = todget(nil); power_down(); /* no return */ }