Zeldix Magic

Page 6 of 9 Previous  1, 2, 3, 4, 5, 6, 7, 8, 9  Next

View previous topic View next topic Go down

Re: Zeldix Magic

Post by Trovsky on Tue 24 Jan 2017 - 22:01

wizzrobemaster wrote:Will I be able to rename the title on this new program. I had trouble renaming the opening with HM.

My advise to you is to go with the flow. I'd rather not be bombarded with questions inside and outside this thread about Zeldix Magic. Users in the past had issues with your questions because of the amount, so I recommend limiting them. Smile

My personal repo can now display the palettes in little boxes. Currently, I'm fixing graphics and palette issues. After this, I'll handle inserting graphics from BMPs.

Trovsky
    
    

Since : 2014-04-10

Back to top Go down

Re: Zeldix Magic

Post by Trovsky on Wed 25 Jan 2017 - 23:06



Anyone care to provide information on palette data pointers and locations? I plan on allowing the user to change palettes (and modify them) while using the graphics window. One issue that will come up is that a the palette may be modified after an image has been exported. This will prove problematic once the image is imported, how do I tell which bitmap colors are correlated to what palettes values?

Special thanks to Superskuj for providing documentation that helped me out.

Trovsky
    
    

Since : 2014-04-10

Back to top Go down

Re: Zeldix Magic

Post by qwertymodo on Wed 25 Jan 2017 - 23:46

Use indexed images for import/export.  .png and .bmp both support 4-bit (16-color) indexed formats.

https://en.wikipedia.org/wiki/Indexed_color#Image_file_formats_supporting_indexed_color
avatar
qwertymodo
                             
                             

Since : 2014-10-21

Back to top Go down

Re: Zeldix Magic

Post by Trovsky on Sat 28 Jan 2017 - 18:27

qwertymodo wrote:Use indexed images for import/export.  .png and .bmp both support 4-bit (16-color) indexed formats.

https://en.wikipedia.org/wiki/Indexed_color#Image_file_formats_supporting_indexed_color

I'm working with C#'s bitmap packages that are a pain to deal with. For example, the Bitmap's indexed palette entries cannot be modified directly, so I have to copy the entries in another object and then I can modify the values. I then set the bitmap's palette reference to the object. Why there's permission protection when the values can be modified anyway is beyond me. https://stackoverflow.com/questions/5627018/cant-set-palette-in-bitmap

In any case, the values that I set the copied palette object give me an error. It doesn't seem to be agreeing with the Bitmap class when copied over, even 0x00 values give an error work. This is useful in exporting I guess. I'll have to invest more time to see how to manage how to read indexed Bitmaps.


Trovsky
    
    

Since : 2014-04-10

Back to top Go down

Re: Zeldix Magic

Post by Trovsky on Mon 30 Jan 2017 - 18:06

Well Microsoft's Bitmap class is dumb. You cannot write to a Bitmap in memory if it's indexed and converting a non-indexed bitmap to an indexed Bitmap results in an color table that's out of order for me. I am considering on making my own Bitmap class for indexed images. Perhaps C++ is best for here? The thing is that I don't know C++.

Trovsky
    
    

Since : 2014-04-10

Back to top Go down

Re: Zeldix Magic

Post by qwertymodo on Mon 30 Jan 2017 - 18:12

Reading around a bit online, it sounds like the way to do it is to load the image into a System.Drawing.Image object instead of trying to directly work with a Bitmap object, then you can modify the palette, and when you want to save it, convert it to a System.Drawing.Bitmap at that point.
avatar
qwertymodo
                             
                             

Since : 2014-10-21

Back to top Go down

Re: Zeldix Magic

Post by Trovsky on Mon 30 Jan 2017 - 18:37

qwertymodo wrote:Reading around a bit online, it sounds like the way to do it is to load the image into a System.Drawing.Image object instead of trying to directly work with a Bitmap object, then you can modify the palette, and when you want to save it, convert it to a System.Drawing.Bitmap at that point.

Cool, I can already modify the palette, but thank you for telling me anyway. The current issue is that converting an unindexed Bitmap to an Indexed bitmap results in the Colors getting messed up. I can modify the palette table just fine, but a changing the palette table messes up the colors for each pixel. I cannot modify pixels in the Bitmap class for indexed images. In the case of Link, I get a pink Link when changing the color table.

Trovsky
    
    

Since : 2014-04-10

Back to top Go down

