BT II - Empty Building

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

BT II - Empty Building

Post by Darendor »

BT2 Character Disk
#$EA | 234 | EOR all bytes against 11101010
2 blocks; 506 bytes (70EA TO ???? Inclusive; 9A00 - ????)
This is the subroutine that handles whenever the party enters an empty building.

The picture that is loaded depends on the building type (orange, blue, white, brown), and a table of sorts is at 9aa5. I think.

I'm not completely certain I found the end of the file. The file on disk contains a field of "01" at the end, but in memory that doesn't exist, so I excluded it.

Also curious is the JSR $0899 instruction, which seems to have #$00 in location $e1.

Code: Select all

.C:9a00  20 90 08    JSR $0890
.C:9a03  A5 5A       LDA $5A
.C:9a05  29 03       AND #$03
.C:9a07  D0 09       BNE $9A12
.C:9a09  A9 00       LDA #$00
.C:9a0b  85 E1       STA $E1
.C:9a0d  A9 FF       LDA #$FF
.C:9a0f  20 99 08    JSR $0899		Load file from T/S as per $e1
.C:9a12  AD 98 03    LDA $0398
.C:9a15  29 07       AND #$07
.C:9a17  A8          TAY
.C:9a18  BE A5 9A    LDX $9AA5,Y	4 building types
.C:9a1b  20 1B 08    JSR $081B		Display building picture depending on type of building entered
.C:9a1e  A9 9A       LDA #$9A
.C:9a20  85 59       STA $59
.C:9a22  A9 69       LDA #$69
.C:9a24  85 58       STA $58
.C:9a26  20 0F 08    JSR $080F		Display "Building" caption
.C:9a29  20 E1 08    JSR $08E1
.C:9a2c  A0 9A       LDY #$9A
.C:9a2e  A2 72       LDX #$72
.C:9a30  20 06 08    JSR $0806		"You are in an empty..."
.C:9a33  20 78 08    JSR $0878		Get keypress
.C:9a36  20 87 08    JSR $0887		Evaluate keypress
.C:9a39  C9 C5       CMP #$C5
.C:9a3b  D0 F6       BNE $9A33		Exit?  No?  Go $9a33
.C:9a3d  A6 24       LDX $24		Begin exit routine
.C:9a3f  BD A1 9A    LDA $9AA1,X
.C:9a42  85 24       STA $24		Spin party 180 degrees
.C:9a44  20 51 9A    JSR $9A51
.C:9a47  A9 00       LDA #$00
.C:9a49  85 2F       STA $2F
.C:9a4b  20 E1 08    JSR $08E1
.C:9a4e  4C 00 90    JMP $9000		Back to main program.
.C:9a51  A5 24       LDA $24
.C:9a53  F0 0B       BEQ $9A60		Facing north?  Go $9a60
.C:9a55  C9 01       CMP #$01
.C:9a57  F0 0D       BEQ $9A66		Facing east?  Go $9a66
.C:9a59  C9 02       CMP #$02
.C:9a5b  F0 06       BEQ $9A63		Facing south?  Go $9a63
.C:9a5d  C6 29       DEC $29		Move party 1 square west
.C:9a5f  60          RTS		Back to $9a47
.C:9a60  E6 28       INC $28		Move party 1 square north
.C:9a62  60          RTS		Back to $9a47
.C:9a63  C6 28       DEC $28		Move party 1 square south
.C:9a65  60          RTS		Back to $9a47
.C:9a66  E6 29       INC $29		Move party 1 square east
.C:9a68  60          RTS		Back to $9a47
.C:9a69  C2 F5       NOOP #$F5		[B][u]
.C:9a6b  E9 EC       SBC #$EC		[i][l]
.C:9a6d  E4 E9       CPX $E9		[d][i]
.C:9a6f  EE E7 DC    INC $DCE7		[n][g][EOT]
.C:9a72  D9 EF F5    CMP $F5EF,Y	[Y][o][u]
.C:9a75  A0 E1       LDY #$E1		[_][a]
.C:9a77  F2          JAM		[r]
.C:9a78  E5 A0       SBC $A0		[e][_]
.C:9a7a  E9 EE       SBC #$EE		[i][n]
.C:9a7c  A0 E1       LDY #$E1		[_][a]
.C:9a7e  EE A0 E5    INC $E5A0		[n][_][e]
.C:9a81  ED F0 F4    SBC $F4F0		[m][p][t]
.C:9a84  F9 A0 E2    SBC $E2A0,Y	[y][_][b]
.C:9a87  F5 E9       SBC $E9,X		[u][i]
.C:9a89  EC E4 E9    CPX $E9E4		[l][d][i]
.C:9a8c  EE E7 AE    INC $AEE7		[n][g][.]
.C:9a8f  00          BRK		[CR]
.C:9a90  00          BRK		[CR]
.C:9a91  A8          TAY		[(]
.C:9a92  C5 A9       CMP $A9		[E][)]
.C:9a94  F8          SED		[x]
.C:9a95  E9 F4       SBC #$F4		[i][t]
.C:9a97  A0 E2       LDY #$E2		[_][b]
.C:9a99  F5 E9       SBC $E9,X		[u][i]
.C:9a9b  EC E4 E9    CPX $E9E4		[l][d][i]
.C:9a9e  EE E7 FF    INC $FFE7		[n][g][Input]
.C:9aa1  02          JAM
.C:9aa2  03 00       SLO ($00,X)
.C:9aa4  01 00       ORA ($00,X)
.C:9aa6  10 11       BPL $9AB9
.C:9aa8  12          JAM
.C:9aa9  13
Post Reply