Page 2 of 6

Re: CusPop TODO list

Posted: December 27th, 2013, 9:09 pm
by David
I see you also added some space between the lines.
Now it looks much better! :)

Re: CusPop TODO list

Posted: May 17th, 2014, 10:40 am
by David
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.

Re: CusPop TODO list

Posted: May 17th, 2014, 9:36 pm
by salvadorc17
What is cuspop, is for pc dos version???

Re: CusPop TODO list

Posted: May 18th, 2014, 7:19 pm
by David
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

Re: CusPop TODO list

Posted: May 23rd, 2014, 11:44 am
by Norbert
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.]

Re: CusPop TODO list

Posted: August 11th, 2014, 8:16 pm
by Norbert
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. ;)

Re: CusPop TODO list

Posted: August 12th, 2014, 7:33 pm
by David
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?

Re: CusPop TODO list

Posted: August 12th, 2014, 9:26 pm
by Norbert
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.

Re: CusPop TODO list

Posted: August 13th, 2014, 2:51 pm
by Norbert
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

Re: CusPop TODO list

Posted: August 13th, 2014, 3:15 pm
by Norbert
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.

Re: CusPop TODO list

Posted: August 13th, 2014, 3:41 pm
by Norbert
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.)

Re: CusPop TODO list

Posted: August 15th, 2014, 11:08 am
by David
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.

Re: CusPop TODO list

Posted: October 31st, 2014, 1:03 pm
by Norbert
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

Re: CusPop TODO list

Posted: November 1st, 2014, 8:10 pm
by Norbert
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

Re: CusPop TODO list

Posted: February 15th, 2015, 6:11 am
by Andrew
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?