Jump to content

Johan Kårlin

  • Content Count

  • Joined

  • Last visited

  • Days Won


Johan Kårlin last won the day on December 1 2020

Johan Kårlin had the most liked content!

Community Reputation

78 Excellent

1 Follower

About Johan Kårlin

  • Birthday 08/09/1971

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I do exactly this in my new game project where I use 64 Kb tilemaps. Just change the tilebase address for layer 0 in RAM address $9f2f and copy the character set to the new location.
  2. Really great that you are interested in contributing with some hardware expansions! Welcome!
  3. I remember starting out with VERA a long, long time ago (= more than a year). I tried to figure out what concepts like tiles and layers even meant. In those days there were no tutorials by Dusan, very few programs with source code to study, but luckily I had great help of Stephen’s legendary, unofficial documentation. This is the true story of how the West was won, or maybe not, but definitely a story of how a new interest in assembly programming was found. [emoji4]
  4. Whether sprite positions are signed or unsigned numbers is a matter of preference as I see it. A binary number does not know if it is negative or not, the interpretation is up to you. The problem with seeing it as a signed number is as you point out that after position 511 comes -512 but your sprite is still visible in the right part of the screen if your resolution is 640x480 which can be confusing. The advantage is that you can push the sprite over the top and left border by just setting the position to -1 which is more intuitive than setting it to 1023. When making scrolling games you constantly calculate sprite positions. I use 16 bits arithmetics. It works fine because the 6 most significant bits are just ignored by VERA. For example -1 = 65535 = %1111 1111 1111 1111 but it is also -1 if you just look at the 10 least significant bits. In the end I check if the calculated position is between -256 and 512 (requires only checking of the upper byte), if not I disable it. This is to avoid the risk of having sprites disappering to the right and suddenly turn up on the left and vice versa.
  5. There is actually nothing to wait for : ). Sprites can absolutely be displayed partially on the top or left edge of the screen. Positions are represented by 10 bits (= 0 - 1023) and wrap around which means that 1024 is the same as 0. Let's say you have a sprite that is 32 pixels wide. If you set the horizontal position to 1024 - 16 = 1008, the right half of it will be visible.
  6. Interesting, not least to see your VERA macros! But it still feels a bit awkward. I can end up having a numbers of flags for macros with several variables.
  7. It works but you must make sure all filenames are in capital letters. The file suffixes must also be whitelisted by the server. [mention]desertfish [/mention] ran into that problem when he tried to load image files with the suffix “KOA”. When he changed to “BIN” it worked.
  8. @lamb-duh That is an interesting solution. RPN brings memories to life, in high school, the coolest of my classmates had Texas Instrument calculators using this. I have to dive deeper into this. Interesting that you mention passing of parameters too. I have tested once to use inline parameters for and then use the ordinary stack to access them from the subroutine. Clever but adds extra code. But if you use your own stack, of course this is suddenly a lot easier. @paulscottrobson Well, right or wrong processor, I don't know. The only real experience of assembly language I have before this is from the Amiga and I can admit that I sometimes miss the 68000. I guess the discussion of how limited a retrocomputer should be will continue forever : ).
  9. I am still changing a color. I read somewhere that C64 game developers often just did inc $D020 to change the border color in the beginning and in the end of the interrupt handler. Very easy and useful. On the X16 it’s an easy solution too. Most of the times you don’t need an exact value, you just want to make sure that you have a lot more cycles to spend. [emoji846] But still it’s surely interesting that there is a counter at $9fb8, I had no idea.
  10. I just pasted it from VS Code. It looks great on my laptop but on Tapatalk linebreaks are missing. I don't know what the best way of sharing code snippets is?
  11. This is not the simplest byt quite useful. It is from my own library of text routines. _row, _col and _color are global variables that must be set. Text layer must start at $00000 which is the default. The string(s) to print must be in screen code not ascii/petscii. !macro Inc16 .addr { inc .addr bne + inc .addr+1 + } VPrintString: ;IN: ZP0, ZP1 = address of string terminated with 0. OUT: ZP0, ZP1 = address of string termination + 1 (to make printing of a string array easier) lda _col asl sta VERA_ADDR_L lda _row sta VERA_ADDR_M lda #$10 sta VERA_ADDR_H ldy _color - lda (ZP0) beq + sta VERA_DATA0 sty VERA_DATA0 +Inc16 ZP0 bra - + inc _row ;increase row and +Inc16 ZP0 ;increase pointer possibly to a string that follows directly after rts
  12. Thanks for the tip! I bought one too that I found on German Ebay. It was not the easiest to understand the German I can say but ”bieten” obviously meant what I was hoping for : ).
  13. Thanks for your answers! @StephenHorn I took a look at math.inc. It is clearly a better way of doing it compared to what I am doing now. I guess I have reached the limit for what ACME can do. Both for this and other macro implementations it would really be a relief to not have to write multiple macros just to cope with the fact that parameters can be passed by value or reference. After my current project I will probably start developing with ca65 instead. By the way - why not finish math.inc and upload it as a development tool : )?
  • Create New...

Important Information

Please review our Terms of Use