// Title     : Dr.Hell's Action Replay GPU Wrapper
// Version   : 1.05
// Copyright : (C)Dr.Hell, 2002-2003
// Web       : http://members.tripod.co.jp/DrHell/

My pen name is 'Dr.Hell' in English or 'Ɠcn' in Japanese.
I live in Nippon(true name of Japan) and I cannot write English well.
Please guess.

{͉̕ɂ܂B


Introduction
------------
This is a cheat tool for PSX emulator with PSEmu Pro type GPU plugin.


How to use (ex. ePSXe)
----------------------
(1) Move "gpuHellAR.dll" into plugins folder of ePSXe.

(2) Start ePSXe.

(3) Click [main menu->config->video].

(3) Select "Dr.Hell's Action Replay GPU Wrapper" as Video Plugin.

(4) Click "Configure" button.

(5) Select a true video plugin and configure.

(6) Input cheat codes.

    1) copy and paste
    2) drag and drop a text file

(7) Select a code engine at 'PAR compatibe' CheckBox.

  Checked:   supports "Action Replay(GameShark)" codes.
  UnChecked: supports part of 'Caetla' codes.

    "Action Replay" is a product of DATEL in UK.
    Its look is modified and it is called another name in another country,
    for example, "GameShark" in US.

(8) Choose a trigger at 'UpdateLace as Trigger' CheckBox.

  Checked  : when GPUupdateLace is called.
  UnChecked: when GPUdmaChain is called.

(9) Set Skip Count.

(A) (Not Necessary)Input base address and check 'Force Set BaseAddress'.
  If not checked, base address is automatically determined.

(B) When you want to activate codes at the time of a game start,
check 'Activate Codes'.

(C) Click "OK" button.

(D) Click "OK" button.

(E) Restart ePSXe and start a game.

(F) When ESC button is pushed(GPUclose is called),
 codes are activated/inactivated alternatively.
(A state of codes(active/inactive) is written to registry)

(G) When a game is continued(GPUopen is called),
codes and a state of codes(active/inactive) are reloaded from registry.


Cheat codes supported
---------------------

"Standard" engine supports part of "caetla" codes as follows.
+------------------------------------------------------------------------------+
|  3aaaaaaa 00dd     : Write simply ( 8 Bit)                                   |
|  8aaaaaaa dddd     : Write simply (16 Bit)                                   |
|  9aaaaaaa dddddddd : Write simply (32 Bit)                                   |
|  Blllaaaa dddddddd : Repeat(with 3, 8 and 9 code)                            |
|  Caaaaaaa 00dd     : Ignore one following code if not equal ( 8 Bit)         |
|  Daaaaaaa dddd     : Ignore one following code if not equal (16 Bit)         |
|  Eaaaaaaa ddddllll : Ignore several following codes if not equal (16 Bit)    |
+------------------------------------------------------------------------------+

"PAR compatible" engine supports following codes.
+------------------------------------------------------------------------------+
|  30aaaaaa 00dd : Write simply ( 8 Bit)                                       |
|  80aaaaaa dddd : Write simply (16 Bit)                                       |
|  10aaaaaa dddd : Increase (16 Bit)                                           |
|  11aaaaaa dddd : Decrease (16 Bit)                                           |
|  20aaaaaa 00dd : Increase ( 8 Bit)                                           |
|  21aaaaaa 00dd : Decrease ( 8 Bit)                                           |
|  5000llaa dddd : Repeat(with 30 and 80 code)                                 |
|  D0aaaaaa dddd : Ignore until next single-code if not equal   (16 Bit)       |
|  D1aaaaaa dddd : Ignore until next single-code if equal       (16 Bit)       |
|  D2aaaaaa dddd : Ignore until next single-code if not less    (16 Bit)       |
|  D3aaaaaa dddd : Ignore until next single-code if not greater (16 Bit)       |
|  E0aaaaaa 00dd : Ignore until next single-code if not equal   ( 8 Bit)       |
|  E1aaaaaa 00dd : Ignore until next single-code if equal       ( 8 Bit)       |
|  E2aaaaaa 00dd : Ignore until next single-code if not less    ( 8 Bit)       |
|  E3aaaaaa 00dd : Ignore until next single-code if not greater ( 8 Bit)       |
|  C0aaaaaa dddd : Ignore all following codes if not equal(Master Code)        |
|  C2aaaaaa 0lll : Copy bytes                                                  |
+------------------------------------------------------------------------------+
Single-code means 30,80,10,11,20,21 codes.

 aa... address [to add (the following)] 
 dd... data [to add (the following)]
 ll... loop number or lines to jump 


