├── 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 Help :: BITMAPPED :: SCREEN 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

BITMAPPED :: SCREEN

19 | 20 |
21 | Returns the currently hidden buffer in a double-buffer mode. 22 |
23 | FUNCTION SCREEN
24 | 
25 |
Parameters 26 | 27 |
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 |
45 | 46 |
47 | Send feedback on this 48 | topic
49 | Licensing information 51 |
52 | 53 | 54 | -------------------------------------------------------------------------------- /dbapi/Core_GRAPHICS.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: CORE :: GRAPHICS 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

CORE :: GRAPHICS

19 | 20 |
21 | Sets the current graphics mode. 22 |
23 | SUB GRAPHICS(
24 |     mode,
25 |     sprites
26 | )
27 | 
28 |
Parameters 29 | 30 |
31 | mode - the mode to set (must be 0-5)
32 | sprites - a boolean flag whether or not sprites should 33 | be enabled (0=no, non-0=yes)
34 |
Return 35 | 36 |
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 |
46 | 47 |
48 | Send feedback on this 49 | topic
50 | Licensing information 52 |
53 | 54 | 55 | -------------------------------------------------------------------------------- /dbapi/Core_LOG.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: CORE :: LOG 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

CORE :: LOG

19 | 20 |
21 | Writes a string to the console of VBA. 22 |
23 | SUB LOG(
24 |     string$
25 | )
26 | 
27 |
Parameters 28 | 29 |
30 | string$ - a string to send to the console
31 |
Return 32 | 33 |
34 | None. 35 |
Remarks 36 | 37 |
38 | This only works in VisualBoyAdvance. It will lock up actual 39 | hardware or other emulators. 40 |
41 |
42 | 43 |
44 | Send feedback on this 45 | topic
46 | Licensing information 48 |
49 | 50 | 51 | -------------------------------------------------------------------------------- /dbapi/Core_SCANLINE.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: CORE :: SCANLINE 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

CORE :: SCANLINE

19 | 20 |
21 | Returns the current scanline begin drawn. 22 |
23 | FUNCTION SCANLINE
24 | 
25 |
Parameters 26 | 27 |
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 |
44 | 45 |
46 | Send feedback on this 47 | topic
48 | Licensing information 50 |
51 | 52 | 53 | -------------------------------------------------------------------------------- /dbapi/Core_VBLANK.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: CORE :: VBLANK 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

CORE :: VBLANK

19 | 20 |
21 | Waits for the next vertical blank to begin. 22 |
23 | SUB VBLANK
24 | 
25 |
Parameters 26 | 27 |
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 |
45 | 46 |
47 | Send feedback on this 48 | topic
49 | Licensing information 51 |
52 | 53 | 54 | -------------------------------------------------------------------------------- /dbapi/Directives_CONSTANT.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: DIRECTIVES :: #CONSTANT 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

DIRECTIVES :: #CONSTANT

19 | 20 |
21 | Creates a constant macro for the compiler. 22 |
23 | #CONSTANT <id> {macro}
24 | 
25 |
Parameters 26 | 27 |
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 |
42 | 43 |
44 | Send 45 | feedback on this topic
46 | Licensing information 48 |
49 | 50 | 51 | -------------------------------------------------------------------------------- /dbapi/Directives_IMPORT.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: DIRECTIVES :: #IMPORT 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

DIRECTIVES :: #IMPORT

19 | 20 |
21 | Import a binary file. 22 |
23 | #IMPORT "file"
24 | 
25 |
Parameters 26 | 27 |
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 |
41 | 42 |
43 | Send feedback on this 44 | topic
45 | Licensing information 47 |
48 | 49 | 50 | -------------------------------------------------------------------------------- /dbapi/Directives_INCLUDE.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: DIRECTIVES :: #INCLUDE 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

DIRECTIVES :: #INCLUDE

19 | 20 |
21 | Include another Dragon BASIC source file. 22 |
23 | #INCLUDE "file"
24 | 
25 |
Parameters 26 | 27 |
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 |
44 | 45 |
46 | Send feedback on this 47 | topic
48 | Licensing information 50 |
51 | 52 | 53 | -------------------------------------------------------------------------------- /dbapi/Directives_MUSIC.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: DIRECTIVES :: #MUSIC 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

DIRECTIVES :: #MUSIC

19 | 20 |
21 | Not implemented. 22 |
23 | #MUSIC "file"
24 | 
25 |
Parameters 26 | 27 |
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 |
44 | 45 |
46 | Send feedback on this 47 | topic
48 | Licensing information 50 |
51 | 52 | 53 | -------------------------------------------------------------------------------- /dbapi/Directives_SOUND.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: DIRECTIVES :: #SOUND 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

DIRECTIVES :: #SOUND

19 | 20 |
21 | Import an 8- or 16-bit WAV file. 22 |
23 | #SOUND "file"
24 | 
25 |
Parameters 26 | 27 |
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 |
46 | 47 |
48 | Send feedback on this 49 | topic
50 | Licensing information 52 |
53 | 54 | 55 | -------------------------------------------------------------------------------- /dbapi/Directives_TITLE.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: DIRECTIVES :: #TITLE 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

DIRECTIVES :: #TITLE

19 | 20 |
21 | Set the title of the compiled ROM image. 22 |
23 | #TITLE "name"
24 | 
25 |
Parameters 26 | 27 |
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 |
41 | 42 |
43 | Send feedback on this 44 | topic
45 | Licensing information 47 |
48 | 49 | 50 | -------------------------------------------------------------------------------- /dbapi/EFFECTS.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: EFFECTS 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

EFFECTS Subroutines & Functions

19 | 20 |
21 | FADEIN - Fades the screen 22 | from black to normal.
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 |
34 |
35 | 36 |
37 | Send feedback on this 38 | topic
39 | Licensing information 41 |
42 | 43 | 44 | -------------------------------------------------------------------------------- /dbapi/Effects_FADEIN.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: EFFECTS :: FADEIN 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

EFFECTS :: FADEIN

19 | 20 |
21 | Fades the screen from black to normal. 22 |
23 | SUB FADEIN
24 | 
25 |
Parameters 26 | 27 |
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 |
45 | 46 |
47 | Send feedback on this 48 | topic
49 | Licensing information 51 |
52 | 53 | 54 | -------------------------------------------------------------------------------- /dbapi/Effects_FADEOUT.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: EFFECTS :: FADEOUT 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

EFFECTS :: FADEOUT

19 | 20 |
21 | Fades the screen to black. 22 |
23 | SUB FADEOUT
24 | 
25 |
Parameters 26 | 27 |
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 |
45 | 46 |
47 | Send feedback on this 48 | topic
49 | Licensing information 51 |
52 | 53 | 54 | -------------------------------------------------------------------------------- /dbapi/Extended_ABS.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: EXTENDED :: ABS 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

EXTENDED :: ABS

19 | 20 |
21 | Calculates the absolute value of an integer. 22 |
23 | FUNCTION ABS(
24 |     n
25 | )
26 | 
27 |
Parameters 28 | 29 |
30 | n - a signed integer
31 |
Return 32 | 33 |
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 |
42 | 43 |
44 | Send feedback on this 45 | topic
46 | Licensing information 48 |
49 | 50 | 51 | -------------------------------------------------------------------------------- /dbapi/Extended_ALIGNED.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: EXTENDED :: ALIGNED 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

EXTENDED :: ALIGNED

19 | 20 |
21 | Calculates an aligned address. 22 |
23 | FUNCTION ALIGNED(
24 |     address
25 | )
26 | 
27 |
Parameters 28 | 29 |
30 | address - a 32-bit, unsigned address
31 |
Return 32 | 33 |
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 |
47 | 48 |
49 | Send feedback on this 50 | topic
51 | Licensing information 53 |
54 | 55 | 56 | -------------------------------------------------------------------------------- /dbapi/Extended_DMAWAIT.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: EXTENDED :: DMAWAIT 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

EXTENDED :: DMAWAIT

19 | 20 |
21 | Waits for the current DMA transfer to finish. 22 |
23 | SUB DMAWAIT
24 | 
25 |
Parameters 26 | 27 |
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 |
46 | 47 |
48 | Send feedback on this 49 | topic
50 | Licensing information 52 |
53 | 54 | 55 | -------------------------------------------------------------------------------- /dbapi/Extended_FIX.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: EXTENDED :: FIX# 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

EXTENDED :: FIX#

19 | 20 |
21 | Converts an integer to a fixed-point value. 22 |
23 | FUNCTION FIX#(
24 |     n
25 | )
26 | 
27 |
Parameters 28 | 29 |
30 | n - an integer
31 |
Return 32 | 33 |
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 |
47 | 48 |
49 | Send feedback on this 50 | topic
51 | Licensing information 53 |
54 | 55 | 56 | -------------------------------------------------------------------------------- /dbapi/Extended_FSQRT.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: EXTENDED :: FSQRT# 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

EXTENDED :: FSQRT#

19 | 20 |
21 | Calculates the square root value of a fixed-point value. 22 |
23 | FUNCTION FSQRT#(
24 |     f#
25 | )
26 | 
27 |
Parameters 28 | 29 |
30 | f# - an unsigned, fixed-point value
31 |
Return 32 | 33 |
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 |
42 | 43 |
44 | Send feedback on this 45 | topic
46 | Licensing information 48 |
49 | 50 | 51 | -------------------------------------------------------------------------------- /dbapi/Extended_INT.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: EXTENDED :: INT 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

EXTENDED :: INT

19 | 20 |
21 | Converts a fixed-point value to an integer. 22 |
23 | FUNCTION INT(
24 |     f#
25 | )
26 | 
27 |
Parameters 28 | 29 |
30 | f# - a fixed-point value
31 |
Return 32 | 33 |
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 |
47 | 48 |
49 | Send feedback on this 50 | topic
51 | Licensing information 53 |
54 | 55 | 56 | -------------------------------------------------------------------------------- /dbapi/Extended_ROUND.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: EXTENDED :: ROUND 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

EXTENDED :: ROUND

19 | 20 |
21 | Rounds a fixed-point value up or down and returns an integer. 22 |
23 | FUNCTION ROUND(
24 |     f#
25 | )
26 | 
27 |
Parameters 28 | 29 |
30 | f# - a fixed-point value
31 |
Return 32 | 33 |
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 |
47 | 48 |
49 | Send feedback on this 50 | topic
51 | Licensing information 53 |
54 | 55 | 56 | -------------------------------------------------------------------------------- /dbapi/Extended_SQRT.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: EXTENDED :: SQRT 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

EXTENDED :: SQRT

19 | 20 |
21 | Calculates the square root value of an integer. 22 |
23 | FUNCTION SQRT(
24 |     n
25 | )
26 | 
27 |
Parameters 28 | 29 |
30 | n - an unsigned integer
31 |
Return 32 | 33 |
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 |
42 | 43 |
44 | Send feedback on this 45 | topic
46 | Licensing information 48 |
49 | 50 | 51 | -------------------------------------------------------------------------------- /dbapi/INPUT.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: INPUT 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

INPUT Subroutines & Functions

19 | 20 |
21 | INPUT - Waits for a button to 22 | change state.
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 |
30 |
31 | 32 |
33 | Send feedback on this 34 | topic
35 | Licensing information 37 |
38 | 39 | 40 | -------------------------------------------------------------------------------- /dbapi/Input_CHECKKEYS.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: INPUT :: CHECKKEYS 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

INPUT :: CHECKKEYS

