It is currently Wed May 24, 2017 6:17 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 36 posts ]  Go to page Previous  1, 2, 3
Author Message
PostPosted: Mon Aug 22, 2016 2:07 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 5687
Location: Seattle
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 ...


Top
 Profile  
 
PostPosted: Mon Aug 22, 2016 2:09 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 18345
Location: NE Indiana, USA (NTSC)
A VGA text mode emulator is probably simpler than, say, the PPU part of an NES or Game Boy emulator.


Top
 Profile  
 
PostPosted: Mon Aug 22, 2016 3:52 pm 
Offline
User avatar

Joined: Tue Jun 24, 2008 8:38 pm
Posts: 1500
Location: Fukuoka, Japan
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.


Top
 Profile  
 
PostPosted: Tue Aug 23, 2016 1:35 am 
Offline
User avatar

Joined: Mon Feb 07, 2011 12:46 pm
Posts: 885
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:
   ; 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).

_________________
.


Top
 Profile  
 
PostPosted: Wed Aug 24, 2016 12:09 pm 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7035
Location: Jongny, VD, Switzerland
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.


Top
 Profile  
 
PostPosted: Wed Aug 24, 2016 8:17 pm 
Offline
User avatar

Joined: Mon Feb 07, 2011 12:46 pm
Posts: 885
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.

_________________
.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 36 posts ]  Go to page Previous  1, 2, 3

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group