diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..49d75d4 --- /dev/null +++ b/.clang-format @@ -0,0 +1,2 @@ +UseTab: ForIndentation +BreakBeforeBraces: Attach \ No newline at end of file diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..08501c2 --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,29 @@ +{ + "configurations": [ + { + "name": "NDS", + "forcedInclude": ["${workspaceFolder}/include/vscode_fix.h"], + "includePath": [ + "${workspaceFolder}", + "${workspaceFolder}/include/**", + "/opt/devkitpro/libnds/include/**", + "/opt/devkitpro/devkitARM/arm-none-eabi/include/**" + ], + "defines": ["_DEBUG", "_UNICODE", "WIN32", "ARM7", "ARM9"], + "browse": { + "path": [ + "${workspaceFolder}", + "${workspaceFolder}/include/**", + "/opt/devkitpro/libnds/include/**", + "/opt/devkitpro/devkitARM/arm-none-eabi/include/**" + ], + "limitSymbolsToIncludedHeaders": true, + "databaseFilename": "" + }, + "cStandard": "c11", + "cppStandard": "c++11", + "compilerPath": "/opt/devkitpro/devkitARM/bin/arm-none-eabi-g++" + } + ], + "version": 4 +} diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..f900375 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,32 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "(gdb) Launch", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/${workspaceFolderBasename}.elf", + "targetArchitecture": "arm", + "preLaunchTask": "gdb-debug", + "postDebugTask": "stop-emulation", + "serverLaunchTimeout": 10000, + "stopAtEntry": true, + "cwd": "${workspaceFolder}", + "environment": [], + "externalConsole": true, + "MIMode": "gdb", + "miDebuggerPath": "/opt/devkitpro/devkitARM/bin/arm-none-eabi-gdb", + "miDebuggerServerAddress": "localhost:20000", + "setupCommands": [ + { + "description": "Enable pretty-printing", + "text": "file ${workspaceFolder}/${workspaceFolderBasename}.elf -enable-pretty-printing", + "ignoreFailures": true + } + ] + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..e7b9e31 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "C_Cpp.clang_format_fallbackStyle": "{UseTab: ForIndentation}" +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..aaeaf45 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,79 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "make debug", + "type": "process", + "command": "make", + "args": [ + "DEBUG=1" + ], + "problemMatcher": [] + }, + { + "label": "make release", + "type": "process", + "command": "make", + "args": [ + "DEBUG=0" + ], + "problemMatcher": [], + "group": { + "kind": "build", + "isDefault": true + } + }, + { + "label": "clean", + "type": "process", + "command": "make", + "args": [ + "clean" + ], + "problemMatcher": [] + }, + { + "label": "run", + "type": "shell", + "isBackground": true, + "command": "/usr/games/desmume-cli", + "args": [ + "${workspaceFolder}/${workspaceFolderBasename}.nds" + ], + "presentation": { + "clear": true, + "reveal": "always" + }, + "problemMatcher": [] + }, + { + "label": "gdb-debug", + "type": "shell", + "dependsOn": [ + "make debug" + ], + "isBackground": false, + "command": "/usr/games/desmume-cli", + "args": [ + "--arm9gdb=20000", + "${workspaceFolder}/${workspaceFolderBasename}.nds" + ], + "presentation": { + "clear": true, + "reveal": "always" + }, + "problemMatcher": [] + }, + { + "label": "stop-emulation", + "type": "shell", + "command": "taskkill", + "args": [ + "/FI", + "imagename eq DeSmuME*" + ], + "problemMatcher": [] + } + ] \ No newline at end of file diff --git a/Makefile b/Makefile index f6861e4..009d0a9 100644 --- a/Makefile +++ b/Makefile @@ -10,10 +10,10 @@ include $(DEVKITARM)/ds_rules export TARGET := $(shell basename $(CURDIR)) export TOPDIR := $(CURDIR) export GAME_TITLE := prettychips -export GAME_ICON := $(DEVKITPRO)/prettychips.bmp -export GAME_SUBTITLE1 := holy rookies +export GAME_ICON := icon.bmp +export GAME_SUBTITLE1 := love x export GAME_SUBTITLE2 := chee -ICON := -b $(DEVKITPRO)/prettychips.bmp +ICON := -b icon.bmp .PHONY: $(TARGET).arm7 $(TARGET).arm9 diff --git a/arm7/source/main7.c b/arm7/source/main7.c index 642ade0..bcf27d4 100644 --- a/arm7/source/main7.c +++ b/arm7/source/main7.c @@ -65,7 +65,7 @@ int main() { irqInit(); fifoInit(); - int channel = -1; + // int channel = -1; // read User Settings from firmware readUserSettings(); diff --git a/arm9/source/extras.c b/arm9/source/extras.c index feba62a..edbb483 100644 --- a/arm9/source/extras.c +++ b/arm9/source/extras.c @@ -1,204 +1,207 @@ -/* Copyright 2009 Graeme Roberts :: - prettychips is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - prettychips is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with prettychips. If not, see . -*/ -#include "globals.h" -#include "extras.h" -#include - - - -float powfer(float x, float y) { - float final; - final = x; - int i; -for (i = 1; i < y; i++) - - x *= final; - - return x; -} - -void chroot() { - int i; - root = NOTEA/2; - for (i = 0; i < octave; i++) - root += root; - - root *= (powfer(TWELFTHROOT, (curkey + 1))); - root -= TWELFTHROOT; - root -= TWELFTHROOT; -} - -void makeNotes() { - int i; - for (i = 0; i < 13; i++) - { - notes[i] = root * (powfer(TWELFTHROOT, (i+1) ) ); - } -} - -void doKeys() { - switch (scale) { - - default: // Major Scale - keys[0] = notes[0]; - keys[1] = notes[2]; - keys[2] = notes[4]; - keys[3] = notes[5]; - keys[4] = notes[7]; - keys[5] = notes[9]; - keys[6] = notes[11]; - keys[7] = notes[12]; - break; - - case 1: // Minor Scale - keys[0] = notes[0]; - keys[1] = notes[2]; - keys[2] = notes[3]; - keys[3] = notes[5]; - keys[4] = notes[7]; - keys[5] = notes[8]; - keys[6] = notes[10]; - keys[7] = notes[12]; - break; - - case 2: // Mel. Minor Scale - keys[0] = notes[0]; - keys[1] = notes[2]; - keys[2] = notes[3]; - keys[3] = notes[5]; - keys[4] = notes[7]; - keys[5] = notes[9]; - keys[6] = notes[11]; - keys[7] = notes[12]; - break; - - case 3: // Phrygian Scale - keys[0] = notes[0]; - keys[1] = notes[1]; - keys[2] = notes[3]; - keys[3] = notes[5]; - keys[4] = notes[7]; - keys[5] = notes[8]; - keys[6] = notes[10]; - keys[7] = notes[12]; - break; - - case 4: // Blues Scale - keys[0] = notes[0]; - keys[1] = notes[3]; - keys[2] = notes[5]; - keys[3] = notes[6]; - keys[4] = notes[7]; - keys[5] = notes[10]; - keys[6] = notes[11]; - keys[7] = notes[12]; - break; - } -} - -bool withIn(int f, int m, int l) { - if (f < m && m < l) - return true; - else if (f > m || m > l) - return false; -return 0; -} - -void doWD(int wd) { - int i; - for (i = 0; i < 8; i++) - soundSetWaveDuty(ids[i], wd); - wCycle = wd; -} - -void doPAN(int pan) { - int i; - for (i = 0; i < 8; i++) - soundSetPan(ids[i], pan); - nPan = pan; -} - - -void doVOLUME(int volume) { - nVolume = volume; -} - -void clearanarray(u8 *l, int max) { - int i; -for (i = 0; i < max; i++) -l[i] = 0; -} -int v; -float p; - -void touchMe(int soundid) { -int i; - if (drone > 4) { - for (i=0;i<8;i++) - if (noteHeld[i] == false) - soundKill((i+8)); - drone = 0; - } - p = pitching; - v = volbent; - - noteHeld[soundid] = true; - myVolume[soundid] = nVolume; - ids[soundid] = soundPlayPSG(wCycle, keys[soundid], myVolume[soundid], nPan); - noted[soundid] = keys[soundid]; -} - -void holdMe(int soundid) { - noteHeld[soundid] = true; - - if (myVolume[soundid] + v > 126) - soundSetVolume(ids[soundid], myVolume[soundid]); - else - soundSetVolume(ids[soundid], myVolume[soundid] + v); - - soundSetPan(ids[soundid], myPan[soundid]); - - if (keys[soundid] + p + whammy > keys[soundid]* (2*ppeak) || keys[soundid] + p + whammy < keys[soundid] / (2*ppeak)) - p = 0; - - soundSetFreq(ids[soundid], noted[soundid] + p + whammy); - v += volbent; - p += pitching; - myVolume[soundid] = nVolume; - myPan[soundid] = nPan; -} - - -void killMe(int soundid) { - p = 0; - v = 0; - soundKill(ids[soundid]); - noteHeld[soundid] = false; -} - -// drones. -void LMe(int soundid) { - p = 0; - v = 0; - noteHeld[soundid] = false; - drone++; -} - -// Panic button, kills every PSG channel (including noise channels); -void PANIC() { - int i; - for (i = 8; i < 16; i++) - soundKill(i); -} +/* Copyright 2009 Graeme Roberts :: + prettychips is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + prettychips is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with prettychips. If not, see . +*/ +#include "extras.h" +#include + +bool noteHeld[8]; +int ids[8]; +int drone; +u16 keys[8]; +u8 myPan[8]; +u8 myVolume[8]; +float noted[8]; +u16 notes[13]; +float ppeak; +u16 root; + +float powfer(float x, float y) { + float final; + final = x; + int i; + for (i = 1; i < y; i++) { + x *= final; + } + + return x; +} + +void chrootnote() { + int i; + root = NOTEA / 2; + for (i = 0; i < octave; i++) + root += root; + + root *= (powfer(TWELFTHROOT, (curkey + 1))); + root -= TWELFTHROOT; + root -= TWELFTHROOT; +} + +void makeNotes() { + int i; + for (i = 0; i < 13; i++) { + notes[i] = root * (powfer(TWELFTHROOT, (i + 1))); + } +} + +void doKeys() { + switch (scale) { + default: // Major Scale + keys[0] = notes[0]; + keys[1] = notes[2]; + keys[2] = notes[4]; + keys[3] = notes[5]; + keys[4] = notes[7]; + keys[5] = notes[9]; + keys[6] = notes[11]; + keys[7] = notes[12]; + break; + + case 1: // Minor Scale + keys[0] = notes[0]; + keys[1] = notes[2]; + keys[2] = notes[3]; + keys[3] = notes[5]; + keys[4] = notes[7]; + keys[5] = notes[8]; + keys[6] = notes[10]; + keys[7] = notes[12]; + break; + + case 2: // Mel. Minor Scale + keys[0] = notes[0]; + keys[1] = notes[2]; + keys[2] = notes[3]; + keys[3] = notes[5]; + keys[4] = notes[7]; + keys[5] = notes[9]; + keys[6] = notes[11]; + keys[7] = notes[12]; + break; + + case 3: // Phrygian Scale + keys[0] = notes[0]; + keys[1] = notes[1]; + keys[2] = notes[3]; + keys[3] = notes[5]; + keys[4] = notes[7]; + keys[5] = notes[8]; + keys[6] = notes[10]; + keys[7] = notes[12]; + break; + + case 4: // Blues Scale + keys[0] = notes[0]; + keys[1] = notes[3]; + keys[2] = notes[5]; + keys[3] = notes[6]; + keys[4] = notes[7]; + keys[5] = notes[10]; + keys[6] = notes[11]; + keys[7] = notes[12]; + break; + } +} + +bool withIn(int f, int m, int l) { + if (f < m && m < l) + return true; + else if (f > m || m > l) + return false; + return 0; +} + +void doWD(int wd) { + int i; + for (i = 0; i < 8; i++) + soundSetWaveDuty(ids[i], wd); + wCycle = wd; +} + +void doPAN(int pan) { + int i; + for (i = 0; i < 8; i++) + soundSetPan(ids[i], pan); + nPan = pan; +} + +void doVOLUME(int volume) { nVolume = volume; } + +void clearanarray(u8 *l, int max) { + int i; + for (i = 0; i < max; i++) + l[i] = 0; +} +int v; +float p; + +void touchMe(int soundid) { + int i; + if (drone > 4) { + for (i = 0; i < 8; i++) + if (noteHeld[i] == false) + soundKill((i + 8)); + drone = 0; + } + p = pitching; + v = volbent; + + noteHeld[soundid] = true; + myVolume[soundid] = nVolume; + ids[soundid] = soundPlayPSG(wCycle, keys[soundid], myVolume[soundid], nPan); + noted[soundid] = keys[soundid]; +} + +void holdMe(int soundid) { + noteHeld[soundid] = true; + + if (myVolume[soundid] + v > 126) + soundSetVolume(ids[soundid], myVolume[soundid]); + else + soundSetVolume(ids[soundid], myVolume[soundid] + v); + + soundSetPan(ids[soundid], myPan[soundid]); + + if (keys[soundid] + p + whammy > keys[soundid] * (2 * ppeak) || + keys[soundid] + p + whammy < keys[soundid] / (2 * ppeak)) + p = 0; + + soundSetFreq(ids[soundid], noted[soundid] + p + whammy); + v += volbent; + p += pitching; + myVolume[soundid] = nVolume; + myPan[soundid] = nPan; +} + +void killMe(int soundid) { + p = 0; + v = 0; + soundKill(ids[soundid]); + noteHeld[soundid] = false; +} + +// drones. +void LMe(int soundid) { + p = 0; + v = 0; + noteHeld[soundid] = false; + drone++; +} + +// Panic button, kills every PSG channel (including noise channels); +void PANIC() { + int i; + for (i = 8; i < 16; i++) + soundKill(i); +} diff --git a/arm9/source/extras.h b/arm9/source/extras.h index f9b7c2e..78aaa0c 100644 --- a/arm9/source/extras.h +++ b/arm9/source/extras.h @@ -1,5 +1,5 @@ -/* Copyright 2009 Graeme Roberts :: - prettychips is free software: you can redistribute it and/or modify +/* Copyright 2009 Graeme Roberts :: + prettychips is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. @@ -13,15 +13,15 @@ along with prettychips. If not, see . */ -#include +#include "globals.h" #include +#include float powfer(float x, float y); -void chroot(); +void chrootnote(); void makeNotes(); void doKeys(); - void doWD(int wd); void doPAN(int pan); void doVOLUME(int volume); @@ -33,4 +33,7 @@ void touchMe(int soundid); void holdMe(int soundid); void killMe(int soundid); void LMe(int soundid); -void PANIC(); \ No newline at end of file +void PANIC(); + +#define NOTEA 440 +#define TWELFTHROOT 1.0594630943593 diff --git a/arm9/source/globals.c b/arm9/source/globals.c index ddc0faa..79360f9 100644 --- a/arm9/source/globals.c +++ b/arm9/source/globals.c @@ -1,4 +1,2 @@ -#include #include "globals.h" - - +#include diff --git a/arm9/source/globals.h b/arm9/source/globals.h index b4603f6..3b0be75 100644 --- a/arm9/source/globals.h +++ b/arm9/source/globals.h @@ -1,5 +1,5 @@ -/* Copyright 2009 Graeme Roberts :: - prettychips is free software: you can redistribute it and/or modify +/* Copyright 2009 Graeme Roberts :: + prettychips is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. @@ -20,53 +20,50 @@ // For calculating the notes. -u16 notes[13]; -u16 keys[8]; -u16 root; - -int scale; -int octave; -int curkey; - -//Rhythm. -int bpm; -int hpm; -int lpm; -//for setting a PSG -int ids[8]; -int wCycle; -u8 nVolume; -u8 nPan; - -//other -int cscreen; -bool trem_on; -bool rel_on; - -bool noteHeld[8]; - - -int volbent; -float pitching; -float ppeak; -u8 vpeak; -float whammy; - - -int trem_speed; -u8 rlength; -int bg3; -int bg3sub; -int killme[8]; -u8 myVolume[8]; -u8 myPan[8]; - - -bool wOval; -bool fTri; -int wovalate; -int ftriangulate; - -float noted[8]; - -int drone; \ No newline at end of file +extern u16 notes[13]; +extern u16 keys[8]; +extern u16 root; + +extern int scale; +extern int octave; +extern int curkey; + +// Rhythm. +extern int bpm; +extern int hpm; +extern int lpm; +// for setting a PSG +extern int ids[8]; +extern int wCycle; +extern u8 nVolume; +extern u8 nPan; + +// other +extern int cscreen; +extern bool trem_on; +extern bool rel_on; + +extern bool noteHeld[8]; + +extern int volbent; +extern float pitching; +extern float ppeak; +extern u8 vpeak; +extern float whammy; + +extern int trem_speed; +extern u8 rlength; +extern int bg3; +extern int bg3sub; +extern int killme[8]; +extern u8 myVolume[8]; +extern u8 myPan[8]; + +extern bool wOval; +extern bool fTri; +extern int wovalate; +extern int ftriangulate; + +extern float noted[8]; + +extern int drone; \ No newline at end of file diff --git a/arm9/source/main9.c b/arm9/source/main9.c index 1f7fdeb..c802199 100644 --- a/arm9/source/main9.c +++ b/arm9/source/main9.c @@ -1,5 +1,5 @@ /* Copyright 2009 Graeme Roberts :: - prettychips is free software: you can redistribute it and/or modify + prettychips is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. @@ -14,241 +14,239 @@ */ // includes +#include "nds/fifomessages.h" +#include #include #include -#include -#include "nds/fifomessages.h" // My headers. -#include "mytimers.h" #include "extras.h" -#include "globals.h" #include "menus.h" +#include "mytimers.h" #include "topscreen.h" -//Include the font header generated by grit +int wovalate; +u8 nVolume; +int bg3; +int bg3sub; +int bpm; +int curkey; +bool fTri; +bool wOval; +int wovalate; +int ftriangulate; +int hpm; +int lpm; +u8 nPan; +int octave; +float pitching; +int scale; +int volbent; +int wCycle; +float whammy; + +// Include the font header generated by grit //#include "font.h" //--------------------------------------------------------------------------------- int main(void) { -//--------------------------------------------------------------------------------- - - int i; - const int tile_base = 0; - const int map_base = 20; - - - //state the global starting values - - wOval = false; - fTri = false; - wovalate = 1; - ftriangulate = 0; - - - curkey = 0; - octave = 1; - scale = 0; - chroot(); - - pitching = 0; - volbent = 0; - - wCycle = 0; - nVolume = 127; - nPan = 64; - bpm = 120; - hpm = bpm/60; - lpm = hpm; - effect(); - - touchPosition touch; - int tx, ty; - - soundEnable(); - lcdMainOnBottom(); - consoleDemoInit(); //setting the sub screen for printing, in case I implement a debug mode. - videoSetMode(MODE_5_2D); - - vramSetBankA(VRAM_A_MAIN_BG_0x06000000); - bg3 = bgInit(3, BgType_Bmp8, BgSize_B8_256x256, 0,0); - - videoSetModeSub(MODE_5_2D); - vramSetBankB(VRAM_B_MAIN_BG_0x06000000); - bg3sub = bgInitSub(3, BgType_Bmp16, BgSize_B16_256x256, 0, 0); - decompress(topscreenBitmap, BG_GFX_SUB, LZ77Vram); - - vramSetBankC(VRAM_C_SUB_BG); - PrintConsole *console = consoleInit(0, 2, BgType_ExRotation, BgSize_ER_256x256, map_base, tile_base, false, false); - - ConsoleFont font; - - font.gfx = (u16*)fontTiles; - font.pal = (u16*)fontPal; - font.numChars = 95; - font.numColors = fontPalLen / 2; - font.bpp = 8; - font.asciiOffset = 32; - font.convertSingleColor = false; - - consoleSetFont(console, &font); - - int bg2 = console->bgId; - - - - unsigned int angle = 0; - int scrollX = 0; - int scrollY = 0; - int scaleX = intToFixed(1,8); - int scaleY = intToFixed(1,8); - - setMenuUP(); - theBeat(); - - makeMeSomeButtons(); - - // Initial keys launch. - makeNotes(); - doKeys(); - noteHeld[0] = false; - - while(1) { // main loop - - - scanKeys(); - - touchRead(&touch); - tx = touch.px; - ty = touch.py; - - - /* - * TOUCH ME - */ - - if (keysDown() & KEY_DOWN) - touchMe(0); - if (keysDown() & KEY_LEFT) - touchMe(1); - if (keysDown() & KEY_UP) - touchMe(2); - if (keysDown() & KEY_RIGHT) - touchMe(3); - if (keysDown() & KEY_Y) - touchMe(4); - if (keysDown() & KEY_X) - touchMe(5); - if (keysDown() & KEY_A) - touchMe(6); - if (keysDown() & KEY_B) - touchMe(7); - - /* - * HOLD ME - */ - - if (keysHeld() & KEY_DOWN) - holdMe(0); - if (keysHeld() & KEY_LEFT) - holdMe(1); - if (keysHeld() & KEY_UP) - holdMe(2); - if (keysHeld() & KEY_RIGHT) - holdMe(3); - if (keysHeld() & KEY_Y) - holdMe(4); - if (keysHeld() & KEY_X) - holdMe(5); - if (keysHeld() & KEY_A) - holdMe(6); - if (keysHeld() & KEY_B) - holdMe(7); - - - - /* - * KILL ME - */ - if ( !(keysHeld() & KEY_L) ) { - if (keysUp() & KEY_DOWN) - killMe(0); - if (keysUp() & KEY_LEFT) - killMe(1); - if (keysUp() & KEY_UP) - killMe(2); - if (keysUp() & KEY_RIGHT) - killMe(3); - if (keysUp() & KEY_Y) - killMe(4); - if (keysUp() & KEY_X) - killMe(5); - if (keysUp() & KEY_A) - killMe(6); - if (keysUp() & KEY_B) - killMe(7); - } - if ( (keysHeld() & KEY_L) ) { - if (keysUp() & KEY_DOWN) - LMe(1); - if (keysUp() & KEY_LEFT) - LMe(1); - if (keysUp() & KEY_UP) - LMe(2); - if (keysUp() & KEY_RIGHT) - LMe(3); - if (keysUp() & KEY_Y) - LMe(4); - if (keysUp() & KEY_X) - LMe(5); - if (keysUp() & KEY_A) - LMe(6); - if (keysUp() & KEY_B) - LMe(7); - } - - - /* L + R are panic buttons ;__; */ - - if (keysDown() & KEY_R) - PANIC(); - - /* sends touch data for button checking over on menus.c */ - - if (keysHeld() & KEY_TOUCH) - isWeHasButton(tx, ty); - - if (keysDown() & KEY_TOUCH) - keysDownOnly(tx, ty); - - if (keysUp() & KEY_TOUCH) - whammy = 0; - - if (keysHeld() & KEY_SELECT){ - if (bpm > 30) { - if (keysDown() & KEY_DOWN) - bpm -=1; - if (keysHeld() & KEY_LEFT) - bpm -=1; - } - if (keysDown() & KEY_UP) - bpm +=1; - if (keysHeld() & KEY_RIGHT) - bpm +=1; - - if (keysHeld() & KEY_START) { - - } - - } - - /* updates the bpm every fram, for future use, dollface. */ - hpm = bpm/60; - iprintf("\x1b[0;0H%i", bpm); - bgSetRotateScale(bg2, angle, scaleX, scaleY); - bgSetScroll(bg2, scrollX, scrollY); - bgUpdate(); - swiWaitForVBlank(); - } - - return 0; + //--------------------------------------------------------------------------------- + + const int tile_base = 0; + const int map_base = 20; + + // state the global starting values + + wOval = false; + fTri = false; + wovalate = 1; + ftriangulate = 0; + + curkey = 0; + octave = 1; + scale = 0; + chrootnote(); + + pitching = 0; + volbent = 0; + + wCycle = 0; + nVolume = 127; + nPan = 64; + bpm = 120; + hpm = bpm / 60; + lpm = hpm; + effect(); + + touchPosition touch; + int tx, ty; + + soundEnable(); + lcdMainOnBottom(); + consoleDemoInit(); // setting the sub screen for printing, in case I implement + // a debug mode. + videoSetMode(MODE_5_2D); + + vramSetBankA(VRAM_A_MAIN_BG_0x06000000); + bg3 = bgInit(3, BgType_Bmp8, BgSize_B8_256x256, 0, 0); + + videoSetModeSub(MODE_5_2D); + vramSetBankB(VRAM_B_MAIN_BG_0x06000000); + bg3sub = bgInitSub(3, BgType_Bmp16, BgSize_B16_256x256, 0, 0); + decompress(topscreenBitmap, BG_GFX_SUB, LZ77Vram); + + vramSetBankC(VRAM_C_SUB_BG); + PrintConsole *console = + consoleInit(0, 2, BgType_ExRotation, BgSize_ER_256x256, map_base, + tile_base, false, false); + + int bg2 = console->bgId; + + unsigned int angle = 0; + int scrollX = 0; + int scrollY = 0; + int scaleX = intToFixed(1, 8); + int scaleY = intToFixed(1, 8); + + setMenuUP(); + theBeat(); + + makeMeSomeButtons(); + + // Initial keys launch. + makeNotes(); + doKeys(); + noteHeld[0] = false; + + while (1) { // main loop + + scanKeys(); + + touchRead(&touch); + tx = touch.px; + ty = touch.py; + + /* + * TOUCH ME + */ + + if (keysDown() & KEY_DOWN) + touchMe(0); + if (keysDown() & KEY_LEFT) + touchMe(1); + if (keysDown() & KEY_UP) + touchMe(2); + if (keysDown() & KEY_RIGHT) + touchMe(3); + if (keysDown() & KEY_Y) + touchMe(4); + if (keysDown() & KEY_X) + touchMe(5); + if (keysDown() & KEY_A) + touchMe(6); + if (keysDown() & KEY_B) + touchMe(7); + + /* + * HOLD ME + */ + + if (keysHeld() & KEY_DOWN) + holdMe(0); + if (keysHeld() & KEY_LEFT) + holdMe(1); + if (keysHeld() & KEY_UP) + holdMe(2); + if (keysHeld() & KEY_RIGHT) + holdMe(3); + if (keysHeld() & KEY_Y) + holdMe(4); + if (keysHeld() & KEY_X) + holdMe(5); + if (keysHeld() & KEY_A) + holdMe(6); + if (keysHeld() & KEY_B) + holdMe(7); + + /* + * KILL ME + */ + if (!(keysHeld() & KEY_L)) { + if (keysUp() & KEY_DOWN) + killMe(0); + if (keysUp() & KEY_LEFT) + killMe(1); + if (keysUp() & KEY_UP) + killMe(2); + if (keysUp() & KEY_RIGHT) + killMe(3); + if (keysUp() & KEY_Y) + killMe(4); + if (keysUp() & KEY_X) + killMe(5); + if (keysUp() & KEY_A) + killMe(6); + if (keysUp() & KEY_B) + killMe(7); + } + if ((keysHeld() & KEY_L)) { + if (keysUp() & KEY_DOWN) + LMe(1); + if (keysUp() & KEY_LEFT) + LMe(1); + if (keysUp() & KEY_UP) + LMe(2); + if (keysUp() & KEY_RIGHT) + LMe(3); + if (keysUp() & KEY_Y) + LMe(4); + if (keysUp() & KEY_X) + LMe(5); + if (keysUp() & KEY_A) + LMe(6); + if (keysUp() & KEY_B) + LMe(7); + } + + /* L + R are panic buttons ;__; */ + + if (keysDown() & KEY_R) + PANIC(); + + /* sends touch data for button checking over on menus.c */ + + if (keysHeld() & KEY_TOUCH) + isWeHasButton(tx, ty); + + if (keysDown() & KEY_TOUCH) + keysDownOnly(tx, ty); + + if (keysUp() & KEY_TOUCH) + whammy = 0; + + if (keysHeld() & KEY_SELECT) { + if (bpm > 30) { + if (keysDown() & KEY_DOWN) + bpm -= 1; + if (keysHeld() & KEY_LEFT) + bpm -= 1; + } + if (keysDown() & KEY_UP) + bpm += 1; + if (keysHeld() & KEY_RIGHT) + bpm += 1; + + if (keysHeld() & KEY_START) { + } + } + + /* updates the bpm every fram, for future use, dollface. */ + hpm = bpm / 60; + iprintf("\x1b[0;0H%i", bpm); + bgSetRotateScale(bg2, angle, scaleX, scaleY); + bgSetScroll(bg2, scrollX, scrollY); + bgUpdate(); + swiWaitForVBlank(); + } + + return 0; } diff --git a/arm9/source/main9.h b/arm9/source/main9.h index 6587c17..6aea040 100644 --- a/arm9/source/main9.h +++ b/arm9/source/main9.h @@ -1,5 +1,5 @@ -/* Copyright 2009 Graeme Roberts :: - prettychips is free software: you can redistribute it and/or modify +/* Copyright 2009 Graeme Roberts :: + prettychips is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. @@ -14,14 +14,14 @@ */ // includes +#include "nds/fifomessages.h" +#include #include #include -#include -#include "nds/fifomessages.h" // My headers. -#include "mytimers.h" +#include "extras.h" #include "globals.h" #include "menus.h" -#include "topscreen.h" -#include "extras.h" \ No newline at end of file +#include "mytimers.h" +#include "topscreen.h" \ No newline at end of file diff --git a/arm9/source/menus.c b/arm9/source/menus.c index 5b1f002..8fe384d 100644 --- a/arm9/source/menus.c +++ b/arm9/source/menus.c @@ -1,5 +1,5 @@ -/* Copyright 2009 Graeme Roberts :: - prettychips is free software: you can redistribute it and/or modify +/* Copyright 2009 Graeme Roberts :: + prettychips is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. @@ -13,29 +13,29 @@ along with prettychips. If not, see . */ -#include #include "menus.h" -#include "globals.h" #include "extras.h" -#include "mytimers.h" +#include "globals.h" #include "menu1.h" #include "menu2.h" #include "menu3.h" #include "menu5.h" - +#include "mytimers.h" +#include int menuon; typedef struct { - int fx; - int lx; - int fy; - int ly; + int fx; + int lx; + int fy; + int ly; } touchPlace; - + +int cscreen; // make buttons. -touchPlace majorb; // first screen +touchPlace majorb; // first screen touchPlace minorb; touchPlace melminb; touchPlace phrygb; @@ -57,319 +57,295 @@ touchPlace keyfsb; touchPlace keygb; touchPlace keygsb; -touchPlace wdab; // second screen +touchPlace wdab; // second screen touchPlace wdbb; touchPlace wdcb; touchPlace wddb; touchPlace wdeb; touchPlace wdfb; -touchPlace trem; // third screen +touchPlace trem; // third screen touchPlace pRamp; touchPlace vRamp; touchPlace aTack; touchPlace rLease; -void makeMeSomeButtons(){ -// define buttons. -majorb.fx = 8; //first screen -majorb.lx = 46; -minorb.fx = 58; -minorb.lx = 96; -melminb.fx = 108; -melminb.lx = 146; -phrygb.fx = 158; -phrygb.lx = 196; -bluesb.fx = 208; -bluesb.lx = 246; - -octdb.fx = 80; -octdb.lx = 118; -octub.fx = 136; -octub.lx = 174; - - -keyab.fx = 6; -keyab.lx = 22; -keyasb.fx = 23; -keyasb.lx = 50; -keybb.fx = 51; -keybb.lx = 66; -keycb.fx = 67; -keycb.lx = 82; -keycsb.fx = 83; -keycsb.lx = 110; -keydb.fx = 111; -keydb.lx = 124; -keydsb.fx = 125; -keydsb.lx = 150; -keyeb.fx = 151; -keyeb.lx = 164; -keyfb.fx = 165; -keyfb.lx = 176; -keyfsb.fx = 177; -keyfsb.lx = 201; -keygb.fx = 202; -keygb.lx = 217; -keygsb.fx = 218; -keygsb.lx = 248; - -wdab.fx = 2; // second screen; -wdab.lx = 39; -wdbb.fx = 45; -wdbb.lx = 82; -wdcb.fx = 88; -wdcb.lx = 125; -wddb.fx = 130; -wddb.lx = 167; -wdeb.fx = 173; -wdeb.lx = 210; -wdfb.fx = 216; -wdfb.lx = 253; - -trem.fy = 45; -trem.ly = 186; - +void makeMeSomeButtons() { + // define buttons. + majorb.fx = 8; // first screen + majorb.lx = 46; + minorb.fx = 58; + minorb.lx = 96; + melminb.fx = 108; + melminb.lx = 146; + phrygb.fx = 158; + phrygb.lx = 196; + bluesb.fx = 208; + bluesb.lx = 246; + + octdb.fx = 80; + octdb.lx = 118; + octub.fx = 136; + octub.lx = 174; + + keyab.fx = 6; + keyab.lx = 22; + keyasb.fx = 23; + keyasb.lx = 50; + keybb.fx = 51; + keybb.lx = 66; + keycb.fx = 67; + keycb.lx = 82; + keycsb.fx = 83; + keycsb.lx = 110; + keydb.fx = 111; + keydb.lx = 124; + keydsb.fx = 125; + keydsb.lx = 150; + keyeb.fx = 151; + keyeb.lx = 164; + keyfb.fx = 165; + keyfb.lx = 176; + keyfsb.fx = 177; + keyfsb.lx = 201; + keygb.fx = 202; + keygb.lx = 217; + keygsb.fx = 218; + keygsb.lx = 248; + + wdab.fx = 2; // second screen; + wdab.lx = 39; + wdbb.fx = 45; + wdbb.lx = 82; + wdcb.fx = 88; + wdcb.lx = 125; + wddb.fx = 130; + wddb.lx = 167; + wdeb.fx = 173; + wdeb.lx = 210; + wdfb.fx = 216; + wdfb.lx = 253; + + trem.fy = 45; + trem.ly = 186; } - void setMenuUP() { - switch (cscreen) { - case 0: - dmaCopy(menu1Bitmap, bgGetGfxPtr(bg3), 256*256); - dmaCopy(menu1Pal, BG_PALETTE, 256*2); - break; - case 1: - dmaCopy(menu2Bitmap, bgGetGfxPtr(bg3), 256*256); - dmaCopy(menu2Pal, BG_PALETTE, 256*2); - break; - case 2: - dmaCopy(menu3Bitmap, bgGetGfxPtr(bg3), 256*256); - dmaCopy(menu3Pal, BG_PALETTE, 256*2); - break; - case 4: - dmaCopy(menu5Bitmap, bgGetGfxPtr(bg3), 256*256); - dmaCopy(menu5Pal, BG_PALETTE, 256*2); - break; - } + switch (cscreen) { + case 0: + dmaCopy(menu1Bitmap, bgGetGfxPtr(bg3), 256 * 256); + dmaCopy(menu1Pal, BG_PALETTE, 256 * 2); + break; + case 1: + dmaCopy(menu2Bitmap, bgGetGfxPtr(bg3), 256 * 256); + dmaCopy(menu2Pal, BG_PALETTE, 256 * 2); + break; + case 2: + dmaCopy(menu3Bitmap, bgGetGfxPtr(bg3), 256 * 256); + dmaCopy(menu3Pal, BG_PALETTE, 256 * 2); + break; + case 4: + dmaCopy(menu5Bitmap, bgGetGfxPtr(bg3), 256 * 256); + dmaCopy(menu5Pal, BG_PALETTE, 256 * 2); + break; + } } void isWeHasButton(int px, int py) { - int ra; - int inde; - if (withIn(TOPMENUFY, py, TOPMENULY)) - { - if (withIn(1, px, 49)) - { - cscreen = 0; - setMenuUP(); - } - if (withIn(52, px, 101)) - { - cscreen = 1; - setMenuUP(); - } - if (withIn(103, px, 152)) - { - cscreen = 2; - setMenuUP(); - } - if (withIn(208, px, 255)) - { - cscreen = 4; - setMenuUP(); - } - - } - - if (cscreen == 0) { - if (withIn(MENU1TFY, py, MENU1TLY)) - { - if (withIn(majorb.fx, px, majorb.lx)) - scale = 0; - if (withIn(minorb.fx, px, minorb.lx)) - scale = 1; - if (withIn(melminb.fx, px, melminb.lx)) - scale = 2; - if (withIn(phrygb.fx, px, phrygb.lx)) - scale = 3; - if (withIn(bluesb.fx, px, bluesb.lx)) - scale = 4; - doKeys(); - } - - if (withIn(MENU1BFY, py, MENU1BLY)) - { - if (withIn(keyab.fx, px, keyab.lx)) - curkey = 0; - if (withIn(keyasb.fx, px, keyasb.lx)) - curkey = 1; - if (withIn(keybb.fx, px, keybb.lx)) - curkey = 2; - if (withIn(keycb.fx, px, keycb.lx)) - curkey = 3; - if (withIn(keycsb.fx, px, keycsb.lx)) - curkey = 4; - if (withIn(keydb.fx, px, keydb.lx)) - curkey = 5; - if (withIn(keydsb.fx, px, keydsb.lx)) - curkey = 6; - if (withIn(keyeb.fx, px, keyeb.lx)) - curkey = 7; - if (withIn(keyfb.fx, px, keyfb.lx)) - curkey = 8; - if (withIn(keyfsb.fx, px, keyfsb.lx)) - curkey = 9; - if (withIn(keygb.fx, px, keygb.lx)) - curkey = 10; - if (withIn(keygsb.fx, px, keygsb.lx)) - curkey = 11; - chroot(); - makeNotes(); - doKeys(); - - } - } - else if (cscreen == 1) { - - if (withIn(MENU2MFY, py, MENU2MLY)) - doPAN(px/2); - - if (withIn(MENU2BFY, py, MENU2BLY)) - doVOLUME(px/2); - - if (withIn(MENU2TFY, py, MENU2TLY)) { - if (withIn(0, px, 41)) - doWD(0); - if (withIn(43, px, 84)) - doWD(1); - if (withIn(86, px, 128)) - doWD(2); - if (withIn(129, px, 169)) - doWD(3); - if (withIn(171, px, 212)) - doWD(4); - if (withIn(214, px, 255)) - doWD(5); - } - - } - - else if (cscreen == 2) { - if (withIn(45, py, 186)) - { - ra = py - 45; - inde = ra - 70; - if (withIn(MWHAMF, px, MWHAML)) - whammy = inde*4; - if (withIn(MPITCHF, px, MPITCHL)) - pitching = inde; - if (withIn(MVOLUMEF, px, MVOLUMEL)) - volbent = inde/10; - if (withIn(MPPF, px, MPPL)) { - - if (withIn(45, py, 65)) - ppeak = 0.1; - - if (withIn(66, py, 86)) - ppeak = 0.2; - - if (withIn(87, py, 107)) - ppeak = 0.3; - - if (withIn(108, py, 128)) - ppeak = 0.5; - - if (withIn(129, py, 149)) - ppeak = 1; - - if (withIn(150, py, 170)) - ppeak = 2; - - if (withIn(171, py, 186)) - ppeak = 4; - } - - - } - - } - - else if (cscreen == 4) { - if (withIn(33, py, 83)) { - if (withIn(2, px, 63)) - curkey = 0; - if (withIn(65, px, 126)) - curkey = 1; - if (withIn(128, px, 189)) - curkey = 2; - if (withIn(191, px, 252)) - curkey = 3; - } - - if (withIn(86, py, 136)) { - if (withIn(2, px, 63)) - curkey = 4; - if (withIn(65, px, 126)) - curkey = 5; - if (withIn(128, px, 189)) - curkey = 6; - if (withIn(191, px, 252)) - curkey = 7; - } - - if (withIn(140, py, 190)) { - if (withIn(2, px, 63)) - curkey = 8; - if (withIn(65, px, 126)) - curkey = 9; - if (withIn(128, px, 189)) - curkey = 10; - if (withIn(191, px, 252)) - curkey = 11; - } - chroot(); - makeNotes(); - doKeys(); - - } - - } - - + int ra; + int inde; + if (withIn(TOPMENUFY, py, TOPMENULY)) { + if (withIn(1, px, 49)) { + cscreen = 0; + setMenuUP(); + } + if (withIn(52, px, 101)) { + cscreen = 1; + setMenuUP(); + } + if (withIn(103, px, 152)) { + cscreen = 2; + setMenuUP(); + } + if (withIn(208, px, 255)) { + cscreen = 4; + setMenuUP(); + } + } + + if (cscreen == 0) { + if (withIn(MENU1TFY, py, MENU1TLY)) { + if (withIn(majorb.fx, px, majorb.lx)) + scale = 0; + if (withIn(minorb.fx, px, minorb.lx)) + scale = 1; + if (withIn(melminb.fx, px, melminb.lx)) + scale = 2; + if (withIn(phrygb.fx, px, phrygb.lx)) + scale = 3; + if (withIn(bluesb.fx, px, bluesb.lx)) + scale = 4; + doKeys(); + } + + if (withIn(MENU1BFY, py, MENU1BLY)) { + if (withIn(keyab.fx, px, keyab.lx)) + curkey = 0; + if (withIn(keyasb.fx, px, keyasb.lx)) + curkey = 1; + if (withIn(keybb.fx, px, keybb.lx)) + curkey = 2; + if (withIn(keycb.fx, px, keycb.lx)) + curkey = 3; + if (withIn(keycsb.fx, px, keycsb.lx)) + curkey = 4; + if (withIn(keydb.fx, px, keydb.lx)) + curkey = 5; + if (withIn(keydsb.fx, px, keydsb.lx)) + curkey = 6; + if (withIn(keyeb.fx, px, keyeb.lx)) + curkey = 7; + if (withIn(keyfb.fx, px, keyfb.lx)) + curkey = 8; + if (withIn(keyfsb.fx, px, keyfsb.lx)) + curkey = 9; + if (withIn(keygb.fx, px, keygb.lx)) + curkey = 10; + if (withIn(keygsb.fx, px, keygsb.lx)) + curkey = 11; + chrootnote(); + makeNotes(); + doKeys(); + } + } else if (cscreen == 1) { + + if (withIn(MENU2MFY, py, MENU2MLY)) + doPAN(px / 2); + + if (withIn(MENU2BFY, py, MENU2BLY)) + doVOLUME(px / 2); + + if (withIn(MENU2TFY, py, MENU2TLY)) { + if (withIn(0, px, 41)) + doWD(0); + if (withIn(43, px, 84)) + doWD(1); + if (withIn(86, px, 128)) + doWD(2); + if (withIn(129, px, 169)) + doWD(3); + if (withIn(171, px, 212)) + doWD(4); + if (withIn(214, px, 255)) + doWD(5); + } + + } + + else if (cscreen == 2) { + if (withIn(45, py, 186)) { + ra = py - 45; + inde = ra - 70; + if (withIn(MWHAMF, px, MWHAML)) + whammy = inde * 4; + if (withIn(MPITCHF, px, MPITCHL)) + pitching = inde; + if (withIn(MVOLUMEF, px, MVOLUMEL)) + volbent = inde / 10; + if (withIn(MPPF, px, MPPL)) { + + if (withIn(45, py, 65)) + ppeak = 0.1; + + if (withIn(66, py, 86)) + ppeak = 0.2; + + if (withIn(87, py, 107)) + ppeak = 0.3; + + if (withIn(108, py, 128)) + ppeak = 0.5; + + if (withIn(129, py, 149)) + ppeak = 1; + + if (withIn(150, py, 170)) + ppeak = 2; + + if (withIn(171, py, 186)) + ppeak = 4; + } + } + + } + + else if (cscreen == 4) { + if (withIn(33, py, 83)) { + if (withIn(2, px, 63)) + curkey = 0; + if (withIn(65, px, 126)) + curkey = 1; + if (withIn(128, px, 189)) + curkey = 2; + if (withIn(191, px, 252)) + curkey = 3; + } + + if (withIn(86, py, 136)) { + if (withIn(2, px, 63)) + curkey = 4; + if (withIn(65, px, 126)) + curkey = 5; + if (withIn(128, px, 189)) + curkey = 6; + if (withIn(191, px, 252)) + curkey = 7; + } + + if (withIn(140, py, 190)) { + if (withIn(2, px, 63)) + curkey = 8; + if (withIn(65, px, 126)) + curkey = 9; + if (withIn(128, px, 189)) + curkey = 10; + if (withIn(191, px, 252)) + curkey = 11; + } + chrootnote(); + makeNotes(); + doKeys(); + } +} /* octave was going HAYWIRE when it was controlled by held, * so this is a function for any buttons that can't * handle held. (Octave needed slow incrementation, one * per push. */ void keysDownOnly(int px, int py) { -switch (cscreen){ - case 0: - if (withIn(MENU1MFY, py, MENU1MLY)) { - if (withIn(octdb.fx, px, octdb.lx)) - octave--; - - if (withIn(octub.fx, px, octub.lx)) - if (octave < 7) - octave++; - - chroot(); - makeNotes(); - doKeys(); - break; - - } - -} - if (cscreen == 2) - { - if (withIn(208, px, 253)) { - if (withIn(46, py, 90)) - wOval = ! wOval; - if (withIn(92, py, 136)) - fTri = !fTri; - - } - } + switch (cscreen) { + case 0: + if (withIn(MENU1MFY, py, MENU1MLY)) { + if (withIn(octdb.fx, px, octdb.lx)) + octave--; + + if (withIn(octub.fx, px, octub.lx)) + if (octave < 7) + octave++; + + chrootnote(); + makeNotes(); + doKeys(); + break; + } + } + if (cscreen == 2) { + if (withIn(208, px, 253)) { + if (withIn(46, py, 90)) + wOval = !wOval; + if (withIn(92, py, 136)) + fTri = !fTri; + } + } } \ No newline at end of file diff --git a/arm9/source/menus.h b/arm9/source/menus.h index c679b3f..1b81efc 100644 --- a/arm9/source/menus.h +++ b/arm9/source/menus.h @@ -1,5 +1,5 @@ -/* Copyright 2009 Graeme Roberts :: - prettychips is free software: you can redistribute it and/or modify +/* Copyright 2009 Graeme Roberts :: + prettychips is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. @@ -41,7 +41,6 @@ #define MVPF 211 #define MVPL 249 - void makeMeSomeButtons(); void isWeHasButton(int px, int py); void keysDownOnly(int px, int py); diff --git a/include/vscode_fix.h b/include/vscode_fix.h new file mode 100644 index 0000000..56432de --- /dev/null +++ b/include/vscode_fix.h @@ -0,0 +1,14 @@ +/* +Used to get VS Code Intellisense working correctly for header definitions +protected by compiler-specific feature flags. + +from: https://github.com/cuibonobo/nds_vscode_template/blob/master/include/vscode_fix.h +*/ +#ifdef __GNUC__ +#define _ATTRIBUTE(attrs) __attribute__(attrs) +#else +#define _ATTRIBUTE(attrs) +#endif + +int iprintf(const char *, ...) + _ATTRIBUTE((__format__(__printf__, 1, 2))); \ No newline at end of file diff --git a/prettychips.arm9 b/prettychips.arm9 new file mode 100755 index 0000000..1bfe9cf Binary files /dev/null and b/prettychips.arm9 differ diff --git a/prettychips.nds b/prettychips.nds new file mode 100644 index 0000000..3a7499b Binary files /dev/null and b/prettychips.nds differ