If you appreciate the work done within the wiki, please consider supporting The Cutting Room Floor on Patreon. Thanks for all your support!

Crime Patrol 2: Drug Wars (CD-i)

From The Cutting Room Floor
Jump to navigation Jump to search

Title Screen

Crime Patrol 2: Drug Wars

Also known as: Drug Wars (box art)
Developer: Capitol Multimedia
Publisher: Philips Media
Platform: CD-i Digital Video Cartridge
Released in EU: 1996


DevTextIcon.png This game has hidden development-related text.


Crime Patrol 2: Drug Wars plays much like its prequel, but instead of stopping various evildoers of escalating threat, you're taking down the cartel of a drug lord who definitely isn't Tony Montana.

Debugging Files

Elementary, my dear Cactus.
This needs some investigation.
Discuss ideas and findings on the talk page.
Specifically: Can this debug mode be reactivated in some way?

Two unused files can be found on the disc, both of which contain code and strings meant for a debugging mode controlled using a keyboard and a CD-i dev kit. Said files are nearly identical to the ones used in Crime Patrol, with only a few changes and rearrangements between them.

cdi_appld

The first, larger file is cdi_appld, a debug version of the used file cdi_appl. Its contents can be sorted into three chunks.

Chunk 1 deals with the gameplay itself, containing various variable strings and debug keys. A huge list of every cutscene can be found after the "Dummy function called" line; this has been excluded for viewing purposes.

FONT8X8
Couldn't find FONT8X8!
CD_disc_error.c

APPL_nofmv_start: start
nofmv.c

APPL_calib_start: start
calibration.c
DANGER! FAILED CALIBRATION: BAD SHOTS!
AVG POINT1: (%d,%d)
AVG POINT2: (%d,%d)
DANGER! FAILED CALIBRATION: SHOTS CROSSED!

APPL_custom_start: start
custom.c

APPL_nvram_test: start
nvram.c
avail %d size %d (%d)
APPL_nvram_test enough space found...
APPL_nvram_save: save failed, deleting junk save file.
No open
No ver
No read
No crc
Wrong version save file.
BAD CRC
APPL_nvram_restore: restore failed, deleting unusable save file.
NVR file does not exist. Creating
Error creating '%s' file

sm_out failed
soundmap.c

APPL_click_start: start
click.c

APPL_death_start: start
death.c
Real death time...
APPL_timer_set: Unable to install timer task
APPL_timer_delete: Unable to delete death task
Interrupt

APPL_play_env: Play failed!
play.c
Done Check:
    PCB:  Stat 0x%04x, Sig 0x%04x (%03d)
    FMV:  Stat 0x%04x, Sig 0x%04x (%03d)
    FMA:  Stat 0x%04x, Sig 0x%04x (%03d)
    ERRNO:    %03d    DISC POS:    %d

DEBUG MENU
APPL_start_application: start
start.c
Can't install keyboard signal
cdi_rmail
DUOH! OUT OF MEMORY!!!!

Automagic rectangle pause is %s
ON
OFF
Must have rectangle display ON to work!
PCB debugging is %s
Context flags are 0x%x.
Context flags_sys are 0x%x.
Context status is 0x%x.
Jump to what scene number?
Pause at time (return to ignore)?
Jumping to scene %d
Illegal scene (%d)
level set to %d
Quiet mode is %s
Rect display is %s
RP_DEBUG (0x%x)?
%x Current scene

Stuff of general interest:
a - Automagical rectangle pausing system.
c - Continue play after a pause.
d - Debug mpeg scene rectangles.
j - Jump to scene.
k - Toggle autokill mode.
l - Difficulty level change.
m - Max lives and bullets.
p - Pause a play for rectangle work.
q - Quiet mode. No soundmap play.
r - Rectangle show/hide.
s - Show current DB entry

Stuff of engineering interest:
C - CTE
D - Toggle pcb_debug
F - RP Context flags
G - Display context PCB
R - set rp_debug
S - callback_dump

Controller set to: %d
controller.c

APPL_dispatch_scene: %d (%s)
dispatch.c
NO_SCENE received in APPL_dispatch_scene cur: %d.
Dispatching MAIN MENU from %d
appl_die_scene = %d
APPL_dispatch_function: %d
APPL_dispatch_function: unknown function!
APPL_dispatch_special: start new scene %d
APPL_dispatch_special: Scene type %d
Error dispatching special scene %d.
Can't cleanup.

