Jump to content
IGNORED

Blitter


SCPCD

Recommended Posts

Hello !

 

I would like to use the bit to pixel expansion mode of the blitter but I don't find the configuration to made for this.

 

I would like to have a color when the original bit is 0 and an another color when the bit is 1. (with the possibility to change colors)

 

Nobody know how could I made this ?

 

regards,

 

SCPCD.

Link to comment
Share on other sites

Hi!

 

Hmm... atari never gave examples on how exactly to do the bit2pixel expansion.. and from what i can gather, not that many ugd'ers use it (or the blitter in general... I am sorry to say!) So I guess you are in for some nice, timeconsuming, DIY ("Do It Yourself") sessions ;)

 

Personaly i have never used that mode of the blitter, so take the below with allot of "salt" =)

 

I had similar thoughts about how to use anohter feature of the blitter... and then got tipp from someone how easy it was, just setting a bit in the blitter flag...

..My point beeing that it Might... might! be as simple to use the bit2pixel expansion as it was with the thing i did.

 

So.. some ideas to start with (guessing here so pardon me if it turns out to be totally wrong ;)

 

set up the phrase you whant to expand in the patterndata register.. (iirc thats what atari said... ie you can do a 8x8 pixel character with one blitt (8x8=64 bits expanded to 8x8pixels) if you whant to do bigger you need to do more expansions/blitter setups.

 

And then... perhapps... hopefully you just need to set the correct flag in the blittercommand register... to use the bitexpansion thing...

 

(if i get time i can recheck this.. and then come back & admit i was totally wrong ;) ...but...

 

 

....What actually do you whant to do? ....and do you realy need to use the blitter to do that expansion? ...

From what i can understand you dont realy need to use the blitter.. or?

 

do you whant a "bitposition" in memory to be one pixel... and if that bit is 0.. it should be one color (like BG color or whatever) ..and if the same bit is 1 (set) then another color of that same pixel?

 

Ie something like a 2 color sprite... with possibility to change color of each colour?

 

I mean this can (or should be, never did it myself) be done with OP objects... just by setting the object to be a bitmap object with less bits... (not 16bitrgb or cry, but 8bit, 4, ..or so (dont remember if the OP can handle 1bit objects (??) ...but anyhow...)

 

By setting up such a object you can get ..for example (8bit bitmap OP objects) 256 colours of one byte in memory... and by changing the CLUT table you can change the colour of each individual colour..

 

Making a 4bit OP bitmap object, each nibble in memory is a pixel... with 2^4 different possible colours... taken from the 16 first .w positions in the CLUT table...

IF... IF! the op can do 1bit objects then the principle should be the same...

------

 

Though i strongly sugest anyone to use as much colours as possible... just because the jaguar can!... vivid colours/ "eye candy" is always nice.. =)

 

So depending on what you whant to do.. perhapps consider using a 8bit OP object instead... making atleast 256 colour sprites ..that can have each colour change... (like falcons bitplane mode, like OC "Mode7" 256 colour mode.. and so on).

 

Anyhow... Good Luck! ...if you manage to get the bit2pixel thing to work.. I for one would like to know exactly how you did!... since I use the blitter allot! ...(and not OP obejcts! =).. though I'm usualy doing cry mode..

 

cheers!

/Sym

Link to comment
Share on other sites

Hi again... what did i say? ...Id probably have to admit i was wrong, and i was ;) ...its supposed to be the "source data register" not the patterndata as i guessed at first... :-)

 

Ahh ok.. so you have a 16bit background... (cry?) ..and what to blitt low colour sprites (that can change their colour via a palette) as Fast as possible... 1bit sprites...

 

well.... I admit i never used the bit expansion function ..But!... (iirc.. ;) ...it might conflict with what you wanted... "as fast as possible" ...since i think the bitexpansion only work in blitter pixel mode (addinc=1) ....and over hole phrases only in 8bits / pixel.... (iirc & if i understod it correctly).

 

Ie everytime you blitt a sprite it will be in pixelmode.. and that is not as fast as it can be, especially if it is a bit bigger sprites...

 

And if you what phrase mode... you might have to use 8bit sprites... (7bit waste if you only whant 2 colour sprites...)

 

So....

 

IF possible! ...it might be better to use the OP in 1bit mode... (it apparently has 1bit,2,4,8,16,24 bits/pixels.. so a 1bit object sprite might be a "better choise" ....*caugh*... =)

 

the way i figure the bitexpansion function is best used for 8x8 single colour fonts... (font data made in "bit fields"=least space...

Instead of like i have it now in my code... the font is a 8x13 CRY font... a bit of waste of space I know.. but having everything in cry have its advantages..

 

Ahh well... I am verry interested in your results.. if you go for the bitexpansion thing.. just because it is a "undiscovered country" of the blitter ... so if you feel like it please share your results..

 

good Luck!

/Sym

Link to comment
Share on other sites

Hello!

 

Hi !

 

I looked at it only shortly so far, but I couldn't see where the bits are stored that you expand to pixels.. I assume it's the vertical yellow lines ?

 

Regards, Lars.

 

I think the demo-code was a little bit too reduced ;-)

 

I tested the blitter.bin and looked into the source and it seems to be derived from one of the simple JOYSTICK-samples Atari provided. The program shows a single object which can be moved around by using the direction-keys of the Joypad in port 1 and additionally the key you have pressed on the joypad is printed into that screen-object. The font used for this is stored in ATARI8x8.FNT which seems to be an object-file containing the familiar Atari ST-font.

 

