forked from buserror/simavr
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix cursor handling in segmented DDRAM of HD44780
HD44780 has only 80 bytes of DDRAM, which consists of two 40 bytes long segments. The segment starting at address 0x00 contains the data for the first line of the display, while the segment starting at address 0x40 contains the data for the second line of the display. This means that there are invalid ranges in the 7-bit address space of the DDRAM (0x00+40 .. 0x3f and 0x40+40 .. 0x7f). The cursor (address counter) of the HD44780 automatically "jumps over" these regions whenever auto-incremented/decremented. This commit implements this behaviour. Moreover, this commit also fixes the 4-lines mode. When in a 4-lines setup, the first 20 bytes of the first and the second memory segments control what is displayed in the first two lines, as usual. However, the second 20 bytes of the memory segments contain the data for the third and fourth lines of the display. This means that the starting addresses of lines 3 & 4 are 0x00+20 and 0x40+20.
- Loading branch information
1 parent
cb6fcbe
commit f97e7f0
Showing
2 changed files
with
32 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters