diff options
| author | the lemons <citrons@mondecitronne.com> | 2023-02-05 19:06:16 -0600 |
|---|---|---|
| committer | the lemons <citrons@mondecitronne.com> | 2023-02-05 19:06:16 -0600 |
| commit | 3af50b956b8887b64c3c29b30a0008be866b24c4 (patch) | |
| tree | af2a6f736505585192f852342ae988a297024133 /memview.h | |
initial commit
Diffstat (limited to 'memview.h')
| -rw-r--r-- | memview.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/memview.h b/memview.h new file mode 100644 index 0000000..186bfa8 --- /dev/null +++ b/memview.h @@ -0,0 +1,28 @@ +#ifndef CORE_MEMVIEW_H +#define CORE_MEMVIEW_H + +#include <stdlib.h> +#include <stdint.h> +#include <stdbool.h> +#include <SDL.h> + +#include "procfs.h" + +#ifndef PAGE_WIDTH +#define PAGE_WIDTH (256) +#endif + +#define PAGE_HEIGHT ((PAGE_SIZE * CHAR_BIT) / PAGE_WIDTH) + +uintptr_t to_addr(int x, int y); +void to_pos(uintptr_t addr, int *x, int *y); + +struct viewer; +struct viewer *create_viewer(int fd, SDL_Renderer *renderer); +void destroy_viewer(struct viewer *v); + +void render_pages(struct viewer *v, + int x, int y, int width, int height, double scale, bool refresh); +void pencil(struct viewer *v, int x1, int y1, int x2, int y2, bool bit); + +#endif |
