Compucolor.org – Virtual Media

Listing of file='MAZEG2.SRC;01' on disk='vmedia/mazes_2-sector.ccvf'

;MAZEP2 - V2A.1      7/18/81	GREG ALLEN

;THIS ROUTINE SETS UP AND PRINTS THE WALLS OF THE MAZE.
;THIS VERSION DIFFERS FROM THE OTHERS BECAUSE IT USES THE
;I CAN'T GET THE BLIND CURSOR MODE TO WORK
;WRITE VERTICAL OPTION.

FIXROLL		EQU	3A85H
BASOUT		EQU	33H
OUTSTRING	EQU	33F4H
DIVDEBYHL	EQU	3581H

DEPTH		EQU	96FFH

CLEARSCREEN	EQU	12

		ORG	8A00H
FIXMEMORY:	;A = CHARCTER TO INSERT
		;B = # OF ITERATIONS
		;HL -> THE FIRST BYTE

		PUSH	PSW
		PUSH	B
		PUSH	H

FIXLOOP:	MOV	M,A
		INX	H
		DCR	B
		JNZ	FIXLOOP

		POP	H
		POP	B
		POP	PSW
		RET

		ORG	8A1DH
FIXWALLS:	;FILL TH STORAGE AREAS OF THE VARIOUS WALLS
		;WITH THE CORRECT CHARACTERS.

TOPCHAR		EQU	101
BOTTOMCHAR	EQU	127
WESTCHAR	EQU	98
EASTCHAR	EQU	97

		PUSH	PSW
		PUSH	B
		PUSH	H

		;FIX C1D1W
		MVI	B,34
		MVI	A,TOPCHAR
		LXI	H,C1TOPBORDER
		CALL	FIXMEMORY
		MVI	A,BOTTOMCHAR
		LXI	H,C1BOTBORDER
		CALL	FIXMEMORY
		MVI	B,17
		MVI	A,WESTCHAR
		LXI	H,C1LFTBORDER
		CALL	FIXMEMORY
		MVI	A,EASTCHAR
		LXI	H,C1RITBORDER
		CALL	FIXMEMORY

		;FIX C1D2W
		MVI	B,14
		MVI	A,TOPCHAR
		LXI	H,C1D2TBORDER
		CALL	FIXMEMORY
		MVI	A,BOTTOMCHAR
		LXI	H,C1D2BBORDER
		CALL	FIXMEMORY
		MVI	B,7
		MVI	A,WESTCHAR
		LXI	H,C1D2LBORDER
		CALL	FIXMEMORY
		MVI	A,EASTCHAR
		LXI	H,C1D2RBORDER
		CALL	FIXMEMORY

		;FIX L1D1W
		MVI	B,17
		MVI	A,WESTCHAR
		LXI	H,L1D1WALL
		CALL	FIXMEMORY
		;FIX L1D2 WHILE I AM AT IT
		LXI	H,L1D2WALL
		CALL	FIXMEMORY
		;FIX R1D1W
		MVI	A,EASTCHAR
		LXI	H,R1D1WALL
		CALL	FIXMEMORY
		;FIX R1D2W
		LXI	H,R1D2WALL
		CALL	FIXMEMORY

		;FIX R2D1W
		MVI	B,15
		LXI	H,R2D1WALL
		CALL	FIXMEMORY

		;FIX L2D1W
		MVI	A,WESTCHAR
		LXI	H,L2D1WALL
		CALL	FIXMEMORY

		POP	H
		POP	B
		POP	PSW
		RET

		ORG	8AA2H
PRINTWALL:	PUSH	PSW
		PUSH	D
		PUSH	H

		MOV	D,A
		MVI	A,30
		CALL	BASOUT
		MOV	A,D

		RLC
		RLC
		LXI	H,DEPTH
		ADD	M
		DCR	A	;ACC = DEPTH - 1
		RLC
		LXI	H,WALLBT
		ADD	L
		MOV	L,A
		MVI	A,0
		ADC	H
		MOV	H,A

		MOV	E,M
		INX	H
		MOV	D,M
		XCHG
		CALL	OUTSTRING
		XRA	A
		CALL	FIXROLL

		POP	H
		POP	D
		POP	PSW
		RET

