Skip to content
Open
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
10 changes: 6 additions & 4 deletions src/graphx/graphx.asm
Original file line number Diff line number Diff line change
Expand Up @@ -388,10 +388,12 @@ gfx_AllocSprite:
inc de ; de = width * height + 2
push de
call _indcallHL ; hl = malloc(width * height + 2)
pop de ; de = width * height + 2
add hl, de ; this should never carry
sbc hl, de ; check if malloc failed (hl == 0)
pop de ; e = width, d = height
pop de
pop de ; e = width, d = height, ude = unknown
; check if malloc failed (hl == 0)
add hl, de
or a, a
sbc hl, de
ret z ; abort if malloc failed
ld (hl), de ; store width and height
ret
Expand Down
Loading