]> git.sur5r.net Git - cc65/commitdiff
Added get_tv for several platforms
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 3 Dec 2002 22:19:21 +0000 (22:19 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 3 Dec 2002 22:19:21 +0000 (22:19 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@1709 b7a2c559-68d2-44c3-8de9-860c34a00d81

include/cbm.h
libsrc/c128/Makefile
libsrc/c128/c128.inc
libsrc/c128/get_tv.s [new file with mode: 0644]
libsrc/c16/Makefile
libsrc/c16/get_tv.s [new file with mode: 0644]
libsrc/c64/Makefile
libsrc/c64/get_tv.s [new file with mode: 0644]
libsrc/plus4/Makefile
libsrc/plus4/get_tv.s [new file with mode: 0644]
libsrc/plus4/plus4.inc

index cd3755d791deaabbcfd4ddaacc755b693052e5d5..2db0af40bacd8ac8deb361dc216b251f5724b4bb 100644 (file)
@@ -108,6 +108,24 @@ extern unsigned char _filetype;         /* Default 'u' */
 
 
 
+/*****************************************************************************/
+/*                               Machine info                                */
+/*****************************************************************************/
+
+
+
+#if defined(__C16__) || defined(__C64__) || defined(__C128__) || defined(__PLUS4__)
+
+#define TV_NTSC 0
+#define TV_PAL  1
+
+unsigned char __fastcall__ get_tv (void);
+/* Return the video mode the machine is using */
+
+#endif
+
+
+
 /*****************************************************************************/
 /*                           CBM kernal functions                            */
 /*****************************************************************************/
index 8b9352a6106160e62e15f8cf085448faf2d961cf..6ab8bd0eacf9cb669493dc9fcd49812d8ce22aa5 100644 (file)
@@ -31,6 +31,7 @@ OBJS =        _scrsize.o      \
        crt0.o          \
                color.o         \
        cputc.o         \
+        get_tv.o        \
        kbhit.o         \
         kernal.o        \
        mouse.o         \
index c8e65bc31ecdd70429753952f944b8c7a5a1e316..61a439e05e87f5dd32630ae94491533d02293773 100644 (file)
@@ -24,6 +24,7 @@ CRAM_PTR              = $E2           ; Pointer to current char in color RAM
 
 CHARCOLOR       = $F1
 FKEY_COUNT             = $D1           ; Characters for function key
+PALFLAG         = $A03          ; $FF=PAL, $00=NTSC
 INIT_STATUS    = $A04          ; Flag: Reset/NMI Status
 FKEY_LEN       = $1000         ; Function key lengths
 FKEY_TEXT      = $100A         ; Function key texts
diff --git a/libsrc/c128/get_tv.s b/libsrc/c128/get_tv.s
new file mode 100644 (file)
index 0000000..a9ee260
--- /dev/null
@@ -0,0 +1,28 @@
+;
+; Ullrich von Bassewitz, 2002-12-03
+;
+; unsigned char __fastcall__ get_tv (void);
+; /* Return the video mode the machine is using */
+;
+
+        .export         _get_tv
+
+        .include        "c128.inc"
+
+
+;--------------------------------------------------------------------------
+; _get_tv
+
+.proc   _get_tv
+
+        ldx     #$01            ; Assume PAL
+        lda     PALFLAG
+        bne     pal
+        dex                     ; NTSC
+pal:    txa
+        ldx     #0
+        rts
+
+.endproc
+
+
index c3ed76f7d4baa19a38f3943b6de3b47739b62aa0..8577b66bba8c7df7650c6c5d88edc2e7f8167ed2 100644 (file)
@@ -19,6 +19,7 @@ OBJS =        _scrsize.o      \
        conio.o         \
        cputc.o         \
        crt0.o          \
+        get_tv.o        \
        kbhit.o         \
         kernal.o        \
         randomize.o     \
diff --git a/libsrc/c16/get_tv.s b/libsrc/c16/get_tv.s
new file mode 100644 (file)
index 0000000..b21b815
--- /dev/null
@@ -0,0 +1,28 @@
+;
+; Ullrich von Bassewitz, 2002-12-03
+;
+; unsigned char __fastcall__ get_tv (void);
+; /* Return the video mode the machine is using */
+;
+
+        .export         _get_tv
+
+        .include        "../plus4/plus4.inc"
+
+
+;--------------------------------------------------------------------------
+; _get_tv
+
+.proc   _get_tv
+
+        ldx     #$01            ; Assume PAL
+        bit     TED_MULTI1      ; Test bit 6
+        bvc     pal
+        dex                     ; NTSC
+pal:    txa
+        ldx     #0
+        rts
+
+.endproc
+
+
index 738c2c9801f5b8e05496d0195890a5798b23f5d9..c57920254eb831352d00045a61b0f382f80ed91f 100644 (file)
@@ -32,6 +32,7 @@ OBJS =        _scrsize.o              \
                color.o                 \
                conio.o                 \
                cputc.o                 \
+        get_tv.o                \
                kbhit.o                 \
         kernal.o                \
                mouse.o                 \
diff --git a/libsrc/c64/get_tv.s b/libsrc/c64/get_tv.s
new file mode 100644 (file)
index 0000000..1975293
--- /dev/null
@@ -0,0 +1,24 @@
+;
+; Ullrich von Bassewitz, 2002-12-03
+;
+; unsigned char __fastcall__ get_tv (void);
+; /* Return the video mode the machine is using */
+;
+
+        .export         _get_tv
+
+        .include        "c64.inc"
+
+
+;--------------------------------------------------------------------------
+; _get_tv
+
+.proc   _get_tv
+
+        lda     PALFLAG
+        ldx     #0
+        rts
+
+.endproc
+
+           
index 08455d48dd35eabbff19f5059c1720147ce8f1cf..3b8ce23468de0afeca2ff70849edecd6cb7ac899 100644 (file)
@@ -19,6 +19,7 @@ OBJS =        _scrsize.o      \
        conio.o         \
        cputc.o         \
        crt0.o          \
+        get_tv.o        \
         kacptr.o        \
         kbasin.o        \
        kbhit.o         \
diff --git a/libsrc/plus4/get_tv.s b/libsrc/plus4/get_tv.s
new file mode 100644 (file)
index 0000000..712d8df
--- /dev/null
@@ -0,0 +1,28 @@
+;
+; Ullrich von Bassewitz, 2002-12-03
+;
+; unsigned char __fastcall__ get_tv (void);
+; /* Return the video mode the machine is using */
+;
+
+        .export         _get_tv
+
+        .include        "plus4.inc"
+
+
+;--------------------------------------------------------------------------
+; _get_tv
+
+.proc   _get_tv
+
+        ldx     #$01            ; Assume PAL
+        bit     TED_MULTI1      ; Test bit 6
+        bvc     pal
+        dex                     ; NTSC
+pal:    txa
+        ldx     #0
+        rts
+
+.endproc
+
+
index b1d67d00f12303e2d73eb4edab5982e5ed240977..825dda15f551cc25db2fd2fc2824b93a3b8fcf5a 100644 (file)
@@ -50,6 +50,7 @@ TED_T2LO      = $FF02
 TED_T2HI       = $FF03
 TED_T3LO       = $FF04
 TED_T4HI       = $FF05
+TED_MULTI1      = $FF07
 TED_KBD                = $FF08
 TED_CURSHI     = $FF0C
 TED_CURSLO     = $FF0D