View Issue Details

IDProjectCategoryView StatusLast Update
06952CrimeWaveslavepublic2026-06-01 21:59
Reporterztronzo Assigned ToWepl  
PrioritynormalSeverityfeatureReproducibilityalways
Status assignedResolutionopen 
Project InfoCrime Wave (U.S.Gold)
http://www.whdload.de/games/CrimeWave.html
Summary06952: Custom options added - (Keyboard Language preset, Skip intro, Disable tap waits for up/down movement)
DescriptionThe game controls are somewhat OK-ish if you have 1 fire button since tapping down crouches and tapping up jumps..
Using keyboard it has keys assigned keys for fire, rocket, jump, and crouch, which render the quick up/down tap for jump and crouch redundant, and not only that; the game has a priority waiting on the release tap, so the character doesn't even move before the final action is determined.. this is hugely wrong from the original developer and makes up/down move response time terrible..

I found that NOPing some code removes the wait for determined action to increase the response time
NOPing on more code and forcing a branch will also remove the tap release reading function which is best if you use keyboard to play the game.
This can be done more cleanly and also adding CD32 button controls will be easier and recommended in combination with the above feature.

I include new code with the above feature, and as bonus features I also added the "Skip Intro" WHDload option as a menu preset and WHDload "startup keyboard language" selection
TagsNo tags attached.
Attached Files
CrimeWave.asm (5,400 bytes)   
; V1.2.1, ztronzo
; 26-May-2026	- WHDload option custom2 for keyboard language setting
;		- WHDload option custom3 to skip intro preset option
;		- WHDload option custom4 to remove keyboard up/down tap-wait which rendered slow character up/down response time
;			using keyboard you can use the extra keys: space, left-alt, left-ctrl, left-shift for fire, rocket, jump, crouch	
;			the above can now assist for an easy adaptation to CD32 controls
;
; V1.2, StingRay
; 10-Apr-2022	- manual protection completely skipped
;		- keyboard routine fixed
;		- 68000 quitkey support
;		- file loader patch rewritten, it is 68000 compatible now

	;INCDIR	SOURCES:Include/
	INCDIR	Include:
	INCLUDE	whdload.i
	OUTPUT	"CrimeWave.Slave"

GAME_ADDRESS		= $1100-$1c
FILE_TABLE_OFFSET	= $14c06


_base		SLAVE_HEADER			;ws_Security + ws_ID
		dc.w	17			;ws_Version
		dc.w	WHDLF_NoError		;ws_flags
		dc.l	$80000			;ws_BaseMemSize
		dc.l	0			;ws_ExecInstall
		dc.w	_Start-_base		;ws_GameLoader
		dc.w	_dir-_base		;ws_CurrentDir
		dc.w	0			;ws_DontCache
_keydebug	dc.b	0			;ws_keydebug
_keyexit	dc.b	$59			;ws_keyexit = F10
		dc.l	0
		dc.w	_name-_base		;ws_name
		dc.w	_copy-_base		;ws_copy
		dc.w	_info-_base		;ws_info
; v16
	dc.w	0			; ws_kickname
	dc.l	0			; ws_kicksize
	dc.w	0			; ws_kickcrc

; v17
	dc.w	.config-_base		; ws_config


.config
	dc.b	"C1:B:Enable Trainer;"
	dc.b	"C2:L:Keyboard Language:Not set,English Keyboard,Clavier Francais,Deutsche Tastatur,Tastiera Italiana;"
	dc.b	"C3:B:Skip Intro;"
	dc.b	"C4:B:Disable up-down tap wait (disables jump/crouch tap function);"
	dc.b	0


_dir		dc.b	"data",0
_name		dc.b	"Crime Wave",0
_copy		dc.b	"1990 US Gold",0
_info		dc.b	"installed & fixed by Bored Seal & StingRay (extras by ztronzo)",10
		dc.b	"V1.2.1 (26-May-2026)",0
		even

_Start		lea	(_resload,pc),a1
		move.l	a0,(a1)			;save for later using

		move.l	a0,a2
                lea     (_tags,pc),a0
                jsr     (resload_Control,a2)

		lea	filename(pc),a0
		lea	$10e4.w,a1
		move.l	a1,-(sp)
		jsr	(resload_LoadFile,a2)

		move.l	(sp)+,a0
		jsr	(resload_CRC16,a2)
		cmp.w	#$7d36,d0
		bne.w	Unsupported


		move.w	#$4e75,$175ba		;remove disk access
		move.w	#$4e75,$17802
		move.w	#$6012,$20dc

		move.w	#$6002,$b1b2		;remove access fault

		lea	_trainer(pc),a1
		tst.l	(a1)
		beq.b	.NoTrainer

		move.l	#$4e714e71,$3b40	;unlimited lives
		move.w	#$4a79,d0
		move.w	d0,$39d0		;unlimited ammo1
		move.w	d0,$38d4		;unlimited rocked
