.text:0040BDB8 loc_40BDB8:                             ; CODE XREF: sub_40BC80+2Ej
.text:0040BDB8                 lea     ecx, [eax-100h]
.text:0040BDBE                 cmp     ecx, 16h        ; switch 23 cases
.text:0040BDC1                 ja      loc_40CC9D      ; default
.text:0040BDC1                                         ; jumptable 0040BCC2 cases 3-5
.text:0040BDC1                                         ; jumptable 0040BDCE cases 2-16,18-21
.text:0040BDC7                 movzx   edx, ds:byte_40CD04[ecx]
.text:0040BDCE                 jmp     ds:off_40CCF0[edx*4] ; switch jump
.text:0040BDD5

.text:0040BDD5 loc_40BDD5:                             ; DATA XREF: .text:off_40CCF0o
.text:0040BDD5                 movzx   eax, word ptr [esp+418h+wParam] ; jumptable 0040BDCE case 17
.text:0040BDDD                 add     eax, 0FFFF63BFh ; switch 52 cases
.text:0040BDE2                 cmp     eax, 33h
.text:0040BDE5                 ja      loc_40CC70      ; jumptable 0040BCC2 cases 6,8
.text:0040BDE5                                         ; jumptable 0040BDEB cases 40028-40032,40042

; NOTE: Place breakpoint here to find 'Run ISO' values

.text:0040BDEB                 jmp     ds:off_40CD1C[eax*4] ; switch jump






.text:0040BF2E loc_40BF2E:                             ; CODE XREF: sub_40BC80+16Bj
.text:0040BF2E                                         ; DATA XREF: .text:off_40CD1Co
.text:0040BF2E                 mov     edi, offset aNull ; jumptable 0040BDEB case 40003
.text:0040BF33                 mov     esi, offset Dest
.text:0040BF38                 mov     ecx, 5
.text:0040BF3D                 xor     eax, eax
.text:0040BF3F                 repe cmpsb
.text:0040BF41                 jz      loc_40BE07
.text:0040BF47                 mov     edi, offset aNull ; "NULL"
.text:0040BF4C                 mov     esi, offset byte_C0EB40
.text:0040BF51                 mov     ecx, 5
.text:0040BF56                 xor     edx, edx
.text:0040BF58                 repe cmpsb
.text:0040BF5A                 jz      loc_40BE37
.text:0040BF60                 call    sub_418ED0
.text:0040BF65                 test    eax, eax
.text:0040BF67                 jnz     loc_40BE5B

; call OpenFileDialog
; .data:00C0A6C0 ; const CHAR FileName

.text:0040BF6D                 push    offset off_4502AC
.text:0040BF72                 push    offset saved_fp
.text:0040BF77                 push    offset FileName
.text:0040BF7C                 push    offset aPsxIsos_bin_is ; "PSX ISOs (*.BIN, *.ISO, *.IMG, *.CUE, *"...
.text:0040BF81                 push    offset aOpenPsxIso ; "Open PSX ISO"
.text:0040BF86                 call    sub_405EB0
.text:0040BF8B                 add     esp, 14h
.text:0040BF8E                 test    eax, eax
.text:0040BF90                 jz      loc_40CC70      ; jumptable 0040BCC2 cases 6,8
.text:0040BF90                                         ; jumptable 0040BDEB cases 40028-40032,40042

.text:0040BF96                 lea     eax, [esp+418h+FilePart]
.text:0040BF9A                 push    eax             ; lpFilePart
.text:0040BF9B                 lea     ecx, [esp+41Ch+Buffer]
.text:0040BF9F                 push    ecx             ; lpBuffer
.text:0040BFA0                 push    400h            ; nBufferLength
.text:0040BFA5                 push    offset FileName ; lpFileName
.text:0040BFAA                 call    ds:GetFullPathNameA
.text:0040BFB0                 mov     edx, [esp+418h+FilePart]
.text:0040BFB4                 push    offset FileName
.text:0040BFB9                 push    offset Format   ; "%s"
.text:0040BFBE                 push    offset saved_fp ; Dest
.text:0040BFC3                 mov     byte ptr [edx], 0
.text:0040BFC6                 call    _sprintf
.text:0040BFCB                 add     esp, 0Ch
.text:0040BFCE                 call    sub_402B20


====>
====>
====>
; last used ISO

.text:00402B20 sub_402B20      proc near               ; CODE XREF: sub_40BC80+34Ep
.text:00402B20                                         ; sub_40BC80+4E8p
.text:00402B20                 push    offset saved_fp ; lpData
.text:00402B25                 push    offset aIsodirectory ; "IsoDirectory"
.text:00402B2A                 push    offset SubKey   ; "Software\\epsxe\\config"
.text:00402B2F                 call    sub_401090
.text:00402B34                 add     esp, 0Ch
.text:00402B37                 retn
.text:00402B37 sub_402B20      endp
====>
====>
====>



.text:0040BFD3                 push    0               ; nExitCode
.text:0040BFD5                 call    ds:PostQuitMessage
.text:0040BFDB                 cmp     byte_4BF711, 0
.text:0040BFE2                 jz      short loc_40BFEB
.text:0040BFE4                 mov     byte_456000, 0
.text:0040BFEB
.text:0040BFEB loc_40BFEB:                             ; CODE XREF: sub_40BC80+362j
.text:0040BFEB                 mov     eax, offset FileName
.text:0040BFF0                 lea     edx, [eax+1]

; get filename length

.text:0040BFF3
.text:0040BFF3 loc_40BFF3:                             ; CODE XREF: sub_40BC80+37Aj
.text:0040BFF3                 mov     cl, [eax]
.text:0040BFF5                 add     eax, 1
.text:0040BFF8                 test    cl, cl
.text:0040BFFA                 jnz     short loc_40BFF3

; length okay?

.text:0040BFFC                 sub     eax, edx
.text:0040BFFE                 cmp     eax, 400h
.text:0040C003                 jnb     loc_40CC70      ; jumptable 0040BCC2 cases 6,8
.text:0040C003                                         ; jumptable 0040BDEB cases 40028-40032,40042
.text:0040C009                 xor     eax, eax
.text:0040C00B                 jmp     short loc_40C010
.text:0040C00B ; ---------------------------------------------------------------------------
.text:0040C00D                 align 10h
.text:0040C010
.text:0040C010 loc_40C010:                             ; CODE XREF: sub_40BC80+38Bj
.text:0040C010                                         ; sub_40BC80+3A0j
.text:0040C010                 mov     cl, FileName[eax]
.text:0040C016                 mov     byte_507C80[eax], cl
.text:0040C01C                 add     eax, ebx
.text:0040C01E                 test    cl, cl
.text:0040C020                 jnz     short loc_40C010
.text:0040C022                 push    offset aNull    ; "NULL"
.text:0040C027                 call    sub_418DE0
.text:0040C02C                 add     esp, 4
.text:0040C02F                 mov     dword_510B5C, 3
.text:0040C039                 mov     byte_459379, 0
.text:0040C040                 mov     eax, ebx
.text:0040C042                 jmp     loc_40CCB5
