├── DBC.cpp ├── DBC.h ├── DBX.ico ├── IDE.exe ├── LICENSE ├── MF.cpp ├── MF.h ├── MF_mappy.cpp ├── Makefile ├── README.md ├── dbapi ├── BITMAPPED.htm ├── Bitmapped_BLIT.htm ├── Bitmapped_CLS.htm ├── Bitmapped_FLIP.htm ├── Bitmapped_LINE.htm ├── Bitmapped_PIXEL.htm ├── Bitmapped_PLOT.htm ├── Bitmapped_SCREEN.htm ├── Bitmapped_WALLPAPER.htm ├── CORE.htm ├── Core_COPY.htm ├── Core_ERASE.htm ├── Core_GRAPHICS.htm ├── Core_LOG.htm ├── Core_PEEK.htm ├── Core_POKE.htm ├── Core_SCANLINE.htm ├── Core_VBLANK.htm ├── DIRECTIVES.htm ├── Directives_BITMAP.htm ├── Directives_CONSTANT.htm ├── Directives_IMPORT.htm ├── Directives_INCLUDE.htm ├── Directives_MUSIC.htm ├── Directives_PALETTE.htm ├── Directives_REQUIRES.htm ├── Directives_SOUND.htm ├── Directives_TITLE.htm ├── EFFECTS.htm ├── EXTENDED.htm ├── Effects_FADEIN.htm ├── Effects_FADEOUT.htm ├── Effects_MOSAIC.htm ├── Effects_MOSAICTILES.htm ├── Effects_SPRITEMOSAIC.htm ├── Extended_ABS.htm ├── Extended_ALIGNED.htm ├── Extended_ALLOCATE.htm ├── Extended_BLOCKS.htm ├── Extended_DMACOPY.htm ├── Extended_DMAWAIT.htm ├── Extended_FIX.htm ├── Extended_FSQRT.htm ├── Extended_INT.htm ├── Extended_ROUND.htm ├── Extended_SQRT.htm ├── Extended_TILEOFFSET.htm ├── INPUT.htm ├── INTERRUPTS.htm ├── Index.htm ├── Input_CHECKKEYS.htm ├── Input_INPUT.htm ├── Input_KEY.htm ├── Input_KEYDOWN.htm ├── Input_KEYS.htm ├── Input_KEYUP.htm ├── Input_WAITKEY.htm ├── Interrupts_DISABLEINTERRUPTS.htm ├── Interrupts_ENABLEINTERRUPTS.htm ├── Interrupts_ONHBLANK.htm ├── Interrupts_ONKEY.htm ├── Interrupts_ONTIMER.htm ├── Interrupts_ONVBLANK.htm ├── Interrupts_ONVCOUNT.htm ├── KEYWORDS.htm ├── Keywords_AND.htm ├── Keywords_CASE.htm ├── Keywords_DATA.htm ├── Keywords_DEFAULT.htm ├── Keywords_DIM.htm ├── Keywords_DOWNTO.htm ├── Keywords_ELSE.htm ├── Keywords_END.htm ├── Keywords_EXIT.htm ├── Keywords_FOR.htm ├── Keywords_FUNCTION.htm ├── Keywords_IF.htm ├── Keywords_INTERRUPT.htm ├── Keywords_LOOP.htm ├── Keywords_MAP.htm ├── Keywords_MOD.htm ├── Keywords_NAND.htm ├── Keywords_NEXT.htm ├── Keywords_NOR.htm ├── Keywords_NOT.htm ├── Keywords_OR.htm ├── Keywords_READ.htm ├── Keywords_REPEAT.htm ├── Keywords_RESET.htm ├── Keywords_RESTORE.htm ├── Keywords_RETURN.htm ├── Keywords_SELECT.htm ├── Keywords_SL.htm ├── Keywords_SR.htm ├── Keywords_STEP.htm ├── Keywords_SUB.htm ├── Keywords_THEN.htm ├── Keywords_TO.htm ├── Keywords_UNTIL.htm ├── Keywords_WHILE.htm ├── Keywords_XOR.htm ├── PALETTE.htm ├── Palette_GETPALENTRY.htm ├── Palette_LOADPAL16.htm ├── Palette_LOADPAL256.htm ├── Palette_MAKEPALETTE.htm ├── Palette_RGB.htm ├── Palette_RGBB.htm ├── Palette_RGBG.htm ├── Palette_RGBR.htm ├── Palette_ROTATEPAL16.htm ├── Palette_ROTATEPAL256.htm ├── Palette_SETPALENTRY.htm ├── RAND.htm ├── ROTATIONS.htm ├── Rand_RANDOM.htm ├── Rand_RND.htm ├── Rand_SEED.htm ├── Rotations_COS.htm ├── Rotations_MAKEROTATION.htm ├── Rotations_ROTATESPRITE.htm ├── Rotations_SIN.htm ├── Rotations_TAN.htm ├── Rotations_WRAPANGLE.htm ├── SOUND.htm ├── SPRITES.htm ├── SRAM.htm ├── STRINGS.htm ├── Sound_PLAYDRUM.htm ├── Sound_PLAYMUSIC.htm ├── Sound_PLAYNOTE.htm ├── Sound_PLAYSOUND.htm ├── Sound_STOPMUSIC.htm ├── Sound_STOPSOUND.htm ├── Sound_TURNSOUNDOFF.htm ├── Sound_TURNSOUNDON.htm ├── Sprites_ANIMSPRITE.htm ├── Sprites_BUMPSPRITES.htm ├── Sprites_COLORSPRITE.htm ├── Sprites_FLIPSPRITE.htm ├── Sprites_HIDESPRITE.htm ├── Sprites_LOADSPRITE.htm ├── Sprites_MAKESPRITE.htm ├── Sprites_MOVESPRITE.htm ├── Sprites_ORDERSPRITE.htm ├── Sprites_POSITIONSPRITE.htm ├── Sprites_SIZESPRITE.htm ├── Sprites_SPRITE.htm ├── Sprites_SPRITEFRAME.htm ├── Sprites_SPRITEHIDDEN.htm ├── Sprites_SPRITEX.htm ├── Sprites_SPRITEY.htm ├── Sprites_UPDATESPRITES.htm ├── Sram_LOADBYTE.htm ├── Sram_LOADLONG.htm ├── Sram_LOADTEXT.htm ├── Sram_LOADWORD.htm ├── Sram_SAVEBYTE.htm ├── Sram_SAVELONG.htm ├── Sram_SAVETEXT.htm ├── Sram_SAVEWORD.htm ├── Strings_APPEND.htm ├── Strings_COMPARE.htm ├── Strings_HEX.htm ├── Strings_LEFT.htm ├── Strings_LEN.htm ├── Strings_MID.htm ├── Strings_MOVE.htm ├── Strings_PRINT.htm ├── Strings_RESIZE.htm ├── Strings_RIGHT.htm ├── Strings_STR.htm ├── TILES.htm ├── TIMER.htm ├── Tiles_CHARBLOCK.htm ├── Tiles_CLEARTILES.htm ├── Tiles_COLORTILE.htm ├── Tiles_DISABLETILES.htm ├── Tiles_ENABLETILES.htm ├── Tiles_FLIPTILE.htm ├── Tiles_GETTILE.htm ├── Tiles_LOADFONT16.htm ├── Tiles_LOADFONT256.htm ├── Tiles_LOADTILES.htm ├── Tiles_MAPIMAGE.htm ├── Tiles_MAPTILES.htm ├── Tiles_ORDERTILES.htm ├── Tiles_SCREENBLOCK.htm ├── Tiles_SCROLL.htm ├── Tiles_SCROLLPOS.htm ├── Tiles_SCROLLX.htm ├── Tiles_SCROLLY.htm ├── Tiles_SETTILE.htm ├── Tiles_TILE.htm ├── Tiles_UPDATETILES.htm ├── Timer_CLOCKTIMER.htm ├── Timer_MAKETIMER.htm ├── Timer_ONTIMER.htm ├── Timer_RESETTIMER.htm ├── Timer_STARTTIMER.htm ├── Timer_STOPTIMER.htm ├── Timer_WAITTIMER.htm ├── dbapi.hhc ├── dbapi.hhp ├── sizes.png └── styles.css ├── docs ├── dbc.chl ├── dbc.jsf ├── memory-map.txt └── tin.chl ├── examples ├── Makefile ├── breakout │ ├── ball.pcx │ ├── bg.bin │ ├── bg.bmp │ ├── bg.map │ ├── blocks.pcx │ ├── breakout.dbc │ ├── data.dbc │ ├── font.pcx │ ├── gameover.pcx │ ├── paddle.pcx │ └── sbounce.wav ├── coppa │ └── coppa.dbc ├── gapman │ ├── deadpac.pcx │ ├── eatdot.wav │ ├── font.pcx │ ├── fruitpoints.pcx │ ├── fruitsprites.pcx │ ├── gapman.pcx │ ├── gapman2.dbc │ ├── ghostpoints.pcx │ ├── ghosts.pcx │ ├── ghostscared2.wav │ ├── ghostsnormal.wav │ ├── maptiles2.pcx │ ├── morph.pcx │ ├── pactitle3.pcx │ └── startgame.wav ├── mappy │ ├── mansion.fmp │ ├── mansion_8x8.fmp │ ├── mappy.dbc │ ├── test.fmp │ └── test8x8.fmp ├── moddemo │ ├── acker.mod │ ├── font.bmp │ └── moddemo.dbc ├── old_tut_4 │ └── old_tut_4.dbc ├── old_tut_7 │ ├── A.png │ ├── B.png │ └── old_tut_7.dbc ├── tut_1 │ ├── font.bmp │ └── tut_1.dbc ├── tut_2 │ └── tut_2.dbc ├── tut_3 │ ├── dragon.png │ └── tut_3.dbc ├── tut_4 │ ├── ship.bmp │ └── tut_4.dbc ├── tut_5 │ ├── asteroid_large.png │ ├── asteroid_small.png │ └── tut_5.dbc ├── tut_6 │ ├── bg_music.wav │ ├── block.pcx │ ├── jump.wav │ ├── mario_0.pcx │ ├── mario_1.pcx │ ├── mario_2.pcx │ ├── mario_3.pcx │ └── tut_6.dbc ├── tut_7 │ ├── baron.bmp │ ├── bomb.bmp │ ├── bullet.bmp │ ├── cloud.bmp │ ├── clouds.bmp │ ├── font.bmp │ ├── sky.pal │ └── tut_7.dbc ├── tut_8 │ ├── coin.wav │ ├── forest.pcx │ ├── link.pcx │ ├── rupee.pcx │ └── tut_8.dbc ├── tut_9 │ ├── house.pcx │ ├── shop.pcx │ ├── tiles.pcx │ └── tut_9.dbc └── wavy │ ├── bluebar.png │ ├── dragonlogo.png │ ├── greenbar.png │ ├── letter_b.png │ ├── letter_e.png │ ├── letter_g.png │ ├── letter_l.png │ ├── letter_o.png │ ├── letter_r.png │ ├── letter_t.png │ ├── play.wav │ ├── redbar.png │ ├── screenshot.png │ ├── tiles2.png │ └── wavy.dbc ├── extract_syms.sh ├── gbax.dll ├── include ├── core.dbc ├── effects.dbc ├── ext.dbc ├── fmp.dbc ├── gba.dbc ├── graphics.dbc ├── input.dbc ├── interrupts.dbc ├── lognc.dbc ├── logvba.dbc ├── mod.dbc ├── palette.dbc ├── rnd.dbc ├── rotations.dbc ├── sound.dbc ├── sprites.dbc ├── sram.dbc ├── strings.dbc ├── tiles.dbc └── timers.dbc ├── optional ├── core.f ├── effects.f ├── ext.f ├── fmp.f ├── graphics.f ├── input.f ├── interrupts.f ├── lognc.f ├── logvba.f ├── palette.f ├── rotations.f ├── sound.f ├── sprites.f ├── sram.f ├── strings.f ├── tiles.f └── timers.f ├── os.h ├── pimpmobile_r1 ├── LICENSE.TXT ├── Makefile ├── converter │ ├── Makefile │ ├── converter.cpp │ ├── converter.h │ ├── converter_mod.cpp │ ├── converter_s3m.cpp │ ├── converter_xm.cpp │ ├── dump_module.cpp │ └── dump_samples.cpp ├── example │ ├── Makefile │ ├── data │ │ └── dxn-oopk.xm │ ├── example.cpp │ ├── gbfs.h │ └── libgbfs.c ├── include │ └── pimpmobile.h ├── lib │ └── .gitignore ├── lut_gen.py ├── makefs.bat ├── makefs.sh ├── src │ ├── amiga_delta_lut.h │ ├── amiga_period_lut.h │ ├── linear_delta_lut.h │ ├── pimp_base.h │ ├── pimp_config.h │ ├── pimp_debug.c │ ├── pimp_debug.h │ ├── pimp_effects.h │ ├── pimp_envelope.c │ ├── pimp_envelope.h │ ├── pimp_gba.c │ ├── pimp_instrument.h │ ├── pimp_internal.h │ ├── pimp_math.c │ ├── pimp_math.h │ ├── pimp_mixer.c │ ├── pimp_mixer.h │ ├── pimp_mixer_arm.S │ ├── pimp_mixer_clip_arm.S │ ├── pimp_mixer_portable.c │ ├── pimp_mod_context.c │ ├── pimp_mod_context.h │ ├── pimp_module.h │ ├── pimp_render.c │ ├── pimp_render.h │ ├── pimp_sample.h │ └── pimp_types.h └── testbench │ ├── Makefile │ ├── framework │ ├── test.c │ └── test.h │ ├── toplevel │ ├── env_sustain.xm │ └── ins_fadeout.xm │ ├── unit │ └── test_mixer.c │ └── unit_test.c ├── runtime ├── cart_hdr.s ├── gba_cart.ld ├── gba_crt0.s ├── helpers.c ├── runpimp.c ├── runtime.s └── runtime_common.s ├── scintilla.dll └── test ├── dim_const.dbc └── dim_const.f /DBX.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/DBX.ico -------------------------------------------------------------------------------- /IDE.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/IDE.exe -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Dragon BASIC Compilers, Run-Time Environment, and Library. 2 | 3 | Copyright (C) 2003-2004 Jeff Massung 4 | Copyright (C) 2015 Ulrich Hecht 5 | 6 | This software is provided 'as-is', without any express or implied 7 | warranty. In no event will the authors be held liable for any damages 8 | arising from the use of this software. 9 | 10 | Permission is granted to anyone to use this software for any purpose, 11 | including commercial applications, and to alter it and redistribute it 12 | freely, subject to the following restrictions: 13 | 14 | 1. The origin of this software must not be misrepresented; you must not 15 | claim that you wrote the original software. If you use this software 16 | in a product, an acknowledgment in the product documentation would be 17 | appreciated but is not required. 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 3. This notice may not be removed or altered from any source distribution. 21 | 22 | Ulrich Hecht 23 | ulrich.hecht@gmail.com 24 | -------------------------------------------------------------------------------- /dbapi/Bitmapped_SCREEN.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 9 | 10 |Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Returns the currently hidden buffer in a double-buffer mode. 22 |Parameters 26 | 27 |23 | FUNCTION SCREEN 24 |25 |
28 | None. 29 |Return 30 | 31 |
32 | The 32-bit, unsigned address to the currently hidden buffer. 33 |Remarks 34 | 35 |
36 | In modes 4 and 5, this function will either return &6000000 37 | or &600A0000. In mode 3, this function always returns 38 | &6000000. 39 |See Also 40 | 41 |
42 | GRAPHICS 43 |44 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Sets the current graphics mode. 22 |Parameters 29 | 30 |23 | SUB GRAPHICS( 24 | mode, 25 | sprites 26 | ) 27 |28 |
31 | mode - the mode to set (must be 0-5)Return 35 | 36 |
32 | sprites - a boolean flag whether or not sprites should 33 | be enabled (0=no, non-0=yes)
34 |
37 | None. 38 |Remarks 39 | 40 |
41 | Sets the current graphics mode. 0-2 are tiled modes and 3-5 are 42 | bitmapped modes. This function will completely erase the VRAM 43 | before returning. 44 |45 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Writes a string to the console of VBA. 22 |Parameters 28 | 29 |23 | SUB LOG( 24 | string$ 25 | ) 26 |27 |
30 | string$ - a string to send to the consoleReturn 32 | 33 |
31 |
34 | None. 35 |Remarks 36 | 37 |
38 | This only works in VisualBoyAdvance. It will lock up actual 39 | hardware or other emulators. 40 |41 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Returns the current scanline begin drawn. 22 |Parameters 26 | 27 |23 | FUNCTION SCANLINE 24 |25 |
28 | None. 29 |Return 30 | 31 |
32 | An unsigned value from 0-227. 33 |Remarks 34 | 35 |
36 | Scanlines 0-159 are visible on the screen. Vertical blanks 37 | occur at scanline 160. 38 |See Also 39 | 40 |
41 | VBLANK 42 |43 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Waits for the next vertical blank to begin. 22 |Parameters 26 | 27 |23 | SUB VBLANK 24 |25 |
28 | None. 29 |Return 30 | 31 |
32 | None. 33 |Remarks 34 | 35 |
36 | Waits for the current scanline to reach 160 (bottom of the 37 | screen) before returning. The GBA refresh rate is 60 Hz (60 38 | vblanks occur per second). 39 |See Also 40 | 41 |
42 | SCANLINE 43 |44 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Creates a constant macro for the compiler. 22 |Parameters 26 | 27 |23 | #CONSTANT <id> {macro} 24 |25 |
28 | None. 29 |Return 30 | 31 |
32 | None. 33 |Remarks 34 | 35 |
36 | Macros can be good to define sprite indexes, or small code 37 | sequences for math, etc. Whenever <id> is encountered in 38 | your source code, it is replaced (at compile time) with 39 | {macro}. 40 |41 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Import a binary file. 22 |Parameters 26 | 27 |23 | #IMPORT "file" 24 |25 |
28 | None. 29 |Return 30 | 31 |
32 | None. 33 |Remarks 34 | 35 |
36 | This can be used to import direct binary files, byte for byte. 37 | The compiled ROM image will be word aligned before and after 38 | the binary file is imported. 39 |40 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Include another Dragon BASIC source file. 22 |Parameters 26 | 27 |23 | #INCLUDE "file" 24 |25 |
28 | None. 29 |Return 30 | 31 |
32 | None. 33 |Remarks 34 | 35 |
36 | Use this to include data files or other code snippets into your 37 | Dragon BASIC program. 38 |See Also 39 | 40 |
41 | #REQUIRES 42 |43 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Not implemented. 22 |Parameters 26 | 27 |23 | #MUSIC "file" 24 |25 |
28 | None. 29 |Return 30 | 31 |
32 | None. 33 |Remarks 34 | 35 |
36 | This directive is reserved for future use with MOD, XM and or 37 | MIDI file formats. 38 |See Also 39 | 40 |
41 | #SOUND 42 |43 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Import an 8- or 16-bit WAV file. 22 |Parameters 26 | 27 |23 | #SOUND "file" 24 |25 |
28 | None. 29 |Return 30 | 31 |
32 | None. 33 |Remarks 34 | 35 |
36 | The WAV file will be converted from 16-bit or stereo to 8-bit, 37 | mono sample to help save space, and can be played back with 38 | PLAYMUSIC or PLAYSOUND. 39 |See Also 40 | 41 |
42 | PLAYMUSIC | PLAYSOUND 44 |45 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Set the title of the compiled ROM image. 22 |Parameters 26 | 27 |23 | #TITLE "name" 24 |25 |
28 | None. 29 |Return 30 | 31 |
32 | None. 33 |Remarks 34 | 35 |
36 | The maximum length of name is 12 characters. If it is longer, 37 | the remaining characters will be truncated. Other than that, 38 | any ASCII characters will do. 39 |40 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | FADEIN - Fades the screen 22 | from black to normal.34 |
23 | FADEOUT - Fades the screen 24 | to black.
25 | MOSAIC - Sets the mosaic 26 | registers in the GBA.
27 | MOSAICTILES - Toggles 28 | whether a background should use the mosaic effect or 29 | not.
30 | SPRITEMOSAIC - 31 | Toggles whether a sprite should use the mosaic effect or 32 | not.
33 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Fades the screen from black to normal. 22 |Parameters 26 | 27 |23 | SUB FADEIN 24 |25 |
28 | None. 29 |Return 30 | 31 |
32 | None. 33 |Remarks 34 | 35 |
36 | Will slowly fade all the colors back onto the screen. This does 37 | not affect the palette! If already visible, the screen will go 38 | black, then fade in. 39 |See Also 40 | 41 |
42 | FADEOUT 43 |44 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Fades the screen to black. 22 |Parameters 26 | 27 |23 | SUB FADEOUT 24 |25 |
28 | None. 29 |Return 30 | 31 |
32 | None. 33 |Remarks 34 | 35 |
36 | Will slowly fade all the colors on the screen to black. This 37 | does not affect the palette! If already black, the screen will 38 | appear, then fade out. 39 |See Also 40 | 41 |
42 | FADEIN 43 |44 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Calculates the absolute value of an integer. 22 |Parameters 28 | 29 |23 | FUNCTION ABS( 24 | n 25 | ) 26 |27 |
30 | n - a signed integerReturn 32 | 33 |
31 |
34 | The absolute value of n ( |n| ). 35 |Remarks 36 | 37 |
38 | Checks to see if n is negative, and if it is, performs a two's 39 | complement and returns the new value. 40 |41 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Calculates an aligned address. 22 |Parameters 28 | 29 |23 | FUNCTION ALIGNED( 24 | address 25 | ) 26 |27 |
30 | address - a 32-bit, unsigned addressReturn 32 | 33 |
31 |
34 | A word aligned, 32-bit, unsigned address. 35 |Remarks 36 | 37 |
38 | If address is already word aligned, ALIGNED will return 39 | address. Otherwise, it will return the next available aligned 40 | address. 41 |See Also 42 | 43 |
44 | ALLOCATE 45 |46 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Waits for the current DMA transfer to finish. 22 |Parameters 26 | 27 |23 | SUB DMAWAIT 24 |25 |
28 | None. 29 |Return 30 | 31 |
32 | None. 33 |Remarks 34 | 35 |
36 | The current transfer can be caused by using DMACOPY, WALLPAPER 37 | or CLS. 38 |See Also 39 | 40 |
41 | CLS | DMACOPY | WALLPAPER 44 |45 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Converts an integer to a fixed-point value. 22 |Parameters 28 | 29 |23 | FUNCTION FIX#( 24 | n 25 | ) 26 |27 |
30 | n - an integerReturn 32 | 33 |
31 |
34 | The fixed-point equivelant of n. 35 |Remarks 36 | 37 |
38 | Converts n to a fixed-point value by bit-shifting left the 39 | whole value. 40 |See Also 41 | 42 |
43 | INT | ROUND 45 |46 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Calculates the square root value of a fixed-point value. 22 |Parameters 28 | 29 |23 | FUNCTION FSQRT#( 24 | f# 25 | ) 26 |27 |
30 | f# - an unsigned, fixed-point valueReturn 32 | 33 |
31 |
34 | The square root of f#. 35 |Remarks 36 | 37 |
38 | Same as SQRT, but more accurate, keeping decimal places to 39 | within 1/256. 40 |41 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Converts a fixed-point value to an integer. 22 |Parameters 28 | 29 |23 | FUNCTION INT( 24 | f# 25 | ) 26 |27 |
30 | f# - a fixed-point valueReturn 32 | 33 |
31 |
34 | The whole portion of f# without the fraction. 35 |Remarks 36 | 37 |
38 | Converts f# to an integer value by bit-shifting right the whole 39 | value. 40 |See Also 41 | 42 |
43 | FIX# | ROUND 45 |46 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Rounds a fixed-point value up or down and returns an integer. 22 |Parameters 28 | 29 |23 | FUNCTION ROUND( 24 | f# 25 | ) 26 |27 |
30 | f# - a fixed-point valueReturn 32 | 33 |
31 |
34 | The whole portion of the rounded value of f#. 35 |Remarks 36 | 37 |
38 | First rounds f# up or down to the nearest whole number. Then 39 | returns the whole value as an integer. 40 |See Also 41 | 42 |
43 | FIX# | INT 45 |46 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Calculates the square root value of an integer. 22 |Parameters 28 | 29 |23 | FUNCTION SQRT( 24 | n 25 | ) 26 |27 |
30 | n - an unsigned integerReturn 32 | 33 |
31 |
34 | The square root of n, to the nearest integer. 35 |Remarks 36 | 37 |
38 | Will not exceed the true square root of n. For example, SQRT(9) 39 | and SQRT(11) are both 3. 40 |41 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | INPUT - Waits for a button to 22 | change state.30 |
23 | KEY - Returns a masked copy of 24 | the current input register.
25 | KEYS - Returns the current 26 | input mask.
27 | WAITKEY - Waits for a button 28 | to be pressed and released.
29 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Returns the current input state. 22 |Parameters 26 | 27 |23 | SUB CHECKKEYS 24 |25 |
28 | None. 29 |Remarks 30 | 31 |
32 | CHECKKEYS keeps track of transitions in the state of keys. 33 | After calling CHECKKEYS it is possible to use KEYUP and 34 | KEYDOWN to determine which keys have changed state since 35 | the last call to CHECKKEYS. 36 |See Also 37 | 38 |
39 | KEYDOWN | KEYUP 41 |42 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Returns the current input state. 22 |Parameters 26 | 27 |23 | FUNCTION KEYS 24 |25 |
28 | None. 29 |Return 30 | 31 |
32 | Reads REG_P1 from the GBA hardware and returns it. 33 | All bits are flipped, so that a 0 is not-pressed and 1 is 34 | pressed. 35 |Remarks 36 | 37 |
38 | The return value can be masked using an AND operation along 39 | with a KEY_ constant to see if a button is pressed. 40 |See Also 41 | 42 |
43 | KEY | AND 45 |46 |
AND &expr = n1 and 40 | n2
41 | 42 |43 |58 | 59 |Description
44 | 45 |Performs a bitwise AND of two numbers.
46 | 47 |Results
48 | 49 |Returns the bitwise AND of n1 and n2.
50 | 51 |Example
52 |53 | ; perform a bitwise AND 54 | x = %1100 and %1001 ; x = %1000 56 |57 |
Back to Keywords
61 | 62 | 63 | -------------------------------------------------------------------------------- /dbapi/Keywords_CASE.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |CASE [expr] ...
12 | 13 |14 |44 | 45 |Description
15 | 16 |Compares the current SELECT expression against 17 | [expr].
18 | 19 |Results
20 | 21 |Tests the current SELECT expression against 22 | [expr]. If they match (are equal) then … is executed. 23 | Once … finishes, execution will continue after END 24 | SELECT.
25 | 26 |Example
27 |28 | ; act based on what buttons are pressed 29 | select not( keys ) 32 | case key_a or key_b 34 | ; a and b both pressed 35 | case key_start 36 | ; just start button 37 | default 39 | ; any other combination 40 | end select 42 |43 |
Back to Keywords
47 | 48 | 49 | -------------------------------------------------------------------------------- /dbapi/Keywords_DEFAULT.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |DEFAULT ...
12 | 13 |14 |40 | 41 |Description
15 | 16 |SELECT … END SELECT clause to execute if 17 | all other CASE statements fail.
18 | 19 |Results
20 | 21 |When used inside a SELECT … END SELECT clause, 22 | … following DEFAULT will execute only if all other CASE 23 | [expr] statements fail.
24 | 25 |Example
26 |27 | ; see what level we want to load 28 | select level 29 | case 1 30 | addr_ptr = level1! 31 | case 2 32 | addr_ptr = level2! 33 | default ; any other level 35 | level_not_made_yet 36 | end select 38 |39 |
Back to Keywords
43 | 44 | 45 | -------------------------------------------------------------------------------- /dbapi/Keywords_DIM.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |DIM ...
12 | 13 |14 |35 | 36 |Description
15 | 16 |Declares global variables.
17 | 18 |Results
19 | 20 |The variables named by DIM are declared. They 21 | can be indexed (arrays) , with the suffixe $ for a string and # 22 | for fix point.
23 | 24 |Example
25 |26 | ; declare some global variables 27 | dim x,list(10),temp$,y# 28 | 29 | 30 | temp$ = "Hello world" 31 | 32 | y# = 1.2 33 |34 |
Back to Keywords
38 | 39 | 40 | -------------------------------------------------------------------------------- /dbapi/Keywords_DOWNTO.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |DOWNTO
12 | 13 |14 |34 | 35 |Description
15 | 16 |Used in a FOR loop to denote an downward 17 | stepping counter variable.
18 | 19 |Results
20 | 21 |Sets the default STEP value in a FOR loop to -1 22 | and sets the conditional to less than (<).
23 | 24 |Example
25 |26 | ; sum the numbers from 100 to 1 27 | sum = 0 28 | for x = 100 downto 1 30 | sum = sum + x 31 | next 32 |33 |
Back to Keywords
37 | 38 | 39 | -------------------------------------------------------------------------------- /dbapi/Keywords_ELSE.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |ELSE ...
12 | 13 |14 |41 | 42 |Description
15 | 16 |Used inside an IF … END IF clause to 17 | denote an optional execution path.
18 | 19 |Results
20 | 21 |When used inside an IF [expr] … END IF 22 | clause, … following ELSE will execute if [expr] returns 23 | false (0).
24 | 25 |26 | 27 |
Example
28 |29 | ; checks to see if a sprite is on the right half of the screen 31 | if spritex(my_sprite) > 120 33 | ; execute code when on right 34 | else 35 | ; execute code when on left 36 | end if 38 | 39 |40 |
Back to Keywords
44 | 45 | 46 | -------------------------------------------------------------------------------- /dbapi/Keywords_EXIT.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |EXIT
12 | 13 |14 |37 | 38 |Description
15 | 16 |Exits an interrupt service routine.
17 | 18 |Results
19 | 20 |Closes the code block of the current ISR and 21 | returns program execution back to Dragon BASIC's interrupt 22 | handler.
23 | 24 |Example
25 |26 | ; create a new interrupt routine 27 | interrupt refresh 28 | updatesprites 29 | exit 30 | 31 | start: 32 | ; set refresh to be called automatically every vblank 34 | onvblank refresh 35 |36 |
Back to Keywords
40 | 41 | 42 | -------------------------------------------------------------------------------- /dbapi/Keywords_FOR.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |FOR var=[expr] to|downto [goal] &optional step 12 | [n]
13 | 14 |15 |40 | 41 |Description
16 | 17 |Begins a FOR loop.
18 | 19 |Results
20 | 21 |Compiles a FOR loop. Sets the counter variable 22 | 'var' to [expr]. If the keyword TO is used, then the loop 23 | continues executing until var > [goal]. If DOWNTO is used, 24 | execution continues until va < [goal].
25 | 26 |An optional STEP parameter is allowed. If specified, then 27 | var is incremented by [n] each iteration. Otherwise, [n] 28 | defaults to 1 for TO and -1 for DOWNTO.
29 | 30 |Example
31 |32 | ; loop through all the indices of a loop, skipping every other one 34 | for x = 0 to 99 step 2 36 | ; do something with list[x] 37 | next 38 |39 |
Back to Keywords
43 | 44 | 45 | -------------------------------------------------------------------------------- /dbapi/Keywords_FUNCTION.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |FUNCTION name &optional ([arg1,arg2,...])
12 | 13 |14 |39 | 40 |Description
15 | 16 |Declares a new function.
17 | 18 |Results
19 | 20 |Creates a new function in ROM with name. 21 | Optionally, parameters can be passed to the function to make 22 | use of.
23 | 24 |Example
25 |26 | ; create a function to sum a list of numbers 28 | function sum_array(list,count) 29 | total = 0 ; <-- total is global 30 | for x = 0 to count - 1 32 | total = total + list[x] 33 | next 34 | return total 35 | end function 37 |38 |
Back to Keywords
42 | 43 | 44 | -------------------------------------------------------------------------------- /dbapi/Keywords_IF.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |IF [expr] ... end if
12 | 13 |14 |36 | 37 |Description
15 | 16 |Begins a conditional block of code.
17 | 18 |Results
19 | 20 |If [expr] evaluates to true (non-zero) then the 21 | code following the IF statement is executed. IF statements are 22 | terminated with END IF.
23 | 24 |Example
25 |26 | ; test if the -A- button is pressed if so, clear the screen 28 | if key(key_a) 30 | cls screen,black 32 | end if 34 |35 |
Back to Keywords
39 | 40 | 41 | -------------------------------------------------------------------------------- /dbapi/Keywords_INTERRUPT.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |INTERRUPT name
12 | 13 |14 |40 | 41 |Description
15 | 16 |Creates a new interrupt service routine.
17 | 18 |Results
19 | 20 |Defines name as the label pointing to a new 21 | ISR. It can then be used with any of the ON… functions. 22 | Interrupt routines should be extremely short and fast! If an 23 | interrupt handler is too long, your program may begin to 24 | experience problems. Note: INTERRUPT routines must be 25 | matched with EXIT.
26 | 27 |Example
28 |29 | ; create a new interrupt routine 30 | interrupt refresh 31 | updatesprites 32 | exit 33 | 34 | start: 35 | ; set refresh to be called automatically every vblank 37 | onvblank refresh 38 |39 |
Back to Keywords
43 | 44 | 45 | -------------------------------------------------------------------------------- /dbapi/Keywords_LOOP.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |LOOP
12 | 13 |14 |35 | 36 |Description
15 | 16 |Terminates a WHILE loop.
17 | 18 |Results
19 | 20 |Closes the compiler clause of a WHILE loop. 21 | Must be matched with a WHILE statement.
22 | 23 |Example
24 |25 | ; create an infinite loop 26 | while 27 | ; wait for vertical blank then run game code 29 | vblank 30 | run_game_code 31 | loop ; run again 33 |34 |
Back to Keywords
38 | 39 | 40 | -------------------------------------------------------------------------------- /dbapi/Keywords_MAP.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 34 | 35 |MAP n1 &optional ,n2 40 | &optional ...
41 | 42 |43 |69 | 70 |Description
44 | 45 |MAP can be used to write constants into 46 | ROM.
47 | 48 |Results
49 | 50 |Compiles n1,n2,… into the ROM with 51 | 16-bit data each value.
52 | 53 |Example
54 |55 | ; create some data 56 | my_map: 57 | map 1,2,3,4,5,6 ; must be even before other code 60 | map 1,2,3,4,5,6 ; here we have 12 so it's ok. 63 | 64 | start: 65 | ; some code here then 66 | maptiles tile(8,0,0),my_map,6,2 67 |68 |
Back to Keywords
72 | 73 | 74 | -------------------------------------------------------------------------------- /dbapi/Keywords_MOD.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |MOD &expr = n1 mod n2
12 | 13 |14 |29 | 30 |Description
15 | 16 |Calculates the modula of two integers.
17 | 18 |Results
19 | 20 |Returns the remainder of two integers.
21 | 22 |Example
23 |24 | ; what is the remainder of 12/5? 25 | x = 12 mod 5 ; x = 2 27 |28 |
Back to Keywords
32 | 33 | 34 | -------------------------------------------------------------------------------- /dbapi/Keywords_NAND.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 34 | 35 |NAND &expr = n1 nand 40 | n2
41 | 42 |43 |58 | 59 |Description
44 | 45 |Performs a bitwise NAND of two numbers.
46 | 47 |Results
48 | 49 |Returns the bitwise NAND of n1 and n2.
50 | 51 |Example
52 |53 | ; perform a bitwise NAND 54 | x = %1100 nnand %1001 ; x = %0111 56 |57 |
Back to Keywords
61 | 62 | 63 | -------------------------------------------------------------------------------- /dbapi/Keywords_NEXT.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |NEXT
12 | 13 |14 |36 | 37 |Description
15 | 16 |End a FOR loop.
17 | 18 |Results
19 | 20 |Compiles the branch back to a FOR statement 21 | after incrementing var by the STEP value of the FOR loop.
22 | 23 |Example
24 |25 | ; loop through all the indices of a loop, skipping every other one 27 | for x = 0 to 99 step 2 30 | ; quit the loop if x > 50 31 | if x > 50 then x = 99 33 | next 34 |35 |
Back to Keywords
39 | 40 | 41 | -------------------------------------------------------------------------------- /dbapi/Keywords_NOR.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |NOR &expr = n1 nor n2
12 | 13 |14 |29 | 30 |Description
15 | 16 |Performs a bitwise NOR of two numbers.
17 | 18 |Results
19 | 20 |Returns the bitwise NOR of n1 and n2.
21 | 22 |Example
23 |24 | ; perform a bitwise NOR 25 | x = %1100 nor %1001 ; x = %0010 27 |28 |
Back to Keywords
32 | 33 | 34 | -------------------------------------------------------------------------------- /dbapi/Keywords_NOT.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |NOT [expr]
12 | 13 |14 |30 | 31 |Description
15 | 16 |Performs a logical NOT on an expression.
17 | 18 |Results
19 | 20 |Returns the logical NOT of [expr]. If [expr] is 21 | false (0), NOT returns true, otherwise false.
22 | 23 |Example
24 |25 | ; test to see if button a is released 26 | released = not key(key_a) 28 |29 |
Back to Keywords
33 | 34 | 35 | -------------------------------------------------------------------------------- /dbapi/Keywords_OR.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |OR &expr = n1 or n2
12 | 13 |14 |29 | 30 |Description
15 | 16 |Performs a bitwise OR of two numbers.
17 | 18 |Results
19 | 20 |Returns the bitwise OR of n1 and n2.
21 | 22 |Example
23 |24 | ; perform a bitwise OR 25 | x = %1100 or %1001 ; x = %1101 27 |28 |
Back to Keywords
32 | 33 | 34 | -------------------------------------------------------------------------------- /dbapi/Keywords_READ.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |READ var1 &optional ,var2 &optional 12 | ...
13 | 14 |15 |45 | 46 |Description
16 | 17 |Reads data from the current data pointer.
18 | 19 |Results
20 | 21 |Once the data pointer has been set with 22 | RESTORE, data may be READ from the ROM into variables. Each 23 | READ increments the data pointer by 4 bytes. Note:All data 24 | read is 32-bit (even if stored as 16-bit).
25 | 26 |Example
27 |28 | ; create some data 29 | my_data: 30 | data 1,2,3,4,5 31 | 32 | 33 | ; create an array 34 | dim x(5) 35 | 36 | start: 37 | ; restore and read the data 38 | restore my_data 39 | for k = 0 to 5 41 | read x[k] 42 | next 43 |44 |
Back to Keywords
48 | 49 | 50 | -------------------------------------------------------------------------------- /dbapi/Keywords_REPEAT.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |REPEAT
12 | 13 |14 |37 | 38 |Description
15 | 16 |Begins a REPEAT… UNTIL clause.
17 | 18 |Results
19 | 20 |Begins a loop to be terminated with UNTIL.
21 | 22 |Example
23 |24 | ; create a game loop 25 | repeat 26 | ; inside the game loop, create a loop that happens 28 | ; while the player is pressing the -B- button 30 | repeat 31 | ; do something 32 | until key(key_b)> 0 34 | until x > 76 35 |36 |
Back to Keywords
40 | 41 | 42 | -------------------------------------------------------------------------------- /dbapi/Keywords_RESET.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |RESET
12 | 13 |14 |32 | 33 |Description
15 | 16 |Resets the GBA.
17 | 18 |Results
19 | 20 |Program execution will automatically begin 21 | again at the "start" of rom.Don't use it
22 | 23 |I repeat DON'T USE 24 | IT it's broken.
25 | 26 |Example
27 |28 | ; reset the program 29 | reset 30 |31 |
Back to Keywords
35 | 36 | 37 | -------------------------------------------------------------------------------- /dbapi/Keywords_RESTORE.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |RESTORE
12 | 13 |14 |42 | 43 |Description
15 | 16 |The data pointer is set by RESTORE.
17 | 18 |Results
19 | 20 |Once the data pointer has been set with 21 | RESTORE, data may be READ from the ROM into variables.
22 | 23 |Example
24 |25 | ; create some data 26 | my_data: 27 | data 1,2,3,4,5 28 | 29 | 30 | ; create an array 31 | dim x(5) 32 | 33 | start: 34 | ; restore and read the data 35 | restore my_data 36 | for k = 0 to 5 38 | read x[k] 39 | next 40 |41 |
Back to Keywords
45 | 46 | 47 | -------------------------------------------------------------------------------- /dbapi/Keywords_RETURN.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |RETURN &optional [expr]
12 | 13 |14 |46 | 47 |Description
15 | 16 |RETURN is used from within a subroutine or 17 | FUNCTION to exit either. When used inside a function, it has 18 | the option of returning a value for the function.
19 | 20 |Results
21 | 22 |When used inside a subroutine, it halts 23 | execution of the subroutine and returns to the subroutine that 24 | called it (with GOSUB).
25 | 26 |When used inside a FUNCTION, it can optionally return a 27 | value ([expr]).
28 | 29 |Example
30 |31 | ; create a subroutine to update all sprites 33 | update: 34 | vblank 35 | updatesprites 36 | return 37 | 38 | ; create a function to return the sum of two numbers 40 | function add(n1,n2) 41 | return n1+n2 42 | end function 44 |45 |
Back to Keywords
49 | 50 | 51 | -------------------------------------------------------------------------------- /dbapi/Keywords_SELECT.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |SELECT [expr]
12 | 13 |14 |42 | 43 |Description
15 | 16 |Begins a SELECT clause where [expr] is tested 17 | against many possible CASE expressions.
18 | 19 |Results
20 | 21 |Compiles a SELECT expression, [expr], to be 22 | tested against various CASE expressions. If none of them match, 23 | a DEFAULT block of code will execute.
24 | 25 |Example
26 |27 | ; act based on what buttons are pressed 28 | select not keys 30 | case key_a or key_b 32 | ; a and b both pressed 33 | case key_start 34 | ; just start button 35 | default 37 | ; any other combination 38 | end select 40 |41 |
Back to Keywords
45 | 46 | 47 | -------------------------------------------------------------------------------- /dbapi/Keywords_SL.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |SL &expr = n1 sr n2
12 | 13 |14 |30 | 31 |Description
15 | 16 |Performs a logical shift left of two 17 | numbers.
18 | 19 |Results
20 | 21 |Returns the logical shift left of n1 and 22 | n2.
23 | 24 |Example
25 |26 | ; multiply x by 8 (shift left 3 bits) 27 | x = x sl 3 28 |29 |
Back to Keywords
33 | 34 | 35 | -------------------------------------------------------------------------------- /dbapi/Keywords_SR.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |SR &expr = n1 sr n2
12 | 13 |14 |30 | 31 |Description
15 | 16 |Performs a logical shift right of two 17 | numbers.
18 | 19 |Results
20 | 21 |Returns the logical shift right of n1 and 22 | n2.
23 | 24 |Example
25 |26 | ; shift x right by 4 bits 27 | x = x sr 4 28 |29 |
Back to Keywords
33 | 34 | 35 | -------------------------------------------------------------------------------- /dbapi/Keywords_STEP.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |STEP [expr]
12 | 13 |14 |34 | 35 |Description
15 | 16 |Sets the step value for a FOR loop.
17 | 18 |Results
19 | 20 |Overrides the default step value in a FOR loop 21 | with [expr]. Note: if DOWNTO is used, make sure that [expr] 22 | is a negative value.
23 | 24 |Example
25 |26 | ; sum the odd numbers from 1 to 100 27 | sum = 0 28 | for x = 1 to 100 step 2 30 | sum = sum + x 31 | next 32 |33 |
Back to Keywords
37 | 38 | 39 | -------------------------------------------------------------------------------- /dbapi/Keywords_SUB.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |SUB name &optional ([arg1,arg2,...])
12 | 13 |14 |38 | 39 |Description
15 | 16 |Declares a new sub.
17 | 18 |Results
19 | 20 |Creates a new sub in ROM with name. Optionally, 21 | parameters can be passed to the sub to make use of.
22 | 23 |Example
24 |25 | ; create a sub to sum a list of numbers 26 | sub sum_array(list,count) 27 | total = 0 ; <-- total is global 28 | for x = 0 to count - 1 30 | total = total + list[x] 31 | next 32 | return ; optionnal 34 | end sub 36 |37 |
Back to Keywords
41 | 42 | 43 | -------------------------------------------------------------------------------- /dbapi/Keywords_THEN.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |THEN [statement]
12 | 13 |14 |35 | 36 |Description
15 | 16 |Optional THEN statement after an IF 17 | statement.
18 | 19 |Results
20 | 21 |When placed after an IF statement, if the 22 | expression is true, then [statement] is executed instead of all 23 | the code following the IF statement.
24 | 25 |Example
26 |27 | ; make sure angle is between 0-359 28 | if angle < 0 then angle = angle + 360 30 | if angle > 359 then angle = angle - 360 33 |34 |
Back to Keywords
38 | 39 | 40 | -------------------------------------------------------------------------------- /dbapi/Keywords_TO.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |TO
12 | 13 |14 |34 | 35 |Description
15 | 16 |Used in a FOR loop to denote an upward stepping 17 | counter variable.
18 | 19 |Results
20 | 21 |Sets the default STEP value in a FOR loop to +1 22 | and sets the conditional to greater than (>).
23 | 24 |Example
25 |26 | ; sum the numbers from 1 to 100 27 | sum = 0 28 | for x = 1 to 100 30 | sum = sum + x 31 | next 32 |33 |
Back to Keywords
37 | 38 | 39 | -------------------------------------------------------------------------------- /dbapi/Keywords_UNTIL.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |UNTIL expression
12 | 13 |14 |35 | 36 |Description
15 | 16 |Terminates a REPEAT...UNTIL
17 | 18 |Results
19 | 20 |Closes the compiler clause of a REPEAT..UNTIL. 21 | Must be matched with a REPEAT statement.
22 | 23 |Example
24 |25 | ; create a loop 26 | repeat 27 | ; wait for vertical blank then run game code 29 | vblank 30 | run_game_code 31 | until x = 8 ; run again 33 |34 |
Back to Keywords
38 | 39 | 40 | -------------------------------------------------------------------------------- /dbapi/Keywords_WHILE.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |WHILE &optional [expr]
12 | 13 |14 |40 | 41 |Description
15 | 16 |Begins a WHILE … LOOP clause.
17 | 18 |Results
19 | 20 |Begins a loop to be terminated with LOOP. If 21 | [expr] is present, the loop will only execute while [expr] is 22 | true; [expr] is evaluated every iteration of the loop. If 23 | [expr] is not present, an infinite loop is created.
24 | 25 |Example
26 |27 | ; create an infinite game loop 28 | while 29 | ; inside the game loop, create a loop that happens 31 | ; while the player is pressing the -B- button 33 | while key(key_b) 35 | ; do something 36 | loop 37 | loop 38 |39 |
Back to Keywords
43 | 44 | 45 | -------------------------------------------------------------------------------- /dbapi/Keywords_XOR.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |XOR &expr = n1 xor n2
12 | 13 |14 |31 | 32 |Description
15 | 16 |Performs a bitwise exclusive OR of two 17 | numbers.
18 | 19 |Results
20 | 21 |Returns the bitwise exclusive OR of n1 and 22 | n2.
23 | 24 |Example
25 |26 | ; perform a bitwise exclusive OR 27 | x = %1100 xor %1001 ; x = %0101 29 |30 |
Back to Keywords
34 | 35 | 36 | -------------------------------------------------------------------------------- /dbapi/RAND.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 |Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | RANDOM - Computes a 22 | pseudo-random number in a range.28 |
23 | RND - Computes a 15-bit, 24 | pseudo-random number.
25 | SEED - Sets the random 26 | seed.
27 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | COS# - Look up the cosine of 22 | an angle.34 |
23 | MAKEROTATION - 24 | Setup one of the 4 available rotation matrices.
25 | ROTATESPRITE - 26 | Enables the rotation of a sprite.
27 | SIN# - Look up the sine of 28 | an angle.
29 | TAN# - Computes the tangent 30 | of an angle.
31 | WRAPANGLE - Clamps an 32 | angle to [0,359].
33 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Sets the random seed. 22 |Parameters 28 | 29 |23 | SUB SEED( 24 | n 25 | ) 26 |27 |
30 | n - a 32-bit seed valueReturn 32 | 33 |
31 |
34 | None. 35 |Remarks 36 | 37 |
38 | Sets the random number generator with n. To seed effectively, 39 | it is recommended to seed from user input. 40 |See Also 41 | 42 |
43 | RANDOM | RND 45 |46 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Look up the cosine of an angle. 22 |Parameters 28 | 29 |23 | FUNCTION COS#( 24 | degrees 25 | ) 26 |27 |
30 | degrees - an angle between 0-359Return 32 | 33 |
31 |
34 | The 24:8 fixed-point representation of the cosine of an angle. 35 |Remarks 36 | 37 |
38 | The angle must be in degrees and between 0-359. 39 |See Also 40 | 41 |
42 | SIN# | TAN# | WRAPANGLE 45 |46 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Look up the sine of an angle. 22 |Parameters 28 | 29 |23 | FUNCTION SIN#( 24 | degrees 25 | ) 26 |27 |
30 | degrees - an angle between 0-359Return 32 | 33 |
31 |
34 | The 24:8 fixed-point representation of the sine of an angle. 35 |Remarks 36 | 37 |
38 | The angle must be in degrees and between 0-359. 39 |See Also 40 | 41 |
42 | COS# | TAN# | WRAPANGLE 45 |46 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Computes the tangent of an angle. 22 |Parameters 28 | 29 |23 | FUNCTION TAN#( 24 | degrees 25 | ) 26 |27 |
30 | degrees - an angle between 0-359Return 32 | 33 |
31 |
34 | The 24:8 fixed-point representation of the tangent of an angle. 35 |Remarks 36 | 37 |
38 | The angle must be in degrees and between 0-359. 39 |See Also 40 | 41 |
42 | COS# | SIN# | WRAPANGLE 45 |46 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Stops the currently running music sample. 22 |Parameters 26 | 27 |23 | SUB STOPMUSIC 24 |25 |
28 | None. 29 |Return 30 | 31 |
32 | None. 33 |Remarks 34 | 35 |
36 | Calling this routine will instantly stop any music sample 37 | playing on the DirectSound channel A. 38 |See Also 39 | 40 |
41 | PLAYMUSIC | STOPSOUND 43 |44 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Stops the currently running sound sample. 22 |Parameters 26 | 27 |23 | SUB STOPSOUND 24 |25 |
28 | None. 29 |Return 30 | 31 |
32 | None. 33 |Remarks 34 | 35 |
36 | Calling this routine will instantly stop any sound sample 37 | playing on the DirectSound channel B. 38 |See Also 39 | 40 |
41 | PLAYSOUND | STOPMUSIC 43 |44 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Disables all sounds. 22 |Parameters 26 | 27 |23 | SUB TURNSOUNDOFF 24 |25 |
28 | None. 29 |Return 30 | 31 |
32 | None. 33 |Remarks 34 | 35 |
36 | Call this to turn off the sound chip on the GBA. This will 37 | instantly halt any currently playing music or sounds (although 38 | they will still be processed). 39 |See Also 40 | 41 |
42 | TURNSOUNDON 43 |44 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Hide a sprite so that it isn't displayed. 22 |Parameters 28 | 29 |23 | SUB HIDESPRITE( 24 | n 25 | ) 26 |27 |
30 | n - the sprite index (0-127)Return 32 | 33 |
31 |
34 | None. 35 |Remarks 36 | 37 |
38 | Moves the sprite offscreen (240,160) so that it isn't visible. 39 |See Also 40 | 41 |
42 | SPRITEHIDDEN 43 |44 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Updates all OAM data. 22 |Parameters 26 | 27 |23 | SUB UPDATESPRITES 24 |25 |
28 | None. 29 |Return 30 | 31 |
32 | None. 33 |Remarks 34 | 35 |
36 | Copies all data in RAM (duplicated OAM) to OAM memory to update 37 | the GBA hardware. This should only be done during a vertical 38 | blank period. 39 |See Also 40 | 41 |
42 | ONVBLANK | VBLANK 44 |45 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Loads the next available byte (8-bit) from static RAM. 22 |Parameters 26 | 27 |23 | FUNCTION LOADBYTE 24 |25 |
28 | None. 29 |Return 30 | 31 |
32 | Reads and returns the next byte in static RAM. 33 |Remarks 34 | 35 |
36 | After reading the next byte, the address pointer will 37 | self-increment. 38 |See Also 39 | 40 |
41 | LOADLONG | LOADWORD | SAVEBYTE 44 |45 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Loads the next available word (32-bit) from static RAM. 22 |Parameters 26 | 27 |23 | FUNCTION LOADLONG 24 |25 |
28 | None. 29 |Return 30 | 31 |
32 | Reads and returns the next byte in static RAM. 33 |Remarks 34 | 35 |
36 | After reading the next word, the address pointer will 37 | self-increment. 38 |See Also 39 | 40 |
41 | LOADBYTE | LOADWORD | SAVELONG 44 |45 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Loads the next available counted string frm static RAM. 22 |Parameters 26 | 27 |23 | FUNCTION LOADTEXT$ 24 |25 |
28 | None. 29 |Return 30 | 31 |
32 | A counted string. 33 |Remarks 34 | 35 |
36 | The counted string is copied into the destination. Increments 37 | the address pointer by the length of the string + 1. 38 |See Also 39 | 40 |
41 | SAVETEXT 42 |43 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Loads the next available halfword (16-bit) from static RAM. 22 |Parameters 26 | 27 |23 | FUNCTION LOADWORD 24 |25 |
28 | None. 29 |Return 30 | 31 |
32 | Reads and returns the next byte in static RAM. 33 |Remarks 34 | 35 |
36 | After reading the next halfword, the address pointer will 37 | self-increment. 38 |See Also 39 | 40 |
41 | LOADBYTE | LOADLONG | SAVEWORD 44 |45 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Saves a counted string to static RAM. 22 |Parameters 28 | 29 |23 | SUB SAVETEXT( 24 | string$ 25 | ) 26 |27 |
30 | string$ - the string to saveReturn 32 | 33 |
31 |
34 | None. 35 |Remarks 36 | 37 |
38 | This subroutine can only be used to save a string to static RAM 39 | (&E000000). It will not work on other RAM addresses. 40 |See Also 41 | 42 |
43 | LOADTEXT$ | RESTORE 45 |46 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Converts an integer to a string. 22 |Parameters 28 | 29 |23 | FUNCTION HEX$( 24 | n 25 | ) 26 |27 |
30 | n - the unsigned integer to convertReturn 32 | 33 |
31 |
34 | A string that is the hexadecimal representation of the number 35 | n. 36 |Remarks 37 | 38 |
39 | The number is converted using base 16, and it is treated as 40 | unsigned (no negative values). 41 |See Also 42 | 43 |
44 | LOG | STR$ 46 |47 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Calculates the length of a string. 22 |Parameters 28 | 29 |23 | FUNCTION LEN( 24 | string$ 25 | ) 26 |27 |
30 | string$ - the string to get the length ofReturn 32 | 33 |
31 |
34 | Returns the length of the string (0-255 characters). 35 |Remarks 36 | 37 |
38 | The length is always stored in the first byte of a string. 39 | Immediately following the length byte are the bytes of the 40 | string. 41 |See Also 42 | 43 |
44 | RESIZE 45 |46 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Converts an integer to a string. 22 |Parameters 28 | 29 |23 | FUNCTION STR$( 24 | n 25 | ) 26 |27 |
30 | n - the unsigned integer to convertReturn 32 | 33 |
31 |
34 | A string that is the decimal representation of the number n. 35 |Remarks 36 | 37 |
38 | The number is converted using base 10, and it is treated as 39 | unsigned (no negative values). 40 |See Also 41 | 42 |
43 | HEX$ | LOG 45 |46 |
Dragon BASIC, online at Official Website
14 | 15 |16 |32 | 33 | 34 | -------------------------------------------------------------------------------- /dbapi/Tiles_CHARBLOCK.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 |TIMER FUNCTIONS List
17 | 18 |19 |
31 |- CLOCKTIMER
20 | 21 |- MAKETIMER
22 | 23 |- RESETTIMER
24 | 25 |- STARTTIMER
26 | 27 |- STOPTIMER
28 | 29 |- WAITTIMER
30 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Gets the address of a character block. 22 |Parameters 28 | 29 |23 | FUNCTION CHARBLOCK( 24 | n 25 | ) 26 |27 |
30 | n - a character base block (0-3)Return 32 | 33 |
31 |
34 | The address of a character base block in VRAM. 35 |Remarks 36 | 37 |
38 | Character base blocks are used for tile data. They hold all 39 | tile graphics that screen blocks then use for mapping. 40 |See Also 41 | 42 |
43 | SCREENBLOCK 44 |45 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Disable a background layer. 22 |Parameters 28 | 29 |23 | SUB DISABLETILES( 24 | bg 25 | ) 26 |27 |
30 | bg - the background layer to disable (0-3)Return 32 | 33 |
31 |
34 | None. 35 |Remarks 36 | 37 |
38 | Disables the background layer, bg, so that it is no longer 39 | drawn. 40 |See Also 41 | 42 |
43 | ENABLETILES 44 |45 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Gets the address of a screen block. 22 |Parameters 28 | 29 |23 | FUNCTION SCREENBLOCK( 24 | n 25 | ) 26 |27 |
30 | n - a screen base block (0-31)Return 32 | 33 |
31 |
34 | The address of a screen base block in VRAM. 35 |Remarks 36 | 37 |
38 | Screen blocks contain map data. Each index in a screen block is 39 | a pointer to a tile in a corresponding character base block. 40 |See Also 41 | 42 |
43 | CHARBLOCK 44 |45 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Get the number of pixels scrolled. 22 |Parameters 28 | 29 |23 | FUNCTION SCROLLX( 24 | bg 25 | ) 26 |27 |
30 | bg - the background layer (0-3)Return 32 | 33 |
31 |
34 | The number of pixels scrolled horizontally. 35 |Remarks 36 | 37 |
38 | None. 39 |See Also 40 | 41 |
42 | SCROLL | SCROLLPOS | SCROLLY 45 |46 |
Dragon BASIC, online at http://github.com/uli/dragonbasic
17 | 18 |21 | Get the number of pixels scrolled. 22 |Parameters 28 | 29 |23 | FUNCTION SCROLLY( 24 | bg 25 | ) 26 |27 |
30 | bg - the background layer (0-3)Return 32 | 33 |
31 |
34 | The number of pixels scrolled vertically. 35 |Remarks 36 | 37 |
38 | None. 39 |See Also 40 | 41 |
42 | SCROLL | SCROLLPOS | SCROLLX 45 |46 |
Dragon BASIC, online at Official Website
14 | 15 |16 |43 | 44 |CLOCKTIMER
17 | 18 |Checks how many timer the user-defined timer 19 | has fired.
20 | 21 |Arguments
22 | 23 |No arguments
24 | 25 |Results
26 | 27 |Returns the number of times the timer has fired 28 | since the last RESETTIMER.
29 | 30 |Example
31 |32 | ; make a timer that fires 10 times a second 34 | maketimer 10 35 | starttimer 36 | 37 | ; do nothing until 5 seconds has elaped 38 | while clocktimer < 50 40 | loop 41 |42 |
Back to TIMER functions.
46 | 47 | 48 | -------------------------------------------------------------------------------- /dbapi/Timer_MAKETIMER.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |Dragon BASIC, online at Official Website
14 | 15 |16 |50 | 51 |MAKETIMER freq
17 | 18 |Initializes the user-defined timer.
19 | 20 |Arguments
21 | 22 |23 |
36 | 37 |24 | 28 | 29 |Parameter 25 | 26 |Meaning 27 |30 | 35 |freq 31 | 32 |the number of times the timer will fire 33 | per second 34 |Results
38 | 39 |Creates the new timer with all appropriate 40 | parameters. Note: the user-defined timer uses both timers 2 41 | & 3 of the GBA hardware.
42 | 43 |Example
44 |45 | ; create a new timer that fires 10 times a second 47 | maketimer 10 48 |49 |
Back to TIMER functions.
53 | 54 | 55 | -------------------------------------------------------------------------------- /dbapi/Timer_RESETTIMER.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |Dragon BASIC, online at Official Website
14 | 15 |16 |45 | 46 |RESETTIMER
17 | 18 |Resets the current fire count to 0.
19 | 20 |Arguments
21 | 22 |No arguments
23 | 24 |Results
25 | 26 |The total number of times the user-defined 27 | timer has fired is reset to 0.
28 | 29 |Example
30 |31 | ; create a timer that fires 20 times a second 33 | maketimer 20 34 | starttimer 35 | 36 | ; every time 10 fires have occurred, reset the timer 38 | while 39 | if clocktimer >= 10 then resettimer 42 | loop 43 |44 |
Back to TIMER functions.
48 | 49 | 50 | -------------------------------------------------------------------------------- /dbapi/Timer_STARTTIMER.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |Dragon BASIC, online at Official Website
14 | 15 |16 |38 | 39 |STARTTIMER
17 | 18 |Begins the user-defined timer.
19 | 20 |Arguments
21 | 22 |No arguments
23 | 24 |Results
25 | 26 |Starts the user-define timer firing. Note: 27 | this will not reset the timer to 0. You must use RESETTIMER to 28 | do this.
29 | 30 |Example
31 |32 | ; make a timer that fires 4 times a second and start it 34 | maketimer 4 35 | starttimer 36 |37 |
Back to TIMER functions.
41 | 42 | 43 | -------------------------------------------------------------------------------- /dbapi/Timer_STOPTIMER.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |Dragon BASIC, online at Official Website
14 | 15 |16 |47 | 48 |STOPTIMER
17 | 18 |Stops the user-defined timer from firing.
19 | 20 |Arguments
21 | 22 |No arguments
23 | 24 |Results
25 | 26 |Halts the user-defined timer. Note: this 27 | will not reset the timer to 0. You must use RESETTIMER to do 28 | this.
29 | 30 |Example
31 |32 | ; create an interrupt for the timer 33 | interrupt my_timer_int 34 | stoptimer ; stop the timer 36 | exit 37 | 38 | start: 39 | ; create a timer and let it go 40 | maketimer 10 41 | starttimer 42 | 43 | ; in 1/10 of a second it will stop automatically… 45 |46 |
Back to TIMER functions.
50 | 51 | 52 | -------------------------------------------------------------------------------- /dbapi/Timer_WAITTIMER.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |Dragon BASIC, online at Official Website
14 | 15 |16 |52 | 53 |MAKETIMER ticks
17 | 18 |Waits until the timer has fired so many 19 | times.
20 | 21 |waittimer
22 | 23 |24 |
36 | 37 |25 | 29 | 30 |Parameter 26 | 27 |Meaning 28 |31 | 35 |ticks 32 | 33 |the number of fires to wait for 34 |Results
38 | 39 |Halts program execution (except interrupts) 40 | until CLOCKTIMER returns >= ticks. This will not necessarily 41 | be the total number of ticks waited unless preceeded with a 42 | call to RESETTIMER.
43 | 44 |Example
45 |46 | ; create a timer and wait for 3 seconds 47 | maketimer 1 48 | starttimer 49 | waittimer 3 50 |51 |
Back to TIMER functions.
55 | 56 | 57 | -------------------------------------------------------------------------------- /dbapi/dbapi.hhp: -------------------------------------------------------------------------------- 1 | [Options] 2 | Compiled file = dbapi.chm 3 | Contents file = dbapi.hhc 4 | [Windows] 5 | $global_main="Dragon BASIC API Reference","dbapi.hhc",,"Index.htm","Index.htm" 6 | -------------------------------------------------------------------------------- /dbapi/sizes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/dbapi/sizes.png -------------------------------------------------------------------------------- /dbapi/styles.css: -------------------------------------------------------------------------------- 1 | .sub { 2 | background-color: #99CCFF; 3 | color: black; 4 | font-family: ms sans serif; 5 | font-size: 14px; 6 | border-width: 0; 7 | border-right-width: 1; 8 | border-bottom-width: 1; 9 | border-style: solid; 10 | border-color: gray; 11 | padding-top: 5px; 12 | padding-left: 5px; 13 | padding-bottom: 5px; 14 | } 15 | 16 | .sections { 17 | font-family: courier new; 18 | font-size: 24px; 19 | font-weight: 800; 20 | } 21 | 22 | .section { 23 | font-family: courier new; 24 | font-size: 12px; 25 | font-weight: 800; 26 | } 27 | .header { 28 | background-color: #CCCCCC; 29 | color: black; 30 | font-family: arial; 31 | font-size: 12px; 32 | font-weight: 800; 33 | vertical-align: middle; 34 | text-align: left; 35 | } 36 | 37 | .plist { 38 | 39 | border-width: 2; 40 | border-style: solid; 41 | border-color: gray; 42 | cell-spacing: none; 43 | } 44 | 45 | .meaning { 46 | color: black; 47 | font-family: arial; 48 | font-size: 10px; 49 | vertical-align: top; 50 | text-align: left; 51 | border-width: 2; 52 | border-style: solid; 53 | border-color: gray; 54 | } 55 | 56 | .param { 57 | color: black; 58 | font-family: arial; 59 | font-weight: 800; 60 | font-size: 12px; 61 | vertical-align: top; 62 | text-align: left; 63 | border-width: 2; 64 | border-style: solid; 65 | border-color: gray; 66 | } 67 | 68 | pre { 69 | background-color: #CCCCCC; 70 | color: black; 71 | font-family: courier new; 72 | } 73 | 74 | .api { 75 | color: blue; 76 | text-decoration: underline; 77 | } 78 | 79 | .keyword { 80 | color: black; 81 | font-weight: 800; 82 | text-decoration: underline; 83 | } 84 | -------------------------------------------------------------------------------- /docs/memory-map.txt: -------------------------------------------------------------------------------- 1 | EWRAM 2 | $2000000 - $203afff TIN variable space 3 | $203b000 - $203bfff NO$GBA debug output buffer 4 | $203c000 - $203cfff Temporary string ring buffer 5 | $203d000 - $203ffff C runtime EWRAM 6 | 7 | IWRAM 8 | $3000000 - $30003ff OAM staging buffer 9 | $3000400 - $30005ff BG register staging buffer 10 | $3000600 - $300060f Sound data 11 | $3000610 - $300063b User interrupt vectors 12 | 13 | $3000ffe - $3000fff Thumb thunking stub 14 | $3001000 - $3001fff TIN IWRAM code 15 | $3002000 - C runtime IWRAM 16 | 17 | - $3007bff Return stack 18 | $3007c00 - $3007eff User stack 19 | $3007f00 - $3007f9f Interrupt stack 20 | 21 | $3007ffc - $3007fff BIOS interrupt vector 22 | -------------------------------------------------------------------------------- /examples/Makefile: -------------------------------------------------------------------------------- 1 | OBJS = \ 2 | breakout/breakout.gba \ 3 | coppa/coppa.gba \ 4 | gapman/gapman2.gba \ 5 | mappy/mappy.gba \ 6 | moddemo/moddemo.gba \ 7 | old_tut_4/old_tut_4.gba \ 8 | old_tut_7/old_tut_7.gba \ 9 | tut_1/tut_1.gba \ 10 | tut_2/tut_2.gba \ 11 | tut_3/tut_3.gba \ 12 | tut_4/tut_4.gba \ 13 | tut_5/tut_5.gba \ 14 | tut_6/tut_6.gba \ 15 | tut_7/tut_7.gba \ 16 | tut_8/tut_8.gba \ 17 | tut_9/tut_9.gba \ 18 | wavy/wavy.gba \ 19 | 20 | all: $(OBJS) 21 | 22 | clean: 23 | rm -f */*.gba */*.sym 24 | 25 | $(OBJS): %.gba: %.dbc 26 | cd $(@D); ../../dbc -sym $(