Full Code of Erick194/PSXDOOM-RE for AI

master 923e5feb02dc cached
111 files
1.2 MB
434.3k tokens
819 symbols
1 requests
Download .txt
Showing preview only (1,274K chars total). Download the full file or copy to clipboard to get everything.
Repository: Erick194/PSXDOOM-RE
Branch: master
Commit: 923e5feb02dc
Files: 111
Total size: 1.2 MB

Directory structure:
gitextract_ch5iijr1/

├── CONTRIBUTORS.md
├── ERRORDETECTION.md
├── LICENSE
├── PSXDOOM/
│   ├── GAME/
│   │   ├── CD/
│   │   │   └── PSXDOOM/
│   │   │       ├── ABIN/
│   │   │       │   └── MOVIE.STR
│   │   │       ├── CDAUDIO/
│   │   │       │   └── tmp.txt
│   │   │       ├── MAPDIR0/
│   │   │       │   └── tmp.txt
│   │   │       ├── MAPDIR1/
│   │   │       │   └── tmp.txt
│   │   │       ├── MAPDIR2/
│   │   │       │   └── tmp.txt
│   │   │       ├── MAPDIR3/
│   │   │       │   └── tmp.txt
│   │   │       ├── MAPDIR4/
│   │   │       │   └── tmp.txt
│   │   │       ├── MAPDIR5/
│   │   │       │   └── tmp.txt
│   │   │       ├── MAPDIR6/
│   │   │       │   └── tmp.txt
│   │   │       ├── MAPDIR7/
│   │   │       │   └── tmp.txt
│   │   │       ├── MUSIC/
│   │   │       │   └── tmp.txt
│   │   │       ├── SNDMAPS1/
│   │   │       │   └── tmp.txt
│   │   │       ├── SNDMAPS2/
│   │   │       │   └── tmp.txt
│   │   │       └── SNDMAPS3/
│   │   │           └── tmp.txt
│   │   ├── MAKE_CD.bat
│   │   └── PSXDOOMCD.xml
│   ├── LCDLOAD.C
│   ├── LCDLOAD.H
│   ├── MAIN.LNK
│   ├── MAKEFILE.bat
│   ├── PSXCD.C
│   ├── PSXCD.H
│   ├── PSXCDABS.C
│   ├── PSXCDABS.H
│   ├── PSXCMD.C
│   ├── PSXDOOM.cbp
│   ├── PSXDOOM.layout
│   ├── PSXSPU.C
│   ├── PSXSPU.H
│   ├── PSX_FILE.C
│   ├── SEQLOAD.C
│   ├── SEQLOAD.H
│   ├── SEQLOADR.C
│   ├── WESSAPI.C
│   ├── WESSAPI.H
│   ├── WESSAPIM.C
│   ├── WESSAPIP.C
│   ├── WESSAPIT.C
│   ├── WESSARC.C
│   ├── WESSARC.H
│   ├── WESSBASE.C
│   ├── WESSSEQ.C
│   ├── WESSSEQ.H
│   ├── am_main.c
│   ├── asm/
│   │   └── tmp.txt
│   ├── c_main.c
│   ├── cf_main.c
│   ├── d_main.c
│   ├── doomdata.h
│   ├── doomdef.h
│   ├── f_main.c
│   ├── g_game.c
│   ├── in_main.c
│   ├── info.c
│   ├── info.h
│   ├── l_main.c
│   ├── m_fixed.c
│   ├── m_fixed.s
│   ├── m_main.c
│   ├── m_password.c
│   ├── o_main.c
│   ├── obj/
│   │   └── tmp.txt
│   ├── p_base.c
│   ├── p_ceilng.c
│   ├── p_change.c
│   ├── p_doors.c
│   ├── p_enemy.c
│   ├── p_floor.c
│   ├── p_inter.c
│   ├── p_lights.c
│   ├── p_local.h
│   ├── p_map.c
│   ├── p_maputl.c
│   ├── p_mobj.c
│   ├── p_move.c
│   ├── p_plats.c
│   ├── p_pspr.c
│   ├── p_setup.c
│   ├── p_shoot.c
│   ├── p_sight.c
│   ├── p_slide.c
│   ├── p_spec.c
│   ├── p_spec.h
│   ├── p_switch.c
│   ├── p_telept.c
│   ├── p_tick.c
│   ├── p_user.c
│   ├── psxmain.c
│   ├── pw_main.c
│   ├── r_data.c
│   ├── r_local.h
│   ├── r_main.c
│   ├── r_phase1.c
│   ├── r_phase2.c
│   ├── s_sound.c
│   ├── snmain.s
│   ├── sounds.h
│   ├── soundst.h
│   ├── sprinfo.c
│   ├── st_main.c
│   ├── st_main.h
│   ├── t_main.c
│   ├── tables.c
│   ├── vsprintf.c
│   ├── w_wad.c
│   └── z_zone.c
├── PSYQ/
│   └── README.txt
└── README.md

================================================
FILE CONTENTS
================================================

================================================
FILE: CONTRIBUTORS.md
================================================

= PSXDOOM RE contributors (sorted alphabetically)
=

* **[Darragh Coy (intacowetrust)](https://github.com/BodbDearg)**

    * Various information and code for PSX DOOM based on his own extensive reverse engineering efforts, including:
    
      * Suggestions for changing names in variables:
      
               cheatfullbright -> viewlighting
               solidseg -> solidsubsectors
               newend-> endsubsector
               numsegs-> numdrawsubsectors
               xtoviewangle -> yslope
               vissprites_tmp ->visspritehead
               lastsprite_p -> next
               
      * Identification of differences in the DrawImage and I_DrawSprite code:
         https://github.com/BodbDearg/PsyDoom/commit/9360bd322bc939a29903f21b19f216931b67f196#r37085143
         
      * Bug identification, on line 259 in p_tick.c:
         https://github.com/BodbDearg/PsyDoom/commit/50862aab3a3511dbc33269ee1249429314a71c18#commitcomment-37125911
         
      * Identification of non-existent lines in the original code:
         https://github.com/BodbDearg/PsyDoom/commit/8b7afc9d06f76c9f7fd00fc2e840107dd79a01de#r37163087
         https://github.com/BodbDearg/PsyDoom/commit/775e02de38cd3bf50e3dfa7173529c6ff783d641#r37185771
         
      * Update Identification from Psx Doom Greatest Hits:
         https://github.com/BodbDearg/PsyDoom/commit/775e02de38cd3bf50e3dfa7173529c6ff783d641#r37185747
         
      * Fire sky width repair in title:
         https://github.com/BodbDearg/PsyDoom/commit/9bd75ff52b517bec0737d946b12db5254a1d0e95
         
      * Identification of error in the CD_TRACK array:
         https://github.com/BodbDearg/PsyDoom/commit/7f75f07502bcac6557c7d026f0188f07704899a6#r37223485
         
      * Identification of non-existent lines, in the first version of Psx Doom, but which were subsequently added in the Greatest Hits version:
         https://github.com/BodbDearg/PsyDoom/commit/0457990ceebdf6e0e5cd9279e63a25b97f96a28c#r37246141
         
      * Line identification that is present in the 'Greatest Hits' version
         https://github.com/BodbDearg/PsyDoom/commit/f258d1713611a4e3ea3766f4e02266f3a0772638#r37268303
         
      * Identification of a small correction on line 265 in am_main.cpp
         https://github.com/BodbDearg/PsyDoom/commit/40816754f7978d4c2b3c34bf0cdb31c8e50abd0b#r37315450
         
      * Error identification in state blocks (else / if), in the files (f_main.c and st_main.c)
         https://github.com/BodbDearg/PsyDoom/commit/f4d6fb8b428ff0262cde02f7c77fdd71dc45d0bc#r37348133
         https://github.com/BodbDearg/PsyDoom/commit/201f293f0473e288c77b2f6e3c1a4c8b622c2968#commitcomment-37368964
         
      * Non-existent lines are blocked in Psx Doom
         https://github.com/BodbDearg/PsyDoom/commit/d60da8761208e3cb137e5b5fb85c6dd3a9ff514c#r37805111
         
      * Wess_malloc : fix function signature
         https://github.com/BodbDearg/PsyDoom/commit/a89ae26943fe08dc213d77bcabc50090c74316f0

      * Return fix in wess_seq_loader_init function
         https://github.com/BodbDearg/PsyDoom/commit/81f2bdc65724d2d7bce01e89900845803edeb957#r38278381

      * Error identification on the line (168) in wess_seq_load_sub function
         https://github.com/BodbDearg/PsyDoom/commit/89b38b23f6e0067d7ac123960c0cdc6064a8ef51#r38286066

      * Changes in data types in variable ptk_stat->psp
         https://github.com/BodbDearg/PsyDoom/commit/3eea78ba5a31da31f1007061f95bd6e32d275754#commitcomment-38312476
         https://github.com/BodbDearg/PsyDoom/commit/b952d4be8126ae1fa16f3dfdb87b190c5db6aabb

      * Changes in (Write_Vlq and Len_Vlq) functions
         https://github.com/BodbDearg/PsyDoom/commit/f5e0d69afeb1dee45b699002ee26fe513ae2271d
         
      * Non-existent return statement identification
         https://github.com/BodbDearg/PsyDoom/commit/1a01906c71ea7aadd5a1393cb0cf3365ed68138e#r38841312
         
      * Identification Missing sum in damagecount
         https://github.com/BodbDearg/PsyDoom/commit/69dd2e3ad910eb1dcf5bd159651aafea7e21e3fa
         
      * Automap: fix a PSX DOOM bug where lines flagged with ML_DONTDRAW
         https://github.com/BodbDearg/PsyDoom/commit/5a9b4059ac7a18b724edc380c26fa3fc6e548f5a
         
      * Range checks, added from Psy Doom to avoid alterations in P_RadiusAttack
         https://github.com/BodbDearg/PsyDoom/commit/107f7d3d91824e06f3b9e5106e3498e98a590ebe
      
      * P_FindNextHighestFloor: rewritten to avoid possible undefined behavior, from PsyDoom
         https://github.com/BodbDearg/PsyDoom/commit/91a3cc54e050d1ebba3572fb935a2625717ee21f

      * P_CheckKeyLock and P_SpawnSpecials: added skull key detection code from Greatest Hits version, also fatal BUFFER OVERFLOW is corrected in the D_memset assignment in activeceilings and activeplats
         https://github.com/BodbDearg/PsyDoom/commit/227fbaddf5237088d236865169cb2cae995043a5
         https://github.com/BodbDearg/PsyDoom/commit/f9e7295f63a2757f68bca66eb83661de71b184e5

      * P_SpawnStrobeFlashFast: Fixed `minlight` and` maxlight` assignments, as they were reversed.
         https://github.com/BodbDearg/PsyDoom/commit/8dec4ccbbd73d278b7b1d0d8e1090b0e39ad539d

      * T_CountdownTimer: Correction of regressive count, the code towards which an extra tick will be delayed to carry out the action
         https://github.com/BodbDearg/PsyDoom/commit/890d7dd90474b837d552b45cd38d737f11f7477f

      * P_UseLines: Another blockmap check ranges is added
         https://github.com/BodbDearg/PsyDoom/commit/ea5f99886ae054ac89c88dc961402b681a5b1562

      * A_CheckReload: Eliminate the return status and change a "void" like in Doom PC, since it's return is unnecessary.
         https://github.com/BodbDearg/PsyDoom/commit/7c6d6d851cd6f7f9ac6c3ddd04ce37c8ca53632b

      * A_Punch and A_Saw: (angle_t) identification is added before (P_Random () - P_Random ()), in order to avoid demo desynchronization
         https://github.com/BodbDearg/PsyDoom/commit/7b3d77fdb689f98808faf7a0d3a77f80556dd079
         https://github.com/BodbDearg/PsyDoom/commit/dc56fa6d91ee6d8f54aa11e9053fafd85ddad7f3

      * Suggestion to create a code to increase the map limit to 255
         https://github.com/BodbDearg/PsyDoom/commit/78436a90bfb8e2318141c13bce2e9c8f313af814

      * Floor rendering fix, from PsyDoom
         https://github.com/BodbDearg/PsyDoom/commit/2a0250ca6b43d920706849d0d9018cc4656cb1f1

* **[Fabien Sanglard](https://github.com/fabiensanglard)**

   * Article **[The Polygons of Doom: PSX](http://fabiensanglard.net/doom_psx/index.html)**
   * Fix cryptic magic number "mode" for Plane rendition
   
* **[James Haley (Quasar)](https://github.com/haleyjd)**
    * Wrong name identification in the PA_PointOnDivlineSide function, which must be called PA_DivlineSide

* **[Samuel Villarreal (svkaiser)](https://github.com/svkaiser)**

    * Console DOOM reverse engineering, specs & tools:
    https://www.doomworld.com/forum/topic/38608-the-console-doom-hacking-project-console-specs
    * Doom64-EX source code (DOOM 64 was based on PSX DOOM, thus can serve as a reference point for it):
    https://github.com/svkaiser/Doom64EX


================================================
FILE: ERRORDETECTION.md
================================================
PSXDOOM RE Error detection before source code release (sorted alphabetically)
============================================

* **[Gerardo Vsquez Garca (Gerardo194)]**

    * The player does not keep weapons and ammunition if he advances in level.
    * The lines of action were not activated when a special enemy died, for example the barons of hell on map 8.
    * In the game menu when you pause and press select.
    * The barrels and the rocket did not generate the radio damage, to the enemies only to the player.
    * Error in the position of the fps code, this generated problems when generating the graphics in the ot.
    * The repeatable action buttons, the game was frozen as it did not reproduce the sound of the button when it returns to the initial graph.
    * I didn't play the music of Club Doom.
    * Spider Demon attack sound error.
    * Texture identification error in sidedefs.
    * Error loading MAP60.LCD before executing Cast Monsters.

* **[Samuel Villarreal (svkaiser)]**

    * Errors in the view bobbing.
    * Scrolling wall textures did not work.

================================================
FILE: LICENSE
================================================
                    GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007

 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The GNU General Public License is a free, copyleft license for
software and other kinds of works.

  The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.  We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors.  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.

  To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights.  Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received.  You must make sure that they, too, receive
or can get the source code.  And you must show them these terms so they
know their rights.

  Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.

  For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software.  For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.

  Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so.  This is fundamentally incompatible with the aim of
protecting users' freedom to change the software.  The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable.  Therefore, we
have designed this version of the GPL to prohibit the practice for those
products.  If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.

  Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary.  To prevent this, the GPL assures that
patents cannot be used to render the program non-free.

  The precise terms and conditions for copying, distribution and
modification follow.

                       TERMS AND CONDITIONS

  0. Definitions.

  "This License" refers to version 3 of the GNU General Public License.

  "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.

  "The Program" refers to any copyrightable work licensed under this
License.  Each licensee is addressed as "you".  "Licensees" and
"recipients" may be individuals or organizations.

  To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy.  The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.

  A "covered work" means either the unmodified Program or a work based
on the Program.

  To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy.  Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.

  To "convey" a work means any kind of propagation that enables other
parties to make or receive copies.  Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.

  An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License.  If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.

  1. Source Code.

  The "source code" for a work means the preferred form of the work
for making modifications to it.  "Object code" means any non-source
form of a work.

  A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.

  The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form.  A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.

  The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities.  However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work.  For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.

  The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.

  The Corresponding Source for a work in source code form is that
same work.

  2. Basic Permissions.

  All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met.  This License explicitly affirms your unlimited
permission to run the unmodified Program.  The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work.  This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.

  You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force.  You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright.  Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.

  Conveying under any other circumstances is permitted solely under
the conditions stated below.  Sublicensing is not allowed; section 10
makes it unnecessary.

  3. Protecting Users' Legal Rights From Anti-Circumvention Law.

  No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.

  When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.

  4. Conveying Verbatim Copies.

  You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.

  You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.

  5. Conveying Modified Source Versions.

  You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:

    a) The work must carry prominent notices stating that you modified
    it, and giving a relevant date.

    b) The work must carry prominent notices stating that it is
    released under this License and any conditions added under section
    7.  This requirement modifies the requirement in section 4 to
    "keep intact all notices".

    c) You must license the entire work, as a whole, under this
    License to anyone who comes into possession of a copy.  This
    License will therefore apply, along with any applicable section 7
    additional terms, to the whole of the work, and all its parts,
    regardless of how they are packaged.  This License gives no
    permission to license the work in any other way, but it does not
    invalidate such permission if you have separately received it.

    d) If the work has interactive user interfaces, each must display
    Appropriate Legal Notices; however, if the Program has interactive
    interfaces that do not display Appropriate Legal Notices, your
    work need not make them do so.

  A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit.  Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.

  6. Conveying Non-Source Forms.

  You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:

    a) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by the
    Corresponding Source fixed on a durable physical medium
    customarily used for software interchange.

    b) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by a
    written offer, valid for at least three years and valid for as
    long as you offer spare parts or customer support for that product
    model, to give anyone who possesses the object code either (1) a
    copy of the Corresponding Source for all the software in the
    product that is covered by this License, on a durable physical
    medium customarily used for software interchange, for a price no
    more than your reasonable cost of physically performing this
    conveying of source, or (2) access to copy the
    Corresponding Source from a network server at no charge.

    c) Convey individual copies of the object code with a copy of the
    written offer to provide the Corresponding Source.  This
    alternative is allowed only occasionally and noncommercially, and
    only if you received the object code with such an offer, in accord
    with subsection 6b.

    d) Convey the object code by offering access from a designated
    place (gratis or for a charge), and offer equivalent access to the
    Corresponding Source in the same way through the same place at no
    further charge.  You need not require recipients to copy the
    Corresponding Source along with the object code.  If the place to
    copy the object code is a network server, the Corresponding Source
    may be on a different server (operated by you or a third party)
    that supports equivalent copying facilities, provided you maintain
    clear directions next to the object code saying where to find the
    Corresponding Source.  Regardless of what server hosts the
    Corresponding Source, you remain obligated to ensure that it is
    available for as long as needed to satisfy these requirements.

    e) Convey the object code using peer-to-peer transmission, provided
    you inform other peers where the object code and Corresponding
    Source of the work are being offered to the general public at no
    charge under subsection 6d.

  A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.

  A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling.  In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage.  For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product.  A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.

  "Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source.  The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.

  If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information.  But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).

  The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed.  Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.

  Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.

  7. Additional Terms.

  "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law.  If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.

  When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it.  (Additional permissions may be written to require their own
removal in certain cases when you modify the work.)  You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.

  Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:

    a) Disclaiming warranty or limiting liability differently from the
    terms of sections 15 and 16 of this License; or

    b) Requiring preservation of specified reasonable legal notices or
    author attributions in that material or in the Appropriate Legal
    Notices displayed by works containing it; or

    c) Prohibiting misrepresentation of the origin of that material, or
    requiring that modified versions of such material be marked in
    reasonable ways as different from the original version; or

    d) Limiting the use for publicity purposes of names of licensors or
    authors of the material; or

    e) Declining to grant rights under trademark law for use of some
    trade names, trademarks, or service marks; or

    f) Requiring indemnification of licensors and authors of that
    material by anyone who conveys the material (or modified versions of
    it) with contractual assumptions of liability to the recipient, for
    any liability that these contractual assumptions directly impose on
    those licensors and authors.

  All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10.  If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term.  If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.

  If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.

  Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.

  8. Termination.

  You may not propagate or modify a covered work except as expressly
provided under this License.  Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).

  However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.

  Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

  Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.

  9. Acceptance Not Required for Having Copies.

  You are not required to accept this License in order to receive or
run a copy of the Program.  Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance.  However,
nothing other than this License grants you permission to propagate or
modify any covered work.  These actions infringe copyright if you do
not accept this License.  Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.

  10. Automatic Licensing of Downstream Recipients.

  Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License.  You are not responsible
for enforcing compliance by third parties with this License.

  An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations.  If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.

  You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License.  For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.

  11. Patents.

  A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based.  The
work thus licensed is called the contributor's "contributor version".

  A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version.  For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.

  Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.

  In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement).  To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.

  If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients.  "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.

  If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.

  A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License.  You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.

  Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.

  12. No Surrender of Others' Freedom.

  If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all.  For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.

  13. Use with the GNU Affero General Public License.

  Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work.  The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.

  14. Revised Versions of this License.

  The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

  Each version is given a distinguishing version number.  If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation.  If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.

  If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.

  Later license versions may give you additional or different
permissions.  However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.

  15. Disclaimer of Warranty.

  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  16. Limitation of Liability.

  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.

  17. Interpretation of Sections 15 and 16.

  If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

                     END OF TERMS AND CONDITIONS

            How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

  If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

    <program>  Copyright (C) <year>  <name of author>
    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".

  You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.

  The GNU General Public License does not permit incorporating your program
into proprietary programs.  If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library.  If this is what you want to do, use the GNU Lesser General
Public License instead of this License.  But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.


================================================
FILE: PSXDOOM/GAME/CD/PSXDOOM/CDAUDIO/tmp.txt
================================================
temp file

================================================
FILE: PSXDOOM/GAME/CD/PSXDOOM/MAPDIR0/tmp.txt
================================================
temp file

================================================
FILE: PSXDOOM/GAME/CD/PSXDOOM/MAPDIR1/tmp.txt
================================================
temp file

================================================
FILE: PSXDOOM/GAME/CD/PSXDOOM/MAPDIR2/tmp.txt
================================================
temp file

================================================
FILE: PSXDOOM/GAME/CD/PSXDOOM/MAPDIR3/tmp.txt
================================================
temp file

================================================
FILE: PSXDOOM/GAME/CD/PSXDOOM/MAPDIR4/tmp.txt
================================================
temp file

================================================
FILE: PSXDOOM/GAME/CD/PSXDOOM/MAPDIR5/tmp.txt
================================================
temp file

================================================
FILE: PSXDOOM/GAME/CD/PSXDOOM/MAPDIR6/tmp.txt
================================================
temp file

================================================
FILE: PSXDOOM/GAME/CD/PSXDOOM/MAPDIR7/tmp.txt
================================================
temp file

================================================
FILE: PSXDOOM/GAME/CD/PSXDOOM/MUSIC/tmp.txt
================================================
temp file

================================================
FILE: PSXDOOM/GAME/CD/PSXDOOM/SNDMAPS1/tmp.txt
================================================
temp file

================================================
FILE: PSXDOOM/GAME/CD/PSXDOOM/SNDMAPS2/tmp.txt
================================================
temp file

================================================
FILE: PSXDOOM/GAME/CD/PSXDOOM/SNDMAPS3/tmp.txt
================================================
temp file

================================================
FILE: PSXDOOM/GAME/MAKE_CD.bat
================================================
mkpsxiso.exe -y -makeabs -lba2 doom.txt -lba doom_.txt PSXDOOMCD.xml

copy PSXCDABS.C ..\
copy PSXCDABS.H ..\
pause

================================================
FILE: PSXDOOM/GAME/PSXDOOMCD.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>

<!-- MKPSXISO example XML script -->

<iso_project image_name="PSXDOOM.bin" cue_sheet="PSXDOOM.cue">

	<!-- <track>
		Specifies a track to the ISO project. This example element creates a data
		track for storing data files and CD-XA/STR streams.
	
		Only one data track is allowed and data tracks must only be specified as the
		first track in the ISO image and cannot	be specified after an audio track.
		
		Attributes:
			type		- Track type (either data or audio).
			source		- For audio tracks only, specifies the file name of a wav audio
						  file to use for the audio track.	
	-->

	<track type = "data" >
	
		<identifiers
			system		= "PLAYSTATION"
			application	= "PLAYSTATION"
			volume		= "PSXDOOM"
			volumeset	= "PSXDOOM"
			publisher	= "WILLIAMS ENTERTAINMENT"
			datapreparer	= "WILLIAMS ENTERTAINMENT"
		/>
		

		<license file = "licensea.dat"/>
		

		<directory_tree>
		
			<file name = "SYSTEM.CNF"	type = "data"	source="CD\SYSTEM.CNF"/>
			<file name = "SLUS_000.77"	type = "data"	source="CD\SLUS_000.77"/>
			
			<dir name = "PSXDOOM">

				<dir name = "ABIN">
					<file name = "DEMO1.LMP"	type = "data"	source="CD\PSXDOOM\ABIN\DEMO1.LMP"/>
					<file name = "DEMO2.LMP"	type = "data"	source="CD\PSXDOOM\ABIN\DEMO2.LMP"/>
					<file name = "MAPSPR60.IMG"	type = "data"	source="CD\PSXDOOM\ABIN\MAPSPR60.IMG"/>
					<file name = "MOVIE.STR"	type = "str"	source="CD\PSXDOOM\ABIN\MOVIE.STR"/>
					<file name = "PSXDOOM.EXE"	type = "data"	source="MAIN.EXE"/>	<!--Discard original CD\PSXDOOM\ABIN\PSXDOOM.EXE-->
					<file name = "PSXDOOM.WAD"	type = "data"	source="CD\PSXDOOM\ABIN\PSXDOOM.WAD"/>
				</dir>

				<dir name = "MAPDIR0">
					<file name = "MAP01.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR0\MAP01.WAD"/>
					<file name = "MAP02.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR0\MAP02.WAD"/>
					<file name = "MAP03.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR0\MAP03.WAD"/>
					<file name = "MAP04.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR0\MAP04.WAD"/>
					<file name = "MAP05.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR0\MAP05.WAD"/>
					<file name = "MAP06.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR0\MAP06.WAD"/>
					<file name = "MAP07.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR0\MAP07.WAD"/>
					<file name = "MAP08.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR0\MAP08.WAD"/>
					<file name = "MAPSPR01.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR0\MAPSPR01.IMG"/>
					<file name = "MAPSPR02.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR0\MAPSPR02.IMG"/>
					<file name = "MAPSPR03.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR0\MAPSPR03.IMG"/>
					<file name = "MAPSPR04.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR0\MAPSPR04.IMG"/>
					<file name = "MAPSPR05.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR0\MAPSPR05.IMG"/>
					<file name = "MAPSPR06.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR0\MAPSPR06.IMG"/>
					<file name = "MAPSPR07.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR0\MAPSPR07.IMG"/>
					<file name = "MAPSPR08.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR0\MAPSPR08.IMG"/>
					<file name = "MAPTEX01.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR0\MAPTEX01.IMG"/>
					<file name = "MAPTEX02.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR0\MAPTEX02.IMG"/>
					<file name = "MAPTEX03.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR0\MAPTEX03.IMG"/>
					<file name = "MAPTEX04.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR0\MAPTEX04.IMG"/>
					<file name = "MAPTEX05.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR0\MAPTEX05.IMG"/>
					<file name = "MAPTEX06.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR0\MAPTEX06.IMG"/>
					<file name = "MAPTEX07.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR0\MAPTEX07.IMG"/>
					<file name = "MAPTEX08.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR0\MAPTEX08.IMG"/>
				</dir>

				<dir name = "MAPDIR1">
					<file name = "MAP09.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR1\MAP09.WAD"/>
					<file name = "MAP10.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR1\MAP10.WAD"/>
					<file name = "MAP11.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR1\MAP11.WAD"/>
					<file name = "MAP12.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR1\MAP12.WAD"/>
					<file name = "MAP13.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR1\MAP13.WAD"/>
					<file name = "MAP14.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR1\MAP14.WAD"/>
					<file name = "MAP15.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR1\MAP15.WAD"/>
					<file name = "MAP16.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR1\MAP16.WAD"/>
					<file name = "MAPSPR09.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR1\MAPSPR09.IMG"/>
					<file name = "MAPSPR10.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR1\MAPSPR10.IMG"/>
					<file name = "MAPSPR11.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR1\MAPSPR11.IMG"/>
					<file name = "MAPSPR12.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR1\MAPSPR12.IMG"/>
					<file name = "MAPSPR13.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR1\MAPSPR13.IMG"/>
					<file name = "MAPSPR14.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR1\MAPSPR14.IMG"/>
					<file name = "MAPSPR15.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR1\MAPSPR15.IMG"/>
					<file name = "MAPSPR16.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR1\MAPSPR16.IMG"/>
					<file name = "MAPTEX09.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR1\MAPTEX09.IMG"/>
					<file name = "MAPTEX10.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR1\MAPTEX10.IMG"/>
					<file name = "MAPTEX11.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR1\MAPTEX11.IMG"/>
					<file name = "MAPTEX12.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR1\MAPTEX12.IMG"/>
					<file name = "MAPTEX13.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR1\MAPTEX13.IMG"/>
					<file name = "MAPTEX14.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR1\MAPTEX14.IMG"/>
					<file name = "MAPTEX15.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR1\MAPTEX15.IMG"/>
					<file name = "MAPTEX16.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR1\MAPTEX16.IMG"/>
				</dir>

				<dir name = "MAPDIR2">
					<file name = "MAP17.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR2\MAP17.WAD"/>
					<file name = "MAP18.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR2\MAP18.WAD"/>
					<file name = "MAP19.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR2\MAP19.WAD"/>
					<file name = "MAP20.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR2\MAP20.WAD"/>
					<file name = "MAP21.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR2\MAP21.WAD"/>
					<file name = "MAP22.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR2\MAP22.WAD"/>
					<file name = "MAP23.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR2\MAP23.WAD"/>
					<file name = "MAP24.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR2\MAP24.WAD"/>
					<file name = "MAPSPR17.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR2\MAPSPR17.IMG"/>
					<file name = "MAPSPR18.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR2\MAPSPR18.IMG"/>
					<file name = "MAPSPR19.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR2\MAPSPR19.IMG"/>
					<file name = "MAPSPR20.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR2\MAPSPR20.IMG"/>
					<file name = "MAPSPR21.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR2\MAPSPR21.IMG"/>
					<file name = "MAPSPR22.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR2\MAPSPR22.IMG"/>
					<file name = "MAPSPR23.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR2\MAPSPR23.IMG"/>
					<file name = "MAPSPR24.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR2\MAPSPR24.IMG"/>
					<file name = "MAPTEX17.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR2\MAPTEX17.IMG"/>
					<file name = "MAPTEX18.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR2\MAPTEX18.IMG"/>
					<file name = "MAPTEX19.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR2\MAPTEX19.IMG"/>
					<file name = "MAPTEX20.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR2\MAPTEX20.IMG"/>
					<file name = "MAPTEX21.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR2\MAPTEX21.IMG"/>
					<file name = "MAPTEX22.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR2\MAPTEX22.IMG"/>
					<file name = "MAPTEX23.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR2\MAPTEX23.IMG"/>
					<file name = "MAPTEX24.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR2\MAPTEX24.IMG"/>
				</dir>

				<dir name = "MAPDIR3">
					<file name = "MAP25.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR3\MAP25.WAD"/>
					<file name = "MAP26.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR3\MAP26.WAD"/>
					<file name = "MAP27.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR3\MAP27.WAD"/>
					<file name = "MAP28.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR3\MAP28.WAD"/>
					<file name = "MAP29.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR3\MAP29.WAD"/>
					<file name = "MAP30.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR3\MAP30.WAD"/>
					<file name = "MAP31.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR3\MAP31.WAD"/>
					<file name = "MAP32.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR3\MAP32.WAD"/>
					<file name = "MAPSPR25.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR3\MAPSPR25.IMG"/>
					<file name = "MAPSPR26.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR3\MAPSPR26.IMG"/>
					<file name = "MAPSPR27.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR3\MAPSPR27.IMG"/>
					<file name = "MAPSPR28.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR3\MAPSPR28.IMG"/>
					<file name = "MAPSPR29.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR3\MAPSPR29.IMG"/>
					<file name = "MAPSPR30.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR3\MAPSPR30.IMG"/>
					<file name = "MAPSPR31.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR3\MAPSPR31.IMG"/>
					<file name = "MAPSPR32.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR3\MAPSPR32.IMG"/>
					<file name = "MAPTEX25.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR3\MAPTEX25.IMG"/>
					<file name = "MAPTEX26.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR3\MAPTEX26.IMG"/>
					<file name = "MAPTEX27.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR3\MAPTEX27.IMG"/>
					<file name = "MAPTEX28.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR3\MAPTEX28.IMG"/>
					<file name = "MAPTEX29.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR3\MAPTEX29.IMG"/>
					<file name = "MAPTEX30.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR3\MAPTEX30.IMG"/>
					<file name = "MAPTEX31.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR3\MAPTEX31.IMG"/>
					<file name = "MAPTEX32.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR3\MAPTEX32.IMG"/>
				</dir>

				<dir name = "MAPDIR4">
					<file name = "MAP33.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR4\MAP33.WAD"/>
					<file name = "MAP34.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR4\MAP34.WAD"/>
					<file name = "MAP35.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR4\MAP35.WAD"/>
					<file name = "MAP36.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR4\MAP36.WAD"/>
					<file name = "MAP37.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR4\MAP37.WAD"/>
					<file name = "MAP38.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR4\MAP38.WAD"/>
					<file name = "MAP39.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR4\MAP39.WAD"/>
					<file name = "MAP40.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR4\MAP40.WAD"/>
					<file name = "MAPSPR33.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR4\MAPSPR33.IMG"/>
					<file name = "MAPSPR34.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR4\MAPSPR34.IMG"/>
					<file name = "MAPSPR35.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR4\MAPSPR35.IMG"/>
					<file name = "MAPSPR36.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR4\MAPSPR36.IMG"/>
					<file name = "MAPSPR37.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR4\MAPSPR37.IMG"/>
					<file name = "MAPSPR38.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR4\MAPSPR38.IMG"/>
					<file name = "MAPSPR39.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR4\MAPSPR39.IMG"/>
					<file name = "MAPSPR40.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR4\MAPSPR40.IMG"/>
					<file name = "MAPTEX33.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR4\MAPTEX33.IMG"/>
					<file name = "MAPTEX34.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR4\MAPTEX34.IMG"/>
					<file name = "MAPTEX35.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR4\MAPTEX35.IMG"/>
					<file name = "MAPTEX36.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR4\MAPTEX36.IMG"/>
					<file name = "MAPTEX37.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR4\MAPTEX37.IMG"/>
					<file name = "MAPTEX38.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR4\MAPTEX38.IMG"/>
					<file name = "MAPTEX39.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR4\MAPTEX39.IMG"/>
					<file name = "MAPTEX40.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR4\MAPTEX40.IMG"/>
				</dir>

				<dir name = "MAPDIR5">
					<file name = "MAP41.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR5\MAP41.WAD"/>
					<file name = "MAP42.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR5\MAP42.WAD"/>
					<file name = "MAP43.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR5\MAP43.WAD"/>
					<file name = "MAP44.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR5\MAP44.WAD"/>
					<file name = "MAP45.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR5\MAP45.WAD"/>
					<file name = "MAP46.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR5\MAP46.WAD"/>
					<file name = "MAP47.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR5\MAP47.WAD"/>
					<file name = "MAP48.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR5\MAP48.WAD"/>
					<file name = "MAPSPR41.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR5\MAPSPR41.IMG"/>
					<file name = "MAPSPR42.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR5\MAPSPR42.IMG"/>
					<file name = "MAPSPR43.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR5\MAPSPR43.IMG"/>
					<file name = "MAPSPR44.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR5\MAPSPR44.IMG"/>
					<file name = "MAPSPR45.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR5\MAPSPR45.IMG"/>
					<file name = "MAPSPR46.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR5\MAPSPR46.IMG"/>
					<file name = "MAPSPR47.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR5\MAPSPR47.IMG"/>
					<file name = "MAPSPR48.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR5\MAPSPR48.IMG"/>
					<file name = "MAPTEX41.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR5\MAPTEX41.IMG"/>
					<file name = "MAPTEX42.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR5\MAPTEX42.IMG"/>
					<file name = "MAPTEX43.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR5\MAPTEX43.IMG"/>
					<file name = "MAPTEX44.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR5\MAPTEX44.IMG"/>
					<file name = "MAPTEX45.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR5\MAPTEX45.IMG"/>
					<file name = "MAPTEX46.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR5\MAPTEX46.IMG"/>
					<file name = "MAPTEX47.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR5\MAPTEX47.IMG"/>
					<file name = "MAPTEX48.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR5\MAPTEX48.IMG"/>
				</dir>

				<dir name = "MAPDIR6">
					<file name = "MAP49.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR6\MAP49.WAD"/>
					<file name = "MAP50.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR6\MAP50.WAD"/>
					<file name = "MAP51.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR6\MAP51.WAD"/>
					<file name = "MAP52.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR6\MAP52.WAD"/>
					<file name = "MAP53.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR6\MAP53.WAD"/>
					<file name = "MAP54.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR6\MAP54.WAD"/>
					<file name = "MAP55.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR6\MAP55.WAD"/>
					<file name = "MAP56.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR6\MAP56.WAD"/>
					<file name = "MAPSPR49.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR6\MAPSPR49.IMG"/>
					<file name = "MAPSPR50.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR6\MAPSPR50.IMG"/>
					<file name = "MAPSPR51.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR6\MAPSPR51.IMG"/>
					<file name = "MAPSPR52.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR6\MAPSPR52.IMG"/>
					<file name = "MAPSPR53.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR6\MAPSPR53.IMG"/>
					<file name = "MAPSPR54.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR6\MAPSPR54.IMG"/>
					<file name = "MAPSPR55.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR6\MAPSPR55.IMG"/>
					<file name = "MAPSPR56.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR6\MAPSPR56.IMG"/>
					<file name = "MAPTEX49.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR6\MAPTEX49.IMG"/>
					<file name = "MAPTEX50.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR6\MAPTEX50.IMG"/>
					<file name = "MAPTEX51.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR6\MAPTEX51.IMG"/>
					<file name = "MAPTEX52.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR6\MAPTEX52.IMG"/>
					<file name = "MAPTEX53.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR6\MAPTEX53.IMG"/>
					<file name = "MAPTEX54.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR6\MAPTEX54.IMG"/>
					<file name = "MAPTEX55.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR6\MAPTEX55.IMG"/>
					<file name = "MAPTEX56.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR6\MAPTEX56.IMG"/>
				</dir>

				<dir name = "MAPDIR7">
					<file name = "MAP57.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR7\MAP57.WAD"/>
					<file name = "MAP58.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR7\MAP58.WAD"/>
					<file name = "MAP59.WAD"	type = "data"	source="CD\PSXDOOM\MAPDIR7\MAP59.WAD"/>
					<file name = "MAP60.PAD"	type = "data"	source="CD\PSXDOOM\MAPDIR7\MAP60.PAD"/>
					<file name = "MAP61.PAD"	type = "data"	source="CD\PSXDOOM\MAPDIR7\MAP61.PAD"/>
					<file name = "MAP62.PAD"	type = "data"	source="CD\PSXDOOM\MAPDIR7\MAP62.PAD"/>
					<file name = "MAP63.PAD"	type = "data"	source="CD\PSXDOOM\MAPDIR7\MAP63.PAD"/>
					<file name = "MAP64.PAD"	type = "data"	source="CD\PSXDOOM\MAPDIR7\MAP64.PAD"/>
					<file name = "MAPSPR57.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR7\MAPSPR57.IMG"/>
					<file name = "MAPSPR58.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR7\MAPSPR58.IMG"/>
					<file name = "MAPSPR59.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR7\MAPSPR59.IMG"/>
					<file name = "MAPSPR60.PAD"	type = "data"	source="CD\PSXDOOM\MAPDIR7\MAPSPR60.PAD"/>
					<file name = "MAPSPR61.PAD"	type = "data"	source="CD\PSXDOOM\MAPDIR7\MAPSPR61.PAD"/>
					<file name = "MAPSPR62.PAD"	type = "data"	source="CD\PSXDOOM\MAPDIR7\MAPSPR62.PAD"/>
					<file name = "MAPSPR63.PAD"	type = "data"	source="CD\PSXDOOM\MAPDIR7\MAPSPR63.PAD"/>
					<file name = "MAPSPR64.PAD"	type = "data"	source="CD\PSXDOOM\MAPDIR7\MAPSPR64.PAD"/>
					<file name = "MAPTEX57.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR7\MAPTEX57.IMG"/>
					<file name = "MAPTEX58.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR7\MAPTEX58.IMG"/>
					<file name = "MAPTEX59.IMG"	type = "data"	source="CD\PSXDOOM\MAPDIR7\MAPTEX59.IMG"/>
					<file name = "MAPTEX60.PAD"	type = "data"	source="CD\PSXDOOM\MAPDIR7\MAPTEX60.PAD"/>
					<file name = "MAPTEX61.PAD"	type = "data"	source="CD\PSXDOOM\MAPDIR7\MAPTEX61.PAD"/>
					<file name = "MAPTEX62.PAD"	type = "data"	source="CD\PSXDOOM\MAPDIR7\MAPTEX62.PAD"/>
					<file name = "MAPTEX63.PAD"	type = "data"	source="CD\PSXDOOM\MAPDIR7\MAPTEX63.PAD"/>
					<file name = "MAPTEX64.PAD"	type = "data"	source="CD\PSXDOOM\MAPDIR7\MAPTEX64.PAD"/>
				</dir>

				<dir name = "MUSIC">
					<file name = "DOOMSFX.LCD"	type = "data"	source="CD\PSXDOOM\MUSIC\DOOMSFX.LCD"/>
					<file name = "DOOMSND.WMD"	type = "data"	source="CD\PSXDOOM\MUSIC\DOOMSND.WMD"/>
					<file name = "MUSLEV1.LCD"	type = "data"	source="CD\PSXDOOM\MUSIC\MUSLEV1.LCD"/>
					<file name = "MUSLEV10.LCD"	type = "data"	source="CD\PSXDOOM\MUSIC\MUSLEV10.LCD"/>
					<file name = "MUSLEV11.LCD"	type = "data"	source="CD\PSXDOOM\MUSIC\MUSLEV11.LCD"/>
					<file name = "MUSLEV12.LCD"	type = "data"	source="CD\PSXDOOM\MUSIC\MUSLEV12.LCD"/>
					<file name = "MUSLEV13.LCD"	type = "data"	source="CD\PSXDOOM\MUSIC\MUSLEV13.LCD"/>
					<file name = "MUSLEV14.LCD"	type = "data"	source="CD\PSXDOOM\MUSIC\MUSLEV14.LCD"/>
					<file name = "MUSLEV15.LCD"	type = "data"	source="CD\PSXDOOM\MUSIC\MUSLEV15.LCD"/>
					<file name = "MUSLEV16.LCD"	type = "data"	source="CD\PSXDOOM\MUSIC\MUSLEV16.LCD"/>
					<file name = "MUSLEV17.LCD"	type = "data"	source="CD\PSXDOOM\MUSIC\MUSLEV17.LCD"/>
					<file name = "MUSLEV18.LCD"	type = "data"	source="CD\PSXDOOM\MUSIC\MUSLEV18.LCD"/>
					<file name = "MUSLEV19.LCD"	type = "data"	source="CD\PSXDOOM\MUSIC\MUSLEV19.LCD"/>
					<file name = "MUSLEV2.LCD"	type = "data"	source="CD\PSXDOOM\MUSIC\MUSLEV2.LCD"/>
					<file name = "MUSLEV20.LCD"	type = "data"	source="CD\PSXDOOM\MUSIC\MUSLEV20.LCD"/>
					<file name = "MUSLEV3.LCD"	type = "data"	source="CD\PSXDOOM\MUSIC\MUSLEV3.LCD"/>
					<file name = "MUSLEV4.LCD"	type = "data"	source="CD\PSXDOOM\MUSIC\MUSLEV4.LCD"/>
					<file name = "MUSLEV5.LCD"	type = "data"	source="CD\PSXDOOM\MUSIC\MUSLEV5.LCD"/>
					<file name = "MUSLEV6.LCD"	type = "data"	source="CD\PSXDOOM\MUSIC\MUSLEV6.LCD"/>
					<file name = "MUSLEV7.LCD"	type = "data"	source="CD\PSXDOOM\MUSIC\MUSLEV7.LCD"/>
					<file name = "MUSLEV8.LCD"	type = "data"	source="CD\PSXDOOM\MUSIC\MUSLEV8.LCD"/>
					<file name = "MUSLEV9.LCD"	type = "data"	source="CD\PSXDOOM\MUSIC\MUSLEV9.LCD"/>
				</dir>

				<dir name = "SNDMAPS1">
					<file name = "MAP01.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS1\MAP01.LCD"/>
					<file name = "MAP02.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS1\MAP02.LCD"/>
					<file name = "MAP03.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS1\MAP03.LCD"/>
					<file name = "MAP04.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS1\MAP04.LCD"/>
					<file name = "MAP05.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS1\MAP05.LCD"/>
					<file name = "MAP06.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS1\MAP06.LCD"/>
					<file name = "MAP07.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS1\MAP07.LCD"/>
					<file name = "MAP08.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS1\MAP08.LCD"/>
					<file name = "MAP09.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS1\MAP09.LCD"/>
					<file name = "MAP10.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS1\MAP10.LCD"/>
					<file name = "MAP11.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS1\MAP11.LCD"/>
					<file name = "MAP12.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS1\MAP12.LCD"/>
					<file name = "MAP13.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS1\MAP13.LCD"/>
					<file name = "MAP14.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS1\MAP14.LCD"/>
					<file name = "MAP15.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS1\MAP15.LCD"/>
					<file name = "MAP16.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS1\MAP16.LCD"/>
					<file name = "MAP17.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS1\MAP17.LCD"/>
					<file name = "MAP18.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS1\MAP18.LCD"/>
					<file name = "MAP19.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS1\MAP19.LCD"/>
					<file name = "MAP20.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS1\MAP20.LCD"/>
				</dir>

				<dir name = "SNDMAPS2">
					<file name = "MAP21.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS2\MAP21.LCD"/>
					<file name = "MAP22.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS2\MAP22.LCD"/>
					<file name = "MAP23.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS2\MAP23.LCD"/>
					<file name = "MAP24.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS2\MAP24.LCD"/>
					<file name = "MAP25.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS2\MAP25.LCD"/>
					<file name = "MAP26.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS2\MAP26.LCD"/>
					<file name = "MAP27.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS2\MAP27.LCD"/>
					<file name = "MAP28.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS2\MAP28.LCD"/>
					<file name = "MAP29.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS2\MAP29.LCD"/>
					<file name = "MAP30.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS2\MAP30.LCD"/>
					<file name = "MAP31.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS2\MAP31.LCD"/>
					<file name = "MAP32.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS2\MAP32.LCD"/>
					<file name = "MAP33.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS2\MAP33.LCD"/>
					<file name = "MAP34.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS2\MAP34.LCD"/>
					<file name = "MAP35.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS2\MAP35.LCD"/>
					<file name = "MAP36.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS2\MAP36.LCD"/>
					<file name = "MAP37.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS2\MAP37.LCD"/>
					<file name = "MAP38.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS2\MAP38.LCD"/>
					<file name = "MAP39.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS2\MAP39.LCD"/>
					<file name = "MAP40.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS2\MAP40.LCD"/>
				</dir>

				<dir name = "SNDMAPS3">
					<file name = "MAP41.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS3\MAP41.LCD"/>
					<file name = "MAP42.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS3\MAP42.LCD"/>
					<file name = "MAP43.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS3\MAP43.LCD"/>
					<file name = "MAP44.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS3\MAP44.LCD"/>
					<file name = "MAP45.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS3\MAP45.LCD"/>
					<file name = "MAP46.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS3\MAP46.LCD"/>
					<file name = "MAP47.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS3\MAP47.LCD"/>
					<file name = "MAP48.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS3\MAP48.LCD"/>
					<file name = "MAP49.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS3\MAP49.LCD"/>
					<file name = "MAP50.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS3\MAP50.LCD"/>
					<file name = "MAP51.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS3\MAP51.LCD"/>
					<file name = "MAP52.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS3\MAP52.LCD"/>
					<file name = "MAP53.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS3\MAP53.LCD"/>
					<file name = "MAP54.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS3\MAP54.LCD"/>
					<file name = "MAP55.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS3\MAP55.LCD"/>
					<file name = "MAP56.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS3\MAP56.LCD"/>
					<file name = "MAP57.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS3\MAP57.LCD"/>
					<file name = "MAP58.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS3\MAP58.LCD"/>
					<file name = "MAP59.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS3\MAP59.LCD"/>
					<file name = "MAP60.LCD"	type = "data"	source="CD\PSXDOOM\SNDMAPS3\MAP60.LCD"/>
					<dummy sectors="2048"/>
				</dir>

				<dir name = "CDAUDIO">
					<file name = "DOOMMAIN.RAW"	type = "da"	 source = "CD\PSXDOOM\CDAUDIO\DOOMMAIN.RAW"/>
					<file name = "DMSELECT.RAW"	type = "da"	 source = "CD\PSXDOOM\CDAUDIO\DMSELECT.RAW"/>
					<file name = "CREDITS.RAW"	type = "da"	 source = "CD\PSXDOOM\CDAUDIO\CREDITS.RAW"/>
					<file name = "COMPLETE.RAW"	type = "da"	 source = "CD\PSXDOOM\CDAUDIO\COMPLETE.RAW"/>
					<file name = "DOOMRAVE.RAW"	type = "da"	 source = "CD\PSXDOOM\CDAUDIO\DOOMRAVE.RAW"/>
					<file name = "DOOM1FIN.RAW"	type = "da"	 source = "CD\PSXDOOM\CDAUDIO\DOOM1FIN.RAW"/>
					<file name = "FINALE1.RAW"	type = "da"	 source = "CD\PSXDOOM\CDAUDIO\FINALE1.RAW"/>
				</dir>

			</dir>

		
		</directory_tree>
		
	</track>
	