.NoTrainer

		lea	_KeyBoardLang(pc),a1
		move.l	(a1),d0
		beq.b	.NoKeyBoardLanguage		; 0 = not set 		; OG check starts at $00001268
		cmp.l	#1,d0
		beq.b	.English
		cmp.l	#2,d0
		beq.b	.French
		cmp.l	#3,d0
		beq.b	.German
		cmp.l	#4,d0
		beq.b	.Italian
		bra.b	.NoKeyBoardLanguage
.English	move.l	#$103C0031,$126a		; English operations	; 103C 0031 	move.b #$31,d0
		bra.b	.NoKeyBoardLanguage	
.French		move.l	#$103C0032,$126a
		bra.b	.NoKeyBoardLanguage
.German		move.l	#$103C0033,$126a
		bra.b	.NoKeyBoardLanguage
.Italian	move.l	#$103C0034,$126a
.NoKeyBoardLanguage

		lea	_SkipIntro(pc),a1
		tst.l	(a1)
		beq.b	.NoSkipIntro
		move.l	#$50EE0149,$dde2		; st.b	($0149,a6) ; $00=Play intro	$ff=disable intro ; from OG: 00dde2 422e 0149 clr.b ($0149,a6) == $0002761d [00]
.NoSkipIntro

		lea	_NoKeyWait(pc),a1
		tst.l	(a1)
		beq.b	.NoKeyWait

		move.l	#$4e714e71,$2150	; disable up key wait	(works OK but we also disable the release check)
		move.l	#$4e714e71,$2154
		move.w	#$4e71,$2158
		move.l	#$4e714e71,$2170	; disable up release check	
		move.l	#$4e716000,$2174

		move.l	#$4e714e71,$2196	; disable down key wait (works OK but we also disable the release check)
		move.l	#$4e714e71,$219A
		move.w	#$4e71,$219E
		move.l	#$4e714e71,$21b6	; disable down release check
		move.l	#$4e716000,$21ba
.NoKeyWait


	; V1.2
	lea	PL_GAME(pc),a0
	lea	(GAME_ADDRESS).w,a1
	move.l	_resload(pc),a2
	jsr	resload_Patch(a2)

		jmp	$1100.w

PL_GAME	PL_START
	PL_R	$e608			; disable protection check
	PL_PS	$16a44,.Fix_Keyboard_Delay
	PL_PS	$16a32,.Check_Quit_Key
	PL_P	$14a4e,Load_File
	PL_END

.Fix_Keyboard_Delay
	movem.l	d0/d1,-(a7)
	moveq	#3-1,d0
.loop	move.b	$dff006,d1
.same_raster_line
	cmp.b	$dff006,d1
	beq.b	.same_raster_line
	dbf	d0,.loop
	movem.l	(a7)+,d0/d1
	rts


.Check_Quit_Key
	move.b	$bfec01,d0
	move.l	d0,-(a7)
	ror.b	#1,d0
	not.b	d0
	bsr.b	Check_Quit_Key
	move.l	(a7)+,d0
	rts


; d0.w: file number
; a0.l: destination

Load_File
	movem.l	d1-a6,-(a7)
	lea	GAME_ADDRESS+FILE_TABLE_OFFSET,a1
	
.find_file_entry
	tst.w	d0
	beq.b	.file_entry_found
.find_file_name_end
	tst.b	(a1)+
	bne.b	.find_file_name_end
	subq.w	#1,d0
	bra.b	.find_file_entry


.file_entry_found
	addq.w	#2,a1		; skip disk number

	move.l	a1,a2
.filter_file_name
	cmp.b	#"\",(a2)
	bne.b	.file_name_character_is_valid
	move.b	#"/",(a2)

.file_name_character_is_valid
	addq.w	#1,a2
	tst.b	(a2)
	bne.b	.filter_file_name

	exg	a0,a1
	move.l	_resload(pc),a2
	jsr	resload_LoadFileDecrunch(a2)
	movem.l	(a7)+,d1-a6
	rts


; d0.b: raw key code
Check_Quit_Key
	cmp.b	_base+ws_keyexit(pc),d0
	beq.b	QUIT
	rts

QUIT	pea	(TDREASON_OK).w
	bra.w	_end



Unsupported	pea	(TDREASON_WRONGVER).w
_end		move.l	(_resload,pc),a2
		jmp	(resload_Abort,a2)

_resload	dc.l	0
_tags		dc.l	WHDLTAG_CUSTOM1_GET
_trainer		dc.l    0
			dc.l	WHDLTAG_CUSTOM2_GET
_KeyBoardLang	dc.l    0
			dc.l	WHDLTAG_CUSTOM3_GET