19 | 20 |
21 | Returns the current input state. 22 |
23 | SUB CHECKKEYS
24 | 
25 |
Parameters 26 | 27 |
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 |
43 | 44 |
45 | Send feedback on this 46 | topic
47 | Licensing information 49 |
50 | 51 | 52 | -------------------------------------------------------------------------------- /dbapi/Input_KEYS.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: INPUT :: KEYS 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

INPUT :: KEYS

19 | 20 |
21 | Returns the current input state. 22 |
23 | FUNCTION KEYS
24 | 
25 |
Parameters 26 | 27 |
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 |
47 | 48 |
49 | Send feedback on this 50 | topic
51 | Licensing information 53 |
54 | 55 | 56 | -------------------------------------------------------------------------------- /dbapi/Keywords_AND.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 34 | 35 | Dragon BASIC Help :: INPUT :: INPUT 36 | 37 | 38 | 39 |

AND &expr = n1 and 40 | n2

41 | 42 |
43 |

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 |
58 | 59 |

Back to Keywords

61 | 62 | 63 | -------------------------------------------------------------------------------- /dbapi/Keywords_CASE.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | CASE 8 | 9 | 10 | 11 |

CASE [expr] ...

12 | 13 |
14 |

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 |
44 | 45 |

Back to Keywords

47 | 48 | 49 | -------------------------------------------------------------------------------- /dbapi/Keywords_DEFAULT.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | ELSE 8 | 9 | 10 | 11 |

DEFAULT ...

12 | 13 |
14 |

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 |
40 | 41 |

Back to Keywords

43 | 44 | 45 | -------------------------------------------------------------------------------- /dbapi/Keywords_DIM.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | DIM 8 | 9 | 10 | 11 |

DIM ...

12 | 13 |
14 |

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 |
35 | 36 |

Back to Keywords

38 | 39 | 40 | -------------------------------------------------------------------------------- /dbapi/Keywords_DOWNTO.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | DOWNTO 8 | 9 | 10 | 11 |

DOWNTO

12 | 13 |
14 |

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 |
34 | 35 |

Back to Keywords

37 | 38 | 39 | -------------------------------------------------------------------------------- /dbapi/Keywords_ELSE.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | ELSE 8 | 9 | 10 | 11 |

ELSE ...

12 | 13 |
14 |

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 |
41 | 42 |

Back to Keywords

44 | 45 | 46 | -------------------------------------------------------------------------------- /dbapi/Keywords_EXIT.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | EXIT 8 | 9 | 10 | 11 |

EXIT

12 | 13 |
14 |

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 |
37 | 38 |

Back to Keywords

40 | 41 | 42 | -------------------------------------------------------------------------------- /dbapi/Keywords_FOR.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | FOR 8 | 9 | 10 | 11 |

FOR var=[expr] to|downto [goal] &optional step 12 | [n]

13 | 14 |
15 |

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 |
40 | 41 |

Back to Keywords

43 | 44 | 45 | -------------------------------------------------------------------------------- /dbapi/Keywords_FUNCTION.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | FUNCTION 8 | 9 | 10 | 11 |

FUNCTION name &optional ([arg1,arg2,...])

12 | 13 |
14 |

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 |
39 | 40 |

Back to Keywords

42 | 43 | 44 | -------------------------------------------------------------------------------- /dbapi/Keywords_IF.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | IF 8 | 9 | 10 | 11 |

IF [expr] ... end if

12 | 13 |
14 |

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 |
36 | 37 |

Back to Keywords

39 | 40 | 41 | -------------------------------------------------------------------------------- /dbapi/Keywords_INTERRUPT.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | INTERRUPT 8 | 9 | 10 | 11 |

INTERRUPT name

12 | 13 |
14 |

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 |
40 | 41 |

Back to Keywords

43 | 44 | 45 | -------------------------------------------------------------------------------- /dbapi/Keywords_LOOP.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | LOOP 8 | 9 | 10 | 11 |

LOOP

12 | 13 |
14 |

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 |
35 | 36 |

Back to Keywords

38 | 39 | 40 | -------------------------------------------------------------------------------- /dbapi/Keywords_MAP.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 34 | 35 | Dragon BASIC Help :: INPUT :: INPUT 36 | 37 | 38 | 39 |

MAP n1 &optional ,n2 40 | &optional ...

41 | 42 |
43 |

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 |
69 | 70 |

Back to Keywords

72 | 73 | 74 | -------------------------------------------------------------------------------- /dbapi/Keywords_MOD.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MOD 8 | 9 | 10 | 11 |

MOD &expr = n1 mod n2

12 | 13 |
14 |

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 |
29 | 30 |

Back to Keywords

32 | 33 | 34 | -------------------------------------------------------------------------------- /dbapi/Keywords_NAND.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 34 | 35 | Dragon BASIC Help :: INPUT :: INPUT 36 | 37 | 38 | 39 |

NAND &expr = n1 nand 40 | n2

41 | 42 |
43 |

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 |
58 | 59 |

Back to Keywords

61 | 62 | 63 | -------------------------------------------------------------------------------- /dbapi/Keywords_NEXT.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | NEXT 8 | 9 | 10 | 11 |

NEXT

12 | 13 |
14 |

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 |
36 | 37 |

Back to Keywords

39 | 40 | 41 | -------------------------------------------------------------------------------- /dbapi/Keywords_NOR.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | NOR 8 | 9 | 10 | 11 |

NOR &expr = n1 nor n2

12 | 13 |
14 |

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 |
29 | 30 |

Back to Keywords

32 | 33 | 34 | -------------------------------------------------------------------------------- /dbapi/Keywords_NOT.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | NOT 8 | 9 | 10 | 11 |

NOT [expr]

12 | 13 |
14 |

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 |
30 | 31 |

Back to Keywords

33 | 34 | 35 | -------------------------------------------------------------------------------- /dbapi/Keywords_OR.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | OR 8 | 9 | 10 | 11 |

OR &expr = n1 or n2

12 | 13 |
14 |

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 |
29 | 30 |

Back to Keywords

32 | 33 | 34 | -------------------------------------------------------------------------------- /dbapi/Keywords_READ.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | READ 8 | 9 | 10 | 11 |

READ var1 &optional ,var2 &optional 12 | ...

13 | 14 |
15 |

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 |
45 | 46 |

Back to Keywords

48 | 49 | 50 | -------------------------------------------------------------------------------- /dbapi/Keywords_REPEAT.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | WHILE 8 | 9 | 10 | 11 |

REPEAT

12 | 13 |
14 |

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 |
37 | 38 |

Back to Keywords

40 | 41 | 42 | -------------------------------------------------------------------------------- /dbapi/Keywords_RESET.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | RESET 8 | 9 | 10 | 11 |

RESET

12 | 13 |
14 |

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 |
32 | 33 |

Back to Keywords

35 | 36 | 37 | -------------------------------------------------------------------------------- /dbapi/Keywords_RESTORE.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | READ 8 | 9 | 10 | 11 |

RESTORE

12 | 13 |
14 |

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 |
42 | 43 |

Back to Keywords

45 | 46 | 47 | -------------------------------------------------------------------------------- /dbapi/Keywords_RETURN.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | RETURN 8 | 9 | 10 | 11 |

RETURN &optional [expr]

12 | 13 |
14 |

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 |
46 | 47 |

Back to Keywords

49 | 50 | 51 | -------------------------------------------------------------------------------- /dbapi/Keywords_SELECT.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | SELECT 8 | 9 | 10 | 11 |

SELECT [expr]

12 | 13 |
14 |

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 |
42 | 43 |

Back to Keywords

45 | 46 | 47 | -------------------------------------------------------------------------------- /dbapi/Keywords_SL.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | SL 8 | 9 | 10 | 11 |

SL &expr = n1 sr n2

12 | 13 |
14 |

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 |
30 | 31 |

Back to Keywords

33 | 34 | 35 | -------------------------------------------------------------------------------- /dbapi/Keywords_SR.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | SR 8 | 9 | 10 | 11 |

SR &expr = n1 sr n2

12 | 13 |
14 |

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 |
30 | 31 |

Back to Keywords

33 | 34 | 35 | -------------------------------------------------------------------------------- /dbapi/Keywords_STEP.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | STEP 8 | 9 | 10 | 11 |

STEP [expr]

12 | 13 |
14 |

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 |
34 | 35 |

Back to Keywords

37 | 38 | 39 | -------------------------------------------------------------------------------- /dbapi/Keywords_SUB.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | FUNCTION 8 | 9 | 10 | 11 |

SUB name &optional ([arg1,arg2,...])

12 | 13 |
14 |

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 |
38 | 39 |

Back to Keywords

41 | 42 | 43 | -------------------------------------------------------------------------------- /dbapi/Keywords_THEN.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | THEN 8 | 9 | 10 | 11 |

THEN [statement]

12 | 13 |
14 |

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 |
35 | 36 |

Back to Keywords

38 | 39 | 40 | -------------------------------------------------------------------------------- /dbapi/Keywords_TO.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | TO 8 | 9 | 10 | 11 |

TO

12 | 13 |
14 |

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 |
34 | 35 |

Back to Keywords

37 | 38 | 39 | -------------------------------------------------------------------------------- /dbapi/Keywords_UNTIL.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | LOOP 8 | 9 | 10 | 11 |

UNTIL expression

12 | 13 |
14 |

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 |
35 | 36 |

Back to Keywords

38 | 39 | 40 | -------------------------------------------------------------------------------- /dbapi/Keywords_WHILE.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | WHILE 8 | 9 | 10 | 11 |

WHILE &optional [expr]

12 | 13 |
14 |

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 |
40 | 41 |

Back to Keywords

43 | 44 | 45 | -------------------------------------------------------------------------------- /dbapi/Keywords_XOR.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | XOR 8 | 9 | 10 | 11 |

XOR &expr = n1 xor n2

12 | 13 |
14 |

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 |
31 | 32 |

Back to Keywords

34 | 35 | 36 | -------------------------------------------------------------------------------- /dbapi/RAND.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: RAND 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

RAND Subroutines & Functions

19 | 20 |
21 | RANDOM - Computes a 22 | pseudo-random number in a range.
23 | RND - Computes a 15-bit, 24 | pseudo-random number.
25 | SEED - Sets the random 26 | seed.
27 |
28 |
29 | 30 |
31 | Send feedback on this 32 | topic
33 | Licensing information 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /dbapi/ROTATIONS.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: ROTATIONS 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

ROTATIONS Subroutines & Functions

19 | 20 |
21 | COS# - Look up the cosine of 22 | an angle.
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 |
34 |
35 | 36 |
37 | Send feedback on this 38 | topic
39 | Licensing information 41 |
42 | 43 | 44 | -------------------------------------------------------------------------------- /dbapi/Rand_SEED.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: RAND :: SEED 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

RAND :: SEED

19 | 20 |
21 | Sets the random seed. 22 |
23 | SUB SEED(
24 |     n
25 | )
26 | 
27 |
Parameters 28 | 29 |
30 | n - a 32-bit seed value
31 |
Return 32 | 33 |
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 |
47 | 48 |
49 | Send feedback on this 50 | topic
51 | Licensing information 53 |
54 | 55 | 56 | -------------------------------------------------------------------------------- /dbapi/Rotations_COS.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: ROTATIONS :: COS# 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

ROTATIONS :: COS#

19 | 20 |
21 | Look up the cosine of an angle. 22 |
23 | FUNCTION COS#(
24 |     degrees
25 | )
26 | 
27 |
Parameters 28 | 29 |
30 | degrees - an angle between 0-359
31 |
Return 32 | 33 |
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 |
47 | 48 |
49 | Send feedback on this 50 | topic
51 | Licensing information 53 |
54 | 55 | 56 | -------------------------------------------------------------------------------- /dbapi/Rotations_SIN.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: ROTATIONS :: SIN# 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

ROTATIONS :: SIN#

19 | 20 |
21 | Look up the sine of an angle. 22 |
23 | FUNCTION SIN#(
24 |     degrees
25 | )
26 | 
27 |
Parameters 28 | 29 |
30 | degrees - an angle between 0-359
31 |
Return 32 | 33 |
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 |
47 | 48 |
49 | Send feedback on this 50 | topic
51 | Licensing information 53 |
54 | 55 | 56 | -------------------------------------------------------------------------------- /dbapi/Rotations_TAN.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: ROTATIONS :: TAN# 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

ROTATIONS :: TAN#

19 | 20 |
21 | Computes the tangent of an angle. 22 |
23 | FUNCTION TAN#(
24 |     degrees
25 | )
26 | 
27 |
Parameters 28 | 29 |
30 | degrees - an angle between 0-359
31 |
Return 32 | 33 |
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 |
47 | 48 |
49 | Send feedback on this 50 | topic
51 | Licensing information 53 |
54 | 55 | 56 | -------------------------------------------------------------------------------- /dbapi/Sound_STOPMUSIC.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: SOUND :: STOPMUSIC 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

SOUND :: STOPMUSIC

19 | 20 |
21 | Stops the currently running music sample. 22 |
23 | SUB STOPMUSIC
24 | 
25 |
Parameters 26 | 27 |
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 |
45 | 46 |
47 | Send feedback on this 48 | topic
49 | Licensing information 51 |
52 | 53 | 54 | -------------------------------------------------------------------------------- /dbapi/Sound_STOPSOUND.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: SOUND :: STOPSOUND 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

SOUND :: STOPSOUND

19 | 20 |
21 | Stops the currently running sound sample. 22 |
23 | SUB STOPSOUND
24 | 
25 |
Parameters 26 | 27 |
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 |
45 | 46 |
47 | Send feedback on this 48 | topic
49 | Licensing information 51 |
52 | 53 | 54 | -------------------------------------------------------------------------------- /dbapi/Sound_TURNSOUNDOFF.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: SOUND :: TURNSOUNDOFF 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

SOUND :: TURNSOUNDOFF

19 | 20 |
21 | Disables all sounds. 22 |
23 | SUB TURNSOUNDOFF
24 | 
25 |
Parameters 26 | 27 |
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 |
45 | 46 |
47 | Send feedback on this 48 | topic
49 | Licensing information 51 |
52 | 53 | 54 | -------------------------------------------------------------------------------- /dbapi/Sprites_HIDESPRITE.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: SPRITES :: HIDESPRITE 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

SPRITES :: HIDESPRITE

19 | 20 |
21 | Hide a sprite so that it isn't displayed. 22 |
23 | SUB HIDESPRITE(
24 |     n
25 | )
26 | 
27 |
Parameters 28 | 29 |
30 | n - the sprite index (0-127)
31 |
Return 32 | 33 |
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 |
45 | 46 |
47 | Send feedback on this 48 | topic
49 | Licensing information 51 |
52 | 53 | 54 | -------------------------------------------------------------------------------- /dbapi/Sprites_UPDATESPRITES.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: SPRITES :: UPDATESPRITES 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

SPRITES :: UPDATESPRITES

19 | 20 |
21 | Updates all OAM data. 22 |
23 | SUB UPDATESPRITES
24 | 
25 |
Parameters 26 | 27 |
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 |
46 | 47 |
48 | Send feedback on this 49 | topic
50 | Licensing information 52 |
53 | 54 | 55 | -------------------------------------------------------------------------------- /dbapi/Sram_LOADBYTE.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: SRAM :: LOADBYTE 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

SRAM :: LOADBYTE

19 | 20 |
21 | Loads the next available byte (8-bit) from static RAM. 22 |
23 | FUNCTION LOADBYTE
24 | 
25 |
Parameters 26 | 27 |
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 |
46 | 47 |
48 | Send feedback on this 49 | topic
50 | Licensing information 52 |
53 | 54 | 55 | -------------------------------------------------------------------------------- /dbapi/Sram_LOADLONG.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: SRAM :: LOADLONG 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

SRAM :: LOADLONG

19 | 20 |
21 | Loads the next available word (32-bit) from static RAM. 22 |
23 | FUNCTION LOADLONG
24 | 
25 |
Parameters 26 | 27 |
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 |
46 | 47 |
48 | Send feedback on this 49 | topic
50 | Licensing information 52 |
53 | 54 | 55 | -------------------------------------------------------------------------------- /dbapi/Sram_LOADTEXT.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: SRAM :: LOADTEXT$ 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

SRAM :: LOADTEXT$

19 | 20 |
21 | Loads the next available counted string frm static RAM. 22 |
23 | FUNCTION LOADTEXT$
24 | 
25 |
Parameters 26 | 27 |
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 |
44 | 45 |
46 | Send feedback on this 47 | topic
48 | Licensing information 50 |
51 | 52 | 53 | -------------------------------------------------------------------------------- /dbapi/Sram_LOADWORD.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: SRAM :: LOADWORD 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

SRAM :: LOADWORD

19 | 20 |
21 | Loads the next available halfword (16-bit) from static RAM. 22 |
23 | FUNCTION LOADWORD
24 | 
25 |
Parameters 26 | 27 |
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 |
46 | 47 |
48 | Send feedback on this 49 | topic
50 | Licensing information 52 |
53 | 54 | 55 | -------------------------------------------------------------------------------- /dbapi/Sram_SAVETEXT.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: SRAM :: SAVETEXT 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

SRAM :: SAVETEXT

19 | 20 |
21 | Saves a counted string to static RAM. 22 |
23 | SUB SAVETEXT(
24 |     string$
25 | )
26 | 
27 |
Parameters 28 | 29 |
30 | string$ - the string to save
31 |
Return 32 | 33 |
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 |
47 | 48 |
49 | Send feedback on this 50 | topic
51 | Licensing information 53 |
54 | 55 | 56 | -------------------------------------------------------------------------------- /dbapi/Strings_HEX.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: STRINGS :: HEX$ 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

STRINGS :: HEX$

19 | 20 |
21 | Converts an integer to a string. 22 |
23 | FUNCTION HEX$(
24 |     n
25 | )
26 | 
27 |
Parameters 28 | 29 |
30 | n - the unsigned integer to convert
31 |
Return 32 | 33 |
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 |
48 | 49 |
50 | Send feedback on this 51 | topic
52 | Licensing information 54 |
55 | 56 | 57 | -------------------------------------------------------------------------------- /dbapi/Strings_LEN.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: STRINGS :: LEN 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

STRINGS :: LEN

19 | 20 |
21 | Calculates the length of a string. 22 |
23 | FUNCTION LEN(
24 |     string$
25 | )
26 | 
27 |
Parameters 28 | 29 |
30 | string$ - the string to get the length of
31 |
Return 32 | 33 |
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 |
47 | 48 |
49 | Send feedback on this 50 | topic
51 | Licensing information 53 |
54 | 55 | 56 | -------------------------------------------------------------------------------- /dbapi/Strings_STR.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: STRINGS :: STR$ 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

STRINGS :: STR$

19 | 20 |
21 | Converts an integer to a string. 22 |
23 | FUNCTION STR$(
24 |     n
25 | )
26 | 
27 |
Parameters 28 | 29 |
30 | n - the unsigned integer to convert
31 |
Return 32 | 33 |
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 |
47 | 48 |
49 | Send feedback on this 50 | topic
51 | Licensing information 53 |
54 | 55 | 56 | -------------------------------------------------------------------------------- /dbapi/TIMER.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | TIMER 8 | 9 | 10 | 11 |

Dragon BASIC, online at Official Website

14 | 15 |
16 |

TIMER FUNCTIONS List

17 | 18 | 31 |
32 | 33 | 34 | -------------------------------------------------------------------------------- /dbapi/Tiles_CHARBLOCK.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: TILES :: CHARBLOCK 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

TILES :: CHARBLOCK

19 | 20 |
21 | Gets the address of a character block. 22 |
23 | FUNCTION CHARBLOCK(
24 |     n
25 | )
26 | 
27 |
Parameters 28 | 29 |
30 | n - a character base block (0-3)
31 |
Return 32 | 33 |
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 |
46 | 47 |
48 | Send feedback on this 49 | topic
50 | Licensing information 52 |
53 | 54 | 55 | -------------------------------------------------------------------------------- /dbapi/Tiles_DISABLETILES.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: TILES :: DISABLETILES 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

TILES :: DISABLETILES

19 | 20 |
21 | Disable a background layer. 22 |
23 | SUB DISABLETILES(
24 |     bg
25 | )
26 | 
27 |
Parameters 28 | 29 |
30 | bg - the background layer to disable (0-3)
31 |
Return 32 | 33 |
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 |
46 | 47 |
48 | Send feedback on this 49 | topic
50 | Licensing information 52 |
53 | 54 | 55 | -------------------------------------------------------------------------------- /dbapi/Tiles_SCREENBLOCK.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: TILES :: SCREENBLOCK 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

TILES :: SCREENBLOCK

19 | 20 |
21 | Gets the address of a screen block. 22 |
23 | FUNCTION SCREENBLOCK(
24 |     n
25 | )
26 | 
27 |
Parameters 28 | 29 |
30 | n - a screen base block (0-31)
31 |
Return 32 | 33 |
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 |
46 | 47 |
48 | Send feedback on this 49 | topic
50 | Licensing information 52 |
53 | 54 | 55 | -------------------------------------------------------------------------------- /dbapi/Tiles_SCROLLX.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: TILES :: SCROLLX 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

TILES :: SCROLLX

19 | 20 |
21 | Get the number of pixels scrolled. 22 |
23 | FUNCTION SCROLLX(
24 |     bg
25 | )
26 | 
27 |
Parameters 28 | 29 |
30 | bg - the background layer (0-3)
31 |
Return 32 | 33 |
34 | The number of pixels scrolled horizontally. 35 |
Remarks 36 | 37 |
38 | None. 39 |
See Also 40 | 41 |
42 | SCROLL | SCROLLPOS | SCROLLY 45 |
46 |
47 | 48 |
49 | Send feedback on this 50 | topic
51 | Licensing information 53 |
54 | 55 | 56 | -------------------------------------------------------------------------------- /dbapi/Tiles_SCROLLY.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | Dragon BASIC Help :: TILES :: SCROLLY 11 | 12 | 13 | 14 |

Dragon BASIC, online at http://github.com/uli/dragonbasic

17 | 18 |

TILES :: SCROLLY

19 | 20 |
21 | Get the number of pixels scrolled. 22 |
23 | FUNCTION SCROLLY(
24 |     bg
25 | )
26 | 
27 |
Parameters 28 | 29 |
30 | bg - the background layer (0-3)
31 |
Return 32 | 33 |
34 | The number of pixels scrolled vertically. 35 |
Remarks 36 | 37 |
38 | None. 39 |
See Also 40 | 41 |
42 | SCROLL | SCROLLPOS | SCROLLX 45 |
46 |
47 | 48 |
49 | Send feedback on this 50 | topic
51 | Licensing information 53 |
54 | 55 | 56 | -------------------------------------------------------------------------------- /dbapi/Timer_CLOCKTIMER.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | CLOCKTIMER 8 | 9 | 10 | 11 |

Dragon BASIC, online at Official Website

14 | 15 |
16 |

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 |
43 | 44 |

Back to TIMER functions.

46 | 47 | 48 | -------------------------------------------------------------------------------- /dbapi/Timer_MAKETIMER.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | MAKETIMER 8 | 9 | 10 | 11 |

Dragon BASIC, online at Official Website

14 | 15 |
16 |

MAKETIMER freq

17 | 18 |

Initializes the user-defined timer.

19 | 20 |

Arguments

21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 34 | 35 |
ParameterMeaning
freqthe number of times the timer will fire 33 | per second
36 | 37 |

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 |
50 | 51 |

Back to TIMER functions.

53 | 54 | 55 | -------------------------------------------------------------------------------- /dbapi/Timer_RESETTIMER.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | RESETTIMER 8 | 9 | 10 | 11 |

Dragon BASIC, online at Official Website

14 | 15 |
16 |

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 |
45 | 46 |

Back to TIMER functions.

48 | 49 | 50 | -------------------------------------------------------------------------------- /dbapi/Timer_STARTTIMER.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | STARTTIMER 8 | 9 | 10 | 11 |

Dragon BASIC, online at Official Website

14 | 15 |
16 |

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 |
38 | 39 |

Back to TIMER functions.

41 | 42 | 43 | -------------------------------------------------------------------------------- /dbapi/Timer_STOPTIMER.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | STOPTIMER 8 | 9 | 10 | 11 |

Dragon BASIC, online at Official Website

14 | 15 |
16 |

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 |
47 | 48 |

Back to TIMER functions.

50 | 51 | 52 | -------------------------------------------------------------------------------- /dbapi/Timer_WAITTIMER.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | WAITTIMER 8 | 9 | 10 | 11 |

Dragon BASIC, online at Official Website

14 | 15 |
16 |

MAKETIMER ticks

17 | 18 |

Waits until the timer has fired so many 19 | times.

20 | 21 |

waittimer

