VB81 Hi-Res Hiccup

Emulator and emulator development specific topics
Post Reply
butchi
Posts: 38
Joined: Wed Jun 12, 2019 4:12 am

VB81 Hi-Res Hiccup

Post by butchi »

Hi,
VB81 display does render this Hi-Res .P file, however, the fine detail is missing:
link
dr beep
Posts: 2060
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

Re: VB81 Hi-Res Hiccup

Post by dr beep »

What is wrong with the emulator?
It looks like how the game itself is coded is shown.
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: VB81 Hi-Res Hiccup

Post by XavSnap »

Hi,

VB81 is not designed to run hi-res graphics on the video IO/rebuild display routine.
Only the hi-res graphics cards are properly emulated.

UDG's and RocketMan like can be used, but most of early hi-res stuff just get a blank screen.

This failing is due to the poor visual BASIC accuracy and the choice to bypass the ZX81's display routine to speed up the emulator and run it on a 200 Mhz PC.

To run a hight res program, prefer EO to get the right display...

Have fun.
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
butchi
Posts: 38
Joined: Wed Jun 12, 2019 4:12 am

Re: VB81 Hi-Res Hiccup

Post by butchi »

VB81 Developer, etc.,
You can use external libraries or API calls to achieve more accurate timing functionality in VB6. For example, you can use the Windows API to call assembly code written in a separate DLL file. Here's a simple demonstration using inline assembly in a DLL and calling it from VB6:

First, create a new DLL project in a language that supports inline assembly, such as C or C++. Here's an example in C:

'C'
// ExampleDLL.c

#include <windows.h>

__declspec(dllexport) int AddNumbers(int a, int b)
{
int result;

__asm
{
mov eax, a
add eax, b
mov result, eax
}

return result;
}

Compile the DLL code to produce the DLL file. Let's assume the DLL file is named "ExampleDLL.dll."

Next, create a new VB6 project and add a command button to the form. Double-click the command button to open its click event handler, and add the following code:

'VB6'
Private Declare Function AddNumbers Lib "ExampleDLL.dll" (ByVal a As Long, ByVal b As Long) As Long

Private Sub Command1_Click()
Dim a As Long
Dim b As Long
Dim result As Long

a = 10
b = 20

result = AddNumbers(a, b)

MsgBox "The result is: " & result, vbInformation, "Inline Assembly Demo"
End Sub

In this VB6 code, we're using the Declare statement to import the AddNumbers function from the DLL file we created earlier. Then, we call the AddNumbers function with two integer parameters and display the result in a message box.

When you run the VB6 project and click the command button, the AddNumbers function in the DLL will be invoked with the values 10 and 20, and the result will be displayed in a message box.

Keep in mind that inline assembly is not a standard feature of VB6, and this approach involves using external libraries and potentially unsafe code. Therefore, caution should be exercised when working with inline assembly in this manner.
User avatar
GCHarder
Posts: 427
Joined: Sat Dec 14, 2013 7:46 pm

Re: VB81 Hi-Res Hiccup

Post by GCHarder »

FYI, it is quite simple to use the QS board for hires dev, in lieu of WRX. They have the same resolution unlike Memotech HRG. As I recall all that is needed is to change the pointer to the WRX dfile to the QS dfile and turn off the WRX display driver.

I've never had problems running Pseudo Hires in VB81.

Regards;

Greg
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: VB81 Hi-Res Hiccup

Post by XavSnap »

Hi,

Yes, butchi.
I ever code DLLs in VB, but better rewrite an emulator in a new language.
I decide to code and upgrade VB81 to complement EO from 2005.
At the time, only a handful of HRG games were available.
But, the ZX81's spirit wasn't target on HRG, UDG was the standard...

In 1984, if you wanted HRG graphics, you had to buy a Spectrum!
:mrgreen:

Better let a chance to the wonderful EO to test ours HRG games.

Greg, i used to run all HRG programs in EO... I prefer not to be forced to be disappointed with VB81!

:D
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
butchi
Posts: 38
Joined: Wed Jun 12, 2019 4:12 am

