/programs/cmm/lib/collection.h |
---|
67,7 → 67,10 |
:void collection::drop() { |
if (data_start) free(data_start); |
data_size = data_start = element_offset[count] = count = 0; |
data_size = 0; |
data_start = 0; |
element_offset[count] = 0; |
count = 0; |
} |
/programs/cmm/lib/debug.h |
---|
51,4 → 51,12 |
debugln(#tmpch); |
} |
:void debug_n(dword _text, _size) |
{ |
dword res_text = malloc(_size); |
strncpy(res_text, _text, _size-1); |
debugln(res_text); |
free(res_text); |
} |
#endif |
/programs/cmm/lib/keyboard.h |
---|
128,12 → 128,26 |
key_ascii = AH; |
$shr eax,16 |
key_scancode = AL; |
key_modifier = GetKeyModifier(); |
EAX = key_editbox; |
} |
// ECX is a mode: 1 - scancodes, 0 - ascii |
inline fastcall SetKeyboardMode(ECX) |
{ |
$mov eax,66 |
$mov ebx,1 |
//$mov ecx,? |
$int 0x40 |
} |
//get alt/shift/ctrl key status |
inline fastcall dword GetKeyModifier() |
{ |
$mov eax,66 |
$mov ebx,3 |
$int 0x40 |
key_modifier = EAX; |
EAX = key_editbox; |
} |
#endif |
/programs/cmm/lib/patterns/history.h |
---|
3,6 → 3,7 |
struct _history { |
collection items; |
int active; |
void clear(); |
int add(); |
int back(); |
int forward(); |
35,4 → 36,10 |
dword _history::current() |
{ |
return items.get(active-1); |
} |
} |
:void _history::clear() |
{ |
items.drop(); |
active=0; |
} |