Posted: Tue Jan 27, 2009 4:30 pm
HOw else do I edit this disk?
The Ultimate Bard's Tale Resource
https://bardstale.brotherhood.de/talefiles/forum/
https://bardstale.brotherhood.de/talefiles/forum/viewtopic.php?t=788
Code: Select all
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
+--+--+--+--+--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+--+
21 | # | | | | | # | # | | | 21
+ + + + +--+--+ + + + +ss+ + +##+ + +--+ +--+ +##+ +
20 | | | | | | | | | 20
+--+ + + + + + + +--+ +--+ +--+ + +--+ +--+ +--+--+ +
19 s | # | | | | s 19
+--+ + + +--+--+--+--+--+--+ +--+ +--+--+--+ + +--+--+ +--+
18 | | | | | | | | | | | 18
+ + + + + + + +##+ +ss+ +--+ +--+--+ +--+ + +--+ +--+
17 | | | | | | | | # | | | | | 17
+ +--+ +--+ + +--+--+ +--+ + +--+##+--+ +--+ +--+--+ + +
16 | s | | | | | | | | | | 16
+--+ + + +--+--+ +--+ +--+--+--+ +--+ +--+--+--+--+##+ +##+
15 | | | | | | | | | | | | | | 15
+ + +--+ + + +--+ + + +--+ + +--+ss+ + +--+ +--+ +--+
14 | | | | | # | | | | | | | | | 14
+ + +--+ +##+ +##+--+ + +--+ + +--+ + +--+ +--+ +--+ +
13 | | | | | | | | | | | | | # | 13
+ +--+ + +--+ +--+ +--+--+--+ + +--+ +--+--+--+ + +--+--+
12 | # | | | # | | | # | | 12
+##+--+ +--+ +--+ + +--+##+--+--+--+--+ +--+ +--+ + +--+--+
11 | | | | | | | | | | | | | 11
+ +--+--+ + + +--+ + + + + +##+ +--+ +--+##+--+ +--+ +
10 | | | | | # | | | | | | | | 10
+ + + + +--+ +--+--+ +--+--+ +--+ + +ss+ +--+--+--+ + +
9 | | | | | | # | | | | | | 9
+ + + +--+ +--+--+ +--+ + +--+ +--+--+ + + +--+--+--+ +
8 | | | # | | | | | 8
+ +--+ +--+--+--+ + + + + + + + + +--+ +--+ + + + +
7 | | | | | 7
+ +--+ +--+ + +##+ + + + + + +--+ + + + +--+--+--+ +
6 | | | | | | | # | | | | | 6
+ + +--+ +--+--+ +--+ + + + + +--+ +--+ + + + + + +
5 | | | | # | | | | | 5
+ + + +--+ +--+ + + + + + + + + +--+ +--+ +--+ + +
4 | | | | | | | | | | 4
+ + + +##+ +--+ + + + + + + + +--+ + +--+ + + + +
3 | | | | | | | | | | | | | 3
+ +--+--+##+--+ + + +--+--+--+--+--+--+##+--+ + + + + + +
2 | | | | | | | | # | | | | | | | | 2
+ + + + + + + + + + + + + +--+ + + + + + + + +
1 | | | | | # # | | | | | | | | | | | 1
+ +--+--+--+ +--+ +--+--+--+--+--+--+ +--+ +--+ +--+ +--+ +
0 | | # # # # # | 0
+--+--+--+--+--+--+--+--+--+--+--+--+ +--+--+--+--+--+--+--+--+--+
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
Code: Select all
import sys
NOTHING = 0
WALL = 1
DOOR = 2
SECRET_DOOR = 3
if len(sys.argv) < 2:
print >> sys.stderr, "usage: asciimap file"
sys.exit(1)
else:
fname = sys.argv[1]
class Tile(object):
def __init__(self, byte):
self.west = (byte >> 6) & 0x3
self.east = (byte >> 4) & 0x3
self.south = (byte >> 2) & 0x3
self.north = byte & 0x03
disk_image = file(fname, "rb")
# Look for 'C64MEM'
target = 'C64MEM'
i = 0
while i < 6:
c = disk_image.read(1)
if c == '':
print >> sys.stderr, "Not a valid Vice snapshot."
sys.exit(1)
if c == target[i]:
i += 1
else:
i = 0
# Skip forward in memory to the location of the dungeon info.
fp = disk_image.tell()
fp += 0xf800 + 0x14
disk_image.seek(fp)
# Read one dungeon row at a time, and store them in rows.
rows = []
for _ in xrange(22):
rows.append([Tile(ord(byte)) for byte in disk_image.read(22)])
rows.reverse()
legend = ' 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21'
# Draw a crude ASCII map.
print legend
rnum = 21
write = sys.stdout.write
for row in rows:
# north
write(' ')
for tile in row:
write({NOTHING: '+ ',
WALL: '+--',
DOOR: '+##',
SECRET_DOOR: '+ss'}[tile.north])
write('+\n')
write(str(rnum).rjust(2))
write(' ')
# west and east
for tile in row:
write({NOTHING: ' ',
WALL: '|',
DOOR: '#',
SECRET_DOOR: 's'}[tile.west])
write(' ')
# south and east are not generally bothered with. No one-way doors or walls
# currently allowed. However, special handling is then needed for the right
# and bottom edges.
write({NOTHING: ' ',
WALL: '|',
DOOR: '#',
SECRET_DOOR: 's'}[row[0].west])
write(' ')
write(str(rnum))
write('\n')
rnum -= 1
write(' ')
for tile in rows[0]:
write({NOTHING: '+ ',
WALL: '+--',
DOOR: '+##',
SECRET_DOOR: '+ss'}[tile.north])
write('+\n')
print legend
Code: Select all
WINE CELLAR
0009c00 [5th byte] - 0009de0 [8th byte]
0009c00: ---- ---- c414 4505 0505 0505 0505 0505 ...@..E......... begin cellar 5th[C4..]
0009c10: 0505 0505 0505 0505 0534 4100 0505 0405 .........4A.....
0009c20: 0505 0504 0404 0505 0505 0505 0505 1450 ...............P
0009c30: 5450 4415 5044 0404 1440 0010 5444 0505 TPD.PD...@..TD..
0009c40: 0505 0514 5050 5050 5054 5040 0000 1040 ....PPPPPTP@...@
0009c50: 0010 5050 5456 5656 5650 5050 5050 5050 ..PPTVVVVPPPPPPP
0009c60: 5041 0100 1040 0010 5050 6188 0808 1850 PA...@..PPa....P
0009c70: 5050 5060 9150 4005 1440 1040 0010 5050 PPP`.P@..@.@..PP
0009c80: 6580 0000 1050 5050 5050 4410 5054 5040 e....PPPPPD.PTP@
0009c90: 1040 0010 5050 6482 0202 1050 5050 5050 .@..PPd....PPPPP
0009ca0: 4111 5050 5040 1040 0010 5050 5159 5959 A.PPP@.@..PPQYYY
0009cb0: 5050 5050 5060 9565 9050 5140 1040 0110 PPPPP`.e.PQ@.@..
0009cc0: 5041 0505 0515 5050 5050 5050 4515 5041 PA....PPPPPPE.PA
0009cd0: 0501 1150 5550 4105 0505 0515 5251 5050 ...PUPA.....RQPP
0009ce0: 5040 0404 0004 0404 0500 0400 0504 0404 P@..............
0009cf0: 0404 0804 1050 5040 0000 0000 0010 5540 .....PP@......U@
0009d00: 0814 c500 cb80 cb00 cc80 cc00 cd80 cd00 ................
0009d10: ce00 0000 0100 0000 0000 2100 0000 0000 ..........!.....
0009d20: 0120 0000 0000 0000 0405 2240 0022 0100 . ........"@."..
0009d30: 0000 0020 0041 0000 0000 0001 0000 0000 ... .A..........
0009d40: 0022 2304 2102 0222 0000 0001 0000 0000 ."#.!.."........
0009d50: 0002 2304 2241 0000 0000 0000 0000 0000 ..#."A..........
0009d60: 0000 0000 2200 0000 0000 0000 0300 4122 ....".........A"
0009d70: 0002 0000 0000 0000 0000 0000 4300 0000 ............C...
0009d80: 0000 0000 0000 0001 0202 0304 0501 0101 ................
0009d90: 0100 0000 1003 0405 0004 1000 0010 0202 ................
0009da0: 1000 0600 0002 0002 2020 1012 0200 2004 ........ .... .
0009db0: 2003 0320 2000 0002 0002 0005 0607 0603 .. ...........
0009dc0: 0502 0000 1020 3220 0000 0030 0530 0400 ..... 2 ...0.0..
0009dd0: 0020 1010 1010 0308 0502 0100 0100 0000 . ..............
0009de0: 0200 0103 5000 0001 ---- ---- ---- ---- ....P.......@... end cellar 8th [..01]
0009d20 appears to contain 11N, from 12E to 18E. Right?Darendor wrote:This is the disk code for WINE CELLAR. It's apparently wrong, but my patience is expended.Code: Select all
WINE CELLAR 0009c00 [5th byte] - 0009de0 [8th byte] 0009c00: ---- ---- c414 4505 0505 0505 0505 0505 ...@..E......... begin cellar 5th[C4..] 0009c10: 0505 0505 0505 0505 0534 4100 0505 0405 .........4A..... 0009c20: 0505 0504 0404 0505 0505 0505 0505 1450 ...............P 0009c30: 5450 4415 5044 0404 1440 0010 5444 0505 TPD.PD...@..TD.. 0009c40: 0505 0514 5050 5050 5054 5040 0000 1040 ....PPPPPTP@...@ 0009c50: 0010 5050 5456 5656 5650 5050 5050 5050 ..PPTVVVVPPPPPPP 0009c60: 5041 0100 1040 0010 5050 6188 0808 1850 PA...@..PPa....P 0009c70: 5050 5060 9150 4005 1440 1040 0010 5050 PPP`.P@..@.@..PP 0009c80: 6580 0000 1050 5050 5050 4410 5054 5040 e....PPPPPD.PTP@ 0009c90: 1040 0010 5050 6482 0202 1050 5050 5050 .@..PPd....PPPPP 0009ca0: 4111 5050 5040 1040 0010 5050 5159 5959 A.PPP@.@..PPQYYY 0009cb0: 5050 5050 5060 9565 9050 5140 1040 0110 PPPPP`.e.PQ@.@.. 0009cc0: 5041 0505 0515 5050 5050 5050 4515 5041 PA....PPPPPPE.PA 0009cd0: 0501 1150 5550 4105 0505 0515 5251 5050 ...PUPA.....RQPP 0009ce0: 5040 0404 0004 0404 0500 0400 0504 0404 P@.............. 0009cf0: 0404 0804 1050 5040 0000 0000 0010 5540 .....PP@......U@ 0009d00: 0814 c500 cb80 cb00 cc80 cc00 cd80 cd00 ................ 0009d10: ce00 0000 0100 0000 0000 2100 0000 0000 ..........!..... 0009d20: 0120 0000 0000 0000 0405 2240 0022 0100 . ........"@.".. 0009d30: 0000 0020 0041 0000 0000 0001 0000 0000 ... .A.......... 0009d40: 0022 2304 2102 0222 0000 0001 0000 0000 ."#.!.."........ 0009d50: 0002 2304 2241 0000 0000 0000 0000 0000 ..#."A.......... 0009d60: 0000 0000 2200 0000 0000 0000 0300 4122 ....".........A" 0009d70: 0002 0000 0000 0000 0000 0000 4300 0000 ............C... 0009d80: 0000 0000 0000 0001 0202 0304 0501 0101 ................ 0009d90: 0100 0000 1003 0405 0004 1000 0010 0202 ................ 0009da0: 1000 0600 0002 0002 2020 1012 0200 2004 ........ .... . 0009db0: 2003 0320 2000 0002 0002 0005 0607 0603 .. ........... 0009dc0: 0502 0000 1020 3220 0000 0030 0530 0400 ..... 2 ...0.0.. 0009dd0: 0020 1010 1010 0308 0502 0100 0100 0000 . .............. 0009de0: 0200 0103 5000 0001 ---- ---- ---- ---- ....P.......@... end cellar 8th [..01]
Yes. There are only 256 bytes or so in a sector, so a dungeon will be split into pieces on the disk.Darendor wrote:0009d20 appears to contain 11N, from 12E to 18E. Right?
The Python code? To run it, you need to install Python 2.5 or below.Darendor wrote:I put that code where?
What are you seeing where the byte "should" be?Darendor wrote:I can't seem to find 21N, 21E on the disk on the Wine Cellar. Can you?