this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

crash fix in standalone player, tools_zip in a separate source

nesbox a2a5a9ef 39be7a5e

+42 -16
+4 -2
src/api.h
··· 37 37 typedef void(*TraceOutput)(void*, const char*, u8 color); 38 38 typedef void(*ErrorOutput)(void*, const char*); 39 39 typedef void(*ExitCallback)(void*); 40 + typedef u64(*CounterCallback)(void*); 41 + typedef u64(*FreqCallback)(void*); 40 42 41 43 typedef struct 42 44 { ··· 44 46 ErrorOutput error; 45 47 ExitCallback exit; 46 48 47 - u64 (*counter)(void*); 48 - u64 (*freq)(void*); 49 + CounterCallback counter; 50 + FreqCallback freq; 49 51 u64 start; 50 52 51 53 void* data;
+1 -1
src/tic.c
··· 65 65 tic_api_reset(mem); 66 66 } 67 67 68 - TIC80_API void tic80_tick(tic80* tic, tic80_input input, u64 (*counter)(), u64 (*freq)()) 68 + TIC80_API void tic80_tick(tic80* tic, tic80_input input, CounterCallback counter, FreqCallback freq) 69 69 { 70 70 tic_mem* mem = (tic_mem*)tic; 71 71
-13
src/tools.c
··· 26 26 #include <string.h> 27 27 #include <stdlib.h> 28 28 #include <stdio.h> 29 - #include <zlib.h> 30 29 31 30 extern void tic_tool_poke4(void* addr, u32 index, u8 value); 32 31 extern u8 tic_tool_peek4(const void* addr, u32 index); ··· 225 224 226 225 ((u8*)buf)[i] = (u8)strtol(val, NULL, 16); 227 226 } 228 - } 229 - 230 - u32 tic_tool_zip(void* dest, s32 destSize, const void* source, s32 size) 231 - { 232 - unsigned long destSizeLong = destSize; 233 - return compress2(dest, &destSizeLong, source, size, Z_BEST_COMPRESSION) == Z_OK ? destSizeLong : 0; 234 - } 235 - 236 - u32 tic_tool_unzip(void* dest, s32 destSize, const void* source, s32 size) 237 - { 238 - unsigned long destSizeLong = destSize; 239 - return uncompress(dest, &destSizeLong, source, size) == Z_OK ? destSizeLong : 0; 240 227 } 241 228 242 229 char* tic_tool_metatag(const char* code, const char* tag, const char* comment)
+37
src/zip.c
··· 1 + // MIT License 2 + 3 + // Copyright (c) 2017 Vadim Grigoruk @nesbox // grigoruk@gmail.com 4 + 5 + // Permission is hereby granted, free of charge, to any person obtaining a copy 6 + // of this software and associated documentation files (the "Software"), to deal 7 + // in the Software without restriction, including without limitation the rights 8 + // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 + // copies of the Software, and to permit persons to whom the Software is 10 + // furnished to do so, subject to the following conditions: 11 + 12 + // The above copyright notice and this permission notice shall be included in all 13 + // copies or substantial portions of the Software. 14 + 15 + // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 + // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 + // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 + // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 + // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 + // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 + // SOFTWARE. 22 + 23 + #include "tools.h" 24 + 25 + #include <zlib.h> 26 + 27 + u32 tic_tool_zip(void* dest, s32 destSize, const void* source, s32 size) 28 + { 29 + unsigned long destSizeLong = destSize; 30 + return compress2(dest, &destSizeLong, source, size, Z_BEST_COMPRESSION) == Z_OK ? destSizeLong : 0; 31 + } 32 + 33 + u32 tic_tool_unzip(void* dest, s32 destSize, const void* source, s32 size) 34 + { 35 + unsigned long destSizeLong = destSize; 36 + return uncompress(dest, &destSizeLong, source, size) == Z_OK ? destSizeLong : 0; 37 + }