Valhalla Legends Forums Archive | Visual Basic Programming | need help porting to vb

AuthorMessageTime
Killa
i lack expierence in C and i would like this function in vb so if anyone could help me port it id appreciate it or if somone already has if they could post it.

[code]
//----------------------------------------------------------------------
// Packet Decompression Tables
//----------------------------------------------------------------------

unsigned int CharIndex[] = {
0x0247, 0x0236, 0x0225, 0x0214, 0x0203, 0x01F2, 0x01E1, 0x01D0,
0x01BF, 0x01AE, 0x019D, 0x018C, 0x017B, 0x016A, 0x0161, 0x0158,
0x014F, 0x0146, 0x013D, 0x0134, 0x012B, 0x0122, 0x0119, 0x0110,
0x0107, 0x00FE, 0x00F5, 0x00EC, 0x00E3, 0x00DA, 0x00D1, 0x00C8,
0x00BF, 0x00B6, 0x00AD, 0x00A8, 0x00A3, 0x009E, 0x0099, 0x0094,
0x008F, 0x008A, 0x0085, 0x0080, 0x007B, 0x0076, 0x0071, 0x006C,
0x0069, 0x0066, 0x0063, 0x0060, 0x005D, 0x005A, 0x0057, 0x0054,
0x0051, 0x004E, 0x004B, 0x0048, 0x0045, 0x0042, 0x003F, 0x003F,
0x003C, 0x003C, 0x0039, 0x0039, 0x0036, 0x0036, 0x0033, 0x0033,
0x0030, 0x0030, 0x002D, 0x002D, 0x002A, 0x002A, 0x0027, 0x0027,
0x0024, 0x0024, 0x0021, 0x0021, 0x001E, 0x001E, 0x001B, 0x001B,
0x0018, 0x0018, 0x0015, 0x0015, 0x0012, 0x0012, 0x0012, 0x0012,
0x000F, 0x000F, 0x000F, 0x000F, 0x000C, 0x000C, 0x000C, 0x000C,
0x0009, 0x0009, 0x0009, 0x0009, 0x0006, 0x0006, 0x0006, 0x0006,
0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003,
0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
};


unsigned char CharTable[] = {
0x00,0x00,0x01,0x00,0x01,0x04,0x00,0xFF,0x06,0x00,0x14,0x06,
0x00,0x13,0x06,0x00,0x05,0x06,0x00,0x02,0x06,0x00,0x80,0x07,
0x00,0x6D,0x07,0x00,0x69,0x07,0x00,0x68,0x07,0x00,0x67,0x07,
0x00,0x1E,0x07,0x00,0x15,0x07,0x00,0x12,0x07,0x00,0x0D,0x07,
0x00,0x0A,0x07,0x00,0x08,0x07,0x00,0x07,0x07,0x00,0x06,0x07,
0x00,0x04,0x07,0x00,0x03,0x07,0x00,0x6C,0x08,0x00,0x51,0x08,
0x00,0x20,0x08,0x00,0x1F,0x08,0x00,0x1D,0x08,0x00,0x18,0x08,
0x00,0x17,0x08,0x00,0x16,0x08,0x00,0x11,0x08,0x00,0x10,0x08,
0x00,0x0F,0x08,0x00,0x0C,0x08,0x00,0x0B,0x08,0x00,0x09,0x08,
0x01,0x96,0x09,0x97,0x09,0x01,0x90,0x09,0x95,0x09,0x01,0x64,
0x09,0x6B,0x09,0x01,0x62,0x09,0x63,0x09,0x01,0x56,0x09,0x58,
0x09,0x01,0x52,0x09,0x55,0x09,0x01,0x4D,0x09,0x50,0x09,0x01,
0x45,0x09,0x4C,0x09,0x01,0x40,0x09,0x43,0x09,0x01,0x31,0x09,
0x3B,0x09,0x01,0x28,0x09,0x30,0x09,0x01,0x1A,0x09,0x25,0x09,
0x01,0x0E,0x09,0x19,0x09,0x02,0xE2,0x0A,0xE8,0x0A,0xF0,0x0A,
0xF8,0x0A,0x02,0xC0,0x0A,0xC2,0x0A,0xCE,0x0A,0xE0,0x0A,0x02,
0xA0,0x0A,0xA2,0x0A,0xB0,0x0A,0xB8,0x0A,0x02,0x8A,0x0A,0x8F,
0x0A,0x93,0x0A,0x98,0x0A,0x02,0x81,0x0A,0x82,0x0A,0x83,0x0A,
0x89,0x0A,0x02,0x7C,0x0A,0x7D,0x0A,0x7E,0x0A,0x7F,0x0A,0x02,
0x77,0x0A,0x78,0x0A,0x79,0x0A,0x7A,0x0A,0x02,0x73,0x0A,0x74,
0x0A,0x75,0x0A,0x76,0x0A,0x02,0x6E,0x0A,0x6F,0x0A,0x70,0x0A,
0x72,0x0A,0x02,0x61,0x0A,0x65,0x0A,0x66,0x0A,0x6A,0x0A,0x02,
0x5D,0x0A,0x5E,0x0A,0x5F,0x0A,0x60,0x0A,0x02,0x57,0x0A,0x59,
0x0A,0x5A,0x0A,0x5B,0x0A,0x02,0x4A,0x0A,0x4B,0x0A,0x4E,0x0A,
0x53,0x0A,0x02,0x46,0x0A,0x47,0x0A,0x48,0x0A,0x49,0x0A,0x02,
0x3F,0x0A,0x41,0x0A,0x42,0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0xBA,0x0B,0x03,
0xA9,0x0B,0xAA,0x0B,0xAB,0x0B,0xAC,0x0B,0xAD,0x0B,0xAE,0x0B,
0xAF,0x0B,0xB1,0x0B,0x03,0x9F,0x0B,0xA1,0x0B,0xA3,0x0B,0xA4,
0x0B,0xA5,0x0B,0xA6,0x0B,0xA7,0x0B,0xA8,0x0B,0x03,0x92,0x0B,
0x94,0x0B,0x99,0x0B,0x9A,0x0B,0x9B,0x0B,0x9C,0x0B,0x9D,0x0B,
0x9E,0x0B,0x03,0x86,0x0B,0x87,0x0B,0x88,0x0B,0x8B,0x0B,0x8C,
0x0B,0x8D,0x0B,0x8E,0x0B,0x91,0x0B,0x03,0x2F,0x0B,0x4F,0x0B,
0x54,0x0B,0x5C,0x0B,0x71,0x0B,0x7B,0x0B,0x84,0x0B,0x85,0x0B
};

