Пример #1
3
//////////////////////////////////////////////////////////////////
// checkKeyboardMenu
//    Checks the keyboard for the menu options
//
//
// Returns:
//    void
//
void checkKeyboardMenu() {

    u8 *pvideo;


    delay(20);

    if (( cpct_isKeyPressed(Key_1)) || (((cpct_isKeyPressed(keys.fire) || (cpct_isKeyPressed(Joy0_Fire1)))  && (selectedOption == 0)))) {

        drawMarker();
        selectedOption = 0;
        drawMarker();

        waitKeyUp(Key_1);

        keys.up    = redefineKey("UP");
        keys.down  = redefineKey("DOWN");
        keys.left  = redefineKey("LEFT");
        keys.right = redefineKey("RIGHT");
        keys.fire  = redefineKey("FIRE");
        keys.pause = redefineKey("PAUSE");
        keys.abort = redefineKey("ABORT");
        //keys.music = redefineKey("MUSIC");

        pvideo = cpct_getScreenPtr(CPCT_VMEM_START, 8, 154);
        cpct_drawSolidBox(pvideo, #0, 64, FONT_H);

    }
Пример #2
0
void gamePluginEntry() {
	u32 ret, key;
	INIT_SHARED_FUNC(plgGetIoBase, 8);
	// wait for game starts up (5 seconds)
	svc_sleepThread(5000000000);

	if (((NS_CONFIG*)(NS_CONFIGURE_ADDR))->sharedFunc[8]) {
		isNewNtr = 1;
	} else {
		isNewNtr = 0;
	}
	
	if (isNewNtr) {
		IoBasePad = plgGetIoBase(IO_BASE_PAD);
	}
	while (1) {
		svc_sleepThread(100000000);
		
		key = getKey();
		if (key == BUTTON_R) {
      u16 *id = (u16*)0x16F4C460;
      char id_str[5] = {0};
      for (size_t i = 0; i < 4u; ++i)
      {
        id_str[i] = (char)READU16(id + i);
      }
      
      u16 result = (u16)strtoul(id_str, NULL, 16);
      WRITEU16(0x15FBEDD0, result);
			waitKeyUp();
		}

	}
}
void gamePluginEntry()
{
	u32 ret, key;
	u32 i = 0;
	INIT_SHARED_FUNC(plgGetIoBase, 8);
	INIT_SHARED_FUNC(copyRemoteMemory, 9);
	svc_sleepThread(5000000000);
	
	mode = 0;
	if (((NS_CONFIG*)(NS_CONFIGURE_ADDR))->sharedFunc[8])
	{
		isNewNtr = 1;
	} 
	else
	{
		isNewNtr = 0;
	}
	
	if (isNewNtr)
	{
		IoBasePad = plgGetIoBase(IO_BASE_PAD);
	}
	rtReleaseLock(&((NS_CONFIG*)(NS_CONFIGURE_ADDR))->debugBufferLock);
	plgGetSharedServiceHandle("fs:USER", &fsUserHandle);
	updateMenu();
	current_menu = BASE;
	init_menu();
	create_base_menu();
	show_menu(BASE);
	while (1)
	{
		key = getKey();
		if (key == BUTTON_ST + BUTTON_SE)
		{
			show_menu(BASE);
			waitKeyUp();
		}
		key_trigger(key);
		svc_sleepThread(10000000);
		scanCheatMenu();
		do_all_action();		
	}
}