MaxCoderz

for your 1 bit pleasure!

All times are UTC




Post new topic Reply to topic  [ 159 posts ]  Go to page Previous  1 ... 5, 6, 7, 8, 9, 10, 11  Next
Author Message
PostPosted: Wed 11 Feb, 2009 3:41 am 
Offline
New Member

Joined: Wed 03 Sep, 2008 1:52 am
Posts: 4
calc84maniac wrote:
Wow... that almost beats pure basic! :insane:
Image

Wow that's insanely fast. Where's a link for download?


Top
 Profile  
Reply with quote  
PostPosted: Wed 11 Feb, 2009 5:03 am 
Offline
Regular Member
User avatar

Joined: Wed 18 Oct, 2006 7:34 pm
Posts: 112
Location: The ex-planet Pluto
Nowhere... heh. I just randomly had that screenshot from way back when...

Edit: Also, I'm guessing it was recorded in 15MHz, whereas Ben's was probably 6MHz.

_________________
~calc84maniac has spoken.

Projects:
F-Zero 83+
Project M (Super Mario for 83+)


Top
 Profile  
Reply with quote  
PostPosted: Wed 11 Feb, 2009 5:21 am 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 4095
Location: I cant seem to get out of this cryogenic chamber!
By not clearing and only drawing the head/(erasing) the tail instead of keeping a list of all elements, you can speed it up considerably. Im assuming thats what calc has done. Very nice btw.

_________________
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image


Top
 Profile  
Reply with quote  
PostPosted: Wed 11 Feb, 2009 11:22 am 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
Location: Croydon, England
Very nice screenshot, calc84maniac. :D

That's what I do, at any rate; a ring buffer with a pointer to the "head" element some way ahead of the "tail" element. Normally the head and tail pointers move forwards together, but to elongate the snake you can move the head pointer forwards and leave the tail pointer where it was.

As the game world is 24x16 units where each block is either "on" or "off" I use a 48 byte buffer (one bit per block) instead of a 1536 byte 24x16 array. This additional bit manipulation -
Code:
  490 REM Get or set point in the world
  500 DEFPROC_world(X%,Y%,V%)P%=Y%*3+X%DIV8:X%=X%AND7:IF V% world%?P%=world%?P%OR2^X% ELSE world%?P%=world%?P%ANDNOT(2^X%)
  510 ENDPROC
  520 DEFFN_world(X%,Y%)P%=Y%*3+X%DIV8:X%=X%AND7:=world%?P%AND2^X%
- probably does little for speed but it reduces memory concerns somewhat.

In a similar vein the longest snake would be 24x16 units long, and with an X and Y component for each you'd end up with a 3072 byte array, so I instead use a 768 byte buffer.

My screenshot was recorded at 15MHz, but I tried to get speed 9 roughly the same on both. (Last time I checked it played about as fast at 6MHz). You can make it run faster on an SE by removing the delay between frames entirely (currently capped at 3 centiseconds, ie 30ms) which is stored in the static variable S%:
Code:
  260   S%=(9-speed%)*5+3: ...
The game runs in the Windows version of BBC BASIC (where I originally developed it) if you can't be bothered to send it to your calculator. ;)


Top
 Profile  
Reply with quote  
PostPosted: Thu 12 Feb, 2009 8:18 pm 
Offline
Regular Member
User avatar

Joined: Sun 12 Oct, 2008 1:42 am
Posts: 137
Location: Boise, Idaho
Wow! :shock:
This is looking great. It makes me feel like I want to learn BBC Basic, but time will not permit... This is really coming along great, Ben.
Aren't you making a documentation on how to use BBC Basic and some coding?
Keep up the good work.

_________________
ImageImage
ImageImage
Image


Top
 Profile  
Reply with quote  
PostPosted: Thu 12 Feb, 2009 9:31 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
Location: Croydon, England
I'm afraid I don't really go in for tutorials - most of my learning is from reference material and examples. I could try writing a tutorial but for the reasons above I don't think it would be very good. :(

There's always the BBC BASIC for Windows documentation, but I have not yet checked it myself to see how different it is.


Top
 Profile  
Reply with quote  
PostPosted: Thu 12 Feb, 2009 9:33 pm 
Offline
Regular Member

Joined: Sun 14 Sep, 2008 10:00 am
Posts: 88
Wesley wrote:
Wow! :shock:
This is looking great. It makes me feel like I want to learn BBC Basic, but time will not permit... This is really coming along great, Ben.
Aren't you making a documentation on how to use BBC Basic and some coding?
Keep up the good work.
Yes, Ben has a nice looking help document with the apps for the calc. I will try this BASIC sometime... It is a new field in calc dev.