Dummy function called

APPL_practice_start: start
practice.c
Mucking with old matte %d new matte %d
practice_timeout

APPL_count_start: start
count.c
data %d total needed %d
COUNT: Enough already!
COUNT: One more time!

APPL_mainmenu_start: start
mainmenu.c

APPL_res_load: start
resident.c
Found transparent red. value = %d

APPL_timer_set: Unable to install timer task
timer.c
APPL_timer_delete: Unable to delete timer task

CV_cp_calibrate: Can't send CALIBRATE letter.
cp_calibrate.c

APPL_maskmenu_start: start
maskmenu.c
appl_click_scene = %d appl_cur_scene = %d 
appl_click_choice = %d item = %d

APPL_show_planes
utils.c

BAD MATTE VALUE: %d
Hiding matte %d
showing matte %d @ (%d %d) to 
(%d %d)

Scene pointer is NULL!
##### Scene %s Tag %d #####
Type: 
CLICK Flags: 
COUNT Flags: 
CUSTOM Flags: 
DEATH Flags: 
MASK Flags:
MPEG Flags: 
SET Flags: 
Interrupt
SetDie
Panel
ShootStart
ActEntry: %2d ActExit: %2d
NextScene: %s (%d)
NumFields: %2d Data: %2d Sector %ld
Field %d:
Field pointer is NULL!
Color: %2d Action: %2d Select: %s (%3d)
Start %5d  End %5d CurStart %5d CurEnd %5d
UL (%3d %3d) - LR (%3d %3d)
%d Rects
Rect %d (%3d %3d) - (%3d %3d)

SCENE_MAINMENU
SCENE_NONE/BAD

APPL_slide_start: start
slide.c

FMV PIC
No fmv cartridge!!!
fmv.c
Can't get handle to FMV map

APPL_missed_start: start
missed.c

APPL_cross_start: start
cross.c

APPL_gen_start: start
genfmv.c

APPL_timer_set: Unable to install timer task
mpeg.c
APPL_timer_delete: Unable to delete rectangle task
Start %d (%3d, %3d) - (%3d, %3d) @ %d
End %d (%3d, %3d) - (%3d, %3d) @ %d

