Jump to content

Trying to create a simple RGB test pattern "slideshow"

Doomy Doomer

Recommended Posts

I'm trying to create a simple RGB Test Pattern "slideshow" that would have a few test patterns you can flip through and have it run on my GameDrive. I'm very new to JagStudio but I understand core logic concepts since my day job revolves around JS and TS. I'm embarrassingly stuck at the beginning steps in the quick start guide though. At the moment, all I'm trying to do is get a bmp of test bars to appear on screen. I can get the project to compile fine in Virtual Jaguar but the image is distorted, so I'm obviously doing something wrong :)  


My BMP is 16bit color depth and 320x240. Again, I'm new to all of this so this setup might be the issue but I tried to follow the "clut" description for this setup using the Reference Manual file. In fact, I tried using ref manual for most of the below info that didn't make sense to me initially.


Here's a snippet of my rapinit file:

    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    0,0                              ; sprite_x                      ; 16.16 x value to position at
    dc.w    0,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    320                              ; sprite_hbox                   ; width of collision box
    dc.l    240                              ; sprite_vbox                   ; height of collision box
    dc.l    RGB_PATTERN                      ; sprite_gfxbase                ; start of bitmap data
    dc.l    16                               ; (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    320*240 	                     ; sprite_framesz                ; size per frame in bytes of sprite data
    dc.l    320                              ; 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_kill                        ; 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    no_CLUT                          ; 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    320                              ; sprite_gwidth                 ; GFX width (of data)

Here's my asset desc:



Attached is the actual BMP. I appreciate any help you guys can offer!


Link to comment
Share on other sites



If it's a 16bit image, you need the *2 for these values;

sprite_framesz = 320*240*2
sprite_bytewid = 320*2
sprite_gwidth = 320*2



The rapinit.s for the project template should have comments detailing this;



Your assets.txt entry looks correct.


PaintShopPro 7 couldn't open your BMP, but it does display in Windows image preview so i'm not sure off hand if that's corrupt or not.


Try those values above and see what you get - post an image of what you see if it still fails  ?




  • Thanks 1
Link to comment
Share on other sites

Appreciate the fast response. It still fails but it at least now resembles the color bars. 




I originally created the BMP in Photoshop but I just tried GIMP as well to try and rule out the image itself. Same results for both images. So to further rule out the image, I decided to use one of the images from an existing project in the JagStudio. I pulled "2.bmp" from the "background" project and here's how that looks:



I'm obviously still doing something wrong ? 


Link to comment
Share on other sites

2.bmp from the background project is only 4 bit so that won't work without further changes.


Try background.bmp from the doger project.

That is a 352*240 image and 16 bit compatible.


So change all your sizes in rapinit.s to 352*240 and those 3 properties I mentioned earlier set to sprite_framesz=352*240*2




This will help rule out if your image is incompatible.


If it still doesn't work for you, please zip and post your project files here. Then we can help further.

  • Thanks 1
Link to comment
Share on other sites

  • 3 weeks later...
  • 3 weeks later...

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.

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.

  • Recently Browsing   0 members

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