Main Menu
Main Page
Forums
New pages
Recent changes
Random page
Help

Glitches
Arbitrary code execution
Pokémon cloning
Pomeg glitch and Glitzer Popping
Tweaking and voiding
Glitches by generation
Glitch categories

References/Resources
Databases
Disassembly projects
The Big HEX List
Pokémon cheat codes
Pokémon glitch terminology
Useful tools
More

Affiliates
Legendary Star Blob 2 (Hakuda) (日本語/Japanese)
Pokémon Speedruns wiki (English)
PRAMA Initiative (Français/French)
MissingNo. Glitch City (Italiano/Italian)
Become an affiliate!

Technical
Site source code

Search Wiki

 

Search Forums

 

Author Topic: Now I know a little bit about gbz80 assembly.  (Read 632 times)

0 Members and 1 Guest are viewing this topic.

joshuarpl2

  • Banned
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Now I know a little bit about gbz80 assembly.
« on: December 04, 2018, 10:22:32 am »
I now know how to change an address in Assembly, It goes like this

Loading a value into A! ld   a,<value>
Loading A's value into an address! ld   (<adress>),a
But i have no idea how to increment or decrement values, but at least what I know now is a start to programming.
However I have a problem with this https://eldred.fr/gbz80toitems3/
Whenever I use ld   (<adress>),a It says Line <Line number> : <address> is badly formatted hexadecimal !
How do I fix this?  :-\

Princess Torchic Owl Lover ☽ ❤

  • Head Administrator
  • *****
  • Offline Offline
  • Gender: Female
  • Aspiring mother. 🦋 ✿
    • View Profile
Re: Now I know a little bit about gbz80 assembly.
« Reply #1 on: December 04, 2018, 10:28:48 am »
ld a,$<value> and ld ($<address>),a should work. Hope this helps.

The converter can be really picky with certain things. Let me know if there are any other errors and I'll try to resolve them for you.

✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿
Here have some free flowers on every post ^^
✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿



(Images © Sanrio, Nintendo, Pokémon, HAL Laboratory)

✿ Hi, I'm Evie. Sex male, and spiritually doesn't believe 'male'/'female' needs to be defined; lives more stereotypically like a woman. Call me whichever pronouns you like. :)

Feel free to contact me here about anything regarding the site.

Forgiveness. I feel that the more people pray to our greatest source/God/mathematical equality for world peace, the more and more it manifests into reality (until our next spiritual death).

Thank you Nyapon for this lovely artwork. :3

joshuarpl2

  • Banned
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Re: Now I know a little bit about gbz80 assembly.
« Reply #2 on: December 04, 2018, 10:42:22 am »
Oh, hey, thanks! I was just forgetting the $! Thanks for fixing it for me, I was scared there for a second.

ISSOtm

  • The French Lord of Laziness (and a huge The Legend Of Zelda fan)
  • Staff
  • *****
  • Offline Offline
  • Gender: Male
  • Pewter City (B)rocks !
    • View Profile
    • My Little Website
Re: Now I know a little bit about gbz80 assembly.
« Reply #3 on: December 04, 2018, 01:21:34 pm »
If you want to learn GB ASM, I made a tutorial.
"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 !)

joshuarpl2

  • Banned
  • Offline Offline
  • CHARIZRAD 'M ROXORX or is it.
    • View Profile
Re: Now I know a little bit about gbz80 assembly.
« Reply #4 on: December 04, 2018, 04:49:59 pm »
2 questions

How do you display a textbox with you're own text?
How do you do a delay?

ISSOtm

  • The French Lord of Laziness (and a huge The Legend Of Zelda fan)
  • Staff
  • *****
  • Offline Offline
  • Gender: Male
  • Pewter City (B)rocks !
    • View Profile
    • My Little Website
Re: Now I know a little bit about gbz80 assembly.
« Reply #5 on: December 05, 2018, 12:34:53 am »
Displaying a textbox is fairly complicated... I'm not sure, especially considering that there's already text on-screen when an item is used.

I'm not sure what you mean by "a delay". If you want to wait for the next frame, you can call the DelayFrame function; if you just want to wait, there's the SGB wait function (waits four frames or so), or you can just make your own time-wasting loop
"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 !)

joshuarpl

  • GCLF Member
  • Offline Offline
  • Gender: Male
  • Oh snap, I destroyed my save file!
    • View Profile
