FshVar Functions now catch Out Of Bounds Exceptions
This commit is contained in:
parent
3e1451c007
commit
94ceaddf3b
BIN
bin/FSHa.8xp
BIN
bin/FSHa.8xp
Binary file not shown.
|
|
@ -7,6 +7,9 @@ fshvarset:
|
|||
push bc
|
||||
push de
|
||||
push hl
|
||||
ld bc, FshVarsSize / 2 + 1
|
||||
call cpBCDE
|
||||
jr nc, fshvarsetOOBException
|
||||
ld bc, FshVars
|
||||
ex de, hl
|
||||
add hl, hl
|
||||
|
|
@ -14,6 +17,7 @@ fshvarset:
|
|||
ld (hl), e
|
||||
inc hl
|
||||
ld (hl), d
|
||||
fshvarsetOOBException:
|
||||
pop hl
|
||||
pop de
|
||||
pop bc
|
||||
|
|
@ -28,6 +32,10 @@ fshvarset:
|
|||
fshvarget:
|
||||
push bc
|
||||
push de
|
||||
ld hl, 0
|
||||
ld bc, FshVarsSize / 2 + 1
|
||||
call cpBCDE
|
||||
jr nc, fshvargetOOBException
|
||||
ld bc, FshVars
|
||||
ex de, hl
|
||||
add hl, hl
|
||||
|
|
@ -36,6 +44,7 @@ fshvarget:
|
|||
inc hl
|
||||
ld d, (hl)
|
||||
ex de, hl
|
||||
fshvargetOOBException:
|
||||
pop de
|
||||
pop bc
|
||||
ret
|
||||
|
|
@ -49,6 +58,9 @@ fshvarcpy:
|
|||
push bc
|
||||
push de
|
||||
push hl
|
||||
ld bc, FshVarsSize / 2 + 1
|
||||
call cpBCDE
|
||||
jr nc, fshvarcpyOOBException
|
||||
ld bc, FshVars
|
||||
add hl, hl
|
||||
add hl, bc
|
||||
|
|
@ -61,6 +73,7 @@ fshvarcpy:
|
|||
inc hl
|
||||
ld a, (de)
|
||||
ld (hl), a
|
||||
fshvarcpyOOBException:
|
||||
pop hl
|
||||
pop de
|
||||
pop bc
|
||||
|
|
|
|||
Loading…
Reference in New Issue