MaxCoderz

for your 1 bit pleasure!

All times are UTC




Post new topic Reply to topic  [ 159 posts ]  Go to page Previous  1 ... 7, 8, 9, 10, 11  Next
Author Message
PostPosted: Fri 06 Mar, 2009 4:47 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
Location: Croydon, England
As mentioned above, it seems to be reading the wrong pixel on the screen (if you fill the entire screen black or white it returns the correct values). I'm really sorry about that, I'll work on it as soon as I have a chance and upload a fixed version!

One thing that bothers me with the hand-assembled code is
Code:
180 S%?15=&BEF
That will only load &EF, as ? deals with a byte at a time.


Top
 Profile  
Reply with quote  
PostPosted: Fri 06 Mar, 2009 6:09 pm 
Offline
New Member

Joined: Tue 11 Nov, 2008 7:36 pm
Posts: 25
The S%?15=&BEF is a typo, I meant for it to be S%?15=&EF. Fortunately, the code worked despite the typo.


Top
 Profile  
Reply with quote  
PostPosted: Fri 06 Mar, 2009 8:27 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
Location: Croydon, England
Hopefully the latest version should fix the POINT bugs:

Code:
   10 DIM S% 19
   20 P%=S%
   30 plotSScreen=&9340
   40 MemClear=&4C30
   50 [OPT 2
   60 LD HL,plotSScreen+12
   70 LD DE,plotSScreen
   80 LD BC,756
   90 LDIR
  100 EX DE,HL
  110 LD BC,12
  120 RST &28:DEFW MemClear
  130 RET:]
  140 *GSCALE 1
  150 CLG
  160 *REFRESH OFF
  170 *FX4,1
  180 *FX11,8
  190 *ESCOFF
  200 D%=1
  210 A%=32
  220 U%=48
  230 REPEAT
  240   CALL S%:CALL S%
  250   RECTANGLE FILL A%+32,0,96-A%,1
  260   RECTANGLE FILL 0,0,A%,1
  270   IF RND(1)<.5 A%=A%-1 ELSE A%=A%+1
  280   IF A%<0 A%=0
  290   IF A%>63 A%=63
  300   IF POINT(U%,39)=0 EXIT REPEAT
  310   RECTANGLE FILL U%,40,0,1
  320   K%=INKEY0
  330   IF K%<>0 U%=U%+(K%=136)-(K%=137)
  340   *REFRESH
  350 UNTIL K%=13 OR K%=27
  360 *REFRESH
  370 WAIT 100
  380 *REFRESH ON
  390 CLG:CLS
  400 *FX4,0
  410 *FX11,32
  420 *ESCON


Edit: I didn't mean to kill the thread; the game plays well. :) The above code is slightly amended from your original code to work with the new POINT code. It uses Z80 assembly (easier to read) in place of poking hand-assembled code, and *FX11 sets the initial keyboard repeat delay.


Top
 Profile  
Reply with quote  
PostPosted: Tue 26 May, 2009 10:21 am 
Offline
New Member

Joined: Tue 13 Jan, 2009 8:41 pm
Posts: 15
I think your APP is lacking something, but I dunno if you can code it: :D
It would be great if we could call it from Ti Basic programs. I thought of a code of that kind:

