-
Notifications
You must be signed in to change notification settings - Fork 1
/
notes.txt
executable file
·166 lines (114 loc) · 5.72 KB
/
notes.txt
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
mesen tracelog exclude loop:
(pc < $800a || pc > $8015) && (pc < $99ee || pc > $9a15 )
****
L855C/L855F - tables with low/high bytes of top left corner of player1, player2 & coop
*****
0 - no tetromino
1 - I
2 - T
3 - O
4 - J
5 - L
6 - S
7 - Z
$52 (pieceStatistics) gets a zero stored in it but doesn't seem to be read
****
L9997 - line clear stat columns
999B - maximum height of column
****
L95C6 - probably start of demo
L95E3 - start of game?
L8565 - plant pieces in playfield
playfield is stored with 1 tile per nibble. nibble aligns with tile index. 0 is clear.
walls are built with F0 on left, 0F on right
Floor is built with FF
****
L836B - @rightNotPressed
doSomethingWithInputDuringGameplay - is maybe get filtered input? it leaves buttons in A
8327 - if fall timer is 0, down is pressed for you
L8650 - checkPosition after shifting/rotating and then do something else
L8C15 - probably the checkPosition
L8CA7 - negative3 thru 3
**********
orientation table is 2 bytes for 16 possible locations, 1 bit per tile
Example T Down:
0000 0
1110 E
0100 4
0000 0
would be: $0E,$40
Need to learn more about the order of orienations, but these replacements allow for T spins. Unforunately the rotation is backwards with it.
orientationForT:
.byte $0E,$40,$4C,$40,$4E,$00,$46,$40 ; 86D3 E4 00 8C 80 4E 00 4C 40 ....N.L@
tilesForT:
.byte $01,$09,$03,$06,$04,$01,$0A,$06 ; 8713 01 09 03 06 04 08 03 06 ........
.byte $04,$01,$07,$03,$04,$08,$03,$06 ; 871B 04 01 07 03 04 01 0A 06 ........
*********
LB65D - game background modification address table
****
01D2 (relatedToLevelUpAnimations)
Looks to be reset to 0 once per line cleared, incremented during score calculation (9597) (?) and used to flag a reset of player1FallTimer (8D10) if 9597 doesn't happen
single leveling up:
87D0 STA $01D2 = $01 A:00 X:00 Y:C8 S:FB P:nv--dIZC V:67 H:181 Fr:14198
9597 INC $01D2 = $01 A:31 X:00 Y:00 S:FB P:nv--dIzc V:11 H:34 Fr:14227
8D10 LDA $01D2 = $01 A:04 X:00 Y:02 S:FD P:nv--dIzC V:7 H:303 Fr:14283
tetris with no level up:
87D0 STA $01D2 = $00 A:00 X:00 Y:B0 S:FB P:nv--dIZC V:66 H:326 Fr:20365
87D0 STA $01D2 = $00 A:00 X:00 Y:B8 S:FB P:nv--dIZC V:69 H:194 Fr:20365
87D0 STA $01D2 = $00 A:00 X:00 Y:C0 S:FB P:nv--dIZC V:72 H:122 Fr:20365
87D0 STA $01D2 = $00 A:00 X:00 Y:C8 S:FB P:nv--dIZC V:75 H:110 Fr:20365
****
in main loop:
jsr L9B62 ; score staging?
****
Attempt to understand datapath for main title song:
View when first byte of the 4 blobs of data that make up the title song are read:
Address == $F2E1 || Address == $F37F || Address == $F439 || Address == $F4FD
View when addresses referencing the 4 blobs are read:
Address >= $DF8F && Address <= $DF96
****
Trying to figure out wall kicks. This disables them on the right side of the playfield*. Leaving this here to come back to later.
diff --git a/main.asm b/main.asm
index 815c91b..81115b1 100755
--- a/main.asm
+++ b/main.asm
@@ -726,13 +726,16 @@ L836B:
and #$03 ; 8378 29 03 ).
sta player1TetrominoOrientation,x ; 837A 95 68 .h
jsr checkPositionAndClearFlagsOnCarrySet; 837C 20 50 86 P.
- bcs L838E ; 837F B0 0D ..
- dec player1TetrominoX,x ; 8381 D6 62 .b
+ bcc @restore ; 837F B0 0D ..
+ bcs L838E
+ ; dec player1TetrominoX,x ; 8381 D6 62 .b
jsr checkPositionAndClearFlagsOnCarrySet; 8383 20 50 86 P.
bcs L838E ; 8386 B0 06 ..
inc player1TetrominoX,x ; 8388 F6 62 .b
+@restore:
lda generalCounter3a ; 838A A5 3A .:
sta player1TetrominoOrientation,x ; 838C 95 68 .h
+; This has something to do with wallkicks
L838E:
lda generalCounter3b ; 838E A5 3B .;
and #$01 ; 8390 29 01 ).
@@ -744,11 +747,13 @@ L838E:
and #$03 ; 839B 29 03 ).
sta player1TetrominoOrientation,x ; 839D 95 68 .h
jsr checkPositionAndClearFlagsOnCarrySet; 839F 20 50 86 P.
- bcs L83B1 ; 83A2 B0 0D ..
- dec player1TetrominoX,x ; 83A4 D6 62 .b
+ bcc @restore ; 83A2 B0 0D ..
+ bcs L83B1
+ ; dec player1TetrominoX,x ; 83A4 D6 62 .b
jsr checkPositionAndClearFlagsOnCarrySet; 83A6 20 50 86 P.
bcs L83B1 ; 83A9 B0 06 ..
inc player1TetrominoX,x ; 83AB F6 62 .b
+@restore:
lda generalCounter3a ; 83AD A5 3A .:
sta player1TetrominoOrientation,x ; 83AF 95 68 .h
L83B1:
*https://tetris.wiki/Tetris_(NES,_Tengen)
"Because basic rotation can fail when a piece is against the right wall, but not when the same piece is against the left wall, this game will wallkick one square to the left if basic rotation fails."
****
80C3 & 80D7
replace 01 with 00 to disable auto rotate