Manic 40 Miner Editor Versions to date Version 0 Original Version 1 * revisions I added a piece of code just before I assembled the code and then placed the code on this web site. The code that I added was a bypass of the cheat code. The additional code was added so that it was possible to find and use the editor, without knowing what the cheat code was. Unfortunately that addition has made the editor (see the key combination Z H O) unable to remove the cheat code. Version 2 * revisions. The program has been modified to include (Item/key) editing Version 3 * revisions. 1) moving the start position and start animation frame in a room 2) Moving the position of the portals Version 4 * revisions. 1) removal of Kong switch Bug (in game) 2) removal of score Glitch (in game) 3) A lot of small changes 4) The addition of editor Mode 5 mode 5 permits altering a sprites room definition Version 5 * revisions. 1) defining a sprites room colour 2) removed fixed colour on Kong - Still Red it it falls (in game) Version 6 * revisions. 1) Change in item/object/key collection sound. (in game) 2) change in general sound effects. (in game) 3) Change in order of modes- they now cycle as defined. Before they cycled as they were added. - Which was not the same order. 4) defining a sprite as 4 phase or 8 phase. Only needed on Horizontal sprites (in mode 5) 5) Improved cursor flash. 6) Speeded up the draw routine. 7) more consistency in speed between draw a block and move cursor. Version 7 – not written. * revisions 1) fix the known bug in v6 and maybe earlier versions I have discovered a problem with Pasmo doing calculations wrong. e.g. Pasmo can calculate a-b differently to -b+a. Considering the thousands of lines of code I have written. A strange problem to crop up. 1a) possible crash on reset in editor via ZHO. (see above comment) The following explanation below is for V6 (Version 6) ========================================================================== I will start with a WARNING. If the programme file is edited so that the first room is unplayable. Then going back to the title screen can cause a lockout of the editor. The room needs to be drawn and the first loop of the game passed before the keyboard is scanned for both the cheat code, the cheat type in, and all the editor keys. If the sprites are set to start with a collision on the first room or Willy started over any Nasty graphic. Then death will occur before any other action can take place. This means that further editing and even game play can not proceed. If the start of any other room causes instant death then the editor is still reachable via any other room, and the problem area can be changed via editing. (hopefully) It is the first room that can remove access to editing and for that reason editing the first room needs more care than any other room. ========================================================================== At present the game starts with cheat enabled and this limited editor in memory. It allows normal game play with cheat, and the ability to jump into this limited Editor. The editor does have the ability to delete/encrypt itself and then turn the cheat and editor references off. When that is done, it is still possible to type in the cheat code and again use the cheat. The editor and all its function will however not be available. Manic 40 Miner - Editor While playing the game. When the game is played and the boot is shown on the lower portion of the screen. Beneath the cheat boot is the active room number. Active keyboard keys for cheat. the "3" key is the cheat activator 3 - Reset the room to its start position 3 Plus 1 - Move back a room. Wrap around to 40 if on room 1 3 Plus 2 - Move forward a room. Wrap around to 1 if on room 40 3 Plus 0 - Activate the Editor (If available) Pressing the keyboard keys three and zero at the same time will enter into a limited editor. Provided the editor is still in memory ========================================================================= From here onwards keyboard keys described are for the environment of editing the game ========================================================================= There are a great deal of keyboard keys active. And remember that this also has the data for 40 rooms. The memory restriction placed on me due to the extra rooms, has forced convoluted keyboard key usage. In all modes (keyboard keys operational in mode 1, mode 2, mode 3, mode 4, mode 5) L - Toggle between the graphic room display and the hex room display modes J - Toggle full screen display If in graphic room display mode - (switch Items/key, portals and sprites) on/off - (switch graphic trails) on/off If in hex room display mode - (switch full hex) - on/off M - Toggle between the five screen edit modes mode 1) room tiles (define tile colours) mode 2) global tiles (define which tiles to use) (room tiles and edit tile) (define item/key graphic) mode 3) edit tile (edit a tile definition) mode 4) edit room (define where the platforms are in a room) (define Willie-s start position/face direction/phase) (define the Portal-s start position) (define the position of keys) mode 5) edit sprites (identify sprite allocation) (change a sprite definition for the current room) (change a sprite colour for the current room) (for horizontal sprites change the number of animation phases) R - Move the cursor left - wraps on left edge T - Move the cursor right - wraps on right edge U - Move the cursor up - stops on the top H - Move the cursor down - stops on the bottom Q - Move to previous room W - Move to next room - exit room editor and resume play NOTE the purpose of allowing Graphic trails by switching the sprites on. Is so the user can see where the sprites move in any room. This enables the user to keep the rooms graphics out of their paths. ================================================= Room edit for mode 1 which is room tiles (define tile colours) mode 1 room tiles. These are displayed in the lower left part of the screen There are 16 tiles, each tile is displayed as follows line 0 - The graphic as defined for the room. line 1 - The paper colour of the tile line 1 - can also have a dot displayed in the paper colour A dot indicates bright is set line 2 - The ink colour of the tile line 2 - can also have a dot displayed in the ink colour A dot indicates that flash is set line 3 - A hex digit signifying what key is designated to what graphic A room is built from these 16 tiles The cursor when moved will jump across the gaps between the upper eight tiles and the lower eight tiles. Whilst it moves it will stay illuminating the hex digits for the tile. The only method of changing the selection is via the cursor move keyboard keys. [R-T-H-U] Active keyboard keys for room tiles in addition to the global keyboard keys (additional mode 1 keyboard keys) These keys affect the tile that corresponds to the cursor position. I - change the Ink P - change the Paper B - change the Bright - Note the dot - indicating bright F - change the Flash - Note the dot - indicating Flash all changes to the tiles will be seen instantly in the playing area ================================================= Room edit mode 2 which is for Global tiles (define which tiles to use in (room tiles and edit tile)) Mode 2 Global tiles. These are displayed on the lower right of the screen. 8 rows of 16 tiles in yellow. allowing access to 128 tiles The space for tiles is shared with the space for portals. The ability of expand past 128 is not included There exists a big block of empty shared memory for the portals and the tiles. To move the cursor around the Global tiles use the keyboard cursor keys. [R-T-H-U]. It will be evident that the tile graphic under the cursor is displayed next to the room tiles. (middle lower left of the screen) The tile under the cursor can be selected as a room tile. Just by pressing one of the keyboard keys representing one of the 16 room tiles. (0123456789ABCDEF) E.g. pressing "1" will transfer that selection into position "1" of the room tiles. The graphic is copied into the room and also if the room has those graphics displayed then the room graphics will also be updated instantly. *** Note *** transferring graphics into the room tile graphics does not affect any tiles colour. They are defined only via the room tile editor. Since the transfer of graphics is instantaneous, it pays to just mess around transferring graphics into the room tiles. The graphics can then be judged in situ. Active keyboard keys for Global tiles in addition to the global keyboard keys (additional mode 2 keyboard keys) 0 - copy current tile into graphic slot 0 - Background 1 - copy current tile into graphic slot 1 - Floor 2 - copy current tile into graphic slot 2 - Collapse 3 - copy current tile into graphic slot 3 - Wall 4 - copy current tile into graphic slot 4 - Conveyor (moving from right to left) 5 - copy current tile into graphic slot 5 - Nasty 1 6 - copy current tile into graphic slot 6 - Nasty 2 7 - copy current tile into graphic slot 7 - Switch 8 - copy current tile into graphic slot 8 - Conveyor (moving from left to right) 9 - copy current tile into graphic slot 9 A - copy current tile into graphic slot A B - copy current tile into graphic slot B C - copy current tile into graphic slot C D - copy current tile into graphic slot D E - copy current tile into graphic slot E F - copy current tile into graphic slot F - Ignore tile (continuation of mode 2 keyboard keys) When the main screen is displaying the flashing keys e.g. when you can see the Items/keys flashing K - copy the current tile into the Item/Key graphic A note on the ignore tile (tile F). All tiles can be walked on. Manic Miner and Jet Set Willy treat any tile that is found under Willies feet as a tile that can be walked on. It treats collapsing floors as a special case, but everything thing else can be walked on. Walking on nasties will still kill you. Tile "F" is specifically checked for and deliberately ignored as a tile. What this means is that all tiles with the same colour as tile "F" can not be jumped on or walked on. This does not permit the ignore tile, if it contains graphics, to be placed in the path of a sprite. That will still flag a sprite collision and result in the demise of Willy. A note on on Switch tiles (Tile 7). The switch tile is checked only when a Kong sprite is defined in a room. In any room that does not have Kong, this tile will act as a normal walk on tile. =============================================== Room edit mode 3 which is for editing tiles (edit a tile definition) Mode 3 edit tile. This is where the cursor is flashing on the graphic for the last tile that was under the cursor in Global tiles. The cursor can be moved around - space will toggle a bit on/off/on etc... ***** NOTE **** all editing will affect all the graphics seen on the screen. If you are editing a tile, then if the tile is a graphic used in the room then you will see the rooms graphics changing as a result. ***** TIP ***** do not leave the sprite trails on while doing this. It is very distracting. If shift is pressed whilst moving the cursor then the tile definition will scroll. active keyboard keys for edit tile in addition to the global keyboard keys (additional mode 3 keyboard keys) space - Toggle the bit on/off/on et shift + cursor = scroll the tile Addendum In modes 1,2,3,4 - not mode 5 There is numeric data displayed in blue in this area. Top line first digit pair is the Y offset of the cursor in the mode displayed. Top line second digit pair is the X offset of the cursor in the mode displayed. Middle line (central) is a digit pair displaying the number of the current room. Lower line is a triple digit display, showing the LS of the offset from the top left of the mode displayed. (displayed in decimal and not hex for reasons of code space only) ============================================= Room edit mode 4 which is for editing the room layout (define where the platforms etc.. are in a room) Mode 4 edit the room layout- Which is the top two thirds of the screen. The cursor can be moved around over the hex or graphic data. ***** TIP ***** do not leave the sprite trails on while editing tiles. It is very distracting. pressing any of the hexadecimal/alphanumeric 0123456789abcdef on the keyboard will place that tile on the screen at the cursor position. Because nearly all keyboard keys are active. And the keyboard scan has problems reacting to multiple keys. I added the ability to lock a selection onto the keyboard space key. If a long platform is needed in say type 4 conveyors then press four on the keyboard to start the drawing off and then use the keyboard cursor keys [R-T-U-H] along with the keyboard space key to move and deposit conveyors. active keyboard keys for edit room in addition to the global keyboard keys (additional mode 4 keyboard keys) 0 - place tile 0 at cursor location 1 - place tile 1 at cursor location 2 - place tile 2 at cursor location 3 - place tile 3 at cursor location 4 - place tile 4 at cursor location 5 - place tile 5 at cursor location 6 - place tile 6 at cursor location 7 - place tile 7 at cursor location 8 - place tile 8 at cursor location 9 - place tile 9 at cursor location A - place tile A at cursor location B - place tile B at cursor location C - place tile C at cursor location D - place tile D at cursor location E - place tile E at cursor location F - place tile F at cursor location space - place last tile selected (additional mode 4 keyboard keys) When the main screen is displaying Willy the portal and the keys e.g. when you can see the Item/keys flashing K - Place an Item/Key in the current position if no item/key available - request is ignored if an Item/key is already at this position - the item/key will be deleted (additional mode 4 keyboard keys) When the main screen is displaying the start position of Willy and the portal e.g. when you can see Willy and the Portal P - Move the portal to this position. only legal screen positions are allowed for the portal N - Move Willies start position. If already at this position then cycle through the frames and reverse. ===================================================== Room edit mode 5 which is for room sprites (define room sprites) mode 5 used to edit sprites When in this mode the graphic that is normally displayed just left of the centre on the lower portion of the screen changes colour. It will change from the normal black and white with blue underlying text to one of four sets of colours. In all cases the text that is normally present in this area is hidden The graphic depicted will be a “+”(plus sign) a “-”(Minus sign) or "5"(FIVE) - indicating mode 5– 1) Red graphic - sprite changing not allowed. Displaying a graphic "5" This is normally seen when in hex mode or graphic trail mode. 2) Yellow Graphic - sprite changing is allowed - displaying "+" or "-" This is seen when static sprites are displayed 3) Black background - Any Horizontal sprite changed. Will be set to 4 phase animation 4) Blue Background - Any horizontal sprite changed. Will be set to 8 Phase animation There will be no screen cursor. The "+" or "-" symbol shown is indicating the direction that sprite/guardian graphics will be changed. If showing a "5" it will be in red and no sprite changes can take place. Pressing the letter "S" will toggle the "+" to "-" or toggle the "-" to "+" when either of those symbols is visible Pressing the keyboard letter -P- will toggle the background colour. This is a visual marker. What follows below is when the sign indicated is "+" or "-" and is in yellow. Each room has eight sprites slots. And a Guardian/sprite can occupy any of the eight slots. Pressing the digits "12345678" will flash any active sprites colours, if it is in the sprite slot indicated by that digit. This is used to identify which sprite is in which sprite/Guardian slot. A number if when pressed, gives no visual feedback indication on the screen is indicating that that sprite/guardian slot is not used. Having identified a sprite/Guardian, we can change the sprite/guardian by pressing the shift key and the corresponding number for that sprite. The direction of change is defined by the "+" or "-" seen on the screen When a sprite is changed, the page that is used for the definition is stepped either upwards or downward in value. If the sprite is defined and moves in a horizontal fashion then the original Manic Miner game engine assumed the sprite was either an eight phase sprite or a four phase sprite. Now. In conjunction with the [marker] which is either a black background or blue background. We can set either an eight phase sprite or a 4 phase sprite. For all other types of sprite, the marker has no action. If a black background marker is seen - then 4 phase horizontal sprites are set If a blue background marker can be seen - then 8 phase horizontal sprites are set This very limited editor:- Gives no help making sure that horizontal sprites are placed in horizontal definitions. Does not check if 8 phase or 4 phase Gives no help making sure that vertical sprites are place in vertical definitions. Does not check for boundary limits and thus on where the data is taken from. This means we scan the full 32 pages, and pages not defined are presented as undefined sprites. We can force a sprites colour We can force animation limits on horizontal sprites - 8 phase or 4 phase Active keyboard keys for sprite edit in addition to the global keyboard keys S - Change the sign and direction of change P - Change the phase marker for 8/4 phase horizontal animation black background marker - set 4 phase horizontal sprites Blue background Marker - set 8 phase horizontal sprites Any horizontal guardian/sprite that is changed will have its phase set. (as above) When Sign is Yellow 1 - Identify sprite slot 1 2 - Identify sprite slot 2 3 - Identify sprite slot 3 4 - Identify sprite slot 4 5 - Identify sprite slot 5 6 - Identify sprite slot 6 7 - Identify sprite slot 7 8 - Identify sprite slot 8 Direction of sprite change is indicated by the “+” or “-” sign shift +1 - Change sprite in slot 1 shift +2 - Change sprite in slot 2 shift +3 - Change sprite in slot 3 shift +4 - Change sprite in slot 4 shift +5 - Change sprite in slot 5 shift +6 - Change sprite in slot 6 shift +7 - Change sprite in slot 7 shift +8 - Change sprite in slot 8 Pressing a number will up cycle the sprites colour. Used to identify a sprite slot. If the "C" key is held down then the colour is stored. The border will also change colour to match the sprites colour. C +1 - Set colour of sprite in slot 1 C +2 - Set colour of sprite in slot 2 C +3 - Set colour of sprite in slot 3 C +4 - Set colour of sprite in slot 4 C +5 - Set colour of sprite in slot 5 C +6 - Set colour of sprite in slot 6 C +7 - Set colour of sprite in slot 7 C +8 - Set colour of sprite in slot 8 Method to use... Find a sprite/guardian slot with keys 1 to 8, When the sprite that needs its colour changed is found, hold down the keyboard "C" key and tap the number that corresponds to that sprite slot. The border and the sprite will up cycle colour. The colour remembered for the sprite is the border colour while up cycling and the keyboard "C" key was pressed. Subsequent changes of colour are ignored if the keyboard "C" key is not held down. This changes only one sprite's colour at a time. Not a logical or easy set of operations to follow - (the best I can do in the space I have) ===================================================== This is a global keyboard key press that changes everything (available in all modes -- e.g. mode 1, mode 2, mode 3, mode 4, mode 5) While in the editor... Holding Z H and O will result in a block slowly moving across the screen. ( on a red screen this might not be noticeable) The amount of time it takes to fully activate, is deliberate. Once done all the code for the editor is deleted. The game will be put back into a standard uneditable game, without cheat activated. If this is aborted part way through the screen might need refreshing by pressing any key that updates the screen. ==================================================== Tiles The storage of the tiles was made as simple as possible. This was to enable editing from any hex editor. The rooms have no compression and are very simple to edit. The colour of each tile defines what action is taken by the game. If a tile is defined with multiple tiles in the same colour it will exhibit normal Manic Miner duplication of actions. Tile "0" is the background. Tile "1" is the standard floor tile. (can be walked on) Tile "2" is the crumbling floor tile. (can be walked on but crumbles) Tile "3" is Wall tile. (Blocks movement through it) Tiles "4" and tile "8" are conveyors in the opposite directions. The tiles are scanned on building the room to display. The positions of the conveyors are noted and copied into a list. This list has a finite size. Any more than the maximum number of conveyors will just be ignored. This means they will still be conveyors- but not animated. Tile "5" is Nasty 1 (kills if touched) Tile "6" is Nasty 2 (kills if touched) Tile "7" (the switch tile) is also tracked when a room is built. The first two switches found in the room (scanning from the top left) are the active switches for Kong. They can be placed anywhere in the room, or even omitted. Tile "9" Free to use. Tile "A" Free to use. Tile "B" Free to use. Tile "C" Free to use. Tile "D" Free to use. Tile "E" Free to use. Tile "F" (ignore tile) is specifically checked for and deliberately ignored as a tile. What this means is that all tiles with the same colour as tile "F" can not be jumped or walked on. This does not permit the ignore tile, if it contains graphics, to be placed in the path of a sprite. That will still flag a sprite collision and result in the demise of Willy. ===================================================================== Room events Editing these is not undertaken in this editor Skylab 1) Can descend or ascend 2) They can step left or right after each ascent/descent 3) The sound of crashes are selectable from a list of four 4) They can animate or stay static Light beams 1) standard light beam - down and left 2) left light beam switching on and off - down and right 3) moving light beam - down and left switching periodically to down and right 4) Light beams can be mixed and can be used in any room. Kong 1) Kong's switches can be anywhere in a room 2) the order the switches are pressed is unimportant 3) Kong can be anywhere in a room 4) Kong's distance if Fall is definable 5) The wall opening is part definable 6) It still has a fixed sprite that can pass through a fixed opening. Eugene 1) Eugene can be placed anywhere 2) Range definable Sprites/guardians 1) any type of guardian/sprite can occupy any rooms sprite/guardian slot this means you can/could have eight verticals or eight horizontals in any room 2) any type of guardian/sprite can be mixed with any other 3) Eugene is a guardian/sprite and not a room event 4) Skylabs are a guardian/sprite and not a room event 5) Kong is a guardian/sprite and not a room event ===================================================================== The edit function was added as a mess around. Its purpose (to me) was to see how much code it would take to add an edit function. I ran out of space and the amount of code needed to expand the scope of editing is not available with 40 rooms as well. Below details the edit options that are only part undertaken or not at all. PORTALS - only the placement of portals SPRITES - only defining horizontal phase and basic definition change ROOM NAME - no editing