From e75eaec86c88e9223b1682098e9d27622877f20c Mon Sep 17 00:00:00 2001 From: Brett Gordon Date: Wed, 30 Sep 2015 16:32:55 -0400 Subject: [PATCH] coco3: check for pal/ntsc bit in BASIC ROM, set hardware regs accordingly. --- Kernel/platform-coco3/coco3.s | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Kernel/platform-coco3/coco3.s b/Kernel/platform-coco3/coco3.s index 1a17988d..fe9b3bbc 100644 --- a/Kernel/platform-coco3/coco3.s +++ b/Kernel/platform-coco3/coco3.s @@ -105,6 +105,10 @@ _irqrestore: ; B holds the data ; ----------------------------------------------------------------------------- ; KERNEL MEMORY BANK ; ----------------------------------------------------------------------------- + .area .data +hz: .db 0 ; Is machine in 50hz? + + .area .text ;;; Stuff to initialize *before* hardware @@ -138,8 +142,17 @@ b@ sta ,x+ ;; set temporary screen up ldb #%01000100 ; coco3 mode stb $ff90 - ldb #%00000100 ; text / 8 lines per char row - stb $ff98 + ;; detect PAL or NTSC ROM + ldb #$3f ; put Super BASIC in mmu + stb $ffae ; + lda $c033 ; get BASIC's "mirror" of Video Reg + ldb #$06 ; put Fuzix Kernel back in mmu + stb $ffae ; + anda #$8 ; mask off 50 hz bit + sta hz ; save for future use + ;; continue setup of regs + ora #%00000100 ; text / 8 lines per char row + sta $ff98 ldb #%00010100 ; 80 column mode stb $ff99 ldd #$b400/8 ; video at physical 0xb000 -- 2.34.1