/***************************************************************************** * Copyright (C) 2010 by ANNEHEIM Geoffrey * Contact: geoffrey.anneheim@gmail.com * * Original code by BoneSoft: * http://www.codeproject.com/KB/GDI-plus/FunWithGravity.aspx * * This program 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. * * RCSID $Id$ *****************************************************************************/ #include #include "utils.h" inline void clearScreen() { memset(SCREEN_BASE_ADDRESS, 0xFF, SCREEN_BYTES_SIZE); } void showSimpleDialogBox(const char* title, const char* msg) { char* buffTitle; char* buffMsg; char *language = "E\x00n\x00g\x00l\x00i\x00s\x00h\x00\x00"; buffTitle = (char*)malloc(0x200); buffMsg = (char*)malloc(0x800); ascii2utf16(buffTitle, title, 0x80); ascii2utf16(buffMsg, msg, 0x200); show_dialog_box2( buffTitle, buffMsg, (const char*)&language[0]); free(buffTitle); free(buffMsg); } int show3BtnDialogBox(const char* title, const char* msg) { char *buffTitle; char *buffMsg; char *buttons = "Y\x00e\x00s\x00\x00N\x00o\x00\x00"; // cancel is the third int ans; buffTitle = (char*)malloc(0x200); buffMsg = (char*)malloc(0x800); ascii2utf16(buffTitle, title, 0x80); ascii2utf16(buffMsg, msg, 0x200); ans = dialog_3btn( buffTitle, buffMsg, (const char*)&buttons[0], 0x13f1); free(buffTitle); free(buffMsg); return ans; }