Jump to content

Photo

IntyBASIC compiler v1.2.9: The good things are now better!

Intellivision IntyBASIC

361 replies to this topic

#276 freewheel OFFLINE  

freewheel

    River Patroller

  • 3,064 posts

Posted Sun Jan 7, 2018 9:04 PM

Just wanted to say thanks again for the add-on hardware detection that's been coded up and/or added to IntyBASIC this year. You've made my life a lot easier. First Spear's comment about IF... THEN made me realize that I'm probably writing the most complicated/involved code about this that anyone's likely to ever bother with.

 

Oops. I've said too much. :P



#277 wolfy62 OFFLINE  

wolfy62

    River Patroller

  • 3,018 posts
  • Location:Simi Valley, CA

Posted Mon Jan 8, 2018 6:22 PM

Just wanted to say thanks again for the add-on hardware detection that's been coded up and/or added to IntyBASIC this year. You've made my life a lot easier. First Spear's comment about IF... THEN made me realize that I'm probably writing the most complicated/involved code about this that anyone's likely to ever bother with.

 

Oops. I've said too much. :P

Best of luck with this i am sure you will do great! :thumbsup:



#278 freewheel OFFLINE  

freewheel

    River Patroller

  • 3,064 posts

Posted Mon Jan 8, 2018 6:33 PM

Oscar, did the NTSC constant get broken in a recent release? I have the world's simplest program:

loop:
      PRINT AT 0,<3>NTSC
      GOTO loop

It displays 001 even when I use -P or --pal in the latest jzintv. Or is jzintv broken? :)



#279 nanochess ONLINE  

nanochess

    Processorus Polyglotus

  • Topic Starter
  • 5,391 posts
  • Coding something good
  • Location:Mexico City

Posted Mon Jan 8, 2018 7:38 PM

Oscar, did the NTSC constant get broken in a recent release? I have the world's simplest program:

loop:
      PRINT AT 0,<3>NTSC
      GOTO loop
It displays 001 even when I use -P or --pal in the latest jzintv. Or is jzintv broken? :)

Ouch! I'll check soon

#280 freewheel OFFLINE  

freewheel

    River Patroller

  • 3,064 posts

Posted Mon Jan 8, 2018 7:47 PM

Ouch! I'll check soon

 

OK, confirmed, it's IntyBASIC. I grabbed some older code compiled with IntyBASIC from about a year ago, and it works fine with the latest jzintv. When I compile with 1.2.9, it doesn't work.

 

I looked in the prologue and didn't see any changes there, but I honestly don't know what you're doing for this so I'm no help :P



#281 nanochess ONLINE  

nanochess

    Processorus Polyglotus

  • Topic Starter
  • 5,391 posts
  • Coding something good
  • Location:Mexico City

Posted Mon Jan 8, 2018 8:45 PM

OK, confirmed, it's IntyBASIC. I grabbed some older code compiled with IntyBASIC from about a year ago, and it works fine with the latest jzintv. When I compile with 1.2.9, it doesn't work.
 
I looked in the prologue and didn't see any changes there, but I honestly don't know what you're doing for this so I'm no help :P


I'm not sure how it happened, but the value returned for the comparison of PAL mode is different. (using IntyBASIC v1.2.9 and latest jzintv 2018)

It's now $01bb for NTSC and $01f9 for PAL, so you should replace CMPI #520,R2 with CMPI #$01DB,R2 in intybasic_prologue.asm and it will work.

I'll account for this in future releases.



#282 freewheel OFFLINE  

freewheel

    River Patroller

  • 3,064 posts

Posted Mon Jan 8, 2018 8:55 PM

It's now $01bb for NTSC and $01f9 for PAL, so you should replace CMPI #520,R2 with CMPI #$01DB,R2 in intybasic_prologue.asm and it will work.

I'll account for this in future releases.

 

Thanks, that did the trick! This isn't going to break anything else, is it? :) Why would earlier IntyBASIC work with the previous value? Something else in the prologue that you changed I guess?

 

