packages feed

lazyboy 0.2.1.1 → 0.2.2.0

raw patch · 4 files changed

+54/−19 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Lazyboy.Prelude: (&&) :: Lazyboy Condition -> Lazyboy Condition -> Lazyboy Condition
+ Lazyboy.Prelude: (/=) :: Comparable a b => a -> b -> Lazyboy Condition
+ Lazyboy.Prelude: (<) :: Comparable a b => a -> b -> Lazyboy Condition
+ Lazyboy.Prelude: (==) :: Comparable a b => a -> b -> Lazyboy Condition
+ Lazyboy.Prelude: (>) :: Comparable a b => a -> b -> Lazyboy Condition
+ Lazyboy.Prelude: (||) :: Lazyboy Condition -> Lazyboy Condition -> Lazyboy Condition

Files

ChangeLog.md view
@@ -1,5 +1,10 @@ # Changelog for Lazyboy +# 0.2.2.0+- Added a Prelude module which provides overloaded operators.+- Updated the example in Main.hs to use the newer syntax.+- Updated README to match the newer syntax.+ # 0.2.1.1 - Added a lot of instruction tests and fix some bugs. 
README.md view
@@ -11,28 +11,16 @@ Currently, RGBASM is the only output target, but in the future native machine code generation is planned.  Syntax example (will be updated as more complex constructs are added):+ ```haskell main :: IO () main = rom >>= T.putStrLn     where rom = compileROM $ do-            smiley <- embedBytes image-            -- set scroll values-            write (Address scx) 0-            write (Address scy) 0-            -- set background palette-            setBackgroundPalette defaultPalette-            -- perform graphics operations-            onVblank $ do-                disableLCD-                memcpy (Name smiley) (Address $ 0x9010) $ fromIntegral $ length image-                memset (Address 0x9904) (0x992F - 0x9904) 0 -- clear the background tilemap-                write (Address background1) 1 -- write the background tile data-                setLCDControl $ defaultLCDControl { lcdDisplayEnable = True, lcdBackgroundEnable = True }-            -- halt indefinitely+            byte A 0xDE+            byte B 0xDE+            if' ((A == (0xDE :: Word8)) && (A == B)) $ do+                write (Address wram0) 0xDE             freeze--image :: [Word8]-image = [0x00,0x00,0x00,0x00,0x24,0x24,0x00,0x00,0x81,0x81,0x7e,0x7e,0x00,0x00,0x00,0x00] ```  See `app/Main.hs` for a full usage example.
lazyboy.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 4e2f866c2ce7b498a6ca6022a042bf2cacb83928127a1e6c802abd72499ef0d8+-- hash: 2c2f36e2503c75ae0efa9de0982175bc15ad7cc3ae2fd5a750d71f5248abbeb0  name:           lazyboy-version:        0.2.1.1+version:        0.2.2.0 synopsis:       An EDSL for programming the Game Boy. description:    An EDSL for programming the Nintendo Game Boy. <https://github.com/ix/lazyboy#readme> category:       DSL, Compiler@@ -35,6 +35,7 @@       Lazyboy.Constants       Lazyboy.Control       Lazyboy.IO+      Lazyboy.Prelude       Lazyboy.Target.ASM       Lazyboy.Types   other-modules:
+ src/Lazyboy/Prelude.hs view
@@ -0,0 +1,41 @@+{-|+    Module      : Lazyboy.Prelude+    Description : Convenience aliases for Lazyboy which share names with Haskell's Prelude.+    Copyright   : (c) Rose 2019+    License     : BSD3+    Maintainer  : rose@lain.org.uk+    Stability   : experimental+    Portability : POSIX++    This module defines aliases for Lazyboy functions which share names with entities in Haskell's+    Prelude library. These are presented for the user to optionally import.+-}++module Lazyboy.Prelude where++import Lazyboy (Condition, Lazyboy, Comparable)+import qualified Lazyboy.Control as Lazyboy++-- | Overload the == (equality) operator for use in Lazyboy.+(==) :: Comparable a b => a -> b -> Lazyboy Condition+(==) = Lazyboy.equalTo++-- | Overload the /= (inequality) operator for use in Lazyboy.+(/=) :: Comparable a b => a -> b -> Lazyboy Condition+(/=) = Lazyboy.notEqualTo++-- | Overload the > (greater than) operator for use in Lazyboy.+(>) :: Comparable a b => a -> b -> Lazyboy Condition+(>) = Lazyboy.greaterThan++-- | Overload the < (lesser than) operator for use in Lazyboy.+(<) :: Comparable a b => a -> b -> Lazyboy Condition+(<) = Lazyboy.lessThan++-- | Overload the && (AND) operator for use in Lazyboy.+(&&) :: Lazyboy Condition -> Lazyboy Condition -> Lazyboy Condition+(&&) = Lazyboy.and++-- | Overload the || (OR) operator for use in Lazyboy.+(||) :: Lazyboy Condition -> Lazyboy Condition -> Lazyboy Condition+(||) = Lazyboy.or