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

Daffy Duck: The Marvin Missions (SNES)

From The Cutting Room Floor
Jump to navigation Jump to search

Title Screen

Daffy Duck: The Marvin Missions

Developer: ICOM Simulations
Publisher: Sunsoft
Platform: SNES
Released in US: October 1993
Released in EU: April 28, 1994
Released in BR: February 1994


SourceIcon.png This game has uncompiled source code.


Hmmm...
To do:
Prototype.

Uncompiled Source Code

Large chunks of uncompiled source code are in the American sample ROM at 0x47400 and 0x4F400, while the European release just has a small chunk at 0x37F2A.

00		; 16 bit accu.
	LONGA	ON
	inc	ep1
	lda	et1			; Current Address
	sta	[ep1]
	inc	ep1			; bump hma pointer
	inc	ep1
	dec	et2			; keep going until complete
	bne	.15

	inc	et1			; bump var used
	inc	et1
	bra	.10

.40	sep	#%00100000		; 8 bit accu.
	LONGA	OFF
	lda	#$81			; 1 at a time
	sta	[ep1]
	rep	#%00100000		; 16 bit accu.
	LONGA	ON
	inc	ep1
	lda	et1			; Current Address
	sta	[ep1]
	inc	ep1
	inc	ep1
	lda	ep1
	cmp	#(HDMAMiscTable+$0ef0)	; Reached the end?
	bcc	.40
	lda	#$0000			; End
	sta	[ep1]
	inc	ep1
	inc	ep1
	sta	[ep1]

	lda	#HDMAVarSpace
	sta	ep1
	ldx	#|HDMAVarSpace
	stx	ep1+2
	stx	$4377			; Data Bank for HDMA

	lda	#$0000
	ldy	#$80
.80	sta	[ep1],y			; Clear out var. space
	dey
	dey
	bpl	.80

.90	plb				; Restore DBR
	plp
	rtl
;----------------------------------------------------------------------------
Build_Level_HDMA:
	php

	sep	#%00100000		; 8 bit accumulator
	LONGA	OFF
	phb				; Save current DBR
	lda	#|(.10)-1		; Push current bank #
	pha
	rep	#%00100000		; 16 bit accumulator
	LONGA	ON
	lda	#(.10)-1		; Return address on stack
	pha

	sep	#%00100000		; 8 bit accumulator
	LONGA	OFF
	lda	LevelInitBank
	pha
	pha
	plb				; Set DBR same as init code
	rep	#%00100000		; 16 bit accumulator
	LONGA	ON

	lda	LevelInitCode
	clc
	adc	#12			; Get to 5th spot (HDMA Update)
	pha
	rtl				; Special JMP

.10	plb				; Restore DBR
	plp				; Restore processor status
	rtl
;----------------------------------------------------------------------------
Check_For_Pause:
	php
	rep	#%00100000		; 16 bit accu.
	LONGA	ON
	lda	DDStartCtrl
	beq	.90
	lda	#1
	sta	GamePaused

	lda	CurrentLevel
	and	#%0000000000000011
	cmp	#%0000000000000011	; End-Boss level?
	beq	.30			; skip radar if End-Boss
;	lda	StatusBarUpdate
;	ora	#Update_PauseOn		; Update pause display
;	sta	StatusBarUpdate

	jsl	MakeRadar
	jsl	Wait_For_VBL
	jsl	Draw_Radar		; Draw radar to screen

	jsl	Init_PauseBlink		; Initialize blinking dot

.30	jsl	Wait_For_VBL
	jsl	Update_Status_Bar	; Update energy & life bar
	jsl	Read_DD_Controls	; Get controls for DD
	lda	CurrentLevel
	and	#%0000000000000011
	cmp	#%0000000000000011	; End-Boss level?
	beq	.35			; skip radar if End-Boss
	jsl	Update_PauseBlink

.35	lda	DDStartCtrl
	beq	.30

	jsl	Clear_Radar		; Clear Radar image

	lda	StatusBarUpdate
	ora	#Update_PauseOff	; Update pause display
	sta	StatusBarUpdate

.90	stz	GamePaused
	plp
	rtl
;----------------------------------------------------------------------------
; Duck Dodgers object
; -------------------
; UserWrd --> Timer for Sleep Frame changes
; UsrWrd2 --> Sleep Frame for nutty
; UsrWrd3 --> Ptr. to Nutty Delta List
; UsrWrd4 --> Timer for Nutty Deltas
; UsrWrd5 --> Direction for Nutty Sleep Frame changes (0=faster 1=slower)
; UsrWrd6 --> Old Scroll obj. (for use with nutty)
; SftCtrl --> Copy of SATCtrl (used by Nutty and "Think" pose)
;----------------------------------------------------------------------------
Init_DuckDodgers:
	php
	rep	#%00100000


