SPIELASM;
; ********************************
; *..............................*
; *.begonnen:....Olb,.4.8.1990...*
; *.beendet.:....................*
; *..............................*
; *.....f.i.r.s.t..g.a.m.e.......*
; *..............................*
; *.Holger.Reither...............*
; *.Tempelweg.25.......I.......I.*
; *.Olbernhau..........I.OMEGA.I.*
; *.9.3.3.0............I.......I.*
; *..............................*
; ********************************
;
;
PV1	EQU	0F003H
;
WINNR	EQU	0B798H
WINON	EQU	0B79CH
WINLG	EQU	0B79EH
CURSO	EQU	0B7A0H
STBT	EQU	0B7A2H
COLOR	EQU	0B7A3H
HOR	EQU	0B7D3H
VERT	EQU	0B7D5H
FARB	EQU	0B7D6H
;
FHCUR	EQU	06000H 	;F'hinter'Cur.
FCURS	EQU	FHCUR+1	 ;FCURSO-Adr.
FOVO	EQU	FCURS+2	 ;ueberlauf o
FOVU	EQU	FOVO+1	 ;    "	    u
FOVL	EQU	FOVU+1	 ;    "	    l
FOVR	EQU	FOVL+1	 ;    "     r
;
 	ORG	FOVR+1
;
;TEST UP
	DEFB	0
	DEFW	7F7FH
	DEFM	'TEST'
	DEFB	01
	CALL	CLSS
	CALL	FENST
	CALL	FRES
	LD	DE,(FCURS)
	CALL	FCUR
	CALL	FSET
	LD	DE,(FCURS)
	CALL	FCUR
	CALL	FSET
TES1	LD	A,(IX+13)
	LD	DE,(FCURS)
	CP	8
	JR	NZ,TES2
	CALL	FCUL
	CALL	FSET
	JR	TES1
TES2	CP	9
	JR	NZ,TES3
	CALL	FCUR
	CALL	FSET
	JR	TES1
TES3	CP	0AH
	JR	NZ,TES4
	CALL	FCUU
	CALL	FSET
	JR	TES1
TES4	CP	0BH
	JR	NZ,TES5
	CALL	FCUO
	CALL	FSET
	JR	TES1
TES5	CP	41H
	JR	NZ,TES6
	CALL	HIR
	JR	TES1
TES6	CP	47H
	JR	NZ,TES7
	CALL	HIL
	JR	TES1
TES7	CP	45H
	JR	NZ,TES8
	CALL	HIU
	JR	TES1
TES8	CP	58H
	JR  	NZ,TES9
	CALL	HIO
	JR	TES1
TES9	CP	57H
	JR	NZ,TES10
	CALL	HIUR
	JR	TES1
TES10	CP	52H
	JR	NZ,TES11
	CALL	HIUL
	JR	TES1
TES11	CP	59H
	JR 	NZ,TES12
	CALL  	HIOR
	JR	TES1
TES12	CP	43H
	JR	NZ,TES13
	CALL	HIOL
	JR	TES1
TES13	CP	3
	RET	Z
	JP	TES1
TEST	RET
;
; *******************************
;
; CLS-SP
CLSS	LD	A,7FH
	LD      HL,0B6FFH
CLS1	LD	(HL),0
	DEC	HL
	CP	H
	JR 	NZ,CLS1
	RET
;
; COLORLINE
; -Reg B-Laenge
; -Reg C-Farbe
; -Reg HL-Anfang
; -Reg DE-Winkel
CLINE	PUSH 	BC
	PUSH	HL
CLIN	LD	(HL),C
	ADD	HL,DE
	DJNZ	CLIN
	POP	HL
	POP	BC
	RET
