Permalink
Browse files

Merge branch 'master' of git://github.com/mtheall/tiny-2d-games

  • Loading branch information...
2 parents e5cc277 + 4b2d83b commit 243a6f8fc22011d37e651a1513f67bb6556efe97 @steveschnepp steveschnepp committed Jun 12, 2012
Showing with 10 additions and 7 deletions.
  1. +3 −0 nds/fbtest/.gitignore
  2. +2 −2 nds/fbtest/Makefile
  3. +5 −5 nds/fbtest/source/main.cpp
View
@@ -0,0 +1,3 @@
+build/
+*.nds
+*.elf
View
@@ -30,9 +30,9 @@ GRAPHICS := gfx
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
-ARCH := -mthumb -mthumb-interwork
+ARCH := -marm -mthumb-interwork
-CFLAGS := -g -Wall -O2 -std=c++11\
+CFLAGS := -g -Wall -O2 -std=gnu++11\
-march=armv5te -mtune=arm946e-s -fomit-frame-pointer\
-ffast-math \
$(ARCH)
View
@@ -96,8 +96,8 @@ int main(int argc, char *argv[]) {
e->x = src.x;
e->y = src.y;
- e->dx = (xor128()%256 - 128) / 256.0f;
- e->dy = (xor128()%256 - 128) / 256.0f;
+ e->dx = f32((s32)inttof32((xor128()%256 - 128))) / 256.0f;
+ e->dy = f32((s32)inttof32((xor128()%256 - 128))) / 256.0f;
e->color = xor128()%16+16; // don't allow transparent
myEntities.push_back(e);
@@ -206,9 +206,9 @@ int main(int argc, char *argv[]) {
// Print debug info
{
consoleClear();
- printf("nb: %d\n", myEntities.size());
- printf("cpu: %.0f%%\n", cpu_usage / 1.92f);
- printf("ticks: %d/%d (%.0f)\n", ticks_move, ticks_done, (100.0f * ticks_move / ticks_done));
+ iprintf("nb: %d\n", myEntities.size());
+ iprintf("cpu: %u%%\n", cpu_usage*100/ 192);
+ iprintf("ticks: %d/%d (%u)\n", ticks_move, ticks_done, (100 * ticks_move / ticks_done));
}
// copy to vram

0 comments on commit 243a6f8

Please sign in to comment.