-
Notifications
You must be signed in to change notification settings - Fork 0
/
code.s
1594 lines (1215 loc) · 21.5 KB
/
code.s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
.memorymap
defaultslot 0
slotsize $2000
slot 0 $0000
slot 1 $2000
slot 2 $4000
slot 3 $6000
slot 4 $8000
slot 5 $A000
slot 6 $C000
slot 7 $E000
.endme
.rombanksize $2000
.rombanks 17
.stringmaptable mainFontMap "DDSMT.tbl"
.macro text
.stringmap mainFontMap, \1
.endm
;text " "
;text " "
.background "Digital Devil Story.rom"
.incdir ""
.bank 2
.slot 2
.org $03CC
.section "Load Title Screen text" overwrite
ld a, $04
ld ($E002), a
ld ($7800), a
ld hl, Start
ld b, $B0
ld de, $1000
call LoadText
ld hl, Continue
ld b, $B0
ld de, $1028
call LoadText
ld hl, $1DAF
.ends
.bank 0
.slot 2
.org $054D
.section "Cutscene 1 load text" overwrite
ld de, $1100
ld b, $F1
ld a, $0D
ld ($E002), a
ld ($7800), a
ld hl, Cutscene1
call LoadText
.ds 11, $00
ret
.ends
.bank 0
.slot 2
.org $04D8
.section "Cutscene 2 load text" overwrite
ld de, $1100
ld b, $F1
ld a, $0D
ld ($E002), a
ld ($7800), a
ld hl, Cutscene2
call LoadText
.ds 11, $00
ret
.ends
.bank 0
.slot 2
.org $0781
.section "Cutscene 3 load text" overwrite
ld de, $1100
ld b, $F1
ld a, $0D
ld ($E002), a
ld ($7800), a
ld hl, Cutscene3
call LoadText
.ds 22, $00
ret
.ends
.bank 0
.slot 2
.org $0609
.section "Cutscene 4 load text" overwrite
ld de, $1100
ld b, $F1
ld a, $0D
ld ($E002), a
ld ($7800), a
ld hl, Cutscene4
call LoadText
.ds 11, $00
.ends
.bank 0
.slot 2
.org $06E1
.section "Cutscene 5 load text" overwrite
ld de, $1100
ld b, $F1
ld a, $0D
ld ($E002), a
ld ($7800), a
ld hl, Cutscene5
call LoadText
.ds 11, $00
.ends
.bank 0
.slot 2
.org $0723
.section "Cutscene 6 load text" overwrite
ld de, $1100
ld b, $F1
ld a, $0D
ld ($E002), a
ld ($7800), a
ld hl, Cutscene6
call LoadText
.ds 22, $00
.ends
.bank 2
.slot 4
.org $1A45
.section "Cutscene 7 load text" overwrite
.dw Cutscene7
.ends
.bank 0
.slot 2
.org $0811
.section "Bad ending load text" overwrite
ld hl, BadEnd
ld de, $1000
ld b, $F0
call LoadText
ld hl, $1A44
ld b, $19
.ends
.bank 0
.slot 2
.org $07B0
.section "Good ending load text" overwrite
ld hl, GoodEnd
ld de, $1000
ld b, $F0
call LoadText
ld hl, $1A47
ld b, $13
.ends
.bank 2
.slot 4
.org $05E9
.section "Telenet text" overwrite
Telenet: text "Presented by Telenet\END"
.ends
.bank 2
.slot 4
.org $0D8D
.section "Password Error" overwrite
Error: text "Password Error\END"
.ends
.bank 2
.slot 4
.org $1D60
.section "Exit Salesman text" overwrite
Exit: text "Exit\END"
.ends
.bank 2
.slot 4
.org $084A
.section "Load Password Screen text" overwrite
ld b, $80
ld hl, Password
ld a, $0D
ld ($E002), a
ld ($7800), a
ld de, $0080
call LoadText
.ends
.bank 2
.slot 4
.org $087D
.section "Load Password Screen" overwrite
ld b, $F0
ld a, $0D
ld ($E002), a
ld ($7800), a
ld hl, PasswordScreen
ld de, $1188
call LoadText
.ends
.bank 2
.slot 4
.org $08A4
.section "Done text" overwrite
ld b, $B0
ld a, $04
ld ($E002), a
ld ($7800), a
ld hl, Done
ld de, $1388
call LoadText
.ends
.bank 2
.slot 4
.org $1080
.section "Text routine" overwrite
LoadText:
ld a, ($E002)
push af
ld a, :LABEL5080
ld ($E002), a
ld ($7800), a
call LABEL5080
ld b, a
pop af
ld ($E002), a
ld ($7800), a
ld a, b
ret
.ends
.bank 2
.slot 4
.org $19CC
.section "Center Text" overwrite
CenterText:
ld a, ($E002)
push af
ld a, :LABEL59CC
ld ($E002), a
ld ($7800), a
call LABEL59CC
ld b, a
pop af
ld ($E002), a
ld ($7800), a
ld a, b
ret
.ends
.bank 14
.slot 4
.org $1C51
.section "HHC Text" overwrite
HHCText:
ld a, ($E002)
push af
ld a, :LABEL1DC51
ld ($E002), a
ld ($7800), a
call LABEL1DC51
ld b, a
pop af
ld ($E002), a
ld ($7800), a
ld a, b
ret
.ends
.bank 1
.slot 3
.org $1492
.section "Combat Log Text load" overwrite
CombatLogText:
ld a, ($E002)
push af
ld a, :LABEL3492
ld ($E002), a
ld ($7800), a
call LABEL3492
ld b, a
pop af
ld ($E002), a
ld ($7800), a
ld a, b
ret
.ends
.bank 4
.slot 6
.org $1E50
.section "Title 1 Image" overwrite
.INCBIN "title1.bin" READ 256
.ends
.bank 12
.slot 5
.org $0A80
.section "Title 2 Image" overwrite
.INCBIN "title2.bin" READ 1176
.ends
.bank 3
.slot 5
.org $14A0
.section "Title 3 Image" overwrite
.INCBIN "title3.bin" READ 158
.ends
.bank 6
.slot 6
.org $1F00
.section "Title 4 Image" overwrite
.INCBIN "title4.bin" READ 128
.ends
.bank 2
.slot 4
.org $1ABB
.section "Load Salesman Text" overwrite
ld hl, Salesman
ld b, $70
ld de, $1008
call LoadText
.ends
.bank 2
.slot 4
.org $191B
.section "Pointer load table" overwrite
ld de, $10F0
push de
call CenterText
.ends
.bank 13
.slot 5
.org $151B
.section "Izanami Text Pointer table rewrite" overwrite
.dw Izanami1, Izanami2, Izanami3, Izanami4, Izanami5, Izanami6, Izanami7, Izanami8
.dw Izanami9, Izanami10, Izanami11, Izanami12, Izanami13, Izanami14, Izanami15, Izanami16
.ends
.bank 13
.slot 5
.org $1727
.section "Yumiko Text Pointer table rewrite" overwrite
.dw Yumiko1, Yumiko2, Yumiko3, Yumiko4, Yumiko5, Yumiko6, Yumiko7, Yumiko8
.dw Yumiko9, Yumiko10, Yumiko11, Yumiko12, Yumiko13, Yumiko14, Yumiko15, Yumiko16
.ends
.bank 1
.slot 3
.org $11C0
.section "Load World names" overwrite
.dw MalkuthL, YesodL, HodL, NetzachL, TipheresL, GeburahL, ChesedL, BinahL, ChokmahL, KetherL, DaathL
.ends
.bank 1
.slot 3
.org $11D6
.section "Light World names" overwrite
MalkuthL: text "MALKHUT\END"
YesodL: text "YESOD\END"
HodL: text "HOD\END"
NetzachL: text "NETZACH\END"
TipheresL: text "TIFERET\END"
GeburahL: text "GEVURAH\END"
ChesedL: text "CHESED\END"
BinahL: text "BINAH\END"
ChokmahL: text "CHOKMAH\END"
KetherL: text "KETER\END"
DaathL: text "DA'AT\END"
.ends
.bank 13
.slot 5
.org $14B6
.section "Load HHC World names" overwrite
.dw $FFFF, MalkuthH, YesodH, HodH, NetzachH, TipheresH, GeburahH, ChesedH, BinahH, ChokmahH, KetherH, DaathH
.ends
.bank 14
.slot 2
.org $17CB
.section "Load HHC Text" overwrite
ld b, $F0
ld hl, Files
ld de, $00B0
call HHCText
call $9BBF
xor a
ld ($D6FD), a
ld b, $80
ld hl, Goto
ld de, $01F0
call HHCText
ld a, ($D28A)
or a
jr nz, LABEL1D7FC
ld b, $E8
ld hl, NoComp
ld de, $0330
call HHCText
jp $94D7
LABEL1D7FC:
ld a, ($D7A4)
or a
jr nz, LABEL1D81F
ld a, ($D280)
or a
jr nz, LABEL1D816
ld b, $E8
ld hl, NoBat
ld de, $0330
call HHCText
jp $94D7
LABEL1D816:
dec a
ld ($D280), a
ld a, $10
ld ($D7A4), a
LABEL1D81F:
ld b, $70
ld hl, NextSpr
ld de, $0330
call HHCText
ld b, $70
ld hl, ItemList
ld de, $0810
call HHCText
ld b, $70
ld hl, SprsMap
ld de, $0950
call HHCText
ld b, $70
ld hl, Pass
ld de, $0A90
call HHCText
.ends
.bank 14
.slot 2
.org $19DF
.section "Map text" overwrite
MapText: text "From to \END"
.ends
.bank 14
.slot 2
.org $1BBF
.section "Battery Text" overwrite
ld b, $70
ld hl, Battery
ld de, $1298
call HHCText
.ends
.bank 14
.slot 2
.org $15D3
.section "HHC Password Text" overwrite
ld b, $70
ld hl, Pass
ld de, $02A0
call HHCText
.ends
.bank 14
.slot 2
.org $1615
.section "Go to next SPR (No Map)" overwrite
ld b, $70
ld hl, NextSpr
ld de, $0160
call HHCText
ld a, ($D291)
or a
.db $20 $0E
ld b, $E8
ld hl, NoMap
ld de, $03E0
call HHCText
.ends
.bank 14
.slot 2
.org $1AAA
.section "Item List text" overwrite
ld b, $70
ld hl, ItemList
ld de, $00C8
call HHCText
.ends
.bank 14
.slot 2
.org $195D
.section "Map Title Text" overwrite
ld b, $70
ld hl, SprsMap
ld de, $00C0
call HHCText
.ends
.bank 0
.slot 2
.org $11B8
.section "Load Potion Text 1" overwrite
ld de, Potion
call CombatLogText
.ends
.bank 0
.slot 2
.org $11CF
.section "Load Potion Text 2" overwrite
ld de, Potion
call CombatLogText
.ends
.bank 0
.slot 2
.org $11F9
.section "Load Potion Text 3" overwrite
ld de, Potion
call CombatLogText
.ends
.bank 0
.slot 2
.org $128A
.section "Load Key Text 1" overwrite
ld de, Key
call CombatLogText
.ends
.bank 0
.slot 2
.org $133A
.section "Load Key Text 2" overwrite
ld de, Key
call CombatLogText
.ends
.bank 0
.slot 2
.org $1212
.section "Load Item Text 1" overwrite
ld de, Item
call CombatLogText
.ends
.bank 0
.slot 2
.org $1244
.section "Load Item Text 2" overwrite
ld de, Item
call CombatLogText
.ends
.bank 0
.slot 2
.org $1325
.section "Load Item Text 3" overwrite
ld de, Item
call CombatLogText
.ends
.bank 0
.slot 2
.org $1353
.section "Load Item Text 4" overwrite
ld de, Item
call CombatLogText
.ends
.bank 0
.slot 2
.org $1373
.section "Load Item Text 5" overwrite
ld de, Item
call CombatLogText
.ends
.bank 0
.slot 2
.org $13BD
.section "Load Item Text 6" overwrite
ld de, Item
call CombatLogText
.ends
.bank 0
.slot 2
.org $13DD
.section "Load Item Text 7" overwrite
ld de, Item
call CombatLogText
.ends
.bank 0
.slot 2
.org $1399
.section "Load Item Text 8" overwrite
ld de, Item
call CombatLogText
.ends
.bank 0
.slot 2
.org $13F6
.section "Load Item Text 9" overwrite
ld de, Item
call CombatLogText
.ends
.bank 0
.slot 2
.org $141B
.section "Load Item Text 10" overwrite
ld de, Item
call CombatLogText
.ends
.bank 1
.slot 3
.org $02CC
.section "Load Spotted Text" overwrite
ld de, Spotted
call CombatLogText
.ends
.bank 1
.slot 3
.org $067B
.section "Load Damage Text 1" overwrite
ld de, Damage
call CombatLogText
.ends
.bank 1
.slot 3
.org $1C38
.section "Load Damage Text 2" overwrite
ld de, Damage
call CombatLogText
.ends
.bank 1
.slot 3
.org $1CAA
.section "Load Damage Text 3" overwrite
ld de, Damage
call CombatLogText
.ends
.bank 16
.slot 5
.org $0000
.section "Password Screen" overwrite
Password: text "Password\END"
PasswordScreen: .db $F4 $20 $F5 $20 $F6 $20 $20 $20 $F7 $FF
.db $91 $92 $93 $94 $95 $00 $EA $EB $EC $ED $EE $96 $97 $98 $99 $9A $00 $EF $F0 $F1 $F2 $F3 $9B $9C $9D $9E $9F $00 $F7 $F8 $F9 $FA $FB $E0 $E1 $E2 $E3 $E4 $00 $F4 $F5 $F6 $00 $FE $E5 $E6 $E7 $E8 $E9 $00 $FF
.ends
.section "HHC Menu Text" overwrite
Files: text "PROGRAMS\END"
Goto: text "GOTO_NEXT_SPR\END"
NoComp: text "NO COMPUTER\END"
NextSpr: text "MAP_NEXT_SPR\END"
ItemList: text "LIST_ITEMS\END"
SprsMap: text "MAP_ALL_SPRS\END"
Pass: text "GET_PASSWORD\END"
NoMap: text "MAP NOT FOUND\END"
NoBat: text "BATTERY LOW\END"
Battery: text "BATTERY LEVEL\END"
.ends
.section "HHC World names" overwrite
MalkuthH: text "MALKHUT\END"
YesodH: text "YESOD\END"
HodH: text "HOD\END"
NetzachH: text "NETZACH\END"
TipheresH: text "TIFERET\END"
GeburahH: text "GEVURAH\END"
ChesedH: text "CHESED\END"
BinahH: text "BINAH\END"
ChokmahH: text "CHOKMAH\END"
KetherH: text "KETER\END"
DaathH: text "DA'AT\END"
.ends
.section "Cutscene 1 text" overwrite
Cutscene1:
text " \"Hinokagutsuchi!\" The power of "
text " the divine sword received from "
text " Izanami tears apart demonic "
text " force.\END"
.ends
.section "Cutscene 2 text" overwrite
Cutscene2:
text "You think that Master Loki could"
text "be defeated by the likes of you?"
text " You and Yumiko will "
text " be demon food!\END"
.ends
.section "Cutscene 3 text" overwrite
Cutscene3:
text " To cross the world connecting "
text " the good and evil of the Demon "
text " World, you will require the "
text " power of a demon-beast. "
text " Run, Cerberus!\END"
.ends
.section "Cutscene 4 text" overwrite
Cutscene4:
text " The Demon World's assaults are "
text " endless! Will Nakajima be able "
text " to save Yumiko?\END"
.ends
.section "Cutscene 5 text" overwrite
Cutscene5:
text " \"Akemi, I'm entrusting my "
text " message to this doll.\"\END"
.ends
.section "Cutscene 6 text" overwrite
Cutscene6:
text " \"Impressive, to end up all the "
text " way here, but your life shall "
text " end here as well.\" "
text " The Demon Lord Set's voice "
text " echoes in the darkness.\END"
.ends
.section "Cutscene 7 text" overwrite
Cutscene7:
text "Thank you for\n"
text "saving me, Akemi.\n"
text "Here, Set was\n"
text "keeping this\n"
text "key safe.\END"
.ends
.section "Izanami 1 text" overwrite
Izanami1:
text "Quickly, find your\n"
text "servant Cerberus.\END"
.ends
.section "Izanami 2 text" overwrite
Izanami2:
text "There is no\n"
text "going back,\n"
text "once you set foot\n"
text "in the Demon World.\END"
.ends
.section "Izanami 3 text" overwrite
Izanami3:
text "As the moon waxes,\n"
text "a \"demon\" starts\n"
text "to move.\END"
.ends
.section "Izanami 4 text" overwrite
Izanami4:
text "The greedy wants to\n"
text "devour the poor.\END"
.ends
.section "Izanami 5 text" overwrite
Izanami5:
text "The good and evil of\n"
text "the Demon World are\n"
text "at balance within\n"
text "a dark world.\END"
.ends
.section "Izanami 6 text" overwrite
Izanami6:
text "Treat Cerberus well.\n"
text "He has sworn to you\n"
text "eternal loyalty.\END"
.ends
.section "Izanami 7 text" overwrite
Izanami7:
text "Take Yumiko and come\n"
text "see me quickly...\END"
.ends
.section "Izanami 8 text" overwrite
Izanami8:
text "Shikome is\n"
text "enthralled by\n"
text "the serene smell.\END"
.ends
.section "Izanami 9 text" overwrite
Izanami9:
text "The flowing sand\n"
text "fills the demonic\n"
text "hourglass.\END"
.ends
.section "Izanami 10 text" overwrite
Izanami10: