Please be advised that access to Atari Forum this coming Friday will be sporadic whilst the backend operating system and dependency upgrades are carried out.

New game by Mr Ni!

C and PASCAL (or any other high-level languages) in here please

Moderators: Zorro 2, Moderator Team

User avatar
Nyh
Atari God
Atari God
Posts: 1533
Joined: Tue Oct 12, 2004 2:25 pm
Location: Netherlands

New game by Mr Ni!

Post by Nyh »

FedePede04 wrote:Thanks, i love to see others code,
you can always learn something from it.
I sitched to an other part were we can talk code.

There are some interesting bits in the code I think. Let me give you a quick tour.
SET.C: this is the main file. Here is the game logic.

SET_DATA.C: this file is generated by SET.C When DEVELOPMENT is defined all data is loaded from their original files (PI3 files, FNT files etc.) . The data is converted into structures used in the game and then saved to this file by the function save_all_data().

SETSTLOW.C: Sets the resolution to ST low. Should work for ST, Ste, Mega STe, TT and Falcon.

PROPRINT.C: routine for printing proportional text in a given box. The text can be left, right, center or justified aligned. The part of the string that didn't fit in the box is returned.

MAKEFONT.C: used to generate a proportional font.

CRC_CODE.S: generated a 32 bit CRC code. Used in the save files.

KEYBOARD.S: keyboard and mouse driver.

LOADER_N.S and RELOCATE.S: the loader system. The compiled program is added to relocate.s to get a position independent file. This file is compressed with ARJBETA.TTP, the compressed data is extracted with UNARJPR.TTP and merged with loader_n.s which contains the depacker.

NYHRAND.S: the random generator. Linear congruential generator, x = (ax+c) mod m, m = 2^32, a = 1103515245, c = 12345

PPRNF.S: the actual print routines of PROPRINT.C

PRINT.S: a relic, the original non proportional print routines

SET_FAST.S: all assembly routines for the game. Most of it is graphics output like card drawing routines and menu drawing routines but also the timer interrupt routine for the score.

Hans Wessels
User avatar
FedePede04
Atari God
Atari God
Posts: 1215
Joined: Fri Feb 04, 2011 12:14 am
Location: Denmark

Re: New game by Mr Ni!

Post by FedePede04 »

Hi Hans.

Thanks for the reply, i have not have the time to test your game, and look at your source code.
at the moment i have a bad bag, and i also got the flu. :(

i have not program for the atari for 20+ year, only a little at the beginning of last year, and a little for the two last month.

on of my big problems is then i had an Atari last time, for the most of the time, the mouse port was not working, so i never got a hang programing for the mouse, most of the time, i did not even setup the keyboard interrupt, i was just reading from the port.

at the moment i have the keyboard interrupt install and isolate then mouse, but later on, i would be nice to could use the mouse.
but it is hard to find good examples for the Atari St.
and for what i have read on this board, it look that you know you thing, and when i saw, that you had release this game, and source code was include. I got pretty wild. :D
so i will be most the keyboard routine and mouse routine, i am interesting in. will it be ok if i contact you later on, if i have some questions regarding the ST.
i am looking forward to try your game, i am just waiting, to i get a extern floppy disk, so i can transfer it to the Atari.

Best Regards
Peter
Atari will rule the world, long after man has disappeared

sometime my English is a little weird, Google translate is my best friend :)
User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 3461
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada

Re: New game by Mr Ni!

Post by charles »

nyh , before i thought you were only a guiness,,,
now you are a guiness and a game maker

!! cool !!

charles
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!
User avatar
Nyh
Atari God
Atari God
Posts: 1533
Joined: Tue Oct 12, 2004 2:25 pm
Location: Netherlands

Re: New game by Mr Ni!

Post by Nyh »

FedePede04 wrote:so i will be most the keyboard routine and mouse routine, i am interesting in. will it be ok if i contact you later on, if i have some questions regarding the ST.
Be aware my routines are very low level. They are not an example of clean and neat programming using the standard OS functions for user interaction.

I like to do low level programming and using direct hardware access. I know the hardware pretty good and I don't have extensive knowledge of the OS routines. So if you want to do game and demo programming then go ahead and use my routines. I you want to write clean GEM programs suitable for all TOS compatible computers then stay away from my code.

Hans Wessels
User avatar
FedePede04
Atari God
Atari God
Posts: 1215
Joined: Fri Feb 04, 2011 12:14 am
Location: Denmark

Re: New game by Mr Ni!

Post by FedePede04 »