Re: Now I know a little bit about gbz80 assembly.
« Reply #6 on: December 20, 2018, 06:52:52 pm »
So, someone banned my alt account, huh? Well, Guess i'll have to work towards getting rid of my WPM!
By "delay" I mean like, how do you delay for an amount of seconds?
If I am necro-bumping, I am sorry.
4 4 scares me on a deep emotional level I can't describe.

ISSOtm

  • The French Lord of Laziness (and a huge The Legend Of Zelda fan)
  • Staff
  • *****
  • Offline Offline
  • Gender: Male
  • Pewter City (B)rocks !
    • View Profile
    • My Little Website
Re: Now I know a little bit about gbz80 assembly.
« Reply #7 on: December 21, 2018, 01:33:05 am »
You can call `DelayFrames`. But what do you need this for?
"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 !)

joshuarpl

  • GCLF Member
  • Offline Offline
  • Gender: Male
  • Oh snap, I destroyed my save file!
    • View Profile
Re: Now I know a little bit about gbz80 assembly.
« Reply #8 on: December 29, 2018, 04:21:29 pm »
In Blockland, 1000 milliseconds is a single second!
I wonder if this works the same way?
If I am necro-bumping, I am sorry.
4 4 scares me on a deep emotional level I can't describe.

Parzival

  • Buyer beware: House comes with 3 free skeletons in a closet of your choice.
  • GCLF Member
  • *
  • Offline Offline
  • Gender: Male
  • This box intentionally left blank. ...wait...
    • View Profile
    • (null)
Re: Now I know a little bit about gbz80 assembly.
« Reply #9 on: December 29, 2018, 07:27:17 pm »
1000 milliseconds to 1 second is the standard metric conversion, yes. The system runs at something like 59.8338FPS constant iirc, so one frame is 1/59.8338, or 16.852 milliseconds a frame. Also, isn't Blockland a PC game? How does that have any bearing on this?
Ask me about betrayal.
Ask me about depression.
Ask me about death.
Ask me about destruction.
Ask me about hardship.
I've been through s**t.
If you need to talk to someone, my PM inbox is always open.

joshuarpl

  • GCLF Member
  • Offline Offline
  • Gender: Male
  • Oh snap, I destroyed my save file!
    • View Profile
Re: Now I know a little bit about gbz80 assembly.
« Reply #10 on: February 07, 2019, 03:10:13 pm »
1000 milliseconds to 1 second is the standard metric conversion, yes. The system runs at something like 59.8338FPS constant iirc, so one frame is 1/59.8338, or 16.852 milliseconds a frame. Also, isn't Blockland a PC game? How does that have any bearing on this?

I know it's a PC game (Blockland), but does Pokemon Blue/Red/Yellow also see 1000 milliseconds as a single second?
If I am necro-bumping, I am sorry.
4 4 scares me on a deep emotional level I can't describe.

Princess Torchic Owl Lover ☽ ❤

  • Head Administrator
  • *****
  • Offline Offline
  • Gender: Female
  • Aspiring mother. 🦋 ✿
    • View Profile
Re: Now I know a little bit about gbz80 assembly.
« Reply #11 on: February 07, 2019, 03:21:22 pm »
1000 milliseconds to 1 second is the standard metric conversion, yes. The system runs at something like 59.8338FPS constant iirc, so one frame is 1/59.8338, or 16.852 milliseconds a frame. Also, isn't Blockland a PC game? How does that have any bearing on this?

I know it's a PC game (Blockland), but does Pokemon Blue/Red/Yellow also see 1000 milliseconds as a single second?

I think if it is 16.852 milliseconds a frame, then 16.852 x 59.834 gives you the number of milliseconds for one second on a Game Boy game, which is about 1008.32 milliseconds. ✿

✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿
Here have some free flowers on every post ^^
✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿



(Images © Sanrio, Nintendo, Pokémon, HAL Laboratory)

✿ Hi, I'm Evie. Sex male, and spiritually doesn't believe 'male'/'female' needs to be defined; lives more stereotypically like a woman. Call me whichever pronouns you like. :)

Feel free to contact me here about anything regarding the site.

Forgiveness. I feel that the more people pray to our greatest source/God/mathematical equality for world peace, the more and more it manifests into reality (until our next spiritual death).

Thank you Nyapon for this lovely artwork. :3

Parzival

  • Buyer beware: House comes with 3 free skeletons in a closet of your choice.
  • GCLF Member
  • *
  • Offline Offline
  • Gender: Male
  • This box intentionally left blank. ...wait...
    • View Profile
    • (null)