22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 |
ParameterMeaning
ticksthe number of fires to wait for
36 | 37 |

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 |
52 | 53 |

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 $( 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | DIM i,j 14 | 15 | INTERRUPT iwram raster 16 | INC i 17 | setpalentry BG_PALETTE, 0, 0, i 18 | EXIT 19 | 20 | INTERRUPT iwram rastcol 21 | INC j 22 | IF key(KEY_A) THEN DEC j, 2 23 | i = j 24 | EXIT 25 | 26 | SUB start 27 | graphics 1, 0 28 | vblank 29 | onhblank raster 30 | onvblank rastcol 31 | 32 | WHILE 33 | vblank 34 | LOOP 35 | END SUB 36 | -------------------------------------------------------------------------------- /examples/gapman/deadpac.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/gapman/deadpac.pcx -------------------------------------------------------------------------------- /examples/gapman/eatdot.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/gapman/eatdot.wav -------------------------------------------------------------------------------- /examples/gapman/font.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/gapman/font.pcx -------------------------------------------------------------------------------- /examples/gapman/fruitpoints.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/gapman/fruitpoints.pcx -------------------------------------------------------------------------------- /examples/gapman/fruitsprites.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/gapman/fruitsprites.pcx -------------------------------------------------------------------------------- /examples/gapman/gapman.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/gapman/gapman.pcx -------------------------------------------------------------------------------- /examples/gapman/ghostpoints.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/gapman/ghostpoints.pcx -------------------------------------------------------------------------------- /examples/gapman/ghosts.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/gapman/ghosts.pcx -------------------------------------------------------------------------------- /examples/gapman/ghostscared2.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/gapman/ghostscared2.wav -------------------------------------------------------------------------------- /examples/gapman/ghostsnormal.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/gapman/ghostsnormal.wav -------------------------------------------------------------------------------- /examples/gapman/maptiles2.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/gapman/maptiles2.pcx -------------------------------------------------------------------------------- /examples/gapman/morph.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/gapman/morph.pcx -------------------------------------------------------------------------------- /examples/gapman/pactitle3.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/gapman/pactitle3.pcx -------------------------------------------------------------------------------- /examples/gapman/startgame.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/gapman/startgame.wav -------------------------------------------------------------------------------- /examples/mappy/mansion.fmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/mappy/mansion.fmp -------------------------------------------------------------------------------- /examples/mappy/mansion_8x8.fmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/mappy/mansion_8x8.fmp -------------------------------------------------------------------------------- /examples/mappy/test.fmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/mappy/test.fmp -------------------------------------------------------------------------------- /examples/mappy/test8x8.fmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/mappy/test8x8.fmp -------------------------------------------------------------------------------- /examples/moddemo/acker.mod: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/moddemo/acker.mod -------------------------------------------------------------------------------- /examples/moddemo/font.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/moddemo/font.bmp -------------------------------------------------------------------------------- /examples/moddemo/moddemo.dbc: -------------------------------------------------------------------------------- 1 | ; MOD player demonstration 2 | ; 3 | #title "MOD demo" 4 | 5 | #include 6 | #include 7 | 8 | font: #bitmap "font.bmp" 9 | pal: #palette "font.bmp" 10 | 11 | ; This is the way to import a MOD or XM file. 12 | acker: #music "acker.mod" 13 | 14 | sub start 15 | ; Set up the display and load a font. See Tutorial 1 for a 16 | ; detailed explanation. 17 | graphics 0,false 18 | enabletiles 0,0,1,TEXT_256x256 + BG_COLOR_16 19 | loadfont16 1,font 20 | loadpal16 BG_PALETTE,0,pal 21 | 22 | print tile(0,2,2),"MOD Demo" 23 | 24 | ; This initializes the MOD player and loads the song specified in 25 | ; the argument. 26 | modinit acker 27 | 28 | while 29 | vblank 30 | ; While playing a song, the MODVBLANK subroutine must be 31 | ; called immediately after entering the vertical blanking 32 | ; period to avoid noise during playback. 33 | modvblank 34 | 35 | ; Print the current playing position. 36 | print tile(0, 2, 5), "Order " + str$(modgetorder) + " " 37 | print tile(0, 2, 6), "Row " + str$(modgetrow) + " " 38 | 39 | ; Check if any key states have changed. 40 | checkkeys 41 | 42 | if keydown(KEY_UP) 43 | ; Change the current playback position to the 44 | ; start of the next pattern. 45 | modsetpos 0, modgetorder + 1 46 | end if 47 | if keydown(KEY_DOWN) 48 | modsetpos 0, modgetorder - 1 49 | end if 50 | 51 | if keydown(KEY_RIGHT) 52 | ; Skip eight rows ahead. The masking ensures 53 | ; that the row specified is valid. 54 | modsetpos (modgetrow + 8) and 63, modgetorder 55 | end if 56 | if keydown(KEY_LEFT) 57 | modsetpos (modgetrow - 8) and 63, modgetorder 58 | end if 59 | 60 | ; While playing a song, the MODFRAME subroutine must be 61 | ; called once per frame. This subroutine can, but does 62 | ; not have to be executed during the vertical blanking 63 | ; period. You can run it at any convenient time. 64 | modframe 65 | loop 66 | end sub 67 | -------------------------------------------------------------------------------- /examples/old_tut_7/A.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/old_tut_7/A.png -------------------------------------------------------------------------------- /examples/old_tut_7/B.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/old_tut_7/B.png -------------------------------------------------------------------------------- /examples/tut_1/font.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/tut_1/font.bmp -------------------------------------------------------------------------------- /examples/tut_3/dragon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/tut_3/dragon.png -------------------------------------------------------------------------------- /examples/tut_4/ship.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/tut_4/ship.bmp -------------------------------------------------------------------------------- /examples/tut_5/asteroid_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/tut_5/asteroid_large.png -------------------------------------------------------------------------------- /examples/tut_5/asteroid_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/tut_5/asteroid_small.png -------------------------------------------------------------------------------- /examples/tut_6/bg_music.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/tut_6/bg_music.wav -------------------------------------------------------------------------------- /examples/tut_6/block.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/tut_6/block.pcx -------------------------------------------------------------------------------- /examples/tut_6/jump.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/tut_6/jump.wav -------------------------------------------------------------------------------- /examples/tut_6/mario_0.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/tut_6/mario_0.pcx -------------------------------------------------------------------------------- /examples/tut_6/mario_1.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/tut_6/mario_1.pcx -------------------------------------------------------------------------------- /examples/tut_6/mario_2.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/tut_6/mario_2.pcx -------------------------------------------------------------------------------- /examples/tut_6/mario_3.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/tut_6/mario_3.pcx -------------------------------------------------------------------------------- /examples/tut_7/baron.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/tut_7/baron.bmp -------------------------------------------------------------------------------- /examples/tut_7/bomb.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/tut_7/bomb.bmp -------------------------------------------------------------------------------- /examples/tut_7/bullet.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/tut_7/bullet.bmp -------------------------------------------------------------------------------- /examples/tut_7/cloud.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/tut_7/cloud.bmp -------------------------------------------------------------------------------- /examples/tut_7/clouds.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/tut_7/clouds.bmp -------------------------------------------------------------------------------- /examples/tut_7/font.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/tut_7/font.bmp -------------------------------------------------------------------------------- /examples/tut_7/sky.pal: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/tut_7/sky.pal -------------------------------------------------------------------------------- /examples/tut_8/coin.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/tut_8/coin.wav -------------------------------------------------------------------------------- /examples/tut_8/forest.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/tut_8/forest.pcx -------------------------------------------------------------------------------- /examples/tut_8/link.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/tut_8/link.pcx -------------------------------------------------------------------------------- /examples/tut_8/rupee.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/tut_8/rupee.pcx -------------------------------------------------------------------------------- /examples/tut_9/house.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/tut_9/house.pcx -------------------------------------------------------------------------------- /examples/tut_9/shop.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/tut_9/shop.pcx -------------------------------------------------------------------------------- /examples/tut_9/tiles.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/tut_9/tiles.pcx -------------------------------------------------------------------------------- /examples/wavy/bluebar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/wavy/bluebar.png -------------------------------------------------------------------------------- /examples/wavy/dragonlogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/wavy/dragonlogo.png -------------------------------------------------------------------------------- /examples/wavy/greenbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/wavy/greenbar.png -------------------------------------------------------------------------------- /examples/wavy/letter_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/wavy/letter_b.png -------------------------------------------------------------------------------- /examples/wavy/letter_e.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/wavy/letter_e.png -------------------------------------------------------------------------------- /examples/wavy/letter_g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/wavy/letter_g.png -------------------------------------------------------------------------------- /examples/wavy/letter_l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/wavy/letter_l.png -------------------------------------------------------------------------------- /examples/wavy/letter_o.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/wavy/letter_o.png -------------------------------------------------------------------------------- /examples/wavy/letter_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/wavy/letter_r.png -------------------------------------------------------------------------------- /examples/wavy/letter_t.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/wavy/letter_t.png -------------------------------------------------------------------------------- /examples/wavy/play.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/wavy/play.wav -------------------------------------------------------------------------------- /examples/wavy/redbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/wavy/redbar.png -------------------------------------------------------------------------------- /examples/wavy/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/wavy/screenshot.png -------------------------------------------------------------------------------- /examples/wavy/tiles2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/examples/wavy/tiles2.png -------------------------------------------------------------------------------- /extract_syms.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | objdump -x "$1" | \ 3 | egrep '^0[238]...... g.*(text|init|\*ABS\*)......... [^.]'| \ 4 | sed "s,\(........\) g.*............. \(.*\)$,#define $2_\2\t0x\1," 5 | 6 | 7 | -------------------------------------------------------------------------------- /gbax.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/gbax.dll -------------------------------------------------------------------------------- /include/core.dbc: -------------------------------------------------------------------------------- 1 | ;;; CORE.DBC 2 | ;;; 3 | ;;; Compiles required TIN source for all CORE routines 4 | ;;; that are needed for Dragon BASIC to run. This file 5 | ;;; should be included with every program. 6 | ;;; 7 | ;;; Copyright (c) 2003 by Jeff Massung 8 | ;;; All rights reserved. 9 | 10 | #REQUIRES "CORE.F" 11 | 12 | ; CORE memory functions 13 | PROTOTYPE INLINE FUNCTION PEEK(address) 14 | PROTOTYPE INLINE FUNCTION PEEKB(address) 15 | PROTOTYPE INLINE FUNCTION PEEKW(address) 16 | PROTOTYPE INLINE SUB POKE(address,n) 17 | PROTOTYPE INLINE SUB POKEB(address,n) 18 | PROTOTYPE INLINE SUB POKEW(address,n) 19 | 20 | ; Memory routines 21 | PROTOTYPE SUB COPY(address,source,bytes) 22 | PROTOTYPE SUB ERASE(address,bytes) 23 | 24 | ; Graphics mode routines 25 | 26 | ; set the graphics mode 27 | SUB graphics(mode, sprites) 28 | ; for bitmapped modes enable BG 2 29 | IF mode >= 3 THEN mode = mode OR &400 30 | ; set the sprite bit 31 | IF sprites THEN mode = mode OR &1040 32 | ; set REG_DISPCNT 33 | poke &4000000, mode 34 | ; erase VRAM 35 | erase &6000000, &18000 36 | END SUB 37 | 38 | ; wait for the next vertical blank 39 | ; XXX: This assumes that the user vblank handler does not touch DISPCNT or 40 | ; IE... 41 | SUB vblank 42 | LOCAL old_dispcnt, old_ie 43 | LOCAL REGISTER ie, dispcnt 44 | 45 | ; Loading the constants here is more work overall, but makes for a 46 | ; faster return when the halt SWI is finished. 47 | dispcnt = &4000004 48 | ie = &4000200 49 | 50 | ; enable vblank interrupt in DISPCNT 51 | old_dispcnt = peek(dispcnt) 52 | poke dispcnt, old_dispcnt OR 8 53 | 54 | ; enable vblank interrupt in IE 55 | old_ie = peek(ie) 56 | poke ie, old_ie OR 1 57 | 58 | swi 5 ; VBlankIntrWait 59 | 60 | ; restore old settings 61 | poke dispcnt, old_dispcnt 62 | poke ie, old_ie 63 | END SUB 64 | 65 | PROTOTYPE INLINE FUNCTION SCANLINE 66 | -------------------------------------------------------------------------------- /include/effects.dbc: -------------------------------------------------------------------------------- 1 | ;;; EFFECTS.DBC 2 | ;;; 3 | ;;; Subroutines and functions for controlling 4 | ;;; special effects produced by GBA hardware like 5 | ;;; mosaics and fading. 6 | ;;; 7 | ;;; Copyright (c) 2003 by Jeff Massung 8 | ;;; All rights reserved. 9 | 10 | #REQUIRES "EFFECTS.F" 11 | 12 | ; Mosaic effect 13 | PROTOTYPE SUB MOSAICTILES(bg,flag) 14 | PROTOTYPE SUB SPRITEMOSAIC(n,flag) 15 | PROTOTYPE SUB MOSAIC(bgx,bgy,objx,objy) 16 | 17 | ; Screen fading 18 | PROTOTYPE SUB FADEOUT 19 | PROTOTYPE SUB FADEIN 20 | -------------------------------------------------------------------------------- /include/ext.dbc: -------------------------------------------------------------------------------- 1 | ;;; EXT.DBC 2 | ;;; 3 | ;;; Extended CORE functionality for Dragon BASIC. 4 | ;;; 5 | ;;; Copyright (c) 2003 by Jeff Massung 6 | ;;; All rights reserved. 7 | 8 | #REQUIRES "EXT.F" 9 | 10 | ; Address and dynamic memory 11 | PROTOTYPE INLINE FUNCTION ALIGNED(address) 12 | PROTOTYPE FUNCTION ALLOCATE(bytes) 13 | 14 | ; Using DMA 3 for transfering data 15 | PROTOTYPE SUB DMACOPY(dest,source,words) 16 | PROTOTYPE SUB DMAWAIT 17 | 18 | ; Image blocks 19 | PROTOTYPE FUNCTION BLOCKS(width,height,depth) 20 | PROTOTYPE INLINE FUNCTION TILEOFFSET(blocks) 21 | 22 | ; More math routines 23 | PROTOTYPE INLINE FUNCTION ABS(n) 24 | PROTOTYPE INLINE FUNCTION SQRT(n) 25 | PROTOTYPE INLINE FUNCTION FSQRT#(f#) 26 | 27 | ; Conversion from integer to fixed-point and back 28 | PROTOTYPE INLINE FUNCTION FIX#(n) 29 | PROTOTYPE INLINE FUNCTION INT(f#) 30 | PROTOTYPE INLINE FUNCTION ROUND(f#) 31 | -------------------------------------------------------------------------------- /include/gba.dbc: -------------------------------------------------------------------------------- 1 | ;;; GBA.DBC 2 | ;;; 3 | ;;; Includes the entire Dragon BASIC/TIN API. 4 | ;;; 5 | ;;; Copyright (c) 2003 by Jeff Massung 6 | ;;; All rights reserved. 7 | 8 | #INCLUDE "CORE.DBC" 9 | #INCLUDE "EXT.DBC" 10 | #INCLUDE "TILES.DBC" 11 | #INCLUDE "GRAPHICS.DBC" 12 | #INCLUDE "RND.DBC" 13 | #INCLUDE "PALETTE.DBC" 14 | #INCLUDE "STRINGS.DBC" 15 | #INCLUDE "SPRITES.DBC" 16 | #INCLUDE "TIMERS.DBC" 17 | #INCLUDE "INPUT.DBC" 18 | #INCLUDE "SOUND.DBC" 19 | #INCLUDE "EFFECTS.DBC" 20 | #INCLUDE "ROTATIONS.DBC" 21 | #INCLUDE "SRAM.DBC" 22 | #INCLUDE "INTERRUPTS.DBC" 23 | -------------------------------------------------------------------------------- /include/graphics.dbc: -------------------------------------------------------------------------------- 1 | ;;; GFX.DBC 2 | ;;; 3 | ;;; Contains all graphics routines for all 4 | ;;; bitmapped modes (3, 4 and 5). 5 | ;;; 6 | ;;; Copyright (c) 2003 by Jeff Massung 7 | ;;; All rights reserved. 8 | 9 | #REQUIRES "GRAPHICS.F" 10 | 11 | ; Clear screen and wallpaper 12 | PROTOTYPE SUB CLS(color) 13 | PROTOTYPE SUB WALLPAPER(label) 14 | 15 | ; Page flipping and addressing 16 | PROTOTYPE FUNCTION SCREEN 17 | PROTOTYPE SUB FLIP 18 | 19 | ; Get and set pixels 20 | PROTOTYPE SUB PLOT(x,y,color) 21 | PROTOTYPE FUNCTION PIXEL(x,y) 22 | 23 | ; Blit an image and line 24 | PROTOTYPE SUB BLIT(label,x,y,width,height) 25 | PROTOTYPE SUB LINE(x1,y1,x2,y2,color) 26 | -------------------------------------------------------------------------------- /include/input.dbc: -------------------------------------------------------------------------------- 1 | ;;; INPUT.DBC 2 | ;;; 3 | ;;; Contains prototypes for all functions that 4 | ;;; work with the GBA buttons and D-pad. 5 | ;;; 6 | ;;; Copyright (c) 2003 by Jeff Massung 7 | ;;; All rights reserved. 8 | 9 | #REQUIRES "INPUT.F" 10 | 11 | ; Player 1 keypad constants 12 | #CONSTANT KEY_A &001 ; A button mask 13 | #CONSTANT KEY_B &002 ; B button mask 14 | #CONSTANT KEY_SELECT &004 ; SELECT button mask 15 | #CONSTANT KEY_START &008 ; START button mask 16 | #CONSTANT KEY_RIGHT &010 ; Right arrow mask 17 | #CONSTANT KEY_LEFT &020 ; Left arrow mask 18 | #CONSTANT KEY_UP &040 ; UP arrow mask 19 | #CONSTANT KEY_DOWN &080 ; Down arrow mask 20 | #CONSTANT KEY_R &100 ; Right trigger mask 21 | #CONSTANT KEY_L &200 ; Left trigger mask 22 | #CONSTANT KEY_ANY &3FF ; Any key 23 | 24 | ; Status of all buttons (1=pressed) 25 | PROTOTYPE FUNCTION KEYS 26 | 27 | ; Wait for the state of any button in mask to change 28 | PROTOTYPE SUB INPUT(mask) 29 | 30 | ; Return the state of the buttons in mask (1=pressed) 31 | PROTOTYPE INLINE FUNCTION KEY(mask) 32 | 33 | ; Wait for any button in mask to be pressed and released 34 | PROTOTYPE FUNCTION WAITKEY(mask) 35 | 36 | ; Check key state and record the keys that have been pressed and released 37 | ; since the last call. 38 | PROTOTYPE SUB CHECKKEYS 39 | 40 | ; Check if a key has been pressed between the last two CHECKKEYS calls. 41 | PROTOTYPE FUNCTION KEYDOWN(mask) 42 | 43 | ; Check if a key has been released between the last two CHECKKEYS calls. 44 | PROTOTYPE FUNCTION KEYUP(mask) 45 | -------------------------------------------------------------------------------- /include/interrupts.dbc: -------------------------------------------------------------------------------- 1 | ;;; INTERRUPTS.DBC 2 | ;;; 3 | ;;; Contains all routines for starting 4 | ;;; and stopping interrupt services 5 | ;;; 6 | ;;; Copyright (c) 2003 by Jeff Massung 7 | ;;; All rights reserved. 8 | 9 | #REQUIRES "INTERRUPTS.F" 10 | 11 | ; Turn interrupts on and off 12 | SUB ENABLEINTERRUPTS 13 | poke &4000208, 1 14 | END SUB 15 | SUB DISABLEINTERRUPTS 16 | poke &4000208, 0 17 | END SUB 18 | 19 | ; Enable and disable various interrupts 20 | PROTOTYPE SUB ONKEY(i,mask,flag) 21 | PROTOTYPE SUB ONTIMER(i) 22 | PROTOTYPE SUB ONHBLANK(i) 23 | PROTOTYPE SUB ONVBLANK(i) 24 | PROTOTYPE SUB ONVCOUNT(i,count) 25 | -------------------------------------------------------------------------------- /include/lognc.dbc: -------------------------------------------------------------------------------- 1 | ;;; lognc.dbc: logging functions for NO$GBA 2 | 3 | #REQUIRES "LOGNC.F" 4 | 5 | PROTOTYPE SUB LOG(string$) 6 | -------------------------------------------------------------------------------- /include/logvba.dbc: -------------------------------------------------------------------------------- 1 | ;;; logvba.dbc: logging functions for VBA 2 | 3 | #REQUIRES "LOGVBA.F" 4 | 5 | PROTOTYPE SUB LOG(string$) 6 | -------------------------------------------------------------------------------- /include/mod.dbc: -------------------------------------------------------------------------------- 1 | PROTOTYPE SUB MODINIT(module) 2 | 3 | PROTOTYPE SUB MODFRAME 4 | PROTOTYPE SUB MODVBLANK 5 | 6 | PROTOTYPE FUNCTION MODGETROW 7 | PROTOTYPE FUNCTION MODGETORDER 8 | PROTOTYPE SUB MODSETPOS(row, order) 9 | 10 | PROTOTYPE SUB MODCLOSE 11 | -------------------------------------------------------------------------------- /include/palette.dbc: -------------------------------------------------------------------------------- 1 | ;;; PALETTE.DBC 2 | ;;; 3 | ;;; Functions and subroutines used for loading 4 | ;;; and manipulating palettes and 16-bit colors. 5 | ;;; 6 | ;;; Copyright (c) 2003 by Jeff Massung 7 | ;;; All rights reserved. 8 | 9 | #REQUIRES "PALETTE.F" 10 | 11 | ; Palette memory base addresses 12 | #CONSTANT BG_PALETTE &5000000 ; Base address of background palette 13 | #CONSTANT SPRITE_PALETTE &5000200 ; Base address of sprite palette 14 | 15 | ; Color functions 16 | PROTOTYPE FUNCTION RGB(red,green,blue) 17 | PROTOTYPE INLINE FUNCTION RGBR(color) 18 | PROTOTYPE INLINE FUNCTION RGBG(color) 19 | PROTOTYPE INLINE FUNCTION RGBB(color) 20 | 21 | ; Some constant 15-bit colors 22 | ; XXX: needs to be below RGB() because otherwise DBC misinterprets the 23 | ; argument "red" as a constant... 24 | #CONSTANT RED &001F 25 | #CONSTANT GREEN &03E0 26 | #CONSTANT BLUE &7C00 27 | #CONSTANT BLACK &0000 28 | #CONSTANT WHITE &7FFF 29 | #CONSTANT CYAN &7FE0 30 | #CONSTANT YELLOW &03FF 31 | #CONSTANT MAGENTA &7C1F 32 | #CONSTANT DARKRED &000F 33 | #CONSTANT DARKGREEN &01E0 34 | #CONSTANT DARKBLUE &3C00 35 | #CONSTANT OLIVE &01EF 36 | #CONSTANT ORANGE &01FF 37 | #CONSTANT TEAL &3DE0 38 | #CONSTANT GRAY &3DEF 39 | #CONSTANT BROWN &01B4 40 | 41 | ; Palette subroutines 42 | PROTOTYPE SUB LOADPAL16(palette,index,label) 43 | PROTOTYPE SUB LOADPAL256(palette,label) 44 | PROTOTYPE SUB MAKEPALETTE(palette) 45 | PROTOTYPE SUB ROTATEPAL16(palette,index) 46 | PROTOTYPE SUB ROTATEPAL256(palette) 47 | 48 | ; Entry manipulation 49 | PROTOTYPE INLINE SUB SETPALENTRY(palette,index,entry,color) 50 | PROTOTYPE INLINE FUNCTION GETPALENTRY(palette,index,entry) 51 | 52 | -------------------------------------------------------------------------------- /include/rnd.dbc: -------------------------------------------------------------------------------- 1 | ;;; RND.DBC 2 | ;;; 3 | ;;; Functions for setting the random seed 4 | ;;; generator, getting the next number from 5 | ;;; the seed and getting a random number 6 | ;;; within a range. 7 | ;;; 8 | ;;; Copyright (c) 2003 by Jeff Massung 9 | ;;; All rights reserved. 10 | 11 | #CONSTANT RAND_MAX &0007FFF ; The highest randon number possible 12 | 13 | DIM __rnd_seed 14 | 15 | ; return a random number from 0-7FFF 16 | FUNCTION rnd 17 | __rnd_seed = __rnd_seed * 69069 + 1 18 | RETURN __rnd_seed SR 17 19 | END FUNCTION 20 | 21 | SUB seed(seed) 22 | __rnd_seed = seed 23 | END SUB 24 | 25 | ; return a random number between min and max-1 26 | FUNCTION random(min,max) 27 | RETURN min + rnd MOD (max - min) 28 | END FUNCTION 29 | -------------------------------------------------------------------------------- /include/rotations.dbc: -------------------------------------------------------------------------------- 1 | ;;; ROTATIONS.DBC 2 | ;;; 3 | ;;; Contains all trig functions and routines 4 | ;;; for rotating sprites and backgrounds 5 | ;;; 6 | ;;; Copyright (c) 2003 by Jeff Massung 7 | ;;; All rights reserved. 8 | 9 | #REQUIRES "ROTATIONS.F" 10 | 11 | ; Angle functions 12 | PROTOTYPE FUNCTION WRAPANGLE(angle) 13 | 14 | ; Trig functions 15 | PROTOTYPE FUNCTION SIN#(angle) 16 | PROTOTYPE FUNCTION COS#(angle) 17 | PROTOTYPE FUNCTION TAN#(angle) 18 | 19 | ; Matrix creation and sprite rotating 20 | PROTOTYPE SUB MAKEROTATION(matrix,sx#,sy#,angle) 21 | PROTOTYPE SUB ROTATESPRITE(n,matrix) 22 | -------------------------------------------------------------------------------- /include/sound.dbc: -------------------------------------------------------------------------------- 1 | ;;; SOUND.DBC 2 | ;;; 3 | ;;; Contains prototypes for all functions that 4 | ;;; create notes and sounds on the GBA. 5 | ;;; 6 | ;;; Copyright (c) 2003 by Jeff Massung 7 | ;;; All rights reserved. 8 | 9 | #REQUIRES "SOUND.F" 10 | 11 | ; Sound constants 12 | #CONSTANT WAVE_DUTY_12 &0000 ; 12.5% 13 | #CONSTANT WAVE_DUTY_25 &0040 ; 25% 14 | #CONSTANT WAVE_DUTY_50 &0080 ; 50% 15 | #CONSTANT WAVE_DUTY_75 &00C0 ; 75% 16 | 17 | ; Turn sound on and off 18 | PROTOTYPE SUB TURNSOUNDON 19 | PROTOTYPE SUB TURNSOUNDOFF 20 | 21 | ; Play music and sound (DirectSound) 22 | PROTOTYPE SUB PLAYMUSIC(label) 23 | PROTOTYPE SUB PLAYSOUND(label) 24 | 25 | ; Stop music and sound (DirectSound) 26 | PROTOTYPE SUB STOPSOUND 27 | PROTOTYPE SUB STOPMUSIC 28 | 29 | ; Play a note or drum effect (Channels) 30 | PROTOTYPE SUB PLAYNOTE(channel,length,frequency,wave_duty) 31 | PROTOTYPE SUB PLAYDRUM(length,frequency,wave_step) 32 | -------------------------------------------------------------------------------- /include/sram.dbc: -------------------------------------------------------------------------------- 1 | ;;; SRAM.DBC 2 | ;;; 3 | ;;; Contains all static ram functions 4 | ;;; 5 | ;;; Copyright (c) 2003 by Jeff Massung 6 | ;;; All rights reserved. 7 | 8 | #REQUIRES "SRAM.F" 9 | 10 | #CONSTANT SRAM &E000000 ; Start of static ram 11 | 12 | ; Save data 13 | PROTOTYPE SUB SAVEBYTE(x) 14 | PROTOTYPE SUB SAVEWORD(x) 15 | PROTOTYPE SUB SAVELONG(x) 16 | PROTOTYPE SUB SAVETEXT(s$) 17 | 18 | ; Load data 19 | PROTOTYPE FUNCTION LOADBYTE 20 | PROTOTYPE FUNCTION LOADWORD 21 | PROTOTYPE FUNCTION LOADLONG 22 | PROTOTYPE FUNCTION LOADTEXT$ 23 | -------------------------------------------------------------------------------- /include/strings.dbc: -------------------------------------------------------------------------------- 1 | ;;; STRING.DBC 2 | ;;; 3 | ;;; Subroutines and functions for manipulating 4 | ;;; strings and conversion of numbers to strings. 5 | ;;; 6 | ;;; Copyright (c) 2003 by Jeff Massung 7 | ;;; All rights reserved. 8 | 9 | #REQUIRES "STRINGS.F" 10 | 11 | ; Length functions 12 | PROTOTYPE INLINE FUNCTION LEN(string$) 13 | PROTOTYPE INLINE SUB RESIZE(string$,length) 14 | 15 | ; Converting from number to string 16 | PROTOTYPE FUNCTION STR$(n) 17 | PROTOTYPE FUNCTION HEX$(n) 18 | 19 | ; Converting between numbers and characters 20 | PROTOTYPE FUNCTION CHR$(n) 21 | PROTOTYPE INLINE FUNCTION ASC(string$) 22 | 23 | ; Copying, comparing and printing 24 | PROTOTYPE SUB MOVE(dest$,source$) 25 | PROTOTYPE FUNCTION COMPARE(string1$,string2$) 26 | PROTOTYPE SUB PRINT(tile,string$) 27 | 28 | ; Substring functions and concatenating 29 | PROTOTYPE FUNCTION APPEND$(dest$,source$) 30 | PROTOTYPE FUNCTION LEFT$(string$,length) 31 | PROTOTYPE FUNCTION RIGHT$(string$,length) 32 | PROTOTYPE FUNCTION MID$(string$,start,length) 33 | 34 | -------------------------------------------------------------------------------- /include/timers.dbc: -------------------------------------------------------------------------------- 1 | ;;; TIMERS.DBC 2 | ;;; 3 | ;;; Contains prototypes for all functions that 4 | ;;; work with the user timer. 5 | ;;; 6 | ;;; Copyright (c) 2003 by Jeff Massung 7 | ;;; All rights reserved. 8 | 9 | #REQUIRES "TIMERS.F" 10 | 11 | ; Make and reset 12 | PROTOTYPE SUB MAKETIMER(frequency) 13 | PROTOTYPE SUB RESETTIMER 14 | 15 | ; Start and stop 16 | PROTOTYPE SUB STARTTIMER 17 | PROTOTYPE SUB STOPTIMER 18 | 19 | ; Waiting 20 | PROTOTYPE FUNCTION CLOCKTIMER 21 | PROTOTYPE SUB WAITTIMER(n) 22 | -------------------------------------------------------------------------------- /optional/fmp.f: -------------------------------------------------------------------------------- 1 | { -- FMP map TIN functions 2 | -- 3 | -- Copyright (C) 2015 Ulrich Hecht 4 | -- 5 | -- This software is provided 'as-is', without any express or implied 6 | -- warranty. In no event will the authors be held liable for any damages 7 | -- arising from the use of this software. 8 | -- 9 | -- Permission is granted to anyone to use this software for any purpose, 10 | -- including commercial applications, and to alter it and redistribute it 11 | -- freely, subject to the following restrictions: 12 | -- 13 | -- 1. The origin of this software must not be misrepresented; you must not 14 | -- claim that you wrote the original software. If you use this software 15 | -- in a product, an acknowledgment in the product documentation would be 16 | -- appreciated but is not required. 17 | -- 2. Altered source versions must be plainly marked as such, and must not be 18 | -- misrepresented as being the original software. 19 | -- 3. This notice may not be removed or altered from any source distribution. 20 | -- 21 | -- Ulrich Hecht 22 | -- ulrich.hecht@gmail.com } 23 | 24 | icode-thumb fmppaladdr 0 ( fmp -- v ) 25 | tos 0@ tos ldr, 26 | end-code 27 | 28 | icode-thumb fmptileaddr 0 ( fmp -- v ) 29 | tos 4 #( tos ldr, 30 | end-code 31 | 32 | icode-thumb fmptilesize 0 ( fmp -- v ) 33 | tos 12 #( tos ldrb, 34 | end-code 35 | 36 | icode-thumb fmpwidth 0 ( fmp -- v ) 37 | tos 14 #( tos ldrb, 38 | end-code 39 | 40 | icode-thumb fmpheight 0 ( fmp -- v) 41 | tos 15 #( tos ldrb, 42 | end-code 43 | 44 | icode-thumb fmptiles 0 ( fmp -- v ) 45 | tos 16 #( tos ldrh, 46 | end-code 47 | 48 | icode-thumb fmplayers 0 ( fmp -- v ) 49 | tos 18 #( tos ldrh, 50 | end-code 51 | -------------------------------------------------------------------------------- /optional/logvba.f: -------------------------------------------------------------------------------- 1 | { -- VBA logging functions 2 | -- Copyright (c) 2003 by Jeff Massung } 3 | 4 | \ send a string to the VBA console 5 | :n log ( a -- ) 1+ $ff swi drop ; 6 | -------------------------------------------------------------------------------- /optional/sram.f: -------------------------------------------------------------------------------- 1 | { -- MF/TIN SRAM functions 2 | -- Original code by Jeff Massung, 2003 } 3 | 4 | \ shift masking 5 | :i /8 ( n1 -- n1 n2 ) dup 8 # n/ ; 6 | :n *8 ( n1 n2 -- n3 ) swap 8 # n* + ; 7 | 8 | \ save data to static ram 9 | :n savebyte ( b -- ) >a c!a a> ; 10 | :n saveword ( n -- ) >a /8 c!a c!a a> ; 11 | :n savelong ( x -- ) >a /8 /8 /8 c!a c!a c!a c!a a> ; 12 | 13 | \ load data from static ram 14 | :n loadbyte ( -- b ) >a c@a a> ; 15 | : loadword ( -- n ) >a c@a c@a *8 a> ; 16 | : loadlong ( -- x ) >a c@a c@a *8 c@a *8 c@a *8 a> ; 17 | 18 | \ save a string 19 | code-thumb /savetext ( a -- ) 20 | $100 w movi 21 | 22 | l: __loop 23 | 24 | \ copy a byte 25 | tos 0@ v0 ldrb, 26 | 1 ## tos add, 27 | a 0@ v0 strb, 28 | 1 ## a add, 29 | 30 | \ loop until 256 bytes written 31 | 1 ## w sub, 32 | __loop gt? b, 33 | 34 | \ done 35 | tos pop 36 | ret 37 | end-code 38 | 39 | \ load a string 40 | code-thumb /loadtext ( a -- a ) 41 | $100 w movi 42 | tos v2 mov, 43 | 44 | l: __loop 45 | 46 | \ load two bytes 47 | a 0@ v1 ldrb, 48 | 1 ## a add, 49 | 50 | \ write bytes 51 | v2 0@ v1 strb, 52 | 1 ## v2 add, 53 | 54 | \ loop until length is zero 55 | 1 ## w sub, 56 | __loop gt? b, 57 | 58 | \ done 59 | ret 60 | end-code 61 | 62 | \ save a string to static ram 63 | : savetext ( a -- ) >a /savetext a> ; 64 | : loadtext$ ( -- a ) >a 256 # r-alloc /loadtext a> ; 65 | -------------------------------------------------------------------------------- /os.h: -------------------------------------------------------------------------------- 1 | #ifndef _OS_H 2 | #define _OS_H 3 | 4 | #ifdef __WIN32__ 5 | #include 6 | #include 7 | #define PATHSEP "\\" 8 | #define EXE ".exe" 9 | #define OS_getAppDir(buf) do { GetModuleFileNameA(0, (buf), 0x100); dirname(buf); } while(0) 10 | #else 11 | #define OS_getAppDir(buf) do { strcpy(buf, APPDIR); } while(0) 12 | #define PATHSEP "/" 13 | #define EXE "" 14 | #endif 15 | 16 | static const char* stolower(const char *str) 17 | { 18 | static char buf[256]; 19 | char *b = buf; 20 | while (*str) 21 | *b++ = tolower(*str++); 22 | *b = 0; 23 | return buf; 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /pimpmobile_r1/LICENSE.TXT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/LICENSE.TXT -------------------------------------------------------------------------------- /pimpmobile_r1/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/Makefile -------------------------------------------------------------------------------- /pimpmobile_r1/converter/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/converter/Makefile -------------------------------------------------------------------------------- /pimpmobile_r1/converter/converter.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/converter/converter.cpp -------------------------------------------------------------------------------- /pimpmobile_r1/converter/converter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/converter/converter.h -------------------------------------------------------------------------------- /pimpmobile_r1/converter/converter_mod.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/converter/converter_mod.cpp -------------------------------------------------------------------------------- /pimpmobile_r1/converter/converter_s3m.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/converter/converter_s3m.cpp -------------------------------------------------------------------------------- /pimpmobile_r1/converter/converter_xm.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/converter/converter_xm.cpp -------------------------------------------------------------------------------- /pimpmobile_r1/converter/dump_module.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/converter/dump_module.cpp -------------------------------------------------------------------------------- /pimpmobile_r1/converter/dump_samples.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/converter/dump_samples.cpp -------------------------------------------------------------------------------- /pimpmobile_r1/example/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/example/Makefile -------------------------------------------------------------------------------- /pimpmobile_r1/example/data/dxn-oopk.xm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/example/data/dxn-oopk.xm -------------------------------------------------------------------------------- /pimpmobile_r1/example/example.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/example/example.cpp -------------------------------------------------------------------------------- /pimpmobile_r1/include/pimpmobile.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/include/pimpmobile.h -------------------------------------------------------------------------------- /pimpmobile_r1/lib/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /pimpmobile_r1/lut_gen.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/lut_gen.py -------------------------------------------------------------------------------- /pimpmobile_r1/makefs.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | REM check parameters 4 | if %1x==x goto usage 5 | 6 | REM generate filename lists 7 | set _infiles= 8 | set _outfiles= 9 | :start 10 | if %1x==x goto end 11 | echo %1 12 | set _infiles=%_infiles% %1 13 | set _outfiles=%_outfiles% %1.bin 14 | shift 15 | goto start 16 | :end 17 | 18 | REM convert 19 | bin\converter %_infiles% 20 | if not %ERRORLEVEL%==0 goto :EOF 21 | 22 | REM make filesystem 23 | gbfs data.gbfs sample_bank.bin %_outfiles% 24 | 25 | REM append filesystem to rom 26 | copy /B bin\example.bin+data.gbfs example.gba 27 | 28 | goto :EOF 29 | 30 | :usage 31 | echo USAGE: makefs.bat filename.(mod/xm/s3m) 32 | -------------------------------------------------------------------------------- /pimpmobile_r1/makefs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # check parameters 4 | if [ -z "$@" ] 5 | then 6 | echo "USAGE: makefs.bat filename.(mod/xm/s3m)" 7 | exit 1 8 | fi 9 | 10 | # convert 11 | bin/converter $@ 12 | [ $? -ne 0 ] && exit 1 13 | 14 | # make filesystem 15 | gbfs data.gbfs sample_bank.bin `echo $@ | sed -e "s/[^ ]\+/\0.bin/g"` 16 | 17 | # append filesystem to rom 18 | cat bin/example.bin > example.gba 19 | cat data.gbfs >> example.gba 20 | -------------------------------------------------------------------------------- /pimpmobile_r1/src/amiga_delta_lut.h: -------------------------------------------------------------------------------- 1 | #define AMIGA_DELTA_LUT_LOG2_SIZE 7 2 | const u16 amiga_delta_lut[65] = 3 | { 4 | 55928, 55067, 54233, 53423, 52638, 51875, 51134, 50414, 49713, 49032, 48370, 47725, 5 | 47097, 46485, 45889, 45308, 44742, 44190, 43651, 43125, 42611, 42110, 41621, 41142, 6 | 40675, 40218, 39771, 39334, 38906, 38488, 38078, 37678, 37285, 36901, 36524, 36155, 7 | 35794, 35439, 35092, 34751, 34417, 34089, 33768, 33452, 33142, 32838, 32540, 32247, 8 | 31959, 31676, 31398, 31125, 30857, 30593, 30334, 30079, 29828, 29582, 29339, 29101, 9 | 28866, 28635, 28408, 28184, 27964, 10 | }; 11 | 12 | -------------------------------------------------------------------------------- /pimpmobile_r1/src/amiga_period_lut.h: -------------------------------------------------------------------------------- 1 | const u16 amiga_period_lut[] = 2 | { 3 | // this is for negative fine-tunes... 4 | 907,900,894,887,881,875,868,862, // B-0 5 | 6 | 856,850,844,838,832,826,820,814, // C-1 7 | 808,802,796,791,785,779,774,768, // C#1 8 | 762,757,752,746,741,736,730,725, // D-1 9 | 720,715,709,704,699,694,689,684, // D#1 10 | 678,674,670,665,660,655,651,646, // E-1 11 | 640,637,632,628,623,619,614,610, // F-1 12 | 604,601,597,592,588,584,580,575, // F#1 13 | 570,567,563,559,555,551,547,543, // G-1 14 | 538,535,532,528,524,520,516,513, // G#1 15 | 508,505,502,498,495,491,487,484, // A-1 16 | 480,477,474,470,467,463,460,457, // A#1 17 | 453,450,447,444,441,437,434,431, // B-1 18 | 19 | 428,425,422,419,416,413,410,407, // C-2 20 | 404,401,398,395,392,390,387,384, // C#2 21 | 381,379,376,373,370,368,365,363, // D-2 22 | 360,357,355,352,350,347,345,342, // D#2 23 | 339,337,335,332,330,328,325,323, // E-2 24 | 320,318,316,314,312,309,307,305, // F-2 25 | 302,300,298,296,294,292,290,288, // F#2 26 | 285,284,282,280,278,276,274,272, // G-2 27 | 269,268,266,264,262,260,258,256, // G#2 28 | 254,253,251,249,247,245,244,242, // A-2 29 | 240,239,237,235,233,232,230,228, // A#2 30 | 226,225,224,222,220,219,217,216, // B-2 31 | 32 | 214,213,211,209,208,206,205,204, // C-3 33 | 202,201,199,198,196,195,193,192, // C#3 34 | 190,189,188,187,185,184,183,181, // D-3 35 | 180,179,177,176,175,174,172,171, // D#3 36 | 170,169,167,166,165,164,163,161, // E-3 37 | 160,159,158,157,156,155,154,152, // F-3 38 | 151,150,149,148,147,146,145,144, // F#3 39 | 143,142,141,140,139,138,137,136, // G-3 40 | 135,134,133,132,131,130,129,128, // G#3 41 | 127,126,125,125,124,123,122,121, // A-3 42 | 120,119,118,118,117,116,115,114, // A#3 43 | // 113,113,112,111,110,109,109,108, // B-3 44 | 45 | // this is for positive fine-tunes 46 | // 107,106,105,104,104,103,102,102, // C-4 47 | }; 48 | -------------------------------------------------------------------------------- /pimpmobile_r1/src/pimp_base.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/src/pimp_base.h -------------------------------------------------------------------------------- /pimpmobile_r1/src/pimp_config.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/src/pimp_config.h -------------------------------------------------------------------------------- /pimpmobile_r1/src/pimp_debug.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/src/pimp_debug.c -------------------------------------------------------------------------------- /pimpmobile_r1/src/pimp_debug.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/src/pimp_debug.h -------------------------------------------------------------------------------- /pimpmobile_r1/src/pimp_effects.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/src/pimp_effects.h -------------------------------------------------------------------------------- /pimpmobile_r1/src/pimp_envelope.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/src/pimp_envelope.c -------------------------------------------------------------------------------- /pimpmobile_r1/src/pimp_envelope.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/src/pimp_envelope.h -------------------------------------------------------------------------------- /pimpmobile_r1/src/pimp_gba.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/src/pimp_gba.c -------------------------------------------------------------------------------- /pimpmobile_r1/src/pimp_instrument.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/src/pimp_instrument.h -------------------------------------------------------------------------------- /pimpmobile_r1/src/pimp_internal.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/src/pimp_internal.h -------------------------------------------------------------------------------- /pimpmobile_r1/src/pimp_math.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/src/pimp_math.c -------------------------------------------------------------------------------- /pimpmobile_r1/src/pimp_math.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/src/pimp_math.h -------------------------------------------------------------------------------- /pimpmobile_r1/src/pimp_mixer.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/src/pimp_mixer.c -------------------------------------------------------------------------------- /pimpmobile_r1/src/pimp_mixer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/src/pimp_mixer.h -------------------------------------------------------------------------------- /pimpmobile_r1/src/pimp_mixer_arm.S: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/src/pimp_mixer_arm.S -------------------------------------------------------------------------------- /pimpmobile_r1/src/pimp_mixer_clip_arm.S: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/src/pimp_mixer_clip_arm.S -------------------------------------------------------------------------------- /pimpmobile_r1/src/pimp_mixer_portable.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/src/pimp_mixer_portable.c -------------------------------------------------------------------------------- /pimpmobile_r1/src/pimp_mod_context.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/src/pimp_mod_context.c -------------------------------------------------------------------------------- /pimpmobile_r1/src/pimp_mod_context.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/src/pimp_mod_context.h -------------------------------------------------------------------------------- /pimpmobile_r1/src/pimp_module.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/src/pimp_module.h -------------------------------------------------------------------------------- /pimpmobile_r1/src/pimp_render.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/src/pimp_render.c -------------------------------------------------------------------------------- /pimpmobile_r1/src/pimp_render.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/src/pimp_render.h -------------------------------------------------------------------------------- /pimpmobile_r1/src/pimp_sample.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/src/pimp_sample.h -------------------------------------------------------------------------------- /pimpmobile_r1/src/pimp_types.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/src/pimp_types.h -------------------------------------------------------------------------------- /pimpmobile_r1/testbench/Makefile: -------------------------------------------------------------------------------- 1 | CPPFLAGS = -I.. -DASSERT_ENABLE 2 | 3 | FRAMEWORK_SOURCES = framework/test.c 4 | TEST_SOURCES = unit_test.c unit/test_mixer.c 5 | TEST_DEPS_SOURCES = ../src/pimp_mixer.c ../src/pimp_mixer_portable.c 6 | 7 | all: unit_test 8 | run: unit_test 9 | ./unit_test 10 | 11 | unit_test: $(TEST_SOURCES) $(TEST_DEPS_SOURCES) $(FRAMEWORK_SOURCES) 12 | 13 | 14 | -------------------------------------------------------------------------------- /pimpmobile_r1/testbench/framework/test.c: -------------------------------------------------------------------------------- 1 | #include "test.h" 2 | 3 | #define MAX_TEST_PRINTF_STRING_LEN 4096 4 | #include 5 | 6 | char *test_printf(const char* fmt, ...) 7 | { 8 | char temp[MAX_TEST_PRINTF_STRING_LEN]; 9 | char *string; 10 | int len = 0; 11 | va_list arglist; 12 | 13 | va_start(arglist, fmt); 14 | len = vsnprintf(temp, MAX_TEST_PRINTF_STRING_LEN, fmt, arglist); 15 | va_end(arglist); 16 | 17 | string = (char*)malloc(len + 1); 18 | if (NULL != string) 19 | { 20 | va_start(arglist, fmt); 21 | vsnprintf(string, len + 1, fmt, arglist); 22 | va_end(arglist); 23 | string[len] = 0; /* ensure string termination */ 24 | } 25 | 26 | return string; 27 | } 28 | 29 | int test_test_count = 0; 30 | int test_fail_count = 0; 31 | int test_pass_count = 0; 32 | 33 | int test_fail(const char *error) 34 | { 35 | printf("TEST #%d FAILED: %s\n", test_test_count + 1, error); 36 | test_test_count++; 37 | test_fail_count++; 38 | return test_test_count; 39 | } 40 | 41 | int test_pass() 42 | { 43 | test_test_count++; 44 | test_pass_count++; 45 | return test_test_count; 46 | } 47 | 48 | int test_report_file(FILE *fp) 49 | { 50 | fprintf(fp, "%d/%d tests failed\n", test_fail_count, test_test_count); 51 | return test_fail_count; 52 | } 53 | -------------------------------------------------------------------------------- /pimpmobile_r1/testbench/framework/test.h: -------------------------------------------------------------------------------- 1 | #ifndef TEST_H 2 | #define TEST_H 3 | 4 | char *test_printf(const char* fmt, ...); 5 | 6 | int test_fail(const char *error); 7 | int test_pass(); 8 | #define TEST(expr, error) (!(expr) ? test_fail(error) : test_pass()) 9 | 10 | #include 11 | int test_report_file(FILE *fp); 12 | 13 | #endif /* TEST_H */ 14 | -------------------------------------------------------------------------------- /pimpmobile_r1/testbench/toplevel/env_sustain.xm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/testbench/toplevel/env_sustain.xm -------------------------------------------------------------------------------- /pimpmobile_r1/testbench/toplevel/ins_fadeout.xm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/pimpmobile_r1/testbench/toplevel/ins_fadeout.xm -------------------------------------------------------------------------------- /pimpmobile_r1/testbench/unit_test.c: -------------------------------------------------------------------------------- 1 | #include "framework/test.h" 2 | #include 3 | 4 | void test_mixer(void); 5 | 6 | int main(int argc, char *argv[]) 7 | { 8 | test_mixer(); 9 | return test_report_file(stdout); 10 | } 11 | -------------------------------------------------------------------------------- /runtime/cart_hdr.s: -------------------------------------------------------------------------------- 1 | # cartridge header 2 | # extracted from MF/TIN 1.4.3 3 | .byte 0x24, 0xff, 0xae, 0x51, 0x69, 0x9a, 0xa2, 0x21, 0x3d, 0x84, 0x82, 0x0a 4 | .byte 0x84, 0xe4, 0x09, 0xad, 0x11, 0x24, 0x8b, 0x98, 0xc0, 0x81, 0x7f, 0x21, 0xa3, 0x52, 0xbe, 0x19 5 | .byte 0x93, 0x09, 0xce, 0x20, 0x10, 0x46, 0x4a, 0x4a, 0xf8, 0x27, 0x31, 0xec, 0x58, 0xc7, 0xe8, 0x33 6 | .byte 0x82, 0xe3, 0xce, 0xbf, 0x85, 0xf4, 0xdf, 0x94, 0xce, 0x4b, 0x09, 0xc1, 0x94, 0x56, 0x8a, 0xc0 7 | .byte 0x13, 0x72, 0xa7, 0xfc, 0x9f, 0x84, 0x4d, 0x73, 0xa3, 0xca, 0x9a, 0x61, 0x58, 0x97, 0xa3, 0x27 8 | .byte 0xfc, 0x03, 0x98, 0x76, 0x23, 0x1d, 0xc7, 0x61, 0x03, 0x04, 0xae, 0x56, 0xbf, 0x38, 0x84, 0x00 9 | .byte 0x40, 0xa7, 0x0e, 0xfd, 0xff, 0x52, 0xfe, 0x03, 0x6f, 0x95, 0x30, 0xf1, 0x97, 0xfb, 0xc0, 0x85 10 | .byte 0x60, 0xd6, 0x80, 0x25, 0xa9, 0x63, 0xbe, 0x03, 0x01, 0x4e, 0x38, 0xe2, 0xf9, 0xa2, 0x34, 0xff 11 | .byte 0xbb, 0x3e, 0x03, 0x44, 0x78, 0x00, 0x90, 0xcb, 0x88, 0x11, 0x3a, 0x94, 0x65, 0xc0, 0x7c, 0x63 12 | .byte 0x87, 0xf0, 0x3c, 0xaf, 0xd6, 0x25, 0xe4, 0x8b, 0x38, 0x0a, 0xac, 0x72, 0x21, 0xd4, 0xf8, 0x07 13 | .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x44, 0x42, 0x45 14 | .byte 0x30, 0x30, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 15 | -------------------------------------------------------------------------------- /runtime/helpers.c: -------------------------------------------------------------------------------- 1 | /* Implementation of the COMPARE word. */ 2 | int rt_compare(const char *a, const char *b) 3 | { 4 | int size_a = *a++; 5 | int size_b = *b++; 6 | 7 | while (size_a && size_b) { 8 | if (*a < *b) 9 | return 1; 10 | else if (*a > *b) 11 | return -1; 12 | ++a; ++b; 13 | --size_a; --size_b; 14 | } 15 | 16 | if (size_b) 17 | return 1; 18 | else if (size_a) 19 | return -1; 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /runtime/runpimp.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* This is executed before the DragonBASIC runtime. */ 4 | int main() 5 | { 6 | /* This is not strictly necessary, but if we don't use the pimpmobile 7 | library here, it will be eliminated as dead code... */ 8 | pimp_close(); 9 | /* Jump to DragonBASIC runtime. */ 10 | asm("b 0x80000e0"); 11 | } 12 | -------------------------------------------------------------------------------- /runtime/runtime.s: -------------------------------------------------------------------------------- 1 | @ runtime.s: Legacy DragonBASIC runtime identical to the last MF/TIN version 2 | @ released by Jeff Massung. 3 | 4 | .text 5 | 6 | .global _start 7 | _start: 8 | b _entry 9 | 10 | .include "cart_hdr.s" 11 | 12 | @ runtime entry point 13 | .org 0xc0 14 | _entry: 15 | b _tin_entry 16 | 17 | .include "runtime_common.s" 18 | -------------------------------------------------------------------------------- /scintilla.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uli/dragonbasic/6a896cd46718ab7db418b3fd03d5a84a591b81bc/scintilla.dll -------------------------------------------------------------------------------- /test/dim_const.dbc: -------------------------------------------------------------------------------- 1 | #constant foo 10 2 | dim bar(foo) 3 | dim baz(10) 4 | -------------------------------------------------------------------------------- /test/dim_const.f: -------------------------------------------------------------------------------- 1 | CREATE BAR 10 CELLS RESERVE 2 | : BAR[] ( i*x -- a ) 2 # N* BAR + ; 3 | 4 | CREATE BAZ 10 CELLS RESERVE 5 | : BAZ[] ( i*x -- a ) 2 # N* BAZ + ; 6 | 7 | 8 | ENTRY START 9 | PROGRAM" test/dim_const.gba" 10 | 11 | --------------------------------------------------------------------------------