You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-04-09 05:44:44 -07:00
24
STYLE.md
24
STYLE.md
@@ -79,19 +79,19 @@ hPascalCase: ; hram
|
||||
PascalCase: ; rom
|
||||
|
||||
; Some constants are also prefixed
|
||||
rBGP EQU $ff47 ; hardware register
|
||||
DEF rBGP EQU $ff47 ; hardware register
|
||||
|
||||
; Most other constants should be upper case
|
||||
UPPER_CASE EQU 1
|
||||
DEF UPPER_CASE EQU 1
|
||||
|
||||
|
||||
; Long lists of constants should be aligned
|
||||
SHORT_CONSTANT EQU 1
|
||||
LONGER_CONSTANT EQU 2
|
||||
PRETTY_LONG_CONSTANT EQU 3
|
||||
TINY EQU 4
|
||||
DEF SHORT_CONSTANT EQU 1
|
||||
DEF LONGER_CONSTANT EQU 2
|
||||
DEF PRETTY_LONG_CONSTANT EQU 3
|
||||
DEF TINY EQU 4
|
||||
|
||||
BUT_ONLY_RELATED_CONSTANTS EQU 5
|
||||
DEF BUT_ONLY_RELATED_CONSTANTS EQU 5
|
||||
|
||||
```
|
||||
|
||||
@@ -103,12 +103,12 @@ BUT_ONLY_RELATED_CONSTANTS EQU 5
|
||||
SECTION "section", ROMX
|
||||
INCLUDE "filename"
|
||||
INCBIN "filename"
|
||||
my_macro: MACRO
|
||||
MACRO my_macro
|
||||
nop
|
||||
ENDM
|
||||
TEST EQUS "test"
|
||||
DEF TEST EQUS "test"
|
||||
PURGE TEST
|
||||
TEST EQU 2
|
||||
DEF TEST EQU 2
|
||||
|
||||
; data macros should be lowercase
|
||||
db 1
|
||||
@@ -135,7 +135,7 @@ endr
|
||||
|
||||
```asm
|
||||
|
||||
when_in_doubt_lowercase: MACRO
|
||||
MACRO when_in_doubt_lowercase
|
||||
|
||||
; only shift if it's required or more readable
|
||||
|
||||
@@ -158,7 +158,7 @@ endr
|
||||
ENDM
|
||||
|
||||
|
||||
UPPER_CASE_IS_OK_SOMETIMES: MACRO
|
||||
MACRO UPPER_CASE_IS_OK_SOMETIMES
|
||||
|
||||
; but I can't think of any examples besides ACRONYMS
|
||||
|
||||
|
Reference in New Issue
Block a user