Jump to content
IGNORED

how can you realize the fill and the plot with millfork for the graphics?


Recommended Posts

Hi good afternoon.


the graphics for the atari can be called up in millfork-demo:

asm void openmode (byte register (a) m) @ $ ef9c extern
asm void drawto () @ $ f9c2 extern

 

where can you find the two addresses for the openmode and the drawto?

 

how can you call the fill and plot in millfork?

Link to comment
Share on other sites

You should not jump straight into the OS. Use CIO. That's what it's for. Only 128 or 256-byte coding challenges is something different. There you specify excactly which hardware and OS it will run on.

 

And now, how many times have people asked you to stop spamming this forum with constantly creating new threads?

  • Like 1
Link to comment
Share on other sites

51 minutes ago, xxl said:

plot: $f1d8 (color to $2FB)
fill: same as drawto but first set fillfla: 1 to $2B7 and color to $2FD

For which OS? Those entry points aren't even listed in Mapping The Atari, even though it lists a lot of entry points that are not portable.

 

Link to comment
Share on other sites

4 minutes ago, ivop said:

For which OS? Those entry points aren't even listed in Mapping The Atari, even though it lists a lot of entry points that are not portable.

 

for all XL series

 

---

for each system that was distributed with Atari XL / XE / XEGS series

Edited by xxl
Link to comment
Share on other sites

hello xxl , thanks.

 

your proposal works wonderfully.

Thank you.

 

with : include from millfork:

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

alias prev_x = os_OLDCOL.lo
alias cursor_x = os_COLCRS.lo
alias prev_y = os_OLDROW
alias cursor_y = os_ROWCRS
alias color = os_ATACHR
alias colfill = os_FILDAT
alias fillfla = os_FILFLG

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

simple fill with millfork :


alias prev_x = os_OLDCOL.lo
alias cursor_x = os_COLCRS.lo
alias prev_y = os_OLDROW
alias cursor_y = os_ROWCRS
alias color = os_ATACHR

byte colplot @ $2fb
byte colfill @ $2fd
byte fillfla @ $2b7

asm void openmode(byte register(a) m) @ $ef9c extern
asm void drawto() @ $f9c2 extern
asm void plot() @ $f1d8 extern

void main(){ 
  openmode(7)
  
  colplot=5
  cursor_x = 10
  cursor_y = 10
  prev_x = 50
  prev_y = 10
  drawto()
  
  cursor_x = 10
  cursor_y = 10
  prev_x = 10
  prev_y = 50
  drawto()
  
  cursor_x = 50
  cursor_y = 10
  prev_x = 50
  prev_y = 50
  drawto()
  
  fillfla =1
  colfill=6
  cursor_x = 10
  cursor_y = 10
  prev_x = 10
  prev_y = 50
  drawto()
 
  while true {}
}

 

 

drawtofill.jpg

Edited by funkheld
Link to comment
Share on other sites

I'm with IVOP here. Using XIO commands via the CIOV vector the the correct and documented way. Code like the above is not portable and will break on arbitrary OS versions. There are much many then "each system that was distributed with Atari XL / XE / XEGS series" even though people tend forget that.

http://www.abbuc.de/software/133-software/softwarereferenz/315-xio-command-codes

17 DRAW LINE
18 FILL

  • Like 2
Link to comment
Share on other sites

15 minutes ago, funkheld said:

your proposal works wonderfully.

sometimes there is a need to get the memory address at a specific point on the screen. write the coordinates to "rowcrs" and "colcrs"

do: CONVRT = $ F5AC

and under ADRESS = $ 64, $ 65 you will have a byte address in the screen memory ?

 

 

Link to comment
Share on other sites

Quote

 


I'm with IVOP here. Using XIO commands via the CIOV vector the the correct and documented way. Code like the above is not portable and will break on arbitrary OS versions. There are much many then "each system that was distributed with Atari XL / XE / XEGS series" even though people tend forget that.
 

 

 

 

it would be nice if there was a suggestion for millfork on how to implement your idea for the graphic "open, plot, drawto, fill"
with XIO?

I'm a beginner and have asked about it several times, but was laughed at here because I can't.

 

Thank you.
greeting

Edited by funkheld
Link to comment
Share on other sites

there are only "disk sector" read/write procedures in the OS, no "file" read/write procedures.

 

If you are creating a BOOT program, the OS routines are fine (many era games written on disk are just like that), but if you need to read/write to/from a file you have two options: load DOS before running your program or use xBIOS.

 

DOS (located in BOOT SECTORS, installs "D:" device in the system) - 384 bytes DOS - access to files through the CIO mechanism.

https://xxl.atari.pl/xbootdos/

 

xBIOS (1 KB relocated library) https://xxl.atari.pl/ - access files in a compact way:

 

fname .byte c'MYFILE COM'

ldy     < fname
ldx     > fname
jsr     xBIOS_LOAD_FILE
 

there are also other DOSes: the AtariDOS family, the SpartaDOS family, DOS 3, DOS 4, DOS XE and many others

before choosing the appropriate one, get to know the differences in the file system because quite a few are not compatible with each other (in absolutely basic functions they are compatible).

 

back to the answer: you need to know exactly what you need.

Edited by xxl
Link to comment
Share on other sites

Try these two functions first. If you are a beginner then do not use the xBIOS configuration file.


fname .byte c'MYFILE COM' ; 11 ATASCII chars

ldy     < fname
ldx     > fname
jsr     xBIOS_OPEN_FILE


ldy     < dest
ldx     > dest
jsr     xBIOS_LOAD_DATA
 

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