Posts for Hoe

1 2
6 7 8
Hoe
Experienced Forum User
Joined: 7/31/2004
Posts: 183
Location: USA
I've been trying for a bit to compile my modified VBA with no luck. It's having a lot of trouble with my version of Visual Studio (2005 beta2) and I'm rather sick of messing with it. Any one out there half decent with C++ and feel like doing this? gba.cpp line ~1773 find
internalRAM = (u8 *)calloc(1,0x8000);
replace
mapIRAM = CreateFileMapping((HANDLE)0xFFFFFFFF,NULL,PAGE_READWRITE, 0, 0x8000,"vbaIRAM");
internalRAM = (u8 *)MapViewOfFile(mapIRAM, FILE_MAP_WRITE, 0, 0, 0);
(Above is untested) You'll also need to declear it (HANDLE mapIRAM; in gba.h, and include windows.h there). Some of my trouble:
  • To build 2xSaImmx.asm, it assumes masmw.exe is in "c:\program files\nasm\" and that there's no spaces in the path to the .asm. I had to assemble it seperately from the build process.
  • Wount build the DirectX headers.
  • Needed to make all of the implicit 'const char *' to 'char *' convertions explicit.
  • And plenty more!
Edit--- Oh, you may want to close the handle at some point, too, otherwise it will linger till you restart.
Hoe
Experienced Forum User
Joined: 7/31/2004
Posts: 183
Location: USA
A few weeks back I fiddled with VBA's code a bit to cause it to allocate the GBA buffers as shared memory, but it wouldn't compile properly. I'll dick with it some more when/if I feel up to it. If I can get the memory shared, doing this (as well as for other games) will be extreamly simple.
Post subject: Re: feedback
Hoe
Experienced Forum User
Joined: 7/31/2004
Posts: 183
Location: USA
Bisqwit wrote:
However, this is a very anticipated movie, and I don't think it's failing in entertainment, so I vote yes.
Though lacking the ability to confirm or add to the problems in the recording, I highly vote yes. This movie was simply fantastic in entertainment value. If some one beats it, I can only hope they keep it as entertaining as yours.
Hoe
Experienced Forum User
Joined: 7/31/2004
Posts: 183
Location: USA
I highly doubt I'll ever get the time or patience to learn my way around the VBA code base, as well as actualy write the required code. Any one else out there? I've go no problem figuring out the additional algorithims needed to calculate the stuff, but I doubt I I'll ever write the required software to make it useable. Things needed to know (am I missing any thing?): Drop item calculations Critical hit calculations (---edit: Woops, no critical hits) Things known: Soul drop calculations If some one shows intrest in actualy writing the software portion of it all, I'll gladly figure out what else is needed.
Hoe
Experienced Forum User
Joined: 7/31/2004
Posts: 183
Location: USA
Based upon what I've seen, I thought it was impossible to make a half decent fighting game video. You have gone above and beyound half decent. It's possibly my love for beat downs by Ken, but I can't wait to show this to fellow Ken enthusiasts.
Hoe
Experienced Forum User
Joined: 7/31/2004
Posts: 183
Location: USA
I know little/nothing about sports, but it apears durring the "pass in" phase of the game, the clock stops. To my knowledge, you only need to have more points at the end then completly dominate them. Upon this, I'd say it would be faster to get a single point then fuck with them until the end.
Hoe
Experienced Forum User
Joined: 7/31/2004
Posts: 183
Location: USA
Wren wrote:
Well, that would be cheating and the code doesn't work anyway.
That's my web site, I am aware that that code does work. It's for the eur version of the game, and VBA decided to break some aspects of it's cheating system at some point past 1.5- vba and the rom are out of my hands. We're talking about making a program which will predict how many more calls to the PRNG will need to occure for a soul drop. Meaning, it's a bit more tool assisted then attempting at every frame until the results are in your favor.
Hoe
Experienced Forum User
Joined: 7/31/2004
Posts: 183
Location: USA
To my knowledge, there is no AoS program right now. The program I linked to, my Seph2k, is a SNES tracer that works for SNESAdvance. The reason why I linked to it is because that program could be modified to read values from AoS and generate statistics on future randomness. It would definately be wiser/easier to program it inside of VBA-rerecord, but then the source diff would need to be applied to each additional version for future AoS runners. I may/may not attempt at making an AoS specific version of VBA-rerecord, but I will need to find the time and effort to bother. The basic idea is to calculate future outcomes of the PRNG to let the ranner known how many additional frames until the next soul or item drop, but there is a large problem on the grounds that it can be called once or more per frame due to the PRNG being used for non-drops.
Hoe
Experienced Forum User
Joined: 7/31/2004
Posts: 183
Location: USA
:)
Hoe
Experienced Forum User
Joined: 7/31/2004
Posts: 183
Location: USA
I laughed, I cried, I voted yes.
Hoe
Experienced Forum User
Joined: 7/31/2004
Posts: 183
Location: USA
I was attempting to find the 'drop item code' but I havn't found it. I disassembled the function which calls the soul function (which apprently also checks for level ups) but found nothing. It may be below the soul stuff, not sure yet.
;the on hit function.
0807B116:	;not real label
	add r2,2Dh
	mov r0,8h
	strb r0,[r2]
	ldrh r0,[r6,34h]
	lsl r1,r1,10h
	asr r1,r1,10h
	sub r0,r0,r1
	strh r0,[r6,34h]
	mov r0,r6
	mov r2,0h
	bl 8042BA0h
	mov r1,34h
	ldsh r0[r6,r1]
	cmp r0,0h	;find out if the monster is dead. If not, skip
	bgt +	;807B1C4h
	mov r0,r6
	bl SoulFunction ;80683D0h	;This is our soul function.
	mov r0,70h
	bl 80D7924h
	mov r0,r6
	mov r1,3h
	mov r2,0h
	mov r3,0h
	bl 803F2Dch
	mov r1,r6
	add r1,2Ch
	mov r3,r6
	add r3,5Ah
	mov r0,0Fh
	ldrb r1,[r1]
	and r1,r0
	lsl r1,r1,3h
	ldrb r2,[r3]
	mov r0,79h
	neg r0,r0
	and r0,r2
	orr r0,r1
	strb r0,[r3]
	mov r0,28h
	strb r0,[r6,-Dh]
	mov r0,1h
	strb r0,[r6,0Bh]
	bl PRNG	;8000a90h
	ldr r4,=3FFFFh
	and r0,r4
	ldr r1,[r6,40h]
	add r7,r7,r1
	ldr r1,=0FFe60000h
	add r0,r0,r1
	ldr r1,[r6,44h]
	add r2,r0,r1
	mov r0,r6
	mov r1,r7
	bl 807B26Ch
	bl PRNG	;8000a90h
	mov r1,r8
	and r0,r1
	add r7,r0,r5
	bl PRNG	;8000a90h
	and r0,r4
	ldr r1,[r6,40h]
	add r7,r7,r1
	ldr r1,=0FFE60000h
	add r0,r0,r1
	ldr r1,[r6,44h]
	add r2,r0,r1
	mov r0,r6
	mov r1,r7
	bl 807B26Ch
