Taking SC5 snapshot of games

Page 2/5
1 | | 3 | 4 | 5

By Manuel

Ascended (15799)

Manuel's picture

15-09-2012, 17:21

Nice one Wouter! Now to generalize it for other screen modes Smile

Your move, NYYRIKKI? ;-)

By hit9918

Prophet (2868)

hit9918's picture

15-09-2012, 18:21

Did I get it right, the script doesn't capture screensplit?

Quickest way would be snapshot in no-zoom mode.
Zoom and blur is what makes wrong colors.

But there are Emulator problems:
bluemsx screenshot is always zoomed
openmsx screenshot in 1x no-zoom mode is blured.

Looks like the emu always renders 512 pixels, and openmsx then zooms it down with bilinear zoom, causing blur.
feature request: point sampling zoom in the "renderer" selection.
That zoom would do a plain copy of every second pixel, no blur.

With the small window one first thinks "cant see small things on big PC monitor", but a lot of it is the zoom blur.

By wouter_

Champion (418)

wouter_'s picture

15-09-2012, 19:31

hit9918 wrote:

Did I get it right, the script doesn't capture screensplit?

Correct.

hit9918 wrote:

openmsx screenshot in 1x no-zoom mode is blured.

The screenshot command in openmsx has many possibilities:
- The screenshot command without parameters creates a screenshot of the screen as it is currently rendered, so including all video effects (and this can be configured in many ways, also 1x zoom without any blur)
- When you give the command screenshot -raw, it creates a 320x240 image of only the MSX screen without any video effects, so no blur
- The command screenshot -raw -doublesize creates a 640x480 image, so that also screen 6/7 has no blur
- It's also possible to add the -no-sprites option, this can be useful to e.g. create maps

By hit9918

Prophet (2868)

hit9918's picture

15-09-2012, 23:26

I just tried
screenshot -raw
in the console, very nice. So the "wrong colors" problem is gone.

On http://msx.jannone.org/conv/ , the option
scale:none
does crop the pic centered. The default setting
palette:adaptive
seems needed to keep colors. I only checked with a BASIC screenshot of color ,4,5.

But screen 5 got only 212 pixel mode, still need to crop if you want 192 pixels.

For writing an openmsx screensave script, would need an API to get stuff into an array instead saved to file. I can't see it in screenshot.tcl .

By Manuel

Ascended (15799)

Manuel's picture

16-09-2012, 09:27

What do you want to do, hit9918? So, why do you want the stuff into an array?

By NYYRIKKI

Enlighted (5396)

NYYRIKKI's picture

16-09-2012, 13:01

There is something wrong with SCREEN 2 routine, but I just can't see it... Please help
(Might include some other bugs as well, input welcome)

