Jump to content

Photo

IntyBASIC v1.4.0 call for testers

IntyBASIC Compiler BASIC Intellivision

32 replies to this topic

#1 nanochess OFFLINE  

nanochess

    Processorus Polyglotus

  • 5,734 posts
  • Coding something good
  • Location:Mexico City

Posted Fri Dec 28, 2018 4:01 PM

Hi all.

I'm about to release officially IntyBASIC v1.4.0 with new features, corrections and enhancements.

But before doing it "officially" I need your help to check if your current programs compile with this new version of compiler and post here with your OK.

I've been careful but I'm trying not to release version after version because small bugs ;)

Thanks!

Edit: for some reason I couldn't upload the ZIP here, so find it here https://github.com/n...eases/tag/1.4.0

o Tracker allows playing 8 channels of music (using ECS PSG)
o Now detects failure of flow control when using GOTO to jump wrongly between procedures.
o Detects wrong flow of control (GOTO to PROCEDURE or GOSUB to non-PROCEDURE)
o Name mangling for assembler now uses original names, easing assembler interface.
o Support for local labels (using period character before a label, uses last global label as prefix)
o Added MUSIC GOSUB, MUSIC RETURN, MUSIC VOLUME and MUSIC SPEED.
o Added contrib/accel.bas it shows how to move sprites by fractions of pixel (contributed by intvnut)
o VOICE INIT now "shuts up" the Intellivision (contributed by intvnut) and the initializatin is done in automatic form at start of program.
o FLASH INIT SIZE to choose Flash memory size.
o Allows constants in DATA PACKED.
o Added ON expr FAST to avoid two instructions.
o Generates warnings for AND/OR/XOR and small operators non-parenthesized.
o Now direct CONT1, CONT2, CONT3 and CONT4 generate 8-bit results.
o Solved bug where IF CONT.B0 THEN wouldn't work, also ABS and SGN.
o Compatibility with Tutorvision consoles.

#2 artrag OFFLINE  

artrag

    Stargunner

  • 1,190 posts

Posted Fri Dec 28, 2018 4:28 PM

Going to try!! Thanks for the release!

#3 Tarzilla OFFLINE  

Tarzilla

    River Patroller

  • 2,100 posts
  • Huh?
  • Location:Alberta, Canada

Posted Fri Dec 28, 2018 4:31 PM

Hi all.

I'm about to release officially IntyBASIC v1.4.0 with new features, corrections and enhancements.

But before doing it "officially" I need your help to check if your current programs compile with this new version of compiler and post here with your OK.

I've been careful but I'm trying not to release version after version because small bugs ;)

Thanks!

Edit: for some reason I couldn't upload the ZIP here, so find it here https://github.com/n...eases/tag/1.4.0

o Tracker allows playing 8 channels of music (using ECS PSG)
o Now detects failure of flow control when using GOTO to jump wrongly between procedures.
o Detects wrong flow of control (GOTO to PROCEDURE or GOSUB to non-PROCEDURE)
o Name mangling for assembler now uses original names, easing assembler interface.
o Support for local labels (using period character before a label, uses last global label as prefix)
o Added MUSIC GOSUB, MUSIC RETURN, MUSIC VOLUME and MUSIC SPEED.
o Added contrib/accel.bas it shows how to move sprites by fractions of pixel (contributed by intvnut)
o VOICE INIT now "shuts up" the Intellivision (contributed by intvnut) and the initializatin is done in automatic form at start of program.
o FLASH INIT SIZE to choose Flash memory size.
o Allows constants in DATA PACKED.
o Added ON expr FAST to avoid two instructions.
o Generates warnings for AND/OR/XOR and small operators non-parenthesized.
o Now direct CONT1, CONT2, CONT3 and CONT4 generate 8-bit results.
o Solved bug where IF CONT.B0 THEN wouldn't work, also ABS and SGN.
o Compatibility with Tutorvision consoles.

Perfect timing! I have a bunch of things to test with. Thanks!



#4 nanochess OFFLINE  

nanochess

    Processorus Polyglotus

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

Posted Fri Dec 28, 2018 5:43 PM

Forgot to say the ECS player consumes more processor cycles, so you can only define 12 GRAM per frame. IntyColor includes a new flag to choose total number of GRAM defined per frame.

