pold500 / gens-rerecording

Automatically exported from code.google.com/p/gens-rerecording
0 stars 0 forks source link

Lua VDP library #64

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Gens could use a library of functions to expose the video processor to Lua
scripting. 
Desired functionality would enable reading and writing to
VRam (64KB of 8x8 tiles, and nametables, not directly addressable by 68K)
Suggest: vdp.readword(address), vdp.writeword(address,data),
vdp.readcell(cell_number), vdp.writecell(cell_number, cell),
vdp.readnametable(scroll_plane), vdp.writenametable(scroll_plane, data)
Functions to manipulate sprites would also be useful, but further research
is required to determine how to implement these.
CRam (128 bytes of 12-bit BGR color entries. 16 entries per line, 4 lines)
Suggest: vdp.readpalette([line]), vdp.writepalette([line, ]palette),
vdp.readcolor(palette_line, index), vdp.readcolor(palette_line, index, color)
VSRam (80 bytes of 16-bit vertical scroll values pertaining to Scrolling
planes A and B either as a whole, or in 16-pixel columns)
suggest: vdp.readscrolldata(), vdp.writescrolldata(data)

Original issue reported on code.google.com by Upth...@gmail.com on 23 Mar 2009 at 11:02

GoogleCodeExporter commented 8 years ago
Also, I think Gens should expose display layer toggling functions, although 
maybe
those belong more in the GUI library? (since while they're VDP-related, they're 
not
part of the "real" state of the VDP)

Original comment by nitsuja-@hotmail.com on 24 Mar 2009 at 4:50

GoogleCodeExporter commented 8 years ago
I knew there was an issue I was forgetting to make. Yes, Lua should have layer
toggling (which I agree should be GUI), and the gui.gdscreenshot() could use a
parameter to specify a transparent color. Between those two additions, all the
necessary tools to make a Lua ghost script (which displays sprites from a 
comparison
movie in their relative locations over the screen of a main movie) would be 
provided.

Original comment by Upth...@gmail.com on 24 Mar 2009 at 4:56

GoogleCodeExporter commented 8 years ago
Although I doubt it would be practical to do a ghost script with a full 
screenshot
per frame, since it's taxing enough just to keep the position data alone. Maybe 
if we
also add a way for the script to take a screenshot of only part of the screen 
so it
can "crop out" the main character, then it would automatically share memory 
with the
other screenshots (assuming the character looks the same pretty often and that
there's some way to exclude other sprites from the screenshot).

Original comment by nitsuja-@hotmail.com on 25 Mar 2009 at 4:43

GoogleCodeExporter commented 8 years ago

Original comment by Upth...@gmail.com on 11 Oct 2009 at 7:36

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
X vdp.readcell(address[,count])
X vdp.writecell(address,data)
X tilelib
X   tile.new()
X   tile.getpixel(tile,x,y)
X   tile.setpixel(tile,x,y,pal_index)
X   tile.rawdata(tile)
X vdp.readpalette([line[,count]])
X vdp.writepalette([line,]data)
X palettelib
X   palette.new()
X   palette.getcolor(palette,index)
X   palette.setcolor(palette,index,color)
X   palette.rawdata(palette)
X memory.writebyterange(address,[length,]data)
+ vdp.getnametable([scroll_plane])
+ vdp.setnametable([scroll_plane,]data)
+ vdp.readscrolldata([scroll_plane,]axis)
+ vdp.writescrolldata([scroll_plane,]axis,data)
+ vdp.readword(address)
+ vdp.writeword(address,data)
+ vdp.getregister(register[,count])
+ vdp.setregister(register,data)

Original comment by Upth...@gmail.com on 9 Nov 2009 at 5:06

GoogleCodeExporter commented 8 years ago
I would also add a function to read the vdp registers.

Original comment by maxime...@gmail.com on 7 May 2012 at 11:59