-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.agc
67 lines (47 loc) · 1.67 KB
/
Main.agc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
SETLOC 4000
RESTART
INHINT # Turn off interrupts
CA O37774 # Schedule the first TIME3 interrupt
TS TIME3
TCF INIT # Proceed with initialization
$Vectors.agc # Add table of interrupt vectors
# Initialization.
INIT
CA ZERO # Load 0 to A
TS ACTIVE # Set game not started
TS GM_DONE # Set game not completed
EXTEND
WRITE CH11 # Clear any DSKY lights
CA NOKEY # Clear the keypad buffer variable
TS KEYBUF # to initially hold an illegal keycode.
TC RESETALL # Set all grid items to empty (-1)
TC DISP15 # Clear the grid
CA STA_WAIT # Set game status to wait for any key
TS GM_STATE
RELINT # Enable interrupts
MAINLOOP
CS NEWJOB # Each loop, nudge hardware watchdog
CHK_STATE
INDEX GM_STATE # Index into game state jump table
TCF ST_TABLE # Will jump to appropriate function below based on state
ST_TABLE
TCF CHECK_KEY # 0
TCF MOVING_DN # 1
TCF MOVING_UP # 2
TCF MOVING_LT # 3
TCF MOVING_RT # 4
TCF NEWNUM # 5
TCF WAITKEY # 6
# Include the rest of the code modules below
$Grid.agc
$Down.agc
$Up.agc
$Left.agc
$Right.agc
$Display.agc
$Interrupts.agc
$Input.agc
$Random.agc
$Constants.agc
$Tables.agc
$Ram.agc