├── .gitignore ├── README.md ├── SConstruct ├── common └── stm32f429 │ ├── AseAccessMode.h │ ├── AseCommands.h │ ├── Error.h │ ├── FpgaProgrammer.h │ ├── LoadSpriteDef.h │ └── MoveSpriteDef.h ├── main ├── stm32f429 │ ├── manic_knights │ │ ├── .cproject │ │ ├── .gitignore │ │ ├── .project │ │ ├── Application.h │ │ ├── Buttons.h │ │ ├── FpgaBusyMonitor.h │ │ ├── Introduction.cpp │ │ ├── Introduction.h │ │ ├── ManicKnights.cpp │ │ ├── ManicKnights.h │ │ ├── Panel.h │ │ ├── SConscript │ │ ├── World.cpp │ │ ├── bitFile.asm │ │ ├── system │ │ │ ├── LibraryHacks.cpp │ │ │ └── f429 │ │ │ │ ├── Linker.ld │ │ │ │ ├── Startup.asm │ │ │ │ └── System.c │ │ ├── ux │ │ │ ├── .gitignore │ │ │ ├── convert.pl │ │ │ ├── spiflash │ │ │ │ ├── 000_tile42.bin │ │ │ │ ├── 001_tile17.bin │ │ │ │ ├── 002_tile25.bin │ │ │ │ ├── 003_tile8.bin │ │ │ │ ├── 004_tile93.bin │ │ │ │ ├── 005_tile73.bin │ │ │ │ ├── 006_tile10.bin │ │ │ │ ├── 007_tile85.bin │ │ │ │ ├── 008_tile92.bin │ │ │ │ ├── 009_tile75.bin │ │ │ │ ├── 010_tile97.bin │ │ │ │ ├── 011_tile105.bin │ │ │ │ ├── 012_tile74.bin │ │ │ │ ├── 013_tile83.bin │ │ │ │ ├── 014_tile94.bin │ │ │ │ ├── 015_tile99.bin │ │ │ │ ├── 016_tile107.bin │ │ │ │ ├── 017_tile47.bin │ │ │ │ ├── 018_tile76.bin │ │ │ │ ├── 019_tile96.bin │ │ │ │ ├── 020_tile104.bin │ │ │ │ ├── 021_tile91.bin │ │ │ │ ├── 022_tile98.bin │ │ │ │ ├── 023_tile106.bin │ │ │ │ ├── 024_tile57.bin │ │ │ │ ├── 025_tile66.bin │ │ │ │ ├── 026_tile41.bin │ │ │ │ ├── 027_tile55.bin │ │ │ │ ├── 028_tile95.bin │ │ │ │ ├── 029_tile33.bin │ │ │ │ ├── 030_tile58.bin │ │ │ │ ├── 031_tile109.bin │ │ │ │ ├── 032_tile82.bin │ │ │ │ ├── 033_tile79.bin │ │ │ │ ├── 034_tile77.bin │ │ │ │ ├── 035_tile54.bin │ │ │ │ ├── 036_tile34.bin │ │ │ │ ├── 037_tile78.bin │ │ │ │ ├── 038_tile59.bin │ │ │ │ ├── 039_tile88.bin │ │ │ │ ├── 040_tile89.bin │ │ │ │ ├── 041_tile90.bin │ │ │ │ ├── 042_tile81.bin │ │ │ │ ├── 043_tile84.bin │ │ │ │ ├── 044_tile101.bin │ │ │ │ ├── 045_tile72.bin │ │ │ │ ├── 046_tile80.bin │ │ │ │ ├── 047_tile18.bin │ │ │ │ ├── 048_tile9.bin │ │ │ │ ├── 049_tile100.bin │ │ │ │ ├── 050_tile108.bin │ │ │ │ ├── 051_tile87.bin │ │ │ │ ├── 052_tile27.bin │ │ │ │ ├── 053_tile11.bin │ │ │ │ ├── 054_tile86.bin │ │ │ │ ├── 055_tile102.bin │ │ │ │ ├── 056_tile110.bin │ │ │ │ ├── 057_tile118.bin │ │ │ │ ├── 058_tile19.bin │ │ │ │ ├── 100_torch_1.bin │ │ │ │ ├── 101_torch_2.bin │ │ │ │ ├── 102_torch_3.bin │ │ │ │ ├── 103_torch_4.bin │ │ │ │ ├── 104_enemy1_walk1_l.bin │ │ │ │ ├── 105_enemy1_walk2_l.bin │ │ │ │ ├── 106_enemy1_walk3_l.bin │ │ │ │ ├── 107_enemy1_walk4_l.bin │ │ │ │ ├── 108_enemy1_walk5_l.bin │ │ │ │ ├── 109_enemy1_walk6_l.bin │ │ │ │ ├── 110_enemy1_walk7_l.bin │ │ │ │ ├── 111_enemy1_walk8_l.bin │ │ │ │ ├── 112_enemy1_walk9_l.bin │ │ │ │ ├── 113_enemy1_walk10_l.bin │ │ │ │ ├── 114_enemy1_walk11_l.bin │ │ │ │ ├── 115_enemy1_walk12_l.bin │ │ │ │ ├── 116_enemy1_walk1_r.bin │ │ │ │ ├── 117_enemy1_walk2_r.bin │ │ │ │ ├── 118_enemy1_walk3_r.bin │ │ │ │ ├── 119_enemy1_walk4_r.bin │ │ │ │ ├── 120_enemy1_walk5_r.bin │ │ │ │ ├── 121_enemy1_walk6_r.bin │ │ │ │ ├── 122_enemy1_walk7_r.bin │ │ │ │ ├── 123_enemy1_walk8_r.bin │ │ │ │ ├── 124_enemy1_walk9_r.bin │ │ │ │ ├── 125_enemy1_walk10_r.bin │ │ │ │ ├── 126_enemy1_walk11_r.bin │ │ │ │ ├── 127_enemy1_walk12_r.bin │ │ │ │ ├── 128_enemy2_walk1_r.bin │ │ │ │ ├── 129_enemy2_walk2_r.bin │ │ │ │ ├── 130_enemy2_walk3_r.bin │ │ │ │ ├── 131_enemy2_walk4_r.bin │ │ │ │ ├── 132_enemy2_walk5_r.bin │ │ │ │ ├── 133_enemy2_walk6_r.bin │ │ │ │ ├── 134_enemy2_walk7_r.bin │ │ │ │ ├── 135_enemy2_walk8_r.bin │ │ │ │ ├── 136_enemy2_walk9_r.bin │ │ │ │ ├── 137_enemy2_walk10_r.bin │ │ │ │ ├── 138_enemy2_walk11_r.bin │ │ │ │ ├── 139_enemy2_walk12_r.bin │ │ │ │ ├── 140_enemy2_walk1_l.bin │ │ │ │ ├── 141_enemy2_walk2_l.bin │ │ │ │ ├── 142_enemy2_walk3_l.bin │ │ │ │ ├── 143_enemy2_walk4_l.bin │ │ │ │ ├── 144_enemy2_walk5_l.bin │ │ │ │ ├── 145_enemy2_walk6_l.bin │ │ │ │ ├── 146_enemy2_walk7_l.bin │ │ │ │ ├── 147_enemy2_walk8_l.bin │ │ │ │ ├── 148_enemy2_walk9_l.bin │ │ │ │ ├── 149_enemy2_walk10_l.bin │ │ │ │ ├── 150_enemy2_walk11_l.bin │ │ │ │ ├── 151_enemy2_walk12_l.bin │ │ │ │ ├── 152_moving_platform.bin │ │ │ │ ├── 153_saw_1.bin │ │ │ │ ├── 154_saw_2.bin │ │ │ │ ├── 155_saw_3.bin │ │ │ │ ├── 156_saw_4.bin │ │ │ │ ├── 157_saw_5.bin │ │ │ │ ├── 158_saw_6.bin │ │ │ │ └── index.txt │ │ │ ├── tiles │ │ │ │ ├── .gitignore │ │ │ │ ├── cropper │ │ │ │ │ ├── .gitignore │ │ │ │ │ ├── App.config │ │ │ │ │ ├── Program.cs │ │ │ │ │ ├── Properties │ │ │ │ │ │ └── AssemblyInfo.cs │ │ │ │ │ ├── TmxReader.cs │ │ │ │ │ ├── TsxReader.cs │ │ │ │ │ ├── XmlUtil.cs │ │ │ │ │ ├── cropper.csproj │ │ │ │ │ └── cropper.sln │ │ │ │ ├── level1.tmx │ │ │ │ └── tileset.tsx │ │ │ └── worldmap.tif │ │ └── world │ │ │ ├── Actor.cpp │ │ │ ├── Actor.h │ │ │ ├── AnimationType.h │ │ │ ├── Background.cpp │ │ │ ├── Background.h │ │ │ ├── BackgroundSprites.cpp │ │ │ ├── BackgroundSprites.h │ │ │ ├── EasingMode.h │ │ │ ├── EasingType.h │ │ │ ├── Level1.cpp │ │ │ ├── Level1.h │ │ │ ├── Level1_Tiles.cpp │ │ │ ├── MovingPath.cpp │ │ │ ├── MovingPath.h │ │ │ ├── PathBase.cpp │ │ │ ├── PathBase.h │ │ │ ├── PathSprites.cpp │ │ │ ├── PathSprites.h │ │ │ ├── StaticPath.cpp │ │ │ ├── StaticPath.h │ │ │ ├── World.h │ │ │ └── defs │ │ │ ├── ActorDef.h │ │ │ ├── LevelDef.h │ │ │ ├── PathDef.h │ │ │ ├── SpriteDefs.cpp │ │ │ └── SpriteDefs.h │ └── sprites_demo │ │ ├── .cproject │ │ ├── .gitignore │ │ ├── .project │ │ ├── SConscript │ │ ├── bitFile.asm │ │ ├── sprites_demo.cpp │ │ ├── system │ │ ├── LibraryHacks.cpp │ │ └── f429 │ │ │ ├── Linker.ld │ │ │ ├── Startup.asm │ │ │ └── System.c │ │ └── ux │ │ ├── andysworkshop.png │ │ ├── background.png │ │ ├── convert.sh │ │ ├── left1.png │ │ ├── left2.png │ │ ├── left3.png │ │ ├── right1.png │ │ ├── right2.png │ │ ├── right3.png │ │ └── spiflash │ │ ├── andysworkshop.bin │ │ ├── background.bin │ │ ├── index.txt │ │ ├── left1.bin │ │ ├── left2.bin │ │ ├── left3.bin │ │ ├── right1.bin │ │ ├── right2.bin │ │ └── right3.bin └── xc3s50 │ ├── .gitignore │ ├── SConscript │ ├── clock_generator.xaw │ ├── command_fifo.xco │ ├── constants.vhdl │ ├── coregen.cgp │ ├── frame_counter.vhdl │ ├── frame_writer.vhdl │ ├── functions.vhdl │ ├── lcd_arbiter.vhdl │ ├── lcd_sender.vhdl │ ├── main.prj │ ├── main.ucf │ ├── main.ut │ ├── main.vhdl │ ├── main.xst │ ├── maplog │ ├── mcu_interface.vhdl │ ├── nextx_adder.xco │ ├── parlog │ ├── reset_conditioner.vhdl │ ├── simulate │ ├── sprite_memory.xco │ ├── sprite_writer.vhdl │ ├── sram_addr_adder.xco │ ├── tests │ ├── frame_counter.wcfg │ ├── frame_counter_tb.vhdl │ ├── frame_writer.wcfg │ ├── frame_writer_tb.vhdl │ ├── lcd_sender.wcfg │ ├── lcd_sender_tb.vhdl │ ├── main.wcfg │ ├── main_tb.vhdl │ ├── mcu_interface.wcfg │ ├── mcu_interface_tb.prj │ ├── mcu_interface_tb.vhdl │ ├── sprite_writer.wcfg │ ├── sprite_writer_tb.prj │ └── sprite_writer_tb.vhdl │ ├── timing.xlsx │ ├── twrlog │ └── xstlog ├── tests ├── fpga_blink │ ├── stm32f429 │ │ ├── .cproject │ │ ├── .gitignore │ │ ├── .project │ │ ├── SConscript │ │ ├── bitFile.asm │ │ ├── fpga_blink.cpp │ │ └── system │ │ │ ├── LibraryHacks.cpp │ │ │ └── f429 │ │ │ ├── Linker.ld │ │ │ ├── Startup.asm │ │ │ └── System.c │ └── xc3s50 │ │ ├── .gitignore │ │ ├── SConscript │ │ ├── blink.prj │ │ ├── blink.ucf │ │ ├── blink.ut │ │ ├── blink.vhdl │ │ └── blink.xst ├── fpga_sram │ ├── stm32f429 │ │ ├── .cproject │ │ ├── .gitignore │ │ ├── .project │ │ ├── SConscript │ │ ├── bitFile.asm │ │ ├── fpga_sram.cpp │ │ └── system │ │ │ ├── LibraryHacks.cpp │ │ │ └── f429 │ │ │ ├── Linker.ld │ │ │ ├── Startup.asm │ │ │ └── System.c │ └── xc3s50 │ │ ├── .gitignore │ │ ├── SConscript │ │ ├── clock_generator.xaw │ │ ├── fpga_sram.prj │ │ ├── fpga_sram.ucf │ │ ├── fpga_sram.ut │ │ ├── fpga_sram.vhdl │ │ ├── fpga_sram.xst │ │ └── tests │ │ ├── fpga_sram.wcfg │ │ ├── fpga_sram_tb.vhdl │ │ └── sram_sim.vhdl ├── lcd │ ├── .cproject │ ├── .gitignore │ ├── .project │ ├── SConscript │ ├── bitFile.asm │ ├── lcd.cpp │ └── system │ │ ├── LibraryHacks.cpp │ │ └── f429 │ │ ├── Linker.ld │ │ ├── Startup.asm │ │ └── System.c ├── mcu_blink │ ├── .cproject │ ├── .gitignore │ ├── .project │ ├── SConscript │ ├── blink.cpp │ └── system │ │ ├── LibraryHacks.cpp │ │ └── f429 │ │ ├── Linker.ld │ │ ├── Startup.asm │ │ └── System.c ├── mcu_eeprom │ ├── .cproject │ ├── .gitignore │ ├── .project │ ├── SConscript │ ├── eeprom.cpp │ └── system │ │ ├── LibraryHacks.cpp │ │ └── f429 │ │ ├── Linker.ld │ │ ├── Startup.asm │ │ └── System.c └── mcu_sdio │ ├── .cproject │ ├── .gitignore │ ├── .project │ ├── SConscript │ ├── sdio.cpp │ └── system │ ├── LibraryHacks.cpp │ └── f429 │ ├── Linker.ld │ ├── Startup.asm │ └── System.c └── utilities └── flash_programmer ├── stm32f429 ├── .cproject ├── .gitignore ├── .project ├── SConscript ├── bitFile.asm ├── flash_programmer.cpp └── system │ ├── LibraryHacks.cpp │ └── f429 │ ├── Linker.ld │ ├── Startup.asm │ └── System.c └── xc3s50 ├── .gitignore ├── SConscript ├── clock_generator.xaw ├── constants.vhdl ├── flash_programmer.prj ├── flash_programmer.ucf ├── flash_programmer.ut ├── flash_programmer.vhdl ├── flash_programmer.xst ├── functions.vhdl ├── maplog ├── mcu_interface.vhdl ├── parlog ├── reset_conditioner.vhdl ├── simulate ├── tests ├── flash_programmer.wcfg ├── flash_programmer_tb.vhdl ├── mcu_interface_tb.prj ├── mcu_interface_tb.vhdl └── mcu_interface_tb.wcfg ├── twrlog └── xstlog /.gitignore: -------------------------------------------------------------------------------- 1 | .sconsign.dblite 2 | -------------------------------------------------------------------------------- /common/stm32f429/Error.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 3 | * Copyright (c) 2014 Andy Brown 4 | * Please see website for licensing terms. 5 | */ 6 | 7 | 8 | #pragma once 9 | 10 | 11 | namespace Error { 12 | 13 | /** 14 | * This helper function will light up the blue LED on PD11, flashing a number 15 | * of times to indicate an error code 16 | */ 17 | 18 | static void display(uint8_t code) { 19 | 20 | using namespace stm32plus; 21 | 22 | uint8_t i; 23 | 24 | GpioD > pd; 25 | 26 | for(;;) { 27 | 28 | // flash the blue led quickly 'code' number of times 29 | 30 | for(i=0;i 4 | * Please see website for licensing terms. 5 | */ 6 | 7 | #pragma once 8 | 9 | 10 | /** 11 | * Definition for a sprite to be loaded using CMD_LOAD 12 | */ 13 | 14 | struct LoadSpriteDef { 15 | uint16_t SpriteNumber; // sprite number (0..511) 16 | uint32_t SramAddress; // pixel address on the screen (y * 360) + x 17 | uint32_t FlashAddress; // flash address of the graphic 18 | uint16_t PixelWidth; // width of this sprite in pixels 19 | uint32_t NumPixels; // total number of pixels 20 | uint16_t RepeatX; // number of times to repeat on X axis (minimum = 1) 21 | uint16_t RepeatY; // number of times to repeat on Y axis (minimum = 1) 22 | uint8_t Visible; // 1 if visible, 0 if hidden 23 | uint16_t FirstX; // first visible X column (or zero if fully on screen) 24 | uint16_t LastX; // last visible X column (or 359 if fully on screen) 25 | uint16_t FirstY; // first visible Y column (or zero if fully on screen) 26 | uint16_t LastY; // last visible Y column (or 639 if fully on screen) 27 | }; 28 | -------------------------------------------------------------------------------- /common/stm32f429/MoveSpriteDef.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 3 | * Copyright (c) 2014 Andy Brown 4 | * Please see website for licensing terms. 5 | */ 6 | 7 | #pragma once 8 | 9 | 10 | /** 11 | * Definition for a sprite to be moved using CMD_MOVE_PARTIAL 12 | */ 13 | 14 | struct MoveSpriteDef { 15 | uint16_t SpriteNumber; // sprite number (0..511) 16 | uint32_t SramAddress; // pixel address on the screen (y * 360) + x 17 | uint16_t FirstX; // first visible X column (or zero if fully on screen) 18 | uint16_t LastX; // last visible X column (or 359 if fully on screen) 19 | uint16_t FirstY; // first visible Y column (or zero if fully on screen) 20 | uint16_t LastY; // last visible Y column (or 639 if fully on screen) 21 | }; 22 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/.gitignore: -------------------------------------------------------------------------------- 1 | doc/ 2 | *~ 3 | *.lock 4 | *.DS_Store 5 | *.swp 6 | *.out 7 | *.class 8 | #OS junk files 9 | [Tt]humbs.db 10 | 11 | *.a 12 | *.o 13 | 14 | #Visual Studio files 15 | 16 | *.[Oo]bj 17 | *.user 18 | *.aps 19 | *.pch 20 | *.vspscc 21 | *.vssscc 22 | *_i.c 23 | *_p.c 24 | *.ncb 25 | *.suo 26 | *.tlb 27 | *.tlh 28 | *.bak 29 | *.[Cc]ache 30 | *.ilk 31 | *.log 32 | *.lib 33 | *.sbr 34 | *.sdf 35 | *.opensdf 36 | ipch/ 37 | obj/ 38 | [Bb]in 39 | [Dd]ebug*/ 40 | [Rr]elease*/ 41 | Ankh.NoLoad 42 | 43 | #Tooling 44 | _ReSharper*/ 45 | *.resharper 46 | [Tt]est[Rr]esult* 47 | 48 | #Project files 49 | [Bb]uild/ 50 | 51 | #Subversion files 52 | .svn 53 | 54 | # Office Temp Files 55 | ~$* 56 | 57 | # eclipse local settings 58 | 59 | .settings/ 60 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | ase-manic_knights 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 10 | clean,full,incremental, 11 | 12 | 13 | 14 | 15 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 16 | full,incremental, 17 | 18 | 19 | 20 | 21 | 22 | org.eclipse.cdt.core.cnature 23 | org.eclipse.cdt.core.ccnature 24 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 25 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 26 | 27 | 28 | 29 | common 30 | 2 31 | PARENT-3-PROJECT_LOC/common/stm32f429 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/Application.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 3 | * Copyright (c) 2014 Andy Brown 4 | * Please see website for licensing terms. 5 | */ 6 | 7 | #pragma once 8 | 9 | // stm32plus includes 10 | 11 | #include "config/stm32plus.h" 12 | #include "config/timing.h" 13 | #include "config/display/tft.h" 14 | #include "config/fx.h" 15 | #include "config/smartptr.h" 16 | 17 | using namespace stm32plus; 18 | using namespace stm32plus::fx; 19 | using namespace stm32plus::display; 20 | 21 | // common ASE includes 22 | 23 | #include "Error.h" 24 | #include "FpgaProgrammer.h" 25 | #include "AseAccessMode.h" 26 | 27 | // local application includes 28 | 29 | #include "Panel.h" 30 | #include "Buttons.h" 31 | #include "world/EasingType.h" 32 | #include "world/AnimationType.h" 33 | #include "world/EasingMode.h" 34 | #include "world/defs/SpriteDefs.h" 35 | #include "world/BackgroundSprites.h" 36 | #include "world/PathSprites.h" 37 | #include "world/defs/PathDef.h" 38 | #include "world/defs/ActorDef.h" 39 | #include "world/defs/LevelDef.h" 40 | #include "world/defs/ActorDef.h" 41 | #include "world/Background.h" 42 | #include "world/PathBase.h" 43 | #include "world/MovingPath.h" 44 | #include "world/StaticPath.h" 45 | #include "world/Actor.h" 46 | #include "world/Level1.h" 47 | #include "world/World.h" 48 | #include "FpgaBusyMonitor.h" 49 | #include "Introduction.h" 50 | #include "ManicKnights.h" 51 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/Buttons.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 3 | * Copyright (c) 2014 Andy Brown 4 | * Please see website for licensing terms. 5 | */ 6 | 7 | #pragma once 8 | 9 | 10 | /* 11 | * Simple synchronous button sampler not using interrupts 12 | */ 13 | 14 | class Buttons { 15 | 16 | protected: 17 | enum { 18 | LEFT_PIN = 12, 19 | RIGHT_PIN = 13, 20 | UP_PIN = 14, 21 | DOWN_PIN = 15, 22 | 23 | LEFT_INDEX = 0, 24 | RIGHT_INDEX = 1, 25 | UP_INDEX = 2, 26 | DOWN_INDEX =3 27 | }; 28 | 29 | GpioPinRef _pins[4]; 30 | 31 | public: 32 | Buttons(); 33 | 34 | bool isLeftPressed() const; 35 | bool isRightPressed() const; 36 | bool isUpPressed() const; 37 | bool isDownPressed() const; 38 | }; 39 | 40 | 41 | /* 42 | * Constructor 43 | */ 44 | 45 | inline Buttons::Buttons() { 46 | 47 | // the 4-way buttons are on port B 48 | 49 | GpioB< 50 | DigitalInputFeature 51 | > pb; 52 | 53 | _pins[LEFT_INDEX]=pb[LEFT_PIN]; 54 | _pins[RIGHT_INDEX]=pb[RIGHT_PIN]; 55 | _pins[UP_INDEX]=pb[UP_PIN]; 56 | _pins[DOWN_INDEX]=pb[DOWN_PIN]; 57 | } 58 | 59 | 60 | /* 61 | * Check if left is pressed 62 | */ 63 | 64 | inline bool Buttons::isLeftPressed() const { 65 | return _pins[LEFT_INDEX].read(); 66 | } 67 | 68 | 69 | /* 70 | * Check if right is pressed 71 | */ 72 | 73 | inline bool Buttons::isRightPressed() const { 74 | return _pins[RIGHT_INDEX].read(); 75 | } 76 | 77 | 78 | /* 79 | * Check if up is pressed 80 | */ 81 | 82 | inline bool Buttons::isUpPressed() const { 83 | return _pins[UP_INDEX].read(); 84 | } 85 | 86 | 87 | /* 88 | * Check if down is pressed 89 | */ 90 | 91 | inline bool Buttons::isDownPressed() const { 92 | return _pins[DOWN_INDEX].read(); 93 | } 94 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/FpgaBusyMonitor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 3 | * Copyright (c) 2014 Andy Brown 4 | * Please see website for licensing terms. 5 | */ 6 | 7 | #pragma once 8 | 9 | 10 | /* 11 | * This class allows monitoring the state of the BUSY pin (PC14). BUSY goes high when the FPGA is accessing 12 | * the sprite definitions and goes back to low when the FPGA has finished. A transition from high 13 | * to low is the signal that the game engine should start its update logic. 14 | */ 15 | 16 | class FpgaBusyMonitor { 17 | 18 | protected: 19 | enum { BUSY_PIN = 14 }; 20 | 21 | GpioPinRef _busyPin; 22 | 23 | public: 24 | FpgaBusyMonitor(); 25 | 26 | bool isBusy() const; 27 | }; 28 | 29 | 30 | /* 31 | * Constructor 32 | */ 33 | 34 | inline FpgaBusyMonitor::FpgaBusyMonitor() { 35 | 36 | // get a pin reference 37 | 38 | GpioC> pc; 39 | _busyPin=pc[BUSY_PIN]; 40 | } 41 | 42 | 43 | /* 44 | * Get the busy state 45 | */ 46 | 47 | inline bool FpgaBusyMonitor::isBusy() const { 48 | return _busyPin.read(); 49 | } 50 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/Introduction.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 3 | * Copyright (c) 2014 Andy Brown 4 | * Please see website for licensing terms. 5 | */ 6 | 7 | #include "Application.h" 8 | 9 | 10 | /* 11 | * Constructor: set ourselves up to show level 1 12 | */ 13 | 14 | Introduction::Introduction(Panel& panel) 15 | : _panel(panel), 16 | _world(panel,Level1) { 17 | } 18 | 19 | 20 | /* 21 | * Run the introduction 22 | */ 23 | 24 | void Introduction::run() { 25 | 26 | uint32_t start,busy_elapsed,frame_counter; 27 | uint32_t free_elapsed __attribute__((unused)); 28 | Buttons buttons; 29 | 30 | // fade up the backlight to 90% 31 | 32 | _panel.setBacklight(90); 33 | 34 | // enable sprite mode. the backlight cannot be adjusted once we're in sprite mode 35 | // without coming back to passthrough mode first. 36 | 37 | _panel.enableSpriteMode(); 38 | 39 | // create a busy monitor 40 | 41 | FpgaBusyMonitor busyMonitor; 42 | 43 | // infinite loop 44 | 45 | for(frame_counter=0;;frame_counter++) { 46 | 47 | // wait for busy to go high and then back to low 48 | 49 | while(!busyMonitor.isBusy()); 50 | start=MillisecondTimer::millis(); 51 | while(busyMonitor.isBusy()); 52 | busy_elapsed=MillisecondTimer::millis()-start; 53 | if(busy_elapsed>16) 54 | for(;;); // lock up so a debugger break can detect this 'too many graphics' case 55 | 56 | // update the sprites based on the state of the world 57 | 58 | start=MillisecondTimer::millis(); 59 | _world.update(buttons,frame_counter); 60 | free_elapsed=MillisecondTimer::millis()-start; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/Introduction.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 3 | * Copyright (c) 2014 Andy Brown 4 | * Please see website for licensing terms. 5 | */ 6 | 7 | #pragma once 8 | 9 | 10 | /* 11 | * Introduction displays an introductory message over a continually panning background 12 | */ 13 | 14 | class Introduction { 15 | 16 | public: 17 | Panel& _panel; 18 | World _world; 19 | 20 | public: 21 | Introduction(Panel& panel); 22 | 23 | void run(); 24 | }; 25 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ManicKnights.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 3 | * Copyright (c) 2014 Andy Brown 4 | * Please see website for licensing terms. 5 | */ 6 | 7 | #include "Application.h" 8 | 9 | 10 | /* 11 | * Run the application 12 | */ 13 | 14 | void ManicKnights::run() { 15 | 16 | // program and reset the FPGA 17 | 18 | programFpga(); 19 | 20 | // show the intro screen 21 | 22 | introduction(); 23 | } 24 | 25 | 26 | /* 27 | * Show the introduction screen 28 | */ 29 | 30 | void ManicKnights::introduction() { 31 | 32 | // there's a class for that 33 | 34 | Introduction intro(*_panel); 35 | intro.run(); 36 | } 37 | 38 | 39 | /* 40 | * Program the FPGA with the main bit file 41 | */ 42 | 43 | void ManicKnights::programFpga() { 44 | 45 | // program the FPGA 46 | 47 | FpgaProgrammer programmer; 48 | programmer.program(); 49 | 50 | // reset the FPGA 51 | 52 | _accessMode.resetFpga(); 53 | 54 | // create the panel 55 | 56 | _panel.reset(new Panel(_accessMode)); 57 | } 58 | 59 | 60 | /* 61 | * Main entry point 62 | */ 63 | 64 | int main() { 65 | 66 | // set up SysTick at 1ms resolution 67 | MillisecondTimer::initialise(); 68 | 69 | ManicKnights mk; 70 | mk.run(); 71 | 72 | // not reached 73 | return 0; 74 | } 75 | 76 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ManicKnights.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 3 | * Copyright (c) 2014 Andy Brown 4 | * Please see website for licensing terms. 5 | */ 6 | 7 | #include "Application.h" 8 | 9 | 10 | /* 11 | * Main application startup class 12 | */ 13 | 14 | class ManicKnights { 15 | 16 | protected: 17 | scoped_ptr _panel; 18 | AseAccessMode _accessMode; 19 | 20 | protected: 21 | void programFpga(); 22 | void introduction(); 23 | 24 | public: 25 | void run(); 26 | }; 27 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/SConscript: -------------------------------------------------------------------------------- 1 | # import everything exported in SConstruct 2 | 3 | Import('*') 4 | 5 | # get a copy of the environment 6 | 7 | env=env.Clone(BIT=main_bit) 8 | 9 | # this project name and location 10 | 11 | PROJECT = "manic_knights" 12 | MYDIR = "main/stm32f429/"+PROJECT 13 | 14 | # collect the source files 15 | 16 | matches=[] 17 | matches.append(Glob("*.cpp")) 18 | matches.append(Glob("world/*.cpp")) 19 | matches.append(Glob("world/defs/*.cpp")) 20 | matches.append(Glob("*.asm")) 21 | 22 | # append the system startup files 23 | 24 | matches.append("system/LibraryHacks.cpp") 25 | matches.append("system/f429/Startup.asm") 26 | matches.append("system/f429/System.c") 27 | 28 | # additional include directory 29 | 30 | env.Append(CCFLAGS="-I"+MYDIR) 31 | 32 | # assembler flags 33 | 34 | env.Append(ASFLAGS="-I"+MYDIR) 35 | 36 | # here's where the linker script is located 37 | 38 | env.Append(LINKFLAGS="-T"+MYDIR+"/system/f429/Linker.ld") 39 | 40 | # trigger a build with the correct output name 41 | 42 | buildoutdir=MYDIR+"/build/"+mode+"/" 43 | 44 | elf=env.Program(PROJECT+".elf",matches) 45 | hex=env.Command(PROJECT+".hex",elf,"arm-none-eabi-objcopy -O ihex "+buildoutdir+PROJECT+".elf "+buildoutdir+PROJECT+".hex") 46 | bin=env.Command(PROJECT+".bin",elf,"arm-none-eabi-objcopy -O binary "+buildoutdir+PROJECT+".elf "+buildoutdir+PROJECT+".bin") 47 | lst=env.Command(PROJECT+".lst",elf,"arm-none-eabi-objdump -h -S "+buildoutdir+PROJECT+".elf > "+buildoutdir+PROJECT+".lst") 48 | size=env.Command(PROJECT+".size",elf,"arm-none-eabi-size --format=berkeley "+buildoutdir+PROJECT+".elf | tee "+buildoutdir+PROJECT+".size") 49 | 50 | # bitFile.asm includes the output of the FPGA build and scons needs to be told about it 51 | 52 | env.Depends("bitFile.o",env["BIT"]) 53 | 54 | # return the hex file 55 | 56 | Return("hex") 57 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/World.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 3 | * Copyright (c) 2014 Andy Brown 4 | * Please see website for licensing terms. 5 | */ 6 | 7 | #include "Application.h" 8 | 9 | 10 | /* 11 | * Constructor 12 | */ 13 | 14 | World::World(Panel& panel,const LevelDef& ldef) 15 | : _levelDef(ldef), 16 | _panel(panel), 17 | _background(panel,ldef) { 18 | 19 | createActors(panel); 20 | } 21 | 22 | 23 | /* 24 | * Destructor 25 | */ 26 | 27 | World::~World() { 28 | 29 | for(int i=0;i<_levelDef.ActorCount;i++) 30 | delete &_actors[i]; 31 | 32 | free(_actors); 33 | } 34 | 35 | 36 | /* 37 | * Update the components of the world 38 | */ 39 | 40 | void World::update(const Buttons& buttons,uint32_t frame_counter) { 41 | 42 | Point topLeft(_background.getTopLeft()); 43 | uint16_t i; 44 | float f; 45 | 46 | // sample the navigation buttons 47 | 48 | if(buttons.isRightPressed() && topLeft.Y>0) 49 | topLeft.Y-=4; 50 | else if(buttons.isLeftPressed() && topLeft.Y!=1920-640) 51 | topLeft.Y+=4; 52 | 53 | if(buttons.isUpPressed() && topLeft.X>0) 54 | topLeft.X-=4; 55 | else if(buttons.isDownPressed() && topLeft.X!=1280-360) 56 | topLeft.X+=4; 57 | 58 | // set the new position 59 | 60 | _background.setTopLeft(topLeft); 61 | 62 | // update the components 63 | 64 | _background.update(); 65 | 66 | f=static_cast(frame_counter); 67 | for(i=0;i<_levelDef.ActorCount;i++) 68 | _actors[i]->update(f,_background.getTopLeft()); 69 | } 70 | 71 | 72 | /* 73 | * Create the actors for this level 74 | */ 75 | 76 | void World::createActors(Panel& panel) { 77 | 78 | uint16_t i,fpgaSpriteIndex; 79 | 80 | // actor has a non-default constructor with reference members 81 | 82 | _actors=reinterpret_cast(malloc(sizeof(Actor)*_levelDef.ActorCount)); 83 | 84 | fpgaSpriteIndex=FIRST_PATH_SPRITE; 85 | 86 | // initialise array 87 | 88 | for(i=0;i<_levelDef.ActorCount;i++) 89 | _actors[i]=new Actor(panel,_levelDef.ActorDefs[i],fpgaSpriteIndex++); 90 | } 91 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/bitFile.asm: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 3 | * Copyright (c) 2014 Andy Brown 4 | * Please see website for licensing terms. 5 | */ 6 | 7 | .global BitFileStart 8 | .global BitFileSize 9 | 10 | BitFileStart: 11 | .incbin "../../xc3s50/main.bit" 12 | BitFileSize=.-BitFileStart 13 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/system/LibraryHacks.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * LibraryHacks.cpp 3 | * 4 | * Created on: 23 Jan 2011 5 | * Author: Andy 6 | */ 7 | 8 | #include 9 | #include 10 | 11 | 12 | /* 13 | * The default pulls in 70K of garbage 14 | */ 15 | 16 | namespace __gnu_cxx { 17 | 18 | void __verbose_terminate_handler() { 19 | for(;;); 20 | } 21 | } 22 | 23 | 24 | /* 25 | * The default pulls in about 12K of garbage 26 | */ 27 | 28 | extern "C" void __cxa_pure_virtual() { 29 | for(;;); 30 | } 31 | 32 | 33 | /* 34 | * Implement C++ new/delete operators using the heap 35 | */ 36 | 37 | void *operator new(size_t size) { 38 | return malloc(size); 39 | } 40 | 41 | void *operator new(size_t,void *ptr) { 42 | return ptr; 43 | } 44 | 45 | void *operator new[](size_t size) { 46 | return malloc(size); 47 | } 48 | 49 | void *operator new[](size_t,void *ptr) { 50 | return ptr; 51 | } 52 | 53 | void operator delete(void *p) { 54 | free(p); 55 | } 56 | 57 | void operator delete[](void *p) { 58 | free(p); 59 | } 60 | 61 | 62 | /* 63 | * EABI builds can generate reams of stack unwind code for system generated exceptions 64 | * e.g. (divide-by-zero). Since we don't support exceptions we'll wrap out these 65 | * symbols and save a lot of flash space. 66 | */ 67 | 68 | extern "C" void __wrap___aeabi_unwind_cpp_pr0() {} 69 | extern "C" void __wrap___aeabi_unwind_cpp_pr1() {} 70 | extern "C" void __wrap___aeabi_unwind_cpp_pr2() {} 71 | 72 | 73 | /* 74 | * sbrk function for getting space for malloc and friends 75 | */ 76 | 77 | extern int _end; 78 | 79 | extern "C" { 80 | caddr_t _sbrk ( int incr ) { 81 | 82 | static unsigned char *heap = NULL; 83 | unsigned char *prev_heap; 84 | 85 | if (heap == NULL) { 86 | heap = (unsigned char *)&_end; 87 | } 88 | prev_heap = heap; 89 | /* check removed to show basic approach */ 90 | 91 | heap += incr; 92 | 93 | return (caddr_t) prev_heap; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/.gitignore: -------------------------------------------------------------------------------- 1 | characters 2 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/000_tile42.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/000_tile42.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/001_tile17.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/001_tile17.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/002_tile25.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/002_tile25.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/003_tile8.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/003_tile8.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/004_tile93.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/004_tile93.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/005_tile73.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/005_tile73.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/006_tile10.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/006_tile10.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/007_tile85.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/007_tile85.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/008_tile92.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/008_tile92.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/009_tile75.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/009_tile75.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/010_tile97.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/010_tile97.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/011_tile105.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/011_tile105.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/012_tile74.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/012_tile74.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/013_tile83.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/013_tile83.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/014_tile94.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/014_tile94.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/015_tile99.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/015_tile99.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/016_tile107.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/016_tile107.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/017_tile47.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/017_tile47.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/018_tile76.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/018_tile76.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/019_tile96.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/019_tile96.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/020_tile104.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/020_tile104.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/021_tile91.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/021_tile91.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/022_tile98.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/022_tile98.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/023_tile106.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/023_tile106.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/024_tile57.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/024_tile57.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/025_tile66.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/025_tile66.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/026_tile41.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/026_tile41.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/027_tile55.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/027_tile55.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/028_tile95.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/028_tile95.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/029_tile33.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/029_tile33.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/030_tile58.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/030_tile58.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/031_tile109.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/031_tile109.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/032_tile82.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/032_tile82.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/033_tile79.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/033_tile79.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/034_tile77.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/034_tile77.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/035_tile54.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/035_tile54.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/036_tile34.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/036_tile34.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/037_tile78.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/037_tile78.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/038_tile59.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/038_tile59.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/039_tile88.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/039_tile88.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/040_tile89.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/040_tile89.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/041_tile90.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/041_tile90.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/042_tile81.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/042_tile81.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/043_tile84.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/043_tile84.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/044_tile101.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/044_tile101.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/045_tile72.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/045_tile72.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/046_tile80.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/046_tile80.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/047_tile18.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/047_tile18.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/048_tile9.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/048_tile9.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/049_tile100.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/049_tile100.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/050_tile108.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/050_tile108.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/051_tile87.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/051_tile87.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/052_tile27.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/052_tile27.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/053_tile11.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/053_tile11.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/054_tile86.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/054_tile86.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/055_tile102.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/055_tile102.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/056_tile110.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/056_tile110.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/057_tile118.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/057_tile118.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/058_tile19.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/058_tile19.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/100_torch_1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/100_torch_1.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/101_torch_2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/101_torch_2.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/102_torch_3.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/102_torch_3.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/103_torch_4.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/103_torch_4.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/104_enemy1_walk1_l.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/104_enemy1_walk1_l.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/105_enemy1_walk2_l.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/105_enemy1_walk2_l.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/106_enemy1_walk3_l.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/106_enemy1_walk3_l.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/107_enemy1_walk4_l.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/107_enemy1_walk4_l.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/108_enemy1_walk5_l.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/108_enemy1_walk5_l.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/109_enemy1_walk6_l.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/109_enemy1_walk6_l.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/110_enemy1_walk7_l.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/110_enemy1_walk7_l.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/111_enemy1_walk8_l.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/111_enemy1_walk8_l.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/112_enemy1_walk9_l.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/112_enemy1_walk9_l.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/113_enemy1_walk10_l.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/113_enemy1_walk10_l.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/114_enemy1_walk11_l.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/114_enemy1_walk11_l.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/115_enemy1_walk12_l.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/115_enemy1_walk12_l.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/116_enemy1_walk1_r.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/116_enemy1_walk1_r.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/117_enemy1_walk2_r.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/117_enemy1_walk2_r.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/118_enemy1_walk3_r.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/118_enemy1_walk3_r.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/119_enemy1_walk4_r.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/119_enemy1_walk4_r.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/120_enemy1_walk5_r.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/120_enemy1_walk5_r.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/121_enemy1_walk6_r.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/121_enemy1_walk6_r.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/122_enemy1_walk7_r.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/122_enemy1_walk7_r.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/123_enemy1_walk8_r.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/123_enemy1_walk8_r.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/124_enemy1_walk9_r.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/124_enemy1_walk9_r.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/125_enemy1_walk10_r.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/125_enemy1_walk10_r.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/126_enemy1_walk11_r.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/126_enemy1_walk11_r.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/127_enemy1_walk12_r.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/127_enemy1_walk12_r.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/128_enemy2_walk1_r.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/128_enemy2_walk1_r.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/129_enemy2_walk2_r.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/129_enemy2_walk2_r.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/130_enemy2_walk3_r.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/130_enemy2_walk3_r.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/131_enemy2_walk4_r.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/131_enemy2_walk4_r.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/132_enemy2_walk5_r.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/132_enemy2_walk5_r.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/133_enemy2_walk6_r.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/133_enemy2_walk6_r.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/134_enemy2_walk7_r.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/134_enemy2_walk7_r.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/135_enemy2_walk8_r.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/135_enemy2_walk8_r.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/136_enemy2_walk9_r.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/136_enemy2_walk9_r.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/137_enemy2_walk10_r.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/137_enemy2_walk10_r.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/138_enemy2_walk11_r.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/138_enemy2_walk11_r.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/139_enemy2_walk12_r.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/139_enemy2_walk12_r.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/140_enemy2_walk1_l.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/140_enemy2_walk1_l.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/141_enemy2_walk2_l.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/141_enemy2_walk2_l.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/142_enemy2_walk3_l.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/142_enemy2_walk3_l.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/143_enemy2_walk4_l.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/143_enemy2_walk4_l.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/144_enemy2_walk5_l.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/144_enemy2_walk5_l.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/145_enemy2_walk6_l.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/145_enemy2_walk6_l.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/146_enemy2_walk7_l.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/146_enemy2_walk7_l.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/147_enemy2_walk8_l.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/147_enemy2_walk8_l.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/148_enemy2_walk9_l.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/148_enemy2_walk9_l.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/149_enemy2_walk10_l.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/149_enemy2_walk10_l.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/150_enemy2_walk11_l.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/150_enemy2_walk11_l.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/151_enemy2_walk12_l.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/151_enemy2_walk12_l.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/152_moving_platform.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/152_moving_platform.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/153_saw_1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/153_saw_1.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/154_saw_2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/154_saw_2.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/155_saw_3.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/155_saw_3.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/156_saw_4.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/156_saw_4.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/157_saw_5.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/157_saw_5.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/spiflash/158_saw_6.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/spiflash/158_saw_6.bin -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/tiles/.gitignore: -------------------------------------------------------------------------------- 1 | tileset.png 2 | tileset.tif 3 | converted-tiles 4 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/tiles/cropper/.gitignore: -------------------------------------------------------------------------------- 1 | *.suo 2 | *.user 3 | bin/ 4 | obj/ 5 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/tiles/cropper/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/tiles/cropper/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace cropper { 8 | class Program { 9 | static void Main(string[] args) { 10 | 11 | try { 12 | 13 | if (args.Length!=1) 14 | System.Console.WriteLine("usage: cropper "); 15 | else { 16 | 17 | TmxReader tmx; 18 | tmx=new TmxReader(); 19 | 20 | tmx.Run(args[0]); 21 | } 22 | } 23 | catch (Exception ex) { 24 | Console.WriteLine(ex.StackTrace); 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/tiles/cropper/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("cropper")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("cropper")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("23d21543-7231-4bd8-9cda-15745905b05a")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/tiles/cropper/TmxReader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Xml; 4 | using System.Text; 5 | 6 | 7 | namespace cropper { 8 | 9 | public class TmxReader { 10 | 11 | public void Run(string filename) { 12 | 13 | XmlDocument doc; 14 | String tsx; 15 | List tiles; 16 | TsxReader tsxreader; 17 | 18 | Console.WriteLine("Reading "+filename); 19 | 20 | doc=new XmlDocument(); 21 | doc.Load(filename); 22 | 23 | tsx=XmlUtil.GetString(doc,"/map/tileset/@source",null,true); 24 | tiles=new List(); 25 | 26 | foreach(XmlNode node in doc.SelectNodes("/map/layer[@name='background']/data/tile/@gid")) 27 | tiles.Add(node.InnerText); 28 | 29 | tsxreader=new TsxReader(); 30 | tsxreader.Run(filename,tsx,tiles); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/tiles/cropper/XmlUtil.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using System.Xml; 5 | 6 | 7 | namespace cropper 8 | { 9 | class XmlUtil 10 | { 11 | /* 12 | * append XML child 13 | */ 14 | 15 | public static void AppendString(XmlElement parent_,string childName_,string value_) 16 | { 17 | XmlElement child; 18 | XmlText text; 19 | 20 | if(value_==null) 21 | return; 22 | 23 | child=parent_.OwnerDocument.CreateElement(childName_); 24 | text=parent_.OwnerDocument.CreateTextNode(value_); 25 | 26 | parent_.AppendChild(child); 27 | child.AppendChild(text); 28 | } 29 | 30 | 31 | /* 32 | * append boolean 33 | */ 34 | 35 | public static void AppendBool(XmlElement parent_,string childName_,bool value_) 36 | { 37 | AppendString(parent_,childName_,value_ ? "true" : "false"); 38 | } 39 | 40 | 41 | /* 42 | * append XML child CDATA 43 | */ 44 | 45 | public static void AppendCdata(XmlElement parent_,string childName_,string value_) 46 | { 47 | XmlElement child; 48 | XmlCDataSection text; 49 | 50 | child=parent_.OwnerDocument.CreateElement(childName_); 51 | text=parent_.OwnerDocument.CreateCDataSection(value_); 52 | 53 | parent_.AppendChild(child); 54 | child.AppendChild(text); 55 | } 56 | 57 | 58 | /* 59 | * append int 60 | */ 61 | 62 | public static void AppendInt(XmlElement parent_,string childName_,int value_) 63 | { 64 | AppendString(parent_,childName_,value_.ToString()); 65 | } 66 | 67 | 68 | /* 69 | * get string 70 | */ 71 | 72 | public static string GetString(XmlNode parent_,string xpath_,string default_,bool required_) 73 | { 74 | string str; 75 | 76 | try 77 | { 78 | str=parent_.SelectSingleNode(xpath_).FirstChild.InnerText; 79 | return str; 80 | } 81 | catch(Exception) 82 | { 83 | if(required_) 84 | throw new Exception("XML value: "+default_+" is required but is not present in this document"); 85 | 86 | return default_; 87 | } 88 | } 89 | 90 | 91 | /* 92 | * get an integer 93 | */ 94 | 95 | public static Int32 GetInt(XmlNode parent_,string xpath_,Int32 default_,bool required_) 96 | { 97 | string str; 98 | 99 | if((str=GetString(parent_,xpath_,null,required_))==null) 100 | return default_; 101 | 102 | return Int32.Parse(str); 103 | } 104 | 105 | 106 | /* 107 | * get a boolean 108 | */ 109 | 110 | public static bool GetBool(XmlNode parent_,string xpath_,bool default_,bool required_) 111 | { 112 | string str; 113 | 114 | if((str=GetString(parent_,xpath_,null,required_))==null) 115 | return default_; 116 | 117 | return str.Equals("true"); 118 | } 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/tiles/cropper/cropper.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {AA8D86BA-4A4C-48D4-BA6A-1C19AD690ED2} 8 | Exe 9 | Properties 10 | cropper 11 | cropper 12 | v4.5 13 | 512 14 | 15 | 16 | AnyCPU 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | AnyCPU 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 62 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/tiles/cropper/cropper.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.30501.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cropper", "cropper.csproj", "{AA8D86BA-4A4C-48D4-BA6A-1C19AD690ED2}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {AA8D86BA-4A4C-48D4-BA6A-1C19AD690ED2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {AA8D86BA-4A4C-48D4-BA6A-1C19AD690ED2}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {AA8D86BA-4A4C-48D4-BA6A-1C19AD690ED2}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {AA8D86BA-4A4C-48D4-BA6A-1C19AD690ED2}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/tiles/tileset.tsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/ux/worldmap.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/manic_knights/ux/worldmap.tif -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/world/Actor.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 3 | * Copyright (c) 2014 Andy Brown 4 | * Please see website for licensing terms. 5 | */ 6 | 7 | #include "Application.h" 8 | 9 | 10 | /* 11 | * constructor 12 | */ 13 | 14 | Actor::Actor(Panel& panel,const ActorDef& def,uint16_t fpgaSpriteIndex) 15 | : _def(def) { 16 | 17 | uint16_t i; 18 | 19 | // allocate array space 20 | 21 | _paths=reinterpret_cast(malloc(sizeof(PathBase)*def.PathCount)); 22 | 23 | // create each array element 24 | 25 | for(i=0;irestart(0); 37 | } 38 | 39 | 40 | /* 41 | * Update the path for this actor 42 | */ 43 | 44 | void Actor::update(float time,const Point& bgTopLeft) { 45 | 46 | // check if this path has finished 47 | 48 | if(_paths[_currentPath]->hasFinished(time)) { 49 | 50 | // hide this path's sprite 51 | 52 | _paths[_currentPath]->hide(); 53 | 54 | // update to the next path or reset to the beginning 55 | 56 | _currentPath++; 57 | 58 | if(_currentPath==_def.PathCount) 59 | _currentPath=0; 60 | 61 | // initialise the new path 62 | 63 | _paths[_currentPath]->restart(time); 64 | } 65 | 66 | // update the path 67 | 68 | _paths[_currentPath]->update(time,bgTopLeft); 69 | } 70 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/world/Actor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 3 | * Copyright (c) 2014 Andy Brown 4 | * Please see website for licensing terms. 5 | */ 6 | 7 | #pragma once 8 | 9 | 10 | /* 11 | * Higher level actor class that manages the movement of an actor through a number of paths. 12 | * Paths should be closed, i.e. the last path should end at the start of the first path. 13 | */ 14 | 15 | class Actor { 16 | 17 | protected: 18 | const ActorDef& _def; 19 | PathBase **_paths; 20 | uint16_t _currentPath; 21 | 22 | public: 23 | Actor(Panel& panel,const ActorDef& def,uint16_t fpgaSpriteIndex); 24 | ~Actor(); 25 | 26 | void update(float time,const Point& bgTopLeft); 27 | }; 28 | 29 | 30 | /* 31 | * Destructor 32 | */ 33 | 34 | inline Actor::~Actor() { 35 | 36 | for(int i=0;i<_def.PathCount;i++) 37 | delete _paths[i]; 38 | 39 | free(_paths); 40 | } 41 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/world/AnimationType.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 3 | * Copyright (c) 2014 Andy Brown 4 | * Please see website for licensing terms. 5 | */ 6 | 7 | #pragma once 8 | 9 | 10 | /* 11 | * Possible animation types 12 | */ 13 | 14 | enum class AnimationType { 15 | MOVING, 16 | STATIC 17 | }; 18 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/world/Background.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 3 | * Copyright (c) 2014 Andy Brown 4 | * Please see website for licensing terms. 5 | */ 6 | 7 | #include "Application.h" 8 | 9 | 10 | /* 11 | * Constructor. Start the world off at the bottom left 12 | */ 13 | 14 | Background::Background(Panel& panel,const LevelDef& ldef) 15 | : _panel(panel), 16 | _levelDef(ldef), 17 | _topLeft(1280-360,1920-640), 18 | _lastTopLeft(0,0) { 19 | 20 | // constants for the load 21 | 22 | _lsd.PixelWidth=64; 23 | _lsd.NumPixels=64*64; 24 | _lsd.RepeatX=1; 25 | _lsd.RepeatY=1; 26 | _lsd.Visible=1; 27 | } 28 | 29 | 30 | /* 31 | * Update the 77 slots reserved for the background tiles in the FPGA 32 | */ 33 | 34 | void Background::update() { 35 | 36 | const uint16_t *tile,*row_tile; 37 | uint8_t x,y,left_firstx,top_firsty; 38 | uint16_t spriteNumber; 39 | int16_t px,py; 40 | int32_t sram_address,row_sram_address; 41 | 42 | // check if update required 43 | 44 | if(_lastTopLeft==_topLeft) 45 | return; 46 | 47 | // get a pointer to the first tile 48 | 49 | row_tile=&_levelDef.Tiles[((_topLeft.Y / 64)*20)+(_topLeft.X / 64)]; 50 | 51 | // calculate overlapping pixels at each edge 52 | 53 | left_firstx=_topLeft.X % 64; 54 | top_firsty=_topLeft.Y % 64; 55 | 56 | // there are (10+1)*(6+1) = 77 slots reserved for the scene, slots 0..76 57 | 58 | spriteNumber=0; 59 | 60 | // initial sram address 61 | 62 | row_sram_address=0; 63 | 64 | if(top_firsty) 65 | row_sram_address-=top_firsty*360; 66 | 67 | if(left_firstx) 68 | row_sram_address-=left_firstx; 69 | 70 | py=-top_firsty; 71 | 72 | for(y=0;y<11;y++) { 73 | 74 | tile=row_tile; 75 | sram_address=row_sram_address; 76 | 77 | // values unique to the row 78 | 79 | _lsd.FirstY=y==0 ? top_firsty : 0; 80 | _lsd.LastY=y==10 ? top_firsty-1 : 63; 81 | 82 | px=-left_firstx; 83 | 84 | for(x=0;x<7;x++) { 85 | 86 | if(px<360 && py<640) { 87 | 88 | // values unique to the individual sprite 89 | 90 | _lsd.SpriteNumber=spriteNumber++; 91 | _lsd.FirstX=x==0 ? left_firstx : 0; 92 | _lsd.LastX=px+64>360 ? 63-(px+64-360) : 63; 93 | _lsd.SramAddress=sram_address>=0 ? sram_address : 524288+sram_address; 94 | _lsd.FlashAddress=BackgroundSprites[*tile].FlashAddress; 95 | 96 | // load the sprite 97 | 98 | _panel.getAccessMode().loadSprite(_lsd); 99 | } 100 | else 101 | _panel.getAccessMode().hideSprite(spriteNumber++); 102 | 103 | // move to the adjacent sprite on the X axis 104 | 105 | sram_address+=64; 106 | px+=64; 107 | tile++; 108 | } 109 | 110 | // advance to the next row 111 | 112 | row_tile=row_tile+20; 113 | row_sram_address+=360*64; 114 | py+=64; 115 | } 116 | 117 | // done 118 | 119 | _lastTopLeft=_topLeft; 120 | } 121 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/world/Background.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 3 | * Copyright (c) 2014 Andy Brown 4 | * Please see website for licensing terms. 5 | */ 6 | 7 | #pragma once 8 | 9 | 10 | /* 11 | * The background class looks after maintaining the tiles that make up 12 | * the background. 13 | */ 14 | 15 | class Background { 16 | 17 | protected: 18 | Panel& _panel; 19 | const LevelDef &_levelDef; 20 | Point _topLeft; 21 | Point _lastTopLeft; 22 | LoadSpriteDef _lsd; 23 | 24 | public: 25 | Background(Panel& panel,const LevelDef& ldef); 26 | 27 | void update(); 28 | void setTopLeft(const Point& topLeft); 29 | const Point& getTopLeft() const; 30 | }; 31 | 32 | 33 | /* 34 | * Set a new top-left point 35 | */ 36 | 37 | inline void Background::setTopLeft(const Point& topLeft) { 38 | _topLeft=topLeft; 39 | } 40 | 41 | 42 | /* 43 | * Get the current top-left 44 | */ 45 | 46 | inline const Point& Background::getTopLeft() const { 47 | return _topLeft; 48 | } 49 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/world/BackgroundSprites.cpp: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 4 | * Copyright (c) 2014 Andy Brown 5 | * Please see website for licensing terms. 6 | */ 7 | 8 | #include "Application.h" 9 | 10 | /* 11 | * All sprites in this world 12 | */ 13 | 14 | const BackgroundSpriteDef BackgroundSprites[]={ 15 | { 0, 0 }, 16 | { 1, 8448 }, 17 | { 2, 16896 }, 18 | { 3, 25344 }, 19 | { 4, 33792 }, 20 | { 5, 42240 }, 21 | { 6, 50688 }, 22 | { 7, 59136 }, 23 | { 8, 67584 }, 24 | { 9, 76032 }, 25 | { 10, 84480 }, 26 | { 11, 92928 }, 27 | { 12, 101376 }, 28 | { 13, 109824 }, 29 | { 14, 118272 }, 30 | { 15, 126720 }, 31 | { 16, 135168 }, 32 | { 17, 143616 }, 33 | { 18, 152064 }, 34 | { 19, 160512 }, 35 | { 20, 168960 }, 36 | { 21, 177408 }, 37 | { 22, 185856 }, 38 | { 23, 194304 }, 39 | { 24, 202752 }, 40 | { 25, 211200 }, 41 | { 26, 219648 }, 42 | { 27, 228096 }, 43 | { 28, 236544 }, 44 | { 29, 244992 }, 45 | { 30, 253440 }, 46 | { 31, 261888 }, 47 | { 32, 270336 }, 48 | { 33, 278784 }, 49 | { 34, 287232 }, 50 | { 35, 295680 }, 51 | { 36, 304128 }, 52 | { 37, 312576 }, 53 | { 38, 321024 }, 54 | { 39, 329472 }, 55 | { 40, 337920 }, 56 | { 41, 346368 }, 57 | { 42, 354816 }, 58 | { 43, 363264 }, 59 | { 44, 371712 }, 60 | { 45, 380160 }, 61 | { 46, 388608 }, 62 | { 47, 397056 }, 63 | { 48, 405504 }, 64 | { 49, 413952 }, 65 | { 50, 422400 }, 66 | { 51, 430848 }, 67 | { 52, 439296 }, 68 | { 53, 447744 }, 69 | { 54, 456192 }, 70 | { 55, 464640 }, 71 | { 56, 473088 }, 72 | { 57, 481536 }, 73 | { 58, 489984 }, 74 | }; 75 | 76 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/world/BackgroundSprites.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 4 | * Copyright (c) 2014 Andy Brown 5 | * Please see website for licensing terms. 6 | */ 7 | 8 | #pragma once 9 | 10 | 11 | extern const BackgroundSpriteDef BackgroundSprites[]; 12 | enum { BACKGROUND_SPRITES_COUNT=59 }; 13 | 14 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/world/EasingMode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 3 | * Copyright (c) 2014 Andy Brown 4 | * Please see website for licensing terms. 5 | */ 6 | 7 | #pragma once 8 | 9 | 10 | /* 11 | * The possible easing modes 12 | */ 13 | 14 | enum class EasingMode { 15 | IN = 0, 16 | OUT = 1, 17 | INOUT = 2 18 | }; 19 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/world/EasingType.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 3 | * Copyright (c) 2014 Andy Brown 4 | * Please see website for licensing terms. 5 | */ 6 | 7 | 8 | #pragma once 9 | 10 | 11 | /* 12 | * Enumeration of the possible easing types. 13 | */ 14 | 15 | enum class EasingType { 16 | BACK = 0, 17 | BOUNCE = 1, 18 | CIRCULAR = 2, 19 | CUBIC = 3, 20 | ELASTIC = 4, 21 | EXPONENTIAL = 5, 22 | LINEAR = 6, 23 | QUADRATIC = 7, 24 | QUARTIC = 8, 25 | QUINTIC = 9, 26 | SINE = 10 27 | }; 28 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/world/Level1.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 3 | * Copyright (c) 2014 Andy Brown 4 | * Please see website for licensing terms. 5 | */ 6 | 7 | #pragma once 8 | 9 | // declare the definitions for each level 10 | 11 | extern const LevelDef Level1; 12 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/world/Level1_Tiles.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 4 | * Copyright (c) 2014 Andy Brown 5 | * Please see website for licensing terms. 6 | */ 7 | 8 | #include "Application.h" 9 | 10 | 11 | /* 12 | * Level world definition 13 | */ 14 | 15 | extern const uint16_t Level1_Tiles[] = { 16 | 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 17 | 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 3, 3, 3, 3, 3, 5, 6, 18 | 0, 3, 7, 3, 3, 3, 3, 3, 3, 3, 8, 3, 3, 3, 3, 3, 3, 3, 3, 6, 19 | 0, 3, 3, 3, 9, 10, 11, 12, 13, 14, 8, 3, 15, 16, 9, 3, 3, 9, 3, 6, 20 | 0, 3, 3, 17, 18, 19, 20, 6, 0, 3, 21, 3, 22, 23, 24, 3, 3, 24, 25, 26, 21 | 0, 3, 3, 3, 3, 3, 3, 5, 0, 3, 3, 3, 3, 25, 24, 3, 17, 6, 27, 6, 22 | 0, 3, 3, 3, 3, 3, 3, 5, 0, 28, 3, 3, 3, 29, 30, 3, 3, 6, 27, 6, 23 | 0, 3, 3, 3, 3, 3, 3, 6, 0, 3, 7, 3, 3, 3, 24, 3, 3, 24, 3, 6, 24 | 0, 3, 31, 12, 32, 13, 3, 33, 0, 3, 3, 3, 3, 3, 24, 3, 31, 18, 3, 34, 25 | 0, 3, 25, 6, 35, 36, 3, 37, 38, 3, 39, 40, 41, 3, 18, 28, 3, 3, 3, 5, 26 | 0, 3, 3, 34, 42, 43, 3, 3, 18, 3, 3, 7, 3, 3, 3, 3, 3, 3, 25, 5, 27 | 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 25, 5, 28 | 0, 3, 7, 3, 3, 3, 5, 9, 28, 3, 3, 44, 12, 32, 13, 3, 3, 3, 3, 5, 29 | 0, 3, 3, 3, 3, 17, 29, 30, 3, 3, 10, 11, 6, 35, 0, 3, 3, 12, 45, 46, 30 | 0, 3, 39, 40, 41, 3, 5, 30, 3, 3, 19, 20, 6, 47, 0, 3, 3, 48, 2, 47, 31 | 0, 3, 3, 3, 3, 3, 29, 30, 3, 7, 3, 3, 5, 47, 0, 3, 3, 3, 6, 35, 32 | 0, 3, 3, 9, 3, 3, 5, 18, 3, 3, 3, 3, 6, 35, 0, 3, 3, 3, 6, 47, 33 | 0, 3, 25, 24, 3, 3, 3, 3, 3, 3, 3, 3, 34, 42, 43, 3, 7, 3, 49, 50, 34 | 0, 3, 44, 24, 3, 15, 16, 12, 32, 13, 3, 39, 40, 41, 3, 3, 3, 3, 6, 47, 35 | 0, 3, 3, 18, 28, 22, 23, 6, 35, 36, 3, 3, 3, 12, 32, 13, 28, 3, 33, 47, 36 | 0, 3, 3, 3, 3, 3, 3, 34, 42, 43, 14, 28, 3, 33, 47, 0, 3, 3, 37, 2, 37 | 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 37, 2, 0, 3, 3, 44, 6, 38 | 0, 3, 7, 3, 3, 3, 3, 3, 3, 9, 3, 3, 3, 3, 6, 0, 3, 3, 3, 6, 39 | 0, 3, 3, 3, 3, 3, 3, 3, 3, 18, 3, 7, 3, 25, 6, 0, 3, 3, 3, 6, 40 | 0, 3, 3, 3, 12, 32, 13, 3, 3, 3, 4, 3, 3, 51, 52, 0, 3, 17, 53, 52, 41 | 0, 3, 10, 11, 49, 50, 0, 3, 17, 9, 8, 3, 3, 54, 47, 0, 3, 3, 48, 2, 42 | 0, 3, 19, 20, 34, 42, 43, 28, 3, 18, 8, 3, 3, 34, 42, 0, 3, 3, 5, 6, 43 | 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 8, 3, 3, 3, 5, 0, 3, 3, 53, 52, 44 | 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 21, 3, 3, 3, 5, 0, 3, 55, 56, 57, 45 | 0, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 47, 58, 58, 52, 47 46 | }; 47 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/world/MovingPath.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 3 | * Copyright (c) 2014 Andy Brown 4 | * Please see website for licensing terms. 5 | */ 6 | 7 | #include "Application.h" 8 | 9 | 10 | /* 11 | * Constructor 12 | */ 13 | 14 | MovingPath::MovingPath(Panel& p,const PathDef& def,uint16_t fpgaSpriteIndex) 15 | : PathBase(p,def,fpgaSpriteIndex) { 16 | 17 | // horizontal flag 18 | 19 | _horizontal=def.StartY==def.EndY; 20 | 21 | // set change extent 22 | 23 | if(_horizontal) 24 | _easingFunction->setTotalChangeInPosition(static_cast(_def.EndX-_def.StartX+1)); 25 | else 26 | _easingFunction->setTotalChangeInPosition(static_cast(_def.EndY-_def.StartY+1)); 27 | } 28 | 29 | 30 | /* 31 | * Update the position using the easing function 32 | */ 33 | 34 | void MovingPath::doUpdate(float time,const Point& /* bgTopLeft */,Point& myPos) { 35 | 36 | float newPosition; 37 | int16_t newPoint; 38 | 39 | // get the new position 40 | 41 | switch(_def.EasingInOutMode) { 42 | 43 | case EasingMode::IN: 44 | newPosition=_easingFunction->easeIn(time-_timeBase); 45 | break; 46 | 47 | case EasingMode::OUT: 48 | newPosition=_easingFunction->easeOut(time-_timeBase); 49 | break; 50 | 51 | case EasingMode::INOUT: 52 | newPosition=_easingFunction->easeInOut(time-_timeBase); 53 | break; 54 | 55 | default: 56 | newPosition=0; // not reached 57 | break; 58 | } 59 | 60 | if(_horizontal) { 61 | myPos.X=_def.StartX+static_cast(newPosition); 62 | myPos.Y=_def.StartY; 63 | newPoint=myPos.X; 64 | } 65 | else { 66 | myPos.X=_def.StartX; 67 | myPos.Y=_def.StartY+static_cast(newPosition); 68 | newPoint=myPos.Y; 69 | } 70 | 71 | // update the sprite number if the position has changed 72 | 73 | if(newPoint!=_lastPoint) { 74 | 75 | if(_currentSpriteNumber==_def.LastSpriteNumber) { 76 | _currentSpriteNumber=_def.FirstSpriteNumber; 77 | _currentSpriteDef=_spriteArray; 78 | } 79 | else { 80 | _currentSpriteNumber++; 81 | _currentSpriteDef++; 82 | } 83 | 84 | // remember the new last position 85 | 86 | _lastPoint=newPoint; 87 | } 88 | } 89 | 90 | 91 | /* 92 | * Restart this path walk at the given elapsed time 93 | */ 94 | 95 | void MovingPath::restart(float timeBase) { 96 | _currentSpriteNumber=_def.FirstSpriteNumber; 97 | _currentSpriteDef=_spriteArray; 98 | _lastPoint=-1; 99 | _timeBase=timeBase; 100 | } 101 | 102 | 103 | /* 104 | * Check if this path has finished 105 | */ 106 | 107 | bool MovingPath::hasFinished(float time) const { 108 | return time-_timeBase==_def.EasingDuration; 109 | } 110 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/world/MovingPath.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 3 | * Copyright (c) 2014 Andy Brown 4 | * Please see website for licensing terms. 5 | */ 6 | 7 | #pragma once 8 | 9 | 10 | /* 11 | * Path management class. Will manage the transition of a sprite along a 12 | * straight line using an easing function 13 | */ 14 | 15 | class MovingPath : public PathBase { 16 | 17 | protected: 18 | bool _horizontal; // true if this sprite moves horizontally Y1==Y2 19 | int16_t _lastPoint; // the last position of this sprite 20 | 21 | public: 22 | MovingPath(Panel& p,const PathDef& def,uint16_t fpgaSpriteIndex); 23 | virtual ~MovingPath() {} 24 | 25 | // overrides from PathBase 26 | 27 | virtual void restart(float timebase) override; 28 | virtual void doUpdate(float time,const Point& bgTopLeft,Point& p); 29 | virtual bool hasFinished(float time) const override; 30 | }; 31 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/world/PathBase.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 3 | * Copyright (c) 2014 Andy Brown 4 | * Please see website for licensing terms. 5 | */ 6 | 7 | #pragma once 8 | 9 | 10 | /* 11 | * Base class for path management. A sprite is animated by continually reloading its 12 | * slot in the FPGA with the appropriate image definition. If the sprite is offscreen 13 | * then it's hidden and will not consume FPGA resources. 14 | */ 15 | 16 | class PathBase { 17 | 18 | protected: 19 | Panel& _panel; 20 | const PathDef& _def; 21 | EasingBase *_easingFunction; 22 | uint16_t _currentSpriteNumber; 23 | uint16_t _fpgaSpriteIndex; 24 | const PathSpriteDef *_spriteArray; 25 | const PathSpriteDef *_currentSpriteDef; 26 | bool _hidden; 27 | float _timeBase; 28 | 29 | protected: 30 | EasingBase *createEasingFunction() const; 31 | 32 | public: 33 | PathBase(Panel& p,const PathDef& def,uint16_t fpgaSpriteIndex); 34 | virtual ~PathBase(); 35 | 36 | void update(float time,const Point& bgTopLeft); 37 | void hide(); 38 | bool isOnScreen(const Point& myPos,const Point& bgTopLeft) const; 39 | 40 | virtual void restart(float timebase)=0; 41 | virtual bool hasFinished(float time) const=0; 42 | virtual void doUpdate(float time,const Point& bgTopLeft,Point& p)=0; 43 | }; 44 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/world/PathSprites.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 4 | * Copyright (c) 2014 Andy Brown 5 | * Please see website for licensing terms. 6 | */ 7 | 8 | #pragma once 9 | 10 | 11 | extern const PathSpriteDef PathSprites[]; 12 | 13 | enum { 14 | PATH_SPRITES_COUNT=59, 15 | 16 | TORCH_1 = 0, 17 | TORCH_2 = 1, 18 | TORCH_3 = 2, 19 | TORCH_4 = 3, 20 | ENEMY1_WALK1_L = 4, 21 | ENEMY1_WALK2_L = 5, 22 | ENEMY1_WALK3_L = 6, 23 | ENEMY1_WALK4_L = 7, 24 | ENEMY1_WALK5_L = 8, 25 | ENEMY1_WALK6_L = 9, 26 | ENEMY1_WALK7_L = 10, 27 | ENEMY1_WALK8_L = 11, 28 | ENEMY1_WALK9_L = 12, 29 | ENEMY1_WALK10_L = 13, 30 | ENEMY1_WALK11_L = 14, 31 | ENEMY1_WALK12_L = 15, 32 | ENEMY1_WALK1_R = 16, 33 | ENEMY1_WALK2_R = 17, 34 | ENEMY1_WALK3_R = 18, 35 | ENEMY1_WALK4_R = 19, 36 | ENEMY1_WALK5_R = 20, 37 | ENEMY1_WALK6_R = 21, 38 | ENEMY1_WALK7_R = 22, 39 | ENEMY1_WALK8_R = 23, 40 | ENEMY1_WALK9_R = 24, 41 | ENEMY1_WALK10_R = 25, 42 | ENEMY1_WALK11_R = 26, 43 | ENEMY1_WALK12_R = 27, 44 | ENEMY2_WALK1_R = 28, 45 | ENEMY2_WALK2_R = 29, 46 | ENEMY2_WALK3_R = 30, 47 | ENEMY2_WALK4_R = 31, 48 | ENEMY2_WALK5_R = 32, 49 | ENEMY2_WALK6_R = 33, 50 | ENEMY2_WALK7_R = 34, 51 | ENEMY2_WALK8_R = 35, 52 | ENEMY2_WALK9_R = 36, 53 | ENEMY2_WALK10_R = 37, 54 | ENEMY2_WALK11_R = 38, 55 | ENEMY2_WALK12_R = 39, 56 | ENEMY2_WALK1_L = 40, 57 | ENEMY2_WALK2_L = 41, 58 | ENEMY2_WALK3_L = 42, 59 | ENEMY2_WALK4_L = 43, 60 | ENEMY2_WALK5_L = 44, 61 | ENEMY2_WALK6_L = 45, 62 | ENEMY2_WALK7_L = 46, 63 | ENEMY2_WALK8_L = 47, 64 | ENEMY2_WALK9_L = 48, 65 | ENEMY2_WALK10_L = 49, 66 | ENEMY2_WALK11_L = 50, 67 | ENEMY2_WALK12_L = 51, 68 | MOVING_PLATFORM = 52, 69 | SAW_1 = 53, 70 | SAW_2 = 54, 71 | SAW_3 = 55, 72 | SAW_4 = 56, 73 | SAW_5 = 57, 74 | SAW_6 = 58, 75 | }; 76 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/world/StaticPath.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 3 | * Copyright (c) 2014 Andy Brown 4 | * Please see website for licensing terms. 5 | */ 6 | 7 | #include "Application.h" 8 | 9 | 10 | /* 11 | * Constructor 12 | */ 13 | 14 | StaticPath::StaticPath(Panel& p,const PathDef& def,uint16_t fpgaSpriteIndex) 15 | : PathBase(p,def,fpgaSpriteIndex) { 16 | 17 | // set change extent 18 | 19 | _easingFunction->setTotalChangeInPosition(static_cast(_def.LastSpriteNumber-_def.FirstSpriteNumber+1)); 20 | } 21 | 22 | 23 | /* 24 | * Update the position using the easing function 25 | */ 26 | 27 | void StaticPath::doUpdate(float time,const Point& /* bgTopLeft */,Point& myPos) { 28 | 29 | float newPosition; 30 | uint16_t newSpriteNumber; 31 | 32 | // the position doesn't change 33 | 34 | myPos.X=_def.StartX; 35 | myPos.Y=_def.StartY; 36 | 37 | // get the new frame index 38 | 39 | switch(_def.EasingInOutMode) { 40 | 41 | case EasingMode::IN: 42 | newPosition=_easingFunction->easeIn(time-_timeBase); 43 | break; 44 | 45 | case EasingMode::OUT: 46 | newPosition=_easingFunction->easeOut(time-_timeBase); 47 | break; 48 | 49 | case EasingMode::INOUT: 50 | newPosition=_easingFunction->easeInOut(time-_timeBase); 51 | break; 52 | 53 | default: 54 | newPosition=0; // not reached 55 | break; 56 | } 57 | 58 | newSpriteNumber=static_cast(newPosition)+_def.FirstSpriteNumber; 59 | 60 | // update the sprite number if the position has changed 61 | 62 | if(newSpriteNumber!=_currentSpriteNumber && newSpriteNumber>=_def.FirstSpriteNumber && newSpriteNumber<=_def.LastSpriteNumber) { 63 | 64 | _currentSpriteNumber=newSpriteNumber; 65 | _currentSpriteDef=&AllSprites.PathSprites[_currentSpriteNumber]; 66 | } 67 | } 68 | 69 | 70 | /* 71 | * Restart this path walk at the given elapsed time 72 | */ 73 | 74 | void StaticPath::restart(float timeBase) { 75 | _currentSpriteNumber=_def.FirstSpriteNumber; 76 | _currentSpriteDef=_spriteArray; 77 | _timeBase=timeBase; 78 | } 79 | 80 | 81 | /* 82 | * Check if this path has finished 83 | */ 84 | 85 | bool StaticPath::hasFinished(float time) const { 86 | return time-_timeBase==_def.EasingDuration; 87 | } 88 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/world/StaticPath.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 3 | * Copyright (c) 2014 Andy Brown 4 | * Please see website for licensing terms. 5 | */ 6 | 7 | #pragma once 8 | 9 | 10 | /* 11 | * Path management class. Will manage the animation of a non-moving sprite 12 | * througout its frames 13 | */ 14 | 15 | class StaticPath : public PathBase { 16 | 17 | public: 18 | StaticPath(Panel& p,const PathDef& def,uint16_t fpgaSpriteIndex); 19 | virtual ~StaticPath() {} 20 | 21 | // overrides from PathBase 22 | 23 | virtual void restart(float timebase) override; 24 | virtual void doUpdate(float time,const Point& bgTopLeft,Point& p); 25 | virtual bool hasFinished(float time) const override; 26 | }; 27 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/world/World.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 3 | * Copyright (c) 2014 Andy Brown 4 | * Please see website for licensing terms. 5 | */ 6 | 7 | #pragma once 8 | 9 | 10 | /* 11 | * Our view of the world for the current level 12 | */ 13 | 14 | class World { 15 | 16 | protected: 17 | const LevelDef& _levelDef; 18 | Panel& _panel; 19 | Background _background; 20 | Actor **_actors; 21 | 22 | public: 23 | World(Panel& panel,const LevelDef& ldef); 24 | ~World(); 25 | 26 | void update(const Buttons& buttons,uint32_t frame_counter); 27 | void createActors(Panel& panel); 28 | }; 29 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/world/defs/ActorDef.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 3 | * Copyright (c) 2014 Andy Brown 4 | * Please see website for licensing terms. 5 | */ 6 | 7 | 8 | #pragma once 9 | 10 | 11 | /* 12 | * Definition of an actor (auto-animated entity) 13 | */ 14 | 15 | struct ActorDef { 16 | AnimationType PathType; // moving or static 17 | 18 | uint8_t PathCount; // number of paths to be followed by this actor 19 | const PathDef *Paths; // array of path definitions 20 | }; 21 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/world/defs/LevelDef.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 3 | * Copyright (c) 2014 Andy Brown 4 | * Please see website for licensing terms. 5 | */ 6 | 7 | #pragma once 8 | 9 | 10 | /* 11 | * Definition of a level 12 | */ 13 | 14 | struct LevelDef { 15 | const uint16_t *Tiles; // The tile array (30*20) 16 | uint16_t ActorCount; // number of actors in the array below 17 | const ActorDef *ActorDefs; // pointer to array of actors 18 | }; 19 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/world/defs/PathDef.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 3 | * Copyright (c) 2014 Andy Brown 4 | * Please see website for licensing terms. 5 | */ 6 | 7 | #pragma once 8 | 9 | 10 | /* 11 | * Definition of an actor's path. A path starts and finishes at a point in the world. The 12 | * path should be horizontal or vertical. The actor is eased between the points using the 13 | * easing function to allow for acceleration and deceleration. 14 | */ 15 | 16 | struct PathDef { 17 | int16_t StartX,StartY; // the starting point in world pixels 18 | int16_t EndX,EndY; // the ending point in world pixels 19 | 20 | uint16_t FirstSpriteNumber; // first sprite index 21 | uint16_t LastSpriteNumber; // last sprite index 22 | 23 | EasingType EasingFunction; // the easing function used to move the sprite 24 | EasingMode EasingInOutMode; // the easing mode (in,out,inout) 25 | float EasingDuration; // total duration, in frames 26 | float EasingParameter1; // optional. used if easing function has parameters 27 | float EasingParameter2; // optional. used if easing function has parameters 28 | }; 29 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/world/defs/SpriteDefs.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 3 | * Copyright (c) 2014 Andy Brown 4 | * Please see website for licensing terms. 5 | */ 6 | 7 | #include "Application.h" 8 | 9 | 10 | /* 11 | * Sprite definitions 12 | */ 13 | 14 | extern const AllSpritesDef AllSprites={ 15 | BACKGROUND_SPRITES_COUNT, 16 | BackgroundSprites, 17 | 18 | PATH_SPRITES_COUNT, 19 | PathSprites 20 | }; 21 | -------------------------------------------------------------------------------- /main/stm32f429/manic_knights/world/defs/SpriteDefs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 3 | * Copyright (c) 2014 Andy Brown 4 | * Please see website for licensing terms. 5 | */ 6 | 7 | 8 | #pragma once 9 | 10 | 11 | /* 12 | * Constants 13 | */ 14 | 15 | enum { 16 | FIRST_PATH_SPRITE = 100 17 | }; 18 | 19 | 20 | /* 21 | * Definition of a background 64x64 sprite 22 | */ 23 | 24 | struct BackgroundSpriteDef { 25 | uint16_t SpriteNumber; 26 | uint32_t FlashAddress; 27 | }; 28 | 29 | 30 | /* 31 | * Definition of a path (moving) sprite. The sprite number is assigned during the initialisation 32 | */ 33 | 34 | struct PathSpriteDef { 35 | uint32_t FlashAddress; 36 | uint16_t PixelWidth; 37 | uint16_t PixelHeight; 38 | }; 39 | 40 | 41 | /* 42 | * All sprites 43 | */ 44 | 45 | struct AllSpritesDef { 46 | uint16_t BackgroundSpritesCount; 47 | const BackgroundSpriteDef *BackgroundSprites; 48 | 49 | uint16_t PathSpritesCount; 50 | const PathSpriteDef *PathSprites; 51 | }; 52 | 53 | extern const AllSpritesDef AllSprites; 54 | -------------------------------------------------------------------------------- /main/stm32f429/sprites_demo/.gitignore: -------------------------------------------------------------------------------- 1 | doc/ 2 | *~ 3 | *.lock 4 | *.DS_Store 5 | *.swp 6 | *.out 7 | *.class 8 | #OS junk files 9 | [Tt]humbs.db 10 | 11 | *.a 12 | *.o 13 | 14 | #Visual Studio files 15 | 16 | *.[Oo]bj 17 | *.user 18 | *.aps 19 | *.pch 20 | *.vspscc 21 | *.vssscc 22 | *_i.c 23 | *_p.c 24 | *.ncb 25 | *.suo 26 | *.tlb 27 | *.tlh 28 | *.bak 29 | *.[Cc]ache 30 | *.ilk 31 | *.log 32 | *.lib 33 | *.sbr 34 | *.sdf 35 | *.opensdf 36 | ipch/ 37 | obj/ 38 | [Bb]in 39 | [Dd]ebug*/ 40 | [Rr]elease*/ 41 | Ankh.NoLoad 42 | 43 | #Tooling 44 | _ReSharper*/ 45 | *.resharper 46 | [Tt]est[Rr]esult* 47 | 48 | #Project files 49 | [Bb]uild/ 50 | 51 | #Subversion files 52 | .svn 53 | 54 | # Office Temp Files 55 | ~$* 56 | 57 | # eclipse local settings 58 | 59 | .settings/ 60 | -------------------------------------------------------------------------------- /main/stm32f429/sprites_demo/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | ase-sprites-demo 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 10 | clean,full,incremental, 11 | 12 | 13 | 14 | 15 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 16 | full,incremental, 17 | 18 | 19 | 20 | 21 | 22 | org.eclipse.cdt.core.cnature 23 | org.eclipse.cdt.core.ccnature 24 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 25 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 26 | 27 | 28 | 29 | common 30 | 2 31 | P:/docs/source/fpga/ase/common/stm32f429 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /main/stm32f429/sprites_demo/SConscript: -------------------------------------------------------------------------------- 1 | # import everything exported in SConstruct 2 | 3 | Import('*') 4 | 5 | # get a copy of the environment 6 | 7 | env=env.Clone(BIT=main_bit) 8 | 9 | # this project name and location 10 | 11 | PROJECT = "sprites_demo" 12 | MYDIR = "main/stm32f429/"+PROJECT 13 | 14 | # collect the source files 15 | 16 | matches=[] 17 | matches.append(Glob("*.cpp")) 18 | matches.append(Glob("*.asm")) 19 | 20 | # append the system startup files 21 | 22 | matches.append("system/LibraryHacks.cpp") 23 | matches.append("system/f429/Startup.asm") 24 | matches.append("system/f429/System.c") 25 | 26 | # assembler flags 27 | 28 | env.Append(ASFLAGS="-I"+MYDIR) 29 | 30 | # here's where the linker script is located 31 | 32 | env.Append(LINKFLAGS="-T"+MYDIR+"/system/f429/Linker.ld") 33 | 34 | # trigger a build with the correct output name 35 | 36 | buildoutdir=MYDIR+"/build/"+mode+"/" 37 | 38 | elf=env.Program(PROJECT+".elf",matches) 39 | hex=env.Command(PROJECT+".hex",elf,"arm-none-eabi-objcopy -O ihex "+buildoutdir+PROJECT+".elf "+buildoutdir+PROJECT+".hex") 40 | bin=env.Command(PROJECT+".bin",elf,"arm-none-eabi-objcopy -O binary "+buildoutdir+PROJECT+".elf "+buildoutdir+PROJECT+".bin") 41 | lst=env.Command(PROJECT+".lst",elf,"arm-none-eabi-objdump -h -S "+buildoutdir+PROJECT+".elf > "+buildoutdir+PROJECT+".lst") 42 | size=env.Command(PROJECT+".size",elf,"arm-none-eabi-size --format=berkeley "+buildoutdir+PROJECT+".elf | tee "+buildoutdir+PROJECT+".size") 43 | 44 | # bitFile.asm includes the output of the FPGA build and scons needs to be told about it 45 | 46 | env.Depends("bitFile.o",env["BIT"]) 47 | 48 | # return the hex file 49 | 50 | Return("hex") 51 | -------------------------------------------------------------------------------- /main/stm32f429/sprites_demo/bitFile.asm: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 3 | * Copyright (c) 2014 Andy Brown 4 | * Please see website for licensing terms. 5 | */ 6 | 7 | .global BitFileStart 8 | .global BitFileSize 9 | 10 | BitFileStart: 11 | .incbin "../../xc3s50/main.bit" 12 | BitFileSize=.-BitFileStart 13 | -------------------------------------------------------------------------------- /main/stm32f429/sprites_demo/system/LibraryHacks.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * LibraryHacks.cpp 3 | * 4 | * Created on: 23 Jan 2011 5 | * Author: Andy 6 | */ 7 | 8 | #include 9 | #include 10 | 11 | 12 | /* 13 | * The default pulls in 70K of garbage 14 | */ 15 | 16 | namespace __gnu_cxx { 17 | 18 | void __verbose_terminate_handler() { 19 | for(;;); 20 | } 21 | } 22 | 23 | 24 | /* 25 | * The default pulls in about 12K of garbage 26 | */ 27 | 28 | extern "C" void __cxa_pure_virtual() { 29 | for(;;); 30 | } 31 | 32 | 33 | /* 34 | * Implement C++ new/delete operators using the heap 35 | */ 36 | 37 | void *operator new(size_t size) { 38 | return malloc(size); 39 | } 40 | 41 | void *operator new(size_t,void *ptr) { 42 | return ptr; 43 | } 44 | 45 | void *operator new[](size_t size) { 46 | return malloc(size); 47 | } 48 | 49 | void *operator new[](size_t,void *ptr) { 50 | return ptr; 51 | } 52 | 53 | void operator delete(void *p) { 54 | free(p); 55 | } 56 | 57 | void operator delete[](void *p) { 58 | free(p); 59 | } 60 | 61 | 62 | /* 63 | * EABI builds can generate reams of stack unwind code for system generated exceptions 64 | * e.g. (divide-by-zero). Since we don't support exceptions we'll wrap out these 65 | * symbols and save a lot of flash space. 66 | */ 67 | 68 | extern "C" void __wrap___aeabi_unwind_cpp_pr0() {} 69 | extern "C" void __wrap___aeabi_unwind_cpp_pr1() {} 70 | extern "C" void __wrap___aeabi_unwind_cpp_pr2() {} 71 | 72 | 73 | /* 74 | * sbrk function for getting space for malloc and friends 75 | */ 76 | 77 | extern int _end; 78 | 79 | extern "C" { 80 | caddr_t _sbrk ( int incr ) { 81 | 82 | static unsigned char *heap = NULL; 83 | unsigned char *prev_heap; 84 | 85 | if (heap == NULL) { 86 | heap = (unsigned char *)&_end; 87 | } 88 | prev_heap = heap; 89 | /* check removed to show basic approach */ 90 | 91 | heap += incr; 92 | 93 | return (caddr_t) prev_heap; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /main/stm32f429/sprites_demo/ux/andysworkshop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/sprites_demo/ux/andysworkshop.png -------------------------------------------------------------------------------- /main/stm32f429/sprites_demo/ux/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/sprites_demo/ux/background.png -------------------------------------------------------------------------------- /main/stm32f429/sprites_demo/ux/convert.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | bm2rgbi=../../../../../../stm32plus/utils/bm2rgbi/bm2rgbi/bin/Release/bm2rgbi.exe 4 | 5 | if [ ! -x ${bm2rgbi} ] ; then 6 | echo "bm2rgbi not found at ${bm2rgbi}" 7 | fi 8 | 9 | offset=0 10 | rm -f spiflash/* 11 | 12 | for i in `ls *.png | sort`; do 13 | 14 | outfile=spiflash/${i%.png}.bin 15 | ${bm2rgbi} $i $outfile r61523 64 > /dev/null 16 | echo $outfile=$offset >> spiflash/index.txt 17 | 18 | filesize=$(stat -c%s $outfile) 19 | offset=$(($offset+$filesize)) 20 | offset=$(((($offset/256)+1)*256)) 21 | 22 | echo $i $filesize $offset 23 | 24 | done 25 | -------------------------------------------------------------------------------- /main/stm32f429/sprites_demo/ux/left1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/sprites_demo/ux/left1.png -------------------------------------------------------------------------------- /main/stm32f429/sprites_demo/ux/left2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/sprites_demo/ux/left2.png -------------------------------------------------------------------------------- /main/stm32f429/sprites_demo/ux/left3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/sprites_demo/ux/left3.png -------------------------------------------------------------------------------- /main/stm32f429/sprites_demo/ux/right1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/sprites_demo/ux/right1.png -------------------------------------------------------------------------------- /main/stm32f429/sprites_demo/ux/right2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/sprites_demo/ux/right2.png -------------------------------------------------------------------------------- /main/stm32f429/sprites_demo/ux/right3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/sprites_demo/ux/right3.png -------------------------------------------------------------------------------- /main/stm32f429/sprites_demo/ux/spiflash/andysworkshop.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/sprites_demo/ux/spiflash/andysworkshop.bin -------------------------------------------------------------------------------- /main/stm32f429/sprites_demo/ux/spiflash/background.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/sprites_demo/ux/spiflash/background.bin -------------------------------------------------------------------------------- /main/stm32f429/sprites_demo/ux/spiflash/index.txt: -------------------------------------------------------------------------------- 1 | spiflash/andysworkshop.bin=0 2 | spiflash/background.bin=90624 3 | spiflash/left1.bin=551680 4 | spiflash/left2.bin=553984 5 | spiflash/left3.bin=556288 6 | spiflash/right1.bin=558592 7 | spiflash/right2.bin=560896 8 | spiflash/right3.bin=563200 9 | -------------------------------------------------------------------------------- /main/stm32f429/sprites_demo/ux/spiflash/left1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/sprites_demo/ux/spiflash/left1.bin -------------------------------------------------------------------------------- /main/stm32f429/sprites_demo/ux/spiflash/left2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/sprites_demo/ux/spiflash/left2.bin -------------------------------------------------------------------------------- /main/stm32f429/sprites_demo/ux/spiflash/left3.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/sprites_demo/ux/spiflash/left3.bin -------------------------------------------------------------------------------- /main/stm32f429/sprites_demo/ux/spiflash/right1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/sprites_demo/ux/spiflash/right1.bin -------------------------------------------------------------------------------- /main/stm32f429/sprites_demo/ux/spiflash/right2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/sprites_demo/ux/spiflash/right2.bin -------------------------------------------------------------------------------- /main/stm32f429/sprites_demo/ux/spiflash/right3.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andysworkshop/ase/98b272e97f3dd09599e40cbcb4596b7ba0f0adb3/main/stm32f429/sprites_demo/ux/spiflash/right3.bin -------------------------------------------------------------------------------- /main/xc3s50/.gitignore: -------------------------------------------------------------------------------- 1 | clock_generator.vhdl 2 | clock_generator_arwz.ucf 3 | command_fifo.vhd 4 | command_fifo/ 5 | main.bit 6 | nextx_adder.vhd 7 | nextx_adder/ 8 | sprite_memory.vhd 9 | sprite_memory/ 10 | sram_addr_adder.vhd 11 | sram_addr_adder/ 12 | usage_statistics_webtalk.html 13 | fuse.xmsgs 14 | fuseRelaunch.cmd 15 | isim/ 16 | 17 | ise 18 | tmp 19 | xst 20 | xlnx_auto_0_xdb 21 | _ngo 22 | _xmsgs 23 | *.bit 24 | *.lso 25 | *.ngd 26 | *_map.ngm 27 | *.ngr 28 | *.pad 29 | *.par 30 | *.twr 31 | *.xpi 32 | *.bgn 33 | *.drc 34 | *.ptwx 35 | *.twx 36 | *.unroutes 37 | *_map.ncd 38 | *.ncd 39 | *_bitgen.xwbt 40 | *.bld 41 | *_map.mrp 42 | *_map.map 43 | *_pad.csv 44 | *.pcf 45 | *_vhdl.prj 46 | *.ngc 47 | *.asy 48 | *.gise 49 | *.log 50 | *.tcl 51 | *.cgc 52 | *.txt 53 | *.xml 54 | *.vho 55 | *.xrpt 56 | *.xise 57 | *.psr 58 | -------------------------------------------------------------------------------- /main/xc3s50/coregen.cgp: -------------------------------------------------------------------------------- 1 | SET busformat = BusFormatAngleBracketNotRipped 2 | SET designentry = VHDL 3 | SET device = xc3s50 4 | SET devicefamily = spartan3 5 | SET flowvendor = Other 6 | SET package = vq100 7 | SET speedgrade = -5 8 | SET verilogsim = false 9 | SET vhdlsim = true 10 | -------------------------------------------------------------------------------- /main/xc3s50/frame_counter.vhdl: -------------------------------------------------------------------------------- 1 | -- This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 2 | -- Copyright (c) 2014 Andy Brown 3 | -- Please see website for licensing terms. 4 | 5 | library ieee; 6 | 7 | use ieee.std_logic_1164.all; 8 | use ieee.numeric_std.all; 9 | 10 | use work.constants.all; 11 | use work.functions.all; 12 | 13 | 14 | -- 15 | -- frame_counter toggles a 0/1 counter each time the TE signal is positively asserted high 16 | -- 17 | 18 | entity frame_counter is 19 | port( 20 | 21 | -- inputs 22 | 23 | clk100 : in std_logic; -- 100MHz clock 24 | reset : in std_logic; -- synchronous reset 25 | lcd_te : in std_logic; -- TE signal from the LCD 26 | 27 | -- outputs 28 | 29 | frame_index : out std_logic -- 0/1 frame index 30 | ); 31 | end entity frame_counter; 32 | 33 | architecture behavioural of frame_counter is 34 | 35 | signal frame_index_i : std_logic := '0'; 36 | signal lcd_te_sreg_i : std_logic_vector(1 to 3) := (others => '0'); 37 | 38 | begin 39 | 40 | -- register the output 41 | 42 | frame_index <= frame_index_i; 43 | 44 | process(clk100,reset) is 45 | begin 46 | 47 | if rising_edge(clk100) then 48 | 49 | if reset = '1' then 50 | 51 | -- set the frame index back to zero and clear the shift register 52 | 53 | frame_index_i <= '0'; 54 | lcd_te_sreg_i <= (others => '0'); 55 | 56 | else 57 | 58 | -- if TE is definitely asserted then advance a frame 59 | 60 | if lcd_te_sreg_i(2) = '1' and lcd_te_sreg_i(3) = '0' then 61 | frame_index_i <= not frame_index_i; 62 | end if; 63 | 64 | -- shift the register to the left and shift in the current state 65 | 66 | lcd_te_sreg_i <= lcd_te & lcd_te_sreg_i(1 to 2); 67 | 68 | end if; 69 | 70 | end if; 71 | 72 | end process; 73 | 74 | end architecture behavioural; 75 | -------------------------------------------------------------------------------- /main/xc3s50/lcd_arbiter.vhdl: -------------------------------------------------------------------------------- 1 | -- This file is a part of the firmware supplied with Andy's Workshop Sprite Engine (ASE) 2 | -- Copyright (c) 2014 Andy Brown 3 | -- Please see website for licensing terms. 4 | 5 | library ieee; 6 | library unisim; 7 | 8 | use ieee.std_logic_1164.all; 9 | use ieee.numeric_std.all; 10 | use unisim.vcomponents.all; 11 | 12 | use work.constants.all; 13 | use work.functions.all; 14 | 15 | 16 | -- 17 | -- manage ownership of the LCD bi-directional data bus. mode_passthrough 18 | -- grants ownership to lcd_sender and mode_sprite grants access to frame_writer 19 | -- 20 | 21 | entity lcd_arbiter is 22 | 23 | port( 24 | 25 | -- inputs 26 | 27 | clk100 : in std_logic; -- 100MHz clock 28 | mode : in mode_t; -- mode_sprite or mode_passthrough 29 | 30 | lcd_sender_db : in lcd_bus_t; -- lcd_sender's desired data bus 31 | lcd_sender_wr : in std_logic; -- lcd_sender's desired WR flag 32 | lcd_sender_ale : in std_logic; -- lcd_sender's ALE flag 33 | lcd_sender_rs : in std_logic; -- lcd_sender's RS signal 34 | 35 | frame_writer_db : in lcd_bus_t; -- frame_writer's desired data bus 36 | frame_writer_wr : in std_logic; -- frame_writer's WR flag 37 | frame_writer_ale : in std_logic; -- frame_writer's ALE flag 38 | 39 | -- outputs 40 | 41 | lcd_db : out lcd_bus_t; -- the selected data for the LCD bus 42 | lcd_wr : out std_logic; -- the selected LCD WR signal 43 | lcd_ale : out std_logic; -- the selected ALE signal 44 | lcd_rs : out std_logic -- the selected RS signal 45 | ); 46 | 47 | end lcd_arbiter; 48 | 49 | architecture behavioral of lcd_arbiter is 50 | 51 | begin 52 | 53 | process(clk100) is 54 | begin 55 | 56 | if rising_edge(clk100) then 57 | 58 | -- make the output selection based on the current mode 59 | 60 | if mode = mode_passthrough then 61 | 62 | lcd_db <= lcd_sender_db; 63 | lcd_wr <= lcd_sender_wr; 64 | lcd_ale <= lcd_sender_ale; 65 | lcd_rs <= lcd_sender_rs; 66 | 67 | else 68 | 69 | lcd_db <= frame_writer_db; 70 | lcd_wr <= frame_writer_wr; 71 | lcd_ale <= frame_writer_ale; 72 | lcd_rs <= '1'; -- frame_writer is always sending data 73 | 74 | end if; 75 | 76 | end if; 77 | 78 | end process; 79 | 80 | end behavioral; 81 | -------------------------------------------------------------------------------- /main/xc3s50/main.prj: -------------------------------------------------------------------------------- 1 | vhdl work "sram_addr_adder.vhd" 2 | vhdl work "nextx_adder.vhd" 3 | vhdl work "sprite_memory.vhd" 4 | vhdl work "command_fifo.vhd" 5 | vhdl work "constants.vhdl" 6 | vhdl work "functions.vhdl" 7 | vhdl work "sprite_writer.vhdl" 8 | vhdl work "reset_conditioner.vhdl" 9 | vhdl work "mcu_interface.vhdl" 10 | vhdl work "lcd_sender.vhdl" 11 | vhdl work "lcd_arbiter.vhdl" 12 | vhdl work "frame_writer.vhdl" 13 | vhdl work "frame_counter.vhdl" 14 | vhdl work "clock_generator.vhdl" 15 | vhdl work "main.vhdl" 16 | -------------------------------------------------------------------------------- /main/xc3s50/main.ut: -------------------------------------------------------------------------------- 1 | -w 2 | -g Binary:no 3 | -g CRC:Enable 4 | -g ConfigRate:6 5 | -g CclkPin:PullUp 6 | -g M0Pin:PullUp 7 | -g M1Pin:PullUp 8 | -g M2Pin:PullUp 9 | -g ProgPin:PullUp 10 | -g DonePin:PullUp 11 | -g HswapenPin:PullUp 12 | -g TckPin:PullUp 13 | -g TdiPin:PullUp 14 | -g TdoPin:PullUp 15 | -g TmsPin:PullUp 16 | -g UnusedPin:PullDown 17 | -g UserID:0xFFFFFFFF 18 | -g DCMShutdown:Disable 19 | -g DCIUpdateMode:AsRequired 20 | -g StartUpClk:CClk 21 | -g DONE_cycle:4 22 | -g GTS_cycle:5 23 | -g GWE_cycle:6 24 | -g LCK_cycle:NoWait 25 | -g Match_cycle:Auto 26 | -g Security:None 27 | -g DonePipe:Yes 28 | -g DriveDone:No 29 | -------------------------------------------------------------------------------- /main/xc3s50/main.xst: -------------------------------------------------------------------------------- 1 | set -tmpdir "tmp/xst/projnav.tmp" 2 | set -xsthdpdir "xst" 3 | run 4 | -ifn main.prj 5 | -ifmt mixed 6 | -ofn main 7 | -ofmt NGC 8 | -p xc3s50-5-vq100 9 | -top main 10 | -opt_mode Speed 11 | -opt_level 1 12 | -iuc NO 13 | -keep_hierarchy No 14 | -netlist_hierarchy As_Optimized 15 | -rtlview Yes 16 | -glob_opt AllClockNets 17 | -read_cores YES 18 | -sd {"ipcore_dir" } 19 | -write_timing_constraints NO 20 | -cross_clock_analysis NO 21 | -hierarchy_separator / 22 | -bus_delimiter <> 23 | -case Maintain 24 | -slice_utilization_ratio 100 25 | -bram_utilization_ratio 100 26 | -verilog2001 YES 27 | -fsm_extract YES -fsm_encoding Auto 28 | -safe_implementation No 29 | -fsm_style LUT 30 | -ram_extract Yes 31 | -ram_style Auto 32 | -rom_extract Yes 33 | -mux_style Auto 34 | -decoder_extract YES 35 | -priority_extract Yes 36 | -shreg_extract YES 37 | -shift_extract YES 38 | -xor_collapse YES 39 | -rom_style Auto 40 | -auto_bram_packing NO 41 | -mux_extract Yes 42 | -resource_sharing YES 43 | -async_to_sync NO 44 | -mult_style Auto 45 | -iobuf YES 46 | -max_fanout 500 47 | -bufg 8 48 | -register_duplication YES 49 | -register_balancing No 50 | -slice_packing YES 51 | -optimize_primitives NO 52 | -use_clock_enable Yes 53 | -use_sync_set Yes 54 | -use_sync_reset Yes 55 | -iob Auto 56 | -equivalent_register_removal YES 57 | -slice_utilization_ratio_maxmargin 5 58 | -------------------------------------------------------------------------------- /main/xc3s50/maplog: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | less main_map.map -------------------------------------------------------------------------------- /main/xc3s50/nextx_adder.xco: -------------------------------------------------------------------------------- 1 | ############################################################## 2 | # 3 | # Xilinx Core Generator version 14.7 4 | # Date: Fri Jul 25 19:21:57 2014 5 | # 6 | ############################################################## 7 | # 8 | # This file contains the customisation parameters for a 9 | # Xilinx CORE Generator IP GUI. It is strongly recommended 10 | # that you do not manually alter this file as it may cause 11 | # unexpected and unsupported behavior. 12 | # 13 | ############################################################## 14 | # 15 | # Generated from component: xilinx.com:ip:c_addsub:11.0 16 | # 17 | ############################################################## 18 | # 19 | # BEGIN Project Options 20 | SET addpads = false 21 | SET asysymbol = true 22 | SET busformat = BusFormatAngleBracketNotRipped 23 | SET createndf = false 24 | SET designentry = VHDL 25 | SET device = xc3s50 26 | SET devicefamily = spartan3 27 | SET flowvendor = Other 28 | SET formalverification = false 29 | SET foundationsym = false 30 | SET implementationfiletype = Ngc 31 | SET package = vq100 32 | SET removerpms = false 33 | SET simulationfiles = Behavioral 34 | SET speedgrade = -5 35 | SET verilogsim = false 36 | SET vhdlsim = true 37 | # END Project Options 38 | # BEGIN Select 39 | SELECT Adder_Subtracter xilinx.com:ip:c_addsub:11.0 40 | # END Select 41 | # BEGIN Parameters 42 | CSET a_type=Unsigned 43 | CSET a_width=9 44 | CSET add_mode=Add 45 | CSET ainit_value=0 46 | CSET b_constant=false 47 | CSET b_type=Unsigned 48 | CSET b_value=000000000 49 | CSET b_width=9 50 | CSET borrow_sense=Active_Low 51 | CSET bypass=false 52 | CSET bypass_ce_priority=CE_Overrides_Bypass 53 | CSET bypass_sense=Active_High 54 | CSET c_in=false 55 | CSET c_out=false 56 | CSET ce=false 57 | CSET component_name=nextx_adder 58 | CSET implementation=Fabric 59 | CSET latency=1 60 | CSET latency_configuration=Manual 61 | CSET out_width=9 62 | CSET sclr=false 63 | CSET sinit=false 64 | CSET sinit_value=0 65 | CSET sset=false 66 | CSET sync_ce_priority=Sync_Overrides_CE 67 | CSET sync_ctrl_priority=Reset_Overrides_Set 68 | # END Parameters 69 | # BEGIN Extra information 70 | MISC pkg_timestamp=2013-07-22T10:35:41Z 71 | # END Extra information 72 | GENERATE 73 | # CRC: b4d05e57 74 | -------------------------------------------------------------------------------- /main/xc3s50/parlog: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | less main.par -------------------------------------------------------------------------------- /main/xc3s50/reset_conditioner.vhdl: -------------------------------------------------------------------------------- 1 | library ieee; 2 | 3 | use ieee.std_logic_1164.all; 4 | use ieee.numeric_std.all; 5 | 6 | 7 | -- 8 | -- the reset_conditioner module accepts the raw 'reset' signal and the clock. it outputs 9 | -- 'conditioned_reset' which will be '1' while 'reset' has been '1' for at least 6 clock ticks 10 | -- 11 | 12 | entity reset_conditioner is 13 | port( 14 | clk100 : in std_logic; 15 | reset : in std_logic; 16 | conditioned_reset : out std_logic 17 | ); 18 | end reset_conditioner; 19 | 20 | architecture behavioral of reset_conditioner is 21 | 22 | signal sreg_i : std_logic_vector(5 downto 0) := (others => '0'); 23 | signal conditioned_reset_i : std_logic := '0'; 24 | 25 | begin 26 | 27 | -- register the output 28 | 29 | conditioned_reset <= conditioned_reset_i; 30 | 31 | -- this process uses a shift register to keep a short history of consecutive 32 | -- reset states. when we've seen reset continually high for 6 cycles then 33 | -- we'll consider it done. 34 | 35 | conditioner : process(clk100) is 36 | begin 37 | 38 | if rising_edge(clk100) then 39 | 40 | if sreg_i = "111111" then 41 | conditioned_reset_i <= '1'; 42 | else 43 | conditioned_reset_i <= '0'; 44 | end if; 45 | 46 | -- shift in the new state on the right 47 | 48 | sreg_i <= sreg_i(4 downto 0) & reset; 49 | 50 | end if; 51 | 52 | end process conditioner; 53 | 54 | end behavioral; 55 | -------------------------------------------------------------------------------- /main/xc3s50/simulate: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use strict; 4 | use warnings; 5 | 6 | # 7 | # set the Xilinx directory if not already set. This must be windows format if on cygwin under Windows 8 | # 9 | 10 | if(!defined $ENV{'XILINX'}) { 11 | print "WARNING: XILINX environment variable not set, using Windows default.\n"; 12 | $ENV{"XILINX"} = "c:\\Xilinx\\14.7\\ISE_DS\\ISE"; 13 | } 14 | 15 | # 16 | # check args 17 | # 18 | 19 | die("Usage: simulate