News: 11 March 2016 - Forum Rules

Author Topic: How to go about tile editing for the PC-Engine?  (Read 2296 times)

extremelyextreme

  • Jr. Member
  • **
  • Posts: 3
    • View Profile
How to go about tile editing for the PC-Engine?
« on: January 04, 2019, 12:42:07 pm »
I want to start rom hacking, and I'm going in the order of the getting started page on the website.  Tile Layer Pro doesn't seem to properly display PC-Engine sprites, whereas YY-CHR supports them, but seems harder to use.  The ROMs I'm trying to use don't display the sprites I'm looking for in 4BBP PCE CG mode or 4BBP PCE SG 16x16 mode.  Am I in over my head trying with the PC-Engine?

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 7412
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: How to go about tile editing for the PC-Engine?
« Reply #1 on: January 04, 2019, 12:57:14 pm »
PCE uses different tile formats for sprites and BG tiles (the only console I've ever seen do that).
I know someone (was it Bongo?) many years ago wrote a PCE plugin for a DOS-based title editor (was it tmod2?), which I think only works on current PCs with DOSBox, and that is all I had seen.

Though given that PCE had a very fast CPU (for an 8-bit console) there's probably a better chance of graphics compression in games as well.
"My watch says 30 chickens" Google, 2018

extremelyextreme

  • Jr. Member
  • **
  • Posts: 3
    • View Profile
Re: How to go about tile editing for the PC-Engine?
« Reply #2 on: January 04, 2019, 02:35:17 pm »
I know someone (was it Bongo?) many years ago wrote a PCE plugin for a DOS-based title editor (was it tmod2?), which I think only works on current PCs with DOSBox, and that is all I had seen.

You were right.  I searched online and found tmod2 with PCE plugins already seemingly installed.  I got it running in DOSBox and the sprites in Doraemon Meikyuu Daisakusen are still, garbled.  I found a similar thread on here and it says to break compression with Mednafen.  That's what I'm going to do next.

dshadoff

  • Full Member
  • ***
  • Posts: 172
    • View Profile
    • Homepage (really old)
Re: How to go about tile editing for the PC-Engine?
« Reply #3 on: January 04, 2019, 07:53:11 pm »
Hi.

That was my plugin (but I didn't write TMOD2).
What game(s) are you looking at ?

Sometimes the tiles aren't so easy to see because the ROM-storage format isn't precisely the same as the VRAM format (I wouldn't call this compression exactly).  For example, if the sprite only uses 4 colors (i.e. 2 bits), but the video processor is set for 4 bits; the video load process would 'unpack' it.


(Note: Fighting Run is (AFAIK) the only game that uses native 2-bit sprite mode.)

You might want to search video memory for the sprite, once it has already loaded, then restart the game, but this time with a watchpoint on the VRAM write.

Dave

extremelyextreme

  • Jr. Member
  • **
  • Posts: 3
    • View Profile
Re: How to go about tile editing for the PC-Engine?
« Reply #4 on: January 06, 2019, 09:09:29 pm »
I was playing Doraemon Meikyuu Daisakusen.  I found those sprites I wanted to edit in video memory, using Mednafen.  They have a title and an address (for example, Doraemon's head is Title 000000c0 and Address 00003000).  Afraid I don't know what a watchpoint is or how overwrite the VRAM write.  I did see "watch address" in the documentation for Mednafen.  I dumped the sprites from Mednafen in debug mode by switching to the memory editor and dumping from the address 0000 to FFF0 in VDC VRAM to a file called dump.bin (dump is a placeholder it could be anything.bin).  At first I couldn't find it but it was in the same folder as the ROM I used to boot Mednafen.  I guess that's the hard part done for now.  I really wanted to edit Doraemon's face, as a mini first project.

dshadoff

  • Full Member
  • ***
  • Posts: 172
    • View Profile
    • Homepage (really old)
Re: How to go about tile editing for the PC-Engine?
« Reply #5 on: January 07, 2019, 01:46:56 am »
A watchpoint (also known in Mednafen as a watch address) is a breakpoint you can set, where the debugger halts execution when a specific part of memory (or I/O) is accessed, instead of just an execution address.  You can set Mednafen to stop as the VRAM is getting loaded from the cartridge.

Which brings us to the second point - if you just look at VRAM, you may not be able to get the desired result.  The VRAM is loaded from the cartridge (on some games, this happens multiple times because VRAM is often in short supply).  If you want Doraemon's head to appear differnetly, you need to alter the source data on the cartridge, not just the VRAM data.

But having found it in VRAM is a big step; from this, you can find the cartridge data by doing one of the following:
1) Set a watchpoint on the VRAM write to that location, examine the loop where it's being loaded, and determine the source location of the data.
- or -
2) Now that you have a dump of the data, see if you can search the source ROM for the same byte sequence.

I'm not sure about tools to do the editing though.

Dave