_SkipIntro	dc.l    0
			dc.l	WHDLTAG_CUSTOM4_GET
_NoKeyWait	dc.l    0
			dc.l	TAG_END
filename	dc.b	"boot.prg",0
CrimeWave.asm (5,400 bytes)   
MachineA1200
CPU68020
CPUSpeed50
ChipSetAGA
GFXCardNone
ChipMem2 MB
FastMem0 MB
WorkbenchOS 3.0
KickROM40 - Kick 3.1
KickSoftNone
WHDLoad19.2
imported

Activities

ztronzo

ztronzo

2026-05-29 13:25

reporter   note ~14995

I include a version 1.2.2 in this attachment with the updated slave source
added option for CD32 controls (Still requires keyboard to press G to enter the menu and to write high-score name on game-over)

included ReadJoypad-ButtonsJ1.s which reads GamePort1 using minimal code and single byte return only for reading buttons
(useful for patching games which already include original movement function and only require the extra buttons read)

; V1.2.2, ztronzo
; 27-May-2026 - WHDload option custom4 for controller type
; - CD32 gamepad option enabled
; Red = Normal shot (disabled tap reads)
; Blue = Rockets
; Yellow/Forward = Jump
; Green/Reverse = Crouch
; Play = Pause
;
; - simplified code on skipping tap waits for up, down and rocket launcher when using CD32 gamepad controller
;
ReadJoypad-ButtonsJ1.s (1,822 bytes)   
;==========================================================================
; single byte read for CD32 joypad1 buttons-only with: move.b	joy1(pc),d0 
; (use ReadJoypad.s for full directions)

BTN_PLAY		EQU	1	; start button
BTN_REVERSE		EQU	2	; L1 shoulder button
BTN_FORWARD		EQU	3	; R1 shoulder button
BTN_GREEN		EQU	4	; west button
BTN_YELLOW		EQU	5	; north button
BTN_RED			EQU	6	; south button
BTN_BLUE		EQU	7	; east button

_CD32buttons:		movem.l	d0-d3/a0-a1,-(a7)
		lea	$DFF000,a0		;lea	_custom,a0
		lea	$BFE001,a1		;lea	_ciaa,a1		;	* ciaa port A (0xbfe001)
		moveq	#(7),d3	; red button ( port 1 )		; CIAB_GAMEPORT1	  EQU	(7)   * gameport 1, pin 6 (fire button*)
.read_buttons
		bset	d3,$0200(a1)	;set bit to out at ciaddra
		bclr	d3,$0000(a1)	;clr bit to in at ciapra
		move.w	#$e000,$034(a0)	; move to potgo	; $e000 for potgo port 1  ; $6f00
		moveq	#0,d0
		moveq	#8-1,d1
		bra.b	.gamecont4
.gamecont3
		tst.b	$0000(a1)	; tst.b	ciapra(a1)
		tst.b	$0000(a1)
.gamecont4	
		tst.b	$0000(a1)	; wepl timing fix
		tst.b	$0000(a1)	; tst.b	ciapra(a1)
		tst.b	$0000(a1)
		tst.b	$0000(a1)
		tst.b	$0000(a1)
		tst.b	$0000(a1)
		move.w	$016(a0),d2			;move.w	potinp(a0),d2
		bset	d3,$0000(a1)
		bclr	d3,$0000(a1)
		btst	#14,d2			; blue button ( port 1 )
		bne.b	.gamecont5
		bset	d1,d0
.gamecont5	dbf	d1,.gamecont3
		bclr	d3,$0200(a1)		;bclr	d3,ciaddra(a1)			;set bit to in at ciaddra
		move.w	#$FF00,$034(a0)	; #POTGO_RESET,$034(a0)	; reset potgo ; was $FFFF but changed, thanks to robinsonb5@eab
		cmp.b	#$FF,d0	; all 7 but triggered = possible 2 button joystick
		bne.s	.skip
		move.b	#$80,d0	; set 2 button joystick to be compatible with CD32 result 
.skip		
		lea	joy1(pc),a0
		move.b	d0,(a0)		
		movem.l	(a7)+,d0-d3/a0-a1
	rts	

;==========================================================================