Edit: I just diff'd 1.2.8 and 1.2.9. The only change you made was the MEMSET acceleration. You're not touching R2 in there, but I won't pretend to follow all the register juggling here.



#283 nanochess ONLINE  

nanochess

    Processorus Polyglotus

  • Topic Starter
  • 5,391 posts
  • Coding something good
  • Location:Mexico City

Posted Mon Jan 8, 2018 9:02 PM

 

Thanks, that did the trick! This isn't going to break anything else, is it? :) Why would earlier IntyBASIC work with the previous value? Something else in the prologue that you changed I guess?

 

Edit: I just diff'd 1.2.8 and 1.2.9. The only change you made was the MEMSET acceleration. You're not touching R2 in there, but I won't pretend to follow all the register juggling here.

 

I think jzintv is now more exact in the cycle counting for PAL. I don't remind modifying anything in intybasic_prologue.asm.



#284 freewheel OFFLINE  

freewheel

    River Patroller

  • 3,064 posts

Posted Mon Jan 8, 2018 9:09 PM

 

I think jzintv is now more exact in the cycle counting for PAL. I don't remind modifying anything in intybasic_prologue.asm.

 

OK, on further analysis...

 

You also added a CALL CLRSCR to MAIN0. Interestingly, if I comment that out, the old value works. However, if I revert MEMSET to the 1.2.8 version, it also works with the old value. Something with these changes is what caused the problem. I don't understand nearly enough to know why.

 

Edit: Also, I noticed something. When I'm using jzintv in PAL mode, I very quickly see the Mattel EXEC titlescreen when I reset. I'm not sure if it always did that before, but thought I'd mention it.



#285 DZ-Jay OFFLINE  

DZ-Jay

    Quadrunner

  • 10,735 posts
  • Triple-Stripe Mo' Bro
  • Location:NC, USA

Posted Tue Jan 9, 2018 4:25 AM

I'm not sure how it happened, but the value returned for the comparison of PAL mode is different. (using IntyBASIC v1.2.9 and latest jzintv 2018)

It's now $01bb for NTSC and $01f9 for PAL, so you should replace CMPI #520,R2 with CMPI #$01DB,R2 in intybasic_prologue.asm and it will work.

I'll account for this in future releases.

 

Would it be useful if instead of returning the counter value, you return a flag say like "TVMODE = 0" for NTSC and "TVMODE = 1" for PAL?

 

This is similar to what I do in P-Machinery.  I think it is safer that way because although the actual hardware is purely deterministic, the emulator may not exactly match its timing.  Also, any changes to the internal algorithm may affect the ultimate value.

 

Ultimately, what the programmer is interested in know is whether it is running in NTSC or PAL.  The exact method of measuring, the cycle difference, etc. are not significant and should be abstracted.

 

   -dZ.



#286 DZ-Jay OFFLINE  

DZ-Jay

    Quadrunner

  • 10,735 posts
  • Triple-Stripe Mo' Bro
  • Location:NC, USA

Posted Tue Jan 9, 2018 4:33 AM

 

OK, on further analysis...

 

You also added a CALL CLRSCR to MAIN0. Interestingly, if I comment that out, the old value works. However, if I revert MEMSET to the 1.2.8 version, it also works with the old value. Something with these changes is what caused the problem. I don't understand nearly enough to know why.

 

Edit: Also, I noticed something. When I'm using jzintv in PAL mode, I very quickly see the Mattel EXEC titlescreen when I reset. I'm not sure if it always did that before, but thought I'd mention it.

 

Further on this, perhaps it's time we all extirpate the EXEC boot sequence completely.  I just took the plunge last week-end with P-Machinery:  hooking up at the PlayCable monitor in location $4800, hijacking the initial minimal EXEC sequence.  At that point, I do all my normal start-up, but I first start by clearing all memory and resetting all devices (PSG, STIC, BACKTAB, etc.).

 

Now I see a lot less flickering and color changing when I start up or reset the emulator, including no more occasional appearances of the Mattel title screen.  It looks a lot more stable, since I keep interrupts disabled and the display inactive throughout.

 

