protocrystal

Safari Zone

The Safari Zone from Gen 1 was going to be included, but was left out of the final game, possibly due to time constraints.

The final ROM has pretty much Safari Zone content left, including an incomplete map in maps/SafariZoneBeta.asm and maps/SafariZoneBeta.blk. However, even in the original code, some functions remaing missing or unreferenced. For instance, esa_ishi_chk in FIGHT.DMG (Unreferenced_HandleSafariAngerEatingStatus in engine/battle/core.asm) is not called anywhere.

Some unidentified labels in pokecrystal have to do with the Safari Zone.

Disasm Name Original Name Disasm File Original File Details
BATTLETYPE_DEBUG DEMO_SAFARI constants/battle_constants.asm DEMO_F.DEF
Unreferenced_Function24b8f SafariCounterWindow engine/menus/menu_2.asm WINDOW.DMG

This partly commented code in C_EVENT.DMG (corresponding to CountStep in engine/overworld/events.asm) would have called the Safari Game step handler.


step_count_check:
	ld	a,(tuushin_flg)			;
	and	a				; 通信中はフックする
	jr	nz,no_event$			;


;	extern	SafariStepCheck
;	BCALL	G_BANK04,SafariStepCheck
;	jr	c,set$

This partly removed code in EV_CHECK.DMG (starting at RandomEncounter.ok in engine/overworld/events.asm) would have allowed Safari Game encounters.


set_fight$:
;	chkbit	SAFARI_MODE_BIT,scenario_status
;	jr	nz,set_safari$


set_normal$:
	ld	a,<nowbank
	ld	hl,fight_wild_event
	jr	SetEncountEvent

  ifn	0
	extern	SafariEvBank
	extern	SafariEncountEvent
set_safari$:
	ld	a,<SafariEvBank
	ld	hl,SafariEncountEvent
	jr	SetEncountEvent
  endif

This partly commented code in PERSONAL.DMG (starting at StartMenu.DrawBugContestStatus in engine/menus/start_menu.asm) would have shown the Safari Zone step and Ball counter.


;-------------------------------------------------
; 特殊な状況でのサブウィンドウ表示
;-------------------------------------------------
SpSubWindow:
	chkbit	MUSHITORI_MODE_BIT,scenario_status
	ret	z

	extern	ParkCounterWinFrame			; 99/08/29 by tama
	BCALL	G_BANK09,ParkCounterWinFrame
	ret

SpSubWindowContent:
;	chkbit	SAFARI_MODE_BIT,scenario_status
;	jr	nz,safari_cnt$

	chkbit	MUSHITORI_MODE_BIT,scenario_status
	jr	nz,park_cnt$

	ret

;safari_cnt$:
;	extern	SafariCounterWindow
;	BCALL	G_BANK09,SafariCounterWindow
;	ret

park_cnt$:
	extern	ParkCounterWindow
	BCALL	G_BANK09,ParkCounterWindow
	ret

This dummied-out code in ELEVATOR.DMG (after everything in engine/events/elevator.asm) would have implemented some aspects of the Safari Game. (The comment "※サファリゾーンはなくなる!" means "* The Safari Zone will disappear!")


	extern	SetEventDirect
;	extern	muspinpon


  ifn	0

		; ※サファリゾーンはなくなる!
		; 	by tama,99/05/26

;=======================================================================;
;
; サファリ関連ルーチン
;
;=======================================================================;

	public	SafariModeSet
	public	SafariStepCheck
	public	SafariEncountEvent
	public	SafariEvBank
SafariEvBank	equ	nowbank

;-----------------------------------------------------------------------
; サファリ内でのステップカウント
;-----------------------------------------------------------------------

SafariStepCheck:
  ifn	1
	xor	a
	ret

  endif
  

	chkbit	SAFARI_MODE_BIT,scenario_status
	jr	z,not$

	ld	hl,SafariStepCount + 1
	dec	(hl)
	jr	nz,not$
	dec	hl
	ld	a,(hl)
	and	a
	jr	z,count_stop$
	dec	(hl)
	
not$:
	xor	a
	ret

count_stop$:
;	ld	hl,exit_work + 3
;	ld	de,setmap_work + 0
;	ld	bc,3
;	call	block_move

	ld	a,nowbank
	ld	hl,SafariTimerEndEvent
	call	SetEventDirect
	ret



;-----------------------------------------------------------------------
; サファリ終了時のスクリプト
;-----------------------------------------------------------------------

SafariTimerEndEvent:
	db	E_SE
	dw	muspinpon

	db	MSG_MODE_START

	db	E_MSG
	dw	SafariTimerEndMessage

	db	E_JUMP
	dw	SafariEndSameEvent

SafariBallEndEvent:
	db	E_SE
	dw	muspinpon

	db	MSG_MODE_START

	db	E_MSG
	dw	SafariBallEndMessage


SafariEndSameEvent:
	db	E_AB_BTN_WAIT

	db	MSG_MODE_END

;	db	E_CHG_MAP
;	db	<set_after_entrance

	db	E_RESET_SYS_FLAG
	dw	EvBit_Safari

	db	E_END

SafariTimerEndMessage:
	db	D_MSG
	db	a__,na__,u__,n__,su__,kako2@
	db	pi__,n__,po__,bou@,n__,gyoe@
	db	normal@
	db	zi_,ka_,n_,ga_,spc@,ki_,ma_,si_,ta_,gyoe@
	db	EOMeom

SafariBallEndMessage:
	db	D_MSG
	db	a__,na__,u__,n__,su__,kako2@
	db	sa__,hu__,aa__,ri__,spc@,ge__,bou@,mu__
	db	home@
	db	o_,wa_,ri_,spc@,de_,bou@,su_,gyoe@
	db	EOMeom









;-----------------------------------------------------------------------
; サファリモードのスタート
;-----------------------------------------------------------------------

	public	TestSafariStart
TestSafariStart:
	ld	b,030
	ld	de,0025
	call	SafariModeSet

	ret



SafariModeSet:
	ld	a,b
	ld	(SafariBallCount),a
	ld	a,d
	ld	(SafariStepCount),a
	ld	a,e
	ld	(SafariStepCount + 1),a

	setbit	SAFARI_MODE_BIT,scenario_status

	ret


;-----------------------------------------------------------------------
; サファリ内でのエンカウント時のスクリプト
;-----------------------------------------------------------------------

SafariEncountEvent:
	db	E_SET_SYS_DATA
	db	EvValue_FIGHT_MODE
	db	DEMO_SAFARI		; Safari Mode

	db	E_ENCOUNT_FIGHT		;990802 by tama
	db	E_GO_FIGHT
	db	E_RECOVER_MAP_DATA

	db	E_GET_DATA
	dw	SafariBallCount

	db	IF_ZERO_JUMP
	dw	SafariBallEndEvent

	db	E_END


  endif