WALLBT:		DW	C1D1W
		DW	C1D2W
		DW	C1D3W
		DW	0
		DW	L1D1W
		DW	L1D2W
		DW	L1D3W
		DW	0
		DW	L2D1W
		DW	L2D2W
		DW	L2D3W
		DW	0
		DW	R1D1W
		DW	R1D2W
		DW	R1D3W
		DW	0
		DW	R2D1W
		DW	R2D2W
		DW	R2D3W

C1D1W:		DB	3,5,2
C1TOPBORDER:	DS	34
		DB	3,5,18
C1BOTBORDER:	DS	34
		DB	27,10
		DB	3,4,2
C1LFTBORDER:	DS	17
		DB	3,39,2
C1RITBORDER:	DS	17
		DB	239

C1D2W:		DB	3,15,7
C1D2TBORDER:	DS	14
		DB	3,15,13
C1D2BBORDER:	DS	14
		DB	27,10
		DB	3,14,7
C1D2LBORDER:	DS	7
		DB	3,29,7
C1D2RBORDER:	DS	7
		DB	239

C1D3W:		DB	3,19,9,101,101,101,101,101,101
		DB	3,19,11,127,127,127,127,127,127
		DB	27,10
		DB	3,18,9,98,98,98
		DB	3,25,9,97,97,97
		DB	239

L1D1W:		DB	3,1,0,102,103,10,102,103
		DB	3,1,20,105,104,28,105,104
		DB	27,10
		DB	3,4,2
L1D1WALL:	DS	17
		DB	239

L1D2W:		DB	3,5,2
		DB	102,103,10,102,103,10,102,103,10
		DB	102,103,10,102,103
		DB	3,5,18
		DB	105,104,28,105,104,28,105,104,28
		DB	105,104,28,105,104,28
		DB	27,10
		DB	3,14,7,98,98,98,98,98,98,98
		DB	3,4,2
L1D2WALL:	DS	17
		DB	239

L1D3W:		DB	3,15,7,102,103,10,102,103
		DB	3,15,13,105,104,28,105,104
		DB	27,10
		DB	3,14,7,98,98,98,98,98,98,98
		DB	3,18,9,98,98,98
		DB	239

L2D1W:		DB	3,1,2,101,101,101
		DB	3,1,18,127,127,127
		DB	27,10
		DB	3,4,2,111
L2D1WALL:	DS	15
		DB	109
		DB	239

L2D2W:		DB	3,5,7
		DB	101,101,101,101,101,101,101,101,101
		DB	3,5,13
		DB	127,127,127,127,127,127,127,127,127
		DB	27,10
		DB	3,14,7,111,98,98,98,98,98,109
		DB	239

L2D3W:		DB	3,15,9,101,101,101
		DB	3,15,11,127,127,127
		DB	27,10
		DB	3,18,9,111,98,109
		DB	239

R1D1W:		DB	3,39,1,105,104,28,105,104
		DB	3,39,19,102,103,10,102,103
		DB	27,10
		DB	3,39,2
R1D1WALL:	DS	17
		DB	239

R1D2W:		DB	3,29,6
		DB	105,104,28,105,104,28,105,104,28
		DB	105,104,28,105,104
		DB	3,29,14,102,103,10,102,103,10
		DB	102,103,10,102,103,10,102,103
		DB	27,10
		DB	3,29,7,97,97,97,97,97,97,97
		DB	3,39,2
R1D2WALL:	DS	17
		DB	239

R1D3W:		DB	3,25,8,105,104,28,105,104
		DB	3,25,12,102,103,10,102,103
		DB	27,10
		DB	3,29,7,97,97,97,97,97,97,97
		DB	3,25,9,97,97,97
		DB	239

R2D1W:		DB	3,40,2,101,101,101
		DB	3,40,18,127,127,127
		DB	27,10
		DB	3,39,2,110
R2D1WALL:	DS	15
		DB	108
		DB	239

R2D2W:		DB	3,30,7,101,101,101,101
		DB	101,101,101,101,101
		DB	3,30,13,127,127,127,127
		DB	127,127,127,127,127
		DB	27,10
		DB	3,29,7,110,97,97,97,97,97,108
		DB	239

R2D3W:		DB	3,26,9,101,101,101
		DB	3,26,11,127,127,127
		DB	27,10
		DB	3,25,9,110,97,108
		DB	239

		END