I would even recommend intvnut to add this to CART.MAC in a future update to the SDK-1600 (or I can make a patch for it).

 

It's time to take the training wheels off.  Buh-bye EXEC. :)

 

    -dZ.



#287 nanochess ONLINE  

nanochess

    Processorus Polyglotus

  • Topic Starter
  • 5,391 posts
  • Coding something good
  • Location:Mexico City

Posted Tue Jan 9, 2018 9:49 AM

Actually is only the comparison before setting the value for the programmer, only needs to check the special variable NTSC.

On the other side, I'll add a note in documentation that you can avoid the EXEC entirely using a single statement at start of your program:

SOUND 9,,$38

This will enable ECS support code and bypass EXEC.

#288 DZ-Jay OFFLINE  

DZ-Jay

    Quadrunner

  • 10,735 posts
  • Triple-Stripe Mo' Bro
  • Location:NC, USA

Posted Wed Jan 10, 2018 4:10 AM

Actually is only the comparison before setting the value for the programmer, only needs to check the special variable NTSC.

On the other side, I'll add a note in documentation that you can avoid the EXEC entirely using a single statement at start of your program:

SOUND 9,,$38

This will enable ECS support code and bypass EXEC.

 

But does it initialize the system or just jumps from there to programmer's code?  The idea is not only to bypass the EXEC, but to replace its boot up sequence.  Otherwise, every program will have to have boiler-plate code to clear the screen and reset the STIC, etc.

 

   -dZ.



#289 nanochess ONLINE  

nanochess

    Processorus Polyglotus

  • Topic Starter
  • 5,391 posts
  • Coding something good
  • Location:Mexico City

Posted Wed Jan 10, 2018 7:52 AM

But does it initialize the system or just jumps from there to programmer's code?  The idea is not only to bypass the EXEC, but to replace its boot up sequence.  Otherwise, every program will have to have boiler-plate code to clear the screen and reset the STIC, etc.
 
   -dZ.


It cleans everything, just Yesterday I checked and the only things it doesn't initialize are the scroll offset registers and added the pertaining code.

#290 DZ-Jay OFFLINE  

DZ-Jay

    Quadrunner

  • 10,735 posts
  • Triple-Stripe Mo' Bro
  • Location:NC, USA

Posted Wed Jan 10, 2018 9:54 AM

It cleans everything, just Yesterday I checked and the only things it doesn't initialize are the scroll offset registers and added the pertaining code.

Awesome! :thumbsup:

By the way, I am curious to know if you have a reason not to do this automatically by the prologue.asm. Do you see a use case that needs to keep the EXEC boot sequence?

#291 nanochess ONLINE  

nanochess

    Processorus Polyglotus

  • Topic Starter
  • 5,391 posts
  • Coding something good
  • Location:Mexico City

Posted Wed Jan 10, 2018 10:09 AM

Awesome! :thumbsup:

By the way, I am curious to know if you have a reason not to do this automatically by the prologue.asm. Do you see a use case that needs to keep the EXEC boot sequence?


Just my hard-to-machineness, I still want be able to make programs using only $5000 to $6fff in case I make my own cart PCB 😅

#292 DZ-Jay OFFLINE  

DZ-Jay

    Quadrunner

  • 10,735 posts
  • Triple-Stripe Mo' Bro
  • Location:NC, USA

Posted Wed Jan 10, 2018 10:26 AM

Just my hard-to-machineness, I still want be able to make programs using only $5000 to $6fff in case I make my own cart PCB 😅


Gotcha. Would it be worth making that the option?

I'm just thinking that a simpler setup and interface for programmers is always better. :)

#293 nanochess ONLINE  

nanochess

    Processorus Polyglotus

  • Topic Starter
  • 5,391 posts
  • Coding something good
  • Location:Mexico City

Posted Wed Jan 10, 2018 12:02 PM

Gotcha. Would it be worth making that the option?

I'm just thinking that a simpler setup and interface for programmers is always better. :)

