Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. Yes, both EFFECTS and EFFECTSHI works for me in Aritm now. In order to use it with the "Try it now" button one would have to be able to upload disk images or have some way of including the sound effects library in a single prg-file with my BASICv2-program.
  3. Okay after reading the Regex Tutorial again .. it turns out that it should be this - which works in the JavaScript on regex101: \b[AXY](?<!^\s*[AXY]|^\s*;.*)\b Hower converting it to this # Registers { match: '\\b[AXY](?<!^\\s*[AXY]|^\\s*;.*)\\b' name: 'keyword.parameter.register.ca65' } Leads to nothing parsed anymore (all characters white now). I tried a lot of stuff but I cannot get my head around to something working in Atom.. This is my test text for regex101: Only the second and the last entry shall be matched. This does the trick as well (?<!^\s*|;.*)\b[AXY]\b ... it reads: Match [AXY] if it as single letter and if infront of it there is neither a ";" sign nor only whitespaces. Works again with JavaScript in regex101 - but not in atom.
  4. Today
  5. I still have some minor issue with it. 1. My register statement does not work as I would like it to be. I addressed this question in another thread put like to pull it out there, as it is not related to the original topic. So here we go. If I hit a Register as a parameter to a Assembly call I like to highlight it For instance I like to highlight the X in LDA ADDR,X where LDA should be highlighted as Mnemonic, ADDR should be highlighted as symbol/label , as operator and X as register. That works great with the current file. However if I just put X anywhere on the line (without anything else) it is getting highlighted to. I got a recommendation from @Ender to try that: { match: '^\\s*\\S+.*\\b([AXY])\\b' captures: 1: name: 'keyword.parameter.register.ca65' } The result is not as I expected it to be. Now every X or A will be highlighted and the rest of the line will be not highlighted at all. I also tried to change the match to this - but same result: match: '^\\s*\\w+.*\\b([AXY])\\b' .. Same result. So obviously I am overwriting the comment rule and this rule has somehow precendence. I would love to write it this way: If the line does not start with A or X or Y with any number of Whitespaces in front, then tread a word which consists only of the letter A or X or Y as a register. So the normal way would be like that: match :'(?!^\\s*[AXY])\\b[AXY])\\b' This part is the if not start+any number of whitespaces+[A or X or Y]. If that hits, the rest will be ignored. If that does not hit, the rest will get matched. However it does not work. It works if I put X in the first column. But as soon as I put it in second column with a space in front, the not part does not seem to work and it is getting matched as a register. This is what regex101 has to say about it: I cannot see what is wrong with it - but it is even there doing the highlighting for the " X" string
  6. My latest video on YouTube looks at how to use ca65 for another system: the Atari VCS/2600:
  7. You're absolutely right! Finally I am getting it! And indexing makes it even better. Many thanks to both of you! This is exactly why I included the code, to see if someone could point out the weak points. I am not using this exact code anymore but use the same slow code in other places. Good to know it can be optimized. When updating the whole screen I have about half of the available CPU time left. No problem at this point but if the X16 ends up with a clock frequency of 4 MHZ I might run into trouble...
  8. pastblast meant that, if the starting address is even, then it always needs an even number of increments to make the lower byte overflow. (If the address starts at $FE, then one increment cannot overflow -- only two increments can do it.) Therefore, the odd-numberred increments don't need to be tested. Another -- even bigger -- improvement in speed can be gained by using an indexing address mode. Registers are incremented faster that zero-page memory. ;Update top leftmost 21x16 tiles of 32x32 tilemap. lda #<_tilebuffer ;set tilebuffer pointer sta ZP0 lda #>_tilebuffer sta ZP0+1 lda #<L0_MAP_ADDR ;set tilemap pointer sta VERA_ADDR_L lda #>L0_MAP_ADDR sta VERA_ADDR_M lda #$10 sta VERA_ADDR_H ldy #16 ;16 rows sty COUNT ldy #$00 -- ldx #21 ;21 columns of 2 bytes each - lda (ZP0),y ;copy tile from buffer to tilemap sta VERA_DATA0 ;write first byte of column iny lda (ZP0),y sta VERA_DATA0 ;write second byte of column iny bne + inc ZP0+1 + dex bne - clc ;add (32-21)*2 = 22 bytes to get addr. for next tilemap row lda #<22 adc VERA_ADDR_L sta VERA_ADDR_L lda VERA_ADDR_M adc #>22 sta VERA_ADDR_M dec COUNT bne --
  9. Oh, sorry, I missed your comment. Thanks for taking time to read the code! But no, it will not work. I think you interpret BNE as testing if a number is even or not. It is only testing if it is zero. What I basically do is adding 1 to a 16 bit number (in this case an address pointer). This can be done most easily by increasing the lower byte all the way until it wraps from $ff to $00 at that point you increase the high byte and start over again with the lower byte. Do I understand you right? I am also trying to get a grasp on 6502 assembler, it’s been a while... and I haven’t really begun to learn until now.
  10. Yesterday
  11. Thanks! I am now reading Machine Language for Commodore Machines. And am typing in code now Also thanks for your youtube Hello World video and answering my questions there
  12. You can certainly do just that, use mon to write the code and then the emulator debugger for actual debugging. You will have to kick off your program from BASIC to start running, and then you can use the debugger to set breakpoints and step through it.
  13. Hello all, I just worked thorough the Easy 6502 tutorial with its assembler/debugger. Is there something similar that can be ran inside the X16 emulator? Maybe some combination of using -debug and mon? By similar I mean I can type in assembly code, assemble it, then either run it or step through it with a debugger. Thanks!
  14. Yeah, I was surprised by the comment, too, because I "grew up" on the Motorola 6809E in the Color Computer, which not only has a hardware multiply instruction, but also 4 index registers (X, Y, U, and S). The auto-incrementing made memory-to-memory copies a breeze.
  15. If you're modulo-ing by a power of 2, it can be done much faster with an AND: 10 A = 111 20 REM MODULO 4 IS JUST THE LOWEST TWO BITS 30 M = A AND 3 40 PRINT M
  16. Back when I used to program an 8-bit home machine, I would use the following for MOD: a mod b === a - int(a/b) * b Example: 10 A = 111 20 B = 4 30 M = A - INT(A/B) * B 40 PRINT M This will print a value of 3.
  17. I realize that you determined a better way to do things (i.e., to use double buffering), but I was wondering whether you got a chance to see my comment about your sample code, and the "bne/inc" instruction pair. Do you agree with my evaluation?
  18. Thanks for the comment Mikael. It seems that there was some interference between effects library and some VERA related actions from BASIC programs, specifically in your case, scrolling of the screen. I added some code to save and restore VERA state inside the IRQ Player. I tried both EFFECTS.PRG and EFFECTSHI.PRG with your program and it seems to work without problems now.
  19. Tiled Map Editor BASIC DATA export View File This file is a JavaScript extension for the Tiled Map Editor. It will export your Tiled map as BASIC DATA statements. Inspired by Johan Kårlin export files. When exporting it will prompt for the starting BASIC line number. The script will output a few data statements about the map. Then the tile data will be output in DATA statements with 16 elements. Submitter Justin Baldock Submitted 09/24/20 Category Dev Tools  
  20. Version 1.0.0

    1 download

    This file is a JavaScript extension for the Tiled Map Editor. It will export your Tiled map as BASIC DATA statements. Inspired by Johan Kårlin export files. When exporting it will prompt for the starting BASIC line number. The script will output a few data statements about the map. Then the tile data will be output in DATA statements with 16 elements.
  21. No worries, everybody has made this mistake at least once. If you have too much time you can read up following two posts on why it behaves this way: Mathematical explanation: http://www.righto.com/2012/12/the-6502-overflow-flag-explained.html If you want to go to the level of silicon: http://www.righto.com/2013/01/a-small-part-of-6502-chip-explained.html
  22. Last week
  23. Yeah I updated the script to use the correct colours some time ago. Not sure why the version you had still discarded the lower nybble. Sent from my iPhone using Tapatalk
  24. Awesome ... not sure why that is not part of the official flight manual
  25. In the regex I wrote, the part you want to match is just the [AXY], so I put it inside of a capture group. That statement should choose only group 1 for the match. I found a reference to it here https://gist.github.com/Aerijo/b8c82d647db783187804e86fa0a604a1
  26. Hmm the regex is supposed to match the second part \b[AXY]\b but not if the first part is matched before (which is ^\s*[AXY] or beginning of line with any number of whitespaces followed by one character AXY ... that should actually work. what is this captures Statement doing? I could not find the right documentation to explain how the grammar file is setup.
  1. Load more activity
  • Create New...

Important Information

Please review our Terms of Use