View Single Post
  #9    
Old March 13th, 2010 (12:03 AM). Edited March 13th, 2010 by Giga Universe.
Giga Universe's Avatar
Giga Universe
Working on a tool.
 
Join Date: Aug 2007
Location: South Africa
Age: 19
Gender: Male
Nature: Calm
Send a message via ICQ to Giga Universe Send a message via AIM to Giga Universe Send a message via Yahoo to Giga Universe Send a message via Skype™ to Giga Universe
Well, I've done a half-job. I'm just posting the progress I have made so far. I'm in a bit of a rush, so they aren't very good or optimised.

Code:
.text
.align 2
.thumb
.thumb_func

main:
	push {r0-r3, lr}
	ldr r0, .CAM
	ldr r0, [r0]
	ldrh r1, [r0, #0x2]
	ldr r0, .CAM
	ldr r0, [r0]
	ldrh r0, [r0, #0x0]
	ldr r2, .VAR
	ldr r3, .VARS
	strh r0, [r2]
	strh r1, [r3]
	pop {r0-r3, pc}

.align 2
.CAM:
	.word 0x03005008
.VAR:
	.word 0x020370B8
.VARS:
	.word 0x020370BA


Compile it, Insert it at a propper offset, then in a script call a 'callasm YOUR-OFFSET-1' command. This above code exports the X position of the camera to the variable 0x8000 and the Y position to 0x8001.


Below is the setting routine. It doesn't work properly, because if you use special 0x8E after it, the game freezes. But, if you open a menu (Pokedex, Pokemon menu, etc), the camera updates without freezing the game. I'll try find a way to make it not freeze after use of special 0x8E. Insert the routine and insert this script:
setvar 0x8000 XPOS
setvar 0x8001 YPOS
callasm YOUROFFSET-1
end

Run the script, and then open a menu, and you'll notice the camera adjusts to those positions. If you want to jump the camera up 2 places, and don't know the coordinates of the camera, use it in conjunction with the first routine.

Code:
.text
.align 2
.thumb
.thumb_func

main:
	push {r0-r1, lr}
	ldr r0, .CAM
	ldr r0, [r0]
	ldr r1, .VAR
	str r1, [r0]
	pop {r0-r1, pc}

.align 2
.CAM:
	.word 0x03005008
.VAR:
	.word 0x020370B8
.VARS:
	.word 0x020370BA
I'll try and fix them up later.
__________________
Reply With Quote