joy1		dc.b	0,0
ReadJoypad-ButtonsJ1.s (1,822 bytes)   
CrimeWave-2.asm (6,426 bytes)   
; V1.2.2, ztronzo
; 27-May-2026	- WHDload option custom4 for controller type
;		- CD32 gamepad option enabled
;			Red				= Normal shot (disabled tap reads)
;			Blue			= Rockets
;			Yellow/Forward	= Jump
;			Green/Reverse	= Crouch
;			Play 			= Pause
;
;		- simplified code on skipping tap waits for up, down and rocket launcher when using CD32 gamepad controller
;
; V1.2.1, ztronzo
; 26-May-2026	- WHDload option custom2 for keyboard language setting
;		- WHDload option custom3 to skip intro preset option
;		- WHDload option custom4 to remove keyboard up/down tap-wait which rendered slow character up/down response time
;			using keyboard you can use the extra keys: space, left-alt, left-ctrl, left-shift for fire, rocket, jump, crouch	
;			the above can now assist for an easy adaptation to CD32 controls
;
; V1.2, StingRay
; 10-Apr-2022	- manual protection completely skipped
;		- keyboard routine fixed
;		- 68000 quitkey support
;		- file loader patch rewritten, it is 68000 compatible now

	;INCDIR	SOURCES:Include/
	INCDIR	Include:
	INCLUDE	whdload.i
	OUTPUT	"CrimeWave.Slave"

GAME_ADDRESS		= $1100-$1c
FILE_TABLE_OFFSET	= $14c06


_base		SLAVE_HEADER			;ws_Security + ws_ID
		dc.w	17			;ws_Version
		dc.w	WHDLF_NoError		;ws_flags
		dc.l	$80000			;ws_BaseMemSize
		dc.l	0			;ws_ExecInstall
		dc.w	_Start-_base		;ws_GameLoader
		dc.w	_dir-_base		;ws_CurrentDir
		dc.w	0			;ws_DontCache
_keydebug	dc.b	0			;ws_keydebug
_keyexit	dc.b	$59			;ws_keyexit = F10
		dc.l	0
		dc.w	_name-_base		;ws_name
		dc.w	_copy-_base		;ws_copy
		dc.w	_info-_base		;ws_info
; v16
	dc.w	0			; ws_kickname
	dc.l	0			; ws_kicksize
	dc.w	0			; ws_kickcrc

; v17
	dc.w	.config-_base		; ws_config


.config
	dc.b	"C1:B:Enable Trainer;"
	dc.b	"C2:L:Keyboard Language:Not set,English Keyboard,Clavier Francais,Deutsche Tastatur,Tastiera Italiana;"
	dc.b	"C3:B:Skip Intro;"
	dc.b	"C4:L:Controller type:Joystick,CD32 Gamepad,Keyboard;"
	dc.b	0


_dir		dc.b	"data",0
_name		dc.b	"Crime Wave",0
_copy		dc.b	"1990 US Gold",0
_info		dc.b	"installed & fixed by Bored Seal & StingRay (extras by ztronzo)",10
		dc.b	"V1.2.2 (27-May-2026)",0
		even

    include ReadJoypad-ButtonsJ1.s

_Start		lea	(_resload,pc),a1
		move.l	a0,(a1)			;save for later using

		move.l	a0,a2
                lea     (_tags,pc),a0
                jsr     (resload_Control,a2)

		lea	filename(pc),a0
		lea	$10e4.w,a1
		move.l	a1,-(sp)
		jsr	(resload_LoadFile,a2)

		move.l	(sp)+,a0
		jsr	(resload_CRC16,a2)
		cmp.w	#$7d36,d0
		bne.w	Unsupported


		move.w	#$4e75,$175ba		;remove disk access
		move.w	#$4e75,$17802
		move.w	#$6012,$20dc

		move.w	#$6002,$b1b2		;remove access fault

		lea	_trainer(pc),a1
		tst.l	(a1)
		beq.b	.NoTrainer

		move.l	#$4e714e71,$3b40	;unlimited lives
		move.w	#$4a79,d0
		move.w	d0,$39d0		;unlimited ammo1
		move.w	d0,$38d4		;unlimited rocked
.NoTrainer

		lea	_KeyBoardLang(pc),a1
		move.l	(a1),d0
		beq.b	.NoKeyBoardLanguage		; 0 = not set 		; OG check starts at $00001268
		cmp.l	#1,d0
		beq.b	.English
		cmp.l	#2,d0
		beq.b	.French
		cmp.l	#3,d0
		beq.b	.German
		cmp.l	#4,d0
		beq.b	.Italian
		bra.b	.NoKeyBoardLanguage
.English	move.l	#$103C0031,$126a		; English operations	; 103C 0031 	move.b #$31,d0
		bra.b	.NoKeyBoardLanguage	
.French		move.l	#$103C0032,$126a
		bra.b	.NoKeyBoardLanguage
.German		move.l	#$103C0033,$126a
		bra.b	.NoKeyBoardLanguage
.Italian	move.l	#$103C0034,$126a
.NoKeyBoardLanguage

		lea	_SkipIntro(pc),a1
		tst.l	(a1)
		beq.b	.NoSkipIntro
		move.l	#$50EE0149,$dde2		; st.b	($0149,a6) ; $00=Play intro	$ff=disable intro ; from OG: 00dde2 422e 0149 clr.b ($0149,a6) == $0002761d [00]
.NoSkipIntro


	; V1.2
	lea	PL_GAME(pc),a0
	lea	(GAME_ADDRESS).w,a1
	move.l	_resload(pc),a2
	jsr	resload_Patch(a2)

		jmp	$1100.w

PL_GAME	PL_START
	PL_R	$F6EC-$10E4		; disable protection check
	PL_PS	$17b28-$10E4,Fix_Keyboard_Delay			; 00017b28 
	PL_PS	$17B16-$10E4,Check_Quit_Key
	PL_P	$15B32-$10E4,Load_File
	
	
	PL_IFC4X	00	; CD32 Gamepad
		PL_PS	$17a3e-$10E4,ControllerCD32pad
		PL_W	$2100-$10E4,$6000	; disable joystick fire tap wait for rocket launch
		PL_W	$2146-$10E4,$6000	; disable up key wait
		PL_W	$21b2-$10E4,$6000	; disable down key wait
		PL_W	$17b5a-$10E4,$FF00	; Options menu
	PL_ENDIF

	PL_IFC4X	01	; Keyboard
		PL_W	$2146-$10E4,$6000	; disable up key wait
		PL_W	$21b2-$10E4,$6000	; disable down key wait
	PL_ENDIF

	
	PL_END

Fix_Keyboard_Delay
	movem.l	d0/d1,-(a7)
	moveq	#3-1,d0
.loop	move.b	$dff006,d1
.same_raster_line
	cmp.b	$dff006,d1
	beq.b	.same_raster_line
	dbf	d0,.loop
	movem.l	(a7)+,d0/d1
	rts


Check_Quit_Key
	move.b	$bfec01,d0
	move.l	d0,-(a7)
	ror.b	#1,d0
	not.b	d0
	bsr.b	.Check_Quit_Key
	move.l	(a7)+,d0
	rts

; d0.b: raw key code
.Check_Quit_Key
	cmp.b	_base+ws_keyexit(pc),d0
	beq.b	.QUIT
	rts

.QUIT	pea	(TDREASON_OK).w
	bra.w	_end


ControllerCD32pad	bsr		_CD32buttons
		move.b	joy1(pc),d1
		btst.b	#BTN_RED,d1			; BTN_RED - shoot gun ($17b70)
		sne.b	$17b70
		btst.b	#BTN_BLUE,d1		; BTN_BLUE - rocket ($17b71)
		sne.b	$17b71
		btst.b	#BTN_YELLOW,d1		; BTN_YELLOW - jump ($17b55)
		bne.s	.SetJump
		btst.b	#BTN_FORWARD,d1		; BTN_FORWARD - also jump
.SetJump
		sne.b	$17b55
		btst.b	#BTN_GREEN,d1		; BTN_GREEN - crouch ($17b62)
		bne.s	.SetCrouch
		btst.b	#BTN_REVERSE,d1		; BTN_REVERSE - also crouch
.SetCrouch
		sne.b	$17b62
		btst.b	#BTN_PLAY,d1		; BTN_RED - pause ($17b70)
		sne.b	$17b51
		sne.b	$17b5a				; Options menu
		;not.b	$17b5a				; Options menu
		move.b	$00bfe001,d1		; OG code to allow Keyboard input too
		rts


; d0.w: file number
; a0.l: destination

Load_File
	movem.l	d1-a6,-(a7)
	lea	GAME_ADDRESS+FILE_TABLE_OFFSET,a1
	
.find_file_entry
	tst.w	d0
	beq.b	.file_entry_found
.find_file_name_end
	tst.b	(a1)+
	bne.b	.find_file_name_end
	subq.w	#1,d0
	bra.b	.find_file_entry


.file_entry_found
	addq.w	#2,a1		; skip disk number

	move.l	a1,a2
.filter_file_name
	cmp.b	#"\",(a2)
	bne.b	.file_name_character_is_valid
	move.b	#"/",(a2)

.file_name_character_is_valid
	addq.w	#1,a2
	tst.b	(a2)
	bne.b	.filter_file_name

	exg	a0,a1
	move.l	_resload(pc),a2
	jsr	resload_LoadFileDecrunch(a2)
	movem.l	(a7)+,d1-a6
	rts






Unsupported	pea	(TDREASON_WRONGVER).w
_end		move.l	(_resload,pc),a2
		jmp	(resload_Abort,a2)

_resload	dc.l	0
_tags		dc.l	WHDLTAG_CUSTOM1_GET
_trainer		dc.l    0
			dc.l	WHDLTAG_CUSTOM2_GET
_KeyBoardLang	dc.l    0
			dc.l	WHDLTAG_CUSTOM3_GET
_SkipIntro	dc.l    0
			dc.l	WHDLTAG_CUSTOM4_GET
_Controller	dc.l    0
			dc.l	TAG_END
