Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Notes: While coding this things went wrong and a couple of the sprites are unused (one of them was glitched and did not display properly). This program works but there are various things I stubbed out/overwrote.
- Q&A:
- *Where is the save file?:
- Here ^^
- https://drive.google.com/file/d/1DoI4gl8o1D3wQEWsbcGY5B53tzlcIaim/view?usp=sharing
- *What is this?:
- A way to display 7 custom Pokémon sprites on loop, even if they're not in the game.
- *How to start it:
- -Talk to the man in front of Red to view the rotating Porygon
- -(Optional) Use ws m in the bag to view just one sprite of it
- -(Optional) Use 4F to set the palette to Virtual Boy mode. Though you can do the two above without setting the palette. (edit: I'll need to update the save file again sorry, as this also changes the map script and freezes the game after closing the menu on an unknown opcode at the moment. It might not freeze on Nintendo 3DS Virtual Console because they ignore unknown opcodes. Either way, a GameShark code 010E5CD3 will fix that for now by setting the palette without 4F).
- *How did you make it rotate?
- You can play around with the skew feature on Paint, and for the upside down Porygon I rotated some parts while keeping the rest and made some small other changes.
- *How do I add sprites?:
- To import sprites, use/follow the steps on the readme of the sprite import tools link on my old Google Sites.
- https://sites.google.com/site/torchickens2/glitching-tools
- You don't have to do a rotation demo, for example, you could add a slideshow of seven or more unreleased Pokémon, or Gen II+ Pokémon, etc.
- This only works for compressed sprites (not uncompressed sprites) and if you're editing the Porygon rotation demo save,
- a maximum of 0x015A bytes long (as in the ld bc,015A below) (unless you rework the code).
- Editing the code can be done by opening BGB debugger and going to the memory addresses below.
- To do that,
- 1. Run BGB emulator with Pokémon Yellow and the save file (the easiest way is to rename the save file the same name as the ROM and have it in the
- same folder/directory). Right click on the window and go to other>debugger.
- 2. Right click again on the new debugging window and select "Go to..."
- 3. Choose one of the below memory addresses (such as da80, dd50, dac5, etc.) you want to inspect by typing da80 and clicking OK, etc.
- DAC5-DBE4 is the first picture, which you can replace with your own after following the steps below and copy/pasting the bytes.
- For the save file, it's a bit more complicated as the save file is normally locked.
- On the debugger, click debug, then access breakpoints, then add an entry for address range A000-BFFF (the value doesn't matter) with on write checked.
- Attempt to save the game. Now, BGB should pause at a point where the save file is open. This time go to 2:(save file pointer) such as 2:A000 for the picture 2,
- 2:A15A for the picture 3, etc. You can then right click and modify code/data, then paste the bytes you got using your hex editor after making a new compressed
- sprite with the sprite import tools.
- *Changing the 'Virtual Boy palette': Go to DA65 and change the 0E to another ID to get another possible palette after using the 4F in your bag. Or directly,
- you can just edit D35C but this won't change how 4F works. As another example, f0 d3 ea 5c d3 c9 at DA64 would give a (pseudo)random palette after using 4F.
- Note 4F won't work on Nintendo 64 GB Tower (and I haven't tested it there for this concept either).
- da80 (da81-dac4)
- > print box of compressed picture file, next text box at DD00.
- dd50
- > declare dimensions/sprite source (picture 1) ; dimensions = 56x56 ($77), pointer=dac5
- dac5-dbe4
- > Picture 1, Gen I compressed picture file
- 77 BF 49 53 D1 5B DC F2 D5 0E BC 28 8C C9 53 A5 7E A1 8E 38 EA 82 8B 62 D0 DA AA A2 23 95 04 95 0F B2 E2 DC BA 38 D4 56 D6 58 D5 92 5D 43 38 DF 82 0C 23 14 A8 BA 05 38 FE 1F 21 8C 20 96 86 18 22 63 8E 85 0A 8C 53 14 1E 29 39 6D 29 68 3A 31 5A 3B D5 A8 AC CA E8 C2 3C 3C C6 33 8F 0F 39 13 C4 81 3D 8C 85 63 28 F1 B0 A8 C5 AA 3C 54 15 31 53 C8 78 9A 94 F2 9C 22 D5 F6 8F 11 0E 15 43 FA 8F 1D E0 5F A8 F3 77 C2 8F C5 F7 E9 29 E9 21 AC 19 E5 20 B0 21 44 F9 92 76 2E 85 F4 4A E6 7C 75 61 4B 43 7F B8 23 2C 76 AC D4 08 E1 B5 02 D4 47 BE 38 67 26 2A 14 0A 1C 12 09 78 2A 0B A8 67 1B F0 42 C5 D2 08 E4 C0 9D 1F 12 D3 C4 41 41 71 30 30 41 04 72 A2 DF C0 A1 C0 95 20 A8 A8 A7 3C 90 B4 31 12 5C 91 47 66 14 6A 95 AB 44 47 94 98 E4 47 8B 97 06 52 29 E3 46 09 EB 2F 28 EB 9E 47 E3 44 E4 C7 90 A6 2E 79 8D 7E A3 1E 53 51 28 60 C7 8E B4 08 2C C1 1E 42 C8 4C 11 E6 E1 30 47 E2 E0
- (1. facing left)
- dd00 (dd01)
- > ASM (text code) for picture 2 - Open bank 2 of save file, copy $015A bytes of data from 2:A000 to dynamically change dac5. Next text box is now at DD1F.
- db 08
- ld a,02
- ld (4000),a
- ld a,0a
- ld (0000),a
- ld bc,015a
- ld de,dac5
- ld hl,a000
- call 00b1
- ld a,1f
- ld (dac2),a
- jp da81
- (2. diagonal bottom left)
- dd1F
- > ASM (text code) for picture 3. Next text box is now at dd60
- db 08
- ld a,02
- ld (4000),a
- ld a,0a
- ld (0000),a
- ld bc,015a
- ld de,dac5
- ld hl,a15a
- call 00b1
- ld a,60
- ld (dac2),a
- jp da81
- (3. facing down red/blue sprite)
- dd60
- > ASM (text code) for picture 4. Next text box is now at dd60.
- A15A +15B=A2B5 (picture 4)
- DD60 +1F=7F (next text code)
- db 08
- ld a,02
- ld (4000),a
- ld a,0a
- ld (0000),a
- ld bc,015a
- ld de,dac5
- ld hl,a2B5
- call 00b1
- ld a,7f
- ld (dac2),a
- jp da81
- (4. diagonal bottom-right)
- DD7F
- ''' +15B = A410 (picture 5)
- DD9E (next) (note I used 7.pic because 6.pic wouldn't display properly)
- db 08
- ld a,02
- ld (4000),a
- ld a,0a
- ld (0000),a
- ld bc,015a
- ld de,dac5
- ld hl,a410
- call 00b1
- ld a,9e
- ld (dac2),a
- jp da81
- (5. another intermediatry between bottom-right and top-right unneeded on hindsight)
- DD9E
- ''' +15B = A56B (picture 6)
- DDBD (next)
- db 08
- ld a,02
- ld (4000),a
- ld a,0a
- ld (0000),a
- ld bc,015a
- ld de,dac5
- ld hl,a56b
- call 00b1
- ld a,bd
- ld (dac2),a
- jp da81
- (6. diagonal top-right)
- DDBD
- ''' +15B = A6C6 (picture 7)
- DDDC (next)
- db 08
- ld a,02
- ld (4000),a
- ld a,0a
- ld (0000),a
- ld bc,015a
- ld de,dac5
- ld hl,a6c6
- call 00b1
- ld a,dc
- ld (dac2),a
- jp da81
- (7. facing up 'upside down Porygon')
- DDDC
- ''' +15B = A821 (I stored another copy of the picture 1 here, it works though inefficient (as is the rest of this program))
- DD00
- db 08
- ld a,02
- ld (4000),a
- ld a,0a
- ld (0000),a
- ld bc,015a
- ld de,dac5
- ld hl,a821
- call 00b1
- ld a,00
- ld (dac2),a
- jp da81
- (8. copy of picture 1 'facing left', loop to picture 2, and repeat indefinitely))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement