void ds_global_breakpoint(char *where, int X) { char error[255]; char memused[100]; sprintf(memused,"U: %d / F: %d ", getMemUsed(), getMemFree()); sprintf(error,"<Breakpoint> \n %s \n %s",where,memused); // Prepare JSOB //PA_Reset3DSprites2Banks(); //PA_3DProcess(); ds_global_fillScreen(0,ds_global_getScreen1(),PA_RGB(0,0,16)); ds_global_fillScreen(1,ds_global_getScreen0(),PA_RGB(0,0,16)); // Fill JSOB PA_SmartText16bBuf_DS(ds_global_getScreen(0), 80, 48, // base 255 - 32, 191, // max " -- Breakpoint!!!\n /\n MMMM\n MMMMMM\n MMMMMMM\n MDMM===M\n MDM=X=X\n MDM====M\n MDMM===M\n MNNM-MM\n MNM-M\n MM--M", PA_RGB(31,31,31), 1, 1, 255); // Features PA_CenterSmartText16bBuf_DS(ds_global_getScreen(1), 0, 0, // base 255, 64, // max "KSDS Breakpoint",PA_RGB(31,31,31), 3, 1); // Features PA_CenterSmartText16bBuf_DS(ds_global_getScreen(1), 0, 0, // base 255, 191, // max error,PA_RGB(31,31,31), 2, 1); // Features if (X) { PA_CenterSmartText16bBuf_DS(ds_global_getScreen(1), 0, 191 - 32, // base 255, 191, // max "Please press X...",PA_RGB(31,31,31), 1, 1); // Features } else { PA_CenterSmartText16bBuf_DS(ds_global_getScreen(1), 0, 191 - 32, // base 255, 191, // max "Please press Y...",PA_RGB(31,31,31), 1, 1); // Features } // Show JSOB ds_global_paintScreen(1,ds_global_getScreen1(),0,0); ds_global_paintScreen(0,ds_global_getScreen0(),0,0); // Wait... PA_DisableSpecialFx(0); PA_DisableSpecialFx(1); if (X) { while (!Pad.Newpress.X) { PA_WaitForVBL(); } } else { while (!Pad.Newpress.Y) { PA_WaitForVBL(); } } }
size_t DS_UsedMem(void) { return getMemUsed(); }
void ds_global_errorHalt(char *where) { char error[255]; char memused[100]; sprintf(memused,"U: %d / F: %d ", getMemUsed(), getMemFree()); // Write Error String switch (ds_global_error) { case DS_C_ERR_: sprintf(error,"[E00] Unknown Error \n %s \n %s",where,memused); break; case DS_C_ERR_NOTILESET: sprintf(error,"[E01] Tileset not found \n %s \n %s",where,memused); break; case DS_C_ERR_NOMAPBIN: sprintf(error,"[E02] File Map.bin not found \n %s \n %s",where,memused); break; case DS_C_ERR_NOMEMORY: sprintf(error,"[E03] Not enough memory \n %s \n %s",where,memused); break; case DS_C_ERR_NOMOREOBJECTS: sprintf(error,"[E04] This room has too many objects \n %s \n %s",where,memused); break; case DS_C_ERR_NOWORLDINI: sprintf(error,"[E05] No World.ini \n %s \n %s",where,memused); break; case DS_C_ERR_NOSAVEINI: sprintf(error,"[E06] No Savegame.ini \n %s \n %s",where,memused); break; case DS_C_ERR_ZIPFAST: sprintf(error,"[E07] Incompatible Map.bin (idx)\n %s \n %s",where,memused); break; case DS_C_ERR_NOHDD: sprintf(error,"[E08] Not enough disk space \n %s \n %s",where,memused); break; case DS_C_ERR_NOFOUND: sprintf(error,"[E09] Not Found \n %s \n %s",where,memused); break; case DS_C_ERR_BIGIMA: sprintf(error,"[E10] Image too big\nSorry, you can't play this story\n%s \n %s",where,memused); break; } // Prepare JSOD PA_Reset3DSprites2Banks(); PA_3DProcess(); ds_global_fillScreen(1,ds_global_getScreen1(),PA_RGB(16,0,0)); ds_global_fillScreen(0,ds_global_getScreen0(),PA_RGB(16,0,0)); // Fill JSOD PA_SmartText16bBuf_DS(ds_global_getScreen(1), 80, 48, // base 255 - 32, 191, // max " -- Ouch! Sorry!!!\n /\n MMMM\n MMMMMM\n MMMMMMM\n MDMM===M\n MDM=X=X\n MDM====M\n MDMM===M\n MNNM-MM\n MNM-M\n MM--M", PA_RGB(31,31,31), 1, 1, 255); // Features PA_CenterSmartText16bBuf_DS(ds_global_getScreen(0), 0, 0, // base 255, 64, // max "KSDS Internal Error",PA_RGB(31,31,31), 3, 1); // Features PA_CenterSmartText16bBuf_DS(ds_global_getScreen(0), 0, 0, // base 255, 191, // max error,PA_RGB(31,31,31), 2, 1); // Features PA_CenterSmartText16bBuf_DS(ds_global_getScreen(0), 0, 191 - 32, // base 255, 191, // max "Please reboot your DS",PA_RGB(31,31,31), 1, 1); // Features // Show JSOD ds_global_paintScreen(1,ds_global_getScreen1(),0,0); ds_global_paintScreen(0,ds_global_getScreen0(),0,0); // End... PA_DisableSpecialFx(0); PA_DisableSpecialFx(1); while(1) { PA_WaitForVBL(); } }