filename	dc.b	"boot.prg",0
CrimeWave-2.asm (6,426 bytes)   
ztronzo

ztronzo

2026-05-29 17:15

reporter   note ~14996

Had to cleanup and give you my final corrected files, please delete/replace older files of similar name
CrimeWave-3.asm (6,405 bytes)   
; V1.2.2, ztronzo
; 27-May-2026	- WHDload option custom4 for controller type
;		- CD32 gamepad option enabled
;			Red				= Normal shot (disabled tap reads)
;			Blue			= Rockets
;			Yellow/Forward	= Jump
;			Green/Reverse	= Crouch
;			Play 			= Pause
;
;		- simplified code on skipping tap waits for up, down and rocket launcher when using CD32 gamepad controller
;
; V1.2.1, ztronzo
; 26-May-2026	- WHDload option custom2 for keyboard language setting
;		- WHDload option custom3 to skip intro preset option
;		- WHDload option custom4 to remove keyboard up/down tap-wait which rendered slow character up/down response time
;			using keyboard you can use the extra keys: space, left-alt, left-ctrl, left-shift for fire, rocket, jump, crouch	
;			the above can now assist for an easy adaptation to CD32 controls
;
; V1.2, StingRay
; 10-Apr-2022	- manual protection completely skipped
;		- keyboard routine fixed
;		- 68000 quitkey support
;		- file loader patch rewritten, it is 68000 compatible now

	;INCDIR	SOURCES:Include/
	INCDIR	Include:
	INCLUDE	whdload.i
	OUTPUT	"CrimeWave.Slave"

GAME_ADDRESS		= $1100-$1c
FILE_TABLE_OFFSET	= $14c06


_base		SLAVE_HEADER			;ws_Security + ws_ID
		dc.w	17			;ws_Version
		dc.w	WHDLF_NoError		;ws_flags
		dc.l	$80000			;ws_BaseMemSize
		dc.l	0			;ws_ExecInstall
		dc.w	_Start-_base		;ws_GameLoader
		dc.w	_dir-_base		;ws_CurrentDir
		dc.w	0			;ws_DontCache
_keydebug	dc.b	0			;ws_keydebug
_keyexit	dc.b	$59			;ws_keyexit = F10
		dc.l	0
		dc.w	_name-_base		;ws_name
		dc.w	_copy-_base		;ws_copy
		dc.w	_info-_base		;ws_info
; v16
	dc.w	0			; ws_kickname
	dc.l	0			; ws_kicksize
	dc.w	0			; ws_kickcrc

; v17
	dc.w	.config-_base		; ws_config


.config
	dc.b	"C1:B:Enable Trainer;"
	dc.b	"C2:L:Keyboard Language:Not set,English Keyboard,Clavier Francais,Deutsche Tastatur,Tastiera Italiana;"
	dc.b	"C3:B:Skip Intro;"
	dc.b	"C4:L:Controller type:Joystick,CD32 Gamepad,Keyboard;"
	dc.b	0


_dir		dc.b	"data",0
_name		dc.b	"Crime Wave",0
_copy		dc.b	"1990 US Gold",0
_info		dc.b	"installed & fixed by Bored Seal & StingRay (extras by ztronzo)",10
		dc.b	"V1.2.2 (27-May-2026)",0
		even

    include ReadJoypad-ButtonsJ1.s

_Start		lea	(_resload,pc),a1
		move.l	a0,(a1)			;save for later using

		move.l	a0,a2
                lea     (_tags,pc),a0
                jsr     (resload_Control,a2)

		lea	filename(pc),a0
		lea	$10e4.w,a1
		move.l	a1,-(sp)
		jsr	(resload_LoadFile,a2)

		move.l	(sp)+,a0
		jsr	(resload_CRC16,a2)
		cmp.w	#$7d36,d0
		bne.w	Unsupported


		move.w	#$4e75,$175ba		;remove disk access
		move.w	#$4e75,$17802
		move.w	#$6012,$20dc

		move.w	#$6002,$b1b2		;remove access fault

		lea	_trainer(pc),a1
		tst.l	(a1)
		beq.b	.NoTrainer

		move.l	#$4e714e71,$3b40	;unlimited lives
		move.w	#$4a79,d0
		move.w	d0,$39d0		;unlimited ammo1
		move.w	d0,$38d4		;unlimited rocked
.NoTrainer

		lea	_KeyBoardLang(pc),a1
		move.l	(a1),d0
		beq.b	.NoKeyBoardLanguage		; 0 = not set 		; OG check starts at $00001268
		cmp.l	#1,d0
		beq.b	.English
		cmp.l	#2,d0
		beq.b	.French
		cmp.l	#3,d0
		beq.b	.German
		cmp.l	#4,d0
		beq.b	.Italian
		bra.b	.NoKeyBoardLanguage