</iso_project>

================================================
FILE: PSXDOOM/LCDLOAD.C
================================================
// Reconstruido por Erick Vasquez Garcia 16/05/2019 [GEC]
// Update 20/10/2019 [GEC]

#include <libspu.h>
#include "psxcd.h"
#include "psxspu.h"
#include "wessapi.h"
#include "lcdload.h"
#include "doomdata.h"

extern int lcd_open;	//L800758F4
extern char *lcd_ppat_data_patches;//L800758F8
extern char *lcd_ppat_data_patchmaps;//L800758FC
extern char *lcd_ppat_data_patchinfo;//L80075900
extern char *lcd_ppat_data_track;//L80075904
extern patch_group_data *lcd_ppat_info;//L80075908;
extern unsigned long lcd_sample_pos;//L8007590C
extern unsigned int lcd_sectorbuf_pos;//L80075910
extern unsigned int lcd_totaltogo;//L80075914

extern short lcd_sectorbuf_code ; //L80075918
extern char *lcd_sectorbuf;//L8007591C

extern int lcd_cd_status; //L80075920

extern int  lcd_sync_intr;//L80075924
extern char lcd_sync_result[8];//0x80075928

extern Wess_Data_IO_Struct lcd_data_fileref;//0x8007f104

#define CHUNKSIZE 2048
extern char chunk[CHUNKSIZE];//80096394
extern char chunk2[CHUNKSIZE];//80096BA4

int wess_dig_lcd_loader_init(void *input_pm_stat)//80048C54
{
    pmasterstat *pm_stat;
    patch_group_data *pat_info;
	char *ppat_data;
	int k;

	pm_stat = input_pm_stat;

	lcd_open = 0;
	if (!pm_stat)
		return 0;

	for (k = 0; k < pm_stat->pmod_info->mod_hdr.patch_types_infile; k++)
	{
		pat_info = (pm_stat->ppat_info + k);

		if (pat_info->pat_grp_hdr.patch_id == SNDHW_TAG_DRIVER_ID)
			break;
	}

	lcd_ppat_info = pat_info;

	if (lcd_ppat_info != 0)
	{
		ppat_data = lcd_ppat_info->ppat_data;
		lcd_open = 1;

		lcd_ppat_data_patches = ppat_data;

		//printf("patches %d\n",lcd_ppat_info->pat_grp_hdr.patches);
		ppat_data += (lcd_ppat_info->pat_grp_hdr.patches * sizeof(patches_header));
		lcd_ppat_data_patchmaps = ppat_data;

		//printf("patchmaps %d\n",lcd_ppat_info->pat_grp_hdr.patchmaps);
		ppat_data += (lcd_ppat_info->pat_grp_hdr.patchmaps * sizeof(patchmaps_header));
		lcd_ppat_data_patchinfo = ppat_data;

		//printf("patchinfo %d\n",lcd_ppat_info->pat_grp_hdr.patchinfo);
		ppat_data += (lcd_ppat_info->pat_grp_hdr.patchinfo * sizeof(patchinfo_header));
		lcd_ppat_data_track = ppat_data;
		return 1;
	}

	return 0;
}

void wess_dig_set_sample_position(int samplenum, char *samplepos)//80048D3C
{
    patchinfo_header *patchinfo;

	if (lcd_ppat_data_patchinfo)
	{
		patchinfo = (patchinfo_header *) (lcd_ppat_data_patchinfo + (samplenum * sizeof(patchinfo_header)));
		patchinfo->sample_pos = (unsigned long)samplepos;
	}
}

Wess_Data_IO_Struct *wess_dig_lcd_data_open(char *filename)//80048D68
{
    Wess_File_IO_Struct *fp;

	fp = psxcd_open(filename);

	lcd_data_fileref = *fp;

	return(&lcd_data_fileref);
}

int wess_dig_lcd_data_read(unsigned char *buffer,void *destptr, SampleBlock *sampblk, int override)//80048DDC
{
    patchinfo_header *patchinfo;
	unsigned int samplenum, totaltogo, readbytes, totaltogo_tmp;
	unsigned long spuptr;

	spuptr = 0;
	readbytes = 0;
	totaltogo = CHUNKSIZE;

    while(totaltogo != 0)
    {
        //InitNextSampleBlock
        if (lcd_totaltogo == 0)
        {
            if (lcd_sectorbuf_pos > 0)
            {
                samplenum = (short) *(lcd_sectorbuf + (lcd_sectorbuf_pos << 1));
                patchinfo = (patchinfo_header *)(lcd_ppat_data_patchinfo + (samplenum * sizeof(patchinfo_header)));

                if (!(patchinfo->sample_pos) || (override != 0))
                {
                    patchinfo->sample_pos = lcd_sample_pos;
                    if (sampblk != 0)
                    {
                        sampblk->sampindx[sampblk->numsamps] = samplenum;
                        sampblk->samppos[sampblk->numsamps] = patchinfo->sample_pos >> 3;
                        sampblk->numsamps += 1;
                        //printf("save to sample [%d] [%d]\n", patchinfo->sample_pos, patchinfo->sample_pos >> 3);
                    }
                }
            }

            if (lcd_sectorbuf_code <= lcd_sectorbuf_pos)
            {
                return readbytes;
            }

            lcd_sectorbuf_pos++;
            samplenum = (short) *(lcd_sectorbuf + (lcd_sectorbuf_pos << 1));
            patchinfo = (patchinfo_header *)(lcd_ppat_data_patchinfo + (samplenum * sizeof(patchinfo_header)));

            lcd_totaltogo = patchinfo->sample_size;
            lcd_sample_pos = ((unsigned long)destptr + spuptr);

            if (((end_of_sram - (unsigned long)destptr) + spuptr) < patchinfo->sample_size)
            {
                lcd_totaltogo = 0;
                return readbytes;
            }
            if (totaltogo == 0) {
                return readbytes;
            }
        }

        totaltogo_tmp = totaltogo;

        //Read Data
        if (lcd_totaltogo < totaltogo)
        {
            samplenum = (short) *(lcd_sectorbuf + (lcd_sectorbuf_pos << 1));
            patchinfo = (patchinfo_header *)(lcd_ppat_data_patchinfo + (samplenum * sizeof(patchinfo_header)));

            if (!(patchinfo->sample_pos) || (override != 0))
            {
                SpuIsTransferCompleted(SPU_TRANSFER_WAIT);
                SpuSetTransferStartAddr(((unsigned long)destptr + spuptr));
                SpuWrite((buffer + spuptr), lcd_totaltogo);
                readbytes += lcd_totaltogo;
            }
            totaltogo = totaltogo_tmp - lcd_totaltogo;
            spuptr += lcd_totaltogo;
            lcd_totaltogo = 0;
        }
        else
        {
            samplenum = (short) *(lcd_sectorbuf + (lcd_sectorbuf_pos << 1));
            patchinfo = (patchinfo_header *)(lcd_ppat_data_patchinfo + (samplenum * sizeof(patchinfo_header)));

            if (!(patchinfo->sample_pos) || (override != 0))
            {
                SpuIsTransferCompleted(SPU_TRANSFER_WAIT);
                SpuSetTransferStartAddr(((unsigned long)destptr + spuptr));
                SpuWrite(buffer+spuptr, totaltogo_tmp);
                readbytes += totaltogo_tmp;
            }

            spuptr += totaltogo_tmp;
            lcd_totaltogo -= totaltogo_tmp;
            totaltogo = 0;
        }
    }

	return (readbytes);
}

int wess_dig_lcd_psxcd_sync(void)//8004911C
{
    unsigned long block;

	block = millicount;
	block += 8000;

	while (millicount < block)
	{
		lcd_sync_intr = CdSync(1, (u_char *)&lcd_sync_result);

		if (lcd_sync_intr == CdlDiskError)
		{
			CdFlush();
			return 1;
		}

		if (lcd_sync_intr == CdlComplete) return 0;
	}

	return 1;
}

int wess_dig_lcd_load(char *lcdfilename, void *memptr, SampleBlock *sampblk, int override)//800491C4
{
	Wess_File_IO_Struct *fileptr;
	char *destptr;
	int countbytes, bytestocopy, readbytes;
	boolean read1, read2;

	psxcd_disable_callbacks();

ReadAgain:
	do
	{
		do
		{
			do
			{
				lcd_sectorbuf_pos = 0;
				lcd_totaltogo = 0;
				readbytes = 0;

				psxcd_init_pos();
				psxcd_set_data_mode();

				fileptr = wess_dig_lcd_data_open(lcdfilename);

				if (*(int *)&fileptr->file.pos == 0)
					return 0;

				bytestocopy = fileptr->file.size;

				CdIntToPos(CdPosToInt(&fileptr->file.pos), &fileptr->new_io_loc);
				CdControl(CdlSetloc, (u_char *)&fileptr->new_io_loc, 0);
				CdControl(CdlReadN, (u_char *)&fileptr->new_io_loc, 0);
				do
				{
					lcd_cd_status = CdReady(1, 0);
					if (lcd_cd_status == CdlDataReady) goto DataReady1;
				} while (lcd_cd_status != CdlDiskError);
				CdFlush();
			DataReady1:
			} while (lcd_cd_status == CdlDiskError);

			CdGetSector((u_long *)&sectorbuf, CHUNKSIZE / 4);
			lcd_sectorbuf_code = (short)*sectorbuf; // read lcd count indx
			lcd_sectorbuf = (char *)&sectorbuf;
		} while (100 < lcd_sectorbuf_code);

		if (bytestocopy < CHUNKSIZE)
			bytestocopy = 0;
		else
			bytestocopy += -CHUNKSIZE;

		read1 = true;
		read2 = true;
		destptr = memptr;
		lcd_sectorbuf_code = (short)*sectorbuf; // read lcd count indx
		while (bytestocopy != 0)
		{
			if (read1)
			{
				do
				{
					lcd_cd_status = CdReady(1, 0);
					if (lcd_cd_status == CdlDataReady) goto DataReady2;
				} while (lcd_cd_status != CdlDiskError);
				CdFlush();
			DataReady2:
				if (lcd_cd_status == CdlDiskError) goto ReadAgain;

				CdGetSector((u_long *)&chunk, CHUNKSIZE / 4);

				if (bytestocopy < CHUNKSIZE)
					bytestocopy = 0;
				else
					bytestocopy += -CHUNKSIZE;

				countbytes = wess_dig_lcd_data_read(chunk, destptr, sampblk, override);
				readbytes += countbytes;
				destptr += countbytes;
				read2 = true;
				read1 = false;
			}
			else
			{
				if (read2)
				{
					do
					{
						lcd_cd_status = CdReady(1, 0);
						if (lcd_cd_status == CdlDataReady) goto DataReady3;
					} while (lcd_cd_status != CdlDiskError);
					CdFlush();
				DataReady3:
					if (lcd_cd_status == CdlDiskError) goto ReadAgain;

					CdGetSector((u_long *)&chunk2, CHUNKSIZE / 4);

					if (bytestocopy < CHUNKSIZE)
						bytestocopy = 0;
					else
						bytestocopy += -CHUNKSIZE;

					SpuIsTransferCompleted(SPU_TRANSFER_WAIT);
					countbytes = wess_dig_lcd_data_read(chunk2, destptr, sampblk, override);
					readbytes += countbytes;
					destptr += countbytes;
					read2 = false;
				}
				else
				{
					do
					{
						lcd_cd_status = CdReady(1, 0);
						if (lcd_cd_status == CdlDataReady) goto DataReady4;
					} while (lcd_cd_status != CdlDiskError);
					CdFlush();
				DataReady4:
					if (lcd_cd_status == CdlDiskError) goto ReadAgain;

					CdGetSector((u_long *)&chunk, CHUNKSIZE / 4);

					if (bytestocopy < CHUNKSIZE)
						bytestocopy = 0;
					else
						bytestocopy += -CHUNKSIZE;

					SpuIsTransferCompleted(SPU_TRANSFER_WAIT);
					countbytes = wess_dig_lcd_data_read(chunk, destptr, sampblk, override);
					readbytes += countbytes;
					destptr += countbytes;
					read2 = true;
				}
			}
		}

		if (lcd_cd_status != CdlDiskError)
		{
			CdControl(CdlPause, 0, 0);
			if (wess_dig_lcd_psxcd_sync() == 0)
			{
				SpuIsTransferCompleted(SPU_TRANSFER_WAIT);
				psxcd_enable_callbacks();
				return (readbytes);
			}
		}
	} while (true);
}


================================================
FILE: PSXDOOM/LCDLOAD.H
================================================
    /*------------------------------------------------------------------*/
    /*
                      Williams Entertainment Sound System
                             by Scott Patterson

                   Application Programming Interface Routines:

                   - digital (in linear .LCD file) load functions
    */
    /*------------------------------------------------------------------*/

#define SAMPLE_RECORD_SIZE 100

typedef struct SampleBlock {
    unsigned short numsamps;//r*
    unsigned short sampindx[SAMPLE_RECORD_SIZE];//r*2
    unsigned short samppos[SAMPLE_RECORD_SIZE];//r*4
}SampleBlock;

extern int wess_dig_lcd_loader_init(void *input_pm_stat);

extern void wess_dig_set_sample_position(int samplenum, char *samplepos);

extern int wess_dig_lcd_load(char *lcdfilename,void *memptr,SampleBlock *sampblk, int override);




================================================
FILE: PSXDOOM/MAIN.LNK
================================================

	org	$80010000

text	group				; main text group
bss	group	bss			; main data group

	section	.rdata,text	; main sections
	section	.text,text
	section	.data,text
	section	.sdata,text

	section	.sbss,bss	; The bss sections
	section	.bss,bss

	;
	; Object files
	;

	include	"obj\d_main.obj"
	include	"obj\info.obj"
	include	"obj\sprinfo.obj"
	include	"obj\g_game.obj"
	include	"obj\p_base.obj"
	include	"obj\p_ceilng.obj"
	include	"obj\p_change.obj"
	include	"obj\p_doors.obj"
	include	"obj\p_enemy.obj"
	include	"obj\p_floor.obj"
	include	"obj\p_inter.obj"
	include	"obj\p_lights.obj"
	include	"obj\p_map.obj"
	include	"obj\p_maputl.obj"
	include	"obj\p_mobj.obj"
	include	"obj\p_move.obj"
	include	"obj\p_plats.obj"
	include	"obj\p_pspr.obj"
	include	"obj\p_setup.obj"
	include	"obj\p_shoot.obj"
	include	"obj\p_sight.obj"
	include	"obj\p_slide.obj"
	include	"obj\p_spec.obj"
	include	"obj\p_switch.obj"
	include	"obj\p_telept.obj"
	include	"obj\p_tick.obj"
	include	"obj\p_user.obj"
	include	"obj\r_phase1.obj"
	include	"obj\r_phase2.obj"
	include	"obj\r_data.obj"
	include	"obj\r_main.obj"
	include	"obj\vsprintf.obj"
	include	"obj\w_wad.obj"
	include	"obj\psx_file.obj"
	include	"obj\z_zone.obj"
	include	"obj\psxmain.obj"
	;include	"obj\psxmain_mip.obj" ;//-----MIPS
	include	"obj\l_main.obj"
	include	"obj\t_main.obj"
	include	"obj\m_main.obj"
	include	"obj\c_main.obj"
	include	"obj\pw_main.obj"
	include	"obj\cf_main.obj"
	include	"obj\m_password.obj"
	include	"obj\st_main.obj"
	include	"obj\am_main.obj"
	include	"obj\in_main.obj"
	include	"obj\f_main.obj"
	include	"obj\o_main.obj"
	include	"obj\m_fixed.obj"
	include	"obj\tables.obj"
	include	"obj\psxcd.obj"
	include	"obj\s_sound.obj"
	include	"obj\psxspu.obj"
	include	"obj\psxcmd.obj"
	include	"obj\wessapip.obj"
	include	"obj\wessapi.obj"
	include	"obj\wessarc.obj"
	include	"obj\wessapit.obj"
	include	"obj\wessseq.obj"
	include	"obj\seqload.obj"
	include	"obj\lcdload.obj"
	include	"obj\wessapim.obj"
	include	"obj\seqloadr.obj"

	include	"obj\wessbase.obj"

	include "obj\snmain.obj"

	;
	; Library files
	;

	inclib "C:\psyq\lib\libsn.lib"
	inclib "C:\psyq\lib\libapi.lib"
	inclib "C:\psyq\lib\libetc.lib"
	inclib "C:\psyq\lib\libgpu.lib"
	inclib "C:\psyq\lib\libgte.lib"
	inclib "C:\psyq\lib\libspu.lib"
	inclib "C:\psyq\lib\libc.lib"
	inclib "C:\psyq\lib\libcd.lib"
	inclib "C:\psyq\lib\libc2.lib"
	inclib "C:\psyq\lib\libcomb.lib"

	; The following line initializes the program counter register so
	; that the downloader sets the entry point before the program
	; is executed.  SN_ENTRY_POINT is defined in a module in
	; ligsn.lib and clears the bss, sets up the heap, etc., before
	; calling main().

	regs	pc=__SN_ENTRY_POINT	; entry point



================================================
FILE: PSXDOOM/MAKEFILE.bat
================================================
@echo off
set PATH=C:\psyq\bin
set PSYQ_PATH=C:\psyq\bin

::remove_all:
	del obj\*.obj
	del asm\*.s
@echo on

::all:
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/d_main.obj  d_main.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/info.obj  info.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/sprinfo.obj  sprinfo.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/g_game.obj  g_game.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/p_base.obj  p_base.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/p_ceilng.obj  p_ceilng.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/p_change.obj  p_change.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/p_doors.obj  p_doors.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/p_enemy.obj  p_enemy.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/p_floor.obj  p_floor.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/p_inter.obj  p_inter.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/p_lights.obj  p_lights.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/p_map.obj  p_map.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/p_maputl.obj  p_maputl.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/p_mobj.obj  p_mobj.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/p_move.obj  p_move.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/p_plats.obj  p_plats.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/p_pspr.obj  p_pspr.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/p_setup.obj  p_setup.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/p_shoot.obj  p_shoot.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/p_sight.obj  p_sight.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/p_slide.obj  p_slide.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/p_spec.obj  p_spec.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/p_switch.obj  p_switch.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/p_telept.obj  p_telept.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/p_tick.obj  p_tick.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/p_user.obj  p_user.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/r_phase1.obj  r_phase1.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/r_phase2.obj  r_phase2.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/r_data.obj  r_data.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/r_main.obj  r_main.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/vsprintf.obj  vsprintf.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/w_wad.obj  w_wad.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/psx_file.obj  psx_file.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/z_zone.obj  z_zone.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/psxmain.obj  psxmain.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/l_main.obj  l_main.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/t_main.obj  t_main.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/m_main.obj  m_main.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/c_main.obj  c_main.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/pw_main.obj  pw_main.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/cf_main.obj  cf_main.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/m_password.obj  m_password.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/st_main.obj  st_main.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/am_main.obj  am_main.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/in_main.obj  in_main.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/f_main.obj  f_main.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/o_main.obj  o_main.c
	::ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/m_fixed.obj  m_fixed.c
	asmpsx /l m_fixed.s,obj\m_fixed.obj
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/tables.obj  tables.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/psxcd.obj  psxcd.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/s_sound.obj  s_sound.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/psxspu.obj  psxspu.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/psxcmd.obj  psxcmd.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/wessapip.obj  wessapip.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/wessapi.obj  wessapi.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/wessarc.obj  wessarc.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/wessapit.obj  wessapit.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/wessseq.obj  wessseq.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/seqload.obj  seqload.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/lcdload.obj  lcdload.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/wessapim.obj  wessapim.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/seqloadr.obj  seqloadr.c
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj/wessbase.obj  wessbase.c
	asmpsx /l snmain.s,obj\snmain.obj

::child:
	ccpsx -comments-c++ -Wreturn-type -c -O2 -g -o obj\psxmain.obj  psxmain.c
	psylink /m /g /c /q /o$80010000 @main.lnk,main.cpe,main.sym,main.map
	::cpe2x main.cpe
	cpe2x_gec main.cpe

@echo off
::asm:
	ccpsx -O2 -S -Xo$80010000 -o asm\d_main.s d_main.c
	ccpsx -O2 -S -Xo$80010000 -o asm\info.s info.c
	ccpsx -O2 -S -Xo$80010000 -o asm\sprinfo.s sprinfo.c
	ccpsx -O2 -S -Xo$80010000 -o asm\g_game.s g_game.c
	ccpsx -O2 -S -Xo$80010000 -o asm\p_base.s p_base.c
	ccpsx -O2 -S -Xo$80010000 -o asm\p_ceilng.s p_ceilng.c
	ccpsx -O2 -S -Xo$80010000 -o asm\p_change.s p_change.c
	ccpsx -O2 -S -Xo$80010000 -o asm\p_doors.s p_doors.c
	ccpsx -O2 -S -Xo$80010000 -o asm\p_enemy.s p_enemy.c
	ccpsx -O2 -S -Xo$80010000 -o asm\p_floor.s p_floor.c
	ccpsx -O2 -S -Xo$80010000 -o asm\p_inter.s p_inter.c
	ccpsx -O2 -S -Xo$80010000 -o asm\p_lights.s p_lights.c
	ccpsx -O2 -S -Xo$80010000 -o asm\p_map.s p_map.c
	ccpsx -O2 -S -Xo$80010000 -o asm\p_maputl.s p_maputl.c
	ccpsx -O2 -S -Xo$80010000 -o asm\p_mobj.s p_mobj.c
	ccpsx -O2 -S -Xo$80010000 -o asm\p_move.s p_move.c
	ccpsx -O2 -S -Xo$80010000 -o asm\p_plats.s p_plats.c
	ccpsx -O2 -S -Xo$80010000 -o asm\p_pspr.s p_pspr.c
	ccpsx -O2 -S -Xo$80010000 -o asm\p_setup.s p_setup.c
	ccpsx -O2 -S -Xo$80010000 -o asm\p_shoot.s p_shoot.c
	ccpsx -O2 -S -Xo$80010000 -o asm\p_sight.s p_sight.c
	ccpsx -O2 -S -Xo$80010000 -o asm\p_slide.s p_slide.c
	ccpsx -O2 -S -Xo$80010000 -o asm\p_spec.s p_spec.c
	ccpsx -O2 -S -Xo$80010000 -o asm\p_switch.s p_switch.c
	ccpsx -O2 -S -Xo$80010000 -o asm\p_telept.s p_telept.c
	ccpsx -O2 -S -Xo$80010000 -o asm\p_tick.s p_tick.c
	ccpsx -O2 -S -Xo$80010000 -o asm\p_user.s p_user.c
	ccpsx -O2 -S -Xo$80010000 -o asm\r_phase1.s r_phase1.c
	ccpsx -O2 -S -Xo$80010000 -o asm\r_phase2.s r_phase2.c
	ccpsx -O2 -S -Xo$80010000 -o asm\r_data.s r_data.c
	ccpsx -O2 -S -Xo$80010000 -o asm\r_main.s r_main.c
	ccpsx -O2 -S -Xo$80010000 -o asm\vsprintf.s vsprintf.c
	ccpsx -O2 -S -Xo$80010000 -o asm\w_wad.s  w_wad.c
	ccpsx -O2 -S -Xo$80010000 -o asm\psx_file.s  psx_file.c
	ccpsx -O2 -S -Xo$80010000 -o asm\z_zone.s z_zone.c
	ccpsx -O2 -S -Xo$80010000 -o asm\psxmain.s psxmain.c
	ccpsx -O2 -S -Xo$80010000 -o asm\l_main.s l_main.c
	ccpsx -O2 -S -Xo$80010000 -o asm\t_main.s t_main.c
	ccpsx -O2 -S -Xo$80010000 -o asm\m_main.s m_main.c
	ccpsx -O2 -S -Xo$80010000 -o asm\c_main.s c_main.c
	ccpsx -O2 -S -Xo$80010000 -o asm\pw_main.s pw_main.c
	ccpsx -O2 -S -Xo$80010000 -o asm\cf_main.s cf_main.c
	ccpsx -O2 -S -Xo$80010000 -o asm\m_password.s m_password.c
	ccpsx -O2 -S -Xo$80010000 -o asm\st_main.s st_main.c
	ccpsx -O2 -S -Xo$80010000 -o asm\am_main.s am_main.c
	ccpsx -O2 -S -Xo$80010000 -o asm\in_main.s in_main.c
	ccpsx -O2 -S -Xo$80010000 -o asm\f_main.s f_main.c
	ccpsx -O2 -S -Xo$80010000 -o asm\o_main.s o_main.c
	::ccpsx -O2 -S -Xo$80010000 -o asm\m_fixed.s m_fixed.c
	ccpsx -O2 -S -Xo$80010000 -o asm\tables.s tables.c
	ccpsx -O2 -S -Xo$80010000 -o asm\psxcd.s psxcd.c
	ccpsx -O2 -S -Xo$80010000 -o asm\s_sound.s s_sound.c
	ccpsx -O2 -S -Xo$80010000 -o asm\psxspu.s psxspu.c
	ccpsx -O2 -S -Xo$80010000 -o asm\psxcmd.s psxcmd.c
	ccpsx -O2 -S -Xo$80010000 -o asm\wessapip.s wessapip.c
	ccpsx -O2 -S -Xo$80010000 -o asm\wessapi.s wessapi.c
	ccpsx -O2 -S -Xo$80010000 -o asm\wessarc.s wessarc.c
	ccpsx -O2 -S -Xo$80010000 -o asm\wessapit.s wessapit.c
	ccpsx -O2 -S -Xo$80010000 -o asm\wessseq.s wessseq.c
	ccpsx -O2 -S -Xo$80010000 -o asm\seqload.s seqload.c
	ccpsx -O2 -S -Xo$80010000 -o asm\lcdload.s lcdload.c
	ccpsx -O2 -S -Xo$80010000 -o asm\wessapim.s wessapim.c
	ccpsx -O2 -S -Xo$80010000 -o asm\seqloadr.s seqloadr.c
	ccpsx -O2 -S -Xo$80010000 -o asm\wessbase.s wessbase.c

@echo on

@echo off
	copy main.exe GAME
@echo on
pause


================================================
FILE: PSXDOOM/PSXCD.C
================================================
// Reconstruido Y Verificado por Erick Vasquez Garcia 16/05/2019 [GEC]
// Update_1 20/10/2019 [GEC]
// Update_2 32/01/2020 [GEC]

    /*------------------------------------------------------------------*/
    /*
                     Sony CD Architecture Specific Routines
                            by Scott Patterson

                     development and testing period on this code:
                            4/18/95 - 9/28/95
    */
    /*------------------------------------------------------------------*/

#include <kernel.h>
#include "wessapi.h"
#include "psxcd.h"
#include "psxspu.h"

// undeclared SONY prototypes
//extern void CdInit(void);

#if _CD_VERSION_ == 1

// CD Stuff
// CD Stuff
// CD Stuff
// CD Stuff

#if _CD_ABS_OPEN_ == 1
  //lets just put this table in this file
  #include "psxcdabs.c"
#endif

// private variables
static volatile int seeking_for_play = 0;
static volatile int waiting_for_pause = 0;
static volatile int async_on = 0;
static CdlLOC sectorbuf_contents = {0,0,0,0};

static void psxcd_memcpy(void *pdest, void *psrc, unsigned long bytestocopy);

//static void (*cd_pause_callback)(void) = 0;

static u_long cbsyncsave;
static u_long cbreadysave;
static void cbcomplete(int intr, u_char *result);
static void cbready(int intr, u_char *result);

static int psxcd_mode = -1; //initially an undefined mode
static int IsCdInit = 0;
static int init_pos = 0;

static PsxCd_File cdfile;
static CdlLOC cur_io_loc = {0,0,0,0};

int cb_enable_flag = 0;
int critical_error = 0;
int cdl_intr = 0;
int cdl_errintr = 0;
int cdl_errcount = 0;
unsigned char cdl_stat = 0;
unsigned char cdl_errstat = 0;
unsigned char cdl_com = CdlPause;
unsigned char cdl_errcom = 0;
int readcount = 0;
int playcount = 0;

char sectorbuf[CD_ROM_SECTOR_SIZE];

static char cd_param[8] = {0,0,0,0,0,0,0,0};

// CD ASYNC CHECKING
static int  sync_intr = 0;//iGp000007c4 80077BD4
static char sync_result[8] = {0,0,0,0,0,0,0,0};//80077bd8
static int  check_intr = 0;
static char check_result[8] = {0,0,0,0,0,0,0,0};

// CD ASYNC STUFF
#define PSXCD_COMMAND_END       0
#define PSXCD_COMMAND_COPY      1
#define PSXCD_COMMAND_SEEK      2
#define PSXCD_COMMAND_READ      3
#define PSXCD_COMMAND_READCOPY  4

typedef struct PsxCd_Command {
    int     command;
    int     amount; //sectors or bytes
    char   *pdest;  //buffer or direct
    char   *psrc;  //buffer pos
    CdlLOC  io_loc;
}PsxCd_Command;

static int cur_cmd = 0;
static PsxCd_Command psxcd_cmd[5];

static void *lastdestptr = 0;
static int lastreadbytes = 0;
static PsxCd_File newfilestruct;
static PsxCd_File lastfilestruct;

// CD-DA play stuff
static int playflag = 0;
static int playvol = 0;
static int playfadeuptime = 0;
static int looptrack = 0;
static int loopflag = 0;
static int loopvol = 0;
static int loopsectoroffset = 0;
static int loopfadeuptime = 0;
static CdlLOC  cdloc = {0,0,0,0};
static CdlATV  cdatv = {0,0,0,0};
static CdlLOC  loc[100];
static CdlLOC  newloc = {0,0,0,0};
static CdlLOC  lastloc = {0,0,0,0};
static CdlLOC  beginloc = {0,0,0,0};

static void psxcd_memcpy(void *pdest, void *psrc, unsigned long bytestocopy)//L8003EF70()
{
    while(bytestocopy--)
    {
        *(char *)pdest++ = *(char *)psrc++;
    }
}

extern volatile unsigned long millicount;

static void psxcd_sync(void)//8003EFA4
{
    unsigned long block;

    block = millicount;
    block += 8000;

    while(millicount<block)
    {
        sync_intr = CdSync(1,(u_char *)sync_result);
        if(sync_intr==CdlDiskError)
        {
            CdFlush();
            cdl_errintr = sync_intr + 80; //to give us unique error numbers
            cdl_errcom = cdl_com;
            cdl_errstat = sync_result[0];
            cdl_errcount++;
        }
        if(sync_intr==CdlComplete) return;
    }
}

static int psxcd_critical_sync(void)//8003F060
{
    unsigned long block;

    block = millicount;
    block += 8000;

    while(millicount<block)
    {
        sync_intr = CdSync(1,(u_char *)sync_result);
        if(sync_intr==CdlDiskError)
        {
            CdFlush();
            cdl_errintr = sync_intr + 70; //to give us unique error numbers
            cdl_errcom = cdl_com;
            cdl_errstat = sync_result[0];
            cdl_errcount++;
            return(0);
        }
        if(sync_intr==CdlComplete) return(1);
    }
    return(0);
}

static void cbcomplete(int intr, u_char *result)//8003F11C
{
    if(!cb_enable_flag) return;

    //cdl_intr = intr + 10; //to give us unique error numbers
    //cdl_stat = result[0];
    if(intr == CdlComplete)
    {
        if(cdl_com==CdlSeekP)
        {
            seeking_for_play = 0;
            if(playflag)
            {
                #if _CD_SPU_LINK_ == 1
                 psxspu_setcdmixon();
                 if(playfadeuptime)
                 {
                    psxspu_set_cd_vol(0);
                    psxspu_start_cd_fade(playfadeuptime,playvol);
                    playfadeuptime = 0;
                 } else {
                    psxspu_set_cd_vol(playvol);
                 }
                #endif

                CdControlF(cdl_com=CdlPlay,0);
            }
        } else if(cdl_com==CdlPause) {
            waiting_for_pause = 0;
        }
    } else {
        // error = intr
        cdl_errintr = intr + 10; //to give us unique error numbers
        cdl_errcom = cdl_com;
        cdl_errstat = result[0];
        cdl_errcount++;
        //if((cdl_com==CdlSeekP)&&(result[0]&2))
        //{
        //    CdControlF(cdl_com=CdlSeekP,(u_char *)&cdloc);
        //}
    }
}

static void cbready(int intr, u_char *result)//8003F200
{
    if(!cb_enable_flag) return;

    cdl_intr = intr;
    cdl_stat = result[0];
    if((result[0]&CdlStatRead)&&async_on&&(cdl_com==CdlReadN))
    {
        //if shell open, hang till closed then reread
        readcount++;
        if (intr == CdlDataReady)
        {
            switch(psxcd_cmd[cur_cmd].command)
            {
                case PSXCD_COMMAND_READ:
                    //if((!CdGetSector((u_long *)psxcd_cmd[cur_cmd].pdest, 2048/4))||(result[0]!=0x22))
                    //{
                    //    cdl_errintr = 50;
                    //    cdl_errcom = cdl_com;
                    //    cdl_errstat = result[0];
                    //    cdl_errcount++;
                    //    ////reissue the last read command
                    //    //newfilestruct = lastfilestruct;
                    //    //psxcd_async_read(lastdestptr,lastreadbytes,&newfilestruct);
                    //    return;
                    //}
                    // must check for quad align!!!!
                    if((unsigned long)psxcd_cmd[cur_cmd].pdest&3)
                    {
                        CdGetSector((u_long *)sectorbuf, 2048/4);
                        psxcd_memcpy(psxcd_cmd[cur_cmd].pdest,
                                     sectorbuf,
                                     2048);
                    } else {
                        CdGetSector((u_long *)psxcd_cmd[cur_cmd].pdest, 2048/4);
                    }
                    psxcd_cmd[cur_cmd].pdest += 2048;
                    if(!--psxcd_cmd[cur_cmd].amount)
                    {
                        cur_cmd++;
                    }
                    break;

                case PSXCD_COMMAND_READCOPY:
                    //if((!CdGetSector((u_long *)sectorbuf, 2048/4))||(result[0]!=0x22))
                    //{
                    //    cdl_errintr = 50;
                    //    cdl_errcom = cdl_com;
                    //    cdl_errstat = result[0];
                    //    cdl_errcount++;
                    //    //reissue the last read command
                    //    //newfilestruct = lastfilestruct;
                    //    //psxcd_async_read(lastdestptr,lastreadbytes,&newfilestruct);
                    //    return;
                    //}
                    CdGetSector((u_long *)sectorbuf, 2048/4);
                    psxcd_memcpy(psxcd_cmd[cur_cmd].pdest,
                                 psxcd_cmd[cur_cmd].psrc,
                                 psxcd_cmd[cur_cmd].amount);
                    cur_cmd++;
                    break;

                default:
                    psxcd_cmd[cur_cmd].command = PSXCD_COMMAND_END;
                    break;

            }

            if(psxcd_cmd[cur_cmd].command == PSXCD_COMMAND_END)
            {
                async_on = 0;
                waiting_for_pause = 1;
                CdControlF(cdl_com=CdlPause, 0);
            }

            return;
        } else {
            // error = intr
            if(intr==CdlDiskError)
            {
                CdFlush();
                critical_error = 1;
            }
            cdl_errintr = intr;
            cdl_errcom = cdl_com;
            cdl_errstat = result[0];
            cdl_errcount++;

            //reissue the last read command
            //newfilestruct = lastfilestruct;
            //psxcd_async_read(lastdestptr,lastreadbytes,&newfilestruct);
            return;
        }
    }


    if(result[0]&CdlStatPlay/*cdl_com==CdlPlay*/)
    {
        //if shell open, hang till closed then restart play
        if (intr == CdlDataReady)
        {
            if ((result[4]&0x80) == 0)
            {
                playcount++;
                newloc.track = btoi(result[1]);
                newloc.minute = result[3];
                newloc.second = result[4];
                newloc.sector = result[5];
                //vol   = (result[6]<<8)|result[7];
            }

            return;
        } else {
            // error = intr
            // intr==CdlDataEnd means end of track
            if(intr==CdlDataEnd)
            {
                *(int *)&lastloc = 0;
                cdl_com = CdlNop;
                //if playflag and loopflag, play again
                if(playflag||loopflag) //if(playflag&&loopflag)
                {
                    psxcd_play_at_andloop(looptrack, loopvol, loopsectoroffset, loopfadeuptime,
                                           looptrack, loopvol, loopsectoroffset, loopfadeuptime);
                }
            } else {
                if(intr==CdlDiskError)
                {
                    CdFlush();
                }
                cdl_errintr = intr + 20; //to give us unique error numbers
                cdl_errcom = cdl_com;
                cdl_errstat = result[0];
                cdl_errcount++;
            }

            return;
        }
    }

    //if(intr==CdlDiskError)
    //{
    //    CdFlush();
    //}
    //we only get here if there is an error
    cdl_errintr = intr + 30; //to give us unique error numbers
    cdl_errcom = cdl_com;
    cdl_errstat = result[0];
    cdl_errcount++;
}

#endif //_CD_VERSION_

void psxcd_disable_callbacks(void)//8003F604
{
#if _CD_VERSION_ == 1
    cb_enable_flag = 0;
#endif
}

void psxcd_enable_callbacks(void)//8003F610
{
#if _CD_VERSION_ == 1
    cb_enable_flag = 1;
#endif
}

void psxcd_init(void)//8003F620
{
#if _CD_VERSION_ == 1

    int i,ntoc;

    if(IsCdInit)
    {
        return;
    }

    CdInit();

    IsCdInit = 1;

    for(i=0;i<100;i++)
    {
        loc[i].minute = 0;
        loc[i].second = 0;
        loc[i].sector = 0;
        loc[i].track = 0;
    }

    #if _CD_SPU_LINK_ == 1
     psxspu_init();
    #endif

    if((ntoc=CdGetToc(loc)) == 0)
    {
        //printf("No TOC found: please use CD-DA disc...\n");
        return;
    }

    init_pos = 0;
    async_on = 0;
    cbsyncsave = (u_long)CdSyncCallback((CdlCB)cbcomplete);
    cbreadysave = (u_long)CdReadyCallback((CdlCB)cbready);

    psxcd_enable_callbacks();

#else
    return;
#endif
}

void psxcd_exit(void)//8003F6FC
{
#if _CD_VERSION_ == 1
    CdSyncCallback((void *)cbsyncsave);
    CdReadyCallback((void *)cbreadysave);
#else
    return;
#endif
}

void psxcd_set_data_mode(void)//8003F72C
{
#if _CD_VERSION_ == 1
    //int millitemp;

    if(psxcd_mode!=1)
    {
        playflag = 0; // ensure no SeekP callback activity
        loopflag = 0;
        seeking_for_play = 0;

        #if _CD_SPU_LINK_ == 1
         if(psxspu_get_cd_vol())
         {
             psxspu_start_cd_fade(FADE_TIME,0);
             while(psxspu_get_cd_fade_status());
         }
         psxspu_setcdmixoff();
        #endif

        psxcd_sync(); // to ensure no pending pauses...

        cd_param[0] = CdlModeSpeed;  //|CdlModeRept not necessary

        CdControl(cdl_com=CdlSetmode, cd_param, 0);

        psxcd_mode = 1;

        //millitemp = millicount;
        //millitemp += 1500;
        //while(millicount<millitemp);

        psxcd_sync(); // to ensure no pending pauses...

        CdControl(cdl_com=CdlPause, 0, 0);

        psxcd_sync(); // to ensure no pending pauses...

        CdFlush();

    } else {
        if(async_on)
        {
            psxcd_async_read_cancel();
        }

        if(cdl_com!=CdlPause)
        {
            psxcd_sync(); // to ensure no pending pauses...
            CdControl(cdl_com=CdlPause, 0, 0);
        }

        psxcd_sync(); // to ensure no pending pauses...

        CdFlush();

    }
#endif
}

#if _CD_VERSION_ == 1

 #if _CD_ABS_OPEN_ == 1

  PsxCd_File *psxcd_open(char *filename)//8003F83C
  {
      //printf("filename %d\n", (int)filename);
      //printf("abs %d\n", cdmaptbl[(int)filename].abs);
      //printf("size %d\n", cdmaptbl[(int)filename].size);

      CdIntToPos(cdmaptbl[(int)filename].abs,&cdfile.file.pos);
      cdfile.file.size = cdmaptbl[(int)filename].size;
      cdfile.new_io_loc = cdfile.file.pos;

      cdfile.io_block_offset = 0;
      cdfile.io_result[0] = 0;
      cdfile.io_result[1] = 0;
      cdfile.io_result[2] = 0;
      cdfile.io_result[3] = 0;
      cdfile.io_result[4] = 0;
      cdfile.io_result[5] = 0;
      cdfile.io_result[6] = 0;
      cdfile.io_result[7] = 0;

      return(&cdfile);

  }

 #else /* _CD_ABS_OPEN_ */

  PsxCd_File *psxcd_open(char *filename)
  {
      //int dum;

      psxcd_set_data_mode();

      cdfile.file.pos.minute = 0;
      cdfile.file.pos.second = 0;
      cdfile.file.pos.sector = 0;
      cdfile.file.pos.track  = 0;

      if(!CdSearchFile(&cdfile.file,filename))
      {
          return(0);
      }

      cdfile.new_io_loc = cdfile.file.pos;

      cdfile.io_block_offset = 0;
      cdfile.io_result[0] = 0;
      cdfile.io_result[1] = 0;
      cdfile.io_result[2] = 0;
      cdfile.io_result[3] = 0;
      cdfile.io_result[4] = 0;
      cdfile.io_result[5] = 0;
      cdfile.io_result[6] = 0;
      cdfile.io_result[7] = 0;

      return(&cdfile);

  }
 #endif /* _CD_ABS_OPEN_ */

#endif /* _CD_VERSION_ */


void psxcd_init_pos(void)//8003F90C
{
#if _CD_VERSION_ == 1
    init_pos = 0;
    playflag = 0;
    loopflag = 0;
    seeking_for_play = 0;
    waiting_for_pause = 0;
    critical_error = 0;
#endif
}

int psxcd_async_on(void)//8003F92C
{
#if _CD_VERSION_ == 1
    if(async_on)
    {
        check_intr = CdSync(1,(u_char *)check_result);
        if(critical_error ||
           (check_intr==CdlDiskError) ||
           //(check_result[0] & !(CdlStatSeek|CdlStatRead|CdlStatStandby)) || // This line of code are blocked in Psx Doom
           !(check_result[0] & CdlStatStandby))
        {
            CdFlush();
            critical_error = 0;
            cdl_errintr = check_intr + 100; //to give us unique error numbers
            cdl_errcom = cdl_com;
            cdl_errstat = check_result[0];
            cdl_errcount++;

            //reissue the last read command
            newfilestruct = lastfilestruct;
            psxcd_async_read(lastdestptr,lastreadbytes,&newfilestruct);
        }
        return(1);
    } else {
        return(0);
    }
#else
    return(0);
#endif
}

int psxcd_seeking_for_play(void)//8003FA34
{
#if _CD_VERSION_ == 1
    if(seeking_for_play)
    {
        check_intr = CdSync(1,(u_char *)check_result);
        if((check_intr==CdlDiskError) ||
           //(check_result[0] & !(CdlStatSeek|CdlStatPlay|CdlStatStandby)) || // This line of code are blocked in Psx Doom
           !(check_result[0] & CdlStatStandby))
        {
            CdFlush();
            cdl_errintr = check_intr + 110; //to give us unique error numbers
            cdl_errcom = cdl_com;
            cdl_errstat = check_result[0];
            cdl_errcount++;

            //reissue the last play command
            psxcd_sync();

            CdControlF(cdl_com=CdlSeekP, (u_char *)&lastloc);
        }
        return(1);
    } else {
        return(0);
    }
#else
    return(0);
#endif
}

int psxcd_waiting_for_pause(void)//8003FAE4
{
#if _CD_VERSION_ == 1
    if(waiting_for_pause)
    {
        check_intr = CdSync(1,(u_char *)check_result);
        if((check_intr==CdlDiskError) ||
           //(check_result[0] & !(CdlStatSeek|CdlStatRead|CdlStatPlay|CdlStatStandby)) || // This line of code are blocked in Psx Doom
           !(check_result[0] & CdlStatStandby))
        {
            CdFlush();
            cdl_errintr = check_intr + 120; //to give us unique error numbers
            cdl_errcom = cdl_com;
            cdl_errstat = check_result[0];
            cdl_errcount++;

            //reissue the pause command
            psxcd_sync();

            CdControlF(cdl_com=CdlPause, 0);
        }
        return(1);
    } else {
        return(0);
    }
#else
    return(0);
#endif
}

int psxcd_read(void *destptr,int readbytes,PsxCd_File *fileptr)//8003FB90
{
    int retbytes;

    retbytes = psxcd_async_read(destptr, readbytes, fileptr);

    // wait for Async
    while(psxcd_async_on());

    return(retbytes);
}

void psxcd_async_read_cancel(void)//8003FBC8
{
#if _CD_VERSION_ == 1
    if(async_on)
    {
        async_on = 0;
        init_pos = 0;

        psxcd_sync(); // to ensure no pending pauses...

        waiting_for_pause = 1;
        CdControlF(cdl_com=CdlPause, 0);
    }
#endif
}

int psxcd_async_read(void *destptr,int readbytes,PsxCd_File *fileptr)//8003FC14
{
#if _CD_VERSION_ == 1

    int read_setup_failure;
    int sectors;
    char *pdest;
    unsigned long bytestoread,byteoffset,bytestocopy,bytesofblocks;

    if(!readbytes)
    {
        return(0);
    }

    if(*(int *)&fileptr->file.pos==0)
    {
        return(0);
    }

    do
    {
        sectors = 0;
        read_setup_failure = 0;

        psxcd_set_data_mode();

        lastdestptr = destptr;
        lastreadbytes = readbytes;
        lastfilestruct = *fileptr;

        // pause check is later in this function

        cur_cmd = 0;

        pdest = (char *)destptr;
        bytestoread = readbytes;
        byteoffset = fileptr->io_block_offset;

        // if read begins inside block:

        if(byteoffset && bytestoread)
        {
            if(!init_pos||(*(long *)&cur_io_loc!=*(long *)&fileptr->new_io_loc))
            {
                psxcd_cmd[cur_cmd].command = PSXCD_COMMAND_SEEK;
                psxcd_cmd[cur_cmd].io_loc = fileptr->new_io_loc;
                cur_cmd++;

                cur_io_loc = fileptr->new_io_loc;

                init_pos = 1;
            }

            bytestocopy = CD_ROM_SECTOR_SIZE-byteoffset;
            if(bytestocopy>bytestoread)
            {
                bytestocopy = bytestoread;
            }

            if(cur_cmd||(*(long *)&sectorbuf_contents!=*(long *)&cur_io_loc))
            {
                psxcd_cmd[cur_cmd].command = PSXCD_COMMAND_READCOPY;
                psxcd_cmd[cur_cmd].amount = bytestocopy;
                psxcd_cmd[cur_cmd].pdest = pdest;
                psxcd_cmd[cur_cmd].psrc = sectorbuf + byteoffset;
                psxcd_cmd[cur_cmd].io_loc = cur_io_loc;
                cur_cmd++;

                sectorbuf_contents = cur_io_loc;
            } else {
                psxcd_cmd[cur_cmd].command = PSXCD_COMMAND_COPY;
                psxcd_cmd[cur_cmd].amount = bytestocopy;
                psxcd_cmd[cur_cmd].pdest = pdest;
                psxcd_cmd[cur_cmd].psrc = sectorbuf + byteoffset;
                cur_cmd++;

            }

            bytestoread -= bytestocopy;
            pdest += bytestocopy;
            fileptr->io_block_offset = byteoffset + bytestocopy;
            if(fileptr->io_block_offset==CD_ROM_SECTOR_SIZE)
            {
                CdIntToPos(CdPosToInt(&cur_io_loc) + 1,&cur_io_loc);
                fileptr->new_io_loc = cur_io_loc;
                fileptr->io_block_offset = 0;
            }
        }

        // for block aligned reading:

        if(bytestoread>=CD_ROM_SECTOR_SIZE)
        {
            sectors = bytestoread/CD_ROM_SECTOR_SIZE;
            bytesofblocks = sectors*CD_ROM_SECTOR_SIZE;

            if(!init_pos||(*(long *)&cur_io_loc!=*(long *)&fileptr->new_io_loc))
            {
                psxcd_cmd[cur_cmd].command = PSXCD_COMMAND_SEEK;
                psxcd_cmd[cur_cmd].io_loc = fileptr->new_io_loc;
                cur_cmd++;

                cur_io_loc = fileptr->new_io_loc;

                init_pos = 1;
            }

            psxcd_cmd[cur_cmd].command = PSXCD_COMMAND_READ;
            psxcd_cmd[cur_cmd].amount = sectors;
            psxcd_cmd[cur_cmd].pdest = pdest;
            if((unsigned long)pdest&3)
            {
                CdIntToPos(CdPosToInt(&cur_io_loc) + sectors - 1,&sectorbuf_contents);
            }
            psxcd_cmd[cur_cmd].io_loc = cur_io_loc;
            cur_cmd++;

            pdest += bytesofblocks;
            bytestoread -= bytesofblocks;

            CdIntToPos(CdPosToInt(&cur_io_loc) + sectors,&cur_io_loc);

            fileptr->io_block_offset = 0;
            fileptr->new_io_loc = cur_io_loc;
        }

        // if read ends inside block:

        if(bytestoread)
        {
            if(!init_pos||(*(long *)&cur_io_loc!=*(long *)&fileptr->new_io_loc))
            {
                psxcd_cmd[cur_cmd].command = PSXCD_COMMAND_SEEK;
                psxcd_cmd[cur_cmd].io_loc = fileptr->new_io_loc;
                cur_cmd++;

                cur_io_loc = fileptr->new_io_loc;

                init_pos = 1;
            }

            psxcd_cmd[cur_cmd].command = PSXCD_COMMAND_READCOPY;
            psxcd_cmd[cur_cmd].amount = bytestoread;
            psxcd_cmd[cur_cmd].pdest = pdest;
            psxcd_cmd[cur_cmd].psrc = sectorbuf;
            psxcd_cmd[cur_cmd].io_loc = cur_io_loc;
            cur_cmd++;

            sectorbuf_contents = cur_io_loc;

            fileptr->io_block_offset = bytestoread;
        }

        psxcd_cmd[cur_cmd].command = PSXCD_COMMAND_END;
        cur_cmd = 0;

        // if we are just a copy , then skip all the async stuff
        if(psxcd_cmd[cur_cmd].command == PSXCD_COMMAND_COPY)
        {
            // do copy
            psxcd_memcpy(psxcd_cmd[cur_cmd].pdest,
                         psxcd_cmd[cur_cmd].psrc,
                         psxcd_cmd[cur_cmd].amount);
            // increment cur_cmd
            cur_cmd++;
            // set to end
            if(psxcd_cmd[cur_cmd].command == PSXCD_COMMAND_END)
            {
                return(readbytes);
            }
        }

        // if we seek, start now...
        if(psxcd_cmd[cur_cmd].command == PSXCD_COMMAND_SEEK)
        {
            // do seek
            psxcd_sync();
            CdControl(cdl_com=CdlSetloc,
                      (u_char *)&psxcd_cmd[cur_cmd].io_loc, 0);
            // increment cur_cmd
            cur_cmd++;
            if(psxcd_cmd[cur_cmd].command == PSXCD_COMMAND_END)
            {
                return(readbytes);
            }
        }

        switch(psxcd_cmd[cur_cmd].command)
        {
            case PSXCD_COMMAND_READ:
            case PSXCD_COMMAND_READCOPY:
                //do read
                if(!psxcd_critical_sync())
                {
                    read_setup_failure = 1;
                    break;
                }
                CdControl(cdl_com=CdlReadN,
                          (u_char *)&psxcd_cmd[cur_cmd].io_loc, 0);
                if(!psxcd_critical_sync())
                {
                    read_setup_failure = 1;
                    break;
                }
                async_on = 1;
                break;

            case PSXCD_COMMAND_END:
                    return(readbytes);
                break;

            default:
                    return(0);
                break;

        }

        if(read_setup_failure)
        {
            *fileptr = lastfilestruct;
        }
    }while(read_setup_failure);

    return(readbytes);

#else
    return(0);
#endif
}

int psxcd_seek(PsxCd_File *fileptr,int seekpos,int seekmode)//80040444
{
#if _CD_VERSION_ == 1

    int sector_index;

    if(*(int *)&fileptr->file.pos==0)
    {
        return(0);
    }

    if(seekmode==PSXCD_SEEK_SET)
    {
        sector_index = (seekpos / CD_ROM_SECTOR_SIZE) + CdPosToInt(&fileptr->file.pos);

        CdIntToPos(sector_index,&fileptr->new_io_loc);
        fileptr->io_block_offset = seekpos % CD_ROM_SECTOR_SIZE;

    } else if(seekmode==PSXCD_SEEK_CUR) {
        sector_index = ((seekpos+fileptr->io_block_offset) / CD_ROM_SECTOR_SIZE) + CdPosToInt(&cur_io_loc);

        CdIntToPos(sector_index,&fileptr->new_io_loc);
        fileptr->io_block_offset = (seekpos+fileptr->io_block_offset) % CD_ROM_SECTOR_SIZE;

    } else { //PSXCD_SEEK_END
        sector_index = ((fileptr->file.size-seekpos) / CD_ROM_SECTOR_SIZE) + CdPosToInt(&fileptr->file.pos);

        CdIntToPos(sector_index,&fileptr->new_io_loc);
        fileptr->io_block_offset = (fileptr->file.size-seekpos) % CD_ROM_SECTOR_SIZE;
    }
    return(0);

#else
    return(0);
#endif
}

unsigned long psxcd_tell(PsxCd_File *fileptr)//80040538
{
#if _CD_VERSION_ == 1

    int sector_index;

    if(*(int *)&fileptr->file.pos==0)
    {
        return(0);
    }

    sector_index = CdPosToInt(&fileptr->new_io_loc) - CdPosToInt(&fileptr->file.pos);
    return((sector_index*CD_ROM_SECTOR_SIZE) + fileptr->io_block_offset);

#else
    return(0);
#endif
}

void psxcd_close(PsxCd_File *fileptr)//800405A0
{
#if _CD_VERSION_ == 1

#endif
}

void psxcd_set_audio_mode(void)//800405A8
{
#if _CD_VERSION_ == 1
    if(psxcd_mode!=0)
    {
        if(async_on)
        {
            psxcd_async_read_cancel();
        }

        init_pos = 0; //since we have lost the data position of the CD
        cd_param[0] = CdlModeRept|CdlModeAP|CdlModeDA;

        CdControl(cdl_com=CdlSetmode, cd_param, 0);

        psxcd_mode = 0;

        psxcd_sync();

        CdControl(cdl_com=CdlPause, 0, 0);

        psxcd_sync(); // to ensure no pending pauses...

        CdFlush();
    } else {
        psxcd_sync();
    }
#endif
}

void psxcd_set_loop_volume(int volforloop)//8004064C
{
#if _CD_VERSION_ == 1
    loopvol = volforloop;
#endif
}

void psxcd_play_at_andloop(int track,
                           int vol,
                           int sectoroffset,
                           int fadeuptime,
                           int tracktoloop,
                           int volforloop,
                           int loopstartsectoroffset,
                           int loopstartfadeuptime)//80040658
{
#if _CD_VERSION_ == 1

    if(*(int *)&loc[track]==0)
    {
        return;
    }

    psxcd_set_audio_mode();

    playvol = vol;

    CdIntToPos((CdPosToInt(&loc[track]) + sectoroffset),&cdloc);

    playcount = 0;
    playflag = 1;
    loopflag = 1;
    looptrack = tracktoloop;
    loopvol = volforloop;
    loopsectoroffset = loopstartsectoroffset;
    loopfadeuptime = loopstartfadeuptime;
    seeking_for_play = 1;
    playfadeuptime = fadeuptime;
    CdControlF(cdl_com=CdlSeekP, (u_char *)&cdloc);

    lastloc = loc[track];
    beginloc = lastloc;
    newloc = lastloc;

#endif
}

void psxcd_play_at(int track, int vol, int sectoroffset)//800407B8
{
#if _CD_VERSION_ == 1

    if(*(int *)&loc[track]==0)
    {
        return;
    }

    playflag = 0;
    loopflag = 0;
    seeking_for_play = 0;

    psxcd_set_audio_mode();

    playvol = vol;

    CdIntToPos((CdPosToInt(&loc[track]) + sectoroffset),&cdloc);

    playcount = 0;
    playflag = 1;
    loopflag = 0;
    seeking_for_play = 1;
    playfadeuptime = 0;

    CdControlF(cdl_com=CdlSeekP, (u_char *)&cdloc);

    lastloc = loc[track];
    beginloc = lastloc;
    newloc = lastloc;

#endif
}

void psxcd_play(int track, int vol)//800408DC
{
    psxcd_play_at(track,vol,0);
}

void psxcd_seek_for_play_at(int track, int sectoroffset)//800408FC
{
#if _CD_VERSION_ == 1

    if(*(int *)&loc[track]==0)
    {
        return;
    }

    playflag = 0;
    loopflag = 0;
    seeking_for_play = 0;

    psxcd_set_audio_mode();

    CdIntToPos((CdPosToInt(&loc[track]) + sectoroffset),&cdloc);

    playcount = 0;
    playflag = 0;
    loopflag = 0;
    seeking_for_play = 1;
    CdControlF(cdl_com=CdlSeekP, (u_char *)&cdloc);

    lastloc = loc[track];
    beginloc = lastloc;
    newloc = lastloc;

#endif
}

void psxcd_seek_for_play(int track)//80040A10
{
    psxcd_seek_for_play_at(track, 0);
}

int psxcd_play_status(void)//80040A30
{
#if _CD_VERSION_ == 1
    if((cdl_com==CdlPlay)||(cdl_com==CdlSeekP))
    {
        check_intr = CdSync(1,(u_char *)check_result);
        if((check_intr==CdlDiskError) ||
           //(check_result[0] & !(CdlStatSeek|CdlStatPlay|CdlStatStandby)) || // This line of code are blocked in Psx Doom
           !(check_result[0] & CdlStatStandby))
        {
            CdFlush();
            cdl_errintr = check_intr + 90; //to give us unique error numbers
            cdl_errcom = cdl_com;
            cdl_errstat = check_result[0];
            cdl_errcount++;

            //report not playing
            return(0);
        }
        return(1);
    } else {
        return(0);
    }
#else
    return(0);
#endif
}

void psxcd_stop(void)//80040AC8
{
#if _CD_VERSION_ == 1

    playflag = 0; // ensure no SeekP callback activity
    loopflag = 0;
    seeking_for_play = 0;

    *(int *)&lastloc = 0;

    #if _CD_SPU_LINK_ == 1
     if(psxspu_get_cd_vol())
     {
         psxspu_start_cd_fade(FADE_TIME,0);
         while(psxspu_get_cd_fade_status());
     }
    #endif

    psxcd_sync();

    // pause seems to be better than stop here because
    // play is more stable after a pause
    waiting_for_pause = 1;
    CdControlF(cdl_com=CdlPause, 0);

#endif
}

void psxcd_pause(void)//80040B40
{
#if _CD_VERSION_ == 1

    playflag = 0; // ensure no SeekP callback activity
    seeking_for_play = 0;

    // this check is
    if(*(int *)&lastloc==0)
    {
        return;
    }

    lastloc = newloc;

    #if _CD_SPU_LINK_ == 1
    if(psxspu_get_cd_vol())
    {
         psxspu_start_cd_fade(FADE_TIME,0);
         while(psxspu_get_cd_fade_status());
    }
    #endif

    psxcd_sync();

    waiting_for_pause = 1;
    CdControlF(cdl_com=CdlPause, 0);

#endif
}

void psxcd_restart(int vol)//80040BE4
{
#if _CD_VERSION_ == 1

    if(*(int *)&lastloc==0)
    {
        return;
    }

    psxcd_set_audio_mode();

    playvol = vol;

    cdloc = lastloc;

    playcount = 0;
    playflag = 1;
    seeking_for_play = 1;
    CdControlF(cdl_com=CdlSeekP, (u_char *)&cdloc);

#endif
}

int psxcd_elapsed_sectors(void)//80040C6C
{
#if _CD_VERSION_ == 1
    if(*(int *)&beginloc==0)
    {
        return(0);
    }
    return(CdPosToInt(&newloc)-CdPosToInt(&beginloc));
#else
    return(0);
#endif
}

void psxcd_set_stereo(int stereo_true)//80040CC0
{
#if _CD_VERSION_ == 1
    if(stereo_true)
    {
        cdatv.val0 = 127;
        cdatv.val1 = 0;
        cdatv.val2 = 127;
        cdatv.val3 = 0;
    } else {
        cdatv.val0 = 63;
        cdatv.val1 = 63;
        cdatv.val2 = 63;
        cdatv.val3 = 63;
    }

    CdMix(&cdatv);
#endif
}




================================================
FILE: PSXDOOM/PSXCD.H
================================================
    /*------------------------------------------------------------------*/
    /*
                     Sony CD Architecture Specific Routines
                            by Scott Patterson

                     development and testing period on this code:
                            4/18/95 - 9/28/95
    */
    /*------------------------------------------------------------------*/

#ifndef _PSXCD_H
#define _PSXCD_H

    /*
        The following functions will pause for a short CD volume fade if
        the CD volume is not zero (and _CD_SPU_LINK_ == 1):

        psxcd_async_read()
        psxcd_read()
        psxcd_stop()
        psxcd_pause()

        To asyncronously fade the CD volume beforehand so these functions
        will not have any delays see comments in "psxspu.h"
    */

#include <sys\types.h>
#include <libcd.h>

#define _CD_VERSION_  1
#define _CD_SPU_LINK_ 1//para cd tracks
#define _CD_ABS_OPEN_ 1

#define PSXCD_SEEK_SET    0
#define PSXCD_SEEK_CUR    1
#define PSXCD_SEEK_END    2

#if _CD_VERSION_ == 0
 #include <libsn.h>
#endif

typedef struct PsxCd_File {
    CdlFILE       file;
    CdlLOC        new_io_loc;
    unsigned long io_block_offset;
    unsigned char io_result[8];
}PsxCd_File;

#if _CD_ABS_OPEN_ == 1

typedef struct PsxCd_MapTbl {
    int           abs;
    u_long        size;
}PsxCd_MapTbl;

extern PsxCd_MapTbl cdmaptbl[];

#endif

// CD-data read stuff
#define CD_ROM_SECTOR_SIZE 2048
#define SECTORS_PER_SECOND 75
#define SECONDS_PER_MINUTE 60

/*
    Asyncronous read function: psxcd_async_on()

    this function returns non-zero during asyncronous reading

    to code an asyncronous read:

    psxcd_async_read(destptr,readbytes,fileptr);

    // do your other shit here
    // (don't mess with the RAM you are reading to!)

    // to check for completion
    if(!psxcd_async_on())
    {
        // psxcd_async_read is complete
    }

    // to wait for completion:
    while(psxcd_async_on()); // wait for completion of psxcd_async_read
*/

extern int           psxcd_async_on(void);

/*
    CD-DA play seek variable: seeking_for_play

    after psxcd_seek_for_play(track) call is made

    this function returns non-zero until seeking is done
*/

extern int           psxcd_seeking_for_play(void);

/*
    CD-DA play stop/pause variable: waiting_for_pause

    after psxcd_stop/psxcd_pause call is made

    this function returns non-zero until pause operation is done
*/

extern int           psxcd_waiting_for_pause(void);

extern int           cdl_insetmode;
extern int           cdl_intr;
extern unsigned char cdl_stat;
extern unsigned char cdl_com;

extern int           cdl_errcount;
extern int           cdl_errintr;
extern unsigned char cdl_errstat;
extern unsigned char cdl_errcom;
extern int readcount;
extern int playcount;

// PSX CD-MODE1 DATA commands

extern void          psxcd_init(void);

extern void          psxcd_exit(void);

extern void          psxcd_disable_callbacks(void);

extern void          psxcd_enable_callbacks(void);

extern void          psxcd_set_data_mode(void);

extern PsxCd_File   *psxcd_open(char *filename);

extern void          psxcd_async_read_cancel(void);

extern int           psxcd_async_read(void *destptr,int readbytes,PsxCd_File *fileptr);

extern int           psxcd_read(void *destptr,int readbytes,PsxCd_File *fileptr);

extern int           psxcd_seek(PsxCd_File *fileptr,int seekpos,int seekmode);

extern unsigned long psxcd_tell(PsxCd_File *fileptr);

extern void          psxcd_close(PsxCd_File *fileptr);

// PSX CD-AUDIO commands

extern void psxcd_set_stereo(int stereo_true);

extern void psxcd_set_audio_mode(void);

extern void psxcd_seek_for_play(int track);

extern void psxcd_seek_for_play_at(int track,
                                   int sectoroffset);

extern void psxcd_play(int track, int vol);

extern void psxcd_play_at(int track,
                          int vol,
                          int sectoroffset);

extern void psxcd_set_loop_volume(int volforloop);

extern void psxcd_play_at_andloop(int track,
                                  int vol,
                                  int sectoroffset,
                                  int fadeuptime,
                                  int tracktoloop,
                                  int volforloop,
                                  int loopstartsectoroffset,
                                  int loopstartfadeuptime);

extern void psxcd_stop(void);

extern void psxcd_pause(void);

extern void psxcd_restart(int vol);

int psxcd_play_status(void);

int psxcd_elapsed_sectors(void);

// PSX low level CD extras

extern char sectorbuf[CD_ROM_SECTOR_SIZE];

extern void psxcd_init_pos(void);

#endif



================================================
FILE: PSXDOOM/PSXCDABS.C
================================================