unsigned int BitMasks[] = {
0x0000,0x0001,0x0003,0x0007,0x000F,0x001F,0x003F,0x007F,
0x00FF,0x01FF,0x03FF,0x07FF,0x0FFF,0x1FFF,0x3FFF,0x7FFF
};

//----------------------------------------------------------------------
// GamePacketSize
// Calculates the size of a compressed game packet.
//
// data: [in] pointer to received packet
// size: [out] pointer to size
// returns: the offset to the data.
//----------------------------------------------------------------------

unsigned char *GamePacketSize(unsigned char *data, unsigned int *size,
unsigned int *offset)
{
unsigned int a;

if (data
< 0xF0) {
*size = data
- 1;
*offset = 1;
return &data[1];
}

a = (data
& 0xF) << 8;
*size = a + data[1] - 2;
*offset = 2;
return &data[2];
}

//----------------------------------------------------------------------
// GamePacketDecode
// Decompress a d2gs packet into data.
// Note: packets come in clumps. A single compressed packet may have
// several game packets, and its up to you to figure it out.
//
// indata: [in] compressed packet (without size byte)
// insize: [in] length of indata
// outdata: [out] output buffer
// outmax: [in] size of output buffer
// outsize: [out] location to store size of decoded data
// returns: 1 on successf decode, 0 if not enough room
//----------------------------------------------------------------------

int GamePacketDecode(unsigned char *indata, unsigned int insize,
unsigned char *outdata, unsigned int outmax,
unsigned int *outsize)
{
unsigned int a, b, c, d;
unsigned int maxcnt, index, cnt;
unsigned char *outptr, *inptr;
int size;

b = 0;

size = insize;
inptr = indata;

maxcnt = outmax;
outptr = outdata;
cnt = 0x20;

while (1) {

if (cnt >= 0x8) {
while (size > 0 && cnt >= 8) {
cnt -= 0x8;
size--;
a = *inptr++ << cnt;
b |= a;
};
}

index = CharIndex[b >> 0x18];
a = CharTable[index];
d = (b >> (0x18 - a)) & BitMasks[a];
c = CharTable[index + 2*d + 2];

cnt += c;
if (cnt > 0x20) {
*outsize = outmax - maxcnt;
return 1;
}

if (maxcnt-- == 0)
return 0;

a = CharTable[index + 2*d + 1];
*outptr++ = (unsigned char)a;

b <<= (c & 0xFF);
}

assert(0);
return 0;
}

[/code]
December 6, 2003, 5:39 PM
warz
Make a .dll in C, and just use that? No porting needed
December 6, 2003, 11:30 PM
Grok
If you're going to post someone else's work, give credit to the original author.
December 7, 2003, 1:45 AM
St0rm.iD
I would...but...I'm not typing all that.
December 7, 2003, 6:11 AM
iago
Sure, let me just spend my entire morning banging that out in VB! haha but seriously, it would probably take you less time to learn C++ than for me to convert that.
December 7, 2003, 2:23 PM
Adron
I don't think it'd take that long to port it. Maybe 1-5 hours work? What's your hourly rate?

Edit:

It sounds like boring work and nothing I really want to do, but send me this and I'll get right on porting that thing ;)
December 7, 2003, 2:47 PM
TheMinistered
Adron, how do you plan on doing the bitwise shifts without a c++ dll? in pure vb? haha?
December 7, 2003, 3:35 PM
Killa
when porting it what exactly should i do with these huge tables?

[code]

unsigned int CharIndex[] = {
0x0247, 0x0236, 0x0225, 0x0214, 0x0203, 0x01F2, 0x01E1, 0x01D0,
0x01BF, 0x01AE, 0x019D, 0x018C, 0x017B, 0x016A, 0x0161, 0x0158,
0x014F, 0x0146, 0x013D, 0x0134, 0x012B, 0x0122, 0x0119, 0x0110,
0x0107, 0x00FE, 0x00F5, 0x00EC, 0x00E3, 0x00DA, 0x00D1, 0x00C8,
0x00BF, 0x00B6, 0x00AD, 0x00A8, 0x00A3, 0x009E, 0x0099, 0x0094,
0x008F, 0x008A, 0x0085, 0x0080, 0x007B, 0x0076, 0x0071, 0x006C,
0x0069, 0x0066, 0x0063, 0x0060, 0x005D, 0x005A, 0x0057, 0x0054,
0x0051, 0x004E, 0x004B, 0x0048, 0x0045, 0x0042, 0x003F, 0x003F,
0x003C, 0x003C, 0x0039, 0x0039, 0x0036, 0x0036, 0x0033, 0x0033,
0x0030, 0x0030, 0x002D, 0x002D, 0x002A, 0x002A, 0x0027, 0x0027,
0x0024, 0x0024, 0x0021, 0x0021, 0x001E, 0x001E, 0x001B, 0x001B,
0x0018, 0x0018, 0x0015, 0x0015, 0x0012, 0x0012, 0x0012, 0x0012,
0x000F, 0x000F, 0x000F, 0x000F, 0x000C, 0x000C, 0x000C, 0x000C,
0x0009, 0x0009, 0x0009, 0x0009, 0x0006, 0x0006, 0x0006, 0x0006,
0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003,
0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003, 0x0003,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
};