Re: Zeldix Magic

Post by qwertymodo on Mon 30 Jan 2017 - 18:41

Yeah, that's why I was saying work only with indexed bitmaps, trying to do the RGB->indexed conversion in anything even remotely resembling an automated fashion is just asking for trouble.
avatar
qwertymodo
                             
                             

Since : 2014-10-21

Back to top Go down

Re: Zeldix Magic

Post by Trovsky on Mon 30 Jan 2017 - 22:44

qwertymodo wrote:Reading around a bit online, it sounds like the way to do it is to load the image into a System.Drawing.Image object instead of trying to directly work with a Bitmap object, then you can modify the palette, and when you want to save it, convert it to a System.Drawing.Bitmap at that point.

Cool, I can already modify the palette, but thank you for telling me anyway. The current issue is that converting an unindexed Bitmap to an Indexed bitmap results in the Colors getting messed up. I can modify the palette table just fine, but a changing the palette table messes up the colors for each pixel. I cannot modify pixels in the Bitmap class for indexed images. In the case of Link, I get a pink Link when changing the color table.

My best choice at this point is to create an indexed BMP file and write to it using a stream writer.

Trovsky
    
    

Since : 2014-04-10

Back to top Go down

Re: Zeldix Magic

Post by Trovsky on Thu 2 Feb 2017 - 15:03

I'm quite busy as of lately so no progress. In other news, zarby seems to have made a lot of progress with an overworld viewer:


Trovsky
    
    

Since : 2014-04-10

Back to top Go down

Re: Zeldix Magic

Post by Puzzledude on Thu 2 Feb 2017 - 15:21

Nice, good to see talented people at work.

Puzzledude
   
   

Since : 2012-06-20

Back to top Go down

Re: Zeldix Magic

Post by wizzrobemaster on Thu 2 Feb 2017 - 19:59

For a moment i thought I was able to click on the arrow keys that were posted. I used the blood colored water for the LW.

wizzrobemaster
Rank: Blacksmith
Rank: Blacksmith

Since : 2015-01-04

Back to top Go down

Re: Zeldix Magic

Post by zarby89 on Thu 2 Feb 2017 - 23:54



maps are loading 100% correctly now i just need the palettes Smile i'll fully documentate it once im done with that and some extra like sprites, items

zarby89
Rank: Bee
Rank: Bee

Since : 2016-10-30

Back to top Go down

Re: Zeldix Magic

Post by wizzrobemaster on Fri 3 Feb 2017 - 0:19

It seems to be making progress which is good.


Last edited by wizzrobemaster on Mon 6 Feb 2017 - 6:48; edited 1 time in total

wizzrobemaster
Rank: Blacksmith
Rank: Blacksmith

Since : 2015-01-04

Back to top Go down

Re: Zeldix Magic

Post by Trovsky on Sun 5 Feb 2017 - 22:03

I decided on making my own 8-bit indexed bitmap class to allow easy palette changing. Zarby, is your overworld viewer on your github? It would be nice if I could see it, so I can make the code compatible. And to the followers, yes, I am still busy with real life stuff.

Trovsky
    
    

Since : 2014-04-10

Back to top Go down

Re: Zeldix Magic

Post by zarby89 on Mon 6 Feb 2017 - 15:21

i am rewriting it because it super slow and very incomprehensible it not on github right now it will be probably when i'll have a stable clear code Wink

zarby89
Rank: Bee
Rank: Bee

Since : 2016-10-30

Back to top Go down

Re: Zeldix Magic

Post by Trovsky on Tue 7 Feb 2017 - 20:59

zarby89 wrote:i am rewriting it because it super slow and very incomprehensible it not on github right now it will be probably when i'll have a stable clear code Wink

A thing I didn't tell you in a PM, I have an unfinished class that's supposed to be it's own bitmap class. As of now, it just sets up the file to to be written to but has no code to write to the bitmap. Also the class has code that modifies the canvas size of the bitmap but fails to do it right. The index palette is set to Link's green tunic palette but you can modify that easily with the Bitmap class. To check the code in action, just use the export function in the graphics viewer. Do you want me to post this on github? I'm too busy to finish it, but it should be helpful.

All that needs to be done is to code the canvas size input correctly and to add the bitmap data, it just needs to be added to the end of the file.

Trovsky
    
    

Since : 2014-04-10

Back to top Go down

Re: Zeldix Magic

Post by Trovsky on Fri 10 Feb 2017 - 18:50

With the recent git commit there's also added code that attempts to move the room pointers for the dungeons. I used puzzledude's docs, but something went wrong.

https://github.com/trovsky/Zeldix-Magic/blob/master/Zeldix/Classes/Dungeon.cs

The code allows the user to input an address to move the pointers the primary pointers point to. The place must contain data that contains the the same byte values, such as all $FF.

Whenever the data is moved, the dungeons get messed up.

Trovsky
    
    

Since : 2014-04-10

Back to top Go down

Re: Zeldix Magic

Post by Puzzledude on Fri 10 Feb 2017 - 19:16

The code allows the user to input an address to move the pointers the primary pointers point to. The place must contain data that contains the the same byte values, such as all $FF.
Not sure what went wrong as I moved the data a lot of times.

Some facts: you need to change all 4 primary pointers and 2 for some reason must be a +1 value. This will now point to secondary pointers, so at the new location, for instance 1F8000 instead of 0F8000, you need to write secondary pointers (in this case a copy paste from ALTTP). You thus move socondary pointers, while the data for rooms remains (for instance).

This basically means only the primary pointers must be in place, the secondary pointers and the data can move anywhere.

I can show you how to do this manually in hex, so you can then tell the program how to do it automated.

Puzzledude
   
   

Since : 2012-06-20

Back to top Go down

Re: Zeldix Magic

Post by Trovsky on Sat 11 Feb 2017 - 20:49

It was due to a logical error (I had to change a "<" to "<=") so one primary pointer was not being changed. The program can now repoint room and sprite pointers (I haven't verified that the sprites repoint correctly). I will add support to Conn's sprite patch next.

I'm currently waiting on Zarby to finish his overworld viewer and indexed bitmap editor. Note to zarby, you might want to have the metatiles stored as multiple bitmaps, instead of merging it into a larger bitmap. If you need any help, just provide me the source. Smile

Trovsky
    
    

Since : 2014-04-10

Back to top Go down

Re: Zeldix Magic

Post by zarby89 on Sun 12 Feb 2017 - 0:17

Sorry i am very busy these days Sad , i can give you the source if you want it but it really messy and it using gfx already extracted not directly from the rom and it would be easier to remake it completly (what i was suposed to do) but i don't have time to spend on it unfortunately the code is super small at least like less than 300 lines without the decompressing code

REMOVED LINK TO ROM

it require the rom in the executable folder named "alttp.sfc", i've included the gfx file




Last edited by Trovsky on Sun 12 Feb 2017 - 15:21; edited 1 time in total (Reason for editing : removed link that includes rom)

zarby89
Rank: Bee
Rank: Bee

Since : 2016-10-30

Back to top Go down

Re: Zeldix Magic

Post by Trovsky on Sun 12 Feb 2017 - 15:14

I appreciate your honesty zarby89. I'm glad you are being transparent with the source code while knowing it's a bit messy. This shows a lot in a person. Very Happy

Trovsky
    
    

Since : 2014-04-10

Back to top Go down

Re: Zeldix Magic

Post by Trovsky on Sun 12 Feb 2017 - 15:22

I had to remove your download because it includes a rom, try reuploading sometime.

Trovsky
    
    

Since : 2014-04-10

Back to top Go down

Re: Zeldix Magic

Post by Trovsky on Tue 14 Feb 2017 - 0:47

New update:

Implemented zarby's decompresser so it outputs something (because I messed up the code). I have yet to make it output bitmaps.

The graphics viewer got a major GUI update. Scrollbar and mouse wheel support has been added.

Trovsky
    
    

Since : 2014-04-10

Back to top Go down

Re: Zeldix Magic

Post by Trovsky on Sun 19 Feb 2017 - 13:35

Still busy, but here's a minor update:

  • You can now switch between palettes for the font (2BPP) and Link graphics (4BPP). The code here is a bit messy, but it will do for now.
  • You can now jump to significant sections in the graphic viewer via three buttons
  • Tabs at the top of the main window are more organized

Sooner or later, I'll write get writing code for indexed bitmaps. It's not that hard to do in theory actually.

I must ask you all, how do you feel about these minor updates? I just like to keep you all informed. Should I only announce major comits?

Trovsky
    
    

Since : 2014-04-10

Back to top Go down

Page 6 of 9 Previous  1, 2, 3, 4, 5, 6, 7, 8, 9  Next

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum