Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Darkly)
  • No Skin
Collapse

Chebucto Regional Softball Club

  1. Home
  2. Uncategorized
  3. tandy put their sound chip on the 1A interrupt?
A forum for discussing and organizing recreational softball and baseball games and leagues in the greater Halifax area.

tandy put their sound chip on the 1A interrupt?

Scheduled Pinned Locked Moved Uncategorized
325 Posts 1 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Foone🏳️‍⚧️F Foone🏳️‍⚧️

    could also be that this is a compiler-provided bit of code, which is left in because the runtime needs it, or they just didn't eliminate dead code

    Foone🏳️‍⚧️F This user is from outside of this forum
    Foone🏳️‍⚧️F This user is from outside of this forum
    Foone🏳️‍⚧️
    wrote on last edited by
    #68

    okay I've figured out there's a shared format they're using here. it chunks the file into chunks, which have a 16-bit ID (unique per file, but not globally), an offset, and 16-bit length

    Foone🏳️‍⚧️F 1 Reply Last reply
    0
    • Foone🏳️‍⚧️F Foone🏳️‍⚧️

      okay I've figured out there's a shared format they're using here. it chunks the file into chunks, which have a 16-bit ID (unique per file, but not globally), an offset, and 16-bit length

      Foone🏳️‍⚧️F This user is from outside of this forum
      Foone🏳️‍⚧️F This user is from outside of this forum
      Foone🏳️‍⚧️
      wrote on last edited by
      #69

      so like, midisnd.dat will have 12 entries, and the first 11 are 200-500 bytes each, and then the last is 3k.
      presumably it's each song and then some config info?

      Foone🏳️‍⚧️F 1 Reply Last reply
      0
      • Foone🏳️‍⚧️F Foone🏳️‍⚧️

        so like, midisnd.dat will have 12 entries, and the first 11 are 200-500 bytes each, and then the last is 3k.
        presumably it's each song and then some config info?

        Foone🏳️‍⚧️F This user is from outside of this forum
        Foone🏳️‍⚧️F This user is from outside of this forum
        Foone🏳️‍⚧️
        wrote on last edited by
        #70

        cities.dat is very interesting. There's 30 cities in total, but 491 entries in it!

        So they must be doing something odd there, that doesn't divide equally. Maybe one city-chunk gives IDs of the others?

        Foone🏳️‍⚧️F 1 Reply Last reply
        0
        • Foone🏳️‍⚧️F Foone🏳️‍⚧️

          cities.dat is very interesting. There's 30 cities in total, but 491 entries in it!

          So they must be doing something odd there, that doesn't divide equally. Maybe one city-chunk gives IDs of the others?

          Foone🏳️‍⚧️F This user is from outside of this forum
          Foone🏳️‍⚧️F This user is from outside of this forum
          Foone🏳️‍⚧️
          wrote on last edited by
          #71

          idea for a test: it's easy to spot which chunk in a city is the image, because it's the biggest. Here's a way to determine if it's looking up by IDs or offsets/indices: swap the IDs of two images

          Foone🏳️‍⚧️F 1 Reply Last reply
          0
          • Foone🏳️‍⚧️F Foone🏳️‍⚧️

            idea for a test: it's easy to spot which chunk in a city is the image, because it's the biggest. Here's a way to determine if it's looking up by IDs or offsets/indices: swap the IDs of two images

            Foone🏳️‍⚧️F This user is from outside of this forum
            Foone🏳️‍⚧️F This user is from outside of this forum
            Foone🏳️‍⚧️
            wrote on last edited by
            #72

            darn. turns out you can't just renumber the chunks, because they have to be in increasing order.

            so maybe I just need to leave the chunk indexes as is, and instead of moving the entries around, I move where they're pointing?

            Foone🏳️‍⚧️F 1 Reply Last reply
            0
            • Foone🏳️‍⚧️F Foone🏳️‍⚧️

              darn. turns out you can't just renumber the chunks, because they have to be in increasing order.

              so maybe I just need to leave the chunk indexes as is, and instead of moving the entries around, I move where they're pointing?

              Foone🏳️‍⚧️F This user is from outside of this forum
              Foone🏳️‍⚧️F This user is from outside of this forum
              Foone🏳️‍⚧️
              wrote on last edited by
              #73

              Bingo! I'm in Athens, but I'm seeing the image for Baghdad, and apparently with the Baghdad palette?

              So one of these other chunks must be the palette for a city. Or it selects from a selection of palettes? Maybe they've just got a couple defined.

              Link Preview Image
              Foone🏳️‍⚧️F 1 Reply Last reply
              0
              • Foone🏳️‍⚧️F Foone🏳️‍⚧️

                Bingo! I'm in Athens, but I'm seeing the image for Baghdad, and apparently with the Baghdad palette?

                So one of these other chunks must be the palette for a city. Or it selects from a selection of palettes? Maybe they've just got a couple defined.

                Link Preview Image
                Foone🏳️‍⚧️F This user is from outside of this forum
                Foone🏳️‍⚧️F This user is from outside of this forum
                Foone🏳️‍⚧️
                wrote on last edited by
                #74

                okay I figured out the cities.dat IDs:

                They're all 1XXYY (in decimal):
                XX is the city number (0-29), YY is the sub-chunk-id.

                So like:
                YY=0: City name
                YY=2: City image.

                They go between 00 and 22, and not all numbers need to be present.

                Foone🏳️‍⚧️F 1 Reply Last reply
                0
                • Foone🏳️‍⚧️F Foone🏳️‍⚧️

                  okay I figured out the cities.dat IDs:

                  They're all 1XXYY (in decimal):
                  XX is the city number (0-29), YY is the sub-chunk-id.

                  So like:
                  YY=0: City name
                  YY=2: City image.

                  They go between 00 and 22, and not all numbers need to be present.

                  Foone🏳️‍⚧️F This user is from outside of this forum
                  Foone🏳️‍⚧️F This user is from outside of this forum
                  Foone🏳️‍⚧️
                  wrote on last edited by
                  #75

                  hmm, reading a buffer and then summing all the values of the bytes in it.

                  suspicious behavior.

                  Foone🏳️‍⚧️F 1 Reply Last reply
                  0
                  • Foone🏳️‍⚧️F Foone🏳️‍⚧️

                    hmm, reading a buffer and then summing all the values of the bytes in it.

                    suspicious behavior.

                    Foone🏳️‍⚧️F This user is from outside of this forum
                    Foone🏳️‍⚧️F This user is from outside of this forum
                    Foone🏳️‍⚧️
                    wrote on last edited by
                    #76

                    okay I think it has a very simple 1-byte CRC check on the chunks, which are optionally not run.
                    I can't make the math work but I'm reasonably sure that's what it is

                    Foone🏳️‍⚧️F 1 Reply Last reply
                    0
                    • Foone🏳️‍⚧️F Foone🏳️‍⚧️

                      okay I think it has a very simple 1-byte CRC check on the chunks, which are optionally not run.
                      I can't make the math work but I'm reasonably sure that's what it is

                      Foone🏳️‍⚧️F This user is from outside of this forum
                      Foone🏳️‍⚧️F This user is from outside of this forum
                      Foone🏳️‍⚧️
                      wrote on last edited by
                      #77

                      okay they're using a blit that's UI-aware, so it starts the coordinate system at (1,13). Fun!

                      Foone🏳️‍⚧️F 1 Reply Last reply
                      0
                      • Foone🏳️‍⚧️F Foone🏳️‍⚧️

                        okay they're using a blit that's UI-aware, so it starts the coordinate system at (1,13). Fun!

                        Foone🏳️‍⚧️F This user is from outside of this forum
                        Foone🏳️‍⚧️F This user is from outside of this forum
                        Foone🏳️‍⚧️
                        wrote on last edited by
                        #78

                        looking into the blitting code I managed to steal the world map out of RAM

                        Link Preview Image
                        Foone🏳️‍⚧️F 1 Reply Last reply
                        0
                        • Foone🏳️‍⚧️F Foone🏳️‍⚧️

                          looking into the blitting code I managed to steal the world map out of RAM

                          Link Preview Image
                          Foone🏳️‍⚧️F This user is from outside of this forum
                          Foone🏳️‍⚧️F This user is from outside of this forum
                          Foone🏳️‍⚧️
                          wrote on last edited by
                          #79

                          ugh. TODO for my eventual Good DOS Debugger:
                          Instant Video display.
                          I don't know exactly how DOSBox-X is doing it, but while single-stepping the debugger, the display never updates. I can dump the ram at A000:0000 and see what updated, but not on the screen in DOSBox

                          Foone🏳️‍⚧️F 1 Reply Last reply
                          0
                          • Foone🏳️‍⚧️F Foone🏳️‍⚧️

                            ugh. TODO for my eventual Good DOS Debugger:
                            Instant Video display.
                            I don't know exactly how DOSBox-X is doing it, but while single-stepping the debugger, the display never updates. I can dump the ram at A000:0000 and see what updated, but not on the screen in DOSBox

                            Foone🏳️‍⚧️F This user is from outside of this forum
                            Foone🏳️‍⚧️F This user is from outside of this forum
                            Foone🏳️‍⚧️
                            wrote on last edited by
                            #80

                            found a suspicious array, which goes:
                            [
                            (-1,0),
                            (-1,1),
                            (0,1),
                            (1,1),
                            (1,0),
                            (1,-1),
                            (0, -1),
                            (-1,-1),
                            (0,0)
                            ]

                            POP QUIZ: why does the font renderer need this array? how are they being "lazy" with this array?

                            Foone🏳️‍⚧️F 1 Reply Last reply
                            0
                            • Foone🏳️‍⚧️F Foone🏳️‍⚧️

                              found a suspicious array, which goes:
                              [
                              (-1,0),
                              (-1,1),
                              (0,1),
                              (1,1),
                              (1,0),
                              (1,-1),
                              (0, -1),
                              (-1,-1),
                              (0,0)
                              ]

                              POP QUIZ: why does the font renderer need this array? how are they being "lazy" with this array?

                              Foone🏳️‍⚧️F This user is from outside of this forum
                              Foone🏳️‍⚧️F This user is from outside of this forum
                              Foone🏳️‍⚧️
                              wrote on last edited by
                              #81

                              there's also this code in the for-loop that steps through this array:

                              if index==8:
                              color=white
                              else:
                              color=black

                              Foone🏳️‍⚧️F 1 Reply Last reply
                              0
                              • Foone🏳️‍⚧️F Foone🏳️‍⚧️

                                there's also this code in the for-loop that steps through this array:

                                if index==8:
                                color=white
                                else:
                                color=black

                                Foone🏳️‍⚧️F This user is from outside of this forum
                                Foone🏳️‍⚧️F This user is from outside of this forum
                                Foone🏳️‍⚧️
                                wrote on last edited by
                                #82

                                @dividuum got it:

                                they're drawing the font 9 times, offset in each of the 8 directions, and in black. then they draw it in white, with no offset.

                                It's a pixel-outliner! By drawing their pixel font offset in each direction, they get a black outline on their font.

                                Foone🏳️‍⚧️F 1 Reply Last reply
                                0
                                • Foone🏳️‍⚧️F Foone🏳️‍⚧️

                                  @dividuum got it:

                                  they're drawing the font 9 times, offset in each of the 8 directions, and in black. then they draw it in white, with no offset.

                                  It's a pixel-outliner! By drawing their pixel font offset in each direction, they get a black outline on their font.

                                  Foone🏳️‍⚧️F This user is from outside of this forum
                                  Foone🏳️‍⚧️F This user is from outside of this forum
                                  Foone🏳️‍⚧️
                                  wrote on last edited by
                                  #83

                                  The Answer to the DRM questions for Where in the world is Carmen Sandiego? Enhanced (DOS, 1990) are, in no particular order:

                                  23
                                  Kent
                                  dragon
                                  calcium
                                  1796
                                  Warren
                                  revenue
                                  1792
                                  Willard
                                  1937
                                  Crater
                                  Tanzania
                                  Hartford
                                  Duluth
                                  London
                                  Gem
                                  Silent
                                  squeaker

                                  Foone🏳️‍⚧️F 1 Reply Last reply
                                  0
                                  • Foone🏳️‍⚧️F Foone🏳️‍⚧️

                                    The Answer to the DRM questions for Where in the world is Carmen Sandiego? Enhanced (DOS, 1990) are, in no particular order:

                                    23
                                    Kent
                                    dragon
                                    calcium
                                    1796
                                    Warren
                                    revenue
                                    1792
                                    Willard
                                    1937
                                    Crater
                                    Tanzania
                                    Hartford
                                    Duluth
                                    London
                                    Gem
                                    Silent
                                    squeaker

                                    Foone🏳️‍⚧️F This user is from outside of this forum
                                    Foone🏳️‍⚧️F This user is from outside of this forum
                                    Foone🏳️‍⚧️
                                    wrote on last edited by
                                    #84

                                    if ((0x80 >> ((byte)local_4 & 7) &
                                    (int)(char)*(byte *)((int)((int *)param_1 + 1) + (local_4 >> 3))) != 0) {

                                    COULD YOU USE SOME MORE CASTS MAYBE?

                                    Foone🏳️‍⚧️F 1 Reply Last reply
                                    0
                                    • Foone🏳️‍⚧️F Foone🏳️‍⚧️

                                      if ((0x80 >> ((byte)local_4 & 7) &
                                      (int)(char)*(byte *)((int)((int *)param_1 + 1) + (local_4 >> 3))) != 0) {

                                      COULD YOU USE SOME MORE CASTS MAYBE?

                                      Foone🏳️‍⚧️F This user is from outside of this forum
                                      Foone🏳️‍⚧️F This user is from outside of this forum
                                      Foone🏳️‍⚧️
                                      wrote on last edited by
                                      #85

                                      oh it's because ghidra's near/far pointer support is shit.

                                      I had param2 defined as a byte*32 and it was casting it to a byte* before using it

                                      Foone🏳️‍⚧️F 1 Reply Last reply
                                      0
                                      • Foone🏳️‍⚧️F Foone🏳️‍⚧️

                                        oh it's because ghidra's near/far pointer support is shit.

                                        I had param2 defined as a byte*32 and it was casting it to a byte* before using it

                                        Foone🏳️‍⚧️F This user is from outside of this forum
                                        Foone🏳️‍⚧️F This user is from outside of this forum
                                        Foone🏳️‍⚧️
                                        wrote on last edited by
                                        #86

                                        if I define it as byte* and let the calling convention implicitly define it as 32bit, it doesn't do the cast

                                        Foone🏳️‍⚧️F 1 Reply Last reply
                                        0
                                        • Foone🏳️‍⚧️F Foone🏳️‍⚧️

                                          if I define it as byte* and let the calling convention implicitly define it as 32bit, it doesn't do the cast

                                          Foone🏳️‍⚧️F This user is from outside of this forum
                                          Foone🏳️‍⚧️F This user is from outside of this forum
                                          Foone🏳️‍⚧️
                                          wrote on last edited by
                                          #87

                                          well I found the decompression method.

                                          as always, I hate it. decompression routines are probably my least favorite thing to reverse engineer

                                          Foone🏳️‍⚧️F 1 Reply Last reply
                                          0

                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • 1
                                          • 2
                                          • 7
                                          • 8
                                          • 9
                                          • 10
                                          • 11
                                          • 16
                                          • 17
                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          Powered by NodeBB Contributors
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups