90 Commits

Author SHA1 Message Date
506b0974ff Merge branch 'FancyDoorsMap' into MappableDoors 2026-01-18 07:02:23 -06:00
a3bc7dea0e Print label of end of bank B9 2026-01-18 06:59:46 -06:00
94ccbb70dc Fix pot junk not showing as uncollected 2026-01-17 13:56:20 -06:00
e2614b6f75 Fix check for overlord (which fixes boomerang chest guard) 2026-01-17 13:30:37 -06:00
9e2b148a57 Fix light cone not showing after torches extinguish 2026-01-16 18:27:32 -06:00
f8cc7d2ef8 Fix a chest in incorrect section 2026-01-16 15:44:05 -06:00
d504e33d52 Show button help on map screen 2026-01-16 14:36:43 -06:00
043a2d83b2 Add tier of item value for maps 2026-01-15 19:03:13 -06:00
8f75b8ec71 Merge branch 'GKNew' into FancyDoorsMap 2026-01-15 04:07:27 -06:00
420f2477fc Invert bitfield for pseudoflute 2026-01-15 04:05:30 -06:00
727c265811 Fix/update (de)compress utils 2026-01-15 03:37:02 -06:00
32e7fe5454 Small bugfixes 2026-01-15 03:28:46 -06:00
2c601d2fc7 More split rooms, hide boss icon in HC, fix loot bug 2026-01-14 13:10:12 -06:00
902e14b3f4 Bugfixes! 2026-01-13 18:57:55 -06:00
a011bc9f4a Allow switching dungeons in doors mode 2026-01-13 11:00:31 -06:00
633453f386 Press Select for next entrance 2026-01-13 09:34:04 -06:00
831e6cc27f SW Pot Prison 2026-01-13 00:38:34 -06:00
8e45ef1bd2 Section off drops and warps, add more sections 2026-01-13 00:28:25 -06:00
9c5f0dd5f5 More separate-section implementation 2026-01-12 22:28:54 -06:00
17939339bc Start tracking separated sections 2026-01-12 20:30:08 -06:00
91fab07e5c Clean up CanSeeConnector 2026-01-12 16:39:32 -06:00
cacc640a4f Draw entrances 2026-01-12 16:24:22 -06:00
c38b3b6d0a Conditionally draw staircase labels 2026-01-12 15:49:09 -06:00
fcf17a6dff Fix ordering of several edges and spiral staircases 2026-01-12 14:37:42 -06:00
06aa3cb10f Fix some UI infinite loops 2026-01-11 22:25:03 -06:00
970d1f5db0 Show stairs, warps, and drops in doors map 2026-01-11 21:42:48 -06:00
e56b8a55fe Do not show unknown connectors 2026-01-11 06:05:46 -06:00
78eb8916fc Show boss icon 2026-01-11 05:04:39 -06:00
60c852bfa9 Rearrange gfx slightly 2026-01-11 04:12:07 -06:00
36a8eaee89 Handle In-Room staircases 2026-01-11 04:03:52 -06:00
527041b81b Show loot in doors map 2026-01-10 21:21:19 -06:00
5e7c4a65b8 Allow moving through doors map 2026-01-10 20:17:29 -06:00
6f2b68886f Move unused chest data to room 0F instead of F0 2026-01-10 14:50:47 -06:00
b1cc141154 Merge branch 'DungeonMap' into MappableDoors 2026-01-10 14:50:05 -06:00
4da41410db Move bottles to minor item tier 2026-01-10 14:47:48 -06:00
1776daa43d Draw triple connections correctly 2026-01-10 14:44:15 -06:00
610607ece4 Refactor and open edges 2026-01-10 00:48:22 -06:00
278e428658 First steps 2026-01-09 13:45:00 -06:00
63065e34b7 Update supertile shapes 2026-01-07 20:56:14 -06:00
ba9f0c7555 Fix incorrect dungeon reminder appearing briefly out of map 2026-01-07 20:21:20 -06:00
aae220fb46 Update supertiles, fix incorrect linkpoint 2026-01-07 20:09:35 -06:00
a7c7fc4394 Map tile updates 2026-01-07 13:34:28 -06:00
b2b23b047f Remove custom sheet d4 2026-01-07 12:04:19 -06:00
3964c34658 Move loot icons to sheet with connectors 2026-01-07 12:00:16 -06:00
8cf0059f84 compress util takes offset and length parameters 2026-01-07 11:44:26 -06:00
0a98db7025 Clear unseen connections in custom map mode 2026-01-07 06:12:43 -06:00
bdb1272cb2 Clean up macros somewhat 2026-01-07 05:30:49 -06:00
d5917afb64 Read map data from bank $B9 in custom map mode 2026-01-07 05:12:07 -06:00
e5523473d6 Item category tweaks, fix two phantom chests 2026-01-06 22:40:00 -06:00
72e126a1b6 Separate sheet for door connections beginning 2026-01-06 18:16:20 -06:00
56dd5fbc01 In doors mode, ignore current floor when loading maps 2026-01-06 12:06:04 -06:00
7764682f95 square connector? idk 2026-01-06 10:33:17 -06:00
b3f35f274b Draw door connections? prototype??? 2026-01-05 23:25:51 -06:00
5574eea4c7 WIP 2026-01-05 20:06:50 -06:00
d918e571ab Rearrange some tiles 2026-01-05 06:06:02 -06:00
23edb9a3e6 Supertile shapes, small fixes 2026-01-04 23:02:21 -06:00
21c6d0acfd Many more supertile tweaks 2026-01-04 12:23:56 -06:00
f75db2cac8 AlwaysShowCompass setting 2026-01-04 09:15:10 -06:00
fd8852d866 Lots of bugs fixes and supertile updates 2026-01-04 09:03:23 -06:00
7fc7c8fe0b Full words in supertile shapes file 2026-01-03 17:12:39 -06:00
7a12032067 More supertile shape updates 2026-01-03 13:19:29 -06:00
3489af82fa Add dungeon indicator lettering to maps 2026-01-03 09:58:23 -06:00
fecf9547a5 Sprites for entrances and update supertile shapes 2026-01-03 09:20:51 -06:00
688300d21a Tile warps on map 2026-01-02 17:29:57 -06:00
9b4d79247f Update supertile shapes 2026-01-02 15:01:12 -06:00
1b43799e6e Fix pot shuffle, implement map settings 2026-01-02 03:37:02 -06:00
58db28f8bf Check dungeon prizes, tweak gfx 2025-12-31 12:17:43 -06:00
443080c482 ShowItems settings 2025-12-31 00:21:40 -06:00
10ced3c9c6 Big pass at dungeon item indicators 2025-12-30 21:56:48 -06:00
9a40f28a86 Rename dungeonmap.asm -> bossicons.asm 2025-12-30 16:36:55 -06:00
8de358d99f (de)compression src fixes and windows binaries 2025-12-30 16:35:43 -06:00
1ba813f068 Add src and linux binaries for (de)compression code 2025-12-28 14:30:49 -06:00
13372307c2 Include bosses in option to make baserom playable 2025-12-28 14:29:18 -06:00
63e8d5687b Fix timer and add drop-to-ganon mode 2025-12-14 11:10:23 -06:00
a6ad4c082b Finish pseudoflute 2025-12-13 22:48:03 -06:00
74d9c72cc8 Pseudoflute 2025-12-13 19:06:11 -06:00
18a73e3b88 Add flag to make the baserom work 2025-12-12 21:33:08 -06:00
4f0703ea62 Merge remote-tracking branch 'codemann/OWMain' into GKNew 2025-12-12 18:16:07 -06:00
9b7e5646b3 Improve junk item configuration 2025-09-05 20:47:36 -05:00
e4f9c4cffc Add variable ganon vulnerability mode 2025-09-03 19:53:10 -05:00
cef41b1674 Merge branch 'OWMain' into GKNew 2025-09-01 10:56:43 -05:00
02b07528bb Merge branch 'OWmain' into GKNew 2025-07-22 11:33:34 -05:00
9256f48f5e Merge branch 'OWMain' into GKNew 2025-07-01 14:08:48 -05:00
2344f9490e copy skulls manually instead of DMA 2025-05-18 02:56:13 -05:00
642aec9112 Fix gloom heart icons to be loaded via DMA 2025-05-18 02:32:39 -05:00
bc0f396275 Challenge modes: OHKO and Gloom 2025-05-18 00:59:34 -05:00
a3f892975f Merge branch 'OWMain' into GKNew 2025-05-04 15:18:54 -05:00
e92aa018e3 Multiworld junk item shortening 2025-03-17 19:02:02 -05:00
66e4e91beb Dashing mimics and crystal books 2025-03-09 16:42:54 -05:00
bc966c0f99 Dark room modes 2025-03-09 13:25:22 -05:00
76 changed files with 8295 additions and 154 deletions

View File

@@ -50,6 +50,7 @@ dw !ROM_VERSION_HIGH
function hexto555(h) = ((((h&$FF)/8)<<10)|(((h>>8&$FF)/8)<<5)|(((h>>16&$FF)/8)<<0)) function hexto555(h) = ((((h&$FF)/8)<<10)|(((h>>8&$FF)/8)<<5)|(((h>>16&$FF)/8)<<0))
; Feature flags, run asar with -DFEATURE_X=1 to enable ; Feature flags, run asar with -DFEATURE_X=1 to enable
!FEATURE_FIX_BASEROM ?= 0
;================================================================================ ;================================================================================
@@ -178,7 +179,7 @@ incsrc toast.asm
incsrc fastcredits.asm incsrc fastcredits.asm
incsrc msu.asm incsrc msu.asm
incsrc menu/overworldmap.asm ; Overwrites some code in bank $8A incsrc menu/overworldmap.asm ; Overwrites some code in bank $8A
incsrc dungeonmap.asm incsrc bossicons.asm
incsrc hextodec.asm incsrc hextodec.asm
incsrc multiworld.asm incsrc multiworld.asm
incsrc textrenderer.asm incsrc textrenderer.asm
@@ -201,6 +202,21 @@ incsrc inventory.asm
incsrc menu/hudalpha.asm incsrc menu/hudalpha.asm
warnpc $A38000 warnpc $A38000
org $B98000
incsrc crystalswitchbook.asm
incsrc mimicdash.asm
incsrc gloom.asm
incsrc special_weapons.asm
incsrc variable_ganon_vulnerability.asm
incsrc pseudoflute.asm
incsrc dungeon_map/main.asm
print "End of B9: ", pc
warnpc $B9E000 ; $E000 - EFFF reserved for custom door rando map data
org $B9F000
incsrc dungeon_map/settings.asm
org $A38000 org $A38000
incsrc stats/credits.asm ; Statically mapped incsrc stats/credits.asm ; Statically mapped
incsrc stats/main.asm incsrc stats/main.asm
@@ -243,7 +259,7 @@ warnpc $B1A000
org $B1A000 org $B1A000
GFX_HUD_Items: GFX_HUD_Items:
incbin "menu/drsheetdc.2bppc" incbin "menu/dr_sheet_dc.2bppc"
warnpc $B1A800 warnpc $B1A800
org $B1A800 org $B1A800
@@ -296,6 +312,24 @@ NewFontInverted:
incbin "data/newfont_inverted.bin" incbin "data/newfont_inverted.bin"
SmallCharacters: SmallCharacters:
incbin "data/smallchars.2bpp" incbin "data/smallchars.2bpp"
DungeonMapIcons1:
incbin "menu/map_icons_1.3bppc"
DungeonMapIcons2:
incbin "menu/map_icons_2.3bppc"
DungeonMapIcons3:
incbin "menu/map_icons_3.3bppc"
DungeonMapIcons4:
incbin "menu/map_icons_4.3bppc"
DungeonMapIcons5:
incbin "menu/map_icons_5.3bppc"
DungeonMapIcons6:
incbin "menu/map_icons_6.3bppc"
DungeonMapDoorConnectors:
incbin "menu/door_connectors.3bppc"
MapSheetD4:
incbin "menu/map_sheet_d4.3bppc"
org $8CD7DF org $8CD7DF
incsrc data/playernamecharmap.asm incsrc data/playernamecharmap.asm
org $8CE73D org $8CE73D
@@ -353,6 +387,7 @@ warnpc $B08000
;$33 Graphics Bank ;$33 Graphics Bank
;$36 reserved for Enemizer ;$36 reserved for Enemizer
;$37 Room data if needed for DR/Pottery/Enemizer ;$37 Room data if needed for DR/Pottery/Enemizer
;$39 GwaaKiwi Code Bank
;$3A reserved for downstream use ;$3A reserved for downstream use
;$3B reserved for downstream use ;$3B reserved for downstream use
;$3F reserved for internal debugging ;$3F reserved for internal debugging

BIN
bin/linux/compress Normal file

Binary file not shown.

BIN
bin/linux/decompress Normal file

Binary file not shown.

249
bin/src/compress.c Normal file
View File

@@ -0,0 +1,249 @@
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <sys/stat.h>
const int MAXLENGTH = 0x300;
struct section {
int mode;
int length;
unsigned char data[2];
int datalength;
};
int find_duplicate(off_t loc, off_t size, unsigned char buf[], struct section *out) {
int i, j;
struct section result;
result.mode = 4;
result.length = 0;
for (i = 0; i < loc && i < 0x10000; i++) {
if (buf[i] != buf[loc]) {
continue;
}
for (j = 0; j < MAXLENGTH; j++) {
if (buf[i + j] != buf[loc + j]) {
break;
}
}
if (j > result.length) {
result.length = j;
result.data[0] = i & 0xFF;
result.data[1] = (i >> 8) & 0xFF;
result.datalength = 2;
}
}
if (result.length < 4) {
return -1;
}
*out = result;
return 0;
}
int find_repeat_byte(off_t loc, off_t size, unsigned char buf[], struct section *out) {
int i;
for (i = 0; i < MAXLENGTH && loc + i < size; i++) {
if (buf[loc + i] != buf[loc]) {
break;
}
}
if (i > 2) {
struct section result;
result.mode = 1;
result.length = i;
result.data[0] = buf[loc];
result.datalength = 1;
*out = result;
return 0;
}
return -1;
}
int find_repeat_word(off_t loc, off_t size, unsigned char buf[], struct section *out) {
int i;
for (i = 0; i < MAXLENGTH && loc + i + 1 < size; i += 1) {
if (buf[loc + i] != buf[loc + (i & 1)]) {
break;
}
}
if (i > 3) {
struct section result;
result.mode = 2;
result.length = i;
result.data[0] = buf[loc];
result.data[1] = buf[loc + 1];
result.datalength = 2;
*out = result;
return 0;
}
return -1;
}
int find_incrementing_byte(off_t loc, off_t size, unsigned char buf[], struct section *out) {
int i;
for (i = 0; i < MAXLENGTH && loc + i < size; i++) {
if (buf[loc] + i < i) {
break;
}
if (buf[loc + i] != buf[loc] + i) {
break;
}
}
if (i > 2) {
struct section result;
result.mode = 3;
result.length = i;
result.data[0] = buf[loc];
result.datalength = 1;
*out = result;
return 0;
}
return -1;
}
int get_section(off_t loc, off_t size, unsigned char buf[], struct section *out) {
struct section best, current;
best.length = 0;
if (!find_repeat_byte(loc, size, buf, &current)) {
if (current.length > best.length) {
best = current;
}
}
if (!find_repeat_word(loc, size, buf, &current)) {
if (current.length > best.length) {
best = current;
}
}
if (!find_incrementing_byte(loc, size, buf, &current)) {
if (current.length > best.length) {
best = current;
}
}
if (!find_duplicate(loc, size, buf, &current)) {
if (current.length > best.length) {
best = current;
}
}
if (best.length > 0) {
// printf("byte %06X: mode %d length %02X\n", loc, best.mode, best.length);
*out = best;
return 0;
} else {
return -1;
}
}
int write_section(struct section section, unsigned char data[], unsigned char buf[], int loc) {
int nloc = loc;
int len = section.length - 1;
if (len > 0x1F) {
buf[nloc++] = 0xE0 | (section.mode << 2) | (len >> 8);
buf[nloc++] = len & 0xFF;
} else {
buf[nloc++] = (section.mode << 5) | len;
}
for (int i = 0; i < section.datalength; i++) {
buf[nloc++] = data[i];
}
return nloc;
}
int main(int argc, char *argv[]) {
if (argc < 3) {
printf("Usage: %s infile outfile [start [length]]\n", argv[0]);
return 1;
}
off_t seek = 0;
if (argc > 3) {
seek = strtol(argv[3], NULL, 0);
}
FILE *inptr;
if ((inptr = fopen(argv[1], "rb")) == NULL) {
printf("%s does not exist.\n", argv[1]);
return 1;
}
int fd = fileno(inptr);
if (fd < 0) {
printf("Error stating file: %s\n", argv[1]);
return 1;
}
struct stat buf;
if (fstat(fd, &buf) != 0) {
printf("Error stating file: %s\n", argv[1]);
return 1;
}
off_t size = buf.st_size - seek;
if (argc > 4) {
size = strtol(argv[4], NULL, 0);
}
unsigned char inbuf[size];
fseek(inptr, seek, SEEK_SET);
if (fread(inbuf, 1, size, inptr) < size) {
printf("Error reading file: %s\n", argv[1]);
return 1;
}
fclose(inptr);
unsigned char outbuf[size * 2];
unsigned char m0data[MAXLENGTH];
int oloc = 0;
struct section m0;
m0.mode = 0;
m0.length = 0;
int i;
off_t loc = 0;
while (loc < size) {
struct section section;
if (!get_section(loc, size, inbuf, &section)) {
if (m0.length > 0) {
m0.datalength = m0.length;
oloc = write_section(m0, m0data, outbuf, oloc);
m0.length = 0;
}
oloc = write_section(section, section.data, outbuf, oloc);
loc += section.length;
} else {
if (m0.length == MAXLENGTH) {
m0.datalength = m0.length;
oloc = write_section(m0, m0data, outbuf, oloc);
m0.length = 0;
}
m0data[m0.length++] = inbuf[loc];
loc += 1;
}
}
if (m0.length > 0) {
m0.datalength = m0.length;
oloc = write_section(m0, m0data, outbuf, oloc);
m0.length = 0;
}
outbuf[oloc++] = 0xFF;
FILE *outptr;
if ((outptr = fopen(argv[2], "wb")) == NULL) {
printf("Error opening file: %s\n", argv[2]);
return 1;
}
if (fwrite(outbuf, 1, oloc, outptr) < oloc) {
printf("Error writing to file: %s\n", argv[2]);
return 1;
}
fclose(outptr);
printf("Input file: %lX bytes. Compressed: %X bytes.\n", size, oloc);
return 0;
}

155
bin/src/decompress.c Normal file
View File

@@ -0,0 +1,155 @@
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <sys/stat.h>
struct section {
int mode;
int length;
unsigned char data[2];
int datalength;
};
int read_section(unsigned char buf[], int loc, struct section *out) {
int nloc = loc;
unsigned char header = buf[nloc++];
if (header == 0xFF) {
return -1;
}
struct section result;
result.data[0] = buf[loc];
result.datalength = 1;
if ((header & 0xE0) == 0xE0) {
result.mode = (header & 0x1C) >> 2;
result.length = (((header & 0x03) << 8) | buf[nloc++]) + 1;
} else {
result.mode = (header & 0xE0) >> 5;
result.length = (header & 0x1F) + 1;
}
switch (result.mode) {
case 0:
result.datalength = 0;
break;
case 1:
result.datalength = 1;
break;
case 2:
result.datalength = 2;
break;
case 3:
result.datalength = 1;
break;
case 4:
result.datalength = 2;
break;
}
for (int i = 0; i < result.datalength; i++) {
result.data[i] = buf[nloc++];
}
*out = result;
return nloc;
}
int main(int argc, char *argv[]) {
if (argc < 3) {
printf("Usage: %s infile outfile [start [length]]\n", argv[0]);
return 1;
}
off_t seek = 0;
if (argc > 3) {
seek = strtol(argv[3], NULL, 0);
}
FILE *inptr;
if ((inptr = fopen(argv[1], "rb")) == NULL) {
printf("%s does not exist.\n", argv[1]);
return 1;
}
int fd = fileno(inptr);
if (fd < 0) {
printf("Error stating file: %s\n", argv[1]);
return 1;
}
struct stat buf;
if (fstat(fd, &buf) != 0) {
printf("Error stating file: %s\n", argv[1]);
return 1;
}
off_t size = buf.st_size - seek;
if (argc > 4) {
size = strtol(argv[4], NULL, 0);
}
fseek(inptr, seek, SEEK_SET);
unsigned char inbuf[size];
if (fread(inbuf, 1, size, inptr) < size) {
printf("Error reading file: %s\n", argv[1]);
return 1;
}
fclose(inptr);
unsigned char outbuf[size * 256];
int oloc = 0;
struct section section;
int i;
off_t loc = 0;
while ((loc = read_section(inbuf, loc, &section)) >= 0) {
if (section.mode == 0) {
for (i = 0; i < section.length; i++) {
outbuf[oloc++] = inbuf[loc++];
}
} else if (section.mode == 1) {
for (i = 0; i < section.length; i++) {
outbuf[oloc++] = section.data[0];
}
} else if (section.mode == 2) {
for (i = 0; i < section.length; i++) {
outbuf[oloc++] = section.data[0];
if (++i < section.length) {
outbuf[oloc++] = section.data[1];
}
}
} else if (section.mode == 3) {
for (i = 0; i < section.length; i++) {
outbuf[oloc++] = (section.data[0] + i) & 0xff;
}
} else if (section.mode == 4) {
int offset = section.data[0] | (section.data[1] << 8);
for (i = 0; i < section.length; i++) {
outbuf[oloc++] = outbuf[offset + i];
}
}
}
FILE *outptr;
if ((outptr = fopen(argv[2], "wb")) == NULL) {
printf("Error opening file: %s\n", argv[2]);
return 1;
}
if (fwrite(outbuf, 1, oloc, outptr) < oloc) {
printf("Error writing to file: %s\n", argv[2]);
return 1;
}
fclose(outptr);
printf("Input file: %lX bytes. Decompressed: %X bytes.\n", size, oloc);
return 0;
}

BIN
bin/windows/compress.exe Normal file

Binary file not shown.

BIN
bin/windows/decompress.exe Normal file

Binary file not shown.

View File

@@ -20,7 +20,12 @@ DoDungeonMapBossIcon:
; get sprite pointer for room ; get sprite pointer for room
LDA.l UWSpritesPointers,X LDA.l UWSpritesPointers,X
STA.b Scrap00 ; pointer in $00 STA.b Scrap00 ; pointer in $00
LDA.w #$0028 : STA.b Scrap02 ; set the bank to 28 for now if !FEATURE_FIX_BASEROM
LDA.w #$0089
else
LDA.w #$0028 ; set the bank to 28 for now
endif
STA.b Scrap02
LDY.w #$0001 ; to skip the "sort" LDY.w #$0001 ; to skip the "sort"
; get first byte to make sure it isn't an empty room ; get first byte to make sure it isn't an empty room

View File

@@ -282,6 +282,72 @@ SetItemRiseTimer:
LDA.w ItemReceiptMethod : CMP.b #$01 : BNE .not_from_chest LDA.w ItemReceiptMethod : CMP.b #$01 : BNE .not_from_chest
LDA.b #$38 : STA.w AncillaTimer, X LDA.b #$38 : STA.w AncillaTimer, X
RTL RTL
.not_from_chest .not_from_chest
JSL.l ItemIsJunk
BEQ .default
.junk
LDA.l JunkItemTimer : AND.b #$3F : STA.w AncillaTimer, X
RTL
.default
TYA : STA.w AncillaTimer, X ; What we wrote over TYA : STA.w AncillaTimer, X ; What we wrote over
RTL RTL
;--------------------------------------------------------------------------------
ItemIsJunk:
PHX
LDA.l JunkItemTimer : BIT.b #$3F : BEQ .not_junk
BIT.b #$80 : BNE .check
LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE .check
LDA.l !MULTIWORLD_RECEIVING_ITEM : BNE .check
BRA .not_junk
.check
LDA.l JunkItemTimer : AND.b #$40
BEQ +
LDA.b #JunkItems_triforce_end-JunkItems_end
+
CLC : ADC.b #JunkItems_end-JunkItems-1
LDA.w AncillaGet, X
TAX
-
CMP.l JunkItems, X : BEQ .junk
DEX : BPL -
.not_junk
PLX
LDA.b #$00
RTL
.junk
PLX
LDA.b #$01
RTL
RTL
JunkItems:
db $27 ; Bomb
db $28 ; 3 bombs
db $31 ; 10 bombs
db $34 ; 1 rupee
db $35 ; 5 rupees
db $36 ; 20 rupees
db $40 ; 100 rupees
db $41 ; 50 rupees
db $42 ; Heart
db $43 ; Arrow
db $44 ; 10 arrows
db $45 ; Small magic
db $46 ; 300 rupees
db $47 ; 20 rupees green
db $59 ; Rupoor
db $D1 ; Apples
db $D2 ; Fairy
db $D3 ; Chicken
db $D4 ; Big Magic
db $D5 ; 5 Arrows
db $D6 ; Good Bee
.end
db $6B ; Power Star
db $6C ; Triforce Piece
.triforce_end
;--------------------------------------------------------------------------------

52
crystalswitchbook.asm Normal file
View File

@@ -0,0 +1,52 @@
pushpc
org $87A46E
JSL CheckBookTriggerSwitch
BCS +
skip 15
+
org $8296A8
JSL FinishPegChange
pullpc
FinishPegChange:
LDA.b #$20
TRB.w $037A
STZ.b $B0
STZ.b $11
RTL
CheckBookTriggerSwitch:
LDA.l CrystalSwitchBook
BEQ +
LDA.b $10
CMP.b #$07
BNE +
LDA.l $7EC172
EOR.b #$01
STA.l $7EC172
LDA.b #$16
STA.b $11
LDA.b #$20
TSB.w $037A
LDA.b #$25
JSL $8DBB8A
SEC
BRA .done
+ CLC
.done
; what we wrote over
LDA.b $3A
AND.b #$BF
STA.b $3A
RTL

Binary file not shown.

Binary file not shown.

BIN
data/skull.bin Normal file

Binary file not shown.

View File

