There appears to be a 4-cycle difference between the two (SLA and RLCA)...
calc84maniac wrote:
RLCA (which happens to be the non-carry flag one)
Fair enough; I'll have to switch over to rlc a then. -
calc84maniac
- eZ80 Guru (Posts: 1626)
- 27 Apr 2007 09:11:00 am
- Last edited by calc84maniac on 27 Apr 2007 11:53:57 am; edited 1 time in total
Here's an optimized version I whipped up:
Code:
See how much simpler that is?
27 bytes rather than 50, and no pushes or pops. Feel free to use this as the first step of keeping DCS out of 3 app pages
Code:
dcsSquish:
ex de,hl
dscSquishLoop:
call dcsSquishPutNibble
call dcsSquishPutNibble
cpi
jp pe,dcsSquishLoop
ex de,hl
ret
dcsSquishPutNibble:
call GetArcProgByteDe
inc de
cp $3A
jr c,dcsSquish_DONE
sub 7
dcsSquish_DONE:
rld ;rotates lower nibble only of a into (hl)
ret
See how much simpler that is?
27 bytes rather than 50, and no pushes or pops. Feel free to use this as the first step of keeping DCS out of 3 app pages
Well done. One of these days I should go through and look at all my unoptimized code from back in the day. :/
I am trying to create a routine to turn on all the pixels and create a black screen. Right now i am having trouble with it though the code i am using only turns about half of the screen black. How would i change my code to make it turn the entire screen black.
Code:
Code:
DEFHDR.HDR
LD B,768
LD HL,PLOTSSCREEN
LOOP:
LD A,11111111B
LD (HL),A
INC HL
DJNZ LOOP
BCALL GRBUFCPY
RET
B can only hold numbers up to 255. Make a counter with BC instead. And also
ld (hl),11111111b
is faster and smaller than
ld a,11111111b
ld (hl),a
Edit: I whipped up a small fast one:
Code:
ld (hl),11111111b
is faster and smaller than
ld a,11111111b
ld (hl),a
Edit: I whipped up a small fast one:
Code:
:LD HL,PLOTSSCREEN
:LD BC,768
:LOOP:
:LD (HL),11111111b
:CPI
:>Compares (hl) to a, increases hl, decreases bc, and returns PE if bc is not zero
:JP PE,LOOP
:>There is no jr pe
:BCALL GRBUFCPY
:RET
I realized what i was doing wrong about after an hour of staring at code. Before looking at yours this is what i had come up with,
Code:
I will try yours though since it is better. I also have another question though. Since i can clear the graph screen by switching a to 00000000B which area of memory would i have to access to clear both the home and graph screen.
Code:
:LD BC,768
:LD HL,PLOTSSCREEN
:BLACK:
:LD A,11111111B
:LD (HL),A
:INC HL
:DEC BC
:LD A,C
:OR B
:JR NZ,GILOOP
:BCALL GRBUFCPY
:RET
I will try yours though since it is better. I also have another question though. Since i can clear the graph screen by switching a to 00000000B which area of memory would i have to access to clear both the home and graph screen.
- haveacalc
- Power User (Posts: 358)
- 15 May 2007 10:17:18 pm
- Last edited by haveacalc on 16 May 2007 07:21:43 am; edited 4 times in total
When you write directly to the LCD (and you're on the homescreen), your alterations stay there and are even shifted upwards by Disps.
Also:
Code:
Less cycles.
Also:
Code:
:LD HL,PLOTSSCREEN
:LD BC,767
:LD D,H
:LD E,L
:INC E
:LD (HL),FFH
:LOOP:
:LDI
:DEC HL
:>sets (DE) to the value of (HL), increases DE and HL, decreases BC, and flags its overflowing
:JP PE,LOOP
:BCALL GRBUFCPY
:RET
Calc84maniac your black screen code is being stupid. It worked yesterday but now it wants to only blacken the first seven pixels or so.
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
» Go to Registration page
» Goto page Previous 1, 2, 3, 4, 5, 6, 7, 8
» View previous topic :: View next topic
» View previous topic :: View next topic
Page 8 of 8
» All times are UTC - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Advertisement