Jump to content

nanochess

+AtariAge Subscriber
  • Posts

    7,111
  • Joined

  • Last visited

  • Days Won

    21

nanochess last won the day on October 27 2022

nanochess had the most liked content!

About nanochess

  • Birthday November 4

Profile Information

  • Custom Status
    Coding something good
  • Gender
    Male
  • Location
    Mexico City
  • Interests
    MSX, Colecovision, Atari VCS/2600, Intellivision, Sega Master System, TI-99/4A, NES.
  • Currently Playing
    Mr. Chess for Intellivision ;)
  • Playing Next
    I should make something new! ;)

Recent Profile Visitors

53,352 profile views

nanochess's Achievements

Quadrunner

Quadrunner (9/9)

7.8k

Reputation

  1. The second column is the frequency, but I cannot make sense of the left column.
  2. Now available my new book Programming Games for Colecovision

     

  3. I'm glad to say that Programming Games for Colecovision is now available in paperback format (hardcover soon to be available). You can order copies now from Lulu: https://www.lulu.com/shop/oscar-toledo-gutierrez/programming-games-for-colecovision/paperback/product-95qvzj8.html?page=1&pageSize=4
  4. It would be better if you upload the whole output file. That single line doesn't look too recognizable.
  5. Anything you write to VRAM (DEFINE CHAR, DEFINE BITMAP, DEFINE SPRITE, SPRITE, SCREEN) is "eternal" until you erase it. It doesn't matter if you change banks, as these are local to CPU, and the VRAM is completely separate. The correct way to disable a sprite is by using SPRITE num,$D1,0,0,0 For example, you can see an example in Camelot Knights source code where I erase sprites 4 to 31. FOR c = 4 TO 31 SPRITE c, $d1, 0, 0, 0 NEXT c
  6. @Pixelboy is right. Technically we have two 16K banks sitting together in the 32K cartridge area ($8000-$ffff). The $8000-$bfff area is always BANK 0, while the $c000-$ffff area can be any bank, and that's the cause you can only select banks when you are running at the global bank ($8000-$bfff can change the bank at $c000-$ffff, but you cannot execute at $c000-$ffff and change the bank at $c000-$ffff because it would disrupt execution). Also, there are two tricks inside CVBasic to ease the programmer's life. One, the ON FRAME GOSUB subroutine must be at bank 0, but inside that subroutine, you can switch to any bank. This is because the video interrupt subroutine saves the current bank, and restores it in exit. Totally transparent for the user, and allows you to make for very complex handling on interruption. Two, the PLAY statement saves the bank number of the melody you want to play. This is because the music player is called in the video interrupt subroutine, so the music tracker can play melodies from anywhere the 1MB of ROM. Otherwise, you would be limited to putting melodies in the global bank, and melodies can "eat" a lot of ROM space.
  7. The variables without # prefix are 8-bit variables, and the numbers by default are 16-bit unless you add a period as suffix. You'll get the correct result with this (two's complement arithmetic with 8-bit): a = -1 print at 0, 12.+a Notice the period after the number. Remember whenever you use a 16-bit variable or number, CVBasic will extend internally the processing to 16-bit. Any 8-bit value will be zero-extended to 16-bit. So for the first example, the right way to do the arithmetic is: #a = -1 print at 0, 12 + #a Normal BASIC language doesn't have types, but CVBasic actually enforces two types: 8-bit and 16-bit. This is in order to generate more optimized Z80 code.
  8. Three days to go! Currently, Canyon Escape leads the pack, Sheep it up! near, and very close The Blob!
  9. I suppose you mean for display. Currently, there is no direct support to display negative numbers. But you can always do it the other way: IF #value >= 32768 THEN PRINT "-",-#value ELSE PRINT #value END IF
  10. If you need the same routine in multiple banks, it is better to have it in the global bank. If for some reason you want to repeat a subroutine in multiple banks, you would need to have a different name for the subroutine in each bank. The compiler doesn't keep track of the bank of each subroutine.
  11. If you need a global routine, you should put it in the global bank. To call a subroutine in another bank you use: BANK SELECT 1 GOSUB routine_in_bank_1 WHILE 1: WEND BANK 1 routine_in_bank_1: PROCEDURE [...code...] END
  12. You can put both code and data inside a BANK. The only constraint is that BANK SELECT can only appear in the global bank 0 (the default after you set BANK ROM) There is an example included with CVBasic called bank.bas
  13. It is better to put your image as a 24-bit BMP file, and process it with TMSColor. It will generate the minimum number of tiles, using for example: tmscolor -t128 -b your_image.bmp your_image.bas your_image
  14. The correct value to end sprite processing is 208. However, CVBasic currently does sprite flicker by default (rearranging sprites on the screen), so you need to invoke SPRITE FLICKER OFF to use the 208 value.
×
×
  • Create New...