1
0
mirror of https://github.com/KarolS/millfork.git synced 2026-04-22 00:17:03 +00:00

Library improvements

This commit is contained in:
Karol Stasiak
2018-12-17 17:18:29 +01:00
parent 7616c246ee
commit 585407e9bb
38 changed files with 554 additions and 70 deletions
+4 -6
View File
@@ -2,9 +2,11 @@
## Cross-platform examples
* [Hello world](hello_world/hello_world.mfk) (C64/C16/PET/VIC-20/Atari/Apple II/BBC Micro) simple text output
* [Hello world](hello_world/hello_world.mfk) (C64/C16/PET/VIC-20/Atari/Apple II/BBC Micro/PC-88) simple text output
* [Text encodings](c64/text_encodings.mfk) (C64/ZX Spectrum) examples of text encoding features
* [Text encodings](c64/text_encodings.mfk) (C64/ZX Spectrum) examples of text encoding features
* [Bell](apple2/bell.mfk) (Apple II/ZX Spectrum) a program that goes \*ding!\*
## Commodore 64 examples
@@ -30,10 +32,6 @@
* [MMC4 example](nes/nestest_mmc4.mfk) the same thing as above, but uses a MMC4 mapper just to test bankswitching
## Apple II examples
* [Bell](apple2/bell.mfk) a program that goes \*ding!\*
## Atari 2600 examples
* [Colors](vcs/colors.mfk) simple static rasterbars
+14 -2
View File
@@ -5,9 +5,21 @@ import stdio
array hello_world = "hello world"
void main(){
void main() {
#if CBM_64 || CBM_264
set_bg_color(green)
#endif
#if CBM_64 || CBM_264 || ZX_SPECTRUM
set_border(red)
#endif
putstr(hello_world, hello_world.length)
putchar(13)
new_line()
putstrz("hello world again"z)
#if not(CPM)
while(true){}
#endif
}
+6 -7
View File
@@ -1,6 +1,8 @@
// Based upon the example code from NES 101 tutorial by Michael Martin
// compile with -t nes_small
import nes_joy1_default
void main() {
init_graphics()
init_input()
@@ -99,17 +101,14 @@ void update_sprite() {
}
void react_to_input() {
strobe_joypad()
if read_joypad1() & 1 != 0 { // A button
read_joy()
if input_a != 0 { // A button
reverse_dx()
}
read_joypad1() // B button
read_joypad1() // Select button
read_joypad1() // Start button
if read_joypad1() & 1 != 0 { // Up button
if input_dy < 0 { // Up button
if oam_buffer[0] > 7 { oam_buffer[0] -= 1}
}
if read_joypad1() & 1 != 0 { // Down button
if input_dy > 0 { // Down button
if oam_buffer[0] < 223 { oam_buffer[0] += 1}
}
}