Frank the Fruit Fly
- RazorLeafAttack
- PM.net Staff
- Posts: 145
- Joined: May 9th, 2017, 00:58
Re: Frank the Fruit Fly
Got it updated. You should seriously join the Discord, it's specifically for people like you. I actually kinda had you in mind when I thought of making it in the first place. Some VERY experienced PM devs in there.
-
- Posts: 153
- Joined: February 21st, 2015, 22:53
- Location: United States
- Contact:
Re: Frank the Fruit Fly
I was looking around, and the only homebrew program that went over 64k was the "Indestructible" video thing. In it was the line
What does this do? Do I need to use this to go over 64k? I remember seeing something that said I needed to do something special to do that, but I can't find it.
Code: Select all
.orgfill 0x4000
-
- Posts: 153
- Joined: February 21st, 2015, 22:53
- Location: United States
- Contact:
Re: Frank the Fruit Fly
Help me learn how to save something! I'm using assembly and I want to save three variables at the beginning of a level: the [levelnumber] variable, the [health] one and the [health10] one. And then when the user turns it off, the game stores the info and when it turns back on, you can go right to where you left off. Wouldn't that be cool? I tried looking at the EEPROM browser code and I couldn't understand any of it. I ran the EEPROM browser. All I got were Fs. I pressed every button, but I couldn't change the Fs. I don't understand any of this.
Re: Frank the Fruit Fly
The eeprom browser code just reads the data, so you can't change it at all. Once you save a game you'd be ale to see how it's stored. Saving it very often isn't such a great idea, as the flash wears of with lot of writes, hence saving only when user wants is much better strategy - it is the console that'd go bad eventually. Also you'd need GUI to ask what slot to delete in case all 6 are already used.VirtualChris wrote:Help me learn how to save something! I'm using assembly and I want to save three variables at the beginning of a level: the [levelnumber] variable, the [health] one and the [health10] one. And then when the user turns it off, the game stores the info and when it turns back on, you can go right to where you left off. Wouldn't that be cool? I tried looking at the EEPROM browser code and I couldn't understand any of it. I ran the EEPROM browser. All I got were Fs. I pressed every button, but I couldn't change the Fs. I don't understand any of this.
-
- Posts: 153
- Joined: February 21st, 2015, 22:53
- Location: United States
- Contact:
Re: Frank the Fruit Fly
I guess I'll just use passwords then.
- Attachments
-
- The password screen for "Frank the Fruit Fly."
- passwordscreenftff.png (2.66 KiB) Viewed 19640 times
-
- Posts: 153
- Joined: February 21st, 2015, 22:53
- Location: United States
- Contact:
Re: Frank the Fruit Fly
I can't seem to get the password screen cursor (Frank) to move correctly. It works on PokeMini, but on a real Pokemon Mini, if you press left or right it sometimes skips a number for no reason. Here is the code I have for testing if right is pressed, for example:
If 0 indicates that the button is not pressed and 1 indicates it is pressed, why wouldn't this work right?
Code: Select all
call read_keys
test a, KEY_RIGHT
jnz right_pressed
jmp test_left
right_pressed:
call password_key_pressed1
call read_keys
test a, KEY_RIGHT
jz cursor_right
jmp right_pressed
Re: Frank the Fruit Fly
It's called button debounce. basically when you press a button on physical device is makes a contact but that contact on first might not be so reliable. Like the conductive parts just touching briefly and then losing the connection again. The net effect is that instead of one press and release you might read out several. If your button press trigger is front based (on the press/release event), you might experience several of those events. In order to correct it you would need to check the state of the button for a longer period of time. And only if the reading is the same (pressed) for several checks in a row then consider it a real press. Now for how long those checks should be and how many of them it's up to experimentation. In general not very long should be fine. I personally like to have the press for three frames in a row. Some people do two reads sequentially...VirtualChris wrote:I can't seem to get the password screen cursor (Frank) to move correctly. It works on PokeMini, but on a real Pokemon Mini, if you press left or right it sometimes skips a number for no reason. Here is the code I have for testing if right is pressed, for example:If 0 indicates that the button is not pressed and 1 indicates it is pressed, why wouldn't this work right?Code: Select all
call read_keys test a, KEY_RIGHT jnz right_pressed jmp test_left right_pressed: call password_key_pressed1 call read_keys test a, KEY_RIGHT jz cursor_right jmp right_pressed
-
- Posts: 153
- Joined: February 21st, 2015, 22:53
- Location: United States
- Contact:
Re: Frank the Fruit Fly
This sucks. I tried this, for pressing right:
As you can see, I made it wait for a few frames, have two read_keys calls and it still does the same stupidity as before. What do I have to do here? I'm so frustrated.
Code: Select all
call read_keys
test a, KEY_RIGHT
jnz waiting_for_press_right
...
waiting_for_press_right:
mov a,2
mov [ticker3],a
jmp waiting_for_press
...
waiting_for_press:
call password_key_pressed2
mov a, [buttonpress]
inc a
mov [buttonpress], a
mov a, [buttonpress]
cmp a, 254
jz get_key_press
jmp waiting_for_press
...
get_key_press:
call password_key_pressed2
mov a,0
mov [buttonpress],a
mov a, [ticker3]
cmp a, 2
jz cursor_right
cmp a, 3
jz enter_a_number
...
cursor_right:
call password_key_pressed1
mov a,0
mov [buttonpress],a
mov [ticker3],a
call read_keys
test a, KEY_RIGHT
jnz cursor_right
<stuff that happens when right is pressed.>
Re: Frank the Fruit Fly
Can you please add more comments to the code. I have hard time understanding what are you trying to achieve. Some subroutines are missing and the label names are not helping to guess what those are supposed to do... Maybe try to explain what each chunk of code is handling, it would ease others looking at your the code. That also often has a side effect of you spotting the problem (a rubber duck testing). You can also try to run it in a emulator and trace those parts of your code.VirtualChris wrote:This sucks. I tried this, for pressing right:
As you can see, I made it wait for a few frames, have two read_keys calls and it still does the same stupidity as before. What do I have to do here? I'm so frustrated.
-
- Posts: 153
- Joined: February 21st, 2015, 22:53
- Location: United States
- Contact:
Re: Frank the Fruit Fly
I think I fixed it. I added a second variable to keep track of which button I selected. That led to the discovery of the key being used when the key wasn't being pressed. So I added another round of key pressing determining code and that seemed to help a lot.