Re: A85: What am I doing wrong?
[Prev][Next][Index][Thread]
Re: A85: What am I doing wrong?
In a message dated 6/16/99 1:48:18 PM MDT, evil_sam@hotmail.com writes:
> 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?
I don't know if someone's already answered this (and i'm too lazy to check
;). But I do see a problem in the code below...
>
> 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
Here...I don't think you can do more than one relocation in a row, which is
probably your problem. It would be a lot smaller if you just put in the
relative addresses, then in the routine add the program's address to it
(because relocation tacks on an extra byte).
> .db 10,32,32
>
> .dw &overw+47
> .dw &houseA
> .db 5,32,32
>
>
> Thanks for any help,
> Sam
Hope that helped...I half expect to see someone else's reply as I'm sifting
through my mail (I've just gotten back from a vacation) ;) Anyway, there you
go.
JL
Macross Software