CBM64 Bard's Tale 1 Disassembly

Any developer realated stuff
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

So I've decided to go ahead and try to expand the BTI game with my limited knowledge of ML and how the game engine works.

I'm going to try to edit the existing event files by giving them a branch routine at the beginning; i.e. depending on dungeon level and/or other things it'll know which event to run from one file. This is because the jump table cannot be expanded.

Wish me luck, and I'll post my progress as I go along.

To start with, I'm expanding the sewers to have a "lost city" underneath them. So far I'm going to be expanding NM1F.PRG to be reusable for another event.

In front of the NM1F.PRG code I am inserting the following 3 lines:

Code: Select all

lda #$06
cmp $001e
beq $3bb4
Where $3BB4 is where the new code I'm adding will go, right after the text string for the original is.

Here is what the file will look like when I'm done. Anyone wanna guess what it does?

Code: Select all

                       *        =   $3b00 ;  C64 

lda #$06
cmp $001e
beq $3bb4

3b00:0002:1   20 06 08          jsr $0806
3b03:0005:1   a0 bb             ldy #$bb
3b05:0007:1   a2 26             ldx #$26
3b07:0009:1   20 09 08          jsr $0809
3b0a:000c:1   20 0f 08          jsr $080f
3b0d:000f:1   20 3f 08          jsr $083f
3b10:0012:1   c9 d9             cmp #$d9
3b12:0014:1   f0 07             beq $3b1b
3b14:0016:1   c9 ce             cmp #$ce
3b16:0018:1   d0 f2             bne $3b0a
3b18:001a:1   4c 06 08          jmp $0806

3b1b:001d:1   a9 01             lda #$01
3b1d:001f:1   8d 13 fc          sta $fc13
3b20:0022:1   8d 14 fc          sta $fc14
3b23:0025:1   4c 0c ae          jmp $ae0c

3b26:0028:1   d4                BAD 
3b27:0029:1   e8                inx 
3b28:002a:1   e5 f2             sbc $f2
3b2a:002c:1   e5 a0             sbc $a0
3b2c:002e:1   e1 f2             sbc ($f2,x)
3b2e:0030:1   e5 a0             sbc $a0
3b30:0032:1   f3                BAD 
3b31:0033:1   f4                BAD 
3b32:0034:1   e1 e9             sbc ($e9,x)
3b34:0036:1   f2                BAD 
3b35:0037:1   f3                BAD 
3b36:0038:1   a0 e8             ldy #$e8
3b38:003a:1   e5 f2             sbc $f2
3b3a:003c:1   e5 ac             sbc $ac
3b3c:003e:1   a0 f7             ldy #$f7
3b3e:0040:1   e8                inx 
3b3f:0041:1   e9 e3             sbc #$e3
3b41:0043:1   e8                inx 
3b42:0044:1   a0 f3             ldy #$f3
3b44:0046:1   e5 e5             sbc $e5
3b46:0048:1   ed a0 f4          sbc $f4a0
3b49:004b:1   ef                BAD 
3b4a:004c:1   a0 e7             ldy #$e7
3b4c:004e:1   ef                BAD 
3b4d:004f:1   a0 e1             ldy #$e1
3b4f:0051:1   a0 ec             ldy #$ec
3b51:0053:1   ef                BAD 
3b52:0054:1   ee e7 a0          inc $a0e7
3b55:0057:1   f7                BAD 
3b56:0058:1   e1 f9             sbc ($f9,x)
3b58:005a:1   a0 f5             ldy #$f5
3b5a:005c:1   f0 ae             beq $3b0a
3b5c:005e:1   a0 c4             ldy #$c4
3b5e:0060:1   ef                BAD 
3b5f:0061:1   a0 f9             ldy #$f9
3b61:0063:1   ef                BAD 
3b62:0064:1   f5 a0             sbc $a0,x
3b64:0066:1   f7                BAD 
3b65:0067:1   e9 f3             sbc #$f3
3b67:0069:1   e8                inx 
3b68:006a:1   a0 f4             ldy #$f4
3b6a:006c:1   ef                BAD 
3b6b:006d:1   a0 f4             ldy #$f4
3b6d:006f:1   e1 eb             sbc ($eb,x)
3b6f:0071:1   e5 a0             sbc $a0
3b71:0073:1   f4                BAD 
3b72:0074:1   e8                inx 
3b73:0075:1   e5 ed             sbc $ed
3b75:0077:1   bf                BAD 
3b76:0078:1   a0 db             ldy #$db
3b78:007a:1   d9 ad ce          cmp $cead,y
3b7b:007d:1   dd dc c1          cmp $c1dc,x
3b7e:0080:1   00                brk 
3b7f:0081:1   c2                BAD 
3b80:0082:1   80                BAD 
3b81:0083:1   c2                BAD 
3b82:0084:1   00                brk 
3b83:0085:1   c3                BAD 
3b84:0086:1   b1 b0             lda ($b0),y
3b86:0088:1   a0 b9             ldy #$b9
3b88:008a:1   a0 b8             ldy #$b8
3b8a:008c:1   a0 b7             ldy #$b7
3b8c:008e:1   a0 b6             ldy #$b6
3b8e:0090:1   a0 b5             ldy #$b5
3b90:0092:1   a0 b4             ldy #$b4
3b92:0094:1   a0 b3             ldy #$b3
3b94:0096:1   a0 b2             ldy #$b2
3b96:0098:1   a0 b1             ldy #$b1
3b98:009a:1   a0 b0             ldy #$b0
3b9a:009c:1   ad b1 ad          lda $adb1
3b9d:009f:1   b2                BAD 
3b9e:00a0:1   ad b3 ad          lda $adb3
3ba1:00a3:1   b4 ad             ldy $ad,x
3ba3:00a5:1   b5 ad             lda $ad,x
3ba5:00a7:1   b6 ad             ldx $ad,y
3ba7:00a9:1   b7                BAD 
3ba8:00aa:1   ad b8 ad          lda $adb8
3bab:00ad:1   b9 cc cf          lda $cfcc,y
3bae:00b0:1   ce e5 f7          dec $f7e5
3bb1:00b3:1   a0 cf             ldy #$cf
3bb3:00b5:1   f2                BAD 
3bb4:00b6:1   e4 e5             cpx $e5
3bb6:00b8:1   f2                BAD 
3bb7:00b9:1   ba                tsx 
3bb8:00ba:1   00                brk 
3bb9:00bb:1   00                brk 
3bba:00bc:1   b1 be             lda ($be),y
3bbc:00be:1   a0 ff             ldy #$ff
3bbe:00c0:1   00                brk 
3bbf:00c1:1   d2                BAD 
3bc0:00c2:1   e1 e3             sbc ($e3,x)
3bc2:00c4:1   e5 ba             sbc $ba
3bc4:00c6:1   a0 a0             ldy #$a0
3bc6:00c8:1   ff                BAD 
3bc7:00c9:1   00                brk 
3bc8:00ca:1   c3                BAD 
3bc9:00cb:1   ec e1 f3          cpx $f3e1
3bcc:00ce:1   f3                BAD 
3bcd:00cf:1   ba                tsx 
3bce:00d0:1   a0 ff             ldy #$ff
3bd0:00d2:1   a0 a0             ldy #$a0
3bd2:00d4:1   a0 a0             ldy #$a0
3bd4:00d6:1   a0 00             ldy #$00
3bd6:00d8:1   00                brk 
3bd7:00d9:1   cc f6 ec          cpy $ecf6
3bda:00dc:1   ba                tsx 
3bdb:00dd:1   ff                BAD 
3bdc:00de:1   a0 d3             ldy #$d3
3bde:00e0:1   f0 d0             beq $3bb0
3be0:00e2:1   f4                BAD 
3be1:00e3:1   ba                tsx 
3be2:00e4:1   ff                BAD 
3be3:00e5:1   00                brk 
3be4:00e6:1   c5 f8             cmp $f8
3be6:00e8:1   f0 e5             beq $3bcd
3be8:00ea:1   f2                BAD 
3be9:00eb:1   ba                tsx 
3bea:00ec:1   ff                BAD 
3beb:00ed:1   00                brk 
3bec:00ee:1   c7                BAD 
3bed:00ef:1   ef                BAD 
3bee:00f0:1   ec e4 a0          cpx $a0e4
3bf1:00f3:1   ba                tsx 
3bf2:00f4:1   ff                BAD 
3bf3:00f5:1   a0 fc             ldy #$fc
3bf5:00f7:1   de bf 00          dec $00bf,x
3bf8:00fa:1   00                brk 
3bf9:00fb:1   00                brk 
3bfa:00fc:1   01 20             ora ($20,x)
3bfc:00fe:1   fe 8f 3e          inc $3e8f,x
.end