Error pausing play.
Error continuing play.
No current scene!
No current rect (pick with 'p')
MPEG debug (? for help): 
No current rect
Enter next debug pause time:
Enter rectangle (0 - %d):
Rectangle %d out of range (0 - %d
Current rect is %d
Enter ulx (current %d return skips):
Enter uly (current %d return skips):
Enter lrx (current %d return skips):
Enter lry (current %d return skips):
Working scene:
Paused at time %d
Enter new start time in 100ths (current %d):
Enter new end time in 100ths (current %d):

d - display info on current rectangle.
n - set the next debug pause time.
p - pick rectangle to work on.
q - quit and return to application.
r - change rectangle coordinates.
s - show current scene data.
t - Set new start and end times.
D - Down
L - Left
R - Right
U - Up

WARNING: Ending with active rect @ %d (rect ends at %d) scene %d

APPL_set_start: start
set.c
SET: Dispatching entry %d of %d

PANIC! Save size too small for database! Modify MAX_SAVE_BYTES in appl.h
game.c
PANIC! Restore size too small for database! Modify MAX_SAVE_BYTES in appl.h
APPL_game_restore: Restore failed.
appl_gameok = %d
APPL_game_new: start
APPL_game_reset: start
APPL_db_reset: start
APPL_db_reset: Out of fields in DB.
APPL_db_reset: Looking for fields in DB, found none.

Custom function: PAUSEATEND
appl.c

Auto check 1 dispatching...
Auto check 2 dispatching...

Chunk 2 focuses on the game engine and the CD-i itself, and includes some FMV debug functions in its first half. This chunk's functions are arranged very differently when compared to its Crime Patrol equivalent, though the contents are more-or-less the same.

CD_rp_load_map(): error during seek to map.
CD_rp_load_map.c
Couldn't load map file. Path %d PCB_Chan 0x%0x
Unknown status, assuming error

Starting FX!
CD_rp_task.c
CD_rp_task: invoking effect %d
CD_rp_task: invoking effect %d buffer index %dID %d
CD_rp_task: PLAY_DONE flag set

RP PLAY DONE
RP AUDIO BUF FULL
RP DATA BUF FULL
RP FX TIMER
RP VIDEO BUF FULL
RP FMV PIC
RP FMV LPD
RP FMA UNF
CD_rp_play: Play attempt with uninitialized context.
CD_rp_play.c
CD_rp_play: Map load failed.

Error! curAsset %d Audio PCL at 0x%08x has type %ld!
audio in, PCL Buf 0x%08x

Error! curAsset %d Data PCL at 0x%08x has type %ld!
data in, PCL Buf 0x%08x

FX occurs before buffer is ready! FX %d Buffer %d Type %d
*FX alarm went off*
SetFMVTrigger: ERROR setting FMV triggers
ClearFMVTrigger: ERROR clearing FMV triggers
SetFMATrigger: ERROR setting FMA triggers
ClearFMATrigger: ERROR clearing FMA triggers

CD_rp_play(): map read failed, 
retry attempt #%d
trying backup map at sector %ld
I give up, calling done_func

PlayFMVCleanup: ERROR aborting FMV
PlayFMVCleanup: ERROR aborting FMA
Error during play (stat = 0x%x)!
FMV stat = 0x%x
FMA stat = 0x%x
PlayDone: Play is done!
Setting PCL 0x%x MapLoc 0x%x Size %d

SetupFMV: ERROR setting FMV triggers
SetupFMV: ERROR setting FMA triggers

CD_rp_play(): cur map file has no channel %d
Couldn't start FMV decoder?!?  Stat = 0x%x
Couldn't start FMA decoder?!?  Stat = 0x%x
Playing record at sector %ld
Couldn't play record?!?
Error! curAsset %d Video PCL at 0x%08x has type %ld!
submode 0x%02x
coding 0x%02x
video in, PCL Buf 0x%08x
Setting pixmap %d's LAT to buffer %d

RpSetFMVTrigger: ERROR setting FMV triggers
RpClearFMVTrigger: ERROR clearing FMV triggers
RpSetFMATrigger: ERROR setting FMA triggers

CD_callback: Unhandled signal received: class %d, value %d
CD_callback_init.c

CD_callback_attach: Illegal callback structure.
CD_callback_attach.c

CD_callback_replace: Illegal callback structure.
CD_callback_replace.c

CD_callback_remove: Illegal callback structure.
CD_callback_remove.c

Callbacks:
CD_callback_dump.c
Class %2d:
    Value %2d (0x%08x): 
0x%08x,0x%08x    
    Value  * (0x%08x): 0x%08x,0x%08x    
%s
No Label
                0x%08x,0x%08x   

CD_mm_send failed for new event
CD_cp_flush.c
CD_mm_send failed requeued letter (type=0x%x)

Can't create cp mailbox.
CD_cp_install.c
CP install failed.
cdi_cd_cp

cdi_cp_mail
Incompatible versions: 
libraries (%d), cursor process (%d)
CD_cp_mail: Can't send letter for type %d.
CD_cp_mail.c
CD_cp_qsize: Can't send Q_SIZE letter.
CD_cp_qsize.c
CD_cp_setlimits: Can't send OP_CP_LIMITS letter.
CD_cp_setlimits.c

CD_ifx_get_params(): param too big (%d/%d)
CD_ifx.c
CD_ifx_perform(): bad fx (%d)

CD_pm_show.c

CD_tasks: execute
CD_task.c
(0x%x) recursion (%d)
task %d:0x%x

Could not allocate task - task array full
CD_task_install.c

Can't open FMV video path
CD_applinit.c
FMV Paths opened
Opened Full Motion descriptors
Load module %s:%d
CD_appl_init: Can't load module: %s into plane %d
CD_appl_init: Can't open file '%s'

Can't ss_enable controls
CD_cdroot.c

CFREE: _srtmem error %d 0x%x
CD_cfree.c

CD_malloc grabbing %d bytes from %x
CD_malloc.c
(%s:%d)

CD_free: INVALID POINTER : 0x%x SYNC : 0x%x
CD_free releasing %d bytes at 0x%x

init
Can't get init module
CD_get_plane.c

line_event

CD_vd_open : csd_devname fails
CD_vd_open.c
CD_vd_open : Could not open %s

Can't get name of monitor.
vd_compat.c
Can't get monitor parameters.
LI= 
Can't determine the monitor type.
625 
TV

CD_rp_continue: Play not paused. Context 0x%x
CD_rp_continue.c
CD_rp_continue: Physical play done. Context 0x%x

PCB: Stat=0x%x Sig 0x%x Rec=0x%x
CD_rp_debug_pcb.c
AChan=0x%x Chan=0x%x
Video PCLs:
Audio PCLs:
Data PCLs:

Channel %d:
  PCL=0x%x Ctrl=0x%x Smode=0x%x
Type=0x%x Sig=0x%x Buf=0x%x
BufSz=%d

CD_rp_dump_map(): bad key [0x%04x]
CD_rp_dump_map.c
chanMask 0x%08x  aChanMask 0x%04x
start sector %ld offset to next %d
# Video Assets: %d
  Size %3d
  Buff %3d
# Audio Assets: %d
# Data Assets: %d

CD_rp_pause: Play already paused. Context 0x%x
CD_rp_pause.c
CD_rp_pause: Attempting pause before a sector read.Context 0x%x
CD_rp_pause: Physical play is done. Context 0x%x

Play is already finished!
CD_rp_stop.c

Tried to start FX while play paused!
rpfx.c
No more FX (done %d of %d)!!
During play, FX offset %d startPos %d
During play, alarm for FX #%d @ %d cur_pos %d
After play, alarm for FX #%d @ %d
deleting rp fx alarm %d
Can't set alarm for FX!
alarm %d set to occur in %d ticks

Chunk 3 features the CD-i graphics editor/second chunk-esque strings that's ubiquitous among the debug files of CapDisc's games.

Quit 
New Control Table
Dissassemble
Enter Instruction
Help
Search for Instruction
Insert NOPs into the LCT
1.02
CD control table editor V%s

Starting line?
Number of lines?

8 (normal)
4 (double)
8 (high)

Half
Full
Black
Blue
Green
Cyan
Red
Magenta
Yellow
White

OFF
CLUT8
CLUT7/RL7
CLUT7/RL7 (Dual)
DYUV
CLUT4/RL3
RGB555
QHY

END
IFCA
IFCB
Matte Flag Off
Matte Flag On
Matte Flag Off + IFCA
Matte Flag On + IFCA
Matte Flag Off + IFCB
Matte Flag On + IFCB

1
2
A over B
B over A
x2
x4
x8
x16

Normal
Runlength
Mosaic
Bit = 0
Bit = 1
CKey = FALSE
CKey = TRUE
MFlag 0 off
MFlag 0 off & CKey FALSE
MFlag 0 on
MFlag 0 on & CKey TRUE
MFlag 1 off
MFlag 1 off & CKey FALSE
MFlag 1 on
MFlag 1 on & CKey TRUE

off
on
Line?
Column?

clut number
red value
green value
blue value

matte register
Enter opcode 
matte flag 
icf 
x position
Enter brightness
Enter color 
clut bank
Not allowed!

Enter mode
Enter pixel repeat
Enter Bits/pixel
icf value
Enter plane A ICM
Enter plane B ICM
Enter # mattes 
external video 
enable pixel hold 
pixel hold factor
Enter plane order 
mixing: 0=OFF, 1=ON
Enter plane A TCI
Enter plane B TCI
y start value
u start value
v start value
Write failed, errno=%d!

FCT 0
FCT 1
LCT 0 
LCT 1
PAL LCT 0
PAL LCT 1
Decode which control table?

8bpN
8 bits/pixel, Normal resolution
4bpD
4 bits/pixel, Double resolution
8bpH
8 bits/pixel, High resolution

Any color can be at 1/2 intensity
??
Illegal 
--
Off
c4
Clut 4 or RunLength 3
c7
Clut 7 or RunLength 7
77
Clut 7/7 or RunLength 7/7 (dual clut)
c8
Clut 8
dv
r5
qy
???

Illegal value
end
Ignore all commands in higher registers
icfa
Change ICF value for plane A
icfb
Change ICF value for plane B
MFoff
Turn Matte Flag off
MFon
Turn Matte Flag on
offIa
Turn Matte Flag off and change ICF for plane A
onIa
Turn Matte Flag on and change ICF for plane A
offIb
Turn Matte Flag off and change ICF for plane B
onIb
Turn Matte Flag on and change ICF for plane B

nml
rl
RunLength enabled
mos
Mosaic enabled
Illegal mode
b0
Transparency bit 0
B1
Transparency bit 1
cF
Color Key FALSE
cT
Color Key TRUE
m0F
Matte Flag 0 FALSE
m0FcF
Matte Flag 0 FALSE or Color Key FALSE
m0T
Matte Flag 0 TRUE
m0TcT
Matte Flag 0 TRUE or Color Key TRUE
m1F
Matte Flag 1 FALSE
m1FcF
Matte Flag 1 FALSE or Color Key FALSE
m1T
Matte Flag 1 TRUE
m1TcT
Matte Flag 1 TRUE or Color Key TRUE

Never transparent
Always transparent

CLUT<clut number> <red> <green> <blue>
<clut number>            0 -  63
<red>, <green>, <blue>   0 - 255
72
5.5

MR<register> <op> <matte flag> <icf> <x position>
<register>    0 -    7
op 
<matte flag>  0 -    1
<icf>         0 -   63
<x position>  0 - 1023
83
5.10.3

BKCOL <color>
color
91
5.13

CLTB <bank>
<bank>  0 - 3

DLS <address>
57
4.5.2.2

DPRM <mode> <pixel repeat> <bits/pixel>
mode 
<pixel repeat>   2, 4, 8, or 16
bits/pixel
59
4.6.1

ICF<plane> <value>
<plane>    A or B
<value>    0 - 63
79
5.9

ICM <icm A> <icm B> <# mattes> <external video> <clut bank>
icm A
icm B
<# mattes>         1 - 2
<external video>   0 - 1
<clut bank>        0 - 1
58

LINK LCT <address>
56, Note 1
4.5.1

MCOL<plane> <red> <green> <blue>
<plane>   A or B
<red>     0 - 255
<green>   0 - 255
<blue>    0 - 255
76
5.7.2.2

PHLD<plane> <enable> <value>
<plane>    A/B
<enable>   on/off
<value>    0 - 255
86
5.11.1.1

NOP
56

PO <value>
<value>    B over A  or  A over B
75
5.7.1

SIG video interrpt
74
5.6

TCOL<plane> <red> <green> <blue>

TCI <mix> <tci a> <tci b>
<mix>   on/of(f)
tci a>, <tci b
5.7.3

YUV<plane> <y> <u> <v>
<y>       0 - 255
<u>       0 - 255
<v>       0 - 255
61
4.6.2

Starting row
Starting column
Number of rows
Number of columns

Any Clut Instruction
Specific Clut Number
Any Matte Instruction
Specific Matte Register

Look for:
CLUT number
Matte Register

Start line?
Step (-1 or +1) ?
Instruction not found.
At line %d , column %d : %s

CLUT
MR
BKCOL
CLTB
DLS
DPRM
ICF
ICM
LCT
MCOL
PHLD
NOP
PO
SIG
TCOL
TCI
YUV
Choose Instruction Type:

Green Book Reference: Vol. I, V.%s, page V-%s

%s
%2d) %%-%ds
==>

