Jump to content
IGNORED

control flow : goto (works) = JMP , gosub (does not) = JSR and functions()


Syntax Error

Recommended Posts

Hi again,

I was wondering if you were for instance to have a cinematic trail , a linear trail sorry in an intro of sorts and you want to check every slice if a joypad button is pressed (to skip) how to implement this in a routine that can be called

 

i tried using gosub but i get errors , i tried adapting the one function() example thats in localisation.bas but it seems like using getjoypad in there gives another error in the C code

 

for instance i have something that puts a word on screen using print commands in chunks, then delay(60) but what id like is to have a loop with delay(1) 60 times which checks also to see if there is a button pressed and if that is so to jump directly to the title screen/intro/whatever

 

ill keep looking on it but i thought i might as well ask, most of the command in xc basic manual seem to work with the compiler but not everything so maybe gosub/return isnt implemented and nesting functions (raptor functions or jagstudio functions) inside a user functions also isnt complete or has to be done a specific way.

 

otherwise i would have to re-type the same small block of code like 20 times after each bit of the intro-credit roll

which seems a bit un-pretty :)

 

thanks in advance if anyone has the time and solution, but i might not be able to check back until next weekend so sorry if i dont reply right away

 

J

(o , yea on the c64 for instance id set up an interrupt chain and in one split id have it check 1/50 seconds = every frame but im not sure if the .bas version of jagstudio allows that and learning C or RISC/asm for this mostly denies the purpose of having a basic ide, which is why i picked it up actually, if its not implemented i can just repeat the lines no problem but i think i should ask)

 

 

Edited by Syntax Error
Link to comment
Share on other sites

 it says "can no longer be edited so ill try this ?" (since i dont know how to delete and re-post)

 

edit  :

 

Hi again,

I was wondering if you were for instance to have a cinematic trail , a linear trail sorry in an intro of sorts and you want to check every slice if a joypad button is pressed (to skip) how to implement this in a routine that can be called

 

i tried using gosub but i get errors , i tried adapting the one function() example thats in localisation.bas but it seems like using getjoypad in there gives another error in the C code

 

for instance i have something that puts a word on screen using print commands in chunks, then delay(60) but what id like is to have a loop with delay(1) 60 times which checks also to see if there is a button pressed and if that is so to jump directly to the title screen/intro/whatever

 

ill keep looking on it but i thought i might as well ask, most of the command in xc basic manual seem to work with the compiler but not everything so maybe gosub/return isnt implemented and nesting functions (raptor functions or jagstudio functions) inside a user functions also isnt complete or has to be done a specific way.

 

otherwise i would have to re-type the same small block of code like 20 times after each bit of the intro-credit roll

which seems a bit un-pretty :)

 

thanks in advance if anyone has the time and solution, but i might not be able to check back until next weekend so sorry if i dont reply right away

 

J

(o , yea on the c64 for instance id set up an interrupt chain and in one split id have it check 1/50 seconds = every frame but im not sure if the .bas version of jagstudio allows that and learning C or RISC/asm for this mostly denies the purpose of having a basic ide, which is why i picked it up actually, if its not implemented i can just repeat the lines no problem but i think i should ask)

 

allow me to edit what i found for today

# allow me to fix half of myself here
#what i have now :


#begin .bas file - inc declarations and whatnot ...

#
# DO STUFF HERE (e.g. print name 1 to credit and roll into screen)
#

do

    'gosub joypaddery
    pad1 = test(1)
    IF pad1 BAND JAGPAD_B THEN

        goto labello
    endif

jsfDelay(1) 'this already feels wonky

loop
CLS

#
# DO MORE STUFF HERE ( e.g. next credit )
#

...

#
#
#

...

labello:

#
# START TITLESCREEN OR INTRO HERE
#


....


#
# END past main program
#

function test(o%)               ' o% is not really needed here, just for testing (% = AS INT or INT o)

    rapPrintCont "ccc"          ' not needed, used for checking
    function = jsfGetPad(1)
end function


########################################################################################
#------------ this is where i screwed b/c of some other syntax im used to
########################################################################################

function test(o%)

    o = jsfGetPad(1)    
end o

#------------ this seems to work

function test(o%)

    o = jsfGetPad(1)    
end function o

#------------ this also seems to work

