Active Threads | Active Posts | Unanswered Today | Since Yesterday | This Week
MAME Jump to new posts
Re: Autoboot cpc cassette crazyc 12/02/20 03:04 PM
Lua support for tape controls will be in the next release.
3 163 Read More
MAME Jump to new posts
Re: Autoboot cpc cassette crazyc 11/30/20 05:27 PM
Looks like cassette_image_device::change_state has to be exposed to lua for that.
3 163 Read More
MAME Jump to new posts
Re: Autoboot cpc cassette R. Belmont 11/30/20 04:41 PM
As I understand it, you can send keys to the emulated system, but not to MAME itself. That's unfortunately an important distinction here.
3 163 Read More
MAME Jump to new posts
Autoboot cpc cassette bobz 11/30/20 04:32 PM
Hello,

I want to write an autoboot script for cpc cassette software.

It's trivial to send the command to cpc prompt with :

emu.keypost('|TAPE\nRUN"\n\n')

But then I am stuck with tape control. How can I put tape in "play" mode in a LUA script ?
3 163 Read More
MAME Jump to new posts
Re: Ap2000 signs of life Golden Child 11/29/20 12:15 PM
Some more experiments:

I made an array of bitmap_rgb32 and a readpngtobitmap routine and exposed them to lua:
Code

	bitmap_rgb32 bitmaparray[10];
	bitmap_rgb32 * getbitmaparrayitem(int item) { return &(bitmaparray[item]); }
	
	void bitmapalloc(bitmap_rgb32& bitmap, int width, int height){ bitmap.allocate(width,height); }


int readpngtobitmap(bitmap_rgb32& bitmap, std::string filename){

         emu_file file("",OPEN_FLAG_READ);;
        osd_file::error const filerr = file.open(filename);
        if (filerr != osd_file::error::NONE)
                {printf("no file!\n"); return 0;}

        // read the PNG data
        png_info png;
        png_error const result = png.read_file(file);
        file.close();
        if (result != PNGERR_NONE)
        {
                osd_printf_error("%s: Error reading PNG file\n", filename);
                return 0;
        }
   bool hasalpha=false;
   png_error result2 = png.copy_to_bitmap( *((bitmap_argb32 * ) &bitmap), hasalpha);
   
      if (PNGERR_NONE != result2)
                {
                        osd_printf_error("%s: Error copying PNG bitmap to MAME bitmap\n", filename);
                        osd_printf_error("Error result = %d\n", result);
                        return false;
                }

printf("bitmap size %d %d\n",bitmap.width(),bitmap.height());
	return 1;
}

which allows me to load various bitmap fonts as pngs so I can use those fonts:

Opening ubuntu's character map on Noto Mono 22:
[Linked Image from i.imgur.com]

Taking a screencap and figuring out the grid size in Gimp:
[Linked Image from i.imgur.com]

and a test of what the font would look like (scaling the font to 66% to make it fit 80 columns wide):
[Linked Image from i.imgur.com]

Code
manager:machine().lp[1]:readpngtobitmap(manager:machine().lp[1]:getbitmaparrayitem(4),"grid.png")

function drawstringscaleoffset(x,y,str,bitmap,xsize,ysize,rowsize,spacing,scale,offsetx,offsety,offsetsizex,offsetsizey,linegap,rtmar)
xpos = x ypos = y
  for i=1,str:len() do c = str:byte(i) if c>=32 and c<=127 then cpos = c - 32 colpos = cpos % rowsize rowpos = math.floor(cpos/rowsize) lp0:mycopyroz(lp0.m_lp_bitmap, bitmap, math.floor(colpos*xsize+offsetx),math.floor(rowpos*ysize+offsety) , xpos,ypos+792, offsetsizex, offsetsizey, scale, scale)
xpos = xpos + spacing end if xpos > rtmar or c==10 then xpos = x ypos=ypos+offsetsizey+linegap end
end
end
drawstringscaleoffset(20,-792+100,zstring,lp0:getbitmaparrayitem(4),65.75,61,16,12,0.66,25,16,20,35,-14,120*8+20)