<%s> is one of:
%-5s
%s

Allowed on plane A or B (may be set independently on each)
(different opcodes on each plane)
plane A only

CLUT%-2d %3d %3d %3d
CLTB set bank %-5d
DLS 0x%-13x
ICF%c %-14d
LINK
LCT 0x%-8x
MCOL%c %3d %3d %3d
PHLD%c %-3s %3d
on
off
%-19s
NOP
PO %-16s
B ovr A
A over B
SIG video interrupt
TCOL%c %3d %3d %3d
YUV%c %3d %3d %3d
ERROR in the CT??

Black
1/2 Blue
1/2 Green
1/2 Cyan
1/2 Red
1/2 Magenta
1/2 Yellow
1/2 White
Blue
Green
Cyan
Red
Magenta
Yellow
White
BKCOL %-13s

Dumping FCT #%d,  starting line=%d numlines=%d
%03d %s

Dumping LCT #%d,  start line=%d numlines=%d
%3d 
%s

%s (line %d): WARNING: %d:
%s (line %d): ERROR: %d:

CD_ap_open : csd_devname fails
CD_ap_open.c
CD_ap_open : Could not open %s

CD_iff2fct_clut.c

cdi_driversd

The second, smaller file is cdi_driversd, a debug version of the used file cdi_drivers. It has 12 additional kilobytes of data, including this set of strings:

/cd
Cannot chd to /cd (errno %d)

/cd
Cannot chx to /cd (errno %d)

dvr_name = '%s', filename = '%s'
About to load new driver
Driver load failed (errno = %d)!

About to load application %s
No System RAM, using Plane B
Error %d loading %s

About to chain to application %s
Error %d chaining to %s