Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coding guidelines #11

Open
BlockoS opened this issue Feb 12, 2016 · 8 comments
Open

Coding guidelines #11

BlockoS opened this issue Feb 12, 2016 · 8 comments
Assignees
Milestone

Comments

@BlockoS
Copy link
Owner

BlockoS commented Feb 12, 2016

Write coding guidelines!

@BlockoS BlockoS self-assigned this Feb 12, 2016
@BlockoS
Copy link
Owner Author

BlockoS commented Feb 12, 2016

Keep in mind that the asm source should work with

@freem
Copy link
Collaborator

freem commented Feb 12, 2016

thanks! though I'd imagine anything involving zero page is going to be a nightmare to get working with both set{wla,cc65} and pceas.

@BlockoS BlockoS changed the title Coding guidelins Coding guidelines Feb 15, 2016
@BlockoS
Copy link
Owner Author

BlockoS commented Feb 15, 2016

I think I'll drop wla-dx support for the time being.

Back on the guidelines :
Labels are in snake case.
Macro/routines should be named : target_action. Where target is the hardware, module on which the action is performed. For example, the routine setting the current PSG channel may be psg_set_chn, and the name of the routine that deletes a Backup RAM entry may be bm_delete.
Exceptions to this rule are "standard" functions or algorithms. For example the routine to compare two string may be strcmp, and sorting two byte-arrays simply sort.

I didn't find a good alternative to doxygen for asm. If anyone has an idea, let me know.

@tonma
Copy link

tonma commented Feb 18, 2016

I found these two software.
http://www.naturaldocs.org/languages.html (for assembly)
I have not tested it but I know cpctelera uses it.(http://lronaldo.github.io/cpctelera/files/sprites/cpct_drawSpriteMasked-asm.html)

https://github.com/mrshankly/asm_doc
I have no executable for asmdoc but it should be compilable under Windows

@BlockoS
Copy link
Owner Author

BlockoS commented Feb 18, 2016

Natural Docs looks cools. It can do both asm and C. I'll try it asap.

Anyway, let's not forgot to add a nifty header to the source files!
C version:

/* 
 * HuDK
 * [small description]
 * Licensed under the MIT License
 * (c) 2016 {authors name}
 */

ASM version:

;;
;; HuDK
;; [small description]
;; Licensed under the MIT License
;; (c) 2016 {authors name}
;;

@BlockoS
Copy link
Owner Author

BlockoS commented Feb 18, 2016

I think I'll stick with Natural Docs.
http://blockos.org/docs/HuDK/files/word-inc.html

@tonma
Copy link

tonma commented Feb 19, 2016

Cool. The doc seem easy to read.

@BlockoS
Copy link
Owner Author

BlockoS commented Feb 21, 2016

Code documentation is now accessible here:
http://blockos.github.io/HuDK/doc

The hw docs are far from begin complete atm.

@BlockoS BlockoS added this to the HuDK 1.0.0 milestone Mar 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants