0 Members and 1 Guest are viewing this topic.
I've further optimized that grayscale command and its basically the same size as my original now except way faster which is excellent.
calc83manic
Quote from: Quigibo on June 09, 2010, 09:59:04 pmcalc83manicYou downgraded calc84maniac to 6 MHz hardware
Quote from: DJ Omnimaga on June 09, 2010, 11:41:29 pmQuote from: Quigibo on June 09, 2010, 09:59:04 pmcalc83manicYou downgraded calc84maniac to 6 MHz hardware He also downgraded him to having a mood disorder.
Quote from: Runer112 on June 09, 2010, 11:53:09 pmQuote from: DJ Omnimaga on June 09, 2010, 11:41:29 pmQuote from: Quigibo on June 09, 2010, 09:59:04 pmcalc83manicYou downgraded calc84maniac to 6 MHz hardware He also downgraded him to having a mood disorder.oh crap I didn't notice . I hope he still finishes all his projects including the 8 level grayscale raycaster *runs*
It's awesome that you were able to further optimize the grayscale, this makes me very happy! Quote from: DJ Omnimaga on June 09, 2010, 11:55:49 pmQuote from: Runer112 on June 09, 2010, 11:53:09 pmQuote from: DJ Omnimaga on June 09, 2010, 11:41:29 pmQuote from: Quigibo on June 09, 2010, 09:59:04 pmcalc83manicYou downgraded calc84maniac to 6 MHz hardware He also downgraded him to having a mood disorder.oh crap I didn't notice . I hope he still finishes all his projects including the 8 level grayscale raycaster *runs*LOL, you guys...
Maybe you could use ixl/ixh to avoid the shadow reg? It is 9 clocks for ld iirc tho :S.
Quote from: tr1p1ea on June 10, 2010, 08:41:26 amMaybe you could use ixl/ixh to avoid the shadow reg? It is 9 clocks for ld iirc tho :S.Aren't those incompatible with the Nspire, though? Or am I confusing them?
Quote from: calc84maniac on June 09, 2010, 01:16:54 amHmm, remember when I suggested you could use IX as a pointer to the variables for easier access when doing 8-bit operations? That would be too much of a hassle, we agreed. But what if you moved the variables to the END of savesscreen? Then they would be within the range of the IY register (which points 4 bytes after the end of savesscreen). Just something to consider Hmm... interesting proposition. Although it would optimize some operations like addition and subtraction, there is still one key advantage to using the existing variable slots. By using only the least significant bytes of those variables, you never need to do "conversions" when you switch from word to byte mode. You have to get input and output somehow otherwise there's not much advantage to the new mode. By being able to skip the conversions, I think that will save more memory in the long run than by using the iy or ix registers.
Hmm, remember when I suggested you could use IX as a pointer to the variables for easier access when doing 8-bit operations? That would be too much of a hassle, we agreed. But what if you moved the variables to the END of savesscreen? Then they would be within the range of the IY register (which points 4 bytes after the end of savesscreen). Just something to consider
xor ald b,ald c,acpirld hl,-1sbc hl,bc
ld hl,(var_a) ld de,5 or a sbc hl,de ;The Z condition code is set to correspond to 1 jp nz,end
ld hl,(var_b) ld de,-10 add hl,de ;The NC condition code is set to correspond to 1 ld hl,(var_a) jp c,no_inc inc hlno_inc:
I'm thinking it would be neat for the commands that return booleans to not always have to calculate the 0 or 1 value directly. I was thinking instead that the command will set an internal compiler variable that tells which condition code to use. Then, the following command can either optimize according to the condition or otherwise generate a 0 or 1 as usual.
ld hl,(var_a) ld de,5 or a sbc hl,de ;The NZ condition code is set to correspond to 1 ld hl,1 jp nz,_ ld hl,(var_b) ld de,6 or a sbc hl,de ;The NZ condition code is set to correspond to 1 ld hl,1 jr nz,_ dec hl_