MateoC's code:
Code:
Questions:
1. Under label "Display_Org" why is the specific number $1038 loaded into HL?
2. Under label "Display_Window" why does reg A start at $50?
3. Under label "Write_Display_Control" why is reg A output to port $10 twice?
Sorry if the answers seem obvious, this LCD is really throwing me for a loop.
Code:
Display_Org:
ld a,3 ; adjust origin drawing mode
ld hl,$1038
call Write_Display_Control
jr Full_Window
Display_Normal:
ld a,3 ; normal drawing mode
ld hl,$10B8
call Write_Display_Control
Full_Window:
ld a,$50 ; Set minimum Y
ld hl,0
call Write_Display_Control
inc a ; Set maximum Y
ld l,239
call Write_Display_Control
ld l,0 ; Set minimum X
inc a
call Write_Display_Control
inc a ; Set maximum X
ld hl,319
Write_Display_Control:
out ($10),a
out ($10),a
ld c,$11
out (c),h
out (c),l
ret
Questions:
1. Under label "Display_Org" why is the specific number $1038 loaded into HL?
2. Under label "Display_Window" why does reg A start at $50?
3. Under label "Write_Display_Control" why is reg A output to port $10 twice?
Sorry if the answers seem obvious, this LCD is really throwing me for a loop.