Autore Topic: Apertura Dei Bordi Superiore Ed Inferiore  (Letto 2574 volte)

MarC=ello

  • Utente
  • **
  • Post: 337
  • Gioco Preferito: CBM BASIC 2.0
Apertura Dei Bordi Superiore Ed Inferiore
« il: 28 Dicembre 2004, 23:45:48 »
 Ecco adattata dall'articolo "Opening the borders" di Pasi Ojala, C= Hacking issue 6, una routine che apre i bordi superiore e inferiore, nel caso interessasse  ;)

Ciao!

Codice: [Seleziona]
;border splitter by Albert
;modified by MarC=ello



RASTER= $FA    ; Rasterline for the interrupt
DUMMY=  $CFFF  ; Dummy-address for timing (refer to missing_cycles-article)

*= $C000
        SEI            ; Disable interrupts
        LDA #$7F       ; Disable timer interrupts (CIA)
        STA $DC0D
        LDA #$01       ; Enable raster interrupts (VIC)
        STA $D01A
        STA $D015      ; Enable the timing sprite
        LDA #<IRQ
        STA $0314      ; Interrupt vector to our routine
        LDA #>IRQ
        STA $0315
        LDA #RASTER    ; Set the raster compare (9th bit will be set
        STA $D012      ;  inside the raster routine)
        LDA #RASTER-20 ; Sprite is situated 20 lines before the interrupt
        STA $D001

        
        LDY #0
        STY $D017      ; Disable y-expand
      
        CLI            ; Enable interrupts
        RTS            ; Return to basic (?)


IRQ     LDA #$13       ; Open the bottom border (top border will open too)
        STA $D011
        NOP
        LDY #111; Reduce for NTSC ?
        INC DUMMY      ; Do the timing with a sprite
        BIT $EA        ; Wait a bit (add a NOP for NTSC)

nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop

    
        LDA #$1B
        STA $D011      ; Normal screen (be ready to open the border again)
        

        LDA #1
        STA $D019      ; Acknowledge the raster interrupt
        JMP $EA31      ; jump to the normal irq-handler


Tutti quei NOP possono essere sostituiti con un ciclo di ritardo, naturalmente  ;)  Scusate ma vado di fretta!

Ciao
-=MarC=ellO=-

iAN CooG

  • Utente
  • **
  • Post: 1774
    • http://iancoog.altervista.org
  • Gioco Preferito: Turbo Assembler, ActionReplay Monitor, DiskDemon
Apertura Dei Bordi Superiore Ed Inferiore
« Risposta #1 il: 29 Dicembre 2004, 01:57:14 »
 
Citazione da: "MarC=ello"
Tutti quei NOP possono essere sostituiti con un ciclo di ritardo, naturalmente  ;)
Detto fatto :) tutta la pappardella fa 71 cicli, che faccio, lascio? In effetti va anche con meno...
Codice: [Seleziona]
;border splitter by Albert
;modified by MarC=ello & iAN CooG

RASTER  = $FA  ; Rasterline for the interrupt

        *= $C000
        SEI      ; Disable interrupts
        LDA #$7F  ; Disable timer interrupts (CIA)
        STA $DC0D
        LDA #$01  ; Enable raster interrupts (VIC)
        STA $D01A
        STA $D015  ; Enable the timing sprite
        LDA #<IRQ
        STA $0314  ; Interrupt vector to our routine
        LDA #>IRQ
        STA $0315
        LDA #RASTER  ; Set the raster compare (9th bit will
        STA $D012  ;  be set inside the raster routine)
        LDA #RASTER-20; Sprite is situated 20 lines before
        STA $D001    ; the interrupt

        LDY #0
        STY $D017  ; Disable y-expand
        STY $3fff;clean open border dirty byte
        CLI      ; Enable interrupts
        RTS      ; Return to basic (?)

IRQ    
        LDA #$13  ; Open the bottom border
        STA $D011; (top border will open too)

        ldy #11  ;2
ldel1  
        nop      ;2
        dey      ;2
        bne ldel1;2 = 6*11  + 2 = 68
        bit $24  ;3 = 71

      ; Normal screen
      ; (be ready to open the border again)
        LDA #$1B
        STA $D011  
        LSR $D019  ; Acknowledge the raster interrupt
        JMP $EA31
-=[]=--- iAN CooG/HVSC^C64Intros ---=[]=-
- http://hvsc.c64.org - http://intros.c64.org -