Jump to content

Photo

Player Missile Graphics 2 and 3 Issue

PMG player missile graphics

8 replies to this topic

#1 fadix OFFLINE  

fadix

    Space Invader

  • 48 posts

Posted Wed Mar 26, 2014 11:35 AM

I'm having issues with the following code. Players 0 and 1 display a vertical line as expected, but players 2 and 3 appear to just display in the border area at the very top and very bottom. Does anyone know what is causing this?

    PMBASELOC = $8000
    M = $8300
    P0 = $8400
    P1 = $8500
    P2 = $8600
    P3 = $8700
    PCOLR0 = 704
    PCOLR1 = 705
    PCOLR2 = 706
    PCOLR3 = 707
    COLOR2 = 710 ;playfield
    COLOR4 = 712 ;border
    HPOSP0 = $D000
    HPOSP1 = $D001
    HPOSP2 = $D002
    HPOSP3 = $D003
    PMBASE = $D407
    SDMCTL = $22F
    GRACTL = $D01D

    *= $9000

INIT
    lda #0
    sta PCOLR0
    sta PCOLR1
    sta PCOLR2
    sta PCOLR3
    lda #176
    sta COLOR2
    sta COLOR4
    lda #PMBASELOC/256
    sta PMBASE
    lda #62
    sta SDMCTL
    lda #3
    sta GRACTL
    lda #50
    sta HPOSP0
    lda #100
    sta HPOSP1
    lda #150
    sta HPOSP2
    lda #200
    sta HPOSP3

CLRPM1
    lda #0
    tax
CLRPM2
    sta P0, x
    sta P1, x
    sta P2, x
    sta P3, x
    inx
    bne CLRPM2

SETPM01
    lda #255
    ldx #0
SETPM02
    sta P0, x
    sta P1, x
    sta P2, x
    sta P3, x
    inx
    iny
    cpy #255
    bne SETPM02

END
    jmp END



#2 Stephen OFFLINE  

Stephen

    Quadrunner

  • 7,642 posts
  • A8 Gear Head
  • Location:No longer in Crakron, Ohio

Posted Wed Mar 26, 2014 11:48 AM

My guess would be GPRIOR needs set?



#3 fadix OFFLINE  

fadix

    Space Invader

  • Topic Starter
  • 48 posts

Posted Wed Mar 26, 2014 11:56 AM

Yes, GPRIOR did the trick. Silly default, IMO.

 

Now why do I still get a solid line with the following section code? I made sure to clear the memory first. It should draw for 10 lines, then jump 10 lines, draw 10 lines...

SETPM01
    lda #255
    ldx #0
SETPM02
    sta P0, x
    sta P1, x
    sta P2, x
    sta P3, x
    inx
    iny
    cpy #10
    bne SETPM02
    txa
    clc
    adc #10
    tax
    ldy #0
    lda #255
    cpx #240
    bne SETPM02


#4 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • 14,588 posts
  • Location:United Kingdom

Posted Wed Mar 26, 2014 12:00 PM

I assume Y is initialized to zero before entering the loop?

#5 fadix OFFLINE  

fadix

    Space Invader

  • Topic Starter
  • 48 posts

Posted Wed Mar 26, 2014 12:03 PM

I assume Y is initialized to zero before entering the loop?

Nope, good catch. It works now.



#6 fadix OFFLINE  

fadix

    Space Invader

  • Topic Starter
  • 48 posts

Posted Thu Mar 27, 2014 2:59 PM

I got another question, so I will just tack it onto this thread.

 

I tried using the following code to hide the cursor, but it still shows. Per Mapping The Atari, I am updating the cursor position to actually hide the cursor, but it is still showing. I also tried using 1 instead of 2 and it still didn't work. CRSINH is 752, ROWCRS is 84 and COLCRSL is 85.

    lda #2
    sta CRSINH ; hide cursor
    sta ROWCRS ; update cursor pos to actually hide cursor
    sta COLCRSL


#7 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • 14,588 posts
  • Location:United Kingdom

Posted Thu Mar 27, 2014 3:06 PM

I don't think just storing coordinates works, since this on its own doesn't move the cursor. You actually have to send a character to the screen (such as ATASCII 125 to clear it). POKE 752,1 works in BASIC because immediate mode commands cause writes to the screen editor.


Edited by flashjazzcat, Thu Mar 27, 2014 3:08 PM.


#8 fadix OFFLINE  

fadix

    Space Invader

  • Topic Starter
  • 48 posts

Posted Thu Mar 27, 2014 3:46 PM

Do you know of a good tutorial for sending a character to the screen? I tried the examples at http://www.atariarch...s/chapter_7.php, but I'm not exactly sure how to run the two separate programs. I just load the first, and then load and run the second, but it crashes the emulator.


Edited by fadix, Thu Mar 27, 2014 3:46 PM.


#9 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • 14,588 posts
  • Location:United Kingdom

Posted Thu Mar 27, 2014 4:34 PM

Those examples are fine but you'd be better off merging them into your own program (they're intended to be assembled with the Assembler Editor or similar, so the first bit of code is still at $5000 when you assemble the second part). So you should INCLUDE the "PRNTSC" routine when assembling your program, and this will enable you to JSR to it at the appropriate points. You can remove the "*=$5000" if you're merging this code with your own program, since you should set the origin at the top of your own code.







Also tagged with one or more of these keywords: PMG, player missile, graphics

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users