VOGONS


King's Valley

Topic actions

First post, by wiebermensch

User metadata
Rank Newbie
Rank
Newbie

Motherboard : AOPEN AX6B
Processor : Celeron 533MHz
RAM : SDRAM 128MB
Video board : GForce4 Ti 4200 w/ 64MB DDR RAM
Sound board : Sound Blaster 16(PCI)
Operating system : Windows 2000 5.00.2195 SP4
Game name : King's Valley
Description of problem : (cf: When I don't use DOSBox and just
double-click B.EXE, I can see VGA title screen and corrupted game
screen.) Using DOSBox, I can see 4-color title screen and corrupted
game screen. I can press 1 and start the game, but the sprites seem
to be jerky and screen doesn't change(i.e. When I move to rightmost
end of screen, screen should scroll to show another part of map, but
it doesn't.)
Reproducibility of problem : always
Sound mode used : base=220,irq=7,dma=1,hdma=5,sbrate=22050,enabled=true,adlib=true,cms=false,cmsrate=22050
Video mode : 1024*768 Truecolor
Version of emulator : 0.60
Steps already attempted to solve the problem :

Hi.
I think DOSBox is SO GREAT emulator which I have seen.
I admire programmers who make emulators.
By the way, I downloaded King's Valley, which is famous PC game
made by APROMAN in 1989 March. It is PC version(NOT the porting) of
MSX game King's Valley. I love this game, but I think it can not run
on DOSBox. I don't know if there is a fault in the GAME ITSELF.
But I guess it can't run on current version DOSBox because it runs on
Hercules(Monochrome) computer...(I am not sure, because I can
see colorful title screen and colorful but broken game screen.)
I really hope that DOSBox programmers would download and test
the game in DOSBox and make some conclusion. (e.g. "This game is
corrupted!" or "This game can not run on DOSBox v0.60!")
kvtitle.gif
I attached the game and screenshot.

Attachments

  • Filename
    kingsval.zip
    File size
    67.58 KiB
    Downloads
    467 downloads
    File comment
    Press 1 twice then the game starts.
    File license
    Fair use/fair dealing exception

Reply 3 of 15, by wiebermensch

User metadata
Rank Newbie
Rank
Newbie

I have played that version.
Yes, it is cool, but in fact it is NOT PC version.
I have memories on APROMAN King's Valley, so I want to
play it again. UnderDogs administrator says "there is no
PC conversion of MSX King's Valley", but it's not true.
Korean company APROMAN ported the game well, and
many koreans have enjoyed it.
Thanks anyway. 😉

Reply 5 of 15, by eL_PuSHeR

User metadata
Rank l33t++
Rank
l33t++

No, he, he, was a little joke on myself. With DOSBOX (all caps and just one word, i mean the emulator) as opposite to a dos box (ms-dos box) or NTVDM (NT Virtual DOS Machine). I added the (tm) thingie to DOSBOX name just for fun, heh. 😁 If i would have known it would cause such hassle, i would not had done it. Sorry.

Reply 6 of 15, by taiken7

User metadata
Rank Member
Rank
Member

Just a brief update; a forced HGC with the provided zip'd game;
It returns
"!! You must have CGA or EGA or VGA or MCGA."

If I force Tandy (~MCGA), I get this screenshot
(There are still a few modes to implement, I'll try have them
ready for the 0.61 release for ya wiebermensch)

Attachments

  • kingsvalley.PNG
    Filename
    kingsvalley.PNG
    File size
    13.91 KiB
    Views
    3853 views
    File comment
    Snapshot .. several tweaks needed...
    File license
    Fair use/fair dealing exception

Reply 7 of 15, by taiken7

User metadata
Rank Member
Rank
Member

Right, managed to get scrollers working for HGC/CGA/TANDY.

So this game now works.
For those with CVS, head over to
HGC( Hercules Monochrome) WIP report
to update your build.

I will look at adding/fixing EGAVGA scrollers a little later.

Attachments

  • Filename
    kingsvalley.PNG
    File size
    24.94 KiB
    Downloads
    243 downloads
    File comment
    4x4 images showing off new scrollersTM in King's Valley.
    File license
    Fair use/fair dealing exception

Reply 8 of 15, by Stiletto

User metadata
Rank l33t++
Rank
l33t++

I dunno what you're doing to those PNG files, but Internet Explorer 6.0 doesn't like it. 😒

[EDIT] Just confirmed that I could download the PNG and view it in Windows XP's built-in Image Viewer. Internet Explorer 6 doesn't like this image, I dunno why.

"I see a little silhouette-o of a man, Scaramouche, Scaramouche, will you
do the Fandango!" - Queen

Stiletto

Reply 10 of 15, by wiebermensch

User metadata
Rank Newbie
Rank
Newbie

Perfect! I upgraded DOSBox 0.60 to 0.61, and then I could play King's Valley! Thanks guys!

You should change dosbox.conf a little.
Change "machine=auto" to "machine=cga".

Attachments

  • kingsva1.gif
    Filename
    kingsva1.gif
    File size
    13.13 KiB
    Views
    3696 views
    File comment
    King's Valley Level 1 snapshot
    File license
    Fair use/fair dealing exception

Reply 14 of 15, by wiebermensch

User metadata
Rank Newbie
Rank
Newbie

If you run King's Valley under VGA, it enters into MODE 04H(i.e, 320*200 4-color graphics).
But if you run King's Valley under Hercules(or edit DOSBox.conf to machine=cga and play the game on DOSBox), it enters into MODE 06H(i.e, 640*200 2-color graphics) and you can play the game without a jerky screen.
Now I shall introduce some programming TIPs. Perhaps DOSBox programmers should already know it, but I hope it should be helpful to newbies like me. 😀
Maybe you should know how to access video memory on MODE 13H(i.e, 320*200 256-color graphics)...if you don't know, you can confer Alex Russell's Dos Game Programming in C for Beginners site.
In MODE 13H, if you want to draw a pixel on (x,y), the only thing you should do is just to put color palette value into A000:offset where offset=y*320+x.
OK. I will return to the subject.
MODE 06H is a little tricky. B800:0000~B800:1F3F represents even lines(i.e, (0,2k)~(639,2k) ), and B800:2000~B800:3F3F represents odd lines(i.e, (0,2k+1)~(639,2k+1) ). B800:1F40~B800:1FFF represents NOTHING!!!
So in MODE 06H if you want to draw 8 pixels on (8x,2y)~(8x+7,2y), the only thing you should do is just to put BYTE into B800:offset where
offset=y*80+x. To draw 8 pixels on (8x,2y+1)~(8x+7,2y+1), put BYTE into B800:offset where
offset=8192+y*80+x.
BYTE is byte representation of 8 pixels. That is, one BYTE consists of 8 bits, and these bits represents black(0)/white(1). MSB(Most Significant Bit) represents leftmost pixel and LSB represents rightmost pixel. For example, 0xA6 represents *_*__**_.

p.s. Next example codes are equivalent:

***** Assembly Language *****
1A28:0100 B80600 MOV AX,0006
1A28:0103 CD10 INT 10 #Enter into MODE 06H
1A28:0105 BF0000 MOV DI,0000
1A28:0108 B800B8 MOV AX,B800
1A28:010B 8EC0 MOV ES,AX
1A28:010D B0A6 MOV AL,A6 #*_*__**_
1A28:010F 26 ES:
1A28:0110 8805 MOV [DI],AL #Put A6 into B800:0000
1A28:0112 CD20 INT 20 #Return to DOS
(You will not be able to see the result because of screen scrolling. If you want to see the result, change last instruction to JMP 0110. You can break infinite loop pressing Ctrl+C.)

***** Turbo C++ 3.0 for DOS *****
#include <dos.h>
int old_mode;
unsigned char far *screen;
void main(void){
union REGS in, out;
// get old video mode
in.h.ah=0x0F;
int86(0x10, &in, &out);
old_mode=out.h.al;
// enter mode 06h
in.h.ah=0;
in.h.al=0x06;
int86(0x10, &in, &out);
screen=(unsigned char far *)MK_FP(0xB800, 0); // screen points to B800:0000
*screen = 0xA6; //*_*__**_
}
(Also, if you want to see the result, append getch();. You should include <conio.h> too.)

***** Quick Basic 3.0 for DOS *****
SCREEN 2
PSET(0,0),1
PSET(1,0),0
PSET(2,0),1
PSET(3,0),0
PSET(4,0),0
PSET(5,0),1
PSET(6,0),1
PSET(7,0),0

or

SCREEN 2
DEF SEG = &HB800
POKE &H0,&HA6 '*_*__**_

Reply 15 of 15, by wiebermensch

User metadata
Rank Newbie
Rank
Newbie

Whew, I did it!
I had a lot of difficulties in hacking King's Valley,
and recently I found out why: EXE file was COMPRESSED!!!
I didn't know EXE can be compressed to smaller EXE file!
When I examined the program header,
I found string "PKLITE Copr. 1990-91 PKWARE Inc.",
so I used pklite -x to decompress B.exe
Then hacking it was a piece of cake 😀
I fixed three INT 10 parts to set correct values to registers.
0D13:19BC INT 10(AH=12,BL=10) <- Should set AX FF10 and set CX 000F

0D13:1A7E INT 10(AX=3006) <- Should set AX 3000

0D13:1A23 INT 10(AX=1A00) <- Should set AL 0 and set BX FF10

Now, enjoying the game on real dos or command window is possible.
Enjoy and be happy 😀

Attachments

  • Filename
    kvfixed.zip
    File size
    61.32 KiB
    Downloads
    336 downloads
    File comment
    King's Valley. Fixed to be able to run on VGA card. But the game color is originally monotone.
    File license
    Fair use/fair dealing exception