home *** CD-ROM | disk | FTP | other *** search
- ;--------= screen copy routine =--------
- ; Author: Ian Graf
- ; (ian_graf@geocities.com)
- ; Version: 1.0
- ; Date: 8/31/98
- ;
- ;---------------------------------------
- ; this routine writes from location hl
- ; directly to the lcd. there must be
- ; 768 bytes of data at hl. to only copy
- ; 756 bytes (the size of a pic var)
- ; change the line "cp 0C0h" to
- ; "cp 0BFh".
- ;
- ; example usage:
- ;
- ; ld hl,plotsscreen
- ; call putscreen
- ;
- ; this copies the graph buffer to the
- ; screen.
-
-
- ;-------------= put screen =------------
- ; input: hl - location of screen
- ; data
- ; output: 768 bytes written to
- ; screen
- ; destroys: af, bc, d, hl
-
- putscreen:
- di ; disable interrupts
- ld a,07h ; set y inc mode
- call lcdbusy ;
- out (lcdinstport),a ;
- ld a,80h ; top row
- ld d,a ;
- wloop1: call lcdbusy ; set row
- out (lcdinstport),a ;
- ld a,20h ; left col
- call lcdbusy ; set col
- out (lcdinstport),a ;
- ld bc,12*256+lcddataport ; 12 cols/port 11h
- wloop2: call lcdbusy ;
- outi ; write col
- jr nz,wloop2 ;
- inc d ;
- ld a,d ;
- cp 0C0h ; bottom row
- jr nz,wloop1 ;
- ld a,05h ; x inc mode
- call lcdbusy ;
- out (lcdinstport),a ;
- ei ; enable interrupts
- ret ;
-
- ;---------------= lcdbusy =-------------
-
- lcdbusy:
- push af ; create a small delay before
- inc hl ; communicating with LCD
- dec hl ;
- pop af ;
- ret ;
-