1. 05 Aug, 2011 1 commit
    • Jeffrey Lee's avatar
      Update to work with zero page relocation · efbbc508
      Jeffrey Lee authored
        Sources/SprExtend - Try using OS_ReadSysInfo 6 to get ECF block addresses before falling back on legacy addresses. Store pointers in module workspace for speedy access.
        Sources/SprOp, Sources/SprTrans - Use workspace ECF block pointers
        c/rojpeg - Fix null pointer access (actually an unused variable)
        Tested on rev A2 BB-xM
      Version 1.46. Tagged as 'SprExtend-1_46'
  2. 20 Jul, 2011 2 commits
    • Robert Sprowson's avatar
      Revise strictness of sprite area checking. · 1fcbc76a
      Robert Sprowson authored
      Those SpriteOps that modify the sprite input now
      * R0=&0-&FF R1=don't care R2=mustn't be too low down
      * R0=&100-&1FF R1=must be valid R2=mustn't be too low down
      * R0=&200-&2FF R1=must be valid R2=must be valid
      Those SpriteOps that just display but don't modify the input sprite
      * R0=&0-&FF R1=don't care R2=mustn't be too low down
      * R0=&100-&1FF R1=must be valid R2=mustn't be too low down
      * R0=&200-&2FF R1=don't care R2=must be valid
      In this context, valid means word aligned and not too low down.
      In this context, too low down is anything below &100.
      Version 1.45. Tagged as 'SprExtend-1_45'
    • Robert Sprowson's avatar
  3. 10 Jul, 2011 1 commit
  4. 09 Jul, 2011 1 commit
  5. 25 Jun, 2011 1 commit
    • Jeffrey Lee's avatar
      Make SpriteExtend perform sanity checks on sprite/area pointers · 25b0870e
      Jeffrey Lee authored
        Sources/SprExtend - Added new CheckAlignedAndSensible macro to make it easy to check pointers. Pointers which aren't word aligned or are less than 256 are considered bad.
        Sources/SprOp - Update findsprite, getspritename and getspriteaddr to check sprite/area/name pointers for validity. Sprite names are the only ones that are allowed to not be word aligned.
        Tested on rev A2 BB-xM.
      Version 1.43. Tagged as 'SprExtend-1_43'
  6. 14 Apr, 2011 2 commits
    • Ben Avison's avatar
      Added !ptr_test demonstrator/test harness. · 1a702ba7
      Ben Avison authored
      Retagged as 'SprExtend-1_42'
    • Ben Avison's avatar
      Fixed set active coord from mask in OS_SpriteOp 36 (set pointer shape) · de25c04d
      Ben Avison authored
        Page 33 of the RiscOS 3 volume 3 Programmers manual states that the
        active point can be set from the sprite's mask. This was never
        implemented but it is very useful as it means that the active point
        is no longer hardwired into programs but dependant on the sprite
        The obvious problem is ptr_write. At present the active point is at
        the top left. If you run !ptr_test and run the pointer over the
        'standard active point position' writable icons from the bottom you
        will see that the pointer changes to an I with its top at the bottom
        of the writable icon. If you move the pointer until the top of the I
        is just inside the upper writable icon of the 2 and click, the focus
        goes into the upper writable - not what you'd expect.
        Similarly it's difficult to place the caret between the 2 lls in
        will. The bottom two icons shows the difference with the active
        point in the correct position in the I beam.
        You could change the wimp to put the caret in the correct position
        like I have in the bottom 2 writables of !Ptr_test however this
        would have the wrong active point position if the mode had
        rectangular y pixels and it wouldn't fix all instances where
        programmers had set ther own values.
        It also means that themes can change the pointer active point as
        well as the shape.
        The routine added copes with old and new type sprites of any bit depth though
        OS_SpriteOp 36 has a 8bit limit.
        Tested on Iyonix 5.17.
        Colin Granville
      Version 1.42. Tagged as 'SprExtend-1_42'
  7. 14 Mar, 2011 1 commit
  8. 13 Feb, 2011 1 commit
  9. 11 Jan, 2011 1 commit
    • Robert Sprowson's avatar
      Fix bug in JPEG vetting, tag 0xC4 was being taken as an SOF and quitting the... · c6b8eb1b
      Robert Sprowson authored
      Fix bug in JPEG vetting, tag 0xC4 was being taken as an SOF and quitting the tag scanning loop, which in turn rejected the JPEG as 0xC4 isn't a supported SOF type. In fact, it's not even an SOF type at all. See new IS_AN_SOF macro.
      Fix bug leaving JPEG file handle open when unknown SOF or entropy encoding encountered (spotted testing the above).
      Version 1.39. Tagged as 'SprExtend-1_39'
  10. 23 Dec, 2010 1 commit
    • Robert Sprowson's avatar
      Retire unused IJG version 4 files. · 008a1606
      Robert Sprowson authored
      Fold RISC OS specific colour conversion routines into rojpeg.
      Remove jcconv, this also highlighted there were some more unused functions.
      Should make move to IJG version 8 even easier.
      Version 1.38. Tagged as 'SprExtend-1_38'
  11. 22 Dec, 2010 1 commit
    • Robert Sprowson's avatar
      Reorganise rojpeg. · e5be19dd
      Robert Sprowson authored
      Aside from moving blocks around and adding comments, decisions about numcomponents use switch/case statements to allow CMYK support in the future.
      Split out (some of the) Huffman decoding to allow arithmetic support in the future.
      Moved memcpy() and memset() into CSupport.
      Tested in all colour depths with 1x1; 1x2; 2x1; 2x2 sampling & ChangeFSI.
      Tighten up check on cinfo being NULL (was previously only checked in the colour decoder, not the monochrome).
      Version 1.37. Tagged as 'SprExtend-1_37'
  12. 14 Nov, 2010 2 commits
    • Robert Sprowson's avatar
      Obey bit 0 of JPEG_[File]Info flags. · 009a0332
      Robert Sprowson authored
      When clear, r2 and r3 are preserved per PRM documentation.
      Also BIC'd out bits 7-10 of r0 on return so they can be reused in future, previous version would always have returned &C in those bits.
      Version 1.36. Tagged as 'SprExtend-1_36'
    • Robert Sprowson's avatar
      API enhancement and space saving refactoring. · 8f1ed4bb
      Robert Sprowson authored
      Setting bit 1 of r0 in JPEG_FileInfo and JPEG_Info will now return the SOF type of the JPEG in question in bits 3-6 of the info flags in r0 on exit.
      Took this opportunity to refactor find_image_dims to take a structure pointer rather than lots of individual pointers (CFSI-JPEG ammended to match). Untangled the return codes a bit so it is only necessary to inspect r0 on exit from C to determine the outcome. Values of 1 & 2 are translated in the assembler code into more specific error messages than just "Incomplete or corrupt JPEG".
      Fix bug where unknown density marker would leave the file open in JPEG_FileInfo.
      Don't bother ADRL'ing r1 for error messages that don't have a %0 in them.
      Added all the input & output flag definitions to the exported header file so other callers can use them too.
      More functionality, fewer bugs, about 200 bytes smaller too.
      Version 1.35. Tagged as 'SprExtend-1_35'
  13. 06 Nov, 2010 1 commit
    • Robert Sprowson's avatar
      Fix infinite loop when unrecognised entropy encoding encountered. · b0a63e28
      Robert Sprowson authored
      In find_image_dims() the while loop is only exited when SOF0 or SOF1 (the two supported ones) is encountered, the other 14 possible combinations got stuck in a loop because OS_GBPB doesn't return an error at EOF.
      Check added for OS_GBPB returning nothing, plus an exit when a SOS or EOI tag is hit for the memory only check (it's not possible to know where the end truly is in that case.
      jcconv: warning supressed.
      SWIs: comment corrected.
      Tested with a bogus SOF, now gives an error message instead.
      Version 1.34. Tagged as 'SprExtend-1_34'
  14. 17 Oct, 2010 1 commit
    • Robert Sprowson's avatar
      Change memory management strategy. · a4a91aff
      Robert Sprowson authored
      There's no need for the C code to know which pool of memory it's using, so simplify it to just use malloc() and realloc(), the assembler implementation can then select whether the RMA or a dynamic area is in use based on the 'dynamicarea' switch.
      Be more careful about area_number when it is zero, since we use that to denote the area is not yet set up but area zero is a valid dynamic area number!
      Trim out some unused workspace.
      Variable ccompiler_errptr had '# 0' bytes assigned, resulting in writes off the end of the workspace.
      Retire DUMPVAL[N]() macro.
      Remove M_SOF9 as one of the SOF markers accepted - this is allocated to arithmetic JPEGs which aren't currently supported.
      Save a few words by: changing arbitrary constants (eg. safety margins) to be a power of two so they can be register immediates; numerous loads and stores of R12 relative variables changed to not use ADRL; jpeg_fetchroutine similarly simplified.
      Version 1.33. Tagged as 'SprExtend-1_33'
  15. 13 Oct, 2010 1 commit
    • Robert Sprowson's avatar
      Paper and fill some JPEG cracks. · 06d6b99e
      Robert Sprowson authored
      The exit_c function was repeatedly being called with the line number argument and error code the wrong way round and since only bits 0-2 of the error code are inspected on exit any fatal exits from the ported JPEG library code would either report the wrong error or fail silently (depending on the line number) - example a 12 bits per sample JPEG would be rendered without fault into a screen full of random memory garbage.
      Assembling/compiling with the 'jpeg' switch off didn't work, fixed, and also now zeros out the SWI decode values in the module header.
      Moved include of 'yuvtabs.s' into the colour conversion code.
      Deleted panic_exit, it did nothing useful but trace a value then exit, so it now just calls exit() like everyone else.
      Removed excess call to find_image_dims(), this was needed just to get the workspace requirements when the JPEG had already been sized up by asm_find_image_dims() earlier. Side effect of removing the pilot JPEG code earlier is that this call can now only get to the JPEG code from a JPEG_ SWI. Changed to just pass the workspace requirements into 'c.PutScaled' and save a duplicate scan.
      Fatal exits from the assembler huffman decoder now report a sensible error.
      Trimmed out all the JPEG assessment code from 'c.PutScaled' and moved it into 'c.rojpeg' so the put scaled is only concerned with putting things scaled.
      Sanitised the #includes a bit.
      Fixed on last check of wp->save_mode looking at the wrong bits for the mode number.
      Resolved all the warning in the genhdr/genyuvtabs/genpalette utilities by casting a bit harder.[A[B
      Added new more descriptive error messages to the messages file (not currently used), and made the 'not supported by' ones consistent so the tokeniser might crunch the file a bit more.
      In looks_like_jpeg() changed a bitwise to logical or.
      Fixed longstanding problem of not being able to render JPEGs at a scale of less than 1/6 in any greyscale mode, because, err, there was no code to do it - only the colour case was checked for. Implemented for 8bpp grey and 32bpp grey (which gets dithered for other lower modes) by just converting the luma channel into an equally weighted RGB value or replicating it for 256 greys.
      Tested in all 8 colour depths on a Risc PC using sampling ratios of 1x1; 2x1; 1x2; 2x2 of the IJG test image scaled in !Draw by 0.16.
      Version 1.32. Tagged as 'SprExtend-1_32'
  16. 07 Oct, 2010 1 commit
  17. 29 Sep, 2010 1 commit
    • Robert Sprowson's avatar
      Remove pilot JPEG code. · 1a4e51bd
      Robert Sprowson authored
      During the original development (referred to in the docs as Sprite Extend 2) JPEG data was briefly wrapped inside a sprite file before the JPEG_ swis were introduced. Within SpriteExtend some code still remained to fake a mode 20 sprite header with the JPEG output sized adjusted as though it was 4bpp, then later undo the faking by checking for a mode 20 sprite with is_it_jpeg set.
      This version removes all of the code looking out for pilot JPEGs, and rationalises the fake sprite header to just report the true X/Y size.
      Fix bug where r4 would be corrupted on exit from JPEG_PlotScaled if an error occurred, and generally rationalised the exit cases a bit more sensibly.
      Made the JPEG_ swi despatch a bit more simple to follow.
      Corrected a comment in the NSM_bpptable.
      Deleted unused 'ecfspace' from the workspace.
      Hid the 'macroword' from the C code as it's now an assembler only value.
      Cut the initial comments from c/putscaled and placed in Docs.
      Cut the debug tracing code (a notable %age) from c/putscaled and placed in tracing support file.
      Simplified the entry to putscaled_compiler() now we don't have to look out for pilot format JPEGs within sprites any more.
      Sprinkled in some block comments to make navigating the c/putscaled file a bit easier.
      Version 1.30. Tagged as 'SprExtend-1_30'
  18. 25 Sep, 2010 3 commits
    • Robert Sprowson's avatar
      Copy 'n' paste of an EXPORT twice corrected. · f5f4b53d
      Robert Sprowson authored
      Retagged as SprExtend-1_29.
    • Robert Sprowson's avatar
      Reinstate mungeGCOL8to32. · 4347e05f
      Robert Sprowson authored
      Had erroneously been switched out in version 1.27 clean up, when it is needed. Comment added to denote it's a fall through of the table above it.
      Version 1.29. Tagged as 'SprExtend-1_29'
    • Robert Sprowson's avatar
      Remove postprocessing step of C code. · 4c21926d
      Robert Sprowson authored
      Since 2001 this module has been using objasm, but still using the C compiler to output (via -S) assembly code which is then passed through 'sed' and included via GET into the assembler code.
      Changed to compile the C code into object files, and use the linker to patch up the unresolved references - this has required some reordering of the C code to make sure static functions now appear in the object file, and some reordering of the header files to ensure both the module and the CFSI version still compile without conflicts.
      Minor fix to 'swiv2', the label was in the wrong place for _swi() though it's not used in this module so didn't affect the _swix() case.
      Makefile cut down a bit. Unixify some path names.
      Test code moved to 'Test/c' directory.
      Tested in both debug and non debug cases via softloaded module. Oddly, it's 4 bytes longer than the previous version.
      Version 1.28. Tagged as 'SprExtend-1_28'
  19. 19 Sep, 2010 2 commits
    • Robert Sprowson's avatar
      Panel beat with hammer of sanity. · 19fec5e3
      Robert Sprowson authored
      Deleted c.SpriteOp to untangle it from c.rojpeg to draw boundary around JPEG code.
      Moved all the OS_SpriteOp code out of SprExtend into a new file SprOp, so the main file just contains the usual macros/includes/module heading.
      Added new 'debugso' switch for debugging SpriteOps, was previously using 'debuggs' which is supposed to be for JPEG leading to reams of confusing debug.
      TestForMaskAtDepth was rejecting 8bpp sprites with masks due to testing against log2bpp (4) instead of sprite type (5).
      NSM_bpptable re-encoded in bytes rather than words, accesses ammended accordingly.
      Took fresh copy of swiv2 from RISCOS_Lib revision 4.7.
      SpriteV interception made a bit simpler (& faster).
      Fixes to validate sprite (SpriteOp 17):
       Was looking at the wrong bits of the mode word to test for old mode words.
       Added new test for DPI values being non zero.
       Algorithm more closely follows PRM.
      Version 1.27. Tagged as 'SprExtend-1_27'
    • Robert Sprowson's avatar
      Title line made consistent. · f9b84277
      Robert Sprowson authored
      No code change - not tagged.
  20. 17 Sep, 2010 3 commits
    • Robert Sprowson's avatar
      Retire old compiler. · a76bc825
      Robert Sprowson authored
      2000 lines of unloved code from 1993 deleted, binary still the same afterwards, so should be same as 1.25.
      Version 1.26. Tagged as 'SprExtend-1_26'
    • Robert Sprowson's avatar
      Fix two bugs causing aborts on corner cases. · d801c60e
      Robert Sprowson authored
      1 pixel wide JPEGs:
      The diffuse dithering code considers all lines as 1-N-1 where N can be zero and the first and last pixel are dealt with specially because there's no data to scatter beyond the edge.
      With a 1 pixel wide JPEG the dithering code ended up with a -ve number in the X counter and wandered off the end of memory. Fix just moves a SUB up a few lines and turns it into a SUBS so that the 1 wide case becomes 0-N-1 with N=0.
      1 pixel high sprites:
      With output switched to a 1 pixel high sprite an abort would quickly follow because the read of mode variables had a backdoor check to workaround a bug in RISC OS 2.00 which returned a duff value for YWindLimit in MODE 22. As the definition of MODE 22 got changed to 768x288 in RISC OS 3.xx (and the YWindLimit bug fixed) this code now just falsely reported a 1 pixel high sprite as being 1024 high and the blitter splattered all over memory it shouldn't.
      Loss of RISC OS 2.00 compatibility, but can now load JPEGs of Xx1 or 1xY and even 1x1.
      Version 1.25. Tagged as 'SprExtend-1_25'
    • Robert Sprowson's avatar
      Comment corrected. · f6a6ef40
      Robert Sprowson authored
  21. 01 Sep, 2010 1 commit
    • Robert Sprowson's avatar
      Clean up pass. · ff031992
      Robert Sprowson authored
      Trim 200+ lines of changes dating back to 1987, combine with non duplicates in the 'BlackLog'.
      Use 'offsetof' macro in genjhdr to avoid warnings about uninitialised variables, rename from makejhdr so all the utils are clearly demarked.
      Add throwback to MkCFSI-j.
      Replace reason codes passed to SWIs with textual equivalents from the respective header files.
      Speed up SWI despatch a bit by making the first few debug instructions depend on 'debuggs'.
      Qualify all of the debug switches with the global 'debug' one.
      Eliminate single use of 'pullx' macro.
      Make do_branch() take an unsigned opcode so 50% of the branches don't result in implied cast warnings.
      Added an UNUSED() macro to reduce a few of the legitimate warnings (the remainder are either in the original JPEG code or ones that it is worth checking the logic of.
      Unixify one last filename.
      Version 1.24. Tagged as 'SprExtend-1_24'
  22. 29 Aug, 2010 1 commit
    • Robert Sprowson's avatar
      A few small fixes. · 6393b19d
      Robert Sprowson authored
       Sync comment with C code.
       Debug switch 'debuggs' had been left on, which left in some unnecessary code, but turning it off pulled in code with a stack imbalance. Now off.
       Ensured a terminator at the end of the RMEnsure.
       Colour translation tables passed to SetPointerShape that were in top bit set addresses were being interpreted as though no tt was supplied. Now tested against zero to match docs.
       Switches pre 0.60 collapsed.
       The C code was corrupting r12 workspace pointer so the check of the flag 'ctrans_recent' sometimes failed leading to a duff table lookup.
       Small optimisation to checking of guard word.
       Change paths to be Unix friendly.
       Put assembler_panic in the header file to shut the compiler up.
      3x unused files deleted.
      Version 1.23. Tagged as 'SprExtend-1_23'
  23. 26 Aug, 2010 2 commits
    • Robert Sprowson's avatar
      Collapse old switches. · 02ca29e9
      Robert Sprowson authored
      Removed braces selecting code from 0.47 0.50 and 0.55, this is over 80
      versions ago and just confusing.
      Binary the same, not tagged.
    • Robert Sprowson's avatar
      Code generator improvements for ARMv5T and later. · 8ef703da
      Robert Sprowson authored
      The code generator could output TST instructions with immediate constants not generated in the ARM approved way, while this isn't currently a problem the generator is changed to encode constants less than 256 as an immediate with no shift.
      Use of LDR rn, Rd,[Rn] would produce
             LDR Rd,[Rn],#0
      which is unpredictable when Rd=Rn. Swapped use of OFFSET0 to OFFSET(0) so
      an indexed load is used instead.
      Removed the explicit 'S' from TST use, since the TST macro includes 'S' already.
      Delete h/swis (held centrally).
      Delete h/kernel (held centrally).
      Delete hdr/Modes (not used).
      Version 1.22. Tagged as 'SprExtend-1_22'
  24. 21 Aug, 2010 1 commit
  25. 19 Jan, 2010 1 commit
    • ROOL's avatar
      Incremented version number, no other change. · bd7ef5fe
      ROOL authored
      Previous changes were untagged, but incrementing the version number gives
      us a tag we can associate with the official RISC OS 5.16 release.
      Version 1.21. Tagged as 'SprExtend-1_21'
  26. 16 Jun, 2009 1 commit
    • Ben Avison's avatar
      Build fix · 1eb8d8a1
      Ben Avison authored
        Defines UXTH and SXTH as macros. This means we can assemble the output of
        cc -S -cpu 6 even using current versions of objasm that are limited to the
        v5TEJ instruction set. It is expected that objasm will ignore these macros
        if/when it gains v6 instruction set support.
        Tested - it works.
  27. 13 Jun, 2009 1 commit
    • Ben Avison's avatar
      Build fix · 3a68b17c
      Ben Avison authored
        The build utilities utils.makejhdr, utils.genpalette and utils.genyuvtabs,
        compiled at build time, are now built using the HostTools shared makefile,
        and so will execute on any RISC OS build host even if the default compiler
        options are to target an incompatible ARM architecture. Also now sets the
        throwback flag when doing builds via the Mk obey file.
        Tested using an APCS-R build on an Iyonix.
      Version 1.20. Not tagged
  28. 11 Jun, 2009 1 commit
    • Ben Avison's avatar
      GET file pathnames changed · b1220ed0
      Ben Avison authored
        Uses suffixed file extensions for compatiblity with both objasm and asasm.
        Supplied by Peter Naulls, tested at ROOL
      Version 1.20. Not tagged
  29. 10 May, 2009 1 commit
    • Ben Avison's avatar
      Now safe to use in IOMD builds again. · 383c0f8d
      Ben Avison authored
        The use of ARMv4 SMULL instructions is now switched based upon the
        Hdr:CPU.Arch header file. This means that in IOMD ROM builds, only pre-v4
        instructions are used, so it will function on all required target platforms.
        Tungsten and OMAP3 builds will continue to use SMULL.
        Inspected binary to ensure correct behaviour. Requires HdrSrc 1.67 or
      Version 1.20. Tagged as 'SprExtend-1_20'
  30. 24 Apr, 2009 1 commit
    • Steve Revill's avatar
      Performance improvement and code tidy-up. · 2ae9b407
      Steve Revill authored
      Removed local definition of XOS_CLI and XColourTrans_SelectTable, replaced
      with header file.
      Delete swiv2_old (moved to _old directory)
      Changed to use {TRUE} and {FALSE} built in objasm variables.
      Label dividebyzero fall through had code in the way for debug = {TRUE}.
      Trimmed some dead code and definitions.
      Stopped thrashing OS_CLI every time a JPEG plot is required to check
      ColourTrans version, this is now done once at startup and a flag kept
      Author: Rob Sprowson
      Version 1.19. Tagged as 'SprExtend-1_19'
  31. 17 Oct, 2008 1 commit
    • Steve Revill's avatar
      Small makefile tweak · bdc1c026
      Steve Revill authored
        Creates install directories if not already present before doing the
        copy operation.
        Will work.
      Version 1.18. Tagged as 'SprExtend-1_18'