A85: What am I doing wrong?


[Prev][Next][Index][Thread]

A85: What am I doing wrong?




  I can't seem to figure out why this relatively simple routine refuses to 
run on the 85 (it runs fine on the 82/83/86). Can someone on this list help? 
The data in (temp) is fine, but the data extracted from the table is always 
incorrect.


Here is the basic routine:

Search_For_Door:
ld hl,&door_table   ;Table of door locations ;)

dt_loop:
xor a
ld a,(hl)
or a
jr z,none_detected   ;0 = End of list
ld e,a
inc hl
ld d,(hl)    ;Loads HL -> DE, the long way

push hl
ld hl,(temp)
call CP_HL_DE  ; If player location and door location are equal, then
                ; enter a new room
jr z,new_room
pop hl
inc hl
ld de,6          ;If not, skip this entry
add hl,de
jr dt_loop  ;loop


temp = TEXT_MEM ; Temporary storage for player's location

door_table:
; .dw <door locat>,<new map start>
; .db <new cols>,<new X>,<new Y>
.dw &overw+37    ;over world map
.dw &dualhouseA
.db 10,32,32

.dw &overw+47
.dw &houseA
.db 5,32,32


  Thanks for any help,
     Sam


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com


Follow-Ups: