Jump to content

Photo

Cortex BASIC in 80 Column


83 replies to this topic

#26 Ksarul OFFLINE  

Ksarul

    River Patroller

  • 4,631 posts

Posted Tue Nov 24, 2015 6:17 PM

Omega, did you burn a 512K test chip (using the 512K Type 8 Tursi Bank Test) and put it into the cartridge to see what was going on--that one test will give you ALL of the information I need to figure out how your board is working. . .and if there IS a problem on the hardware side. Everything else you do there will just frustrate you. . .because it won't isolate the issue.



#27 --- Ω --- OFFLINE  

--- Ω ---

    --- Ω ---

  • 12,105 posts
  • Location:워싱턴 주

Posted Tue Nov 24, 2015 6:46 PM

No, I certainly will if you can post the image here or a link to it.  I tried to find it at Tursi's site, but all I got was this...

 

Attached Files

  • Attached File  HL.JPG   57.81KB   2 downloads


#28 Ksarul OFFLINE  

Ksarul

    River Patroller

  • 4,631 posts

Posted Tue Nov 24, 2015 8:10 PM

Tursi put it up in the BIN file thread. . .here's the link.  ;)



#29 --- Ω --- OFFLINE  

--- Ω ---

    --- Ω ---

  • 12,105 posts
  • Location:워싱턴 주

Posted Tue Nov 24, 2015 8:51 PM

Tursi put it up in the BIN file thread. . .here's the link.  ;)

 

Awwwww KerAP... the liknk was right under my nose... in MY thread no less.  Jeeez...... oh well.

 

Okay, here are the results......

Attached Files



#30 jedimatt42 OFFLINE  

jedimatt42

    Stargunner

  • 1,637 posts
  • Location:Beaverton, OR

Posted Tue Nov 24, 2015 11:39 PM

Ok, this worked for me on my red board. Attached is a 512k image that I've created that as long as your ubergrom doesn't boot into bank 2,3 or 4, it should work. I've padded the trailing 60 banks with bank 1 of the cortex 040 image that Stuart posted. 

 

Attached File  CBASIC80_040_512k.zip   24.43KB   20 downloads

 

What I did to create this image was just some unix-fu.

 

first I renamed the JS99... file that was padded to 32k to something I could type... CBASIC80.bin  don't confuse that with the other CBASIC80.bin's in Stuarts original zip... 

 

Then...

 

# copy the first 8k to a separate file

dd if=CBASIC80.bin of=bank1.bin bs=8192 count=1

 

# 'fill' the 1st 4 banks with the original bits (just copying the file)

cp CBASIC80.bin CBASIC80_040.bin

 

# pad the remaining 60 banks (512k/8k == 64; 64 - 4 == 60)

for i in {1..60}; do cat bank1.bin >>CBASIC80_040.bin ; done

 

 



#31 --- Ω --- OFFLINE  

--- Ω ---

    --- Ω ---

  • 12,105 posts
  • Location:워싱턴 주

Posted Wed Nov 25, 2015 12:20 AM

Ok, this worked for me on my red board. Attached is a 512k image that I've created that as long as your ubergrom doesn't boot into bank 2,3 or 4, it should work. I've padded the trailing 60 banks with bank 1 of the cortex 040 image that Stuart posted. 

 

THANK YOU!!!!

Now it'll be on tap for when I need it!  :)

 

sml_gallery_35324_1027_27353.jpg

med_gallery_35324_1027_25668.jpg

 

gallery_35324_1027_13590.jpg



#32 jedimatt42 OFFLINE  

jedimatt42

    Stargunner

  • 1,637 posts
  • Location:Beaverton, OR

Posted Wed Nov 25, 2015 1:06 AM

I of course then wonder, is it time for the battle of the basics ?   Just kidding...    But I can't resist doing a little computation test... 

 

For Cortex Basic computing primes from 1 to 100 with my non-optimized implementation takes 1 minute and 56 seconds.

80  REM TAKES 1:56 ON 4A
90  PRINT 1
100  FOR I=2 TO 100
105   P=0
110   FOR J=2 TO (I-1)
111    D=I/J
112    E=INT[I/J]
120    IF D=E THEN P=1
130   NEXT J
135   IF P=0 THEN PRINT I
140  NEXT I

