Jump to content
IGNORED

Mad Pascal


Recommended Posts

On 8/15/2022 at 6:26 PM, bocianu said:

long awaited volatile and inline !

What is the purpose of the volatile modifier? Tell the compiler the the variable will be modfied outside of the compiler's control?

Link to comment
Share on other sites

10 hours ago, JAC! said:

What is the purpose of the volatile modifier? Tell the compiler the the variable will be modfied outside of the compiler's control?

Yup. Like reading random register.

Without it, when you read it couple times in a row, optimization algorithm would optimize it, and you get just one value.

 

 

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

  • 2 weeks later...
Link to comment
Share on other sites

  • 2 weeks later...

I prepared a program in MadPascal which is able to render unicode texts encoded in UTF-8 format.

 

 

The program uses unifont glyphs available on https://unifoundry.com/unifont/

As an example there was used "Article 1 of the Universal Declaration of Human Rights" translated into multiple languages.

The source codes of the program are available on my gitlab: https://gitlab.com/amarok8bit/unicode

 

Program is relative simple because the main goal was just to check how unicode content might be rendered on Atari 8-bit computer. Nothing special, I suppose...

 

Edit: I attached atr file containing above program and texts.

unicode.atr

Edited by amarok
  • Like 8
Link to comment
Share on other sites

new unit VBXEANSI

https://github.com/tebe6502/Mad-Pascal/blob/master/lib/vbxeansi.pas

 

samples

https://github.com/tebe6502/Mad-Pascal/tree/master/samples/a8/graph_vbxe_ansi

 

DISPANSI.OBX (max 100 files *.ANS in directory)

 

Press W - scroll UP

Press S - scroll Down

Press SPACE - next file

Press ESC - exit program

 

p.s.

thanks to Joseph Zatarski

 

dispansi.atr

dispansi.png

Edited by tebe
  • Like 5
Link to comment
Share on other sites

16 hours ago, tebe said:

new unit VBXEANSI

https://github.com/tebe6502/Mad-Pascal/blob/master/lib/vbxeansi.pas

 

samples

https://github.com/tebe6502/Mad-Pascal/tree/master/samples/a8/graph_vbxe_ansi

 

DISPANSI.OBX (max 100 files *.ANS in directory)

 

Press W - scroll UP

Press S - scroll Down

Press SPACE - next file

Press ESC - exit program

 

Awesome!  I started working on something similar but trying to code in straight assembly really makes it difficult!  Definitely interested in viewing the source for this.

Link to comment
Share on other sites

1 hour ago, Stephen said:

Awesome!  I started working on something similar but trying to code in straight assembly really makes it difficult!  Definitely interested in viewing the source for this.

A clearer approach to the subject of ANSI decoding

 

https://anotherdroidbbs.wordpress.com/2019/05/12/free-pascan-ansi-viewer/
 

dispansi.pas

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 2 weeks later...

unit DISPANSI remove, unit VBXE merged with ANSI (code rewritten, VBXE on $d600 ; $d700)

 

simplified VBXE support, CRT (40 columns + color map), ANSI (80 columns), added page scroll for both modes

 

DISPANSI.ATR (Sparta DOS X disk), DISPANSI.EXE runs slideshow all *.ANS files

or from the command line

 

X VANSI.EXE FILENAME.ANS

 

ansi.png

ansi_test.obx ansi_test.pas crt_colors.obx crt_colors.pas crt_colors_C64.prg crt_test.obx crt_test.pas crt_vbxe_detect.obx crt_vbxe_detect.pas DISPANSI.ATR dispansi.obx dispansi.pas IBMPC.FNT vbxe_ansi.obx vbxe_ansi.pas vbxe_ansi.rc

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

  • 3 weeks later...

Hi @tebe,

 

I'm having a problem in current revisions of mp from your github:

 

--

XIO(40,1,0,0,'D:OVERLAY.XEX');     // put overlay routines into XMS (which then starts city)

--

gives a compile error:

Mad Pascal Compiler version 1.6.6 [2022/11/19] for 6502
Compiling U_Loader.Pas
U_Loader.Pas (1520,23) Error: Incompatible types: got STRING expected "^BYTE"

--

 

the last version i got that works is "Mad Pascal Compiler version 1.6.6 [2022/10/16] "

 

is that some error in the current branch or do i have to address the file parameter different now - and if, how?

 

Link to comment
Share on other sites

13 hours ago, Atlan_Roland said:

I'm having a problem in current revisions of mp from your github:

 

--

XIO(40,1,0,0,'D:OVERLAY.XEX');     // put overlay routines into XMS (which then starts city)

--

gives a compile error:

Mad Pascal Compiler version 1.6.6 [2022/11/19] for 6502
Compiling U_Loader.Pas
U_Loader.Pas (1520,23) Error: Incompatible types: got STRING expected "^BYTE"

https://github.com/tebe6502/Mad-Pascal/blob/master/lib/cio.pas

 

PByte -> PString

  • Thanks 1
Link to comment
Share on other sites

  • 3 weeks later...

I've released the sources for my latest production at Silly Venture, which by some miracle took first place in the INTRO 16K category.

 

ac23inv.xex

 

Maybe the source will be useful to someone:

https://gitlab.com/bocianu/atasciicompo3

 

Of particular note is the unique scripting language for describing the presentation itself, which was created for this production. It makes use of the MADS assembler macros:

https://gitlab.com/bocianu/atasciicompo3/-/blob/main/script.asm

 

 

 

  • Like 6
  • Thanks 1
Link to comment
Share on other sites

11 hours ago, bocianu said:

I've released the sources for my latest production at Silly Venture, which by some miracle took first place in the INTRO 16K category.

No miracle, but obvious hard work on your side. I also like it the most, because it was different, consistent and very entertaining. A good example that MAD Pascal is good and fast enough to do demos with it. And the usage of macros for the scriping is something (I've also done in the past for ISO / VCS demos) that demos how flexible the combination of MADS & MP is.

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

  • 1 month later...

Question about the usage of accessing extended memory with a custom VBI

 

I'm using Mad Pascals TMemoryStream for accessing extended memory quite intensively

 

This all works very fine, up until i have a custom VBI installed too:

When i don't turn off the VBI before a TMemoryStream  read/write, the program will eventually crash, sooner or later.

(even if its just an empty VBI routine, like in the example code)

 

How would i be able to have a custom VBI running while accessing the extended memory with TMemoryStream?

 

var 
	xms:	TMemoryStream; 
	tb:		array [0..0] of byte
[..]
procedure vbl; interrupt;
begin
	asm
		; for example a VBI that doesn't do anything.
		jmp xitvbv		
	end;
end;

begin
	SetIntVec(iVBL, @vbl);

[..] ..in a main loop i got this xms.Readbuffer command, that works great without a VBI, but otherwise breaks randomly

  	xms.position:=XMS_TILESTORE2 +  word(i * 192) + byte(random(4)*48);  	 
	//nmien:=128;				// if I don't turn off the VBI before the read, it will sooner or later crash.
	xms.ReadBuffer(tb,48);	// get new animation frame from xms
	//nmien:=128+64;			//VBI back on 
[..]

 

 

 

 

 

 

 

 

Link to comment
Share on other sites

thank you very much!  i forgot about the VBL routine (which just JSRs to code already off the banking area) itself that was still compiled by MP to a region that got banked out.

 

I solved it now like this:

 

created a resource file with the VBL code (which is just a JSR),

that I include in my pascal source and assign it to an addr. off the $4000..$7FFF area.

 

vbl.asm:

		;jsr QuickMusic_VBI
		jsr $0980+$20+$0F
		jmp xitvbv

 

vbl.rc:

MYVBL	RCASM	'C:\jac\wudsn\Workspace\Ultima\Resources\vbl.asm'

 

 

[..]
{$r 'vbl.rc'}

const
MYVBL=$2000;    // put the VBL outside the banking area


SetIntVec(iVBL, pointer(MYVBL));

 

 

thank also to @Zolaerla for pointing me in the right direction!

 

Edited by Atlan_Roland
Link to comment
Share on other sites

  • 2 months later...

testing the dev branch:

following example works in stable branch; not anymore in 1.6.7:

 

type
    tNPC =    record	// record needs to be in a certain order, as functions also access values directy with direct peek/pokes. 	
		person: byte;
		ai:	byte;	
		covered_tile: byte;
		x,y,z: byte;
		to_x,to_y,to_z:	byte;
		path_idx: byte; // 255: finished path | 128: recalculate path
		tilt: byte; // tilt counter
		dialog:	byte; 
		knows_avatar: byte; // met avatar before? additional info: is_dead()? =255?
    end;

var
	 npc		: array [0..31] of ^tNPC	absolute NPC_ARRAY;	// 64 byte; pointer to NPC objects
	
	
[..]


for i:=0 to 30 do
 	npc[i].knows_avatar:=0;

 

--> 

Mad Pascal Compiler version 1.6.7 [2023/04/04] for 6502
Compiling CITY.PAS
inc/npc_procedures.pas (184,10) Error: Assignments to formal parameters and open arrays are not possible

 

 

Question:

Is it by design that access to a structure like above won't be possible anymore?

 

 


 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...