D
try drawing both at once instead of putting a "Screen.flip()" between them.I need a bit of help with stuff that's been frustrating me.
Take a look at this code:
code
After the for loop is done, the place where the number is displayed looks like a rectangle with two missing pixels because all the numbers are overlapping, and the words "angry" are gone. Why is that?
for i = 0, 10 do
Screen.waitVblankStart()
Screen.refresh()
Screen.clear(TOP_SCREEN)
Screen.clear(BOTTOM_SCREEN)
Screen.debugPrint(0, 0, ("angry"), Color.new(255,255,255), TOP_SCREEN)
Screen.debugPrint(0, 64, tostring(math.random(1,5)), Color.new(255,255,255), TOP_SCREEN)
Screen.flip()
end
Okay, that works.
What would I need to do if I wanted to display something, have the user be able to see it, and then display another thing on the screen while still being able to see the first thing?
show_number = false
-- do something to set this to true
for i = 0, 10 do
Screen.waitVblankStart()
Screen.refresh()
Screen.clear(TOP_SCREEN)
Screen.clear(BOTTOM_SCREEN)
Screen.debugPrint(0, 0, ("angry"), Color.new(255,255,255), TOP_SCREEN)
if show_number then
Screen.debugPrint(0, 64, tostring(math.random(1,5)), Color.new(255,255,255), TOP_SCREEN)
end
Screen.flip()
end
- Controls.enableGyro() - Enables Gyroscope.
- Controls.disableGyro() - Disables Gyroscope.
- Controls.enableAccel() - Enables Accelerometer.
- Controls.disableAccel() - Disables Accelerometer.
- Controls.readGyro() - Reads Gyroscope state.
- Controls.readAccel() - Reads Accelerometer state.
- Controls.enableScreen() - Power on a screen.
- Controls.disableScreen() - Power off a screen.
- Controls.shellStatus() - Gets shell status.
- Graphics.getPixel() - Gets a pixel for a GPU texture.
- System.setCpuSpeed() - Sets CPU frequency.
- System.getCpuSpeed() - Gets CPU frequency.
- Camera.init() - Inits console camera.
- Camera.getOutput() - Blends on screen camera output.
- Camera.takePhoto() - Takes a photo with the camera.
- Camera.takeImage() - Takes an image with the camera.
- Camera.term() - Terminates camera.
- Mic.start() - Starts recording with microphone.
- Mic.isRecording() - Checks if microphone is still recording.
- Mic.stop() - Stops recording and save the result.
- Mic.pause() - Pauses record.
- Mic.resume() - Resumes record.
- JPGV.drawFast() - Draws a JPGV video in fast mode (only fullscreen videos).
- Sound.getService() - Gets used service for audio system.
New features and improvements:
- Now sockets are set in non-blocking mode by default.
- Now Screen functions can be used to edit GPU textures (like before for normal Images).
- Now System.checkBuild() will return different codes for NH1 and NH2.
- Updated Lua build from 5.3.0 to 5.3.1.
- Speedup for I/O functions.
- Now if index.lua file is not found, interpreter will give an error instead of a system crash.
- Introduced Audio-Device system to manage Audio on the system.
- Now if csnd:SND is not available, dsp::DSP will be used for a basic audio support.
- Now a faster version (unsafe) of the interpreter will be provided in official builds without error handler.
- Now third argument for System.takeScreenshot() and Screen.saveImage() is facoltative (Default = false).
- Added possibility to change interpolation mode for sounds (Default = LINEAR_INTERP).
Deprecated functions:
- BMPV module deprecated ( Useless video format ).
- Sound.register() deprecated ( Use Mic module ).
Syntax changes:
- Now System.getKernel() and System.getFirmware() will return MAJOR_VERSION, MINOR_VERSION and REVISION.
- Now Sound.play() will not take channels arguments anymore and will take as third (facoltative) argument an interpolation mode.
- Now JPGV.start() will not take channels arguments anymore.
Bugfixes:
- System.extractZIP() now closes ZIP files correctly, allowing to delete them for example.
- Now an interpreter crash during Sockets usage will not corrupt Networking features.
- Now System.getKernel() and System.getFirmware are not swapped anymore.
- Now Kernel privilege escalation for 4.5-9.2 users is done also on Ninjhax 2.x.
- Now Graphics.fillCircle() accepts correct arguments number.
- Now Screen.drawPartialImage() blends correctly on RIGHT_EYE.
- Now exiting from interpreter will not crash the system anymore on NH2.5.
- Now Sound module functions work correctly on NH2.5.
- Now System.getDate() will not cause freezes if console clock was never set.
- Now System.addNotification() works also on NH2.
- Now enabling 3D with 3D slider off will not cause system crashes anymore.
Samples:
- Replaced BMPV sample with a JPGV sample.
- Added Camera sample for camera usage.
- Updated Mic sample with new Mic module.
- Some modules (Advanced Sound Module, Camera Module, Network Module) are not accessible together on NH2.5. When you write your homebrews take a look to Descriptors folder to use one of these services.
- Mic module could crash on initialization in some circumstances on N3DS.
- Basic Sound Module is unfinished due to lack of a good library for dsp::DSP service support. Advanced Sound Module is highly recommended.
- System.addNotification will require a target title to be used on NH 2.x.
- Polyphase interpolation mode is available ONLY on Basic Sound Module.
bad argument #2 to 'open' (number expected, got nil)Code:fileStream = (io.open("/Options.cfg",FREAD))
does nothing at all. you can use it regardless of system, and it will only do something on New 3DS [XL].Does setting the CPU to the n3ds speed on an o3ds do anything? If it does do something, does it do anything harmful
If so, is there a way to check which type of 3ds the user is using?
model = System.getModel()
With your DSP work, have you heard any noticeable difference with different interpolation modes?
c:/Users/Chris/Desktop/sadsd/lpp-3ds-master/source/luaMic.cpp:142:12: error: redefinition of 'int lua_stoprec_CSND(lua_State*)'
static int lua_stoprec_CSND(lua_State *L)
^
c:/Users/Chris/Desktop/sadsd/lpp-3ds-master/source/luaMic.cpp:105:12: note: 'int lua_stoprec_CSND(lua_State*)' previously defined here
static int lua_stoprec_CSND(lua_State *L)
^
c:/Users/Chris/Desktop/sadsd/lpp-3ds-master/source/luaMic.cpp: At global scope:
c:/Users/Chris/Desktop/sadsd/lpp-3ds-master/source/luaMic.cpp:211:15: error: 'lua_stoprec_DSP' was not declared in this scope
{"stop", lua_stoprec_DSP},
^
make[1]: *** [luaMic.o] Error 1
make: *** [build] Error 2
When I try to compile it gives me the following error.
Code:c:/Users/Chris/Desktop/sadsd/lpp-3ds-master/source/luaMic.cpp:142:12: error: redefinition of 'int lua_stoprec_CSND(lua_State*)' static int lua_stoprec_CSND(lua_State *L) ^ c:/Users/Chris/Desktop/sadsd/lpp-3ds-master/source/luaMic.cpp:105:12: note: 'int lua_stoprec_CSND(lua_State*)' previously defined here static int lua_stoprec_CSND(lua_State *L) ^ c:/Users/Chris/Desktop/sadsd/lpp-3ds-master/source/luaMic.cpp: At global scope: c:/Users/Chris/Desktop/sadsd/lpp-3ds-master/source/luaMic.cpp:211:15: error: 'lua_stoprec_DSP' was not declared in this scope {"stop", lua_stoprec_DSP}, ^ make[1]: *** [luaMic.o] Error 1 make: *** [build] Error 2
How do I make it so I can use network features and sound features? When I put in the sound xml, I can't use network features anymore.
I tried to combine the network and sound xml files to make this:
Code:<services autodetect="false"> <request priority="1">csnd:SND</request> <request priority="2">soc:U</request> </services>
But that didn't work.
Using the networking_features.xml gives me the ability to use sound, but not network features.
Code:<services autodetect="false"> <request priority="1">soc:U</request> </services>