void startdebugger() { static int firsttime = 1; curblank = 0x40; debuggeron = 1; #ifdef __MSDOS__ __dpmi_regs regs; regs.x.ax = 0x0003; __dpmi_int(0x10, ®s); #endif // __MSDOS__ if (firsttime) { initscr(); cbreak(); noecho(); intrflush(stdscr, FALSE); keypad(stdscr, TRUE); /* set up colors */ start_color(); init_pair(cp_white, COLOR_WHITE, COLOR_BLACK); init_pair(cp_magenta, COLOR_MAGENTA, COLOR_BLACK); init_pair(cp_red, COLOR_RED, COLOR_BLACK); init_pair(cp_cyan, COLOR_CYAN, COLOR_BLACK); init_pair(cp_green, COLOR_GREEN, COLOR_BLACK); init_pair(cp_yellow, COLOR_YELLOW, COLOR_BLACK); init_pair(cp_white_on_blue, COLOR_WHITE, COLOR_BLUE); } execut = 0; if (firsttime) { startdisplay(); debugwin = newwin(20, 77, 2, 1); wbkgd(debugwin, CP(cp_white_on_blue) | ' '); // wattrset(debugwin, CP(cp_white_on_blue)); scrollok(debugwin, TRUE); idlok(debugwin, TRUE); firsttime = 0; } else { touchwin(stdscr); touchwin(debugwin); refresh(); wrefresh(debugwin); } debugloop(); cleardisplay(); // "pushad / call LastLog / ... / popad" elided SaveOAMRamLog(); if (execut == 1) { start65816(); return; } endprog(); return; }
// process the audio void Loop::DoProcess() { u32 diff = 0; // figure out if we're at the swing point diff = globals->counter - (globals->beat * 3600 / globals->currentsong->bpm); // are we playing a sample? if ((sbSample->GetChoice() != 0xFF) && kramHandleValid(handle)) { // if we have notes, then things are handled a bit differently if (notes) { beat = globals->beat % numnotes; debugloop("diff: %ld", diff); if ((diff >= notes[beat]->swing) && (lastbeat != globals->beat)) { debug("Swing detected: %ld", diff); // update the parameters UpdateParametersNotes(); lastbeat = globals->beat; } // if cont is not on if (notes[beat]->noteEnd != note_continue && notes[beat]->noteEnd != note_feed) { debug("Pos: %d > %ld > %ld", kramGetPos(handle), (GetSize() / nbBeats->GetValue()) * (notes[beat]->offset - 1), (GetSize() / nbBeats->GetValue()) * (notes[beat]->offset)); // if cut is on, then set vol to zero if (notes[beat]->noteEnd == note_stretch) { UpdateParametersNotes(); } // are we past the end of this note, or before the beginning? else if ((kramGetPos(handle) < (GetSize() / nbBeats->GetValue()) * (notes[beat]->offset - 1)) || (kramGetPos(handle) > (GetSize() / nbBeats->GetValue()) * (notes[beat]->offset))) { // if cut is on, then set vol to zero if (notes[beat]->noteEnd == note_cut) { kramSetVol(handle, 0); } else if (notes[beat]->noteEnd == note_loop) { // if loop is on, then set us to the start of this note again (call update parameters) UpdateParametersNotes(); } } } } else { // otherwise it's simple style parameter updates beat = globals->beat % nbBeats->GetValue(); debugloop("Diff: %ld", diff); if ((diff >= (u32)(nbSwing->GetValue() * (beat | 1))) && (lastbeat != globals->beat)) { UpdateParameters(); lastbeat = globals->beat; } } } debugloop("Beat: %d", beat);