User Tools

Site Tools


super:data_maps:rom_map:bank80
______             _      _____ _____
| ___ \           | |    |  _  |  _  |
| |_/ / __ _ _ __ | | __  \ V /| |/' |
| ___ \/ _` | '_ \| |/ /  / _ \|  /| |
| |_/ / (_| | | | |   <  | |_| \ |_/ /
\____/ \__,_|_| |_|_|\_\ \_____/\___/

Data - 000000/007FFF - Common routines

$808000-8001 [data] Skip NTSC/PAL and SRAM mapping check
$808002-8003 [data] Demo recorder
$808004-8005 [data] Debug mode
$808006-8007 [data] Debug scrolling
$808008-8009 [data] Something for the audio man
$80800A-8027 Load new music (parameter after call)
$808028-8058 Load new music (parameter in $00)
$808059-80FF Process music data
$808100-8110 Increment Y (once or twice), bank overflow check
$808111-8145 Random number generator
$808146-818D ???
$80818E-81A5 Change nth bit to address offset and mask
$8081A6-81BF Set boss bits in A for current area ($7E:D828,X)
$8081C0-81DB Clear boss bits in A for current area ($7E:D828,X)
$8081DC-81F9 Checks if the boss bits for the current area matches any bits in A. SEC if there's a match
$8081FA-8211 Marks an event as happened. Event bit # must be stored in A
$808212-8232 Marks an event as not happened. Event bit # must be stored in A
$808233-824E Checks if an event has happened. Event bit # must be stored in A. CLC if 0, SEC if 1
$80824F-8260 Write 'supermetroid' to SRAM ($70:1FE0..1FEB)
$808261-82AC Check for non-corrupt SRAM
$8082AD-82B8 [data] 'madadameyohn' garbage written if there's corrupt SRAM
$8082B9-82C4 [data] 'supermetroid' written to SRAM
$8082C5-82D5 Wait until the end of a VBlank
$8082D6-8337 Multiplies A and Y together (16-bit * 16-bit). Result in $05F1-$05F4
$808338-834A Wait for IRQ
$80834B-835C Enable NMI with $84 options
$80835D-836E Disable NMI with $84 options
$80836F-8381 Set force blank
$808382-8394 Clear force blank
$808395-83BC DMA, slot 1, 200h bytes from $7E:C000 through $2122 (CGRAM Data Write)
$8083BD-83CF 8-bit write Y bytes of A to $00:X
$8083D0-83E2 16-bit write Y bytes of A to $00:X
$8083E3-83F5 8-bit write Y bytes of A to $7E:X
$8083F6-8408 16-bit write Y bytes of A to $7E:X
$808409-841B 16-bit write Y bytes of A to $7F:X
$80841C-8461 Boot
$808462-8081 Soft reset
$808482-8572 Game initialisation
$808573-8576 Infinite loop; pointed to by misc. error handling
$808577-858B Wait A many IRQs
$80858C-85B5 Load mirror of current area's map explored
$8085C6-85F5 Mirror current area's map explored
$8085F6-875C NTSC/PAL and SRAM mapping check
$80875D-8791 Initialise $4200..420D
$808792-88B3 Initialise $2100..2133
$8088B4-88D0 Clear high RAM
$8088D1-88EA Write a load of 1C2Fh
$8088EB-88FD Write 800h bytes of A to $7E:3000
$8088FE-8910 Write 800h bytes of A to $7E:4000
$808911-8923 Write 800h bytes of A to $7E:6000
$808924-894C Handle fading out
$80894D-896D Handle fading in
$80896E-8B19 Clear unused OAM (sprites to Y=F0h), clear OAM data offset
$808B1A-8B4E Clear all OAM high-x bits and sizes
$808B4F-8BB9 Unpack mode 7 DMAs
$808BBA-8BD2 Handle mode 7 DMAs
$808BD3-8C82 Handle mode 7 DMAs continued
$808C83-8CD7 Process $D0,X VRAM writes
$808CD8-8DAB Execute horizontal scrolling DMAs
$808DAC-8EA1 Execute vertical scrolling DMAs
$808EA2-8EF3 Handle $0340,X VRAM reads
$808EF4-8F0B Check for command timer
$808F0C-8FA2 ???
$808FA3-8FC0 ???
$808FC1-8FF6 Changes music song/instruments or music track to A, with an 8-frame delay. Makes sure 0639 does not lap 063B
$808FF7-9020 Changes music song/instruments or music track to A, with a Y-frame delay (minimum of 8). Does not stop 0639 from lapping 063B
$809021-902A Sound library 1, $0653 = 0Fh
$80902B-9034 Sound library 1, $0653 = 09h
$809035-903E Sound library 1, $0653 = 03h
$80903F-9048 Sound library 1, $0653 = 01h
$809049-9050 Sound library 1, $0653 = 06h
$809051-90A2 Sound library 1
$8090A3-90AC Sound library 2, $0653 = 0Fh
$8090AD-90B6 Sound library 2, $0653 = 09h
$8090B7-90C0 Sound library 2, $0653 = 03h
$8090C1-90CA Sound library 2, $0653 = 01h
$8090CB-90D2 Sound library 2, $0653 = 06h
$8090D3-9124 Sound library 2
$809125-912E Sound library 3, $0653 = 0Fh
$80912F-9138 Sound library 3, $0653 = 09h
$809139-9142 Sound library 3, $0653 = 03h
$809143-914C Sound library 3, $0653 = 01h
$80914D-9154 Sound library 3, $0653 = 06h
$809155-91A6 Sound library 3
$8091A7-91A8 NOP : RTS
$8091A9-91ED Set up a (H)DMA transfer
$8091EE-9339 Update hardware registers
$80933A-9375 Update OAM & CGRAM
$809376-9415 Samus' graphics → VRAM
$809416-9458 Handle misc. animations (spikes, FX1)
$809459-9582 Read controller input. Also a debug branch
$809583-9615 NMI
$809616-9631 [data] Interrupt commands
$809632-966D DMA transfer to VRAM
$80966E-967F Interrupt command 00h. Next interrupt command = [$A7]
$809680-968A Interrupt command 02h. Disable horizontal and vertical timer interrupts
$80968B-96A8 Interrupt command 04h. Main gameplay, status bar drawing
$8096A9-96D2 Interrupt command 06h. Main gameplay, status bar drawn
$8096D3-96F0 Interrupt command 08h. Start of room transition, status bar drawing
$8096F1-9719 Interrupt command 0Ah. Start of room transition, status bar drawn
$80971A-9732 Interrupt command 0Ch. Draygon's room, status bar drawing
$809733-9757 Interrupt command 0Eh. Draygon's room, status bar drawn
$809758-9770 Interrupt command 10h. Vertical room transition, status bar drawing
$809771-97A8 Interrupt command 12h. Vertical room transition, screen drawing
$8097A9-97C0 Interrupt command 14h. Vertical room transition, screen drawn
$8097C1-97D9 Interrupt command 16h. Horizontal room transition, status bar drawing
$8097DA-9809 Interrupt command 18h. Horizontal room transition, screen drawing
$80980A-9829 Interrupt command 1Ah. Horizontal room transition, screen drawn
$80982A-9840 Enable horizontal and vertical timer interrupts
$809841-985E Enable horizontal and vertical timer interrupts now
$80985F-9869 Disable horizontal and vertical timer interrupts
$80986A-988A IRQ
$80988B-98CA [data] HUD tilemap - top row, never changed
$8098CB-998A [data] HUD tilemap - item selector background
$80998B-9996 [data] HUD tilemap - auto reserve
$809997-99A2 [data] HUD tilemap - empty auto reserve
$8099A3-99AE [data] HUD tilemap - missiles
$8099AF-99B6 [data] HUD tilemap - super missiles
$8099B7-99BE [data] HUD tilemap - power bombs
$8099BF-99C6 [data] HUD tilemap - grapple
$8099C7-99CE [data] HUD tilemap - x-ray
$8099CF-9A0D Add missiles to HUD WRAM tilemap
$809A0E-9A1D Add super missiles to HUD WRAM tilemap
$809A1E-9A2D Add power bombs to HUD WRAM tilemap
$809A2E-9A3D Add grapple to HUD WRAM tilemap
$809A3E-9A4B Add x-ray to HUD WRAM tilemap
$809A4C-9A78 Add to HUD WRAM tilemap
$809A79-9B43 HUD routine when game is loading
$809B44-9CCD HUD routine when game is paused/running
$809CCE-9CE9 [data] Energy tank icon WRAM tilemap offsets
$809CEA-9D6D Toggle HUD item highlight
$809D6E-9D77 [data] Item WRAM tilemap offsets
$809D78-9D97 Draw three HUD digits
$809D98-9DBE Draw two HUD digits
$809DBF-9DD2 [data] HUD digits tilemap values - Health
$809DD3-9DE6 [data] HUD digits tilemap values - Artillery
$809DE7-9DFA Process timer
$809DFB-9E08 [data] Pointers to timer code
$809E09-9E1B Ceres start timer
$809E1C-9E2E Mother Brain start timer
$809E2F-9E40 Delay timer running/movement
$809E41-9E57 Run timer, delay movement
$809E58-9E8B Move timer, still running
$809E8C-9E92 Set timer to A_high minutes and A_low seconds
$809E93-9EA8 Clear timer RAM
$809EA9-9EEB Finally stop timer movement, still running
$809EEC-9F6B [data] Timer centisecond decrements
$809F6C-9F94 Draw timer
$809F95-9FB0 Draw timer section
$809FB3-9DF3 Draw timer spritemap
$809FD4-9FE7 [data] Timer digits spritemap pointers
$809FE8-A05F [data] Timer digits spritemaps
$80A060-A07A [data] Timer TIME spritemap
$80A07B-A12A ???
$80A12B-A148
$80A149-A175
$80A176-A1E2
$80A1E3-A210 Add VRAM $4800..57FF = 0338h
$80A211-A23E Add VRAM $5880..677F = 184Eh
$80A23F-A29B VRAM $4800..4FFF = 3838h
$80A29C-A2F8 VRAM $5880..5FFF = 184Eh
$80A2F9-A339 Calculate layer 2 X position
$80A33A-A37A Calculate layer 2 Y position
$80A37B-A39F Calculate BG positions
$80A3A0-A3AA Updates only BG1 when scrolling, I think
$80A3AB-A4BA Updates BG1 and BG2 graphics when scrolling
$80A4BB-A527 Calculate blocks scrolled
$80A528-A640 Handle autoscrolling when not moving horizontally and part of the screen is has no scroll
$80A641-A6BA Handle scrolling when moving and triggered scrolling right
$80A6BB-A730 Handle scrolling when moving and triggered scrolling left
$80A731-A892 Handle autoscrolling when not moving vertically and part of the screen is has no scroll
$80A893-A935 Handle scrolling when moving and triggered scrolling down
$80A936-A9AB Handle scrolling when moving and triggered scrolling up
$80A9AC-A9D5 Debug scroll position save/loading
$80A9D6-ABDA Update background data block
$80A9DB-AB6F Update level data block
$80AB70-AB74 Update a block in Layer 2 / BG2
$80AB75-AD1C Update a block in Layer 1 / BG1
$80AD1D-AD2F Run to 'Fix' doors moving up; redraws top row of blocks
$80AD30-AD49 Follow door transition
$80AD4A-AD73 Door transition - right
$80AD74-AD9D Door transition - left
$80AD9E-ADC7 Door transition - down
$80ADC8-AE07 Door transition - up
$80AE08-AE0F [data] Pointers to door transition code
$80AE10-AE28 Save number of blocks scrolled
$80AE29-AE4D Update BG scroll offsets
$80AE4E-AE75 Follow door transition
$80AE76-AE7D [data] Pointers to door transition code
$80AE7E-AEC1 Door transition - right
$80AEC2-AF01 Door transition - left
$80AF02-AF88 Door transition - down
$80AF89-B031 Door transition - up
$80B032-B0C1 Unused. Mode 7 initialisation?
$80B0C2-B0FE Configure mode 7 rotation matrix
$80B0FF-B118 Decompression to [PC+3]
$80B119-B265 Decompression
$80B266-B270 Source bank overflow correction
$80B271-B436 Decompression to VRAM
$80B437-BC36 [data] Tilemap for failed NTSC/PAL check
$80BC37-C436 [data] Tilemap for failed SRAM mapping check
$80C437-C4B4 Load new save/elevator
$80C4B5-C4C4 [data] Pointers to each area's saves/elevators
$80C4C5-C5CE [data] Crateria saves/elevators
$80C5CF-C6C8 [data] Brinstar saves/elevators
$80C6D9-C81A [data] Norfair saves/elevators
$80C81B-C916 [data] Wrecked Ship saves/elevators
$80C917-CA2E [data] Maridia saves/elevators
$80CA2F-CB2A [data] Tourian saves/elevators
$80CB2B-CC18 [data] Ceres saves/elevators
$80CC19-CD06 [data] Debug saves/elevators
$80CD07-CD45 Set elevators as used
$80CD46-CD51 [data] Pointers to each area's elevator bits
$80CD52-CD65 [data] Crateria elevator bits
$80CD66-CD75 [data] Brinstar elevator bits
$80CD76-CD81 [data] Norfair elevator bits
$80CD82-CD85 [data] Maridia elevator bits
$80CD86-CD89 [data] Tourian elevator bits
$80CD8A-CD8D [data] Wrecked Ship elevator bits
$80CD8E-FFBF Free space
$80FFC0-FFFF [data] Game header
super/data_maps/rom_map/bank80.txt · Last modified: 2016/07/17 20:59 by mon732