fix: Get rid of fixed screen sizes (GE0_SCREEN_HEIGHT related code) #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
主要是这个commit,主要做了以下工作:
screen.h以及display.h里面的SCREEN_HEIGHT等,统一命名为GE0_SCREEN_HEIGHT等SCREEN_HEIGHT等宏定义,GE0应该适配各种尺寸的屏幕,不应当写死尺寸,应当诸如通过编译参数-DSCREEN_HEIGHT=128传入屏幕参数todo: Why x here is 64?,代码,我认为这里的64应该是所谓的SCREEN_WIDTH_BYTES,源代码中宽度为128,每个点空间4bit,SCREEN_WIDTH_BYTES=128*4/8=64,所以这里就是64SCREEN_ADDR宏函数是写死的6,我认为这里的6就是log2(64)即log2(SCREEN_WIDTH_BYTES),所以这里也需要修,所以我加入了一个BITS_TO_REPRESENT宏魔法,用于编译期计算log2(SCREEN_WIDTH_BYTES)