Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Most useful/needed stuff which should be added
#7
FreeBasic Types (like your syntax) will be supported in the future. But there several things to keep in mind. E.g. How to implement them in asm, and how to change the compiler to allow them (many changes). So this won't be available in the short term.

na_th_an Wrote:
boriel Wrote:
na_th_an Wrote:3.- Less important, but may come handy, the ability use Attr as a modifier for Print which combines Ink, Bright, Paper, and Flash in a single command:
You can get this with a simple POKE 23695,t (ATTR_T <!-- m --><a class="postlink" href="http://www.wearmouth.demon.co.uk/sys/attr_t.htm">http://www.wearmouth.demon.co.uk/sys/attr_t.htm</a><!-- m -->). ZX BASIC could in the future optimize this, if numeric values are given in a sequence of attributes. E.g. PAPER 7; INK 1; BRIGHT 1; FLASH 0.... could be compiled in a single poke. There's also a function defined in attr.bas library, called SetATTR(x, y, ATTR) which you might find useful.

That's what I'm using (I reinvented the wheel creating my own SetATTR). I didn't know about the systems var thing. But still, it requires two commands to do such a simple task. The "SetATTR" solution also makes noticeable the separation between the printing and the colour setting.
Then I guess you my manage your self with SetATTR, don't you? So lets try a simple putchar:
Code:
Sub FASTCALL PutChar(x as Ubyte, y as Ubyte, c as uByte)
     Asm
     ; x comes in A register (FastCall)
     ; y and charCode
     pop hl ; Return Address
     pop de ; get Y in D register
     ex (sp), hl ;  => get c in H register and push return address back

     ; At this point you have X in a; Y in D; an C in H. Now proceed as you want.
     ; This routine is fascalled => you can simply RET at any point.


     End Asm
End SuB

Also, I would like you to time against print. PRINT is slow because it relays on strings which are a little slower.
You might want to call internal __PRINT_CHAR routine (at the internal PRINT routine). The difference in time shouldn't be too much.
If you wan't your routine to draw at a different screen location, use the global internal label (SCREEN_ADDRESS), which defaults to 16384 as expected.

na_th_an Wrote:5.- Allow comments in broken lines, such as this:

Code:
Dim myLevel(2) as uByte => { _
   0, _     ' Number of exists
   10, _    ' Baddies life gauge
   7 _      ' Water level
}
As LCD pointed out, It's not /'...'/, but the ability of use single comments in broken lines.
Then I misunderstood you. Anyway, this feature will be available soon too (along with the block comment), since it's a standard one.
Quote:I'm writing all this 'cause I'm currently writing my second game using this compiler, and such features (specially the user defined types and a fast putchar) will make the games writing chores to be quite a walk in the park Smile
Then try LCD's routine which uses a similar aproximation. You can also use my template SUB function to put the inline assembler there.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)