Post Reply 
[PSP] [Source code] Simple Popstation GUI v3.00 beta
Author Message
pka4916
Neophitic Presence

Posts: 5.1711
Threads: 0
Joined: 22nd Dec 2007
Reputation: 0
E-Pigs: 0.5000
Offline
Post: #24
RE: [PSP] [Source code] Simple Popstation GUI v3.00 beta
in vb6 it works fine, in .net it isn't working

Visual Basic Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
'The code

        intFF2 = FreeFile()
        FileOpen(intFF2, strISO, OpenMode.Binary)

        'get data
        Dim bytBuff(16 * 2352 - 1) As Byte
        Dim bytBuffC(lngISOIndex_Length(lngCnt) - 1) As Byte


        Dim lngRtn As Integer 'return from zlib
        Dim ZS As Z_STREAM_S

        Dim intUpdCnt As Short
        Const UPDATE_FREQ As Short = 32 'every 1MB

        For lngCnt = 0 To lngNumIndexes - 1
            Seek(intFF, lngPSARHead + &H100001 + lngISOIndex_Offset(lngCnt))

            intUpdCnt = intUpdCnt + 1
            If intUpdCnt >= UPDATE_FREQ Then
                System.Windows.Forms.Application.DoEvents()
                If bConvertCancel Then
                    bConvertCancel = False
                    ExtractISOFromEBOOT = CANCELLED_TEXT
                    GoTo exitFunction
                End If
                intUpdCnt = 0
            End If


'  TODO:    inflate Not WORKING

            'check if block is compressed
            If lngISOIndex_Length(lngCnt) = 16 * 2352 Then
                FileGet(intFF, bytBuff)   **this one is working for uncompressed ****
            Else 'decompress the data
                ReDim bytBuffC(lngISOIndex_Length(lngCnt) - 1)
                FileGet(intFF, bytBuffC)
                With ZS
                    .zalloc = 0
                    .zfree = 0
                    .opaque = 0
                    .avail_in = 0
                    .next_in = 0

                    inflateInit2(ZS, -15, "1.1.3", Len(ZS))  **** I think this is the problem ***
                    .avail_in = lngISOIndex_Length(lngCnt)
                    .next_in = VarPtr(bytBuffC(0))
                    .avail_out = 16 * 2352
                    .next_out = VarPtr(bytBuff(0))

                End With

                If inflate(VarPtr(ZS), 0) < 0 Then
                    ExtractISOFromEBOOT = "zlib inflate failed!"
                    GoTo exitFunction
                Else
                    inflate(VarPtr(ZS), 0)
                End If
                'Output size should be 16*2352
                inflateEnd(VarPtr(ZS))

            End If
            FilePut(intFF2, bytBuff)
        Next

        FileClose(intFF)
        FileClose(intFF2)

(This post was last modified: 23/01/2008 04:14 AM by ZiNgA BuRgA.)
10/01/2008 09:44 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [PSP] [Source code] Simple Popstation GUI v3.00 beta - pka4916 - 10/01/2008 09:44 AM
Thread Revived!!! - Necro-Bot - 15/08/2009, 09:47 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)

 Quick Theme: