Skip to content

Commit 77b3e95

Browse files
fix ti_ArchiveHasRoom
Signed-off-by: mateoconlechuga <matthewwaltzis@gmail.com>
1 parent f0b7a14 commit 77b3e95

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/fileioc/fileioc.asm

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ library FILEIOC, 7
5858
; v5 functions
5959
;-------------------------------------------------------------------------------
6060
export ti_ArchiveHasRoom
61-
6261
;-------------------------------------------------------------------------------
6362
; v6 functions
6463
;-------------------------------------------------------------------------------
@@ -1379,21 +1378,22 @@ ti_RclVar:
13791378

13801379
;-------------------------------------------------------------------------------
13811380
ti_ArchiveHasRoom:
1382-
; checks if there is room in the archive before a garbage collect
1381+
; checks if there is room in the archive without triggering a garbage collect.
13831382
; args:
13841383
; sp + 3 : number of bytes to store into the archive
13851384
; return:
13861385
; true if there is room, false if not
13871386
pop de
13881387
ex (sp),hl
13891388
push de
1390-
util_ArchiveHasRoom:
1391-
ld bc,12
1392-
add hl,bc
1389+
.entry:
1390+
ex.s de,hl
1391+
push de
1392+
pop bc
13931393
call ti.FindFreeArcSpot
13941394
ld a,1
13951395
ret nz
1396-
dec a
1396+
xor a,a
13971397
ret
13981398

13991399
;-------------------------------------------------------------------------------
@@ -1627,7 +1627,7 @@ util_Arc_Unarc: ; properly handle garbage collects
16271627
ex hl,de
16281628
call ti.LoadDEInd_s
16291629
ex hl,de
1630-
call util_ArchiveHasRoom
1630+
call ti_ArchiveHasRoom.entry
16311631
jp nz,ti.Arc_Unarc ; gc will not be triggered
16321632
call util_pre_gc_default_handler
16331633
util_pre_gc_handler := $-3

src/fileioc/fileioc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ uint8_t ti_RclVar(uint8_t type, const char *name, void **data);
511511
* without needing to execute a Garbage Collect.
512512
*
513513
* @param[in] num_bytes Number of bytes to be stored to the archive.
514-
* @returns `true` if the bytes can be stored to the archive without a Garbage Collect.
514+
* @returns `true` if the bytes can be stored to the archive without triggering a Garbage Collect.
515515
*/
516516
bool ti_ArchiveHasRoom(uint24_t num_bytes);
517517

0 commit comments

Comments
 (0)