| 157 | } |
| 158 | |
| 159 | tSharedBuffer cResource_PC_CD::file_Get( cResource_File *pFile, bool pDecode ) { |
| 160 | mDataCurrent = mData->data() + pFile->mAddressStart; |
| 161 | |
| 162 | auto result = std::make_shared<std::vector<uint8>>(); |
| 163 | |
| 164 | for( uint32 i = 0; i < 0x1A3B; ++i ) |
| 165 | byte_27EE6[i] = 0x0; |
| 166 | |
| 167 | if(!pDecode) { |
| 168 | |
| 169 | |
| 170 | } else { |
| 171 | |
| 172 | // seg006:0075 |
| 173 | mBytesRead = 0; |
| 174 | byte_26DB0 = 0; |
| 175 | |
| 176 | uint8 dl = data_Read( ); |
| 177 | uint8 dh = data_Read( ); |
| 178 | |
| 179 | uint16 dx = dl | (dh << 8); |
| 180 | word_26DA8 = dx; |
| 181 | word_26DBA = dx; |
| 182 | |
| 183 | dl = data_Read( ); |
| 184 | dh = data_Read( ); |
| 185 | dx = dl | (dh << 8); |
| 186 | |
| 187 | word_26DAA = dx; |
| 188 | word_26DBA = (word_26DBA & 0xFFFF) | dx << 16; |
| 189 | |
| 190 | if ((word_26DA8 | dx) == 0) { |
| 191 | result->clear(); |
| 192 | return result; |
| 193 | } |
| 194 | |
| 195 | // seg006:00BA |
| 196 | sub_26AA4(); |
| 197 | |
| 198 | for( uint32 i = 0; i < 0xFC4; ++i ) |
| 199 | byte_27EE6[i] = 0x20; |
| 200 | |
| 201 | word_26DB4 = 0xFC4; |
| 202 | } |
| 203 | |
| 204 | for(;;) { |
| 205 | |
| 206 | if( (word_26DBA >> 16) < 0 ) |
| 207 | break; |
| 208 | |
| 209 | if( ! word_26DBA ) |
| 210 | break; |
| 211 | |
| 212 | uint16 ax = sub_26C06(); |
| 213 | |
| 214 | if( (ax & 0xFF00) == 0 ) { |
| 215 | |
| 216 | result->push_back(ax & 0xFF); |