| Mega Man 3's cartridge ROM, counted by part of the game: each stretch of code or data goes to the part the disassembly's labels and comments say it serves, and the value sums the bytes of each part. | 0x10-0x6000f | Code notes |
Mega Man 3's divide_8bit is Mega Man 2's _divide_mod with its zero-page operands one byte lower ($00-$03 for $01-$04). Its 16-bit division is Mega Man 2's _divide_fraction with its RAM moved and two changes: Mega Man 3 saves and restores X around the loop, and stores the low byte of each successful subtraction back in the remainder ($01), where Mega Man 2 writes it to $09, outside its shift chain. | 0x3fcfb-0x3fd61 | Code |
| Doc Robot's Air Man fight in Mega Man 3 uses Air Man's tornado tables from Mega Man 2 byte for byte (155 bytes): the five delays between rounds, then five patterns of six tornadoes each, with their Y and X speeds (whole and fraction) and how long each flies. | 0xa70b-0xa7a5 | Code |
Mega Man 3's sprite CHR banks $00-$01, mapped at sprite tiles $00-$7F throughout play, start from Mega Man 2's first 128 sprite tiles (the disassembly's megaman_capsule_e_tank_bullet_mega_buster.chr): 84 of the 127 non-blank tiles are the same at the same numbers, the longest run tiles $20-$37 (384 bytes). | 0x40210-0x4038f | Code |
| The first 32 tiles of 17 of Mega Man 3's sprite CHR banks ($08, $0A, $0C, $0F, $11, $13, $15, $1D, $20, $24, $26, $27, $2A, $2C, $2E, $32, and $3C) are Mega Man 2's sprite tiles $60-$7F, from the same set as Mega Man's own: 29 of the 32 are the same at the same numbers, the longest run tiles $0B-$1F (336 bytes). | 0x420c0-0x4220f | Code |
Mega Man 3's title screen background tiles (CHR banks $76-$77) are largely Mega Man 2's title set (title.chr, loaded at _load_title_chr), moved a few tile numbers: 102 of their 128 non-blank tiles appear in it, 96 different ones, in runs of up to 16 tiles (256 bytes). | 0x5db10-0x5dc0f | Code |
Mega Man 3's background CHR bank $66, mapped for Wily stage 6, holds 27 of the 31 non-blank tiles of Mega Man 2's third font set (the disassembly's font_3.chr), the longest aligned run 10 tiles (160 bytes). | 0x598c0-0x5995f | Code |
Mega Man 3's sprite CHR bank $3C holds 13 of the 23 non-blank tiles of Mega Man 2's set of Dr. Wily bowing down (the disassembly's dogeza.chr), six of them in a run (96 bytes). | 0x4f210-0x4f26f | Code |
| Mega Man 3's sprite CHR bank $22 holds 17 tiles of Mega Man 2's boss sets, 9 from Wood Man's and 8 from Heat Man's, and bank $21 holds 4 of Crash Man's; the longest run is 9 of Wood Man's tiles (144 bytes). | 0x48b00-0x48b8f | Code |
Mega Man 3's check_new_enemies is the enemy half of Mega Man 2's _find_objects, instruction for instruction, with new RAM and table addresses: both take the screen's left and right edges, then on the side the screen moves toward spawn each placement that comes into range and on the other side move a second cursor past placements left behind. Mega Man 3 drops Mega Man 2's matching walk over a separate item list and the switch to the stage bank around it. The spawn routine each calls starts the same way, skipping a placement already in a slot and taking a free one, and then differs: Mega Man 2 fills the slot from per-type tables in its fixed bank, and Mega Man 3 skips a placement marked defeated and copies the type's properties from bank 0. | 0x35c10-0x35c8f | Code |
| Both games run their sound driver from the NMI, but Mega Man 3's is new code with a new layout. Mega Man 2 keeps the driver and its songs together in bank 12, queues up to 16 tracks, and works out a note's length as a table value times its channel's tempo byte. Mega Man 3 keeps the code in bank 22 and the data in bank 23, reading bank 24 for data addresses from $C000; it takes sound IDs from an eight-entry ring buffer in the fixed bank, and refuses a sound whose priority byte is lower than the one playing. | 0x2c010-0x2c07b | Code |
Both games strobe the controllers and merge each port's two data bits, but Mega Man 3's routine is new code. Mega Man 2's _joy reads one pad after the other and leaves the newly pressed buttons to the frame wait that calls it; Mega Man 3's read_controllers reads both pads in one loop, works out the new presses itself, and clears the d-pad when opposite directions are held together. | 0x3c555-0x3c5ac | Code |
| Both games flag a bank switch in progress and catch up on the frame's sound afterward if the NMI arrived during it, but Mega Man 3's switch is new code for a different board: Mega Man 2 maps one 16 KB bank at $8000 by writing its number to MMC1 one bit at a time, and Mega Man 3 writes two 8 KB banks, at $8000 and $A000, to the MMC3 as whole bytes. | 0x3ff7b-0x3ff9f | Code |
| Both games' NMI handlers copy the sprites by DMA, write the queued screen and palette updates, set the scroll, and run the sound driver, but Mega Man 3's handler is new code. Mega Man 2's offsets the scroll for the Mecha Dragon and puts the sound off when the NMI interrupts a bank switch; Mega Man 3's also loads the MMC3's scanline counter for the frame's split-screen interrupt and picks the interrupt handler for the screen mode. | 0x3c010-0x3c0f6 | Code |
Both games run a stage a frame at a time in step with the NMI, but Mega Man 3's frame loop is new code built on a task scheduler. Mega Man 2's stage loop calls its routines in turn and then spins in _nmi_wait_0e until the NMI sets a flag, reading the pads after it. Mega Man 3 runs up to four tasks, each resumed from its own saved stack pointer; gameplay_frame_loop gives up the CPU for a frame through the scheduler, which reads the controllers only when it resumes task 0. | 0x3feba-0x3ff4b | Code |
Both games move an object each frame by a speed with a fraction and change its Y speed by gravity, but Mega Man 3's movers are new code that Mega Man and the enemies share. Mega Man 2's enemy routine, left undecoded by its disassembly, checks the object's hits, moves it by its Y speed, subtracts gravity from that speed when a flag bit asks for it, moves it by its X speed in the way it faces, and removes it once it leaves the screen; walls and floors are a separate routine, and Mega Man moves with his own code. Mega Man 3's move_vertical_gravity and move_right_collide serve slot 0, the player, and every enemy alike, and run the tile check inside each move, snapping the object to the floor, ceiling, or wall it reaches. | 0x3f68c-0x3f70f | Code |
Both games find the 32-pixel block at a point in the screen's layout and then its 16-pixel quarter, but Mega Man 3's tile check is new code with a new type format. Mega Man 2's _tsa_collision tests one point a call and takes its type from the quarter byte's top two bits, which a per-stage table remaps; Mega Man 3's check_tile_collision tests a list of points from a hitbox table in one call, clamps them to the screen, takes each type from the upper four bits of the tile's entry in a table at $BF00 in the stage bank, and ORs the types together. | 0x3e9f3-0x3eb3f | Code |
Both games' stage selects move a cursor over the bosses' portraits and start the chosen stage, but Mega Man 3's is new code. Mega Man 2's _stage_select blanks a beaten boss's portrait by writing empty tiles to the name table, and on a d-pad press calls _stage_select_set to move the cursor; Mega Man 3 keeps the cursor's column and row apart, moves each by a table offset and ignores a move off its 3 by 3 grid, redraws the six sprites of Mega Man's eyes in the center portrait for the cursor's position, and confirms on A as well as Start. | 0x311fc-0x31325 | Code |
| Mega Man 4's sound bank opens with Mega Man 3's entry jumps, multiply, and sound-data read, at the same addresses; only the two bank numbers the read maps differ: the overflow data bank, $18 in Mega Man 3 and $1D in Mega Man 4, and the data bank it restores, $17 and $1F. | 0x2c010-0x2c07b | Code |
Mega Man 4's per-frame sound tick is Mega Man 3's sound_driver_update, byte for byte at the same address. | 0x2c07c-0x2c10d | Code |
| Mega Man 4's routine that starts a song or an effect, and takes the stop, pause, fade, and transpose commands, is Mega Man 3's, byte for byte at the same address. | 0x2c10e-0x2c261 | Code |
Mega Man 4's sound effect reader is Mega Man 3's (labeled parse_music_data there), byte for byte at the same address. | 0x2c262-0x2c3a2 | Code |
Mega Man 4's music track reader is Mega Man 3's (labeled process_sfx_channel there), byte for byte at the same address, so the two games read the same track format. | 0x2c3a3-0x2c5ed | Code |
| Mega Man 4's note-to-pitch routines are Mega Man 3's, byte for byte at the same address. | 0x2c5ee-0x2c6c9 | Code |
| Mega Man 4's volume envelope and fade code is Mega Man 3's, byte for byte at the same address. | 0x2c6ca-0x2c844 | Code |
| Mega Man 4's code that writes each channel's pitch to the APU, with vibrato, detune, and slides, is Mega Man 3's, byte for byte at the same address. | 0x2c845-0x2c924 | Code |
| Mega Man 4's sound driver tables, through the note period table, are Mega Man 3's at the same addresses; the 37 bytes after it ($8A1B-$8A3F), all zero in Mega Man 3, hold data in Mega Man 4. | 0x2c925-0x2ca4f | Code |
Mega Man 4's controller read, which works out the new presses and cancels opposite directions, is Mega Man 3's read_controllers, byte for byte. | 0x3c555-0x3c5ac | Code |
Mega Man 4's routine that fills a name table and its attributes with one value is Mega Man 3's fill_nametable, byte for byte. | 0x3c5ad-0x3c5f8 | Code |
Mega Man 4's name table buffer flush is Mega Man 3's drain_ppu_buffer, byte for byte (37 bytes). Mega Man 4 follows it with four short routines: two that change PPUCTRL and two that turn rendering off and on. | 0x3c508-0x3c52c | Code |
Mega Man 4's cooperative task scheduler, with its routines to start, kill, and yield tasks, is Mega Man 3's task_scheduler instruction for instruction; it sits 5 bytes lower, and only its jump and call addresses differ. | 0x3feba-0x3ff4b | Code |
Mega Man 4's enemy spawn engine is Mega Man 3's check_new_enemies instruction for instruction, moved from bank 26 at $9C00 to bank 56 at $8000; only the addresses of the stage's placement tables and one zero-page variable ($2E in Mega Man 3, $2F in Mega Man 4) differ. | 0x35c10-0x35c8f | Code |
Mega Man 4's first boss door routine follows Mega Man 3's close_boss_door step for step: the door sound, then four 16x16 blocks of tiles and attributes through the same buffer, one every 4 frames. Mega Man 4 runs it from the fixed bank, with the stage's bank mapped at $A000, and reads the door's addresses and tiles from fixed places in that bank ($B570-$B57B), where Mega Man 3 indexes tables in its door bank by the door's number. | 0x20010-0x200e2 | Code |
Mega Man 4's second boss door routine follows Mega Man 3's open_boss_door the same way, with the same changes: it runs from the fixed bank and reads its door's data from $B57C-$B587 in the stage's bank. | 0x20203-0x202bf | Code |
Mega Man 4's four routines that push an entity out of a wall, ceiling, or floor after a tile hit are Mega Man 3's snap_x_to_wall_right, snap_x_to_wall_left, snap_y_to_ceil, and snap_y_to_floor instruction for instruction; only the addresses of the entity position arrays differ. Mega Man 3 follows them with two calls into its boss door bank, which Mega Man 4 doesn't have there. | 0x3eddb-0x3ee40 | Code |
Mega Man 4's four routines that move an entity by its speed and stop it at a wall, floor, or ceiling follow Mega Man 3's move_right_collide, move_left_collide, move_down_collide, and move_up_collide step for step. Each saves the player's position before the move, checks for a platform, pushes the player off it, and on a push that crosses a screen retries with the opposite side's tile check. Two things changed. Each tile check is one call, where Mega Man 3 calls its tile check and then update_collision_flags. And when the right mover hits a solid tile, Mega Man 4 first copies $45 to $3F for the player, which its disassembly reads as the ground tile type. Two of the screen-crossing tests also test their two flags in the other order, to the same effect. | 0x3f590-0x3f68b | Code |
| 304 bytes of Mega Man 3's default sprite position offsets, $A078-$A1A7 of its bank $19, are byte for byte in Mega Man 4's player animation bank $0C at $97BE-$98ED. They are position sets $08-$17 in both games' pointer tables: sixteen lists of signed Y and X offsets, one pair per tile, 4 to 12 tiles each. | 0x32088-0x321b7 | Code |
| Mega Man 4's routines that move an entity by its speed without checking tiles, and apply gravity, follow Mega Man 3's with the entity arrays moved, and with four changes. Mega Man 4 drops Mega Man 3's routine that sets a behind-the-background flag from the tile hit. Its gravity tests one flag at $43 first, where Mega Man 3 tests for the player and then a flag at $B9. It drops Mega Man 3's exemption, for one animation ($13), from the cap on falling speed. And when gravity resets, it sets one speed ($FF00) for every entity, where Mega Man 3 sets $FFC0 for the player and $FFAB for the rest. | 0x3f710-0x3f844 | Code |
Mega Man 4's 8-bit and 16-bit division routines, used to aim enemies, are Mega Man 3's divide_8bit and its 16-bit version, byte for byte (103 bytes), at $FC14 in its fixed bank where Mega Man 3 has them at $FCEB. | 0x3fcfb-0x3fd61 | Code |
Mega Man 4's four routines after its name table buffer flush, two that reset or set bits of PPUCTRL and two that turn rendering off and on, are Mega Man 3's disable_nmi, dead_code_enable_nmi, rendering_off, and rendering_on instruction for instruction; only the zero-page counter the last two step differs ($EE in Mega Man 3, $EA in Mega Man 4). | 0x3c52d-0x3c554 | Code |
| The first 57 sprite tiles ($00-$38) of the set Mega Man 4 shares across its stages (912 bytes) are byte for byte the first 57 tiles of Mega Man 3's sprite CHR banks $00-$01, the set it maps throughout play. Of the first 128 tiles, 96 are the same at the same numbers. | 0x40010-0x4039f | Code |
| Mega Man 4 has Mega Man 3's 26 letter tiles, A to Z, byte for byte (416 bytes), in its bank 19 at $9800. Mega Man 3 has two copies, in its password screen tiles (after its digits 0 to 9) and in its stage start sprite tiles; Mega Man 4's digits before them differ. | 0x5f0b0-0x5f24f | Code |
| Mega Man 4's bank 20 holds, at $8800-$8FFF, Mega Man 3's 128 title screen background tiles (CHR banks $76-$77), the same in all but two: tiles $20 and $2F, which in Mega Man 4 are plain outlined squares. | 0x5d810-0x5e00f | Code |