Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix typos #2242

Merged
merged 1 commit into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ if(BUILD_DEMO_CARTS)

endforeach(CART_FILE)

# we need to build these separatly combining both the project
# we need to build these separately combining both the project
# and the external WASM binary chunk since projects do not
# include BINARY chunks

Expand Down
2 changes: 1 addition & 1 deletion build/baremetalpi/toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ message("Crosscompiler path is ${BINUTILS_PATH}")
get_filename_component(ARM_TOOLCHAIN_DIR ${BINUTILS_PATH} DIRECTORY)

# removed squirrel language as it doesn't seem to compile under arm. Needs investigation.
# More investigation: Squirrel builds correcly but the linked give these kinds of error:
# More investigation: Squirrel builds correctly but the linked give these kinds of error:
# arm-none-eabi-ld: error: kernel8-32.elf uses VFP register arguments, ../../build/lib/libsquirrel.a(sqapi.cpp.obj) does not
# Even more investigation: turns out i was only setting CMAKE_C_FLAGS and not CMAKE_CXX_FLAGS. So C++ stuff was building without arm/rpi proper flags, VFP-related-stuff in particular.
# Now squirrel works.
Expand Down
8 changes: 4 additions & 4 deletions demos/car.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
point={x=0,y=0,z=300}
fov=100
mesh={} -- Table that contains all the 3D points
polygon={} -- Table that contains all conections of 3D points to create triangle polygons, with their texture specified too
zorder={} -- Tabe used to know the rendering order of the triangles
polygon={} -- Table that contains all connections of 3D points to create triangle polygons, with their texture specified too
zorder={} -- Table used to know the rendering order of the triangles
rspeed=.1 -- Rotation speed, you can change it
tspeed=10 -- Translation speed, you can change it

Expand Down Expand Up @@ -147,7 +147,7 @@ function calculateMeshUV()
end
end

-- I made this up but ot works... it gives the avarage of the depth of the three points of each triangle, it works good enough to know witch triangles to draw first (the further ones)
-- I made this up but not works... it gives the average of the depth of the three points of each triangle, it works good enough to know witch triangles to draw first (the further ones)
function calculateZOrder()
m=mesh
for i,p in pairs(polygon) do
Expand All @@ -156,7 +156,7 @@ function calculateZOrder()
end
end

-- Once calcuated the zorder you need to update the zorder table with those values
-- Once calculated the zorder you need to update the zorder table with those values
-- Why do we need this values in another table? well... lua can sort this table and now we have the order in witch to draw the triangles
function updateZOrder(polygon,zor)
for i,z in pairs(zorder) do
Expand Down
4 changes: 2 additions & 2 deletions demos/fire.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ x=120
y=120

particle = {}
palete = {14,9,6,3,10,15}
palette = {14,9,6,3,10,15}

function addParticle(x,y)
local p = {}
Expand All @@ -30,7 +30,7 @@ function ticParticle()
p.t = p.t + 1
s = math.log(p.t / 2.0)
s2 = s/2.0
c = palete[math.ceil(p.t/70)]
c = palette[math.ceil(p.t/70)]
p.x = p.x + p.dx
p.y = p.y + p.dy

Expand Down
2 changes: 1 addition & 1 deletion demos/janetdemo.janet
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# script: janet
# strict: true

# Unlike other langauges, the tic80 API
# Unlike other languages, the tic80 API
# is provided as a module.
(import tic80)

Expand Down
2 changes: 1 addition & 1 deletion demos/palette.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- title: palette demo
-- author: Nesbox
-- desc: how to switch palatte in runtime
-- desc: how to switch palette in runtime
-- script: lua
-- input: gamepad

Expand Down
2 changes: 1 addition & 1 deletion demos/quest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ end
local p1,boss,golem1,golem2

local function Init()
-- detect if run for the fisrt time
-- detect if run for the first time
if not firstRun then return end
firstRun=false

Expand Down
2 changes: 1 addition & 1 deletion include/tic80.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ typedef struct
u8 y;
};

// releative values
// relative values
struct
{
s8 rx;
Expand Down
2 changes: 1 addition & 1 deletion src/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ enum
"The map can be up to 240 cells wide by 136 deep.\n" \
"This function will draw the desired area of the map to a specified screen position.\n" \
"For example, map(5,5,12,10,0,0) will draw a 12x10 section of the map, " \
"starting from map co-ordinates (5,5) to screen position (0,0).\n" \
"starting from map coordinates (5,5) to screen position (0,0).\n" \
"The map function's last parameter is a powerful callback function " \
"for changing how map cells (sprites) are drawn when map is called.\n" \
"It can be used to rotate, flip and replace sprites while the game is running.\n" \
Expand Down
2 changes: 1 addition & 1 deletion src/api/python.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ static bool setup_core(pkpy_vm* vm, tic_core* core)
return true;
}

//index should be a postive index
//index should be a positive index
static int prepare_colorindex(pkpy_vm* vm, int index, u8 * buffer)
{
if (pkpy_is_int(vm, index))
Expand Down
2 changes: 1 addition & 1 deletion src/api/scheme.c
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ static const char* const SchemeKeywords [] =
"not", "number->string", "odd?", "even?", "zero?",
"append", "list-ref", "assoc", "assq", "member", "memq", "memv",
"tree-memq", "string?", "string-length", "character?",
"number?", "integer?", "real?", "rationnal?", "rationalize",
"number?", "integer?", "real?", "rational?", "rationalize",
"numerator", "denominator", "random", "random-state",
"random-state->list", "random-state?", "complex?",
"real-part", "imag-part", "number->string", "vector?",
Expand Down
4 changes: 2 additions & 2 deletions src/api/wasm.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#include <ctype.h>

// Avoid redefining u* ans s*
// Avoid redefining u* and s*
#define d_m3ShortTypesDefined 1
typedef int8_t i8;
typedef int16_t i16;
Expand Down Expand Up @@ -366,7 +366,7 @@ m3ApiRawFunction(wasmtic_btnp)
tic_core* core = getWasmCore(runtime);

// -1 is the "default" placeholder for index, hold, and period but the TIC side API
// knows this so we don't need to do any transation, we can just pass the -1 values
// knows this so we don't need to do any transaction, we can just pass the -1 values
// straight thru

m3ApiReturn(tic_api_btnp((tic_mem *)core, index, hold, period));
Expand Down
2 changes: 1 addition & 1 deletion src/core/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ void tic_core_tick(tic_mem* tic, tic_tick_data* data)
data->start = data->counter(core->data->data);

// TODO: does where to fetch code from need to be a config option so this isn't hard
// coded for just a single langage? perhaps change it later when we have a second script
// 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) {
code = tic->cart.binary.data;
Expand Down
22 changes: 11 additions & 11 deletions src/core/sound.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#define ENVELOPE_FREQ_SCALE 2
#define SECONDS_PER_MINUTE 60
#define NOTES_PER_MUNUTE (TIC80_FRAMERATE / NOTES_PER_BEAT * SECONDS_PER_MINUTE)
#define NOTES_PER_MINUTE (TIC80_FRAMERATE / NOTES_PER_BEAT * SECONDS_PER_MINUTE)
#define PIANO_START 8

static const u16 NoteFreqs[] = { 0x10, 0x11, 0x12, 0x13, 0x15, 0x16, 0x17, 0x18, 0x1a, 0x1c, 0x1d, 0x1f, 0x21, 0x23, 0x25, 0x27, 0x29, 0x2c, 0x2e, 0x31, 0x34, 0x37, 0x3a, 0x3e, 0x41, 0x45, 0x49, 0x4e, 0x52, 0x57, 0x5c, 0x62, 0x68, 0x6e, 0x75, 0x7b, 0x83, 0x8b, 0x93, 0x9c, 0xa5, 0xaf, 0xb9, 0xc4, 0xd0, 0xdc, 0xe9, 0xf7, 0x106, 0x115, 0x126, 0x137, 0x14a, 0x15d, 0x172, 0x188, 0x19f, 0x1b8, 0x1d2, 0x1ee, 0x20b, 0x22a, 0x24b, 0x26e, 0x293, 0x2ba, 0x2e4, 0x310, 0x33f, 0x370, 0x3a4, 0x3dc, 0x417, 0x455, 0x497, 0x4dd, 0x527, 0x575, 0x5c8, 0x620, 0x67d, 0x6e0, 0x749, 0x7b8, 0x82d, 0x8a9, 0x92d, 0x9b9, 0xa4d, 0xaea, 0xb90, 0xc40, 0xcfa, 0xdc0, 0xe91, 0xf6f, 0x105a, 0x1153, 0x125b, 0x1372, 0x149a, 0x15d4, 0x1720, 0x1880 };
Expand All @@ -43,32 +43,32 @@ static_assert(sizeof(tic_music_state) == 4, "tic_music_s

static s32 getTempo(tic_core* core, const tic_track* track)
{
return core->state.music.tempo < 0
? track->tempo + DEFAULT_TEMPO
return core->state.music.tempo < 0
? track->tempo + DEFAULT_TEMPO
: core->state.music.tempo;
}

static s32 getSpeed(tic_core* core, const tic_track* track)
{
return core->state.music.speed < 0
? track->speed + DEFAULT_SPEED
return core->state.music.speed < 0
? track->speed + DEFAULT_SPEED
: core->state.music.speed;
}

static s32 tick2row(tic_core* core, const tic_track* track, s32 tick)
{
// BPM = tempo * 6 / speed
s32 speed = getSpeed(core, track);
return speed
? tick * getTempo(core, track) * DEFAULT_SPEED / speed / NOTES_PER_MUNUTE
return speed
? tick * getTempo(core, track) * DEFAULT_SPEED / speed / NOTES_PER_MINUTE
: 0;
}

static s32 row2tick(tic_core* core, const tic_track* track, s32 row)
{
s32 tempo = getTempo(core, track);
return tempo
? row * getSpeed(core, track) * NOTES_PER_MUNUTE / tempo / DEFAULT_SPEED
? row * getSpeed(core, track) * NOTES_PER_MINUTE / tempo / DEFAULT_SPEED
: 0;
}

Expand Down Expand Up @@ -118,7 +118,7 @@ static void runEnvelope(blip_buffer_t* blip, const tic_sound_register* reg, tic_

static void runNoise(blip_buffer_t* blip, const tic_sound_register* reg, tic_sound_register_data* data, s32 end_time, u8 volume)
{
// phase is noise LFSR, which must never be zero
// phase is noise LFSR, which must never be zero
if (data->phase == 0)
data->phase = 1;

Expand Down Expand Up @@ -408,7 +408,7 @@ static void processMusic(tic_mem* memory)
s32 note = channel->note;
s32 pitch = 0;

// process chord commmand
// process chord command
{
s32 chord[] =
{
Expand All @@ -420,7 +420,7 @@ static void processMusic(tic_mem* memory)
note += chord[cmdData->chord.tick % (cmdData->chord.note2 == 0 ? 2 : 3)];
}

// process vibrato commmand
// process vibrato command
if (cmdData->vibrato.period && cmdData->vibrato.depth)
{
static const s32 VibData[] = { 0x0, 0x31f1, 0x61f8, 0x8e3a, 0xb505, 0xd4db, 0xec83, 0xfb15, 0x10000, 0xfb15, 0xec83, 0xd4db, 0xb505, 0x8e3a, 0x61f8, 0x31f1, 0x0, 0xffffce0f, 0xffff9e08, 0xffff71c6, 0xffff4afb, 0xffff2b25, 0xffff137d, 0xffff04eb, 0xffff0000, 0xffff04eb, 0xffff137d, 0xffff2b25, 0xffff4afb, 0xffff71c6, 0xffff9e08, 0xffffce0f };
Expand Down
2 changes: 1 addition & 1 deletion src/studio/editors/code.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static void packState(Code* code)
}
}

//if pos_undo is true, we set the position to the first charcter
//if pos_undo is true, we set the position to the first character
//that is different between the current source and the state (wanted undo behavior)
//otherwise we set the position to the stored location (wanted redo behavior)
//in either case if no change was detected we do not change the position
Expand Down
Loading
Loading