RE: A83: RE: Greyscale (some more info...)
[Prev][Next][Index][Thread]
RE: A83: RE: Greyscale (some more info...)
I have attached the file in my first e-mail: i've received my own e-mail
with an attachment!!!
But since nobody received it, and i still didn't fix the problem, i'll
copy it into my e-mail:
;----------> SGryDemo.asm <--------------
.NOLIST
#define equ .equ
#define EQU .equ
#define end .end
#include "ti83asm.inc"
#include "tokens.inc"
#define GreyLayer1 Grey1
#define GreyLayer2 Grey2
.LIST
.org     9327h
        call GreyScaleOn
        call _getkey
        jp GreyScaleOff
#include "SGreyLib.asm"
#include "spic2.asm"			; This is an 10 kb file with the
image data...
					; I will not include this file,
if you want to test:
					; just make your own file with
to layers called 
					; 'Grey1' and 'Grey2' (defined),
each 12x64 bytes
.END
;-------------------------------------------------
;--------------> SGreyLib.asm <--------
; SGreyLib
; a GreyScale lib for the TI83
; (c) Sebastiaan Roodenburg
;
; Thanx to:
; - Joe Wingbermuehle for his FastCopy routine (ZGFXL)
; - Bill Nagel & Dines Justesen for their GREYLIB
;
#define count counter-IntStart+8585h
GreyScaleOn:
        im 1
        ld hl,8300h
        ld de,8301h
        ld bc,256
        ld (hl),85h
        ldir
        ld hl,IntStart
        ld de,8585h
        ld bc,IntEnd-IntStart+1
        ldir
        ld a,83h
        ld i,a
        im 2
        ret
GreyScaleOff:
        im 1
        set graphdraw,(iy+graphflags)
        ret
IntStart:
        di
        ex af,af'
        exx
        ld a,(count)
        push af
        or a
        jr z,dsp1
        ;dec a
        ;jr z,dsp2
        jr dsp2
intret:
        pop af
        inc a
        cp 3
        jr nz,intret2
        xor a
intret2:
        ld (count),a
        exx
        ex af,af'
        ei
        jp 0038h
counter: .db 0
dsp1:
        ld hl,GreyLayer1
        jr fastCopy
dsp2:
        ld hl,GreyLayer2
fastCopy:
        ld a,$80           
        out ($10),a         
        ld de,755
        add hl,de
        ld a,$20        
        ld c,a          
fastCopyAgain:
        ld b,64         
        inc c           
        ld de,-(12*64)+1
        out ($10),a     
        add hl,de       
        ld de,12
fastCopyLoop:
        add hl,de          
        jr c,intret
        ld a,(hl)          
        out ($11),a        
        djnz fastCopyLoop  
        ld a,c             
        cp $2C           
        jr nz,fastCopyAgain
        jr intret
IntEnd:
;--------------------------
- Warning
 
- Could not process part with given Content-Type: 
application/ms-tnef