View Full Version: Game port

dex >>DexOS >>Game port


Dex- 07-19-2005
Game port
I have ported a game i made in 2003 to "Dex4u" you can try it here: http://www.dex4u.com/Dex4uPong.zip I have made two versions one for CLI (13h mode) and one for GUI vesa mode. The games called "SpacePong" you will need the latest kernel32.exe to run it so i have put it together with the kernel32 in a selfextrating exe. Note for GUI programmers: you can now load from floppy in the GUI, but program for loading from GUI should be for vesa 640x480 24/32 bpp and should have a org 800000h and a "gex" extension, I will post a demo soon. Good luck :wink:.

jas2o- 07-20-2005

I exited and it called me a chicken :cry: Both pongs worked. Colours worked. Screenshots should be up soon (if not, by the time you read this). Jas2o

Dex- 07-20-2005

Thanks jas2o, for the screenshots :). http://www.dex4u.com/images/guipong.PNG

bubach- 07-20-2005

Hi! Maybe you remember that I wrote about a game called Pitman that I tried to port to dex? Well I don't had that much time over recently, and it's been harder then i thougth ( when i'm not the author, and it's very depending on DOS and BIOS). At least I have it working in the game menus, and even until the point where it starts displaying the levels. It's not playable yet though... :( If i give up on it I'll post the current source and the old one to compare with here, BTW: Great job with the pong game, looks great by the screenshot. Gonna test it later. / Christoffer

Dex- 07-20-2005

Hi bubach, Do not be disheartened i had big problems and i wrote the code :cry:. I have been at it for 4 weeks, and before that i tyred porting "Tomasz Grysztar" tetris game from the 512b compo, but i give up in the end as i thought it better to start from the beginning, looks simple but its not. There are two versions one for vesa and one for mode 13h (see jas2o site for screenshots). I was going to port Mario, but as i know you want to do that for BOS, i thought i would see your code to help me. And if you do not get time to work on pitman, post the code as it would be a good games to have available for "Dex4u" :), even though i do not have much time to work on game, as there so much to do in "Dex4u" still, i like games programming and it give me a break form kernel programming. If you want to port "SpacePong" to BOS let me know as the code is very self contained , other than the built in games keyboard and a reprogramming the timer, most of the commands are built in . Nice to hear from you 8).

jas2o- 07-21-2005

Why is some of SpacePong part of the kernel anyway? Jas2o

Dex- 07-21-2005

@jas2o, the part that are in the kernel that "SpacePong" uses are not just for "SpacePong", but for uses by any program that uses the "DexFunction.inc" All these : http://dex.7.forumer.com/viewtopic.php?t=80 and more as i am add more each week. eg: there is a built in function to use a games keyboard instead of the normal one, so you can press upto 6 keys at the same time and they all work 8). I am now working on a text editor for "Dex4u", but for a good editor you also will need a mouse and to be able to write to floppy, so its: 1. Mouse driver 2. Floppy write 3. Text Editor (for text mode & GUI ) 4. Port Fasm Thats the todo list for now :lol:. PS: in the GUI version of "SpacePong" you can speed the ball up by press + on the number pad and - to put it back to the start speed, so theres two speeds.

tonyMac- 07-21-2005

@dex4u: I'm not that concerned about a Mouse Driver, perhaps the floppy write routines should be finished first, at least some basic ones before doing more with interfaces and so forth. There's another project I know of that has a beautiful gui and all, but no good FS support.

bubach- 07-21-2005

Hi! Tested the pong game, worked fine. I'll try to work more with Pitman later, some physics stuff to take care of before the new semester..., but if you want to have a look at my current status it can be found on: http://dex4u.asmhackers.net/ Download "Pitman DOS & DEX versions.zip" It's a textmode game, but it's enought fun to be worth porting.. :) And maybe I can remake it in graphics sometime. / Christoffer

Dex- 07-21-2005

Thanks bubach :), i have down load it. and will give the dos version a good testing :lol:. Had a quick look in the dex asm version looks like you have done a lot of work already :wink:. @tonyMac, The mouse driver, is already working in text mode, even works with a usb mouse :? , so the 2 day to finish it, is nether here or there. Also the new Russian version of the OS your talking abouts, floppy driver is from Dex4u any way :shock:.

bubach- 07-22-2005

