• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubypythonwindowsphpgamebathyscaphegui翻訳comegattwitterframeworkbtronvb.net計画中(planning stage)testdomarduinodirectxpreviewerゲームエンジン

伝説のワープロ専用機に強く影響を受けた乾電池で動くオープンソースワープロ専用機の開発を予定


Commit MetaInfo

Révisionccc812e45b48aa93e064c53bee83d1fc2847ba1a (tree)
l'heure2020-05-31 13:42:11
Auteurmegumi_engines <megumi_engines@user...>
Commitermegumi_engines

Message de Log

Adds tmenu (prototype)

Change Summary

Modification

Binary files /dev/null and b/AD401/tmemu/1590777102234.png differ
--- /dev/null
+++ b/AD401/tmemu/ad401.lua
@@ -0,0 +1,59 @@
1+--
2+-- FUJITSU OASYS 30 AD-401/AD-405 Icon Layout / Cursor Move Range.
3+-- Data type: sigle
4+
5+
6+-- 1D:
7+-- [ 1][ 2][ 3]
8+-- [ 4][ 5][ 6][ 7]
9+-- [ 8][ 9][10][11]
10+-- [12][13][14][15]
11+
12+-- 2D:
13+-- [1][2][3] -- [1]
14+-- [1][2][3][4] -- [2]
15+-- [1][2][3][4] -- [3]
16+-- [1][2][3][4] -- [4]
17+
18+
19+ad401 =
20+{
21+ icon = {
22+ { x = 420, y = 54, image = "" }, -- [1][1]
23+ { x = 492, y = 54, image = "" }, -- [1][2]
24+ { x = 564, y = 54, image = "" }, -- [1][3]
25+ { x = 348, y = 122, image = "" }, -- [2][1]
26+ { x = 420, y = 122, image = "" }, -- [2][2]
27+ { x = 492, y = 122, image = "" }, -- [2][3]
28+ { x = 564, y = 122, image = "" }, -- [2][4]
29+ { x = 276, y = 190, image = "" }, -- [3][1]
30+ { x = 348, y = 190, image = "" }, -- [3][2]
31+ { x = 420, y = 190, image = "" }, -- [3][3]
32+ { x = 492, y = 190, image = "" }, -- [3][4]
33+ { x = 204, y = 258, image = "" }, -- [1][1]
34+ { x = 276, y = 258, image = "" }, -- [2][2]
35+ { x = 348, y = 258, image = "" }, -- [3][3]
36+ { x = 420, y = 258, image = "" } -- [4][4]
37+ },
38+
39+ move = {
40+ { left = 4, up = 1, right= 2, down = 5 }, -- 1 : [1][1]
41+ { left = 1, up = 2, right= 3, down = 6 }, -- 2 : [1][2]
42+ { left = 2, up = 3, right= 3, down = 7 }, -- 3 : [1][3]
43+
44+ { left = 8, up = 1, right= 5, down = 9 }, -- 4 : [2][1]
45+ { left = 4, up = 1, right= 6, down = 10 }, -- 5 : [2][2]
46+ { left = 5, up = 2, right= 7, down = 11 }, -- 6 : [2][3]
47+ { left = 6, up = 3, right= 7, down = 11 }, -- 7 : [2][4]
48+
49+ { left = 12, up = 4, right= 9, down = 13 }, -- 8 : [3][1]
50+ { left = 8, up = 4, right= 10, down = 14 }, -- 9 : [3][2]
51+ { left = 9, up = 5, right= 11, down = 15 }, -- 10 : [3][3]
52+ { left = 10, up = 6, right= 7, down = 15 }, -- 11 : [3][4]
53+
54+ { left = 12, up = 8, right= 13, down = 12 }, -- 12 : [4][1]
55+ { left = 12, up = 8, right= 14, down = 13 }, -- 13 : [4][2]
56+ { left = 13, up = 9, right= 15, down = 14 }, -- 14 : [4][3]
57+ { left = 14, up = 10, right= 11, down = 15 } -- 15 : [4][4]
58+ }
59+}
--- /dev/null
+++ b/AD401/tmemu/conf.lua
@@ -0,0 +1,10 @@
1+function love.conf(t)
2+ t.window.width = 640
3+ t.window.height = 400
4+ t.window.title = "Caramel AD405 (Unofficial Port) - Layout Editor (by @develop_writer)"
5+ t.window.icon = nil
6+
7+ t.modules.audio = false
8+ t.modules.sound = false
9+ t.modules.video = false
10+end
--- /dev/null
+++ b/AD401/tmemu/main.lua
@@ -0,0 +1,997 @@
1+--
2+-- Caramel 30 AD-405 -- Inital Menu / Layout Editor (試作版)
3+-- Copyright(C)2019-, @develop_writer / Caramel Factory All Rights Reserved.
4+-- License information : for Non-commercial & Evaluation Purpose & Personal Use Only.
5+
6+-- 将来的に AX401, AD401, 405, LX651 へ対応予定
7+require 'ad401' -- AD401, AD405
8+
9+layout =
10+{
11+ undefined = { },
12+ userdefined = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }
13+}
14+
15+cursor_position =
16+{
17+ undefined = 1,
18+ userdefined = 5,
19+ userdefined_default = 5,
20+ userdefined_initial = 5,
21+ userdefined_restore = 1
22+}
23+
24+
25+BaseIconSize_X = 64
26+BaseIconSize_Y = 62
27+slot_x = 64
28+slot_y = 54
29+
30+
31+isDownLeftCtrl = false
32+
33+
34+
35+function addUserDefinedIconLabel()
36+ for i = 1, #layout.userdefined, 1 do
37+ if (cursor_position.userdefined == i) then
38+ love.graphics.setColor(0.0, 0.0, 0.0)
39+ love.graphics.print("[".. layout.userdefined[i] .. "]",ad401.icon[i].x+4, ad401.icon[i].y+4)
40+ love.graphics.setColor(1.0, 1.0, 1.0)
41+ else
42+ love.graphics.print(" ".. layout.userdefined[i] .. " ",ad401.icon[i].x+4, ad401.icon[i].y+4)
43+ end
44+ end
45+end
46+
47+
48+function DebugInformation()
49+ love.graphics.print(" Undefined Icons:", 0, 0)
50+
51+ if (#layout.undefined == 0) then
52+ love.graphics.print("Empty...", 0, 16)
53+ else
54+ for i = 1, #layout.undefined, 1 do
55+ if (cursor_position.undefined == i) then
56+ love.graphics.print(" -> [".. layout.undefined[i] .. "]",0 ,16 * i)
57+ else
58+ love.graphics.print(" [".. layout.undefined[i] .. "]",0 ,16 * i)
59+ end
60+ end
61+ end
62+end
63+
64+function ConsoleDebugInformation()
65+ print("")
66+ print("Undefined : " .. table.concat(layout.undefined , ", "))
67+ print("User Defined : " .. table.concat(layout.userdefined, ", "))
68+end
69+
70+
71+function dummyIconLayout()
72+ for i = 1, #ad401.icon, 1 do
73+ if (cursor_position.userdefined == i) then
74+ love.graphics.rectangle("fill", ad401.icon[i].x, ad401.icon[i].y, BaseIconSize_X, BaseIconSize_Y)
75+ else
76+ love.graphics.setColor(0.0, 0.0, 0.0, 0.8)
77+ love.graphics.rectangle("fill", ad401.icon[i].x, ad401.icon[i].y, BaseIconSize_X, BaseIconSize_Y)
78+ love.graphics.setColor(1.0, 1.0, 1.0, 0.8)
79+ love.graphics.rectangle("line", ad401.icon[i].x, ad401.icon[i].y, BaseIconSize_X, BaseIconSize_Y)
80+
81+ end
82+ end
83+end
84+
85+
86+function dummyUndefinedSlot()
87+
88+ love.graphics.setColor(0.0, 0.0, 0.0, 0.8)
89+ love.graphics.rectangle("fill", slot_x, slot_y, BaseIconSize_X, BaseIconSize_Y)
90+ love.graphics.setColor(1.0, 1.0, 1.0, 0.8)
91+ love.graphics.rectangle("line", slot_x, slot_y, BaseIconSize_X, BaseIconSize_Y)
92+
93+
94+ if (#layout.undefined == 0) then
95+ love.graphics.print("Empty!", slot_x + 4, slot_y + 4)
96+ else
97+ love.graphics.print("[".. layout.undefined[cursor_position.undefined] .. "]", slot_x + 4, slot_y + 4)
98+ end
99+
100+end
101+
102+
103+function setPreviousUndefinedCursor()
104+ if (cursor_position.undefined == 1) then
105+ cursor_position.undefined = #layout.undefined
106+ else
107+ cursor_position.undefined = cursor_position.undefined - 1
108+ end
109+end
110+
111+function setNextUndefinedCursor()
112+ if (cursor_position.undefined == #layout.undefined) then
113+ cursor_position.undefined = 1
114+ else
115+ cursor_position.undefined = cursor_position.undefined + 1
116+ end
117+end
118+
119+
120+function setUndefinedToUserDefined()
121+ -- Undefined → User Defined
122+ layout.userdefined[cursor_position.userdefined] = layout.undefined[cursor_position.undefined]
123+ table.remove(layout.undefined, cursor_position.undefined)
124+ table.sort (layout.undefined)
125+
126+ if (layout.undefined[cursor_position.undefined] == nil) then -- 末尾除去時の処理
127+-- cursor_position.undefined = #layout.undefined -- 巻き戻し
128+ cursor_position.undefined = 1 -- 先頭へ移動 (AD401/405 実機挙動)
129+ end
130+end
131+
132+function setUserDefinedToUndefined()
133+ -- User Defined → Undefined
134+ table.insert(layout.undefined, layout.userdefined[cursor_position.userdefined])
135+ table.sort (layout.undefined)
136+
137+ -- undefined側のカーソル移動処理 (keyで検索して移動)
138+ for i = 1, #layout.undefined, 1 do
139+ if (layout.undefined[i] == layout.userdefined[cursor_position.userdefined]) then
140+ cursor_position.undefined = i
141+ end
142+ end
143+
144+ layout.userdefined[cursor_position.userdefined] = 0
145+end
146+
147+--------------------------------------------------------------------------------------------------
148+-- State management.
149+
150+state = {
151+ draw = {
152+ },
153+
154+ keypressed = {},
155+ update = {}
156+}
157+
158+
159+--------------------------------------------------------------------------------------------------
160+--
161+
162+--[[
163+state = {
164+ post = { -- Power On Self Test
165+ countup = 55
166+ },
167+
168+ main = {
169+ menu = 1,
170+ layout = 2
171+ },
172+
173+ layout =
174+ {
175+ menu = 10,
176+ positioner = 20,
177+ editor = 30
178+ }
179+}
180+
181+
182+--]]
183+
184+--[[ Botu:
185+state2 = {
186+
187+ layout = {
188+ editor = {
189+ draw = {},
190+ keypressed = {}
191+ },
192+
193+ positioner = {
194+ draw = {},
195+ keypressed = {}
196+ }
197+
198+ }
199+}
200+
201+
202+state2.layout.editor.draw()
203+
204+--]]
205+
206+--[[
207+[current_function]
208+[current_callback]
209+
210+function layout_editor.draw()
211+function layout_positioner.draw()
212+--]]
213+
214+
215+
216+
217+
218+--------------------------------------------------------------------------------------------------
219+-- [ utility ] fx_intermediater
220+-- switching effect for state swicher.
221+
222+function setAppState(to_state)
223+ current_state = "fx_intermediater"
224+end
225+
226+
227+function state.draw.fx_intermediater()
228+ love.graphics.setColor(0.0, 0.0, 0.0, 1.0)
229+ love.graphics.rectangle("fill", 0, 0, 640, 400)
230+ love.graphics.setColor(1.0, 1.0, 1.0, 1.0)
231+end
232+
233+function state.keypressed.fx_intermediater(key)
234+
235+end
236+
237+function state.update.fx_intermediater(dt)
238+
239+end
240+
241+
242+--------------------------------------------------------------------------------------------------
243+-- [ reset ] layout/positioner
244+
245+function layout_reset()
246+-- layout.undefined = { }
247+ layout.userdefined = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }
248+-- cursor_position.undefined = 1
249+-- cursor_position.userdefined = cursor_position.userdefined_initial
250+ ConsoleDebugInformation()
251+end
252+
253+
254+function positoner_reset()
255+ cursor_position.userdefined = cursor_position.userdefined_default
256+end
257+
258+--------------------------------------------------------------------------------------------------
259+-- [ state ]
260+
261+
262+
263+current_state = "initialmenu_root"
264+-- current_state = "auxiliarymenu_root"
265+
266+-- Icon Settings
267+-- current_state = "layout_mainmenu"
268+-- current_state = "layout_positioner"
269+-- current_state = "layout_editor"
270+
271+-- Enhanced states (Unused)
272+current_callback = "draw"
273+
274+
275+--------------------------------------------------------------------------------------------------
276+-- [ initalmenu ] root-screen
277+
278+
279+setupmenu = {
280+ information = {
281+ { name = "複文節変換 ─ 1", x = 0 + 16, y = 0 + 158 + 16, value = true },
282+ { name = "文節変換 ── 2", x = 0 + 16, y = 0 + 158 + 32, value = false },
283+ { name = "通常表示 ── 3", x = 0 + 16, y = 0 + 166 + 48, value = true },
284+ { name = "縦縮小 ─── 4", x = 0 + 16, y = 0 + 166 + 64, value = false },
285+ { name = "横縮小 ─── 5", x = 0 + 16, y = 0 + 166 + 80, value = false },
286+ { name = "縦横縮小 ── 6", x = 0 + 16, y = 0 + 166 + 96, value = false },
287+ { name = "文書フロッピィ ─ 7", x = 0 + 16, y = 0 + 176 + 112, value = true },
288+ { name = "文書RAMカード ─ 8", x = 0 + 16, y = 0 + 176 + 128, value = false }
289+ },
290+
291+ information_ax401 = {
292+ { name = "複文節変換 ─ 1", x = 0, y = 0, value = true },
293+ { name = "文節変換 ── 2", x = 0, y = 0, value = false },
294+ { name = "通常表示 ── 3", x = 0, y = 0, value = true },
295+ { name = "縦縮小 ─── 4", x = 0, y = 0, value = false },
296+ { name = "横縮小 ─── 5", x = 0, y = 0, value = false },
297+ { name = "縦横縮小 ── 6", x = 0, y = 0, value = false },
298+ { name = "横書表示 ── 7", x = 0, y = 0, value = false },
299+ { name = "縦書表示 ── 8", x = 0, y = 0, value = false },
300+ { name = "文書フロッピィ ─ 9", x = 0, y = 0, value = true },
301+ { name = "文書RAMカード ─ 0", x = 0, y = 0, value = false }
302+ }
303+}
304+
305+
306+
307+setupmenu_legacy = {
308+ information = {
309+ { name = "文節変換 ─ 1", x = 0, y = 0, value = true }, -- (OASYS Pocket 3 : 複文節変換)
310+ { name = "複文節変換 ── 2", x = 0, y = 0, value = false }, -- (OASYS Pocket 3 : 文節変換)
311+ { name = "通常表示 ── 3", x = 0, y = 0, value = true },
312+ { name = "縦縮小 ─── 4", x = 0, y = 0, value = false },
313+ { name = "横縮小 ─── 5", x = 0, y = 0, value = false },
314+ { name = "縦横縮小 ── 6", x = 0, y = 0, value = false },
315+ { name = "横書表示 ── 7", x = 0, y = 0, value = false }, -- OASYS 30AX/SX only (without AFⅢ,MS, AD, AD-EX)
316+ { name = "縦書表示 ── 8", x = 0, y = 0, value = false }, -- OASYS 30AX/SX only (without AFⅢ,MS, AD, AD-EX)
317+ { name = "24表示 ─ 9", x = 0, y = 0, value = true }, -- OASYS 30SX only
318+ { name = "16表示 ─ 0", x = 0, y = 0, value = false } -- OASYS 30SX only
319+ }
320+
321+}
322+
323+
324+-- false : ○ (1)
325+-- true : ● (2)
326+function lamp_old(state_lamp)
327+ lamps = { " ○ ", " ● " }
328+ if (state_lamp == true) then
329+ return lamps[2]
330+ else
331+ return lamps[1]
332+ end
333+end
334+
335+-- Shipped from: Luaの数値へのブール値 - コードログ
336+-- https://codeday.me/jp/qa/20190324/471638.html
337+function bool_to_number(value)
338+ return value and 1 or 0
339+end
340+
341+function lamp(value)
342+ lamps = { " ○ ", " ● " }
343+-- return lamps[bool_to_number(value) + 1] -- 1 based (in Ring/Lua)
344+ return lamps[(value and 1 or 0) + 1] -- 1 based (in Ring/Lua)
345+end
346+
347+
348+
349+--
350+-- SetUpMenu box (AD401, AD405 共用)
351+--
352+function dummySetUpBox()
353+-- for AD401/AD405 frame
354+
355+
356+ love.graphics.setColor(0.0, 0.0, 0.0, 1.0)
357+ love.graphics.rectangle("fill", 14, 168, 122, 38)
358+ love.graphics.rectangle("fill", 14, 209, 122, 72)
359+ love.graphics.rectangle("fill", 14, 284, 122, 38)
360+
361+ love.graphics.setColor(1.0, 1.0, 1.0, 1.0)
362+ love.graphics.rectangle("line", 14, 168, 122, 38)
363+ love.graphics.rectangle("line", 14, 209, 122, 72)
364+ love.graphics.rectangle("line", 14, 284, 122, 38)
365+
366+ for i = 1, #setupmenu.information, 1 do
367+ love.graphics.print( lamp(setupmenu.information[i].value) .. setupmenu.information[i].name,
368+ setupmenu.information[i].x, setupmenu.information[i].y)
369+ end
370+end
371+
372+
373+--
374+-- SetUpMenu box (AX401用)
375+--
376+function dummySetUpBox2()
377+-- for AD401/AD405 frame
378+
379+ love.graphics.setColor(0.0, 0.0, 0.0, 1.0)
380+ love.graphics.rectangle("line", 14, 125, 122, 38)
381+ love.graphics.rectangle("line", 14, 166, 122, 72)
382+ love.graphics.rectangle("line", 14, 242, 122, 38)
383+ love.graphics.rectangle("line", 14, 284, 122, 38)
384+
385+ love.graphics.setColor(1.0, 1.0, 1.0, 1.0)
386+ love.graphics.rectangle("line", 14, 125, 122, 38)
387+ love.graphics.rectangle("line", 14, 166, 122, 72)
388+ love.graphics.rectangle("line", 14, 242, 122, 38)
389+ love.graphics.rectangle("line", 14, 284, 122, 38)
390+
391+
392+ for i = 1, #setupmenu.information_ax401, 1 do
393+ love.graphics.print( lamp(setupmenu.information_ax401[i].value) .. setupmenu.information_ax401[i].name,
394+ setupmenu.information[i].x, setupmenu.information[i].y)
395+ end
396+
397+end
398+
399+function dummyGuideBar()
400+ love.graphics.setColor(0.0, 0.0, 0.0, 1.0)
401+ love.graphics.rectangle("fill", 14, 336, 613, 24)
402+ love.graphics.setColor(1.0, 1.0, 1.0, 1.0)
403+ love.graphics.rectangle("line", 14, 336, 613, 24)
404+ love.graphics.rectangle("fill", 0, 368, 640, 32)
405+end
406+
407+
408+function state.draw.initialmenu_root()
409+
410+ dummySetUpBox()
411+ dummyGuideBar()
412+ dummyIconLayout()
413+ addUserDefinedIconLabel()
414+end
415+
416+function state.keypressed.initialmenu_root(key)
417+ if (key == 'left' ) then
418+ cursor_position.userdefined = ad401.move[cursor_position.userdefined].left
419+ end
420+
421+ if (key == 'up' ) then
422+ cursor_position.userdefined = ad401.move[cursor_position.userdefined].up
423+ end
424+
425+ if (key == 'right') then
426+ cursor_position.userdefined = ad401.move[cursor_position.userdefined].right
427+ end
428+
429+ if (key == 'down' ) then
430+ cursor_position.userdefined = ad401.move[cursor_position.userdefined].down
431+ end
432+
433+ if (key == '1') then
434+ setupmenu.information[1].value = true
435+ setupmenu.information[2].value = false
436+ end
437+
438+ if (key == '2') then
439+ setupmenu.information[1].value = false
440+ setupmenu.information[2].value = true
441+ end
442+
443+ if (key == '3') then
444+ setupmenu.information[3].value = true
445+ setupmenu.information[4].value = false
446+ setupmenu.information[5].value = false
447+ setupmenu.information[6].value = false
448+ end
449+
450+ if (key == '4') then
451+ setupmenu.information[3].value = false
452+ setupmenu.information[4].value = true
453+ setupmenu.information[5].value = false
454+ setupmenu.information[6].value = false
455+ end
456+
457+ if (key == '5') then
458+ setupmenu.information[3].value = false
459+ setupmenu.information[4].value = false
460+ setupmenu.information[5].value = true
461+ setupmenu.information[6].value = false
462+ end
463+
464+ if (key == '6') then
465+ setupmenu.information[3].value = false
466+ setupmenu.information[4].value = false
467+ setupmenu.information[5].value = false
468+ setupmenu.information[6].value = true
469+ end
470+
471+ if (key == '7') then
472+ setupmenu.information[7].value = true
473+ setupmenu.information[8].value = false
474+ end
475+
476+ if (key == '8') then
477+ setupmenu.information[7].value = false
478+ setupmenu.information[8].value = true
479+ end
480+
481+ if (key == 'f6') then
482+ cursor_position.userdefined = cursor_position.userdefined_initial -- reset cursor position by userdefined value.
483+ current_state = "layout_mainmenu"
484+ end
485+
486+ if (key == 'return') then
487+ if (layout.userdefined[cursor_position.userdefined] == 7) then
488+ cursor_position.userdefined = cursor_position.userdefined_initial -- reset cursor position by userdefined value.
489+ current_state = "auxiliarymenu_root"
490+ end
491+ end
492+
493+end
494+
495+--------------------------------------------------------------------------------------------------
496+-- [ layout ] mainmenu
497+
498+local frame_x = 18
499+local frame_y = 17
500+local framesize_x = 160 + 12
501+local framesize_y = 64 - 10
502+local frame_offset = 3
503+
504+local layout_menu_cursor = 1
505+local layout_menu_level = 1
506+local layout_menu_modeselect = 1
507+
508+local layout_menu_level_signature = { top = 1, sub = 3 }
509+local layout_menu_modeselect_signature = { positioner = 1, layout_editor = 2 }
510+
511+
512+local layout_menudata =
513+{
514+ { caption = "◇ アイコン初期表示位置", x = frame_x + 16, y = frame_y + 13 }, -- Top level
515+ { caption = "◇ アイコンレイアウト" , x = frame_x + 16, y = frame_y + 16 + 13 }, -- Top level
516+ { caption = "◇ 初期状態に戻す" , x = frame_x + 16, y = frame_y + 13 }, -- Sub level
517+ { caption = "◇ 変更する" , x = frame_x + 16, y = frame_y + 16 + 13 } -- Sub level
518+}
519+
520+
521+function back_layout_mainmenu()
522+ layout_menu_cursor = 1
523+ layout_menu_level = 1
524+ layout_menu_modeselect = 1
525+ current_state = "layout_mainmenu"
526+end
527+
528+
529+function back_initialmenu()
530+ layout_menu_cursor = 1
531+ layout_menu_level = 1
532+ layout_menu_modeselect = 1
533+ current_state = "initialmenu_root"
534+end
535+
536+
537+function state.draw.layout_mainmenu()
538+ dummySetUpBox()
539+ dummyGuideBar()
540+
541+ love.graphics.setColor(0.0, 0.0, 0.0, 1.0)
542+ love.graphics.rectangle("fill", frame_x , frame_y , framesize_x + frame_offset, framesize_y + frame_offset)
543+ love.graphics.rectangle("fill", frame_x + frame_offset, frame_y + frame_offset, framesize_x - frame_offset, framesize_y - frame_offset)
544+
545+ love.graphics.setColor(1.0, 1.0, 1.0, 1.0)
546+ love.graphics.rectangle("line", frame_x , frame_y , framesize_x + frame_offset, framesize_y + frame_offset)
547+ love.graphics.rectangle("line", frame_x + frame_offset, frame_y + frame_offset, framesize_x - frame_offset, framesize_y - frame_offset)
548+
549+ for i = layout_menu_level, layout_menu_level + 1, 1 do
550+ love.graphics.print(layout_menudata[i].caption, layout_menudata[i].x, layout_menudata[i].y)
551+ end
552+
553+ love.graphics.print("◆" , layout_menudata[layout_menu_cursor].x, layout_menudata[layout_menu_cursor].y)
554+
555+ dummyIconLayout()
556+ addUserDefinedIconLabel()
557+end
558+
559+function state.keypressed.layout_mainmenu(key)
560+ if (key == 'up' ) then
561+ layout_menu_cursor = 1
562+ end
563+
564+ if (key == 'down' ) then
565+ layout_menu_cursor = 2
566+ end
567+
568+
569+---
570+ if (key == 'return') then
571+ if (layout_menu_level == layout_menu_level_signature.top) then
572+ if (layout_menu_cursor == 1) then
573+ layout_menu_level = layout_menu_level_signature.sub
574+ layout_menu_modeselect = layout_menu_modeselect_signature.positioner
575+ elseif (layout_menu_cursor == 2) then
576+ layout_menu_level = layout_menu_level_signature.sub
577+ layout_menu_modeselect = layout_menu_modeselect_signature.layout_editor
578+ end
579+
580+ elseif (layout_menu_level == layout_menu_level_signature.sub) then
581+
582+ if (layout_menu_cursor == 1) then
583+ if (layout_menu_modeselect == layout_menu_modeselect_signature.positioner) then
584+ positoner_reset()
585+ back_layout_mainmenu()
586+
587+ elseif (layout_menu_modeselect == layout_menu_modeselect_signature.layout_editor) then
588+ layout_reset()
589+ back_layout_mainmenu()
590+ end
591+
592+ elseif (layout_menu_cursor == 2) then
593+
594+ if (layout_menu_modeselect == layout_menu_modeselect_signature.positioner) then
595+ cursor_position.userdefined_restore = cursor_position.userdefined
596+ current_state = "layout_positioner"
597+
598+ elseif (layout_menu_modeselect == layout_menu_modeselect_signature.layout_editor) then
599+ cursor_position.userdefined_restore = cursor_position.userdefined
600+ current_state = "layout_editor"
601+ end
602+ end
603+ end
604+ layout_menu_cursor = 1
605+ end
606+
607+
608+-- if (key == 'delete') then
609+-- print("now restarting...")
610+-- love.event.quit("restart")
611+-- end
612+
613+ if (key == 'escape') then
614+ if (layout_menu_level == layout_menu_level_signature.top) then
615+ back_initialmenu()
616+ elseif (layout_menu_level == layout_menu_level_signature.sub) then
617+ back_layout_mainmenu()
618+ end
619+ end
620+end
621+
622+
623+--------------------------------------------------------------------------------------------------
624+-- [ layout ] positioner
625+
626+function state.draw.layout_positioner()
627+
628+ dummySetUpBox()
629+ dummyGuideBar()
630+
631+ dummyIconLayout()
632+ love.graphics.print(" [ Icon positioner mode ] User defined Icons ", 16, 0)
633+ addUserDefinedIconLabel()
634+end
635+
636+function state.keypressed.layout_positioner(key)
637+ if (key == 'left' ) then
638+ cursor_position.userdefined = ad401.move[cursor_position.userdefined].left
639+ end
640+
641+ if (key == 'up' ) then
642+ cursor_position.userdefined = ad401.move[cursor_position.userdefined].up
643+ end
644+
645+ if (key == 'right') then
646+ cursor_position.userdefined = ad401.move[cursor_position.userdefined].right
647+ end
648+
649+ if (key == 'down' ) then
650+ cursor_position.userdefined = ad401.move[cursor_position.userdefined].down
651+ end
652+
653+ if (key == 'return') then
654+ cursor_position.userdefined_initial = cursor_position.userdefined
655+ back_layout_mainmenu()
656+ end
657+
658+ if (key == 'escape') then
659+ cursor_position.userdefined = cursor_position.userdefined_restore
660+ back_layout_mainmenu()
661+ end
662+end
663+
664+
665+--------------------------------------------------------------------------------------------------
666+-- [ layout ] editor
667+
668+function state.draw.layout_editor()
669+ love.graphics.print(" User defined Icons:", 312, 0)
670+
671+ dummySetUpBox()
672+ dummyGuideBar()
673+ dummyIconLayout()
674+ addUserDefinedIconLabel()
675+ DebugInformation()
676+ dummyUndefinedSlot()
677+end
678+
679+
680+function state.keypressed.layout_editor(key)
681+ if (key == 'w' ) then
682+ setPreviousUndefinedCursor()
683+ end
684+
685+ if (key == 'a' ) then
686+ end
687+
688+ if (key == 's' ) then
689+ setNextUndefinedCursor()
690+ end
691+
692+ if (key == 'd' ) then
693+ end
694+
695+
696+--[[
697+ if (key == 'up' ) then
698+ if (cursor_position.userdefined == 1) then
699+ cursor_position.userdefined = #layout.userdefined
700+ else
701+ cursor_position.userdefined = cursor_position.userdefined - 1
702+ end
703+ end
704+
705+ if (key == 'down' ) then
706+ if (cursor_position.userdefined == #layout.userdefined) then
707+ cursor_position.userdefined = 1
708+ else
709+ cursor_position.userdefined = cursor_position.userdefined + 1
710+ end
711+ end
712+--]]
713+
714+ if (key == 'left' ) then
715+ cursor_position.userdefined = ad401.move[cursor_position.userdefined].left
716+ end
717+
718+ if (key == 'up' ) then
719+ if (isDownLeftCtrl == true) then
720+ setNextUndefinedCursor() -- 反転カーソル (Shift+[↑]で進む)
721+ else
722+ cursor_position.userdefined = ad401.move[cursor_position.userdefined].up
723+ end
724+ end
725+
726+ if (key == 'right') then
727+ cursor_position.userdefined = ad401.move[cursor_position.userdefined].right
728+ end
729+
730+ if (key == 'down' ) then
731+ if (isDownLeftCtrl == true) then
732+ setPreviousUndefinedCursor() -- 反転カーソル (Shift+[↓]で戻る)
733+ else
734+ cursor_position.userdefined = ad401.move[cursor_position.userdefined].down
735+ end
736+ end
737+
738+ if (key == 'return') then
739+ if (layout.userdefined[cursor_position.userdefined] == 0) then
740+ setUndefinedToUserDefined()
741+ else
742+ setUserDefinedToUndefined()
743+ end
744+
745+ ConsoleDebugInformation()
746+ end
747+
748+ if (key == 'escape') then
749+ if (#layout.undefined == 0) then
750+-- love.graphics.print("Empty...", 0, 16)
751+ cursor_position.userdefined = cursor_position.userdefined_restore
752+ back_layout_mainmenu()
753+ else
754+ love.graphics.print("Not Empty...", 0, 16)
755+ end
756+ end
757+end
758+
759+
760+--------------------------------------------------------------------------------------------------
761+-- [ auxiliary ] root-menu
762+
763+----------------------------------------------------
764+-- 補助メニュー (for OASYS 30-AD405)
765+----------------------------------------------------
766+
767+-- auxiliary_topmenu =
768+
769+page_state = "firstpage"
770+auxmenu_cursorPos = 1
771+menuAux = {}
772+
773+
774+-- ///// 後程連想配列にします。
775+DocumentDrive = 1
776+InternalDrive = 1
777+FloppyDrive = 2
778+SRAMDrive = 3
779+
780+menuDriveSelectK = {
781+ "1",
782+ "2",
783+ "3",
784+}
785+-- /////
786+
787+menuAux.firstpage =
788+{
789+ "◇ 文書メモリ(→フロッピィ/文書RAM カード)書込",
790+ "◇ 文書メモリ(←フロッピィ/文書RAM カード)読出",
791+ "◇ 文書メモリクリア",
792+ "◇ 文書メモリ領域表示",
793+ "",
794+ "◇ 文字パターン登録/複写",
795+ "◇ 文字パターン(→フロッピィ/文書RAM カード)書込",
796+ "◇ 文字パターン(←フロッピィ/文書RAM カード)読出",
797+ "◇ Lite文字パターン読出",
798+ "",
799+ "◇ 辞書(→フロッピィ)書込",
800+ "◇ 辞書(←フロッピィ)読出",
801+ "◇ 登録単語複写",
802+ "◇ 辞書表示",
803+ "",
804+ "◇ システム環境設定            ⇩【次項】"
805+}
806+
807+----------------------------------------------------
808+menuAux.lastpage =
809+{
810+ "◇ 文書削除                ⇧【前項】",
811+ "◇ 文書フロッピィ/文書RAM カード作成",
812+ "◇ 文書フロッピィ/文書RAM カード名変更",
813+ "◇ フロッピィ複写",
814+ "◇ 文書複写",
815+ "◇ 文書番号管理",
816+ "◇ 文書一覧表印刷",
817+ "◇ 書込保護設定/解除",
818+ "◇ 全文書修復",
819+ "◇ Liteフロッピィ文書交換",
820+ "◇ MS-DOSファイル交換",
821+ "◇ MS-DOSフロッピィ作成",
822+ "◇ 日時設定",
823+ "◇ 練習",
824+ "◇ テスト"
825+}
826+
827+--
828+-- カーソルの反転
829+-- 本来ならば、指定領域を取り込んで xor なり GLSL で処理したほうが汎用性の面でいいはずなのだが。
830+-- CUI プログラミングの癖が抜けないへっぽこ実装です。
831+function drawCurrentCursor2(x, y)
832+ love.graphics.rectangle("fill", x, y - 1, 16, 16 )
833+ love.graphics.setColor(0.0, 0.0, 0.0)
834+ love.graphics.print("◇ ", x, y);
835+ love.graphics.setColor(1.0, 1.0, 1.0)
836+end
837+
838+
839+function setInternalDrive(k)
840+ if k == "1" then
841+ DocumentDrive = InternalDrive
842+ end
843+end
844+
845+function setDriveFloppy(k)
846+ if k == "2" then
847+ DocumentDrive = FloppyDrive
848+ end
849+end
850+
851+function drawAuxMenuList()
852+
853+ x = 148 -- メニュー項目描画始点
854+ y = 56 -- メニュー項目描画始点
855+
856+ for i = 1, #menuAux[page_state], 1 do
857+ love.graphics.print(menuAux[page_state][i], x, y)
858+
859+ if i == auxmenu_cursorPos then
860+ drawCurrentCursor2(x, y)
861+ end
862+
863+ y = y + 16
864+ end
865+end
866+
867+function state.draw.auxiliarymenu_root()
868+-- love.graphics.setFont(auxmenuFont);
869+ drawAuxMenuList()
870+-- love.graphics.setFont(mainFont);
871+
872+ love.graphics.print(" " .. menuDriveSelectK[DocumentDrive] .. "(1:文書フロッピィ,2:文書RAM カード)" , 128, 370)
873+end
874+
875+
876+function state.keypressed.auxiliarymenu_root(key)
877+
878+ if (key == "escape") then
879+ page_state = "firstpage"
880+ auxmenu_cursorPos = 1
881+-- cursor_position.userdefined = cursor_position.userdefined_restore
882+ back_initialmenu()
883+ end
884+
885+ if (key == "pageup") then
886+ auxmenu_cursorPos = 1
887+ page_state = "firstpage"
888+ end
889+
890+ if (key == "pagedown") then
891+ auxmenu_cursorPos = 1
892+ page_state = "lastpage"
893+ end
894+
895+
896+--
897+-- コメントアウトで現在カーソル位置を保持したまま次のページへ
898+--
899+ if key == "up" then
900+ if auxmenu_cursorPos == 1 then
901+-- auxmenu_cursorPos = #menuAux[page_state]
902+ else
903+ auxmenu_cursorPos = auxmenu_cursorPos - 1
904+
905+-- 空アイテム対策
906+ if (menuAux[page_state][auxmenu_cursorPos] == "") then
907+ auxmenu_cursorPos = auxmenu_cursorPos - 1
908+ end
909+
910+ end
911+ end
912+
913+--
914+-- コメントアウトで現在カーソル位置を保持したまま前のページへ
915+--
916+
917+ if key == "down" then
918+ if auxmenu_cursorPos == #menuAux[page_state] then
919+-- auxmenu_cursorPos = 1
920+ else
921+ auxmenu_cursorPos = auxmenu_cursorPos + 1
922+
923+-- 空アイテム対策
924+ if (menuAux[page_state][auxmenu_cursorPos] == "") then
925+ auxmenu_cursorPos = auxmenu_cursorPos + 1
926+ end
927+ end
928+ end
929+
930+-- ドライブセレクタ
931+ setInternalDrive(key)
932+ setDriveFloppy(key)
933+
934+ if key == "3" then
935+ DocumentDrive = SRAMDrive
936+ end
937+end
938+
939+
940+--------------------------------------------------------------------------------------------------
941+--- NVRAM loader/saver
942+--- Since 2020/03/25
943+
944+nvram = {}
945+
946+
947+function nvram.load()
948+-- info = love.filesystem.getInfo("oasys.nvram")
949+-- love.filesystem.lines
950+end
951+
952+
953+
954+--------------------------------------------------------------------------------------------------
955+function love.load()
956+ love.graphics.setLineStyle('rough') -- 線描時のアンチエイリアシング無効化
957+ wallpaper = love.graphics.newImage("1590777102234.png")
958+-- aux_wallpaper = love.graphics.newImage("top_first.png")
959+
960+ SystemFontFile = "ipaexg.ttf"
961+-- SystemFontSize = 11.5
962+ auxmenuFontSize = 12
963+ mainFont = love.graphics.newFont(SystemFontFile, SystemFontSize);
964+ auxmenuFont = love.graphics.newFont(SystemFontFile, auxmenuFontSize);
965+ love.graphics.setFont(mainFont);
966+
967+ nvram.load()
968+
969+end
970+
971+
972+function love.draw()
973+ if (current_state == "auxiliarymenu_root") then
974+ love.graphics.draw( aux_wallpaper, 0, 0)
975+ else
976+-- love.graphics.draw( wallpaper, 0, 0)
977+ end
978+
979+ -- NG: state[current_callback]layout_editor()
980+
981+ --- OK:
982+ -- state[current_callback][current_state]()
983+ state.draw[current_state]()
984+ -- state.draw.layout_editor()
985+
986+end
987+
988+function love.keypressed(key)
989+ state.keypressed[current_state](key)
990+end
991+
992+
993+function love.update()
994+ isDownLeftCtrl = love.keyboard.isDown('lctrl')
995+ love.timer.sleep(0.1) -- waits.
996+end
997+
--- /dev/null
+++ b/AD401/tmemu/readme.txt
@@ -0,0 +1,12 @@
1+去年あたりから開発が呈している試作コードです。
2+防犯上の問題、および開発中につき使用方法は公開しません。
3+動いても....ちょっとだけよ...のお飾りですからね。
4+
5+相応の能力と忍耐力があれば、実機完全移植は可能です (もちろん私的利用範囲を超えないこと)。
6+
7+
8+
9+Thridparty Software/Assets
10+(整理中)
11+
12+
--- /dev/null
+++ b/AD401/tmemu/run64.bat
@@ -0,0 +1,2 @@
1+"c:\Program Files\LOVE\lovec.exe" .
2+pause
\ No newline at end of file
--- a/readme.txt
+++ b/readme.txt
@@ -1,5 +1,71 @@
1-Caramel Bento - 日本語モバイルワープロ専用機
1+Caramel Bento - 日本語モバイルワープロ専用機 (開発中)
22
3+使用許諾条件: 評価専用ライセンス
4+・個人かつ非営利目的でのみ使用可能です。
5+・ソースコードの販売・改変・再配布は禁止します。
6+・無保証です。使用した結果、発生した損害は種類を問わず利用者が負ってくださいです。
7+ 開発者は一切の責任を負いません。
38
4-(執筆中)
9+(以下は執筆中です。未確定の記述があります)
10+
11+
12+概要
13+AD401/405 の代替品として個人的に開発している日本語モバイルワープロ専用機のソフトウェアです。
14+クリーンルーム方式による丁寧な解析を行い、できるかぎり忠実に移植を行いました。
15+また、メニュー以外のベースシステムをAP系にすることで大容量文書ディスクへの対応もしています。
16+
17+現在でも OASYS Pocket 3 の次くらいに根強い支持を誇る名機ではありますが
18+設計上の問題を抱えており、かろうじて動いてるものも多いです。
19+
20+警告
21+当プロジェクトの開発者は株式会社富士通、および関連子企業・協力企業とは無関係です。
22+双方の迷惑となりますので、ワープロ専用機の復刻を望むなら問い合わせは絶対にしないださい。
23+当プロジェクトの開発者が復刻可能だからといって、原作者が復刻可能ではないことも多いです。
24+ご理解いただけないのでしたら、本プロジェクトの成果物の使用は固くお断りさせていただきます。
25+
26+
27+使いかた
28+・実機と同じ規格のアセットを用意してください。現在、互換品は用意されていません。
29+
30+
31+
32+実装について一部機能は LOVE2D を、メインとなる基幹機能は Nim で書かれています。
33+初期メニューなどはカスタマイズ可能です。
34+
35+
36+
37+モジュールについて (予定)
38+
39+post - ハードウェア自己診断プログラムです。
40+nvram - 不揮発メモリ関連処理です。実装には JSON を採用しています。
41+tmenu - 初期メニュープログラムです。
42+auxmenu - 補助メニュープログラムです。
43+addon/calc - アドオンの電卓プログラムです。
44+addon/calendar - アドオンのカレンダプログラムです。
45+
46+
47+
48+
49+仮想ハードウェア仕様
50+
51+Generic Series name: Caramel Bento
52+Generic System name: AD-505 Super
53+Generic Formfactor : Laptop
54+
55+Hardware Unique D : Cameo Kanda
56+Japanese Hardaware A.K.A : ---
57+
58+CPU : ARM-based CPU (Raspberry pi zero-based)
59+ : AUX-Board : Levis & Lee
60+
61+Storages : System/Intenal mSATA (Deck1)
62+ : microSDXC (Deck2)
63+ : USB 3.0 (Deck3)
64+ : WebDAV
65+
66+Peripherals : LPT1
67+ : WLAN
68+ : Buletooth
69+ : HDMI Port
70+ : OASYS 30/100 Series Keyboard Port (Option)
571