Jul 20, 2011 at 2:48 AM
Not anymore
"Run, rabbit run. Dig that hole, forget the sun."
Join Date: Jan 28, 2010
Location: Internet
Posts: 1369
Age: 34
LunarSoul said:
I tried your rendering, CLord, and it didn't work. I think the title's in the same place as before.

My title.bmp is 640x480, BTW. I still don't know what you meant by fullscreenrect.

What? It works for me.

This time I tried an actual title hack.
Here's what I did for the ASM:

Before:

Code:
Address  Code
4100B4   PUSH 28
4100B6   PUSH 58

Address   Hex dump          Command                                  Comments
0040F9B9  |.  C745 E0 00000 MOV DWORD PTR SS:[EBP-20],0
0040F9C0  |.  C745 E4 00000 MOV DWORD PTR SS:[EBP-1C],0
0040F9C7  |.  C745 E8 90000 MOV DWORD PTR SS:[EBP-18],90
0040F9CE  |.  C745 EC 28000 MOV DWORD PTR SS:[EBP-14],28

After:

Code:
Address  Code
4100B4   PUSH 0
4100B6   PUSH 0

Address   Hex dump          Command                                  Comments
0040F9B9  |.  C745 E0 00000 MOV DWORD PTR SS:[EBP-20],0
0040F9C0  |.  C745 E4 00000 MOV DWORD PTR SS:[EBP-1C],31
0040F9C7  |.  C745 E8 90000 MOV DWORD PTR SS:[EBP-18],140
0040F9CE  |.  C745 EC 28000 MOV DWORD PTR SS:[EBP-14],121

Rect for Title BG:
Upper coordinates: 0,49
Lower coordinates: 320,289
(inside Title.pbm or .bmp)

{left,upper,right,lower} = {0,49,320,289}

{0,49,320,289} in hex = {0x0,0x31,0x140,0x121}

Title.bmp used (320 x 289):
diph.php


Result:
diph.php


Proof that it works: Download example mod

Now that I think about it, your title.bmp should not be 640x480 unless you are using the 2x resolution hack.
Instead, go for 320x240 or something similar.

FullScreenRect means the call to the rendering function will use the entire screen for rendering.
This is done through PUSH 0048F91C, which you don't need to modify.
 
Jul 20, 2011 at 4:28 AM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
Uweh? Mine are (framerects) 0, 0, 640, 480 and (position) 0, 0. (All decimal)
Well, I'll try the 320x240 thing tomorrow. I really hope this works.
Thanks for your help CLord.
 
Jul 21, 2011 at 5:57 AM
Senior Member
"Wahoo! Upgrade!"
Join Date: Jul 13, 2011
Location: Submerged in the colour orange
Posts: 63
I'm using Resource Hacker to input some custom music into my mod. Most of my songs have gone in just fine, but two songs won't replace the old song. I tried a song that has worked for me already, and it will indeed replace Cave Story's original song, so the originals don't seem to be the problem. It must be something about the new songs.
Does anyone know how to remedy this?
 
Jul 21, 2011 at 6:34 AM
Only Love, Maximum Love, Forever
"Life begins and ends with Nu."
Join Date: May 6, 2009
Location: somewhere new
Posts: 2137
Age: 29
Huh.
I can't think of why it wouldn't work.
Did you accidentally encrypt the ORGs? That may be the problem, I dunno, that's what happened to me.
I am assuming you have the ORGkutsu hack installed on your executable, or else most percussion won't work in the game, they're very limited without the hack.
 
Jul 21, 2011 at 6:48 AM
Senior Member
"Wahoo! Upgrade!"
Join Date: Jul 13, 2011
Location: Submerged in the colour orange
Posts: 63
cultr1 said:
Huh.
I can't think of why it wouldn't work.
Did you accidentally encrypt the ORGs? That may be the problem, I dunno, that's what happened to me.
I am assuming you have the ORGkutsu hack installed on your executable, or else most percussion won't work in the game, they're very limited without the hack.

I don't actually have that. I just use the percussion that does work (at least I have so far). Besides one of the songs that don't work is percussion-less. D:
And I haven't encrypted them to my knowledge. Any of them.
 
Jul 21, 2011 at 7:18 AM
Lvl 1
Forum Moderator
"Life begins and ends with Nu."
Join Date: May 28, 2008
Location: PMMM MMO
Posts: 3713
Age: 32
Can you describe what you mean by "it won't replace the old song"? Does ResHack stop you when you try to put it in? Does the game crash and become unplayable? Does it just play the old song even though you replaced it?
 
