JoSch Posted June 20, 2016 Share Posted June 20, 2016 (edited) Thanks, that works. Edited June 20, 2016 by JoSch Quote Link to comment Share on other sites More sharing options...
Gury Posted June 27, 2016 Share Posted June 27, 2016 (edited) Hi, Tebe! I experimented with $R directive for including resource data to main binary file. It works well, including RCDATA for general types of data. But I have a small problem. Resource data set is mirrored to constant value in main program in a way like this: const data = $8F00; That's ok, every data in resource is linked to constant value in main program with specified memory address. Now, for my problem, which probably isn't. What I want to do is calling resource data, then declaring variable in main program without assigning it to specific memory address, but dynamically relocating resource variable to main data segment. For example, I want to do something like this (putting resource data directly to array of bytes): newData : array[0..150] of byte; // Linked directly to resource data with the same name Currently I have to do: const data = $8F00; var newData : array[0..150] of byte; . . . newData := Pointer(data); . . . Is this possible? Greetings, Gury Edited June 27, 2016 by Gury Quote Link to comment Share on other sites More sharing options...
tebe Posted June 27, 2016 Author Share Posted June 27, 2016 (edited) Mad Pascal 1.3.7, http://mads.atari8.info {$R 'text.rc'} var txt: array [0..0] of byte absolute $bc40; text.rc txt rcasm 'text.asm' text.asm dta d'Atari !' Edited July 3, 2016 by tebe 2 Quote Link to comment Share on other sites More sharing options...
Gury Posted June 28, 2016 Share Posted June 28, 2016 Thank you! I thought about previous solution with const value, which works great (I actually read array of data from resource and point it to screen memory without declaring array), but you never know, the way from this patch can be useful, too. Quote Link to comment Share on other sites More sharing options...
tebe Posted July 3, 2016 Author Share Posted July 3, 2016 (edited) Mad Pascal 1.3.8, http://mads.atari8.info - SYSTEM: RANDOM(RANGE: BYTE): BYTE; RANDOM(RANGE: INTEGER): SMALLINT; - CRT: WHEREX, WHEREY - SYSUTILS: BEEP - new unit ATARI - char invers by '*': writeln('with invers'*'without invers'); Edited July 4, 2016 by tebe Quote Link to comment Share on other sites More sharing options...
Gury Posted July 4, 2016 Share Posted July 4, 2016 I had a custom routine to do inverse text, but it is unnecessary now. I can use text and * sign in resource file with RCASM directive, but this new solution is more than practical. Feature straight from MAD assembler Mad Pascal 1.3.7, http://mads.atari8.info {$R 'text.rc'} var txt: array [0..0] of byte absolute $bc40; text.rc txt rcasm 'text.asm' text.asm dta d'Atari !' I can confirm I use this text resource file feature successfully, I just have to be careful with setting offsets to specific strings. One thing I like about this stuff is, I can make more resource files with strings for specific purposes. This also makes code more readable. Quote Link to comment Share on other sites More sharing options...
tebe Posted July 4, 2016 Author Share Posted July 4, 2016 pascal string dta b(text_length),c'text' Quote Link to comment Share on other sites More sharing options...
tebe Posted July 25, 2016 Author Share Posted July 25, 2016 Mad Pascal 1.4.0 http://mads.atari8.info 1 Quote Link to comment Share on other sites More sharing options...
Gury Posted July 27, 2016 Share Posted July 27, 2016 Great to see new version. But I run my program and something is wrong: c:\Atari\Appl\mp>mads.exe projects\titler\titler.a65 -x -i:base SYSTEM: $24B4..$2559 JOYSTICK: $255A..$2559 CRT: $255A..$25FB FASTGRAPH: $25FC..$2857 SYSUTILS: $2858..$28EF CODE: $2000..$45FE DATA: $45FF..$5116 RCDATA 'MEM0101.SCR' adr.MENU0101 0 0 0 0 0 0 0 0 ift main.ADR.MENU0101+len >= $c000 res6502.asm (221) ERROR: Undeclared label MAIN.ADR.MENU0101 (BANK=0) org main.ADR.MENU0101 res6502.asm (242) ERROR: Undeclared label MAIN.ADR.MENU0101 (BANK=0) RCDATA 'MEM0102.SCR' adr.MENU0102 0 0 0 0 0 0 0 0 ift main.ADR.MENU0102+len >= $c000 res6502.asm (221) ERROR: Undeclared label MAIN.ADR.MENU0102 (BANK=0) org main.ADR.MENU0102 res6502.asm (242) ERROR: Undeclared label MAIN.ADR.MENU0102 (BANK=0) Writing listing file... I didn't reach $c000 memory address. Are there any modifications in code for reading resource files? Greetings Quote Link to comment Share on other sites More sharing options...
tebe Posted July 27, 2016 Author Share Posted July 27, 2016 how to declare a label MENU0101, MENU0102 ? Quote Link to comment Share on other sites More sharing options...
Gury Posted July 27, 2016 Share Posted July 27, 2016 const menu0101 = 36900; menu0102 = menu0101 + 360; var functions: array [0..0] of byte absolute menu0101 + 360 + 840; {$r 'projects\titler\titler.rc'} titler.rc ******** menu0101 RCDATA 'MEM0101.SCR' menu0102 RCDATA 'MEM0102.SCR' functions RCASM 'functions.asm' I will check anyway if a problem is in my code. Quote Link to comment Share on other sites More sharing options...
kogden Posted August 2, 2016 Share Posted August 2, 2016 Is it possible to utilize extended RAM in MAD Pascal or is CLSN Pascal the only one that I can do this with? Quote Link to comment Share on other sites More sharing options...
tebe Posted August 2, 2016 Author Share Posted August 2, 2016 EXT RAM this is the plan for the future 1 Quote Link to comment Share on other sites More sharing options...
tebe Posted August 2, 2016 Author Share Posted August 2, 2016 Mad Pascal 1.4.1 http://mads.atari8.info 1 Quote Link to comment Share on other sites More sharing options...
ascrnet Posted August 3, 2016 Share Posted August 3, 2016 great work congratulations. there will be some easy to read and write disk sectors in mad pascal? regards Quote Link to comment Share on other sites More sharing options...
tebe Posted August 7, 2016 Author Share Posted August 7, 2016 there will be some easy to read and write disk sectors in mad pascal? read / write disk sectors without DOS (JSIOINT $E459) ? Quote Link to comment Share on other sites More sharing options...
tebe Posted August 7, 2016 Author Share Posted August 7, 2016 (edited) Mad Pascal 1.4.2 http://mads.atari8.info - new real (fixed-point) type SINGLE (-128.00 .. 127.0) - unit MISC: DetectCPUSpeed Edited August 7, 2016 by tebe 6 Quote Link to comment Share on other sites More sharing options...
JoSch Posted August 8, 2016 Share Posted August 8, 2016 Great work. Quote Link to comment Share on other sites More sharing options...
+Stephen Posted August 8, 2016 Share Posted August 8, 2016 Amazing progress. Quote Link to comment Share on other sites More sharing options...
ascrnet Posted August 9, 2016 Share Posted August 9, 2016 read / write disk sectors without DOS (JSIOINT $E459) ? I meant with DOS, using $E453. I'm thinking of making a small application under DOS to test the Mad Pascal. regards Quote Link to comment Share on other sites More sharing options...
tebe Posted January 5, 2017 Author Share Posted January 5, 2017 http://mads.atari8.info MadPascal 1.4.3 - SYSTEM: ReadConfig, ReadSector, WriteSector - SYSTEM: Point, Rect, Bounds, PointsEqual - DOS: CurrentMinuteOfDay, CurrentSec100OfDay, CurrentSecondOfDay, MinuteOfDay, MinutesToTime, SecondOfDay, SecondsToTime - MATH: Power, ArcTan2, InRange, EnsureRange, CycleToRad, DegNormalize, DegToGrad, DegToRad, DivMod, GradToDeg, GradToRad, RadToCycle, RadToDeg, RadToGrad - LABEL, GOTO label - {$f page} fast multiplication for types WORD, SMALLINT, SINGLE 5 Quote Link to comment Share on other sites More sharing options...
Gury Posted January 6, 2017 Share Posted January 6, 2017 Great, thanks Tebe! More and more functions added... But there is always user wish list Some of them: - extended RAM support - faster FP routines - true smart linking - ... But anyway, the system is already great. Quote Link to comment Share on other sites More sharing options...
dmsc Posted February 25, 2017 Share Posted February 25, 2017 Hi tebe! http://mads.atari8.info MadPascal 1.4.3 While porting a little (very old) game from TP7 to Mad-Pascal, I found a little bug in the generated code, probably at the optimizer. This code: program bug; var A : byte; B : boolean; begin A := 4; if A = 2 then B := False else begin if A = 3 then A := 1; B := True; end; writeln(B); end. Should write "TRUE", but the optimizer generates a "sta B" instruction, writing a "0" to "B", so the result is "FALSE". Thanks!! 1 Quote Link to comment Share on other sites More sharing options...
tebe Posted February 25, 2017 Author Share Posted February 25, 2017 (edited) thx DMSC, yes it was a bug new, fixed MP 1.4.5, http://mads.atari8.info/mp_145.7z - UNIT support clause USES - UNIT, section INTERFACE need procedure/function declaration http://wiki.freepascal.org/Unit p.s. section INITIALIZATION, FINALIZATION is not supported Edited February 25, 2017 by tebe 2 Quote Link to comment Share on other sites More sharing options...
dmsc Posted February 25, 2017 Share Posted February 25, 2017 Hi tebe!, thx DMSC, yes it was a bug new, fixed MP 1.4.5, http://mads.atari8.info/mp_145.7z - UNIT support clause USES - UNIT, section INTERFACE need procedure/function declaration http://wiki.freepascal.org/Unit p.s. section INITIALIZATION, FINALIZATION is not supported Thank you! Indeed, my ported program works now :-) 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.