.English	move.l	#$103C0031,$126a		; English operations	; 103C 0031 	move.b #$31,d0
		bra.b	.NoKeyBoardLanguage	
.French		move.l	#$103C0032,$126a
		bra.b	.NoKeyBoardLanguage
.German		move.l	#$103C0033,$126a
		bra.b	.NoKeyBoardLanguage
.Italian	move.l	#$103C0034,$126a
.NoKeyBoardLanguage

		lea	_SkipIntro(pc),a1
		tst.l	(a1)
		beq.b	.NoSkipIntro
		move.l	#$50EE0149,$dde2		; st.b	($0149,a6) ; $00=Play intro	$ff=disable intro ; from OG: 00dde2 422e 0149 clr.b ($0149,a6) == $0002761d [00]
.NoSkipIntro


	; V1.2
	lea	PL_GAME(pc),a0
	lea	(GAME_ADDRESS).w,a1
	move.l	_resload(pc),a2
	jsr	resload_Patch(a2)

		jmp	$1100.w

PL_GAME	PL_START
	PL_R	$F6EC-$10E4		; disable protection check
	PL_PS	$17b28-$10E4,Fix_Keyboard_Delay			; 00017b28 
	PL_PS	$17B16-$10E4,Check_Quit_Key
	PL_P	$15B32-$10E4,Load_File
	
	
	PL_IFC4X	00	; CD32 Gamepad
		PL_PS	$17a3e-$10E4,ControllerCD32pad
		PL_W	$2100-$10E4,$6000	; disable joystick fire tap wait for rocket launch
		PL_W	$2146-$10E4,$6000	; disable up key wait
		PL_W	$21b2-$10E4,$6000	; disable down key wait
		;PL_W	$17b5a-$10E4,$FF00	; Options menu
	PL_ENDIF

	PL_IFC4X	01	; Keyboard
		PL_W	$2146-$10E4,$6000	; disable up key wait
		PL_W	$21b2-$10E4,$6000	; disable down key wait
	PL_ENDIF

	
	PL_END

Fix_Keyboard_Delay
	movem.l	d0/d1,-(a7)
	moveq	#3-1,d0
.loop	move.b	$dff006,d1
.same_raster_line
	cmp.b	$dff006,d1
	beq.b	.same_raster_line
	dbf	d0,.loop
	movem.l	(a7)+,d0/d1
	rts


Check_Quit_Key
	move.b	$bfec01,d0
	move.l	d0,-(a7)
	ror.b	#1,d0
	not.b	d0
	bsr.b	.Check_Quit_Key
	move.l	(a7)+,d0
	rts

; d0.b: raw key code
.Check_Quit_Key
	cmp.b	_base+ws_keyexit(pc),d0
	beq.b	.QUIT
	rts

.QUIT	pea	(TDREASON_OK).w
	bra.w	_end


ControllerCD32pad	bsr		_CD32buttons
		move.b	joy1(pc),d1
		btst.b	#BTN_RED,d1			; BTN_RED - shoot gun ($17b70)
		sne.b	$17b70
		btst.b	#BTN_BLUE,d1		; BTN_BLUE - rocket ($17b71)
		sne.b	$17b71
		btst.b	#BTN_YELLOW,d1		; BTN_YELLOW - jump ($17b55)
		bne.s	.SetJump
		btst.b	#BTN_FORWARD,d1		; BTN_FORWARD - also jump
.SetJump
		sne.b	$17b55
		btst.b	#BTN_GREEN,d1		; BTN_GREEN - crouch ($17b62)
		bne.s	.SetCrouch
		btst.b	#BTN_REVERSE,d1		; BTN_REVERSE - also crouch
.SetCrouch
		sne.b	$17b62
		btst.b	#BTN_PLAY,d1		; BTN_RED - pause ($17b70)
		sne.b	$17b51
		;sne.b	$17b5a				;enable game options menu
		move.b	$00bfe001,d1		; OG code to allow Keyboard input too
		rts


; d0.w: file number
; a0.l: destination

Load_File
	movem.l	d1-a6,-(a7)
	lea	GAME_ADDRESS+FILE_TABLE_OFFSET,a1
	
.find_file_entry
	tst.w	d0
	beq.b	.file_entry_found
.find_file_name_end
	tst.b	(a1)+
	bne.b	.find_file_name_end
	subq.w	#1,d0
	bra.b	.find_file_entry


.file_entry_found
	addq.w	#2,a1		; skip disk number

	move.l	a1,a2
.filter_file_name
	cmp.b	#"\",(a2)
	bne.b	.file_name_character_is_valid
	move.b	#"/",(a2)

