Users browsing this thread: 2 Guest(s)
Request: No items lost at Colosseum
I forgot the case of the reward being the same as item bet with a quantity of 1 (and battle won). The above code would remove 1 then null the item, and when later 1 would be added to item it would still be null so it wouldn't display in the inventory. I have 2 untested solutions for this:
1) I added a check, if item waged is same as item won, nothing happen, including no Colosseum message:
2) I added a check when the quantity is added, if it's 1 then I put the item as not null, since previous quantity was 0 and item had being nulled out. This solution keep the Colosseum message:
1) I added a check, if item waged is same as item won, nothing happen, including no Colosseum message:
Code:
hirom
org $C25D79
lda $0207
cmp $0205
beq skip
jsr free_space
org $C25D8F
skip:
org $C2499E
bra jump
org $C249C4
jump:
org $C26469
free_space:
tdc
lda $0205
rep #$10
phx
ldx #$0000
loop:
cmp $2686,X
beq found
inx
inx
inx
inx
inx
cpx #$0500
bne loop
found:
dec $2689,X
lda $2689,X
bne exit
lda #$FF
sta $2686,X
exit:
plx
sep #$10
lda #$01
sta $2E75
lda $0207
sta $2F35
rts
2) I added a check when the quantity is added, if it's 1 then I put the item as not null, since previous quantity was 0 and item had being nulled out. This solution keep the Colosseum message:
Code:
hirom
org $C25D79
jsr free_space
nop
nop
org $C25D8F
skip:
org $C2499E
bra jump
org $C249C4
jump:
org $C26469
free_space:
tdc
lda $0205
rep #$10
phx
ldx #$0000
loop:
cmp $2686,X
beq found
inx
inx
inx
inx
inx
cpx #$0500
bne loop
found:
dec $2689,X
lda $2689,X
bne exit
lda #$FF
sta $2686,X
exit:
plx
sep #$10
lda #$01
sta $2E75
rts
org $C14491
jsr free_C1
org $C1FFE5
free_C1:
sta $2689,X
cmp #$01
bne exit2
lda $602D,Y
sta 2686,X
exit2:
rts
« Next Oldest | Next Newest »
Users browsing this thread: 2 Guest(s)