Jump to content

dmsc

Members
  • Posts

    1,172
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by dmsc

  1. Hi! I don't understand, that is exactly how Altirra works if you set the image to "R/W", just there in the disk-drives window. And this is not the default because people tend to overwrite it's images in this mode 😛 Have Fun!
  2. Hi! Here is a version without a table - it is still 2 more characters than the table solution by Vitoco, but it does not use any special symbols: n=x/16+x&15*256:n=n!(n*4)&13107:n=n!(n*2)&21845:n=n*3 The way this works is, starting with the binary number ABCDEFGH: 00000000ABCDEFGH n=x/16+x&15*256 0000EFGH0000ABCD n=n!(n*4)&13107 00EF00GH00AB00CD n=n!(n*2)&21845 0E0F0G0H0A0B0C0D n=n*3 EEFFGGHHAABBCCDD Have Fun!
  3. Hi! Yes, parameters in procedures are not local, so you can't call a procedure recursively and expect them to retain the value. But of course, you can implement recursion if you save the values in an array, and the parameters are a good way to minimize your program in a tenliner 🙂. Do you have a recursive function that need to implement? This is an example of a recursive QuickSort, using an array as a stack to store the variables that need to be preserved between calls: proc QSort i0 i1 if i1 < i0 + 10 ' Use insertion sort for small arrays for i=i0 to i1-1 temp = p(i+1) for j=i to i0 step -1 if (p(j)) <= (temp) then exit p(j+1) = p(j) next p(j+1) = temp next else ' Set pivot to 'i1', do the partition temp = p(i1) j0 = i0 - 1 j1 = i1 do repeat : inc j0 : until (p(j0)) >= (temp) repeat : dec j1 : if j1 = i0 then exit : until (temp) >= (p(j1)) if j0 >= j1 then exit x = p(j0) : p(j0) = p(j1) : p(j1) = x loop p(i1) = p(j0) : p(j0) = temp ' Recurse over smaller sub-array first stack1(lvl) = j0 if i1 - j0 > j1 - i0 stack0(lvl) = i1 : inc lvl @QSort i0, j0 - 1 : dec lvl @QSort stack1(lvl) + 1, stack0(lvl) else stack0(lvl) = i0 : inc lvl @QSort j0 + 1, i1 : dec lvl @QSort stack0(lvl), stack1(lvl) - 1 endif endif endproc The above can be minimized to: pr.QS i j:ifj<=i t.ex.:t=p(j):k=i-1:m=j:do:r.:inck:u.p(k)>=t:r.:decm:u.m<>i a.t>=p(m):ifk>=m t.ex.:x=p(k):p(k)=p(m):p(m)=x:l.:p(j)=p(k):p(k)=t s1(l)=k:ifj-k>m-i:s0(l)=j:incl:@QS i,k-1:decl:@QS s1(l)+1,s0(l):el.:s0(l)=i:incl:@QS k+1,j:decl:@QS s0(l),s1(l)-1:e.:en. Have Fun!
  4. Hi! Not easily, you need a better compression and a decompressor in assembly language. This is a little prof of concept, using the RAM under the ROM on the XL computers, needs 64K and decompresses each frame using directly to screen. Then, all the frame data is compressed again to allow loading from disk. I used my ZX02 compressor for both the individual frames and the complete program. There are 83 frames in total. Have Fun! raytrace.atr
  5. Hi! I made a disk based animation, uncompressed from disk to screen. All 100 frames were rendered with my code above, in FastBasic, then saved to disk and compressed. Decompression code: Have Fun! video.atr
  6. Hi! I suspected the original was EFG = XYZ - (I,I,0) , so EFG is the full relative vector, and crept from and old version with Z=1 and finally left unused. I removed that from my FastBasic version. The ray-tracing code is straightforward, the clever thing was testing only one sphere at a time, as after a reflection in one sphere you can only hit the other one - this makes rendering the two spheres as fast as rendering only one. Have Fun!
  7. Hi! In BBC Basic, you can specify more than one variable as argument to NEXT, you can write " NEXT M,N ", this is the same as "NEXT M : NEXT N". Also, you can omit the variable names so the "NEXT , " is the same as "NEXT : NEXT". I could add this syntax to FastBasic, it is a simple addition to the parser. Have Fun!
  8. Hi! From the original BBC source at https://bbcmic.ro/?t=9ctpk you can translate it to other BASIC. This is a FastBasic version, the ATR includes the Altirra Mathpack for more speed, it starts with Z=2.25 and goes further by 0.25 each frame. raytrace.atr
  9. Hi! This is not a bug in GTIA, but on the way the luma DAC works. The dark areas occur in the places where you go from 0111 bit pattern to 1000, the GTIA output is faster to transition from 1 to 0 then from 0 to 1 (because NMOS chips pull down), so the output briefly goes trough 0000, giving the dark line. The same occurs, but less pronounced, when going from 0011 to 0100, or from 1011 to 1100. The UAV fixes this by latching the GTIA output with a CMOS chip before feeding the DAC - this ensures that all bits transition at the same time. Have Fun!
  10. Hi! I don't see it in the program you posted, lines don't grow and go to both sides of the screen. Here is a BAS file you can try: lines.bas I also converted your program to FastBasic for a faster experience, attached is the source and compiled binary. Have Fun! lines2.xex lines2.fb
  11. Hi! A typical quartz oscillator has +/- 100ppm of precision, so you are good enough. Have Fun!
  12. Hi! Note that this will be true fo many expressions, in general "a = some_expression + b" is faster than "a = b + some_expression". Have Fun!
  13. Hi! Thank you! I have the luck of living near the beach and in the more developed areas - so we are somewhat more protected from the current fires. But the emergency alarms in the mobile phones are constantly ringing. Sadly, we are getting used to the forest fires in the summer, but this one has been extremely big, and got into the city into an industrial zone and a few populated areas - it has been really bad. A combination of a rainy winter plus now a few extremely hot and windy days. Have Fun!
  14. A quick conversion, photo from my window: Have Fun! dmsc_Humo-1.6.xex
  15. Hi again! Ok, fixed now, but I should rewrite the FORMAT command completely at some point, replacing the old boot loader with something smaller. The problem is that the boot code should be capable of loading current BW-DOS (at $2300) and old one (at $36E0), so the current location will only boot the new BW-DOS. Currently I put the BOOT code at $3E00, this will not work with old BW-DOS. I will probably rearrange things a little. Have Fun!
  16. Hi! The problem is the last commit: I lowered the load address to allow booting on 16K machines, but I forgot to change the boot code included in the FORMAT command, and it now loads over the boot sector code. The reason the original image works is that MKATR uses a different boot loader that resides in low memory. I will fix it ASAP. Have Fun!
  17. Hi! Why not simply press the big "Start New Topic" button? Have Fun!
  18. Hi! It is right above in this same thread! Have Fun!
  19. Hi! The value $3FFF is what you will read if the joy2pic is not connected to the port (the first joystick port), or if the PIC is not installed into the socket correctly. I would verify all the connections and the soldering of the components. Using a multimeter, you can also check that when the programming software runs the PIC is receiving the 5V in the power pins and more than 9V in the reset pin. Have Fun!
  20. Hi! I suspect he needs to enable VBXE support... Have Fun!
  21. Hi @mytek! Happy New 2024, hope it is great year for you! The problem is not in the calibration byte, but in the configuration word. The datasheet says: So, bits 9 to 11 should always be 0. But your HEX file (both TKNUCFN and TKNUCSD) have a value of 3FC4 specified. A simple fix is to edit the HEX file and in the line before to last, change the ":02400E00C43FAD" with ":02400E00C431BB", that should make the programming work. The other fix is to see what generated your HEX file and put the wrong bits there. Have Fun!
  22. Hi! Please create a bug report over github, so we can fix it. The code is different in version 5.2, so the patch will not be identical. Have Fun!
  23. Hi! Thanks for the new version! I discovered a compatibility problem with the ALtirraOS mathpack and the MAC65 version from here: https://seriouscomputerist.atariverse.com/media/atr/OSS Mac-65 4.2.atr When you activate the "auto-number" (with NUM or with ENTER #,A), the line entry fails: This is because MAC65 calls AFP two times in a row, and expects that when the conversion fails the value of FR0 is left as is. AltirraOS clears FR0 at the start, before checking if the next character is a valid one, so MAC65 sees an invalid line number and errors out. Looking at the AFP code, sadly this is not an easy fix , as there is only one byte available in that part. Have Fun!
  24. Hi! Perhaps you could try reading the help of the emulator? Hint: right of the menu that was shown in the shot above. Have Fun!
  25. Hi! When you compile your FastBasic program, you generate a binary executable file. So, you need to execute a binary file from another. With the provided BW-DOS, you can use XIO 40, this will also work with SpartaDOS-X, XDOS and MyDOS: ? "Press any key:"; GET K CLOSE #1 : XIO #1, 40, 4, 0, "D:MENU.COM" Have Fun!
×
×
  • Create New...