function test(o%)

    o = jsfGetPad(1)
    return o
end function


other configs that wont including :
f

Quote

 

unction test()

    local o as int
    o = jsfGetPad(1)
    'o = 1
    return o
end function
+as well as
end function o

 

lead to
 

Quote

`
Linking things...
UNRESOLVED SYMBOLS
        __sigmask (/home/retrodevcat/Desktop/jagstudio/buildfiles/include/libc.a:setjmp.o)
        ___mint (/home/retrodevcat/Desktop/jagstudio/buildfiles/include/libc.a:setjmp.o)
`

however

Quote

 

function test(o%)

    rapPrintCont "ccc"
    function = jsfGetPad(1)
    o = jsfGetPad(1)
    return o
end function o

 

does ...

so i went with
```

function test(o%)

    function = jsfGetPad(o)
end function


```

seems like using "function" is necessary i get others where i define o but it doesnt return anything that amounts to a B-press no matter what or how many times i press

and as for the gosub : i first tried gosub return since its available in xc basic manual pages and i thought it would be closer to a ML routine (JRS ... RTS) after compilation

but for every time i use gosub i get the same error as above :

Quote

`
Linking things...
UNRESOLVED SYMBOLS
        __sigmask (/home/retrodevcat/Desktop/jagstudio/buildfiles/include/libc.a:setjmp.o)
        ___mint (/home/retrodevcat/Desktop/jagstudio/buildfiles/include/libc.a:setjmp.o)
`

assuming the return value "function" can be an array too or maybe a complex one with multiple datatypes i can probably take it from there but any other feedback is ofcourse appreciated, examples with source even more lol or maybe a list of just how much of the actual xc compiler works with jagstudio and what commands shouldnt be used for programming logic outside the raptor calls

thanks in advance (and if its too much chaos nevermind, i know im not the greatest of explainers)

 

i still think it would be handy to be able to use the gosub return structure but if not possible i guess i can work with functions -

 

any and all feedback (excluding RTFM NOOB-type comments if you please) are welcome ...

 

 

 

 

 

 

Link to comment
Share on other sites

8 hours ago, lwdallas said:

I think I lost the plot in your question :)

 

Yes, function = stuff is the correct syntax... but I don't think you are asking that.

 

Beware: I am also a noob...

its not unheard of, it has happened before and we're aware but thats why the Oracle likes us ... i know a little more by now so im no longer the wisest greek , i think the original two points were

 

