Graphic conversion for any 256x192 into MSX1 graphics (Source code in Blitz Basic).

Pagina 3/14
1 | 2 | | 4 | 5 | 6 | 7 | 8

Van Grauw

Ascended (10820)

afbeelding van Grauw

30-03-2019, 14:54

Van Rogerup

Resident (39)

afbeelding van Rogerup

30-03-2019, 19:06

This should be converted automatically. But if not, you can use & lt; with no space between & and l, I put the space in order to not be converted like here: <

For example, you cannot write this: <f> without the HTML special entities.

Van MsxKun

Paragon (1134)

afbeelding van MsxKun

31-03-2019, 14:10

I'm working on it now, using the pastebin version (thx for the warning, LeandroCorreia)
Translating from Blitz to Python Smile Using PIL library to read the image dots by nowr (this can be changed to other libs).
As I used BlitzBasic before (in fact my old Kame MSX image viewer was Blitz) I can easily figure it. And it's BASIC after all.
So if it works, I'll paste the python code too, and I will use it on my new Kame MSX Image viewer, that now uses python ^_^

Dunno If I'll have time to finish it today, I hope there is no hurry Smile And maybe somebody else is doing the same, anyway? Big smile

Van LeandroCorreia

Paladin (963)

afbeelding van LeandroCorreia

31-03-2019, 16:46

MsxKun wrote:

I'm working on it now, using the pastebin version (thx for the warning, LeandroCorreia)
Translating from Blitz to Python Smile Using PIL library to read the image dots by nowr (this can be changed to other libs).
As I used BlitzBasic before (in fact my old Kame MSX image viewer was Blitz) I can easily figure it. And it's BASIC after all.
So if it works, I'll paste the python code too, and I will use it on my new Kame MSX Image viewer, that now uses python ^_^

Dunno If I'll have time to finish it today, I hope there is no hurry Smile And maybe somebody else is doing the same, anyway? Big smile

Thanks, MSXKun! Smile

Van LeandroCorreia

Paladin (963)

afbeelding van LeandroCorreia

31-03-2019, 16:50

BTW, can anyone give me information on how would be the command BLOAD to load an MSX screen dump and how is the structure of that file, so I can make my routine directly save an MSX screen to disk?

Van Rogerup

Resident (39)

afbeelding van Rogerup

31-03-2019, 17:27

Do you already know the Screen 2 VRAM format ?

If not you can see here: MSX Red Book Graphic Mode
You have to write 2 blocks of 256x192/8 = 2 x 6144 bytes
1 block for the Character Pattern Table
1 block for the Color Table

If you already made that, the second part (bload) will be easy.
If you did not, look at the book, if it's still complicated ask for more info.

Van LeandroCorreia

Paladin (963)

afbeelding van LeandroCorreia

31-03-2019, 17:33

Just that, a raw dump first for the pattern and one for the 2 colors? No extra bytes before to specify the memory entry point?

Van MsxKun

Paragon (1134)

afbeelding van MsxKun

31-03-2019, 18:06

Ok, I got with this. Tell me if it works. It's python 2.7 and uses the PIL library to load/save image (and get the pixel colors of it). Used the Game Over image posted before, cause big reasons Hannibal

https://pastebin.com/P2UNgxgA

It takes 2 minutes to convert on my full of Intel holes i7. After that, my output screen shows something quite similar to examples, but I think it's not exactly 100% the same. Maybe cause float values conversion? Python automatically adjust float stuff and so (afaik).
The program shows the loaded image and, after conversion, the output one. Using PIL. In my linux, it shows them using ImageMagick. Not sure on computers without IM on it, but it's only to see what happens. You can just comment the image.show()
It exports to BMP but could be JPG, BMP and any other format supported by PIL. Same for input file.

Pic with the converter working.

2x size of the output image. Notice how it's different from the examples you posted before.

Edit: Maybe the differences could be cause Python floats are doubles in fact? They have more precision than C (and Blitzbasic?) floats. If that, is that good or bad?

Van MsxKun

Paragon (1134)

afbeelding van MsxKun

31-03-2019, 18:19

@LeandroCorreia

this:

SC2_PAT1 = 0x0000 # patterns
SC2_PAT2 = 0x0800
SC2_PAT3 = 0x1000
SC2_NAM1 = 0x1800 # name table
SC2_NAM2 = 0x1900
SC2_NAM3 = 0x1a00
SPR_ATT = 0x1b00 # sprite attributes
SC2_COL1 = 0x2000 # colors
SC2_COL2 = 0x2800
SC2_COL3 = 0x3000
SPR_PAT = 0x3800 # sprite definitions

For a SC2 file loadable in basic, you know, add 7 extra bytes as header.

Or, more graphic info: Aorante's Blog

Van Rogerup

Resident (39)

afbeelding van Rogerup

31-03-2019, 18:22

LeandroCorreia wrote:

Just that, a raw dump first for the pattern and one for the 2 colors? No extra bytes before to specify the memory entry point?

Now you need the entry point AND a loader. Send me the file of 12288 bytes (2 x 6144) that I will create an Assembly loader for it and see how are the exact bytes you need at the beginning of your files, in order to see it directly with bload "image",r without lines of basic.

e-mail: rogerup at gmail . com

Pagina 3/14
1 | 2 | | 4 | 5 | 6 | 7 | 8