PROTOTYPE CODE - Sewers level 6, the "wastewater pipe" event

3bb4: ldx #$14
3bb6: jsr $0803  ; load image
3bb9: ldx #$??
3bbb: ldy #$??
3bbd: jsr $08c0  ; caption "Ewww!..."
3bc0: jsr $0806  ; clear text window
3bc3: ldx #$??
3bc5: ldy #$??
3bc7: jsr $0809 ; display "YOu have entered..." text
3bca: lda #$64 ;100 damage
3bcc: sta $0045
3bce: ldx #$01  ;party member 1
3bd0: ldy #$01  ; Poison mode
3bd2: stx $0044
sty $00c8  ; apply poison mode
jsr $089c  ; apply 100 damage and "Psnd"
inx
cmp #$07
beq $????
jmp $3bd2


jmp $ae03  ; back to dungeon

Also, I'm wondering if there's an easy to use cross assembler for putting the code back together. :?[/code]
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

I have successfully split the NM1F event into two seperate events.

I had to strip out the text strings, add branch code and reinsert the text strings manually, but the NM1F seems to work just fine.

Well, it should be stated that the file's original function (i.e. stairs to Mangar's courtyard) works just fine. I haven't tested the 2nd function yet because I haven't built the dungeon for it yet. :roll:
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

So I've constructed a fourth level to the Sewers using file NMA4.PRG.

The physical dungeon layout is perfected, but as expected there's a few issues with messages (I cannot figure out how to place the text offsets properly).

Also ran out of room in the file for the messages I would have liked to have placed, so I'll need to play with expanding the dungeon files a few sectors or something.

Sigh. It's late.
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

Fooled the game into thinking I was on the 5th (6th?) sewers level, and got my modified NM1F event file to load the added code.

Sadly, I seem to have forgotten to tell it where to find the caption text and as a result I get a CPU JAM error on WinVICE. Whoops.
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

Well I'm kind of stumped.

The modified NM1F.PRG file continually crashes out on me.

Here is the code if anyone has any suggestions.

Code: Select all

                       *        =   $3b00 ;  C64 


3b00:0002:1   a9 05             lda #$05
3b02:0004:1   c5 1e             cmp $1e
3b04:0006:1   f0 7c             beq $3b82
3b06:0008:1   20 06 08          jsr $0806
3b09:000b:1   a0 bb             ldy #$bb
3b0b:000d:1   a2 2c             ldx #$2c
3b0d:000f:1   20 09 08          jsr $0809
3b10:0012:1   20 0f 08          jsr $080f
3b13:0015:1   20 3f 08          jsr $083f
3b16:0018:1   c9 d9             cmp #$d9
3b18:001a:1   f0 07             beq $3b21
3b1a:001c:1   c9 ce             cmp #$ce
3b1c:001e:1   d0 f2             bne $3b10
3b1e:0020:1   4c 06 08          jmp $0806

3b21:0023:1   a9 01             lda #$01
3b23:0025:1   8d 13 fc          sta $fc13
3b26:0028:1   8d 14 fc          sta $fc14
3b29:002b:1   4c 0c ae          jmp $ae0c

3b2c:002e:1   d4                BAD 
3b2d:002f:1   e8                inx 
3b2e:0030:1   e5 f2             sbc $f2
3b30:0032:1   e5 a0             sbc $a0
3b32:0034:1   e1 f2             sbc ($f2,x)
3b34:0036:1   e5 a0             sbc $a0
3b36:0038:1   f3                BAD 
3b37:0039:1   f4                BAD 
3b38:003a:1   e1 e9             sbc ($e9,x)
3b3a:003c:1   f2                BAD 
3b3b:003d:1   f3                BAD 
3b3c:003e:1   a0 e8             ldy #$e8
3b3e:0040:1   e5 f2             sbc $f2
3b40:0042:1   e5 ac             sbc $ac
3b42:0044:1   a0 f7             ldy #$f7
3b44:0046:1   e8                inx 
3b45:0047:1   e9 e3             sbc #$e3
3b47:0049:1   e8                inx 
3b48:004a:1   a0 f3             ldy #$f3
3b4a:004c:1   e5 e5             sbc $e5
3b4c:004e:1   ed a0 f4          sbc $f4a0
3b4f:0051:1   ef                BAD 
3b50:0052:1   a0 e7             ldy #$e7
3b52:0054:1   ef                BAD 
3b53:0055:1   a0 e1             ldy #$e1
3b55:0057:1   a0 ec             ldy #$ec
3b57:0059:1   ef                BAD 
3b58:005a:1   ee e7 a0          inc $a0e7
3b5b:005d:1   f7                BAD 
3b5c:005e:1   e1 f9             sbc ($f9,x)
3b5e:0060:1   a0 f5             ldy #$f5
3b60:0062:1   f0 ae             beq $3b10
3b62:0064:1   a0 c4             ldy #$c4
3b64:0066:1   ef                BAD 
3b65:0067:1   a0 f9             ldy #$f9
3b67:0069:1   ef                BAD 
3b68:006a:1   f5 a0             sbc $a0,x
3b6a:006c:1   f7                BAD 
3b6b:006d:1   e9 f3             sbc #$f3
3b6d:006f:1   e8                inx 
3b6e:0070:1   a0 f4             ldy #$f4
3b70:0072:1   ef                BAD 
3b71:0073:1   a0 f4             ldy #$f4
3b73:0075:1   e1 eb             sbc ($eb,x)
3b75:0077:1   e5 a0             sbc $a0
3b77:0079:1   f4                BAD 
3b78:007a:1   e8                inx 
3b79:007b:1   e5 ed             sbc $ed
3b7b:007d:1   bf                BAD 
3b7c:007e:1   db                BAD 
3b7d:007f:1   d9 ad ce          cmp $cead,y
3b80:0082:1   dd dc a9          cmp $a9dc,x
3b83:0085:1   14                BAD 
3b84:0086:1   20 03 08          jsr $0803
3b87:0089:1   a2 b6             ldx #$b6
3b89:008b:1   a0 bb             ldy #$bb
3b8b:008d:1   84 58             sty $58
3b8d:008f:1   86 59             stx $59
3b8f:0091:1   20 c0 08          jsr $08c0
3b92:0094:1   20 06 08          jsr $0806
3b95:0097:1   a2 bf             ldx #$bf
3b97:0099:1   a0 bb             ldy #$bb
3b99:009b:1   20 09 08          jsr $0809
3b9c:009e:1   a9 64             lda #$64
3b9e:00a0:1   85 45             sta $45
3ba0:00a2:1   a2 01             ldx #$01
3ba2:00a4:1   a0 01             ldy #$01
3ba4:00a6:1   86 44             stx $44
3ba6:00a8:1   84 c8             sty $c8
3ba8:00aa:1   20 9c 08          jsr $089c
3bab:00ad:1   e8                inx 
3bac:00ae:1   e0 05             cpx #$05
3bae:00b0:1   f0 03             beq $3bb3
3bb0:00b2:1   4c a4 3b          jmp $3ba4

