
DRAWAT	equ	50FDh	;Where to draw the room number
ATTRAT	equ	9AFDh	;Where to put its attributes
ATTR	equ	44h	;Attributes to draw the room number in
SHEET	equ	8420h	;Room number
FRAMES	equ	85CBh	;JSW frame counter
PR_STR	equ	9680h	;JSW print string

        org     840Ch   ;Bypass colour card
        jp      87CAh

	org	8A46h
	call	showrm	;New show-room-number code
;
; The actual intercept code. This can go anywhere in memory.
;
	org	97C3h
msg:	defb	'000'

showrm:	call	PR_STR	;This is the line that was at 8A46h
	ld	a,(SHEET)
	ld	c,'0'
	ld	ix,msg
showrm0:
	sub	100
	jr	c,showrm1
	inc	c
	jr	showrm0

showrm1: add	a,100
	ld	(ix+0),c
	ld	c,'0'
showrm2:
	sub	10
	jr	c,showrm3
	inc	c
	jr	showrm2
;
showrm3:
	add	a,'0' + 10
	ld	(ix+1),c
	ld	(ix+2),a
	ld	c,3
	ld	de,DRAWAT
	jp	pr_str

	org	ATTRAT
	defb	ATTR,ATTR,ATTR

	end

