Legacy of the Wizard: Difference between revisions

From Data Crystal
Jump to navigation Jump to search
mNo edit summary
 
(11 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Bob
| bobscreen= Legacy of the Wizard Title.png
| aka= Dragon Slayer IV: Drasle Family (JP)
| developer= Nihon Falcom
| publishers= {{publisher|Namco}} (JP), {{publisher|Brøderbund}} (US), {{publisher|Bandai Namco}} (EU/AU)
| systems= {{system|NES}}
| japan= {{date|1987|July|17}}
| usa= {{date|1989|April|nocat=true}}
| europe= {{date|2020|June|18|nocat=true}} (''[[Namco Museum Archives]] Vol. 2'')
| aus= {{date|2020|June|18|nocat=true}} (''Namco Museum Archives Vol. 2'')
| tcrf=Legacy of the Wizard
}}
{{INES
|title = Legacy of the Wizard <!--/ Dragon Slayer 4-->
|image = [[File:Legacy of the Wizard Title.png]]
|mapperno = 4 <!--/ 206-->
|mappername = Nintendo MMC3 <!--/ NAMCOT-3416-->
|prgrom = 8 x 16 KiB
|chrrom = 8 x 8 KiB
|mirroring = Vertical
|4screen = No
|sram = No
|game = Legacy of the Wizard
}}
==Sub-pages==
{{namespaces}}
== Tools ==
* [https://github.com/bbbradsmith/lotwtool lotwtool] - Game editor
* [https://www.romhacking.net/utilities/170/ DS4w] - Game editor (Windows 98)
== Documents ==
* [http://lsd4.starfree.jp/ LSD4] - Unofficial archive of Legacy of the Wizard / Dragon Slayer 4
* [https://strategywiki.org/wiki/Legacy_of_the_Wizard StrategyWiki: Legacy of the Wizard]
* [https://www.romhacking.net/documents/86/ Leghack] - A guide to hacking Legacy of the Wizard
* [https://gamefaqs.gamespot.com/nes/587404-legacy-of-the-wizard/faqs/26604 GameFAQs: Item and Stats Hacking Guide]
== Enemy Drops ==
== Enemy Drops ==


Line 62: Line 102:


== RNG ==
== RNG ==
Random number generation follows a simple PRNG formula that's based on nothing but its own previous values, and only ever changes when a new random number is rolled. This means it can be "seeded" and predictably determined based on # of times rolled. The code is:
Random number generation follows a simple PRNG formula that's based on nothing but its own previous values, and only ever changes when a new random number is rolled. This means it can be "seeded" and predictably determined based on # of times rolled. The pertinent RAM addresses are $0039, $003A, and $003B. $0038 also stores a modulus / exclusive upper bound that can be passed in via accumulator, which governs how many times to reroll for one single RNG call. The code is:


<pre>
<pre>
Line 95: Line 135:
  07:CC8E:  RTS
  07:CC8E:  RTS
</pre>
</pre>
{{Dragon Slayer series}}

Latest revision as of 22:50, 13 February 2024

Title Screen

Legacy of the Wizard

Also known as: Dragon Slayer IV: Drasle Family (JP)
Developer: Nihon Falcom
Publishers: Namco (JP), Brøderbund (US), Bandai Namco (EU/AU)
Platforms: NES
Released in JP: July 17, 1987
Released in US: April 1989
Released in EU: June 18, 2020 (Namco Museum Archives Vol. 2)
Released in AU: June 18, 2020 (Namco Museum Archives Vol. 2)


ROMIcon.png ROM map
RAMIcon.png RAM map
Cactisprite.png TCRF
Legacy of the Wizard
Mapper No. 4
Mapper Name Nintendo MMC3
PRG-ROM Pages 8 x 16 KiB
CHR-ROM Pages 8 x 8 KiB
Mirroring Vertical
4-Screen Mirroring No
SRAM Enabled No


Sub-pages

Read about development information and materials for this game.
ROM map
Read about prototype versions of this game that have been released or dumped.
RAM map

Tools

Documents

Enemy Drops

Drop index Item
$00 Bread
$01 Potion
$02 Money
$03 Poison
$04 Key
$05 Ring
$06 Cross
$07 Scroll

First, before any RNG is rolled whatsoever, three checks are done, in priority order (at $07EF85~$07EF9B):

  • If health is less than 20 ($14 hex), guaranteed bread drop ($00 drop index).
  • If magic is less than 30 ($1E hex), guaranteed magic potion drop ($01 drop index).
  • If key count is less than 2, guaranteed key drop ($04 drop index).

If none of these conditions are met, we then roll a random number from 0 to 19 ($14 hex modulus / exclusive upper bound). Fully detailed results for each value:

RNG roll value Result
$00 Poison
$01 Poison
$02 Poison
$03 Poison
$04 Key
$05 Key
$06 Ring
$07 Cross
$08 Scroll
$09~$13 Bread / Potion / Money based on checks (see below)

There's a 45% chance that it simply fetches from the drop table at $07EFE7~$07EFEF, meaning 20% chance for poison, 10% key, 5% ring, 5% cross, 5% scroll. The other 55% will do the following checks, in priority order (at $07EFAC~$07EFC3):

  • If life < magic, drop bread
  • If magic < gold, drop potion
  • Otherwise, drop money

RNG

Random number generation follows a simple PRNG formula that's based on nothing but its own previous values, and only ever changes when a new random number is rolled. This means it can be "seeded" and predictably determined based on # of times rolled. The pertinent RAM addresses are $0039, $003A, and $003B. $0038 also stores a modulus / exclusive upper bound that can be passed in via accumulator, which governs how many times to reroll for one single RNG call. The code is:

 07:CC64:  STA $0038
 07:CC66:  BEQ $CC8E
 07:CC68:  LDX $003B
 07:CC6A:  LDY $003A
 07:CC6C:  STY $0039
 07:CC6E:  TYA
 07:CC6F:  ASL
 07:CC70:  TAY
 07:CC71:  TXA
 07:CC72:  ROL
 07:CC73:  TAX
 07:CC74:  INY
 07:CC75:  BNE $CC78
 07:CC77:  INX
 07:CC78:  CLC
 07:CC79:  TYA
 07:CC7A:  ADC $003A
 07:CC7C:  TAY
 07:CC7D:  TXA
 07:CC7E:  ADC $003B
 07:CC80:  CLC
 07:CC81:  ADC $0039
 07:CC83:  AND #$7F
 07:CC85:  TAX
 07:CC86:  STX $003B
 07:CC88:  STY $003A
 07:CC8A:  CMP $0038
 07:CC8C:  BCS $CC6C
 07:CC8E:  RTS