assembly - 如何在 2 列中显示交替的文本行?
问题描述
我有这部分代码,所有文本行都同时出现在屏幕上。现在我希望每一行从另一侧出现在屏幕上(即左起第一行,右起第二行等)。任何人都可以帮忙吗?
Start SEI
LDX #$01
STX $0286
DEX
STX $D020
STX $D021
JSR $E544
mainLoop LDA #$FA
waitRaster CMP $D012
BNE waitRaster
waitRaster2 CMP $D012
BEQ waitRaster2
LDA #$0F
STA $D020
JSR UpdateThings
INC $D020
JMP mainLoop
UpdateThings ; is state 0 ?
LDA State
BNE nextState
; yes, call Move Text to Screen routine
JSR MoveTextIn
nextState RTS
我在这里尝试了一些改变..
MoveTextIn LDX 02
LDY Counter
loop ; LDA TextLines1+(1*40),x
; STA $0400+(1*40),X
LDA TextLines2+(1*40),y
STA $0400+(1*40),X
; LDA TextLines+(5*40),Y
; STA $0400+(5*40),X
INX
INY
CPY #$28
BNE loop
and there....
; LDX #$27
TXA
SEC
SBC Counter
TAY
又在这里...
loop2 ;LDA TextLines1+(0*40),x
;STA $0400+(0*40),X
LDA TextLines2+(0*40),y
STA $0400+(0*40),X
;LDA TextLines+(4*40),Y
;STA $0400+(4*40),X
DEX
DEY
BPL loop2
LDA Counter
BEQ TextMoveDone
DEC Counter
RTS
TextMoveDone INC State
RTS
State !byte 0
Counter !byte $10
TextLines1 !scr "!x-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-xx!"
TextLines2 !scr "!x commodore master soft x!"
!scr "! ------------------- !"
!scr "! somewhere in 2019. !"
!scr "! ---------------- !"
!scr "! -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- !"
解决方案
好的,谢谢大家。我找到了答案:
一种可能性是让计数器从 0 变为 240,并且一旦帧添加 +1,它就会更新......
如果值为 0 - 39,它将移动第 1 行并计算需要将文本放到屏幕上的位置 如果值为 40 - 79,它将移动第 2 行 + 相同...如果值为 200 - 239,它将移动第 6 行 + 相同如果值为 240,则所有移动都已完成...
其他方法是让计数器变为 0..40,当 40 时,它会添加 linecounter。
推荐阅读
- react-native - 反应原生重新选择错误选择器创建者,除了所有输入
- haskell - Haskell - 将联合列表转换为列表元组
- spring-security - 连接被拒绝 - 无法获取用户详细信息 - 尝试访问身份验证服务器时
- python - Python 资源模块不支持“管道大小”和“虚拟内存”资源限制
- reactjs - 如何在 Next js 中集成 React Odometerjs
- bulkinsert - 将 csv 文件加载到 SQL Server 表中
- python - 将多位数字相加直到返回单个数字的函数
- javascript - 在同一个对象Javascript的另一个值中使用一个对象值
- django - Linux python django 站点包在信封中无法识别
- python - 从熊猫数据框创建滚动窗口