

			       ۲
				      
			     ۰ ۰    
			         ۰      
			       ۰      
			     ۰  ۰       
				      
			      ۲


			XC - 1701 ][ (C) 1997/98 by
			     Icarus Productions
			 http://icarus.ganymed.org
				Version 1.0

			    LEVEL FILE DESCRIPTION

a) Basics:
~~~~~~~~~~
A XC-1701 II level file is composed of two parts: the main level file,
containing the number of stages, intro & ending and various other information.
It includes the stages itself. It is suggested that you have a main ASM
file, where you include the stages as H files. An example is shown below.

b) Main level file:
~~~~~~~~~~~~~~~~~~~
 2 bytes	- header: .db 7,0 for compressed stages, 7,1 for uncompressed
 1 byte		- number of stages+1
 x bytes	- ASCIIZ string containing the title
 x bytes	- ASCIIZ string containing the author
 9 bytes	- ASCIIZ string containing hiscore name
 2 bytes	- hiscore
 4 bytes	- reserved for latter updates
 2 bytes	- pointer to intro code
 2 bytes	- pointer to ending code
--> stages
--> intro code
--> ending code

c) Stage file:
~~~~~~~~~~~~~~
 1 byte		- length of level (in lines)
 x bytes	- ASCIIZ string: level title
 1 byte		- background image number
 1 byte		- 0 = attackwaves disabled, otherwise enabled
 1 byte		- possible boss (0 = none, 1-4 = boss no.)
 1 byte		- speed code:
			$9E - fastest
			$A6, $AE, $B6
			$Be - slowest
		  don't use any other values!
--> stage definition:
 .db $00,$00,$00,$00 <- 8 columns of enemy data (each hex digit = one enemy)

Hex digit	Enemy
-----------------------------
 0		none
 1              'chaser' (comes from behind and flies circles)
 2		'offender' (comes from front)
 3		'glider' (flies forward in your line)
 4		'waiter' (flies left&right until in your line)
 5		'waiter 2' (flies up&down until in your line)
 6		'slalom' (flies from right to left, down, then opposite)
 7		'galaxian' (normal galaxian enemy, only works in attack wave mode!)
 8		'normal glider' (flies straight-forward)
 9		'asteroid'
 A		'fast slalom' (flies sinewaves downwards)
 B		'finder' (waits, and then chases you)
 C		'circle' (flies circles which get smaller)
 D		'slalom backwards' (flies fast sinewaves from bottom to top)
 E		'vertical slalom'

d) Example: XCLEVEL.ASM
~~~~~~~~~~~~~~~~~~~~~~~

;Standard XC levels, header file:
#include "usgard.h"

.org 0

.db     7,0
.db     8                       ;number of levels
.db	"Sunsystem 21XX",0      ;title
.db     "N.Haines / A.Ess",0	;author
.db	"--------",0		;hi score name (9 bytes)
.dw	10			;hi score
.dw	0,0			;reserved
;Pointer to intro code:
.dw	IntroCode_
;Pointer to ending code:
.dw	IntroCode_+2+IntroEnd-IntroCode

;include binary stages (compressed)
#incbin "xclevel.lc"
;--> if uncompressed stages, just do #include "level1.h", etc.

IntroCode_:
.dw     IntroEnd-IntroCode
.org $8641
IntroCode:
	ld	HL, IntroText_0
	call	DispText
	ld	HL, IntroText_1
	call	DispText
	ld	HL, IntroText_2
	call	DispText

	ld	A, (CONTRAST)
	out	(2), A
	ret

DispText:
	sub	A
	out	(2), A
	push	HL
	call	CLEARLCD
	ld	(CURSOR_ROW), DE
	pop	HL
	call	D_ZT_STR
	ld	A, (CONTRAST)
	ld	C, A
	sub	A
FadeLoop:
	cp	C
	jr	z, Fade_End
	inc	A
	out	(2), A
	call	Delay
	jr	FadeLoop
Fade_End:
	halt
	call	GET_KEY
	cp	K_EXIT
	jr	z, Exit_D
	cp	5
	jr	c, Fade_End
	ld	A, (CONTRAST)
Fade_Out:
	and	A
	ret	z
	dec	A
	out	(2), A
	call	Delay
	jr	Fade_Out
Exit_D:
	pop	HL
	ld	A, (CONTRAST)
	out	(2), A
	ret

Delay:
	ld	B, 20
Wait:
	halt
	djnz	Wait
	ret

IntroText_0:
     ;012345678901234567890
 .db "Remember the end of  "
 .db "XC1701? You were able"
 .db "to cut down the evil "
 .db "supermans...",0
IntroText_1:
 .db "Nevertheless, you got"
 .db "arrested on Pluto.   "
 .db "You seem to have no  "
 .db "possibilty to escape "
 .db "and help the humans.",0
IntroText_2:
 .db "But one day you can  "
 .db "gather a ship and try"
 .db "your escape.         "
 .db "CAN YOU REACH EARTH? "
 .db "  -icarus.ganymed.org",0
IntroEnd:

.dw     EndingEnd-EndingCode
.org $8641
EndingCode:
	call	CLEARLCD
	ld	(CURSOR_ROW), DE
	ld	HL, EndingText
	call	D_ZT_STR
	call	OTH_PAUSE
	call	CLEARLCD
	ret
EndingText:
     ;012345678901234567890
 .db "...",0
EndingEnd:

.end
