Jump to content

Photo

FastBasic - New Year Release

basic compiler interpreter

43 replies to this topic

#26 funkheld OFFLINE  

funkheld

    Moonsweeper

  • 370 posts

Posted Sun Sep 9, 2018 3:42 PM

thanks for the data-help.

 

I make an xex with start address $ 3000 with the cfg.

FEATURES {

    STARTADDRESS: default = $3000;

the dli starts at $2000.
if I pull the xex into the altirra, the program works.
if I put the xex on an atr and start in the altirra from the disk, the altirra crashes.

 

greeting

dlist =560
savmsc=$58
 
colpf0=$d016
colpf1=$d017
colpf2=$d018
colpf3=$d019
 
ramadr=$2000
 
data dlidat() byte = $70, $70, $70, $44, $00, $20, $4, $4, $4, $4, 
data          byte = $4,$4,$41, $00, $00
 
dpoke adr(dlidat)+13,ramadr
 
dpoke dlist,adr(dlidat)
dpoke savmsc,ramadr 
 
poke colpf0,10
poke colpf1,10
poke colpf2,10
poke colpf3,10
 
for i=0 to 12
   print "printen..."
next i
 
repeat
until key()

Attached Thumbnails

  • Bild2.jpg
  • Bild3.jpg

Edited by funkheld, Sun Sep 9, 2018 3:45 PM.


#27 _The Doctor__ OFFLINE  

_The Doctor__

    Flux Capacitor Master Craftsman

  • 6,231 posts
  • Location:10-0-11-00:02

Posted Sun Sep 9, 2018 4:03 PM

pick a dos that doesn't use your memory area and format the atr with that dos and make it bootable with the write DOS or boot x32x.dos function then copy your exe to it...

if it is not basic then hold option key during boot (in an emu make sure basic is not attached)

if it is going to be a basic program attach cartridge on 800 or do not hold option (or make sure basic rom is not selected in emu)

 

then just load it like normal in whatever dos you chose or even make an autorun.sys etc..


Edited by _The Doctor__, Sun Sep 9, 2018 4:04 PM.


#28 funkheld OFFLINE  

funkheld

    Moonsweeper

  • 370 posts

Posted Mon Sep 10, 2018 12:32 AM

who can please give me a little displaylist (dli) that works too
make for the fastbasic from atr do altirra?
 
I can not get that as oldmen.
 
Thank you.
grus

Edited by funkheld, Mon Sep 10, 2018 2:15 AM.


#29 dmsc OFFLINE  

dmsc

    Moonsweeper

  • Topic Starter
  • 474 posts
  • Location:Viņa del Mar, Chile

Posted Mon Sep 10, 2018 6:08 AM

Hi Funkheld!
 

who can please give me a little displaylist (dli) that works too
make for the fastbasic from atr do altirra?
 
I can not get that as oldmen.


If your little program with the DL already works as XEX, the problem is how you are generating the ATR.

What tools are you using for creating the ATR?

I personally use my own "mkatr" tool, that is compatible with SpartaDOS and BW-DOS , but many people use other tools. A good one is "dir2atr" by HiassofT, it allows selecting a DOS or a mini "pico-dos" to load your program.

Attached is an ATR with your compiled program.

Attached Files


Edited by dmsc, Mon Sep 10, 2018 6:12 AM.


#30 funkheld OFFLINE  

funkheld

    Moonsweeper

  • 370 posts

Posted Mon Sep 10, 2018 11:12 AM

makeATR.exe , this is the programm.for the atr.

 

thanks.

greeting



#31 dmsc OFFLINE  

dmsc

    Moonsweeper

  • Topic Starter
  • 474 posts
  • Location:Viņa del Mar, Chile

Posted Mon Sep 10, 2018 12:08 PM

Hi Funkheld!
 

makeATR.exe , this is the programm.for the atr.


Ok, what I did was:

- Open makeATR.exe (I'm on Linux, so I used wine)
- Open an ATR with DOS-2.5.
- Remove all files except DOS.SYS and DUP.SYS.
- Insert the compiled program ( FUNKHELD.XEX )
- Rename the program to AUTORUN.SYS (this makes the program run at DOS start).
- Save as TEST.ATR

Now, the ATR correctly loads and run the program. Note that the output will have extraneous data after loading DOS, because you are not clearing the memory area from $2000 to the end of the display, so any data there will be keep between runs.

All in all, I think that is much easier to use a command line tool, like "dir2atr" (download from http://www.horus.com/~hias/atari/), so building the ATR can be automated, you can simply do:
 
  dir2atr -b MyPicoDos405 OUTPUT.ATR C:\PATH\TO\DIR\WITH\XEX\ 


#32 funkheld OFFLINE  

funkheld

    Moonsweeper

  • 370 posts

Posted Mon Sep 10, 2018 3:17 PM

thanks now it works.
The graphics 160x92 works wonderfully with the displaylist.

the second graphic (displaylist) 320x192 exceeds the 1kb limit.
where is the new address jump address now used?

Thank you.
greeting

 

fastbasic.cfg

--------------------------------------------------------

FEATURES {

    STARTADDRESS: default = $4000;

--------------------------------------------------------

 

is ok !!!!! displaylist. 160x96

dlist =560
savmsc=$58
 
ramadr=$2000
 
data dlidat() byte = $70, $70, $4d, 
data          byte = $00,$20,
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, $00            
             
dpoke adr(dlidat)+102,adr(dlidat)
dpoke dlist,adr(dlidat)
dpoke savmsc,ramadr 
 
for i=0 to 3839
   poke $2000+i,129
next   
 
repeat
until Key()

Edited by funkheld, Mon Sep 10, 2018 3:39 PM.


#33 funkheld OFFLINE  

funkheld

    Moonsweeper

  • 370 posts

Posted Mon Sep 10, 2018 3:21 PM

here is the displaylist for 320x192 :

where is the new address jump address now used?

 

 

fastbasic.cfg

--------------------------------------------------------

FEATURES {

    STARTADDRESS: default = $4000;

--------------------------------------------------------

savmsc=$58
 
ramadr=$2000
 
data dlidat() byte = $70, $70, $4F, 
data          byte = $00, $20,
data          byte = $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F,
data          byte = $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F,
data          byte = $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F,
data          byte = $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F,
data          byte = $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F,
data          byte = $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F,
data          byte = $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F,
data          byte = $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F,
data          byte = $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F,
data          byte = $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F,
data          byte = $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F,
data          byte = $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F,
data          byte = $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F,
data          byte = $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F,
data          byte = $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F,
data          byte = $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F,
data          byte = $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F,
data          byte = $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F,
data          byte = $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F, $0F,$0F, $41, 
data          byte = $00, $00            
             
dpoke adr(dlidat)+197,adr(dlidat)
dpoke dlist,adr(dlidat)
dpoke savmsc,ramadr 
 
for i=0 to 7679
   poke $2000+i,129
next   
 
repeat
until Key()

Edited by funkheld, Mon Sep 10, 2018 3:39 PM.


#34 funkheld OFFLINE  

funkheld

    Moonsweeper

  • 370 posts

Posted Tue Sep 11, 2018 1:26 AM

Hi good afternoon.
 
i not found "CLS" for Text and "CLS for "GRAFIK" ?
 
Thank you.
 
 

Edited by funkheld, Tue Sep 11, 2018 2:59 AM.


#35 funkheld OFFLINE  

funkheld

    Moonsweeper

  • 370 posts

Posted Tue Sep 11, 2018 3:37 AM

waht is this in the fastbasic.cfg :

MAIN:    file = %O, define = yes, start = %S,    size = $BC20 - %S;

 

 $BC20 - %S;

 

tanks

greeting.


Edited by funkheld, Tue Sep 11, 2018 3:38 AM.


#36 sanny OFFLINE  

sanny

    Moonsweeper

  • 357 posts
  • Location:Bavaria

Posted Tue Sep 11, 2018 4:45 AM

That's the size of the "MAIN" memory area.

 

regards,

chris



#37 dmsc OFFLINE  

dmsc

    Moonsweeper

  • Topic Starter
  • 474 posts
  • Location:Viņa del Mar, Chile

Posted Thu Sep 13, 2018 6:27 PM

Hi Funkheld!
 

Hi good afternoon.
 
i not found "CLS" for Text and "CLS for "GRAFIK" ?
 
Thank you.


Yes, there is no "CLS" statement currently, I can add it to the next FastBasic version, it's only 9 bytes more in the IDE.

In the mean time, I suggest using " PUT 125 " for the text screen and " PUT #6, 125 " for the graphics screen.

#38 dmsc OFFLINE  

dmsc

    Moonsweeper

  • Topic Starter
  • 474 posts
  • Location:Viņa del Mar, Chile

Posted Thu Sep 13, 2018 7:01 PM

Hi Funkheld!
 

here is the displaylist for 320x192 :
where is the new address jump address now used?

 
 
Generating the display list for screens with more than 4096 bytes ($1000) is not trivial, as you need to ensure that the last byte of a line is just one before the address wrap.

I suggest using the OS functions, this will make the program simpler.

This is an example that creates two 160x192 screens and alternates between the two:
' OS equates
SDLSTL =$230
SAVMSC = $58
RAMTOP = $6A

' Stores original ramtop
rtop = peek(RAMTOP)

' Sets the top of memory to our reserved address
poke RAMTOP, $40
gr. 15+16

' Save the address of display-list and display data
dlist1 = dpeek(SDLSTL)
scrad1 = dpeek(SAVMSC)

' Draw some simple graphics
i0 = 0 : exec draw

' Now, generate "original" screen
poke RAMTOP, rtop
gr. 15+16

' Save the address of display-list and display data
dlist2 = dpeek(SDLSTL)
scrad2 = dpeek(SAVMSC)

' Draw some simple graphics
i0 = 3 : exec draw

' Alternate screens
repeat
  exec screen1
  pause 5
  exec screen2
  pause 5
until key()

end


proc draw
  color 1
  for i=i0 to 100 step 10
    plot i,0
    dr. 0,100-i
  next i
endproc

proc screen1
  pause 0
  dpoke SDLSTL, dlist1
  dpoke SAVMSC, scrad1
endproc

proc screen2
  pause 0
  dpoke SDLSTL, dlist2
  dpoke SAVMSC, scrad2
endproc
Compile with a start-address of at least $4000.

Warning: original OS versions had a bug with screen clearing, so you need to reserve 256 bytes more memory than actually needed.

#39 funkheld OFFLINE  

funkheld

    Moonsweeper

  • 370 posts

Posted Fri Sep 14, 2018 12:57 AM

hello, tanks for help me.

 

greeting.



#40 funkheld OFFLINE  

funkheld

    Moonsweeper

  • 370 posts

Posted Fri Sep 14, 2018 5:38 AM


 " PUT 125 " for the text screen and " PUT #6, 125 " for the graphics screen

 

is little  and very good.

 

greeting.


Edited by funkheld, Sat Sep 15, 2018 11:28 AM.


#41 Philsan OFFLINE  

Philsan

    River Patroller

  • 3,804 posts
  • New Orleans Saints Super Bowl XLIV Champions
  • Location:Switzerland

Posted Sat Sep 29, 2018 12:40 AM

Mad Studio now supports FastBasic!



#42 funkheld OFFLINE  

funkheld

    Moonsweeper

  • 370 posts

Posted Sat Sep 29, 2018 1:38 AM

Hello thanks for the information.
how does that work with the parser for fastbasic
how is please which file in what implemented?

can you please give a brief introduction for that?

What does the batch look like if I do it under d: \ atari \ mads?

Thank you.
greeting



#43 Philsan OFFLINE  

Philsan

    River Patroller

  • 3,804 posts
  • New Orleans Saints Super Bowl XLIV Champions
  • Location:Switzerland

Posted Sat Sep 29, 2018 3:46 AM

Hello thanks for the information.
how does that work with the parser for fastbasic
how is please which file in what implemented?

can you please give a brief introduction for that?

What does the batch look like if I do it under d: \ atari \ mads?

Thank you.
greeting

Sorry, I am not able to answer to your questions.

I can only advise you to try Mad Studio.



#44 funkheld OFFLINE  

funkheld

    Moonsweeper

  • 370 posts

Posted Sat Sep 29, 2018 8:08 AM

hello, thanks.

 

greeting







Also tagged with one or more of these keywords: basic, compiler, interpreter

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users