Taking SC5 snapshot of games

Página 1/5
| 2 | 3 | 4 | 5

Por ~mk~

Master (227)

imagem de ~mk~

15-09-2012, 06:28

Hi everyone,
I've been trying to create SC5 files of in-game snapshots to create a cool game selector.
So far the only way I managed to do it is by using an emulator, taking the snapshot in png format, and then converting it with jannone's scrconv.exe.
This method works fine, but I find it a little tedious and has a few problems.
First, it must be an emulator which takes the snapshot at the exact resolution (256x212) otherwise I have to manually crop the relevant part of the snapshot. Second and last, I am noticing some color differences between different emulators (tried BlueMSX, openMSX and MESS so far) and I'm not sure which is more accurate.
So I wanted to ask you guys, how would you accomplish this task? I'm afraid using an emulator can't be avoided. In that case which one would you recommend? Is there any emu which can take a snapshot directly in SC5 format? That would be awesome because I wouldn't have to do the conversion manually.
Ideas, suggestions, anything welcome! Smile

Entrar ou registrar-se para comentar

Por Manuel

Ascended (15829)

imagem de Manuel

15-09-2012, 09:58

In openMSX it would be possible to make a small script that reads out the VRAM data and writes it to a file in the proper format.

Normal screenshots are including borders and all video effects, so it depends also on settings like scaler and stuff like TV-emulation (NTSC filters perhaps? Don't know what blueMSX has) and stuff like that.

Por wolf_

Ambassador_ (9774)

imagem de wolf_

15-09-2012, 11:10

Some games feature colour screen splits, e.g. an upper 2/3 for the gaming area, a lower 1/3 for a status bar. Some games even feature a screen mode split *and* a colour split and a scroll split, think Psycho World. You wouldn't be able to make proper vram dumps in .sc5/.ge5 format for all games - at least not from the parts that feature all these splits. That's where regular bitmap dumps work best..

Por NYYRIKKI

Enlighted (5399)

imagem de NYYRIKKI

15-09-2012, 12:06

If someone makes such a script for OpenMSX, then this is how I think the output file should be build:

SC5 format:

File offset #0000-#0006:
RAW DATA: #FE,#00,#00,#FF,#7F,#00,#00

File offset #0007-#7406
Bytes from VRAM: offset= ([VDP R#2] AND 96)*1024

File offset: #7407-#7786
Bytes from VRAM: offset= (([VDP R#5] AND 252)+[VDP R#11]*256)*128-512

File offset: #7687-#76A6
Dump of Pallette RAM

File offset: #76A7-#7806
Bytes from VRAM: offset= ([VDP R#2] AND 96)*1024+30368

File offset: #7807-#8006
Bytes from VRAM: offset= [VDP R#6]*2048

Forget the screen splits. It might not work for screen captures for games, but it might proof it self other ways handy tool to have.

Por Manuel

Ascended (15829)

imagem de Manuel

15-09-2012, 13:13

NYYRIKKI: you almost wrote the script there!

Por NYYRIKKI

Enlighted (5399)

imagem de NYYRIKKI

15-09-2012, 13:23

Yes, but I don't know anything about TCL Crying

Por Manuel

Ascended (15829)

imagem de Manuel

15-09-2012, 14:15

Well, it's not very hard... take a look at some other scripts like those in example_tools.tcl... (see http://openmsx.svn.sourceforge.net/viewvc/openmsx/openmsx/tr... )

If you get on IRC, we can chat about it and make it together.

Por NYYRIKKI

Enlighted (5399)

imagem de NYYRIKKI

15-09-2012, 15:20

Damn you lazy, no good bastards...

Why do I get to do all the stupid stuff?

Grr... This should do it...

proc SC5capture { } {
     set out [open "SCREEN.SC5" w]
         fconfigure $out -translation binary
         puts -nonewline $out [binary format c* {0xFE 0 0 0xFF 0x7F 0 0}]
         set bg [expr ([debug read "VDP regs" 2] & 96)*1024]
         set en [expr $bg + 0x7400]
         for { set adr $bg} { $adr < $en } { incr adr } {
             puts -nonewline $out [binary format c [debug read VRAM $adr] ]
         }
         set bg [expr (([debug read "VDP regs" 5] & 252)+[debug read "VDP regs" 11]*256)*128-512]
         set en [expr $bg + 0x280]
         for { set adr $bg} { $adr < $en } { incr adr } {
             puts -nonewline $out [binary format c [debug read VRAM $adr] ]
         }
         for { set adr 0} { $adr < 32 } { incr adr } {
             puts -nonewline $out [binary format c [debug read "VDP palette" $adr] ]
         }
         set bg [expr ([debug read "VDP regs" 2] & 96)*1024+30368]
         set en [expr $bg + 0x160]
         for { set adr $bg} { $adr < $en } { incr adr } {
             puts -nonewline $out [binary format c [debug read VRAM $adr] ]
         }
         set bg [expr [debug read "VDP regs" 6]*2048]
         set en [expr $bg + 0x800]
         for { set adr $bg} { $adr < $en } { incr adr } {
             puts -nonewline $out [binary format c [debug read VRAM $adr] ]
         }
     close $out
}

Por Manuel

Ascended (15829)

imagem de Manuel

15-09-2012, 16:21

Wow, NYYRIKKI, you rock Smile

It works! Smile

Por Meits

Scribe (5656)

imagem de Meits

15-09-2012, 16:37

Hahahaha... Big LOL here Tongue
Nyyrikki doesn't have to do much to entertain his audience Smile

Por wouter_

Champion (418)

imagem de wouter_

15-09-2012, 17:05

NYYRIKKI wrote:

[13:23] Yes, but I don't know anything about TCL
[15:20] Grr... This should do it...

In less than 2 hours from knowing nothing about Tcl to a fully functional script ... openMSX scripting can't be that hard Wink

Just a few simplifications:

proc SC5capture {{filename "SCREEN5.SC5"}} {
	set out [open $filename w]
	fconfigure $out -translation binary
	puts -nonewline $out [binary format c* {0xFE 0 0 0xFF 0x7F 0 0}]

	set adr [expr ([vdpreg 2] & 96) * 1024]
	puts -nonewline $out [debug read_block "VRAM" $adr 0x7400]

	set adr [expr (([vdpreg 5] & 252) + [vdpreg 11] * 256) * 128 - 512]
	puts -nonewline $out [debug read_block "VRAM" $adr 0x280]

	puts -nonewline $out [debug read_block "VDP palette" 0 32]

	set adr [expr ([vdpreg 2] & 96) * 1024 + 30368]
	puts -nonewline $out [debug read_block "VRAM" $adr 0x160]

	set adr [expr [vdpreg 6] * 2048]
	puts -nonewline $out [debug read_block "VRAM" $adr 0x800]

	close $out
}
Página 1/5
| 2 | 3 | 4 | 5