]> git.sur5r.net Git - cc65/commitdiff
NTSC/PAL update by Stefan Haubenthal.
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 10 Apr 2008 20:15:28 +0000 (20:15 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 10 Apr 2008 20:15:28 +0000 (20:15 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@3831 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/nes/_scrsize.s
libsrc/nes/crt0.s

index 8ed7e6f1ff34f34c922cf73eea8852103d802c95..71a45fa321ee129c012d2c10ea978b52b8d7fe76 100644 (file)
@@ -1,20 +1,24 @@
 ;
 ; Ullrich von Bassewitz, 2003-04-14
+; Stefan Haubenthal, 2007-01-21
 ;
 ; Screen size function
 ;
 
-       .export         screensize
+       .export         screensize
 
-        .include        "nes.inc"
+       .include        "nes.inc"
+       .include        "get_tv.inc"
 
 
-.proc   screensize
+.proc  screensize
 
-        ldx     #charsperline
-        ldy     #screenrows
-        rts
+       jsr     _get_tv
+       ldx     #charsperline
+       ldy     #screenrows
+       cmp     #TV::NTSC
+       beq     nopal
+       dey
+nopal: rts
 
 .endproc
-
-
index 06a450681c4ed7b2b25b83d3eccb66a18f0e6ba1..3a22324976a88963593be200ea98727d43ba0b62 100644 (file)
@@ -9,7 +9,7 @@
 
         .export         _exit
        .import         initlib, donelib, callmain
-       .import         push0, _main, zerobss
+       .import         push0, _main, zerobss, copydata
         .import         ppubuf_flush
 
         ; Linker generated symbols
@@ -19,7 +19,6 @@
        .import         __STARTUP_LOAD__,__STARTUP_RUN__, __STARTUP_SIZE__
        .import         __CODE_LOAD__,__CODE_RUN__, __CODE_SIZE__
        .import         __RODATA_LOAD__,__RODATA_RUN__, __RODATA_SIZE__
-       .import         __DATA_LOAD__,__DATA_RUN__, __DATA_SIZE__
 
         .include        "zeropage.inc"
        .include        "nes.inc"
@@ -57,7 +56,7 @@
 ;    | ..-EOF |      | CHR-ROM pages (in ascending order).      |
 ;    +--------+------+------------------------------------------+
 
-        .byte   $4e,$45,$53,$1a        ; "nes\n"
+        .byte   $4e,$45,$53,$1a        ; "NES"^Z
        .byte   2               ; ines prg  - Specifies the number of 16k prg banks.
        .byte   1               ; ines chr  - Specifies the number of 8k chr banks.
        .byte   %00000011       ; ines mir  - Specifies VRAM mirroring of the banks.
@@ -96,43 +95,8 @@ start:
 
         jsr    zerobss
 
-; Copy the .data segment to RAM
-
-        lda     #<(__DATA_LOAD__)
-        sta     ptr1
-        lda     #>(__DATA_LOAD__)
-        sta     ptr1+1
-        lda     #<(__DATA_RUN__)
-        sta     ptr2
-        lda     #>(__DATA_RUN__)
-        sta     ptr2+1
-
-        ldx     #>(__DATA_SIZE__)
-
-@l2:    beq     @s1                    ; no more full pages
-
-        ; copy one page
-        ldy     #0
-@l1:    lda     (ptr1),y
-        sta     (ptr2),y
-        iny
-        bne     @l1
-
-        inc     ptr1+1
-        inc     ptr2+1
-        dex
-        bne     @l2
-
-        ; copy remaining bytes
-@s1:
-
-        ; copy one page
-        ldy     #0
-@l3:    lda     (ptr1),y
-        sta     (ptr2),y
-        iny
-        cpy     #<(__DATA_SIZE__)
-        bne     @l3
+; initialize data
+       jsr     copydata
 
 ; setup the stack