#5 blainelocklair OFFLINE  

blainelocklair

    Chopper Commander

  • 234 posts
  • Location:Summerville, SC

Posted Fri Dec 28, 2018 7:17 PM

Thanks for posting this up! I have downloaded it and will compile some programs, including my current project, with it. I'll also add some ECS music to it to see how it performs within the project.

 

- Blaine



#6 digress OFFLINE  

digress

    Stargunner

  • 1,104 posts
  • Location:Toronto, Ontario, Canada

Posted Fri Dec 28, 2018 7:21 PM

I compiled boothill with no issues under 1.4 intybasic. thumbs up

;-)



#7 Lathe26 OFFLINE  

Lathe26

    River Patroller

  • 3,799 posts

Posted Sat Dec 29, 2018 1:26 PM

I hope to test the new release out in the next few days.



#8 artrag OFFLINE  

artrag

    Stargunner

  • 1,190 posts

Posted Sat Dec 29, 2018 1:35 PM

The new warnings/errors are quite interesting.

I have a case to report.

 

I get:

Error: GOTO ACTIVATE_BONUS from procedure INACTIVE flows inside main code (stack disruption)

 

For this code:


		
inactive: procedure
		resetsprite(n+4)
		
		' do not respawn if in boss mode
		if (enter_boss_mode) then return
		
		if (activate_bonus)	then goto activate_bonus
		
		' Respawn a new enemy
		e_time(n) = e_time(n) - 1
		
		if	(e_time(n) = 0) then 
			e_state(n) = e_active
			e_substate(n) = 0
			
			if ((frame and 3)=0) then 
				e_type(n) = enemy_type xor 1	'random(max_enemy_type+1)		'PRINT AT 11*20+0	COLOR 2,<3> e_type(n)
			else 
				e_type(n) = enemy_type			'PRINT AT 11*20+0	COLOR 5,<3> e_type(n)
			end if

			
			on  (e_type(n))  goto 	phi_rand_back,\
									phi_rand,\
									phi_rand,\
									my_phi,\
									phi_rand,\
									phi_rand,\
									my_phi_backa,\
									my_phi_backb
phi_rand:
			p(n) =  random(two_pi+1)
			return
my_phi_backa:
			e_time(n) = 127
			p(n) = (ms_p + 64 + random((two_pi+1)/8)) and two_pi
			return			
my_phi_backb:
			e_time(n) = 127
			p(n) = (ms_p - 64 - random((two_pi+1)/8)) and two_pi
			return			
my_phi:		
			p(n) = (ms_p - 32 + random(64)) and two_pi
			return
phi_rand_back:
			e_time(n) = 127
			p(n) =  ms_p + 128 - (two_pi+1)/16 + random((two_pi+1)/8)
			return
		end if

	end


''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'	Bonus
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
	const b_frame = 15
	
activate_bonus:
	e_state(n) = b_active
	e_type(n) = activate_bonus-1				' Bonus type	
	activate_bonus = 0
	e_time(n) = 0
	p(n) =  random(two_pi+1)
	return

Do I really corrupt the stack?



#9 artrag OFFLINE  

artrag

    Stargunner

  • 1,190 posts

Posted Sat Dec 29, 2018 2:32 PM

Forgot to say the ECS player consumes more processor cycles, so you can only define 12 GRAM per frame. IntyColor includes a new flag to choose total number of GRAM defined per frame.

 

 

Maybe a dummy question: why don't you run the music player after all the I/O in the vertical border has been completed?

In this way you can use all the border time for GRAM access (maybe at cost of small jitters in the note duration)



#10 DZ-Jay OFFLINE  

DZ-Jay

    Quadrunner

  • 11,966 posts
  • The P-Machinery AGE is almost here!
  • Location:NC, USA

Posted Sat Dec 29, 2018 2:47 PM

Do I really corrupt the stack?

 

Well, for practical purposes, yes, since the compiler is not smart enough to tell that you are returning properly from the outside branch.  All it knows is that you branched out of a subroutine, and therefore cannot guarantee the integrity of the stack.

 

In your case, you can safely ignore the warning.  However, it is "unclean" and I wouldn't recommend it.

 

