Search the Community
Showing results for tags 'pmg'.
-
I have been working on a simple player-missile graphics demo in BASIC using the VBI for fast player movement. The code below is modified from Chapter 5 of Compute's First Book of Atari Graphics (p164). Everything works fine except that when I set a Graphics mode (e.g. six or eight) I get a weird line on the screen that moves as the player moves up and down. This only happens when I specify a graphics mode. No graphics mode is fine. Graphics 0 is fine. I am stuck on why this is happening. I assume I am bleeding into a memory area. Here is the ATR file with the BASIC program. The code and a screenshot are below. Many thanks for your help!!! 10 REM * DEMO OF PLAYER-MISSILE GRAPHICS USING THE VERTICAL * 20 REM * BLANK INTERRUPT FOR FAST PLAYER MOVEMENT * 20 REM see CH5, p164 of Compute's First Book of Atari 30 REM for base code used to make this PM graphics demo 40 REM Modifications by Jason H. Moore, Ph.D. 50 REM March 24, 2019 100 REM * INITIALIZE PLAYER & MEMORY LOCATIONS 110 GRAPHICS 0 120 POKE 752,1:PRINT " ":REM TURN OFF CURSOR 130 SETCOLOR 2,0,0:REM BLACK BACKGROUND 140 PCOL0=216:REM PLAYER COLOR GREEN 150 POKE 704,PCOL0:REM SET PLAYER COLOR 160 PXMEM=53248:PYMEM=1780:PHMEM=1784 170 P0X=120:P0Y=80:REM INIT PLAYER POSITION VARIABLES 200 REM * INITIALIZE VBLANK PLAYER MOVEMENT ROUTINE * 210 FOR I=1536 TO 1706:READ A:POKE I,A:NEXT I 220 FOR I=1774 TO 1787:POKE I,0:NEXT I 230 PM=PEEK(106)-16:PMBASE=256*PM 240 FOR I=PMBASE+1023 TO PMBASE+2047:POKE I,0:NEXT I 250 FOR I=PMBASE+1025 TO PMBASE+1038:READ A:POKE I,A:NEXT I 260 POKE 559,62:POKE 623,1:POKE 1788,PM+4 270 POKE 53277,3:POKE 53256,1:POKE 54279,PM 300 X=USR(1696) 400 REM * SET PLAYER POSITION AND HEIGHT * 410 POKE PHMEM,14:REM HEIGHT 420 POKE PXMEM,P0X:POKE PYMEM,P0Y:REM POSITION 430 GOSUB 500 440 GOTO 400 450 END 500 REM * PLAYER MOVEMENT CALCULATIONS * 510 JOY = STICK(0):REM READ JOYSTICK VALUE 520 IF JOY=15 THEN RETURN:REM RETURN IF NOT PRESSED 530 IF JOY=11 THEN P0X=P0X-2:REM LEFT? DECREASE X 540 IF JOY=7 THEN P0X=P0X+2:REM RIGHT? INCREASE X 550 IF JOY=13 THEN P0Y=P0Y+2:REM UP? INCREASE Y 560 IF JOY=14 THEN P0Y=P0Y-2:REM DOWN? DECREASE Y 570 IF P0X>190 THEN P0X=50:REM SCREEN WRAP RIGHT 580 IF P0X<50 THEN P0X=190:REM SCREEN WRAP LEFT 590 IF P0Y>205 THEN P0Y=35:REM SCREEN WRAP DOWN 600 IF P0Y<35 THEN P0Y=205:REM SCREEN WRAP UP 610 RETURN 1000 REM * VBLANK INTERRUPT ROUTINE * 1010 DATA 162,3,189,244,6,240,89,56,221,240,6,240,83,141,254,6,106,141 1020 DATA 255,6,142,253,6,24,169,0,109,253,6,24,109,252,6,133,204,133 1030 DATA 206,189,240,6,133,203,173,254,6,133,205,189,248,6,170,232,46,255 1040 DATA 6,144,16,168,177,203,145,205,169,0,145,203,136,202,208,244,76,87 1050 DATA 6,160,0,177,203,145,205,169,0,145,203,200,202,208,244,174,253,6 1060 DATA 173,254,6,157,240,6,189,236,6,240,48,133,203,24,138,141,253,6 1070 DATA 109,235,6,133,204,24,173,253,6,109,252,6,133,206,189,240,6,133 1080 DATA 205,189,248,6,170,160,0,177,203,145,205,200,202,208,248,174,253,6 1090 DATA 169,0,157,236,6,202,48,3,76,2,6,76,98,228,0,0,104,169 1100 DATA 7,162,6,160,0,32,92,228,96 2000 REM * PLAYER SHAPE DATA * 2010 DATA 66,129,129,153,153,255,255,255,255,153,153,129,129,66
-
http://atari.dan24.pl/
-
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
- 8 replies
-
- PMG
- player missile
-
(and 1 more)
Tagged with:
-
I'm working on writing my first game in Action!. It's a two player game, and the players are identical except that they are mirrored. I'm storing the shape data in a BYTE ARRAY, is there a trick to flipping my player?