From ed2e5a01f9ee0565d4bf1d26c748d54258300e4f Mon Sep 17 00:00:00 2001 From: Julia <145168563+julia-aph@users.noreply.github.com> Date: Mon, 1 Apr 2024 19:55:30 -0500 Subject: [PATCH] fixing input it almost works sob --- silly.c | 90 +++++++++++++++++++++++++++++++ silly.exe | Bin 0 -> 67171 bytes source/io/ctrl.c | 43 ++++----------- source/io/ctrl.h | 24 ++++----- source/io/input.c | 28 ++++------ source/io/input.h | 2 +- source/io/platforms/win.c | 2 +- source/io/platforms/win.h | 2 +- source/io/platforms/winhandler.c | 18 +++---- source/io/platforms/winhandler.h | 2 +- source/io/term.c | 3 +- source/main.c | 36 +++++++------ test.exe | Bin 80992 -> 80992 bytes 13 files changed, 152 insertions(+), 98 deletions(-) create mode 100644 silly.c create mode 100644 silly.exe diff --git a/silly.c b/silly.c new file mode 100644 index 0000000..6af0d3b --- /dev/null +++ b/silly.c @@ -0,0 +1,90 @@ +#include +#include +#include +#include +#include +#include +#include + +size_t f(float x, int n) +{ + bool is_negative = x < 0; + x = fabsf(x); + + float pow10 = 1; + float factor = n < 0 ? 0.1 : 10; + + size_t decs = 0; + size_t zeroes = 0; + for (int i = 0; decs < FLT_DIG and i < abs(n); i++) { + float next_pow = pow10 * factor; + float mod = fmodf(x * next_pow, 10); + + if (mod == 0) + break; + + pow10 = next_pow; + if (decs != 0 or (int)mod != 0) + decs += 1; + else + zeroes += 1; + } + decs += n * (n < 0); + + uint_fast64_t x_integ = roundf(x * pow10); + + size_t ints = 0; + for (int y = x_integ / pow10; y > 0; y /= 10) + ints += 1; + + size_t len = (is_negative) + (ints == 0) + ints + (decs != 0) + zeroes + decs; + char buf[len + 1]; + buf[len] = 0; + + for (int i = 0; i < decs; i++) { + buf[--len] = x_integ % 10 + 48; + x_integ /= 10; + } + + for (int i = 0; i < zeroes; i++) { + buf[--len] = '0'; + } + + if (decs != 0) + buf[--len] = '.'; + + if (n < 0) for (int i = 0; i < -n; i++) { + buf[--len] = '0'; + } + + if (ints == 0) { + buf[--len] = '0'; + } else for (int i = 0; i < ints; i++) { + buf[--len] = x_integ % 10 + 48; + x_integ /= 10; + } + + if (is_negative) + buf[--len] = '-'; + + printf("%s\n", buf); + printf("\t%f : decs:%llu, ints:%u, zeroes:%u\n", pow10, decs, ints, zeroes); +} + +int main() +{ + f(39, 3); // "39" + f(39.39, 9); // "39.39" + f(0.3939, 3); // "0.394" + f(39e-9, 9); // "0.000000039" + + f(3939, -2); // "3900" + + f(39.99, 0); // 39.99 expected: 40 + f(39.99, 1); // 39. expected: 40 + f(39.99, 2); // 39. expected: 39.99 + + f(-39.3939, 3); // -39.4 expected: -39.394 + + return 0; +} \ No newline at end of file diff --git a/silly.exe b/silly.exe new file mode 100644 index 0000000000000000000000000000000000000000..a02981f0d1563bdee081c26f88a452952e1659e0 GIT binary patch literal 67171 zcmeHw3w&I~dGD;GwdJRlhe14o*I*NwU|F_hBNH5UEv>vFdMtVv+c7y>ODk!^O4{tM zEZM=JARbnPQ>7uTo15l}#%@iT6qh)}&@`0{#SS643Q38fv{8B~T_bX@0wgGn6W#we zkMr2GE7>ZS+w}VUv^z83eDl5Ln{OWH>`~Q@L6*%J%fV-Aim~HJ>GJUJ>A!kWy?E)< zi`lVx-(PmzQThF4^=;v}I~wb3jRo7?O~H&CS&NV9@_@qXVgcZGj3Q6;$^=Y(dx&0C(Brn~MGZA5$H#PeK(DYz3P?^h zh!5f2hL7p;5ZDvW7q8H;J{mVmm>(}%0A^LVpJaQn@Su~!U7U+ua3eqglC0ZDE()( zK!d;kU;X`6E`NVRer3PUUDjV!FnH%P9NhP&J6Vr$-0%F=A28-0aQ*=T!vK3=II-|4 za-(D?BHj4>r^pqOO~@yI@Ik^`vIRkX;NpH)@<~y?T$MX8dO_z~r9`K1($STN(ni$! z`$v+0dAXc^{C&^5brFhy@j+@2F}j5qr%4Q#|A4cV%Kc@_-QNBmRvvJAsCdA+hC@#v zcOB1-B>!SLDX|izLC`KTXrJ_*#hgbX9fL?GXlfKtza1Hog3;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R{&6YzFkZ%XJjR5PuhvJZFt|vLfGZ7i)T`nliHkPv!>w3$)tQL_Z zp&JEy=}T;yJBXfjRVX-Eyu;2nl^N)t0}RuOI^luwbgow3hA~Cqzsl4?F^@m z`YC(LGR_=_GDR2b_|R3!6e{hVfzCA@HCT6;n139(x#u++)RKymWEgMMFtVm;A MO~4}9=%M!i0MssNivR!s literal 0 HcmV?d00001 diff --git a/source/io/ctrl.c b/source/io/ctrl.c index f5617da..f85ed17 100644 --- a/source/io/ctrl.c +++ b/source/io/ctrl.c @@ -12,7 +12,7 @@ #define IO_BUF_SIZE 16 -enum InputType { +enum CtrlType { KEY, AXIS, JOYSTICK, @@ -20,7 +20,7 @@ enum InputType { ESCAPE }; -struct InputRecord { +struct CtrlRecord { u16 id; u8 type; @@ -40,15 +40,15 @@ struct InputRecord { struct timespec timestamp; }; -struct InputBuffer { - struct InputRecord records[IO_BUF_SIZE]; +struct RecordBuffer { + struct CtrlRecord records[IO_BUF_SIZE]; size_t count; pthread_mutex_t mutex; }; -struct InputBuffer NewInputBuffer() +struct RecordBuffer NewInputBuffer() { - struct InputBuffer buf; + struct RecordBuffer buf; buf.count = 0; buf.mutex = PTHREAD_MUTEX_INITIALIZER; return buf; @@ -74,27 +74,6 @@ struct Axis { struct timespec last_released; }; -enum KeyCode { - LEFT, - RIGHT, - SOFT_DROP, - HARD_DROP, - ROTATE_CCW, - ROTATE_CW, - ROTATE_180, - SWAP, - ESC -}; - -enum AxisCode { - VSCROLL, - HSCROLL -}; - -enum JoystickCode { - MOUSE -}; - typedef u32 hashtype; hashtype Hash(void *item, size_t size) { @@ -273,7 +252,7 @@ struct Axis *CtrlGet(Ctrl *ctrl, u16f code, u8f type) return code_bkt->axis; } -void update_key(struct Axis *axis, struct InputRecord *record) +void update_key(struct Axis *axis, struct CtrlRecord *record) { if (record->data.key.is_down) axis->last_pressed = record->timestamp; @@ -283,26 +262,26 @@ void update_key(struct Axis *axis, struct InputRecord *record) axis->data.key.is_down = record->data.key.is_down; } -void update_axis(struct Axis *axis, struct InputRecord *record) +void update_axis(struct Axis *axis, struct CtrlRecord *record) { axis->data.axis.value = record->data.axis.value; axis->last_pressed = record->timestamp; } -void update_joystick(struct Axis *axis, struct InputRecord *record) +void update_joystick(struct Axis *axis, struct CtrlRecord *record) { axis->data.joystick.x = record->data.joystick.x; axis->data.joystick.y = record->data.joystick.y; axis->last_pressed = record->timestamp; } -bool CtrlPoll(Ctrl *ctrl, struct InputBuffer *buf) +bool CtrlPoll(Ctrl *ctrl, struct RecordBuffer *buf) { pthread_mutex_lock(&buf->mutex); pthread_mutex_lock(&ctrl->mutex); for (size_t i = 0; i < buf->count; i++) { - struct InputRecord *rec = &buf->records[i]; + struct CtrlRecord *rec = &buf->records[i]; struct Axis *axis = find_axis(&ctrl->binds, rec->id, rec->type); if (axis == nullptr) diff --git a/source/io/ctrl.h b/source/io/ctrl.h index 0ace76e..e363640 100644 --- a/source/io/ctrl.h +++ b/source/io/ctrl.h @@ -12,7 +12,7 @@ #define IO_BUF_SIZE 16 -enum InputType { +enum CtrlType { KEY, AXIS, JOYSTICK, @@ -20,7 +20,7 @@ enum InputType { ESCAPE }; -struct InputRecord { +struct CtrlRecord { u16 id; u8 type; @@ -40,13 +40,13 @@ struct InputRecord { struct timespec timestamp; }; -struct InputBuffer { - struct InputRecord records[IO_BUF_SIZE]; +struct RecordBuffer { + struct CtrlRecord records[IO_BUF_SIZE]; size_t count; pthread_mutex_t mutex; }; -struct InputBuffer NewInputBuffer(); +struct RecordBuffer NewInputBuffer(); struct Axis { union { @@ -68,7 +68,7 @@ struct Axis { struct timespec last_released; }; -enum KeyCode { +enum CtrlCode { LEFT, RIGHT, SOFT_DROP, @@ -77,15 +77,9 @@ enum KeyCode { ROTATE_CW, ROTATE_180, SWAP, - ESC -}; - -enum AxisCode { + ESC, VSCROLL, - HSCROLL -}; - -enum JoystickCode { + HSCROLL, MOUSE }; @@ -129,4 +123,4 @@ bool CtrlMap(Ctrl *ctrl, u16f code, u16f bind, u8f type); struct Axis *CtrlGet(Ctrl *ctrl, u16f code, u8f type); -bool CtrlPoll(Ctrl *ctrl, struct InputBuffer *buf); \ No newline at end of file +bool CtrlPoll(Ctrl *ctrl, struct RecordBuffer *buf); \ No newline at end of file diff --git a/source/io/input.c b/source/io/input.c index 8713d82..c9b5f59 100644 --- a/source/io/input.c +++ b/source/io/input.c @@ -14,27 +14,23 @@ struct input_args { Ctrl *ctrl; - struct InputBuffer *buf; - pthread_mutex_t mutex; + struct RecordBuffer *buf; }; void *block_input(void *args_ptr) { struct input_args *args = args_ptr; Ctrl *ctrl = args->ctrl; - struct InputBuffer *buf = args->buf; - printf("RECIEVED BUF: %u, %u\n", args->ctrl, args->buf); + struct RecordBuffer *buf = args->buf; + free(args_ptr); while (true) { - printf("\tIN LOOP\n"); bool success; #ifdef _WIN32 success = WindowsBlockInput(buf); #endif - - printf("%llu\n", buf->records[0].timestamp.tv_sec); - + if (!success) { printf("winfail"); exit(1); @@ -44,17 +40,13 @@ void *block_input(void *args_ptr) return nullptr; } -void StartInput(Ctrl *ctrl, struct InputBuffer *buf) +void StartInput(Ctrl *ctrl, struct RecordBuffer *buf) { - printf("START INPUT:%u\n", buf); - struct input_args args = { - .ctrl = ctrl, - .buf = buf, - .mutex = PTHREAD_MUTEX_INITIALIZER - }; - pthread_mutex_lock(&args.mutex); - pthread_create(&ctrl->thread, nullptr, block_input, &args); - pthread_mutex_destroy(); + struct input_args *args = malloc(sizeof(struct input_args)); + args->ctrl = ctrl; + args->buf = buf; + + pthread_create(&ctrl->thread, nullptr, block_input, args); } void JoinInput(Ctrl *ctrl) diff --git a/source/io/input.h b/source/io/input.h index 3253074..08c43eb 100644 --- a/source/io/input.h +++ b/source/io/input.h @@ -8,6 +8,6 @@ #include "ctrl.h" #include "fumotris.h" -void StartInput(Ctrl *ctrl, struct InputBuffer *buf); +void StartInput(Ctrl *ctrl, struct RecordBuffer *buf); void JoinInput(Ctrl *ctrl); \ No newline at end of file diff --git a/source/io/platforms/win.c b/source/io/platforms/win.c index f006dd6..29e9f96 100644 --- a/source/io/platforms/win.c +++ b/source/io/platforms/win.c @@ -21,7 +21,7 @@ bool WindowsInit() return true; } -bool WindowsBlockInput(struct InputBuffer *buf) +bool WindowsBlockInput(struct RecordBuffer *buf) { return WinBlockInput(buf); } diff --git a/source/io/platforms/win.h b/source/io/platforms/win.h index b539fdd..57eee81 100644 --- a/source/io/platforms/win.h +++ b/source/io/platforms/win.h @@ -10,6 +10,6 @@ bool WindowsInit(); -bool WindowsBlockInput(struct InputBuffer *buf); +bool WindowsBlockInput(struct RecordBuffer *buf); bool WindowsWait(double seconds); \ No newline at end of file diff --git a/source/io/platforms/winhandler.c b/source/io/platforms/winhandler.c index b3b901c..43f996e 100644 --- a/source/io/platforms/winhandler.c +++ b/source/io/platforms/winhandler.c @@ -43,7 +43,7 @@ bool WinInitConsole() return SetConsoleMode(windows.input_handle, mode); } -void set_key_record(struct InputRecord *record, KEY_EVENT_RECORD win_key) +void set_key_record(struct CtrlRecord *record, KEY_EVENT_RECORD win_key) { record->type = KEY; record->id = win_key.wVirtualKeyCode; @@ -53,7 +53,7 @@ void set_key_record(struct InputRecord *record, KEY_EVENT_RECORD win_key) record->type = ESCAPE; } -bool set_mouse_record(struct InputRecord *record, MOUSE_EVENT_RECORD win_mouse) +bool set_mouse_record(struct CtrlRecord *record, MOUSE_EVENT_RECORD win_mouse) { switch (win_mouse.dwEventFlags) { case MOUSE_WHEELED: @@ -78,14 +78,14 @@ bool set_mouse_record(struct InputRecord *record, MOUSE_EVENT_RECORD win_mouse) return true; } -void set_window_record(struct InputRecord *record, WINDOW_BUFFER_SIZE_RECORD win_resize) +void set_window_record(struct CtrlRecord *record, WINDOW_BUFFER_SIZE_RECORD win_resize) { record->type = WINDOW; record->data.joystick.x = win_resize.dwSize.X; record->data.joystick.y = win_resize.dwSize.Y; } -bool dispatch_record(struct InputRecord *record, INPUT_RECORD win_record) +bool dispatch_record(struct CtrlRecord *record, INPUT_RECORD win_record) { switch (win_record.EventType) { case KEY_EVENT: @@ -102,18 +102,14 @@ bool dispatch_record(struct InputRecord *record, INPUT_RECORD win_record) return true; } -bool WinBlockInput(struct InputBuffer *buf) +bool WinBlockInput(struct RecordBuffer *buf) { - printf("\twin blocked: %u\n", buf); size_t win_size = IO_BUF_SIZE - buf->count; - printf("\twhar\n"); INPUT_RECORD win_buf[win_size]; DWORD count; - printf("\treading in..\n"); if (!ReadConsoleInput(windows.input_handle, win_buf, win_size, &count)) return false; - printf("\read done\n"); struct timespec now; timespec_get(&now, TIME_UTC); @@ -121,7 +117,7 @@ bool WinBlockInput(struct InputBuffer *buf) pthread_mutex_lock(&buf->mutex); for (size_t i = 0; i < count; i++) { - struct InputRecord record; + struct CtrlRecord record; record.timestamp = now; bool include = dispatch_record(&record, win_buf[i]); @@ -143,9 +139,7 @@ bool WinWait(double seconds) if (!SetWaitableTimer(windows.timer, &duration, 0, NULL, NULL, FALSE)) return false; - printf("about to wait..\n"); DWORD result = WaitForSingleObject(windows.timer, INFINITE); - printf("waitforsingle\n"); if (result != WAIT_OBJECT_0) return false; diff --git a/source/io/platforms/winhandler.h b/source/io/platforms/winhandler.h index 7bb4172..09b75ef 100644 --- a/source/io/platforms/winhandler.h +++ b/source/io/platforms/winhandler.h @@ -13,6 +13,6 @@ bool WinInitTimer(); bool WinInitConsole(); -bool WinBlockInput(struct InputBuffer *buf); +bool WinBlockInput(struct RecordBuffer *buf); bool WinWait(double seconds); \ No newline at end of file diff --git a/source/io/term.c b/source/io/term.c index d920236..2871b56 100644 --- a/source/io/term.c +++ b/source/io/term.c @@ -71,8 +71,7 @@ size_t TermBufToChars(struct TermBuf *term, char *buf, size_t max_chars) u8f last_bg = 0; u8f last_fg = 0; - //size_t filled = snprintf(buf, max_chars, "\x1b[H\x1b[0m"); - size_t filled = snprintf(buf, max_chars, "\x1b[0m"); + size_t filled = snprintf(buf, max_chars, "\x1b[H\x1b[0m"); for(size_t y = 0; y < term->hgt; y++) { for(size_t x = 0; x < term->wid; x++) { diff --git a/source/main.c b/source/main.c index 7541a47..956e572 100644 --- a/source/main.c +++ b/source/main.c @@ -15,7 +15,9 @@ #include "win.h" #endif -const enum KeyCode key_codes[] = { +const size_t code_count = 12; + +const enum CtrlCode codes[12] = { LEFT, RIGHT, SOFT_DROP, @@ -24,9 +26,15 @@ const enum KeyCode key_codes[] = { ROTATE_CW, ROTATE_180, SWAP, - ESC + ESC, + + VSCROLL, + HSCROLL, + + MOUSE }; -const u16f key_binds[] = { + +const u16f binds[12] = { 0x25, 0x27, 0x28, @@ -35,14 +43,13 @@ const u16f key_binds[] = { 'X', 'A', 'C', - 0x1B -}; + 0x1B, -const enum AxisCode axis_codes[] = { - VSCROLL, - HSCROLL + 0, + 1, + + 0 }; -const u16f axis_binds[] = { 0, 1 }; u8 I[16] = { 0, 0, 0, 0, @@ -51,7 +58,7 @@ u8 I[16] = { 0, 0, 0, 0 }; -void Loop(Ctrl *ctrl, struct InputBuffer *in_buf) +void Loop(Ctrl *ctrl, struct RecordBuffer *in_buf) { struct TermBuf term = NewTermBuf(20, 20); struct CharBlk4 term_blks[term.area]; @@ -74,15 +81,14 @@ void Loop(Ctrl *ctrl, struct InputBuffer *in_buf) for (int i = 0; i < 7779997; i++) { CtrlPoll(ctrl, in_buf); - printf("polled\n"); TetrMapToTermBuf(&board, &term); TetrMapToTermBuf(&falling, &term); TermBufToChars(&term, out, out_max); - //puts(out); + puts(out); - printf("%u\n", WindowsWait(0.01)); + WindowsWait(0.5); } } @@ -93,7 +99,7 @@ int main() Ctrl ctrl; NEW_CTRL(ctrl, 13, 13); - for (size_t i = 0; i < 9; i++) { + for (size_t i = 0; i < code_count; i++) { CtrlMap(&ctrl, key_binds[i], key_codes[i], KEY); } for (size_t i = 0; i < 2; i++) { @@ -104,7 +110,7 @@ int main() printf("set controls\n"); - struct InputBuffer in_buf = { + struct RecordBuffer in_buf = { .count = 0, .mutex = PTHREAD_MUTEX_INITIALIZER }; diff --git a/test.exe b/test.ex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