saboteur Posted December 1, 2020 Share Posted December 1, 2020 Anyone got a working example or a working rapinit.s using 8bpp images ? I have no problem using 4bpp but as soon as i create one in paint and save it as 8bpp I get a load of crap on the screen. I've tried changing the rapinit.s by hand and using OMF's excellent tool, but still cant get it working. Any help appreciated. Cheers Quote Link to comment Share on other sites More sharing options...
tonma Posted December 2, 2020 Share Posted December 2, 2020 Can you send an image to test ? ; sprite 0 - decors GFX ************ dc.l 1 ; (REPEAT COUNTER) ; Create this many objects of this type (or 1 for a single object) dc.l is_active ; sprite_active ; sprite active flag dc.w 48,0 ; sprite_x ; 16.16 x value to position at dc.w 16,0 ; sprite_y ; 16.16 y value to position at dc.w 0,0 ; sprite_xadd ; 16.16 x addition for sprite movement dc.w 0,0 ; sprite_yadd ; 16.16 y addition for sprite movement dc.l 256 ; sprite_width ; width of sprite (in pixels) dc.l 192 ; sprite_height ; height of sprite (in pixels) dc.l is_normal ; sprite_flip ; flag for mirroring data left<>right dc.l 0 ; sprite_coffx ; x offset from center for collision box center dc.l 0 ; sprite_coffy ; y offset from center for collision box center dc.l 0 ;32/2 ; sprite_hbox ; width of collision box dc.l 0 ;5/2 ; sprite_vbox ; height of collision box dc.l decorsGFX ; sprite_gfxbase ; start of bitmap data dc.l 8 ; (BIT DEPTH) ; bitmap depth (1/2/4/8/16/24) dc.l is_RGB ; (CRY/RGB) ; bitmap GFX type dc.l is_opaque ; (TRANSPARENCY) ; bitmap TRANS flag dc.l 256*192 ; sprite_framesz ; size per frame in bytes of sprite data dc.l 256 ; sprite_bytewid ; width in bytes of one line of sprite data dc.l 0 ; sprite_animspd ; frame delay between animation changes dc.l 0 ; sprite_maxframe ; number of frames in animation chain dc.l ani_rept ; sprite_animloop ; repeat or play once dc.l edge_wrap ; sprite_wrap ; wrap on screen exit, or remove dc.l spr_inf ; sprite_timer ; frames sprite is active for (or spr_inf) dc.l spr_linear ; sprite_track ; use 16.16 xadd/yadd or point to 16.16 x/y table dc.l 0 ; sprite_tracktop ; pointer to loop point in track table (if used) dc.l spr_unscale ; sprite_scaled ; flag for scaleable object dc.l %00100000 ; sprite_scale_x ; x scale factor (if scaled) dc.l %00100000 ; sprite_scale_y ; y scale factor (if scaled) dc.l -1 ; sprite_was_hit ; initially flagged as not hit dc.l 0 ; sprite_CLUT ; no_CLUT (8/16/24 bit) or CLUT (1/2/4 bit) dc.l can_hit ; sprite_colchk ; if sprite can collide with another dc.l cd_keep ; sprite_remhit ; flag to remove (or keep) on collision dc.l single ; sprite_bboxlink ; single for normal bounding box, else pointer to table dc.l 1 ; sprite_hitpoint ; Hitpoints before death dc.l 2 ; sprite_damage ; Hitpoints deducted from target dc.l 256 ; sprite_gwidth ; GFX width (of data) assets.txt : abs,decorsGFX,gfx_clut,assets\GFX\decor\dec.bmp in abs: ' chargement des palettes loadclut(strptr(decorsGFX_clut),0,256) ' palette DecorS Quote Link to comment Share on other sites More sharing options...
saboteur Posted December 2, 2020 Author Share Posted December 2, 2020 Thanks tonma, i'll have a looki when i get home later. I have a feelling my loadclut statement is wrong. Quote Link to comment Share on other sites More sharing options...
TXG/MNX Posted December 6, 2020 Share Posted December 6, 2020 On 12/2/2020 at 8:35 AM, tonma said: Can you send an image to test ? ; sprite 0 - decors GFX ************ dc.l 1 ; (REPEAT COUNTER) ; Create this many objects of this type (or 1 for a single object) dc.l is_active ; sprite_active ; sprite active flag dc.w 48,0 ; sprite_x ; 16.16 x value to position at dc.w 16,0 ; sprite_y ; 16.16 y value to position at dc.w 0,0 ; sprite_xadd ; 16.16 x addition for sprite movement dc.w 0,0 ; sprite_yadd ; 16.16 y addition for sprite movement dc.l 256 ; sprite_width ; width of sprite (in pixels) dc.l 192 ; sprite_height ; height of sprite (in pixels) dc.l is_normal ; sprite_flip ; flag for mirroring data left<>right dc.l 0 ; sprite_coffx ; x offset from center for collision box center dc.l 0 ; sprite_coffy ; y offset from center for collision box center dc.l 0 ;32/2 ; sprite_hbox ; width of collision box dc.l 0 ;5/2 ; sprite_vbox ; height of collision box dc.l decorsGFX ; sprite_gfxbase ; start of bitmap data dc.l 8 ; (BIT DEPTH) ; bitmap depth (1/2/4/8/16/24) dc.l is_RGB ; (CRY/RGB) ; bitmap GFX type dc.l is_opaque ; (TRANSPARENCY) ; bitmap TRANS flag dc.l 256*192 ; sprite_framesz ; size per frame in bytes of sprite data dc.l 256 ; sprite_bytewid ; width in bytes of one line of sprite data dc.l 0 ; sprite_animspd ; frame delay between animation changes dc.l 0 ; sprite_maxframe ; number of frames in animation chain dc.l ani_rept ; sprite_animloop ; repeat or play once dc.l edge_wrap ; sprite_wrap ; wrap on screen exit, or remove dc.l spr_inf ; sprite_timer ; frames sprite is active for (or spr_inf) dc.l spr_linear ; sprite_track ; use 16.16 xadd/yadd or point to 16.16 x/y table dc.l 0 ; sprite_tracktop ; pointer to loop point in track table (if used) dc.l spr_unscale ; sprite_scaled ; flag for scaleable object dc.l %00100000 ; sprite_scale_x ; x scale factor (if scaled) dc.l %00100000 ; sprite_scale_y ; y scale factor (if scaled) dc.l -1 ; sprite_was_hit ; initially flagged as not hit dc.l 0 ; sprite_CLUT ; no_CLUT (8/16/24 bit) or CLUT (1/2/4 bit) dc.l can_hit ; sprite_colchk ; if sprite can collide with another dc.l cd_keep ; sprite_remhit ; flag to remove (or keep) on collision dc.l single ; sprite_bboxlink ; single for normal bounding box, else pointer to table dc.l 1 ; sprite_hitpoint ; Hitpoints before death dc.l 2 ; sprite_damage ; Hitpoints deducted from target dc.l 256 ; sprite_gwidth ; GFX width (of data) assets.txt : abs,decorsGFX,gfx_clut,assets\GFX\decor\dec.bmp in abs: ' chargement des palettes loadclut(strptr(decorsGFX_clut),0,256) ' palette DecorS Hi, I was playing around with to images 8-bit 256 color bmp files. The first does display right when I disable the second object in the rapinit.s When enable both pictures the first objects gets corrupt and doesnot look the same. It seems its using the clut table of the second picture. Both pictures are 8-bit bmp loadclut(strptr(sprite_background_clut),0,256) loadclut(strptr(sprite_girlb_clut),0,256) How can I handle two or more 8-bit bmp files with cluts ? picture 1: Jaguar is 256 color bmp picture 2: Jaguar + clut enabled + second sprite girlb 256 color no clut in code jaguar ok, girlb sprite not ok picture 3: Jaguar no clut in code and girlb clut enabled in code girlb displays ok, jaguar don't Could someone show me an example code of two 256 color bmp files shown on screen ? Quote Link to comment Share on other sites More sharing options...
matmook Posted December 6, 2020 Share Posted December 6, 2020 There is only one 256 color clut in the Jaguar. You can use multiple 8bit sprites but they will all share the same clut. The last loadclut overwrites previous loaded clut. 2 Quote Link to comment Share on other sites More sharing options...
TXG/MNX Posted December 7, 2020 Share Posted December 7, 2020 On 12/6/2020 at 3:51 PM, matmook said: There is only one 256 color clut in the Jaguar. You can use multiple 8bit sprites but they will all share the same clut. The last loadclut overwrites previous loaded clut. yep fixed it not using 256 color images right now Quote Link to comment Share on other sites More sharing options...
JumbleJag Posted August 13, 2021 Share Posted August 13, 2021 (edited) I know this is old but when I read matmook comment yesterday I understood how the clut works,Thank U Edited August 13, 2021 by JumbleJag Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.