Main Menu
Main Page
Forums
Recent changes
Random page
Help

Databases
GlitchDex
AttackDex
ItemDex
TypeDex
UnownDex
More

Major Glitches
Trainer escape glitch
Old man trick
Celebi trick
Select glitches (Japan)
SRAM glitch
CoolTrainer♀ corruption
LOL glitch
Rival LOL glitch
Super Glitch
ZZAZZ glitch
Pomeg corruption glitch (Glitzer Popping)
Tweaking
Elite Four door glitch (Japan)
Pokémon merge glitch
Pokémon cloning
Time Capsule exploit
Arbitrary code execution
Coin Case glitch
More

Other Glitch Categories
Glitches by generation
Glitches between two generations
Japan-only/language specific glitches
Music glitches
Natural glitches
Non-core series glitches
Non-Pokémon glitches
Officially acknowledged glitches
Recurring glitches
Dead glitches

References
Pokémon GameShark codes
The Big HEX List
GB programming
Curiosities
Debugging features
Easter eggs
Error traps
Glitch areas
Glitch myths
Non-glitch exploits
Placeholder texts
Pokémon glitch terminology
Unused content and prerelease information

Useful Tools
8F Helper
GBz80 to Items
Old man trick name generator
PATH (Prama's Advanced Tweaking Heaven)
Save file editors
Special stat/Pokémon converter
Trainer escape Trainer Pokémon finder

Affiliates
Legendary Star Blob 2 (Hakuda)
Pokémon Speedruns wiki
PRAMA Initiative
Become an affiliate!

Search Wiki

 

Search Forums

 

Author Topic: Nothing seem to match  (Read 541 times)

0 Members and 1 Guest are viewing this topic.

PanCave

  • GCLF Member
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Nothing seem to match
« on: March 08, 2017, 08:33:36 am »
Hey,

first of all: I hope this is the right place to ask this question, if not please forgive me.

The thing is, I'm new to this kind of "programming", but very interested!
I read some sources (mainly from this forum), but sadly nothing seems to match...

A few examples explaining my problem:
1)
This thread's first answer: http://forums.glitchcity.info/index.php?topic=7871.msg204526#msg204526
When i compare his(/her?)
Quote
Back into raw code using the Big List:


- Repel x index number of wanted Pokemon
- X Speed x14
- Ultra Ball x 64
- TM05 (Mega Kick) x72
- Lemonade x201

Becomes
1e xx 43 0e 02 40 cd 48 3e c9
I get the exact same Byte-String, using the Big List. So far so good. But when he shows how the Bytes should look like @3E59:
Quote
Now, CF91 is one of the addresses that is reduced by 1 in Yellow; so if we search for 78 ea 90 cf [ld a,b ld (cf90),a ld a,c] in a hex editor (I like to use HxD which is freeware) we can luckily find the beginning gift Pokémon routine in Yellow at 3E59.

78 EA 90 CF 79

So we need to change cd 48 3e to cd 59 3e (59 3e because the call routine expects big endian, which may mean highest value comes first; sadly not sure but remember it's the often the opposite byte order you would find in a memory viewer)
My Bytes (read with VBA's Memory viewer) are: CD 18 38 37 C9 78 EA 95 CF 79 EA 2B D1 AF EA 49
Why? :/

2)
In another thread there is linked the RAM map of red/blue: http://datacrystal.romhacking.net/wiki/Pok%C3%A9mon_Red/Blue:RAM_map#Items
When i search for yellow map, everyone tells me, it's just red/blue - 1. So according to that list my total item counter should be @(D31D - 1 = D31C), but it's actually @D321.
Reading from there on gives me the correct information about my items, but it's acutally +4 instead of -1. Why? :/

3)
Again in another thread is this link: http://aurellem.org/vba-clojure/html/rom.html#sec-9-1
Quote
0DE2F.   Duration of Repel.   A single byte, representing the number of steps you can take before the effect wears off.   100
But when I take a look @0DE2F and the nearby bytes, there is nowhere a 64, which should indicate the 100 steps of repel. Why? :/

I get the feeling, that i missed something important on how to find the location of any information in the memory...