If you really want the branch, why not include it within the subroutine, at the end, and just return before it?  If it's a block of code accessed from multiple places, perhaps it'll be best to wrap it as a subroutine and call it with GOSUB everywhere.

 

    -dZ.


Edited by DZ-Jay, Sat Dec 29, 2018 2:52 PM.


#11 DZ-Jay OFFLINE  

DZ-Jay

    Quadrunner

  • 11,966 posts
  • The P-Machinery AGE is almost here!
  • Location:NC, USA

Posted Sat Dec 29, 2018 2:49 PM

 

 

Maybe a dummy question: why don't you run the music player after all the I/O in the vertical border has been completed?

In this way you can use all the border time for GRAM access (maybe at cost of small jitters in the note duration)

 

Or run the tracker outside the context of the ISR, like we do in assembly programs.  The extra PSG management does not come for free, so playing 6 channels will always incur some cost in processing; but it should not be at the expense of GRAM and STIC handling.

 

    -dZ.



#12 nanochess OFFLINE  

nanochess

    Processorus Polyglotus

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

Posted Sat Dec 29, 2018 2:55 PM

The new warnings/errors are quite interesting.
I have a case to report.
 
I get:
Error: GOTO ACTIVATE_BONUS from procedure INACTIVE flows inside main code (stack disruption)
 
Do I really corrupt the stack?


You put the RETURN in the right place but the compiler cannot know that, your code is in the outside! So better to stay in the safe side ;)

In fact your RETURN statement should've already generating an error of RETURN without PROCEDURE.

#13 nanochess OFFLINE  

nanochess

    Processorus Polyglotus

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

Posted Sat Dec 29, 2018 2:56 PM

Maybe a dummy question: why don't you run the music player after all the I/O in the vertical border has been completed?
In this way you can use all the border time for GRAM access (maybe at cost of small jitters in the note duration)


I'm afraid my trained ear can notice it. But I'll try to optimize before release.

#14 DZ-Jay OFFLINE  

DZ-Jay

    Quadrunner

  • 11,966 posts
  • The P-Machinery AGE is almost here!
  • Location:NC, USA

Posted Sat Dec 29, 2018 3:43 PM

I'm afraid my trained ear can notice it. But I'll try to optimize before release.

 

Couldn't you run the tracker right after the VBLANK-critical code (before returning control to the program)?  That way, you can guarantee that the tracker runs within the engine cycle at the expense of delaying the game code.  Your trained ears would be kept at ease. :)

 

If the game code is too long between frames it already gets delayed anyway, so there was never a guarantee that the game code would run within a single frame.  This gives the programmer an incentive to optimize his game code, which he has full control over.  That is, rather than reducing the GRAM copy cycle (and thus, limiting the potential for animations and such), which is something the programmer has absolutely no control over.

 

   -dZ.


Edited by DZ-Jay, Sat Dec 29, 2018 3:46 PM.


#15 carlsson ONLINE  

carlsson

    Metagalactic Mule

  • 8,294 posts
  • Location:Västerås, Sweden

Posted Sat Dec 29, 2018 3:47 PM

o Solved bug where IF CONT.B0 THEN wouldn't work, also ABS and SGN.


I don't know what this is supposed to mean, but IMHO ABS still is broken though I know you don't agree with me so I have learned to live with it and make workarounds.

Otherwise, some of my most recent programs compile and run without issues. I didn't try any of the new features though, which perhaps is most important to test before making a final release.

#16 artrag OFFLINE  

artrag

    Stargunner

  • 1,190 posts

Posted Sat Dec 29, 2018 4:08 PM

I'm afraid my trained ear can notice it. But I'll try to optimize before release.


At the end of the current frame, you can compute and store the psg values in ram and write them to the psg at the beginning of the next frame. It will cost ram but it will minimize the time lost during the border time.

#17 DZ-Jay OFFLINE  

DZ-Jay

    Quadrunner

  • 11,966 posts
  • The P-Machinery AGE is almost here!
  • Location:NC, USA

Posted Sat Dec 29, 2018 4:24 PM

At the end of the current frame, you can compute and store the psg values in ram and write them to the psg at the beginning of the next frame. It will cost ram but it will minimize the time lost during the border time.

 

