CusPop TODO list

Discussions about all other tools (CusPop, SAV/HOF editors) and hex editing.

Moderator: English Moderator Team

David
The Prince of Persia
The Prince of Persia
Posts: 1474
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: CusPop TODO list

Post by David » December 27th, 2013, 9:09 pm

I see you also added some space between the lines.
Now it looks much better! :)

David
The Prince of Persia
The Prince of Persia
Posts: 1474
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: CusPop TODO list

Post by David » May 17th, 2014, 10:40 am

I found a bug: Unavailable options are not grayed out in CusPoP.
Seems like the Javascript code is generated incorrectly.
I could track down the problem to cuspopgenerator.php:
The part in question looks like this in an older version:

Code: Select all

	for ($i=0;$i<$global_n;$i++) {
		$all1="f$i";
		$all.=$coma."z.$all1";
		$coma=',';
	}
And in the current version:

Code: Select all

	for ($i = 0; $i < $global_n; $i++)
	{
		$all = "f" . $i;
		$all .= $comma . "z." . $all . "1";
		$comma = ',';
	}
Looks like you accidentally made a mistake when you cleaned up the formatting.
$all1 changed to $all in the first case and $all . "1" in the second case.
These should be changed back to $all1, or perhaps a better name like $item or $name.

salvadorc17
Calif
Calif
Posts: 521
Joined: August 27th, 2011, 2:04 am

Re: CusPop TODO list

Post by salvadorc17 » May 17th, 2014, 9:36 pm

What is cuspop, is for pc dos version???

David
The Prince of Persia
The Prince of Persia
Posts: 1474
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: CusPop TODO list

Post by David » May 18th, 2014, 7:19 pm

Yes, CusPoP is for the DOS version. You can use it to make a custom prince.exe. For example, to change the special events.
You can use it here: http://www.popot.org/other_useful_tools.php?tool=CusPop

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3121
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: CusPop TODO list

Post by Norbert » May 23rd, 2014, 11:44 am

David wrote:Looks like you accidentally made a mistake when you cleaned up the formatting.
Auch, sorry. I'll fix that this weekend.
[Edit: Fixed it.]

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3121
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: CusPop TODO list

Post by Norbert » August 11th, 2014, 8:16 pm

Regarding the latest princehack.xml. I think instead of using...

Code: Select all

type="array"
...for all the new hacks, other types may need to be used. For example, ...

Code: Select all

<read type="array" name="where will the kid have the sword">
...probably needs to be a ((un)signed) char.
To be honest, I don't even understand how it still works, but I don't know the CusPop code very well.
What I do know is that diffpop will not understand that "where will the kid have the sword" is one byte.
That's mostly diffpop's fault, but if CusPop uses arrays everywhere, that's not helping either. ;)

David
The Prince of Persia
The Prince of Persia
Posts: 1474
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: CusPop TODO list

Post by David » August 12th, 2014, 7:33 pm

I used arrays for those hacks that change the machine code. -- Because it might be many bytes.
For example the "fix infinite down bug" is 8 bytes.
...probably needs to be a ((un)signed) char.
I don't know if the longer ones could be changed to char.
(Maybe, but with lots of "<read duplicated=... />", one for each byte.)
What I do know is that diffpop will not understand that "where will the kid have the sword" is one byte.
Look at the value of the first option, and count how many space-separated words are there.
I don't even understand how it still works
Wait, I'm not sure what you mean by "still" here...
a) "how could it still work" (despite the various changes and the refactorings that might go wrong)
-or-
b) "still don't understand"

Is there any specific detail I might explain?

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3121
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: CusPop TODO list

Post by Norbert » August 12th, 2014, 9:26 pm

David wrote:I don't know if the longer ones could be changed to char.
I understand the hacks are of varying sizes, and didn't mean to imply it'd be preferable to convert all of them to type="char".
The "fix infinite down bug", for example, could by of type="long long" or type="double".
From what I can tell, the majority of the (new) hacks do not go beyond 8 bytes, and specifying non-array types wherever possible might be the most accurate thing to do.
That was my reasoning. ;)
Norbert wrote:I don't even understand how it still works
I meant after you added the type="array" hacks, since I assumed the code would use - only - the type="" fields to figure out how many bytes to work with for each hack.
Apparently the code does other stuff; I haven't looked into it at all. I may scan through it one day.

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3121
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: CusPop TODO list

Post by Norbert » August 13th, 2014, 2:51 pm

To change the delay before a loose floor falls:
viewtopic.php?p=14274#p14274

Allow climbing of any loose floor:
viewtopic.php?p=14282#p14282

Custom palace wall marks color:
viewtopic.php?p=15233#p15233

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3121
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: CusPop TODO list

Post by Norbert » August 13th, 2014, 3:15 pm

I just noticed that CusPop has "Bubbles of the blue potion" and "Bubbles of the green potion", but not "Bubbles of the red potion".
Maybe I'm overlooking something.

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3121
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: CusPop TODO list

Post by Norbert » August 13th, 2014, 3:41 pm

Suggested improvement for the sword hack, for a future princehack.xml.

From:

Code: Select all

<hack name="sword">
	<offset file="u0" value="0x61D5"/>
	<offset file="u3" value="0x56E5"/>
	<offset file="u4" value="0x5B91"/>
	<offset file="p0" value="0x4B25"/>
	<offset file="p3" value="0x4FA5"/>
	<offset file="p4" value="0x4A61"/>
	<check codes="83 7E 06 01"/>
	<read type="array" name="where will the kid have the sword">
		<option value="74" default="true">On all levels except level 1</option>
		<option value="EB">On none of the levels</option>
	</read>
	<check codes="05"/>
</hack>
To:

Code: Select all

<hack name="sword">
	<offset file="p0" value="0x4B25"/>
	<offset file="u0" value="0x61D5"/>
	<offset file="p3" value="0x4FA5"/>
	<offset file="u3" value="0x56E5"/>
	<offset file="p4" value="0x4A61"/>
	<offset file="u4" value="0x5B91"/>
	<check codes="83 7E"/>
	<read type="long" name="where will the kid have the sword">
		<option value="06 01 74 05" default="true">On all levels except level 1</option>
		<option value="06 02 74 05">On all levels except level 2</option>
		<option value="06 03 74 05">On all levels except level 3</option>
		<option value="06 04 74 05">On all levels except level 4</option>
		<option value="06 05 74 05">On all levels except level 5</option>
		<option value="06 06 74 05">On all levels except level 6</option>
		<option value="06 07 74 05">On all levels except level 7</option>
		<option value="06 08 74 05">On all levels except level 8</option>
		<option value="06 09 74 05">On all levels except level 9</option>
		<option value="06 10 74 05">On all levels except level 10</option>
		<option value="06 11 74 05">On all levels except level 11</option>
		<option value="06 12 74 05">On all levels except level 12a</option>
		<option value="06 13 74 05">On all levels except level 12b</option>
		<option value="06 14 74 05">On all levels except princess level</option>
		<option value="06 15 74 05">On all levels except potions level</option>
		<option value="06 00 74 05">On all levels except demo level</option>
		<option value="06 01 EB 05">On none of the levels</option>
		<option value="06 01 90 90">On all of the levels</option>
		<option value="06 02 7C 05">On level 2 and higher</option>
		<option value="06 03 7C 05">On level 3 and higher</option>
		<option value="06 04 7C 05">On level 4 and higher</option>
		<option value="06 05 7C 05">On level 5 and higher</option>
		<option value="06 06 7C 05">On level 6 and higher</option>
		<option value="06 07 7C 05">On level 7 and higher</option>
		<option value="06 08 7C 05">On level 8 and higher</option>
		<option value="06 09 7C 05">On level 9 and higher</option>
		<option value="06 10 7C 05">On level 10 and higher</option>
		<option value="06 11 7C 05">On level 11 and higher</option>
		<option value="06 12 7C 05">On level 12a and higher</option>
		<option value="06 13 7C 05">On level 12b and higher</option>
		<option value="06 14 7C 05">On princess and potions levels</option>
	</read>
</hack>
(Moved the trailing 05 byte to the values, for use with 90 90 ("On all of the levels"), and moved 06 from the check to the values to make the type "long". Also changed the offset files to the default - first hack's - order.)

David
The Prince of Persia
The Prince of Persia
Posts: 1474
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: CusPop TODO list

Post by David » August 15th, 2014, 11:08 am

Norbert wrote:I just noticed that CusPop has "Bubbles of the blue potion" and "Bubbles of the green potion", but not "Bubbles of the red potion".
Maybe I'm overlooking something.
That would be color 12 (see draw_tile_anim() in seg008.c), but its RGB values are overridden (see init_game_main() in seg000.c).
By the way, the color of the palace wall patterns (color 6) is overridden at the same place.

I'm not sure why did the programmer (of the DOS version) choose to override them seperately, instead of changing the hardcoded palette.
Perhaps the hardcoded palette was part of some library they used?

@sword hack:
I'm not sure if "long" accepts a sequence of hex bytes. You should try if it works.

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3121
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: CusPop TODO list

Post by Norbert » October 31st, 2014, 1:03 pm

Changing what happens if you press a key after dying:
viewtopic.php?p=15722#p15722

Disabling Ctrl+l, disabling cheat mode:
viewtopic.php?p=15737#p15737

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 3121
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: CusPop TODO list

Post by Norbert » November 1st, 2014, 8:10 pm

Disabling HP regeneration:
viewtopic.php?p=15745#p15745

[Edit:]
And a couple more related to regeneration and such starting this post and further:
viewtopic.php?p=15788#p15788

Andrew
Wise Scribe
Wise Scribe
Posts: 313
Joined: July 16th, 2009, 4:39 pm

Re: CusPop TODO list

Post by Andrew » February 15th, 2015, 6:11 am

Is there any point adding PoP1 1.1 as well? I don't suppose it'll be easy because all the offsets and other version-specific values will have to be figured out first, probably requiring David to disassemble yet another version. Not sure whether it's worth it or not. Probably for the sake of completeness?

Post Reply