proc picsave {fname} {

    set scr [string index "124567 83       0 9" [expr (([debug read "VDP regs" 0]/2)&7)+([debug read "VDP regs" 1]&24)]]

    switch $scr {
    "0" {
            append fname ".SC0"
            set out [open $fname w]
            fconfigure $out -translation binary
            puts -nonewline $out [binary format c* {0xFE 0 0 0xFF 0x0F 0 0}]
            set adr [expr [debug read "VDP regs" 2]*1024]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x400]
            puts -nonewline $out [debug read_block "VDP palette" 0 0x20]
            set adr [expr [debug read "VDP regs" 2]*1024+0x420]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x3E0]
            set adr [expr [debug read "VDP regs" 4]*512]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x800]
            close $out
    }
    "1" {

            append fname ".SC1"
            set out [open $fname w]
            fconfigure $out -translation binary
            puts -nonewline $out [binary format c* {0xFE 0 0 0xFF 0x3F 0 0}]
            # BG Tiles
            set adr [expr [debug read "VDP regs" 4]*512]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x1800]
            # BG Map
            set adr [expr [debug read "VDP regs" 2]*1024]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x300]
            # OBJ Attributes
            set adr [expr ([debug read "VDP regs" 5]+[debug read "VDP regs" 11]*256)*128]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x500]
            # BG Colors
            set adr [expr ([debug read "VDP regs" 3]+[debug read "VDP regs" 10]*256)*64]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x20]
            # Palette
            puts -nonewline $out [debug read_block "VDP palette" 0 0x20]
            # Fill (BG Colors)
            set adr [expr ([debug read "VDP regs" 3]+[debug read "VDP regs" 10]*256)*64+0x40]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x17C0]
            # OBJ Tiles
            set adr [expr ([debug read "VDP regs" 6]*2048)]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x800]
            close $out

    }
    "2" {
            append fname ".SC2"
            set out [open $fname w]
            fconfigure $out -translation binary
            puts -nonewline $out [binary format c* {0xFE 0 0 0xFF 0x3F 0 0}]
            # BG Tiles
            set adr [expr ([debug read "VDP regs" 4] & 60 )*512]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x1800]
            # BG Map
            set adr [expr [debug read "VDP regs" 2]*1024]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x300]
            # OBJ Attributes
            set adr [expr ([debug read "VDP regs" 5]+[debug read "VDP regs" 11]*256)*128]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x500]
            # BG Colors
            set adr [expr (([debug read "VDP regs" 3] & 128)+[debug read "VDP regs" 10]*256)*64]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x20]
            # Palette
            puts -nonewline $out [debug read_block "VDP palette" 0 0x20]
            # Fill (BG Colors)
            set adr [expr (([debug read "VDP regs" 3] & 128)+[debug read "VDP regs" 10]*256)*64+0x40]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x17C0]
            # OBJ Tiles
            set adr [expr ([debug read "VDP regs" 6]*2048)]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x800]
            close $out
    }
    "3" {
            append fname ".SC3"
            set out [open $fname w]
            fconfigure $out -translation binary
            puts -nonewline $out [binary format c* {0xFE 0 0 0xFF 0x3F 0 0}]
            # BG Tiles
            set adr [expr [debug read "VDP regs" 4]*512]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x800]
            # BG Map
            set adr [expr [debug read "VDP regs" 2]*1024]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x1300]
            # OBJ Attributes
            set adr [expr ([debug read "VDP regs" 5]+[debug read "VDP regs" 11]*256)*128]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x520]
            # Palette
            puts -nonewline $out [debug read_block "VDP palette" 0 0x20]
            # Fill (OBJ Attributes)
            set adr [expr ([debug read "VDP regs" 5]+[debug read "VDP regs" 11]*256)*128+0x540]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x17C0]
            # OBJ Tiles
            set adr [expr ([debug read "VDP regs" 6]*2048)]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x800]
            close $out
    }
    "4" {
            append fname ".SC4"
            set out [open $fname w]
            fconfigure $out -translation binary
            puts -nonewline $out [binary format c* {0xFE 0 0 0xFF 0x3F 0 0}]
            # BG Tiles
            set adr [expr ([debug read "VDP regs" 4] & 60 )*512]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x1800]
            # BG Map
            set adr [expr [debug read "VDP regs" 2]*1024]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x380]
            # Palette
            puts -nonewline $out [debug read_block "VDP palette" 0 0x20]
            # Fill (BG Map)
            set adr [expr [debug read "VDP regs" 2]*1024+0x3A0]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x60]
            # OBJ Attributes
            set adr [expr (([debug read "VDP regs" 5] &252)+[debug read "VDP regs" 11]*256)*128-0x200]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x400]
            # BG Colors
            set adr [expr (([debug read "VDP regs" 3] & 128)+[debug read "VDP regs" 10]*256)*64]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x1800]
            # OBJ Tiles
            set adr [expr ([debug read "VDP regs" 6]*2048)]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x800]
            close $out
    }
    "5" {
            append fname ".SC5"
            set out [open $fname w]
            fconfigure $out -translation binary
            puts -nonewline $out [binary format c* {0xFE 0 0 0xFF 0x7F 0 0}]
            # Bitmap
            set adr [expr ([vdpreg 2] & 96) * 1024]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x7400]
            # Sprite colors + attributes
            set adr [expr (([vdpreg 5] & 252) + [vdpreg 11] * 256) * 128 - 0x200]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x280]
            # Palette
            puts -nonewline $out [debug read_block "VDP palette" 0 32]
            # Fill (Bitmap)
            set adr [expr ([vdpreg 2] & 96) * 1024 + 0x76A0]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x160]
            # Sprite character patterns
            set adr [expr [vdpreg 6] * 2048]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x800]
            close $out
    }
    "6" {
            append fname ".SC6"
            set out [open $fname w]
            fconfigure $out -translation binary
            puts -nonewline $out [binary format c* {0xFE 0 0 0xFF 0x7F 0 0}]
            # Bitmap
            set adr [expr ([vdpreg 2] & 96) * 1024]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x7400]
            # Sprite colors + attributes
            set adr [expr (([vdpreg 5] & 252) + [vdpreg 11] * 256) * 128 - 0x200]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x280]
            # Palette
            puts -nonewline $out [debug read_block "VDP palette" 0 32]
            # Fill (Bitmap)
            set adr [expr ([vdpreg 2] & 96) * 1024 + 0x76A0]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x160]
            # Sprite character patterns
            set adr [expr [vdpreg 6] * 2048]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x800]
            close $out
    }
    "7" {
            append fname ".SC7"
            set out [open $fname w]
            fconfigure $out -translation binary
            puts -nonewline $out [binary format c* {0xFE 0 0 0x9F 0xFA 0 0}]
            # Bitmap
            set adr [expr ([vdpreg 2] & 96) * 1024]
            puts -nonewline $out [debug read_block "VRAM" $adr 0xF000]
            # Sprite character patterns
            set adr [expr [vdpreg 6] * 2048]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x800]
            # Sprite colors + attributes
            set adr [expr (([vdpreg 5] & 252) + [vdpreg 11] * 256) * 128 - 0x200]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x280]
            # Palette
            puts -nonewline $out [debug read_block "VDP palette" 0 32]
            close $out
    }
    "8" {
            append fname ".SC8"
            set out [open $fname w]
            fconfigure $out -translation binary
            puts -nonewline $out [binary format c* {0xFE 0 0 0x9F 0xFA 0 0}]
            # Bitmap
            set adr [expr ([vdpreg 2] & 96) * 1024]
            puts -nonewline $out [debug read_block "VRAM" $adr 0xF000]
            # Sprite character patterns
            set adr [expr [vdpreg 6] * 2048]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x800]
            # Sprite colors + attributes
            set adr [expr (([vdpreg 5] & 252) + [vdpreg 11] * 256) * 128 - 0x200]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x280]
            # Palette
            puts -nonewline $out [debug read_block "VDP palette" 0 32]
            close $out
    }
    "9" {
            append fname ".SC0"
            set out [open $fname w]
            fconfigure $out -translation binary
            puts -nonewline $out [binary format c* {0xFE 0 0 0xFF 0x17 0 0}]
            # BG Map
            set adr [expr ([debug read "VDP regs" 2] & 252)*1024]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x800]
            # Blink
            set adr [expr ([debug read "VDP regs" 3]+[debug read "VDP regs" 10]*256)*64]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x700]
            # Palette
            puts -nonewline $out [debug read_block "VDP palette" 0 0x20]
            # Fill (BG Map)
            set adr [expr ([debug read "VDP regs" 2] & 252)*1024+0xF20]
            puts -nonewline $out [debug read_block "VRAM" $adr 0xE0]
            # BG Tiles
            set adr [expr [debug read "VDP regs" 4]*2048]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x800]
            close $out
    }
    default {
            return "Unknown screenmode"
    }}
}

By NYYRIKKI

Enlighted (5396)

NYYRIKKI's picture

16-09-2012, 14:42

Ah, found the problem... I used SCREEN 1 palette address in SCREEN 2 also VDP register 4 handling was incorrect:

Now it is fixed:

proc picsave {fname} {

    set scr [string index "124567 83       0 9" [expr (([debug read "VDP regs" 0]/2)&7)+([debug read "VDP regs" 1]&24)]]

    switch $scr {
    "0" {
            append fname ".SC0"
            set out [open $fname w]
            fconfigure $out -translation binary
            puts -nonewline $out [binary format c* {0xFE 0 0 0xFF 0x0F 0 0}]
            set adr [expr [debug read "VDP regs" 2]*1024]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x400]
            puts -nonewline $out [debug read_block "VDP palette" 0 0x20]
            set adr [expr [debug read "VDP regs" 2]*1024+0x420]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x3E0]
            set adr [expr [debug read "VDP regs" 4]*2048]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x800]
            close $out
    }
    "1" {

            append fname ".SC1"
            set out [open $fname w]
            fconfigure $out -translation binary
            puts -nonewline $out [binary format c* {0xFE 0 0 0xFF 0x3F 0 0}]
            # BG Tiles
            set adr [expr [debug read "VDP regs" 4]*2048]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x1800]
            # BG Map
            set adr [expr [debug read "VDP regs" 2]*1024]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x300]
            # OBJ Attributes
            set adr [expr ([debug read "VDP regs" 5]+[debug read "VDP regs" 11]*256)*128]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x500]
            # BG Colors
            set adr [expr ([debug read "VDP regs" 3]+[debug read "VDP regs" 10]*256)*64]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x20]
            # Palette
            puts -nonewline $out [debug read_block "VDP palette" 0 0x20]
            # Fill (BG Colors)
            set adr [expr ([debug read "VDP regs" 3]+[debug read "VDP regs" 10]*256)*64+0x40]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x17C0]
            # OBJ Tiles
            set adr [expr ([debug read "VDP regs" 6]*2048)]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x800]
            close $out

    }
    "2" {
            append fname ".SC2"
            set out [open $fname w]
            fconfigure $out -translation binary
            puts -nonewline $out [binary format c* {0xFE 0 0 0xFF 0x3F 0 0}]
            # BG Tiles
            set adr [expr ([debug read "VDP regs" 4] & 60 )*2048]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x1800]
            # BG Map
            set adr [expr [debug read "VDP regs" 2]*1024]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x300]
            # OBJ Attributes
            set adr [expr ([debug read "VDP regs" 5]+[debug read "VDP regs" 11]*256)*128]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x80]
            # Palette
            puts -nonewline $out [debug read_block "VDP palette" 0 0x20]
            # Fill (OBJ Attributes)
            set adr [expr ([debug read "VDP regs" 5]+[debug read "VDP regs" 11]*256)*128+0xA0]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x460]
            # BG Colors
            set adr [expr (([debug read "VDP regs" 3] & 128)+[debug read "VDP regs" 10]*256)*64]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x1800]
            # OBJ Tiles
            set adr [expr ([debug read "VDP regs" 6]*2048)]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x800]
            close $out
    }
    "3" {
            append fname ".SC3"
            set out [open $fname w]
            fconfigure $out -translation binary
            puts -nonewline $out [binary format c* {0xFE 0 0 0xFF 0x3F 0 0}]
            # BG Tiles
            set adr [expr [debug read "VDP regs" 4]*2048]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x800]
            # BG Map
            set adr [expr [debug read "VDP regs" 2]*1024]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x1300]
            # OBJ Attributes
            set adr [expr ([debug read "VDP regs" 5]+[debug read "VDP regs" 11]*256)*128]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x520]
            # Palette
            puts -nonewline $out [debug read_block "VDP palette" 0 0x20]
            # Fill (OBJ Attributes)
            set adr [expr ([debug read "VDP regs" 5]+[debug read "VDP regs" 11]*256)*128+0x540]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x17C0]
            # OBJ Tiles
            set adr [expr ([debug read "VDP regs" 6]*2048)]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x800]
            close $out
    }
    "4" {
            append fname ".SC4"
            set out [open $fname w]
            fconfigure $out -translation binary
            puts -nonewline $out [binary format c* {0xFE 0 0 0xFF 0x3F 0 0}]
            # BG Tiles
            set adr [expr ([debug read "VDP regs" 4] & 60 )*2048]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x1800]
            # BG Map
            set adr [expr [debug read "VDP regs" 2]*1024]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x380]
            # Palette
            puts -nonewline $out [debug read_block "VDP palette" 0 0x20]
            # Fill (BG Map)
            set adr [expr [debug read "VDP regs" 2]*1024+0x3A0]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x60]
            # OBJ Attributes
            set adr [expr (([debug read "VDP regs" 5] &252)+[debug read "VDP regs" 11]*256)*128-0x200]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x400]
            # BG Colors
            set adr [expr (([debug read "VDP regs" 3] & 128)+[debug read "VDP regs" 10]*256)*64]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x1800]
            # OBJ Tiles
            set adr [expr ([debug read "VDP regs" 6]*2048)]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x800]
            close $out
    }
    "5" {
            append fname ".SC5"
            set out [open $fname w]
            fconfigure $out -translation binary
            puts -nonewline $out [binary format c* {0xFE 0 0 0xFF 0x7F 0 0}]
            # Bitmap
            set adr [expr ([vdpreg 2] & 96) * 1024]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x7400]
            # Sprite colors + attributes
            set adr [expr (([vdpreg 5] & 252) + [vdpreg 11] * 256) * 128 - 0x200]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x280]
            # Palette
            puts -nonewline $out [debug read_block "VDP palette" 0 32]
            # Fill (Bitmap)
            set adr [expr ([vdpreg 2] & 96) * 1024 + 0x76A0]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x160]
            # Sprite character patterns
            set adr [expr [vdpreg 6] * 2048]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x800]
            close $out
    }
    "6" {
            append fname ".SC6"
            set out [open $fname w]
            fconfigure $out -translation binary
            puts -nonewline $out [binary format c* {0xFE 0 0 0xFF 0x7F 0 0}]
            # Bitmap
            set adr [expr ([vdpreg 2] & 96) * 1024]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x7400]
            # Sprite colors + attributes
            set adr [expr (([vdpreg 5] & 252) + [vdpreg 11] * 256) * 128 - 0x200]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x280]
            # Palette
            puts -nonewline $out [debug read_block "VDP palette" 0 32]
            # Fill (Bitmap)
            set adr [expr ([vdpreg 2] & 96) * 1024 + 0x76A0]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x160]
            # Sprite character patterns
            set adr [expr [vdpreg 6] * 2048]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x800]
            close $out
    }
    "7" {
            append fname ".SC7"
            set out [open $fname w]
            fconfigure $out -translation binary
            puts -nonewline $out [binary format c* {0xFE 0 0 0x9F 0xFA 0 0}]
            # Bitmap
            set adr [expr ([vdpreg 2] & 96) * 1024]
            puts -nonewline $out [debug read_block "VRAM" $adr 0xF000]
            # Sprite character patterns
            set adr [expr [vdpreg 6] * 2048]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x800]
            # Sprite colors + attributes
            set adr [expr (([vdpreg 5] & 252) + [vdpreg 11] * 256) * 128 - 0x200]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x280]
            # Palette
            puts -nonewline $out [debug read_block "VDP palette" 0 32]
            close $out
    }
    "8" {
            append fname ".SC8"
            set out [open $fname w]
            fconfigure $out -translation binary
            puts -nonewline $out [binary format c* {0xFE 0 0 0x9F 0xFA 0 0}]
            # Bitmap
            set adr [expr ([vdpreg 2] & 96) * 1024]
            puts -nonewline $out [debug read_block "VRAM" $adr 0xF000]
            # Sprite character patterns
            set adr [expr [vdpreg 6] * 2048]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x800]
            # Sprite colors + attributes
            set adr [expr (([vdpreg 5] & 252) + [vdpreg 11] * 256) * 128 - 0x200]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x280]
            # Palette
            puts -nonewline $out [debug read_block "VDP palette" 0 32]
            close $out
    }
    "9" {
            append fname ".SC0"
            set out [open $fname w]
            fconfigure $out -translation binary
            puts -nonewline $out [binary format c* {0xFE 0 0 0xFF 0x17 0 0}]
            # BG Map
            set adr [expr ([debug read "VDP regs" 2] & 252)*1024]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x800]
            # Blink
            set adr [expr ([debug read "VDP regs" 3]+[debug read "VDP regs" 10]*256)*64]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x700]
            # Palette
            puts -nonewline $out [debug read_block "VDP palette" 0 0x20]
            # Fill (BG Map)
            set adr [expr ([debug read "VDP regs" 2] & 252)*1024+0xF20]
            puts -nonewline $out [debug read_block "VRAM" $adr 0xE0]
            # BG Tiles
            set adr [expr [debug read "VDP regs" 4]*2048]
            puts -nonewline $out [debug read_block "VRAM" $adr 0x800]
            close $out
    }
    default {
            return "Unknown screenmode"
    }}
}

