ASCII Fishtank Mini Contest!

Started by
210 comments, last by Michalson 20 years, 4 months ago
quote: -michalson wrote
Also, to use assembly in DJGPP do this (this is a conversion of the assembly code I posted on the previous page):

union REGS regs;regs.h.ax = 0x1202; regs.h.bl = 0x30; int86(0x10,&regs,&regs);regs.h.ax = 0x3; int86(0x10,&regs,&regs);regs.h.ax = 0x1110; regs.h.bx = 0x800; regs.h.cx = 0xA; regs.h.dx = 0x0; int86(0x10,&regs,&regs);


Um, lets not confuse the guy anymore than he already is. That is not assembly. It''s a software interrupt function. they are not even close to being the same thing.

-= Twisted Matrix =-
- Twisted Matrix
Advertisement
quote:Original post by TwistedMatrix
Um, lets not confuse the guy anymore than he already is. That is not assembly. It''s a software interrupt function. they are not even close to being the same thing.

-= Twisted Matrix =-


They are exactly the same thing. The usage of software interrupts is a hardwired feature of the x86 cpu though the INT and IRET opcodes and the interrupt vector lookup table. The earlier example I posted was of the real assembly to use those interrupts, and as I stated the above was a conversion to use DJGPP''s abstraction layer, which while not true assembly code is designed to allow the programmer to access the platform dependent x86 registers and some of its opcodes (such as the INT opcode).
quote:Original post by TwistedMatrix
Im a newbie 2, i am using DJGPP also for this compo and would be happy to help you get started.


Just to clear the air, I''m not a newbie I do MFC/Win32, but it''s been about 7 years since I''ve touched DOS programming. And at work now I don''t have Visual Studio like at home so I''m using djgpp (new thing for me). Just thought I''d clarify

Michalson, You sir, are a god. Plain and simple. Thanks!

Always remember, you''''re unique. Just like everyone else.
Always remember, you''re unique. Just like everyone else.Greven
Do any of you realize that DevC++ and VC++ have conio? No need for QB or DJGPP here in my mind...
---START GEEK CODE BLOCK---GCS/M/S dpu s:+ a---- C++ UL(+) P(++) L+(+) E--- W++ N+ o K w(--) !O !M !V PS- PE+Y+ PGP+ t 5 X-- R tv+ b+ DI+ D G e* h! r-- !x ---END GEEK CODE BLOCK---
Ok… let me clarify

In DJGPP



First to set 80x50 text mode and get a pointer to the memory


      #include <sys/nearptr.h>int main(){//set 80x50 union REGS regs;regs.h.ax = 0x1202;	  regs.h.bl = 0x30;	  int86(0x10,®s,®s);regs.h.ax = 0x3;	  	  int86(0x10,®s,®s);regs.h.ax = 0x1110;	  regs.h.bx = 0x800;	  regs.h.cx = 0xA;	  regs.h.dx = 0x0;	  int86(0x10,®s,®s);//get pointer to screen__djgpp_nearptr_enable();  textmemory=(char *)(0xb8000 + __djgpp_conventional_base);__djgpp_nearptr_disable();return 0;}    


Is this right?
And also is there any thing I have to clean up before I exit (Like set it back into standard screen mode?)

Thanks for any help

[edited by - Abob on October 30, 2002 10:39:51 PM]

[edited by - Abob on October 30, 2002 10:40:47 PM]
Arrg!!
Greven, i was using ''newbie'' in a general sense. Dont take it to offense. (I have also been a programmer for 4 years) Im just new to Win32 and pmode programming.
Anyways, Im glad you figured out what you needed. I am doing it a different way. I didnt know about that FAR heap ptr thingine until now (Still dont know really). Let me know if I can help (I will let EVERYONE know when I need help you can be sure of that! )

>> Michalson
Dude using INT86 is basicly just the same thing as calling some inline assembly to preform a sofware int, I know this. But you said and I quote: "Also, to use assembly in DJGPP do this"
Some assemblers can have up to 100''s of opcodes. INT86 does not allow use of all these opcodes. It has a specific function.

Not that it matters, but since you made a big deal out of It...

-= Twisted Matrix =-
- Twisted Matrix
quote:Original post by Abob
Is this right?
And also is there any thing I have to clean up before I exit (Like set it back into standard screen mode?)

Thanks for any help


If you want to be nice and neat about it (won''t really matter under Windows since it closes when you are done) you could set the screenmode back to 80x25 by using:

regs.h.ax = 0x3;
int86(0x10,&ampregs,&ampregs);
quote:Original post by AtelierVisca
But I agree that Michalson is keeping a pretty tight lip on his technique...


Mua-ha-ha



www.coldcity.com
code, pics, life
[size="2"]www.coldcity.com code, art, life
quote:Original post by IainC
Mua-ha-ha



www.coldcity.com
code, pics, life


Boo! You should kept that until after the competion. Besides, you''re using a round about method. Since you are simply calculating the difference in RGB color space it would be easier to just code colorDifference=Sqr(R1-R2)+Sqr(G1-G2)+Sqr(B1-B2). Of course there is another method that will give more accurate results than your RGB color space comparision.
quote:Original post by Michalson
Boo! You should kept that until after the competion. Besides, you''re using a round about method. Since you are simply calculating the difference in RGB color space it would be easier to just code colorDifference=Sqr(R1-R2)+Sqr(G1-G2)+Sqr(B1-B2). Of course there is another method that will give more accurate results than your RGB color space comparision.


Why don''t you share this other technique? Hell, I''ll even withdraw from the contest if you think I''m going to use it for the fishtank... I''m really just curious as to how it all works, not in using it against contestants.

To quote myself from an earlier post: the ascii renderer would require the fish to be huge so that they didn''t show up as little blurred blobs.

- James
- James

This topic is closed to new replies.

Advertisement