匯編器:CBM prg Studio。
大家好,圣誕快樂,節日快樂 :) 我的中斷中的文本輸出是怎么回事?我一定在這里遺漏了一些明顯的東西,但請看一下所附的圖片......
應該是這樣說的:
“進入第一個候選人的范圍……”
*位圖顯示
“開始我的作業是/否?”
看一下所附的圖片,親眼看看。
下面是代碼。感謝您抽出時間來看看,這讓我整晚都莫名其妙!
:) James點擊這里查看圖片
; 10 SYS (2064)
*=$0801
BYTE $0E, $08, $0A, $00, $9E, $20, $28, $32, $30, $36, $34, $29, $00, $00, $00
;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 = $0020
tempst2 = $0021
;Screen details...
Screen = $0400
Border = $D020
Background = $D021
; I/O Stuff.........
LSTX = $00c5 ; 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.
*=$0810
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 #$00
lda #$0e
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 $3f40,x
;sta $0400,x
lda $4040,x
sta $0500,x
lda $4140,x
sta $0600,x
;lda $4240,x
;sta $0700,x
;lda $4328,x
;sta $d800,x
lda $4428,x
sta $d900,x
lda $4528,x
sta $da00,x
;lda $4628,x
;sta $db00,x
inx
bne loaddccimage
lda #$3b
sta $d011
lda #$18
sta $d016
jump jmp *
;===================
Init SEI ; set interrupt bit, make the CPU ignore interrupt requests
LDA #111111 ; 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 $0314
LDA #>Irq
STA $0315
LDA # 000001 ; 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 #011111
STA $D011
lda #$14
sta $d018
LDA # 000000
sta $d016
LDA #<Irq2 ; set interrupt vectors to the second interrupt service routine at Irq2
STA $0314
LDA #>Irq2
STA $0315
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 # 100000
STA $D011
lda #$18
sta $d018
LDA # 010000
sta $d016
LDA #<Irq ; set interrupt vectors back to the first interrupt service routine at Irq
STA $0314
LDA #>Irq
STA $0315
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
*=$1FFE
incbin "ASTRO1.prg"
uj5u.com熱心網友回復:
該問題似乎與稱為移位的PETSCII 規范的功能有關。
假設圖形模式未轉換,則 PETSCII 在其通電狀態下只有大寫字母。
在移位模式下,小寫字符與非移位模式下的大寫字符a-z占用相同的字符空間(0x41..0x5a)A-Z。在這種模式下,大寫字符位于 (0x61..0x7a),它在未移位模式下保存了一些圖形字形。
證據支持這一點,因為小寫字母顯示為大寫,而大寫字母顯示為塊圖形字符。
要解決這個問題:
在 C64 上,通過翻轉位元組 53272 的第 2 位來交替設定
或者,我認為可以在不使用 KERNAL 函式的情況下將正確的字符直接輸出到螢屏記憶體。我不確定這一點,因為我撰寫 C64 已經很長時間了。可能是因為需要禁用字符集的切換,以便隨機按鍵不會改變螢屏......
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/392653.html
下一篇:GNU匯編器沒有給出正確的浮點值
