Оберон-клуб «ВЄДАsoft»
https://zx.oberon.org/forum/

Did I break it?
https://zx.oberon.org/forum/viewtopic.php?f=10&t=120
Страница 1 из 1

Автор:  slenkar [ 16 июн 2013, 00:45 ]
Заголовок сообщения:  Did I break it?

hi trying to print chars all over the screen:

MODULE hi;
IMPORT B := Basic;
PROCEDURE Main* ;
VAR
x,y:INTEGER;
gameboard:ARRAY 32,24 OF SHORTINT;
BEGIN B.Init;

gameboard[0][0]:=1;
gameboard[31][23]:=1;
gameboard[14][14]:=1;

B.BORDER(B.Green);
B.PAPER(B.Black);
B.CLS;


FOR x:= 0 TO 31 BY 1 DO
FOR y:= 0 TO 23 BY 1 DO
B.AT(y,x);
IF gameboard[x][y]=1 THEN
B.PRSTR("y");
ELSE
B.PRSTR("n");
END;
END;
END;

B.PAUSE(B.WaitAKey);
B.Quit;

END Main;

END hi.



it only prints chars on the left side

uif you reverse the x and y coords it prints as you would expect

Автор:  slenkar [ 16 июн 2013, 00:50 ]
Заголовок сообщения:  Re: Did I break it?

Oh I just realized that the spectrum screen is 24 chars high
but BASIC can only access 0-21

Автор:  Zorko [ 16 июн 2013, 18:07 ]
Заголовок сообщения:  Re: Did I break it?

slenkar писал(а):
if you reverse the x and y coords it prints as you would expect
Y first and X second is a ZX-Basic tradition that I adhere into my module "Basic".

In the module Console will be procedure At(x, y), of course.

slenkar писал(а):
Oh I just realized that the spectrum screen is 24 chars high
but BASIC can only access 0-21
Look into the module configurator Obj/BasicCfg.h:
Код: "C"
/* Use ROM output (RST 10H, slow, 32x22) or CUSTOM (fast, 32x24) */
 
#define ROM_OUTPUT

You need to comment this line:
Код: "C"
// #define ROM_OUTPUT
Make sure that SDCC found this configurator first, but not any other (for example, not "ZXDev/Lib/Obj/BasicCfg.h").

Страница 1 из 1 Часовой пояс: UTC + 2 часа
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/