Jump to content

stepho

Members
  • Posts

    172
  • Joined

  • Last visited

Posts posted by stepho

  1. I'm a bit late to the party - oh well...
    @Andrew Davie's bit twiddling reminds me of DEC's radix50 method to pack 3 characters (selected from a set of 40) in 16 bits. See https://en.wikipedia.org/wiki/DEC_RADIX_50
    Relies on cheap multiplication to pack them and cheap division to unpack them.
    Packed format was essentially char*40*40+char2*40+char3
    Each character takes log(40)/log(2) = 5.32 bits.
    I used it on an ARM project a couple of years ago where I had to send text in very small radio packets between 2 devices. The reduced character set was adequate for my purposes.

  2. x MOD 2 just returns the lowest bit: 0 or 1.
    Replace with

    x/2<>int(x/2)


    Sure wish Atari Basic has bit operators.

     

    I agree with Rybags, probably meant to be (D-2) MOD 2 and (D-1) MOD 2.
    Except that (D-2) MOD 2 is always exactly the same value as D MOD 2 .
    (2 MOD 2) is of course just 0 and (1 MOD 2) is always 1 .

  3. For me in the late 80s and 90s on non gaming devices, I'd build my binary on a DOS based PC, burn the image to an EPROM, plug the EPROM in and see what happens.
    Also had a big pile of EPROMS being erased under a UV lamp.
    A RAM based EPROM simulator certainly would have made my job much easier - oh well, 20/20 hindsight.

     

    My equipment was modified to have a bank of LEDs hanging off it that my code would trigger on/off as it passed through various points (eg turn on LED3 when entering interrupt handler, turn off when exiting handler, or turn on LED5 when a particular state is reached).
    I'd hook up an oscilloscope to these LEDs, record a run and look at the recording to see the timing and which routines/states were being reached.
    I still use this technique for time sensitive code that can't be single stepped with a modern debugger (typically when my code is watching external signals that can't be slowed down).

  4. 15 hours ago, JetSetIlly said:

    If anyone wants to help/advise me on standard representation of audio data it would be very helpful.

    Since we mostly want to store frequency, volume and modulation effects, that's a pretty good match for MIDI.

  5. Sandbagging came from drag racing.

    Run the early part of the day with a bag of sand in the car, hidden from prying eyes.

    For the final race, secretly remove the sandbag.

    This works because to go faster you have to overstress the engine.
    Going faster means risking the engine blowing up, which would lose the race.

    If you think your opponent can do a 5 second run then you stress your engine to do a 4.9 second run.
    But if he removes the sandbag then he can do a 4.7 second run and win.
    You can second guess him by stressing your engine even more but if he hasn't used a sandbag then you have stressed your engine more than it needs and maybe blow it up when you didn't have to.

    • Like 1
    • Thanks 1
  6. Might be useful to remember what BCC and BCS stand for:

    • BCC - Branch if Carry is Clear (ie previous operation did not require a carry)
    • BCC - Branch if Carry is Set (ie previous operation did require a carry, typically)

    CMP is really just SUB that throws away the results but keeps the flags.
    So CMP XXX is really SUB XXX, which is really (reg A - XXX).

    • Like 4
  7. On 3/6/2023 at 7:09 AM, Alfred said:

    Around 1978 the highschool acquired a Compucolor II, and we were assigned physics problems that had to be done on it. Someone gave me a photocopy of the Adventure game source code in HP3000 Basic from an article in Byte. I spent a few months porting it to the Compucolor, and I would do everybody's physic's problems so I could maximize my time at the machine. I heard later they were kind of annoyed when I took the floppy disks with the game code on it with me when I left school. After that it was into IBM mainframes. Spent the nightshifts reading all the IBM manuals, learning PL/I, S/370 Assembler. So I was ready for 6502 assembler when I got an 800XL around 1985.

    Cool !
    My uni used Compucolour as terminals to the VAX VMS systems.
    First week at uni they gave us am 8" floppy and a few minutes of "insert disk, turn on, press '1', then login" for the less bright among us.
    Not many students realised that there was a full computer inside it.

  8. At school (8th grade) we had dial up access to a PDP-11/45 running Basic+.
    Later the school bought some CP/M machines for which I wrote a Z80 disassembler and some machine language graphic routines.
    Then in Uni I moved up to big iron - DEC-10, PDP-11/70, VAX-11/750 and an IBM 360.
    But I bought myself a second-hand Atari 800+1050 and used it to prototype a mini payroll package for my Pizza shop boss (first paid SW job).

    Handed in my third year uni project printed by a 1020 plotter (ie half width and half height of standard paper but still 80 column).

    • Like 2
  9. Sounds like the cable between the TV and Atari and the cable between the AtariVox and the speaker are joined somewhere.
    The AtariVox output is being put onto RF cable and merging with the RF signal.
    The TV interprets part of that signal as audio (hence hearing it on the TV) and part of it as video (hence lines on the TV).

    As someone said above, the sockets on the speaker are probably audio out (not in), so nothing is heard from them.

  10. https://theswissbay.ch/pdf/Gentoomen Library/Programming/Python/Thinking in Python (Bruce Eckel%2C Rev 0.1.2) - 2001.pdf
    https://github.com/BruceEckel/ThinkingInPython

    You do need to think in new patterns.
    Eg, the FOR loop is usually the wrong way to do it in python.
    Basic is a very old style language and simplistic.
    We have made vast improvements in newer languages.

     

    Far from being a beginner's language, I've see it used as a substitute for MatLab (ie maths heavy stuff), as a string processor (eg generating C/C++ code from small config files), an application download manager and real-time management of vehicles on mining sites.
    Comparing equivalent algorithms in C/C++ code and python code, the Python code is far simpler, far more natural and far easier to understand/modify.

     

    Admittedly, speed is not its forte - but same issue for Basic.
    And it is memory hungry - ruling out most 8-bit systems.

  11. The extra sockets maybe to help avoid pin breakage when plugging in/out many times from the cartridge.
    If you break the occasional pin then you just replace that extra socket rather than losing the game.

    • Like 1
  12. Very nicely done.

     

    But fun-fun-fun will always be the theme song to Red Dwarf:


    It's cold outside
    Theres no kind of atmosphere
    I'm all alone, more or less
    Let me fly far away from here
    Fun Fun Fun, in the Sun Sun Sun
    I want to lie, Shipwrecked in-comatose
    Drinking fresh mango juice
    Gold fish shoals
    Nibbling at my toes
    Fun Fun Fun in the Sun Sun Sun
    Fun Fun Fun in the Sun Sun Sun
     

    • Like 2
  13. Generally clean code.

     

    Some nit picks...

    rand_target = (rand() % player_limit) + 1; // generate "computer's guess"

    If player_limit is 65535 then you have a small chance of the target being 65536, which would become 0 for uint16_t .
    Since you also want to eliminate 0, you probably want :

    rand_target = (rand() % (player_limit-1)) + 1; // generate "computer's guess"

    You can find boundary conditions like that by testing with a small limit of, say, 7 and then noticing if you occasionally get an 8.
    Or by changing uint16_t to uint8_t and testing enough to see the occasional 0, then changing back to uint16_t .
    Always test boundaries - its where the majority of bugs like to hide.

     

    All uppercase is considered SHOUTING, which my mother taught me is rude! Just say no!
    Even most old devices just display lowercase as uppercase, so it works on most old devices too.
    For the very, very, few that don't display nice things for the lowercase letters, there are alternatives that I can elaborate on later.

     

    Generally considered bad form to bomb out deep down inside code.
    In particular, the exit() calls in get_limit() .
    I would have had get_limit() return int32_t and use negative values to represent bad cases.
    Then main() can decide whether to:

    • bomb out doing exit(-player_limit); or better yet, calling quit();
      This can be particularly important if there is clean-up code required for some future platform.
    • ask again
    • substitute a sane value and play anyway.
    • Thanks 1
  14. My guess would be:

    1. colour cycling (also often used in waterfall images)
    2. page flipping
      Multiples pages (screens) are set up in memory and the Dl (display list) is altered to select the current page to display. Flip through the pages quickly like old cartoon time flip books.

    And of course you can combine them.

  15. We could always buy it.
    And when it arrives without the hard drive, monitor and mouse then force him to ship those (assuming he can find a PBI interface for an IDE hard drive or an SD card interface) because they were explicitly in the description.
    Shipping a monitor overseas could be expensive.
    Even more fun if the fragile monitor arrives damaged and he has to ship it again.

    But I'm guessing it was just a copy/paste error from an ST auction.

    • Like 3
×
×
  • Create New...