PC compatible text modes

Discussion of development of software for any "obsolete" computer or video game system. See the WSdev wiki and ObscureDev wiki for more information on certain platforms.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: PC compatible text modes

Post by lidnariq »

A lot of people have written VGA text mode emulators for various projects, when true VGA text mode wasn't really accessible anymore.

Obviously there's the one in the linux kernel (fbcon), and the ones in DOSEMU and DOSBOX. There's also one for Schism Tracker, one for OpenCubicPlayer, one for Adlib Tracker 2, one for MegaZeux ...
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: PC compatible text modes

Post by tepples »

A VGA text mode emulator is probably simpler than, say, the PPU part of an NES or Game Boy emulator.
User avatar
Banshaku
Posts: 2417
Joined: Tue Jun 24, 2008 8:38 pm
Location: Japan
Contact:

Re: PC compatible text modes

Post by Banshaku »

Dosbox is used today to distribute commercial games from the ms-dos era so I wouldn't call it a nesticle experience.

It all depends of your goals: if you want to program like in the dos days to learn how it was done then dosbox will be the easiest solution. Dosbox runs on windows, linux, mac, bsd etc. Freedos.. Well.. You may not be able to make the sound work with new hardware unfortunately. That will be the first issue encountered.

If your goal is just to have a text based ui and be multiplatform then it will get a lot more complicated.

Before choosing a platform I think you will need to clarify your goals first.
zzo38
Posts: 1096
Joined: Mon Feb 07, 2011 12:46 pm

Re: PC compatible text modes

Post by zzo38 »

One thing that having emulation of the text mode is useful for is if the program will be ported to computers that are not even a PC, and/or porting to a windowed system. If your program is written for DOS, then you can use Dosbox to emulate it (as well as other features such as FM synth) on many kinds of computers.

Also, I was designing a new kind of computer system design and one of the things that the video processor was designed to do is to be able to emulate a PC text mode by using a display list similar to the following (this one does not implement the cursor, but adding a sprite with the impostor and occult bits set, and the logic necessary to activate it, could be used to add the cursor):

Code: Select all

	; Set mode (could be omitted if programmed during initialization)
L0	LDA #$20
	SAR #MODE
	; Do text blinking
	LDA V1
	<CMC
	ADC #0
	CMP #60
	>LDA #0
	STA V1
	; Initialize playfield address
	LDA #$80
	STA V2+0
	SAR #PFAH
	LDA #$00
	STA V2+1
	SAR #PFAL
	; Initialize character page address
	LDA #$40
	STA V3
	; Do processing for next scanline
L1	LDA V1
	CMP #30
	LDA V3
	SAR #CHRP+0
	SAR #CHRP+2
	<LDA #$48
	SAR #CHRP+1
	SAR #CHRP+3
	WAI -
	LDA V3
	CMP #$47
	>LDA #$3E
	ADC #1
	STA V3
	CMP #$41
	<JMP L1
	; Advance playfield address
	LDA V2+1
	ADC #79
	STA V2+1
	SAR #PFAL
	LDA V2+0
	ADC #0
	STA V2+0
	SAR #PFAH
	; Next
	JMP L1
	; Variables (they could be inlined for improved speed)
V1	DATA 59 ; Blinking time
V2	SPACE 2 ; Playfield address
V3	SPACE 1 ; Character page address
And if you can find the PC CGA schematics then look since possibly you might find something of interst to you (I don't know).
(Free Hero Mesh - FOSS puzzle game engine)
User avatar
Bregalad
Posts: 8056
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Re: PC compatible text modes

Post by Bregalad »

I guess I could always shape the code so that it can be compiled either as a genuine DOS application and be run in either DosBox or FreeDOS (or both), or make it a graphical applicaiton using an existing VGA simulator so that it can be run natively without those programs. Yet it's still strangely complicated to have to go through all this to simply build a semi-graphical application.
zzo38
Posts: 1096
Joined: Mon Feb 07, 2011 12:46 pm

Re: PC compatible text modes

Post by zzo38 »

Bregalad wrote:I guess I could always shape the code so that it can be compiled either as a genuine DOS application and be run in either DosBox or FreeDOS (or both), or make it a graphical applicaiton using an existing VGA simulator so that it can be run natively without those programs. Yet it's still strangely complicated to have to go through all this to simply build a semi-graphical application.
If a library for doing this would be written (with x86-specific code when compiling for DOS), then it can be use for multiple purposes in this way, for any program that would use this.
(Free Hero Mesh - FOSS puzzle game engine)
Post Reply