gz0000 Posted May 27, 2023 Share Posted May 27, 2023 On 5/20/2023 at 2:53 AM, danwinslow said: Ah. Ok, thanks. The guy asking about it seemed to have some expectation of it working that way, so I kind of thought it was supposed to. Maybe it's kind of a language hole, and only works in variants that MadPascal is not implementing. Yes, I assumed that local variables are initialized every time you call a function, but it seems local variables in (Mad) Pascal act more like static local variables in C language. I like Mad Pascal. It makes me more productive. 4 1 Quote Link to comment https://forums.atariage.com/topic/240919-mad-pascal/page/33/#findComment-5260944 Share on other sites More sharing options...
tebe Posted August 16, 2023 Author Share Posted August 16, 2023 v1.6.8 https://github.com/tebe6502/Mad-Pascal https://github.com/tebe6502/Mad-Pascal/blob/master/samples/tests/tests-record/recordtest.pas recordtest.zip 1 3 Quote Link to comment https://forums.atariage.com/topic/240919-mad-pascal/page/33/#findComment-5299742 Share on other sites More sharing options...
Atlan_Roland Posted August 17, 2023 Share Posted August 17, 2023 (edited) Hi Tebe, thank you very much for the compiler update! Woke me up to restart some A8 coding after summer break Recompiling my project with 1.6.8 gave me an error with "mod", which did not happen under 1.6.6. It looks like a 'mod 16' (or 2,4,8,..) produces a 'jsr #$00' . line 1288: textline[13]:=chr(33+w1 mod 16); --> RTLIB: $22AB..$29D3 jsr #$00 BRIT.a65 (12562) ERROR: Illegal addressing mode (CPU 6502) The corresponding code in .a65 @ line 12562: ; optimize OK (BRIT.PAS), line = 1288 lda GLOBALS.W1 and #$0F jsr #$00 lda #$21 add @BYTE.MOD.RESULT sta adr.TEXTLINE+$0D for context: [..] 'u' : begin // Use sextant textline:='Use-sextant'~; write_text; if night < 50 then begin xms_textline(103); // Only xms_textline(105); // at night! end else begin xms_textline(101); // Position: Y"y' X"x' w1:=byte(my*16)+ay_m; w2:=byte(mx*16)+ax_m; textline[11]:=chr(33+w1 div 16); textline[13]:=chr(33+w1 mod 16); //rogi@2023.08.17: new compiler error?? textline[16]:=chr(33+w2 div 16); //textline[18]:=chr(33+w2 mod 16); rogi@2023.08.17: new compiler error?? end; end; [..] Edited August 17, 2023 by Atlan_Roland Quote Link to comment https://forums.atariage.com/topic/240919-mad-pascal/page/33/#findComment-5300070 Share on other sites More sharing options...
tebe Posted August 17, 2023 Author Share Posted August 17, 2023 3 hours ago, Atlan_Roland said: jsr #$00 BRIT.a65 (12562) ERROR: Illegal addressing mode (CPU 6502) fixed 2 Quote Link to comment https://forums.atariage.com/topic/240919-mad-pascal/page/33/#findComment-5300187 Share on other sites More sharing options...
tebe Posted August 19, 2023 Author Share Posted August 19, 2023 (edited) Mad Pascal 1.6.8 https://github.com/tebe6502/Mad-Pascal/releases/tag/v1.6.7-1.6.8 Edited August 19, 2023 by tebe 5 Quote Link to comment https://forums.atariage.com/topic/240919-mad-pascal/page/33/#findComment-5301057 Share on other sites More sharing options...
Gury Posted August 20, 2023 Share Posted August 20, 2023 What a release! Thank you for the new version, making it the most powerful Atari 8-bit cross-platform development tool besides MADS. Other tools are also great, of course, but this is true masterpiece. 1 Quote Link to comment https://forums.atariage.com/topic/240919-mad-pascal/page/33/#findComment-5301375 Share on other sites More sharing options...
tebe Posted August 21, 2023 Author Share Posted August 21, 2023 MP newest version, new features https://github.com/tebe6502/Mad-Pascal/tree/master - improved memory allocation for arrays [0..0], 'ABSOLUTE $0000' is enforced initially, 1 byte of memory is saved - added possibility to declare arrays without specifying their size, e.g.: tab: array of byte = [1,3,4,3,1]; tb: array of char = 'abcdefghij'; - new compiler directive {$bin2csv filename} allows you to initialize arrays e.g.: tb: array of byte = [ {$bin2csv filename} ]; https://github.com/tebe6502/Mad-Pascal/tree/master/samples/a8/bin2csv 3 1 Quote Link to comment https://forums.atariage.com/topic/240919-mad-pascal/page/33/#findComment-5302119 Share on other sites More sharing options...
Atlan_Roland Posted August 23, 2023 Share Posted August 23, 2023 Hi Tebe, in MP 1.6.8+, the usage of a pstring variable as parameter to unzx0() does not work anymore. (compiles, but the unzx0ed datastream seems to get written unpredictably into memory, at least not in the specified target adress). The same workes fine with MP1.6.6 though. Has there been any change in usage of pstring that i'm missing? Attached the .a65 outputs of MP 1.6.6 and MP 1.6.8 of given code below. If you should need more data tell me. Thank you for all your efforts with mp! 👍 program test_mp_1_6_8; uses crt,zx0; const IMPORT = $5000; var i : byte; fname : pstring; begin fname:='D:RESOURCE.ZX0'; unzx0(fname, pointer(IMPORT)); // was fine MP 1.6.6, but not anymore in MP 1.6.8 ? //unzx0('D:RESOURCE.ZX0', pointer(IMPORT)); // to verify, works fine if the filestring is given directly. gotoxy(1,1); for i:=0 to 39 do write(chr(peek(IMPORT+i))); repeat until false; end. testcode_mp_1.6.6.a65 testcode_mp_1.6.9.a65 Quote Link to comment https://forums.atariage.com/topic/240919-mad-pascal/page/33/#findComment-5303405 Share on other sites More sharing options...
tebe Posted August 23, 2023 Author Share Posted August 23, 2023 2 hours ago, Atlan_Roland said: fname : pstring; fname: string[16]; 1 Quote Link to comment https://forums.atariage.com/topic/240919-mad-pascal/page/33/#findComment-5303503 Share on other sites More sharing options...
+JAC! Posted August 26, 2023 Share Posted August 26, 2023 On 8/21/2023 at 11:37 PM, tebe said: - improved memory allocation for arrays [0..0], 'ABSOLUTE $0000' is enforced initially, 1 byte of memory is saved - added possibility to declare arrays without specifying their size, e.g.: tab: array of byte = [1,3,4,3,1]; tb: array of char = 'abcdefghij'; - new compiler directive {$bin2csv filename} allows you to initialize arrays e.g.: tb: array of byte = [ {$bin2csv filename} ]; https://github.com/tebe6502/Mad-Pascal/tree/master/samples/a8/bin2csv I'm a bit confused about the name "$bin2csv". I'd expect CSV means "Comma Separated Values", so read a "1,2,3" text file. But this looks like a "bin2bytearray," e.g. INS in MADS. ?! Quote Link to comment https://forums.atariage.com/topic/240919-mad-pascal/page/33/#findComment-5305206 Share on other sites More sharing options...
tebe Posted August 26, 2023 Author Share Posted August 26, 2023 https://github.com/t-edson/P65Pas Tokenizer sees this as "Comma Separated Values." Quote Link to comment https://forums.atariage.com/topic/240919-mad-pascal/page/33/#findComment-5305251 Share on other sites More sharing options...
tebe Posted August 27, 2023 Author Share Posted August 27, 2023 (edited) MP logo https://github.com/tebe6502/Mad-Pascal/tree/master/logo G2F version with improved graphics that fit on 1 character set Edited August 27, 2023 by tebe 2 1 Quote Link to comment https://forums.atariage.com/topic/240919-mad-pascal/page/33/#findComment-5305716 Share on other sites More sharing options...
+JAC! Posted August 27, 2023 Share Posted August 27, 2023 On 8/26/2023 at 11:15 PM, tebe said: https://github.com/t-edson/P65Pas Tokenizer sees this as "Comma Separated Values." I see, this this is actually a compile-time expression that resolves into source; not a binary include directive. Quote Link to comment https://forums.atariage.com/topic/240919-mad-pascal/page/33/#findComment-5305833 Share on other sites More sharing options...
tebe Posted October 3, 2023 Author Share Posted October 3, 2023 (edited) https://github.com/tebe6502/Mad-Pascal new directive {$optimization LOOPUNROLL}, {$optimization NOLOOPUNROLL}, works only with FOR with const parameters {$optimization LOOPUNROLL} for a:='a' to 'd' do writeln(a); {$optimization NOLOOPUNROLL} Edited October 3, 2023 by tebe 4 Quote Link to comment https://forums.atariage.com/topic/240919-mad-pascal/page/33/#findComment-5327575 Share on other sites More sharing options...
Wrathchild Posted October 4, 2023 Share Posted October 4, 2023 @tebe When looking into the loading of Arcadia here: There seemed to be issues: 1) The mechanism works with a hard-OS but left the NMIEN as $C0 2) With a soft-OS the code is never entered and so the NMIEN remains as the OS set it, $40 3) The game itself never loads & copies blocks under the OS and so call/PORTB flip is not required. So with 2) the fault appears to lay with the game not asserting NMIEN should be $C0, rather than the framework? With 3, could the compiler detect RAM under OS is not used (during loading) and so flip to off/on entry points to RTS? Quote Link to comment https://forums.atariage.com/topic/240919-mad-pascal/page/33/#findComment-5328198 Share on other sites More sharing options...
tebe Posted October 12, 2023 Author Share Posted October 12, 2023 MP 1.6.9 https://github.com/tebe6502/Mad-Pascal/releases - improved memory allocation for arrays [0..0], 'ABSOLUTE $0000' is enforced initially, 1 byte of memory is saved - added possibility to declare arrays without specifying their size, e.g.: var tab: array of byte = [1,3,4,3,1]; var tb: array of char = 'abcdefghij'; - new compiler directive {$bin2csv filename} allows you to initialize arrays e.g.: var tb: array of byte = [ {$bin2csv filename} ]; - new compiler directive {$optimization loopunroll}, {$optimization noloopunroll}, performs FOR loop unrolling with fixed parameters - new BLOWFISH module allowing to encrypt, decrypt character strings according to specified key - new example a8\AES-Rijndeal new samples (AES-Rijndeal, Blowfish) https://github.com/tebe6502/Mad-Pascal/tree/master/samples/a8/math/AES-Rijndael https://github.com/tebe6502/Mad-Pascal/blob/master/lib/blowfish.pas https://github.com/tebe6502/Mad-Pascal/tree/master/samples/common/math/blowfish blowfish_test.obx 4 1 Quote Link to comment https://forums.atariage.com/topic/240919-mad-pascal/page/33/#findComment-5332053 Share on other sites More sharing options...
Atlan_Roland Posted October 13, 2023 Share Posted October 13, 2023 (edited) 21 hours ago, tebe said: MP 1.6.9 https://github.com/tebe6502/Mad-Pascal/releases - improved memory allocation for arrays [0..0], 'ABSOLUTE $0000' is enforced initially, 1 byte of memory is saved - added possibility to declare arrays without specifying their size, e.g.: var tab: array of byte = [1,3,4,3,1]; var tb: array of char = 'abcdefghij'; - new compiler directive {$bin2csv filename} allows you to initialize arrays e.g.: var tb: array of byte = [ {$bin2csv filename} ]; - new compiler directive {$optimization loopunroll}, {$optimization noloopunroll}, performs FOR loop unrolling with fixed parameters - new BLOWFISH module allowing to encrypt, decrypt character strings according to specified key - new example a8\AES-Rijndeal new samples (AES-Rijndeal, Blowfish) https://github.com/tebe6502/Mad-Pascal/tree/master/samples/a8/math/AES-Rijndael https://github.com/tebe6502/Mad-Pascal/blob/master/lib/blowfish.pas https://github.com/tebe6502/Mad-Pascal/tree/master/samples/common/math/blowfish blowfish_test.obx 7.75 kB · 2 downloads Question: String handling seems to have changed again. This example worked in MP v1.6.8+: var fname : string[14] absolute NPC_ARRAY + 64+6+7+16+1+1; // fname: "D:X#.ZX0" --> todo: reduce to [8] [..] fname:='D:UA.ZX0'; //Initialize fname (D:**.ZX0) and set to Atascii font file. unzx0(fname,pointer(FONT)); //load font before text is displayed Now with 1.6.9 it throws: Mad Pascal Compiler version 1.6.9 [2023/10/13] for 6502 Compiling U_LOADER.PAS U_LOADER.PAS (537,8) Error: Incompatible types: got "STRING" expected "POINTER" Ok, changing it to: unzx0(pointer(fname),pointer(FONT)); compiles, but crashes at running. --> What would be the correct syntax/data structure now? Edited October 13, 2023 by Atlan_Roland Quote Link to comment https://forums.atariage.com/topic/240919-mad-pascal/page/33/#findComment-5332417 Share on other sites More sharing options...
tebe Posted October 14, 2023 Author Share Posted October 14, 2023 https://github.com/tebe6502/Mad-Pascal/tree/master/samples/a8/compression https://github.com/tebe6502/Mad-Pascal/blob/master/lib/zx0.pas interface procedure unZX0(inputPointer, outputPointer: pointer); assembler; register; overload; procedure unZX0(fnam: PString; outputPointer: pointer; a: byte); register; overload; 1 Quote Link to comment https://forums.atariage.com/topic/240919-mad-pascal/page/33/#findComment-5332579 Share on other sites More sharing options...
Atlan_Roland Posted October 15, 2023 Share Posted October 15, 2023 (edited) ok, thanks!: missed the new "a:byte" parameter for stream loading.. (is that used for anything?) Edited October 15, 2023 by Atlan_Roland Quote Link to comment https://forums.atariage.com/topic/240919-mad-pascal/page/33/#findComment-5333011 Share on other sites More sharing options...
tebe Posted October 15, 2023 Author Share Posted October 15, 2023 42 minutes ago, Atlan_Roland said: missed the new "a:byte" parameter for stream loading.. (is that used for anything?) Without this additional parameter, it will not be possible to distinguish between the calls of these two variants of the UNZX0 procedure procedure unZX0(inputPointer, outputPointer: pointer); assembler; register; overload; procedure unZX0(fnam: PString; outputPointer: pointer); register; overload; Error: Can't determine which overloaded function 'UNZX0' to call Quote Link to comment https://forums.atariage.com/topic/240919-mad-pascal/page/33/#findComment-5333022 Share on other sites More sharing options...
tebe Posted October 16, 2023 Author Share Posted October 16, 2023 procedure unZX0(fnam: PString; outputPointer: pointer; a: byte); register; overload; this was probably supposed to be a temporary procedure until I corrected it, but I forgot it has now been fixed https://github.com/tebe6502/Mad-Pascal procedure unZX0(fnam: PString; outputPointer: pointer); register; overload; https://github.com/tebe6502/Mad-Pascal/blob/master/lib/zx0.pas 2 Quote Link to comment https://forums.atariage.com/topic/240919-mad-pascal/page/33/#findComment-5333542 Share on other sites More sharing options...
Atlan_Roland Posted October 16, 2023 Share Posted October 16, 2023 31 minutes ago, tebe said: procedure unZX0(fnam: PString; outputPointer: pointer; a: byte); register; overload; this was probably supposed to be a temporary procedure until I corrected it, but I forgot it has now been fixed https://github.com/tebe6502/Mad-Pascal procedure unZX0(fnam: PString; outputPointer: pointer); register; overload; https://github.com/tebe6502/Mad-Pascal/blob/master/lib/zx0.pas wow, you are the best - and you are fast! though just tested it with main branch (1.7.0) and with 1.6.9 with the new zx0.pas lib; but seems not to work here in my constellation though - the compiler seems to choose the inputPointer version. That is probably because I used it like the example below, pointing to a file-string. The version with the indicator byte was a good decision then 😄 var fname : string[14]; begin [..] fname:='D:QSTON.ZX0'; unzx0(@fname,pointer(QuickMusic_Song)); By the way, i see that the compiler output in the 1.7.0 branch is listening procedures.. maybe this is some preliminary testing for the ORIGIN proposal ? 😆https://github.com/tebe6502/Mad-Pascal/issues/119 (that would really be an cool feature, saving me enormous amout of RAM, as i would use it as some kind of 'overlay' function.) Quote Link to comment https://forums.atariage.com/topic/240919-mad-pascal/page/33/#findComment-5333573 Share on other sites More sharing options...
Atlan_Roland Posted October 16, 2023 Share Posted October 16, 2023 Sorry, Tebe, i didn't check the paramters! your new unzx0() stream overload works perfectly of course! Like you stated in your example code: https://github.com/tebe6502/Mad-Pascal/blob/master/samples/a8/compression/unzx0_stream.pas fn:='D:KORONIS.ZX0'; unZX0(fn, pointer(dpeek(88)) ); so to correct my code sample from above var fname : string[14]; begin [..] fname:='D:QSTON.ZX0'; unzx0(fname,pointer(QuickMusic_Song)); Quote Link to comment https://forums.atariage.com/topic/240919-mad-pascal/page/33/#findComment-5333719 Share on other sites More sharing options...
tebe Posted November 13, 2023 Author Share Posted November 13, 2023 instruction update {$link filename} https://mads.atari8.info/doc/en/asm/ 2 1 Quote Link to comment https://forums.atariage.com/topic/240919-mad-pascal/page/33/#findComment-5348179 Share on other sites More sharing options...
tebe Posted November 23, 2023 Author Share Posted November 23, 2023 (edited) update https://github.com/tebe6502/Mad-Pascal - {$UNITPATH filename} is equivalent {$LIBRARYPATH filename} - USES unit_name in 'filename' uses crt, vector in '..\3d\vector.pas'; Edited November 23, 2023 by tebe 3 1 Quote Link to comment https://forums.atariage.com/topic/240919-mad-pascal/page/33/#findComment-5354158 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.