Jump to content
IGNORED

Showing 8-bit images


atari2600land

Recommended Posts

This is my image. This is my code in the rapinit.s file:

; Text/Particle Layer
    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    64,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    256                                                                ; 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                                                                ; sprite_hbox        ; width of collision box
    dc.l    0                                                                ; sprite_vbox        ; height of collision box
    dc.l    TITLESCREEN                                                        ; 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_trans                                                        ; (TRANSPARENCY)    ; bitmap TRANS flag
    dc.l    256*256*2                                                            ; sprite_framesz    ; size per frame in bytes of sprite data
    dc.l    256*2                                                                ; 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    cant_hit                                                        ; sprite_colchk        ; if sprite can collide with another
    dc.l    cd_remove                                                        ; 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/2                                                            ; sprite_gwidth        ; GFX width (of data)
    

I put this in the assets file:


ABS,TITLESCREEN,gfx_clut,assets\oniontitlescreen.bmp

The result is a couple of little red and white dots. What am I doing wrong?

oniontitlescreen.bmp

Link to comment
Share on other sites

In each rapinit.s file:

"no_CLUT (8/16/24 bit) or CLUT (1/2/4 bit)"

 

in each assets.s file:

"For graphics conversion you can use "gfx_clut" or "gfx_noclut" to convert a .BMP file into jaguar raw format and optionally export the paletter or not (clut=yes, noclut=no). This applies to 1-, 2-, 4- and 8-bit graphics only."

 

So which is it? I'm really confused now.

 

 

Link to comment
Share on other sites

1 hour ago, atari2600land said:

This is my image. This is my code in the rapinit.s file:



    dc.l    256                                                                ; sprite_width        ; width of sprite (in pixels)
    dc.l    256                                                                ; sprite_height        ; height of sprite (in pixels)

    dc.l    256*256*2                                                            ; sprite_framesz    ; size per frame in bytes of sprite data
    dc.l    256*2                                                                ; sprite_bytewid    ; width in bytes of one line of sprite data

    dc.l    256/2                                                            ; sprite_gwidth        ; GFX width (of data)
    

 

256x256x8bit is not 256x256x2...

and gwidth is not 256/2

 

framesize = 256*256

bytewid=256

gwidth=256

Link to comment
Share on other sites

  • 3 weeks later...
  • 9 months later...

How do we display 8-bit bitmaps without CLUT?  Based on the docs sounds like this should be doable, but I am not having any luck getting these displayed properly.

I have an 8-bit (RGB) pixel formatted bitmap, 32x32 pixels I am trying to display, and here is the rapinit sprite definition:

 

    ; MARYO_stand_right
    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    58,0                    ; sprite_x                        ; 16.16 x value to position at
    dc.w    141,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    32                ; sprite_width                    ; width of sprite (in pixels)
    dc.l    32                ; 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    16                            ; sprite_hbox                    ; width of collision box
    dc.l    16                                ; sprite_vbox                    ; height of collision box
    dc.l    MARYO_stand_right                        ; 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_trans                        ; (TRANSPARENCY)                ; bitmap TRANS flag
    dc.l    32*32            ; sprite_framesz                ; size per frame in bytes of sprite data
    dc.l    32                            ; 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_ignore                        ; 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    32                                ; sprite_scale_x                ; x scale factor (if scaled)
    dc.l    32                                ; 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    0                        ; sprite_hitpoint                ; Hitpoints before death
    dc.l    2                                ; sprite_damage                    ; Hitpoints deducted from target
    dc.l    32                            ; sprite_gwidth                    ; GFX width (of data)

 

Asset Definition:

ABS,MARYO_stand_right,gfx_noclut8,ASSETS\GFX\pixmaps\maryo\small\output.bmp

 

And this is the bitmap I am using:

output.bmp

 

This is what the sprite looks like, expected result is it should look like the bitmap above, but obviously I am doing something wrong.  Thanks in advance for any pointers!

 

995071819_Screenshot2022-03-14185925.thumb.png.8df2b4df1978ec1106a547d6c809ae8c.png

Link to comment
Share on other sites

I believe you still have to load the clut when displaying 8-bit images.  The OP is still doing color lookups.  The difference with 4-bit images, for example, is you can specify which part of the 256 color table will be used by the OP when writing to the line buffer, the sprite_CLUT.  With 8-bit images, sprite_CLUT is ignored and the entire color table is used.

Apologies for my rough explanation.  I hope it makes sense and helps.

  • Like 1
Link to comment
Share on other sites

1 hour ago, OVERRiDE said:

How do we display 8-bit bitmaps without CLUT? 

 

You need to use the entire CLUT, and any 4bpp/2bpp/1bpp palettes will need to be subsets of the full clut for this image.  Or, use a 16bit image, which has no clut.

 

26 minutes ago, xzpecter said:

I believe you still have to load the clut when displaying 8-bit images.  The OP is still doing color lookups.  The difference with 4-bit images, for example, is you can specify which part of the 256 color table will be used by the OP when writing to the line buffer, the sprite_CLUT.  With 8-bit images, sprite_CLUT is ignored and the entire color table is used.

Apologies for my rough explanation.  I hope it makes sense and helps.

^^^ Gold star for zxpecter!

Link to comment
Share on other sites

Thank you guys for the reply, perhaps the documentation should be updated as it really gives the impression that 8bit no clut is possible.

 

Either way, I am assuming then we can only have 1 pallette loaded per frame?

 

My use case is I have dozens of textures in use per frame, each with their own pallette, and it would be ideal to have these all be 8 bit to reduce the load on the OP.  In the screenshot above the OP really slows down when the whole screen is covered with 16bit sprites

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...