Jump to content
Jagware
Starcat

High Res Graphics On The Jaguar

Recommended Posts

Tursi    0

It's a good thing you reminded me. I'm well known for taking people's work without credit.

 

Share this post


Link to post
Share on other sites
Tursi    0

Yeah, sorry. I get annoyed when I'm "reminded" to do something that is blindingly to me anyway. It's like being reminded by your parents to clean your room two minutes after you've already started - now instead of having done the right thing by your own merits, it's only because you were told to.

 

Yeah, I'm weird that way. :)

 

In the future I'll just steal quietly instead of speaking up. ;)

 

It interests me a bit because with this resolution, a direct port of the Cool Herders Dreamcast version suddenly looks a lot more feasible... still a few technical hurles to overcome, some minor and some major, but it's interesting to see.

 

Share this post


Link to post
Share on other sites
Tyrant    0

Well, if this spurs a whole load of high-res Jaguar games I'm all for it... I just hope I can get mine out there first. The race, it seems, is on :)

Share this post


Link to post
Share on other sites
Tursi    0

Ah, no, no, don't worry, you'll win for sure. I can't see the end of my CURRENT project list, let alone things added to the end of it. ;)

 

Share this post


Link to post
Share on other sites
Tyrant    0
Another possibility is to keep the bitmap data as it is, but double the value of the DWIDTH field. This will cause the OP to skip every other line when drawing. In your VBL interrupt routine, update the DATA field with either your bitmap's address (to show lines #0, #2, etc.) or your bitmap's address + one line (to show lines #1, #3, etc.), according to the field which will be drawn next.

 

In both cases, remember that you're only drawing half the number of lines per field, so the HEIGHT field value should be divided by two, compared to a non-interlaced screen.

Arrgh! Sometimes I really hate this cat!

 

Further to the above advice, I would add (for anyone else foolish enough to do a high res game), that if you want smooth movement in the y direction, you will additionally have to consider the case when you want to draw an object on an odd line boundary. Softref says (p16, object definitions) that YPOS gives "the value in the vertical counter (in half lines) for the first (top) line of the object. ... If the display is interlaced the number is even for even lines and odd for odd lines." This, as with most of the OP's interlace support, is broken, and the value must always be even*.

 

In order to get objects to draw on odd lines, you must do a similar trick as zerosquare described: For odd-aligned objects, on even fields of the display, add IWIDTH to DATA, and add 1 to YPOS. This is getting so confusing that I made myself a reference image to keep it all straight. I hope it proves useful to someone.

 

*if it's not even, it will display on the next line drawn, i.e. it will round up until it is even.

 

EDIT: My original post gave an incorrect workaround, suggesting to just add iwidth on even rows, and subtract 1 on odd rows. It has now been corrected, and a new image uploaded.

post-77-1303349184_thumb.png

Edited by Tyr of the Arcana

Share this post


Link to post
Share on other sites
Tyrant    0

My last post has been edited to fix an error I discovered a little while ago. Since I am now not the only one writing an interlaced game, I figured it was a bad idea to leave incorrect advice here.

Share this post


Link to post
Share on other sites
Zerosquare    10

To switch back from interlaced to non-interlaced mode:

Blindly restoring the values from the boot ROM into the video registers doesn't work reliably. Both HC and VC must be reset immediately before doing so, otherwise you have a chance of ending up in a state where you don't get VBLANK interrupts anymore.

 

Here's the code:

InitNonInterlacedMode:
    move.w        CONFIG, d0
    andi.w        #16, d0
    bne           InitNonInterlacedMode_60Hz
InitNonInterlacedMode_50Hz:
    move.w        #0, HC  
    move.w        #0, VC   
    move.w        #$026F, VP  
    move.w        #$0265, VEB
    move.w        #$026A, VS
    move.w        #$0006, VEE
    move.w        #$0022, VBE
    move.w        #$0258, VBB
    move.w        #$0352, HP
    move.w        #$06D5, HS
    move.w        #$0313, HEQ
    move.w        #$0259, HVS
    move.w        #$06AF, HBB
    move.w        #$009E, HBE
    move.w        #$06A0, HDE
    move.w        #$00A6, HDB1
    move.w        #$00A6, HDB2
    move.w        #$002E, VDB        
    move.w        #$020E, VDE  
    bra         InitNonInterlacedMode_End
InitNonInterlacedMode_60Hz:
    move.w        #0, HC  
    move.w        #0, VC  
    move.w        #$020B, VP
    move.w        #$01FF, VEB
    move.w        #$0205, VS
    move.w        #$0006, VEE
    move.w        #$0018, VBE
    move.w        #$01F4, VBB
    move.w        #$034C, HP
    move.w        #$06CD, HS
    move.w        #$0310, HEQ
    move.w        #$028B, HVS
    move.w        #$06B1, HBB
    move.w        #$007D, HBE
    move.w        #$06A0, HDE
    move.w        #$00A6, HDB1
    move.w        #$00A6, HDB2
    move.w        #$002E, VDB
    move.w        #$01F0, VDE
InitNonInterlacedMode_End:

For safety, you should disable 68K interrupts before running this code, to make sure it doesn't get interrupted.

This code resets all video registers, so you should rerun your video init code afterwards to set VI, HDB1, HDB2, HDE, VDB and VDE properly for your game. VI is especially important: make sure its value is odd, otherwise you won't get any VBLANK interrupts anymore.

Share this post


Link to post
Share on other sites
Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoticons maximum 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.


×