Compare commits
123 Commits
agent/w092
...
agent/w092
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cdfa42f57b | ||
|
|
8f546b4127 | ||
|
|
47e2fca14d | ||
|
|
a7959ad5c6 | ||
|
|
a01b3eb034 | ||
|
|
59310eec2e | ||
|
|
5063340c0a | ||
|
|
5f700048d0 | ||
|
|
69575ef7b0 | ||
|
|
bce8e09407 | ||
|
|
c0ea9c8b5e | ||
|
|
da09f7459b | ||
|
|
668abf4b8f | ||
|
|
2ca72f20f7 | ||
|
|
0ba7888699 | ||
|
|
190b11df6b | ||
|
|
b946e40dda | ||
|
|
9f10bd3f0f | ||
|
|
e21d4626ea | ||
|
|
ca8fe833e4 | ||
|
|
243e914ab0 | ||
|
|
3611c932a1 | ||
|
|
c687c940fa | ||
|
|
aa05001ce6 | ||
|
|
96b8b71a6d | ||
|
|
cc5048eca1 | ||
|
|
0933fb4dab | ||
|
|
7050f7033e | ||
|
|
e4632c60d2 | ||
|
|
5877d598d9 | ||
|
|
4c2a6ef4e1 | ||
|
|
ff7155ea15 | ||
|
|
a1ad43a516 | ||
|
|
b484456d2b | ||
|
|
61032b94a8 | ||
|
|
679b249d0e | ||
|
|
9f68f59195 | ||
|
|
a496d77426 | ||
|
|
6754dcef5c | ||
|
|
5da9e5abdb | ||
|
|
5eebf39964 | ||
|
|
eb50f578f5 | ||
|
|
7c7b0569bf | ||
|
|
79a654a64b | ||
|
|
2e8d3579df | ||
|
|
4b035b954b | ||
|
|
eac956b1b6 | ||
|
|
332f58508f | ||
|
|
52576c6bc6 | ||
|
|
8e5787f568 | ||
|
|
3e5411f37d | ||
|
|
600048402a | ||
|
|
67ba5e3663 | ||
|
|
3f2af2a919 | ||
|
|
f57e48be09 | ||
|
|
728624da2a | ||
|
|
6deff4fdc0 | ||
|
|
a87c7b1ca1 | ||
|
|
d506be5a50 | ||
|
|
4f449d73be | ||
|
|
7f215a6261 | ||
|
|
43f2bc33d8 | ||
|
|
9bf797ecc7 | ||
|
|
9b3c98122d | ||
|
|
ed0a012a22 | ||
|
|
b00e235438 | ||
|
|
f99704f4d0 | ||
|
|
056ece032e | ||
|
|
be8eeb9d70 | ||
|
|
508f449ccc | ||
|
|
9ded6e6496 | ||
|
|
3e3bf3422e | ||
|
|
22e7459a57 | ||
|
|
20bffa1ec2 | ||
|
|
861a326a67 | ||
|
|
b20a59205a | ||
|
|
7dff4b031b | ||
|
|
9f06a5bb96 | ||
|
|
467cc7835f | ||
|
|
847a3f3e7d | ||
|
|
173e87526a | ||
|
|
93a4f33eb1 | ||
|
|
cd13dd9c59 | ||
|
|
28f7d5f62a | ||
|
|
51cc6bdba3 | ||
|
|
59a683f651 | ||
|
|
5b3bd9524e | ||
|
|
3a5249d356 | ||
|
|
af48f0a19f | ||
|
|
dd74a9d314 | ||
|
|
e265d9664e | ||
|
|
a620eec6a4 | ||
|
|
5cdca2e8aa | ||
|
|
3b286167ba | ||
|
|
882a83064e | ||
|
|
d9237cdbd3 | ||
|
|
a6ac8d34d0 | ||
|
|
58b5333a4e | ||
|
|
64f977ea3b | ||
|
|
daf758ece1 | ||
|
|
6cdbe274bd | ||
|
|
2e63974b0c | ||
|
|
1c419b67a1 | ||
|
|
07459f685a | ||
|
|
3b93fc8664 | ||
|
|
7f627435b5 | ||
|
|
74f1719bfd | ||
|
|
506535db40 | ||
|
|
2a4e4f85ed | ||
|
|
4402bd99a8 | ||
|
|
44f42d98ed | ||
|
|
db27a09ea3 | ||
|
|
c21dcc3d31 | ||
|
|
ac51d83fa5 | ||
|
|
6490b90f65 | ||
|
|
823ee31937 | ||
|
|
51f940c1ea | ||
|
|
8e254f1c88 | ||
|
|
313e396989 | ||
|
|
f98e550b24 | ||
|
|
7f8b4c8a4f | ||
|
|
6806dc1926 | ||
|
|
f0f1462ff4 |
@@ -4580,9 +4580,9 @@ handleNandTitleUsage__Q33ipl5scene15SDChannelSelectFv = .text:0x813DBD94; // typ
|
||||
compareTitleUsage__Q33ipl5scene15SDChannelSelectFPCvPCv = .text:0x813DBE6C; // type:function size:0x28
|
||||
handleSDTitleList__Q33ipl5scene15SDChannelSelectFv = .text:0x813DBE94; // type:function size:0x124
|
||||
compareTitleInfo__Q33ipl5scene15SDChannelSelectFPCvPCv = .text:0x813DBFB8; // type:function size:0x28
|
||||
iplSDChannelSelect_813DBFE0 = .text:0x813DBFE0; // type:function size:0x2AC
|
||||
handleSDTitleListResult__Q33ipl5scene15SDChannelSelectFv = .text:0x813DBFE0; // type:function size:0x2AC
|
||||
handleSDMountComplete__Q33ipl5scene15SDChannelSelectFv = .text:0x813DC28C; // type:function size:0x64
|
||||
iplSDChannelSelect_813DC2F0 = .text:0x813DC2F0; // type:function size:0x1B0
|
||||
handleSDChannelUpdateComplete__Q33ipl5scene15SDChannelSelectFv = .text:0x813DC2F0; // type:function size:0x1B0
|
||||
handleSDCardReady__Q33ipl5scene15SDChannelSelectFv = .text:0x813DC4A0; // type:function size:0x5C
|
||||
handleCardCommand__Q33ipl5scene15SDChannelSelectFv = .text:0x813DC4FC; // type:function size:0x78
|
||||
handleCopyComplete__Q33ipl5scene15SDChannelSelectFv = .text:0x813DC574; // type:function size:0x80
|
||||
@@ -4592,25 +4592,25 @@ handleMoveComplete__Q33ipl5scene15SDChannelSelectFv = .text:0x813DC684; // type:
|
||||
handleBackupFitComplete__Q33ipl5scene15SDChannelSelectFv = .text:0x813DC714; // type:function size:0x48
|
||||
handleNandSDCleanupComplete__Q33ipl5scene15SDChannelSelectFv = .text:0x813DC75C; // type:function size:0x48
|
||||
handleSDDeleteComplete__Q33ipl5scene15SDChannelSelectFv = .text:0x813DC7A4; // type:function size:0x48
|
||||
iplSDChannelSelect_813DC7EC = .text:0x813DC7EC; // type:function size:0x14C
|
||||
updateChannelNotices__Q33ipl5scene15SDChannelSelectFii = .text:0x813DC7EC; // type:function size:0x14C
|
||||
processWorkerState__Q33ipl5scene15SDChannelSelectFv = .text:0x813DC938; // type:function size:0x18C
|
||||
updateDialogAnimation__Q33ipl5scene15SDChannelSelectFv = .text:0x813DCAC4; // type:function size:0x42C
|
||||
setDialogMessage__Q33ipl5scene15SDChannelSelectFUlUl = .text:0x813DCEF0; // type:function size:0x24
|
||||
iplSDChannelSelect_813DCF14 = .text:0x813DCF14; // type:function size:0xCC
|
||||
iplSDChannelSelect_813DCFE0 = .text:0x813DCFE0; // type:function size:0xCC
|
||||
iplSDChannelSelect_813DD0AC = .text:0x813DD0AC; // type:function size:0x194
|
||||
iplSDChannelSelect_813DD240 = .text:0x813DD240; // type:function size:0x198
|
||||
iplSDChannelSelect_813DD3D8 = .text:0x813DD3D8; // type:function size:0x1F8
|
||||
iplSDChannelSelect_813DD5D0 = .text:0x813DD5D0; // type:function size:0x5A4
|
||||
iplSDChannelSelect_813DDB74 = .text:0x813DDB74; // type:function size:0x40
|
||||
iplSDChannelSelect_813DDBB4 = .text:0x813DDBB4; // type:function size:0xB4
|
||||
iplSDChannelSelect_813DDC68 = .text:0x813DDC68; // type:function size:0x18
|
||||
iplSDChannelSelect_813DDC80 = .text:0x813DDC80; // type:function size:0x58
|
||||
iplSDChannelSelect_813DDCD8 = .text:0x813DDCD8; // type:function size:0x8C
|
||||
iplSDChannelSelect_813DDD64 = .text:0x813DDD64; // type:function size:0x58
|
||||
iplSDChannelSelect_813DDDBC = .text:0x813DDDBC; // type:function size:0x5C
|
||||
iplSDChannelSelect_813DDE18 = .text:0x813DDE18; // type:function size:0x2C
|
||||
iplSDChannelSelect_813DDE44 = .text:0x813DDE44; // type:function size:0x24
|
||||
isCurrentTitleUsageEnough__Q33ipl5scene15SDChannelSelectCFPCl = .text:0x813DCF14; // type:function size:0xCC
|
||||
getCurrentTitleUsage__Q33ipl5scene15SDChannelSelectCFPlPl = .text:0x813DCFE0; // type:function size:0xCC
|
||||
collectTitlesByUsage__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl = .text:0x813DD0AC; // type:function size:0x194
|
||||
collectTitlesFromNandUsage__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl = .text:0x813DD240; // type:function size:0x198
|
||||
collectTitlesByChannelOrder__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl = .text:0x813DD3D8; // type:function size:0x1F8
|
||||
collectTitlesBySpecialChannels__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl = .text:0x813DD5D0; // type:function size:0x5A4
|
||||
collectTitlesForMode__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUli = .text:0x813DDB74; // type:function size:0x40
|
||||
findAdjacentChannel__Q33ipl5scene15SDChannelSelectCFiPiPi = .text:0x813DDBB4; // type:function size:0xB4
|
||||
setCurrentPageAndRefresh__Q33ipl5scene15SDChannelSelectFiiPQ33ipl5scene12SDChannelObj = .text:0x813DDC68; // type:function size:0x18
|
||||
handleFourPageDialog__Q33ipl5scene15SDChannelSelectFv = .text:0x813DDC80; // type:function size:0x58
|
||||
flushSaveDataAndMountSD__Q33ipl5scene15SDChannelSelectFv = .text:0x813DDCD8; // type:function size:0x8C
|
||||
handleThreePageDialog__Q33ipl5scene15SDChannelSelectFv = .text:0x813DDD64; // type:function size:0x58
|
||||
finishCardDialog__Q33ipl5scene15SDChannelSelectFv = .text:0x813DDDBC; // type:function size:0x5C
|
||||
finishDialogOperation__Q33ipl5scene15SDChannelSelectFv = .text:0x813DDE18; // type:function size:0x2C
|
||||
finishDialogTransition__Q33ipl5scene15SDChannelSelectFv = .text:0x813DDE44; // type:function size:0x24
|
||||
isResetProcessDone__Q33ipl5scene15SDChannelSelectFv = .text:0x813DDE68; // type:function size:0x28
|
||||
calcCommon__Q33ipl5scene15SDChannelSelectFv = .text:0x813DDE90; // type:function size:0x1B0
|
||||
calcFadein__Q33ipl5scene15SDChannelSelectFv = .text:0x813DE040; // type:function size:0x30
|
||||
@@ -4623,60 +4623,60 @@ createBaseLayout__Q33ipl5scene15SDChannelSelectFv = .text:0x813DE9FC; // type:fu
|
||||
updateChannelObjects__Q33ipl5scene15SDChannelSelectFv = .text:0x813DEE3C; // type:function size:0x5C
|
||||
updateChannelObject__Q33ipl5scene15SDChannelSelectFPQ33ipl5scene12SDChannelObj = .text:0x813DEE98; // type:function size:0x78
|
||||
calcChannelObjects__Q33ipl5scene15SDChannelSelectFv = .text:0x813DEF10; // type:function size:0x58
|
||||
iplSDChannelSelect_813DEF68 = .text:0x813DEF68; // type:function size:0x27C
|
||||
iplSDChannelSelect_813DF1E4 = .text:0x813DF1E4; // type:function size:0x14
|
||||
drawChannelTransitionObjects__Q33ipl5scene15SDChannelSelectFv = .text:0x813DEF68; // type:function size:0x27C
|
||||
isChannelReady__Q33ipl5scene15SDChannelSelectFPCQ33ipl5scene12SDChannelObj = .text:0x813DF1E4; // type:function size:0x14
|
||||
drawChannelObjects__Q33ipl5scene15SDChannelSelectFv = .text:0x813DF1F8; // type:function size:0xB0
|
||||
iplSDChannelSelect_813DF2A8 = .text:0x813DF2A8; // type:function size:0x138
|
||||
iplSDChannelSelect_813DF3E0 = .text:0x813DF3E0; // type:function size:0x1C
|
||||
iplSDChannelSelect_813DF3FC = .text:0x813DF3FC; // type:function size:0x110
|
||||
iplSDChannelSelect_813DF50C = .text:0x813DF50C; // type:function size:0x4C
|
||||
iplSDChannelSelect_813DF558 = .text:0x813DF558; // type:function size:0x178
|
||||
iplSDChannelSelect_813DF6D0 = .text:0x813DF6D0; // type:function size:0x164
|
||||
iplSDChannelSelect_813DF834 = .text:0x813DF834; // type:function size:0x110
|
||||
iplSDChannelSelect_813DF944 = .text:0x813DF944; // type:function size:0x84
|
||||
iplSDChannelSelect_813DF9C8 = .text:0x813DF9C8; // type:function size:0xF8
|
||||
iplSDChannelSelect_813DFAC0 = .text:0x813DFAC0; // type:function size:0xFC
|
||||
iplSDChannelSelect_813DFBBC = .text:0x813DFBBC; // type:function size:0xE4
|
||||
processNormalInput__Q33ipl5scene15SDChannelSelectFv = .text:0x813DF2A8; // type:function size:0x138
|
||||
setPageActionFrame__Q33ipl5scene15SDChannelSelectFv = .text:0x813DF3E0; // type:function size:0x1C
|
||||
finishPageScroll__Q33ipl5scene15SDChannelSelectFv = .text:0x813DF3FC; // type:function size:0x110
|
||||
advancePageAnimation__Q33ipl5scene15SDChannelSelectFv = .text:0x813DF50C; // type:function size:0x4C
|
||||
initializeNormalPage__Q33ipl5scene15SDChannelSelectFv = .text:0x813DF558; // type:function size:0x178
|
||||
refreshPageObjects__Q33ipl5scene15SDChannelSelectFiPQ33ipl5scene12SDChannelObji = .text:0x813DF6D0; // type:function size:0x164
|
||||
createChannelList__Q33ipl5scene15SDChannelSelectFib = .text:0x813DF834; // type:function size:0x110
|
||||
createChannelObject__Q33ipl5scene15SDChannelSelectFii = .text:0x813DF944; // type:function size:0x84
|
||||
destroyUnusedChannelObjects__Q33ipl5scene15SDChannelSelectFiPQ33ipl5scene12SDChannelObj = .text:0x813DF9C8; // type:function size:0xF8
|
||||
refreshChannelList__Q33ipl5scene15SDChannelSelectFv = .text:0x813DFAC0; // type:function size:0xFC
|
||||
refreshAfterSDTitleList__Q33ipl5scene15SDChannelSelectFv = .text:0x813DFBBC; // type:function size:0xE4
|
||||
destroyChannelObject__Q33ipl5scene15SDChannelSelectFPQ33ipl5scene12SDChannelObj = .text:0x813DFCA0; // type:function size:0x50
|
||||
iplSDChannelSelect_813DFCF0 = .text:0x813DFCF0; // type:function size:0x74
|
||||
iplSDChannelSelect_813DFD64 = .text:0x813DFD64; // type:function size:0x154
|
||||
iplSDChannelSelect_813DFEB8 = .text:0x813DFEB8; // type:function size:0x74
|
||||
iplSDChannelSelect_813DFF2C = .text:0x813DFF2C; // type:function size:0x1C0
|
||||
updateChannelObjectOrder__Q33ipl5scene15SDChannelSelectFi = .text:0x813DFCF0; // type:function size:0x74
|
||||
moveChannelObjectsToDrawOrder__Q33ipl5scene15SDChannelSelectFii = .text:0x813DFD64; // type:function size:0x154
|
||||
findChannelObject__Q33ipl5scene15SDChannelSelectCFii = .text:0x813DFEB8; // type:function size:0x74
|
||||
updateArrowVisibility__Q33ipl5scene15SDChannelSelectFv = .text:0x813DFF2C; // type:function size:0x1C0
|
||||
hasChannelObject__Q33ipl5scene15SDChannelSelectCFii = .text:0x813E00EC; // type:function size:0x140
|
||||
isChannelInCalc__Q33ipl5scene15SDChannelSelectCFiii = .text:0x813E022C; // type:function size:0x68
|
||||
iplSDChannelSelect_813E0294 = .text:0x813E0294; // type:function size:0x104
|
||||
iplSDChannelSelect_813E0398 = .text:0x813E0398; // type:function size:0x18
|
||||
iplSDChannelSelect_813E03B0 = .text:0x813E03B0; // type:function size:0xA0
|
||||
iplSDChannelSelect_813E0450 = .text:0x813E0450; // type:function size:0xEC
|
||||
iplSDChannelSelect_813E053C = .text:0x813E053C; // type:function size:0x84
|
||||
iplSDChannelSelect_813E05C0 = .text:0x813E05C0; // type:function size:0x64
|
||||
iplSDChannelSelect_813E0624 = .text:0x813E0624; // type:function size:0xB4
|
||||
isPageCreated__Q33ipl5scene15SDChannelSelectCFi = .text:0x813E0294; // type:function size:0x104
|
||||
setStateAndPlaySelectSound__Q33ipl5scene15SDChannelSelectFi = .text:0x813E0398; // type:function size:0x18
|
||||
setLayoutFrame__Q33ipl5scene15SDChannelSelectFi = .text:0x813E03B0; // type:function size:0xA0
|
||||
selectChannel__Q33ipl5scene15SDChannelSelectFii = .text:0x813E0450; // type:function size:0xEC
|
||||
tellStartingZoomAnm__Q33ipl5scene15SDChannelSelectFv = .text:0x813E053C; // type:function size:0x84
|
||||
prepareRestarting__Q33ipl5scene15SDChannelSelectFi = .text:0x813E05C0; // type:function size:0x64
|
||||
startPageTransition__Q33ipl5scene15SDChannelSelectFii = .text:0x813E0624; // type:function size:0xB4
|
||||
getChannelBasePane__Q33ipl5scene15SDChannelSelectCFiii = .text:0x813E06D8; // type:function size:0xAC
|
||||
getCenterChannelPane__Q33ipl5scene15SDChannelSelectCFi = .text:0x813E0784; // type:function size:0x30
|
||||
getChannelPane__Q33ipl5scene15SDChannelSelectCFi = .text:0x813E07B4; // type:function size:0x30
|
||||
getChannelPanePosition__Q33ipl5scene15SDChannelSelectFPQ33ipl5scene15SDChannelSelecti = .text:0x813E07E4; // type:function size:0x64
|
||||
iplSDChannelSelect_813E0848 = .text:0x813E0848; // type:function size:0x3A4
|
||||
iplSDChannelSelect_813E0BEC = .text:0x813E0BEC; // type:function size:0x294
|
||||
setChannelScissor__Q33ipl5scene15SDChannelSelectCFPCQ33ipl5scene12SDChannelObj = .text:0x813E0848; // type:function size:0x3A4
|
||||
initPageAnimations__Q33ipl5scene15SDChannelSelectFRCQ33ipl4math4VEC3i = .text:0x813E0BEC; // type:function size:0x294
|
||||
calcPageAnimations__Q33ipl5scene15SDChannelSelectFv = .text:0x813E0E80; // type:function size:0x60
|
||||
iplSDChannelSelect_813E0EE0 = .text:0x813E0EE0; // type:function size:0x26C
|
||||
iplSDChannelSelect_813E114C = .text:0x813E114C; // type:function size:0x78
|
||||
iplSDChannelSelect_813E11C4 = .text:0x813E11C4; // type:function size:0x3A4
|
||||
iplSDChannelSelect_813E1568 = .text:0x813E1568; // type:function size:0x124
|
||||
iplSDChannelSelect_813E168C = .text:0x813E168C; // type:function size:0x2D0
|
||||
iplSDChannelSelect_813E195C = .text:0x813E195C; // type:function size:0x6C
|
||||
iplSDChannelSelect_813E19C8 = .text:0x813E19C8; // type:function size:0x68
|
||||
iplSDChannelSelect_813E1A30 = .text:0x813E1A30; // type:function size:0x208
|
||||
iplSDChannelSelect_813E1C38 = .text:0x813E1C38; // type:function size:0x118
|
||||
iplSDChannelSelect_813E1D50 = .text:0x813E1D50; // type:function size:0xFC
|
||||
iplSDChannelSelect_813E1E4C = .text:0x813E1E4C; // type:function size:0x19C
|
||||
iplSDChannelSelect_813E1FE8 = .text:0x813E1FE8; // type:function size:0x1A4
|
||||
iplSDChannelSelect_813E218C = .text:0x813E218C; // type:function size:0x16C
|
||||
iplSDChannelSelect_813E22F8 = .text:0x813E22F8; // type:function size:0x1E0
|
||||
iplSDChannelSelect_813E24D8 = .text:0x813E24D8; // type:function size:0x204
|
||||
iplSDChannelSelect_813E26DC = .text:0x813E26DC; // type:function size:0x74
|
||||
iplSDChannelSelect_813E2750 = .text:0x813E2750; // type:function size:0x164
|
||||
iplSDChannelSelect_813E28B4 = .text:0x813E28B4; // type:function size:0x2A0
|
||||
iplSDChannelSelect_813E2B54 = .text:0x813E2B54; // type:function size:0x240
|
||||
updatePageTransform__Q33ipl5scene15SDChannelSelectFv = .text:0x813E0EE0; // type:function size:0x26C
|
||||
getCenterChannelIndex__Q33ipl5scene15SDChannelSelectCFPCc = .text:0x813E114C; // type:function size:0x78
|
||||
createSceneLayouts__Q33ipl5scene15SDChannelSelectFv = .text:0x813E11C4; // type:function size:0x3A4
|
||||
updateDragState__Q33ipl5scene15SDChannelSelectFv = .text:0x813E1568; // type:function size:0x124
|
||||
updateDragPageTransition__Q33ipl5scene15SDChannelSelectFv = .text:0x813E168C; // type:function size:0x2D0
|
||||
finishDragWait__Q33ipl5scene15SDChannelSelectFv = .text:0x813E195C; // type:function size:0x6C
|
||||
finishDragPageTransition__Q33ipl5scene15SDChannelSelectFv = .text:0x813E19C8; // type:function size:0x68
|
||||
applyChannelMove__Q33ipl5scene15SDChannelSelectFv = .text:0x813E1A30; // type:function size:0x208
|
||||
finishChannelMove__Q33ipl5scene15SDChannelSelectFv = .text:0x813E1C38; // type:function size:0x118
|
||||
resetDragPreview__Q33ipl5scene15SDChannelSelectFv = .text:0x813E1D50; // type:function size:0xFC
|
||||
finishDragPageChange__Q33ipl5scene15SDChannelSelectFv = .text:0x813E1E4C; // type:function size:0x19C
|
||||
onEventDerived__Q33ipl5scene15SDChannelSelectFPCcUlPQ33ipl10controller9Interface = .text:0x813E1FE8; // type:function size:0x1A4
|
||||
onButtonEvent__Q33ipl5scene15SDChannelSelectFPCcUlPCQ33ipl10controller9Interface = .text:0x813E218C; // type:function size:0x16C
|
||||
startDrag__Q33ipl5scene15SDChannelSelectFPCQ33ipl10controller9Interfaceii = .text:0x813E22F8; // type:function size:0x1E0
|
||||
finishDrag__Q33ipl5scene15SDChannelSelectFv = .text:0x813E24D8; // type:function size:0x204
|
||||
isChannelMoveTarget__Q33ipl5scene15SDChannelSelectCFii = .text:0x813E26DC; // type:function size:0x74
|
||||
moveDrag__Q33ipl5scene15SDChannelSelectFv = .text:0x813E2750; // type:function size:0x164
|
||||
onEvent__Q43ipl5scene32@unnamed@iplSDChannelSelect_cpp@27SDChannelSelectEventHandlerFUlUlPv = .text:0x813E28B4; // type:function size:0x2A0
|
||||
onEventDerived__Q43ipl5scene32@unnamed@iplSDChannelSelect_cpp@33SDChannelSelectButtonEventHandlerFUlUlPCQ33ipl10controller9Interface = .text:0x813E2B54; // type:function size:0x240
|
||||
startResetting__Q33ipl5scene15SDChannelSelectFv = .text:0x813E2D94; // type:function size:0x44
|
||||
pop__Q33ipl5scene26SDChannelSelectNoticeQueueFv = .text:0x813E2DD8; // type:function size:0x4C
|
||||
push__Q33ipl5scene27SDChannelSelectCommandQueueFRCQ33ipl5scene22SDChannelSelectCommand = .text:0x813E2E24; // type:function size:0x80
|
||||
@@ -4694,7 +4694,7 @@ iplSDChannelObj_813E322C = .text:0x813E322C; // type:function size:0x9C
|
||||
iplSDChannelObj_813E32C8 = .text:0x813E32C8; // type:function size:0x3C
|
||||
iplSDChannelObj_813E3304 = .text:0x813E3304; // type:function size:0x8
|
||||
iplSDChannelObj_813E330C = .text:0x813E330C; // type:function size:0x14
|
||||
iplSDChannelObj_813E3320 = .text:0x813E3320; // type:function size:0x10
|
||||
getTranslate__Q33ipl5scene12SDChannelObjCFv = .text:0x813E3320; // type:function size:0x10
|
||||
iplSDChannelObj_813E3330 = .text:0x813E3330; // type:function size:0x24
|
||||
iplSDChannelObj_813E3354 = .text:0x813E3354; // type:function size:0x98
|
||||
iplSDChannelObj_813E33EC = .text:0x813E33EC; // type:function size:0x94
|
||||
@@ -4837,7 +4837,7 @@ onEvent__Q33ipl5scene22SDMenuEventHandlerBaseFUlUlPv = .text:0x813EB51C; // type
|
||||
onEventDerived__Q33ipl5scene22SDMenuEventHandlerBaseFUlUlPCQ33ipl10controller9Interface = .text:0x813EB5E8; // type:function size:0x4
|
||||
__ct__Q33ipl5scene8SDMemoryFv = .text:0x813EB5EC; // type:function size:0x48
|
||||
__dt__Q33ipl5scene8SDMemoryFv = .text:0x813EB634; // type:function size:0x5C
|
||||
create__Q33ipl5scene8SDMemoryFPQ23EGG4HeapPQ33ipl4nand10LayoutFilePQ33ipl5scene17NandSDCardManager = .text:0x813EB690; // type:function size:0x10A0
|
||||
create__Q33ipl5scene8SDMemoryFPQ23EGG4HeapPQ33ipl4nand10LayoutFilePQ33ipl5scene15SDChannelSelect = .text:0x813EB690; // type:function size:0x10A0
|
||||
setTitleLists__Q33ipl5scene8SDMemoryFRCQ43ipl5scene8SDMemory10TitleRangeRCQ43ipl5scene8SDMemory10TitleRange = .text:0x813EC730; // type:function size:0xD4
|
||||
setScrollLimit__Q33ipl5scene8SDMemoryFv = .text:0x813EC804; // type:function size:0x144
|
||||
init__Q33ipl7utility8ScrollerFv = .text:0x813EC948; // type:function size:0x20
|
||||
@@ -4879,28 +4879,28 @@ onDialogState21__Q33ipl5scene8SDMemoryFv = .text:0x813EEB94; // type:function si
|
||||
onDialogState22__Q33ipl5scene8SDMemoryFv = .text:0x813EECDC; // type:function size:0x11C
|
||||
onDialogState23__Q33ipl5scene8SDMemoryFv = .text:0x813EEDF8; // type:function size:0x78
|
||||
onDialogState24__Q33ipl5scene8SDMemoryFv = .text:0x813EEE70; // type:function size:0xC0
|
||||
iplSDMemory_813EEF30 = .text:0x813EEF30; // type:function size:0x88
|
||||
iplSDMemory_813EEFB8 = .text:0x813EEFB8; // type:function size:0x70C
|
||||
iplSDMemory_813EF6C4 = .text:0x813EF6C4; // type:function size:0x14
|
||||
iplSDMemory_813EF6D8 = .text:0x813EF6D8; // type:function size:0x48
|
||||
draw__Q33ipl5scene8SDMemoryFv = .text:0x813EEF30; // type:function size:0x88
|
||||
drawTransferTitles__Q33ipl5scene8SDMemoryFv = .text:0x813EEFB8; // type:function size:0x70C
|
||||
writeFourFlagBytes__Q23ipl5sceneFPUcUcUcUcUc = .text:0x813EF6C4; // type:function size:0x14
|
||||
setTitleRowColors__Q23ipl5sceneFPQ34nw4r3lyt7TextBoxRCQ34nw4r2ut5ColorRCQ34nw4r2ut5Color = .text:0x813EF6D8; // type:function size:0x48
|
||||
GetBeginIter__Q34nw4r2ut28LinkList<Q34nw4r3lyt4Pane,4>Fv = .text:0x813EF720; // type:function size:0x8
|
||||
iplSDMemory_813EF728 = .text:0x813EF728; // type:function size:0x8
|
||||
GetEndIter__Q34nw4r2ut28LinkList<Q34nw4r3lyt4Pane,4>Fv = .text:0x813EF728; // type:function size:0x8
|
||||
__ne__Q24nw4r2utFQ44nw4r2ut28LinkList<Q34nw4r3lyt4Pane,4>8IteratorQ44nw4r2ut28LinkList<Q34nw4r3lyt4Pane,4>8Iterator = .text:0x813EF730; // type:function size:0x18
|
||||
iplSDMemory_813EF748 = .text:0x813EF748; // type:function size:0x74
|
||||
iplSDMemory_813EF7BC = .text:0x813EF7BC; // type:function size:0x128
|
||||
iplSDMemory_813EF8E4 = .text:0x813EF8E4; // type:function size:0xF0
|
||||
iplSDMemory_813EF9D4 = .text:0x813EF9D4; // type:function size:0x120
|
||||
iplSDMemory_813EFAF4 = .text:0x813EFAF4; // type:function size:0xD8
|
||||
iplSDMemory_813EFBCC = .text:0x813EFBCC; // type:function size:0xC0
|
||||
iplSDMemory_813EFC8C = .text:0x813EFC8C; // type:function size:0x160
|
||||
iplSDMemory_813EFDEC = .text:0x813EFDEC; // type:function size:0x128
|
||||
iplSDMemory_813EFF14 = .text:0x813EFF14; // type:function size:0x24C
|
||||
iplSDMemory_813F0160 = .text:0x813F0160; // type:function size:0xD8
|
||||
iplSDMemory_813F0238 = .text:0x813F0238; // type:function size:0x74
|
||||
iplSDMemory_813F02AC = .text:0x813F02AC; // type:function size:0x144
|
||||
iplSDMemory_813F03F0 = .text:0x813F03F0; // type:function size:0x10C
|
||||
iplSDMemory_813F04FC = .text:0x813F04FC; // type:function size:0x1A0
|
||||
iplSDMemory_813F069C = .text:0x813F069C; // type:function size:0xD8
|
||||
getControlPaneIndex__Q33ipl5scene8SDMemoryFPCc = .text:0x813EF748; // type:function size:0x74
|
||||
activateControlPane__Q33ipl5scene8SDMemoryFPCcPQ23gui9Component = .text:0x813EF7BC; // type:function size:0x128
|
||||
deactivateControlPane__Q33ipl5scene8SDMemoryFPCc = .text:0x813EF8E4; // type:function size:0xF0
|
||||
cancelControlPane__Q33ipl5scene8SDMemoryFPCc = .text:0x813EF9D4; // type:function size:0x120
|
||||
onEvent__Q43ipl5scene8SDMemory23ControlPaneEventHandlerFUlUlPv = .text:0x813EFAF4; // type:function size:0xD8
|
||||
getTitlePaneIndex__Q33ipl5scene8SDMemoryFPCc = .text:0x813EFBCC; // type:function size:0xC0
|
||||
activateTitlePane__Q33ipl5scene8SDMemoryFPCcPQ23gui9Component = .text:0x813EFC8C; // type:function size:0x160
|
||||
deactivateTitlePane__Q33ipl5scene8SDMemoryFPCc = .text:0x813EFDEC; // type:function size:0x128
|
||||
selectTitlePane__Q33ipl5scene8SDMemoryFPCc = .text:0x813EFF14; // type:function size:0x24C
|
||||
onEvent__Q43ipl5scene8SDMemory21TitlePaneEventHandlerFUlUlPv = .text:0x813F0160; // type:function size:0xD8
|
||||
getDialogPaneIndex__Q33ipl5scene8SDMemoryFPCc = .text:0x813F0238; // type:function size:0x74
|
||||
activateDialogPane__Q33ipl5scene8SDMemoryFPCcPQ23gui9Component = .text:0x813F02AC; // type:function size:0x144
|
||||
deactivateDialogPane__Q33ipl5scene8SDMemoryFPCc = .text:0x813F03F0; // type:function size:0x10C
|
||||
selectDialogPane__Q33ipl5scene8SDMemoryFPCc = .text:0x813F04FC; // type:function size:0x1A0
|
||||
onEvent__Q43ipl5scene8SDMemory22DialogPaneEventHandlerFUlUlPv = .text:0x813F069C; // type:function size:0xD8
|
||||
__ct__Q33ipl5scene7SettingFPQ23EGG4Heapi = .text:0x813F0774; // type:function size:0xF8
|
||||
isAnimating__Q33ipl5scene7SettingFv = .text:0x813F086C; // type:function size:0x3C
|
||||
getFuncMsgQ__Q33ipl5scene7SettingFv = .text:0x813F08A8; // type:function size:0x68
|
||||
@@ -5126,8 +5126,8 @@ __ct__Q33ipl5scene10AOSSThreadFPQ23EGG4Heap = .text:0x813FCA0C; // type:function
|
||||
destroy__Q33ipl5scene10AOSSThreadFi = .text:0x813FCAA0; // type:function size:0x84
|
||||
__dt__Q33ipl5scene10AOSSThreadFv = .text:0x813FCB24; // type:function size:0x70
|
||||
start__Q33ipl5scene10AOSSThreadFv = .text:0x813FCB94; // type:function size:0xF8
|
||||
AOSSThread_813FCC8C__Q33ipl5scene10AOSSThreadFv = .text:0x813FCC8C; // type:function size:0x58
|
||||
AOSSThread_813FCCE4__Q33ipl5scene10AOSSThreadFv = .text:0x813FCCE4; // type:function size:0x50
|
||||
AOSSThread_813FCC8C__Q33ipl5scene10AOSSThreadFUll = .text:0x813FCC8C; // type:function size:0x58
|
||||
AOSSThread_813FCCE4__Q33ipl5scene10AOSSThreadFUlPvl = .text:0x813FCCE4; // type:function size:0x50
|
||||
Run__Q33ipl5scene10AOSSThreadFv = .text:0x813FCD34; // type:function size:0xEC
|
||||
cancel__Q33ipl5scene10AOSSThreadFv = .text:0x813FCE20; // type:function size:0x50
|
||||
finish__Q33ipl5scene10AOSSThreadFP13NCDAossConfigPi = .text:0x813FCE70; // type:function size:0x2FC
|
||||
@@ -5146,7 +5146,7 @@ AOSSi_WLANConnect = .text:0x813FD72C; // type:function size:0x26C
|
||||
AOSSi_Sleep = .text:0x813FD998; // type:function size:0x4
|
||||
AOSSi_Status = .text:0x813FD99C; // type:function size:0x34
|
||||
AOSS_SetCallback = .text:0x813FD9D0; // type:function size:0x34
|
||||
RakuRakuThread_813FDA04__Q33ipl5scene14RakuRakuThreadFv = .text:0x813FDA04; // type:function size:0x6C scope:local
|
||||
RakuRakuThread_813FDA04__Q33ipl5scene14RakuRakuThreadFPUl = .text:0x813FDA04; // type:function size:0x6C scope:local
|
||||
__ct__Q33ipl5scene14RakuRakuThreadFPQ23EGG4Heap = .text:0x813FDA70; // type:function size:0xD8
|
||||
__dt__Q33ipl5scene14RakuRakuThreadFv = .text:0x813FDB48; // type:function size:0xA4
|
||||
destroy__Q33ipl5scene14RakuRakuThreadFv = .text:0x813FDBEC; // type:function size:0xD8
|
||||
@@ -16752,73 +16752,73 @@ __vt__Q33ipl5scene14ParentalDialog = .data:0x81653ED8; // type:object size:0x68
|
||||
@10007 = .data:0x81653FD8; // type:object size:0xE scope:local data:string
|
||||
__vt__Q33ipl5scene6Reboot = .data:0x81653FE8; // type:object size:0x4C
|
||||
__vt__Q33ipl5scene9RootScene = .data:0x81654038; // type:object size:0x4C
|
||||
lbl_81654088 = .data:0x81654088; // type:object size:0x9 data:string
|
||||
lbl_81654091 = .data:0x81654091; // type:object size:0x9 data:string
|
||||
lbl_8165409A = .data:0x8165409A; // type:object size:0x9 data:string
|
||||
lbl_816540A3 = .data:0x816540A3; // type:object size:0x9 data:string
|
||||
lbl_816540AC = .data:0x816540AC; // type:object size:0x9 data:string
|
||||
lbl_816540B5 = .data:0x816540B5; // type:object size:0x9 data:string
|
||||
lbl_816540BE = .data:0x816540BE; // type:object size:0x9 data:string
|
||||
lbl_816540C7 = .data:0x816540C7; // type:object size:0x9 data:string
|
||||
lbl_816540D0 = .data:0x816540D0; // type:object size:0x9 data:string
|
||||
lbl_816540D9 = .data:0x816540D9; // type:object size:0x9 data:string
|
||||
lbl_816540E2 = .data:0x816540E2; // type:object size:0x9 data:string
|
||||
lbl_816540EB = .data:0x816540EB; // type:object size:0x9 data:string
|
||||
lbl_816540F4 = .data:0x816540F4; // type:object size:0x9 data:string
|
||||
lbl_816540FD = .data:0x816540FD; // type:object size:0x9 data:string
|
||||
lbl_81654106 = .data:0x81654106; // type:object size:0x9 data:string
|
||||
lbl_8165410F = .data:0x8165410F; // type:object size:0x9 data:string
|
||||
lbl_81654118 = .data:0x81654118; // type:object size:0x9 data:string
|
||||
lbl_81654121 = .data:0x81654121; // type:object size:0x9 data:string
|
||||
lbl_8165412A = .data:0x8165412A; // type:object size:0x9 data:string
|
||||
lbl_81654133 = .data:0x81654133; // type:object size:0x9 data:string
|
||||
lbl_8165413C = .data:0x8165413C; // type:object size:0x9 data:string
|
||||
lbl_81654145 = .data:0x81654145; // type:object size:0x9 data:string
|
||||
lbl_8165414E = .data:0x8165414E; // type:object size:0x9 data:string
|
||||
lbl_81654157 = .data:0x81654157; // type:object size:0x9 data:string
|
||||
lbl_81654160 = .data:0x81654160; // type:object size:0x9 data:string
|
||||
lbl_81654169 = .data:0x81654169; // type:object size:0x9 data:string
|
||||
lbl_81654172 = .data:0x81654172; // type:object size:0x9 data:string
|
||||
lbl_8165417B = .data:0x8165417B; // type:object size:0x9 data:string
|
||||
lbl_81654184 = .data:0x81654184; // type:object size:0x9 data:string
|
||||
lbl_8165418D = .data:0x8165418D; // type:object size:0x9 data:string
|
||||
lbl_81654196 = .data:0x81654196; // type:object size:0x9 data:string
|
||||
lbl_8165419F = .data:0x8165419F; // type:object size:0x9 data:string
|
||||
lbl_816541A8 = .data:0x816541A8; // type:object size:0x9 data:string
|
||||
lbl_816541B1 = .data:0x816541B1; // type:object size:0x9 data:string
|
||||
lbl_816541BA = .data:0x816541BA; // type:object size:0x9 data:string
|
||||
lbl_816541C3 = .data:0x816541C3; // type:object size:0x9 data:string
|
||||
lbl_816541CC = .data:0x816541CC; // type:object size:0x9 data:string
|
||||
lbl_816541D5 = .data:0x816541D5; // type:object size:0x9 data:string
|
||||
lbl_816541DE = .data:0x816541DE; // type:object size:0x9 data:string
|
||||
lbl_816541E7 = .data:0x816541E7; // type:object size:0x9 data:string
|
||||
lbl_816541F0 = .data:0x816541F0; // type:object size:0x9 data:string
|
||||
lbl_816541F9 = .data:0x816541F9; // type:object size:0x9 data:string
|
||||
@16632 = .data:0x81654088; // type:object size:0x9 scope:local data:string
|
||||
@16633 = .data:0x81654091; // type:object size:0x9 scope:local data:string
|
||||
@16634 = .data:0x8165409A; // type:object size:0x9 scope:local data:string
|
||||
@16635 = .data:0x816540A3; // type:object size:0x9 scope:local data:string
|
||||
@16636 = .data:0x816540AC; // type:object size:0x9 scope:local data:string
|
||||
@16637 = .data:0x816540B5; // type:object size:0x9 scope:local data:string
|
||||
@16638 = .data:0x816540BE; // type:object size:0x9 scope:local data:string
|
||||
@16639 = .data:0x816540C7; // type:object size:0x9 scope:local data:string
|
||||
@16640 = .data:0x816540D0; // type:object size:0x9 scope:local data:string
|
||||
@16641 = .data:0x816540D9; // type:object size:0x9 scope:local data:string
|
||||
@16642 = .data:0x816540E2; // type:object size:0x9 scope:local data:string
|
||||
@16643 = .data:0x816540EB; // type:object size:0x9 scope:local data:string
|
||||
@16644 = .data:0x816540F4; // type:object size:0x9 scope:local data:string
|
||||
@16645 = .data:0x816540FD; // type:object size:0x9 scope:local data:string
|
||||
@16646 = .data:0x81654106; // type:object size:0x9 scope:local data:string
|
||||
@16647 = .data:0x8165410F; // type:object size:0x9 scope:local data:string
|
||||
@16648 = .data:0x81654118; // type:object size:0x9 scope:local data:string
|
||||
@16649 = .data:0x81654121; // type:object size:0x9 scope:local data:string
|
||||
@16650 = .data:0x8165412A; // type:object size:0x9 scope:local data:string
|
||||
@16651 = .data:0x81654133; // type:object size:0x9 scope:local data:string
|
||||
@16652 = .data:0x8165413C; // type:object size:0x9 scope:local data:string
|
||||
@16653 = .data:0x81654145; // type:object size:0x9 scope:local data:string
|
||||
@16654 = .data:0x8165414E; // type:object size:0x9 scope:local data:string
|
||||
@16655 = .data:0x81654157; // type:object size:0x9 scope:local data:string
|
||||
@16656 = .data:0x81654160; // type:object size:0x9 scope:local data:string
|
||||
@16657 = .data:0x81654169; // type:object size:0x9 scope:local data:string
|
||||
@16658 = .data:0x81654172; // type:object size:0x9 scope:local data:string
|
||||
@16659 = .data:0x8165417B; // type:object size:0x9 scope:local data:string
|
||||
@16660 = .data:0x81654184; // type:object size:0x9 scope:local data:string
|
||||
@16661 = .data:0x8165418D; // type:object size:0x9 scope:local data:string
|
||||
@16662 = .data:0x81654196; // type:object size:0x9 scope:local data:string
|
||||
@16663 = .data:0x8165419F; // type:object size:0x9 scope:local data:string
|
||||
@16664 = .data:0x816541A8; // type:object size:0x9 scope:local data:string
|
||||
@16665 = .data:0x816541B1; // type:object size:0x9 scope:local data:string
|
||||
@16666 = .data:0x816541BA; // type:object size:0x9 scope:local data:string
|
||||
@16667 = .data:0x816541C3; // type:object size:0x9 scope:local data:string
|
||||
@16668 = .data:0x816541CC; // type:object size:0x9 scope:local data:string
|
||||
@16669 = .data:0x816541D5; // type:object size:0x9 scope:local data:string
|
||||
@16670 = .data:0x816541DE; // type:object size:0x9 scope:local data:string
|
||||
@16671 = .data:0x816541E7; // type:object size:0x9 scope:local data:string
|
||||
@16672 = .data:0x816541F0; // type:object size:0x9 scope:local data:string
|
||||
@16673 = .data:0x816541F9; // type:object size:0x9 scope:local data:string
|
||||
lbl_81654204 = .data:0x81654204; // type:object size:0xF0
|
||||
lbl_816542F4 = .data:0x816542F4; // type:object size:0xA data:string
|
||||
lbl_816542FE = .data:0x816542FE; // type:object size:0xA data:string
|
||||
lbl_81654308 = .data:0x81654308; // type:object size:0xA data:string
|
||||
lbl_81654312 = .data:0x81654312; // type:object size:0xA data:string
|
||||
@16674 = .data:0x816542F4; // type:object size:0xA scope:local data:string
|
||||
@16675 = .data:0x816542FE; // type:object size:0xA scope:local data:string
|
||||
@16676 = .data:0x81654308; // type:object size:0xA scope:local data:string
|
||||
@16677 = .data:0x81654312; // type:object size:0xA scope:local data:string
|
||||
lbl_8165431C = .data:0x8165431C; // type:object size:0x20
|
||||
lbl_8165433C = .data:0x8165433C; // type:object size:0xB data:string
|
||||
lbl_81654347 = .data:0x81654347; // type:object size:0xB data:string
|
||||
lbl_81654352 = .data:0x81654352; // type:object size:0xB data:string
|
||||
lbl_8165435D = .data:0x8165435D; // type:object size:0xB data:string
|
||||
@16679 = .data:0x8165433C; // type:object size:0xB scope:local data:string
|
||||
@16680 = .data:0x81654347; // type:object size:0xB scope:local data:string
|
||||
@16681 = .data:0x81654352; // type:object size:0xB scope:local data:string
|
||||
@16682 = .data:0x8165435D; // type:object size:0xB scope:local data:string
|
||||
lbl_81654368 = .data:0x81654368; // type:object size:0x20
|
||||
lbl_81654388 = .data:0x81654388; // type:object size:0x14 data:4byte
|
||||
lbl_8165439C = .data:0x8165439C; // type:object size:0x70
|
||||
lbl_8165440C = .data:0x8165440C; // type:object size:0x54
|
||||
lbl_81654460 = .data:0x81654460; // type:object size:0x9 data:string
|
||||
lbl_81654469 = .data:0x81654469; // type:object size:0x9 data:string
|
||||
sFourPageDialogPages__Q23ipl5scene = .data:0x8165439C; // type:object size:0x70
|
||||
sThreePageDialogPages__Q23ipl5scene = .data:0x8165440C; // type:object size:0x54
|
||||
@16689 = .data:0x81654460; // type:object size:0x9 scope:local data:string
|
||||
@16690 = .data:0x81654469; // type:object size:0x9 scope:local data:string
|
||||
lbl_81654472 = .data:0x81654472; // type:object size:0x16
|
||||
lbl_81654488 = .data:0x81654488; // type:object size:0xE data:string
|
||||
lbl_81654496 = .data:0x81654496; // type:object size:0x11 data:string
|
||||
lbl_816544A7 = .data:0x816544A7; // type:object size:0x19 data:string
|
||||
lbl_816544C0 = .data:0x816544C0; // type:object size:0x1B data:string
|
||||
@24438 = .data:0x81654488; // type:object size:0xE scope:local data:string
|
||||
@24439 = .data:0x81654496; // type:object size:0x11 scope:local data:string
|
||||
@24489 = .data:0x816544A7; // type:object size:0x19 scope:local data:string
|
||||
@24490 = .data:0x816544C0; // type:object size:0x1B scope:local data:string
|
||||
jumptable_816544DC = .data:0x816544DC; // type:object size:0x38 scope:local
|
||||
jumptable_81654514 = .data:0x81654514; // type:object size:0x40 scope:local
|
||||
lbl_81654554 = .data:0x81654554; // type:object size:0xB data:string
|
||||
lbl_8165455F = .data:0x8165455F; // type:object size:0xE data:string
|
||||
@24961 = .data:0x81654554; // type:object size:0xB scope:local data:string
|
||||
@24962 = .data:0x8165455F; // type:object size:0xE scope:local data:string
|
||||
jumptable_81654570 = .data:0x81654570; // type:object size:0x3C scope:local
|
||||
jumptable_816545AC = .data:0x816545AC; // type:object size:0x40 scope:local
|
||||
jumptable_816545EC = .data:0x816545EC; // type:object size:0x40 scope:local
|
||||
@@ -16826,16 +16826,16 @@ jumptable_8165462C = .data:0x8165462C; // type:object size:0x40 scope:local
|
||||
jumptable_8165466C = .data:0x8165466C; // type:object size:0x28 scope:local
|
||||
jumptable_81654694 = .data:0x81654694; // type:object size:0x78 scope:local
|
||||
lbl_8165473B = .data:0x8165473B; // type:object size:0xD4
|
||||
lbl_8165480F = .data:0x8165480F; // type:object size:0xE data:string
|
||||
lbl_8165481D = .data:0x8165481D; // type:object size:0xB data:string
|
||||
lbl_81654828 = .data:0x81654828; // type:object size:0x10 data:string
|
||||
@26032 = .data:0x8165480F; // type:object size:0xE scope:local data:string
|
||||
@26047 = .data:0x8165481D; // type:object size:0xB scope:local data:string
|
||||
@26062 = .data:0x81654828; // type:object size:0x10 scope:local data:string
|
||||
lbl_81654838 = .data:0x81654838; // type:object size:0x146
|
||||
lbl_8165497E = .data:0x8165497E; // type:object size:0x16 data:string
|
||||
lbl_81654994 = .data:0x81654994; // type:object size:0x10 data:string
|
||||
lbl_816549A4 = .data:0x816549A4; // type:object size:0xF data:string
|
||||
lbl_816549B3 = .data:0x816549B3; // type:object size:0x14 data:string
|
||||
lbl_816549C7 = .data:0x816549C7; // type:object size:0x10 data:string
|
||||
lbl_816549D7 = .data:0x816549D7; // type:object size:0xF data:string
|
||||
@26231 = .data:0x8165497E; // type:object size:0x16 scope:local data:string
|
||||
@26266 = .data:0x81654994; // type:object size:0x10 scope:local data:string
|
||||
@26311 = .data:0x816549A4; // type:object size:0xF scope:local data:string
|
||||
@26312 = .data:0x816549B3; // type:object size:0x14 scope:local data:string
|
||||
@26336 = .data:0x816549C7; // type:object size:0x10 scope:local data:string
|
||||
@26559 = .data:0x816549D7; // type:object size:0xF scope:local data:string
|
||||
lbl_81654A08 = .data:0x81654A08; // type:object size:0x1C
|
||||
lbl_81654A24 = .data:0x81654A24; // type:object size:0x18
|
||||
lbl_81654A3C = .data:0x81654A3C; // type:object size:0xFC
|
||||
@@ -17078,7 +17078,7 @@ lbl_81657B18 = .data:0x81657B18; // type:object size:0x1A data:string
|
||||
lbl_81657B32 = .data:0x81657B32; // type:object size:0x18 data:string
|
||||
lbl_81657B4A = .data:0x81657B4A; // type:object size:0x16 data:string
|
||||
__vt__Q33ipl5scene10AOSSThread = .data:0x81657B60; // type:object size:0x30
|
||||
lbl_81657B90 = .data:0x81657B90; // type:object size:0x30
|
||||
sRateTable = .data:0x81657B90; // type:object size:0x30
|
||||
lbl_81657BC0 = .data:0x81657BC0; // type:object size:0x38 data:string
|
||||
jumptable_81657BF8 = .data:0x81657BF8; // type:object size:0x20 scope:local
|
||||
__vt__Q33ipl5scene14RakuRakuThread = .data:0x81657C18; // type:object size:0x30
|
||||
@@ -22014,20 +22014,20 @@ natType = .sdata:0x81696D30; // type:object size:0x4 scope:local data:4byte
|
||||
@11124 = .sdata:0x81696D69; // type:object size:0x7 scope:local data:string
|
||||
@11125 = .sdata:0x81696D70; // type:object size:0x7 scope:local data:string
|
||||
@11250 = .sdata:0x81696D78; // type:object size:0x2 scope:local
|
||||
lbl_81696D80 = .sdata:0x81696D80; // type:object size:0x1
|
||||
lbl_81696D81 = .sdata:0x81696D81; // type:object size:0x6 data:string
|
||||
lbl_81696D87 = .sdata:0x81696D87; // type:object size:0x6 data:string
|
||||
lbl_81696D8D = .sdata:0x81696D8D; // type:object size:0x6 data:string
|
||||
lbl_81696D93 = .sdata:0x81696D93; // type:object size:0x6 data:string
|
||||
lbl_81696D99 = .sdata:0x81696D99; // type:object size:0x6 data:string
|
||||
lbl_81696D9F = .sdata:0x81696D9F; // type:object size:0x7 data:string
|
||||
@16631 = .sdata:0x81696D80; // type:object size:0x1 scope:local
|
||||
@16684 = .sdata:0x81696D81; // type:object size:0x6 scope:local data:string
|
||||
@16685 = .sdata:0x81696D87; // type:object size:0x6 scope:local data:string
|
||||
@16686 = .sdata:0x81696D8D; // type:object size:0x6 scope:local data:string
|
||||
@16687 = .sdata:0x81696D93; // type:object size:0x6 scope:local data:string
|
||||
@16688 = .sdata:0x81696D99; // type:object size:0x6 scope:local data:string
|
||||
@16692 = .sdata:0x81696D9F; // type:object size:0x7 scope:local data:string
|
||||
lbl_81696DA8 = .sdata:0x81696DA8; // type:object size:0x4 data:4byte
|
||||
lbl_81696DAC = .sdata:0x81696DAC; // type:object size:0x6 data:wstring
|
||||
lbl_81696DB2 = .sdata:0x81696DB2; // type:object size:0x4 data:string
|
||||
lbl_81696DB6 = .sdata:0x81696DB6; // type:object size:0x7 data:string
|
||||
lbl_81696DBD = .sdata:0x81696DBD; // type:object size:0x1
|
||||
lbl_81696DBE = .sdata:0x81696DBE; // type:object size:0x4 data:string
|
||||
lbl_81696DC2 = .sdata:0x81696DC2; // type:object size:0x5 data:string
|
||||
@25675 = .sdata:0x81696DB2; // type:object size:0x4 scope:local data:string
|
||||
@25689 = .sdata:0x81696DB6; // type:object size:0x7 scope:local data:string
|
||||
@25710 = .sdata:0x81696DBD; // type:object size:0x1 scope:local
|
||||
@26199 = .sdata:0x81696DBE; // type:object size:0x4 scope:local data:string
|
||||
@26201 = .sdata:0x81696DC2; // type:object size:0x5 scope:local data:string
|
||||
lbl_81696DC7 = .sdata:0x81696DC7; // type:object size:0x8 data:string
|
||||
lbl_81696DD0 = .sdata:0x81696DD0; // type:object size:0x4 data:4byte
|
||||
lbl_81696DD4 = .sdata:0x81696DD4; // type:object size:0x4 data:4byte
|
||||
@@ -23472,14 +23472,14 @@ lbl_81698C28 = .sbss:0x81698C28; // type:object size:0x4 data:4byte
|
||||
lbl_81698C2C = .sbss:0x81698C2C; // type:object size:0x4 data:4byte
|
||||
lbl_81698C30 = .sbss:0x81698C30; // type:object size:0x4 data:4byte
|
||||
AOSSi_cancel_flag = .sbss:0x81698C38; // type:object size:0x4 data:4byte
|
||||
lbl_81698C3C = .sbss:0x81698C3C; // type:object size:0x4
|
||||
lbl_81698C40 = .sbss:0x81698C40; // type:object size:0x4
|
||||
lbl_81698C44 = .sbss:0x81698C44; // type:object size:0x4
|
||||
lbl_81698C48 = .sbss:0x81698C48; // type:object size:0x4
|
||||
lbl_81698C4C = .sbss:0x81698C4C; // type:object size:0x4
|
||||
lbl_81698C50 = .sbss:0x81698C50; // type:object size:0x4 data:4byte
|
||||
lbl_81698C54 = .sbss:0x81698C54; // type:object size:0x4 data:4byte
|
||||
lbl_81698C58 = .sbss:0x81698C58; // type:object size:0x4 data:4byte
|
||||
AOSSi_ipAddr = .sbss:0x81698C3C; // type:object size:0x4
|
||||
AOSSi_netmask = .sbss:0x81698C40; // type:object size:0x4
|
||||
AOSSi_gateway = .sbss:0x81698C44; // type:object size:0x4
|
||||
AOSSi_dns1 = .sbss:0x81698C48; // type:object size:0x4
|
||||
AOSSi_dns2 = .sbss:0x81698C4C; // type:object size:0x4
|
||||
AOSSi_alloc = .sbss:0x81698C50; // type:object size:0x4 data:4byte
|
||||
AOSSi_free = .sbss:0x81698C54; // type:object size:0x4 data:4byte
|
||||
AOSSi_callback = .sbss:0x81698C58; // type:object size:0x4 data:4byte
|
||||
lbl_81698C60 = .sbss:0x81698C60; // type:object size:0x4 data:4byte
|
||||
lbl_81698C64 = .sbss:0x81698C64; // type:object size:0x4 data:4byte
|
||||
lbl_81698C68 = .sbss:0x81698C68; // type:object size:0x1 data:byte
|
||||
|
||||
24
configure.py
24
configure.py
@@ -815,7 +815,7 @@ config.libs = [
|
||||
Object(NonMatching, "scene/memoryCard/iplMemoryCard.cpp"),
|
||||
Object(NonMatching, "scene/memoryCard/iplMemoryCardBase.cpp"),
|
||||
Object(NonMatching, "scene/memoryCard/iplMemoryCardManager.cpp"),
|
||||
Object(NonMatching, "scene/memoryCard/iplGCSaveData.cpp"),
|
||||
Object(Matching, "scene/memoryCard/iplGCSaveData.cpp"),
|
||||
Object(NonMatching, "scene/memoryCard/iplGCWindow.cpp"),
|
||||
]
|
||||
),
|
||||
@@ -875,7 +875,7 @@ config.libs = [
|
||||
Object(Matching, "scene/setting/iplAPScanThread.cpp"),
|
||||
Object(NonMatching, "scene/setting/iplUSBAP.cpp"),
|
||||
Object(NonMatching, "scene/setting/iplUSBAPThread.cpp"),
|
||||
Object(NonMatching, "scene/setting/iplAOSSThread.cpp"),
|
||||
Object(Matching, "scene/setting/iplAOSSThread.cpp"),
|
||||
Object(NonMatching, "scene/setting/AOSSLink.c"),
|
||||
Object(NonMatching, "scene/setting/iplRakuRakuThread.cpp"),
|
||||
Object(NonMatching, "scene/setting/AOSS.c"),
|
||||
@@ -1041,7 +1041,7 @@ config.libs = [
|
||||
]
|
||||
),
|
||||
RevoEXLib("net", [
|
||||
Object(NonMatching, "net/nettime.c"),
|
||||
Object(Matching, "net/nettime.c"),
|
||||
Object(Matching, "net/crc.c"),
|
||||
Object(NonMatching, "net/md5.c"),
|
||||
Object(NonMatching, "net/sha1.c"),
|
||||
@@ -1053,19 +1053,19 @@ config.libs = [
|
||||
]
|
||||
),
|
||||
RevoEXLib("nhttp", [
|
||||
Object(NonMatching, "nhttp/NHTTP_bgnend.c"),
|
||||
Object(NonMatching, "nhttp/NHTTP_control.c"),
|
||||
Object(NonMatching, "nhttp/NHTTP_list.c"),
|
||||
Object(NonMatching, "nhttp/NHTTP_os_RVL.c"),
|
||||
Object(Matching, "nhttp/NHTTP_bgnend.c"),
|
||||
Object(Matching, "nhttp/NHTTP_control.c"),
|
||||
Object(Matching, "nhttp/NHTTP_list.c"),
|
||||
Object(Matching, "nhttp/NHTTP_os_RVL.c"),
|
||||
Object(NonMatching, "nhttp/NHTTP_recvbuf.c"),
|
||||
Object(NonMatching, "nhttp/NHTTP_request.c"),
|
||||
Object(NonMatching, "nhttp/NHTTP_response.c"),
|
||||
Object(Matching, "nhttp/NHTTP_request.c"),
|
||||
Object(Matching, "nhttp/NHTTP_response.c"),
|
||||
Object(NonMatching, "nhttp/NHTTP_socket_RVL.c"),
|
||||
Object(NonMatching, "nhttp/NHTTP_stdlib_RVL.c"),
|
||||
Object(NonMatching, "nhttp/NHTTP_thread.c"),
|
||||
Object(NonMatching, "nhttp/d_nhttp_private.c"),
|
||||
Object(NonMatching, "nhttp/d_nhttp.c"),
|
||||
Object(NonMatching, "nhttp/d_nhttp_common.c"),
|
||||
Object(Matching, "nhttp/d_nhttp.c"),
|
||||
Object(Matching, "nhttp/d_nhttp_common.c"),
|
||||
]
|
||||
),
|
||||
RevoEXLib("nwc24", [
|
||||
@@ -1089,7 +1089,7 @@ config.libs = [
|
||||
Object(Matching, "nwc24/NWC24UserId.c"),
|
||||
Object(Matching, "nwc24/NWC24Time.c"),
|
||||
Object(Matching, "nwc24/NWC24Ipc.c"),
|
||||
Object(NonMatching, "nwc24/NWC24Download.c"),
|
||||
Object(Equivalent, "nwc24/NWC24Download.c"),
|
||||
Object(Matching, "nwc24/NWC24CHJump.c"),
|
||||
Object(NonMatching, "nwc24/NWC24System.c"),
|
||||
]
|
||||
|
||||
68
include/iplMemoryCardLib.h
Normal file
68
include/iplMemoryCardLib.h
Normal file
@@ -0,0 +1,68 @@
|
||||
#ifndef IPL_MEMORY_CARD_LIB_H
|
||||
#define IPL_MEMORY_CARD_LIB_H
|
||||
|
||||
#include <revolution/types.h>
|
||||
|
||||
namespace ipl {
|
||||
namespace memorycard {
|
||||
typedef struct FileInfo {
|
||||
u16 fileNo; // 0x00
|
||||
u16 size; // 0x02
|
||||
u8 canCopy; // 0x04
|
||||
u8 canMove; // 0x05
|
||||
u16 unk_0x06; // 0x06
|
||||
u32 key; // 0x08
|
||||
} FileInfo; // 0x0C
|
||||
|
||||
typedef struct CardState {
|
||||
vu8 unk_0x00; // 0x00
|
||||
vu8 changed; // 0x01
|
||||
vs16 state; // 0x02
|
||||
vu16 unk_0x04; // 0x04
|
||||
vu16 unk_0x06; // 0x06
|
||||
vu32 key; // 0x08
|
||||
vu16 unk_0x0C; // 0x0C
|
||||
vu16 unk_0x0E; // 0x0E
|
||||
vu16 freeBlocks; // 0x10
|
||||
vu16 unk_0x12; // 0x12
|
||||
} CardState; // 0x14
|
||||
|
||||
typedef struct IconState {
|
||||
u8 bannerEnable; // 0x00
|
||||
u8 unk_0x01; // 0x01
|
||||
u8 unk_0x02; // 0x02
|
||||
u8 bannerType; // 0x03
|
||||
s8 anmDelta; // 0x04
|
||||
u8 anmType; // 0x05
|
||||
u8 unk_0x06; // 0x06
|
||||
u8 unk_0x07; // 0x07
|
||||
u8 iconFmt[8]; // 0x08
|
||||
u16 anmFrameBits; // 0x10
|
||||
s16 anmMax; // 0x12
|
||||
u32 bannerOffset; // 0x14
|
||||
u32 bannerTlutOffset; // 0x18
|
||||
u32 iconOffset[8]; // 0x1C
|
||||
u32 iconTlutOffset; // 0x3C
|
||||
} IconState; // 0x40
|
||||
|
||||
void probeCard();
|
||||
CardState* getCardSlotState();
|
||||
FileInfo* getCardDirState();
|
||||
IconState* getIconStateArray();
|
||||
long getCardLastSendCmd();
|
||||
long getCardLastSrcSlot();
|
||||
long getCardLastCMDFCmdResult();
|
||||
|
||||
void sendCardFormatCmd(u8 slot);
|
||||
void sendCardCopyCmd(u8 slot, s16 fileNo);
|
||||
void sendCardMoveCmd(u8 slot, s16 fileNo);
|
||||
void sendCardDeleteCmd(u8 slot, s16 fileNo);
|
||||
|
||||
const char* getIconComment(u8 slot, s16 fileNo);
|
||||
|
||||
void initCardThread();
|
||||
bool shutdownCardThread();
|
||||
} // namespace memorycard
|
||||
} // namespace ipl
|
||||
|
||||
#endif // IPL_MEMORY_CARD_LIB_H
|
||||
@@ -122,6 +122,14 @@ extern WWWProtocolFinalizeFn WWWProtocolFinished;
|
||||
extern WWWProtocolFinalizeFn WWWProtocolFailed;
|
||||
extern WWWAddProtocolFn WWWAddProtocol;
|
||||
|
||||
#ifdef IPL_SETTING_IMPLEMENTATION
|
||||
namespace ipl {
|
||||
namespace scene {
|
||||
class Setting;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace www {
|
||||
namespace arcreader {
|
||||
class ArcContainer;
|
||||
@@ -206,6 +214,9 @@ namespace ext_ead {
|
||||
WWWHandle* GetHandle() { return mpBrowserHandle; }
|
||||
|
||||
private:
|
||||
#ifdef IPL_SETTING_IMPLEMENTATION
|
||||
friend class ::ipl::scene::Setting;
|
||||
#endif
|
||||
static BOOL SNotifyCallback_(WWWHandle* wwwBrowser, WWWHandlewindow* wwwWindow, WWWEvent event, WWWHandleEventData* eventData);
|
||||
BOOL NotifyCallback_(WWWHandle* wwwBrowser, WWWHandlewindow* wwwWindow, WWWEvent event, WWWHandleEventData* eventData);
|
||||
|
||||
|
||||
@@ -14,7 +14,15 @@ namespace textinput {
|
||||
|
||||
class LayoutByNW4R : public Base, public nw4rmanager::Layout {
|
||||
public:
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
LayoutByNW4R(nw4r::lyt::MultiArcResourceAccessor* multiArc, const char* layoutName, EventObserver* event)
|
||||
: nw4rmanager::Layout(multiArc, layoutName, event) {}
|
||||
#endif
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
virtual ~LayoutByNW4R();
|
||||
#else
|
||||
virtual ~LayoutByNW4R() {}
|
||||
#endif
|
||||
|
||||
virtual void create(MEMAllocator* allocator);
|
||||
virtual void init();
|
||||
|
||||
@@ -30,14 +30,32 @@ namespace textinput {
|
||||
EM_Last
|
||||
} EditMode;
|
||||
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
InputForm(textinput::Manager* manager, nw4r::lyt::MultiArcResourceAccessor* multiArc,
|
||||
const char* layoutName, EventObserver* event, const char* fontName)
|
||||
: textinput::InputForm(manager, multiArc, layoutName, event, fontName),
|
||||
unk_0x308(NULL), unk_0x30C(NULL), unk_0x310(NULL), unk_0x314(NULL),
|
||||
mfScroll(0.0f), mfScrollFrom(0.0f), mfScrollTo(0.0f), mnLine(0),
|
||||
mDrawRect(), mDefaultDrawSize(), mDefaultBoundSize(), mExScrollAnm(),
|
||||
mpNigaoeObserver(NULL), mpDefaultNigaoe(NULL), mpSendString(NULL),
|
||||
mbEdited(false), mbGoodBye(false), mbEditScrollUp(false), mbEditScrollDown(false),
|
||||
mbCloseWithSend(false), mpScrollButton(NULL), mbScrollUp(false), mbScrollDown(false),
|
||||
meEditMode(EM_Disp) {}
|
||||
#endif
|
||||
|
||||
~InputForm();
|
||||
|
||||
virtual void setScroll(f32 scroll);
|
||||
virtual void setAddScroll(f32 scroll, bool up, bool down);
|
||||
|
||||
virtual f32 getScroll() { return mfScroll; }
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
virtual f32 getScrollFrom();
|
||||
virtual f32 getScrollTo();
|
||||
#else
|
||||
virtual f32 getScrollFrom() { return mfScrollFrom; }
|
||||
virtual f32 getScrollTo() { return mfScrollTo; }
|
||||
#endif
|
||||
|
||||
virtual void open();
|
||||
virtual void close();
|
||||
@@ -90,7 +108,11 @@ namespace textinput {
|
||||
void setEditScrollDown(bool editScrollDown) { mbEditScrollUp = editScrollDown; }
|
||||
void setCloseWithSend(bool closeWithSend) { mbCloseWithSend = closeWithSend; }
|
||||
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
void setEditMode(EditMode editMode);
|
||||
#else
|
||||
void setEditMode(EditMode editMode) { meEditMode = editMode; }
|
||||
#endif
|
||||
|
||||
bool isEdited() { return mbEdited; }
|
||||
bool isGoodBye() { return mbGoodBye; }
|
||||
@@ -103,6 +125,9 @@ namespace textinput {
|
||||
tistring::Decolated* getSendString() { return mpSendString; }
|
||||
|
||||
private:
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
undefined4* unk_0x308;
|
||||
#endif
|
||||
undefined4* unk_0x30C;
|
||||
undefined4* unk_0x310;
|
||||
undefined4* unk_0x314;
|
||||
@@ -117,7 +142,11 @@ namespace textinput {
|
||||
nw4r::lyt::Size mDefaultBoundSize; // 0x358
|
||||
Mtx mDrawMtx; // 0x360
|
||||
Mtx mBoundMtx; // 0x390
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
util::Animation mExScrollAnm; // 0x3C0
|
||||
#else
|
||||
u8 /*todo*/ mExScrollAnm[32]; // 0x3C0
|
||||
#endif
|
||||
NigaoeEventObserver* mpNigaoeObserver; // 0x3E0
|
||||
GXTexObj* mpDefaultNigaoe; // 0x3E4
|
||||
tistring::Decolated* mpSendString; // 0x3E8
|
||||
|
||||
@@ -16,6 +16,13 @@ namespace textinput {
|
||||
T_Last,
|
||||
} Type;
|
||||
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
InputForm(textinput::Manager* manager, nw4r::lyt::MultiArcResourceAccessor* multiArc,
|
||||
const char* layoutName, EventObserver* event, const char* fontName)
|
||||
: textinput::MemoInputForm(manager, multiArc, layoutName, event, fontName),
|
||||
unk_0x400(0), mbPhotoDraw(false), meType(T_MailAddressSel) {}
|
||||
#endif
|
||||
|
||||
virtual nw4r::lyt::Material* getPhotoPaneMaterial();
|
||||
|
||||
virtual void onPhotoTrig();
|
||||
|
||||
@@ -28,6 +28,9 @@ namespace textinput {
|
||||
CT_NumericWithSeparator,
|
||||
CT_NormalWithoutLineFeedWithSign,
|
||||
CT_PredictWithoutLineFeed,
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
CT_PredictBigText,
|
||||
#endif
|
||||
|
||||
CT_Last
|
||||
} ConfigType;
|
||||
@@ -78,7 +81,11 @@ namespace textinput {
|
||||
virtual void start();
|
||||
virtual void end();
|
||||
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
virtual textinput::InputForm* createInputForm();
|
||||
#else
|
||||
virtual InputForm* createInputForm();
|
||||
#endif
|
||||
|
||||
virtual void memoDraw();
|
||||
|
||||
@@ -93,8 +100,16 @@ namespace textinput {
|
||||
|
||||
virtual ConfigType getConfigType() { return meConfigType; }
|
||||
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
virtual void setSaveData();
|
||||
#else
|
||||
virtual void setSaveData_();
|
||||
#endif
|
||||
virtual void reflectSaveData();
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
void reflectSaveDataRev1();
|
||||
void reflectSaveDataDefault();
|
||||
#endif
|
||||
|
||||
virtual void configDefault();
|
||||
virtual void configLetter();
|
||||
@@ -111,10 +126,21 @@ namespace textinput {
|
||||
virtual void configNormalWithoutLineFeedWithSign();
|
||||
virtual void configPredictWithoutLineFeed();
|
||||
virtual void configPredictBigText();
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
virtual textinput::MemoInputForm* createMemoInputForm();
|
||||
virtual textinput::LetterInputForm* createLetterInputForm();
|
||||
virtual textinput::InputForm* createBigTextInputForm();
|
||||
virtual void* createBG();
|
||||
#else
|
||||
virtual void createMemoInputForm();
|
||||
virtual void createLetterInputForm();
|
||||
virtual void createBigTextInputForm();
|
||||
virtual void createBG();
|
||||
#endif
|
||||
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
void* getBackGround() const { return mpBackGround; }
|
||||
#endif
|
||||
|
||||
private:
|
||||
State* mpCurrentState; // 0x40
|
||||
@@ -135,6 +161,11 @@ namespace textinput {
|
||||
|
||||
class State {
|
||||
public:
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
State() : mpManager(NULL) {}
|
||||
Manager* getManager() const { return mpManager; }
|
||||
void setManager(Manager* manager) { mpManager = manager; }
|
||||
#endif
|
||||
virtual ~State();
|
||||
virtual Manager::StateType getStateType();
|
||||
|
||||
@@ -153,6 +184,18 @@ namespace textinput {
|
||||
virtual void start();
|
||||
virtual void end();
|
||||
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
virtual InputForm* InputForm();
|
||||
virtual keyboard::hwkey::HWKeyboard* HWKeyboard();
|
||||
virtual keyboard::pctype::LayoutByNW4R* PCKeyboard();
|
||||
virtual keyboard::cellphonetype::LayoutByNW4R* CellPhoneKeyboard();
|
||||
virtual void* SignKeyboard();
|
||||
virtual candidatebox::LayoutByNW4R* CandidateBox();
|
||||
virtual toolbar::LayoutByNW4R* ToolBar();
|
||||
virtual void* PredictLanguageSelectDialog();
|
||||
virtual void* BG();
|
||||
#endif
|
||||
|
||||
private:
|
||||
Manager* mpManager; // 0x04
|
||||
};
|
||||
|
||||
@@ -2,13 +2,57 @@
|
||||
#define TEXTINPUT_CELL_PHONE_H
|
||||
|
||||
#include "tiNw4rManager.h"
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
#include "tiKeyboard.h"
|
||||
#endif
|
||||
|
||||
namespace textinput {
|
||||
namespace keyboard {
|
||||
namespace cellphonetype {
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
class Base : public textinput::keyboard::KeyboardBase {
|
||||
#else
|
||||
class Base {
|
||||
#endif
|
||||
public:
|
||||
// TODO
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
enum InputMode {
|
||||
IM_00,
|
||||
IM_01,
|
||||
IM_02,
|
||||
IM_03,
|
||||
IM_04,
|
||||
};
|
||||
|
||||
virtual ~Base();
|
||||
virtual void create(MEMAllocator* allocator) override;
|
||||
virtual void init() override;
|
||||
virtual void updateFromReceiver(u32, void*) override;
|
||||
virtual void onKey(u32, void*) override;
|
||||
virtual void getType() override;
|
||||
virtual void onActive() override;
|
||||
virtual void calc();
|
||||
virtual void draw();
|
||||
virtual InputMode getInputMode() const;
|
||||
virtual bool isLocked() const;
|
||||
virtual bool isNumeric() const;
|
||||
virtual bool isNumericWithDot() const;
|
||||
virtual bool isHoldingButton() const;
|
||||
virtual void doNumericMode(bool);
|
||||
virtual void changeInputMode(InputMode);
|
||||
virtual bool isUpperCase();
|
||||
virtual void setInputMode(InputMode);
|
||||
virtual void setUpperCaseJP(bool);
|
||||
virtual void setLangKeyActive(bool);
|
||||
virtual bool onClose();
|
||||
virtual void goSignInputMode();
|
||||
virtual void changePredictLanguage();
|
||||
virtual void setAbcMode(bool);
|
||||
virtual bool isZiActive();
|
||||
virtual bool isAtokActive();
|
||||
virtual void doInput();
|
||||
virtual void updateFixMode();
|
||||
#else
|
||||
virtual void vt_0x08();
|
||||
virtual void vt_0x0C();
|
||||
virtual void vt_0x10();
|
||||
@@ -30,7 +74,11 @@ namespace textinput {
|
||||
|
||||
virtual void vt_0x4C();
|
||||
virtual void vt_0x50();
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
virtual void doNumericMode(bool);
|
||||
#else
|
||||
virtual void vt_0x54();
|
||||
#endif
|
||||
virtual void vt_0x58();
|
||||
virtual void vt_0x5C();
|
||||
virtual void vt_0x60();
|
||||
@@ -38,17 +86,48 @@ namespace textinput {
|
||||
virtual void vt_0x68(bool);
|
||||
|
||||
virtual bool onClose();
|
||||
#endif
|
||||
|
||||
// TODO enum?
|
||||
int getInputType() const;
|
||||
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
private:
|
||||
u32 mPreviousInputMode;
|
||||
u32 mCurrentInputMode;
|
||||
bool mbInputModeLocked;
|
||||
bool mbNumericMode;
|
||||
bool mbNumericWithDotMode;
|
||||
bool mbUpperCaseMode;
|
||||
bool mbAbcMode;
|
||||
bool mbLanguageKeyMode;
|
||||
u32 mHoldingButton;
|
||||
void* mpInputModeTable;
|
||||
MEMAllocator* mpAllocator;
|
||||
void* mpInputSettings;
|
||||
u32 mInputState;
|
||||
#endif
|
||||
};
|
||||
|
||||
class LayoutByNW4R : public Base, public nw4rmanager::Layout {
|
||||
public:
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
virtual void doNumericMode(bool);
|
||||
virtual void setPredictLanguageDialog(void*);
|
||||
virtual void setSignWindow(void*);
|
||||
virtual void doNumericWithDotMode(bool);
|
||||
virtual void setLineFeedButton(bool);
|
||||
virtual void setPredictLanguageButton(bool);
|
||||
virtual void setSignWindowButton(bool);
|
||||
#endif
|
||||
virtual bool onClose();
|
||||
|
||||
void onPressedShift(bool shift);
|
||||
void onReleasedShift();
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
virtual bool updateInput(int chan, f32 x, f32 y, u32 trig, u32 hold, u32 release, void* data) override;
|
||||
virtual bool updateInput(input::HKBManager& hkbManager) override;
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace cellphonetype
|
||||
|
||||
@@ -15,7 +15,11 @@ namespace textinput {
|
||||
|
||||
virtual void init();
|
||||
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
void updateInput(int chan, f32 x, f32 y, u32 trig, u32 hold, u32 release, void* data);
|
||||
#else
|
||||
virtual void updateInput(int chan, f32 x, f32 y, u32 trig, u32 hold, u32 release, void* data);
|
||||
#endif
|
||||
virtual bool updateInput(input::HKBManager& hkbManager);
|
||||
|
||||
private:
|
||||
|
||||
@@ -17,6 +17,9 @@ namespace textinput {
|
||||
namespace inputform {
|
||||
class EditBuffer {
|
||||
public:
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
void create(MEMAllocator* allocator);
|
||||
#endif
|
||||
~EditBuffer();
|
||||
|
||||
private:
|
||||
@@ -167,6 +170,10 @@ namespace textinput {
|
||||
|
||||
virtual void onSE(sound::SE seId);
|
||||
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
void dirtyCacheAll();
|
||||
#endif
|
||||
|
||||
virtual void clear();
|
||||
|
||||
virtual u32 calcCursorPos(f32 x, f32 y);
|
||||
@@ -228,6 +235,9 @@ namespace textinput {
|
||||
|
||||
class LayoutByNW4R : public Base, public nw4rmanager::Layout {
|
||||
public:
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
LayoutByNW4R(textinput::Manager*, nw4r::lyt::MultiArcResourceAccessor*, const char*, EventObserver*, const char*);
|
||||
#endif
|
||||
~LayoutByNW4R();
|
||||
|
||||
virtual void init();
|
||||
@@ -255,7 +265,11 @@ namespace textinput {
|
||||
virtual void visibleSeparator(bool flag);
|
||||
|
||||
private:
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
u8 unk_0x2C0[0x48];
|
||||
#else
|
||||
u8 unk_0x2C0[0x4C];
|
||||
#endif
|
||||
};
|
||||
}
|
||||
typedef inputform::LayoutByNW4R InputForm;
|
||||
|
||||
@@ -14,7 +14,11 @@ namespace textinput {
|
||||
virtual void setCommandReceiver(CommandReceiver* receiver) override;
|
||||
virtual void sendCommand(u32 command, void*) override;
|
||||
virtual void updateFromReceiver(u32, void*) override;
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
virtual void onKey(u32, void*);
|
||||
#else
|
||||
virtual void onKey(u32);
|
||||
#endif
|
||||
virtual void getType();
|
||||
virtual void setLanguage(Language language);
|
||||
virtual Language getLanguage() const;
|
||||
|
||||
@@ -56,6 +56,9 @@ namespace textinput {
|
||||
|
||||
virtual void setLanguage(Language language);
|
||||
virtual Language getLanguage() const { return meLanguage; }
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
Language getLanguageForMemo() const { return meLanguage; }
|
||||
#endif
|
||||
|
||||
virtual void setDestination(Destination destination);
|
||||
|
||||
@@ -66,7 +69,35 @@ namespace textinput {
|
||||
|
||||
virtual void setAspectRatio(bool b4x3);
|
||||
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
MEMAllocator* getAllocatorForMemo() const { return mpAllocator; }
|
||||
inputform::EditBuffer* getEditBufferForMemo() const { return mpEditBuffer; }
|
||||
void setEditBufferForMemo(inputform::EditBuffer* editBuffer) { mpEditBuffer = editBuffer; }
|
||||
void setHWKeyboardForMemo(keyboard::hwkey::HWKeyboard* keyboard) { mpHWKeyboard = keyboard; }
|
||||
nw4r::lyt::MultiArcResourceAccessor* getMultiArcForMemo() const { return mpMultiArcResourceAccessor; }
|
||||
EventObserver* getEventObserverForMemo() const { return mpEventObserver; }
|
||||
InputForm* getInputFormForMemo() const { return mpInputForm; }
|
||||
void setInputFormForMemo(InputForm* inputForm) { mpInputForm = inputForm; }
|
||||
toolbar::LayoutByNW4R* getToolBarForMemo() const { return mpToolBar; }
|
||||
candidatebox::LayoutByNW4R* getCandidateBoxForMemo() const { return mpCandidateBox; }
|
||||
void setPCKeyboardForMemo(keyboard::pctype::LayoutByNW4R* keyboard) { mpPCKeyboard = keyboard; }
|
||||
void setCellPhoneKeyboardForMemo(keyboard::cellphonetype::LayoutByNW4R* keyboard) { mpCellPhoneKeyboard = keyboard; }
|
||||
void setCandidateBoxForMemo(candidatebox::LayoutByNW4R* candidateBox) { mpCandidateBox = candidateBox; }
|
||||
void setToolBarForMemo(toolbar::LayoutByNW4R* toolBar) { mpToolBar = toolBar; }
|
||||
void setPredictLanguageDialogForMemo(void* dialog) { mpPredictLanguageDialog = dialog; }
|
||||
void setSignWindowForMemo(void* signWindow) { mpSignWindow = signWindow; }
|
||||
void* getSignWindowForMemo() const { return mpSignWindow; }
|
||||
keyboard::pctype::LayoutByNW4R* getPCKeyboardForMemo() const { return mpPCKeyboard; }
|
||||
keyboard::cellphonetype::LayoutByNW4R* getCellPhoneKeyboardForMemo() const { return mpCellPhoneKeyboard; }
|
||||
Destination getDestinationForMemo() const { return meDestination; }
|
||||
void initAspect();
|
||||
#endif
|
||||
|
||||
#ifdef IPL_TI_MANAGER_OUT_OF_LINE
|
||||
virtual void setSecretInputMode(bool secretInputMode);
|
||||
#else
|
||||
virtual void setSecretInputMode(bool secretInputMode) { mpInputForm->setSecretModeOn(secretInputMode); }
|
||||
#endif
|
||||
#ifdef IPL_ADDRESS_EDIT_CPP
|
||||
void enableKSXFilter(bool compatibleFilter);
|
||||
#endif
|
||||
@@ -79,7 +110,11 @@ namespace textinput {
|
||||
virtual void start() {}
|
||||
virtual void end() {}
|
||||
|
||||
#ifdef IPL_TI_MANAGER_OUT_OF_LINE
|
||||
virtual InputForm* getInputForm();
|
||||
#else
|
||||
virtual InputForm* getInputForm() { return mpInputForm; }
|
||||
#endif
|
||||
virtual const InputForm* getInputForm() const { return mpInputForm; }
|
||||
|
||||
virtual keyboard::hwkey::HWKeyboard* getHWKeyboard() { return mpHWKeyboard; }
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
|
||||
#include "tiNw4rManager.h"
|
||||
#include "tiTextInputBase.h"
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
#include "tiKeyboard.h"
|
||||
#endif
|
||||
|
||||
namespace textinput {
|
||||
class Manager;
|
||||
@@ -11,8 +14,22 @@ namespace textinput {
|
||||
|
||||
namespace pctype {
|
||||
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
class UIObj {
|
||||
public:
|
||||
class Listener {
|
||||
public:
|
||||
virtual void onEvent(UIObj*, u32, void*);
|
||||
};
|
||||
};
|
||||
#endif
|
||||
|
||||
// TODO
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
class Base : public textinput::keyboard::KeyboardBase {
|
||||
#else
|
||||
class Base : public CommandSender {
|
||||
#endif
|
||||
public:
|
||||
enum TranslateMode {
|
||||
TM_00,
|
||||
@@ -26,6 +43,48 @@ namespace textinput {
|
||||
IT_04,
|
||||
};
|
||||
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
enum InputMode {
|
||||
IM_00,
|
||||
IM_01,
|
||||
IM_02,
|
||||
IM_03,
|
||||
IM_04,
|
||||
};
|
||||
|
||||
virtual ~Base();
|
||||
virtual void create(MEMAllocator* allocator) override;
|
||||
virtual void init() override;
|
||||
virtual void updateFromReceiver(u32, void*) override;
|
||||
virtual void onKey(u32, void*) override;
|
||||
virtual void getType() override;
|
||||
virtual void setLanguage(Language) override;
|
||||
virtual void onActive() override;
|
||||
virtual void inputCharCode(u16);
|
||||
virtual void getState();
|
||||
virtual bool isShiftOn() const;
|
||||
virtual bool isCapsOn() const;
|
||||
virtual bool isABC();
|
||||
virtual void setABC(bool);
|
||||
virtual InputMode getABCInputMode() const;
|
||||
virtual InputMode getAIUInputMode() const;
|
||||
virtual TranslateMode getTranslateMode() const;
|
||||
virtual void setTranslateMode(TranslateMode);
|
||||
virtual void onlyQwerty(bool);
|
||||
virtual void setLangKeyActive(bool);
|
||||
virtual void setInputModeJP(bool, u32, u32);
|
||||
virtual void setInputModeCK(u32);
|
||||
virtual void refreshState();
|
||||
virtual void changeABCInputMode(InputMode);
|
||||
virtual void changeAIUInputMode(InputMode);
|
||||
virtual void onClose();
|
||||
virtual void getWCCode(char*);
|
||||
virtual void getControlKey(char*);
|
||||
virtual void sendInputWChar(u16, bool);
|
||||
virtual void goSignInputMode();
|
||||
virtual void changePredictLanguage();
|
||||
virtual void updateFixMode();
|
||||
#else
|
||||
virtual ~Base();
|
||||
virtual void create(MEMAllocator* allocator);
|
||||
virtual void init();
|
||||
@@ -61,17 +120,57 @@ namespace textinput {
|
||||
virtual void goSignInputMode();
|
||||
virtual void changePredictLanguage();
|
||||
virtual void updateFixMode();
|
||||
#endif
|
||||
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
private:
|
||||
u8 mKeyboardInputFlags[8];
|
||||
const void* mpKeyStateTable;
|
||||
u32 mTranslateMode;
|
||||
u32 mABCInputMode;
|
||||
u32 mAIUInputMode;
|
||||
u32 mCurrentInputType;
|
||||
u32 mInputState;
|
||||
const void* mpLanguageData;
|
||||
bool mbOnlyQwerty;
|
||||
bool mbLanguageKeyActive;
|
||||
u16 mKeyboardFlags;
|
||||
void* mpInputSettings;
|
||||
void* mpCurrentKeyState;
|
||||
|
||||
public:
|
||||
u32 getTranslateModeForMemo() const { return mTranslateMode; }
|
||||
u32 getABCInputModeForMemo() const { return mABCInputMode; }
|
||||
u32 getAIUInputModeForMemo() const { return mAIUInputMode; }
|
||||
#endif
|
||||
};
|
||||
|
||||
// TODO
|
||||
class LayoutByNW4R : public Base, public nw4rmanager::Layout {
|
||||
class LayoutByNW4R : public Base, public nw4rmanager::Layout
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
, public UIObj::Listener
|
||||
#endif
|
||||
{
|
||||
public:
|
||||
// TODO - ...
|
||||
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
virtual void draw();
|
||||
virtual void calc();
|
||||
virtual void setPredictLanguageDialog(void*);
|
||||
virtual void setSignWindow(void*);
|
||||
virtual void setLineFeedButton(bool);
|
||||
virtual void setPredictLanguageButton(bool);
|
||||
virtual void setSignWindowButton(bool);
|
||||
#endif
|
||||
virtual void onClose();
|
||||
|
||||
void onPressedShift(bool shift);
|
||||
void onReleasedShift();
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
virtual bool updateInput(int chan, f32 x, f32 y, u32 trig, u32 hold, u32 release, void* data) override;
|
||||
virtual bool updateInput(input::HKBManager& hkbManager) override;
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace pctype
|
||||
|
||||
@@ -9,7 +9,11 @@
|
||||
|
||||
namespace textinput {
|
||||
namespace textdrawer {
|
||||
#ifdef MYTIMANAGER_IMPLEMENTATION
|
||||
class Base : public nw4r::ut::CharWriter {
|
||||
#else
|
||||
class Base : nw4r::ut::CharWriter {
|
||||
#endif
|
||||
public:
|
||||
typedef struct ViewPort {
|
||||
f32 xOrig; // 0x00
|
||||
@@ -51,7 +55,11 @@ namespace textinput {
|
||||
|
||||
virtual nw4r::math::VEC2 getScale() const = 0;
|
||||
|
||||
#ifdef IPL_TI_TEXTDRAWER_OUT_OF_LINE
|
||||
virtual void setSecretModeOn(bool secretMode);
|
||||
#else
|
||||
virtual void setSecretModeOn(bool secretMode) { mbSecretMode = secretMode; }
|
||||
#endif
|
||||
|
||||
virtual void doBeforeDrawProcess(const wchar_t*, u32, const DrawInfo& drawInfo);
|
||||
virtual void doAfterDrawProcess(const wchar_t*, u32, const DrawInfo& drawInfo);
|
||||
|
||||
@@ -56,10 +56,16 @@ namespace gui {
|
||||
|
||||
virtual void onEvent(u32 compId, u32 event, void* data) {} // 0x08 (0x02)
|
||||
|
||||
#ifdef IPL_GUI_VIRTS_OUT_OF_LINE
|
||||
virtual void setManager(Manager* manager); // 0x0C (0x03)
|
||||
virtual void setLatestEventCtrlNo(int ctrlNo); // 0x10 (0x04)
|
||||
virtual int getLatestEventCtrlNo(); // 0x14 (0x05)
|
||||
#else
|
||||
virtual void setManager(Manager* manager) { mpManager = manager; } // 0x0C (0x03)
|
||||
|
||||
virtual void setLatestEventCtrlNo(int ctrlNo) { mLatestCtrlNum = ctrlNo; } // 0x10 (0x04)
|
||||
virtual int getLatestEventCtrlNo() { return mLatestCtrlNum; } // 0x14 (0x05)
|
||||
#endif
|
||||
|
||||
protected:
|
||||
Manager* mpManager; // 0x04
|
||||
@@ -85,7 +91,11 @@ namespace gui {
|
||||
virtual bool isPointed(int point) { return mbPointed[point]; } // 0x24 (0x09)
|
||||
virtual bool isDragging(int point) { return mbDragging[point]; } // 0x28 (0x0A)
|
||||
|
||||
#ifdef IPL_GUI_VIRTS_OUT_OF_LINE
|
||||
virtual void setPointed(int point, bool bEnable); // 0x2C (0x0B)
|
||||
#else
|
||||
virtual void setPointed(int point, bool bEnable) { mbPointed[point] = bEnable; } // 0x2C (0x0B)
|
||||
#endif
|
||||
|
||||
virtual void onPoint(int point) { mFlightDuration[point] = 0; } // 0x30 (0x0C)
|
||||
virtual void offPoint(int point) { mFlightDuration[point] = 0; } // 0x34 (0x0D)
|
||||
@@ -252,7 +262,11 @@ namespace gui {
|
||||
virtual bool contain(f32 x, f32 y); // 0x68 (0x1A)
|
||||
|
||||
virtual void setPane(nw4r::lyt::Pane* pane) { mpPane = pane; } // 0x6C (0x1B)
|
||||
#ifdef IPL_GUI_VIRTS_OUT_OF_LINE
|
||||
virtual nw4r::lyt::Pane* getPane(); // 0x70 (0x1C)
|
||||
#else
|
||||
virtual nw4r::lyt::Pane* getPane() { return mpPane; } // 0x70 (0x1C)
|
||||
#endif
|
||||
|
||||
private:
|
||||
nw4r::lyt::Pane* mpPane; // 0x88
|
||||
|
||||
@@ -8,15 +8,21 @@
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#include "global/decomp/utils.h"
|
||||
|
||||
namespace ipl {
|
||||
namespace gui {
|
||||
class PaneComponent : public ::gui::PaneComponent {};
|
||||
class PaneManager : public ::gui::PaneManager {
|
||||
public:
|
||||
#ifdef IPL_GCW_PANEMANAGER_CTOR_OUT_OF_LINE
|
||||
PaneManager(::gui::EventHandler* event, const nw4r::lyt::DrawInfo* drawInfo, EGG::Heap* heap, EGG::Allocator* allocator, bool bDisableCon = false) NO_INLINE;
|
||||
#else
|
||||
PaneManager(::gui::EventHandler* event, const nw4r::lyt::DrawInfo* drawInfo, EGG::Heap* heap, EGG::Allocator* allocator, bool bDisableCon = false) :
|
||||
::gui::PaneManager(event, allocator, drawInfo),
|
||||
mpHeap(heap),
|
||||
mbDisableCon(bDisableCon) {}
|
||||
#endif
|
||||
|
||||
#ifdef IPL_CHANNEL_TITLE_NOVTABLE
|
||||
virtual ~PaneManager();
|
||||
|
||||
@@ -180,7 +180,11 @@ namespace ipl {
|
||||
|
||||
/*** TODO: These always generate a weak. Try and make them not do that. ***/
|
||||
const nw4r::ut::Rect getTextDrawRect(const nw4r::lyt::TextBox* textBox) const { return textBox->GetTextDrawRect(mDrawInfo); }
|
||||
#ifdef IPL_SDMEMORY_GET_TEXT_DRAW_RECT_OUT_OF_LINE
|
||||
const nw4r::ut::Rect getTextDrawRect(const char* paneName) const;
|
||||
#else
|
||||
const nw4r::ut::Rect getTextDrawRect(const char* paneName) const { return getTextDrawRect(nw4r::ut::DynamicCast<nw4r::lyt::TextBox*>(mLayout.GetRootPane()->FindPaneByName(paneName))); }
|
||||
#endif
|
||||
|
||||
const nw4r::ut::Rect getPaneRect(nw4r::lyt::Pane* pane) const { return pane->GetPaneRect(mDrawInfo); }
|
||||
const nw4r::ut::Rect getPaneRect(const char* paneName) const { return getPaneRect(mLayout.GetRootPane()->FindPaneByName(paneName)); }
|
||||
|
||||
@@ -7,6 +7,10 @@
|
||||
|
||||
#include "utility/iplFrameController.h"
|
||||
|
||||
#ifdef IPL_GCW_INTP_CTOR_OUT_OF_LINE
|
||||
#include "global/decomp/utils.h"
|
||||
#endif
|
||||
|
||||
namespace ipl {
|
||||
namespace math {
|
||||
template <typename T>
|
||||
@@ -37,6 +41,9 @@ namespace ipl {
|
||||
template <typename T>
|
||||
class LinearIntp : public Interporation<T> {
|
||||
public:
|
||||
#ifdef IPL_GCW_INTP_CTOR_OUT_OF_LINE
|
||||
LinearIntp() NO_INLINE;
|
||||
#endif
|
||||
#ifdef IPL_BOARD_OBJECT_INLINE_INTERPOLATION_DTORS
|
||||
virtual ~LinearIntp();
|
||||
#endif
|
||||
@@ -50,6 +57,7 @@ namespace ipl {
|
||||
T get2() const { return (((mStart * (mMaxFrame - mFrame)) + (mEnd * mFrame)) / mMaxFrame); }
|
||||
};
|
||||
|
||||
|
||||
#ifdef IPL_CHANNEL_TITLE_NOVTABLE
|
||||
template <typename T>
|
||||
class __declspec(novtable) HermiteIntp : public utility::FrameController {
|
||||
|
||||
@@ -85,6 +85,9 @@ namespace ipl {
|
||||
}
|
||||
|
||||
const utility::BScroller& getBInst() { return mBScroller; }
|
||||
#ifdef IPL_SDMEMORY_SCROLLER_BINST_RESET
|
||||
void resetBInst() { mBScroller.reset(); }
|
||||
#endif
|
||||
|
||||
bool isDownEnd() const { return mScroller.isDownEnd(); }
|
||||
bool isUpEnd() const { return mScroller.isUpEnd(); }
|
||||
@@ -98,6 +101,9 @@ namespace ipl {
|
||||
|
||||
void setDownLimit(f32 v) { mScroller.setDownLimit(v); }
|
||||
void setUpLimit(f32 v) { mScroller.setUpLimit(v); }
|
||||
#ifdef IPL_SDMEMORY_SCROLLER_STATE_ACCESSOR
|
||||
void setState(int state) { mScroller.setState(state); }
|
||||
#endif
|
||||
|
||||
bool isActive() const { return mScroller.isActive(); }
|
||||
|
||||
|
||||
@@ -31,6 +31,11 @@ namespace ipl {
|
||||
|
||||
virtual void calc();
|
||||
|
||||
#ifdef IPL_FADER_SCENE_BASE_VIRTS_OUT_OF_LINE
|
||||
virtual void initCalcNormal(); // 0x4C
|
||||
virtual void initCalcFadeout(); // 0x50
|
||||
virtual void calcCommon(); // 0x54
|
||||
#else
|
||||
virtual void initCalcNormal() {
|
||||
} // 0x4C
|
||||
virtual void initCalcFadeout() {
|
||||
@@ -38,6 +43,7 @@ namespace ipl {
|
||||
|
||||
virtual void calcCommon() {
|
||||
} // 0x54
|
||||
#endif
|
||||
|
||||
virtual FaderSceneCommand calcFadein() {
|
||||
return FADER_SCN_NEXT;
|
||||
@@ -49,8 +55,12 @@ namespace ipl {
|
||||
return FADER_SCN_NEXT;
|
||||
} // 0x60
|
||||
|
||||
#ifdef IPL_FADER_SCENE_BASE_VIRTS_OUT_OF_LINE
|
||||
virtual void calcCommonAfter(); // 0x64
|
||||
#else
|
||||
virtual void calcCommonAfter() {
|
||||
} // 0x64
|
||||
#endif
|
||||
|
||||
int getSceneFadeState() {
|
||||
return mScnFadeState;
|
||||
|
||||
@@ -62,14 +62,26 @@ namespace ipl {
|
||||
virtual ~Base();
|
||||
|
||||
/** @brief If the scene is ready */
|
||||
#ifdef IPL_SCENE_BASE_VIRTS_OUT_OF_LINE
|
||||
virtual BOOL isReady() const;
|
||||
#else
|
||||
virtual BOOL isReady() const { return FALSE; }
|
||||
#endif
|
||||
|
||||
/** @brief If the user can power off/reset the system */
|
||||
virtual BOOL isResetAcceptable() const { return TRUE; }
|
||||
/** @brief The scene running code when powering off/resetting the system */
|
||||
#ifdef IPL_SCENE_BASE_VIRTS_OUT_OF_LINE
|
||||
virtual void startResetting();
|
||||
#else
|
||||
virtual void startResetting() {}
|
||||
#endif
|
||||
/** @brief If the scene has finished its powering off/resetting task */
|
||||
#ifdef IPL_SCENE_BASE_VIRTS_OUT_OF_LINE
|
||||
virtual BOOL isResetProcessDone();
|
||||
#else
|
||||
virtual BOOL isResetProcessDone() { return TRUE; }
|
||||
#endif
|
||||
|
||||
/** @brief Prepare to create scene */
|
||||
virtual void prepare() {}
|
||||
@@ -82,10 +94,17 @@ namespace ipl {
|
||||
/** @brief Destroy the scene and clear from memory */
|
||||
virtual void destroy() {}
|
||||
|
||||
#ifdef IPL_SCENE_BASE_VIRTS_OUT_OF_LINE
|
||||
virtual Base* getParent();
|
||||
virtual Base* getChild();
|
||||
virtual Base* getNext();
|
||||
virtual Base* getPrev();
|
||||
#else
|
||||
virtual Base* getParent() { return (Base*)mpParent; }
|
||||
virtual Base* getChild() { return (Base*)mpChild; }
|
||||
virtual Base* getNext() { return (Base*)mpNext; }
|
||||
virtual Base* getPrev() { return (Base*)mpPrev; }
|
||||
#endif
|
||||
|
||||
/** @brief Check if scene has been created.*/
|
||||
bool isSceneCreated() const { return (mScnState & SCN_STATE_CREATED); }
|
||||
|
||||
44
include/scene/memoryCard/iplGCSaveData.h
Normal file
44
include/scene/memoryCard/iplGCSaveData.h
Normal file
@@ -0,0 +1,44 @@
|
||||
#ifndef IPL_SCENE_GC_SAVE_DATA_H
|
||||
#define IPL_SCENE_GC_SAVE_DATA_H
|
||||
|
||||
#include <nw4r/ut.h>
|
||||
|
||||
#include "scene/memoryCard/iplMemoryCardBase.h"
|
||||
|
||||
#include "math/iplMathTypes.h"
|
||||
|
||||
namespace ipl {
|
||||
namespace scene {
|
||||
class GCSaveData : public MemoryBase {
|
||||
friend class MemoryCard;
|
||||
|
||||
public:
|
||||
GCSaveData(EGG::Heap* heap, nand::LayoutFile* layoutFile, const char* directory, const char* fileName,
|
||||
math::VEC3 translate);
|
||||
virtual ~GCSaveData();
|
||||
|
||||
virtual void onPoint(const char* paneName, controller::Interface* controller);
|
||||
virtual void onLeft(const char* paneName);
|
||||
virtual void onTrig(const char* paneName);
|
||||
|
||||
void calc();
|
||||
void draw();
|
||||
void update();
|
||||
void init();
|
||||
|
||||
void setTranslate(const nw4r::math::VEC3& translate);
|
||||
const nw4r::math::VEC3* getTranslate();
|
||||
|
||||
void setBalloon(TextBalloon* balloon);
|
||||
|
||||
private:
|
||||
MemoryBaseEvent* mpEvent; // 0x34
|
||||
TextBalloon* mpBalloon; // 0x38
|
||||
u8 mSlot; // 0x3C
|
||||
s16 mIndex; // 0x3E
|
||||
nw4r::ut::Link mLink; // 0x40
|
||||
};
|
||||
} // namespace scene
|
||||
} // namespace ipl
|
||||
|
||||
#endif // IPL_SCENE_GC_SAVE_DATA_H
|
||||
@@ -3,14 +3,87 @@
|
||||
|
||||
#include "iplSceneHeader.h"
|
||||
|
||||
#include "scene/memoryCard/iplMemoryCardBase.h"
|
||||
#include "scene/memoryCard/iplMemoryCardManager.h"
|
||||
|
||||
#include "math/iplMathTypes.h"
|
||||
|
||||
namespace ipl {
|
||||
namespace scene {
|
||||
SCENE_CLASS(MemoryCard) {
|
||||
class GCSaveData;
|
||||
class GCWindow;
|
||||
class SavedataEditWindow;
|
||||
|
||||
class MemoryCard : public Base, public MemoryBase {
|
||||
public:
|
||||
MemoryCard(EGG::Heap * heap);
|
||||
MemoryCard(EGG::Heap* heap);
|
||||
virtual ~MemoryCard();
|
||||
|
||||
virtual BOOL isResetAcceptable() const;
|
||||
|
||||
virtual void prepare();
|
||||
virtual void create();
|
||||
virtual void calc();
|
||||
virtual void draw();
|
||||
|
||||
virtual void onPoint(const char* paneName, controller::Interface* controller);
|
||||
virtual void onLeft(const char* paneName);
|
||||
virtual void onTrig(const char* paneName);
|
||||
|
||||
void onFocus(void* data);
|
||||
void onRelease();
|
||||
|
||||
MemoryCardManager* getManager() { return mpManager; }
|
||||
|
||||
private:
|
||||
u8 unk_0x54[0x7C];
|
||||
enum {
|
||||
SLOT_A = 0,
|
||||
SLOT_B,
|
||||
};
|
||||
|
||||
void on_fadein1st();
|
||||
void on_fadein2nd();
|
||||
void on_normal();
|
||||
void on_scroll_r();
|
||||
void on_scroll_l();
|
||||
void on_change_tag1st();
|
||||
void on_change_tag2nd();
|
||||
void on_fadeout1st();
|
||||
void on_fadeout2nd();
|
||||
void on_error();
|
||||
void on_insert_card();
|
||||
void on_detach_card();
|
||||
|
||||
void start_savedata_fadein();
|
||||
void start_savedata_fadeout();
|
||||
void start_errormessage_fadein();
|
||||
int update_slot();
|
||||
|
||||
void show_arw();
|
||||
void show_capacity(u8 slot);
|
||||
|
||||
void scroll_common();
|
||||
void start_scroll_r();
|
||||
void start_scroll_l();
|
||||
|
||||
private:
|
||||
s32 mState; // 0x88
|
||||
s32 mPrevState; // 0x8C
|
||||
u8 mSlot; // 0x90
|
||||
u8 unk_0x91[3]; // 0x91
|
||||
s32 mSlotState[2]; // 0x94
|
||||
s16 mIconIndex; // 0x9C
|
||||
s16 mIconCount; // 0x9E
|
||||
u8 mShowArwR; // 0xA0
|
||||
u8 mShowArwL; // 0xA1
|
||||
u8 unk_0xA2[2]; // 0xA2
|
||||
MemoryCardManager* mpManager; // 0xA4
|
||||
MemoryBaseEvent* mpEvent; // 0xA8
|
||||
nw4r::ut::List mSaveDataList; // 0xAC
|
||||
nand::LayoutFile* mBalloonLayoutFile; // 0xB8
|
||||
nw4r::ut::List mBalloonList; // 0xBC
|
||||
GCSaveData* mpFocusSaveData; // 0xC8
|
||||
GCWindow* mpGCWindow; // 0xCC
|
||||
};
|
||||
} // namespace scene
|
||||
} // namespace ipl
|
||||
|
||||
144
include/scene/memoryCard/iplMemoryCardBase.h
Normal file
144
include/scene/memoryCard/iplMemoryCardBase.h
Normal file
@@ -0,0 +1,144 @@
|
||||
#ifndef IPL_SCENE_MEMORY_CARD_BASE_H
|
||||
#define IPL_SCENE_MEMORY_CARD_BASE_H
|
||||
|
||||
#include <nw4r/ut.h>
|
||||
|
||||
#include "layout/iplLayout.h"
|
||||
#include "layout/iplGuiManager.h"
|
||||
|
||||
#include "system/iplController.h"
|
||||
|
||||
namespace ipl {
|
||||
namespace scene {
|
||||
class TextBalloon;
|
||||
class SettingButton;
|
||||
class MemoryBase;
|
||||
}
|
||||
namespace nand {
|
||||
class LayoutFile;
|
||||
}
|
||||
namespace scene {
|
||||
|
||||
class MemoryBaseEvent : public ::gui::EventHandler {
|
||||
public:
|
||||
#ifdef IPL_MEMORYCARD_BASE_EVENT_OUT_OF_LINE
|
||||
MemoryBaseEvent(MemoryBase* base);
|
||||
#else
|
||||
MemoryBaseEvent(MemoryBase* base) : mpBase(base) {}
|
||||
#endif
|
||||
|
||||
virtual ~MemoryBaseEvent();
|
||||
|
||||
virtual void onEvent(u32 componentID, u32 event, void* data);
|
||||
|
||||
private:
|
||||
MemoryBase* mpBase; // 0x0C
|
||||
};
|
||||
|
||||
class MemoryBase {
|
||||
public:
|
||||
class Anm {
|
||||
public:
|
||||
Anm(layout::GroupAnimator* anim) : mAnim(anim) {}
|
||||
virtual ~Anm();
|
||||
|
||||
layout::GroupAnimator* mAnim; // 0x04
|
||||
nw4r::ut::Link mLink; // 0x08
|
||||
};
|
||||
|
||||
class Button {
|
||||
public:
|
||||
Button(nw4r::lyt::Pane* pane) : unk_0x04(0), mPane(pane) {}
|
||||
virtual ~Button();
|
||||
|
||||
u32 unk_0x04; // 0x04
|
||||
nw4r::lyt::Pane* mPane; // 0x08
|
||||
nw4r::ut::Link mLink; // 0x0C
|
||||
};
|
||||
|
||||
class AnmButton {
|
||||
public:
|
||||
AnmButton(const char* name, Anm* anm1, Anm* anm2, Anm* anm3)
|
||||
: unk_0x04(0), mName(name), mCurrentAnm(NULL), mAnm1(anm1), mAnm2(anm2), mAnm3(anm3),
|
||||
unk_0x24(0), mLastCmd(0), mpBalloon(NULL) {}
|
||||
virtual ~AnmButton();
|
||||
|
||||
void calc();
|
||||
void onCmdRecv(int command);
|
||||
|
||||
void setBalloon(TextBalloon* balloon);
|
||||
|
||||
int unk_0x04; // 0x04
|
||||
const char* mName; // 0x08
|
||||
Anm* mCurrentAnm; // 0x0C
|
||||
Anm* mAnm1; // 0x10
|
||||
Anm* mAnm2; // 0x14
|
||||
Anm* mAnm3; // 0x18
|
||||
nw4r::ut::Link mLink; // 0x1C
|
||||
u32 unk_0x24; // 0x24
|
||||
int mLastCmd; // 0x28
|
||||
TextBalloon* mpBalloon; // 0x2C
|
||||
};
|
||||
|
||||
struct AnmName {
|
||||
const char* anmFile;
|
||||
const char* groupName;
|
||||
};
|
||||
|
||||
#ifdef IPL_MEMORYCARD_BASE_CTOR_OUT_OF_LINE
|
||||
MemoryBase();
|
||||
#else
|
||||
MemoryBase() : mpLayout(NULL), unk_0x08(NULL) {
|
||||
nw4r::ut::List_Init(&mAnmList, offsetof(Anm, mLink));
|
||||
nw4r::ut::List_Init(&mButtonList, offsetof(Button, mLink));
|
||||
nw4r::ut::List_Init(&mAnmButtonList, offsetof(AnmButton, mLink));
|
||||
}
|
||||
#endif
|
||||
#ifdef IPL_MEMORYCARD_BASE_OUT_OF_LINE
|
||||
virtual ~MemoryBase();
|
||||
#else
|
||||
virtual ~MemoryBase() {}
|
||||
#endif
|
||||
|
||||
virtual void onPoint(const char* paneName, controller::Interface* controller);
|
||||
virtual void onLeft(const char* paneName);
|
||||
virtual void onMove(const char* paneName);
|
||||
virtual void onTrig(const char* paneName);
|
||||
|
||||
virtual void add_button(const char** paneNames, int count);
|
||||
virtual void add_anmbutton(const char* paneName, Anm* anm1, Anm* anm2, Anm* anm3);
|
||||
virtual Button* get_button(const char* paneName);
|
||||
virtual AnmButton* get_anmbutton(const char* paneName);
|
||||
virtual void clear_button(const char* paneName);
|
||||
virtual void add_animation(const AnmName* anmNames, int count);
|
||||
virtual Anm* get_animation(int index);
|
||||
virtual void do_animation(int index);
|
||||
virtual void do_animation(int index, bool flag);
|
||||
virtual void stop_animation(int index);
|
||||
virtual bool is_animation(int index);
|
||||
virtual bool is_fadein_enable();
|
||||
virtual void set_visible(const char* paneName, bool flag);
|
||||
|
||||
void set_textbox(const char* paneName, u32 message);
|
||||
void set_textbox(const char* paneName, u32 message, int x, int y);
|
||||
void set_textbox(const char* paneName, const wchar_t* text, f32 x, f32 y);
|
||||
void set_textbox(const char* paneName, const wchar_t* text);
|
||||
SettingButton* get_setting_button();
|
||||
void change_button_text_close();
|
||||
void change_button_text_return();
|
||||
void change_button_text_ok();
|
||||
void show_button_return();
|
||||
void show_button_ok();
|
||||
|
||||
protected:
|
||||
layout::Object* mpLayout; // 0x04
|
||||
nand::LayoutFile* unk_0x08; // 0x08
|
||||
gui::PaneManager* mpPaneManager; // 0x0C
|
||||
nw4r::ut::List mAnmList; // 0x10
|
||||
nw4r::ut::List mButtonList; // 0x1C
|
||||
nw4r::ut::List mAnmButtonList; // 0x28
|
||||
};
|
||||
} // namespace scene
|
||||
} // namespace ipl
|
||||
|
||||
#endif // IPL_SCENE_MEMORY_CARD_BASE_H
|
||||
107
include/scene/memoryCard/iplMemoryCardManager.h
Normal file
107
include/scene/memoryCard/iplMemoryCardManager.h
Normal file
@@ -0,0 +1,107 @@
|
||||
#ifndef IPL_SCENE_MEMORY_CARD_MANAGER_H
|
||||
#define IPL_SCENE_MEMORY_CARD_MANAGER_H
|
||||
|
||||
#include <revolution/types.h>
|
||||
#include <revolution/gx.h>
|
||||
|
||||
#include <private/card.h>
|
||||
|
||||
#include <wchar.h>
|
||||
|
||||
#include "iplMemoryCardLib.h"
|
||||
|
||||
namespace ipl {
|
||||
namespace scene {
|
||||
class MemCardEventHandler {
|
||||
public:
|
||||
MemCardEventHandler() {}
|
||||
|
||||
virtual ~MemCardEventHandler();
|
||||
|
||||
virtual void onMemEvent(long event, u8 slot);
|
||||
};
|
||||
|
||||
typedef struct MCFile {
|
||||
u32 fileNo; // 0x00
|
||||
u32 unk_0x04; // 0x04
|
||||
u32 unk_0x08; // 0x08
|
||||
s32 sortKey; // 0x0C
|
||||
} MCFile; // 0x10
|
||||
|
||||
typedef struct MCFileCell {
|
||||
wchar_t comment[2][0x40]; // 0x000
|
||||
s16 iconAnmCounter; // 0x100
|
||||
u16 unk_0x102; // 0x102
|
||||
GXTexObj icon; // 0x104
|
||||
GXTexObj banner; // 0x124
|
||||
GXTlutObj iconTlut; // 0x144
|
||||
GXTlutObj bannerTlut; // 0x150
|
||||
} MCFileCell; // 0x15C
|
||||
|
||||
class MemoryCardManager {
|
||||
public:
|
||||
MemoryCardManager() {
|
||||
MCFileCell* pCell = mFileCell[0];
|
||||
do {
|
||||
pCell->iconAnmCounter = 0;
|
||||
wmemset(pCell->comment[0], 0, 0x40);
|
||||
pCell++;
|
||||
} while (pCell < mFileCell[2]);
|
||||
mLastResult = 0;
|
||||
mLastCmd = 0;
|
||||
__CARDSetDiskID(NULL);
|
||||
memorycard::initCardThread();
|
||||
sort_file_array(0);
|
||||
sort_file_array(1);
|
||||
}
|
||||
virtual ~MemoryCardManager();
|
||||
|
||||
void calc();
|
||||
|
||||
bool isSlotReady(u8 slot);
|
||||
bool isSlotNoCard(u8 slot);
|
||||
long isSlotWrongDevice(u8 slot);
|
||||
|
||||
void sort_file_array(u8 slot);
|
||||
|
||||
void sendCardCmdMove(u8 slot, s16 index);
|
||||
void sendCardCmdCopy(u8 slot, s16 index);
|
||||
void sendCardCmdDelete(u8 slot, s16 index);
|
||||
void sendCardCmdFormat(u8 slot);
|
||||
|
||||
bool isDistSlot(u8 slot, long* pState);
|
||||
bool isMoveEnable(u8 slot, u32 index, long* pCode);
|
||||
bool isCopyEnable(u8 slot, u32 index, long* pCode);
|
||||
|
||||
bool isIconValidate(u8 slot, s16 index);
|
||||
bool isBannerEnable(u8 slot, s16 index);
|
||||
|
||||
void update_icon_anm();
|
||||
void update_file_array(u8 slot);
|
||||
void update_change_cardstate(u8 slot);
|
||||
|
||||
GXTexObj* create_icon(u8 slot, s16 index);
|
||||
GXTexObj* create_icon(u8 slot, s16 index, long start);
|
||||
GXTexObj* _create_icon(u8 slot, s16 fileNo, long start);
|
||||
const wchar_t* getComment(u8 slot, s16 index, int which);
|
||||
GXTexObj* create_banner(u8 slot, s16 index);
|
||||
u16 getBlocks(u8 slot, s16 index);
|
||||
u16 getFreeBlocks(u8 slot);
|
||||
|
||||
void setEventHandler(MemCardEventHandler* eventHandler) {
|
||||
mpEventHandler = eventHandler;
|
||||
}
|
||||
|
||||
private:
|
||||
u32 unk_0x04; // 0x00004
|
||||
MCFile mFile[2][0x7F]; // 0x00008
|
||||
MCFileCell mFileCell[2][0x7F]; // 0x00FE8
|
||||
s32 mLastResult; // 0x16930
|
||||
s32 mLastCmd; // 0x16934
|
||||
u32 unk_0x16938; // 0x16938
|
||||
MemCardEventHandler* mpEventHandler; // 0x1693C
|
||||
};
|
||||
} // namespace scene
|
||||
} // namespace ipl
|
||||
|
||||
#endif // IPL_SCENE_MEMORY_CARD_MANAGER_H
|
||||
@@ -11,6 +11,12 @@
|
||||
|
||||
namespace ipl {
|
||||
namespace scene {
|
||||
#ifdef IPL_SD_CHANNEL_SELECT_CPP
|
||||
namespace {
|
||||
class SDChannelSelectButtonEventHandler;
|
||||
}
|
||||
#endif
|
||||
|
||||
class SDButtonEventHandlerBase : public ::gui::EventHandler {
|
||||
public:
|
||||
virtual void onEvent(u32 compId, u32 event, void* data);
|
||||
@@ -92,7 +98,12 @@ namespace ipl {
|
||||
|
||||
bool isActive() const;
|
||||
|
||||
#ifdef IPL_SD_CHANNEL_SELECT_CPP
|
||||
void setEventHandler(::gui::EventHandler * event,
|
||||
::gui::EventHandler * optOutEvent = NULL);
|
||||
#else
|
||||
void setEventHandler(::gui::EventHandler * event, ::gui::EventHandler * optOutEvent);
|
||||
#endif
|
||||
|
||||
void setText(const char* paneName, u32 msgId);
|
||||
void setText(const char* paneName, const wchar_t* text);
|
||||
@@ -156,6 +167,10 @@ namespace ipl {
|
||||
|
||||
friend class SDArrow;
|
||||
friend class SDButtonEventHandlerBase;
|
||||
#ifdef IPL_SD_CHANNEL_SELECT_CPP
|
||||
friend class SDChannelSelect;
|
||||
friend class SDChannelSelectButtonEventHandler;
|
||||
#endif
|
||||
};
|
||||
} // namespace scene
|
||||
} // namespace ipl
|
||||
|
||||
@@ -10,19 +10,22 @@
|
||||
|
||||
namespace ipl {
|
||||
namespace scene {
|
||||
class SDChannelSelect;
|
||||
|
||||
class SDMemory {
|
||||
public:
|
||||
struct TitleRange {
|
||||
ESTitleId* mpTitles;
|
||||
s32 mByteSize;
|
||||
u32 mCount;
|
||||
};
|
||||
|
||||
SDMemory();
|
||||
~SDMemory();
|
||||
|
||||
void create(EGG::Heap* heap, nand::LayoutFile* layoutFile, NandSDCardManager* manager);
|
||||
void create(EGG::Heap* heap, nand::LayoutFile* layoutFile, SDChannelSelect* channelSelect);
|
||||
void setTitleLists(const TitleRange& nandTitles, const TitleRange& sdTitles);
|
||||
bool calc();
|
||||
void draw();
|
||||
void setScrollLimit();
|
||||
void updateSideArrows();
|
||||
void resetScrollArrows();
|
||||
@@ -38,6 +41,7 @@ namespace ipl {
|
||||
|
||||
private:
|
||||
s32 updateState();
|
||||
void drawTransferTitles();
|
||||
void onDialogState0();
|
||||
void onDialogState2();
|
||||
bool onDialogState3();
|
||||
@@ -62,6 +66,45 @@ namespace ipl {
|
||||
void onDialogState23();
|
||||
bool onDialogState24();
|
||||
void resetDialogPaneAnimations();
|
||||
s32 getControlPaneIndex(const char* paneName);
|
||||
void activateControlPane(const char* paneName, ::gui::Component* component);
|
||||
void deactivateControlPane(const char* paneName);
|
||||
void cancelControlPane(const char* paneName);
|
||||
s32 getTitlePaneIndex(const char* paneName);
|
||||
void activateTitlePane(const char* paneName, ::gui::Component* component);
|
||||
void deactivateTitlePane(const char* paneName);
|
||||
void selectTitlePane(const char* paneName);
|
||||
s32 getDialogPaneIndex(const char* paneName);
|
||||
void activateDialogPane(const char* paneName, ::gui::Component* component);
|
||||
void deactivateDialogPane(const char* paneName);
|
||||
void selectDialogPane(const char* paneName);
|
||||
|
||||
class ControlPaneEventHandler : public ::gui::EventHandler {
|
||||
public:
|
||||
ControlPaneEventHandler(SDMemory* instance) : ::gui::EventHandler(), mpInstance(instance) {}
|
||||
virtual void onEvent(u32 compId, u32 event, void* data);
|
||||
|
||||
private:
|
||||
SDMemory* mpInstance;
|
||||
};
|
||||
|
||||
class TitlePaneEventHandler : public ::gui::EventHandler {
|
||||
public:
|
||||
TitlePaneEventHandler(SDMemory* instance) : ::gui::EventHandler(), mpInstance(instance) {}
|
||||
virtual void onEvent(u32 compId, u32 event, void* data);
|
||||
|
||||
private:
|
||||
SDMemory* mpInstance;
|
||||
};
|
||||
|
||||
class DialogPaneEventHandler : public ::gui::EventHandler {
|
||||
public:
|
||||
DialogPaneEventHandler(SDMemory* instance) : ::gui::EventHandler(), mpInstance(instance) {}
|
||||
virtual void onEvent(u32 compId, u32 event, void* data);
|
||||
|
||||
private:
|
||||
SDMemory* mpInstance;
|
||||
};
|
||||
|
||||
layout::Object* mpMainLayout;
|
||||
layout::Object* mpTitleLayout;
|
||||
@@ -76,7 +119,7 @@ namespace ipl {
|
||||
u32 mPanelStates[3];
|
||||
u32 mTitlePanelStates[5];
|
||||
u32 mPanelAnimationStates[4];
|
||||
NandSDCardManager* mpNandSDCardManager;
|
||||
SDChannelSelect* mpSDChannelSelect;
|
||||
TitleRange mNandTitleRange;
|
||||
TitleRange mSDTitleRange;
|
||||
u32 mTitleCount;
|
||||
@@ -85,11 +128,11 @@ namespace ipl {
|
||||
ESTitleId mTitleIds[96];
|
||||
wchar_t mTitleNames[96][21];
|
||||
u32 mTitleNameCount;
|
||||
u32 mNandTitleNameCount;
|
||||
ESTitleId mNandTitleIds[96];
|
||||
u32 mNandTitleCount;
|
||||
u32 mSDTitleCount;
|
||||
ESTitleId mSDTitleIds[96];
|
||||
u32 mNandTitleCount;
|
||||
u32 mNandTitleNameCount;
|
||||
ESTitleId mNandTitleIds[96];
|
||||
wchar_t mCurrentTitleName[0x840];
|
||||
u8 mTransferFlags[4];
|
||||
u32 mTransferStatus;
|
||||
|
||||
@@ -10,31 +10,77 @@
|
||||
|
||||
namespace ipl {
|
||||
namespace scene {
|
||||
#ifdef IPL_SD_CHANNEL_SELECT_CPP
|
||||
class SDChannelSelect;
|
||||
namespace {
|
||||
class SDChannelSelectEventHandler;
|
||||
class SDChannelSelectButtonEventHandler;
|
||||
}
|
||||
#endif
|
||||
|
||||
class SDChannelObj {
|
||||
public:
|
||||
SDChannelObj(EGG::Heap* heap, int page, int index);
|
||||
~SDChannelObj();
|
||||
|
||||
EGG::Heap* getHeap() const { return mpHeap; }
|
||||
int getPage() const { return mPage; }
|
||||
int getIndex() const { return mIndex; }
|
||||
nw4r::math::VEC3& getTranslate() const;
|
||||
|
||||
private:
|
||||
friend class SDChannelSelect;
|
||||
|
||||
nw4r::ut::Link mListLink;
|
||||
f32 mOffsetX;
|
||||
f32 mOffsetY;
|
||||
EGG::ExpHeap* mpDialogHeap;
|
||||
EGG::ExpHeap* mpChannelHeap;
|
||||
EGG::Heap* mpHeap;
|
||||
u32 mState;
|
||||
int mPage;
|
||||
int mIndex;
|
||||
nand::LayoutFile* mpLayoutFile;
|
||||
nw4r::lyt::Pane* mpPane;
|
||||
layout::Animator* mpPaneAnimator;
|
||||
layout::Object* mpBaseLayout;
|
||||
layout::Animator* mpBaseAnimator;
|
||||
layout::Object* mpPageLayout;
|
||||
layout::Animator* mpPageAnimators[3];
|
||||
int mPageAnimation;
|
||||
int mPageAnimationFrame;
|
||||
layout::Object* mpDialogLayout;
|
||||
layout::Animator* mpDialogAnimator;
|
||||
int mDialogState;
|
||||
int mDialogFrame;
|
||||
int mDialogTimer;
|
||||
int mAnimationState;
|
||||
nw4r::lyt::Group* mpNewMessageGroup;
|
||||
int mNewMessageCount;
|
||||
u8 mbNewMessageGroupActive;
|
||||
int mNewMessageState;
|
||||
int mNewMessageFrame;
|
||||
f32 mOffsetX;
|
||||
f32 mOffsetY;
|
||||
f32 mAspectRatioScale;
|
||||
int mStateFlags;
|
||||
void* mpThumbnailData;
|
||||
NandSDWorker::SDAppMetaEntry mAppMeta;
|
||||
};
|
||||
extern "C" void iplSDChannelObj_813E3104(SDChannelObj* channel);
|
||||
extern "C" void iplSDChannelObj_813E311C(SDChannelObj* channel, EGG::ExpHeap* firstHeap,
|
||||
EGG::ExpHeap* secondHeap);
|
||||
extern "C" void iplSDChannelObj_813E322C(SDChannelObj* channel);
|
||||
extern "C" void iplSDChannelObj_813E32C8(SDChannelObj* channel);
|
||||
extern "C" void iplSDChannelObj_813E34E0(SDChannelObj* channel);
|
||||
extern "C" void iplSDChannelObj_813E3178(SDChannelObj* channel, nw4r::lyt::Pane* pane);
|
||||
extern "C" void iplSDChannelObj_813E3180(SDChannelObj* channel, nand::LayoutFile* layoutFile);
|
||||
extern "C" void iplSDChannelObj_813E3304(SDChannelObj* channel);
|
||||
extern "C" void iplSDChannelObj_813E330C(SDChannelObj* channel);
|
||||
extern "C" void iplSDChannelObj_813E3354(SDChannelObj* channel, int state);
|
||||
extern "C" void iplSDChannelObj_813E33EC(SDChannelObj* channel, int state);
|
||||
extern "C" void iplSDChannelObj_813E3480(SDChannelObj* channel, bool selected);
|
||||
extern "C" void iplSDChannelObj_813E34E8(SDChannelObj* channel, int enabled);
|
||||
extern "C" void* iplSDChannelObj_813E3128(SDChannelObj* channel);
|
||||
extern "C" bool iplSDChannelObj_813E3330(SDChannelObj* channel);
|
||||
|
||||
union SDChannelSelectCommandArguments {
|
||||
u32 values[3];
|
||||
@@ -68,7 +114,7 @@ namespace ipl {
|
||||
|
||||
struct SDChannelSelectTitleInfo {
|
||||
ESTitleId32 titleId;
|
||||
u32 state;
|
||||
bool used;
|
||||
};
|
||||
|
||||
struct SDChannelSelectNoticeQueue {
|
||||
@@ -94,6 +140,11 @@ namespace ipl {
|
||||
SDChannelSelect(EGG::Heap* heap);
|
||||
virtual ~SDChannelSelect();
|
||||
|
||||
NandSDWorker::WorkSDState getSDState() const {
|
||||
return static_cast<NandSDWorker::WorkSDState>(mCurrentSDState);
|
||||
}
|
||||
NandSDWorker* getWorker() const { return mpSDWorker; }
|
||||
|
||||
virtual BOOL isResetProcessDone();
|
||||
virtual void startResetting();
|
||||
virtual void prepare();
|
||||
@@ -106,6 +157,14 @@ namespace ipl {
|
||||
virtual FaderSceneCommand calcNormal();
|
||||
virtual FaderSceneCommand calcFadeout();
|
||||
|
||||
void onButtonEvent(const char* paneName, u32 event,
|
||||
const controller::Interface* controller);
|
||||
BOOL onEventDerived(const char* paneName, u32 event,
|
||||
controller::Interface* controller);
|
||||
bool collectTitlesByUsage(const s32* firstUsage, const s32* secondUsage,
|
||||
ESTitleId* titleIds, char* titleNames,
|
||||
u32* titleCount);
|
||||
|
||||
static const char* mscChannelPaneNames[PAGE_COUNT][MAX_CHANNEL_INDEX];
|
||||
static const char* mscBasePaneNames[PAGE_COUNT];
|
||||
static const char* mscPicturePaneNames[PAGE_COUNT];
|
||||
@@ -114,6 +173,10 @@ namespace ipl {
|
||||
static const char* mscMaskPaneName;
|
||||
|
||||
private:
|
||||
#ifdef IPL_SD_CHANNEL_SELECT_CPP
|
||||
friend class SDChannelSelectEventHandler;
|
||||
friend class SDChannelSelectButtonEventHandler;
|
||||
#endif
|
||||
void enqueueStartNotice();
|
||||
bool enqueueFinishNotice();
|
||||
bool enqueueNotice(u32 highTitleId, u32 lowTitleId, u32 result);
|
||||
@@ -131,22 +194,50 @@ namespace ipl {
|
||||
void calcChannelObjects();
|
||||
void updateChannelObjects();
|
||||
void updateChannelObject(SDChannelObj* channel);
|
||||
void drawChannelTransitionObjects();
|
||||
void drawChannelObjects();
|
||||
bool isChannelInCalc(int page, int index, int currentPage) const;
|
||||
nw4r::lyt::Pane* getChannelBasePane(int page, int index, int currentPage) const;
|
||||
int getCenterChannelIndex(const char* paneName) const;
|
||||
nw4r::lyt::Pane* getCenterChannelPane(int index) const;
|
||||
nw4r::lyt::Pane* getChannelPane(int index) const;
|
||||
static math::VEC3 getChannelPanePosition(SDChannelSelect* scene, int index);
|
||||
void calcPageAnimations();
|
||||
void processNormalInput();
|
||||
void updateArrowVisibility();
|
||||
void processWorkerState();
|
||||
void updateDialogAnimation();
|
||||
void initializeNormalPage();
|
||||
void updatePageTransform();
|
||||
void setChannelScissor(const SDChannelObj* channel) const;
|
||||
bool isCurrentTitleUsageEnough(const s32* usage) const;
|
||||
void getCurrentTitleUsage(s32* bytes, s32* blocks) const;
|
||||
bool collectTitlesByChannelOrder(const s32* firstUsage, const s32* secondUsage,
|
||||
ESTitleId* titleIds, char* titleNames,
|
||||
u32* titleCount);
|
||||
bool collectTitlesFromNandUsage(const s32* firstUsage, const s32* secondUsage,
|
||||
ESTitleId* titleIds, char* titleNames,
|
||||
u32* titleCount);
|
||||
bool collectTitlesBySpecialChannels(const s32* firstUsage, const s32* secondUsage,
|
||||
ESTitleId* titleIds, char* titleNames,
|
||||
u32* titleCount);
|
||||
bool collectTitlesForMode(const s32* firstUsage, const s32* secondUsage,
|
||||
ESTitleId* titleIds, char* titleNames,
|
||||
u32* titleCount, int searchMode);
|
||||
bool findAdjacentChannel(int direction, int* page, int* index) const;
|
||||
void setStateAndPlaySelectSound(int state) NO_INLINE;
|
||||
void finishDialogOperation();
|
||||
void finishDialogTransition();
|
||||
void processWorkerCommands();
|
||||
void handleWorkerStartup();
|
||||
void handleNandTitleCount();
|
||||
void handleNandTitleUsage();
|
||||
void handleNandTitleUsageComplete();
|
||||
void handleSDTitleList();
|
||||
void handleSDTitleListResult();
|
||||
void refreshAfterSDTitleList();
|
||||
void handleSDChannelUpdateComplete();
|
||||
void updateChannelNotices(int pageOffset, int index);
|
||||
void handleSDMountComplete();
|
||||
void handleCopyComplete();
|
||||
void handleDeleteComplete();
|
||||
@@ -164,12 +255,44 @@ namespace ipl {
|
||||
static int compareTitleInfo(const void* lhs, const void* rhs);
|
||||
void createChannelList(int page, bool force);
|
||||
void destroyChannelObject(SDChannelObj* channel);
|
||||
void destroyUnusedChannelObjects(int currentPage, SDChannelObj* keepChannel);
|
||||
void refreshChannelList();
|
||||
bool hasChannelObject(int page, int index) const;
|
||||
SDChannelObj* findChannelObject(int page, int index) const;
|
||||
void createChannelObject(int page, int index);
|
||||
void createBaseLayout();
|
||||
void updateNoCardLayouts();
|
||||
void createChannelThumbnails();
|
||||
|
||||
void createSceneLayouts();
|
||||
BOOL isChannelMoveTarget(int page, int index) const;
|
||||
void selectChannel(int page, int index);
|
||||
BOOL prepareRestarting(int page);
|
||||
void startPageTransition(int page, int index);
|
||||
void setCurrentPageAndRefresh(int page, int index, SDChannelObj* keepChannel);
|
||||
void handleFourPageDialog();
|
||||
void handleThreePageDialog();
|
||||
void setPageActionFrame();
|
||||
void advancePageAnimation();
|
||||
void finishPageScroll();
|
||||
void finishCardDialog();
|
||||
void flushSaveDataAndMountSD();
|
||||
void startDrag(const controller::Interface* controller, int page, int index);
|
||||
void finishDrag();
|
||||
void moveDrag();
|
||||
void updateDragState();
|
||||
void updateDragPageTransition();
|
||||
void finishDragWait();
|
||||
void finishDragPageTransition();
|
||||
void applyChannelMove();
|
||||
void finishChannelMove();
|
||||
void resetDragPreview();
|
||||
void finishDragPageChange();
|
||||
BOOL isPageCreated(int page) const;
|
||||
void refreshPageObjects(int page, SDChannelObj* keepChannel, int noticeIndex);
|
||||
void updateChannelObjectOrder(int page);
|
||||
void moveChannelObjectsToDrawOrder(int page, int mode);
|
||||
void setLayoutFrame(int state);
|
||||
BOOL tellStartingZoomAnm();
|
||||
void initPageAnimations(const math::VEC3& position, int direction);
|
||||
static BOOL isChannelReady(const SDChannelObj* channel);
|
||||
nw4r::ut::List mChannelObjects;
|
||||
nand::LayoutFile* mpLayoutFile;
|
||||
layout::Object* mpLayout;
|
||||
@@ -185,7 +308,7 @@ namespace ipl {
|
||||
int mCurrentChannelIndex;
|
||||
f32 mThumbOffsetX;
|
||||
f32 mThumbOffsetY;
|
||||
nw4r::math::VEC3 mPosition;
|
||||
math::VEC3 mPosition;
|
||||
math::VEC2 mScale;
|
||||
f32 mAspectRatioScale;
|
||||
bool mbLeftArrowVisible;
|
||||
@@ -208,9 +331,9 @@ namespace ipl {
|
||||
bool mbButtonEnabled;
|
||||
bool mbDialogActive;
|
||||
u16 mInputFlags;
|
||||
SDChannelObj* mpCurrentChannel;
|
||||
void* mpCurrentChannel;
|
||||
layout::Object* mpStateLayout;
|
||||
layout::Object* mpHelpLayout;
|
||||
layout::Animator* mpHelpLayout;
|
||||
EGG::ExpHeap* mpRsoHeap;
|
||||
channel::RsoThread* mpRsoThread;
|
||||
u32 mCommandQueueState;
|
||||
@@ -226,8 +349,8 @@ namespace ipl {
|
||||
ESTitleId32* mpSDTitleIds;
|
||||
SDChannelSelectTitleInfo* mpSDTitleInfo;
|
||||
NandSDWorker::TitleUsage* mpNandTitleInfo;
|
||||
u32 mFirstTitleCount;
|
||||
u32 mSecondTitleCount;
|
||||
s32 mFirstTitleCount;
|
||||
s32 mSecondTitleCount;
|
||||
SDChannelObj* mpCurrentLoadedChannel;
|
||||
u32 mSDTitleCount;
|
||||
u32 mNandTitleCount;
|
||||
@@ -241,8 +364,8 @@ namespace ipl {
|
||||
u8 mbShowNoCardMessage;
|
||||
u8 mbOperationActive;
|
||||
u8 mbSDCardBroken;
|
||||
u32 mOperationState;
|
||||
u32 mDialogState;
|
||||
int mOperationState;
|
||||
int mDialogState;
|
||||
nand::File* mpSaveDataFile;
|
||||
u32 mAnimationState;
|
||||
u32 mAnimationTarget;
|
||||
|
||||
32
include/scene/setting/AOSS.h
Normal file
32
include/scene/setting/AOSS.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef IPL_SCENE_SETTING_AOSS_H
|
||||
#define IPL_SCENE_SETTING_AOSS_H
|
||||
|
||||
#include <revolution/ncd/NCDTypes.h>
|
||||
#include <revolution/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct AOSSInitInput {
|
||||
u16 flags;
|
||||
u8 mode;
|
||||
u8 reserved;
|
||||
u16 ssidLength;
|
||||
u8 ssid[0x100];
|
||||
s16 options[5];
|
||||
u8 optionData[6];
|
||||
u8 status;
|
||||
u8 result[0x154];
|
||||
} AOSSInitInput;
|
||||
|
||||
int AOSSi_Init(AOSSInitInput* input);
|
||||
int AOSS_Init_old(AOSSInitInput* input);
|
||||
void* AOSSi_Alloc(u32 size);
|
||||
void AOSSi_Free(void* block);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -17,7 +17,11 @@ namespace ipl {
|
||||
|
||||
virtual ~APScanThread(); // 0x08
|
||||
virtual void* Run(); // 0x0C
|
||||
virtual void unk_0x2C() = 0; // 0x2C
|
||||
#ifdef IPL_SETTING_IMPLEMENTATION
|
||||
virtual void unk_0x2C();
|
||||
#else
|
||||
virtual void unk_0x2C() = 0;
|
||||
#endif
|
||||
|
||||
void setResultData(unsigned short* buffer);
|
||||
void setParam();
|
||||
|
||||
@@ -3,14 +3,198 @@
|
||||
|
||||
#include "iplSceneHeader.h"
|
||||
|
||||
#ifdef IPL_SETTING_IMPLEMENTATION
|
||||
#include <revolution/os.h>
|
||||
#include "layout/iplGuiManager.h"
|
||||
#include "layout/GUIManager.h"
|
||||
#include "iplwww/www_wiisetting.h"
|
||||
#include "iplwww/www_browser.h"
|
||||
#include "system/iplKeyboard.h"
|
||||
#include "system/iplNand.h"
|
||||
#include "utility/iplThread.h"
|
||||
extern "C" {
|
||||
#include <revolution/wd.h>
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace ipl {
|
||||
namespace controller {
|
||||
class Interface;
|
||||
}
|
||||
}
|
||||
|
||||
namespace ipl {
|
||||
namespace scene {
|
||||
#ifdef IPL_SETTING_IMPLEMENTATION
|
||||
class Setting;
|
||||
class APScanThread;
|
||||
class APEvent;
|
||||
|
||||
struct SettingAnimation {
|
||||
u8 unknown[0x14];
|
||||
int state;
|
||||
};
|
||||
|
||||
struct SettingAPScanList {
|
||||
u8 unknown[0x14];
|
||||
u16 count;
|
||||
u8 entries[0x7fe];
|
||||
union {
|
||||
WDBssDesc_* currentDescriptor;
|
||||
u16* currentDescriptorWords;
|
||||
};
|
||||
};
|
||||
#endif
|
||||
|
||||
FADER_SCENE_CLASS(Setting) {
|
||||
public:
|
||||
Setting(EGG::Heap * heap, int arg);
|
||||
void setInitializeResult(bool, int);
|
||||
#ifdef IPL_SETTING_IMPLEMENTATION
|
||||
virtual ~Setting();
|
||||
|
||||
bool isAnimating();
|
||||
void getFuncMsgQ();
|
||||
void resetFuncMsgQ();
|
||||
void createBrowser();
|
||||
void initDirectUrl();
|
||||
void initString();
|
||||
void initWiiSettingData();
|
||||
void initNickName();
|
||||
void initSecurityKey();
|
||||
void initSSID();
|
||||
void initIP();
|
||||
void initDNS();
|
||||
void initProxy();
|
||||
void initBasic();
|
||||
void initMTU();
|
||||
void initSecA();
|
||||
void initVersion();
|
||||
void updateController_();
|
||||
void setSE();
|
||||
void changeVideoMode();
|
||||
bool isInitialSequenceExit(const ::ipl::controller::Interface* input);
|
||||
bool updateScreenMode();
|
||||
void initHTMLText();
|
||||
void initMessage();
|
||||
void initKeyboard(const char* text);
|
||||
bool checkInputString(const wchar_t* text);
|
||||
int checkIPString(const wchar_t* text);
|
||||
void setDefaultBackString();
|
||||
void calcKeyboard();
|
||||
void calcSetting();
|
||||
void onTextInputOK();
|
||||
void setDisPos();
|
||||
void setNickName();
|
||||
void setSecurityKey();
|
||||
void setSSID();
|
||||
void setIP();
|
||||
void setDNS();
|
||||
void setProxy();
|
||||
void setBasic();
|
||||
void setMTU();
|
||||
void setParePass();
|
||||
void setPareRePass();
|
||||
void setPareJudgePass();
|
||||
void setSecA();
|
||||
void setReSecA();
|
||||
void setMasterKey();
|
||||
void adjustSecA(wchar_t* text);
|
||||
void reAdjustSecA();
|
||||
u8 checkTextNum(const char* text);
|
||||
bool checkSpace();
|
||||
void convertIP(char* destination, const u8* address);
|
||||
void convertRevIP(u8* destination, const char* address);
|
||||
void initScroll();
|
||||
void updateScroll();
|
||||
void setAPDraw();
|
||||
u8 getRadioLevel(const WDBssDesc_* descriptor);
|
||||
void setUseEULA_Init_();
|
||||
void setUseEULA_Cancel_();
|
||||
void setUseEULA_Start_();
|
||||
void setUseEULA_WaitStopMotor_();
|
||||
bool validateEULA_();
|
||||
void setUpdate_Init_();
|
||||
void setUpdate_WaitAcceptDialog_();
|
||||
void setUpdate_ConnectTestStart_();
|
||||
void setUpdate_ConnectTestCreateWait_();
|
||||
void setUpdate_ConnectTestRun_();
|
||||
void setUpdate_ConnectTestFailed_();
|
||||
void setUpdate_SuccessDialog_();
|
||||
void setUpdate_NoUpdateDialog_();
|
||||
void setUpdate_EULAInit_();
|
||||
void setUpdate_Reboot_();
|
||||
void makeErrorMessage();
|
||||
bool calcSafeMode();
|
||||
void waitStart();
|
||||
void waitFinish();
|
||||
bool isWaitPlaying();
|
||||
void initAP();
|
||||
void resetAP();
|
||||
void redrawAP();
|
||||
void scanAP();
|
||||
void setNUP();
|
||||
void setUSBAP();
|
||||
void cancelUSBAP();
|
||||
void AOSSProcess();
|
||||
void RakuProcess();
|
||||
void setUpdate_();
|
||||
void setUseEULA_();
|
||||
void start_point_event(const char* pageName);
|
||||
void start_trig_event(const char* pageName);
|
||||
void start_left_event(const char* pageName);
|
||||
int get_arw_no(const char* paneName);
|
||||
int get_ap_no(const char* buttonName);
|
||||
void makeSupportCode();
|
||||
int getErrorNum();
|
||||
virtual void destroy();
|
||||
virtual void prepare();
|
||||
virtual void create();
|
||||
virtual void draw();
|
||||
virtual FaderSceneCommand calcFadein();
|
||||
virtual FaderSceneCommand calcNormal();
|
||||
virtual FaderSceneCommand calcFadeout();
|
||||
virtual BOOL isResetAcceptable() const;
|
||||
virtual void unkv_0x68() = 0;
|
||||
virtual void unkv_0x6C() = 0;
|
||||
virtual void unkv_0x70() = 0;
|
||||
virtual void unkv_0x74() = 0;
|
||||
virtual void unkv_0x78() = 0;
|
||||
virtual void unkv_0x7C() = 0;
|
||||
virtual void unkv_0x80() = 0;
|
||||
virtual void unkv_0x84() = 0;
|
||||
virtual void unkv_0x88() = 0;
|
||||
virtual void unkv_0x8C() = 0;
|
||||
virtual void unkv_0x90() = 0;
|
||||
virtual void unkv_0x94() = 0;
|
||||
virtual void unkv_0x98() = 0;
|
||||
virtual void unkv_0x9C() = 0;
|
||||
virtual void unkv_0xA0() = 0;
|
||||
virtual void unkv_0xA4() = 0;
|
||||
virtual void unkv_0xA8() = 0;
|
||||
virtual void unkv_0xAC() = 0;
|
||||
virtual void unkv_0xB0() = 0;
|
||||
virtual void unkv_0xB4() = 0;
|
||||
virtual void unkv_0xB8() = 0;
|
||||
virtual void unkv_0xBC() = 0;
|
||||
virtual void unkv_0xC0() = 0;
|
||||
virtual void unkv_0xC4() = 0;
|
||||
virtual void unkv_0xC8() = 0;
|
||||
virtual void unkv_0xCC() = 0;
|
||||
virtual void unkv_0xD0() = 0;
|
||||
virtual void unkv_0xD4() = 0;
|
||||
virtual void unkv_0xD8() = 0;
|
||||
virtual void unkv_0xDC() = 0;
|
||||
virtual void unkv_0xE0() = 0;
|
||||
virtual void unkv_0xE4() = 0;
|
||||
virtual void unkv_0xE8() = 0;
|
||||
virtual void unkv_0xEC() = 0;
|
||||
virtual void unkv_0xF0() = 0;
|
||||
virtual void unkv_0xF4() = 0;
|
||||
virtual void unkv_0xF8() = 0;
|
||||
#endif
|
||||
|
||||
u16 getProfileID();
|
||||
void setInitializeResult(bool, int);
|
||||
void setConnectTestResult(int, int, bool, int);
|
||||
int getUpdateTiming();
|
||||
|
||||
@@ -25,8 +209,98 @@ namespace ipl {
|
||||
};
|
||||
|
||||
private:
|
||||
#ifdef IPL_SETTING_IMPLEMENTATION
|
||||
int mUpdateTiming;
|
||||
u8 unk_0x5C;
|
||||
u8 unk_0x5D[3];
|
||||
nand::Base* mpWWWLibraryFile;
|
||||
nand::Base* mpSettingHTMLFile;
|
||||
nand::Base* mpWWWArchiveFile;
|
||||
nand::Base* mpFontFile;
|
||||
nand::Base* mpBackgroundTPLFile;
|
||||
int unk_0x74;
|
||||
int unk_0x78;
|
||||
int unk_0x7C;
|
||||
int mProfileIDMode;
|
||||
int unk_0x84;
|
||||
int mAOSSState;
|
||||
int mRakuState;
|
||||
int mFuncMsgPending;
|
||||
int unk_0x94;
|
||||
ESTitleId mUpdateTitleId;
|
||||
u32 mPrepareTick;
|
||||
u8 mSettingData[0x16];
|
||||
u8 unk_0xBA[2];
|
||||
nand::LayoutFile* mpSettingLayoutFile;
|
||||
layout::Object* mpChangeLayout;
|
||||
layout::Object* mpMainLayout;
|
||||
layout::Object* mpWaitLayout;
|
||||
SettingAnimation* mpFirstAnimation;
|
||||
SettingAnimation* mpSecondAnimation;
|
||||
APEvent* mpEventHandler;
|
||||
gui::PaneManager* mpPaneManager;
|
||||
void* mpUSBAPThread;
|
||||
utility::ut_thread* mpAOSSThread;
|
||||
utility::ut_thread* mpRakuRakuThread;
|
||||
APScanThread* mpAPScanThread;
|
||||
SettingAPScanList mAPScanList;
|
||||
void* mpMem1BrowserBuffer;
|
||||
u32 unk_0x908;
|
||||
void* mpMem2BrowserBuffer;
|
||||
void* mpBrowserStringBuffer;
|
||||
int unk_0x914;
|
||||
int unk_0x918;
|
||||
u8 unk_0x91C[4];
|
||||
ext_ead::www::ImeData* mpBrowserData;
|
||||
www::wiisetting::WiiData* mpWiiSettingData;
|
||||
www::wiisetting::WiiFlag* mpWiiSettingFlag;
|
||||
u8 unk_0x92C;
|
||||
u8 unk_0x92D[3];
|
||||
int unk_0x930;
|
||||
www::wiisetting::SetStringBuf* mpStringBuffer;
|
||||
#ifdef IPL_SETTING_IMPLEMENTATION
|
||||
wchar_t unk_0x938[0x101];
|
||||
#else
|
||||
u8 unk_0x938[0x202];
|
||||
#endif
|
||||
u8 unk_0xB3A;
|
||||
u8 mBrowserCreated;
|
||||
keyboard::Manager::State mKeyboardState;
|
||||
int mInitialArgument;
|
||||
int mAspectRatio;
|
||||
int mProgressiveMode;
|
||||
int mEuRgb60Mode;
|
||||
u8 mIsResetAcceptable;
|
||||
u8 unk_0xB5D[3];
|
||||
OSMessageQueue mFuncMessageQueue;
|
||||
OSMessage mFuncMessages[5];
|
||||
int unk_0xB94;
|
||||
int mState;
|
||||
int unk_0xB9C;
|
||||
OSTime mCreatePageTime;
|
||||
u32 unk_0xBA8;
|
||||
u8 unk_0xBAC;
|
||||
u8 unk_0xBAD[3];
|
||||
u8 unk_0xBB0[0x10];
|
||||
static void* mem1Buffer_;
|
||||
static void* mem2Buffer_;
|
||||
#else
|
||||
u8 unk_0x58[0xB68];
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
#ifdef IPL_SETTING_IMPLEMENTATION
|
||||
class APEvent : public ::gui::EventHandler {
|
||||
public:
|
||||
APEvent(Setting* setting) : ::gui::EventHandler(), mpSetting(setting) {}
|
||||
|
||||
virtual void onEvent(u32 componentID, u32 event, void* data);
|
||||
|
||||
private:
|
||||
Setting* mpSetting;
|
||||
};
|
||||
#endif
|
||||
} // namespace scene
|
||||
} // namespace ipl
|
||||
|
||||
|
||||
@@ -36,6 +36,11 @@
|
||||
#define MAX_CHANNEL_INFO_SIZE CHANNEL_INFO_SIZE(MAX_CHANNEL_PAGE, MAX_CHANNEL_INDEX)
|
||||
|
||||
namespace ipl {
|
||||
#ifdef IPL_SD_CHANNEL_SELECT_CPP
|
||||
namespace scene {
|
||||
class SDChannelSelect;
|
||||
}
|
||||
#endif
|
||||
namespace channel {
|
||||
enum {
|
||||
PRIMARY_TYPE_NONE = 0,
|
||||
@@ -368,6 +373,9 @@ namespace ipl {
|
||||
char* getChJumpData() { return mChJumpData; }
|
||||
|
||||
private:
|
||||
#ifdef IPL_SD_CHANNEL_SELECT_CPP
|
||||
friend class ipl::scene::SDChannelSelect;
|
||||
#endif
|
||||
typedef struct MD5Head {
|
||||
u8 magic[4]; // 0x00 (`IMD5`; "IPL MD5"?)
|
||||
u32 length; // 0x04
|
||||
|
||||
@@ -121,6 +121,7 @@ namespace ipl {
|
||||
#ifdef IPL_SDMEMORY_DIALOG_STATE_ACCESSOR
|
||||
int getStateForSDMemory() const { return mState; }
|
||||
int getResultForSDMemory() const { return mResult; }
|
||||
void setTitleForSDMemory(const wchar_t* text) { set_title(text); }
|
||||
#endif
|
||||
|
||||
/*=================*/
|
||||
@@ -326,6 +327,9 @@ namespace ipl {
|
||||
void setProgBarLength(int len) { mProgBarLen = len; }
|
||||
/** @return The current length of the progress bar */
|
||||
int getProgBarLength() { return mProgBarLen; }
|
||||
#ifdef IPL_SDMEMORY_DIALOG_PROGRESS_FRAME_ACCESSOR
|
||||
int getProgBarFrame() const { return mProgBarFrame; }
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Dialog component handler (Automatically executed by the GUI manager)
|
||||
|
||||
@@ -50,10 +50,17 @@ namespace ipl {
|
||||
} KeyboardType;
|
||||
|
||||
typedef struct KeyboardSetting {
|
||||
#ifdef IPL_SETTING_IMPLEMENTATION
|
||||
u32 rowLimit; // 0x00
|
||||
const wchar_t* wcString; // 0x04
|
||||
u32 stringLimit; // 0x08
|
||||
KeyboardType type; // 0x0C
|
||||
#else
|
||||
KeyboardType type; // 0x00
|
||||
const wchar_t* wcString; // 0x04
|
||||
u32 stringLimit; // 0x08
|
||||
u32 rowLimit; // 0x0C
|
||||
#endif
|
||||
#ifdef IPL_ADDRESS_EDIT_CPP
|
||||
KeyboardSetting(KeyboardType keyboardType, const wchar_t* value, u32 limit, u32 rows);
|
||||
#endif
|
||||
@@ -63,8 +70,15 @@ namespace ipl {
|
||||
textinput::MemoManager::StateType type; // 0x00
|
||||
KeyboardState iplType; // 0x04
|
||||
bool pressOK; // 0x08
|
||||
#ifdef IPL_SETTING_IMPLEMENTATION
|
||||
u8 reservedByte;
|
||||
#else
|
||||
u8 unused_0x09;
|
||||
#endif
|
||||
wchar_t* wcString; // 0x0C
|
||||
#ifdef IPL_SETTING_IMPLEMENTATION
|
||||
State& operator=(const State& other);
|
||||
#endif
|
||||
} State;
|
||||
|
||||
Manager() : mpManager(NULL), mEvent(), mCurrentConChan(0), mbActivated(false), mpSaveFile(NULL) {}
|
||||
|
||||
@@ -15,9 +15,10 @@ namespace ipl {
|
||||
const wchar_t* getMessage(u32 id) const { return mpMessage->getMessage(id); }
|
||||
void setResource(u8* msgData) const { mpMessage->setResource(msgData); }
|
||||
|
||||
private:
|
||||
void initMessage();
|
||||
|
||||
private:
|
||||
|
||||
Message* mpMessage; // 0x00
|
||||
};
|
||||
} // namespace message
|
||||
|
||||
@@ -151,6 +151,10 @@ namespace ipl {
|
||||
BOOL is_terminated();
|
||||
BOOL is_working();
|
||||
|
||||
#ifdef IPL_SD_CHANNEL_SELECT_CPP
|
||||
void requestCancel() { unk_0x04 = true; }
|
||||
#endif
|
||||
|
||||
WIISaveBannerFile* get_cached_nand_save_banner(ESTitleId titleId);
|
||||
void* get_cached_nand_app_thumbnail(ESTitleId titleId, u32*);
|
||||
WIISaveBannerFile* get_cached_sd_save_banner(ESTitleId32 titleId);
|
||||
@@ -179,6 +183,10 @@ namespace ipl {
|
||||
|
||||
static const int SD_APP_BACKUP_THUMBNAIL_LENGTH = 0xC800;
|
||||
|
||||
#ifdef IPL_SDMEMORY_COMPLETION_PCT_ACCESSOR
|
||||
static int getCompletionPct() { return s_completion_pct; }
|
||||
#endif
|
||||
|
||||
protected:
|
||||
static const int FAT_PAGES = 8;
|
||||
static const int DATA_PAGES = 32;
|
||||
|
||||
@@ -15,6 +15,11 @@
|
||||
#define SAVEDATA_VERSION 3
|
||||
|
||||
namespace ipl {
|
||||
#ifdef IPL_SD_CHANNEL_SELECT_ACCESS
|
||||
namespace scene {
|
||||
class SDChannelSelect;
|
||||
}
|
||||
#endif
|
||||
namespace channel {
|
||||
class Manager;
|
||||
}
|
||||
@@ -54,6 +59,7 @@ namespace ipl {
|
||||
int getLastSDPrevPage() { return mLastSDPrevPage; }
|
||||
void setLastSDPrevPage(int page) { mLastSDPrevPage = page; }
|
||||
BOOL didntGotoSDMenu() const { return mData.didntGotoSDMenu; }
|
||||
void setDidntGotoSDMenu(BOOL value) { mData.didntGotoSDMenu = value; }
|
||||
#endif
|
||||
|
||||
bool hasPhotoMP3Dummy() { return mbPhotoMP3; }
|
||||
@@ -68,6 +74,9 @@ namespace ipl {
|
||||
void iplSavedata_813596B8(ESTitleId titleId);
|
||||
|
||||
private:
|
||||
#ifdef IPL_SD_CHANNEL_SELECT_ACCESS
|
||||
friend class ipl::scene::SDChannelSelect;
|
||||
#endif
|
||||
BOOL checkValidApp(ESTitleId titleId);
|
||||
|
||||
static void initManagerTask(void* work);
|
||||
|
||||
@@ -56,6 +56,7 @@ namespace ipl {
|
||||
void stop() { mState = ANIM_STATE_STOP; }
|
||||
|
||||
bool isPlaying() const { return mState == ANIM_STATE_PLAY; }
|
||||
bool isPlaying() const volatile { return mState == ANIM_STATE_PLAY; }
|
||||
|
||||
protected:
|
||||
f32 mMaxFrame; // 0x04
|
||||
|
||||
@@ -73,6 +73,9 @@ namespace ipl {
|
||||
|
||||
void setDownLimit(f32 v) { mDownLimit = v; }
|
||||
void setUpLimit(f32 v) { mUpLimit = v; }
|
||||
#ifdef IPL_SDMEMORY_SCROLLER_STATE_ACCESSOR
|
||||
void setState(int state) { mState = state; }
|
||||
#endif
|
||||
|
||||
void addScroll(f32 v) { mScroll += v; }
|
||||
|
||||
|
||||
@@ -48,7 +48,12 @@ namespace nw4r {
|
||||
Pane(const res::Pane* pBlock);
|
||||
virtual ~Pane(); // 0x08
|
||||
|
||||
#ifdef IPL_LYT_PANE_RTTI_OUT_OF_LINE
|
||||
virtual const nw4r::ut::detail::RuntimeTypeInfo* GetRuntimeTypeInfo() const;
|
||||
static const nw4r::ut::detail::RuntimeTypeInfo typeInfo;
|
||||
#else
|
||||
NW4R_UT_RUNTIME_TYPEINFO;
|
||||
#endif
|
||||
|
||||
virtual void CalculateMtx(const DrawInfo& drawInfo); // 0x10
|
||||
|
||||
@@ -105,7 +110,11 @@ namespace nw4r {
|
||||
void SetSize(const Size& size) { mSize = size; }
|
||||
|
||||
bool IsVisible() { return detail::TestBit(mFlag, BIT_VISIBLE); };
|
||||
#ifdef IPL_LYT_PANE_SETVISIBLE_OUT_OF_LINE
|
||||
void SetVisible(bool visible);
|
||||
#else
|
||||
void SetVisible(bool visible) { detail::SetBit(&mFlag, BIT_VISIBLE, visible); };
|
||||
#endif
|
||||
|
||||
bool IsInfluencedAlpha() { return detail::TestBit(mFlag, BIT_INFLUENCED_ALPHA); };
|
||||
void SetInfluencedAlpha(bool visible) { detail::SetBit(&mFlag, BIT_INFLUENCED_ALPHA, visible); };
|
||||
|
||||
@@ -55,6 +55,12 @@ namespace nw4r {
|
||||
NW4R_ASSERT(type < TEXTCOLOR_MAX);
|
||||
return mTextColors[type];
|
||||
}
|
||||
#ifdef IPL_SDMEMORY_SET_TEXT_COLORS
|
||||
void SetTextColors(const ut::Color& first, const ut::Color& second) {
|
||||
mTextColors[0] = first;
|
||||
mTextColors[1] = second;
|
||||
}
|
||||
#endif
|
||||
void SetTextColor(u32 type, ut::Color value) {
|
||||
NW4R_ASSERT(type < TEXTCOLOR_MAX);
|
||||
mTextColors[type] = value;
|
||||
|
||||
@@ -157,11 +157,15 @@ namespace nw4r {
|
||||
y = pF[1];
|
||||
z = pF[2];
|
||||
}
|
||||
#if defined(IPL_SD_CHANNEL_SELECT_CPP)
|
||||
VEC3(f32 fx, f32 fy, f32 fz);
|
||||
#else
|
||||
VEC3(f32 fx, f32 fy, f32 fz) {
|
||||
x = fx;
|
||||
y = fy;
|
||||
z = fz;
|
||||
}
|
||||
#endif
|
||||
|
||||
operator Vec*() { return reinterpret_cast<Vec*>(this); }
|
||||
operator const Vec*() const { return reinterpret_cast<const Vec*>(this); }
|
||||
|
||||
@@ -8,8 +8,13 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
void __VISetRGBModeImm();
|
||||
#ifdef VI_MATCHING_SOURCE
|
||||
BOOL __VIResetRFIdle();
|
||||
BOOL __VIResetSIIdle();
|
||||
#else
|
||||
void __VIResetRFIdle();
|
||||
void __VIResetSIIdle();
|
||||
#endif
|
||||
|
||||
void __VIGetCurrentPosition(s16* x, s16* y);
|
||||
|
||||
|
||||
@@ -27,8 +27,13 @@ void VISetNextFrameBuffer(void* fb);
|
||||
void VISetBlack(BOOL setBlack);
|
||||
|
||||
void VISetTrapFilter(BOOL setTrap);
|
||||
#ifdef VI_MATCHING_SOURCE
|
||||
BOOL VIResetDimmingCount();
|
||||
BOOL VIEnableDimming(BOOL enableDim);
|
||||
#else
|
||||
void VIResetDimmingCount();
|
||||
void VIEnableDimming(BOOL enableDim);
|
||||
#endif
|
||||
|
||||
u32 VIGetRetraceCount();
|
||||
u32 VIGetDTVStatus();
|
||||
|
||||
1482
libs/RVL_SDK/src/fa/driver/sd_drv.c
Normal file
1482
libs/RVL_SDK/src/fa/driver/sd_drv.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -178,7 +178,7 @@ PFDIR_SDD* PFDIR_GetSDD(PF_VOLUME* volume, PF_DIR_ENT* entry) {
|
||||
pf_s32 remaining = 3;
|
||||
|
||||
for (i = 0; remaining != 0; i++, free_candidate++, remaining--) {
|
||||
if ((volume_dirs->sdds[i].stat & 1) == 0) {
|
||||
if ((volume_dirs->sdds[i].stat & 1) == 0 || (volume_dirs->sdds[i].stat & 2) == 0) {
|
||||
if (first_free_sdd == 0) {
|
||||
first_free_sdd = free_candidate;
|
||||
}
|
||||
@@ -209,18 +209,19 @@ pf_s32 PFDIR_DoFsexecOpenDir(PF_DIR_ENT* entry, PF_ENT_ITER* iter, PFDIR_DIR** o
|
||||
if ((entry->attr & 0x10) == 0) {
|
||||
return 0x14;
|
||||
}
|
||||
sdd = PFDIR_GetSDD(entry->p_vol, entry);
|
||||
sdd = PFDIR_GetSDD((PF_VOLUME*)volume_dirs, entry);
|
||||
if (sdd == 0) {
|
||||
return 0x15;
|
||||
}
|
||||
dir = 0;
|
||||
scan_dir = volume_dirs->udds;
|
||||
for (i = 0; i < 3; i++, scan_dir++) {
|
||||
if ((scan_dir->stat & 1) == 0) {
|
||||
dir = &volume_dirs->udds[i];
|
||||
break;
|
||||
goto directory_available;
|
||||
}
|
||||
}
|
||||
dir = 0;
|
||||
directory_available:
|
||||
if (dir == 0) {
|
||||
return 0x16;
|
||||
}
|
||||
@@ -240,8 +241,8 @@ pf_s32 PFDIR_p_opendir(PF_VOLUME* volume, PFDIR_STR* path, PFDIR_DIR** opened_di
|
||||
PF_DIR_ENT entry;
|
||||
PFDIR_SDD* sdd;
|
||||
PFDIR_DIR* dir;
|
||||
pf_s32 error;
|
||||
pf_s32 i;
|
||||
pf_s32 error;
|
||||
|
||||
if ((PFSTR_StrNCmp(path, (const pf_s8*)"\\", 1, 0, 1) == 0 ||
|
||||
PFSTR_StrNCmp(path, (const pf_s8*)"/", 1, 0, 1) == 0) &&
|
||||
@@ -287,16 +288,15 @@ open_directory:
|
||||
if (sdd == 0) {
|
||||
return 0x15;
|
||||
}
|
||||
dir = ((PFDIR_VOLUME_DIRS*)volume)->udds;
|
||||
i = 0;
|
||||
do {
|
||||
if ((dir->stat & 1) == 0) {
|
||||
break;
|
||||
for (i = 0; i < 3; i++) {
|
||||
if ((((PFDIR_VOLUME_DIRS*)volume)->udds[i].stat & 1) == 0) {
|
||||
dir = &((PFDIR_VOLUME_DIRS*)volume)->udds[i];
|
||||
goto directory_available;
|
||||
}
|
||||
i++;
|
||||
dir++;
|
||||
} while (i < 3);
|
||||
if (i == 3) {
|
||||
}
|
||||
dir = 0;
|
||||
directory_available:
|
||||
if (dir == 0) {
|
||||
return 0x16;
|
||||
}
|
||||
dir->p_sdd = sdd;
|
||||
@@ -356,6 +356,7 @@ pf_s32 PFDIR_p_mkdir(PF_VOLUME* p_vol, PF_STR* p_path, pf_u32 option, PF_DTA* p_
|
||||
pf_u16 dirname_len;
|
||||
PF_DIR_ENT entry;
|
||||
PF_DIR_ENT parent_entry;
|
||||
PF_ENT_ITER parent_iter;
|
||||
PF_FFD ffd;
|
||||
pf_u32 pos;
|
||||
PF_FAT_HINT fat_hint;
|
||||
@@ -371,12 +372,13 @@ pf_s32 PFDIR_p_mkdir(PF_VOLUME* p_vol, PF_STR* p_path, pf_u32 option, PF_DTA* p_
|
||||
if (err != 0) {
|
||||
return err;
|
||||
}
|
||||
err = VFiPFENT_GetParentEntryOfPath(&parent_entry, p_vol, &full_path);
|
||||
err = PFENT_ITER_GetEntryOfPath(&parent_iter, &parent_entry, p_vol,
|
||||
(PFDIR_STR*)&full_path, 1);
|
||||
if (err != 0) {
|
||||
return err;
|
||||
}
|
||||
if ((parent_entry.attr & 0x10) == 0) {
|
||||
err = 0x14;
|
||||
return 0x14;
|
||||
}
|
||||
if (p_dta != PF_NULL) {
|
||||
p_dta->parent_start_cluster = parent_entry.start_cluster;
|
||||
@@ -682,8 +684,6 @@ extern pf_s32 PFCACHE_FlushFATCache(PF_VOLUME* volume);
|
||||
extern pf_s32 PFDIR_p_fsfirst(PF_VOLUME* volume, PF_STR* path, pf_u8 attributes, PF_DTA* data);
|
||||
extern pf_s32 PFDIR_p_fsnext(PF_DTA* data);
|
||||
extern pf_s32 PFDIR_p_fsexec(PF_DTA* data, pf_u32 flags, pf_u32 mode);
|
||||
extern pf_s32 PFDIR_p_rename(PF_VOLUME* volume, PF_STR* old_path, PF_STR* new_path);
|
||||
extern pf_s32 PFDIR_p_move(PF_VOLUME* volume, PF_STR* old_path, PF_STR* new_path);
|
||||
extern pf_s32 PFDIR_p_fsexec_chmod(PF_DTA* data, PF_DIR_ENT* entry, pf_u32 attributes, pf_u32 mode);
|
||||
extern pf_s32 PFDIR_p_fsexec_remove(PF_DTA* data, PF_DIR_ENT* entry, PF_ENT_ITER* iter);
|
||||
extern pf_s32 PFDIR_p_fsexec_fopen(PF_DTA* data, PF_DIR_ENT* entry, PF_ENT_ITER* iter, pf_u32 flags,
|
||||
@@ -692,9 +692,12 @@ extern pf_s32 PFDIR_p_fsexec_opendir(PF_DTA* data, PF_DIR_ENT* entry, PF_ENT_ITE
|
||||
extern void PFFAT_FinalizeFFD(PF_FFD* ffd);
|
||||
extern pf_s32 PFENT_ITER_GetEntryOfPattern(PF_ENT_ITER* iter, PF_DIR_ENT* entry, PF_VOLUME* volume,
|
||||
PFDIR_STR* directory);
|
||||
extern pf_s32 PFENT_ITER_FindEntry(PF_ENT_ITER* iter, PF_DIR_ENT* entry, PFDIR_STR* pattern,
|
||||
pf_u8 attributes, pf_u32 start, pf_u32* found);
|
||||
extern pf_s32 PFENT_findEntry(PFDIR_FFD* ffd, PF_DIR_ENT* entry, pf_u32 start, PFDIR_STR* pattern,
|
||||
pf_u8 attributes, pf_u32* logical_position, pf_u32* entry_position);
|
||||
extern pf_u32 PFSTR_GetCodeMode(PFDIR_STR* path);
|
||||
extern const pf_s8* PFSTR_GetStrPos(PFDIR_STR* path, pf_u32 target);
|
||||
extern pf_s32 PFPATH_SplitPathPattern(PF_STR* path, PFDIR_STR* directory, PFDIR_STR* pattern);
|
||||
extern void PFPATH_SetSearchPattern(pf_s8* ansi_pattern, pf_u16* unicode_pattern, PFDIR_STR* pattern);
|
||||
extern pf_u16* pf_w_strcpy(pf_u16* destination, const pf_u16* source);
|
||||
@@ -706,6 +709,201 @@ extern pf_s32 PFFILE_FsexecOpenFile(PF_DIR_ENT* entry, PF_ENT_ITER* iter, pf_u32
|
||||
extern pf_s32 PFPATH_cmpName(const pf_s8* short_name, PFDIR_STR* pattern, pf_u32 short_search);
|
||||
extern pf_s32 PFPATH_cmpNameUni(const pf_u16* name, PFDIR_STR* pattern);
|
||||
|
||||
pf_s32 PFDIR_p_rename(PF_VOLUME* volume, PF_STR* old_path, PF_STR* new_path) {
|
||||
PF_ENT_ITER source_iter;
|
||||
PF_ENT_ITER destination_iter;
|
||||
PF_DIR_ENT source_entry;
|
||||
PF_DIR_ENT source_parent;
|
||||
PF_DIR_ENT destination_parent;
|
||||
PF_DIR_ENT existing_entry;
|
||||
PFDIR_STR source_directory;
|
||||
PFDIR_STR source_name;
|
||||
PFDIR_STR destination_directory;
|
||||
PFDIR_STR destination_name;
|
||||
pf_s8 normalized_name[512];
|
||||
const pf_s8* name;
|
||||
pf_u32 entry_position;
|
||||
pf_s32 error;
|
||||
|
||||
error = PFPATH_SplitPath((PFDIR_STR*)old_path, &source_directory, &source_name);
|
||||
if (error != 0) {
|
||||
return error;
|
||||
}
|
||||
if (PFSTR_GetCodeMode(&source_name) == 2) {
|
||||
if (PFSTR_StrNumChar(&source_name, 1) > 0xFF) {
|
||||
return 1;
|
||||
}
|
||||
error = PFPATH_transformFromUnicodeToNormal(
|
||||
normalized_name, (const pf_u16*)PFSTR_GetStrPos(&source_name, 1));
|
||||
if (error != 0) {
|
||||
return error;
|
||||
}
|
||||
PFSTR_SetLocalStr(&source_name, (pf_u32)normalized_name);
|
||||
}
|
||||
error = PFENT_ITER_GetEntryOfPath(&source_iter, &source_parent, volume,
|
||||
&source_directory, 1);
|
||||
if (error != 0) {
|
||||
return error;
|
||||
}
|
||||
PFFAT_InitFFD(&source_iter.ffd, 0, volume, &source_parent.start_cluster);
|
||||
error = PFENT_ITER_IteratorInitialize(&source_iter, 0);
|
||||
if (error != 0) {
|
||||
return error;
|
||||
}
|
||||
error = PFENT_ITER_FindEntry(&source_iter, &source_entry, &source_name, 0x7F, 0,
|
||||
&entry_position);
|
||||
if (error != 0) {
|
||||
return error;
|
||||
}
|
||||
if (entry_position == 0) {
|
||||
return 3;
|
||||
}
|
||||
if ((source_entry.attr & 0x10) != 0) {
|
||||
return 3;
|
||||
}
|
||||
if ((source_entry.attr & 1) != 0) {
|
||||
return 0x18;
|
||||
}
|
||||
if (PFSTR_StrNCmp((PFDIR_STR*)new_path, (const pf_s8*)":", 1, 1, 1) == 0 &&
|
||||
PFPATH_GetVolumeFromPath(new_path) != volume) {
|
||||
return 0x1F;
|
||||
}
|
||||
error = PFPATH_SplitPath((PFDIR_STR*)new_path, &destination_directory,
|
||||
&destination_name);
|
||||
if (error != 0) {
|
||||
return error;
|
||||
}
|
||||
error = PFENT_ITER_GetEntryOfPath(&destination_iter, &destination_parent, volume,
|
||||
&destination_directory, 1);
|
||||
if (error != 0) {
|
||||
return error;
|
||||
}
|
||||
if ((destination_parent.attr & 0x10) == 0) {
|
||||
return 0x14;
|
||||
}
|
||||
if (source_iter.ffd.start_cluster != destination_parent.start_cluster) {
|
||||
return 0x1F;
|
||||
}
|
||||
if (PFSTR_GetCodeMode(&destination_name) == 2) {
|
||||
if (PFSTR_StrNumChar(&destination_name, 1) > 0xFF) {
|
||||
return 1;
|
||||
}
|
||||
error = PFPATH_transformFromUnicodeToNormal(
|
||||
normalized_name, (const pf_u16*)PFSTR_GetStrPos(&destination_name, 1));
|
||||
if (error != 0) {
|
||||
return error;
|
||||
}
|
||||
PFSTR_SetLocalStr(&destination_name, (pf_u32)normalized_name);
|
||||
}
|
||||
name = PFSTR_GetStrPos(&destination_name, 1);
|
||||
error = PFENT_ITER_FindEntry(&destination_iter, &existing_entry, &destination_name,
|
||||
0x7F, 0, &entry_position);
|
||||
if (error == 0) {
|
||||
return 8;
|
||||
}
|
||||
if (error != 3) {
|
||||
return error;
|
||||
}
|
||||
error = PFPATH_parseShortName(&source_entry, name);
|
||||
if (error != 0) {
|
||||
return error;
|
||||
}
|
||||
source_entry.long_name[0] = 0;
|
||||
return PFENT_updateEntry(&source_entry, 1);
|
||||
}
|
||||
|
||||
pf_s32 PFDIR_p_move(PF_VOLUME* volume, PF_STR* old_path, PF_STR* new_path) {
|
||||
PF_ENT_ITER source_iter;
|
||||
PF_ENT_ITER destination_iter;
|
||||
PF_DIR_ENT source_entry;
|
||||
PF_DIR_ENT destination_entry;
|
||||
PF_DIR_ENT existing_entry;
|
||||
PFDIR_STR destination_directory;
|
||||
PFDIR_STR destination_name;
|
||||
PFDIR_VOLUME_DIRS* volume_dirs;
|
||||
pf_s8 normalized_name[512];
|
||||
pf_u32 entry_position;
|
||||
pf_u32 index;
|
||||
pf_s32 error;
|
||||
|
||||
error = PFENT_ITER_GetEntryOfPath(&source_iter, &source_entry, volume,
|
||||
(PFDIR_STR*)old_path, 0);
|
||||
if (error != 0) {
|
||||
return error;
|
||||
}
|
||||
if (PFPATH_GetVolumeFromPath(new_path) != volume) {
|
||||
return 0x1F;
|
||||
}
|
||||
error = PFPATH_SplitPath((PFDIR_STR*)new_path, &destination_directory,
|
||||
&destination_name);
|
||||
if (error != 0) {
|
||||
return error;
|
||||
}
|
||||
if (PFSTR_GetCodeMode(&destination_name) == 2) {
|
||||
if (PFSTR_StrNumChar(&destination_name, 1) > 0xFF) {
|
||||
return 1;
|
||||
}
|
||||
error = PFPATH_transformFromUnicodeToNormal(
|
||||
normalized_name, (const pf_u16*)PFSTR_GetStrPos(&destination_name, 1));
|
||||
if (error != 0) {
|
||||
return error;
|
||||
}
|
||||
PFSTR_SetLocalStr(&destination_name, (pf_u32)normalized_name);
|
||||
}
|
||||
error = PFENT_ITER_GetEntryOfPath(&destination_iter, &destination_entry, volume,
|
||||
&destination_directory, 1);
|
||||
if (error != 0) {
|
||||
return error;
|
||||
}
|
||||
if ((destination_entry.attr & 0x10) == 0) {
|
||||
return 0x14;
|
||||
}
|
||||
if ((source_entry.attr & 1) != 0) {
|
||||
return 0x18;
|
||||
}
|
||||
volume_dirs = (PFDIR_VOLUME_DIRS*)volume;
|
||||
if ((source_entry.attr & 0x10) != 0) {
|
||||
if (PFVOL_CheckCurrentDir(volume, source_entry.start_cluster) != 0 ||
|
||||
source_entry.start_cluster == 1 ||
|
||||
(volume->bpb.fat_type == FAT_32 &&
|
||||
source_entry.start_cluster == volume->bpb.root_dir_cluster)) {
|
||||
return 0x1C;
|
||||
}
|
||||
for (index = 0; index < 3; index++) {
|
||||
PFDIR_SDD* sdd = &volume_dirs->sdds[index];
|
||||
if ((sdd->stat & 1) != 0 && (sdd->stat & 2) != 0 &&
|
||||
sdd->dir_entry.p_vol == source_entry.p_vol &&
|
||||
sdd->dir_entry.entry_sector == source_entry.entry_sector &&
|
||||
sdd->dir_entry.entry_offset == source_entry.entry_offset) {
|
||||
return 0x13;
|
||||
}
|
||||
}
|
||||
} else if (PFFILE_IsOpened(&source_entry) != 0) {
|
||||
return 0x13;
|
||||
}
|
||||
PFFAT_InitFFD(&destination_iter.ffd, 0, volume, &destination_entry.start_cluster);
|
||||
error = PFENT_ITER_IteratorInitialize(&destination_iter, 0);
|
||||
if (error != 0) {
|
||||
return error;
|
||||
}
|
||||
error = PFENT_ITER_FindEntry(&destination_iter, &existing_entry, &destination_name,
|
||||
0x7F, 0, &entry_position);
|
||||
if (error == 0) {
|
||||
if (source_entry.entry_sector == existing_entry.entry_sector &&
|
||||
source_entry.entry_offset == existing_entry.entry_offset) {
|
||||
return 0;
|
||||
}
|
||||
return 8;
|
||||
}
|
||||
if (error != 3) {
|
||||
return error;
|
||||
}
|
||||
if (source_iter.ffd.start_cluster != destination_entry.start_cluster) {
|
||||
return 0x1F;
|
||||
}
|
||||
return PFDIR_p_rename(volume, old_path, new_path);
|
||||
}
|
||||
|
||||
pf_s32 PFDIR_p_fsexec_remove(PF_DTA* data, PF_DIR_ENT* entry, PF_ENT_ITER* iter) {
|
||||
PFDIR_VOLUME_DIRS* volume_dirs = (PFDIR_VOLUME_DIRS*)entry->p_vol;
|
||||
PFDIR_FAT_HINT hint;
|
||||
@@ -1118,7 +1316,7 @@ void PFDIR_opendir(PF_STR* path, PFDIR_DIR** dir) {
|
||||
pf_vol_set.last_error = error;
|
||||
((PFDIR_VOLUME_DIRS*)volume)->last_error = error;
|
||||
} else {
|
||||
volume_dirs->num_opened_directories++;
|
||||
((PFDIR_VOLUME_DIRS*)volume)->num_opened_directories++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1180,11 +1378,13 @@ pf_s32 PFDIR_telldir(PFDIR_DIR* dir, pf_u32* position) {
|
||||
} else {
|
||||
sdd = dir->p_sdd;
|
||||
if ((sdd->stat & 1) == 0 || (sdd->stat & 2) == 0) {
|
||||
pf_vol_set.last_error = 10;
|
||||
((PFDIR_VOLUME_DIRS*)volume)->last_error = 10;
|
||||
error = 10;
|
||||
pf_vol_set.last_error = error;
|
||||
((PFDIR_VOLUME_DIRS*)volume)->last_error = error;
|
||||
} else if (dir->end_position != 0) {
|
||||
*position = dir->end_position;
|
||||
} else {
|
||||
*position = dir->end_position != 0 ? dir->end_position : dir->next_position;
|
||||
*position = dir->next_position;
|
||||
}
|
||||
}
|
||||
return error;
|
||||
@@ -1198,9 +1398,9 @@ pf_s32 PFDIR_seekdir(PFDIR_DIR* dir, pf_u32 position) {
|
||||
pf_vol_set.last_error = error;
|
||||
((PFDIR_VOLUME_DIRS*)volume)->last_error = error;
|
||||
} else if ((dir->p_sdd->stat & 1) == 0 || (dir->p_sdd->stat & 2) == 0) {
|
||||
pf_vol_set.last_error = 10;
|
||||
((PFDIR_VOLUME_DIRS*)volume)->last_error = 10;
|
||||
error = 10;
|
||||
pf_vol_set.last_error = error;
|
||||
((PFDIR_VOLUME_DIRS*)volume)->last_error = error;
|
||||
} else {
|
||||
dir->end_position = position;
|
||||
}
|
||||
|
||||
2123
libs/RVL_SDK/src/fa/pf_fat.c
Normal file
2123
libs/RVL_SDK/src/fa/pf_fat.c
Normal file
File diff suppressed because it is too large
Load Diff
2241
libs/RVL_SDK/src/fa/pf_file.c
Normal file
2241
libs/RVL_SDK/src/fa/pf_file.c
Normal file
File diff suppressed because it is too large
Load Diff
1110
libs/RVL_SDK/src/fa/pf_path.c
Normal file
1110
libs/RVL_SDK/src/fa/pf_path.c
Normal file
File diff suppressed because it is too large
Load Diff
2134
libs/RVL_SDK/src/fa/pf_volume.c
Normal file
2134
libs/RVL_SDK/src/fa/pf_volume.c
Normal file
File diff suppressed because it is too large
Load Diff
1476
libs/RVL_SDK/src/nup/nup.cpp
Normal file
1476
libs/RVL_SDK/src/nup/nup.cpp
Normal file
File diff suppressed because it is too large
Load Diff
1473
libs/RVL_SDK/src/vi/vi.c
Normal file
1473
libs/RVL_SDK/src/vi/vi.c
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
182
libs/RevoEX/include/private/nhttp.h
Normal file
182
libs/RevoEX/include/private/nhttp.h
Normal file
@@ -0,0 +1,182 @@
|
||||
#ifndef PRIVATE_NHTTP_H
|
||||
#define PRIVATE_NHTTP_H
|
||||
|
||||
#include <revolution/nhttp.h>
|
||||
#include <revolution/os.h>
|
||||
#include <revolution/ssl.h>
|
||||
|
||||
#define STR_POSTBOUND "--t9Sf4yfjf1RtvDu3AA"
|
||||
#define LEN_POSTBOUND 18
|
||||
#define LEN_URLBUF 256
|
||||
#define MIN(AA, BB) (((AA) > (BB)) ? (BB) : (AA))
|
||||
|
||||
typedef struct NHTTPBgnEndInfo NHTTPBgnEndInfo;
|
||||
typedef struct NHTTPRequestInfo NHTTPRequestInfo;
|
||||
#define NHTTP_CONN_RECVBUF_SIZE 0x8000
|
||||
|
||||
typedef struct NHTTPConnectionInfo NHTTPConnectionInfo;
|
||||
|
||||
typedef enum NHTTPConnectionEvent
|
||||
{
|
||||
NHTTP_EVENT_NONE,
|
||||
NHTTP_EVENT_POST_SEND,
|
||||
NHTTP_EVENT_BODY_RECV_FULL,
|
||||
NHTTP_EVENT_BODY_RECV_DONE,
|
||||
NHTTP_EVENT_COMPLETE,
|
||||
NHTTP_CALLBACK_EVENT_MAX,
|
||||
} NHTTPConnectionEvent;
|
||||
|
||||
typedef s32 (*NHTTPConnectionCallback)(NHTTPConnectionInfo* connection,
|
||||
NHTTPConnectionEvent event, void* arg);
|
||||
|
||||
typedef struct NHTTPConnectionCallbackParam
|
||||
{
|
||||
void* value;
|
||||
u32 _unk4;
|
||||
u32 _unk8;
|
||||
u32 _unkC;
|
||||
} NHTTPConnectionCallbackParam;
|
||||
|
||||
typedef struct NHTTPPostSendArg
|
||||
{
|
||||
const char* label;
|
||||
char* buf;
|
||||
u32 size;
|
||||
u32 offset;
|
||||
} NHTTPPostSendArg;
|
||||
|
||||
typedef struct NHTTPBodyBufArg
|
||||
{
|
||||
char* buf;
|
||||
u32 size;
|
||||
u32 offset;
|
||||
} NHTTPBodyBufArg;
|
||||
|
||||
typedef struct NHTTPHeader
|
||||
{
|
||||
struct NHTTPHeader* next;
|
||||
struct NHTTPHeader* prev;
|
||||
char* name;
|
||||
char* value;
|
||||
u32 length;
|
||||
u32 _unk14;
|
||||
} NHTTPHeader;
|
||||
|
||||
typedef struct NHTTPReqQueue
|
||||
{
|
||||
struct NHTTPReqQueue* next;
|
||||
struct NHTTPReqQueue* prev;
|
||||
s32 requestId;
|
||||
NHTTPRequestInfo* volatile request;
|
||||
s32 _unk10;
|
||||
} NHTTPReqQueue;
|
||||
|
||||
typedef struct NHTTPListInfo
|
||||
{
|
||||
NHTTPReqQueue* reqQueue;
|
||||
s32 nextRequestId;
|
||||
} NHTTPListInfo;
|
||||
|
||||
typedef struct NHTTPReqInfo
|
||||
{
|
||||
NHTTPReqQueue* reqQueue;
|
||||
} NHTTPReqInfo;
|
||||
|
||||
typedef struct NHTTPi_HDRBUFLIST
|
||||
{
|
||||
struct NHTTPi_HDRBUFLIST* next_p;
|
||||
u8 block[NHTTP_HDRRECVBUF_BLOCKLEN];
|
||||
} NHTTPi_HDRBUFLIST;
|
||||
|
||||
typedef struct NHTTPResponseInfo
|
||||
{
|
||||
volatile s32 headerLen;
|
||||
volatile s32 bodyLen;
|
||||
volatile s32 totalBodyLen;
|
||||
volatile s32 contentLength;
|
||||
s32 isSuccess;
|
||||
s32 isHeaderParse;
|
||||
s32 httpStatus;
|
||||
u32 recvBufLen;
|
||||
char* allHeader_p;
|
||||
char* foundHeader_p;
|
||||
char* recvBuf_p;
|
||||
NHTTPResponseCallback bufFull;
|
||||
NHTTPResponseCleanup freeBuf;
|
||||
NHTTPi_HDRBUFLIST* hdrBufBlock_p;
|
||||
u8 hdrBufFirst[NHTTP_HDRRECVBUF_INILEN];
|
||||
void* param_p;
|
||||
} NHTTPResponseInfo;
|
||||
|
||||
struct NHTTPRequestInfo
|
||||
{
|
||||
BOOL cancel;
|
||||
s32 state;
|
||||
BOOL secure;
|
||||
BOOL proxyEnabled;
|
||||
BOOL isRawData;
|
||||
s32 hostEnd;
|
||||
s32 pathStart;
|
||||
s32 method;
|
||||
u32 port;
|
||||
char* url;
|
||||
char* host;
|
||||
NHTTPResponseInfo* response;
|
||||
NHTTPHeader* headers;
|
||||
NHTTPHeader* postData;
|
||||
char multipartBoundary[LEN_POSTBOUND + 2];
|
||||
char authorization[0x5C];
|
||||
s32 authorizationLength;
|
||||
SSLId sslId;
|
||||
const char* clientCertData;
|
||||
u32 clientCertSize;
|
||||
const char* privateKeyData;
|
||||
u32 privateKeySize;
|
||||
const char* rootCAData;
|
||||
u32 rootCASize;
|
||||
BOOL clientCertDefault;
|
||||
u32 verifyOption;
|
||||
NHTTPEncodingType encodingType;
|
||||
void* _unkD4;
|
||||
u32 builtinRootCA;
|
||||
u32 builtinClientCert;
|
||||
char proxyServer[0x100];
|
||||
u32 proxyPort;
|
||||
char proxyAuthorization[0x5C];
|
||||
s32 proxyAuthorizationLength;
|
||||
u32 recvBufferSize;
|
||||
const void* postBuffer;
|
||||
u32 postBufferSize;
|
||||
void* _unk250;
|
||||
};
|
||||
|
||||
struct NHTTPConnectionInfo
|
||||
{
|
||||
BOOL started;
|
||||
s32 state;
|
||||
s32 sslError;
|
||||
u32 _unkC;
|
||||
NHTTPRequestInfo* request;
|
||||
NHTTPResponseInfo* response;
|
||||
s32 requestId;
|
||||
NHTTPConnectionCallback callback;
|
||||
NHTTPConnectionInfo* next;
|
||||
u32 _unk24;
|
||||
u32 _unk28;
|
||||
u32 virtualContentLength;
|
||||
NHTTPReqCallback requestCallback;
|
||||
u32 _unk34;
|
||||
u32 _unk38;
|
||||
u32 _unk3C;
|
||||
u8 recvBuf[0x8000];
|
||||
u32 recvBufOffset;
|
||||
u32 recvBufDataLen;
|
||||
u32 _unk8048;
|
||||
u32 _unk804C;
|
||||
u32 _unk8050;
|
||||
u32 _unk8054;
|
||||
u32 _unk8058;
|
||||
u32 _unk805C;
|
||||
};
|
||||
|
||||
#endif // PRIVATE_NHTTP_H
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
#ifndef REVOLUTION_NHTTP_H
|
||||
#define REVOLUTION_NHTTP_H
|
||||
|
||||
@@ -6,49 +5,80 @@
|
||||
|
||||
#include <revolution/nhttp/nhttp_err.h>
|
||||
|
||||
#define NHTTP_HDRRECVBUF_INILEN 1024
|
||||
#define NHTTP_HDRRECVBUF_BLOCKSHIFT 9
|
||||
#define NHTTP_HDRRECVBUF_BLOCKLEN (1 << NHTTP_HDRRECVBUF_BLOCKSHIFT)
|
||||
#define NHTTP_HDRRECVBUF_BLOCKMASK (NHTTP_HDRRECVBUF_BLOCKLEN - 1)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
typedef struct {
|
||||
u8 dummy[1];
|
||||
} NHTTPRequest;
|
||||
typedef struct {
|
||||
u8 dummy[1];
|
||||
} NHTTPResponse;
|
||||
|
||||
typedef int NHTTPConnection;
|
||||
|
||||
typedef void* (*NHTTPAlloc)(u32 size, int align);
|
||||
typedef void (*NHTTPFree)(void* buf);
|
||||
|
||||
typedef void (*NHTTPRequestCallback)(int, NHTTPResponse*);
|
||||
typedef void (*NHTTPCleanupCallback)();
|
||||
|
||||
int NHTTPStartup(NHTTPAlloc alloc, NHTTPFree free, u32 priority);
|
||||
int NHTTPCleanupAsync(NHTTPCleanupCallback);
|
||||
int NHTTPGetError();
|
||||
typedef struct NHTTPRequestInfo NHTTPRequest;
|
||||
typedef struct NHTTPResponseInfo NHTTPResponse;
|
||||
typedef s32 NHTTPConnection;
|
||||
|
||||
NHTTPRequest* NHTTPCreateRequest(char* url, undefined4, void* buf, u32 bufSize, NHTTPRequestCallback reqCallback, undefined4);
|
||||
NHTTPRequest* NHTTPCreateRequestEx(char* url, undefined4, void* buf, u32 bufSize, NHTTPRequestCallback reqCallback, undefined4, undefined4,
|
||||
undefined4);
|
||||
int NHTTPDeleteRequest(NHTTPRequest* request);
|
||||
typedef enum NHTTPReqMethod {
|
||||
NHTTP_REQMETHOD_GET,
|
||||
NHTTP_REQMETHOD_POST,
|
||||
NHTTP_REQMETHOD_HEAD,
|
||||
} NHTTPReqMethod;
|
||||
|
||||
typedef enum NHTTPEncodingType {
|
||||
NHTTP_ENCODING_TYPE_AUTO,
|
||||
NHTTP_ENCODING_TYPE_URL,
|
||||
NHTTP_ENCODING_TYPE_MULTIPART,
|
||||
NHTTP_ENCODING_TYPE_MAX,
|
||||
} NHTTPEncodingType;
|
||||
|
||||
typedef void (*NHTTPReqCallback)();
|
||||
typedef void* (*NHTTPResponseCallback)(void** buffer, void* data,
|
||||
u32 contentLength, NHTTPAlloc alloc,
|
||||
NHTTPFree free, void* userParam);
|
||||
typedef void (*NHTTPResponseCleanup)(void* buffer, NHTTPFree free,
|
||||
void* userParam);
|
||||
|
||||
s32 NHTTPStartup(NHTTPAlloc alloc, NHTTPFree free, u32 priority);
|
||||
void NHTTPCleanupAsync(NHTTPCleanupCallback callback);
|
||||
s32 NHTTPGetError(void);
|
||||
|
||||
NHTTPRequest* NHTTPCreateRequest(const char* url, NHTTPReqMethod method,
|
||||
void* buffer, u32 bufferSize,
|
||||
NHTTPReqCallback callback, void* userParam);
|
||||
NHTTPRequest* NHTTPCreateRequestEx(const char* url, NHTTPReqMethod method,
|
||||
void* buffer, u32 bufferSize,
|
||||
NHTTPReqCallback callback, void* userParam,
|
||||
NHTTPResponseCallback responseCallback,
|
||||
NHTTPResponseCleanup cleanup);
|
||||
s32 NHTTPAddHeaderField(NHTTPRequest* request, const char* name,
|
||||
const char* value);
|
||||
s32 NHTTPAddPostDataRaw(NHTTPRequest* request, const void* data,
|
||||
u32 size, const char* label);
|
||||
s32 NHTTPDeleteRequest(NHTTPRequest* request);
|
||||
|
||||
NHTTPConnection NHTTPSendRequestAsync(NHTTPRequest* request);
|
||||
int NHTTPCancelRequestAsync(NHTTPConnection connection);
|
||||
s32 NHTTPCancelRequestAsync(NHTTPConnection connection);
|
||||
|
||||
void NHTTPGetProgress(u32* complete, u32* total);
|
||||
s32 NHTTPGetProgress(u32* complete, u32* total);
|
||||
|
||||
int NHTTPDestroyResponse(NHTTPResponse* response);
|
||||
u32 NHTTPGetHeaderField(NHTTPResponse* response, const char* name, const char** value);
|
||||
void NHTTPDestroyResponse(NHTTPResponse* response);
|
||||
s32 NHTTPGetHeaderAll(NHTTPResponse* response, const char** header);
|
||||
s32 NHTTPGetHeaderField(NHTTPResponse* response, const char* name,
|
||||
const char** value);
|
||||
|
||||
int NHTTPGetResultCode(NHTTPResponse* res);
|
||||
s32 NHTTPGetBodyAll(NHTTPResponse* response, void** buffer);
|
||||
s32 NHTTPGetResultCode(NHTTPResponse* response);
|
||||
|
||||
int NHTTPSetVerifyOption(NHTTPRequest* request, u32 option);
|
||||
|
||||
int NHTTPSetProxyDefault(NHTTPRequest* request);
|
||||
int NHTTPSetRootCADefault(NHTTPRequest* request);
|
||||
int NHTTPSetClientCertDefault(NHTTPRequest* request);
|
||||
s32 NHTTPSetVerifyOption(NHTTPRequest* request, u32 option);
|
||||
s32 NHTTPSetProxy(NHTTPRequest* request, const char* server, u16 port,
|
||||
const char* username, const char* password);
|
||||
s32 NHTTPSetProxyDefault(NHTTPRequest* request);
|
||||
s32 NHTTPSetClientCertDefault(NHTTPRequest* request);
|
||||
s32 NHTTPSetRootCADefault(NHTTPRequest* request);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -102,13 +102,16 @@ struct SOAddrInfo {
|
||||
SOAddrInfo* next; // 0x20
|
||||
};
|
||||
|
||||
#define SO_ENOTCONN -56
|
||||
|
||||
int SOSocket(int pf, int type, int protocol);
|
||||
int __SOCreateSocket(int pf, int type, int protocol);
|
||||
int SOClose(int s);
|
||||
|
||||
int SOConnect(int s, void* sockAddr);
|
||||
|
||||
int SORecv(int s, void* buf, int len, int flags);
|
||||
int SOSend(int s, void* buf, int len, int flags);
|
||||
int SOSend(int s, const void* buf, int len, int flags);
|
||||
int SOFcntl(int s, int cmd, ...);
|
||||
|
||||
int SOShutdown(int s, int how);
|
||||
|
||||
@@ -14,6 +14,7 @@ typedef struct IPAddrEntry {
|
||||
} IPAddrEntry;
|
||||
|
||||
int SOGetInterfaceOpt(void* unk, int level, int optname, void* optval, int* optlen);
|
||||
int SOSetSockOpt(int s, int level, int optname, const void* optval, int optlen);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
33
libs/RevoEX/src/net/nettime.c
Normal file
33
libs/RevoEX/src/net/nettime.c
Normal file
@@ -0,0 +1,33 @@
|
||||
#include <revolution/net.h>
|
||||
|
||||
#include <private/nwc24.h>
|
||||
#include <private/os.h>
|
||||
|
||||
#include <revolution/NWC24.h>
|
||||
#include <revolution/OS.h>
|
||||
|
||||
NWC24Err NWC24iEpochSecondsToDate(NWC24Date* date, OSTime time);
|
||||
NWC24Err NWC24iDateToOSCalendarTime(OSCalendarTime* cal, const NWC24Date* date);
|
||||
|
||||
BOOL NETGetUniversalCalendar(OSCalendarTime* pTime) {
|
||||
static s64 whenCached = 0;
|
||||
NWC24Date date;
|
||||
s64 universalTime;
|
||||
|
||||
if (whenCached == 0 ||
|
||||
whenCached + OSSecondsToTicks(60) < __OSGetSystemTime()) {
|
||||
|
||||
NWC24iSynchronizeRtcCounter(FALSE);
|
||||
whenCached = __OSGetSystemTime();
|
||||
}
|
||||
|
||||
if (NWC24iGetUniversalTime(&universalTime) >= 0 &&
|
||||
NWC24iEpochSecondsToDate(&date, universalTime) >= 0 &&
|
||||
NWC24iDateToOSCalendarTime(pTime, &date) >= 0) {
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
OSTicksToCalendarTime(OSGetTime(), pTime);
|
||||
return FALSE;
|
||||
}
|
||||
179
libs/RevoEX/src/nhttp/NHTTP_bgnend.c
Normal file
179
libs/RevoEX/src/nhttp/NHTTP_bgnend.c
Normal file
@@ -0,0 +1,179 @@
|
||||
#include <revolution/nhttp.h>
|
||||
|
||||
#include <revolution/ncd.h>
|
||||
#include <revolution/os.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int SOClose(int s);
|
||||
|
||||
typedef struct NHTTPBgnEndInfo
|
||||
{
|
||||
NCDIpConfig ipConfig;
|
||||
NHTTPAlloc alloc;
|
||||
NHTTPFree free;
|
||||
BOOL started;
|
||||
s32 socket;
|
||||
s32 sslError;
|
||||
NHTTPErr error;
|
||||
u32 _unk7DC;
|
||||
void* threadStack;
|
||||
u32 _unk7E4;
|
||||
} NHTTPBgnEndInfo;
|
||||
|
||||
NHTTPBgnEndInfo* NHTTPi_GetSystemInfoP(void);
|
||||
NHTTPBgnEndInfo* NHTTPi_GetBgnEndInfoP(void* systemInfo);
|
||||
void* NHTTPi_GetListInfoP(void* systemInfo);
|
||||
void* NHTTPi_GetReqInfoP(void* systemInfo);
|
||||
void* NHTTPi_GetMutexInfoP(void* systemInfo);
|
||||
void* NHTTPi_GetThreadInfoP(void* systemInfo);
|
||||
|
||||
void NHTTPi_InitListInfo(void* listInfo);
|
||||
void NHTTPi_InitRequestInfo(void* reqInfo);
|
||||
void NHTTPi_initLockReqList(void* mutexInfo);
|
||||
void NHTTPi_exitLockReqList(void);
|
||||
BOOL NHTTPi_createCommThread(void* threadInfo, u32 priority, void* stack);
|
||||
void NHTTPi_destroyCommThread(void* threadInfo, NHTTPBgnEndInfo* bgnEndInfo);
|
||||
void NHTTPi_CheckCurrentThread(void* threadInfo, BOOL allowCommThread);
|
||||
void NHTTPi_cancelAllRequests(void* systemInfo);
|
||||
int NHTTPi_GetConnectionListLength(void);
|
||||
void NHTTPi_InitConnectionList(void);
|
||||
|
||||
void NHTTPi_InitBgnEndInfo(NHTTPBgnEndInfo* info)
|
||||
{
|
||||
info->sslError = 0;
|
||||
info->error = NHTTP_ERROR_NONE;
|
||||
info->alloc = NULL;
|
||||
info->free = NULL;
|
||||
info->started = FALSE;
|
||||
info->socket = -1;
|
||||
info->_unk7DC = 0;
|
||||
info->threadStack = NULL;
|
||||
info->_unk7E4 = 0;
|
||||
}
|
||||
|
||||
void* NHTTPi_alloc(u32 size, int align)
|
||||
{
|
||||
NHTTPBgnEndInfo* info = NHTTPi_GetSystemInfoP();
|
||||
|
||||
if (info->alloc != NULL)
|
||||
{
|
||||
return info->alloc(size, align);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void NHTTPi_free(void* buf)
|
||||
{
|
||||
NHTTPBgnEndInfo* info = NHTTPi_GetSystemInfoP();
|
||||
|
||||
if (info->free != NULL)
|
||||
{
|
||||
info->free(buf);
|
||||
}
|
||||
}
|
||||
|
||||
void NHTTPi_SetError(NHTTPBgnEndInfo* info, NHTTPErr error)
|
||||
{
|
||||
info->error = error;
|
||||
}
|
||||
|
||||
void NHTTPi_SetSSLError(NHTTPBgnEndInfo* info, s32 error)
|
||||
{
|
||||
info->sslError = error;
|
||||
}
|
||||
|
||||
s32 NHTTPi_GetSSLError(NHTTPBgnEndInfo* info)
|
||||
{
|
||||
return info->sslError;
|
||||
}
|
||||
|
||||
BOOL NHTTPi_Startup(void* systemInfo, NHTTPAlloc alloc, NHTTPFree free,
|
||||
u32 priority)
|
||||
{
|
||||
NHTTPBgnEndInfo* bgnEndInfo = NHTTPi_GetBgnEndInfoP(systemInfo);
|
||||
void* listInfo = NHTTPi_GetListInfoP(systemInfo);
|
||||
void* reqInfo = NHTTPi_GetReqInfoP(systemInfo);
|
||||
void* mutexInfo = NHTTPi_GetMutexInfoP(systemInfo);
|
||||
void* threadInfo = NHTTPi_GetThreadInfoP(systemInfo);
|
||||
void* stack;
|
||||
NCDErr result;
|
||||
|
||||
bgnEndInfo->alloc = alloc;
|
||||
bgnEndInfo->free = free;
|
||||
bgnEndInfo->error = NHTTP_ERROR_NONE;
|
||||
bgnEndInfo->sslError = 0;
|
||||
bgnEndInfo->_unk7DC = 0;
|
||||
|
||||
NHTTPi_InitListInfo(listInfo);
|
||||
NHTTPi_InitRequestInfo(reqInfo);
|
||||
NHTTPi_initLockReqList(mutexInfo);
|
||||
NHTTPi_InitConnectionList();
|
||||
bgnEndInfo->socket = -1;
|
||||
|
||||
stack = NHTTPi_alloc(0x2000, 8);
|
||||
bgnEndInfo->threadStack = stack;
|
||||
if (stack == NULL)
|
||||
{
|
||||
bgnEndInfo->error = NHTTP_ERROR_ALLOC;
|
||||
NHTTPi_exitLockReqList();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!NHTTPi_createCommThread(threadInfo, priority, stack))
|
||||
{
|
||||
bgnEndInfo->error = NHTTP_ERROR_REVOLUTIONSDK;
|
||||
NHTTPi_free(bgnEndInfo->threadStack);
|
||||
bgnEndInfo->threadStack = NULL;
|
||||
NHTTPi_exitLockReqList();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
result = NCDGetCurrentIpConfig(&bgnEndInfo->ipConfig);
|
||||
if (result < 0)
|
||||
{
|
||||
OSReport("NCDGetCurrentIpConfig err = %d\n", result);
|
||||
OSPanic("NHTTP_bgnend.c", 230, "NCDGetCurrentIpConfig");
|
||||
}
|
||||
|
||||
bgnEndInfo->started = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void NHTTPi_CleanupAsync(void* systemInfo, NHTTPCleanupCallback callback)
|
||||
{
|
||||
NHTTPBgnEndInfo* bgnEndInfo = NHTTPi_GetBgnEndInfoP(systemInfo);
|
||||
void* threadInfo = NHTTPi_GetThreadInfoP(systemInfo);
|
||||
int connectionCount;
|
||||
|
||||
NHTTPi_CheckCurrentThread(threadInfo, TRUE);
|
||||
NHTTPi_cancelAllRequests(systemInfo);
|
||||
NHTTPi_destroyCommThread(threadInfo, bgnEndInfo);
|
||||
NHTTPi_free(bgnEndInfo->threadStack);
|
||||
bgnEndInfo->threadStack = NULL;
|
||||
NHTTPi_exitLockReqList();
|
||||
bgnEndInfo->started = FALSE;
|
||||
|
||||
if (callback != NULL)
|
||||
{
|
||||
callback();
|
||||
}
|
||||
|
||||
connectionCount = NHTTPi_GetConnectionListLength();
|
||||
if (connectionCount != 0)
|
||||
{
|
||||
printf("*warning: %d connections rests! Please free connections.\n",
|
||||
connectionCount);
|
||||
}
|
||||
|
||||
if (bgnEndInfo->socket >= 0)
|
||||
{
|
||||
SOClose(bgnEndInfo->socket);
|
||||
bgnEndInfo->socket = -1;
|
||||
}
|
||||
}
|
||||
|
||||
s32 NHTTPi_GetError(NHTTPBgnEndInfo* info)
|
||||
{
|
||||
return info->error;
|
||||
}
|
||||
102
libs/RevoEX/src/nhttp/NHTTP_control.c
Normal file
102
libs/RevoEX/src/nhttp/NHTTP_control.c
Normal file
@@ -0,0 +1,102 @@
|
||||
#include <private/nhttp.h>
|
||||
|
||||
#include <stdio.h>
|
||||
s32 NHTTPi_compareToken(const char* lhs, const char* rhs);
|
||||
void* NHTTPi_alloc(u32 size, int align);
|
||||
void NHTTPi_SetError(NHTTPBgnEndInfo* info, NHTTPErr error);
|
||||
|
||||
static BOOL addHdrList(NHTTPHeader** list, NHTTPBgnEndInfo* info, char* name,
|
||||
char* value)
|
||||
{
|
||||
BOOL found = FALSE;
|
||||
NHTTPHeader* header = *list;
|
||||
|
||||
if (header != NULL)
|
||||
{
|
||||
if (NHTTPi_compareToken(name, header->name) != 0)
|
||||
{
|
||||
header = header->prev;
|
||||
while (header != *list)
|
||||
{
|
||||
if (NHTTPi_compareToken(name, header->name) == 0)
|
||||
{
|
||||
found = TRUE;
|
||||
break;
|
||||
}
|
||||
header = header->prev;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
found = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (found)
|
||||
{
|
||||
header->value = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
header = NHTTPi_alloc(sizeof(NHTTPHeader), 4);
|
||||
if (header == NULL)
|
||||
{
|
||||
printf("failed to allocate memory\n");
|
||||
NHTTPi_SetError(info, NHTTP_ERROR_ALLOC);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
header->name = name;
|
||||
header->value = value;
|
||||
header->length = 0;
|
||||
header->_unk14 = 0;
|
||||
|
||||
if (*list != NULL)
|
||||
{
|
||||
header->next = (*list)->next;
|
||||
header->prev = *list;
|
||||
(*list)->next->prev = header;
|
||||
(*list)->next = header;
|
||||
}
|
||||
else
|
||||
{
|
||||
header->prev = header;
|
||||
header->next = header;
|
||||
*list = header;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
NHTTPHeader* NHTTPi_getHdrFromList(NHTTPHeader** list)
|
||||
{
|
||||
NHTTPHeader* header = *list;
|
||||
|
||||
if (header != NULL)
|
||||
{
|
||||
if (header != header->next)
|
||||
{
|
||||
header->next->prev = header->prev;
|
||||
header->prev->next = header->next;
|
||||
*list = header->prev;
|
||||
}
|
||||
else
|
||||
{
|
||||
*list = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return header;
|
||||
}
|
||||
|
||||
BOOL NHTTP_AddHeaderField(NHTTPRequestInfo* request, NHTTPBgnEndInfo* info,
|
||||
char* name, char* value)
|
||||
{
|
||||
if (request->state != 0)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
return addHdrList(&request->headers, info, name, value);
|
||||
}
|
||||
|
||||
126
libs/RevoEX/src/nhttp/NHTTP_list.c
Normal file
126
libs/RevoEX/src/nhttp/NHTTP_list.c
Normal file
@@ -0,0 +1,126 @@
|
||||
#include <private/nhttp.h>
|
||||
|
||||
void* NHTTPi_alloc(u32 size, int align);
|
||||
void NHTTPi_free(void* ptr);
|
||||
NHTTPConnectionInfo* NHTTPi_Request2Connection(void* mutexInfo,
|
||||
NHTTPRequestInfo* request);
|
||||
void NHTTPi_destroyRequestObject(void* mutexInfo, NHTTPRequestInfo* request);
|
||||
void NHTTPi_CompleteCallback(void* mutexInfo, NHTTPConnectionInfo* connection);
|
||||
NHTTPHeader* NHTTPi_getHdrFromList(NHTTPHeader** list);
|
||||
|
||||
void NHTTPi_InitListInfo(NHTTPListInfo* info)
|
||||
{
|
||||
info->reqQueue = NULL;
|
||||
info->nextRequestId = 0;
|
||||
}
|
||||
|
||||
s32 NHTTPi_setReqQueue(NHTTPListInfo* info, NHTTPRequestInfo* request)
|
||||
{
|
||||
s32 requestId = -1;
|
||||
NHTTPReqQueue* queue = NHTTPi_alloc(sizeof(NHTTPReqQueue), 4);
|
||||
|
||||
if (queue != NULL)
|
||||
{
|
||||
if (info->reqQueue != NULL)
|
||||
{
|
||||
queue->next = info->reqQueue->next;
|
||||
queue->prev = info->reqQueue;
|
||||
info->reqQueue->next->prev = queue;
|
||||
info->reqQueue->next = queue;
|
||||
}
|
||||
else
|
||||
{
|
||||
queue->next = queue;
|
||||
queue->prev = queue;
|
||||
info->reqQueue = queue;
|
||||
}
|
||||
|
||||
queue->requestId = info->nextRequestId++;
|
||||
queue->request = request;
|
||||
queue->_unk10 = -1;
|
||||
requestId = queue->requestId;
|
||||
|
||||
if (info->nextRequestId < 0)
|
||||
{
|
||||
info->nextRequestId = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return requestId;
|
||||
}
|
||||
|
||||
BOOL NHTTPi_freeReqQueue(NHTTPListInfo* info, void* mutexInfo, s32 requestId)
|
||||
{
|
||||
NHTTPReqQueue* current;
|
||||
NHTTPReqQueue* queue = info->reqQueue;
|
||||
NHTTPReqQueue* found = NULL;
|
||||
BOOL result = FALSE;
|
||||
|
||||
if (queue != NULL)
|
||||
{
|
||||
if (queue->requestId == requestId)
|
||||
{
|
||||
found = queue;
|
||||
}
|
||||
else
|
||||
{
|
||||
current = queue->prev;
|
||||
|
||||
while (current != queue)
|
||||
{
|
||||
if (current->requestId == requestId)
|
||||
{
|
||||
found = current;
|
||||
break;
|
||||
}
|
||||
current = current->prev;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (found != NULL)
|
||||
{
|
||||
NHTTPConnectionInfo* connection;
|
||||
|
||||
if (queue != queue->next)
|
||||
{
|
||||
found->next->prev = found->prev;
|
||||
found->prev->next = found->next;
|
||||
|
||||
if (info->reqQueue == found)
|
||||
{
|
||||
info->reqQueue = found->prev;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
info->reqQueue = NULL;
|
||||
}
|
||||
|
||||
connection = NHTTPi_Request2Connection(mutexInfo, found->request);
|
||||
NHTTPi_destroyRequestObject(mutexInfo, found->request);
|
||||
NHTTPi_free(found);
|
||||
|
||||
if (connection != NULL)
|
||||
{
|
||||
connection->state = 8;
|
||||
NHTTPi_CompleteCallback(mutexInfo, connection);
|
||||
}
|
||||
result = TRUE;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void NHTTPi_allFreeReqQueue(NHTTPListInfo* info, void* mutexInfo)
|
||||
{
|
||||
while (info->reqQueue != NULL)
|
||||
{
|
||||
NHTTPi_freeReqQueue(info, mutexInfo, info->reqQueue->requestId);
|
||||
}
|
||||
}
|
||||
|
||||
NHTTPReqQueue* NHTTPi_getReqFromReqQueue(NHTTPReqQueue** queue)
|
||||
{
|
||||
return (NHTTPReqQueue*)NHTTPi_getHdrFromList((NHTTPHeader**)queue);
|
||||
}
|
||||
120
libs/RevoEX/src/nhttp/NHTTP_os_RVL.c
Normal file
120
libs/RevoEX/src/nhttp/NHTTP_os_RVL.c
Normal file
@@ -0,0 +1,120 @@
|
||||
#include <revolution/nhttp.h>
|
||||
|
||||
#include <revolution/ncd.h>
|
||||
#include <revolution/os.h>
|
||||
|
||||
typedef struct NHTTPMutexInfo
|
||||
{
|
||||
OSMutex mutex;
|
||||
BOOL initialized;
|
||||
} NHTTPMutexInfo;
|
||||
|
||||
typedef struct NHTTPBgnEndInfo
|
||||
{
|
||||
NCDIpConfig ipConfig;
|
||||
NHTTPAlloc alloc;
|
||||
NHTTPFree free;
|
||||
BOOL started;
|
||||
s32 socket;
|
||||
s32 sslError;
|
||||
NHTTPErr error;
|
||||
u32 _unk7DC;
|
||||
void* threadStack;
|
||||
u32 _unk7E4;
|
||||
} NHTTPBgnEndInfo;
|
||||
|
||||
typedef struct NHTTPThreadInfo
|
||||
{
|
||||
OSMessageQueue messageQueue;
|
||||
OSMessage messages[3];
|
||||
OSThread thread;
|
||||
BOOL isCreateCommThreadMessageQueue;
|
||||
u8 _unk34C[0x14];
|
||||
char commBuf[0x100];
|
||||
} NHTTPThreadInfo;
|
||||
|
||||
BOOL NHTTPi_IsCreateCommThreadMessageQueue(NHTTPThreadInfo* info);
|
||||
void NHTTPi_IsCreateCommThreadMessageQueueOn(NHTTPThreadInfo* info);
|
||||
void NHTTPi_CommThreadProcMain(void* argument);
|
||||
|
||||
void NHTTPi_InitMutexInfo(NHTTPMutexInfo* info)
|
||||
{
|
||||
info->initialized = FALSE;
|
||||
}
|
||||
|
||||
void NHTTPi_initLockReqList(NHTTPMutexInfo* info)
|
||||
{
|
||||
if (!info->initialized)
|
||||
{
|
||||
OSInitMutex(&info->mutex);
|
||||
info->initialized = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
void NHTTPi_exitLockReqList(void)
|
||||
{
|
||||
}
|
||||
|
||||
void NHTTPi_lockReqList(NHTTPMutexInfo* info)
|
||||
{
|
||||
OSLockMutex(&info->mutex);
|
||||
}
|
||||
|
||||
void NHTTPi_unlockReqList(NHTTPMutexInfo* info)
|
||||
{
|
||||
OSUnlockMutex(&info->mutex);
|
||||
}
|
||||
|
||||
void* NHTTPi_CommThreadProc(void* argument);
|
||||
|
||||
BOOL NHTTPi_createCommThread(NHTTPThreadInfo* info, s32 priority, void* stack)
|
||||
{
|
||||
if (!NHTTPi_IsCreateCommThreadMessageQueue(info))
|
||||
{
|
||||
OSInitMessageQueue(&info->messageQueue, info->messages, 3);
|
||||
NHTTPi_IsCreateCommThreadMessageQueueOn(info);
|
||||
}
|
||||
|
||||
OSCreateThread(&info->thread, NHTTPi_CommThreadProc, NULL, (u8*)stack + 0x2000, 0x2000, priority, 0);
|
||||
OSResumeThread(&info->thread);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void NHTTPi_destroyCommThread(NHTTPThreadInfo* info, NHTTPBgnEndInfo* bgnEndInfo)
|
||||
{
|
||||
bgnEndInfo->_unk7DC = 1;
|
||||
OSSendMessage(&info->messageQueue, NULL, 0);
|
||||
OSJoinThread(&info->thread, NULL);
|
||||
}
|
||||
|
||||
void NHTTPi_idleCommThread(NHTTPThreadInfo* info)
|
||||
{
|
||||
OSMessage message;
|
||||
|
||||
OSReceiveMessage(&info->messageQueue, &message, OS_MESSAGE_BLOCK);
|
||||
}
|
||||
|
||||
void NHTTPi_kickCommThread(NHTTPThreadInfo* info)
|
||||
{
|
||||
OSSendMessage(&info->messageQueue, NULL, 0);
|
||||
}
|
||||
|
||||
void NHTTPi_CheckCurrentThread(NHTTPThreadInfo* info, BOOL notCommThread)
|
||||
{
|
||||
OSThread* current = OSGetCurrentThread();
|
||||
OSThread* commThread = &info->thread;
|
||||
|
||||
if (current != NULL
|
||||
&& ((!notCommThread && current != commThread)
|
||||
|| (notCommThread && current == commThread)))
|
||||
{
|
||||
OSReport("%s:illegal thread\n", __FUNCTION__);
|
||||
OSPanic(__FILE__, 223, "halt\n");
|
||||
}
|
||||
}
|
||||
|
||||
void* NHTTPi_CommThreadProc(void* argument)
|
||||
{
|
||||
NHTTPi_CommThreadProcMain(argument);
|
||||
return NULL;
|
||||
}
|
||||
487
libs/RevoEX/src/nhttp/NHTTP_request.c
Normal file
487
libs/RevoEX/src/nhttp/NHTTP_request.c
Normal file
@@ -0,0 +1,487 @@
|
||||
#include <private/nhttp.h>
|
||||
|
||||
const char NHTTPi_strMultipartBound[] = STR_POSTBOUND;
|
||||
|
||||
void* NHTTPi_alloc(u32 size, int align);
|
||||
void NHTTPi_free(void* ptr);
|
||||
void NHTTPi_SetError(NHTTPBgnEndInfo* info, NHTTPErr error);
|
||||
void* NHTTPi_memclr(void* destination, u32 size);
|
||||
s32 NHTTPi_strlen(const char* string);
|
||||
void* NHTTPi_memcpy(void* destination, const void* source, u32 size);
|
||||
s32 NHTTPi_strnicmp(const char* left, const char* right, s32 size);
|
||||
s32 NHTTPi_strToHex(const char* string, s32 length);
|
||||
s32 NHTTPi_strtonum(const char* string, s32 length);
|
||||
|
||||
NHTTPBgnEndInfo* NHTTPi_GetBgnEndInfoP(void* systemInfo);
|
||||
NHTTPListInfo* NHTTPi_GetListInfoP(void* systemInfo);
|
||||
NHTTPReqInfo* NHTTPi_GetReqInfoP(void* systemInfo);
|
||||
void* NHTTPi_GetMutexInfoP(void* systemInfo);
|
||||
void* NHTTPi_GetThreadInfoP(void* systemInfo);
|
||||
NHTTPConnectionInfo* NHTTPi_Request2Connection(void* mutexInfo,
|
||||
NHTTPRequestInfo* request);
|
||||
void NHTTPi_lockReqList(void* mutexInfo);
|
||||
void NHTTPi_unlockReqList(void* mutexInfo);
|
||||
s32 NHTTPi_setReqQueue(NHTTPListInfo* listInfo, NHTTPRequestInfo* request);
|
||||
void NHTTPi_kickCommThread(void* threadInfo);
|
||||
void NHTTPi_SocCancel(void* mutexInfo, NHTTPRequestInfo* request, s32 socket);
|
||||
BOOL NHTTPi_freeReqQueue(NHTTPListInfo* listInfo, void* mutexInfo,
|
||||
s32 requestId);
|
||||
void NHTTPi_allFreeReqQueue(NHTTPListInfo* listInfo, void* mutexInfo);
|
||||
|
||||
void NHTTPi_InitRequestInfo(NHTTPReqInfo* info)
|
||||
{
|
||||
info->reqQueue = NULL;
|
||||
}
|
||||
|
||||
NHTTPRequestInfo* NHTTP_CreateRequest(NHTTPBgnEndInfo* bgnEndInfo_p,
|
||||
const char* url_p, s32 method, void* buf_p, u32 len, void* param_p,
|
||||
NHTTPResponseCallback bufFull, NHTTPResponseCleanup freeBuf)
|
||||
{
|
||||
int i;
|
||||
int suflen, urllen, prelen;
|
||||
int nhostenc, deccount;
|
||||
int declen, hostend;
|
||||
int port;
|
||||
int decode_urllen;
|
||||
|
||||
char a_url[LEN_URLBUF];
|
||||
char* prefix_p;
|
||||
NHTTPRequestInfo* req_p = NULL;
|
||||
|
||||
if (method >= 3 || method < 0)
|
||||
{
|
||||
NHTTPi_SetError(bgnEndInfo_p, NHTTP_ERROR_UNKNOWN);
|
||||
goto errend;
|
||||
}
|
||||
|
||||
req_p = NHTTPi_alloc(sizeof(NHTTPRequestInfo), 4);
|
||||
if (!req_p)
|
||||
{
|
||||
NHTTPi_SetError(bgnEndInfo_p, NHTTP_ERROR_ALLOC);
|
||||
goto errend;
|
||||
}
|
||||
NHTTPi_memclr(req_p, sizeof(NHTTPRequestInfo));
|
||||
|
||||
req_p->response = NHTTPi_alloc(sizeof(NHTTPResponseInfo), 4);
|
||||
if (!req_p->response)
|
||||
{
|
||||
NHTTPi_SetError(bgnEndInfo_p, NHTTP_ERROR_ALLOC);
|
||||
goto errend;
|
||||
}
|
||||
NHTTPi_memclr(req_p->response, sizeof(NHTTPResponseInfo));
|
||||
req_p->response->recvBuf_p = buf_p;
|
||||
req_p->response->recvBufLen = len;
|
||||
req_p->response->bufFull = bufFull;
|
||||
req_p->response->freeBuf = freeBuf;
|
||||
|
||||
urllen = NHTTPi_strlen(url_p);
|
||||
if (urllen <= 7)
|
||||
{
|
||||
NHTTPi_SetError(bgnEndInfo_p, NHTTP_ERROR_DNS);
|
||||
goto errend;
|
||||
}
|
||||
|
||||
NHTTPi_memclr(a_url, urllen);
|
||||
NHTTPi_memcpy(a_url, url_p, urllen);
|
||||
|
||||
req_p->port = 80;
|
||||
suflen = 7;
|
||||
if (NHTTPi_strnicmp(a_url, "http://", 7) != 0)
|
||||
{
|
||||
if (NHTTPi_strnicmp(a_url, "https://", 8) != 0)
|
||||
{
|
||||
NHTTPi_SetError(bgnEndInfo_p, NHTTP_ERROR_DNS);
|
||||
goto errend;
|
||||
}
|
||||
req_p->secure = TRUE;
|
||||
req_p->port = 443;
|
||||
suflen = 8;
|
||||
}
|
||||
|
||||
prefix_p = a_url + suflen;
|
||||
prelen = urllen - suflen;
|
||||
if (prelen <= 0)
|
||||
{
|
||||
NHTTPi_SetError(bgnEndInfo_p, NHTTP_ERROR_DNS);
|
||||
goto errend;
|
||||
}
|
||||
|
||||
for (i = 0, nhostenc = 0, deccount = 0;
|
||||
(i < prelen) && (prefix_p[i] != '/'); i++)
|
||||
{
|
||||
if (deccount == 2)
|
||||
{
|
||||
deccount--;
|
||||
}
|
||||
else if (deccount == 1)
|
||||
{
|
||||
s8 c = (s8)NHTTPi_strToHex(&prefix_p[i - 1], 2);
|
||||
deccount--;
|
||||
if (c < 0)
|
||||
{
|
||||
NHTTPi_SetError(bgnEndInfo_p, NHTTP_ERROR_DNS);
|
||||
goto errend;
|
||||
}
|
||||
if (c == '/')
|
||||
{
|
||||
nhostenc--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (prefix_p[i] == '%')
|
||||
{
|
||||
deccount = 2;
|
||||
nhostenc++;
|
||||
}
|
||||
}
|
||||
|
||||
if (deccount)
|
||||
{
|
||||
NHTTPi_SetError(bgnEndInfo_p, NHTTP_ERROR_DNS);
|
||||
goto errend;
|
||||
}
|
||||
|
||||
decode_urllen = suflen + prelen - nhostenc * 2 + 1;
|
||||
req_p->url = NHTTPi_alloc(decode_urllen, 4);
|
||||
if (!req_p->url)
|
||||
{
|
||||
NHTTPi_SetError(bgnEndInfo_p, NHTTP_ERROR_ALLOC);
|
||||
goto errend;
|
||||
}
|
||||
NHTTPi_memclr(req_p->url, decode_urllen);
|
||||
NHTTPi_memcpy(req_p->url, a_url, suflen);
|
||||
|
||||
for (i = 0, declen = 0, deccount = 0, hostend = FALSE;
|
||||
i < prelen; i++)
|
||||
{
|
||||
if (deccount == 2)
|
||||
{
|
||||
deccount--;
|
||||
}
|
||||
else if (deccount == 1)
|
||||
{
|
||||
char c = (char)NHTTPi_strToHex(&prefix_p[i - 1], 2);
|
||||
deccount--;
|
||||
req_p->url[suflen + declen - 1] = c;
|
||||
if (c == '/')
|
||||
{
|
||||
hostend = TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (prefix_p[i] == '/')
|
||||
{
|
||||
hostend = TRUE;
|
||||
}
|
||||
if (!hostend & (prefix_p[i] == '%'))
|
||||
{
|
||||
deccount = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
req_p->url[suflen + declen] = prefix_p[i];
|
||||
}
|
||||
declen++;
|
||||
}
|
||||
}
|
||||
req_p->url[suflen + declen] = 0;
|
||||
|
||||
prefix_p = &req_p->url[suflen];
|
||||
prelen = declen;
|
||||
|
||||
for (i = 0; i < prelen; i++)
|
||||
{
|
||||
if ((prefix_p[i] == '/') || (prefix_p[i] == ':'))
|
||||
{
|
||||
req_p->hostEnd = i + suflen;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i == prelen)
|
||||
{
|
||||
req_p->pathStart = req_p->hostEnd = i + suflen;
|
||||
}
|
||||
else if (prefix_p[i] == '/')
|
||||
{
|
||||
req_p->pathStart = req_p->hostEnd;
|
||||
}
|
||||
else if (prefix_p[i] == ':')
|
||||
{
|
||||
for (; i < prelen; i++)
|
||||
{
|
||||
if (prefix_p[i] == '/')
|
||||
{
|
||||
req_p->pathStart = i + suflen;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i == prelen)
|
||||
{
|
||||
req_p->pathStart = i + suflen;
|
||||
}
|
||||
else
|
||||
{
|
||||
port = NHTTPi_strtonum(&req_p->url[req_p->hostEnd + 1],
|
||||
(int)(req_p->pathStart - (req_p->hostEnd + 1)));
|
||||
if (port < 0)
|
||||
{
|
||||
port = req_p->port;
|
||||
}
|
||||
else if (port > 65535)
|
||||
{
|
||||
NHTTPi_SetError(bgnEndInfo_p, NHTTP_ERROR_DNS);
|
||||
goto errend;
|
||||
}
|
||||
req_p->port = (u16)port;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
u32 a_hostnameLen = (u32)(req_p->hostEnd - (req_p->secure ? 8 : 7));
|
||||
req_p->host = NHTTPi_alloc(a_hostnameLen + 1, 4);
|
||||
if (!req_p->host)
|
||||
{
|
||||
NHTTPi_SetError(bgnEndInfo_p, NHTTP_ERROR_ALLOC);
|
||||
goto errend;
|
||||
}
|
||||
NHTTPi_memclr(req_p->host, (int)(a_hostnameLen + 1));
|
||||
NHTTPi_memcpy(req_p->host,
|
||||
req_p->url + (req_p->secure ? 8 : 7), (int)a_hostnameLen);
|
||||
}
|
||||
|
||||
NHTTPi_memcpy(req_p->multipartBoundary, NHTTPi_strMultipartBound,
|
||||
sizeof(req_p->multipartBoundary));
|
||||
req_p->method = method;
|
||||
req_p->sslId = 0;
|
||||
req_p->clientCertData = NULL;
|
||||
req_p->clientCertSize = 0;
|
||||
req_p->privateKeyData = NULL;
|
||||
req_p->privateKeySize = 0;
|
||||
req_p->rootCAData = NULL;
|
||||
req_p->rootCASize = 0;
|
||||
req_p->clientCertDefault = FALSE;
|
||||
req_p->verifyOption = 0;
|
||||
req_p->_unkD4 = NULL;
|
||||
req_p->response->param_p = param_p;
|
||||
req_p->proxyEnabled = FALSE;
|
||||
req_p->recvBufferSize = 0;
|
||||
return req_p;
|
||||
|
||||
errend:
|
||||
if (req_p)
|
||||
{
|
||||
if (req_p->url)
|
||||
{
|
||||
NHTTPi_free(req_p->url);
|
||||
}
|
||||
if (req_p->host)
|
||||
{
|
||||
NHTTPi_free(req_p->host);
|
||||
}
|
||||
if (req_p->response)
|
||||
{
|
||||
NHTTPi_free(req_p->response);
|
||||
}
|
||||
NHTTPi_free(req_p);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void NHTTP_DestroyRequest(void* systemInfo, NHTTPRequestInfo* request)
|
||||
{
|
||||
NHTTPConnectionInfo* connection;
|
||||
NHTTPHeader* header;
|
||||
NHTTPHeader* next;
|
||||
NHTTPHeader* post;
|
||||
NHTTPHeader* nextPost;
|
||||
void* mutexInfo = NHTTPi_GetMutexInfoP(systemInfo);
|
||||
|
||||
connection = NHTTPi_Request2Connection(mutexInfo, request);
|
||||
if (connection != NULL)
|
||||
{
|
||||
connection->response = NULL;
|
||||
}
|
||||
NHTTPi_free(request->response);
|
||||
|
||||
connection = NHTTPi_Request2Connection(mutexInfo, request);
|
||||
if (connection != NULL)
|
||||
{
|
||||
connection->request = NULL;
|
||||
}
|
||||
|
||||
header = request->headers;
|
||||
while (header != NULL)
|
||||
{
|
||||
if (header != header->next)
|
||||
{
|
||||
next = header->next->next;
|
||||
NHTTPi_free(header->next);
|
||||
header->next = next;
|
||||
}
|
||||
else
|
||||
{
|
||||
NHTTPi_free(header);
|
||||
header = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
post = request->postData;
|
||||
while (post != NULL)
|
||||
{
|
||||
if (post != post->next)
|
||||
{
|
||||
nextPost = post->next->next;
|
||||
NHTTPi_free(post->next);
|
||||
post->next = nextPost;
|
||||
}
|
||||
else
|
||||
{
|
||||
NHTTPi_free(post);
|
||||
post = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
NHTTPi_free(request->url);
|
||||
NHTTPi_free(request->host);
|
||||
NHTTPi_free(request);
|
||||
}
|
||||
|
||||
BOOL NHTTPi_destroyRequestObject(void* mutexInfo, NHTTPRequestInfo* request)
|
||||
{
|
||||
NHTTPConnectionInfo* connection;
|
||||
NHTTPHeader* header;
|
||||
NHTTPHeader* next;
|
||||
NHTTPHeader* post;
|
||||
NHTTPHeader* nextPost;
|
||||
|
||||
connection = NHTTPi_Request2Connection(mutexInfo, request);
|
||||
if (connection != NULL)
|
||||
{
|
||||
connection->request = NULL;
|
||||
}
|
||||
|
||||
header = request->headers;
|
||||
while (header != NULL)
|
||||
{
|
||||
if (header != header->next)
|
||||
{
|
||||
next = header->next->next;
|
||||
NHTTPi_free(header->next);
|
||||
header->next = next;
|
||||
}
|
||||
else
|
||||
{
|
||||
NHTTPi_free(header);
|
||||
header = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
post = request->postData;
|
||||
while (post != NULL)
|
||||
{
|
||||
if (post != post->next)
|
||||
{
|
||||
nextPost = post->next->next;
|
||||
NHTTPi_free(post->next);
|
||||
post->next = nextPost;
|
||||
}
|
||||
else
|
||||
{
|
||||
NHTTPi_free(post);
|
||||
post = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
NHTTPi_free(request->url);
|
||||
NHTTPi_free(request->host);
|
||||
NHTTPi_free(request);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
s32 NHTTP_SendRequestAsync(void* systemInfo, NHTTPRequestInfo* request)
|
||||
{
|
||||
NHTTPBgnEndInfo* info = NHTTPi_GetBgnEndInfoP(systemInfo);
|
||||
void* threadInfo = NHTTPi_GetThreadInfoP(systemInfo);
|
||||
void* mutexInfo = NHTTPi_GetMutexInfoP(systemInfo);
|
||||
s32 requestId;
|
||||
|
||||
if (request->state != 0)
|
||||
{
|
||||
NHTTPi_SetError(info, NHTTP_ERROR_UNKNOWN);
|
||||
return -1;
|
||||
}
|
||||
|
||||
NHTTPi_lockReqList(mutexInfo);
|
||||
requestId = NHTTPi_setReqQueue(NHTTPi_GetListInfoP(systemInfo), request);
|
||||
if (requestId >= 0)
|
||||
{
|
||||
request->state = 1;
|
||||
NHTTPi_kickCommThread(threadInfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
NHTTPi_SetError(info, NHTTP_ERROR_ALLOC);
|
||||
}
|
||||
NHTTPi_unlockReqList(mutexInfo);
|
||||
return requestId;
|
||||
}
|
||||
|
||||
BOOL NHTTP_CancelRequestAsync(void* sysInfo_p, s32 id)
|
||||
{
|
||||
BOOL rc = FALSE;
|
||||
NHTTPReqInfo* reqInfo_p = NHTTPi_GetReqInfoP(sysInfo_p);
|
||||
void* mutexInfo_p = NHTTPi_GetMutexInfoP(sysInfo_p);
|
||||
volatile NHTTPReqQueue* reqCurrent_p = reqInfo_p->reqQueue;
|
||||
|
||||
NHTTPi_lockReqList(mutexInfo_p);
|
||||
|
||||
if (reqCurrent_p)
|
||||
{
|
||||
if (reqCurrent_p->requestId == id)
|
||||
{
|
||||
if (!reqCurrent_p->request->cancel)
|
||||
{
|
||||
reqCurrent_p->request->cancel = TRUE;
|
||||
NHTTPi_SocCancel(mutexInfo_p, reqCurrent_p->request,
|
||||
reqCurrent_p->_unk10);
|
||||
rc = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!rc)
|
||||
{
|
||||
NHTTPListInfo* listInfo_p = NHTTPi_GetListInfoP(sysInfo_p);
|
||||
rc = NHTTPi_freeReqQueue(listInfo_p, mutexInfo_p, id);
|
||||
}
|
||||
|
||||
NHTTPi_unlockReqList(mutexInfo_p);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
void NHTTPi_cancelAllRequests(void* sysInfo_p)
|
||||
{
|
||||
NHTTPReqInfo* reqInfo_p = NHTTPi_GetReqInfoP(sysInfo_p);
|
||||
NHTTPListInfo* listInfo_p = NHTTPi_GetListInfoP(sysInfo_p);
|
||||
void* mutexInfo_p = NHTTPi_GetMutexInfoP(sysInfo_p);
|
||||
volatile NHTTPReqQueue* reqCurrent_p = reqInfo_p->reqQueue;
|
||||
|
||||
NHTTPi_lockReqList(mutexInfo_p);
|
||||
|
||||
if (reqCurrent_p)
|
||||
{
|
||||
if (!reqCurrent_p->request->cancel)
|
||||
{
|
||||
reqCurrent_p->request->cancel = TRUE;
|
||||
NHTTPi_SocCancel(mutexInfo_p, reqCurrent_p->request,
|
||||
reqCurrent_p->_unk10);
|
||||
}
|
||||
}
|
||||
|
||||
NHTTPi_allFreeReqQueue(listInfo_p, mutexInfo_p);
|
||||
NHTTPi_unlockReqList(mutexInfo_p);
|
||||
}
|
||||
202
libs/RevoEX/src/nhttp/NHTTP_response.c
Normal file
202
libs/RevoEX/src/nhttp/NHTTP_response.c
Normal file
@@ -0,0 +1,202 @@
|
||||
#include <private/nhttp.h>
|
||||
|
||||
void* NHTTPi_alloc(u32 size, int align);
|
||||
void NHTTPi_free(void* ptr);
|
||||
void NHTTPi_SetError(NHTTPBgnEndInfo* info, NHTTPErr error);
|
||||
s32 NHTTPi_loadFromHdrRecvBuf(NHTTPResponseInfo* res_p, char* dst, s32 pos,
|
||||
s32 size);
|
||||
s32 NHTTPi_strcmp(const char* lhs, const char* rhs);
|
||||
s32 NHTTPi_getHeaderValue(const NHTTPResponseInfo* res_p, const char* label_p,
|
||||
s32* pos_p);
|
||||
NHTTPConnectionInfo* NHTTPi_Response2Connection(void* mutexInfo_p,
|
||||
NHTTPResponseInfo* res_p);
|
||||
s32 NHTTPi_findNextLineHdrRecvBuf(const NHTTPResponseInfo* res_p, s32 pos,
|
||||
s32 limit, s32* colon_pos_p, s32* return_code_size_p);
|
||||
s32 NHTTPi_compareTokenN_HdrRecvBuf(const NHTTPResponseInfo* res_p, s32 pos,
|
||||
s32 limit, const char* str_p, s8 extdeli);
|
||||
s32 NHTTPi_skipSpaceHdrRecvBuf(
|
||||
const NHTTPResponseInfo* res_p, s32 pos, s32 limit);
|
||||
|
||||
void NHTTP_DestroyResponse(void* mutexInfo_p, NHTTPResponseInfo* res_p)
|
||||
{
|
||||
NHTTPi_HDRBUFLIST* list_p = NULL;
|
||||
|
||||
while (res_p->hdrBufBlock_p)
|
||||
{
|
||||
list_p = res_p->hdrBufBlock_p->next_p;
|
||||
NHTTPi_free(res_p->hdrBufBlock_p);
|
||||
res_p->hdrBufBlock_p = list_p;
|
||||
}
|
||||
|
||||
if (res_p->allHeader_p)
|
||||
{
|
||||
NHTTPi_free(res_p->allHeader_p);
|
||||
}
|
||||
|
||||
if (res_p->foundHeader_p)
|
||||
{
|
||||
NHTTPi_free(res_p->foundHeader_p);
|
||||
}
|
||||
|
||||
if (res_p->freeBuf != NULL)
|
||||
{
|
||||
res_p->freeBuf(res_p->recvBuf_p, NHTTPi_free, res_p->param_p);
|
||||
res_p->recvBuf_p = NULL;
|
||||
res_p->recvBufLen = 0;
|
||||
}
|
||||
|
||||
{
|
||||
NHTTPConnectionInfo* connection_p =
|
||||
NHTTPi_Response2Connection(mutexInfo_p, res_p);
|
||||
|
||||
if (connection_p != NULL)
|
||||
{
|
||||
connection_p->response = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
NHTTPi_free(res_p);
|
||||
}
|
||||
|
||||
s32 NHTTPi_getHeaderValue(const NHTTPResponseInfo* res_p, const char* label_p,
|
||||
s32* pos_p)
|
||||
{
|
||||
s32 linetop, nextlinetop;
|
||||
s32 labeltop, labelend;
|
||||
s32 valuetop, valueend;
|
||||
s32 return_code_size = 0;
|
||||
|
||||
linetop = NHTTPi_findNextLineHdrRecvBuf(
|
||||
res_p, 12, res_p->headerLen, &labelend, &return_code_size);
|
||||
|
||||
while (linetop > 0)
|
||||
{
|
||||
nextlinetop = NHTTPi_findNextLineHdrRecvBuf(res_p, linetop,
|
||||
res_p->headerLen, &labelend, &return_code_size);
|
||||
|
||||
if (labelend > 0)
|
||||
{
|
||||
labeltop = linetop;
|
||||
|
||||
if (NHTTPi_compareTokenN_HdrRecvBuf(
|
||||
res_p, labeltop, labelend, label_p, 0)
|
||||
== 0)
|
||||
{
|
||||
if (labelend + 1 < res_p->headerLen)
|
||||
{
|
||||
valueend = NHTTPi_findNextLineHdrRecvBuf(res_p,
|
||||
labelend + 1, res_p->headerLen, NULL,
|
||||
&return_code_size);
|
||||
if (valueend <= 0)
|
||||
{
|
||||
valueend = res_p->headerLen;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (valueend < return_code_size)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
valueend -= return_code_size;
|
||||
}
|
||||
|
||||
valuetop = NHTTPi_skipSpaceHdrRecvBuf(
|
||||
res_p, labelend + 1, valueend);
|
||||
if (valuetop < 0)
|
||||
{
|
||||
valuetop = valueend;
|
||||
}
|
||||
|
||||
*pos_p = valuetop;
|
||||
return valueend - valuetop;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
linetop = nextlinetop;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
s32 NHTTP_GetHeaderField(NHTTPResponseInfo* res_p, const char* label_p,
|
||||
const char** value_p)
|
||||
{
|
||||
s32 pos;
|
||||
s32 length;
|
||||
|
||||
if (res_p->isHeaderParse == 0)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (res_p->foundHeader_p != NULL)
|
||||
{
|
||||
NHTTPi_free(res_p->foundHeader_p);
|
||||
res_p->foundHeader_p = NULL;
|
||||
}
|
||||
|
||||
length = NHTTPi_getHeaderValue(res_p, label_p, &pos);
|
||||
if (length >= 0)
|
||||
{
|
||||
res_p->foundHeader_p = NHTTPi_alloc(length + 1, 4);
|
||||
if (res_p->foundHeader_p == NULL)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
res_p->foundHeader_p[length] = 0;
|
||||
NHTTPi_loadFromHdrRecvBuf(res_p, res_p->foundHeader_p, pos, length);
|
||||
*value_p = res_p->foundHeader_p;
|
||||
return length;
|
||||
}
|
||||
|
||||
if (NHTTPi_strcmp("HTTPSTATUSCODE", label_p) == 0)
|
||||
{
|
||||
res_p->foundHeader_p = NHTTPi_alloc(4, 4);
|
||||
if (res_p->foundHeader_p == NULL)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
res_p->foundHeader_p[3] = 0;
|
||||
NHTTPi_loadFromHdrRecvBuf(res_p, res_p->foundHeader_p, 9, 3);
|
||||
*value_p = res_p->foundHeader_p;
|
||||
return 3;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
s32 NHTTP_GetHeaderAll(void* bgnEndInfo_p, NHTTPResponseInfo* res_p,
|
||||
const char** header_p)
|
||||
{
|
||||
if (res_p->isHeaderParse == 0 || res_p->headerLen == 0)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (res_p->headerLen < NHTTP_HDRRECVBUF_INILEN)
|
||||
{
|
||||
*header_p = (const char*)res_p->hdrBufFirst;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (res_p->allHeader_p == NULL)
|
||||
{
|
||||
res_p->allHeader_p = NHTTPi_alloc(res_p->headerLen, 4);
|
||||
if (res_p->allHeader_p == NULL)
|
||||
{
|
||||
NHTTPi_SetError(bgnEndInfo_p, NHTTP_ERROR_ALLOC);
|
||||
return -1;
|
||||
}
|
||||
NHTTPi_loadFromHdrRecvBuf(res_p, res_p->allHeader_p, 0,
|
||||
res_p->headerLen);
|
||||
}
|
||||
*header_p = res_p->allHeader_p;
|
||||
}
|
||||
|
||||
return res_p->headerLen;
|
||||
}
|
||||
|
||||
1218
libs/RevoEX/src/nhttp/NHTTP_thread.c
Normal file
1218
libs/RevoEX/src/nhttp/NHTTP_thread.c
Normal file
File diff suppressed because it is too large
Load Diff
673
libs/RevoEX/src/nhttp/d_nhttp.c
Normal file
673
libs/RevoEX/src/nhttp/d_nhttp.c
Normal file
@@ -0,0 +1,673 @@
|
||||
#include <private/nhttp.h>
|
||||
|
||||
#include <revolution/ncd.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
struct NHTTPBgnEndInfo
|
||||
{
|
||||
NCDIpConfig ipConfig;
|
||||
};
|
||||
|
||||
typedef s32 (*NHTTPPostSend)(const char* label, char** value_p,
|
||||
u32* length_p, s32 offset, void* userParam);
|
||||
|
||||
void* NHTTPi_GetSystemInfoP(void);
|
||||
NHTTPBgnEndInfo* NHTTPi_GetBgnEndInfoP(void* systemInfo);
|
||||
void* NHTTPi_GetMutexInfoP(void* systemInfo);
|
||||
BOOL NHTTPi_Startup(void* systemInfo, NHTTPAlloc alloc, NHTTPFree free,
|
||||
u32 priority);
|
||||
void NHTTPi_CleanupAsync(void* systemInfo, NHTTPCleanupCallback callback);
|
||||
s32 NHTTPi_GetError(NHTTPBgnEndInfo* info);
|
||||
void* NHTTPi_alloc(u32 size, int align);
|
||||
void NHTTPi_free(void* buffer);
|
||||
s32 NHTTPi_strlen(const char* string);
|
||||
void* NHTTPi_memcpy(void* destination, const void* source, u32 size);
|
||||
void* NHTTPi_memclr(void* destination, u32 size);
|
||||
s32 NHTTPi_Base64Encode(char* destination, const char* source);
|
||||
NHTTPConnectionInfo* NHTTPCreateConnection(const char* url, s32 method,
|
||||
void* buffer, u32 bufferSize, NHTTPConnectionCallback callback,
|
||||
void* userParam);
|
||||
s32 NHTTPStartConnection(NHTTPConnectionInfo* connection);
|
||||
s32 NHTTPGetBodyBuffer(NHTTPConnectionInfo* connection, void** buffer,
|
||||
u32* bufferSize);
|
||||
void* NHTTPGetUserParam(NHTTPConnectionInfo* connection);
|
||||
s32 NHTTPGetConnectionError(NHTTPConnectionInfo* connection);
|
||||
NHTTPConnectionInfo* NHTTPi_GetConnection(void* mutexInfo,
|
||||
NHTTPConnectionInfo* connection);
|
||||
NHTTPRequestInfo* NHTTPi_Connection2Request(void* mutexInfo,
|
||||
NHTTPConnectionInfo* connection);
|
||||
NHTTPResponseInfo* NHTTPi_Connection2Response(void* mutexInfo,
|
||||
NHTTPConnectionInfo* connection);
|
||||
NHTTPConnectionInfo* NHTTPi_Request2Connection(void* mutexInfo,
|
||||
NHTTPRequestInfo* request);
|
||||
NHTTPConnectionInfo* NHTTPi_Response2Connection(void* mutexInfo,
|
||||
NHTTPResponseInfo* response);
|
||||
NHTTPRequestInfo* NHTTPi_GetRequest(void* mutexInfo,
|
||||
NHTTPRequestInfo* request);
|
||||
NHTTPResponseInfo* NHTTPi_GetResponse(void* mutexInfo,
|
||||
NHTTPResponseInfo* response);
|
||||
s32 NHTTPi_OmitConnectionList(void* mutexInfo,
|
||||
NHTTPConnectionInfo* connection);
|
||||
u32 NHTTPi_GetVirtualContentLength(NHTTPConnectionInfo* connection);
|
||||
BOOL NHTTP_AddHeaderField(NHTTPRequestInfo* request, NHTTPBgnEndInfo* info,
|
||||
const char* name, const char* value);
|
||||
BOOL NHTTP_AddPostDataAscii(NHTTPRequestInfo* request, NHTTPBgnEndInfo* info,
|
||||
const char* name, const char* value);
|
||||
BOOL NHTTP_CancelRequestAsync(void* systemInfo, s32 requestId);
|
||||
void NHTTP_DestroyRequest(void* systemInfo, NHTTPRequestInfo* request);
|
||||
void NHTTP_DestroyResponse(void* mutexInfo, NHTTPResponseInfo* response);
|
||||
|
||||
static s32 nhttpRegistered = 0;
|
||||
|
||||
const char* __NHTTPVersion = "<< RVL_SDK - NHTTP \trelease build: Jun 27 2007 16:27:59 (0x4199_60726) >>";
|
||||
char __NHTTPUnofficialVersion[] = "<< RVL_SDK - NHTTP \trelease build: Jun 27 2007 16:27:59 (0x4199_60726) UNOFFICIAL >>";
|
||||
|
||||
s32 NHTTPStartup(NHTTPAlloc alloc, NHTTPFree free, u32 priority)
|
||||
{
|
||||
void* system = NHTTPi_GetSystemInfoP();
|
||||
if (nhttpRegistered == 0)
|
||||
{
|
||||
OSRegisterVersion(__NHTTPVersion);
|
||||
nhttpRegistered = TRUE;
|
||||
}
|
||||
return NHTTPi_Startup(system, alloc, free, priority) ? 0 : -1;
|
||||
}
|
||||
|
||||
void NHTTPCleanupAsync(NHTTPCleanupCallback callback)
|
||||
{
|
||||
NHTTPi_CleanupAsync(NHTTPi_GetSystemInfoP(), callback);
|
||||
}
|
||||
|
||||
s32 NHTTPGetError(void)
|
||||
{
|
||||
return NHTTPi_GetError(NHTTPi_GetSystemInfoP());
|
||||
}
|
||||
|
||||
static s32 NHTTPi_PostSendCallbackWrap(void* mutexInfo_p,
|
||||
NHTTPConnectionInfo* connection_p, void* arg_p)
|
||||
{
|
||||
if (connection_p != NULL)
|
||||
{
|
||||
NHTTPRequestInfo* req_p =
|
||||
NHTTPi_Connection2Request(mutexInfo_p, connection_p);
|
||||
if (req_p != NULL)
|
||||
{
|
||||
NHTTPPostSend postSend = (NHTTPPostSend)req_p->_unk250;
|
||||
if (postSend != NULL)
|
||||
{
|
||||
NHTTPPostSendArg* postSendArg_p = arg_p;
|
||||
return postSend(postSendArg_p->label,
|
||||
&postSendArg_p->buf, &postSendArg_p->size,
|
||||
postSendArg_p->offset,
|
||||
NHTTPGetUserParam(connection_p));
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
static s32 NHTTPi_BufFullCallbackWrap(void* mutexInfo_p,
|
||||
NHTTPConnectionInfo* connection_p, void* arg_p)
|
||||
{
|
||||
if (connection_p != NULL)
|
||||
{
|
||||
NHTTPResponseInfo* res_p =
|
||||
NHTTPi_Connection2Response(mutexInfo_p, connection_p);
|
||||
if (res_p != NULL)
|
||||
{
|
||||
NHTTPResponseCallback bufFull = res_p->bufFull;
|
||||
if (bufFull != NULL)
|
||||
{
|
||||
NHTTPBodyBufArg* bodyBufArg_p = arg_p;
|
||||
char* oldBuf_p = bodyBufArg_p->buf;
|
||||
u32 contentLength =
|
||||
NHTTPi_GetVirtualContentLength(connection_p);
|
||||
bodyBufArg_p->buf = bufFull((void**)&oldBuf_p,
|
||||
&bodyBufArg_p->size, contentLength, NHTTPi_alloc,
|
||||
NHTTPi_free, NHTTPGetUserParam(connection_p));
|
||||
if (bodyBufArg_p->buf != NULL && oldBuf_p != NULL)
|
||||
{
|
||||
bodyBufArg_p->offset = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static s32 NHTTPi_CompleteCallbackWrap(void* mutexInfo_p,
|
||||
NHTTPConnectionInfo* connection_p)
|
||||
{
|
||||
if (connection_p != NULL)
|
||||
{
|
||||
NHTTPReqCallback reqCallback = connection_p->requestCallback;
|
||||
if (reqCallback != NULL)
|
||||
{
|
||||
NHTTPResponseInfo* res_p =
|
||||
NHTTPi_Connection2Response(mutexInfo_p, connection_p);
|
||||
if (res_p != NULL)
|
||||
{
|
||||
NHTTPErr result = NHTTPGetConnectionError(connection_p);
|
||||
reqCallback(
|
||||
result, res_p, NHTTPGetUserParam(connection_p));
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 NHTTPi_TemplateConnectionCallback(NHTTPConnectionInfo* handle,
|
||||
NHTTPConnectionEvent event, void* arg_p)
|
||||
{
|
||||
void* sysInfo_p = NHTTPi_GetSystemInfoP();
|
||||
void* mutexInfo_p = NHTTPi_GetMutexInfoP(sysInfo_p);
|
||||
NHTTPConnectionInfo* connection_p =
|
||||
NHTTPi_GetConnection(mutexInfo_p, handle);
|
||||
s32 ret = 0;
|
||||
|
||||
switch (event)
|
||||
{
|
||||
case NHTTP_EVENT_POST_SEND:
|
||||
ret = NHTTPi_PostSendCallbackWrap(
|
||||
mutexInfo_p, connection_p, arg_p);
|
||||
break;
|
||||
case NHTTP_EVENT_BODY_RECV_FULL:
|
||||
ret = NHTTPi_BufFullCallbackWrap(
|
||||
mutexInfo_p, connection_p, arg_p);
|
||||
break;
|
||||
case NHTTP_EVENT_BODY_RECV_DONE:
|
||||
break;
|
||||
case NHTTP_EVENT_COMPLETE:
|
||||
ret = NHTTPi_CompleteCallbackWrap(mutexInfo_p, connection_p);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
NHTTPRequest* NHTTPCreateRequest(const char* url, NHTTPReqMethod method,
|
||||
void* buffer, u32 bufferSize, NHTTPReqCallback callback, void* userParam)
|
||||
{
|
||||
return NHTTPCreateRequestEx(url, method, buffer, bufferSize, callback, userParam, NULL, NULL);
|
||||
}
|
||||
|
||||
NHTTPRequest* NHTTPCreateRequestEx(const char* url, NHTTPReqMethod method,
|
||||
void* buffer, u32 bufferSize, NHTTPReqCallback callback, void* userParam,
|
||||
NHTTPResponseCallback responseCallback, NHTTPResponseCleanup cleanup)
|
||||
{
|
||||
void* systemInfo;
|
||||
void* mutexInfo;
|
||||
NHTTPConnectionInfo* connection;
|
||||
NHTTPRequestInfo* request;
|
||||
|
||||
connection = NHTTPCreateConnection(url, method, buffer, bufferSize, NHTTPi_TemplateConnectionCallback, userParam);
|
||||
request = NULL;
|
||||
if (connection != NULL)
|
||||
{
|
||||
systemInfo = NHTTPi_GetSystemInfoP();
|
||||
mutexInfo = NHTTPi_GetMutexInfoP(systemInfo);
|
||||
connection = NHTTPi_GetConnection(mutexInfo, connection);
|
||||
request = NHTTPi_Connection2Request(mutexInfo, connection);
|
||||
if (request != NULL)
|
||||
{
|
||||
if (request->response != NULL)
|
||||
{
|
||||
connection->requestCallback = callback;
|
||||
request->response->bufFull = responseCallback;
|
||||
request->response->freeBuf = cleanup;
|
||||
return request;
|
||||
}
|
||||
else
|
||||
{
|
||||
NHTTP_DestroyRequest(systemInfo, request);
|
||||
NHTTPi_OmitConnectionList(mutexInfo, connection);
|
||||
NHTTPi_free(connection);
|
||||
request = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
return request;
|
||||
}
|
||||
|
||||
s32 NHTTPDeleteRequest(NHTTPRequest* request)
|
||||
{
|
||||
NHTTPConnectionInfo* connection = NHTTPi_Request2Connection(
|
||||
NHTTPi_GetMutexInfoP(NHTTPi_GetSystemInfoP()), request);
|
||||
if (connection != NULL)
|
||||
{
|
||||
NHTTPDeleteConnection(connection);
|
||||
}
|
||||
}
|
||||
|
||||
s32 NHTTPAddHeaderField(NHTTPRequest* handle, const char* name,
|
||||
const char* value)
|
||||
{
|
||||
void* systemInfo;
|
||||
NHTTPRequestInfo* request;
|
||||
void* bgnEndInfo;
|
||||
|
||||
systemInfo = NHTTPi_GetSystemInfoP();
|
||||
request = NHTTPi_GetRequest(NHTTPi_GetMutexInfoP(systemInfo), handle);
|
||||
bgnEndInfo = NHTTPi_GetBgnEndInfoP(systemInfo);
|
||||
if (request == NULL)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
if (request->state != 0)
|
||||
{
|
||||
static char name[] = "NHTTPAddHeaderField";
|
||||
printf("%s can be called before NHTTPStartConnection()\n", name);
|
||||
return -1;
|
||||
}
|
||||
return NHTTP_AddHeaderField(request, bgnEndInfo, name, value) ? 0 : -1;
|
||||
}
|
||||
|
||||
s32 NHTTPAddPostDataAscii(NHTTPRequest* handle, const char* name,
|
||||
const char* value)
|
||||
{
|
||||
NHTTPRequestInfo* request;
|
||||
void* bgnEndInfo;
|
||||
|
||||
bgnEndInfo = NHTTPi_GetBgnEndInfoP(NHTTPi_GetSystemInfoP());
|
||||
request = NHTTPi_GetRequest(
|
||||
NHTTPi_GetMutexInfoP(NHTTPi_GetSystemInfoP()), handle);
|
||||
if (request == NULL)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
if (request->state != 0)
|
||||
{
|
||||
printf("%s can be called before NHTTPStartConnection()\n",
|
||||
"NHTTPAddPostDataAscii");
|
||||
return -1;
|
||||
}
|
||||
return NHTTP_AddPostDataAscii(request, bgnEndInfo, name, value)
|
||||
? 0
|
||||
: -1;
|
||||
}
|
||||
|
||||
s32 NHTTPAddPostDataBinary(NHTTPRequest* handle, const char* name,
|
||||
const char* value)
|
||||
{
|
||||
NHTTPRequestInfo* request;
|
||||
void* bgnEndInfo;
|
||||
|
||||
bgnEndInfo = NHTTPi_GetBgnEndInfoP(NHTTPi_GetSystemInfoP());
|
||||
request = NHTTPi_GetRequest(
|
||||
NHTTPi_GetMutexInfoP(NHTTPi_GetSystemInfoP()), handle);
|
||||
if (request == NULL)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
if (request->state != 0)
|
||||
{
|
||||
printf("%s can be called before NHTTPStartConnection()\n",
|
||||
"NHTTPAddPostDataBinary");
|
||||
return -1;
|
||||
}
|
||||
return NHTTP_AddPostDataAscii(request, bgnEndInfo, name, value)
|
||||
? 0
|
||||
: -1;
|
||||
}
|
||||
|
||||
s32 NHTTPAddPostDataRaw(NHTTPRequest* handle, const void* data,
|
||||
u32 size, const char* label)
|
||||
{
|
||||
NHTTPRequestInfo* request;
|
||||
|
||||
request = NHTTPi_GetRequest(
|
||||
NHTTPi_GetMutexInfoP(NHTTPi_GetSystemInfoP()), handle);
|
||||
if (request == NULL)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
if (request->state != 0)
|
||||
{
|
||||
printf("%s can be called before NHTTPStartConnection()\n",
|
||||
"NHTTPAddPostDataRaw");
|
||||
return -1;
|
||||
}
|
||||
if (request->postData != NULL)
|
||||
{
|
||||
printf("already called NHTTPAddPostDataAscii or NHTTPAddPostDataBinary (exclusive fucntion)\n");
|
||||
return -1;
|
||||
}
|
||||
request->isRawData = TRUE;
|
||||
request->postBuffer = data;
|
||||
request->postBufferSize = size;
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 NHTTPSetPostDataEncoding(NHTTPRequest* handle, u32 encodingType)
|
||||
{
|
||||
NHTTPRequestInfo* request;
|
||||
|
||||
request = NHTTPi_GetRequest(
|
||||
NHTTPi_GetMutexInfoP(NHTTPi_GetSystemInfoP()), handle);
|
||||
if (request == NULL)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
if (request->state != 0)
|
||||
{
|
||||
printf("%s can be called before NHTTPStartConnection()\n",
|
||||
"NHTTPSetPostDataEncoding");
|
||||
return -1;
|
||||
}
|
||||
request->encodingType = encodingType;
|
||||
return 0;
|
||||
}
|
||||
|
||||
NHTTPConnection NHTTPSendRequestAsync(NHTTPRequest* request)
|
||||
{
|
||||
NHTTPConnectionInfo* connection;
|
||||
s32 result;
|
||||
|
||||
connection = NHTTPi_Request2Connection(
|
||||
NHTTPi_GetMutexInfoP(NHTTPi_GetSystemInfoP()), request);
|
||||
if (connection != NULL && NHTTPStartConnection(connection) == 0)
|
||||
{
|
||||
result = connection->requestId;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = -1;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
s32 NHTTPCancelRequestAsync(NHTTPConnection connection)
|
||||
{
|
||||
return NHTTP_CancelRequestAsync(NHTTPi_GetSystemInfoP(), connection)
|
||||
? 0
|
||||
: -1;
|
||||
}
|
||||
|
||||
s32 NHTTPGetProgress(u32* complete, u32* total)
|
||||
{
|
||||
s32 result;
|
||||
result = NHTTP_GetProgress(NHTTPi_GetSystemInfoP(), complete, total)
|
||||
== 0;
|
||||
return -result;
|
||||
}
|
||||
|
||||
void NHTTPDestroyResponse(NHTTPResponse* handle)
|
||||
{
|
||||
void* mutexInfo;
|
||||
NHTTPConnectionInfo* connection;
|
||||
|
||||
mutexInfo = NHTTPi_GetMutexInfoP(NHTTPi_GetSystemInfoP());
|
||||
connection = NHTTPi_Response2Connection(mutexInfo, handle);
|
||||
if (connection != NULL)
|
||||
{
|
||||
if (NHTTPi_Connection2Response(mutexInfo, connection) != NULL)
|
||||
{
|
||||
NHTTP_DestroyResponse(mutexInfo, connection->response);
|
||||
}
|
||||
NHTTPi_OmitConnectionList(mutexInfo, connection);
|
||||
NHTTPi_free(connection);
|
||||
}
|
||||
}
|
||||
|
||||
s32 NHTTPGetHeaderField(NHTTPResponse* response, const char* name,
|
||||
const char** value)
|
||||
{
|
||||
void* mutexInfo;
|
||||
NHTTPResponseInfo* res;
|
||||
|
||||
mutexInfo = NHTTPi_GetMutexInfoP(NHTTPi_GetSystemInfoP());
|
||||
res = NHTTPi_GetResponse(mutexInfo, response);
|
||||
if (res == NULL)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
return NHTTP_GetHeaderField(res, name, value);
|
||||
}
|
||||
|
||||
s32 NHTTPGetHeaderAll(NHTTPResponse* response, const char** header)
|
||||
{
|
||||
void* systemInfo;
|
||||
NHTTPBgnEndInfo* bgnEndInfo;
|
||||
NHTTPResponseInfo* res;
|
||||
|
||||
systemInfo = NHTTPi_GetSystemInfoP();
|
||||
bgnEndInfo = NHTTPi_GetBgnEndInfoP(systemInfo);
|
||||
res = NHTTPi_GetResponse(NHTTPi_GetMutexInfoP(systemInfo), response);
|
||||
if (res == NULL)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
return NHTTP_GetHeaderAll(bgnEndInfo, res, header);
|
||||
}
|
||||
|
||||
s32 NHTTPGetBodyAll(NHTTPResponse* response, void** buffer)
|
||||
{
|
||||
NHTTPConnectionInfo* connection;
|
||||
u32 bufferSize;
|
||||
s32 result;
|
||||
|
||||
connection = NHTTPi_Response2Connection(
|
||||
NHTTPi_GetMutexInfoP(NHTTPi_GetSystemInfoP()), response);
|
||||
if (connection != NULL)
|
||||
{
|
||||
bufferSize = 0;
|
||||
result = NHTTPGetBodyBuffer(connection, buffer, &bufferSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = -1;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
s32 NHTTPGetResultCode(NHTTPResponse* handle)
|
||||
{
|
||||
NHTTPResponseInfo* response;
|
||||
response = NHTTPi_GetResponse(
|
||||
NHTTPi_GetMutexInfoP(NHTTPi_GetSystemInfoP()), handle);
|
||||
if (response == NULL)
|
||||
return -1;
|
||||
if (response->isHeaderParse != FALSE)
|
||||
return response->httpStatus;
|
||||
return -1;
|
||||
}
|
||||
|
||||
s32 NHTTPSetVerifyOption(NHTTPRequest* handle, u32 option)
|
||||
{
|
||||
NHTTPRequestInfo* request;
|
||||
s32 result;
|
||||
|
||||
request = NHTTPi_GetRequest(
|
||||
NHTTPi_GetMutexInfoP(NHTTPi_GetSystemInfoP()), handle);
|
||||
if (request == NULL)
|
||||
{
|
||||
result = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
request->verifyOption = option;
|
||||
result = 0;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
s32 NHTTPSetProxy(NHTTPRequest* handle, const char* proxy_p, u16 port,
|
||||
const char* username_p, const char* password_p)
|
||||
{
|
||||
void* sysInfo_p = NHTTPi_GetSystemInfoP();
|
||||
void* mutexInfo_p = NHTTPi_GetMutexInfoP(sysInfo_p);
|
||||
NHTTPRequestInfo* req_p = NHTTPi_GetRequest(mutexInfo_p, handle);
|
||||
s32 proxyLen = 0;
|
||||
|
||||
if (req_p == NULL || proxy_p == NULL)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
proxyLen = NHTTPi_strlen(proxy_p);
|
||||
if (proxyLen > 0x100)
|
||||
{
|
||||
printf("proxy-address exceeded 256 characters\n");
|
||||
return -1;
|
||||
}
|
||||
NHTTPi_memcpy(req_p->proxyServer, proxy_p, proxyLen);
|
||||
req_p->proxyPort = port;
|
||||
|
||||
if (username_p != NULL && password_p != NULL)
|
||||
{
|
||||
s32 username_len;
|
||||
s32 password_len;
|
||||
char tmpbuf[0x41];
|
||||
|
||||
username_len = NHTTPi_strlen(username_p);
|
||||
password_len = NHTTPi_strlen(password_p);
|
||||
if (username_len > 0x20)
|
||||
{
|
||||
printf("username exceeded 32 characters\n");
|
||||
return -1;
|
||||
}
|
||||
if (password_len > 0x20)
|
||||
{
|
||||
printf("password exceeded 32 characters\n");
|
||||
return -1;
|
||||
}
|
||||
NHTTPi_memclr(tmpbuf, sizeof(tmpbuf));
|
||||
NHTTPi_memcpy(tmpbuf, username_p, username_len);
|
||||
NHTTPi_memcpy(&(tmpbuf[username_len]), ":", 1);
|
||||
NHTTPi_memcpy(
|
||||
&(tmpbuf[(username_len + 1)]), password_p, password_len);
|
||||
req_p->proxyAuthorizationLength =
|
||||
NHTTPi_Base64Encode(req_p->proxyAuthorization, tmpbuf);
|
||||
}
|
||||
|
||||
req_p->proxyEnabled = TRUE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 NHTTPSetProxyDefault(NHTTPRequest* handle)
|
||||
{
|
||||
NCDProxyServerProfile* proxy;
|
||||
void* systemInfo;
|
||||
NHTTPBgnEndInfo* bgnEndInfo;
|
||||
NHTTPRequestInfo* request;
|
||||
const char* username;
|
||||
const char* password;
|
||||
s32 result;
|
||||
|
||||
systemInfo = NHTTPi_GetSystemInfoP();
|
||||
request = NHTTPi_GetRequest(NHTTPi_GetMutexInfoP(systemInfo), handle);
|
||||
bgnEndInfo = NHTTPi_GetBgnEndInfoP(systemInfo);
|
||||
if (request->secure != FALSE)
|
||||
{
|
||||
proxy = &bgnEndInfo->ipConfig.proxy.ssl;
|
||||
}
|
||||
else
|
||||
{
|
||||
proxy = &bgnEndInfo->ipConfig.proxy.http;
|
||||
}
|
||||
|
||||
if (proxy->mode == 1)
|
||||
{
|
||||
username = NULL;
|
||||
password = NULL;
|
||||
if (proxy->authType == 1)
|
||||
{
|
||||
username = proxy->username;
|
||||
password = proxy->password;
|
||||
}
|
||||
OSReport("Using proxy server %s:%d (%s/%s).\n", proxy->server, proxy->port, username != NULL ? username : "[no-auth]", password != NULL ? password : "[no-auth]");
|
||||
result = NHTTPSetProxy(request, proxy->server, proxy->port, username, password);
|
||||
if (result < 0)
|
||||
{
|
||||
OSReport("NHTTPSetProxy failed.(%d)\n", result);
|
||||
OSPanic("d_nhttp.c", 0x37d, "NHTTPSetProxy");
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("NCD proxy-settings are disabled\n");
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
s32 NHTTPSetRootCADefault(NHTTPRequest* handle)
|
||||
{
|
||||
s32 result;
|
||||
NHTTPRequestInfo* request;
|
||||
|
||||
request = NHTTPi_GetRequest(
|
||||
NHTTPi_GetMutexInfoP(NHTTPi_GetSystemInfoP()), handle);
|
||||
|
||||
if (request == NULL)
|
||||
{
|
||||
result = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
request->builtinRootCA = FALSE;
|
||||
request->rootCAData = NULL;
|
||||
request->rootCASize = 0;
|
||||
result = 0;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
s32 NHTTPSetClientCertDefault(NHTTPRequest* handle)
|
||||
{
|
||||
s32 result;
|
||||
NHTTPRequestInfo* request;
|
||||
|
||||
request = NHTTPi_GetRequest(
|
||||
NHTTPi_GetMutexInfoP(NHTTPi_GetSystemInfoP()), handle);
|
||||
|
||||
if (request == NULL)
|
||||
{
|
||||
result = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
request->builtinClientCert = FALSE;
|
||||
request->clientCertDefault = TRUE;
|
||||
request->clientCertData = NULL;
|
||||
request->clientCertSize = 0;
|
||||
request->privateKeyData = NULL;
|
||||
request->privateKeySize = 0;
|
||||
result = 0;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
s32 NHTTPDisableVerifyOptionForDebug(NHTTPRequest* handle, u32 option)
|
||||
{
|
||||
NHTTPRequestInfo* request;
|
||||
|
||||
request = NHTTPi_GetRequest(
|
||||
NHTTPi_GetMutexInfoP(NHTTPi_GetSystemInfoP()), handle);
|
||||
if (request == NULL)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
if (request->state != 0)
|
||||
{
|
||||
printf("%s can be called before NHTTPStartConnection()\n",
|
||||
"NHTTPDisableVerifyOptionForDebug");
|
||||
return -1;
|
||||
}
|
||||
{
|
||||
static s32 debugSet;
|
||||
if (debugSet == 0)
|
||||
{
|
||||
debugSet = 1;
|
||||
}
|
||||
}
|
||||
request->verifyOption &= ~option;
|
||||
return 0;
|
||||
}
|
||||
421
libs/RevoEX/src/nhttp/d_nhttp_common.c
Normal file
421
libs/RevoEX/src/nhttp/d_nhttp_common.c
Normal file
@@ -0,0 +1,421 @@
|
||||
#include <private/nhttp.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
typedef struct NHTTPSysInfo
|
||||
{
|
||||
u8 bgnEndInfo[0x800];
|
||||
NHTTPListInfo listInfo;
|
||||
NHTTPReqInfo reqInfo;
|
||||
u8 mutexInfo[0x34];
|
||||
u8 threadInfo[0x460];
|
||||
} NHTTPSysInfo;
|
||||
|
||||
typedef struct NHTTPStaticResource
|
||||
{
|
||||
BOOL initialized;
|
||||
OSMutex mutex;
|
||||
OSCond cond;
|
||||
u32 _unk24;
|
||||
u8 _unk28[0x18];
|
||||
} NHTTPStaticResource;
|
||||
|
||||
static NHTTPSysInfo sysInfo;
|
||||
static NHTTPSysInfo* sysInfo_p;
|
||||
static NHTTPConnectionInfo* sConnectionList;
|
||||
static NHTTPStaticResource NHTTPiStaticResource;
|
||||
|
||||
void NHTTPi_lockReqList(void* mutexInfo);
|
||||
void NHTTPi_unlockReqList(void* mutexInfo);
|
||||
void NHTTPi_InitBgnEndInfo(NHTTPBgnEndInfo* info);
|
||||
void NHTTPi_InitListInfo(NHTTPListInfo* info);
|
||||
void NHTTPi_InitRequestInfo(NHTTPReqInfo* info);
|
||||
void NHTTPi_InitMutexInfo(void* info);
|
||||
void NHTTPi_InitThreadInfo(void* info);
|
||||
NHTTPBgnEndInfo* NHTTPi_GetBgnEndInfoP(NHTTPSysInfo* sysInfo_p);
|
||||
NHTTPListInfo* NHTTPi_GetListInfoP(NHTTPSysInfo* sysInfo_p);
|
||||
NHTTPReqInfo* NHTTPi_GetReqInfoP(NHTTPSysInfo* sysInfo_p);
|
||||
void* NHTTPi_GetThreadInfoP(NHTTPSysInfo* sysInfo_p);
|
||||
void* NHTTPi_GetMutexInfoP(NHTTPSysInfo* sysInfo_p);
|
||||
|
||||
void NHTTPi_WaitForCompletion(NHTTPConnectionInfo* connection)
|
||||
{
|
||||
NHTTPStaticResource* res_p = &NHTTPiStaticResource;
|
||||
|
||||
if (!res_p->initialized)
|
||||
{
|
||||
OSInitMutex(&res_p->mutex);
|
||||
OSInitCond(&res_p->cond);
|
||||
res_p->initialized = TRUE;
|
||||
}
|
||||
OSLockMutex(&res_p->mutex);
|
||||
while (connection->_unkC != 0)
|
||||
{
|
||||
OSWaitCond(&res_p->cond, &res_p->mutex);
|
||||
}
|
||||
OSUnlockMutex(&res_p->mutex);
|
||||
}
|
||||
|
||||
void NHTTPi_NotifyCompletion(NHTTPConnectionInfo* connection)
|
||||
{
|
||||
NHTTPStaticResource* res_p = &NHTTPiStaticResource;
|
||||
|
||||
if (!res_p->initialized)
|
||||
{
|
||||
OSInitMutex(&res_p->mutex);
|
||||
OSInitCond(&res_p->cond);
|
||||
res_p->initialized = TRUE;
|
||||
}
|
||||
OSLockMutex(&res_p->mutex);
|
||||
connection->_unkC = 0;
|
||||
OSSignalCond(&res_p->cond);
|
||||
OSUnlockMutex(&res_p->mutex);
|
||||
}
|
||||
|
||||
NHTTPConnectionInfo* NHTTPi_ControlConnectionList(void* mutexInfo,
|
||||
void* handle, u32 mode)
|
||||
{
|
||||
NHTTPConnectionInfo* connection;
|
||||
NHTTPConnectionInfo* result;
|
||||
NHTTPConnectionInfo** current;
|
||||
|
||||
result = NULL;
|
||||
NHTTPi_lockReqList(mutexInfo);
|
||||
if (mode == 3)
|
||||
{
|
||||
connection = handle;
|
||||
connection->next = sConnectionList;
|
||||
sConnectionList = connection;
|
||||
result = connection;
|
||||
}
|
||||
else
|
||||
{
|
||||
current = &sConnectionList;
|
||||
while (*current != NULL)
|
||||
{
|
||||
connection = *current;
|
||||
switch (mode)
|
||||
{
|
||||
case 0:
|
||||
if (connection == handle)
|
||||
{
|
||||
result = connection;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (connection->request == handle)
|
||||
{
|
||||
result = connection;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (connection->response == handle)
|
||||
{
|
||||
result = connection;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (connection == handle)
|
||||
{
|
||||
*current = connection->next;
|
||||
result = connection;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (result != NULL)
|
||||
{
|
||||
break;
|
||||
}
|
||||
current = &(*current)->next;
|
||||
}
|
||||
}
|
||||
NHTTPi_unlockReqList(mutexInfo);
|
||||
return result;
|
||||
}
|
||||
|
||||
s32 NHTTPi_CommitConnectionList(void* mutexInfo_p,
|
||||
NHTTPConnectionInfo* connection_p)
|
||||
{
|
||||
return ((NHTTPi_ControlConnectionList(mutexInfo_p, connection_p, 3)
|
||||
!= NULL)
|
||||
? 0
|
||||
: -1);
|
||||
}
|
||||
|
||||
s32 NHTTPi_OmitConnectionList(void* mutexInfo_p,
|
||||
NHTTPConnectionInfo* connection_p)
|
||||
{
|
||||
return ((NHTTPi_ControlConnectionList(mutexInfo_p, connection_p, 4)
|
||||
!= NULL)
|
||||
? 0
|
||||
: -1);
|
||||
}
|
||||
|
||||
NHTTPRequestInfo* NHTTPi_Connection2Request(void* mutexInfo,
|
||||
NHTTPConnectionInfo* connection)
|
||||
{
|
||||
connection = NHTTPi_ControlConnectionList(mutexInfo, connection, 0);
|
||||
return connection != NULL ? connection->request : NULL;
|
||||
}
|
||||
|
||||
NHTTPResponseInfo* NHTTPi_Connection2Response(void* mutexInfo,
|
||||
NHTTPConnectionInfo* connection)
|
||||
{
|
||||
connection = NHTTPi_ControlConnectionList(mutexInfo, connection, 0);
|
||||
return connection != NULL ? connection->response : NULL;
|
||||
}
|
||||
|
||||
NHTTPConnectionInfo* NHTTPi_Request2Connection(void* mutexInfo,
|
||||
NHTTPRequestInfo* request)
|
||||
{
|
||||
return NHTTPi_ControlConnectionList(
|
||||
mutexInfo, request, 1);
|
||||
}
|
||||
|
||||
NHTTPConnectionInfo* NHTTPi_Response2Connection(void* mutexInfo,
|
||||
NHTTPResponseInfo* response)
|
||||
{
|
||||
return NHTTPi_ControlConnectionList(
|
||||
mutexInfo, response, 2);
|
||||
}
|
||||
|
||||
NHTTPConnectionInfo* NHTTPi_GetConnection(void* mutexInfo,
|
||||
NHTTPConnectionInfo* connection)
|
||||
{
|
||||
return NHTTPi_ControlConnectionList(mutexInfo, connection, 0);
|
||||
}
|
||||
|
||||
NHTTPRequestInfo* NHTTPi_GetRequest(void* mutexInfo,
|
||||
NHTTPRequestInfo* request)
|
||||
{
|
||||
NHTTPConnectionInfo* connection;
|
||||
|
||||
connection = NHTTPi_ControlConnectionList(
|
||||
mutexInfo, request, 0);
|
||||
return connection != NULL ? connection->request : request;
|
||||
}
|
||||
|
||||
NHTTPResponseInfo* NHTTPi_GetResponse(void* mutexInfo,
|
||||
NHTTPResponseInfo* response)
|
||||
{
|
||||
NHTTPConnectionInfo* connection;
|
||||
|
||||
connection = NHTTPi_ControlConnectionList(
|
||||
mutexInfo, response, 0);
|
||||
return connection != NULL ? connection->response : response;
|
||||
}
|
||||
|
||||
s32 NHTTPi_GetConnectionListLength(void)
|
||||
{
|
||||
NHTTPConnectionInfo* connection;
|
||||
s32 length;
|
||||
|
||||
connection = sConnectionList;
|
||||
length = 0;
|
||||
while (connection != NULL)
|
||||
{
|
||||
connection = connection->next;
|
||||
length++;
|
||||
}
|
||||
return length;
|
||||
}
|
||||
|
||||
s32 NHTTPi_PostSendCallback(void* mutexInfo,
|
||||
NHTTPConnectionInfo* connection, void* value, u32 arg)
|
||||
{
|
||||
u32 callbackArg4;
|
||||
u32 callbackArg8;
|
||||
s32 result;
|
||||
NHTTPResponseInfo* response;
|
||||
NHTTPConnectionCallbackParam param;
|
||||
|
||||
result = -1;
|
||||
if (NHTTPi_GetConnection(mutexInfo, connection) != NULL)
|
||||
{
|
||||
response = NHTTPi_Connection2Response(mutexInfo, connection);
|
||||
if (response != NULL && connection->callback != NULL)
|
||||
{
|
||||
param.value = value;
|
||||
param._unk4 = connection->_unk24;
|
||||
param._unk8 = connection->_unk28;
|
||||
param._unkC = arg;
|
||||
result = connection->callback(connection, 1, ¶m);
|
||||
callbackArg8 = param._unk8;
|
||||
callbackArg4 = param._unk4;
|
||||
|
||||
connection = NHTTPi_GetConnection(mutexInfo, connection);
|
||||
if (connection != NULL)
|
||||
{
|
||||
connection->_unk24 = callbackArg4;
|
||||
connection->_unk28 = callbackArg8;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void NHTTPi_BufferFullCallback(void* mutexInfo,
|
||||
NHTTPConnectionInfo* connection)
|
||||
{
|
||||
void* buffer;
|
||||
u32 bufferSize;
|
||||
s32 responseResult;
|
||||
NHTTPResponseInfo* response;
|
||||
NHTTPConnectionCallbackParam param;
|
||||
|
||||
if (NHTTPi_GetConnection(mutexInfo, connection) != NULL)
|
||||
{
|
||||
response = NHTTPi_Connection2Response(mutexInfo, connection);
|
||||
if (response != NULL && connection->callback != NULL)
|
||||
{
|
||||
param.value = response->recvBuf_p;
|
||||
param._unk4 = response->recvBufLen;
|
||||
param._unk8 = response->bodyLen;
|
||||
connection->callback(connection, 2, ¶m);
|
||||
responseResult = param._unk8;
|
||||
bufferSize = param._unk4;
|
||||
buffer = param.value;
|
||||
|
||||
connection = NHTTPi_GetConnection(mutexInfo, connection);
|
||||
if (connection != NULL)
|
||||
{
|
||||
response = NHTTPi_Connection2Response(mutexInfo, connection);
|
||||
if (response != NULL)
|
||||
{
|
||||
response->recvBuf_p = buffer;
|
||||
response->recvBufLen = bufferSize;
|
||||
response->bodyLen = responseResult;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void NHTTPi_ReceivedCallback(void* mutexInfo,
|
||||
NHTTPConnectionInfo* connection)
|
||||
{
|
||||
void* buffer;
|
||||
u32 bufferSize;
|
||||
s32 responseResult;
|
||||
NHTTPResponseInfo* response;
|
||||
NHTTPConnectionCallbackParam param;
|
||||
|
||||
if (NHTTPi_GetConnection(mutexInfo, connection) != NULL)
|
||||
{
|
||||
response = NHTTPi_Connection2Response(mutexInfo, connection);
|
||||
if (response != NULL && connection->callback != NULL)
|
||||
{
|
||||
param.value = response->recvBuf_p;
|
||||
param._unk4 = response->recvBufLen;
|
||||
param._unk8 = response->bodyLen;
|
||||
connection->callback(connection, 3, ¶m);
|
||||
responseResult = param._unk8;
|
||||
bufferSize = param._unk4;
|
||||
buffer = param.value;
|
||||
|
||||
connection = NHTTPi_GetConnection(mutexInfo, connection);
|
||||
if (connection != NULL)
|
||||
{
|
||||
response = NHTTPi_Connection2Response(mutexInfo, connection);
|
||||
if (response != NULL)
|
||||
{
|
||||
response->recvBuf_p = buffer;
|
||||
response->recvBufLen = bufferSize;
|
||||
response->bodyLen = responseResult;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void NHTTPi_CompleteCallback(void* mutexInfo,
|
||||
NHTTPConnectionInfo* connection)
|
||||
{
|
||||
if (NHTTPi_GetConnection(mutexInfo, connection) != NULL
|
||||
&& connection->callback != NULL)
|
||||
{
|
||||
connection->callback(connection, 4, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static void NHTTPi_InitSystemInfo(NHTTPSysInfo* sysInfo_p)
|
||||
{
|
||||
NHTTPi_InitBgnEndInfo(NHTTPi_GetBgnEndInfoP(sysInfo_p));
|
||||
NHTTPi_InitListInfo(NHTTPi_GetListInfoP(sysInfo_p));
|
||||
NHTTPi_InitRequestInfo(NHTTPi_GetReqInfoP(sysInfo_p));
|
||||
NHTTPi_InitMutexInfo(NHTTPi_GetMutexInfoP(sysInfo_p));
|
||||
NHTTPi_InitThreadInfo(NHTTPi_GetThreadInfoP(sysInfo_p));
|
||||
}
|
||||
|
||||
NHTTPSysInfo* NHTTPi_GetSystemInfoP(void)
|
||||
{
|
||||
if (sysInfo_p == NULL)
|
||||
{
|
||||
sysInfo_p = &sysInfo;
|
||||
NHTTPi_InitSystemInfo(sysInfo_p);
|
||||
}
|
||||
return sysInfo_p;
|
||||
}
|
||||
|
||||
NHTTPBgnEndInfo* NHTTPi_GetBgnEndInfoP(NHTTPSysInfo* sysInfo_p)
|
||||
{
|
||||
return (NHTTPBgnEndInfo*)sysInfo_p->bgnEndInfo;
|
||||
}
|
||||
|
||||
NHTTPListInfo* NHTTPi_GetListInfoP(NHTTPSysInfo* sysInfo_p)
|
||||
{
|
||||
return &sysInfo_p->listInfo;
|
||||
}
|
||||
|
||||
NHTTPReqInfo* NHTTPi_GetReqInfoP(NHTTPSysInfo* sysInfo_p)
|
||||
{
|
||||
return &sysInfo_p->reqInfo;
|
||||
}
|
||||
|
||||
void* NHTTPi_GetThreadInfoP(NHTTPSysInfo* sysInfo_p)
|
||||
{
|
||||
return sysInfo_p->threadInfo;
|
||||
}
|
||||
|
||||
void* NHTTPi_GetMutexInfoP(NHTTPSysInfo* sysInfo_p)
|
||||
{
|
||||
return sysInfo_p->mutexInfo;
|
||||
}
|
||||
|
||||
void NHTTPi_SetVirtualContentLength(NHTTPConnectionInfo* connection,
|
||||
u32 length)
|
||||
{
|
||||
if (connection != NULL)
|
||||
{
|
||||
connection->virtualContentLength = length;
|
||||
}
|
||||
}
|
||||
|
||||
u32 NHTTPi_GetVirtualContentLength(NHTTPConnectionInfo* connection)
|
||||
{
|
||||
return connection != NULL ? connection->virtualContentLength : 0;
|
||||
}
|
||||
|
||||
void NHTTPi_InitConnectionList(void)
|
||||
{
|
||||
NHTTPConnectionInfo* connection;
|
||||
s32 count;
|
||||
|
||||
connection = sConnectionList;
|
||||
if (connection != NULL)
|
||||
{
|
||||
count = 0;
|
||||
while (connection != NULL)
|
||||
{
|
||||
connection = connection->next;
|
||||
count++;
|
||||
}
|
||||
if (count != 0)
|
||||
{
|
||||
printf("*warning: %d connections rests! Please free connections.\n",
|
||||
count);
|
||||
}
|
||||
}
|
||||
sConnectionList = NULL;
|
||||
}
|
||||
2068
libs/RevoEX/src/nwc24/NWC24Download.c
Normal file
2068
libs/RevoEX/src/nwc24/NWC24Download.c
Normal file
File diff suppressed because it is too large
Load Diff
1130
src/keyboard/MyTiManager.cpp
Normal file
1130
src/keyboard/MyTiManager.cpp
Normal file
File diff suppressed because it is too large
Load Diff
147
src/scene/memoryCard/iplGCSaveData.cpp
Normal file
147
src/scene/memoryCard/iplGCSaveData.cpp
Normal file
@@ -0,0 +1,147 @@
|
||||
#define IPL_CHANNEL_TITLE_NOVTABLE
|
||||
#include "scene/memoryCard/iplGCSaveData.h"
|
||||
|
||||
#include "scene/memoryCard/iplMemoryCard.h"
|
||||
#include "scene/textBalloon/iplBalloon.h"
|
||||
|
||||
#include "iplSound.h"
|
||||
#include "iplSystem.h"
|
||||
#undef IPL_CHANNEL_TITLE_NOVTABLE
|
||||
|
||||
namespace ipl {
|
||||
namespace scene {
|
||||
static const MemoryBase::AnmName scAnmName[] = {
|
||||
{"it_ObjCubeEdit_b_SaveDataIn.brlan", "G_Data"},
|
||||
{"it_ObjCubeEdit_b_SaveDataOut.brlan", "G_Data"},
|
||||
{"it_ObjCubeEdit_b_SaveDataFoucusIn.brlan", "G_Data"},
|
||||
{"it_ObjCubeEdit_b_SaveDataFoucusOut.brlan", "G_Data"},
|
||||
{"it_ObjCubeEdit_b_SaveDataFlash.brlan", "G_DataFlash"},
|
||||
};
|
||||
static const char* scDataPaneName = "B_Data_00";
|
||||
|
||||
|
||||
GCSaveData::GCSaveData(EGG::Heap* heap, nand::LayoutFile* layoutFile, const char* directory, const char* fileName,
|
||||
math::VEC3 translate) {
|
||||
mpBalloon = NULL;
|
||||
mpLayout = new layout::Object(heap, layoutFile, directory, fileName);
|
||||
add_animation(scAnmName, 5);
|
||||
mpLayout->finishBinding();
|
||||
|
||||
mpEvent = new MemoryBaseEvent(this);
|
||||
mpPaneManager = new gui::PaneManager(mpEvent, mpLayout->getDrawInfo(), NULL, NULL, true);
|
||||
mpPaneManager->setupScene(mpLayout);
|
||||
mpPaneManager->setAllComponentTriggerTarget(false);
|
||||
|
||||
mpPaneManager->setTriggerTarget(mpLayout->FindPaneByName(scDataPaneName), true);
|
||||
|
||||
add_anmbutton(scDataPaneName, get_animation(2), get_animation(3), NULL);
|
||||
|
||||
setTranslate(translate);
|
||||
}
|
||||
|
||||
void GCSaveData::calc() {
|
||||
mpLayout->calc();
|
||||
mpPaneManager->calc();
|
||||
get_anmbutton(scDataPaneName)->calc();
|
||||
}
|
||||
|
||||
void GCSaveData::draw() {
|
||||
nw4r::lyt::Pane* pane = mpLayout->FindPaneByName("DataBanner_00");
|
||||
nw4r::lyt::Material* material = pane->FindMaterialByName("DataBanner_00");
|
||||
pane->SetVisible(true);
|
||||
|
||||
if (static_cast<MemoryCard*>(System::getScene(0xE))->getManager()->isIconValidate(mSlot, mIndex) &&
|
||||
static_cast<MemoryCard*>(System::getScene(0xE))->getManager()->create_icon(mSlot, mIndex) != NULL) {
|
||||
material->SetTexture(0, *static_cast<MemoryCard*>(System::getScene(0xE))
|
||||
->getManager()
|
||||
->create_icon(mSlot, mIndex));
|
||||
} else {
|
||||
pane->SetVisible(false);
|
||||
}
|
||||
|
||||
if (mIndex >= 0 && mIndex < 0x7f) {
|
||||
mpLayout->draw();
|
||||
} else {
|
||||
if (mpBalloon != NULL) {
|
||||
mpBalloon->terminate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GCSaveData::update() {
|
||||
if (mIndex < 0) {
|
||||
return;
|
||||
}
|
||||
if (mIndex >= 0x7f) {
|
||||
return;
|
||||
}
|
||||
mpPaneManager->update();
|
||||
}
|
||||
|
||||
void GCSaveData::onPoint(const char* paneName, controller::Interface* controller) {
|
||||
AnmButton* button = get_anmbutton(paneName);
|
||||
if (button != NULL) {
|
||||
if (button->unk_0x04 == 0) {
|
||||
if (System::getScene(0xE) != NULL) {
|
||||
if (static_cast<MemoryCard*>(System::getScene(0xE))
|
||||
->getManager()
|
||||
->isIconValidate(mSlot, mIndex)) {
|
||||
mpBalloon->init(static_cast<MemoryCard*>(System::getScene(0xE))
|
||||
->getManager()
|
||||
->getComment(mSlot, mIndex, 0),
|
||||
0);
|
||||
get_anmbutton(scDataPaneName)->setBalloon(mpBalloon);
|
||||
} else {
|
||||
get_anmbutton(scDataPaneName)->setBalloon(NULL);
|
||||
}
|
||||
}
|
||||
snd::getSystem()->startSE("WIPL_SE_BT_TARGETTING");
|
||||
if (controller != NULL) {
|
||||
controller->rumble(0);
|
||||
}
|
||||
button->onCmdRecv(1);
|
||||
}
|
||||
button->unk_0x04++;
|
||||
}
|
||||
}
|
||||
|
||||
void GCSaveData::onLeft(const char* paneName) {
|
||||
AnmButton* button = get_anmbutton(paneName);
|
||||
if (button != NULL) {
|
||||
if (button->unk_0x04 == 1) {
|
||||
button->onCmdRecv(2);
|
||||
}
|
||||
button->unk_0x04--;
|
||||
}
|
||||
}
|
||||
|
||||
void GCSaveData::onTrig(const char* paneName) {
|
||||
if (static_cast<MemoryCard*>(System::getScene(0xE)) != NULL &&
|
||||
static_cast<MemoryCard*>(System::getScene(0xE))->getManager()->isIconValidate(mSlot, mIndex) &&
|
||||
get_anmbutton(paneName) != NULL) {
|
||||
static_cast<MemoryCard*>(System::getScene(0xE))->onFocus(this);
|
||||
}
|
||||
}
|
||||
|
||||
void GCSaveData::setTranslate(const nw4r::math::VEC3& translate) {
|
||||
mpLayout->FindPaneByName("N_Data_00")->SetTranslate(translate);
|
||||
}
|
||||
|
||||
const nw4r::math::VEC3* GCSaveData::getTranslate() {
|
||||
return &mpLayout->FindPaneByName("N_Data_00")->GetTranslate();
|
||||
}
|
||||
|
||||
void GCSaveData::init() {
|
||||
clear_button(scDataPaneName);
|
||||
if (mpBalloon != NULL) {
|
||||
mpBalloon->terminate();
|
||||
}
|
||||
}
|
||||
|
||||
void GCSaveData::setBalloon(TextBalloon* balloon) {
|
||||
mpBalloon = balloon;
|
||||
}
|
||||
|
||||
GCSaveData::~GCSaveData() {}
|
||||
} // namespace scene
|
||||
} // namespace ipl
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
2725
src/scene/setting/AOSS.c
Normal file
2725
src/scene/setting/AOSS.c
Normal file
File diff suppressed because it is too large
Load Diff
425
src/scene/setting/AOSSLink.c
Normal file
425
src/scene/setting/AOSSLink.c
Normal file
@@ -0,0 +1,425 @@
|
||||
#include <string.h>
|
||||
|
||||
#include <revolution/types.h>
|
||||
#include <revolution/os.h>
|
||||
#include <revolution/soex.h>
|
||||
|
||||
void OSSetAlarm();
|
||||
|
||||
s32 NCDLockWirelessDriver(void);
|
||||
s32 NCDUnlockWirelessDriver(s32 id);
|
||||
s32 NCDSetIpConfig(void* ipConfig);
|
||||
s32 NCDSetIfConfig(void* ifConfig);
|
||||
BOOL NCDIsInterfaceDecided(void);
|
||||
|
||||
s32 WD_Startup(u32 flags);
|
||||
s32 WD_Cleanup(void);
|
||||
s32 WD_Scan(void* params, u8* buffer, u32 bufferLen);
|
||||
s32 WD_GetInfo(void* info);
|
||||
|
||||
static u8 sConf[352];
|
||||
static u8 sIpConfig[1992];
|
||||
|
||||
static void (*AOSSi_callback)(void);
|
||||
static void (*AOSSi_free)(u32 id, void* ptr, s32 size);
|
||||
static void* (*AOSSi_alloc)(u32 id, s32 size);
|
||||
static u32 AOSSi_dns2;
|
||||
static u32 AOSSi_dns1;
|
||||
static u32 AOSSi_gateway;
|
||||
static u32 AOSSi_netmask;
|
||||
static u32 AOSSi_ipAddr;
|
||||
static s32 AOSSi_cancel_flag;
|
||||
|
||||
static u16 sRateTable[12][2] = {
|
||||
{0x0001, 0x0200}, {0x0002, 0x0400}, {0x0004, 0x0B00},
|
||||
{0x0008, 0x0C00}, {0x0010, 0x1200}, {0x0020, 0x1600},
|
||||
{0x0040, 0x1800}, {0x0080, 0x2400}, {0x0100, 0x3000},
|
||||
{0x0200, 0x4800}, {0x0400, 0x6000}, {0x0800, 0x6C00},
|
||||
};
|
||||
|
||||
void AOSSi_Cancel(void) {
|
||||
AOSSi_cancel_flag = 1;
|
||||
}
|
||||
|
||||
static void AOSS_813FD17C(OSAlarm* alarm, OSContext* context) {
|
||||
OSSendMessage((OSMessageQueue*)alarm->tag, NULL, FALSE);
|
||||
}
|
||||
|
||||
static void AOSS_813FD18C(u32 ms) {
|
||||
OSMessage queueBuffer;
|
||||
OSMessage message;
|
||||
OSMessageQueue queue;
|
||||
OSAlarm alarm;
|
||||
|
||||
OSInitMessageQueue(&queue, &queueBuffer, 1);
|
||||
OSCreateAlarm(&alarm);
|
||||
OSSetAlarmTag(&alarm, (u32)&queue);
|
||||
OSSetAlarm(&alarm, *(u32*)0x800000F8 >> 2, 0, ms * (OS_TIMER_CLOCK / 1000), AOSS_813FD17C);
|
||||
OSReceiveMessage(&queue, &message, TRUE);
|
||||
}
|
||||
|
||||
typedef struct WD_Info_ {
|
||||
u8 MAC[6];
|
||||
u16 enableChannel;
|
||||
u16 NTRallowedChannel;
|
||||
u8 countryCode[4];
|
||||
u8 channel;
|
||||
u8 initialized;
|
||||
u8 version[80];
|
||||
u8 unk_0x60[0x30];
|
||||
} WD_Info;
|
||||
|
||||
typedef struct WDScanParam_ {
|
||||
u16 channelBit;
|
||||
u16 maxChannelTime;
|
||||
u8 bssid[6];
|
||||
u16 type;
|
||||
u16 ssidLength;
|
||||
u8 ssid[32];
|
||||
u8 ssidMask[32];
|
||||
} WDScanParam;
|
||||
|
||||
typedef struct WDBssDesc_ {
|
||||
u16 length;
|
||||
u16 rssi;
|
||||
u8 bssid[6];
|
||||
u16 ssidLength;
|
||||
u8 ssid[32];
|
||||
u16 capabilities;
|
||||
struct {
|
||||
u16 basic;
|
||||
u16 support;
|
||||
} rateSet;
|
||||
u16 beaconPeriod;
|
||||
u16 dtimPeriod;
|
||||
u16 channel;
|
||||
u16 cfPeriod;
|
||||
u16 cfMaxDuration;
|
||||
u16 ieLength;
|
||||
} WDBssDesc;
|
||||
|
||||
void* AOSSi_Alloc(s32 size) {
|
||||
if (AOSSi_alloc != NULL) {
|
||||
return AOSSi_alloc(0, size);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void AOSSi_Free(void* ptr) {
|
||||
if (AOSSi_free != NULL) {
|
||||
AOSSi_free(0, ptr, 0);
|
||||
}
|
||||
}
|
||||
|
||||
static void AOSS_813FD25C(u8* dst, u32 val) {
|
||||
int i;
|
||||
for (i = 0; i < 4; i++) {
|
||||
dst[i] = val >> ((3 - i) * 8);
|
||||
}
|
||||
}
|
||||
|
||||
s32 AOSSi_SetNCDIPAddr(u32 ip, u32 mask, u32 gateway, u32 dns1, u32 dns2) {
|
||||
AOSS_813FD25C((u8*)&AOSSi_ipAddr, ip);
|
||||
AOSS_813FD25C((u8*)&AOSSi_netmask, mask);
|
||||
AOSS_813FD25C((u8*)&AOSSi_gateway, gateway);
|
||||
AOSS_813FD25C((u8*)&AOSSi_dns1, dns1);
|
||||
AOSS_813FD25C((u8*)&AOSSi_dns2, dns2);
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 AOSSi_InitLocal(void* (*alloc)(u32 id, s32 size),
|
||||
void (*free_)(u32 id, void* ptr, s32 size)) {
|
||||
BOOL level;
|
||||
|
||||
if (alloc == NULL || free_ == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
level = OSDisableInterrupts();
|
||||
AOSSi_alloc = alloc;
|
||||
AOSSi_free = free_;
|
||||
AOSSi_cancel_flag = 0;
|
||||
OSRestoreInterrupts(level);
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 AOSSi_EndLocal(void) {
|
||||
BOOL level;
|
||||
|
||||
level = OSDisableInterrupts();
|
||||
AOSSi_alloc = NULL;
|
||||
AOSSi_free = NULL;
|
||||
OSRestoreInterrupts(level);
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 AOSSi_WLANGetBSSList(u32** out) {
|
||||
u8 mac[6];
|
||||
WDScanParam ATTRIBUTE_ALIGN(32) req;
|
||||
WD_Info ATTRIBUTE_ALIGN(32) info;
|
||||
u8* buf;
|
||||
u32* list;
|
||||
u8* src;
|
||||
u8* dst;
|
||||
int count;
|
||||
int i;
|
||||
int j;
|
||||
int n;
|
||||
s32 result = -1;
|
||||
int retry = 0;
|
||||
int uretry = 0;
|
||||
int cretry = 0;
|
||||
int rescan = 0;
|
||||
s32 lock;
|
||||
s32 err;
|
||||
|
||||
if (AOSSi_alloc == 0 || AOSSi_free == 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
lock = NCDLockWirelessDriver();
|
||||
if (lock <= 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
if (WD_Startup(3) == 0) {
|
||||
break;
|
||||
}
|
||||
if (retry > 10) {
|
||||
goto unlock;
|
||||
}
|
||||
retry++;
|
||||
AOSS_813FD18C(10);
|
||||
}
|
||||
|
||||
if (WD_GetInfo(&info) == 0) {
|
||||
memcpy(mac, info.MAC, 6);
|
||||
}
|
||||
|
||||
buf = AOSSi_Alloc(0x3200);
|
||||
if (buf == 0) {
|
||||
goto cleanup;
|
||||
}
|
||||
memset(buf, 0, 0x3200);
|
||||
|
||||
req.channelBit = info.enableChannel;
|
||||
req.maxChannelTime = 0x28;
|
||||
memset(req.bssid, 0xFF, 6);
|
||||
req.type = 0;
|
||||
req.ssidLength = 0;
|
||||
memset(req.ssid, 0, 0x20);
|
||||
memset(req.ssidMask, 0xFF, 0x20);
|
||||
|
||||
scan:
|
||||
err = WD_Scan(&req, buf, 0x3200);
|
||||
if (err != 0 && (u32)(err - 0x80000000) != 0x8004) {
|
||||
goto free;
|
||||
}
|
||||
|
||||
count = *(u16*)buf;
|
||||
if (count == 0) {
|
||||
goto rescan;
|
||||
}
|
||||
|
||||
list = AOSSi_Alloc((count - 1) * 0x54 + 0x58);
|
||||
if (list == 0) {
|
||||
result = -1;
|
||||
goto free;
|
||||
}
|
||||
list[0] = count;
|
||||
|
||||
src = buf + 2;
|
||||
dst = (u8*)list;
|
||||
for (i = 0; i < count; i++) {
|
||||
u32 off = i * 0x54;
|
||||
*(u32*)(dst + off + 4) = ((WDBssDesc*)src)->ssidLength;
|
||||
memcpy(dst + off + 8, ((WDBssDesc*)src)->ssid, 0x20);
|
||||
*(u32*)(dst + off + 0x28) = ((WDBssDesc*)src)->channel;
|
||||
memcpy(dst + off + 0x34, ((WDBssDesc*)src)->bssid, 6);
|
||||
|
||||
n = 0;
|
||||
for (j = 0; j < 12; j++) {
|
||||
if (((WDBssDesc*)src)->rateSet.support & sRateTable[j][0]) {
|
||||
dst[off + 0x40 + n] = ((u8*)sRateTable)[j * 4 + 2];
|
||||
if (((WDBssDesc*)src)->rateSet.basic & sRateTable[j][0]) {
|
||||
dst[off + 0x40 + n] |= 0x80;
|
||||
}
|
||||
n++;
|
||||
}
|
||||
}
|
||||
*(u32*)(dst + off + 0x3C) = n;
|
||||
|
||||
*(u32*)(dst + off + 0x50) = ((WDBssDesc*)src)->beaconPeriod;
|
||||
if ((((WDBssDesc*)src)->capabilities & 3) == 1) {
|
||||
*(u32*)(dst + off + 0x54) = 1;
|
||||
}
|
||||
else if ((((WDBssDesc*)src)->capabilities & 3) == 2) {
|
||||
*(u32*)(dst + off + 0x54) = 2;
|
||||
}
|
||||
else {
|
||||
*(u32*)(dst + off + 0x54) = 0;
|
||||
}
|
||||
|
||||
src += ((WDBssDesc*)src)->length * 2;
|
||||
}
|
||||
|
||||
*out = list;
|
||||
result = 0;
|
||||
goto free;
|
||||
|
||||
rescan:
|
||||
if (AOSSi_cancel_flag == 1) {
|
||||
result = -1;
|
||||
goto free;
|
||||
}
|
||||
rescan++;
|
||||
if (rescan > 10) {
|
||||
list = AOSSi_Alloc(0x58);
|
||||
if (list == 0) {
|
||||
result = -1;
|
||||
goto free;
|
||||
}
|
||||
list[0] = 0;
|
||||
result = 0;
|
||||
*out = list;
|
||||
goto free;
|
||||
}
|
||||
AOSS_813FD18C(100);
|
||||
goto scan;
|
||||
|
||||
free:
|
||||
if (AOSSi_free != 0) {
|
||||
AOSSi_free(0, buf, 0);
|
||||
}
|
||||
|
||||
cleanup:
|
||||
while (WD_Cleanup() != 0) {
|
||||
if (cretry > 10) {
|
||||
result = -1;
|
||||
break;
|
||||
}
|
||||
cretry++;
|
||||
AOSS_813FD18C(10);
|
||||
}
|
||||
|
||||
unlock:
|
||||
while (NCDUnlockWirelessDriver(lock) != 0) {
|
||||
if (uretry > 10) {
|
||||
result = -1;
|
||||
break;
|
||||
}
|
||||
uretry++;
|
||||
AOSS_813FD18C(10);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
s32 AOSSi_WLANConnect(u32* in, u32* out) {
|
||||
WD_Info ATTRIBUTE_ALIGN(32) info;
|
||||
int count = 0;
|
||||
int ret;
|
||||
u8* conf = sConf;
|
||||
u8* ipcfg;
|
||||
|
||||
memset(conf, 0, 0x15E);
|
||||
conf[0] = 1;
|
||||
*(u16*)(conf + 2) = 0;
|
||||
conf[4] = 0;
|
||||
|
||||
if (in[0x28 / 4] == 0) {
|
||||
*(u16*)(conf + 0x2A) = 0;
|
||||
}
|
||||
if (in[0x28 / 4] == 5) {
|
||||
*(u16*)(conf + 0x2A) = 1;
|
||||
*(u16*)(conf + 0x2E) = 0;
|
||||
memcpy(conf + 0x32, (u8*)in + 0x2C, in[0x28 / 4]);
|
||||
}
|
||||
else if (in[0x28 / 4] == 0xD) {
|
||||
*(u16*)(conf + 0x2A) = 2;
|
||||
*(u16*)(conf + 0x2E) = 0;
|
||||
memcpy(conf + 0x32, (u8*)in + 0x2C, in[0x28 / 4]);
|
||||
}
|
||||
else if (in[0x28 / 4] == 0x10) {
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
return -1;
|
||||
}
|
||||
|
||||
*(u16*)(conf + 0x26) = in[0] & 0xFF;
|
||||
memcpy(conf + 6, (u8*)in + 4, in[0]);
|
||||
|
||||
ipcfg = sIpConfig;
|
||||
ret = 0;
|
||||
memset(ipcfg, 0, 0x7C4);
|
||||
*(u32*)(ipcfg + 0x1C) = 0x514;
|
||||
*(u32*)(ipcfg + 0x20) = 0x64;
|
||||
*(u32*)(ipcfg + 0x24) = 4;
|
||||
*(u32*)(ipcfg + 0) = 0;
|
||||
*(u32*)(ipcfg + 4) = 0;
|
||||
memcpy(ipcfg + 8, &AOSSi_ipAddr, 4);
|
||||
memcpy(ipcfg + 0xC, &AOSSi_netmask, 4);
|
||||
memcpy(ipcfg + 0x10, &AOSSi_gateway, 4);
|
||||
memcpy(ipcfg + 0x14, &AOSSi_dns1, 4);
|
||||
memcpy(ipcfg + 0x18, &AOSSi_dns2, 4);
|
||||
|
||||
if (NCDSetIpConfig(sIpConfig) != 0) {
|
||||
ret = -1;
|
||||
}
|
||||
if (ret == 0 && NCDSetIfConfig(sConf) != 0) {
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
if (ret == 0) {
|
||||
while (!NCDIsInterfaceDecided()) {
|
||||
if (AOSSi_cancel_flag == 1) {
|
||||
ret = -1;
|
||||
break;
|
||||
}
|
||||
if (count > 0x258) {
|
||||
ret = -1;
|
||||
break;
|
||||
}
|
||||
count++;
|
||||
AOSS_813FD18C(10);
|
||||
}
|
||||
}
|
||||
|
||||
if (ret == 0) {
|
||||
out[0] = 1;
|
||||
if (WD_GetInfo(&info) == 0) {
|
||||
out[0x28 / 4] = info.channel;
|
||||
}
|
||||
{
|
||||
u32 len = *(u16*)(conf + 0x26);
|
||||
out[4 / 4] = len;
|
||||
memcpy((u8*)out + 8, conf + 6, len);
|
||||
}
|
||||
}
|
||||
else {
|
||||
out[0] = 0;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void AOSSi_Sleep(u32 ms) {
|
||||
AOSS_813FD18C(ms);
|
||||
}
|
||||
|
||||
s32 AOSSi_Status(void) {
|
||||
if (AOSSi_callback != NULL) {
|
||||
AOSSi_callback();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void AOSS_SetCallback(void (*callback)(void)) {
|
||||
BOOL level;
|
||||
|
||||
level = OSDisableInterrupts();
|
||||
AOSSi_callback = callback;
|
||||
OSRestoreInterrupts(level);
|
||||
}
|
||||
2833
src/scene/setting/ATERM.c
Normal file
2833
src/scene/setting/ATERM.c
Normal file
File diff suppressed because it is too large
Load Diff
290
src/scene/setting/iplAOSSThread.cpp
Normal file
290
src/scene/setting/iplAOSSThread.cpp
Normal file
@@ -0,0 +1,290 @@
|
||||
#include <revolution/os.h>
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#include <egg/core.h>
|
||||
|
||||
#include <revolution/mem.h>
|
||||
#include <revolution/net.h>
|
||||
#include <revolution/soex.h>
|
||||
#include <revolution/ncd.h>
|
||||
|
||||
#include "utility/iplThread.h"
|
||||
|
||||
extern "C" {
|
||||
int AOSSi_Init(void* config);
|
||||
int AOSSi_InitLocal(SOAlloc alloc, SOFree free_);
|
||||
int AOSSi_EndLocal(void);
|
||||
int AOSSi_Cancel(void);
|
||||
int AOSS_SetCallback(void (*callback)(void));
|
||||
}
|
||||
|
||||
namespace ipl {
|
||||
namespace scene {
|
||||
class USBAPThread {
|
||||
public:
|
||||
static void callback();
|
||||
};
|
||||
|
||||
MEMAllocator m_allocator;
|
||||
|
||||
typedef struct AOSSResult {
|
||||
u8 wep40Key[4][6]; // 0x000
|
||||
char wep40Ssid[0x20]; // 0x018
|
||||
u8 pad_0x38; // 0x038
|
||||
u8 wep104Key[4][0xE]; // 0x039
|
||||
char wep104Ssid[0x20]; // 0x071
|
||||
u8 pad_0x91; // 0x091
|
||||
char tkipKey[0x40]; // 0x092
|
||||
char tkipSsid[0x20]; // 0x0D2
|
||||
u8 pad_0xF2; // 0x0F2
|
||||
char aesKey[0x40]; // 0x0F3
|
||||
char aesSsid[0x20]; // 0x133
|
||||
u8 pad_0x153[2]; // 0x153
|
||||
} AOSSResult; // 0x155
|
||||
|
||||
typedef struct AOSSConfig {
|
||||
u16 version; // 0x000
|
||||
u8 unk_0x02; // 0x002
|
||||
u16 unk_0x04; // 0x004
|
||||
u8 name[3]; // 0x006
|
||||
u8 pad_0x09[0xFD]; // 0x009
|
||||
u16 unk_0x106; // 0x106
|
||||
u16 unk_0x108; // 0x108
|
||||
u16 unk_0x10A; // 0x10A
|
||||
u16 unk_0x10C; // 0x10C
|
||||
u16 unk_0x10E; // 0x10E
|
||||
u8 mac[6]; // 0x110
|
||||
u8 result; // 0x116
|
||||
AOSSResult security; // 0x117
|
||||
} AOSSConfig; // 0x26C
|
||||
|
||||
static u32 sAOSSStartTimeHi;
|
||||
static u32 sAOSSStartTimeLo;
|
||||
static s32 sAOSSState;
|
||||
static s32 sAOSSUnk;
|
||||
|
||||
class AOSSThread : public utility::ut_thread {
|
||||
public:
|
||||
AOSSThread(EGG::Heap* heap);
|
||||
|
||||
virtual ~AOSSThread(); // 0x08
|
||||
virtual void* Run(); // 0x0C
|
||||
virtual void unk_0x2C() = 0; // 0x2C
|
||||
|
||||
void destroy(int flag);
|
||||
int start();
|
||||
int cancel();
|
||||
int finish(NCDAossConfig* config, int* result);
|
||||
void printInfo();
|
||||
|
||||
static void* AOSSThread_813FCC8C(u32 id, s32 size);
|
||||
static void AOSSThread_813FCCE4(u32 id, void* ptr, s32 align);
|
||||
|
||||
private:
|
||||
s32 mState; // 0x32C
|
||||
s32 mThreadPriority; // 0x330
|
||||
u8* mpStackBuffer; // 0x334
|
||||
u8* mpHeapBuffer; // 0x338
|
||||
MEMHeapHandle mpExpHeap; // 0x33C
|
||||
AOSSConfig mAoss; // 0x340
|
||||
};
|
||||
|
||||
AOSSThread::AOSSThread(EGG::Heap* heap) : utility::ut_thread() {
|
||||
mpExpHeap = NULL;
|
||||
sAOSSState = 0;
|
||||
mpHeapBuffer = (u8*)heap->alloc(0x40000, 0x20);
|
||||
mpStackBuffer = (u8*)heap->alloc(0x1000, 0x20);
|
||||
}
|
||||
|
||||
void AOSSThread::destroy(int flag) {
|
||||
if (sAOSSState != 0) {
|
||||
if (IsThreadTerminated()) {
|
||||
WaitForThreadExit();
|
||||
SOFinish();
|
||||
sAOSSState = 0;
|
||||
}
|
||||
}
|
||||
if (mpExpHeap != NULL) {
|
||||
MEMDestroyExpHeap(mpExpHeap);
|
||||
mpExpHeap = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
AOSSThread::~AOSSThread() {
|
||||
destroy(1);
|
||||
}
|
||||
|
||||
int AOSSThread::start() {
|
||||
SOLibraryConfig config;
|
||||
|
||||
if (sAOSSState != 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
config.alloc = AOSSThread_813FCC8C;
|
||||
config.free = AOSSThread_813FCCE4;
|
||||
|
||||
BOOL level = OSDisableInterrupts();
|
||||
|
||||
OSTime t = OSGetTime();
|
||||
sAOSSStartTimeLo = (u32)t;
|
||||
sAOSSStartTimeHi = (u32)(t >> 32);
|
||||
|
||||
mpExpHeap = MEMCreateExpHeapEx(mpHeapBuffer, 0x40000, 2);
|
||||
MEMInitAllocatorForExpHeap(&m_allocator, mpExpHeap, 0x20);
|
||||
|
||||
mThreadPriority = OSGetThreadPriority(OSGetCurrentThread()) - 2;
|
||||
sAOSSState = 1;
|
||||
SOInit(&config);
|
||||
memset(mpStackBuffer, 0, 4);
|
||||
Create(mpStackBuffer, 0x1000, mThreadPriority, TRUE);
|
||||
|
||||
OSRestoreInterrupts(level);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void* AOSSThread::AOSSThread_813FCC8C(u32 id, s32 size) {
|
||||
void* buffer;
|
||||
BOOL level = OSDisableInterrupts();
|
||||
buffer = MEMAllocFromAllocator(&m_allocator, size);
|
||||
OSRestoreInterrupts(level);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
void AOSSThread::AOSSThread_813FCCE4(u32 id, void* ptr, s32 align) {
|
||||
BOOL level = OSDisableInterrupts();
|
||||
MEMFreeToAllocator(&m_allocator, ptr);
|
||||
OSRestoreInterrupts(level);
|
||||
}
|
||||
|
||||
void* AOSSThread::Run() {
|
||||
mState = 0xF;
|
||||
AOSS_SetCallback(USBAPThread::callback);
|
||||
|
||||
if (AOSSi_InitLocal(AOSSThread_813FCC8C, AOSSThread_813FCCE4) == -1) {
|
||||
return this;
|
||||
}
|
||||
|
||||
memset(&mAoss, 0, sizeof(mAoss));
|
||||
mAoss.version = 0xF;
|
||||
mAoss.unk_0x106 = 0x32;
|
||||
mAoss.unk_0x10A = 0x32;
|
||||
mAoss.unk_0x108 = 0x64;
|
||||
mAoss.unk_0x10C = 0x64;
|
||||
mAoss.unk_0x10E = 0x4E20;
|
||||
mAoss.unk_0x02 = 0x50;
|
||||
memcpy(mAoss.name, "Wii", 3);
|
||||
mAoss.unk_0x04 = 4;
|
||||
NETGetWirelessMacAddress(mAoss.mac);
|
||||
|
||||
*(u32*)(mpStackBuffer + 0x3FC0) = 0x97654321;
|
||||
|
||||
mState = AOSSi_Init(&mAoss);
|
||||
AOSSi_EndLocal();
|
||||
OSCheckActiveThreads();
|
||||
return this;
|
||||
}
|
||||
|
||||
int AOSSThread::cancel() {
|
||||
if (sAOSSState == 0) {
|
||||
return 0;
|
||||
}
|
||||
BOOL level = OSDisableInterrupts();
|
||||
AOSSi_Cancel();
|
||||
OSRestoreInterrupts(level);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int AOSSThread::finish(NCDAossConfig* config, int* result) {
|
||||
if (sAOSSState == 0) {
|
||||
*result = -0x63;
|
||||
return 1;
|
||||
}
|
||||
if (IsThreadTerminated()) {
|
||||
destroy(0);
|
||||
}
|
||||
else {
|
||||
if (((u32)OSGetTime() - (u32)sAOSSStartTimeLo)
|
||||
/ (OS_TIMER_CLOCK / 1000)
|
||||
>= 90000)
|
||||
{
|
||||
BOOL level = OSDisableInterrupts();
|
||||
AOSSi_Cancel();
|
||||
OSRestoreInterrupts(level);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (mState == 0) {
|
||||
BOOL level = OSDisableInterrupts();
|
||||
AOSSResult* sec = &mAoss.security;
|
||||
|
||||
if ((mAoss.version & 0x0001) == 1) {
|
||||
memcpy(config->wep40.ssid, sec->wep40Ssid, 0x20);
|
||||
memcpy(config->wep40.key[0], sec->wep40Key[0], 5);
|
||||
memcpy(config->wep40.key[1], sec->wep40Key[1], 5);
|
||||
memcpy(config->wep40.key[2], sec->wep40Key[2], 5);
|
||||
memcpy(config->wep40.key[3], sec->wep40Key[3], 5);
|
||||
config->wep40.keyId = 1;
|
||||
config->wep40.ssidLength = strlen(sec->wep40Ssid);
|
||||
}
|
||||
else {
|
||||
memset(config->wep40.ssid, 0, 0x20);
|
||||
config->wep40.ssidLength = 0;
|
||||
}
|
||||
|
||||
if ((mAoss.version & 0x0002) == 2) {
|
||||
memcpy(config->wep104.ssid, sec->wep104Ssid, 0x20);
|
||||
memcpy(config->wep104.key[0], sec->wep104Key[0], 0xD);
|
||||
memcpy(config->wep104.key[1], sec->wep104Key[1], 0xD);
|
||||
memcpy(config->wep104.key[2], sec->wep104Key[2], 0xD);
|
||||
memcpy(config->wep104.key[3], sec->wep104Key[3], 0xD);
|
||||
config->wep104.keyId = 1;
|
||||
config->wep104.ssidLength = strlen(sec->wep104Ssid);
|
||||
}
|
||||
else {
|
||||
memset(config->wep104.ssid, 0, 0x20);
|
||||
config->wep104.ssidLength = 0;
|
||||
}
|
||||
|
||||
if ((mAoss.version & 0x0004) == 4) {
|
||||
memcpy(config->tkip.ssid, sec->tkipSsid, 0x20);
|
||||
memcpy(config->tkip.key, sec->tkipKey, 0x40);
|
||||
config->tkip.ssidLength = strlen(sec->tkipSsid);
|
||||
config->tkip.keyLen = strlen(sec->tkipKey);
|
||||
}
|
||||
else {
|
||||
memset(config->tkip.ssid, 0, 0x20);
|
||||
config->tkip.ssidLength = 0;
|
||||
}
|
||||
|
||||
if ((mAoss.version & 0x0008) == 8) {
|
||||
memcpy(config->aes.ssid, sec->aesSsid, 0x20);
|
||||
memcpy(config->aes.key, sec->aesKey, 0x40);
|
||||
config->aes.ssidLength = strlen(sec->aesSsid);
|
||||
config->aes.keyLen = strlen(sec->aesKey);
|
||||
}
|
||||
else {
|
||||
memset(config->aes.ssid, 0, 0x20);
|
||||
config->aes.ssidLength = 0;
|
||||
}
|
||||
|
||||
printInfo();
|
||||
OSRestoreInterrupts(level);
|
||||
}
|
||||
else if (mState == -2) {
|
||||
*result = -0x62;
|
||||
}
|
||||
|
||||
*result = mAoss.result;
|
||||
return 1;
|
||||
}
|
||||
|
||||
#pragma dont_inline on
|
||||
void AOSSThread::printInfo() {
|
||||
}
|
||||
#pragma dont_inline reset
|
||||
|
||||
} // namespace scene
|
||||
} // namespace ipl
|
||||
361
src/scene/setting/iplRakuRakuThread.cpp
Normal file
361
src/scene/setting/iplRakuRakuThread.cpp
Normal file
@@ -0,0 +1,361 @@
|
||||
#include <revolution/os.h>
|
||||
#include <revolution/soex.h>
|
||||
#include <revolution/mem.h>
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#include <revolution/ncd/NCDTypes.h>
|
||||
|
||||
#include "utility/iplThread.h"
|
||||
#include "egg/core/eggHeap.h"
|
||||
|
||||
extern "C" {
|
||||
u32 ATERMi_ApConfigGetVersion(void);
|
||||
s32 ATERMi_ApConfigStart(s32 priority, u32 size, void (*callback)(u32* data),
|
||||
void* (*alloc)(u32 size), void (*free_)(u32 size),
|
||||
u32 stackSize);
|
||||
s32 ATERMi_ApConfigGetState(u32* state);
|
||||
s32 ATERMi_ApConfigEnd(void);
|
||||
s32 ATERMi_ApConfigGetResult(void* result);
|
||||
}
|
||||
|
||||
namespace ipl {
|
||||
namespace scene {
|
||||
extern "C" {
|
||||
static void* RakuRakuThread_813FDEF0(u32 id, s32 size);
|
||||
static void RakuRakuThread_813FDEFC(u32 id, void* ptr, s32 align);
|
||||
static void* RakuRakuThread_813FDF08(u32 size);
|
||||
static void RakuRakuThread_813FDF18(u32 size);
|
||||
}
|
||||
|
||||
typedef struct ATERMResult {
|
||||
char ssid[0x20]; // 0x00
|
||||
s32 type; // 0x20
|
||||
u32 keyId; // 0x24
|
||||
u8 keys[4][0x20]; // 0x28
|
||||
char key[0x40]; // 0xA8
|
||||
} ATERMResult; // 0xE8
|
||||
|
||||
typedef struct RakuRakuWork {
|
||||
u32 state; // 0x00
|
||||
u32 unk_0x04; // 0x04
|
||||
s32 result; // 0x08
|
||||
ATERMResult data; // 0x0C
|
||||
} RakuRakuWork; // 0xF4
|
||||
|
||||
typedef struct QueueWork {
|
||||
OSMessageQueue queue; // 0x00
|
||||
OSMessage msg; // 0x20
|
||||
} QueueWork; // 0x24
|
||||
|
||||
MEMAllocator mAllocator;
|
||||
RakuRakuWork mWork;
|
||||
QueueWork mQueue;
|
||||
|
||||
static u32 sStartTimeHi;
|
||||
static u32 sStartTimeLo;
|
||||
static u8 sStarted;
|
||||
static OSMessage sMsgArray;
|
||||
static s32 sState = 1;
|
||||
|
||||
class RakuRakuThread : public utility::ut_thread {
|
||||
public:
|
||||
RakuRakuThread(EGG::Heap* heap);
|
||||
|
||||
virtual ~RakuRakuThread(); // 0x08
|
||||
virtual void* Run(); // 0x0C
|
||||
virtual void unk_0x2C() = 0; // 0x2C
|
||||
|
||||
static void RakuRakuThread_813FDA04(u32* data);
|
||||
|
||||
void destroy();
|
||||
int start();
|
||||
int getState();
|
||||
void cancel();
|
||||
int finish(NCDApConfig* config, int* result);
|
||||
void printInfo();
|
||||
|
||||
private:
|
||||
s32 mUnk_0x32C; // 0x32C
|
||||
s32 mEndFlag; // 0x330
|
||||
s32 mCreated; // 0x334
|
||||
s32 mThreadPriority; // 0x338
|
||||
u8* mpWorkBuffer; // 0x33C
|
||||
u8* mpStackBuffer; // 0x340
|
||||
MEMHeapHandle mpExpHeap; // 0x344
|
||||
};
|
||||
|
||||
void RakuRakuThread::RakuRakuThread_813FDA04(u32* data) {
|
||||
BOOL level = OSDisableInterrupts();
|
||||
mWork.state = data[0];
|
||||
mWork.unk_0x04 = data[1];
|
||||
mWork.result = data[2];
|
||||
OSTime t = OSGetTime();
|
||||
sStartTimeLo = (u32)t;
|
||||
sStartTimeHi = (u32)(t >> 32);
|
||||
OSRestoreInterrupts(level);
|
||||
}
|
||||
|
||||
RakuRakuThread::RakuRakuThread(EGG::Heap* heap) : utility::ut_thread() {
|
||||
u32 version = ATERMi_ApConfigGetVersion();
|
||||
|
||||
if ((((version >> 12) & 0xF) * 10 + ((version >> 8) & 0xF)) != 1) {
|
||||
mpWorkBuffer = NULL;
|
||||
}
|
||||
else {
|
||||
mpWorkBuffer = (u8*)heap->alloc(0x40000, 0x20);
|
||||
mpStackBuffer = (u8*)heap->alloc(0x1000, 0x20);
|
||||
}
|
||||
|
||||
mpExpHeap = NULL;
|
||||
sStarted = 0;
|
||||
mEndFlag = 0;
|
||||
mCreated = 0;
|
||||
OSInitMessageQueue(&mQueue.queue, &sMsgArray, 1);
|
||||
}
|
||||
|
||||
RakuRakuThread::~RakuRakuThread() {
|
||||
if (mCreated != 0) {
|
||||
OSJamMessage(&mQueue.queue, (OSMessage)2, TRUE);
|
||||
WaitForThreadExit();
|
||||
}
|
||||
destroy();
|
||||
}
|
||||
|
||||
void RakuRakuThread::destroy() {
|
||||
if (sStarted != 0) {
|
||||
OSSendMessage(&mQueue.queue, (OSMessage)1, FALSE);
|
||||
u32 tick = OSGetTick();
|
||||
while ((u32)(OSGetTick() - tick) / (OS_TIMER_CLOCK / 1000)
|
||||
< 0x7D0)
|
||||
{
|
||||
u32 state[4];
|
||||
if (ATERMi_ApConfigGetState(state) == 1 && (s32)state[0] == 7) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
SOFinish();
|
||||
sStarted = 0;
|
||||
}
|
||||
|
||||
if (mpExpHeap != NULL) {
|
||||
MEMDestroyExpHeap(mpExpHeap);
|
||||
memset(&mAllocator, 0, 0x10);
|
||||
mpExpHeap = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
int RakuRakuThread::start() {
|
||||
SOLibraryConfig config;
|
||||
MEMAllocator* alloc = &mAllocator;
|
||||
|
||||
if (sStarted != 0 || mpWorkBuffer == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
BOOL level = OSDisableInterrupts();
|
||||
OSTime t = OSGetTime();
|
||||
sStartTimeLo = (u32)t;
|
||||
sStartTimeHi = (u32)(t >> 32);
|
||||
|
||||
mpExpHeap = MEMCreateExpHeapEx(mpWorkBuffer, 0x40000, 2);
|
||||
MEMInitAllocatorForExpHeap(&mAllocator, mpExpHeap, 0x20);
|
||||
|
||||
mThreadPriority = OSGetThreadPriority(OSGetCurrentThread()) - 1;
|
||||
|
||||
sStarted = 1;
|
||||
mEndFlag = 0;
|
||||
memset((u8*)alloc + 0x1C, 0, 0xE8);
|
||||
memset((u8*)alloc + 0x10, 0, 0xC);
|
||||
|
||||
config.alloc = RakuRakuThread_813FDEF0;
|
||||
config.free = RakuRakuThread_813FDEFC;
|
||||
SOInit(&config);
|
||||
|
||||
ATERMi_ApConfigStart(mThreadPriority, 0xC8,
|
||||
RakuRakuThread_813FDA04,
|
||||
RakuRakuThread_813FDF08,
|
||||
RakuRakuThread_813FDF18, 0x1000);
|
||||
|
||||
if (mCreated == 0) {
|
||||
mCreated = 1;
|
||||
memset(mpStackBuffer, 0, 4);
|
||||
Create(mpStackBuffer, 0x1000, mThreadPriority - 1, TRUE);
|
||||
OSReport("RakuRakuThread (for End function) start with prio(%d) \n",
|
||||
mThreadPriority);
|
||||
}
|
||||
|
||||
OSRestoreInterrupts(level);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void* RakuRakuThread::Run() {
|
||||
u32 magic = 0x97654321;
|
||||
OSMessage msg;
|
||||
|
||||
for (;;) {
|
||||
while (OSReceiveMessage(&mQueue.queue, &msg, FALSE) != FALSE) {
|
||||
if ((s32)msg == 2) {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
OSReceiveMessage(&mQueue.queue, &msg, TRUE);
|
||||
if ((s32)msg == 2) {
|
||||
break;
|
||||
}
|
||||
*(u32*)(mpStackBuffer + 0x3FC0) = magic;
|
||||
ATERMi_ApConfigEnd();
|
||||
mEndFlag = 1;
|
||||
if (mCreated == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
static void* RakuRakuThread_813FDEF0(u32 id, s32 size) {
|
||||
return MEMAllocFromAllocator(&mAllocator, size);
|
||||
}
|
||||
|
||||
static void RakuRakuThread_813FDEFC(u32 id, void* ptr, s32 align) {
|
||||
MEMFreeToAllocator(&mAllocator, ptr);
|
||||
}
|
||||
|
||||
static void* RakuRakuThread_813FDF08(u32 size) {
|
||||
return MEMAllocFromAllocator(&mAllocator, size);
|
||||
}
|
||||
|
||||
static void RakuRakuThread_813FDF18(u32 size) {
|
||||
MEMFreeToAllocator(&mAllocator, (void*)size);
|
||||
}
|
||||
}
|
||||
|
||||
int RakuRakuThread::getState() {
|
||||
if (sStarted == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
BOOL level = OSDisableInterrupts();
|
||||
|
||||
switch (mWork.state) {
|
||||
case 1:
|
||||
sState = 1;
|
||||
break;
|
||||
case 2:
|
||||
sState = 2;
|
||||
break;
|
||||
case 3:
|
||||
sState = 2;
|
||||
break;
|
||||
case 4:
|
||||
sState = 4;
|
||||
break;
|
||||
case 5:
|
||||
sState = 5;
|
||||
break;
|
||||
case 6:
|
||||
sState = 6;
|
||||
break;
|
||||
case 7:
|
||||
sState = 7;
|
||||
break;
|
||||
default:
|
||||
sState = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
if (sState != 6 && sState != 7) {
|
||||
if (((u32)OSGetTime() - (u32)sStartTimeLo)
|
||||
/ (OS_TIMER_CLOCK / 1000)
|
||||
>= 90000)
|
||||
{
|
||||
OSSendMessage(&mQueue.queue, (OSMessage)1, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
OSRestoreInterrupts(level);
|
||||
return sState;
|
||||
}
|
||||
|
||||
void RakuRakuThread::cancel() {
|
||||
OSSendMessage(&mQueue.queue, (OSMessage)1, FALSE);
|
||||
}
|
||||
|
||||
int RakuRakuThread::finish(NCDApConfig* config, int* result) {
|
||||
u8* ws = (u8*)&mAllocator;
|
||||
RakuRakuWork* wk = (RakuRakuWork*)(ws + 0x10);
|
||||
|
||||
if (sStarted == 0) {
|
||||
if (result != NULL) {
|
||||
*result = -0x63;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ((u32)(wk->state - 6) <= 1) {
|
||||
if (mEndFlag == 0) {
|
||||
if ((s32)wk->state == 6) {
|
||||
ATERMi_ApConfigGetResult(&wk->data);
|
||||
printInfo();
|
||||
}
|
||||
OSSendMessage((OSMessageQueue*)(ws + 0x104), (OSMessage)1, FALSE);
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
SOFinish();
|
||||
sStarted = 0;
|
||||
destroy();
|
||||
}
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (config != NULL) {
|
||||
memcpy(config->ssid, wk->data.ssid, 0x20);
|
||||
config->ssidLength = strlen(wk->data.ssid);
|
||||
|
||||
ATERMResult* data = &wk->data;
|
||||
|
||||
if (data->type == 1) {
|
||||
config->privacy.mode = 1;
|
||||
config->privacy.wep40.keyId = data->keyId;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
memcpy(config->privacy.wep40.key[i],
|
||||
data->keys[i], 5);
|
||||
}
|
||||
}
|
||||
else if (data->type == 2) {
|
||||
config->privacy.mode = 2;
|
||||
config->privacy.wep104.keyId = data->keyId;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
memcpy(config->privacy.wep104.key[i],
|
||||
data->keys[i], 0xD);
|
||||
}
|
||||
}
|
||||
else if (data->type == 4) {
|
||||
config->privacy.mode = 4;
|
||||
memcpy(config->privacy.tkip.key, data->key, 0x40);
|
||||
config->privacy.tkip.keyLen = strlen(data->key);
|
||||
}
|
||||
else if (data->type == 5) {
|
||||
config->privacy.mode = 6;
|
||||
memcpy(config->privacy.aes.key, data->key, 0x40);
|
||||
config->privacy.aes.keyLen = strlen(data->key);
|
||||
}
|
||||
}
|
||||
|
||||
if (result != NULL) {
|
||||
*result = wk->result;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
#pragma dont_inline on
|
||||
void RakuRakuThread::printInfo() {
|
||||
}
|
||||
#pragma dont_inline reset
|
||||
|
||||
} // namespace scene
|
||||
} // namespace ipl
|
||||
150
src/scene/setting/iplSensitivity.cpp
Normal file
150
src/scene/setting/iplSensitivity.cpp
Normal file
@@ -0,0 +1,150 @@
|
||||
#define IPL_CONTROLLER_TRIVIAL_RECT_DTOR
|
||||
#include <nw4r/ut/Rect.h>
|
||||
|
||||
extern "C" {
|
||||
#include <revolution/gx.h>
|
||||
#include <revolution/tpl.h>
|
||||
#include <revolution/wpad.h>
|
||||
}
|
||||
|
||||
#include <system/iplController.h>
|
||||
#include <system/iplNand.h>
|
||||
#include <system/iplSystem.h>
|
||||
#include <utility/iplGraphics.h>
|
||||
|
||||
extern "C" void* KPADGetWPADRingBuffer(s32 chan);
|
||||
extern "C" void* KPADGetWPADFSRingBuffer(s32 chan);
|
||||
extern "C" void* KPADGetWPADCLRingBuffer(s32 chan);
|
||||
|
||||
extern __declspec(section ".sdata2") u8 sFrameColorR;
|
||||
extern __declspec(section ".sdata2") u8 sFrameColorG;
|
||||
extern __declspec(section ".sdata2") u8 sFrameColorB;
|
||||
extern __declspec(section ".sdata2") u8 sFrameColorA;
|
||||
extern __declspec(section ".sdata2") u8 sPointColorR;
|
||||
extern __declspec(section ".sdata2") u8 sPointColorG;
|
||||
extern __declspec(section ".sdata2") u8 sPointColorB;
|
||||
extern __declspec(section ".sdata2") u8 sPointColorA;
|
||||
extern __declspec(section ".sdata2") const f32 sPosZero;
|
||||
extern __declspec(section ".sdata2") f32 sDpdOffsetY;
|
||||
extern __declspec(section ".sdata2") f32 sDpdScale;
|
||||
|
||||
namespace ipl {
|
||||
|
||||
typedef struct DPDObj {
|
||||
s16 x; // 0x0
|
||||
s16 y; // 0x2
|
||||
u16 size; // 0x4
|
||||
s16 id; // 0x6
|
||||
} DPDObj;
|
||||
|
||||
class SensitivityDrawing {
|
||||
public:
|
||||
static void draw(nand::File* file);
|
||||
};
|
||||
|
||||
void SensitivityDrawing::draw(nand::File* file) {
|
||||
GXRenderModeObj mode = *System::getRenderModeObj();
|
||||
|
||||
nw4r::ut::Rect rect(sPosZero, sPosZero, sPosZero, sPosZero);
|
||||
System::getProjectionRect(&rect);
|
||||
|
||||
GXColor frameColor = {sFrameColorR, sFrameColorG, sFrameColorB,
|
||||
sFrameColorA};
|
||||
u32 left;
|
||||
u32 top;
|
||||
u32 width;
|
||||
u32 height;
|
||||
GXGetScissor(&left, &top, &width, &height);
|
||||
|
||||
f32 fw2 = 0.5f * (rect.right - rect.left);
|
||||
f32 ys = (0.5f * (rect.bottom - rect.top)) / 768.0f;
|
||||
f32 xs = (0.5f * (rect.right - rect.left)) * 0.0009765625f;
|
||||
f32 ws = mode.fbWidth / (rect.right - rect.left);
|
||||
f32 hs = mode.efbHeight / (rect.bottom - rect.top);
|
||||
f32 fh2 = 0.5f * (rect.bottom - rect.top);
|
||||
|
||||
utility::Graphics::setDefaultOrtho(0);
|
||||
|
||||
GXSetScissor((u32)(ws * (0.5f * rect.left + fw2)),
|
||||
(u32)(hs * (0.5f * rect.top + fh2 + sDpdOffsetY)),
|
||||
(u32)(ws * ((rect.right - rect.left) * 0.5f)),
|
||||
(u32)(hs * ((rect.bottom - rect.top) * 0.5f)));
|
||||
|
||||
utility::Graphics::drawPolygon(rect, frameColor);
|
||||
|
||||
controller::Interface* controller = System::getYoungController();
|
||||
if (controller != NULL && controller->getKPADStatus() != NULL) {
|
||||
GXTexObj texObj;
|
||||
TPLGetGXTexObjFromPalette((TPLPalette*)file->getBuffer(), &texObj, 1);
|
||||
GXInitTexObjWrapMode(&texObj, GX_MIRROR, GX_MIRROR);
|
||||
|
||||
s32 index = WPADGetLatestIndexInBuf(controller->getChannel());
|
||||
|
||||
DPDObj* first;
|
||||
DPDObj* last;
|
||||
switch (controller->getType()) {
|
||||
case 0: {
|
||||
u8* base = (u8*)KPADGetWPADRingBuffer(
|
||||
controller->getChannel()) +
|
||||
index * 0x2A;
|
||||
last = (DPDObj*)(base + 0x20);
|
||||
first = (DPDObj*)(base + 8);
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
u8* base = (u8*)KPADGetWPADFSRingBuffer(
|
||||
controller->getChannel()) +
|
||||
index * 0x32;
|
||||
last = (DPDObj*)(base + 0x20);
|
||||
first = (DPDObj*)(base + 8);
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
u8* base = (u8*)KPADGetWPADCLRingBuffer(
|
||||
controller->getChannel()) +
|
||||
index * 0x36;
|
||||
last = (DPDObj*)(base + 0x20);
|
||||
first = (DPDObj*)(base + 8);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DPDObj* obj = last;
|
||||
do {
|
||||
if (obj->size != 0) {
|
||||
s32 x = obj->x - 0x200;
|
||||
s32 y = obj->y - 0x180;
|
||||
f32 s = sDpdScale * (obj->size + 0x19);
|
||||
|
||||
nw4r::ut::Rect pos(sPosZero, sPosZero, sPosZero, sPosZero);
|
||||
f32 sx = xs * x;
|
||||
f32 sy = ys * y;
|
||||
pos.left = sx - s;
|
||||
pos.top = (-sy + s) - sDpdOffsetY;
|
||||
pos.right = sx + s;
|
||||
pos.bottom = (-sy - s) - sDpdOffsetY;
|
||||
|
||||
utility::Graphics::drawTexture(pos, texObj,
|
||||
*(GXColor*)&sPointColorR, 2,
|
||||
utility::Graphics::ORI_NONE);
|
||||
}
|
||||
obj--;
|
||||
} while (obj >= first);
|
||||
}
|
||||
|
||||
GXSetScissor(left, top, width, height);
|
||||
}
|
||||
|
||||
} // namespace ipl
|
||||
|
||||
extern __declspec(section ".sdata2") u8 sFrameColorR = 0x60;
|
||||
extern __declspec(section ".sdata2") u8 sFrameColorG = 0x60;
|
||||
extern __declspec(section ".sdata2") u8 sFrameColorB = 0x60;
|
||||
extern __declspec(section ".sdata2") u8 sFrameColorA = 0xC0;
|
||||
extern __declspec(section ".sdata2") u8 sPointColorR = 0xFF;
|
||||
extern __declspec(section ".sdata2") u8 sPointColorG = 0xFF;
|
||||
extern __declspec(section ".sdata2") u8 sPointColorB = 0xFF;
|
||||
extern __declspec(section ".sdata2") u8 sPointColorA = 0xFF;
|
||||
extern __declspec(section ".sdata2") const f32 sPosZero = 0.0f;
|
||||
extern __declspec(section ".sdata2") f32 sDpdOffsetY = -45.0f;
|
||||
extern __declspec(section ".sdata2") f32 sDpdScale = 0.15f;
|
||||
3909
src/scene/setting/iplSetting.cpp
Normal file
3909
src/scene/setting/iplSetting.cpp
Normal file
File diff suppressed because it is too large
Load Diff
190
src/scene/setting/iplUSBAP.cpp
Normal file
190
src/scene/setting/iplUSBAP.cpp
Normal file
@@ -0,0 +1,190 @@
|
||||
extern "C" {
|
||||
#include <private/wd.h>
|
||||
}
|
||||
|
||||
#include <revolution/os.h>
|
||||
#include <revolution/wd.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#define USBAP_STACK_SIZE 0x1000
|
||||
#define USBAP_NICKNAME_LEN 0x14
|
||||
#define USBAP_MAC_TABLE_MAX 0x14
|
||||
#define USBAP_MAC_LENGTH 6
|
||||
#define USBAP_SSID "NWCUSBAP"
|
||||
#define USBAP_SSID_LENGTH 8
|
||||
|
||||
typedef void (*USBAPCallback)(int result);
|
||||
|
||||
static OSThread usbapThread;
|
||||
static u8 usbapStack[USBAP_STACK_SIZE];
|
||||
static OSMessageQueue usbapMessageQ;
|
||||
static u16 usbapNickname[12];
|
||||
|
||||
static OSMessage usbapMsg;
|
||||
static USBAPCallback usbapCallback;
|
||||
static s32 usbapUseNickname;
|
||||
static u16 usbapEnableChannel;
|
||||
static u8* usbapScanBuffer;
|
||||
static u8* usbapMacTable;
|
||||
u8* gUSBAPResult;
|
||||
|
||||
extern "C" void* DoRegistration(void* param);
|
||||
|
||||
extern "C" int USBAPStartRegistration(void* unused1, void* unused2,
|
||||
u32 priority, s32 useNickname, const u16* nickname,
|
||||
USBAPCallback callback, u8* scanBuffer, u8* macTable) {
|
||||
s32 level;
|
||||
|
||||
level = OSDisableInterrupts();
|
||||
usbapScanBuffer = scanBuffer;
|
||||
usbapMacTable = macTable;
|
||||
|
||||
if (usbapThread.state != 0 && !OSIsThreadTerminated(&usbapThread)) {
|
||||
OSRestoreInterrupts(level);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (priority > 0x1F || nickname == NULL || callback == NULL) {
|
||||
OSRestoreInterrupts(level);
|
||||
return 0;
|
||||
}
|
||||
|
||||
usbapUseNickname = useNickname;
|
||||
usbapCallback = callback;
|
||||
memcpy(usbapNickname, nickname, USBAP_NICKNAME_LEN);
|
||||
|
||||
OSInitMessageQueue(&usbapMessageQ, &usbapMsg, 1);
|
||||
|
||||
if (OSCreateThread(&usbapThread, DoRegistration, NULL,
|
||||
usbapStack + sizeof(usbapStack), sizeof(usbapStack), priority, 1)
|
||||
== 1)
|
||||
{
|
||||
OSRestoreInterrupts(level);
|
||||
while (OSResumeThread(&usbapThread) > 1) {
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
OSRestoreInterrupts(level);
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern "C" int USBAPCancelRegistration(void) {
|
||||
return OSSendMessage(&usbapMessageQ, NULL, 0);
|
||||
}
|
||||
|
||||
extern "C" int USBAPIsThreadTerminated(void) {
|
||||
return OSIsThreadTerminated(&usbapThread);
|
||||
}
|
||||
|
||||
extern "C" void* DoRegistration(void* param) {
|
||||
OSMessage msg;
|
||||
WDScanParam req;
|
||||
s32 ret;
|
||||
s32 result;
|
||||
BOOL found;
|
||||
BOOL empty;
|
||||
u16 count;
|
||||
s32 i;
|
||||
s32 j;
|
||||
s32 joff;
|
||||
WDBssDesc* entry;
|
||||
|
||||
if (WDCheckEnableChannel(&usbapEnableChannel) != 0) {
|
||||
ret = 0;
|
||||
if (usbapCallback != NULL) {
|
||||
usbapCallback(0);
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (;;) {
|
||||
OSYieldThread();
|
||||
|
||||
if (OSReceiveMessage(&usbapMessageQ, &msg, 0) == TRUE) {
|
||||
ret = 0;
|
||||
if (usbapCallback != NULL) {
|
||||
usbapCallback(0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
result = 0;
|
||||
|
||||
req.channelBit = usbapEnableChannel;
|
||||
req.maxChannelTime = 0x64;
|
||||
memset(req.bssid, 0xFF, WD_BSSID_LENGTH);
|
||||
req.type = 0;
|
||||
req.ssidLength = 0x20;
|
||||
memcpy(req.ssid, USBAP_SSID, USBAP_SSID_LENGTH);
|
||||
req.ssid[8] = 0;
|
||||
req.ssid[9] = 1;
|
||||
|
||||
if (usbapUseNickname == 1) {
|
||||
req.ssid[9] |= 2;
|
||||
}
|
||||
req.ssid[10] = 1;
|
||||
req.ssid[11] = 0;
|
||||
memcpy(&req.ssid[12], usbapNickname, USBAP_NICKNAME_LEN);
|
||||
|
||||
memset(&req.ssidMask[0], 0, 8);
|
||||
memset(&req.ssidMask[8], 0xFF, 0x18);
|
||||
|
||||
if (WDScanOnce(usbapScanBuffer, 0x800, &req) == 0) {
|
||||
found = 0;
|
||||
empty = 0;
|
||||
count = *(u16*)usbapScanBuffer;
|
||||
entry = (WDBssDesc*)(usbapScanBuffer + 2);
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
if (entry->ssidLength == 0x20
|
||||
&& strncmp((char*)entry->ssid, USBAP_SSID,
|
||||
USBAP_SSID_LENGTH)
|
||||
== 0)
|
||||
{
|
||||
for (j = 0, joff = 0; j < USBAP_MAC_TABLE_MAX;
|
||||
j++, joff += USBAP_MAC_LENGTH)
|
||||
{
|
||||
if (memcmp(entry->bssid,
|
||||
&usbapMacTable[1 + joff],
|
||||
USBAP_MAC_LENGTH)
|
||||
== 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (j == USBAP_MAC_TABLE_MAX) {
|
||||
if (entry->ssid[9] == 1) {
|
||||
memcpy(&usbapMacTable[1 + usbapMacTable[0]
|
||||
* USBAP_MAC_LENGTH],
|
||||
entry->bssid, USBAP_MAC_LENGTH);
|
||||
usbapMacTable[0]++;
|
||||
found = 1;
|
||||
}
|
||||
else if (entry->ssid[9] == 0) {
|
||||
empty = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
entry = (WDBssDesc*)((u8*)entry + entry->length * 2);
|
||||
}
|
||||
|
||||
if (found) {
|
||||
result = empty ? 2 : 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (result != 0) {
|
||||
ret = result == 1;
|
||||
if (usbapCallback != NULL) {
|
||||
usbapCallback(ret);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (void*)(u32)ret;
|
||||
}
|
||||
71
src/scene/setting/iplUSBAPThread.cpp
Normal file
71
src/scene/setting/iplUSBAPThread.cpp
Normal file
@@ -0,0 +1,71 @@
|
||||
#include <revolution/os.h>
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#include "utility/iplCharacterCode.h"
|
||||
|
||||
extern "C" int USBAPStartRegistration(void* arg1, void* arg2, s32 priority,
|
||||
void* arg4, void* arg5, void* callback, void* arg7, void* arg8);
|
||||
extern "C" int USBAPCancelRegistration(void);
|
||||
extern "C" int USBAPIsThreadTerminated(void);
|
||||
|
||||
extern u8* gUSBAPResult;
|
||||
|
||||
namespace ipl {
|
||||
namespace scene {
|
||||
class USBAPThread {
|
||||
public:
|
||||
USBAPThread();
|
||||
void Init(u16* pData, u8* pBuf);
|
||||
void cancel();
|
||||
void is();
|
||||
void setData(const wchar_t* pData, u8* pBuf);
|
||||
void callback();
|
||||
|
||||
private:
|
||||
wchar_t mData[10];
|
||||
};
|
||||
|
||||
USBAPThread::USBAPThread() {
|
||||
}
|
||||
|
||||
void USBAPRegisterCallback(int result) {
|
||||
if (result == 1) {
|
||||
*gUSBAPResult = 1;
|
||||
OSReport("Registration completed !\n");
|
||||
}
|
||||
else {
|
||||
*gUSBAPResult = 2;
|
||||
OSReport("Registration failed...\n");
|
||||
}
|
||||
}
|
||||
|
||||
void USBAPThread::Init(u16* pData, u8* pBuf) {
|
||||
s32 priority = OSGetThreadPriority(OSGetCurrentThread()) + 1;
|
||||
s32 result = USBAPStartRegistration(NULL, NULL, priority, NULL, this,
|
||||
USBAPRegisterCallback, pData, pBuf);
|
||||
if (result == 1)
|
||||
{
|
||||
OSReport("Registration started\n");
|
||||
}
|
||||
}
|
||||
|
||||
void USBAPThread::cancel() {
|
||||
USBAPCancelRegistration();
|
||||
}
|
||||
|
||||
void USBAPThread::is() {
|
||||
USBAPIsThreadTerminated();
|
||||
}
|
||||
|
||||
void USBAPThread::setData(const wchar_t* pData, u8* pBuf) {
|
||||
gUSBAPResult = pBuf;
|
||||
std::memcpy(mData, pData, sizeof(mData));
|
||||
utility::CharacterCode::changeEndian(
|
||||
reinterpret_cast<wchar_t*>(mData), 0xA);
|
||||
}
|
||||
|
||||
void USBAPThread::callback() {
|
||||
}
|
||||
} // namespace scene
|
||||
} // namespace ipl
|
||||
93
tools/decomp-assist/NHTTP_thread.attempts.md
Normal file
93
tools/decomp-assist/NHTTP_thread.attempts.md
Normal file
@@ -0,0 +1,93 @@
|
||||
# NHTTP_thread leaf attempts
|
||||
|
||||
Target: Wii Menu 4.3U, libs/RevoEX/src/nhttp/NHTTP_thread.c.
|
||||
Baseline: no source, 0/26 instruction-exact functions, 0/11292 matched code bytes,
|
||||
0/504 matched data bytes. Implemented all 26 functions in object order using the
|
||||
private nhttp structures. Other translation units and shared headers are unchanged.
|
||||
|
||||
Current: 23/26 instruction-exact functions, 8504/11292 matched code bytes,
|
||||
88/504 matched data bytes. The eight-string .data pool is identical.
|
||||
The unit remains NonMatching after a failed linking experiment.
|
||||
|
||||
## Remaining functions
|
||||
|
||||
### NHTTPi_RecvProxyConnectHeader: 99.92063%
|
||||
|
||||
126/126 instructions. Only the order of the two zero initializations differs:
|
||||
source initializes r5 then r4; target initializes r4 then r5.
|
||||
|
||||
- Initial pointer/countdown scan: 90.2381%.
|
||||
- Materialized communication buffer and a for loop: 96.74603%.
|
||||
- Index-bounded scan: 98.690475%; pointer-end bound: 95.833336%.
|
||||
- Declared request/response before the accepted flag: 99.44444%.
|
||||
- Cursor declaration before index: 99.7619%; while-loop pointer increments:
|
||||
99.92063%, retained.
|
||||
- Initialized index before the end flag: still 99.92063%.
|
||||
- Moved flag before cursor declarations: 99.24603%.
|
||||
- Other scan declaration orders: 99.64286%, 99.32539%, 99.166664%.
|
||||
- Inline header scan helper: 97.53968%, rejected and restored.
|
||||
|
||||
### NHTTPi_ThreadParseHeaderProc: 98.58639%
|
||||
|
||||
191/191 instructions. Differences remain in string-base and request registers,
|
||||
and zero initialization/scheduling around the Keep-Alive comparison. There are
|
||||
no missing branches or instructions in the retained version.
|
||||
|
||||
- Shared error label: 66.84293%; individual error returns: 85.125656%.
|
||||
- Positive Content-Length branch first: 89.84293%.
|
||||
- Positive header-value branches first: 94.84293%.
|
||||
- Secure connection branch first, with all false assignments preserved:
|
||||
98.03665%.
|
||||
- Store computed chunked flag after its length branches: 98.58639%, retained.
|
||||
- Default keepalive value before comparison, and declaration hoisting:
|
||||
98.58639%, no improvement.
|
||||
- Buffer declaration first: 98.50785%, rejected.
|
||||
- Request declaration first: 98.58639%, no improvement.
|
||||
|
||||
### NHTTPi_ThreadRecvBodyProc: 99.1579%
|
||||
|
||||
379/380 instructions. Register assignment differs for system info, the chunk
|
||||
count and the two-byte recent-character buffer. The ignored trailer-line return
|
||||
lets the compiler reuse a zero-valued loop counter for scratch initialization;
|
||||
the target emits a separate zero load. No undefined values are used.
|
||||
|
||||
- Initial implementation: 75.11053%.
|
||||
- Half-open informational status range: 75.12631%.
|
||||
- Incomplete fixed-length body branch first: 76.71842%.
|
||||
- Hoisted chunk count: 76.86316%; scratch array scope variations: unchanged
|
||||
or 76.71842%.
|
||||
- Corrected Ghidra's apparent 64-bit chunk count to the assembly's 32-bit
|
||||
count, and restored the consumed-byte return from the inline chunk-line
|
||||
reader: 81.48421%.
|
||||
- Positive chunk branch before zero-chunk trailers: 96.905266%.
|
||||
- Handle end-of-stream success inside the receive loop: 99.1579%, retained.
|
||||
- Unsigned recent-character local and function-scope recent array:
|
||||
99.1579%, no improvement. Hoisted byte count: 98.07895%, rejected.
|
||||
|
||||
## Linking experiment
|
||||
|
||||
Temporarily changed only NHTTP_thread.c to Matching and built main.dol.
|
||||
The final experiment produced SHA1 18abd4071ea17c4ef4708fa149dc479009c12b8d,
|
||||
so configure.py was restored to NonMatching.
|
||||
|
||||
unitaudit.py reported 25 text symbols at their target addresses, with only the
|
||||
following CommThreadProcMain shifted by -4. The next unit,
|
||||
d_nhttp_private.c at 0x8149b390, and subsequent text also shifted by -4.
|
||||
nm confirms the source .text is 11288 bytes, against 11292 target bytes.
|
||||
The missing instruction is in ThreadRecvBodyProc.
|
||||
|
||||
The real named multipart string arrays were declared as ordinary const char
|
||||
arrays. Source STR_POST_DISPOS starts at 0x0, STR_POST_TYPE_BIN at 0x28,
|
||||
STR_POST_TYPE_URLENCODE at 0x74, and STR_POST_TYPE_MULTIPART at 0xa8. The target
|
||||
object names these symbols at 0x0, 0x27, 0x74, and 0xa6. unitaudit reports
|
||||
rodata deltas of 0, +1, and +2. Source section sizes are .data 194, .rodata 213,
|
||||
.sdata 88; target sizes are .data 200, .rodata 216, .sdata 88. The pool's string
|
||||
contents and offsets agree; section trailing alignment and named constant
|
||||
boundaries still need investigation. No padding or address-pinning was added.
|
||||
|
||||
A byte comparison against orig/43U/00000008.app found 1305353 differing bytes,
|
||||
first at file offset 0x5bb. Both files are 3867904 bytes. The text shift changes
|
||||
relocated references outside this unit, so that count is not a count of local
|
||||
instruction mismatches.
|
||||
|
||||
Final acceptance uses the full non-quick gate after restoring NonMatching.
|
||||
@@ -1,10 +1,11 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Compact function diff with context: python ctxdiff.py <unit> <symbol> [--full]"""
|
||||
import sys
|
||||
import os
|
||||
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
sys.path.insert(0, "/home/cole/projects/tests")
|
||||
from odiff import dis, sym
|
||||
import os
|
||||
import itertools
|
||||
|
||||
|
||||
|
||||
166
tools/decomp-assist/odiff.py
Normal file
166
tools/decomp-assist/odiff.py
Normal file
@@ -0,0 +1,166 @@
|
||||
#!/usr/bin/env python3
|
||||
"""odiff: symbol lookup + normalized disassembly for object files.
|
||||
|
||||
Recreated for this environment (original lived on the author's machine).
|
||||
"""
|
||||
|
||||
import re
|
||||
|
||||
from capstone import CS_ARCH_PPC, CS_MODE_32, CS_MODE_BIG_ENDIAN, Cs
|
||||
from elftools.elf.elffile import ELFFile
|
||||
|
||||
_cache = {}
|
||||
|
||||
|
||||
def _load(path):
|
||||
if path in _cache:
|
||||
return _cache[path]
|
||||
with open(path, "rb") as f:
|
||||
e = ELFFile(f)
|
||||
st = e.get_section_by_name(".symtab")
|
||||
names = [s.name for s in st.iter_symbols()]
|
||||
syms = {s.name: (s["st_value"], s["st_size"]) for s in st.iter_symbols()}
|
||||
data = {}
|
||||
for sec in e.iter_sections():
|
||||
data[sec.name] = (sec["sh_offset"], sec.data())
|
||||
relocs = {}
|
||||
for sec in e.iter_sections():
|
||||
if sec.name.startswith(".rela"):
|
||||
target = sec.name[5:]
|
||||
for r in sec.iter_relocations():
|
||||
relocs[(target, r["r_offset"])] = names[r["r_info_sym"]]
|
||||
_cache[path] = (data, syms, relocs)
|
||||
return _cache[path]
|
||||
|
||||
|
||||
def sym(path, name):
|
||||
_, syms, _ = _load(path)
|
||||
return syms[name]
|
||||
|
||||
|
||||
_PS_ARITH = {
|
||||
40: "ps_sum0", 41: "ps_sum1", 20: "ps_sum0", 21: "ps_sum1",
|
||||
32: "ps_muls0", 33: "ps_muls1", 28: "ps_madds0", 29: "ps_madds1",
|
||||
12: "ps_mul", 14: "ps_div", 10: "ps_add", 11: "ps_sub",
|
||||
26: "ps_madd", 30: "ps_nmsub", 31: "ps_msub", 28 >> 2: "x",
|
||||
18: "ps_merge00", 528: "ps_merge00", 560: "ps_merge01",
|
||||
592: "ps_merge10", 624: "ps_merge11", 25: "ps_mul",
|
||||
}
|
||||
|
||||
|
||||
def _ps_decode(w):
|
||||
major = w >> 26
|
||||
if major in (56, 57, 60, 61): # psq_l psq_lu psq_st psq_stu
|
||||
names = {56: "psq_l", 57: "psq_lu", 60: "psq_st", 61: "psq_stu"}
|
||||
fd = (w >> 21) & 31
|
||||
ra = (w >> 16) & 31
|
||||
w_ = (w >> 15) & 1
|
||||
i = (w >> 12) & 7
|
||||
d = w & 0xFFF
|
||||
if d & 0x800:
|
||||
d -= 0x1000
|
||||
return "%s f%d, %d(r%d), %d, %d" % (names[major], fd, d, ra, w_, i)
|
||||
if major in (6, 7): # psq_lx psq_stx
|
||||
names = {6: "psq_lx", 7: "psq_stx"}
|
||||
fd = (w >> 21) & 31
|
||||
ra = (w >> 16) & 31
|
||||
rb = (w >> 11) & 31
|
||||
w_ = (w >> 10) & 1
|
||||
i = (w >> 7) & 7
|
||||
return "%s f%d, r%d, r%d, %d, %d" % (names[major], fd, ra, rb, w_, i)
|
||||
if major == 4: # ps_* arithmetic
|
||||
xo = (w >> 1) & 0x3FF
|
||||
rc = w & 1
|
||||
fd = (w >> 21) & 31
|
||||
fa = (w >> 16) & 31
|
||||
fb = (w >> 11) & 31
|
||||
fc = (w >> 6) & 31
|
||||
names = {18: "ps_div", 20: "ps_sub", 21: "ps_add", 23: "ps_sel",
|
||||
24: "ps_res", 25: "ps_mul", 26: "ps_rsqrte", 28: "ps_msub",
|
||||
29: "ps_madd", 30: "ps_nmsub", 31: "ps_nmadd", 10: "ps_sum0",
|
||||
11: "ps_sum1", 12: "ps_muls0", 13: "ps_muls1",
|
||||
14: "ps_madds0", 15: "ps_madds1", 16: "ps_cmpu0",
|
||||
32: "ps_cmpo0", 40: "ps_cmpu1", 48: "ps_cmpo1",
|
||||
66: "ps_neg", 34: "ps_mr", 136: "ps_nabs", 264: "ps_abs",
|
||||
528: "ps_merge00", 560: "ps_merge01", 592: "ps_merge10",
|
||||
624: "ps_merge11", 1014: "dcbz_l"}
|
||||
n = names.get(xo)
|
||||
if n is None:
|
||||
return None
|
||||
if xo in (34, 66, 136, 264):
|
||||
return "%s%s f%d, f%d" % (n, "." if rc else "", fd, fb)
|
||||
if xo in (528, 560, 592, 624):
|
||||
return "%s%s f%d, f%d, f%d" % (n, "." if rc else "", fd, fa, fb)
|
||||
if xo in (16, 32, 40, 48):
|
||||
return "%s cr%d, f%d, f%d" % (n, fd >> 2, fa, fb)
|
||||
if xo in (10, 11):
|
||||
return "%s%s f%d, f%d, f%d, f%d" % (n, "." if rc else "", fd, fc, fa, fb)
|
||||
return "%s%s f%d, f%d, f%d, f%d" % (n, "." if rc else "", fd, fa, fc, fb)
|
||||
return None
|
||||
|
||||
|
||||
def dis(path, off, size, section=".text"):
|
||||
data, syms, relocs = _load(path)
|
||||
sec_data = data[section][1]
|
||||
|
||||
# Word-granular disassembly: capstone with paired-single fallback.
|
||||
class _I:
|
||||
__slots__ = ("address", "mnemonic", "op_str")
|
||||
|
||||
def __init__(self, a, m, o):
|
||||
self.address = a
|
||||
self.mnemonic = m
|
||||
self.op_str = o
|
||||
|
||||
insns = []
|
||||
pos = off
|
||||
end = off + size
|
||||
md = Cs(CS_ARCH_PPC, CS_MODE_32 + CS_MODE_BIG_ENDIAN)
|
||||
while pos < end:
|
||||
w = int.from_bytes(sec_data[pos:pos + 4], "big")
|
||||
major = w >> 26
|
||||
is_ps = major in (4, 56, 57, 60, 61) or (
|
||||
major in (6, 7) and ((w >> 1) & 0x3FF) == 18)
|
||||
if is_ps:
|
||||
t = _ps_decode(w)
|
||||
if t is None:
|
||||
insns.append(_I(pos, ".long", hex(w)))
|
||||
else:
|
||||
parts = t.split(" ", 1)
|
||||
insns.append(_I(pos, parts[0], parts[1]))
|
||||
pos += 4
|
||||
continue
|
||||
chunk = sec_data[pos:end]
|
||||
done = False
|
||||
for i in md.disasm(chunk, pos):
|
||||
insns.append(i)
|
||||
done = True
|
||||
break
|
||||
if not done:
|
||||
w = int.from_bytes(sec_data[pos:pos + 4], "big")
|
||||
t = _ps_decode(w)
|
||||
if t is None:
|
||||
insns.append(_I(pos, ".long", hex(w)))
|
||||
else:
|
||||
parts = t.split(" ", 1)
|
||||
insns.append(_I(pos, parts[0], parts[1]))
|
||||
pos += 4
|
||||
|
||||
out = []
|
||||
for i in insns:
|
||||
text = i.mnemonic + " " + i.op_str
|
||||
m = re.search(r"0x[0-9a-fA-F]+", i.op_str)
|
||||
if (section, i.address) in relocs:
|
||||
# External reference: show the symbol, drop the raw addend
|
||||
text = i.mnemonic + " " + re.sub(r"0x[0-9a-fA-F]+",
|
||||
"<" + relocs[(section, i.address)] + ">",
|
||||
i.op_str)
|
||||
elif m and i.mnemonic.startswith("b"):
|
||||
val = int(m.group(0), 16)
|
||||
if off <= val < off + size:
|
||||
# Intra-function branch: normalize to function-relative
|
||||
text = i.mnemonic + " " + (i.op_str[:m.start()] +
|
||||
"+" + hex(val - off) +
|
||||
i.op_str[m.end():])
|
||||
out.append((i.address - off, text))
|
||||
return out
|
||||
Reference in New Issue
Block a user