PsxCd_MapTbl cdmaptbl[] = 
{
	{23,	68},
	{24,	907264},
	{469,	32768},
	{485,	32768},
	{501,	657392},
	{822,	3387200},
	{2272,	374784},
	{2455,	4806088},
	{4803,	28196},
	{4817,	58304},
	{4846,	54552},
	{4873,	46124},
	{4896,	44844},
	{4918,	61588},
	{4949,	55100},
	{4976,	24416},
	{4988,	590344},
	{5277,	538668},
	{5541,	539124},
	{5805,	599804},
	{6098,	542608},
	{6363,	540092},
	{6627,	610152},
	{6925,	569128},
	{7203,	90744},
	{7248,	98652},
	{7297,	87032},
	{7340,	89728},
	{7384,	96636},
	{7432,	102092},
	{7482,	94632},
	{7529,	89024},
	{7574,	23512},
	{7586,	47200},
	{7610,	37120},
	{7629,	58980},
	{7658,	41452},
	{7679,	41744},
	{7700,	40452},
	{7720,	13212},
	{7727,	681400},
	{8060,	538364},
	{8323,	839084},
	{8733,	712692},
	{9081,	815644},
	{9480,	849720},
	{9895,	851488},
	{10311,	560564},
	{10585,	115168},
	{10642,	64668},
	{10674,	117700},
	{10732,	96036},
	{10779,	114880},
	{10836,	100588},
	{10886,	118028},
	{10944,	75608},
	{10982,	26192},
	{10995,	34844},
	{11013,	37460},
	{11032,	67584},
	{11065,	44536},
	{11087,	54204},
	{11114,	16240},
	{11122,	25256},
	{11135,	655924},
	{11456,	754608},
	{11825,	711920},
	{12173,	609232},
	{12471,	947256},
	{12934,	698412},
	{13276,	783292},
	{13659,	503360},
	{13905,	94700},
	{13952,	99824},
	{14001,	90168},
	{14046,	113084},
	{14102,	119052},
	{14161,	101824},
	{14211,	93508},
	{14257,	122260},
	{14318,	36092},
	{14336,	55228},
	{14363,	38620},
	{14382,	71392},
	{14417,	79124},
	{14456,	70688},
	{14491,	23548},
	{14503,	30096},
	{14518,	658696},
	{14840,	811608},
	{15237,	617220},
	{15539,	713644},
	{15888,	690772},
	{16226,	658504},
	{16548,	303772},
	{16697,	453732},
	{16919,	120520},
	{16978,	95616},
	{17025,	134144},
	{17091,	138792},
	{17159,	115788},
	{17216,	107636},
	{17269,	111304},
	{17324,	99928},
	{17374,	34424},
	{17391,	31812},
	{17407,	54264},
	{17434,	61796},
	{17465,	12760},
	{17472,	40412},
	{17492,	46432},
	{17515,	64972},
	{17547,	536376},
	{17809,	540772},
	{18074,	786920},
	{18459,	781336},
	{18841,	563728},
	{19117,	891472},
	{19553,	925360},
	{20005,	726232},
	{20360,	92832},
	{20406,	79672},
	{20445,	95636},
	{20492,	101916},
	{20542,	67744},
	{20576,	135548},
	{20643,	109668},
	{20697,	108968},
	{20752,	56652},
	{20780,	53028},
	{20806,	89220},
	{20850,	54560},
	{20877,	77656},
	{20915,	54032},
	{20942,	93852},
	{20988,	28216},
	{21002,	748724},
	{21368,	808468},
	{21763,	581464},
	{22047,	842888},
	{22459,	677172},
	{22790,	809260},
	{23186,	617784},
	{23488,	881152},
	{23919,	131496},
	{23984,	135640},
	{24051,	113068},
	{24107,	128592},
	{24170,	135508},
	{24237,	137308},
	{24305,	127780},
	{24368,	148004},
	{24442,	35168},
	{24460,	32840},
	{24477,	53120},
	{24503,	59788},
	{24533,	64036},
	{24565,	22640},
	{24577,	9828},
	{24582,	40960},
	{24602,	536716},
	{24865,	861136},
	{25286,	813132},
	{25684,	738880},
	{26045,	763852},
	{26418,	898916},
	{26857,	418288},
	{27062,	601328},
	{27356,	131980},
	{27421,	145340},
	{27492,	161620},
	{27571,	128848},
	{27634,	155948},
	{27711,	106412},
	{27763,	50408},
	{27788,	86568},
	{27832,	30796},
	{27848,	91964},
	{27893,	37592},
	{27912,	32768},
	{27928,	32768},
	{27944,	32768},
	{27960,	32768},
	{27976,	32768},
	{27992,	688812},
	{28329,	661156},
	{28652,	417300},
	{28856,	32768},
	{28872,	32768},
	{28888,	32768},
	{28904,	32768},
	{28920,	32768},
	{28936,	117464},
	{28994,	131544},
	{29059,	124532},
	{29120,	32768},
	{29136,	32768},
	{29152,	32768},
	{29168,	32768},
	{29184,	32768},
	{29201,	177104},
	{29288,	55502},
	{29316,	61232},
	{29346,	77280},
	{29384,	103120},
	{29435,	111968},
	{29490,	73968},
	{29527,	104656},
	{29579,	85488},
	{29621,	71008},
	{29656,	83584},
	{29697,	93136},
	{29743,	92528},
	{29789,	67280},
	{29822,	120992},
	{29882,	136496},
	{29949,	103328},
	{30000,	116512},
	{30057,	101168},
	{30107,	104528},
	{30159,	116944},
	{30217,	121216},
	{30278,	143632},
	{30349,	143312},
	{30419,	143312},
	{30489,	168112},
	{30572,	143312},
	{30642,	143312},
	{30712,	184160},
	{30802,	131872},
	{30867,	199920},
	{30965,	158576},
	{31043,	229632},
	{31156,	202112},
	{31255,	226912},
	{31366,	242960},
	{31485,	236304},
	{31601,	134800},
	{31667,	202384},
	{31766,	219632},
	{31874,	202112},
	{31973,	155664},
	{32051,	247024},
	{32172,	170960},
	{32256,	137200},
	{32323,	160832},
	{32402,	199920},
	{32500,	219632},
	{32608,	181248},
	{32697,	199920},
	{32795,	181248},
	{32884,	206496},
	{32985,	111456},
	{33040,	143312},
	{33110,	143312},
	{33180,	143312},
	{33250,	199920},
	{33348,	222544},
	{33457,	122240},
	{33517,	158352},
	{33595,	240768},
	{33713,	209920},
	{33817,	189056},
	{33910,	236480},
	{34026,	164176},
	{34107,	219792},
	{34215,	161536},
	{34294,	219904},
	{34402,	182400},
	{34492,	226480},
	{34603,	160832},
	{34682,	250064},
	{34805,	209216},
	{34908,	199920},
	{35006,	222544},
	{35115,	89712},
	{35159,	80992},
	{35199,	168112},
	{35282,	120416},
	{35341,	206496},
	{35442,	69888},
	{35477,	425904},
	{0,	0}
};

================================================
FILE: PSXDOOM/PSXCDABS.H
================================================
#define _SYSTEM_CNF	0
#define _SLUS_000_77	1
#define _DEMO1_LMP	2
#define _DEMO2_LMP	3
#define _MAPSPR60_IMG	4
#define _MOVIE_STR	5
#define _PSXDOOM_EXE	6
#define _PSXDOOM_WAD	7
#define _MAP01_WAD	8
#define _MAP02_WAD	9
#define _MAP03_WAD	10
#define _MAP04_WAD	11
#define _MAP05_WAD	12
#define _MAP06_WAD	13
#define _MAP07_WAD	14
#define _MAP08_WAD	15
#define _MAPSPR01_IMG	16
#define _MAPSPR02_IMG	17
#define _MAPSPR03_IMG	18
#define _MAPSPR04_IMG	19
#define _MAPSPR05_IMG	20
#define _MAPSPR06_IMG	21
#define _MAPSPR07_IMG	22
#define _MAPSPR08_IMG	23
#define _MAPTEX01_IMG	24
#define _MAPTEX02_IMG	25
#define _MAPTEX03_IMG	26
#define _MAPTEX04_IMG	27
#define _MAPTEX05_IMG	28
#define _MAPTEX06_IMG	29
#define _MAPTEX07_IMG	30
#define _MAPTEX08_IMG	31
#define _MAP09_WAD	32
#define _MAP10_WAD	33
#define _MAP11_WAD	34
#define _MAP12_WAD	35
#define _MAP13_WAD	36
#define _MAP14_WAD	37
#define _MAP15_WAD	38
#define _MAP16_WAD	39
#define _MAPSPR09_IMG	40
#define _MAPSPR10_IMG	41
#define _MAPSPR11_IMG	42
#define _MAPSPR12_IMG	43
#define _MAPSPR13_IMG	44
#define _MAPSPR14_IMG	45
#define _MAPSPR15_IMG	46
#define _MAPSPR16_IMG	47
#define _MAPTEX09_IMG	48
#define _MAPTEX10_IMG	49
#define _MAPTEX11_IMG	50
#define _MAPTEX12_IMG	51
#define _MAPTEX13_IMG	52
#define _MAPTEX14_IMG	53
#define _MAPTEX15_IMG	54
#define _MAPTEX16_IMG	55
#define _MAP17_WAD	56
#define _MAP18_WAD	57
#define _MAP19_WAD	58
#define _MAP20_WAD	59
#define _MAP21_WAD	60
#define _MAP22_WAD	61
#define _MAP23_WAD	62
#define _MAP24_WAD	63
#define _MAPSPR17_IMG	64
#define _MAPSPR18_IMG	65
#define _MAPSPR19_IMG	66
#define _MAPSPR20_IMG	67
#define _MAPSPR21_IMG	68
#define _MAPSPR22_IMG	69
#define _MAPSPR23_IMG	70
#define _MAPSPR24_IMG	71
#define _MAPTEX17_IMG	72
#define _MAPTEX18_IMG	73
#define _MAPTEX19_IMG	74
#define _MAPTEX20_IMG	75
#define _MAPTEX21_IMG	76
#define _MAPTEX22_IMG	77
#define _MAPTEX23_IMG	78
#define _MAPTEX24_IMG	79
#define _MAP25_WAD	80
#define _MAP26_WAD	81
#define _MAP27_WAD	82
#define _MAP28_WAD	83
#define _MAP29_WAD	84
#define _MAP30_WAD	85
#define _MAP31_WAD	86
#define _MAP32_WAD	87
#define _MAPSPR25_IMG	88
#define _MAPSPR26_IMG	89
#define _MAPSPR27_IMG	90
#define _MAPSPR28_IMG	91
#define _MAPSPR29_IMG	92
#define _MAPSPR30_IMG	93
#define _MAPSPR31_IMG	94
#define _MAPSPR32_IMG	95
#define _MAPTEX25_IMG	96
#define _MAPTEX26_IMG	97
#define _MAPTEX27_IMG	98
#define _MAPTEX28_IMG	99
#define _MAPTEX29_IMG	100
#define _MAPTEX30_IMG	101
#define _MAPTEX31_IMG	102
#define _MAPTEX32_IMG	103
#define _MAP33_WAD	104
#define _MAP34_WAD	105
#define _MAP35_WAD	106
#define _MAP36_WAD	107
#define _MAP37_WAD	108
#define _MAP38_WAD	109
#define _MAP39_WAD	110
#define _MAP40_WAD	111
#define _MAPSPR33_IMG	112
#define _MAPSPR34_IMG	113
#define _MAPSPR35_IMG	114
#define _MAPSPR36_IMG	115
#define _MAPSPR37_IMG	116
#define _MAPSPR38_IMG	117
#define _MAPSPR39_IMG	118
#define _MAPSPR40_IMG	119
#define _MAPTEX33_IMG	120
#define _MAPTEX34_IMG	121
#define _MAPTEX35_IMG	122
#define _MAPTEX36_IMG	123
#define _MAPTEX37_IMG	124
#define _MAPTEX38_IMG	125
#define _MAPTEX39_IMG	126
#define _MAPTEX40_IMG	127
#define _MAP41_WAD	128
#define _MAP42_WAD	129
#define _MAP43_WAD	130
#define _MAP44_WAD	131
#define _MAP45_WAD	132
#define _MAP46_WAD	133
#define _MAP47_WAD	134
#define _MAP48_WAD	135
#define _MAPSPR41_IMG	136
#define _MAPSPR42_IMG	137
#define _MAPSPR43_IMG	138
#define _MAPSPR44_IMG	139
#define _MAPSPR45_IMG	140
#define _MAPSPR46_IMG	141
#define _MAPSPR47_IMG	142
#define _MAPSPR48_IMG	143
#define _MAPTEX41_IMG	144
#define _MAPTEX42_IMG	145
#define _MAPTEX43_IMG	146
#define _MAPTEX44_IMG	147
#define _MAPTEX45_IMG	148
#define _MAPTEX46_IMG	149
#define _MAPTEX47_IMG	150
#define _MAPTEX48_IMG	151
#define _MAP49_WAD	152
#define _MAP50_WAD	153
#define _MAP51_WAD	154
#define _MAP52_WAD	155
#define _MAP53_WAD	156
#define _MAP54_WAD	157
#define _MAP55_WAD	158
#define _MAP56_WAD	159
#define _MAPSPR49_IMG	160
#define _MAPSPR50_IMG	161
#define _MAPSPR51_IMG	162
#define _MAPSPR52_IMG	163
#define _MAPSPR53_IMG	164
#define _MAPSPR54_IMG	165
#define _MAPSPR55_IMG	166
#define _MAPSPR56_IMG	167
#define _MAPTEX49_IMG	168
#define _MAPTEX50_IMG	169
#define _MAPTEX51_IMG	170
#define _MAPTEX52_IMG	171
#define _MAPTEX53_IMG	172
#define _MAPTEX54_IMG	173
#define _MAPTEX55_IMG	174
#define _MAPTEX56_IMG	175
#define _MAP57_WAD	176
#define _MAP58_WAD	177
#define _MAP59_WAD	178
#define _MAP60_PAD	179
#define _MAP61_PAD	180
#define _MAP62_PAD	181
#define _MAP63_PAD	182
#define _MAP64_PAD	183
#define _MAPSPR57_IMG	184
#define _MAPSPR58_IMG	185
#define _MAPSPR59_IMG	186
#define _MAPSPR60_PAD	187
#define _MAPSPR61_PAD	188
#define _MAPSPR62_PAD	189
#define _MAPSPR63_PAD	190
#define _MAPSPR64_PAD	191
#define _MAPTEX57_IMG	192
#define _MAPTEX58_IMG	193
#define _MAPTEX59_IMG	194
#define _MAPTEX60_PAD	195
#define _MAPTEX61_PAD	196
#define _MAPTEX62_PAD	197
#define _MAPTEX63_PAD	198
#define _MAPTEX64_PAD	199
#define _DOOMSFX_LCD	200
#define _DOOMSND_WMD	201
#define _MUSLEV1_LCD	202
#define _MUSLEV10_LCD	203
#define _MUSLEV11_LCD	204
#define _MUSLEV12_LCD	205
#define _MUSLEV13_LCD	206
#define _MUSLEV14_LCD	207
#define _MUSLEV15_LCD	208
#define _MUSLEV16_LCD	209
#define _MUSLEV17_LCD	210
#define _MUSLEV18_LCD	211
#define _MUSLEV19_LCD	212
#define _MUSLEV2_LCD	213
#define _MUSLEV20_LCD	214
#define _MUSLEV3_LCD	215
#define _MUSLEV4_LCD	216
#define _MUSLEV5_LCD	217
#define _MUSLEV6_LCD	218
#define _MUSLEV7_LCD	219
#define _MUSLEV8_LCD	220
#define _MUSLEV9_LCD	221
#define _MAP01_LCD	222
#define _MAP02_LCD	223
#define _MAP03_LCD	224
#define _MAP04_LCD	225
#define _MAP05_LCD	226
#define _MAP06_LCD	227
#define _MAP07_LCD	228
#define _MAP08_LCD	229
#define _MAP09_LCD	230
#define _MAP10_LCD	231
#define _MAP11_LCD	232
#define _MAP12_LCD	233
#define _MAP13_LCD	234
#define _MAP14_LCD	235
#define _MAP15_LCD	236
#define _MAP16_LCD	237
#define _MAP17_LCD	238
#define _MAP18_LCD	239
#define _MAP19_LCD	240
#define _MAP20_LCD	241
#define _MAP21_LCD	242
#define _MAP22_LCD	243
#define _MAP23_LCD	244
#define _MAP24_LCD	245
#define _MAP25_LCD	246
#define _MAP26_LCD	247
#define _MAP27_LCD	248
#define _MAP28_LCD	249
#define _MAP29_LCD	250
#define _MAP30_LCD	251
#define _MAP31_LCD	252
#define _MAP32_LCD	253
#define _MAP33_LCD	254
#define _MAP34_LCD	255
#define _MAP35_LCD	256
#define _MAP36_LCD	257
#define _MAP37_LCD	258
#define _MAP38_LCD	259
#define _MAP39_LCD	260
#define _MAP40_LCD	261
#define _MAP41_LCD	262
#define _MAP42_LCD	263
#define _MAP43_LCD	264
#define _MAP44_LCD	265
#define _MAP45_LCD	266
#define _MAP46_LCD	267
#define _MAP47_LCD	268
#define _MAP48_LCD	269
#define _MAP49_LCD	270
#define _MAP50_LCD	271
#define _MAP51_LCD	272
#define _MAP52_LCD	273
#define _MAP53_LCD	274
#define _MAP54_LCD	275
#define _MAP55_LCD	276
#define _MAP56_LCD	277
#define _MAP57_LCD	278
#define _MAP58_LCD	279
#define _MAP59_LCD	280
#define _MAP60_LCD	281
#define MAX_ABS_FILES	282


================================================
FILE: PSXDOOM/PSXCMD.C
================================================
// Reconstruido por Erick Vasquez Garcia 16/05/2019 [GEC]
// Update_1 20/10/2019 [GEC]
// Update_2 32/01/2020 [GEC]

#include "wessseq.h"

void start_record_music_mute(NoteState *notestate);
void end_record_music_mute(void);
void add_music_mute_note(unsigned short seq_num, unsigned char track,
                  unsigned char keynum, unsigned char velnum,
                  patchmaps_header *patchmap, patchinfo_header *patchinfo);
void wess_set_mute_release(int newrate);
void TriggerPSXVoice(voice_status *voice_stat, unsigned char keynum, unsigned char velnum);

void PSX_DriverInit(master_status_structure *pm_stat);
void PSX_DriverExit (track_status *ptk_stat);
void PSX_DriverEntry1 (track_status *ptk_stat);
void PSX_DriverEntry2(track_status *ptk_stat);
void PSX_DriverEntry3(track_status *ptk_stat);
void PSX_TrkOff(track_status *ptk_stat);
void PSX_TrkMute(track_status *ptk_stat);
void PSX_PatchChg(track_status *ptk_stat);
void PSX_PatchMod(track_status *ptk_stat);
void PSX_PitchMod(track_status *ptk_stat);
void PSX_ZeroMod(track_status *ptk_stat);
void PSX_ModuMod(track_status *ptk_stat);
void PSX_VolumeMod(track_status *ptk_stat);
void PSX_PanMod(track_status *ptk_stat);
void PSX_PedalMod(track_status *ptk_stat);
void PSX_ReverbMod(track_status *ptk_stat);
void PSX_ChorusMod(track_status *ptk_stat);
void PSX_voiceon(voice_status *voice_stat, track_status *ptk_stat,
	           patchmaps_header *patchmaps, patchinfo_header *patchinfo,
	           unsigned char keynum, unsigned char velnum);
void PSX_voiceparmoff(voice_status *voice_stat);
void PSX_voicerelease(voice_status *voice_stat);
void PSX_voicenote(track_status *ptk_stat,
	           patchmaps_header *patchmap, patchinfo_header *patchinfo,
	           unsigned char keynum, unsigned char velnum);
void PSX_NoteOn(track_status *ptk_stat);
void PSX_NoteOff(track_status *ptk_stat);

void(*drv_cmds[19])() =
{
	PSX_DriverInit,         //0x0
	PSX_DriverExit,         //0x1
	PSX_DriverEntry1,       //0x2
	PSX_DriverEntry2,       //0x3
	PSX_DriverEntry3,       //0x4
	PSX_TrkOff,             //0x5
	PSX_TrkMute,            //0x6
	PSX_PatchChg,           //0x7
	PSX_PatchMod,           //0x8
	PSX_PitchMod,           //0x9
	PSX_ZeroMod,            //0xA
	PSX_ModuMod,            //0xB
	PSX_VolumeMod,          //0xC
	PSX_PanMod,             //0xD
	PSX_PedalMod,           //0xE
	PSX_ReverbMod,          //0xF
	PSX_ChorusMod,          //0x10
	PSX_NoteOn,             //0x11
	PSX_NoteOff             //0x12
};

extern unsigned char                skip_table[72];         //80075930

extern unsigned char	            master_sfx_volume;	    //80075834
extern unsigned char	            master_mus_volume;	    //80075835
extern unsigned char	            pan_status;			    //80075836
extern unsigned char	            release_rate;			//80075837

extern unsigned long	            voice_flags1;			//80075838
extern unsigned long	            voice_flags2;			//8007583C
extern NoteState		            *ptr_notestate;			//80075840
extern voice_status	                *ptr_pvoicestattbl;		//80075844
extern unsigned long	            priority;			    //80075848
extern unsigned long	            max_pabstime;           //8007584C

extern master_status_structure		*drv_pmsbase;			//8007EF88
extern sequence_status				*drv_pssbase;		    //8007EF8C
extern track_status				    *drv_ptsbase;		    //8007EF90
extern unsigned long				drv_hwvl;		        //8007EF98
extern patch_group_data			    *drv_ppgd;		        //8007EF9C
extern unsigned long				*drv_pcurabstime;		//8007EFA0
extern patches_header				*drv_patchesbase;		//8007EFA4
extern patchmaps_header			    *drv_patchmapsbase;		//8007EFA8
extern patchinfo_header			    *drv_samplesbase;		//8007EFAC
extern char						    *drv_drummapsbase;		//8007EFB0
extern SpuVoiceAttr				    drv_outattr;            //8007EFB4

extern unsigned char				drv_nvst;		        //8007EED0
extern unsigned char				drv_npti;               //8007EED4
extern unsigned long				drv_cnt;				//8007EED8
extern voice_status				    *drv_pvsbase;		    //8007EEDC

extern voice_status				    *drv_pcurvs;	        //8007EF94

extern unsigned char				drv_channels[24];		//8007f00C

extern void (**CmdFuncArr[10])(track_status *);
extern void(*DrvFunctions[36])();

//-----------------------------------------------------------
// Sound System
//-----------------------------------------------------------
void start_record_music_mute(NoteState *notestate)//L80045750()
{
    ptr_notestate = notestate;
    if (notestate != 0)
    {
        notestate->numnotes = 0;
    }
}

void end_record_music_mute(void)//L8004576C()
{
	ptr_notestate = 0;
}

void add_music_mute_note(unsigned short seq_num, unsigned char track,
                  unsigned char keynum, unsigned char velnum,
                  patchmaps_header *patchmap, patchinfo_header *patchinfo)//L8004577C()
{
	if (ptr_notestate != 0)
	{
		ptr_notestate->nd[ptr_notestate->numnotes].seq_num = seq_num;
		ptr_notestate->nd[ptr_notestate->numnotes].track = track;
		ptr_notestate->nd[ptr_notestate->numnotes].keynum = keynum;
		ptr_notestate->nd[ptr_notestate->numnotes].velnum = velnum;
		ptr_notestate->nd[ptr_notestate->numnotes].patchmap = patchmap;
		ptr_notestate->nd[ptr_notestate->numnotes].patchinfo = patchinfo;
		ptr_notestate->numnotes++;
	}
}

void wess_set_mute_release(int newrate)//L80045848()
{
    int maxrate;

    maxrate = 0x10000000;
    release_rate = 0x1f;
    while ((newrate < maxrate && (release_rate != 0)))
    {
        maxrate >>= 1;
        release_rate -= 1;
    }
    return;
}

extern unsigned long				drv_pitch1;				//L8007EEB8
extern unsigned long				drv_pitch2;				//L8007EEBC
extern unsigned long				drv_pitch3;				//L8007EEC0
extern unsigned long				drv_volume_1;			//L8007EEC4
extern track_status				    *drv_ptrk_stat;			//L8007EEC8
extern short				        drv_pan_1;				//L8007EECC

void TriggerPSXVoice(voice_status *voice_stat, unsigned char keynum, unsigned char velnum)//L8004587C()
{
	unsigned long volume;
	unsigned long pitch;

	drv_outattr.voice = 1 << (voice_stat->refindx & 31);
	drv_outattr.mask = (SPU_VOICE_VOLL | SPU_VOICE_VOLR | SPU_VOICE_NOTE | SPU_VOICE_SAMPLE_NOTE | SPU_VOICE_WDSA | SPU_VOICE_ADSR_ADSR1 | SPU_VOICE_ADSR_ADSR2);
    //printf("Voice pos %d\n",drv_outattr.voice);

	drv_ptrk_stat = (drv_ptsbase+voice_stat->track);

	if (drv_ptrk_stat->reverb != 0)
	{
		if (drv_channels[voice_stat->refindx] == 0)
		{
			SpuSetReverbVoice(SPU_ON, drv_outattr.voice);
			drv_channels[voice_stat->refindx] = 0x7f;
		}
	}
	else
	{
		if (drv_channels[voice_stat->refindx] != 0)
		{
			SpuSetReverbVoice(SPU_OFF, drv_outattr.voice);
			drv_channels[voice_stat->refindx] = 0;
		}
	}

	if (pan_status != 0)
	{
		drv_pan_1 = drv_ptrk_stat->pan_cntrl + voice_stat->patchmaps->pan - 0x40;

		if (drv_pan_1 < 0)      drv_pan_1 = 0;
        if (drv_pan_1 > 0x7F)	drv_pan_1 = 0x7F;
	}
	else
	{
		drv_pan_1 = 0x40;
	}

	//Volume
	if (drv_ptrk_stat->sndclass == SNDFX_CLASS)
	{
		volume = velnum * voice_stat->patchmaps->volume * drv_ptrk_stat->volume_cntrl * master_sfx_volume;
	}
	else
	{
		volume = velnum * voice_stat->patchmaps->volume * drv_ptrk_stat->volume_cntrl * master_mus_volume;
	}

	drv_volume_1 = volume >> 21;

	//Pan
	if (pan_status != 0)
	{
		if (pan_status != 1)//2
		{
			drv_outattr.volume.right = ((drv_volume_1 << 7) * (0x80 - drv_pan_1)) >> 7;
			drv_outattr.volume.left = ((drv_volume_1 << 7) * (drv_pan_1 + 1)) >> 7;
		}
		else//1
		{
			drv_outattr.volume.left = ((drv_volume_1 << 7) * (0x80 - drv_pan_1)) >> 7;
			drv_outattr.volume.right = ((drv_volume_1 << 7) * (drv_pan_1 + 1)) >> 7;
		}
	}
	else//0
	{
		drv_outattr.volume.left = drv_outattr.volume.right = drv_volume_1 << 6;
	}

	//Pitch
	if (drv_ptrk_stat->pitch_cntrl == 0)
    {
		drv_outattr.note = (voice_stat->keynum << 8);
	}
	else
	{
		if (drv_ptrk_stat->pitch_cntrl < 1)
		{
			pitch = drv_ptrk_stat->pitch_cntrl * voice_stat->patchmaps->pitchstep_min;

			drv_pitch1 = (32 - pitch);
			drv_pitch2 = (drv_pitch1 >> 13) + 1;
			drv_pitch3 = 0x80 - ((drv_pitch1 & 8191) >> 6);

			drv_outattr.note = (voice_stat->keynum - (drv_pitch2)) << 8 | drv_pitch3 & 0x7F;
		}
		else
		{
			pitch = drv_ptrk_stat->pitch_cntrl * voice_stat->patchmaps->pitchstep_max;

			drv_pitch1 = (32 + pitch);
			drv_pitch2 = (drv_pitch1 >> 13);
			drv_pitch3 = (drv_pitch1 & 8191) >> 6;

			drv_outattr.note = (voice_stat->keynum + (drv_pitch2)) << 8 | drv_pitch3 & 0x7F;
		}
	}

	drv_outattr.sample_note = (voice_stat->patchmaps->root_key << 8) | voice_stat->patchmaps->fine_adj;
	drv_outattr.addr = voice_stat->patchinfo->sample_pos;
	drv_outattr.adsr1 = voice_stat->patchmaps->adsr1;
	drv_outattr.adsr2 = voice_stat->patchmaps->adsr2;

	SpuSetKeyOnWithAttr(&drv_outattr);
}
//-----------------------------------------------------------
// Driver System
//-----------------------------------------------------------

void PSX_DriverInit(master_status_structure *pm_stat)//L80045CFC()
{
	char *pmem;

	//printf("PSX_DriverInit\n");

	drv_pmsbase = pm_stat;
	drv_pcurabstime = pm_stat->pabstime;
	drv_pssbase = pm_stat->pseqstattbl;
	drv_ptsbase = pm_stat->ptrkstattbl;
	drv_pvsbase = pm_stat->pvoicestattbl;
	drv_nvst = pm_stat->voices_total;

	drv_cnt = 0;

	if (drv_nvst != 0)
	{
		while (drv_cnt < drv_nvst)
		{
			if ((pm_stat->pvoicestattbl + drv_cnt)->patchtype == 1)
			{
				drv_pcurvs = (pm_stat->pvoicestattbl + drv_cnt);
				break;
			}
			drv_cnt++;
		}
	}

	drv_npti = drv_pmsbase->pmod_info->mod_hdr.patch_types_infile;

	drv_cnt = 0;
	if (drv_npti != 0)
	{
		while (drv_cnt < drv_npti)
		{
			if ((pm_stat->ppat_info + drv_cnt)->pat_grp_hdr.patch_id == 1)
			{
				drv_ppgd = (pm_stat->ppat_info + drv_cnt);
				break;
			}
			drv_cnt++;
		}
	}

	drv_hwvl = drv_ppgd->pat_grp_hdr.hw_voice_limit;

	pmem = drv_ppgd->ppat_data; /* pointer math temp */
	drv_patchesbase = (patches_header *)pmem;

	pmem += (drv_ppgd->pat_grp_hdr.patches * sizeof(patches_header));
	drv_patchmapsbase = (patchmaps_header *)pmem;

	pmem += (drv_ppgd->pat_grp_hdr.patchmaps * sizeof(patchmaps_header));
	drv_samplesbase = (patchinfo_header *)pmem;

	pmem += (drv_ppgd->pat_grp_hdr.patchinfo * sizeof(patchinfo_header));
	drv_drummapsbase = (char *)pmem;

	psxspu_init();

	drv_cnt = 0;
	do
	{
		drv_channels[drv_cnt] = 0x7F;
		drv_cnt++;
	} while (drv_cnt < 24);
}

void PSX_DriverExit (track_status *ptk_stat)//L80045F24()
{
    //printf("PSX_DriverExit\n");
	SpuQuit();
}

extern unsigned long		drv_vn;			    //8007EEE0
extern unsigned long		drv_vi;             //8007EEE4
extern unsigned long		drv_keychannels;    //8007EEE8
extern unsigned long		drv_keycnt;			//8007EEEC
extern voice_status		    *drv_pvs;			//8007EEF0
extern unsigned long		drv_voiceflag;      //8007EEF4
extern char				    drv_keysstatus[24]; //8007EFF4

void PSX_DriverEntry1 (track_status *ptk_stat)//L80045F44()
{
    //printf("PSX_DriverEntry1\n");
	drv_vn = drv_pmsbase->voices_active;

	if (drv_vn != 0)
	{
		drv_pvs = drv_pcurvs;
		drv_vi = drv_hwvl;

		while (drv_vi--)
		{
			if ((drv_pvs->flags & (VOICE_ACTIVE | VOICE_RELEASE)) == 3)
			{
				if (drv_pvs->pabstime < *drv_pcurabstime)
				{
					PSX_voiceparmoff(drv_pvs);
					if (!--drv_vn) break;
				}
			}
			drv_pvs++;
		}
	}

	drv_voiceflag = 0;
	if (voice_flags1 != 0)
	{
		drv_voiceflag = voice_flags1;
		voice_flags1 = 0;
	}

	if (voice_flags2 != 0)
	{
		drv_outattr.voice = voice_flags2;
		drv_outattr.mask = (SPU_VOICE_ADSR_RMODE | SPU_VOICE_ADSR_RR);
		drv_outattr.r_mode = SPU_VOICE_EXPDec;
		drv_outattr.rr = release_rate;
		SpuSetVoiceAttr(&drv_outattr);

		drv_voiceflag |= voice_flags2;
		voice_flags2 = 0;
	}

	if (drv_voiceflag != 0)
	{
		SpuSetKey(SPU_OFF, drv_voiceflag);
		drv_voiceflag = 0;
	}

	SpuGetAllKeysStatus(drv_keysstatus);

	drv_keychannels = 24;
	drv_keycnt = 0;
	drv_pvs = drv_pcurvs;
	while (drv_keychannels--)
	{
		if ((drv_pvs->flags & VOICE_ACTIVE) != 0)
		{
			if (drv_keysstatus[drv_keycnt] == 0)
			{
				PSX_voiceparmoff(drv_pvs);
			}
		}
		drv_pvs++;
		drv_keycnt++;
	}
}

void PSX_DriverEntry2(track_status *ptk_stat)//L800461F4()
{
    //printf("PSX_DriverEntry2\n");
}

void PSX_DriverEntry3(track_status *ptk_stat)//L800461FC()
{
    //printf("PSX_DriverEntry3\n");
}

extern sequence_status				*drv_pss;		//L8007EEF8

void PSX_TrkOff(track_status *ptk_stat)//L80046204()
{
    //printf("PSX_TrkOff\n");
	drv_pss = drv_pssbase + ptk_stat->seq_owner;
	PSX_TrkMute(ptk_stat);

	if (ptk_stat->voices_active != 0)
	{
		ptk_stat->flags |= (TRK_OFF | TRK_STOPPED);

		if (!drv_pss->tracks_playing--)
			drv_pss->playmode = SEQ_STATE_STOPPED;
	}
	else
	{
		Eng_TrkOff(ptk_stat);
	}
}

extern unsigned long				drv_vn_2;		    //L8007EEFC
extern unsigned long				drv_vi_2;		    //L8007EF00
extern voice_status				   *drv_pvs_2;			//L8007EF04
extern sequence_status			   *drv_pss_2;			//L8007EF08

void PSX_TrkMute(track_status *ptk_stat)//L800462B0()
{
    //printf("PSX_TrkMute\n");
	drv_vn_2 = ptk_stat->voices_active;

	if (drv_vn_2 != 0)
	{
		drv_pvs_2 = drv_pcurvs;
		drv_vi_2 = drv_hwvl;

		while (drv_vi_2--)
		{
			if (((drv_pvs_2->flags & VOICE_ACTIVE) != 0) && (drv_pvs_2->track == ptk_stat->refindx))
			{
                if (ptr_notestate != 0 && (!(drv_pvs_2->flags & VOICE_RELEASE) && (ptk_stat->sndclass == MUSIC_CLASS)))
                {
                  drv_pss_2 = (drv_pssbase + ptk_stat->seq_owner);
                  add_music_mute_note(drv_pss_2->seq_num,
                               drv_pvs_2->track,
                               drv_pvs_2->keynum,
                               drv_pvs_2->velnum,
                               drv_pvs_2->patchmaps,
                               drv_pvs_2->patchinfo);
                }
                drv_pvs_2->adsr2 = 0x10000000 >> (0x1f - (unsigned int)release_rate & 0x1f);
                PSX_voicerelease(drv_pvs_2);
                //printf("voice_stat->refindx %d\n",drv_pvs_2->refindx);

				voice_flags2 = 1 << (drv_pvs_2->refindx & 31) | voice_flags2;
				if (!--drv_vn_2) break;
			}

			drv_pvs_2++;
		}
	}
}

extern unsigned short				drv_thepatch;				//L8007EF0C

void PSX_PatchChg(track_status *ptk_stat)//L8004646C()
{
    //printf("PSX_PatchChg\n");
	drv_thepatch = (*(ptk_stat->ppos + 1) | (*(ptk_stat->ppos + 2) << 8));
	ptk_stat->patchnum = drv_thepatch;
}

void PSX_PatchMod(track_status *ptk_stat)//L80046494()
{
    //printf("PSX_PatchMod\n");
}

extern unsigned long				drv_voices_active_3;		//L8007EF10
extern unsigned long				drv_hwvl_3;		//L8007EF14
extern unsigned long				drv_pitch_1;				//L8007EF18
extern unsigned long				drv_pitch_2;				//L8007EF1C
extern unsigned long				drv_pitch_3;				//L8007EF20
extern voice_status				    *drv_voice_stat_3;			//L8007EF24
extern short				        drv_pitch_cntrl;			//L8007EF28

void PSX_PitchMod(track_status *ptk_stat)//L8004649C()
{
	unsigned long pitch;

	//printf("PSX_PitchMod\n");

	drv_pitch_cntrl = (*(ptk_stat->ppos + 1) | (*(ptk_stat->ppos + 2) << 8));
	if (ptk_stat->pitch_cntrl != drv_pitch_cntrl)
	{
		ptk_stat->pitch_cntrl = drv_pitch_cntrl;
		drv_voices_active_3 = ptk_stat->voices_active;

		if (drv_voices_active_3 != 0)
		{
			drv_voice_stat_3 = drv_pcurvs;
			drv_hwvl_3 = drv_hwvl;

			while (drv_hwvl_3--)
			{
                if ((drv_voice_stat_3->flags & VOICE_ACTIVE) && (drv_voice_stat_3->track == ptk_stat->refindx))
                {
                    drv_outattr.voice = 1 << (drv_voice_stat_3->refindx & 31);
                    drv_outattr.mask = (SPU_VOICE_NOTE);

                    if (ptk_stat->pitch_cntrl != 0)
                    {
                        if (ptk_stat->pitch_cntrl <= 0)
                        {
                            pitch = ptk_stat->pitch_cntrl * drv_voice_stat_3->patchmaps->pitchstep_min;

                            drv_pitch_1 = (32 - pitch);
                            drv_pitch_2 = (drv_pitch_1 >> 13) + 1;
                            drv_pitch_3 = 0x80 - ((drv_pitch_1 & 8191) >> 6);

                            drv_outattr.note = (drv_voice_stat_3->keynum - (drv_pitch_2)) << 8 | drv_pitch_3 & 0x7F;
                        }
                        else
                        {
                            pitch = ptk_stat->pitch_cntrl * drv_voice_stat_3->patchmaps->pitchstep_max;

                            drv_pitch_1 = (32 + pitch);
                            drv_pitch_2 = (drv_pitch_1 >> 13);
                            drv_pitch_3 = (drv_pitch_1 & 8191) >> 6;

                            drv_outattr.note = (drv_voice_stat_3->keynum + (drv_pitch_2)) << 8 | drv_pitch_3 & 0x7F;
                        }
                    }
                    else
                    {
                        drv_outattr.note = (drv_voice_stat_3->keynum << 8);
                    }

                    SpuSetVoiceAttr(&drv_outattr);

                    if (!--drv_voices_active_3) break;
                }

				drv_voice_stat_3++;
			}
		}
	}
}

