我想我已经解决了光栅中断 text/bitmap 模式,但我有这个奇怪的文本错误
I think I have solved raster interrupts text/bitmap mode but I have this weird text error
汇编程序:CBM prg Studio。
大家好,圣诞快乐,节日快乐:)
我的中断中的文本输出是怎么回事?我一定在这里遗漏了一些明显的东西,但请看一下所附的图片...
应该说:
“正在进入第一个候选人的范围...”
*位图显示
“开始开采 Y/N?”
看看附图,自己看看。
下面是代码。感谢您抽出时间来看一看,这让我困惑了一晚上!
:) 詹姆斯Click here to see the pic
; 10 SYS (2064)
*=01
BYTE [=11=]E, , [=11=]A, [=11=], E, , , , , , , , [=11=], [=11=], [=11=]
;Sexy Subroutines...
CHROUT = $FFD2 ; Output a character to the screen
SCNKEY = $FF9F ; Place ASCII character into keyboard queue
GETIN = $FFE4 ; Places the ASCII value into the Accumulator
PLOT = $FFF0 ; PLOTs the cursor to the next line down, X = the row number
; Y = the colum. Always Clear the Carry (CLC) vital for
; plotting!
DECDIS = $BDCD
;The stack location for temporary strings...
tempst1 = [=11=]20
tempst2 = [=11=]21
;Screen details...
Screen = 00
Border = $D020
Background = $D021
; I/O Stuff.........
LSTX = [=11=]c5 ; Current key pressed.
; 01=ENTER. 3C=SPACE. 1=38. 2=3b. 3=08. 4=0b. 5=10. 6=13. 7=18. 8=1b. 9=20
; Y=19. N=27. S=0d. P=29.
*=10
lda #147 ; This is a BASIC routine that presses the keyboard
jsr CHROUT ; button that clears the screen.
lda #00
sta Border
sta Background
jsr Init ; Split the screen!
ldx #[=11=]
lda #[=11=]e
jsr CHROUT
ldx #20
ldy #00
clc
jsr PLOT
lda #>Siliconi
sta tempst2
lda #<Siliconi
sta tempst1
jsr print
ldx #01
ldy #00
clc
jsr PLOT
lda #>message
sta tempst2
lda #<message
sta tempst1
jsr print
loaddccimage
;lda f40,x
;sta 00,x
lda 40,x
sta 00,x
lda 40,x
sta 00,x
;lda 40,x
;sta 00,x
;lda 28,x
;sta $d800,x
lda 28,x
sta $d900,x
lda 28,x
sta $da00,x
;lda 28,x
;sta $db00,x
inx
bne loaddccimage
lda #b
sta $d011
lda #
sta $d016
jump jmp *
;===================
Init SEI ; set interrupt bit, make the CPU ignore interrupt requests
LDA #%01111111 ; switch off interrupt signals from CIA-1
STA $DC0D
AND $D011 ; clear most significant bit of VIC's raster register
STA $D011
LDA $DC0D ; acknowledge pending interrupts from CIA-1
LDA $DD0D ; acknowledge pending interrupts from CIA-2
LDA #0 ; set rasterline where interrupt shall occur
STA $D012
LDA #<Irq ; set interrupt vectors, pointing to interrupt service routine below
STA 14
LDA #>Irq
STA 15
LDA #%00000001 ; enable raster interrupt signals from VIC
STA $D01A
CLI ; clear interrupt flag, allowing the CPU to respond to interrupt requests
RTS ; ?? Leave here ??
Irq LDA $D011 ; select text screen mode
AND #%11011111
STA $D011
lda #
sta $d018
LDA #%00000000
sta $d016
LDA #<Irq2 ; set interrupt vectors to the second interrupt service routine at Irq2
STA 14
LDA #>Irq2
STA 15
LDA #100
STA $D012 ; next interrupt will occur at line no. 0
ASL $D019 ; acknowledge the interrupt by clearing the VIC's interrupt flag
JMP $EA31 ; jump into KERNAL's standard interrupt service routine to handle keyboard scan, cursor display etc.
Irq2 LDA $D011 ; select bitmap screen mode
ORA #%00100000
STA $D011
lda #
sta $d018
LDA #%00010000
sta $d016
LDA #<Irq ; set interrupt vectors back to the first interrupt service routine at Irq
STA 14
LDA #>Irq
STA 15
LDA #200
STA $D012 ; next interrupt will occur at line no. 210
ASL $D019 ; acknowledge the interrupt by clearing the VIC's interrupt flag
JMP $EA81 ; jump into shorter ROM routine to only restore registers from the stack etc
Print
ldy #0 ;Clear the Y register
Print1
lda (tempst1),y
cmp #255
beq PrintDone
jsr PrintChar
iny
jmp Print1
PrintDone
RTS
PrintChar
cmp #48
bcc PrintChar1
PrintChar1
jsr CHROUT
rts
Siliconi
Text "COMMENCE MINE Y/N?"
byte 255
message
Text "Moving into range of the first candidate..."
byte 255
*=FFE
incbin "ASTRO1.prg"
这个问题似乎与 PETSCII specification 的功能有关,称为 shifting。
Assuming the graphics mode is unshifted, PETSCII has only uppercase letters in its powerup state.
在移位模式下,小写字符 a-z
与未移位模式下的大写字符 A-Z
占用相同的字符 space (0x41..0x5a)。在此模式下,大写字符位于 (0x61..0x7a),其中包含未移位模式下的一些图形字形。
证据支持这一点,因为小写字母显示为大写字母,大写字母显示为块图形字符。
解决这个问题:
On C64 the sets are alternated by flipping bit 2 of the byte 53272
或者,我认为可以不使用 KERNAL 函数直接将正确的字符输出到屏幕内存。我不确定这一点,因为我编写 C64 已经很长时间了。可能是需要禁用字符集的切换,以便随机按键不会改变屏幕...
汇编程序:CBM prg Studio。
大家好,圣诞快乐,节日快乐:) 我的中断中的文本输出是怎么回事?我一定在这里遗漏了一些明显的东西,但请看一下所附的图片...
应该说:
“正在进入第一个候选人的范围...”
*位图显示
“开始开采 Y/N?”
看看附图,自己看看。
下面是代码。感谢您抽出时间来看一看,这让我困惑了一晚上!
:) 詹姆斯Click here to see the pic
; 10 SYS (2064)
*=01
BYTE [=11=]E, , [=11=]A, [=11=], E, , , , , , , , [=11=], [=11=], [=11=]
;Sexy Subroutines...
CHROUT = $FFD2 ; Output a character to the screen
SCNKEY = $FF9F ; Place ASCII character into keyboard queue
GETIN = $FFE4 ; Places the ASCII value into the Accumulator
PLOT = $FFF0 ; PLOTs the cursor to the next line down, X = the row number
; Y = the colum. Always Clear the Carry (CLC) vital for
; plotting!
DECDIS = $BDCD
;The stack location for temporary strings...
tempst1 = [=11=]20
tempst2 = [=11=]21
;Screen details...
Screen = 00
Border = $D020
Background = $D021
; I/O Stuff.........
LSTX = [=11=]c5 ; Current key pressed.
; 01=ENTER. 3C=SPACE. 1=38. 2=3b. 3=08. 4=0b. 5=10. 6=13. 7=18. 8=1b. 9=20
; Y=19. N=27. S=0d. P=29.
*=10
lda #147 ; This is a BASIC routine that presses the keyboard
jsr CHROUT ; button that clears the screen.
lda #00
sta Border
sta Background
jsr Init ; Split the screen!
ldx #[=11=]
lda #[=11=]e
jsr CHROUT
ldx #20
ldy #00
clc
jsr PLOT
lda #>Siliconi
sta tempst2
lda #<Siliconi
sta tempst1
jsr print
ldx #01
ldy #00
clc
jsr PLOT
lda #>message
sta tempst2
lda #<message
sta tempst1
jsr print
loaddccimage
;lda f40,x
;sta 00,x
lda 40,x
sta 00,x
lda 40,x
sta 00,x
;lda 40,x
;sta 00,x
;lda 28,x
;sta $d800,x
lda 28,x
sta $d900,x
lda 28,x
sta $da00,x
;lda 28,x
;sta $db00,x
inx
bne loaddccimage
lda #b
sta $d011
lda #
sta $d016
jump jmp *
;===================
Init SEI ; set interrupt bit, make the CPU ignore interrupt requests
LDA #%01111111 ; switch off interrupt signals from CIA-1
STA $DC0D
AND $D011 ; clear most significant bit of VIC's raster register
STA $D011
LDA $DC0D ; acknowledge pending interrupts from CIA-1
LDA $DD0D ; acknowledge pending interrupts from CIA-2
LDA #0 ; set rasterline where interrupt shall occur
STA $D012
LDA #<Irq ; set interrupt vectors, pointing to interrupt service routine below
STA 14
LDA #>Irq
STA 15
LDA #%00000001 ; enable raster interrupt signals from VIC
STA $D01A
CLI ; clear interrupt flag, allowing the CPU to respond to interrupt requests
RTS ; ?? Leave here ??
Irq LDA $D011 ; select text screen mode
AND #%11011111
STA $D011
lda #
sta $d018
LDA #%00000000
sta $d016
LDA #<Irq2 ; set interrupt vectors to the second interrupt service routine at Irq2
STA 14
LDA #>Irq2
STA 15
LDA #100
STA $D012 ; next interrupt will occur at line no. 0
ASL $D019 ; acknowledge the interrupt by clearing the VIC's interrupt flag
JMP $EA31 ; jump into KERNAL's standard interrupt service routine to handle keyboard scan, cursor display etc.
Irq2 LDA $D011 ; select bitmap screen mode
ORA #%00100000
STA $D011
lda #
sta $d018
LDA #%00010000
sta $d016
LDA #<Irq ; set interrupt vectors back to the first interrupt service routine at Irq
STA 14
LDA #>Irq
STA 15
LDA #200
STA $D012 ; next interrupt will occur at line no. 210
ASL $D019 ; acknowledge the interrupt by clearing the VIC's interrupt flag
JMP $EA81 ; jump into shorter ROM routine to only restore registers from the stack etc
Print
ldy #0 ;Clear the Y register
Print1
lda (tempst1),y
cmp #255
beq PrintDone
jsr PrintChar
iny
jmp Print1
PrintDone
RTS
PrintChar
cmp #48
bcc PrintChar1
PrintChar1
jsr CHROUT
rts
Siliconi
Text "COMMENCE MINE Y/N?"
byte 255
message
Text "Moving into range of the first candidate..."
byte 255
*=FFE
incbin "ASTRO1.prg"
这个问题似乎与 PETSCII specification 的功能有关,称为 shifting。
Assuming the graphics mode is unshifted, PETSCII has only uppercase letters in its powerup state.
在移位模式下,小写字符 a-z
与未移位模式下的大写字符 A-Z
占用相同的字符 space (0x41..0x5a)。在此模式下,大写字符位于 (0x61..0x7a),其中包含未移位模式下的一些图形字形。
证据支持这一点,因为小写字母显示为大写字母,大写字母显示为块图形字符。
解决这个问题:
On C64 the sets are alternated by flipping bit 2 of the byte 53272
或者,我认为可以不使用 KERNAL 函数直接将正确的字符输出到屏幕内存。我不确定这一点,因为我编写 C64 已经很长时间了。可能是需要禁用字符集的切换,以便随机按键不会改变屏幕...