Mercurial > repos > rhope
view ds_main.c @ 75:0083b2f7b3c7
Partially working implementation of List. Modified build scripts to allow use of other compilers. Fixed some bugs involving method implementations on different types returning different numbers of outputs. Added Fold to the 'builtins' in the comipler.
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 06 Jul 2010 07:52:59 -0400 |
parents | 76568becd6d6 |
children |
line wrap: on
line source
/*--------------------------------------------------------------------------------- $Id: main.c,v 1.5 2007/10/23 00:46:29 wntrmute Exp $ Simple console print demo -- dovoto ---------------------------------------------------------------------------------*/ #include <nds.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include "saveload.h" #include "structs.h" #include "interp.h" //--------------------------------------------------------------------------------- int main(void) { //--------------------------------------------------------------------------------- touchPosition touchXY; program * prog; irqInit(); videoSetMode(0); //not using the main screen videoSetModeSub(MODE_0_2D | DISPLAY_BG0_ACTIVE); //sub bg 0 will be used to print text vramSetBankC(VRAM_C_SUB_BG); SUB_BG0_CR = BG_MAP_BASE(31); BG_PALETTE_SUB[255] = RGB15(31,31,31); //by default font will be rendered with color 255 //consoleInit() is a lot more flexible but this gets you up and running quick consoleInitDefault((u16*)SCREEN_BASE_BLOCK_SUB(31), (u16*)CHAR_BASE_BLOCK_SUB(0), 16); fatInitDefault(); prog = load_program("/program.vistxt"); interp_start(-1,TRUE, 0, NULL, prog); while(1) { touchXY=touchReadXY(); iprintf("\x1b[10;0HTouch x = %04X, %04X\n", touchXY.x, touchXY.px); iprintf("Touch y = %04X, %04X\n", touchXY.y, touchXY.py); swiWaitForVBlank(); } return 0; }