3bb3:00b5:1   4c 03 ae          jmp $ae03

3bb6:00b8:1   c5 f7             cmp $f7
3bb8:00ba:1   f7                BAD 
3bb9:00bb:1   f7                BAD 
3bba:00bc:1   a1 ae             lda ($ae,x)
3bbc:00be:1   ae ae dc          ldx $dcae
3bbf:00c1:1   c1 ee             cmp ($ee,x)
3bc1:00c3:1   a0 ef             ldy #$ef
3bc3:00c5:1   f6 e5             inc $e5,x
3bc5:00c7:1   f2                BAD 
3bc6:00c8:1   e6 ec             inc $ec
3bc8:00ca:1   ef                BAD 
3bc9:00cb:1   f7                BAD 
3bca:00cc:1   a0 f0             ldy #$f0
3bcc:00ce:1   e9 f0             sbc #$f0
3bce:00d0:1   e5 a0             sbc $a0
3bd0:00d2:1   e6 f2             inc $f2
3bd2:00d4:1   ef                BAD 
3bd3:00d5:1   ed a0 f4          sbc $f4a0
3bd6:00d8:1   e8                inx 
3bd7:00d9:1   e5 a0             sbc $a0
3bd9:00db:1   f3                BAD 
3bda:00dc:1   e5 f7             sbc $f7
3bdc:00de:1   e5 f2             sbc $f2
3bde:00e0:1   a0 f3             ldy #$f3
3be0:00e2:1   f9 f3 f4          sbc $f4f3,y
3be3:00e5:1   e5 ed             sbc $ed
3be5:00e7:1   a0 e1             ldy #$e1
3be7:00e9:1   e2                BAD 
3be8:00ea:1   ef                BAD 
3be9:00eb:1   f6 e5             inc $e5,x
3beb:00ed:1   a0 e9             ldy #$e9
3bed:00ef:1   f3                BAD 
3bee:00f0:1   a0 e4             ldy #$e4
3bf0:00f2:1   f5 ed             sbc $ed,x
3bf2:00f4:1   f0 e9             beq $3bdd
3bf4:00f6:1   ee e7 a0          inc $a0e7
3bf7:00f9:1   f7                BAD 
3bf8:00fa:1   e1 f3             sbc ($f3,x)
3bfa:00fc:1   f4                BAD 
3bfb:00fd:1   e5 a0             sbc $a0
3bfd:00ff:1   f7                BAD 
3bfe:0100:1   e1 f4             sbc ($f4,x)
3c00:0102:1   e5 f2             sbc $f2
3c02:0104:1   a0 e9             ldy #$e9
3c04:0106:1   ee f4 ef          inc $eff4
3c07:0109:1   a0 f4             ldy #$f4
3c09:010b:1   e8                inx 
3c0a:010c:1   e5 a0             sbc $a0
3c0c:010e:1   e3                BAD 
3c0d:010f:1   e5 ee             sbc $ee
3c0f:0111:1   f4                BAD 
3c10:0112:1   f2                BAD 
3c11:0113:1   e5 a0             sbc $a0
3c13:0115:1   ef                BAD 
3c14:0116:1   e6 a0             inc $a0
3c16:0118:1   f4                BAD 
3c17:0119:1   e8                inx 
3c18:011a:1   e9 f3             sbc #$f3
3c1a:011c:1   a0 e3             ldy #$e3
3c1c:011e:1   e8                inx 
3c1d:011f:1   e1 ed             sbc ($ed,x)
3c1f:0121:1   e2                BAD 
3c20:0122:1   e5 f2             sbc $f2
3c22:0124:1   ae a0 d3          ldx $d3a0
3c25:0127:1   e1 e4             sbc ($e4,x)
3c27:0129:1   ec f9 ac          cpx $acf9
3c2a:012c:1   a0 f9             ldy #$f9
3c2c:012e:1   ef                BAD 
3c2d:012f:1   f5 a0             sbc $a0,x
3c2f:0131:1   f7                BAD 
3c30:0132:1   e1 ec             sbc ($ec,x)
3c32:0134:1   eb                BAD 
3c33:0135:1   e5 e4             sbc $e4
3c35:0137:1   a0 e4             ldy #$e4
3c37:0139:1   e9 f2             sbc #$f2
3c39:013b:1   e5 e3             sbc $e3
3c3b:013d:1   f4                BAD 
3c3c:013e:1   ec f9 a0          cpx $a0f9
3c3f:0141:1   f5 ee             sbc $ee,x
3c41:0143:1   e4 e5             cpx $e5
3c43:0145:1   f2                BAD 
3c44:0146:1   ee e5 e1          inc $e1e5
3c47:0149:1   f4                BAD 
3c48:014a:1   e8                inx 
3c49:014b:1   a0 f4             ldy #$f4
3c4b:014d:1   e8                inx 
3c4c:014e:1   e5 a0             sbc $a0
3c4e:0150:1   ef                BAD 
3c4f:0151:1   f5 f4             sbc $f4,x
3c51:0153:1   ec e5 f4          cpx $f4e5
3c54:0156:1   a0 f7             ldy #$f7
3c56:0158:1   e8                inx 
3c57:0159:1   e9 ec             sbc #$ec
3c59:015b:1   f3                BAD 
3c5a:015c:1   f4                BAD 
3c5b:015d:1   a0 e9             ldy #$e9
3c5d:015f:1   f4                BAD 
3c5e:0160:1   a0 f7             ldy #$f7
3c60:0162:1   e1 f3             sbc ($f3,x)
3c62:0164:1   a0 e6             ldy #$e6
3c64:0166:1   ec ef f7          cpx $f7ef
3c67:0169:1   e9 ee             sbc #$ee
3c69:016b:1   e7                BAD 
3c6a:016c:1   ae 00 00          ldx $0000
3c6d:016f:1   d2                BAD 
3c6e:0170:1   e5 e1             sbc $e1
3c70:0172:1   ec a0 f3          cpx $f3a0
3c73:0175:1   ed ef ef          sbc $efef
3c76:0178:1   f4                BAD 
3c77:0179:1   e8                inx 
3c78:017a:1   ae dc ff          ldx $ffdc
3c7b:017d:1   ff                BAD 
3c7c:017e:1   ff                BAD 
3c7d:017f:1   ff                BAD 
3c7e:0180:1   ff                BAD 
3c7f:0181:1   ff                BAD 
3c80:0182:1   00                brk 
3c81:0183:1   00                brk 
3c82:0184:1   00                brk 
3c83:0185:1   00                brk 
3c84:0186:1   00                brk 
3c85:0187:1   00                brk 
3c86:0188:1   00                brk 
3c87:0189:1   00                brk 
3c88:018a:1   00                brk 
3c89:018b:1   00                brk 
3c8a:018c:1   00                brk 
3c8b:018d:1   00                brk 
3c8c:018e:1   00                brk 
3c8d:018f:1   00                brk 
3c8e:0190:1   00                brk 
3c8f:0191:1   00                brk 
3c90:0192:1   00                brk 
3c91:0193:1   00                brk 
3c92:0194:1   00                brk 
3c93:0195:1   00                brk 
3c94:0196:1   00                brk 
3c95:0197:1   00                brk 
3c96:0198:1   00                brk 
3c97:0199:1   00                brk 
3c98:019a:1   00                brk 
3c99:019b:1   00                brk 
3c9a:019c:1   00                brk 
3c9b:019d:1   00                brk 
3c9c:019e:1   00                brk 
3c9d:019f:1   00                brk 
3c9e:01a0:1   00                brk 
3c9f:01a1:1   00                brk 
3ca0:01a2:1   00                brk 
3ca1:01a3:1   00                brk 
3ca2:01a4:1   00                brk 
3ca3:01a5:1   00                brk 
3ca4:01a6:1   00                brk 
3ca5:01a7:1   00                brk 
3ca6:01a8:1   00                brk 
3ca7:01a9:1   00                brk 
3ca8:01aa:1   00                brk 
3ca9:01ab:1   00                brk 
3caa:01ac:1   00                brk 
3cab:01ad:1   00                brk 
3cac:01ae:1   00                brk 
3cad:01af:1   00                brk 
3cae:01b0:1   00                brk 
3caf:01b1:1   00                brk 
3cb0:01b2:1   00                brk 
3cb1:01b3:1   00                brk 
3cb2:01b4:1   00                brk 
3cb3:01b5:1   00                brk 
3cb4:01b6:1   00                brk 
3cb5:01b7:1   00                brk 
3cb6:01b8:1   00                brk 
3cb7:01b9:1   00                brk 
3cb8:01ba:1   00                brk 
3cb9:01bb:1   00                brk 
3cba:01bc:1   00                brk 
3cbb:01bd:1   00                brk 
3cbc:01be:1   00                brk 
3cbd:01bf:1   00                brk 
3cbe:01c0:1   00                brk 
3cbf:01c1:1   00                brk 
3cc0:01c2:1   ff                BAD 
3cc1:01c3:1   ff                BAD 
3cc2:01c4:1   ff                BAD 
3cc3:01c5:1   ff                BAD 
3cc4:01c6:1   ff                BAD 
3cc5:01c7:1   ff                BAD 
3cc6:01c8:1   ff                BAD 
3cc7:01c9:1   ff                BAD 
3cc8:01ca:1   ff                BAD 
3cc9:01cb:1   ff                BAD 
3cca:01cc:1   ff                BAD 
3ccb:01cd:1   ff                BAD 
3ccc:01ce:1   ff                BAD 
3ccd:01cf:1   ff                BAD 
3cce:01d0:1   ff                BAD 
3ccf:01d1:1   ff                BAD 
3cd0:01d2:1   ff                BAD 
3cd1:01d3:1   ff                BAD 
3cd2:01d4:1   ff                BAD 
3cd3:01d5:1   ff                BAD 
3cd4:01d6:1   ff                BAD 
3cd5:01d7:1   ff                BAD 
3cd6:01d8:1   ff                BAD 
3cd7:01d9:1   ff                BAD 
3cd8:01da:1   ff                BAD 
3cd9:01db:1   ff                BAD 
3cda:01dc:1   ff                BAD 
3cdb:01dd:1   ff                BAD 
3cdc:01de:1   ff                BAD 
3cdd:01df:1   ff                BAD 
3cde:01e0:1   ff                BAD 
3cdf:01e1:1   ff                BAD 
3ce0:01e2:1   ff                BAD 
3ce1:01e3:1   ff                BAD 
3ce2:01e4:1   ff                BAD 
3ce3:01e5:1   ff                BAD 
3ce4:01e6:1   ff                BAD 
3ce5:01e7:1   ff                BAD 
3ce6:01e8:1   ff                BAD 
3ce7:01e9:1   ff                BAD 
3ce8:01ea:1   ff                BAD 
3ce9:01eb:1   ff                BAD 
3cea:01ec:1   ff                BAD 
3ceb:01ed:1   ff                BAD 
3cec:01ee:1   ff                BAD 
3ced:01ef:1   ff                BAD 
3cee:01f0:1   ff                BAD 
3cef:01f1:1   ff                BAD 
3cf0:01f2:1   ff                BAD 
3cf1:01f3:1   ff                BAD 
3cf2:01f4:1   ff                BAD 
3cf3:01f5:1   ff                BAD 
3cf4:01f6:1   ff                BAD 
3cf5:01f7:1   ff                BAD 
3cf6:01f8:1   ff                BAD 
3cf7:01f9:1   ff                BAD 
3cf8:01fa:1   ff                BAD 
3cf9:01fb:1   ff                BAD 
3cfa:01fc:1   ff                BAD 
3cfb:01fd:1   ff                BAD 
3cfc:01fe:1   ff                BAD 
3cfd:01ff:1   ff                BAD 
3cfe:0200:1   ff                BAD 
3cff:0201:1   ff                BAD 
.end

What happens is that I tell the game engine it's level 5, meaning it branches down to $3b82. It loads an outdoor tavern picture, and displays the text. It then does a CPU jam.

It fails to put the caption text and execute the rest of the code.

What the event is trying to do is load a picture of a zombie (the guy in torn clothes). It loads "Ewww!..." as the caption under the picture. It then displays text informing the party they've stepped underneath a sewer overflow outlet, and then it's supposed to poison all party members and deal 100 damage each.

Can anyone point out the errors I'm making?
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

Tonight I have successfully added two completed dungeon levels to the Wine Cellar/Sewers of Skara Brae.

By searching through other event file code I was able to figure out how to get my modified NM1F.PRG file to function precisely how I wanted it to, and I'm pleased to report that it works as intended on either dungeon level.

I'm now faced with the task of modifying two more event files, and I think I'm going to take a break from that for a day or two.
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

On to NM20.PRG, originally the "Spidergod" statue event in level 1 of the sewers.

I'm now adding code to the end of it to have a magic mouth blurb off a few pages of text to the party.

The good news is that the relocated original code operates as originally designed with no problems.

The bad news is that my modified code crashes the system, as though holding down RUN/STOP and tapping RESTORE would, only it locks the system up completely.

Code: Select all

                       *        =   $3b00 ;  C64 


3b00:0002:1   a9 05             lda #$05
3b02:0004:1   c5 1e             cmp $1e
3b04:0006:1   d0 03             bne $3b09
3b06:0008:1   4c e2 3b          jmp $3be2

