You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Purpose**: Comments should explain why the code exists and what it is intended to do, especially for complex logic.
75
-
-**Placement**:
73
+
-**Placement**:
76
74
- Comments can be placed above the code block they describe for longer explanations.
77
75
- Inline comments can be used for single lines of code where the purpose might not be immediately clear.
78
76
-**Clarity**: Avoid stating the obvious. Focus on explaining the logic rather than restating the code.
@@ -83,22 +81,6 @@ Example:
83
81
LDA $22 : SEC : SBC $3F : STA $31 ; Adjust X position for camera movement
84
82
```
85
83
86
-
## Directives
87
-
88
-
-**Organization**: Use `%macro`, `include`, and other Asar directives in a structured manner, keeping related directives grouped together.
89
-
-**Usage**: Ensure all directives are used consistently throughout the codebase, following the naming conventions and formatting rules established.
90
-
91
-
Example:
92
-
93
-
```asm
94
-
%macro InitMovement
95
-
LDA.b $22 : STA.b $3F
96
-
LDA.b $23 : STA.b $41
97
-
LDA.b $20 : STA.b $3E
98
-
LDA.b $21 : STA.b $40
99
-
endmacro
100
-
```
101
-
102
84
## Instructions
103
85
104
86
-**Single Line Instructions**: Combine multiple instructions on a single line using colons (`:`) where appropriate for related operations.
@@ -121,11 +103,11 @@ Example:
121
103
122
104
```asm
123
105
%macro HandlePlayerCamera
124
-
LDA $22 : SEC : SBC $3F : STA $31
125
-
LDA $20 : SEC : SBC $3E : STA $30
126
-
JSL Link_HandleMovingAnimation_FullLongEntry
127
-
JSL HandleIndoorCameraAndDoors
128
-
RTS
106
+
LDA $22 : SEC : SBC $3F : STA $31
107
+
LDA $20 : SEC : SBC $3E : STA $30
108
+
JSL Link_HandleMovingAnimation_FullLongEntry
109
+
JSL HandleIndoorCameraAndDoors
110
+
RTS
129
111
endmacro
130
112
```
131
113
@@ -137,12 +119,12 @@ endmacro
137
119
Example:
138
120
139
121
```asm
140
-
.loop_start
141
-
LDA $00 : CMP #$10 : BEQ .end_loop
122
+
.loop_start
123
+
LDA $00 : CMP #$10 : BEQ .end_loop
142
124
INC $00
143
125
BRA .loop_start
144
-
.end_loop
145
-
RTS
126
+
.end_loop
127
+
RTS
146
128
```
147
129
148
130
## Data Structures
@@ -155,10 +137,10 @@ Example:
155
137
```asm
156
138
.DirectionTileLookup
157
139
{
158
-
db $02, $00, $04, $00 ; North
159
-
db $00, $00, $03, $01 ; East
160
-
db $00, $02, $00, $04 ; South
161
-
db $03, $01, $00, $00 ; West
140
+
db $02, $00, $04, $00 ; North
141
+
db $00, $00, $03, $01 ; East
142
+
db $00, $02, $00, $04 ; South
143
+
db $03, $01, $00, $00 ; West
162
144
}
163
145
```
164
146
@@ -206,7 +188,6 @@ AncillaAdd_Hookshot:
206
188
-**Logical Grouping**: Organize code into logical sections, with related routines and macros grouped together.
207
189
-**Separation of Concerns**: Ensure that each section of code is responsible for a specific task or set of related tasks, avoiding tightly coupled code.
208
190
-**Modularity**: Write code in a modular way, making it easier to reuse and maintain.
209
-
-**Status Registers and Stack Operations**: Indent code blocks when using status register operations (REP, SEP, PHX, PLX, etc.) to improve readability.
-**Integration**: Include custom assembly code in the `yaze.asm` file to ensure it is applied correctly to the ROM. The module should include a define and conditional statement to allow users to disable the module if needed.
213
+
-**Integration**: Include custom assembly code in the `yaze.asm` file to ensure it is applied correctly to the ROM. The module should include a define and conditional statement to allow users to disable the module if needed.
0 commit comments