Unlike the STIC, there is no requirement to reserve PSG updates to the VBLANK period -- the only requirement is to update it periodically, once per frame to maintain the music's temporal integrity.  Therefore, I don't really think it matters when in the frame it's updated as long as it is updated once and roughly at the same point every time.

 

I don't really understand why it needs to be at the top of the ISR rather than at the bottom, and I don't really understand why the tracker's processing has an impact on GRAM updates.  I do not think this is necessary.  In fact, I think it's disingenuous because in IntyBASIC, GRAM updates is a feature for which the programmer has little control, and it is also critically time-bound to the VBLANK period.

 

In my mind, if the programmer is given the option to use fully the GRAM capabilities (i.e., copying 16 cards per frame), and to use fully the music tracker capabilities (i.e., 6 tracker channels), and his game loop is too slow to run at 60 Hz; it is absolutely under his control to either reduce GRAM use, reduce music channel use, optimize his code, or reduce the frame-rate of his game loop.

 

It is my opinion that limiting either feature takes away this power from the programmer's hands.

 

    -dZ.


Edited by DZ-Jay, Sat Dec 29, 2018 4:26 PM.


#18 artrag OFFLINE  

artrag

    Stargunner

  • 1,190 posts

Posted Sat Dec 29, 2018 4:25 PM

One word: jitter

#19 DZ-Jay OFFLINE  

DZ-Jay

    Quadrunner

  • 11,966 posts
  • The P-Machinery AGE is almost here!
  • Location:NC, USA

Posted Sat Dec 29, 2018 4:26 PM

One word: jitter

 

???  The PSG does not need to be updated before GRAM, so there is no need for it to have an impact on it at all.



#20 artrag OFFLINE  

artrag

    Stargunner

  • 1,190 posts

Posted Sat Dec 29, 2018 4:31 PM

 
???  The PSG does not need to be updated before GRAM, so there is no need for it to have an impact on it at all.


A trained ear can notice that the length of the notes varies according to the time taken by the gram update.
If you update the psg always at the same time in the frame there will be no jitter

#21 artrag OFFLINE  

artrag

    Stargunner

  • 1,190 posts

Posted Sat Dec 29, 2018 4:48 PM

Anyway for my untrained hear the result depends case by case.

#22 DZ-Jay OFFLINE  

DZ-Jay

    Quadrunner

  • 11,966 posts
  • The P-Machinery AGE is almost here!
  • Location:NC, USA

Posted Sat Dec 29, 2018 4:59 PM

A trained ear can notice that the length of the notes varies according to the time taken by the gram update.
If you update the psg always at the same time in the frame there will be no jitter


I understand that, and I experience it myself sometimes (I was a Dj for many years, so I have an ear that notices small timing differences in sounds). However, I insist that the difference in the few cycles it takes to process GRAM before will not make a noticeable difference, as long as the period is mostly stable.

Take a look at older games and see if you notice any jitter in the music. Most of the older assembly language games, especially those by Arnauld, Joe Z., and Carl, which use music considerably, typically update outside the ISR context, but at a mostly stable period.

In my opinion, the trick is to update the PSG at roughly the same point in the engine and make the period predictable to the ear. Psychoacoustics will take care of the rest.

dZ.

#23 DZ-Jay OFFLINE  

DZ-Jay

    Quadrunner

  • 11,966 posts
  • The P-Machinery AGE is almost here!
  • Location:NC, USA

Posted Sat Dec 29, 2018 5:12 PM

Heres some info:
https://en.m.wikiped...on_applications
https://sound.stacke...f-human-hearing

#24 artrag OFFLINE  

artrag

    Stargunner

  • 1,190 posts

Posted Sat Dec 29, 2018 5:49 PM

The generated code is slightly more efficient, as now you support R1 in ADDI while in previous version you had mainly R0 

 
 


#25 nanochess OFFLINE  

nanochess

    Processorus Polyglotus

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

Posted Sat Dec 29, 2018 9:32 PM


The generated code is slightly more efficient, as now you support R1 in ADDI while in previous version you had mainly R0 
 

 


Indeed there is more optimization required by my work on the recent Elektronite games and some of the issues you brought in my Github.





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

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users