Difference between revisions of "Programming Libraries and Engines"
m (→Game Math) |
m (Protected "Programming Libraries and Engines" ([edit=autoconfirmed] (indefinite) [move=autoconfirmed] (indefinite))) |
||
(8 intermediate revisions by 2 users not shown) | |||
Line 6: | Line 6: | ||
If there are specific functions or library elements that you'd like to see, put a request on the "discussion" page. | If there are specific functions or library elements that you'd like to see, put a request on the "discussion" page. | ||
+ | |||
+ | == Utility / Hardware Description == | ||
+ | |||
+ | * Definitions for register addresses and bit fields: [[gimini.asm]] | ||
+ | * Macro libraries | ||
+ | ** High level constructs: [[util.mac]] | ||
+ | ** [[PSG]] abstraction: [[psg.mac]] | ||
+ | ** [[STIC]] abstraction: [[stic.mac]] | ||
+ | ** Graphic image macros: [[gfx.mac]] | ||
== Basic Math == | == Basic Math == | ||
Line 29: | Line 38: | ||
* Game variables | * Game variables | ||
− | ** Macros for declaring variables: [[ | + | ** Macros for setting up the cartridge and declaring variables: [[cart.mac]] |
+ | ** Initializing memory: [[initmem.asm and initmem.mac]] | ||
* Block memory functions | * Block memory functions | ||
** Copy memory | ** Copy memory | ||
Line 45: | Line 55: | ||
* Status display | * Status display | ||
− | ** Printing strings: [[print.asm]] | + | ** Printing strings: [[print.asm]] [[print.mac]] |
− | ** Printing | + | ** Printing numbers |
*** 16-bit decimal numbers: [[prnum16.asm]] | *** 16-bit decimal numbers: [[prnum16.asm]] | ||
*** 32-bit decimal numbers: [[prnum32.asm]] | *** 32-bit decimal numbers: [[prnum32.asm]] | ||
− | *** Hexadecimal numbers: [[ | + | *** Hexadecimal numbers: [[hexdisp.asm]] [[hex16.asm]] |
* Hand controller scanning | * Hand controller scanning | ||
** Wait for tap / wait for release: [[wnk.asm]] | ** Wait for tap / wait for release: [[wnk.asm]] | ||
Line 65: | Line 75: | ||
== Music / Sound Effects == | == Music / Sound Effects == | ||
− | + | * Music | |
+ | ** Tracker: [[tracker.asm and tracker.mac]] | ||
+ | ** Example: [[Trkdemo.asm and demosong.asm]] |
Latest revision as of 09:08, 4 December 2010
Contents
Programming Libraries and Engines
Below are links to various library functions, as well as programming frameworks (aka "engines") that you can use when building a game. After all, while inventing wheels is sometimes fun, more often than not it's more fun to focus on writing a game.
If there are specific functions or library elements that you'd like to see, put a request on the "discussion" page.
Utility / Hardware Description
- Definitions for register addresses and bit fields: gimini.asm
- Macro libraries
Basic Math
- Multiplication
- (to do)
- See also: Tutorial on using shifts for multiplication
- Division
- Signed and unsigned divide: dividivu.asm
- Optimized unsigned divide: fastdivu.asm
- See also: Tutorial on using shifts for division by powers of 2
- Square root
- Integer and fixed point square root: sqrt.asm
Game Math
- Distance computation: dist_fast.asm
- Random number generation
- Fully featured: rand.asm
- Stripped down and fast: randfast.asm
Memory Management
- Game variables
- Macros for setting up the cartridge and declaring variables: cart.mac
- Initializing memory: initmem.asm and initmem.mac
- Block memory functions
- Copy memory
- As-is: memcpy.asm
- Unpacking packed 8-bit data: memunpk.asm
- Compare memory: memcmp.asm
- Fill / clear memory
- C-style function: memset.asm
- Older FILLMEM/FILLZERO/CLRSCR combined routine: fillmem.asm
- Copy memory
- Bank switching
- Intellicart bank switch utility routines ic_banksw.asm
- To do: ECS-style bank switching routines
Basic I/O
- Status display
- Printing strings: print.asm print.mac
- Printing numbers
- 16-bit decimal numbers: prnum16.asm
- 32-bit decimal numbers: prnum32.asm
- Hexadecimal numbers: hexdisp.asm hex16.asm
- Hand controller scanning
- Wait for tap / wait for release: wnk.asm
- Comprehensive: (todo -- tends to be integrated with game's event handling scheme)
- Intellivoice
- Core Intellivoice driver: ivoice.asm
- Speaking numbers using RESROM samples: saynum16.asm
- Speaking numbers using AL2: (to do)
- SP0256-AL2 Allophone library: (external link coming; cannot be uploaded here due to license reasons.)
Sprite Engine
The intention is to put a sprite engine here. None present currently.
Music / Sound Effects
- Music
- Tracker: tracker.asm and tracker.mac
- Example: Trkdemo.asm and demosong.asm