mirror of
https://github.com/catseye/SixtyPical.git
synced 2025-02-09 16:31:42 +00:00
Apparently this hack was only needed previously due to a bug?
This commit is contained in:
parent
7d11273c6c
commit
3417fd96c7
@ -202,9 +202,6 @@ routine game_state_title_screen
|
|||||||
// call clear_screen
|
// call clear_screen
|
||||||
// call init_game
|
// call init_game
|
||||||
copy game_state_play, dispatch_game_state
|
copy game_state_play, dispatch_game_state
|
||||||
} else {
|
|
||||||
// This is sort of a hack. FIXME: let `if` branches diverge this much.
|
|
||||||
copy forward game_state_title_screen, dispatch_game_state
|
|
||||||
}
|
}
|
||||||
|
|
||||||
goto save_cinv
|
goto save_cinv
|
||||||
|
@ -1065,6 +1065,26 @@ If a location is initialized in one block, is must be initialized in the other a
|
|||||||
| }
|
| }
|
||||||
? InconsistentInitializationError: x
|
? InconsistentInitializationError: x
|
||||||
|
|
||||||
|
However, this only pertains to initialization. If a value is already
|
||||||
|
initialized, either because it was set previous to the `if`, or is an
|
||||||
|
input to the routine, and it is initialized in one branch, it need not
|
||||||
|
be initialized in the other.
|
||||||
|
|
||||||
|
| routine foo
|
||||||
|
| inputs x
|
||||||
|
| outputs x
|
||||||
|
| trashes a, z, n, c
|
||||||
|
| {
|
||||||
|
| ld a, 0
|
||||||
|
| cmp a, 42
|
||||||
|
| if z {
|
||||||
|
| ld x, 7
|
||||||
|
| } else {
|
||||||
|
| ld a, 23
|
||||||
|
| }
|
||||||
|
| }
|
||||||
|
= ok
|
||||||
|
|
||||||
An `if` with a single block is analyzed as if it had an empty `else` block.
|
An `if` with a single block is analyzed as if it had an empty `else` block.
|
||||||
|
|
||||||
| routine foo
|
| routine foo
|
||||||
|
Loading…
x
Reference in New Issue
Block a user