unsigned char CharTable[] = {
0x00,0x00,0x01,0x00,0x01,0x04,0x00,0xFF,0x06,0x00,0x14,0x06,
0x00,0x13,0x06,0x00,0x05,0x06,0x00,0x02,0x06,0x00,0x80,0x07,
0x00,0x6D,0x07,0x00,0x69,0x07,0x00,0x68,0x07,0x00,0x67,0x07,
0x00,0x1E,0x07,0x00,0x15,0x07,0x00,0x12,0x07,0x00,0x0D,0x07,
0x00,0x0A,0x07,0x00,0x08,0x07,0x00,0x07,0x07,0x00,0x06,0x07,
0x00,0x04,0x07,0x00,0x03,0x07,0x00,0x6C,0x08,0x00,0x51,0x08,
0x00,0x20,0x08,0x00,0x1F,0x08,0x00,0x1D,0x08,0x00,0x18,0x08,
0x00,0x17,0x08,0x00,0x16,0x08,0x00,0x11,0x08,0x00,0x10,0x08,
0x00,0x0F,0x08,0x00,0x0C,0x08,0x00,0x0B,0x08,0x00,0x09,0x08,
0x01,0x96,0x09,0x97,0x09,0x01,0x90,0x09,0x95,0x09,0x01,0x64,
0x09,0x6B,0x09,0x01,0x62,0x09,0x63,0x09,0x01,0x56,0x09,0x58,
0x09,0x01,0x52,0x09,0x55,0x09,0x01,0x4D,0x09,0x50,0x09,0x01,
0x45,0x09,0x4C,0x09,0x01,0x40,0x09,0x43,0x09,0x01,0x31,0x09,
0x3B,0x09,0x01,0x28,0x09,0x30,0x09,0x01,0x1A,0x09,0x25,0x09,
0x01,0x0E,0x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x0B,0x71,0x0B,0x7B,0x0B,0x84,0x0B,0x85,0x0B
};

unsigned int BitMasks[] = {
0x0000,0x0001,0x0003,0x0007,0x000F,0x001F,0x003F,0x007F,
0x00FF,0x01FF,0x03FF,0x07FF,0x0FFF,0x1FFF,0x3FFF,0x7FFF
};

[/code]

im unsure as to what i should change them into for them to function properly
December 7, 2003, 4:42 PM
Adron
[quote author=TheMinistered link=board=31;threadid=4109;start=0#msg34120 date=1070811300]
Adron, how do you plan on doing the bitwise shifts without a c++ dll? in pure vb? haha?
[/quote]

Those aren't a problem. They won't be as good performance as if done in c++, but it'll work.
December 7, 2003, 5:01 PM
UserLoser.
Hmm

[code]
Private CharIndex(0 To 255) As Long
Private CharTable(0 To 599) As Long
Private BitMasks(0 To 15) As Long

Public Sub InitTables()
BitMasks(0) = &H0
BitMasks(1) = &H1
BitMasks(2) = &H3
BitMasks(3) = &H7
BitMasks(4) = &HF
BitMasks(5) = &H1F
BitMasks(6) = &H3F
BitMasks(7) = &H7F
BitMasks(8) = &HFF
BitMasks(9) = &H1FF
BitMasks(10) = &H3FF
BitMasks(11) = &H7FF
BitMasks(12) = &HFFF
BitMasks(13) = &H1FFF
BitMasks(14) = &H3FFF
BitMasks(15) = &H7FFF
CharIndex(0) = &H247
CharIndex(1) = &H236
CharIndex(2) = &H225
CharIndex(3) = &H214
CharIndex(4) = &H203
CharIndex(5) = &H1F2
CharIndex(6) = &H1E1
CharIndex(7) = &H1D0
CharIndex(8) = &H1BF
CharIndex(9) = &H1AE
CharIndex(10) = &H19D
CharIndex(11) = &H18C
CharIndex(12) = &H17B
CharIndex(13) = &H16A
CharIndex(14) = &H161
CharIndex(15) = &H158
CharIndex(16) = &H14F
CharIndex(17) = &H146
CharIndex(18) = &H13D
CharIndex(19) = &H134
CharIndex(20) = &H12B
CharIndex(21) = &H122
CharIndex(22) = &H119
CharIndex(23) = &H110
CharIndex(24) = &H107
CharIndex(25) = &HFE
CharIndex(26) = &HF5
CharIndex(27) = &HEC
CharIndex(28) = &HE3
CharIndex(29) = &HDA
CharIndex(30) = &HD1
CharIndex(31) = &HC8
CharIndex(32) = &HBF
CharIndex(33) = &HB6
CharIndex(34) = &HAD
CharIndex(35) = &HA8
CharIndex(36) = &HA3
CharIndex(37) = &H9E
CharIndex(38) = &H99
CharIndex(39) = &H94
CharIndex(40) = &H8F
CharIndex(41) = &H8A
CharIndex(42) = &H85
CharIndex(43) = &H80
CharIndex(44) = &H7B
CharIndex(45) = &H76
CharIndex(46) = &H71
CharIndex(47) = &H6C
CharIndex(48) = &H69
CharIndex(49) = &H66
CharIndex(50) = &H63
CharIndex(51) = &H60
CharIndex(52) = &H5D
CharIndex(53) = &H5A
CharIndex(54) = &H57
CharIndex(55) = &H54
CharIndex(56) = &H51
CharIndex(57) = &H4E
CharIndex(58) = &H4B
CharIndex(59) = &H48
CharIndex(60) = &H45
CharIndex(61) = &H42
CharIndex(62) = &H3F
CharIndex(63) = &H3F
CharIndex(64) = &H3C
CharIndex(65) = &H3C
CharIndex(66) = &H39
CharIndex(67) = &H39
CharIndex(68) = &H36
CharIndex(69) = &H36
CharIndex(70) = &H33
CharIndex(71) = &H33
CharIndex(72) = &H30
CharIndex(73) = &H30
CharIndex(74) = &H2D
CharIndex(75) = &H2D
CharIndex(76) = &H2A
CharIndex(77) = &H2A
CharIndex(78) = &H27
CharIndex(79) = &H27
CharIndex(80) = &H24
CharIndex(81) = &H24
CharIndex(82) = &H21
CharIndex(83) = &H21
CharIndex(84) = &H1E
CharIndex(85) = &H1E
CharIndex(86) = &H1B
CharIndex(87) = &H1B
CharIndex(88) = &H18
CharIndex(89) = &H18
CharIndex(90) = &H15
CharIndex(91) = &H15
CharIndex(92) = &H12
CharIndex(93) = &H12
CharIndex(94) = &H12
CharIndex(95) = &H12
CharIndex(96) = &HF
CharIndex(97) = &HF
CharIndex(98) = &HF
CharIndex(99) = &HF
CharIndex(100) = &HC
CharIndex(101) = &HC
CharIndex(102) = &HC
CharIndex(103) = &HC
CharIndex(104) = &H9
CharIndex(105) = &H9
CharIndex(106) = &H9
CharIndex(107) = &H9
CharIndex(108) = &H6
CharIndex(109) = &H6
CharIndex(110) = &H6
CharIndex(111) = &H6
CharIndex(112) = &H3
CharIndex(113) = &H3
CharIndex(114) = &H3
CharIndex(115) = &H3
CharIndex(116) = &H3
CharIndex(117) = &H3
CharIndex(118) = &H3
CharIndex(119) = &H3
CharIndex(120) = &H3
CharIndex(121) = &H3
CharIndex(122) = &H3
CharIndex(123) = &H3
CharIndex(124) = &H3
CharIndex(125) = &H3
CharIndex(126) = &H3
CharIndex(127) = &H3
CharIndex(128) = &H0
CharIndex(129) = &H0
CharIndex(130) = &H0
CharIndex(131) = &H0
CharIndex(132) = &H0
CharIndex(133) = &H0
CharIndex(134) = &H0
CharIndex(135) = &H0
CharIndex(136) = &H0
CharIndex(137) = &H0
CharIndex(138) = &H0
CharIndex(139) = &H0
CharIndex(140) = &H0
CharIndex(141) = &H0
CharIndex(142) = &H0
CharIndex(143) = &H0
CharIndex(144) = &H0
CharIndex(145) = &H0
CharIndex(146) = &H0
CharIndex(147) = &H0
CharIndex(148) = &H0
CharIndex(149) = &H0
CharIndex(150) = &H0
CharIndex(151) = &H0
CharIndex(152) = &H0
CharIndex(153) = &H0
CharIndex(154) = &H0
CharIndex(155) = &H0
CharIndex(156) = &H0
CharIndex(157) = &H0
CharIndex(158) = &H0
CharIndex(159) = &H0
CharIndex(160) = &H0
CharIndex(161) = &H0
CharIndex(162) = &H0
CharIndex(163) = &H0
CharIndex(164) = &H0
CharIndex(165) = &H0
CharIndex(166) = &H0
CharIndex(167) = &H0
CharIndex(168) = &H0
CharIndex(169) = &H0
CharIndex(170) = &H0
CharIndex(171) = &H0
CharIndex(172) = &H0
CharIndex(173) = &H0
CharIndex(174) = &H0
CharIndex(175) = &H0
CharIndex(176) = &H0
CharIndex(177) = &H0
CharIndex(178) = &H0
CharIndex(179) = &H0
CharIndex(180) = &H0
CharIndex(181) = &H0
CharIndex(182) = &H0
CharIndex(183) = &H0
CharIndex(184) = &H0
CharIndex(185) = &H0
CharIndex(186) = &H0
CharIndex(187) = &H0
CharIndex(188) = &H0
CharIndex(189) = &H0
CharIndex(190) = &H0
CharIndex(191) = &H0
CharIndex(192) = &H0
CharIndex(193) = &H0
CharIndex(194) = &H0
CharIndex(195) = &H0
CharIndex(196) = &H0
CharIndex(197) = &H0
CharIndex(198) = &H0
CharIndex(199) = &H0
CharIndex(200) = &H0
CharIndex(201) = &H0
CharIndex(202) = &H0
CharIndex(203) = &H0
CharIndex(204) = &H0
CharIndex(205) = &H0
CharIndex(206) = &H0
CharIndex(207) = &H0
CharIndex(208) = &H0
CharIndex(209) = &H0
CharIndex(210) = &H0
CharIndex(211) = &H0
CharIndex(212) = &H0
CharIndex(213) = &H0
CharIndex(214) = &H0
CharIndex(215) = &H0
CharIndex(216) = &H0
CharIndex(217) = &H0
CharIndex(218) = &H0
CharIndex(219) = &H0
CharIndex(220) = &H0
CharIndex(221) = &H0
CharIndex(222) = &H0
CharIndex(223) = &H0
CharIndex(224) = &H0
CharIndex(225) = &H0
CharIndex(226) = &H0
CharIndex(227) = &H0
CharIndex(228) = &H0
CharIndex(229) = &H0
CharIndex(230) = &H0
CharIndex(231) = &H0
CharIndex(232) = &H0
CharIndex(233) = &H0
CharIndex(234) = &H0
CharIndex(235) = &H0
CharIndex(236) = &H0
CharIndex(237) = &H0
CharIndex(238) = &H0
CharIndex(239) = &H0
CharIndex(240) = &H0
CharIndex(241) = &H0
CharIndex(242) = &H0
CharIndex(243) = &H0
CharIndex(244) = &H0
CharIndex(245) = &H0
CharIndex(246) = &H0
CharIndex(247) = &H0
CharIndex(248) = &H0
CharIndex(249) = &H0
CharIndex(250) = &H0
CharIndex(251) = &H0
CharIndex(252) = &H0
CharIndex(253) = &H0
CharIndex(254) = &H0
CharIndex(255) = &H0
CharTable(0) = &H0
CharTable(1) = &H0
CharTable(2) = &H1
CharTable(3) = &H0
CharTable(4) = &H1
CharTable(5) = &H4
CharTable(6) = &H0
CharTable(7) = &HFF
CharTable(8) = &H6
CharTable(9) = &H0
CharTable(10) = &H14
CharTable(11) = &H6
CharTable(12) = &H0
CharTable(13) = &H13
CharTable(14) = &H6
CharTable(15) = &H0
CharTable(16) = &H5
CharTable(17) = &H6
CharTable(18) = &H0
CharTable(19) = &H2
CharTable(20) = &H6
CharTable(21) = &H0
CharTable(22) = &H80
CharTable(23) = &H7
CharTable(24) = &H0
CharTable(25) = &H6D
CharTable(26) = &H7
CharTable(27) = &H0
CharTable(28) = &H69
CharTable(29) = &H7
CharTable(30) = &H0
CharTable(31) = &H68
CharTable(32) = &H7
CharTable(33) = &H0
CharTable(34) = &H67
CharTable(35) = &H7
CharTable(36) = &H0
CharTable(37) = &H1E
CharTable(38) = &H7
CharTable(39) = &H0
CharTable(40) = &H15
CharTable(41) = &H7
CharTable(42) = &H0
CharTable(43) = &H12
CharTable(44) = &H7
CharTable(45) = &H0
CharTable(46) = &HD
CharTable(47) = &H7
CharTable(48) = &H0
CharTable(49) = &HA
CharTable(50) = &H7
CharTable(51) = &H0
CharTable(52) = &H8
CharTable(53) = &H7
CharTable(54) = &H0
CharTable(55) = &H7
CharTable(56) = &H7
CharTable(57) = &H0
CharTable(58) = &H6
CharTable(59) = &H7
CharTable(60) = &H0
CharTable(61) = &H4
CharTable(62) = &H7
CharTable(63) = &H0
CharTable(64) = &H3
CharTable(65) = &H7
CharTable(66) = &H0
CharTable(67) = &H6C
CharTable(68) = &H8
CharTable(69) = &H0
CharTable(70) = &H51
CharTable(71) = &H8
CharTable(72) = &H0
CharTable(73) = &H20
CharTable(74) = &H8
CharTable(75) = &H0
CharTable(76) = &H1F
CharTable(77) = &H8
CharTable(78) = &H0
CharTable(79) = &H1D
CharTable(80) = &H8
CharTable(81) = &H0
CharTable(82) = &H18
CharTable(83) = &H8
CharTable(84) = &H0
CharTable(85) = &H17
CharTable(86) = &H8
CharTable(87) = &H0
CharTable(88) = &H16
CharTable(89) = &H8
CharTable(90) = &H0
CharTable(91) = &H11
CharTable(92) = &H8
CharTable(93) = &H0
CharTable(94) = &H10
CharTable(95) = &H8
CharTable(96) = &H0
CharTable(97) = &HF
CharTable(98) = &H8
CharTable(99) = &H0
CharTable(100) = &HC
CharTable(101) = &H8
CharTable(102) = &H0
CharTable(103) = &HB
CharTable(104) = &H8
CharTable(105) = &H0
CharTable(106) = &H9
CharTable(107) = &H8
CharTable(108) = &H1
CharTable(109) = &H96
CharTable(110) = &H9
CharTable(111) = &H97
CharTable(112) = &H9
CharTable(113) = &H1
CharTable(114) = &H90
CharTable(115) = &H9
CharTable(116) = &H95
CharTable(117) = &H9
CharTable(118) = &H1
CharTable(119) = &H64
CharTable(120) = &H9
CharTable(121) = &H6B
CharTable(122) = &H9
CharTable(123) = &H1
CharTable(124) = &H62
CharTable(125) = &H9
CharTable(126) = &H63
CharTable(127) = &H9
CharTable(128) = &H1
CharTable(129) = &H56
CharTable(130) = &H9
CharTable(131) = &H58
CharTable(132) = &H9
CharTable(133) = &H1
CharTable(134) = &H52
CharTable(135) = &H9
CharTable(136) = &H55
CharTable(137) = &H9
CharTable(138) = &H1
CharTable(139) = &H4D
CharTable(140) = &H9
CharTable(141) = &H50
CharTable(142) = &H9
CharTable(143) = &H1
CharTable(144) = &H45
CharTable(145) = &H9
CharTable(146) = &H4C
CharTable(147) = &H9
CharTable(148) = &H1
CharTable(149) = &H40
CharTable(150) = &H9
CharTable(151) = &H43
CharTable(152) = &H9
CharTable(153) = &H1
CharTable(154) = &H31
CharTable(155) = &H9
CharTable(156) = &H3B
CharTable(157) = &H9
CharTable(158) = &H1
CharTable(159) = &H28
CharTable(160) = &H9
CharTable(161) = &H30
CharTable(162) = &H9
CharTable(163) = &H1
CharTable(164) = &H1A
CharTable(165) = &H9
CharTable(166) = &H25
CharTable(167) = &H9
CharTable(168) = &H1
CharTable(169) = &HE
CharTable(170) = &H9
CharTable(171) = &H19
CharTable(172) = &H9
CharTable(173) = &H2
CharTable(174) = &HE2
CharTable(175) = &HA
CharTable(176) = &HE8
CharTable(177) = &HA
CharTable(178) = &HF0
CharTable(179) = &HA
CharTable(180) = &HF8
CharTable(181) = &HA
CharTable(182) = &H2
CharTable(183) = &HC0
CharTable(184) = &HA
CharTable(185) = &HC2
CharTable(186) = &HA
CharTable(187) = &HCE
CharTable(188) = &HA
CharTable(189) = &HE0
CharTable(190) = &HA
CharTable(191) = &H2
CharTable(192) = &HA0
CharTable(193) = &HA
CharTable(194) = &HA2
CharTable(195) = &HA
CharTable(196) = &HB0
CharTable(197) = &HA
CharTable(198) = &HB8
CharTable(199) = &HA
CharTable(200) = &H2
CharTable(201) = &H8A
CharTable(202) = &HA
CharTable(203) = &H8F
CharTable(204) = &HA
CharTable(205) = &H93
CharTable(206) = &HA
CharTable(207) = &H98
CharTable(208) = &HA
CharTable(209) = &H2
CharTable(210) = &H81
CharTable(211) = &HA
CharTable(212) = &H82
CharTable(213) = &HA
CharTable(214) = &H83
CharTable(215) = &HA
CharTable(216) = &H89
CharTable(217) = &HA
CharTable(218) = &H2
CharTable(219) = &H7C
CharTable(220) = &HA
CharTable(221) = &H7D
CharTable(222) = &HA
CharTable(223) = &H7E
CharTable(224) = &HA
CharTable(225) = &H7F
CharTable(226) = &HA
CharTable(227) = &H2
CharTable(228) = &H77
CharTable(229) = &HA
CharTable(230) = &H78
CharTable(231) = &HA
CharTable(232) = &H79
CharTable(233) = &HA
CharTable(234) = &H7A
CharTable(235) = &HA
CharTable(236) = &H2
CharTable(237) = &H73
CharTable(238) = &HA
CharTable(239) = &H74
CharTable(240) = &HA
CharTable(241) = &H75
CharTable(242) = &HA
CharTable(243) = &H76
CharTable(244) = &HA
CharTable(245) = &H2
CharTable(246) = &H6E
CharTable(247) = &HA
CharTable(248) = &H6F
CharTable(249) = &HA
CharTable(250) = &H70
CharTable(251) = &HA
CharTable(252) = &H72
CharTable(253) = &HA
CharTable(254) = &H2
CharTable(255) = &H61
CharTable(256) = &HA
CharTable(257) = &H65
CharTable(258) = &HA
CharTable(259) = &H66
CharTable(260) = &HA
CharTable(261) = &H6A
CharTable(262) = &HA
CharTable(263) = &H2
CharTable(264) = &H5D
CharTable(265) = &HA
CharTable(266) = &H5E
CharTable(267) = &HA
CharTable(268) = &H5F
CharTable(269) = &HA
CharTable(270) = &H60
CharTable(271) = &HA
CharTable(272) = &H2
CharTable(273) = &H57
CharTable(274) = &HA
CharTable(275) = &H59
CharTable(276) = &HA
CharTable(277) = &H5A
CharTable(278) = &HA
CharTable(279) = &H5B
CharTable(280) = &HA
CharTable(281) = &H2
CharTable(282) = &H4A
CharTable(283) = &HA
CharTable(284) = &H4B
CharTable(285) = &HA
CharTable(286) = &H4E
CharTable(287) = &HA
CharTable(288) = &H53
CharTable(289) = &HA
CharTable(290) = &H2
CharTable(291) = &H46
CharTable(292) = &HA
CharTable(293) = &H47
CharTable(294) = &HA
CharTable(295) = &H48
CharTable(296) = &HA
CharTable(297) = &H49
CharTable(298) = &HA
CharTable(299) = &H2
CharTable(300) = &H3F
CharTable(301) = &HA
CharTable(302) = &H41
CharTable(303) = &HA
CharTable(304) = &H42
CharTable(305) = &HA
CharTable(306) = &H44
CharTable(307) = &HA
CharTable(308) = &H2
CharTable(309) = &H3A
CharTable(310) = &HA
CharTable(311) = &H3C
CharTable(312) = &HA
CharTable(313) = &H3D
CharTable(314) = &HA
CharTable(315) = &H3E
CharTable(316) = &HA
CharTable(317) = &H2
CharTable(318) = &H36
CharTable(319) = &HA
CharTable(320) = &H37
CharTable(321) = &HA
CharTable(322) = &H38
CharTable(323) = &HA
CharTable(324) = &H39
CharTable(325) = &HA
CharTable(326) = &H2
CharTable(327) = &H32
CharTable(328) = &HA
CharTable(329) = &H33
CharTable(330) = &HA
CharTable(331) = &H34
CharTable(332) = &HA
CharTable(333) = &H35
CharTable(334) = &HA
CharTable(335) = &H2
CharTable(336) = &H2B
CharTable(337) = &HA
CharTable(338) = &H2C
CharTable(339) = &HA
CharTable(340) = &H2D
CharTable(341) = &HA
CharTable(342) = &H2E
CharTable(343) = &HA
CharTable(344) = &H2
CharTable(345) = &H26
CharTable(346) = &HA
CharTable(347) = &H27
CharTable(348) = &HA
CharTable(349) = &H29
CharTable(350) = &HA
CharTable(351) = &H2A
CharTable(352) = &HA
CharTable(353) = &H2
CharTable(354) = &H21
CharTable(355) = &HA
CharTable(356) = &H22
CharTable(357) = &HA
CharTable(358) = &H23
CharTable(359) = &HA
CharTable(360) = &H24
CharTable(361) = &HA
CharTable(362) = &H3
CharTable(363) = &HFB
CharTable(364) = &HB
CharTable(365) = &HFC
CharTable(366) = &HB
CharTable(367) = &HFD
CharTable(368) = &HB
CharTable(369) = &HFE
CharTable(370) = &HB
CharTable(371) = &H1B
CharTable(372) = &HA
CharTable(373) = &H1B
CharTable(374) = &HA
CharTable(375) = &H1C
CharTable(376) = &HA
CharTable(377) = &H1C
CharTable(378) = &HA
CharTable(379) = &H3
CharTable(380) = &HF2
CharTable(381) = &HB
CharTable(382) = &HF3
CharTable(383) = &HB
CharTable(384) = &HF4
CharTable(385) = &HB
CharTable(386) = &HF5
CharTable(387) = &HB
CharTable(388) = &HF6
CharTable(389) = &HB
CharTable(390) = &HF7
CharTable(391) = &HB
CharTable(392) = &HF9
CharTable(393) = &HB
CharTable(394) = &HFA
CharTable(395) = &HB
CharTable(396) = &H3
CharTable(397) = &HE9
CharTable(398) = &HB
CharTable(399) = &HEA
CharTable(400) = &HB
CharTable(401) = &HEB
CharTable(402) = &HB
CharTable(403) = &HEC
CharTable(404) = &HB
CharTable(405) = &HED
CharTable(406) = &HB
CharTable(407) = &HEE
CharTable(408) = &HB
CharTable(409) = &HEF
CharTable(410) = &HB
CharTable(411) = &HF1
CharTable(412) = &HB
CharTable(413) = &H3
CharTable(414) = &HDE
CharTable(415) = &HB
CharTable(416) = &HDF
CharTable(417) = &HB
CharTable(418) = &HE1
CharTable(419) = &HB
CharTable(420) = &HE3
CharTable(421) = &HB
CharTable(422) = &HE4
CharTable(423) = &HB
CharTable(424) = &HE5
CharTable(425) = &HB
CharTable(426) = &HE6
CharTable(427) = &HB
CharTable(428) = &HE7
CharTable(429) = &HB
CharTable(430) = &H3
CharTable(431) = &HD6
CharTable(432) = &HB
CharTable(433) = &HD7
CharTable(434) = &HB
CharTable(435) = &HD8
CharTable(436) = &HB
CharTable(437) = &HD9
CharTable(438) = &HB
CharTable(439) = &HDA
CharTable(440) = &HB
CharTable(441) = &HDB
CharTable(442) = &HB
CharTable(443) = &HDC
CharTable(444) = &HB
CharTable(445) = &HDD
CharTable(446) = &HB
CharTable(447) = &H3
CharTable(448) = &HCD
CharTable(449) = &HB
CharTable(450) = &HCF
CharTable(451) = &HB
CharTable(452) = &HD0
CharTable(453) = &HB
CharTable(454) = &HD1
CharTable(455) = &HB
CharTable(456) = &HD2
CharTable(457) = &HB
CharTable(458) = &HD3
CharTable(459) = &HB
CharTable(460) = &HD4
CharTable(461) = &HB
CharTable(462) = &HD5
CharTable(463) = &HB
CharTable(464) = &H3
CharTable(465) = &HC5
CharTable(466) = &HB
CharTable(467) = &HC6
CharTable(468) = &HB
CharTable(469) = &HC7
CharTable(470) = &HB
CharTable(471) = &HC8
CharTable(472) = &HB
CharTable(473) = &HC9
CharTable(474) = &HB
CharTable(475) = &HCA
CharTable(476) = &HB
CharTable(477) = &HCB
CharTable(478) = &HB
CharTable(479) = &HCC
CharTable(480) = &HB
CharTable(481) = &H3
CharTable(482) = &HBB
CharTable(483) = &HB
CharTable(484) = &HBC
CharTable(485) = &HB
CharTable(486) = &HBD
CharTable(487) = &HB
CharTable(488) = &HBE
CharTable(489) = &HB
CharTable(490) = &HBF
CharTable(491) = &HB
CharTable(492) = &HC1
CharTable(493) = &HB
CharTable(494) = &HC3
CharTable(495) = &HB
CharTable(496) = &HC4
CharTable(497) = &HB
CharTable(498) = &H3
CharTable(499) = &HB2
CharTable(500) = &HB
CharTable(501) = &HB3
CharTable(502) = &HB
CharTable(503) = &HB4
CharTable(504) = &HB
CharTable(505) = &HB5
CharTable(506) = &HB
CharTable(507) = &HB6
CharTable(508) = &HB
CharTable(509) = &HB7
CharTable(510) = &HB
CharTable(511) = &HB9
CharTable(512) = &HB
CharTable(513) = &HBA
CharTable(514) = &HB
CharTable(515) = &H3
CharTable(516) = &HA9
CharTable(517) = &HB
CharTable(518) = &HAA
CharTable(519) = &HB
CharTable(520) = &HAB
CharTable(521) = &HB
CharTable(522) = &HAC
CharTable(523) = &HB
CharTable(524) = &HAD
CharTable(525) = &HB
CharTable(526) = &HAE
CharTable(527) = &HB
CharTable(528) = &HAF
CharTable(529) = &HB
CharTable(530) = &HB1
CharTable(531) = &HB
CharTable(532) = &H3
CharTable(533) = &H9F
CharTable(534) = &HB
CharTable(535) = &HA1
CharTable(536) = &HB
CharTable(537) = &HA3
CharTable(538) = &HB
CharTable(539) = &HA4
CharTable(540) = &HB
CharTable(541) = &HA5
CharTable(542) = &HB
CharTable(543) = &HA6
CharTable(544) = &HB
CharTable(545) = &HA7
CharTable(546) = &HB
CharTable(547) = &HA8
CharTable(548) = &HB
CharTable(549) = &H3
CharTable(550) = &H92
CharTable(551) = &HB
CharTable(552) = &H94
CharTable(553) = &HB
CharTable(554) = &H99
CharTable(555) = &HB
CharTable(556) = &H9A
CharTable(557) = &HB
CharTable(558) = &H9B
CharTable(559) = &HB
CharTable(560) = &H9C
CharTable(561) = &HB
CharTable(562) = &H9D
CharTable(563) = &HB
CharTable(564) = &H9E
CharTable(565) = &HB
CharTable(566) = &H3
CharTable(567) = &H86
CharTable(568) = &HB
CharTable(569) = &H87
CharTable(570) = &HB
CharTable(571) = &H88
CharTable(572) = &HB
CharTable(573) = &H8B
CharTable(574) = &HB
CharTable(575) = &H8C
CharTable(576) = &HB
CharTable(577) = &H8D
CharTable(578) = &HB
CharTable(579) = &H8E
CharTable(580) = &HB
CharTable(581) = &H91
CharTable(582) = &HB
CharTable(583) = &H3
CharTable(584) = &H2F
CharTable(585) = &HB
CharTable(586) = &H4F
CharTable(587) = &HB
CharTable(588) = &H54
CharTable(589) = &HB
CharTable(590) = &H5C
CharTable(591) = &HB
CharTable(592) = &H71
CharTable(593) = &HB
CharTable(594) = &H7B
CharTable(595) = &HB
CharTable(596) = &H84
CharTable(597) = &HB
CharTable(598) = &H85
CharTable(599) = &HB
End Sub
[/code]
December 7, 2003, 7:07 PM
iago
nonono!

You got the variable types all wrong. Retype!
December 7, 2003, 10:29 PM
Spht
Userloser, I gave you a better way of doing that. Paste.
December 7, 2003, 11:17 PM
UserLoser.
[quote author=Spht link=board=31;threadid=4109;start=0#msg34190 date=1070839051]
Userloser, I gave you a better way of doing that. Paste.
[/quote]

i don't have your better way of doing it anymore
December 9, 2003, 12:08 AM
Spht
[quote author=UserLoser. link=board=31;threadid=4109;start=0#msg34374 date=1070928486]
[quote author=Spht link=board=31;threadid=4109;start=0#msg34190 date=1070839051]
Userloser, I gave you a better way of doing that. Paste.
[/quote]

i don't have your better way of doing it anymore
[/quote]

Deleted what I gave you and decided to go with your total crap code instead?
December 9, 2003, 12:37 AM
Killa
can you post it spht? or do you not have it anymore or somthing
December 9, 2003, 1:07 AM
dRAgoN
just because you did a whole hell of alot of typeing there User +1
December 9, 2003, 7:30 PM
Stealth
Hell, I would have written a little program to convert the tables for me.. nobody would actually go through those tables converting them to VB by hand, right?
December 9, 2003, 10:06 PM
Spht
[quote author=Stealth link=board=31;threadid=4109;start=15#msg34493 date=1071007604]
Hell, I would have written a little program to convert the tables for me.. nobody would actually go through those tables converting them to VB by hand, right?
[/quote]

I'd hope not. I suggest declaring a global array for each table (CharIndex, CharTable, BitMasks) then write a function to fill the array which can be called like this:

[code]FillArray CharIndex, _
&H0247, &H0236, &H0225, &H0214, &H0203, &H01F2, &H01E1, &H01D0, _
&H01BF, &H01AE, &H019D, &H018C, &H017B, &H016A, &H0161, &H0158, _
...[/code]

The arguments for the function would look something like, FillArray(TheArray(), ParamArray paElements()). I did not save the example I sent UL because I assumed he'd keep it...
December 9, 2003, 10:26 PM
Etheran
[quote author=Stealth link=board=31;threadid=4109;start=15#msg34493 date=1071007604]
Hell, I would have written a little program to convert the tables for me.. nobody would actually go through those tables converting them to VB by hand, right?
[/quote]That's what I did the last time I tried to port this.
December 11, 2003, 12:51 AM
Etheran
[quote author=TheMinistered link=board=31;threadid=4109;start=0#msg34120 date=1070811300]
Adron, how do you plan on doing the bitwise shifts without a c++ dll? in pure vb? haha?
[/quote]

HINT:
x << y
x * (2^y) (note: ^ is power of and not xor)

x >> y
x / (2^y)
December 11, 2003, 12:54 AM
Adron
Yes, but you have to mask off bits so VB won't puke on an overflow.
December 11, 2003, 4:19 AM
Killa
im wondering if anyone can tell me how far off from accurate this is or if anyone can correct any errors i made in porting this.

http://www.geocities.com/clan_darknexus/Module1.bas
December 13, 2003, 3:53 PM
Spht
[quote author=Killa link=board=31;threadid=4109;start=15#msg35121 date=1071330814]
if anyone can correct any errors i made in porting this.
[/quote]

Yes, you went with UserLoser's horrible coding after asking me how I told him to do it, then ignoring my post (just like UserLoser did...)?

I guess people don't care for optimizations.
December 13, 2003, 4:15 PM
Killa
well after i actually get it working ill proboly use your suggestion for the tables,i just want to get it working right now.
December 13, 2003, 4:18 PM

Search