Changeset 4f508e6 in buchla-68k for vlib/glcplot.s
- Timestamp:
- 07/01/2017 02:34:46 PM (7 years ago)
- Branches:
- master
- Children:
- 08e1da1
- Parents:
- f40a309
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vlib/glcplot.s
rf40a309 r4f508e6 1 *------------------------------------------------------------------------------2 *glcplot.s -- plot a pixel on the LCD display3 *Version 2 -- 1987-04-23 -- D.N. Lynx Crowe4 *(c) Copyright 1987 -- D.N. Lynx Crowe5 * 6 *GLCplot(x, y, val)7 *unsigned x, y, val);8 * 9 *Plot a pixel at ('x', 'y') using lcdbase as the plane address10 *in GLC RAM. If 'val' is zero, the pixel is cleared,11 *otherwise the pixel is cleared. No error checking is done.12 *Limits: 0 LE x LE 511, 0 LE y LE 63.13 *------------------------------------------------------------------------------1 | ------------------------------------------------------------------------------ 2 | glcplot.s -- plot a pixel on the LCD display 3 | Version 2 -- 1987-04-23 -- D.N. Lynx Crowe 4 | (c) Copyright 1987 -- D.N. Lynx Crowe 5 6 | GLCplot(x, y, val) 7 | unsigned x, y, val); 8 9 | Plot a pixel at ('x', 'y') using lcdbase as the plane address 10 | in GLC RAM. If 'val' is zero, the pixel is cleared, 11 | otherwise the pixel is cleared. No error checking is done. 12 | Limits: 0 LE x LE 511, 0 LE y LE 63. 13 | ------------------------------------------------------------------------------ 14 14 .text 15 * 15 16 16 .xdef _GLCplot 17 17 .xref _lcd_a0,_lcd_a1,_lcdbase 18 * 19 XLOC .equ 8 *'x' parameter offset20 YLOC .equ 10 *'y' parameter offset21 VAL .equ 12 *'val' parameter offset22 * 23 G_CRSWR .equ $46 *GLC set cursor command24 G_MWRITE .equ $42 *GLC write command25 G_MREAD .equ $43 *GLC read command26 * 18 19 XLOC = 8 | 'x' parameter offset 20 YLOC = 10 | 'y' parameter offset 21 VAL = 12 | 'val' parameter offset 22 23 G_CRSWR = 0x46 | GLC set cursor command 24 G_MWRITE = 0x42 | GLC write command 25 G_MREAD = 0x43 | GLC read command 26 27 27 .page 28 * 29 _GLCplot: link a6,#0 *Link stack frames30 moveq #63,d0 * d0 = (63-y) *8531 sub.w YLOC(a6),d0 *...32 mulu #85,d0 *...33 clr.l d1 *d1 = x/634 move.w XLOC(a6),d1 *...35 divu #6,d1 *...36 add.w d1,d0 * d0 = (63-y)*85 + (x/6)37 swap d1 *d2 = 7 - (x%6) % 838 moveq #7,d2 *...39 sub.w d1,d2 *...40 andi.w #7,d2 *...41 lsr.w #3,d1 *d1 = (x%6) / 842 add.w d1,d0 *d0 = cursor address43 add.w _lcdbase,d0 *...44 move.w d0,d1 *d1 = cursor address, too45 move.b #G_CRSWR,_lcd_a1 *Send cursor address to GLC46 move.b d0,_lcd_a0 *...47 lsr.w #8,d0 *...48 move.b d0,_lcd_a0 *...49 move.b #G_MREAD,_lcd_a1 *Read old pixel byte50 move.b _lcd_a1,d0 *... into d051 tst.w VAL(a6) *Check val for zero52 beq glcplt1 *Jump if val EQ 053 * 54 bset d2,d0 *Set the pixel to 155 bra glcplt2 *Go write pixel to GLC56 * 57 glcplt1: bclr d2,d0 *Clear the pixel to 058 * 59 glcplt2: move.b #G_CRSWR,_lcd_a1 *Send cursor address to GLC60 move.b d1,_lcd_a0 *...61 lsr.w #8,d1 *...62 move.b d1,_lcd_a0 *...63 move.b #G_MWRITE,_lcd_a1 *Setup GLC to write pixel64 move.b d0,_lcd_a0 *Write pixel65 unlk a6 *Unlink stack frames66 rts *Return to caller67 * 28 29 _GLCplot: link a6,#0 | Link stack frames 30 moveq #63,d0 | d0 = (63-y) | 85 31 sub.w YLOC(a6),d0 | ... 32 mulu #85,d0 | ... 33 clr.l d1 | d1 = x/6 34 move.w XLOC(a6),d1 | ... 35 divu #6,d1 | ... 36 add.w d1,d0 | d0 = (63-y)|85 + (x/6) 37 swap d1 | d2 = 7 - (x%6) % 8 38 moveq #7,d2 | ... 39 sub.w d1,d2 | ... 40 andi.w #7,d2 | ... 41 lsr.w #3,d1 | d1 = (x%6) / 8 42 add.w d1,d0 | d0 = cursor address 43 add.w _lcdbase,d0 | ... 44 move.w d0,d1 | d1 = cursor address, too 45 move.b #G_CRSWR,_lcd_a1 | Send cursor address to GLC 46 move.b d0,_lcd_a0 | ... 47 lsr.w #8,d0 | ... 48 move.b d0,_lcd_a0 | ... 49 move.b #G_MREAD,_lcd_a1 | Read old pixel byte 50 move.b _lcd_a1,d0 | ... into d0 51 tst.w VAL(a6) | Check val for zero 52 beq glcplt1 | Jump if val EQ 0 53 54 bset d2,d0 | Set the pixel to 1 55 bra glcplt2 | Go write pixel to GLC 56 57 glcplt1: bclr d2,d0 | Clear the pixel to 0 58 59 glcplt2: move.b #G_CRSWR,_lcd_a1 | Send cursor address to GLC 60 move.b d1,_lcd_a0 | ... 61 lsr.w #8,d1 | ... 62 move.b d1,_lcd_a0 | ... 63 move.b #G_MWRITE,_lcd_a1 | Setup GLC to write pixel 64 move.b d0,_lcd_a0 | Write pixel 65 unlk a6 | Unlink stack frames 66 rts | Return to caller 67 68 68 .end
Note:
See TracChangeset
for help on using the changeset viewer.