- is there a way to use gosub return as it would be in the basic compiler manual ( link example : control flow : GOSUB RETURN

- is there a list of supported / non supported tokens which are available in bcx basic but not (...yet ? ...) in jagstudio

 

at the moment im wrestling with the fact that i cant seem to use ROM on linux and i have to compile the thing on windows (even the examples dont work on linux when compiled, also not when compiled with ROM option but they seem to do on windows which is a drag b/c im used to cinnamon desktop and usa-dos is a bit of a one-screen mess to me) , thanks for answering, when i have like 5 or more levels that actually run i'll make a post about the game tho i doubt i'll be entering jagjam or something it'l be on itch (for free or donate coffees) when ready

 

no deadlines, no roadmaps

 

all tips and tricks are welcome, snippets even more 😹

 

  • Like 1
Link to comment
Share on other sites

21 minutes ago, Syntax Error said:

at the moment im wrestling with the fact that i cant seem to use ROM on linux and i have to compile the thing on windows (even the examples dont work on linux when compiled, also not when compiled with ROM option but they seem to do on windows which is a drag b/c im used to cinnamon desktop and usa-dos is a bit of a one-screen mess to me) , thanks for answering, when i have like 5 or more levels that actually run i'll make a post about the game tho i doubt i'll be entering jagjam or something it'l be on itch (for free or donate coffees) when ready

 

Neither myself or Sporadic use Linux or macs, so support there is limited. All I can say is, under the specific flavour of linux specified (And I can't remember which one that is, and don't feel like going looking!) everything builds correctly.  But, due to the 'roll your own' nature of said OS, who knows?

  • Like 1
Link to comment
Share on other sites

5 minutes ago, CyranoJ said:

 

Neither myself or Sporadic use Linux or macs, so support there is limited. All I can say is, under the specific flavour of linux specified (And I can't remember which one that is, and don't feel like going looking!) everything builds correctly.  But, due to the 'roll your own' nature of said OS, who knows?

i thought it might be something like that , thanks for taking the time to answer (that was fast btw) ... i'll see if i can find the flavor specified (personally im using linux Mint the latest version w/ cinnamon b/c thats my fav desktop environment with the superfast switching between everything running) and if i can dig up an old drive or a cheap one to get another dedicated partition to boot from

 

thx !!! its a great thing id never had started on the machine Ctulhu built if it werent for this "readable basic" version

Link to comment
Share on other sites

I use (for example) ;

 

Function functionname(variable as integer)

Blah blah

Function = result

End Function

 

Call it with;

functionresult = functionname(10)

 

And

 

SUB subname(variable as integer)

Blah blah

END SUB

 

Call it with;

 

CALL subname(10)

 

  • Like 1
Link to comment
Share on other sites

On 6/25/2024 at 5:37 AM, Syntax Error said:

at the moment im wrestling with the fact that i cant seem to use ROM on linux and i have to compile the thing on windows (even the examples dont work on linux when compiled, also not when compiled with ROM option but they seem to do on windows which is a drag b/c im used to cinnamon desktop and usa-dos is a bit of a one-screen mess to me) , thanks for answering, when i have like 5 or more levels that actually run i'll make a post about the game tho i doubt i'll be entering jagjam or something it'l be on itch (for free or donate coffees) when ready

I build and run on a recent mac. Not unlike Linux, but I can confirm that THAT much works just fine. Most problems I have (all) are pretty much my own...

  • Like 1
Link to comment
Share on other sites

On 6/28/2024 at 10:41 PM, lwdallas said:

I build and run on a recent mac. Not unlike Linux, but I can confirm that THAT much works just fine. Most problems I have (all) are pretty much my own...

no idea what problems are my own , i download the pack, run the build.sh as documented and "out of the box" thats what i get

 

its not like i cant work with it, i just have to move to a windos partition to use the ROM section, as one of the devs mentioned it works fine on the linux version they wrote the linux version on 😛 ... i dont expect anyone to put aside their daily lives to cater to an ethnic minority lol just adding my 2 cents

 

this is what i got after a few weeks im sure i'll get to the point where i can do my shmup - its nostalgia b/c im a rare alien being who owned one back then i dont expect to make a ferrari with it hahah ...

 

if anyone has experience with using it on linux otherwise im very much interested in reading about it, anything at all , otherwise im always looking out for snippets and includeable functions thanks in advance and enjoy the summer

 

  • Like 2
Link to comment
Share on other sites

  • 3 weeks later...
On 7/1/2024 at 3:43 AM, SlidellMan said:

Judging from the video, you are off to a decent start. By the way, what kind of Shmup are you making for the Jaguar?

o dear ... i wouldnt wanna say "making" yet - id first like to port Oggy ( https://janesondergrond.art/galmeetsdemo/pages/phaser-game-OGA%20is%20the%20new%20crack%20v0.01/ ) , a browser / phaser game from 2019 (so it says , im not too good with pinpointing in time) to get the ropes down as its a "simple" one screen-style coin collect platformer with very few assets i thought it was a good way to start, after all its new, and even the basic version of Jag its still a jag (lol ... ) i dont think id ever considered trying it if it werent for JS which i discoverd now a few months ago . SO without roadmaps or deadlines (also somewhat on a c64 easyflash game) , when Oggy is presentable for a public post i was thinking something along the lines of SJA soul force on the c64, i kinda like that one a lot in the neo-retro post 2020 batch and seeing as the jag holds more horizontal than it does vertical i also thought a horizontal shump would be better (theres no "plan" or anything however) just i like the way soul force goes with the little story plot and the avatar-comm giving you the lowdown before each level.

As a guideline (to finally answer, we are very well aware i dawdle and drift all the time) id say "soul force" ( https://www.lemon64.com/game/soul-force )

 

Maybe this still reaches you , im a very bad forum person who checks when it happens and even worse at discording , it IS great to see so many titles for the jag (i had no idea really) and the yearly homebrew awards somewhere on the forum here. If Atari knew that they might have open-sourced the JaG on week two lol .

 

Do not underestimate  the power of the bedroom-coder 😅

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