.file_name_character_is_valid
	addq.w	#1,a2
	tst.b	(a2)
	bne.b	.filter_file_name

	exg	a0,a1
	move.l	_resload(pc),a2
	jsr	resload_LoadFileDecrunch(a2)
	movem.l	(a7)+,d1-a6
	rts






Unsupported	pea	(TDREASON_WRONGVER).w
_end		move.l	(_resload,pc),a2
		jmp	(resload_Abort,a2)

_resload	dc.l	0
_tags		dc.l	WHDLTAG_CUSTOM1_GET
_trainer		dc.l    0
			dc.l	WHDLTAG_CUSTOM2_GET
_KeyBoardLang	dc.l    0
			dc.l	WHDLTAG_CUSTOM3_GET
_SkipIntro	dc.l    0
			dc.l	WHDLTAG_CUSTOM4_GET
_Controller	dc.l    0
			dc.l	TAG_END
filename	dc.b	"boot.prg",0
CrimeWave-3.asm (6,405 bytes)   
ReadJoypad-ButtonsJ1-2.s (1,795 bytes)   
;==========================================================================
; single byte read for CD32 joypad1 buttons-only with: move.b	joy1(pc),d0 
; (use ReadJoypad.s for full directions)

BTN_PLAY		EQU	1	; start button
BTN_REVERSE		EQU	2	; L1 shoulder button
BTN_FORWARD		EQU	3	; R1 shoulder button
BTN_GREEN		EQU	4	; west button
BTN_YELLOW		EQU	5	; north button
BTN_RED			EQU	6	; south button
BTN_BLUE		EQU	7	; east button

_CD32buttons:		movem.l	d0-d3/a0-a1,-(a7)
		lea	$DFF000,a0		;lea	_custom,a0
		lea	$BFE001,a1		;lea	_ciaa,a1		;	* ciaa port A (0xbfe001)
		moveq	#(7),d3	; red button ( port 1 )		; CIAB_GAMEPORT1	  EQU	(7)   * gameport 1, pin 6 (fire button*)
.read_buttons
		bset	d3,$0200(a1)	;set bit to out at ciaddra
		bclr	d3,$0000(a1)	;clr bit to in at ciapra
		move.w	#$4F00,$034(a0)	; move to potgo	; $6f00 for potgo port 1
		moveq	#0,d0
		moveq	#8-1,d1
		bra.b	.gamecont4
.gamecont3
		tst.b	$0000(a1)	; tst.b	ciapra(a1)
		tst.b	$0000(a1)
.gamecont4	
		tst.b	$0000(a1)	; wepl timing fix
		tst.b	$0000(a1)	; tst.b	ciapra(a1)
		tst.b	$0000(a1)
		tst.b	$0000(a1)
		tst.b	$0000(a1)
		tst.b	$0000(a1)
		move.w	$016(a0),d2			;move.w	potinp(a0),d2
		bset	d3,$0000(a1)
		bclr	d3,$0000(a1)
		btst	#14,d2			; blue button ( port 1 )
		bne.b	.gamecont5
		bset	d1,d0
.gamecont5	dbf	d1,.gamecont3
		bclr	d3,$0200(a1)		;bclr	d3,ciaddra(a1)			;set bit to in at ciaddra
		move.w	#$FF00,$034(a0)	; #POTGO_RESET,$034(a0)	; reset potgo ; was $FFFF but changed, thanks to robinsonb5@eab
		cmp.b	#$FF,d0	; 7 bits triggered, possible 2 button joystick
		bne.s	.skip
		move.b	#$80,d0	; 2 button joystick output same as CD32 blue
.skip		
		lea	joy1(pc),a0
		move.b	d0,(a0)		
		movem.l	(a7)+,d0-d3/a0-a1
	rts	

;==========================================================================

joy1		dc.b	0,0
ReadJoypad-ButtonsJ1-2.s (1,795 bytes)   
Wepl

Wepl

2026-06-01 21:59

manager   note ~14999

Why not using https://whdload.de/docs/autodoc.html#resload_ReadJoyPort ?
I will try to test and maybe build new install package.

Issue History

Date Modified Username Field Change
2026-05-28 05:16 ztronzo New Issue
2026-05-28 05:16 ztronzo File Added: CrimeWave.asm
2026-05-29 13:25 ztronzo Note Added: 14995
2026-05-29 13:25 ztronzo File Added: ReadJoypad-ButtonsJ1.s
2026-05-29 13:25 ztronzo File Added: CrimeWave-2.asm
2026-05-29 17:15 ztronzo Note Added: 14996
2026-05-29 17:15 ztronzo File Added: CrimeWave-3.asm
2026-05-29 17:15 ztronzo File Added: ReadJoypad-ButtonsJ1-2.s
2026-06-01 21:59 Wepl Note Added: 14999
2026-06-01 21:59 Wepl Assigned To => Wepl
2026-06-01 21:59 Wepl Status new => assigned