Internal representation of Pacman-style maps

This is a discussion on Internal representation of Pacman-style maps within the Tech Board forums, part of the Community Boards category; Originally Posted by Bubba Linked list is totally out of the question for older systems. I would agree with the ...

  1. #16
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,403
    Quote Originally Posted by Bubba View Post
    Linked list is totally out of the question for older systems. I would agree with the bitfield approach but the max you would get was 8 bits back then.
    Yes. But that would only mean you would have to process 8 bits at a time.
    Code:
    DEFB 01110010b, 11001001b
    DEFB inserts the bytes following it (as many as you require) at the point it occurs in the program. I used bit representation here because it suits the purpose.

    You'd then just load a byte at a time to one of the registers (register A, the Accumulator, would be the ideal one) and process each bit individually with the BIT instruction which sets or resets the zero flag according to the value of the bit tested.

    You could even operate on 16 bits at a time and stored data with DEFW. The Z80 features register pairs which do provide some 16bit functionality. Loading data into them is as trivial as with 8 bit registers, But since BIT only operates on an 8 bit register (BIT n, r), there wouldn't be much gain here.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  2. #17
    Registered User
    Join Date
    Sep 2008
    Location
    Toronto, Canada
    Posts
    1,831
    Quote Originally Posted by Sebastiani View Post
    Bleh, I would have hated being a programmer back then. Having to squeeze every last drop of optimization out of it at the expense of writing maintainable code. Depressing.
    It was great! I wish I was back there again. Real job satisfaction! Your code either runs lickedy-split, or it's crap. I like that clarity.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. BN_CLICKED, change button style
    By bennyandthejets in forum Windows Programming
    Replies: 13
    Last Post: 07-05-2010, 11:42 PM
  2. Replies: 2
    Last Post: 01-06-2009, 09:37 AM
  3. WM_CAPTION causing CreateWindowEx() to fail.
    By Necrofear in forum Windows Programming
    Replies: 8
    Last Post: 04-06-2007, 08:23 AM
  4. Button handler
    By Nephiroth in forum Windows Programming
    Replies: 8
    Last Post: 03-12-2006, 05:23 AM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21