/[projet1]/public/oric/routines/rasterization/linebench/clip.s
Defence Force logotype

Diff of /public/oric/routines/rasterization/linebench/clip.s

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 279 by thrust26, Sat Feb 13 21:20:38 2010 UTC revision 280 by thrust26, Sat Feb 13 23:24:23 2010 UTC
# Line 7  Line 7 
7    
8      .zero      .zero
9    
10    ; 5 bytes for point 0
11  _LargeX0        .dsb 2  _LargeX0        .dsb 2
12  _LargeY0        .dsb 2  _LargeY0        .dsb 2
13    _ClipCode0      .dsb 1
14    ; 5 bytes for point 1
15  _LargeX1        .dsb 2  _LargeX1        .dsb 2
16  _LargeY1        .dsb 2  _LargeY1        .dsb 2
17    _ClipCode1      .dsb 1
18    
19  _LargeX         .dsb 2  _LargeX         .dsb 2
20  _LargeY         .dsb 2  _LargeY         .dsb 2
 ;_ClipCode       .dsb 1  
 _ClipCode0      .dsb 1  
 _ClipCode1      .dsb 1  
21    
22  #ifdef USE_ACCURATE_CLIPPING  #ifdef USE_ACCURATE_CLIPPING
23                  .dsb 1                  .dsb 1
# Line 432  done Line 433  done
433  ; the resolution of an Oric screen, so they will never be out  ; the resolution of an Oric screen, so they will never be out
434  ; of a 240x200 screen resolution, fit in an unsigned byte.  ; of a 240x200 screen resolution, fit in an unsigned byte.
435  ;  ;
436    _ClipFindRegion0
437        ldx #0
438  _ClipFindRegion  _ClipFindRegion
439  .(  .(
440  ; yHi >= $01 -> clip_bottom  ; yHi >= $01 -> clip_bottom
# Line 484  clip_right Line 487  clip_right
487  clip_left  clip_left
488      ora #8              ;       means (x < CLIP_LEFT)      ora #8              ;       means (x < CLIP_LEFT)
489  end_left_right  end_left_right
490        sta _ClipCode0,x
491      rts      rts
492  .)  .)
493    
# Line 491  _DrawClippedLine Line 495  _DrawClippedLine
495  .(  .(
496  ; The region outcodes for the the endpoints  ; The region outcodes for the the endpoints
497  ; Compute the outcode for the first point  ; Compute the outcode for the first point
498      ldx #0                      ; XY0      jsr _ClipFindRegion0
     jsr _ClipFindRegion  
     sta _ClipCode0  
499  ; Compute the outcode for the second point  ; Compute the outcode for the second point
500  clip_loop1  clip_loop1
501      ldx #_LargeY1-_LargeY0      ; XY1      ldx #_LargeY1-_LargeY0      ; XY1
502      jsr _ClipFindRegion      jsr _ClipFindRegion
     sta _ClipCode1  
503    
504      ; In theory, this can never end up in an infinite loop, it'll always come in one of the trivial cases eventually      ; In theory, this can never end up in an infinite loop, it'll always come in one of the trivial cases eventually
505  clip_loop  clip_loop
# Line 588  clip_first_point Line 589  clip_first_point
589      lda _LargeY+1      lda _LargeY+1
590      sta _LargeY0+1      sta _LargeY0+1
591    
592      ldx #0                      ; XY0      jsr _ClipFindRegion0
     jsr _ClipFindRegion  
     sta _ClipCode0  
593    
594      jmp clip_loop      jmp clip_loop
595    
# Line 606  clip_second_point Line 605  clip_second_point
605      lda _LargeY+1      lda _LargeY+1
606      sta _LargeY1+1      sta _LargeY1+1
607    
 ;    ldx #_LargeY1-_LargeY0      ; XY1  
 ;    jsr _ClipFindRegion  
 ;    sta _ClipCode1  
   
608      jmp clip_loop1      jmp clip_loop1
609    
610      .)      .)

Legend:
Removed from v.279  
changed lines
  Added in v.280

  ViewVC Help
Powered by ViewVC 1.1.26