Jump to content

Willsy

Members
  • Content Count

    3,144
  • Joined

  • Last visited

Everything posted by Willsy

  1. That was a nice trip down memory lane! <brag> It turns out I did an *optimising* BF compiler! http://turboforth.net/fun/brainfuck.html </brag> 'yall got some work to do!😜
  2. I already have that in TFs joystick routine but removed it from the above snippet 🙂
  3. ; JOYST ( joystick# -- value ) ; Scans the joystick returning the direction value li r1,6 ; use keyboard select 6 for #0, 7 for #1 swpb r1 li r12,36 ldcr r1,3 li r12,6 stcr r1,5 swpb r1 inv r1 andi r1,>001f At the end of this routine, R1 contains a bit pattern as follows: 1=Fire 2=Left 4=Right 8=Down 16=Up So your can simply mask the bits to examine the joystick/button status that you're interested in. At the start of the routine load R1 with 6 for joystick 0 or 7 for joystick 1. I took this from TurboForth's joystick routine. Cheers
  4. Willsy

    SDD 99

    Yes it's quite tough on Europe right now. In the UK the situation is getting ridiculous. I hope things are a bit better in the USA. Anyway, back on topic: is this an SD reader/writer for the side port?
  5. Try adding a 2N7000 or something similar to drive the signal. Worth a try if you have a MOSFET lying around...
  6. If you got the double byte thing from TurboForth, know that I got it from the original driver/utility routines supplied by the original SAMS guys (the names of whom escape me right now) - there was a bunch of machine code source files supplied on disk and I simply copied the technique. ☝️
  7. <geek> Do I spy a ZX Spectrum/Jupiter ACE character set? </geek>😁
  8. Dang it! That's an evil gotcha! Imagine trying to debug that back in the day without a single-step debugger. Shudder 🤯
  9. I just use Linux. Been running Linux Mint for around four years now. It doesn't get in the way. Windows does. All the time. For older machines, there are still plenty of 32-bit Linux builds around that will give those old machine a new lease of life.
  10. Scored 410 - level 5. Then it kicked my ass. 🙂
  11. Can you scope the outputs? If they're sitting at half of VCC then there's a good chance they are oscillating, which would again cause me to suspect floating/unconnected inputs.
  12. Yes. Was thinking, it sounds like one of the inputs is floating. Either because you forgot to tie it low or high (G1 input is active high) or because of a bad connection.
  13. CCFOS is a lovely little game! If that came out as a cart in the 4A's hey-day you'd have made a bloody fortune!
  14. It is rather beautiful isn't it? I love the raw, brutal simplicity of forth. My only criticism would be the lack of stack comments. However, the definitions are so short you can easily understand them.
  15. Factor factor factor. When it's getting hard it's normally a sign that you need to factor into smaller definitions. And don't be afraid to use global variables to store things in. It may ultimately be faster than wasting cycles just to manipulate the stack.
  16. Those structured jump tokens are the jewel in the crown of the Forth assembler (for me)! Merry Christmas! Mark
  17. Interrupts are off most of the time in TurboForth. I legacy of a naive design decision by yours truly. At the time though, I was going for speed. I seem to remember experimenting with getting TF with interrupts enabled but couldn't get it to work. At least not easily, so I gave up! It's fairly easy to install a user ISR in TF. Poke in some machine code, either using the assembler or using CODE: load the ISR vector at >A008 with the address of the machine code. Caveats: The ISR vector must point to the machine code, not the CFA of the machine code as built by the Forth assembler or by CODE: This amounts to ticking the machine code word and adding 2 to move past the CFA The ISR must use RT/B *R11 instruction to return to the TF (TF does a regular BL to your ISR) Since TF does a regular BL to your ISR, you are in TF's register workspace, so be careful! Don't change R3, R4, R5 and R12 - or, if you change them, restore them before you return. Example to create a 'frame counter' ISR: variable fcount ASM: ISR fcount @@ inc, r11 ** b, ;ASM ' ISR 2+ $A008 ! (at this point the ISR is loaded and running) FCOUNT @ . FCOUNT @ . Here's a video I did last night showing the process for those that are interested 🙂
  18. That's what stacks are for, my friend! 👍 Or in assembly, you can chain workspaces via the BLWP & RT instructions - which is really nice, because each subroutine gets a bunch of registers (ostensibly R0 to R11 inclusive) to themselves.
  19. Good point. I'm very rusty. So the best I can say is TF will work for up to 1MB on a 4MB card. I think. It's an easy fix to make it work with 4MB cards. Assuming I have enough bytes free 🤯
  20. Yes. @InsaneMultitasker and Fred Kaal helped me to work them out.
  21. Good. Glad to read this. TurboForth always writes a word when using >MAP - but not because of any great insight from me - I just cribbed it all from the original SAMS docs/driver disks 🤓.
  22. Oh my this was seven years ago! We should keep this thread alive and include fbForth and Forth99.
  23. Also, I wonder how fast it would be with no screen I/O at all? Just output the final result? Then you're really timing your algorithm (and the underlying Forth system, of course) and removing the I/O.
×
×
  • Create New...