and an experiment with a spectrum zx 8x8 font (from DamienG's ZX Origins webpage):

(I couldn't figure out why the png wouldn't load and then I realized it was an 8-bit indexed png. After converting the file to rgb with gimp and exporting it worked fine.)

[Linked Image from i.imgur.com]
103 6,377 Read More
MAME Jump to new posts
Re: Ap2000 signs of life Golden Child 11/28/20 03:10 PM
And why not add the ability to draw lines into our bitmap too:


[Linked Image from i.imgur.com]

Use a drawline routine from the hp9845 driver and make some changes:

Code
//void hp9845ct_base_state::draw_line(unsigned x0 , unsigned y0 , unsigned x1 , unsigned y1)
void drawline(int x0 , int y0 , int x1 , int y1, u32 pixelval)
{
        int dx, dy, sx, sy, x, y, err, e2;

        // draw line, vector generator uses Bresenham's algorithm
        x = x0;
        y = y0;
        dx = abs((int) (x1 - x));
        sx = x < x1 ? 1 : -1;   // actually always 1 because of normalization
        dy = abs((int) (y1 - y));
        sy = y < y1 ? 1 : -1;
        err = (dx > dy ? dx : -dy) / 2;

        for(;;){
//                plot(x, y, BIT(m_gv_line_type_mask, 15));
//               update_line_pattern();

		if (!((x<0) || (x >= m_lp_bitmap->width()) || (y<0) || (y >= m_lp_bitmap->height()))) 
					m_lp_bitmap->pix32(y,x) = pixelval;

                if (x == x1 && y == y1) break;

                e2 = err;
                if (e2 > -dx) {
                        err -= dy;
                        x += sx;
                }
                if (e2 < dy) {
                        err += dx;
                        y += sy;
                }
        }
}



and make some spokes:

Code
function drawcirclespokes(cx,cy,size,step,color) 
for i=0,360,step do 
  manager:machine().lp[1]:drawline(math.floor(cx),math.floor(cy),math.floor(cx+size*math.cos(i/360*2*math.pi)),math.floor(cy+size*math.sin(i/360*2*math.pi)),color) 
  manager:machine().lp[1]:drawline(math.floor(cx+size*math.cos(i/360*2*math.pi)),math.floor(cy+size*math.sin(i/360*2*math.pi)),
math.floor(cx+size*math.cos((i+step)/360*2*math.pi)),math.floor(cy+size*math.sin((i+step)/360*2*math.pi)),color)
 end
end

drawcirclespokes(200,792,150,360/36,0)
drawcirclespokes(0,0,360,360/36,0)
drawcirclespokes(8.5*120,0,360,360/36,0)
drawcirclespokes(9.0*120,792,360,360/36,0)

103 6,377 Read More
MAME Jump to new posts
Re: Ap2000 signs of life Golden Child 11/28/20 02:51 AM
[Linked Image from i.imgur.com]

Experimenting with making a half-inch green bar paper background.

or a non-0xffffff background:

[Linked Image from i.imgur.com]
103 6,377 Read More
MAME Jump to new posts
Re: Ap2000 signs of life Golden Child 11/26/20 04:23 PM
I wanted to be able to scale the bitmap so I could save a scaled version. This would be useful to double the pixels vertically so 120x72 would be 120x144 which would look more "square".

So why not expose a copyrozbitmap function to lua so I could experiment/test with it?
Code
void mycopyroz(bitmap_rgb32& dest, bitmap_rgb32& src, int srcx, int srcy, int destx, int desty, int width, int height, double scalex, double scaley) {
	copyrozbitmap(dest, rectangle(destx,destx+width*scalex-1,desty,desty+height*scaley-1), src, 
	((srcx+0.01) * 1.0 - destx * (1.0/scalex) ) * 0x10000, 
	((srcy+0.01) * 1.0 - desty * (1.0/scaley) ) * 0x10000, 
	0x10000 * (1.0/scalex), 0, 0, 
	0x10000 * (1.0/scaley), false);
	}

and then I can do stuff like:

Code
lp0 = manager:machine().lp[1] 

lp0:clearpage(0,0xffffff)
lp0:clearpage(-1,0x808080)

function drawx(x1,y1,size) 
  local y2 = y1+size-1 local x2 = x1+size-1 
  for i=0,size-1 do 
    lp0:drawpixel(x1+i,y1) lp0:drawpixel(x1+i,y2) lp0:drawpixel(x1,y1+i) lp0:drawpixel(x2,y1+i) lp0:drawpixel(x1+i,y1+i) lp0:drawpixel(x2-i,y1+i) 
  end 
end

drawx(0,0,20)  

lp0:savepagescale(0,2.0,4.0)   -- save page 0 at magnification 2.0 horiz and 4.0 vertically

for i = 0,20 do lp0:mycopyroz(lp0.m_lp_bitmap,lp0.m_lp_bitmap,0,792,70+40*i,792,20,20,2,2) end

xpos = 0 
for i = 1,10 do 
  mag = i size = 20 * mag lp0:mycopyroz(lp0.m_lp_bitmap,lp0.m_lp_bitmap,0,792+0,xpos,792-100,size/mag,size/mag,mag,mag) 
  xpos = xpos + size 
end

lp0:setheadpos(0,20)

lp0:saveall()
[Linked Image from i.imgur.com]
103 6,377 Read More
MAME Jump to new posts
Layouts, parameters, and softlists Mr. Do 11/26/20 07:22 AM
I think of things at the weirdest times sometimes, so I'm writing this down now before I forget again, and apologies to Vas if he's already thought of this and it's on his to do list...

For layouts, we have the below pre-defined parameters today:

https://docs.mamedev.org/techspecs/layout_files.html#pre-defined-parameters

Would it be possible to have a softlist title to be a pre-defined parameter?

Example:
  • The new Vectrex artwork currently has a separate view for each of the twenty-something games we have artwork for now
  • For each view, everything is exactly the same, except the element that defines which overlay to use for each view
  • And the dimensions of each overlay is exactly the same (well, most of them... they WILL be when I fix the last few that are in there)
  • If instead we used a parameter to define the name of the element used for the overlay which matches the software list title, we wouldn't need twenty-something views anymore; just one view, where the view would change when the loaded software changes.


I'm sure there's likely more to it than that, for example, we would need to be able to define something as a fallback default, if the software loaded doesn't match any elements currently defined in the layout.

If you look at Nightvoice's Atari 2600 artwork, he has the system with a cartridge and label. How cool would it be if the cartridge label changed depending on the softlist tile that was loaded.

Anyway... that's my thought for the night... be safe, and Happy Thanksgiving to those here that celebrate the holiday tomorrow.
0 146 Read More
Non-Windows MAME Support Jump to new posts
Re: Question about portability on Mac Llaffer 11/24/20 08:53 PM
Originally Posted by R. Belmont
My understanding is that you can build both architectures on both architectures, but I don't have first-hand experience. I don't think MAME's build system would allow building a universal binary but you could probably glue together the architectures manually with the command line tools.
I guess we'll find out once I buy one and have a chance to do builds with it. smile Thanks.
4 140 Read More
Non-Windows MAME Support Jump to new posts
Re: Question about portability on Mac Llaffer 11/24/20 08:53 PM
Originally Posted by Richard Bannister
Usenet is still a thing?
Yup. I post ROM and CHD updates along with updated binaries every month and others send fill requests that myself and others will assist in filling. Most of the usenet areas got flooded with spam and became worthless but alt.binaries.emulators.mame is still alive and kicking.
4 140 Read More
MAME Jump to new posts
Re: Olympia BOSS rfka01 11/24/20 08:52 PM
Done.
36 9,086 Read More
Non-Windows MAME Support Jump to new posts
Re: Question about portability on Mac Richard Bannister 11/24/20 07:43 PM
Originally Posted by Llaffer
I've been building MAME for years and distributing the Windows and Mac 64-bit builds on Usenet newsgroups

Usenet is still a thing?
4 140 Read More
MAME Jump to new posts
Re: Olympia BOSS aquarius 11/24/20 07:35 PM
I have uploaded harddisk images of the ST-506 with
- CPM 2.2 (boot floppy required)
- Prologue 1.9 (direct booting by hiting enter)

@rfka01: Please upload the Zips to the Mame ftp-repository.

I will receive Circuit diagrams in the next weeks!
36 9,086 Read More
Non-Windows MAME Support Jump to new posts
Re: Question about portability on Mac R. Belmont 11/23/20 08:07 PM
My understanding is that you can build both architectures on both architectures, but I don't have first-hand experience. I don't think MAME's build system would allow building a universal binary but you could probably glue together the architectures manually with the command line tools.
4 140 Read More
Non-Windows MAME Support Jump to new posts
Question about portability on Mac Llaffer 11/23/20 08:00 PM
Sounds like anything built on an Intel Mac will work with the new M1 macs bases on what I've been hearing.

The question is if the reverse is true or not: If I build MAME on an M1 mac and distribute the executable, will it be playable on older macs?

I don't yet own an M1 mac but planning on replacing my Mac Mini with the latest model this spring. I've been building MAME for years and distributing the Windows and Mac 64-bit builds on Usenet newsgroups still and wondering how portable that code is, or if I need to keep building it on my 8-year-old machine that takes over 3 hours to build. smile

Thanks.
4 140 Read More
MAME Jump to new posts
Re: 8bit Apples - Apple I, II, /// and the 16 bit GS Golden Child 11/23/20 05:37 PM
Just for fun, I wanted to see if the Cauzin softstrip "stripper" program would run.

[Linked Image from i.imgur.com]

After messing around with S2.DSK which has the stripper.e program, I nearly gave up since it errored out with "ERROR DURING READ, PROGRAM ABORTED".

Why not try booting from a regular dos disk in flop1 -flop2 S2.DSK and RUN STRIPPER.E,D2 and voila! - it prints something that looks like a strip.

[Linked Image from i.imgur.com]
[Linked Image from i.imgur.com]
[Linked Image from i.imgur.com]

STRIPPER.I is supposed to make strips from an Imagewriter.
STRIPPER.E is the Epson version of the program.

According to a page I read:

"The electronics
consist of an ATMS 7040 8-bit
microprocessor and a custom VLSI
chip that contains the reader logic,
control and communications using
four nested phase-locked-loops and
several hardware and software
servos." which I think means a TMS7040.
608 132,852 Read More
Non-Windows MAME Support Jump to new posts
Re: Dynarecs Yash Anand 11/23/20 08:38 AM
Originally Posted by R. Belmont
I don't understand where you're going with this. I thought your question was because you were writing your own CPS-3 or whatever SH-2 emulator. MAME does know what its doing, I promise.

I was thinking on the lines that instead of speeding up or targeting a single CPU should I try to speed up in general on ARM64? This may not be directly but the spread of the solution might be vast!!
8 239 Read More
Non-Windows MAME Support Jump to new posts
Re: Dynarecs Vas Crabb 11/21/20 12:13 AM
Sure it would. You want to buy me an AArch64 development box and give me some motivation to work on it? Don’t suggest a Pi or cross-compiling for my phone, and given Apple’s increasing hostility to users and developers for the last decade, I’m not really interested in Apple Silicon.
8 239 Read More
Non-Windows MAME Support Jump to new posts
Re: Dynarecs R. Belmont 11/20/20 02:47 PM
I don't understand where you're going with this. I thought your question was because you were writing your own CPS-3 or whatever SH-2 emulator. MAME does know what its doing, I promise.
8 239 Read More
Non-Windows MAME Support Jump to new posts
Re: Dynarecs Yash Anand 11/20/20 01:13 PM
Instead of a DRC per CPU (for the laggards) to arm64 would it make more sense to implement a kind of drcarm64.c (on the lines of drcbex64.c - 64-bit x64 back-end for the universal machine language)?
8 239 Read More
QMC2 Jump to new posts
Global settings doesn't display hamelg 11/19/20 10:20 PM
Hello,
I have an issue with the latest version 0.218 (svn r8336) compiled with QT 5.15.1. All fields in the Global configuration tab (Tools -> Options -> Tab Emulator/Global configuration) are empty.
see the screenshot here : https://app.box.com/s/lqkuon6wxreudhx1152w7wy84zz2eafn
It looks like a bug : if I type something in a empty field and I push the button Revert to stored values, the correct value displays back.
Any ideas ?
0 54 Read More
MAME Jump to new posts
Re: Adding memory to an ISA device. Duke 11/19/20 08:16 AM
1 264 Read More
Non-Windows MAME Support Jump to new posts
Re: Dynarecs Yash Anand 11/19/20 07:19 AM
Originally Posted by balrog
asmjit is working on AArch64 backend support but it's still very much a work in progress:
https://github.com/asmjit/asmjit/tree/aarch64

Discussion takes place in their Gitter.

This is new development! Last when I saw it was only x86.
8 239 Read More
Non-Windows MAME Support Jump to new posts
Re: Dynarecs Yash Anand 11/19/20 07:16 AM
Originally Posted by R. Belmont
I don't know of any specific SH2 to ARM64 dynarecs. If there's any Dreamcast emulators that work on Android that would get you SH4, which is mostly back compatible.

Thanks RB for the info.
Would this be good... just stumbled on it -

https://github.com/devmiyax/yabause
8 239 Read More
Page 1 of 4 1 2 3 4
Who's Online Now
1 members (robcfg), 40 guests, and 2 robots.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics8,836
Posts116,223
Members4,921
Most Online890
Jan 17th, 2020
Powered by UBB.threads™ PHP Forum Software 7.7.5