For extended basic (using xb2.7)  basically the same code took 2 minutes and 31 seconds

100 REM TAKES 2:31 IN XB ON 4A
110 PRINT 1
120 FOR I=2 TO 100
130 P=0
140 FOR J=2 TO (I-1)
150 D=I/J
160 E=INT(I/J)
170 IF D=E THEN P=1
180 NEXT J
190 IF P=0 THEN PRINT I
200 NEXT I



#33 Opry99er OFFLINE  

Opry99er

    Quadrunner

  • 9,724 posts
  • Location:Hustisford, WI

Posted Wed Nov 25, 2015 1:08 AM

Oh jeez... Here we go. :lol:

#34 --- Ω --- OFFLINE  

--- Ω ---

    --- Ω ---

  • 12,105 posts
  • Location:워싱턴 주

Posted Wed Nov 25, 2015 1:24 AM

Oh jeez... Here we go. :lol:

 

 Yep!  Well, how about it Rich... how does RXB stand up to the "Battle of the BASIC's"?

Attached Files



#35 jedimatt42 OFFLINE  

jedimatt42

    Stargunner

  • 1,637 posts
  • Location:Beaverton, OR

Posted Wed Nov 25, 2015 2:09 AM

That cartridge label looks real nice!

 

So, how compatible is this basic with software for the cortex computer?  Was there a document on the port to the 4A? 



#36 Willsy OFFLINE  

Willsy

    River Patroller

  • 3,062 posts
  • Location:Uzbekistan (no, really!)

Posted Wed Nov 25, 2015 2:46 AM

 

I of course then wonder, is it time for the battle of the basics ?   Just kidding...    But I can't resist doing a little computation test... 

 

For Cortex Basic computing primes from 1 to 100 with my non-optimized implementation takes 1 minute and 56 seconds.

80  REM TAKES 1:56 ON 4A
90  PRINT 1
100  FOR I=2 TO 100
105   P=0
110   FOR J=2 TO (I-1)
111    D=I/J
112    E=INT[I/J]
120    IF D=E THEN P=1
130   NEXT J
135   IF P=0 THEN PRINT I
140  NEXT I

For extended basic (using xb2.7)  basically the same code took 2 minutes and 31 seconds

100 REM TAKES 2:31 IN XB ON 4A
110 PRINT 1
120 FOR I=2 TO 100
130 P=0
140 FOR J=2 TO (I-1)
150 D=I/J
160 E=INT(I/J)
170 IF D=E THEN P=1
180 NEXT J
190 IF P=0 THEN PRINT I
200 NEXT I

Without wishing to derail the thread, TurboForth takes about 0.5 seconds!

 

Wanna see it? Load TurboForth from Classic99. After it has booted type

 

DEMOS

 

You'll see "Prime numbers to 1000" on block 15.

 

Type:

 

15 LOAD

 

It will show you the prime numbers to 1000 (which takes ~2.5 seconds)

 

Then type:

 

PAGE

 

(this will clear the screen)

 

Then type:

 

100 primes

 

Ta dah!

 

Okay. As you were.... :)



#37 Stuart OFFLINE  

Stuart

    Dragonstomper

  • Topic Starter
  • 761 posts
  • Location:Southampton, UK

Posted Wed Nov 25, 2015 3:17 AM

There was a comparison between various BASICs and Forth on another thread some time ago. Can't remember which thread though.



#38 Stuart OFFLINE  

Stuart

    Dragonstomper

  • Topic Starter
  • 761 posts
  • Location:Southampton, UK

Posted Wed Nov 25, 2015 3:23 AM

That cartridge label looks real nice!

 

So, how compatible is this basic with software for the cortex computer?  Was there a document on the port to the 4A? 

 

Most Cortex BASIC programs seem to work as long as they don't contain peeks/pokes and/or calls to assembler. I've got a couple typed out from the user magazines that I'll post up soon. The main difference, particularly for games, is the keyboard scanning, as the keyboard on the Cortex is interrupt driven. If you have a look at [http://www.avjd51.ds...ti.htm#programs], then just under the keyboard mapping table there is a section "Changes and Restrictions in the TI Implementation".

 