3b09:000b:1   e6 c1             inc $c1
3b0b:000d:1   a2 1a             ldx #$1a
3b0d:000f:1   20 03 08          jsr $0803
3b10:0012:1   20 06 08          jsr $0806
3b13:0015:1   a9 bb             lda #$bb
3b15:0017:1   85 59             sta $59
3b17:0019:1   a9 d8             lda #$d8
3b19:001b:1   85 58             sta $58
3b1b:001d:1   20 0c 08          jsr $080c
3b1e:0020:1   a0 bb             ldy #$bb
3b20:0022:1   a2 6a             ldx #$6a
3b22:0024:1   20 09 08          jsr $0809
3b25:0027:1   20 0f 08          jsr $080f
3b28:002a:1   20 3f 08          jsr $083f
3b2b:002d:1   c9 d3             cmp #$d3
3b2d:002f:1   f0 0a             beq $3b39
3b2f:0031:1   c9 cc             cmp #$cc
3b31:0033:1   d0 f2             bne $3b25
3b33:0035:1   20 06 08          jsr $0806
3b36:0038:1   4c 03 ae          jmp $ae03

3b39:003b:1   a0 bb             ldy #$bb
3b3b:003d:1   a2 bc             ldx #$bc
3b3d:003f:1   20 09 08          jsr $0809
3b40:0042:1   a9 08             lda #$08
3b42:0044:1   20 57 08          jsr $0857
3b45:0047:1   a9 28             lda #$28
3b47:0049:1   8d b0 03          sta $03b0
3b4a:004c:1   a9 01             lda #$01
3b4c:004e:1   8d b8 03          sta $03b8
3b4f:0051:1   a9 00             lda #$00
3b51:0053:1   85 3a             sta $3a
3b53:0055:1   e6 f5             inc $f5
3b55:0057:1   20 93 08          jsr $0893
3b58:005a:1   a5 4b             lda $4b
3b5a:005c:1   d0 08             bne $3b64
3b5c:005e:1   20 09 ae          jsr $ae09
3b5f:0061:1   a4 29             ldy $29
3b61:0063:1   b1 6e             lda ($6e),y
3b63:0065:1   29 fb             and #$fb
3b65:0067:1   91 6e             sta ($6e),y
3b67:0069:1   4c 03 ae          jmp $ae03

3b6a:006c:1   d4                BAD 
3b6b:006d:1   e8                inx 
3b6c:006e:1   e5 f2             sbc $f2
3b6e:0070:1   e5 a0             sbc $a0
3b70:0072:1   e9 f3             sbc #$f3
3b72:0074:1   a0 f4             ldy #$f4
3b74:0076:1   e8                inx 
3b75:0077:1   e5 a0             sbc $a0
3b77:0079:1   f3                BAD 
3b78:007a:1   f4                BAD 
3b79:007b:1   e1 f4             sbc ($f4,x)
3b7b:007d:1   f5 e5             sbc $e5,x
3b7d:007f:1   a0 ef             ldy #$ef
3b7f:0081:1   e6 a0             inc $a0
3b81:0083:1   e1 a0             sbc ($a0,x)
3b83:0085:1   ec e1 f2          cpx $f2e1
3b86:0088:1   e7                BAD 
3b87:0089:1   e5 a0             sbc $a0
3b89:008b:1   f3                BAD 
3b8a:008c:1   f0 e9             beq $3b75
3b8c:008e:1   e4 e5             cpx $e5
3b8e:0090:1   f2                BAD 
3b8f:0091:1   a0 e8             ldy #$e8
3b91:0093:1   e5 f2             sbc $f2
3b93:0095:1   e5 ae             sbc $ae
3b95:0097:1   a0 d9             ldy #$d9
3b97:0099:1   ef                BAD 
3b98:009a:1   f5 a0             sbc $a0,x
3b9a:009c:1   e3                BAD 
3b9b:009d:1   e1 ee             sbc ($ee,x)
3b9d:009f:1   00                brk 
3b9e:00a0:1   00                brk 
3b9f:00a1:1   a8                tay 
3ba0:00a2:1   d3                BAD 
3ba1:00a3:1   a9 e5             lda #$e5
3ba3:00a5:1   e1 f2             sbc ($f2,x)
3ba5:00a7:1   e3                BAD 
3ba6:00a8:1   e8                inx 
3ba7:00a9:1   a0 e9             ldy #$e9
3ba9:00ab:1   f4                BAD 
3baa:00ac:1   00                brk 
3bab:00ad:1   a8                tay 
3bac:00ae:1   cc a9 e5          cpy $e5a9
3baf:00b1:1   e1 f6             sbc ($f6,x)
3bb1:00b3:1   e5 a0             sbc $a0
3bb3:00b5:1   e9 f4             sbc #$f4
3bb5:00b7:1   a0 e1             ldy #$e1
3bb7:00b9:1   ec ef ee          cpx $eeef
3bba:00bc:1   e5 dc             sbc $dc
3bbc:00be:1   00                brk 
3bbd:00bf:1   00                brk 
3bbe:00c0:1   d4                BAD 
3bbf:00c1:1   e8                inx 
3bc0:00c2:1   e1 f4             sbc ($f4,x)
3bc2:00c4:1   a0 f7             ldy #$f7
3bc4:00c6:1   e1 f3             sbc ($f3,x)
3bc6:00c8:1   a0 ee             ldy #$ee
3bc8:00ca:1   ef                BAD 
3bc9:00cb:1   f4                BAD 
3bca:00cc:1   a0 e1             ldy #$e1
3bcc:00ce:1   a0 f7             ldy #$f7
3bce:00d0:1   e9 f3             sbc #$f3
3bd0:00d2:1   e5 a0             sbc $a0
3bd2:00d4:1   ed ef f6          sbc $f6ef
3bd5:00d7:1   e5 a1             sbc $a1
3bd7:00d9:1   dc                BAD 
3bd8:00da:1   d3                BAD 
3bd9:00db:1   f0 e9             beq $3bc4
3bdb:00dd:1   e4 e5             cpx $e5
3bdd:00df:1   f2                BAD 
3bde:00e0:1   e7                BAD 
3bdf:00e1:1   ef                BAD 
3be0:00e2:1   e4 dc             cpx $dc

