Jump to content
IGNORED

Going into Action! - A noob perspective


Recommended Posts

6 hours ago, svhovater said:
 

so, funkheld, I realize this is an old topic, but I'm learning action! too.

 

I note that somewhere I read that in order to produce a standalone binary, the statement

BYTE RTS=[$60]

 

had to be before I include the runtime.act.


My question is.. why?

 

thanks

Steve

 

The reason for the BYTE rts=[$60] statement is due to the fact that the Action! cartridge writes the binary file and then appends the INIT vector ($02E2/$02E3] as the run address for the file. The problem arises that some DOS versions (Sparta for one, and I think DOS XL) do a JSR to the first segment loaded if there is no RUN [$02E0/$02E1] address supplied. This usually is a JSR into data rather than code, and bad things often happen in those cases. So by coding the rts statement you ensure that a call to the loading address simply returns to the caller, rather than maybe formatting your hard disk partition.

  • Thanks 2
Link to comment
Share on other sites

@Alfred I don't notice that problem, if your explanation it's true why BYTE rts=[$60] is required not only [$60]?

 

Can you give code example where RTS helps in practice? Any piece of code that works on Sparta with this declaration but doesn't work without?

Edited by zbyti
code example
Link to comment
Share on other sites

I checked this out. Works fine on SpartaDOS.

SET $E=$2000
SET $491=$2000

BYTE ARRAY
  DL=[$70$70$70$56$C$20$41$1$20],
  TEXT="NNNNNNNNNNNNNNNNNNNNNNwithout@rtsNNNNNNNNNNNNNNNNNNNNNN"

BYTE
  RTCLOCK=$14,
  CH=$2FC,
  HSCROL=$D404
CARD SDLSTL=$230

INCLUDE "H6:RUNTIME.ACT"

PROC WAIT(BYTE FRAMES)
  FRAMES==+RTCLOCK
  WHILE FRAMES#RTCLOCK DO OD
RETURN

PROC MAIN()
  BYTE I=$CA

  SDLSTL=DL

  WHILE CH=$FF DO
    I=8
    WHILE I DO
      I==-1
      HSCROL=I
      WAIT(1)
    OD
    DL(4)==+1
    IF DL(4)=$23+$C THEN DL(4)=$C FI
  OD
  GRAPHICS(0)
RETURN

 

MAIN.ACT RUNTIME.ACT test.atr

Screenshot_2020-07-16_10-00-59.png

 

Jump in the end of the DL to $2001 is my mistake (my first attempts) but it doesn't matter.

Edited by zbyti
screenshot
Link to comment
Share on other sites

3 hours ago, zbyti said:

@Alfred I don't notice that problem, if your explanation it's true why BYTE rts=[$60] is required not only [$60]?

 

Can you give code example where RTS helps in practice? Any piece of code that works on Sparta with this declaration but doesn't work without?

[$60] is not a valid statement. Byte rts=[$60] is a short way to put the $60 opcode at the start of the file. You tested with Sparta 2.3 or 3.2D, right?

Link to comment
Share on other sites

13 minutes ago, Alfred said:

[$60] is not a valid statement. Byte rts=[$60] is a short way to put the $60 opcode at the start of the file. You tested with Sparta 2.3 or 3.2D, right?

Yes you right, out of the proc body [$60] will not produce RTS this must be some variable declaration.

atari000.png

with x hscroll.com and without x, in my Action! project I use Exomizer - works with SpartaDOS

SCRAMBLE.XEX

Edited by zbyti
Exomizer
Link to comment
Share on other sites

@Alfred you refer to this https://atariwiki.org/wiki/Wiki.jsp?page=Action Bugsheet#section-Action+Bugsheet-20..COMPROGRAMS

 

Quote

Running compiled ACTION! programs as .COM files under OS/A+ causes those programs to execute twice.

Affects: All versions, but only when using a version of OS/A+. DOS XL is not affected.

Fix: Insert the following as the first global variable you declare:

    BYTE RTS=[$60]
    ; This MUST be the first line in your program,
    ; aside from comments and SET commands.

I'll check it. This states that only OS/A+ have this issue.

Edited by zbyti
OS/A+
Link to comment
Share on other sites

On 7/17/2020 at 4:22 PM, zbyti said:

@pedgarcia If you are interested in it and it will be useful in your tutorial I included some tricks in my code that I saw or discovered on my own https://github.com/zbyti/a8-action-scramble

Hey @zbyti, thanks! That is a very organized code (compared to mine so far!) . I noticed that you have a module with low-level routines and some of them are part of Action! standard library (not sure if that is the correct term). Why did you do that? Was to have more efficient code, or simply to have only what you would need?

 

I haven't had a chance to run it yet, but I will dig deeper tomorrow. That will be very useful.

 

Cheers

 

 

Link to comment
Share on other sites

18 hours ago, pedgarcia said:

 Why did you do that? Was to have more efficient code, or simply to have only what you would need?

For 3 reasons:

 

1. to save memory by picking exactly what I need from runtime

2. to make binary (xex file) working without cartridge

3. speed

 

I use one of those runtimes (I belie von Jeff Reister was the one) but noticed what SETBLOCK procedure is 3x slower then PROC on Action! cartridge, I'll fix this later.

Edited by zbyti
SETBLOCK info
Link to comment
Share on other sites

@pedgarcia I only compile code using Atari800 but I'm writing the code outside Action! env. It's looks (early version) this way:

 

 

I think this way I can use more variables on ZERO PAGE (>= $80) because I don't have to worry about the correct work of the Action! editor after running my own code. 

Edited by zbyti
>= $80
  • Like 1
Link to comment
Share on other sites

Hey @zbyti, it looks great! I've been using Action! editor (full immersion :) ) and I found it excellent, even for today's standards, but the Atari's 40 columns display doesn't help much to visualize the code. I will try to get going something similar you showed in your video using an external editor.

 

Another point I wasn't thinking is the amount of memory the editor and the code would take. My current game is very small so that's ok, but at some point I can see things will start to get more complicated to manage.

 

Thanks!

 

 

  • Like 1
Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...
17 hours ago, DocSavage2001 said:

Yes, good stuff. I will need to pull that image for Action! in your first tutorial. I just picked up an 800 with Basic, Logo and Mac/65 and I need to have Action! too! :)

 

Dave

Thanks. The first article contains a link to an image I created for the series. It is nothing fancy but this way I can point to folders or specific things without thinking on different types of images, etc.

 

 

Cheers

 

 

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