/smw-irq

Not mine, just reuploading it since the original host went down

Primary LanguageAssembly

Documentation style:

1) Tabs are the method of spacing with a width of 8.
2) \n is the preferred line ending for consistency.
3) Labels and code should never share a line.
4) Underscores are the naming convention of choice.  Case variations are not permitted.
5) Prefer sublabels whenever possible.
6) A newline may be added after jumps/subroutines/forced branches/or branches into other subroutines.
7) The "soft margin" width is 120 characters per line. 
8) Lines missing an address should have the address added.
9) At this time RAM defines should NOT be used.
10) Abbreviations should be avoided where possible to enforce maximum consistency.  Exceptions list below.
11) Opcode suffixes are currently required.  At some point they will be removed however.
12) Avoid +/- labels if reasonable.
13) Opcodes and hex numbers are written in upper case.
14) Documentation should be enough to at a mimium explain the result of an operation, rather than the operation itself.
15) All labels should recieve meaningful names, code/data labels should be gradually removed.
16) It is required to where possible convert numeric addresses to labels.  Especially those used in DMA.


The comment structure:
The comment structure is rather simple and is rather basic. The backslash (\) is used to represent a new level of code,
the pipe (|) is used to designate continuation of the current code level, and finally the forwardslash (/) closes a 
level of code.  You may nest comments up to two levels deep.  An example of the comment structure looks something like
this:

(code section)					(address column) (comment wall) 
mode_7_static_background_scroll:		;		\ 
	LDA.b #$59				;$008416	 |\ set layer 1 tilemap address to $5800, mirror X
	STA.w $2107				;$008418	 |/
	LDA.b #$07				;$00841B	 |\ set layer 1 base character address to $7000
	STA.w $210B				;$00841D	 |/
	LDA $1A					;$008420	 |\ Set layer 1 X position.
	STA.w $210D				;$008422	 | |
	LDA $1B					;$008425	 | |
	STA.w $210D				;$008427	 |/
	LDA $1C					;$00842A	 |\ Set relative layer 1 Y position.
	CLC					;$00842C	 | |
	ADC.w $1888				;$00842D	 | | Add in the relative amount.
	STA.w $210E				;$008430	 | |
	LDA $1D					;$008433	 | |
	STA.w $210E				;$008435	 |/
	RTS					;$008438	/


Acceptable abbreviations:
Abbreviations are enforced on the following words for maximum consistency and ease of typing.  Abbreviations are
carefully chosen to avoid ambiguity and not compromise readability in any way.  If you feel a word is lacking an
abbreviations please contact p4plus2 so the potential inclusion can be discussed.  To clarify, acronyms do not count as
abbreviations and may be used.  (NOTE: these should be treated as case sensitive!!)  

(abbreviations = base word)
OW = overworld
BG = background
gfx = graphics
info = information
init = initialization