Giter Site home page Giter Site logo

egordorichev / neko8 Goto Github PK

View Code? Open in Web Editor NEW
110.0 16.0 11.0 55.8 MB

Fantasy console inspired by pico8, tic80 and liko12, written in c++

Home Page: https://egordorichev.itch.io/neko8

Batchfile 0.13% CMake 7.95% C++ 46.80% C 45.12%
fantasy-console pico-8 tic80 liko console pico cpp

neko8's People

Contributors

egordorichev avatar emmachase avatar freeblues avatar paul-arutyunov avatar pi-pi3 avatar pibeplayer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

neko8's Issues

Some non-important stuff.

You could use a typedef for doing bytes.
Like typedef bitset<8> byte which of course will require you to include <bitset.h>

bad argument #18 to 'send' (number or boolean expected, got nil)

Error info:

Air:neko8 admin$ love .
[INFO  01:17:21] main.lua:30: neko 8 v0.0.3 kitten
Error: main.lua:2241: bad argument #18 to 'send' (number or boolean expected, got nil)
stack traceback:
	[C]: in function 'send'
	main.lua:2241: in function 'initPalette'
	main.lua:415: in function 'init'
	main.lua:35: in function 'load'
	main.lua:255: in function <main.lua:245>
	[C]: in function 'xpcall'
Air:neko8 admin$

Love2d version: 0.10.1
Platform: MacOS Sierra 10.12.6

I think maybe your love2d version is different from mine, but you have not say which version in use.

use cmd new with a parameter(not lua or asm), crash

use cmd new with a parameter(not lua or asm), crash

new a

[INFO  12:38:40] main.lua:61: neko 8 
[INFO  12:38:40] src/carts.lua:613: running cart /neko.n8
[ERROR 12:38:46] error.lua:64: Ooops, we have a bad news...
Please, send this error to @egordorichev.
It is in your clipboard now.

editors/code.lua:741: attempt to index local 'c' (a nil value)

error.lua:39: in function '__index'
editors/code.lua:741: in function 'import'
src/carts.lua:117: in function 'import'
src/commands.lua:290: in function <src/commands.lua:287>
/neko.n8:202: in function 'run_command'
/neko.n8:174: in function 'triggerCallback'
main.lua:253: in function <main.lua:148>
main.lua:421: in function <main.lua:390>
[C]: in function 'xpcall'
Air:neko8 admin$

Error when run on iOS, but is normal on Mac

Error when run on iOS, but is normal on Mac
It seemed have not require api.lua when OS is iOS

Error

src/neko8.lua:24: attempt to call global 'initApi' (a nil value)
Traceback

src/neko8.lua:24: in function 'init'
main.lua:58: in function 'load'
main.lua:347: in function <main.lua:337>
[C]: in function 'xpcall'

Some potentially erroneous things in helpers.hpp

In helpers.hpp, you return a pointer allocated on the stack, which is unsafe.

C++ allows you to return a pointer to an array from a local scope, but it is undefined behavior to use the memory pointed to by this pointer outside of its local scope.

Also the result is not allocated, rather it overwrites w1, also of which the amount of allocated memory is unknown. It could have enough space to concatenate w2 to it, but it probably doesn't, which is a memory violation.

Suggested revision:

char* concat(const char* w1, const char* w2){
	char* result = new char[strlen(w1) + strlen(w2)];
	strcpy(result, w1);
	strcat(result, w2);
	return result;
}

And then make sure to delete[] afterwards, so usage would be like:

char* result = concat(strOne, strTwo);
// Do something with result
delete[] result;

Crash when run a demo, then press ESC back to terminal, then run cls

On Mac, do like below:

  1. Run a demo;
  2. Press ESC back to terminal;
  3. Run command cls;
    It will crash
Error: main.lua:1258: attempt to perform arithmetic on local 'c' (a table value)
stack traceback:
	main.lua:1258: in function 'color'
	main.lua:1845: in function 'v'
	[string "/neko.n8"]:195: in function 'run_command'
	[string "/neko.n8"]:166: in function 'triggerCallback'
	main.lua:194: in function <main.lua:105>
	main.lua:310: in function <main.lua:282>
	[C]: in function 'xpcall'
Air:neko8 admin$

On iOS the soft keyboard can not use ESC etc.

On iOS, the default soft keyboard called with love2d can not use the ESC or CTRL key, we can not launch the Editor. So I add some ugly code directly in the function love.touchpressed(), it can launch the Editor on iOS, see below:

function love.touchpressed()
    love.keyboard.setTextInput(true)
    touches = love.touch.getTouches()
    for i, id in ipairs(touches) do
        local x, y = love.touch.getPosition(id)
    
        if x <= 100 and y <= 100 then 
             handled = false
            if neko.cart then 
                neko.cart = nil
            elseif editors.opened then 
                editors.close()
            else 
                editors.open()
            end  
    
        end  
    end  
end

Implement a script language similar to Python/QBasic

Neko8 is very nice but I can not use it because it uses asm?!? is a tool for hobbyists, passionate and nostalgic, asm is out of measure for a human being. I've been hobbies for many years, but I think it's a good idea to implement a scripting language that is very simple, everyone's reach. Especially trying to simplify the APIs, PICO-8, TIC-80 and LIKO-12 have a big defect... they use LUA as a script language, and it is not the best choice in my opinion. Python is perfect! it would be nice to implement it similarly to Godot Game Engine's GDScript, a middle ground between Python and the old QuickBasic makes Neko8 perfect and increases the spread of the project. Many people want to use these PICO-8 Like Fantasy Consoles, but they give up because of the complexity and lack of proper tutorials and documentation.

Neko8 implements the documentation inside it, this is a nice feature.

Your work is extraordinary, you can make Neko8 the absolute reference for fans, students and all those people who want to learn calmly, and make a project in no time without frustration.

Thanks for your nice job.

Formatting

Different contributors and collaborators use different formatting style. I'm mainly talking about spaces and tabs. I believe @egordorichev originally used tabs, so this is a note for everyone: use tabs when developing neko8. If you use vim, you can do :set noet to write tabs instead of 4 (or 2) spaces.
Here's a quote from @egordorichev about formatting.

2 spaces for tab, but use tabs!! If you can, keep your lines shorter then 42 80 chars

So if line doesn't fit, (...) [do this:]

function toLongFunctions(
	arg, arg2
)
	body
end

Multiple crlf

While looking at 1aa3387, I noticed that neko8 is replacing \r\n with \n, I'm not sure if it's worth implementing, but it should be noted that it is valid in windows to have multiple \rs before the \n indicating multiple line breaks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.