From 6dd3a6d5b2bbe4ef0880a85b053caa06ad919ba3 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Fri, 8 Jan 2021 23:53:07 +0100 Subject: [PATCH] monitor command 'M' fully adapted --- src/mon_m65/bsmon.s | 22 ++++++++-------------- src/mon_m65/mon_helper_memory.s | 3 +-- src/mon_m65/mon_helper_print.s | 27 +++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 16 deletions(-) create mode 100644 src/mon_m65/mon_helper_print.s diff --git a/src/mon_m65/bsmon.s b/src/mon_m65/bsmon.s index f76705f3..20eb2adc 100644 --- a/src/mon_m65/bsmon.s +++ b/src/mon_m65/bsmon.s @@ -192,7 +192,7 @@ Jump_Table: !word Mon_Go ; G XXX to be debugged/adapted !word Mon_Hunt ; H XXX to be debugged/adapted !word Mon_JSR ; J XXX to be debugged/adapted - !word Mon_Memory ; M XXX to be debugged/adapted + !word Mon_Memory ; M !word Mon_Register ; R !word Mon_Transfer ; T XXX to be debugged/adapted !word Mon_Exit ; X @@ -528,9 +528,7 @@ Mon_JSR: Dump_4_Bytes: ; XXX to be adapted ; *********** - JSR CHROUT ; colour -@loop - JSR Get_From_Memory +@loop JSR Get_From_Memory JSR Print_Hex_Blank INZ TZA @@ -542,11 +540,7 @@ Dump_4_Bytes: ; XXX to be adapted Dump_4_Chars: ; XXX to be adapted ; *********** - LDY #0 - STY QTSW ; disable quote mode - JSR CHROUT ; colour -@loop - JSR Get_From_Memory +@loop JSR Get_From_Memory TAY AND #%01100000 BNE @laba @@ -573,9 +567,9 @@ Dump_Row: LDX #2 ; 2 blocks in 80 columns BBR7 MODE_80,@loop DEX ; 1 block in 40 columns -@loop LDA #KEY_LT_RED +@loop JSR Print_Attr_Bold JSR Dump_4_Bytes - LDA #KEY_WHITE + JSR Print_Attr_NoBold JSR Dump_4_Bytes DEX BNE @loop @@ -583,13 +577,13 @@ Dump_Row: BBS7 MODE_80,@done ; in 40 columns, do not display chars JSR PRIMM - !byte $3a,$12,$00 ; : reverse on + !byte $3a,$12,$00 ; reverse on LDZ #0 LDX #2 ; 4 blocks in 80 columns -@lchr LDA #KEY_LT_RED ; XXX replace color with bold attribute +@lchr JSR Print_Attr_Bold JSR Dump_4_Chars - LDA #KEY_WHITE ; XXX replace color with bold attribute + JSR Print_Attr_NoBold JSR Dump_4_Chars DEX BNE @lchr diff --git a/src/mon_m65/mon_helper_memory.s b/src/mon_m65/mon_helper_memory.s index e0a5a884..7be5de6d 100644 --- a/src/mon_m65/mon_helper_memory.s +++ b/src/mon_m65/mon_helper_memory.s @@ -1,7 +1,6 @@ -; Monitor helper code - read and write +; Monitor helper code - memory read and write -; XXX there is a bug somewhere with wrapping arounf $FFFF Get_From_Memory: diff --git a/src/mon_m65/mon_helper_print.s b/src/mon_m65/mon_helper_print.s new file mode 100644 index 00000000..4ad15ce9 --- /dev/null +++ b/src/mon_m65/mon_helper_print.s @@ -0,0 +1,27 @@ + +; Monitor helper code - output printing + + +Print_Attr_Bold: + + jsr Print_Attr_Common1 + lda #'s' + bra Print_Attr_Common2 + +Print_Attr_NoBold: + + jsr Print_Attr_Common1 + lda #'u' + + ; FALLTROUGH + +Print_Attr_Common2: + + jmp CHROUT + +Print_Attr_Common1: + + lda #$00 + sta QTSW ; make sure quote mode is disabled + lda #KEY_ESC + jmp CHROUT