Ejemplo n.º 1
0
//This is a special version of a noop that prints to the console.
//Invented by joat.  Slick!
void ARM_dprintThumb() {
	if ((arm.r[0] == 0xC0DED00D) && (arm.r[1] == 0)) {
		u32 address = arm.r[2];
		u32 index = address >> 24;
		u32 offset = address & 0x00FFFFFF;
		if (offset >= gbaMem.memorySize[index]) {
			Console_print("Error:  Attempting to dprint from inaccessible region of memory.\n");
		} else {
			//Console_print("dprint: ");
			Console_print((char*)(gbaMem.u8Mem[index]+offset));
		}
	}
Ejemplo n.º 2
0
void welcome() {
    Console_print(
            "calc - A simple calculator based on stack.\n"
            "Copyright (C) 2014, Zhang Hai.\n"
            "Powered by zhclib.\n"
            "\n"
            "This program comes with ABSOLUTELY NO WARRANTY.\n"
            "This is free software, and you are welcome to redistribute it\n"
            "under GNU General Public License v3.0.\n"
            "\n"
            "Press <Enter> to evaluate an expression;\n"
            "Enter an empty line to quit.\n"
            "\n");
}
Ejemplo n.º 3
0
void Console_printf(console* cons,const char* fmt,...)
{
    char* buffer;
    va_list ap;

    va_start(ap, fmt);
    buffer = make_message_for_printf(fmt,ap);
    va_end(ap);

    if(buffer==NULL)
        return;

    Console_print(cons,buffer);

    free(buffer);
}