Yep, it's worth it because in the case of a missing cfg file, the bin still works.

I know. It's kind of crazy. But that is me ;)

#294 DZ-Jay OFFLINE  

DZ-Jay

    Quadrunner

  • 10,735 posts
  • Triple-Stripe Mo' Bro
  • Location:NC, USA

Posted Wed Jan 10, 2018 6:24 PM

Yep, it's worth it because in the case of a missing cfg file, the bin still works.

I know. It's kind of crazy. But that is me ;)

 

LOL!  I meant if it made sense to make the "bypass EXEC" the default behaviour and "use $5000 - $6FFFF" the optional condition -- But yeah, it's your platform, so you do what you think is best. :)

 

  -dZ.



#295 First Spear OFFLINE  

First Spear

    Stargunner

  • 1,251 posts
  • Location:Somewhere in Uptown

Posted Mon Jan 22, 2018 2:59 PM

Should that now be set as mandatory for all "normal" IntyBASIC programs? Enable the ECS just in case it is connected, and always bypass the EXEC since it can never be used?

 

 

 

 

Actually is only the comparison before setting the value for the programmer, only needs to check the special variable NTSC.

On the other side, I'll add a note in documentation that you can avoid the EXEC entirely using a single statement at start of your program:

SOUND 9,,$38

This will enable ECS support code and bypass EXEC.



#296 nanochess ONLINE  

nanochess

    Processorus Polyglotus

  • Topic Starter
  • 5,391 posts
  • Coding something good
  • Location:Mexico City

Posted Mon Jan 22, 2018 3:52 PM

Should that now be set as mandatory for all "normal" IntyBASIC programs? Enable the ECS just in case it is connected, and always bypass the EXEC since it can never be used?

 

 

 

 

 

Now it looks like a good idea. :)



#297 freewheel OFFLINE  

freewheel

    River Patroller

  • 3,064 posts

Posted Tue Jan 23, 2018 8:20 PM

Is there no way to use colored squares mode in IntyBASIC? I don't think I've ever tried it.

 

Oh wait, is it just color stack mode, and you set bit 12 on a card? Does that mean you can mix and match the modes?



#298 nanochess ONLINE  

nanochess

    Processorus Polyglotus

  • Topic Starter
  • 5,391 posts
  • Coding something good
  • Location:Mexico City

Posted Tue Jan 23, 2018 9:24 PM

Is there no way to use colored squares mode in IntyBASIC? I don't think I've ever tried it.

 

Oh wait, is it just color stack mode, and you set bit 12 on a card? Does that mean you can mix and match the modes?

 

Yes, just set color stack mode, set bit 12 and clear bit 11 in card. This means also you don't have access to GROM cards with "high" colors.



#299 freewheel OFFLINE  

freewheel

    River Patroller

  • 3,064 posts

Posted Tue Jan 23, 2018 9:29 PM

 

Yes, just set color stack mode, set bit 12 and clear bit 11 in card. This means also you don't have access to GROM cards with "high" colors.

 

Yeah, I've already had to define my own GRAM cards to do that ;) I just never intentionally tried colored squares before!



#300 DZ-Jay OFFLINE  

DZ-Jay

    Quadrunner

  • 10,735 posts
  • Triple-Stripe Mo' Bro
  • Location:NC, USA

Posted Wed Jan 24, 2018 4:47 AM

Is there no way to use colored squares mode in IntyBASIC? I don't think I've ever tried it.

 

Oh wait, is it just color stack mode, and you set bit 12 on a card? Does that mean you can mix and match the modes?

 

Yes, on both counts:  You can "mix and match" Color Stack and Colored Squares modes.  The reason is that "Colored Squares" is not really a screen mode per se, it's a "mode" on a card in Color Stack.

 

Like nanochess said, this "feature" limits the use of color in GROM cards in Color Stack mode, since setting the "pastel" color bit turns the card into "Colored Square" mode.

 

   -dZ.







Also tagged with one or more of these keywords: Intellivision, IntyBASIC

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users