-NEW CODE AFTER HERE-
3be2:00e4:1   e6 c1             inc $c1
3be4:00e6:1   a2 2d             ldx #$2d
3be6:00e8:1   20 03 08          jsr $0803
3be9:00eb:1   20 06 08          jsr $0806
3bec:00ee:1   a9 bb             lda #$bb
3bee:00f0:1   85 59             sta $59
3bf0:00f2:1   a9 fe             lda #$fe
3bf2:00f4:1   85 58             sta $58
3bf4:00f6:1   20 0c 08          jsr $080c
3bf7:00f9:1   a0 bc             ldy #$bc
3bf9:00fb:1   a2 07             ldx #$07
3bfb:00fd:1   20 09 08          jsr $0809
3bfe:0100:1   cd ef f5          cmp $f5ef
3c01:0103:1   f4                BAD 
3c02:0104:1   e8                inx 
3c03:0105:1   ae ae ae          ldx $aeae
3c06:0108:1   dc                BAD 
3c07:0109:1   ee a0 f4          inc $f4a0
3c0a:010c:1   e8                inx 
3c0b:010d:1   e5 a0             sbc $a0
3c0d:010f:1   e4 e5             cpx $e5
3c0f:0111:1   f0 f4             beq $3c05
3c11:0113:1   f8                sed 
3c12:0114:1   f3                BAD 
3c13:0115:1   a0 ef             ldy #$ef
3c15:0117:1   e6 a0             inc $a0
3c17:0119:1   c4 f2             cpy $f2
3c19:011b:1   e5 fa             sbc $fa
3c1b:011d:1   a7                BAD 
3c1c:011e:1   c2                BAD 
3c1d:011f:1   f2                BAD 
3c1e:0120:1   e1 e5             sbc ($e5,x)
3c20:0122:1   ac a0 e1          ldy $e1a0
3c23:0125:1   ee a0 e1          inc $e1a0
3c26:0128:1   ee e3 e9          inc $e9e3
3c29:012b:1   e5 ee             sbc $ee
3c2b:012d:1   f4                BAD 
3c2c:012e:1   a0 e3             ldy #$e3
3c2e:0130:1   e9 f4             sbc #$f4
3c30:0132:1   f9 a0 f4          sbc $f4a0,y
3c33:0135:1   e8                inx 
3c34:0136:1   e1 f4             sbc ($f4,x)
3c36:0138:1   a0 e5             ldy #$e5
3c38:013a:1   f8                sed 
3c39:013b:1   e9 f3             sbc #$f3
3c3b:013d:1   f4                BAD 
3c3c:013e:1   e5 e4             sbc $e4
3c3e:0140:1   a0 e2             ldy #$e2
3c40:0142:1   e5 e6             sbc $e6
3c42:0144:1   ef                BAD 
3c43:0145:1   f2                BAD 
3c44:0146:1   e5 a0             sbc $a0
3c46:0148:1   f9 ef f5          sbc $f5ef,y
3c49:014b:1   f2                BAD 
3c4a:014c:1   a0 e6             ldy #$e6
3c4c:014e:1   ef                BAD 
3c4d:014f:1   f2                BAD 
3c4e:0150:1   e5 e6             sbc $e6
3c50:0152:1   e1 f4             sbc ($f4,x)
3c52:0154:1   e8                inx 
3c53:0155:1   e5 f2             sbc $f2
3c55:0157:1   f3                BAD 
3c56:0158:1   ae a0 d4          ldx $d4a0
3c59:015b:1   e8                inx 
3c5a:015c:1   ef                BAD 
3c5b:015d:1   f5 e7             sbc $e7,x
3c5d:015f:1   e8                inx 
3c5e:0160:1   a0 ee             ldy #$ee
3c60:0162:1   ef                BAD 
3c61:0163:1   f7                BAD 
3c62:0164:1   a0 e9             ldy #$e9
3c64:0166:1   ee a0 f2          inc $f2a0
3c67:0169:1   f5 e9             sbc $e9,x
3c69:016b:1   ee f3 ac          inc $acf3
3c6c:016e:1   a0 e9             ldy #$e9
3c6e:0170:1   f4                BAD 
3c6f:0171:1   a0 f7             ldy #$f7
3c71:0173:1   e1 f3             sbc ($f3,x)
3c73:0175:1   a0 ef             ldy #$ef
3c75:0177:1   ee e3 e5          inc $e5e3
3c78:017a:1   a0 e1             ldy #$e1
3c7a:017c:1   a0 ec             ldy #$ec
3c7c:017e:1   e9 f6             sbc #$f6
3c7e:0180:1   e5 ec             sbc $ec
3c80:0182:1   f9 a0 f0          sbc $f0a0,y
3c83:0185:1   ec e1 e3          cpx $e3e1
3c86:0188:1   e5 a0             sbc $a0
3c88:018a:1   e6 f5             inc $f5
3c8a:018c:1   ec ec a0          cpx $a0ec
3c8d:018f:1   ef                BAD 
3c8e:0190:1   e6 a0             inc $a0
3c90:0192:1   ed f5 f3          sbc $f3f5
3c93:0195:1   e9 e3             sbc #$e3
3c95:0197:1   ac a0 ed          ldy $eda0
3c98:019a:1   e1 e7             sbc ($e7,x)
3c9a:019c:1   e9 e3             sbc #$e3
3c9c:019e:1   ac a0 e1          ldy $e1a0
3c9f:01a1:1   ee e4 a0          inc $a0e4
3ca2:01a4:1   f4                BAD 
3ca3:01a5:1   f2                BAD 
3ca4:01a6:1   e1 e4             sbc ($e4,x)
3ca6:01a8:1   e5 ae             sbc $ae
3ca8:01aa:1   00                brk 
3ca9:01ab:1   db                BAD 
3caa:01ac:1   d0 f2             bne $3c9e
3cac:01ae:1   e5 f3             sbc $f3
3cae:01b0:1   f3                BAD 
3caf:01b1:1   a0 e1             ldy #$e1
3cb1:01b3:1   a0 eb             ldy #$eb
3cb3:01b5:1   e5 f9             sbc $f9
3cb5:01b7:1   dd dc 00          cmp $00dc,x
3cb8:01ba:1   00                brk 
3cb9:01bb:1   00                brk 
3cba:01bc:1   00                brk 
3cbb:01bd:1   00                brk 
3cbc:01be:1   00                brk 
3cbd:01bf:1   00                brk 
3cbe:01c0:1   00                brk 
3cbf:01c1:1   00                brk 
3cc0:01c2:1   ff                BAD 
3cc1:01c3:1   ff                BAD 
3cc2:01c4:1   ff                BAD 
3cc3:01c5:1   ff                BAD 
3cc4:01c6:1   ff                BAD 
3cc5:01c7:1   ff                BAD 
3cc6:01c8:1   ff                BAD 
3cc7:01c9:1   ff                BAD 
3cc8:01ca:1   ff                BAD 
3cc9:01cb:1   ff                BAD 
3cca:01cc:1   ff                BAD 
3ccb:01cd:1   ff                BAD 
3ccc:01ce:1   ff                BAD 
3ccd:01cf:1   ff                BAD 
3cce:01d0:1   ff                BAD 
3ccf:01d1:1   ff                BAD 
3cd0:01d2:1   ff                BAD 
3cd1:01d3:1   ff                BAD 
3cd2:01d4:1   ff                BAD 
3cd3:01d5:1   ff                BAD 
3cd4:01d6:1   ff                BAD 
3cd5:01d7:1   ff                BAD 
3cd6:01d8:1   ff                BAD 
3cd7:01d9:1   ff                BAD 
3cd8:01da:1   ff                BAD 
3cd9:01db:1   ff                BAD 
3cda:01dc:1   ff                BAD 
3cdb:01dd:1   ff                BAD 
3cdc:01de:1   ff                BAD 
3cdd:01df:1   ff                BAD 
3cde:01e0:1   ff                BAD 
3cdf:01e1:1   ff                BAD 
3ce0:01e2:1   ff                BAD 
3ce1:01e3:1   ff                BAD 
3ce2:01e4:1   ff                BAD 
3ce3:01e5:1   ff                BAD 
3ce4:01e6:1   ff                BAD 
3ce5:01e7:1   ff                BAD 
3ce6:01e8:1   ff                BAD 
3ce7:01e9:1   ff                BAD 
3ce8:01ea:1   ff                BAD 
3ce9:01eb:1   ff                BAD 
3cea:01ec:1   ff                BAD 
3ceb:01ed:1   ff                BAD 
3cec:01ee:1   ff                BAD 
3ced:01ef:1   ff                BAD 
3cee:01f0:1   ff                BAD 
3cef:01f1:1   ff                BAD 
3cf0:01f2:1   ff                BAD 
3cf1:01f3:1   ff                BAD 
3cf2:01f4:1   ff                BAD 
3cf3:01f5:1   ff                BAD 
3cf4:01f6:1   ff                BAD 
3cf5:01f7:1   ff                BAD 
3cf6:01f8:1   ff                BAD 
3cf7:01f9:1   ff                BAD 
3cf8:01fa:1   ff                BAD 
3cf9:01fb:1   ff                BAD 
3cfa:01fc:1   ff                BAD 
3cfb:01fd:1   ff                BAD 
3cfc:01fe:1   ff                BAD 
3cfd:01ff:1   ff                BAD 
3cfe:0200:1   ff                BAD 
3cff:0201:1   ff                BAD 
3d00:0202:1   00                brk 
3d01:0203:1   00                brk 
3d02:0204:1   00                brk 
3d03:0205:1   00                brk 
3d04:0206:1   00                brk 
3d05:0207:1   00                brk 
3d06:0208:1   00                brk 
3d07:0209:1   00                brk 
3d08:020a:1   00                brk 
3d09:020b:1   00                brk 
3d0a:020c:1   00                brk 
3d0b:020d:1   00                brk 
3d0c:020e:1   00                brk 
3d0d:020f:1   00                brk 
3d0e:0210:1   00                brk 
3d0f:0211:1   00                brk 
3d10:0212:1   00                brk 
3d11:0213:1   00                brk 
3d12:0214:1   00                brk 
3d13:0215:1   00                brk 
3d14:0216:1   00                brk 
3d15:0217:1   00                brk 
3d16:0218:1   00                brk 
3d17:0219:1   00                brk 
3d18:021a:1   00                brk 
3d19:021b:1   00                brk 
3d1a:021c:1   00                brk 
3d1b:021d:1   00                brk 
3d1c:021e:1   00                brk 
3d1d:021f:1   00                brk 
3d1e:0220:1   00                brk 
3d1f:0221:1   00                brk 
3d20:0222:1   00                brk 
3d21:0223:1   00                brk 
3d22:0224:1   00                brk 
3d23:0225:1   00                brk 
3d24:0226:1   00                brk 
3d25:0227:1   00                brk 
3d26:0228:1   00                brk 
3d27:0229:1   00                brk 
3d28:022a:1   00                brk 
3d29:022b:1   00                brk 
3d2a:022c:1   00                brk 
3d2b:022d:1   00                brk 
3d2c:022e:1   00                brk 
3d2d:022f:1   00                brk 
3d2e:0230:1   00                brk 
3d2f:0231:1   00                brk 
3d30:0232:1   00                brk 
3d31:0233:1   00                brk 
3d32:0234:1   00                brk 
3d33:0235:1   00                brk 
3d34:0236:1   00                brk 
3d35:0237:1   00                brk 
3d36:0238:1   00                brk 
3d37:0239:1   00                brk 
3d38:023a:1   00                brk 
3d39:023b:1   00                brk 
3d3a:023c:1   00                brk 
3d3b:023d:1   00                brk 
3d3c:023e:1   00                brk 
3d3d:023f:1   00                brk 
3d3e:0240:1   00                brk 
3d3f:0241:1   00                brk 
3d40:0242:1   ff                BAD 
3d41:0243:1   ff                BAD 
3d42:0244:1   ff                BAD 
3d43:0245:1   ff                BAD 
3d44:0246:1   ff                BAD 
3d45:0247:1   ff                BAD 
3d46:0248:1   ff                BAD 
3d47:0249:1   ff                BAD 
3d48:024a:1   ff                BAD 
3d49:024b:1   ff                BAD 
3d4a:024c:1   ff                BAD 
3d4b:024d:1   ff                BAD 
3d4c:024e:1   ff                BAD 
3d4d:024f:1   ff                BAD 
3d4e:0250:1   ff                BAD 
3d4f:0251:1   ff                BAD 
3d50:0252:1   ff                BAD 
3d51:0253:1   ff                BAD 
3d52:0254:1   ff                BAD 
3d53:0255:1   ff                BAD 
3d54:0256:1   ff                BAD 
3d55:0257:1   ff                BAD 
3d56:0258:1   ff                BAD 
3d57:0259:1   ff                BAD 
3d58:025a:1   ff                BAD 
3d59:025b:1   ff                BAD 
3d5a:025c:1   ff                BAD 
3d5b:025d:1   ff                BAD 
3d5c:025e:1   ff                BAD 
3d5d:025f:1   ff                BAD 
3d5e:0260:1   ff                BAD 
3d5f:0261:1   ff                BAD 
3d60:0262:1   ff                BAD 
3d61:0263:1   ff                BAD 
3d62:0264:1   ff                BAD 
3d63:0265:1   ff                BAD 
3d64:0266:1   ff                BAD 
3d65:0267:1   ff                BAD 
3d66:0268:1   ff                BAD 
3d67:0269:1   ff                BAD 
3d68:026a:1   ff                BAD 
3d69:026b:1   ff                BAD 
3d6a:026c:1   ff                BAD 
3d6b:026d:1   ff                BAD 
3d6c:026e:1   ff                BAD 
3d6d:026f:1   ff                BAD 
3d6e:0270:1   ff                BAD 
3d6f:0271:1   ff                BAD 
3d70:0272:1   ff                BAD 
3d71:0273:1   ff                BAD 
3d72:0274:1   ff                BAD 
3d73:0275:1   ff                BAD 
3d74:0276:1   ff                BAD 
3d75:0277:1   ff                BAD 
3d76:0278:1   ff                BAD 
3d77:0279:1   ff                BAD 
3d78:027a:1   ff                BAD 
3d79:027b:1   ff                BAD 
3d7a:027c:1   ff                BAD 
3d7b:027d:1   ff                BAD 
3d7c:027e:1   ff                BAD 
3d7d:027f:1   ff                BAD 
3d7e:0280:1   ff                BAD 
3d7f:0281:1   ff                BAD 
3d80:0282:1   00                brk 
3d81:0283:1   00                brk 
3d82:0284:1   00                brk 
3d83:0285:1   00                brk 
3d84:0286:1   00                brk 
3d85:0287:1   00                brk 
3d86:0288:1   00                brk 
3d87:0289:1   00                brk 
3d88:028a:1   00                brk 
3d89:028b:1   00                brk 
3d8a:028c:1   00                brk 
3d8b:028d:1   00                brk 
3d8c:028e:1   00                brk 
3d8d:028f:1   00                brk 
3d8e:0290:1   00                brk 
3d8f:0291:1   00                brk 
3d90:0292:1   00                brk 
3d91:0293:1   00                brk 
3d92:0294:1   00                brk 
3d93:0295:1   00                brk 
3d94:0296:1   00                brk 
3d95:0297:1   00                brk 
3d96:0298:1   00                brk 
3d97:0299:1   00                brk 
3d98:029a:1   00                brk 
3d99:029b:1   00                brk 
3d9a:029c:1   00                brk 
3d9b:029d:1   00                brk 
3d9c:029e:1   00                brk 
3d9d:029f:1   00                brk 
3d9e:02a0:1   00                brk 
3d9f:02a1:1   00                brk 
3da0:02a2:1   00                brk 
3da1:02a3:1   00                brk 
3da2:02a4:1   00                brk 
3da3:02a5:1   00                brk 
3da4:02a6:1   00                brk 
3da5:02a7:1   00                brk 
3da6:02a8:1   00                brk 
3da7:02a9:1   00                brk 
3da8:02aa:1   00                brk 
3da9:02ab:1   00                brk 
3daa:02ac:1   00                brk 
3dab:02ad:1   00                brk 
3dac:02ae:1   00                brk 
3dad:02af:1   00                brk 
3dae:02b0:1   00                brk 
3daf:02b1:1   00                brk 
3db0:02b2:1   00                brk 
3db1:02b3:1   00                brk 
3db2:02b4:1   00                brk 
3db3:02b5:1   00                brk 
3db4:02b6:1   00                brk 
3db5:02b7:1   00                brk 
3db6:02b8:1   00                brk 
3db7:02b9:1   00                brk 
3db8:02ba:1   00                brk 
3db9:02bb:1   00                brk 
3dba:02bc:1   00                brk 
3dbb:02bd:1   00                brk 
3dbc:02be:1   00                brk 
3dbd:02bf:1   00                brk 
3dbe:02c0:1   00                brk 
3dbf:02c1:1   00                brk 
3dc0:02c2:1   ff                BAD 
3dc1:02c3:1   ff                BAD 
3dc2:02c4:1   ff                BAD 
3dc3:02c5:1   ff                BAD 
3dc4:02c6:1   ff                BAD 
3dc5:02c7:1   ff                BAD 
3dc6:02c8:1   ff                BAD 
3dc7:02c9:1   ff                BAD 
3dc8:02ca:1   ff                BAD 
3dc9:02cb:1   ff                BAD 
3dca:02cc:1   ff                BAD 
3dcb:02cd:1   ff                BAD 
3dcc:02ce:1   ff                BAD 
3dcd:02cf:1   ff                BAD 
3dce:02d0:1   ff                BAD 
3dcf:02d1:1   ff                BAD 
3dd0:02d2:1   ff                BAD 
3dd1:02d3:1   ff                BAD 
3dd2:02d4:1   ff                BAD 
3dd3:02d5:1   ff                BAD 
3dd4:02d6:1   ff                BAD 
3dd5:02d7:1   ff                BAD 
3dd6:02d8:1   ff                BAD 
3dd7:02d9:1   ff                BAD 
3dd8:02da:1   ff                BAD 
3dd9:02db:1   ff                BAD 
3dda:02dc:1   ff                BAD 
3ddb:02dd:1   ff                BAD 
3ddc:02de:1   ff                BAD 
3ddd:02df:1   ff                BAD 
3dde:02e0:1   ff                BAD 
3ddf:02e1:1   ff                BAD 
3de0:02e2:1   ff                BAD 
3de1:02e3:1   ff                BAD 
3de2:02e4:1   ff                BAD 
3de3:02e5:1   ff                BAD 
3de4:02e6:1   ff                BAD 
3de5:02e7:1   ff                BAD 
3de6:02e8:1   ff                BAD 
3de7:02e9:1   ff                BAD 
3de8:02ea:1   ff                BAD 
3de9:02eb:1   ff                BAD 
3dea:02ec:1   ff                BAD 
3deb:02ed:1   ff                BAD 
3dec:02ee:1   ff                BAD 
3ded:02ef:1   ff                BAD 
3dee:02f0:1   ff                BAD 
3def:02f1:1   ff                BAD 
3df0:02f2:1   ff                BAD 
3df1:02f3:1   ff                BAD 
3df2:02f4:1   ff                BAD 
3df3:02f5:1   ff                BAD 
3df4:02f6:1   ff                BAD 
3df5:02f7:1   ff                BAD 
3df6:02f8:1   ff                BAD 
3df7:02f9:1   ff                BAD 
3df8:02fa:1   ff                BAD 
3df9:02fb:1   ff                BAD 
3dfa:02fc:1   ff                BAD 
3dfb:02fd:1   ff                BAD 
3dfc:02fe:1   ff                BAD 
3dfd:02ff:1   ff                BAD 
3dfe:0300:1   ff                BAD 
3dff:0301:1   ff                BAD 
.end
The "new code" should load the image of the magic mouth, load "Mouth..." under the caption window and proceed to print a screen of text. Inexplicably the system crashes instead.