void PSX_ZeroMod(track_status *ptk_stat)//L800466EC()
{
    //printf("PSX_ZeroMod\n");
}

void PSX_ModuMod(track_status *ptk_stat)//L800466f4()
{
    //printf("PSX_ModuMod\n");
}

extern unsigned long				drv_voices_active_4;		//L8007EF2C
extern unsigned long				drv_hwvl_4;		//L8007EF30
extern unsigned long				drv_volume_2;				//L8007EF34
extern voice_status				    *drv_voice_stat_4;			//L8007EF38
extern short				        drv_pan_2;					//L8007EF3C

void PSX_VolumeMod(track_status *ptk_stat)//L800466FC()
{
	unsigned long volume;
	//printf("PSX_VolumeMod\n");
	ptk_stat->volume_cntrl = *(ptk_stat->ppos + 1);

	drv_voices_active_4 = ptk_stat->voices_active;
	if (drv_voices_active_4 != 0)
	{
		drv_voice_stat_4 = drv_pcurvs;
		drv_hwvl_4 = drv_hwvl;

		while (drv_hwvl_4--)
		{
			if ((drv_voice_stat_4->flags & VOICE_ACTIVE) && (drv_voice_stat_4->track == ptk_stat->refindx))
			{
				if (pan_status == 0)
				{
					drv_pan_2 = 0x40;
				}
				else
				{
					drv_pan_2 = ptk_stat->pan_cntrl + drv_voice_stat_4->patchmaps->pan - 0x40;

					if (drv_pan_2 < 0)      drv_pan_2 = 0;
					if (drv_pan_2 > 0x7F)	drv_pan_2 = 0x7F;
				}

				if (ptk_stat->sndclass == SNDFX_CLASS)
				{
					volume = drv_voice_stat_4->velnum * drv_voice_stat_4->patchmaps->volume * ptk_stat->volume_cntrl * master_sfx_volume;
				}
				else
				{
					volume = drv_voice_stat_4->velnum * drv_voice_stat_4->patchmaps->volume * ptk_stat->volume_cntrl * master_mus_volume;
				}

				drv_volume_2 = volume >> 21;

				drv_outattr.voice = 1 << (drv_voice_stat_4->refindx & 31);
				drv_outattr.mask = (SPU_VOICE_VOLL | SPU_VOICE_VOLR);

				if (pan_status != 0)
				{
					if (pan_status != 1)//2
					{
						drv_outattr.volume.right = ((drv_volume_2 << 7) * (0x80 - drv_pan_2)) >> 7;
						drv_outattr.volume.left  = ((drv_volume_2 << 7) * (drv_pan_2 + 1)) >> 7;
					}
					else//1
					{
						drv_outattr.volume.left  = ((drv_volume_2 << 7) * (0x80 - drv_pan_2)) >> 7;
						drv_outattr.volume.right = ((drv_volume_2 << 7) * (drv_pan_2 + 1)) >> 7;
					}
				}
				else//0
				{
					drv_outattr.volume.left = drv_outattr.volume.right = drv_volume_2 << 6;
				}

				SpuSetVoiceAttr(&drv_outattr);

				if (!--drv_voices_active_4) break;
			}

			drv_voice_stat_4++;
		}
	}
}

extern unsigned long				drv_voices_active_5;		//L8007EF40
extern unsigned long				drv_hwvl_5;		//L8007EF44
extern unsigned long				drv_volume_3;				//L8007EF48
extern voice_status				    *drv_voice_stat_5;			//L8007EF4C
extern short				        drv_pan_3;					//L8007EF50

void PSX_PanMod(track_status *ptk_stat)//L80046A14()
{
	unsigned long volume;
	//printf("PSX_PanMod\n");

	ptk_stat->pan_cntrl = *(ptk_stat->ppos + 1);

	if (pan_status != 0)
	{
		drv_voices_active_5 = ptk_stat->voices_active;

		if (drv_voices_active_5 != 0)
		{
			drv_voice_stat_5 = drv_pcurvs;
			drv_hwvl_5 = drv_hwvl;

			while (drv_hwvl_5--)
			{
				if ((drv_voice_stat_5->flags & VOICE_ACTIVE) && (drv_voice_stat_5->track == ptk_stat->refindx))
				{
					drv_pan_3 = ptk_stat->pan_cntrl + drv_voice_stat_5->patchmaps->pan - 0x40;

					if (drv_pan_3 < 0)      drv_pan_3 = 0;
                    if (drv_pan_3 > 0x7F)	drv_pan_3 = 0x7F;

					if (ptk_stat->sndclass == SNDFX_CLASS)
					{
						volume = drv_voice_stat_5->velnum * drv_voice_stat_5->patchmaps->volume * ptk_stat->volume_cntrl * master_sfx_volume;
					}
					else
					{
						volume = drv_voice_stat_5->velnum * drv_voice_stat_5->patchmaps->volume * ptk_stat->volume_cntrl * master_mus_volume;
					}

					drv_volume_3 = volume >> 21;

					drv_outattr.voice = 1 << (drv_voice_stat_5->refindx & 31);
					drv_outattr.mask = (SPU_VOICE_VOLL | SPU_VOICE_VOLR);

					if (pan_status != 1)//2
					{
						drv_outattr.volume.right = ((drv_volume_3 << 7) * (0x80 - drv_pan_3)) >> 7;
						drv_outattr.volume.left = ((drv_volume_3 << 7) * (drv_pan_3 + 1)) >> 7;
					}
					else//1
					{
						drv_outattr.volume.left = ((drv_volume_3 << 7) * (0x80 - drv_pan_3)) >> 7;
						drv_outattr.volume.right = ((drv_volume_3 << 7) * (drv_pan_3 + 1)) >> 7;
					}

					SpuSetVoiceAttr(&drv_outattr);

					if (!--drv_voices_active_5) break;
				}

				drv_voice_stat_5++;
			}
		}
	}
}

//PSX_PedalMod
void PSX_PedalMod(track_status *ptk_stat)//L80046CF0()
{
    //printf("PSX_PedalMod\n");
}

//PSX_ReverbMod
void PSX_ReverbMod(track_status *ptk_stat)//L80046CF8()
{
    //printf("PSX_ReverbMod\n");
}

//PSX_ChorusMod
void PSX_ChorusMod(track_status *ptk_stat)//L80046D00()
{
    //printf("PSX_ChorusMod\n");
}

void PSX_voiceon(voice_status *voice_stat, track_status *ptk_stat,
	           patchmaps_header *patchmaps, patchinfo_header *patchinfo,
	           unsigned char keynum, unsigned char velnum)//L80046D08()
{
	int adsr2;
	//printf("PSX_voiceon\n");

	voice_stat->flags = (voice_stat->flags | VOICE_ACTIVE) & ~VOICE_RELEASE;
	voice_stat->track = ptk_stat->refindx;
	voice_stat->keynum = keynum;
	voice_stat->velnum = velnum;
	voice_stat->sndtype = 0;//no used??
	voice_stat->priority = ptk_stat->priority;
	voice_stat->patchmaps = patchmaps;
	voice_stat->patchinfo = patchinfo;
	voice_stat->pabstime = *drv_pcurabstime;

    if (!(patchmaps->adsr2 & 0x20))
    {
        adsr2 = 0x5dc0000;
    }
    else
    {
        adsr2 = 0x10000000;
    }
    voice_stat->adsr2 = adsr2 >> (0x1f - ((unsigned int)patchmaps->adsr2 & 0x1f) & 0x1f);

	ptk_stat->voices_active++;
	drv_pmsbase->voices_active++;

	TriggerPSXVoice(voice_stat, keynum, velnum);//TriggerPSXVoice
}


extern track_status				*drv_ptrk_stat_1;			//L8007EF54

void PSX_voiceparmoff(voice_status *voice_stat)//L80046DDC()
{
    //printf("PSX_voiceparmoff\n");
	drv_ptrk_stat_1 = (drv_ptsbase + voice_stat->track);

	drv_pmsbase->voices_active--;
	drv_ptrk_stat_1->voices_active--;

	if ((drv_ptrk_stat_1->voices_active == 0) && (drv_ptrk_stat_1->flags & TRK_OFF))
	{
        Eng_TrkOff(drv_ptrk_stat_1);
	}

	voice_stat->flags &= ~(VOICE_ACTIVE|VOICE_RELEASE);
}

void PSX_voicerelease(voice_status *voice_stat)//L80046EA4()
{
    //printf("PSX_voicerelease\n");
	voice_flags1 = 1 << (voice_stat->refindx & 31) | voice_flags1;
	voice_stat->flags |= VOICE_RELEASE;
	voice_stat->pabstime = *drv_pcurabstime + voice_stat->adsr2;
}


extern unsigned long				drv_hwvl_6;		//L8007EF58
extern unsigned long				drv_note_stat;				//L8007EF5C
extern voice_status				*drv_voice_stat_6;			//L8007EF60

void PSX_voicenote(track_status *ptk_stat,
	           patchmaps_header *patchmap, patchinfo_header *patchinfo,
	           unsigned char keynum, unsigned char velnum)//L80046EF0()
{
    //printf("PSX_voicenote\n");
	drv_note_stat = 0;
	drv_hwvl_6 = drv_hwvl;
	drv_voice_stat_6 = drv_pcurvs;

    while (drv_hwvl_6--)
    {
        if ((drv_voice_stat_6->flags & VOICE_ACTIVE) == 0)
        {
          PSX_voiceon(drv_voice_stat_6, ptk_stat, patchmap, patchinfo, keynum, velnum);
          drv_note_stat = 0;
          break;
        }
        if (drv_voice_stat_6->priority <= ptk_stat->priority)
        {
          if (priority <= drv_voice_stat_6->priority)
          {
            if ((drv_voice_stat_6->flags & VOICE_RELEASE) == 0)
            {
              if ((ptr_pvoicestattbl->flags & VOICE_RELEASE) != 0) goto next_voice;
            }
            else
            {
              if ((ptr_pvoicestattbl->flags & VOICE_RELEASE) == 0) goto set_note_stat;
            }
            if (max_pabstime <= drv_voice_stat_6->pabstime) goto next_voice;
          }

    set_note_stat:
          drv_note_stat = 1;
          priority = drv_voice_stat_6->priority;
          max_pabstime = drv_voice_stat_6->pabstime;
          ptr_pvoicestattbl = drv_voice_stat_6;
        }

    next_voice:
        drv_voice_stat_6++;
    }

    if (drv_note_stat != 0)
    {
        PSX_voiceparmoff(ptr_pvoicestattbl);
        PSX_voiceon(ptr_pvoicestattbl,ptk_stat,patchmap,patchinfo,keynum,velnum);
    }
}

extern unsigned long				drv_patch_cnt;				//L8007EF64
extern unsigned char				drv_byte01;					//L8007EF68
extern unsigned char				drv_byte02;					//L8007EF6C
extern unsigned char				drv_patchmap_cnt;			//L8007EF70
extern patches_header				*drv_patch_1;				//L8007EF74
extern patchmaps_header			    *drv_patchmap_1;			//L8007EF78
extern patchinfo_header			    *drv_samplesbase_1;			//L8007EF7C

void PSX_NoteOn(track_status *ptk_stat)//L80047104()
{
	char *drummaps;
	//printf("PSX_NoteOn\n");

	drv_byte01 = *(ptk_stat->ppos + 1);
	drv_byte02 = *(ptk_stat->ppos + 2);

	if (ptk_stat->sndclass == DRUMS_CLASS)
	{
		drummaps = (drv_drummapsbase + (drv_byte01 * sizeof(long)));
		drv_patch_1 = drv_patchesbase + *(unsigned short*)(drummaps);
		drv_byte01 = *(drummaps + sizeof(short));
	}
	else
	{
		drv_patch_1 = drv_patchesbase+ptk_stat->patchnum;
	}

	drv_patch_cnt = 0;
	drv_patchmap_cnt = (char) drv_patch_1->patchmap_cnt;

	while (drv_patchmap_cnt--)
	{
		drv_patchmap_1 = drv_patchmapsbase + (drv_patch_1->patchmap_idx + drv_patch_cnt);
		drv_samplesbase_1 = drv_samplesbase + drv_patchmap_1->sample_id;

		if (drv_samplesbase_1->sample_pos != 0)
		{
			if (drv_patchmap_1->note_min <= drv_byte01)
			{
				if (drv_byte01 <= drv_patchmap_1->note_max)
				{
					PSX_voicenote(ptk_stat,drv_patchmap_1,
                   drv_samplesbase_1,drv_byte01,drv_byte02);
				}
			}
		}

		drv_patch_cnt++;
	}
}

extern unsigned long			drv_hwvl_7;		    //L8007EF80
extern voice_status				*drv_voice_stat_7;  //L8007EF84

void PSX_NoteOff(track_status *ptk_stat)//L800472E8()
{
    //printf("PSX_NoteOff\n");
	drv_voice_stat_7 =
	drv_pcurvs;
	drv_hwvl_7 = drv_hwvl;

	while (drv_hwvl_7--)
	{
		if (((drv_voice_stat_7->flags & (VOICE_ACTIVE|VOICE_RELEASE)) == VOICE_ACTIVE) &&
			(drv_voice_stat_7->keynum == *(ptk_stat->ppos + 1)) &&
			(drv_voice_stat_7->track == ptk_stat->refindx))
		{
			PSX_voicerelease(drv_voice_stat_7);
		}

		drv_voice_stat_7++;
	}
}


================================================
FILE: PSXDOOM/PSXDOOM.cbp
================================================
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
	<FileVersion major="1" minor="6" />
	<Project>
		<Option title="PSXDOOM" />
		<Option pch_mode="2" />
		<Option compiler="null" />
		<Build>
			<Target title="Release">
				<Option output="bin/Release/PSXDOOM" prefix_auto="1" extension_auto="1" />
				<Option object_output="obj/Release/" />
				<Option type="1" />
				<Option compiler="null" />
			</Target>
		</Build>
		<Unit filename="LCDLOAD.C">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="LCDLOAD.H" />
		<Unit filename="MAIN.LNK" />
		<Unit filename="MAKEFILE.bat" />
		<Unit filename="PSXCD.C">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="PSXCD.H" />
		<Unit filename="PSXCDABS.C">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="PSXCDABS.H" />
		<Unit filename="PSXCMD.C">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="PSXSPU.C">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="PSXSPU.H" />
		<Unit filename="PSX_FILE.C">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="SEQLOAD.C">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="SEQLOAD.H" />
		<Unit filename="SEQLOADR.C">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="WESSAPI.C">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="WESSAPI.H" />
		<Unit filename="WESSAPIM.C">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="WESSAPIP.C">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="WESSAPIT.C">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="WESSARC.C">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="WESSARC.H" />
		<Unit filename="WESSBASE.C">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="WESSSEQ.C">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="WESSSEQ.H" />
		<Unit filename="am_main.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="c_main.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="cf_main.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="d_main.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="doomdata.h" />
		<Unit filename="doomdef.h" />
		<Unit filename="f_main.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="g_game.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="in_main.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="info.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="info.h" />
		<Unit filename="l_main.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="m_fixed.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="m_fixed.s" />
		<Unit filename="m_main.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="m_password.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="o_main.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="p_base.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="p_ceilng.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="p_change.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="p_doors.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="p_enemy.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="p_floor.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="p_inter.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="p_lights.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="p_local.h" />
		<Unit filename="p_map.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="p_maputl.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="p_mobj.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="p_move.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="p_plats.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="p_pspr.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="p_setup.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="p_shoot.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="p_sight.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="p_slide.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="p_spec.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="p_spec.h" />
		<Unit filename="p_switch.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="p_telept.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="p_tick.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="p_user.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="psxmain.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="psxmain.s" />
		<Unit filename="pw_main.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="r_data.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="r_local.h" />
		<Unit filename="r_main.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="r_phase1.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="r_phase2.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="s_sound.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="snmain.s" />
		<Unit filename="sound.h" />
		<Unit filename="sounds.h" />
		<Unit filename="sprinfo.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="st_main.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="st_main.h" />
		<Unit filename="t_main.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="tables.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="vsprintf.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="w_wad.c">
			<Option compilerVar="CC" />
		</Unit>
		<Unit filename="z_zone.c">
			<Option compilerVar="CC" />
		</Unit>
		<Extensions>
			<code_completion />
			<envvars />
			<debugger />
			<lib_finder disable_auto="1" />
		</Extensions>
	</Project>
</CodeBlocks_project_file>


================================================
FILE: PSXDOOM/PSXDOOM.layout
================================================
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_layout_file>
	<FileVersion major="1" minor="0" />
	<ActiveTarget name="Release" />
</CodeBlocks_layout_file>


================================================
FILE: PSXDOOM/PSXSPU.C
================================================
// Reconstruido por Erick Vasquez Garcia 16/05/2019 [GEC]
// Update_1 20/10/2019 [GEC]
// Update_2 31/01/2020 [GEC]

#include <libspu.h>
#include "psxspu.h"
#include "wessapi.h"

extern void SpuSetCommonAttr (SpuCommonAttr *attr);

#define MALLOC_MAX 1
extern char spu_malloc_rec[SPU_MALLOC_RECSIZ * (MALLOC_MAX + 1)];

extern unsigned int psxspu_initialized;
extern unsigned int psxspu_status;
extern unsigned long end_of_sram;

extern int psxspu_master_vol;
extern int psxspu_master_fadecount;
extern int psxspu_master_vol_fixed;
extern int psxspu_master_destvol;
extern int psxspu_master_changeval;

extern int psxspu_cd_vol;
extern int psxspu_cd_fadecount;
extern int psxspu_cd_vol_fixed;
extern int psxspu_cd_destvol;
extern int psxspu_cd_changeval;

extern SpuReverbAttr rev_attr;//8007EEA4

unsigned long SpuGetReverbOffsetAddr[10] = // equivale a la función SpuGetReverbOffsetAddr()
{
    520192, 514368, 516288, 505792, 495648,
    479776, 461120, 425920, 425920, 508928
};

#define END_O_SRAM 520192
void psxspu_init_reverb(long  rev_mode, short depthleft, short depthright, long  delay, long  feedback)//80045098
{
    psxspu_status = 0;

    rev_attr.mask = (SPU_REV_MODE|SPU_REV_DEPTHL|SPU_REV_DEPTHR|SPU_REV_DELAYTIME|SPU_REV_FEEDBACK);
    rev_attr.mode = rev_mode | SPU_REV_MODE_CLEAR_WA;
    rev_attr.depth.left = depthleft;
    rev_attr.depth.right = depthright;
    rev_attr.delay = delay;
    rev_attr.feedback = feedback;

    SpuSetReverbModeParam (&rev_attr);
    SpuSetReverbDepth (&rev_attr);

    if(rev_mode == PSXSPU_REV_MODE_OFF)
    {
        SpuSetReverb(SPU_OFF);
        end_of_sram = END_O_SRAM;
    }
    else
    {
        SpuSetReverb(SPU_ON);
        end_of_sram = SpuGetReverbOffsetAddr[rev_mode];//SpuGetReverbOffsetAddr();
    }

    SpuSetReverbVoice((rev_mode != PSXSPU_REV_MODE_OFF), SPU_ALLCH);
    psxspu_status = 1;

    //printf("End_Of_Sram %d\n", end_of_sram);
}

void psxspu_set_reverb_depth(short depthleft,short depthright)//80045178
{
    psxspu_status = 0;
    rev_attr.depth.left = depthleft;
	rev_attr.depth.right = depthright;
	SpuSetReverbDepth(&rev_attr);
	psxspu_status = 1;

}

void psxspu_init(void)//800451c0
{
    SpuCommonAttr com_attr;

    if (psxspu_initialized == 0)
	{
	    //printf("psxspu_init\n");
		psxspu_status = 0;
		psxspu_initialized = 1;

		SpuInit();
		SpuInitMalloc(MALLOC_MAX, spu_malloc_rec);
		SpuSetTransMode(SpuTransferByDMA);

		psxspu_init_reverb(0, 0, 0, 0, 0);

		com_attr.mask = (SPU_COMMON_MVOLL | SPU_COMMON_MVOLR | SPU_COMMON_CDVOLL | SPU_COMMON_CDVOLR | SPU_COMMON_CDVOLR| SPU_COMMON_CDREV | SPU_COMMON_CDMIX);
		com_attr.mvol.left = MAX_MASTER_VOL;
		com_attr.mvol.right = MAX_MASTER_VOL;
		com_attr.cd.volume.left = MAX_CD_VOL;
		com_attr.cd.volume.right = MAX_CD_VOL;
		com_attr.cd.reverb = 0;
		com_attr.cd.mix = 1;
		SpuSetCommonAttr(&com_attr);
		psxspu_status = 1;
	}
}

void psxspu_set_master_volume(int vol)//8004526C
{
    SpuCommonAttr com_attr;

    psxspu_status = 0;
    com_attr.mvol.left = vol;
	com_attr.mvol.right = vol;
	com_attr.mask = (SPU_COMMON_MVOLL | SPU_COMMON_MVOLR);
	SpuSetCommonAttr(&com_attr);
	psxspu_status = 1;
}

void psxspu_set_cd_volume(int vol)//800452B0
{
    SpuCommonAttr com_attr;

    psxspu_status = 0;
    com_attr.cd.volume.left = vol;
	com_attr.cd.volume.right = vol;
	com_attr.mask = (SPU_COMMON_CDVOLL | SPU_COMMON_CDVOLR);
	SpuSetCommonAttr(&com_attr);
	psxspu_status = 1;
}

void psxspu_setcdmixon(void)//800452F4
{
    SpuCommonAttr com_attr;

    psxspu_status = 0;
	com_attr.mask = (SPU_COMMON_CDMIX);
	com_attr.cd.mix = 1;
	SpuSetCommonAttr(&com_attr);
	psxspu_status = 1;
}

void psxspu_setcdmixoff(void)//8004533C
{
    SpuCommonAttr com_attr;

    psxspu_status = 0;
	com_attr.mask = (SPU_COMMON_CDMIX);
	com_attr.cd.mix = 0;
	SpuSetCommonAttr(&com_attr);
	psxspu_status = 1;
}

void psxspu_fadeengine(void)//8004537C
{
    if (psxspu_status != 0)
	{
		if (psxspu_cd_fadecount > 0)
		{
			psxspu_cd_fadecount -= 1;
			psxspu_cd_vol_fixed += psxspu_cd_changeval;

			if (psxspu_cd_fadecount == 0)
				psxspu_cd_vol_fixed = psxspu_cd_destvol;

			psxspu_cd_vol = psxspu_cd_vol_fixed >> 16;

			psxspu_set_cd_volume(psxspu_cd_vol);
		}

		if (psxspu_master_fadecount > 0)
		{
			psxspu_master_fadecount -= 1;
			psxspu_master_vol_fixed += psxspu_master_changeval;

			if (psxspu_master_fadecount == 0)
				psxspu_master_vol_fixed = psxspu_master_destvol;

			psxspu_master_vol = psxspu_master_vol_fixed >> 16;
			psxspu_set_master_volume(psxspu_master_vol);
		}
	}
}

void psxspu_set_cd_vol(int vol)//80045490
{
    psxspu_status = 0;
    psxspu_cd_vol = vol;
	psxspu_cd_vol_fixed = psxspu_cd_vol << 16;
	psxspu_cd_fadecount = 0;
	psxspu_set_cd_volume(psxspu_cd_vol);
	psxspu_status = 1;
}

int  psxspu_get_cd_vol(void)//800454EC
{
    return psxspu_cd_vol;
}

void psxspu_start_cd_fade(int msec, int destvol)//800454FC
{
    psxspu_status = 0;
    if (WessTimerActive == 0)
    {
        psxspu_cd_fadecount = 0;
    }
    else
    {
        psxspu_cd_destvol = destvol * 0x10000;
        psxspu_cd_fadecount = (msec * 0x78) / 1000 + 1;
        psxspu_cd_changeval = (psxspu_cd_destvol - psxspu_cd_vol_fixed) / psxspu_cd_fadecount;
    }
    psxspu_status = 1;
}

void psxspu_stop_cd_fade(void)//800455B4
{
    psxspu_status = 0;
	psxspu_cd_fadecount = 0;
	psxspu_status = 1;
}

int  psxspu_get_cd_fade_status(void)//800455D8
{
    return (psxspu_cd_fadecount < 2) ^ 1;
}

void psxspu_set_master_vol(int vol)//800455F0
{
    psxspu_status = 0;
    psxspu_master_vol = vol;
	psxspu_master_vol_fixed = psxspu_master_vol << 16;
	psxspu_master_fadecount = 0;
	psxspu_set_master_volume(psxspu_master_vol);
	psxspu_status = 1;
}

int  psxspu_get_master_vol(void)//8004564C
{
    return psxspu_master_vol;
}

void psxspu_start_master_fade(int msec, int destvol)//8004565C
{
    psxspu_status = 0;
	if (WessTimerActive == 0)
    {
        psxspu_master_fadecount = 0;
    }
    else
    {
        psxspu_master_destvol = destvol * 0x10000;
        psxspu_master_fadecount = (msec * 0x78) / 1000 + 1;
        psxspu_master_changeval = (psxspu_master_destvol - psxspu_master_vol_fixed) / psxspu_master_fadecount;
    }
    psxspu_status = 1;
}

void psxspu_stop_master_fade(void)//80045714
{
    psxspu_status = 0;
	psxspu_master_fadecount = 0;
	psxspu_status = 1;
}

int  psxspu_get_master_fade_status(void)//80045738
{
    return (psxspu_master_fadecount < 2) ^ 1;
}


================================================
FILE: PSXDOOM/PSXSPU.H
================================================

    /*------------------------------------------------------------------*/
    /*
                     Williams Entertainment Sound System
                            by Scott Patterson

                     PSX SPU Volume and Reverb controls.
    */
    /*------------------------------------------------------------------*/

#ifndef _PSXSPU_H
#define _PSXSPU_H

#define FADE_TIME 250

    /*
        Notes on fade calls:

        To do a syncronous fade to zero volume:

            psxspu_start_cd_fade(FADE_TIME,0);
            while(psxspu_get_cd_fade_status());

        To do an asyncronous fade to zero volume:

            psxspu_start_cd_fade(FADE_TIME,0);
            .
            .
            .
            if(!psxspu_get_cd_fade_status())
            {
                //fade is now done
            }
    */

#define MAX_MASTER_VOL 0x3fff
#define MAX_CD_VOL    0x3cff
#define MED_CD_VOL    0x2fff
#define MIN_CD_VOL    0x1fff

#define SRAM_ADDRESS_LIMIT 520192
#define SRAM_RESERVED_SIZE 4112
#define SRAM_TO_ALLOC_SPU (SRAM_ADDRESS_LIMIT-SRAM_RESERVED_SIZE)

#define PSXSPU_REV_MODE_OFF        0
#define PSXSPU_REV_MODE_ROOM       1
#define PSXSPU_REV_MODE_STUDIO_A   2
#define PSXSPU_REV_MODE_STUDIO_B   3
#define PSXSPU_REV_MODE_STUDIO_C   4
#define PSXSPU_REV_MODE_HALL       5
#define PSXSPU_REV_MODE_SPACE      6
#define PSXSPU_REV_MODE_ECHO       7
#define PSXSPU_REV_MODE_DELAY      8
#define PSXSPU_REV_MODE_PIPE       9

extern unsigned long end_of_sram;

extern void psxspu_init(void);

extern void psxspu_init_reverb(long  rev_mode,
                               short depthleft,
                               short depthright,
                               long  delay,
                               long  feedback);

extern void psxspu_set_reverb_depth(short depthleft,
                                    short depthright);

extern void psxspu_fadeengine(void);

extern void psxspu_set_master_vol(int vol);
extern int  psxspu_get_master_vol(void);
extern void psxspu_start_master_fade(int msec,int destvol);
extern void psxspu_stop_master_fade(void);

//returns zero when fade is done
extern int  psxspu_get_master_fade_status(void);

extern void psxspu_set_cd_vol(int vol);
extern int  psxspu_get_cd_vol(void);
extern void psxspu_start_cd_fade(int msec,int destvol);
extern void psxspu_stop_cd_fade(void);

//returns zero when fade is done
extern int  psxspu_get_cd_fade_status(void);

extern void psxspu_setcdmixon(void);
extern void psxspu_setcdmixoff(void);

#endif



================================================
FILE: PSXDOOM/PSX_FILE.C
================================================
/* PSX_FILE.c */

#include "doomdef.h"
#include "r_local.h"

/*
============================================================================

READ/OPEN/CLOSE/SEEK/CLEAR PSX FILE BASED ROUTINES

============================================================================
*/

PsxCd_File	files[4];		//800A9B74 psxdoom

/*
== == == == == == == == == ==
=
= ClearFiles
=
= Exclusive Psx Doom
== == == == == == == == == ==
*/

void ClearFiles(void)//L80031D84()
{
	int i;

	for (i = 0; i < 4; i++)
	{
		files[i].file.size = 0;
	}
}

/*
== == == == == == == == == ==
=
= OpenFile
=
= Exclusive Psx Doom
== == == == == == == == == ==
*/

int OpenFile(char *filename)//L80031DAC()
{
	PsxCd_File *fp;
	int i, j;

	fp = psxcd_open(filename);

	if (!fp)
		I_Error("Cannot open %s", filename);

	//get free file
	for (i = 0; i < 4; i++)
	{
		if (files[i].file.size == 0)
			break;
	}

	if (!(i < 4))
		I_Error("OpenFile: Too many open files!");

	//copy file pointer
	files[i] = *fp;
	return i;
}

/*
== == == == == == == == == ==
=
= CloseFile
=
= Exclusive Psx Doom
== == == == == == == == == ==
*/

void CloseFile(int file_num)//L80031EA8()
{
	files[file_num].file.size = 0;
	psxcd_close(&files[file_num]);
}

/*
== == == == == == == == == ==
=
= SeekFile
=
= Exclusive Psx Doom
== == == == == == == == == ==
*/

int SeekFile(int file_num, int seekpos, int seekmode)//L80031EF4()
{
    PsxCd_File *fileptr;
    int tell;

    //printf("seekpos %d\n",seekpos);

    fileptr = &files[file_num];
	psxcd_seek(fileptr, seekpos, seekmode);
	tell = psxcd_tell(fileptr);
	//printf("tell %d\n",tell);
	return tell;
}

/*
== == == == == == == == == ==
=
= ReadFile
=
= Exclusive Psx Doom
== == == == == == == == == ==
*/

void ReadFile(int file_num, void *destptr, unsigned int readbytes)//L800322F8()
{
	unsigned long tell;
	unsigned int rbytes;
	PsxCd_File *fileptr;

	fileptr = &files[file_num];
	//printf("0x%X, [%d]", (unsigned long)fileptr,  file_num);

	tell = psxcd_tell(fileptr);

	rbytes = readbytes;
	if (0x2000 < readbytes)
		rbytes = 0x2000;	//max 32 kb

	psxcd_seek(fileptr, 0, PSXCD_SEEK_SET);
	psxcd_read(destptr, rbytes, fileptr);
	psxcd_seek(fileptr, tell, PSXCD_SEEK_SET);

	rbytes = psxcd_read(destptr, readbytes, fileptr);
	if (rbytes != readbytes)
		I_Error("ReadFile: error reading %d of %d bytes\n", rbytes, readbytes);
}


================================================
FILE: PSXDOOM/SEQLOAD.C
================================================
// Reconstruido por Erick Vasquez Garcia 16/05/2019 [GEC]
// Update 20/10/2019 [GEC]

#include "seqload.h"
#define _ALIGN4_ 1

#include <stdio.h>

extern pmasterstat *pm_stat;

extern int seq_loader_enable;           //80075790
extern char *loaderfile;		        //80075794
extern pmasterstat *ref_pm_stat;        //80075798
extern int ref_max_seq_num;             //8007579C
extern char Driver_Init;                //800757A0
extern char Reset_Gates;                //800757A1
extern int	opencount;				    //800757A4
extern int(*Seq_Error_func)(int, int);  //800757A8
extern int Seq_Error_module;            //800757AC
extern Wess_File_IO_Struct *fp_seq_file; //800757B0

extern track_header scratch_trk_hdr;    //8007EDE8
extern track_header seq_track_header;   //8007EE74
extern track_header base_track_header;  //8007EE8C

static void wess_seq_err(int code)//800444B0
{
    if (Seq_Error_func) {
		Seq_Error_func(Seq_Error_module, code);
	}
}

void wess_seq_loader_install_error_handler(int (*error_func)(int, int), int module)//800444E8
{
    Seq_Error_func = error_func;
	Seq_Error_module = module;
}

int Is_Seq_Seq_Num_Valid(int seqnum)//80044500
{
    if (seqnum >= 0)
    {
        if(ref_max_seq_num <= seqnum)
            return 0;

        return 1;
    }
    return 0;
}

int open_sequence_data(void)//8004452C
{
    if (opencount == 0)
    {
        fp_seq_file = (Wess_File_IO_Struct *)module_open(loaderfile);
        if(fp_seq_file == 0)
        {
            wess_seq_err(SEQLOAD_FOPEN);
            return 0;
        }
    }

    opencount += 1;
    return 1;
}

void close_sequence_data(void)//80044598
{
    if (opencount == 1)
	{
		module_close(fp_seq_file);
	}
	if (opencount > 0)
	{
		opencount -= 1;
	}
}

