Videopac / Odyssey2 forum
September 25, 2021, 09:02:50 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Join Rafael's Haunted Woods contest and win a copy of the game!
 
   Home   Help Login Register links videopac.nl  
Pages: [1]   Go Down
  Print  
Author Topic: Videopac-emulator on the ZX Spectrum  (Read 782 times)
dr beep
Played Munchkin once...
**
Posts: 65


« on: March 16, 2021, 06:51:40 PM »

Hello,

in 2000 I coded a Videopac-emulator on the ZX Spectrum.
It uses a method to translate 8048 ROMS into Z80 code and then run the translated code.

It is slow and not all games run.

Last year I recoded my ZX81 emulator from 1997 and I think I can make the Videopac-emulator better as well.

I might ask a few things, although I worked all things out in 2000 with the info from Dan Boris site.

If you want to try the emulator:
https://spectrumcomputing.co.uk/entry/15647/ZX-Spectrum/Videopac_Emulator
Logged
Rafael
Pedit5
I take the Videopac and leave the Canoli!
*
Posts: 2723



« Reply #1 on: March 16, 2021, 10:16:16 PM »

Yes, I remember playing it many years ago. Wink Cool
Logged
dr beep
Played Munchkin once...
**
Posts: 65


« Reply #2 on: August 01, 2021, 03:30:10 PM »

After coding SHOGUN ( experts : SEE MY POST REGARDING HARDWARE ISSUES) I started totake a look on my videopac-emulator from 2000.

My documentation is old and coded on a compiler on the ZX Spectrum itself.
Due to lack of memory parts are hardcoded and I need a disassembler to make it readable.

These days I can use a crosscompiler that will do the job for me.
I already have several ideas to improve the speed of the emulator.
Also some ideas to make GOLF run on the emulator. This game has some issues with my collissiondetection which I might fix in a general way.

Still not all games will run on the ZX Spectrum. I will keep off sound and colour might become an option ( SHOGUN needs colour!).

Quick question to the experts:
Is SEL RB0 only used in the BIOS? If so I can win speed with an alternative way to emulate SEL RB0 and SEL RB1.
Logged
manopac
Game & App Development
Give this man a Jopac!
*
Posts: 1157



« Reply #3 on: August 01, 2021, 10:38:37 PM »

> Quick question to the experts:
> Is SEL RB0 only used in the BIOS? If so I can win speed with an alternative way to emulate SEL RB0 and SEL RB1.

I use it in my code, as I don't use the interrupt routines from the BIOS ... basically it depends if a game is using the BIOS a lot or if it doesn't ... if it doesnt, it gives the programmer more variables in the second RB ...
Logged

sex, lies, and videopac
dr beep
Played Munchkin once...
**
Posts: 65


« Reply #4 on: August 02, 2021, 05:17:11 PM »

Thanks....

I still think I can speed up the emulator even if I correctly emulate SEL RB0/RB1.
I can "translate" the BIOS-routines into opcodes that are not used and make those execute the full BIOS-routine.
Logged
dr beep
Played Munchkin once...
**
Posts: 65


« Reply #5 on: August 02, 2021, 09:36:50 PM »

I just coded a new main emulationpart.

The main emulator part is now 33 tstates to get to an emulated code. This was 55 tstates.
Also the emulation itself is quicker. Besides that the code is smaller.

Still a long way to go, so far only 8 opcodes emulated.
Logged
dr beep
Played Munchkin once...
**
Posts: 65


« Reply #6 on: August 14, 2021, 12:04:04 PM »

Due to the translation from 8048 to Z80 CALL and RET can meet 4 fases. I need to test them all.
Sofar working:

CALL   RET
8048 8048 working
8048 Z80 working
Z80 8048 need testing
Z80  Z80   working
Logged
dr beep
Played Munchkin once...
**
Posts: 65


« Reply #7 on: August 14, 2021, 08:10:53 PM »

All CALL and RET now tested and working.

This 8048-code
000   07   dec a
001   1405   call 005
003   0400   jmp 000
005   1208   jb0 008
007   15   ret
008   15   ret

Translates into this Z80-code
9d01 dec a
9d02 call 9d0a
9d05 jp 9d13
9d08 dw 0003   ; remnant from testing all addresses translated
9d0a bit 0,a
9d0c jp nz,9d12
9d0f jp 9d16
9d12 ret
9d13 jp 9d01
9d16 ret
Logged
dr beep
Played Munchkin once...
**
Posts: 65


« Reply #8 on: August 15, 2021, 05:47:12 PM »

I started with a shortened opcodefinderprogram, but the code got too long to maintain this method.
I now use a routine with the same effect as in the 2000 emulaor but the opcode is found in 44 tstates not in 55 so 25% in the new emulator.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!