gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Graphics > Question about Windows and GBA

#22953 - InflamedSpirit - Thu Jul 01, 2004 8:13 pm

I was a bit curious when I first started programming for gba about the array for all the pixels (the video memory in the bitmap modes). Are there any similar variables on a PC? If so is there some way to access them easily (a pointer or something for programming on the computer)?

Also, are there 'modes' on the computer like they have on gba?

Thx in advance!

#22960 - dagamer34 - Thu Jul 01, 2004 8:48 pm

DOS, yes, regular Windows, no.

And you won't like DOS. You have to support lots of devices. That's why DirectX is much, much better.
_________________
Little kids and Playstation 2's don't mix. :(

#22969 - tepples - Thu Jul 01, 2004 10:47 pm

You probably want to try the Allegro library, a cross-platform game programming library whose Windows version wraps the hairier parts of DirectX. However, you're always working in a bitmapped mode without sprites, so you'll have to emulate sprites in software. Luckily, Allegro's blit() calls make it easy.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#22976 - Abscissa - Fri Jul 02, 2004 1:05 am

It actualy is on Windows as well. You just have to go through DirectX to access all of that stuff, you can't get to it by writing values directly to the hardware.

#22998 - keldon - Fri Jul 02, 2004 12:31 pm

DOS isn't that hard; you just change the mode using an interrupt; it's easy for beginners.

Dos has mode 13h, which is a 320x200 screen with 8 bit colours, now how easy is that?

In windows there you can get direct access to your pixels like that using the basic windows functions. You can have many different modes, with palettes, etc. Only that there are no tile modes, you'll have to write that yourself.

#23050 - tepples - Sat Jul 03, 2004 3:56 am

keldon wrote:
DOS isn't that hard; you just change the mode using an interrupt; it's easy for beginners.

Most computers sold nowadays come with Windows XP, which 1. doesn't run DOS apps perfectly and 2. uses a DOS-incompatible file system by default. Most beginners do not know how to reboot the computer into FreeDOS and repartition the machine to hold a FreeDOS partition.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#23064 - Lupin - Sat Jul 03, 2004 8:25 am

I heard so much about freeDOS, am i able to run windows (3.11 or 95/98) on it? I think i may try it myself sometime =)
_________________
Team Pokeme
My blog and PM ASM tutorials

#23108 - Abscissa - Sun Jul 04, 2004 9:10 pm

I just use an old 486 for that stuff :)

#23114 - dagamer34 - Sun Jul 04, 2004 11:29 pm

Abscissa wrote:
I just use an old 486 for that stuff :)

Not everyone has a 486 in the closet, right next to their old school Atari and C64. :)
_________________
Little kids and Playstation 2's don't mix. :(

#23124 - keldon - Mon Jul 05, 2004 3:16 am

dagamer34 wrote:
Abscissa wrote:
I just use an old 486 for that stuff :)

Not everyone has a 486 in the closet, right next to their old school Atari and C64. :)


I'd just run that stuff on VMWare; although I would like VMWare to have an option to make your computer appear slower; because it forces you to use slowdos all the time.

#23130 - Abscissa - Mon Jul 05, 2004 5:24 am

dagamer34 wrote:
Abscissa wrote:
I just use an old 486 for that stuff :)

Not everyone has a 486 in the closet, right next to their old school Atari and C64. :)


Heh, I wish I C64 right next to my 486. Never had one, but they always looked cool.

#28274 - Outlaw - Thu Oct 28, 2004 7:55 pm

Hi,

to get a simple frame (buffer) with Windows, just use the TinyPTC Library, which creates a DirectX Surface for you (which is a really ugly thing if you have to do by yourself :-). Then just use the update-function of that library with an array of the screen-size.

Really simple to use and reopens the fun of coding for windows just like in good old Dos times ! (Mode 13h) ... :-)

The smallest DirectX Test with LCC-Win32 + TinyPTC - 3 kb packed with UPX .. it's better than in Dos-Times :-) (using .exe-files)

See my HP for Links ...

Greetz

Outlaw
www.yakuza.de.be

#28554 - LOst? - Tue Nov 02, 2004 7:36 pm

InflamedSpirit wrote:
I was a bit curious when I first started programming for gba about the array for all the pixels (the video memory in the bitmap modes). Are there any similar variables on a PC? If so is there some way to access them easily (a pointer or something for programming on the computer)?

Also, are there 'modes' on the computer like they have on gba?

Thx in advance!


First off, the character modes which the GBA has is simular to the PC's charecter modes. The only differences are palettes and backgrounds. In the standard PC text modes, you can not have different palette lines for different 8x8 characters, and you can only have 1 background that cannot be scrolled. Also, the PC does not genetate any interrupts for VBlanks or HBlanks so you can't mess with the screen. And to not forget, monitors update the screen in 60 Hz mostly, but it can update at other refresh rates so you won't get a smooth animation like you get on the GBA.
The PC was not built as a game computer. The PC is a big calculator with a floppy disk that takes a higher interrupt level than the rest of the system so synchronization doesn't exist.
Microsoft changed the PC into something it is not! The hardware and IRQ levels are not handled in respect for synchronization. It's sad but true. The closest thing to a console I have seen in synchronization on a PC was BeOS. But BeOS is no more because Microsoft didn't like it.

#28580 - pyros - Tue Nov 02, 2004 11:40 pm

actually if you write to the address that was the video segment in dos (i cant remember, was it 0xA000 or something??) then it does draw to the top (64k perhaps??) of the windows screen. well, it did in win95 anyway. i haven't checked if xp implements this historical addressing. you could probably access the rest as well. so the answer may well be yes. it's not a practical solution, and windows will still be writing to the same bit of memory, etc.

#28663 - LOst? - Thu Nov 04, 2004 4:35 am

pyros wrote:
actually if you write to the address that was the video segment in dos (i cant remember, was it 0xA000 or something??) then it does draw to the top (64k perhaps??) of the windows screen. well, it did in win95 anyway. i haven't checked if xp implements this historical addressing. you could probably access the rest as well. so the answer may well be yes. it's not a practical solution, and windows will still be writing to the same bit of memory, etc.

I believe Windows will put you into an exception if you write outside the preserved memory for the application. At least in Win32 applications.

#28691 - pyros - Thu Nov 04, 2004 4:15 pm

well it definitely worked in win95; using inline assembler in delphi 2.0. this wasn't intended to be a practical solution. perhaps something, somewhere does use it though.

#28718 - keldon - Thu Nov 04, 2004 11:59 pm

I thought that windows 98 gave no response at all when I tried it ( a long, long time ago)?!?