Skip to content

Commit 0328237

Browse files
Fix boot_GetDate, optimize gfx_Polygon
1 parent ed8f1e1 commit 0328237

File tree

2 files changed

+21
-33
lines changed

2 files changed

+21
-33
lines changed

src/ce/tice.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ void *memset_fast(void *ptr, int c, size_t num);
215215
* @param month Month to set
216216
* @param year Year to set
217217
*/
218-
void boot_SetDate(uint8_t day, uint8_t month, uint24_t year);
218+
void boot_SetDate(uint8_t day, uint8_t month, uint16_t year);
219219

220220
/**
221221
* Gets the calculator's date
@@ -224,7 +224,7 @@ void boot_SetDate(uint8_t day, uint8_t month, uint24_t year);
224224
* @param month Pointer to variable to store month
225225
* @param year Pointer to variable to store year
226226
*/
227-
void boot_GetDate(uint8_t *day, uint8_t *month, uint24_t *year);
227+
void boot_GetDate(uint8_t *day, uint8_t *month, uint16_t *year);
228228

229229
/**
230230
* Sets the calculator's time

src/graphx/graphx.asm

Lines changed: 19 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3647,55 +3647,43 @@ _: ld (LineType0_SMC),hl \.r
36473647
push ix
36483648
ld ix,0
36493649
add ix,sp
3650-
lea hl,ix+-9
36513650
ld sp,hl
3652-
ld bc,(ix+6)
3653-
ld (ix+-3),bc
3654-
ld hl,(ix+9)
3655-
dec hl
3656-
ld (ix+9),hl
3657-
ld iy,(ix+-3)
3651+
ld iy,(ix+6)
36583652
jr StartPolygonLoop
36593653
PolygonLoop:
3660-
lea hl,iy+9
3661-
ld bc,(hl)
3654+
push iy
3655+
ld bc,(iy+9)
36623656
push bc
3663-
lea hl,iy+6
3664-
ld bc,(hl)
3657+
ld bc,(iy+6)
36653658
push bc
3666-
lea hl,iy+3
3667-
ld bc,(hl)
3659+
ld bc,(iy+3)
36683660
push bc
3669-
lea hl,iy+0
3670-
ld bc,(hl)
3661+
ld bc,(iy+0)
36713662
push bc
36723663
call 0
36733664
LineType0_SMC =$-3
3674-
lea hl,ix+-9
3675-
ld sp,hl
3676-
ld iy,(ix+-3)
3665+
pop bc
3666+
pop bc
3667+
pop bc
3668+
pop bc
3669+
pop iy
36773670
lea iy,iy+6
3678-
ld (ix+-3),iy
3671+
StartPolygonLoop:
36793672
ld hl,(ix+9)
36803673
dec hl
36813674
ld (ix+9),hl
3682-
StartPolygonLoop:
36833675
add hl,bc
36843676
or a,a
36853677
sbc hl,bc
36863678
jr nz,PolygonLoop
3687-
lea hl,iy+3
3688-
ld bc,(hl)
3679+
ld bc,(iy+3)
36893680
push bc
3690-
lea hl,iy+0
3691-
ld bc,(hl)
3681+
ld bc,(iy+0)
36923682
push bc
36933683
ld iy,(ix+6)
3694-
lea hl,iy+3
3695-
ld bc,(hl)
3684+
ld bc,(iy+3)
36963685
push bc
3697-
lea hl,iy+0
3698-
ld bc,(hl)
3686+
ld bc,(iy+0)
36993687
push bc
37003688
call 0
37013689
LineType1_SMC =$-3
@@ -3710,7 +3698,7 @@ _Reserved:
37103698

37113699
;-------------------------------------------------------------------------------
37123700
_LZDecompressSprite_Deprecated:
3713-
; Decompresses a sprite that is LZ77 compressed from ConvPNG
3701+
; Decompresses a sprite that is LZ77 compressed from ConvPNG (Deprecated)
37143702
ld hl,-23
37153703
call __frameset
37163704
ld hl,(ix+6)
@@ -4274,7 +4262,7 @@ ff_forloop1start:
42744262
ff_xmax_smc =$+1
42754263
ld hl,0
42764264

4277-
jr +_ ; for (; (unsigned)x<=xmax && gfx_getpixel(x, y) == ov; x++) { gfx_setpixel(x, y); }
4265+
jr +_ ; for (; (unsigned)x<=xmax && p(x, y) == ov; x++) { s(x, y); }
42784266
ff_forloop1:
42794267
ff_newcolor1_smc =$+1
42804268
ld a,0
@@ -4350,7 +4338,7 @@ ff_badpush1:
43504338
ld (iy+6),a
43514339
lea iy,iy+8
43524340
ff_skip:
4353-
ff_badpush2: ; skip: for (x++; (unsigned)x<=x2 && gfx_getpixel(x, y) != ov; x++);
4341+
ff_badpush2: ; skip: for (x++; (unsigned)x<=x2 && p(x, y) != ov; x++);
43544342
ld bc,(ix+6)
43554343
inc bc
43564344

0 commit comments

Comments
 (0)