@@ -288,21 +288,61 @@ DialogGanon2:
REP #$20 REP #$20
BCS + BCS +
LDA.w #$018D : BRA ++ LDA.w #$018D : JMP .done
+ +
LDA.l GanonVulnerabilityItem : AND.w #$00FF
BEQ .silver_arrows
CMP.w #$0001 : BEQ .silver_arrows
CMP.w #$0004 : BEQ .bombs
CMP.w #$0005 : BEQ .powder
CMP.w #$0010 : BEQ .bee
PHX : TAX
LDA.l EquipmentWRAM-1, X
PLX
AND.w #$00FF : BNE .have
BRA .dont_have
.silver_arrows
LDA.l BowTracking LDA.l BowTracking
BIT.w #$0080 : BNE + ; branch if bow BIT.w #$0080 : BEQ .dont_have ; no bow
LDA.w #$0192 : BRA ++ BIT.w #$0040 : BNE .have ; have silvers
+
BIT.w #$0040 : BEQ + ; branch if no silvers BIT.w #$0020 : BNE +
LDA.w #$0195 : BRA ++ LDA.w #$0194 : BRA .done ; have p bow
+ + LDA.w #$0193 : BRA .done ; don't have p bow
BIT.w #$0020 : BNE + ; branch if p bow
LDA.w #$0194 : BRA ++ .dont_have
+ LDA.w #$0192 : BRA .done
LDA.w #$0193 : BRA ++ .have
++ LDA.w #$0195 : BRA .done
.bombs
LDA.l BombsEquipment : AND.w #$00FF : BNE .have
LDA.l InfiniteBombs : AND.w #$00FF : BNE .have
BRA .dont_have
.powder
LDA.l InventoryTracking : BIT.w #$0010 : BNE .have
BRA .dont_have
.bee
LDA.l BottleContentsOne : AND.w #$00FF
CMP.w #$0007 : BEQ .have
CMP.w #$0008 : BEQ .have
LDA.l BottleContentsTwo : AND.w #$00FF
CMP.w #$0007 : BEQ .have
CMP.w #$0008 : BEQ .have
LDA.l BottleContentsThree : AND.w #$00FF
CMP.w #$0007 : BEQ .have
CMP.w #$0008 : BEQ .have
LDA.l BottleContentsFour : AND.w #$00FF
CMP.w #$0007 : BEQ .have
CMP.w #$0008 : BEQ .have
BRA .dont_have
.done
STA.w TextID STA.w TextID
SEP #$20 SEP #$20
JSL Sprite_ShowMessageMinimal_Alt JSL Sprite_ShowMessageMinimal_Alt

View File

@@ -59,10 +59,18 @@ DRHUD_EnemyDropIndicator:
SEP #$10 : TAX : REP #$10 SEP #$10 : TAX : REP #$10
DRHUD_DrawCurrentDungeonIndicator: ; mX DRHUD_DrawCurrentDungeonIndicator: ; mX
LDA.l DRMode : BIT.b #$02 : BEQ DRHUD_Finished LDA.l DRMode : BIT.b #$02 : BNE + : JMP DRHUD_Finished : +
LDY.w #!BlankTile LDY.w #!BlankTile
LDA.w CurrentHealth : BEQ .draw_indicator LDA.w CurrentHealth : BEQ .draw_indicator
LDA.b GameMode
CMP.b #$0E : BNE .get_indicator
LDA.b GameSubMode
CMP.b #$03 : BNE .get_indicator
LDA.w SubModuleInterface
CMP.b #$06 : BEQ .draw_indicator
.get_indicator
REP #$20 : LDA.l DungeonReminderTable,X : TAY REP #$20 : LDA.l DungeonReminderTable,X : TAY
SEP #$20 SEP #$20
.draw_indicator .draw_indicator

110
dungeon_map/blink_loot.asm Normal file
View File

@@ -0,0 +1,110 @@
; we want the icons indicating what is left in a room to blink
; but we don't want to redraw to BG1 every few frames
; so we duplicate the left side of BG1 to a lower portion and just toggle vertical scroll
BlinkLoot:
; do not show icons if we're scrolling
LDA.w $0210
BNE .hide
LDA.b FrameCounter
AND.b #$20
BEQ .show
.hide
LDA.b #$01
.show
STZ.b $E6
STA.w $E7
JSL $8AE96B
RTL
StartDoubleWrite:
; what we wrote over
LDA.l DRMode
BEQ .draw
LDA.l DungeonMapMode
BNE .draw
INC.w $020D ; next subsubmode
PLA : PLA : PLA ; pull our jump to here off the stack
PLB
RTL
.draw
REP #$30
STZ.w GFXStripes
STZ.w $021B
RTL
CheckDoubleWrite:
LDA.w $021C
BNE .done
LDA.b #$08
STA.w $021C
REP #$30
JML $8AE20B
.done
; what we wrote over
REP #$10
LDY.w GFXStripes
LDA.b #$FF
JML $8AE2E7
DrawMountain:
LDX.w GFXStripes
PHX
LDY.w #$0000
.next_word
LDA.w $8AEFEF, Y
STA.w GFXStripes+2, X
INX : INX
INY : INY
CPY.w #$002A
BCC .next_word
PLY
LDA.w $021B
BEQ .done
; if second copy of mountain, adjust VRAM addresses
SEP #$20
LDA.w GFXStripes+$02, Y
ORA.w $021C
STA.w GFXStripes+$02, Y
LDA.w GFXStripes+$08, Y
ORA.w $021C
STA.w GFXStripes+$08, Y
LDA.w GFXStripes+$10, Y
ORA.w $021C
STA.w GFXStripes+$10, Y
LDA.w GFXStripes+$20, Y
ORA.w $021C
STA.w GFXStripes+$20, Y
LDA.w GFXStripes+$26, Y
ORA.w $021C
STA.w GFXStripes+$26, Y
REP #$20
.done
RTL
WriteBigEndianAddressX:
ORA.w $021B
XBA
STA.w GFXStripes+2, X
AND.w #$FFF7
RTL
WriteBigEndianAddressY:
ORA.w $021B
XBA
STA.w GFXStripes+2, Y
AND.w #$FFF7
RTL

633
dungeon_map/check_loot.asm Normal file
View File

@@ -0,0 +1,633 @@
; A = room_id
; out A = level of loot
CheckLoot:
PHP
REP #$30
PHB : PHX : PHY
STA.b $CA
LDA.b $06 : PHA
LDA.b $0E : PHA
STZ.b $02 ; best item class found
LDA.l ShowItems_default
AND.w #$00FF
STA.b $0E
LDA.b $CA
AND.w #$00FF
ASL A
TAX
LDA.l SaveDataWRAM, X
AND.w #$000F
BEQ +
LDA.l ShowItems_visited_tile
AND.w #$00FF
CMP.b $0E
BCC +
STA.b $0E
+ LDA.w DungeonID
TAX
LDA.l MapField
AND.l DungeonMask, X
BEQ +
LDA.l ShowItems_have_map
AND.w #$00FF
CMP.b $0E
BCC +
STA.b $0E
+ LDA.l CompassField
AND.l DungeonMask, X
BEQ +
LDA.l ShowItems_have_compass
AND.w #$00FF
CMP.b $0E
BCC +
STA.b $0E
+
LDA.l ItemSources : BIT.w #$0001 : BEQ +
JSR CheckChests
+
LDA.l ItemSources : BIT.w #$0002 : BEQ +
JSR CheckPots
+
LDA.l ItemSources : BIT.w #$0004 : BEQ +
JSR CheckEnemies
+
LDA.l ItemSources : BIT.w #$0008 : BEQ +
JSR CheckBoss
+
LDA.l ItemSources : BIT.w #$0010 : BEQ +
JSR CheckPrize
+
.done
PLA : STA.b $0E
PLA : STA.b $06
PLY : PLX : PLB
PLP
LDA.b $02
RTL
CheckChests:
LDA.b $CA
AND.w #$00FF
STA.b $00
ASL A
TAX
LDA.w #($81<<8)
PHA
PLB : PLB
LDA.w #$0008
STA.b $04
STZ.b $06
LDY.w #$FFFD
.increment_mask
LDA.b $04
ASL A
STA.b $04
.next_chest
INY #3
CPY.w #$01F8
BCS .done
LDA.w RoomData_ChestItems, Y
AND.w #$7FFF
CMP.b $00
BNE .next_chest
LDA.b $06
JSR CheckChestSection
INC.b $06
BCC .increment_mask
LDA.l SaveDataWRAM, X
AND.b $04
BNE .increment_mask ; already got item
LDA.w RoomData_ChestItems+2, Y
AND.w #$00FF
JSR GetLootClass
BRA .increment_mask
.done
RTS
CheckBoss:
; we assume all bosses are in section 1 of split sections
; mainly to simplify hera cage key and GT torch
; which use the same flow
; and bosses are always in their own section anyway
LDA.b $CA
AND.w #$F000
XBA
CMP.w #$0020
BCC +
RTS
+
LDA.b $CA
AND.w #$00FF
STA.b $04
LDX.w #$FFFA
.next_boss
INX #6
LDA.l MiscLocations, X
BPL .check
RTS
.check
CMP.b $04
BNE .next_boss
TXY
CMP.b RoomIndex
BEQ .current_room
ASL A
TAX
LDA.l SaveDataWRAM, X
BRA .continue
.current_room
LDA.w RoomItemsTaken ; if checking our current room, $0403 has fresher flags
ASL #4
.continue
STA.b $04
TYX
LDA.l MiscLocations+2, X ; get bit of room data to check
AND.w #$00FF
ASL A
TAX
LDA.l DungeonMask, X
TYX
BIT.b $04
BNE .next_boss ; continue checking if we already got the item
LDA.l MiscLocations+4, X
STA.b $05
LDA.l MiscLocations+3, X
STA.b $04
LDA.b [$04]
AND.w #$00FF
JSR GetLootClass
BRA .next_boss
CheckPrize:
LDA.b $CA
AND.w #$00FF
STA.b $04
LDX.w #$FFFD
.next_prize
INX #3
LDA.l PrizeLocations, X
BPL .check
RTS
.check
CMP.b $04
BNE .next_prize
TXY
ASL A
TAX
LDA.l SaveDataWRAM, X
TYX
BIT.w #$0800
BNE .next_prize
LDA.l PrizeLocations+2, X ; get which prize to look at
AND.w #$00FF
TAX
LDA.l DungeonPrizeReceiptID, X
TYX
AND.w #$00FF
JSR GetLootClass
BRA .next_prize
CheckPots:
LDA.b $CA
AND.w #$00FF
ASL A
TAX
LDA.l UWPotsPointers, X
STA.b $04
LDA.w #bank(UWPotsData)
STA.b $06
LDY.w #$0000
LDX.w #$FFFF
.next_pot
LDA.b [$04], Y
CMP.w #$FFFF : BEQ .done
INX : INY : INY
BIT.w #$8000 : BNE .major_item ; marked as major item
LDA.b [$04], Y
AND.w #$00FF
CMP.w #$0008 : BEQ .small_key
LDA.l PotCountMode
BEQ +
JSR CheckJunkPot
+
INY
BRA .next_pot
.small_key
LDA.w #$8000 : STA.b $08
LDA.w #$0024
PHA
PHX
INY
BRA .mask_set
.major_item
LDA.b [$04], Y
PHA
PHX
INY
TXA : ASL A
TAX
LDA.l DungeonMask, X : STA.b $08
TXA : LSR A : TAX
.mask_set
TXA
JSR CheckPotSection
BCS +
PLX
PLA
BRA .next_pot
+
LDA.b $CA
AND.w #$00FF
ASL A
TAX
if !FEATURE_FIX_BASEROM
LDA.l SpriteDropData, X
else
LDA.l RoomPotData, X
endif
PLX
AND.b $08
BEQ .not_obtained
PLA
BRA .next_pot
.not_obtained
PLA
AND.w #$00FF
JSR GetLootClass
BRA .next_pot
.done
RTS
CheckJunkPot:
LDA.b [$04], Y
PHA
PHX
TXA : ASL A : TAX
LDA.l DungeonMask, X : STA.b $08
TXA : LSR A
JSR CheckPotSection
BCS +
PLX
PLA
RTS
+
LDA.b $CA
AND.w #$00FF
ASL A
TAX
LDA.l PotCollectionRateTable, X
AND.b $08
BEQ .not_important
if !FEATURE_FIX_BASEROM
LDA.l SpriteDropData, X
else
LDA.l RoomPotData, X
endif
AND.b $08
BNE .not_important
PLX
PLA
AND.w #$00FF
JSR GetPotJunkClass
RTS
.not_important
PLX
PLA
RTS
CheckEnemies:
LDA.b $CA
AND.w #$00FF
ASL A
TAX
LDA.l UWSpritesPointers, X
INC A ; skip the layered/unlayered indicator
STA.b $04
LDA.w #bank(UWSpritesData)
STA.b $06
LDY.w #$0000
LDX.w #$FFFF
.next_enemy
LDA.b [$04], Y
AND.w #$00FF
CMP.w #$00FF
BNE +
JMP .done
+
LDA.b [$04], Y
AND.w #$E000
CMP.w #$E000
BEQ .overlord
INY : INY
LDA.b [$04], Y
AND.w #$00FF
CMP.w #$00F8 : BEQ .major ; major item
CMP.w #$00F9 : BEQ .major ; major item in other world
CMP.w #$00E4 : BEQ .vanilla_key
INY
INX
BRA .next_enemy
.overlord
INY : INY : INY
BRA .next_enemy
.vanilla_key
DEY : DEY
LDA.w #$8000 : STA.b $08
LDA.b [$04], Y
INY #3
AND.w #$00FF
CMP.w #$00FD ; big key
BEQ .big_key
CMP.w #$00FE ; small key
BEQ .small_key
; false alarm -- probably hera basement key
INX ; since it's an actual sprite it advances the counter
BRA .next_enemy
.small_key
LDA.w #$0024
PHA : PHX
BRA .mask_set
.big_key
LDA.w #$0032
PHA : PHX
BRA .mask_set
.major
DEY : DEY
LDA.b [$04], Y
AND.w #$00FF
.proceed
INY : INY : INY
PHA
PHX
TXA : ASL A
TAX
LDA.l DungeonMask, X : STA.b $08
TXA : LSR A : TAX
.mask_set
TXA
JSR CheckEnemySection
BCS +
PLX
PLA
JMP .next_enemy
+
LDA.b $CA
AND.w #$00FF
ASL A
TAX
LDA.l SpriteDropData, X
PLX
AND.b $08
BEQ .not_obtained
PLA
JMP .next_enemy
.not_obtained
PLA
AND.w #$00FF
JSR GetLootClass
JMP .next_enemy
.done
RTS
; A = item id
; updates "best loot" value if better
GetLootClass:
PHX
TAX
CMP.w #$0025 : BEQ .compass
AND.w #$00F0
CMP.w #$0080 : BNE .not_compass
.compass
LDA.l AlwaysShowCompass : BNE .check_value
.not_compass
LDA.b $0E
BEQ .done
CMP.w #$0001
BEQ .value_set
.check_value
LDA.l LootTypeMapping, X
AND.w #$00FF
.value_set
CMP.b $02
BCC .done
STA.b $02
.done
PLX
RTS
; A = item id
; updates "best loot" value if better
GetPotJunkClass:
PHX
TAX
LDA.b $0E
BEQ .done
CMP.w #$0001
BEQ .value_set
; hardcode as junk for now
LDA.w #$0002
.value_set
CMP.b $02
BCC .done
STA.b $02
.done
PLX
RTS
macro DefineGetFooSection(type, offset)
Get<type>Section:
PHX
LDA.b $CA
AND.w #$00FF
ASL A
TAX
LDA.l SplitRooms, X
TAX
LDA.l SplitRooms, X
AND.w #$00FF
STA.b $CE
BEQ .found
INX
.check_next_section
PHX
LDA.l SplitRooms+<offset>, X
TAX
-
LDA.l SplitRooms, X
AND.w #$00FF
CMP.w #$00FF
BEQ .not_this_section
CMP.b $CC
BEQ .plx_found
INX
BRA -
.not_this_section
PLX
TXA : CLC : ADC.w #$000D : TAX
DEC.b $CE
BNE .check_next_section
BRA .found
.plx_found
PLX
.found
PLX
LDA.b $CE
RTS
endmacro
macro DefineCheckFooSection(type)
Check<type>Section:
STA.b $CC
LDA.b $CB
AND.w #$00FF
BEQ .yes
JSR Get<type>Section
LDA.b $CB
AND.w #$00FF
LSR A : LSR A : LSR A : LSR A
DEC A
CMP.b $CE
BEQ .yes
.no
CLC
RTS
.yes
SEC
RTS
endmacro
%DefineGetFooSection(Door, 3)
%DefineGetFooSection(Stair, 5)
%DefineGetFooSection(Chest, 7)
%DefineGetFooSection(Pot, 9)
%DefineGetFooSection(Enemy, 11)
%DefineCheckFooSection(Door)
%DefineCheckFooSection(Stair)
%DefineCheckFooSection(Chest)
%DefineCheckFooSection(Pot)
%DefineCheckFooSection(Enemy)
GetIncomingStairSection:
PHX
AND.w #$0300
XBA
ASL A
TAX
LDA.l $8098D8, X
STA.b $CC
LDA.b $CA
AND.w #$00FF
ASL A
TAX
LDA.l SplitRooms, X
TAX
LDA.l SplitRooms, X
AND.w #$00FF
STA.b $CE
BEQ .found
INX
.check_next_section
LDA.l SplitRooms+0, X
AND.w #$00FF
AND.b $CC
BNE .found
TXA : CLC : ADC.w #$000D : TAX
DEC.b $CE
BNE .check_next_section
BRA .found
.found
PLX
LDA.b $CE
RTS

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,39 @@
File.open("supertile_shapes.asm", "r") do |file|
bytes = []
while line = file.gets
m = line.match(/dw \$(\h+), \$(\h+), \$(\h+), \$(\h+)/)
bytes += m.captures if m
break if bytes.length >= 4 * 0xE0
end
counts = []
for byte in bytes do
value = byte.to_i(16)
next if value == 0xFFFF
value = (value & 0x03FF) - 0x340
if not counts[value]
counts[value] = 0
end
counts[value] += 1
end
print(" ")
for col in 0...16
printf(" x%X", col)
end
puts
for row in 0...0xC
printf("%Xx", row + 4)
for col in 0...16
printf("%4d", counts[row * 16 + col] || 0)
end
puts
end
printf("Unused:")
for i in 0...0x80
printf(" %2X", i) unless counts[i]
end
puts
end

View File

@@ -0,0 +1,43 @@
DoorConnectionTiles:
.vertical
dw $0000, $0000 ; $00
dw $01C0, $0000 ; $01 left -> left
dw $01D0, $01D1 ; $02 left -> middle
dw $81C3, $41C3 ; $03 left -> right
dw $81D0, $81D1 ; $04 middle -> left
dw $01C1, $41C1 ; $05 middle -> middle
dw $C1D1, $C1D0 ; $06 middle -> right
dw $01C3, $C1C3 ; $07 right -> left
dw $41D1, $41D0 ; $08 right -> middle
dw $0000, $01C0 ; $09 right -> right
dw $41C2, $41C1 ; $0A left-middle -> left-middle
dw $81D2, $C1D0 ; $0B left-middle -> left-right
dw $41D3, $81D3 ; $0C left-middle -> middle-right
dw $01D2, $41D0 ; $0D left-right -> left-middle
dw $01C0, $01C0 ; $0E left-right -> left-right
dw $01D0, $41D2 ; $0F left-right -> middle-right
dw $C1D3, $01D3 ; $10 middle-right -> left-middle
dw $81D0, $C1D2 ; $11 middle-right -> left-right
dw $01C1, $01C2 ; $12 middle-right -> middle-right
dw $41C2, $01C2 ; $13 triple -> triple
.horizontal
dw $0300, $0300 ; $00
dw $01C4, $0300 ; $01 top -> top
dw $C1D4, $C1D5 ; $02 top -> middle
dw $81C7, $41C7 ; $03 top -> bottom
dw $81D4, $81D5 ; $04 middle -> top
dw $01C5, $81C5 ; $05 middle -> middle
dw $01D5, $01D4 ; $06 middle -> bottom
dw $C1C7, $01C7 ; $07 bottom -> top
dw $41D5, $41D4 ; $08 bottom -> middle
dw $0300, $01C4 ; $09 bottom -> bottom
dw $41C6, $41C5 ; $0A top-middle -> top-middle
dw $41D6, $01D4 ; $0B top-middle -> top-bottom
dw $41D7, $81D7 ; $0C top-middle -> middle-bottom
dw $01D6, $41D4 ; $0D top-bottom -> top-middle
dw $01C4, $01C4 ; $0E top-bottom -> top-bottom
dw $C1D4, $81D6 ; $0F top-bottom -> middle-bottom
dw $C1D7, $01D7 ; $10 middle-bottom -> top-middle
dw $81D4, $C1D6 ; $11 middle-bottom -> top-bottom
dw $01C5, $01C6 ; $12 middle-bottom -> middle-bottom
dw $81C6, $01C6 ; $13 triple -> triple

View File

@@ -0,0 +1,309 @@
DoorSlotsSprites:
; center
dw $48A8
; north
dw $2090, $20A8, $20C0
dw $2098, $20B8
; west
dw $3080, $4880, $6080
dw $3880, $5880
; south
dw $7090, $70A8, $70C0
dw $7098, $70B8
; east
dw $30D0, $48D0, $60D0
dw $38D0, $58D0
; stairs
dw $B080, $B098, $B0B0
; drop/warp
dw $B0D0
DoorSlotsBG1:
; center
dw $1135
; north
dw $1092, $1095, $1098
dw $1093, $1097
; west
dw $10D0, $1130, $1190
dw $10F0, $1170
; south
dw $11D2, $11D5, $11D8
dw $11D3, $11D7
; east
dw $10DA, $113A, $119A
dw $10FA, $117A
; stairs
dw $12D0, $12D3, $12D6
; drop/warp
dw $12DA
DoorSlotsBG2:
; center
dw $0000
; north
dw $FEBA, $FEC0, $FEC6
dw $FEBC, $FEC4
; west
dw $FF36, $FFF6, $00B6
dw $FF76, $0076
; south
dw $013A, $0140, $0146
dw $013C, $0144
; east
dw $FF4A, $000A, $00CA
dw $FF8A, $008A
; stairs
dw $0336, $033C, $0342
; drop/warp
dw $034A
DoorSlotSides:
db $02, $0C, $16, $20
DoorSlotOffsets:
db $02, $02, $06, $00
; up, left, down, right
NextCursorSlot:
db $80, $81, $82, $83
; top
db $FF, $C1, $00, $04
db $FF, $04, $00, $05
db $FF, $05, $00, $C3
db $FF, $01, $00, $02
db $FF, $02, $00, $03
; left
db $C0, $FF, $09, $00
db $09, $FF, $0A, $00
db $0A, $FF, $C2, $00
db $06, $FF, $07, $00
db $07, $FF, $08, $00
; bottom
db $00, $E1, $85, $0E
db $00, $0E, $85, $0F
db $00, $0F, $85, $E3
db $00, $0B, $85, $0C
db $00, $0C, $85, $0D
; right
db $E0, $00, $13, $FF
db $13, $00, $14, $FF
db $14, $00, $E2, $FF
db $10, $00, $11, $FF
db $11, $00, $12, $FF
; stairs
db $84, $18, $FF, $16
db $84, $15, $FF, $17
db $84, $16, $FF, $18
; drop/warp
db $84, $17, $FF, $15
NextCursorSpecial:
.center
db $02, $04, $05, $01, $03, $FF
db $07, $09, $0A, $06, $08, $FF
db $0C, $0E, $0F, $0B, $0D, $15, $16, $17, $18, $FF
db $11, $13, $14, $10, $12, $FF
db $0C, $0E, $0F, $0B, $0D, $00, $FF
db $17, $16, $15, $18, $FF
.center_offset
db $00, $06, $0C, $16, $1C, $23
.start_index
db $01, $06, $0B, $10, $15
.start_direction
db $03, $02, $03, $02, $03
.end_index
db $03, $08, $0D, $12, $18
.end_direction
db $01, $00, $01, $00, $01
SingleEdgeCurrentRoomConnectors:
.north
dw $01C0, $0300, $01C0, $0300, $01C0, $0300 ; left -> left
dw $01C1, $41C1, $81D0, $81D1, $01C0, $0300 ; left -> middle
dw $41D1, $41D0, $01C1, $41C1, $81D0, $81D1 ; left -> right
dw $01C0, $0300, $01D0, $01D1, $01C1, $41C1 ; middle -> left
dw $01C1, $41C1, $01C1, $41C1, $01C1, $41C1 ; middle -> middle
dw $0300, $01C0, $41D1, $41D0, $01C1, $41C1 ; middle -> right
dw $01D0, $01D1, $01C1, $41C1, $C1D1, $C1D0 ; right -> left
dw $01C1, $41C1, $C1D1, $C1D0, $0300, $01C0 ; right -> middle
dw $0300, $01C0, $0300, $01C0, $0300, $01C0 ; right -> right
.west
dw $01C4, $01C4, $01C4, $0300, $0300, $0300 ; top -> top
dw $01C5, $81D4, $01C4, $C1C5, $81D5, $0300 ; top -> middle
dw $41D5, $01C5, $81D4, $41D4, $C1C5, $81D5 ; top -> bottom
dw $01C4, $C1D4, $01C5, $0300, $C1D5, $C1C5 ; middle -> top
dw $01C5, $01C5, $01C5, $C1C5, $C1C5, $C1C5 ; middle -> middle
dw $0300, $41D5, $01C5, $01C4, $41D4, $C1C5 ; middle -> bottom
dw $C1D4, $01C5, $01D5, $C1D5, $C1C5, $01D4 ; bottom -> top
dw $01C5, $01D5, $0300, $C1C5, $01D4, $01C4 ; bottom -> middle
dw $0300, $0300, $0300, $01C4, $01C4, $01C4 ; bottom -> bottom
.south
dw $01C0, $0300, $01C0, $0300, $01C0, $0300 ; left -> left
dw $01C0, $0300, $01D0, $01D1, $01C1, $41C1 ; left -> middle
dw $01D0, $01D1, $01C1, $41C1, $C1D1, $C1D0 ; left -> right
dw $01C1, $41C1, $81D0, $81D1, $01C0, $0300 ; middle -> left
dw $01C1, $41C1, $01C1, $41C1, $01C1, $41C1 ; middle -> middle
dw $01C1, $41C1, $C1D1, $C1D0, $0300, $01C0 ; middle -> right
dw $41D1, $41D0, $01C1, $41C1, $81D0, $81D1 ; right -> left
dw $0300, $01C0, $41D1, $41D0, $01C1, $41C1 ; right -> middle
dw $0300, $01C0, $0300, $01C0, $0300, $01C0 ; right -> right
.east
dw $01C4, $01C4, $01C4, $0300, $0300, $0300 ; top -> top
dw $01C4, $C1D4, $01C5, $0300, $C1D5, $81C5 ; top -> middle
dw $C1D4, $01C5, $01D5, $C1D5, $81C5, $01D4 ; top -> bottom
dw $01C5, $81D4, $01C4, $81C5, $81D5, $0300 ; middle -> top
dw $01C5, $01C5, $01C5, $81C5, $81C5, $81C5 ; middle -> middle
dw $01C5, $01D5, $0300, $81C5, $01D4, $01C4 ; middle -> bottom
dw $41D5, $01C5, $81D4, $41D4, $81C5, $81D5 ; bottom -> top
dw $0300, $41D5, $01C5, $01C4, $41D4, $81C5 ; bottom -> middle
dw $0300, $0300, $0300, $01C4, $01C4, $01C4 ; bottom -> bottom
QuadrantMasks:
; north
dw $0008, $000C, $0004
; west
dw $0008, $000A, $0002
; south
dw $0002, $0003, $0001
; east
dw $0004, $0005, $0001
EntranceQuadrantMasks:
dw $0002
dw $0003
dw $0001
DropdownQuadrantMasks:
dw $0008
dw $000C
dw $0004
MultiConnectorMapping:
.two
db $02, $00
.three
db $02, $01, $00
MultiConnectorTiles:
.north
..two
dw $41C7, $81C7, $C1C7, $01C7
..three
dw $41C7, $01C4, $81F7, $C1F7, $01C4, $01C7
.west
..two
dw $81C7, $41C7, $C1C7, $01C7
..three
dw $81C7, $01C0, $41E7, $C1E7, $01C0, $01C7
.south
..two
dw $C1C7, $01C7, $41C7, $81C7
..three
dw $C1C7, $01C4, $01F7, $41F7, $01C4, $81C7
.east
..two
dw $C1C7, $01C7, $81C7, $41C7
..three
dw $C1C7, $01C0, $01E7, $81E7, $01C0, $41C7
.direction_index
db $00, $14, $28, $3C
.start_offset
..two
dw $FF7E, $FFBC, $00BE, $FFC6
..three
dw $FF7C, $FF7C, $00BC, $FF86
.increment
db $02, $40
EdgePositions:
.north
db $01, $00 ; HC Basement
db $02 ; Desert West Wing
db $00, $01, $02 ; Desert Lobby
db $00 ; Desert East Wing
db $01, $02 ; TT
db $00, $01 ; different TT
.west
db $02 ; TT Attic
db $02, $02 ; Desert North Hall
db $00, $02 ; HC Basement
db $00 ; Desert East Wing
db $02, $00 ; TT Triple
db $02 ; TT Big Key Chest
.south
db $01, $00 ; HC Basement
db $02 ; Desert West Wing
db $00, $01, $02 ; Desert Lobby
db $00 ; Desert East Wing
db $01, $02 ; TT
db $00, $01 ; different TT
.east
db $02 ; TT Attic
db $02, $02 ; Desert North Hall
db $02, $00 ; HC Basement
db $00 ; Desert East Wing
db $02, $00 ; TT Triple
db $02 ; TT Big Key Chest
EdgeConnectionIndices:
; North
dw $0182, $0000
dw $0082, $0003
dw $0283, $0006
dw $0084, $0009
dw $0184, $000C
dw $0284, $000F
dw $0085, $0012
dw $01DB, $0015
dw $02DB, $0018
dw $00DC, $001B
dw $01DC, $001E
; South
dw $0772, $0021
dw $0672, $0024
dw $0873, $0027
dw $0674, $002A
dw $0774, $002D
dw $0874, $0030
dw $0675, $0033
dw $07CB, $0036
dw $08CB, $0039
dw $06CC, $003C
dw $07CC, $003F
; West
dw $0565, $0042
dw $0574, $0045
dw $0575, $0048
dw $0582, $004B
dw $0382, $004E
dw $0385, $0051
dw $05CC, $0054
dw $03CC, $0057
dw $05DC, $005A
; East
dw $0B64, $005D
dw $0B73, $0060
dw $0B74, $0063
dw $0981, $0066
dw $0B81, $0069
dw $0984, $006C
dw $0BCB, $006F
dw $09CB, $0072
dw $0BDB, $0075
dw $FFFF
InRoomConnectionIndices:
dw $020B, $0000
dw $081B, $0002
dw $023F, $0004
dw $081F, $0006
dw $007E, $0008
dw $065E, $000A
dw $0296, $000C
dw $083D, $000E
dw $FFFF

View File

@@ -0,0 +1,26 @@
dw $200C
dw $100E
dw $2012
dw $1023
dw $1024
dw $2028
dw $204A
dw $4056
dw $4057
dw $4058
dw $4059
dw $1060
dw $2061
dw $4062
dw $4063
dw $2077
dw $4083
dw $2084
dw $1085
dw $4098
dw $20C9
dw $40D5
dw $10D6
dw $20DB
dw $40E0
dw $FFFF

View File

@@ -0,0 +1,38 @@
FallTable:
dw $1007, $1017 ; Moldorm Arena
dw $1017, $1027 ; Below Moldorm drop to Big Chest
dw $101E, $103E ; IP first drop
dw $1027, $1031 ; ToH Big Chest drop
dw $1031, $1077 ; Second Floor ToH
dw $1039, $1029 ; Mothula drop
dw $103A, $100A ; Pod front drop
dw $103D, $1096 ; GT Torches drop
dw $104D, $10A6 ; Moldorm 2 drop
dw $1054, $1034 ; Left side Swamp
dw $105E, $107E ; IP drop to tall icy room
dw $107E, $109E ; Freezors drop (to big chest)
dw $208C, $101C ; Ice Armos drop
dw $1097, $10D1 ; Mire Cutscene
dw $109E, $10BE ; IP Big Chest tile (push blocks)
dw $10CE, $10DE ; Kholdstare drop
; db $65, $AC ; TT Attic
; db $77, $A7 ; ToH drop to fairy room (Herapot)
; db $A9, $89 ; EP drop to fairy room
; db $BE, $4F ; IP drop to fairy room
dw $FFFF
WarpTable:
dw $2009, $104B ; PoD Basement (start)
dw $100A, $1009 ; PoD Stalfos Basement
dw $100B, $206A ; PoD Turtle Room to Boss
dw $104B, $2009 ; PoD Basement (mimics)
dw $207B, $209D ; GT post-compass island hardhat
dw $207D, $109B ; GT warp maze
dw $109D, $307B ; GT compass room
dw $109B, $207D ; GT warp maze
dw $10B1, $20B2 ; South of Fishbone warp
dw $10D1, $10B1 ; Mire Big Key Chest warp
; db $89, $A9 ; EP Fairy Room
; db $A7, $17 ; ToH Fairy Room
; db $4F, $BE ; IP Fairy Room
dw $FFFF

View File

@@ -0,0 +1,276 @@
!TIER_UNKNOWN = $01
!TIER_JUNK = $02
!TIER_LOW_KEY = $03
!TIER_HEALTH = $05
!TIER_MINOR = $06
!TIER_MAP = $07
!TIER_COMPASS = $08
!TIER_SM_KEY = $09
!TIER_BIG_KEY = $0A
!TIER_MAJOR = $0B
!TIER_PENDANT = $0C
!TIER_CRYSTAL = $0D
!TIER_TFP = $0E
!TIER_TFORCE = $0F
db !TIER_MAJOR ; 00 - Fighter Sword and Shield
db !TIER_MAJOR ; 01 - Master Sword
db !TIER_MAJOR ; 02 - Tempered Sword
db !TIER_MAJOR ; 03 - Butter Sword
db !TIER_JUNK ; 04 - Fighter Shield
db !TIER_MINOR ; 05 - Fire Shield
db !TIER_MINOR ; 06 - Mirror Shield
db !TIER_MAJOR ; 07 - Fire Rod
db !TIER_MAJOR ; 08 - Ice Rod
db !TIER_MAJOR ; 09 - Hammer
db !TIER_MAJOR ; 0A - Hookshot
db !TIER_MAJOR ; 0B - Bow
db !TIER_MINOR ; 0C - Boomerang
db !TIER_MINOR ; 0D - Powder
db !TIER_JUNK ; 0E - Bottle Refill (bee)
db !TIER_MAJOR ; 0F - Bombos
db !TIER_MAJOR ; 10 - Ether
db !TIER_MAJOR ; 11 - Quake
db !TIER_MAJOR ; 12 - Lamp
db !TIER_MINOR ; 13 - Shovel
db !TIER_MAJOR ; 14 - Flute
db !TIER_MAJOR ; 15 - Somaria
db !TIER_MINOR ; 16 - Bottle
db !TIER_HEALTH ; 17 - Heartpiece
db !TIER_MINOR ; 18 - Byrna
db !TIER_MINOR ; 19 - Cape
db !TIER_MAJOR ; 1A - Mirror
db !TIER_MAJOR ; 1B - Glove
db !TIER_MAJOR ; 1C - Mitts
db !TIER_MAJOR ; 1D - Book
db !TIER_MAJOR ; 1E - Flippers
db !TIER_MAJOR ; 1F - Pearl
db !TIER_CRYSTAL ; 20 - Crystal
db !TIER_MINOR ; 21 - Net
db !TIER_MINOR ; 22 - Blue Mail
db !TIER_MINOR ; 23 - Red Mail
db !TIER_LOW_KEY ; 24 - Small Key
db !TIER_COMPASS ; 25 - Compass
db !TIER_HEALTH ; 26 - Heart Container from 4/4
db !TIER_JUNK ; 27 - Bomb
db !TIER_JUNK ; 28 - 3 bombs
db !TIER_MINOR ; 29 - Mushroom
db !TIER_MINOR ; 2A - Red boomerang
db !TIER_MINOR ; 2B - Full bottle (red)
db !TIER_MINOR ; 2C - Full bottle (green)
db !TIER_MINOR ; 2D - Full bottle (blue)
db !TIER_HEALTH ; 2E - Potion refill (red)
db !TIER_HEALTH ; 2F - Potion refill (green)
db !TIER_HEALTH ; 30 - Potion refill (blue)
db !TIER_JUNK ; 31 - 10 bombs
db !TIER_BIG_KEY ; 32 - Big key
db !TIER_MAP ; 33 - Map
db !TIER_JUNK ; 34 - 1 rupee
db !TIER_JUNK ; 35 - 5 rupees
db !TIER_JUNK ; 36 - 20 rupees
db !TIER_PENDANT ; 37 - Green pendant
db !TIER_PENDANT ; 38 - Blue pendant
db !TIER_PENDANT ; 39 - Red pendant
db !TIER_MAJOR ; 3A - Tossed bow
db !TIER_MAJOR ; 3B - Silvers
db !TIER_MINOR ; 3C - Full bottle (bee)
db !TIER_MINOR ; 3D - Full bottle (fairy)
db !TIER_HEALTH ; 3E - Boss heart
db !TIER_HEALTH ; 3F - Sanc heart
db !TIER_JUNK ; 40 - 100 rupees
db !TIER_JUNK ; 41 - 50 rupees
db !TIER_JUNK ; 42 - Heart
db !TIER_JUNK ; 43 - Arrow
db !TIER_JUNK ; 44 - 10 arrows
db !TIER_JUNK ; 45 - Small magic
db !TIER_JUNK ; 46 - 300 rupees
db !TIER_JUNK ; 47 - 20 rupees green
db !TIER_MINOR ; 48 - Full bottle (good bee)
db !TIER_MAJOR ; 49 - Tossed fighter sword
db !TIER_MAJOR ; 4A - Active Flute
db !TIER_MAJOR ; 4B - Boots
db !TIER_MINOR ; 4C - Bomb capacity (50)
db !TIER_MINOR ; 4D - Arrow capacity (70)
db !TIER_MINOR ; 4E - 1/2 magic
db !TIER_MINOR ; 4F - 1/4 magic
db !TIER_MAJOR ; 50 - Safe master sword
db !TIER_MINOR ; 51 - Bomb capacity (+5)
db !TIER_MINOR ; 52 - Bomb capacity (+10)
db !TIER_MINOR ; 53 - Arrow capacity (+5)
db !TIER_MINOR ; 54 - Arrow capacity (+10)
db !TIER_JUNK ; 55 - Programmable item 1
db !TIER_JUNK ; 56 - Programmable item 2
db !TIER_JUNK ; 57 - Programmable item 3
db !TIER_MAJOR ; 58 - Upgrade-only silver arrows
db !TIER_JUNK ; 59 - Rupoor
db !TIER_JUNK ; 5A - Nothing
db !TIER_JUNK ; 5B - Red clock
db !TIER_JUNK ; 5C - Blue clock
db !TIER_JUNK ; 5D - Green clock
db !TIER_MAJOR ; 5E - Progressive sword
db !TIER_MINOR ; 5F - Progressive shield
db !TIER_MINOR ; 60 - Progressive armor
db !TIER_MAJOR ; 61 - Progressive glove
db !TIER_JUNK ; 62 - RNG pool item (single)
db !TIER_JUNK ; 63 - RNG pool item (multi)
db !TIER_MAJOR ; 64 - Progressive bow
db !TIER_MAJOR ; 65 - Progressive bow
db !TIER_JUNK ; 66 -
db !TIER_JUNK ; 67 -
db !TIER_JUNK ; 68 -
db !TIER_JUNK ; 69 -
db !TIER_TFORCE ; 6A - Triforce
db !TIER_TFP ; 6B - Power star
db !TIER_TFP ; 6C - Triforce Piece
db !TIER_JUNK ; 6D - Server request item
db !TIER_JUNK ; 6E - Server request item (dungeon drop)
db !TIER_JUNK ; 6F -
db !TIER_MAP ; 70 - Map of Light World
db !TIER_MAP ; 71 - Map of Dark World
db !TIER_MAP ; 72 - Map of Ganon's Tower
db !TIER_MAP ; 73 - Map of Turtle Rock
db !TIER_MAP ; 74 - Map of Thieves' Town
db !TIER_MAP ; 75 - Map of Tower of Hera
db !TIER_MAP ; 76 - Map of Ice Palace
db !TIER_MAP ; 77 - Map of Skull Woods
db !TIER_MAP ; 78 - Map of Misery Mire
db !TIER_MAP ; 79 - Map of Dark Palace
db !TIER_MAP ; 7A - Map of Swamp Palace
db !TIER_MAP ; 7B - Map of Agahnim's Tower
db !TIER_MAP ; 7C - Map of Desert Palace
db !TIER_MAP ; 7D - Map of Eastern Palace
db !TIER_MAP ; 7E - Map of Hyrule Castle
db !TIER_MAP ; 7F - Map of Sewers
db !TIER_COMPASS ; 80 - Compass of Light World
db !TIER_COMPASS ; 81 - Compass of Dark World
db !TIER_COMPASS ; 82 - Compass of Ganon's Tower
db !TIER_COMPASS ; 83 - Compass of Turtle Rock
db !TIER_COMPASS ; 84 - Compass of Thieves' Town
db !TIER_COMPASS ; 85 - Compass of Tower of Hera
db !TIER_COMPASS ; 86 - Compass of Ice Palace
db !TIER_COMPASS ; 87 - Compass of Skull Woods
db !TIER_COMPASS ; 88 - Compass of Misery Mire
db !TIER_COMPASS ; 89 - Compass of Dark Palace
db !TIER_COMPASS ; 8A - Compass of Swamp Palace
db !TIER_COMPASS ; 8B - Compass of Agahnim's Tower
db !TIER_COMPASS ; 8C - Compass of Desert Palace
db !TIER_COMPASS ; 8D - Compass of Eastern Palace
db !TIER_COMPASS ; 8E - Compass of Hyrule Castle
db !TIER_COMPASS ; 8F - Compass of Sewers
db !TIER_BIG_KEY ; 90 - Skull key
db !TIER_BIG_KEY ; 91 - Reserved
db !TIER_BIG_KEY ; 92 - Big key of Ganon's Tower
db !TIER_BIG_KEY ; 93 - Big key of Turtle Rock
db !TIER_BIG_KEY ; 94 - Big key of Thieves' Town
db !TIER_BIG_KEY ; 95 - Big key of Tower of Hera
db !TIER_BIG_KEY ; 96 - Big key of Ice Palace
db !TIER_BIG_KEY ; 97 - Big key of Skull Woods
db !TIER_BIG_KEY ; 98 - Big key of Misery Mire
db !TIER_BIG_KEY ; 99 - Big key of Dark Palace
db !TIER_BIG_KEY ; 9A - Big key of Swamp Palace
db !TIER_BIG_KEY ; 9B - Big key of Agahnim's Tower
db !TIER_BIG_KEY ; 9C - Big key of Desert Palace
db !TIER_BIG_KEY ; 9D - Big key of Eastern Palace
db !TIER_BIG_KEY ; 9E - Big key of Hyrule Castle
db !TIER_BIG_KEY ; 9F - Big key of Sewers
db !TIER_SM_KEY ; A0 - Small key of Sewers
db !TIER_SM_KEY ; A1 - Small key of Hyrule Castle
db !TIER_SM_KEY ; A2 - Small key of Eastern Palace
db !TIER_SM_KEY ; A3 - Small key of Desert Palace
db !TIER_SM_KEY ; A4 - Small key of Agahnim's Tower
db !TIER_SM_KEY ; A5 - Small key of Swamp Palace
db !TIER_SM_KEY ; A6 - Small key of Dark Palace
db !TIER_SM_KEY ; A7 - Small key of Misery Mire
db !TIER_SM_KEY ; A8 - Small key of Skull Woods
db !TIER_SM_KEY ; A9 - Small key of Ice Palace
db !TIER_SM_KEY ; AA - Small key of Tower of Hera
db !TIER_SM_KEY ; AB - Small key of Thieves' Town
db !TIER_SM_KEY ; AC - Small key of Turtle Rock
db !TIER_SM_KEY ; AD - Small key of Ganon's Tower
db !TIER_JUNK ; AE - Reserved
db !TIER_LOW_KEY ; AF - Generic small key
db !TIER_CRYSTAL ; B0 - Crystal 6
db !TIER_CRYSTAL ; B1 - Crystal 1
db !TIER_CRYSTAL ; B2 - Crystal 5
db !TIER_CRYSTAL ; B3 - Crystal 7
db !TIER_CRYSTAL ; B4 - Crystal 2
db !TIER_CRYSTAL ; B5 - Crystal 4
db !TIER_CRYSTAL ; B6 - Crystal 3
db !TIER_JUNK ; B7 - Reserved
db !TIER_JUNK ; B8 -
db !TIER_JUNK ; B9 -
db !TIER_JUNK ; BA -
db !TIER_JUNK ; BB -
db !TIER_JUNK ; BC -
db !TIER_JUNK ; BD -
db !TIER_JUNK ; BE -
db !TIER_JUNK ; BF -
db !TIER_JUNK ; C0 -
db !TIER_JUNK ; C1 -
db !TIER_JUNK ; C2 -
db !TIER_JUNK ; C3 -
db !TIER_JUNK ; C4 -
db !TIER_JUNK ; C5 -
db !TIER_JUNK ; C6 -
db !TIER_JUNK ; C7 -
db !TIER_JUNK ; C8 -
db !TIER_JUNK ; C9 -
db !TIER_JUNK ; CA -
db !TIER_JUNK ; CB -
db !TIER_JUNK ; CC -
db !TIER_JUNK ; CD -
db !TIER_JUNK ; CE -
db !TIER_JUNK ; CF -
db !TIER_JUNK ; D0 - Bee trap
db !TIER_JUNK ; D1 - Apples
db !TIER_JUNK ; D2 - Fairy
db !TIER_JUNK ; D3 - Chicken
db !TIER_JUNK ; D4 - Big Magic
db !TIER_JUNK ; D5 - 5 Arrows
db !TIER_JUNK ; D6 - Good Bee
db !TIER_JUNK ; D7 -
db !TIER_JUNK ; D8 -
db !TIER_JUNK ; D9 -
db !TIER_JUNK ; DA -
db !TIER_JUNK ; DB -
db !TIER_JUNK ; DC -
db !TIER_JUNK ; DD -
db !TIER_JUNK ; DE -
db !TIER_JUNK ; DF -
db !TIER_JUNK ; E0 -
db !TIER_JUNK ; E1 -
db !TIER_JUNK ; E2 -
db !TIER_JUNK ; E3 -
db !TIER_JUNK ; E4 -
db !TIER_JUNK ; E5 -
db !TIER_JUNK ; E6 -
db !TIER_JUNK ; E7 -
db !TIER_JUNK ; E8 -
db !TIER_JUNK ; E9 -
db !TIER_JUNK ; EA -
db !TIER_JUNK ; EB -
db !TIER_JUNK ; EC -
db !TIER_JUNK ; ED -
db !TIER_JUNK ; EE -
db !TIER_JUNK ; EF -
db !TIER_JUNK ; F0 -
db !TIER_JUNK ; F1 -
db !TIER_JUNK ; F2 -
db !TIER_JUNK ; F3 -
db !TIER_JUNK ; F4 -
db !TIER_JUNK ; F5 -
db !TIER_JUNK ; F6 -
db !TIER_JUNK ; F7 -
db !TIER_JUNK ; F8 -
db !TIER_JUNK ; F9 -
db !TIER_JUNK ; FA -
db !TIER_JUNK ; FB -
db !TIER_JUNK ; FC -
db !TIER_JUNK ; FD -
db !TIER_JUNK ; FE - Server request (async)
db !TIER_JUNK ; FF -

View File

@@ -0,0 +1,87 @@
SpiralPropsIndex:
db $00, $04, $07, $00, $01, $00, $00, $0D, $00, $10, $04, $00, $15, $00, $0A, $00
db $00, $07, $00, $00, $00, $01, $07, $1C, $00, $00, $21, $00, $26, $07, $0A, $00
db $00, $00, $00, $00, $00, $00, $29, $30, $01, $00, $00, $00, $00, $00, $00, $00
db $00, $35, $00, $00, $3A, $00, $00, $00, $01, $00, $04, $00, $00, $00, $00, $3D
db $40, $07, $07, $00, $00, $01, $00, $00, $00, $00, $43, $00, $07, $07, $07, $00
db $00, $00, $00, $01, $48, $00, $00, $00, $00, $00, $00, $00, $07, $07, $00, $4B
db $00, $00, $00, $01, $50, $00, $07, $00, $00, $00, $53, $01, $01, $00, $58, $00
; 0 1 2 3 4 5 6 7 8 9 a b c d e f
db $5B, $01, $04, $00, $00, $00, $60, $67, $00, $00, $00, $00, $00, $00, $00, $6E
db $01, $00, $00, $00, $00, $00, $00, $71, $00, $00, $00, $00, $76, $00, $04, $00
db $00, $07, $00, $04, $00, $00, $00, $01, $7D, $0A, $00, $00, $00, $00, $04, $00
db $01, $00, $04, $00, $00, $01, $07, $00, $00, $00, $00, $0A, $00, $00, $07, $00
db $80, $00, $00, $00, $00, $01, $01, $00, $00, $00, $00, $00, $01, $00, $07, $00
db $85, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
db $8A, $92, $8F, $00, $00, $00, $00, $00, $00, $00, $0A, $00, $00, $00, $00, $00
db $04
SpiralProps:
db $00 ;null row
db $01, $00, $00 ; ($01) Single Top-Left Staircase
db $01, $00, $01 ; ($04) Single Top-Middle Staircase
db $01, $00, $02 ; ($07) Single Top-Right Staircase
db $01, $00, $05 ; ($0A) Single Staircase at Top of Bottom Left Quadrant
db $01, $00, $04 ; ($0D) Moldorm
db $02, $01, $00, $00, $02 ; ($10) Pod Basement
db $03, $01, $0A, $02, $01, $00, $0B ; ($15) GT Entrance
db $02, $00, $03, $01, $04 ; ($1C) Hera Below Moldorm
db $02, $00, $01, $01, $0B ; ($21) PoD Bridge
db $01, $00, $08 ; ($26) GT Ice Armos
db $03, $00, $01, $01, $0B, $02, $09 ; ($29) Swamp Statue
db $02, $01, $03, $00, $04 ; ($30) Hera Big Chest
db $02, $00, $04, $02, $09 ; ($35) Hera Startiles (middle value unused)
db $01, $00, $08 ; ($3A) West Swamp
db $01, $00, $05 ; ($3D) Ice Hamlift
db $01, $00, $07 ; ($40) Aga Guards
db $02, $01, $00, $00, $02 ; ($43) Pod Entrance
db $01, $00, $08 ; ($48) Swamp Attic
db $02, $03, $0C, $04, $06 ; ($4B) Ice U (1st three values unused)
db $01, $00, $05 ; ($50) TT Attic Left
db $02, $00, $01, $01, $0B ; ($53) Pod Rupees
db $01, $00, $04 ; ($58) Ice Gators
db $02, $01, $0A, $02, $01 ; ($5B) HC Tiny (first value placeholder)
db $03, $00, $01, $01, $0B, $02, $09 ; ($60) Swamp Sunken
db $03, $01, $00, $03, $08, $02, $09 ; ($67) Hera Entrance (first value unused)
db $01, $00, $08 ; ($6E) Ice Hookshot
db $02, $01, $00, $03, $08 ; ($71) Hera Basement (first and third values unused)
db $03, $01, $00, $00, $02, $03, $08 ; ($76) GT Circle (third value unused)
db $01, $00, $07 ; ($7D) Mire Entrance
db $02, $00, $02, $02, $09 ; ($80) Tower Usains (2nd value unused)
db $02, $00, $02, $02, $09 ; ($85) Tower Dark2 (2nd value unused)
db $02, $00, $02, $02, $09 ; ($8A) Tower Dark1 (2nd value unused)
db $01, $00, $09 ; ($8F) Mire2
db $01, $00, $0A ; ($92) Mire south of Torch Room
SpiralLabelOffsets:
db 1, -9
db 5, -9
db 9, -9
db -6, -1
db 15, -1
db 1, -1
db 5, -1
db 9, -1
db -6, 7
db 15, 7
db -3, -9
db 13, -9
db -3, -1
db 13, -1
SpiralLabelQuadrantMasks:
dw $0008
dw $000C
dw $0004
dw $0008
dw $0004
dw $0002
dw $0003
dw $0001
dw $0002
dw $0001
dw $0008
dw $0004
dw $0002
dw $0001

View File

@@ -0,0 +1,571 @@
IncomingDoorMap:
; north
db $06, $07, $08
; west
db $09, $0A, $0B
; south
db $00, $01, $02
; east
db $03, $04, $05
macro d(label)
dw <label>-SplitRooms
endmacro
macro sq(byte)
db <byte>
endmacro
SplitRooms:
; 0/8 1/9 2/A 3/B 4/C 5/D 6/E 7/F
%d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no)
%d(.no) : %d(.09) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no)
%d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.14) : %d(.no) : %d(.no) : %d(.no)
%d(.no) : %d(.no) : %d(.1a) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no)
%d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no)
%d(.no) : %d(.no) : %d(.2a) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no)
%d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.35) : %d(.36) : %d(.37)
%d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no)
%d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no)
%d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no)
%d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.57)
%d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no)
%d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no)
%d(.no) : %d(.no) : %d(.6a) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no)
%d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.75) : %d(.no) : %d(.no)
%d(.no) : %d(.no) : %d(.no) : %d(.7b) : %d(.7c) : %d(.7d) : %d(.no) : %d(.no)
; 0/8 1/9 2/A 3/B 4/C 5/D 6/E 7/F
%d(.no) : %d(.no) : %d(.82) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.87)
%d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.8c) : %d(.no) : %d(.no) : %d(.no)
%d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no)
%d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.9d) : %d(.no) : %d(.no)
%d(.no) : %d(.no) : %d(.a2) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no)
%d(.no) : %d(.a9) : %d(.aa) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no)
%d(.no) : %d(.no) : %d(.b2) : %d(.no) : %d(.no) : %d(.no) : %d(.b6) : %d(.no)
%d(.no) : %d(.b9) : %d(.no) : %d(.no) : %d(.bc) : %d(.no) : %d(.no) : %d(.no)
%d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.c7)
%d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.no)
%d(.no) : %d(.d1) : %d(.no) : %d(.no) : %d(.no) : %d(.no) : %d(.d6) : %d(.no)
%d(.no) : %d(.no) : %d(.no) : %d(.db) : %d(.no) : %d(.no) : %d(.no) : %d(.no)
%d(.no)
.no
db $00
.no_items
db $FF
.09
db $01
%sq($04)
%d(..areas) : %d(.no_items) : %d(..stairs)
%d(.no_items) : %d(.no_items) : %d(..enemies)
..areas
db $03, $80, $FF, $00, $80
db $FF
..stairs
db $01
db $FF
..enemies
db $02
db $FF
.14
db $02
%sq($00)
%d(..areas3) : %d(..doors3) : %d(.no_items)
%d(.no_items) : %d(.no_items) : %d(.no_items)
%sq($00)
%d(..areas2) : %d(..doors2) : %d(.no_items)
%d(.no_items) : %d(.no_items) : %d(.no_items)
..areas3
db $03, $C0, $FF, $00, $50
db $03, $00, $28, $30, $50
db $03, $30, $50, $D0, $FF
db $FF
..doors3
db $03, $06, $09
db $FF
..areas2
db $03, $B0, $D0, $D0, $FF
db $03, $30, $50, $00, $28
db $FF
..doors2
db $00, $08
db $FF
.1a ; PoD Big Chest (2) // Falling bridge and such (1)
db $01
%sq($00)
%d(..areas) : %d(..doors) : %d(.no_items)
%d(..chests) : %d(.no_items) : %d(.no_items)
..areas
db $03, $00, $2C, $70, $98
db $FF
..doors
db $04
db $FF
..chests
db $00
db $FF
.2a ; PoD Arena Right-Side Chest (2) // Arena (1)
db $01
%sq($00)
%d(..areas) : %d(..doors) : %d(.no_items)
%d(..chests) : %d(.no_items) : %d(.no_items)
..areas
db $03, $D8, $FF, $A8, $C8
db $FF
..doors
db $0B
db $FF
..chests
db $00
db $FF
.35 ; Swamp BK Chest (2) // Swamp second trench (1)
db $01
%sq($00)
%d(..areas) : %d(..doors) : %d(.no_items)
%d(..chests) : %d(..pots) : %d(.no_items)
..areas
db $03, $00, $70, $00, $80
db $FF
..doors
db $03
db $FF
..chests
db $00
db $FF
..pots
db $01, $02, $03, $04, $05
db $FF
.36 ; Swamp Big Lobby (1) // Tiny Top-Right Blocked Corner (2)
db $01
%sq($00)
%d(..areas) : %d(..doors) : %d(.no_items)
%d(.no_items) : %d(..pots) : %d(.no_items)
..areas
db $03, $D4, $FF, $00, $48
db $FF
..doors
db $09
db $FF
..pots
db $00, $01
db $FF
.37 ; Swamp Second Chest (2) // Swamp first trench (1)
db $01
%sq($00)
%d(..areas) : %d(..doors) : %d(.no_items)
%d(..chests) : %d(.no_items) : %d(..enemies)
..areas
db $03, $90, $FF, $00, $80
db $FF
..doors
db $09
db $FF
..chests
db $00
db $FF
..enemies
db $02, $03
db $FF
.57 ; SW pot cage (2) // middle section (1)
db $01
%sq($00)
%d(..areas) : %d(..doors) : %d(.no_items)
%d(..chests) : %d(..pots) : %d(..enemies)
..areas
db $03, $80, $FF, $80, $FF
db $FF
..doors
db $08, $0B
db $FF
..chests
db $01
db $FF
..pots
db $02, $03, $04, $05
db $FF
..enemies
db $08, $09, $0A, $0B
db $FF
.6a ; pre-helmasaur-king (2) // PoD rupee basement (1)
db $01
%sq($00)
%d(..areas) : %d(..doors) : %d(.no_items)
%d(.no_items) : %d(.no_items) : %d(..enemies)
..areas
db $03, $B4, $C4, $00, $B4
db $03, $A8, $D0, $B0, $D0
db $FF
..doors
db $02
db $FF
..enemies
db $00, $01, $04, $05
db $FF
.74 ; desert north -- trapped area (2) // everything else (1)
db $01
%sq($00)
%d(..areas) : %d(..doors) : %d(.no_items)
%d(.no_items) : %d(.no_items) : %d(..enemies)
..areas
db $03, $4C, $C4, $CC, $FF
db $FF
..doors
db $07
db $FF
..enemies
db $06, $07
db $FF
.75 ; desert cannonball (2) // desert northeast + trap room (1)
db $01
%sq($00)
%d(..areas) : %d(..doors) : %d(.no_items) : %d(..chests) : %d(.no_items) : %d(..enemies)
..areas
db $03, $80, $FF, $00, $FF
db $FF
..doors
db $08
db $FF
..chests
db $00
db $FF
..enemies
db $06, $07
db $FF
.7b ; GT post-compass (3) // island hardhat (2) // DMs room (1)
db $02
%sq($00)
%d(..areas3) : %d(..doors3) : %d(.no_items)
%d(.no_items) : %d(..pots3) : %d(..enemies3)
%sq($00)
%d(..areas2) : %d(..doors2) : %d(.no_items)
%d(.no_items) : %d(.no_items) : %d(..enemies2)
..areas3
db $03, $00, $FF, $00, $80
db $FF
..doors3
db $09
db $FF
..pots3
db $00, $01, $02, $03, $04
db $FF
..enemies3
db $00, $01
db $FF
..areas2
db $03, $80, $FF, $80, $FF
db $FF
..doors2
db $0B
db $FF
..enemies2
db $06, $07
db $FF
.7c ; GT falling bridge // rando room
db $01
%sq($00)
%d(..areas) : %d(..doors) : %d(.no_items)
%d(.no_items) : %d(..pots) : %d(..enemies)
..areas
db $03, $00, $80, $00, $FF
db $FF
..doors
db $03, $05
db $FF
..pots
db $00, $01, $02, $03
db $FF
..enemies
db $01, $02, $03, $04
db $FF
.7d ; GT warp maze (section next to rando room)
db $01
%sq($00)
%d(..areas) : %d(..doors) : %d(.no_items)
%d(..chests) : %d(..pots) : %d(..enemies)
..areas
db $03, $00, $FF, $00, $80
db $03, $00, $80, $80, $FF
db $03, $CA, $DA, $9A, $A6
db $FF
..doors
db $05
db $FF
..chests
db $00
db $FF
..pots
db $00, $01, $02, $03
db $FF
..enemies
db $00, $01, $02, $03, $09
db $FF
.82 ; HC Basement (1) + catwalk (2)
db $01
%sq($00)
%d(..areas) : %d(..doors) : %d(.no_items)
%d(.no_items) : %d(.no_items) : %d(.no_items)
..areas
db $03, $00, $20, $00, $50
db $FF
..doors
db $00, $03
db $FF
.87 ; Hera basement: cage (0) // torches (1)
db $01
%sq($08)
%d(..areas) : %d(.no_items) : %d(..stairs)
%d(..chests) : %d(..pots) : %d(..enemies)
..areas
db $03, $00, $FF, $00, $80
db $03, $80, $FF, $80, $FF
db $FF
..stairs
db $00
db $FF
..chests
db $00
db $FF
..pots
db $00, $01, $02, $03, $04, $05, $06, $07
db $FF
..enemies
db $00, $01, $02, $05, $06, $09, $0C
db $FF
.8c
db $01
%sq($00)
%d(..areas) : %d(..doors) : %d(.no_items)
%d(..chests) : %d(..pots) : %d(..enemies)
..areas
db $03, $80, $FF, $80, $FF
db $FF
..doors
db $08
db $FF
..chests
db $03
db $FF
..pots
db $02, $03, $04, $05, $06
db $FF
..enemies
db $06, $07, $09
db $FF
.9d
db $01
%sq($00)
%d(..areas) : %d(..doors) : %d(.no_items)
%d(.no_items) : %d(.no_items) : %d(..enemies)
..areas
db $03, $00, $FF, $80, $FF
db $FF
..doors
db $05
db $FF
..enemies
db $06, $07, $08
db $FF
.a2 ; Mire abyss -- EW bridge (2), stairs to basement + hookable chest (1)
db $01
%sq($00)
%d(..areas) : %d(..doors) : %d(.no_items)
%d(.no_items) : %d(.no_items) : %d(.no_items)
..areas
db $01, $00, $FF, $70, $84
db $FF
..doors
db $04, $0A
db $FF
.a9
db $01
%sq($00)
%d(..areas) : %d(..doors) : %d(.no_items) : %d(.no_items) : %d(..pots) : %d(.no_items)
..areas
db $03, $00, $40, $70, $FF
db $03, $00, $FF, $A0, $FF
db $03, $C0, $FF, $70, $FF
db $FF
..doors
db $04, $07, $0A
db $FF
..pots
db $04, $05, $06, $07
db $FF
.aa
db $01
%sq($00)
%d(..areas) : %d(..doors) : %d(.no_items) : %d(.no_items) : %d(.no_items) : %d(.no_items)
..areas
db $02, $00, $80, $00, $FF
db $01, $34, $D4, $B8, $FF
db $FF
..doors
db $03, $06
db $FF
.b2
db $01
%sq($00)
%d(..areas) : %d(..doors) : %d(.no_items) : %d(.no_items) : %d(..pots) : %d(..enemies)
..areas
db $02, $00, $FF, $00, $80
db $03, $60, $A0, $00, $40
db $FF
..doors
db $01, $09
db $FF
..pots
db $00, $01, $02, $03, $04, $05, $06
db $FF
..enemies
db $00, $01, $02, $03, $04
db $FF
.b6
db $01
%sq($00)
%d(..areas) : %d(..doors) : %d(.no_items)
%d(.no_items) : %d(..pots) : %d(..enemies)
..areas
db $03, $80, $FF, $00, $FF
db $FF
..doors
db $08
db $FF
..pots
db $00
db $FF
..enemies
db $04
db $FF
.b9
db $01
%sq($00)
%d(..areas) : %d(..doors) : %d(.no_items) : %d(.no_items) : %d(.no_items) : %d(.no_items)
..areas
db $01, $00, $20, $28, $60
db $01, $E0, $FF, $28, $60
db $01, $00, $FF, $58, $60
db $FF
..doors
db $03, $09
db $FF
.bc
db $01
%sq($00)
%d(..areas) : %d(..doors) : %d(.no_items) : %d(.no_items) : %d(..pots) : %d(.no_items)
..areas
db $03, $2C, $4C, $CA, $FF
db $FF
..doors
db $06
db $FF
..pots
db $0C, $0D
db $FF
.c7 ; TR Torch Maze (1) // Tiny Bottom-Left Blocked Corner (2)
db $01
%sq($00)
%d(..areas) : %d(..doors) : %d(.no_items)
%d(.no_items) : %d(..pots) : %d(.no_items)
..areas
db $03, $00, $1C, $A8, $FF
db $FF
..doors
db $05
db $FF
..pots
db $02, $03
db $FF
.d1
db $01
%sq($00)
%d(..areas) : %d(..doors) : %d(.no_items)
%d(.no_items) : %d(..pots) : %d(..enemies)
..areas
db $03, $80, $FF, $00, $A8
db $FF
..doors
db $02
db $FF
..pots
db $02, $03, $04, $05
db $FF
..enemies
db $00, $01, $07
db $FF
.d6
db $01
%sq($00)
%d(..areas) : %d(..doors) : %d(.no_items)
%d(..chests) : %d(.no_items) : %d(..enemies)
..areas
db $03, $00, $80, $00, $FF
db $FF
..doors
db $00
db $FF
..chests
db $00
db $FF
..enemies
db $00, $01, $02
db $FF
.db
db $01
%sq($00)
%d(..areas) : %d(..doors) : %d(.no_items)
%d(..chests) : %d(.no_items) : %d(.no_items)
..areas
db $02, $B0, $FF, $90, $C0
db $FF
..doors
db $0B
db $FF
..chests
db $01
db $FF

View File

@@ -0,0 +1,258 @@
dw $FFFF, $83A5, $FFFF, $FFFF ; 00
dw $C388, $8388, $FFFF, $FFFF ; 01
dw $4348, $034A, $4342, $0342 ; 02
dw $FFFF, $FFFF, $438F, $FFFF ; 03 - Houlihan
dw $039A, $038F, $4365, $C39B ; 04
dw $FFFF, $FFFF, $FFFF, $FFFF ; 05 - unused
dw $FFFF, $FFFF, $438F, $FFFF ; 06 - Arrghus
dw $0100, $0101, $4111, $0111 ; 07 - Moldorm
dw $FFFF, $FFFF, $43B2, $03B2 ; 08 - useless fairy entrance
dw $C3A6, $837B, $FFFF, $FFFF ; 09
dw $C398, $835F, $FFFF, $FFFF ; 0A
dw $039B, $439C, $839B, $0381 ; 0B
dw $C371, $8371, $4354, $0354 ; 0C
dw $FFFF, $FFFF, $438F, $FFFF ; 0D - Aga 2
dw $FFFF, $FFFF, $8399, $439B ; 0E
dw $FFFF, $FFFF, $FFFF, $FFFF ; 0F - unused and should never be used, treated as non-id
dw $C340, $8340, $4350, $0340 ; 10
dw $83B7, $C3AC, $03B7, $438A ; 11
dw $C354, $8354, $4354, $0354 ; 12
dw $FFFF, $83B7, $FFFF, $03B7 ; 13
dw $012E, $012F, $013E, $013F ; 14
dw $C374, $8340, $4341, $0340 ; 15
dw $0108, $0109, $436B, $036B ; 16
dw $4104, $0104, $4114, $0114 ; 17
dw $C3B5, $FFFF, $43B4, $FFFF ; 18 - useless fairy drop
dw $FFFF, $8369, $FFFF, $035A ; 19
dw $03E7, $03E8, $03F7, $0361 ; 1A
dw $039B, $439C, $4361, $FFFF ; 1B
dw $038F, $038F, $037E, $C39B ; 1C
dw $C3B2, $83A7, $FFFF, $FFFF ; 1D
dw $FFFF, $4391, $0122, $0123 ; 1E
dw $FFFF, $FFFF, $4360, $C399 ; 1F
dw $FFFF, $FFFF, $438F, $FFFF ; 20
dw $4348, $0363, $C348, $8368 ; 21
dw $FFFF, $FFFF, $4368, $0348 ; 22
dw $FFFF, $FFFF, $FFFF, $039B ; 23
dw $4365, $0365, $0132, $0133 ; 24
dw $FFFF, $FFFF, $FFFF, $FFFF ; 25 - unused
dw $039B, $03E4, $4363, $0382 ; 26
dw $4104, $0104, $4114, $0114 ; 27
dw $C3A5, $FFFF, $4358, $0348 ; 28
dw $FFFF, $FFFF, $FFFF, $0396 ; 29 - Mothula
dw $C350, $8352, $4350, $03F8 ; 2A
dw $C36A, $FFFF, $03F9, $C38D ; 2B
dw $C340, $8340, $4350, $0350 ; 2C - hookshot cave back
dw $FFFF, $FFFF, $FFFF, $FFFF ; 2D - unused
dw $FFFF, $838F, $FFFF, $FFFF ; 2E
dw $C3B4, $FFFF, $436E, $03B2 ; 2F - Kakariko well
dw $C361, $FFFF, $839A, $FFFF ; 30 - inset stairs if possible
dw $0124, $0125, $0134, $0135 ; 31
dw $43C4, $03C4, $43D4, $03D4 ; 32
dw $FFFF, $FFFF, $438F, $FFFF ; 33
dw $0129, $012A, $0139, $013A ; 34
dw $C38D, $039B, $43B1, $037D ; 35
dw $0118, $0119, $0128, $4128 ; 36
dw $439B, $838D, $437D, $03B1 ; 37
dw $C3AC, $FFFF, $43B7, $FFFF ; 38
dw $FFFF, $FFFF, $039B, $0381 ; 39
dw $03C2, $03C3, $43D3, $03D3 ; 3A - make bespoke if feasible
dw $C3A5, $FFFF, $43B5, $FFFF ; 3B - inset stairs if feasible
dw $C340, $8350, $4340, $0350 ; 3C - hookshot cave front
dw $039B, $439B, $0361, $838E ; 3D
dw $FFFF, $438F, $43B2, $0373 ; 3E
dw $FFFF, $FFFF, $0130, $C399 ; 3F
dw $C3A5, $FFFF, $4372, $C399 ; 40 - inset stairs if feasible
dw $03C5, $03C6, $03D5, $03D6 ; 41
dw $03E9, $03EA, $FFFF, $FFFF ; 42
dw $C3B2, $03B2, $FFFF, $0361 ; 43
dw $038D, $839F, $838D, $039F ; 44
dw $C3AB, $83B4, $4364, $43B7 ; 45
dw $C375, $8375, $4373, $0373 ; 46
dw $FFFF, $FFFF, $FFFF, $FFFF ; 47 - unused
dw $FFFF, $FFFF, $FFFF, $FFFF ; 48 - unused
dw $839B, $8372, $039B, $0372 ; 49
dw $03E2, $03E3, $0386, $4386 ; 4A
dw $C361, $4391, $4373, $0373 ; 4B
dw $FFFF, $83A5, $FFFF, $03B7 ; 4C
dw $0102, $0103, $0112, $0113 ; 4D
dw $839B, $439C, $FFFF, $FFFF ; 4E
dw $FFFF, $8396, $838D, $FFFF ; 4F
dw $FFFF, $83B7, $FFFF, $03B5 ; 50
dw $C354, $8354, $4384, $0384 ; 51
dw $C3B7, $FFFF, $4359, $0348 ; 52
dw $039A, $83B5, $839B, $43B7 ; 53
dw $C390, $8390, $4380, $0340 ; 54
dw $C340, $8340, $4350, $0340 ; 55 - secret passage
dw $038F, $83B4, $4365, $039F ; 56
dw $039B, $438D, $0365, $039B ; 57
dw $C372, $439B, $0383, $0365 ; 58 - split
dw $838A, $8372, $03D1, $0372 ; 59
dw $FFFF, $FFFF, $FFFF, $038F ; 5A - Helmasaur King
dw $FFFF, $83B7, $FFFF, $03B5 ; 5B
dw $C3B1, $83AA, $FFFF, $838F ; 5C
dw $039B, $C399, $0361, $FFFF ; 5D
dw $FFFF, $0110, $839C, $0123 ; 5E
dw $FFFF, $FFFF, $43BB, $FFFF ; 5F
dw $FFFF, $8379, $FFFF, $036A ; 60
dw $C387, $8385, $4356, $0356 ; 61
dw $C346, $8354, $4352, $0340 ; 62
dw $039A, $FFFF, $0361, $FFFF ; 63
dw $FFFF, $FFFF, $8399, $0367 ; 64
dw $FFFF, $FFFF, $0367, $0381 ; 65
dw $038F, $039A, $0362, $83B2 ; 66
dw $83B4, $83B5, $03B7, $039F ; 67
dw $C340, $8350, $4341, $0340 ; 68
dw $FFFF, $FFFF, $FFFF, $FFFF ; 69 - unused
dw $FFFF, $03E1, $FFFF, $03F1 ; 6A
dw $039A, $0361, $839B, $C39B ; 6B
dw $039A, $FFFF, $839B, $0360 ; 6C - Lanmolas 2
dw $0361, $FFFF, $C39B, $FFFF ; 6D
dw $FFFF, $838E, $FFFF, $FFFF ; 6E
dw $FFFF, $FFFF, $FFFF, $FFFF ; 6F - unused
dw $43BA, $FFFF, $FFFF, $FFFF ; 70
dw $039A, $FFFF, $4365, $438D ; 71
dw $437A, $037A, $8386, $0342 ; 72 - slight cheating I guess...
dw $038F, $038F, $839B, $0366 ; 73
dw $43B2, $03B2, $43A8, $03A8 ; 74
dw $038F, $83B4, $0365, $03B5 ; 75
dw $010D, $010E, $011D, $011E ; 76
dw $0126, $0127, $4137, $0137 ; 77
dw $FFFF, $FFFF, $FFFF, $FFFF ; 78 - unused
dw $FFFF, $FFFF, $FFFF, $FFFF ; 79 - unused
dw $FFFF, $FFFF, $FFFF, $FFFF ; 7A - unused
dw $0106, $0107, $438F, $4381 ; 7B
dw $C3B7, $83B4, $43B7, $03B7 ; 7C
dw $43B2, $835E, $034C, $0391 ; 7D
dw $FFFF, $83B7, $4393, $438A ; 7E
dw $439B, $FFFF, $838E, $FFFF ; 7F
dw $C3A7, $83B0, $FFFF, $FFFF ; 80
dw $C350, $8341, $4340, $0341 ; 81
dw $C39D, $8354, $4341, $0340 ; 82
dw $038F, $83B5, $4365, $43B7 ; 83
dw $C344, $8345, $4354, $0354 ; 84
dw $C38B, $C39B, $03B7, $439B ; 85
dw $FFFF, $FFFF, $FFFF, $FFFF ; 86 - unused
dw $0136, $0117, $4394, $838F ; 87
dw $FFFF, $FFFF, $FFFF, $FFFF ; 88 - unused
dw $C3B0, $83B0, $FFFF, $FFFF ; 89
dw $FFFF, $FFFF, $FFFF, $FFFF ; 8A - unused
dw $838A, $0360, $038A, $438D ; 8B
dw $83BE, $83BF, $03BD, $0391 ; 8C
dw $0360, $C38A, $038D, $438A ; 8D
dw $FFFF, $838E, $FFFF, $FFFF ; 8E
dw $FFFF, $FFFF, $FFFF, $FFFF ; 8F - unused
dw $FFFF, $FFFF, $438F, $FFFF ; 90
dw $FFFF, $83A5, $FFFF, $03B7 ; 91
dw $03D2, $C3B7, $0364, $039F ; 92
dw $C36C, $836C, $C39B, $838F ; 93
dw $FFFF, $FFFF, $FFFF, $FFFF ; 94 - unused
dw $FFFF, $83B7, $FFFF, $03B5 ; 95
dw $010F, $FFFF, $011F, $C39C ; 96
dw $039A, $83B4, $839B, $036F ; 97
dw $FFFF, $FFFF, $43B2, $0397 ; 98
dw $FFFF, $038F, $434A, $0363 ; 99
dw $FFFF, $FFFF, $FFFF, $FFFF ; 9A - unused
dw $839B, $0381, $435E, $0378 ; 9B
dw $C350, $8350, $4341, $0341 ; 9C
dw $0116, $83B2, $43B1, $035E ; 9D
dw $FFFF, $439A, $838D, $03B9 ; 9E
dw $FFFF, $FFFF, $439B, $FFFF ; 9F
dw $839B, $C39C, $FFFF, $FFFF ; A0
dw $C3B0, $835D, $FFFF, $036A ; A1
dw $03EE, $03EF, $03FE, $03FF ; A2
dw $C35A, $FFFF, $436A, $FFFF ; A3
dw $FFFF, $FFFF, $438F, $FFFF ; A4
dw $039A, $0361, $C3B2, $83B2 ; A5
dw $C340, $8370, $4340, $0340 ; A6
dw $C396, $FFFF, $FFFF, $FFFF ; A7 - ToH fairy basement room
dw $039B, $03E5, $839B, $03F5 ; A8
dw $C357, $8357, $4356, $0356 ; A9
dw $03E6, $439B, $03F6, $C39B ; AA
dw $FFFF, $FFFF, $439A, $FFFF ; AB
dw $FFFF, $FFFF, $FFFF, $038F ; AC - Blind
dw $FFFF, $FFFF, $FFFF, $FFFF ; AD - unused
dw $FFFF, $8399, $FFFF, $FFFF ; AE
dw $C39B, $FFFF, $FFFF, $FFFF ; AF
dw $039B, $C399, $839B, $C399 ; B0
dw $0391, $83B5, $434C, $438A ; B1
dw $C35C, $83A2, $039B, $0366 ; B2
dw $0365, $FFFF, $0365, $FFFF ; B3
dw $03FA, $83FD, $03EC, $03ED ; B4
dw $03EB, $83FD, $83FA, $03FD ; B5
dw $039A, $038F, $0361, $0361 ; B6
dw $C3B4, $FFFF, $43B5, $FFFF ; B7
dw $FFFF, $838A, $FFFF, $03B4 ; B8
dw $43F3, $03F3, $4354, $0354 ; B9
dw $0364, $438D, $FFFF, $FFFF ; BA
dw $838A, $8364, $4372, $0364 ; BB
dw $83BE, $C38A, $03D0, $438A ; BC
dw $FFFF, $FFFF, $FFFF, $FFFF ; BD - unused
dw $FFFF, $439A, $FFFF, $C365 ; BE
dw $FFFF, $FFFF, $438D, $FFFF ; BF
dw $C372, $C399, $4372, $C399 ; C0
dw $039B, $0364, $4365, $8364 ; C1
dw $C351, $8353, $4341, $0353 ; C2
dw $03E0, $C369, $03F0, $4369 ; C3 - show layers
dw $43C0, $03C0, $4340, $0341 ; C4
dw $C3B5, $FFFF, $438A, $FFFF ; C5
dw $03FA, $03FB, $83FA, $83FB ; C6
dw $43FB, $83FD, $03FC, $03FD ; C7
dw $FFFF, $FFFF, $FFFF, $038F ; C8 - Armos Knights
dw $03F2, $43F2, $0386, $4386 ; C9
dw $FFFF, $FFFF, $FFFF, $FFFF ; CA - unused
dw $C340, $8343, $4354, $0347 ; CB
dw $C353, $8350, $4347, $0354 ; CC
dw $FFFF, $FFFF, $FFFF, $FFFF ; CD - unused
dw $FFFF, $8391, $FFFF, $FFFF ; CE - Kholdstare drop
dw $FFFF, $FFFF, $FFFF, $FFFF ; CF - unused
dw $C372, $C399, $4372, $C399 ; D0
dw $C38E, $838F, $4381, $C38D ; D1
dw $FFFF, $83B5, $FFFF, $0395 ; D2
dw $FFFF, $FFFF, $FFFF, $FFFF ; D3 - unused
dw $FFFF, $FFFF, $FFFF, $FFFF ; D4 - unused
dw $C3B5, $FFFF, $43B5, $FFFF ; D5
dw $C3B5, $010A, $43B4, $011A ; D6
dw $FFFF, $FFFF, $FFFF, $FFFF ; D7 - unused
dw $FFFF, $8361, $FFFF, $839B ; D8
dw $FFFF, $FFFF, $4360, $0360 ; D9
dw $FFFF, $FFFF, $439C, $FFFF ; DA
dw $C354, $8346, $4354, $037F ; DB
dw $C346, $8354, $4343, $0340 ; DC
dw $FFFF, $FFFF, $FFFF, $FFFF ; DD - unused
dw $FFFF, $8396, $FFFF, $FFFF ; DE - Kholdstare
dw $FFFF, $FFFF, $43A0, $0354 ; DF - paradox top
dw $039B, $C399, $0361, $FFFF ; E0
; no more dungeon
dw $C340, $8340, $4350, $0340 ; E1 - lost woods thieves hideout
dw $C340, $8340, $4340, $0350 ; E2 - lumberjack cave
dw $FFFF, $83B4, $43B2, $036E ; E3 - magic bat
dw $C340, $8342, $4350, $0342 ; E4 - old man's house front
dw $C342, $8340, $4356, $0354 ; E5 - old man's house back
dw $C340, $8341, $4350, $0340 ; E6 - death mountain descent left
dw $C341, $8340, $4340, $0350 ; E7 - death mountain descent right
dw $C370, $8370, $4380, $0350 ; E8 - superbunny top
dw $FFFF, $FFFF, $FFFF, $FFFF ; E9 - unused
dw $C3A5, $FFFF, $43B5, $FFFF ; EA - spectacle top
dw $FFFF, $83A6, $FFFF, $03B5 ; EB - bumper top
dw $FFFF, $FFFF, $FFFF, $FFFF ; EC - unused
dw $C370, $8370, $4340, $0350 ; ED - fairy ascension top
dw $C340, $8390, $4340, $0350 ; EE - spiral top
dw $FFFF, $8340, $43A0, $0354 ; EF - paradox top
dw $C340, $8342, $4350, $0342 ; F0 - old man rescue left
dw $C342, $8342, $4340, $0350 ; F1 - old man rescue right
dw $FFFF, $FFFF, $FFFF, $03B2 ; F2 - Sahasrahla's Kakariko house left
dw $FFFF, $FFFF, $43B2, $FFFF ; F3 - Sahasrahla's Kakariko house right
dw $FFFF, $FFFF, $FFFF, $03B2 ; F4 - quarreling brothers left
dw $FFFF, $FFFF, $43B2, $FFFF ; F5 - quarreling brothers right
dw $FFFF, $FFFF, $FFFF, $FFFF ; F6 - unused
dw $FFFF, $FFFF, $FFFF, $FFFF ; F7 - unused
dw $C370, $8370, $43A0, $0354 ; F8 - superbunny bottom
dw $C340, $8341, $4350, $0340 ; F9 - spectacle left
dw $C374, $8340, $4350, $0340 ; FA - spectacle bottom
dw $FFFF, $83A5, $4348, $0358 ; FB - bumper bottom
dw $FFFF, $FFFF, $FFFF, $FFFF ; FC - unused
dw $C370, $8370, $4354, $0354 ; FD - fairy ascension bottom
dw $FFFF, $FFFF, $43B4, $03B5 ; FE - spiral bottom
dw $C3B4, $83B4, $436E, $036D ; FF - paradox bottom

