News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_AMSDOS

Hisoft Pascal 4T

Started by AMSDOS, 11:33, 25 August 12

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

AMSDOS



Quote from: funkheld on 13:20, 02 September 19
Hi good afternoon.
on the dsk I have test1.pas and test2.pas
when I enter g ,, test1.pas it works.
if I then continue to enter g ,, test2.pas, test1.pas is still in memory. how do I please test1.pas from the memory, or how can I delete test1.pas in memory?




Thank you.
greeting


Yes so test1.pas needs to be deleted, at the prompt '>' type d<n,e> with 'n' being the first line number and 'e' the last line number, then 'g,,test2.pas'.


Quote from: funkheld on 16:14, 02 September 19
Hi good afternoon.
I have converted a rsx-file : testrsx in asm to a binfile: test.bin with 150 byte.
I would like to invite to & 8000.




Can one make it like this :
-----------------------------------
VAR
  Prog : ARRAY [0..151] OF integer;




PROCEDURE LoadSprite;
VAR
  loop : integer;




  BEGIN
  tin('test.bin',addr(Prog));
  FOR loop:=0 TO 150 DO
  poke(#8000+loop,prog[loop]);
  user(#8000);
  END;
------------------------------------   




Can one make it like this?
------------------------------------
PROCEDURE test();
  BEGIN
    external('testrsx');
  END;
------------------------------------




greeting


No unfortunately, because TIN is its own format Hisoft wrote in conjunction with TOUT to create files. To make matters worse it has formatting which makes it appear that it writes as a true BINary file, as it can be used to Load or Save Data. I did write a small Assembly routine here to demonstrate how the routine works though which loads a SCREEN of a certain name to the Screen Memory from BASIC.


It is possible to load a standard BINary file in Hisoft Pascal with a routine like this:




   40 TYPE name = ARRAY[1..12] OF char;

  220 PROCEDURE load(file : name; adress : integer);
  230 BEGIN
  240   rb:=chr(size(file));
  250   rhl:=addr(file);
  260   rde:=adress;
  270   user(#bc77);
  280   rhl:=adress;
  290   user(#bc83);
  300   user(#bc7a)
  310 END;



Just alter the line numbers so it fits in your source code.


To use it, set RAM-TOP Question at the Hisoft Pascal loading screen to &7FFF, change the LoadSprite Procedure to:



PROCEDURE LoadSprite;
BEGIN
   load('test    .bin',#8000);
   user(#8000)
END;



making sure test.bin is exactly 12 characters long (by filling up any space after the name with spaces, followed by the .bin). user(#8000) then activates the RSXs.


The Test PROCEDURE should work, but it doesn't need brackets after its name, brackets are only necessary if information from variables is being passed as shown with the load PROCEDURE.

Quote from: funkheld on 17:42, 02 September 19
Hi good afternoon.


with which you converted please all text files here in PAS?


Thank you.
Greeting



Unfortunately I haven't got JavaCPC, so you'll need to go into that Emulators Settings to see if it allows Printer Dumps to File. If it does, Great because that will allow you to specify a Filename to Dump the Source Code to, by using the 'Z' Print Text option at the Hisoft Pascal Command Prompt '>'. If JavaCPC hasn't got that, then unfortunately you will have to use something like FROMAMS.COM on the Pascal 80 Disk to convert the format back to ASCII, which unfortunately still won't get the file off the DSK. In Winape is an option which allows Files to be copied from DSK outside of it, which is very useful for taking ASCII Files off the DSK. Somehow I would be shocked if JavaCPC didn't have any of that because it's one of the main emulators in use.
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

funkheld

hello, thanks for the help.


greeting.

funkheld

#102
hello, good day.

is ok.

tanks.

funkheld

#103

screen 1 loop  this demo ok.


this demo no loop ,jump back to basic :
Colour Animation & screen load2


have one CPC6128.

greeting

AMSDOS

Quote from: funkheld on 10:22, 03 September 19
screen 1 loop  this demo ok.


this demo no loop ,jump back to basic :
Colour Animation & screen load2


have one CPC6128.

greeting


Colour Animation & Screen Load or AnimationTest as I called it, draws the Triangles to Screen doing some Colour Animation, it doesn't do what I was curious about, which was INK rotation during the loading of the Second Screen, but decided to publish the code on here anyway. That particular Demo won't work on any system while Hisoft Pascal is running in the background because it draws the Triangles on the main screen @ &C000, while loading the picture into the other @ &4000. So the code needs to be Translated to BINary file and executed like that, which makes this an example of how to write code in Hisoft Pascal that uses 2 Screens and using SCR SET BASE (#BC08) to do the switch.
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

funkheld


I took your original bin and started with: ANMTIN.BIN and SCREEN.DAT.


RUN"ANMTIN.BIN"


greeting

funkheld

#106

I have your original bin and started with: ANMTIN.BIN and SCREEN.DAT.

RUN"ANMTIN.BIN"

this program not ok.

greeting.


funkheld

#107

Hi good afternoon.


do you have a solution please?


greeting

funkheld

#108


Hi good afternoon.
i want to write in addr $ 4000.
then switch from $ c000 to $ 4000 so I can see the graph.
how is that possible?


Thank you.
greeting


PROGRAM LOADBASE;
{$C-}
{$L-}
   
TYPE NAME = ARRAY[1..12] OF CHAR;   


PROCEDURE LOAD(FILE : NAME; ADRESS : INTEGER);
BEGIN
   RB:=CHR(SIZE(FILE));
   RHL:=ADDR(FILE);
   RDE:=ADRESS;
   USER(#BC77);
   RHL:=ADRESS;
   USER(#BC83);
   USER(#BC7A)
END;


PROCEDURE LOADBIN;
BEGIN
   LOAD('DATEN   .BIN',#4000);
END;


PROCEDURE SCRBASE(SCR : INTEGER);
BEGIN
   RA:=CHR(SCR);
   USER(#BC08)
END;


PROCEDURE SCRWRITE(SCR : INTEGER);
BEGIN
  POKE(#B7C6,CHR(SCR))
END;


BEGIN
  SCRWRITE(#40);
   LOADBIN;
   SCRBASE(#40)
END.



AMSDOS



Quote from: funkheld on 18:35, 03 September 19
I have your original bin and started with: ANMTIN.BIN and SCREEN.DAT.


RUN"ANMTIN.BIN"


this program not ok.


greeting.




Quote from: funkheld on 21:39, 03 September 19
Hi good afternoon.




do you have a solution please?




greeting


What I created seems to be working fine in 464 and 6128 settings. Though my example is using TIN, which only works from Drive A: if a Disk is present in Drive A: and this is executed TIN will try finding SCREEN.DAT from Drive A: and if it's not present exit back to BASIC, if Disk was only present in Drive B: a Disk Missing error occurs with Retry, Ignore and Cancel option. This occurs because Hisoft Pascal Library resets at it's Initialisation stage (before program starts), nothing much I can do about that except load from Drive A:


All that code is, is some Triangles Blinking Away while SCREEN.DAT is loading, once loaded switches to the Second Screen and the program is complete with "Run (Y/N)?". If anything other than 'Y' is pressed the Computer Resets to BASIC, pressing 'Y' will run it from the Beginning (at the Flashing Triangles and load SCREEN.DAT again).

Quote from: funkheld on 08:17, 04 September 19

Hi good afternoon.
i want to write in addr $ 4000.
then switch from $ c000 to $ 4000 so I can see the graph.
how is that possible?


Thank you.
greeting


PROGRAM LOADBASE;
{$C-}
{$L-}
   
TYPE NAME = ARRAY[1..12] OF CHAR;   


PROCEDURE LOAD(FILE : NAME; ADRESS : INTEGER);
BEGIN
   RB:=CHR(SIZE(FILE));
   RHL:=ADDR(FILE);
   RDE:=ADRESS;
   USER(#BC77);
   RHL:=ADRESS;
   USER(#BC83);
   USER(#BC7A)
END;


PROCEDURE LOADBIN;
BEGIN
   LOAD('DATEN   .BIN',#4000);
END;


PROCEDURE SCRBASE(SCR : INTEGER);
BEGIN
   RA:=CHR(SCR);
   USER(#BC08)
END;


PROCEDURE SCRWRITE(SCR : INTEGER);
BEGIN
  POKE(#B7C6,CHR(SCR))
END;


BEGIN
  SCRWRITE(#40);
   LOADBIN;
   SCRBASE(#40)
END.



In your case you don't need SCRWRITE();
#B7C6 is a 6128 only address used to tell the Amstrad to write to #4000 using Conventional Printing, but your LoadBIN is already loading a Screen to #4000, so you don't need SCRWRITE(#40);
It's always good to have a MODE procedure when dealing with Screens (and INKs if you want other colours), and your example will have to be Translated straight to File in order for the program to work.


Mode Procedure Looks like this:



PROCEDURE Mode(n : integer);
BEGIN
   ra:=chr(n);
   user(#bc0e)
END;
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

funkheld

#110


How is this going to be changed for Pascal?
Thank you.
greeting

------------------------------------------------
PROCEDURE scrwrite(n : integer);
begin
  ld hl,#b7c6
  ld (hl),CHR(n)
END;
---------------------------------------------------------

AMSDOS

Quote from: funkheld on 11:07, 04 September 19

How is this going to be changed for Pascal?
Thank you.
greeting

------------------------------------------------
PROCEDURE scrwrite(n : integer);
begin
  ld hl,#b7c6
  ld (hl),CHR(n)
END;
---------------------------------------------------------


Delete the SCRWRITE Procedure and SCRWRITE(#40); within the Main Code and replace with the Mode Procedure and Mode(<screen mode>); in the Main Code.
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

funkheld


it should be visible to the screen $C000 and wants to invisibly write in $4000. then I want to switch from $C000 to $ 4000.

Thank you.
greeting

funkheld


how does the symbol and symbolafter in pascal work?

Thank you.
greeting


funkheld



hello, can you translate that into ASM source code?
Thank you.
greeting


  190 PROCEDURE DrawBlock(xpos,ypos,width : integer; height,col : char);
  200 VAR storey : integer;
  210 BEGIN
  220   inline(#DD,#7E,#03);
  230   inline(#47);
  240   inline(#DD,#7E,#02);
  250   inline(#CD,#DE,#BB);
  260   inline(#DD,#6E,#06);
  270   inline(#DD,#66,#07);
  280   inline(#DD,#74,#FB);
  290   inline(#DD,#75,#FA);
  300   inline(#C5);
  310   inline(#DD,#6E,#08);
  320   inline(#DD,#66,#09);
  330   inline(#EB);
  340   inline(#DD,#6E,#FA);
  350   inline(#DD,#66,#FB);
  360   inline(#CD,#C0,#BB);
  370   inline(#DD,#6E,#04);
  380   inline(#DD,#66,#05);
  390   inline(#EB);
  400   inline(#21,#00,#00);
  410   inline(#CD,#F9,#BB);
  420   inline(#C1);
  430   inline(#DD,#6E,#FA);
  440   inline(#DD,#66,#FB);
  450   inline(#2B);
  460   inline(#2B);
  470   inline(#DD,#75,#FA);
  480   inline(#DD,#74,#FB);
  490   inline(#10,#D1);
  500 END;

funkheld

#115
symbol and symbolafter in pascal work wonderbar.
is ok.

greeting

funkheld

#116
hello can you please create me the sourcocde for it.
Thank you.
greeting



220   inline(#DD,#7E,#03);
  230   inline(#47);
  240   inline(#DD,#7E,#02);
  250   inline(#CD,#DE,#BB);
  260   inline(#DD,#6E,#06);
  270   inline(#DD,#66,#07);
  280   inline(#DD,#74,#FB);
  290   inline(#DD,#75,#FA);
  300   inline(#C5);
  310   inline(#DD,#6E,#08);
  320   inline(#DD,#66,#09);
  330   inline(#EB);
  340   inline(#DD,#6E,#FA);
  350   inline(#DD,#66,#FB);
  360   inline(#CD,#C0,#BB);
  370   inline(#DD,#6E,#04);
  380   inline(#DD,#66,#05);
  390   inline(#EB);
  400   inline(#21,#00,#00);
  410   inline(#CD,#F9,#BB);
  420   inline(#C1);
  430   inline(#DD,#6E,#FA);
  440   inline(#DD,#66,#FB);
  450   inline(#2B);
  460   inline(#2B);
  470   inline(#DD,#75,#FA);
  480   inline(#DD,#74,#FB);
  490   inline(#10,#D1);




robcfg

Asking several times will actually make people ignore your request.


Now, for the next time you need something like this, follow these steps:


1) Open a hex editor like HxD on Windows or 0xED on Mac and create a new file.
2) Type all the values so you create a binary file and save it.
3) Run a Z80 disassembler (like Unidasm, or any other you fancy) on the resulting file.


And here is the code:
00: dd 7e 03  ld   a,(ix+$03)
03: 47        ld   b,a
04: dd 7e 02  ld   a,(ix+$02)
07: cd de bb  call $BBDE
0a: dd 6e 06  ld   l,(ix+$06)
0d: dd 66 07  ld   h,(ix+$07)
10: dd 74 fb  ld   (ix-$05),h
13: dd 75 fa  ld   (ix-$06),l
16: c5        push bc
17: dd 6e 08  ld   l,(ix+$08)
1a: dd 66 09  ld   h,(ix+$09)
1d: eb        ex   de,hl
1e: dd 6e fa  ld   l,(ix-$06)
21: dd 66 fb  ld   h,(ix-$05)
24: cd c0 bb  call $BBC0
27: dd 6e 04  ld   l,(ix+$04)
2a: dd 66 05  ld   h,(ix+$05)
2d: eb        ex   de,hl
2e: 21 00 00  ld   hl,$0000
31: cd f9 bb  call $BBF9
34: c1        pop  bc
35: dd 6e fa  ld   l,(ix-$06)
38: dd 66 fb  ld   h,(ix-$05)
3b: 2b        dec  hl
3c: 2b        dec  hl
3d: dd 75 fa  ld   (ix-$06),l
40: dd 74 fb  ld   (ix-$05),h
43: 10 d1     djnz $0016

funkheld

hello thanks.


greeting
:) :) :)

funkheld

#119

Hi good afternoon.

I load and save with amsdos-load-save.
working wonderfully, can ascii and am data load-saven.

Thank you
greeting

load:

PROGRAM LOAD;
{$C-}
{$L-}


TYPE NAME = ARRAY[1..12] OF CHAR;   


VAR j    : integer;
    Loop : Boolean;


PROCEDURE LOAD(FILE : NAME; ADRESS : INTEGER);
BEGIN
   RB:=CHR(SIZE(FILE));
   RHL:=ADDR(FILE);
   RDE:=ADRESS;
   USER(#BC77);
   RHL:=ADRESS;
   USER(#BC83);
   USER(#BC7A)
END;


BEGIN
   LOAD('DATEN   .BIN',#C000)
END.


save:

PROGRAM save;
{$C-}
{$L-}


TYPE NAME = ARRAY[1..12] OF CHAR;   


VAR j     : integer;
    Loop  : Boolean;
      loopo : integer;


PROCEDURE SAVE(FILE : NAME; ADRESS , LANG , BIN : INTEGER);
BEGIN
   RB:=CHR(SIZE(FILE));
   RHL:=ADDR(FILE);
   RDE:=ADRESS;
   USER(#BC8C);
   RHL:=ADRESS;
   RDE:=LANG;
   RBC:=#0000;
   RA:=CHR(BIN);
   USER(#BC98);
   USER(#BC8F)
END;


PROCEDURE move(x,y : integer);
BEGIN
   rde:=x;
   rhl:=y;
   user(#bbc0);
END;


PROCEDURE draw(x,y : integer);
BEGIN
   rde:=x;
   rhl:=y;
   user(#bbf6);
END;


PROCEDURE mode(a : char);
BEGIN
   ra:=a;
   user(#bc0e);
END;


FUNCTION degtorad(val : integer) : real;
VAR num1 : real;
BEGIN
   num1:=3.14159/180;
   degtorad:=num1*val;
END;


BEGIN
   mode(chr(1));
   loopo:=0;
   REPEAT
      move(320,200);
      draw(round(320+190*cos(degtorad(loopo))),round(200+190*sin(degtorad(loopo))));
      loopo:=loopo+1;
   UNTIL loopo=361;
   SAVE('DATEN   .BIN',#C000,#4000,#0002)
END.

funkheld

#120

Hi good afternoon.
I understood that with the inline now as well.
I did not know how the data would be recorded.
Thank you. I wrote a program in purebasic which makes an asm an inline.

Thank you
greeting

for mi little demo plot.asm:

ld l,(ix+$02)
ld h,(ix+$03)
ld e,(ix+$04)
ld d,(ix+$05)
call $BBEA
     


PROGRAM plot;
{$C-}
{$L-}


PROCEDURE plot(x,y : integer);
BEGIN
  inline( #DD ,#6E ,#2 ,#DD ,#66 ,#3 ,#DD ,#5E ,#4 ,#DD);
  inline( #56 ,#5 ,#CD ,#EA ,#BB  );
END;


PROCEDURE mode(a : char);
BEGIN
   ra:=a;
   user(#bc0e);
END;


PROCEDURE grapen(col : integer);
BEGIN
   ra:=chr(col);
   user(#bbde);
END;


BEGIN
  mode(chr(2));
   grapen(1);
   plot(620,350)
END.

funkheld


Hi good afternoon.

how can you please prevent this after saving a file:
t,, test.bin
the compiler will not leave?

Thank you.
greeting

funkheld

#122

Hi good afternoon.

when I compile your program:

PROGRAM MemoryTest;

then the error message comes:
No more Text


gruss

funkheld

#123

Hi good afternoon.


you load the 4 pictures after $4000 and push them with OUT... in the upper memory area. then you bring the pictures with OUT....to $4000 and then copy them to $c000. why is this program at $a500 and not in your main program?

Thank you.
greeting

funkheld

#124

Hi good afternoon.
Now I have finally understood this with the RSX.
have in the RSX 2 plot to practice.
The hisoft pascal 4t is a great thing.

Thank you.
greeting


Pascal-RSX :

PROGRAM RSX;
{$C-}
{$L-}


TYPE NAME = ARRAY[1..12] OF CHAR;   


VAR x,y : integer;
   
PROCEDURE LOAD(FILE : NAME; ADRESS : INTEGER);
BEGIN
   RB:=CHR(SIZE(FILE));
   RHL:=ADDR(FILE);
   RDE:=ADRESS;
   USER(#BC77);
   RHL:=ADRESS;
   USER(#BC83);
   USER(#BC7A)
END;


PROCEDURE mode(a : char);
BEGIN
   ra:=a;
   user(#bc0e);
END;


PROCEDURE grapen(col : integer);
BEGIN
   ra:=chr(col);
   user(#bbde);
END;


BEGIN
   LOAD('RSPLOT  .BIN',#8000);
   USER(#8000);
   mode(chr(2));
   grapen(1);
   x:=100;
   y:=100;
   external('PLOT1',x,y);
   x:=200;
   y:=200;
   external('PLOT2',x,y)
END.



create a bin : rsx:

         nolist
        org #8000


        LD      HL,BufferRsx
        LD      BC,PtrRsx
        JP      #BCD1


PtrRsx:
        DW      RSX_TABLE
        JP      plot1
        JP      plot2


RSX_TABLE:
        DB      "PLOT","1"+#80
        DB      "PLOT","2"+#80


plot1:
        ld l,(ix+$04)
ld h,(ix+$05)
        ld e,(ix+$02)
ld d,(ix+$03)
call #BBEA
        RET


plot2:
        ld l,(ix+$04)
ld h,(ix+$05)
        ld e,(ix+$02)
ld d,(ix+$03)
call #BBEA
        RET
       
BufferRsx:
        DS      4


Powered by SMFPacks Menu Editor Mod