Re: Now I know a little bit about gbz80 assembly.
« Reply #12 on: February 07, 2019, 08:25:16 pm »
1000 milliseconds to 1 second is the standard metric conversion, yes. The system runs at something like 59.8338FPS constant iirc, so one frame is 1/59.8338, or 16.852 milliseconds a frame. Also, isn't Blockland a PC game? How does that have any bearing on this?

I know it's a PC game (Blockland), but does Pokemon Blue/Red/Yellow also see 1000 milliseconds as a single second?

I think if it is 16.852 milliseconds a frame, then 16.852 x 59.834 gives you the number of milliseconds for one second on a Game Boy game, which is about 1008.32 milliseconds. ✿
1008.3191976 milliseconds, without rounding, yeah.
Ask me about betrayal.
Ask me about depression.
Ask me about death.
Ask me about destruction.
Ask me about hardship.
I've been through s**t.
If you need to talk to someone, my PM inbox is always open.

joshuarpl

  • GCLF Member
  • Offline Offline
  • Gender: Male
  • Oh snap, I destroyed my save file!
    • View Profile
Re: Now I know a little bit about gbz80 assembly.
« Reply #13 on: May 08, 2019, 04:15:15 pm »
I found a way to display strings without taking up TOO much memory, I know this doesn't really have too much relation, but I used the TI-84 z80 assembly compiler's Quick hex feature, bgb doesn't support labels, and I couldn't figure out how to install Cygwin or make properly, and I'm no Linux user, I use Windows,
I'd just change the header code
Code: [Select]
#define     progStart   $9D95
.org        progStart-2
.db         $BB,$6D
to
Code: [Select]
#define     progStart   $DA80
.org        progStart

and write my code below (not including BCALLS because BCALLS are a custom assembly function only on the TI-84 calculator)

I then use the Quick hex feature and paste that into DA80 on emulated Pokemon Yellow...

...Oh, and if this post is way too long, I am sorry for breaking the rules if I am!

Assembly code
Code: [Select]
ld hl,$C3A0
    ld bc,character
write:
ld a,(bc)
    cp $00
    jr z,return
    jr continue
continue:
ld (hl),a
    inc hl
    inc bc
jp write
return:
ret
character:
.db 1,2,3,4,5,6,7,8,9,10,11,12,0

Hexadecimal
Code: [Select]
21 A0 C3 01 94 DA 0A FE 00 28 08 18 00 77 23 03
C3 86 DA C9 01 02 03 04 05 06 07 08 09 0A 0B 0C 00

Oh, and end the string with 00, The string is right past the C9
« Last Edit: May 08, 2019, 04:19:42 pm by joshuarpl »
If I am necro-bumping, I am sorry.
4 4 scares me on a deep emotional level I can't describe.

Sherkel

  • Ringsome on the aquaface
  • Administrator
  • *****
  • Offline Offline
  • Gender: Male
    • View Profile
Re: Now I know a little bit about gbz80 assembly.
« Reply #14 on: May 09, 2019, 02:24:36 am »
Huh! That's quite a lot it looks like you've done there. The TI-84 assembler is certainly a strange workaround, to say the least, but it did seem to produce valid GBz80 and binary. I'm not sure what might have gotten in the way of installing Cygwin on Windows, as I remember it being straightforward after downloading the installer from the program's site. As for make, that's much faster yet, once you have Cygwin of course. You can certainly ask about anything you're stuck on, especially considering you seem to have created more questions for yourself in the process of trying to figure this out than you answered. What Isso was saying was just to make some effort to figure out the answer to something first instead of asking straight away about it. There's also nothing at all in the rules about long posts. As for your code...it didn't do anything on my end. It didn't freeze, but it also didn't do anything else. You're on the right track by trying to write to $C3A0. But as for actually doing it...well, remind me to get back to that when I'm more awake. In the meantime, though, maybe check out jfb1337's RAM writer for reference. There's even a video to show exactly how it looks. Do you have a picture of what it looked like for you when you tried yours? And again, you don't need to be nearly so nervous here, especially when it comes to relevant content.

All that said, maybe your first project could be something else? Maybe something based off an example in Isso's programming guide, or a well-known RBY script? I just think there might be a better place to start.

Sticking to quality control and moderation until I sort some IRL matters out. I check in here almost daily and will answer questions, but not all of them.
I don't have a habit of keeping Discord open, so direct inquiries are preferred through here.