Nyh wrote:
FedePede04 wrote:so i will be most the keyboard routine and mouse routine, i am interesting in. will it be ok if i contact you later on, if i have some questions regarding the ST.
Be aware my routines are very low level. They are not an example of clean and neat programming using the standard OS functions for user interaction.

I like to do low level programming and using direct hardware access. I know the hardware pretty good and I don't have extensive knowledge of the OS routines. So if you want to do game and demo programming then go ahead and use my routines. I you want to write clean GEM programs suitable for all TOS compatible computers then stay away from my code.

Hans Wessels
Hi Hans.
the most of the code i do is also low level, i am only using Asm on the Atari, and i try not to use rom function.
the thing i am using is the file system routine like chdir,open,close,read, findfirst,findnext, Etc

it is not that i wont to steal you code, it is more to see how you handle the keyboard (mouse) pack, and to see if the thing i have made is not total wrong (i am pretty lost here).
and of course if it is ok for you, if you don't want me to sniff in you code, just say it, and i will respect it.

Best Regards
Peter

Ps. i have just uploaded the program, that i am working on. right now it is only Gfx interface and the load function that is working.
i hope it will work on a real Atari St, i have not tested it on a real ST.
Last edited by FedePede04 on Wed Feb 08, 2012 10:36 am, edited 1 time in total.
Atari will rule the world, long after man has disappeared

sometime my English is a little weird, Google translate is my best friend :)
User avatar
Nyh
Atari God
Atari God
Posts: 1533
Joined: Tue Oct 12, 2004 2:25 pm
Location: Netherlands

Re: New game by Mr Ni!

Post by Nyh »

FedePede04 wrote:it is not that i wont to steal you code, it is more to see how you handle the keyboard (mouse) pack, and to see if the thing i have made is not total wrong (i am pretty lost here).
and of course if it is ok for you, if you don't want me to sniff in you code, just say it, and i will respect it.
I release my code in the hope others have fun with it and hopefully we can all learn something from it.

Don't be afraid to reuse my code. I have no problem with that.

Hans Wessels
User avatar
FedePede04
Atari God
Atari God
Posts: 1215
Joined: Fri Feb 04, 2011 12:14 am
Location: Denmark

Re: New game by Mr Ni!

Post by FedePede04 »

Thanks Hans.

I have just uploade the program that i am working on. so you can see it, if you like.

Best Regards
Peter
Atari will rule the world, long after man has disappeared

sometime my English is a little weird, Google translate is my best friend :)
User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 3461
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada

Re: New game by Mr Ni!

Post by charles »

ni , question? where can i ge your code?
and second
compliment . i love crazy controlled numbers
where can i find more formulas to recourse random numbers?

this formula for instance
the random generator.
Linear congruential generator,
x = (ax+c) mod m, m = 2^32, a = 1103515245, c = 12345

is it ??? for us illliterators

m = 2^32
a = 1103515245
c = 12345

x=((a*x)+c)mod m


thanks
charles
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!
Dal
Administrator
Administrator
Posts: 4232
Joined: Mon Feb 20, 2006 9:00 pm
Location: Cheltenham, UK

Re: New game by Mr Ni!

Post by Dal »

charles wrote:ni , question? where can i ge your code?
He attached it to this thread
STE: Desktopper case, IDE interface, UltraSatan (8GB + 512Mb) + HXC floppy emulator. Plus some STE's/STFM's
simonsunnyboy
Forum Administrator
Forum Administrator
Posts: 5836
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany

Re: New game by Mr Ni!

Post by simonsunnyboy »

charles wrote:ni , question? where can i ge your code?
and second
compliment . i love crazy controlled numbers
where can i find more formulas to recourse random numbers?

this formula for instance
the random generator.
Linear congruential generator,
x = (ax+c) mod m, m = 2^32, a = 1103515245, c = 12345

is it ??? for us illliterators

m = 2^32
a = 1103515245
c = 12345

x=((a*x)+c)mod m


thanks
charles
You should read "The Art Of Computer Programming" by Donald E. Knuth, esp Volume 2 chapter 3 on Random numbers - it's all in there.
Simon Sunnyboy/Paradize - http://paradize.atari.org/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee
AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2978
Joined: Mon Feb 20, 2012 4:42 pm

Re: New game by Mr Ni!

Post by AtariZoll »

I like the game. Any chance to add some background music ?
Famous Schrodinger's cat hypothetical experiment says that cat is dead or alive until we open box and see condition of poor animal, which deserved better logic. Cat is always in some certain state - regardless from is observer able or not to see what the state is.

Return to “C / PASCAL etc.”