;
; FENSTER
FENST	LD	C,9	;Farbe
	LD	HL,0A903H
	LD	DE,01
	LD	B,1CH
	CALL	CLINE
	LD	HL,0A923H
	CALL	CLINE
	LD	HL,0AD03H
	CALL	CLINE
	LD	HL,0AD23H
	CALL	CLINE
	LD	DE,20H
	LD	B,1EH
	LD	HL,0A943H
	CALL	CLINE
	LD	HL,0A95EH
	CALL	CLINE
;
	LD	A,30H
	LD	(COLOR),A
	LD	L,4
	LD	H,5
	LD	(WINON),HL
	LD	L,26
	LD	H,15
	LD	(WINLG),HL
	LD	A,0CH
	CALL	PV1
	DEFB	00H
;
	CALL	HIM
;
	RET
;
; Himmel
HIM	LD	A,94H
	EX	AF,AF'
	LD	A,1
	EX	AF,AF'
	LD	DE,0E000H
	LD	HL,8400H
	LD	B,0
HI	EX	DE,HL
	LD	C,(HL)
	EX	DE,HL
	ADD	HL,BC
	EX	AF,AF'
	RLC	A
	RLC	A
	RLC	A
	LD	(HL),A
	EX	AF,AF'
	INC	DE
	CP	H
	JR	NZ,HI
	RET
;
; Himmel nach links
HIL	LD	A,(8400H)
	PUSH	AF
	LD	DE,8400H
	LD	HL,8401H
	LD	BC,1100H
	LDIR
	POP	AF
	LD	(94FFH),A
	RET
;
; Himmel nach rechts
HIR	LD	A,(94FFH)
	PUSH	AF
	LD	DE,94FFH
	LD	HL,94FEH
	LD	BC,1100H
	LDDR
	POP	AF
	LD	(8400H),A
	RET
;
; Himmel nach oben
HIO	LD	DE,8300H
	LD	HL,8400H
	LD	BC,1100H
	LDIR
	LD	HL,8300H
	LD	DE,9400H
	LD	BC,100H
	LDIR
	RET
;
; Himmel nach unten
HIU	LD	DE,95FFH
	LD	HL,94FFH
	LD	BC,1100H
	LDDR
	LD	DE,8500H
	LD	HL,9400H
	LD	BC,100H
	LDDR
	RET
;
; Himmel nach oben links
HIOL	LD	DE,82FFH
	LD	HL,8400H
	LD	BC,1100H
	LDIR
	LD	HL,82FFH
	LD	DE,93FFH
	LD	BC,101H
	LDIR
	RET
;
; Himmel nach oben rechts
HIOR	LD	DE,8301H
	LD	HL,8400H
	LD	BC,1100H
	LDIR
	LD	HL,8301H
	LD	DE,9401H
	LD	BC,100H
	LDIR
	RET
;
; Himmel nach unten links
HIUL	LD	DE,95FEH
	LD	HL,94FFH
	LD	BC,1100H
	LDDR
	LD	DE,84FEH
  	LD	HL,95FFH
	LD	BC,100H
	LDDR
	RET
;
; Himmel nach unten rechts
HIUR	LD	HL,94FFH
	LD	DE,9600H
	LD	BC,1100H
	LDDR
	LD	HL,9600H
	LD	DE,8500H
	LD	BC,101H
	LDDR
	RET
;
; Farbcursor in Ausgangsstellung
FRES	XOR	A
	LD	(FOVO),A
	LD	(FOVU),A
	LD	(FOVL),A
	LD	(FOVR),A
	LD	HL,0AB10H
	LD	(FCURS),HL
	LD	(HL),36H
	LD	A,30H
	LD	(FHCUR),A
	RET
;
; Farbcursor umsetzen
; -neue Poss. in DE
FSET	LD	A,(FHCUR)
	LD	BC,(FCURS)
	LD	(BC),A
	LD	A,(DE)
	LD	(FHCUR),A
	LD	A,36H
	LD	(DE),A
	LD	(FCURS),DE
	RET
;
; Berechnung FCURS (nur in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