Good. BTW thanks for the offer about mario and space pong. I'll have some things left before I can start on porting games to BOS though. Thats one good thing about having a reletaded OS like yours that I can test stuff on, before I reach that point myself.. :P About the mario source, you can get it here: http://home.wxs.nl/~mikewiering/msrc/index.html Maybe it's not that hard to port if we use FreePascal? translating it to asm may take alot of time! / Christoffer

Dex- 07-22-2005

Thanks bubach got the pas code, was thinking about using the tiles and lay out, but recoding it in fasm, level by level etc, may take some time, but its a classic :wink: . Also i would like to add some code to BOS, so the mouse driver i am working on for "Dex4u", will beself contained so i hope to have it working on BOS by sunday, that if a mouse driver will be helpfull ?.

bubach- 07-22-2005

that would be great, but i wont have time to port it to asm, if you do it/start at it, it would be great! A mouse driver is very welcome, as I have alot of other things to do right now. / Christoffer

Dex- 03-09-2006

A Tetris game would be great 0) , here are one or two pointer that may help. SET GRAPHIC MODE: The change mode depends on which mode, if your talking BIOS, like mode 13h you do it like this: ;----------------------------------------------------; ; Change to mode 13h. ; ;----------------------------------------------------; mov ax,0x0013 call [RealModeInt10h] If your talking vesa you do it like this: ;----------------------------------------------------; ; Load vesa info. ; ;----------------------------------------------------; call [LoadVesaInfo] mov edi,VESA_Info mov ecx,193 cld cli rep movsd sti call [SetVesaMode] ;set to 4112h (640*480 32bpp) TIMER: The timer in Dex4u is set to 18.2 ticks a second, you can change that like this: ;----------------------------------------------------; ; Set time ticks per second. ; ;----------------------------------------------------; mov cx,100 call [InterruptTimer] The above code will give you 100 ticks a second. ;----------------------------------------------------; ; Set time ticks per second. ; ;----------------------------------------------------; mov cx,0 call [InterruptTimer] The above code restore time back to 18.2 and should be called a end of program. There also functions for set delay both wait and nowait. KEYBOARD: Built into Dex4u is a game keyboard function, that let you get multi keypress, used like this: ;----------------------------------------------------; ; Replace keyboard with Game keyboard. ; ;----------------------------------------------------; call [GameKeyBoardOn] mov [KeyDown],esi Here is a example of data to go with it. ;----------------------------------------------------; ; Data ; ;----------------------------------------------------; KeyDown dd 0 Up = 0x48 Down = 0x50 Left = 0x4b Q = 0x10 A = 0x1e W = 0x11 Up1 = 0x4e Down1 = 0x4a EscKey = 1 Than all you need do to test for a keypressed is code like this: ;----------------------------------------------------; ; KeyPressed ; ;----------------------------------------------------; KeyPressed: push esi mov esi,[KeyDown] ;----------------------------------------------------; ; Is ESC held down? ; ;----------------------------------------------------; test byte[esi+EscKey],1 JZ Next mov esi,message5 call PrintVGAstringSmall mov [ExitYesNo],1 jmp Exit ;----------------------------------------------------; ; Is Q down? ; ;----------------------------------------------------; Next: test byte[esi+Q],1 jz Next1 cmp [PadLy],2 jbe Next1 sub [PadLy],2 ;----------------------------------------------------; ; Is A down? ; ;----------------------------------------------------; Next1: test byte[esi+A],1 jz Next2 cmp [PadLy],182 jae Next2 add [PadLy],2 ;----------------------------------------------------; ; Is down arrow down? ; ;----------------------------------------------------; Next2: test byte[esi+Down],1 jz Next3 cmp [PadRy],182 jae Next3 add [PadRy],2 ;----------------------------------------------------; ; Is up arrow down? ; ;----------------------------------------------------; Next3: test byte[esi+Up],1 jz Exit cmp [PadRy],2 jbe Exit sub [PadRy],2 Exit: pop esi ret Hope this helps, also i can send you the code for spacepong (a Dex4u game) if you want, but theres no comments in the code. Also here is a bootable fasm Tetris game here: http://bos.asmhackers.net/forum/viewtopic.php?id=54&p=2

smiddy- 03-09-2006

Thanks, I was just re-looking at all the functions. I will have to do a text version first since I have no idea what to do in a graphics mode. Though a graphics mode would make it a really nice game. ;-)

Forumer™ is Voted #1 Free Forum Hosting provider
Build your own community today with the largest message board hosting company.