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 bc
|
||||||
push de
|
push de
|
||||||
push hl
|
push hl
|
||||||
|
ld bc, FshVarsSize / 2 + 1
|
||||||
|
call cpBCDE
|
||||||
|
jr nc, fshvarsetOOBException
|
||||||
ld bc, FshVars
|
ld bc, FshVars
|
||||||
ex de, hl
|
ex de, hl
|
||||||
add hl, hl
|
add hl, hl
|
||||||
|
|
@ -14,6 +17,7 @@ fshvarset:
|
||||||
ld (hl), e
|
ld (hl), e
|
||||||
inc hl
|
inc hl
|
||||||
ld (hl), d
|
ld (hl), d
|
||||||
|
fshvarsetOOBException:
|
||||||
pop hl
|
pop hl
|
||||||
pop de
|
pop de
|
||||||
pop bc
|
pop bc
|
||||||
|
|
@ -28,6 +32,10 @@ fshvarset:
|
||||||
fshvarget:
|
fshvarget:
|
||||||
push bc
|
push bc
|
||||||
push de
|
push de
|
||||||
|
ld hl, 0
|
||||||
|
ld bc, FshVarsSize / 2 + 1
|
||||||
|
call cpBCDE
|
||||||
|
jr nc, fshvargetOOBException
|
||||||
ld bc, FshVars
|
ld bc, FshVars
|
||||||
ex de, hl
|
ex de, hl
|
||||||
add hl, hl
|
add hl, hl
|
||||||
|
|
@ -36,6 +44,7 @@ fshvarget:
|
||||||
inc hl
|
inc hl
|
||||||
ld d, (hl)
|
ld d, (hl)
|
||||||
ex de, hl
|
ex de, hl
|
||||||
|
fshvargetOOBException:
|
||||||
pop de
|
pop de
|
||||||
pop bc
|
pop bc
|
||||||
ret
|
ret
|
||||||
|
|
@ -49,6 +58,9 @@ fshvarcpy:
|
||||||
push bc
|
push bc
|
||||||
push de
|
push de
|
||||||
push hl
|
push hl
|
||||||
|
ld bc, FshVarsSize / 2 + 1
|
||||||
|
call cpBCDE
|
||||||
|
jr nc, fshvarcpyOOBException
|
||||||
ld bc, FshVars
|
ld bc, FshVars
|
||||||
add hl, hl
|
add hl, hl
|
||||||
add hl, bc
|
add hl, bc
|
||||||
|
|
@ -61,6 +73,7 @@ fshvarcpy:
|
||||||
inc hl
|
inc hl
|
||||||
ld a, (de)
|
ld a, (de)
|
||||||
ld (hl), a
|
ld (hl), a
|
||||||
|
fshvarcpyOOBException:
|
||||||
pop hl
|
pop hl
|
||||||
pop de
|
pop de
|
||||||
pop bc
|
pop bc
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue