dmsc Posted January 9, 2021 Share Posted January 9, 2021 Hi! 2 hours ago, Atlan_Roland said: Thank you very much TeBe and XXL! I (theoretically) get the concept now; but i couldn't put it down in code; my assembler skills - an knowledge of the OS system calls - are to little yet. You did not understood what Tebe said. Madpascal has two functions: FilePos returns current file position and Seek sets the position. In DOS 2.5 or compatibles (like xbootdos), you should only call Seek with values returned from FilePos other values would give undefined behavior. In SDX and other compatible like BW-DOS FilePos will return the position in bytes and Seek will also set the position in bytes, so you can use arbitrary values. If you need this functionality, use BW-DOS or SDX. Basically "FilePos" is like NOTE, "Seek" is like POINT. Have Fun! 2 Quote Link to comment Share on other sites More sharing options...
xxl Posted January 9, 2021 Share Posted January 9, 2021 you can also use xBIOS: (unit xBIOS for MadPacal) https://bocianu.gitlab.io/blibs/xbios.html xBiosSetFileOffset procedure xBiosSetFileOffset(pos: cardinal); assembler; Sets the current read/write position in the current file with a value stored in parameter. This item is calculated relative to the beginning of the file. In DOS speak, the operation is called "POINT". You can only move this pointer forward. parameters: pos - new position in the current file 1 Quote Link to comment Share on other sites More sharing options...
Atlan_Roland Posted January 10, 2021 Share Posted January 10, 2021 Got it! i forgot to add xBDext! on my xboot disk,, that's why FilePos/Seek always returned 0 ! (see https://xxl.atari.pl/xbootdos/ ) Thank you everybody for your explanations & help! Quote Link to comment Share on other sites More sharing options...
zbyti Posted January 11, 2021 Share Posted January 11, 2021 (edited) New Mad Pascal target: Commodore Plus/4 #!/bin/bash mp="$HOME/Programs/MadPascal/mp" mads="$HOME/Programs/mads/mads" base="$HOME/Programs/MadPascal/base" if [ -z "$1" ]; then echo -e "\nPlease call '$0 <argument>' to run this command!\n" exit 1 fi $mp $1 -t c4p -z 10 -o name=${1::-4} if [ -f $name.a65 ]; then [ ! -d "output" ] && mkdir output mv $name.a65 output/ $mads output/$name.a65 -x -i:$base -o:output/$name.prg else exit 1 fi if [ ! -z "$2" ]; then xplus4 output/$name.prg fi var COLORRAM : array [0..0] of byte absolute $0800; SCREEN : array [0..0] of byte absolute $0c00; BORDERCOLOR : byte absolute $ff15; BGCOLOR : byte absolute $ff19; var w0i, row : word; b0i, b1i : byte; begin BORDERCOLOR := 0; BGCOLOR := 0; FillByte(@SCREEN, 40 * 25, $a0); for b0i := 0 to 7 do begin row := 40 * b0i; for b1i := 0 to 15 do COLORRAM[row+b1i] := (b0i shl 4) + b1i; end; end. test.pas test.prg Edited January 12, 2021 by zbyti example was refactored 2 Quote Link to comment Share on other sites More sharing options...
tebe Posted January 11, 2021 Author Share Posted January 11, 2021 speed up for b0i := 0 to 7 do begin m := 40 * b0i; for b1i := 0 to 15 do COLORRAM[m+b1i] := (b0i shl 4) + b1i; end; 1 1 Quote Link to comment Share on other sites More sharing options...
zbyti Posted January 11, 2021 Share Posted January 11, 2021 Yes, but it was direct translation from https://c64portal.pl/2020/05/04/programowanie-w-kick-c-dla-commodore-plus-4/ Quote Link to comment Share on other sites More sharing options...
Gury Posted February 8, 2021 Share Posted February 8, 2021 On 12/5/2020 at 12:15 PM, zbyti said: main.xex 1.21 kB · 22 downloads I am still wondering where this ship is destinated to. I suppose it is close to Pluto right now. The barrier of our solar system is very close, so I am very excited what adventure awaits it. 2 Quote Link to comment Share on other sites More sharing options...
zbyti Posted February 8, 2021 Share Posted February 8, 2021 @Gury right now I'm reading Writing Strategy Games On Your Atari Computer. If I just come up with how to apply this knowledge in this game I will push this game forward I will quote you the beginning of the mentioned book: Quote There comes a time in any computer owner's life when he becomes tired of zapping aliens. As the 1,079,864th flying saucer crashes spectacularly to the ground (or, more often, the player crashes instead), he thinks about signing a peace treaty with the rest of the galaxy and turning to something else. Are you really want to zapp another alien mothership? 2 1 Quote Link to comment Share on other sites More sharing options...
tebe Posted February 9, 2021 Author Share Posted February 9, 2021 unit VBXE, new improvements SetPlayfieldPalette SetOverlayPalette Line PutPixel vbxeCustomPalette.obx vbxeCustomPalette.pas vbxeOverlayLine.obx vbxeOverlayLine.pas 3 Quote Link to comment Share on other sites More sharing options...
zbyti Posted February 9, 2021 Share Posted February 9, 2021 Mad Pascal code is the only VBXE documentation I can find Quote Link to comment Share on other sites More sharing options...
dmsc Posted February 9, 2021 Share Posted February 9, 2021 Hi! 9 hours ago, zbyti said: Mad Pascal code is the only VBXE documentation I can find You are probably kidding, but best (only?) vbxe docs are in https://lotharek.pl/files/vbxe/docs.zip Have Fun! 1 1 Quote Link to comment Share on other sites More sharing options...
+Stephen Posted February 9, 2021 Share Posted February 9, 2021 There's also some files in the SDX toolkit in the screen driver's sub-directory (XIO.TXT and S_VBXE.TXT) Quote Link to comment Share on other sites More sharing options...
drpeter Posted February 10, 2021 Share Posted February 10, 2021 1 hour ago, Stephen said: There's also some files in the SDX toolkit in the screen driver's sub-directory (XIO.TXT and S_VBXE.TXT) And in the Altirra Hardware Reference Manual. 1 Quote Link to comment Share on other sites More sharing options...
zbyti Posted February 16, 2021 Share Posted February 16, 2021 (edited) While reading "Writing Strategy Games On Your Atari Computer" I decided to have some fun writing a simple AI for siege type games. At the moment I wrote a few simple strategies for bots: - STRAIGHT - BULLY - MIRROR - SAPPER Game prototyping in Mad Pascal is real fun :] I even started drawing graphics Gameplay movie taken on C+4, human player on the left. tron.mp4 Edited February 16, 2021 by zbyti typo 2 Quote Link to comment Share on other sites More sharing options...
Gury Posted February 16, 2021 Share Posted February 16, 2021 Aha! This is specific time when pre-SkyNet was born! 2 Quote Link to comment Share on other sites More sharing options...
zbyti Posted February 17, 2021 Share Posted February 17, 2021 @Gury please help me with diamond (find best path) strategy Quote Link to comment Share on other sites More sharing options...
Gury Posted February 17, 2021 Share Posted February 17, 2021 Hmm, ok Quote Link to comment Share on other sites More sharing options...
zbyti Posted February 17, 2021 Share Posted February 17, 2021 @Gury Diamond not needed, I can't beat my own game tron.mp4 https://github.com/zbyti/siege-ai-playground Quote Link to comment Share on other sites More sharing options...
zbyti Posted February 19, 2021 Share Posted February 19, 2021 Finito! If someone want to convert this to A8 (to exercise a little MP) link to repository above. tron.mp4 tron.prg 3 Quote Link to comment Share on other sites More sharing options...
zbyti Posted February 20, 2021 Share Posted February 20, 2021 (edited) On 2/18/2021 at 12:42 AM, zbyti said: @Gury Diamond not needed, I can't beat my own game I just managed to beat my game, I found a solution for the last two hardest levels :] I think I have to add DIAMOND AI :] Edited February 21, 2021 by zbyti screenshot Quote Link to comment Share on other sites More sharing options...
Gury Posted February 23, 2021 Share Posted February 23, 2021 New version, new additions... ? Quote Link to comment Share on other sites More sharing options...
zbyti Posted February 23, 2021 Share Posted February 23, 2021 29 minutes ago, Gury said: New version, new additions... ? Shhhh... It's a secret! Quote Link to comment Share on other sites More sharing options...
Gury Posted February 23, 2021 Share Posted February 23, 2021 1 Quote Link to comment Share on other sites More sharing options...
zbyti Posted February 23, 2021 Share Posted February 23, 2021 I ? Simpsons 1 Quote Link to comment Share on other sites More sharing options...
zbyti Posted February 24, 2021 Share Posted February 24, 2021 (edited) Raster IRQ and C+4 var DETIRQSRC : byte absolute $ff09; //detect IRQ source, and clear IRQ flag SETIRQSRC : byte absolute $ff0a; //set IRQ source RC : byte absolute $ff0b; //raser counter bits 0-7 BORDER : byte absolute $ff19; VCOUNT : byte absolute $ff1d; //vertical line bits 0-7 IRQVEC : word absolute $fffe; var tmp : byte absolute $ff; procedure myRasterIrq; interrupt; begin asm { phr }; Inc(BORDER); tmp:= VCOUNT + 32; repeat until tmp = VCOUNT; Dec(BORDER); DETIRQSRC := DETIRQSRC and %01111111; asm { plr }; end; begin pause; asm { sei \ sta $ff3f}; RC := 204; SETIRQSRC := 2; DETIRQSRC := DETIRQSRC and %01111111; IRQVEC := word(@myRasterIrq); asm { cli }; repeat until false; end. Edited February 24, 2021 by zbyti typo 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.