+	pop r3	;where the function goes if a monster didn't die.
	mov r8,r3
	pop r4-r7
	pop r0
	bx r0	;return
SoulFunction:
080683D0h:	;Soul function entry point
	push r4-r7,r14
	mov r7,r10
	mov r6,r9
	mov r5,r8
	push r5,r7
	add sp,-24h
	mov r7,r0
	add r0,36h
	ldrb r0,[r0]
	mov r8,r0
	lsl r0,r0,3h
	...skip...
0806845Ah:	;not real label.
	cmp r0,0h
	beq +	;8068464h
	ldr r0,=133h
	mul r0,r4
	lsr r4,r0,8h
+	cmp r4,0h
	beq 806848Ah
	mov r1,r9
	ldr r0,[r1,30h]
	add r0,r0,r4
	str r0,[r1,30h]
	ldr r1,=5F5E0FFh
	cmp r0,r1
	bls 806847Ah	;false if you went up a level
	...skip...
080684CEh:	;not real label.
;see other posts for the code that goes here.
Hoe
Experienced Forum User
Joined: 7/31/2004
Posts: 183
Location: USA
A glitch I discovered as a child was using my turbo controller to L/R force your self at walls while jumping at them, and you can stand against the wall and keep jumping upwards.
Post subject: Re: Animation fun
Hoe
Experienced Forum User
Joined: 7/31/2004
Posts: 183
Location: USA
Bisqwit wrote:
For fun, I've been trying to create a version of the above-shown animation where the magnet beams are contiguous instead of flashing. Among many algorithms I tried, here's the most promising so far: http://bisqwit.iki.fi/kala/snap/rm1bombdemo2b.gif Now, who can guess how exactly the algorithm works? Hint: The animation generator has no access to the emulator's knowledge of sprites. It operates only on images. Hint 2: Except for the background (array of most commonly appeared pixels during the movie clip), the animation generator has no knowledge of future. Can someone suggest a better algorithm?
One thing that would be intresting is taking several animations, taking differntials of the animations against the base version, putting the additional ones into a differnt portion of the gif color palette, and then combining them. It apears that you're just OR'ing the last X frames together. You may want to only OR if it's a specific color. You'll get the 'motion blur' effect on megaman, and potentialy other things, but it will at least be far from every thing.
Hoe
Experienced Forum User
Joined: 7/31/2004
Posts: 183
Location: USA
TNSe wrote:
Your PRNG is same as MAKE_SEED btw.
erm, woops ;]
TNSe wrote:
So basically all that needs to be done now, is make a calculator built into the emulator that handles this for every frame you play, and tells you what random value you would receive that frame (at the final cmp r4,r5).. :P
You could modify sephiroth2ks program to do exactly that, with out fiddling with the emulators source: http://boards.pocketheaven.com/viewtopic.php?t=222&start=810#14921
Hoe
Experienced Forum User
Joined: 7/31/2004
Posts: 183
Location: USA
Let me post my full code to make sure we're all on the same page here.
#define WRAM	0x02000000
#define TIMER	0x02000000
#define SEED	0x02000008
#define WRAM_P	0x084F0B28	;adress in pool which contains WRAM.

