Jump to content
IGNORED

Zyx game collection #1


Recommended Posts

Fixed a whole bunch of stuff that was wrong with the previous version. It just irks me that I have to do weird stuff in order for stuff to work. For example, in the running zyx game (the one that scrolls), I had to put two bananas in the game even though one will appear because the list apparently expects there to be a banana picture in level 1. And then I can proceed normally, which means the second picture that scrolls in is in level 2, Zyx is in level 3, and so on. It says that you can have 15 separate lists. I'm up to five (0-4).

Link to comment
Share on other sites

2 hours ago, atari2600land said:

Fixed a whole bunch of stuff that was wrong with the previous version. It just irks me that I have to do weird stuff in order for stuff to work. For example, in the running zyx game (the one that scrolls), I had to put two bananas in the game even though one will appear because the list apparently expects there to be a banana picture in level 1. And then I can proceed normally, which means the second picture that scrolls in is in level 2, Zyx is in level 3, and so on. It says that you can have 15 separate lists. I'm up to five (0-4).

 

I quite literally have no idea what you are talking about.

Link to comment
Share on other sites

1 minute ago, atari2600land said:

I was just releasing my anger. Not really expecting people to want to help.

 

All your "Why is this so hard?" whining might put other people off.

All your "The Jaguar can't render trees!" whining makes you look like an idiot.

 

If you need help, ask - Someone will help.  But please, post code and cut to the point.

Link to comment
Share on other sites

Let him go.  He won't ask for help he won't read the instructions then kicks and screams. It's a bad mindset to not read instructions or bitch about bugs constantly. Take care of business or go away IMO. Others who don't know better hop in and think wow that's a messed up system to get tangled with. And then maybe don't try. It's like bad press. Let the bad press go away. Go program for the N64. 

 

You don't see guys like Sporadic doing this. They just take care of business. 

Link to comment
Share on other sites

I am continuing work on this.

I am sorry that I had been complaining and whining a lot about stuff in the past. It just got me so frustrated and I needed to vent. I still don't know how what I did made it work any better, but it did and everything works now, so I don't really need help at the moment.

All that I see on tutorials is the ones that came downloaded with Raptor, if there are any more, please let me know of them, as the ones that are included are kind of sparse.

And if you ever see me complaining and actually would like to help, please let it be known that I will put everything I am having trouble with on my webpage in my signature.

Sorry for all my troubles.

Link to comment
Share on other sites

I'm trying to make a timer for one of my games. Here is my code for displaying the timer.


    if game=4 then
    RLOCATE 10,16
    basic_r_size=0
    basic_r_indx=0
    print " time:               "
    
    if seconds<10 then
    RLOCATE 10,25
    print minutes,":0",seconds,".",tenthseconds
    end if

    if seconds>9 then
    RLOCATE 10,25
    print minutes,":",seconds,".",tenthseconds
    end if
   
    end if

(I put the 0 in front of the seconds because it won't display it otherwise.)

But if I use this code, I get this:

timeproblem.png

There are gaps between the second's tenth and ones digit, as well as a gap between the decimal point and tenths of a second. My question is can I get rid of those gaps, and if so, how?

If you need some stuff to download, check http://www.atari2600land.com/zyx/ and the code I posted begins at line 795.

  • Like 1
Link to comment
Share on other sites

Right, first of all let me just say that string handling in rb+ has always been a bit problematic (and broken, let's not mince words here).

 

You see the extra space in your print statement because of number-to-string conversion. If you read the bcx help file for str$ it is mentioned that

Note well that a space is prepended to the returned string if the number is positive. This space is actually a part of the number and is the location of the sign. When it's a negative number, there will be a minus there and when it's a positive number, it'll be blank.

So that's what you see there.

 

How to overcome this? Well, it's a bit complicated but doable of course. Before trying my suggestions you should download the latest rb+ from github as today I've pushed some fixes regarding all this.

 

After the update you can try the following code:

 


dim seconds as float

seconds=0.01

dim st$

rlocate 30,30

 

do

vsync

st$=str$(seconds)

print mid$(st$,2,2)

seconds=seconds+0.01

if seconds>=1 then

seconds=seconds-1

endif
loop

 

If all goes well you will see a 2 digit number counting to 99 and then going back to 00 again. It works by placing the two digits we want to the decimal places of a floating point number, converts that to string and takes the 3th and 4th digit from that (i.e. omit the "0." part of the string). There is also a protection of resetting the number going above 1, because if the number reaches 10, we would have to then take the 4th and 5th digit.

 

Anyway, hope this helps!

Link to comment
Share on other sites

Using floating point for this is a bit dangerous because of potential rounding issues. You can achieve the same result using integers:

dim seconds as integer

seconds=1

dim st$

rlocate 30,30

do

vsync

st$=str$(seconds+100)

print mid$(st$,3,2)

seconds=seconds+1

if seconds>=100 then

seconds=seconds-100

endif
loop

(can't test it right now, but it should work)

Link to comment
Share on other sites

I tried both of your code snippets and got this in the build.log file:

Linking things...
UNRESOLVED SYMBOLS
    __sig_handler (libc.a:write.o)
    ___open_stat (libc.a:write.o)
    ___mint (libc.a:write.o)
    ___mint (libc.a:access.o)
    ___has_no_ssystem (libc.a:ioctl.o)
    ___funcs (libc.a:ioctl.o)
    ___fonts (libc.a:ioctl.o)
    ___aline (libc.a:ioctl.o)
    ___open_stat (libc.a:ioctl.o)
    ___mint (libc.a:ioctl.o)
    __rootdir (libc.a:unx2dos.o)
    ___mint (libc.a:unx2dos.o)
    ___mint (libc.a:getuid.o)
    ___open_stat (libc.a:open.o)
    ___mint (libc.a:open.o)
    ___mint (libc.a:isctty.o)
    __base (libc.a:getpid.o)
    __sigpending (libc.a:kill.o)
    __sigmask (libc.a:kill.o)
    __sig_handler (libc.a:kill.o)
    ___mint (libc.a:read.o)
    ___open_stat (libc.a:read.o)
    ___open_stat (libc.a:close.o)
    _environ (libc.a:getenv.o)
    ___open_stat (libc.a:isatty.o)
    ___mint (libc.a:globals.o)
    __pdomain (libc.a:globals.o)
    __rootdir (libc.a:globals.o)
    __starttime (libc.a:globals.o)
    __childtime (libc.a:globals.o)
    __at_exit (libc.a:globals.o)
    __num_at_exit (libc.a:globals.o)
    ___has_no_ssystem (libc.a:globals.o)
    __base (libc.a:globals.o)
    _environ (libc.a:globals.o)
    __PgmSize (libc.a:globals.o)
    __exit_dummy_decl (libc.a:globals.o)
    ___mint (libc.a:do_fstat.o)
    ___open_stat (libc.a:dup2.o)
    __at_exit (libc.a:exit.o)
    __num_at_exit (libc.a:exit.o)
    ___printf_arginfo_table (libc.a:vfprintf.o)
    ___printf_function_table (libc.a:vfprintf.o)
Build error!

Link to comment
Share on other sites

What I did was replace the code posted in post #38 with this:


    if game=4 then
    RLOCATE 10,16
    basic_r_size=0
    basic_r_indx=0
    print " time:               "
    
    dim st$
    rlocate 30,30    
    st$=str$(seconds+100)
    print mid$(st$,3,2)
    seconds++
    if seconds>5 then seconds=0
    end if

And it gave me the following build.log file.

build.log

Link to comment
Share on other sites

15 hours ago, atari2600land said:

I tried both of your code snippets and got this in the build.log file:

 


Linking things...
UNRESOLVED SYMBOLS
    __sig_handler (libc.a:write.o)
    ___open_stat (libc.a:write.o)
    ___mint (libc.a:write.o)
    ___mint (libc.a:access.o)
    ___has_no_ssystem (libc.a:ioctl.o)
    ___funcs (libc.a:ioctl.o)
    ___fonts (libc.a:ioctl.o)
    ___aline (libc.a:ioctl.o)
    ___open_stat (libc.a:ioctl.o)
    ___mint (libc.a:ioctl.o)
    __rootdir (libc.a:unx2dos.o)
    ___mint (libc.a:unx2dos.o)
    ___mint (libc.a:getuid.o)
    ___open_stat (libc.a:open.o)
    ___mint (libc.a:open.o)
    ___mint (libc.a:isctty.o)
    __base (libc.a:getpid.o)
    __sigpending (libc.a:kill.o)
    __sigmask (libc.a:kill.o)
    __sig_handler (libc.a:kill.o)
    ___mint (libc.a:read.o)
    ___open_stat (libc.a:read.o)
    ___open_stat (libc.a:close.o)
    _environ (libc.a:getenv.o)
    ___open_stat (libc.a:isatty.o)
    ___mint (libc.a:globals.o)
    __pdomain (libc.a:globals.o)
    __rootdir (libc.a:globals.o)
    __starttime (libc.a:globals.o)
    __childtime (libc.a:globals.o)
    __at_exit (libc.a:globals.o)
    __num_at_exit (libc.a:globals.o)
    ___has_no_ssystem (libc.a:globals.o)
    __base (libc.a:globals.o)
    _environ (libc.a:globals.o)
    __PgmSize (libc.a:globals.o)
    __exit_dummy_decl (libc.a:globals.o)
    ___mint (libc.a:do_fstat.o)
    ___open_stat (libc.a:dup2.o)
    __at_exit (libc.a:exit.o)
    __num_at_exit (libc.a:exit.o)
    ___printf_arginfo_table (libc.a:vfprintf.o)
    ___printf_function_table (libc.a:vfprintf.o)
Build error!

 

Sorry, I can't reproduce that here locally. To be clear:

 

  • I downloaded a full archive from https://github.com/ggnkua/bcx-basic-Jaguar (pushed 'clone or download' button, chose 'download zip').
  • I unpacked the zip somewhere on the hard drive
  • opened a command prompt at the root of the unpacked zip location
  • I typed "build testproj new"
  • I opened projects\testproj\testproj.bas
  • I edited the file and pasted the sample code from reply #39 and saved
  • I typed "build testproj" on the command prompt
  • Everything built and virtualjaguar came up

I really can't imagine what went wrong with you there, it seems like some library is missing or truncated (=corrupt). Try again using the steps I outlined above and let us know what happens.

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