My immediate thought is that the event file has been made too large, i.e. event code can't reside in memory beyond a certain limit (say $bbff). If this is so then I'm pretty much dead-ended in terms of crafting my own event files.

Goddamn it, what the hell is with that immovable jump table BS anyways. Honestly, such a pain in the ass.
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

The solution was to replace a JMP command with a BEQ right after a BNE. Also had to move all the executable code towards the top of the file.

So that solved it, except the file wasn't large enough for the texts I wanted, so I had to load it into WinVICE using the monitor's BLOAD command, then I BSAVED it back telling it to save up to, say, $3EFF.

Doing this seemed to work, except now the load address bytes were somehow ruined and 64Copy wouldn't manipulate it properly.

So I just deleted the whole NM20.PRG and will be reentering the entire $%^&*()ing thing by hand all over again.

How did Mr Cranford not punch walls programming this game? :?
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

The world didn't end today, so I've continued on my meagre quest.

Finished modifying 1 and a half event files and have come across yet again a glitch that causes a CPU jam.

Of course, that's what I get for adding like 800 bytes to a piece of ML code.

Gonna call it quits for the night because if I don't I'll be up until sunrise again.
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

My coding/testing has yielded some useful information regarding this subroutine:

Code: Select all

089c
It applies damage to the currently held roster # in $0044. The damage amount is held in $0045 and $0046, and the special condition is held in $00c8.

