|
ForumsSega Master System / Mark III / Game GearSG-1000 / SC-3000 / SF-7000 / OMV |
Home - Forums - Games - Scans - Maps - Cheats - Credits Music - Videos - Development - Hacks - Translations - Homebrew |
Author | Message |
---|---|
cactus
|
BmpToTile
Posted: Tue Jan 14, 2003 2:04 am
|
Hi,
I have progress in my wild ambition to program SMS: Now i can load tiles!AND I know how to change palette (thanks maxim)Yhhuu!!! But I have today a question for Maxim and his BMPTOTILE converter: I droped a 96*96 bmp in order to convert it;the program give me 2 files, 1=the tiles 2=the order to re-assemble the tiles Now,how to use this second file.inc ??? I don't know how to put in the source... Thanks again! PS:Maxim I repeat i have great interest in your tutorials for programing sms !!! |
|
|
Posted: Tue Jan 14, 2003 8:52 am |
You know how to include it because it's exactly the same as the way you include the tile data. It depends which options you chose for the second one. "Tile offset" is which tile index you intend to load the tiles at, so the indices will match. "Pad with" will pad the data to 32 columns wide with the byte you give, so you don't have to figure that out yourself. "Use sprite palette" and "In front of sprites" toggle two of the tile status bits in the generated data. Most importantly, "Bytes" will leave out the high byte of each name table entry and you will have to re-insert it in the source. This is only possible if there are no bits set in the high byte, ie. the maximum tile index is less than $100 and no status bits are used. The easiest thing to do is: 1. Uncheck "Bytes" 2. Pad with zeroes (or whatever index your blank tile is) 3. Use this code: ; Set VRAM to write to name table address ld a,$00 out ($bf),a ld a,$78 out ($bf),a ; Output data ; Draw tiles ld hl,TileMap ld c,$be ld b,$00 otir ld b,$20 otir In your case, you have 96x96=144 tiles, needing 288 bytes to be defined; so you need to otir with b set to $00, which will output 256, and then again for the rest. The problem with this is, it is very wasteful of ROM space. So, before figuring out compression, I put in the option to leave out the high bytes, since as long as your tile indices are low, they're all zero. Then I coded a function for drawing such an image without padding, called DrawImageBytes in my graphics.inc. See there for the parameters, and good luck. Speaking of my tutorial, it seems you are maybe exceeding how far I've got with it. However, I've going into a lot of detail so it may still be useful to you. I hope to get the first instalment finished today. Maxim |
|
|
Compression
Posted: Tue Jun 15, 2021 2:56 pm
|
Hi! Finally manage to register here. I'm another newbie self-proclaimed developer. So I started my simple project using Maxim's tutorial, and already I see it's taken too much space for what it is. For slightly bigger game compression of graphics is a must. I understand what Bmp2tile can compress tiles. But somehow, I just can't. The only option it give me is to create <>.inc file. Where do I go wrong? Do I need to download something additional? Help please. | |
|
Posted: Tue Jun 15, 2021 8:03 pm |
In the latest version of Bmp2tile, you have to install the plugins, or it won't support compression. https://github.com/maxim-zhao/bmp2tilecompressors |
|
|
Posted: Wed Jun 16, 2021 7:40 am |
Ok, so I download compressors. And unzip it to Bmp2tile directory and still nothing. The messages field give me something like this:
Discovering compressors Loaded .....\gfxcomp_phantasystar.dll but found no compressors Added 1 compressors What do I do wrong? |
|
|
Posted: Wed Jun 16, 2021 8:41 am |
What versions of bmp2tile and the DLLs are you using? What version of Windows are you using? I suspect it may be a C runtime dependency issue, you can search for “Windows 10 universal C runtime” to download from Microsoft’s website but I think it should be built in for Windows 10. | |
|
Posted: Wed Jun 16, 2021 9:47 am |
I have Windows 7, Bmp2tile 0.5. And about DLLs, sorry I don't know how to see it version. So problem is must be my OS, yeah? Ok, I'll try to search this C runtime. Thanks! |
|
|
Posted: Wed Jun 16, 2021 10:10 am |
did you try with version 0.44? If that works it means you have some issues with .NET | |
|
Posted: Wed Jun 16, 2021 12:30 pm |
Ok, so version 0.44 doesn't even start. ) It tells me my PC miss VCRUNTIME140.dll and also MSVPC140.dll |
|
|
Posted: Wed Jun 16, 2021 1:22 pm |
It means that you need to install "Microsoft Visual C++ 2015 Redistributable". It can be found here: https://support.microsoft.com/en-us/topic/the-latest-supported-visual-c-download... Look for the "Visual Studio 2015, 2017 and 2019" section. Download the installers for "x86: vc_redist.x86.exe" and "x64: vc_redist.x64.exe" (ignore ARM64). Then install both. |
|
|
Posted: Wed Jun 16, 2021 7:43 pm |
Wow, thanks! Now it's working in either 0.44 or 0.5 Bmp2tile. Greatness awaits 😀 |
|
|
Posted: Wed Jun 16, 2021 10:44 pm |
Yeah! 😀 |
|