问题描述
汇编程序:CBM prg Studio
这是我之前的帖子,我觉得我已经取得了一些进展,但仍然很卡。 My previous post requesting help on this issue a few stages ago... 从乐于助人的社区成员 Emir Akayd 提交的答案中,我选择了选项 1。
目前我只是使用 TEST JUMPER 来尝试每个图像,并希望在每个加载的图像和初始化到我的游戏之间移动到计时器上。
我认为这里的解决方案现在对于更高级的程序员来说应该是显而易见的。我想我一定是在不太明显的加载屏幕 Ram 部分或稍后在标签“设置”下的代码中做了一些愚蠢的事情,我的评论应该解释所有。
对任何建议都很满意,非常感谢您的浏览!
; 10 SYS (4096)
*=$0801
BYTE $0E,$08,$0A,$00,$9E,$20,$28,$34,$30,$39,$36,$29,$00
*=$1FFE
incbin "ASTRO1.prg" ;2 bytes behind as stated in tutorial due to header.
*=$5FFE
incbin "ASTRO2.prg"
*=$9FFE
incbin "ASTRO3.prg"
*=$1000
start1 ; SET THE BACKGROUND SCREEN COLOURS!
lda #$00 ; This is where the main background colour of image is
sta $d020 ; sent to the C64 background and boarder.
sta $d021 ; Becasue all three images have black as their backgrounds
ldx #$00 ; I have just used the black colour from the system to
; store them respectively.
jmp LDimg2 ; TEST JUMPER! Change this each time to view a different
; bitmap? Once working,which it isn't,we can look at adding
; a timer to allow for switching between each bitmap at game
; start.
LDimg1 ; LOADING THE SCREEN RAM.
lda $3f40,x ; The Charmem data from the export is loaded into A
sta $0c00,x ; This is a loop that fills the next400 bytes of screen
lda $4040,x ; RAM with our data from the bitmap
sta $0d00,x
lda $4140,x
sta $0e00,x
lda $4240,x
sta $0f00,x
lda $4328,x ; LOADING COLOUR RAM!
sta $d800,x
lda $4428,x
sta $d900,x
lda $4528,x
sta $da00,x
lda $4628,x
sta $db00,x
inx ; Inc the X registry
bne LDimg1 ; While x is not equal to zero keep branch looping!
jmp setup
LDimg2 ; LOADING THE SCREEN RAM.
lda $3f40,x ; The Charmem data from the export is loaded into A
sta $4c00,x ; RAM with our data from the bitmap
sta $4d00,x
sta $4e00,x
sta $4f00,x
lda $4328,x
inx ; Inc the X registry
bne LDimg2 ; While x is not equal to zero keep branch looping!
jmp setup
LDimg3 ; LOADING THE SCREEN RAM.
lda $3f40,x ; The Charmem data from the export is loaded into A
sta $8c00,x ; RAM with our data from the bitmap
sta $8d00,x
sta $8e00,x
sta $8f00,x
lda $4328,x
lda $4428,x
inx ; Inc the X registry
bne LDimg3 ; While x is not equal to zero keep branch looping!
jmp setup
setup
lda #$3b ; BITMAP MODE!
sta $d011 ; Mode storage. #$3b is Bitmap mode.
lda #$18 ; COLOUR MODE!?
sta $d016 ; Load $d016 into #$18 we switch to multi-colour mode.
lda #$38 ; image 1 - I understand that this 0c00 / 0400 = 3
; & the 8 comes from 2000 (starting mem of Bitmap) divided
; by 0400 (screen RAM in bytes).
sta $d018 ; Guessing the significance of this address is screen based?
;lda #$?? ; image 2 - doing the math above with the image two the
; conditions the results here are 13 & 18,but how do I
; combine larger hex numbers like this?
;sta $d018 ; See query above
;lda #$?? ; image 3 - As above the math here is clear. But how do I
; combine the results into the 2 numbers?
;sta $d018
play jmp play
解决方法
如果我没理解错的话,您是在尝试将位图复制到 VIC-II 设置为读取的区域中。但这不是你的程序在做什么!
你的程序从start1
开始,设置背景颜色和边框颜色为黑色,然后跳转到LDimg2
,将屏幕ram复制到某个目的地,然后跳转到{{1} },然后继续执行setup
,这是一个无限循环。
您的 play
例程似乎为位图 1 进行了设置(但您的程序似乎仅复制(部分)位图 2?)。
以下是猜测,因为我看不到 setup
里面有什么。但是 ASTRO1.prg
似乎将某些内容从 LDimg2
复制到从 ASTRO1.prg
开始的区域。不过,它似乎并没有复制整个位图。 C64 位图是 8 KB。您只复制了 1 KB。