I've figured out the values (at least most of them) that $00c8 can have to produce the following effects:

0 - Nothing (for if you just wanna deal regular damage)
1 - Psnd
2 - Nothing? (didn't have any obvious effect on party, but see 4)
3 - Nuts
4 - Doubles the damage in $45/$46
5 - Poss
6 - Ston
7 - Dead

I'm guessing 2 was the "Para" function that was not implemented. I'm not certain though.

So there you have it, just for interest's sake.

Back to debugging.
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

Found out the hard way that you cannot safely increase the size of dungeon files or the system will crash out.

This means that there is a finite number of bytes reserved for text messages "a la 'On the wall is written...'". Just in case anyone was curious.

If you want your messages to be long, multi-page deals (and/or you want to have more than 8 per dungeon level) then you need to put them into loadable events.

Fun times ahead.
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

Sick on Christmas day with sore joints, so I won't be working on this today.
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

I've almosted finished my demo, I just have one more event to write in.

Sadly, I've encountered an inexplicable glitch where the system hangs despite entering the code correctly.

I'm going to have to try a different strategy.

So much for a 2012 release. :roll:
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

All that remains is to restore the dungeon files I originally modified so that the original game runs as intended and I'll be set to release a demo.
User avatar
ZeroZero
Posts: 286
Joined: Tue Mar 10, 2009 9:10 pm
Location: Germany

Post by ZeroZero »

Updates: found compass spell routine & variable
Post Reply