TGI_ERR_INV_ARG ; Invalid function argument
TGI_ERR_INV_FUNC ; Function not supported
TGI_ERR_INV_FONT ; Font file is invalid
- TGI_ERR_NO_MEM ; Not enough memory
+ TGI_ERR_NO_RES ; Out of resources (memory, handles, ...)
TGI_ERR_UNKNOWN ; Unknown error
TGI_ERR_COUNT ; Special: Number of error messages
#define TGI_ERR_INV_ARG 5 /* Invalid function argument */
#define TGI_ERR_INV_FUNC 6 /* Function not supported */
#define TGI_ERR_INV_FONT 7 /* Font file is invalid */
-#define TGI_ERR_NO_MEM 8 /* Out of memory */
+#define TGI_ERR_NO_RES 8 /* Out of resources */
sbc #$10
bcs search
- ; No free IOCB
- lda #TGI_ERR_NO_IOCB
+ ; Out of resources
+nores: lda #TGI_ERR_NO_RES
sta error
rts
lda RAMTOP
sbc #>mem_needed
cmp APPMHI + 1
- bcc nomem
+ bcc nores
bne switch
cpy APPMHI
- bcs switch
-
- ; No memory
-nomem: lda #TGI_ERR_NO_MEM
- sta error
- rts
+ bcc nores
; Switch into graphics mode
switch: lda #OPEN
msg5: .asciiz "Invalid function argument"
msg6: .asciiz "Function not supported"
msg7: .asciiz "Invalid font file"
-msg8: .asciiz "Out of memory"
+msg8: .asciiz "Out of resources"
msg9: .asciiz "Unknown error"
Font = malloc (H.size);
if (Font == 0) {
/* Out of memory */
- tgi_error = TGI_ERR_NO_MEM;
+ tgi_error = TGI_ERR_NO_RES;
goto LoadError;
}