204
dungeon_map/draw_loot.asm Normal file
View File

@@ -0,0 +1,204 @@
RedrawLoot:
JSL DrawLoot
; what we wrote over
SEP #$20
STZ.w $0210
RTL
FirstDrawLoot:
LDA.b #$FF
STA.w $0215
LDA.b #$80
STA.w $0216
STA.w $0218
LDA.l DRMode
BEQ +
LDA.w DungeonID
ASL A
TAX
LDA.l DungeonMapData.floor, X
STA.b $A4
+
; what we wrote over
LDA.b #$08
STA.b $17
DrawLoot:
LDA.b $07
STA.w $021B
LDA.l DRMode
BEQ +
LDA.l DungeonMapMode
BNE +
BRA .skip
+
REP #$30
PHX : PHY
STZ.b $0E
LDX.w DungeonID
JSL LoadDungeonMapRoomPointer
STA.b $72
SEP #$20
LDA.l DungeonMapFloorCountData, X
AND.b #$0F
CLC : ADC.w DungeonMapCurrentFloor
PHA
JSR DrawSingleFloorLoot
INC.b $0F
LDA.b #$80
STA.b $0E
PLA : DEC A
JSR DrawSingleFloorLoot
LDX.w GFXStripes
LDA.b #$FF
STA.w GFXStripes+$02, X
LDA.b #$01
STA.b NMISTRIPES
PLY : PLX
.skip
LDA.b #$00
RTL
DrawSingleFloorLoot:
REP #$20
AND.w #$00FF
INC A
ASL A
%ADD_MapMode()
LDA.l MapDrawingData_floor_data_offset, X
DEC A
TAY
%LDX_MapMode()
SEP #$20
LDA.l MapDrawingData_column_count, X
DEC A
STA.b $06
LDA.l MapDrawingData_row_count, X
DEC A
STA.b $07
.next_row
REP #$20
LDA.w GFXStripes
TAX
CLC : ADC.w #$0034
STA.w GFXStripes
PHX
%LDX_MapMode()
SEP #$20
LDA.b $07
CPX.w #$0002
BNE +
ASL A
+
CLC : ADC.b $07
REP #$20
AND.w #$00FF
ASL #5
CLC : ADC.l MapDrawingData_bg1_grid_start, X
ADC.b $0E
XBA
PLX
STA.w GFXStripes+$02, X
CLC : ADC.w #$2000
STA.w GFXStripes+$1C, X
LDA.w #$1500
STA.w GFXStripes+$04, X
STA.w GFXStripes+$1E, X
TXA
CLC : ADC.w #$0018
TAX
.next_room
REP #$20
LDA.b [$72], Y ; get room id
PHY
AND.w #$00FF
CMP.w #$000F ; $0F = empty room
BNE .valid_room
LDA.w #$0000
BRA +
.valid_room
JSL CheckLoot
+
ASL A : ASL A : ASL A
TXY
TAX
LDA.l LootTypeIcons+0, X
STA.w GFXStripes+$00, Y
LDA.l LootTypeIcons+2, X
STA.w GFXStripes+$02, Y
LDA.l LootTypeIcons+4, X
STA.w GFXStripes+$1A, Y
LDA.l LootTypeIcons+6, X
STA.w GFXStripes+$1C, Y
TYX
PLY
DEY : DEX #4
LDA.l DungeonMapMode
BEQ +
LDA.b $06
AND.w #$00FF
BEQ +
; skip a column if in 4x3 mode and it's not the last column
LDA.w #$0300
STA.w GFXStripes+$02, X
STA.w GFXStripes+$1C, X
DEX : DEX
+
SEP #$20
DEC.b $06
BPL .next_room
LDA.l DungeonMapMode
BNE +
; draw an extra empty tile at the end to make up for width differences between modes
LDA.b #$03
STZ.w GFXStripes+$02, X
STA.w GFXStripes+$03, X
STZ.w GFXStripes+$1C, X
STA.w GFXStripes+$1D, X
+
DEC.b $07
BMI .done
LDA.b #$00
XBA
%LDX_MapMode()
LDA.l MapDrawingData_column_count, X
DEC A
STA.b $06
JMP .next_row
.done
RTS

315
dungeon_map/draw_rooms.asm Normal file
View File

@@ -0,0 +1,315 @@
DrawNonexistentRoom:
REP #$20
LDA.w #$0F00
STA.l $7F0000, X
STA.l $7F0002, X
STA.l $7F0040, X
STA.l $7F0042, X
FinishRoom:
PHX
%LDX_MapMode()
PLA
CLC : ADC.l MapDrawingData_column_spacing, X
TAX
JML $8AE7F6
NormalDrawDungeonMapRoom:
JSL DrawDungeonMapRoom
JMP FinishRoom
; $CA has room_id
; $0E has quadrant flags
; X has address to draw at
DrawDungeonMapRoom:
REP #$20
PHB : PHK : PLB ; need to keep this in same bank as data, or else specify bank
LDA.b $0A : PHA
LDA.l ShowRooms_default
AND.w #$00FF
STA.b $0A
PHX
LDX.w DungeonID
LDA.l MapField
AND.l DungeonMask, X
BEQ +
LDA.l ShowRooms_have_map
AND.w #$00FF
CMP.b $0A
BCC +
STA.b $0A
+
LDX.w DungeonID
LDA.l CompassField
AND.l DungeonMask, X
BEQ +
LDA.l ShowRooms_have_compass
AND.w #$00FF
CMP.b $0A
BCC +
STA.b $0A
+
LDA.b $0E
AND.w #$000F
BEQ +
LDA.l ShowRooms_visited_tile
AND.w #$00FF
CMP.b $0A
BCC +
STA.b $0A
+
PLX
LDA.l DungeonMapMode
BEQ +
LDA.b $0A
CMP.w #$0003
BCS +
JSL ClearAdjacentConnections
+
LDA.b $0A : BNE + : LDA.w #$0F00 : BRA ++
+ DEC A : BNE + : LDA.w #$174F : BRA ++
+ DEC A : BNE + : LDA.w #$174F : BRA ++
+ DEC A : BNE + : LDA.w #$1400 : BRA ++
+ DEC A : BNE + : LDA.w #$1000 : BRA ++
+ DEC A : BNE + : LDA.w #$0C00 : BRA ++
+ LDA.w #$0800
++ STA.b $0C
LDA.b $CA
AND.w #$00FF
ASL A : ASL A : ASL A
TAY
macro DrawQuadrant(quadrant, writeOffset)
?DrawQuadrant:
LDA.w SupertileRoomShapes+(2*<quadrant>), Y
CMP.w #$FFFF : BEQ ?.empty
PHA
LDA.b $0E
AND.w #1<<(3-<quadrant>)
BNE ?.visited
?.unvisited
LDA.b $0A
CMP.w #$0003
BCS ?.shape
?.square
PLA
LDA.b $0C
EOR.w #(3-<quadrant>)<<14
BRA ?.write
?.shape
PLA
ORA.b $0C
BRA ?.write
?.visited
PLA
ORA.w #$0800
BRA ?.write
?.empty
LDA.b $0A
CMP.w #$0001
BEQ ?.full_square
LDA.w #$0F00
BRA ?.write
?.full_square
LDA.w #$174F
EOR.w #(3-<quadrant>)<<14
?.write
STA.l $7F0000+<writeOffset>, X
?.done
endmacro
%DrawQuadrant(0, $00)
%DrawQuadrant(1, $02)
%DrawQuadrant(2, $40)
%DrawQuadrant(3, $42)
.done
PLA : STA.b $0A
PLB
RTL
DrawEntrances:
REP #$30
PHX : PHY
LDA.b $06 : PHA
LDX.w DungeonID
JSL LoadDungeonMapRoomPointer
STA.b $72
SEP #$20
LDA.l DungeonMapFloorCountData, X
AND.b #$0F
CLC : ADC.w DungeonMapCurrentFloor
REP #$20
AND.w #$00FF
STZ.b $02
PHA
JSR DrawSingleFloorEntrances
INC.b $02
INC.b $02
PLA
DEC A
JSR DrawSingleFloorEntrances
.done
REP #$20
PLA : STA.b $06
PLY : PLX
SEP #$30
RTL
DrawSingleFloorEntrances:
ASL A
TAX
%ADD_MapMode()
LDA.l MapDrawingData_floor_data_offset, X
TAY
STZ.b $06
%LDX_MapMode()
.next_room
REP #$20
LDA.b [$72], Y ; get room id
AND.w #$00FF
CMP.w #$000F ; $0F = empty room
BEQ +
PHX
JSR DrawSingleRoomEntrances
PLX
+
INY
SEP #$20
INC.b $06
LDA.b $06
CMP.l MapDrawingData_column_count, X
BCC .next_room
STZ.b $06
- INC.b $07
LDA.b $07
CMP.l MapDrawingData_row_count, X
BCC .next_room
.done
REP #$20
RTS
macro DrawSingleEntrance(offset)
LDY.b $00
LDA.b #$00
STA.w OAMBufferAux, Y ; high x-bit and size bit
TYA
ASL #2
TAY
LDA.b $06
CPX.b #$02
BNE ?+
ASL A
?+
CLC : ADC.b $06
ASL #3
CLC : ADC.b #<offset>
CLC : ADC.l MapDrawingData_sprite_offset_x_base, X
STA.w OAMBuffer+0, Y
PHX
LDA.b $07
CPX.b #$02
BNE ?+
ASL A
?+
CLC : ADC.b $07
ASL #3
PHA
LDA.b $02
%ADD_MapMode()
PLA
CLC : ADC.l MapDrawingData_sprite_offset_y_base, X
PLX
CLC : ADC.b #$08
CLC : ADC.w $0213
SEC : SBC.b $E8
STA.w OAMBuffer+1, Y
LDA.b #$33
STA.w OAMBuffer+2, Y
LDA.b #$23
STA.w OAMBuffer+3, Y
INC.b $00
endmacro
DrawSingleRoomEntrances:
STA.b $0E
PHY
%LDY_MapMode()
SEP #$10
LDX.b #$FE
.next_entry
INX : INX
LDA.l SupertileEntrances, X
BPL +
JMP .done
+
AND.w #$0FFF
CMP.b $0E
BNE .next_entry
SEP #$20
LDA.l SupertileEntrances+1, X
TYX
PHA : PHA
BIT.b #$40
BEQ +
%DrawSingleEntrance(0)
+
PLA
BIT.b #$20
BEQ +
%DrawSingleEntrance(4)
+
PLA
BIT.b #$10
BEQ +
%DrawSingleEntrance(8)
+
.done
REP #$30
PLY
RTS

View File

@@ -0,0 +1,410 @@
CheckSwitchMap:
LDA.l DRMode
BEQ .not_fancy_door_map
LDA.l DungeonMapMode
BNE .not_fancy_door_map
; fancy door map
SEP #$20
LDA.b $F6
BIT.b #$30
BNE .change_dungeon
BIT.b #$80
BNE .select_new_room
LDA.b $F4
BIT.b #$80
BNE .select_new_room
BIT.b #$20
BNE .next_entrance
BIT.b #$40
BNE .current_room
AND.b #$0F
BEQ .doors_done
BIT.b #$08 : BEQ + : LDA.b #$00 : BRA .doors_move_cursor : +
BIT.b #$04 : BEQ + : LDA.b #$02 : BRA .doors_move_cursor : +
BIT.b #$02 : BEQ + : LDA.b #$01 : BRA .doors_move_cursor : +
LDA.b #$03
.doors_move_cursor
STA.b $00
JSL MoveDoorsMapCursor
BRA .doors_done
.select_new_room
JSL DoorsMapSelectCursor
BRA .doors_done
.next_entrance
JSL DoorsMapNextEntrance
BRA .doors_done
.change_dungeon
JSL DoorsMapChangeDungeon
BRA .doors_done
.current_room
LDA.l CachedDungeonID
CMP.w DungeonID
BNE .doors_done
JSL DoorsMapCurrentRoom
BRA .doors_done
.doors_done
REP #$20
LDA.w #$0002 ; ignore input! nothing to see here!
RTL
.not_fancy_door_map
SEP #$20
LDA.b $F6
AND.b #$30
BNE +
; what we wrote over
REP #$20
LDA.w DungeonMapFloorCountData, X
AND.w #$000F
CLC : ADC.b $00
RTL
+ PHA
TXA
ASL A
TAX
PLA
BIT.b #$20
BNE +
INX
+ LDA.l DungeonMapData.prev, X
STA.w DungeonID
LDA.b #$04
STA.w SubModuleInterface
REP #$20
LDA.w #$0000
RTL
DungeonMapSwitch_Submodule:
JSL $80893D
JSL $80833F
LDA.b #$09
STA.b $14
STA.w $0710
LDA.b #$01
STA.w SubModuleInterface
STA.w $020D
STZ.w $0213
STZ.w $021B
STZ.w $021C
STZ.b $06
STZ.b $07
LDA.w DungeonID
CMP.l CachedDungeonID
BEQ .current_dungeon
ASL A
TAX
LDA.l DungeonMapData.floor, X
STA.b CurrentFloor
BRA .continue
.current_dungeon
LDA.l CachedCurrentFloor
STA.b CurrentFloor
.continue
REP #$20
STZ.b $E0
STZ.b $E2
STZ.b $E4
STZ.b $E6
STZ.b $E8
STZ.b $EA
JML $98BCA1
SkipMapSprites:
STZ.b $00
LDA.b $02 : PHA
LDA.b $03 : PHA
LDA.b $04 : PHA
LDA.l DRMode
BNE +
LDA.w SubModuleInterface
CMP.b #$04
BEQ +
JSL DrawEntrances
+
PLA : STA.b $04
PLA : STA.b $03
PLA : STA.b $02
STZ.b $0E
STZ.b $0F
LDA.w SubModuleInterface
CMP.b #$04
BNE +
JML $8AEAFC
+
LDA.l DRMode
BEQ +
LDA.l DungeonMapMode
BEQ .no_vanilla_draw
JML $8AEADE
.no_vanilla_draw
JSL DrawDoorsMapSprites
JML $8AEAFC
+
LDA.l CachedDungeonID
CMP.w DungeonID
BEQ +
JML $8AEAF3
+ JML $8AEADE
CacheCurrentDungeon:
STA.l $7EC206
SEP #$20
LDA.w DungeonID
STA.l CachedDungeonID
LDA.b CurrentFloor
STA.l CachedCurrentFloor
LDA.l DRMode
BEQ +
LDA.w DungeonID
PHX
ASL A
TAX
LDA.l DungeonMapData.floor, X
STA.b $A4
PLX
+
REP #$20
RTL
RestoreCurrentDungeon:
LDA.b #$F3
STA.w $012C ; what we wrote over
LDA.l CachedDungeonID
STA.w DungeonID
LDA.l CachedCurrentFloor
STA.b CurrentFloor
RTL
RestoreDungeonMapFloorIndex:
STZ.w $020F ; first part we wrote over
LDA.w $021B
STA.b $07
STZ.b $06
LDA.b $0A ; the rest of what we wrote over
AND.b #$08
RTL
DrawDungeonLabel:
LDY.b #$00
LDA.w DungeonID
ASL A
TAX
LDA.b NMISTRIPES
BEQ +
LDY.b #$20
+
; Dungeon Label
REP #$20
LDA.w #$E660
STA.w GFXStripes+$02, Y
LDA.w #$0300
STA.w GFXStripes+$04, Y
LDA.l DungeonLabels+0, X
STA.w GFXStripes+$06, Y
LDA.l DungeonLabels+2, X
STA.w GFXStripes+$08, Y
TYA
CLC : ADC.w #$0008
TAY
; L/R switch indicators
LDA.w #$E310
STA.w GFXStripes+$02, Y
LDA.w #$E910
STA.w GFXStripes+$0A, Y
LDA.w #$E318
STA.w GFXStripes+$12, Y
LDA.w #$E918
STA.w GFXStripes+$1A, Y
LDA.w #$0300
STA.w GFXStripes+$04, Y
STA.w GFXStripes+$0C, Y
STA.w GFXStripes+$14, Y
STA.w GFXStripes+$1C, Y
LDA.w #$49AF
STA.w GFXStripes+$06, Y
STA.w GFXStripes+$16, Y
LDA.w #$099E
STA.w GFXStripes+$08, Y
STA.w GFXStripes+$18, Y
LDA.w #$099F
STA.w GFXStripes+$0E, Y
STA.w GFXStripes+$1E, Y
LDA.w #$09AF
STA.w GFXStripes+$10, Y
STA.w GFXStripes+$20, Y
TYA
CLC : ADC.w #$0020
TAY
LDA.l DRMode
BEQ .not_doors
LDA.l DungeonMapMode
BEQ .doors
.not_doors
JMP .skip_doors
.doors
; Select for Next Entrance indicator
LDA.w #$E311
STA.w GFXStripes+$02, Y
LDA.w #$E319
STA.w GFXStripes+$16, Y
LDA.w #$0F00
STA.w GFXStripes+$04, Y
STA.w GFXStripes+$18, Y
LDA.w #$09B8
LDX.b #$07
-
STA.w GFXStripes+$06, Y
STA.w GFXStripes+$1A, Y
INC A
INY : INY
DEX
BPL -
TYA
CLC : ADC.w #$0018
TAY
LDA.l CachedDungeonID
AND.w #$00FF
CMP.w DungeonID
BNE .skip_doors
; Y for Current Location indicator
LDA.w #$A411
STA.w GFXStripes+$02, Y
LDA.w #$A419
STA.w GFXStripes+$12, Y
LDA.w #$0B00
STA.w GFXStripes+$04, Y
STA.w GFXStripes+$14, Y
LDA.w #$09A9
LDX.b #$05
-
STA.w GFXStripes+$06, Y
STA.w GFXStripes+$16, Y
INC A
INY : INY
DEX
BPL -
TYA
CLC : ADC.w #$0014
TAY
.skip_doors
SEP #$20
LDA.b #$FF
STA.w GFXStripes+$02, Y
LDA.b #$01
STA.b NMISTRIPES
INC.w $020D ; what we wrote over
RTL
StartCurrentRoomSearch:
LDA.w DungeonMapFloorCountData, X
LSR A : LSR A : LSR A : LSR A
STA.b $00
LDA.w DungeonMapFloorCountData, X
AND.b #$0F
CLC : ADC.b $00
ASL A
TAY
RTL
FindCurrentRoom:
PHX
TYA
%ADD_MapMode()
LDA.l MapDrawingData_floor_data_offset, X
STA.b $0C
LDY.w #$0000
%LDX_MapMode()
SEP #$20
.next_room_check
CPY.b $0C
BCS .not_found
LDA.b [$72], Y
INY
CMP.b $0E
BEQ .found
LDA.b $00
CMP.l MapDrawingData_floor_pixel_column_wrap, X
BCS .next_row
CLC : ADC.l MapDrawingData_supertile_pixel_spacing, X
STA.b $00
BRA .next_room_check
.next_row
STZ.b $00
LDA.b $02
CMP.l MapDrawingData_floor_pixel_row_wrap, X
BCS .next_floor
CLC : ADC.l MapDrawingData_supertile_pixel_spacing, X
STA.b $02
BRA .next_room_check
.next_floor
STZ.b $02
BRA .next_room_check
.found
PLX
JML $8AE891
.not_found
PLX
JML $8AE8CD

269
dungeon_map/hooks.asm Normal file
View File

@@ -0,0 +1,269 @@
; move aga boss icon to correct room
org $8AEE75
db $08
; use AA1 = $1C for map stuff
org $80E193
skip 4
db $61, $62, $63, $D6
org $8AE11D
LDA.b #$1C
org $8AE12B
LDA.b #$20
; dungeon map sheets
org $80DD97
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
db $61, $56, $57, $62
; unused chest data
org $81E9A5
dw $000F ; freezor room, second chest (only one chest in supertile)
org $81EA6E
dw $000F ; mire spike room, second chest (only one chest in supertile)
org $81EAF8
dw $000F ; GT button/switch/bladetrap room (no chest in supertile)
; Dungeon Map Palettes 2-5 left half
org $9BE544
dw $0000, $71E7, $7FFF, $3B5F, $0000, $0000, $7EB5, $1CE7
org $9BE564
dw $0000, $5565, $7FFF, $331C, $0000, $0000, $7E27, $0C63
org $9BE584
dw $0000, $4100, $7FFF, $2656, $4100, $0000, $4100, $4100
org $9BE5A4
dw $0000, $34E0, $7FFF, $34E0, $34E0, $0000, $34E0, $34E0
; move BG1 to main screen in dungeon map screen
org $8AE130
LDA.b #$17 : STA.b $1C
LDA.b #$00 : STA.b $1D
; make skull icon blink opposite our loot icons
org $8AEE2B
AND.b #$10
NOP #2
db $F0 ; BEQ to replace BCS
;================================================================================
; Overhaul of Dungeon Map Screen
;--------------------------------------------------------------------------------
org $8AE64D
PLX
JML NormalDrawDungeonMapRoom
org $8AE606
PLX
JML DrawNonexistentRoom
org $8AE152
JSL LoadLastHUDPalette
org $808BD3
JSL LoadStripes
BRA + : NOP #9 : +
org $8AEAE8 ; vanilla checks number of sprites drawn instead of... counting...
LDA.b $0E
CMP.b #$02
;================================================================================
; Swapping Dungeon in Dungeon Map Screen (L/R)
;--------------------------------------------------------------------------------
org $8AE9A7
JSL CheckSwitchMap
BRA + : NOP #3 : +
org $8AEF06
DEC.b $13
BNE +
JML DungeonMapSwitch_Submodule
+ RTL
warnpc $8AEF29
org $8AEADA
JML SkipMapSprites
org $8AE9C7
JSL RestoreDungeonMapFloorIndex
NOP
org $98BC86
JSL CacheCurrentDungeon
org $8AEFC5
JSL RestoreCurrentDungeon
NOP
org $8AE1EC
PLB
JML DrawDungeonLabel
org $8AE83E
JSL StartCurrentRoomSearch
BRA + : NOP #6 : +
org $8AE86C
JML FindCurrentRoom
padbyte $EA
pad $8AE891
org $8AEBF8
LDA.w $0217
SEC : SBC.b $0F
BMI +
CMP.b #$18
BCS +
skip 7
+
org $8AEB9A
db -8, 8, -8, 8
db -8, -8, 8, 8
;================================================================================
; Show indicators of what is left in each room
;--------------------------------------------------------------------------------
org $8AEABA
JSL RedrawLoot
NOP
org $8AE42B
JSL FirstDrawLoot
;================================================================================
; Blink indicators of what is left in each room
;--------------------------------------------------------------------------------
org $8AE964
JSL BlinkLoot
org $8AE235
JSL WriteBigEndianAddressX
org $8AE290
JSL WriteBigEndianAddressY
org $8AE350
JSL WriteBigEndianAddressY
org $8AE206
JSL StartDoubleWrite
NOP
org $8AE2E0
JML CheckDoubleWrite
NOP
org $8AE21C
JSL DrawMountain
BRA + : NOP #9 : +
;================================================================================
; Custom Door Rando Maps
;--------------------------------------------------------------------------------
org $8AE590
JSL PrepDrawRow
BRA + : NOP #5 : +
org $8AE5F2
JSR LoadDungeonMapRoomPointer_0A
STA.b $72
org $8AE600
LDA.b [$72], Y
org $8AE634
JSR LoadDungeonMapRoomPointer_0A
STA.b $72
org $8AE63B
LDA.b [$72], Y
org $8AE867
JSR LoadDungeonMapRoomPointer_0A
STA.b $72
org $8AE872
LDA.b [$72], Y
org $8AE8DD
JSR LoadDungeonMapRoomPointer_0A
org $8AE8E4
STA.b $72
org $8AE8F9
LDA.b [$72], Y
org $8AEBC6
JSL GetLocationMarkerLeft
NOP
;================================================================================
; Draw Wacky Door Rando Layouts
;--------------------------------------------------------------------------------
org $8AE3D7
LDA.l DungeonMapMode
BNE .normal
LDA.l DRMode
BEQ .normal
JSL DrawWackyDoorRandoStuff
JMP.w $8AE422
NOP
.normal
warnpc $8AE3EB
org $8AE439
dw $0F19, $4F19, $8F19, $CF19
org $8AE449
dw $0F1A, $8F1A
org $8AE451
dw $0F1B, $4F1B
org $8AE473
NOP #2
org $8AE4A4
NOP #2
org $8AE4DC
NOP #2
org $8AE4F9
dw $0F1E, $0F1F, $0F20, $0F21
dw $0F22, $0F23, $0F24, $0F25
org $8AE539
LDA.w #$0F1C
org $8AE573
LDA.w #$0F1D
org $8AE555
NOP #2
org $8AE576
NOP #2

40
dungeon_map/main.asm Normal file
View File

