Kaiketsu Zorori Tomahounoyuuenchi O Hime Samawosukue!
Princess at the ending: conditions and operations
You can see the ending where the princess appears. The operation/condition is to clear the game while collecting 9999 stamps that appear during the game.
JapanRetroGameClub