2	lda	#DDStndR		; stand / face right
	jsl	Poke_Anim
	jmp	.90

; Get correct friction for current platform
.15
;	jsl	Get_Bottom_Coordinates
;	jsl	Get_Character_Info
;	lda	ObjType

	lda	Obj3CharType
	bit	#Stamp_Ice
	bne	.16
	lda	#Duck_StandFriction
	bra	.17
.16	lda	#Duck_IceStandFriction
.17	sta	ot3
	eor	#$ffff
	inc	a
	sta	ot4

; Apply friction for standing (looking up)
	lda	X_Delta,x
	beq	.70			; skip this if not moving
	bmi	.30			; branch if moving left

	cmp	ot3
	bcc	.60			; stop duck if moving too slow
	sec
	sbc	ot3			; Slow duck down
	sta	X_Delta,x
	bra	.70
.30	cmp	ot4
	bcs	.60
	clc
	adc	ot3
	sta	X_Delta,x
	bra	.70
.60	stz	X_Delta,x		; Stop duck from moving

; check to see if duck wants to crouch in a new direction
.70	lda	DDLeftCtrl
	beq	.80
	lda	SATCtrl,x
	bit	#Obj_XFlip		; Is duck facing left?
	bne	.90			; branch if he is...
	ora	#Obj_XFlip		; Face duck to the left
	sta	SATCtrl,x
	lda	#DDLookL		; Make duck look up / left
	jsl	Poke_Anim
	lda	#2			; keep in frame #2
	sta	Frame,x
	lda	#1
	jsl	Do_Anim			; update frame
	bra	.90

.80	lda	DDRightCtrl
	beq	.90
	lda	SATCtrl,x
	bit	#Obj_XFlip		; Is duck facing right?
	beq	.90			; branch if he is...
	and	#$ffff-Obj_XFlip	; Face duck to the right
	sta	SATCtrl,x
	lda	#DDLookR		; Make duck look up / right
	jsl	Poke_Anim
	lda	#2			; keep in frame #3
	sta	Frame,x
	lda	#1
	jsl	Do_Anim			; update frame

.90	rts
;----------------------------------------------------------------------------
Duck_ShootUp:
	jsl	Adjust_For_45		; Fix Y Coordinate if Duck is on 45
	beq	.1
	jmp	.90
.1	jsl	Check_For_Sides
	cmp	#2			; pain?
	bne	.2
	lda	#1			; 1 damage
	jsl	Hurt_DuckDodgers
	jmp	.90

.2	lda	DDShield
	bne	.3			; Don't check pain if DD has shield
	jsl	Get_Middle_Coordinates	; Check middle
	jsl	Get_Character_Info
	lda	ObjType
	bit	#Stamp_Pain
	beq	.3
	lda	#1			; 1 damage
	jsl	Hurt_DuckDodgers		; Hurt duck who crouches in pain!!
	jmp	.90

.3	jsr	Check_Evil_Collision
	beq	.4
	jmp	.90			; leave early if hurt/dead
.4	jsr	Check_For_Fall
	beq	.10
	jmp	.90			; leave if duck has fallen

; Get correct friction for current platform
.10
;	jsl	Get_Bottom_Coordinates
;	jsl	Get_Character_Info
;	lda	ObjType
	lda	Obj3CharType
	bit	#Stamp_Ice
	bne	.16
	lda	#Duck_StandFriction
	bra	.17
.16	lda	#Duck_IceStandFriction
.17	sta	ot3
	eor	#$ffff
	inc	a
	sta	ot4

; Apply friction for standing (shooting up)
	lda	X_Delta,x
	beq	.70			; skip this if not moving
	bmi	.30			; branch if moving left

	cmp	ot3
	bcc	.60			; stop duck if moving too slow
	sec
	sbc	ot3			; Slow duck down
	sta	X_Delta,x
	bra	.70
.30	cmp	ot4
	bcs	.60
	clc
	adc	ot3
	sta	X_Delta,x
	bra	.70
.60	stz	X_Delta,x		; Stop duck from moving

.70	lda	SlpTime,x
	cmp	#1			; End of frame?
	bne	.90			; branch if not..
	lda	SATCtrl,x
	bit	#Obj_XFlip		; which way is duck facing?
	beq	.80			; branch if facing right
	lda	#DDLookL		; Make duck look up / left
	bra	.85
.80	lda	#DDLookR		; Make duck look up / right
.85	jsl	Poke_A


kPGrowY:
	dw	$8000,$8000,$8000,$8000
;----------------------------------------------------------------------------
MrtGun0	dw	$0001,$ffff,MG0PAT,$0000,$0000,$0000
	dw	$0000,$0000,$0000,$0000,$0000,$ffff
MG0PAT