0

汇编:CBM prg Studio

这是我之前的帖子,我觉得我已经取得了一些进展,但仍然非常卡住。 我之前的帖子在几个阶段前就这个问题请求帮助......从乐于助人的社区成员Emir Akayd提交的答案中,我选择了选项 1。

目前我只是使用 TEST JUMPER 来尝试每个图像,并希望在每个加载的图像和初始化到我的游戏之间移动到一个计时器。

我认为这里的解决方案现在对更高级的程序员来说应该是显而易见的。我认为我必须在不那么明显的加载屏幕 Ram 部分或稍后在标签“设置”下的代码中做一些愚蠢的事情,我的评论应该解释一切。

对任何建议都很满意,非常感谢您的关注!

; 10 SYS (4096)


*=$0801

        BYTE    $0E, $08, $0A, $00, $9E, $20, $28,  $34, $30, $39, $36, $29, $00, $00, $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 ; This is a loop that fills the next400 bytes of screen
        lda $4040,x ; RAM with our data from the bitmap
        sta $4d00,x
        lda $4140,x
        sta $4e00,x
        lda $4240,x
        sta $4f00,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 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 ; This is a loop that fills the next400 bytes of screen
        lda $4040,x ; RAM with our data from the bitmap
        sta $8d00,x
        lda $4140,x
        sta $8e00,x
        lda $4240,x
        sta $8f00,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 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

4

1 回答 1

2

如果我理解正确,您正试图将位图复制到 VIC-II 设置读取的区域。那不是您的程序正在做的事情!

您的程序从 开始start1,将背景颜色和边框颜色设置为黑色,然后跳转到LDimg2,将屏幕内存复制到某个目的地,然后跳转到setup,然后继续执行play无限循环。

您的setup例程似乎为位图 1 进行了设置(但您的程序似乎只复制(部分)位图 2?)。

以下是猜测,因为我看不到里面是什么ASTRO1.prg。但LDimg2似乎将某些ASTRO1.prg内容从$4c00. 不过,它似乎并没有复制整个位图。C64 位图为 8 KB。您只复制 1 KB。

于 2021-08-01T15:29:33.880 回答