sanny Posted October 19, 2018 Share Posted October 19, 2018 Here's a simple scrolling example. Ok, not so simple since it can be compiled to a COM file or a cart image. The cart image is intended for a MaxFlash 8 cart. It's in assembler, though. regards, chris hitobi.zip 1 Quote Link to comment Share on other sites More sharing options...
Irgendwer Posted October 19, 2018 Share Posted October 19, 2018 (edited) Here's a simple scrolling example. Poster is really lucky that you are so supportive. Thankfully he will never ask for cc65 support: http://atariage.com/forums/topic/240919-mad-pascal/page-5?do=findComment&comment=3399885 http://atariage.com/forums/topic/240919-mad-pascal/page-5?do=findComment&comment=3401996 Edited October 19, 2018 by Irgendwer 1 Quote Link to comment Share on other sites More sharing options...
vitoco Posted October 19, 2018 Share Posted October 19, 2018 Hi good afternoon. I would like to please the sentence: AAAAAAAAAA Slide 32x pixels to the right and then 32x pixels to the left. then I want to scroll the sentence over the zoom screen so that it disappears. I can only 8x pixel hscrol. gr. 17 no print !!! text just poke Thank you. greeting [code] dlist =560 savmsc=$58 vscrol=$d405 hscrol=$d404 gr. 17 ramadr=dpeek(savmsc) dl=dpeek(dlist) poke dl+3,$56 for z=0 to 4 poke ramadr+z,0 next z for z = 5 to 15 Poke ramadr+z,33 next z for z=0 to 5 for a=0 to 8 pause 5 pause 0 poke hscrol,a next a for a=0 to 8 pause 5 pause 0 poke hscrol,8-a next a next z repeat until key() end Your FOR A loops are wrong... they must go from 0 to 7 for that graphics mode (8 steps). Also, PAUSE 0 right after another PAUSE statement is useless, just keep the PAUSE 5. As sanny said, if you want to scroll more than 8 pixels, you also have to change the data pointer in DL (or move the data) at the same time you reset the HSCROL register, in order to display the next byte as the new base address of that line (and the following ones). See the explained source code in my mini games La Peste (FastBasic with data movement) and Invaders (TurboBasic XL with DL pointers change). 1 Quote Link to comment Share on other sites More sharing options...
funkheld Posted October 19, 2018 Author Share Posted October 19, 2018 (edited) here an A is attached in front. then it goes away and is attached at the back this A somehow it does not work with the addresses. Thank you greeting dlist =560 savmsc=$58 vscrol=$d405 hscrol=$d404 x=0 gr. 17 ramadr=dpeek(savmsc) dl=dpeek(dlist) poke dl+3,$56 for y = 5 to 9 Poke ramadr+y,33 next y for z=0 to 10 for a=0 to 7 pause 5 poke hscrol,a next a poke ramadr+10+x,33 poke ramadr+5+x,0 x=x+1 next z repeat until key() end Edited October 19, 2018 by funkheld Quote Link to comment Share on other sites More sharing options...
vitoco Posted October 19, 2018 Share Posted October 19, 2018 Yes, it works!!!! The problem is that the sequence of events and pauses is wrong. I've changed the order to this: for z=0 to 10 pause 0 poke ramadr+10+x,33 poke ramadr+5+x,0 for a=0 to 7 poke hscrol,a pause 5 next a x=x+1 next z You might have to initialize X to the right value. Have fun! Quote Link to comment Share on other sites More sharing options...
funkheld Posted October 19, 2018 Author Share Posted October 19, 2018 it works the same way as with me above. Thank you. Quote Link to comment Share on other sites More sharing options...
funkheld Posted October 19, 2018 Author Share Posted October 19, 2018 (edited) Hi good afternoon, hello dmsc have now tried with the Compy-ram-256kb made with fastbasic. in the data are the values for addressing 16 x16kb. the area to show is $4000- $7fff. how can you please create the cfg so I have the memory of $4000- $7fff free and the starting address the program at $8000 ? or how can I keep the memory in the cfg from $4000- $7fff ? Thank you. greeting Edited October 19, 2018 by funkheld Quote Link to comment Share on other sites More sharing options...
funkheld Posted October 19, 2018 Author Share Posted October 19, 2018 (edited) it is already running wonderfully. but after the scrol-7 it jerks a bit. how can you please put that away? greeting dlist =560 savmsc=$58 vscrol=$d405 hscrol=$d404 x=0 gr. 17 ramadr=dpeek(savmsc) dl=dpeek(dlist) poke dl+3,$56 for z = 2 to 6 Poke ramadr+z,33 next z pause 30 for z=0 to 14 for a=0 to 7 pause 1 poke hscrol,a next a for y = 3+x to 7+x pause 0 poke ramadr+y-5,0 Poke ramadr+y,33 next y poke hscrol,0 x=x+1 next z repeat until key() end Edited October 19, 2018 by funkheld Quote Link to comment Share on other sites More sharing options...
+Stephen Posted October 19, 2018 Share Posted October 19, 2018 I've never seen a smooth scroller done without pure assembler, precisely for the reason you mentioned. If things are not perfectly synchronized, there will be a jump when resetting hscroll from 7 to 0 and changing the LMS for the coarse scroll. Quote Link to comment Share on other sites More sharing options...
vitoco Posted October 20, 2018 Share Posted October 20, 2018 First, the FOR Y loop has PAUSE 0 inside it that repeats five times and in total it behaves like a PAUSE 5. Move that PAUSE outside the loop, just before the FOR statement. It will be smother. Second, you have two steps 0: one in the FOR X loop and another one outside the loop (the FOR Y loop). Change the FOR X loop to start from 1 instead of 0. It will be smother tha the previous. Third, you can get a better result if you use the tools that FastBasic supplies, like the MOVE statement that could replace the FOR Y loop, and fit into the same screen refresh. Forth, you will get the best result if you change the order of the events to something like this: for z=0 to 14 -move ramadr,ramadr+1,22 for a=0 to 7 poke hscrol,a pause 1 next a next z The -MOVE statement (with a dash in front of it) moves the data in that line one byte to the right by copying itself backwards (from right to left), but you have to be sure that the leftmost byte is empty to create the effect. Note that this requires that the data should be stored one byte to the left, because the MOVE will start moving it before the start of the fine scroll inner loop. Also, the HSCROL register should be set to 7 at the program start to fit that initial location, and it might require a PAUSE 0 just before the main loop to avoid a glitch. I hope that this solution meets Stephen's expectations 1 Quote Link to comment Share on other sites More sharing options...
+Stephen Posted October 20, 2018 Share Posted October 20, 2018 First, the FOR Y loop has PAUSE 0 inside it that repeats five times and in total it behaves like a PAUSE 5. Move that PAUSE outside the loop, just before the FOR statement. It will be smother. Second, you have two steps 0: one in the FOR X loop and another one outside the loop (the FOR Y loop). Change the FOR X loop to start from 1 instead of 0. It will be smother tha the previous. Third, you can get a better result if you use the tools that FastBasic supplies, like the MOVE statement that could replace the FOR Y loop, and fit into the same screen refresh. Forth, you will get the best result if you change the order of the events to something like this: for z=0 to 14 -move ramadr,ramadr+1,22 for a=0 to 7 poke hscrol,a pause 1 next a next z The -MOVE statement (with a dash in front of it) moves the data in that line one byte to the right by copying itself backwards (from right to left), but you have to be sure that the leftmost byte is empty to create the effect. Note that this requires that the data should be stored one byte to the left, because the MOVE will start moving it before the start of the fine scroll inner loop. Also, the HSCROL register should be set to 7 at the program start to fit that initial location, and it might require a PAUSE 0 just before the main loop to avoid a glitch. I hope that this solution meets Stephen's expectations Sorry man - I am way behind the times!! Quote Link to comment Share on other sites More sharing options...
dmsc Posted October 20, 2018 Share Posted October 20, 2018 Hi! Hi good afternoon, hello dmsc have now tried with the Compy-ram-256kb made with fastbasic. in the data are the values for addressing 16 x16kb. the area to show is $4000- $7fff. how can you please create the cfg so I have the memory of $4000- $7fff free and the starting address the program at $8000 ? or how can I keep the memory in the cfg from $4000- $7fff ? Thank you. greeting This is not easy. Best way is to put *all* program (the interpreter plus your compiled program) in the area from $2000 to $3FFF (8KB), and put all variables and arrays in tha area from $8000 upward. This is realized by adding a new memory area in the config file, and placing the BSS segment (this is all the memory available for your program) in the new memory area: FEATURES { STARTADDRESS: default = $2000; } SYMBOLS { __EXEHDR__: type = import; __STARTADDRESS__: type = export, value = %S; } MEMORY { ZP: file = "", define = yes, start = $0094, size = $0040; # file header, just $FFFF HEADER: file = %O, start = $0000, size = $0002; # "main program" load chunk MAINHDR: file = %O, start = $0000, size = $0004; MAIN: file = %O, define = yes, start = %S, size = $3FFF - %S; DATAMEM: define = yes, start = $8000, size = $BC20 - $8000; # This is for data at address past $8000. # code in zero page! IHEADER: file = %O, start = $0000, size = $0004; INTERP: file = %O, define = yes, start = $0082, size = $0012; TRAILER: file = %O, start = $0000, size = $0006; } SEGMENTS { ZEROPAGE: load = ZP, type = zp, optional = yes; EXEHDR: load = HEADER, type = ro, optional = yes; MAINHDR: load = MAINHDR, type = ro, optional = yes; JUMPTAB: load = MAIN, type = ro, define = yes, align = $100; RUNTIME: load = MAIN, type = rw, define = yes; CODE: load = MAIN, type = rw, define = yes; DATA: load = MAIN, type = rw optional = yes, define = yes; BSS: load = DATAMEM, type = bss, optional = yes, define = yes; # Put the BSS into DATAMEM IHEADER: load = IHEADER, type = ro; INTERP: load = INTERP, type = rw; AUTOSTRT: load = TRAILER, type = ro, optional = yes; } Quote Link to comment Share on other sites More sharing options...
funkheld Posted October 20, 2018 Author Share Posted October 20, 2018 Hi, Thank You. I play with the crosscompiler on the pc and then transfer the xex to the atari. I do not design the programs on the atari with the interpreter. can one adapt there the cfg? greeting Quote Link to comment Share on other sites More sharing options...
funkheld Posted October 20, 2018 Author Share Posted October 20, 2018 (edited) I play with fastbasic-cross, so compile on the pc have now again made a test with my cfg. start at $8000. have made grafik23 in my own dlist. dlist from $2000-$2100 and the graphics23 from $2100. have the compy-ram256 from 5x$4000 ($63 in the data-zeile) with 4x graphics23 (3840 byte) described with 4 different graphics so altogether with 15360 byte. These are displayed at $4000-$3fff and work without any problems. In between I have the memory which is not needed by grafik23 ($2100-$2fff) of $3000-$3fff deleted with "0". actually should now a fault (crash) come when the program is there. but it seems the program starts at $8000 work. so have times really brought chaos into the memory. it also runs from my MIST FPGA. Thank you. greeting savmsc=$58 ramadr=$2100 dlist =560 data compy256() byte = $23, $27, $2b, $2f, $63, $67, $6b, $6f, data byte = $a3, $a7, $ab, $af, $e3, $e7, $eb, $ef compadr=adr(compy256) comp=54017 compy4=16384 data dldat() byte = $70, $70, $70, $4d, data byte = $00,$21, data byte = $0D, $0D, $0D, $0D, $0D, $0D, $0D, $0D, $0D, $0D, data byte = $0D, $0D, $0D, $0D, $0D, $0D, $0D, $0D, $0D, $0D, data byte = $0D, $0D, $0D, $0D, $0D, $0D, $0D, $0D, $0D, $0D, data byte = $0D, $0D, $0D, $0D, $0D, $0D, $0D, $0D, $0D, $0D, data byte = $0D, $0D, $0D, $0D, $0D, $0D, $0D, $0D, $0D, $0D, data byte = $0D, $0D, $0D, $0D, $0D, $0D, $0D, $0D, $0D, $0D, data byte = $0D, $0D, $0D, $0D, $0D, $0D, $0D, $0D, $0D, $0D, data byte = $0D, $0D, $0D, $0D, $0D, $0D, $0D, $0D, $0D, $0D, data byte = $0D, $0D, $0D, $0D, $0D, $0D, $0D, $0D, $0D, $0D, data byte = $0D, $0D, $0D, $0D, $0D, $41, data byte = $00, $20 dladr=adr(dldat) move dladr,$2000,255 gr. 23 color 1 dpoke dlist,$2000 dpoke savmsc,ramadr for z=0 to 3839 poke ramadr+z,128 next z plot 0,0 drawto 159,95 poke comp,$63 move ramadr,compy4,3840 poke comp,253 for z=0 to 3839 poke ramadr+z,129 next z plot 159,0 drawto 0,95 poke comp,$63 move ramadr,compy4+3840,3840 poke comp,253 for z=0 to 3839 poke ramadr+z,130 next z plot 0,10 drawto 159,10 poke comp,$63 move ramadr,compy4+7680,3840 poke comp,253 for z=0 to 3839 poke ramadr+z,131 next z plot 0,60 drawto 159,60 poke comp,$63 move ramadr,compy4+11520,3840 poke comp,253 pause 40 poke comp,$63 move compy4,ramadr,3840 poke comp,253 pause 40 poke comp,$63 move compy4+3840,ramadr,3840 poke comp,253 pause 40 poke comp,$63 move compy4+7680,ramadr,3840 poke comp,253 pause 40 poke comp,$63 move compy4+11520,ramadr,3840 poke comp,253 for z=$3000 to $3fff poke z,0 next for z=0 to 3839 poke ramadr+z,128 next z poke comp,$63 move ramadr,compy4,3840 poke comp,253 for z=0 to 3839 poke ramadr+z,129 next z poke comp,$63 move ramadr,compy4+3840,3840 poke comp,253 for z=0 to 3839 poke ramadr+z,130 next z poke comp,$63 move ramadr,compy4+7680,3840 poke comp,253 for z=0 to 3839 poke ramadr+z,131 next z poke comp,$63 move ramadr,compy4+11520,3840 poke comp,253 pause 40 poke comp,$63 move compy4,ramadr,3840 poke comp,253 pause 40 poke comp,$63 move compy4+3840,ramadr,3840 poke comp,253 pause 40 poke comp,$63 move compy4+7680,ramadr,3840 poke comp,253 pause 40 poke comp,$63 move compy4+11520,ramadr,3840 poke comp,253 repeat until key() end my fatsbasic.cfg: FEATURES { STARTADDRESS: default = $8000; } SYMBOLS { __EXEHDR__: type = import; __STARTADDRESS__: type = export, value = %S; } MEMORY { ZP: file = "", define = yes, start = $0094, size = $0040; # file header, just $FFFF HEADER: file = %O, start = $0000, size = $0002; # "main program" load chunk MAINHDR: file = %O, start = $0000, size = $0004; MAIN: file = %O, define = yes, start = %S, size = $BFFF - %S; # code in zero page! IHEADER: file = %O, start = $0000, size = $0004; INTERP: file = %O, define = yes, start = $0082, size = $0012; TRAILER: file = %O, start = $0000, size = $0006; } SEGMENTS { ZEROPAGE: load = ZP, type = zp, optional = yes; EXEHDR: load = HEADER, type = ro, optional = yes; MAINHDR: load = MAINHDR, type = ro, optional = yes; JUMPTAB: load = MAIN, type = ro, define = yes, align = $100; RUNTIME: load = MAIN, type = rw, define = yes; CODE: load = MAIN, type = rw, define = yes; DATA: load = MAIN, type = rw optional = yes, define = yes; BSS: load = MAIN, type = bss, optional = yes, define = yes; IHEADER: load = IHEADER, type = ro; INTERP: load = INTERP, type = rw; AUTOSTRT: load = TRAILER, type = ro, optional = yes; } Edited October 20, 2018 by funkheld Quote Link to comment Share on other sites More sharing options...
funkheld Posted October 20, 2018 Author Share Posted October 20, 2018 (edited) hello, tanks for helo. greeting Edited October 20, 2018 by funkheld Quote Link to comment Share on other sites More sharing options...
funkheld Posted October 23, 2018 Author Share Posted October 23, 2018 (edited) Hi good afternoon. where is there in the forum please a beginner course for beginners with MADS? This one should start small and not immediately start as an expert. Part 1..part 2 ... Part 3 ... how can you create a binary file with mads? Thank you. greeting Edited October 23, 2018 by funkheld Quote Link to comment Share on other sites More sharing options...
funkheld Posted October 23, 2018 Author Share Posted October 23, 2018 (edited) Hi good afternoon. is ok. Edited October 24, 2018 by funkheld Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted October 23, 2018 Share Posted October 23, 2018 Learn 6502 assembly language and MADS becomes largely self-explanatory with the aid of the manual. There's example code in the download package as well. Quote Link to comment Share on other sites More sharing options...
funkheld Posted October 23, 2018 Author Share Posted October 23, 2018 Hi good afternoon. the compy-ram when it's turned on is $4000-$7fff. is this a shadow that lies down there and you have to write the data somewhere else in the atari? when the compy-ram is turned off, is my program back then? Thank you. greeting Quote Link to comment Share on other sites More sharing options...
sanny Posted October 23, 2018 Share Posted October 23, 2018 Why didn't you post that as follow-up here: http://atariage.com/forums/topic/284144-have-now-tried-with-the-compy-ram-256kb-made-with-fastbasic/ ??? Quote Link to comment Share on other sites More sharing options...
funkheld Posted October 23, 2018 Author Share Posted October 23, 2018 Thank you. I would like to know whether my memory content $ 4000- $ 7fff is maintained when the compy-ram is turned on or when it is turned off again. Thank you. greeting Quote Link to comment Share on other sites More sharing options...
sanny Posted October 23, 2018 Share Posted October 23, 2018 Yes, I understand your question. But why didn't you post that as follow-up on the other thread, as it apparently is related? You're creating an inflation of threads which becomes over time quite confusing ("unübersichtlich" in German, if that's your native language). Why don't you settle down on one thread each for fastbasic questions, compy-shop questions, madpascal questions, etc.? Then all the answers would be in one thread and would potentially help other people with similar problems. regards, chris 1 Quote Link to comment Share on other sites More sharing options...
funkheld Posted October 23, 2018 Author Share Posted October 23, 2018 because compy-ram and rambo-ram are all concerned and not tied to the language greeting Quote Link to comment Share on other sites More sharing options...
solo/ng Posted October 23, 2018 Share Posted October 23, 2018 (edited) try this IDE: https://www.wudsn.com/ download, start it with it it will compile with mads and run it and start in altirra (just press F9 and see the effect;) cant remember if it has mads+altirra as default (if not - just set it via options) edit: super simple code to put there and press F9 to see results: org $2000 loop lda $d20a ; random sta $d01a ; colbak jmp loop Edited October 23, 2018 by solo/ng 1 Quote Link to comment Share on other sites More sharing options...
funkheld Posted October 23, 2018 Author Share Posted October 23, 2018 this IDE from wudns is good. greeting. 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.