EDIT: you are right Ben. It is more documentation of commands. =/ We can solve that solve that. And making update advanced TI-BASIC stuff like grayscale and others would be nice, too. =P


Top
 Profile  
Reply with quote  
PostPosted: Thu 12 Feb, 2009 10:21 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
Location: Croydon, England
Galandros wrote:
EDIT: you are right Ben. It is more documentation of commands. =/ We can solve that solve that. And making update advanced TI-BASIC stuff like grayscale and others would be nice, too. =P
As you may have noticed there aren't many MODE numbers allocated so in theory it may be possible to create a greyscale mode. The main issue there is runtime memory (as it would require three additional screen buffers, and memory is tight enough as it is). I'd personally rather work on getting the existing graphics commands up to scratch first!


Top
 Profile  
Reply with quote  
PostPosted: Fri 13 Feb, 2009 5:26 am 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 4095
Location: I cant seem to get out of this cryogenic chamber!
I say using the TI-BASIC+lib method would be feasable, xor'ing screen images every frame instead of a full blow interrupt driven implementation.

I started making a small map demo, ill let you know how it goes :).

_________________
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image


Top
 Profile  
Reply with quote  
PostPosted: Fri 13 Feb, 2009 11:10 am 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
Location: Croydon, England
What may be useful would be a way to select the buffer that drawing operations write to. That way you could DIM some space on the heap and use that as your second buffer; all you'd then need to do would be to swap this buffer and the regular plotsscreen and call *REFRESH to repaint the LCD.


Top
 Profile  
Reply with quote  
PostPosted: Fri 13 Feb, 2009 4:06 pm 
Offline
New Member

Joined: Fri 13 Feb, 2009 3:52 pm
Posts: 1
Is there a way to write small sized text to the screen while in Mode 4?


Top
 Profile  
Reply with quote  
PostPosted: Fri 13 Feb, 2009 5:26 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
Location: Croydon, England
Not currently, and I don't think it would ever be possible in VDU 4 (text fits in a grid fixed), but it would be possible in VDU 5 (text is drawn at the graphics cursor location) with an additional command. Good idea, I'll add it. :D


Top
 Profile  
Reply with quote  
PostPosted: Sat 14 Feb, 2009 2:53 am 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
Location: Croydon, England
The new version adds two features. Possibly the most useful is *FONT, which allows you to switch between SMALL and LARGE font sizes when used with VDU 5.

The other main new feature is the rather dangerous *GBUF, which lets you reposition the graphics buffer. A flickery greyscale demo follows:
Code:
   10 MODE3
   20 HIMEM=HIMEM-768:alt%=HIMEM
   30 *ESCOFF
   40 GCOL143:CLG
   50 GCOL0:CIRCLE FILL 192,128,128
   60 GCOL15:CIRCLE FILL 192,128,96
   70 GCOL0:CIRCLE FILL 192,128,40
   80 OSCLI"GBUF"+STR$~alt%
   90 CLG:CIRCLE FILL 192,128,96
  100 REPEAT
  110   OSCLI"GBUF"+STR$~alt%
  120   T%=TIME+3:REPEAT:UNTILTIME>T%
  130   *GBUF
  140   T%=TIME:REPEAT:UNTILTIME>T%
  150 UNTILINKEY0<>-1
  160 *ESCON
  170 *HIMEM

A rather nasty crashing bug has also been fixed (scrolling a one row high text viewport which doesn't fill the width of the screen used to trigger an instant crash).

Edit: There is a mistake in the documentation. buf%=HIMEM:HIMEM=HIMEM-768 would place buf% above the old value of HIMEM. You want to place buf% above the new value of HIMEM, ie HIMEM=HIMEM-768:buf%=HIMEM.

Fortunately BBC BASIC has the 2KB user-definable character buffer above HIMEM anyway so all you'll end up doing is overwriting these characters rather than crashing the calculator. I'll fix the docs in the next version.


Top
 Profile  
Reply with quote  
PostPosted: Wed 18 Feb, 2009 7:58 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
Location: Croydon, England
The new version contains amended documentation and one minor feature; the Clear button now generates ASCII ESC (27) - the same as the On key when *ESC OFF has been used.


Top
 Profile  
Reply with quote  
PostPosted: Sun 22 Feb, 2009 4:45 pm 
Offline
New Member

Joined: Sun 30 Nov, 2008 12:14 pm
Posts: 5
Nice program, but (on the TiLem emu, fortunately), I had a serious crash while trying to figure out how the thing worked xD (my own fault) and trying to run some of the samples, and it asked me to reinstall the os, I hope this will never happen on my real calc :lol:


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 159 posts ]  Go to page Previous  1 ... 5, 6, 7, 8, 9, 10, 11  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB ® Forum Software © phpBB Group | DVGFX2 by: Matt