By Manuel

Ascended (15799)

Manuel's picture

16-09-2012, 21:54

Great move!

You could shorten it a bit by factoring out the common code of these cases.

Some examples:

append fname ".SC$scr"
set out [open $fname w]
fconfigure $out -translation binary

Note that there are some useful procs to use in this case: get_screen_mode_number for instance (and get_screen _mode to get the diff between TEXT40 and TEXT80).

However, at the moment I'm too tired to post an improved script...

By ~mk~

Master (227)

~mk~'s picture

16-09-2012, 23:57

Wow!!!
I didn't know this was possible with openMSX!
Once again I'm impressed by openMSX features.
Thanks a lot for the script NYYRIKKI, it does what I needed (and more). I tested it with screen 2 and 5.
I configured a key binding to "picsave screen" and now I can take an SC snapshot with the press of a key... awesome Cool

By ~mk~

Master (227)

~mk~'s picture

17-09-2012, 05:58

Hello NYYRIKKI,
I found a problem while taking a snapshot in screen 2.
I don't know if it's an issue with the script or something else.
While playing the game Adonis, I paused the emulation (screen looked ok) and took the sc2 snapshot.
Then I tried loading it with a small basic program as follows:

10 SCREEN 2
20 BLOAD"ADONIS.SC2",S
30 A$=INPUT$(1)

And the background of the game looks fine, but the player's ship and bullets look wrong.
It seems only the first quarter of each sprite got saved.
I will try a few more games to see if same thing happens Nishi

Page 2/5
1 | | 3 | 4 | 5