Gameboy Development Forum

Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)

You are not logged in.

Ads

#1 2021-09-07 05:00:41

EmptyBarrel
New member
Registered: 2021-09-07
Posts: 2

?ASlink-Warning-Byte PCR relocation error for symbol .set_tile_xy

So, I was getting this warning when trying to compile my code.
I am using GBDK 2020 and everything worked out fine so far, until I tried to implement background collision detection.
First i would like to show the whole warning and what caused it and then try to explain what i was trying to achieve:

?ASlink-Warning-Undefined Global '.set_tile_xy' referenced by module ''

?ASlink-Warning-Byte PCR relocation error for symbol  .set_tile_xy
                file                    module            area                    offset
  Refby     <missing>                                _CODE                00001B
  Defin      c:\gbdk\lib/sm    Runtime           .  .ABS.               000000

so that's the error and it appears when I try to call the function "uint8_t get_bkg_tile_xy(uint8_t x, uint8_t y)" that returns the index of a background tile at the position (x,y)

I thought I could use this for background collision detection on a big map where i would return the indices of neighbouring background tiles where my character is at, because only the background scrolls, while the characters position is static. So i could make out Tiles that would stop the character to move.

I am new to gameboy developement and especially GBDK, so maybe that warning is caused by some offset,  as it is saying above, but I really don't know how to fix this,
and attempts to avoid this error by implementing different ways for background collision detection would sacrifice the freedom of movement of the character

Thanks in advance

Offline

 

#2 2021-09-07 08:29:36

toxa
Member
Registered: 2020-02-13
Posts: 309

Re: ?ASlink-Warning-Byte PCR relocation error for symbol .set_tile_xy

Yes, that is a known problem, and was recently fixed. Download the “nightly” build artifacts from the github under the “actions” link. You should be logged onto the github.

Offline

 

#3 2021-09-07 08:37:06

toxa
Member
Registered: 2020-02-13
Posts: 309

Re: ?ASlink-Warning-Byte PCR relocation error for symbol .set_tile_xy

Also i suggest not to read VRAM, it is slow.

Offline

 

#4 2021-09-07 11:46:58

EmptyBarrel
New member
Registered: 2021-09-07
Posts: 2

Re: ?ASlink-Warning-Byte PCR relocation error for symbol .set_tile_xy

Thank you very much for the reply.
I will take the advice and look for a way where I dont read from VRAM

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson