Jump to content

Bill Lange

Members
  • Content Count

    1,037
  • Joined

  • Last visited

Posts posted by Bill Lange


  1. The problem is, it's not pixel-specific and if I was not 100% accurate in the mapping you'd get sloppy collision. The problem comes with the dragging -- I can't imagine graphically showing you drag a BG urn smoothly, especially if it touches a BG tile as you drag it.  

     

    If your using a square dot as player #1 then if you "pick" something up, why not added it to the player's data? There is plenty of room in the verticle player ribbon. If you pick up an urn, just add the urns data above or below the square data in player one's ribbon. They would be the same color though. You can probably fix that in a DLI or something. That would also mess up the collision as a collision with the urn would be seen as a collision with the square.

     

     

    CHeck out:  

     

    http://www.atariage.com/forums/viewtopic.p...menace&start=25  

     

    The zipped Menace ATR file in my message is a good demo (but not the best version) of Antic 4 software sprites...  

     

    That is pretty cool. Is the source available for this?

     

    WRL


  2. since a collision register could detect bg colors but wouldn't know if your square had touched a wall or the sword.

     

    If you are using character set graphics, the collision register should tell you which character code you ran into, no?

     

    In basic you can do

    10 LOCATE X,Y,Z

     

    Where x and y are the position and z returns the color or character you ran into. Should be able to do the same in assembly.


  3. I was reading through chapter 8 of De Re Atari which is the chapter on the operating system. It is here

     

    http://www.atariarchives.org/dere/chapt08.php

     

    And your right, if a diagnostic cart is installed, most of the OS init is skipped and control is handed off to the diagnostic cart.

     

    You can read through the flowcharts in De Re Atari to see the order of how things are processed.

     

    WRL


  4. If you used bg pixels for the Urn for example, would the Urn move with the eyes in your Haunted House 5200 game? Or did it simply disappear and become part of an inventory?  

     

    I used character graphics for the non-moving items, i.e. urn pieces, scepter, key ... then they just became part of the inventory as in the 2600 version.

     

    WRL


  5. Here is a simple piece of code that shows how to create a cartridge image on the Atari 400/800/1200/800XL ... A 5200 example would be a little different. Anyone want to covert it to 5200 code?

     

    You'll need to compile it with DASM and than load it as a cartridge into an emulator.

     

    Let me know if you have any questions -

     

    ; colorloop
    ; William R. Lange
    ; compile with DASM
    ; dasm sourcecolorloop.s -f3 -odestcolorloop.bin
    
    
    
           processor 6502	; must be seven space before this line
    
    
    
     ORG $A000	; beginning of cartridge space
    
    
    ; user code goes here
    
    
    
    START  LDX #$FF	; load the x register with 255
    
    CLOOP  STX $02C8	; store it in COLOR4 register
    
     DEX  ; decrement x register
    
     CPX #0	; compare x register to 0
    
     BNE CLOOP	; if not equal to zero jump to CLOOP
    
     JMP START	; else jump back to START
    
    
    ; user code ends here
    
    
    ; The next seven lines of source code are required for creating
    ; a cartridge image on an Atari 400/800/1200XL/800XL/600XL ... 
    ; This lines are slightly different on the 5200.
    
    
    
       ORG $BFFA
    
       .byte $00; $BFFA starting address low byte
    
       .byte $A0; $BFFB starting address high byte
    
       .byte $00; $BFFC cartridge present byte must be zero
    
       .byte $02; $BFFD cartridge flag byte - bits 0,2 and 7 are significant
    
       .byte $00; $BFFE init address low byte
    
       .byte $A0; $BFFF init address high byte

    colorloop.zip


  6. Iceman -

     

    When you boot up the 600XL, you should get the infamous "READY" prompt of Atari BASIC.

     

    If you hold down the OPTION key while you turn on the power, you should get the SELF TEST mode. I believe it is the OPTION key or maybe the SELECT key.

     

    If you hold down the START key while you turn on the power, you should hear a BEEP from the TV speaker ... this is how you boot from cassette. The BEEP is letting you know to press PLAY on the cassette player. You should hear the BEEP even if you don't have a cassette player attached.

     

    Finally, if you turn on the computer and there is nothing on the screen, try type something to see if you can hear the key clicks from the speaker. Try this -

     

    SOUND 10,10,10,10

     

    If you hear a sound, maybe the video out is bad. If you hear nothing, your screwed.

     

    Good luck

     

    WRL

    post-188-1038439245_thumb.jpg


  7. Inky -

     

    I was bored at work on Friday, so I wrote this object oriented version of the Atari 8-bit game Kingdom. It is about 80% done. This shows how to use OO programing for a simple text based game. I compiled this under VC++ 6.0.

     

    WRL

     

    // Kingdom
    
    // Ported from the Atari 8-bit game of Kingdom
    
    // William R. Lange
    
    // November 2002
    
    
    
    // header files
    
    #include <iostream.h>
    
    #include <time.h> // random seed / time functions
    
    #include <stdlib.h>
    
    #include <string.h> // string handling functions
    
    
    
    // prototypes
    
    int main(void);
    
    void DisplayStats(void);
    
    void OutOfOffice(int starved);
    
    void GameLoop(void);
    
    void GoodLeader(void);
    
    void BadLeader(void);
    
    void OkLeader(void);
    
    int DisplayPrompt(char InputPrompt []);
    
    
    
    // CKingdom class
    
    class CKingdom {
    
    
    
    private:
    
    
    
    int nDied;
    
    int nStarvedOnAvg;
    
    int nYear;
    
    int nPeople;
    
    int nBushels;
    
    int nBushelsInStore;
    
    int nTerm;
    
    int nAcresOwned;
    
    int nStarvedThisYear;
    
    int nHarvested;
    
    int nRatsAte;
    
    int nTrade;
    
    int nImmigrants;
    
    int nPeopleStarved;
    
    int nTermYear;
    
    
    
    public:
    
    
    
    CKingdom::CKingdom(){
    
     nYear=0; // starting year number
    
     nPeopleStarved=0;
    
     nImmigrants=0;
    
     nPeople=100; // starting number of people
    
     nAcresOwned=1000; // starting number of acres
    
     nHarvested=3;
    
     nRatsAte=0;
    
     nBushelsInStore=3000; // bushels in store
    
     nTrade=25;
    
    
    
    	 nTerm=1; // starting term number
    
     nTermYear=0;
    
    
    
    }
    
    
    
    int getYear(void);
    
    int getPeopleStarved(void);
    
    int getImmigrants(void);
    
    int getPopulation(void);
    
    int getAcresOwned(void);
    
    int getHarvested(void);
    
    int getRatsAte(void);
    
    int getBushelsInStore(void);
    
    int getTrade(void);
    
    int getTerm(void);
    
    
    
    void incYear(void);
    
    void incTermYear(void);
    
    void incBushelsInStore(int);
    
    void decAcresOwned(int);
    
    };
    
    
    
    void CKingdom::decAcresOwned(int temp){
    
    nAcresOwned-=temp;
    
    }
    
    
    
    void CKingdom::incBushelsInStore(int temp){
    
    nBushelsInStore+=temp;
    
    }
    
    
    
    void CKingdom::incTermYear(){
    
    nTermYear+=1;
    
    }
    
    
    
    void CKingdom::incYear(){
    
    nYear+=1;
    
    }
    
    
    
    
    
    int CKingdom::getYear(void){
    
    return nYear;
    
    }
    
    
    
    int CKingdom::getPeopleStarved(void){
    
    return nStarvedThisYear;
    
    }
    
    
    
    int CKingdom::getImmigrants(void){
    
    return nImmigrants;
    
    }
    
    
    
    int CKingdom::getPopulation(void){
    
    return nPeople;
    
    } 
    
    
    
    int CKingdom::getAcresOwned(void){
    
    return nAcresOwned;
    
    } 
    
    
    
    int CKingdom::getHarvested(void){
    
    return nHarvested;
    
    }
    
    
    
    int CKingdom::getRatsAte(void){
    
    return nRatsAte;
    
    }
    
    
    
    int CKingdom::getBushelsInStore(void){
    
    return nBushelsInStore;
    
    } 
    
    
    
    int CKingdom::getTrade(void){
    
    return nTrade;
    
    }
    
    
    
    int CKingdom::getTerm(void){
    
    return nTerm;
    
    }
    
    // end of CKingdom class
    
    
    
    
    
    CKingdom Kingdom;
    
    
    
    int main(){
    
    GameLoop();	
    
    return 0;
    
    }
    
    
    
    void GameLoop(){
    
    bool bPlay=true;
    
    bool bGood=false;
    
    int nUserInput;
    
    int exchange_rate=3;
    
    
    
    do
    
    {
    
     Kingdom.incYear();
    
     Kingdom.incTermYear();
    
     DisplayStats();
    
    
    
     //plague?
    
    
    
    
    
     //what's the exchange?
    
     
    
     // Acres to Sell?
    
     bGood=false;
    
     do {
    
     nUserInput=DisplayPrompt("Acres to sell? ");
    
     if (nUserInput<=Kingdom.getAcresOwned()){
    
    	 bGood=true;
    
    	 Kingdom.decAcresOwned(nUserInput);
    
    	 Kingdom.incBushelsInStore(exchange_rate*nUserInput);
    
     }
    
     else 
    
    	 cout << "You've only " << Kingdom.getAcresOwned() << " acres of land!!" << endl;
    
     }
    
     while (bGood==false);
    
     
    
     // Acres to Buy (if needed)
    
     if(nUserInput==0)
    
     {
    
    	 bGood=false;
    
    	 do {
    
       nUserInput=DisplayPrompt("Acres to buy? ");
    
       if (nUserInput<=Kingdom.getBushelsInStore()){
    
      	 bGood=true;
    
    
    
       }
    
       else
    
      	 cout << "You've only " << Kingdom.getBushelsInStore() << " bushels of grain!" << endl;
    
    	 }
    
    	 while (bGood==false);
    
     }
    
     
    
     nUserInput=DisplayPrompt("Acres for the people? ");
    
     nUserInput=DisplayPrompt("Acres to plant? ");
    
     system("cls");
    
    }
    
    
    
    while(bPlay==true);
    
    }
    
    
    
    void DisplayStats(){
    
    cout << "                   KINGDOM" << endl;
    
    cout << endl;
    
    
    
    if(Kingdom.getTerm()>1)
    
     cout << "                      TERM " << Kingdom.getTerm() << endl;
    
    
    
    cout << "                      YEAR " << Kingdom.getYear() << endl;
    
    cout << "            PEOPLE STARVED " << Kingdom.getPeopleStarved() << endl;
    
    cout << "                IMMIGRANTS " << Kingdom.getImmigrants() << endl;
    
    cout << "                POPULATION " << Kingdom.getPopulation() << endl;
    
    cout << "           ACRES CITY OWNS " << Kingdom.getAcresOwned() << endl;
    
    cout << "    BUSHELS/ACRE HARVESTED " << Kingdom.getHarvested() << endl;
    
    cout << "          BUSHELS RATS ATE " << Kingdom.getRatsAte() << endl;
    
    cout << "          BUSHELS IN STORE " << Kingdom.getBushelsInStore() << endl;
    
    cout << "BUSHELS/ACRE OF LAND TRADE " << Kingdom.getTrade() << endl;
    
    cout << endl;
    
    cout << endl;
    
    } // end of DisplayStats()
    
    
    
    
    
    void YearsInOffice(int years, int ave_starved, int total_starved, int acres_per_person) {
    
    cout << "In " << years << " years of office, " << ave_starved << "% of the " << endl;
    
    cout << "population starved on the average."  << endl;
    
    cout << total_starved << " people died in total starting " << endl;
    
    cout << "with 10 acres/person and ending " << endl;
    
    cout << acres_per_person << " acres/person. " << endl;
    
    } // end of YearsInOffice()
    
    
    
    void OutOfOffice(int starved){
    
    cout << "You starved " << starved << " people this year!" << endl;
    
    cout << "Due to this extreme mismanagement," << endl;
    
    cout << "you have been thrown out of office" << endl;
    
    cout << "and declared National Fink!" << endl;
    
    } // end of OutOfOffice()
    
    
    
    void GoodLeader(){
    
    cout << "A fantastic performance!" << endl;
    
    cout << "Charlemange, Disraeli, and" << endl;
    
    cout << "Jefferson combined could not have" << endl;
    
    cout << "done better!!" << endl;
    
    } // end of GoodLeader()
    
    
    
    void BadLeader(){
    
    cout << "Your heavy-handed performance" << endl;
    
    cout << "smacks of Nero and Ivan IV. The" << endl;
    
    cout << "people find you an unpleasant ruler" << endl;
    
    cout << "frankly hate your guts!" << endl;
    
    } // end of BadLeader()
    
    
    
    void OkLeader(){
    
    cout << "You could have done better." << endl;
    
    cout << Kingdom.getPopulation()*.08*rand() << "people would like to see you" << endl;
    
    cout << "assassinated." << endl;
    
    } // end of OkLeader()
    
    
    
    int DisplayPrompt(char InputPrompt []){
    
    char InputBuffer[100];
    
    bool bGood=false;
    
    int nValue;
    
    
    
    do {
    
     cout << InputPrompt;
    
     cin.getline (InputBuffer,100);
    
     nValue=atoi(InputBuffer);
    
     if( (nValue==(int)nValue) && (nValue>-1) )
    
    	 bGood=true;
    
    }
    
    while (!bGood);
    
    
    
    return nValue;
    
    
    
    };


  8. #include <iostream.h> 
    
    
    
    class NumOperator 
    
    { 
    
    public: 
    
      [b] int duble (int doubNum); // should double the number [/b]
    
    }; 
    
    
    
    int NumOperator::duble(int setnum) 
    
    { 
    
    setnum=doubNum*2; 
    
    return setnum; 
    
    }

     

    This part of your code doesn't contain any data storage. When you do the setnum=doubNum*2, it doesn't know what doubNum is.

     

    WRL


  9. Inky - try it this way -

     

    #include <iostream.h> 
    
    
    
    class NumOperator 
    
    { 
    
    public: 
    
       int number; 
    
    void duble(void);
    
    int getNumber(void);
    
    void setNumber(int);
    
    };  
    
    
    
    void NumOperator::duble() { 
    
    number=number*2; 
    
    } 
    
    
    
    int NumOperator::getNumber(void) {
    
    return number;
    
    }
    
    
    
    void NumOperator::setNumber(int tmp) {
    
    number=tmp;
    
    }
    
    
    
    
    
    
    
    int main () 
    
    { 
    
      
    
       NumOperator NumOp; 
    
    
    
       int AnyNum; 
    
       cout << "Type a number: "; 
    
       cin >> AnyNum; 
    
       cout << endl; 
    
       NumOp.setNumber(AnyNum); 
    
    NumOp.duble();
    
       cout << "Double = " << NumOp.getNumber(); 
    
       
    
       return 0; 
    
    }

×
×
  • Create New...