I got Mappy working by adding the following functions to MappyLibraryDBPRO_V010.DBA.
Function Mappy_PeekDataBlock_Byte(ThisTile,Offset,mult)
Bank = Mappy_BlockStructuresBankNumb(1)
Address=(ThisTile*mult)+Offset
result=VB_Peek(Bank,Address)
EndFunction result
Function Mappy_PeekDataBlock_INT(ThisTile,Offset)
Bank = Mappy_BlockStructuresBankNumb(1)
Address = (ThisTile*32)+Offset
result = VB_Leek(Bank,Address)
EndFunction result
` *=---------------------------------------------------------------------=*
` >> Mappy Read Tile Layer <<
` *=---------------------------------------------------------------------=*
`
` This simple function lets you read a Tile from any layer your wish.
`
` Inputs:
`
` LAYER = The Map Layer you wish to access
` TileMapX = The X coord of the tile
` TileMapY = The Y coord of the tile
`
` returns
`
` Tile = returns the tile structure index number.
`
` *=---------------------------------------------------------------------=*
Function Mappy_Read_Tile_Layer(Layer,TileMapx,TileMapy)
Tile=-1
TileMapBank=Mappy_TileMapLayers_BankNumb(Layer)
` Check to see if this layer exists
If TileMapBank>-1
MapWidth=Mappy_MapWidth(1)
if TileMapX>-1 and TileMapX<MapWidth
MapHeight=Mappy_MapHeight(1)
if TileMapY>-1 and TileMapY<MapHeight
TileAddress=(TileMapY*MapWidth)+TileMapX+VB_Get_Bank_BaseAddress(TileMapBank)
Tile=VB_DataCache(TileAddress)
endif
endif
endif
EndFunction tile
`***This function changes a tile on the map. NewTile=the tile number you want to insert in location TileMapx, TileMapy.
Function Mappy_PlaceTile(Layer,TileMapx,TileMapy,NewTile,StartAddress)
Tile=-1
TileMapBank=Mappy_TileMapLayers_BankNumb(Layer)
` Check to see if this layer exists
If TileMapBank>-1
MapWidth=Mappy_MapWidth(1)
if TileMapX>-1 and TileMapX<MapWidth
MapHeight=Mappy_MapHeight(1)
if TileMapY>-1 and TileMapY<MapHeight
`get address of tile
TileAddress=(TileMapY*MapWidth)+TileMapX+VB_Get_Bank_BaseAddress(TileMapBank)
`get number of tile
Tile=VB_DataCache(TileAddress)
set cursor 0,60
ink rgb(255,255,255),0
newloc = (TileAddress-StartAddress)*4
print str$(TileAddress)+", "+str$(newloc)
`place a new tile number at the address gotten above
VB_Loke(TileMapBank, newloc, NewTile)
endif
endif
endif
EndFunction tile
`returns TileAddress
Function Mappy_GetStartingAddress(Layer)
TileMapX=0
TileMapY=0
Tile=-1
TileMapBank=Mappy_TileMapLayers_BankNumb(Layer)
` Check to see if this layer exists
If TileMapBank>-1
MapWidth=Mappy_MapWidth(1)
if TileMapX>-1 and TileMapX<MapWidth
MapHeight=Mappy_MapHeight(1)
if TileMapY>-1 and TileMapY<MapHeight
TileAddress=(TileMapY*MapWidth)+TileMapX+VB_Get_Bank_BaseAddress(TileMapBank)
endif
endif
endif
EndFunction TileAddress
Here is how I checked the Block Information for a given tile:
User1 = Mappy_PeekDataBlock_BYTE(CheckTileNumber1,16,mult)`u1 unsigned long int |Thats all of em
User2 = Mappy_PeekDataBlock_BYTE(CheckTileNumber1,20,mult)`u2 unsigned long int | 4 per var
User3 = Mappy_PeekDataBlock_BYTE(CheckTileNumber1,24,mult)`u3 unsigned short int |Thats all of em
User4 = Mappy_PeekDataBlock_BYTE(CheckTileNumber1,26,mult)`u4 unsigned short int | 2 per var
User5 = Mappy_PeekDataBlock_BYTE(CheckTileNumber1,28,mult)`u5 unsigned char |
User6 = Mappy_PeekDataBlock_BYTE(CheckTileNumber1,29,mult)`u6 unsigned char |Thats all of em
User7 = Mappy_PeekDataBlock_BYTE(CheckTileNumber1,30,mult)`u7 unsigned char | 1 per var
bg = Mappy_PeekDataBlock_BYTE(CheckTileNumber1,7,mult) `bg offset long int - equals 0 unless there is a tile in fg1, fg2, or fg3. If so, then it returns fg1's tle number
fg1 = Mappy_PeekDataBlock_BYTE(CheckTileNumber1,11,mult)` fg1 offset long int = returns fg2's tle number
fg2 = Mappy_PeekDataBlock_BYTE(CheckTileNumber1,15,mult)` fg2 offset long int = returns fg3's tle number
fg3 = Mappy_PeekDataBlock_BYTE(CheckTileNumber1,18,mult)` fg3 offset long int = UNUSED??
collision = Mappy_PeekDataBlock_BYTE(CheckTileNumber1,31,mult)
`16 17 18 20 24 19 28 21 26 15 9 23 27 30 29
`oo|xo|ox|oo|oo|xx|oo|xo|ox|xx|xo|xx|xx|ox|xo
`oo|oo|oo|xo|ox|oo|xx|xo|ox|xx|ox|xo|ox|xx|xx