funkheld Posted October 6, 2018 Author Share Posted October 6, 2018 hello, thanks for the help. greeting Quote Link to comment Share on other sites More sharing options...
funkheld Posted October 6, 2018 Author Share Posted October 6, 2018 is the fastbasic still being developed? Thank you. greeting Quote Link to comment Share on other sites More sharing options...
funkheld Posted October 6, 2018 Author Share Posted October 6, 2018 Hi good afternoon. integrated asm-proc does not work with FASTBASIC. Why? Thank you greeting .global PRINTE .proc PRINTE pha pha ldx #0 lda #32 loop sta $2100,x inx bne loop lda #0 ldx #0 pla pla rts .endproc Quote Link to comment Share on other sites More sharing options...
Rybags Posted October 6, 2018 Share Posted October 6, 2018 (edited) Not sure about FastBasic but with standard Atari Basic USR calls you need at least one PLA at the start. You've got 2 x PHA which is sort of pointless. Once you've done the PLA, A should contain the # of parameters that the USR call has passed. It's up to you whether you want to do complex parsing that can handle any number, or just expect a particular number of parms (or none) which will probably crash if not called in the expected way. Parameters are 16 bit numbers so you need 2 x PLA to retrieve each one. Generally with any Basic, there's no need to save/restore registers, the Basic interpreter will take care of that itself. Edited October 6, 2018 by Rybags Quote Link to comment Share on other sites More sharing options...
funkheld Posted October 6, 2018 Author Share Posted October 6, 2018 hello, thanks. greeting Quote Link to comment Share on other sites More sharing options...
dmsc Posted October 6, 2018 Share Posted October 6, 2018 Hi! is the fastbasic still being developed? Thank you. greeting Yes, as time allows. Why do you ask? 1 Quote Link to comment Share on other sites More sharing options...
funkheld Posted October 6, 2018 Author Share Posted October 6, 2018 (edited) if you have new ideas for the extension? You invented a wonderful Basic. I am also looking for a solution for the Fastbasic for the VBI? I also have a problem here, it does not work: .global PRINTE .proc PRINTE ldx #0 lda #32 loop sta $2100,x inx bne loop lda #0 ldx #0 rts .endproc Edited October 6, 2018 by funkheld Quote Link to comment Share on other sites More sharing options...
dmsc Posted October 6, 2018 Share Posted October 6, 2018 Hi! if you have new ideas for the extension? You invented a wonderful Basic. I am also looking for a solution for the Fastbasic for the VBI? What do you want the VBI for? For BASIC programs, normally you simply use "PAUSE 0" to wait for VBI, then you can write all registers without tearing. See: repeat : pause 0 : poke 53274, 127 : until key() I also have a problem here, it does not work: .global PRINTE .proc PRINTE ldx #0 lda #32 loop sta $2100,x inx bne loop lda #0 ldx #0 rts .endproc That should work only if you change the start-address, it writes the value "32" to memory locations from $2100 to $21FF. Quote Link to comment Share on other sites More sharing options...
funkheld Posted October 6, 2018 Author Share Posted October 6, 2018 (edited) i would like to do vscrol with vbi once. ------------------- loop ------------------- this is ok : loop: the addresses are correct. I have created a new dl from $ 2100.. Thank you. greeting Edited October 6, 2018 by funkheld Quote Link to comment Share on other sites More sharing options...
funkheld Posted October 7, 2018 Author Share Posted October 7, 2018 Hi good afternoon. what does the parser error mean? Thank you. greeting dlist =560 savmsc=$58 ramadr=$2100 data dldat() byte = $70, $70, $70, $46, data byte = $00,$21, data byte = $80, $06, $06, $06, $60, $06, $06, $06, $06, $06, data byte = $06, $06, $06, $06, $60, $06, $06, $06, $06, $06, data byte = $06, $06, $06, $41, $00, $20 dladr=adr(dldat) move dladr,$2000,255 dpoke dlist,$2000 dpoke savmsc,ramadr for i= ramadr to ramadr+439 poke i,32 next i pause 0 poke $20fe,0 dpoke 512, @dlizeile1 poke 54286, 192 z=$2007 repeat get a pause 0 poke z,$80 poke z-1,$06 z=z+1 if z=$201a then z=$2007 endif until 0 end Quote Link to comment Share on other sites More sharing options...
funkheld Posted October 7, 2018 Author Share Posted October 7, 2018 (edited) Hi good afternoon. I need a memory allocation of madpascal. why do I have to put the pm-memory always so low (256 * 106-4) although in graph8 there is so much space for the pm? the memory principle of madpascal is incomprehensible to me. Thank you. greeting uses crt, graph, joystick; const _max = 7; // Number of player 0 data values _speed = 16; // Player 0 movement speed var p0Data : array [0.._max] of byte = (48,120,252,48,48,48,48,48); // Draw player 0 image px0 : byte = 120; // Sprite X position py0 : byte = 60; // Sprite Y position pmgMem : Word; procedure moveSprite; begin Poke(pmgMem+512+py0-1, 0); Poke(pmgMem+512+py0+_max+1, 0); move(p0Data, pointer(pmgMem+512+py0), sizeof(p0Data)); end; begin // Set graphics mode and playfield colors InitGraph(; Poke(710, 122); Poke(712, 130); Poke(709, 64); // Set playfield graphics SetColor(1); Line(10,10,300,10); Rectangle(30,50,100,130); Circle(250,60,20); // Initialize P/M graphics Poke(53277, 0); pmgMem := Peek(106) - 4; Poke(54279, pmgMem); pmgMem := pmgMem shl 8; Poke(559, 46); // Clear player 0 memory fillchar(pointer(pmgMem+512), 128, 0); // Draw player 0 // Vertical position of player 0 moveSprite; 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 case joy_1 of joy_left: begin // Move player 0 left Dec(px0); if px0 < 45 then px0 := 45; Poke(53248,px0); Delay(_speed); end; joy_right: begin // Move player 0 right Inc(px0); if px0 > 203 then px0 := 203; Poke(53248,px0); Delay(_speed); end; joy_up: begin // Move player 0 up Dec(py0); if py0 < 16 then py0 := 16; moveSprite; Delay(_speed); end; joy_down: begin // Move player 0 down Inc(py0); if py0 > 97 then py0 := 97; moveSprite; Delay(_speed); end; end; until keypressed; // Reset P/M graphics InitGraph(0); Poke(53277, 0); end. Edited October 7, 2018 by funkheld Quote Link to comment Share on other sites More sharing options...
tebe Posted October 7, 2018 Share Posted October 7, 2018 (edited) *.a65 file STACKWIDTH = 16 CODEORIGIN = $2000 TRUE = 1 FALSE = 0 org $80 .print 'ZPFREE: $0000..',*-1 fxptr .ds 2 eax .ds 4 ;8 bytes (aex + edx) -> divREAL edx .ds 4 ecx .ds 4 bp .ds 2 bp2 .ds 2 ztmp ztmp8 .ds 1 ztmp9 .ds 1 ztmp10 .ds 1 ztmp11 .ds 1 TMP .ds 2 STACKORIGIN .ds STACKWIDTH*4 .print 'ZPFREE: ',*,'..',$ff ax = eax al = eax ah = eax+1 cx = ecx cl = ecx ch = ecx+1 dx = edx dl = edx dh = edx+1 org eax FP1MAN0 .ds 1 FP1MAN1 .ds 1 FP1MAN2 .ds 1 FP1MAN3 .ds 1 org ztmp8 FP1SGN .ds 1 FP1EXP .ds 1 org edx FP2MAN0 .ds 1 FP2MAN1 .ds 1 FP2MAN2 .ds 1 FP2MAN3 .ds 1 org ztmp10 FP2SGN .ds 1 FP2EXP .ds 1 org ecx FPMAN0 .ds 1 FPMAN1 .ds 1 FPMAN2 .ds 1 FPMAN3 .ds 1 org bp2 FPSGN .ds 1 FPEXP .ds 1 ; ----------------------------------------------------------- org CODEORIGIN STATICDATA START try Mad Pascal Compiler Syntax: mp <inputfile> [options] -d Diagnostics mode -code:$address Code origin address -data:$address Data origin address -stack:$address Software stack address (size = 64 bytes) -zpage:$address Address variables on the zero page (size = 24 bytes) Edited October 7, 2018 by tebe Quote Link to comment Share on other sites More sharing options...
tebe Posted October 7, 2018 Share Posted October 7, 2018 default: $2000...$BFFF Quote Link to comment Share on other sites More sharing options...
funkheld Posted October 7, 2018 Author Share Posted October 7, 2018 hello, thanks. greeting. Quote Link to comment Share on other sites More sharing options...
funkheld Posted October 7, 2018 Author Share Posted October 7, 2018 thanks for the info. greeting. Quote Link to comment Share on other sites More sharing options...
dmsc Posted October 7, 2018 Share Posted October 7, 2018 Hi! Hi good afternoon. what does the parser error mean? if z=$201a then z=$2007 endif A multi-line IF is written without ELSE: if z=$201a z=$2007 endif I will try to improve the error message. Quote Link to comment Share on other sites More sharing options...
funkheld Posted October 7, 2018 Author Share Posted October 7, 2018 hello tanks. greeting. Quote Link to comment Share on other sites More sharing options...
funkheld Posted October 7, 2018 Author Share Posted October 7, 2018 (edited) Hi good afternoon. readkey outputs the most impossible values with Altirra with madpas. why is that please? what needs to be done here? greeting uses crt; var s: char; a: byte; quit: boolean; begin repeat begin s := ReadKey; a:=byte(s); writeln(a); end; until quit; end. Edited October 7, 2018 by funkheld Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted October 7, 2018 Share Posted October 7, 2018 (edited) Please explain why you think they are impossible? What do you expect?Perhaps take a look at the page here. Edited October 7, 2018 by Wrathchild Quote Link to comment Share on other sites More sharing options...
funkheld Posted October 8, 2018 Author Share Posted October 8, 2018 (edited) They do not work according to the table. greeting test: e = 12 i = 228 k = 208 W = 1 E = 208 R = 63 ........ ........ uses crt; var s: char; a: byte; quit: boolean; begin repeat begin s := readkey; a:=byte(s); writeln(a); end; until quit; end. Edited October 8, 2018 by funkheld Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted October 8, 2018 Share Posted October 8, 2018 (edited) The ReadKey routine (which uses GetKey) is translating the keycode using the O/S lookup table via the address at ($79).w which points in the XL O/S to $FB51 Have you switched out the O/S or altered the content of $79 or $7A? [Edit] your listing works fine for me; pressing A,B,C,D,space,a,b,c,d results in 65, 66, 67, 68, 32, 97, 98, 99, 100 Edited October 8, 2018 by Wrathchild Quote Link to comment Share on other sites More sharing options...
phaeron Posted October 8, 2018 Share Posted October 8, 2018 I'm guessing he is running on a 400/800 OS. The pointer at $79 doesn't exist on OS-B and the values reported are consistent with the GetKey routine breaking as a result (which is why I consider it a bad idea to rely on this pointer or the OS key table in general). 1 Quote Link to comment Share on other sites More sharing options...
funkheld Posted October 8, 2018 Author Share Posted October 8, 2018 hello, thanks for the info with the OS. had a wrong OS involved in the Altirra. it works now. Thank you. greeting Quote Link to comment Share on other sites More sharing options...
Rybags Posted October 8, 2018 Share Posted October 8, 2018 It's not good practice to rely on either method. In 95% or more of cases if you know it's not an XL you could probably refer to the fixed location table in the old OS.But there's no guarantee if a custom OS is in use.So you'd need to cater for both, which in practical use means just supply your own translation table. You can do it in 64 bytes - the Shift and Ctrl variants are just bitsettings. Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted October 8, 2018 Share Posted October 8, 2018 You can do it in 64 bytes - the Shift and Ctrl variants are just bitsettings. 192 bytes, I think. Certain POKEY key codes (like the whole alphabet) can easily be mapped to the appropriate ATASCII codes in an algorithmic fashion using a 64 byte table as a base, but I guess there's a reason they used a look up table for shift and control when you consider the rest (shifted numbers, cursor control, etc). 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.