Thanks to HTML export, it's now possible to run picotron cartridges on a mobile phone.
However, at present the DPAD isn't displayed, and touch operations are replaced by mouse movements, making operation very uncomfortable.
So I wrote the following code to simulate touch operations.
This also led me to notice some strange behavior, but that's another story.
I'd be happy if the picotron itself could support touch operations in the future.
function _init() window{cursor=0} -- Hide the mouse cursor tch = touch.new() -- Initializing the touch structure end function _draw() -- Touch Structure Update. This is necessary to determine touch. tch:check() --[[ *** Wait until it truly becomes the initial state *** Since _init cannot fully initialize, it waits for time to pass in the main program. It seems that the time t() stops in _init, and the mouse position does not change. It seems that time progresses entirely within _draw(_update). This is to prevent unnecessary tap events from occurring because a touch is determined by moving the position of the mouse cursor, and the initial position of the mouse cannot be obtained correctly. There may be a way to avoid this using memory manipulation, etc. This decision statement is clearly a waste of processing. --]] if t() < 0.2 then return end -- Processes when it is determined that a touch has occurred. if tch.tap then splatter(tch.x, tch.y) end end -- [ [size=16][color=#ffaabb] [ Continue Reading.. ] [/color][/size] ](/bbs/?pid=156240#p) |
I've put together a way to use the MISAKI font (https://littlelimit.net/misaki.htm) to display Japanese on picotoron.
Currently, only simple functions have been implemented, so there is still a lot to do before it can be used in practical use.
I can't keep up with the work by myself, so I decided to release it here so that it can be used partially. Basically, I think it's fine if you use it freely. (I would appreciate feedback as well.)
*You will need to know the kuten code to display it, but there is a lot of useful information on the Internet about this.
A virtual computer that runs on a fantasy console. I find this very interesting, so I've made it work for now.
Key assignments
[1][2][3][4]
[q][w][e][r]
[a][s][d][f]
[z][x][c][v]
These can also be changed in key.lua if necessary.
0.0.1b
- Minor bug fixes
- Modified to load ROMs as external pod files by drag and drop (Thank you pancelor!)
- Change display from full screen to windowed (to drop the ROM)
How to create a "rom" pod.
store(filepath, userdata("u8", bytelength, romdata))
Specifically, it looks like this.
store("/logo.pod", userdata("u8", 132, "00e0a22a600c6108d01f7009a239d01fa2487008d01f7004a257d01f7008a266d01f7008a275d01f1228ff00ff003c003c003c003c00ff00ffff00ff0038003f003f003800ff00ff8000e000e00080008000e000e00080f800fc003e003f003b003900f800f8030007000f00bf00fb00f300e30043e505e2008507810180028007e106e7"))
- Operation cannot be confirmed online.
If you want to store floating point values in user data (or POD storage), currently using floats in user data or memmaps will not give good results.
My guess is that using floats in user data will be treated as standard in the future.
This program, f32b.lua, is included, and main.lua contains a simple usage example.
It is very experimental, but may be useful in some way.
It may also be possible to improve it and achieve more.
I don't think f32b.lua is fully optimized, but someone could perfect it.
The usage is as follows (contents of main.lua):
include "f32b.lua" --[[ *** If you store it in user data. f32b.lua uses "u8" for user data. Each floating point value uses 4 bytes. In other words, if you want to save two values, create it as userdata("u8", 8). --]] mydata = userdata("u8", 8) -- To set a value for user data, do this: set_value(mydata, 0, -123.45) set_value(mydata, 1, 100.0) -- To extract it from the user data: print(get_value(mydata, 0)) print(get_value(mydata, 1)) -- [ [size=16][color=#ffaabb] [ Continue Reading.. ] [/color][/size] ](/bbs/?pid=153082#p) |
function sel_layer(name) local m = fetch("map/0.map") local map_no = 0 for i in pairs(m) do if m[i].name == name then map_no = i break end end if map_no != 0 then memmap(m[map_no].bmp, 0x100000) else error("There is no map data named '" .. name .. "'") end end |
I have saved the aforementioned code as a file named 'layer.lua'.
By utilizing this code, we can load specific map layers based on their assigned names.
To illustrate, imagine a map with a layer configuration as depicted in the following image.
include "layer.lua" function _draw() sel_layer("sky") map(0, 0) sel_layer("house") map(0, 0) sel_layer("tree") map(0, 0) end |
I ported my favorite game for Gamebuino.
It's simple but very nice.
The original punkt is here.
Note: This game is not a complete port of the original punkt.