Registry used
-------------
"Software\Vision Thing\PSEmu Pro\GPU\HellAR"

BaseAddress    4 // Base address(0=Automatic)
Codes       1024 // Translated codes(must be null-terminated and max 127 codes).
Engine         4 // Type of code engine(1=PAR compatible, Other=Standard)
FileName       4 // GPU library file name
Skip           4 // Skip count
Switch         4 // State of codes(active/inactive)
Trigger        4 // Trigger for patch(1=UpdateLace, Other=DmaChain)

Update
------

1.05(03/04/11)

- Check existance of function 'GPUinit' during search for GPU library to wrap.

1.04d(02/10/26)
'Auto search plugins directory' function came back.
  This function use 'FindFirstFile' api,
  so you should restart an emulator after configuration even if you use AdriPSX.

to use with PCSX & Windows2000
  Click "Configuration>Plugins & Bios" and select this plugin as GPU and NOT configure.
  Click "Configuration>Graphics" for configuration.

1.04c(02/10/23)
(1)Compiler(&language) was changed from Delphi(Object Pascal)2 to Borland C++ compiler 5.5.
So it became to be smaller and more stable.
(2)'Auto search plugins directory' was disabled.
Because it causes 10H error during playing game for PCSX & AdriPSX.

1.03(02/07/16)
A function to change a state of codes(active/inactive)
 at the time of a game start was added.
Timing of reloading codes from registry was changed(GPUclose -> GPUopen).

1.02a(02/07/14)
SendCode.exe was updated.
(1)Interfaces for selecting codes were changed to CheckBox type.
(When ScrollBox is double-clicked, CheckBoxes are reversed.)
(2)"CODELIST.TXT(not need CODEINDX.TXT)" for cep/CVGSUtil was supported.
(CODLIST.TXT and SendCode.exe have to be in the same folder.)

1.02(2002/07/09)
a function to reload codes from registry was added for changing codes during execution.
SendCode.exe which was a support application to send codes to registry was added.

1.01(2002/06/30)
A function to activate/deactivate codes was added.

1.0(2002/06/30)
1st release.


Reference
---------
P.E.Op.S. Soft GPU 1.5


Written in Japanese..


