コード例 #1
0
        /// <summary>
        /// Sets the value whether to load RRB (AI path) files.
        /// </summary>
        /// <param name="value">The value whether to load RRB (AI path) files or not.</param>
        /// <returns>Returns whether the set was successful or not.</returns>
        private bool SetLoadRRB(bool value)
        {
            bool result = true;

            if (initialized)
            {
                if (value == true)
                {
                    result &= memoryManager.WriteBytes(LOAD_RRB_BASE, new byte[] { 0x75, 0x0C });     // JNE +332AD
                    result &= memoryManager.WriteBytes(LOAD_RRB_BASE + 4, new byte[] { 0x75, 0x08 }); // JNE +332AD
                    result &= memoryManager.WriteByte(LOAD_RRB_BASE + 0xC, 0x74);                     // JE
                }
                else
                {
                    result &= memoryManager.WriteBytes(LOAD_RRB_BASE, new byte[] { 0x90, 0x90 });     // NOP NOP
                    result &= memoryManager.WriteBytes(LOAD_RRB_BASE + 4, new byte[] { 0x90, 0x90 }); // NOP NOP
                    result &= memoryManager.WriteByte(LOAD_RRB_BASE + 0xC, 0xEB);                     // JMP
                }
            }

            return(result);
        }
コード例 #2
0
        public bool RemoveMenuButtons()
        {
            bool result = true;

            result &= MemoryManager.WriteByte(MAINMENU_BUTTONS_BASE + 0xB, 0x00);             // build
            result &= MemoryManager.WriteByte(MAINMENU_BUTTONS_BASE + 0xB + 1 * 0x14, 0x00);  // circuit
            result &= MemoryManager.WriteByte(MAINMENU_BUTTONS_BASE + 0xB + 2 * 0x14, 0x00);  // singlerace
            result &= MemoryManager.WriteByte(MAINMENU_BUTTONS_BASE + 0xB + 3 * 0x14, 0x55);  // versus (moving to location 55 (circuit))
            result &= MemoryManager.WriteByte(MAINMENU_BUTTONS_BASE + 0xB + 4 * 0x14, 0x00);  // timeattack
            result &= MemoryManager.WriteByte(MAINMENU_BUTTONS_BASE + 0xB + 5 * 0x14, 0x00);  // options
            //result &= writeByte(MAINMENU_BUTTONS_BASE + 0xB + 6*0x14, 0x00); // exit

            result &= MemoryManager.WriteByte(RACERSELECT_BUTTONS_BASE + 0x49, 0x00);                                // cancel racer selection

            result &= MemoryManager.WriteBytes(MAINMENU_BUTTONS_BASE + 0x98, new byte[] { 0x90, 0x90, 0x90, 0x90 }); // always disable versus

            result &= MemoryManager.WriteByte(MAINMENU_BUTTONS_BASE + 0x3D, 46);                                     // set versus button text to line 47 of menustrings.srf
            result &= MemoryManager.WriteBytes(GetMenuStringsAddress(46), MemoryManager.GetStringBytes("WAITING FOR SERVER TO START A RACE..."));

            return(result);
        }