@@ -0,0 +1,40 @@
pushpc
incsrc hooks.asm
macro WriteGFXSheetPointer(sheet, location)
pushpc
org $80CFC0+<sheet>
db <location>>>16
org $80D09F+<sheet>
db <location>>>8
org $80D17E+<sheet>
db <location>>>0
pullpc
endmacro
%WriteGFXSheetPointer($C9, DungeonMapIcons1)
%WriteGFXSheetPointer($CA, DungeonMapIcons2)
%WriteGFXSheetPointer($D5, DungeonMapIcons3)
%WriteGFXSheetPointer($D4, MapSheetD4)
%WriteGFXSheetPointer($D6, DungeonMapDoorConnectors)
%WriteGFXSheetPointer($61, DungeonMapIcons4)
%WriteGFXSheetPointer($62, DungeonMapIcons5)
%WriteGFXSheetPointer($63, DungeonMapIcons6)
pullpc
incsrc mappable_doors.asm
incsrc current_room_map.asm
incsrc draw_rooms.asm
incsrc map_bg3.asm
incsrc dungeon_switch.asm
incsrc draw_loot.asm
incsrc check_loot.asm
incsrc blink_loot.asm
incsrc data/doors_display.asm
incsrc data/spiral_stairs.asm
incsrc data/fall_warps.asm
incsrc data/split_room.asm

280
dungeon_map/map_bg3.asm Normal file
View File

@@ -0,0 +1,280 @@
LoadStripes:
CPY.b #$09
BEQ .dungeon_map
.not_dungeon_map
LDA.w $80937A, Y
STA.b $00
LDA.w $809383,Y
STA.b $01
LDA.w $80938C,Y
STA.b $02
RTL
.dungeon_map
LDA.l DungeonMapMode
BNE .4x3
LDA.l DRMode
BNE .6x6
.5x5
LDA.b #BG3DungeonMap5x5Stripes>>0
STA.b $00
LDA.b #BG3DungeonMap5x5Stripes>>8
STA.b $01
LDA.b #BG3DungeonMap5x5Stripes>>16
STA.b $02
RTL
.4x3
LDA.b #BG3DungeonMap4x3Stripes>>0
STA.b $00
LDA.b #BG3DungeonMap4x3Stripes>>8
STA.b $01
LDA.b #BG3DungeonMap4x3Stripes>>16
STA.b $02
RTL
.6x6
LDA.b #BG3DungeonMap6x6Stripes>>0
STA.b $00
LDA.b #BG3DungeonMap6x6Stripes>>8
STA.b $01
LDA.b #BG3DungeonMap6x6Stripes>>16
STA.b $02
RTL
LoadLastHUDPalette:
; what we wrote over
JSL $9BEE52
REP #$20
LDA.l MapHUDPalette
STA.l PaletteBuffer+$3A
LDA.l MapHUDPalette+2
STA.l PaletteBuffer+$3C
LDA.l MapHUDPalette+4
STA.l PaletteBuffer+$3E
SEP #$20
RTL
macro VanillaCommonMapStripes()
dw $4260, $0100, $2100
dw $4360, $0E40, $2101
dw $4B60, $0100, $6100
dw $6260, $2EC0, $2110
dw $6B60, $2EC0, $6110
dw $6263, $0100, $A100
dw $6363, $0E40, $A101
dw $6B63, $0100, $E100
dw $8460, $0B00, $2102, $2103, $2104, $2105, $2106, $2107
dw $A460, $0B00, $2112, $2113, $2114, $2115, $2116, $2117
dw $5D60, $0100, $6100
dw $7D60, $2EC0, $6110
dw $7D63, $0100, $E100
dw $0060, $7E40, $2111
dw $8063, $3E41, $2111
dw $0060, $3EC0, $2111
dw $0160, $3EC0, $2111
dw $0C60, $3EC0, $2111
dw $0D60, $3EC0, $2111
dw $1E60, $3EC0, $2111
dw $1F60, $3EC0, $2111
endmacro
BG3DungeonMap5x5Stripes:
%VanillaCommonMapStripes()
; left edge of map border, from vanilla
dw $4E60, $0100, $2100
dw $4F60, $1A40, $2101
dw $6E60, $2EC0, $2110
dw $6E63, $0100, $A100
dw $6F63, $1A40, $A101
; horizontal borders
dw $7260, $1240, $1D11
dw $D261, $1240, $1D11
dw $F261, $1240, $1D11
dw $5263, $1240, $1D11
; vertical borders
dw $7160, $2EC0, $1D11
dw $7C60, $2EC0, $1D11
macro TopOfSquares(start)
; silly Big Endian
db <start>>>8, <start>, $00, $13
dw $5D4C, $1D4C, $5D4C, $1D4C, $5D4C, $1D4C, $5D4C, $1D4C, $5D4C, $1D4C
endmacro
macro BottomOfSquares(start)
; silly Big Endian
db <start>>>8, <start>, $00, $13
dw $DD4C, $9D4C, $DD4C, $9D4C, $DD4C, $9D4C, $DD4C, $9D4C, $DD4C, $9D4C
endmacro
macro FullRow(start)
%TopOfSquares(<start>)
%BottomOfSquares(<start>+$20)
endmacro
; top grid
%FullRow($6092)
%FullRow($60D2)
%FullRow($6112)
%FullRow($6152)
%FullRow($6192)
%FullRow($6212)
%FullRow($6252)
%FullRow($6292)
%FullRow($62D2)
%FullRow($6312)
db $FF
BG3DungeonMap4x3Stripes:
%VanillaCommonMapStripes()
; left edge of map border, adjusted from vanilla
dw $4D60, $0100, $2100
dw $4E60, $1C40, $2101
dw $6D60, $2EC0, $2110
dw $6D63, $0100, $A100
dw $6E63, $1C40, $A101
; horizontal borders
dw $B160, $1440, $1D11
dw $1161, $1440, $1D11
dw $7161, $1440, $1D11
dw $D161, $1440, $1D11
dw $3162, $1440, $1D11
dw $9162, $1440, $1D11
dw $F162, $1440, $1D11
dw $5163, $1440, $1D11
; vertical borders
dw $B060, $12C0, $1D11
dw $BC60, $12C0, $1D11
dw $3062, $12C0, $1D11
dw $3C62, $12C0, $1D11
macro TopOfDoorSquares(start)
; silly Big Endian
db <start>>>8, <start>, $00, $15
dw $5D4C, $1D4C, $1D11, $5D4C, $1D4C, $1D11, $5D4C, $1D4C, $1D11, $5D4C, $1D4C
endmacro
macro BottomOfDoorSquares(start)
; silly Big Endian
db <start>>>8, <start>, $00, $15
dw $DD4C, $9D4C, $1D11, $DD4C, $9D4C, $1D11, $DD4C, $9D4C, $1D11, $DD4C, $9D4C
endmacro
macro FullDoorRow(start)
%TopOfDoorSquares(<start>)
%BottomOfDoorSquares(<start>+$20)
endmacro
; top grid
%FullDoorRow($60D1)
%FullDoorRow($6131)
%FullDoorRow($6191)
%FullDoorRow($6251)
%FullDoorRow($62B1)
%FullDoorRow($6311)
db $FF
BG3DungeonMap6x6Stripes:
; vanilla
dw $4260, $0100, $2100
dw $4360, $0E40, $2101
dw $4B60, $0100, $6100
dw $8460, $0B00, $2102, $2103, $2104, $2105, $2106, $2107
dw $A460, $0B00, $2112, $2113, $2114, $2115, $2116, $2117
dw $0060, $7E40, $2111
dw $8063, $3E41, $2111
dw $0060, $3EC0, $2111
dw $0160, $3EC0, $2111
dw $0C60, $3EC0, $2111
dw $0D60, $3EC0, $2111
dw $1E60, $3EC0, $2111
dw $1F60, $3EC0, $2111
; left side border
dw $6260, $1AC0, $2110
dw $6B60, $1AC0, $6110
dw $2262, $0100, $A100
dw $2362, $0E40, $A101
dw $2B62, $0100, $E100
; right side top area border
dw $4E60, $0100, $2100
dw $4F60, $1A40, $2101
dw $5D60, $0100, $6100
dw $6E60, $1AC0, $2110
dw $7D60, $1AC0, $6110
dw $2E62, $0100, $A100
dw $2F62, $1A40, $A101
dw $3D62, $0100, $E100
; right side bottom area border
dw $8E62, $0100, $2100
dw $8F62, $1A40, $2101
dw $9D62, $0100, $6100
dw $AE62, $06C0, $2110
dw $BD62, $06C0, $6110
dw $2E63, $0100, $A100
dw $2F63, $1A40, $A101
dw $3D63, $0100, $E100
; blank below left side
dw $4262, $4440, $2111
dw $6262, $4440, $2111
dw $8262, $1240, $2111
dw $A262, $1240, $2111
dw $C262, $1240, $2111
dw $E262, $1240, $2111
dw $0263, $1240, $2111
dw $2263, $1240, $2111
dw $4263, $4440, $2111
dw $6263, $4440, $2111
; map area inside top area
dw $6F60, $1A40, $1D11
dw $8F60, $1A40, $1D11
dw $AF60, $1A40, $1D11
dw $CF60, $1A40, $1D11
dw $EF60, $1A40, $1D11
dw $0F61, $1A40, $1D11
dw $2F61, $1A40, $1D11
dw $4F61, $1A40, $1D11
dw $6F61, $1A40, $1D11
dw $8F61, $1A40, $1D11
dw $AF61, $1A40, $1D11
dw $CF61, $1A40, $1D11
dw $EF61, $1A40, $1D11
dw $0F62, $1A40, $1D11
; center square
dw $3561, $0300
dw $5D4C, $1D4C
dw $5561, $0300
dw $DD4C, $9D4C
; map area inside bottom area
dw $AF62, $1A40, $1D11
dw $CF62, $1B00
dw $1D11, $5D4C, $1D4C, $1D11, $5D4C, $1D4C, $1D11, $5D4C, $1D4C, $1D11, $1D11, $5D4C, $1D4C, $1D11
dw $EF62, $1B00
dw $1D11, $DD4C, $9D4C, $1D11, $DD4C, $9D4C, $1D11, $DD4C, $9D4C, $1D11, $1D11, $DD4C, $9D4C, $1D11
dw $0F63, $1A40, $1D11
db $FF

View File

@@ -0,0 +1,474 @@
MapDrawingData:
.floor_data_offset
dw $0000, $0000
dw $0019, $000C
dw $0032, $0018
dw $004B, $0024
dw $0064, $0030
dw $007D, $003C
dw $0096, $0048
dw $00AF, $0054
dw $00C8, $0060
.row_data_offset
dw $0000, $0000
dw $0005, $0004
dw $000A, $0008
dw $000F, $000C
dw $0014, $0010
.corner_tile_address
dw $00E2, $0160
dw $00F8, $0178
dw $03A2, $03A0
dw $03B8, $03B8
.row_tile_address
dw $00E4, $0162
dw $03A4, $03A2
.row_tile_length
dw $0014, $0016
.column_tile_address
dw $0122, $01A0
dw $0138, $01B8
.column_tile_length
dw $0280, $0200
.floor_label_address
dw $035E, $035C
.row_start_address
dw $0124, $01A2
dw $01A4, $0262
dw $0224, $0322
dw $02A4, $03D2
dw $0324, $04A2
.column_count
dw $0005, $0004
.column_spacing
dw $0004, $0006
.row_count
dw $0005, $0003
.bg1_grid_start
dw $1091, $10D1
.sprite_offset_x_base
dw $0090, $0088
.sprite_offset_y_base
dw $001F, $002F
dw $007F, $008F
.entrance_sprite_offset_y_base
dw $0087, $0097
.supertile_pixel_spacing
dw $0010, $0018
.floor_pixel_column_wrap
dw $0040, $0048
.floor_pixel_row_wrap
dw $0040, $0030
CustomMapDrawingData:
.column_wrap
dw $0003
.column_count
dw $0004
.row_wrap
dw $0002
.floor_connection_data_offset
dw $0000
dw $0011
dw $0022
dw $0033
dw $0044
dw $0055
dw $0066
dw $0077
dw $0088
.row_connection_data_offset
dw $0000
dw $0007
dw $000E
dw $0015
macro LDA_MapMode()
LDA.l DungeonMapMode
ASL A
endmacro
macro LDX_MapMode()
%LDA_MapMode()
TAX
endmacro
macro LDY_MapMode()
%LDA_MapMode()
TAY
endmacro
macro ADD_MapMode()
CLC : ADC.l DungeonMapMode
ASL A
TAX
endmacro
macro Map_LDA(addr, label)
pushpc
org <addr>
JSR LDA_<label>
pullpc
if not(defined("LDA_<label>"))
!LDA_<label> = 1
LDA_<label>:
PHX
%LDX_MapMode()
LDA.l MapDrawingData_<label>, X
PLX
RTS
endif
endmacro
macro Map_LDAY(addr, label)
pushpc
org <addr>
JSR LDA_Y_<label>
pullpc
if not(defined("LDA_Y_<label>"))
!LDA_Y_<label> = 1
LDA_Y_<label>:
PHX
TYA
%ADD_MapMode()
LDA.l MapDrawingData_<label>, X
PLX
RTS
endif
endmacro
macro Map_LDAX(addr, label)
pushpc
org <addr>
JSR LDA_X_<label>
pullpc
if not(defined("LDA_X_<label>"))
!LDA_X_<label> = 1
LDA_X_<label>:
PHX
TXA
%ADD_MapMode()
LDA.l MapDrawingData_<label>, X
PLX
RTS
endif
endmacro
macro Map_CMP(addr, label)
pushpc
org <addr>
JSR CMP_<label>
pullpc
if not(defined("CMP_<label>"))
!CMP_<label> = 1
CMP_<label>:
PHX
PHA
%LDX_MapMode()
PLA
CMP.l MapDrawingData_<label>, X
BEQ .z_flag_set
.z_flag_clear
PLX
REP #$02
RTS
.z_flag_set
PLX
SEP #$02
RTS
endif
endmacro
macro Map_ADD(addr, label)
pushpc
org <addr>
JSR ADD_<label>
pullpc
if not(defined("ADD_<label>"))
!ADD_<label> = 1
ADD_<label>:
PHX
PHA
%LDX_MapMode()
PLA
CLC : ADC.l MapDrawingData_<label>, X
PLX
RTS
endif
endmacro
macro Map_ADDY(addr, label)
pushpc
org <addr>
JSR ADD_Y_<label>
pullpc
if not(defined("ADD_Y_<label>"))
!ADD_Y_<label> = 1
ADD_Y_<label>:
PHX
PHA
TYA
%ADD_MapMode()
PLA
CLC : ADC.l MapDrawingData_<label>, X
PLX
RTS
endif
endmacro
pushpc
org $8AE5DA
ADC.b $02 ; swap position of load and add for ease
org $8AE652 ; steal some space from the old map-drawing code we're no longer using
LoadDungeonMapRoomPointer_0A:
JSL LoadDungeonMapRoomPointer
RTS
%Map_LDAY($8AE45F, corner_tile_address)
%Map_LDAY($8AE489, row_tile_address)
%Map_CMP($8AE4B0, row_tile_length)
%Map_LDAY($8AE4C1, column_tile_address)
%Map_CMP($8AE4EA, column_tile_length)
%Map_LDA($8AE54A, floor_label_address)
%Map_LDAX($8AE5D7, row_data_offset)
%Map_LDAY($8AE5F7, floor_data_offset)
%Map_CMP($8AE5A2, row_count)
%Map_CMP($8AE7FA, column_count)
%Map_ADD($8AE896, sprite_offset_x_base)
%Map_ADDY($8AE8B5, sprite_offset_y_base)
%Map_ADD($8AE952, sprite_offset_y_base)
%Map_ADDY($8AEBDB, sprite_offset_y_base)
warnpc $8AE7F6
padbyte $EA
pad $8AE7F6
pullpc
incsrc data/doors_connections.asm
LoadDungeonMapRoomPointer:
LDA.l DungeonMapMode
BEQ .normal
LDA.w #bank(CustomMapPointers)
STA.b $74
LDA.l CustomMapPointers, X
RTL
.normal
LDA.w #bank(DungeonMapRoomPointers)
STA.b $74
LDA.l DungeonMapRoomPointers, X
RTL
PrepDrawRow:
%ADD_MapMode()
LDA.l MapDrawingData_row_start_address, X
CLC : ADC.b $06
AND.w #$0FFF
TAX
LDA.l DungeonMapMode
BEQ .done
JSR DrawRowOfRoomConnections
.done
RTL
ClearAdjacentConnections:
; Left
LDA.b $02
BEQ +
LDA.b $0E
BIT.w #$000A
BNE +
LDA.w #$0F00
STA.l $7F0000-$02, X
STA.l $7F0040-$02, X
+
; Top
LDA.b $00
BEQ +
LDA.b $0E
BIT.w #$000C
BNE +
LDA.w #$0F00
STA.l $7F0000-$40, X
STA.l $7F0002-$40, X
+
; Right
LDA.b $02
CMP.l CustomMapDrawingData_column_wrap
BCS +
LDA.b $0E
BIT.w #$0005
BNE +
LDA.w #$0F00
STA.l $7F0000+$04, X
STA.l $7F0040+$04, X
+
; Bottom
LDA.b $00
CMP.l CustomMapDrawingData_row_wrap
BCS +
LDA.b $0E
BIT.w #$0003
BNE +
LDA.w #$0F00
STA.l $7F0000+$80, X
STA.l $7F0002+$80, X
+
RTL
DrawRowOfRoomConnections:
PHB : PHK : PLB
PHX
LDX.w DungeonID
LDA.l DoorConnectionPointers, X
STA.b $04
LDA.l DungeonMapFloorCountData, X
AND.w #$000F
CLC : ADC.w DungeonMapCurrentFloor
AND.w #$00FF
ASL A
TAX
LDA.l CustomMapDrawingData_floor_connection_data_offset, X
CLC : ADC.b $04
STA.b $04
LDA.b $00
ASL A
TAX
LDA.l CustomMapDrawingData_row_connection_data_offset, X
CLC : ADC.b $04
STA.b $04
STZ.b $02
PLX : PHX
LDY.w #$0000
.next_horizontal
LDA.b ($04), Y
AND.w #$00FF
JSR DrawHorizontalConnector
INY
INX #6
INC.b $02
LDA.b $02
CMP.l CustomMapDrawingData_column_wrap
BCC .next_horizontal
LDA.b $00
CMP.l CustomMapDrawingData_row_wrap
BCS .done
PLX : PHX
STZ.b $02
.next_vertical
LDA.b ($04), Y
AND.w #$00FF
JSR DrawVerticalConnector
INY
INX #6
INC.b $02
LDA.b $02
CMP.l CustomMapDrawingData_column_count
BCC .next_vertical
.done
PLX
PLB
RTS
; A = connector index
; X = address
DrawHorizontalConnector:
PHY
ASL A : ASL A
TAY
LDA.w DoorConnectionTiles+0, Y
BEQ +
ORA.w #$1404
STA.l $7F0004, X
+
LDA.w DoorConnectionTiles+2, Y
BEQ +
ORA.w #$1404
STA.l $7F0044, X
+
PLY
RTS
; A = connector index
; X = address
DrawVerticalConnector:
PHY
ASL A : ASL A
TAY
LDA.w DoorConnectionTiles+0, Y
BEQ +
ORA.w #$1400
STA.l $7F0080, X
+
LDA.w DoorConnectionTiles+2, Y
BEQ +
ORA.w #$1400
STA.l $7F0082, X
+
PLY
RTS
GetLocationMarkerLeft:
LDA.b LinkQuadrantH
BEQ +
LDA.b #$F8
+
CLC : ADC.w $0215
AND.b #$F8
RTL

208
dungeon_map/settings.asm Normal file
View File

@@ -0,0 +1,208 @@
; $B9F000
SupertileRoomShapes:
incsrc data/supertile_shapes.asm
warnpc $B9F800
padbyte $FF
pad $B9F800
org $B9F800
DungeonMapData:
db $02, $04, $00, $00 ; Sewers
db $1A, $00, $00, $00 ; Hyrule Castle
db $00, $06, $00, $00 ; Eastern Palace
db $04, $14, $00, $00 ; Desert Palace
db $14, $0C, $01, $00 ; Castle Tower
db $0C, $10, $00, $00 ; Swamp Palace
db $08, $0A, $00, $00 ; Palace of Darkness
db $12, $18, $00, $00 ; Misery Mire
db $0A, $16, $FF, $00 ; Skull Woods
db $16, $0E, $00, $00 ; Ice Palace
db $06, $08, $01, $00 ; Tower of Hera
db $10, $12, $00, $00 ; Thieves Town
db $0E, $1A, $00, $00 ; Turtle Rock
db $18, $02, $01, $00 ; Ganon's Tower
db $1A, $02, $00, $00 ; Extra
db $1A, $02, $00, $00 ; Extra
struct DungeonMapData DungeonMapData
.prev: skip 1
.next: skip 1
.floor: skip 1
.unused: skip 1
endstruct
warnpc $B9F840
org $B9F840
DoorConnectionPointers:
skip $20
warnpc $B9F860
org $B9F860
CustomMapPointers:
skip $20
warnpc $B9F880
org $B9F880
LootTypeIcons:
dw $0B00, $0B00, $0B00, $0B00 ; 00 - nothing
dw $2DCB, $6DCB, $ADCB, $EDCB ; 01 - unknown - dot
dw $29EB, $69EB, $29FB, $69FB ; 02 - junk - pot
dw $29CA, $69CA, $29DA, $29DB ; 03 - small key
dw $29E9, $69E9, $29F9, $69F9 ; 04 - triforce piece
dw $29DD, $69DD, $A9DD, $E9DD ; 05 - safety - plus
dw $29EC, $69EC, $29FC, $69FC ; 06 - less important item - small chest
dw $29CE, $29CF, $29DE, $29DF ; 07 - map
dw $29E8, $69E8, $29F8, $69F8 ; 08 - compass
dw $29CA, $69CA, $29DA, $29DB ; 09 - small key
dw $29C8, $69C8, $29D8, $29D9 ; 0A - big key
dw $29ED, $69ED, $29FD, $69FD ; 0B - important inventory item - big chest
dw $29CC, $29CD, $29DC, $69DC ; 0C - pendant
dw $2DC9, $69C9, $A9C9, $EDC9 ; 0D - crystal
dw $29E9, $69E9, $29F9, $69F9 ; 0E - triforce piece
dw $29EA, $69EA, $29EB, $69EB ; 0F - triforce
warnpc $B9F900
org $B9F900
LootTypeMapping:
incsrc data/item_mapping.asm
warnpc $B9FA00
org $B9FA00
; Room ID mappings to bit to check for presence and address of item drop
MiscLocations:
dw $00C8 : db $04 : dl HeartContainer_ArmosKnights
dw $0033 : db $04 : dl HeartContainer_Lanmolas
dw $0007 : db $04 : dl HeartContainer_Moldorm
dw $005A : db $04 : dl HeartContainer_HelmasaurKing
dw $0006 : db $04 : dl HeartContainer_Arrghus
dw $0029 : db $04 : dl HeartContainer_Mothula
dw $00AC : db $04 : dl HeartContainer_Blind
dw $00DE : db $04 : dl HeartContainer_Kholdstare
dw $0090 : db $04 : dl HeartContainer_Vitreous
dw $00A4 : db $04 : dl HeartContainer_Trinexx
dw $0073 : db $05 : dl BonkKey_Desert ; torch
dw $008C : db $05 : dl BonkKey_GTower ; torch
dw $0087 : db $05 : dl StandingKey_Hera
dw $FFFF : db $FF : dl $FFFFFF ; Placeholders
dw $FFFF : db $FF : dl $FFFFFF
dw $FFFF : db $FF : dl $FFFFFF ; Aga 1? ($0020)
dw $FFFF : db $FF : dl $FFFFFF ; Ice Armos? ($001C)
dw $FFFF : db $FF : dl $FFFFFF ; Lanmolas 2? ($0033)
dw $FFFF : db $FF : dl $FFFFFF ; Moldorm 2? ($004D)
dw $FFFF : db $FF : dl $FFFFFF ; Aga 2? ($000D)
dw $FFFF
warnpc $B9FA9A
org $B9FA9A
MapHUDPalette:
dw $0000, $3ED8, $2E54
warnpc $B9FAA0
org $B9FAA0
PrizeLocations:
dw $00C8 : db $02 ; Armos Knights
dw $0033 : db $03 ; Lanmolas
dw $0006 : db $05 ; Arrghus
dw $005A : db $06 ; Helmasaur King
dw $0090 : db $07 ; Vitreous
dw $0029 : db $08 ; Mothula
dw $00DE : db $09 ; Kholdstare
dw $0007 : db $0A ; Moldorm
dw $00AC : db $0B ; Blind
dw $00A4 : db $0C ; Trinexx
dw $FFFF
warnpc $B9FAC0
org $B9FAC0
SupertileEntrances:
incsrc data/entrance_tiles.asm
warnpc $B9FB00
padbyte $FF
pad $B9FB00
; $B9FB00
DungeonLabels:
dw $2550, $2579 ; Sewers
dw $2564, $255F ; Hyrule Castle
dw $2561, $256C ; Eastern Palace
dw $2560, $256C ; Desert Palace
dw $255D, $2570 ; Agahnim's Tower
dw $256F, $256C ; Swamp Palace
dw $256C, $2560 ; Palace of Darkness
dw $2569, $2569 ; Misery Mire
dw $256F, $2573 ; Skull Woods
dw $2565, $256C ; Ice Palace
dw $2570, $2564 ; Tower of Hera
dw $2570, $2570 ; Thieves' Town
dw $2570, $256E ; Turtle Rock
dw $2563, $2570 ; Ganon's Tower
dw $25A4, $25A4 ; Reserved
dw $25A4, $25A4 ; Reserved
; $B9FB40
warnpc $B9FF00
org $B9FF00
; $00 - do not show anything
; $01 - show presence of supertile as dark square
; $02 - show presence of quadrants as dark squares
; $03 - show outline of shape with walls but no interior details (palette 5)
; $04 - show dark with stairs but no hole/internal walls (palette 4)
; $05 - show mostly lit with stairs and holes/internal walls (palette 3)
; $06 - show fully lit with stairs and holes/internal walls (palette 2)
ShowRooms:
.default
db $02
.have_map
db $05
.have_compass
db $03
.visited_tile
db $04
.reserved
skip 4
warnpc $B9FF08
org $B9FF08
; $00 - do not show anything
; $01 - show presence of unobtained items
; $02 - show category of item
ShowItems:
.default
db $00
.have_map
db $00
.have_compass
db $02
.visited_tile
db $01
.reserved
skip 4
warnpc $B9FF10
org $B9FF10
; ---P bepc
; P - dungeon prizes
; b - bosses (and torches in GT and desert, plus hera basement standing item)
; e - enemy drops
; p - pots
; c - chests
ItemSources:
db $09
; $B9FF11
AlwaysShowCompass:
db $01
; $B9FF12
; $0000 - vanilla 5x5 maps
; $0001 - special DR 4x3 maps
DungeonMapMode:
dw $0000

View File

@@ -11,6 +11,7 @@ Sprite_ResetAll: ; Bank09.asm(1344)
;================================================================================ ;================================================================================
; On Room Transition -> Move Sprite depending on the room loaded ; On Room Transition -> Move Sprite depending on the room loaded
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
if not(!FEATURE_FIX_BASEROM)
org $828979 ; JSL Dungeon_ResetSprites ; REPLACE THAT (Sprite initialization) original jsl : $09C114 org $828979 ; JSL Dungeon_ResetSprites ; REPLACE THAT (Sprite initialization) original jsl : $09C114
JSL boss_move JSL boss_move
org $828C16 ; JSL Dungeon_ResetSprites ; REPLACE THAT (Sprite initialization) original jsl : $09C114 org $828C16 ; JSL Dungeon_ResetSprites ; REPLACE THAT (Sprite initialization) original jsl : $09C114
@@ -19,6 +20,7 @@ org $829338 ; JSL Dungeon_ResetSprites ; REPLACE THAT (Sprite initialization) o
JSL boss_move JSL boss_move
org $828256 ; JSL Dungeon_ResetSprites ; REPLACE THAT (Sprite initialization) original jsl : $09C114 org $828256 ; JSL Dungeon_ResetSprites ; REPLACE THAT (Sprite initialization) original jsl : $09C114
JSL boss_move JSL boss_move
endif
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------

View File

@@ -61,7 +61,3 @@ LDA.b [Scrap00],Y
org $89C416 org $89C416
LDA.b [Scrap00],Y LDA.b [Scrap00],Y

View File

@@ -1,6 +1,7 @@
LoadUnderworldSprites: LoadUnderworldSprites:
STA.b Scrap00 ; part one of what we replaced STA.b Scrap00 ; part one of what we replaced
LDA.w #UWSpritesData>>16 : STA.b Scrap02 ; set the bank to 28 for now LDA.w #UWSpritesData>>16 ; set the bank to 28 for now
STA.b Scrap02
LDA.w $048E LDA.w $048E
RTL RTL

View File

@@ -217,18 +217,37 @@ OnInitFileSelect:
JSL EnableForceBlank JSL EnableForceBlank
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
OnGloomDamage:
LDA.b #$01
STA.l UpdateHUDFlag
LDA.l MaximumHealth
SEC : SBC.b #$08
STA.l CurrentHealth
BEQ +
STA.l MaximumHealth
+ RTL
;--------------------------------------------------------------------------------
OnLinkDamaged: OnLinkDamaged:
JSL IncrementDamageTakenCounter_Arb JSL IncrementDamageTakenCounter_Arb
LDA.l ChallengeModes : AND.b #$03 : CMP.b #$02 : BEQ .gloom
JML OHKOTimer JML OHKOTimer
.gloom
STZ.b $00
JML OnGloomDamage
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
;OnEnterWater: ;OnEnterWater:
; JSL UnequipCapeQuiet ; what we wrote over ; JSL UnequipCapeQuiet ; what we wrote over
;RTL ;RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
OnLinkDamagedFromPit: OnLinkDamagedFromPit:
LDA.l ChallengeModes : AND.b #$03 : CMP.b #$02 : BEQ .gloom
JSL OHKOTimer JSL OHKOTimer
BRA +
.gloom
JSL OnGloomDamage
CLC : ADC.b #$08 : STA.l CurrentHealth
LDA.l AllowAccidentalMajorGlitch + LDA.l AllowAccidentalMajorGlitch
BEQ ++ BEQ ++
-- LDA.b #$14 : STA.b GameSubMode ; thing we wrote over -- LDA.b #$14 : STA.b GameSubMode ; thing we wrote over
@@ -240,7 +259,12 @@ OnLinkDamagedFromPit:
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
OnLinkDamagedFromPitOutdoors: OnLinkDamagedFromPitOutdoors:
LDA.l ChallengeModes : AND.b #$03 : CMP.b #$02 : BEQ .gloom
JML OHKOTimer ; make sure this is last JML OHKOTimer ; make sure this is last
.gloom
JSL OnGloomDamage
CLC : ADC.b #$08
RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
OnOWTransition: OnOWTransition:
JSL FloodGateReset JSL FloodGateReset
@@ -253,6 +277,7 @@ OnOWTransition:
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
OnLoadDuckMap: OnLoadDuckMap:
JSL SelectFirstFluteSpot
LDA.l DuckMapFlag LDA.l DuckMapFlag
BNE + BNE +
INC : STA.l DuckMapFlag INC : STA.l DuckMapFlag

View File

@@ -248,8 +248,12 @@ DrawPlayerFileShared:
; Flute ; Flute
LDA.l InventoryTrackingSRAM : AND.w #$0003 : BEQ + LDA.l InventoryTrackingSRAM : AND.w #$0003 : BEQ +
LDA.l $7003C2 : AND.w #$00FF : BNE .pseudo
%fs_drawItem(7,16,FileSelectItems_flute) %fs_drawItem(7,16,FileSelectItems_flute)
BRA ++ BRA ++
.pseudo
%fs_drawItem(7,16,FileSelectItems_flute_green)
BRA ++
+ +
%fs_drawItemGray(7,16,FileSelectItems_flute) %fs_drawItemGray(7,16,FileSelectItems_flute)
++ ++
@@ -539,6 +543,8 @@ FileSelectItems:
dw #$0264|!FS_COLOR_BROWN, #$0265|!FS_COLOR_BROWN, #$0274|!FS_COLOR_BROWN, #$0275|!FS_COLOR_BROWN dw #$0264|!FS_COLOR_BROWN, #$0265|!FS_COLOR_BROWN, #$0274|!FS_COLOR_BROWN, #$0275|!FS_COLOR_BROWN
.flute .flute
dw #$0266|!FS_COLOR_BLUE, #$0267|!FS_COLOR_BLUE, #$0276|!FS_COLOR_BLUE, #$0277|!FS_COLOR_BLUE dw #$0266|!FS_COLOR_BLUE, #$0267|!FS_COLOR_BLUE, #$0276|!FS_COLOR_BLUE, #$0277|!FS_COLOR_BLUE
.flute_green
dw #$0266|!FS_COLOR_GREEN, #$0267|!FS_COLOR_GREEN, #$0276|!FS_COLOR_GREEN, #$0277|!FS_COLOR_GREEN
.book .book
dw #$026A|!FS_COLOR_GREEN, #$026B|!FS_COLOR_GREEN, #$027A|!FS_COLOR_GREEN, #$027B|!FS_COLOR_GREEN dw #$026A|!FS_COLOR_GREEN, #$026B|!FS_COLOR_GREEN, #$027A|!FS_COLOR_GREEN, #$027B|!FS_COLOR_GREEN
.redcane .redcane

29
gloom.asm Normal file
View File

@@ -0,0 +1,29 @@
AdjustDefaultGraphics:
JSL $80E310
LDA.l ChallengeModes : AND.b #$03 : CMP.b #$02 : BEQ .gloom
RTL
.gloom
LDA.b #$80
STA.w $2115
REP #$20
LDA.w #$7500
STA.w $2116
LDY.b #SkullGfx_end-SkullGfx
LDX.b #$00
- LDA.l SkullGfx, X
STA.w $2118
INX #2
DEY #2
BNE -
SEP #$20
RTL
SkullGfx:
incbin "data/skull.bin"
.end

View File

