Skip to content

Commit b8a2e6a

Browse files
committed
Repair bitmap skewing for 1 to 4 bit BMPs
1 parent 1d35edc commit b8a2e6a

5 files changed

Lines changed: 11 additions & 27 deletions

File tree

build_and_upload.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,24 +39,15 @@ def get_drives():
3939

4040
def directory_hash(dir, extra = []):
4141
sha = hashlib.sha256()
42-
dirtree = sorted(os.walk(dir))
4342

4443
for file in sorted(extra):
4544
print("Hashing "+file)
4645
file = open(file, 'rb')
4746
while chunk := file.read(8192):
4847
sha.update(chunk)
49-
'''
50-
for root, dir, manifest in dirtree:
51-
for file in sorted(manifest):
52-
if(file.endswith('.py')):
53-
print("Hashing "+file+" in "+str(dir))
54-
file = open(os.path.join(root, file), 'rb')
55-
while chunk := file.read(8192):
56-
sha.update(chunk)
57-
'''
48+
49+
# uPy doesn't have os.walk(), and the firmware hash has to match, so this is custom
5850
def _traverse(path):
59-
# listdir returns names; we sort them for consistency with the build script
6051
items = sorted(os.listdir(path))
6152

6253
for item in items:

filesystem/system/util.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@ def directory_hash(dir, extra = []):
1414
sha.update(chunk)
1515

1616
#print(str(dirtree))
17-
'''
18-
for root, dir, manifest in dirtree:
19-
for file in sorted(manifest):
20-
if(file.endswith('.py')):
21-
print("Hashing "+file+" in "+str(dir))
22-
file = open(os.path.join(root, file), 'rb')
23-
while chunk := file.read(8192):
24-
sha.update(chunk)
25-
'''
2617
def _traverse(path):
2718
# listdir returns names; we sort them for consistency with the build script
2819
items = sorted(os.listdir(path))

src/engine.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@
4242
});
4343

4444
const char *firmware_date = "0000-00-00_00:00:00";
45+
const unsigned long long int system_files_digest = 0;
4546
#elif defined(__unix__)
4647
const char *firmware_date = "0000-00-00_00:00:00";
48+
const unsigned long long int system_files_digest = 0;
4749
#elif defined(__arm__)
4850
#include "hardware/clocks.h"
4951
#include "hardware/pll.h"
@@ -58,6 +60,7 @@
5860
// // Set firmware date from generated header file if using Python build script
5961
const char *firmware_date = FIRMWARE_DATE;
6062
// const char *firmware_date = "0000-00-00_00:00:00";
63+
const unsigned long long int system_files_digest = SYSTEM_FILES_DIGEST;
6164
#endif
6265

6366

@@ -484,7 +487,7 @@ MP_DEFINE_CONST_FUN_OBJ_0(engine_firmware_date_obj, engine_firmware_date);
484487
RETURN: int
485488
*/
486489
static mp_obj_t engine_system_files_digest(){
487-
return mp_obj_new_int_from_ull(SYSTEM_FILES_DIGEST);
490+
return mp_obj_new_int_from_ull(system_files_digest);
488491
}
489492
MP_DEFINE_CONST_FUN_OBJ_0(engine_system_files_digest_obj, engine_system_files_digest);
490493

src/nodes/2D/sprite_2d_node.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ void sprite_2d_node_class_draw(mp_obj_t sprite_node_base_obj, mp_obj_t camera_no
120120
engine_draw_blit(sprite_texture, sprite_frame_fb_start_index,
121121
floorf(sprite_rotated_x), floorf(sprite_rotated_y),
122122
sprite_frame_width, sprite_frame_height,
123-
spritesheet_width,
123+
sprite_texture->pixel_stride,
124124
sprite_scale->x.value*camera_zoom,
125125
sprite_scale->y.value*camera_zoom,
126126
-sprite_rotation,
@@ -481,4 +481,4 @@ MP_DEFINE_CONST_OBJ_TYPE(
481481
make_new, sprite_2d_node_class_new,
482482
attr, sprite_2d_node_class_attr,
483483
locals_dict, &sprite_2d_node_class_locals_dict
484-
);
484+
);

src/nodes/empty_node.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ static mp_attr_fun_t empty_node_class_attr(mp_obj_t self_in, qstr attribute, mp_
7979
PARAM: [type={ref_link:Vector3}] [name=position] [value={ref_link:Vector3}]
8080
PARAM: [type={ref_link:Vector3}] [name=rotation] [value={ref_link:Vector3}]
8181
PARAM: [type=int] [name=layer] [value=0 ~ 127]
82-
ATTR: [type=function] [name={ref_link:add_child}] [value=function]
82+
ATTR: [type=function] [name={ref_link:add_child}] [value=function]
8383
ATTR: [type=function] [name={ref_link:get_child}] [value=function]
8484
ATTR: [type=function] [name={ref_link:get_child_count}] [value=function]
8585
ATTR: [type=function] [name={ref_link:node_base_mark_destroy}] [value=function]
@@ -105,7 +105,7 @@ static mp_obj_t empty_node_class_new(const mp_obj_type_t *type, size_t n_args, s
105105
enum arg_ids {child_class, position, rotation, layer};
106106
bool inherited = false;
107107

108-
// If there is one positional argument and it isn't the first
108+
// If there is one positional argument and it isn't the first
109109
// expected argument (as is expected when using positional
110110
// arguments) then define which way to parse the arguments
111111
if(n_args >= 1 && mp_obj_get_type(args[0]) != &vector3_class_type){
@@ -176,7 +176,6 @@ static const mp_rom_map_elem_t empty_node_class_locals_dict_table[] = {
176176
};
177177
static MP_DEFINE_CONST_DICT(empty_node_class_locals_dict, empty_node_class_locals_dict_table);
178178

179-
180179
MP_DEFINE_CONST_OBJ_TYPE(
181180
engine_empty_node_class_type,
182181
MP_QSTR_EmptyNode,
@@ -185,4 +184,4 @@ MP_DEFINE_CONST_OBJ_TYPE(
185184
make_new, empty_node_class_new,
186185
attr, empty_node_class_attr,
187186
locals_dict, &empty_node_class_locals_dict
188-
);
187+
);

0 commit comments

Comments
 (0)