Jump to content

mobluse

Members
  • Content Count

    54
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by mobluse


  1. It might be possible to write a CP/M 8080 emulator for X16, just like there exists one for C64, which I tested some years ago.

    I tested the following 8080 emulator with CP/M on Raspberry Pi in 2014:
    https://nanochess.org/emulator.html

    This source code is rather difficult to understand, but one could write an Intel 8080 emulator from scratch that has the same instructions for peripheral operations and then the rest of the files should work. Not all CP/M software works on 8080 since Zilog Z80 was more common. I have PCs with V20 and V30 CPUs (80186 super set) that can emulate 8080 in hardware and there was also CP/M-80 for PCs that used that 8080 emulation. My Amstrad PC1512 had originally 8086 CPU, but I switched it to V30.

    I found a tutorial on how to write an 8080 emulator: http://emulator101.com/

    • Like 1

  2. From the release notes for r38: "changed PETSCII screen codes $65/$67 to PET 1/8th blocks"

    I don't see any difference between X16 and C64. I tried this code in x16emu:

    5 SCREEN0
    10 ?CHR$($65);CHR$($67)

    and this in x64 in VICE 3.4 SDL2:

    5 ?"{clear}";
    10 ?CHR$(6*16+5);CHR$(6*16+7)

    ({clear} is Shift+Home i.e. a reversed heart.)

    What is the difference between the C64 character set and X16? I think it's good if there are identical characters in C64 that they are different in X16, because there is no point in having identical characters. It is a problem of how to print them since the Style64.org PETSCII font probably only supports C64.


  3. I use GNU Nano as my main editor in Linux and I noticed a disadvantage of Ctrl+U (Uncut) in X16 Edit: Ctrl+U can only paste once in X16 Edit, but several times in Nano. I hope this will change because I often use Ctrl+U several times in Nano and would like to do so in X16 Edit. I believe there is no advantage of emptying the cut-buffer after the first uncut/paste.

    • Like 1

  4. There are emulators for other computers that run in a terminal e.g. https://atari800.github.io/ and http://rullf2.xs4all.nl/sg/zx81ce.html. The output of x16emu can be sent through a filter program that converts PETSCII to UTF8: https://github.com/mobluse/x16-petscii2utf8

    The difficult thing is to get the keys you press (key down and key up events) in the terminal to be sent to x16emu. I once hacked x16emu so that this was possible, but that slowed down the emulator. One would also need to remove the GUI to make it independent of X and SDL.


  5. I tested my game Aritm using the "Try it now" feature in Chrome on iPhone 8 Plus and it works well, but it requires a Bluetooth keyboard since the web emulator of CX16 doesn't have a screen keyboard and the phone's own touch keyboard doesn't come up.

    If I click outside the CX16 screen and scroll and return, the Bluetooth keyboard stops working, even if I touch the X16 screen. If I then touch the close button (X, actually a zoom out button) and then go full screen again the Bluetooth keyboard works again in the Commander X16 emulator.

    Another issue (that isn't only for phones) is that the speaker mute button shows as muted from start, but there is sound (e.g. if you enter wrongly in Aritm) from start. If you toggle the mute button a couple of times then it shows correctly the same way as on e.g. YouTube.

    (It can be difficult to type "-" (minus sign) on some international Bluetooth keyboards, therefore I've added "." (point/period/stop) as an alternative to minus. Actually, this alternative has existed for a long time since I had this problem in other emulators too.)

    Maybe @SebastianVoges can help.


  6. The title in Featured Downloads is overlapped by the name of the developer. This is so in all browsers I tested this in: Chromium, Vivaldi, and Firefox in Raspberry Pi OS. If I press Ctrl+- twice I get zoom 80% and then it doesn't overlap, but that makes the text too tiny. I have 1280x1024 pixels screen.


  7. On 4/2/2021 at 7:10 PM, Snickers11001001 said:

    Reading the description of the 'bug' that is the subject of this thread, it occurs precisely because of the same shortfalls of the c64 collection mechanism that cause it to be slow and problematic.   So putting in the better garbage collection from Plus4/C128 should both negate the bug and vastly improve GC in general.   Focusing on fixing the 'long standing' bug alone while staying with the crappy C64 style GC would, in my view, be an exercise in esoterica rather than productive use of coding efforts.

    Putting in the better GC of C128 would not help since the bug is also in C128: "I found this bug in all versions of Commodore BASIC, that I investigated, VIC-20, C64, C128, C65, MEGA65." https://c65gs.blogspot.com/2021/03/guest-post-from-bitshifter-fixing.html

    • Like 1

  8. I developed RatBAS2 in order to generate large BASIC v.2 programs from C-like source code:
    https://github.com/mobluse/ratbas2

    RatBAS2 is similar to RatFOR (Rational Fortran). I discovered that RatFOR could be used to generate BASIC since it is similar to Fortran 66 and modern RatFOR has a disabled Fortran 66 mode that I could enable.

    RatBAS uses only IF...GOTO, but BASIC does have FOR...NEXT loops, ON...GOTO, GOSUB, and ON...GOSUB also. Unfortunately the program that turns a program in BASIC with labels into BASIC with line numbers doesn't handle the ON... constructs. FOR... NEXT is probably faster than using IF...GOTO.


  9. I think VAL() should work for hexadecimal numbers and not only for decimal as it does now.

    PRINT VAL("$FFFFFFF")
    should print: 268435455.

    I believe it would not be too difficult to implement since the code already exists for converting numbers in code.

    PRINT $FFFFFFF
    works now, and types: 268435455.

    Especially now when HEX$() exists in the next prerelease (-39). HEX$() converts without $ as prefix, but I think that's OK since $ could be added easily if one wants. It's also similar to how it works in other BASICs, e.g. GW-BASIC: http://www.antonis.de/qbebooks/gwbasman/hexs.html

    In GW-BASIC HEX$() also works for negative numbers, e.g. HEX$(-32768) is "8000", but negative numbers doesn't currently work with X16 BASIC HEX$().

    I don't think it's necessary to implement VAL() for binary numbers, even though BIN$() exists, but if one did they should probably have % as prefix, e.g. %101.

    FreePascal uses the same prefixes:
    https://www.freepascal.org/docs-html/ref/refse6.html


  10. 1 hour ago, AndyMt said:

    I'm in the process of updating Brixx and Invaderz to the new emulator and ROM. I want them to be compatible with R38 and R39 - but how can I detect which version the PRG is running?

    I know I can detect if I'm running in the emulator:
        read $9FBE/$9FBF, must read 0x31 and 0x36

    This doesn't seem to be the version, just an indicator that the software is running on the emulator. Is there an official way to detect ROM/emulator version? I found different solutions, but none seemed officially supportet. Like reading $FF80 or $FFFA etc.

    What's the best approach there?

    "The KERNAL version can be read from location $FF80 in ROM. A value of $FF indicates a custom build. All other values encode the build number. Positive numbers are release versions ($02 = release version 2), two's complement negative numbers are prerelease versions ($FE = $100 - 2 = prerelease version 2)." - https://github.com/commanderx16/x16-docs/blob/master/Commander X16 Programmer's Reference Guide.md

    • Like 1
    • Thanks 1

  11. There is a flow control command in Applesoft BASIC that might be good to have in X16 BASIC:

    POP
    Removes one address from the return stack, i.e. converts last GOSUB into a GOTO.

    POP could be useful in more advanced BASIC programs. Maybe this could be solved using POKE, but it would be easier with a BASIC command, and then more old Applesoft BASIC programs could run on Commander X16. I did find two programs that uses POP:
    https://github.com/inexorabletash/jsbasic/blob/master/samples/sample.nuclear.txt
    https://github.com/inexorabletash/jsbasic/blob/master/samples/sample.pacman.txt

    https://www.calormen.com/jsbasic/reference.html
    https://www.landsnail.com/a2ref.htm


  12. On 3/5/2021 at 8:39 PM, Nero said:

    As I was hoping to 're-learn' BASIC not too long ago, I was planning on porting one of those old 'book games' into BASIC. Actually began doing that in an old Apple II emulator, since it was the computer I learned BASIC on, but now I'm more or less inclined to do it in the X16's emulator and see what happens. I have never even seen a real C64 in my life, let alone programmed in one. Is there any place where I can check the differences between Applesoft's and X16's/Commodore's BASIC? Or... is there any practical difference? Sorry for the newbness, but we gotta start somewhere 😛

    In VIC20, C64, and X16 BASIC the AND, OR, and NOT operators are bitwise, but in Applesoft they are logical/boolean. 3=3 is -1 in X16 etc., but 1 in Applesoft. STR$(7) has an extra space for sign in X16 etc., but not in Applesoft. Applesoft is described here: https://www.calormen.com/jsbasic/reference.html
    X16 BASIC is the same as C64 BASIC (CBM BASIC v.2), but with enhancements: https://github.com/commanderx16/x16-docs/blob/master/Commander X16 Programmer's Reference Guide.md
     


  13. I could load the C128 program X16C128W70.PRG (above) in x16emu from the host file system using LOAD"X16C128W70.PRG" and LOAD"X16C128W70.PRG",8 but not using LOAD"X16C128W70.PRG",8,1. I've not tried to LOAD from SD card.

    Also I do not get the text "SEARCHING...
    LOADING FROM $..." but only "READY."

    Maybe you have a different release than 38 or this is how it looks when you load from an SD card.

    Anyway, I think loading should work in Commander X16 as in Commodore computers, because that is what most people expect and know how to handle.


  14. What do you mean would happen with the three line program where one line is skipped by linking in the cases ,8 and ,8,1 and x16emu -prg?

    I have two programs 3LINES.PRG and 3LINES2.PRG. The last is the hacked version where line 1 links to line 3.

    x16emu -prg 3LINES2.PRG
    and LIST gives two lines, but LOAD with ,8 and ,8,1 gives three lines in both x16emu and x64 from VICE.

    It seems that the program is repaired with both ,8 and ,8,1.

    3LINES.PRG 3LINES2.PRG


  15. There are pointers to the next line in the BASIC lines, but the computer doesn't know what it is loading and updates the pointers anyway, but one can probably fix that by having the machine code after the last line of the program.

    I think I can solve the original problem anyway by using SYS to set screen with to 40 characters in X16 and C128:
    POKE 780,0:SYS 65375

    screen_set_mode/$FF5F
    https://github.com/commanderx16/x16-docs/blob/master/Commander X16 Programmer's Reference Guide.md#function-name-screen_set_mode

    I could use screen/$FFED to get the rows and columns, but that doesn't seem to work on C128 - tested in x128 and x128 -80col:
    SYS 65517:R=PEEK(782):C=PEEK(781)

    BTW screen_set_mode in C128 is slightly different than in X16 since in C128 it switches between two different physical screens with different screen dimensions AFAIK. In the x128 emulator you have to switch screen manually in the configuration menu.


  16. Edit: THIS IS WRONG, BECAUSE WHEN I TEST IT NOW IT DOESN'T WORK.

    But it works in xpet and x64 if I change the two start bytes in the C128 file (X16C128W70.PRG) to the correct address for the computers, respectively, and load as machine code with e.g.:
    x64 -autoload X16C128W7064.PRG
    That uses:
    load "X16C128W7064.PRG",8,1

    It also works if I load using:
    LOAD "X16C128W7064.PRG",8,1
    in x16emu.

    That would mean that if you load with ',1' it also changes the pointers, but that would make it difficult to load machine code in C64, since LOAD would change the two bytes after a 0, but I've never heard that is a problem. Does the LOAD"*",8,1 detect if it is a BASIC or machine code program, and try not to modify pointers if it is machine code?

    Also if people write machine code assuming -prg doesn't change the code, then they might not be able to run the program from within x16emu or the real computer.

×
×
  • Create New...

Important Information

Please review our Terms of Use