#define MOD	r4
#define CHANCE	r5

;Psudo-random number generator.
PRNG:
08000A90h:
	ldr r0,=WRAM_P	
	ldr r2,[r0]	;contains 0x02000000 (wram)
	ldr r0,[r2,8h]	;this time loaded 0x4C34683F
	lsr r0,r0,8h	;now 0x004C3468
	ldr r1,=3243F6ADh
	mul r0,r1	;r0=6911396F, c
	ldr r1,=1B0cB175h
	add r0,r0,r1	;r0=0x841DEAE4, nv
	str r0,[r2,8h]	;Write this back to where we first read from.

;gets mod of r0/r1. Returns to r0.
MOD:
080D8140h:
	swi 6h	;div (r0/r1)
	mov r0,r1
	bx r14

;there's also a bunch more stuff above here which handles other CHANCE values.
080684CEh:	;not real label.
	and r0,r1
	cmp r0,0h
	beq +	;80684D0h
	mov CHANCE,7h	;CHANCE base is 7.
+	mov r0,1h
	bl 804B328h
	cmp r0,28h	;if r0==28h, gives you 8 luck.
	bne +	;80684DCh
	add CHANCE,8h
+	ldrb r1,[r6,12h]
	lsl r1,r1,3h
	ldr r0,[sp,14h]
	add r0,0E8h
	ldrh r0,[r0]	;loads luck
	lsl r0,r0,10h
	asr r0,r0,14h
	sub r0,20h
	sub MOD,r1,r0
	cmp MOD,0Fh	;make sure mod value dosn't go below 0x10
	bgt +	;80684F4h
	mov MOD,10h
+	bl PRND
	lsr r0,r0,2h
	mov r1,MOD
	bl MOD
	mov r4,r0
	cmp r4,r5
	bcs 8068540h	;if r4 < r5, get soul.
	
804B328h:
	push r14
	mov r1,r0	;r0 always =1
	ldr r0,WRAM_P
	ldr r0,[r0]
	ldr r3,=1325Ch
	add r0,r0,r3	;r0=0201325Ch
	cmp r1,1h	;always true, in this case.
	beq +	;804B358h
	**SKIP**
804B358:
+	ldrb r2,[r0,11h]	;0201326D
	mov r0,r2
	pop r1
	bx r1

;Calculate seed
;mem[SEED] = mem[TIMER] * (mem[SEED] * 0x3243F6AD) + 0x1B0CB175
MAKE_SEED:
08000A90:
	ldr r0,=WRAM_P
	ldr r2,[r0]	;r2=[TIMER]
	ldr r0,[r0,8h]	;r0=[SEED]
	ldr r1,=3243F6ADh
	mul r0,r1	;r0=3243F6AD*[SEED]
	ldr r1,=1B0CB175h
	add r0,r0,r1	r0=r0+1B0CB175
	str r0,[r2,8h]
	bx r14
