Merge in dungeon map changes #1

Merged
karafruit merged 75 commits from FancyDoorsMap into GKNew 2026-01-25 22:43:02 +00:00
16 changed files with 56 additions and 36 deletions
Showing only changes of commit a7c7fc4394 - Show all commits
+8
View File
@@ -318,8 +318,16 @@ 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
incsrc data/playernamecharmap.asm
+10 -10
View File
@@ -8,11 +8,11 @@ const int MAXLENGTH = 0x300;
struct section {
int mode;
int length;
char data[2];
unsigned char data[2];
int datalength;
};
int find_duplicate(off_t loc, off_t size, char buf[], struct section *out) {
int find_duplicate(off_t loc, off_t size, unsigned char buf[], struct section *out) {
int i, j;
struct section result;
result.mode = 4;
@@ -40,7 +40,7 @@ int find_duplicate(off_t loc, off_t size, char buf[], struct section *out) {
return 0;
}
int find_repeat_byte(off_t loc, off_t size, char buf[], struct section *out) {
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]) {
@@ -59,7 +59,7 @@ int find_repeat_byte(off_t loc, off_t size, char buf[], struct section *out) {
return -1;
}
int find_repeat_word(off_t loc, off_t size, char buf[], struct section *out) {
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)]) {
@@ -79,7 +79,7 @@ int find_repeat_word(off_t loc, off_t size, char buf[], struct section *out) {
return -1;
}
int find_incrementing_byte(off_t loc, off_t size, char buf[], struct section *out) {
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) {
@@ -101,7 +101,7 @@ int find_incrementing_byte(off_t loc, off_t size, char buf[], struct section *ou
return -1;
}
int get_section(off_t loc, off_t size, char buf[], struct section *out) {
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)) {
@@ -133,7 +133,7 @@ int get_section(off_t loc, off_t size, char buf[], struct section *out) {
}
}
int write_section(struct section section, char data[], char buf[], int loc) {
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) {
@@ -181,7 +181,7 @@ int main(int argc, char *argv[]) {
if (argc > 4) {
size = strtol(argv[4], NULL, 0);
}
char inbuf[size];
unsigned char inbuf[size];
fseek(inptr, seek, SEEK_SET);
@@ -192,8 +192,8 @@ int main(int argc, char *argv[]) {
fclose(inptr);
char outbuf[size * 2];
char m0data[MAXLENGTH];
unsigned char outbuf[size * 2];
unsigned char m0data[MAXLENGTH];
int oloc = 0;
struct section m0;
+20 -12
View File
@@ -1,21 +1,20 @@
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <sys/stat.h>
struct section {
int mode;
int length;
char data[2];
unsigned char data[2];
int datalength;
};
int read_section(char buf[], int loc, struct section *out) {
int read_section(unsigned char buf[], int loc, struct section *out) {
int nloc = loc;
char header = buf[nloc++];
unsigned char header = buf[nloc++];
printf("%x: ", header & 0xff);
if (header == -1) {
if (header == 0xFF) {
return -1;
}
@@ -31,8 +30,6 @@ int read_section(char buf[], int loc, struct section *out) {
result.length = (header & 0x1F) + 1;
}
printf("%d: %x\n", result.mode, result.length);
switch (result.mode) {
case 0:
result.datalength = 0;
@@ -61,10 +58,15 @@ int read_section(char buf[], int loc, struct section *out) {
int main(int argc, char *argv[]) {
if (argc < 3) {
printf("Usage: %s infile outfile\n", argv[0]);
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]);
@@ -82,9 +84,15 @@ int main(int argc, char *argv[]) {
printf("Error stating file: %s\n", argv[1]);
return 1;
}
off_t size = buf.st_size;
char inbuf[size];
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]);
@@ -93,7 +101,7 @@ int main(int argc, char *argv[]) {
fclose(inptr);
char outbuf[size * 256];
unsigned char outbuf[size * 256];
int oloc = 0;
struct section section;
Binary file not shown.
+11 -11
View File
@@ -5,7 +5,7 @@ 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 $C340, $8370, $4340, $0340 ; 07 - Moldorm
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
@@ -20,15 +20,15 @@ dw $C354, $8354, $4354, $0354 ; 12
dw $FFFF, $83B7, $FFFF, $03B7 ; 13
dw $C351, $8341, $4351, $0351 ; 14
dw $C374, $8340, $4341, $0340 ; 15
dw $0361, $039A, $C3B2, $83B2 ; 16 - gross (add middle section if feasible)
dw $C370, $8370, $4340, $0340 ; 17
dw $0108, $0109, $C3B2, $83B2 ; 16 - gross (add middle section if feasible)
dw $C104, $0103, $4104, $0104 ; 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, $8399, $0366 ; 1E
dw $FFFF, $4391, $0122, $0123 ; 1E
dw $FFFF, $FFFF, $4360, $C399 ; 1F
dw $FFFF, $FFFF, $438F, $FFFF ; 20
dw $4348, $0363, $C348, $8368 ; 21
@@ -37,7 +37,7 @@ dw $FFFF, $FFFF, $FFFF, $039B ; 23
dw $4365, $0365, $0364, $0365 ; 24
dw $FFFF, $FFFF, $FFFF, $FFFF ; 25 - unused
dw $039B, $03E4, $4363, $0382 ; 26
dw $C370, $8370, $4340, $0340 ; 27
dw $C104, $0103, $4104, $0104 ; 27
dw $C3A5, $FFFF, $4358, $0348 ; 28
dw $FFFF, $FFFF, $FFFF, $0396 ; 29 - Mothula
dw $C350, $8352, $4350, $03F8 ; 2A
@@ -47,7 +47,7 @@ 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 $43B2, $0397, $839B, $C399 ; 31
dw $0124, $0125, $0134, $0135 ; 31
dw $43C4, $03C4, $43D4, $03D4 ; 32
dw $FFFF, $FFFF, $438F, $FFFF ; 33
dw $4348, $0368, $4349, $8368 ; 34
@@ -61,7 +61,7 @@ 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, $8399, $C399 ; 3F
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
@@ -75,7 +75,7 @@ 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 $C350, $8370, $4341, $0340 ; 4D
dw $0102, $0103, $0112, $0113 ; 4D
dw $839B, $439C, $FFFF, $FFFF ; 4E
dw $FFFF, $8396, $838D, $FFFF ; 4F
dw $FFFF, $83B7, $FFFF, $03B5 ; 50
@@ -92,7 +92,7 @@ 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, $4391, $839C, $0366 ; 5E
dw $FFFF, $0110, $839C, $0123 ; 5E
dw $FFFF, $FFFF, $43BB, $FFFF ; 5F
dw $FFFF, $8379, $FFFF, $036A ; 60
dw $C387, $8385, $4356, $0356 ; 61
@@ -121,7 +121,7 @@ dw $C370, $8340, $43A0, $03A0 ; 77
dw $FFFF, $FFFF, $FFFF, $FFFF ; 78 - unused
dw $FFFF, $FFFF, $FFFF, $FFFF ; 79 - unused
dw $FFFF, $FFFF, $FFFF, $FFFF ; 7A - unused
dw $C35E, $83B1, $438F, $4381 ; 7B
dw $0106, $0107, $438F, $4381 ; 7B
dw $C3B7, $83B4, $43B7, $03B7 ; 7C
dw $43B2, $835E, $034C, $0391 ; 7D
dw $FFFF, $83B7, $4393, $438A ; 7E
@@ -155,7 +155,7 @@ 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 $C35E, $83B2, $43B1, $035E ; 9D
dw $0116, $83B2, $43B1, $035E ; 9D
dw $FFFF, $439A, $838D, $03B9 ; 9E
dw $FFFF, $FFFF, $439B, $FFFF ; 9F
dw $839B, $C39C, $FFFF, $FFFF ; A0
+2 -2
View File
@@ -4,8 +4,8 @@ db $08
; use AA1 = $1C for map stuff
org $80E193
skip 7
db $D6
skip 4
db $61, $62, $62, $D6
org $8AE11D
LDA.b #$1C
+5 -1
View File
@@ -11,15 +11,19 @@ macro WriteGFXSheetPointer(sheet, location)
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.