My final goal to achieve is to write code in yellow to change the OT and ID of a specific pokemon (yes mew pokebank). I know, that there are guides out there either doing that in Red/Blue or changing OT/ID of the player in Yellow. But I want to change one specific pokemon in yellow and i can't find any guides/codes/hints on that. If someone knows one, please tell me, I'm very interested, but I really want also to learn how to read and write the code by myself, so the original question would still be a thing.

I hope i worked out, what my problem is and what i want to be able to learn/code.

Thank you,
PanCave

Torchickens

  • Administrator
  • *****
  • Offline Offline
  • Gender: Female
    • View Profile
Re: Nothing seem to match
« Reply #1 on: March 08, 2017, 07:07:51 pm »
Hi PanCave :). This is a good place to ask but belongs better in the arbitrary code execution board so I'll move it there.

A few examples explaining my problem:
1)
This thread's first answer: http://forums.glitchcity.info/index.php?topic=7871.msg204526#msg204526
When i compare his(/her?)
Quote
Back into raw code using the Big List:


- Repel x index number of wanted Pokemon
- X Speed x14
- Ultra Ball x 64
- TM05 (Mega Kick) x72
- Lemonade x201

Becomes
1e xx 43 0e 02 40 cd 48 3e c9
I get the exact same Byte-String, using the Big List. So far so good. But when he shows how the Bytes should look like @3E59:
Quote
Now, CF91 is one of the addresses that is reduced by 1 in Yellow; so if we search for 78 ea 90 cf [ld a,b ld (cf90),a ld a,c] in a hex editor (I like to use HxD which is freeware) we can luckily find the beginning gift Pokémon routine in Yellow at 3E59.

78 EA 90 CF 79

So we need to change cd 48 3e to cd 59 3e (59 3e because the call routine expects big endian, which may mean highest value comes first; sadly not sure but remember it's the often the opposite byte order you would find in a memory viewer)
My Bytes (read with VBA's Memory viewer) are: CD 18 38 37 C9 78 EA 95 CF 79 EA 2B D1 AF EA 49
Why? :/

This byte sequence can be found in English Yellow using a hex editor and VBA's memory viewer (or BGB's memory viewer), so it's odd that you got different bytes. It may be possible that your ROM is not English Yellow or you're using a buggy version of VBA. The one I used for this was called v23.6 svn480, although BGB is great for accuracy so I recommend using that even though it doesn't have a recording feature that is as user friendly.

2)
In another thread there is linked the RAM map of red/blue: http://datacrystal.romhacking.net/wiki/Pok%C3%A9mon_Red/Blue:RAM_map#Items
When i search for yellow map, everyone tells me, it's just red/blue - 1. So according to that list my total item counter should be @(D31D - 1 = D31C), but it's actually @D321.
Reading from there on gives me the correct information about my items, but it's acutally +4 instead of -1. Why? :/

The French, German, Italian and Spanish versions of Pokémon Red and Blue use addresses -5 of the original English version address. So D31E in English Red/Blue is D31D in English Yellow and is D321 in non-English European Yellow.

3)
Again in another thread is this link: http://aurellem.org/vba-clojure/html/rom.html#sec-9-1
Quote
0DE2F.   Duration of Repel.   A single byte, representing the number of steps you can take before the effect wears off.   100
But when I take a look @0DE2F and the nearby bytes, there is nowhere a 64, which should indicate the 100 steps of repel. Why? :/

This appears to be an offset for English Yellow, which is 0x64 there as you thought. For looking up 0xDE2F keep in mind that viewing it in the memory editor would just bring up the value for WRAM memory address DE2F instead of ROM offset DE2F.

I get the feeling, that i missed something important on how to find the location of any information in the memory...

It seems like the only confusion was due to analyzing a non-English version (plus make sure you use a hex editor rather than a memory editor). Otherwise it looks like you're on the right track. :)

My final goal to achieve is to write code in yellow to change the OT and ID of a specific pokemon (yes mew pokebank). I know, that there are guides out there either doing that in Red/Blue or changing OT/ID of the player in Yellow. But I want to change one specific pokemon in yellow and i can't find any guides/codes/hints on that. If someone knows one, please tell me, I'm very interested, but I really want also to learn how to read and write the code by myself, so the original question would still be a thing.

