From fc9a9c757b9f569fe71e54957caea2987f54941e Mon Sep 17 00:00:00 2001 From: Karkat Date: Sat, 3 Jun 2017 17:41:50 -0400 Subject: [PATCH] fixes dialog & map --- dialog.asm | 78 +++++++++++++++++++++---------------------- pendantcrystalhud.asm | 3 +- 2 files changed, 40 insertions(+), 41 deletions(-) diff --git a/dialog.asm b/dialog.asm index ab562eb..4d95c9f 100644 --- a/dialog.asm +++ b/dialog.asm @@ -44,43 +44,11 @@ RTL ; PLY : PLX : PLA ;endmacro ;-------------------------------------------------------------------------------- -;macro LoadDialogAddress(address) -; PHA : PHX : PHY -; PHP -; PHB : PHK : PLB -; SEP #$30 ; set 8-bit accumulator and index registers -; LDA $00 : PHA -; LDA $01 : PHA -; LDA $02 : PHA -; LDA.b #$01 : STA $7F5035 ; set flag -; -; LDA.b #
: STA $00 ; write pointer to direct page -; LDA.b #
>>8 : STA $01 -; LDA.b #
>>16 : STA $02 -; -; LDX.b #$00 : LDY.b #$00 -; - -; LDA [$00], Y ; load the next character from the pointer -; STA $7F5700, X ; write to the buffer -; INX : INY -; CMP.b #$7F : BNE - -; PLA : STA $02 -; PLA : STA $01 -; PLA : STA $00 -; PLB -; PLP -; PLY : PLX : PLA -;endmacro -;-------------------------------------------------------------------------------- -!OFFSET_POINTER = "$7F5094" -!OFFSET_RETURN = "$7F5096" -!DIALOG_BUFFER = "$7F5700" macro LoadDialogAddress(address) PHA : PHX : PHY PHP PHB : PHK : PLB - SEP #$20 ; set 8-bit accumulator - REP #$10 ; set 16-bit index registers + SEP #$30 ; set 8-bit accumulator and index registers LDA $00 : PHA LDA $01 : PHA LDA $02 : PHA @@ -90,16 +58,12 @@ macro LoadDialogAddress(address) LDA.b #
>>8 : STA $01 LDA.b #
>>16 : STA $02 - LDA !OFFSET_POINTER : TAX : LDY.w #$0000 + LDX.b #$00 : LDY.b #$00 - LDA [$00], Y ; load the next character from the pointer - STA !DIALOG_BUFFER, X ; write to the buffer + STA $7F5700, X ; write to the buffer INX : INY CMP.b #$7F : BNE - - REP #$20 ; set 16-bit accumulator - TXA : STA !OFFSET_RETURN ; copy out X into - LDA.w #$0000 : STA !OFFSET_POINTER - SEP #$20 ; set 8-bit accumulator PLA : STA $02 PLA : STA $01 PLA : STA $00 @@ -108,6 +72,42 @@ macro LoadDialogAddress(address) PLY : PLX : PLA endmacro ;-------------------------------------------------------------------------------- +!OFFSET_POINTER = "$7F5094" +!OFFSET_RETURN = "$7F5096" +!DIALOG_BUFFER = "$7F5700" +;macro LoadDialogAddress(address) +; PHA : PHX : PHY +; PHP +; PHB : PHK : PLB +; SEP #$20 ; set 8-bit accumulator +; REP #$10 ; set 16-bit index registers +; LDA $00 : PHA +; LDA $01 : PHA +; LDA $02 : PHA +; LDA.b #$01 : STA $7F5035 ; set flag +; +; LDA.b #
: STA $00 ; write pointer to direct page +; LDA.b #
>>8 : STA $01 +; LDA.b #
>>16 : STA $02 +; +; LDA !OFFSET_POINTER : TAX : LDY.w #$0000 +; - +; LDA [$00], Y ; load the next character from the pointer +; STA !DIALOG_BUFFER, X ; write to the buffer +; INX : INY +; CMP.b #$7F : BNE - +; REP #$20 ; set 16-bit accumulator +; TXA : STA !OFFSET_RETURN ; copy out X into +; LDA.w #$0000 : STA !OFFSET_POINTER +; SEP #$20 ; set 8-bit accumulator +; PLA : STA $02 +; PLA : STA $01 +; PLA : STA $00 +; PLB +; PLP +; PLY : PLX : PLA +;endmacro +;-------------------------------------------------------------------------------- FreeDungeonItemNotice: PHX : PHA LDA.l FreeItemTest : BNE + : BRL .skip : + diff --git a/pendantcrystalhud.asm b/pendantcrystalhud.asm index 78bb16e..51650d1 100644 --- a/pendantcrystalhud.asm +++ b/pendantcrystalhud.asm @@ -31,8 +31,7 @@ RTL !INVENTORY_MAP = "$7EF368" OverworldMap_CheckObject: PHX - LDA $FFFFFF - LDA $7EF3C7 : CMP.b #$03 : BNE + + LDA $7EF3CA : AND.b #$40 : BNE + ;LW Map LDA.l MapMode : BEQ +++ LDA.l !INVENTORY_MAP : AND.b #$01 : BNE +++