Changes

Programming:Next / previous line calculation

658 bytes added, 11:07, 16 January 2016
</pre>
 
 
 
= Fastest way to print a character in Mode 2 =
 
 
'''Input:''' HL=Address DE=screen address (works for every first line of screen !! For example: &C000, &C050, &C0A0 etc..)
 
'''Destroyed:''' AF, C
 
'''Unchanged:''' DE returns to its input value (through C register)
 
''''If HL is not page aligned, INC HL must be used instead of INC L (1 NOP SLOWER!)
 
 
<pre>
ld c,d
ld a,(hl):ld(de),a:inc l:set 3,d
ld a,(hl):ld(de),a:inc l:ld d,c:set 4,d
ld a,(hl):ld(de),a:inc l:set 3,d
ld a,(hl):ld(de),a:inc l:ld d,c:set 5,d
ld a,(hl):ld(de),a:inc l:set 3,d
ld a,(hl):ld(de),a:inc l:set 4,d:res 3,d
ld a,(hl):ld(de),a:inc l:set 3,d
ld a,(hl):ld(de),a
ld d,c
 
</pre>
 
 
[[Category:Programming]]
2,912
edits