rendered paste bodyextern "C" { #include "fxlib.h" #include "revolution.h"} //^ the libaries by casio must be externed, //they are the ones found in the library/bin/fx, and have a casio header#include <stdlib.h>#include <stdio.h>#include <string.h>// ^the libaries by hitachi don't need to be externed, // they are the ones found in the library/bin/sh, and have a hitachi headerunsigned int hs[2] = {0};FONTCHARACTER PathName[]={'\\','\\','f','l','s','0','\\','G','H','s','c','o','r','e','s',0}; // storage memoryint main();void draw_titlescreen();void draw_menu();void mainmenu();void draw_fretboard();void draw_multbox();void draw_fingering();void draw_countbox(int x1);void draw_multcount(int count);void draw_note(int xnote, int string);int rand_string();int rand_wait();void set_waitstring(int simul, int wait[], int string[]);void setdraw_xnote(int simul, int xnote[], int wait[], int string[]);bool check_hit(int string);//void do_mishit();void check_score(bool &bHit, int string);void transfer_notes(bool &bHit, int xnote[], int wait[], int string[]);float note_speed = 12.0;int score = 0;int streak = 0;int highscore = 0;int highstreak = 0;int multiplier = 1;int mult_count = 0;const int stringG = 11;const int stringD = 24;const int stringA = 37;const int stringE = 50;int (*prand_string) () = &rand_string; // gen rand #, determines a string for the noteint (*prand_wait) () = &rand_wait; // gen rand #, determines how many pixels until the next note appearsvoid draw_titlescreen(){ DISPGRAPH picture; GRAPHDATA picture_info;//Image File: ghlogo_converted-shrunk.bmp//Width: 84px Height: 64pxconst unsigned long ghtitle[] = { 0x00000000, 0x00000000, 0x00000000, 0x03000000, 0x00000000, 0x00000007, 0x80000000, 0x00000000, 0x00000FC0, 0x00000000, 0x00000000, 0x0FFFFFC0, 0x00000000, 0x0000000F, 0xFCFFC000, 0x00000000, 0x00000E00, 0x01C00FFF, 0xFF000000, 0x000E0003, 0xC00FFFFF, 0xFFF80000, 0x0E070780, 0x3C0007FF, 0xFE00000E, 0x0707E078, 0x000EE00F, 0x00000E0F, 0x07FFF000, 0x1E700380, 0x000E0F06, 0x3FFFC3F8, 0x38E38000, 0x0E0F061F, 0x9FC7F018, 0xF1C0001E, 0x0F071C3F, 0xC7E038F1, 0xC0001C0F, 0xFF1C60C7, 0xC638F1C0, 0x001C0FFF, 0x1C60C70E, 0x38F1C000, 0x380E031C, 0x71C70E38, 0xE1C0003C, 0x0F071C71, 0xC78E3807, 0xC0003C0F, 0x071C71C7, 0x8E380F80, 0x001E0F07, 0x1C71C78E, 0x380E0000, 0x0E0F071C, 0x71C78038, 0xC700000E, 0x0F071C71, 0xC78C38C7, 0x00000E0F, 0x071C71C7, 0x8E38E300, 0x000E0F07, 0x8C71C78E, 0x38E38000, 0x0E0F07C0, 0x71C78E38, 0xF380000E, 0x0707F071, 0xC78E3871, 0xC0000E00, 0x077E60C3, 0x0E3FF9C0, 0x000E0007, 0x0FE0FFFE, 0x3FFCE000, 0x0E070F81, 0xFFFFFE1F, 0xFC70000E, 0xFF8F81FF, 0x807FFF7E, 0x38000FFF, 0x8F83FFC0, 0x1FFC3F9E, 0x000FF31F, 0x87FFF00F, 0xE01FFF80, 0x0F873F87, 0x83F387C0, 0x07FFC00F, 0x073F8700, 0xF3C7C183, 0x80000E06, 0x77871873, 0xE3C1C380, 0x00000EEF, 0x873C73E3, 0xC3C38000, 0x000DCF87, 0x3E33E3C3, 0xC3800000, 0x1F8F873E, 0x33C7C3C3, 0x8000001F, 0x0F873E33, 0x8FC3C380, 0x00003E0F, 0x873C700F, 0x83C38000, 0x007C0F07, 0x38701F83, 0xC3800000, 0x7E000701, 0xF01F83C3, 0xC00000EE, 0x000703F1, 0x8FC3C1C0, 0x00000E00, 0x070FF1CF, 0xC3C3C000, 0x00061F87, 0x1FF1CFC3, 0xC3800000, 0x061F871F, 0x31C7C3C3, 0x80000006, 0x0F871831, 0xE7C3C380, 0x0000060F, 0x878031E3, 0xC3C38000, 0x00060F87, 0xC0F0F3C3, 0xC3800000, 0x060F87F3, 0xF0F1C183, 0x80000006, 0x0F87FFFF, 0xF9E18380, 0x0000060F, 0x87FFFFF8, 0xF8078000, 0x00060F03, 0xFF001C7C, 0x3F800000, 0x060F03FC, 0x001E3E7F, 0x00000006, 0x0FFFF000, 0x0F9FF800, 0x00000E07, 0xFFF00003, 0xFFE00000, 0x000E07F8, 0x000000FF, 0xC0000000, 0x1C0FC000, 0x00000700, 0x00000079, 0xFFC00000, 0x00000000, 0x0000FFFC, 0x00000000, 0x00000000, 0x01FF8000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }; //Image File: casiocalc2-bw.bmp//Width: 19px Height: 32pxconst unsigned char calc[] = { 0x7F, 0xFF, 0xC0, 0x80, 0x00, 0x20, 0x80, 0x00, 0x20, 0x9F, 0xFF, 0x20, 0xBF, 0xF0, 0xA0, 0xBF, 0xE0, 0xA0, 0xBF, 0xC0, 0xA0, 0xBF, 0x80, 0xA0, 0xBF, 0x00, 0xA0, 0xBE, 0x00, 0xA0, 0xBC, 0x00, 0xA0, 0x9F, 0xFF, 0x20, 0x80, 0x00, 0x20, 0x40, 0x00, 0x40, 0x40, 0x00, 0x40, 0x4D, 0x9C, 0x40, 0x40, 0x22, 0x40, 0x4D, 0x9C, 0x40, 0x40, 0x00, 0x40, 0x4D, 0xB6, 0x40, 0x40, 0x00, 0x40, 0x4D, 0xB6, 0x40, 0x40, 0x00, 0x40, 0x4D, 0xB6, 0x40, 0x40, 0x00, 0x40, 0x4D, 0xB6, 0x40, 0x40, 0x00, 0x40, 0x4D, 0xB6, 0x40, 0x40, 0x00, 0x40, 0x60, 0x00, 0xC0, 0x70, 0x01, 0xC0, 0x3F, 0xFF, 0x80 }; Bdisp_AllClr_DDVRAM(); picture_info.width = 84; picture_info.height = 64; picture_info.pBitmap = (unsigned char*)ghtitle; picture.x = 0; picture.y = 0; picture.GraphData = picture_info; picture.WriteModify = IMB_WRITEMODIFY_NORMAL; picture.WriteKind = IMB_WRITEKIND_OR; Bdisp_WriteGraph_VRAM(&picture); picture_info.width = 19; picture_info.height = 32; picture_info.pBitmap = (unsigned char*)calc; picture.x = 105; picture.y = 29; picture.GraphData = picture_info; picture.WriteModify = IMB_WRITEMODIFY_NORMAL; picture.WriteKind = IMB_WRITEKIND_OR; Bdisp_WriteGraph_VRAM(&picture); PrintMini(81,7,(unsigned char*)"Calculator", MINI_OVER); PrintMini(95,14,(unsigned char*)"Edition", MINI_OVER); PrintMini(107,23,(unsigned char*)"v0.9", MINI_OVER); PrintMini(3,59,(unsigned char*)"casiokingdom.org Prog Comp '08", MINI_OVER); Bdisp_PutDisp_DD(); int i = 0; for(;i < 10001;i++){}; int fade_counter; for (fade_counter = 167; fade_counter >= 130; fade_counter--) // Fading out {Change_Contrast(fade_counter); Sleep(40); // Delay }; Bdisp_AllClr_DDVRAM(); Change_Contrast(167);}void draw_menu(){ DISPGRAPH picture; GRAPHDATA picture_info;//Image File: bolt_menu-cropped.bmp//Width: 74px Height: 64pxconst unsigned char menu[] = { 0x0D, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x36, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77, 0x00, 0x1B, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x00, 0x0D, 0x8B, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x41, 0x00, 0x06, 0xCA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x7F, 0x00, 0x0D, 0x8A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x00, 0x1B, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x00, 0x36, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x00, 0x6C, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x00, 0xD8, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x00, 0x6C, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x00, 0x36, 0x0B, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x41, 0x00, 0x1B, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x00, 0x0D, 0x8B, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x41, 0x00, 0x06, 0xCA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x00, 0x0D, 0x8A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x00, 0x1B, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x00, 0x36, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x00, 0x6C, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x00, 0xD8, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x00, 0x6C, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x00, 0x36, 0x0B, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x41, 0x00, 0x1B, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x00, 0x0D, 0x8B, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x41, 0x00, 0x06, 0xCA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x00, 0x0D, 0x8A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x00, 0x1B, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x00, 0x36, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x00, 0x6C, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x00, 0xD8, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x00, 0x6C, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x00, 0x36, 0x0B, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x41, 0x00, 0x1B, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x00, 0x0D, 0x8B, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x41, 0x00, 0x06, 0xCA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x00, 0x0D, 0x8A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x00, 0x1B, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x00, 0x36, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x00, 0x6C, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x00, 0xD8, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x00, 0x6C, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x00, 0x36, 0x0B, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x41, 0x00, 0x1B, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x00, 0x0D, 0x8B, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x41, 0x00, 0x06, 0xCA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x00, 0x0D, 0x8A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x00, 0x1B, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x00, 0x36, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x00, 0x6C, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x00, 0xD8, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x00, 0x6C, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x7F, 0x00, 0x36, 0x0B, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x41, 0x00, 0x1B, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x00, 0x0D, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77, 0x00, 0x06, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0D, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; Bdisp_AllClr_DDVRAM(); picture_info.width = 74; picture_info.height = 64; picture_info.pBitmap = (unsigned char*)menu; picture.x = 54; picture.y = 0; picture.GraphData = picture_info; picture.WriteModify = IMB_WRITEMODIFY_NORMAL; picture.WriteKind = IMB_WRITEKIND_OR; Bdisp_WriteGraph_VRAM(&picture);}void draw_invert(int position){ int y1 = 8; switch(position) { case 1: y1 = 8; break; case 2: y1 = 18; break; case 3: y1 = 28; break; case 4: y1 = 38; break; case 5: y1 = 48; break; default: break; } Bdisp_AreaReverseVRAM(68,y1,117,y1+8); }void draw_credits(){ }void mainmenu(int &mode){ int position = 1; //only onscreen highlighting, value from 1 to 5 inclusive// int selection = 1; //which of the choices is actually highlighted, help with scrolling names unsigned int choice; draw_menu(); PrintMini(80,10,(unsigned char*)"Endless", MINI_OVER); PrintMini(84,20,(unsigned char*)"Timed", MINI_OVER); PrintMini(75,30,(unsigned char*)"Endurance", MINI_OVER); PrintMini(70,40,(unsigned char*)"DragonForce", MINI_OVER); PrintMini(81,50,(unsigned char*)"Credits", MINI_OVER); // for now, save the menu text to be restored. once the scrolling is implemented it will need to be variable SaveDisp(1); while(1) { RestoreDisp(1); draw_invert(position); // later, gonna have to add code for changing menu text, etc GetKey(&choice); switch(choice) { case KEY_CTRL_DOWN: if(++position > 5) position = 1; continue; case KEY_CTRL_UP: if(--position < 1) position = 5; continue; case KEY_CTRL_EXE: break; case KEY_CTRL_EXIT: break; }; if(choice == KEY_CTRL_EXE) break; if(choice == KEY_CTRL_EXIT) break; } mode = position;}void draw_fretboard(){int i = 0;int j = 0;int row = 11;int y1 = 0;int y2 = 6; // declare local variables PrintMini(17,3,(unsigned char*)"Guitar Hero: Calc Demo", MINI_OVER); PrintMini(31,16,(unsigned char*)"by Chris Wright", MINI_OVER); for(i=0;i<13;i++) // draw bridge with fret gaps { Bdisp_DrawLineVRAM(119,y1,119,y2); y1=y2+2,y2+=8; Bdisp_PutDisp_DD(); } for(j=0;j<4;j++) // draw strings with fret gaps { int x1 = 0; int x2 = 5; // set vars, reset upon each iteration for(i=0;i<17;i++) { Bdisp_DrawLineVRAM(x1,row,x2,row); x1=x2+2,x2+=7; Bdisp_PutDisp_DD(); Sleep(12.5); }; // sleep after each iteration to give the onscreen drawing effect row+=13; //move down to next row }}void draw_multbox(){ Bdisp_DrawLineVRAM(38-2,55,61-2,55); Bdisp_DrawLineVRAM(38-2,55,38-2,60+1); Bdisp_DrawLineVRAM(61-2,55,61-2,60+1); Bdisp_DrawLineVRAM(38-2,60+1,61-2,60+1);}void draw_fingering(){int string = 11;int j = 0; for(j=0;j<4;j++){ Bdisp_DrawLineVRAM(122,string+2,124,string+2); Bdisp_DrawLineVRAM(121,string+1,121,string-1); Bdisp_DrawLineVRAM(125,string+1,125,string-1); Bdisp_DrawLineVRAM(122,string-2,124,string-2); string += 13;}Bdisp_PutDisp_DD();}void draw_countbox(int x1){ Bdisp_DrawLineVRAM(x1,57,x1+1,57); Bdisp_DrawLineVRAM(x1,58,x1+1,58); Bdisp_DrawLineVRAM(x1,59,x1+1,59);}void draw_multcount(int count){ switch(count) { case 10: draw_countbox(56); case 9: draw_countbox(54); case 8: draw_countbox(52); case 7: draw_countbox(50); case 6: draw_countbox(48); case 5: draw_countbox(46); case 4: draw_countbox(44); case 3: draw_countbox(42); case 2: draw_countbox(40); case 1: draw_countbox(38); break; default: return; };}void draw_note(int xnote, int string){ Bdisp_DrawLineVRAM(xnote-1,string+2,xnote+1,string+2); Bdisp_DrawLineVRAM(xnote-2,string+1,xnote+2,string+1); Bdisp_DrawLineVRAM(xnote-2,string,xnote+2,string); Bdisp_DrawLineVRAM(xnote-2,string-1,xnote+2,string-1); Bdisp_DrawLineVRAM(xnote-1,string-2,xnote+1,string-2); } // draw note, all filled blackint rand_string(){int x = 0; static_cast<int>(x = 1+rand()*(4-1+1)/RAND_MAX); switch(x) { case 1: return stringG; break; case 2: return stringD; break; case 3: return stringA; break; case 4: return stringE; break; }return 0;}int rand_wait(){int x = 0;const int min_wait = 10;const int max_wait = 20; static_cast<int>(x = min_wait+rand()*(max_wait-min_wait+1)/RAND_MAX); return x;}void pauze(){ while(IsKeyDown(KEY_CTRL_F1)==0) { PopUpWin(2); locate(6,3); Print((unsigned char*)"GAME PAUSED"); PrintMini(29,27, (unsigned char*)"Hit F1 to continue", MINI_OVER); Bdisp_PutDisp_DD(); }}/*void LoadArray(){ int Handle = 0; Handle = Bfile_OpenFile(PathName, _OPENMODE_READ); if (Handle >= 0) { Bfile_ReadFile(Handle, &hs, sizeof(hs), 0); Bfile_CloseFile(Handle); };}*//*void SaveArray(){ int Handle = 0; Handle = Bfile_OpenFile(PathName, _OPENMODE_READWRITE); if(Handle < 0) { if(Bfile_CreateFile(PathName, sizeof(hs))==0) { Handle = Bfile_OpenFile(PathName, _OPENMODE_READWRITE); }; }; if(Handle >= 0) { Bfile_WriteFile(Handle, &hs, sizeof(hs)); Bfile_CloseFile(Handle); };}*/void set_waitstring(int simul, int wait[], int string[]){ int i = 0; for(i=0;i<simul;i++) { wait[i] = prand_wait(); string[i] = prand_string(); } }void setdraw_xnote(int simul, int xnote[], int wait[], int string[]){ int i = 0; draw_note(xnote[0], string[0]); // always draw xnote[0] for(i=1;i<simul;i++) { xnote[i] = xnote[i - 1] - wait[i - 1]; // set each successive note with the value of // the previous note, minus the wait time. if(xnote[i] >= 0) // if that value is 0 or larger, draw_note(xnote[i], string[i]); // draw that note. }}bool check_hit(int string){ if(string == stringG) {if((IsKeyDown(KEY_CTRL_ALPHA)) && (IsKeyUp(KEY_CHAR_FRAC)) && (IsKeyUp(KEY_CHAR_4)) && (IsKeyUp(KEY_CHAR_0))) return true; }; if(string == stringD) {if((IsKeyDown(KEY_CHAR_FRAC)) && (IsKeyUp(KEY_CTRL_ALPHA)) && (IsKeyUp(KEY_CHAR_4)) && (IsKeyUp(KEY_CHAR_0))) return true; }; if(string == stringA) {if((IsKeyDown(KEY_CHAR_4)) && (IsKeyUp(KEY_CHAR_FRAC)) && (IsKeyUp(KEY_CTRL_ALPHA)) && (IsKeyUp(KEY_CHAR_0))) return true; }; if(string == stringE) {if((IsKeyDown(KEY_CHAR_0)) && (IsKeyUp(KEY_CHAR_FRAC)) && (IsKeyUp(KEY_CHAR_4)) && (IsKeyUp(KEY_CTRL_ALPHA))) return true; }; return false;}/*void do_mishit(){ // if you hit any of the 4 notes before the note is at 115 if(score > highscore) highscore = score; // check highscores, and if(streak > highstreak) highstreak = streak; // set everything back to default score = 0; streak = 0; multiplier = 1; mult_count = 0;}*/void check_score(bool &bHit, int string){ bHit = check_hit(string); if(bHit == true) // later, include here a statement that if returned true, { streak++; // draw flashbang sprite score += multiplier*50; if(mult_count == 10) { if(multiplier < 4) { mult_count = 0; multiplier++; } } else mult_count++; }}void transfer_notes(bool &bHit, int simul, int xnote[], int wait[], int string[]){ int i = 0; if(bHit == false) { if(score > highscore) highscore = score; if(streak > highstreak) highstreak = streak; score = 0; streak = 0; multiplier = 1; mult_count = 0; } else bHit = false; for(i=0;i<simul;i++) // set each element of xnote[], { xnote[i] = xnote[i + 1];}; // to the value of the element after it xnote[simul-1] = 0; for(i=0;i<simul;i++) // do the same for wait[] array { wait[i] = wait[i + 1];}; wait[simul-1] = prand_wait(); for(i=0;i<simul;i++) // and the string[] array { string[i] = string[i + 1];}; string[simul-1] = prand_string(); } // here you can use c++, see belowint main() { // eventually, there will be a switch case here with the mode argument, // calling the appropriate functions, instead of this load of shit code below.Bdisp_AllClr_DDVRAM();draw_fretboard();draw_fingering();draw_multbox();PrintMini(2,56, (unsigned char*)"Mult:", MINI_OVER);PrintMini(66,56, (unsigned char*)"Score:", MINI_OVER);SaveDisp(1); // save display layout to restore laterBdisp_PutDisp_DD();char buffer[21] = {0};const int simul = 15; // maximum number of notes onscreen at any one timebool bHit = false;int xnote[simul] = {0}; // array storing each note's location along the x axis of the stringint wait[simul] = {0}; // array storing the distance between each successive noteint string[simul] = {0}; // array storing location of string the notes appear on set_waitstring(simul, wait, string); // initialize all elements with a random value to start with while(IsKeyDown(KEY_CTRL_EXIT)==0) { setdraw_xnote(simul, xnote, wait, string); // on each iteration, set each relative val for xnote, // and draw them if >= 0; if(IsKeyDown(KEY_CTRL_F1)) {// if(115 <= xnote[0])// do_mishit() ; // if you strum too early, set scores back to 0// else {if(bHit == false) check_score(bHit, string[0]); }; }; sprintf(buffer,"x%d",multiplier); PrintMini(26,56, (unsigned char*)buffer, MINI_OVER); sprintf(buffer,"%d",score); PrintMini(93,56, (unsigned char*)buffer, MINI_OVER); draw_multcount(mult_count); Bdisp_PutDisp_DD(); //outputs draw results to screen if(IsKeyDown(KEY_CTRL_SHIFT)){pauze();} RestoreDisp(1); //restore fretboard if(xnote[0]==129) // when xnote[0] is at 129, transfer_notes(bHit, simul, xnote, wait, string); else xnote[0]++; // else if xnote[0] is not at 129, increment xnote[0] Sleep(note_speed); // varies note speed }; if(score > highscore) highscore = score; if(streak > highstreak) highstreak = streak; Bdisp_AllClr_DDVRAM(); while((IsKeyUp(KEY_CTRL_EXE))) { PopUpWin(3); sprintf(buffer,"High Score: %d", highscore); locate(3,3); Print((unsigned char*)buffer); sprintf(buffer,"Note Streak: %d", highstreak); locate(3,4); Print((unsigned char*)buffer); Bdisp_PutDisp_DD(); } highscore = 0; highstreak = 0; score = 0; streak = 0; Bdisp_AllClr_DDVRAM(); return 0;}// the main function from casio needs to be externed, or won't run// do this or you won't be able to do neat c++ things in the addin_main function// solved by using it to start the int main() functionextern "C" { int AddIn_main(int isAppli, unsigned short OptionNum) { Bdisp_AllClr_DDVRAM(); srand(RTCReadSecond()); int mode = 1; draw_titlescreen(); mainmenu(mode); main(); return 0; }}//****************************************************************************#pragma section _BR_Sizeunsigned long BR_Size;#pragma section#pragma section _TOPint InitializeSystem(int isAppli, unsigned short OptionNum){ return INIT_ADDIN_APPLICATION(isAppli, OptionNum);}#pragma section