mirror of
https://github.com/catseye/SixtyPical.git
synced 2024-11-22 17:32:01 +00:00
Block-level decls are visible in inner blocks.
This commit is contained in:
parent
23185b8045
commit
04678ca809
@ -241,6 +241,31 @@ Even in inner blocks.
|
||||
| }
|
||||
? undeclared location
|
||||
|
||||
Block-level declarations are visible in inner blocks.
|
||||
|
||||
| routine main {
|
||||
| reserve byte lives
|
||||
| with sei {
|
||||
| if beq {
|
||||
| lda #3
|
||||
| repeat bne {
|
||||
| sta lives
|
||||
| }
|
||||
| } else {
|
||||
| sta lives
|
||||
| }
|
||||
| }
|
||||
| }
|
||||
= True
|
||||
|
||||
A block-level `reserve` may not supply an initial value.
|
||||
|
||||
| routine main {
|
||||
| reserve byte lives : 3
|
||||
| lda lives
|
||||
| }
|
||||
? block-level 'lives' cannot supply initial value
|
||||
|
||||
All routines jsr'ed to must be defined, or external.
|
||||
|
||||
| routine main {
|
||||
|
@ -33,8 +33,6 @@ reserve vector dispatch_state
|
||||
|
||||
reserve byte[18] press_fire_msg: "PRESS FIRE TO PLAY"
|
||||
|
||||
reserve byte save_x // TODO: SHOULD BE BLOCK LOCAL!
|
||||
|
||||
routine calculate_new_position outputs (new_position) {
|
||||
clc
|
||||
lda <position
|
||||
@ -170,7 +168,7 @@ routine state_title_screen {
|
||||
}
|
||||
|
||||
routine state_play_game {
|
||||
// reserve byte save_x
|
||||
reserve byte save_x
|
||||
ldx #0
|
||||
repeat bne {
|
||||
stx save_x
|
||||
|
@ -212,10 +212,16 @@ mapInstrName n1 n2 (JMPVECTOR sl1) =
|
||||
mapInstrName n1 n2 (DELTA sl1 v) =
|
||||
DELTA (mapStorageLocationName n1 n2 sl1) v
|
||||
|
||||
mapInstrName n1 n2 (IF id branch b1 b2) =
|
||||
IF id branch (mapBlockNames n1 n2 b1) (mapBlockNames n1 n2 b2)
|
||||
|
||||
mapInstrName n1 n2 (REPEAT id branch b1) =
|
||||
REPEAT id branch (mapBlockNames n1 n2 b1)
|
||||
|
||||
mapInstrName n1 n2 (WITH instr b1) =
|
||||
WITH instr (mapBlockNames n1 n2 b1)
|
||||
|
||||
{-
|
||||
| IF InternalID Branch Block Block
|
||||
| REPEAT InternalID Branch Block
|
||||
| WITH WithInstruction Block
|
||||
| COPYROUTINE RoutineName StorageLocation
|
||||
-}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user