I hope i worked out, what my problem is and what i want to be able to learn/code.

Thank you,
PanCave

For English Yellow you would need to change the X Accuracy x119 (ld l, 77) into an X Accuracy x118 (ld l, 76). But for a non-English European Yellow (which would require a different bootstrap code of stored Pokémon for non-English European versions that can be found here in the 8F thread) I think you'd need X Accuracy x123.

I hope this helps!
« Last Edit: March 08, 2017, 07:09:11 pm by Torchickens »
Hello. I actually identify as gender questioning, but nowadays feel more firmly that I identify as female. My sex is male but I like to express myself as female.  She/her pronouns, please.


Thank you Myri for my avatar! Thank you Aeriixion for the cute sprite above! :) Roelof also made different variations of the sprite (which I animated).

Contact:

Email Youtube Twitter
Skype: Torchickens
Bulbapedia Starfy Wiki

Beyond all philosophies are the things that go best for you; what makes you feel content. It's important to always follow your heart, so unless you feel perfectly happy about it don't just follow something because it is popular, fits a style or is conventional. Sometimes you may reach a point you're not sure who you are, but as things settle I'm convinced things do work out in time.

PanCave

  • GCLF Member
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Re: Nothing seem to match
« Reply #2 on: March 08, 2017, 08:32:12 pm »
Wow thank you very much for your answer!
Yes you are totally right, I'm using the german version of Pokemon Yellow, which seems to cause the problems/offsets.

I am going to keep that in mind, when writing/editing the code :)

But there are some questions left:
1)
Only double checking:
Quote
The French, German, Italian and Spanish versions of Pokémon Red and Blue use addresses -5 of the original English version address. So D31E in English Red/Blue is D31D in English Yellow and is D321 in non-English European Yellow.
Do you mean +5?
I'm not trying to bug you, I just want to make sure, that i fully unterstand, what you are saying :)

2)
Quote
This appears to be an offset for English Yellow, which is 0x64 there as you thought. For looking up 0xDE2F keep in mind that viewing it in the memory editor would just bring up the value for WRAM memory address DE2F instead of ROM offset DE2F.
I thought, the address space is fixed, such that:
0x0000 - 0x7FFF ROM
0x8000 - 0x9FFF VRAM
0xA000 - 0xBFFF SRAM
0xC000 - 0xCFFF RAM
0xD000 - 0xFEFF WRAM
0xFF00 - 0xFF7F I/O
0xFF80 - 0xFFFF RAM
So that would mean, that 0x0DE2F always refer to the ROM.
Is that wrong? Are there multiple memory chips, which use the same address space?

3)
Quote
plus make sure you use a hex editor rather than a memory editor
What benefit does the hex editor have in comparison to the memory viewer? I installed HxD (which I believe you mentioned in a thread), but then i first have to dump the memory. And messing with the memory viewer i can see the changes (both in memory and ingame) in real-time.

Thank you again for your time and help! And also for moving the thread in the right forum, I actually thought about posting the question in here, but somehow I thought maybe that's not a good idea. Anyways, this topic is really interesting!

Btw.: It seems to me, that 8F and ws m are turing complete... Maybe building a turing machine simulating pokemon INSIDE pokemon and... well, maybe not!

Thanks again,
PanCave

ISSOtm

  • The French Lord of Laziness (and a huge The Legend Of Zelda fan)
  • Wiki Contributor
  • *
  • Offline Offline
  • Gender: Male
  • Pewter City (B)rocks !
    • View Profile
    • My Little Website
Re: Nothing seem to match
« Reply #3 on: March 10, 2017, 05:47:01 am »
I'd recommend you first make setups on US versions, because they are more documented, and then port them to German versions.
It makes it easier for us to help you, since there is a complete disassembly of the US versions.

Also, DON'T F*ING USE VBA. I'm sorry it pisses me so hard, but this thing is absolute garbage, has crappy emulation and poor debugging capabilities.
Once you understood how to use it because it's only 90% user-friendly, BGB is your best friend. Ask anyone doing Pokémon code research here, they use BGB and not VBA.

Anyways, answers.

