NesMemory:0000-0001:Word_44F9 NesMemory:0036-0037:Argument_D NesMemory:2000:PpuControl_2000:7 bit 0\n---- ----\nVPHB SINN\n|||| ||||\n|||| ||++- Base nametable address\n|||| || (0 = $2000; 1 = $2400; 2 = $2800; 3 = $2C00)\n|||| |+--- VRAM address increment per CPU read/write of PPUDATA\n|||| | (0: add 1, going across; 1: add 32, going down)\n|||| +---- Sprite pattern table address for 8x8 sprites\n|||| (0: $0000; 1: $1000; ignored in 8x16 mode)\n|||+------ Background pattern table address (0: $0000; 1: $1000)\n||+------- Sprite size (0: 8x8; 1: 8x16)\n|+-------- PPU master/slave select\n| (0: read backdrop from EXT pins; 1: output color on EXT pins)\n+--------- Generate an NMI at the start of the\n vertical blanking interval (0: off; 1: on) NesMemory:2001:PpuMask_2001:7 bit 0\n---- ----\nBGRs bMmG\n|||| ||||\n|||| |||+- Display type: (0: color, 1: grayscale)\n|||| ||+-- 1: Show background in leftmost 8 pixels of screen, 0: Hide\n|||| |+--- 1: Show sprites in leftmost 8 pixels of screen, 0: Hide\n|||| +---- 1: Show background\n|||+------ 1: Show sprites\n||+------- Emphasize red\n|+-------- Emphasize green\n+--------- Emphasize blue NesMemory:2002:PpuStatus_2002:7 bit 0\n---- ----\nVSO. ....\n|||| ||||\n|||+-++++- Least significant bits previously written into a PPU register\n||| (due to register not being updated for this address)\n||+------- Sprite overflow. The intent was for this flag to be set\n|| whenever more than eight sprites appear on a scanline, but a\n|| hardware bug causes the actual behavior to be more complicated\n|| and generate false positives as well as false negatives; see\n|| PPU sprite evaluation. This flag is set during sprite\n|| evaluation and cleared at dot 1 (the second dot) of the\n|| pre-render line.\n|+-------- Sprite 0 Hit. Set when a nonzero pixel of sprite 0 overlaps\n| a nonzero background pixel; cleared at dot 1 of the pre-render\n| line. Used for raster timing.\n+--------- Vertical blank has started (0: not in vblank; 1: in vblank).\n Set at dot 1 of line 241 (the line *after* the post-render\n line); cleared after reading $2002 and at dot 1 of the\n pre-render line. NesMemory:2003:OamAddr_2003:Set OAM address - Write only NesMemory:2004:OamData_2004:Read/Write OAM data NesMemory:2005:PpuScroll_2005:Set PPU scroll, write twice - Write only NesMemory:2006:PpuAddr_2006:Set PPU address, write twice - Write only NesMemory:2007:PpuData_2007:Read/Write VRAM NesMemory:4000:Sq0Duty_4000:DDLC VVVV\nDuty (D), envelope loop / length counter halt (L), constant volume (C), volume/envelope (V) NesMemory:4001:Sq0Sweep_4001:EPPP NSSS\nSweep unit: enabled (E), period (P), negate (N), shift (S) NesMemory:4002:Sq0Timer_4002:TTTT TTTT\nTimer low (T) NesMemory:4003:Sq0Length_4003:LLLL LTTT\nLength counter load (L), timer high (T) NesMemory:4004:Sq1Duty_4004:DDLC VVVV\nDuty (D), envelope loop / length counter halt (L), constant volume (C), volume/envelope (V) NesMemory:4005:Sq1Sweep_4005:EPPP NSSS\nSweep unit: enabled (E), period (P), negate (N), shift (S) NesMemory:4006:Sq1Timer_4006:TTTT TTTT\nTimer low (T) NesMemory:4007:Sq1Length_4007:LLLL LTTT\nLength counter load (L), timer high (T) NesMemory:4008:TrgLinear_4008:CRRR RRRR\nLength counter halt / linear counter control (C), linear counter load (R) NesMemory:400A:TrgTimer_400A:TTTT TTTT\nTimer low (T) NesMemory:400B:TrgLength_400B:LLLL LTTT\nLength counter load (L), timer high (T) NesMemory:400C:NoiseVolume_400C:--LC VVVV\nEnvelope loop / length counter halt (L), constant volume (C), volume/envelope (V) NesMemory:400E:NoisePeriod_400E:L--- PPPP\nLoop noise (L), noise period (P) NesMemory:400F:NoiseLength_400F:LLLL L---\nLength counter load (L) NesMemory:4010:DmcFreq_4010:IL-- RRRR\nIRQ enable (I), loop (L), frequency (R) NesMemory:4011:DmcCounter_4011:-DDD DDDD\nLoad counter (D) NesMemory:4012:DmcAddress_4012:AAAA AAAA\nSample address (A) NesMemory:4013:DmcLength_4013:LLLL LLLL\nSample length (L) NesMemory:4014:SpriteDma_4014:Writing $XX will upload 256 bytes of data from CPU page $XX00-$XXFF to the internal PPU OAM. NesMemory:4015:ApuStatus_4015:Read:\nIF-D NT21\nDMC interrupt (I), frame interrupt (F), DMC active (D), length counter > 0 (N/T/2/1)\n\nWrite:\n---D NT21\nEnable DMC (D), noise (N), triangle (T), and pulse channels (2/1) NesMemory:4016:Ctrl1_4016:Read (NES - input):\n---4 3210\nRead data from controller port #1.\n\nWrite:\n---- ---A\nOutput data (strobe) to both controllers. NesMemory:4017:Ctrl2_FrameCtr_4017:Read (NES - input):\n---4 3210\nRead data from controller port #2.\n\nWrite (Frame counter): MI-- ----\nMode (M, 0 = 4-step, 1 = 5-step), IRQ inhibit flag (I) NesMemory:4200:SBX_4200_DataAndRAM:Read tape data byte.\nWrite for RAM banks.\n\n7 bit 0\n---- ----\nAA.. .BBB\n|||| ||||\n|||| |+++- Select RAM bank mapped to $5000\n||++-+---- Unused\n++-------- Select RAM bank mapped to $6000 NesMemory:4201:SBX_4201_RomAndTape:Read for tape status:\n\n7 bit 0\n---- ----\nABCD ....\n|||| ||||\n|||| ++++- Unused\n|||+------ Unknown\n||+------- Set when in data region during seek??\n|+-------- tape data synched? current data bit? something else??\n+--------- Something to do with $4202.0? decoder disabeld? decoder data ready?\n\nWrite for ROM bank:\n\n7 bit 0\n---- ----\n.... AAAA\n|||| ||||\n|||| ++++- Select 16k ROM bank at $8000-$BFFF\n++++------ Unused NesMemory:4202:SBX_4202_TapeCtrl:Read for status:\n\n7 bit 0\n---- ----\n.A.. B...\n|||| ||||\n|||| |+++- Unused\n|||| +---- Power supply not connected (unused on SBX-1)\n||++------ Unused\n|+-------- Shift register ready for next bit? (tape ready?)\n+--------- Unused\n\nWrite for control:\n\n7 bit 0\n---- ----\nA?BC ?DEF\n|||| ||||\n|||| |||+- Data decoding enable?\n|||| ||+-- IRQ enable?\n|||| |+--- Maybe tape audio enable??\n|||| +---- Unknown\n|||+------ Pulse low to clock data bit\n||+------- Pulse low to reset drive controller?\n|+-------- Unknown\n+--------- Output data bit NesMemory:6000-6001:ScriptStackAddr:The first two bytes of a\nscript always point to the\nstart of the script's stack. NesPrgRom:0000:Handler_FE_DrawCharacter:\nDraws a character from the SBX ROM's\ncharset. NesPrgRom:0022:L0022 NesPrgRom:002E:L002E_loop NesPrgRom:0046:L0046_RTS NesPrgRom:0047:L0047 NesPrgRom:0060:L0060 NesPrgRom:0067:L0067 NesPrgRom:008E:L008E NesPrgRom:0094:L0094 NesPrgRom:009A:L009A NesPrgRom:00A8:L00A8_loop NesPrgRom:00B7:L00B7 NesPrgRom:00E0:L00E0 NesPrgRom:00F1:L00F1 NesPrgRom:013D:L013D NesPrgRom:015D:L015D NesPrgRom:0161:L0161:\nSwaps to the firmware's charset NesPrgRom:0199:L0199 NesPrgRom:01C3:L01C3 NesPrgRom:01DB:L01DB_loop_outer NesPrgRom:01EF:L01EF_loop_inner NesPrgRom:0235:L0235 NesPrgRom:0257:L0257_LoadCharFromRom:\nLoads a character from the SBX Rom NesPrgRom:0260::2 vs 4 tiles. 4 branches (half vs full width?) NesPrgRom:0288:L0288 NesPrgRom:02DB:L02DB NesPrgRom:02E0:L02E0:\nbuncha math shit\na multiply by 32? line offset? NesPrgRom:02F6:L02F6 NesPrgRom:02FD:L02FD NesPrgRom:030E:L030E NesPrgRom:030F:L030F NesPrgRom:031E:L031E NesPrgRom:0321:L0321 NesPrgRom:0324:L0324 NesPrgRom:0327:L0327 NesPrgRom:036D:L036D NesPrgRom:037D:L037D NesPrgRom:03D6:L03D6 NesPrgRom:041F:L041F NesPrgRom:0443:L0443 NesPrgRom:0445:L0445_loop NesPrgRom:046B:L046B NesPrgRom:0470:L0470 NesPrgRom:0476:Handler_B3 NesPrgRom:048F:LC4AF NesPrgRom:049F:LC49F_ne NesPrgRom:04C0:LC4C0_RTS NesPrgRom:04C1:LC4C1 NesPrgRom:04E0:LC4E0_loop NesPrgRom:0512:LC512_ne NesPrgRom:051A:LC51A NesPrgRom:0521:LC521_RTS NesPrgRom:0525:LC525 NesPrgRom:0551:LC551_loop NesPrgRom:055F:LC55F_exit NesPrgRom:05BC:LC5BC NesPrgRom:06AA:LC6AA NesPrgRom:0724:Handler_89_DrawString:\nDraws a string using characters\nfrom the ROM's character set. NesPrgRom:073E:L073E_loop NesPrgRom:0745:L0745_loop NesPrgRom:074D:L074D NesPrgRom:0762:L0762 NesPrgRom:0768:L0768_next NesPrgRom:076E:L076E NesPrgRom:0778:Handler_F1 NesPrgRom:07D5:L07D5_end NesPrgRom:0884:L0884_LoadPRGCHR:\nSome kinda character load routine NesPrgRom:0890::A <- stack NesPrgRom:0891::A -> X NesPrgRom:0892::A <- X NesPrgRom:0893::A -> stack NesPrgRom:08A6::from Table_4509 above NesPrgRom:08AC::ArgA NesPrgRom:08B2::ArgB NesPrgRom:08B8::LDY happens before jsr NesPrgRom:08C8:L08C8 NesPrgRom:08ED:L08ED NesPrgRom:08F3::\nWord_0600 *= 2 NesPrgRom:08FE::\nWord_0600 += Word_0602\naddr = index + table start NesPrgRom:0911: NesPrgRom:0928: NesPrgRom:094A:L094A_loop NesPrgRom:096F:L096F_loop NesPrgRom:09A1:Handler_D4_SetCursorLoc NesPrgRom:09B3:Handler_E2_SetupSprite:ArgA: Attribute\nArbB-ArgC: a pointer\nArgD-ArgF: ???\nArgG: sprite index+64 NesPrgRom:09FA:LC9FA_loop NesPrgRom:0A12:LCA12_next NesPrgRom:0A1A:LCA1A NesPrgRom:0A1E:Handler_EF NesPrgRom:0ACD:LCACD_RTS NesPrgRom:0B58:LCB58 NesPrgRom:0BA2:LCBA2 NesPrgRom:0BA4:LCBA4_loop NesPrgRom:0BC5:LCBC5 NesPrgRom:0BD1:LCBD1_loop NesPrgRom:0BDE:LCBDE_loop NesPrgRom:0BF5:LCBF5_next NesPrgRom:0BFB:LCBFB NesPrgRom:0C20:LCC20 NesPrgRom:0C49:LCC49_next NesPrgRom:0C4F:LCC4F_end NesPrgRom:0C53:LCC53_SetSprite:Set the sprite data based on\nvalues in Table_4E01, ArgA,\nArgG NesPrgRom:0C73:LCC73 NesPrgRom:0C80:LCC80 NesPrgRom:0C86:LCC86 NesPrgRom:0CA5:LCCA5:loads CHR data from the SBX\nROM and writes it to the PPU. NesPrgRom:0CB6:LCCB6_loop NesPrgRom:0CF2:LCCF2_loop NesPrgRom:0D1A:LCD1A_ClearSpriteTables:Clears byte tables at $0140,\n$4B00, $4B40, $4C00, $4C40,\nand a word table at $4B80.\n\nClear value is #$FF.\n\nThese tables are sprite\nrelated. NesPrgRom:0D1E:L0D1E_loop NesPrgRom:0D40:LCD40_ClearSprites NesPrgRom:0D42:L0D42 NesPrgRom:0D5F:LCD5F:\npopulates hi/lo word tables\nwith Word_455E.\npossibly sprite related NesPrgRom:0D7C:LCD7C_LoadChrFromROM:Loads CHR data from the SBX\nRom and buffers it for the\nPPU.\n\nCan expand 1bpp tiles to 2bpp NesPrgRom:0D82:LCD82_loop NesPrgRom:0D8D:LCD8D_loop NesPrgRom:0D99:LCD99_loop NesPrgRom:0DA6:LCDA6 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:0E00:L0E00 NesPrgRom:0E1D:LCE1D_loop NesPrgRom:0E2A:LCE2A NesPrgRom:0E42:LCE42_SetFlag94_04 NesPrgRom:0E47:LCE47_SetFlag94_05 NesPrgRom:0E4C:LCE4C_SetFlag94_03 NesPrgRom:0E51:L0E51_loop_Flag94 NesPrgRom:0E5F:Handler_A5_Set470A NesPrgRom:0E6A:Handler_A6_Set470B NesPrgRom:0E75:Handler_A3_SpriteSetup NesPrgRom:0E8A:LCE8A NesPrgRom:0E96:LCE96 NesPrgRom:0F12:L0F12 NesPrgRom:0F17:L0F17 NesPrgRom:0F4C:Handler_AA_LongJump:\nBank in ArgA.\nDestination in Word_4E.\nDoes not store a return address. NesPrgRom:0F5C:LCF5C:\nscript long jump?? NesPrgRom:0F7A:Handler_AB_LongCall NesPrgRom:0F8A:LCF8A NesPrgRom:0FB7:LCFB7_rts NesPrgRom:0FB8:Handler_AC_LongReturn NesPrgRom:0FE8:LCFE8_rts NesPrgRom:0FE9:LCFE9_HighWRamSwap NesPrgRom:0FEC::mask off $6000 bank change NesPrgRom:0FF6:L0FF6_loop NesPrgRom:1006:LD006_LowWRamSwap:\nWorks a little differently\nthan LCFE9. This one doesn't\ndo any shifting nonsense. NesPrgRom:1015:LD015_SwapRomBank:\nRom bank in A. A is used\nwithout any modifications. NesPrgRom:101C:LD01C_HighWRamSwap:Swap based on ArgA\nInspect high byte of ArgA for\ndetails on bank swapping. NesPrgRom:1039::\n>= $60 && < $80 NesPrgRom:103F::shifts before swap NesPrgRom:1045:LD045:\n> $50 && < $60 NesPrgRom:104B::no shift before swap NesPrgRom:104E:LD04E_rts NesPrgRom:104F:LD04F_SwapWRam_4710:Swap work ram using the value\nat $4710 directly. NesPrgRom:1146:Handler_D1_ExpansionController:Does some weird shit with\nwriting and reading\nexpansion controller data.\n\nArgA is copied to ArgC.\nWord_B1 is copied to ArgA. NesPrgRom:114D:LD14D_loop NesPrgRom:1156: NesPrgRom:115D: NesPrgRom:1163: NesPrgRom:1167::ArgC == 3 NesPrgRom:116B::ArgC >= 4 NesPrgRom:116D:LD16D_loop:\nArgC is in either 0, 1, or 2 NesPrgRom:1187:LD187_ExpansionController NesPrgRom:11A6:LD1A6 NesPrgRom:11AE:LD1AE NesPrgRom:11B3:L11B3 NesPrgRom:11C4:L11C4 NesPrgRom:11CE:L11CE NesPrgRom:11DE:L11DE NesPrgRom:11E9:LD1E9_ControllerStuff_ArgA_ArgC NesPrgRom:12A9-12B0:tbl_D2A9 NesPrgRom:12B1-12C0:tbl_D2B1 NesPrgRom:12FD:L12FD_SomethingTape NesPrgRom:1322:L1322_loop NesPrgRom:1329:L1329_WaitOn_EE:waits for Byte_EE to\nequal $F0 NesPrgRom:1332:Handler_82_TapeNMIShenanigans NesPrgRom:133A:Handler_83_TapeWait:\nWaits for tape data. Waits\nusing Byte_EE. NesPrgRom:1342:Handler_E8_SetupTapeNMI:\nSets up the tape reading NMI\nthat starts at ED00, as well\nas some other shenanigans. NesPrgRom:13B1:LD3B1_ClearSomeStuff NesPrgRom:13C0:Handler_D5_WaitForTape:\nWaits for some tape stuff in\nWord_442A. NesPrgRom:13C6::return if 16-bit is zero NesPrgRom:13C7:LD3C7 NesPrgRom:13DC:LD3DC_loop NesPrgRom:13EA:LD3EA NesPrgRom:1403:LD403_end NesPrgRom:17B0:L17B0 NesPrgRom:17CC:L17CC NesPrgRom:17E7:L17E7 NesPrgRom:183D:L183D NesPrgRom:184E:LD84E NesPrgRom:1851:LD851 NesPrgRom:1868:LD868 NesPrgRom:1872:LD872 NesPrgRom:187C:LD87C NesPrgRom:188C:LD88C_PointerShenanigans NesPrgRom:18E0:LD8E0_SetNT_00 NesPrgRom:18EB:LD8EB_SetNT_01 NesPrgRom:18F6:LD8F6_SetNT_02 NesPrgRom:1901:LD901_SetNT_03 NesPrgRom:190C:LD90C_DrawSomeData NesPrgRom:191E:LD91E_loop NesPrgRom:192C:L192C NesPrgRom:1937:L1937 NesPrgRom:1943::load Y coord and divide by 8 for tile coord NesPrgRom:1959:LD959_Pointer83_HeaderCopy:\nReads data via Pointer_83,\nwrites to Table_06D1,\nSets Pointer_83 to this table\n\nLooks like it's copying a header\nfor nametable or sprite data that\nis currently in RAM. NesPrgRom:195B:L195B_loop NesPrgRom:196C:LD96C_Pointer83_PixelToTile:\nTakes pixel coords an converts to\ntile coords?\n\nData at (Pointer_83) is the header\nfor nametable data in RAM. NesPrgRom:196E:L196E_loop NesPrgRom:1987:LD987_ArgSwap:\nSwap ArgA+1 with Byte_6A\nSwap ArgB+1 with Byte_6B NesPrgRom:199A:LD99A_CopySomethingTo0777 NesPrgRom:19BD::\nWord_81 = Byte_06CC * Word_06CA.Low NesPrgRom:19D6::\nWord_81 += (Byte_6A - Word_06CA.High) NesPrgRom:19E7::\nWord_81 += Array_85 NesPrgRom:19F4: NesPrgRom:19FF::ensure data ends with a null NesPrgRom:1A03:LDA03_loop NesPrgRom:1A0C:LDA0C NesPrgRom:1A31:LDA31 NesPrgRom:1A41::\nWord_81 = Word_06CA.High * 8 NesPrgRom:1A59::\nWord_81 += Word_87 NesPrgRom:1A66: NesPrgRom:1A72::\nByte_06CC = (Word_66+1) >> 1 NesPrgRom:1A7E:L1A7E:\nByte_06CC = (Word_66 >> 1)+1 NesPrgRom:1A87:L1A87 NesPrgRom:1A99:L1A99_loop:\nByte_06CC is loop counter NesPrgRom:1AAB:LDAAB NesPrgRom:1AE4:LDAE4 NesPrgRom:1AF7:L1AF7 NesPrgRom:1B12:L1B12_loop NesPrgRom:1B1C:L1B1C NesPrgRom:1B34:LDB34_BufferSomePPUStuff:\nBuffers some PPU data and\nwaits for NMI to draw it. NesPrgRom:1B3A::\nvertical PPU increment NesPrgRom:1B4D:L1B4D:\nhorizontal PPU increment NesPrgRom:1B5D:LDB5D NesPrgRom:1B76::\nWord_06C3 += Byte_6A NesPrgRom:1B87::\nWord_06C3 += Word_0747 NesPrgRom:1B9A::\nWord_0774 = Word_06C3 NesPrgRom:1BA6: NesPrgRom:1BB1:LDBB1 NesPrgRom:1BB3:LDBB3 NesPrgRom:1BB8:L1BB8 NesPrgRom:1BC3::\nSet NMI action to write PPU\ndata, then wait for it to\nexecute. NesPrgRom:1BD4:LDBD4 NesPrgRom:1C33:L1C33 NesPrgRom:1C39:L1C39 NesPrgRom:1C3E:L1C3E_loop NesPrgRom:1C50:L1C50 NesPrgRom:1C57:L1C57 NesPrgRom:1C94:LDC94 NesPrgRom:1CB0:L1CB0 NesPrgRom:1CC2:L1CC2 NesPrgRom:1CD4:LDCD4_BufferPPUData:Buffers some PPU data using\ntables in the HW stack.\n\nAlways Attribute data? NesPrgRom:1CD6::horizontal drawing NesPrgRom:1CF0:L1CF0 NesPrgRom:1D11:L1D11 NesPrgRom:1D2B:LDD2B NesPrgRom:1D2D:L1D2D NesPrgRom:1D35:L1D35 NesPrgRom:1D44:LDD44_CopyPaletteToBuffer:\nCopies palette data from the tape\ndata buffer (Pointer_9A) to a\npalette buffer at $0610 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:1D7F:L1D7F NesPrgRom:1D90:L1D90 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: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. NesPrgRom:2329::\nSwitch first bank to data NesPrgRom:2353:L2353_loop NesPrgRom:2364:L2364_Loop:\nLoad tile data from ROM into a buffer in RAM NesPrgRom:2368::Branch if data < $30 NesPrgRom:236A::This is never written to with something != 0 NesPrgRom:2372:L2372 NesPrgRom:2378::Loop if Y < pointer low address NesPrgRom:238B::\nIncrement some pointers NesPrgRom:23A9::\nWrite first half of attribute data NesPrgRom:23CE:L23CE_Loop NesPrgRom:23D3::Write it to the stack? what? NesPrgRom:23E9::\nWrite second half of attribute data NesPrgRom:240C:L240C_loop NesPrgRom:2435::\nBuffer then write palette data NesPrgRom:2446:L2446_loop NesPrgRom:2453::Null terminate data too? NesPrgRom:246A::\nRestore previous PRG bank NesPrgRom:246E:LoadCHRData_A:Load CHR data from a bank into the PPU.\nBank is determined by using A as an index to the 8-byte\nwide data table starting at $FF43. NesPrgRom:2478:LoadCHRData_B:Load CHR data from a bank into the PPU.\nThis entry point expects an index to already be prepared\nin X prior to calling. NesPrgRom:2480::Turn off sprites and BG NesPrgRom:24A6::\nSet background pattern table address NesPrgRom:24AE:L24AE_loop:\nWrite tile loop\nOne tile per loop NesPrgRom:24B1::\nDataPointer_02 holds the destination PPU address. NesPrgRom:24BD:L24BD_loop:\nWrite CHR loop.\nOne byte (tile row) per loop. NesPrgRom:24E5::\nReset bank to previous now that data is read. NesPrgRom:24FB:L24FB NesPrgRom:2530:L2530_Loop NesPrgRom:2539:L2539 NesPrgRom:254C:L254C_loop NesPrgRom:2585:L2585 NesPrgRom:25B5:L25B5 NesPrgRom:25BD:L25BD NesPrgRom:25F1:L25F1 NesPrgRom:2615:LE615_JumpTableExec:\nJump to address in $441A NesPrgRom:2618:L2618 NesPrgRom:262E:LE62E_SpriteShenanigans:\nBunch of sprite related stuff. NesPrgRom:2690:L2690 NesPrgRom:26C4:L26C4 NesPrgRom:26D6:L26D6 NesPrgRom:26DD:L26DD NesPrgRom:26DF:L26DF NesPrgRom:26E4:L26E4 NesPrgRom:2700:RESET_JMP NesPrgRom:2706:L2706_SetupNMI_ED00_LongJump NesPrgRom:2718:L2718 NesPrgRom:271B:L271B_FrameWait_JMP:\nJMP's to L2BFC.\nWhy not just JSR to that address directly? NesPrgRom:2721:L2721_TurnOnNMI_LongJump NesPrgRom:2724:L2724_TurnOffNMI_LongJump NesPrgRom:2727:L2727 NesPrgRom:272D:L272D NesPrgRom:2733:L2733_WriteScroll_LongJmp NesPrgRom:2739:L2739:\nJust JMP's to L3513.\nAgain, why not just JSR to the label directly? NesPrgRom:273C:L273C_InfLoop NesPrgRom:273F:LE73F_Controller_Shenanigans_JMP NesPrgRom:2742:L2742_PossibleDataRecorder_LongJmp NesPrgRom:2745:LE745_StrobeControllers_LongJmp NesPrgRom:2751:L2751_ReadControllers_JMP NesPrgRom:2754:Power_On_Reset:\nThis is JMP'd to (eventually) after a power cycle. NesPrgRom:2756::\nTurn off PPU stuff NesPrgRom:275E::\nWait for next frame (these two loops happen twice). NesPrgRom:2760:L2760 NesPrgRom:2765:L2765 NesPrgRom:276E::\nClear addresses $4400 to $4EFF (notably leaving the\npage at $4F00 untouched). NesPrgRom:277C:ClearRAMChunk:\nClears the the RAM address pointed to by $30 and $31.\nA is the value to write.\nY is the first loop counter (offset counter).\nX is the second loop counter (page counter). Increments\n$31 when DEX'd. NesPrgRom:27A5:ClearZeroPageLoop NesPrgRom:27AB::\nClear $0300-$0700 NesPrgRom:27B2::\nClear sprite RAM (using $F4) NesPrgRom:27BB::\nClear first nametable NesPrgRom:27C4::\nClear second nametable NesPrgRom:27CD::\nClear third nametable NesPrgRom:27D6::\nClear fourth nametable NesPrgRom:27DF::BG patterns at $1000; scroll to $2800 NesPrgRom:27E6::Disable drawing and DMC stuff NesPrgRom:27F3::Enable pulse 1/2, triangle, and noise NesPrgRom:27F8::Inhibit frame counter IRQ, set mode to 5-step NesPrgRom:2833:L2833 NesPrgRom:2840:L2840:\nCheck for power-on button\nstatus. Holding buttons &\nturning the power on will\nstart debugging screens. NesPrgRom:2842::B Button NesPrgRom:2849:L2849:B + Select buttons NesPrgRom:2850:L2850 NesPrgRom:2857::A button NesPrgRom:2860:L2860 NesPrgRom:2874::\nCheck for Test mode?\nData at $E8EC starts "TEST MODE" text NesPrgRom:2884:L2884 NesPrgRom:288C:LE8CC NesPrgRom:28BA:L28BA_palette_to_buffer NesPrgRom:28CD::\nWait for next frame after palette data is written NesPrgRom:28E6:L28E6 NesPrgRom:2914:L2914 NesPrgRom:291F:L291F NesPrgRom:2923:L2923 NesPrgRom:2939:L2939 NesPrgRom:294F:L294F NesPrgRom:2965:L2965 NesPrgRom:297C:L297C_NoTapeLoop:Loop here while there is no\ntape present/ready. NesPrgRom:29A3:L29A3 NesPrgRom:29B4:L29B4_PageSelFrameLoop NesPrgRom:29C4:L29C4 NesPrgRom:29C7::tape ready? NesPrgRom:29DF:L29DF NesPrgRom:2A1B:L2A1B NesPrgRom:2A21:L2A21 NesPrgRom:2A3B:L2A3B NesPrgRom:2A48:L2A48 NesPrgRom:2A5D:L2A5D NesPrgRom:2A6A:L2A6A NesPrgRom:2A77:L2A77 NesPrgRom:2A7F:L2A7F NesPrgRom:2AA9:L2AA9 NesPrgRom:2AAA:LEAAA_HidePageSelect:Removes the page select\nnumbers from screen when\ntape is missing/not ready. NesPrgRom:2AD3:L2AD3 NesPrgRom:2AED:L2AED NesPrgRom:2AFC:L2AFC_UpdatePgSelection:Updates the page selection\ndigits on the start screen.\n\nThis includes increasing and\ndecreasing the numbers on\nUp/Down button presses. NesPrgRom:2B03::B not pressed NesPrgRom:2B3A:L2B3A NesPrgRom:2B42::right NesPrgRom:2B46::left NesPrgRom:2B4A::down NesPrgRom:2B4E::up NesPrgRom:2B5E:L2B5E NesPrgRom:2B64:L2B64 NesPrgRom:2B71:L2B71 NesPrgRom:2B75:L2B75 NesPrgRom:2B77:L2B77 NesPrgRom:2B7D:L2B7D NesPrgRom:2B8F:L2B8F NesPrgRom:2B93:L2B93 NesPrgRom:2B97:L2B97_Loop:Number -> tile ID for page\nselection digits NesPrgRom:2BA2::loops twice NesPrgRom:2BA6:LEBA6_BufferPageSelDigits:\nfirst page sel digit NesPrgRom:2BB9::\nsecond page sel digit NesPrgRom:2BCD:L2BCD NesPrgRom:2BD8:L2BD8 NesPrgRom:2BDC:L2BDC NesPrgRom:2BFC:L2BFC_FrameWait:\nWait for NMI to happen NesPrgRom:2C03:L2C03_Loop NesPrgRom:2C08:L2C08:doing some math and\nshifting stuff. idk. NesPrgRom:2C1D:L2C1D_Loop NesPrgRom:2C24:L2C24 NesPrgRom:2C32:L2C32 NesPrgRom:2C61:L2C61 NesPrgRom:2C66:L2C66 NesPrgRom:2C6F:L2C6F_ReadButtons:Sets flags based on the\npressed status of A, B,\nStart, Select, Left, & Right.\nNote that Up and Down are NOT\nchecked here. NesPrgRom:2C8A:L2C8A NesPrgRom:2C8E::A not pressed NesPrgRom:2C94:L2C94 NesPrgRom:2C96::B not pressed NesPrgRom:2C9C:L2C9C NesPrgRom:2C9E::Select not pressed NesPrgRom:2CA4:L2CA4 NesPrgRom:2CAC:L2CAC NesPrgRom:2CB4:L2CB4 NesPrgRom:2CBC:L2CBC NesPrgRom:2CBD:L2CBD_SetupNMI_ED00:\nSetup the NMI JMP in RAM starting at $07FD.\nWrites JMP $ED00 NesPrgRom:2CCD:L2CCD_SetupNMI_Initial:Setup the initial NMI\nhandler NesPrgRom:2CE8:L2CE8 NesPrgRom:2D00:NMI_ED00 NesPrgRom:2D29:L2D29 NesPrgRom:2D4E:NMI_ED4E NesPrgRom:2D53::\nBackup some pointers NesPrgRom:2D6C::Branch if data >= $06 NesPrgRom:2D77:L2D77:\nAudio stuff? NesPrgRom:2D81:L2D81 NesPrgRom:2D84:L2D84 NesPrgRom:2D8E::\nRestore pointers NesPrgRom:2DA6:NmiDoAction:\nExecute the action that was\nset during the frame, if any.\nThe action ID is in $94. NesPrgRom:2DB2:LEDB2 NesPrgRom:2DBE:LEDBE NesPrgRom:2DC5:LEDC5_rts NesPrgRom:2DCA:LEDCA_WritePPUData_Horiz:\nReads data directly after\naddress in the buffer NesPrgRom:2DDA:L2DDA_Loop NesPrgRom:2DEC:L2DEC_loop NesPrgRom:2E07:L2E07 NesPrgRom:2E08:L2E08 NesPrgRom:2E18:LEE18_IncBy16_B0 NesPrgRom:2E26:L2E26 NesPrgRom:2E2F:L2E2F NesPrgRom:2E32:L2E32_PossibleDataRecorder:Lots of writing to 4016.\nlooks a lot like writing to\nthe data recorder. NesPrgRom:2E4F:LEE4F_loop NesPrgRom:2E68:LEE68_rts NesPrgRom:2E69:L2E69_StrobeControllers:Backs up A in stack NesPrgRom:2E71:LEE71_SBC_DelayLoop:\ndelay loop using SBC NesPrgRom:2E75:L2E75_loop NesPrgRom:2E7B:LEE7B_IRQ NesPrgRom:2E96:L2E96 NesPrgRom:2E9D::disable data decoding? NesPrgRom:2EAC:L2EAC NesPrgRom:2EB5:L2EB5 NesPrgRom:2EBF:L2EBF NesPrgRom:2ECA:L2ECA NesPrgRom:2ECF:L2ECF NesPrgRom:2ED1::enable data decoding? NesPrgRom:2EE2:L2EE2 NesPrgRom:2F04:L2F04 NesPrgRom:2F13:L2F13 NesPrgRom:2F2D:L2F2D NesPrgRom:2F47:L2F47 NesPrgRom:2F54:L2F54 NesPrgRom:2F59:L2F59 NesPrgRom:2F66:L2F66_RTI NesPrgRom:2F6C:L2F6C NesPrgRom:2F72:L2F72 NesPrgRom:2F85:LEF85 NesPrgRom:2F98:LEF98 NesPrgRom:2FA2:LEFA2 NesPrgRom:2FB1:LEFB1 NesPrgRom:2FC0:L2FC0 NesPrgRom:2FC3:LEFC3 NesPrgRom:2FD5:L2FD5 NesPrgRom:2FEC:L2FEC NesPrgRom:2FFC:L2FFC NesPrgRom:300C:L300C NesPrgRom:3024:LF024 NesPrgRom:3025:LF025 NesPrgRom:303E:LF03E NesPrgRom:3048:LF048 NesPrgRom:3067:LF067 NesPrgRom:306A:LF06A NesPrgRom:3070:LF070 NesPrgRom:3073:LF073 NesPrgRom:307B:LF07B NesPrgRom:3085:LF085 NesPrgRom:308E:LF08E NesPrgRom:3097:LF097 NesPrgRom:30A7:LF0A7 NesPrgRom:30AE:L30AE NesPrgRom:30B8:L30B8 NesPrgRom:30BF:L30BF NesPrgRom:30E6:LF0E6 NesPrgRom:30F7:LF0F7 NesPrgRom:3104:LF104 NesPrgRom:3106:LF106 NesPrgRom:3109:LF109 NesPrgRom:311B:LF11B NesPrgRom:3131:L3131 NesPrgRom:314C:L314C NesPrgRom:3153:L3153 NesPrgRom:3158:L3158 NesPrgRom:3169:L3169 NesPrgRom:316C:L316C NesPrgRom:318B:LF18B NesPrgRom:318E:LF18E NesPrgRom:3197:LF197 NesPrgRom:31D1:LF1D1 NesPrgRom:31EC:LF1EC NesPrgRom:31F5:L31F5 NesPrgRom:31F6:LF1F6 NesPrgRom:3209:L3209 NesPrgRom:3214:L3214 NesPrgRom:321A:L321A NesPrgRom:325E:L325E NesPrgRom:3280:L3280 NesPrgRom:3285:L3285 NesPrgRom:3297:L3297 NesPrgRom:329D:L329D NesPrgRom:329E:L329E NesPrgRom:32A6:L32A6 NesPrgRom:32AD:LF2AD NesPrgRom:32C7:L32C7 NesPrgRom:32DA:L32DA NesPrgRom:32DE:L32DE NesPrgRom:32EB:L32EB_rts NesPrgRom:33A4:L33A4_WritePPUData_Vert:\nBuffer starts at $0302 NesPrgRom:33A6::This does nothing but waste cycles (maybe it was a constant in source to help with debugging or something?). NesPrgRom:33B2::JMP relative to end of loop (exit check) NesPrgRom:33B4:L33B4_outer_loop NesPrgRom:33C3::Max length of 64 bytes NesPrgRom:33C6:L33C6_loop NesPrgRom:33D5::???\nThis will set the address to whatever is in X NesPrgRom:33E1:L33E1 NesPrgRom:33E2:L33E2:\nCheck for NULL terminator NesPrgRom:33EE:L33EE_Buffer_Data NesPrgRom:33F0::\nRead low bits into DataValue_04+1 NesPrgRom:33F6::\nRead high bits into DataValue_04+0 NesPrgRom:3401:L3401_loop NesPrgRom:3418:L3418_loop NesPrgRom:342B::\nIncrement pointer to next PPU row? NesPrgRom:343C::\nInsert NULL terminator NesPrgRom:3442:L3442_Idk:\nCMP's X+1 to data at $0300.\nIf less than, RTS.\nOtherwise store $00 at $0302+X, where\nX = data at $301. Then discard the top\ntwo values on the stack. NesPrgRom:3455:L3455_RTS NesPrgRom:3456:L3456:\nhuh? NesPrgRom:3466:L3466_loop NesPrgRom:346D:L346D_WriteSprites NesPrgRom:3490:Read_Controllers NesPrgRom:34A2:L34A2_loop NesPrgRom:3513:L3513_ReadControllerData:\nRead some controller data and do some bitwise operations\non the data. NesPrgRom:3520:L3520_loop NesPrgRom:352F:ClearNametable:\nClears a nametable and it's attribute table.\nA, X, and Y are backed up in $00, $01, and $02\nA is the high byte of the nametable.\nY is the attribute data to write.\nX is the data to write to the nametable. NesPrgRom:353A::Set horizontal PPU write. NesPrgRom:3553:L3553 NesPrgRom:3557:ClearNametable00Loop NesPrgRom:3568::\nClears the Attribute table (even though it's written to\nin the above loop, it's got bogus data). NesPrgRom:3574:ClearAttrTable00Loop NesPrgRom:357A:L357A NesPrgRom:357D:FillRAMBlock:\nFills RAM with the value in A. Banks are cleared backwards\n(high to low). X holds the high address to stop at, Y holds\nthe high address to start at. NesPrgRom:357E::\nX = Y - X (this will wrap around)\nX++ each loop\nstop loop when X = 0 NesPrgRom:3585::\nRestore A and use Y as the byte offset. NesPrgRom:358A:ClearRAMBlock_Loop NesPrgRom:3591::\nNext bank. NesPrgRom:3595:L3595_WriteScroll:\nWrites the scroll positions to the PPU\n$FD is X\n$FC is Y NesPrgRom:35A8:L35A8_TurnOnSpritesAndBG NesPrgRom:35B2:L35B2_TurnOffSpritesAndBG NesPrgRom:35BC:L35BC_TurnOnNMI NesPrgRom:35C9:L35C9_TurnOffNMI NesPrgRom:35D6:LF5D6_LoadFromPPU:\nLoad data from the PPU NesPrgRom:35D8::horiz increment NesPrgRom:35E1::turn off BG and SP NesPrgRom:3612:LF612_loop NesPrgRom:3639:L3639_Controller_Shenanigans:\nsome weird writes to $4016 & \n$4017 with delay loops. NesPrgRom:3688:LF688 NesPrgRom:368E:LF68E_DelayLoop NesPrgRom:3691:LF691_loop NesPrgRom:3696:LF696_Sta4016 NesPrgRom:36A0:L36A0 NesPrgRom:36A5::A or B pressed NesPrgRom:36AA::something else pressed NesPrgRom:36B1:L36B1 NesPrgRom:36BD:L36BD NesPrgRom:36CC:L36CC NesPrgRom:36D0:LF6D0_ReadControllers:\nsets carry based on zpF3_Controller NesPrgRom:36DF:L36DF_CLC_RTS NesPrgRom:36E1:L36E1_ClearControllerAndExpData:\nClears the following addresses:\n$4401, $4402, $4403\n$4404, $4405, $4406\n$4407, $4408, $4409\nAs well as the flag $440A NesPrgRom:36E8:L36E8 NesPrgRom:36F5:L36F5_ReadControllers NesPrgRom:36FA:L36FA_Loop:\nEOR the expansion data with some masks and update\nthe masks. Check for new data? NesPrgRom:370E::Bit 0 of 4th byte?? NesPrgRom:3714::clear oVerflow NesPrgRom:3715:L3715 NesPrgRom:371E:L371E NesPrgRom:3724:L3724 NesPrgRom:3726:L3726:Set to $FF if "A" is pressed\non expansion 4th byte.\nDoes any controller send\nfour data bytes? NesPrgRom:3732:ReadControllerAndExpData:Read 4016 (3*8) times and save\ndata separately.\n\nExpansion data is saved separately again.\n\n4401-4403 holds controller 1's data, one byte\nper read loop.\n4404-4406 holds the expansion data, one\nbyte per read loop. NesPrgRom:3734::Strobe controller NesPrgRom:373E:L373E_OuterLoop:\nRead 16 bits per outer loop NesPrgRom:3740:L3740_InnerLoop:\nRead the last two bits per inner loop. NesPrgRom:3743::Main controller NesPrgRom:3747::Expansion controller NesPrgRom:3752:LF752_RamBankStuff NesPrgRom:3758:L3758_RamBankStuff NesPrgRom:3870:L3870 NesPrgRom:38CF:L38CF NesPrgRom:38EA:L38EA NesPrgRom:38EB:L38EB_DisableAudio NesPrgRom:38F5:L38F5_EnableAudio NesPrgRom:38FF:L38FF_NMITapeStuff:\ncalled during NMI at ED00 NesPrgRom:3910:L3910 NesPrgRom:391D:L391D NesPrgRom:3927:L3927 NesPrgRom:3941:L3941 NesPrgRom:3967:L3967 NesPrgRom:3971:L3971 NesPrgRom:397D:L397D NesPrgRom:39C1:L39C1 NesPrgRom:39D0:L39D0 NesPrgRom:39DA:L39DA NesPrgRom:39E1:L39E1 NesPrgRom:39F2:L39F2 NesPrgRom:39F9:L39F9 NesPrgRom:3A04:L3A04_rts NesPrgRom:3A05:LFA05 NesPrgRom:3A19:L3A19 NesPrgRom:3A25:L3A25 NesPrgRom:3A3A:L3A3A_rts NesPrgRom:3A3B:L3A3B NesPrgRom:3A58:L3A58 NesPrgRom:3A5D:L3A5D NesPrgRom:3A80:L3A80 NesPrgRom:3AA1:L3AA1 NesPrgRom:3AAA:L3AAA NesPrgRom:3AB7:L3AB7 NesPrgRom:3ACB:L3ACB NesPrgRom:3AD8:L3AD8 NesPrgRom:3AE7:L3AE7 NesPrgRom:3AFB:L3AFB NesPrgRom:3B08:L3B08 NesPrgRom:3B09:LFB09 NesPrgRom:3B20:L3B20 NesPrgRom:3B39:L3B39_rts NesPrgRom:3B3A:L3B3A NesPrgRom:3B40:L3B40 NesPrgRom:3B5D:L3B5D NesPrgRom:3B79:L3B79 NesPrgRom:3C7D:L3C7D NesPrgRom:3C8B:L3C8B NesPrgRom:3C8D:L3C8D NesPrgRom:3CA1:L3CA1 NesPrgRom:3CA5:L3CA5 NesPrgRom:3CC2:L3CC2 NesPrgRom:3CD7:L3CD7 NesPrgRom:3CE1:L3CE1 NesPrgRom:3CEB:L3CEB NesPrgRom:3D03:L3D03 NesPrgRom:3D0E:L3D0E NesPrgRom:3D56:L3D56_DecArray_07E1:Decrements values in Array_07E1,\nbut will not go negative. NesPrgRom:3D64:L3D64_loop NesPrgRom:3D6C:L3D6C NesPrgRom:3DA4:L3DA4_loop NesPrgRom:3DB3:LFDB3_StrobeTape:Strobes $4202 and waits for\nan ACK of each strobe. NesPrgRom:3DC6:L3DC6 NesPrgRom:3DCB::wait for data ready NesPrgRom:3DDC:L3DDC NesPrgRom:3DE1::wait for data ready NesPrgRom:3DE4:LFDE4_WaitLoop_05 NesPrgRom:3DE9:LFDE9_WaitLoop_32 NesPrgRom:3DEB:L3DEB_loop NesPrgRom:3DF0:PokeDriveController:\nPokes the drive control register ($4202) then waits\nfor a bunch and pokes it again after resetting bit 5. NesPrgRom:3DF2::Turn off bit 5 (Don't reset drive controller) NesPrgRom:3DF6::\nRequest data? NesPrgRom:3DF9::\nWait loop NesPrgRom:3DFB:L3DFB_loop NesPrgRom:3DFE::\nReset controller? NesPrgRom:3E06:RESET:\nThis is the RESET vector NesPrgRom:3E15:L3E15 NesPrgRom:3E18:LFE18_SetupNMI NesPrgRom:3E2A:LFE2A_MemorySelfTest NesPrgRom:3E58:LFE58 NesPrgRom:3E5D:L3E5D NesPrgRom:3E73:L3E73 NesPrgRom:3E7E:L3E7E NesPrgRom:3E8C:L3E8C NesPrgRom:3E9C:LFE9C NesPrgRom:3EA0:LFEA0 NesPrgRom:3EA6:L3EA6 NesPrgRom:3EBE:L3EBE NesPrgRom:3EE9:L3EE9 NesPrgRom:3F0A:L3F0A NesPrgRom:3F40-3F7F:Screen_Lookup:Data is in three (four?) bytes:\n0 - Tile Bank\n1-2 - Tile data address\n3 - Pattern bank\n4-5 - Pattern address\n6-7 - ?? NesPrgRom:3FF8-3FF9:VECTOR_NMI NesPrgRom:401C:L801C NesPrgRom:4025:L4025 NesPrgRom:4055:L4055 NesPrgRom:405D:L405D NesPrgRom:40A4:L40A4 NesPrgRom:40AE:L40AE NesPrgRom:40B6:L40B6 NesPrgRom:417A:L417A NesPrgRom:4186:VMCodeLoop NesPrgRom:4191:L4191_loop NesPrgRom:419D:L419D NesPrgRom:41AF:L41AF NesPrgRom:41B2:L41B2 NesPrgRom:41B8:L41B8 NesPrgRom:41BB::#$80 is not part of the data NesPrgRom:41E1:L81E1 NesPrgRom:41E7:L81E7_ExecuteOpcode NesPrgRom:41F2:L81F2 NesPrgRom:41FF:L41FF NesPrgRom:420A:L820A NesPrgRom:420D:L820D_SwapToRamBank0 NesPrgRom:421C:L821C_RestorePrevRamBank NesPrgRom:422C:L822C_RamBankB_Check:If $45FE is negative, chop\noff the top bit, shift it\nleft 4 times (high nibble to\nlow), and store that into\nRamBank_B. Clear this high\nnibble from $45FE at the end. NesPrgRom:4241:L4241 NesPrgRom:4242:L4242 NesPrgRom:424B:L824B NesPrgRom:424C:L824C NesPrgRom:424D:Handler_81_InfLoop:Handler for bytecode $81.\nInfinite loop. NesPrgRom:4250:L4250 NesPrgRom:4260:L4260 NesPrgRom:4262:L4262 NesPrgRom:4275:L4275 NesPrgRom:4278:L4278 NesPrgRom:4280:L4280 NesPrgRom:428B:L428B NesPrgRom:428E:L428E NesPrgRom:4296:L4296 NesPrgRom:42BA:L42BA NesPrgRom:42C5:L42C5 NesPrgRom:42C8:L42C8 NesPrgRom:42D0:L42D0 NesPrgRom:42D5:L82D5_SetupArguments:\nBased on BytecodeMetadata,\ntake data off the stack an put\nit into ArgA-ArgG. NesPrgRom:4308:L4308 NesPrgRom:4313:L4313 NesPrgRom:4316:L4316 NesPrgRom:4331:L8331_SetReturnCodes:Takes values in Arguments and\nputs them on the stack based\non BytecodeMetadata values. NesPrgRom:4338:L4338 NesPrgRom:434B:L434B NesPrgRom:434C:L434C NesPrgRom:4366:L4366_RTS NesPrgRom:4367:Handler_CB_Sum:Sum Argument_A and Argument_B\nResult in Argument_A NesPrgRom:4375:Handler_CC_Subtract:Subtract Argument_B from Argument_A\nResult in Argument_A NesPrgRom:4383:Absolute_ArgA:Negates Argument_A if it\nis negative. NesPrgRom:438C:L438C NesPrgRom:438D:Handler_CF_Negate:Subtract Argument_A from Zero\nResult in Argument_A NesPrgRom:438E:Negate_NoSEC:\nNegate, but don't set the carry NesPrgRom:439B:Swap_ArgA_ArgB:Swaps the contens of\nArgument_A and Argument_B NesPrgRom:43B0:Multiply_ArgA_ArgB:Multiply Argument_A and Argument_B\nResult in DoubleWord_34 NesPrgRom:43BE:L83BE_loop NesPrgRom:43D1:L83D1 NesPrgRom:43DF:Handler_CD_Multiply:Multiply Argument_A by Argument_B\nResult is a double word in both Argument_A and Argument_B NesPrgRom:4406::\nnegate if one input arg\nwas negative NesPrgRom:441F:L841F_positive NesPrgRom:4422:L8422_loop NesPrgRom:442C:Handler_CE_SignedDivide:Divides Argument_A by Argument_B\nResult in Argument_A\nRemainder in Argument_C (not pushed to stack) NesPrgRom:4450:L4450 NesPrgRom:4467:L4467_positive NesPrgRom:4478:L4478_rts NesPrgRom:4479:Handler_E0_Modulo:Calls Handler_CE_SignedDivide\nResult in Argument_A (opposed to Argument_C) NesPrgRom:4485:Handler_C5_Equals:Compares (subtracts) Argument_A and Argument_B\nReturns 1 if Equal\nReturns 0 if Not Equal\nReturn value in Argument_A NesPrgRom:4492:Handler_C6_NotEqual NesPrgRom:4498:Handler_C7_LessThan:If Argument_A < Argument_B\n Return_One\nElse\n Return_Zero NesPrgRom:449D::ArgA < ArgB NesPrgRom:449F::ArgA >= ArgB NesPrgRom:44A1:Handler_C8_LessThanOrEqual:If Argument_A <= Argument_B\n Return_One\nElse\n Return_Zero NesPrgRom:44A6::ArgA < ArgB NesPrgRom:44A8::ArgA != ArgB NesPrgRom:44AC::ArgA != ArgB NesPrgRom:44AE::ArgA == ArgB NesPrgRom:44B0:Handler_C9_GreaterThan:If Argument_A > Argument_B\n Return_One\nElse\n Return_Zero NesPrgRom:44B3::negate prev JSR result NesPrgRom:44B6:Handler_CA_GreaterThanOrEqual NesPrgRom:44B9::negate prev JSR result NesPrgRom:44BC:L84BC_GreaterOrEqualToZero:If Argument_A >= 0\n Return_One\nElse\n Return_Zero NesPrgRom:44C2:LongBranch_ReturnOne NesPrgRom:44C5:LongBranch_ReturnZero NesPrgRom:44C8:LongBranch_EqualsZero NesPrgRom:44CB:Handler_DA_IntToString:Stringifies Argument_A\nResult in buffer at $0700\nResult is null terminated NesPrgRom:44D6:L84D6_positive:#$20 if positive; #$2D if negative NesPrgRom:44E3:L84E3_loop:binary to ascii\nstored backwards starting at $0720 NesPrgRom:44F8:L84F8_loop:reverse above result and\nstore in $0700 NesPrgRom:4508:L8508_MinusChar NesPrgRom:450C:L850C_PlusChar NesPrgRom:450F:Handler_8D_StringToInt:takes string at $0700 and\nconverts to an integer\nResult in ArgA? NesPrgRom:4524:L8524 NesPrgRom:4535:L8535_loop NesPrgRom:454D:L854D_done NesPrgRom:4554:L8554_AsciiToBin NesPrgRom:455F:L855F_CLC_RTS NesPrgRom:4560:L8560_RTS NesPrgRom:4561:Handler_D0_Modulus:Divide abs(Word_B8) by Argument_A\nResult is in Argument_A\n\nWhere is Word_B8 populated?! NesPrgRom:4564:L8564_loop NesPrgRom:4570:L8570_loop NesPrgRom:4582:L8582_loop NesPrgRom:458C:Divide:Divide Argument_A by Argument_B\nResult in Argument_A\nRemainder in DoubleWord_34 (ArgC and ArgD) NesPrgRom:459C:L459C NesPrgRom:45A3:L45A3 NesPrgRom:45BE:L45BE NesPrgRom:45C8:L45C8 NesPrgRom:45D4:Handler_B7_DerefPointer:\nDeref **CodePointer\nCode has an inline pointer.\nderef it & put it on the stack. NesPrgRom:45D7:L45D7_loop NesPrgRom:45EA:L45EA NesPrgRom:45ED:L45ED_loop NesPrgRom:45FF:L45FF NesPrgRom:4600:Handler_BA_PushToStack:Push an arbitrary 32 bytes to\nthe stack. Data is pointed to\nby an inline argument in the code. NesPrgRom:4603:L8603_loop:\nInline arg (ptr) -> ArgA NesPrgRom:4616:L8616 NesPrgRom:4619:L8619_loop:Push 32 bytes to stack pointed\nto by Argument_A NesPrgRom:462C:Handler_B8_PushWordToStack:\nPush inline word to stack NesPrgRom:462F:L462F NesPrgRom:4641:L4641 NesPrgRom:464C:L464C NesPrgRom:464D:Handler_BB_PushData:Push a null-terminated string\nof data to the stack.\nIncrement StackPointer by 32,\nalways. NesPrgRom:464F:L464F_loop NesPrgRom:4664:L4664 NesPrgRom:4667::string buffers on stack are always 32-bytes NesPrgRom:466F:L466F NesPrgRom:4670:Handler_B9_IndexedDeref:\nPush the value at the inline\naddress + word offset from stack. NesPrgRom:4676:L4676 NesPrgRom:4688:L4688 NesPrgRom:4689:Handler_BC_PushStringToStack_FromTable:Push a string from table\n(addr inline, offset stack)\nto the stack. NesPrgRom:468F:L868F_loop NesPrgRom:46A1:L86A1 NesPrgRom:46A2:Handler_E9_SetupLoop:Inline word -> stack\nCodePointer -> stack NesPrgRom:46A5:L46A5_loop:\ninline arg -> ArgA NesPrgRom:46B8:L46B8 NesPrgRom:46BB:L46BB:\nArgA -> stack NesPrgRom:46CE:L46CE NesPrgRom:46D1:L46D1:\nCodePointer -> stack NesPrgRom:46E4:L46E4 NesPrgRom:46E5:Handler_BD_PopAndStore:Destination is inline word\nWrites word from stack to destination NesPrgRom:46E8:L46E8_loop:\ninline -> ArgA NesPrgRom:46FB:L46FB NesPrgRom:4706:L4706 NesPrgRom:4709:L4709_loop NesPrgRom:4711:Handler_8A_PopStringToAddr:Destination is inline\nPops 32 bytes from stack and\nwrites to destination NesPrgRom:4714:L8714_loop:\ninline -> ArgA NesPrgRom:4727:L4727:\nStack_Pointer -= 32 NesPrgRom:4732:L4732 NesPrgRom:4735:L4735_loop NesPrgRom:473D:Handler_BE_WriteToWordTable:Base addr inline\nOffset in stack\nWrites two bytes from stack NesPrgRom:474B:L474B NesPrgRom:474E:L474E NesPrgRom:4756:Handler_EA_WriteToStringTable:Base addr inline\nOffset in stack\nWrites 32 bytes from stack NesPrgRom:476F:L876F_CalcAddrOffset:\nArgA = (Stack*2)+Inline\n\nCalculate address using inline\nas the base and the stack value as\na word offset. NesPrgRom:4772:L4772:\nInline word -> ArgB NesPrgRom:4785:L4785:\nPop word -> ArgA NesPrgRom:4790:L4790 NesPrgRom:4793:L4793 NesPrgRom:479B: NesPrgRom:47AD:L87AD_IndexedDeref_StringTable:Index into a string table.\nBase addr is inline.\nOffset is on stack. NesPrgRom:47B0:L87B0_loop:\ninline arg -> ArgB NesPrgRom:47C3:L87C3 NesPrgRom:47CE:L87CE NesPrgRom:47D1:L87D1_loop:\npop word -> ArgA NesPrgRom:47FB:Handler_96_SetWord4E:\nSet Word_4E to inline word argument. NesPrgRom:47FE:L87FE_loop NesPrgRom:4811:L8811 NesPrgRom:4812:L4812_NotZero:\nDon't jump NesPrgRom:481D:L481D NesPrgRom:481E:Handler_BF_JumpIfNotZero:\nSet Code_Pointer to\ninline argument NesPrgRom:4821:Handler_C0_JumpIfZero:\nSet Code_Pointer to\ninline argument NesPrgRom:4829:Handler_84_Jump:\nSet Code_Pointer to\ninline argument NesPrgRom:482C:L482C:\ninline -> argA NesPrgRom:4837:L4837_loop:\nArgA -> Code_Pointer NesPrgRom:4841:Handler_85_Call:\nInline word is destination NesPrgRom:4844:L4844_loop:\nCode_Pointer -> ArgA NesPrgRom:484D::\nCode_Pointer += 2 NesPrgRom:4858:L4858 NesPrgRom:485B:L485B_loop:\nCode_Pointer -> stack NesPrgRom:486E:L486E NesPrgRom:4871:L4871_loop:\n(ArgA) -> Code_Pointer NesPrgRom:487A:Handler_86_Return:\nJump to whatever is on stack NesPrgRom:4885:L4885 NesPrgRom:4888:L4888 NesPrgRom:4891:Handler_C1_JumpSwitch:Inline ArgB (default case & max size)\nArgA is switch value\nArgA is shifted for use as\nindex into pointer table. NesPrgRom:4894:L8894_notloop:\ninline byte -> ArgB NesPrgRom:48A2:L88A2 NesPrgRom:48A8::ArgA == ArgB (inline arg) NesPrgRom:48AA::default case if OOB NesPrgRom:48AC:L88AC NesPrgRom:48BB:L88BB NesPrgRom:48BE:L88BE_ArgB_Jump NesPrgRom:48CB:L88CB NesPrgRom:48CC:Handler_EE_CallSwitch:\nLength & Default case inline word NesPrgRom:48CF:L88CF_notloop:\ninline byte -> ArgB NesPrgRom:48E9:L88E9 NesPrgRom:48EA::\nFind end of table NesPrgRom:4900:L8900 NesPrgRom:490F:L890F NesPrgRom:4912:L8912_loop:\ninline word -> ArgA NesPrgRom:491D:L819D_loop:\nWord_34 (end of table) -> stack NesPrgRom:4930:L8930 NesPrgRom:4933:L8933_loop:\nArgA -> Code_Pointer NesPrgRom:493D:L893D_JumpArgB NesPrgRom:494A:L894A NesPrgRom:494B:Handler_87_Loop:On the stack:\n- Limit\n- Increment\n- LoopVar\n- LoopEntry NesPrgRom:4956:L4956 NesPrgRom:4959:L4959_loop NesPrgRom:496C:L496C NesPrgRom:496F:L496F_loop NesPrgRom:4982:L4982 NesPrgRom:4985:L4985 NesPrgRom:4994:L4994 NesPrgRom:49A2:L49A2 NesPrgRom:49B5:L49B5 NesPrgRom:49B8:L49B8 NesPrgRom:49CA:L49CA NesPrgRom:49CD:L49CD_LessThan NesPrgRom:49D2:L49D2 NesPrgRom:49DD:L49DD NesPrgRom:49E0:L49E0_loop:\nWord_34 -> Code_Pointer NesPrgRom:49EA:Return_One:\nReturns #01 in Argument_A NesPrgRom:49EF:L49EF_STY_RTS NesPrgRom:49F2:Return_Zero:\nReturns #00 in Argument_A NesPrgRom:49F8:Handler_C3_LogicalAND_ArgA_ArgB:\nIf Arg_A != 0 && Arg_B != 0\n Return_One\nElse\n Return_Zero NesPrgRom:4A00:L8A00:\nArgA != 0 NesPrgRom:4A08:L8A08:\nArgB != 0 NesPrgRom:4A0A:Handler_C4_LogicalOR_ArgA_ArgB:^ branch always\n NesPrgRom:4A1C:Handler_C2_Equals_Zero:If Argument_A is zero,\n Return_One\nElse\n Return_Zero NesPrgRom:4A26:Handler_8C_StringLength:Return length of NULL\nterminated string at $0700\nResult in Argument_A NesPrgRom:4A2A:L8A2A_loop NesPrgRom:4A32:L8A32 NesPrgRom:4A35:Handler_D8_TrimStringStart_32:\nTrims the start of the\nstring buffer. NesPrgRom:4A39:Handler_D9_TrimStringStart:\nLike Handler_D8, but doesn't\nload #$20 into ArgB first. NesPrgRom:4A42:L8A42_loop NesPrgRom:4A4D:L8A4D_loop NesPrgRom:4A57::NULL terminated NesPrgRom:4A5D:L8A5D_done NesPrgRom:4A5F:L8A5F_STA_RTS NesPrgRom:4A63:Handler_D6_TruncateString:\nTruncate length in Argument_A NesPrgRom:4A6E:L8A6E NesPrgRom:4A6F:Handler_D7_TrimString:\nChop off a bunch of the start\nof the string. ArgA-2 is\ntail byte count to keep? NesPrgRom:4A88:Handler_8E_ConcatStrings:\nConcatinate string buffer\n$0720 to the end of $0700 NesPrgRom:4A8C:L8A8C_loop:\nfind first NULL NesPrgRom:4A94:L8A94 NesPrgRom:4A96::length check NesPrgRom:4AA4:L8AA4 NesPrgRom:4AA9:L8AA9 NesPrgRom:4AAA:Handler_90_StringsNotEqual:\nIf String_0700 != String_0720\n Return_One\nElse\n Return_Zero NesPrgRom:4AAD::negate prev JSR NesPrgRom:4AB0:Handler_8F_StringsEqual:\nIf String_0700 == String_0720\n Return_One\nElse\n Return_Zero NesPrgRom:4AB2:L8AB2_loop NesPrgRom:4ABD::both equal, found null NesPrgRom:4AC2:Handler_91_CompareStr_LessThan:\nIf String_700 < String_720\n Return_One\nElse\n Return_Zero NesPrgRom:4AC4:L8AC4_loop NesPrgRom:4ACF::NULL check NesPrgRom:4AD4:L8AD4_Return:700 >= 720 NesPrgRom:4AD6::700 < 720 NesPrgRom:4AD8:Handler_92_CompareStr_LtEqual:??\nIf String_700 <= String_720\n Return_One\nElse\n Return_Zero NesPrgRom:4ADA:L8ADA_loop NesPrgRom:4ADD::bail early? NesPrgRom:4AE7:L8AE7_Return:700 < 720 NesPrgRom:4AE9::700 >= 720 NesPrgRom:4AEB:Handler_93_CompareStr_GT:\nProbably this. Handler_92\nneeds clarification. NesPrgRom:4AF1:Handler_94_CompareStr_GreaterThan:\nJust negates Handler_91 NesPrgRom:4AF7:L8AF7_ReturnOne NesPrgRom:4AFA:L8AFA_ReturnZero NesPrgRom:4B03:Handler_E5_DisableSprite:\nSprite property/type/something\nin ArgA. (Table_0140 value) NesPrgRom:4B0B:L4B0B_loop NesPrgRom:4B23:L4B23_next NesPrgRom:4B2A:L4B2A_ClearTables NesPrgRom:4B35:Handler_F0_DisableSprites:\nSprite property/type/something\nis in String_0700. Each char\nof the string is checked against\nevery sprite. NesPrgRom:4B37:L8B37_loop_outer NesPrgRom:4B3E:L8B3E_loop_inner NesPrgRom:4B68:L8B68_next NesPrgRom:4B70:L8B70 NesPrgRom:4B78:Handler_ED NesPrgRom:4B7A:L8B7A_loop NesPrgRom:4BAC:L8BAC_next NesPrgRom:4BB3:L8BB3_DisableSprite:\nDisable sprite at index X NesPrgRom:4BBD:Handler_DD:\nsome sort of NT clear? NesPrgRom:4BC3::\nif A < C\n swap values of A and C NesPrgRom:4BCC:L4BCC_LT NesPrgRom:4BDB:L4BDB_LT NesPrgRom:4BDF::ArgC < #$20 NesPrgRom:4BE5::ArgD >= #$1E (this is wrong) NesPrgRom:4BE7:L4BE7_rts NesPrgRom:4BE8:L4BE8 NesPrgRom:4C1B::%0000_0011 NesPrgRom:4C1F::%0000_1100 NesPrgRom:4C25:L4C25 NesPrgRom:4C3B:L8C3B_loop NesPrgRom:4C45:L8C45 NesPrgRom:4C4F::\nBuffer and write Attribute\ndata. NesPrgRom:4C82:L8C82_rts NesPrgRom:4C8F:L8C8F_EE_WaitFor3:Wait for Byte_EE low nibble\nto equal 3, then clear the\nlow nibble when it does, keeping\nthe high nibble intact. NesPrgRom:4C9E:L8C9E_EE_WaitFor4:Same as L8C8F_EE_WaitFor3\nonly waiting for the value 4 NesPrgRom:4CAD:L8CAD NesPrgRom:4D6E:L8D6E_BufferAndDraw:\nBuffers some PPU data and\nwaits for it to be drawn. NesPrgRom:4D7B:L8D7B_loop NesPrgRom:4D97:L8D97_outer_loop NesPrgRom:4D9D:L8D9D_middle_loop NesPrgRom:4DBD:L8DBD_loop NesPrgRom:4DDF:L8DDF NesPrgRom:4E1F:L8E1F NesPrgRom:4E2A:L8E2A_PointerShenanigans:\nAdd a pointer to the data it points\nto, store result in Pointer_9A.\nWord_96 is another pointer output.\n\nDepending on if ZERO is set, source\npointer is either $5000 (Z unset) or\n$5400 (Z set). NesPrgRom:4E2E::always branch NesPrgRom:4E30:L8E30 NesPrgRom:4E32:L8E32 NesPrgRom:4E63:L8E63 NesPrgRom:4E87:L4E87 NesPrgRom:4E99:L4E99 NesPrgRom:4F17:L4F17 NesPrgRom:4F18:L8F18_rts NesPrgRom:4F19:L8F19 NesPrgRom:4F1B::load loop counter for later NesPrgRom:4F3D:L8F3D_loop NesPrgRom:4F4F:L8F4F_loop NesPrgRom:4F53::$697E NesPrgRom:4F59::$697F NesPrgRom:4F6B::A NesPrgRom:4F70::B NesPrgRom:4F75::Word_06CE = A * B NesPrgRom:4FCF:L8FCF_rts NesPrgRom:4FD0:Handler_DC:something to do with the\nlower 3 bits in the arguments\nand words 34 and 36 NesPrgRom:4FE5:L8FE5_gt NesPrgRom:4FF4:L8FF4 NesPrgRom:5013:L0913 NesPrgRom:501A:L901A NesPrgRom:5034:L9034_loop NesPrgRom:5041:L9041_loop NesPrgRom:5055:Handler_A2_BufferPalette:\nSomething to do with palette\nrotation? NesPrgRom:5057::>= 128 NesPrgRom:505B::Argument_B < 13 NesPrgRom:505D:L905D_rts NesPrgRom:505E:L905E_continue NesPrgRom:5060::61 NesPrgRom:5068:L9068:\nchoose buffer at $610 or $620 NesPrgRom:5079:L9079 NesPrgRom:5081:L9081 NesPrgRom:5085::\nX = Y / 3, probably NesPrgRom:5089:L9089_loop NesPrgRom:5091:L9091_loop_exit NesPrgRom:5098::\nY = ArgB + (ArgB/3) NesPrgRom:509D:L909D_loop_init:\nsomething different NesPrgRom:50A1:L90A1_loop NesPrgRom:50AD:L90AD NesPrgRom:50B4:Handler_DB:\nSome sort of wait loop that\ndoes some math. Toggles drawing\nBG & turns on NMI in a loop. NesPrgRom:50BB:L90BB_loop NesPrgRom:50D0::\nWord_6D += Argument_C NesPrgRom:50DD:L90DD:\nWord_6D += Argument_B NesPrgRom:50F2:L90F2_rts NesPrgRom:50F3:L90F3_ToggleBg:\nToggle drawing the background NesPrgRom:5102:L9102_ne NesPrgRom:5107:L9107 NesPrgRom:510B:L910B_TurnOffBG NesPrgRom:5115:L9115_TurnOnBG NesPrgRom:511F:L911F_WaitLoop:\nWord_6D - Word_B1, looped\nwhile positive result in\nlow byte.\nResult isn't saved. NesPrgRom:512B:Handler_9D_SomethingTape NesPrgRom:5133:L9133 NesPrgRom:514A:L914A NesPrgRom:5155:L9155 NesPrgRom:5161:L9161_WaitLoop NesPrgRom:517A:Handler_9E_DrawAndShowScreen:\nDraw and show a full screen from\ntape data. This includes sprites. NesPrgRom:519D:L919D NesPrgRom:51AF:L91AF NesPrgRom:51F0:L91F0 NesPrgRom:5231:L9231 NesPrgRom:523F:L923F NesPrgRom:52D1:Handler_DF:\nDoes something with strings?\nPossibly drawing them? NesPrgRom:52E1:Handler_8B:\nDoes something with strings?\nPossibly drawing them? NesPrgRom:52EC:L92EC NesPrgRom:52F4:L92F4 NesPrgRom:52FF:L92FF NesPrgRom:5312:L9312_WaitLoop NesPrgRom:535C:L935C_loop NesPrgRom:53CC:L96CC:\nTile vs Pixel coords? NesPrgRom:53DC: NesPrgRom:53EC:L93EC_PointerShenanigans NesPrgRom:5416:L5416 NesPrgRom:5495:L5495 NesPrgRom:549A:L549A NesPrgRom:54AF:L54AF NesPrgRom:54BF:L54BF NesPrgRom:54C8:L54C8 NesPrgRom:54D8:L54D8 NesPrgRom:5512:L5512 NesPrgRom:5521:L9521_WeirdInc_Word4E NesPrgRom:552C:L552C NesPrgRom:5530:L9530_ClearTables:Uses Pointer_50 and fills a\npage with #$FF. Then fill\na bunch of seemingly random\npages in ram with #$00. Some\nfull pages, others half or\nquarter pages.\n\nSeen filling at $6000. NesPrgRom:553C:L553C_loop NesPrgRom:553E:L553E NesPrgRom:5553:L5553 NesPrgRom:556A:L556A NesPrgRom:5580:L5580 NesPrgRom:5592:L5592_CheckForZero:\nChecks for Zero in $44F9\nthrough $44FC. RTS 1 any are\nnon zero. NesPrgRom:5594:L9594_loop NesPrgRom:559F:L959F_01 NesPrgRom:55A2:Handler_E7_DrawMetasprite:ArgA MetaSpriteID (index into table from tape)\nArgB X Coord\nArgC Y Coord\nArgD Palette Override\nArgE some switch?\nArgF Sprite Flip\nArgG Swap sprite table? NesPrgRom:55AA::\nWord_96 = Word_4716 NesPrgRom:55B4::\nabs(ArgA) NesPrgRom:55BD:L55BD NesPrgRom:55C6:L55C6:holds sign of ArgA NesPrgRom:55D5::compare to list length (OOB check) NesPrgRom:55D9:L55D9 NesPrgRom:55DD:L95DD NesPrgRom:55EA::extra args in hardware stack?? NesPrgRom:55F1:L95F1 NesPrgRom:55F5:L95F5_loop NesPrgRom:5601:L9601 NesPrgRom:560B::skip next JSR if no available sprites NesPrgRom:560D:L960D NesPrgRom:5610:L9610_rts NesPrgRom:5614:L9614_CopySpriteEnableTable:\nCopies the sprite enable table to\nwork ram.\n\nFor 256 bytes, look at\n$0140+offset. If value equals\nArgA, write value to same\noffset from $4B00. NesPrgRom:5618:L9618_loop NesPrgRom:5620:L9620 NesPrgRom:5624:L9624_AllocSprites:\nallocate sprites? Writes a value\nto the table at $0140 ArgA.l times NesPrgRom:562F::If Word_68 > $0040\n ldy #FF\n rts NesPrgRom:5638:L5638 NesPrgRom:5641:L5641 NesPrgRom:5648::disable some sprites? (burns at least one frame) NesPrgRom:564E:L564E NesPrgRom:5654:L5654_loop NesPrgRom:5668:L5668 NesPrgRom:5671:L5671:\nY is expected to be the next available\nsprite slot in Table_0140 NesPrgRom:5679:L5679 NesPrgRom:567B::Byte_89 = (ArgF << 3) & $C0 | Byte_89\n\nArgF & $18 is placed in the top two\nbits of either $00 or $20, depending\non the value of ArgE NesPrgRom:5687: NesPrgRom:568B: NesPrgRom:568F: NesPrgRom:5693:L5693_loop NesPrgRom:56A2:L56A2_loop_next NesPrgRom:56A8:L56A8_loop_SkipRTS NesPrgRom:56AB:L56AB NesPrgRom:56B7::ArgC NesPrgRom:56BB::this value is from Pointer_60 (high byte of val) NesPrgRom:56BE::also from Pointer_60 (low byte of val) NesPrgRom:56C7::ArgB NesPrgRom:56F7:L56F7_RTS NesPrgRom:56F8:L56F8_LoadSingleMetaSpriteTile:\nLoad a single sprite of a metasprite NesPrgRom:5701::\nset Y coord NesPrgRom:5723::\nset tile NesPrgRom:572D:L572D NesPrgRom:5748:L5748:palette data NesPrgRom:574A::ArgF NesPrgRom:574C::\nset attr & pal NesPrgRom:5752::\nset X coord NesPrgRom:5758:L5758:\nsome sort of sprite cycling thing? NesPrgRom:575B:L575B_loop NesPrgRom:577A:L577A_rts NesPrgRom:577B:L977B_FindHeaderEnd:\nPopulates $62, $63 as bytes\nfrom table at $6800.\n\nPopulates $63.W from table at\n$6980.\n\nIndex into both is\n(ArgA - 1) * 2\n\nPointer_60 = (Word_96 + 1) + (6 * (ArgA-1)) NesPrgRom:577D::\nY = (ArgA - 1) * 2\nIndex into word table based on 0.\nArgA is the index based on 1. NesPrgRom:5786: NesPrgRom:5791: NesPrgRom:579B: NesPrgRom:57A3::\nPointer_60++ NesPrgRom:57B0:L97B0_loop:X init value is from ArgA NesPrgRom:57B3::\nPointer_60 += 6 NesPrgRom:57C3:L97C3_rts NesPrgRom:57C4:L57C4_SpriteCoordMath:\nDo some math if we're not on the\nfirst sprite of a metasprite? NesPrgRom:57CB:L57CB NesPrgRom:5828:L9828_ClearTables:Clears tables at $4300, $4C80,\n$4D80, $6500, & $6600.\n\nAll have different sizes. NesPrgRom:582C:L982C_loop NesPrgRom:583B:L983B_loop NesPrgRom:5843:L9843_loop NesPrgRom:584D:L984D_loop NesPrgRom:5855:L9855_loop NesPrgRom:585E:Handler_E6_TapeNmiSetup:\nsetup some tape NMI stuff if\nnot already setup. stores\nArgA in some arrays. NesPrgRom:5866:L5866 NesPrgRom:5872::set to 1 if not already 1 NesPrgRom:5880:L9880 NesPrgRom:5889:L9889_WritePPUData:\nBuffer then write PPU data NesPrgRom:5892:L5892 NesPrgRom:58BD:L98BD_loop NesPrgRom:58E3:L98E3_loop NesPrgRom:58FF:L58FF NesPrgRom:590C:L590C NesPrgRom:590F::addr high NesPrgRom:5916::addr low NesPrgRom:591C::length NesPrgRom:592C:L592C NesPrgRom:594C:L594C NesPrgRom:5984::wait for write to PPU? NesPrgRom:598A:L598A NesPrgRom:5995:L9995 NesPrgRom:59BC:L59BC NesPrgRom:5A01:Handler_88_PlaySound:\nSeems to play a short SFX NesPrgRom:5A2E::\nenabling different channels? NesPrgRom:5A39: NesPrgRom:5A4E:L5A4E_loop NesPrgRom:5A64:L5A64_disable NesPrgRom:5A6F:L5A6F_DecodeAudioString_EntryPoint:mode 1; don't generate IRQ NesPrgRom:5A7E:L5A7E_loop NesPrgRom:5A8E:L5A8E_rts NesPrgRom:5A8F:L5A8F_DecodeAudioString:\nDecodes an audio string NesPrgRom:5A95::only if current channel is enabled NesPrgRom:5A97:L5A97_rts NesPrgRom:5A98:L5A98 NesPrgRom:5A9B::set to #1 in handler entry point NesPrgRom:5AAA:L5AAA_loop NesPrgRom:5AC2::overwrite the pointer low with itself? NesPrgRom:5AC6:L5AC6_realDecode NesPrgRom:5ACA::ignore spaces NesPrgRom:5ACC::\nO NesPrgRom:5AD0: NesPrgRom:5AE7:L5AE7:\nT NesPrgRom:5AEB: NesPrgRom:5B04:L5B04:\nM NesPrgRom:5B08: NesPrgRom:5B18:L5B18 NesPrgRom:5B21:L5B21_next NesPrgRom:5B23:L5B23:\nV NesPrgRom:5B27: NesPrgRom:5B29:L5B29 NesPrgRom:5B2D::: NesPrgRom:5B4C:L5B4C_next NesPrgRom:5B4E:L5B4E NesPrgRom:5B56:L5B56_done NesPrgRom:5B5C:L5B5C:\nY NesPrgRom:5B60: NesPrgRom:5B78:L5B78:\n# NesPrgRom:5B7C: NesPrgRom:5B83:L5B83:\nR NesPrgRom:5B87: NesPrgRom:5B98:L5B98 NesPrgRom:5B9C:L5B9C:A NesPrgRom:5BA0::H NesPrgRom:5BBF:L5BBF NesPrgRom:5BCC:L5BCC NesPrgRom:5BD5:L5BD5_WriteReg NesPrgRom:5BDA::subtract 'A' to get numeric value of note NesPrgRom:5BFB:L5BFB NesPrgRom:5C08:L5C08_DataLen_A0:Get the length of data that\nis pointed to by Pointer_A0.\n\nReturn value in Byte_0490. NesPrgRom:5C0C:L9C0C_loop NesPrgRom:5C14:L9C14_exit NesPrgRom:5C18:L5C18_CopyPtrA0PtrA2:Copies data from PointerA0 to\nPointerA2, stopping when a\ncolon is encountered. NesPrgRom:5C1A:L5C1A_loop NesPrgRom:5C25::colon (:) NesPrgRom:5C2F:L9C2F_end:make sure data is null terminated NesPrgRom:5C34:L5C34_LoadAndIncr_PtrA0 NesPrgRom:5C3A::restore flags from LDA that were clobbered with the INC NesPrgRom:5C3D:L5C3D_zero NesPrgRom:5C42:L5C42_SomethingNote NesPrgRom:5C5B:L5C5B NesPrgRom:5C7C:L5C7C_8x8_Mult:Multiply $04B1 by $04B2 and put the\nresult in $04B3. NesPrgRom:5C83:L5C83 NesPrgRom:5C8C:L5C8C NesPrgRom:5C94:Handler_80_PlayBeep NesPrgRom:5CB7:L9CB7_loop NesPrgRom:5CC5:L5CC5_LongDelay:\ndelays using three nested\nloops.\n\nA little less than 33k cycles (~1 frame) NesPrgRom:5CCA:L9CCA_loop_outer NesPrgRom:5CCF:L9CCF_loop_a NesPrgRom:5CD9:L9CD9_loop_b NesPrgRom:5D6A:Handler_DE NesPrgRom:5D71:Handler_E1 NesPrgRom:5D75:L9D75 NesPrgRom:5F31:Handler_97 NesPrgRom:5F39:L5F39 NesPrgRom:5F42:L5F42 NesPrgRom:5F4D:L5F4D NesPrgRom:5F62:L5F62 NesPrgRom:5F9B:L5F9B_loop NesPrgRom:5FA6:L5FA6 NesPrgRom:5FAD:L5FAD_loop NesPrgRom:5FB6: NesPrgRom:612B:LA12B NesPrgRom:6138:LA138 NesPrgRom:613C:LA13C NesPrgRom:6143:L6143 NesPrgRom:615A:L615A NesPrgRom:615E:Handler_D2_D3:\nHandles both D2 and D3 opcodes NesPrgRom:6395:Handler_E3_GetByteAtArgA:Using pointer in ArgA, swap\nbank, load byte into ArgA using\npointer, restore orig bank. NesPrgRom:639E::swap back to orig bank NesPrgRom:63A6:Handler_E4 NesPrgRom:63B3:Handler_A7_CallAsm:JSR's to an arbitrary address\nthat's in ArgA NesPrgRom:63C5:LA3C5_indirect_jsr NesPrgRom:63C8:Handler_9C_Toggle44FE:\n--- NesPrgRom:63D3:LA3D3 NesPrgRom:63DE:Handler_EC:\nSome scroll math NesPrgRom:647B:Handler_EB NesPrgRom:648A:LA48A_rts NesPrgRom:648B:LA48B NesPrgRom:64A4:LA4A4 NesPrgRom:64C3::\nByte_4A = ArgA.Low\nArgA = ArgA - 1 NesPrgRom:64D2: NesPrgRom:64E6: NesPrgRom:650D: NesPrgRom:6524: NesPrgRom:6531: NesPrgRom:6538:LA538:ArgB -> ArgA\nArgC -> ArgB NesPrgRom:6557:LA557_loop NesPrgRom:65A0:L65A0 NesPrgRom:65AC:LA5AC:Word_471C = Word_0747\nWord_471E = Word_0749\nWord_0747 = #$2000\nWord_0749 = #$23C0 NesPrgRom:65DF:LA5DF NesPrgRom:65F4:LA5F4 NesPrgRom:6612:L6612 NesPrgRom:6626:LA626_loop NesPrgRom:6634:LA634:\nRead some PPU data.\nProbably for saving/restoring\nwhat a dialog box overwrites. NesPrgRom:6644:L6644 NesPrgRom:6645:L6645 NesPrgRom:66AC::\nWord_81 = Word_06CA.High * #$20 NesPrgRom:66C4::\nWord_81 += Word_06CA.Low NesPrgRom:66D2::\nWord_81 += Word_0747 NesPrgRom:66E1: NesPrgRom:66F2:LA6F2_loop NesPrgRom:66FC::\nSet PPU addr to read from NesPrgRom:6706::\nSet destination pointer NesPrgRom:6710::\nSet data len NesPrgRom:6716::\nRead some data from the PPU\ndurring NMI. NesPrgRom:671D::\nWord_50 += Byte_06CC NesPrgRom:672B: NesPrgRom:6730::\nWord_81 += #$20 NesPrgRom:673D: NesPrgRom:6740: NesPrgRom:674C: NesPrgRom:6776:LA776_loop NesPrgRom:6780::\nRead more data from the PPU NesPrgRom:67A1::\nWord_50 += Byte_456A NesPrgRom:67AF: NesPrgRom:67B4::\nWord_81 += #$08 NesPrgRom:67C1: NesPrgRom:67D8:LA7D8:\nsome pointer math shenanigans? NesPrgRom:67EF: NesPrgRom:67FB: NesPrgRom:6807: NesPrgRom:6820: NesPrgRom:683B::\nWord_81 += Word_4568 NesPrgRom:684A::\nWord_81 += Word_4875 NesPrgRom:685A:LA85A:\nSome weird bit manipulation thing\n\nOutput in Word_4568+0\nSome I/O in Byte_4567 NesPrgRom:6866:L6866 NesPrgRom:686B:L686B NesPrgRom:687D:L687D NesPrgRom:6884:L6884 NesPrgRom:6888:Handler_95_TapeNmiShenanigansSet NesPrgRom:6890:L6890 NesPrgRom:68AA:L68AA NesPrgRom:68B3:LA8B3:\nWord_4E+0 is a table index+1\nWord_4E+1 is a bank ID\n\nReads and "corrects" (??) nametable\nand sprite data?? NesPrgRom:68B9::\nif zero, default to #$04 NesPrgRom:68CD:L68CD NesPrgRom:68D6:L68D6 NesPrgRom:68F3:L68F3 NesPrgRom:695C:L695C NesPrgRom:6964: NesPrgRom:698C:LA98C_loop NesPrgRom:699E:LA99E_loop NesPrgRom:69A2:LA9A2_loop NesPrgRom:69B4:LA9B4 NesPrgRom:69F7:LA9F7 NesPrgRom:6A02:L6A02 NesPrgRom:6A1C:L6A1C NesPrgRom:6A4A:L6A4A NesPrgRom:6A5A:L6A5A NesPrgRom:6A83:Handler_B4_IndCopy_471A_4E NesPrgRom:6AB1:Handler_B5_StringCopy:Copy (Word_471A) to (Word_4E) then\nincrement Word_471A by number of\nbytes copied. NesPrgRom:6AB6::RTS if < #$60 NesPrgRom:6AC4:L6AC4_loop NesPrgRom:6ADC:L6ADC_rts NesPrgRom:6ADD:Handler_B6_4E_to_471A NesPrgRom:6AE8:L6AE8 NesPrgRom:6B09:Handler_AD_Absolute:\nNegates Arg_A if negative NesPrgRom:6B11:Handler_AE_Compare:\nIf Arg_A < 0\n Return -1\nElse If ArgA == 0\n Return 0\nElse\n Return 1 NesPrgRom:6B20:LAB20_ne NesPrgRom:6B22:LAB22_eq NesPrgRom:6B29:LAB29_mi NesPrgRom:6B2D:LAB2D NesPrgRom:6B30:Handler_AF_StrToArgA:Takes the first byte of the string\nat $0700 and puts it into ArgA+0. NesPrgRom:6B3A:Handler_B0_ArgAToStr:Takes ArgA+0 and writes it to the\nfirst Word of the string at $0700. NesPrgRom:6C83:Handler_A8 NesPrgRom:6CEE:Handler_F2_InfLoop NesPrgRom:6E56:Handler_A9:ArgA DataID (used as a lookup into $6C01)\n\nupdates or restores nametable.\nlooks like it works on a portion\nof the screen, not the full screen. NesPrgRom:6E5F:L6E5F_loop NesPrgRom:6E69:L6E69 NesPrgRom:6E6D:L6E6D:\ndraws some nametable stuff NesPrgRom:6ED2:L6ED2_loop:\nDraw to screen.\neach loop burns a frame. NesPrgRom:6F02:L6F02 NesPrgRom:6F4A:L6F4A NesPrgRom:6F50:L6F50 NesPrgRom:6F65:L6F65 NesPrgRom:6F77:L6F77 NesPrgRom:6F98:L6F98 NesPrgRom:6FA2:L6FA2 NesPrgRom:6FBA:L6FBA NesPrgRom:6FDE:L6FDE NesPrgRom:6FE7:L6FE7 NesPrgRom:702D:L702D NesPrgRom:7037:L7037 NesPrgRom:7046:L7046 NesPrgRom:7080:L7080 NesPrgRom:70B8:L70B8 NesPrgRom:70CE:L70CE NesPrgRom:70EF:L70EF NesPrgRom:7104:Handler_F9:\nLow byte of Word_0742 to\nArg_A. Truncated to byte. NesPrgRom:710E:Handler_FA:\nHigh byte of Word_0742 to\nArg_A. Truncated to byte. NesPrgRom:7118:Handler_FB_Jump:\nJump to address in Arg_A,\nonly if Byte_4400 != 0. NesPrgRom:7125:L7125 NesPrgRom:7126:Handler_FC NesPrgRom:7211-7290:Table_BytecodeMetadata:Bytecode Metadata table. NesPrgRom:7291-7390:Table_Handlers:128 direct pointers for use\nwith a JMP (ADDR). NesPrgRom:73AF-73E8:Table_73AF_NoteTable:Audio string O related NesPrgRom:743F-7448:Table_743F:Something related to Handler_88 NesPrgRom:7449-744F:Table_7449:Audio string O related. at least 7\nbytes long. NesPrgRom:7450-7453:Table_7450:audio string O related. at\nleast 4 bytes long. NesPrgRom:8062:L8062:\nNMI wait loop NesPrgRom:8070:L8070_ClearSysRam:\nClears banks 0, 2, 3, 4, 5, & 6 of main ram. NesPrgRom:80A6:L80A6_NMI NesPrgRom:80F5:L80F5_DrawControllerTestScreen NesPrgRom:80FB::Palettes NesPrgRom:80FF::Attribute NesPrgRom:8104:L8104_loop:Nametable NesPrgRom:8125:L8125_WaitForNMI:\nWaits for NMI to happen, but NMI is turned\noff, so it polls $2002 instead. NesPrgRom:8141:L8141_ControllerDelayedStrobe NesPrgRom:81BC:L81BC_WaitLoop:\nClobbers A, loops $DD times. NesPrgRom:81C4:L81C4_Write4016WithNOP NesPrgRom:822E:L822E_ReadControllers:\nReads Controller 1 and Expansion NesPrgRom:82B8:L82B8_WritePPU:Writes data to the PPU using a pointer to\nfind the data. Seems to be $FD terminated. NesPrgRom:82CA::$FD marks end of data NesPrgRom:82CF:L82CF:$FE marks new PPU address NesPrgRom:8452:L8452_WirteNumberLines NesPrgRom:847B:L847B_WriteHorizNumberLine:\nHorizontal number lines NesPrgRom:848A:L848A_WriteVertNumberLine:\nVirtical number line NesPrgRom:84AA:L84AA_IncPtrBy32 NesPrgRom:84B6:L84B6_DrawBorders:\nDraws the bottom and right borders.\nThe top and left borders are handled by\nthe grid NesPrgRom:84C4:L84C4_Loop:bottom border NesPrgRom:84CA::border bottom right corner NesPrgRom:84D9:L84D9_Loop:virtical border (right) NesPrgRom:84F2:L84F2_DrawGrid NesPrgRom:85AA:L85AA NesPrgRom:85AF:L85AF_AudioStuff NesPrgRom:85D6:L85D6_LoadCHR NesPrgRom:9628:L9628_MemorySelfTest:Memory Check code.\nChecks CRAM, VRAM, PRAM,\nBRAM, & PROM. NesPrgRom:96B8:L96B8 NesPrgRom:96C0:L96C0 NesPrgRom:96DE:L96DE NesPrgRom:96E6:L96E6 NesPrgRom:96F0:L96F0 NesPrgRom:972B:L972B NesPrgRom:9733:L9733 NesPrgRom:973D:L973D NesPrgRom:9757:L9757 NesPrgRom:977F:L977F NesPrgRom:9787:L9787 NesPrgRom:97A0:L97A0 NesPrgRom:97AB:L97AB NesPrgRom:97B8:L97B8 NesPrgRom:97C4:L97C4 NesPrgRom:97D7:L97D7 NesPrgRom:97DD:L97DD NesPrgRom:97F6:L97F6 NesPrgRom:97FE:L97FE NesPrgRom:981C:L981C NesPrgRom:9828:L9828 NesPrgRom:9836:L9836 NesPrgRom:984C:L984C_InfiniteLoop:Infinite loop after the\nmemory self-test. NesPrgRom:9900:L9900_RamVerify NesPrgRom:9908:L9908 NesPrgRom:9929:L9929 NesPrgRom:9931:L9931_LoadRamBanks_ROR:Similar to L9941_LoadBanks,\nonly ROR A (stored in $4700)\nthree times first. NesPrgRom:9941:L9941_LoadRamBanks:($4700 | $4701) is written to\n$4200 to select RAM banks. NesPrgRom:9952:L9952 NesPrgRom:9976:L9976 NesPrgRom:9987:L9987 NesPrgRom:998F:L998F NesPrgRom:999A:L999A NesPrgRom:99AC:L99AC NesPrgRom:99B4:L99B4 NesPrgRom:9A15:L9A15 NesPrgRom:9A20:L9A20 NesPrgRom:9A32:L9A32 NesPrgRom:9A50:NoPowerErrorMessage NesPrgRom:9A55:L9A55_loop NesPrgRom:9A64::Load up the PPU Ctrl and set the nametable base addr to 00 NesPrgRom:9AA0:L9AA0 NesPrgRom:9AA5:L9AA5_loop NesPrgRom:9AAB::\nFrame counter code? NesPrgRom:9AC8:L9AC8_DrawLoadingScreen NesPrgRom:9B43:L9B43_HideSprites:\nMoves all sprites to ($F0, $F0) with tile ID $FF and\nattribute $02. NesPrgRom:9B45:L9B45_loop NesPrgRom:9B62:L9B62_ClearTables:Clears three 64-byte tables\nat $0140, $4C00, & $4C40.\n\nTable at $0140 is filled with\n#$FF, while the other two are\nfilled with #$00. NesPrgRom:9B68:L9B68 NesPrgRom:9B7A:L9B7A_AnimateSprite:Uses tables at $0140, $4C00,\n& $4C40. NesPrgRom:9B92:L9B92 NesPrgRom:9BC1:L9BC1 NesPrgRom:9BC8:L9BC8 NesPrgRom:9BD0:L9BD0 NesPrgRom:9BD1:L9BD1_AnimateSprite:Uses tables at $0140, $4C00,\nand $4C40. NesPrgRom:9BE4:L9BE4 NesPrgRom:9C14:L9C14 NesPrgRom:9C19:L9C19 NesPrgRom:9C41:L9C41 NesPrgRom:9C4C:L9C4C NesPrgRom:9C54:L9C54 NesPrgRom:9C67:L9C67 NesPrgRom:9C9F:L9C9F NesPrgRom:9CA3:L9CA3 NesPrgRom:9CA7:L9CA7 NesPrgRom:9CB9:L9CB9 NesPrgRom:9CBA:L9CBA NesPrgRom:9CCC:L9CCC NesPrgRom:9CCD:L9CCD NesPrgRom:9CE8:L9CE8 NesPrgRom:9D14:L9D14_AnimateSprite:\nLoading screen sprite? NesPrgRom:9D22:L9D22 NesPrgRom:9D2E:SetupAudio:\nJSR to a bunch of audio code, starting with some init NesPrgRom:9D4F:InitAudio:\nSetup audio engine? NesPrgRom:9D63:InitAudio_JSRs NesPrgRom:9D77:InitAudio_RTS NesPrgRom:9D78:L9D78 NesPrgRom:9D81:L9D81 NesPrgRom:9D87:L9D87 NesPrgRom:9D96:L9D96 NesPrgRom:9DC1:L9DC1 NesPrgRom:9DCD:L9DCD NesPrgRom:9DD9:L9DD9 NesPrgRom:9DE5:L9DE5 NesPrgRom:9DF5:L9DF5_Pulse NesPrgRom:9DF9:L9DF9_Pulse NesPrgRom:9DFB:L9DFB NesPrgRom:9E3B:L9E3B NesPrgRom:9E45:L9E45_RTS NesPrgRom:9E46:InitPulseA:\nSetup pulse channels NesPrgRom:9E4A:InitPulseB NesPrgRom:9E4C:L9E4C NesPrgRom:9E58:L9E58 NesPrgRom:9E5D:L9E5D NesPrgRom:9E66:L9E66 NesPrgRom:9E74:L9E74 NesPrgRom:9E78:L9E78_PulseDuty NesPrgRom:9E7C:L9E7C_PulseDuty NesPrgRom:9E7E:L9E7E NesPrgRom:9E92:L9E92 NesPrgRom:9EB0:L9EB0 NesPrgRom:9EB3:L9EB3 NesPrgRom:9EB4:L9EB4_Triangle NesPrgRom:9EED:L9EED NesPrgRom:9EEE:InitTriangle:\nSetup some triangle wave stuff ($4008)\nturn it off? $00 is stored in $4008, always. NesPrgRom:9EFC:L9EFC NesPrgRom:9F04:L9F04 NesPrgRom:9F0A:L9F0A NesPrgRom:9F18:L9F18 NesPrgRom:9F35:L9F35 NesPrgRom:9F50:L9F50 NesPrgRom:9F5B:L9F5B NesPrgRom:9F63:L9F63_Triangle NesPrgRom:9F7D:L9F7D NesPrgRom:9F7E:L9F7E_Noise NesPrgRom:9F97:L9F97 NesPrgRom:9FB6:InitNoise:\nSetup Noise channel (set constant volume on $400C) NesPrgRom:9FC4:L9FC4 NesPrgRom:9FC9:L9FC9 NesPrgRom:9FCA:L9FCA NesPrgRom:9FD8:L9FD8 NesPrgRom:9FF3:L9FF3 NesPrgRom:9FFD:L9FFD NesPrgRom:A019:LA019 NesPrgRom:A02C:LA02C NesPrgRom:A032:LA032 NesPrgRom:A047:LA047 NesPrgRom:A04F:LA04F NesPrgRom:A072:LA072 NesPrgRom:A09B:LA09B NesPrgRom:A0B7:LA0B7 NesPrgRom:C000:Data_C000:Main menu CHR NesPrgRom:D000:DD000:Main menu data pointers NesPrgRom:D008:DD008:Main menu BG palette NesPrgRom:D018:DD018:Main menu attribute data NesPrgRom:D058:DD058:Main menu nametable data NesPrgRom:D418:Data_D418:Some pattern data (for the no-power error screen?) NesPrgRom:DD17:DataEnd_DD17:End of tile data NesPrgRom:DD18:Data_DD18:Start of a chunk of data. Starts with some addresses? NesPrgRom:DD20:Data_DD20:Some palette data NesPrgRom:DD30:Data_DD30:Top half of attribute data NesPrgRom:DD50:Data_DD50:Bottom half of attribute data NesPrgRom:DD70:Data_DD70:Row tile data. Uncompressed. NesPrgRom:E130:Data_E130:Pattern data for the no-power error's second screen. NesPrgRom:EC70:Data_EC70:Start of the second screen in the power supply error NesPrgRom:EC78:Data_EC78:Palette data 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 NesInternalRam:0000-0001:Word_00 NesInternalRam:0002-0003:Pointer_02 NesInternalRam:0004-0005:Word_04:Either a pointer or a counter, depending on context. NesInternalRam:0008-0009:Pointer_08 NesInternalRam:000A:Byte_0A NesInternalRam:000B:Byte_0B NesInternalRam:000F-0010:Pointer_0F NesInternalRam:0013:zp13:start sequence state? NesInternalRam:0020-0021:Code_Pointer:Interpreter code pointer NesInternalRam:0022-0023:Stack_Pointer:Interpreter stack pointer NesInternalRam:0024:BytecodeMetadata NesInternalRam:0028:zp28 NesInternalRam:0029:zp29 NesInternalRam:0030-0031:Argument_A NesInternalRam:0032-0033:Argument_B NesInternalRam:0034-0035:Argument_C NesInternalRam:0038-0039:Argument_E NesInternalRam:003A-003B:Argument_F NesInternalRam:003C-003D:Argument_G NesInternalRam:0040:PulseA_40 NesInternalRam:0041:PulseA_41 NesInternalRam:0042-0043:Pointer_42 NesInternalRam:0044:Triangle_44 NesInternalRam:0045:Triangle_45 NesInternalRam:0046:Noise_46 NesInternalRam:0047:Noise_47 NesInternalRam:004A:Byte_4A NesInternalRam:004C:Byte_4C NesInternalRam:004E-004F:Word_4E NesInternalRam:0050-0051:Word_50 NesInternalRam:0052-0053:Word_52 NesInternalRam:0054-0055:Pointer_54 NesInternalRam:0056-0057:Word_56 NesInternalRam:0058-0059:Word_58 NesInternalRam:005A-005B:Pointer_5A NesInternalRam:0060-0061:Pointer_60 NesInternalRam:0062:Byte_62 NesInternalRam:0063-0064:Pointer_63 NesInternalRam:0065:Byte_65 NesInternalRam:0066-0067:Word_66 NesInternalRam:0068-0069:Word_68 NesInternalRam:006A:Byte_6A NesInternalRam:006B-006C:Word_6B NesInternalRam:006D-006E:Word_6D NesInternalRam:007C:Pulse_7C NesInternalRam:0080:Flag_80_AvailableSprites:wtf is this? set to #$40\nafter clearing some ram.\nsprite related? NesInternalRam:0081-0082:Word_81 NesInternalRam:0083-0084:Pointer_83 NesInternalRam:0085-0088:Array_85 NesInternalRam:0089:Byte_89 NesInternalRam:0094:NmiAction_94:05 - Write PPU Data\n04 - Write PPU Buffer\nFF - Read PPU Data NesInternalRam:0096-0097:Word_96 NesInternalRam:009A-009B:Pointer_9A NesInternalRam:00A0-00A1:Pointer_A0 NesInternalRam:00A2-00A3:Pointer_A2:audio related NesInternalRam:00B0:Byte_B0 NesInternalRam:00B1-00B2:Word_B1 NesInternalRam:00B3:Byte_B3 NesInternalRam:00B4:Flag_BtnLeft NesInternalRam:00B5:Flag_BtnRight NesInternalRam:00B6:Flag_BtnA NesInternalRam:00B7:Flag_BtnB NesInternalRam:00B8-00B9:Word_B8 NesInternalRam:00C0:Frame_Sleeping NesInternalRam:00C4:Byte_C4 NesInternalRam:00C5:Flag_BtnStart NesInternalRam:00C6:Flag_BtnSelect NesInternalRam:00C8:Byte_C8 NesInternalRam:00C9:PgSel_A:Page select char 1 NesInternalRam:00CA:PgSel_B:Page select char 2 NesInternalRam:00CF:Byte_CF NesInternalRam:00D4:Byte_D4:Temp tape variable NesInternalRam:00D5:TapeByte_D5:byte from tape NesInternalRam:00E0:Byte_E0_TapeCtrl_Cache NesInternalRam:00E1:Flag_E1:Read during an NMI NesInternalRam:00E4:Byte_E4 NesInternalRam:00E6:Byte_E6 NesInternalRam:00E8-00E9:Pointer_E8 NesInternalRam:00EA:Byte_EA NesInternalRam:00EB:Byte_EB NesInternalRam:00EC:Flag_EC NesInternalRam:00ED:Byte_ED NesInternalRam:00EE:Byte_EE:something to do with the\ntape status? maybe? NesInternalRam:00EF:Byte_EF NesInternalRam:00F2:Byte_F2 NesInternalRam:00F3:zpF3_Controller:some debug nonsense?\nrelated to Controller_4thByteStatus NesInternalRam:00F7:zpF7 NesInternalRam:00F8:zpF8 NesInternalRam:00F9:Controller1 NesInternalRam:00FA:Controller2 NesInternalRam:00FB:ControllerLatchMask:This is used as the data to write to $4016 before\nreading data from the controllers. NesInternalRam:00FC:PPUScrollY NesInternalRam:00FD:PPUScrollX NesInternalRam:00FE:PPUMaskVar NesInternalRam:00FF:PPUControlVar NesInternalRam:0100-011F:Table_0100_Attr:Buffered attribute data? NesInternalRam:0120-013F:Table_0120 NesInternalRam:0140-017F:Table_0140_Sprites NesInternalRam:0200-02FF:Sprites NesInternalRam:0300:TapeCtrl_Cache_0300 NesInternalRam:0301:Byte_0301 NesInternalRam:0302-0303:PpuBuffer_Address:Destination address for the buffer's contents NesInternalRam:0304:PpuBuffer_Length:Length of data in the buffer NesInternalRam:0305-0324:PpuBufferData_0305 NesInternalRam:0325:Byte_0325 NesInternalRam:0326-0327:Word_0326 NesInternalRam:0328-0347:Table_0328 NesInternalRam:0420-0440:AudioString_0420 NesInternalRam:0441-0461:AudioString_0441 NesInternalRam:0462-0482:AudioString_0462 NesInternalRam:0490:Byte_0490_PtrA0Len:String length?\nCounts length of data pointed\nto by Pointer_A0. Data is\nnull terminated. Max of 256 NesInternalRam:0493:Byte_0493 NesInternalRam:0494:Byte_0494 NesInternalRam:0495:Byte_0495 NesInternalRam:0496:Byte_0496 NesInternalRam:0497:Byte_0497 NesInternalRam:0498:Byte_0498 NesInternalRam:0499:Byte_0499 NesInternalRam:049A-049B:Word_049A NesInternalRam:049C-049E:Table_049C_AudioY:Audio string Y values NesInternalRam:049F:Byte_049F NesInternalRam:04A0-04A2:Table_04A0_AudioV:Audio string V values NesInternalRam:04A3-04A5:Table_04A3_AudioM:Audio string M values NesInternalRam:04A6-04A8:Table_04A6:audio related NesInternalRam:04A9-04AB:Table_04A9_AudioO:Audio string O values NesInternalRam:04AC:Byte_04AC_AudioState:value written to 4015 NesInternalRam:04AD:Byte_04AD NesInternalRam:04AE-04B0:Table_4AE_AudioT:Audio string T values NesInternalRam:04B1:Byte_04B1:weird audio string stuff NesInternalRam:04B2:Byte_04B2:weird audio string stuff NesInternalRam:04B3:Byte_04B3 NesInternalRam:04B4:Byte_04B4 NesInternalRam:04B5:Byte_04B5 NesInternalRam:0500-05FF:Page_0500 NesInternalRam:0600-0601:Word_0600 NesInternalRam:0602-0603:Word_0602 NesInternalRam:0604:Byte_0604 NesInternalRam:0605:Byte_0605 NesInternalRam:0606:Byte_0606 NesInternalRam:0607:Byte_0607 NesInternalRam:0610-061F:PaletteBuffer_0610 NesInternalRam:0620-062F:PaletteBuffer_0620 NesInternalRam:0680:Byte_0680 NesInternalRam:06BC-06BD:Word_06BC NesInternalRam:06BE-06BF:Word_06BE NesInternalRam:06C0:Byte_06C0 NesInternalRam:06C3-06C4:Word_06C3 NesInternalRam:06C8:Byte_06C8 NesInternalRam:06C9:Byte_06C9 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: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 NesInternalRam:0745-0746:Word_0745 NesInternalRam:0747-0748:Word_0747_NT NesInternalRam:0749-074A:Word_0749_Attr NesInternalRam:074B:Byte_074B NesInternalRam:074D-074E:Word_074D NesInternalRam:0750:Byte_0750 NesInternalRam:0753:BgFlag_0753 NesInternalRam:0772-0773:Word_0772 NesInternalRam:0774-0775:Word_0774 NesInternalRam:0776:Byte_0776 NesInternalRam:0777-0798:Table_0777 NesInternalRam:079C-07B4:Table_079C NesInternalRam:07E0:Byte_07E0 NesInternalRam:07E1-07E5:Array_07E1:array of DEC counters? NesInternalRam:07E7:Flag_07E7_DebugScreens NesInternalRam:07E8:Byte_07E8 NesInternalRam:07E9:Byte_07E9 NesInternalRam:07EB:Byte_07EB NesInternalRam:07EC:Byte_07EC NesInternalRam:07EE:Byte_07EE NesInternalRam:07EF:Byte_07EF NesInternalRam:07F3:Byte_07F3 NesInternalRam:07F6:Flag_07F6:Used when decoding stuff\nfrom tape? NesInternalRam:07F7:Flag_IRQ_07F7 NesInternalRam:07F8:Byte_07F8 NesInternalRam:07F9:Byte_07F9 NesInternalRam:07FA:Byte_07FA NesInternalRam:07FD-07FF:NMI_Ram:NMI in RAM. Jumps somewhere using absolute addressing\nbut it's in RAM, so it works like an indirect in practice. NesWorkRam:0280:Table_WR0280 NesWorkRam:0300-0301:Table_WR0300 NesWorkRam:0400:Table_WR0400 NesWorkRam:0480:Table_WR0480 NesWorkRam:0640-067F:Table64_6640 NesWorkRam:0700-07FF:Page_6700 NesWorkRam:0800-080F:Table_6800 NesWorkRam:0980-098F:Table_6980 NesWorkRam:0C01:Table_6C01 NesWorkRam:0C41-0C42:Table_6C41 NesWorkRam:0CC1-0CC2:Table_6CC1 NesWorkRam:8400:Byte_4400 NesWorkRam:8401-8403:ControllerStuff_4401 NesWorkRam:8404-8406:ControllerStuff_4404:controller pressed this frame NesWorkRam:8407-8409:ControllerStuff_4407:controller current state NesWorkRam:840A:Controller_4thByteStatus:result of some shenanigans in the\ncontroller read code. NesWorkRam:840E:PageSelChar:Current active page\nselection character NesWorkRam:8412:FrameCounter_4412 NesWorkRam:841A-841B:JmpPointer_441A NesWorkRam:8423:Byte_4423_ExpansionController NesWorkRam:8424-8425:Word_4424_TapeWaitDuration NesWorkRam:8426-8427:Word_4426 NesWorkRam:8428:Byte_4428 NesWorkRam:842A-842B:Word_442A NesWorkRam:8434:Byte_4434:Ram bank swap flag? NesWorkRam:84CF-84D5:Array_44CF:probably just 7 bytes? NesWorkRam:84D6:Byte_44D6 NesWorkRam:84E3:Byte_44E3 NesWorkRam:84E4:Byte_44E4 NesWorkRam:84E6-84E7:Table_44E6:\nAt least 2 bytes,\nno larger that 127.\n\nTable of pointers? NesWorkRam:84EE-84F5:Array_44EE:at most 10 bytes long.\ntable of 4-byte entries NesWorkRam:84F8-84FA:Array_44F8:probably just 3 bytes? NesWorkRam:84FB:Byte_44FB NesWorkRam:84FD:Byte_44FD NesWorkRam:84FE:Byte_44FE:some sort of status or length\nvalue. probably related to\nthe array at 44FB. NesWorkRam:84FF:Byte_44FF NesWorkRam:8500:Audio_4500 NesWorkRam:8501:Audio_4501 NesWorkRam:8502:TriNoise_4502 NesWorkRam:8503:Byte_4503 NesWorkRam:8504:Byte_4504 NesWorkRam:8505-8506:Table_4505:At least two long, probably not\nmore than four. NesWorkRam:8509:Table_4509 NesWorkRam:850D-8510:Array_450D:array of words, at least\n4 bytes long NesWorkRam:8511-8514:Array_4511:word table.\nat least 4 bytes long. NesWorkRam:8515:Byte_4515 NesWorkRam:8516-8517:Word_4516 NesWorkRam:8518-8527:Table_4518:At most 16 bytes NesWorkRam:8558-855B:Table_4558:At most four bytes long NesWorkRam:855C-855D:Word_455C NesWorkRam:855E-855F:Word_455E NesWorkRam:8566:Byte_4566 NesWorkRam:8567:Byte_4567 NesWorkRam:8568-8569:Word_4568 NesWorkRam:856A:Byte_456A NesWorkRam:856B:Byte_456B NesWorkRam:856C:Byte_456C NesWorkRam:856D:Byte_456D NesWorkRam:856E:Byte_456E NesWorkRam:856F:Byte_456F NesWorkRam:8570-8571:Word_4571 NesWorkRam:8572:Byte_4572:something sprite related NesWorkRam:8573-8578:Array_4573:at least 6 bytes long NesWorkRam:8579:Byte_4579 NesWorkRam:857A-8580:Array_457A:probably just 7 bytes? NesWorkRam:8598:Byte_4598:\nHandler_97 stores ArgB here NesWorkRam:859E-859F:Word_459E NesWorkRam:85FE:Byte_45FE:some shenanigans with\nRamBank_B. Code not seen\nexecute yet. NesWorkRam:8640-867F:Table64_4640:possibly one 192-byte table. NesWorkRam:8680-86BF:Table64_4680:possibly one 192-byte table. NesWorkRam:86C0-86FF:Table64_46C0:possibly one 192-byte table. NesWorkRam:8700:RamBank_B:Used when swapping RAM banks.\nThis is ORA'd with $4701\nbefore writing to $4200. NesWorkRam:8701:RamBank_A:Used when swapping RAM banks.\nThis is ORA'd with $4700\nbefore writing to $4200. NesWorkRam:8704:Byte_4704:Used as an index in a lookup\ntable at $4509. NesWorkRam:8705:Table_4705 NesWorkRam:8707:Byte_4707 NesWorkRam:8708-870B:Table_4708 NesWorkRam:870C:Byte_470C NesWorkRam:870D:WorkRamBank:Used when selecting RAM banks. This\nsame variable is used for both high\nand low work ram. NesWorkRam:870E-870F:Word_470E NesWorkRam:8710:RamBanks_4710_PrevBank NesWorkRam:8711:RamBanks_4711_CurrentBank:RAM bank temp value NesWorkRam:8712:CurrentRomBank NesWorkRam:8713-8714:Word_4713_opEB NesWorkRam:8715:Byte_4715 NesWorkRam:8716-8717:Word_4716:Pointer to some sprite data from tape? NesWorkRam:8718:Byte_4718 NesWorkRam:8719:Byte_4719 NesWorkRam:871A-871B:Word_471A NesWorkRam:871C-871D:Word_471C NesWorkRam:871E-871F:Word_471E NesWorkRam:8720:PrevRamBank_4720 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 NesWorkRam:883D-8864:WordTable_483D:Table of stack pointer addresses NesWorkRam:8865-8866:Word_4865 NesWorkRam:8867-8869:Array_4867 NesWorkRam:886B:Byte_486B NesWorkRam:886C:Byte_486C NesWorkRam:886D-886E:Word_486D NesWorkRam:8870:Byte_4870_Charset:Changes the lookup table for the\ncharacter tiles. NesWorkRam:8871:Byte_4871 NesWorkRam:8872:Byte_4872 NesWorkRam:8873:Byte_4873 NesWorkRam:8874:Byte_4874 NesWorkRam:8875-8876:Word_4875 NesWorkRam:8877-8878:Word_4877 NesWorkRam:8900-89FF:Page_4900 NesWorkRam:8A00-8AFF:Page_4A00 NesWorkRam:8B00-8B3F:Table_4B00 NesWorkRam:8B40-8B7F:Table_4B40 NesWorkRam:8B80-8BFF:WordTable_4B80 NesWorkRam:8C00-8C3F:Table_4C00 NesWorkRam:8C40-8C7F:Table_4C40 NesWorkRam:8C80-8CBF:Table_4C80:at most 64 bytes NesWorkRam:8CC0-8CFF:Table_4CC0:probably 64 bytes NesWorkRam:8E00:Byte_4E00 NesWorkRam:8E01-8E7C:Table_4E01