Summing up/Tutorial on SC4ed so farA document I had like to have when I started workig on my Othercastle SC4 hackAbout me:
When I started with SC4ed I had no Rom-hacking experience at all. I understand English a bit and can type words as you see. As I discovered that there is a Editor of my favorite game I was looking like this
DD did inspire me with his hardmode hack and I wanted to make a similar but easier and better looking hack. I did post some of my early work "SC4 Revisite" on youtube. At the Comments on youtube DD posted a invite to the Castlevania Speedrun Discord. Redguy was there too and did help me a lot to get going at his editor. Big thanks to all the people who helped and keep me motivated
If you have questions or needs for your SC4 project use this forum: http://www.romhacking.net/forum/index.php?topic=24158.0Setup and Hotkeys:
You are able to view the Rom without expanding it. But you can't make changes to it within the editor. Expanding the Rom will not only make more space! It does decompress most of the original 1MB Rom and allocate the data somewhere in the 4MB Expandet ROM. The Rom code pints mostly to the decompressed data. (You will not have to worry about decompression within the editor at all)
-You can decompress in the editor at the File drop-down menu
It is very easy to set up the internal and external Emulator to test your hacking. Keep in mind that you can test changes in the internal emulator and this changes are not saved to the rom till you save the project. This can act as a undo button when you save often. I recommend to backup your Rom and make version numbers just in case something went wrong. Sure you can fix a lot if you know how. But rolling back did save me a view times!
-GreenPlayButton Starts the external Emulator when you set the path in the setting
-The open and save buttons open save to ROM
I did test the save future extensive to backup my project. It is not
suited for that. A level save contains; Tile, Palettes, Tilemap, Event and most of the properties of the current scene.
It is perfect to share levels or update tiles and blocks. It can be used for undo your last actions.. and sure it does backup a lot.
-Keep in mind that new added exit events will not be saved in this format.
-When you load a level save the tiles and blocks are updated. And they are shared over multiple levels. Be careful with what saves you are loadingHotkeys and Scene Editor:
right/left mouse button: Copy/paste blocks in scene editor. Right and hold will let you move the main window.
Middle Mouse Button: Moving selected events around
ESC: Will exit the internal Emulator
Page up/Page down: Forward of backward level select (don't work while in Internal Emulator)
B: go to background layer in the scene (Toggle BG0, BG1)
D: Toggle info bar in the main/Event editor
E: Brings up a beautiful screen with Hex-numbers (now clue what it is so far)
T: Toggle Events Viewing
Space bar: Repeat last(selected) actions in block editor
Arrow Key: Moving the scene/changing selected valuesPalette Editor:
I did not have a good understanding of Palettes till after my release of Othercastle 0.6.1 (I did not touch it at all)
You will find most palettes and there offset to edit with other tools. Great tool works well but there are a view bugs. See bug list!Tileset Editor:
This is a very use-full tool I discovered very late. I did draw this Dracula-Wolf-Head within the editor. You have a drop-down menu to the right to change the tile property; ground,mod,step,slope,spike.. D2??? and D6??? work as background stairs. Did not find anything special on them.
The drop-down on the bottom does sort the tiles by there property
You can import tiles with a external tool and reassign everything and make the proper palettes. Here I started a CV3 example. Not nearly finished and it would be a lot of work.Block Editor
I did draw a lot of new blocks by just using tiles that are already there. Like finding some wood or whatever and start drawing a new block with it.
- You can Copy/paste a block. This is very helpful in many ways. Sometimes you need just a view tiles changed in a existing block. It allows a fast workflow.
You can rearrange the whole block-layout this helps a lot when drawing a huge scene and looking for your blocks you need is not fun. I did sort some of the levels. Feel free to check my hack save a level with sorted blocks. Use them and save time
- Change tiles to your liking here! Apply the right palette for each tile. No NES restriction here! Love it
- Flip/Mirror tiles to your liking the only thing that stops you are mode 7 sections.
- set Layer Priority for each tile!! You decide what is in the foreground by checking this box. Make hidden stairs. Hide Candles. Make a awesome scene with depth!! All possible here!!
- A drop-down menu to keep track of your costume tiles. You can sort them here but you don't need to.Event Editor:
Events will get loaded in Order of the Event number (First entry in Event Editor) Use sort event button to bring your events in Order to load properly. (Keep in mind that hard-coded events may correspond to Event ID and may fail if they have a different number. There is only level 1 where it is a issue as far as i know)
The love and hate of events and properties. This will consume the most time to learn but it pays off since you can make really awesome things with it.
Tip I use candle to find x y position I need to edit properties
Some things I noticed about events assuming a (type, id, subid) format. All number in hex:
- (1,m,n) are mostly (all?) candles.
- (1,m,n) m will be all iteams. OLD//(1,6,n) drop subweapons where the subid determines the type. E.g. n=1A -> dagger.
- (2,15,n) are level ending points. Some levels use custom boss code or other events to trigger the end.
- (2,41,n) are in-levelcamera locks. The level has an initial set of bounds looked up by the level ID and then these events can change the bounds.
- (0,m,n) Enemies
Enemies (type==0) seem to use the match as a bit field: 0x8=set to enable foreground, 0x4=set to only see in new game
I did learn a lot of the events by just selecting/reading them and the events may be a bit different depending in what level/level-type you are in (If you change enemy mask form 0 to 8 he might only appear in hard-mode)
I am sorry I am not ready to back this down yet.Property EditorThe Player/Level section
explains it self a lot. Be aware that some changes to the player section may mess up your internal emulator or Rom. There is also a bug that could reset the player and level section with 0's. It does almost never happens and I could not track it down. For example when you set the timer to 0 in the level section. The player spawns in the background and you will be soft-looked. I did not a lot of testing here.
Tip I used other level-type to get bigger scene to draw on. Be aware that the level-type brings hard-coded stuff to the scene and background. You will have to experiment here! Levels also keep some hard-coded stuff that was in the level. (like disappearing treasure pile in stage 9 remaining on there x y position)Camera lock section
The properties editor has the starting camera lock for a particular entrance. (Camara left,right,top and bottom) Events 2,41,SubID X use X to choose the camera lock (also in properties editor) to change one of the lock directions.
Direction =1(Right or Down),2(Left or Up) "Trigger when Simon moves in this direction"
DirAddr=55a(X direction),55e(Y direction) "Direction off the trigger"
CmpAddr=54a(X position), 54e (Y direction) "Set Compering to X or Y"
CmpValue=x or y value to check current values against "Triggers when Simon moves over coordinate X Y "
StValue=new value to change lock to "Set new Value to where you want the camera lock to go"
StAddr=A0 (left), A2 (right), A4 (top), A6 (bottom) "Set witch Camera lock you want to move"
All of those are work ram address so you can do crazy stuff by comparing and writing anything under $2000 if you are feeling lucky.
Locks usually come in pairs. One to set the new value and one to reset the old value (reverse direction)Exit Section
EventID 15, type 2, Are Exit events. Make subID to the same value you want to edit in the property editor. Make compare to X Y
you want the exit. Choose the right exit trigger.
Even entrances expect you to go from low coordinates to high coordinates and odd entrances expect you to go from high to low.
The game engine has very strange event loading.
It assumes everything should be loaded in order in one direction and if you start looping around it gets confused.
To be exact!! What happens is each level has a hardcoded event direction type in the ROM. You can't edit that with the editor right now, but it's stored a 80:D8A3 and indexed by the level (byte per level). 0,2 are values in the positive direction. 1,3 are backwards. Then the entrance has to come in and flip that value around if it's backwards (odd entrance) so it XORs in 1 so 0->1, 1->0, 2->3, 3->2. So if you want to go backwards with how the original level was designed you need to first understand which the direction stored at 80:D8A3 is and then decided if you need an even (same direction as original level) or odd (reverse of original level).
I forgot what the difference is between 0 and 2 (same with 1 and 3).Outside of the editor:
I did use BSNES Plus and the debugger tools to view VRAM I could change the tile map there but how to change it in the rom!?
Going from memory VRAM to ROM is not simple. You need to know how the game engine decompresses (or copies in the case of an expanded ROM). It's a multistep process. The game references some tables using a pointer. That table encodes a src pointer and dst pointer among other things. A chunk ($400 B?) of the src pointer data is decompressed (copied) to a temporary location in WRAM. And then that is DMA'ed to the destination which may be VRAM.(edited)
Some things like menus and one-time things are hardcoded pointers to their table. Level data (tiles, blocks, scene data, etc) use an indexed array to find the table.
$82:80EA - Address of table decompression routine. X contains offset into bank $81 of table.
$81:8B5D - Address of VRAM data for title screen (konami logo). Format is generally the following for VRAM destinations: AA[BBCCC]...FFFF. AA = type, BB=dstAddr, CCC=srcAddr in ROM. If you look at $81:8B5D you can see that $F4:A3FD is stored in that table. BBCCC repeats until it sees FFFF
$F4:A3FD - Address of table that has decompressed tile map data @ VRAM word address $1000 ($2000 VRAM byte address) for title sreen. The first 3 bytes are information (AAC, A=size, C=header byte which says this is uncompressed data) and everything after is data which is aligned to $F4:A400. Offset in the file is $3A2400.
So you should be able to modify the tile map @ $3A2400. The konami text starts appearing around $3A298E in the ROM(edited)
That is how I was able to edit the Konami Logo Known Bugs:
- Entrance does not work as expected? You may have a missing instruction in you expandet rom. (not sure why it happen to me)
- Level 20 tiles to build level are out of range
- Scene editor sometimes draws when scrolling scene (fix reopen scene editor)(fix restart)
- Level saves do not have all the property values
- Recording a entrance has more values the you could edit (in other words record and then change position)
- You can force issues by using hard-coded events in a different level with the same level-type. (Sometime it works surprisingly well)
Most bugs I had been not understanding how it works..
Great tool 5/5 Stars