summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Add-a-new-Mart.md43
1 files changed, 43 insertions, 0 deletions
diff --git a/Add-a-new-Mart.md b/Add-a-new-Mart.md
index 768c565..14c6956 100644
--- a/Add-a-new-Mart.md
+++ b/Add-a-new-Mart.md
@@ -7,6 +7,7 @@ This tutorial is for how to add a new Poké Mart. As an example, we'll add an ev
2. [Give it an inventory](#2-give-it-an-inventory)
3. [Use it in a map script](#3-use-it-in-a-map-script)
4. [Add a new type of Mart](#4-add-a-new-type-of-mart)
+5. [Sell more than 10 items per Mart](#5-sell-more-than-10-items-per-mart)
## 1. Define a mart constant
@@ -318,3 +319,45 @@ This new Mart type is appropriate for the Team Rocket merchant in Mahogany Town.
And it works!
![Screenshot](screenshots/marttype_shady.png)
+
+
+## 5. Sell more than 10 items per Mart
+
+This is a simple improvement.
+
+Edit [wram.asm](../blob/master/wram.asm):
+
+```diff
+ NEXTU ; d002
+ ; mart items
+ wMartItem1BCD:: ds 3
+ wMartItem2BCD:: ds 3
+ wMartItem3BCD:: ds 3
+ wMartItem4BCD:: ds 3
+ wMartItem5BCD:: ds 3
+ wMartItem6BCD:: ds 3
+ wMartItem7BCD:: ds 3
+ wMartItem8BCD:: ds 3
+ wMartItem9BCD:: ds 3
+ wMartItem10BCD:: ds 3
++wMartItem11BCD:: ds 3
++wMartItem12BCD:: ds 3
++wMartItem13BCD:: ds 3
++wMartItem14BCD:: ds 3
++wMartItem15BCD:: ds 3
++wMartItem16BCD:: ds 3
++wMartItem17BCD:: ds 3
++wMartItem18BCD:: ds 3
++wMartItem19BCD:: ds 3
++wMartItem20BCD:: ds 3
+
+ ...
+
+ UNION ; d0f0
+ ; mart data
+-wCurMart:: ds 16
++wCurMart:: ds 22
+ wCurMartEnd::
+```
+
+`wCurMart` stores the inventory from [data/items/marts.asm](../blob/master/data/items/marts.asm), including the count and the ending −1. So with 22 bytes, a Mart can sell 20 items. Then there just has to be enough space to store 20 prices.