1) He did mean +5.

2) Let's talk about offsets. The map you gave is right, except for a some things corrected below.
$0000 - $3FFF ROM bank 0
$4000 - $7FFF ROM bank $01 - $7F (switchable)
$8000 - $9FFF VRAM bank 0 or 1 (switchable)
$A000 - $BFFF SRAM bank 0 to 3 (switchable)
$C000 - $CFFF WRAM bank 0
$D000 - $DFFF WRAM bank 1 to 7 (switchable)
$E000 - $FDFF Echo RAM (mirrors $C000 - $DDFF)
$FE00 - $FE9F OAM
$FEA0 - $FEFF ???
$FF00 - $FF7F I/O registers
$FF80 - $FFFE HRAM
$FFFF Interrupt Enable (IE)

However, $0DE2F is NOT such an offset. It's a ROM offset, like $1DE2F. To use it, open the ROM in HxD, press Ctrl+G, and type "0DEDF".
The thing is very simple to understand : on your memory map, ROM is only present from $0000 to $7FFF. That's 32kB of ROM. However, Pokémon Red and Blue cartridges contain 1 MB of ROM ! But how is that trickery possible ? Using the same principle as a book. You select the page you want to open, then read a specific char.
Here it's the same : select a ROM bank, and read a specific address.
As such, there are two ways of referring to a byte in ROM : either "3:5EDF", which means "byte at offset $5EDF in GB / emulator when bank 5 is loaded", or "0DEDF" which means "byte at offset $DEDF in ROM file (using HxD for example)". Usually ROM offsets are 5-digit wide.
Don't ask me how to load a specific bank in VBA : you can't. Use BGB if you want to do that.

3) That's what she meant : use HxD and not a memory viewer / editor.
"THOU SHALL NOT PASS !!"  RIVAL's effect, Gandalf.

Proudly glitching Pokémon Red and Yellow on a Black & White GB, Pocket GB, GB Color, GBA SP and new 3DS.

My Twitter (beware, I'm French)
My YouTube (same warning)

Here is an online tool to build 8F setups : GBz80 to Items !

They see me layzin', they ha-tin'...
Heavy contributor of the global augmentation of entropy (my room's is too damn high !)

Krys3000

  • The frenchie
  • Distinguished Member
  • *
  • Offline Offline
  • Gender: Male
  • Head admin of the PRAMA Initiative
    • View Profile
    • PRAMA Initiative - Main french pokemon glitch website
Re: Nothing seem to match
« Reply #4 on: March 10, 2017, 06:32:49 am »
I like VBA. I feel uncomfortable with BGB's Memory viewing stuff. I should test mGBA someday since it's now considered the best GBA emulator

camper

  • aka GlitcherRed, azum4roll
  • Member+
  • *
  • Offline Offline
  • Gender: Male
  • 975642dx║'r DExsfoF▓1 error.
    • View Profile
Re: Nothing seem to match
« Reply #5 on: March 10, 2017, 08:34:17 am »
I use VBA-RR simply because of easy AVI recordings that supports the Turbo button. (That means even if you use Turbo or speed up the game in any way the recordings will still be at the original speed)

The BAD thing about the recordings is that the dimensions also stay at the original size even if you make the window size 4x, which results in REALLY LOW QUALITY videos.
« Last Edit: March 10, 2017, 08:34:39 am by camper »
Youtube
 

Guess where this is?

Krys3000

  • The frenchie
  • Distinguished Member
  • *
  • Offline Offline
  • Gender: Male
  • Head admin of the PRAMA Initiative
    • View Profile
    • PRAMA Initiative - Main french pokemon glitch website
Re: Nothing seem to match
« Reply #6 on: March 13, 2017, 07:46:01 am »
I use VBA-RR simply because of easy AVI recordings that supports the Turbo button. (That means even if you use Turbo or speed up the game in any way the recordings will still be at the original speed)

The BAD thing about the recordings is that the dimensions also stay at the original size even if you make the window size 4x, which results in REALLY LOW QUALITY videos.

I record using standard VBA (not M or RR) for PRAMA's videos, it also records at normal speed even with the turbo

TheSixthItem

  • Game breaker
  • GCLF Member
  • *
  • Offline Offline
  • Gender: Male
  • ZZAZZDZZGZZUZZKZZ#ZZXZZUZZ7ZZ#ZZ
    • View Profile
Re: Nothing seem to match
« Reply #7 on: June 21, 2017, 12:32:23 pm »
VBA is a fucking awful emulator. just look at closed SRAM.

Use BGB, Gambatte or at least VBA-M and see if you can do things.
I do things

TheZZAZZGlitch

  • Distinguished Member
  • *
  • Offline Offline
  • Gender: Male
  • Unknown opcode fc at 801a
    • View Profile
Re: Nothing seem to match
« Reply #8 on: June 21, 2017, 04:36:20 pm »
VBA sucks. But there are also VBA-RR and VBA-M, which suck less.
I sometimes use VBA-RR. Obviously not for first-time glitch research, because of rather bad emulation accuracy. But there are tiny features that make it worth using in some scenarios.

- Native video recording with little to no CPU load. It also doesn't need an external process for video encodes.
- Really fast turbo - with sound off and reduced resolution it can easily go up to 8000% on my computer, compared to 600% max on other emulators.
- Easily accessible and simplistic Lua scripting. Also, if you replace the DLL in VBA's working directory, it works with Lua version 5.3, which adds some really useful features (*cough* bitwise operators *cough*) - other emulators tend to have Lua compiled in and stuck at version 5.1.
- It can have multiple instances of memory viewer (aka hex editor) open at the same time. I can have multiple hex views, all centered on different addresses.
- The fact that the SRAM is never closed in the memory editor is sometimes useful, because it allows for direct save data editing without having to mess with the SAV file. Just change the SRAM and you're set.

I'd use VBA-M, but it doesn't have Lua scripting, so VBA-RR is the latest revision that has all of these features.

My preferences are:
- VBA-RR for video recording and "checking things out" in general
- BGB for more formal glitch research
- Bizhawk for TASing

I highly recommend to everyone using plain old VBA: Switch to VBA-RR.
It's really the same emulator, but it has Lua scripting and rudimentary TAS features.
And although VBA-RR's emulation accuracy is still bad, it's infinitely better than classic VBA - it properly handles wrong bank switches, VRAM accessiblity and echo RAM.
« Last Edit: June 21, 2017, 04:43:32 pm by TheZZAZZGlitch »
qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF qÁF

drc

  • Decamark Collector and Pokémaniac
  • Member+
  • *
  • Offline Offline
  • Gender: Male
  • insert dead meme here
    • View Profile
    • YouTube
Re: Nothing seem to match
« Reply #9 on: June 23, 2017, 06:07:52 am »
BGB is the bane of my existence. Required due to its accuracy for stable unstable, but it freezes and doesn't let me close a lot, and also there's no way to set the keys as shift+F1 so I can make it more like VBA. Also in order to view the controls you have to click 'set keys' and/or check'set extra keys'. It's just a fucking mess. Someone needs to make a hybrid between BGB (accuracy) and VBA (layout)
my name is dan and i like to fap that doesn't rhyme what fucking ever

TheSixthItem

  • Game breaker
  • GCLF Member
  • *
  • Offline Offline
  • Gender: Male
  • ZZAZZDZZGZZUZZKZZ#ZZXZZUZZ7ZZ#ZZ
    • View Profile
Re: Nothing seem to match
« Reply #10 on: June 23, 2017, 11:50:36 am »
BGB is the bane of my existence. Required due to its accuracy for stable unstable, but it freezes and doesn't let me close a lot, and also there's no way to set the keys as shift+F1 so I can make it more like VBA. Also in order to view the controls you have to click 'set keys' and/or check'set extra keys'. It's just a fucking mess. Someone needs to make a hybrid between BGB (accuracy) and VBA (layout)
Have you tried Gambatte?
I do things

SatoMew

  • Member+
  • *
  • Offline Offline
    • View Profile
Re: Nothing seem to match
« Reply #11 on: June 23, 2017, 02:58:03 pm »
Someone needs to make a hybrid between BGB (accuracy) and VBA (layout)

Gambatte and mGBA may fit your requirements.