(Thanks for sorting out the EPROM image Matt!)



#39 Tursi OFFLINE  

Tursi

    Quadrunner

  • 5,071 posts
  • HarmlessLion
  • Location:BUR

Posted Wed Nov 25, 2015 5:43 AM

Okay, here are the results......


Totally possible and completely legal - these chips do NOT have a pre-defined startup state. It has worked out that all the chips used to date were reproducible once it was determined where they started (either in the first or last bank), but it's interesting to see the behavior of yours.

It's /also/ possible that it's caused by a bad contact on the ROM, but I would expect to see multiple banks tagged for startup and other errors in that case.

My recommendation remains that multi-bank ROM cartridges simply include startup code in all banks that includes a header and enough code to switch to the correct bank before continuing, you can easily do it in 32 bytes or less. Then it always works. :) (Carts that include a GROM can use a GPL power-up routine to set the correct bank, as well.)

#40 Ksarul OFFLINE  

Ksarul

    River Patroller

  • 4,631 posts

Posted Wed Nov 25, 2015 6:07 AM

Omega, just get a 74LS378 and put it in place of the 25LS07. It should eliminate your problem (and it is interesting that yours switches between two startup banks--I've only seen one other chip out of several hundred tested that did that, but it is a permissible startup based on the chip specs since the startup state is undefined).



#41 Lee Stewart OFFLINE  

Lee Stewart

    River Patroller

  • 3,692 posts
  • Location:Silver Run, Maryland

Posted Wed Nov 25, 2015 8:38 AM

.., TurboForth takes about 0.5 seconds! ...

 

That's not quite a fair comparison since Matt's code was not optimized.  The TurboForth code is highly optimized and using integer math.  Even a first optimizing pass of exiting the inner loop with the first exact division reduces the XB time in Classic99 to 43 seconds.  Of course, the two big hits for XB (which cannot be optimized out) are floating point math and GPL interpretation.

 

...lee



#42 --- Ω --- OFFLINE  

--- Ω ---

    --- Ω ---

  • 12,105 posts
  • Location:워싱턴 주

Posted Wed Nov 25, 2015 9:50 AM

Omega, just get a 74LS378 and put it in place of the 25LS07. It should eliminate your problem (and it is interesting that yours switches between two startup banks--I've only seen one other chip out of several hundred tested that did that, but it is a permissible startup based on the chip specs since the startup state is undefined).

 

Good advice, and I normally would have acted on your suggestion, but since Jedimatt42 came to my aid with that 512K image, I decided to just 'finalize' that cartridge board by making it a permanent Cortex BASIC 80 cartridge instead.  BTW - I need a couple more Uber Carts...  :-D

 

I know I'm not alone on this... I'd really like to see a PDF, with supporting software for the PC, so I, and others, can make our own 512K images... without being dependent on others.  A "Cartridge Making for Dummies" sort of thing.

 

It would be nice to know how to put on the header that Tursi talked about or how to  make my own compilation images, or even a single image and know how to replicate X number of times to make a valid and usable .BIN file.

 

Making cartridges sure turned out to be a hell of a lot more fun than I thought it would be.  



#43 arcadeshopper OFFLINE  

arcadeshopper

    River Patroller

  • 3,358 posts
  • Location:Portland, Oregon USA

Posted Wed Nov 25, 2015 12:56 PM

 

Let me look into that. I thought I had it sorted.  ;-(

 

ARCADESHOPPER - was that the disk or cartridge version you were trying? Was the sprite there from the start or suddenly appeared as you were playing around?

 

Disk



#44 Tursi OFFLINE  

Tursi

    Quadrunner

  • 5,071 posts
  • HarmlessLion
  • Location:BUR

Posted Wed Nov 25, 2015 10:05 PM

It would be nice to know how to put on the header that Tursi talked about or how to  make my own compilation images, or even a single image and know how to replicate X number of times to make a valid and usable .BIN file.

 

It's not a question of just "adding a header"... the cartridge needs to be designed that way, because it occupies space that some carts might otherwise use for code or data. Not very much space, and to me it's well worth it, but it's not something that can be easily inserted after the fact, and certainly not automatically or via a fixed process.

 

My proposal, though, is that programs written for bank switching carts have, as their first instruction, a command to switch to the intended 'first' bank... and then that much is copied to the beginning of every bank. That way you guarantee the startup state, even after a reset.

 

Something like this:

 

 AORG >6000
 DATA >AA01,>0100,>0000,PROG,>0000,>0000
PROG
 DATA >0000,START
 BYTE >04
 TEXT 'TEST'
 
 EVEN
START
 CLR @>6000   * set bank 0

 

That block would take 28 bytes -- if every bank on the ROM started with that exact set of bytes, you'd always get the header and always start up correctly (banks other than the first one can stop after the CLR statement, after the bank switch the code will then continue in the first bank).

 

This is the wrong thread for this though...



#45 aftyde OFFLINE  

aftyde

    Chopper Commander

  • 239 posts

Posted Thu Nov 26, 2015 5:25 AM

Is this something that can be loaded and run - can't seem to figure out what to do with it?



#46 --- Ω --- OFFLINE  

--- Ω ---

    --- Ω ---

  • 12,105 posts
  • Location:워싱턴 주

Posted Thu Nov 26, 2015 7:42 AM

 

Something like this:

 AORG >6000
 DATA >AA01,>0100,>0000,PROG,>0000,>0000
PROG
 DATA >0000,START
 BYTE >04
 TEXT 'TEST'
 
 EVEN
START
 CLR @>6000   * set bank 0

That block would take 28 bytes -- if every bank on the ROM started with that exact set of bytes, you'd always get the header and always start up correctly (banks other than the first one can stop after the CLR statement, after the bank switch the code will then continue in the first bank).

 

This is the wrong thread for this though...

 

 

Is this something that can be loaded and run - can't seem to figure out what to do with it?

 

It's designed to work with a cartridge, simply to get it to start up in the appropriate spot. If you don't have EEPROM burner, it's probably something that you'll never need.  I'm starting a new folder, and that little piece of code will be the first entry.  2016 is going to be the year I *TRY* to find the time to learn how to make my own cartridges, not just program in someone else's work.

 

Having that little piece of code and knowing how to use it are two different things, sadly my ignorance meter is pegged on this topic.  Anyone want to start a new thread teaching NEWBS?



#47 Tursi OFFLINE  

Tursi

    Quadrunner

  • 5,071 posts
  • HarmlessLion
  • Location:BUR

Posted Thu Nov 26, 2015 8:08 PM

Yes, sorry, it's only useful to people creating new cartridges, it's not useful for any existing cartridge and does nothing standalone (well, it'll display a menu entry that crashes when selected ;) ).

 

I'm okay with the idea of teaching, but are you asking to learn to program from scratch? Cause if so, bank-switched cartridge programming is way down the line.



#48 aftyde OFFLINE  

aftyde

    Chopper Commander

  • 239 posts

Posted Thu Nov 26, 2015 11:42 PM

Yep - I have a programmer, a bunch of adapters, and just received a 512K flash ROM/GROM.  Seems to also have a small AT49F040 loose in the static bag.  Not sure what the next step should be.  I have been reading the forums - and a version of Basic that supported 80 col would be very high my my list of desired projects!  :)

 

Seems to be the same board in my Extended Basic 2.7 Suite cart minus the big chip!



#49 jedimatt42 OFFLINE  

jedimatt42

    Stargunner

  • 1,637 posts
  • Location:Beaverton, OR

Posted Fri Nov 27, 2015 2:04 AM

The AT49F040 is the 512k eeprom you can program with your programmer using the adapter that fits, I think it is a 32pin dip adapter.

 

Set the programmer to that chip type, and load the .bin image in this post: http://atariage.com/...-2#entry3376824

into your programmer, and program it.

 

--- Ω --- had a blog post that describes how he got started with the same cartridge board and chip.

 

http://atariage.com/...under-revision/



#50 Ksarul OFFLINE  

Ksarul

    River Patroller

  • 4,631 posts

Posted Fri Nov 27, 2015 8:56 AM

It is the same board as used with XB 2.7--and it works well with 512K images as well, but ONLY if it has one of the quarter-circle green stickers on it!  If it doesn't, all you have to do is change out the 25LS07 with a 74LS378 and test it that way to see if it starts in the first or last banks.






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users