// redraw with current state void op_bignum_redraw(op_bignum_t* bignum) { //// TEST /* u32 i, j; */ /* u8* dat = &(bignum->reg.data[0]); */ // region* r = &(bignum->reg); if(bignum->enable <= 0) { return; } // print value to text buffer op_print(tmpStr, bignum->val); print_dbg("\r\n op_bignum_redraw , "); print_dbg(tmpStr); // blank region_fill(&(bignum->reg), 0); // render text to region region_string_aa(&(bignum->reg), tmpStr, 0, 0, 1); // ascii art /* print_dbg("\r\n"); */ /* for(i=0; i< OP_BIGNUM_PX_H; i++) { */ /* for(j=0; j< OP_BIGNUM_PX_W; j++) { */ /* if(*dat > 0) { print_dbg("#"); } else { print_dbg("_"); } */ /* dat++; */ /* } */ /* print_dbg("\r\n"); */ /* } */ // FIXME: this should NOT go here. //gfx ops should inherit from op_poll, // and only call for a redraw every 100 ms or whatever. // screen_draw_region(r->x, r->y, r->w, r->h, r->data); }
void op_dump(void) { uint16_t* rom = system_getRom(); size_t size = system_getSize(); int i; for (i=0; i<size; i++) { op_print(i + SYSTEM_BASE_PC, rom[i]); printf("\n"); } }
// fill tmp region with new content // given input index and foreground color static void render_line(s16 idx, u8 fg) { const s16 opIdx = net_in_op_idx(idx); region_fill(lineRegion, 0x0); if(opIdx >= 0) { // operator input // build descriptor string clearln(); appendln_idx_lj(opIdx); appendln_char('.'); appendln( net_op_name(opIdx) ); appendln_char('/'); appendln( net_in_name(idx) ); endln(); font_string_region_clip(lineRegion, lineBuf, 4, 0, fg, 0); clearln(); op_print(lineBuf, net_get_in_value(idx)); font_string_region_clip(lineRegion, lineBuf, LINE_VAL_POS_SHORT, 0, fg, 0); } else { // parameter input clearln(); appendln_idx_lj( (int)net_param_idx(idx)); appendln_char('.'); appendln( net_in_name(idx)); endln(); font_string_region_clip(lineRegion, lineBuf, 4, 0, 0xa, 0); clearln(); // op_print(lineBuf, net_get_in_value(idx)); /// FIXME: this is pretty dumb, // params and inputs should just be on separate pages i guess net_get_param_value_string(lineBuf, idx); font_string_region_clip(lineRegion, lineBuf, LINE_VAL_POS_LONG, 0, fg, 0); } // draw something to indicate play mode visibility if(net_get_in_play(idx)) { font_string_region_clip(lineRegion, ".", 0, 0, fg, 0); } // draw something to indicate preset inclusion if(net_get_in_preset(idx)) { font_string_region_clip(lineRegion, ".", 126, 0, fg, 0); } }
// redraw based on provisional preset seleciton void redraw_ins_preset ( void ) { s32 max = net_num_ins() - 1; u8 i=0; u8 n = *pageSelect - 3; u8 enabled; io_t opVal; s32 paramVal; s16 opIdx; print_dbg("\r\n redraw_ins_preset() "); while(i<8) { region_fill(lineRegion, 0x0); opIdx = net_in_op_idx(n); if(n <= max) { enabled = net_get_in_preset(n); if(opIdx < 0 ) { // parameter... clearln(); appendln_idx_lj( (int)net_param_idx(n)); appendln_char('.'); appendln( net_in_name(n)) ; endln(); font_string_region_clip(lineRegion, lineBuf, 4, 0, 0xf, 0); clearln(); if(enabled) { paramVal = preset_get_selected()->ins[n].value; net_get_param_value_string_conversion(lineBuf, net_param_idx(n), paramVal); } else { net_get_param_value_string(lineBuf, n); } font_string_region_clip(lineRegion, lineBuf, LINE_VAL_POS_LONG, 0, 0xf, 0); } else { // op input clearln(); appendln_idx_lj(opIdx); appendln_char('.'); appendln( net_op_name(opIdx) ); appendln_char('/'); appendln( net_in_name(n) ); endln(); font_string_region_clip(lineRegion, lineBuf, 4, 0, 0xf, 0); if(enabled) { opVal = preset_get_selected()->ins[n].value; } else { opVal = net_get_in_value(n); } op_print(lineBuf, opVal); font_string_region_clip(lineRegion, lineBuf, LINE_VAL_POS_SHORT, 0, 0xf, 0); } // draw something to indicate preset inclusion if(enabled) { font_string_region_clip(lineRegion, ".", 126, 0, 0xf, 0); } } render_to_scroll_line(i, 0); ++i; ++n; } // print_dbg("\r\n\r\n"); draw_preset_name(); }
void debug_op(int num, uint8_t pc, uint8_t op) { printf("%5d] ", num); op_print(pc, op); printf("\n"); }