private object ReadByType(int address, Type t) { if (t == typeof(int)) { return(PCSX2_RAM.ReadInteger(address)); } else if (t == typeof(short)) { return(PCSX2_RAM.ReadShort(address)); } else if (t == typeof(string)) { return(PCSX2_RAM.ReadString(address)); } else if (t == typeof(byte[])) { return(PCSX2_RAM.ReadBytes(address, 4)); } else if (t == typeof(uint)) { return(PCSX2_RAM.ReadUInteger(address)); } else { return(PCSX2_RAM.ReadBytes(address, 4)); } }
public static RoomInformation ReadRoomInforation() { RoomInformation r = new RoomInformation(); r.WorldNumber = PCSX2_RAM.ReadBytes(IngameConstants.WORLD_PTR, 1)[0]; r.RoomNumber = PCSX2_RAM.ReadShort(IngameConstants.ROOM_PTR); r.EventNumberMain = PCSX2_RAM.ReadShort(IngameConstants.EVENT1_PTR); return(r); }