Qbasicnews.com
ASCII Graphics Challenge! :P - Printable Version

+- Qbasicnews.com (http://qbasicnews.com/newforum)
+-- Forum: QbasicNews.Com (http://qbasicnews.com/newforum/forum-3.html)
+--- Forum: Challenges (http://qbasicnews.com/newforum/forum-10.html)
+--- Thread: ASCII Graphics Challenge! :P (/thread-2779.html)

Pages: 1 2 3


ASCII Graphics Challenge! :P - adosorken - 12-18-2003

Yeah yeah yeah...y'all are movin' into SVGA, 3D, and all that jazz. But nothing beats good old ASCII graphics. Tongue And since I don't think anyone's really going to try this thing out normally anyways, I figured this was a good chance to see some real-world applications built with this library.

http://www.nodtveidt.net/useless_10a.zip

Here's the challenge:

-Create any kind of game you want, but it has to be ASCII graphical, and in a non-graphics mode (aka you can't use SCREEN 7 but use ASCII graphics, for example)
-Create this game using ONLY the library at the listed URL, no other libraries are allowed
-You are allowed to add your own routines in BASIC code, or in CALL ABSOLUTE strings
-You must provide the sourcecode upon submission as proof that only this library was used

This competition begins right now (December 18th) and will run until March 1st.

Why am I doing this? It's simple, really. I have no real tests for the library, and am curious as to how well it does in a production environment. Since KOQB'04 won't be ready for some time, it'd be nice to see one or two people trying to make a game with this library. I figure this is a great way of seeing how well this thing does in a real production environment Big Grin

Soooo...anyone up to the challenge? Big Grin


ASCII Graphics Challenge! :P - wildcard - 12-18-2003

I'm checking out the library, I'll give the challenge a go; I can't exactly moan about lack of graphics now can I ;-)

[*Looks around wondering if "The Beast" is going to enter and blow the competition away*]


ASCII Graphics Challenge! :P - na_th_an - 12-18-2003

Hmmm - Good, this compo starts today that's my birthday...
I will take a glance to the lib.


ASCII Graphics Challenge! :P - Neo - 12-18-2003

HAPPY BIRTHDAY Na Than!!! And many years. Big Grin

About any programming, I wonder how my computer is atm... Wink


ASCII Graphics Challenge! :P - na_th_an - 12-18-2003

Thanks, Neo Smile

Really cool routines. This library is really interesting. Adosorken, I love text mode stuff, if ya wanna I could try to help you providing some functions Wink I've seen the "future plans" section and I can provide the 512 characters mode and the extended text resolutions, as well as the custom character set loader.

---

This is my little set of routines to use the 512 characters mode and to load the customized char maps into VGA memory:

Code:
DECLARE SUB LoadCharInMap (file$, Map%)
DECLARE SUB BlockBitPlane2 ()
DECLARE SUB UnBlockBitPlane2 ()
DECLARE SUB SelectMaps (Map0%, Map1%)
DECLARE SUB OutPortW (dir%, a%)
'$INCLUDE: 'QB.BI'

SUB BlockBitPlane2
    EgaVgaSequencer% = &H3C4
    EgaVgaGraphCtr% = &H3CE
    OutPortW EgaVgaSequencer%, &H100
    OutPortW EgaVgaSequencer%, &H402
    OutPortW EgaVgaSequencer%, &H704
    OutPortW EgaVgaSequencer%, &H300
    OutPortW EgaVgaGraphCtr%, &H204
    OutPortW EgaVgaGraphCtr%, &H5
    OutPortW EgaVgaGraphCtr%, &H6
END SUB

SUB LoadCharInMap (file$, Map%)
    d$ = CHR$(0)
    aBase% = &H4000 * Map%
    DEF SEG = &HA000
    f% = FREEFILE
    OPEN file$ FOR BINARY AS #f%
    FOR i% = 0 TO 255
        FOR j% = 0 TO 15
            GET #f%, , d$
            POKE aBase% + j%, ASC(d$)
        NEXT j%
        aBase% = aBase% + 32
    NEXT i%
    CLOSE #f%
    DEF SEG
END SUB

SUB OutPortW (dir%, a%)
    OUT dir%, a% AND 255
    OUT dir% + 1, a% \ 256
END SUB

SUB SelectMaps (Map0%, Map1%)
    DIM Regs AS RegType
    DIM OutPortWs AS RegType
    ' Bytes:
    Map0% = Map0% AND 255
    Map1% = Map1% AND 255
    ' Acceso a los registros
    Regs.ax = &H1103
    b% = (Map0% AND 3) + (Map0% AND 4) * 4
    c% = (Map1% AND 3) * 4 + (Map1% AND 4) * 8
    bc% = b% + c%
    Regs.bx = bc%
    INTERRUPT &H10, Regs, OutPortWs
END SUB

SUB UnBlockBitPlane2
    EgaVgaSequencer% = &H3C4
    EgaVgaGraphCtr% = &H3CE
    OutPortW EgaVgaSequencer%, &H100
    OutPortW EgaVgaSequencer%, &H302
    OutPortW EgaVgaSequencer%, &H304
    OutPortW EgaVgaSequencer%, &H300
    OutPortW EgaVgaGraphCtr%, &H4
    OutPortW EgaVgaGraphCtr%, &H1005
    OutPortW EgaVgaGraphCtr%, &HE06
END SUB

To use it you just do this:

Code:
BlockBitPlane2
LoadCharInMap "charset1.fnt", 0
LoadCharInMap "charset2.fnt", 1
SelectMaps 0, 1
UnBlockBitPlane2

... where charset1.fnt and charset2.fnt are standard 4096 bytes text-mode font files (all the 256 characters, 16 bytes each).

Now remember that with colour 0-7 you print with the charset1 font and with colour 8-15 you print with the charset2 font, so adjust your palettes.

If you, reader, don't know what the heck the 512 characters mode is, check this demo Right-click -> Save as

---

Edited once more: I can't work with the enhaced SVGA text modes 'cause my card doesn't seem to support them. I just call the interrupt and it does... nothing Tongue :o


ASCII Graphics Challenge! :P - Anonymous - 12-18-2003

happy bday nathan! my bday was actually yesterday Smile

as for the ascii compo, i think maybe ill join... i dunno if i have time it sounds cool! well peace


ASCII Graphics Challenge! :P - adosorken - 12-18-2003

Quote:Hmmm - Good, this compo starts today that's my birthday...
I will take a glance to the lib.
ahhhhhhhhhhhhhhhhhh nooooooooooooooo! You share yer birthday with one of my ex's!!! nooooooooooooo!

:lol:

Seriously though Big Grin happy birthday man, and I'll add the stuff to the lib asap Smile And happy belated birthday to you cha0s Big Grin


ASCII Graphics Challenge! :P - na_th_an - 12-18-2003

Thanks chaos and Adosorken.

Adosorken: I think your could wrap these functions inside one. Having them separated would allow do some tweaks and stuff, but in 99.99% of cases you just want to switch to 512 characters mode, load the fonts, and that's all. That "BlockBitPlane2" & co. stuff may look way too strange for most people :lol:


ASCII Graphics Challenge! :P - adosorken - 12-18-2003

Yeah that's probably a good idea. Will do Big Grin

...as soon as Rhiannon gives me the network cable so I can download this stuff to my dev computer...sheesh we need a hub badly Sad


ASCII Graphics Challenge! :P - barok - 12-19-2003

A Most Happy Birthday, Na_th_an! And many more!!!


whew, got that out of my system... Just wanted to see for once what that would be like. Not trying to make fun of someone :wink: