Jump to content
IGNORED

The "funkheld" Question Thread


funkheld

Recommended Posts

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 by Irgendwer
  • Like 1
Link to comment
Share on other sites

 

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).

  • Like 1
Link to comment
Share on other sites

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 by funkheld
Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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 by funkheld
Link to comment
Share on other sites

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 by funkheld
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 ;)

 

  • Like 1
Link to comment
Share on other sites

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!!

Link to comment
Share on other sites

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;
}
Link to comment
Share on other sites

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 by funkheld
Link to comment
Share on other sites

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 by funkheld
Link to comment
Share on other sites

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

  • Like 1
Link to comment
Share on other sites

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 by solo/ng
  • Like 1
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...