MaxCoderz

for your 1 bit pleasure!

All times are UTC




Post new topic Reply to topic  [ 120 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8
Author Message
PostPosted: Sat 13 Dec, 2008 1:13 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 4094
Location: I cant seem to get out of this cryogenic chamber!
Wow, thats really cool Ben! I dont mind at all. I had high hopes for tilemapping in this and they are being fulfilled :).

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


Top
 Profile  
Reply with quote  
PostPosted: Sat 13 Dec, 2008 4:03 pm 
Offline
Regular Member
User avatar

Joined: Sun 09 Sep, 2007 8:50 pm
Posts: 124
Location: The dark side of the moon
Is there a limit to the number of character that a font set can have?

_________________
Projects:
Projects:TBA-Soonish. :)
Updated 5/3/12


Top
 Profile  
Reply with quote  
PostPosted: Sat 13 Dec, 2008 4:22 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
Location: Croydon, England
Cheers, tr1p1ea. :) Here's the same program running on a BBC Micro.
Art_of_camelot wrote:
Is there a limit to the number of character that a font set can have?
It's an eight-bit character set and all but the first 32 values can be changed, resulting in 224 user-definable characters. Of those only characters 128-255 should be changed, as those below 128 are the usual printable characters (eg the alphanumeric characters). This is just one way of doing tilemaps (though it is an easy and fast way, just printing strings!) - there are others (eg drawing sprites, or if worst comes to the worst custom assembly code).


Top
 Profile  
Reply with quote  
PostPosted: Sat 13 Dec, 2008 6:22 pm 
Offline
Regular Member
User avatar

Joined: Sun 09 Sep, 2007 8:50 pm
Posts: 124
Location: The dark side of the moon
Ok, another question. If sprites were to be used instead, where would the sprite data be stored? and how do you go about accessing it(assuming you were using BBC's sprite function)?

_________________
Projects:
Projects:TBA-Soonish. :)
Updated 5/3/12


Top
 Profile  
Reply with quote  
PostPosted: Sat 13 Dec, 2008 7:28 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
Location: Croydon, England
The BBC BASIC DIM command can be used to declare arrays (eg DIM array$(9) declares an array of strings named array$ with bounds from 0 to 9 - ie, 10 elements). It can also be used to allocate memory directly, eg DIM pattern 7 would allocate 8 bytes (0 to 7) and return a pointer to that data in the variable pattern. You could use this to allocate memory for sprite data.

As for how you'd invoke the sprite command; I'm not sure. The current method is an unsightly hack on top of PLOT, but the BBC Micro's own Graphics Extension ROM (or "GXR") supported sprites so I'm probably going to modify my code to use the same methods. However, I don't know how the GXR worked and can't find any documents on it so you'll have to wait for concrete answers.


Top
 Profile  
Reply with quote  
PostPosted: Sun 14 Dec, 2008 8:52 am 
Offline
Calc King
User avatar

Joined: Sat 18 Dec, 2004 6:46 am
Posts: 2932
So, how large is BBC Basic on the calc? And will you be adding a user friendly GUI, or keeping it command line?


Top
 Profile  
Reply with quote  
PostPosted: Sun 14 Dec, 2008 12:12 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 4094
Location: I cant seem to get out of this cryogenic chamber!
Im pretty sure its headed for a 3-page APP, and i doubt there will be a gui since the original features nothing of the sort afaik.

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


Top
 Profile  
Reply with quote  
PostPosted: Sun 14 Dec, 2008 1:11 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
Location: Croydon, England
Yes, it's a 3 page app (48KB), with BBC BASIC and the BBC Micro MOS API routines on page 1; file I/O, console I/O and general TI-OS interop on page 0 and graphics routines on page 2.

I'm not sure what you'd be looking for as far as a GUI goes. If it's for editing programs the file format is documented so it would be possible to write external tools if need be. You can convert text files into BASIC programs by *EXECing them from within BBC BASIC.


Top
 Profile  
Reply with quote  
PostPosted: Wed 17 Dec, 2008 10:46 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
Location: Croydon, England
For more information on the Graphics Extension ROM, which supported sprites and patterned fills, you can download a copy of the manual from J.G.Harston's website. I'll try and modify the TI-83+ version to use the same (or at least similar) techniques. This could be a little tricky with sprites...


Top
 Profile  
Reply with quote  
PostPosted: Fri 19 Dec, 2008 12:53 am 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
Location: Croydon, England
I may have sorted out the memory limitation issue.

BBC BASIC's program memory is in the range ≥PAGE and <HIMEM. By default PAGE is set to &A100 and HIMEM is clamped to &C000. By increasing HIMEM you could give more memory to BBC BASIC and by decreasing it you could give more memory to the TI-OS for new program variables.

However, there's a problem; BBC BASIC does not know of the existance of the TI-OS. Currently memory is allocated by the host interface when it loads so that the TI-OS does not run into it, but once HIMEM is changed BBC BASIC is free to overflow this allocated memory and corrupt user variables (if HIMEM is increased) or leaves a gap that the TI-OS can't identify as free memory (if HIMEM is decreased).

To get around this problem I have created a *HIMEM OS command. For example,

Code:
*HIMEM D000

would move HIMEM to &D000. As it goes via the host interface it can perform additional safety checks, relocate the stack and insert more memory to accomodate BASIC's new area. The opposite also rings true; decreasing HIMEM this way frees memory back to the TI-OS.

Decreasing HIMEM the "usual" way (decreasing it via the BASIC HIMEM pseudo-variable) has its advantages; you can use it to set aside an area of memory that isn't cleared when variables are CLEARed (eg by running a new program). For example, if you had a 2KB assembly library you could decrement HIMEM by 2KB, assemble the library to HIMEM then unload the BASIC program from memory. The assembly routine is now outside BBC BASIC's memory space (though still inside the space allocated when BBC BASIC was initialised as that has not been updated by *HIMEM) so can still be accessed.

In addition to this I have modified the EXT# function. Usually this is used to retrieve the size of a an open file handle (eg PRINT EXT#2 would display the size of the open file with a handle of 2). If you pass -1 to EXT# it returns the amount of free memory to the TI-OS (as reported by _MemChk). You could use this, for example, to allocate all of the TI-83+ free memory to BBC BASIC:

Code:
OSCLI "HIMEM "+STR$~(HIMEM+EXT#-1)


Top
 Profile  
Reply with quote  
PostPosted: Sat 03 Jan, 2009 11:01 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
Location: Croydon, England
I spent some time recently knocking together a minesweeper clone in BBC BASIC:

Image

(Due to a bug in Wabbitemu an error is displayed when exiting instead of a quit message; this works on later versions of Wabbitemu and hardware, but later versions of Wabbitemu don't take screenshots properly).

The source code can be found here, and will run in the free Windows version of BBC BASIC if you want to try it (Enter to "click" on cells, Delete to flag). I had to uglify the source somewhat (cramming multiple statements onto a single line, removing most comments) to fit it into the 8KB of the shareware version of BBC BASIC without triggering No room errors!


Top
 Profile  
Reply with quote  
PostPosted: Sun 04 Jan, 2009 7:47 pm 
Offline
Calc King
User avatar

Joined: Sat 18 Dec, 2004 6:46 am
Posts: 2932
That looks awesome! How much is that program on calc?


Top
 Profile  
Reply with quote  
PostPosted: Sun 04 Jan, 2009 7:57 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
Location: Croydon, England
The file on-calculator is the same size as it is on the PC (plus a few bytes of overhead for the filename and VAT entry), so a bit under 5KB.


Top
 Profile  
Reply with quote  
PostPosted: Tue 06 Jan, 2009 4:13 am 
Offline
New Member

Joined: Tue 11 Nov, 2008 7:36 pm
Posts: 25
Looks great! When will the app be released?


Top
 Profile  
Reply with quote  
PostPosted: Tue 06 Jan, 2009 10:19 am 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
Location: Croydon, England
Most of BBC BASIC is now usable, albeit with a few known bugs/omissions, so I hope to put together a release that can be checked by the author. Once that has been checked I can then release a series of test versions, as no doubt I've missed a few bugs. If I could at least compile the first test release before the end of this week I'd be happy. :)


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


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