P2Prep, and other Prop2 Display Drivers ( title change from Prop2 test card image )
Baggers
Posts: 3,019
Hi All,
Wrote a converter to change a 24bit BMP into 16bit RGB data for a prop2, and also change binary file into a .txt file, that can be then copied and pasted into a serial program to upload it to monitor, with the address included at every $1000 to save a little on upload time
Here is my first "real" bitmap on a prop2.
If anyone is interested in this app ( windows, should work in wine also ) then let me know.
P2 1024x768 16 bit colour bitmap SDRAM driver
HiResBitmaps.zip
Here is P2Prep to prepare data for loading to Prop2 over Monitor.
P2Prep.zip
P2Prep source here.
P2Prep.c
Here is a P2 8bit paletted BITMAP from a modified version of Tubular's greyscale driver
P2_NTSC_252x96_8bit_Palettised_DE0_and_DE2.zip
Here is a P2 8bit paletted BITMAP 128x96 threaded, for use with DE0 ( and DE2 ) and also P2Prep, updated to grab/convert 8bit 332 bitmaps.
DE0.zip
Here is the P2 8bit 128x96 threaded bitmap driver with 8 8x16 sprites, and some code running in the threads you can use to make your own stuff.
JB_Sprites_DE0.zip
Here is the P2 16bit 512x384 ( 512x192 at the moment, until I sort interlace mode next ) bitmap using Chip's SDRAM driver.
SDRAM_TV.zip
Here is a binary to SDRAM sender check out the runme.bat to see how to send stuff. -a0 is to address $0 ( ie don't add the $ )
TO_SDRAM.zip
Wrote a converter to change a 24bit BMP into 16bit RGB data for a prop2, and also change binary file into a .txt file, that can be then copied and pasted into a serial program to upload it to monitor, with the address included at every $1000 to save a little on upload time
Here is my first "real" bitmap on a prop2.
If anyone is interested in this app ( windows, should work in wine also ) then let me know.
P2 1024x768 16 bit colour bitmap SDRAM driver
HiResBitmaps.zip
Here is P2Prep to prepare data for loading to Prop2 over Monitor.
P2Prep.zip
P2Prep source here.
P2Prep.c
Here is a P2 8bit paletted BITMAP from a modified version of Tubular's greyscale driver
P2_NTSC_252x96_8bit_Palettised_DE0_and_DE2.zip
Here is a P2 8bit paletted BITMAP 128x96 threaded, for use with DE0 ( and DE2 ) and also P2Prep, updated to grab/convert 8bit 332 bitmaps.
DE0.zip
Here is the P2 8bit 128x96 threaded bitmap driver with 8 8x16 sprites, and some code running in the threads you can use to make your own stuff.
JB_Sprites_DE0.zip
Here is the P2 16bit 512x384 ( 512x192 at the moment, until I sort interlace mode next ) bitmap using Chip's SDRAM driver.
SDRAM_TV.zip
Here is a binary to SDRAM sender check out the runme.bat to see how to send stuff. -a0 is to address $0 ( ie don't add the $ )
TO_SDRAM.zip
Comments
I'm are first one that are interested.
Hi Sapieha,
Here it is, I've included the testcard.bmp also, and a batch file g.bat
to convert the image, just type
g testcard
It will then do two passes on the converter.
First pass to convert the bitmap to a binary, which will invert it ( as BMPs are stored upside down ) and it will skip the first $36 bytes the BMP header, and remove the last 2 bytes, to make it just the bitmap, then it will convert each RGB888 into RGB565 then save out the binary.
Second pass to convert the raw binary into a .txt file that is compatible with the Monitor, with the load address of $8000 ( in the bat file if you want to see how it works, note don't use $ when stating any addresses or skip lenths, when using p2download directly )
Then load the txt file, and copy the while file, then go into PUTTY ( thanks potatohead for the heads up on that app ) or your serial app that you can copy and paste into and press space, activate the monitor, then paste ( or right click when using PUTTY, assuming you have it set in the settings Window Selection right pastes )
Oh and I have baud set to 512000 which seems fine, anything faster can get messed up.
It takes a while to upload the image, then run your program to display the 16bit bitmap ( you can use the one in my cog renderer, but remember to remove the render coginit )
If you have any questions, let me know!.
P2Download.zip
Using a couple of utilities of Baggers (bmp8tolite and prop2download) I converted the images into a text file that is downloaded to the DE0 using the Monitor.
Then I ran Tubulars driver on PNut (I comented out the bitmap generation routine) and downloaded to the DE0 and voilla!
I've got to say I am very impressed with the quality, if the final chip is as good as this Parallax will surely have a winner.
Regards,
Coley
I'm going to update the first post with P2Prep, ( P2Download is now called P2Prep. )
I've changed it a tad, to make it more friendly, and allowed 32bit bmps also, ( untested so I'm hoping I got the right byte to remove the alpha, will test this and fix, if not. )
I've also added the greyscale driver that Coley had modified, and a 8bit bmp convert also in P2Prep, so you can convert greyscale 8bit bitmaps that are 256x96.
Enjoy.
Link don't function
I P2Prep now a combined conversion and monitor download program? If so, would be nice to just have a monitor download program (that could then be posted in the Tools thread). IIRC Sapieha was looking for this.
Maybe for the next version! but I didn't want to divert people from David's P2load.
David's is not going to do downloads using the monitor and his rationale for this is fine. I thought you had this when you mentioned PropDownload after converting the bmp to the monitor style. I know Sapieha is looking for this type of downloader for debugging with the monitor, and it makes sense for some.
I think Andy's Prop2Terminal may use the monitor to download.
If You made loader trough Monitor --- Write in in that way it can convert any type of file to Monitor HEX compatible file and save on PC's HD
With any Address specified on command line
Ps. That can help even people that will load trough WiFi
P2Prep filename.bin filename.txt -a8000
Will convert filename.bin into a Monitor Hex text file which will load at $8000
need to set USING_A_DE0 to 0 for DE2
Edit: In the zip file in top post, I've put a 256x192 but that was from the 16bit one, so will look strange, but the driver does show 8bit file at $8000 for DE2.
I'll also have to make chances to P2Prep, to go by what the BMP size is, I'll also make it go through the header to skip and crop the headers automatically.
Nipping out now though, so back on it later.
Hi All, just thought I'd give you a teaser preview of what's to come.
I'm in the midst of getting to grips completely with the PIX engine
Chip it's ace!
That's really nice to see!
That looks great. Have you had any success with PIX's Z-perspective correction yet? You'll probably need to use the divider to calculate setup. Are you needing that info now?
As an aside, the MUL instruction returns immediately with the result. There is also a SCL instruction which scales by a max value of 2, with many fractional bits.
There are separate large divider and multiplier circuits which take ~16 clocks each.
To do a 32x32 multiply (A*B):
SETMULA D/#n 'provide 1st term for signed multiply (use SETMULU for unsigned multiply)
SETMULB D/#n 'provide 2nd term and start multiply
(~16 clocks, if you want to do anything here)
GETMULL D 'get lower-long result, waits if not ready yet
GETMULH D 'get upper-long result, waits if not ready yet
You can also poll GETMULL/GETMULH D WC, where C=1 and D=result if done. This is useful for multi-threading, where you don't want to stall the pipeline.
To do a 32/32 divide (A/B):
SETDIVA D/#n 'provide dividend term for signed divide (use SETDIVU for unsigned divide)
SETDIVB D/#n 'provide divisor term and start divide
(~16 clocks, if you want to do anything here)
GETDIVQ D 'get quotient long result, waits if not ready yet
GETDIVR D 'get remainder long result, waits if not ready yet
You can also poll GETDIVQ/GETDIVR D WC, where C=1 and D=result if done.
To do a 64/32 divide, do an extra SETDIVA/SETDIVU to provide the upper long of the dividend.
To compute a 16-bit root of a 32-bit unsigned input:
SETSQRL D/#n 'set 32-bit unsigned input and start computation
(~16 clocks, if you want to do anything here)
GETSQRT D 'get square root, waits if not ready yet
You can also poll GETSQRT D WC, where C=1 and D=result if done.
To compute a 32-bit root of a 64-bit unsigned input:
SETSQRH D/#n 'set upper long of a 64-bit unsigned input
SETSQRL D/#n 'set lower long of a 64-bit unsigned input and start computation
(~32 clocks, if you want to do anything here)
GETSQRT D 'get square root, waits if not ready yey
Wow! That's impressive and fast. Way to go Chip
I've had a play with the Z-Perspective correction also, but just working on getting the texture sorted first,
I've got the tri rendering down both sides of the try, with UVs and setting up the pixu, and pixv registers etc, that's all working, next is to read a tri, and sort the verts etc, ready to feed this engine, then I'll get the Z once I've got the 3D rotations etc sorted.
Thanks for the Mult and Divide info, as I had resorted to using the old Multiply and Divide from Prop1, the hardware should help speed it up again too!
Cheers,
Jim.
Will post more pics tomorrow.
I didn't get chance tonight, as it's race night!
Here's a DE2 test for people to have a look at.
It's not finished yet, but here's a preview, so no source at the moment, just a batch file to send a few binaries to the DE2.
JBTest.zip
Nice work.
Only some sync problems on my LCD. Give me some green blinking lines on top
Sapieha, the green at the top, is the raster, how long it's taking the poly engine to draw them, it's not a sync issue.
http://www.youtube.com/watch?v=QRWTaQD5t_M&feature=youtu.be
That raster are about 3 lines -- Then rest of picture are correct
Cool! :cool: