From 0d7d28dcfa08a3d161ca2bd1e774a7c28628a201 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Fri, 18 Dec 2020 19:50:01 +0100 Subject: [PATCH] fixed 40/80 column screen detection in the monitor --- src/mon_m65/,imports_monitor.s | 1 + src/mon_m65/bsmon.s | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/src/mon_m65/,imports_monitor.s b/src/mon_m65/,imports_monitor.s index 49073c70..78a85e28 100644 --- a/src/mon_m65/,imports_monitor.s +++ b/src/mon_m65/,imports_monitor.s @@ -6,6 +6,7 @@ ;; #ALIAS# SETMSG = KERNAL_0.SETMSG ;; #ALIAS# STOP = KERNAL_0.STOP +;; #ALIAS# SCREEN = KERNAL_0.SCREEN ;; #ALIAS# monitor_exit = KERNAL_0.m65_shadow_BZP diff --git a/src/mon_m65/bsmon.s b/src/mon_m65/bsmon.s index 3a2cc2e6..b28dd9e9 100644 --- a/src/mon_m65/bsmon.s +++ b/src/mon_m65/bsmon.s @@ -466,6 +466,8 @@ Fetch Mon_Memory ; ******** + JSR Set_MODE_80 + JSR Get_LAC ; get 1st. parameter LDZ #16 ; default row count BCS @row ; no address @@ -564,6 +566,8 @@ Mon_Set_Register Mon_Set_Memory ; ************ + JSR Set_MODE_80 + JSR Get_LAC ; get 1st. parameter BCS @exit JSR LAC_To_LPC ; Long_PC = row address @@ -654,6 +658,8 @@ Dump_4_Chars Dump_Row ; ****** + JSR Set_MODE_80 + PHZ JSR Print_CR LDA #'>' @@ -2805,3 +2811,30 @@ Mon_Help !pet 0 JMP Main + + +; ********* +Set_MODE_80 +; ********* + + ; Not too effective, but allows to retain more original code + + PHP + PHA + PHX + PHY + + JSR SCREEN + CPX #80 + BEQ @1 + LDA #$FF + +skip_2_bytes_trash_nvz +@1 LDA #$00 + STA MODE_80 + + PLY + PLX + PLA + PLP + + RTS