The source image is 48x16px - so made up of 3 16x16px tiles
As I said when I set the tile height to 8px it all works fine except each tile is displayed half height - as I would expect.
However no map is displayed when setting tile height to 16px
'
' Your code goes here
' Have fun!
'
rlist=(RAPTOR_LIST *)strptr(RAPTOR_sprite_table)
basic_r_indx=0
basic_r_size=0
'RLOCATE 0,202
'RPRINT " RAPTOR BASIC+ - REBOOT "
'basic_r_size=0
'basic_r_indx=0
'RLOCATE 0,218
'RPRINT " Derived from BCX BASIC v6 "
DIM ID_player%
DIM GVAR_player_gfx_loc%
DIM GVAR_player_gfx_size%
ID_player = 2 ' RAPTOR Object number for player
'GVAR_player_gfx_loc = RGETOBJ(ID_player, R_sprite_gfxbase)
'GVAR_player_gfx_size = RGETOBJ(ID_player, R_sprite_framesz)
set maps[15][20] as short
'01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20
{00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00}, ' screen 1 row 01
{00,01,02,01,02,01,02,01,02,01,02,01,02,01,02,01,02,01,02,00}, ' screen 1 row 02
{00,02,01,02,01,02,01,02,01,02,01,02,01,02,01,02,01,02,01,00}, ' screen 1 row 03
{00,01,02,01,02,01,02,01,02,01,02,01,02,01,02,01,02,01,02,00}, ' screen 1 row 04
{00,02,01,02,01,02,01,02,01,02,01,02,01,02,01,02,01,02,01,00}, ' screen 1 row 05
{00,01,02,01,02,01,02,01,02,01,02,01,02,01,02,01,02,01,02,00}, ' screen 1 row 06
{00,02,01,02,01,02,01,02,01,02,01,02,01,02,01,02,01,02,01,00}, ' screen 1 row 07
{00,01,02,01,02,01,02,01,02,01,02,01,02,01,02,01,02,01,02,00}, ' screen 1 row 08
{00,02,01,02,01,02,01,02,01,02,01,02,01,02,01,02,01,02,01,00}, ' screen 1 row 09
{00,01,02,01,02,01,02,01,02,01,02,01,02,01,02,01,02,01,02,00}, ' screen 1 row 10
{00,02,01,02,01,02,01,02,01,02,01,02,01,02,01,02,01,02,01,00}, ' screen 1 row 11
{00,01,02,01,02,01,02,01,02,01,02,01,02,01,02,01,02,01,02,00}, ' screen 1 row 12
{00,02,01,02,01,02,01,02,01,02,01,02,01,02,01,02,01,02,01,00}, ' screen 1 row 13
{00,01,02,01,02,01,02,01,02,01,02,01,02,01,02,01,02,01,02,00}, ' screen 1 row 14
{00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00} ' screen 1 row 15
end set
loadclut(strptr(tiles_clut),0,16)
dim x as short
dim y as short
dim c as short
dim tilex as short
dim tiley as short
dim map as short
dim i as int
DIM pi!: pi=3.1415926535897932384626433832795
dim ph!
' The screen to draw the map's width in bytes.
' Think of this as <width in pixels>*<bits per pixel>/8
const dest_screen_width_in_bytes=160
' Our tile's height in pixels
const tile_height=16
' Our tile's width in bytes.
' Think of this as <width in pixels>*<bits per pixel>/8
const tile_width_in_bytes=8
' Number of available maps.
const no_maps=1
' The screen to read the tile's width in bytes.
' Think of this as <width in pixels>*<bits per pixel>/8
const src_screen_width_in_bytes=24
' Map width inside the map array
const map_width=20
' Map height inside the map array
const map_height=15
map=0
' Draw map
for y=0 to map_height-1
for x=0 to map_width-1
c=maps[map*map_height+y][x]
tilex=(c % map_width)
tiley=(c/map_width)
drawtile(x,y)
next x
next y
rlist[1].x=19*65536
vsync
do
call Player_Update_Position
vsync
loop
sub drawtile(x as SHORT, y as SHORT)
for i=0 to map_height-1
' Our tiles are 16x16 big in 4bpp mode, which means they are 8 bytes wide in RAM. Hence we need 2 LPOKEs per line.
lpoke strptr(scrbuf)+y*(dest_screen_width_in_bytes*tile_height)+x*tile_width_in_bytes+i*dest_screen_width_in_bytes,lpeek(strptr(tiles)+tilex*tile_width_in_bytes+tiley*(src_screen_width_in_bytes*tile_height)+i*src_screen_width_in_bytes)
lpoke strptr(scrbuf)+y*(dest_screen_width_in_bytes*tile_height)+x*tile_width_in_bytes+i*dest_screen_width_in_bytes+4,lpeek(strptr(tiles)+tilex*tile_width_in_bytes+tiley*(src_screen_width_in_bytes*tile_height)+i*src_screen_width_in_bytes+4)
next i
end sub
could it be anything to do with rapinit?
cheers