͂߂
--------
PSEmuProvOC^Cv̉c[łB
̂Ɋ̓vOC^CṽvCXe[VG~[^Ɍ肳܂B
GPŨbp[^CvȂ̂ŕʓr{GPUKvłB
P̂ŊĂ镪A^̓nhOǂ̂ł͂Ȃł傤B

܂AT[`ɃVrAȃXs[h͗vȂ̂ŁA
T[`@\͕t܂(cepg܂傤)B
قڊ`ƎvĉB


g(. ePSXe)
-----------------
(1) "gpuHellAR.dll"  ePSXe  "plugins" tH_ɈړB

(2) ePSXe NB

(3) main menu   config  video NbNB

(3) Video Plugin Ƃ "Dr.Hell's Action Replay GPU Wrapper" IB

(4) "Configure" NbNB

(5) {(bv)vOCIAݒsB

(6) R[h͂B

  ͕@
    1) Rs[y[Xg
    2) R[heLXgt@CɋLqāAhbv
    3) I[v_CAOꉞĝłAݒ肪铙̌ۂN邱Ƃ܂̂ŁAǵAG~[^̂ċNǂ悤łB

(7) R[hGWIB

  'PAR Compatible' Ƀ`FbN PAR ݊R[hsA`FbNȂ
  'Caetla'݊R[hsB

(8) gK[ɂăpb`s߂B

  'UpdateLace as Trigger'Ƀ`FbN
  G~[^ʍXV(GPUupdateLace)oꂽƂɃpb`sA
  łȂDMA(Chainn̂݁ADataMemn͂Ȃ)sɍsB

(9) pb`̕px̂߃XLbvݒ肷B

(A) x[XAhX͂B

  ʏ͓͂ȂČ\łB
  0ɂ邩A`FbNOƁAIɎ擾܂B

(B) Q[JñR[h̃I^Itݒ肷

(C) "OK" NbNB

(D) "OK" NbNB

(E) ePSXeċNAQ[JnB

(F) ESC{^(GPUcloseĂ΂)ɃR[hI^ItB
(I^Itݒ肪WXgɏ܂)

(G) Q[ĊJ(GPUopenĂ΂ꂽ)
WXgR[h̃I^ItݒƃR[hă[hB


gpWXg
--------------
"Software\Vision Thing\PSEmu Pro\GPU\HellAR"

BaseAddress    4 // x[XAhXwB0Ŏ擾B
Codes       1024 // R[hi[obt@̂
Engine         4 // R[hGW̎(WPAR)
FileName       4 // vOCt@C
Skip           4 // pb`̃XLbvB
Switch         4 // R[h̃I^ItݒB
Trigger        4 // pb`sgK[̎ށB

XV
--------

1.05(03/04/22)

o[W񂪊ԈĂ̂ŏC܂B
R[h͉ςĂ܂B
Ɠ{ł݂Ăƍ₷Ƃ̎wÊ
ʃtH_Ɉڂ܂B

1.05(03/04/15)

錴̈ꕔ̂ŏC
vOČ@Ƃ
(1)*.DLLFindFirst-Next
(2)LoadLibrary
(3)PSEgetLibType2̏ꍇGPU
(4)FreeLibrary
ƂĂA
ꕔ̃vOCł(3)̎sŃG[o悤B
̂߁AGPUinit݂̑ɒǉB

vOCfBNg̎擾@ύX
pȂAAhwndDLL(DllMain̑)
HMODULEƂĈ̂ł邱Ƃm܂łB
A܂ł͎st@C̃tH__
炩GPUvOCɑ܂
STutH_Ă܂B
GPU Wrapper g̃t@CpXꔭŕ킯A
͕̏svłˁB
Ȃ킯
gpWXg኱ύX
ȑÕo[WgpĂꍇ
svWXgc܂܂ɂȂ̂
CɂȂl͎蓮ō폜肢܂B

1.04d(02/10/26)
vOCfBNg̎̕B

AAȑOƈقȂ̂́ANł͂ȂARtBO[hN鎞_ŔƂƂłB
āAG~[^ύXxɈxRtBO[h𔭓ȂƂ܂B
''Ƀ`FbNăRtBOċN܂傤B

ĂWin2000PCSXƂǂĂG[oĂ܂݂łB
(PCSX̂FindFileƓGPUFindFileƂŁAX^bNԂ̂܂)B
"Configuration>Plugins & Bios"ɂđI
"Configuration>Graphics"ŐݒsAݒ̓G~[^̂ċNĉB


1.04c(02/10/23)
RpC()̕ύX..Delphi(Object Pascal)2Borland C++ Compiler 5.5ցB
vOCfBNg̎̔p~B

܂ł낭Ɍ؂ĂȂċCÂȂ̂ǁAGPU(Wrapper & GDI)ePSXeȊOƂ悭悤B
ePSXeł͓킯A֐̋K񂪊ԈĂ킯ł͂ȂBłcɈڐAĂ݂APCSXAdriPSXł̈x̂ŁARpCɂ̃̎gŃRtNgNĂ悤

GPU Wrapper ͂̂܂܈ڐAł́A͂10HŗĂ܂B悭悭ׂƁAvOC(FindFirstFile֌W)₷Ȃ錴̂悤BɋN̓vOCtH_̂邽ߎst@CʑwƂƂ񒲂ׂKvA[`ċAIɌĂ(Iɂ͎st@C"plugins""plugin"Ɍ킯ǁAケȊÕP[XƂȂ)߂ɁAWnɂȂ悤BfĂAvO̊Jɔ͂ȂB傤Ȃ̂ŁAݒ荀(WXg)LibDirVɐ݂ConfigʂŕύXɕύXB

Configʂł̓bvt@CIsAǂĂFindFirst[`g킴𓾂Ȃ̂ŁAAdriPSXPCSXłRtBM[VsċN邱Ƃ߂BlɃR_CAO(I[v_CAO)G[NՂ悤Ȃ̂ŁAċNǂ낤B

_CAOɃev[g𓱓BIȕύXʓ|ɂȂĂ܂̂ŃtHg̕ύXp~ATCY͏Ȃ̂ŗǂƂB

1.03(02/07/16)
Q[JñR[h̃I^ItݒǉB
WXg̃R[hă[h̃^C~OύXB
ɔSendCode.exeɂR[h̃I^ItݒǉB

1.02(2002/07/09)
ESC{^ɃWXgR[hă[h悤ύX
WXgւ̃R[hM[eBeBƂSendCode.exeYt

1.01(2002/06/30)
ESC{^ɃR[hIEIt悤ύX

1.0(2002/06/30)
t@[Xg[X
