2. Trig Data
2.1. WIP Trig Data Contents
2.1.1. Trig Monome State Data
monolith_page_mstate *mstate;monolith_page_mstate_new(pg, &trig->mstate);monolith_page_mstate_free(&trig->mstate);2.1.2. Trig VM
The actual virtual machine (VM) for trig.
trig_vm tvm;trig_vm_init(&trig->tvm);
<<trig_wire_setter>>2.1.3. Last Selected cell
The last selected. Used to quickly turn it off.
int last_x;
int last_y;trig->last_x = 0;
trig->last_y = 0;2.1.4. Selected Cell
int curcell;trig->curcell = 0;2.1.5. Wire Event Stacks
For 8 wires. See the < See the < Holding the bottom left two keys down causes a reset.
Their states are held in a variable called  When a reset is requested, a flag is set. A reset will
happen at the beginning of the next  It gets cleared at the end of the  Drawing states for the program visualizer, stored in a
32-bit integer. A current and previous state is stored
to determine when to update.
 CLOSED: [2020-04-19 Sun 14:35]
All trig page data is contained in a struct called  CLOSED: [2020-04-19 Sun 14:35]
Trig data is initiatlized with the function  CLOSED: [2020-04-19 Sun 14:35]
Trig data is freed with the funciton wire_evstack wes[8];{
    int w;
    for (w = 0; w < 8; w++) {
        trig->wes[w].nitems = 0;
        trig->wes[w].input = 0;
        trig->wes[w].ref = trig_vm_wire_ref(&trig->tvm, w);
        trig->wes[w].ces = &trig->ces;
        trig->wes[w].last = 0;
    }
}2.1.6. Clock event stacks
clock_evstack ces;trig->ces.nitems = 0;2.1.7. Reset State
reset_state.
uint8_t reset_state;trig->reset_state = 0;2.1.8. Please Reset
trigex and trigrexblock.
trigex block.
uint8_t please_reset;trig->please_reset = 0;2.1.9. Drawing States
uint32_t dstate;
uint32_t dstate_prev;trig->dstate = 0;
trig->dstate_prev = 0;2.2. DONE Trig Typedef Declaration
page_trig_d.
typedef struct page_trig_d page_trig_d;struct page_trig_d {
<<page_trig_contents>>
};2.3. DONE Trig Data Allocation/Initialization
page_trig_init.
static void page_trig_init(monolith_page *pg, page_trig_d *trig);static void page_trig_init(monolith_page *pg, page_trig_d *trig)
{
<<trig_init>>
}2.4. DONE Trig Data Cleanup
page_trig_free.
static void page_trig_cleanup(page_trig_d *trig);static void page_trig_cleanup(page_trig_d *trig)
{
<<trig_cleanup>>
}
prev | home | next