funkheld Posted July 28, 2015 Share Posted July 28, 2015 (edited) hello, you'll find a description of all commands for "Mad Pascal"? greeting Edited July 28, 2015 by funkheld Quote Link to comment Share on other sites More sharing options...
tebe Posted July 28, 2015 Author Share Posted July 28, 2015 (edited) hello tebe. what this: ??? fpc -Mtp filename.pas greeting Free Pascal Compiler http://www.freepascal.org/ -Mtp Turbo Pascal p.s. http://www.freepascal.org/docs-html/ Edited July 28, 2015 by tebe Quote Link to comment Share on other sites More sharing options...
funkheld Posted July 28, 2015 Share Posted July 28, 2015 hello, thanks. greeting. Quote Link to comment Share on other sites More sharing options...
funkheld Posted July 28, 2015 Share Posted July 28, 2015 hello, why print byte or word in Mad Pascal? z:= 123; Print z....? h:=45678; Print h; greeting Quote Link to comment Share on other sites More sharing options...
tebe Posted July 29, 2015 Author Share Posted July 29, 2015 http://www.freepascal.org/docs-html/rtl/system/write.html http://www.freepascal.org/docs-html/rtl/system/writeln.html write(z); writeln(z,' / ',h); // with EOL (End Of Line) write[ln] (arg0, arg1, arg2 [,argX] ) Quote Link to comment Share on other sites More sharing options...
funkheld Posted July 29, 2015 Share Posted July 29, 2015 Hi, Thank You. One question all run these commands with the "MAD Pascal": http://www.freepascal.org/docs-html/rtl/system/index-8.html ??? Thank You. Quote Link to comment Share on other sites More sharing options...
funkheld Posted July 29, 2015 Share Posted July 29, 2015 Hello, thanks. the not print: numc:=-27234; this print 38302 ??? greeting. var numb : byte; numw : word; numc : cardinal; numr : real; begin ClrScr; TextColor(15); numb:=134; numw:=54678; numc:=-27234; numr:=123.345; GotoXY(1,1); write(numb); GotoXY(1,3); write(numw); GotoXY(1,5); write(numc); GotoXY(1,7); write(numr); repeat until keypressed; end. Quote Link to comment Share on other sites More sharing options...
Gury Posted July 29, 2015 Share Posted July 29, 2015 Gury, pmgdemo.pas // Draw player 0 // Vertical position of player 0 Move(@p0Data, pointer(pmgMem+512+py0), max+1); @ address p.s. pmgMem = $BC00, screen mem = $BC40 -> garbage Thank, Tebe. That's what bothered me Quote Link to comment Share on other sites More sharing options...
tebe Posted July 29, 2015 Author Share Posted July 29, 2015 (edited) Hi, Thank You. One question all run these commands with the "MAD Pascal": http://www.freepascal.org/docs-html/rtl/system/index-8.html ??? Thank You. Predefined: SIZEOF WRITE WRITELN INC DEC CHR ORD ASM IF ELSE THEN FOR TO DO WHILE DO REPEAT UNTIL DIV OR AND XOR SHR SHL CRT.PAS TextMode TextBackground TextColor Delay Keypressed ClrScr GotoXY WhereX WhereY GRAPH.PAS InitGraph SetBkColor SetColor PutPixel MoveTo LineTo Line FloodFill (not working) Circle MATH.PAS Round Trunc Frac IntToReal SYSTEM.PAS Poke DPoke Peek DPeek Random Fillchar Move Edited July 30, 2015 by tebe Quote Link to comment Share on other sites More sharing options...
tebe Posted July 29, 2015 Author Share Posted July 29, 2015 (edited) Hello, thanks. the not print: numc:=-27234; this print 38302 ??? greeting. BYTE (0..255) WORD( 0..65535) CARDINAL (0..4294967295) REAL (-8388607..8388607) if you want test SIGN if (a and $80<>0) then MINUS // for BYTE if (a and $8000<>0) then MINUS // for WORD if (a and $800000 <> 0) then MINUS // for CARDINAL Edited July 29, 2015 by tebe Quote Link to comment Share on other sites More sharing options...
funkheld Posted July 29, 2015 Share Posted July 29, 2015 hello, thanks you. so there is not a whole number as a minus? only real with minus ? greeting Quote Link to comment Share on other sites More sharing options...
funkheld Posted July 29, 2015 Share Posted July 29, 2015 Hello, i'm looking for a small demo for MAD Pascal with the command "ASM". Greeting Quote Link to comment Share on other sites More sharing options...
tebe Posted July 29, 2015 Author Share Posted July 29, 2015 (edited) save register X (@sp defined variable) asm { stx @sp ldx @sp }; p.s. more examples 'test.pas' compile with crt.pas, math.pas, graph.pas, system.pas test.zip Edited July 29, 2015 by tebe Quote Link to comment Share on other sites More sharing options...
funkheld Posted July 29, 2015 Share Posted July 29, 2015 (edited) Hello thanks. greeting. Edited July 29, 2015 by funkheld Quote Link to comment Share on other sites More sharing options...
funkheld Posted July 29, 2015 Share Posted July 29, 2015 Hello thanks for the help. Now my only file routines missing with GET and PUT to read and write bytes on the ATR with MAD Pascal. thank you Quote Link to comment Share on other sites More sharing options...
funkheld Posted July 29, 2015 Share Posted July 29, 2015 (edited) Hello, ASM ist wonderfull mit MAD Pascal. procedure scrasm; begin asm { lda #35 sta $bc40 lda #36 sta $bc41 lda #37 sta $bc42 }; end; begin ClrScr; scrasm; repeat until keypressed; end. Edited July 29, 2015 by funkheld Quote Link to comment Share on other sites More sharing options...
JamesD Posted July 29, 2015 Share Posted July 29, 2015 Hello, ASM ist wonderfull mit MAD Pascal. procedure scrasm; begin asm { lda #35 sta $bc40 lda #36 sta $bc41 lda #37 sta $bc42 }; end; begin ClrScr; scrasm; repeat until keypressed; end. Don't you need to preserve the previous content of A in that assembly? Quote Link to comment Share on other sites More sharing options...
ascrnet Posted July 29, 2015 Share Posted July 29, 2015 fpc -Mtp filename.pas // Show colors // AsCrNet uses crt; var num : byte; begin ClrScr; TextColor(15); repeat num := Random(255); TextBackground(num); GotoXY(14,9); write('Show colors'); Delay(900); until keypressed; end. run application on PC and XE/XL I had not thought of making it compatible with PC, thanks for example. but I thought that in the future, having more typical of ATARI features like these players and missiles, display list, array handling, handling of controls such as joystick, light pen, etc ... easy to use, I can think of something like library for PM: uses PM; CreatePM (pm); ColorPM (pm, color); MovePM (x, y, pm); CollisionPM (pm); regards Quote Link to comment Share on other sites More sharing options...
tebe Posted July 29, 2015 Author Share Posted July 29, 2015 (edited) only regX is important, it's used for stack (STACKORIGIN, STACKWIDTH) in asm full access for local, global variables, constants (by their names) RESULT is predefined variable for FUNCTION function add(a,b: byte): word; begin asm { lda a clc adc b sta Result lda #0 adc #0 sta Result+1 }; end; begin writeln( add(150,200) ); end; Edited July 29, 2015 by tebe Quote Link to comment Share on other sites More sharing options...
a8isa1 Posted July 29, 2015 Share Posted July 29, 2015 (edited) I'm having difficulties compiling PasIntro. Mp105 completes OK and generates PasIntro.a65. However, Mads assembler complains about these instructions within PasIntro.a65. bne @- bne @+ I compiled PasIntro via linux (32-bit system)/wine and I've tried Mads Assember version 1.9.4 and 1.9.8. -SteveS p.s Same issues with Gury's PMG demos. p.p.s. I forgot to provide the error message from Mads assembler. bne @+ pasintro.a65 (389) ERROR: Unexpected end of line Edited July 29, 2015 by a8isa1 Quote Link to comment Share on other sites More sharing options...
tebe Posted July 29, 2015 Author Share Posted July 29, 2015 this feature @+, @- is from mads 1.9.5, bug fixed 1.9.6 http://mads.atari8.info or compile newest mads_2.0.0.zip Quote Link to comment Share on other sites More sharing options...
a8isa1 Posted July 29, 2015 Share Posted July 29, 2015 this feature @+, @- is from mads 1.9.5, bug fixed 1.9.6 http://mads.atari8.info or compile newest I was invoking the wrong .EXE. Sorry! Thanks for the updated version! Quote Link to comment Share on other sites More sharing options...
funkheld Posted July 29, 2015 Share Posted July 29, 2015 Hello, why is : lda #0 adc #0 thanks Quote Link to comment Share on other sites More sharing options...
tebe Posted July 29, 2015 Author Share Posted July 29, 2015 try without a is BYTE b is BYTE but Result ? Quote Link to comment Share on other sites More sharing options...
funkheld Posted July 29, 2015 Share Posted July 29, 2015 hello, I have brought the pm of Stargunner in my dplist. the dplist starts at $ 9060 the pm at $ A800. to get screen mem = $ BC40 not in crash. the demo is the from my MIST. greeting const _max = 7; _speed = 40; var dlist: array [0..110] of byte; dl_idx: word; screen: word; p0Data : array [0.._max] of byte; px0 : byte; py0 : byte; pmgMem : Word; i : Byte; procedure DLByte(a: byte); begin Poke(dl_idx, a); inc(dl_idx); end; procedure DLWord(a: word); begin DPoke(dl_idx, a); inc(dl_idx, 2); end; procedure InitDlist(a: word); begin DLByte($70); DLByte($70); DLByte($70); DLByte($4d); DLWord(36960); DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d); DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d); DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d); DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d); DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d); DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d); DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d); DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d); DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d); DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d);DLByte($0d); DLByte($41); DLWord(a); end; begin dl_idx:= word(@dlist); InitDlist(word(@dlist)); InitGraph(7); DPoke(560,word(@dlist)); DPoke($58,36960); Poke(709, 64); Poke(710, 122); Poke(712, 130); Poke(752, 1); SetColor(1); MoveTo(0,0); LineTo(159,95); SetColor(2); MoveTo(159,0); LineTo(0,95); SetColor(3); Circle(80,50,45); // Initialize P/M graphics Poke(53277, 0); Poke(54279, 168); pmgMem := 168 * 256; Poke(559, 46); px0 := 120; py0 := 60; p0Data[0] := 48; p0Data[1] := 120; p0Data[2] := 252; p0Data[3] := 48; p0Data[4] := 48; p0Data[5] := 48; p0Data[6] := 48; p0Data[7] := 48; // Clear player 0 memory fillchar(pointer(pmgMem+512), 128, 0); // Vertical position of player 0 for i := 0 to _max do begin Poke(pmgMem+512+py0+i, p0Data[i]); end; Poke(53277,3); // Turn on P/M graphics Poke(53256,0); // Size of player 0 (normal size) Poke(704,44); // Player 0 color Poke(53248,px0); // Horizontal position of player 0 repeat // Move player 0 left if Peek(632)=11 then begin Dec(px0); if px0 < 45 then px0 := 45; Poke(53248,px0); Delay(_speed); // Move player 0 right end else if Peek(632)=7 then begin Inc(px0); if px0 > 203 then px0 := 203; Poke(53248,px0); Delay(_speed); // Move player 0 up end else if Peek(632)=14 then begin Dec(py0); if py0 < 16 then py0 := 16; Poke(pmgMem+512+py0-1, 0); Poke(pmgMem+512+py0+_max+1, 0); for i := 0 to _max do begin Poke(pmgMem+512+py0+i, p0Data[i]); end; Delay(_speed-; // Move player 0 down end else if Peek(632)=13 then begin Inc(py0); if py0 > 97+8 then py0 := 97+8; Poke(pmgMem+512+py0-1, 0); Poke(pmgMem+512+py0+_max+1, 0); for i := 0 to _max do begin Poke(pmgMem+512+py0+i, p0Data[i]); end; Delay(_speed-; end; until keypressed; InitGraph(0); Poke(53277, 0); end. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.