kenjennings Posted February 20, 2014 Share Posted February 20, 2014 The other idea... Change the lines of text at the bottom of the screen from OS mode 0 text, to OS mode 1 text. That allows you to use a text mode displaying all four playfield colors. Simple demonstration.... The display list is located, the four text lines are changed. The screen memory of the text lines is located,and a character is poked into screen memory across the width of the screen. In this case, character 255 is the underscore character, so the result is a straight line across the screen using the fourth playfield color which has been set to green. This wrecks the text window at the bottom of the screen. So, after hitting Break you may need to blindly type GR.0 and hit enter to get back to a usable display. 1000 GRAPHICS 3 1025 SETCOLOR 0,0,15:SETCOLOR 1,3,6:SETCOLOR 3,12,6 1100 DL=PEEK(560)+(256*PEEK(561)):REM FIND THE DISPLAY LIST 1110 REM CHANGE THE OS MODE 0/ANTIC MODE 2 TEXT LINES 1115 REM TO OS MODE 1/ANTIC MODE 6 TEXT LINES. 1125 POKE DL+25,70:POKE DL+28,6:POKE DL+29,6:POKE DL+30,6 1150 REM FIND THE START OF THE "TEXT" WINDOW MEMORY IN THE DISPLAY LIST 1175 SC=PEEK(DL+26)+(256*PEEK(DL+27)) 1200 REM STUFF A GRAPHICS CHARACTER ACROSS THE TOP TEXT LINE 1225 FOR I=0 TO 19:POKE SC+I,255:NEXT I 1250 REM ANIMATE THE FLAGS 1275 FOR I=0 TO 10 1300 POSITION I,5:? #6;" CCCBBBBB":REM US FLAG 1325 POSITION I,6:? #6;" CCCAAAAA" 1350 POSITION I,7:? #6;" BBBBBBBB" 1375 POSITION I,8:? #6;" AAAAAAAA" 1400 POSITION I,9:? #6;" BBBBBBBB" 1425 POSITION 31-I,5:? #6;"BBBBBBBB ":REM THAI FLAG 1450 POSITION 31-I,6:? #6;"AAAAAAAA " 1475 POSITION 31-I,7:? #6;"CCCCCCCC " 1500 POSITION 31-I,8:? #6;"AAAAAAAA " 1525 POSITION 31-I,9:? #6;"BBBBBBBB " 1550 FOR N=1 TO 100:NEXT N 1575 NEXT I 1600 GOTO 1600 Quote Link to comment Share on other sites More sharing options...
BoatofCar Posted February 20, 2014 Author Share Posted February 20, 2014 Thank you! I'm going to do some reading to figure out how display lists work. Quote Link to comment Share on other sites More sharing options...
BoatofCar Posted February 20, 2014 Author Share Posted February 20, 2014 DL=PEEK(560)+(256*PEEK(561)):REM FIND THE DISPLAY LIST I still don't understand this...I looked at the Compute Book of Atari Graphics and got to here: Now here's the important part. The next byte (66) is a mode 0 address byte. But, instead of the next two lines containing the address of the screen memory, they contain the address of the text editor memory. This is the start of the text window. Modes 1 through 8 use the screen memory. Mode 0 uses the text editor memory. As you may have already guessed, the next three bytes (2) are mode 0 bytes, giving us the last three rows of the text window. If we were in a full screen format, these last six bytes would not be here. Now we are to the end of the list. This next byte (65) is also an address byte. But it has a special purpose. It tells the computer that it has reached the end of the list and that the next two bytes contain the starting address of the list. (The same as locations 560, 561. ) I know that's related somehow but I don't know why. Quote Link to comment Share on other sites More sharing options...
kenjennings Posted February 20, 2014 Share Posted February 20, 2014 DL=PEEK(560)+(256*PEEK(561)):REM FIND THE DISPLAY LIST I still don't understand this...I looked at the Compute Book of Atari Graphics and got to here: I know that's related somehow but I don't know why. People write books about this. The graphics chip, ANTIC, is a processor, like the 6502 CPU, but more simple. Like a 6502 CPU, ANTIC executes a program stored in memory. This program is called the Display List. The Display list is a series of instructions stored in memory that direct ANTIC to show lines of text, lines of graphics, or blank lines. The instructions also direct ANTIC where to find the data to be displayed on screen. So, the Display list is in memory, and the data to show on the display is also in memory. The PEEK560/561 you show above is where the operating system keeps the shadow copy of the current display list for the screen being displayed. During each vertical blank interrupt the operating system resets ANTIC's program address register (that means ANTIC's pointer to the start of the display list) to the contents of locations 560/561. Below is a dump of an operating system's graphics mode 3 display, including the text window. For now, just look at the VALUE and Description columns.... Disassembled Display List (GR3) to its corresponding graphics line and Scan Line... DL Byte Value Gfx Line Scan Line(s) TV Scan Line(s) Description ======= ===== ======== ============ =============== ============ $000 000 $70 112 $01 - $08 001 - 008 $08 - $0F 008 - 015 8 Blank Lines $001 001 $70 112 $09 - $10 009 - 016 $10 - $17 016 - 023 8 Blank Lines $002 002 $70 112 $11 - $18 017 - 024 $18 - $1F 024 - 031 8 Blank Lines $003 003 $48 072 $01 001 $19 - $20 025 - 032 $20 - $27 032 - 039 Mode 8 + LMS (8 Scan Lines) $004 004 $70 112 $005 005 $9E 158 $006 006 $08 008 $02 002 $21 - $28 033 - 040 $28 - $2F 040 - 047 Mode 8 (8 Scan Lines) $007 007 $08 008 $03 003 $29 - $30 041 - 048 $30 - $37 048 - 055 Mode 8 (8 Scan Lines) $008 008 $08 008 $04 004 $31 - $38 049 - 056 $38 - $3F 056 - 063 Mode 8 (8 Scan Lines) $009 009 $08 008 $05 005 $39 - $40 057 - 064 $40 - $47 064 - 071 Mode 8 (8 Scan Lines) $00A 010 $08 008 $06 006 $41 - $48 065 - 072 $48 - $4F 072 - 079 Mode 8 (8 Scan Lines) $00B 011 $08 008 $07 007 $49 - $50 073 - 080 $50 - $57 080 - 087 Mode 8 (8 Scan Lines) $00C 012 $08 008 $08 008 $51 - $58 081 - 088 $58 - $5F 088 - 095 Mode 8 (8 Scan Lines) $00D 013 $08 008 $09 009 $59 - $60 089 - 096 $60 - $67 096 - 103 Mode 8 (8 Scan Lines) $00E 014 $08 008 $0A 010 $61 - $68 097 - 104 $68 - $6F 104 - 111 Mode 8 (8 Scan Lines) $00F 015 $08 008 $0B 011 $69 - $70 105 - 112 $70 - $77 112 - 119 Mode 8 (8 Scan Lines) $010 016 $08 008 $0C 012 $71 - $78 113 - 120 $78 - $7F 120 - 127 Mode 8 (8 Scan Lines) $011 017 $08 008 $0D 013 $79 - $80 121 - 128 $80 - $87 128 - 135 Mode 8 (8 Scan Lines) $012 018 $08 008 $0E 014 $81 - $88 129 - 136 $88 - $8F 136 - 143 Mode 8 (8 Scan Lines) $013 019 $08 008 $0F 015 $89 - $90 137 - 144 $90 - $97 144 - 151 Mode 8 (8 Scan Lines) $014 020 $08 008 $10 016 $91 - $98 145 - 152 $98 - $9F 152 - 159 Mode 8 (8 Scan Lines) $015 021 $08 008 $11 017 $99 - $A0 153 - 160 $A0 - $A7 160 - 167 Mode 8 (8 Scan Lines) $016 022 $08 008 $12 018 $A1 - $A8 161 - 168 $A8 - $AF 168 - 175 Mode 8 (8 Scan Lines) $017 023 $08 008 $13 019 $A9 - $B0 169 - 176 $B0 - $B7 176 - 183 Mode 8 (8 Scan Lines) $018 024 $08 008 $14 020 $B1 - $B8 177 - 184 $B8 - $BF 184 - 191 Mode 8 (8 Scan Lines) $019 025 $42 066 $15 021 $B9 - $C0 185 - 192 $C0 - $C7 192 - 199 Mode 2 + LMS (8 Scan Lines) $01A 026 $60 096 $01B 027 $9F 159 $01C 028 $02 002 $16 022 $C1 - $C8 193 - 200 $C8 - $CF 200 - 207 Mode 2 (8 Scan Lines) $01D 029 $02 002 $17 023 $C9 - $D0 201 - 208 $D0 - $D7 208 - 215 Mode 2 (8 Scan Lines) $01E 030 $02 002 $18 024 $D1 - $D8 209 - 216 $D8 - $DF 216 - 223 Mode 2 (8 Scan Lines) $01F 031 $41 065 JVB - Jump Vertical Blank $020 032 $4E 078 $021 033 $9E 158 Where you see "LMS" in the description the instruction includes an option directing ANTIC to change its pointer to screen memory. This means ANTIC uses the two bytes that follow as the address for screen data. Two of these LMS options occur in the display list .... One at the first graphics mode instruction at the top of the screen. And another later at the beginning of the text window. The demo program simply locates the display list and changes the instructions used to display the text window to show a different text mode. Quote Link to comment Share on other sites More sharing options...
BoatofCar Posted February 21, 2014 Author Share Posted February 21, 2014 Where does the 256 come from in the line, and why are you multiplying (?) it to the second PEEK value? Quote Link to comment Share on other sites More sharing options...
+Ripdubski Posted February 21, 2014 Share Posted February 21, 2014 (edited) You perform the operation on the values in the two locations to get the memory address. One is a high byte, the other is a low byte. This is covered in depth on the first few pages of Mapping The Atari. http://www.atariarchives.org/mapping/introduction.php Edited February 21, 2014 by Ripdubski Quote Link to comment Share on other sites More sharing options...
kenjennings Posted February 21, 2014 Share Posted February 21, 2014 The Atari is an 8-bit system. The basic unit of information is the byte, which stores 8 bits of information. Just as there are place values for base 10 (ones, tens, hundreds, thousands, etc) so each bit in the byte holds a place value. Bits' values are base 2 values and from least significant bit to most significant bit these values are: bit 1 == 1 bit 2 == 2 bit 3 == 4 bit 4 == 8 bit 5 == 16 bit 6 == 32 bit 7 == 64 bit 8 == 128. The smallest value for a byte is 0. The largest value possible in one byte is 1 + 2 + 4 + 8 + 16 + 32 + 64 + 128 == 255. (A byte can also store negative values, but that is not relevant here and would only complicate the discussion.) Then, in order to count higher than 255 another byte is used, creating a 16-bit value. Since the most significant bit in the first byte is 128, the next bit is value 256. This is the the least significant bit in the next byte. Bit 1 (or 9) == 256 Bit 2 (or 10) == 512 Bit 3 (or 11) == 1024 Bit 4 (or 12) == 2048 Bit 5 (or 13) == 4096 Bit 6 (or 14) == 8192 Bit 7 (or 15) == 16384 Bit 8 (or 16) == 32768 Many 8-bit systems have 16-bit addressing. This means 2 bytes are used to identify a location in memory and these two bytes are commonly referred to as the low byte (0 to 255) and the high byte (256...). So, the formula for figuring out (the decimal equivalent of) an address specified by a two-byte, 16-bit value is: low byte + ( 256 * high byte) ANTIC uses a 16-bit address to locate the start of its Display List. ANTIC's Display list also has instructions that use 16-bit addresses to identify the location of screen memory. When one becomes familiar with assembly language, byte values and 16-bit values become constant friends. Most assemblers have special directives to make it faster/easier to break apart 16-bit values into their low byte/high byte components. In fact, this is so common that even some BASICs have versions of the PEEK and POKE that work on 16-bit values/addresses (and Atari BASIC is not one of them which is the reason the lowbyte+256*hibyte formula is necessary.) Some things in ANTIC use only 8-bits to identify the starting location of memory used for a feature.... The location of player/missile graphics memory, the location of the character set. In these cases the byte specified is the high byte (also called the page pointer, because each block of 256 bytes is called a page ). Simply multiplying that page value by 256 gives the starting address. . . So, up to this point there are two examples of working with addresses (page * 256, and 16-bit values). First, the demo relies on the fact that the OS creates the graphics mode at the end of free memory, and that the display list for the current graphics mode comes before the screen memory. So, a reasonably safe place for a BASIC program to set up user-defined graphics features is just before the display list. The program uses the high byte of the address of the Display list ( peek(561) ), and calculates the value several pages before that to use for Player/Missile graphics. The more recent example program also uses the complete address of the Display List ( peek(560) + (256*peek(561) ) in order to alter the instructions inside the Display List to change the type of text mode used in the text window. Quote Link to comment Share on other sites More sharing options...
BoatofCar Posted February 25, 2014 Author Share Posted February 25, 2014 (edited) I'm back again! Trying to use PMG2 and 3 to draw a cake to throw. 370 REM INIT ALL THE STUFF 380 GRAPHICS 2 390 HISX=78:HERX=170:FLOX=0:FLOMV=0:CATCHES=0 400 FOR I=0 TO 27:POKE 53248+I,0:NEXT I:REM CLEAR COLORS, HPOS, ETC, IN GTIA. 410 POKE 710,198:REM "LAND" 420 POKE 709,14:REM MIGHT WANT TO READ TEXT 430 POKE 708,0:REM THERE'S A REASON FOR THIS, TRUST ME. 440 POKE 706,248:REM CAKE 450 POKE 705,88:REM GIRL 460 POKE 704,136:REM BOY 461 POKE 707,15:REM CAKE 470 REM SET PM GRAPHICS 480 PMPAGE=INT((PEEK(561)/8)-1)*8 490 POKE 54279,PMPAGE 500 PMMEM=PMPAGE*256 510 P0MEM=PMMEM+512 520 P1MEM=PMMEM+640 530 P2MEM=PMMEM+768 531 P3MEM=PMMEM+896 540 FOR I=0 TO 127 550 POKE P0MEM+I,0:POKE P1MEM+I,0:POKE P2MEM+I,0:POKE P3MEM+I,0 560 NEXT I 570 POKE 53277,2:REM GTIA PLAYERS ON 580 POKE 559,42:REM ANTIC SCREEN, PLAYERS, 2 LINE P/M RESOLUTION 590 POKE 623,1:REM PRIORITY ALL P/M ON TOP 600 FOR I=0 TO 9:READ D:POKE P0MEM+86+I,D:NEXT I:REM HIM 610 DATA 24,24,0,60,90,24,0,24,24,60 620 FOR I=0 TO 9:READ D:POKE P1MEM+86+I,D:NEXT I:REM HER 630 DATA 24,24,0,60,90,24,60,126,24,60 640 FOR I=0 TO 5:READ D:POKE P2MEM+86+I,D:NEXT I:REM RED CAKE 650 DATA 0,120,0,120,0,0 655 FOR I=0 TO 5:READ D:POKE P3MEM+86+I,D:NEXT I:REM WHITE CAKE 656 DATA 48,0,252,132,0,0 660 DIM ST2X(15):REM CONVERT STICK TO MOVEMENT 670 FOR I=0 TO 15:READ D:ST2X(I)=D:NEXT I 680 DATA 0,0,0,0,0,2,2,2 690 DATA 0,-2,-2,-2,0,0,0,0 700 GOTO 130 What am I doing wrong? Edited February 25, 2014 by BoatofCar Quote Link to comment Share on other sites More sharing options...
kenjennings Posted February 25, 2014 Share Posted February 25, 2014 Explain everything you expect to see happen? This looks like you updated the init section to load up players 2 and 3 memory with cake shapes. that looks ok. Where is the rest? Where does the program position the cake parts on the screen? (that is, where is horizontal position set)? The original program only throws the flower (player 2). Quote Link to comment Share on other sites More sharing options...
BoatofCar Posted February 25, 2014 Author Share Posted February 25, 2014 I'd like the program to throw both cake shapes in tandem (P2 and P3). I don't understand how the logic statements HIS, HER, FLO are linked to their respective PMG's in the code. Quote Link to comment Share on other sites More sharing options...
BoatofCar Posted February 25, 2014 Author Share Posted February 25, 2014 I figured out what to do! 190 IF FLOMV=0 AND STRIG(0)=0 THEN FLOMV=SGN(HERX-HISX)*3:FLOX=HISX 191 IF FLOCMV=0 AND STRIG(0)=0 THEN FLOCMV=SGN(HERX-HISX)*3:FLOCX=HISX 200 FLOX=FLOX+FLOMV:IF FLOMV=0 THEN FLOX=0 201 FLOCX=FLOCX+FLOCMV:IF FLOCMV=0 THEN FLOCX=0 210 IF FLOMV<0 AND FLOX<=HERX THEN CATCHES=CATCHES+1:FLOMV=0:FLOX=0 211 IF FLOCMV<0 AND FLOCX<=HERX THEN CATCHES=CATCHES+1:FLOCMV=0:FLOCX=0 220 IF FLOMV>0 AND FLOX>=HERX THEN CATCHES=CATCHES+1:FLOMV=0:FLOX=0 221 IF FLOCMV>0 AND FLOCX>=HERX THEN CATCHES=CATCHES+1:FLOCMV=0:FLOC=0 230 POKE 53248,HISX:POKE 53249,HERX:POKE 53250,FLOX:POKE 53251,FLOCX So, 230 is setting the PMG variables? Quote Link to comment Share on other sites More sharing options...
+Ripdubski Posted February 25, 2014 Share Posted February 25, 2014 Your going to have a hard time compressing this to 10 lines. Quote Link to comment Share on other sites More sharing options...
BoatofCar Posted February 25, 2014 Author Share Posted February 25, 2014 Oh yeah, there's no way. I've still got to add music too! Quote Link to comment Share on other sites More sharing options...
+therealbountybob Posted February 25, 2014 Share Posted February 25, 2014 Define all the variables to meaningful names - that way your code will be easier to understand: HPOSP0=53248 (Match the names with those in your favourite book - like Mapping the Atari!) Then when you use them it's 230 POKE HPOSP0,HISX OR name them something more friendly MrBigGuyHorizPosition=53248 Poke MrBigGuyHorizPosition,HISX Quote Link to comment Share on other sites More sharing options...
BoatofCar Posted February 25, 2014 Author Share Posted February 25, 2014 Where are HISX, HERX, and FLOX defined? I don't understand how the program "knows" they correspond to PMG 0, 1, and 2. Quote Link to comment Share on other sites More sharing options...
+Ripdubski Posted February 26, 2014 Share Posted February 26, 2014 (edited) Initialized at 390 in the last code paste. They seem to hold the current locations of those objects, and are the values put (poked) into the pm memory locations at each movement update. Edited February 26, 2014 by Ripdubski Quote Link to comment Share on other sites More sharing options...
kenjennings Posted February 26, 2014 Share Posted February 26, 2014 HISX, HERX, FLOX are initialized in your listing from yesterday. Line 390. These hold the horizontal (or X) position of the objects, HIm(s), HER, and FLOwer. And yes, line 230 in the other listing is where the Players' horizontal positions are set. Since the two cake parts are one object displayed at the same position, you don't need a FLOCX. Use the same value, FLOX, for the horizontal position of Players 2 and 3, or... POKE 53250,FLOX:POKE 53251,FLOX. and so you also don't need the related movement calculations for FLOCX. Feel free to rename everything FLOwer related to something named like CAKE. Quote Link to comment Share on other sites More sharing options...
BoatofCar Posted March 4, 2014 Author Share Posted March 4, 2014 I've added some music! 400 L = 50 420 READ NT,TM 440 IF NT=1 THEN T=T+1:RESTORE 460 IF T=1 THEN GOTO 920 480 SOUND 0,NT,10,10 530 FOR PLAY = 1 TO (TM*L) : NEXT PLAY 620 GOTO 400 800 DATA 162,1,121,3,96,1,81,4,81,3,81,1,72,3,81,1,91,3,72,1,81,12,96,3,91,1,96,4,108,4,0,3,108,1,108,3,96,1,108,3 820 DATA 121,8 900 DATA 1,0 920 SOUND 0,0,0,0 Is there a way to get this to play at the same time the flag animates? Also, I can't get the program to move on past line 920 if I put the flag animation code in below it. Why wouldn't it just go on to line 1000 if it's like this? 400 L = 50 420 READ NT,TM 440 IF NT=1 THEN T=T+1:RESTORE 460 IF T=1 THEN GOTO 920 480 SOUND 0,NT,10,10 530 FOR PLAY = 1 TO (TM*L) : NEXT PLAY 620 GOTO 400 800 DATA 162,1,121,3,96,1,81,4,81,3,81,1,72,3,81,1,91,3,72,1,81,12,96,3,91,1,96,4,108,4,0,3,108,1,108,3,96,1,108,3 820 DATA 121,8 900 DATA 1,0 920 SOUND 0,0,0,0 1000 GRAPHICS 3 1025 SETCOLOR 0,0,15:SETCOLOR 1,3,6:SETCOLOR 3,12,6 1100 DL=PEEK(560)+(256*PEEK(561)):REM FIND THE DISPLAY LIST 1110 REM CHANGE THE OS MODE 0/ANTIC MODE 2 TEXT LINES etc. Quote Link to comment Share on other sites More sharing options...
kenjennings Posted March 4, 2014 Share Posted March 4, 2014 Is there a way to get this to play at the same time the flag animates? Also, I can't get the program to move on past line 920 if I put the flag animation code in below it. Why wouldn't it just go on to line 1000 if it's like this? In order to do both at the same time (using only BASIC) you have to arrange the code to visit both places... Check on sound,... draw one position of US flag... check on sound.... draw one position of Thai flag... check on sound... draw next position of US flag....something like that. Not sure what you mean by moving past 920.. Do you mean the program just stops running? maybe there is an error and the program stops. A possibility is that the stop/error may not be evident because the display list is modified so the text is off screen. Quote Link to comment Share on other sites More sharing options...
BoatofCar Posted March 4, 2014 Author Share Posted March 4, 2014 What do you mean by "check on"? I was thinking of GOTO statements, but with the FOR NEXT loops it seems like that would confuse the program... Quote Link to comment Share on other sites More sharing options...
kenjennings Posted March 4, 2014 Share Posted March 4, 2014 Yes. You have to reduce each action to a routine that does one thing... and then GOSUB to call them.... each routine should know its current state -- flag positions, current note, current delay for sound. each time it is called it updates state to the next state, and returns, so no for/next loop in the audio playing or the flag drawing.... . 200 Increment/decrement new flag position. 210 Draw flag. 220 RETURN 300 Calculate note duration. 310 if delay is not over THEN RETURN 320 start new sound 330 begin new duration. 340 RETURN 500 if intro is finished GOTO 9000 510 gosub 200: Rem do the flags 520 gosub 300: rem do the sound. 530 goto 500 . It's not going to be great. The flags will move much more slowly because there are extra statements being evaluated for the sound. The sound delays will need to be changed, because there are extra statements being executed for drawing the flags. There are limits to how many different things can be done at the same time in BASIC. Quote Link to comment Share on other sites More sharing options...
+therealbountybob Posted March 4, 2014 Share Posted March 4, 2014 You can always speed things up later so get it working first You're probably noticing there are about 5 ways of doing everything; this is all part of the fun: remember you can increment/decrement variables by fractions (or multiples) to effect things more slowly (or quickly) in the same loop. e.g. if your sound was in the main loop with the movement the duration could have a value set and decreased by 0.1 each time so for every 10 loops it goes down by 1... Quote Link to comment Share on other sites More sharing options...
BoatofCar Posted March 7, 2014 Author Share Posted March 7, 2014 (edited) The latest version. What is causing the green arrows and the blue heart in the text box area? 100 REM HAPPY VALENTINE'S DAY GAME/DEMO 110 GOTO 390:REM GO INIT EVERYTHING 120 REM MOVEMENT AND LOGIC 130 HISX=HISX+ST2X(STICK(0)) 140 IF HISX>200 THEN HISX=200 150 IF HISX<48 THEN HISX=48 160 HERX=HERX+ST2X(STICK(1)) 170 IF HERX>200 THEN HERX=200 180 IF HERX<48 THEN HERX=48 190 IF CAKEMV=0 AND STRIG(0)=0 THEN CAKEMV=SGN(HERX-HISX)*3:CAKEX=HISX 200 CAKEX=CAKEX+CAKEMV:IF CAKEMV=0 THEN CAKEX=0 210 IF CAKEMV<0 AND CAKEX<=HERX THEN CATCHES=CATCHES+1:CAKEMV=0:CAKEX=0 220 IF CAKEMV>0 AND CAKEX>=HERX THEN CATCHES=CATCHES+1:CAKEMV=0:CAKEX=0 230 POKE 53248,HISX:POKE 53249,HERX:POKE 53250,CAKEX:POKE 53251,CAKEX 240 POKE 77,0:IF CATCHES<1 THEN GOTO 130: REM DISABLE ATTRACT MODE, THEN LOOP 250 REM THE END 260 TARGET=HISX-6:IF TARGET<48 THEN TARGET=HISX+6 270 IF HERX=TARGET THEN GOTO 290:REM MOVING HER TO HIM 280 HERX=HERX+SGN(TARGET-HERX):POKE 53249,HERX:GOTO 270 290 POKE 756,226:REM A LAME FONT TRICK 300 ? " Happy Birthday!" 310 FOR OUT=1 TO 10 320 FOR I=48 TO 63 STEP 0.125:POKE 708,I:NEXT I 330 FOR I=63 TO 48 STEP -0.125:POKE 708,I:NEXT I 340 NEXT OUT 350 POKE 708,54 360 GOTO 360 370 REM INIT ALL THE STUFF 390 GRAPHICS 3 400 SETCOLOR 0,0,15:SETCOLOR 1,3,6:SETCOLOR 3,12,6 410 DL=PEEK(560)+(256*PEEK(561)):REM FIND THE DISPLAY LIST 420 REM CHANGE THE OS MODE 0/ANTIC MODE 2 TEXT LINES 430 REM TO OS MODE 1/ANTIC MODE 6 TEXT LINES. 440 POKE DL+25,70:POKE DL+28,6:POKE DL+29,6:POKE DL+30,6 450 REM FIND THE START OF THE "TEXT" WINDOW MEMORY IN THE DISPLAY LIST 460 SC=PEEK(DL+26)+(256*PEEK(DL+27)) 470 REM STUFF A GRAPHICS CHARACTER ACROSS THE TOP TEXT LINE 480 FOR I=0 TO 19:POKE SC+I,255:NEXT I 490 REM ANIMATE THE FLAGS 500 FOR I=0 TO 10 510 POSITION I,5:? #6;" CCCBBBBB":REM US FLAG 520 POSITION I,6:? #6;" CCCAAAAA" 530 POSITION I,7:? #6;" BBBBBBBB" 540 POSITION I,8:? #6;" AAAAAAAA" 550 POSITION I,9:? #6;" BBBBBBBB" 560 POSITION 31-I,5:? #6;"BBBBBBBB ":REM THAI FLAG 570 POSITION 31-I,6:? #6;"AAAAAAAA " 580 POSITION 31-I,7:? #6;"CCCCCCCC " 590 POSITION 31-I,8:? #6;"AAAAAAAA " 600 POSITION 31-I,9:? #6;"BBBBBBBB " 610 FOR N=1 TO 100:NEXT N 620 NEXT I 630 HISX=78:HERX=170:CAKEX=0:CAKEMV=0:CATCHES=0 640 FOR I=0 TO 27:POKE 53248+I,0:NEXT I:REM CLEAR COLORS, HPOS, ETC, IN GTIA. 680 POKE 706,248:REM CAKEX 690 POKE 705,88:REM GIRL 700 POKE 704,136:REM BOY 710 POKE 707,15:REM CAKEX 720 REM SET PM GRAPHICS 730 PMPAGE=INT((PEEK(561)/8)-1)*8 740 POKE 54279,PMPAGE 750 PMMEM=PMPAGE*256 760 P0MEM=PMMEM+512 770 P1MEM=PMMEM+640 780 P2MEM=PMMEM+768 790 P3MEM=PMMEM+896 800 FOR I=0 TO 127 810 POKE P0MEM+I,0:POKE P1MEM+I,0:POKE P2MEM+I,0:POKE P3MEM+I,0 820 NEXT I 830 POKE 53277,2:REM GTIA PLAYERS ON 840 POKE 559,42:REM ANTIC SCREEN, PLAYERS, 2 LINE P/M RESOLUTION 850 POKE 623,1:REM PRIORITY ALL P/M ON TOP 860 FOR I=0 TO 9:READ D:POKE P0MEM+86+I,D:NEXT I:REM HIM 870 DATA 24,24,0,60,90,24,0,24,24,60 880 FOR I=0 TO 9:READ D:POKE P1MEM+86+I,D:NEXT I:REM HER 890 DATA 24,24,0,60,90,24,60,126,24,60 900 FOR I=0 TO 5:READ D:POKE P2MEM+86+I,D:NEXT I:REM CAKEX 910 DATA 0,120,0,120,0,0 920 FOR I=0 TO 5:READ D:POKE P3MEM+86+I,D:NEXT I:REM CAKEX 930 DATA 48,0,252,132,0,0 940 DIM ST2X(15):REM CONVERT STICK TO MOVEMENT 950 FOR I=0 TO 15:READ D:ST2X(I)=D:NEXT I 960 DATA 0,0,0,0,0,2,2,2 970 DATA 0,-2,-2,-2,0,0,0,0 980 GOTO 130 Edited March 7, 2014 by BoatofCar Quote Link to comment Share on other sites More sharing options...
+therealbountybob Posted March 7, 2014 Share Posted March 7, 2014 This altirra paste text malarky is pretty darned cool It's the line changing to the arrow when you poke in the upper part of the chset. You need a position statement on your message to get it to the left side Your exclamation mark is showing as the "t" shaped graphic. The blue heart looks like it's to do with the message also. Manually use the graphics mode from basic (with a text window), poke the chset and then print things manually to screen to see what they show as (or write a loop to display each character in turn - though some may effect things e.g. the clear screen) Nice work btw Quote Link to comment Share on other sites More sharing options...
kenjennings Posted March 8, 2014 Share Posted March 8, 2014 The latest version. What is causing the green arrows and the blue heart in the text box area? Half the cause is this : 290 POKE 756,226:REM A LAME FONT TRICK Remember in the original version without the flags this demo was in Graphics mode 2 which is a colored text mode. The color text modes (Graphics 1 and Graphics 2) use only half the font (512 bytes and 64 characters vs 1024 bytes and 128 characters). The POKE in line 290 tells ANTIC to use the second half of the font instead of the first half. In this section of the font the heart graphic is in the same place as the blank space. So, by switching to the second half of the font all the blanks on screen become hearts which for this demo is nicely convenient. When the font switch turns the spaces into hearts, it causes another problem. The program modifies the display list instructions, so that it can use a color text mode in the text window, but the OS doesn't know that the text window is in Mode 1 instead of Mode 0. And it doesn't know about the font switch. The Atari OS is treating the text window as if it were Mode 0 text. A part of that treatment is the visible cursor that appears on the Mode 0 screen as an inverse space. In color text modes this inverse space becomes a heart (due to the font change) displayed in a different color. To turn off the cursor add: 395 POKE 752,1: REM TURN OFF CURSOR (and turn turn it back on later POKE 752,0) The graphic symbol after the "happy birthday" is also related to the font switch. Where the heart in this font is in the same place as the blank space, lower case letters are in the place of upper case letters, and graphics characters are in the place of symbols and punctuation. What BountyBob said is right. That graphic shape is in the same position in this section of the font as the exclamation point in the "normal" font. What you might consider doing is switching to the font to show the hearts on the screen ( the POKE 756,226), do the color glowing effect without printing any other text, and then switch the font back to normal ( add a POKE 756,224 ), so that you can print the text you want to show in the window (with the exclamation point). 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.