Re: VB81 Hi-Res Hiccup

Post by butchi »

Greg wrote:
> FYI, it is quite simple to use the QS board for hires dev, in lieu of WRX. They have the same resolution unlike Memotech HRG. As I recall all that is
> needed is to change the pointer to the WRX dfile to the QS dfile and turn off the WRX display driver.

> I've never had problems running Pseudo Hires in VB81.

Hi,
This link confirms VB81 does emulate QS-HRG:
link

Q1: Does the QS-HRG ROM, in the ROMS directory, replace the ZX81 ROM and how exactly is VB81 QS-HRG emulation setup, so RAND USR 11036 can auto test its functionality?
Q2: Could the following 'HIRES' SRC, from post #1 .P file, be modified to use VB81 QS board emulation for hires, in lieu of WRX, etc., without reinventing-the-wheel?
thanks!

Code: Select all

;
; pachires.asm
;
; hires routines

;switch to high res
hires	
;wait for an interrupt
	halt 	
;wait for a vsync
	ld a,(FRAMES)
	ld c,a
sync1	
	ld a,(FRAMES)		
	cp c
	jr z,sync1
;replace the render routine		
	ld ix,hresgen
	ret
		
;switch back to low res
lores	
;wait for an interrupt
	halt 
;wait for a vsync
;	ld a,(FRAMES)
;	ld c,a
sync2	
;	ld a,(FRAMES)
;	cp c
;	jr z,sync2
;reset the I register to the ROM default		
	ld a,$1e
	ld i,a
;put back the normal display routine		
	ld ix,DISPROUT
	ret

;actual hires routine
hresgen
;slightly odd address - but it's basically 'back one line' from the start of the screen memory
;with bit 15 of the address set
	ld hl,(HDISPLAY - DISPLEN) + $8000
;set the line width	
	ld de,DISPLEN
;the ULA port address		
	ld c,$0FE
;offset within the ROM that gives us the best bit patterns for this game...
	ld a,HIRES_IDX
	ld i,a
;delay to sync with tv	
	ld b,5
syncx
	djnz syncx
;draw 192 lines of hires things
	ld b,$c0
hreslp1	
;keep the ULA thinking it's on the first line of a character		
	in a,(c)
	out ($ff),a
	add hl,de
	call intoula	
	dec b
	jp nz,hreslp1

;sneakily jump into a couple of  ROM routines
	call DISPLAY_3
	call SLOWORFAST + $19
	ld ix,hresgen
;jump back into the ROM
	jp (DISPLAY_3 + $12)
	
intoula
	jp (hl)
User avatar
GCHarder
Posts: 427
Joined: Sat Dec 14, 2013 7:46 pm

Re: VB81 Hi-Res Hiccup

Post by GCHarder »

You just have to enable QS-HRG in the hardware video section and the ROM is loaded automatically.

There's some demo programs in the "HRG-CARDs-DEMO\QS HRG" folder.

Greg
butchi
Posts: 38
Joined: Wed Jun 12, 2019 4:12 am

Re: VB81 Hi-Res Hiccup

Post by butchi »

Hi,
I got some demo programs in the "HRG-CARDs-DEMO\QS HRG" folder to function with VB81, but no docs.
Therefore, the next challenge is to convert the two WRX files in the following link to QS HRG, that Greg reported earlier, he was able to do.
LABEL__64K___16K
DFILE_9613->16627
WRX_HIRES_9640->16654
NORMAL_RES_9714->16728
DUMMY_DISPLAY_FILE_16692->16692; Bug in KB64K, now functional
DISPLAY_HANDLER_11526->18540
thanks!
PS. If anyone fully understands 'D_D_F', please post memory locations where it can be accessed, Developer placed it in the 8K-16K RAM area, which failed on this rig!
butchi
Posts: 38
Joined: Wed Jun 12, 2019 4:12 am

Re: VB81 Hi-Res Hiccup

Post by butchi »

Hi,
Updated the 'buggy' KB64K Hi-Res file in post #9.
Please report functionality on your rig . . .
Post Reply