*!
*D071 I believe is the first origin of checking if you completed a maze in 7-4
*!*D1D1-D1D8 looks to be timers for kink koopas fireballs, if all 00, look out,
lmao!
A2:F350 7B0 BYTES AT 7E:1350
MAKE SURE TO CHANGE INDIRECT JMP FOR STA,X 2A03'S
2A03 ENGINE USE ;20E013
sta 4015 needs this
8D 58 09 08 EB AD 58 09 49 FF 29 1F 1C 45 09 1C
46 09 4E 58 09 B0 06 9C 33 09 9C 4A 09 4E 58 09
B0 06 9C 37 09 9C 4B 09 4E 58 09 B0 03 9C 4C 09
4E 58 09 B0 06 9C 3C 09 9C 4D 09 4E 58 09 90 0A
A9 10 0C 45 09 D0 03 0C 46 09 EB 28 60
-----------------------------------------------------------------------------------
-----------------------------
813D or 8150 actually, looks to be the sprite 0 hit detection for the hud
NES 2000 at $804 [200408] (2B bytes) 48 AD 10 42 68 48 29 80 F0 04 A9 B1 80 02 A9
01
8D 00 42 68 29 04 F0 0A AD 03 08 09 01 8D 03 08
80 05 AD 03 08 29 FE 8D 15 21 60
NES 2001 at $82A [202F08] change to 2F08 (21 bytes) 48 AD 12 42 29 40 F0 F9 68 29
18 D0 09 9C 2C 21 A9 80 8D 00 21 60 A9 12 8D 2C 21 A9 0F 8D 00 21 60
USE $778 with 2901, to get the correct tilemap location of either 2000/2400, this
will be the hi byte to $210F_x
places i replaces AD0220 with AD1042 to clear nmi flag
A1:8E19 = during reset vector
A1:80A6 = during nmi
A1:8EDD = during nmi
A1:8178 = just before rti (hmm, lets not fuck with this one, getting issues)
reset vector loop is a jmp against 8057 [4C5780]
A1:80AE is where I need to implement the OAM DMA
8E92 looks like this might be the $301 buffer, and it also looks like it might be
for palettes
;yup it's a vram buffer
CGRAM PREP [this wont work in current port, until i mod it further, so for now this
is not in use]
43 47 52 41 4D 00 50 52 45 50 00 00 00 00 00 00
A2 00 A0 00 BD D0 1C AA BD F0 1C 85 01 BD 10 1D
85 00 82 3B 01 29 3F 5A A8 B9 40 1F A8 8C 3F 1F
B9 40 1F 7A 91 00 C8 5A AC 3F 1F C8 B9 40 1F 7A
91 00 C8 E8 E0 20 F0 08 C0 08 D0 D6 A0 00 80 C8
9C 3F 1F AD 30 1E 8D 30 1D AD 31 1E 8D 31 1D
ATTRIBUTE BUFFER
-------------------------
for in-game, it looks like A1:8989 is the prep work for attributes. ram $340 is
where the buffer is
looks like A1:89BA finishes the in-game buffer at $340
it also looks like at this point, that I can use this for non rendered screens.
when $340 is set with 90, then we go 74 bytes from $341 (aka, $3B5 is where
attribute data is when $340 is 90)
($341 is where attribute data is when
$340 is 1C)
IF 7E:100F IS NOT EQUAL, RUN DMA ROUTINE
7E:1000-03 = target vram address at $2117 (4 times)
7E:1010-13 = target vram address at $2116 (4 times)
;always 1A for 4305, so we can hard code it
7E:1020-39 = 26(decimal) 1A byte table for vertical strip dma transfer of tsa 1
7E:103A-53 = 26(decimal) 1A byte table for vertical strip dma transfer of tsa 2
7E:1054=6D = 26(decimal) 1A byte table for vertical strip dma transfer of tsa 3
7E:106E-87 = 26(decimal) 1A byte table for vertical strip dma transfer of tsa 4
;make sure to have these set before engine
(A980 8D1521 9C0043 A919 8D0143 A97E 8D0443 A910 8D0343 A920 8D0243 9C0643)
A2:CE80 is the start of my massive attribute lookup tables
A1:882E is the attribute that shows what world you are on before the stage starts,
this is stored in the $300 region of a buffer
2584 ppu, write attribute 08 to 2119 21 times
2625/2D/35 ppu, write attribute 08 to 2119 3 times
1090 will be my generic vram dma engine
HOW GFX ARE DRAWN
A1:8B10 looks to be an area....
RAM $6A1-$6AD = 16x16 vertical column string
A1:9046 wipes out the buffer, but what this really is doing, is prepping all
the 16x16 as the sky/blank tiles
So it looks like the process is during 1 frame before the next nmi,,,,,
1: A1:9408 wipe out the buffer
2: A1:9448 insert the bg theme clouds, bushes, trees $742_bg scenery
(02=1-1)
3: A1:94B1 insert the lower ground 32x16 $741_foreground scenery (00=1-
1) (also looks at $74E_area type 01=1-1, this is used as a Y index
to get the type of ground to draw)
4: A1:9B9D insert interactive blocks
6A1 ID's
-----------
0C = bowser bridge rope connector
10 = top left tube (going down)
11 = top right tube (going down)
12 = top left tube (going down) (CAN ENTER)
13 = top right tube (going down) (CAN ENTER)
14 = bottom left tube (going down)
15 = bottom right tube (going down)
16 = green top left platform
17 = green center platform
18 = green top roght platform
1C = top left tube (facing left) (CAN ENTER)
1D = top right tube (facing left)
1E = top facing left tube connector
1F = bottom left tube (facing left) (CAN ENTER)
20 = bottom right left tube (facing left)
21 = bottom facing left tube connector
24 = top flagpole
25 = flagpole
4A = top castle door exiting stage
4B = bottom castle door exiting stage'
4C = brown underside for green platforms
51 = brick 1-1
52 = brick 1-2
54 = ground
56 = brick vine
57 = star (brick) 1-1
58 = muitl coin brick 1-1
5A = mushroom/flower brick 1-2
5C = star (brick) 1-2
5D = multi coin brick 1-2
5E = brick 1-up 1-2
5F = invisible coin block #-4
60 = invisible 1-up
61 = solid block
62 = #-4 block
67 = spring board top
68 = spring board bottom
89 = bowser bridge
C0 = coin ? 1-1
C1 = mushroom/flower ? block
C2 = coin
C4 = used block
C5 = bowser axe
-----------------------------------
here is a better list from 00-C5, thanks to 6502dissasembly.com
Oh I see the pattern, all bit based. 00-3F 40-7F 80-BF C0-FF
00-26 = 16x16 blocks for palette 0
40-6D = 16x16 blocks for palette 1
80-89 = 16x16 blocks for palette 2
C0-C5 = 16x16 blocks for palette 3
8b10: 24 24 24 24 Palette0_MTiles .bulk $24,$24,$24,$24 ;blank
8b14: 27 27 27 27 .bulk $27,$27,$27,$27 ;black metatile
8b18: 24 24 24 35 .bulk $24,$24,$24,$35 ;bush left
8b1c: 36 25 37 25 .bulk $36,$25,$37,$25 ;bush middle
8b20: 24 38 24 24 .bulk $24,$38,$24,$24 ;bush right
8b24: 24 30 30 26 .bulk $24,$30,$30,$26 ;mountain left
8b28: 26 26 34 26 .bulk $26,$26,$34,$26 ;mountain left
bottom/middle center
8b2c: 24 31 24 32 .bulk $24,$31,$24,$32 ;mountain middle
top
8b30: 33 26 24 33 .bulk $33,$26,$24,$33 ;mountain right
8b34: 34 26 26 26 .bulk $34,$26,$26,$26 ;mountain right
bottom
8b38: 26 26 26 26 .bulk $26,$26,$26,$26 ;mountain middle
bottom
8b3c: 24 c0 24 c0 .bulk $24,$c0,$24,$c0 ;bridge
guardrail
8b40: 24 7f 7f 24 .bulk $24,$7f,$7f,$24 ;chain
8b44: b8 ba b9 bb .bulk $b8,$ba,$b9,$bb ;tall tree, top
half
8b48: b8 bc b9 bd .bulk $b8,$bc,$b9,$bd ;short tree top
8b4c: ba bc bb bd .bulk $ba,$bc,$bb,$bd ;tall tree top,
bottom half
8b50: 60 64 61 65 .bulk $60,$64,$61,$65 ;warp pipe end
left, points up
8b54: 62 66 63 67 .bulk $62,$66,$63,$67 ;warp pipe end
right, points up
8b58: 60 64 61 65 .bulk $60,$64,$61,$65 ;decoration pipe
end left, points up
8b5c: 62 66 63 67 .bulk $62,$66,$63,$67 ;decoration pipe
end right, points up
8b60: 68 68 69 69 .bulk $68,$68,$69,$69 ;pipe shaft left
8b64: 26 26 6a 6a .bulk $26,$26,$6a,$6a ;pipe shaft
right
8b68: 4b 4c 4d 4e .bulk $4b,$4c,$4d,$4e ;tree ledge left
edge
8b6c: 4d 4f 4d 4f .bulk $4d,$4f,$4d,$4f ;tree ledge
middle
8b70: 4d 4e 50 51 .bulk $4d,$4e,$50,$51 ;tree ledge
right edge
8b74: 6b 70 2c 2d .bulk $6b,$70,$2c,$2d ;mushroom left
edge
8b78: 6c 71 6d 72 .bulk $6c,$71,$6d,$72 ;mushroom middle
8b7c: 6e 73 6f 74 .bulk $6e,$73,$6f,$74 ;mushroom right
edge
8b80: 86 8a 87 8b .bulk $86,$8a,$87,$8b ;sideways pipe
end top
8b84: 88 8c 88 8c .bulk $88,$8c,$88,$8c ;sideways pipe
shaft top
8b88: 89 8d 69 69 .bulk $89,$8d,$69,$69 ;sideways pipe
joint top
8b8c: 8e 91 8f 92 .bulk $8e,$91,$8f,$92 ;sideways pipe
end bottom
8b90: 26 93 26 93 .bulk $26,$93,$26,$93 ;sideways pipe
shaft bottom
8b94: 90 94 69 69 .bulk $90,$94,$69,$69 ;sideways pipe
joint bottom
8b98: a4 e9 ea eb .bulk $a4,$e9,$ea,$eb ;seaplant
8b9c: 24 24 24 24 .bulk $24,$24,$24,$24 ;blank, used on
bricks or blocks that're hit
8ba0: 24 2f 24 3d .bulk $24,$2f,$24,$3d ;flagpole ball
8ba4: a2 a2 a3 a3 .bulk $a2,$a2,$a3,$a3 ;flagpole shaft
8ba8: 24 24 24 24 .bulk $24,$24,$24,$24 ;blank, used in
conjunction with vines
8bac: a2 a2 a3 a3 Palette1_MTiles .bulk $a2,$a2,$a3,$a3 ;vertical rope
8bb0: 99 24 99 24 .bulk $99,$24,$99,$24 ;horizontal rope
8bb4: 24 a2 3e 3f .bulk $24,$a2,$3e,$3f ;left pulley
8bb8: 5b 5c 24 a3 .bulk $5b,$5c,$24,$a3 ;right pulley
8bbc: 24 24 24 24 .bulk $24,$24,$24,$24 ;blank used for
balance rope
8bc0: 9d 47 9e 47 .bulk $9d,$47,$9e,$47 ;castle top
8bc4: 47 47 27 27 .bulk $47,$47,$27,$27 ;castle window
left
8bc8: 47 47 47 47 .bulk $47,$47,$47,$47 ;castle brick
wall
8bcc: 27 27 47 47 .bulk $27,$27,$47,$47 ;castle window
right
8bd0: a9 47 aa 47 .bulk $a9,$47,$aa,$47 ;castle top w/
brick
8bd4: 9b 27 9c 27 .bulk $9b,$27,$9c,$27 ;entrance top
8bd8: 27 27 27 27 .bulk $27,$27,$27,$27 ;entrance bottom
8bdc: 52 52 52 52 .bulk $52,$52,$52,$52 ;green ledge
stump
8be0: 80 a0 81 a1 .bulk $80,$a0,$81,$a1 ;fence
8be4: be be bf bf .bulk $be,$be,$bf,$bf ;tree trunk
8be8: 75 ba 76 bb .bulk $75,$ba,$76,$bb ;mushroom stump
top
8bec: ba ba bb bb .bulk $ba,$ba,$bb,$bb ;mushroom stump
bottom
8bf0: 45 47 45 47 .bulk $45,$47,$45,$47 ;breakable brick
w/ line
8bf4: 47 47 47 47 .bulk $47,$47,$47,$47 ;breakable brick
8bf8: 45 47 45 47 .bulk $45,$47,$45,$47 ;breakable brick
(not used)
8bfc: b4 b6 b5 b7 .bulk $b4,$b6,$b5,$b7 ;cracked rock
terrain
8c00: 45 47 45 47 .bulk $45,$47,$45,$47 ;brick with line
(power-up)
8c04: 45 47 45 47 .bulk $45,$47,$45,$47 ;brick with line
(vine)
8c08: 45 47 45 47 .bulk $45,$47,$45,$47 ;brick with line
(star)
8c0c: 45 47 45 47 .bulk $45,$47,$45,$47 ;brick with line
(coins)
8c10: 45 47 45 47 .bulk $45,$47,$45,$47 ;brick with line
(1-up)
8c14: 47 47 47 47 .bulk $47,$47,$47,$47 ;brick (power-
up)
8c18: 47 47 47 47 .bulk $47,$47,$47,$47 ;brick (vine)
8c1c: 47 47 47 47 .bulk $47,$47,$47,$47 ;brick (star)
8c20: 47 47 47 47 .bulk $47,$47,$47,$47 ;brick (coins)
8c24: 47 47 47 47 .bulk $47,$47,$47,$47 ;brick (1-up)
8c28: 24 24 24 24 .bulk $24,$24,$24,$24 ;hidden block (1
coin)
8c2c: 24 24 24 24 .bulk $24,$24,$24,$24 ;hidden block
(1-up)
8c30: ab ac ad ae .bulk $ab,$ac,$ad,$ae ;solid block (3-
d block)
8c34: 5d 5e 5d 5e .bulk $5d,$5e,$5d,$5e ;solid block
(white wall)
8c38: c1 24 c1 24 .bulk $c1,$24,$c1,$24 ;bridge
8c3c: c6 c8 c7 c9 .bulk $c6,$c8,$c7,$c9 ;bullet bill
cannon barrel
8c40: ca cc cb cd .bulk $ca,$cc,$cb,$cd ;bullet bill
cannon top
8c44: 2a 2a 40 40 .bulk $2a,$2a,$40,$40 ;bullet bill
cannon bottom
8c48: 24 24 24 24 .bulk $24,$24,$24,$24 ;blank used for
jumpspring
8c4c: 24 47 24 47 .bulk $24,$47,$24,$47 ;half brick used
for jumpspring
8c50: 82 83 84 85 .bulk $82,$83,$84,$85 ;solid block
(water level, green rock)
8c54: 24 47 24 47 .bulk $24,$47,$24,$47 ;half brick
(???)
8c58: 86 8a 87 8b .bulk $86,$8a,$87,$8b ;water pipe top
8c5c: 8e 91 8f 92 .bulk $8e,$91,$8f,$92 ;water pipe
bottom
8c60: 24 2f 24 3d .bulk $24,$2f,$24,$3d ;flag ball
(residual object)
8c64: 24 24 24 35 Palette2_MTiles .bulk $24,$24,$24,$35 ;cloud left
8c68: 36 25 37 25 .bulk $36,$25,$37,$25 ;cloud middle
8c6c: 24 38 24 24 .bulk $24,$38,$24,$24 ;cloud right
8c70: 24 24 39 24 .bulk $24,$24,$39,$24 ;cloud bottom
left
8c74: 3a 24 3b 24 .bulk $3a,$24,$3b,$24 ;cloud bottom
middle
8c78: 3c 24 24 24 .bulk $3c,$24,$24,$24 ;cloud bottom
right
8c7c: 41 26 41 26 .bulk $41,$26,$41,$26 ;water/lava top
8c80: 26 26 26 26 .bulk $26,$26,$26,$26 ;water/lava
8c84: b0 b1 b2 b3 .bulk $b0,$b1,$b2,$b3 ;cloud level
terrain
8c88: 77 79 77 79 .bulk $77,$79,$77,$79 ;bowser's bridge
8c8c: 53 55 54 56 Palette3_MTiles .bulk $53,$55,$54,$56 ;question block
(coin)
8c90: 53 55 54 56 .bulk $53,$55,$54,$56 ;question block
(power-up)
8c94: a5 a7 a6 a8 .bulk $a5,$a7,$a6,$a8 ;coin
8c98: c2 c4 c3 c5 .bulk $c2,$c4,$c3,$c5 ;underwater coin
8c9c: 57 59 58 5a .bulk $57,$59,$58,$5a ;empty block
8ca0: 7b 7d 7c 7e .bulk $7b,$7d,$7c,$7e ;axe
6A1-6AD = 0D bytes
per screen = D0 bytes
1-1 *without underground = B60
might be able to get away with dedicating 1000 bytes of sram to each level
A1:94E2 is routine that converts $6A1-$6AD buffer for $500 buffer
A1:94D3 looks to be a good spot to write $6A1-$6AD into sram while gameplay is
happening
A9EF1F ;size
A21080 ;source of transfer
A00060 ;target to transfer
54A0A3 ;target & source
source of transfer values
1000 = 1-1
1020 = 1-2_1_entrance
*IGNORE 1040 = 1-2_2
*IGNORE 1060 = 1-2_3_exit
1080 = 1-3
10A0 = 1-4
10C0 = 2-1
10E0 = 2-2_1_entrance
*IGNORE 1000 = 2-2_2
*IGNORE 1020 = 2-2_3_exit
1040 = 2-3
1060 = 2-4
1080 = 3-1
10A0 = 3-2
10C0 = 3-3
10E0 = 3-4
1000 = 4-1
1020 = 4-2_1_entrance
*IGNORE 1040 = 4-2_2
*IGNORE 1060 = 4-2_3_exit
1080 = 4-3
10A0 = 4-4
10C0 = 5-1
10E0 = 5-2
1000 = 5-3
1020 = 5-4
1040 = 6-1
1060 = 6-2
1080 = 6-3
10A0 = 6-4
10C0 = 7-1
10E0 = 7-2_1_entrance
*IGNORE 1000 = 7-2_2
*IGNORE 1020 = 7-2_3_exit
1040 = 7-3
1060 = 7-4
1080 = 8-1
10A0 = 8-2
10C0 = 8-3
10E0 = 8-4_1
*IGNORE 1000 = 8-4_2
*IGNORE 1020 = 8-4_3
*IGNORE 1040 = 8-4_4
*IGNORE 1060 = 8-4_5
6000-65FF = PART 1
6600-69FF = PART 2
6A00-6DFF = PART 3
6E00-72FF = PART 4
7300-77FF = PART 5
1080 = bonus_cloud_1
10A0 = bonus_cloud_2
10C0 = bonus_under_1
10E0 = bonus_under_2
1000 = bonus_under_3
1020 = bonus_under_4
1040 = bonus_under_5
1060 = under_water_5-2
1080 = warp_room_6-8
A0:FD31 = source bank table
A0:FD66 = source hi table
A0:FD9B = source lo table
The 2 bonus cloud areas/ 5 underground bonus areas/ underwater 5-2 area/ warp 6-8
area, need to be crammed into different stages
bonus cloud 1 = 500 bytes ;C6:0E20
bonus cloud 2 = 600 bytes ;C6:3220
bonus under 1 = 200 bytes ;C6:4B20
bonus under 2 = 200 bytes ;C6:6B20
bonus under 3 = 200 bytes ;C6:8E20
bonus under 4 = 200 bytes ;C6:B220
bonus under 5 = 200 bytes ;C6:D020
underwater 5-2 = 500 bytes ;C6:EB20
warp 6-8 = 500 bytes ;C7:0E20
8B C230 A9FF1F A21080 A00060 54A0A3 E230 AB A95A 8DFF7F A901 EB A9A1 48 AB 5C0080A1
A0:FD90 = source bank
A0:FDB0 = source hi
10 = hard coded source lo
-----------------------------------------------------------------------------------
---------------------------
USE THIS SECTION TO START THE SRAM PREP FOR STAGES, A1:9C13
75F,760
1-1 = 0000
1-2 = 0001,0002
1-3 = 0003
1-4 = 0004
2-1 = 0100
2-2 = 0101,0102
2-3 = 0103
2-4 = 0104
3-1 = 0200
3-2 = 0201
3-3 = 0202
3-4 = 0203
4-1 = 0300
4-2 = 0301,0302
4-3 = 0303
4-4 = 0304
5-1 = 0400
5-2 = 0401
5-3 = 0402
5-4 = 0403
6-1 = 0500
6-2 = 0501
6-3 = 0502
6-4 = 0503
7-1 = 0600
7-2 = 0601,0602
7-3 = 0603
7-4 = 0604
8-1 = 0700
8-2 = 0701
8-3 = 0702
8-4 = 0703
A1:AEDC, start of game mode for smb
8FE4 might be the perfect spot to prepare registers for sram addresses
-----------------------------------------------------------------------------------
----------------------------
here we go, piggy back off of this area to prep sram addresses
A1:9CB4 = index table for worlds 1-8
A1:9CBC = worlds 1-8 -# tables
A1:8FFB = miiiight be the spot where we can do tubes?
A1:A133, (set execution breakpoint here) will use this area to determine where to
load the data for the 5 underground pipe rooms
Sooooo, i'm thinking capture the Y at A1:9C4E, to determine what sram to load
1-1 = *08
1-2 = *0C,19,*08
1-3 = *09
1-4 = *1C
2-1 = 0B
2-2 = *0C,*01,*08
2-3 = *0A
2-4 = *1E
3-1 = 07
3-2 = 18
3-3 = 03
3-4 = 1F
4-1 = 05
4-2 = *0C,1A,*08
4-3 = 0F
4-4 = 1D
5-1 = 0D
5-2 = 14
5-3 = *09
5-4 = *1E
6-1 = 11
6-2 = 06
6-3 = 10
6-4 = *1C
7-1 = 16
7-2 = *0C,*01,*08
7-3 = *0A
7-4 = 20
8-1 = 13
8-2 = 15
8-3 = 04
8-4 = 21,02(underwater portion)
----------------------------------------
bonus cloud 1= 0E
;A0:6E00 (now A0:6E10)
bonus cloud 2 = 17
;A1:7200 (now A1:7210)
bonus under 1-5 = 1B (will need to look at 751 to determine exact room, since all
share 1B)
;A2:6B00 (now A2:6B10)
;A3:6B00 (now A3:6B10)
;A4:6E00 (now A4:6E10)
;A5:7200 (now A5:7210)
;A6:7000 (now A6:7010)
underwater 5-2 = 00
;A7:6B00 (now A7:6B10)
4-2 warp to 6 through 8 = 12
;A8:6E00 (now A8:6E10)
A1:9C4E is the spot for bonus clouds/underground/underwater 5-2/4-2 warp zone
------------------------------------------
warp zone copy from sram to ram, try at A1:8567
having difficulty getting ram registers to determine when mouse cursor is on
2000/2400 tilemap, i'm very close, decided to go with a sprite that is positioned
at the top of the screen, and scrolls. when the mouse cursor is on one side of the
sprite, it means load from 2000, when on the right side, it means to load from
2400. but the problem now is, when on 2400 and the sprite warps from 00 to FF, the
mouse cursor is on the left side of that sprite, and then my tilemap register is
forced to 00, when in actuality i'm still on a 16x16 block from the 2400 tilemap.