Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.sys.apple2.programmer > #5341 > unrolled thread
| Started by | Paul MacMillan <paul.s.macmillan@gmail.com> |
|---|---|
| First post | 2019-12-27 15:05 -0800 |
| Last post | 2019-12-31 05:52 -0800 |
| Articles | 7 — 6 participants |
Back to article view | Back to comp.sys.apple2.programmer
Text windows in Apple Pascal? Paul MacMillan <paul.s.macmillan@gmail.com> - 2019-12-27 15:05 -0800
Re: Text windows in Apple Pascal? Fred Smith <fred@thejanitor.corp> - 2019-12-28 01:08 +0000
Re: Text windows in Apple Pascal? Paul MacMillan <paul.s.macmillan@gmail.com> - 2019-12-27 18:51 -0800
Re: Text windows in Apple Pascal? David Schmenk <dschmenk@gmail.com> - 2019-12-27 20:02 -0800
Text windows in Apple Pascal? gids.rs@sasktel.net - 2019-12-27 20:33 -0800
Re: Text windows in Apple Pascal? awanderin <awanderin@gmail.com> - 2019-12-27 23:17 -0700
Re: Text windows in Apple Pascal? Marco Verpelli <mverpelli@libero.it> - 2019-12-31 05:52 -0800
| From | Paul MacMillan <paul.s.macmillan@gmail.com> |
|---|---|
| Date | 2019-12-27 15:05 -0800 |
| Subject | Text windows in Apple Pascal? |
| Message-ID | <ab50e9e8-7f7a-4617-82b2-977a1e0b5a45@googlegroups.com> |
Hi, is there an easy way to get text window functionality in Apple Pascal, similar to POKE 32 (etc.) in Applesoft? I tried POKEing but the builtin WRITE/WRITELN seems to not care what I have poked. I am not adverse to a little assembly language (especially with the very capable Apple Pascal Assembler) but don't want to re-invent the wheel if its already available. Thanks, Paul
[toc] | [next] | [standalone]
| From | Fred Smith <fred@thejanitor.corp> |
|---|---|
| Date | 2019-12-28 01:08 +0000 |
| Message-ID | <qu69va$1l5j$1@gioia.aioe.org> |
| In reply to | #5341 |
On 2019-12-27, Paul MacMillan <paul.s.macmillan@gmail.com> wrote:
> Hi, is there an easy way to get text window functionality in Apple Pascal, similar to POKE
> 32 (etc.) in Applesoft? I tried POKEing but the builtin WRITE/WRITELN seems to not care
> what I have poked. I am not adverse to a little assembly language (especially with the
> very capable Apple Pascal Assembler) but don't want to re-invent the wheel if its already
> available.
>
> Thanks,
> Paul
Never tried, but I seem to recall that the low addresses are used for pascal
interpreter variables (for speed), so "text window" functionality may simply not exist.
You can write peek and poke in Apple Pascal using variant records.
type
byte = 0..255;
membyte = packed array [0..0] of byte;
location = record case boolean of
true : (addr : integer);
false : (ptr : ^membyte)
end;
procedure poke(address : integer;
value : byte);
var
loc : location;
begin
loc.addr := address;
loc.ptr^[0] := value
end;
function peek(address : integer) : byte;
var
loc : location;
begin
loc.addr := address;
peek := loc.ptr^[0]
end;
Try to get a copy of Randall Hyde's "p-Source" book to learn about Apple Pascal
internals, there used to be a copy floating around on the net.
[toc] | [prev] | [next] | [standalone]
| From | Paul MacMillan <paul.s.macmillan@gmail.com> |
|---|---|
| Date | 2019-12-27 18:51 -0800 |
| Message-ID | <7808c2b6-be65-413a-9d77-8c9faf7a47ec@googlegroups.com> |
| In reply to | #5342 |
On Friday, December 27, 2019 at 5:09:01 PM UTC-8, Fred Smith wrote: > On 2019-12-27, Paul MacMillan <paul.s.macmillan@gmail.com> wrote: > > Hi, is there an easy way to get text window functionality in Apple Pascal, similar to POKE > > 32 (etc.) in Applesoft? I tried POKEing but the builtin WRITE/WRITELN seems to not care > > what I have poked. I am not adverse to a little assembly language (especially with the > > very capable Apple Pascal Assembler) but don't want to re-invent the wheel if its already > > available. > > > > Thanks, > > Paul > > Never tried, but I seem to recall that the low addresses are used for pascal > interpreter variables (for speed), so "text window" functionality may simply not exist. > You can write peek and poke in Apple Pascal using variant records. > > type > byte = 0..255; > membyte = packed array [0..0] of byte; > location = record case boolean of > true : (addr : integer); > false : (ptr : ^membyte) > end; > > procedure poke(address : integer; > value : byte); > var > loc : location; > begin > loc.addr := address; > loc.ptr^[0] := value > end; > > function peek(address : integer) : byte; > var > loc : location; > begin > loc.addr := address; > peek := loc.ptr^[0] > end; > > > Try to get a copy of Randall Hyde's "p-Source" book to learn about Apple Pascal > internals, there used to be a copy floating around on the net. Thanks, Fred, that's exactly right, I used code just like that to do the POKE's but it had no effect (which came as no surprise but I checked anyway).
[toc] | [prev] | [next] | [standalone]
| From | David Schmenk <dschmenk@gmail.com> |
|---|---|
| Date | 2019-12-27 20:02 -0800 |
| Message-ID | <2b748d17-aec9-46c4-b9f9-ffd93efaaaec@googlegroups.com> |
| In reply to | #5341 |
On Friday, 27 December 2019 15:05:09 UTC-8, Paul MacMillan wrote: > Hi, is there an easy way to get text window functionality in Apple Pascal, similar to POKE 32 (etc.) in Applesoft? I tried POKEing but the builtin WRITE/WRITELN seems to not care what I have poked. I am not adverse to a little assembly language (especially with the very capable Apple Pascal Assembler) but don't want to re-invent the wheel if its already available. > > Thanks, > Paul Apple Pascal uses a terminal style approach to character I/O. There is even a utility to set the terminal characteristics for things such as gotoxy and screen clear. Similar to dealing with an 80 column card in a ][+ and typing "PR#3". If you have a memory mapped screen like the 40 column screen or a //e 80 column mode, you can always write directly into the screen memory.
[toc] | [prev] | [next] | [standalone]
| From | gids.rs@sasktel.net |
|---|---|
| Date | 2019-12-27 20:33 -0800 |
| Message-ID | <02f90b76-db9c-4fa3-ab27-e7158bb989fd@googlegroups.com> |
| In reply to | #5341 |
Shouldnt be too hard to create a function that keeps track of the horizontal and vertical positions of the cursor, then if needed, print spaces from the left to get to the htab position.
[toc] | [prev] | [next] | [standalone]
| From | awanderin <awanderin@gmail.com> |
|---|---|
| Date | 2019-12-27 23:17 -0700 |
| Message-ID | <yub36d5t1n7.fsf@gmail.com> |
| In reply to | #5341 |
Paul MacMillan <paul.s.macmillan@gmail.com> writes:
> Hi, is there an easy way to get text window functionality in Apple
> Pascal, similar to POKE 32 (etc.) in Applesoft? I tried POKEing but
> the builtin WRITE/WRITELN seems to not care what I have poked. I am
> not adverse to a little assembly language (especially with the very
> capable Apple Pascal Assembler) but don't want to re-invent the wheel
> if its already available.
>
> Thanks,
> Paul
The Apple Pascal Language Reference Manual describes a gotoxy(x, y)
function that positions the text cursor at the chosen column (x) and row
(y) position.
There are no facilities that I know of to control the text-window within
Pascal. The output functions do support a bunch of control characters,
as described in the Apple IIe Technical Reference Manual, page 68-69:
ctrl hex use
---- --- ----
E 05 turn on cursor display
F 06 turn off cursor display
G 07 sound bell (beep)
H 08 move cursor left one column, wraps around to end of
previous line
J 0a move cursor down one row, scrolls if required
K 0b clear from cursor position to end of screen
L 0c clear screen and put cursor at top left
M 0d move cursor to leftmost position
N 0e set normal video
O 0f set inverse video
V 16 scroll display down one line, cursor stays where it is
W 17 scroll display up one line, cursor stays where it is
Y 19 move cursor to upper-left of screen without clearing
Z 1a clear line the cursor is on
\ 1c move cursor one space to right, wraps around to next line below
] 1d clear from cursor to end of line
^ 1e GOTOxy; initiates GOTOxy sequence; next two characters
printed are x+32 and y+32, respectively
_ 1f move cursor up one line if not at top of screen
--
--
Jerry awanderin at gmail dot com
[toc] | [prev] | [next] | [standalone]
| From | Marco Verpelli <mverpelli@libero.it> |
|---|---|
| Date | 2019-12-31 05:52 -0800 |
| Message-ID | <8d640fae-0b7c-4abf-b003-e129ecf8025f@googlegroups.com> |
| In reply to | #5341 |
On Saturday, December 28, 2019 at 12:05:09 AM UTC+1, Paul MacMillan wrote: > Hi, is there an easy way to get text window functionality in Apple Pascal, similar to POKE 32 (etc.) in Applesoft? I tried POKEing but the builtin WRITE/WRITELN seems to not care what I have poked. I am not adverse to a little assembly language (especially with the very capable Apple Pascal Assembler) but don't want to re-invent the wheel if its already available. > > Thanks, > Paul I wouldn't call it simple but there is a complete system (mouse, menu, windows) and it's called Mouse Text Toolkit Marco
[toc] | [prev] | [standalone]
Back to top | Article view | comp.sys.apple2.programmer
csiph-web