This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's
z80 & ez80 Assembly subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.
Z80 & 68k Assembly =>
z80 & ez80 Assembly
Author |
Message |
|
Snipes17
Advanced Newbie
Joined: 07 May 2008 Posts: 62
|
Posted: 13 Mar 2009 09:13:34 pm Post subject: |
|
|
Being relatively new to asm, I am not sure about a lot of things, so without further ado, is there a better way of drawing 10 vertical lines, every six pixels? Here is how I did it:
Code:
; Displays ten vertical lines every six pixels (four pixels in between each line)
bcall (_ClrLCDFull)
ld hl, plotsscreen ; hl=plotsscreen
ld b, 64 ; b=row height
Tenvertlines:
push bc ; save row height
ld a, %10000100 ; a=first row of line 1 and 2
ld (hl), a ; store a to graphbuffer
inc hl ; hl=plotscreen+5
inc hl
inc hl
inc hl
inc hl
ld (hl), a ; store a to graphbuffer
ld b, 2 ; b=number of times to execute Doubleloop
Doubleloop:
dec hl ; first time through: hl=plotsscreen+3 second time through: hl=plotsscreen+1
dec hl
rrca ; first time through: a=%01000010 second time through: a=%00100001
ld (hl), a ; store a to graphbuffer
djnz doubleloop ; Repeat once more
inc hl ; hl=plotsscreen+4
inc hl
inc hl
rra ; a=%00010000
ld (hl), a ; store a to graphbuffer
dec hl ; hl=plotsscreen+2
dec hl
srl a ; a=%00001000
ld (hl), a ; store a to graphbuffer
ld b, 10 ; b=number of times to increment hl
Nextrowloop: ; next row of line
inc hl ; hl=plotsscreen+12
djnz Nextrowloop
pop bc ; b=row height
djnz Tenvertlines ; check to see if at the bottom of the screen
bcall (_grbufcpy) ; display graph buffer
bcall (_getkey) ; wait for input
bcall (_clrlcdfull) ; erase it all
Any help would be greatly appreciated.
Last edited by Guest on 13 Mar 2009 10:22:27 pm; edited 1 time in total |
|
Back to top |
|
|
WikiGuru ADOS (Attention deficit... Oh! Shiny!)
Elite
Joined: 15 Sep 2005 Posts: 923
|
Posted: 14 Mar 2009 02:33:44 am Post subject: |
|
|
Is this what you wanted? If you want, remove call ionfastcopy and you can draw it to the display elsewhere.
Code: vLines:
ld b,64
ld de,plotsscreen
vDraw:
push bc
ld bc, 12
ld hl,data
ldir
pop bc
djnz vDraw
call ionfastcopy
ret
data:
.db $84,$21, $08,$42, $10,$84, $21,$08, $42,$10, $84,$21
Last edited by Guest on 11 Jul 2010 06:03:30 pm; edited 1 time in total |
|
Back to top |
|
|
Snipes17
Advanced Newbie
Joined: 07 May 2008 Posts: 62
|
Posted: 14 Mar 2009 02:18:45 pm Post subject: |
|
|
Thank you. That definitely works a lot better than my attempt and it is much easier to edit. Just wondering, I can add in the code for ionfastcopy so I can use it without the ion shell, right? |
|
Back to top |
|
|
simplethinker snjwffl
Active Member
Joined: 25 Jul 2006 Posts: 700
|
Posted: 14 Mar 2009 02:20:27 pm Post subject: |
|
|
Snipes17 wrote: Thank you. That definitely works a lot better than my attempt and it is much easier to edit. Just wondering, I can add in the code for ionfastcopy so I can use it without the ion shell, right?
Yep. Just make sure you substitute "PlotSScreen" for "gBuf" in the code.
Last edited by Guest on 14 Mar 2009 02:21:47 pm; edited 1 time in total |
|
Back to top |
|
|
|
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.
»
Go to Registration page