Jump to content

witchspace

New Members
  • Content Count

    19
  • Joined

  • Last visited

Posts posted by witchspace


  1. Have you heard of/looked into the Sundog Resurrection Project?

     

    http://www.sundogresurrectionproject.com/

    Yes :) I think it's great that they're working on that. After all, the game was supposed to be a trilogy. 33 years late is better than not.

     

    But indeed, my project's goal is different, it is about nostalgia and history and making the original game more accessible. I very likely won't be adding any new missions :)


  2. Just found the code responsible. It is exactly as you say. Track 3, sector 7 is read then the data is discarded, that read is just to (mis)direct the drive. Then Track 3, sector 4,5,6 are read. Sector 4 is check-summed and compared, and if it fails a state word is set which eventually leads to the Red screen of Death.

     

    This is in addition to the per-track integrity check I posted about above. FTL was certainly paranoid :)

     

    In my port I just pull down the state word involved in these checks. Too lazy to implement a more accurate implementation of the floppy controller just to make this weird code happy.


  3. Seems MAME is caving in and going against what they once said they'd never do. And that is to use the GPU.

     

    My opinion, they have to. Given that processor development and increases in speed is all but at a standstill these last couple of years.

     

     

    The way you word it, it sounds almost like they had a deep philosophical issue with using GPUs? (for anything but rendering/scaling the final image?)

     

    I guess because in the early days of GPU computing it all was proprietary and unstable and limited to a few vendors. Today, OpenCL and OpenGL compute shaders are mature open standards and supported by any GPU vendor worth it's salt, even embedded ones. Integer arithmetic is now available, which relieves the precision concerns with floating point handling on some GPUs.

     

    Depending on the algorithm it is usually more work to write certain code for GPU, though, that still limits their use in open source projects. Having to implement things twice, once for CPU and once for parallelized GPU doesn't really help either.

    • Like 1

  4.  

    Keep in mind: We are talking here an unreleased computer (TI-99/8) depending on using unreleased hardware (Armadillo Bus interface for the 99/8 to the PEB or the Hex-Bus Disk Drive Controller) running unreleased software (P-System for the 99/8). You can hardly except Out-of-the-Box Functionality like for End-User Products,

    I fully realize that. My interest is historical. I don't intend to use it for safety critical production use.

    That's what I use DosBox for icon_angry.gif

    Simulating a computer that never really existed, from just prototypes, is fantastic. Keep up the great work!


  5.  

    Please give me some details about your hard way. As you seem new to the forum, I'd like to tell you that I actively maintain the TI emulations in MAME (formerly MESS) and that I am happy to help whereever possible. I am, of course, depending on feedback and bug reports.

     

    The TI-99/8 emulation in MAME is probably the most complete configuration that you can get among all real systems, with the exception of the still missing floppy drive support in Extended Basic II. The Pascal subsystem as well as many 99/4A cartridges proved to work. The Hexbus floppy is currently early work in progress.

     

    To be precies: I tried using all the possible floppy controllers with the TI99/8, with the TI99/4 Pascal floppy images and with none of them, the P-system detected a disk in the drive at all. The images work fine with TI99/4. But I suppose this is the way things are supposed to be, and TI99/8 needs different floppies for the development environment. Or maybe I did something wrong, I'm not very experienced with MESS.

     

    I don't have a TI99/8 nor ever had one but I'm interested in UCSD Pascal for various platforms. TI99/8 is especially interesting because the system had native support in BIOS for it.

    (another computer I'm very interested in is SAGE, but emulation for that isn't nearly as far progressed).


  6. Not too crazy. I'm working on a port of Sundog: Frozen Legacy to modern platforms.

    This uses the same principle as the SCUMM engine and ScummVM, or the Inform games and Frotz.

     

    This can work because Sundog was written, with the exception of a few small bits of 68k assembly, in UCSD/Softech Pascal. This compiled to a platform-independent p-code. So it was "just" a matter of writing an interpreter for the appropriate p-code dialect and I have most of the game running.

     

    With most other games, which tend to be written for the native platform this is going to be much harder. But I'm certain there are other cases where a game vendor used a single engine for a series of games and much of the game logic is scripted in the data files.


  7. So I recently played around with GEM on Atari ST a bit, and palette setting, and (re-) discovered this weird mapping between GEM/VDI and hardware color mappings:

    unsigned vdi_color_map[16] = { 0, 15, 1, 2, 4, 6, 3, 5, 7, 8, 9, 10, 12, 14, 4, 13 };
    

    Asking GEM VDI to draw a line, v_line with vsl_color 15 would give you a line in... color 13!

     

    I don't understand why they would do this. I really don't. Besides being confusing (it took me a while to figure out what was happening). It seems like a waste of resources, which was even more important on old, slow hardware. Why not just remap the palette?

     

    There may be some really interesting reason I'm missing.

     

    In any case I found this a curious old bit of computing history icon_smile.gif

     

    Edit: [email protected] this probably belongs better here: https://atariage.com/forums/forum/175-atari-stttfalcon-programming/


  8.  

    Exactly. Depending on which sector you read before you will get one or the other. It is also possible to perform a read track, but I don't think Sundog does that.

    Yes I can confirm Sundog only reads per sector. I would have missed any tricks with regard to ordering of reads, though, as I never realized that could be a concern. Thanks for learning me new things about 80's copy protection schemes icon_thumbsup.gif


  9. If you don't have access to them, I guess I should make some images of the UCSD Pascal V4.11 disks for the /8, since they are now useful to people other than me. . .

    These would be extremely useful to me. Already found out the hard way in MESS that the TI-99/4 P-system disks won't work :-)


  10.  

    Sundog is earlier than Dungeon Master and uses a much simpler protection. IIRC it is just a double or duplicated sector. That means that two physical copies, with different content, exist for the same logical sector with the same sector number.

    Interesting - how would a check for that work? I suppose which content it will get dependent on where the disk head went previously?

     

     

    I loved Sundog. Played the game to the very end more than once back at the day.

     

    A few years ago, one of the original developers of the Apple II version was attempting to create a modern version. Don't know what happened with that.

     

    Me too! I played it a lot back in the day and still like it a lot.

     

    As far as I know there have been multiple Sundog Resurrection projects, over the years, also with involvement with the original author, but I'm not sure they went anywhere.


  11. Ahhh, old, many times discussed FTL copy protection pulled out again. Not sure about Sundog, but Dungeon Master uses 2 level protection: 1st is sector number $F7 - what is not possible to create with WD1772 FDC. Another is fuzzy data in track 0 - what means intentional unreliable read, so diverse reading each time. And that is what IS CHECKED randomly during gameplay, with well hidden code in case of DM. If test fails, your party suddenly dies.

    Thanks, that's interesting.

     

    I'm not entirely sure but I think SunDog pulls any floppy disk weird sector tricks. There's only a small bit of native 68k code, the rest is p-system VM code which has no way to directly call the system. All disk i/o goes through one function which enforces simple 80 track/9 sectors/512 bytes, so I don't expect any out-of-range sectors used. The fuzzy trick is possible though.


  12. I wrote a small python script to verify the checksums on a raw disk image (sorry, only supports .st):



    #!/usr/bin/python3
    '''
    Verify SunDog: Frozen Legacy 3.0 Atari ST disk image.

    Only raw .st images are supported right now, not .stx.

    Usage:
    compute_checksums.py <image.st> <0|1>
    '''
    import sys
    import struct

    with open(sys.argv[1], 'rb') as f:
    data = f.read()

    sectors_per_track = 9
    tracks = 80
    base_track = 3
    sector_size = 512
    skipset = 0x182

    track_size = sector_size * sectors_per_track

    if int(sys.argv[2]): # use hardcoded data
    valid='''
    f2 52 71 8b 5e 15 ad 94 2c d2 b2 84 8b ef 9d ee
    65 c0 ed b0 24 0d 71 f0 2a 0b 30 3f bc b9 06 d8
    e4 d4 67 ec 2d 63 9b 27 f5 48 4d 45 15 6c 54 78
    25 ae 9d 17 21 37 57 44 8b de bc b3 f8 42 c6 aa
    45 3c a2 f1 da f4 1b 81 3b e5 0c 8e c6 31 da b6
    e2 4c c1 9f 30 7e 9b 21 52 99 69 8a 31 2c 3c 65
    47 a3 32 62 0a a8 07 4d c0 92 01 eb 03 d5 65 2a
    bd aa a6 6d 96 a4 06 eb 2c f3 8d 8e de 88 aa cf
    7c 34 dc c1 a2 4a 94 20 d9 45 74 eb 9a eb 08 9a
    4d 5f 25 ff 2d f5 ba 0b 28 8a f2 69 56 4b 08 d9
    '''
    valid = bytes(int(x.strip(),16) for x in valid.split())
    valid = struct.unpack('>80H', valid)
    else:
    valid = list(struct.unpack('>80H', data[0xd760:0xd760+2*80]))
    for x in range(80):
    valid[x] = (valid[x] - x*0x169)&0xffff

    for track in range(tracks):
    base = ((base_track + track)%tracks) * sectors_per_track * sector_size
    expect = valid[track]
    ptr = 0
    x = 0
    while ptr < track_size:
    (a,b) = struct.unpack('>HH', data[base+ptr:base+ptr+4])
    x -= a
    x += b
    x &= 0xffff
    ptr += 4
    if (1<<track)&skipset:
    s = 'SKIP'
    elif x == expect:
    s = 'MATCH'
    else:
    s = 'FAIL'
    print('%3i %08x-%08x 0x%04x 0x%04x %s' % (track, base, base + sectors_per_track * sector_size, x, expect, s))


    My output



    $ ./compute_checksums.py ./disk_image 0

    0 00003600-00004800 0xf238 0xf252 FAIL
    1 00004800-00005a00 0x075f 0x718b SKIP
    2 00005a00-00006c00 0x5e15 0x5e15 MATCH
    3 00006c00-00007e00 0xad94 0xad94 MATCH
    4 00007e00-00009000 0x2cd2 0x2cd2 MATCH
    5 00009000-0000a200 0xb284 0xb284 MATCH
    6 0000a200-0000b400 0x8bef 0x8bef MATCH
    7 0000b400-0000c600 0xfec6 0x9dee SKIP
    8 0000c600-0000d800 0xeb71 0x65c0 SKIP
    9 0000d800-0000ea00 0xedb0 0xedb0 MATCH
    10 0000ea00-0000fc00 0x240d 0x240d MATCH
    11 0000fc00-00010e00 0x71f0 0x71f0 MATCH
    12 00010e00-00012000 0x2a0b 0x2a0b MATCH
    13 00012000-00013200 0x303f 0x303f MATCH
    14 00013200-00014400 0xbcb9 0xbcb9 MATCH
    15 00014400-00015600 0x06d8 0x06d8 MATCH
    16 00015600-00016800 0xe4d4 0xe4d4 MATCH
    17 00016800-00017a00 0x67ec 0x67ec MATCH
    18 00017a00-00018c00 0x2d63 0x2d63 MATCH
    19 00018c00-00019e00 0x9b27 0x9b27 MATCH
    20 00019e00-0001b000 0xf548 0xf548 MATCH
    21 0001b000-0001c200 0x4d45 0x4d45 MATCH
    22 0001c200-0001d400 0x156c 0x156c MATCH
    23 0001d400-0001e600 0x5478 0x5478 MATCH
    24 0001e600-0001f800 0x25ae 0x25ae MATCH
    25 0001f800-00020a00 0x9d17 0x9d17 MATCH
    26 00020a00-00021c00 0x2137 0x2137 MATCH
    27 00021c00-00022e00 0x5744 0x5744 MATCH
    28 00022e00-00024000 0x8bde 0x8bde MATCH
    29 00024000-00025200 0xbcb3 0xbcb3 MATCH
    30 00025200-00026400 0xf842 0xf842 MATCH
    31 00026400-00027600 0xc6aa 0xc6aa MATCH
    32 00027600-00028800 0x453c 0x453c MATCH
    33 00028800-00029a00 0xa2f1 0xa2f1 MATCH
    34 00029a00-0002ac00 0xdaf4 0xdaf4 MATCH
    35 0002ac00-0002be00 0x1b81 0x1b81 MATCH
    36 0002be00-0002d000 0x3be5 0x3be5 MATCH
    37 0002d000-0002e200 0x0c8e 0x0c8e MATCH
    38 0002e200-0002f400 0xc631 0xc631 MATCH
    39 0002f400-00030600 0xdab6 0xdab6 MATCH
    40 00030600-00031800 0xe24c 0xe24c MATCH
    41 00031800-00032a00 0xc19f 0xc19f MATCH
    42 00032a00-00033c00 0x307e 0x307e MATCH
    43 00033c00-00034e00 0x9b21 0x9b21 MATCH
    44 00034e00-00036000 0x5299 0x5299 MATCH
    45 00036000-00037200 0x698a 0x698a MATCH
    46 00037200-00038400 0x312c 0x312c MATCH
    47 00038400-00039600 0x3c65 0x3c65 MATCH
    48 00039600-0003a800 0x47a3 0x47a3 MATCH
    49 0003a800-0003ba00 0x3262 0x3262 MATCH
    50 0003ba00-0003cc00 0x0aa8 0x0aa8 MATCH
    51 0003cc00-0003de00 0x074d 0x074d MATCH
    52 0003de00-0003f000 0xc092 0xc092 MATCH
    53 0003f000-00040200 0x01eb 0x01eb MATCH
    54 00040200-00041400 0x03d5 0x03d5 MATCH
    55 00041400-00042600 0x652a 0x652a MATCH
    56 00042600-00043800 0xbdaa 0xbdaa MATCH
    57 00043800-00044a00 0xa66d 0xa66d MATCH
    58 00044a00-00045c00 0x96a4 0x96a4 MATCH
    59 00045c00-00046e00 0x06eb 0x06eb MATCH
    60 00046e00-00048000 0x2cf3 0x2cf3 MATCH
    61 00048000-00049200 0x8d8e 0x8d8e MATCH
    62 00049200-0004a400 0xde88 0xde88 MATCH
    63 0004a400-0004b600 0xaacf 0xaacf MATCH
    64 0004b600-0004c800 0x7c34 0x7c34 MATCH
    65 0004c800-0004da00 0xdcc1 0xdcc1 MATCH
    66 0004da00-0004ec00 0xa24a 0xa24a MATCH
    67 0004ec00-0004fe00 0x9420 0x9420 MATCH
    68 0004fe00-00051000 0xd945 0xd945 MATCH
    69 00051000-00052200 0x74eb 0x74eb MATCH
    70 00052200-00053400 0x9aeb 0x9aeb MATCH
    71 00053400-00054600 0x089a 0x089a MATCH
    72 00054600-00055800 0x4d5f 0x4d5f MATCH
    73 00055800-00056a00 0x25ff 0x25ff MATCH
    74 00056a00-00057c00 0x2df5 0x2df5 MATCH
    75 00057c00-00058e00 0xba0b 0xba0b MATCH
    76 00058e00-0005a000 0x288a 0x288a MATCH
    77 00000000-00001200 0x0e6b 0xf269 FAIL
    78 00001200-00002400 0x33c8 0x564b FAIL
    79 00002400-00003600 0xe8a0 0x08d9 FAIL



    In my case I get "FAIL" for track 0,77,78,79. The last(=first) three tracks are used by TOS itself, so even touching a file will probably cause these to fail. The mismatch in track 0 (which is the p-system boot track) is more peculiar.


    I hope someone who still has the original disk can verify this.


    Edit: I verified the above .stx file after converting it to .st by copying it with fastcopy in the emulator. All tracks MATCH except track 0 is the same as in my image - maybe that one isn't supposed to be checked in practice, I'm not sure. In any case it's better than the image I had, thanks remowilliams.


  13. This happened to me on a real ST as well, in the 80's. More recently while reverse engineering SunDog I found the code for this.

     

    It's a game specific thing, not a TOS or emulator fail. There is explicitly code to draw a fullscreen red rectangle and go into an infinite loop. This seems to be triggered on "disk corruption". At disk accesses, randomly the 9 sectors in a random track are checked against a list of checksums. Something might be going wrong there, say due to an old disk rip or faulty copying or patching. If so it ends up in this state.

     

    The following p-code disassembly shows the code in question:

           ; start of procedure MAINLIB:0x05 RedScreenOfDeath
    007c:  .dw 0x0096
    007e:  .dw 0x0000
    007e:  91 2d       cgp 0x2d ; MAINLIB:0x2d ConditionalWait
    0080:  72 23       scxg3 0x23 ; GEMBIND:0x23 SetClippingRectangle2
    0082:  72 27       scxg3 0x27 ; GEMBIND:0x27 HideMouseCursor
    0084:  01          sldc1 
    0085:  72 16       scxg3 0x16 ; GEMBIND:0x16 SetWriteMode
    0087:  0c          sldc12 
    0088:  72 1a       scxg3 0x1a ; GEMBIND:0x1a SetFillColor
    008a:  00          sldc0 
    008b:  81 3f 01    ldci 0x13f
    008e:  00          sldc0 
    008f:  80 c7       ldcb 0xc7
    0091:  72 14       scxg3 0x14 ; GEMBIND:0x14 DrawFilledRectangle
    0093:  00          sldc0 
    0094:  d4 fd       fjp 0x93
    0096:  96 00       rpu 0x0
    

    I'm not sure it even is a copy protection, or just against modding/tampering with the game. Why? I have no clue. They go through all kinds of checksum dances to protect the library disks and savegames as well. FTL was really afraid of cheating? :-)

     

    I could patch it out or at even make sure a disk verifies as correct by updating the checksums.

×
×
  • Create New...