@@ -840,10 +840,10 @@ JSL LoadModifiedIceFloorValue_a01 : NOP
org $83FC16 ; <- 1FC16 ($A8, $B8, $3D, $D0, $B8, $3D) org $83FC16 ; <- 1FC16 ($A8, $B8, $3D, $D0, $B8, $3D)
db $B1, $C6, $F9, $C9, $C6, $F9 ; data insert - 2 chests, fat fairy room db $B1, $C6, $F9, $C9, $C6, $F9 ; data insert - 2 chests, fat fairy room
; unused item receipts ; unused item receipts - moved to pyramid fairy
org $81E97E org $81E97E
dw $0116 : db $08 dw $0116 : db $5E
dw $0116 : db $25 dw $0116 : db $64
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $86B489 ; <- 33489 - sprite_smithy_bros.asm : 473 (LDA $7EF359 : CMP.b #$03 : BCS .tempered_sword_or_better) org $86B489 ; <- 33489 - sprite_smithy_bros.asm : 473 (LDA $7EF359 : CMP.b #$03 : BCS .tempered_sword_or_better)
JML GetSmithSword : NOP #4 JML GetSmithSword : NOP #4
@@ -2182,6 +2182,9 @@ JSL LampCheck
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $81F503 ; <- F503 - Bank01.asm:14994 (LDA.b #$01 : STA $1D) org $81F503 ; <- F503 - Bank01.asm:14994 (LDA.b #$01 : STA $1D)
JSL SetOverlayIfLamp JSL SetOverlayIfLamp
;--------------------------------------------------------------------------------
org $81B610 ; <- loading whether room is dark
JSL DarkRoomCheck
;================================================================================ ;================================================================================
;================================================================================ ;================================================================================
@@ -2726,5 +2729,92 @@ NOP #2 ; this fixes Link's direction after mirroring and falling after entering
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; Enable new room header table ; Enable new room header table
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
if not(!FEATURE_FIX_BASEROM)
org $81B5E6 org $81B5E6
LDA.b #$30 LDA.b #$30
endif
;================================================================================
;--------------------------------------------------------------------------------
; Mimic dash changes
;--------------------------------------------------------------------------------
org $9EC7BE
JSL MimicDirection
;================================================================================
;--------------------------------------------------------------------------------
; Gloom VRAM overwrite
;--------------------------------------------------------------------------------
org $828068
JSL AdjustDefaultGraphics
;================================================================================
; Special Weapons Modes
;--------------------------------------------------------------------------------
org $86ECC3 ; Bank06.asm@4704 (PHX : TAX : LDA.l .damage_classes, X : PLX)
JSL DamageClassCalc
BRA + : NOP #29 : +
;--------------------------------------------------------------------------------
org $86ED94 ; Bank06.asm@4866 (LDA $0E60, X : AND.b #$40)
JSL Utility_CheckImpervious
NOP
;--------------------------------------------------------------------------------
;================================================================================
;--------------------------------------------------------------------------------
; Variable Ganon Vulnerability
;--------------------------------------------------------------------------------
org $88BBD4 ; ancilla_magic_powder.asm@253 (LDA #$0A : JSL Ancilla_CheckSpriteDamage.preset_class)
JSL Ganon_CheckPowderVulnerability
NOP #2
org $1D8F4E ; sprite_ganon.asm@325 (LDA $04C5 : CMP #$02)
JSL Ganon_CheckInvincible
NOP
org $0DD628 ; Bank0D.asm@1266 (LDA $0B6B, Y : AND #$02)
JSL CheckBeeBoss
NOP
org $0DD677 ; Bank0D.asm@1303 (JSL Ancilla_CheckSpriteDamage.preset_class)
JSL Ganon_CheckBeeVulnerability
;--------------------------------------------------------------------------------
;================================================================================
; PseudoFlute
;--------------------------------------------------------------------------------
org $8AB7D5 ; bank_0A.asm@5655 (DEC.w $1AF0 : LDA.b #$20 : STA.w $012F)
JSL SelectFlutePrev
BRA + : NOP #2 : +
;--------------------------------------------------------------------------------
org $8AB7E3 ; bank_0A.asm@5665 (INC.w $1AF0 : LDA.b #$20 : STA.w $012F)
JSL SelectFluteNext
BRA + : NOP #2 : +
;--------------------------------------------------------------------------------
org $8AB877 ; bank_0A.asm@5758 (STA.b $0C : LDA.b #$00 : STA.b $0B)
JSL SetFluteSpotPalette
NOP #2
;--------------------------------------------------------------------------------
org $8AB8BF ; bank_0A.asm@5800 (STA.b $0C : LDA.b #$00 : STA.b $0B)
JSL SetFluteSpotPalette
NOP #2
;--------------------------------------------------------------------------------
org $82AFBE ; bank_02.asm@8776 (LDA.l $7EC213 : STA.b $8A)
JSL CheckEnterOverworld
NOP #2
;--------------------------------------------------------------------------------
org $82A9A1 ; bank_02.asm@7655 (STA.b $8A : STA.w $040A)
JSL CheckTransitionOverworld
NOP
;--------------------------------------------------------------------------------
org $8DF741
dw $3CD4, $3CD5, $3CE4, $3CE5
;--------------------------------------------------------------------------------
org $8DE58E ; bank_0D.asm@15401 (AND.w #$00FF : STA.b $02)
JSL DrawFluteIcon
NOP
;--------------------------------------------------------------------------------
org $8DFB63 ; bank_0D.asm@18092 (LDA.l $7EF33F, X : AND.w #$00FF)
JSL CheckFluteInHUD
NOP #3
;--------------------------------------------------------------------------------

View File

@@ -114,7 +114,10 @@ StartingGenericKeys: skip 1 ; PC 0x18338B
InitInventoryTracking: skip 2 ; PC 0x18338C \ Need to set bits here for silver arrows, InitInventoryTracking: skip 2 ; PC 0x18338C \ Need to set bits here for silver arrows,
InitBowTracking: skip 2 ; PC 0x18338E / boomerangs, powder/mushroom, etc InitBowTracking: skip 2 ; PC 0x18338E / boomerangs, powder/mushroom, etc
InitItemLimitCounts: skip 16 ; PC 0x183390 InitItemLimitCounts: skip 16 ; PC 0x183390
skip 37 ; skip 34 ;
InitFluteBitfield: db $00 ;
InitSpecialWeaponLevel: db $00 ;
InitItemOnB: db $00 ;
InitProgressIndicator: db $02 ; PC 0x1833C5 - Set to $80 for instant post-aga with standard InitProgressIndicator: db $02 ; PC 0x1833C5 - Set to $80 for instant post-aga with standard
InitProgressFlags: db $14 ; PC 0x1833C6 - Set to $00 for standard InitProgressFlags: db $14 ; PC 0x1833C6 - Set to $00 for standard
InitMapIcons: skip 1 ; PC 0x1833C7 InitMapIcons: skip 1 ; PC 0x1833C7

View File

@@ -809,7 +809,13 @@ PEA.w $C567 ; SNES to RTS to in bank 08
LDA.w AncillaGet, X : CMP.b #$4A : BNE + LDA.w AncillaGet, X : CMP.b #$4A : BNE +
; collecting pre-activated flute ; collecting pre-activated flute
LDA.b #$13 : JML Ancilla_SFX2_Near LDA.b #$13 : JML Ancilla_SFX2_Near
+ ; normal itemget sfx + ; not pre-activated flute
JSL.l ItemIsJunk : BEQ .normal
.junk
LDA.b #$3B : JML Ancilla_SFX3_Near ; what we wrote over
.normal
LDA.b #$0F : JML Ancilla_SFX3_Near ; what we wrote over LDA.b #$0F : JML Ancilla_SFX3_Near ; what we wrote over
; A = item id being collected ; A = item id being collected
@@ -818,6 +824,13 @@ CPY.b #$4A : BNE +
JSL Sound_SetSfxPanWithPlayerCoords : ORA.b #$13 : STA.w SFX2 JSL Sound_SetSfxPanWithPlayerCoords : ORA.b #$13 : STA.w SFX2
RTL RTL
+ ; normal itemget sfx + ; normal itemget sfx
JSL.l ItemIsJunk : BEQ .normal
.junk
JSL Sound_SetSfxPanWithPlayerCoords : ORA.b #$3B : STA.w SFX3
RTL
.normal
JSL Sound_SetSfxPanWithPlayerCoords : ORA.b #$0F : STA.w SFX3 ; what we wrote over JSL Sound_SetSfxPanWithPlayerCoords : ORA.b #$0F : STA.w SFX3 ; what we wrote over
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------

View File

@@ -91,13 +91,25 @@ InitializeMirrorHDMA:
org $89D62E org $89D62E
UWSpritesPointers: ; 0x250 bytes for 0x128 rooms' 16-bit pointers UWSpritesPointers: ; 0x250 bytes for 0x128 rooms' 16-bit pointers
if !FEATURE_FIX_BASEROM
org $81DB67
else
org $89D87E org $89D87E
endif
UWPotsPointers: ; 0x250 bytes for 0x128 rooms' 16-bit pointers UWPotsPointers: ; 0x250 bytes for 0x128 rooms' 16-bit pointers
if !FEATURE_FIX_BASEROM
org $01DDE7
else
org $89DACE org $89DACE
endif
UWPotsData: ; variable number of bytes (max 0x11D1) for all pots data UWPotsData: ; variable number of bytes (max 0x11D1) for all pots data
if !FEATURE_FIX_BASEROM
org $89D92E
else
org $A88000 org $A88000
endif
UWSpritesData: ; variable number of bytes (max 0x2800) for all sprites and sprite drop data UWSpritesData: ; variable number of bytes (max 0x2800) for all sprites and sprite drop data
; First $2800 bytes of this bank (28) is reserved for the sprite tables ; First $2800 bytes of this bank (28) is reserved for the sprite tables

View File

@@ -5,14 +5,31 @@
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
LampCheck: LampCheck:
LDA.l LightConeModifier : BNE .lamp LDA.l LightConeModifier : BNE .lamp
LDA.l LampCone : AND.b #$10 : BNE .lamp ; always on
LDA.l LampEquipment : BNE .lamp ; skip if we already have lantern LDA.l LampEquipment : BNE .lamp ; skip if we already have lantern
LDA.l LampCone : AND.b #$10 : BNE .lamp
LDA.w DungeonID : CMP.b #$04 : BCS + ; are we en HC? LDA.w DungeonID : CMP.b #$04 : BCS + ; are we en HC?
LDA.l LampCone : RTL LDA.l LampCone : AND.b #$01 : RTL
+ : TDC + : TDC
.lamp .lamp
RTL RTL
;================================================================================ ;================================================================================
; Dark Room checks
;--------------------------------------------------------------------------------
; Output: 0 for normal room, 1 for darkness
;--------------------------------------------------------------------------------
DarkRoomCheck:
LDA.l LampCone : AND.b #$20 : BNE .no_dark
LDA.b [$0D], Y
AND.b #$01
RTL
.no_dark
LDA.b $A0 : ORA.b $A1 : BNE .not_dark
LDA.b #$01 ; ganon's room
RTL
.not_dark
LDA.b #$00 ; not ganon's room, so no darkness
RTL
;================================================================================
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; Output: 0 locked, 1 open ; Output: 0 locked, 1 open
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
@@ -26,6 +43,10 @@ RTL
;================================================================================ ;================================================================================
SetOverlayIfLamp: SetOverlayIfLamp:
JSL LampCheck JSL LampCheck
CMP.b #$00
BEQ +
LDA.b #$01
+
STA.b SUBDESQ ; write it directly to the overlay, this isn't a terrible idea at all STA.b SUBDESQ ; write it directly to the overlay, this isn't a terrible idea at all
RTL RTL
;================================================================================ ;================================================================================

BIN
menu/door_connectors.3bpp Normal file

Binary file not shown.

BIN
menu/door_connectors.3bppc Normal file

Binary file not shown.

BIN
menu/dr_sheet_dc.2bpp Normal file

Binary file not shown.

BIN
menu/dr_sheet_dc.2bppc Normal file

Binary file not shown.

Binary file not shown.

BIN
menu/map_icons.3bpp Normal file

Binary file not shown.

BIN
menu/map_icons.dat Normal file

Binary file not shown.

BIN
menu/map_icons.pal Normal file

Binary file not shown.

BIN
menu/map_icons_1.3bppc Normal file

Binary file not shown.

BIN
menu/map_icons_2.3bppc Normal file

Binary file not shown.

BIN
menu/map_icons_3.3bppc Normal file

Binary file not shown.

BIN
menu/map_icons_4.3bppc Normal file

Binary file not shown.

BIN
menu/map_icons_5.3bppc Normal file

Binary file not shown.

BIN
menu/map_icons_6.3bppc Normal file

Binary file not shown.

BIN
menu/map_icons_b.3bpp Normal file

Binary file not shown.

BIN
menu/map_sheet_d4.3bpp Normal file

Binary file not shown.

BIN
menu/map_sheet_d4.3bppc Normal file

Binary file not shown.

22
mimicdash.asm Normal file
View File

@@ -0,0 +1,22 @@
;================================================================================
; Mimic Direction Check
;--------------------------------------------------------------------------------
; Output: 0 for darkness, 1 for lamp cone
;--------------------------------------------------------------------------------
MimicDirection:
LDA.b $F0
AND.b #$0F
BNE .done
LDA.l MimicDash
BEQ .done
LDA.w $0372
BEQ .done
LDA.w $0374
BNE .make_zero
LDA.b $67
.done
RTL
.make_zero
LDA.b #$00
RTL

View File

@@ -23,8 +23,14 @@ NewHUD_DrawBombs:
BRA .draw BRA .draw
.finite .finite
LDA.w BombCapacity : BEQ .no_bomb_bag
LDA.w BombsEquipment LDA.w BombsEquipment
JSR HUDHex2Digit JSR HUDHex2Digit
BRA .draw
.no_bomb_bag
LDY.w #!BlankTile
TYX
.draw .draw
STY.w HUDBombCount+0 STY.w HUDBombCount+0
@@ -150,10 +156,19 @@ NewHUD_DrawPrizeIcon:
SEP #$20 SEP #$20
LDA.b GameMode LDA.b GameMode
CMP.b #$12 : BEQ .no_prize CMP.b #$12 : BEQ .no_prize
CMP.b #$0E : BEQ + CMP.b #$0E : BNE .check_hud_flag
LDA.b GameSubMode
CMP.b #$03 : BNE .check_dungeon
LDA.w SubModuleInterface
CMP.b #$06 : BNE .check_hud_flag
LDA.l $7EC22A
BRA .know_dungeon
.check_hud_flag
LDA.l UpdateHUDFlag : BEQ NewHUD_DrawItemCounter LDA.l UpdateHUDFlag : BEQ NewHUD_DrawItemCounter
+ .check_dungeon
LDA.w DungeonID LDA.w DungeonID
.know_dungeon
CMP.b #$1A : BCS .no_prize CMP.b #$1A : BCS .no_prize
CMP.b #$04 : BCC .no_prize CMP.b #$04 : BCC .no_prize
CMP.b #$08 : BNE .dungeon CMP.b #$08 : BNE .dungeon
@@ -445,6 +460,15 @@ HUDHex4Digit_Long:
REP #$20 REP #$20
RTL RTL
;================================================================================
ClearHearts:
LDA.w #!BlankTile
LDX.b #$14
- STA.l HUDTileMapBuffer+$066, X
STA.l HUDTileMapBuffer+$0A6, X
DEX #2
BPL -
RTS
;================================================================================ ;================================================================================
UpdateHearts: UpdateHearts:
PHB PHB
@@ -455,6 +479,22 @@ UpdateHearts:
PHX PHX
PLB PLB
; OHKO mode
LDA.l ChallengeModes : AND.w #$0003 : CMP.w #$0001 : BNE +
LDA.w #$240A
STA.l HUDTileMapBuffer+$068
INC
STA.l HUDTileMapBuffer+$06A
INC
STA.l HUDTileMapBuffer+$06C
JMP .skip_partial
+
; Gloom mode
LDA.l ChallengeModes : AND.w #$0003 : CMP.w #$0002 : BNE +
JSR ClearHearts
+
LDA.w MaximumHealth LDA.w MaximumHealth
LSR LSR
LSR LSR

View File

@@ -188,10 +188,12 @@ ItemBehavior:
BRA .store_inventory_tracking BRA .store_inventory_tracking
.flute_inactive .flute_inactive
LDA.b #$00 : STA.l FluteBitfield
LDA.l InventoryTracking : ORA.b #$02 LDA.l InventoryTracking : ORA.b #$02
BRA .store_inventory_tracking BRA .store_inventory_tracking
.flute_active .flute_active
LDA.b #$00 : STA.l FluteBitfield
LDA.l InventoryTracking : ORA.b #$01 LDA.l InventoryTracking : ORA.b #$01
BRA .store_inventory_tracking BRA .store_inventory_tracking

View File

@@ -320,6 +320,7 @@ OWLightWorldOrCrossed:
OWFluteCancel: OWFluteCancel:
{ {
lda.l FluteBitfield : cmp.b #$FF : beq +
lda.l OWFlags+1 : and.b #$01 : bne + lda.l OWFlags+1 : and.b #$01 : bne +
jsl FluteMenu_LoadTransport : rtl jsl FluteMenu_LoadTransport : rtl
+ lda.w RandoOverworldTargetEdge : bne + + lda.w RandoOverworldTargetEdge : bne +
@@ -331,8 +332,10 @@ OWFluteCancel2:
lda.b Joy1B_All : ora.b Joy1A_All : and.b #$c0 : bne + lda.b Joy1B_All : ora.b Joy1A_All : and.b #$c0 : bne +
jml FluteMenu_HandleSelection_NoSelection jml FluteMenu_HandleSelection_NoSelection
+ inc.w SubModuleInterface + inc.w SubModuleInterface
lda.l FluteBitfield : cmp.b #$FF : beq .cancel
lda.l OWFlags+1 : and.b #$01 : beq + lda.l OWFlags+1 : and.b #$01 : beq +
lda.b Joy1B_All : cmp.b #$40 : bne + lda.b Joy1B_All : cmp.b #$40 : bne +
.cancel
lda.b #$01 : sta.w RandoOverworldTargetEdge lda.b #$01 : sta.w RandoOverworldTargetEdge
+ rtl + rtl
} }

150
pseudoflute.asm Normal file
View File

@@ -0,0 +1,150 @@
SelectFirstFluteSpot:
LDA.l FluteBitfield
CMP.b #$FF
BNE +
RTL
+ LDA.b #$07
STA.w FluteSelection
.try_next
LDA.w FluteSelection
INC A
AND.b #$07
STA.w FluteSelection
TAX
LDA.l FluteBitfield
AND.l FluteMenuNumbers_bits, X
BNE .try_next
RTL
SelectFluteNext:
LDA.l FluteBitfield
CMP.b #$FF
BEQ InvalidBeep
.try_next
LDA.w FluteSelection
INC A
AND.b #$07
STA.w FluteSelection
TAX
LDA.l FluteBitfield
AND.l FluteMenuNumbers_bits, X
BNE .try_next
LDA.b #$20
STA.w $012F
RTL
SelectFlutePrev:
LDA.l FluteBitfield
CMP.b #$FF
BEQ InvalidBeep
.try_next
LDA.w FluteSelection
DEC A
AND.b #$07
STA.w FluteSelection
TAX
LDA.l FluteBitfield
AND.l FluteMenuNumbers_bits, X
BNE .try_next
LDA.b #$20
STA.w $012F
RTL
InvalidBeep:
LDA.b #$3C
STA.w $012E
RTL
SetFluteSpotPalette:
XBA
LDA.l FluteBitfield
AND.l FluteMenuNumbers_bits, X
BNE .disabled
.enabled
XBA
STA.b $0C
BRA .done
.disabled
LDA.b #$30
STA.b $0C
.done
LDA.b #$00
STA.b $0B
RTL
MaybeMarkFluteSpotVisited:
; don't ever allow the portal in desert/mire to be marked visited
CMP.b #$30 : BEQ .done
CMP.b #$70 : BEQ .done
LDX.b #$0E
.next
CMP.l $02E849, X
BEQ .mark
DEX : DEX
BPL .next
BRA .done
.mark
TXA
LSR A
TAX
LDA.l FluteMenuNumbers_bits, X
EOR.b #$FF
AND.l FluteBitfield
STA.l FluteBitfield
.done
RTL
CheckEnterOverworld:
LDA.l $7EC213
STA.b $8A ; what we wrote over
SEP #$20
JSL MaybeMarkFluteSpotVisited
REP #$20
RTL
CheckTransitionOverworld:
STA.b $8A
STA.w $040A ; what we wrote over
JML MaybeMarkFluteSpotVisited
CheckFlute:
LDA.l FluteBitfield
AND.w #$00FF
BNE .pseudo
.real
LDA.w #$0003
BRA .done
.pseudo
LDA.w #$0002
.done
RTS
DrawFluteIcon:
AND.w #$00FF
CMP.w #$0002
BCC +
JSR CheckFlute
+
STA.b $02
RTL
CheckFluteInHUD:
LDA.l EquipmentWRAM-1, X
AND.w #$00FF ; what we wrote over
CPX.w #$000D
BNE +
CMP.w #$0002
BCC +
JSR CheckFlute
+
RTL

18
ram.asm
View File

@@ -114,6 +114,8 @@ RoomIndex = $7E00A0 ; Underworld room index. Word length. High byt
; Not zeroed on exit to overworld. ; Not zeroed on exit to overworld.
PreviousRoom = $7E00A2 ; Stores previous value of RoomIndex PreviousRoom = $7E00A2 ; Stores previous value of RoomIndex
; ;
CurrentFloor = $7E00A4 ; Current floor in dungeos
;
CameraBoundH = $7E00A6 ; Which set of camera boundaries to use. CameraBoundH = $7E00A6 ; Which set of camera boundaries to use.
CameraBoundV = $7E00A7 ; CameraBoundV = $7E00A7 ;
; ;
@@ -194,6 +196,8 @@ BottleMenuCounter = $7E0205 ; Step counter for opening bottle menu
MenuFrameCounter = $7E0206 ; Incremented every menu frame. Never read. MenuFrameCounter = $7E0206 ; Incremented every menu frame. Never read.
MenuBlink = $7E0207 ; Incremented every frame and masked with $10 to blink cursor MenuBlink = $7E0207 ; Incremented every frame and masked with $10 to blink cursor
; ;
DungeonMapCurrentFloor = $7E020E ;
;
RaceGameFlag = $7E021B ; RaceGameFlag = $7E021B ;
; ;
MessageJunk = $7E0223 ; Zeroed but never used (?) MessageJunk = $7E0223 ; Zeroed but never used (?)
@@ -347,6 +351,7 @@ DynamicDropGFXSlots = $7E07F1 ; Assume future use of this up to $0E bytes, t
; which item gfx is currently occupying each slot ; which item gfx is currently occupying each slot
OAMBuffer = $7E0800 ; Main OAM buffer sent to OAM. $200 bytes. OAMBuffer = $7E0800 ; Main OAM buffer sent to OAM. $200 bytes.
OAMBuffer2 = $7E0A00 ; OAMBuffer2 = $7E0A00 ;
OAMBufferAux = $7E0A20 ; high X-bit and size bit sent to OAM, one byte per sprite
; ;
TransparencyFlag = $7E0ABD ; Flags transparency effects e.g. in Thieves Town Hellway TransparencyFlag = $7E0ABD ; Flags transparency effects e.g. in Thieves Town Hellway
; ;
@@ -468,6 +473,8 @@ RoomStripes = $7E1100 ; Used for room drawing.
; ;
MirrorPortalPosXH = $7E1ACF ; Mirror portal position. (High byte of X coordinate) MirrorPortalPosXH = $7E1ACF ; Mirror portal position. (High byte of X coordinate)
; ;
FluteSelection = $7E1AF0 ; Currently selected flute spot (zero-indexed)
;
IrisPtr = $7E1B00 ; Spotlight pointers for HDMA. $1C0 bytes (?). IrisPtr = $7E1B00 ; Spotlight pointers for HDMA. $1C0 bytes (?).
; ;
MessageSubModule = $7E1CD8 ; MessageSubModule = $7E1CD8 ;
@@ -558,6 +565,17 @@ PegColor = $7EC172 ;
; ;
GameOverSongCache = $7EC227 ; GameOverSongCache = $7EC227 ;
; ;
CachedDungeonID = $7EC22A ; Cached while opening dungeon map
CachedCurrentFloor = $7EC22B ; to restore when closing
;
CurrentDisplayedRoom = $7EC22C ; 2 bytes, used by dungeon map
DisplayedRoomDoorIndex = $7EC22E ; 2 bytes, used by dungeon map
;
DoorSlots = $7EC230 ; $32 bytes, used by dungeon map
DoorSlotScratch = $7EC262 ; 6 bytes, used by dungeon map
DoorSlotCursor = $7EC268 ; 2 bytes, used by dungeon map
CurrentDoorEntrance = $7EC26A ; 2 bytes, used by dungeon map
;
LastBGSet = $7EC2F8 ; Lists loaded sheets to check for decompression. 4 bytes. LastBGSet = $7EC2F8 ; Lists loaded sheets to check for decompression. 4 bytes.
; ;
PaletteBufferAux = $7EC300 ; Secondary and main palette buffer. See symbols_wram.asm PaletteBufferAux = $7EC300 ; Secondary and main palette buffer. See symbols_wram.asm

126
special_weapons.asm Normal file
View File

@@ -0,0 +1,126 @@
DamageClassCalc:
PHA
LDA.l GanonVulnerabilityItem : BEQ +
LDA.w SpriteTypeTable, X : CMP.b #$D7 : BNE +
PLA
JSL Ganon_CheckAncillaVulnerability
RTL
+
LDA.l SpecialWeapons : AND.b #$7F : CMP.b #$06 : BEQ .cane_immune
PLA
CMP.b #$01 : BEQ .red_cane
CMP.b #$2C : BEQ .red_cane
CMP.b #$31 : BEQ .blue_cane
CMP.b #$0C : BEQ .beam
BRA .not_cane_or_beam
.red_cane
PHA
LDA.l SpecialWeapons : AND.b #$7F : CMP.b #$04 : BEQ .special_cane
CMP.b #$05 : BEQ .special_cane
LDA.l SpecialWeapons : BIT.b #$80 : BNE .cane_immune
BRA .normal
.blue_cane
PHA
LDA.l SpecialWeapons : AND.b #$7F : CMP.b #$03 : BEQ .special_cane
CMP.b #$05 : BEQ .special_cane
LDA.l SpecialWeapons : BIT.b #$80 : BNE .cane_immune
BRA .normal
.cane_immune
LDA.w SpriteTypeTable, X : CMP.b #$1E : BEQ .normal ; crystal switch
PLA
BRA .impervious
.special_cane
PLA
LDA.w SpriteTypeTable, X : CMP.b #$D6 : BEQ .unstunned_ganon
CMP.b #$88 : BEQ .mothula
BRA .special_level
.impervious
LDA.b #$FF
RTL
.beam
PHA
LDA.l SpecialWeapons : AND.b #$7F : CMP.b #$02 : BNE .normal
PLA
LDA.b #$05
RTL
.normal
PLA
.not_cane_or_beam
CMP.b #$07 : BNE .no_change
LDA.l SpecialWeapons : AND.b #$7F : CMP.b #$01 : BNE .normal_bombs
LDA.l SpecialWeaponLevel : BEQ .normal_bombs
LDA.w SpriteTypeTable, X : CMP.b #$D6 : BEQ .unstunned_ganon
CMP.b #$88 : BEQ .mothula
CMP.b #$91 : BEQ .stalfos_knight
CMP.b #$92 : BEQ .helmasaur_king
.special_level
LDA.l SpecialWeaponLevel
BRA .done
.mothula
LDA.l SpecialWeaponLevel
CMP.b #$04 : BCS .fix_mothula
BRA .done
.fix_mothula
LDA.b #$03
BRA .done
.stalfos_knight
LDA.l StalfosBombDamage : BEQ .special_level
LDA.b #$08
BRA .done
.helmasaur_king
LDA.w $0DB0, X : CMP.b #$03 : BCS .special_level
LDA.b #$08
BRA .done
.unstunned_ganon
LDA.w $04C5 : CMP.b #$02 : BNE .impervious
LDA.w $0EE0, X : BNE .impervious
LDA.b #$34 : STA.w $0EE0, X ; give the poor pig some i-frames
BRA .special_level
.normal_bombs
LDA.b #$07
.no_change
PHX : TAX
LDA.l $86EC84, X
PLX
CMP.b #$06 : BNE .done
LDA.l BowEquipment : CMP.b #$03 : BCS .actual_silver_arrows
.normal_arrows
LDA.b #$06
.done
RTL
.actual_silver_arrows
LDA.w SpriteTypeTable, X : CMP.b #$D7 : BNE +
LDA.b #$20 : STA.w SpriteTimerE, X
+ LDA.b #$09
RTL
;--------------------------------------------------------------------------------
Utility_CheckImpervious:
LDA.w SpriteControl, X : AND.b #$40 : BNE .impervious
LDA.w $0CF2 : CMP.b #$FF : BEQ .impervious
LDA.w UseY1 : AND.b #$0A : BEQ .not_impervious ; normal behavior if not hammering
JSL Ganon_CheckHammerVulnerability : BCS .not_impervious
.not_impervious
LDA.b #$00 : RTL
.impervious
LDA.b #$01 : RTL
;--------------------------------------------------------------------------------

View File

@@ -190,7 +190,10 @@ ItemLimitCounts: skip 16 ; Keeps track of limited non-progressive items s
; See: ItemSubstitutionRules in tables.asm ; See: ItemSubstitutionRules in tables.asm
; Right now this is only used for three items but extra space is ; Right now this is only used for three items but extra space is
; reserved ; reserved
skip 37 ; Unused skip 34 ; Unused
FluteBitfield: skip 1 ;
SpecialWeaponLevel: skip 1 ; keeps track of level in special weapon modes
ItemOnB: skip 1 ; NYI
ProgressIndicator: skip 1 ; $00 = Pre-Uncle | $01 = Post-Uncle item | $02 = Zelda Rescued ProgressIndicator: skip 1 ; $00 = Pre-Uncle | $01 = Post-Uncle item | $02 = Zelda Rescued
; $03 = Agahnim 1 defeated ; $03 = Agahnim 1 defeated
; $04 and above don't do anything. $00-$02 used in standard mode ; $04 and above don't do anything. $00-$02 used in standard mode

View File

@@ -101,8 +101,17 @@ CheckGanonHammerDamage:
LDA.w SpriteTypeTable, X : CMP.b #$D8 ; original behavior except ganon LDA.w SpriteTypeTable, X : CMP.b #$D8 ; original behavior except ganon
RTL RTL
+ +
LDA.l GanonVulnerabilityItem : CMP.b #$0C : BEQ .hammer_silvers
LDA.w SpriteTypeTable, X : CMP.b #$D6 ; original behavior LDA.w SpriteTypeTable, X : CMP.b #$D6 ; original behavior
RTL RTL
.hammer_silvers
LDA.w SpriteTypeTable, X : CMP.b #$D8 : BCC +
RTL
+ CMP.b #$D6 : BNE +
RTL
+ CLC
RTL
;================================================================================ ;================================================================================
GetSmithSword: GetSmithSword:
JSL ItemCheck_SmithSword : BEQ + : JML Smithy_AlreadyGotSword : + JSL ItemCheck_SmithSword : BEQ + : JML Smithy_AlreadyGotSword : +

View File

@@ -91,7 +91,39 @@ SmithSword:
db $02 ; #$02 = Tempered Sword (default) db $02 ; #$02 = Tempered Sword (default)
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; 0x18002B- 0x180030 (Unused) ; 0x18002B (Unused)
;--------------------------------------------------------------------------------
; 0x18002C (Reserved for Allowed Item on B)
;--------------------------------------------------------------------------------
org $B0802D
ChallengeModes:
; p--- mmdd
; p - permadeath
; m - movement modes (0 - normal, 1 - permanent ice physics)
; d - damage modes (0 - normal, 1 - ohko, 2 - gloom)
db $00
;--------------------------------------------------------------------------------
org $B0802E
GanonVulnerabilityItem:
db $00 ; $00 = default behavior (silver arrows)
;--------------------------------------------------------------------------------
org $B0902F
SpecialWeapons:
db #$00
; s - - - m m m m (bitfield) - NYI
; s - only swords damage can hurt enemies
; m - special weapon mode
; $00 = Off (default)
; $01 = Bomb mode
; $02 = Pseudosword
; $03 = Byrna mode
; $04 = Somaria mode
; $05 = Canes mode
; $06 = Bee mode
; $07 = Unused
; $08 = Bugnet mode
;--------------------------------------------------------------------------------
; 0x180030 (Unused)
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $B08031 ; PC 0x180031 org $B08031 ; PC 0x180031
EnableEasterEggs: EnableEasterEggs:
@@ -111,7 +143,7 @@ dw $000A ; #$0A - Default (10 decimal)
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $B08038 ; PC 0x180038 org $B08038 ; PC 0x180038
LampCone: LampCone:
db $01 ; #$00 = Off - #$01 = Sewers only (default) - #$11 = Always On db $01 ; #$00 = Off - #$01 = On in Sewers (default) - #$10 = On Always - #$20 = No Dark Rooms
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $B08039 ; PC 0x180039 org $B08039 ; PC 0x180039
ItemCounterHUD: ItemCounterHUD:
@@ -423,7 +455,24 @@ db $01 ; #$00 = Original Behavior - #$01 = Randomizer Behavior (Default)
Bugfix_PodEG: Bugfix_PodEG:
db $01 ; #$00 = Original Behavior - #$01 = Randomizer Behavior (Default) db $01 ; #$00 = Original Behavior - #$01 = Randomizer Behavior (Default)
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; 0x1800A5 - 0x1800AF (unused) org $B080A5 ; PC 0x1800A5
MimicDash:
db $00 ; #$00 = Original Behavior (default) - #$01 = Mimics move when link dashes
CrystalSwitchBook:
db $00 ; #$00 = Original Behavior (default) - #$01 = Book can flip crystal switch
;--------------------------------------------------------------------------------
; 0x1800A7 - 0x1800AE (unused)
;--------------------------------------------------------------------------------
; 0x1800AF
; mtff ffff
;
; m - 0 = only shorten timer on multiworld items, 1 = shorten all items
; t - 0 = triforce pieces considered important, 1 = triforce pieces considered junk
; f - number of frames to show items
;--------------------------------------------------------------------------------
org $B080AF ; PC 0x1800AF
JunkItemTimer:
db $00 ; number of frames to show junk items (#$00 = no change)
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $B080B0 ; 0x1800B0-0x1800BF org $B080B0 ; 0x1800B0-0x1800BF
StaticDecryptionKey: StaticDecryptionKey:
@@ -741,7 +790,7 @@ HeartContainer_Vitreous:
HeartContainer_Trinexx: HeartContainer_Trinexx:
db $3E db $3E
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; 0x180159 - 0x18015F (unused) [encrypted] ; 0x18015A - 0x18015F (unused) [encrypted]
;================================================================================ ;================================================================================
org $B08160 ; PC 0x180160 - 0x180162 org $B08160 ; PC 0x180160 - 0x180162
BonkKey_Desert: BonkKey_Desert:

View File

@@ -7,25 +7,25 @@
!FRAMES_PER_HOUR = 60*60*60 !FRAMES_PER_HOUR = 60*60*60
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
macro DecIncr(value) macro DecIncr(value)
LDA.w <value> : INC LDA.l <value> : INC
CMP.w #$000A : !BLT ?noIncr CMP.w #$000A : !BLT ?noIncr
LDA.w <value>+2 : INC : STA.w <value>+2 LDA.l <value>+2 : INC : STA.l <value>+2
LDA.w #$0000 LDA.w #$0000
?noIncr: ?noIncr:
STA.w <value> STA.l <value>
endmacro endmacro
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
macro Sub32(minuend,subtrahend,result) macro Sub32(minuend,subtrahend,result)
LDA.l <minuend> LDA.l <minuend>
!SUB.l <subtrahend> ; perform subtraction on the LSBs !SUB.l <subtrahend> ; perform subtraction on the LSBs
STA.w <result> STA.l <result>
LDA.l <minuend>+2 ; do the same for the MSBs, with carry LDA.l <minuend>+2 ; do the same for the MSBs, with carry
SBC.l <subtrahend>+2 ; set according to the previous result SBC.l <subtrahend>+2 ; set according to the previous result
STA.w <result>+2 STA.l <result>+2
endmacro endmacro
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
macro Blt32(value1,value2) macro Blt32(value1,value2)
LDA.w <value1>+2 LDA.l <value1>+2
CMP.l <value2>+2 CMP.l <value2>+2
!BLT ?done !BLT ?done
BNE ?done BNE ?done
@@ -50,7 +50,7 @@ CalculateTimer:
%Sub32(ChallengeTimer,NMIFrames,ClockBuffer) %Sub32(ChallengeTimer,NMIFrames,ClockBuffer)
++ ++
%Blt32(ClockBuffer,.halfCycle) : !BLT + %Blt32(ClockBuffer,.halfCycle) : !BGE +++ : JMP + : +++
LDA.l TimeoutBehavior : AND.w #$00FF : BNE ++ ; DNF LDA.l TimeoutBehavior : AND.w #$00FF : BNE ++ ; DNF
LDA.w #$0002 : STA.l ClockStatus ; Set DNF Mode LDA.w #$0002 : STA.l ClockStatus ; Set DNF Mode
LDA.l NMIFrames : STA.l ChallengeTimer LDA.l NMIFrames : STA.l ChallengeTimer
@@ -66,6 +66,17 @@ CalculateTimer:
LDA.l NMIFrames : STA.l ChallengeTimer LDA.l NMIFrames : STA.l ChallengeTimer
LDA.l NMIFrames+2 : STA.l ChallengeTimer+2 LDA.l NMIFrames+2 : STA.l ChallengeTimer+2
RTS RTS
++ CMP.w #$0004 : BNE ++ ; Drop Into Ganon
LDA.w $048E
BEQ .already_ganon
LDA.w #$0002 : STA.l ClockStatus ; Set DNF Mode
LDA.w #$0011 : STA.b GameMode
SEP #$20
LDA.b #$7B
STA.w $010E
REP #$20
.already_ganon
RTS
++ ; End Game ++ ; End Game
SEP #$30 SEP #$30
JSL ActivateGoal JSL ActivateGoal
@@ -133,6 +144,13 @@ DrawChallengeTimer:
LDA.w #$247F : STA.l HUDTileMapBuffer+$98 LDA.w #$247F : STA.l HUDTileMapBuffer+$98
STA.l HUDTileMapBuffer+$9A STA.l HUDTileMapBuffer+$9A
BRA +++ BRA +++
++ CMP.w #$0004 : BNE ++ ; Ganon
LDA.w #$247F : STA.l HUDTileMapBuffer+$92
STA.l HUDTileMapBuffer+$94
STA.l HUDTileMapBuffer+$96
STA.l HUDTileMapBuffer+$98
STA.l HUDTileMapBuffer+$9A
BRA +++
++ ; OHKO ++ ; OHKO
LDA.w #$280A : STA.l HUDTileMapBuffer+$94 LDA.w #$280A : STA.l HUDTileMapBuffer+$94
LDA.w #$280B : STA.l HUDTileMapBuffer+$96 LDA.w #$280B : STA.l HUDTileMapBuffer+$96
@@ -163,6 +181,7 @@ RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
OHKOTimer: OHKOTimer:
LDA.l OHKOFlag : BNE .kill LDA.l OHKOFlag : BNE .kill
LDA.l ChallengeModes : AND.b #$03 : CMP.b #$01 : BEQ .kill
LDA.l TimeoutBehavior : CMP.b #$02 : BNE + LDA.l TimeoutBehavior : CMP.b #$02 : BNE +
LDA.l ClockStatus : AND.b #$02 : BEQ + LDA.l ClockStatus : AND.b #$02 : BEQ +
.kill .kill

View File

@@ -274,21 +274,31 @@ GFXSheetPointers_background_bank = $80CFC0
GFXSheetPointers_background_high = $80D09F GFXSheetPointers_background_high = $80D09F
GFXSheetPointers_background_low = $80D17E GFXSheetPointers_background_low = $80D17E
LayerOfDestination = $81C31F LayerOfDestination = $81C31F
RoomData_ChestItems = $81E96C
AnimatedTileSheets = $82802E AnimatedTileSheets = $82802E
Module1B_SpawnSelect_spawns = $828481 Module1B_SpawnSelect_spawns = $828481
Overworld_ActualScreenID = $82A4E3 Overworld_ActualScreenID = $82A4E3
UnderworldTransitionLandingCoordinate = $82C034 UnderworldTransitionLandingCoordinate = $82C034
Overworld_FinalizeEntryOntoScreen_Data = $82C176 Overworld_FinalizeEntryOntoScreen_Data = $82C176
EntranceData_room_id = $82C577
EntranceData_y_coordinate = $82CCBD
EntranceData_x_coordinate = $82CDC7
EntranceData_dungeon_id = $82D1EF
EntranceData_layer = $82D2F9
EntranceData_song = $82D592 EntranceData_song = $82D592
SpawnPointData_room_id = $82D8D2 SpawnPointData_room_id = $82D8D2
Overworld_CheckForSpecialOverworldTrigger_Direction = $84E879 Overworld_CheckForSpecialOverworldTrigger_Direction = $84E879
Sprite_ShowSolicitedMessage_Direction = $85E1A3 Sprite_ShowSolicitedMessage_Direction = $85E1A3
FluteMenuNumbers_bits = $8AB7A3
WorldMap_RedXChars = $8ABF70 WorldMap_RedXChars = $8ABF70
WorldMap_CalculateOAMCoordinates = $8AC3B1 WorldMap_CalculateOAMCoordinates = $8AC3B1
WorldMap_HandleSpriteBlink = $8AC52E WorldMap_HandleSpriteBlink = $8AC52E
WorldMapIcon_AdjustCoordinate = $8AC59B WorldMapIcon_AdjustCoordinate = $8AC59B
WorldMap_DarkWorldTilemap = $8AD739 WorldMap_DarkWorldTilemap = $8AD739
DungeonMapBossRooms = $8AE817 DungeonMapBossRooms = $8AE817
DungeonMapFloorCountData = $8AF5E9
DungeonMapFloorToDataOffset = $8AF605
DungeonMapRoomPointers = $8AF615
DamageSubclassValue = $8DB8F1 DamageSubclassValue = $8DB8F1
TextCharMasks = $8EB844 TextCharMasks = $8EB844
Credits_ScrollScene_target_y = $8EC308 Credits_ScrollScene_target_y = $8EC308

View File

@@ -0,0 +1,130 @@
Ganon_CheckAncillaVulnerability:
PHA
LDA.w $0EE0, X : BNE .not_vulnerable_pla
PLA
PHX : PHA
LDA.l GanonVulnerabilityItem
BMI .no_weakness
TAX : PLA
CMP.l Ganon_CheckByAncilla, X : BNE +
PLX : BRA .vulnerable
+ PLX : PHA
LDA.l GanonVulnerabilityItem
BEQ .silver_arrows
CMP.b #$01 : BEQ .silver_arrows
CMP.b #$11 : BEQ .somaria
BRA .not_vulnerable_pla
.no_weakness
PLA : PLX
BRA .not_vulnerable
.silver_arrows
PLA : CMP.b #$09 : BNE .not_vulnerable
LDA.l BowEquipment : CMP.b #$03 : BCS +
LDA.b #$09 : BRA .not_vulnerable
+ BRA .vulnerable
.somaria
PLA
CMP.b #$01 : BEQ .vulnerable
CMP.b #$2C : BEQ .vulnerable
BRA .not_vulnerable
.vulnerable
PHX
LDA.l GanonVulnerabilityItem
TAX
LDA.l Ganon_IFrameDuration, X
PLX
STA.w $0EE0, X ; give the poor pig some iframes
LDA.b #$20 : STA.w SpriteTimerE, X
LDA.b #$09
RTL
.not_vulnerable_pla_pla
PLA
.not_vulnerable_pla
PLA
.not_vulnerable
PHX : TAX
LDA.l $86EC84, X
PLX
RTL
;--------------------------------------------------------------------------------
Ganon_CheckPowderVulnerability:
LDA.l GanonVulnerabilityItem : CMP.b #$05 : BNE .normal
LDA.w SpriteTypeTable, X : CMP.b #$D7 : BNE .normal
LDA.w $0EE0, X : BNE .normal ; ganon has i-frames
LDA.l Ganon_IFrameDuration+$05
STA.w $0EE0, X ; give ganon i-frames
LDA.b #$20 : STA.w SpriteTimerE, X
LDA.b #$09
BRA .done
.normal
LDA.b #$0A
.done
JML $86ECE6
;--------------------------------------------------------------------------------
Ganon_CheckBeeVulnerability:
; X is bee sprite index
; Y is target sprite index
LDA.l GanonVulnerabilityItem : CMP.b #$10 : BNE .normal
LDA.w SpriteTypeTable, Y : CMP.b #$D7 : BNE .normal
LDA.w $0EE0, Y : BNE .normal ; ganon has i-frames
LDA.l Ganon_IFrameDuration+$10
STA.w $0EE0, X ; give ganon i-frames
LDA.b #$20 : STA.w SpriteTimerE, X
LDA.b #$09
BRA .done
.normal
LDA.b #$01
.done
TYX
JML $86ECE6
;--------------------------------------------------------------------------------
Ganon_CheckInvincible:
LDA.w $04C5 : CMP.b #$02 : BEQ .not_transparent
LDA.w SpriteTypeTable, X : CMP.b #$D7 : BNE .transparent ; non-stunned ganon
LDA.w UseY1 : AND.b #$0A : BEQ .transparent ; normal behavior if not hammering
LDA.l GanonVulnerabilityItem : CMP.b #$0C : BNE .transparent
.not_transparent
LDA.b #$00 : RTL
.transparent
LDA.b #$01 : RTL
;--------------------------------------------------------------------------------
Ganon_CheckHammerVulnerability:
LDA.l GanonVulnerabilityItem : CMP.b #$0C : BNE .normal
LDA.w SpriteTypeTable, X : CMP.b #$D7 : BNE .normal
LDA.w $0EE0, X : BNE .normal ; ganon has i-frames
LDA.l Ganon_IFrameDuration+$0C
STA.w $0EE0, X ; give ganon i-frames
LDA.b #$20 : STA.w SpriteTimerE, X
LDA.b #$09 : STA.w $0CF2 ; set damage class to silver
SEC : RTL
.normal
CLC : RTL
;--------------------------------------------------------------------------------
CheckBeeBoss:
; Y is sprite index
LDA.l GanonVulnerabilityItem : CMP.b #$10 : BNE .normal
LDA.w SpriteTypeTable, Y : CMP.b #$D7 : BNE .normal
LDA.b #$00 : RTL
.normal
LDA.w $0B6B, Y : AND.b #$02
RTL
;--------------------------------------------------------------------------------
Ganon_CheckByAncilla:
db #$00 ; default behavior
db #$00, #$05, #$1F, #$07, #$00
db #$02, #$0B, #$19, #$18, #$1C
db #$00, #$00, #$00, #$00, #$00
db #$00, #$00, #$31, #$00, #$00
Ganon_IFrameDuration:
db #$00 ; default behavior
db #$00, #$00, #$00, #$34, #$00
db #$00, #$00, #$00, #$00, #$00
db #$00, #$00, #$00, #$00, #$00
db #$00, #$00, #$00, #$00, #$00
;--------------------------------------------------------------------------------