int wess_seq_load_sub(int seqnum, void *memptr)//800445EC
{
	sequence_data *psq_info;
	track_data	  *ptrk_info;
	int seqload;
	int seqread;
	int seqseek;
	int numtracks, k, loadit, tracknum, readbytes;
	char *pmem;

	//printf("wess_seq_load_sub\n");

	pmem = memptr;

	if (seq_loader_enable)
	{
		if (!Is_Seq_Seq_Num_Valid(seqnum))
			return 0;

		if (!open_sequence_data())
		{
			wess_seq_err(SEQLOAD_FOPEN);
			return 0;
		}

		psq_info = (ref_pm_stat->pmod_info->pseq_info + seqnum); /* pointer math */
		psq_info->ptrk_info = (track_data *)pmem;

		if (psq_info->trkstoload == 0)
			pmem += sizeof(track_data);
		else
			pmem += (psq_info->trkstoload * sizeof(track_data));

		seqseek = module_seek(fp_seq_file, psq_info->fileposition, PSXCD_SEEK_SET);
		if (seqseek)
		{
			wess_seq_err(SEQLOAD_FSEEK);
			return 0;
		}

		readbytes = sizeof(seq_header);
		seqread = module_read(&(ref_pm_stat->pmod_info->pseq_info + seqnum)->seq_hdr, readbytes, fp_seq_file);

		if (seqread != readbytes)
		{
			wess_seq_err(SEQLOAD_FREAD);
			return 0;
		}

		numtracks = (ref_pm_stat->pmod_info->pseq_info + seqnum)->seq_hdr.tracks;

		tracknum = 0;
		while (numtracks--)
		{
			readbytes = sizeof(track_header);
			seqread = module_read(&seq_track_header, readbytes, fp_seq_file);

			if (seqread != readbytes)
			{
				wess_seq_err(SEQLOAD_FREAD);
				return 0;
			}

			loadit = 0;

			if ((seq_track_header.voices_type == NoSound_ID) ||
				(seq_track_header.voices_type == GENERIC_ID))
			{
				loadit = 1;
			}
			else
			{
				k = ref_pm_stat->patch_types_loaded;
				while (k--)
				{
					if (((seq_track_header.voices_type == (ref_pm_stat->ppat_info + k)->hw_tl_list.hardware_ID) &&
						(((seq_track_header.voices_class == SNDFX_CLASS) && ((ref_pm_stat->ppat_info + k)->hw_tl_list.flags_load & TAG_SOUND_EFFECTS)) ||
						((seq_track_header.voices_class == SFXDRUMS_CLASS) && ((ref_pm_stat->ppat_info + k)->hw_tl_list.flags_load & TAG_SOUND_EFFECTS)) ||
							((seq_track_header.voices_class == MUSIC_CLASS) && ((ref_pm_stat->ppat_info + k)->hw_tl_list.flags_load & TAG_MUSIC)) ||
							((seq_track_header.voices_class == DRUMS_CLASS) && ((ref_pm_stat->ppat_info + k)->hw_tl_list.flags_load & TAG_DRUMS)))))
					{
						loadit = 1;
						break;
					}
				}
			}

			if (loadit == 0)
			{
				seqseek = module_seek(fp_seq_file, (seq_track_header.labellist_count * sizeof(long)) + seq_track_header.data_size, PSXCD_SEEK_CUR);
				if (seqseek != 0)
				{
					wess_seq_err(SEQLOAD_FSEEK);
					return 0;
				}
			}
			else
			{
				ptrk_info = ((ref_pm_stat->pmod_info->pseq_info + seqnum)->ptrk_info + tracknum);

				memcpy(&ptrk_info->trk_hdr, &seq_track_header, sizeof(seq_track_header));

				if (seq_track_header.voices_type == GENERIC_ID)
				{
					ptrk_info->trk_hdr.voices_type = NoSound_ID;

					if (seq_track_header.voices_class == SNDFX_CLASS || seq_track_header.voices_class == SFXDRUMS_CLASS)
					{
						for (k = 0; k < ref_pm_stat->patch_types_loaded; k++)
						{
							if ((ref_pm_stat->ppat_info + k)->hw_tl_list.flags_load  & TAG_SOUND_EFFECTS)
							{
								ptrk_info->trk_hdr.voices_type = (unsigned char)(pm_stat->ppat_info + k)->hw_tl_list.hardware_ID;
								break;
							}
						}
					}
					else if (scratch_trk_hdr.voices_class == MUSIC_CLASS)
					{
						for (k = 0; k < ref_pm_stat->patch_types_loaded; k++)
						{
							if ((ref_pm_stat->ppat_info + k)->hw_tl_list.flags_load  & TAG_MUSIC)
							{
								ptrk_info->trk_hdr.voices_type = (unsigned char)(pm_stat->ppat_info + k)->hw_tl_list.hardware_ID;
								break;
							}
						}
					}
					else if (scratch_trk_hdr.voices_class == DRUMS_CLASS)
					{
						for (k = 0; k < ref_pm_stat->patch_types_loaded; k++)
						{
							if ((ref_pm_stat->ppat_info + k)->hw_tl_list.flags_load  & TAG_DRUMS)
							{
								ptrk_info->trk_hdr.voices_type = (unsigned char)(pm_stat->ppat_info + k)->hw_tl_list.hardware_ID;
								break;
							}
						}
					}
				}

				ptrk_info->plabellist = (unsigned long *)pmem;
				pmem += (ptrk_info->trk_hdr.labellist_count * sizeof(long));

				readbytes = (ptrk_info->trk_hdr.labellist_count * sizeof(long));
				seqread = module_read(ptrk_info->plabellist, readbytes, fp_seq_file);

				if (seqread != readbytes)
				{
					wess_seq_err(SEQLOAD_FREAD);
					return 0;
				}

				ptrk_info->ptrk_data = (char *)pmem;
				pm
Download .txt
gitextract_ch5iijr1/

├── CONTRIBUTORS.md
├── ERRORDETECTION.md
├── LICENSE
├── PSXDOOM/
│   ├── GAME/
│   │   ├── CD/
│   │   │   └── PSXDOOM/
│   │   │       ├── ABIN/
│   │   │       │   └── MOVIE.STR
│   │   │       ├── CDAUDIO/
│   │   │       │   └── tmp.txt
│   │   │       ├── MAPDIR0/
│   │   │       │   └── tmp.txt
│   │   │       ├── MAPDIR1/
│   │   │       │   └── tmp.txt
│   │   │       ├── MAPDIR2/
│   │   │       │   └── tmp.txt
│   │   │       ├── MAPDIR3/
│   │   │       │   └── tmp.txt
│   │   │       ├── MAPDIR4/
│   │   │       │   └── tmp.txt
│   │   │       ├── MAPDIR5/
│   │   │       │   └── tmp.txt
│   │   │       ├── MAPDIR6/
│   │   │       │   └── tmp.txt
│   │   │       ├── MAPDIR7/
│   │   │       │   └── tmp.txt
│   │   │       ├── MUSIC/
│   │   │       │   └── tmp.txt
│   │   │       ├── SNDMAPS1/
│   │   │       │   └── tmp.txt
│   │   │       ├── SNDMAPS2/
│   │   │       │   └── tmp.txt
│   │   │       └── SNDMAPS3/
│   │   │           └── tmp.txt
│   │   ├── MAKE_CD.bat
│   │   └── PSXDOOMCD.xml
│   ├── LCDLOAD.C
│   ├── LCDLOAD.H
│   ├── MAIN.LNK
│   ├── MAKEFILE.bat
│   ├── PSXCD.C
│   ├── PSXCD.H
│   ├── PSXCDABS.C
│   ├── PSXCDABS.H
│   ├── PSXCMD.C
│   ├── PSXDOOM.cbp
│   ├── PSXDOOM.layout
│   ├── PSXSPU.C
│   ├── PSXSPU.H
│   ├── PSX_FILE.C
│   ├── SEQLOAD.C
│   ├── SEQLOAD.H
│   ├── SEQLOADR.C
│   ├── WESSAPI.C
│   ├── WESSAPI.H
│   ├── WESSAPIM.C
│   ├── WESSAPIP.C
│   ├── WESSAPIT.C
│   ├── WESSARC.C
│   ├── WESSARC.H
│   ├── WESSBASE.C
│   ├── WESSSEQ.C
│   ├── WESSSEQ.H
│   ├── am_main.c
│   ├── asm/
│   │   └── tmp.txt
│   ├── c_main.c
│   ├── cf_main.c
│   ├── d_main.c
│   ├── doomdata.h
│   ├── doomdef.h
│   ├── f_main.c
│   ├── g_game.c
│   ├── in_main.c
│   ├── info.c
│   ├── info.h
│   ├── l_main.c
│   ├── m_fixed.c
│   ├── m_fixed.s
│   ├── m_main.c
│   ├── m_password.c
│   ├── o_main.c
│   ├── obj/
│   │   └── tmp.txt
│   ├── p_base.c
│   ├── p_ceilng.c
│   ├── p_change.c
│   ├── p_doors.c
│   ├── p_enemy.c
│   ├── p_floor.c
│   ├── p_inter.c
│   ├── p_lights.c
│   ├── p_local.h
│   ├── p_map.c
│   ├── p_maputl.c
│   ├── p_mobj.c
│   ├── p_move.c
│   ├── p_plats.c
│   ├── p_pspr.c
│   ├── p_setup.c
│   ├── p_shoot.c
│   ├── p_sight.c
│   ├── p_slide.c
│   ├── p_spec.c
│   ├── p_spec.h
│   ├── p_switch.c
│   ├── p_telept.c
│   ├── p_tick.c
│   ├── p_user.c
│   ├── psxmain.c
│   ├── pw_main.c
│   ├── r_data.c
│   ├── r_local.h
│   ├── r_main.c
│   ├── r_phase1.c
│   ├── r_phase2.c
│   ├── s_sound.c
│   ├── snmain.s
│   ├── sounds.h
│   ├── soundst.h
│   ├── sprinfo.c
│   ├── st_main.c
│   ├── st_main.h
│   ├── t_main.c
│   ├── tables.c
│   ├── vsprintf.c
│   ├── w_wad.c
│   └── z_zone.c
├── PSYQ/
│   └── README.txt
└── README.md
Download .txt
SYMBOL INDEX (819 symbols across 74 files)

FILE: PSXDOOM/LCDLOAD.C
  function wess_dig_lcd_loader_init (line 35) | int wess_dig_lcd_loader_init(void *input_pm_stat)//80048C54
  function wess_dig_set_sample_position (line 82) | void wess_dig_set_sample_position(int samplenum, char *samplepos)//80048D3C
  function Wess_Data_IO_Struct (line 93) | Wess_Data_IO_Struct *wess_dig_lcd_data_open(char *filename)//80048D68
  function wess_dig_lcd_data_read (line 104) | int wess_dig_lcd_data_read(unsigned char *buffer,void *destptr, SampleBl...
  function wess_dig_lcd_psxcd_sync (line 200) | int wess_dig_lcd_psxcd_sync(void)//8004911C

FILE: PSXDOOM/LCDLOAD.H
  type SampleBlock (line 14) | typedef struct SampleBlock {

FILE: PSXDOOM/PSXCD.C
  type PsxCd_Command (line 86) | typedef struct PsxCd_Command {
  function psxcd_memcpy (line 118) | static void psxcd_memcpy(void *pdest, void *psrc, unsigned long bytestoc...
  function psxcd_sync (line 128) | static void psxcd_sync(void)//8003EFA4
  function psxcd_critical_sync (line 150) | static int psxcd_critical_sync(void)//8003F060
  function cbcomplete (line 174) | static void cbcomplete(int intr, u_char *result)//8003F11C
  function cbready (line 217) | static void cbready(int intr, u_char *result)//8003F200
  function psxcd_disable_callbacks (line 370) | void psxcd_disable_callbacks(void)//8003F604
  function psxcd_enable_callbacks (line 377) | void psxcd_enable_callbacks(void)//8003F610
  function psxcd_init (line 384) | void psxcd_init(void)//8003F620
  function psxcd_exit (line 429) | void psxcd_exit(void)//8003F6FC
  function psxcd_set_data_mode (line 439) | void psxcd_set_data_mode(void)//8003F72C
  function PsxCd_File (line 503) | PsxCd_File *psxcd_open(char *filename)//8003F83C
  function PsxCd_File (line 529) | PsxCd_File *psxcd_open(char *filename)
  function psxcd_init_pos (line 565) | void psxcd_init_pos(void)//8003F90C
  function psxcd_async_on (line 577) | int psxcd_async_on(void)//8003F92C
  function psxcd_seeking_for_play (line 608) | int psxcd_seeking_for_play(void)//8003FA34
  function psxcd_waiting_for_pause (line 638) | int psxcd_waiting_for_pause(void)//8003FAE4
  function psxcd_read (line 668) | int psxcd_read(void *destptr,int readbytes,PsxCd_File *fileptr)//8003FB90
  function psxcd_async_read_cancel (line 680) | void psxcd_async_read_cancel(void)//8003FBC8
  function psxcd_async_read (line 696) | int psxcd_async_read(void *destptr,int readbytes,PsxCd_File *fileptr)//8...
  function psxcd_seek (line 926) | int psxcd_seek(PsxCd_File *fileptr,int seekpos,int seekmode)//80040444
  function psxcd_tell (line 963) | unsigned long psxcd_tell(PsxCd_File *fileptr)//80040538
  function psxcd_close (line 982) | void psxcd_close(PsxCd_File *fileptr)//800405A0
  function psxcd_set_audio_mode (line 989) | void psxcd_set_audio_mode(void)//800405A8
  function psxcd_set_loop_volume (line 1019) | void psxcd_set_loop_volume(int volforloop)//8004064C
  function psxcd_play_at_andloop (line 1026) | void psxcd_play_at_andloop(int track,
  function psxcd_play_at (line 1066) | void psxcd_play_at(int track, int vol, int sectoroffset)//800407B8
  function psxcd_play (line 1100) | void psxcd_play(int track, int vol)//800408DC
  function psxcd_seek_for_play_at (line 1105) | void psxcd_seek_for_play_at(int track, int sectoroffset)//800408FC
  function psxcd_seek_for_play (line 1135) | void psxcd_seek_for_play(int track)//80040A10
  function psxcd_play_status (line 1140) | int psxcd_play_status(void)//80040A30
  function psxcd_stop (line 1168) | void psxcd_stop(void)//80040AC8
  function psxcd_pause (line 1196) | void psxcd_pause(void)//80040B40
  function psxcd_restart (line 1227) | void psxcd_restart(int vol)//80040BE4
  function psxcd_elapsed_sectors (line 1250) | int psxcd_elapsed_sectors(void)//80040C6C
  function psxcd_set_stereo (line 1263) | void psxcd_set_stereo(int stereo_true)//80040CC0

FILE: PSXDOOM/PSXCD.H
  type PsxCd_File (line 42) | typedef struct PsxCd_File {
  type PsxCd_MapTbl (line 51) | typedef struct PsxCd_MapTbl {

FILE: PSXDOOM/PSXCMD.C
  function start_record_music_mute (line 107) | void start_record_music_mute(NoteState *notestate)//L80045750()
  function end_record_music_mute (line 116) | void end_record_music_mute(void)//L8004576C()
  function add_music_mute_note (line 121) | void add_music_mute_note(unsigned short seq_num, unsigned char track,
  function wess_set_mute_release (line 137) | void wess_set_mute_release(int newrate)//L80045848()
  function TriggerPSXVoice (line 158) | void TriggerPSXVoice(voice_status *voice_stat, unsigned char keynum, uns...
  function PSX_DriverInit (line 269) | void PSX_DriverInit(master_status_structure *pm_stat)//L80045CFC()
  function PSX_DriverExit (line 337) | void PSX_DriverExit (track_status *ptk_stat)//L80045F24()
  function PSX_DriverEntry1 (line 351) | void PSX_DriverEntry1 (track_status *ptk_stat)//L80045F44()
  function PSX_DriverEntry2 (line 419) | void PSX_DriverEntry2(track_status *ptk_stat)//L800461F4()
  function PSX_DriverEntry3 (line 424) | void PSX_DriverEntry3(track_status *ptk_stat)//L800461FC()
  function PSX_TrkOff (line 431) | void PSX_TrkOff(track_status *ptk_stat)//L80046204()
  function PSX_TrkMute (line 455) | void PSX_TrkMute(track_status *ptk_stat)//L800462B0()
  function PSX_PatchChg (line 494) | void PSX_PatchChg(track_status *ptk_stat)//L8004646C()
  function PSX_PatchMod (line 501) | void PSX_PatchMod(track_status *ptk_stat)//L80046494()
  function PSX_PitchMod (line 514) | void PSX_PitchMod(track_status *ptk_stat)//L8004649C()
  function PSX_ZeroMod (line 577) | void PSX_ZeroMod(track_status *ptk_stat)//L800466EC()
  function PSX_ModuMod (line 582) | void PSX_ModuMod(track_status *ptk_stat)//L800466f4()
  function PSX_VolumeMod (line 593) | void PSX_VolumeMod(track_status *ptk_stat)//L800466FC()
  function PSX_PanMod (line 669) | void PSX_PanMod(track_status *ptk_stat)//L80046A14()
  function PSX_PedalMod (line 731) | void PSX_PedalMod(track_status *ptk_stat)//L80046CF0()
  function PSX_ReverbMod (line 737) | void PSX_ReverbMod(track_status *ptk_stat)//L80046CF8()
  function PSX_ChorusMod (line 743) | void PSX_ChorusMod(track_status *ptk_stat)//L80046D00()
  function PSX_voiceon (line 748) | void PSX_voiceon(voice_status *voice_stat, track_status *ptk_stat,
  function PSX_voiceparmoff (line 784) | void PSX_voiceparmoff(voice_status *voice_stat)//L80046DDC()
  function PSX_voicerelease (line 800) | void PSX_voicerelease(voice_status *voice_stat)//L80046EA4()
  function PSX_voicenote (line 813) | void PSX_voicenote(track_status *ptk_stat,
  function PSX_NoteOn (line 871) | void PSX_NoteOn(track_status *ptk_stat)//L80047104()
  function PSX_NoteOff (line 917) | void PSX_NoteOff(track_status *ptk_stat)//L800472E8()

FILE: PSXDOOM/PSXSPU.C
  function psxspu_init_reverb (line 39) | void psxspu_init_reverb(long  rev_mode, short depthleft, short depthrigh...
  function psxspu_set_reverb_depth (line 70) | void psxspu_set_reverb_depth(short depthleft,short depthright)//80045178
  function psxspu_init (line 80) | void psxspu_init(void)//800451c0
  function psxspu_set_master_volume (line 108) | void psxspu_set_master_volume(int vol)//8004526C
  function psxspu_set_cd_volume (line 120) | void psxspu_set_cd_volume(int vol)//800452B0
  function psxspu_setcdmixon (line 132) | void psxspu_setcdmixon(void)//800452F4
  function psxspu_setcdmixoff (line 143) | void psxspu_setcdmixoff(void)//8004533C
  function psxspu_fadeengine (line 154) | void psxspu_fadeengine(void)//8004537C
  function psxspu_set_cd_vol (line 185) | void psxspu_set_cd_vol(int vol)//80045490
  function psxspu_get_cd_vol (line 195) | int  psxspu_get_cd_vol(void)//800454EC
  function psxspu_start_cd_fade (line 200) | void psxspu_start_cd_fade(int msec, int destvol)//800454FC
  function psxspu_stop_cd_fade (line 216) | void psxspu_stop_cd_fade(void)//800455B4
  function psxspu_get_cd_fade_status (line 223) | int  psxspu_get_cd_fade_status(void)//800455D8
  function psxspu_set_master_vol (line 228) | void psxspu_set_master_vol(int vol)//800455F0
  function psxspu_get_master_vol (line 238) | int  psxspu_get_master_vol(void)//8004564C
  function psxspu_start_master_fade (line 243) | void psxspu_start_master_fade(int msec, int destvol)//8004565C
  function psxspu_stop_master_fade (line 259) | void psxspu_stop_master_fade(void)//80045714
  function psxspu_get_master_fade_status (line 266) | int  psxspu_get_master_fade_status(void)//80045738

FILE: PSXDOOM/PSX_FILE.C
  function ClearFiles (line 25) | void ClearFiles(void)//L80031D84()
  function OpenFile (line 44) | int OpenFile(char *filename)//L80031DAC()
  function CloseFile (line 78) | void CloseFile(int file_num)//L80031EA8()
  function SeekFile (line 93) | int SeekFile(int file_num, int seekpos, int seekmode)//L80031EF4()
  function ReadFile (line 116) | void ReadFile(int file_num, void *destptr, unsigned int readbytes)//L800...

FILE: PSXDOOM/SEQLOAD.C
  function wess_seq_err (line 26) | static void wess_seq_err(int code)//800444B0
  function wess_seq_loader_install_error_handler (line 33) | void wess_seq_loader_install_error_handler(int (*error_func)(int, int), ...
  function Is_Seq_Seq_Num_Valid (line 39) | int Is_Seq_Seq_Num_Valid(int seqnum)//80044500
  function open_sequence_data (line 51) | int open_sequence_data(void)//8004452C
  function close_sequence_data (line 67) | void close_sequence_data(void)//80044598
  function wess_seq_load_sub (line 79) | int wess_seq_load_sub(int seqnum, void *memptr)//800445EC
  function wess_seq_loader_init (line 288) | int wess_seq_loader_init(void *input_pm_stat, char *seqfile, enum OpenSe...
  function wess_seq_loader_exit (line 330) | void wess_seq_loader_exit(void)//80044EAC
  function wess_seq_sizeof (line 336) | int wess_seq_sizeof(int seqnum)//80044ED4
  function wess_seq_load (line 356) | int wess_seq_load(int seqnum, void *memptr)//80044F64
  function wess_seq_free (line 373) | int wess_seq_free(int seqnum)//80045008

FILE: PSXDOOM/SEQLOAD.H
  type Seq_Load_Error (line 15) | enum Seq_Load_Error {
  type OpenSeqHandleFlag (line 23) | enum OpenSeqHandleFlag {NoOpenSeqHandle,YesOpenSeqHandle}
  type OpenSeqHandleFlag (line 38) | enum OpenSeqHandleFlag

FILE: PSXDOOM/SEQLOADR.C
  function wess_seq_range_sizeof (line 27) | int wess_seq_range_sizeof(int seqfirst, int numseqs)//800497C0
  function wess_seq_range_load (line 46) | int wess_seq_range_load(int seqfirst, int numseqs, void *memptr)//8004984C
  function wess_seq_range_free (line 72) | int wess_seq_range_free(int seqfirst, int numseqs)//80049900

FILE: PSXDOOM/WESSAPI.C
  function err (line 56) | static void err(int code) {
  function zeroset (line 64) | static void zeroset(char *pdest, unsigned long size)//80041BE8
  function wess_install_error_handler (line 69) | void wess_install_error_handler(int (*error_func)(int, int), int module)...
  function Is_System_Active (line 85) | int Is_System_Active(void)//80041C3C
  function Is_Module_Loaded (line 96) | int Is_Module_Loaded(void)//80041C4C
  function Is_Seq_Num_Valid (line 107) | int Is_Seq_Num_Valid(int seq_num)//80041C5C
  function Register_Early_Exit (line 120) | void Register_Early_Exit(void)//80041CB8
  function wess_install_handler (line 130) | void wess_install_handler (void)//80041CDC
  function wess_restore_handler (line 137) | void wess_restore_handler (void)//80041CFC
  function wess_init (line 144) | int wess_init (void)//80041D1C
  function wess_exit (line 168) | void wess_exit (enum RestoreFlag rflag)//80041D80
  function free_mem_if_mine (line 209) | static void free_mem_if_mine(void)//80041E2C
  function wess_unload_module (line 224) | void wess_unload_module (void)//80041E7C
  function module_memcpy (line 254) | static void module_memcpy(void *pdest, void *psrc, unsigned long bytesto...
  function conditional_read (line 262) | int conditional_read(int readflag, char **ptrtomem, int readsize)//80041FBC
  function wess_load_module (line 288) | int wess_load_module (void *wmd_ptr,
  function filltrackstat (line 1025) | void filltrackstat(track_status *ptk_stat, track_data *ptk_info, Trigger...
  function assigntrackstat (line 1168) | void assigntrackstat(track_status *ptk_stat, track_data *ptk_info)//8004...
  function wess_seq_structrig (line 1191) | int wess_seq_structrig (sequence_data *psq_info,
  function wess_seq_trigger (line 1324) | void wess_seq_trigger (int seq_num)//8004341C
  function wess_seq_trigger_special (line 1332) | void wess_seq_trigger_special (int              seq_num,
  function wess_seq_status (line 1341) | int wess_seq_status (int sequence_number)//8004348C
  function wess_seq_stop (line 1384) | void wess_seq_stop (int sequence_number)//80043560
  function wess_seq_stopall (line 1440) | void wess_seq_stopall (void)//800436EC

FILE: PSXDOOM/WESSAPI.H
  type Wess_Error (line 19) | enum Wess_Error {
  type RestoreFlag (line 28) | enum RestoreFlag {NoRestore,YesRestore}
  type MuteFlag (line 31) | enum MuteFlag {NoMute,YesMute}
  type NoteData (line 33) | typedef struct NoteData {
  type NoteState (line 43) | typedef struct NoteState {
  type SequenceStatus (line 49) | enum SequenceStatus {SEQUENCE_INVALID,SEQUENCE_INACTIVE,SEQUENCE_STOPPED...
  type LoopedFlag (line 52) | enum LoopedFlag {NoLooped,YesLooped}
  type HandleFlag (line 55) | enum HandleFlag {NoHandle,YesHandle}
  type RestoreFlag (line 137) | enum RestoreFlag
  type TriggerPlayAttr (line 212) | typedef struct  {
  type MuteFlag (line 303) | enum MuteFlag
  type MuteFlag (line 322) | enum MuteFlag

FILE: PSXDOOM/WESSAPIM.C
  function wess_master_sfx_volume_get (line 17) | char wess_master_sfx_volume_get (void)//80049548
  function wess_master_mus_volume_get (line 29) | char wess_master_mus_volume_get (void)//80049578
  function wess_master_sfx_vol_set (line 41) | void wess_master_sfx_vol_set (char volume)//800495A8
  function wess_master_mus_vol_set (line 52) | void wess_master_mus_vol_set (char volume)//800495E0
  function wess_pan_mode_get (line 118) | char wess_pan_mode_get (void)//800497A0
  function wess_pan_mode_set (line 125) | void wess_pan_mode_set (char mode)//800497B0

FILE: PSXDOOM/WESSAPIP.C
  function trackstart (line 29) | void trackstart(track_status *ptmp, sequence_status *psq_stat)//800414A4
  function trackstop (line 44) | void trackstop(track_status *ptmp, sequence_status *psq_stat)//800414E8
  function wess_seq_pause (line 60) | void wess_seq_pause(int sequence_number, enum MuteFlag mflag)//80041528
  function wess_seq_restart (line 119) | void wess_seq_restart(int sequence_number)//800416D0
  function wess_seq_pauseall (line 174) | void wess_seq_pauseall(enum MuteFlag mflag, NoteState *pns)//8004183C
  function wess_seq_restartall (line 243) | void wess_seq_restartall(NoteState *pns)//800419f8

FILE: PSXDOOM/WESSAPIT.C
  function updatetrackstat (line 29) | void updatetrackstat(track_status *ptk_stat, TriggerPlayAttr *attr)//L80...
  function wess_seq_trigger_type (line 138) | void wess_seq_trigger_type (int seq_num, unsigned long seq_type)//800440FC
  function wess_seq_trigger_type_special (line 150) | void wess_seq_trigger_type_special (int              seq_num,
  function wess_seq_update_type_special (line 164) | void wess_seq_update_type_special(unsigned long seq_type, TriggerPlayAtt...
  function wess_seq_stoptype (line 222) | void wess_seq_stoptype (unsigned long type_number)//8004431C

FILE: PSXDOOM/WESSARC.C
  function wess_low_level_init (line 95) | void wess_low_level_init(void)//80043868
  function wess_low_level_exit (line 100) | void wess_low_level_exit(void)//80043888
  function wess_free (line 110) | void wess_free(char *mem)//80043898
  function GetIntsPerSec (line 115) | short GetIntsPerSec(void)//800438A0
  function CalcPartsPerInt (line 120) | unsigned long CalcPartsPerInt(short ips,short ppq,short qpm)//800438A8
  function WessInterruptHandler (line 127) | static long WessInterruptHandler(void)//800438F8
  function init_WessTimer (line 149) | void init_WessTimer(void)//8004398C
  function exit_WessTimer (line 166) | void exit_WessTimer(void)//80043A18
  function Wess_init_for_LoadFileData (line 183) | int Wess_init_for_LoadFileData(char *filename)//80043A88
  function Wess_File_IO_Struct (line 197) | Wess_File_IO_Struct *module_open(char *filename)//80043A90
  function module_read (line 208) | int module_read(void *destptr,int readbytes,Wess_File_IO_Struct *fileptr...
  function module_seek (line 213) | int module_seek(Wess_File_IO_Struct *fileptr,int seekpos,int seekmode)//...
  function module_tell (line 218) | unsigned long module_tell(Wess_File_IO_Struct *fileptr)//80043B44
  function module_close (line 223) | void module_close(Wess_File_IO_Struct *fileptr)//80043B64
  function get_num_Wess_Sound_Drivers (line 228) | int get_num_Wess_Sound_Drivers(int **settings_tag_lists)//80043B84
  function Wess_Data_IO_Struct (line 233) | Wess_Data_IO_Struct *data_open(char *filename)
  function data_read_chunk (line 247) | void data_read_chunk(Wess_Data_IO_Struct *fileptr, int totaltogo, unsign...
  function data_read (line 278) | int data_read(Wess_Data_IO_Struct *fileptr,void *destptr,int readbytes,i...
  function data_close (line 312) | void data_close(Wess_Data_IO_Struct *fileptr)//80043DE8

FILE: PSXDOOM/WESSARC.H
  type DriverIds (line 7) | enum DriverIds {NoSound_ID,PSX_ID,GENERIC_ID=50}
  type SoundHardwareTags (line 9) | enum SoundHardwareTags {
  type DriverCmd (line 19) | enum DriverCmd {
  type patches_header (line 59) | typedef struct
  type patchmaps_header (line 66) | typedef struct
  type patchinfo_header (line 84) | typedef struct
  type module_header (line 94) | typedef struct
  type track_header (line 107) | typedef struct
  type track_data (line 127) | typedef struct
  type seq_header (line 134) | typedef struct
  type sequence_data (line 140) | typedef struct
  type module_data (line 149) | typedef struct
  type callback_status (line 156) | typedef struct
  type patch_group_header (line 164) | typedef struct
  type hardware_table_list (line 181) | typedef struct
  type patch_group_data (line 187) | typedef struct
  type sequence_status (line 218) | typedef struct
  type track_status (line 233) | typedef struct
  type voice_status (line 269) | typedef struct
  type master_status_structure (line 285) | typedef struct
  type master_status_structure (line 310) | typedef master_status_structure pmasterstat;
  type PsxCd_File (line 337) | typedef PsxCd_File Wess_File_IO_Struct;
  type PsxCd_File (line 338) | typedef PsxCd_File Wess_Data_IO_Struct;

FILE: PSXDOOM/WESSSEQ.C
  function Len_Vlq (line 183) | int Len_Vlq(unsigned int deltatime)//L800474AC()
  function Eng_DriverInit (line 199) | void Eng_DriverInit (master_status_structure *pm_stat)//L80047518
  function Eng_DriverExit (line 208) | void Eng_DriverExit (track_status *ptk_stat)//L80047554()
  function Eng_DriverEntry1 (line 213) | void Eng_DriverEntry1 (track_status *ptk_stat)//L8004755C()
  function Eng_DriverEntry2 (line 218) | void Eng_DriverEntry2 (track_status *ptk_stat)//L80047564()
  function Eng_DriverEntry3 (line 223) | void Eng_DriverEntry3 (track_status *ptk_stat)//L8004756C()
  function Eng_TrkOff (line 232) | void Eng_TrkOff (track_status *ptk_stat)//L80047574()
  function Eng_TrkMute (line 281) | void Eng_TrkMute (track_status *ptk_stat)//L80047720()
  function Eng_PatchChg (line 288) | void Eng_PatchChg (track_status *ptk_stat)//L80047728()
  function Eng_PatchMod (line 296) | void Eng_PatchMod (track_status *ptk_stat)//L80047750()
  function Eng_PitchMod (line 303) | void Eng_PitchMod (track_status *ptk_stat)//L80047758()
  function Eng_ZeroMod (line 310) | void Eng_ZeroMod (track_status *ptk_stat)//L80047780()
  function Eng_ModuMod (line 315) | void Eng_ModuMod (track_status *ptk_stat)//L80047788()
  function Eng_VolumeMod (line 322) | void Eng_VolumeMod (track_status *ptk_stat)//L80047790()
  function Eng_PanMod (line 331) | void Eng_PanMod (track_status *ptk_stat)//L800477B0()
  function Eng_PedalMod (line 338) | void Eng_PedalMod (track_status *ptk_stat)//L800477D0()
  function Eng_ReverbMod (line 343) | void Eng_ReverbMod (track_status *ptk_stat)//L800477D8()
  function Eng_ChorusMod (line 348) | void Eng_ChorusMod (track_status *ptk_stat)//L800477E0()
  function Eng_NoteOn (line 353) | void Eng_NoteOn (track_status *ptk_stat)//L800477E8()
  function Eng_NoteOff (line 358) | void Eng_NoteOff (track_status *ptk_stat)//L800477F0()
  function Eng_StatusMark (line 367) | void Eng_StatusMark (track_status *ptk_stat)//L800477F8()
  function Eng_GateJump (line 404) | void Eng_GateJump (track_status *ptk_stat)//L80047914()
  function Eng_IterJump (line 431) | void Eng_IterJump (track_status *ptk_stat)//L80047A00()
  function Eng_ResetGates (line 464) | void Eng_ResetGates (track_status *ptk_stat)//L80047AFC()
  function Eng_ResetIters (line 487) | void Eng_ResetIters (track_status *ptk_stat)//L80047C00()
  function Eng_WriteIterBox (line 509) | void Eng_WriteIterBox (track_status *ptk_stat)//L80047D04()
  function Eng_SeqTempo (line 522) | void Eng_SeqTempo (track_status *ptk_stat)//L80047D48()
  function Eng_SeqGosub (line 555) | void Eng_SeqGosub (track_status *ptk_stat)//L80047EC8()
  function Eng_SeqJump (line 595) | void Eng_SeqJump (track_status *ptk_stat)//L800480A4()
  function Eng_SeqRet (line 630) | void Eng_SeqRet (track_status *ptk_stat)//L8004824C()
  function Eng_SeqEnd (line 661) | void Eng_SeqEnd (track_status *ptk_stat)//L8004839C()
  function Eng_TrkTempo (line 709) | void Eng_TrkTempo (track_status *ptk_stat)//L80048644()
  function Eng_TrkGosub (line 716) | void Eng_TrkGosub (track_status *ptk_stat)//L800486A0()
  function Eng_TrkJump (line 731) | void Eng_TrkJump (track_status *ptk_stat)//L80048734()
  function Eng_TrkRet (line 746) | void Eng_TrkRet (track_status *ptk_stat)//L800487A4()
  function Eng_TrkEnd (line 755) | void Eng_TrkEnd (track_status *ptk_stat)//L800487F8()
  function Eng_NullEvent (line 781) | void Eng_NullEvent (track_status *ptk_stat)//L800488FC()
  function SeqEngine (line 791) | void SeqEngine(void)//L80048904()

FILE: PSXDOOM/am_main.c
  function AM_Start (line 32) | void AM_Start(void)//L8003B83C()
  function AM_Control (line 51) | void AM_Control (player_t *player)//L8003B884()
  function AM_Drawer (line 156) | void AM_Drawer (void)//L8003BAB0()
  type outflags_t (line 311) | typedef enum
  function AM_DrawLine (line 321) | void AM_DrawLine(int color, int x1, int y1, int x2, int y2)//L8003C16C()

FILE: PSXDOOM/c_main.c
  function C_Start (line 21) | void C_Start(void)//L800369D8()
  function C_Stop (line 43) | void C_Stop(int exit)//L80036AA0()
  function C_Ticker (line 56) | int C_Ticker(void)//L80036AC0()
  function C_Draw (line 107) | void C_Draw(void) //L80036B58()

FILE: PSXDOOM/cf_main.c
  function CF_Start (line 28) | void CF_Start(void)//L8003773C()
  function CF_Stop (line 44) | void CF_Stop(int exit)//L80037780()
  function CF_Ticker (line 58) | int CF_Ticker(void)//L800377AC()
  function CF_Drawer (line 134) | void CF_Drawer(void)//L80037984()

FILE: PSXDOOM/d_main.c
  function D_DoomMain (line 48) | void D_DoomMain (void) //L80012274()
  function RunLegal (line 95) | int RunLegal(void)//L800123A4()
  function RunTitle (line 102) | int RunTitle(void)//L800123E4()
  function RunDemo (line 109) | int RunDemo(char *demoname)//L80012424()
  function RunCredits (line 126) | int RunCredits(void)//L800124A8()
  function D_DebugSetPrintPos (line 139) | void D_DebugSetPrintPos(int x, int y)//L800124E8()
  function D_DebugPrint (line 145) | void D_DebugPrint(const char *text, ...)//L800124F8()
  function D_memset (line 189) | void D_memset(void *dest, int val, int count)//L80012850()
  function D_memcpy (line 220) | void D_memcpy(void *dest, void *src, int count)//L8001290C()
  function D_strncpy (line 231) | void D_strncpy(char *dest, char *src, int maxcount)//L80012940()
  function D_strncasecmp (line 241) | int D_strncasecmp(char *s1, char *s2, int len)//L8001297C()
  function D_strupr (line 257) | void D_strupr(char *s)//L800129D4()
  function P_Random (line 304) | int P_Random(void)//L80012A18()
  function M_Random (line 310) | int M_Random(void)//L80012A44()
  function M_ClearRandom (line 316) | void M_ClearRandom(void) // L80012A70()
  function M_ClearBox (line 321) | void M_ClearBox(fixed_t *box)//L80012A80()
  function M_AddToBox (line 327) | void M_AddToBox(fixed_t *box, fixed_t x, fixed_t y)//L80012AA0()
  function M_AddToBox2 (line 339) | void M_AddToBox2(fixed_t *box, fixed_t x, fixed_t y)//L80012B10()
  function MiniLoop (line 360) | int MiniLoop(void(*start)(void), void(*stop)(int), int(*ticker)(void), v...

FILE: PSXDOOM/doomdata.h
  type boolean (line 11) | typedef enum {false, true} boolean;
  type byte (line 12) | typedef unsigned char byte;
  type mapvertex_t (line 29) | typedef struct
  type mapsidedef_t (line 34) | typedef struct
  type maplinedef_t (line 42) | typedef struct
  type mapsector_t (line 73) | typedef	struct
  type mapsubsector_t (line 83) | typedef struct
  type mapseg_t (line 89) | typedef struct
  type mapnode_t (line 100) | typedef struct
  type mapthing_t (line 107) | typedef struct
  type mappatch_t (line 132) | typedef struct
  type maptexture_t (line 141) | typedef struct
  type column_t (line 167) | typedef struct
  type patch_t (line 176) | typedef struct

FILE: PSXDOOM/doomdef.h
  type psxobj_t (line 104) | typedef struct psxobj_s
  type patchpsx_t (line 124) | typedef struct
  type fixed_t (line 159) | typedef int fixed_t;
  type angle_t (line 165) | typedef unsigned angle_t;
  type skill_t (line 174) | typedef enum
  type gameaction_t (line 183) | typedef enum
  type mobj_s (line 217) | struct mobj_s
  type mobj_s (line 223) | struct mobj_s
  type thinker_t (line 225) | typedef struct thinker_s
  type player_s (line 231) | struct player_s
  type mobj_t (line 233) | typedef struct mobj_s
  type subsector_s (line 275) | struct subsector_s
  type degenmobj_t (line 276) | typedef struct
  type playerstate_t (line 336) | typedef enum
  type psprnum_t (line 346) | typedef enum
  type pspdef_t (line 353) | typedef struct
  type card_t (line 360) | typedef enum
  type weapontype_t (line 371) | typedef enum
  type ammotype_t (line 386) | typedef enum
  type weaponinfo_t (line 397) | typedef struct
  type powertype_t (line 409) | typedef enum
  type player_t (line 433) | typedef struct player_s
  type gametype_t (line 527) | typedef enum
  function ShortSwap (line 582) | short ShortSwap(short dat)
  function LongSwap (line 587) | long LongSwap(long dat)
  type memblock_t (line 619) | typedef struct memblock_s
  type memzone_t (line 630) | typedef struct
  type lumpinfo_t (line 662) | typedef struct
  type lumpcache_t (line 669) | typedef struct {
  type menu_t (line 762) | typedef enum
  type subsector_s (line 860) | struct subsector_s
  type buttons_t (line 911) | typedef struct
  type cdmusic_t (line 1013) | enum cdmusic_t {

FILE: PSXDOOM/f_main.c
  type castinfo_t (line 65) | typedef struct
  type finalestage_t (line 93) | typedef enum
  function END1_Start (line 113) | void END1_Start(void)//L8003D440()
  function END1_Stop (line 136) | void END1_Stop(int exit)//L8003D4E4()
  function END1_Ticker (line 150) | int END1_Ticker(void)//L8003D50C()
  function END1_Drawer (line 200) | void END1_Drawer(void)//L8003D660()
  function Cast_Start (line 246) | void Cast_Start(void)//L8003D734
  function Cast_Stop (line 281) | void Cast_Stop(int exit)//L8003D860()
  function Cast_Ticker (line 295) | int Cast_Ticker(void)//L8003D888()
  function Cast_Drawer (line 471) | void Cast_Drawer(void)//L8003E098()

FILE: PSXDOOM/g_game.c
  function G_DoLoadLevel (line 44) | void G_DoLoadLevel (void) //L80012E04()
  function G_PlayerFinishLevel (line 87) | void G_PlayerFinishLevel (int player)//L80012ED4()
  function G_PlayerReborn (line 112) | void G_PlayerReborn (int player) //L80012F5C()
  function boolean (line 153) | boolean G_CheckSpot (int playernum, mapthing_t *mthing)
  function G_DeathMatchSpawnPlayer (line 189) | void G_DeathMatchSpawnPlayer (int playernum)
  function G_DoReborn (line 222) | void G_DoReborn (int playernum)//80013044
  function G_CompleteLevel (line 337) | void G_CompleteLevel (void)//80013358
  function G_InitNew (line 355) | void G_InitNew (skill_t skill, int map, gametype_t gametype) //L80013368()
  function G_RunGame (line 431) | void G_RunGame (void)//L800134FC()
  function G_PlayDemoPtr (line 509) | int G_PlayDemoPtr (void)//(int *demo) L800136E8()
  function G_RecordDemo (line 548) | void G_RecordDemo (void)//8001380C

FILE: PSXDOOM/in_main.c
  type pstats_t (line 23) | typedef struct pstats_s
  function IN_Start (line 112) | void IN_Start(void)//L8003C4D4()
  function IN_Stop (line 158) | void IN_Stop(int exit)//L8003C7D4()
  function IN_Ticker (line 164) | int IN_Ticker(void)//L8003C7FC()
  function IN_Drawer (line 281) | void IN_Drawer(void)//L8003CBE0()
  function IN_SingleDrawer (line 299) | void IN_SingleDrawer(void)//L8003CC54()
  function IN_CooperativeDrawer (line 342) | void IN_CooperativeDrawer(void)//L8003CE24()
  function IN_DeathMachtDrawer (line 396) | void IN_DeathMachtDrawer(void)//L8003D1B8()

FILE: PSXDOOM/info.h
  type spritenum_t (line 3) | typedef enum {
  type statenum_t (line 148) | typedef enum
  type state_t (line 909) | typedef struct
  type mobjtype_t (line 922) | typedef enum
  type mobjinfo_t (line 1054) | typedef struct {

FILE: PSXDOOM/l_main.c
  function L_Start (line 19) | void L_Start(void)//L80034D5C()
  function L_Stop (line 35) | void L_Stop(int exit)//L80034DA8()
  function L_Ticker (line 49) | int L_Ticker(void)//L80034DD4()
  function L_Draw (line 81) | void L_Draw(void)//L80034E54()

FILE: PSXDOOM/m_fixed.c
  function fixed_t (line 5) | fixed_t FixedMul(register fixed_t	a, register fixed_t	b)//L8003EEA4()
  function fixed_t (line 34) | fixed_t FixedDiv(register fixed_t a, register fixed_t b)//L8003EEF0()

FILE: PSXDOOM/m_main.c
  type playmode_t (line 29) | typedef enum
  function RunMenu (line 50) | int RunMenu(void)//L8003592C()
  function M_Start (line 96) | void M_Start(void)//L80035A9C()
  function M_Stop (line 163) | void M_Stop(int exit)//L80035C40()
  function M_Ticker (line 182) | int M_Ticker(void)//L80035CC4()
  function M_Drawer (line 335) | void M_Drawer(void)//L80036058()
  function M_CrossFadeWipe (line 377) | void M_CrossFadeWipe(void)//L80036248()

FILE: PSXDOOM/m_password.c
  function Encode_Password (line 13) | void Encode_Password(byte *buff)//L80037BBC()
  function Decode_Password (line 152) | int Decode_Password(byte *inbuff, int *levelnum, int *skill, player_t *p...

FILE: PSXDOOM/o_main.c
  type menuitem_t (line 24) | typedef struct
  function O_Start (line 69) | void O_Start(void)//L8003E680()
  function O_Stop (line 111) | void O_Stop(int exit)//L8003E740()
  function O_Ticker (line 127) | int O_Ticker(void)//L8003E764()
  function O_Drawer (line 295) | void O_Drawer(void)//L8003EC38()

FILE: PSXDOOM/p_base.c
  function P_RunMobjBase (line 44) | void P_RunMobjBase(void)//L80013814()
  function P_XYMovement (line 70) | void P_XYMovement(mobj_t *mo)//L800138AC()
  function P_FloatChange (line 157) | void P_FloatChange(mobj_t *mo)//L80013B0C()
  function P_ZMovement (line 204) | void P_ZMovement(mobj_t *mo)//L80013BD4()
  function P_MobjThinker (line 259) | void P_MobjThinker(mobj_t *mobj)//L80013DB4()
  function boolean (line 319) | boolean PB_TryMove(int tryx, int tryy)//L80013ED4()
  function PB_UnsetThingPosition (line 357) | void PB_UnsetThingPosition(mobj_t *thing)//L80013FB4()
  function PB_SetThingPosition (line 407) | void PB_SetThingPosition(mobj_t *thing)//L800140B0()
  function boolean (line 475) | boolean PB_CheckPosition(void)//L800141B0()
  function boolean (line 552) | boolean PB_BoxCrossLine(line_t *ld)//L80014394()
  function boolean (line 607) | boolean PB_CheckLine(line_t *ld)//L800144AC()
  function boolean (line 668) | boolean PB_CheckThing(mobj_t *thing)//L80014598()
  function boolean (line 746) | boolean PB_BlockLinesIterator(int x, int y) //L800146C4()
  function boolean (line 781) | boolean PB_BlockThingsIterator(int x, int y)//L8001498C()

FILE: PSXDOOM/p_ceilng.c
  function T_MoveCeiling (line 19) | void T_MoveCeiling (ceiling_t *ceiling)//L80014A04()
  function EV_DoCeiling (line 116) | int EV_DoCeiling (line_t *line, ceiling_e  type)//L80014C18()
  function P_AddActiveCeiling (line 194) | void P_AddActiveCeiling(ceiling_t *c)//L80014DEC()
  function P_RemoveActiveCeiling (line 212) | void P_RemoveActiveCeiling(ceiling_t *c)//L80014E28()
  function P_ActivateInStasisCeiling (line 233) | void P_ActivateInStasisCeiling(line_t *line)//L80014E90()
  function EV_CeilingCrushStop (line 254) | int	EV_CeilingCrushStop(line_t	*line)//L80014F04()

FILE: PSXDOOM/p_change.c
  function boolean (line 43) | boolean P_ThingHeightClip (mobj_t *thing)//L80014F78()
  function boolean (line 79) | boolean PIT_ChangeSector (mobj_t *thing)//L80015020()
  function boolean (line 131) | boolean P_ChangeSector (sector_t *sector, boolean crunch)//L8001520C()

FILE: PSXDOOM/p_doors.c
  function T_VerticalDoor (line 18) | void T_VerticalDoor (vldoor_t *door)//L800152D0()
  function boolean (line 136) | boolean P_CheckKeyLock(line_t *line, mobj_t *thing)//L80015514()
  function EV_DoDoor (line 216) | int EV_DoDoor (line_t *line, vldoor_e  type)//L800156FC()
  function EV_VerticalDoor (line 293) | void EV_VerticalDoor (line_t *line, mobj_t *thing)//L80015920()
  function P_SpawnDoorCloseIn30 (line 394) | void P_SpawnDoorCloseIn30 (sector_t *sec)//L80015B1C()
  function P_SpawnDoorRaiseIn5Mins (line 415) | void P_SpawnDoorRaiseIn5Mins (sector_t *sec, int secnum)//L80015B9C()

FILE: PSXDOOM/p_enemy.c
  function boolean (line 27) | boolean P_CheckMeleeRange (mobj_t *actor)//L80015C40()
  function boolean (line 54) | boolean P_CheckMissileRange (mobj_t *actor)//L80015CB4()
  function boolean (line 104) | boolean P_Move (mobj_t *actor)//L80015D98()
  function boolean (line 163) | boolean P_TryWalk (mobj_t *actor)//L80015F00()
  function P_NewChaseDir (line 187) | void P_NewChaseDir (mobj_t *actor)//L80015F4C()
  function boolean (line 307) | boolean P_LookForPlayers (mobj_t *actor, boolean allaround)//L800162CC()
  function A_Look (line 379) | void A_Look (mobj_t *actor)//L8001644C()
  function A_Chase (line 434) | void A_Chase (mobj_t *actor)//L80016578()
  function A_FaceTarget (line 524) | void A_FaceTarget (mobj_t *actor)//L800168C0()
  function A_PosAttack (line 545) | void A_PosAttack (mobj_t *actor)//L80016964()
  function A_SPosAttack (line 569) | void A_SPosAttack (mobj_t *actor)//L80016A6C()
  function A_CPosAttack (line 597) | void A_CPosAttack(mobj_t* actor)//L80016BBC()
  function A_CPosRefire (line 626) | void A_CPosRefire(mobj_t* actor)//L80016D08()
  function A_SpidAttack (line 648) | void A_SpidAttack(mobj_t *actor)//L80016E04()
  function A_SpidRefire (line 676) | void A_SpidRefire (mobj_t *actor)//L80016F54()
  function A_BspiAttack (line 694) | void A_BspiAttack(mobj_t *actor)//L80017054()
  function A_TroopAttack (line 714) | void A_TroopAttack (mobj_t *actor)//L80017108()
  function A_SargAttack (line 743) | void A_SargAttack (mobj_t *actor)//L80017248()
  function A_HeadAttack (line 763) | void A_HeadAttack (mobj_t *actor)//L80017318()
  function A_CyberAttack (line 791) | void A_CyberAttack (mobj_t *actor)//L8001744C()
  function A_BruisAttack (line 808) | void A_BruisAttack (mobj_t *actor)//L80017500()
  function A_SkelMissile (line 836) | void A_SkelMissile(mobj_t *actor) //L800175C8()
  function A_Tracer (line 863) | void A_Tracer(mobj_t *actor) //L800176C8()
  function A_SkelWhoosh (line 938) | void A_SkelWhoosh(mobj_t* actor) //L80017918()
  function A_SkelFist (line 954) | void A_SkelFist(mobj_t*	actor) //L800179C8()
  function A_FatRaise (line 981) | void A_FatRaise(mobj_t *actor)//L80017B28()
  function A_FatAttack1 (line 995) | void A_FatAttack1(mobj_t *actor)//L80017BD8()
  function A_FatAttack2 (line 1023) | void A_FatAttack2(mobj_t *actor)//L80017D14()
  function A_FatAttack3 (line 1051) | void A_FatAttack3(mobj_t *actor)//L80017E50()
  function A_SkullAttack (line 1086) | void A_SkullAttack (mobj_t *actor)//L80017FE4()
  function A_PainShootSkull (line 1118) | void A_PainShootSkull(mobj_t *actor, angle_t angle)//L80018194()
  function A_PainAttack (line 1197) | void A_PainAttack(mobj_t *actor)//L800182E8()
  function A_PainDie (line 1214) | void A_PainDie(mobj_t *actor)//L800184B8()
  function A_Scream (line 1230) | void A_Scream (mobj_t *actor)//L800188BC()
  function A_XScream (line 1273) | void A_XScream (mobj_t *actor)//L8001892C()
  function A_Pain (line 1286) | void A_Pain (mobj_t *actor)//L8001894C()
  function A_Fall (line 1300) | void A_Fall (mobj_t *actor)//L80018984()
  function A_Explode (line 1315) | void A_Explode (mobj_t *thingy)//L80018998()
  function A_BossDeath (line 1331) | void A_BossDeath (mobj_t *mo)//L800189BC()
  function A_Hoof (line 1430) | void A_Hoof (mobj_t *mo)//L80018BDC()
  function A_Metal (line 1444) | void A_Metal (mobj_t *mo)//L80018C10()
  function A_BabyMetal (line 1458) | void A_BabyMetal(mobj_t* mo)//L80018C44()
  function L_CrossSpecial (line 1468) | void L_CrossSpecial (mobj_t *mo)
  function L_MissileHit (line 1487) | void L_MissileHit (mobj_t *mo)//L80018C78()
  function L_SkullBash (line 1510) | void L_SkullBash (mobj_t *mo)//L80018CEC()

FILE: PSXDOOM/p_floor.c
  function result_e (line 19) | result_e	T_MovePlane(sector_t *sector,fixed_t speed,
  function T_MoveFloor (line 164) | void T_MoveFloor(floormove_t *floor)//L80018FA8()
  function EV_DoFloor (line 207) | int EV_DoFloor(line_t *line,floor_e floortype)//L80019098()
  function EV_BuildStairs (line 358) | int EV_BuildStairs(line_t *line, stair_e type)//L800194E0()

FILE: PSXDOOM/p_inter.c
  function boolean (line 32) | boolean P_GiveAmmo (player_t *player, ammotype_t ammo, int num)//L800197...
  function boolean (line 110) | boolean P_GiveWeapon (player_t *player, weapontype_t weapon, boolean dro...
  function boolean (line 160) | boolean P_GiveBody (player_t *player, int num)//L80019A8C()
  function boolean (line 183) | boolean P_GiveArmor (player_t *player, int armortype)//L80019AD8()
  function P_GiveCard (line 206) | void P_GiveCard (player_t *player, card_t card)//L80019B14()
  function boolean (line 223) | boolean P_GivePower (player_t *player, powertype_t power)//L80019B40()
  function P_TouchSpecialThing (line 266) | void P_TouchSpecialThing (mobj_t *special, mobj_t *toucher)//L80019C24()
  function P_KillMobj (line 568) | void P_KillMobj (mobj_t *source, mobj_t *target)//L8001A514()
  function P_DamageMobj (line 679) | void P_DamageMobj (mobj_t *target, mobj_t *inflictor, mobj_t *source, in...

FILE: PSXDOOM/p_lights.c
  function T_FireFlicker (line 20) | void T_FireFlicker(fireflicker_t *flick)//L8001AD0C()
  function P_SpawnFireFlicker (line 45) | void P_SpawnFireFlicker(sector_t *sector)//L8001AD98()
  function T_LightFlash (line 68) | void T_LightFlash (lightflash_t *flash)//L8001AE24()
  function P_SpawnLightFlash (line 92) | void P_SpawnLightFlash (sector_t *sector)//L8001AEAC()
  function T_StrobeFlash (line 123) | void T_StrobeFlash (strobe_t *flash)//L8001AF54()
  function P_SpawnStrobeFlash (line 148) | void P_SpawnStrobeFlash (sector_t *sector,int fastOrSlow, int inSync)//L...
  function P_SpawnStrobeFlashFast (line 179) | void P_SpawnStrobeFlashFast(sector_t *sector)//L8001B08C()
  function EV_StartLightStrobing (line 203) | void EV_StartLightStrobing(line_t *line)//L8001B120()
  function EV_TurnTagLightsOff (line 225) | void EV_TurnTagLightsOff(line_t	*line)//L8001B230()
  function EV_LightTurnOn (line 259) | void EV_LightTurnOn(line_t *line, int bright)//L8001B32C()
  function T_Glow (line 299) | void T_Glow(glow_t *g)//L8001B438()
  function P_SpawnGlowingLight (line 322) | void P_SpawnGlowingLight(sector_t *sector, glowtype_e type)//L8001B4F0()

FILE: PSXDOOM/p_local.h
  type dirtype_t (line 41) | typedef enum

FILE: PSXDOOM/p_map.c
  function boolean (line 62) | boolean P_CheckPosition (mobj_t *thing, fixed_t x, fixed_t y)//L8001B5D8()
  function boolean (line 76) | boolean P_TryMove (mobj_t *thing, fixed_t x, fixed_t y)//L8001B614()
  function fixed_t (line 139) | fixed_t P_InterceptVector (divline_t *v2, divline_t *v1)//L8001B73C()
  function boolean (line 164) | boolean	PIT_UseLines (line_t *li)//L8001B7E0()
  function P_UseLines (line 214) | void P_UseLines (player_t *player) //L8001B98C()
  function boolean (line 319) | boolean PIT_RadiusAttack (mobj_t *thing)//L8001BBC8()
  function P_RadiusAttack (line 359) | void P_RadiusAttack (mobj_t *spot, mobj_t *source, int damage)//L8001BCBC()
  function fixed_t (line 443) | fixed_t P_AimLineAttack (mobj_t *t1, angle_t angle, fixed_t distance)//L...
  function P_LineAttack (line 474) | void P_LineAttack (mobj_t *t1, angle_t angle, fixed_t distance, fixed_t ...

FILE: PSXDOOM/p_maputl.c
  function fixed_t (line 18) | fixed_t P_AproxDistance (fixed_t dx, fixed_t dy)//L8001BFC8()
  function P_PointOnLineSide (line 37) | int P_PointOnLineSide (fixed_t x, fixed_t y, line_t *line)//L8001C000()
  function P_PointOnDivlineSide (line 76) | int P_PointOnDivlineSide (fixed_t x, fixed_t y, divline_t *line)//L8001C...
  function P_MakeDivline (line 123) | void P_MakeDivline (line_t *li, divline_t *dl)//L8001C1B4()
  function P_LineOpening (line 145) | void P_LineOpening (line_t *linedef)//L8001C1F4()
  function P_UnsetThingPosition (line 194) | void P_UnsetThingPosition (mobj_t *thing)//L8001C290()
  function P_SetThingPosition (line 249) | void P_SetThingPosition (mobj_t *thing)//L8001C3A0()
  function boolean (line 322) | boolean P_BlockLinesIterator (int x, int y, boolean(*func)(line_t*) )//L...
  function boolean (line 357) | boolean P_BlockThingsIterator (int x, int y, boolean(*func)(mobj_t*) )//...

FILE: PSXDOOM/p_mobj.c
  function P_RemoveMobj (line 26) | void P_RemoveMobj (mobj_t *mobj)//L8001C6BC()
  function P_RespawnSpecials (line 65) | void P_RespawnSpecials (void)//L8001C7D0()
  function boolean (line 132) | boolean P_SetMobjState (mobj_t *mobj, statenum_t state)//L8001C9B0()
  function P_ExplodeMissile (line 166) | void P_ExplodeMissile (mobj_t *mo)//L8001CB34()
  function mobj_t (line 194) | mobj_t *P_SpawnMobj (fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)//...
  function P_SpawnPlayer (line 264) | void P_SpawnPlayer (mapthing_t *mthing)//L8001CDD8()
  function P_SpawnMapThing (line 338) | void P_SpawnMapThing (mapthing_t *mthing)//L8001D11C()
  function P_SpawnPuff (line 466) | void P_SpawnPuff (fixed_t x, fixed_t y, fixed_t z)//L8001D69C()
  function P_SpawnBlood (line 491) | void P_SpawnBlood (fixed_t x, fixed_t y, fixed_t z, int damage)//L8001D8...
  function P_CheckMissileSpawn (line 517) | void P_CheckMissileSpawn (mobj_t *th)//L8001DB10()
  function mobj_t (line 535) | mobj_t *P_SpawnMissile (mobj_t *source, mobj_t *dest, mobjtype_t type)//...
  function P_SpawnPlayerMissile (line 577) | void P_SpawnPlayerMissile (mobj_t *source, mobjtype_t type)//L8001E08C()

FILE: PSXDOOM/p_move.c
  function P_TryMove2 (line 48) | void P_TryMove2(void)//L8001E48C()
  function boolean (line 119) | static boolean PM_CrossCheck(line_t *ld)
  function PM_PointOnLineSide (line 141) | int PM_PointOnLineSide(fixed_t x, fixed_t y, line_t *line)//L8001E6B8()
  function PM_UnsetThingPosition (line 168) | void PM_UnsetThingPosition(mobj_t *thing)//L8001E704()
  function PM_SetThingPosition (line 222) | void PM_SetThingPosition(mobj_t *thing)//L8001E800()
  function PM_CheckPosition (line 291) | void PM_CheckPosition (void) //L8001E910()
  function boolean (line 399) | boolean PM_BoxCrossLine (line_t *ld)//L8001EC00()
  function boolean (line 455) | boolean PIT_CheckLine (line_t *ld)//L8001ED0C()
  function boolean (line 534) | boolean PIT_CheckThing(mobj_t *thing)//L8001EE5C()
  function boolean (line 628) | boolean PM_BlockLinesIterator(int x, int y)//L8001EFC0()
  function boolean (line 663) | boolean PM_BlockThingsIterator(int x, int y)//L8001F1A0()

FILE: PSXDOOM/p_plats.c
  function T_PlatRaise (line 18) | void	T_PlatRaise(plat_t	*plat)//L8001F218()
  function EV_DoPlat (line 92) | int	EV_DoPlat(line_t *line,plattype_e type,int amount)//L8001F3FC()
  function P_ActivateInStasis (line 192) | void P_ActivateInStasis(int tag)//L8001F6F8()
  function EV_StopPlat (line 206) | void EV_StopPlat(line_t *line)//L8001F76C()
  function P_AddActivePlat (line 222) | void P_AddActivePlat(plat_t *plat)//L8001F7E0()
  function P_RemoveActivePlat (line 236) | void P_RemoveActivePlat(plat_t *plat)//L8001F838()

FILE: PSXDOOM/p_pspr.c
  function P_RecursiveSound (line 28) | void P_RecursiveSound (sector_t *sec, int soundblocks)//L8001F8B0()
  function P_NoiseAlert (line 79) | void P_NoiseAlert (player_t *player)//L8001F9CC()
  function P_SetPsprite (line 105) | void P_SetPsprite (player_t *player, int position, statenum_t stnum) //L...
  function P_BringUpWeapon (line 239) | void P_BringUpWeapon (player_t *player)//L8001FBB0()
  function boolean (line 270) | boolean P_CheckAmmo (player_t *player)//L8001FCE4()
  function P_FireWeapon (line 322) | void P_FireWeapon (player_t *player)//L8001FF54()
  function P_DropWeapon (line 348) | void P_DropWeapon (player_t *player)//L8002015C()
  function A_WeaponReady (line 364) | void A_WeaponReady (player_t *player, pspdef_t *psp)//L80020230()
  function A_ReFire (line 418) | void A_ReFire (player_t *player, pspdef_t *psp)//L80020418()
  function A_CheckReload (line 444) | void A_CheckReload(player_t *player, pspdef_t *psp)//L800204B4()
  function A_Lower (line 457) | void A_Lower (player_t *player, pspdef_t *psp)//L800204D4()
  function A_Raise (line 492) | void A_Raise (player_t *player, pspdef_t *psp)//L8002064C()
  function A_GunFlash (line 520) | void A_GunFlash (player_t *player, pspdef_t *psp) //L80020738()
  function A_Punch (line 543) | void A_Punch (player_t *player, pspdef_t *psp) //L8002080C()
  function A_Saw (line 570) | void A_Saw (player_t *player, pspdef_t *psp) //L80020904()
  function A_FireMissile (line 616) | void A_FireMissile (player_t *player, pspdef_t *psp) //L80020A7C()
  function A_FireBFG (line 631) | void A_FireBFG (player_t *player, pspdef_t *psp) //L80020AE0()
  function A_FirePlasma (line 646) | void A_FirePlasma (player_t *player, pspdef_t *psp) //L80020B44()
  function P_BulletSlope (line 663) | void P_BulletSlope(mobj_t*	mo)//L80020C6C()
  function P_GunShot (line 691) | void P_GunShot (mobj_t *mo, boolean accurate)//L80020CF8()
  function A_FirePistol (line 711) | void A_FirePistol (player_t *player, pspdef_t *psp) //L80020D88()
  function A_FireShotgun (line 729) | void A_FireShotgun (player_t *player, pspdef_t *psp) //L80020F14()
  function A_FireShotgun2 (line 762) | void A_FireShotgun2(player_t *player, pspdef_t *psp)//L800210C4()
  function A_CockSgun (line 793) | void A_CockSgun (player_t *player, pspdef_t *psp)
  function A_FireCGun (line 807) | void A_FireCGun (player_t *player, pspdef_t *psp) //L8002130C()
  function A_Light0 (line 825) | void A_Light0 (player_t *player, pspdef_t *psp)//L800214F4()
  function A_Light1 (line 830) | void A_Light1 (player_t *player, pspdef_t *psp)//L800214FC()
  function A_Light2 (line 835) | void A_Light2 (player_t *player, pspdef_t *psp)//L80021508()
  function A_BFGSpray (line 850) | void A_BFGSpray (mobj_t *mo) //L80021514()
  function A_BFGsound (line 881) | void A_BFGsound (player_t *player, pspdef_t *psp)//L80021604()
  function A_OpenShotgun2 (line 894) | void A_OpenShotgun2(player_t *player, pspdef_t *psp)//L80021628()
  function A_LoadShotgun2 (line 907) | void A_LoadShotgun2(player_t *player, pspdef_t *psp)//L8002164C()
  function A_CloseShotgun2 (line 920) | void A_CloseShotgun2(player_t *player, pspdef_t *psp)//L80021670()
  function P_SetupPsprites (line 939) | void P_SetupPsprites (int curplayer) //L8002172C() //(player_t *player)
  function P_MovePsprites (line 968) | void P_MovePsprites (player_t *player) //L800218A4()

FILE: PSXDOOM/p_setup.c
  function P_LoadVertexes (line 56) | void P_LoadVertexes (int lump)//L80021A64()
  function P_LoadSegs (line 90) | void P_LoadSegs (int lump)//L80021B38()
  function P_LoadSubsectors (line 147) | void P_LoadSubsectors (int lump)//L80021D70()
  function P_LoadSectors (line 184) | void P_LoadSectors (int lump)//L80021E5C()
  function P_LoadNodes (line 251) | void P_LoadNodes (int lump)//L8002209C()
  function P_LoadThings (line 292) | void P_LoadThings (int lump)//L80022210()
  function P_LoadLineDefs (line 333) | void P_LoadLineDefs (int lump)//L80022314()
  function P_LoadSideDefs (line 422) | void P_LoadSideDefs (int lump)//L800225E8()
  function P_LoadBlockMap (line 461) | void P_LoadBlockMap (int lump)//L80022764()
  function P_LoadReject (line 496) | void P_LoadReject(int lump)//L80022864()
  function P_LoadLeafs (line 515) | void P_LoadLeafs(int lump)//L800228B8()
  function P_GroupLines (line 593) | void P_GroupLines (void)//L80022AF0()
  function P_Init (line 683) | void P_Init (void)//L80022E00()
  function P_SetupLevel (line 768) | void P_SetupLevel(int map, skill_t skill)//L8002306C()
  type compressFlags (line 905) | enum compressFlags {Decode,NoDecode,Error}
  type psxblock_t (line 906) | typedef struct psxblock_s
  function P_LoadBlocks (line 918) | void P_LoadBlocks(char *filename)//L80023698()
  function P_CacheSprite (line 1162) | void P_CacheSprite(spritedef_t *sprdef)//L80023970()
  function P_LoadTextureByWidth (line 1195) | void P_LoadTextureByWidth(int width)//L80023A60()

FILE: PSXDOOM/p_shoot.c
  type thingline_t (line 38) | typedef	struct
  function P_Shoot2 (line 60) | void P_Shoot2(void)//L80023BCC()
  function boolean (line 129) | boolean PA_DoIntercept(void *value, boolean isline, int frac)//L80023DD4()
  function boolean (line 168) | boolean	PA_ShootLine(line_t *li, fixed_t interceptfrac)//L80023E5C()
  function boolean (line 241) | boolean PA_ShootThing(mobj_t *th, fixed_t interceptfrac)//L80024054()
  function fixed_t (line 300) | fixed_t PA_SightCrossLine(line_t *line)//L800241F4()
  function boolean (line 359) | boolean PA_CrossSubsector(subsector_t *sub)//L800242CC
  function PA_DivlineSide (line 443) | int PA_DivlineSide(fixed_t x, fixed_t y, divline_t *line)//L800246F0()
  function boolean (line 462) | boolean PA_CrossBSPNode(int bspnum)//L80024734()

FILE: PSXDOOM/p_sight.c
  function P_CheckSights (line 26) | void P_CheckSights(void)//L800248A0()
  function boolean (line 58) | boolean P_CheckSight(mobj_t *t1, mobj_t *t2)//L8002494C()
  function fixed_t (line 116) | fixed_t PS_SightCrossLine (line_t *line)//L80024AD4()
  function boolean (line 173) | boolean PS_CrossSubsector(subsector_t *sub)//L80024BAC()
  function boolean (line 257) | boolean PS_CrossBSPNode(int bspnum)//L80024E58()

FILE: PSXDOOM/p_slide.c
  function P_SlideMove (line 49) | void P_SlideMove(void)//L80024FC4()
  function fixed_t (line 118) | fixed_t P_CompletableFrac(fixed_t dx, fixed_t dy)//L80025154()
  function SL_PointOnSide (line 203) | int SL_PointOnSide(fixed_t x, fixed_t y)//L800253F8()
  function fixed_t (line 221) | fixed_t SL_CrossFrac (void)//L80025468()
  function boolean (line 245) | boolean CheckLineEnds (void)//L80025520()
  function SL_ClipToLine (line 288) | void SL_ClipToLine( void )//L800255E0()
  function boolean (line 342) | boolean SL_CheckLine(line_t *ld)//L800257D8()
  function SL_PointOnSide2 (line 410) | int	SL_PointOnSide2(fixed_t x1, fixed_t y1, fixed_t x2, fixed_t y2, fixe...
  function SL_CheckSpecialLines (line 433) | void SL_CheckSpecialLines (fixed_t x1, fixed_t y1, fixed_t x2, fixed_t y...

FILE: PSXDOOM/p_spec.c
  function P_InitPicAnims (line 37) | void P_InitPicAnims (void)//L80025EDC()
  function side_t (line 110) | side_t *getSide(int currentSector,int line, int side)//L800261BC()
  function sector_t (line 119) | sector_t *getSector(int currentSector,int line,int side)//L80026218()
  function twoSided (line 128) | int	twoSided(int sector,int line)//L8002627C()
  function sector_t (line 138) | sector_t *getNextSector(line_t *line,sector_t *sec)//L800262BC()
  function fixed_t (line 154) | fixed_t	P_FindLowestFloorSurrounding(sector_t *sec)//L800262EC()
  function fixed_t (line 178) | fixed_t	P_FindHighestFloorSurrounding(sector_t *sec)//L80026380()
  function fixed_t (line 202) | fixed_t	P_FindNextHighestFloor(sector_t *sec,int currentheight)//L800264...
  function fixed_t (line 266) | fixed_t	P_FindLowestCeilingSurrounding(sector_t *sec)//L800264FC()
  function fixed_t (line 290) | fixed_t	P_FindHighestCeilingSurrounding(sector_t *sec)//L80026598()
  function P_FindSectorFromLineTag (line 314) | int	P_FindSectorFromLineTag(line_t	*line,int start)//L80026630()
  function P_FindMinSurroundingLight (line 329) | int	P_FindMinSurroundingLight(sector_t *sector,int max)//L80026698()
  function P_CrossSpecialLine (line 372) | void P_CrossSpecialLine (line_t *line, mobj_t *thing)//L8002672C()
  function P_ShootSpecialLine (line 678) | void	P_ShootSpecialLine ( mobj_t *thing, line_t *line)//L80026CD8()
  function P_PlayerInSpecialSector (line 726) | void P_PlayerInSpecialSector (player_t *player)//L80026DA0()
  function P_UpdateSpecials (line 792) | void P_UpdateSpecials (void)//L80026F60()
  function EV_DoDonut (line 895) | int EV_DoDonut(line_t *line)//L800273F4()
  function P_SpawnDelayTimer (line 976) | void P_SpawnDelayTimer(int tics, void(*action)())//L80027640()
  function T_CountdownTimer (line 996) | void T_CountdownTimer(delay_t *timer)//L800276B0()
  function P_ExitLevel (line 1015) | void P_ExitLevel(void)//L80027700()
  function P_SecretExitLevel (line 1030) | void P_SecretExitLevel(int map)//L80027778()
  function P_SpawnSpecials (line 1060) | void P_SpawnSpecials (void)//L800277E4()
  function P_FireSky (line 1221) | void P_FireSky(psxobj_t *psxobj)//L80027B90()

FILE: PSXDOOM/p_spec.h
  type anim_t (line 16) | typedef struct
  type animdef_t (line 29) | typedef struct
  type delay_t (line 64) | typedef struct
  type fireflicker_t (line 125) | typedef struct
  type lightflash_t (line 134) | typedef struct
  type strobe_t (line 145) | typedef struct
  type glowtype_e (line 157) | typedef enum
  type glow_t (line 164) | typedef struct
  type switchlist_t (line 199) | typedef struct
  type bwhere_e (line 205) | typedef enum
  type button_t (line 212) | typedef struct
  type plat_e (line 238) | typedef enum
  type plattype_e (line 246) | typedef enum
  type plat_t (line 255) | typedef struct
  type vldoor_e (line 291) | typedef enum
  type vldoor_t (line 303) | typedef struct
  type ceiling_e (line 333) | typedef enum
  type ceiling_t (line 343) | typedef struct
  type floor_e (line 375) | typedef enum
  type stair_e (line 391) | typedef enum
  type floormove_t (line 397) | typedef struct
  type result_e (line 412) | typedef enum

FILE: PSXDOOM/p_switch.c
  function P_InitSwitchList (line 79) | void P_InitSwitchList(void)//L80027C64()
  function P_StartButton (line 115) | void P_StartButton(line_t *line,bwhere_e w,int texture,int time)//80027D88
  function P_ChangeSwitchTexture (line 141) | void P_ChangeSwitchTexture(line_t *line,int useAgain)//L80027E1C()
  function boolean (line 199) | boolean P_UseSpecialLine ( mobj_t *thing, line_t *line)//L8002810C()

FILE: PSXDOOM/p_telept.c
  function P_Telefrag (line 14) | void P_Telefrag (mobj_t *thing, fixed_t x, fixed_t y)//L80028700()
  function EV_Teleport (line 42) | int	EV_Teleport( line_t *line,mobj_t *thing )//L800287F8()

FILE: PSXDOOM/p_tick.c
  function P_InitThinkers (line 37) | void P_InitThinkers (void)
  function P_AddThinker (line 54) | void P_AddThinker (thinker_t *thinker)//L80028B18()
  function P_RemoveThinker (line 73) | void P_RemoveThinker (thinker_t *thinker)//L80028B48()
  function P_RunThinkers (line 86) | void P_RunThinkers (void)//L80028B54()
  function P_RunMobjLate (line 126) | void P_RunMobjLate (void)//L80028C10()
  type cheatnum_t (line 156) | typedef enum
  function P_CheckCheats (line 189) | void P_CheckCheats (void)//L80028C74()
  function P_Ticker (line 480) | int P_Ticker (void)//800292E4
  function P_Drawer (line 533) | void P_Drawer (void) //L800294CC()
  function P_Start (line 548) | void P_Start (void)//L80029554()
  function P_Stop (line 564) | void P_Stop (int exit)//L800295EC()

FILE: PSXDOOM/p_user.c
  function P_PlayerMove (line 26) | void P_PlayerMove (mobj_t *mo)//L80029670()
  function P_PlayerXYMovement (line 96) | void P_PlayerXYMovement (mobj_t *mo)//L800297E8()
  function P_PlayerZMovement (line 132) | void P_PlayerZMovement (mobj_t *mo)//L800298D8()
  function P_PlayerMobjThink (line 189) | void P_PlayerMobjThink (mobj_t *mobj)//L80029A08()
  function P_BuildMove (line 234) | void P_BuildMove (player_t *player) //L80029CA4()
  function P_Thrust (line 389) | void P_Thrust (player_t *player, angle_t angle, fixed_t move) //L8002A188()
  function P_CalcHeight (line 408) | void P_CalcHeight (player_t *player) //L8002A1FC()
  function P_MovePlayer (line 480) | void P_MovePlayer (player_t *player)//L8002A3B8()
  function P_DeathThink (line 507) | void P_DeathThink (player_t *player)//L8002A570()
  function P_PlayerThink (line 556) | void P_PlayerThink (player_t *player)//L8002A6C8()

FILE: PSXDOOM/psxmain.c
  function main (line 71) | int main()
  function PSX_INIT (line 77) | void PSX_INIT(void)//L80032804()
  function I_Error (line 133) | void I_Error(char *error, ...)//L800329BC
  function ImageToVram (line 153) | void ImageToVram(psxobj_t *pic, char *name, int lump)//L80032A68()
  function DrawStaticImage (line 198) | void DrawStaticImage(psxobj_t *psxobj, int xpos, int ypos, int pal)//L80...
  function DrawImage (line 204) | void DrawImage(int vtpage, int pal, int xpos, int ypos,  char vramx, cha...
  function P_LoadingPlaque (line 221) | void P_LoadingPlaque(psxobj_t *psxobj, int xpos, int ypos, int pal)//L80...
  function NextTextureCacheIdx (line 236) | void NextTextureCacheIdx(void)//L8003324C()
  function DrawRender (line 245) | void DrawRender(void)//80033264
  function Add_vsync (line 279) | void Add_vsync(void)//L80033380()
  type VRAMMEM (line 285) | typedef struct v_vrammem
  function Init_Vram_Cache (line 300) | void Init_Vram_Cache(void)//800333A0
  function TextureCache (line 307) | void TextureCache(psxobj_t *psxobj)
  function V_ClearBlock (line 416) | void V_ClearBlock(psxobj_t *psxobj)
  function Valloc_Init (line 438) | void Valloc_Init(void)
  function Vram_Viewer (line 498) | void Vram_Viewer(int page)//80033938
  function Link_Conection (line 571) | void Link_Conection(void)//L800345A0()
  function boolean (line 668) | boolean Update_Conection(void)//L80034868()
  function Sync_Data_Transmission (line 731) | void Sync_Data_Transmission(void) //L80034AC0()
  function Sync_Read_Write (line 755) | void Sync_Read_Write (void) //L80034B1C()
  function UpdateDrawOTag (line 798) | void UpdateDrawOTag(void)//80034C60
  function Get_CfgCode (line 819) | unsigned int Get_CfgCode(unsigned int *cfgdata)//L80034CAC
  function W_AddPrim (line 879) | void W_AddPrim (void* prim)
  function W_AddPrim (line 955) | void W_AddPrim (void* prim, unsigned long* addr0, unsigned long* addr1)

FILE: PSXDOOM/pw_main.c
  function PW_Start (line 26) | void PW_Start(void)//L80036C1C()
  function PW_Stop (line 45) | void PW_Stop(int exit)//L80036C1C()
  function PW_Ticker (line 60) | int PW_Ticker(void)//L80036CA0()
  function PW_Drawer (line 172) | void PW_Drawer(void) //L80036F34()

FILE: PSXDOOM/r_data.c
  function R_InitData (line 49) | void R_InitData (void)//L8002B878()
  function R_InitTextures (line 68) | void R_InitTextures(void)//L8002B8B0()
  function R_InitFlats (line 125) | void R_InitFlats(void)//L8002BA20()
  function R_InitSprite (line 163) | void R_InitSprite(void)//L8002BB24()
  function R_TextureNumForName (line 220) | int	R_TextureNumForName(char *name)//L8002BC74()
  function R_FlatNumForName (line 272) | int	R_FlatNumForName (char *name)//L8002BD38()
  function R_InitPalettes (line 315) | void R_InitPalettes(void)//L8002BDFC()
  function R_CheckTextureNumForName (line 372) | int	R_CheckTextureNumForName (char *name)

FILE: PSXDOOM/r_local.h
  type divline_t (line 48) | typedef struct
  type vertex_t (line 53) | typedef struct
  type line_s (line 63) | struct line_s
  type subsector_s (line 64) | struct subsector_s
  type sector_t (line 66) | typedef	struct
  type side_t (line 89) | typedef struct
  type slopetype_t (line 97) | typedef enum {ST_HORIZONTAL, ST_VERTICAL, ST_POSITIVE, ST_NEGATIVE} slop...
  type line_t (line 99) | typedef struct line_s
  type subsector_t (line 114) | typedef struct subsector_s
  type seg_t (line 126) | typedef struct seg_s
  type node_t (line 142) | typedef struct
  type leaf_t (line 150) | typedef struct {
  type texture_t (line 156) | typedef struct
  type light_t (line 171) | typedef struct {
  type spriteframe_t (line 200) | typedef struct
  type spritedef_t (line 207) | typedef struct

FILE: PSXDOOM/r_main.c
  function R_Init (line 91) | void R_Init (void) //L80030480()
  function R_RenderPlayerView (line 121) | void R_RenderPlayerView(void)//L80030504()
  function SlopeDiv (line 206) | inline int SlopeDiv(unsigned num, unsigned den)//L80030A28()
  function angle_t (line 215) | angle_t R_PointToAngle2(fixed_t x1, fixed_t y1, fixed_t x2, fixed_t y2)/...
  function R_PointOnSide (line 274) | inline int	R_PointOnSide(int x, int y, node_t *node)//L80030D84()
  type subsector_s (line 312) | struct subsector_s

FILE: PSXDOOM/r_phase1.c
  function R_BSP (line 37) | void R_BSP(void) //L8002ABB8()
  function R_RenderBSPNode (line 50) | void R_RenderBSPNode(int bspnum)//L8002AC0C()
  function boolean (line 122) | boolean R_CheckBBox(fixed_t bspcoord[4])//L8002AD44()
  function R_Subsector (line 282) | void R_Subsector(int num)//L8002B1A8()
  function R_AddLine (line 315) | void R_AddLine(seg_t *line)//L8002B288

FILE: PSXDOOM/r_phase2.c
  function R_RenderSKY (line 7) | void R_RenderSKY(void)//L8002BF4C
  type vleaf_t (line 43) | typedef struct
  type PlaneType (line 62) | typedef enum PlaneType {FLOOR, CEILING} PlaneType;
  function R_RenderAll (line 73) | void R_RenderAll(subsector_t *sub)//L8002C5C8
  function R_FrontZClip (line 210) | void R_FrontZClip(vleaf_t *vlf_in, vleaf_t **vlf_out)//L8002C95C()
  function R_EdgeClipSide (line 296) | int R_EdgeClipSide(int mode, vleaf_t **vlf)//L8002CC38()
  function R_LeftEdgeClip (line 357) | int R_LeftEdgeClip(vleaf_t *vlf_in, vleaf_t **vlf_out)//L8002CD38()
  function R_RightEdgeClip (line 436) | int R_RightEdgeClip(vleaf_t *vlf_in, vleaf_t **vlf_out)//L8002CFDC()
  function R_WallPrep (line 517) | void R_WallPrep(leaf_t *lf)//L8002D27C
  function R_Render_Wall (line 626) | void R_Render_Wall(leaf_t *lf, psxobj_t *texture, int topheight, int bot...
  function R_PlanePrep (line 818) | void R_PlanePrep(vleaf_t *vlf1, PlaneType planeType)//L8002E178
  type xpos_t (line 878) | typedef struct
  function R_Render_Plane (line 886) | void R_Render_Plane(vleaf_t *vlf1, int zheight, psxobj_t *psxobj)
  type vissprite_t (line 1216) | typedef struct vissprite_s
  function R_Render_Sprite (line 1230) | void R_Render_Sprite(subsector_t *sub)//L8002F200
  function R_Render_Hud_Weapons (line 1418) | void R_Render_Hud_Weapons(void)//L8002FD04

FILE: PSXDOOM/s_sound.c
  type mapaudio_t (line 17) | typedef struct mapaudio_s
  type music_t (line 23) | typedef struct music_s
  type Musics (line 32) | enum Musics
  function S_SetSoundVolume (line 238) | void S_SetSoundVolume (int volume) //80040D1C
  function S_SetMusicVolume (line 251) | void S_SetMusicVolume(int volume)//80040D3C
  function S_StopMusic (line 272) | void S_StopMusic(void)//80040D84
  function S_StartMusic (line 286) | void S_StartMusic(void)//80040DC0
  function S_InitBlock (line 301) | void S_InitBlock(SampleBlock *sampblk)//80040E08
  function S_DoBlockClear (line 314) | void S_DoBlockClear(SampleBlock *sampblk)//80040E10
  function S_Lcd_Load (line 325) | void S_Lcd_Load(int map_indx)//80040E88
  function S_Pause (line 385) | void S_Pause(void)//80041088
  function S_Resume (line 398) | void S_Resume(void)//800410B0
  function S_StopSound (line 411) | void S_StopSound(unsigned long sequence_type)//800410D8
  function S_StopAll (line 424) | void S_StopAll(void)//800410F8
  function S_AdjustSoundParams (line 448) | void S_AdjustSoundParams(mobj_t *origin, int sound_id, TriggerPlayAttr *...
  function S_StartSound (line 529) | void S_StartSound(mobj_t *origin, int sound_id)//80041324
  function S_UpdateSounds (line 542) | void S_UpdateSounds(void) //80041344
  function PsxSoundInit (line 555) | void PsxSoundInit(int sfx_volume, int mus_volume, void *data)//8004135C
  function PsxSoundExit (line 608) | void PsxSoundExit (void)//8004149C

FILE: PSXDOOM/sounds.h
  type sfxenum_t (line 8) | typedef enum

FILE: PSXDOOM/soundst.h
  type sfx_t (line 4) | typedef struct
  type sfxinfo_t (line 16) | typedef struct sfxinfo_s
  type musicinfo_t (line 27) | typedef struct
  type sfxchannel_t (line 39) | typedef struct

FILE: PSXDOOM/st_main.c
  function ST_Init (line 155) | void ST_Init (void)//L800382D4()
  function ST_InitEveryLevel (line 181) | void ST_InitEveryLevel(void)//L8003838C()
  function ST_Ticker (line 213) | void ST_Ticker (void)//L80038404()
  function ST_Drawer (line 375) | void ST_Drawer (void)//L80038888();
  function ST_DrawValue (line 563) | void ST_DrawValue(int x, int y, int value)//L8003A144()
  function ST_DrawMessage (line 605) | void ST_DrawMessage(int x, int y, char *text)//L8003A750()
  function ST_CheatDraw (line 641) | void ST_CheatDraw(void)//L8003AA80()
  function ST_doPaletteStuff (line 683) | void ST_doPaletteStuff(void)//L8003AE6C()
  function ST_GetTextCenterX (line 745) | int ST_GetTextCenterX(char *text)//L8003AFB4()
  function ST_DrawText (line 797) | void ST_DrawText(int x, int y, char *text)//L8003B0A0()

FILE: PSXDOOM/st_main.h
  type spclface_e (line 37) | typedef enum
  type facedata_t (line 60) | typedef struct
  type sbobj_e (line 72) | typedef enum
  type sbflash_t (line 86) | typedef struct
  type stbar_t (line 94) | typedef struct
  type symboldata_t (line 114) | typedef struct {

FILE: PSXDOOM/t_main.c
  function T_Start (line 25) | void T_Start(void)//L80034EA0()
  function T_Stop (line 70) | void T_Stop(int exit)//L80035070()
  function T_Ticker (line 84) | int T_Ticker(void)//L8003509C()
  function T_Draw (line 151) | void T_Draw(void)//L80035214()

FILE: PSXDOOM/vsprintf.c
  function mystrlen (line 3) | int mystrlen(char *string)//80030F58
  function D_vsprintf (line 11) | int D_vsprintf(char *string, const char *format, int *argptr)//80030F98

FILE: PSXDOOM/w_wad.c
  type wadinfo_t (line 11) | typedef struct
  function W_Init (line 58) | void W_Init (void)//L80031264()
  function W_CheckNumForName (line 96) | int	W_CheckNumForName (char *name)//L80031374()
  function W_GetNumForName (line 140) | int	W_GetNumForName (char *name)//L80031428()
  function W_LumpLength (line 162) | int W_LumpLength (int lump)//L80031518()
  function W_ReadLump (line 179) | void W_ReadLump (int lump, void *dest, boolean decodelump)//L80031568()
  function byte (line 312) | byte *W_OpenMapWad(char *mapname)//L800319D4()
  function W_MapLumpLength (line 345) | int W_MapLumpLength(int lump)//L80031AA4()
  function W_MapGetNumForName (line 362) | int W_MapGetNumForName(char *name)//L80031AF4()
  function W_ReadMapLump (line 403) | void W_ReadMapLump(int lump, void *dest, int decodelump)//L80031BB0()
  function decode (line 444) | void decode(unsigned char *input, unsigned char *output)//L80031C60()
  function decodedsize (line 488) | int decodedsize(unsigned char *input)//L80031D18()

FILE: PSXDOOM/z_zone.c
  function Z_Init (line 39) | void Z_Init (void)//L80032014()
  function memzone_t (line 61) | memzone_t *Z_InitZone(byte *base, int size)//L8003206C()
  function Z_Free2 (line 338) | inline void Z_Free2(memzone_t *mainzone, void *ptr)//L800324A8()
  function Z_FreeTags (line 361) | void Z_FreeTags (memzone_t *mainzone, int tag)//L80032510()
  function Z_CheckHeap (line 400) | void Z_CheckHeap (memzone_t *mainzone)//L80032640()
  function Z_ChangeTag (line 433) | void Z_ChangeTag (void *ptr, int tag)//L80032708()
  function Z_FreeMemory (line 454) | int Z_FreeMemory (memzone_t *mainzone)//L80032794()
  function Z_DumpHeap (line 477) | void Z_DumpHeap(memzone_t *mainzone)//L800327D4()
Condensed preview — 111 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,416K chars).
[
  {
    "path": "CONTRIBUTORS.md",
    "chars": 7329,
    "preview": "\r\n= PSXDOOM RE contributors (sorted alphabetically)\r\n=\r\n\r\n* **[Darragh Coy (intacowetrust)](https://github.com/BodbDearg"
  },
  {
    "path": "ERRORDETECTION.md",
    "chars": 1098,
    "preview": "PSXDOOM RE Error detection before source code release (sorted alphabetically)\r\n========================================="
  },
  {
    "path": "LICENSE",
    "chars": 35149,
    "preview": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
  },
  {
    "path": "PSXDOOM/GAME/CD/PSXDOOM/CDAUDIO/tmp.txt",
    "chars": 9,
    "preview": "temp file"
  },
  {
    "path": "PSXDOOM/GAME/CD/PSXDOOM/MAPDIR0/tmp.txt",
    "chars": 9,
    "preview": "temp file"
  },
  {
    "path": "PSXDOOM/GAME/CD/PSXDOOM/MAPDIR1/tmp.txt",
    "chars": 9,
    "preview": "temp file"
  },
  {
    "path": "PSXDOOM/GAME/CD/PSXDOOM/MAPDIR2/tmp.txt",
    "chars": 9,
    "preview": "temp file"
  },
  {
    "path": "PSXDOOM/GAME/CD/PSXDOOM/MAPDIR3/tmp.txt",
    "chars": 9,
    "preview": "temp file"
  },
  {
    "path": "PSXDOOM/GAME/CD/PSXDOOM/MAPDIR4/tmp.txt",
    "chars": 9,
    "preview": "temp file"
  },
  {
    "path": "PSXDOOM/GAME/CD/PSXDOOM/MAPDIR5/tmp.txt",
    "chars": 9,
    "preview": "temp file"
  },
  {
    "path": "PSXDOOM/GAME/CD/PSXDOOM/MAPDIR6/tmp.txt",
    "chars": 9,
    "preview": "temp file"
  },
  {
    "path": "PSXDOOM/GAME/CD/PSXDOOM/MAPDIR7/tmp.txt",
    "chars": 9,
    "preview": "temp file"
  },
  {
    "path": "PSXDOOM/GAME/CD/PSXDOOM/MUSIC/tmp.txt",
    "chars": 9,
    "preview": "temp file"
  },
  {
    "path": "PSXDOOM/GAME/CD/PSXDOOM/SNDMAPS1/tmp.txt",
    "chars": 9,
    "preview": "temp file"
  },
  {
    "path": "PSXDOOM/GAME/CD/PSXDOOM/SNDMAPS2/tmp.txt",
    "chars": 9,
    "preview": "temp file"
  },
  {
    "path": "PSXDOOM/GAME/CD/PSXDOOM/SNDMAPS3/tmp.txt",
    "chars": 9,
    "preview": "temp file"
  },
  {
    "path": "PSXDOOM/GAME/MAKE_CD.bat",
    "chars": 119,
    "preview": "mkpsxiso.exe -y -makeabs -lba2 doom.txt -lba doom_.txt PSXDOOMCD.xml\r\n\r\ncopy PSXCDABS.C ..\\\r\ncopy PSXCDABS.H ..\\\r\npause"
  },
  {
    "path": "PSXDOOM/GAME/PSXDOOMCD.xml",
    "chars": 27188,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n\r\n<!-- MKPSXISO example XML script -->\r\n\r\n<iso_project image_name=\"PSXDOOM.bin\" "
  },
  {
    "path": "PSXDOOM/LCDLOAD.C",
    "chars": 10247,
    "preview": "// Reconstruido por Erick Vasquez Garcia 16/05/2019 [GEC]\r\n// Update 20/10/2019 [GEC]\r\n\r\n#include <libspu.h>\r\n#include \""
  },
  {
    "path": "PSXDOOM/LCDLOAD.H",
    "chars": 877,
    "preview": "    /*------------------------------------------------------------------*/\r\n    /*\r\n                      Williams Enter"
  },
  {
    "path": "PSXDOOM/MAIN.LNK",
    "chars": 2826,
    "preview": "\r\n\torg\t$80010000\r\n\r\ntext\tgroup\t\t\t\t; main text group\r\nbss\tgroup\tbss\t\t\t; main data group\r\n\r\n\tsection\t.rdata,text\t; main se"
  },
  {
    "path": "PSXDOOM/MAKEFILE.bat",
    "chars": 8826,
    "preview": "@echo off\r\nset PATH=C:\\psyq\\bin\r\nset PSYQ_PATH=C:\\psyq\\bin\r\n\r\n::remove_all:\r\n\tdel obj\\*.obj\r\n\tdel asm\\*.s\r\n@echo on\r\n\r\n:"
  },
  {
    "path": "PSXDOOM/PSXCD.C",
    "chars": 32790,
    "preview": "// Reconstruido Y Verificado por Erick Vasquez Garcia 16/05/2019 [GEC]\r\n// Update_1 20/10/2019 [GEC]\r\n// Update_2 32/01/"
  },
  {
    "path": "PSXDOOM/PSXCD.H",
    "chars": 4886,
    "preview": "    /*------------------------------------------------------------------*/\r\n    /*\r\n                     Sony CD Archite"
  },
  {
    "path": "PSXDOOM/PSXCDABS.C",
    "chars": 5233,
    "preview": "\r\nPsxCd_MapTbl cdmaptbl[] = \r\n{\r\n\t{23,\t68},\r\n\t{24,\t907264},\r\n\t{469,\t32768},\r\n\t{485,\t32768},\r\n\t{501,\t657392},\r\n\t{822,\t338"
  },
  {
    "path": "PSXDOOM/PSXCDABS.H",
    "chars": 7134,
    "preview": "#define _SYSTEM_CNF\t0\r\n#define _SLUS_000_77\t1\r\n#define _DEMO1_LMP\t2\r\n#define _DEMO2_LMP\t3\r\n#define _MAPSPR60_IMG\t4\r\n#def"
  },
  {
    "path": "PSXDOOM/PSXCMD.C",
    "chars": 27629,
    "preview": "// Reconstruido por Erick Vasquez Garcia 16/05/2019 [GEC]\r\n// Update_1 20/10/2019 [GEC]\r\n// Update_2 32/01/2020 [GEC]\r\n\r"
  },
  {
    "path": "PSXDOOM/PSXDOOM.cbp",
    "chars": 5915,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\n<CodeBlocks_project_file>\n\t<FileVersion major=\"1\" minor=\"6\" />\n"
  },
  {
    "path": "PSXDOOM/PSXDOOM.layout",
    "chars": 178,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\n<CodeBlocks_layout_file>\n\t<FileVersion major=\"1\" minor=\"0\" />\n\t"
  },
  {
    "path": "PSXDOOM/PSXSPU.C",
    "chars": 6681,
    "preview": "// Reconstruido por Erick Vasquez Garcia 16/05/2019 [GEC]\r\n// Update_1 20/10/2019 [GEC]\r\n// Update_2 31/01/2020 [GEC]\r\n\r"
  },
  {
    "path": "PSXDOOM/PSXSPU.H",
    "chars": 2598,
    "preview": "\r\n    /*------------------------------------------------------------------*/\r\n    /*\r\n                     Williams Ente"
  },
  {
    "path": "PSXDOOM/PSX_FILE.C",
    "chars": 2465,
    "preview": "/* PSX_FILE.c */\r\n\r\n#include \"doomdef.h\"\r\n#include \"r_local.h\"\r\n\r\n/*\r\n=================================================="
  },
  {
    "path": "PSXDOOM/SEQLOAD.C",
    "chars": 10076,
    "preview": "// Reconstruido por Erick Vasquez Garcia 16/05/2019 [GEC]\r\n// Update 20/10/2019 [GEC]\r\n\r\n#include \"seqload.h\"\r\n#define _"
  },
  {
    "path": "PSXDOOM/SEQLOAD.H",
    "chars": 3205,
    "preview": "    /*------------------------------------------------------------------*/\r\n    /*\r\n                     The Williams En"
  },
  {
    "path": "PSXDOOM/SEQLOADR.C",
    "chars": 1821,
    "preview": "// Reconstruido por Erick Vasquez Garcia 16/05/2019 [GEC]\r\n// Update 20/10/2019 [GEC]\r\n\r\n#include \"seqload.h\"\r\n#define _"
  },
  {
    "path": "PSXDOOM/WESSAPI.C",
    "chars": 40984,
    "preview": "// Reconstruido por Erick Vasquez Garcia 16/05/2019 [GEC]\r\n// Update_1 20/10/2019 [GEC]\r\n// Update_2 31/01/2020 [GEC]\r\n\r"
  },
  {
    "path": "PSXDOOM/WESSAPI.H",
    "chars": 12452,
    "preview": "    /*------------------------------------------------------------------*/\r\n    /*\r\n                     The Williams En"
  },
  {
    "path": "PSXDOOM/WESSAPIM.C",
    "chars": 2595,
    "preview": "// Reconstruido por Erick Vasquez Garcia 16/05/2019 [GEC]\r\n// Update_1 20/10/2019 [GEC]\r\n// Update_2 31/01/2020 [GEC]\r\n\r"
  },
  {
    "path": "PSXDOOM/WESSAPIP.C",
    "chars": 6897,
    "preview": "// Reconstruido por Erick Vasquez Garcia 16/05/2019 [GEC]\r\n// Update_1 20/10/2019 [GEC]\r\n// Update_2 31/01/2020 [GEC]\r\n\r"
  },
  {
    "path": "PSXDOOM/WESSAPIT.C",
    "chars": 7151,
    "preview": "// Reconstruido por Erick Vasquez Garcia 16/05/2019 [GEC]\r\n// Update_1 20/10/2019 [GEC]\r\n// Update_2 31/01/2020 [GEC]\r\n\r"
  },
  {
    "path": "PSXDOOM/WESSARC.C",
    "chars": 7089,
    "preview": "// Reconstruido por Erick Vasquez Garcia 16/05/2019 [GEC]\r\n// Update_1 20/10/2019 [GEC]\r\n// Update_2 31/01/2020 [GEC]\r\n\r"
  },
  {
    "path": "PSXDOOM/WESSARC.H",
    "chars": 9374,
    "preview": "#ifndef _WESSARC_H\r\n#define _WESSARC_H\r\n\r\n//#include \"psxspu.h\"\r\n#include \"psxcd.h\"\r\n\r\nenum DriverIds {NoSound_ID,PSX_ID"
  },
  {
    "path": "PSXDOOM/WESSBASE.C",
    "chars": 11665,
    "preview": "// Reconstruido por Erick Vasquez Garcia 16/05/2019 [GEC]\r\n// Update_1 20/10/2019 [GEC]\r\n// Update_2 31/01/2020 [GEC]\r\n\r"
  },
  {
    "path": "PSXDOOM/WESSSEQ.C",
    "chars": 25570,
    "preview": "// Reconstruido por Erick Vasquez Garcia 16/05/2019 [GEC]\r\n// Update_1 20/10/2019 [GEC]\r\n// Update_2 31/01/2020 [GEC]\r\n\r"
  },
  {
    "path": "PSXDOOM/WESSSEQ.H",
    "chars": 1023,
    "preview": "#ifndef _WESSSEQ_H\r\n#define _WESSSEQ_H\r\n\r\n#include <libspu.h>\r\n#include \"wessapi.h\"\r\n#include \"wessarc.h\"\r\n\r\nextern unsi"
  },
  {
    "path": "PSXDOOM/am_main.c",
    "chars": 8701,
    "preview": "/* am_main.c -- automap */\r\n\r\n#include \"doomdef.h\"\r\n#include \"p_local.h\"\r\n\r\n#define STEPVALUE   0x800000\r\n\r\n#define COLO"
  },
  {
    "path": "PSXDOOM/asm/tmp.txt",
    "chars": 9,
    "preview": "temp file"
  },
  {
    "path": "PSXDOOM/c_main.c",
    "chars": 2476,
    "preview": "/* c_main.c -- credits intro */\r\n\r\n#include \"doomdef.h\"\r\n#include \"r_local.h\"\r\n\r\npsxobj_t idcredpic[2];  //80097910, 800"
  },
  {
    "path": "PSXDOOM/cf_main.c",
    "chars": 3500,
    "preview": "/* cf_main.c -- configuration menu */\r\n\r\n#include \"doomdef.h\"\r\n#include \"p_local.h\"\r\n#include \"st_main.h\"\r\n#include \"r_l"
  },
  {
    "path": "PSXDOOM/d_main.c",
    "chars": 9870,
    "preview": "/* D_main.c  */\r\n\r\n//------------------------------\r\n#include \"doomdef.h\"\r\n#include \"p_spec.h\"\r\n#include \"r_local.h\"\r\n\r\n"
  },
  {
    "path": "PSXDOOM/doomdata.h",
    "chars": 4712,
    "preview": "/* DoomData.h */\n\n/* all external data is defined here */\n/* most of the data is loaded into different structures at run"
  },
  {
    "path": "PSXDOOM/doomdef.h",
    "chars": 29597,
    "preview": "/* DoomDef.h */\r\n\r\n/* Fixes and Version Update Here*/\r\n// NEWS (PsyDoom) and ([GEC] Master Edition)\r\n#define SHOWFPS 1\r\n"
  },
  {
    "path": "PSXDOOM/f_main.c",
    "chars": 13681,
    "preview": "/* f_main.c -- finale */\r\n\r\n#include \"doomdef.h\"\r\n#include \"p_local.h\"\r\n#include \"st_main.h\"\r\n#include \"r_local.h\"\r\n\r\n\r\n"
  },
  {
    "path": "PSXDOOM/g_game.c",
    "chars": 13304,
    "preview": "/* G_game.c  */\r\n\r\n#include \"doomdef.h\"\r\n#include \"p_local.h\"\r\n\r\nvoid G_PlayerReborn (int player);\r\n\r\nvoid G_DoReborn (i"
  },
  {
    "path": "PSXDOOM/in_main.c",
    "chars": 10141,
    "preview": "\n/* in_main.c -- intermission */\n#include \"doomdef.h\"\n#include \"st_main.h\"\r\n#include \"r_local.h\"\n\n#define\tKVALX\t\t\t172\n#d"
  },
  {
    "path": "PSXDOOM/info.c",
    "chars": 135380,
    "preview": "#include \"doomdef.h\"\r\n/* generated by multigen */\r\n\r\nchar *sprnames[NUMSPRITES] = {//800778B4\r\n\"TROO\",\"SHTG\",\"PUNG\",\"PIS"
  },
  {
    "path": "PSXDOOM/info.h",
    "chars": 21404,
    "preview": "/* generated by multigen */\n\ntypedef enum {\nSPR_TROO,\nSPR_SHTG,\nSPR_PUNG,\nSPR_PISG,\nSPR_PISF,\nSPR_SHTF,\nSPR_SHT2,\nSPR_CH"
  },
  {
    "path": "PSXDOOM/l_main.c",
    "chars": 1323,
    "preview": "/* l_main.c -- legal intro */\r\n\r\n#include \"doomdef.h\"\r\n#include \"r_local.h\"\r\n\r\nint y_scroll;//80077FB8 uGp00000ba8\r\nint "
  },
  {
    "path": "PSXDOOM/m_fixed.c",
    "chars": 966,
    "preview": "/* Fixed_t.c  */\r\n\r\n#include \"doomdef.h\"\r\n\r\nfixed_t FixedMul(register fixed_t\ta, register fixed_t\tb)//L8003EEA4()\r\n{\r\n\tr"
  },
  {
    "path": "PSXDOOM/m_fixed.s",
    "chars": 1983,
    "preview": "    opt at-,w-,c+,m-\r\n\r\n    section\tasm\r\n\r\n\txdef\tFixedMul,FixedDiv\r\n\r\nFixedMul:\r\n                xor     t0, a0, a1\r\n   "
  },
  {
    "path": "PSXDOOM/m_main.c",
    "chars": 10540,
    "preview": "/* m_main.c -- main menu */\r\n\r\n#include \"doomdef.h\"\r\n#include \"r_local.h\"\r\n#include \"st_main.h\"\r\n\r\nunsigned short STARTY"
  },
  {
    "path": "PSXDOOM/m_password.c",
    "chars": 7749,
    "preview": "/* m_password.c -- password encode/decode */\r\n\r\n#include \"doomdef.h\"\r\n#include \"p_local.h\"\r\n#include \"st_main.h\"\r\n#inclu"
  },
  {
    "path": "PSXDOOM/o_main.c",
    "chars": 8520,
    "preview": "/* o_main.c -- options menu */\r\n\r\n#include \"doomdef.h\"\r\n#include \"p_local.h\"\r\n#include \"st_main.h\"\r\n#include \"r_local.h\""
  },
  {
    "path": "PSXDOOM/obj/tmp.txt",
    "chars": 9,
    "preview": "temp file"
  },
  {
    "path": "PSXDOOM/p_base.c",
    "chars": 16845,
    "preview": "/* p_base.c */\r\n\r\n#include \"doomdef.h\"\r\n#include \"p_local.h\"\r\n\r\n//completo y revisado\r\n\r\nstatic mobj_t *checkthing;\t\t/* "
  },
  {
    "path": "PSXDOOM/p_ceilng.c",
    "chars": 6763,
    "preview": "#include \"doomdef.h\"\r\n#include \"p_local.h\"\r\n\r\n/*================================================================== */\r\n/"
  },
  {
    "path": "PSXDOOM/p_change.c",
    "chars": 3622,
    "preview": "/* p_change.c */\r\n\r\n#include \"doomdef.h\"\r\n#include \"p_local.h\"\r\n#include \"st_main.h\"\r\n\r\n//completo y revisado\r\n\r\n/*\r\n==="
  },
  {
    "path": "PSXDOOM/p_doors.c",
    "chars": 10859,
    "preview": "#include \"doomdef.h\"\n#include \"p_local.h\"\n#include \"st_main.h\"\n\n/*======================================================"
  },
  {
    "path": "PSXDOOM/p_enemy.c",
    "chars": 28098,
    "preview": "/* P_enemy.c */\r\n\r\n#include \"doomdef.h\"\r\n#include \"p_local.h\"\r\n\r\nvoid A_Fall (mobj_t *actor);\r\n\r\n/*\r\n==================="
  },
  {
    "path": "PSXDOOM/p_floor.c",
    "chars": 11509,
    "preview": "#include \"doomdef.h\"\r\n#include \"p_local.h\"\r\n\r\n/*================================================================== */\r\n/"
  },
  {
    "path": "PSXDOOM/p_inter.c",
    "chars": 18995,
    "preview": "/* P_inter.c */\r\n\r\n\r\n#include \"doomdef.h\"\r\n#include \"p_local.h\"\r\n#include \"st_main.h\"\r\n\r\n#define\tBONUSADD\t\t4\r\n\r\n/* a wea"
  },
  {
    "path": "PSXDOOM/p_lights.c",
    "chars": 9221,
    "preview": "#include \"doomdef.h\"\r\n#include \"p_local.h\"\r\n\r\n/*================================================================== */\r\n/"
  },
  {
    "path": "PSXDOOM/p_local.h",
    "chars": 8269,
    "preview": "/* P_local.h */\n\n#ifndef __P_LOCAL__\n#define __P_LOCAL__\n\n#ifndef __R_LOCAL__\n#include \"r_local.h\"\n#endif\n\n#define\tFLOAT"
  },
  {
    "path": "PSXDOOM/p_map.c",
    "chars": 11369,
    "preview": "/* P_map.c */\r\n\r\n#include \"doomdef.h\"\r\n#include \"p_local.h\"\r\n\r\n//int DSPRead (void volatile *adr);\r\n\r\n/*================"
  },
  {
    "path": "PSXDOOM/p_maputl.c",
    "chars": 7474,
    "preview": "\n/* P_maputl.c */\n\n#include \"doomdef.h\"\n#include \"p_local.h\"\n\n\n/*\n===================\n=\n= P_AproxDistance\n=\n= Gives an e"
  },
  {
    "path": "PSXDOOM/p_mobj.c",
    "chars": 13085,
    "preview": "/* P_mobj.c */\r\n\r\n#include \"doomdef.h\"\r\n#include \"p_local.h\"\r\n#include \"sounds.h\"\r\n\r\nvoid G_PlayerReborn (int player);\r\n"
  },
  {
    "path": "PSXDOOM/p_move.c",
    "chars": 14952,
    "preview": "#include \"doomdef.h\"\r\n#include \"p_local.h\"\r\n\r\n/*================== */\r\n/* */\r\n/* out */\r\n/* */\r\n/*================== */\r"
  },
  {
    "path": "PSXDOOM/p_plats.c",
    "chars": 6541,
    "preview": "/*================================================================== */\n/*=============================================="
  },
  {
    "path": "PSXDOOM/p_pspr.c",
    "chars": 20285,
    "preview": "/* P_pspr.c */\r\n\r\n#include \"doomdef.h\"\r\n#include \"p_local.h\"\r\n\r\n#define\tLOWERSPEED\t\tFRACUNIT*12\r\n#define\tRAISESPEED\t\tFRA"
  },
  {
    "path": "PSXDOOM/p_setup.c",
    "chars": 29250,
    "preview": "/* P_main.c */\r\n\r\n#include \"doomdef.h\"\r\n#include \"p_local.h\"\r\n\r\nvoid\tP_SpawnMapThing (mapthing_t *mthing);\r\nvoid\tP_Init("
  },
  {
    "path": "PSXDOOM/p_shoot.c",
    "chars": 11480,
    "preview": "#include \"doomdef.h\"\r\n#include \"p_local.h\"\r\n\r\n//===================\r\n//\r\n// IN\r\n//\r\n// A line will be shootdivd from the"
  },
  {
    "path": "PSXDOOM/p_sight.c",
    "chars": 6505,
    "preview": "#include \"doomdef.h\"\r\n#include \"p_local.h\"\r\n\r\n//iGp00000a3c\r\nfixed_t sightzstart;\t\t\t\t//80077E4C // eye z of looker\r\n//iG"
  },
  {
    "path": "PSXDOOM/p_slide.c",
    "chars": 11687,
    "preview": "#include \"doomdef.h\"\r\n#include \"p_local.h\"\r\n\r\n#define\tCLIPRADIUS\t23\r\n#define SIDE_ON\t0\r\n#define\tSIDE_FRONT\t1\r\n#define\tSI"
  },
  {
    "path": "PSXDOOM/p_spec.c",
    "chars": 32888,
    "preview": "/* P_Spec.c */\r\n#include \"doomdef.h\"\r\n#include \"r_local.h\"\r\n#include \"p_local.h\"\r\n#include \"st_main.h\"\r\n\r\n/*\r\n=========="
  },
  {
    "path": "PSXDOOM/p_spec.h",
    "chars": 9586,
    "preview": "/* P_spec.h */\r\n\r\n#include \"r_local.h\"\n\n/*\n============================================================================="
  },
  {
    "path": "PSXDOOM/p_switch.c",
    "chars": 12956,
    "preview": "#include \"doomdef.h\"\r\n#include \"p_local.h\"\r\n\r\n/*================================================================== */\r\n/"
  },
  {
    "path": "PSXDOOM/p_telept.c",
    "chars": 2695,
    "preview": "#include \"doomdef.h\"\n#include \"p_local.h\"\n\n/*\n==============\n=\n= P_Telefrag\n=\n= Kill all monsters around the given spot\n"
  },
  {
    "path": "PSXDOOM/p_tick.c",
    "chars": 13569,
    "preview": "#include \"doomdef.h\"\r\n#include \"p_local.h\"\r\n#include \"st_main.h\"\r\n\r\nint\tplayertics, thinkertics, sighttics, basetics, la"
  },
  {
    "path": "PSXDOOM/p_user.c",
    "chars": 16330,
    "preview": "/* P_user.c */\r\n\r\n#include \"doomdef.h\"\r\n#include \"p_local.h\"\r\n#include \"st_main.h\"\r\n\r\n\r\nfixed_t \t\tforwardmove[2] = {0x40"
  },
  {
    "path": "PSXDOOM/psxmain.c",
    "chars": 24866,
    "preview": "/*-------------------------------------------------**\r\n**                                                 **\r\n**--------"
  },
  {
    "path": "PSXDOOM/pw_main.c",
    "chars": 5705,
    "preview": "/* pw_main.c -- password menu */\r\n\r\n#include \"doomdef.h\"\r\n#include \"p_local.h\"\r\n#include \"st_main.h\"\r\n#include \"r_local."
  },
  {
    "path": "PSXDOOM/r_data.c",
    "chars": 8328,
    "preview": "/* R_data.c */\r\n\r\n#include \"doomdef.h\"\r\n#include \"r_local.h\"\r\n#include \"p_local.h\"\r\n\r\nint\t\t\tfirstflat;              //80"
  },
  {
    "path": "PSXDOOM/r_local.h",
    "chars": 8632,
    "preview": "/* R_local.h */\r\n\r\n#ifndef __R_LOCAL__\r\n#define __R_LOCAL__\r\n\r\n/* proper screen size would be 160*100, stretched to 224 "
  },
  {
    "path": "PSXDOOM/r_main.c",
    "chars": 7665,
    "preview": "/* r_main.c */\r\n\r\n#include \"doomdef.h\"\r\n#include \"r_local.h\"\r\n\r\n/*===================================== */\r\n\r\n/* */\r\n/* "
  },
  {
    "path": "PSXDOOM/r_phase1.c",
    "chars": 12360,
    "preview": "\r\n//Renderer phase 1 - BSP traversal\r\n\r\n#include \"doomdef.h\"\r\n#include \"r_local.h\"\r\n\r\nint checkcoord[12][4] =\t\t\t\t//80067"
  },
  {
    "path": "PSXDOOM/r_phase2.c",
    "chars": 36675,
    "preview": "\r\n//Renderer phase 2\r\n\r\n#include \"doomdef.h\"\r\n#include \"r_local.h\"\r\n\r\nvoid R_RenderSKY(void)//L8002BF4C\r\n{\r\n\tRECT    rec"
  },
  {
    "path": "PSXDOOM/s_sound.c",
    "chars": 15379,
    "preview": "/* s_sound.c */\r\n#include \"doomdef.h\"\r\n#include \"p_local.h\"\r\n\r\n#define abs(x) ((x)<0 ? -(x) : (x))\r\n\r\nint CD_TRACK[NUM_C"
  },
  {
    "path": "PSXDOOM/snmain.s",
    "chars": 3983,
    "preview": ";\tSN Systems replacement for main module\r\n;\tin API lib\r\n\r\n\topt\tc+\r\n\r\nDIPSW\tequ\t$1F802040\t;byte, read only\r\n\r\n\tsection\t.r"
  },
  {
    "path": "PSXDOOM/sounds.h",
    "chars": 1366,
    "preview": "#ifndef __SOUNDSH__\n#define __SOUNDSH__\n\n/*\n *  Identifiers for all sfx in game.\n */\n\ntypedef enum\r\n{\r\n\tsfx_None,\r\n\tsfx_"
  },
  {
    "path": "PSXDOOM/soundst.h",
    "chars": 2017,
    "preview": "/* newsfx.h */\n\r\n#if 0\ntypedef struct\n{\n    int     samples;\n    int     loop_start;\n    int     loop_end;\n    int     i"
  },
  {
    "path": "PSXDOOM/sprinfo.c",
    "chars": 38084,
    "preview": "/* sprinfo.c -- generated by sprgen */\n\n#include \"doomdef.h\"\n#include \"r_local.h\"\n\r\nspriteframe_t spriteframes[] = {//80"
  },
  {
    "path": "PSXDOOM/st_main.c",
    "chars": 19686,
    "preview": "/* st_main.c -- status bar */\r\n\r\n#include \"doomdef.h\"\r\n#include \"st_main.h\"\r\n#include \"r_local.h\"\r\n\r\nstbar_t\tstbar; //80"
  },
  {
    "path": "PSXDOOM/st_main.h",
    "chars": 2971,
    "preview": "/* the status bar consists of two 8 bit color objects: */\n/* the static background pic and a transparent foreground obje"
  },
  {
    "path": "PSXDOOM/t_main.c",
    "chars": 4808,
    "preview": "/* t_main.c -- title intro */\r\n\r\n#include \"doomdef.h\"\r\n#include \"p_spec.h\"\r\n#include \"r_local.h\"\r\n\r\nint vframe1 = 0; //8"
  },
  {
    "path": "PSXDOOM/tables.c",
    "chars": 88039,
    "preview": "#include \"doomdef.h\"\n\nint finesine[10240] = {//80067788\n25,75,125,175,226,276,326,376,\n427,477,527,578,628,678,728,779,\n"
  },
  {
    "path": "PSXDOOM/vsprintf.c",
    "chars": 2723,
    "preview": "\r\n//inline\r\nint mystrlen(char *string)//80030F58\r\n{\r\n  int rc = 0;\r\n  if (string) while (*(string++)) rc++;\r\n  else rc ="
  },
  {
    "path": "PSXDOOM/w_wad.c",
    "chars": 10828,
    "preview": "/* W_wad.c */\r\n\r\n#include \"doomdef.h\"\r\n#include \"r_local.h\"\r\n\r\n/*=============== */\r\n/*   TYPES */\r\n/*=============== */"
  },
  {
    "path": "PSXDOOM/z_zone.c",
    "chars": 11198,
    "preview": "/* Z_zone.c */\r\n\r\n#include \"doomdef.h\"\r\n\r\n/*\r\n=========================================================================="
  },
  {
    "path": "PSYQ/README.txt",
    "chars": 204,
    "preview": "Replace these files once the PSYQ SDK is installed, copy them to the following address C:\\psyq\\bin\r\n\r\nCPE2X.EXE \tOrigina"
  },
  {
    "path": "README.md",
    "chars": 2266,
    "preview": "# PSXDOOM-RE\r\n\r\nWelcome to the complete reverse engineering of PSX Doom by [GEC], this effort took about 2 and a half ye"
  }
]

// ... and 1 more files (download for full content)

About this extraction

This page contains the full source code of the Erick194/PSXDOOM-RE GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 111 files (1.2 MB), approximately 434.3k tokens, and a symbol index with 819 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!