"CH. \"MINES \" *BYE -> str1
Asm(prgmBBCBASIC

Or
"MINES OPTION1(Clear graphic screen: yes/no) OPTION2(Var/Prgm) OPT3(leave BBC at the end of execution: yes/no)... ->Str1
Asm(prgmBBCBASIC

And perhaps that code could use the graphic screen...


Top
 Profile  
Reply with quote  
PostPosted: Tue 26 May, 2009 11:03 am 
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!
You want to use some BBC BASIC as a lib? Im not sure that is entirely possible since things might be a little different in BBC BASIC land, but you never know.

Perhaps ben could make a header that you could add to a BBC BASIC program so that if run from the homescreen it would load the APP and then your program automatically?

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


Top
 Profile  
Reply with quote  
PostPosted: Tue 26 May, 2009 11:10 am 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
Location: Croydon, England
I had thought of that - but the BBC BASIC environment does not play kindly with the TI-OS environment (there's lots of memory shuffling around) so I don't know if it would be possible to call the app then return back to the original "TI-BASIC" program; it's certainly difficult it you wish to retain state (eg graphics colours) between calls to it.

I did experiment with a stub assembly program that could talk to the VDU emulator (and so use BBC BASIC's drawing operations outside BBC BASIC) but couldn't get it to work very nicely. :(

With regard to tr1p1ea's idea - that could work, though I'm not sure the best way to achieve it - a stub assembly program? There needs to be some way to load the app.


Top
 Profile  
Reply with quote  
PostPosted: Tue 26 May, 2009 2:44 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!
Perhaps this could be of some use: http://wikiti.brandonw.net/index.php?ti ... CALLs:4C51

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


Top
 Profile  
Reply with quote  
PostPosted: Tue 26 May, 2009 3:25 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
Location: Croydon, England
I mean loading the app from a "TI-BASIC" program - I was intending on swapping in the app manually and calling a special entry point to trigger loading the BBC BASIC program, though that ROM call may be useful.


Top
 Profile  
Reply with quote  
PostPosted: Tue 26 May, 2009 3:41 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!
Yeah it would require a small nostub program either way most likely.

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


Top
 Profile  
Reply with quote  
PostPosted: Tue 26 May, 2009 3:44 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
Location: Croydon, England
Alternatively, one could detect a BBC BASIC program by checking that its file format was a valid BBC BASIC program. I suppose some sort of hook magic could be used? (I'm unfamiliar with hooks, sorry).

Edit: I should mention that BBC BASIC itself (ie, the bit by Richard Russell) is designed with this sort of use in mind, and by setting a flag when initialising you can get it to automatically CHAIN a program for you.


Top
 Profile  
Reply with quote  
PostPosted: Wed 27 May, 2009 2:28 pm 
Offline
Calc King

Joined: Sat 05 Aug, 2006 7:22 am
Posts: 1513
I think I'd hook into the "prgm" executing hook, well, that is, use the parser hook and then check whether the token was a "prgm"


Top
 Profile  
Reply with quote  
PostPosted: Wed 10 Jun, 2009 10:37 pm 
Offline
New Member

Joined: Wed 10 Jun, 2009 9:58 pm
Posts: 17
Is it true that inkey(0) cannot poll the 2nd, Alpha, or any of the F1-F5 keys? And if so, why?


Top
 Profile  
Reply with quote  
PostPosted: Thu 11 Jun, 2009 12:26 am 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
Location: Croydon, England
2nd and Alpha are modifier keys and as such cannot return any meaningful ASCII code when pressed on their own (they instead affect the codes returned by pressing other keys).

On the BBC Micro, you could define the function of the various function keys in software. For example,
Code:
*KEY 3 Hello
would make the f3 key "type" Hello every time it was pressed. This would probably be a useful feature to implement on the TI version, so I'll see if I can get around to that when I have some spare time. :)

You can always poll the particular keys using the key's scancode as documented in the INKEY reference. For example,
Code:
f3pressed=INKEY(-116)
works on the BBC Micro, Windows and the TI calculator versions.


Top
 Profile  
Reply with quote  
PostPosted: Thu 11 Jun, 2009 2:30 am 
Offline
New Member

Joined: Wed 10 Jun, 2009 9:58 pm
Posts: 17
Yeah, I knew about the inkey(negative) part, but that won't allow you to use quick key repeat

Oh well, maybe i will need to write my own quick key repeater... :(


Top
 Profile  
Reply with quote  
PostPosted: Thu 11 Jun, 2009 10:50 am 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
Location: Croydon, England
Oh, I can see how that would be a problem. :(

*KEY does allow some keys to be redefined, but not any of the modifiers. Implementing it would help you with F1-F5, but not help with 2nd or Alpha. The ability to change the functionality of 2nd or Alpha could have knock-on effects for usability though (eg changing Alpha would prevent the user from typing the * in *BYE) unless I made INKEY(n≥0) a special case.


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

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