Showing preview only (1,797K chars total). Download the full file or copy to clipboard to get everything.
Repository: timoinutilis/lowres-nx
Branch: master
Commit: 35adc1a215e9
Files: 192
Total size: 1.7 MB
Directory structure:
gitextract_m0nciqnm/
├── .gitignore
├── .gitlab-ci.yml
├── LICENSE
├── README.md
├── assets/
│ ├── NX App Design.pxm
│ ├── NX Logo.sketch
│ ├── characters.pxm
│ ├── fonts.pxm
│ ├── old/
│ │ ├── App Icon.sketch
│ │ ├── background_designer_sketch.pxm
│ │ ├── character_designer_sketch.pxm
│ │ ├── console_pixel.pxm
│ │ ├── logo.pxm
│ │ └── mobile_app_icon.pxm
│ └── overlay.nx
├── core/
│ ├── accessories/
│ │ ├── disk_drive.c
│ │ └── disk_drive.h
│ ├── boot_intro.c
│ ├── boot_intro.h
│ ├── core.c
│ ├── core.h
│ ├── core_delegate.c
│ ├── core_delegate.h
│ ├── core_stats.c
│ ├── core_stats.h
│ ├── datamanager/
│ │ ├── data_manager.c
│ │ └── data_manager.h
│ ├── interpreter/
│ │ ├── charsets.c
│ │ ├── charsets.h
│ │ ├── cmd_audio.c
│ │ ├── cmd_audio.h
│ │ ├── cmd_background.c
│ │ ├── cmd_background.h
│ │ ├── cmd_control.c
│ │ ├── cmd_control.h
│ │ ├── cmd_data.c
│ │ ├── cmd_data.h
│ │ ├── cmd_files.c
│ │ ├── cmd_files.h
│ │ ├── cmd_io.c
│ │ ├── cmd_io.h
│ │ ├── cmd_maths.c
│ │ ├── cmd_maths.h
│ │ ├── cmd_memory.c
│ │ ├── cmd_memory.h
│ │ ├── cmd_screen.c
│ │ ├── cmd_screen.h
│ │ ├── cmd_sprites.c
│ │ ├── cmd_sprites.h
│ │ ├── cmd_strings.c
│ │ ├── cmd_strings.h
│ │ ├── cmd_subs.c
│ │ ├── cmd_subs.h
│ │ ├── cmd_text.c
│ │ ├── cmd_text.h
│ │ ├── cmd_variables.c
│ │ ├── cmd_variables.h
│ │ ├── data.c
│ │ ├── data.h
│ │ ├── error.c
│ │ ├── error.h
│ │ ├── interpreter.c
│ │ ├── interpreter.h
│ │ ├── interpreter_config.h
│ │ ├── interpreter_utils.c
│ │ ├── interpreter_utils.h
│ │ ├── labels.c
│ │ ├── labels.h
│ │ ├── rcstring.c
│ │ ├── rcstring.h
│ │ ├── string_utils.c
│ │ ├── string_utils.h
│ │ ├── token.c
│ │ ├── token.h
│ │ ├── tokenizer.c
│ │ ├── tokenizer.h
│ │ ├── value.c
│ │ ├── value.h
│ │ ├── variables.c
│ │ └── variables.h
│ ├── libraries/
│ │ ├── audio_lib.c
│ │ ├── audio_lib.h
│ │ ├── default_characters.c
│ │ ├── default_characters.h
│ │ ├── sprites_lib.c
│ │ ├── sprites_lib.h
│ │ ├── startup_sequence.c
│ │ ├── startup_sequence.h
│ │ ├── text_lib.c
│ │ └── text_lib.h
│ ├── machine/
│ │ ├── audio_chip.c
│ │ ├── audio_chip.h
│ │ ├── io_chip.h
│ │ ├── machine.c
│ │ ├── machine.h
│ │ ├── video_chip.c
│ │ └── video_chip.h
│ └── overlay/
│ ├── overlay.c
│ ├── overlay.h
│ ├── overlay_data.c
│ └── overlay_data.h
├── docs/
│ ├── license.txt
│ ├── manual.html
│ └── readme.txt
├── extras/
│ └── LowRes NX.sublime-syntax
├── libretro/
│ ├── libretro.h
│ ├── libretro_main.c
│ └── libretro_main.h
├── platform/
│ ├── GameShell/
│ │ ├── README.md
│ │ └── home/
│ │ └── cpi/
│ │ ├── apps/
│ │ │ └── Menu/
│ │ │ └── 55_LowRes NX/
│ │ │ └── action.config
│ │ └── games/
│ │ └── LowResNX/
│ │ ├── LowRes Galaxy 2 (1.5).nx
│ │ └── Star Scroller 1.2.nx
│ ├── LibRetro/
│ │ ├── Makefile
│ │ ├── Makefile.common
│ │ ├── jni/
│ │ │ ├── Android.mk
│ │ │ └── Application.mk
│ │ └── link.T
│ ├── Linux/
│ │ ├── README.md
│ │ └── makefile
│ ├── Windows/
│ │ ├── LowRes NX Win/
│ │ │ ├── LowRes NX Win.rc
│ │ │ ├── LowRes NX Win.vcxproj
│ │ │ ├── LowRes NX Win.vcxproj.filters
│ │ │ ├── resource.h
│ │ │ └── resource1.h
│ │ └── LowRes NX Win.sln
│ ├── iOS/
│ │ ├── LowRes NX iOS/
│ │ │ ├── AppDelegate.swift
│ │ │ ├── Assets.xcassets/
│ │ │ │ ├── AppIcon.appiconset/
│ │ │ │ │ └── Contents.json
│ │ │ │ └── Contents.json
│ │ │ ├── Base.lproj/
│ │ │ │ ├── LaunchScreen.storyboard
│ │ │ │ └── Main.storyboard
│ │ │ ├── CoreWrapper.swift
│ │ │ ├── Info.plist
│ │ │ ├── LowResNX-Bridging-Header.h
│ │ │ ├── LowResNXView.swift
│ │ │ └── ViewController.swift
│ │ ├── LowRes NX iOS.xcodeproj/
│ │ │ ├── project.pbxproj
│ │ │ └── project.xcworkspace/
│ │ │ ├── contents.xcworkspacedata
│ │ │ └── xcshareddata/
│ │ │ └── IDEWorkspaceChecks.plist
│ │ └── program.nx
│ ├── macOS/
│ │ ├── LowRes NX macOS/
│ │ │ ├── Assets.xcassets/
│ │ │ │ ├── AppIcon.appiconset/
│ │ │ │ │ └── Contents.json
│ │ │ │ └── Contents.json
│ │ │ ├── Info.plist
│ │ │ └── LowRes_NX_macOS_SDL.entitlements
│ │ └── LowRes NX macOS.xcodeproj/
│ │ ├── project.pbxproj
│ │ └── project.xcworkspace/
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata/
│ │ └── IDEWorkspaceChecks.plist
│ └── web/
│ ├── README.md
│ ├── embed/
│ │ ├── package/
│ │ │ ├── LowResNX120.js
│ │ │ ├── LowResNX120.wasm
│ │ │ ├── index.html
│ │ │ └── program.nx
│ │ └── readme.txt
│ └── makefile
├── programs/
│ ├── Gfx Designer 2.0.nx
│ ├── LowRes Adventure 1.1.nx
│ ├── LowRes Galaxy 2 (1.5).nx
│ ├── Sound Composer 1.5.nx
│ └── Star Scroller 1.2.nx
├── programs test/
│ ├── BG Scroll.nx
│ ├── Crazy Text.nx
│ ├── Demo 0.5.nx
│ ├── Files.nx
│ ├── Scrolling Map 0.3.nx
│ ├── Slide Show 0.4.nx
│ ├── Sprites with Background 0.3.nx
│ ├── Subs 1.nx
│ ├── Subs 2.nx
│ ├── drawing.nx
│ ├── gamepad.nx
│ ├── hello world.nx
│ ├── sprite collision.nx
│ └── touch.nx
├── scripts/
│ ├── export_characters.py
│ └── export_characters_hex.py
└── sdl/
├── config.h
├── dev_menu.c
├── dev_menu.h
├── dev_menu_data.h
├── main.c
├── main.h
├── runner.c
├── runner.h
├── screenshot.c
├── screenshot.h
├── sdl_include.h
├── settings.c
├── settings.h
├── stb_image_write.h
├── system_paths.c
├── system_paths.h
├── utils.c
└── utils.h
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Build generated
build/
DerivedData/
## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/
## Other
*.moved-aside
*.xcuserstate
## Obj-C/Swift specific
*.hmap
*.ipa
*.dSYM.zip
*.dSYM
# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/
# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts
Carthage/Build
# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
fastlane/report.xml
fastlane/screenshots
#Code Injection
#
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode
iOSInjectionProject/
platform/Windows/LowRes NX Win/Debug/
platform/Windows/LowRes NX Win/Release/
platform/Linux/output/
platform/Windows/Debug/
platform/Windows/Release/
platform/Windows/LowRes NX Win/SDL2.dll
platform/Windows/.vs/
*.user
*.aps
*.bc
platform/web/output
Disk.nx
*.o
================================================
FILE: .gitlab-ci.yml
================================================
# DESCRIPTION: GitLab CI/CD for libRetro
##############################################################################
################################# BOILERPLATE ################################
##############################################################################
# Core definitions
.core-defs:
variables:
CORENAME: lowresnx
MAKEFILE_PATH: platform/LibRetro
JNI_PATH: platform/LibRetro
# Inclusion templates, required for the build to work
include:
################################## DESKTOPS ################################
# Windows 64-bit
- project: 'libretro-infrastructure/ci-templates'
file: '/windows-x64-mingw.yml'
# Windows 32-bit
- project: 'libretro-infrastructure/ci-templates'
file: '/windows-i686-mingw.yml'
# Linux 64-bit
- project: 'libretro-infrastructure/ci-templates'
file: '/linux-x64.yml'
# Linux 32-bit
- project: 'libretro-infrastructure/ci-templates'
file: '/linux-i686.yml'
# Linux 64-bit (ARM)
- project: 'libretro-infrastructure/ci-templates'
file: '/linux-aarch64.yml'
# MacOS PowerPC 32-bit
- project: 'libretro-infrastructure/ci-templates'
file: '/osx-ppc.yml'
# MacOS 64-bit
- project: 'libretro-infrastructure/ci-templates'
file: '/osx-x64.yml'
# MacOS ARM 64-bit
- project: 'libretro-infrastructure/ci-templates'
file: '/osx-arm64.yml'
# DJGPP
- project: 'libretro-infrastructure/ci-templates'
file: '/djgpp-static.yml'
################################## CELLULAR ################################
# Android
- project: 'libretro-infrastructure/ci-templates'
file: '/android-jni.yml'
# iOS
- project: 'libretro-infrastructure/ci-templates'
file: '/ios-arm64.yml'
# iOS (armv7)
- project: 'libretro-infrastructure/ci-templates'
file: '/ios9.yml'
################################## CONSOLES ################################
# PlayStation Portable
- project: 'libretro-infrastructure/ci-templates'
file: '/psp-static.yml'
# PlayStation Vita
- project: 'libretro-infrastructure/ci-templates'
file: '/vita-static.yml'
# PlayStation2
- project: 'libretro-infrastructure/ci-templates'
file: '/ps2-static.yml'
# Nintendo 3DS
- project: 'libretro-infrastructure/ci-templates'
file: '/ctr-static.yml'
# Nintendo GameCube
- project: 'libretro-infrastructure/ci-templates'
file: '/ngc-static.yml'
# Nintendo Wii
- project: 'libretro-infrastructure/ci-templates'
file: '/wii-static.yml'
# Nintendo WiiU
- project: 'libretro-infrastructure/ci-templates'
file: '/wiiu-static.yml'
# Nintendo Switch
- project: 'libretro-infrastructure/ci-templates'
file: '/libnx-static.yml'
# tvOS (AppleTV)
- project: 'libretro-infrastructure/ci-templates'
file: '/tvos-arm64.yml'
# OpenDingux
- project: 'libretro-infrastructure/ci-templates'
file: '/dingux-mips32.yml'
# OpenDingux (ARM)
- project: 'libretro-infrastructure/ci-templates'
file: '/dingux-arm32.yml'
#################################### MISC ##################################
# Emscripten
- project: 'libretro-infrastructure/ci-templates'
file: '/emscripten-static.yml'
# Stages for building
stages:
- build-prepare
- build-shared
- build-static
##############################################################################
#################################### STAGES ##################################
##############################################################################
#
################################### DESKTOPS #################################
# Windows 64-bit
libretro-build-windows-x64:
extends:
- .libretro-windows-x64-mingw-make-default
- .core-defs
# Windows 32-bit
libretro-build-windows-i686:
extends:
- .libretro-windows-i686-mingw-make-default
- .core-defs
# Linux 64-bit
libretro-build-linux-x64:
extends:
- .libretro-linux-x64-make-default
- .core-defs
# Linux 32-bit
libretro-build-linux-i686:
extends:
- .libretro-linux-i686-make-default
- .core-defs
# Linux 64-bit (ARM)
libretro-build-linux-aarch64:
extends:
- .libretro-linux-aarch64-make-default
- .core-defs
# DJGPP
libretro-build-djgpp-i586:
extends:
- .libretro-djgpp-static-retroarch-master
- .core-defs
# MacOS 64-bit
libretro-build-osx-x64:
extends:
- .libretro-osx-x64-make-default
- .core-defs
# MacOS ARM 64-bit
libretro-build-osx-arm64:
extends:
- .libretro-osx-arm64-make-default
- .core-defs
# MacOS PowerPC 32-bit
libretro-build-osx-ppc:
extends:
- .libretro-osx-ppc-make-default
- .core-defs
################################### CELLULAR #################################
# Android ARMv7a
android-armeabi-v7a:
extends:
- .libretro-android-jni-armeabi-v7a
- .core-defs
# Android ARMv8a
android-arm64-v8a:
extends:
- .libretro-android-jni-arm64-v8a
- .core-defs
# Android 64-bit x86
android-x86_64:
extends:
- .libretro-android-jni-x86_64
- .core-defs
# Android 32-bit x86
android-x86:
extends:
- .libretro-android-jni-x86
- .core-defs
# iOS
libretro-build-ios-arm64:
extends:
- .libretro-ios-arm64-make-default
- .core-defs
# iOS (armv7) [iOS 9 and up]
libretro-build-ios9:
extends:
- .libretro-ios9-make-default
- .core-defs
# tvOS
libretro-build-tvos-arm64:
extends:
- .libretro-tvos-arm64-make-default
- .core-defs
################################### CONSOLES #################################
# PlayStation Portable
libretro-build-psp:
extends:
- .libretro-psp-static-retroarch-master
- .core-defs
# PlayStation Vita
libretro-build-vita:
extends:
- .libretro-vita-static-retroarch-master
- .core-defs
# PlayStation2
libretro-build-ps2:
extends:
- .libretro-ps2-static-retroarch-master
- .core-defs
# Nintendo 3DS
libretro-build-ctr:
extends:
- .libretro-ctr-static-retroarch-master
- .core-defs
# Nintendo GameCube
libretro-build-ngc:
extends:
- .libretro-ngc-static-retroarch-master
- .core-defs
# Nintendo Wii
libretro-build-wii:
extends:
- .libretro-wii-static-retroarch-master
- .core-defs
# Nintendo WiiU
libretro-build-wiiu:
extends:
- .libretro-wiiu-static-retroarch-master
- .core-defs
# Nintendo Switch
libretro-build-libnx-aarch64:
extends:
- .libretro-libnx-static-retroarch-master
- .core-defs
# OpenDingux
libretro-build-dingux-mips32:
extends:
- .libretro-dingux-mips32-make-default
- .core-defs
# OpenDingux Beta
libretro-build-dingux-odbeta-mips32:
extends:
- .libretro-dingux-odbeta-mips32-make-default
- .core-defs
# OpenDingux Beta
libretro-build-rs90-odbeta-mips32:
extends:
- .libretro-rs90-odbeta-mips32-make-default
- .core-defs
# RetroFW
libretro-build-retrofw-mips32:
extends:
- .libretro-retrofw-mips32-make-default
- .core-defs
# Miyoo
libretro-build-miyoo-arm32:
extends:
- .libretro-miyoo-arm32-make-default
- .core-defs
#################################### MISC ##################################
# Emscripten
libretro-build-emscripten:
extends:
- .libretro-emscripten-static-retroarch-master
- .core-defs
================================================
FILE: LICENSE
================================================
Copyright 2016-2021 Timo Kloss
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
================================================
FILE: README.md
================================================
# LowRes NX
## Program retro games in BASIC
Make your own retro games on a virtual game console. Program in the classic BASIC language and create sprites, tile maps, sound and music with the included tools. As a beginner you will quickly understand how to create simple text games or show your first sprite on a tile map. As an experienced programmer you can discover the full potential of retro hardware tricks!
## Virtual Game Console
Imagine LowRes NX as a handheld game console with a d-pad, two action buttons and a little rubber keyboard below a slidable touchscreen. LowRes NX was inspired by real 8- and 16-bit systems and simulates chips for graphics, sound and I/O, which actually work like classic hardware. It supports hardware sprites as well as hardware parallax scrolling, and even offers vertical blank and raster interrupts to create authentic retro effects.
## Old-School Programming
The programming language of LowRes NX is based on second-generation, structured BASIC. It offers all the classic commands, but with labels, loops and subprograms instead of line numbers. Graphics and sound are supported by additional commands and you can even access the virtual hardware directly using PEEK and POKE. You have complete control over the program flow, there is no standard update function to implement.
## Creative Tools
LowRes NX includes all the tools you need: The Gfx Designer for editing sprites, tiles, fonts and maps, as well as the Sound Composer for music and sound effects. All of these are just normal BASIC programs. You can change and improve them or even create your own custom editors.
## Share and Play
Send your games directly to other users or share them via the website. All programs are open source, so you can play them, learn from them and edit them. Do you prefer making just art or music? Share your creations as assets and let other programmers use them in their projects.
================================================
FILE: assets/overlay.nx
================================================
#2:CHARS
00000000000000000000000000000000
3C3C3C3C3C3C3C3C3C242424243C243C
FEFEFEFE7E000000FE9292DA7E000000
7EFFFFFFFFFFFF7E7EDB81DBDB81DB7E
1C7F7F7F7F7F7F1C1C7741477141771C
F7FFFFFE7FFFFFEFF79D9BF66FD9B9EF
3E7E7EFFFFFFFF7F3E624AC7919BC57F
3C3C7C7C780000003C24644C78000000
1E3E7E7C7C7E3E1E1E32664C4C66321E
787C7E3E3E7E7C78784C663232664C78
007E7EFFFFFF7E7E007E5AE781E75A7E
003C3CFFFFFF3C3C003C24E781E7243C
0000003C3C7C7C780000003C24644C78
000000FFFFFF0000000000FF81FF0000
000000003C3C3C3C000000003C24243C
0F1F3F7EFCF8F0E00F193366CC98B0E0
7EFFFFFFFFFFFF7E7EC399918999C37E
3C7C7C7C3CFFFFFF3C64446424E781FF
7EFFFFFF7EFFFFFF7EC399F366CF81FF
7EFFFFFFFFFFFF7E7EC399F3F999C37E
FFFFFFFFFF0F0F0FFF999981F909090F
FFFFFFFFFFFFFFFEFF819F83F9F983FE
3E7EFEFFFFFFFF7E3E62CE839999C37E
FFFFFF3F7E7C7878FF81F933664C4878
7EFFFFFFFFFFFF7E7EC399C39999C37E
7EFFFFFFFFFFFF7E7EC399C1F999C37E
00003C3C3C3C3C0000003C243C243C00
00003C3C3C7C7C7800003C243C644C78
001E3E7E7C7E3E1E001E32664C66321E
0000FFFFFFFFFF000000FF81FF81FF00
00787C7E3E7E7C7800784C6632664C78
7EFFFFFF3E3C3C3C7EC399F3263C243C
7EFFFFFFFFFFFE7E7EC39991919FC27E
3C7EFFFFFFFFFFFF3C66C399819999FF
FEFFFFFFFFFFFFFEFE839983999983FE
7EFFFFFFFFFFFF7E7EC3999F9F99C37E
FCFEFFFFFFFFFEFCFC869399999386FC
FFFFFFFCFCFFFFFFFF819F849C9F81FF
FFFFFFFCFCF0F0F0FF819F849C9090F0
7EFEFFFFFFFFFF7E7EC29F919999C37E
FFFFFFFFFFFFFFFFFF999981999999FF
7E7E7E3C3C7E7E7E7E4266242466427E
3F3F3F0FFFFFFF7E3F213909F999C37E
FFFFFFFEFEFFFFFFFF999386869399FF
F0F0F0F0F0FFFFFFF0909090909F81FF
E7FFFFFFFFFFFFFFE7BD9981819999FF
FFFFFFFFFFFFFFFFFF998981919999FF
7EFFFFFFFFFFFF7E7EC399999999C37E
FEFFFFFFFEF0F0F0FE8399839E9090F0
7EFFFFFFFFFFFF7F7EC399999593C17F
FEFFFFFFFEFFFFFFFE839983869399FF
7FFFFFFF7FFFFFFE7FC19FC379F983FE
FFFFFF3C3C3C3C3CFF81E7242424243C
FFFFFFFFFFFFFF7EFF9999999999C37E
FFFFFFFFFFFF7E3CFF99999999C3663C
FFFFFFFFFFFFFFE7FF9999818199BDE7
FFFFFF7EFFFFFFFFFF99C366C39999FF
FFFFFFFF7E3C3C3CFF9999C36624243C
FFFFFF7EFCFFFFFFFF81F366CC9F81FF
7EFFFFFFFFFFFF7E7EC399A5BDA5C37E
7EFFFFFFFFFFFF7E7EC3A1B9A5B9C37E
3C7EFFFFFFFF7E3C3C66E78181E7663C
3C7EFFFFFF0000003C66C399FF000000
0000000000FFFFFF0000000000FF81FF
================================================
FILE: core/accessories/disk_drive.c
================================================
//
// Copyright 2017 Timo Kloss
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
#include "disk_drive.h"
#include "core.h"
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <stdint.h>
void disk_init(struct Core *core)
{
// init lazily in disk_prepare()
}
void disk_deinit(struct Core *core)
{
struct DataManager *dataManager = &core->diskDrive->dataManager;
if (dataManager->data)
{
free(dataManager->data);
dataManager->data = NULL;
}
data_deinit(dataManager);
}
void disk_reset(struct Core *core)
{
struct DataManager *dataManager = &core->diskDrive->dataManager;
if (dataManager->data)
{
data_reset(dataManager);
}
}
bool disk_prepare(struct Core *core)
{
struct DataManager *dataManager = &core->diskDrive->dataManager;
if (dataManager->data == NULL)
{
dataManager->data = calloc(DATA_SIZE, 1);
if (!dataManager->data) exit(EXIT_FAILURE);
data_init(dataManager);
}
return delegate_diskDriveWillAccess(core);
}
bool disk_saveFile(struct Core *core, int index, char *comment, int address, int length)
{
if (!disk_prepare(core))
{
return false;
}
assert(address >= 0 && address + length <= sizeof(struct Machine));
struct DataManager *dataManager = &core->diskDrive->dataManager;
if (!data_canSetEntry(dataManager, index, length))
{
delegate_diskDriveIsFull(core);
}
else
{
uint8_t *source = &((uint8_t *)core->machine)[address];
data_setEntry(dataManager, index, comment, source, length);
delegate_diskDriveDidSave(core);
}
return true;
}
bool disk_loadFile(struct Core *core, int index, int address, int maxLength, int offset, bool *pokeFailed)
{
if (!disk_prepare(core))
{
return false;
}
struct DataEntry *entry = &core->diskDrive->dataManager.entries[index];
uint8_t *data = core->diskDrive->dataManager.data;
// read file
int start = entry->start + offset;
int length = entry->length;
if (maxLength > 0 && length > maxLength)
{
length = maxLength;
}
if (offset + length > entry->length)
{
length = entry->length - offset;
}
for (int i = 0; i < length; i++)
{
bool poke = machine_poke(core, address + i, data[i + start]);
if (!poke)
{
*pokeFailed = true;
return true;
}
}
return true;
}
================================================
FILE: core/accessories/disk_drive.h
================================================
//
// Copyright 2017 Timo Kloss
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
#ifndef disk_drive_h
#define disk_drive_h
#include <stdio.h>
#include <stdbool.h>
#include "data_manager.h"
struct Core;
struct DiskDrive {
struct DataManager dataManager;
};
void disk_init(struct Core *core);
void disk_deinit(struct Core *core);
void disk_reset(struct Core *core);
bool disk_prepare(struct Core *core);
bool disk_saveFile(struct Core *core, int index, char *comment, int address, int length);
bool disk_loadFile(struct Core *core, int index, int address, int maxLength, int offset, bool *pokeFailed);
#endif /* disk_drive_h */
================================================
FILE: core/boot_intro.c
================================================
//
// Copyright 2017-2018 Timo Kloss
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
#include "boot_intro.h"
#include "core.h"
const int bootIntroStateAddress = 0xA000;
const char *bootIntroSourceCode = "VER$=\"" CORE_VERSION "\"\n\nGLOBAL JIN\n\nFONT 64\n\nENVELOPE 0,0,10,0,6\nENVELOPE 1,0,10,0,6\nENVELOPE 2,0,7,0,7\nENVELOPE 3,0,7,0,7\nLFO 0,5,4,0,0\nLFO 1,5,4,0,0\nVOLUME 0,15,%10\nVOLUME 1,15,%01\nVOLUME 2,15,%10\nVOLUME 3,15,%01\n\nSPRITE.A 0,(3,0,0,0,1)\nSPRITE.A 1,(0,0,0,0,1)\nSPRITE.A 2,(0,0,0,0,3)\nSPRITE.A 3,(1,0,0,0,0)\nSPRITE.A 4,(2,0,0,0,1)\n\nSPRITE 1,72,56,5\nSPRITE 2,64,56,1\n\nPAL 2\nCELL 0,15,39\nCELL 1,15,40\nCELL 2,15,41\nCELL 3,15,42\nCELL 4,15,43\nCELL 5,15,44\n\nTEXT 20-LEN(VER$),15,VER$\n\n\nDO\n SPRITE 3,76,40,7\n WAIT 30\n FOR Y=40 TO 56\n SPRITE 3,76,Y,7\n WAIT 2\n NEXT Y\n FOR I=1 TO 30\n WAIT VBL\n IF PEEK($A000)=1 THEN GOTO LOADING\n NEXT I\nLOOP\n\nLOADING:\nON VBL CALL JINGLE\nFOR Y=56 TO 49 STEP -1\n SPRITE 0,72,Y,37\n SPRITE 1,,Y,\n WAIT 4\nNEXT Y\nWAIT 60\n\nPOKE $A000,2\nDO\n N=N+1\n SPRITE 4,76,80,8+(N MOD 4)*2\n WAIT 10\nLOOP\n\nSUB JINGLE\n IF JIN=0 THEN\n PLAY 0,52,0\n PLAY 1,48,0\n ELSE IF JIN=15 THEN\n STOP\n PLAY 2,50,1\n PLAY 3,46,1\n ELSE IF JIN=30 THEN\n ON VBL OFF\n END IF\n JIN=JIN+1\nEND SUB\n\n#1:MAIN PALETTES\n0A2A150030381500003F2F0F003F0A34\n003F2A15003F2A15003F2A15003F2A15\n\n#2:MAIN CHARACTERS\n00000000000000000000000000000000\n3F7FC0809CBEBEBE3F40BFFFFFFFFFFF\nFF80808080808080FFFFFFFFFFFFFFFF\nFF01010101010101FFFFFFFFFFFFFFFF\nFCFE0321210D6D61FC02FDDFFFFFFFFF\n7FFF809F9F9F9F9F7F80FFFFFFFFFFFF\nFEFF01F9F9F9F9F9FE01FFFFFFFFFFFF\n7EBDBDBDBD8181FF7EC3DBC3C3FFFFFF\n08090200C100204800412200C1002241\n00000000800000000000000080000000\n00412200C100224108482000C1000209\n00000000800000000000000080000000\n08482000C10002090849220000002249\n00000000800000000000000000000000\n084922000000224908090200C1002048\n00000000000000000000000080000000\n00000000000000000000000000000000\n9C8088948880403FFFFFFFFFFFFF7F3F\n80B6929B89B692FFFFC9FFE4FFC9FFFF\n01D9496D25D949FFFF27FF93FF27FFFF\n01011129110102FCFFFFFFFFFFFFFEFC\n9F9F9F80FFFF80FFFFFFFFFFFF80FFFF\nF9F9F901FFFF01FFFFFFFFFFFF01FFFF\n00000000000000000000000000000000\n08000000000000000000000000000000\n00000000000000000000000000000000\n00000000000000000800000000000000\n00000000000000000000000000000000\n08000000000000000800000000000000\n00000000000000000000000000000000\n08000000000000000800000000000000\n00000000000000000000000000000000\n00000000000000000000000000000000\n00000000000000000000000000000000\n00000000000000000000000000000000\n00000000000000000000000000000000\n00000000000000000000000000000000\n0000000000000301000000000F0F0C0F\n000000000000C08000000000F0F030F0\n00004344444473000000434444447300\n000022A2AAB62200000022A2AAB62200\n0000E794E79497000000E794E7949700\n00009C201804B80000009C201804B800\n00004564544C450000004564544C4500\n000010A040A01000000010A040A01000\n00000000000000000000000000000000\n00000000000000000000000000000000\n00000000000000000000000000000000\n00000000000000000000000000000000\n00000000000000000000000000000000\n00000000000000000000000000000000\n00000000000000000000000000000000\n00000000000000000000000000000000\n00000000000000000F0F000000000000\n0000000000000000F0F0000000000000\n00000000000000000000000000000000\n00000000000000000000000000000000\n00000000000000000000000000000000\n00000000000000000000000000000000\n00000000000000000000000000000000\n00000000000000000000000000000000\n00000000000000000000000000000000\n00000000000000000000000000000000\n00000000000000000000000000000000\n00000000000000000000000000000000\n00181818180018000000000000000000\n006C6C24000000000000000000000000\n00247E24247E24000000000000000000\n00083E380E3E08000000000000000000\n00626408102646000000000000000000\n001C34386E643A000000000000000000\n00181830000000000000000000000000\n00000408080804000000040808080400\n00001008080810000000100808081000\n000024187E1824000000000000000000\n000018187E1818000000000000000000\n00000000181830000000000000000000\n000000007E0000000000000000000000\n00000000000010000000000000001000\n00060C18306040000000000000000000\n00001C2222221C0000001C2222221C00\n0000380808083E000000380808083E00\n00003C021C203E0000003C021C203E00\n00003C021C023C0000003C021C023C00\n00002020283E080000002020283E0800\n00003E203C023C0000003E203C023C00\n00001C203C221C0000001C203C221C00\n00003E040810200000003E0408102000\n00001C221C221C0000001C221C221C00\n00001C221E023C0000001C221E023C00\n00000018001800000000000000000000\n00000018001830000000000000000000\n00000C1830180C000000000000000000\n0000007E007E00000000000000000000\n000030180C1830000000000000000000\n003C660C180018000000000000000000\n003C666E6E603C000000000000000000\n00183C667E6666000000000000000000\n007C667C66667C000000000000000000\n003C666060663C000000000000000000\n00786C66666C78000000000000000000\n007E607860607E000000000000000000\n007E6078606060000000000000000000\n003C606E66663C000000000000000000\n0066667E666666000000000000000000\n003C181818183C000000000000000000\n001E060606663C000000000000000000\n00666C78786C66000000000000000000\n0060606060607E000000000000000000\n0042667E7E6666000000000000000000\n0066767E6E6666000000000000000000\n003C666666663C000000000000000000\n007C667C606060000000000000000000\n003C66666A6C3E000000000000000000\n007C667C786C66000000000000000000\n003E603C06067C000000000000000000\n007E1818181818000000000000000000\n0066666666663C000000000000000000\n00666666663C18000000000000000000\n0066667E7E6642000000000000000000\n00663C183C6666000000000000000000\n0066663C181818000000000000000000\n007E0C1830607E000000000000000000\n003C303030303C000000000000000000\n006030180C0602000000000000000000\n003C0C0C0C0C3C000000000000000000\n00183C66000000000000000000000000\n0000000000007E000000000000000000\n";
================================================
FILE: core/boot_intro.h
================================================
//
// Copyright 2017-2018 Timo Kloss
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
#ifndef boot_intro_h
#define boot_intro_h
extern const int bootIntroStateAddress;
extern const char *bootIntroSourceCode;
enum BootIntroState {
BootIntroStateDefault,
BootIntroStateProgramAvailable,
BootIntroStateReadyToRun,
BootIntroStateDone
};
#endif /* boot_intro_h */
================================================
FILE: core/core.c
================================================
//
// Copyright 2016-2020 Timo Kloss
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
#include "core.h"
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include "string_utils.h"
#include "startup_sequence.h"
const char CoreInputKeyReturn = '\n';
const char CoreInputKeyBackspace = '\b';
const char CoreInputKeyRight = 17;
const char CoreInputKeyLeft = 18;
const char CoreInputKeyDown = 19;
const char CoreInputKeyUp = 20;
void core_handleInput(struct Core *core, struct CoreInput *input);
void core_init(struct Core *core)
{
memset(core, 0, sizeof(struct Core));
core->machine = calloc(1, sizeof(struct Machine));
if (!core->machine) exit(EXIT_FAILURE);
core->machineInternals = calloc(1, sizeof(struct MachineInternals));
if (!core->machineInternals) exit(EXIT_FAILURE);
core->interpreter = calloc(1, sizeof(struct Interpreter));
if (!core->interpreter) exit(EXIT_FAILURE);
core->diskDrive = calloc(1, sizeof(struct DiskDrive));
if (!core->diskDrive) exit(EXIT_FAILURE);
core->overlay = calloc(1, sizeof(struct Overlay));
if (!core->overlay) exit(EXIT_FAILURE);
machine_init(core);
itp_init(core);
overlay_init(core);
disk_init(core);
}
void core_deinit(struct Core *core)
{
itp_deinit(core);
disk_deinit(core);
free(core->machine);
core->machine = NULL;
free(core->machineInternals);
core->machineInternals = NULL;
free(core->interpreter);
core->interpreter = NULL;
free(core->diskDrive);
core->diskDrive = NULL;
free(core->overlay);
core->overlay = NULL;
}
void core_setDelegate(struct Core *core, struct CoreDelegate *delegate)
{
core->delegate = delegate;
}
struct CoreError core_compileProgram(struct Core *core, const char *sourceCode, bool resetPersistent)
{
machine_reset(core, resetPersistent);
overlay_reset(core);
disk_reset(core);
return itp_compileProgram(core, sourceCode);
}
void core_traceError(struct Core *core, struct CoreError error)
{
core->interpreter->debug = false;
struct TextLib *lib = &core->overlay->textLib;
txtlib_printText(lib, err_getString(error.code));
txtlib_printText(lib, "\n");
if (error.sourcePosition >= 0 && core->interpreter->sourceCode)
{
int number = lineNumber(core->interpreter->sourceCode, error.sourcePosition);
char lineNumberText[30];
sprintf(lineNumberText, "IN LINE %d:\n", number);
txtlib_printText(lib, lineNumberText);
const char *line = lineString(core->interpreter->sourceCode, error.sourcePosition);
if (line)
{
txtlib_printText(lib, line);
txtlib_printText(lib, "\n");
free((void *)line);
}
}
}
void core_willRunProgram(struct Core *core, long secondsSincePowerOn)
{
runStartupSequence(core);
core->interpreter->timer = (float)(secondsSincePowerOn * 60 % TIMER_WRAP_VALUE);
machine_suspendEnergySaving(core, 30);
delegate_controlsDidChange(core);
}
void core_update(struct Core *core, struct CoreInput *input)
{
core_handleInput(core, input);
itp_runInterrupt(core, InterruptTypeVBL);
itp_runProgram(core);
itp_didFinishVBL(core);
overlay_draw(core, true);
audio_bufferRegisters(core);
}
void core_handleInput(struct Core *core, struct CoreInput *input)
{
struct IORegisters *ioRegisters = &core->machine->ioRegisters;
union IOAttributes ioAttr = ioRegisters->attr;
bool processedOtherInput = false;
if (input->key != 0)
{
if (ioAttr.keyboardEnabled)
{
char key = input->key;
if ( (key >= 32 && key < 127)
|| key == CoreInputKeyBackspace || key == CoreInputKeyReturn
|| key == CoreInputKeyDown || key == CoreInputKeyUp || key == CoreInputKeyRight || key == CoreInputKeyLeft )
{
ioRegisters->key = key;
}
}
input->key = 0;
machine_suspendEnergySaving(core, 2);
}
if (input->touch)
{
if (ioAttr.touchEnabled)
{
ioRegisters->status.touch = 1;
int x = input->touchX;
int y = input->touchY;
if (x < 0) x = 0; else if (x >= SCREEN_WIDTH) x = SCREEN_WIDTH - 1;
if (y < 0) y = 0; else if (y >= SCREEN_HEIGHT) y = SCREEN_HEIGHT - 1;
ioRegisters->touchX = x;
ioRegisters->touchY = y;
}
else
{
ioRegisters->status.touch = 0;
}
machine_suspendEnergySaving(core, 2);
}
else
{
ioRegisters->status.touch = 0;
}
for (int i = 0; i < NUM_GAMEPADS; i++)
{
union Gamepad *gamepad = &ioRegisters->gamepads[i];
if (ioAttr.gamepadsEnabled > i && !ioAttr.keyboardEnabled)
{
struct CoreInputGamepad *inputGamepad = &input->gamepads[i];
gamepad->up = inputGamepad->up && !inputGamepad->down;
gamepad->down = inputGamepad->down && !inputGamepad->up;
gamepad->left = inputGamepad->left && !inputGamepad->right;
gamepad->right = inputGamepad->right && !inputGamepad->left;
gamepad->buttonA = inputGamepad->buttonA;
gamepad->buttonB = inputGamepad->buttonB;
if (inputGamepad->up || inputGamepad->down || inputGamepad->left || inputGamepad->right)
{
// some d-pad combinations are not registered as I/O, but mark them anyway.
processedOtherInput = true;
}
if (gamepad->value)
{
machine_suspendEnergySaving(core, 2);
}
}
else
{
gamepad->value = 0;
}
}
if (input->pause)
{
if (core->interpreter->state == StatePaused)
{
core->interpreter->state = StateEvaluate;
overlay_updateState(core);
processedOtherInput = true;
}
else if (ioAttr.gamepadsEnabled > 0 && !ioAttr.keyboardEnabled) {
ioRegisters->status.pause = 1;
}
input->pause = false;
}
input->out_hasUsedInput = processedOtherInput || ioRegisters->key || ioRegisters->status.value || ioRegisters->gamepads[0].value || ioRegisters->gamepads[1].value;
}
void core_willSuspendProgram(struct Core *core)
{
if (core->machineInternals->hasChangedPersistent)
{
delegate_persistentRamDidChange(core, core->machine->persistentRam, PERSISTENT_RAM_SIZE);
core->machineInternals->hasChangedPersistent = false;
}
}
void core_setDebug(struct Core *core, bool enabled)
{
core->interpreter->debug = enabled;
overlay_updateState(core);
}
bool core_getDebug(struct Core *core)
{
return core->interpreter->debug;
}
bool core_isKeyboardEnabled(struct Core *core)
{
return core->machine->ioRegisters.attr.keyboardEnabled;
}
bool core_shouldRender(struct Core *core)
{
enum State state = core->interpreter->state;
bool shouldRender = (!core->machineInternals->isEnergySaving && state != StateEnd && state != StateNoProgram)
|| core->machineInternals->energySavingTimer > 0
|| core->machineInternals->energySavingTimer % 20 == 0;
core->machineInternals->energySavingTimer--;
return shouldRender;
}
void core_setInputGamepad(struct CoreInput *input, int player, bool up, bool down, bool left, bool right, bool buttonA, bool buttonB)
{
struct CoreInputGamepad *gamepad = &input->gamepads[player];
gamepad->up = up;
gamepad->down = down;
gamepad->left = left;
gamepad->right = right;
gamepad->buttonA = buttonA;
gamepad->buttonB = buttonB;
}
void core_diskLoaded(struct Core *core)
{
core->interpreter->state = StateEvaluate;
}
================================================
FILE: core/core.h
================================================
//
// Copyright 2016-2020 Timo Kloss
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
#ifndef core_h
#define core_h
#define CORE_VERSION "1.2"
#include <stdio.h>
#include <stdbool.h>
#include "machine.h"
#include "overlay.h"
#include "interpreter.h"
#include "disk_drive.h"
#include "core_delegate.h"
struct Core {
struct Machine *machine;
struct MachineInternals *machineInternals;
struct Interpreter *interpreter;
struct DiskDrive *diskDrive;
struct Overlay *overlay;
struct CoreDelegate *delegate;
};
struct CoreInputGamepad {
bool up;
bool down;
bool left;
bool right;
bool buttonA;
bool buttonB;
};
struct CoreInput {
struct CoreInputGamepad gamepads[NUM_GAMEPADS];
bool pause;
int touchX;
int touchY;
bool touch;
char key;
bool out_hasUsedInput;
};
extern const char CoreInputKeyReturn;
extern const char CoreInputKeyBackspace;
extern const char CoreInputKeyRight;
extern const char CoreInputKeyLeft;
extern const char CoreInputKeyDown;
extern const char CoreInputKeyUp;
void core_init(struct Core *core);
void core_deinit(struct Core *core);
void core_setDelegate(struct Core *core, struct CoreDelegate *delegate);
struct CoreError core_compileProgram(struct Core *core, const char *sourceCode, bool resetPersistent);
void core_traceError(struct Core *core, struct CoreError error);
void core_willRunProgram(struct Core *core, long secondsSincePowerOn);
void core_update(struct Core *core, struct CoreInput *input);
void core_willSuspendProgram(struct Core *core);
void core_setDebug(struct Core *core, bool enabled);
bool core_getDebug(struct Core *core);
bool core_isKeyboardEnabled(struct Core *core);
bool core_shouldRender(struct Core *core);
void core_setInputGamepad(struct CoreInput *input, int player, bool up, bool down, bool left, bool right, bool buttonA, bool buttonB);
void core_diskLoaded(struct Core *core);
// for dev mode only:
void core_handleInput(struct Core *core, struct CoreInput *input);
#endif /* core_h */
================================================
FILE: core/core_delegate.c
================================================
//
// Copyright 2017 Timo Kloss
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
#include <stdio.h>
#include "core.h"
void delegate_interpreterDidFail(struct Core *core, struct CoreError coreError)
{
if (core->delegate->interpreterDidFail)
{
core->delegate->interpreterDidFail(core->delegate->context, coreError);
}
}
bool delegate_diskDriveWillAccess(struct Core *core)
{
if (core->delegate->diskDriveWillAccess)
{
return core->delegate->diskDriveWillAccess(core->delegate->context, &core->diskDrive->dataManager);
}
return true;
}
void delegate_diskDriveDidSave(struct Core *core)
{
if (core->delegate->diskDriveDidSave)
{
core->delegate->diskDriveDidSave(core->delegate->context, &core->diskDrive->dataManager);
}
}
void delegate_diskDriveIsFull(struct Core *core)
{
if (core->delegate->diskDriveIsFull)
{
core->delegate->diskDriveIsFull(core->delegate->context, &core->diskDrive->dataManager);
}
}
void delegate_controlsDidChange(struct Core *core)
{
if (core->delegate->controlsDidChange)
{
struct ControlsInfo info;
union IOAttributes ioAttr = core->machine->ioRegisters.attr;
if (ioAttr.keyboardEnabled)
{
if (core->interpreter->isKeyboardOptional)
{
info.keyboardMode = KeyboardModeOptional;
}
else
{
info.keyboardMode = KeyboardModeOn;
}
}
else
{
info.keyboardMode = KeyboardModeOff;
}
info.numGamepadsEnabled = ioAttr.keyboardEnabled ? 0 : ioAttr.gamepadsEnabled;
info.isTouchEnabled = ioAttr.touchEnabled;
info.isAudioEnabled = core->machineInternals->audioInternals.audioEnabled;
core->delegate->controlsDidChange(core->delegate->context, info);
}
}
void delegate_persistentRamWillAccess(struct Core *core, uint8_t *destination, int size)
{
if (core->delegate->persistentRamWillAccess)
{
core->delegate->persistentRamWillAccess(core->delegate->context, destination, size);
}
}
void delegate_persistentRamDidChange(struct Core *core, uint8_t *data, int size)
{
if (core->delegate->persistentRamDidChange)
{
core->delegate->persistentRamDidChange(core->delegate->context, data, size);
}
}
================================================
FILE: core/core_delegate.h
================================================
//
// Copyright 2017 Timo Kloss
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
#ifndef core_delegate_h
#define core_delegate_h
#include "data_manager.h"
#include "error.h"
struct Core;
enum KeyboardMode {
KeyboardModeOff,
KeyboardModeOn,
KeyboardModeOptional
};
struct ControlsInfo {
enum KeyboardMode keyboardMode;
int numGamepadsEnabled;
bool isTouchEnabled;
bool isAudioEnabled;
};
struct CoreDelegate {
void *context;
/** Called on error */
void (*interpreterDidFail)(void *context, struct CoreError coreError);
/** Returns true if the disk is ready, false if not. In case of not, core_diskLoaded must be called when ready. */
bool (*diskDriveWillAccess)(void *context, struct DataManager *diskDataManager);
/** Called when a disk data entry was saved */
void (*diskDriveDidSave)(void *context, struct DataManager *diskDataManager);
/** Called when a disk data entry was tried to be saved, but the disk is full */
void (*diskDriveIsFull)(void *context, struct DataManager *diskDataManager);
/** Called when keyboard or gamepad settings changed */
void (*controlsDidChange)(void *context, struct ControlsInfo controlsInfo);
/** Called when persistent RAM will be accessed the first time */
void (*persistentRamWillAccess)(void *context, uint8_t *destination, int size);
/** Called when persistent RAM should be saved */
void (*persistentRamDidChange)(void *context, uint8_t *data, int size);
};
void delegate_interpreterDidFail(struct Core *core, struct CoreError coreError);
bool delegate_diskDriveWillAccess(struct Core *core);
void delegate_diskDriveDidSave(struct Core *core);
void delegate_diskDriveIsFull(struct Core *core);
void delegate_controlsDidChange(struct Core *core);
void delegate_persistentRamWillAccess(struct Core *core, uint8_t *destination, int size);
void delegate_persistentRamDidChange(struct Core *core, uint8_t *data, int size);
#endif /* core_delegate_h */
================================================
FILE: core/core_stats.c
================================================
//
// Copyright 2020 Timo Kloss
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
#include "core_stats.h"
#include <string.h>
#include <stdlib.h>
#include "string_utils.h"
void stats_init(struct Stats *stats)
{
memset(stats, 0, sizeof(struct Stats));
stats->tokenizer = calloc(1, sizeof(struct Tokenizer));
if (!stats->tokenizer) exit(EXIT_FAILURE);
stats->romDataManager = calloc(1, sizeof(struct DataManager));
if (!stats->romDataManager) exit(EXIT_FAILURE);
stats->romDataManager->data = calloc(1, DATA_SIZE);
if (!stats->romDataManager->data) exit(EXIT_FAILURE);
}
void stats_deinit(struct Stats *stats)
{
free(stats->romDataManager->data);
stats->romDataManager->data = NULL;
free(stats->tokenizer);
stats->tokenizer = NULL;
free(stats->romDataManager);
stats->romDataManager = NULL;
}
struct CoreError stats_update(struct Stats *stats, const char *sourceCode)
{
stats->numTokens = 0;
stats->romSize = 0;
struct CoreError error = err_noCoreError();
const char *upperCaseSourceCode = uppercaseString(sourceCode);
if (!upperCaseSourceCode)
{
error = err_makeCoreError(ErrorOutOfMemory, -1);
goto cleanup;
}
error = tok_tokenizeUppercaseProgram(stats->tokenizer, upperCaseSourceCode);
if (error.code != ErrorNone)
{
goto cleanup;
}
stats->numTokens = stats->tokenizer->numTokens;
struct DataManager *romDataManager = stats->romDataManager;
error = data_uppercaseImport(romDataManager, upperCaseSourceCode, false);
if (error.code != ErrorNone)
{
goto cleanup;
}
stats->romSize = data_currentSize(stats->romDataManager);
// add default characters if ROM entry 0 is unused
struct DataEntry *entry0 = &romDataManager->entries[0];
if (entry0->length == 0 && (DATA_SIZE - data_currentSize(romDataManager)) >= 1024)
{
stats->romSize += 1024;
}
cleanup:
tok_freeTokens(stats->tokenizer);
if (upperCaseSourceCode)
{
free((void *)upperCaseSourceCode);
}
return error;
}
================================================
FILE: core/core_stats.h
================================================
//
// Copyright 2020 Timo Kloss
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
#ifndef core_stats_h
#define core_stats_h
#include <stdio.h>
#include "error.h"
#include "tokenizer.h"
#include "data_manager.h"
struct Stats {
struct Tokenizer *tokenizer;
struct DataManager *romDataManager;
int numTokens;
int romSize;
};
void stats_init(struct Stats *stats);
void stats_deinit(struct Stats *stats);
struct CoreError stats_update(struct Stats *stats, const char *sourceCode);
#endif /* core_stats_h */
================================================
FILE: core/datamanager/data_manager.c
================================================
//
// Copyright 2017 Timo Kloss
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
#include "data_manager.h"
#include "charsets.h"
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include "string_utils.h"
int data_calcOutputSize(struct DataManager *manager);
void data_init(struct DataManager *manager)
{
data_reset(manager);
}
void data_deinit(struct DataManager *manager)
{
assert(manager);
if (manager->diskSourceCode)
{
free((void *)manager->diskSourceCode);
manager->diskSourceCode = NULL;
}
}
void data_reset(struct DataManager *manager)
{
memset(manager->entries, 0, sizeof(struct DataEntry) * MAX_ENTRIES);
strcpy(manager->entries[1].comment, "MAIN PALETTES");
strcpy(manager->entries[2].comment, "MAIN CHARACTERS");
strcpy(manager->entries[3].comment, "MAIN BG");
strcpy(manager->entries[15].comment, "MAIN SOUND");
if (manager->diskSourceCode)
{
free((void *)manager->diskSourceCode);
manager->diskSourceCode = NULL;
}
}
struct CoreError data_import(struct DataManager *manager, const char *input, bool keepSourceCode)
{
assert(manager);
assert(input);
const char *uppercaseInput = uppercaseString(input);
if (!uppercaseInput) return err_makeCoreError(ErrorOutOfMemory, -1);
struct CoreError error = data_uppercaseImport(manager, uppercaseInput, keepSourceCode);
free((void *)uppercaseInput);
return error;
}
struct CoreError data_uppercaseImport(struct DataManager *manager, const char *input, bool keepSourceCode)
{
assert(manager);
assert(input);
data_reset(manager);
const char *character = input;
uint8_t *currentDataByte = manager->data;
uint8_t *endDataByte = &manager->data[DATA_SIZE];
// skip stuff before
const char *prevChar = NULL;
while (*character && !(*character == '#' && (!prevChar || *prevChar == '\n')))
{
prevChar = character;
character++;
}
if (keepSourceCode)
{
size_t length = (size_t)(character - input);
char *diskSourceCode = malloc(length + 1);
if (!diskSourceCode) exit(EXIT_FAILURE);
stringConvertCopy(diskSourceCode, input, length);
manager->diskSourceCode = diskSourceCode;
}
while (*character)
{
if (*character == '#')
{
character++;
// entry index
int entryIndex = 0;
while (*character)
{
if (strchr(CharSetDigits, *character))
{
int digit = (int)*character - (int)'0';
entryIndex *= 10;
entryIndex += digit;
character++;
}
else
{
break;
}
}
if (*character != ':') return err_makeCoreError(ErrorUnexpectedCharacter, (int)(character - input));
character++;
if (entryIndex >= MAX_ENTRIES) return err_makeCoreError(ErrorIndexOutOfBounds, (int)(character - input));
struct DataEntry *entry = &manager->entries[entryIndex];
if (entry->length > 0) return err_makeCoreError(ErrorIndexAlreadyDefined, (int)(character - input));
// file comment
const char *comment = character;
do
{
character++;
}
while (*character && *character != '\n' && *character != '\r');
size_t commentLen = (character - comment);
if (commentLen >= ENTRY_COMMENT_SIZE) commentLen = ENTRY_COMMENT_SIZE - 1;
memset(entry->comment, 0, ENTRY_COMMENT_SIZE);
strncpy(entry->comment, comment, commentLen);
// binary data
uint8_t *startByte = currentDataByte;
bool shift = true;
int value = 0;
while (*character && *character != '#')
{
char *spos = strchr(CharSetHex, *character);
if (spos)
{
int digit = (int)(spos - CharSetHex);
if (shift)
{
value = digit << 4;
}
else
{
value |= digit;
if (currentDataByte >= endDataByte) return err_makeCoreError(ErrorRomIsFull, (int)(character - input));
*currentDataByte = value;
++currentDataByte;
}
shift = !shift;
}
else if (*character != ' ' && *character != '\t' && *character != '\n' && *character != '\r')
{
return err_makeCoreError(ErrorUnexpectedCharacter, (int)(character - input));
}
character++;
}
if (!shift) return err_makeCoreError(ErrorSyntax, (int)(character - input)); // incomplete hex value
int start = (int)(startByte - manager->data);
int length = (int)(currentDataByte - startByte);
entry->start = start;
entry->length = length;
for (int i = entryIndex + 1; i < MAX_ENTRIES; i++)
{
manager->entries[i].start = entry->start + entry->length;
}
}
else if (*character == ' ' || *character == '\t' || *character == '\n' || *character == '\r')
{
character++;
}
else
{
return err_makeCoreError(ErrorUnexpectedCharacter, (int)(character - input));
}
}
return err_noCoreError();
}
char *data_export(struct DataManager *manager)
{
assert(manager);
size_t outputSize = data_calcOutputSize(manager);
if (outputSize > 0)
{
char *output = malloc(outputSize);
if (output)
{
char *current = output;
if (manager->diskSourceCode)
{
size_t len = strlen(manager->diskSourceCode);
if (len > 0)
{
strcpy(current, manager->diskSourceCode);
char endChar = current[len - 1];
current += len;
if (endChar != '\n')
{
// add new line after end of program
current[0] = '\n';
current++;
}
}
}
for (int i = 0; i < MAX_ENTRIES; i++)
{
struct DataEntry *entry = &manager->entries[i];
if (entry->length > 0)
{
sprintf(current, "#%d:%s\n", i, entry->comment);
current += strlen(current);
int valuesInLine = 0;
int pos = 0;
uint8_t *entryData = &manager->data[entry->start];
while (pos < entry->length)
{
sprintf(current, "%02X", entryData[pos]);
current += strlen(current);
pos++;
valuesInLine++;
if (pos == entry->length)
{
sprintf(current, "\n\n");
}
else if (valuesInLine == 16)
{
sprintf(current, "\n");
valuesInLine = 0;
}
current += strlen(current);
}
}
}
}
return output;
}
return NULL;
}
int data_calcOutputSize(struct DataManager *manager)
{
int size = 0;
for (int i = 0; i < MAX_ENTRIES; i++)
{
struct DataEntry *entry = &manager->entries[i];
if (entry->length > 0)
{
size += (i >= 10 ? 4 : 3) + strlen(entry->comment) + 1; // #10:comment\n
size += entry->length * 2; // 2x hex letters
size += entry->length / 16 + 1; // new line every 16 values
size += 1; // new line
}
}
if (manager->diskSourceCode)
{
size += strlen(manager->diskSourceCode) + 1; // possible new line between program and data
}
size += 1; // 0-byte
return size;
}
int data_currentSize(struct DataManager *manager)
{
int size = 0;
for (int i = 0; i < MAX_ENTRIES; i++)
{
size += manager->entries[i].length;
}
return size;
}
bool data_canSetEntry(struct DataManager *manager, int index, int length)
{
int size = 0;
for (int i = 0; i < MAX_ENTRIES; i++)
{
if (i != index)
{
size += manager->entries[i].length;
}
}
return size + length <= DATA_SIZE;
}
void data_setEntry(struct DataManager *manager, int index, const char *comment, uint8_t *source, int length)
{
struct DataEntry *entry = &manager->entries[index];
uint8_t *data = manager->data;
// move data of higher entries
int nextStart = entry->start + length;
assert(nextStart <= DATA_SIZE);
if (length > entry->length) // new entry is bigger
{
int diff = length - entry->length;
for (int i = DATA_SIZE - 1; i >= nextStart; i--)
{
data[i] = data[i - diff];
}
}
else if (length < entry->length) // new entry is smaller
{
int diff = entry->length - length;
for (int i = nextStart; i < DATA_SIZE - diff; i++)
{
data[i] = data[i + diff];
}
for (int i = DATA_SIZE - diff; i < DATA_SIZE; i++)
{
data[i] = 0;
}
}
// write new entry
strncpy(entry->comment, comment, ENTRY_COMMENT_SIZE);
entry->comment[ENTRY_COMMENT_SIZE - 1] = 0;
entry->length = length;
int start = entry->start;
for (int i = 0; i < length; i++)
{
data[i + start] = source[i];
}
// move entry positions
for (int i = index + 1; i < MAX_ENTRIES; i++)
{
struct DataEntry *thisEntry = &manager->entries[i];
struct DataEntry *prevEntry = &manager->entries[i - 1];
thisEntry->start = prevEntry->start + prevEntry->length;
}
}
================================================
FILE: core/datamanager/data_manager.h
================================================
//
// Copyright 2017 Timo Kloss
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
#ifndef data_manager_h
#define data_manager_h
#include <stdio.h>
#include <stdbool.h>
#include <stdint.h>
#include "error.h"
#define MAX_ENTRIES 16
#define DATA_SIZE 0x8000
#define ENTRY_COMMENT_SIZE 32
struct DataEntry {
char comment[ENTRY_COMMENT_SIZE];
int start;
int length;
};
struct DataManager {
struct DataEntry entries[MAX_ENTRIES];
uint8_t *data;
const char *diskSourceCode;
};
void data_init(struct DataManager *manager);
void data_deinit(struct DataManager *manager);
void data_reset(struct DataManager *manager);
struct CoreError data_import(struct DataManager *manager, const char *input, bool keepSourceCode);
struct CoreError data_uppercaseImport(struct DataManager *manager, const char *input, bool keepSourceCode);
char *data_export(struct DataManager *manager);
int data_currentSize(struct DataManager *manager);
bool data_canSetEntry(struct DataManager *manager, int index, int length);
void data_setEntry(struct DataManager *manager, int index, const char *comment, uint8_t *source, int length);
#endif /* data_manager_h */
================================================
FILE: core/interpreter/charsets.c
================================================
//
// Copyright 2017 Timo Kloss
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
#include "charsets.h"
const char *CharSetDigits = "0123456789";
const char *CharSetLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_";
const char *CharSetAlphaNum = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789";
const char *CharSetHex = "0123456789ABCDEF";
================================================
FILE: core/interpreter/charsets.h
================================================
//
// Copyright 2017 Timo Kloss
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
#ifndef charsets_h
#define charsets_h
extern const char *CharSetDigits;
extern const char *CharSetLetters;
extern const char *CharSetAlphaNum;
extern const char *CharSetHex;
#endif /* charsets_h */
================================================
FILE: core/interpreter/cmd_audio.c
================================================
//
// Copyright 2018 Timo Kloss
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
#include "cmd_audio.h"
#include "core.h"
#include "interpreter_utils.h"
enum ErrorCode cmd_SOUND(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// SOUND
++interpreter->pc;
// n value
struct TypedValue nValue = itp_evaluateNumericExpression(core, 0, NUM_VOICES - 1);
if (nValue.type == ValueTypeError) return nValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// wave value
struct TypedValue waveValue = itp_evaluateOptionalNumericExpression(core, 0, 3);
if (waveValue.type == ValueTypeError) return waveValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// pulse width value
struct TypedValue pwValue = itp_evaluateOptionalNumericExpression(core, 0, 15);
if (pwValue.type == ValueTypeError) return pwValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// length value
struct TypedValue lenValue = itp_evaluateOptionalNumericExpression(core, 0, 255);
if (lenValue.type == ValueTypeError) return lenValue.v.errorCode;
if (interpreter->pass == PassRun)
{
int n = nValue.v.floatValue;
struct Voice *voice = &core->machine->audioRegisters.voices[n];
if (waveValue.type != ValueTypeNull)
{
voice->attr.wave = waveValue.v.floatValue;
}
if (pwValue.type != ValueTypeNull)
{
voice->attr.pulseWidth = pwValue.v.floatValue;
}
if (lenValue.type != ValueTypeNull)
{
int len = lenValue.v.floatValue;
voice->length = len;
voice->attr.timeout = (len > 0) ? 1 : 0;
}
}
return itp_endOfCommand(interpreter);
}
//enum ErrorCode cmd_SOUND_COPY(struct Core *core)
//{
// struct Interpreter *interpreter = core->interpreter;
//
// // SOUND COPY
// ++interpreter->pc;
// ++interpreter->pc;
//
// // sound value
// struct TypedValue sValue = itp_evaluateNumericExpression(core, 0, 15);
// if (sValue.type == ValueTypeError) return sValue.v.errorCode;
//
// // TO
// if (interpreter->pc->type != TokenTO) return ErrorSyntax;
// ++interpreter->pc;
//
// // voice value
// struct TypedValue vValue = itp_evaluateNumericExpression(core, 0, NUM_VOICES - 1);
// if (vValue.type == ValueTypeError) return vValue.v.errorCode;
//
// if (interpreter->pass == PassRun)
// {
// audlib_copySound(&interpreter->audioLib, interpreter->audioLib.sourceAddress, sValue.v.floatValue, vValue.v.floatValue);
// }
//
// return itp_endOfCommand(interpreter);
//}
enum ErrorCode cmd_VOLUME(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// VOLUME
++interpreter->pc;
// n value
struct TypedValue nValue = itp_evaluateNumericExpression(core, 0, NUM_VOICES - 1);
if (nValue.type == ValueTypeError) return nValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// volume value
struct TypedValue volValue = itp_evaluateOptionalNumericExpression(core, 0, 15);
if (volValue.type == ValueTypeError) return volValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// mix value
struct TypedValue mixValue = itp_evaluateOptionalNumericExpression(core, 0, 3);
if (mixValue.type == ValueTypeError) return mixValue.v.errorCode;
if (interpreter->pass == PassRun)
{
int n = nValue.v.floatValue;
struct Voice *voice = &core->machine->audioRegisters.voices[n];
if (volValue.type != ValueTypeNull)
{
voice->status.volume = volValue.v.floatValue;
}
if (mixValue.type != ValueTypeNull)
{
int mix = mixValue.v.floatValue;
voice->status.mix = mix;
}
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_ENVELOPE(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// ENVELOPE
++interpreter->pc;
// n value
struct TypedValue nValue = itp_evaluateNumericExpression(core, 0, NUM_VOICES - 1);
if (nValue.type == ValueTypeError) return nValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// attack value
struct TypedValue attValue = itp_evaluateOptionalNumericExpression(core, 0, 15);
if (attValue.type == ValueTypeError) return attValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// decay value
struct TypedValue decValue = itp_evaluateOptionalNumericExpression(core, 0, 15);
if (decValue.type == ValueTypeError) return decValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// sustain value
struct TypedValue susValue = itp_evaluateOptionalNumericExpression(core, 0, 15);
if (susValue.type == ValueTypeError) return susValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// release value
struct TypedValue relValue = itp_evaluateOptionalNumericExpression(core, 0, 15);
if (relValue.type == ValueTypeError) return relValue.v.errorCode;
if (interpreter->pass == PassRun)
{
int n = nValue.v.floatValue;
struct Voice *voice = &core->machine->audioRegisters.voices[n];
if (attValue.type != ValueTypeNull)
{
voice->envA = attValue.v.floatValue;
}
if (decValue.type != ValueTypeNull)
{
voice->envD = decValue.v.floatValue;
}
if (susValue.type != ValueTypeNull)
{
voice->envS = susValue.v.floatValue;
}
if (relValue.type != ValueTypeNull)
{
voice->envR = relValue.v.floatValue;
}
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_LFO(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// LFO
++interpreter->pc;
// n value
struct TypedValue nValue = itp_evaluateNumericExpression(core, 0, NUM_VOICES - 1);
if (nValue.type == ValueTypeError) return nValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// rate value
struct TypedValue rateValue = itp_evaluateOptionalNumericExpression(core, 0, 15);
if (rateValue.type == ValueTypeError) return rateValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// osc amount value
struct TypedValue oscValue = itp_evaluateOptionalNumericExpression(core, 0, 15);
if (oscValue.type == ValueTypeError) return oscValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// vol amount value
struct TypedValue volValue = itp_evaluateOptionalNumericExpression(core, 0, 15);
if (volValue.type == ValueTypeError) return volValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// pw amount value
struct TypedValue pwValue = itp_evaluateOptionalNumericExpression(core, 0, 15);
if (pwValue.type == ValueTypeError) return pwValue.v.errorCode;
if (interpreter->pass == PassRun)
{
int n = nValue.v.floatValue;
struct Voice *voice = &core->machine->audioRegisters.voices[n];
if (rateValue.type != ValueTypeNull)
{
voice->lfoFrequency = rateValue.v.floatValue;
}
if (oscValue.type != ValueTypeNull)
{
voice->lfoOscAmount = oscValue.v.floatValue;
}
if (volValue.type != ValueTypeNull)
{
voice->lfoVolAmount = volValue.v.floatValue;
}
if (pwValue.type != ValueTypeNull)
{
voice->lfoPWAmount = pwValue.v.floatValue;
}
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_LFO_A(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// LFO.A
++interpreter->pc;
// obsolete syntax!
// n value
struct TypedValue nValue = itp_evaluateNumericExpression(core, 0, NUM_VOICES - 1);
if (nValue.type == ValueTypeError) return nValue.v.errorCode;
struct Voice *voice = NULL;
if (interpreter->pass == PassRun)
{
int n = nValue.v.floatValue;
voice = &core->machine->audioRegisters.voices[n];
}
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
union LFOAttributes attr;
if (voice) attr = voice->lfoAttr; else attr.value = 0;
// attr value
struct TypedValue attrValue = itp_evaluateLFOAttributes(core, attr);
if (attrValue.type == ValueTypeError) return attrValue.v.errorCode;
if (interpreter->pass == PassRun)
{
voice->lfoAttr.value = attrValue.v.floatValue;
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_LFO_WAVE(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// LFO WAVE
++interpreter->pc;
++interpreter->pc;
// n value
struct TypedValue nValue = itp_evaluateNumericExpression(core, 0, NUM_VOICES - 1);
if (nValue.type == ValueTypeError) return nValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// wave value
struct TypedValue wavValue = itp_evaluateOptionalNumericExpression(core, 0, 3);
if (wavValue.type == ValueTypeError) return wavValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// inv value
struct TypedValue invValue = itp_evaluateOptionalNumericExpression(core, -1, 1);
if (invValue.type == ValueTypeError) return invValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// env value
struct TypedValue envValue = itp_evaluateOptionalNumericExpression(core, -1, 1);
if (envValue.type == ValueTypeError) return envValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// tri value
struct TypedValue triValue = itp_evaluateOptionalNumericExpression(core, -1, 1);
if (triValue.type == ValueTypeError) return triValue.v.errorCode;
if (interpreter->pass == PassRun)
{
int n = nValue.v.floatValue;
struct Voice *voice = &core->machine->audioRegisters.voices[n];
if (wavValue.type != ValueTypeNull) voice->lfoAttr.wave = wavValue.v.floatValue;
if (invValue.type != ValueTypeNull) voice->lfoAttr.invert = invValue.v.floatValue ? 1 : 0;
if (envValue.type != ValueTypeNull) voice->lfoAttr.envMode = envValue.v.floatValue ? 1 : 0;
if (triValue.type != ValueTypeNull) voice->lfoAttr.trigger = triValue.v.floatValue ? 1 : 0;
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_PLAY(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// PLAY
++interpreter->pc;
// n value
struct TypedValue nValue = itp_evaluateNumericExpression(core, 0, NUM_VOICES - 1);
if (nValue.type == ValueTypeError) return nValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// pitch value
struct TypedValue pValue = itp_evaluateNumericExpression(core, 0, 96);
if (pValue.type == ValueTypeError) return pValue.v.errorCode;
int len = -1;
if (interpreter->pc->type == TokenComma)
{
// comma
++interpreter->pc;
// length value
struct TypedValue lenValue = itp_evaluateNumericExpression(core, 0, 255);
if (lenValue.type == ValueTypeError) return lenValue.v.errorCode;
len = lenValue.v.floatValue;
}
int sound = -1;
if (interpreter->pc->type == TokenSOUND)
{
// SOUND
++interpreter->pc;
// length value
struct TypedValue sValue = itp_evaluateNumericExpression(core, 0, NUM_SOUNDS - 1);
if (sValue.type == ValueTypeError) return sValue.v.errorCode;
sound = sValue.v.floatValue;
}
if (interpreter->pass == PassRun)
{
audlib_play(&core->interpreter->audioLib, nValue.v.floatValue, pValue.v.floatValue, len, sound);
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_STOP(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// STOP
++interpreter->pc;
// n value
struct TypedValue nValue = itp_evaluateOptionalNumericExpression(core, 0, NUM_VOICES - 1);
if (nValue.type == ValueTypeError) return nValue.v.errorCode;
if (interpreter->pass == PassRun)
{
if (nValue.type != ValueTypeNull)
{
int n = nValue.v.floatValue;
audlib_stopVoice(&interpreter->audioLib, n);
}
else
{
audlib_stopAll(&interpreter->audioLib);
}
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_MUSIC(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// MUSIC
++interpreter->pc;
// pattern value
struct TypedValue pValue = itp_evaluateOptionalNumericExpression(core, 0, NUM_PATTERNS - 1);
if (pValue.type == ValueTypeError) return pValue.v.errorCode;
if (interpreter->pass == PassRun)
{
int startPattern = (pValue.type != ValueTypeNull) ? pValue.v.floatValue : 0;
audlib_playMusic(&interpreter->audioLib, startPattern);
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_TRACK(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// TRACK
++interpreter->pc;
// track value
struct TypedValue tValue = itp_evaluateNumericExpression(core, 0, NUM_TRACKS - 1);
if (tValue.type == ValueTypeError) return tValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// voice value
struct TypedValue vValue = itp_evaluateNumericExpression(core, 0, NUM_VOICES - 1);
if (vValue.type == ValueTypeError) return vValue.v.errorCode;
if (interpreter->pass == PassRun)
{
audlib_playTrack(&interpreter->audioLib, tValue.v.floatValue, vValue.v.floatValue);
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_SOUND_SOURCE(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// SOUND
++interpreter->pc;
// SOURCE
++interpreter->pc;
// address value
struct TypedValue aValue = itp_evaluateNumericExpression(core, 0, 0xFFFF);
if (aValue.type == ValueTypeError) return aValue.v.errorCode;
if (interpreter->pass == PassRun)
{
interpreter->audioLib.sourceAddress = aValue.v.floatValue;
}
return itp_endOfCommand(interpreter);
}
struct TypedValue fnc_MUSIC(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// MUSIC
++interpreter->pc;
// bracket open
if (interpreter->pc->type != TokenBracketOpen) return val_makeError(ErrorSyntax);
++interpreter->pc;
// x value
struct TypedValue xValue = itp_evaluateExpression(core, TypeClassNumeric);
if (xValue.type == ValueTypeError) return xValue;
// bracket close
if (interpreter->pc->type != TokenBracketClose) return val_makeError(ErrorSyntax);
++interpreter->pc;
struct TypedValue value;
value.type = ValueTypeFloat;
if (interpreter->pass == PassRun)
{
int x = xValue.v.floatValue;
struct ComposerPlayer *player = &interpreter->audioLib.musicPlayer;
switch (x)
{
case 0:
value.v.floatValue = player->index;
break;
case 1:
value.v.floatValue = player->row;
break;
case 2:
value.v.floatValue = player->tick;
break;
case 3:
value.v.floatValue = player->speed;
break;
default:
return val_makeError(ErrorInvalidParameter);
}
}
return value;
}
================================================
FILE: core/interpreter/cmd_audio.h
================================================
//
// Copyright 2018 Timo Kloss
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
#ifndef cmd_audio_h
#define cmd_audio_h
#include <stdio.h>
#include "error.h"
#include "value.h"
struct Core;
enum ErrorCode cmd_SOUND(struct Core *core);
//enum ErrorCode cmd_SOUND_COPY(struct Core *core);
enum ErrorCode cmd_VOLUME(struct Core *core);
enum ErrorCode cmd_ENVELOPE(struct Core *core);
enum ErrorCode cmd_LFO(struct Core *core);
enum ErrorCode cmd_LFO_A(struct Core *core);
enum ErrorCode cmd_LFO_WAVE(struct Core *core);
enum ErrorCode cmd_PLAY(struct Core *core);
enum ErrorCode cmd_STOP(struct Core *core);
enum ErrorCode cmd_MUSIC(struct Core *core);
enum ErrorCode cmd_TRACK(struct Core *core);
enum ErrorCode cmd_SOUND_SOURCE(struct Core *core);
struct TypedValue fnc_MUSIC(struct Core *core);
#endif /* cmd_audio_h */
================================================
FILE: core/interpreter/cmd_background.c
================================================
//
// Copyright 2017-2019 Timo Kloss
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
#include "cmd_background.h"
#include "core.h"
#include "text_lib.h"
#include "cmd_text.h"
#include "interpreter_utils.h"
#include <assert.h>
#include <math.h>
enum ErrorCode cmd_BG(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// BG
++interpreter->pc;
// bg value
struct TypedValue bgValue = itp_evaluateNumericExpression(core, 0, 1);
if (bgValue.type == ValueTypeError) return bgValue.v.errorCode;
if (interpreter->pass == PassRun)
{
interpreter->textLib.bg = bgValue.v.floatValue;
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_BG_SOURCE(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// BG SOURCE
++interpreter->pc;
++interpreter->pc;
// address value
struct TypedValue aValue = itp_evaluateNumericExpression(core, 0, 0xFFFF);
if (aValue.type == ValueTypeError) return aValue.v.errorCode;
int w = 0;
if (interpreter->pc->type == TokenComma)
{
// comma
++interpreter->pc;
// width value
struct TypedValue wValue = itp_evaluateNumericExpression(core, 1, 0xFFFF);
if (wValue.type == ValueTypeError) return wValue.v.errorCode;
w = wValue.v.floatValue;
}
int h = 0;
if (interpreter->pc->type == TokenComma)
{
// comma
++interpreter->pc;
// height value
struct TypedValue hValue = itp_evaluateNumericExpression(core, 1, 0xFFFF);
if (hValue.type == ValueTypeError) return hValue.v.errorCode;
h = hValue.v.floatValue;
}
if (interpreter->pass == PassRun)
{
int address = aValue.v.floatValue;
if (w > 0)
{
core->interpreter->textLib.sourceAddress = address;
core->interpreter->textLib.sourceWidth = w;
core->interpreter->textLib.sourceHeight = h;
}
else
{
// data with preceding size (W x H)
core->interpreter->textLib.sourceAddress = address + 4;
core->interpreter->textLib.sourceWidth = machine_peek(core, address + 2);
core->interpreter->textLib.sourceHeight = machine_peek(core, address + 3);
}
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_BG_COPY(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// BG COPY
++interpreter->pc;
++interpreter->pc;
// src X value
struct TypedValue srcXValue = itp_evaluateNumericExpression(core, 0, 0xFFFF);
if (srcXValue.type == ValueTypeError) return srcXValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// src Y value
struct TypedValue srcYValue = itp_evaluateNumericExpression(core, 0, 0xFFFF);
if (srcYValue.type == ValueTypeError) return srcYValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// width value
struct TypedValue wValue = itp_evaluateNumericExpression(core, 0, PLANE_COLUMNS);
if (wValue.type == ValueTypeError) return wValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// height value
struct TypedValue hValue = itp_evaluateNumericExpression(core, 0, PLANE_ROWS);
if (hValue.type == ValueTypeError) return hValue.v.errorCode;
// TO
if (interpreter->pc->type != TokenTO) return ErrorSyntax;
++interpreter->pc;
// dst X value
struct TypedValue dstXValue = itp_evaluateExpression(core, TypeClassNumeric);
if (dstXValue.type == ValueTypeError) return dstXValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// dst Y value
struct TypedValue dstYValue = itp_evaluateExpression(core, TypeClassNumeric);
if (dstYValue.type == ValueTypeError) return dstYValue.v.errorCode;
if (interpreter->pass == PassRun)
{
txtlib_copyBackground(&interpreter->textLib, srcXValue.v.floatValue, srcYValue.v.floatValue, wValue.v.floatValue, hValue.v.floatValue, dstXValue.v.floatValue, dstYValue.v.floatValue);
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_BG_SCROLL(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// BG SCROLL
++interpreter->pc;
++interpreter->pc;
// x1 value
struct TypedValue x1Value = itp_evaluateNumericExpression(core, 0, PLANE_COLUMNS - 1);
if (x1Value.type == ValueTypeError) return x1Value.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// y1 value
struct TypedValue y1Value = itp_evaluateNumericExpression(core, 0, PLANE_ROWS - 1);
if (y1Value.type == ValueTypeError) return y1Value.v.errorCode;
// TO
if (interpreter->pc->type != TokenTO) return ErrorSyntax;
++interpreter->pc;
// x2 value
struct TypedValue x2Value = itp_evaluateNumericExpression(core, 0, PLANE_COLUMNS - 1);
if (x2Value.type == ValueTypeError) return x2Value.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// y2 value
struct TypedValue y2Value = itp_evaluateNumericExpression(core, 0, PLANE_ROWS - 1);
if (y2Value.type == ValueTypeError) return y2Value.v.errorCode;
// STEP
if (interpreter->pc->type != TokenSTEP) return ErrorSyntax;
++interpreter->pc;
// dx value
struct TypedValue dxValue = itp_evaluateExpression(core, TypeClassNumeric);
if (dxValue.type == ValueTypeError) return dxValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// dy value
struct TypedValue dyValue = itp_evaluateExpression(core, TypeClassNumeric);
if (dyValue.type == ValueTypeError) return dyValue.v.errorCode;
if (interpreter->pass == PassRun)
{
txtlib_scrollBackground(&interpreter->textLib, x1Value.v.floatValue, y1Value.v.floatValue, x2Value.v.floatValue, y2Value.v.floatValue, dxValue.v.floatValue, dyValue.v.floatValue);
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_ATTR(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// ATTR
++interpreter->pc;
// attributes value
struct TypedValue aValue = itp_evaluateCharAttributes(core, interpreter->textLib.charAttr);
if (aValue.type == ValueTypeError) return aValue.v.errorCode;
if (interpreter->pass == PassRun)
{
interpreter->textLib.charAttr.value = aValue.v.floatValue;
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_PAL(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// PAL
++interpreter->pc;
// value
struct TypedValue value = itp_evaluateNumericExpression(core, 0, NUM_PALETTES - 1);
if (value.type == ValueTypeError) return value.v.errorCode;
if (interpreter->pass == PassRun)
{
interpreter->textLib.charAttr.palette = value.v.floatValue;
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_FLIP(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// FLIP
++interpreter->pc;
// x value
struct TypedValue fxValue = itp_evaluateNumericExpression(core, -1, 1);
if (fxValue.type == ValueTypeError) return fxValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// y value
struct TypedValue fyValue = itp_evaluateNumericExpression(core, -1, 1);
if (fyValue.type == ValueTypeError) return fyValue.v.errorCode;
if (interpreter->pass == PassRun)
{
interpreter->textLib.charAttr.flipX = fxValue.v.floatValue ? 1 : 0;
interpreter->textLib.charAttr.flipY = fyValue.v.floatValue ? 1 : 0;
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_PRIO(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// PRIO
++interpreter->pc;
// value
struct TypedValue value = itp_evaluateNumericExpression(core, -1, 1);
if (value.type == ValueTypeError) return value.v.errorCode;
if (interpreter->pass == PassRun)
{
interpreter->textLib.charAttr.priority = value.v.floatValue ? 1 : 0;
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_BG_FILL(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// BG FILL
++interpreter->pc;
++interpreter->pc;
// x1 value
struct TypedValue x1Value = itp_evaluateExpression(core, TypeClassNumeric);
if (x1Value.type == ValueTypeError) return x1Value.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// y1 value
struct TypedValue y1Value = itp_evaluateExpression(core, TypeClassNumeric);
if (y1Value.type == ValueTypeError) return y1Value.v.errorCode;
// TO
if (interpreter->pc->type != TokenTO) return ErrorSyntax;
++interpreter->pc;
// x2 value
struct TypedValue x2Value = itp_evaluateExpression(core, TypeClassNumeric);
if (x2Value.type == ValueTypeError) return x2Value.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// y2 value
struct TypedValue y2Value = itp_evaluateExpression(core, TypeClassNumeric);
if (y2Value.type == ValueTypeError) return y2Value.v.errorCode;
// CHAR
if (interpreter->pc->type == TokenCHAR)
{
++interpreter->pc;
// write character with current attributes
// character value
struct TypedValue cValue = itp_evaluateNumericExpression(core, 0, NUM_CHARACTERS - 1);
if (cValue.type == ValueTypeError) return cValue.v.errorCode;
if (interpreter->pass == PassRun)
{
txtlib_setCells(&interpreter->textLib, floorf(x1Value.v.floatValue), floorf(y1Value.v.floatValue), floorf(x2Value.v.floatValue), floorf(y2Value.v.floatValue), cValue.v.floatValue);
}
}
else
{
// write current attributes (obsolete syntax!)
if (interpreter->pass == PassRun)
{
txtlib_setCells(&interpreter->textLib, floorf(x1Value.v.floatValue), floorf(y1Value.v.floatValue), floorf(x2Value.v.floatValue), floorf(y2Value.v.floatValue), -1);
}
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_BG_TINT(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// BG TINT
++interpreter->pc;
++interpreter->pc;
// x1 value
struct TypedValue x1Value = itp_evaluateExpression(core, TypeClassNumeric);
if (x1Value.type == ValueTypeError) return x1Value.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// y1 value
struct TypedValue y1Value = itp_evaluateExpression(core, TypeClassNumeric);
if (y1Value.type == ValueTypeError) return y1Value.v.errorCode;
// TO
if (interpreter->pc->type != TokenTO) return ErrorSyntax;
++interpreter->pc;
// x2 value
struct TypedValue x2Value = itp_evaluateExpression(core, TypeClassNumeric);
if (x2Value.type == ValueTypeError) return x2Value.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// y2 value
struct TypedValue y2Value = itp_evaluateExpression(core, TypeClassNumeric);
if (y2Value.type == ValueTypeError) return y2Value.v.errorCode;
struct SimpleAttributes attrs;
enum ErrorCode attrsError = itp_evaluateSimpleAttributes(core, &attrs);
if (attrsError != ErrorNone) return attrsError;
if (interpreter->pass == PassRun)
{
txtlib_setCellsAttr(&interpreter->textLib, floorf(x1Value.v.floatValue), floorf(y1Value.v.floatValue), floorf(x2Value.v.floatValue), floorf(y2Value.v.floatValue), attrs.pal, attrs.flipX, attrs.flipY, attrs.prio);
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_CELL(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// CELL
++interpreter->pc;
// x value
struct TypedValue xValue = itp_evaluateExpression(core, TypeClassNumeric);
if (xValue.type == ValueTypeError) return xValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// y value
struct TypedValue yValue = itp_evaluateExpression(core, TypeClassNumeric);
if (yValue.type == ValueTypeError) return yValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// character value
struct TypedValue cValue = itp_evaluateOptionalNumericExpression(core, 0, NUM_CHARACTERS - 1);
if (cValue.type == ValueTypeError) return cValue.v.errorCode;
if (interpreter->pass == PassRun)
{
int c = (cValue.type == ValueTypeFloat) ? cValue.v.floatValue : -1;
txtlib_setCell(&interpreter->textLib, floorf(xValue.v.floatValue), floorf(yValue.v.floatValue), c);
}
return itp_endOfCommand(interpreter);
}
struct TypedValue fnc_CELL(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// CELL.?
enum TokenType type = interpreter->pc->type;
++interpreter->pc;
// bracket open
if (interpreter->pc->type != TokenBracketOpen) return val_makeError(ErrorSyntax);
++interpreter->pc;
// x value
struct TypedValue xValue = itp_evaluateExpression(core, TypeClassNumeric);
if (xValue.type == ValueTypeError) return xValue;
// comma
if (interpreter->pc->type != TokenComma) return val_makeError(ErrorSyntax);
++interpreter->pc;
// y value
struct TypedValue yValue = itp_evaluateExpression(core, TypeClassNumeric);
if (yValue.type == ValueTypeError) return yValue;
// bracket close
if (interpreter->pc->type != TokenBracketClose) return val_makeError(ErrorSyntax);
++interpreter->pc;
struct TypedValue value;
value.type = ValueTypeFloat;
if (interpreter->pass == PassRun)
{
struct Cell *cell = txtlib_getCell(&interpreter->textLib, floorf(xValue.v.floatValue), floorf(yValue.v.floatValue));
if (type == TokenCELLA)
{
value.v.floatValue = cell->attr.value;
}
else if (type == TokenCELLC)
{
value.v.floatValue = cell->character;
}
else
{
assert(0);
}
}
return value;
}
enum ErrorCode cmd_MCELL(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// MCELL
++interpreter->pc;
// x value
struct TypedValue xValue = itp_evaluateNumericExpression(core, 0, interpreter->textLib.sourceWidth - 1);
if (xValue.type == ValueTypeError) return xValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// y value
struct TypedValue yValue = itp_evaluateNumericExpression(core, 0, interpreter->textLib.sourceHeight - 1);
if (yValue.type == ValueTypeError) return yValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// character value
struct TypedValue cValue = itp_evaluateOptionalNumericExpression(core, 0, NUM_CHARACTERS - 1);
if (cValue.type == ValueTypeError) return cValue.v.errorCode;
if (interpreter->pass == PassRun)
{
int c = (cValue.type == ValueTypeFloat) ? cValue.v.floatValue : -1;
bool success = txtlib_setSourceCell(&interpreter->textLib, xValue.v.floatValue, yValue.v.floatValue, c);
if (!success) return ErrorIllegalMemoryAccess;
}
return itp_endOfCommand(interpreter);
}
struct TypedValue fnc_MCELL(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// MCELL.?
enum TokenType type = interpreter->pc->type;
++interpreter->pc;
// bracket open
if (interpreter->pc->type != TokenBracketOpen) return val_makeError(ErrorSyntax);
++interpreter->pc;
// x value
struct TypedValue xValue = itp_evaluateExpression(core, TypeClassNumeric);
if (xValue.type == ValueTypeError) return xValue;
// comma
if (interpreter->pc->type != TokenComma) return val_makeError(ErrorSyntax);
++interpreter->pc;
// y value
struct TypedValue yValue = itp_evaluateExpression(core, TypeClassNumeric);
if (yValue.type == ValueTypeError) return yValue;
// bracket close
if (interpreter->pc->type != TokenBracketClose) return val_makeError(ErrorSyntax);
++interpreter->pc;
struct TypedValue value;
value.type = ValueTypeFloat;
if (interpreter->pass == PassRun)
{
int x = floorf(xValue.v.floatValue);
int y = floorf(yValue.v.floatValue);
value.v.floatValue = txtlib_getSourceCell(&interpreter->textLib, x, y, (type == TokenMCELLA));
}
return value;
}
enum ErrorCode cmd_TINT(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// TINT
++interpreter->pc;
// x value
struct TypedValue xValue = itp_evaluateExpression(core, TypeClassNumeric);
if (xValue.type == ValueTypeError) return xValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// y value
struct TypedValue yValue = itp_evaluateExpression(core, TypeClassNumeric);
if (yValue.type == ValueTypeError) return yValue.v.errorCode;
struct SimpleAttributes attrs;
enum ErrorCode attrsError = itp_evaluateSimpleAttributes(core, &attrs);
if (attrsError != ErrorNone) return attrsError;
if (interpreter->pass == PassRun)
{
struct Cell *cell = txtlib_getCell(&interpreter->textLib, floorf(xValue.v.floatValue), floorf(yValue.v.floatValue));
if (attrs.pal >= 0) cell->attr.palette = attrs.pal;
if (attrs.flipX >= 0) cell->attr.flipX = attrs.flipX;
if (attrs.flipY >= 0) cell->attr.flipY = attrs.flipY;
if (attrs.prio >= 0) cell->attr.priority = attrs.prio;
}
return itp_endOfCommand(interpreter);
}
================================================
FILE: core/interpreter/cmd_background.h
================================================
//
// Copyright 2017-2019 Timo Kloss
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
#ifndef cmd_background_h
#define cmd_background_h
#include <stdio.h>
#include "error.h"
#include "value.h"
struct Core;
enum ErrorCode cmd_BG(struct Core *core);
enum ErrorCode cmd_BG_SOURCE(struct Core *core);
enum ErrorCode cmd_BG_COPY(struct Core *core);
enum ErrorCode cmd_BG_SCROLL(struct Core *core);
enum ErrorCode cmd_ATTR(struct Core *core);
enum ErrorCode cmd_PAL(struct Core *core);
enum ErrorCode cmd_FLIP(struct Core *core);
enum ErrorCode cmd_PRIO(struct Core *core);
enum ErrorCode cmd_BG_FILL(struct Core *core);
enum ErrorCode cmd_BG_TINT(struct Core *core);
enum ErrorCode cmd_CELL(struct Core *core);
struct TypedValue fnc_CELL(struct Core *core);
enum ErrorCode cmd_MCELL(struct Core *core);
struct TypedValue fnc_MCELL(struct Core *core);
enum ErrorCode cmd_TINT(struct Core *core);
#endif /* cmd_background_h */
================================================
FILE: core/interpreter/cmd_control.c
================================================
//
// Copyright 2017-2020 Timo Kloss
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
#include "cmd_control.h"
#include "core.h"
#include <assert.h>
enum ErrorCode cmd_END(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
if (interpreter->pass == PassRun && interpreter->mode == ModeInterrupt) return ErrorNotAllowedInInterrupt;
// END
++interpreter->pc;
if (interpreter->pass == PassRun)
{
itp_endProgram(core);
return ErrorNone;
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_IF(struct Core *core, bool isAfterBlockElse)
{
struct Interpreter *interpreter = core->interpreter;
// IF
struct Token *tokenIF = interpreter->pc;
++interpreter->pc;
// Expression
struct TypedValue value = itp_evaluateExpression(core, TypeClassNumeric);
if (value.type == ValueTypeError) return value.v.errorCode;
// THEN
if (interpreter->pc->type != TokenTHEN) return ErrorSyntax;
++interpreter->pc;
if (interpreter->pass == PassPrepare)
{
if (interpreter->pc->type == TokenEol)
{
// IF block
if (interpreter->isSingleLineIf) return ErrorExpectedCommand;
enum ErrorCode errorCode = lab_pushLabelStackItem(interpreter, isAfterBlockElse ? LabelTypeELSEIF : LabelTypeIF, tokenIF);
if (errorCode != ErrorNone) return errorCode;
// Eol
++interpreter->pc;
}
else
{
// single line IF
interpreter->isSingleLineIf = true;
struct Token *token = interpreter->pc;
while (token->type != TokenEol && token->type != TokenELSE)
{
token++;
}
tokenIF->jumpToken = token + 1; // after ELSE or Eol
}
}
else if (interpreter->pass == PassRun)
{
if (value.v.floatValue == 0)
{
interpreter->pc = tokenIF->jumpToken; // after ELSE or END IF, or Eol for single line
}
}
return ErrorNone;
}
enum ErrorCode cmd_ELSE(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// ELSE
struct Token *tokenELSE = interpreter->pc;
++interpreter->pc;
if (interpreter->pass == PassPrepare)
{
if (interpreter->isSingleLineIf)
{
if (interpreter->pc->type == TokenEol) return ErrorExpectedCommand;
struct Token *token = interpreter->pc;
while (token->type != TokenEol)
{
token++;
}
tokenELSE->jumpToken = token + 1; // after Eol
}
else
{
struct LabelStackItem *item = lab_popLabelStackItem(interpreter);
if (!item) return ErrorElseWithoutIf;
if (item->type == LabelTypeIF)
{
item->token->jumpToken = interpreter->pc;
}
else if (item->type == LabelTypeELSEIF)
{
item->token->jumpToken = interpreter->pc;
item = lab_popLabelStackItem(interpreter);
assert(item->type == LabelTypeELSE);
item->token->jumpToken = tokenELSE;
}
else
{
return ErrorElseWithoutIf;
}
enum ErrorCode errorCode = lab_pushLabelStackItem(interpreter, LabelTypeELSE, tokenELSE);
if (errorCode != ErrorNone) return errorCode;
if (interpreter->pc->type == TokenIF)
{
return cmd_IF(core, true);
}
else
{
// Eol
if (interpreter->pc->type != TokenEol) return ErrorSyntax;
++interpreter->pc;
}
}
}
else if (interpreter->pass == PassRun)
{
interpreter->pc = tokenELSE->jumpToken; // after END IF, or Eol for single line
}
return ErrorNone;
}
enum ErrorCode cmd_END_IF(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// END IF
++interpreter->pc;
++interpreter->pc;
if (interpreter->pass == PassPrepare)
{
struct LabelStackItem *item = lab_popLabelStackItem(interpreter);
if (!item)
{
return ErrorEndIfWithoutIf;
}
else if (item->type == LabelTypeIF || item->type == LabelTypeELSE)
{
item->token->jumpToken = interpreter->pc;
}
else if (item->type == LabelTypeELSEIF)
{
item->token->jumpToken = interpreter->pc;
item = lab_popLabelStackItem(interpreter);
assert(item->type == LabelTypeELSE);
item->token->jumpToken = interpreter->pc;
}
else
{
return ErrorEndIfWithoutIf;
}
}
// Eol
if (interpreter->pc->type != TokenEol) return ErrorSyntax;
++interpreter->pc;
return ErrorNone;
}
enum ErrorCode cmd_FOR(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// FOR
struct Token *tokenFOR = interpreter->pc;
++interpreter->pc;
// Variable
struct Token *tokenFORVar = interpreter->pc;
enum ErrorCode errorCode = ErrorNone;
enum ValueType valueType = ValueTypeNull;
union Value *varValue = itp_readVariable(core, &valueType, &errorCode, true);
if (!varValue) return errorCode;
if (valueType != ValueTypeFloat) return ErrorTypeMismatch;
// Eq
if (interpreter->pc->type != TokenEq) return ErrorSyntax;
++interpreter->pc;
// start value
struct TypedValue startValue = itp_evaluateExpression(core, TypeClassNumeric);
if (startValue.type == ValueTypeError) return startValue.v.errorCode;
// TO
if (interpreter->pc->type != TokenTO) return ErrorSyntax;
++interpreter->pc;
// limit value
struct Token *tokenFORLimit = interpreter->pc;
struct TypedValue limitValue = itp_evaluateExpression(core, TypeClassNumeric);
if (limitValue.type == ValueTypeError) return limitValue.v.errorCode;
// STEP
struct TypedValue stepValue;
if (interpreter->pc->type == TokenSTEP)
{
++interpreter->pc;
// step value
stepValue = itp_evaluateExpression(core, TypeClassNumeric);
if (stepValue.type == ValueTypeError) return stepValue.v.errorCode;
}
else
{
stepValue.type = ValueTypeFloat;
stepValue.v.floatValue = 1.0f;
}
if (interpreter->pass == PassPrepare)
{
lab_pushLabelStackItem(interpreter, LabelTypeFORLimit, tokenFORLimit);
lab_pushLabelStackItem(interpreter, LabelTypeFORVar, tokenFORVar);
enum ErrorCode errorCode = lab_pushLabelStackItem(interpreter, LabelTypeFOR, tokenFOR);
if (errorCode != ErrorNone) return errorCode;
// Eol
if (interpreter->pc->type != TokenEol) return ErrorSyntax;
++interpreter->pc;
}
else if (interpreter->pass == PassRun)
{
varValue->floatValue = startValue.v.floatValue;
// limit check
if ((stepValue.v.floatValue > 0 && varValue->floatValue > limitValue.v.floatValue) || (stepValue.v.floatValue < 0 && varValue->floatValue < limitValue.v.floatValue))
{
interpreter->pc = tokenFOR->jumpToken; // after NEXT's Eol
}
else
{
// Eol
if (interpreter->pc->type != TokenEol) return ErrorSyntax;
++interpreter->pc;
}
}
return ErrorNone;
}
enum ErrorCode cmd_NEXT(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
struct LabelStackItem *itemFORLimit = NULL;
struct LabelStackItem *itemFORVar = NULL;
struct LabelStackItem *itemFOR = NULL;
if (interpreter->pass == PassPrepare)
{
itemFOR = lab_popLabelStackItem(interpreter);
if (!itemFOR || itemFOR->type != LabelTypeFOR) return ErrorNextWithoutFor;
itemFORVar = lab_popLabelStackItem(interpreter);
assert(itemFORVar && itemFORVar->type == LabelTypeFORVar);
itemFORLimit = lab_popLabelStackItem(interpreter);
assert(itemFORLimit && itemFORLimit->type == LabelTypeFORLimit);
}
// NEXT
struct Token *tokenNEXT = interpreter->pc;
++interpreter->pc;
// Variable
enum ErrorCode errorCode = ErrorNone;
struct Token *tokenVar = interpreter->pc;
enum ValueType valueType = ValueTypeNull;
union Value *varValue = itp_readVariable(core, &valueType, &errorCode, true);
if (!varValue) return errorCode;
if (valueType != ValueTypeFloat) return ErrorTypeMismatch;
if (interpreter->pass == PassPrepare)
{
if (tokenVar->symbolIndex != itemFORVar->token->symbolIndex) return ErrorNextWithoutFor;
}
// Eol
if (interpreter->pc->type != TokenEol) return ErrorSyntax;
++interpreter->pc;
if (interpreter->pass == PassPrepare)
{
itemFOR->token->jumpToken = interpreter->pc;
tokenNEXT->jumpToken = itemFORLimit->token;
}
else if (interpreter->pass == PassRun)
{
struct Token *storedPc = interpreter->pc;
interpreter->pc = tokenNEXT->jumpToken;
// limit value
struct TypedValue limitValue = itp_evaluateExpression(core, TypeClassNumeric);
if (limitValue.type == ValueTypeError) return limitValue.v.errorCode;
// STEP
struct TypedValue stepValue;
if (interpreter->pc->type == TokenSTEP)
{
++interpreter->pc;
// step value
stepValue = itp_evaluateExpression(core, TypeClassNumeric);
if (stepValue.type == ValueTypeError) return stepValue.v.errorCode;
}
else
{
stepValue.type = ValueTypeFloat;
stepValue.v.floatValue = 1.0f;
}
// Eol
if (interpreter->pc->type != TokenEol) return ErrorSyntax;
++interpreter->pc;
varValue->floatValue += stepValue.v.floatValue;
// limit check
if ((stepValue.v.floatValue > 0 && varValue->floatValue > limitValue.v.floatValue) || (stepValue.v.floatValue < 0 && varValue->floatValue < limitValue.v.floatValue))
{
interpreter->pc = storedPc; // after NEXT's Eol
}
}
return ErrorNone;
}
enum ErrorCode cmd_GOTO(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// GOTO
struct Token *tokenGOTO = interpreter->pc;
++interpreter->pc;
// Identifier
if (interpreter->pc->type != TokenIdentifier) return ErrorExpectedLabel;
struct Token *tokenIdentifier = interpreter->pc;
++interpreter->pc;
if (interpreter->pass == PassPrepare)
{
struct JumpLabelItem *item = tok_getJumpLabel(&interpreter->tokenizer, tokenIdentifier->symbolIndex);
if (!item) return ErrorUndefinedLabel;
tokenGOTO->jumpToken = item->token;
return itp_endOfCommand(interpreter);
}
else if (interpreter->pass == PassRun)
{
interpreter->pc = tokenGOTO->jumpToken; // after label
}
return ErrorNone;
}
enum ErrorCode cmd_GOSUB(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// GOSUB
struct Token *tokenGOSUB = interpreter->pc;
++interpreter->pc;
// Identifier
if (interpreter->pc->type != TokenIdentifier) return ErrorExpectedLabel;
struct Token *tokenIdentifier = interpreter->pc;
++interpreter->pc;
if (interpreter->pass == PassPrepare)
{
struct JumpLabelItem *item = tok_getJumpLabel(&interpreter->tokenizer, tokenIdentifier->symbolIndex);
if (!item) return ErrorUndefinedLabel;
tokenGOSUB->jumpToken = item->token;
return itp_endOfCommand(interpreter);
}
else if (interpreter->pass == PassRun)
{
enum ErrorCode errorCode = lab_pushLabelStackItem(interpreter, LabelTypeGOSUB, interpreter->pc);
if (errorCode != ErrorNone) return errorCode;
interpreter->pc = tokenGOSUB->jumpToken; // after label
}
return ErrorNone;
}
enum ErrorCode cmd_RETURN(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// RETURN
struct Token *tokenRETURN = interpreter->pc;
++interpreter->pc;
// Identifier
struct Token *tokenIdentifier = NULL;
if (interpreter->pc->type == TokenIdentifier)
{
tokenIdentifier = interpreter->pc;
++interpreter->pc;
}
if (interpreter->pass == PassPrepare)
{
if (tokenIdentifier)
{
struct JumpLabelItem *item = tok_getJumpLabel(&interpreter->tokenizer, tokenIdentifier->symbolIndex);
if (!item) return ErrorUndefinedLabel;
tokenRETURN->jumpToken = item->token;
}
}
else if (interpreter->pass == PassRun)
{
struct LabelStackItem *itemGOSUB = lab_popLabelStackItem(interpreter);
if (!itemGOSUB) return ErrorReturnWithoutGosub;
if (itemGOSUB->type == LabelTypeGOSUB)
{
if (tokenRETURN->jumpToken)
{
// jump to label
interpreter->pc = tokenRETURN->jumpToken; // after label
// clear stack
interpreter->numLabelStackItems = 0;
}
else
{
// jump back
interpreter->pc = itemGOSUB->token; // after GOSUB
}
}
else
{
return ErrorReturnWithoutGosub;
}
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_WAIT(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
if (interpreter->pass == PassRun && interpreter->mode == ModeInterrupt) return ErrorNotAllowedInInterrupt;
// WAIT
++interpreter->pc;
int wait = 0;
if (interpreter->pc->type == TokenVBL)
{
// VBL
++interpreter->pc;
}
else
{
// value
struct TypedValue value = itp_evaluateNumericExpression(core, 1, 0xFFFF);
if (value.type == ValueTypeError) return value.v.errorCode;
wait = value.v.floatValue - 1;
}
if (interpreter->pass == PassRun)
{
interpreter->exitEvaluation = true;
interpreter->waitCount = wait;
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_ON(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// ON
++interpreter->pc;
// RASTER/VBL
enum TokenType type = interpreter->pc->type;
if (type != TokenRASTER && type != TokenVBL) return ErrorSyntax;
++interpreter->pc;
if (interpreter->pc->type == TokenOFF)
{
// OFF
++interpreter->pc;
if (interpreter->pass == PassRun)
{
if (type == TokenRASTER)
{
interpreter->currentOnRasterToken = NULL;
}
else if (type == TokenVBL)
{
interpreter->currentOnVBLToken = NULL;
}
}
}
else
{
// CALL
if (interpreter->pc->type != TokenCALL) return ErrorSyntax;
struct Token *tokenCALL = interpreter->pc;
++interpreter->pc;
// Identifier
if (interpreter->pc->type != TokenIdentifier) return ErrorExpectedSubprogramName;
struct Token *tokenIdentifier = interpreter->pc;
++interpreter->pc;
if (interpreter->pass == PassPrepare)
{
struct SubItem *item = tok_getSub(&interpreter->tokenizer, tokenIdentifier->symbolIndex);
if (!item) return ErrorUndefinedSubprogram;
tokenCALL->jumpToken = item->token;
}
else if (interpreter->pass == PassRun)
{
if (type == TokenRASTER)
{
interpreter->currentOnRasterToken = tokenCALL->jumpToken;
}
else if (type == TokenVBL)
{
interpreter->currentOnVBLToken = tokenCALL->jumpToken;
}
}
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_DO(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// DO
struct Token *tokenDO = interpreter->pc;
++interpreter->pc;
if (interpreter->pass == PassPrepare)
{
enum ErrorCode errorCode = lab_pushLabelStackItem(interpreter, LabelTypeDO, tokenDO);
if (errorCode != ErrorNone) return errorCode;
}
// Eol
if (interpreter->pc->type != TokenEol) return ErrorSyntax;
++interpreter->pc;
return ErrorNone;
}
enum ErrorCode cmd_LOOP(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// LOOP
struct Token *tokenLOOP = interpreter->pc;
++interpreter->pc;
if (interpreter->pass == PassPrepare)
{
struct LabelStackItem *item = lab_popLabelStackItem(interpreter);
if (!item || item->type != LabelTypeDO) return ErrorLoopWithoutDo;
tokenLOOP->jumpToken = item->token + 1;
item->token->jumpToken = tokenLOOP + 1;
// Eol
if (interpreter->pc->type != TokenEol) return ErrorSyntax;
++interpreter->pc;
}
else if (interpreter->pass == PassRun)
{
interpreter->pc = tokenLOOP->jumpToken; // after DO
}
return ErrorNone;
}
enum ErrorCode cmd_REPEAT(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// REPEAT
struct Token *tokenREPEAT = interpreter->pc;
++interpreter->pc;
if (interpreter->pass == PassPrepare)
{
enum ErrorCode errorCode = lab_pushLabelStackItem(interpreter, LabelTypeREPEAT, tokenREPEAT);
if (errorCode != ErrorNone) return errorCode;
}
// Eol
if (interpreter->pc->type != TokenEol) return ErrorSyntax;
++interpreter->pc;
return ErrorNone;
}
enum ErrorCode cmd_UNTIL(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// UNTIL
struct Token *tokenUNTIL = interpreter->pc;
++interpreter->pc;
// Expression
struct TypedValue value = itp_evaluateExpression(core, TypeClassNumeric);
if (value.type == ValueTypeError) return value.v.errorCode;
if (interpreter->pass == PassPrepare)
{
struct LabelStackItem *item = lab_popLabelStackItem(interpreter);
if (!item || item->type != LabelTypeREPEAT) return ErrorUntilWithoutRepeat;
tokenUNTIL->jumpToken = item->token + 1;
item->token->jumpToken = interpreter->pc;
// Eol
if (interpreter->pc->type != TokenEol) return ErrorSyntax;
++interpreter->pc;
}
else if (interpreter->pass == PassRun)
{
if (value.v.floatValue == 0)
{
interpreter->pc = tokenUNTIL->jumpToken; // after REPEAT
}
else
{
// Eol
if (interpreter->pc->type != TokenEol) return ErrorSyntax;
++interpreter->pc;
}
}
return ErrorNone;
}
enum ErrorCode cmd_WHILE(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// WHILE
struct Token *tokenWHILE = interpreter->pc;
++interpreter->pc;
if (interpreter->pass == PassPrepare)
{
enum ErrorCode errorCode = lab_pushLabelStackItem(interpreter, LabelTypeWHILE, tokenWHILE);
if (errorCode != ErrorNone) return errorCode;
}
// Expression
struct TypedValue value = itp_evaluateExpression(core, TypeClassNumeric);
if (value.type == ValueTypeError) return value.v.errorCode;
// Eol
if (interpreter->pc->type != TokenEol) return ErrorSyntax;
++interpreter->pc;
if (interpreter->pass == PassRun)
{
if (value.v.floatValue == 0)
{
interpreter->pc = tokenWHILE->jumpToken; // after WEND
}
}
return ErrorNone;
}
enum ErrorCode cmd_WEND(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// WEND
struct Token *tokenWEND = interpreter->pc;
++interpreter->pc;
if (interpreter->pass == PassPrepare)
{
struct LabelStackItem *item = lab_popLabelStackItem(interpreter);
if (!item || item->type != LabelTypeWHILE) return ErrorWendWithoutWhile;
tokenWEND->jumpToken = item->token;
item->token->jumpToken = tokenWEND + 1;
// Eol
if (interpreter->pc->type != TokenEol) return ErrorSyntax;
++interpreter->pc;
}
else if (interpreter->pass == PassRun)
{
interpreter->pc = tokenWEND->jumpToken; // on WHILE
}
return ErrorNone;
}
enum ErrorCode cmd_EXIT(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// EXIT
struct Token *tokenEXIT = interpreter->pc;
++interpreter->pc;
if (interpreter->pass == PassPrepare)
{
enum LabelType types[] = {LabelTypeFOR, LabelTypeDO, LabelTypeWHILE, LabelTypeREPEAT};
struct LabelStackItem *item = lab_searchLabelStackItem(interpreter, types, 4);
if (!item) return ErrorExitNotInsideLoop;
tokenEXIT->jumpToken = item->token;
return itp_endOfCommand(interpreter);
}
else if (interpreter->pass == PassRun)
{
interpreter->pc = tokenEXIT->jumpToken->jumpToken;
}
return ErrorNone;
}
enum ErrorCode cmd_SYSTEM(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// SYSTEM
++interpreter->pc;
// type value
struct TypedValue tValue = itp_evaluateNumericExpression(core, 0, 0);
if (tValue.type == ValueTypeError) return tValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// setting value
struct TypedValue sValue = itp_evaluateExpression(core, TypeClassNumeric);
if (sValue.type == ValueTypeError) return sValue.v.errorCode;
if (interpreter->pass == PassRun)
{
switch ((int)tValue.v.floatValue)
{
case 0:
core->machineInternals->isEnergySaving = (sValue.v.floatValue != 0.0f);
break;
}
}
return itp_endOfCommand(interpreter);
}
================================================
FILE: core/interpreter/cmd_control.h
================================================
//
// Copyright 2017-2020 Timo Kloss
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
#ifndef cmd_control_h
#define cmd_control_h
#include <stdio.h>
#include <stdbool.h>
#include "error.h"
struct Core;
enum ErrorCode cmd_END(struct Core *core);
enum ErrorCode cmd_IF(struct Core *core, bool isAfterBlockElse);
enum ErrorCode cmd_ELSE(struct Core *core);
enum ErrorCode cmd_END_IF(struct Core *core);
enum ErrorCode cmd_FOR(struct Core *core);
enum ErrorCode cmd_NEXT(struct Core *core);
enum ErrorCode cmd_GOTO(struct Core *core);
enum ErrorCode cmd_GOSUB(struct Core *core);
enum ErrorCode cmd_RETURN(struct Core *core);
enum ErrorCode cmd_WAIT(struct Core *core);
enum ErrorCode cmd_ON(struct Core *core);
enum ErrorCode cmd_DO(struct Core *core);
enum ErrorCode cmd_LOOP(struct Core *core);
enum ErrorCode cmd_REPEAT(struct Core *core);
enum ErrorCode cmd_UNTIL(struct Core *core);
enum ErrorCode cmd_WHILE(struct Core *core);
enum ErrorCode cmd_WEND(struct Core *core);
enum ErrorCode cmd_EXIT(struct Core *core);
enum ErrorCode cmd_SYSTEM(struct Core *core);
#endif /* cmd_control_h */
================================================
FILE: core/interpreter/cmd_data.c
================================================
//
// Copyright 2017 Timo Kloss
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
#include "cmd_data.h"
#include "core.h"
enum ErrorCode cmd_DATA(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
if (interpreter->pass == PassPrepare)
{
if (!interpreter->firstData)
{
interpreter->firstData = interpreter->pc;
}
if (interpreter->lastData)
{
interpreter->lastData->jumpToken = interpreter->pc;
}
interpreter->lastData = interpreter->pc;
}
do
{
++interpreter->pc; // DATA at first, then comma
if (interpreter->pc->type == TokenString)
{
++interpreter->pc;
}
else if (interpreter->pc->type == TokenFloat)
{
++interpreter->pc;
}
else if (interpreter->pc->type == TokenMinus)
{
++interpreter->pc;
if (interpreter->pc->type != TokenFloat) return ErrorSyntax;
++interpreter->pc;
}
else
{
return ErrorSyntax;
}
}
while (interpreter->pc->type == TokenComma);
// Eol
if (interpreter->pc->type != TokenEol) return ErrorSyntax;
++interpreter->pc;
return ErrorNone;
}
enum ErrorCode cmd_READ(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
do
{
// READ at first, then comma
++interpreter->pc;
// variable
enum ValueType varType = ValueTypeNull;
enum ErrorCode errorCode = ErrorNone;
union Value *varValue = itp_readVariable(core, &varType, &errorCode, true);
if (!varValue) return errorCode;
if (interpreter->pass == PassRun)
{
if (!interpreter->currentDataValueToken) return ErrorOutOfData;
struct Token *dataValueToken = interpreter->currentDataValueToken;
if (dataValueToken->type == TokenFloat)
{
if (varType != ValueTypeFloat) return ErrorTypeMismatch;
varValue->floatValue = dataValueToken->floatValue;
}
else if (dataValueToken->type == TokenMinus)
{
if (varType != ValueTypeFloat) return ErrorTypeMismatch;
interpreter->currentDataValueToken++;
varValue->floatValue = -interpreter->currentDataValueToken->floatValue;
}
else if (dataValueToken->type == TokenString)
{
if (varType != ValueTypeString) return ErrorTypeMismatch;
if (varValue->stringValue)
{
rcstring_release(varValue->stringValue);
}
varValue->stringValue = dataValueToken->stringValue;
rcstring_retain(varValue->stringValue);
}
dat_nextData(interpreter);
}
}
while (interpreter->pc->type == TokenComma);
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_RESTORE(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// RESTORE
struct Token *tokenRESTORE = interpreter->pc;
++interpreter->pc;
// optional jump label
if (interpreter->pc->type == TokenIdentifier)
{
if (interpreter->pass == PassPrepare)
{
struct JumpLabelItem *item = tok_getJumpLabel(&interpreter->tokenizer, interpreter->pc->symbolIndex);
if (!item) return ErrorUndefinedLabel;
tokenRESTORE->jumpToken = item->token;
}
else if (interpreter->pass == PassRun)
{
// find DATA after label
dat_restoreData(interpreter, tokenRESTORE->jumpToken);
}
++interpreter->pc;
}
else if (interpreter->pass == PassRun)
{
// restore to first DATA
dat_restoreData(interpreter, NULL);
}
return itp_endOfCommand(interpreter);
}
================================================
FILE: core/interpreter/cmd_data.h
================================================
//
// Copyright 2017 Timo Kloss
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
#ifndef cmd_data_h
#define cmd_data_h
#include <stdio.h>
#include "error.h"
struct Core;
enum ErrorCode cmd_DATA(struct Core *core);
enum ErrorCode cmd_READ(struct Core *core);
enum ErrorCode cmd_RESTORE(struct Core *core);
#endif /* cmd_data_h */
================================================
FILE: core/interpreter/cmd_files.c
================================================
//
// Copyright 2017 Timo Kloss
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
#include "cmd_files.h"
#include "core.h"
#include <assert.h>
#include <string.h>
enum ErrorCode cmd_LOAD(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
if (interpreter->pass == PassRun && interpreter->mode == ModeInterrupt) return ErrorNotAllowedInInterrupt;
// LOAD
struct Token *startPc = interpreter->pc;
++interpreter->pc;
// file value
struct TypedValue fileValue = itp_evaluateNumericExpression(core, 0, MAX_ENTRIES - 1);
if (fileValue.type == ValueTypeError) return fileValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// address value
struct TypedValue addressValue = itp_evaluateExpression(core, TypeClassNumeric);
if (addressValue.type == ValueTypeError) return addressValue.v.errorCode;
int maxLength = 0;
int offset = 0;
if (interpreter->pc->type == TokenComma)
{
++interpreter->pc;
// max length value
struct TypedValue maxLengthValue = itp_evaluateNumericExpression(core, 0, DATA_SIZE);
if (maxLengthValue.type == ValueTypeError) return maxLengthValue.v.errorCode;
maxLength = maxLengthValue.v.floatValue;
if (interpreter->pc->type == TokenComma)
{
++interpreter->pc;
// offset value
struct TypedValue offsetValue = itp_evaluateNumericExpression(core, 0, DATA_SIZE);
if (offsetValue.type == ValueTypeError) return offsetValue.v.errorCode;
offset = offsetValue.v.floatValue;
}
}
if (interpreter->pass == PassRun)
{
bool pokeFailed = false;
bool ready = disk_loadFile(core, fileValue.v.floatValue, addressValue.v.floatValue, maxLength, offset, &pokeFailed);
if (pokeFailed) return ErrorIllegalMemoryAccess;
interpreter->exitEvaluation = true;
if (!ready)
{
// disk not ready
interpreter->pc = startPc;
interpreter->state = StateWaitForDisk;
return ErrorNone;
}
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_SAVE(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
if (interpreter->pass == PassRun && interpreter->mode == ModeInterrupt) return ErrorNotAllowedInInterrupt;
// SAVE
struct Token *startPc = interpreter->pc;
++interpreter->pc;
// file value
struct TypedValue fileValue = itp_evaluateNumericExpression(core, 0, MAX_ENTRIES - 1);
if (fileValue.type == ValueTypeError) return fileValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// comment value
struct TypedValue commentValue = itp_evaluateExpression(core, TypeClassString);
if (commentValue.type == ValueTypeError) return commentValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// address value
struct TypedValue addressValue = itp_evaluateExpression(core, TypeClassNumeric);
if (addressValue.type == ValueTypeError) return addressValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// length value
struct TypedValue lengthValue = itp_evaluateNumericExpression(core, 1, DATA_SIZE);
if (lengthValue.type == ValueTypeError) return lengthValue.v.errorCode;
if (interpreter->pass == PassRun)
{
int address = addressValue.v.floatValue;
int length = lengthValue.v.floatValue;
if (address + length > 0x10000)
{
return ErrorIllegalMemoryAccess;
}
bool ready = disk_saveFile(core, fileValue.v.floatValue, commentValue.v.stringValue->chars, address, length);
rcstring_release(commentValue.v.stringValue);
interpreter->exitEvaluation = true;
if (!ready)
{
// disk not ready
interpreter->pc = startPc;
interpreter->state = StateWaitForDisk;
return ErrorNone;
}
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_FILES(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
if (interpreter->pass == PassRun && interpreter->mode == ModeInterrupt) return ErrorNotAllowedInInterrupt;
// FILES
struct Token *startPc = interpreter->pc;
++interpreter->pc;
if (interpreter->pass == PassRun)
{
bool ready = disk_prepare(core);
interpreter->exitEvaluation = true;
if (!ready)
{
// disk not ready
interpreter->pc = startPc;
interpreter->state = StateWaitForDisk;
return ErrorNone;
}
}
return itp_endOfCommand(interpreter);
}
struct TypedValue fnc_FILE(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// FILE$
++interpreter->pc;
// bracket open
if (interpreter->pc->type != TokenBracketOpen) return val_makeError(ErrorSyntax);
++interpreter->pc;
// file value
struct TypedValue fileValue = itp_evaluateNumericExpression(core, 0, MAX_ENTRIES - 1);
if (fileValue.type == ValueTypeError) return fileValue;
// bracket close
if (interpreter->pc->type != TokenBracketClose) return val_makeError(ErrorSyntax);
++interpreter->pc;
struct TypedValue resultValue;
resultValue.type = ValueTypeString;
if (interpreter->pass == PassRun)
{
if (core->diskDrive->dataManager.data == NULL) return val_makeError(ErrorDirectoryNotLoaded);
int index = fileValue.v.floatValue;
struct DataEntry *entry = &core->diskDrive->dataManager.entries[index];
size_t len = strlen(entry->comment);
resultValue.v.stringValue = rcstring_new(entry->comment, len);
rcstring_retain(resultValue.v.stringValue);
interpreter->cycles += len;
}
return resultValue;
}
struct TypedValue fnc_FSIZE(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// FSIZE
++interpreter->pc;
// bracket open
if (interpreter->pc->type != TokenBracketOpen) return val_makeError(ErrorSyntax);
++interpreter->pc;
// file value
struct TypedValue fileValue = itp_evaluateNumericExpression(core, 0, MAX_ENTRIES - 1);
if (fileValue.type == ValueTypeError) return fileValue;
// bracket close
if (interpreter->pc->type != TokenBracketClose) return val_makeError(ErrorSyntax);
++interpreter->pc;
struct TypedValue resultValue;
resultValue.type = ValueTypeFloat;
if (interpreter->pass == PassRun)
{
if (core->diskDrive->dataManager.data == NULL) return val_makeError(ErrorDirectoryNotLoaded);
int index = fileValue.v.floatValue;
struct DataEntry *entry = &core->diskDrive->dataManager.entries[index];
resultValue.v.floatValue = entry->length;
}
return resultValue;
}
================================================
FILE: core/interpreter/cmd_files.h
================================================
//
// Copyright 2017 Timo Kloss
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
#ifndef cmd_files_h
#define cmd_files_h
#include <stdio.h>
#include "error.h"
#include "value.h"
struct Core;
enum ErrorCode cmd_LOAD(struct Core *core);
enum ErrorCode cmd_SAVE(struct Core *core);
enum ErrorCode cmd_FILES(struct Core *core);
struct TypedValue fnc_FILE(struct Core *core);
struct TypedValue fnc_FSIZE(struct Core *core);
#endif /* cmd_files_h */
================================================
FILE: core/interpreter/cmd_io.c
================================================
//
// Copyright 2017 Timo Kloss
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
#include "cmd_io.h"
#include "core.h"
#include <assert.h>
enum ErrorCode cmd_KEYBOARD(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// KEYBOARD
++interpreter->pc;
// ON/OFF/OPTIONAL
enum TokenType type = interpreter->pc->type;
if (type != TokenON && type != TokenOFF && type != TokenOPTIONAL) return ErrorSyntax;
++interpreter->pc;
if (interpreter->pass == PassRun)
{
core->machine->ioRegisters.attr.keyboardEnabled = (type == TokenON || type == TokenOPTIONAL);
interpreter->isKeyboardOptional = (type == TokenOPTIONAL);
delegate_controlsDidChange(core);
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_TOUCHSCREEN(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// TOUCHSCREEN
++interpreter->pc;
if (interpreter->pass == PassRun)
{
if (core->machine->ioRegisters.attr.gamepadsEnabled > 0) return ErrorInputChangeNotAllowed;
core->machine->ioRegisters.attr.touchEnabled = 1;
delegate_controlsDidChange(core);
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_GAMEPAD(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// GAMEPAD
++interpreter->pc;
// number
struct TypedValue value = itp_evaluateNumericExpression(core, 1, 2);
if (value.type == ValueTypeError) return value.v.errorCode;
if (interpreter->pass == PassRun)
{
if (core->machine->ioRegisters.attr.touchEnabled) return ErrorInputChangeNotAllowed;
core->machine->ioRegisters.attr.gamepadsEnabled = value.v.floatValue;
core->machine->ioRegisters.status.touch = 0;
for (int i = 0; i < NUM_GAMEPADS; i++)
{
core->machine->ioRegisters.gamepads[i].value = 0;
}
delegate_controlsDidChange(core);
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_PAUSE(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// PAUSE
++interpreter->pc;
// ON/OFF?
enum TokenType type = interpreter->pc->type;
if (type == TokenON || type == TokenOFF)
{
++interpreter->pc;
}
if (interpreter->pass == PassRun)
{
if (type == TokenON)
{
core->machine->ioRegisters.status.pause = 0;
interpreter->handlesPause = true;
}
else if (type == TokenOFF)
{
interpreter->handlesPause = false;
}
else
{
interpreter->state = StatePaused;
overlay_updateState(core);
}
}
return itp_endOfCommand(interpreter);
}
struct TypedValue fnc_UP_DOWN_LEFT_RIGHT(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// UP/DOWN/LEFT/RIGHT
enum TokenType type = interpreter->pc->type;
++interpreter->pc;
// TAP
bool tap = false;
if (interpreter->pc->type == TokenTAP)
{
++interpreter->pc;
tap = true;
}
// bracket open
if (interpreter->pc->type != TokenBracketOpen) return val_makeError(ErrorSyntax);
++interpreter->pc;
// p expression
struct TypedValue pValue = itp_evaluateNumericExpression(core, 0, 1);
if (pValue.type == ValueTypeError) return pValue;
// bracket close
if (interpreter->pc->type != TokenBracketClose) return val_makeError(ErrorSyntax);
++interpreter->pc;
struct TypedValue value;
value.type = ValueTypeFloat;
if (interpreter->pass == PassRun)
{
if (core->machine->ioRegisters.attr.gamepadsEnabled == 0) return val_makeError(ErrorGamepadNotEnabled);
int p = pValue.v.floatValue;
int active = 0;
int lastFrameActive = 0;
union Gamepad *gamepad = &core->machine->ioRegisters.gamepads[p];
union Gamepad *lastFrameGamepad = &core->interpreter->lastFrameGamepads[p];
switch (type)
{
case TokenUP:
active = gamepad->up;
lastFrameActive = lastFrameGamepad->up;
break;
case TokenDOWN:
active = gamepad->down;
lastFrameActive = lastFrameGamepad->down;
break;
case TokenLEFT:
active = gamepad->left;
lastFrameActive = lastFrameGamepad->left;
break;
case TokenRIGHT:
active = gamepad->right;
lastFrameActive = lastFrameGamepad->right;
break;
default:
assert(0);
break;
}
value.v.floatValue = active && !(tap && lastFrameActive) ? BAS_TRUE : BAS_FALSE;
}
return value;
}
struct TypedValue fnc_BUTTON(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// BUTTON
++interpreter->pc;
// TAP
bool tap = false;
if (interpreter->pc->type == TokenTAP)
{
++interpreter->pc;
tap = true;
}
// bracket open
if (interpreter->pc->type != TokenBracketOpen) return val_makeError(ErrorSyntax);
++interpreter->pc;
// p expression
struct TypedValue pValue = itp_evaluateNumericExpression(core, 0, 1);
if (pValue.type == ValueTypeError) return pValue;
int n = -1;
if (interpreter->pc->type == TokenComma)
{
// comma
++interpreter->pc;
// n expression
struct TypedValue nValue = itp_evaluateNumericExpression(core, 0, 1);
if (nValue.type == ValueTypeError) return nValue;
n = nValue.v.floatValue;
}
// bracket close
if (interpreter->pc->type != TokenBracketClose) return val_makeError(ErrorSyntax);
++interpreter->pc;
struct TypedValue value;
value.type = ValueTypeFloat;
if (interpreter->pass == PassRun)
{
if (core->machine->ioRegisters.attr.gamepadsEnabled == 0) return val_makeError(ErrorGamepadNotEnabled);
int p = pValue.v.floatValue;
union Gamepad *gamepad = &core->machine->ioRegisters.gamepads[p];
int active = (n == -1) ? (gamepad->buttonA || gamepad->buttonB) : (n == 0) ? gamepad->buttonA : gamepad->buttonB;
if (active && tap)
{
// invalidate button if it was already pressed last frame
union Gamepad *lastFrameGamepad = &core->interpreter->lastFrameGamepads[p];
if ((n == -1) ? (lastFrameGamepad->buttonA || lastFrameGamepad->buttonB) : (n == 0) ? lastFrameGamepad->buttonA : lastFrameGamepad->buttonB)
{
active = 0;
}
}
value.v.floatValue = active ? BAS_TRUE : BAS_FALSE;
}
return value;
}
struct TypedValue fnc_TOUCH(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// TOUCH
++interpreter->pc;
struct TypedValue value;
value.type = ValueTypeFloat;
if (interpreter->pass == PassRun)
{
if (core->machine->ioRegisters.attr.touchEnabled == 0) return val_makeError(ErrorTouchNotEnabled);
value.v.floatValue = core->machine->ioRegisters.status.touch ? BAS_TRUE : BAS_FALSE;
}
return value;
}
struct TypedValue fnc_TAP(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// TAP
++interpreter->pc;
struct TypedValue value;
value.type = ValueTypeFloat;
if (interpreter->pass == PassRun)
{
if (core->machine->ioRegisters.attr.touchEnabled == 0) return val_makeError(ErrorTouchNotEnabled);
value.v.floatValue = (core->machine->ioRegisters.status.touch && !core->interpreter->lastFrameIOStatus.touch) ? BAS_TRUE : BAS_FALSE;
}
return value;
}
struct TypedValue fnc_TOUCH_X_Y(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// TOUCH.?
enum TokenType type = interpreter->pc->type;
++interpreter->pc;
struct TypedValue value;
value.type = ValueTypeFloat;
if (interpreter->pass == PassRun)
{
if (core->machine->ioRegisters.attr.touchEnabled == 0) return val_makeError(ErrorTouchNotEnabled);
if (type == TokenTOUCHX)
{
value.v.floatValue = core->machine->ioRegisters.touchX;
}
else if (type == TokenTOUCHY)
{
value.v.floatValue = core->machine->ioRegisters.touchY;
}
else
{
assert(0);
}
}
return value;
}
struct TypedValue fnc_PAUSE(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// PAUSE
++interpreter->pc;
struct TypedValue value;
value.type = ValueTypeFloat;
if (interpreter->pass == PassRun)
{
if (interpreter->handlesPause) return val_makeError(ErrorAutomaticPauseNotDisabled);
value.v.floatValue = core->machine->ioRegisters.status.pause ? BAS_TRUE : BAS_FALSE;
core->machine->ioRegisters.status.pause = 0;
}
return value;
}
================================================
FILE: core/interpreter/cmd_io.h
================================================
//
// Copyright 2017 Timo Kloss
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
#ifndef cmd_io_h
#define cmd_io_h
#include <stdio.h>
#include "error.h"
#include "value.h"
struct Core;
enum ErrorCode cmd_KEYBOARD(struct Core *core);
enum ErrorCode cmd_TOUCHSCREEN(struct Core *core);
enum ErrorCode cmd_GAMEPAD(struct Core *core);
enum ErrorCode cmd_PAUSE(struct Core *core);
struct TypedValue fnc_UP_DOWN_LEFT_RIGHT(struct Core *core);
struct TypedValue fnc_BUTTON(struct Core *core);
struct TypedValue fnc_TOUCH(struct Core *core);
struct TypedValue fnc_TAP(struct Core *core);
struct TypedValue fnc_TOUCH_X_Y(struct Core *core);
struct TypedValue fnc_PAUSE(struct Core *core);
#endif /* cmd_io_h */
================================================
FILE: core/interpreter/cmd_maths.c
================================================
//
// Copyright 2017 Timo Kloss
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
#define _USE_MATH_DEFINES
#include "cmd_maths.h"
#include "core.h"
#include <math.h>
#include <assert.h>
#include <stdlib.h>
struct TypedValue fnc_math0(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// function
enum TokenType type = interpreter->pc->type;
++interpreter->pc;
struct TypedValue value;
value.type = ValueTypeFloat;
if (interpreter->pass == PassRun)
{
switch (type)
{
case TokenPI:
value.v.floatValue = M_PI;
break;
default:
assert(0);
break;
}
}
return value;
}
struct TypedValue fnc_math1(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// function
enum TokenType type = interpreter->pc->type;
++interpreter->pc;
// bracket open
if (interpreter->pc->type != TokenBracketOpen) return val_makeError(ErrorSyntax);
++interpreter->pc;
// expression
struct TypedValue xValue = itp_evaluateExpression(core, TypeClassNumeric);
if (xValue.type == ValueTypeError) return xValue;
// bracket close
if (interpreter->pc->type != TokenBracketClose) return val_makeError(ErrorSyntax);
++interpreter->pc;
struct TypedValue value;
value.type = ValueTypeFloat;
if (interpreter->pass == PassRun)
{
switch (type)
{
case TokenABS:
value.v.floatValue = fabsf(xValue.v.floatValue);
break;
case TokenACOS:
if (xValue.v.floatValue < -1.0 || xValue.v.floatValue > 1.0) return val_makeError(ErrorInvalidParameter);
value.v.floatValue = acosf(xValue.v.floatValue);
break;
case TokenASIN:
if (xValue.v.floatValue < -1.0 || xValue.v.floatValue > 1.0) return val_makeError(ErrorInvalidParameter);
value.v.floatValue = asinf(xValue.v.floatValue);
break;
case TokenATAN:
value.v.floatValue = atanf(xValue.v.floatValue);
break;
case TokenCOS:
value.v.floatValue = cosf(xValue.v.floatValue);
break;
case TokenEXP:
value.v.floatValue = expf(xValue.v.floatValue);
break;
case TokenHCOS:
value.v.floatValue = coshf(xValue.v.floatValue);
break;
case TokenHSIN:
value.v.floatValue = sinhf(xValue.v.floatValue);
break;
case TokenHTAN:
value.v.floatValue = tanhf(xValue.v.floatValue);
break;
case TokenINT:
value.v.floatValue = floorf(xValue.v.floatValue);
break;
case TokenLOG:
if (xValue.v.floatValue <= 0) return val_makeError(ErrorInvalidParameter);
value.v.floatValue = logf(xValue.v.floatValue);
break;
case TokenSGN:
value.v.floatValue = (xValue.v.floatValue > 0) ? 1 : (xValue.v.floatValue < 0) ? BAS_TRUE : BAS_FALSE;
break;
case TokenSIN:
value.v.floatValue = sinf(xValue.v.floatValue);
break;
case TokenSQR:
if (xValue.v.floatValue < 0) return val_makeError(ErrorInvalidParameter);
value.v.floatValue = sqrtf(xValue.v.floatValue);
break;
case TokenTAN:
value.v.floatValue = tanf(xValue.v.floatValue);
break;
default:
assert(0);
break;
}
}
return value;
}
struct TypedValue fnc_math2(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// function
enum TokenType type = interpreter->pc->type;
++interpreter->pc;
// bracket open
if (interpreter->pc->type != TokenBracketOpen) return val_makeError(ErrorSyntax);
++interpreter->pc;
// x expression
struct TypedValue xValue = itp_evaluateExpression(core, TypeClassNumeric);
if (xValue.type == ValueTypeError) return xValue;
// comma
if (interpreter->pc->type != TokenComma) return val_makeError(ErrorSyntax);
++interpreter->pc;
// y expression
struct TypedValue yValue = itp_evaluateExpression(core, TypeClassNumeric);
if (yValue.type == ValueTypeError) return yValue;
// bracket close
if (interpreter->pc->type != TokenBracketClose) return val_makeError(ErrorSyntax);
++interpreter->pc;
struct TypedValue value;
value.type = ValueTypeFloat;
if (interpreter->pass == PassRun)
{
float x = xValue.v.floatValue;
float y = yValue.v.floatValue;
switch (type)
{
case TokenMAX:
value.v.floatValue = (x > y) ? x : y;
break;
case TokenMIN:
value.v.floatValue = (x < y) ? x : y;
break;
default:
assert(0);
break;
}
}
return value;
}
enum ErrorCode cmd_RANDOMIZE(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// RANDOMIZE
++interpreter->pc;
// value
struct TypedValue value = itp_evaluateExpression(core, TypeClassNumeric);
if (value.type == ValueTypeError) return value.v.errorCode;
if (interpreter->pass == PassRun)
{
interpreter->seed = value.v.floatValue;
}
return itp_endOfCommand(interpreter);
}
struct TypedValue fnc_RND(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// RND
++interpreter->pc;
int x = -1;
if (interpreter->pc->type == TokenBracketOpen)
{
// bracket open
++interpreter->pc;
// expression
struct TypedValue xValue = itp_evaluateExpression(core, TypeClassNumeric);
if (xValue.type == ValueTypeError) return xValue;
x = xValue.v.floatValue;
// bracket close
if (interpreter->pc->type != TokenBracketClose) return val_makeError(ErrorSyntax);
++interpreter->pc;
}
struct TypedValue value;
value.type = ValueTypeFloat;
if (interpreter->pass == PassRun)
{
int seed = (1140671485 * interpreter->seed + 12820163) & 0xFFFFFF;
interpreter->seed = seed;
float rnd = seed / (float)0x1000000;
if (x >= 0)
{
// integer 0...x
value.v.floatValue = floorf(rnd * (x + 1));
}
else
{
// float 0..<1
value.v.floatValue = rnd;
}
}
return value;
}
enum ErrorCode cmd_ADD(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// ADD
++interpreter->pc;
enum ErrorCode errorCode = ErrorNone;
// Variable
enum ValueType valueType = ValueTypeNull;
union Value *varValue = itp_readVariable(core, &valueType, &errorCode, false);
if (!varValue) return errorCode;
if (valueType != ValueTypeFloat) return ErrorTypeMismatch;
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// n vale
struct TypedValue nValue = itp_evaluateExpression(core, TypeClassNumeric);
if (nValue.type == ValueTypeError) return nValue.v.errorCode;
bool hasRange = false;
float base = 0;
float top = 0;
if (interpreter->pc->type == TokenComma)
{
// comma
++interpreter->pc;
// base value
struct TypedValue baseValue = itp_evaluateExpression(core, TypeClassNumeric);
if (baseValue.type == ValueTypeError) return baseValue.v.errorCode;
base = baseValue.v.floatValue;
// TO
if (interpreter->pc->type != TokenTO) return ErrorSyntax;
++interpreter->pc;
// top value
struct TypedValue topValue = itp_evaluateExpression(core, TypeClassNumeric);
if (topValue.type == ValueTypeError) return topValue.v.errorCode;
top = topValue.v.floatValue;
hasRange = true;
}
if (interpreter->pass == PassRun)
{
varValue->floatValue += nValue.v.floatValue;
if (hasRange)
{
if (varValue->floatValue < base) varValue->floatValue = top;
if (varValue->floatValue > top) varValue->floatValue = base;
}
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_INC_DEC(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// INC/DEC
enum TokenType type = interpreter->pc->type;
++interpreter->pc;
enum ErrorCode errorCode = ErrorNone;
// Variable
enum ValueType valueType = ValueTypeNull;
union Value *varValue = itp_readVariable(core, &valueType, &errorCode, false);
if (!varValue) return errorCode;
if (valueType != ValueTypeFloat) return ErrorTypeMismatch;
if (interpreter->pass == PassRun)
{
switch (type)
{
case TokenINC:
++varValue->floatValue;
break;
case TokenDEC:
--varValue->floatValue;
break;
default:
assert(0);
break;
}
}
return itp_endOfCommand(interpreter);
}
================================================
FILE: core/interpreter/cmd_maths.h
================================================
//
// Copyright 2017 Timo Kloss
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
#ifndef cmd_maths_h
#define cmd_maths_h
#include <stdio.h>
#include "value.h"
struct Core;
struct TypedValue fnc_math0(struct Core *core);
struct TypedValue fnc_math1(struct Core *core);
struct TypedValue fnc_math2(struct Core *core);
enum ErrorCode cmd_RANDOMIZE(struct Core *core);
struct TypedValue fnc_RND(struct Core *core);
enum ErrorCode cmd_ADD(struct Core *core);
enum ErrorCode cmd_INC_DEC(struct Core *core);
#endif /* cmd_maths_h */
================================================
FILE: core/interpreter/cmd_memory.c
================================================
//
// Copyright 2017 Timo Kloss
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
#include "cmd_memory.h"
#include "core.h"
#include "data_manager.h"
#include <assert.h>
struct TypedValue fnc_PEEK(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// PEEK/W/L
enum TokenType type = interpreter->pc->type;
++interpreter->pc;
// bracket open
if (interpreter->pc->type != TokenBracketOpen) return val_makeError(ErrorSyntax);
++interpreter->pc;
// expression
struct TypedValue addressValue = itp_evaluateExpression(core, TypeClassNumeric);
if (addressValue.type == ValueTypeError) return addressValue;
// bracket close
if (interpreter->pc->type != TokenBracketClose) return val_makeError(ErrorSyntax);
++interpreter->pc;
struct TypedValue resultValue;
resultValue.type = ValueTypeFloat;
if (interpreter->pass == PassRun)
{
switch (type)
{
case TokenPEEK:
{
int peek = machine_peek(core, addressValue.v.floatValue);
if (peek == -1) return val_makeError(ErrorIllegalMemoryAccess);
resultValue.v.floatValue = peek;
break;
}
case TokenPEEKW:
{
int peek1 = machine_peek(core, addressValue.v.floatValue);
int peek2 = machine_peek(core, addressValue.v.floatValue + 1);
if (peek1 == -1 || peek2 == -1) return val_makeError(ErrorIllegalMemoryAccess);
int16_t value = peek1 | (peek2 << 8);
resultValue.v.floatValue = value;
break;
}
case TokenPEEKL:
{
int peek1 = machine_peek(core, addressValue.v.floatValue);
int peek2 = machine_peek(core, addressValue.v.floatValue + 1);
int peek3 = machine_peek(core, addressValue.v.floatValue + 2);
int peek4 = machine_peek(core, addressValue.v.floatValue + 3);
if (peek1 == -1 || peek2 == -1 || peek3 == -1 || peek4 == -1) return val_makeError(ErrorIllegalMemoryAccess);
int32_t value = peek1 | (peek2 << 8) | (peek3 << 16) | (peek4 << 24);
resultValue.v.floatValue = value;
break;
}
default:
assert(0);
}
}
return resultValue;
}
enum ErrorCode cmd_POKE(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// POKE/W/L
enum TokenType type = interpreter->pc->type;
++interpreter->pc;
// address value
struct TypedValue addressValue = itp_evaluateExpression(core, TypeClassNumeric);
if (addressValue.type == ValueTypeError) return addressValue.v.errorCode;
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// poke vale
struct TypedValue pokeValue = itp_evaluateExpression(core, TypeClassNumeric);
if (pokeValue.type == ValueTypeError) return pokeValue.v.errorCode;
if (interpreter->pass == PassRun)
{
switch (type)
{
case TokenPOKE:
{
bool poke = machine_poke(core, addressValue.v.floatValue, pokeValue.v.floatValue);
if (!poke) return ErrorIllegalMemoryAccess;
break;
}
case TokenPOKEW:
{
int16_t value = pokeValue.v.floatValue;
bool poke1 = machine_poke(core, addressValue.v.floatValue , value);
bool poke2 = machine_poke(core, addressValue.v.floatValue + 1, value >> 8);
if (!poke1 || !poke2) return ErrorIllegalMemoryAccess;
break;
}
case TokenPOKEL:
{
int32_t value = pokeValue.v.floatValue;
bool poke1 = machine_poke(core, addressValue.v.floatValue , value);
bool poke2 = machine_poke(core, addressValue.v.floatValue + 1, value >> 8);
bool poke3 = machine_poke(core, addressValue.v.floatValue + 2, value >> 16);
bool poke4 = machine_poke(core, addressValue.v.floatValue + 3, value >> 24);
if (!poke1 || !poke2 || !poke3 || !poke4) return ErrorIllegalMemoryAccess;
break;
}
default:
assert(0);
}
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_FILL(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// FILL
++interpreter->pc;
// start value
struct TypedValue startValue = itp_evaluateExpression(core, TypeClassNumeric);
if (startValue.type == ValueTypeError) return startValue.v.errorCode;
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// length value
struct TypedValue lengthValue = itp_evaluateExpression(core, TypeClassNumeric);
if (lengthValue.type == ValueTypeError) return lengthValue.v.errorCode;
int fill = 0;
if (interpreter->pc->type == TokenComma)
{
++interpreter->pc;
// fill value
struct TypedValue fillValue = itp_evaluateExpression(core, TypeClassNumeric);
if (fillValue.type == ValueTypeError) return fillValue.v.errorCode;
fill = fillValue.v.floatValue;
}
if (interpreter->pass == PassRun)
{
int start = startValue.v.floatValue;
int length = lengthValue.v.floatValue;
for (int i = 0; i < length; i++)
{
bool poke = machine_poke(core, start + i, fill);
if (!poke) return ErrorIllegalMemoryAccess;
}
interpreter->cycles += length;
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_COPY(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// COPY
++interpreter->pc;
// source value
struct TypedValue sourceValue = itp_evaluateExpression(core, TypeClassNumeric);
if (sourceValue.type == ValueTypeError) return sourceValue.v.errorCode;
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// length value
struct TypedValue lengthValue = itp_evaluateExpression(core, TypeClassNumeric);
if (lengthValue.type == ValueTypeError) return lengthValue.v.errorCode;
if (interpreter->pc->type != TokenTO) return ErrorSyntax;
++interpreter->pc;
// destination value
struct TypedValue destinationValue = itp_evaluateExpression(core, TypeClassNumeric);
if (destinationValue.type == ValueTypeError) return destinationValue.v.errorCode;
if (interpreter->pass == PassRun)
{
int source = sourceValue.v.floatValue;
int length = lengthValue.v.floatValue;
int destination = destinationValue.v.floatValue;
if (source < destination)
{
for (int i = length - 1; i >= 0; i--)
{
int peek = machine_peek(core, source + i);
if (peek == -1) return ErrorIllegalMemoryAccess;
bool poke = machine_poke(core, destination + i, peek);
if (!poke) return ErrorIllegalMemoryAccess;
}
}
else if (source > destination)
{
for (int i = 0; i < length; i++)
{
int peek = machine_peek(core, source + i);
if (peek == -1) return ErrorIllegalMemoryAccess;
bool poke = machine_poke(core, destination + i, peek);
if (!poke) return ErrorIllegalMemoryAccess;
}
}
interpreter->cycles += length;
}
return itp_endOfCommand(interpreter);
}
struct TypedValue fnc_ROM_SIZE(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// ROM/SIZE
enum TokenType type = interpreter->pc->type;
++interpreter->pc;
// bracket open
if (interpreter->pc->type != TokenBracketOpen) return val_makeError(ErrorSyntax);
++interpreter->pc;
// index expression
struct TypedValue indexValue = itp_evaluateNumericExpression(core, 0, MAX_ENTRIES - 1);
if (indexValue.type == ValueTypeError) return indexValue;
// bracket close
if (interpreter->pc->type != TokenBracketClose) return val_makeError(ErrorSyntax);
++interpreter->pc;
struct TypedValue value;
value.type = ValueTypeFloat;
if (interpreter->pass == PassRun)
{
int index = indexValue.v.floatValue;
if (type == TokenSIZE)
{
value.v.floatValue = interpreter->romDataManager.entries[index].length;
}
else
{
value.v.floatValue = interpreter->romDataManager.entries[index].start;
}
}
return value;
}
enum ErrorCode cmd_ROL_ROR(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// ROL/ROR
enum TokenType type = interpreter->pc->type;
++interpreter->pc;
// address value
struct TypedValue addressValue = itp_evaluateExpression(core, TypeClassNumeric);
if (addressValue.type == ValueTypeError) return addressValue.v.errorCode;
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// n vale
struct TypedValue nValue = itp_evaluateExpression(core, TypeClassNumeric);
if (nValue.type == ValueTypeError) return nValue.v.errorCode;
if (interpreter->pass == PassRun)
{
int value = machine_peek(core, addressValue.v.floatValue);
if (value == -1) return ErrorIllegalMemoryAccess;
int n = (int)nValue.v.floatValue;
if (type == TokenROR)
{
n = -n;
}
n &= 0x07;
value = value << n;
value = value | (value >> 8);
bool poke = machine_poke(core, addressValue.v.floatValue, value);
if (!poke) return ErrorIllegalMemoryAccess;
}
return itp_endOfCommand(interpreter);
}
================================================
FILE: core/interpreter/cmd_memory.h
================================================
//
// Copyright 2017 Timo Kloss
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
#ifndef cmd_memory_h
#define cmd_memory_h
#include <stdio.h>
#include "error.h"
struct Core;
struct TypedValue fnc_PEEK(struct Core *core);
enum ErrorCode cmd_POKE(struct Core *core);
enum ErrorCode cmd_FILL(struct Core *core);
enum ErrorCode cmd_COPY(struct Core *core);
struct TypedValue fnc_ROM_SIZE(struct Core *core);
enum ErrorCode cmd_ROL_ROR(struct Core *core);
#endif /* cmd_memory_h */
================================================
FILE: core/interpreter/cmd_screen.c
================================================
//
// Copyright 2017 Timo Kloss
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
#include "cmd_screen.h"
#include "core.h"
#include <assert.h>
#include <stdint.h>
#include "interpreter_utils.h"
enum ErrorCode cmd_PALETTE(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// PALETTE
++interpreter->pc;
// n value
struct TypedValue nValue = itp_evaluateNumericExpression(core, 0, NUM_PALETTES - 1);
if (nValue.type == ValueTypeError) return nValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// c0 value
struct TypedValue c0Value = itp_evaluateOptionalNumericExpression(core, 0, 63);
if (c0Value.type == ValueTypeError) return c0Value.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// c1 value
struct TypedValue c1Value = itp_evaluateOptionalNumericExpression(core, 0, 63);
if (c1Value.type == ValueTypeError) return c1Value.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// c2 value
struct TypedValue c2Value = itp_evaluateOptionalNumericExpression(core, 0, 63);
if (c2Value.type == ValueTypeError) return c2Value.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// c3 value
struct TypedValue c3Value = itp_evaluateOptionalNumericExpression(core, 0, 63);
if (c3Value.type == ValueTypeError) return c3Value.v.errorCode;
if (interpreter->pass == PassRun)
{
int n = nValue.v.floatValue;
uint8_t *palColors = &core->machine->colorRegisters.colors[n * 4];
if (c0Value.type != ValueTypeNull) palColors[0] = c0Value.v.floatValue;
if (c1Value.type != ValueTypeNull) palColors[1] = c1Value.v.floatValue;
if (c2Value.type != ValueTypeNull) palColors[2] = c2Value.v.floatValue;
if (c3Value.type != ValueTypeNull) palColors[3] = c3Value.v.floatValue;
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_SCROLL(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// SCROLL
++interpreter->pc;
// bg value
struct TypedValue bgValue = itp_evaluateNumericExpression(core, 0, 1);
if (bgValue.type == ValueTypeError) return bgValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// x value
struct TypedValue xValue = itp_evaluateExpression(core, TypeClassNumeric);
if (xValue.type == ValueTypeError) return xValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// y value
struct TypedValue yValue = itp_evaluateExpression(core, TypeClassNumeric);
if (yValue.type == ValueTypeError) return yValue.v.errorCode;
if (interpreter->pass == PassRun)
{
struct VideoRegisters *reg = &core->machine->videoRegisters;
int bg = bgValue.v.floatValue;
int x = (int)xValue.v.floatValue;
int y = (int)yValue.v.floatValue;
if (bg == 0)
{
reg->scrollAX = x & 0xFF;
reg->scrollAY = y & 0xFF;
reg->scrollMSB.aX = (x >> 8) & 1;
reg->scrollMSB.aY = (y >> 8) & 1;
}
else
{
reg->scrollBX = x & 0xFF;
reg->scrollBY = y & 0xFF;
reg->scrollMSB.bX = (x >> 8) & 1;
reg->scrollMSB.bY = (y >> 8) & 1;
}
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_DISPLAY(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// DISPLAY
++interpreter->pc;
// obsolete syntax!
// atrb value
struct TypedValue aValue = itp_evaluateDisplayAttributes(core, core->machine->videoRegisters.attr);
if (aValue.type == ValueTypeError) return aValue.v.errorCode;
if (interpreter->pass == PassRun)
{
core->machine->videoRegisters.attr.value = aValue.v.floatValue;
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_SPRITE_VIEW(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// SPRITE VIEW
++interpreter->pc;
++interpreter->pc;
// ON/OFF
enum TokenType type = interpreter->pc->type;
if (type != TokenON && type != TokenOFF) return ErrorSyntax;
++interpreter->pc;
if (interpreter->pass == PassRun)
{
core->machine->videoRegisters.attr.spritesEnabled = type == TokenON ? 1 : 0;
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_BG_VIEW(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// BG VIEW
++interpreter->pc;
++interpreter->pc;
// ON/OFF
enum TokenType type = interpreter->pc->type;
if (type != TokenON && type != TokenOFF) return ErrorSyntax;
++interpreter->pc;
// bg value
struct TypedValue bgValue = itp_evaluateNumericExpression(core, 0, 1);
if (bgValue.type == ValueTypeError) return bgValue.v.errorCode;
if (interpreter->pass == PassRun)
{
int value = type == TokenON ? 1 : 0;
if (bgValue.v.floatValue == 0)
{
core->machine->videoRegisters.attr.planeAEnabled = value;
}
else
{
core->machine->videoRegisters.attr.planeBEnabled = value;
}
}
return itp_endOfCommand(interpreter);
}
enum ErrorCode cmd_CELL_SIZE(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// CELL SIZE
++interpreter->pc;
++interpreter->pc;
// bg value
struct TypedValue bgValue = itp_evaluateNumericExpression(core, 0, 1);
if (bgValue.type == ValueTypeError) return bgValue.v.errorCode;
// comma
if (interpreter->pc->type != TokenComma) return ErrorSyntax;
++interpreter->pc;
// size value
struct TypedValue sValue = itp_evaluateOptionalNumericExpression(core, 0, 1);
if (sValue.type == ValueTypeError) return sValue.v.errorCode;
if (interpreter->pass == PassRun)
{
if (bgValue.v.floatValue == 0)
{
core->machine->videoRegisters.attr.planeACellSize = sValue.v.floatValue;
}
else
{
core->machine->videoRegisters.attr.planeBCellSize = sValue.v.floatValue;
}
}
return itp_endOfCommand(interpreter);
}
struct TypedValue fnc_COLOR(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// COLOR
++interpreter->pc;
// bracket open
if (interpreter->pc->type != TokenBracketOpen) return val_makeError(ErrorSyntax);
++interpreter->pc;
// pal expression
struct TypedValue pValue = itp_evaluateNumericExpression(core, 0, NUM_PALETTES - 1);
if (pValue.type == ValueTypeError) return pValue;
// comma
if (interpreter->pc->type != TokenComma) return val_makeError(ErrorSyntax);
++interpreter->pc;
// pal expression
struct TypedValue nValue = itp_evaluateNumericExpression(core, 0, 3);
if (nValue.type == ValueTypeError) return nValue;
// bracket close
if (interpreter->pc->type != TokenBracketClose) return val_makeError(ErrorSyntax);
++interpreter->pc;
struct TypedValue value;
value.type = ValueTypeFloat;
if (interpreter->pass == PassRun)
{
int p = pValue.v.floatValue;
int n = nValue.v.floatValue;
value.v.floatValue = core->machine->colorRegisters.colors[p * 4 + n];
}
return value;
}
struct TypedValue fnc_screen0(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// function
enum TokenType type = interpreter->pc->type;
++interpreter->pc;
struct TypedValue value;
value.type = ValueTypeFloat;
if (interpreter->pass == PassRun)
{
switch (type)
{
case TokenTIMER:
value.v.floatValue = core->interpreter->timer;
break;
case TokenRASTER:
value.v.floatValue = core->machine->videoRegisters.rasterLine;
break;
case TokenDISPLAY:
// obsolete syntax!
value.v.floatValue = core->machine->videoRegisters.attr.value;
break;
default:
assert(0);
break;
}
}
return value;
}
struct TypedValue fnc_SCROLL_X_Y(struct Core *core)
{
struct Interpreter *interpreter = core->interpreter;
// SCROLL.?
enum TokenType type = interpreter->pc->type;
++interpreter->pc;
// bracket open
if (interpreter->pc->type != TokenBracketOpen) return val_makeError(ErrorSyntax);
++interpreter->pc;
// bg value
struct TypedValue bgValue = itp_evaluateNumericExpression(core, 0, 1);
if (bgValue.type == ValueTypeError) return bgValue;
// bracket close
if (interpreter->pc->type != TokenBracketClose) return val_makeError(ErrorSyntax);
++interpreter->pc;
struct TypedValue value;
value.type = ValueTypeFloat;
if (interpreter->pass == PassRun)
{
int bg = bgValue.v.floatValue;
struct VideoRegisters *reg = &core->machine->videoRegisters;
switch (type)
{
case TokenSCROLLX:
if (bg == 0)
{
value.v.floatValue = reg->scrollAX | (reg->scrollMSB.aX << 8);
}
else
{
value.v.floatValue = reg->scrollBX | (reg->scrollMSB.bX << 8);
}
break;
case TokenSCROLLY:
if (bg == 0)
{
value.v.floatValue = reg->scrollAY | (reg->scrollMSB.aY << 8);
}
else
{
value.v.floatValue = reg->scrollBY | (reg->scrollMSB.bY << 8);
}
break;
default:
assert(0);
break;
}
}
return value;
}
================================================
FILE: core/interpreter/cmd_screen.h
================================================
//
// Copyright 2017 Timo Kloss
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
#ifndef cmd_screen_h
#define cmd_screen_h
#include <stdio.h>
#include "error.h"
#include "value.h"
struct Core;
enum ErrorCode cmd_PALETTE(struct Core *core);
enum ErrorCode cmd_SCROLL(struct Core *core);
enum ErrorCode cmd_DISPLAY(struct Core *core);
enum ErrorCode cmd_SPRITE_VIEW(struct Core *core);
enum ErrorCode cmd_BG_VIEW(struct Core *core);
enum ErrorCode cmd_CELL_SIZE(struct Core *core);
struct TypedValue fnc_COLOR(struct Core *core);
struct TypedValue fnc_screen0(struct Core *core);
struct TypedValue fnc_SCROLL_X_Y(struct Core *core);
#endif /* cmd_screen_h */
================================================
FILE: core/interpreter/cmd_sprites.c
================================================
//
// Copyright 2017 Timo Kloss
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this s
gitextract_m0nciqnm/
├── .gitignore
├── .gitlab-ci.yml
├── LICENSE
├── README.md
├── assets/
│ ├── NX App Design.pxm
│ ├── NX Logo.sketch
│ ├── characters.pxm
│ ├── fonts.pxm
│ ├── old/
│ │ ├── App Icon.sketch
│ │ ├── background_designer_sketch.pxm
│ │ ├── character_designer_sketch.pxm
│ │ ├── console_pixel.pxm
│ │ ├── logo.pxm
│ │ └── mobile_app_icon.pxm
│ └── overlay.nx
├── core/
│ ├── accessories/
│ │ ├── disk_drive.c
│ │ └── disk_drive.h
│ ├── boot_intro.c
│ ├── boot_intro.h
│ ├── core.c
│ ├── core.h
│ ├── core_delegate.c
│ ├── core_delegate.h
│ ├── core_stats.c
│ ├── core_stats.h
│ ├── datamanager/
│ │ ├── data_manager.c
│ │ └── data_manager.h
│ ├── interpreter/
│ │ ├── charsets.c
│ │ ├── charsets.h
│ │ ├── cmd_audio.c
│ │ ├── cmd_audio.h
│ │ ├── cmd_background.c
│ │ ├── cmd_background.h
│ │ ├── cmd_control.c
│ │ ├── cmd_control.h
│ │ ├── cmd_data.c
│ │ ├── cmd_data.h
│ │ ├── cmd_files.c
│ │ ├── cmd_files.h
│ │ ├── cmd_io.c
│ │ ├── cmd_io.h
│ │ ├── cmd_maths.c
│ │ ├── cmd_maths.h
│ │ ├── cmd_memory.c
│ │ ├── cmd_memory.h
│ │ ├── cmd_screen.c
│ │ ├── cmd_screen.h
│ │ ├── cmd_sprites.c
│ │ ├── cmd_sprites.h
│ │ ├── cmd_strings.c
│ │ ├── cmd_strings.h
│ │ ├── cmd_subs.c
│ │ ├── cmd_subs.h
│ │ ├── cmd_text.c
│ │ ├── cmd_text.h
│ │ ├── cmd_variables.c
│ │ ├── cmd_variables.h
│ │ ├── data.c
│ │ ├── data.h
│ │ ├── error.c
│ │ ├── error.h
│ │ ├── interpreter.c
│ │ ├── interpreter.h
│ │ ├── interpreter_config.h
│ │ ├── interpreter_utils.c
│ │ ├── interpreter_utils.h
│ │ ├── labels.c
│ │ ├── labels.h
│ │ ├── rcstring.c
│ │ ├── rcstring.h
│ │ ├── string_utils.c
│ │ ├── string_utils.h
│ │ ├── token.c
│ │ ├── token.h
│ │ ├── tokenizer.c
│ │ ├── tokenizer.h
│ │ ├── value.c
│ │ ├── value.h
│ │ ├── variables.c
│ │ └── variables.h
│ ├── libraries/
│ │ ├── audio_lib.c
│ │ ├── audio_lib.h
│ │ ├── default_characters.c
│ │ ├── default_characters.h
│ │ ├── sprites_lib.c
│ │ ├── sprites_lib.h
│ │ ├── startup_sequence.c
│ │ ├── startup_sequence.h
│ │ ├── text_lib.c
│ │ └── text_lib.h
│ ├── machine/
│ │ ├── audio_chip.c
│ │ ├── audio_chip.h
│ │ ├── io_chip.h
│ │ ├── machine.c
│ │ ├── machine.h
│ │ ├── video_chip.c
│ │ └── video_chip.h
│ └── overlay/
│ ├── overlay.c
│ ├── overlay.h
│ ├── overlay_data.c
│ └── overlay_data.h
├── docs/
│ ├── license.txt
│ ├── manual.html
│ └── readme.txt
├── extras/
│ └── LowRes NX.sublime-syntax
├── libretro/
│ ├── libretro.h
│ ├── libretro_main.c
│ └── libretro_main.h
├── platform/
│ ├── GameShell/
│ │ ├── README.md
│ │ └── home/
│ │ └── cpi/
│ │ ├── apps/
│ │ │ └── Menu/
│ │ │ └── 55_LowRes NX/
│ │ │ └── action.config
│ │ └── games/
│ │ └── LowResNX/
│ │ ├── LowRes Galaxy 2 (1.5).nx
│ │ └── Star Scroller 1.2.nx
│ ├── LibRetro/
│ │ ├── Makefile
│ │ ├── Makefile.common
│ │ ├── jni/
│ │ │ ├── Android.mk
│ │ │ └── Application.mk
│ │ └── link.T
│ ├── Linux/
│ │ ├── README.md
│ │ └── makefile
│ ├── Windows/
│ │ ├── LowRes NX Win/
│ │ │ ├── LowRes NX Win.rc
│ │ │ ├── LowRes NX Win.vcxproj
│ │ │ ├── LowRes NX Win.vcxproj.filters
│ │ │ ├── resource.h
│ │ │ └── resource1.h
│ │ └── LowRes NX Win.sln
│ ├── iOS/
│ │ ├── LowRes NX iOS/
│ │ │ ├── AppDelegate.swift
│ │ │ ├── Assets.xcassets/
│ │ │ │ ├── AppIcon.appiconset/
│ │ │ │ │ └── Contents.json
│ │ │ │ └── Contents.json
│ │ │ ├── Base.lproj/
│ │ │ │ ├── LaunchScreen.storyboard
│ │ │ │ └── Main.storyboard
│ │ │ ├── CoreWrapper.swift
│ │ │ ├── Info.plist
│ │ │ ├── LowResNX-Bridging-Header.h
│ │ │ ├── LowResNXView.swift
│ │ │ └── ViewController.swift
│ │ ├── LowRes NX iOS.xcodeproj/
│ │ │ ├── project.pbxproj
│ │ │ └── project.xcworkspace/
│ │ │ ├── contents.xcworkspacedata
│ │ │ └── xcshareddata/
│ │ │ └── IDEWorkspaceChecks.plist
│ │ └── program.nx
│ ├── macOS/
│ │ ├── LowRes NX macOS/
│ │ │ ├── Assets.xcassets/
│ │ │ │ ├── AppIcon.appiconset/
│ │ │ │ │ └── Contents.json
│ │ │ │ └── Contents.json
│ │ │ ├── Info.plist
│ │ │ └── LowRes_NX_macOS_SDL.entitlements
│ │ └── LowRes NX macOS.xcodeproj/
│ │ ├── project.pbxproj
│ │ └── project.xcworkspace/
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata/
│ │ └── IDEWorkspaceChecks.plist
│ └── web/
│ ├── README.md
│ ├── embed/
│ │ ├── package/
│ │ │ ├── LowResNX120.js
│ │ │ ├── LowResNX120.wasm
│ │ │ ├── index.html
│ │ │ └── program.nx
│ │ └── readme.txt
│ └── makefile
├── programs/
│ ├── Gfx Designer 2.0.nx
│ ├── LowRes Adventure 1.1.nx
│ ├── LowRes Galaxy 2 (1.5).nx
│ ├── Sound Composer 1.5.nx
│ └── Star Scroller 1.2.nx
├── programs test/
│ ├── BG Scroll.nx
│ ├── Crazy Text.nx
│ ├── Demo 0.5.nx
│ ├── Files.nx
│ ├── Scrolling Map 0.3.nx
│ ├── Slide Show 0.4.nx
│ ├── Sprites with Background 0.3.nx
│ ├── Subs 1.nx
│ ├── Subs 2.nx
│ ├── drawing.nx
│ ├── gamepad.nx
│ ├── hello world.nx
│ ├── sprite collision.nx
│ └── touch.nx
├── scripts/
│ ├── export_characters.py
│ └── export_characters_hex.py
└── sdl/
├── config.h
├── dev_menu.c
├── dev_menu.h
├── dev_menu_data.h
├── main.c
├── main.h
├── runner.c
├── runner.h
├── screenshot.c
├── screenshot.h
├── sdl_include.h
├── settings.c
├── settings.h
├── stb_image_write.h
├── system_paths.c
├── system_paths.h
├── utils.c
└── utils.h
SYMBOL INDEX (1534 symbols across 92 files)
FILE: core/accessories/disk_drive.c
function disk_init (line 28) | void disk_init(struct Core *core)
function disk_deinit (line 33) | void disk_deinit(struct Core *core)
function disk_reset (line 44) | void disk_reset(struct Core *core)
function disk_prepare (line 53) | bool disk_prepare(struct Core *core)
function disk_saveFile (line 66) | bool disk_saveFile(struct Core *core, int index, char *comment, int addr...
function disk_loadFile (line 89) | bool disk_loadFile(struct Core *core, int index, int address, int maxLen...
FILE: core/accessories/disk_drive.h
type Core (line 28) | struct Core
type DiskDrive (line 30) | struct DiskDrive {
type Core (line 34) | struct Core
type Core (line 35) | struct Core
type Core (line 36) | struct Core
type Core (line 38) | struct Core
type Core (line 39) | struct Core
type Core (line 40) | struct Core
FILE: core/boot_intro.h
type BootIntroState (line 27) | enum BootIntroState {
FILE: core/core.c
type Core (line 35) | struct Core
type CoreInput (line 35) | struct CoreInput
function core_init (line 38) | void core_init(struct Core *core)
function core_deinit (line 63) | void core_deinit(struct Core *core)
function core_setDelegate (line 84) | void core_setDelegate(struct Core *core, struct CoreDelegate *delegate)
function core_compileProgram (line 89) | struct CoreError core_compileProgram(struct Core *core, const char *sour...
function core_traceError (line 97) | void core_traceError(struct Core *core, struct CoreError error)
function core_willRunProgram (line 120) | void core_willRunProgram(struct Core *core, long secondsSincePowerOn)
function core_update (line 128) | void core_update(struct Core *core, struct CoreInput *input)
function core_handleInput (line 138) | void core_handleInput(struct Core *core, struct CoreInput *input)
function core_willSuspendProgram (line 231) | void core_willSuspendProgram(struct Core *core)
function core_setDebug (line 240) | void core_setDebug(struct Core *core, bool enabled)
function core_getDebug (line 246) | bool core_getDebug(struct Core *core)
function core_isKeyboardEnabled (line 251) | bool core_isKeyboardEnabled(struct Core *core)
function core_shouldRender (line 256) | bool core_shouldRender(struct Core *core)
function core_setInputGamepad (line 267) | void core_setInputGamepad(struct CoreInput *input, int player, bool up, ...
function core_diskLoaded (line 278) | void core_diskLoaded(struct Core *core)
FILE: core/core.h
type Core (line 34) | struct Core {
type CoreInputGamepad (line 43) | struct CoreInputGamepad {
type CoreInput (line 52) | struct CoreInput {
type Core (line 69) | struct Core
type Core (line 70) | struct Core
type Core (line 71) | struct Core
type CoreDelegate (line 71) | struct CoreDelegate
type CoreError (line 72) | struct CoreError
type Core (line 72) | struct Core
type Core (line 73) | struct Core
type CoreError (line 73) | struct CoreError
type Core (line 74) | struct Core
type Core (line 75) | struct Core
type CoreInput (line 75) | struct CoreInput
type Core (line 76) | struct Core
type Core (line 77) | struct Core
type Core (line 78) | struct Core
type Core (line 79) | struct Core
type Core (line 80) | struct Core
type CoreInput (line 82) | struct CoreInput
type Core (line 84) | struct Core
type Core (line 87) | struct Core
type CoreInput (line 87) | struct CoreInput
FILE: core/core_delegate.c
function delegate_interpreterDidFail (line 24) | void delegate_interpreterDidFail(struct Core *core, struct CoreError cor...
function delegate_diskDriveWillAccess (line 32) | bool delegate_diskDriveWillAccess(struct Core *core)
function delegate_diskDriveDidSave (line 41) | void delegate_diskDriveDidSave(struct Core *core)
function delegate_diskDriveIsFull (line 49) | void delegate_diskDriveIsFull(struct Core *core)
function delegate_controlsDidChange (line 57) | void delegate_controlsDidChange(struct Core *core)
function delegate_persistentRamWillAccess (line 85) | void delegate_persistentRamWillAccess(struct Core *core, uint8_t *destin...
function delegate_persistentRamDidChange (line 93) | void delegate_persistentRamDidChange(struct Core *core, uint8_t *data, i...
FILE: core/core_delegate.h
type Core (line 27) | struct Core
type KeyboardMode (line 29) | enum KeyboardMode {
type ControlsInfo (line 35) | struct ControlsInfo {
type CoreDelegate (line 42) | struct CoreDelegate {
type Core (line 67) | struct Core
type CoreError (line 67) | struct CoreError
type Core (line 68) | struct Core
type Core (line 69) | struct Core
type Core (line 70) | struct Core
type Core (line 71) | struct Core
type Core (line 72) | struct Core
type Core (line 73) | struct Core
FILE: core/core_stats.c
function stats_init (line 26) | void stats_init(struct Stats *stats)
function stats_deinit (line 40) | void stats_deinit(struct Stats *stats)
function stats_update (line 52) | struct CoreError stats_update(struct Stats *stats, const char *sourceCode)
FILE: core/core_stats.h
type Stats (line 29) | struct Stats {
type Stats (line 36) | struct Stats
type Stats (line 37) | struct Stats
type CoreError (line 38) | struct CoreError
type Stats (line 38) | struct Stats
FILE: core/datamanager/data_manager.c
type DataManager (line 28) | struct DataManager
function data_init (line 30) | void data_init(struct DataManager *manager)
function data_deinit (line 35) | void data_deinit(struct DataManager *manager)
function data_reset (line 46) | void data_reset(struct DataManager *manager)
function data_import (line 62) | struct CoreError data_import(struct DataManager *manager, const char *in...
function data_uppercaseImport (line 76) | struct CoreError data_uppercaseImport(struct DataManager *manager, const...
type DataManager (line 201) | struct DataManager
type DataEntry (line 232) | struct DataEntry
function data_calcOutputSize (line 266) | int data_calcOutputSize(struct DataManager *manager)
function data_currentSize (line 288) | int data_currentSize(struct DataManager *manager)
function data_canSetEntry (line 298) | bool data_canSetEntry(struct DataManager *manager, int index, int length)
function data_setEntry (line 311) | void data_setEntry(struct DataManager *manager, int index, const char *c...
FILE: core/datamanager/data_manager.h
type DataEntry (line 33) | struct DataEntry {
type DataManager (line 39) | struct DataManager {
type DataManager (line 45) | struct DataManager
type DataManager (line 46) | struct DataManager
type DataManager (line 47) | struct DataManager
type CoreError (line 48) | struct CoreError
type DataManager (line 48) | struct DataManager
type CoreError (line 49) | struct CoreError
type DataManager (line 49) | struct DataManager
type DataManager (line 50) | struct DataManager
type DataManager (line 52) | struct DataManager
type DataManager (line 54) | struct DataManager
type DataManager (line 55) | struct DataManager
FILE: core/interpreter/cmd_audio.c
function cmd_SOUND (line 25) | enum ErrorCode cmd_SOUND(struct Core *core)
function cmd_VOLUME (line 111) | enum ErrorCode cmd_VOLUME(struct Core *core)
function cmd_ENVELOPE (line 156) | enum ErrorCode cmd_ENVELOPE(struct Core *core)
function cmd_LFO (line 224) | enum ErrorCode cmd_LFO(struct Core *core)
function cmd_LFO_A (line 292) | enum ErrorCode cmd_LFO_A(struct Core *core)
function cmd_LFO_WAVE (line 331) | enum ErrorCode cmd_LFO_WAVE(struct Core *core)
function cmd_PLAY (line 389) | enum ErrorCode cmd_PLAY(struct Core *core)
function cmd_STOP (line 442) | enum ErrorCode cmd_STOP(struct Core *core)
function cmd_MUSIC (line 469) | enum ErrorCode cmd_MUSIC(struct Core *core)
function cmd_TRACK (line 489) | enum ErrorCode cmd_TRACK(struct Core *core)
function cmd_SOUND_SOURCE (line 516) | enum ErrorCode cmd_SOUND_SOURCE(struct Core *core)
function fnc_MUSIC (line 538) | struct TypedValue fnc_MUSIC(struct Core *core)
FILE: core/interpreter/cmd_audio.h
type Core (line 28) | struct Core
type ErrorCode (line 30) | enum ErrorCode
type Core (line 30) | struct Core
type ErrorCode (line 32) | enum ErrorCode
type Core (line 32) | struct Core
type ErrorCode (line 33) | enum ErrorCode
type Core (line 33) | struct Core
type ErrorCode (line 34) | enum ErrorCode
type Core (line 34) | struct Core
type ErrorCode (line 35) | enum ErrorCode
type Core (line 35) | struct Core
type ErrorCode (line 36) | enum ErrorCode
type Core (line 36) | struct Core
type ErrorCode (line 37) | enum ErrorCode
type Core (line 37) | struct Core
type ErrorCode (line 38) | enum ErrorCode
type Core (line 38) | struct Core
type ErrorCode (line 39) | enum ErrorCode
type Core (line 39) | struct Core
type ErrorCode (line 40) | enum ErrorCode
type Core (line 40) | struct Core
type ErrorCode (line 41) | enum ErrorCode
type Core (line 41) | struct Core
type TypedValue (line 42) | struct TypedValue
type Core (line 42) | struct Core
FILE: core/interpreter/cmd_background.c
function cmd_BG (line 29) | enum ErrorCode cmd_BG(struct Core *core)
function cmd_BG_SOURCE (line 48) | enum ErrorCode cmd_BG_SOURCE(struct Core *core)
function cmd_BG_COPY (line 107) | enum ErrorCode cmd_BG_COPY(struct Core *core)
function cmd_BG_SCROLL (line 167) | enum ErrorCode cmd_BG_SCROLL(struct Core *core)
function cmd_ATTR (line 227) | enum ErrorCode cmd_ATTR(struct Core *core)
function cmd_PAL (line 246) | enum ErrorCode cmd_PAL(struct Core *core)
function cmd_FLIP (line 265) | enum ErrorCode cmd_FLIP(struct Core *core)
function cmd_PRIO (line 293) | enum ErrorCode cmd_PRIO(struct Core *core)
function cmd_BG_FILL (line 312) | enum ErrorCode cmd_BG_FILL(struct Core *core)
function cmd_BG_TINT (line 377) | enum ErrorCode cmd_BG_TINT(struct Core *core)
function cmd_CELL (line 425) | enum ErrorCode cmd_CELL(struct Core *core)
function fnc_CELL (line 461) | struct TypedValue fnc_CELL(struct Core *core)
function cmd_MCELL (line 511) | enum ErrorCode cmd_MCELL(struct Core *core)
function fnc_MCELL (line 548) | struct TypedValue fnc_MCELL(struct Core *core)
function cmd_TINT (line 588) | enum ErrorCode cmd_TINT(struct Core *core)
FILE: core/interpreter/cmd_background.h
type Core (line 28) | struct Core
type ErrorCode (line 30) | enum ErrorCode
type Core (line 30) | struct Core
type ErrorCode (line 31) | enum ErrorCode
type Core (line 31) | struct Core
type ErrorCode (line 32) | enum ErrorCode
type Core (line 32) | struct Core
type ErrorCode (line 33) | enum ErrorCode
type Core (line 33) | struct Core
type ErrorCode (line 34) | enum ErrorCode
type Core (line 34) | struct Core
type ErrorCode (line 35) | enum ErrorCode
type Core (line 35) | struct Core
type ErrorCode (line 36) | enum ErrorCode
type Core (line 36) | struct Core
type ErrorCode (line 37) | enum ErrorCode
type Core (line 37) | struct Core
type ErrorCode (line 38) | enum ErrorCode
type Core (line 38) | struct Core
type ErrorCode (line 39) | enum ErrorCode
type Core (line 39) | struct Core
type ErrorCode (line 40) | enum ErrorCode
type Core (line 40) | struct Core
type TypedValue (line 41) | struct TypedValue
type Core (line 41) | struct Core
type ErrorCode (line 42) | enum ErrorCode
type Core (line 42) | struct Core
type TypedValue (line 43) | struct TypedValue
type Core (line 43) | struct Core
type ErrorCode (line 44) | enum ErrorCode
type Core (line 44) | struct Core
FILE: core/interpreter/cmd_control.c
function cmd_END (line 25) | enum ErrorCode cmd_END(struct Core *core)
function cmd_IF (line 43) | enum ErrorCode cmd_IF(struct Core *core, bool isAfterBlockElse)
function cmd_ELSE (line 94) | enum ErrorCode cmd_ELSE(struct Core *core)
function cmd_END_IF (line 157) | enum ErrorCode cmd_END_IF(struct Core *core)
function cmd_FOR (line 197) | enum ErrorCode cmd_FOR(struct Core *core)
function cmd_NEXT (line 277) | enum ErrorCode cmd_NEXT(struct Core *core)
function cmd_GOTO (line 363) | enum ErrorCode cmd_GOTO(struct Core *core)
function cmd_GOSUB (line 391) | enum ErrorCode cmd_GOSUB(struct Core *core)
function cmd_RETURN (line 422) | enum ErrorCode cmd_RETURN(struct Core *core)
function cmd_WAIT (line 476) | enum ErrorCode cmd_WAIT(struct Core *core)
function cmd_ON (line 507) | enum ErrorCode cmd_ON(struct Core *core)
function cmd_DO (line 570) | enum ErrorCode cmd_DO(struct Core *core)
function cmd_LOOP (line 591) | enum ErrorCode cmd_LOOP(struct Core *core)
function cmd_REPEAT (line 619) | enum ErrorCode cmd_REPEAT(struct Core *core)
function cmd_UNTIL (line 640) | enum ErrorCode cmd_UNTIL(struct Core *core)
function cmd_WHILE (line 681) | enum ErrorCode cmd_WHILE(struct Core *core)
function cmd_WEND (line 714) | enum ErrorCode cmd_WEND(struct Core *core)
function cmd_EXIT (line 742) | enum ErrorCode cmd_EXIT(struct Core *core)
function cmd_SYSTEM (line 768) | enum ErrorCode cmd_SYSTEM(struct Core *core)
FILE: core/interpreter/cmd_control.h
type Core (line 28) | struct Core
type ErrorCode (line 30) | enum ErrorCode
type Core (line 30) | struct Core
type ErrorCode (line 31) | enum ErrorCode
type Core (line 31) | struct Core
type ErrorCode (line 32) | enum ErrorCode
type Core (line 32) | struct Core
type ErrorCode (line 33) | enum ErrorCode
type Core (line 33) | struct Core
type ErrorCode (line 34) | enum ErrorCode
type Core (line 34) | struct Core
type ErrorCode (line 35) | enum ErrorCode
type Core (line 35) | struct Core
type ErrorCode (line 36) | enum ErrorCode
type Core (line 36) | struct Core
type ErrorCode (line 37) | enum ErrorCode
type Core (line 37) | struct Core
type ErrorCode (line 38) | enum ErrorCode
type Core (line 38) | struct Core
type ErrorCode (line 39) | enum ErrorCode
type Core (line 39) | struct Core
type ErrorCode (line 40) | enum ErrorCode
type Core (line 40) | struct Core
type ErrorCode (line 41) | enum ErrorCode
type Core (line 41) | struct Core
type ErrorCode (line 42) | enum ErrorCode
type Core (line 42) | struct Core
type ErrorCode (line 43) | enum ErrorCode
type Core (line 43) | struct Core
type ErrorCode (line 44) | enum ErrorCode
type Core (line 44) | struct Core
type ErrorCode (line 45) | enum ErrorCode
type Core (line 45) | struct Core
type ErrorCode (line 46) | enum ErrorCode
type Core (line 46) | struct Core
type ErrorCode (line 47) | enum ErrorCode
type Core (line 47) | struct Core
type ErrorCode (line 48) | enum ErrorCode
type Core (line 48) | struct Core
FILE: core/interpreter/cmd_data.c
function cmd_DATA (line 24) | enum ErrorCode cmd_DATA(struct Core *core)
function cmd_READ (line 73) | enum ErrorCode cmd_READ(struct Core *core)
function cmd_RESTORE (line 123) | enum ErrorCode cmd_RESTORE(struct Core *core)
FILE: core/interpreter/cmd_data.h
type Core (line 27) | struct Core
type ErrorCode (line 29) | enum ErrorCode
type Core (line 29) | struct Core
type ErrorCode (line 30) | enum ErrorCode
type Core (line 30) | struct Core
type ErrorCode (line 31) | enum ErrorCode
type Core (line 31) | struct Core
FILE: core/interpreter/cmd_files.c
function cmd_LOAD (line 26) | enum ErrorCode cmd_LOAD(struct Core *core)
function cmd_SAVE (line 88) | enum ErrorCode cmd_SAVE(struct Core *core)
function cmd_FILES (line 149) | enum ErrorCode cmd_FILES(struct Core *core)
function fnc_FILE (line 175) | struct TypedValue fnc_FILE(struct Core *core)
function fnc_FSIZE (line 212) | struct TypedValue fnc_FSIZE(struct Core *core)
FILE: core/interpreter/cmd_files.h
type Core (line 28) | struct Core
type ErrorCode (line 30) | enum ErrorCode
type Core (line 30) | struct Core
type ErrorCode (line 31) | enum ErrorCode
type Core (line 31) | struct Core
type ErrorCode (line 32) | enum ErrorCode
type Core (line 32) | struct Core
type TypedValue (line 33) | struct TypedValue
type Core (line 33) | struct Core
type TypedValue (line 34) | struct TypedValue
type Core (line 34) | struct Core
FILE: core/interpreter/cmd_io.c
function cmd_KEYBOARD (line 25) | enum ErrorCode cmd_KEYBOARD(struct Core *core)
function cmd_TOUCHSCREEN (line 47) | enum ErrorCode cmd_TOUCHSCREEN(struct Core *core)
function cmd_GAMEPAD (line 64) | enum ErrorCode cmd_GAMEPAD(struct Core *core)
function cmd_PAUSE (line 91) | enum ErrorCode cmd_PAUSE(struct Core *core)
function fnc_UP_DOWN_LEFT_RIGHT (line 125) | struct TypedValue fnc_UP_DOWN_LEFT_RIGHT(struct Core *core)
function fnc_BUTTON (line 196) | struct TypedValue fnc_BUTTON(struct Core *core)
function fnc_TOUCH (line 263) | struct TypedValue fnc_TOUCH(struct Core *core)
function fnc_TAP (line 282) | struct TypedValue fnc_TAP(struct Core *core)
function fnc_TOUCH_X_Y (line 301) | struct TypedValue fnc_TOUCH_X_Y(struct Core *core)
function fnc_PAUSE (line 332) | struct TypedValue fnc_PAUSE(struct Core *core)
FILE: core/interpreter/cmd_io.h
type Core (line 28) | struct Core
type ErrorCode (line 30) | enum ErrorCode
type Core (line 30) | struct Core
type ErrorCode (line 31) | enum ErrorCode
type Core (line 31) | struct Core
type ErrorCode (line 32) | enum ErrorCode
type Core (line 32) | struct Core
type ErrorCode (line 33) | enum ErrorCode
type Core (line 33) | struct Core
type TypedValue (line 34) | struct TypedValue
type Core (line 34) | struct Core
type TypedValue (line 35) | struct TypedValue
type Core (line 35) | struct Core
type TypedValue (line 36) | struct TypedValue
type Core (line 36) | struct Core
type TypedValue (line 37) | struct TypedValue
type Core (line 37) | struct Core
type TypedValue (line 38) | struct TypedValue
type Core (line 38) | struct Core
type TypedValue (line 39) | struct TypedValue
type Core (line 39) | struct Core
FILE: core/interpreter/cmd_maths.c
function fnc_math0 (line 28) | struct TypedValue fnc_math0(struct Core *core)
function fnc_math1 (line 55) | struct TypedValue fnc_math1(struct Core *core)
function fnc_math2 (line 154) | struct TypedValue fnc_math2(struct Core *core)
function cmd_RANDOMIZE (line 208) | enum ErrorCode cmd_RANDOMIZE(struct Core *core)
function fnc_RND (line 227) | struct TypedValue fnc_RND(struct Core *core)
function cmd_ADD (line 273) | enum ErrorCode cmd_ADD(struct Core *core)
function cmd_INC_DEC (line 334) | enum ErrorCode cmd_INC_DEC(struct Core *core)
FILE: core/interpreter/cmd_maths.h
type Core (line 27) | struct Core
type TypedValue (line 29) | struct TypedValue
type Core (line 29) | struct Core
type TypedValue (line 30) | struct TypedValue
type Core (line 30) | struct Core
type TypedValue (line 31) | struct TypedValue
type Core (line 31) | struct Core
type ErrorCode (line 32) | enum ErrorCode
type Core (line 32) | struct Core
type TypedValue (line 33) | struct TypedValue
type Core (line 33) | struct Core
type ErrorCode (line 34) | enum ErrorCode
type Core (line 34) | struct Core
type ErrorCode (line 35) | enum ErrorCode
type Core (line 35) | struct Core
FILE: core/interpreter/cmd_memory.c
function fnc_PEEK (line 26) | struct TypedValue fnc_PEEK(struct Core *core)
function cmd_POKE (line 92) | enum ErrorCode cmd_POKE(struct Core *core)
function cmd_FILL (line 151) | enum ErrorCode cmd_FILL(struct Core *core)
function cmd_COPY (line 195) | enum ErrorCode cmd_COPY(struct Core *core)
function fnc_ROM_SIZE (line 251) | struct TypedValue fnc_ROM_SIZE(struct Core *core)
function cmd_ROL_ROR (line 289) | enum ErrorCode cmd_ROL_ROR(struct Core *core)
FILE: core/interpreter/cmd_memory.h
type Core (line 27) | struct Core
type TypedValue (line 29) | struct TypedValue
type Core (line 29) | struct Core
type ErrorCode (line 30) | enum ErrorCode
type Core (line 30) | struct Core
type ErrorCode (line 31) | enum ErrorCode
type Core (line 31) | struct Core
type ErrorCode (line 32) | enum ErrorCode
type Core (line 32) | struct Core
type TypedValue (line 33) | struct TypedValue
type Core (line 33) | struct Core
type ErrorCode (line 34) | enum ErrorCode
type Core (line 34) | struct Core
FILE: core/interpreter/cmd_screen.c
function cmd_PALETTE (line 27) | enum ErrorCode cmd_PALETTE(struct Core *core)
function cmd_SCROLL (line 83) | enum ErrorCode cmd_SCROLL(struct Core *core)
function cmd_DISPLAY (line 135) | enum ErrorCode cmd_DISPLAY(struct Core *core)
function cmd_SPRITE_VIEW (line 156) | enum ErrorCode cmd_SPRITE_VIEW(struct Core *core)
function cmd_BG_VIEW (line 177) | enum ErrorCode cmd_BG_VIEW(struct Core *core)
function cmd_CELL_SIZE (line 210) | enum ErrorCode cmd_CELL_SIZE(struct Core *core)
function fnc_COLOR (line 245) | struct TypedValue fnc_COLOR(struct Core *core)
function fnc_screen0 (line 284) | struct TypedValue fnc_screen0(struct Core *core)
function fnc_SCROLL_X_Y (line 320) | struct TypedValue fnc_SCROLL_X_Y(struct Core *core)
FILE: core/interpreter/cmd_screen.h
type Core (line 28) | struct Core
type ErrorCode (line 30) | enum ErrorCode
type Core (line 30) | struct Core
type ErrorCode (line 31) | enum ErrorCode
type Core (line 31) | struct Core
type ErrorCode (line 32) | enum ErrorCode
type Core (line 32) | struct Core
type ErrorCode (line 33) | enum ErrorCode
type Core (line 33) | struct Core
type ErrorCode (line 34) | enum ErrorCode
type Core (line 34) | struct Core
type ErrorCode (line 35) | enum ErrorCode
type Core (line 35) | struct Core
type TypedValue (line 36) | struct TypedValue
type Core (line 36) | struct Core
type TypedValue (line 37) | struct TypedValue
type Core (line 37) | struct Core
type TypedValue (line 38) | struct TypedValue
type Core (line 38) | struct Core
FILE: core/interpreter/cmd_sprites.c
function cmd_SPRITE (line 29) | enum ErrorCode cmd_SPRITE(struct Core *core)
function cmd_SPRITE_A (line 96) | enum ErrorCode cmd_SPRITE_A(struct Core *core)
function cmd_SPRITE_OFF (line 140) | enum ErrorCode cmd_SPRITE_OFF(struct Core *core)
function fnc_SPRITE (line 187) | struct TypedValue fnc_SPRITE(struct Core *core)
function fnc_SPRITE_HIT (line 240) | struct TypedValue fnc_SPRITE_HIT(struct Core *core)
function fnc_HIT (line 297) | struct TypedValue fnc_HIT(struct Core *core)
FILE: core/interpreter/cmd_sprites.h
type Core (line 28) | struct Core
type ErrorCode (line 30) | enum ErrorCode
type Core (line 30) | struct Core
type ErrorCode (line 31) | enum ErrorCode
type Core (line 31) | struct Core
type ErrorCode (line 32) | enum ErrorCode
type Core (line 32) | struct Core
type TypedValue (line 33) | struct TypedValue
type Core (line 33) | struct Core
type TypedValue (line 34) | struct TypedValue
type Core (line 34) | struct Core
type TypedValue (line 35) | struct TypedValue
type Core (line 35) | struct Core
FILE: core/interpreter/cmd_strings.c
function fnc_ASC (line 29) | struct TypedValue fnc_ASC(struct Core *core)
function fnc_BIN_HEX (line 62) | struct TypedValue fnc_BIN_HEX(struct Core *core)
function fnc_CHR (line 119) | struct TypedValue fnc_CHR(struct Core *core)
function fnc_INKEY (line 153) | struct TypedValue fnc_INKEY(struct Core *core)
function fnc_INSTR (line 187) | struct TypedValue fnc_INSTR(struct Core *core)
function fnc_LEFTStr_RIGHTStr (line 257) | struct TypedValue fnc_LEFTStr_RIGHTStr(struct Core *core)
function fnc_LEN (line 314) | struct TypedValue fnc_LEN(struct Core *core)
function fnc_MID (line 344) | struct TypedValue fnc_MID(struct Core *core)
function fnc_STR (line 419) | struct TypedValue fnc_STR(struct Core *core)
function fnc_VAL (line 453) | struct TypedValue fnc_VAL(struct Core *core)
function cmd_LEFT_RIGHT (line 483) | enum ErrorCode cmd_LEFT_RIGHT(struct Core *core)
function cmd_MID (line 573) | enum ErrorCode cmd_MID(struct Core *core)
FILE: core/interpreter/cmd_strings.h
type Core (line 27) | struct Core
type TypedValue (line 29) | struct TypedValue
type Core (line 29) | struct Core
type TypedValue (line 30) | struct TypedValue
type Core (line 30) | struct Core
type TypedValue (line 31) | struct TypedValue
type Core (line 31) | struct Core
type TypedValue (line 32) | struct TypedValue
type Core (line 32) | struct Core
type TypedValue (line 33) | struct TypedValue
type Core (line 33) | struct Core
type TypedValue (line 34) | struct TypedValue
type Core (line 34) | struct Core
type TypedValue (line 35) | struct TypedValue
type Core (line 35) | struct Core
type TypedValue (line 36) | struct TypedValue
type Core (line 36) | struct Core
type TypedValue (line 37) | struct TypedValue
type Core (line 37) | struct Core
type TypedValue (line 38) | struct TypedValue
type Core (line 38) | struct Core
type ErrorCode (line 40) | enum ErrorCode
type Core (line 40) | struct Core
type ErrorCode (line 41) | enum ErrorCode
type Core (line 41) | struct Core
FILE: core/interpreter/cmd_subs.c
function cmd_CALL (line 24) | enum ErrorCode cmd_CALL(struct Core *core)
function cmd_SUB (line 173) | enum ErrorCode cmd_SUB(struct Core *core)
function cmd_END_SUB (line 234) | enum ErrorCode cmd_END_SUB(struct Core *core)
function cmd_GLOBAL (line 349) | enum ErrorCode cmd_GLOBAL(struct Core *core)
function cmd_EXIT_SUB (line 387) | enum ErrorCode cmd_EXIT_SUB(struct Core *core)
FILE: core/interpreter/cmd_subs.h
type Core (line 27) | struct Core
type ErrorCode (line 29) | enum ErrorCode
type Core (line 29) | struct Core
type ErrorCode (line 30) | enum ErrorCode
type Core (line 30) | struct Core
type ErrorCode (line 31) | enum ErrorCode
type Core (line 31) | struct Core
type ErrorCode (line 33) | enum ErrorCode
type Core (line 33) | struct Core
type ErrorCode (line 34) | enum ErrorCode
type Core (line 34) | struct Core
FILE: core/interpreter/cmd_text.c
function cmd_PRINT (line 30) | enum ErrorCode cmd_PRINT(struct Core *core)
function cmd_INPUT (line 92) | enum ErrorCode cmd_INPUT(struct Core *core)
function cmd_endINPUT (line 129) | enum ErrorCode cmd_endINPUT(struct Core *core)
function cmd_TEXT (line 160) | enum ErrorCode cmd_TEXT(struct Core *core)
function cmd_NUMBER (line 196) | enum ErrorCode cmd_NUMBER(struct Core *core)
function cmd_CLS (line 241) | enum ErrorCode cmd_CLS(struct Core *core)
function cmd_WINDOW (line 275) | enum ErrorCode cmd_WINDOW(struct Core *core)
function cmd_FONT (line 333) | enum ErrorCode cmd_FONT(struct Core *core)
function cmd_LOCATE (line 352) | enum ErrorCode cmd_LOCATE(struct Core *core)
function fnc_CURSOR (line 381) | struct TypedValue fnc_CURSOR(struct Core *core)
function cmd_CLW (line 412) | enum ErrorCode cmd_CLW(struct Core *core)
function cmd_TRACE (line 428) | enum ErrorCode cmd_TRACE(struct Core *core)
FILE: core/interpreter/cmd_text.h
type Core (line 28) | struct Core
type ErrorCode (line 30) | enum ErrorCode
type Core (line 30) | struct Core
type ErrorCode (line 31) | enum ErrorCode
type Core (line 31) | struct Core
type ErrorCode (line 32) | enum ErrorCode
type Core (line 32) | struct Core
type ErrorCode (line 33) | enum ErrorCode
type Core (line 33) | struct Core
type ErrorCode (line 34) | enum ErrorCode
type Core (line 34) | struct Core
type ErrorCode (line 35) | enum ErrorCode
type Core (line 35) | struct Core
type ErrorCode (line 36) | enum ErrorCode
type Core (line 36) | struct Core
type ErrorCode (line 37) | enum ErrorCode
type Core (line 37) | struct Core
type ErrorCode (line 38) | enum ErrorCode
type Core (line 38) | struct Core
type TypedValue (line 39) | struct TypedValue
type Core (line 39) | struct Core
type ErrorCode (line 40) | enum ErrorCode
type Core (line 40) | struct Core
type ErrorCode (line 41) | enum ErrorCode
type Core (line 41) | struct Core
FILE: core/interpreter/cmd_variables.c
function cmd_LET (line 24) | enum ErrorCode cmd_LET(struct Core *core)
function cmd_DIM (line 60) | enum ErrorCode cmd_DIM(struct Core *core)
function fnc_UBOUND (line 132) | struct TypedValue fnc_UBOUND(struct Core *core)
function cmd_SWAP (line 178) | enum ErrorCode cmd_SWAP(struct Core *core)
FILE: core/interpreter/cmd_variables.h
type Core (line 27) | struct Core
type ErrorCode (line 29) | enum ErrorCode
type Core (line 29) | struct Core
type ErrorCode (line 30) | enum ErrorCode
type Core (line 30) | struct Core
type TypedValue (line 31) | struct TypedValue
type Core (line 31) | struct Core
type ErrorCode (line 32) | enum ErrorCode
type Core (line 32) | struct Core
FILE: core/interpreter/data.c
function dat_nextData (line 24) | void dat_nextData(struct Interpreter *interpreter)
function dat_restoreData (line 47) | void dat_restoreData(struct Interpreter *interpreter, struct Token *jump...
FILE: core/interpreter/data.h
type Interpreter (line 26) | struct Interpreter
type Token (line 27) | struct Token
type Interpreter (line 29) | struct Interpreter
type Interpreter (line 30) | struct Interpreter
type Token (line 30) | struct Token
FILE: core/interpreter/error.c
type ErrorCode (line 89) | enum ErrorCode
function err_makeCoreError (line 94) | struct CoreError err_makeCoreError(enum ErrorCode code, int sourcePosition)
function err_noCoreError (line 100) | struct CoreError err_noCoreError(void)
FILE: core/interpreter/error.h
type ErrorCode (line 26) | enum ErrorCode {
type CoreError (line 92) | struct CoreError {
type ErrorCode (line 97) | enum ErrorCode
type CoreError (line 98) | struct CoreError
type ErrorCode (line 98) | enum ErrorCode
type CoreError (line 99) | struct CoreError
FILE: core/interpreter/interpreter.c
type TypedValue (line 45) | struct TypedValue
type Core (line 45) | struct Core
type TypedValue (line 46) | struct TypedValue
type Core (line 46) | struct Core
type TypedValue (line 47) | struct TypedValue
type Core (line 47) | struct Core
type ErrorCode (line 48) | enum ErrorCode
type Core (line 48) | struct Core
function itp_init (line 50) | void itp_init(struct Core *core)
function itp_deinit (line 61) | void itp_deinit(struct Core *core)
function itp_compileProgram (line 75) | struct CoreError itp_compileProgram(struct Core *core, const char *sourc...
function itp_runProgram (line 157) | void itp_runProgram(struct Core *core)
function itp_runInterrupt (line 215) | void itp_runInterrupt(struct Core *core, enum InterruptType type)
function itp_didFinishVBL (line 303) | void itp_didFinishVBL(struct Core *core)
function itp_endProgram (line 360) | void itp_endProgram(struct Core *core)
function itp_freeProgram (line 367) | void itp_freeProgram(struct Core *core)
function itp_getIdentifierTokenValueType (line 391) | enum ValueType itp_getIdentifierTokenValueType(struct Token *token)
type Core (line 404) | struct Core
type ValueType (line 404) | enum ValueType
type ErrorCode (line 404) | enum ErrorCode
type Interpreter (line 406) | struct Interpreter
type Token (line 408) | struct Token
type ValueType (line 416) | enum ValueType
type ArrayVariable (line 431) | struct ArrayVariable
type TypedValue (line 447) | struct TypedValue
type SimpleVariable (line 499) | struct SimpleVariable
function itp_checkTypeClass (line 526) | enum ErrorCode itp_checkTypeClass(struct Interpreter *interpreter, enum ...
function itp_evaluateExpression (line 542) | struct TypedValue itp_evaluateExpression(struct Core *core, enum TypeCla...
function itp_evaluateNumericExpression (line 557) | struct TypedValue itp_evaluateNumericExpression(struct Core *core, int m...
function itp_evaluateOptionalExpression (line 586) | struct TypedValue itp_evaluateOptionalExpression(struct Core *core, enum...
function itp_evaluateOptionalNumericExpression (line 597) | struct TypedValue itp_evaluateOptionalNumericExpression(struct Core *cor...
function itp_isTokenLevel (line 608) | bool itp_isTokenLevel(enum TokenType token, int level)
function itp_evaluateExpressionLevel (line 634) | struct TypedValue itp_evaluateExpressionLevel(struct Core *core, int level)
function itp_evaluatePrimaryExpression (line 919) | struct TypedValue itp_evaluatePrimaryExpression(struct Core *core)
function itp_isEndOfCommand (line 1001) | bool itp_isEndOfCommand(struct Interpreter *interpreter)
function itp_endOfCommand (line 1007) | enum ErrorCode itp_endOfCommand(struct Interpreter *interpreter)
function itp_getNextTokenType (line 1019) | enum TokenType itp_getNextTokenType(struct Interpreter *interpreter)
function itp_evaluateFunction (line 1024) | struct TypedValue itp_evaluateFunction(struct Core *core)
function itp_evaluateCommand (line 1175) | enum ErrorCode itp_evaluateCommand(struct Core *core)
function itp_labelStackError (line 1529) | enum ErrorCode itp_labelStackError(struct LabelStackItem *item)
FILE: core/interpreter/interpreter.h
type Core (line 43) | struct Core
type Pass (line 45) | enum Pass {
type State (line 50) | enum State {
type Mode (line 59) | enum Mode {
type InterruptType (line 65) | enum InterruptType {
type Interpreter (line 70) | struct Interpreter {
type Core (line 123) | struct Core
type Core (line 124) | struct Core
type CoreError (line 125) | struct CoreError
type Core (line 125) | struct Core
type Core (line 126) | struct Core
type Core (line 127) | struct Core
type InterruptType (line 127) | enum InterruptType
type Core (line 128) | struct Core
type Core (line 129) | struct Core
type Core (line 130) | struct Core
type ValueType (line 132) | enum ValueType
type Token (line 132) | struct Token
type Core (line 133) | struct Core
type ValueType (line 133) | enum ValueType
type ErrorCode (line 133) | enum ErrorCode
type TypedValue (line 134) | struct TypedValue
type Core (line 134) | struct Core
type TypeClass (line 134) | enum TypeClass
type TypedValue (line 135) | struct TypedValue
type Core (line 135) | struct Core
type TypedValue (line 136) | struct TypedValue
type Core (line 136) | struct Core
type TypeClass (line 136) | enum TypeClass
type TypedValue (line 137) | struct TypedValue
type Core (line 137) | struct Core
type Interpreter (line 138) | struct Interpreter
type ErrorCode (line 139) | enum ErrorCode
type Interpreter (line 139) | struct Interpreter
type ErrorCode (line 140) | enum ErrorCode
type LabelStackItem (line 140) | struct LabelStackItem
FILE: core/interpreter/interpreter_utils.c
function itp_evaluateSimpleAttributes (line 24) | enum ErrorCode itp_evaluateSimpleAttributes(struct Core *core, struct Si...
function itp_evaluateCharAttributes (line 106) | struct TypedValue itp_evaluateCharAttributes(struct Core *core, union Ch...
function itp_evaluateDisplayAttributes (line 192) | struct TypedValue itp_evaluateDisplayAttributes(struct Core *core, union...
function itp_evaluateLFOAttributes (line 276) | struct TypedValue itp_evaluateLFOAttributes(struct Core *core, union LFO...
FILE: core/interpreter/interpreter_utils.h
type Core (line 30) | struct Core
type SimpleAttributes (line 32) | struct SimpleAttributes
type ErrorCode (line 41) | enum ErrorCode
type Core (line 41) | struct Core
type SimpleAttributes (line 41) | struct SimpleAttributes
type TypedValue (line 43) | struct TypedValue
type Core (line 43) | struct Core
type TypedValue (line 44) | struct TypedValue
type Core (line 44) | struct Core
type TypedValue (line 45) | struct TypedValue
type Core (line 45) | struct Core
FILE: core/interpreter/labels.c
function lab_pushLabelStackItem (line 24) | enum ErrorCode lab_pushLabelStackItem(struct Interpreter *interpreter, e...
type LabelStackItem (line 34) | struct LabelStackItem
type Interpreter (line 34) | struct Interpreter
type LabelStackItem (line 44) | struct LabelStackItem
type Interpreter (line 44) | struct Interpreter
type LabelStackItem (line 53) | struct LabelStackItem
type Interpreter (line 53) | struct Interpreter
type LabelType (line 53) | enum LabelType
type LabelStackItem (line 58) | struct LabelStackItem
FILE: core/interpreter/labels.h
type Interpreter (line 26) | struct Interpreter
type Token (line 27) | struct Token
type LabelType (line 29) | enum LabelType {
type LabelStackItem (line 45) | struct LabelStackItem {
type ErrorCode (line 50) | enum ErrorCode
type Interpreter (line 50) | struct Interpreter
type LabelType (line 50) | enum LabelType
type Token (line 50) | struct Token
type LabelStackItem (line 51) | struct LabelStackItem
type Interpreter (line 51) | struct Interpreter
type LabelStackItem (line 52) | struct LabelStackItem
type Interpreter (line 52) | struct Interpreter
type LabelStackItem (line 53) | struct LabelStackItem
type Interpreter (line 53) | struct Interpreter
type LabelType (line 53) | enum LabelType
FILE: core/interpreter/rcstring.c
type RCString (line 25) | struct RCString
type RCString (line 27) | struct RCString
type RCString (line 28) | struct RCString
function rcstring_retain (line 41) | void rcstring_retain(struct RCString *string)
function rcstring_release (line 46) | void rcstring_release(struct RCString *string)
FILE: core/interpreter/rcstring.h
type RCString (line 26) | struct RCString {
type RCString (line 31) | struct RCString
type RCString (line 32) | struct RCString
type RCString (line 33) | struct RCString
FILE: core/interpreter/string_utils.c
function lineNumber (line 74) | int lineNumber(const char *source, int pos)
function stringConvertCopy (line 87) | void stringConvertCopy(char *dest, const char *source, size_t length)
FILE: core/interpreter/token.h
type TokenType (line 27) | enum TokenType {
type Token (line 238) | struct Token {
FILE: core/interpreter/tokenizer.c
function tok_tokenizeProgram (line 28) | struct CoreError tok_tokenizeProgram(struct Tokenizer *tokenizer, const ...
function tok_tokenizeUppercaseProgram (line 39) | struct CoreError tok_tokenizeUppercaseProgram(struct Tokenizer *tokenize...
function tok_freeTokens (line 354) | void tok_freeTokens(struct Tokenizer *tokenizer)
type JumpLabelItem (line 368) | struct JumpLabelItem
type Tokenizer (line 368) | struct Tokenizer
type JumpLabelItem (line 370) | struct JumpLabelItem
function tok_setJumpLabel (line 382) | enum ErrorCode tok_setJumpLabel(struct Tokenizer *tokenizer, int symbolI...
type SubItem (line 399) | struct SubItem
type Tokenizer (line 399) | struct Tokenizer
type SubItem (line 401) | struct SubItem
function tok_setSub (line 413) | enum ErrorCode tok_setSub(struct Tokenizer *tokenizer, int symbolIndex, ...
FILE: core/interpreter/tokenizer.h
type Symbol (line 28) | struct Symbol {
type JumpLabelItem (line 32) | struct JumpLabelItem {
type SubItem (line 37) | struct SubItem {
type Tokenizer (line 42) | struct Tokenizer
type CoreError (line 55) | struct CoreError
type Tokenizer (line 55) | struct Tokenizer
type CoreError (line 56) | struct CoreError
type Tokenizer (line 56) | struct Tokenizer
type Tokenizer (line 57) | struct Tokenizer
type JumpLabelItem (line 58) | struct JumpLabelItem
type Tokenizer (line 58) | struct Tokenizer
type ErrorCode (line 59) | enum ErrorCode
type Tokenizer (line 59) | struct Tokenizer
type Token (line 59) | struct Token
type SubItem (line 60) | struct SubItem
type Tokenizer (line 60) | struct Tokenizer
type ErrorCode (line 61) | enum ErrorCode
type Tokenizer (line 61) | struct Tokenizer
type Token (line 61) | struct Token
FILE: core/interpreter/value.c
function val_makeError (line 25) | struct TypedValue val_makeError(enum ErrorCode errorCode)
FILE: core/interpreter/value.h
type ValueType (line 28) | enum ValueType {
type RCString (line 37) | struct RCString
type ErrorCode (line 39) | enum ErrorCode
type TypedValue (line 42) | struct TypedValue {
type TypeClass (line 47) | enum TypeClass {
type TypedValue (line 55) | struct TypedValue
type ErrorCode (line 55) | enum ErrorCode
FILE: core/interpreter/variables.c
type SimpleVariable (line 26) | struct SimpleVariable
type Interpreter (line 26) | struct Interpreter
type SimpleVariable (line 28) | struct SimpleVariable
type SimpleVariable (line 41) | struct SimpleVariable
type Interpreter (line 41) | struct Interpreter
type ErrorCode (line 41) | enum ErrorCode
type ValueType (line 41) | enum ValueType
type SimpleVariable (line 53) | struct SimpleVariable
type SimpleVariable (line 55) | struct SimpleVariable
function var_freeSimpleVariables (line 77) | void var_freeSimpleVariables(struct Interpreter *interpreter, int minSub...
type ArrayVariable (line 97) | struct ArrayVariable
type Interpreter (line 97) | struct Interpreter
type ArrayVariable (line 99) | struct ArrayVariable
type Interpreter (line 112) | struct Interpreter
type ArrayVariable (line 112) | struct ArrayVariable
type ArrayVariable (line 131) | struct ArrayVariable
type Interpreter (line 131) | struct Interpreter
type ErrorCode (line 131) | enum ErrorCode
type ArrayVariable (line 148) | struct ArrayVariable
type ArrayVariable (line 150) | struct ArrayVariable
type ArrayVariable (line 173) | struct ArrayVariable
type Interpreter (line 173) | struct Interpreter
type ErrorCode (line 173) | enum ErrorCode
type ArrayVariable (line 173) | struct ArrayVariable
type ArrayVariable (line 185) | struct ArrayVariable
type ArrayVariable (line 187) | struct ArrayVariable
function var_freeArrayVariables (line 202) | void var_freeArrayVariables(struct Interpreter *interpreter, int minSubL...
FILE: core/interpreter/variables.h
type Core (line 32) | struct Core
type Interpreter (line 33) | struct Interpreter
type SimpleVariable (line 35) | struct SimpleVariable {
type ArrayVariable (line 43) | struct ArrayVariable {
type SimpleVariable (line 54) | struct SimpleVariable
type Interpreter (line 54) | struct Interpreter
type SimpleVariable (line 55) | struct SimpleVariable
type Interpreter (line 55) | struct Interpreter
type ErrorCode (line 55) | enum ErrorCode
type ValueType (line 55) | enum ValueType
type Interpreter (line 56) | struct Interpreter
type ArrayVariable (line 58) | struct ArrayVariable
type Interpreter (line 58) | struct Interpreter
type Interpreter (line 59) | struct Interpreter
type ArrayVariable (line 59) | struct ArrayVariable
type ArrayVariable (line 60) | struct ArrayVariable
type Interpreter (line 60) | struct Interpreter
type ErrorCode (line 60) | enum ErrorCode
type ArrayVariable (line 61) | struct ArrayVariable
type Interpreter (line 61) | struct Interpreter
type ErrorCode (line 61) | enum ErrorCode
type ArrayVariable (line 61) | struct ArrayVariable
type Interpreter (line 62) | struct Interpreter
FILE: core/libraries/audio_lib.c
type TrackRow (line 32) | struct TrackRow {
type AudioLib (line 40) | struct AudioLib
type AudioLib (line 41) | struct AudioLib
type Voice (line 42) | struct Voice
type AudioLib (line 43) | struct AudioLib
type AudioLib (line 44) | struct AudioLib
type AudioLib (line 45) | struct AudioLib
type AudioLib (line 46) | struct AudioLib
type TrackRow (line 47) | struct TrackRow
type AudioLib (line 47) | struct AudioLib
type AudioLib (line 48) | struct AudioLib
type ComposerPlayer (line 48) | struct ComposerPlayer
type AudioLib (line 49) | struct AudioLib
type Voice (line 49) | struct Voice
type ComposerPlayer (line 49) | struct ComposerPlayer
function audlib_play (line 52) | void audlib_play(struct AudioLib *lib, int voiceIndex, float pitch, int ...
function audlib_copySound (line 75) | void audlib_copySound(struct AudioLib *lib, int sourceAddress, int sound...
function audlib_playMusic (line 87) | void audlib_playMusic(struct AudioLib *lib, int startPattern)
function audlib_playTrack (line 100) | void audlib_playTrack(struct AudioLib *lib, int track, int voiceIndex)
function audlib_stopAll (line 113) | void audlib_stopAll(struct AudioLib *lib)
function audlib_stopVoice (line 124) | void audlib_stopVoice(struct AudioLib *lib, int voiceIndex)
function audlib_update (line 131) | void audlib_update(struct AudioLib *lib)
function audlib_updateMusic (line 148) | void audlib_updateMusic(struct AudioLib *lib)
function audlib_updateTrack (line 222) | void audlib_updateTrack(struct AudioLib *lib, int voiceIndex)
function audlib_setPitch (line 250) | void audlib_setPitch(struct Voice *voice, float pitch)
function audlib_isPatternEmpty (line 257) | bool audlib_isPatternEmpty(struct AudioLib *lib, int sourceAddress, int ...
function audlib_getLoopStart (line 269) | int audlib_getLoopStart(struct AudioLib *lib, int sourceAddress, int pat...
function audlib_getLoop (line 281) | int audlib_getLoop(struct AudioLib *lib, int sourceAddress, int pattern,...
function audlib_getTrack (line 287) | int audlib_getTrack(struct AudioLib *lib, int sourceAddress, int pattern...
function audlib_getTrackRow (line 298) | struct TrackRow audlib_getTrackRow(struct AudioLib *lib, int sourceAddre...
function audlib_playRow (line 313) | void audlib_playRow(struct AudioLib *lib, struct ComposerPlayer *player,...
function audlib_command (line 340) | void audlib_command(struct AudioLib *lib, struct Voice *voice, struct Co...
FILE: core/libraries/audio_lib.h
type Core (line 33) | struct Core
type ComposerPlayer (line 35) | struct ComposerPlayer {
type AudioLib (line 44) | struct AudioLib {
type AudioLib (line 52) | struct AudioLib
type AudioLib (line 53) | struct AudioLib
type AudioLib (line 54) | struct AudioLib
type AudioLib (line 55) | struct AudioLib
type AudioLib (line 56) | struct AudioLib
type AudioLib (line 57) | struct AudioLib
type AudioLib (line 58) | struct AudioLib
FILE: core/libraries/sprites_lib.c
function sprlib_isSpriteOnScreen (line 25) | bool sprlib_isSpriteOnScreen(struct Sprite *sprite)
function sprlib_checkSingleCollision (line 34) | bool sprlib_checkSingleCollision(struct SpritesLib *lib, struct Sprite *...
function sprlib_checkCollision (line 122) | bool sprlib_checkCollision(struct SpritesLib *lib, int checkIndex, int f...
FILE: core/libraries/sprites_lib.h
type Core (line 27) | struct Core
type Sprite (line 28) | struct Sprite
type SpritesLib (line 30) | struct SpritesLib {
type Sprite (line 35) | struct Sprite
type SpritesLib (line 36) | struct SpritesLib
FILE: core/libraries/startup_sequence.c
function runStartupSequence (line 28) | void runStartupSequence(struct Core *core)
FILE: core/libraries/startup_sequence.h
type Core (line 26) | struct Core
type Core (line 28) | struct Core
FILE: core/libraries/text_lib.c
type Plane (line 26) | struct Plane
type TextLib (line 26) | struct TextLib
function txtlib_setCellAt (line 45) | void txtlib_setCellAt(struct Plane *plane, int x, int y, int character, ...
function txtlib_scrollRow (line 55) | void txtlib_scrollRow(struct Plane *plane, int fromX, int toX, int y, in...
function txtlib_scroll (line 80) | void txtlib_scroll(struct Plane *plane, int fromX, int fromY, int toX, i...
function txtlib_scrollWindowIfNeeded (line 105) | void txtlib_scrollWindowIfNeeded(struct TextLib *lib)
function txtlib_printText (line 134) | void txtlib_printText(struct TextLib *lib, const char *text)
function txtlib_deleteBackward (line 172) | bool txtlib_deleteBackward(struct TextLib *lib)
function txtlib_writeText (line 201) | void txtlib_writeText(struct TextLib *lib, const char *text, int x, int y)
function txtlib_writeNumber (line 225) | void txtlib_writeNumber(struct TextLib *lib, int number, int digits, int...
function txtlib_inputBegin (line 256) | void txtlib_inputBegin(struct TextLib *lib)
function txtlib_inputUpdate (line 270) | bool txtlib_inputUpdate(struct TextLib *lib)
function txtlib_clearWindow (line 321) | void txtlib_clearWindow(struct TextLib *lib)
function txtlib_clearScreen (line 339) | void txtlib_clearScreen(struct TextLib *lib)
function txtlib_clearBackground (line 365) | void txtlib_clearBackground(struct TextLib *lib, int bg)
type Cell (line 372) | struct Cell
type TextLib (line 372) | struct TextLib
type Plane (line 374) | struct Plane
function txtlib_setCell (line 378) | void txtlib_setCell(struct TextLib *lib, int x, int y, int character)
function txtlib_setCells (line 384) | void txtlib_setCells(struct TextLib *lib, int fromX, int fromY, int toX,...
function txtlib_setCellsAttr (line 397) | void txtlib_setCellsAttr(struct TextLib *lib, int fromX, int fromY, int ...
function txtlib_scrollBackground (line 414) | void txtlib_scrollBackground(struct TextLib *lib, int fromX, int fromY, ...
function txtlib_copyBackground (line 421) | void txtlib_copyBackground(struct TextLib *lib, int srcX, int srcY, int ...
function txtlib_getSourceCell (line 440) | int txtlib_getSourceCell(struct TextLib *lib, int x, int y, bool getAttrs)
function txtlib_setSourceCell (line 457) | bool txtlib_setSourceCell(struct TextLib *lib, int x, int y, int character)
function txtlib_itobin (line 474) | void txtlib_itobin(char *buffer, size_t buffersize, size_t width, int va...
FILE: core/libraries/text_lib.h
type Core (line 32) | struct Core
type TextLib (line 34) | struct TextLib {
type TextLib (line 54) | struct TextLib
type TextLib (line 55) | struct TextLib
type TextLib (line 56) | struct TextLib
type TextLib (line 57) | struct TextLib
type TextLib (line 58) | struct TextLib
type TextLib (line 59) | struct TextLib
type TextLib (line 60) | struct TextLib
type TextLib (line 61) | struct TextLib
type TextLib (line 62) | struct TextLib
type Cell (line 63) | struct Cell
type TextLib (line 63) | struct TextLib
type TextLib (line 64) | struct TextLib
type TextLib (line 65) | struct TextLib
type TextLib (line 66) | struct TextLib
type TextLib (line 67) | struct TextLib
type TextLib (line 68) | struct TextLib
type TextLib (line 69) | struct TextLib
type TextLib (line 70) | struct TextLib
FILE: core/machine/audio_chip.c
type AudioRegisters (line 83) | struct AudioRegisters
type AudioRegisters (line 83) | struct AudioRegisters
type AudioInternals (line 83) | struct AudioInternals
function audio_reset (line 86) | void audio_reset(struct Core *core)
function audio_bufferRegisters (line 99) | void audio_bufferRegisters(struct Core *core)
function audio_renderAudio (line 128) | void audio_renderAudio(struct Core *core, int16_t *stereoOutput, int num...
function audio_renderAudioBuffer (line 153) | void audio_renderAudioBuffer(struct AudioRegisters *lifeRegisters, struc...
FILE: core/machine/audio_chip.h
type Core (line 35) | struct Core
type WaveType (line 37) | enum WaveType {
type EnvState (line 44) | enum EnvState {
type LFOWaveType (line 69) | enum LFOWaveType {
type Voice (line 86) | struct Voice {
type AudioRegisters (line 113) | struct AudioRegisters {
type VoiceInternals (line 117) | struct VoiceInternals {
type AudioInternals (line 128) | struct AudioInternals {
type Core (line 137) | struct Core
type Core (line 138) | struct Core
type Core (line 139) | struct Core
FILE: core/machine/io_chip.h
type IORegisters (line 67) | struct IORegisters {
FILE: core/machine/machine.c
function machine_init (line 27) | void machine_init(struct Core *core)
function machine_reset (line 32) | void machine_reset(struct Core *core, bool resetPersistent)
function machine_peek (line 50) | int machine_peek(struct Core *core, int address)
function machine_poke (line 69) | bool machine_poke(struct Core *core, int address, int value)
function machine_enableAudio (line 125) | void machine_enableAudio(struct Core *core)
function machine_suspendEnergySaving (line 134) | void machine_suspendEnergySaving(struct Core *core, int numUpdates)
FILE: core/machine/machine.h
type Core (line 33) | struct Core
type Machine (line 36) | struct Machine {
type MachineInternals (line 74) | struct MachineInternals {
type Core (line 82) | struct Core
type Core (line 83) | struct Core
type Core (line 84) | struct Core
type Core (line 85) | struct Core
type Core (line 86) | struct Core
type Core (line 87) | struct Core
FILE: core/machine/video_chip.c
function video_getCharacterPixel (line 27) | int video_getCharacterPixel(struct Character *character, int x, int y)
function video_renderPlane (line 34) | void video_renderPlane(struct Character *characters, struct Plane *plane...
function video_renderSprites (line 104) | void video_renderSprites(struct SpriteRegisters *reg, struct VideoRam *r...
function video_renderScreen (line 187) | void video_renderScreen(struct Core *core, uint32_t *outputRGB)
FILE: core/machine/video_chip.h
type Core (line 37) | struct Core
type Character (line 42) | struct Character {
type Sprite (line 60) | struct Sprite {
type Cell (line 70) | struct Cell {
type Plane (line 78) | struct Plane {
type VideoRam (line 87) | struct VideoRam {
type SpriteRegisters (line 97) | struct SpriteRegisters {
type ColorRegisters (line 101) | struct ColorRegisters {
type VideoRegisters (line 126) | struct VideoRegisters {
type Core (line 140) | struct Core
FILE: core/overlay/overlay.c
type Core (line 26) | struct Core
function overlay_init (line 29) | void overlay_init(struct Core *core)
function overlay_reset (line 46) | void overlay_reset(struct Core *core)
function overlay_updateState (line 53) | void overlay_updateState(struct Core *core)
function overlay_message (line 69) | void overlay_message(struct Core *core, const char *message)
function overlay_draw (line 78) | void overlay_draw(struct Core *core, bool ingame)
function overlay_clear (line 125) | void overlay_clear(struct Core *core)
FILE: core/overlay/overlay.h
type Core (line 30) | struct Core
type Overlay (line 32) | struct Overlay {
type Core (line 39) | struct Core
type Core (line 40) | struct Core
type Core (line 41) | struct Core
type Core (line 42) | struct Core
type Core (line 43) | struct Core
FILE: libretro/libretro.h
type retro_language (line 232) | enum retro_language
type retro_key (line 279) | enum retro_key
type retro_mod (line 429) | enum retro_mod
type retro_hw_render_interface_type (line 925) | enum retro_hw_render_interface_type
type retro_hw_render_interface (line 933) | struct retro_hw_render_interface
type retro_hw_render_context_negotiation_interface_type (line 959) | enum retro_hw_render_context_negotiation_interface_type
type retro_hw_render_context_negotiation_interface (line 967) | struct retro_hw_render_context_negotiation_interface
type retro_memory_descriptor (line 988) | struct retro_memory_descriptor
type retro_memory_map (line 1134) | struct retro_memory_map
type retro_controller_description (line 1140) | struct retro_controller_description
type retro_controller_info (line 1155) | struct retro_controller_info
type retro_subsystem_memory_info (line 1161) | struct retro_subsystem_memory_info
type retro_subsystem_rom_info (line 1172) | struct retro_subsystem_rom_info
type retro_subsystem_info (line 1196) | struct retro_subsystem_info
type retro_get_proc_address_interface (line 1241) | struct retro_get_proc_address_interface
type retro_log_level (line 1246) | enum retro_log_level
type retro_log_level (line 1257) | enum retro_log_level
type retro_log_callback (line 1260) | struct retro_log_callback
type retro_perf_tick_t (line 1290) | typedef uint64_t retro_perf_tick_t;
type retro_time_t (line 1291) | typedef int64_t retro_time_t;
type retro_perf_counter (line 1293) | struct retro_perf_counter
type retro_perf_counter (line 1327) | struct retro_perf_counter
type retro_perf_counter (line 1330) | struct retro_perf_counter
type retro_perf_counter (line 1333) | struct retro_perf_counter
type retro_perf_callback (line 1368) | struct retro_perf_callback
type retro_sensor_action (line 1383) | enum retro_sensor_action
type retro_sensor_action (line 1397) | enum retro_sensor_action
type retro_sensor_interface (line 1401) | struct retro_sensor_interface
type retro_camera_buffer (line 1407) | enum retro_camera_buffer
type retro_camera_callback (line 1455) | struct retro_camera_callback
type retro_location_callback (line 1521) | struct retro_location_callback
type retro_rumble_effect (line 1532) | enum retro_rumble_effect
type retro_rumble_effect (line 1548) | enum retro_rumble_effect
type retro_rumble_interface (line 1550) | struct retro_rumble_interface
type retro_audio_callback (line 1567) | struct retro_audio_callback
type retro_usec_t (line 1581) | typedef int64_t retro_usec_t;
type retro_frame_time_callback (line 1583) | struct retro_frame_time_callback
type retro_hw_context_type (line 1616) | enum retro_hw_context_type
type retro_hw_render_callback (line 1638) | struct retro_hw_render_callback
type retro_keyboard_callback (line 1742) | struct retro_keyboard_callback
type retro_game_info (line 1782) | struct retro_game_info
type retro_game_info (line 1797) | struct retro_game_info
type retro_disk_control_callback (line 1805) | struct retro_disk_control_callback
type retro_pixel_format (line 1818) | enum retro_pixel_format
type retro_message (line 1842) | struct retro_message
type retro_input_descriptor (line 1851) | struct retro_input_descriptor
type retro_system_info (line 1865) | struct retro_system_info
type retro_game_geometry (line 1901) | struct retro_game_geometry
type retro_system_timing (line 1915) | struct retro_system_timing
type retro_system_av_info (line 1921) | struct retro_system_av_info
type retro_variable (line 1927) | struct retro_variable
type retro_game_info (line 1942) | struct retro_game_info
type retro_framebuffer (line 1963) | struct retro_framebuffer
type retro_system_info (line 2057) | struct retro_system_info
type retro_system_av_info (line 2065) | struct retro_system_av_info
type retro_game_info (line 2107) | struct retro_game_info
type retro_game_info (line 2113) | struct retro_game_info
FILE: libretro/libretro_main.c
type retro_log_callback (line 33) | struct retro_log_callback
type Core (line 45) | struct Core
type CoreDelegate (line 46) | struct CoreDelegate
type CoreInput (line 47) | struct CoreInput
type MainState (line 54) | enum MainState
type CoreError (line 60) | struct CoreError
type DataManager (line 61) | struct DataManager
type DataManager (line 62) | struct DataManager
type DataManager (line 63) | struct DataManager
type ControlsInfo (line 64) | struct ControlsInfo
function fallback_log (line 71) | static void fallback_log(enum retro_log_level level, const char *fmt, ...)
function show_message (line 79) | void show_message(const char *txt)
function init_joysticks (line 85) | void init_joysticks()
function update_gamepad (line 114) | bool update_gamepad(int player)
function mouse_pointer_convert (line 136) | int mouse_pointer_convert(float coord, float full)
function update_mouse (line 142) | bool update_mouse()
function keyboard_pressed (line 153) | void keyboard_pressed(bool down, unsigned keycode, uint32_t character, u...
function RETRO_API (line 202) | RETRO_API void retro_set_environment(retro_environment_t callback)
function RETRO_API (line 223) | RETRO_API void retro_set_video_refresh(retro_video_refresh_t callback)
function RETRO_API (line 228) | RETRO_API void retro_set_audio_sample(retro_audio_sample_t callback)
function RETRO_API (line 233) | RETRO_API void retro_set_audio_sample_batch(retro_audio_sample_batch_t c...
function RETRO_API (line 238) | RETRO_API void retro_set_input_poll(retro_input_poll_t callback)
function RETRO_API (line 243) | RETRO_API void retro_set_input_state(retro_input_state_t callback)
function RETRO_API (line 250) | RETRO_API void retro_init(void)
function RETRO_API (line 278) | RETRO_API void retro_deinit(void)
function retro_api_version (line 304) | RETRO_API unsigned retro_api_version(void)
function RETRO_API (line 312) | RETRO_API void retro_get_system_info(struct retro_system_info *info)
function RETRO_API (line 327) | RETRO_API void retro_get_system_av_info(struct retro_system_av_info *info)
function RETRO_API (line 348) | RETRO_API void retro_set_controller_port_device(unsigned port, unsigned ...
function RETRO_API (line 353) | RETRO_API void retro_reset(void)
function RETRO_API (line 367) | RETRO_API void retro_run(void)
function RETRO_API (line 457) | RETRO_API size_t retro_serialize_size(void)
function RETRO_API (line 465) | RETRO_API bool retro_serialize(void *data, size_t size)
function RETRO_API (line 470) | RETRO_API bool retro_unserialize(const void *data, size_t size)
function RETRO_API (line 475) | RETRO_API void retro_cheat_reset(void)
function RETRO_API (line 479) | RETRO_API void retro_cheat_set(unsigned index, bool enabled, const char ...
function RETRO_API (line 484) | RETRO_API bool retro_load_game(const struct retro_game_info *game)
function RETRO_API (line 510) | RETRO_API bool retro_load_game_special(unsigned game_type, const struct ...
function RETRO_API (line 516) | RETRO_API void retro_unload_game(void)
function retro_get_region (line 531) | RETRO_API unsigned retro_get_region(void)
function RETRO_API (line 537) | RETRO_API void *retro_get_memory_data(unsigned id)
function RETRO_API (line 548) | RETRO_API size_t retro_get_memory_size(unsigned id)
function bootNX (line 561) | void bootNX()
function runMainProgram (line 577) | void runMainProgram()
function interpreterDidFail (line 598) | void interpreterDidFail(void *context, struct CoreError coreError)
function diskDriveWillAccess (line 604) | bool diskDriveWillAccess(void *context, struct DataManager *diskDataMana...
function diskDriveDidSave (line 615) | void diskDriveDidSave(void *context, struct DataManager *diskDataManager)
function diskDriveIsFull (line 621) | void diskDriveIsFull(void *context, struct DataManager *diskDataManager)
function controlsDidChange (line 626) | void controlsDidChange(void *context, struct ControlsInfo controlsInfo)
function persistentRamWillAccess (line 631) | void persistentRamWillAccess(void *context, uint8_t *destination, int size)
function persistentRamDidChange (line 636) | void persistentRamDidChange(void *context, uint8_t *data, int size)
FILE: libretro/libretro_main.h
type MainState (line 26) | enum MainState {
FILE: platform/web/embed/package/LowResNX120.js
function locateFile (line 61) | function locateFile(path) {
function alignMemory (line 343) | function alignMemory(size, factor) {
function getNativeTypeSize (line 348) | function getNativeTypeSize(type) {
function warnOnce (line 370) | function warnOnce(text) {
function convertJsFunctionToWasm (line 382) | function convertJsFunctionToWasm(func, sig) {
function getEmptyTableSlot (line 470) | function getEmptyTableSlot() {
function addFunctionWasm (line 488) | function addFunctionWasm(func, sig) {
function removeFunction (line 527) | function removeFunction(index) {
function addFunction (line 534) | function addFunction(func, sig) {
function makeBigInt (line 545) | function makeBigInt(low, high, unsigned) {
function getCompilerSetting (line 559) | function getCompilerSetting(name) {
function setValue (line 609) | function setValue(ptr, value, type, noSafe) {
function getValue (line 627) | function getValue(ptr, type, noSafe) {
function assert (line 662) | function assert(condition, text) {
function getCFunc (line 669) | function getCFunc(ident) {
function ccall (line 680) | function ccall(ident, returnType, argTypes, args, opts) {
function cwrap (line 731) | function cwrap(ident, returnType, argTypes, opts) {
function allocate (line 751) | function allocate(slab, allocator) {
function UTF8ArrayToString (line 785) | function UTF8ArrayToString(heap, idx, maxBytesToRead) {
function UTF8ToString (line 841) | function UTF8ToString(ptr, maxBytesToRead) {
function stringToUTF8Array (line 858) | function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) {
function stringToUTF8 (line 904) | function stringToUTF8(str, outPtr, maxBytesToWrite) {
function lengthBytesUTF8 (line 910) | function lengthBytesUTF8(str) {
function AsciiToString (line 934) | function AsciiToString(ptr) {
function stringToAscii (line 946) | function stringToAscii(str, outPtr) {
function UTF16ToString (line 955) | function UTF16ToString(ptr, maxBytesToRead) {
function stringToUTF16 (line 996) | function stringToUTF16(str, outPtr, maxBytesToWrite) {
function lengthBytesUTF16 (line 1020) | function lengthBytesUTF16(str) {
function UTF32ToString (line 1024) | function UTF32ToString(ptr, maxBytesToRead) {
function stringToUTF32 (line 1058) | function stringToUTF32(str, outPtr, maxBytesToWrite) {
function lengthBytesUTF32 (line 1087) | function lengthBytesUTF32(str) {
function allocateUTF8 (line 1102) | function allocateUTF8(str) {
function allocateUTF8OnStack (line 1110) | function allocateUTF8OnStack(str) {
function writeStringToMemory (line 1123) | function writeStringToMemory(string, buffer, dontAddNull) {
function writeArrayToMemory (line 1138) | function writeArrayToMemory(array, buffer) {
function writeAsciiToMemory (line 1144) | function writeAsciiToMemory(str, buffer, dontAddNull) {
function alignUp (line 1156) | function alignUp(x, multiple) {
function updateGlobalBufferAndViews (line 1183) | function updateGlobalBufferAndViews(buf) {
function writeStackCookie (line 1229) | function writeStackCookie() {
function checkStackCookie (line 1239) | function checkStackCookie() {
function abortFnPtrError (line 1263) | function abortFnPtrError(ptr, sig) {
function preRun (line 1279) | function preRun() {
function initRuntime (line 1291) | function initRuntime() {
function preMain (line 1301) | function preMain() {
function exitRuntime (line 1307) | function exitRuntime() {
function postRun (line 1312) | function postRun() {
function addOnPreRun (line 1325) | function addOnPreRun(cb) {
function addOnInit (line 1329) | function addOnInit(cb) {
function addOnPreMain (line 1333) | function addOnPreMain(cb) {
function addOnExit (line 1337) | function addOnExit(cb) {
function addOnPostRun (line 1340) | function addOnPostRun(cb) {
function getUniqueRunDependency (line 1373) | function getUniqueRunDependency(id) {
function addRunDependency (line 1381) | function addRunDependency(id) {
function removeRunDependency (line 1417) | function removeRunDependency(id) {
function abort (line 1447) | function abort(what) {
function hasPrefix (line 1481) | function hasPrefix(str, prefix) {
function isDataURI (line 1491) | function isDataURI(filename) {
function isFileURI (line 1498) | function isFileURI(filename) {
function createExportWrapper (line 1503) | function createExportWrapper(name, fixedasm) {
function getBinary (line 1524) | function getBinary(file) {
function getBinaryPromise (line 1540) | function getBinaryPromise() {
function createWasm (line 1575) | function createWasm() {
function listenOnce (line 1707) | function listenOnce(object, event, func) {
function autoResumeAudioContext (line 1710) | function autoResumeAudioContext(ctx, elements) {
function callRuntimeCallbacks (line 1725) | function callRuntimeCallbacks(callbacks) {
function demangle (line 1745) | function demangle(func) {
function demangleAll (line 1750) | function demangleAll(text) {
function dynCallLegacy (line 1760) | function dynCallLegacy(sig, ptr, args) {
function dynCall (line 1771) | function dynCall(sig, ptr, args) {
function jsStackTrace (line 1782) | function jsStackTrace() {
function stackTrace (line 1799) | function stackTrace() {
function ___assert_fail (line 1805) | function ___assert_fail(condition, filename, line, func) {
function setErrNo (line 1809) | function setErrNo(value) {
function getRandomDevice (line 1883) | function getRandomDevice() {
function trim (line 1926) | function trim(arr) {
function mmapAlloc (line 2098) | function mmapAlloc(size) {
function doCallback (line 2726) | function doCallback(errCode) {
function done (line 2732) | function done(errCode) {
function LazyUint8Array (line 3768) | function LazyUint8Array() {
function processData (line 3926) | function processData(byteArray) {
function finish (line 3979) | function finish() {
function finish (line 4010) | function finish() {
function ___sys_fcntl64 (line 4187) | function ___sys_fcntl64(fd, cmd, varargs) {SYSCALLS.varargs = varargs;
function ___sys_ioctl (line 4244) | function ___sys_ioctl(fd, op, varargs) {SYSCALLS.varargs = varargs;
function ___sys_open (line 4298) | function ___sys_open(path, flags, varargs) {SYSCALLS.varargs = varargs;
function _clock_gettime (line 4322) | function _clock_gettime(clk_id, tp) {
function _dlclose (line 4338) | function _dlclose(handle) {
function _emscripten_set_main_loop_timing (line 4342) | function _emscripten_set_main_loop_timing(mode, value) {
function setMainLoop (line 4392) | function setMainLoop(browserIterationFunc, fps, simulateInfiniteLoop, ar...
function finish (line 4605) | function finish(audio) {
function fail (line 4611) | function fail() {
function encode64 (line 4630) | function encode64(data) {
function pointerLockChange (line 4670) | function pointerLockChange() {
function fullscreenChange (line 4758) | function fullscreenChange() {
function _eglBindAPI (line 5136) | function _eglBindAPI(api) {
function _eglChooseConfig (line 5146) | function _eglChooseConfig(display, attrib_list, configs, config_size, nu...
function __webgl_enable_ANGLE_instanced_arrays (line 5150) | function __webgl_enable_ANGLE_instanced_arrays(ctx) {
function __webgl_enable_OES_vertex_array_object (line 5161) | function __webgl_enable_OES_vertex_array_object(ctx) {
function __webgl_enable_WEBGL_draw_buffers (line 5173) | function __webgl_enable_WEBGL_draw_buffers(ctx) {
function __webgl_enable_WEBGL_multi_draw (line 5182) | function __webgl_enable_WEBGL_multi_draw(ctx) {
function _eglCreateContext (line 5318) | function _eglCreateContext(display, config, hmm, contextAttribs) {
function _eglCreateWindowSurface (line 5367) | function _eglCreateWindowSurface(display, config, win, attrib_list) {
function _eglDestroyContext (line 5384) | function _eglDestroyContext(display, context) {
function _eglDestroySurface (line 5402) | function _eglDestroySurface(display, surface) {
function _eglGetConfigAttrib (line 5421) | function _eglGetConfigAttrib(display, config, attribute, value) {
function _eglGetDisplay (line 5536) | function _eglGetDisplay(nativeDisplayType) {
function _eglGetError (line 5552) | function _eglGetError() {
function _eglInitialize (line 5556) | function _eglInitialize(display, majorVersion, minorVersion) {
function _eglMakeCurrent (line 5574) | function _eglMakeCurrent(display, draw, read, context) {
function _eglQueryString (line 5598) | function _eglQueryString(display, name) {
function _eglSwapBuffers (line 5620) | function _eglSwapBuffers() {
function _eglSwapInterval (line 5639) | function _eglSwapInterval(display, interval) {
function _eglTerminate (line 5651) | function _eglTerminate(display) {
function _eglWaitClient (line 5664) | function _eglWaitClient() {
function _eglWaitGL (line 5668) | function _eglWaitGL(
function _eglWaitNative (line 5673) | function _eglWaitNative(nativeEngineId) {
function _emscripten_asm_const_int (line 5678) | function _emscripten_asm_const_int(code, sigPtr, argbuf) {
function _emscripten_async_wget (line 5683) | function _emscripten_async_wget(url, file, onload, onerror) {
function arraysHaveEqualContent (line 5732) | function arraysHaveEqualContent(arrA, arrB) {
function maybeCStringToJsString (line 5827) | function maybeCStringToJsString(cString) {
function findEventTarget (line 5836) | function findEventTarget(target) {
function findCanvasEventTarget (line 5841) | function findCanvasEventTarget(target) { return findEventTarget(target); }
function _emscripten_get_canvas_element_size (line 5842) | function _emscripten_get_canvas_element_size(target, width, height) {
function getCanvasElementSize (line 5848) | function getCanvasElementSize(target) {
function _emscripten_set_canvas_element_size (line 5861) | function _emscripten_set_canvas_element_size(target, width, height) {
function setCanvasElementSize (line 5868) | function setCanvasElementSize(target, width, height) {
function registerRestoreOldStyle (line 5882) | function registerRestoreOldStyle(canvas) {
function setLetterbox (line 5952) | function setLetterbox(element, topBottom, leftRight) {
function getBoundingClientRect (line 5958) | function getBoundingClientRect(e) {
function _JSEvents_resizeCanvasForFullscreen (line 5961) | function _JSEvents_resizeCanvasForFullscreen(target, strategy) {
function _JSEvents_requestFullscreen (line 6017) | function _JSEvents_requestFullscreen(target, strategy) {
function _emscripten_exit_fullscreen (line 6039) | function _emscripten_exit_fullscreen() {
function requestPointerLock (line 6056) | function requestPointerLock(target) {
function _emscripten_exit_pointerlock (line 6074) | function _emscripten_exit_pointerlock() {
function _emscripten_get_device_pixel_ratio (line 6088) | function _emscripten_get_device_pixel_ratio() {
function _emscripten_get_element_css_size (line 6092) | function _emscripten_get_element_css_size(target, width, height) {
function fillGamepadEventData (line 6103) | function fillGamepadEventData(eventStruct, e) {
function _emscripten_get_gamepad_status (line 6131) | function _emscripten_get_gamepad_status(index, gamepadState) {
function _emscripten_get_num_gamepads (line 6147) | function _emscripten_get_num_gamepads() {
function _emscripten_glActiveTexture (line 6154) | function _emscripten_glActiveTexture(x0) { GLctx['activeTexture'](x0) }
function _emscripten_glAttachShader (line 6156) | function _emscripten_glAttachShader(program, shader) {
function _emscripten_glBeginQueryEXT (line 6161) | function _emscripten_glBeginQueryEXT(target, id) {
function _emscripten_glBindAttribLocation (line 6165) | function _emscripten_glBindAttribLocation(program, index, name) {
function _emscripten_glBindBuffer (line 6169) | function _emscripten_glBindBuffer(target, buffer) {
function _emscripten_glBindFramebuffer (line 6174) | function _emscripten_glBindFramebuffer(target, framebuffer) {
function _emscripten_glBindRenderbuffer (line 6180) | function _emscripten_glBindRenderbuffer(target, renderbuffer) {
function _emscripten_glBindTexture (line 6184) | function _emscripten_glBindTexture(target, texture) {
function _emscripten_glBindVertexArrayOES (line 6188) | function _emscripten_glBindVertexArrayOES(vao) {
function _emscripten_glBlendColor (line 6192) | function _emscripten_glBlendColor(x0, x1, x2, x3) { GLctx['blendColor'](...
function _emscripten_glBlendEquation (line 6194) | function _emscripten_glBlendEquation(x0) { GLctx['blendEquation'](x0) }
function _emscripten_glBlendEquationSeparate (line 6196) | function _emscripten_glBlendEquationSeparate(x0, x1) { GLctx['blendEquat...
function _emscripten_glBlendFunc (line 6198) | function _emscripten_glBlendFunc(x0, x1) { GLctx['blendFunc'](x0, x1) }
function _emscripten_glBlendFuncSeparate (line 6200) | function _emscripten_glBlendFuncSeparate(x0, x1, x2, x3) { GLctx['blendF...
function _emscripten_glBufferData (line 6202) | function _emscripten_glBufferData(target, size, data, usage) {
function _emscripten_glBufferSubData (line 6209) | function _emscripten_glBufferSubData(target, offset, size, data) {
function _emscripten_glCheckFramebufferStatus (line 6213) | function _emscripten_glCheckFramebufferStatus(x0) { return GLctx['checkF...
function _emscripten_glClear (line 6215) | function _emscripten_glClear(x0) { GLctx['clear'](x0) }
function _emscripten_glClearColor (line 6217) | function _emscripten_glClearColor(x0, x1, x2, x3) { GLctx['clearColor'](...
function _emscripten_glClearDepthf (line 6219) | function _emscripten_glClearDepthf(x0) { GLctx['clearDepth'](x0) }
function _emscripten_glClearStencil (line 6221) | function _emscripten_glClearStencil(x0) { GLctx['clearStencil'](x0) }
function _emscripten_glColorMask (line 6223) | function _emscripten_glColorMask(red, green, blue, alpha) {
function _emscripten_glCompileShader (line 6227) | function _emscripten_glCompileShader(shader) {
function _emscripten_glCompressedTexImage2D (line 6231) | function _emscripten_glCompressedTexImage2D(target, level, internalForma...
function _emscripten_glCompressedTexSubImage2D (line 6235) | function _emscripten_glCompressedTexSubImage2D(target, level, xoffset, y...
function _emscripten_glCopyTexImage2D (line 6239) | function _emscripten_glCopyTexImage2D(x0, x1, x2, x3, x4, x5, x6, x7) { ...
function _emscripten_glCopyTexSubImage2D (line 6241) | function _emscripten_glCopyTexSubImage2D(x0, x1, x2, x3, x4, x5, x6, x7)...
function _emscripten_glCreateProgram (line 6243) | function _emscripten_glCreateProgram() {
function _emscripten_glCreateShader (line 6251) | function _emscripten_glCreateShader(shaderType) {
function _emscripten_glCullFace (line 6257) | function _emscripten_glCullFace(x0) { GLctx['cullFace'](x0) }
function _emscripten_glDeleteBuffers (line 6259) | function _emscripten_glDeleteBuffers(n, buffers) {
function _emscripten_glDeleteFramebuffers (line 6275) | function _emscripten_glDeleteFramebuffers(n, framebuffers) {
function _emscripten_glDeleteProgram (line 6286) | function _emscripten_glDeleteProgram(id) {
function _emscripten_glDeleteQueriesEXT (line 6299) | function _emscripten_glDeleteQueriesEXT(n, ids) {
function _emscripten_glDeleteRenderbuffers (line 6309) | function _emscripten_glDeleteRenderbuffers(n, renderbuffers) {
function _emscripten_glDeleteShader (line 6320) | function _emscripten_glDeleteShader(id) {
function _emscripten_glDeleteTextures (line 6331) | function _emscripten_glDeleteTextures(n, textures) {
function _emscripten_glDeleteVertexArraysOES (line 6342) | function _emscripten_glDeleteVertexArraysOES(n, vaos) {
function _emscripten_glDepthFunc (line 6350) | function _emscripten_glDepthFunc(x0) { GLctx['depthFunc'](x0) }
function _emscripten_glDepthMask (line 6352) | function _emscripten_glDepthMask(flag) {
function _emscripten_glDepthRangef (line 6356) | function _emscripten_glDepthRangef(x0, x1) { GLctx['depthRange'](x0, x1) }
function _emscripten_glDetachShader (line 6358) | function _emscripten_glDetachShader(program, shader) {
function _emscripten_glDisable (line 6363) | function _emscripten_glDisable(x0) { GLctx['disable'](x0) }
function _emscripten_glDisableVertexAttribArray (line 6365) | function _emscripten_glDisableVertexAttribArray(index) {
function _emscripten_glDrawArrays (line 6369) | function _emscripten_glDrawArrays(mode, first, count) {
function _emscripten_glDrawArraysInstancedANGLE (line 6375) | function _emscripten_glDrawArraysInstancedANGLE(mode, first, count, prim...
function _emscripten_glDrawBuffersWEBGL (line 6380) | function _emscripten_glDrawBuffersWEBGL(n, bufs) {
function _emscripten_glDrawElements (line 6390) | function _emscripten_glDrawElements(mode, count, type, indices) {
function _emscripten_glDrawElementsInstancedANGLE (line 6396) | function _emscripten_glDrawElementsInstancedANGLE(mode, count, type, ind...
function _emscripten_glEnable (line 6400) | function _emscripten_glEnable(x0) { GLctx['enable'](x0) }
function _emscripten_glEnableVertexAttribArray (line 6402) | function _emscripten_glEnableVertexAttribArray(index) {
function _emscripten_glEndQueryEXT (line 6406) | function _emscripten_glEndQueryEXT(target) {
function _emscripten_glFinish (line 6410) | function _emscripten_glFinish() { GLctx['finish']() }
function _emscripten_glFlush (line 6412) | function _emscripten_glFlush() { GLctx['flush']() }
function _emscripten_glFramebufferRenderbuffer (line 6414) | function _emscripten_glFramebufferRenderbuffer(target, attachment, rende...
function _emscripten_glFramebufferTexture2D (line 6419) | function _emscripten_glFramebufferTexture2D(target, attachment, textarge...
function _emscripten_glFrontFace (line 6424) | function _emscripten_glFrontFace(x0) { GLctx['frontFace'](x0) }
function __glGenObject (line 6426) | function __glGenObject(n, buffers, createFunction, objectTable
function _emscripten_glGenBuffers (line 6440) | function _emscripten_glGenBuffers(n, buffers) {
function _emscripten_glGenFramebuffers (line 6445) | function _emscripten_glGenFramebuffers(n, ids) {
function _emscripten_glGenQueriesEXT (line 6450) | function _emscripten_glGenQueriesEXT(n, ids) {
function _emscripten_glGenRenderbuffers (line 6465) | function _emscripten_glGenRenderbuffers(n, renderbuffers) {
function _emscripten_glGenTextures (line 6470) | function _emscripten_glGenTextures(n, textures) {
function _emscripten_glGenVertexArraysOES (line 6475) | function _emscripten_glGenVertexArraysOES(n, arrays) {
function _emscripten_glGenerateMipmap (line 6480) | function _emscripten_glGenerateMipmap(x0) { GLctx['generateMipmap'](x0) }
function __glGetActiveAttribOrUniform (line 6482) | function __glGetActiveAttribOrUniform(funcName, program, index, bufSize,...
function _emscripten_glGetActiveAttrib (line 6492) | function _emscripten_glGetActiveAttrib(program, index, bufSize, length, ...
function _emscripten_glGetActiveUniform (line 6496) | function _emscripten_glGetActiveUniform(program, index, bufSize, length,...
function _emscripten_glGetAttachedShaders (line 6500) | function _emscripten_glGetAttachedShaders(program, maxCount, count, shad...
function _emscripten_glGetAttribLocation (line 6513) | function _emscripten_glGetAttribLocation(program, name) {
function readI53FromI64 (line 6517) | function readI53FromI64(ptr) {
function readI53FromU64 (line 6521) | function readI53FromU64(ptr) {
function writeI53ToI64 (line 6524) | function writeI53ToI64(ptr, num) {
function emscriptenWebGLGet (line 6530) | function emscriptenWebGLGet(name_, p, type) {
function _emscripten_glGetBooleanv (line 6629) | function _emscripten_glGetBooleanv(name_, p) {
function _emscripten_glGetBufferParameteriv (line 6633) | function _emscripten_glGetBufferParameteriv(target, value, data) {
function _emscripten_glGetError (line 6643) | function _emscripten_glGetError() {
function _emscripten_glGetFloatv (line 6649) | function _emscripten_glGetFloatv(name_, p) {
function _emscripten_glGetFramebufferAttachmentParameteriv (line 6653) | function _emscripten_glGetFramebufferAttachmentParameteriv(target, attac...
function _emscripten_glGetIntegerv (line 6662) | function _emscripten_glGetIntegerv(name_, p) {
function _emscripten_glGetProgramInfoLog (line 6666) | function _emscripten_glGetProgramInfoLog(program, maxLength, length, inf...
function _emscripten_glGetProgramiv (line 6673) | function _emscripten_glGetProgramiv(program, pname, p) {
function _emscripten_glGetQueryObjecti64vEXT (line 6725) | function _emscripten_glGetQueryObjecti64vEXT(id, pname, params) {
function _emscripten_glGetQueryObjectivEXT (line 6743) | function _emscripten_glGetQueryObjectivEXT(id, pname, params) {
function _emscripten_glGetQueryObjectui64vEXT (line 6761) | function _emscripten_glGetQueryObjectui64vEXT(id, pname, params) {
function _emscripten_glGetQueryObjectuivEXT (line 6779) | function _emscripten_glGetQueryObjectuivEXT(id, pname, params) {
function _emscripten_glGetQueryivEXT (line 6797) | function _emscripten_glGetQueryivEXT(target, pname, params) {
function _emscripten_glGetRenderbufferParameteriv (line 6807) | function _emscripten_glGetRenderbufferParameteriv(target, pname, params) {
function _emscripten_glGetShaderInfoLog (line 6817) | function _emscripten_glGetShaderInfoLog(shader, maxLength, length, infoL...
function _emscripten_glGetShaderPrecisionFormat (line 6824) | function _emscripten_glGetShaderPrecisionFormat(shaderType, precisionTyp...
function _emscripten_glGetShaderSource (line 6831) | function _emscripten_glGetShaderSource(shader, bufSize, length, source) {
function _emscripten_glGetShaderiv (line 6838) | function _emscripten_glGetShaderiv(shader, pname, p) {
function stringToNewUTF8 (line 6865) | function stringToNewUTF8(jsString) {
function _emscripten_glGetString (line 6871) | function _emscripten_glGetString(name_) {
function _emscripten_glGetTexParameterfv (line 6918) | function _emscripten_glGetTexParameterfv(target, pname, params) {
function _emscripten_glGetTexParameteriv (line 6928) | function _emscripten_glGetTexParameteriv(target, pname, params) {
function jstoi_q (line 6939) | function jstoi_q(str) {
function _emscripten_glGetUniformLocation (line 6942) | function _emscripten_glGetUniformLocation(program, name) {
function emscriptenWebGLGetUniform (line 6962) | function emscriptenWebGLGetUniform(program, location, params, type) {
function _emscripten_glGetUniformfv (line 6984) | function _emscripten_glGetUniformfv(program, location, params) {
function _emscripten_glGetUniformiv (line 6988) | function _emscripten_glGetUniformiv(program, location, params) {
function _emscripten_glGetVertexAttribPointerv (line 6992) | function _emscripten_glGetVertexAttribPointerv(index, pname, pointer) {
function emscriptenWebGLGetVertexAttrib (line 7003) | function emscriptenWebGLGetVertexAttrib(index, pname, params, type) {
function _emscripten_glGetVertexAttribfv (line 7029) | function _emscripten_glGetVertexAttribfv(index, pname, params) {
function _emscripten_glGetVertexAttribiv (line 7035) | function _emscripten_glGetVertexAttribiv(index, pname, params) {
function _emscripten_glHint (line 7041) | function _emscripten_glHint(x0, x1) { GLctx['hint'](x0, x1) }
function _emscripten_glIsBuffer (line 7043) | function _emscripten_glIsBuffer(buffer) {
function _emscripten_glIsEnabled (line 7049) | function _emscripten_glIsEnabled(x0) { return GLctx['isEnabled'](x0) }
function _emscripten_glIsFramebuffer (line 7051) | function _emscripten_glIsFramebuffer(framebuffer) {
function _emscripten_glIsProgram (line 7057) | function _emscripten_glIsProgram(program) {
function _emscripten_glIsQueryEXT (line 7063) | function _emscripten_glIsQueryEXT(id) {
function _emscripten_glIsRenderbuffer (line 7069) | function _emscripten_glIsRenderbuffer(renderbuffer) {
function _emscripten_glIsShader (line 7075) | function _emscripten_glIsShader(shader) {
function _emscripten_glIsTexture (line 7081) | function _emscripten_glIsTexture(id) {
function _emscripten_glIsVertexArrayOES (line 7087) | function _emscripten_glIsVertexArrayOES(array) {
function _emscripten_glLineWidth (line 7094) | function _emscripten_glLineWidth(x0) { GLctx['lineWidth'](x0) }
function _emscripten_glLinkProgram (line 7096) | function _emscripten_glLinkProgram(program) {
function _emscripten_glPixelStorei (line 7101) | function _emscripten_glPixelStorei(pname, param) {
function _emscripten_glPolygonOffset (line 7108) | function _emscripten_glPolygonOffset(x0, x1) { GLctx['polygonOffset'](x0...
function _emscripten_glQueryCounterEXT (line 7110) | function _emscripten_glQueryCounterEXT(id, target) {
function computeUnpackAlignedImageSize (line 7114) | function computeUnpackAlignedImageSize(width, height, sizePerPixel, alig...
function __colorChannelsInGlTextureFormat (line 7123) | function __colorChannelsInGlTextureFormat(format) {
function heapObjectForWebGLType (line 7139) | function heapObjectForWebGLType(type) {
function heapAccessShiftForWebGLHeap (line 7160) | function heapAccessShiftForWebGLHeap(heap) {
function emscriptenWebGLGetTexPixelData (line 7163) | function emscriptenWebGLGetTexPixelData(type, format, width, height, pix...
function _emscripten_glReadPixels (line 7171) | function _emscripten_glReadPixels(x, y, width, height, format, type, pix...
function _emscripten_glReleaseShaderCompiler (line 7180) | function _emscripten_glReleaseShaderCompiler() {
function _emscripten_glRenderbufferStorage (line 7184) | function _emscripten_glRenderbufferStorage(x0, x1, x2, x3) { GLctx['rend...
function _emscripten_glSampleCoverage (line 7186) | function _emscripten_glSampleCoverage(value, invert) {
function _emscripten_glScissor (line 7190) | function _emscripten_glScissor(x0, x1, x2, x3) { GLctx['scissor'](x0, x1...
function _emscripten_glShaderBinary (line 7192) | function _emscripten_glShaderBinary() {
function _emscripten_glShaderSource (line 7196) | function _emscripten_glShaderSource(shader, count, string, length) {
function _emscripten_glStencilFunc (line 7202) | function _emscripten_glStencilFunc(x0, x1, x2) { GLctx['stencilFunc'](x0...
function _emscripten_glStencilFuncSeparate (line 7204) | function _emscripten_glStencilFuncSeparate(x0, x1, x2, x3) { GLctx['sten...
function _emscripten_glStencilMask (line 7206) | function _emscripten_glStencilMask(x0) { GLctx['stencilMask'](x0) }
function _emscripten_glStencilMaskSeparate (line 7208) | function _emscripten_glStencilMaskSeparate(x0, x1) { GLctx['stencilMaskS...
function _emscripten_glStencilOp (line 7210) | function _emscripten_glStencilOp(x0, x1, x2) { GLctx['stencilOp'](x0, x1...
function _emscripten_glStencilOpSeparate (line 7212) | function _emscripten_glStencilOpSeparate(x0, x1, x2, x3) { GLctx['stenci...
function _emscripten_glTexImage2D (line 7214) | function _emscripten_glTexImage2D(target, level, internalFormat, width, ...
function _emscripten_glTexParameterf (line 7218) | function _emscripten_glTexParameterf(x0, x1, x2) { GLctx['texParameterf'...
function _emscripten_glTexParameterfv (line 7220) | function _emscripten_glTexParameterfv(target, pname, params) {
function _emscripten_glTexParameteri (line 7225) | function _emscripten_glTexParameteri(x0, x1, x2) { GLctx['texParameteri'...
function _emscripten_glTexParameteriv (line 7227) | function _emscripten_glTexParameteriv(target, pname, params) {
function _emscripten_glTexSubImage2D (line 7232) | function _emscripten_glTexSubImage2D(target, level, xoffset, yoffset, wi...
function _emscripten_glUniform1f (line 7238) | function _emscripten_glUniform1f(location, v0) {
function _emscripten_glUniform1fv (line 7243) | function _emscripten_glUniform1fv(location, count, value) {
function _emscripten_glUniform1i (line 7258) | function _emscripten_glUniform1i(location, v0) {
function _emscripten_glUniform1iv (line 7263) | function _emscripten_glUniform1iv(location, count, value) {
function _emscripten_glUniform2f (line 7278) | function _emscripten_glUniform2f(location, v0, v1) {
function _emscripten_glUniform2fv (line 7282) | function _emscripten_glUniform2fv(location, count, value) {
function _emscripten_glUniform2i (line 7298) | function _emscripten_glUniform2i(location, v0, v1) {
function _emscripten_glUniform2iv (line 7302) | function _emscripten_glUniform2iv(location, count, value) {
function _emscripten_glUniform3f (line 7318) | function _emscripten_glUniform3f(location, v0, v1, v2) {
function _emscripten_glUniform3fv (line 7322) | function _emscripten_glUniform3fv(location, count, value) {
function _emscripten_glUniform3i (line 7339) | function _emscripten_glUniform3i(location, v0, v1, v2) {
function _emscripten_glUniform3iv (line 7343) | function _emscripten_glUniform3iv(location, count, value) {
function _emscripten_glUniform4f (line 7360) | function _emscripten_glUniform4f(location, v0, v1, v2, v3) {
function _emscripten_glUniform4fv (line 7364) | function _emscripten_glUniform4fv(location, count, value) {
function _emscripten_glUniform4i (line 7386) | function _emscripten_glUniform4i(location, v0, v1, v2, v3) {
function _emscripten_glUniform4iv (line 7390) | function _emscripten_glUniform4iv(location, count, value) {
function _emscripten_glUniformMatrix2fv (line 7408) | function _emscripten_glUniformMatrix2fv(location, count, transpose, valu...
function _emscripten_glUniformMatrix3fv (line 7426) | function _emscripten_glUniformMatrix3fv(location, count, transpose, valu...
function _emscripten_glUniformMatrix4fv (line 7449) | function _emscripten_glUniformMatrix4fv(location, count, transpose, valu...
function _emscripten_glUseProgram (line 7483) | function _emscripten_glUseProgram(program) {
function _emscripten_glValidateProgram (line 7487) | function _emscripten_glValidateProgram(program) {
function _emscripten_glVertexAttrib1f (line 7491) | function _emscripten_glVertexAttrib1f(x0, x1) { GLctx['vertexAttrib1f'](...
function _emscripten_glVertexAttrib1fv (line 7493) | function _emscripten_glVertexAttrib1fv(index, v) {
function _emscripten_glVertexAttrib2f (line 7498) | function _emscripten_glVertexAttrib2f(x0, x1, x2) { GLctx['vertexAttrib2...
function _emscripten_glVertexAttrib2fv (line 7500) | function _emscripten_glVertexAttrib2fv(index, v) {
function _emscripten_glVertexAttrib3f (line 7505) | function _emscripten_glVertexAttrib3f(x0, x1, x2, x3) { GLctx['vertexAtt...
function _emscripten_glVertexAttrib3fv (line 7507) | function _emscripten_glVertexAttrib3fv(index, v) {
function _emscripten_glVertexAttrib4f (line 7512) | function _emscripten_glVertexAttrib4f(x0, x1, x2, x3, x4) { GLctx['verte...
function _emscripten_glVertexAttrib4fv (line 7514) | function _emscripten_glVertexAttrib4fv(index, v) {
function _emscripten_glVertexAttribDivisorANGLE (line 7519) | function _emscripten_glVertexAttribDivisorANGLE(index, divisor) {
function _emscripten_glVertexAttribPointer (line 7523) | function _emscripten_glVertexAttribPointer(index, size, type, normalized...
function _emscripten_glViewport (line 7527) | function _emscripten_glViewport(x0, x1, x2, x3) { GLctx['viewport'](x0, ...
function _emscripten_has_asyncify (line 7529) | function _emscripten_has_asyncify() {
function _emscripten_memcpy_big (line 7533) | function _emscripten_memcpy_big(dest, src, num) {
function doRequestFullscreen (line 7537) | function doRequestFullscreen(target, strategy) {
function _emscripten_request_fullscreen_strategy (line 7562) | function _emscripten_request_fullscreen_strategy(target, deferUntilInEve...
function _emscripten_request_pointerlock (line 7575) | function _emscripten_request_pointerlock(target, deferUntilInEventHandle...
function _emscripten_get_heap_size (line 7599) | function _emscripten_get_heap_size() {
function abortOnCannotGrowMemory (line 7603) | function abortOnCannotGrowMemory(requestedSize) {
function _emscripten_resize_heap (line 7606) | function _emscripten_resize_heap(requestedSize) {
function _emscripten_sample_gamepad_data (line 7610) | function _emscripten_sample_gamepad_data() {
function registerBeforeUnloadEventCallback (line 7615) | function registerBeforeUnloadEventCallback(target, userData, useCapture,...
function _emscripten_set_beforeunload_callback_on_thread (line 7641) | function _emscripten_set_beforeunload_callback_on_thread(userData, callb...
function registerFocusEventCallback (line 7650) | function registerFocusEventCallback(target, userData, useCapture, callba...
function _emscripten_set_blur_callback_on_thread (line 7675) | function _emscripten_set_blur_callback_on_thread(target, userData, useCa...
function _emscripten_set_element_css_size (line 7681) | function _emscripten_set_element_css_size(target, width, height) {
function _emscripten_set_focus_callback_on_thread (line 7691) | function _emscripten_set_focus_callback_on_thread(target, userData, useC...
function fillFullscreenChangeEventData (line 7696) | function fillFullscreenChangeEventData(eventStruct) {
function registerFullscreenChangeEventCallback (line 7717) | function registerFullscreenChangeEventCallback(target, userData, useCapt...
function _emscripten_set_fullscreenchange_callback_on_thread (line 7739) | function _emscripten_set_fullscreenchange_callback_on_thread(target, use...
function registerGamepadEventCallback (line 7752) | function registerGamepadEventCallback(target, userData, useCapture, call...
function _emscripten_set_gamepadconnected_callback_on_thread (line 7774) | function _emscripten_set_gamepadconnected_callback_on_thread(userData, u...
function _emscripten_set_gamepaddisconnected_callback_on_thread (line 7780) | function _emscripten_set_gamepaddisconnected_callback_on_thread(userData...
function registerKeyEventCallback (line 7786) | function registerKeyEventCallback(target, userData, useCapture, callback...
function _emscripten_set_keydown_callback_on_thread (line 7822) | function _emscripten_set_keydown_callback_on_thread(target, userData, us...
function _emscripten_set_keypress_callback_on_thread (line 7827) | function _emscripten_set_keypress_callback_on_thread(target, userData, u...
function _emscripten_set_keyup_callback_on_thread (line 7832) | function _emscripten_set_keyup_callback_on_thread(target, userData, useC...
function _emscripten_set_main_loop_arg (line 7837) | function _emscripten_set_main_loop_arg(func, arg, fps, simulateInfiniteL...
function fillMouseEventData (line 7842) | function fillMouseEventData(eventStruct, e, target) {
function registerMouseEventCallback (line 7867) | function registerMouseEventCallback(target, userData, useCapture, callba...
function _emscripten_set_mousedown_callback_on_thread (line 7890) | function _emscripten_set_mousedown_callback_on_thread(target, userData, ...
function _emscripten_set_mouseenter_callback_on_thread (line 7895) | function _emscripten_set_mouseenter_callback_on_thread(target, userData,...
function _emscripten_set_mouseleave_callback_on_thread (line 7900) | function _emscripten_set_mouseleave_callback_on_thread(target, userData,...
function _emscripten_set_mousemove_callback_on_thread (line 7905) | function _emscripten_set_mousemove_callback_on_thread(target, userData, ...
function _emscripten_set_mouseup_callback_on_thread (line 7910) | function _emscripten_set_mouseup_callback_on_thread(target, userData, us...
function fillPointerlockChangeEventData (line 7915) | function fillPointerlockChangeEventData(eventStruct) {
function registerPointerlockChangeEventCallback (line 7925) | function registerPointerlockChangeEventCallback(target, userData, useCap...
function _emscripten_set_pointerlockchange_callback_on_thread (line 7947) | function _emscripten_set_pointerlockchange_callback_on_thread(target, us...
function registerUiEventCallback (line 7962) | function registerUiEventCallback(target, userData, useCapture, callbackf...
function _emscripten_set_resize_callback_on_thread (line 8003) | function _emscripten_set_resize_callback_on_thread(target, userData, use...
function registerTouchEventCallback (line 8008) | function registerTouchEventCallback(target, userData, useCapture, callba...
function _emscripten_set_touchcancel_callback_on_thread (line 8081) | function _emscripten_set_touchcancel_callback_on_thread(target, userData...
function _emscripten_set_touchend_callback_on_thread (line 8086) | function _emscripten_set_touchend_callback_on_thread(target, userData, u...
function _emscripten_set_touchmove_callback_on_thread (line 8091) | function _emscripten_set_touchmove_callback_on_thread(target, userData, ...
function _emscripten_set_touchstart_callback_on_thread (line 8096) | function _emscripten_set_touchstart_callback_on_thread(target, userData,...
function fillVisibilityChangeEventData (line 8101) | function fillVisibilityChangeEventData(eventStruct) {
function registerVisibilityChangeEventCallback (line 8110) | function registerVisibilityChangeEventCallback(target, userData, useCapt...
function _emscripten_set_visibilitychange_callback_on_thread (line 8132) | function _emscripten_set_visibilitychange_callback_on_thread(userData, u...
function registerWheelEventCallback (line 8140) | function registerWheelEventCallback(target, userData, useCapture, callba...
function _emscripten_set_wheel_callback_on_thread (line 8165) | function _emscripten_set_wheel_callback_on_thread(target, userData, useC...
function _emscripten_sleep (line 8175) | function _emscripten_sleep() {
function _emscripten_thread_sleep (line 8179) | function _emscripten_thread_sleep(msecs) {
function getExecutableName (line 8188) | function getExecutableName() {
function getEnvStrings (line 8191) | function getEnvStrings() {
function _environ_get (line 8217) | function _environ_get(__environ, environ_buf) {try {
function _environ_sizes_get (line 8233) | function _environ_sizes_get(penviron_count, penviron_buf_size) {try {
function _exit (line 8249) | function _exit(status) {
function _fd_close (line 8255) | function _fd_close(fd) {try {
function _fd_read (line 8266) | function _fd_read(fd, iov, iovcnt, pnum) {try {
function _fd_seek (line 8278) | function _fd_seek(fd, offset_low, offset_high, whence, newOffset) {try {
function _fd_write (line 8302) | function _fd_write(fd, iov, iovcnt, pnum) {try {
function _gettimeofday (line 8314) | function _gettimeofday(ptr) {
function _setTempRet0 (line 8321) | function _setTempRet0($i) {
function _sigaction (line 8325) | function _sigaction(signum, act, oldact) {
function _signal (line 8332) | function _signal(sig, func) {
function readAsmConstArgs (line 8342) | function readAsmConstArgs(sigPtr, buf) {
function intArrayFromString (line 8434) | function intArrayFromString(stringy, dontAddNull, length) {
function intArrayToString (line 8442) | function intArrayToString(array) {
function ExitStatus (line 8979) | function ExitStatus(status) {
function callMain (line 8993) | function callMain(args) {
function stackCheckInit (line 9041) | function stackCheckInit() {
function run (line 9051) | function run(args) {
function checkUnflushedContent (line 9103) | function checkUnflushedContent() {
function exit (line 9144) | function exit(status, implicit) {
FILE: sdl/dev_menu.c
type DevButton (line 39) | struct DevButton {
type DevButton (line 44) | struct DevButton
type DevMenu (line 53) | struct DevMenu
type DevMenu (line 54) | struct DevMenu
type CoreError (line 54) | struct CoreError
type DevMenu (line 55) | struct DevMenu
type DevMenu (line 56) | struct DevMenu
type DevMenu (line 57) | struct DevMenu
type DevMenu (line 58) | struct DevMenu
type DevMenu (line 59) | struct DevMenu
type DevMenu (line 60) | struct DevMenu
function dev_init (line 62) | void dev_init(struct DevMenu *devMenu, struct Runner *runner, struct Set...
function dev_show (line 69) | void dev_show(struct DevMenu *devMenu, bool reload)
function dev_update (line 127) | void dev_update(struct DevMenu *devMenu, struct CoreInput *input)
function dev_handleDropFile (line 203) | bool dev_handleDropFile(struct DevMenu *devMenu, const char *filename)
function dev_showInfo (line 221) | void dev_showInfo(struct DevMenu *devMenu)
function dev_showError (line 242) | void dev_showError(struct DevMenu *devMenu, struct CoreError error)
function dev_updateButtons (line 273) | void dev_updateButtons(struct DevMenu *devMenu)
function dev_onButtonTap (line 288) | void dev_onButtonTap(struct DevMenu *devMenu)
function dev_showToolsMenu (line 355) | void dev_showToolsMenu(struct DevMenu *devMenu)
function dev_showClearRamMenu (line 376) | void dev_showClearRamMenu(struct DevMenu *devMenu)
function dev_showMenu (line 393) | void dev_showMenu(struct DevMenu *devMenu, const char *message, const ch...
function dev_clearPersistentRam (line 421) | void dev_clearPersistentRam(struct DevMenu *devMenu)
FILE: sdl/dev_menu.h
type DevModeMenu (line 35) | enum DevModeMenu {
type DevMenu (line 41) | struct DevMenu {
type DevMenu (line 52) | struct DevMenu
type Runner (line 52) | struct Runner
type Settings (line 52) | struct Settings
type DevMenu (line 53) | struct DevMenu
type DevMenu (line 54) | struct DevMenu
type CoreInput (line 54) | struct CoreInput
type DevMenu (line 55) | struct DevMenu
FILE: sdl/main.c
type Runner (line 89) | struct Runner
type DevMenu (line 91) | struct DevMenu
type Settings (line 93) | struct Settings
type CoreInput (line 94) | struct CoreInput
type MainState (line 96) | enum MainState
function main (line 111) | int main(int argc, const char * argv[])
function bootNX (line 217) | void bootNX()
function rebootNX (line 231) | void rebootNX()
function hasProgram (line 239) | bool hasProgram()
function selectProgram (line 249) | void selectProgram(const char *filename)
function runMainProgram (line 262) | void runMainProgram()
function runToolProgram (line 285) | void runToolProgram(const char *filename)
function showDevMenu (line 302) | void showDevMenu()
function usesMainProgramAsDisk (line 313) | bool usesMainProgramAsDisk()
function getDiskFilename (line 318) | void getDiskFilename(char *outputString)
function getRamFilename (line 341) | void getRamFilename(char *outputString)
function updateMouseMode (line 371) | void updateMouseMode()
function setMouseEnabled (line 383) | void setMouseEnabled(bool enabled)
function update (line 389) | void update(void *arg)
function updateScreenRect (line 763) | void updateScreenRect(int winW, int winH)
function configureJoysticks (line 814) | void configureJoysticks() {
function closeJoysticks (line 827) | void closeJoysticks() {
function setTouchPosition (line 836) | void setTouchPosition(int windowX, int windowY)
function toggleZoom (line 842) | void toggleZoom()
function changeVolume (line 850) | void changeVolume(int delta)
function audioCallback (line 860) | void audioCallback(void *userdata, Uint8 *stream, int len)
function saveScreenshot (line 867) | void saveScreenshot(void *pixels, int scale)
function onloaded (line 884) | void onloaded(const char *filename)
function onerror (line 889) | void onerror(const char *filename)
FILE: sdl/main.h
type MainState (line 26) | enum MainState {
type Zoom (line 34) | enum Zoom {
FILE: sdl/runner.c
type CoreError (line 28) | struct CoreError
type DataManager (line 29) | struct DataManager
type DataManager (line 30) | struct DataManager
type DataManager (line 31) | struct DataManager
type ControlsInfo (line 32) | struct ControlsInfo
function runner_init (line 37) | void runner_init(struct Runner *runner)
function runner_deinit (line 61) | void runner_deinit(struct Runner *runner)
function runner_isOkay (line 72) | bool runner_isOkay(struct Runner *runner)
function runner_loadProgram (line 77) | struct CoreError runner_loadProgram(struct Runner *runner, const char *f...
function interpreterDidFail (line 112) | void interpreterDidFail(void *context, struct CoreError coreError)
function diskDriveWillAccess (line 119) | bool diskDriveWillAccess(void *context, struct DataManager *diskDataMana...
function diskDriveDidSave (line 172) | void diskDriveDidSave(void *context, struct DataManager *diskDataManager)
function diskDriveIsFull (line 204) | void diskDriveIsFull(void *context, struct DataManager *diskDataManager)
function controlsDidChange (line 211) | void controlsDidChange(void *context, struct ControlsInfo controlsInfo)
function persistentRamWillAccess (line 229) | void persistentRamWillAccess(void *context, uint8_t *destination, int size)
function persistentRamDidChange (line 245) | void persistentRamDidChange(void *context, uint8_t *data, int size)
FILE: sdl/runner.h
type Runner (line 28) | struct Runner {
type Runner (line 34) | struct Runner
type Runner (line 35) | struct Runner
type Runner (line 36) | struct Runner
type CoreError (line 37) | struct CoreError
type Runner (line 37) | struct Runner
FILE: sdl/screenshot.c
function writeImage (line 35) | bool writeImage(const char *filename, int width, int height, uint32_t *p...
function screenshot_save (line 66) | bool screenshot_save(uint32_t *pixels, int scale)
FILE: sdl/settings.c
type Parameters (line 33) | struct Parameters
type Settings (line 34) | struct Settings
function settings_init (line 36) | void settings_init(struct Settings *settings, char *filenameOut, int arg...
function settings_filename (line 120) | bool settings_filename(char *destination)
function settings_setParameter (line 135) | void settings_setParameter(struct Parameters *parameters, const char *ke...
function settings_save (line 191) | void settings_save(struct Settings *settings)
function settings_saveAs (line 202) | void settings_saveAs(struct Settings *settings, const char *filename)
function settings_addTool (line 242) | bool settings_addTool(struct Settings *settings, const char *filename)
function settings_removeTool (line 255) | void settings_removeTool(struct Settings *settings, int index)
FILE: sdl/settings.h
type Parameters (line 30) | struct Parameters {
type Settings (line 38) | struct Settings {
type Settings (line 46) | struct Settings
type Settings (line 47) | struct Settings
type Settings (line 48) | struct Settings
type Settings (line 49) | struct Settings
FILE: sdl/stb_image_write.h
function STBIWDEF (line 253) | STBIWDEF void stbi_flip_vertically_on_write(int flag)
type stbi__write_context (line 258) | typedef struct
function stbi__start_write_callbacks (line 265) | static void stbi__start_write_callbacks(stbi__write_context *s, stbi_wri...
function stbi__stdio_write (line 273) | static void stbi__stdio_write(void *context, void *data, int size)
function stbi__start_write_file (line 278) | static int stbi__start_write_file(stbi__write_context *s, const char *fi...
function stbi__end_write_file (line 291) | static void stbi__end_write_file(stbi__write_context *s)
type stbiw_uint32 (line 298) | typedef unsigned int stbiw_uint32;
function stbiw__writefv (line 301) | static void stbiw__writefv(stbi__write_context *s, const char *fmt, va_l...
function stbiw__writef (line 330) | static void stbiw__writef(stbi__write_context *s, const char *fmt, ...)
function stbiw__putc (line 338) | static void stbiw__putc(stbi__write_context *s, unsigned char c)
function stbiw__write3 (line 343) | static void stbiw__write3(stbi__write_context *s, unsigned char a, unsig...
function stbiw__write_pixel (line 352) | static void stbiw__write_pixel(stbi__write_context *s, int rgb_dir, int ...
function stbiw__write_pixels (line 385) | static void stbiw__write_pixels(stbi__write_context *s, int rgb_dir, int...
function stbiw__outfile (line 413) | static int stbiw__outfile(stbi__write_context *s, int rgb_dir, int vdir,...
function stbi_write_bmp_core (line 427) | static int stbi_write_bmp_core(stbi__write_context *s, int x, int y, int...
function STBIWDEF (line 436) | STBIWDEF int stbi_write_bmp_to_func(stbi_write_func *func, void *context...
function STBIWDEF (line 444) | STBIWDEF int stbi_write_bmp(char const *filename, int x, int y, int comp...
function stbi_write_tga_core (line 456) | static int stbi_write_tga_core(stbi__write_context *s, int x, int y, int...
function STBIWDEF (line 534) | STBIWDEF int stbi_write_tga_to_func(stbi_write_func *func, void *context...
function STBIWDEF (line 542) | STBIWDEF int stbi_write_tga(char const *filename, int x, int y, int comp...
function stbiw__linear_to_rgbe (line 560) | void stbiw__linear_to_rgbe(unsigned char *rgbe, float *linear)
function stbiw__write_run_data (line 577) | void stbiw__write_run_data(stbi__write_context *s, int length, unsigned ...
function stbiw__write_dump_data (line 585) | void stbiw__write_dump_data(stbi__write_context *s, int length, unsigned...
function stbiw__write_hdr_scanline (line 593) | void stbiw__write_hdr_scanline(stbi__write_context *s, int width, int nc...
function stbi_write_hdr_core (line 682) | static int stbi_write_hdr_core(stbi__write_context *s, int x, int y, int...
function STBIWDEF (line 708) | STBIWDEF int stbi_write_hdr_to_func(stbi_write_func *func, void *context...
function STBIWDEF (line 716) | STBIWDEF int stbi_write_hdr(char const *filename, int x, int y, int comp...
function stbiw__zlib_bitrev (line 771) | static int stbiw__zlib_bitrev(int code, int codebits)
function stbiw__zlib_countm (line 781) | static unsigned int stbiw__zlib_countm(unsigned char *a, unsigned char *...
function stbiw__zhash (line 789) | static unsigned int stbiw__zhash(unsigned char *data)
function stbiw__crc32 (line 935) | static unsigned int stbiw__crc32(unsigned char *buffer, int len)
function stbiw__wpcrc (line 984) | static void stbiw__wpcrc(unsigned char **data, int len)
function stbiw__paeth (line 990) | static unsigned char stbiw__paeth(int a, int b, int c)
function stbiw__encode_png_line (line 999) | static void stbiw__encode_png_line(unsigned char *pixels, int stride_byt...
function STBIWDEF (line 1119) | STBIWDEF int stbi_write_png(char const *filename, int x, int y, int comp...
function STBIWDEF (line 1139) | STBIWDEF int stbi_write_png_to_func(stbi_write_func *func, void *context...
function stbiw__jpg_writeBits (line 1161) | static void stbiw__jpg_writeBits(stbi__write_context *s, int *bitBufP, i...
function stbiw__jpg_DCT (line 1178) | static void stbiw__jpg_DCT(float *d0p, float *d1p, float *d2p, float *d3...
function stbiw__jpg_calcBits (line 1226) | static void stbiw__jpg_calcBits(int val, unsigned short bits[2]) {
function stbiw__jpg_processDU (line 1236) | static int stbiw__jpg_processDU(stbi__write_context *s, int *bitBuf, int...
function stbi_write_jpg_core (line 1301) | static int stbi_write_jpg_core(stbi__write_context *s, int width, int he...
function STBIWDEF (line 1473) | STBIWDEF int stbi_write_jpg_to_func(stbi_write_func *func, void *context...
function STBIWDEF (line 1482) | STBIWDEF int stbi_write_jpg(char const *filename, int x, int y, int comp...
FILE: sdl/system_paths.c
function desktop_path (line 29) | void desktop_path(char *buffer, size_t size)
function FILE (line 47) | FILE* fopen_utf8(const char* filename, const char* mode)
FILE: sdl/utils.c
function displayName (line 25) | void displayName(const char *filename, char *destination, size_t size)
function hasPostfix (line 48) | bool hasPostfix(const char *string, const char *postfix)
Condensed preview — 192 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,840K chars).
[
{
"path": ".gitignore",
"chars": 1604,
"preview": "# Xcode\n#\n# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore\n\n"
},
{
"path": ".gitlab-ci.yml",
"chars": 7218,
"preview": "# DESCRIPTION: GitLab CI/CD for libRetro\n\n##############################################################################"
},
{
"path": "LICENSE",
"chars": 850,
"preview": "Copyright 2016-2021 Timo Kloss\n\nThis software is provided 'as-is', without any express or implied\nwarranty. In no event "
},
{
"path": "README.md",
"chars": 1925,
"preview": "# LowRes NX\n\n## Program retro games in BASIC\n\nMake your own retro games on a virtual game console. Program in the classi"
},
{
"path": "assets/overlay.nx",
"chars": 2122,
"preview": "#2:CHARS\n00000000000000000000000000000000\n3C3C3C3C3C3C3C3C3C242424243C243C\nFEFEFEFE7E000000FE9292DA7E000000\n7EFFFFFFFFFF"
},
{
"path": "core/accessories/disk_drive.c",
"chars": 3318,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/accessories/disk_drive.h",
"chars": 1455,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/boot_intro.c",
"chars": 6557,
"preview": "//\n// Copyright 2017-2018 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "core/boot_intro.h",
"chars": 1197,
"preview": "//\n// Copyright 2017-2018 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "core/core.c",
"chars": 8695,
"preview": "//\n// Copyright 2016-2020 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "core/core.h",
"chars": 2846,
"preview": "//\n// Copyright 2016-2020 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "core/core_delegate.c",
"chars": 3173,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/core_delegate.h",
"chars": 2838,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/core_stats.c",
"chars": 2965,
"preview": "//\n// Copyright 2020 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/core_stats.h",
"chars": 1340,
"preview": "//\n// Copyright 2020 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/datamanager/data_manager.c",
"chars": 11373,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/datamanager/data_manager.h",
"chars": 1977,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/interpreter/charsets.c",
"chars": 1141,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/interpreter/charsets.h",
"chars": 1100,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/interpreter/cmd_audio.c",
"chars": 17945,
"preview": "//\n// Copyright 2018 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/interpreter/cmd_audio.h",
"chars": 1644,
"preview": "//\n// Copyright 2018 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/interpreter/cmd_background.c",
"chars": 19775,
"preview": "//\n// Copyright 2017-2019 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "core/interpreter/cmd_background.h",
"chars": 1743,
"preview": "//\n// Copyright 2017-2019 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "core/interpreter/cmd_control.c",
"chars": 23551,
"preview": "//\n// Copyright 2017-2020 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "core/interpreter/cmd_control.h",
"chars": 1914,
"preview": "//\n// Copyright 2017-2020 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "core/interpreter/cmd_data.c",
"chars": 4862,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/interpreter/cmd_data.h",
"chars": 1152,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/interpreter/cmd_files.c",
"chars": 8100,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/interpreter/cmd_files.h",
"chars": 1267,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/interpreter/cmd_io.c",
"chars": 10169,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/interpreter/cmd_io.h",
"chars": 1525,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/interpreter/cmd_maths.c",
"chars": 10810,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/interpreter/cmd_maths.h",
"chars": 1349,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/interpreter/cmd_memory.c",
"chars": 11052,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/interpreter/cmd_memory.h",
"chars": 1300,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/interpreter/cmd_screen.c",
"chars": 11251,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/interpreter/cmd_screen.h",
"chars": 1480,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/interpreter/cmd_sprites.c",
"chars": 9542,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/interpreter/cmd_sprites.h",
"chars": 1337,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/interpreter/cmd_strings.c",
"chars": 20691,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/interpreter/cmd_strings.h",
"chars": 1601,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/interpreter/cmd_subs.c",
"chars": 15151,
"preview": "//\n// Copyright 2018-2020 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "core/interpreter/cmd_subs.h",
"chars": 1293,
"preview": "//\n// Copyright 2018 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/interpreter/cmd_text.c",
"chars": 14287,
"preview": "//\n// Copyright 2017-2020 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "core/interpreter/cmd_text.h",
"chars": 1587,
"preview": "//\n// Copyright 2017-2020 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "core/interpreter/cmd_variables.c",
"chars": 6936,
"preview": "//\n// Copyright 2017-2020 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "core/interpreter/cmd_variables.h",
"chars": 1216,
"preview": "//\n// Copyright 2017-2020 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "core/interpreter/data.c",
"chars": 2214,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/interpreter/data.h",
"chars": 1139,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/interpreter/error.c",
"chars": 3005,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/interpreter/error.h",
"chars": 2981,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/interpreter/interpreter.c",
"chars": 48259,
"preview": "//\n// Copyright 2016-2020 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "core/interpreter/interpreter.h",
"chars": 4081,
"preview": "//\n// Copyright 2016-2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "core/interpreter/interpreter_config.h",
"chars": 1434,
"preview": "//\n// Copyright 2017-2020 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "core/interpreter/interpreter_utils.c",
"chars": 12541,
"preview": "//\n// Copyright 2017-2018 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "core/interpreter/interpreter_utils.h",
"chars": 1610,
"preview": "//\n// Copyright 2017-2018 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "core/interpreter/labels.c",
"chars": 2349,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/interpreter/labels.h",
"chars": 1760,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/interpreter/rcstring.c",
"chars": 1567,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/interpreter/rcstring.h",
"chars": 1201,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/interpreter/string_utils.c",
"chars": 2595,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/interpreter/string_utils.h",
"chars": 1214,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/interpreter/token.c",
"chars": 3476,
"preview": "//\n// Copyright 2017-2020 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "core/interpreter/token.h",
"chars": 4487,
"preview": "//\n// Copyright 2017-2020 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "core/interpreter/tokenizer.c",
"chars": 13769,
"preview": "//\n// Copyright 2016-2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "core/interpreter/tokenizer.h",
"chars": 2130,
"preview": "//\n// Copyright 2016-2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "core/interpreter/value.c",
"chars": 1128,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/interpreter/value.h",
"chars": 1488,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/interpreter/variables.c",
"chars": 8026,
"preview": "//\n// Copyright 2017-2020 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "core/interpreter/variables.h",
"chars": 2526,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/libraries/audio_lib.c",
"chars": 11379,
"preview": "//\n// Copyright 2018 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/libraries/audio_lib.h",
"chars": 1932,
"preview": "//\n// Copyright 2018 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/libraries/default_characters.c",
"chars": 7500,
"preview": "//\n// Copyright 2016 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/libraries/default_characters.h",
"chars": 1074,
"preview": "//\n// Copyright 2016 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/libraries/sprites_lib.c",
"chars": 5375,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/libraries/sprites_lib.h",
"chars": 1259,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/libraries/startup_sequence.c",
"chars": 3493,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/libraries/startup_sequence.h",
"chars": 1066,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/libraries/text_lib.c",
"chars": 14392,
"preview": "//\n// Copyright 2016 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/libraries/text_lib.h",
"chars": 2844,
"preview": "//\n// Copyright 2016-2019 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "core/machine/audio_chip.c",
"chars": 14351,
"preview": "//\n// Copyright 2016-2020 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "core/machine/audio_chip.h",
"chars": 3252,
"preview": "//\n// Copyright 2016-2020 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "core/machine/io_chip.h",
"chars": 2007,
"preview": "//\n// Copyright 2016 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/machine/machine.c",
"chars": 4181,
"preview": "//\n// Copyright 2016-2018 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "core/machine/machine.h",
"chars": 2509,
"preview": "//\n// Copyright 2016 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/machine/video_chip.c",
"chars": 8781,
"preview": "//\n// Copyright 2016-2020 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "core/machine/video_chip.h",
"chars": 3415,
"preview": "//\n// Copyright 2016 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "core/overlay/overlay.c",
"chars": 3782,
"preview": "//\n// Copyright 2017-2018 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "core/overlay/overlay.h",
"chars": 1438,
"preview": "//\n// Copyright 2017-2018 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "core/overlay/overlay_data.c",
"chars": 7577,
"preview": "//\n// Copyright 2017-2018 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "core/overlay/overlay_data.h",
"chars": 1113,
"preview": "//\n// Copyright 2017-2018 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "docs/license.txt",
"chars": 850,
"preview": "Copyright 2016-2021 Timo Kloss\n\nThis software is provided 'as-is', without any express or implied\nwarranty. In no event "
},
{
"path": "docs/manual.html",
"chars": 88176,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\" />\n<meta name=\"viewport\" content=\"width=device-width, init"
},
{
"path": "docs/readme.txt",
"chars": 1991,
"preview": "***************\n* First Steps *\n***************\n\nPlease read the introduction (at least \"Getting Started\") of the manual"
},
{
"path": "extras/LowRes NX.sublime-syntax",
"chars": 2030,
"preview": "%YAML 1.2\n---\n# See http://www.sublimetext.com/docs/3/syntax.html\nfile_extensions:\n - nx\nname: LowRes NX\nscope: source."
},
{
"path": "libretro/libretro.h",
"chars": 102400,
"preview": "/* Copyright (C) 2010-2016 The RetroArch team\n *\n * --------------------------------------------------------------------"
},
{
"path": "libretro/libretro_main.c",
"chars": 19288,
"preview": "//\n// Copyright 2021 Timo Kloss, Antoine Fauroux\n//\n// This software is provided 'as-is', without any express or implied"
},
{
"path": "libretro/libretro_main.h",
"chars": 1112,
"preview": "//\n// Copyright 2021 Timo Kloss, Antoine Fauroux\n//\n// This software is provided 'as-is', without any express or implied"
},
{
"path": "platform/GameShell/README.md",
"chars": 147,
"preview": "# ClockworkPi GameShell\n\nCompile the Linux version and copy it to /home/cpi/apps.\nCopy this folder to the GameShell to a"
},
{
"path": "platform/GameShell/home/cpi/apps/Menu/55_LowRes NX/action.config",
"chars": 160,
"preview": "ROM=/home/cpi/games/LowResNX\nEXT=nx\nLAUNCHER=/home/cpi/apps/LowResNX -disabledev yes -fullscreen yes -zoom 3 -mapping 1 "
},
{
"path": "platform/GameShell/home/cpi/games/LowResNX/LowRes Galaxy 2 (1.5).nx",
"chars": 27540,
"preview": "'TITLE: LOWRES GALAXY 2\n'AUTHOR: TIMO KLOSS\n\nRANDOMIZE TIMER\n\n' SPRITES\n' 0 PLAYER SHIP\n' 1 JET\n' 2-9 PLAYER BULLETS\n"
},
{
"path": "platform/GameShell/home/cpi/games/LowResNX/Star Scroller 1.2.nx",
"chars": 10016,
"preview": "'TITLE: STAR SCROLLER\n'AUTHORS: TIMO KLOSS, DESBYC\n\nDIM GLOBAL STARX(127)\n\nFOR I=0 TO 127\n STARX(I)=INT(RND*256)\nNEX"
},
{
"path": "platform/LibRetro/Makefile",
"chars": 25642,
"preview": "DEBUG=0\nPSS_STYLE=1\nEXTERNAL_ZLIB=0\nHAVE_GRIFFIN=1\nSTATIC_LINKING=0\nENDIANNESS_DEFINES=\n\nSPACE :=\nSPACE := $(SPACE) $(SP"
},
{
"path": "platform/LibRetro/Makefile.common",
"chars": 783,
"preview": "\nINCFLAGS := -I ../../core \\\n -I ../../core/machine \\\n -I ../../core/acces"
},
{
"path": "platform/LibRetro/jni/Android.mk",
"chars": 1145,
"preview": "LOCAL_PATH := $(call my-dir)\n\nSRCDIR := $(LOCAL_PATH)/../../../\n\nINCFLAGS := -I $(SRCDIR)/core \\\n "
},
{
"path": "platform/LibRetro/jni/Application.mk",
"chars": 36,
"preview": "APP_ABI := all\nAPP_STL := c++_static"
},
{
"path": "platform/LibRetro/link.T",
"chars": 38,
"preview": "{\n global: retro_*;\n local: *;\n};\n"
},
{
"path": "platform/Linux/README.md",
"chars": 678,
"preview": "Build for LINUX\n===============\n\n## Installing Dependencies\n\n### Ubuntu\n> Tested with Ubuntu 18.04\n\n```bash\nsudo apt ins"
},
{
"path": "platform/Linux/makefile",
"chars": 713,
"preview": "# Declaration of variables\nCC = gcc\nCC_FLAGS = -D __LINUX__ -w -I ../../core -I ../../core/machine -I ../../core/access"
},
{
"path": "platform/Windows/LowRes NX Win/LowRes NX Win.vcxproj",
"chars": 14223,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.microso"
},
{
"path": "platform/Windows/LowRes NX Win/LowRes NX Win.vcxproj.filters",
"chars": 11700,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
},
{
"path": "platform/Windows/LowRes NX Win/resource.h",
"chars": 440,
"preview": "//{{NO_DEPENDENCIES}}\n// Microsoft Visual C++ generated include file.\n// Used by LowRes NX Win.rc\n//\n#define IDI_ICON1 "
},
{
"path": "platform/Windows/LowRes NX Win/resource1.h",
"chars": 440,
"preview": "//{{NO_DEPENDENCIES}}\n// Microsoft Visual C++ generated include file.\n// Used by LowRes NX Win.rc\n//\n#define IDI_ICON1 "
},
{
"path": "platform/Windows/LowRes NX Win.sln",
"chars": 1420,
"preview": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 15\nVisualStudioVersion = 15.0.27703.2035\nM"
},
{
"path": "platform/iOS/LowRes NX iOS/AppDelegate.swift",
"chars": 2130,
"preview": "//\n// AppDelegate.swift\n// LowRes NX iOS\n//\n// Created by Timo Kloss on 1/9/17.\n// Copyright © 2017 Inutilis Softwar"
},
{
"path": "platform/iOS/LowRes NX iOS/Assets.xcassets/AppIcon.appiconset/Contents.json",
"chars": 1495,
"preview": "{\n \"images\" : [\n {\n \"idiom\" : \"iphone\",\n \"size\" : \"20x20\",\n \"scale\" : \"2x\"\n },\n {\n \"idiom\""
},
{
"path": "platform/iOS/LowRes NX iOS/Assets.xcassets/Contents.json",
"chars": 62,
"preview": "{\n \"info\" : {\n \"version\" : 1,\n \"author\" : \"xcode\"\n }\n}"
},
{
"path": "platform/iOS/LowRes NX iOS/Base.lproj/LaunchScreen.storyboard",
"chars": 1836,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\" version=\"3"
},
{
"path": "platform/iOS/LowRes NX iOS/Base.lproj/Main.storyboard",
"chars": 5252,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\" version=\"3"
},
{
"path": "platform/iOS/LowRes NX iOS/CoreWrapper.swift",
"chars": 3681,
"preview": "//\n// CoreWrapper.swift\n// LowRes NX iOS\n//\n// Created by Timo Kloss on 2/9/17.\n// Copyright © 2017 Inutilis Softwar"
},
{
"path": "platform/iOS/LowRes NX iOS/Info.plist",
"chars": 1612,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
},
{
"path": "platform/iOS/LowRes NX iOS/LowResNX-Bridging-Header.h",
"chars": 176,
"preview": "//\n// LowResNX-Bridging-Header.h\n// LowRes NX iOS\n//\n// Created by Timo Kloss on 23/4/17.\n// Copyright © 2017 Inutil"
},
{
"path": "platform/iOS/LowRes NX iOS/LowResNXView.swift",
"chars": 3379,
"preview": "//\n// LowResNXView.swift\n// LowRes NX iOS\n//\n// Created by Timo Kloss on 1/9/17.\n// Copyright © 2017 Inutilis Softwa"
},
{
"path": "platform/iOS/LowRes NX iOS/ViewController.swift",
"chars": 8872,
"preview": "//\n// ViewController.swift\n// LowRes NX iOS\n//\n// Created by Timo Kloss on 1/9/17.\n// Copyright © 2017 Inutilis Soft"
},
{
"path": "platform/iOS/LowRes NX iOS.xcodeproj/project.pbxproj",
"chars": 39442,
"preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
},
{
"path": "platform/iOS/LowRes NX iOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata",
"chars": 158,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n version = \"1.0\">\n <FileRef\n location = \"self:LowRes NX iOS.x"
},
{
"path": "platform/iOS/LowRes NX iOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist",
"chars": 238,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
},
{
"path": "platform/iOS/program.nx",
"chars": 21000,
"preview": "RANDOMIZE TIMER\n\n'VALUES FOR 16 ALIENS\nDIM ALIENS(15,3)\n' 0 TYPE (0=DISABLED)\n' 1 TICK\n' 2 START Y\n' 3 HITS\n\nBG 0\nBG COP"
},
{
"path": "platform/macOS/LowRes NX macOS/Assets.xcassets/AppIcon.appiconset/Contents.json",
"chars": 1339,
"preview": "{\n \"images\" : [\n {\n \"size\" : \"16x16\",\n \"idiom\" : \"mac\",\n \"filename\" : \"Mac App Icon 16.png\",\n \"s"
},
{
"path": "platform/macOS/LowRes NX macOS/Assets.xcassets/Contents.json",
"chars": 62,
"preview": "{\n \"info\" : {\n \"version\" : 1,\n \"author\" : \"xcode\"\n }\n}"
},
{
"path": "platform/macOS/LowRes NX macOS/Info.plist",
"chars": 1474,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
},
{
"path": "platform/macOS/LowRes NX macOS/LowRes_NX_macOS_SDL.entitlements",
"chars": 181,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
},
{
"path": "platform/macOS/LowRes NX macOS.xcodeproj/project.pbxproj",
"chars": 47958,
"preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 50;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
},
{
"path": "platform/macOS/LowRes NX macOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata",
"chars": 211,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n version = \"1.0\">\n <FileRef\n location = \"self:/Users/timoklos"
},
{
"path": "platform/macOS/LowRes NX macOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist",
"chars": 238,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
},
{
"path": "platform/web/README.md",
"chars": 192,
"preview": "These lines are interesting, but still not a real guide for compiling:\n\nsource ./emsdk_env.sh\nemmake make\n\nAlways clean "
},
{
"path": "platform/web/embed/package/LowResNX120.js",
"chars": 420114,
"preview": "\n\n// The Module object: Our interface to the outside world. We import\n// and export values on it. There are various ways"
},
{
"path": "platform/web/embed/package/index.html",
"chars": 1378,
"preview": "<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <meta http-equiv=\"Content-Type\" content=\"text/h"
},
{
"path": "platform/web/embed/package/program.nx",
"chars": 47,
"preview": "PRINT \"REPLACE THIS WITH\"\nPRINT \"YOUR PROGRAM\"\n"
},
{
"path": "platform/web/embed/readme.txt",
"chars": 532,
"preview": "Embeddable Web Player for LowRes NX\n\nReplace the file \"program.nx\" in the \"package\" folder with your own program. It mus"
},
{
"path": "platform/web/makefile",
"chars": 635,
"preview": "# Declaration of variables\nCC = emcc\nCC_FLAGS = -w -s USE_SDL=2 -I ../../core -I ../../core/machine -I ../../core/access"
},
{
"path": "programs/Gfx Designer 2.0.nx",
"chars": 61942,
"preview": "'TITLE: GFX DESIGNER\n'AUTHOR: TIMO KLOSS, MRLEGOBOY\n\n'======================\n'** RAM MAP **\nGLOBAL USERCHARS,USERBG,USE"
},
{
"path": "programs/LowRes Adventure 1.1.nx",
"chars": 6785,
"preview": "'TITLE: LOWRES ADVENTURE\n'AUTHOR: TIMO KLOSS\n\nSOUND 0,0,0,0\nSOUND 1,3,0,0\n\nSTARTADV:\nHEALTH=10\nNAME$=\"\"\nKEY=0\n\nCLS\nPR"
},
{
"path": "programs/LowRes Galaxy 2 (1.5).nx",
"chars": 27540,
"preview": "'TITLE: LOWRES GALAXY 2\n'AUTHOR: TIMO KLOSS\n\nRANDOMIZE TIMER\n\n' SPRITES\n' 0 PLAYER SHIP\n' 1 JET\n' 2-9 PLAYER BULLETS\n"
},
{
"path": "programs/Sound Composer 1.5.nx",
"chars": 48183,
"preview": "'TITLE: SOUND COMPOSER\n'AUTHOR: TIMO KLOSS\n\n'ENERGY SAVING MODE\nSYSTEM 0,1\n\nGLOBAL NUMINST,INSTSIZE\nNUMINST=16\nINSTSI"
},
{
"path": "programs/Star Scroller 1.2.nx",
"chars": 10016,
"preview": "'TITLE: STAR SCROLLER\n'AUTHORS: TIMO KLOSS, DESBYC\n\nDIM GLOBAL STARX(127)\n\nFOR I=0 TO 127\n STARX(I)=INT(RND*256)\nNEX"
},
{
"path": "programs test/BG Scroll.nx",
"chars": 1910,
"preview": "BG COPY 0,0,20,16 TO 0,0\nGAMEPAD 1\nDO\n IF LEFT TAP(0) THEN BG SCROLL 2,2 TO 17,13 STEP -1,0\n IF RIGHT TAP(0) THEN BG SCR"
},
{
"path": "programs test/Crazy Text.nx",
"chars": 490,
"preview": "RANDOMIZE TIMER\n\nPRINT \"++++++++++++++++++++\";\nPRINT \"....................\";\nPRINT \"////////////////////\";\nPRINT\nPRINT \""
},
{
"path": "programs test/Demo 0.5.nx",
"chars": 14343,
"preview": "'** SCROLLING BACKGROUND AND SPRITES DEMO 0.5 **\n\nGLOBAL TICK,WATERY\n\nBG 0\nBG COPY 0,0,32,16 TO 0,0\nBG 1\nBG COPY 0,16,32"
},
{
"path": "programs test/Files.nx",
"chars": 62,
"preview": "FILES\nFOR I=0 TO 15\n NUMBER 0,I,I,2\n TEXT 3,I,FILE$(I)\nNEXT I\n"
},
{
"path": "programs test/Scrolling Map 0.3.nx",
"chars": 18972,
"preview": "'** SCROLLING MAP 0.3 **\n\n'GET MAP SIZE\nMAPW=PEEK(ROM(3)+2)\nMAPH=PEEK(ROM(3)+3)\n\n'INITIAL CAMERA POSITION\nCAMX=176\nCAMY="
},
{
"path": "programs test/Slide Show 0.4.nx",
"chars": 3976,
"preview": "GLOBAL OFY,SCY,FXT\n\nDISPLAY (1,1,0)\n\nON RASTER CALL FX\n\nNEXTPAGE:\nIF OFY=0 THEN OFY=16 ELSE OFY=0\nBG FILL 0,OFY TO 19,OF"
},
{
"path": "programs test/Sprites with Background 0.3.nx",
"chars": 4325,
"preview": "'** SPRITES WITH BACKGROUND 0.3 **\n\n'COPY MAP TO BACKGROUND\nBG COPY 0,0,20,16 TO 0,0\n\n'INIT SPRITE PALETTES AND SIZES\nSP"
},
{
"path": "programs test/Subs 1.nx",
"chars": 268,
"preview": "CALL HELLO\nCALL GREET(\"LOWRES\",3)\n\nNUM=10\nCALL INCR(NUM,10)\nPRINT NUM\n\nDIM ARR(10)\n\nARR(2)=5\nCALL INCR(ARR(2),5)\nPRINT A"
},
{
"path": "programs test/Subs 2.nx",
"chars": 179,
"preview": "DIM GLOBAL ARR(7)\n\nCALL RANDOM(ARR())\nCALL PRINTARR\n\n\nSUB RANDOM(X())\n FOR I=0 TO 7\n X(I)=INT(RND*100)\n NEXT I\nEND SUB\n"
},
{
"path": "programs test/drawing.nx",
"chars": 981,
"preview": "REM ** FILL DRAWING AREA WITH CHARACTERS\nI=8\nATTR (0,0,0,0,0)\nFOR CY=0 TO 8\n FOR CX=0 TO 19\n CELL CX,CY+3,I\n I=I+1\n NE"
},
{
"path": "programs test/gamepad.nx",
"chars": 8193,
"preview": "REM INIT SPRITES\nSPRITE.A 0,(6,,,,1)\nSPRITE.A 1,(1,,,,1)\n\nDIM X(1),Y(1)\nX(0)=60\nY(0)=64\nX(1)=100\nY(1)=64\n\nGAMEPAD 2\n\nDO\n"
},
{
"path": "programs test/hello world.nx",
"chars": 3228,
"preview": "PRINT \"HELLO WORLD\"\n\nGAMEPAD 1\n\nBG 1\nBG COPY 0,0,32,32 TO 0,0\n\nX=32\nY=32\nDO\n BGX=BGX+1\n SCROLL 1,BGX,0\n IF UP(0) THEN"
},
{
"path": "programs test/sprite collision.nx",
"chars": 3045,
"preview": "PALETTE 1,0,4,8,16\n\nREM INIT SPRITES\nSPRITE.A 0,(0,1,0,,3)\nSPRITE.A 1,(1,0,1,,3)\nSPRITE.A 2,(1,0,0,,0)\nSPRITE.A 3,(1,0,0"
},
{
"path": "programs test/touch.nx",
"chars": 8090,
"preview": "REM INIT SPRITE\nFOR I=0 TO 15\n SPRITE I,-32,-32,130\n SPRITE.A I,(INT(I/2),,,,1)\nNEXT I\n\nDO\n FOR I=15 TO 1 STEP -1\n "
},
{
"path": "scripts/export_characters.py",
"chars": 601,
"preview": "import sys\nfrom PIL import Image\n\nif len(sys.argv) >= 2:\n\tfilename = sys.argv[1]\nelse:\n\tfilename = \"../assets/characters"
},
{
"path": "scripts/export_characters_hex.py",
"chars": 568,
"preview": "import sys\nfrom PIL import Image\n\nif len(sys.argv) >= 2:\n\tfilename = sys.argv[1]\nelse:\n\tfilename = \"../assets/characters"
},
{
"path": "sdl/config.h",
"chars": 1161,
"preview": "//\n// Copyright 2018 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "sdl/dev_menu.c",
"chars": 12807,
"preview": "//\n// Copyright 2017-2018 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "sdl/dev_menu.h",
"chars": 1743,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "sdl/dev_menu_data.h",
"chars": 30943,
"preview": "//\n// Copyright 2017 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "sdl/main.c",
"chars": 26530,
"preview": "//\n// Copyright 2017-2020 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "sdl/main.h",
"chars": 1607,
"preview": "//\n// Copyright 2017-2020 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "sdl/runner.c",
"chars": 7762,
"preview": "//\n// Copyright 2017-2018 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "sdl/runner.h",
"chars": 1344,
"preview": "//\n// Copyright 2017-2018 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "sdl/screenshot.c",
"chars": 2522,
"preview": "//\n// Copyright 2018 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "sdl/screenshot.h",
"chars": 1128,
"preview": "//\n// Copyright 2018 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "sdl/sdl_include.h",
"chars": 972,
"preview": "//\n// Copyright 2018 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "sdl/settings.c",
"chars": 8045,
"preview": "//\n// Copyright 2017-2020 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "sdl/settings.h",
"chars": 1643,
"preview": "//\n// Copyright 2017-2020 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty"
},
{
"path": "sdl/stb_image_write.h",
"chars": 64584,
"preview": "/* stb_image_write - v1.09 - public domain - http://nothings.org/stb/stb_image_write.h\n writes out PNG/BMP/TGA/JPEG/HD"
},
{
"path": "sdl/system_paths.c",
"chars": 1975,
"preview": "//\n// Copyright 2018 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "sdl/system_paths.h",
"chars": 1248,
"preview": "//\n// Copyright 2018 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "sdl/utils.c",
"chars": 1787,
"preview": "//\n// Copyright 2018 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
},
{
"path": "sdl/utils.h",
"chars": 1126,
"preview": "//\n// Copyright 2018 Timo Kloss\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In "
}
]
// ... and 12 more files (download for full content)
About this extraction
This page contains the full source code of the timoinutilis/lowres-nx GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 192 files (1.7 MB), approximately 545.8k tokens, and a symbol index with 1534 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.