It is currently Thu Dec 14, 2017 11:44 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 39 posts ]  Go to page Previous  1, 2, 3
Author Message
PostPosted: Fri May 08, 2015 4:38 am 
Offline

Joined: Sun Jan 26, 2014 9:31 am
Posts: 267
I tested it with 1.0. I can dump BG tiles from SaGa just fine (English version).

Anyway, without hashes, you run into several issues. One of them is that not all of the data comes directly from ROM. A game may compress data (bit-packed fonts for example) and decompress them to RAM, meaning addresses could be arbitrary, and even result in collisions where multiple graphics come from the same few RAM addresses.

Another issue is that the same tile could theoretically exist twice or more in ROM (e.g. copies of a common tile across several memory banks), meaning the emulator would see them as two separate tiles if it does no comparison on the data itself. This would require users to edit the same dump twice (or more) even though visually the tiles are the same.

Lastly, there's tile data that doesn't come from ROM or RAM as direct data, but instead gets generated programatically by the game code (software rendering). If it builds the data one byte at time, it will writing to VRAM from CPU registers. If it builds the whole tile at once, the address will be in RAM, a volatile address.

The point of my approach was to do things in a manner that covered as many bases as possible and would be applicable not only to the GB/GBC but other 2D tile-based systems as well. The problems listed above are only exaggerated on something like the GBA where graphics are commonly decompressed into RAM for example. If you look at VRAM itself, you know exactly what the game is trying to draw. Hash that data sufficiently, and there's no ambiguity or collisions.

I've been meaning to write up the technical theory behind tile replacement via hashing for a while, so that others can implement themselves. I suppose I'll have to finish up the document soon.


Top
 Profile  
 
PostPosted: Fri May 08, 2015 5:48 am 
Offline

Joined: Fri Oct 22, 2010 1:20 am
Posts: 41
I've edited dumped tiles, put them in the load/bg folder, and started up the !load.bat file (after specifying the name of the ROM) but they don't seem to be loading. After the edits didn't show up in-game, I edited the manifest like GGuy said. Still don't show.


Top
 Profile  
 
PostPosted: Fri May 08, 2015 6:02 am 
Offline

Joined: Sun Jan 26, 2014 9:31 am
Posts: 267
What manifest? If you're using the build GGuy made, I can't help you since I haven't used it. If you're talking about the manifest used from the custom-gfx-hd branch, don't use that. It's experimental work intended to handle GBC sprites.

I downloaded the 1.0 tarball from GB Enahnced's Google Code page, compiled that, and was able to dump and load tiles from SaGa. If you're doing anything that's not based on the 1.0 version from the Google Code page, that's likely the cause of the problem.


Top
 Profile  
 
PostPosted: Fri May 08, 2015 6:17 am 
Offline

Joined: Fri Oct 22, 2010 1:20 am
Posts: 41
I went back to the 1.0 version (the binary on Google Code). I dumped the frame tiles at the hero select screen. I opened one of the tiles in MS Paint and colored its interior purple. I saved the file. I copied all the files in the Dump folder to the Load folder. I started with load mode, and now all I get is garbage for both the tiles I dumped and all the sprites.


Top
 Profile  
 
PostPosted: Fri May 08, 2015 6:51 am 
Offline

Joined: Sun Jan 26, 2014 9:31 am
Posts: 267
That's an issue with the format Windows saves their BMPs. You need to save the images as 32-bit ARGB BMPs in 1.0. Older versions of GIMP (2.6 and older as far as I know) did this just fine, but newer ones muck things up. You'll probably have to use an image editor other than MS Paint. Later revisions of GB Enhanced removed 32-bit images because the alpha channel was completely useless, and image editors couldn't agree on how to handle BMPs. Later revisions also added PNG support (loading, not saving).

If you find all of this frustrating, honestly I would encourage you to just wait until GBE+ (https://github.com/shonumi/gbe-plus) comes out. It does away with a lot of things that are complicated about the process of replacing graphics. I really don't know how people like BigHead (http://bhemuhelp.co.nf/other/smlc.html) manage to work with GBE 1.0 as it is, especially since it's command-line only. The process will be much smoother when there's a GUI and all images are expected to 24-bit (seriously, the alpha channel is a pain in the rear, both for the end user and GBE). GBE+ is currently in the phase of integrating GB/GBC support; after that comes a GUI, then reimplementing custom graphics.


Top
 Profile  
 
PostPosted: Fri May 08, 2015 7:23 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19346
Location: NE Indiana, USA (NTSC)
Shonumi wrote:
If you find all of this frustrating, honestly I would encourage you to just wait until GBE+ (https://github.com/shonumi/gbe-plus) comes out.

Is it due out before November?


Top
 Profile  
 
PostPosted: Fri May 08, 2015 7:38 am 
Offline

Joined: Sun Jan 26, 2014 9:31 am
Posts: 267
tepples wrote:
Is it due out before November?


I should hope so. The integration process is mainly about porting over the GB/GBC code and tightening things up. The only areas that require non-trivial reworking are the custom graphics and LCD emulation. Everything else just gets cosmetic work and clean-up. That shouldn't take long. GUI programming (Qt specifically) may take a bit more time, since I have no prior experience with it. I don't expect custom graphics for the GBA to make it into the first point release, but definitely for the GBC.


Top
 Profile  
 
PostPosted: Fri May 08, 2015 8:07 am 
Offline
User avatar

Joined: Fri Jul 18, 2014 4:52 pm
Posts: 24
My unofficial build is the last update of the custom-gfx-hd branch complied for people that don't know how to compile. It works fine for me on most regular GB games. GBC games don't work at all for BGs, and sprites for GBC won't load without using the manifest file.

I remember now some games won't load the BG files for whatever reason no matter what. Not sure why. I will compile all the builds and see what works and what doesn't. The 32-bit BMP problem was a huge hassle so that's why I compiled and used the later revisions myself.

edit: Here is revision ed6790ee337d. I did a quick test and it dumps and loads BG tiles. This is the version before the newer GBC dumping code was added.


Last edited by GGuy on Fri May 08, 2015 8:30 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Fri May 08, 2015 8:29 am 
Offline

Joined: Sun Jan 26, 2014 9:31 am
Posts: 267
Some games won't dump BG tiles (DMG games as well) with the latest custom-gfx-hd revisions either. Plus there are still issues (like the Metroid problem discussed earlier) that I have fixed but have the code to do so. This just means I have to work all that much harder all that much faster :D


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 39 posts ]  Go to page Previous  1, 2, 3

All times are UTC - 7 hours


Who is online

Users browsing this forum: Bing [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group