Unfortunately the bitmap of the screen-object (8*160 16bit pixels) wasn't erased in the original source so i had seen some debris at the right end of it. Attached is a new version which erases the object-bitmap and also uses some other colours. Hope nobody minds that i have added my comments in english to the source ;-)

 

Regards

Matthias

blitter2.zip

Link to comment
Share on other sites

Hi SCPCD!

 

YeeHaa ! =) I told you it was supposed to be easy ;)

 

Though... i have read the manual for 5+ years now and think i knew the "scattered" info rather good.. and iirc even if you collect the pieces could you come up with that code...

But it doesnt matter! ..all that matters is that you got it to work and that was a Good Jobb! =)

 

Would be interesting though to see a speed compare with a pure 16bit CRY blitt.. (standard ascii font picture -> screen) to see if the bitexpansion blitt is faster... (so one could weigh monocolourfont vs speed)

 

standard "move.w #$f0ff,BG" before the blitt.. and then wait for the blitter amd do a "move 0,BG) would be enough...

But im probably the only one optimising for clockcycles anyhow, so i guess i´ll have to do it myself ;)

 

 

There is also the laboration to get it to work with different objects... especially the 8bit object (so that you can easily, without reblitting the hole text) change the colour of the fonts.... (if that is what you wanted... as i understood...(??)).

And this isnt so easy.. since there are restrictions on the blitts in phrase mode (or so i have heard).

 

But perhapps that is enough to suit your needs..?

 

BTW.... is there a English version of what you posted in the frensh jaguar forum? :) ..Im interested in your HW/SW work :)

 

Cheers

Link to comment
Share on other sites

Hi !

 

I have made tests with the bit2pixel expansion and it is possible to made :

1bit/pixel -> 1bit/pixel

1bit/pixel -> 2bits/pixel

1bit/pixel -> 4bit/pixel

1bit/pixel -> 8bits/pixel

1bit/pixel -> 16bit/pixel

1bit/pixel -> 32bits/pixel

 

I explain it in a manual that I started to made to regroup many features that Jaguar's developers found.

Actualy, there is only the bit2pixel expansion but in the futur, I'll expend the manual.

 

http://scpcd.free.fr/downloads/fichiers/JETRM.pdf

 

Regards

 

SCPCD.

Link to comment
Share on other sites

Cool idea with the pfd =) ....(had a similar thought ...but thought to change the devman pdf and make a "symmetry speciall" containing all collected knowledge i have gained over the years... but.. :/

 

What pdf editor do you use? ...(or is it a pdf creator? ....those are easier to find.. though i'd rather have an editor than create a pdf out of a .doc or whatever...)

 

Ahh well... nice work! =)

Link to comment
Share on other sites

Hello,

 

I explain it in a manual that I started to made to regroup many features that Jaguar's developers found.

Actualy, there is only the bit2pixel expansion but in the futur, I'll expend the manual.

That's really great, nice PDF too.

Jaguar coding always needs more explanation, and indeed the idea of

a supplement which brings together and expands Atari information is a

good one. Atari's ideas for structuring the Jag dev manual baffle me...

why did they take useful information and scatter it, or give 50% info?

 

Thanks again.

I look forward to trying to provide info towards your future PDF's.

 

Cheers,

JustClaws.

Link to comment
Share on other sites

Hello,

 

Attached is a new version which erases the object-bitmap and also uses some other colours. Hope nobody minds that i have added my comments in english to the source ;-)
Nice to be part of a community where people help each other out and share

their ideas, their knowledge, their observations. Nice work Matthias too.

 

Cheers,

JustClaws.

Link to comment
Share on other sites

Hello,

 

although i am a long-time hobby-developer for the Jaguar i am still not an expert for Blitter-using, and there is one question i have:

In the character-printing function the blitter copys a 1bit character-bitmap into a multi-bit-per-pixel-bitmap (here into a 16bit-bitmap), but only the set bits are used in this copy-process (they are appearing in the given character-foreground-colour in the destination-bitmap), the 0-bits are ignored.

Is there a way to let the blitter copy the 0-bits also (to let them appear

in the destination-bitmap in a given character-background-colour)?

 

Regards

Matthias

Link to comment
Share on other sites

Hello,

 

It's possible to write an another color when the bit is 0 !!!

 

But it works only in >= 8bits/pixel.

 

So, to made the write when the bit is 0 you must write the colour in the B_DSTD register like the colour in the B_PATD register.

Then, select the bit BKGWREN of the B_CMD register.

 

Why doesn't it work in lower resolution ?

Because to write in lower resolution you must use the DSTEN bit of the B_CMD register and with this option, the B_DSTD is not use.

 

Regards,

 

SCPCD

  • Like 1
Link to comment
Share on other sites

Hello!

 

I have now checked the project on which i thought that i had problems (haven't worked on this project for 10 months) with the background-colour-setting during a blit, but to my own shame i have to admit that i had already used the mentioned blitter-flags. But because of the test-runs i did now i was able to find the real reason for my problems in that project: I had initialized the background-colour-variable in a wrong way, so some tests looked ok and some looked wrong and i had got a wrong impresion about the used blitter-settings.

But now everything is fixed and i am happy ;-)

 

Thanks again

Matthias

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...