Merge branch 'master' into unitxt
This commit is contained in:
		
						commit
						cf3a84c60d
					
				| @ -3,91 +3,6 @@ | |||||||
| // TODO: techniques to enum
 | // TODO: techniques to enum
 | ||||||
| use psopacket::PSOPacketData; | use psopacket::PSOPacketData; | ||||||
| use crate::{PSOPacketData, PacketParseError}; | use crate::{PSOPacketData, PacketParseError}; | ||||||
| //use crate::PSOPacketData;
 |  | ||||||
| 
 |  | ||||||
| pub const DEFAULT_PALETTE_CONFIG: [u8; 0xE8] = [ |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     1, 0, 0, 0, 
 |  | ||||||
|     2, 0, 1, 0, 
 |  | ||||||
|     2, 1, 1, 0, 
 |  | ||||||
|     4, 0, 1, 0, 
 |  | ||||||
|     0, 0, 1, 0, 
 |  | ||||||
|     0, 0, 1, 0, 
 |  | ||||||
|     0, 0, 1, 0, 
 |  | ||||||
|     0, 0, 1, 0, 
 |  | ||||||
|     0, 0, 1, 0, 
 |  | ||||||
|     0, 0, 1, 0, 
 |  | ||||||
|     0, 0, 1, 0, 
 |  | ||||||
|     0, 0, 1, 0, 
 |  | ||||||
|     0, 0, 1, 0, 
 |  | ||||||
|     0, 0, 1, 0, 
 |  | ||||||
|     1, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0, 
 |  | ||||||
|     0, 0, 0, 0 |  | ||||||
| ]; |  | ||||||
| 
 |  | ||||||
| pub const DEFAULT_TECH_MENU: [u8; 40] = [ |  | ||||||
|     0x00, 0x00, |  | ||||||
|     0x06, 0x00, |  | ||||||
|     0x03, 0x00, |  | ||||||
|     0x01, 0x00, |  | ||||||
|     0x07, 0x00, |  | ||||||
|     0x04, 0x00, |  | ||||||
|     0x02, 0x00, |  | ||||||
|     0x08, 0x00, |  | ||||||
|     0x05, 0x00, |  | ||||||
|     0x09, 0x00, |  | ||||||
|     0x12, 0x00, |  | ||||||
|     0x0f, 0x00, |  | ||||||
|     0x10, 0x00, |  | ||||||
|     0x11, 0x00, |  | ||||||
|     0x0d, 0x00, |  | ||||||
|     0x0a, 0x00, |  | ||||||
|     0x0b, 0x00, |  | ||||||
|     0x0c, 0x00, |  | ||||||
|     0x0e, 0x00, |  | ||||||
|     0x00, 0x00, |  | ||||||
| ]; |  | ||||||
| 
 | 
 | ||||||
| #[repr(u32)] | #[repr(u32)] | ||||||
| #[derive(Copy, Clone, Hash, PartialEq, Eq)] | #[derive(Copy, Clone, Hash, PartialEq, Eq)] | ||||||
| @ -357,8 +272,8 @@ impl std::default::Default for Bank { | |||||||
| #[derive(PSOPacketData, Copy, Clone)] | #[derive(PSOPacketData, Copy, Clone)] | ||||||
| pub struct KeyTeamConfig { | pub struct KeyTeamConfig { | ||||||
|     pub _unknown: [u8; 0x114], |     pub _unknown: [u8; 0x114], | ||||||
|     pub key_config: [u8; 0x16C], |     pub keyboard_config: [u8; 0x16C], | ||||||
|     pub joystick_config: [u8; 0x38], |     pub gamepad_config: [u8; 0x38], | ||||||
|     pub guildcard: u32, |     pub guildcard: u32, | ||||||
|     pub team_id: u32, |     pub team_id: u32, | ||||||
|     pub team_info: [u32; 2], |     pub team_info: [u32; 2], | ||||||
| @ -438,8 +353,8 @@ pub struct DBChar { | |||||||
| #[derive(PSOPacketData, Copy, Clone)] | #[derive(PSOPacketData, Copy, Clone)] | ||||||
| pub struct DBOpts { | pub struct DBOpts { | ||||||
|     pub blocked: [u32; 30], |     pub blocked: [u32; 30], | ||||||
|     pub key_config: [u8; 0x16C], |     pub keyboard_config: [u8; 0x16C], | ||||||
|     pub joystick_config: [u8; 0x38], |     pub gamepad_config: [u8; 0x38], | ||||||
|     pub option_flags: u32, |     pub option_flags: u32, | ||||||
|     pub shortcuts: [u8; 0xA40], |     pub shortcuts: [u8; 0xA40], | ||||||
|     pub symbol_chats:  [u8; 0x4E0], |     pub symbol_chats:  [u8; 0x4E0], | ||||||
|  | |||||||
| @ -1,53 +1,22 @@ | |||||||
|  | use crate::packet::ship::{GuildcardAccept}; | ||||||
| 
 | 
 | ||||||
| 
 | #[derive(Copy, Clone, Debug)] | ||||||
| /* | #[repr(C)] | ||||||
| typedef struct bb_guildcard_data { | pub struct BlockedGuildCard {   // 264
 | ||||||
|     uint8_t unk1[0x0114]; |     pub id: u32,                // 4
 | ||||||
|     struct { |     pub name: [u16; 0x18],      // 48
 | ||||||
|         uint32_t guildcard; |     pub team: [u16; 0x10],      // 32
 | ||||||
|         uint16_t name[0x18]; |     pub desc: [u16; 0x58],      // 176
 | ||||||
|         uint16_t team[0x10]; |     pub reserved1: u8,          // 1
 | ||||||
|         uint16_t desc[0x58]; |     pub language: u8,           // 1
 | ||||||
|         uint8_t reserved1; |     pub section_id: u8,         // 1
 | ||||||
|         uint8_t language; |     pub class: u8,              // 1
 | ||||||
|         uint8_t section; |  | ||||||
|         uint8_t ch_class; |  | ||||||
|     } blocked[29]; |  | ||||||
|     uint8_t unk2[0x78]; |  | ||||||
|     struct { |  | ||||||
|         uint32_t guildcard; |  | ||||||
|         uint16_t name[0x18]; |  | ||||||
|         uint16_t team[0x10]; |  | ||||||
|         uint16_t desc[0x58]; |  | ||||||
|         uint8_t reserved1; |  | ||||||
|         uint8_t language; |  | ||||||
|         uint8_t section; |  | ||||||
|         uint8_t ch_class; |  | ||||||
|         uint32_t padding; |  | ||||||
|         uint16_t comment[0x58]; |  | ||||||
|     } entries[104]; |  | ||||||
|     uint8_t unk3[0x01BC]; |  | ||||||
| } bb_gc_data_t; |  | ||||||
|  */ |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| #[derive(Copy, Clone)] |  | ||||||
| pub struct BlockedGuildCard { |  | ||||||
|     pub guildcard: u32, |  | ||||||
|     pub name: [u16; 0x18], |  | ||||||
|     pub team: [u16; 0x10], |  | ||||||
|     pub desc: [u16; 0x58], |  | ||||||
|     pub reserved1: u8, |  | ||||||
|     pub language: u8, |  | ||||||
|     pub section_id: u8, |  | ||||||
|     pub class: u8, |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| impl Default for BlockedGuildCard { | impl Default for BlockedGuildCard { | ||||||
|     fn default() -> BlockedGuildCard { |     fn default() -> BlockedGuildCard { | ||||||
|         BlockedGuildCard { |         BlockedGuildCard { | ||||||
|             guildcard: 0, |             id: 0, | ||||||
|             name: [0; 0x18], |             name: [0; 0x18], | ||||||
|             team: [0; 0x10], |             team: [0; 0x10], | ||||||
|             desc: [0; 0x58], |             desc: [0; 0x58], | ||||||
| @ -59,25 +28,41 @@ impl Default for BlockedGuildCard { | |||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| #[derive(Copy, Clone)] | impl From<GuildCard> for BlockedGuildCard { | ||||||
| pub struct GuildCard { |     fn from(g: GuildCard) -> BlockedGuildCard { | ||||||
|     pub guildcard: u32, |         BlockedGuildCard { | ||||||
|     pub name: [u16; 0x18], |             id: g.id, | ||||||
|     pub team: [u16; 0x10], |             name: g.name, | ||||||
|     pub desc: [u16; 0x58], |             team: g.team, | ||||||
|     pub reserved1: u8, |             desc: g.desc, | ||||||
|     pub language: u8, |             reserved1: g.reserved1, | ||||||
|     pub section_id: u8, |             language: g.language, | ||||||
|     pub class: u8, |             section_id: g.section_id, | ||||||
|     pub padding: u32, |             class: g.class, | ||||||
|     pub comment: [u16; 0x58], |         } | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | #[derive(Copy, Clone, Debug)] | ||||||
|  | #[repr(C)] | ||||||
|  | pub struct GuildCard {          // 444
 | ||||||
|  |     pub id: u32,                // 4
 | ||||||
|  |     pub name: [u16; 0x18],      // 48
 | ||||||
|  |     pub team: [u16; 0x10],      // 32
 | ||||||
|  |     pub desc: [u16; 0x58],      // 176
 | ||||||
|  |     pub reserved1: u8,          // 1
 | ||||||
|  |     pub language: u8,           // 1
 | ||||||
|  |     pub section_id: u8,         // 1
 | ||||||
|  |     pub class: u8,              // 1
 | ||||||
|  |     pub padding: u32,           // 4
 | ||||||
|  |     pub comment: [u16; 0x58],   // 176
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| impl Default for GuildCard { | impl Default for GuildCard { | ||||||
|     fn default() -> GuildCard { |     fn default() -> GuildCard { | ||||||
|         GuildCard { |         GuildCard { | ||||||
|             guildcard: 0, |             id: 0, | ||||||
|             name: [0; 0x18], |             name: [0; 0x18], | ||||||
|             team: [0; 0x10], |             team: [0; 0x10], | ||||||
|             desc: [0; 0x58], |             desc: [0; 0x58], | ||||||
| @ -91,13 +76,30 @@ impl Default for GuildCard { | |||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| #[derive(Copy, Clone)] | impl From<&GuildcardAccept> for GuildCard { | ||||||
| pub struct GuildCardData { |     fn from(g: &GuildcardAccept) -> GuildCard { | ||||||
|     pub _unknown1: [u8; 0x114], |         GuildCard { | ||||||
|     pub blocked: [BlockedGuildCard; 29], |             id: g.id, | ||||||
|     pub _unknown2: [u8; 0x78], |             name: g.name, | ||||||
|     pub friends: [GuildCard; 104], |             team: g.team, | ||||||
|     pub _unknown3: [u8; 0x1BC], |             desc: g.desc, | ||||||
|  |             reserved1: g.one, | ||||||
|  |             language: g.language, | ||||||
|  |             section_id: g.section_id, | ||||||
|  |             class: g.class, | ||||||
|  |             padding: 0, | ||||||
|  |             comment: [0; 0x58], | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | #[derive(Copy, Clone, Debug)] | ||||||
|  | #[repr(C)] | ||||||
|  | pub struct GuildCardData {                  // 54672 0xd590
 | ||||||
|  |     pub _unknown1: [u8; 0x114],             // 276
 | ||||||
|  |     pub blocked: [BlockedGuildCard; 29],    // 264 * 29 = 7656
 | ||||||
|  |     pub _unknown2: [u8; 0x78],              // 120
 | ||||||
|  |     pub friends: [GuildCard; 105],          // 444 * 105 = 46620
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| impl Default for GuildCardData { | impl Default for GuildCardData { | ||||||
| @ -106,8 +108,7 @@ impl Default for GuildCardData { | |||||||
|             _unknown1: [0; 0x114], |             _unknown1: [0; 0x114], | ||||||
|             blocked: [BlockedGuildCard::default(); 29], |             blocked: [BlockedGuildCard::default(); 29], | ||||||
|             _unknown2: [0; 0x78], |             _unknown2: [0; 0x78], | ||||||
|             friends: [GuildCard::default(); 104], |             friends: [GuildCard::default(); 105], | ||||||
|             _unknown3: [0; 0x1BC], |  | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  | |||||||
| @ -1,6 +1,6 @@ | |||||||
| // TODO: deblobify all of this
 | // TODO: deblobify all of this
 | ||||||
| 
 | 
 | ||||||
| const DEFAULT_KEY_CONFIG: [u8; 0x16C] = [ | pub const DEFAULT_KEYBOARD_CONFIG1: [u8; 0x16C] = [ | ||||||
|     0x00, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, |     0x00, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|     0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |     0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|     0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, |     0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, | ||||||
| @ -39,7 +39,128 @@ const DEFAULT_KEY_CONFIG: [u8; 0x16C] = [ | |||||||
|     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, |     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, | ||||||
|     0x01, 0x00, 0x00, 0x00 |     0x01, 0x00, 0x00, 0x00 | ||||||
| ]; | ]; | ||||||
| const DEFAULT_JOYSTICK_CONFIG: [u8; 0x38] = [ | 
 | ||||||
|  | pub const DEFAULT_KEYBOARD_CONFIG2: [u8; 364] = [ | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2d, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, | ||||||
|  |     0x01, 0x00, 0x00, 0x00 | ||||||
|  | ]; | ||||||
|  | 
 | ||||||
|  | pub const DEFAULT_KEYBOARD_CONFIG3: [u8; 364] = [ | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2d, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, | ||||||
|  |     0x01, 0x00, 0x00, 0x00 | ||||||
|  | ]; | ||||||
|  | 
 | ||||||
|  | pub const DEFAULT_KEYBOARD_CONFIG4: [u8; 364] = [ | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2d, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||||
|  |     0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, | ||||||
|  |     0x01, 0x00, 0x00, 0x00 | ||||||
|  | ]; | ||||||
|  | 
 | ||||||
|  | pub const DEFAULT_GAMEPAD_CONFIG: [u8; 0x38] = [ | ||||||
|     0x00, 0x01, 0xff, 0xff, 0x00, 0x00, |     0x00, 0x01, 0xff, 0xff, 0x00, 0x00, | ||||||
|     0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, |     0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, | ||||||
|     0x00, 0x00, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, |     0x00, 0x00, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, | ||||||
| @ -176,12 +297,96 @@ const DEFAULT_SYMBOLCHATS: [u8; 0x4E0] = [ | |||||||
|     0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00 |     0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00 | ||||||
| ]; | ]; | ||||||
| 
 | 
 | ||||||
|  | pub const DEFAULT_PALETTE_CONFIG: [u8; 0xE8] = [ | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x01, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x02, 0x00, 0x01, 0x00, 
 | ||||||
|  |     0x02, 0x01, 0x01, 0x00, 
 | ||||||
|  |     0x04, 0x00, 0x01, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x01, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x01, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x01, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x01, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x01, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x01, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x01, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x01, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x01, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x01, 0x00, 
 | ||||||
|  |     0x01, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00, 
 | ||||||
|  |     0x00, 0x00, 0x00, 0x00 | ||||||
|  | ]; | ||||||
|  | 
 | ||||||
|  | pub const DEFAULT_TECH_MENU: [u8; 40] = [ | ||||||
|  |     0x00, 0x00, | ||||||
|  |     0x06, 0x00, | ||||||
|  |     0x03, 0x00, | ||||||
|  |     0x01, 0x00, | ||||||
|  |     0x07, 0x00, | ||||||
|  |     0x04, 0x00, | ||||||
|  |     0x02, 0x00, | ||||||
|  |     0x08, 0x00, | ||||||
|  |     0x05, 0x00, | ||||||
|  |     0x09, 0x00, | ||||||
|  |     0x12, 0x00, | ||||||
|  |     0x0f, 0x00, | ||||||
|  |     0x10, 0x00, | ||||||
|  |     0x11, 0x00, | ||||||
|  |     0x0d, 0x00, | ||||||
|  |     0x0a, 0x00, | ||||||
|  |     0x0b, 0x00, | ||||||
|  |     0x0c, 0x00, | ||||||
|  |     0x0e, 0x00, | ||||||
|  |     0x00, 0x00, | ||||||
|  | ]; | ||||||
|  | 
 | ||||||
| #[derive(Copy, Clone)] | #[derive(Copy, Clone)] | ||||||
| #[repr(C)] | #[repr(C)] | ||||||
| pub struct UserSettings { | pub struct UserSettings { | ||||||
|     pub blocked_users: [u32; 0x1E], |     pub blocked_users: [u32; 0x1E], | ||||||
|     pub key_config: [u8; 0x16C], |     pub keyboard_config: [u8; 0x16C], | ||||||
|     pub joystick_config: [u8; 0x38], |     pub gamepad_config: [u8; 0x38], | ||||||
|     pub option_flags: u32, |     pub option_flags: u32, | ||||||
|     pub shortcuts: [u8; 0xA40], |     pub shortcuts: [u8; 0xA40], | ||||||
|     pub symbol_chats: [u8; 0x4E0], |     pub symbol_chats: [u8; 0x4E0], | ||||||
| @ -193,8 +398,8 @@ impl Default for UserSettings { | |||||||
|     fn default() -> UserSettings { |     fn default() -> UserSettings { | ||||||
|         UserSettings { |         UserSettings { | ||||||
|             blocked_users: [0; 0x1E], |             blocked_users: [0; 0x1E], | ||||||
|             key_config: DEFAULT_KEY_CONFIG, |             keyboard_config: DEFAULT_KEYBOARD_CONFIG1, | ||||||
|             joystick_config: DEFAULT_JOYSTICK_CONFIG, |             gamepad_config: DEFAULT_GAMEPAD_CONFIG, | ||||||
|             option_flags: 0, |             option_flags: 0, | ||||||
|             shortcuts: [0; 0xA40], |             shortcuts: [0; 0xA40], | ||||||
|             symbol_chats: DEFAULT_SYMBOLCHATS, |             symbol_chats: DEFAULT_SYMBOLCHATS, | ||||||
|  | |||||||
| @ -209,8 +209,8 @@ pub struct RequestSettings { | |||||||
| #[pso_packet(0xE2)] | #[pso_packet(0xE2)] | ||||||
| pub struct SendKeyAndTeamSettings { | pub struct SendKeyAndTeamSettings { | ||||||
|     unknown: [u8; 0x114], |     unknown: [u8; 0x114], | ||||||
|     key_config: [u8; 0x16C], |     keyboard_config: [u8; 0x16C], | ||||||
|     joystick_config: [u8; 0x38], |     gamepad_config: [u8; 0x38], | ||||||
|     guildcard: u32, |     guildcard: u32, | ||||||
|     team_id: u32, |     team_id: u32, | ||||||
|     //team_info: [u32; 2],
 |     //team_info: [u32; 2],
 | ||||||
| @ -225,11 +225,11 @@ pub struct SendKeyAndTeamSettings { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| impl SendKeyAndTeamSettings { | impl SendKeyAndTeamSettings { | ||||||
|     pub fn new(key_config: [u8; 0x16C], joystick_config: [u8; 0x38], guildcard: u32, team_id: u32) -> SendKeyAndTeamSettings { |     pub fn new(keyboard_config: [u8; 0x16C], gamepad_config: [u8; 0x38], guildcard: u32, team_id: u32) -> SendKeyAndTeamSettings { | ||||||
|         SendKeyAndTeamSettings { |         SendKeyAndTeamSettings { | ||||||
|             unknown: [0; 0x114], |             unknown: [0; 0x114], | ||||||
|             key_config: key_config, |             keyboard_config: keyboard_config, | ||||||
|             joystick_config: joystick_config, |             gamepad_config: gamepad_config, | ||||||
|             guildcard: guildcard, |             guildcard: guildcard, | ||||||
|             team_id: team_id, |             team_id: team_id, | ||||||
|             //team_info: [0; 2],
 |             //team_info: [0; 2],
 | ||||||
| @ -385,9 +385,9 @@ impl std::fmt::Debug for GuildcardDataChunk { | |||||||
|     fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { |     fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { | ||||||
|         write!(f, "packet GuildcardDataChunk {{\n").unwrap(); |         write!(f, "packet GuildcardDataChunk {{\n").unwrap(); | ||||||
|         write!(f, "    flag: {:?}\n", 0).unwrap(); |         write!(f, "    flag: {:?}\n", 0).unwrap(); | ||||||
|         write!(f, "    _unknown: {:X?}\n", self._unknown).unwrap(); |         write!(f, "    _unknown: {:#X?}\n", self._unknown).unwrap(); | ||||||
|         write!(f, "    chunk: {:X?}\n", self.chunk).unwrap(); |         write!(f, "    chunk: {:#X?}\n", self.chunk).unwrap(); | ||||||
|         write!(f, "    buffer: [0..{:X}]\n", self.len).unwrap(); |         write!(f, "    buffer: [0..{:#X}]\n", self.len).unwrap(); | ||||||
|         write!(f, "}}") |         write!(f, "}}") | ||||||
|     } |     } | ||||||
| } | } | ||||||
| @ -549,17 +549,17 @@ mod tests { | |||||||
| 
 | 
 | ||||||
|         let mut rng = rand::thread_rng(); |         let mut rng = rand::thread_rng(); | ||||||
| 
 | 
 | ||||||
|         let mut key_config = [0u8; 0x16C]; |         let mut keyboard_config = [0u8; 0x16C]; | ||||||
|         let mut joystick_config = [0u8; 0x38]; |         let mut gamepad_config = [0u8; 0x38]; | ||||||
| 
 | 
 | ||||||
|         rng.fill(&mut key_config[..]); |         rng.fill(&mut keyboard_config[..]); | ||||||
|         rng.fill(&mut joystick_config[..]); |         rng.fill(&mut gamepad_config[..]); | ||||||
|         let pkt = super::SendKeyAndTeamSettings::new(key_config, joystick_config, 123, 456); |         let pkt = super::SendKeyAndTeamSettings::new(keyboard_config, gamepad_config, 123, 456); | ||||||
|         let bytes = pkt.as_bytes(); |         let bytes = pkt.as_bytes(); | ||||||
| 
 | 
 | ||||||
|         assert!(bytes[2] == 0xe2); |         assert!(bytes[2] == 0xe2); | ||||||
|         assert!(bytes[8 + 0x114] == key_config[0]); |         assert!(bytes[8 + 0x114] == keyboard_config[0]); | ||||||
|         assert!(bytes[8 + 0x114 + 0x16C] == joystick_config[0]); |         assert!(bytes[8 + 0x114 + 0x16C] == gamepad_config[0]); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     #[test] |     #[test] | ||||||
|  | |||||||
| @ -635,3 +635,26 @@ impl std::default::Default for TradeSuccessful { | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | #[pso_packet(0x4ED)] | ||||||
|  | pub struct KeyboardConfig { | ||||||
|  |     pub keyboard_config: [u8; 364], | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | #[pso_packet(0x5ED)] | ||||||
|  | pub struct GamepadConfig { | ||||||
|  |     pub gamepad_config: [u8; 56], | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | // same struct as libpso::packet::messages::GuildcardRecv
 | ||||||
|  | #[pso_packet(0x4E8)] | ||||||
|  | pub struct GuildcardAccept { | ||||||
|  |     id: u32, | ||||||
|  |     name: [u16; 0x18], | ||||||
|  |     team: [u16; 0x10], | ||||||
|  |     desc: [u16; 0x58], | ||||||
|  |     one: u8, | ||||||
|  |     language: u8, | ||||||
|  |     section_id: u8, | ||||||
|  |     class: u8, | ||||||
|  | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user