fadix Posted March 26, 2014 Share Posted March 26, 2014 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 Quote Link to comment Share on other sites More sharing options...
+Stephen Posted March 26, 2014 Share Posted March 26, 2014 My guess would be GPRIOR needs set? Quote Link to comment Share on other sites More sharing options...
fadix Posted March 26, 2014 Author Share Posted March 26, 2014 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 Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted March 26, 2014 Share Posted March 26, 2014 I assume Y is initialized to zero before entering the loop? Quote Link to comment Share on other sites More sharing options...
fadix Posted March 26, 2014 Author Share Posted March 26, 2014 I assume Y is initialized to zero before entering the loop? Nope, good catch. It works now. Quote Link to comment Share on other sites More sharing options...
fadix Posted March 27, 2014 Author Share Posted March 27, 2014 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 Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted March 27, 2014 Share Posted March 27, 2014 (edited) 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 March 27, 2014 by flashjazzcat Quote Link to comment Share on other sites More sharing options...
fadix Posted March 27, 2014 Author Share Posted March 27, 2014 (edited) Do you know of a good tutorial for sending a character to the screen? I tried the examples at http://www.atariarchives.org/roots/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 March 27, 2014 by fadix Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted March 27, 2014 Share Posted March 27, 2014 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.