Skip to content

Commit

Permalink
added 'useBinarySection' flag for wasm lang
Browse files Browse the repository at this point in the history
  • Loading branch information
nesbox committed May 26, 2024
1 parent c3218e2 commit d5ef398
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/api/wasm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1355,6 +1355,7 @@ TIC_EXPORT const tic_script EXPORT_SCRIPT(Wasm) =

.keywords = NULL,
.keywordsCount = 0,
.useBinarySection = true,

.demo = {DemoRom, sizeof DemoRom},
.mark = {MarkRom, sizeof MarkRom, "wasmmark.tic"},
Expand Down
7 changes: 1 addition & 6 deletions src/core/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,13 +460,8 @@ void tic_core_tick(tic_mem* tic, tic_tick_data* data)

data->start = data->counter(core->data->data);

// !TODO: move it to wasm module?
// TODO: does where to fetch code from need to be a config option so this isn't hard
// coded for just a single language? perhaps change it later when we have a second script
// engine that uses BINARY?
if (strcmp(config->name,"wasm")==0) {
if (config->useBinarySection)
code = tic->cart.binary.data;
}

done = tic_init_vm(core, code, config);
}
Expand Down
3 changes: 2 additions & 1 deletion src/script.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@ struct tic_script
const char* singleComment;
const char* blockEnd;

const char* const * keywords;
const char* const *keywords;
s32 keywordsCount;

tic_lang_isalnum lang_isalnum;
bool useStructuredEdition;
bool useBinarySection;

s32 api_keywordsCount;
const char** api_keywords;
Expand Down

0 comments on commit d5ef398

Please sign in to comment.