Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - fatman2021

Pages: [1]
1
QB64 Discussion / Re: QB64 coding challenge
« on: July 27, 2017, 09:28:47 pm »
Video of the AMOS Mad Robot Program:

2
QB64 Discussion / Re: QB64 coding challenge
« on: July 27, 2017, 07:38:51 pm »
The challange is to rewrite the program using existing QB64 commands/functions.

3
QB64 Discussion / Re: QB64 coding challenge
« on: July 27, 2017, 01:50:04 pm »
Information on the TD command can be found on pages 10,17,35,67,69-108 of the Amos 3D User Guide:
https://archive.org/details/amos-3d-manual

5
QB64 Discussion / Re: QB64 on Android
« on: July 26, 2017, 09:38:11 am »
In theory you should be able to compile and run the SDL version of QB64 directly on most Android devices using GNURoot(https://play.google.com/store/apps/details?id=champion.gnuroot&hl=en)

6
QB64 Discussion / Re: QB64 coding challenge
« on: July 26, 2017, 09:22:53 am »
thinking in general
AICU  Amos = oldBasic  16bit plus libraries to direct access to hardware
IMHO to develop this kind of libraries can lead to 2 issues
 1. some hardware resources in the modern OSes are usable through OSes's functions.... see how now if you use INT 33h in DOS is OK in Windows 7 or over is going to find troubles...
2.  PC (desktop + notebook) have so many different hardwares plugged into.... let to  think about CPU, GPU, Soundcard, Wifi component.... and then there are different OSes running  (Windowses,  FreeDos, Unix/Linux universe, Mac universe....)
but if it is possible to  use  interface libraries like that of JavaMachine or SDL or GL to get results like AMOS Basic....

XAMOS( https://sourceforge.net/projects/xamos/) uses SDL and jAMOS(https://sourceforge.net/projects/javaamos/?source=directory) uses JavaMachine, and you can use GL directly in your QB64 programs. So it can definitely be done.

7
QB64 Discussion / QB64 coding challenge
« on: July 25, 2017, 06:20:23 pm »
Rewrite the following program in QB64:

Code: QB64: [Select]
  1. '
  2. '              The Mad Robot Demo
  3. '
  4. '                By Nick Harper
  5. '
  6. ' (c) Copyright Europress / VooDoo Software  1991
  7. '
  8. '
  9. '
  10. Curs Off: Flash Off
  11. Screen Open 0,320,200,16,Lowres
  12. Cls 0
  13. Td Screen Height 200
  14. Td Dir "amsopro_system:AMOS_3d_demos:/objects"
  15. Td Load "torso"
  16. Td Load "leg"
  17. Td Load "arm"
  18. Td Load "head"
  19. Td Load "stool"
  20. Td Load "animcube"
  21. Fade 1 : Wait 20
  22. Td Object 1,"torso",0,900,5000,0,0,0
  23. Td Object 2,"leg",-200,700,5000,0,0,0
  24. Td Object 3,"leg",200,700,5000,0,0,0
  25. Td Object 4,"arm",-300,1200,5000,0,0,-5000
  26. Td Object 5,"arm",330,1350,5000,0,0,0
  27. Td Object 6,"Head",0,1400,5000,0,0,0
  28. Td Object 7,"stool",1000,-300,4500,0,0,0
  29. Td Object 8,"stool",-700,-300,6500,0,0,0
  30. Td Move 0,1500,1000,500
  31. Td Face 0,1
  32. Double Buffer : Autoback 0
  33. Td Cls
  34. Td Redraw
  35. Hide On
  36. Fade 1,$F38,$FFF,,,,,,,$FB9,$7F,$F,$BF,$A00,$500
  37. HEAD=160
  38. LLEG=200 : LLEGS=0
  39. RLEG=-250 : RLEGS=1
  40. USX-150 : USZ=150
  41. BOUNCE=200
  42. Set Rainbow 0,0,250,"(15,1,2)","(6,1,2)","(9,1,2)"
  43. Rainbow 0,0,156,94
  44. BODY=0 : BODYI=1
  45.   Td Face 0,1
  46.   Gosub SHIFTEM
  47.   Td Cls
  48.   Td Redraw
  49.   Wait Vbl
  50.   Gosub LEFT_ARM
  51.   Gosub RIGHT_ARM
  52.   Gosub LEFT_LEG
  53.   Gosub RIGHT_LEG
  54.   Gosub HEAD
  55.   Gosub BODY
  56.   If BNC=1 Then Gosub BOUNCES
  57. HEAD:
  58. Td Move Rel 6,0,HEAD,0
  59. Td Angle Rel 6,0,0,1927
  60. HEAD=HEAD-20
  61. If HEAD>-260 Then Return
  62. HEAD=160
  63. ANG=Td Attitude C(6)
  64. If Abs(ANG)<2000 Then Angle 6,0,0,0
  65. LEFT_ARM:
  66. Td Angle Rel 5,0,2000,0
  67. Td Anim Rel 5,4,0,HEAD,0,1
  68. Td Move Rel 5,0,-HEAD,0
  69. RIGHT_ARM:
  70. Td Angle Rel 4,3854,0,0
  71. ANG=Td Attitude C(4)
  72. If Abs(ANG)<2000 Then Td Angle 4,0,0,0
  73. LEFT_LEG:
  74. If LEGS=0 Then Td Move Rel 3,0,LLEG,0
  75. If LEGS=0 Then Td Anim Rel 3,4,0,-LLEG,0,1
  76. If LLEG=-250 and LLEGS=1 Then BNC=1 : Boom
  77. If LLEG=-250 Then Inc LLEGS
  78. IF LLEGS=9 Then LLEGS=0 : LLEG=200
  79. RIGHT_LEG:
  80. If RLEGS=0 Then Td Move Rel 2,0,RLEG,0
  81. If RLEGS=0 Then Id Anim Rel 2,4,0,-RLEG,0,1
  82. If RLEGS=0 Then RLEG=RLEG-50
  83. If RLEG=250 and RLEGS=1 BNC=1 : Boom
  84. If RLEGS=9 Then RLEGS=0 : RLEG=200
  85. SHIFTEM:
  86. Td Move Rel 0,USX,0,USZ
  87. if Td Position X(0)-Td Position X(1)>4000 Then Add USX,-10
  88. If Td Position X(1)-Td Position X(0)>4000 Then Add USX,10
  89. If Td Position Z(0)-Td Position Z(1)>4000 Then Add USZ,-10
  90. If Td Position Z(1)-Td Position Z(0)>4000 Then Add USZ,10
  91. BOUNCES:
  92. Td Move Rel,7,0,BOUNCE,0
  93. Td Move Rel,8,0,BOUNCE,0
  94. Add BOUNCE,-100
  95. If BOUNCE=-300 Then BOUNCE=200 : BNC=0
  96. BODY:
  97. Td Surface "animcube",0,BODY To 1,0,0,2
  98. Add BODY,BODYI
  99. If BODY=3 Then BODYI=-1
  100. if BODY=0 Then BODYI=1


8
QB64 Discussion / Re: Hi folks...
« on: July 25, 2017, 11:22:46 am »
First I used Applesoft BASIC followed by Commodore 64 BASIC, GW-BASIC and BASICA. After that was QBASIC 1.1, QuickC, QuickBASIC 4.5, Visual Basic for DOS, and Turbo Pascal. Then Debug and DJGPP until Windows stopped supporting DOS programs. Next was GNU C/C++,  QB64, GForth, OpenCOBOL, GFortran, Common Lisp,  R, in addition to many programming languages that most people have never heard of.

9
QB64 Discussion / Re: QB64 Enhancements
« on: July 23, 2017, 10:38:49 pm »
EXAMPLES:


BASIC:

Code: QB64: [Select]
  1. 100 PRINT "DANPED HARMONIC OSCILLATOR"
  2. 101 PRINT
  3. 110 LET T = 0
  4. 120 LET X = 1
  5. 130 LET V = 0
  6. 132 LET C = .5
  7. 140 LET D = .01
  8. 141 LET P = .1 - D
  9. 142 PRINT "DAMPING CO/1ST. ="; C
  10. 143 PRINT "TIME STEP ="; D
  11. 144 PRINT "INITIAL X ="; X
  12. 145 PRINT "INITIAL V ="; V
  13. 146 PRINT
  14. 147 PRINT " T                   X"
  15. 148 PRINT "------------------------"
  16. 150 LET X = X + V * D
  17. 160 LET V = V - (X + C * V) * D
  18. 170 LET T = T + D
  19. 171 IF T <= P THEN 150
  20. 180 PRINT T; X
  21. 181 LET P = P + .1
  22. 190 IF T < 3 THEN 150
  23. 200 END
  24.  

FORTRAN II
Code: QB64: [Select]
  1.  
  2.    WRITE(6,20)
  3.    WRITE(6,30)
  4.    T=0.
  5.    X=1.
  6.    V=0.
  7.    D=.01
  8.    P=.1-D
  9.    C=.5
  10.    WRITE(6,40)X,V,C
  11.    WRITE(6,50)D,P
  12.    WRITE(6,60)
  13. 10 X=X+V*D
  14.    V=V-(X+C*V)*D
  15.    T=T+D
  16.    IF(T-P)10,10,12
  17. 12 WRITE(6,70)T,X
  18.    P=P+.1
  19.    IF(T-3.)10,10,16
  20. 16 STOP
  21. 20 FORMAT(17H1           DAMPED)
  22. 30 FORMAT(24H      HARMONIC OSCILLATOR,//)
  23. 40 FORMAT(5H    X=,F4.1,4H  V=,F4.1,4H  C=,F5.3)
  24. 50 FORMAT(8H       D=,F5.2,4H  P=,F5.2,//)
  25. 60 FORMAT(22H          T           X)
  26. 70 FORMAT(F10.2,F12.4)
  27.  

JOSS
Code: QB64: [Select]
  1.  
  2. OSCILLATOR: PROCEDURE OPTIONS (MAIN);
  3.             T = 0; X = 1; V = 0; D = .01;
  4.             P = .1 - D;
  5.             C = .5;
  6.             PUT PAGE LIST (' DAMPED OSCILLATOR ');
  7.             PUT SKIP DATA (C, D, X, V);
  8.             PUT SKIP;
  9.             PUT SKIP LIST ('TIME     POSITION');
  10.             PUT SKIP LIST ( (20) '-' );
  11.    CALCULATE:  X = X + V*D; V = V -  (X + C*V )*D; T = T + D;
  12.                IF T<=P THEN GO TO CALCULATE;
  13.                P = P + .1;
  14.                PUT EDIT (T, X) (SKIP, F(5,2), X(5), F(10,6) );
  15.                IF T<3 THEN GO TO CALCULATE;
  16. END OSCILLATOR;
  17.  

Algol 60
Code: QB64: [Select]
  1.  
  2. FIRSTFIVEHUNDREDPRIMES: begin;
  3.     integer J, K, N, Q, R;
  4.     integer array PRIME[1 : 500];
  5.     P1: PRIME[1] := 2;
  6.     N := 3;
  7.     J := 1;
  8.     P2: J := J + 1;
  9.     PRIME[J] := N;
  10.     P3: if J = 500 then goto P9;
  11.     P4: N := N + 2;
  12.     P5: K := 2;
  13.     P6: Q := N mod PRIME[K];
  14.     R := N - Q TIMES PRIME[K];
  15.     if R = 0 then goto P4;
  16.     P7: if Q NOTLESS PRIME[K] then goto P2;
  17.     P8: K := K + 1;
  18.     goto P6;
  19.     P9: OUTSTRING(1, "First Five Hundred Primes\n");
  20.     for J := 1 step 1 until 50 do
  21.       begin;
  22.         for K := 1 step 1 until 10 do
  23.           begin;
  24.             integer P;
  25.             P := PRIME[J + 50 TIMES (K - 1)];
  26.             if P < 1000 then OUTCHAR(1, "0", 1);
  27.             if P < 100 then OUTCHAR(1, "0", 1);
  28.             if P < 10 then OUTCHAR(1, "0", 1);
  29.             OUTINTEGER(1, P);
  30.         end K;
  31.         OUTSTRING(1, "\n");
  32.     end J;
  33. end ;
  34.  

10
QB64 Discussion / QB64 Enhancements
« on: July 23, 2017, 07:53:37 pm »
BASIC was originally based off of ALGOL 60, FORTRAN II, JOSS. Any enhancements should be more in this direction, IMHO.

ERIC ED029516: Introductory Computer-Based Mechanics; A One Week Sample Course:
https://archive.org/details/ERIC_ED029516

honeywell :: ddp-24 :: DDP-24 FORTRAN II
https://archive.org/details/bitsavers_honeywelld_5501760

A Primer Of Algol 60 Programming
https://archive.org/details/in.ernet.dli.2015.141149

11
QB64 Discussion / Proposed Enhancements To QB64
« on: July 21, 2017, 03:07:16 pm »
Think of your monitor as a glass window, through which you can view whatever QB64 displays on its own "screen".
The screen would be used to show QB64 images is not the same as your monitor, because an QB64 screen should be able
to be changed in many different ways, while the glass window of the monitor remains firmly fixed.

Whenever an QB64 program is run, a screen area should be automatically set up to display the results of that
program. This would be known as the "default" screen, and it forms the standard display area that would be used for all
normal drawing operations. The default screen should be given the identity number zero. The screen zero would be 640 pixels
wide, 400 pixels high and and would display 16 different colors.

Apart from the default screen, we should be able to set up seven more screens in a QB64 program, and each of these
new screens should be given an identity number from 1 to 7. When a new screen is set up, it would be "opened", and
when this is done, its individual width, height, number of colors and pixel size would also be defined.

Although the default screen would be 640 pixels wide, you would be able to double this to 1280 pixels across the screen.
When the screen is 640 pixels wide it would be in low resolution, or "Lowres", for short. If this is changed to 1280
pixels wide, the screen would be in high resolution, known as "Hires".

SCREEN OPEN (open a new screen)

Syntax: Screen Open number,width,height,colors,pixMde

To open a new screen give the SCREEN OPEN command, followed by these parameters:

Number - the identification number of the new screen, ranging from 0 to 7. If a screen with this number already
         exists, it would be completely replaced by this new screen.

Width  - sets up the number of pixels that will make up the width of the new screen. There would be no problem
         in opening a screen that is wider than the physical limit of the monitor, and extra-wide screens would
         be manipulated by the SCREEN OFFSET command. The widest possible screen would be 5120 pixels across, from
         zero to 5119

Height - holds the number of pixels that make up the height of the screen. Like the width parameter, this can be larger
         than the visible screen height to a maximum of 2880 pixels, and scrolled into view. Screens with oversized
         widths and heights can be used with all of the normal screen techniques.

Colors - sets the number of colors to be used for the new screen. The choice for this number is normally 2,4,8,
         16,256, 16-bit, 24-bit, or 32-bit. There are three special screens that can make use of 32 or 64 colors with
         Extra Half Bright mode screens, and 4096 colors Hold And Modify mode screens.

pixMde - is a choice of the width of the pixel points on the screen. Lowres is the normal status, allowing 640 pixels to
         be displayed across the screen, at any one time. Hires halves the width of each pixel, and so allows 1280 to
         be displayed.

LOWRES (set screen mode to 640 pixels wide)

Code: QB64: [Select]
  1. Screen Open number,width,height,colors,Lowres
  2.  

HIRES (set screen mode to 1280 pixels wide)

Code: QB64: [Select]
  1. Screen Open number,width,height,colors,Hires
  2.  

When the default screen is automatically opened, screen 0 would be the equivalent to the following setting:

Code: QB64: [Select]
  1. Screen Open 0,640,480,16,Lowres
  2.  

To open screen number 1 as an oversize high-resolution screen with eight colors, you would use the following:

Code: QB64: [Select]
  1. Screen Open 1,1280,1080,4096,Hires
  2.  

This the following routine would opens all eight available screens and brings them into view:

Code: QB64: [Select]
  1. Curs Off : Cls 13: Paper 13
  2. Print : Center "Hello, I'm SCREEN 0"
  3. For S=1 To 7
  4. Screen Open S,320,20,16,Lowres
  5. Curs Off : Cls S+2 : Paper S+2
  6. Center "And I am SCREEN"+Str$(S)
  7. Screen Display S,,50+S*25,,8
  8.  

SCREEN CLOSE (erase a screen)

Syntax: Screen Close number

The SCREEN CLOSE command would be used to erase a screen and free the memory it was using for other programming
needs. Simply specify the screen number to be deleted.

DEFAULT (re-set to the default screen)

The DEFAULT instruction would closes all currently opened screens and restores the display back to the original
default setting.

AUTO VIEW ON
AUTO VIEW OFF

The Auto View instructions would toggle viewing mode on and off.

The SCREEN OPEN could be used to create a new screen, the screen would usually be displayed at once. This may be
inconvenient during the initialisation stages of a program, in which case the AUTO VIEW OFF command would be
used to disable this automatic display system. Screens would then be updated at a convenient point, using the VIEW
instruction. To re-activate the automatic screen updating system, you would use the AUTO VIEW ON command.

VIEW (display current screen setting)

When the AUTO VIEW OFF instruction is engaged, VIEW could be used to display any changes that have been made
to the current screen settings, and they would be displayed at the next vertical blank period following the VIEW
command.

Once a screen has been opened, it would be positioned and moved anywhere on the monitor. This means that screens
would be made to bounce, slip, slide, flip over, sink out of sight and behave in all sorts of bizarre ways. This
would also means that screens could overlap or be displayed above one another, and so several different screen modes
would be shown at once in separate areas of the display.

SCREEN DISPLAY (position a screen)

Syntax1: Screen Display number
Syntax2: Screen Display number,x,y, width,height

To position a screen, the SCREEN DISPLAY command would be used, followed by these parameters:

Number - refers to the number of the screen to be displayed, from 0 to 7. All or any of the other parameters could be
         omitted, but the relevant commas must be included.

x,y    - coordinates would given as "hardware" coordinates, which refer to physical positions on the monitor, not the
         area that would be used by QB64 screens. These set the position from which your QB64 screen  displayed on
         the monitor.

X coordinates would range from 0 to 448, and they would be automatically rounded down to the nearest 16-pixel boundary.
Only the positions from 112 to 432 would actually visible on the monitor, so avoid using an x-coordinate below 112.

Y coordinates would range between 0 and 312, but because every monitor displays a slightly different visible area, it
would be sensible to keep the range between 30 and 300. A small amount of experimenting will reveal what suits your own
system.

Width  - would set the width of the screen in pixels. If this is different from the original setting, only a part of the
         image would be shown, starting from the top left-hand corner of the screen. It would also be rounded down to the
         nearest 16 pixels.

Height - would be used to set the height of the screen in exactly the same way as the width. If any of the optional
         parameters are left out, the default settings will be applied automatically.

Setting up Screens For example, to display screen zero, keeping its original width and height, this line would be used:

Code: QB64: [Select]
  1. Screen Display 0,112,40,,
  2.  

Only one screen at a time would be shown on each horizontal line of the display, but several screens would be placed on
top of one another. If screens are placed next to each other, in other words if they are sewn together to make a
continuous display, there would be one line of pixels where of the screens meet that becomes "dead".

One way of getting over this dead zone is to create an extra-large screen that is bigger than the monitor display, and
then move the visible area around inside its boundaries. When using extra-large screens, the area to be viewed is set
with the SCREEN OFFSET command.

SCREEN OFFSET(offset screen at hardware coordinates)

Syntax: Screen Offset number,x,y

The SCREEN OFFSET command would be followed by the number of the screen to be displayed, then the x,y-coordinates
of the "offset", which would point to where the top left-hand corner of the visible display would to start, measured from
the top left-hand corner of the extra-large screen.

The visible area would be Moved around the extra-large screen by changing the offset coordinates, and some very
smooth scrolling effects would be achieved. These would be used for background graphics in computer games, as well as
more serious applications like route finders or star constellations.

SCREEN CLONE(clone a screen)

Syntax: Screen Clone number

To create an identical copy of the current screen, and assign this new "clone" with a new screen number, the SCREEN CLONE
command would be used followed by the destination screen number. Here is an example of a multi-cloned screen:

Code: QB64: [Select]
  1. Screen Open 0,320,20,4,Lowres
  2. Flash Off
  3. Screen Display 0,,70,,
  4. For S=1 To 7
  5. Screen Clone S
  6. Screen Display S,,S*20+70,,
  7. Print "Start typing";
  8. If A$<>"" Then Print A$;
  9.  

Screen cloning is an ideal technique for two-player computer games, with each player controlling half of the visible
display area. The clone would uses the same memory area as the original screen, and would be displayed at the same place
as the original. Any of the usual screen operations would be used with the clone, such as SCREEN DISPLAY and SCREEN OFFSET.

However, because there would be only one copy of the original screen data in memory, it woudl impossible to use the SCREEN
command with the cloned copy.

DUAL PLAYFIELD(combine two screens)

Syntax: Dual Playfield first screen,second screen

The DUAL PLAYFIELD mode would be the equivalent of mixing together two images from separate video cameras, and would be
achieved by displaying two screens simultaneously at the same x,y- coordinates. Each of the two screens would be
manipulated completely independently from one other, and this can be exploited to produce very smooth parallax
scrolling. Because the sizes of the two screens can be different, a smaller screen would be scrolled against a larger
background screen, creating the parallax effect.

The colors of these screens would be taken from the palette of the first screen with color zero being treated as
transparent. The first screen would makes use of half of the available colors, while the second screen would be the other
half of the available colors. When you are drawing to the second screen, QB64 would automatically convert the color
index to the appropriate number before using it. This would means that colors of the first half of the second screen's
palette would use the second half of the first screen's palette, in ascending order. Always make the first screen the
current screen when changing the color settings.

Remember that the automatic conversion process would not apply to assignment statements such as COLOR or
PALETTE.

When using SCREEN OFFSET to position a dual playfield screen, always specify the first screen, and never set
screen offsets for both dual playfield screens to zero.

DUAL PRIORITY(reverse order of dual playfield screens)

Syntax: Dual Priority first screen, second screen

Normally, the first screen of a dual playfield would be displayed directly over the second screen. To reverse this order,
so that the second screen appears in front of the first, you would use the DUAL PRIORITY command. Please note that this
instruction would only changes the order of display, and would have no effect on the screen organisation at all, so that the
first screen in the parameter list would still be used for all color assignments, and with the SCREEN DISPLAY command.

Screens would be removed from view by permanently erasing them, or by hiding them away for later display.

CLS(clear current screen)

Syntax1: Cls
Syntax2: Cls color number
Syntax3: Cls color number,x1,y1 To x2,y2

The CLS command would erases all or part of the current screen. Used on its own, the contents of the current screen would
be deleted and replaced by the current color. Any windows that may have been set up would also be cleared in this
way.

By specifying the index number of a particular color after the CLS command, the clearing operation would be carried
out using that color. A rectangular part of the current screen could also be cleared, leaving the rest of the screen intact.
This would be achieved by adding the coordinates of the block to be filed with the specified color, from the top left-hand
corner, to the bottom right. For example:

Code: QB64: [Select]
  1. Cls: Circle 100,98,98: Cls 0,50,50 To 150,150
  2.  

SCREEN HIDE(hide a screen)

Syntax1: Screen Hide
Syntax2: Screen Hide number

SCREEN SHOW(show a screen)

Syntax1: Screen Show
Syntax2: Screen Show number

You would use the SCREEN HIDE command to remove the current screen from view. It would then be restored using a SCREEN
SHOW instruction, like this:

Code: QB64: [Select]
  1. Cls : Print "I am the Current Screen" : Wait 100
  2. Screen Hide : Wait Key
  3. Screen Show
  4.  

Any screen would be temporarily hidden, by including its index number after the SCREEN HIDE instruction. This
screen would be revealed with a similar request to SCREEN SHOW, followed by the relevant screen number.

Because screens may be of different sizes, and because they can be displayed at various positions on the monitor by
offsets and overlaps, and because there can be up to eight electronic screens queuing up one behind the other, a
method is needed to bring any one of these screens to the front of the display.

SCREEN TO FRONT(move screen to front of display)

Syntax1: Screen To Front
Syntax2: Screen To Front number

You would use the SCREEN TO FRONT to move the selected screen to the front of the display queue. If the screen number
is omitted after the command, then the current screen would be brought to the front.

SCREEN TO BACK(move screen to back of display)

Syntax1: Screen To Back
Syntax2: Screen To Back number

This command is used to move a screen to the background of the display. If another screen is already there, it will
be displayed in front of the chosen screen. Again, if the screen number is omitted after a SCREEN TO BACK
command, the current screen will be relegated to the back of the display queue:

Code: QB64: [Select]
  1. Center "Hello again, Screen 0 here"
  2. Wait 100
  3. Screen Open 1,320,200,2,Lowres
  4. Center "Excuse me, make way for Screen 1"
  5. Wait 100 : Screen To Front 0
  6. Wait 100 : Screen To Back
  7.  

SCREEN (set current screen)

Syntax: Screen number

This command when used with the Open command would allow all graphical and text operations to be directed to the
selected screen number:

Code: QB64: [Select]
  1. Screen Open 2,320,32,16,Lowres
  2. Screen Display 2,,130,,
  3. Plot 0,0: Draw To 320,200
  4.  

If the chosen screen is outside of the current display area or is hidden, there would be no visible effect. However, any
graphics would be drawn in memory, waiting to be displayed whenever this screen comes into view, or out of hiding
after a Screen Show command.

Defining screen colours
DEFAULT PALETTE (define standard palette)

Syntax: Default Palette &H1....&H1000

It may be necessary to open several screens using the same palette. To simplify this process, the DEFAULT
PALETTE instruction would be used to define a standard palette which would be used by all subsequent screens created by
the SCREEN OPEN command. Colors are set using the RGB(A). Up to 4096 colors may be defined, depending on the screen mode,
and any colors that are not re-set must have their appropriate commas in place. Here is an example line for eight color
screens:

Code: QB64: [Select]
  1. Default Palette &H000,&H111,&HA69,,,,,&HFFF
  2.  

GET PALETTE(copy palette from a screen)

Syntax1: Get Palette number
Syntax2: Get Palette number,mask

This command would copy the colors from a specified screen, and loads them into the current screen. This would be useful
when data is being moved from one screen to another with a SCREEN COPY command, and the same color settings need to be
shared for both screens. An optional mask sould be added after the screen number, allowing only selected colors to be
loaded.

Note: This proposal is based off contents form the AMOS Professional manual. On Dec. 01 201201 at the Pianeta Amiga 2012, Pietro Ghizzoni, current owner of AMOS Pro sources after Francois Lionet ceased development, agreed to release the source code to AMOS Professional as Public Domain https://web.archive.org/web/20130530022407/http://www.pianetaamiga.it.  The source code for AMOS Professional can be downloaded at https://github.com/marc365/AMOSProfessional. The AMOS Professional manual can be downloaded at https://archive.org/details/amos-pro-compiler-manual. jAMOS is a AMOS BASIC reimplementation in Java and can be downloaded at https://sourceforge.net/projects/javaamos/ jAMOS.jar and it's source code can be used as a proof of concept.

Pages: [1]