Jul 21, 2011 at 7:25 AM
Senior Member
"Wahoo! Upgrade!"
Join Date: Jul 13, 2011
Location: Submerged in the colour orange
Posts: 63
GIRakaCHEEZER said:
Can you describe what you mean by "it won't replace the old song"? Does ResHack stop you when you try to put it in? Does the game crash and become unplayable? Does it just play the old song even though you replaced it?

Everything works up to where the song is supposed to play, then it plays the original song.
 
Jul 21, 2011 at 7:28 AM
Lvl 1
Forum Moderator
"Life begins and ends with Nu."
Join Date: May 28, 2008
Location: PMMM MMO
Posts: 3713
Age: 32
Orange said:
Everything works up to where the song is supposed to play, then it plays the original song.

And which songs?
 
Jul 21, 2011 at 7:31 AM
Senior Member
"Wahoo! Upgrade!"
Join Date: Jul 13, 2011
Location: Submerged in the colour orange
Posts: 63
GIRakaCHEEZER said:
And which songs?

I'm trying to replace BALCONY with my "Noises of Silence.org"

Also, an assembly question.

I'm trying to give the Polar Star's bullet a faux-acceleration.

Code:
00404848    MOV DWORD PTR DS:[EAX+18],1000
0040484F    JMP SHORT 0040485B

That's the code for the bullet's positive horizontal velocity, if I'm not mistaken. I could very well be wrong, because I'm very new at assembly hacking. But, continuing on the assumption that that is indeed the correct code, my plan was to change it to:
Code:
00404848    ADD DWORD PTR DS:[EAX+18],5
CMP [EAX+18],1000
JL SHORT 00404848
0040484F    JMP SHORT 0040485B

There is, of course, not enough room for this seeing as there is only seven addresses available before it jumps to some other code, which I am assuming is unrelated to horizontal velocity. I thought about just placing a JMP at 404848 to go to some unused space at the end of all of the code, but a JMP that far would require eight addresses (or more), if I'm not mistaken. My question is, is it possible to do this?

Oh, and five was just the first number I was going to try setting the speed of the bullet to. If this worked, I would change the number that's being added until I get the increase speed that I desire.
 
Jul 21, 2011 at 7:54 AM
Lvl 1
Forum Moderator
"Life begins and ends with Nu."
Join Date: May 28, 2008
Location: PMMM MMO
Posts: 3713
Age: 32
Well I tried replacing BALCONY with your org on a clean executable and it worked. It played ingame and everything.

Did you save after you replaced it?
 
Jul 21, 2011 at 8:00 AM
Senior Member
"Wahoo! Upgrade!"
Join Date: Jul 13, 2011
Location: Submerged in the colour orange
Posts: 63
GIRakaCHEEZER said:
Well I tried replacing BALCONY with your org on a clean executable and it worked. It played ingame and everything.

Did you save after you replaced it?

Yes, I did save. I just now ended up renaming my song to "Silence.org" and trying that. For some reason, that worked. I don't know what the problem was, but at least it's fixed now. :D

That assembly problem still escapes me, however.
 
Jul 21, 2011 at 8:16 AM
Lvl 1
Forum Moderator
"Life begins and ends with Nu."
Join Date: May 28, 2008
Location: PMMM MMO
Posts: 3713
Age: 32
Orange said:
Also, an assembly question.

I'm trying to give the Polar Star's bullet a faux-acceleration.

Code:
00404848    MOV DWORD PTR DS:[EAX+18],1000
0040484F    JMP SHORT 0040485B

That's the code for the bullet's positive horizontal velocity, if I'm not mistaken. I could very well be wrong, because I'm very new at assembly hacking. But, continuing on the assumption that that is indeed the correct code, my plan was to change it to:
Code:
00404848    ADD DWORD PTR DS:[EAX+18],5
CMP [EAX+18],1000
JL SHORT 00404848
0040484F    JMP SHORT 0040485B

There is, of course, not enough room for this seeing as there is only seven addresses available before it jumps to some other code, which I am assuming is unrelated to horizontal velocity. I thought about just placing a JMP at 404848 to go to some unused space at the end of all of the code, but a JMP that far would require eight addresses (or more), if I'm not mistaken. My question is, is it possible to do this?

Oh, and five was just the first number I was going to try setting the speed of the bullet to. If this worked, I would change the number that's being added until I get the increase speed that I desire.

The loop you have set up there would just add 5 until it reaches 1000, which is kind of what you want except you have it set up to do it so that it does it all in one frame. What you want is:
Code:
ADD DWORD PTR DS:[EAX+18],5
CMP [EAX+18],1000
JL SHORT A
MOV DWORD PTR DS:[EAX+18],1000
A               JMP SHORT 0040485B

Also this code is obviously for it accelerating to the right, since the x-velocity is positive.
 
Jul 21, 2011 at 8:26 AM
Senior Member
"Wahoo! Upgrade!"
Join Date: Jul 13, 2011
Location: Submerged in the colour orange
Posts: 63
GIRakaCHEEZER said:
The loop you have set up there would just add 5 until it reaches 1000, which is kind of what you want except you have it set up to do it so that it does it all in one frame. What you want is:
Code:
ADD DWORD PTR DS:[EAX+18],5
CMP [EAX+18],1000
JL SHORT A
MOV DWORD PTR DS:[EAX+18],1000
A               JMP SHORT 0040485B

Also this code is obviously for it accelerating to the right, since the x-velocity is positive.

Wouldn't that code end up with a bullet with a velocity of 5? It looks like it adds 5 to the velocity, then continues with the bullet code because 5 is less than 1000. Am I wrong?
Also, would I have to set [EAX+18] to 0 before I start adding? I'm sorry I don't understand your code. D:
 
Jul 21, 2011 at 8:39 AM
Lvl 1
Forum Moderator
"Life begins and ends with Nu."
Join Date: May 28, 2008
Location: PMMM MMO
Posts: 3713
Age: 32
Orange said:
Wouldn't that code end up with a bullet with a velocity of 5? It looks like it adds 5 to the velocity, then continues with the bullet code because 5 is less than 1000. Am I wrong?
Also, would I have to set [EAX+18] to 0 before I start adding? I'm sorry I don't understand your code. D:

But it would run this code every frame, so that each frame it goes up by 5. With yours it gets set to 1000 the first frame, since it goes through that loop that gets it to 1000 before it does anything else, like say running the rest of the game. Also when a bullet is created I'm pretty sure its values are initialized to 0, but I might be wrong.
 
Jul 21, 2011 at 8:49 AM
Senior Member
"Wahoo! Upgrade!"
Join Date: Jul 13, 2011
Location: Submerged in the colour orange
Posts: 63
GIRakaCHEEZER said:
But it would run this code every frame, so that each frame it goes up by 5. With yours it gets set to 1000 the first frame, since it goes through that loop that gets it to 1000 before it does anything else, like say running the rest of the game. Also when a bullet is created I'm pretty sure its values are initialized to 0, but I might be wrong.

Okay, I understand now. Thanks! It'll get 5 added to it each frame until 1000, then it gets added 5 but moved back to 1000 in the same frame, essentially keeping it at 1000, right? :D But, do you know how I would be able to fit that in the code anywhere?

After replacing
MOV DWORD PTR DS:[EAX+18],1000
with
ADD DWORD PTR DS:[EAX+18],5
I don't even have enough room for the CMP. Also, a JMP command won't fit before the JMP SHORT that continues the bullet's code. S:
 
Jul 21, 2011 at 9:17 AM
Lvl 1
Forum Moderator
"Life begins and ends with Nu."
Join Date: May 28, 2008
Location: PMMM MMO
Posts: 3713
Age: 32
Due to the space issues, I would just make it an ADD and just simply hope that it doesn't go too fast.
 
Jul 21, 2011 at 9:20 AM
Senior Member
"Wahoo! Upgrade!"
Join Date: Jul 13, 2011
Location: Submerged in the colour orange
Posts: 63
GIRakaCHEEZER said:
Due to the space issues, I would just make it an ADD and just simply hope that it doesn't go too fast.

Alright then, fair enough. Thanks again, Gir. :D
 
Jul 21, 2011 at 1:27 PM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
You could JMP SHORT from the code to a free spot a shorter distance away, then JMP SHORT again to another spot, and so on until you have enough room to either put your code in or put in a JMP to the free space at the end of the code.
 
Jul 21, 2011 at 8:17 PM
Been here way too long...
"Life begins and ends with Nu."
Join Date: Jan 4, 2008
Location: Lingerie, but also, like, fancy curtains
Posts: 3054
Simply rewriting code also generally gives good space.
 
Jul 21, 2011 at 9:29 PM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
True, but that can be difficult to do for beginners to assembly.
 
Top