From cab418a9d94c5faf413eeba84047f0b23761584d Mon Sep 17 00:00:00 2001 From: Zorchenhimer Date: Fri, 31 Oct 2025 19:46:34 -0400 Subject: [PATCH] some stuff from a stream the other day --- labels.mlb | 75 ++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 62 insertions(+), 13 deletions(-) diff --git a/labels.mlb b/labels.mlb index c63cd14..5dd1351 100644 --- a/labels.mlb +++ b/labels.mlb @@ -173,7 +173,7 @@ NesPrgRom:0DAC:LCDAC NesPrgRom:0DD9:LCDD9_Multiply_8to16:\nByte_06C8 * Byte_06C9\n= Word_06CE NesPrgRom:0DE2:L0DE2_loop NesPrgRom:0DEB:L0DEB -NesPrgRom:0DF8:LCDF8_StringShenanigans +NesPrgRom:0DF8:LCDF8_Bin2DecString_disabled:\nThis code seems to be disabled. If\nByte_0607 != 1, return early.\n\nHowever, Byte_0607 is only written\nonce in the reset routine with $00.\n\nIf this code were used, it takes the\nbinary value in Byte_ED and converts\nit to ASCII decimal in String_0700.\nThe value is only two digits. NesPrgRom:0E00:L0E00 NesPrgRom:0E1D:LCE1D_loop NesPrgRom:0E2A:LCE2A @@ -238,16 +238,54 @@ NesPrgRom:13C7:LD3C7 NesPrgRom:13DC:LD3DC_loop NesPrgRom:13EA:LD3EA NesPrgRom:1403:LD403_end +NesPrgRom:1649:Handler_A1 +NesPrgRom:164B::ArgA >= 15? +NesPrgRom:1667::byte 1 - rom data bank +NesPrgRom:166D::\nbyte 2&3 are the data source for\na screen to draw. +NesPrgRom:1678::byte 5 - tile count +NesPrgRom:167E::byte 7 - source addr low +NesPrgRom:1684::byte 8 - source addr high +NesPrgRom:168A::byte 4 - rom data bank +NesPrgRom:16BA:L16BA_LoadMetadata:\nLoads data from a table.\nTable is 15 elements long, each element\nis 8 bytes. +NesPrgRom:16C2::\nArgA (Y) index -> offset +NesPrgRom:16D1: +NesPrgRom:1703:L1703_WeirdPointerMath:byte 2 +NesPrgRom:1708::byte_61 +NesPrgRom:170A::byte 3 +NesPrgRom:1711::\nWord_96 -= 1\n(source addr ($4722.W) - 1) +NesPrgRom:171E::byte_61 +NesPrgRom:1722: +NesPrgRom:1726::byte_61 +NesPrgRom:172B::byte_61 +NesPrgRom:1733::\nWrite $4722.W + 6 to $697E.W +NesPrgRom:1742::\nRead four bytes from ($4722.W)\n(bytes 2&3 from metadata) +NesPrgRom:1746::width? +NesPrgRom:174B::height? +NesPrgRom:174D: +NesPrgRom:1757::\nnumber of tiles (width * height) +NesPrgRom:176E::\n$61.W += above result\n +NesPrgRom:177B: +NesPrgRom:177C::hardcoded to $FE above +NesPrgRom:1788: +NesPrgRom:1796:L1796_WriteTiles:\nWrites tiles to the PPU.\nByte_06C0 - number of tiles.\nWord_0724+0 - Tile ID\nWord_0745 - Base Dest Addr (ie, $0000 or $1000).\nWord_06BC - Data Source Addr +NesPrgRom:17A8::tile ID? NesPrgRom:17B0:L17B0 -NesPrgRom:17CC:L17CC -NesPrgRom:17E7:L17E7 +NesPrgRom:17CC:L17CC_loop +NesPrgRom:17E7:L17E7_loop +NesPrgRom:17F1::\nSource Addr += 16 bytes +NesPrgRom:1802::\nDest PPU Addr += 16 bytes +NesPrgRom:1813: +NesPrgRom:181B::\ntile ID rolled over.\nReset the PPU address to tile ID 4\nwith the current Base Addr.\n(Wrap to the top of the current tile\nbank, skipping the first four tiles) NesPrgRom:183D:L183D -NesPrgRom:184E:LD84E +NesPrgRom:184E:LD84E_DrawScreen:\nSeen drawing a full nametable using\ndata from ROM, not the tape. NesPrgRom:1851:LD851 NesPrgRom:1868:LD868 NesPrgRom:1872:LD872 NesPrgRom:187C:LD87C -NesPrgRom:188C:LD88C_PointerShenanigans +NesPrgRom:188C:LD88C_VarShuffle:\nMoves some vars around:\n\nWord_96 -> Pointer_83 (from metadata earlier on)\nPointer_83 += 1\n$697E.W -> $85.W (data metadata pointed to)\n$6AFE.W -> $87.W +NesPrgRom:1894: +NesPrgRom:18A1: +NesPrgRom:18AB: NesPrgRom:18E0:LD8E0_SetNT_00 NesPrgRom:18EB:LD8EB_SetNT_01 NesPrgRom:18F6:LD8F6_SetNT_02 @@ -316,15 +354,15 @@ NesPrgRom:1D46:L1D46 NesPrgRom:1D4E:L1D4E NesPrgRom:1D5A:LDD5A_PaletteBgCopy:\nCopies the background colors \nfrom one palette to the other NesPrgRom:1D5C:L1D5C -NesPrgRom:1D6B:LDD6D_PpuBuffer:\nBuffering data at $610 to the\nPPU data buffer at 305 +NesPrgRom:1D6B:L1D6D_WritePalData:\nBuffers and writes palette data to\n$3F00. Data is sourced from $0610. NesPrgRom:1D7F:L1D7F -NesPrgRom:1D90:L1D90 +NesPrgRom:1D90:L1D90_WriteFourTiles:\nBuffers and draws four tiles. Tiles\nare loaded in pairs. Because reasons.\n\nWord_0745 is the initial destination address. NesPrgRom:1DA2:L1DA2_loop NesPrgRom:1DB6:L1DB6_loop NesPrgRom:1DE2:L1DE2 NesPrgRom:1F37-1F76:Table_DF37:maybe 64 bytes? NesPrgRom:1F7A-2177:Table_1F78 -NesPrgRom:2178-224D:Table_2178 +NesPrgRom:21D5-224C:Table_21D5:15 entries of 8 bytes each. NesPrgRom:2300:L2300_LoadScreen:\nScreen ID in A\nSaves current bank, swaps to the screen's bank, writes\ntile data, and finally writes pattern data. NesPrgRom:2319:L2319_LoadTileData_Shifted:\nShift A three times and TAX before dropping into\nL2323_LoadTileData NesPrgRom:2323:L2323_LoadTileData:\nLooks like this loads up a screen using a lookup table for\nthe bank and data address. It shuffles around a bunch\nof pointers. @@ -1137,7 +1175,7 @@ NesPrgRom:53CC:L96CC:\nTile vs Pixel coords? NesPrgRom:53DC: NesPrgRom:53EC:L93EC_PointerShenanigans NesPrgRom:5416:L5416 -NesPrgRom:5495:L5495 +NesPrgRom:5495:L5495_GotoNextNametable NesPrgRom:549A:L549A NesPrgRom:54AF:L54AF NesPrgRom:54BF:L54BF @@ -1341,8 +1379,11 @@ NesPrgRom:648A:LA48A_rts NesPrgRom:648B:LA48B NesPrgRom:64A4:LA4A4 NesPrgRom:64C3::\nByte_4A = ArgA.Low\nArgA = ArgA - 1 +NesPrgRom:64C7: NesPrgRom:64D2: NesPrgRom:64E6: +NesPrgRom:64EB: +NesPrgRom:64F8: NesPrgRom:650D: NesPrgRom:6524: NesPrgRom:6531: @@ -1637,8 +1678,6 @@ NesPrgRom:EC88:Data_EC88:Attribute Data. First half. NesPrgRom:ECA8:Data_ECA8:Attribute data. Second half. NesPrgRom:ECC8:Data_ECC8:Tile Data in rows NesPrgRom:10000:D10000:Title sprite CHR data -NesPrgRom:3FA20-3FA27:CHR_BA20_A -NesPrgRom:3FA28-3FA2F:CHR_BA28_B NesInternalRam:0000-0001:Word_00 NesInternalRam:0002-0003:Pointer_02 NesInternalRam:0004-0005:Word_04:Either a pointer or a counter, depending on context. @@ -1781,7 +1820,7 @@ NesInternalRam:0606:Byte_0606 NesInternalRam:0607:Byte_0607 NesInternalRam:0610-061F:PaletteBuffer_0610 NesInternalRam:0620-062F:PaletteBuffer_0620 -NesInternalRam:0680:Byte_0680 +NesInternalRam:0680:Byte_0680_CurrentNametable NesInternalRam:06BC-06BD:Word_06BC NesInternalRam:06BE-06BF:Word_06BE NesInternalRam:06C0:Byte_06C0 @@ -1792,11 +1831,12 @@ NesInternalRam:06CA-06CB:Word_06CA NesInternalRam:06CC:Byte_06CC NesInternalRam:06CD:Byte_06CD NesInternalRam:06CE-06CF:Word_06CE_Result:Multiply result\n(also div result??) +NesInternalRam:06D0:Byte_06D0 NesInternalRam:06D1-06D6:Table_06D1 NesInternalRam:0700-071F:String_0700 NesInternalRam:0720-073F:String_0720 NesInternalRam:0740:Byte_0740_TapeNMISetup:set to 0 if tape NMI is setup\nset to 1 if not\n?? maybe -NesInternalRam:0741-0742:Word_0742_NextAvailTileId +NesInternalRam:0741-0742:Word_0742 NesInternalRam:0745-0746:Word_0745 NesInternalRam:0747-0748:Word_0747_NT NesInternalRam:0749-074A:Word_0749_Attr @@ -1832,7 +1872,9 @@ NesWorkRam:0480:Table_WR0480 NesWorkRam:0640-067F:Table64_6640 NesWorkRam:0700-07FF:Page_6700 NesWorkRam:0800-080F:Table_6800 +NesWorkRam:0880-097F:Table_WR_880:Something with sprites. NesWorkRam:0980-098F:Table_6980 +NesWorkRam:0AFE-0AFF:Word_6AFE NesWorkRam:0C01:Table_6C01 NesWorkRam:0C41-0C42:Table_6C41 NesWorkRam:0CC1-0CC2:Table_6CC1 @@ -1917,6 +1959,13 @@ NesWorkRam:871A-871B:Word_471A NesWorkRam:871C-871D:Word_471C NesWorkRam:871E-871F:Word_471E NesWorkRam:8720:PrevRamBank_4720 +NesWorkRam:8721:Byte_4721 +NesWorkRam:8722:Byte_4722 +NesWorkRam:8723:Byte_4723 +NesWorkRam:8724:Byte_4724 +NesWorkRam:8725:Byte_4725 +NesWorkRam:8726:Byte_4726 +NesWorkRam:8727-8728:Word_4727 NesWorkRam:8800:LongCallIndex_4800 NesWorkRam:8801-8814:BankTable_4801:Stores the bank number for a\nscript so we can return to it\nlater. NesWorkRam:8815-883C:WordTable_4815:Table of code return addresses