The following snippet from the above compairs MOD to 0x0F, and if it's lower, sets MOD to 0x10.
	cmp MOD,0Fh	;make sure mod value dosn't go below 0x10
	bgt +	;80684F4h
	mov MOD,10h
+	bl PRND
Hoe
Experienced Forum User
Joined: 7/31/2004
Posts: 183
Location: USA
TNSe wrote:
the mod is a constant 10.
  mov r4,10h  <-- r4 is set to 0x10 here.
+   bl 8000a90h 
   lsr r0,r0,2h 
   mov r1,r4  <--- r4 is now copied to r1, so r1 (the divisor) is now 0x10
   bl MOD  <-- do % 0x10
   mov r4,r0
080684EEh: 
   cmp r4,0Fh 
   bgt +   ;80684F4h 
   mov r4,10h 
+   bl 8000a90h 
   lsr r0,r0,2h 
   mov r1,r4 
   bl MOD 
   mov r4,r0 
   cmp r4,r5 
   bcs 8068540h   ;if r4 < r5, get soul.
That's inside of a conditional branch. That's the final part of the code in my last post, it's simply to prevent the mod from going below 0x10.
Hoe
Experienced Forum User
Joined: 7/31/2004
Posts: 183
Location: USA
My above formula was wrong, but the mod is not constant. 0x10 is the floor that the mod can hit, the mod is calculated by the following:
;Calculate mod
080684DC:
	ldrb r1,[r6,12h]
	lsl r1,r1,3h
	ldr r0,[sp,14h]
	add r0,0E8h
	ldrh r0,[r0]	;loads luck
	lsl r0,r0,10h
	asr r0,r0,14h
	sub r0,20h
	sub r4,r1,r0
	cmp r4,0Fh
	bgt +	;80684F4h
	mov r4,10h
	+bl PRND
I'm not too sure what the rest of the values the above code reads are. 0 luck gets you a mod of 0x5c0, and 0x7f gives you 0x5b9. The code hints that it's possible for the formula to drop below 0x10, so I'm assuming what ever thouse other values are have a bit of weight behind them.
Hoe
Experienced Forum User
Joined: 7/31/2004
Posts: 183
Location: USA
The seed is 32bits and is stored at 0x02000008. It is calculated off of the past seed and the current timer. The timer is 32bits and is stored at 0x02000000. The seed is only changed when needed. Some rooms you will see it constantly changing, while in others you wount unless you use your weapon. The seed is calculated by the following function:
08000A90:
	ldr r0,=84F0B28h
	ldr r2,[r0]	;r2=[02000000]
	ldr r0,[r0,8h]	;r0=[02000008]
	ldr r1,=3243F6ADh
	mul r0,r1	;r0=3243F6AD*[02000008]
	ldr r1,=1B0CB175h
	add r0,r0,r1	r0=r0+1B0CB175
	str r0,[r2,8h]
	bx r14
mem[0x02000008] = mem[0x02000000] * (mem[0x02000008] * 0x3243F6AD) + 0x1B0CB175
Now, assuming I have it correct, the following formula determins if you get a soul or not:
(((mem[02000008] >> 8) * 0x3243F6AD + 0x1B0cB175) >> 2) % 0x1B0cB175) < r5
Hoe
Experienced Forum User
Joined: 7/31/2004
Posts: 183
Location: USA
The following is only true if I am understanding the code properly. When you kill a bad guy, you want (mem[02000008] >> 8) * 0x3243F6AD + 0x1B0cB175 to come to 1B0cB175 or a multiple of, with a psotive leway up to 8. Possibly r5 values are 3, 6, 7, or 8, depending upon some condition which is unknown. Additionaly, it's possible to get 8 more into r5 in:
804B328h:
	push r14
	mov r1,r0	;r0 always =1
	ldr r0,84F0B28h
	ldr r0,[r0]
	ldr r3,=1325Ch
	add r0,r0,r3	;r0=0201325Ch
	cmp r1,1h	;always true, in this case.
	beq +	;804B358h
	**SKIP**
804B358:
+	ldrb r2,[r0,11h]	;0201326D
	mov r0,r2
	pop r1
080684CEh:	;not real label.
	and r0,r1
	cmp r0,0h
	beq +	;80684D0h
	mov r5,7h	;luck base is 7.
+	mov r0,1h
	bl 804B328h
	[b]cmp r0,28h	;if r0=28h, gives you 8.
	bne +	;80684DCh
	add r5,8h[/b]
+	ldrb r1,[r6,12h]
Though I am not sure how that translates into the actual game- possibly an item? I'd recommend making a list of all good values for 0x02000008 (possible since the function apears extreamly static), and then waiting for it to fall into one of thouse values before you kill. Edit--- Oops, over looked a few things. The above isn't fully true.
Hoe
Experienced Forum User
Joined: 7/31/2004
Posts: 183
Location: USA
Here is the end of it all. 080684EEh is not an actual label, it's simply where I decided to start. It's twards the bottom of the function which calculates if the soul is given or not. 8000a90h is some mystery function. I'm not sure what that formula is suppose to do, but it will always operate on what ever the pointer in 0x02000008 goes to, then moves it back there, it seems. Possibly 'randomize.' 080D8140h just returns the modulas of r0,r1 into r0. r5 apears to contain a set value for each bad guy type. Zombies=3, bats=6. The higher the number, the higher the chance of you getting the soul. I don't care enough to be working on this, but this should be a decent starting point for any one who is intrested.
08000A90h:
	ldr r0,=84F0B28h	
	ldr r2,[r0]	;contains 0x02000000 (wram)
	ldr r0,[r2,8h]	;this time loaded 0x4C34683F
	lsr r0,r0,8h	;now 0x004C3468
	ldr r1,=3243F6ADh
	mul r0,r1	;r0=6911396F, c
	ldr r1,=1B0cB175h
	add r0,r0,r1	;r0=0x841DEAE4, nv
	str r0,[r2,8h]	;Write this back to where we first read from.

;gets mod of r0/r1. Returns to r0.
MOD:
080D8140h:
	swi 6h	;div (r0/r1)
	mov r0,r1
	bx r14
	
	
080684EEh:
	cmp r4,0Fh
	bgt +	;80684F4h
	mov r4,10h
+	bl 8000a90h
	lsr r0,r0,2h
	mov r1,r4
	bl MOD
	mov r4,r0
	cmp r4,r5
	bcs 8068540h	;if r4 < r5, get soul.
Hoe
Experienced Forum User
Joined: 7/31/2004
Posts: 183
Location: USA
I forget every thing I learned while hacking the game ( http://red-stars.net/content/Castlevania:_Aria_of_Sorrow ). I remember Eiz or I figuring out the soul thing to make the 'always get soul' code, but can't remember a god damn thing about it. Eiz wrote a fast program back then to make a full castle image (500mb png), I'll see if I can find it for you guys if intrested.
Hoe
Experienced Forum User
Joined: 7/31/2004
Posts: 183
Location: USA
You have touched the hand of God. Thank you for sharing.
Hoe
Experienced Forum User
Joined: 7/31/2004
Posts: 183
Location: USA
FODA wrote:
Falling to lower floors was obviously foreseen by the designers, and its part of the chalenge, thats why theres the "easy" route. Its hard to fall to a floor below but its clearly possible.
I can only assume, and I would say it was foreseen but was not intentional in the level design.
Vatchern wrote:
If i can find this rom, i could do the Expert level for you Yagz.
Indirect rom begging? google for emule
Hoe
Experienced Forum User
Joined: 7/31/2004
Posts: 183
Location: USA
A yes, of course. But one thing you may want to consider is that if score is a consideration, that once you get 99 lives, to stop getting extra lives.
Hoe
Experienced Forum User
Joined: 7/31/2004
Posts: 183
Location: USA
I enjoyed this run, but I am not going to vote because I did not enjoy the game, thusly never playing past the first few stages. I claim ignorance of it. I am rather confident that this run could be optimized further, though I can not cite specifics. Over all, your paths seemed very optimal, just not done with optimal movements (though potentialy close to). I do agrea with the common idea that you should not be playing this game on easy, but should be playing it on one of the longer hard mode. Though if this game does not include the areas from the simplier levels of difficulty in the harder ones, I do not see the problem with there being multiple runs based upon difficulty selection, or a single run encompasing all 3. The jumping from platforms to lower ones in ways unintended by the level designers was awsome and proved to be greatly entertaining. I would love to see you butcher some of the more difficult levels in this manor. I do also enjoy how you bothered to play through the credits stage. EDIT--- nitsuja: Very nice test run of the normal difficulty. It may be the game it self moving like clay, but it once again apeared to contain suboptimal movements. I really enjoyed the platform hopping on floor8 :)
1 2
6 7 8