Compare commits

...

93 Commits

Author SHA1 Message Date
Lucas Scharenbroich 4c13373bd3 Fix addressing bug that caused serious overdraw 2023-06-27 21:33:59 -05:00
Lucas Scharenbroich cdfc414a9f Fix relative offset from interrupt enable code and fix order bug in exit code path 2023-06-27 21:32:21 -05:00
Lucas Scharenbroich 4645929596 Pretty 2023-06-27 21:31:40 -05:00
Lucas Scharenbroich 1fcf176012 Fix ancient bug in Col2CodeOffset table 2023-06-27 21:31:13 -05:00
Lucas Scharenbroich 29838abb40 Shorter size-agnostic implemention of SetDataBank 2023-06-27 21:30:30 -05:00
Lucas Scharenbroich 2cc839b2c6 Add offset for the interrupt entry point 2023-06-27 21:29:50 -05:00
Lucas Scharenbroich 9c24715217 Enable interrupt processing in the lite blitter 2023-06-27 21:29:32 -05:00
Lucas Scharenbroich e2c9480de4 Better single-step control 2023-06-27 21:27:45 -05:00
Lucas Scharenbroich ae1611fcc9 Add build target for APUSim 2023-06-27 21:26:53 -05:00
Lucas Scharenbroich bcebe6367f Turn APU back on 2023-06-27 21:26:33 -05:00
Lucas Scharenbroich 139a784bfa Fix off-by-one on tile update range and some comment typos 2023-06-27 21:26:17 -05:00
Lucas Scharenbroich a5af4c206c Add hook for half and quarter speed updates 2023-06-27 21:24:59 -05:00
Lucas Scharenbroich cb5e9b0b25 Add interrupt breaks in the lite blitter to allow music to keep playing 2023-06-26 17:17:23 -05:00
Lucas Scharenbroich 6a0b8cbdc1 Fix restore code field bug. SMB demo can use renderer 2023-06-26 14:15:20 -05:00
Lucas Scharenbroich eb548343a7 Fix offset calc 2023-06-26 13:19:12 -05:00
Lucas Scharenbroich 2013771524 Lite render mode bugfixes 2023-06-26 11:21:05 -05:00
Lucas Scharenbroich 94dafd2093 Checkpoint 2023-06-25 21:45:34 -05:00
Lucas Scharenbroich 135a7384b9 Add FPS counter 2023-06-20 07:41:17 -05:00
Lucas Scharenbroich df18dd7570 Init SHR before drawing to make sure linearization is on 2023-06-20 07:41:10 -05:00
Lucas Scharenbroich 7b521c8473 Tweak noise channel and get APU channel select working 2023-06-19 10:15:52 -05:00
Lucas Scharenbroich 01d8029125 Change how to calculate DOC reg values for noise channel 2023-06-19 07:14:10 -05:00
Lucas Scharenbroich ecb11df945 Add Noise channel hooks to ROM 2023-06-18 22:11:43 -05:00
Lucas Scharenbroich 29e2cfd007 Fix bnk bug in APU STATUS register 2023-06-18 21:54:24 -05:00
Lucas Scharenbroich 13cc1a807e Turn on all four channels at startup 2023-06-18 00:26:11 -05:00
Lucas Scharenbroich a1261e8339 Optimization to avoid recalculating DOC frequencies when APU value does not change 2023-06-18 00:12:53 -05:00
Lucas Scharenbroich bdb4006e22 APU fixed
* Fixed type that caused triangle linear counter to be ignored
 * Changed sweep to shift the current period, not the register value
 * Moved muting logic early to avoid setting DOC registers when not needed
2023-06-17 23:50:38 -05:00
Lucas Scharenbroich 8011f268a2 Merge branch 'master' into eight-bit-hal 2023-06-17 12:45:42 -05:00
Lucas Scharenbroich d12bddae48 Revert 2023-06-17 12:43:19 -05:00
Lucas Scharenbroich 94d907fd09 Adjust width 2023-06-17 12:42:15 -05:00
Lucas Scharenbroich 96549b0c21 Add link to KFest video recording to README 2023-06-17 12:40:53 -05:00
Lucas Scharenbroich 8d7d4a8ec6 Add link to KFest video recording to README 2023-06-17 12:39:31 -05:00
Lucas Scharenbroich 28016b6780 Move error check outside of loop 2023-06-17 12:33:22 -05:00
Lucas Scharenbroich e06724eb4a Minor cleanup 2023-06-17 12:29:40 -05:00
Lucas Scharenbroich 95490b4996 Remove dead variable 2023-06-17 12:28:53 -05:00
Lucas Scharenbroich ae2cb8f71d Move area palette change after GTERender to avoid flicker of new color on old pixels 2023-06-16 15:40:49 -05:00
Lucas Scharenbroich 24cd424d7c Add triangle wave back in with counters 2023-06-16 08:18:02 -05:00
Lucas Scharenbroich 99184396fc Mostly full implementations of the pulse channels 2023-06-16 01:07:19 -05:00
Lucas Scharenbroich 60d566e78c Create APU simulator for debugging 2023-06-16 01:05:31 -05:00
Lucas Scharenbroich 361c7dae56 Tweak conversion from APU value to DOC register value 2023-06-12 11:09:21 -05:00
Lucas Scharenbroich 1035af010d First sounds from emulated APU 2023-06-11 12:00:52 -05:00
Lucas Scharenbroich 4f2c2aac0b Wired all APU access to emulation layer. No sound yet :( 2023-06-10 21:05:11 -05:00
Lucas Scharenbroich ef581ab97b Fix rendering bug that cause flicker when two sprites shared a block row 2023-06-07 23:42:48 -05:00
Lucas Scharenbroich b45d2e27bf Fix bad color in overworld table 2023-06-06 14:31:07 -05:00
Lucas Scharenbroich c2b37fdb71 Fix water world palette table 2023-06-06 10:57:23 -05:00
Lucas Scharenbroich a2a0d3af9d Refine palette handling 2023-06-06 08:01:40 -05:00
Lucas Scharenbroich d36e221080 Fix bowser flame init 2023-06-05 17:46:23 -05:00
Lucas Scharenbroich 552f32f917 Add more swizzle tables 2023-06-03 09:07:49 -05:00
Lucas Scharenbroich 5acd964917 Update palette based on AreaType 2023-06-02 21:55:55 -05:00
Lucas Scharenbroich 91454c9481 Move sprite blitter totally into app code 2023-06-02 15:56:13 -05:00
Lucas Scharenbroich 377ac1f788 Fix bad PPU attribute calculation 2023-06-02 08:16:00 -05:00
Lucas Scharenbroich 2c1b7567ec Fix comment typos 2023-06-02 08:15:43 -05:00
Lucas Scharenbroich fa307e5542 Better support for user-defined tiles 2023-06-02 00:38:35 -05:00
Lucas Scharenbroich 459bc645be Swizzle support 2023-06-02 00:37:14 -05:00
Lucas Scharenbroich 0715efa684 Check the background disable bit when rendering 2023-05-28 07:54:55 -05:00
Lucas Scharenbroich aeb620fb7b Added sprite and background disable control bits 2023-05-28 07:49:37 -05:00
Lucas Scharenbroich cc36fcc0f8 Refix abs addr in rom 2023-05-27 08:23:18 -05:00
Lucas Scharenbroich 9560591642 Fix a few more abs addr locations 2023-05-26 12:42:15 -05:00
Lucas Scharenbroich 5e157072fa Adjust x-coordinate sprite cutoff 2023-05-26 12:41:49 -05:00
Lucas Scharenbroich f8cd5c5a6c Fix typo in bowser setup 2023-05-26 08:04:07 -05:00
Lucas Scharenbroich 22f43a42de Add collision fixes 2023-05-25 08:03:20 -05:00
Lucas Scharenbroich 584f3b5ce5 Fix coin blocks 2023-05-24 20:59:12 -05:00
Lucas Scharenbroich 361e814fd0 Fixed title screen. Verified all of World 1 renders correctly 2023-05-24 14:44:15 -05:00
Lucas Scharenbroich aa684ef58c Fresh rom2 that does not have the RenderArea bug 2023-05-24 14:31:49 -05:00
Lucas Scharenbroich 6c5bf4e494 Fix lakitu spawn bug and vine setup issue 2023-05-24 10:50:17 -05:00
Lucas Scharenbroich 56b66033a7 Add support for sprite priority 2023-05-22 13:55:56 -05:00
Lucas Scharenbroich d402d60a4e Filter out more sprites and PPU nametable changes 2023-05-22 11:15:45 -05:00
Lucas Scharenbroich 166274c6c2 Move input read into VBL handler for better responsiveness 2023-05-22 00:36:47 -05:00
Lucas Scharenbroich 61cf1d49c8 Fix bmi/bpl branch bug 2023-05-22 00:05:51 -05:00
Lucas Scharenbroich b40bc0dd2b Don't crash on OOB 2023-05-22 00:04:50 -05:00
Lucas Scharenbroich b0ed4f9692 Fix some bugs introduced by the abs indexed addressing mode changes 2023-05-21 23:37:36 -05:00
Lucas Scharenbroich cc3ee6be0f Add larger PPU buffer 2023-05-21 23:36:52 -05:00
Lucas Scharenbroich d3a7eecc6e Mostly working PPU integration with GTE rendering pipeline 2023-05-21 17:50:05 -05:00
Lucas Scharenbroich 64f7106143 Fix absolute address issue in rom 2023-05-19 20:40:52 -05:00
Lucas Scharenbroich 310c3487ca Support the sprite palette select bits in OAM 2023-05-17 12:59:07 -05:00
Lucas Scharenbroich 25c82cc44b Initial palette work; fix memory init bug 2023-05-16 22:38:54 -05:00
Lucas Scharenbroich cb13c2ae2d Secret sauce 2023-05-16 12:34:18 -05:00
Lucas Scharenbroich aaf70af236 Merge branch 'master' of https://github.com/lscharen/iigs-game-engine 2023-05-09 10:17:04 -05:00
Lucas Scharenbroich 4ee67fb8be Add hook for VBL callback 2023-05-09 10:16:58 -05:00
Lucas Scharenbroich 3eba3fa8e6 Secret stuff 2023-05-04 17:30:22 -05:00
Lucas Scharenbroich 4feb94f5c6 Update sample code to use new STATIC_TILE macro 2023-05-03 07:50:22 -05:00
Lucas Scharenbroich 3a4169cce4 Merge branch 'master' of https://github.com/lscharen/iigs-game-engine 2023-05-03 07:49:51 -05:00
Lucas Scharenbroich 788f938647 Add helper macro for creating static tiles 2023-05-03 07:49:46 -05:00
Lucas Scharenbroich 3c4cf89ecf Start of additional tutorials and samples 2023-05-02 16:06:57 -05:00
Lucas Scharenbroich 89a56d479e Merge branch 'master' of https://github.com/lscharen/iigs-game-engine 2023-05-02 15:59:35 -05:00
Lucas Scharenbroich a5498e07eb Update the shadow renderer to use the common scnaline management routines 2023-04-28 00:35:35 -05:00
Lucas Scharenbroich c7a143b488 Remove unneeded padding from some data arrays 2023-04-28 00:14:03 -05:00
Lucas Scharenbroich 869d80af1e Comment cleanup and minro refactoring 2023-04-28 00:13:05 -05:00
Lucas Scharenbroich 515ec5280b Remove dead code 2023-04-28 00:11:46 -05:00
Lucas Scharenbroich ed01a8da8d Add new UpdateOverlay call 2023-04-28 00:10:59 -05:00
Lucas Scharenbroich 57f57ce533 Restore shadow reg instead of overwriting 2023-04-27 23:38:26 -05:00
Lucas Scharenbroich 77fbe4a5ad Sync with master branch 2023-04-27 16:32:14 -05:00
Lucas Scharenbroich df32442fff
Merge pull request #23 from lscharen/dependabot/bundler/docs/nokogiri-1.14.3
Bump nokogiri from 1.14.2 to 1.14.3 in /docs
2023-04-27 09:29:11 -05:00
dependabot[bot] 6ba595f0b5
Bump nokogiri from 1.14.2 to 1.14.3 in /docs
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.14.2 to 1.14.3.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.14.2...v1.14.3)

---
updated-dependencies:
- dependency-name: nokogiri
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-12 06:28:35 +00:00
67 changed files with 43734 additions and 789 deletions

View File

@ -22,20 +22,17 @@
#include <types.h>
/*
GTE_IS_SYSTEM_TOOLS_INSTALL is a boolean toggle for controlling what the application assumes about the location of the GTE tool.
GTE_IS_USER_TOOL is a boolean toggle for controlling what the application assumes about the location of
the GTE tool.
If GTE is installed in System:Tools, GTE_IS_SYSTEM_TOOLS_INSTALL must be defined.
Otherwise, GTE_IS_SYSTEM_TOOLS_INSTALL must be undefined.
This will control which header file is used as well as the calls used to load the tool during application startup.
If GTE is NOT installed in System:Tools, GTE_IS_USER_TOOL must be defined and the calling program
is responsible for loading and initializing the toolset using InitialLoad and SetTSPtr.
*/
// #define GTE_IS_SYSTEM_TOOLS_INSTALL 1
#ifdef GTE_IS_SYSTEM_TOOLS_INSTALL
#define tool_dispatcher dispatcher
#else
#ifdef GTE_IS_USER_TOOL
#define tool_dispatcher 0xE10008L
#endif // GTE_IS_SYSTEM_TOOLS_INSTALL
#else
#define tool_dispatcher dispatcher
#endif // GTE_IS_USER_TOOL
typedef struct TileMapInfo {
Word width;
@ -117,9 +114,11 @@ extern pascal Word GTEStartScript(Word numTicks, Pointer scriptAddr) inline(0x21
/* GTE Overlay Functions */
extern pascal Word GTESetOverlay(Word top, Word bottom, Pointer procPtr) inline(0x22A0, tool_dispatcher);
extern pascal Word GTEClearOverlay() inline(0x23A0, tool_dispatcher);
extern pascal void GTEUpdateOverlay(Word top, Word bottom, Pointer procPtr) inline(0x2FA0, tool_dispatcher);
/* ReadControl return value bits */
#define PAD_KEY_CODE 0x007F
#define PAD_BUTTON_B 0x0100
#define PAD_BUTTON_A 0x0200
#define PAD_KEY_DOWN 0x0400
@ -164,7 +163,7 @@ extern pascal Word GTEClearOverlay() inline(0x23A0, tool_dispatcher);
#define TILE_CTRL_MASK 0xFE00
/* GTE Sprite Constants */
#define GTE_SPRITE_COMPILES 0x4000
#define GTE_SPRITE_COMPILED 0x4000
#define GTE_SPRITE_HIDE 0x2000
#define GTE_SPRITE_16X16 0x1800
#define GTE_SPRITE_16X8 0x1000
@ -181,5 +180,12 @@ extern pascal Word GTEClearOverlay() inline(0x23A0, tool_dispatcher);
#define GTE_VBUFF_SPRITE_START (GTE_VBUFF_TILE_ROW_BYTES+4) /* Start at an offset so $0000 can be used as an empty value */
#define GTE_VBUFF_SLOT_COUNT (48) /* Have space for this many stamps */
#define GTE_TILE_SIZE_BYTES 128
#define GTE_TILE_STORE_WIDTH 41
#define GTE_TILE_STORE_HEIGHT 26
/* Tile helper macros */
#define STATIC_TILE(x) _TILE_DATA(x),_TILE_DATA(0),_TILE_DATA(x),_TILE_DATA(0)
#define _TILE_DATA(x) _ROW(x),_ROW(x),_ROW(x),_ROW(x),_ROW(x),_ROW(x),_ROW(x),_ROW(x)
#define _ROW(x) x,x,x,x
#endif /* _GTE_HEADER_INCLUDE_ */

View File

@ -8,6 +8,8 @@
The Generic Tile Engine (GTE) project is a tile engine built to exploit the unique hardware capabilities of the Apple IIgs personal computer. It supports the Apple IIgs super hires graphics mode (320x200, 16/256 colors) and provides two full-screen independent scrolling layers along with software sprites. The API and core functionality of the library is inspired by the graphics hardware of the NES/SMS/SNES/Genesis console era.
An overview of GTE was presented at [KansasFest 2022](http://www.youtube.com/watch?v=2x65JymFklk).
<p align="center">
<img src="https://raw.githubusercontent.com/lscharen/iigs-game-engine/master/.github/images/armada.gif"/><br/>
Parallax scrolling of two full-screen static layers

1
demos/lite/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
GTEToolDemo

341
demos/lite/App.Main.s Normal file
View File

@ -0,0 +1,341 @@
REL
DSK MAINSEG
use Locator.Macs
use Load.Macs
use Mem.Macs
use Misc.Macs
use Util.Macs
use EDS.GSOS.Macs
use GTE.Macs
mx %00
TSZelda EXT ; tileset buffer
ScreenX equ 0
ScreenY equ 2
Tmp0 equ 4
Tmp1 equ 6
KeyState equ 8
Selected equ 10
Flips equ 12
DTile equ 14
Tmp2 equ 16
ScreenWidth equ 18
ScreenHeight equ 20
SpriteFlags equ 22
frameCount equ 24
OldOneSecondCounter equ 26
SpriteAddr equ 28
RenderMode equ 30
; Control modes
DefaultMode equ RENDER_WITH_SHADOWING
SlowSprites equ 0
; Typical init
phk
plb
sta MyUserId ; GS/OS passes the memory manager user ID for the application into the program
tdc
sta MyDirectPage ; Keep a copy for the overlay callback
_MTStartUp ; GTE requires the miscellaneous toolset to be running
lda #ENGINE_MODE_USER_TOOL
jsr GTEStartUp ; Load and install the GTE User Tool
; Init local variables
stz frameCount
; Initialize the graphics screen to a 256x160 playfield
pea #160
pea #200
_GTESetScreenMode
; Load a tileset
pea 0
pea 360
pea #^TSZelda
pea #TSZelda
_GTELoadTileSet
; Set the palette
pea $0000
pea #^palette
pea #palette
_GTESetPalette
jsr SetLimits
pha
_GTEGetSeconds
pla
sta OldOneSecondCounter
; Manually fill in the 41x26 tiles of the TileStore with a test pattern of trees
jsr _fillTileStore
pha
pha
pea liteBlitter
_GTEGetAddress
pla
plx
; Set the screen coordinates
lda #0
sta ScreenX
lda #0
sta ScreenY
stz Selected
stz Flips
; Very simple actions
:evt_loop
pha ; space for result, with pattern
_GTEReadControl
pla
jsr HandleKeys ; Do the generic key handlers
bcs :do_more
bra :evt_loop
:do_more
bit #PAD_KEY_DOWN
beq :evt_loop
and #$007F
cmp #'a'
bne :not_a
dec ScreenX
:not_a cmp #'s'
bne :not_s
inc ScreenX
:not_s
:do_render jsr :next_frame
brl :evt_loop
:next_frame
pei ScreenX
pei ScreenY
_GTESetBG0Origin
pea $FFFE
_GTERender
; Update the performance counters
inc frameCount
pha
_GTEGetSeconds
pla
cmp OldOneSecondCounter
beq :noudt
sta OldOneSecondCounter
jsr UdtOverlay
stz frameCount
:noudt
rts
; Shut down everything
Exit
_GTEShutDown
_QuitGS qtRec
qtRec adrl $0000
da $00
; Called by StartUp function callbacks when the screen size changes
SetLimits
pha ; Allocate space for x, y, width, height
pha
pha
pha
_GTEGetScreenInfo
pla
pla ; Discard screen corner
pla
sec
sbc #8
sta ScreenWidth ; Pre-adjust to keep sprites on the visible playfield (for compiled sprites)
pla
sec
sbc #16
sta ScreenHeight
rts
_fillTileStore
sta Tmp2
stz Tmp0
:oloop
stz Tmp1
:iloop
ldx Tmp1
ldy Tmp0
jsr _drawTree
lda Tmp1
clc
adc #2
sta Tmp1
cmp #40
bcc :iloop
lda Tmp0
clc
adc #2
sta Tmp0
cmp #25
bcc :oloop
rts
; Tile 65 Tile 66
; Tile 97 Tile 98
_drawTreeFront
phx
phy
pea #65+TILE_PRIORITY_BIT
inx
phx
phy
pea #66+TILE_PRIORITY_BIT
iny
phx
phy
pea #98+TILE_PRIORITY_BIT
dex
phx
phy
pea #97+TILE_PRIORITY_BIT
_GTESetTile
_GTESetTile
_GTESetTile
_GTESetTile
rts
_drawTree
phx
phy
pea #65
inx
phx
phy
pea #66
iny
phx
phy
pea #98
dex
phx
phy
pea #97
_GTESetTile
_GTESetTile
_GTESetTile
_GTESetTile
rts
_drawTreeH
phx
phy
pea #66+TILE_HFLIP_BIT
inx
phx
phy
pea #65+TILE_HFLIP_BIT
iny
phx
phy
pea #97+TILE_HFLIP_BIT
dex
phx
phy
pea #98+TILE_HFLIP_BIT
_GTESetTile
_GTESetTile
_GTESetTile
_GTESetTile
rts
_drawTreeV
phx
phy
pea #97+TILE_VFLIP_BIT
inx
phx
phy
pea #98+TILE_VFLIP_BIT
iny
phx
phy
pea #66+TILE_VFLIP_BIT
dex
phx
phy
pea #65+TILE_VFLIP_BIT
_GTESetTile
_GTESetTile
_GTESetTile
_GTESetTile
rts
_drawTreeHV
phx
phy
pea #98+TILE_VFLIP_BIT+TILE_HFLIP_BIT
inx
phx
phy
pea #97+TILE_VFLIP_BIT+TILE_HFLIP_BIT
iny
phx
phy
pea #65+TILE_VFLIP_BIT+TILE_HFLIP_BIT
dex
phx
phy
pea #66+TILE_VFLIP_BIT+TILE_HFLIP_BIT
_GTESetTile
_GTESetTile
_GTESetTile
_GTESetTile
rts
MyDirectPage ds 2
MyUserId ds 2
palette dw $0000,$08C1,$0C41,$0F93,$0777,$0FDA,$00A0,$0000,$0D20,$0FFF,$0FD7,$0F59,$0000,$01CE,$0EDA,$0EEE
PUT ../kfest-2022/StartUp.s
PUT ../shell/Overlay.s
; PUT App.Msg.s
; PUT font.s

105
demos/lite/App.Msg.s Normal file
View File

@ -0,0 +1,105 @@
HexToChar dfb '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'
; Convert a byte (Acc) into a string and store at (Y)
ByteToString and #$00FF
sep #$20
pha
lsr
lsr
lsr
lsr
and #$0F
tax
ldal HexToChar,x
sta: $0000,y
pla
and #$0F
tax
ldal HexToChar,x
sta: $0001,y
rep #$20
rts
; Convert a word (Acc) into a hexadecimal string and store at (Y)
WordToString pha
bra Addr2ToString
; Pass in Acc = High, X = low
Addr3ToString phx
jsr ByteToString
iny
iny
lda 1,s
Addr2ToString xba
jsr ByteToString
iny
iny
pla
jsr ByteToString
rts
; A=Value
; X=Screen offset
DrawWord phx ; Save register value
phy
ldy #WordBuff+1
jsr WordToString
ply
plx
lda #WordBuff
jsr DrawString
rts
WordBuff str '0000'
Addr3Buff str '000000' ; str adds leading length byte

15
demos/lite/App.s Normal file
View File

@ -0,0 +1,15 @@
; IIgs GTE Lite rendering test
TYP $B3 ; S16 file
DSK GTELiteDemo
XPL
; Segment #1 -- Main execution block
ASM App.Main.s
SNA Main
; Segment #2 -- Tileset
ASM Zelda.TileSet.s
SNA TSET

13687
demos/lite/Zelda.TileSet.s Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,2 @@
GTEToolDemo=Type(B3),AuxType(0000),VersionCreate(70),MinVersion(BE),Access(E3),FolderInfo1(000000000000000000000000000000000000),FolderInfo2(000000000000000000000000000000000000)
GTELiteDemo=Type(B3),AuxType(0000),VersionCreate(70),MinVersion(BE),Access(E3),FolderInfo1(000000000000000000000000000000000000),FolderInfo2(000000000000000000000000000000000000)

View File

@ -0,0 +1,19 @@
echo off
REM Copy all of the assets into the ProDOS image for emulator testing
REM
REM Pass the path of the Cadius tool as the first argument (%1)
set CADIUS="%1"
set IMAGE="..\\..\\emu\\Target.2mg"
set FOLDER="/GTEDEV/Lite"
REM Cadius does not overwrite files, so clear the root folder first
%CADIUS% DELETEFOLDER %IMAGE% %FOLDER%
%CADIUS% CREATEFOLDER %IMAGE% %FOLDER%
REM Now copy files and folders as needed
%CADIUS% ADDFILE %IMAGE% %FOLDER% .\GTELiteDemo
%CADIUS% ADDFILE %IMAGE% %FOLDER% ..\..\src\Tool160
REM Copy in the image assets

668
demos/lite/font.s Normal file
View File

@ -0,0 +1,668 @@
****************************************
* FONT ENGINE (v3?) *
* *
* Dagen Brock <dagenbrock@gmail.com> *
* 2013-07-20 *
****************************************
* A= ptr to string preceded by length *
* X= screen location *
****************************************
; each char:
; draw char at loc
; update loc
; see if length hit - no? back to draw char
rel
mx %00
]F_Length ds 2 ;length of string (only one byte currently used)
]F_CharIdx ds 2 ;index of current character
]F_CurrentPos ds 2 ;current top left char position
]F_StrPtr equ $01 ;pointer to string (including length byte) / DP
]F_StrClr equ $03
DrawString
pha ; local variable space
pha
tsc
phd
tcd
; sta ]F_StrPtr ; (done in pha init above) store at dp 0 ($00) for indirect loads
stx ]F_CurrentPos
sty ]F_StrClr
stz ]F_CharIdx
lda (]F_StrPtr)
and #$00ff ;strip off first char (len is only one byte)
sta ]F_Length ;get our length byte
NextChar lda ]F_CharIdx
cmp ]F_Length
bne :notDone
ldy ]F_StrClr ;restore the color pattern
pld
pla
pla
rts ;DONE! Return to caller
:notDone inc ]F_CharIdx
ldy ]F_CharIdx
lda (]F_StrPtr),y ;get next char!
and #$00FF ;mask high byte
sec
sbc #' ' ;our table starts with space ' '
asl ;*2
tay
ldx ]F_CurrentPos
jsr :drawChar
inc ]F_CurrentPos ;compare to addition time (?)
inc ]F_CurrentPos
inc ]F_CurrentPos
inc ]F_CurrentPos ;update screen pos (2 words=8 pixels)
bra NextChar
;x = TopLeft screen pos
;y = char table offset
:drawChar lda FontTable,y ;get real address of char data
sec
sbc #FontData ;pivot offset - now a is offset of fontdata
tay ;so we'll index with that
lda FontData,y
and ]F_StrClr
stal $E12000,x
lda FontData+2,y
and ]F_StrClr
stal $E12000+2,x
lda FontData+4,y
and ]F_StrClr
stal $E12000+160,x
lda FontData+6,y
and ]F_StrClr
stal $E12000+160+2,x
lda FontData+8,y
and ]F_StrClr
stal {$E12000+160*2},x
lda FontData+10,y
and ]F_StrClr
stal {$E12000+160*2+2},x
lda FontData+12,y
and ]F_StrClr
stal {$E12000+160*3},x
lda FontData+14,y
and ]F_StrClr
stal {$E12000+160*3+2},x
lda FontData+16,y
and ]F_StrClr
stal {$E12000+160*4},x
lda FontData+18,y
and ]F_StrClr
stal {$E12000+160*4+2},x
lda FontData+20,y
and ]F_StrClr
stal {$E12000+160*5},x
lda FontData+22,y
and ]F_StrClr
stal {$E12000+160*5+2},x
rts
FontTable dw s_Space
dw s_Exclaim
dw s_Quote
dw s_Number
dw s_Dollar
dw s_Percent
dw s_Amper
dw s_Single
dw s_OpenParen
dw s_CloseParen
dw s_Asterix
dw s_Plus
dw s_Comma
dw s_Minus
dw s_Period
dw s_Slash
dw s_N0
dw s_N1
dw s_N2
dw s_N3
dw s_N4
dw s_N5
dw s_N6
dw s_N7
dw s_N8
dw s_N9
dw s_Colon
dw s_Semi
dw s_LAngle
dw s_Equal
dw s_RAngle
dw s_Question
dw s_At
dw s_A
dw s_B
dw s_C
dw s_D
dw s_E
dw s_F
dw s_G
dw s_H
dw s_I
dw s_J
dw s_K
dw s_L
dw s_M
dw s_N
dw s_O
dw s_P
dw s_Q
dw s_R
dw s_S
dw s_T
dw s_U
dw s_V
dw s_W
dw s_X
dw s_Y
dw s_Z
dw s_LBracket
dw s_BackSlash
dw s_RBracket
dw s_Carot
dw s_UnderLine
FontData = *
s_Space hex 00000000
hex 00000000
hex 00000000
hex 00000000
hex 00000000
hex 00000000
s_Exclaim hex 000FF000
hex 000FF000
hex 000FF000
hex 000FF000
hex 00000000
hex 000FF000
s_Quote hex 0FF00FF0
hex 00F000F0
hex 00000000
hex 00000000
hex 00000000
hex 00000000
s_Number hex 00000000
hex 00F00F00
hex 0FFFFFF0
hex 00F00F00
hex 0FFFFFF0
hex 00F00F00
s_Dollar hex 000F0F00
hex 00FFFFF0
hex 0F0F0F00
hex 00FFFF00
hex 000F0FF0
hex 0FFFFF00
s_Percent hex 0FF000F0
hex 00000F00
hex 0000F000
hex 000F0000
hex 00F00000
hex 0F000FF0
s_Amper hex 000FF000
hex 00F00F00
hex 0F00F000
hex 00F000F0
hex 0F0FFF00
hex 00F0F000
s_Single hex 000FF000
hex 0000F000
hex 00000000
hex 00000000
hex 00000000
hex 00000000
s_OpenParen hex 000FF000
hex 00FF0000
hex 0FF00000
hex 0FF00000
hex 00FF0000
hex 000FF000
s_CloseParen hex 000FF000
hex 0000FF00
hex 00000FF0
hex 00000FF0
hex 0000FF00
hex 000FF000
s_Asterix hex 00000000
hex 00F0F0F0
hex 000FFF00
hex 00FFFFF0
hex 000FFF00
hex 00F0F0F0
s_Plus hex 000F0000
hex 000F0000
hex 0FFFFF00
hex 000F0000
hex 000F0000
hex 00000000
s_Comma hex 00000000
hex 00000000
hex 00000000
hex 00000000
hex 0000FF00
hex 0000F000
s_Minus hex 00000000
hex 00000000
hex 0FFFFF00
hex 00000000
hex 00000000
hex 00000000
s_Period hex 00000000
hex 00000000
hex 00000000
hex 00000000
hex 0000FF00
hex 0000FF00
s_Slash hex 000000F0
hex 00000F00
hex 0000F000
hex 000F0000
hex 00F00000
hex 0F000000
s_N0 hex 00FFFF00
hex 0F000FF0
hex 0F00F0F0
hex 0F0F00F0
hex 0FF000F0
hex 00FFFF00
s_N1 hex 000F0000
hex 00FF0000
hex 000F0000
hex 000F0000
hex 000F0000
hex 00FFF000
s_N2 hex 00FFFF00
hex 0F0000F0
hex 00000F00
hex 000FF000
hex 00F00000
hex 0FFFFFF0
s_N3 hex 00FFFF00
hex 000000F0
hex 000FFF00
hex 000000F0
hex 000000F0
hex 00FFFF00
s_N4 hex 0000FF00
hex 000F0F00
hex 00F00F00
hex 0FFFFFF0
hex 00000F00
hex 00000F00
s_N5 hex 0FFFFFF0
hex 0F000000
hex 0FFFFF00
hex 000000F0
hex 0F0000F0
hex 00FFFF00
s_N6 hex 000FFF00
hex 00F00000
hex 0F000000
hex 0FFFFF00
hex 0F0000F0
hex 00FFFFF0
s_N7 hex 0FFFFFF0
hex 000000F0
hex 00000F00
hex 0000F000
hex 000F0000
hex 000F0000
s_N8 hex 00FFFF00
hex 0F0000F0
hex 00FFFF00
hex 0F0000F0
hex 0F0000F0
hex 00FFFF00
s_N9 hex 00FFFF00
hex 0F0000F0
hex 00FFFF00
hex 0000F000
hex 000F0000
hex 00F00000
s_Colon hex 000FF000
hex 000FF000
hex 00000000
hex 000FF000
hex 000FF000
hex 00000000
s_Semi hex 00000000
hex 000FF000
hex 000FF000
hex 00000000
hex 000FF000
hex 000F0000
s_LAngle hex 0000F000
hex 000F0000
hex 00F00000
hex 000F0000
hex 0000F000
hex 00000000
s_Equal hex 00000000
hex 00000000
hex 0FFFFF00
hex 00000000
hex 0FFFFF00
hex 00000000
s_RAngle hex 0000F000
hex 00000F00
hex 000000F0
hex 00000F00
hex 0000F000
hex 00000000
s_Question hex 00FFF000
hex 0F000F00
hex 00000F00
hex 000FF000
hex 00000000
hex 000FF000
s_At hex 00FFFF00
hex 0F0000F0
hex 0F00F0F0
hex 0FFFF0F0
hex 000000F0
hex 0FFFFF00
s_A hex 000FF000
hex 00F00F00
hex 0F0000F0
hex 0FFFFFF0
hex 0F0000F0
hex 0F0000F0
s_B hex 0FFFFF00
hex 0F0000F0
hex 0FFFFF00
hex 0F0000F0
hex 0F0000F0
hex 0FFFFF00
s_C hex 00FFFFF0
hex 0F000000
hex 0F000000
hex 0F000000
hex 0F000000
hex 00FFFFF0
s_D hex 0FFFFF00
hex 0F0000F0
hex 0F0000F0
hex 0F0000F0
hex 0F0000F0
hex 0FFFFF00
s_E hex 0FFFFFF0
hex 0F000000
hex 0FFFF000
hex 0F000000
hex 0F000000
hex 0FFFFFF0
s_F hex 0FFFFFF0
hex 0F000000
hex 0FFFF000
hex 0F000000
hex 0F000000
hex 0F000000
s_G hex 00FFFFF0
hex 0F000000
hex 0F000000
hex 0F00FFF0
hex 0F0000F0
hex 00FFFF00
s_H hex 0F0000F0
hex 0F0000F0
hex 0FFFFFF0
hex 0F0000F0
hex 0F0000F0
hex 0F0000F0
s_I hex 0FFFFF00
hex 000F0000
hex 000F0000
hex 000F0000
hex 000F0000
hex 0FFFFF00
s_J hex 000000F0
hex 000000F0
hex 000000F0
hex 0F0000F0
hex 0F0000F0
hex 00FFFF00
s_K hex 0F000F00
hex 0F00F000
hex 0FFF0000
hex 0F00F000
hex 0F000F00
hex 0F000F00
s_L hex 0F000000
hex 0F000000
hex 0F000000
hex 0F000000
hex 0F000000
hex 0FFFFFF0
s_M hex 0F0000F0
hex 0FF00FF0
hex 0F0FF0F0
hex 0F0000F0
hex 0F0000F0
hex 0F0000F0
s_N hex 0F0000F0
hex 0FF000F0
hex 0F0F00F0
hex 0F00F0F0
hex 0F000FF0
hex 0F0000F0
s_O hex 00FFFF00
hex 0F0000F0
hex 0F0000F0
hex 0F0000F0
hex 0F0000F0
hex 00FFFF00
s_P hex 0FFFFF00
hex 0F0000F0
hex 0FFFFF00
hex 0F000000
hex 0F000000
hex 0F000000
s_Q hex 00FFFF00
hex 0F0000F0
hex 0F0000F0
hex 0F00F0F0
hex 0F000FF0
hex 00FFFFF0
s_R hex 0FFFFF00
hex 0F0000F0
hex 0FFFFF00
hex 0F000F00
hex 0F0000F0
hex 0F0000F0
s_S hex 00FFFFF0
hex 0F000000
hex 00FFFF00
hex 000000F0
hex 000000F0
hex 0FFFFF00
s_T hex 0FFFFF00
hex 000F0000
hex 000F0000
hex 000F0000
hex 000F0000
hex 000F0000
s_U hex 0F0000F0
hex 0F0000F0
hex 0F0000F0
hex 0F0000F0
hex 0F0000F0
hex 00FFFF00
s_V hex 0F0000F0
hex 0F0000F0
hex 0F0000F0
hex 0F0000F0
hex 00F00F00
hex 000FF000
s_W hex 0F0000F0
hex 0F0000F0
hex 0F0000F0
hex 0F0FF0F0
hex 0FF00FF0
hex 0F0000F0
s_X hex 0F0000F0
hex 00F00F00
hex 000FF000
hex 000FF000
hex 00F00F00
hex 0F0000F0
s_Y hex F00000F0
hex 0F000F00
hex 00F0F000
hex 000F0000
hex 000F0000
hex 000F0000
s_Z hex 0FFFFFF0
hex 00000F00
hex 0000F000
hex 000F0000
hex 00F00000
hex 0FFFFFF0
s_LBracket hex 000FFF00
hex 000F0000
hex 000F0000
hex 000F0000
hex 000F0000
hex 000FFF00
s_BackSlash hex 0F000000
hex 00F00000
hex 000F0000
hex 0000F000
hex 00000F00
hex 000000F0
s_RBracket hex 00FFF000
hex 0000F000
hex 0000F000
hex 0000F000
hex 0000F000
hex 00FFF000
s_Carot hex 0000F000
hex 000F0F00
hex 00F000F0
hex 00000000
hex 00000000
hex 00000000
s_UnderLine hex 00000000
hex 00000000
hex 00000000
hex 00000000
hex 00000000
hex FFFFFFF0
s_Template hex 00000000
hex 00000000
hex 00000000
hex 00000000
hex 00000000
hex 00000000

32
demos/lite/package.json Normal file
View File

@ -0,0 +1,32 @@
{
"name": "gte-lite-demo",
"version": "1.0.0",
"description": "A testbed for testing hte GTE lite rendering mode",
"main": "index.js",
"config": {
"merlin32": "C:\\Programs\\IIgsXDev\\bin\\Merlin32-1.1.10.exe",
"cadius": "C:\\Programs\\IIgsXDev\\bin\\Cadius.exe",
"gsport": "C:\\Programs\\gsport\\gsport_0.31\\GSPort.exe",
"macros": "../../macros",
"crossrunner": "C:\\Programs\\Crossrunner\\Crossrunner.exe"
},
"scripts": {
"test": "npm run build && build-image.bat %npm_package_config_cadius% && %npm_package_config_gsport%",
"debug": "%npm_package_config_crossrunner% GTELiteDemo -Source MAINSEG_Output.txt -Debug -CompatibilityLayer -Map App.s",
"build": "npm run build:tool && npm run build:sys16",
"build:sys16": "%npm_package_config_merlin32% -V %npm_package_config_macros% App.s",
"build:tool": "%npm_package_config_merlin32% -V %npm_package_config_macros% ../../src/Master.s"
},
"repository": {
"type": "git",
"url": "git+https://github.com/lscharen/iigs-game-engine.git"
},
"author": "Lucas Scharenbroich",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/lscharen/iigs-game-engine/issues"
},
"homepage": "https://github.com/lscharen/iigs-game-engine#readme",
"devDependencies": {
}
}

124
demos/smb/App.Msg.s Normal file
View File

@ -0,0 +1,124 @@
mx %00
HexToChar dfb '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'
; Convert a byte (Acc) into a string and store at (Y)
ByteToString and #$00FF
sep #$20
pha
lsr
lsr
lsr
lsr
and #$0F
tax
ldal HexToChar,x
sta: $0000,y
pla
and #$0F
tax
ldal HexToChar,x
sta: $0001,y
rep #$20
rts
; Convert a word (Acc) into a hexadecimal string and store at (Y)
WordToString pha
bra Addr2ToString
; Pass in Acc = High, X = low
Addr3ToString phx
jsr ByteToString
iny
iny
lda 1,s
Addr2ToString xba
jsr ByteToString
iny
iny
pla
jsr ByteToString
rts
; A=Value
; X=Screen offset
DrawByte phx ; Save register value
phy
ldy #ByteBuff+1
jsr ByteToString
ply
plx
lda #ByteBuff
jsr DrawString
rts
; A=Value
; X=Screen offset
DrawWord phx ; Save register value
phy
ldy #WordBuff+1
jsr WordToString
ply
plx
lda #WordBuff
jsr DrawString
rts
ClearWord lda #EmptyBuff
jsr DrawString
rts
EmptyBuff str ' '
ByteBuff str '00'
WordBuff str '0000'
Addr3Buff str '000000' ; str adds leading length byte

View File

@ -1,16 +1,20 @@
; IIgs Game Engine
TYP $B3 ; S16 file
DSK GTETestApp
DSK SuperMarioGS
XPL
; Segment #1 -- Main execution block
ASM Main.s
KND #$1100
SNA MAIN
; Segment #2 -- ROM
ASM rom.s
ASM rom2.s
KND #$1100
SNA SMBROM

4
demos/smb/Externals.s Normal file
View File

@ -0,0 +1,4 @@
SMBStart EXT ; Base address of the ROM. Should be XX/8000 in the bank the ROM is loaded into
NonMaskableInterrupt EXT ; Called every VBL
ExtIn EXT
ROMBase EXT

File diff suppressed because it is too large Load Diff

59
demos/smb/Sim.s Normal file
View File

@ -0,0 +1,59 @@
; IIgs Game Engine
TYP $B3 ; S16 file
DSK APUSim
XPL
; Segment #1 -- Main execution block
ASM apu_sim.s
KND #$1100
SNA MAIN

View File

@ -1 +1,4 @@
GTETestApp=Type(B3),AuxType(0000),VersionCreate(70),MinVersion(BE),Access(E3),FolderInfo1(000000000000000000000000000000000000),FolderInfo2(000000000000000000000000000000000000)
SMBProto.SHK=Type(E0),AuxType(8002),VersionCreate(80),MinVersion(87),Access(E3),FolderInfo1(000000000000000000000000000000000000),FolderInfo2(000000000000000000000000000000000000)
SMBProto2.SHK=Type(E0),AuxType(8002),VersionCreate(80),MinVersion(87),Access(E3),FolderInfo1(000000000000000000000000000000000000),FolderInfo2(000000000000000000000000000000000000)
APUSim=Type(B3),AuxType(0000),VersionCreate(70),MinVersion(BE),Access(E3),FolderInfo1(000000000000000000000000000000000000),FolderInfo2(000000000000000000000000000000000000)
SuperMarioGS=Type(B3),AuxType(0000),VersionCreate(70),MinVersion(BE),Access(E3),FolderInfo1(000000000000000000000000000000000000),FolderInfo2(000000000000000000000000000000000000)

1264
demos/smb/apu.s Normal file

File diff suppressed because it is too large Load Diff

728
demos/smb/apu_sim.s Normal file
View File

@ -0,0 +1,728 @@
; APU Sim
;
; Interactive driver for the APU emulation. Inspired by the liveNES ROM (https://github.com/plgDavid/livenes)
REL
use EDS.GSOS.Macs
; Keycodes
LEFT_ARROW equ $08
RIGHT_ARROW equ $15
UP_ARROW equ $0B
DOWN_ARROW equ $0A
SHADOW_REG equ $E0C035
KBD_REG equ $E0C000
KBD_STROBE_REG equ $E0C010
VBL_STATE_REG equ $E0C019
MOD_REG equ $E0C025
COMMAND_KEY_REG equ $E0C061
OPTION_KEY_REG equ $E0C062
; ReadControl return value bits
PAD_BUTTON_B equ $0100
PAD_BUTTON_A equ $0200
PAD_KEY_DOWN equ $0400
; Direct page space
MyUserId equ 0
LastKey equ 2
CursorRow equ 4
CursorCol equ 6
Tmp0 equ 128
Tmp1 equ 130
mx %00
phk
plb
sta MyUserId
stz CursorCol
stz CursorRow
jsr InitGraphics
jsr DrawStaticUI
jsr APUStartUp
sep #$30
lda #$f
jsl APU_STATUS_WRITE ; turn on the first four channels by default
rep #$30
:update
jsr DrawUI
:evtloop
; jsr DrawDynUI ; Always update to see changing internal APU values
jsr _ReadControl
bit #PAD_KEY_DOWN ; Only response to actual key presses
beq :evtloop
and #$007F
cmp #'q'
beq :done
cmp #UP_ARROW
bne *+8
jsr MoveUp
brl :update
cmp #DOWN_ARROW
bne *+8
jsr MoveDown
brl :update
cmp #LEFT_ARROW
bne *+8
jsr MoveLeft
brl :update
cmp #RIGHT_ARROW
bne *+8
jsr MoveRight
brl :update
cmp #' '
bne :not_spc
jsr Toggle
brl :update
:not_spc cmp #'a'
bne :not_a
lda show_border
eor #1
sta show_border
:not_a
brl :evtloop
:done
jsr APUShutDown
Quit
_QuitGS qtRec
qtRec adrl $0000
da $00
; Toggle an APU bit
Toggle
mx %11
sep #$30
lda CursorRow
asl
tax
jmp (:toggle1,x)
:toggle1 da Toggle4000,Toggle4001,Toggle4002,Toggle4003
da Toggle4008,Toggle400A,Toggle400B,ToggleNoop
da Toggle4004,Toggle4005,Toggle4006,Toggle4007
da Toggle400C,Toggle400E,Toggle400F,Toggle4015
ToggleNoop
brl ToggleExit
Toggle4000
lda APU_PULSE1_REG1
ldx CursorCol
eor ToggleTable,x
jsl APU_PULSE1_REG1_WRITE
brl ToggleExit
Toggle4001
lda APU_PULSE1_REG2
ldx CursorCol
eor ToggleTable,x
jsl APU_PULSE1_REG2_WRITE
brl ToggleExit
Toggle4002
lda APU_PULSE1_REG3
ldx CursorCol
eor ToggleTable,x
jsl APU_PULSE1_REG3_WRITE
brl ToggleExit
Toggle4003
lda APU_PULSE1_REG4
ldx CursorCol
eor ToggleTable,x
jsl APU_PULSE1_REG4_WRITE
brl ToggleExit
Toggle4004
lda APU_PULSE2_REG1
ldx CursorCol
eor ToggleTable,x
jsl APU_PULSE2_REG1_WRITE
brl ToggleExit
Toggle4005
lda APU_PULSE2_REG2
ldx CursorCol
eor ToggleTable,x
jsl APU_PULSE2_REG2_WRITE
brl ToggleExit
Toggle4006
lda APU_PULSE2_REG3
ldx CursorCol
eor ToggleTable,x
jsl APU_PULSE2_REG3_WRITE
brl ToggleExit
Toggle4007
lda APU_PULSE2_REG4
ldx CursorCol
eor ToggleTable,x
jsl APU_PULSE2_REG4_WRITE
brl ToggleExit
Toggle4008
lda APU_TRIANGLE_REG1
ldx CursorCol
eor ToggleTable,x
jsl APU_TRIANGLE_REG1_WRITE
brl ToggleExit
Toggle400A
lda APU_TRIANGLE_REG3
ldx CursorCol
eor ToggleTable,x
jsl APU_TRIANGLE_REG3_WRITE
brl ToggleExit
Toggle400B
lda APU_TRIANGLE_REG4
ldx CursorCol
eor ToggleTable,x
jsl APU_TRIANGLE_REG4_WRITE
brl ToggleExit
Toggle400C
lda APU_NOISE_REG1
ldx CursorCol
eor ToggleTable,x
jsl APU_NOISE_REG1_WRITE
brl ToggleExit
Toggle400E
lda APU_NOISE_REG3
ldx CursorCol
eor ToggleTable,x
jsl APU_NOISE_REG3_WRITE
brl ToggleExit
Toggle400F
lda APU_NOISE_REG4
ldx CursorCol
eor ToggleTable,x
jsl APU_NOISE_REG4_WRITE
brl ToggleExit
Toggle4015
lda APU_STATUS
ldx CursorCol
eor ToggleTable,x
jsl APU_STATUS_WRITE
bra ToggleExit
TogglePulse2
ToggleExit
rep #$30
rts
ToggleTable dfb $80,$40,$20,$10,$08,$04,$02,$01
; Cursor navigation
mx %00
MoveUp
lda CursorRow
bne :not_0
lda #6
sta CursorRow
rts
:not_0
cmp #8
bne :not_8
lda #15
sta CursorRow
rts
:not_8
dec
sta CursorRow
rts
MoveDown
lda CursorRow
cmp #6
bne :not_6
stz CursorRow
rts
:not_6
cmp #15
bne :not_15
lda #8
sta CursorRow
rts
:not_15
inc
sta CursorRow
rts
MoveLeft
lda CursorCol
dec
bpl :store
lda CursorRow
cmp #15
beq :skip
eor #8
sta CursorRow
:skip
lda #7
:store sta CursorCol
rts
MoveRight
lda CursorCol
inc
cmp #8
bcc :store
lda CursorRow
cmp #15
beq :skip
eor #8
sta CursorRow
:skip
lda #0
:store sta CursorCol
rts
; Read the keyboard and paddle controls and return in a game-controller-like format
mx %00
_ReadControl pea $0000 ; low byte = key code, high byte = %------AB
sep #$20
ldal OPTION_KEY_REG ; 'B' button
and #$80
beq :BNotDown
lda #>PAD_BUTTON_B
ora 2,s
sta 2,s
:BNotDown
ldal COMMAND_KEY_REG
and #$80
beq :ANotDown
lda #>PAD_BUTTON_A
ora 2,s
sta 2,s
:ANotDown
ldal KBD_STROBE_REG ; read the keyboard
bit #$80
beq :KbdNotDwn ; check the key-down status
and #$7f
ora 1,s
sta 1,s
cmp LastKey
beq :KbdDown
sta LastKey
lda #>PAD_KEY_DOWN ; set the keydown flag
ora 2,s
sta 2,s
bra :KbdDown
:KbdNotDwn
stz LastKey
:KbdDown
ldal KBD_REG
rep #$20
pla
rts
mx %00
InitGraphics
sep #$20
lda #$C1
stal $E0C029 ; screen on
ldal SHADOW_REG ; shadow on
and #$F7
stal SHADOW_REG
rep #$20
lda #0
ldx #0
:scbloop stal $012000,x
inx
inx
cpx #$7E00
bcc :scbloop
ldx #0
:palloop lda DefaultPalette,x
stal $019E00,x
inx
inx
cpx #$20
bcc :palloop
rts
DefaultPalette ENT
dw $0000,$0777,$0841,$072C
dw $000F,$0080,$0F70,$0D00
dw $0FA9,$0FF0,$00E0,$04DF
dw $0DAF,$078F,$0CCC,$0FFF
; UI string templates
PULSE1_TITLE str 'PULSE1'
PULSE2_TITLE str 'PULSE2'
TRIANGLE_TITLE str 'TRIANGLE'
NOISE_TITLE str 'NOISE'
CONTROL_TITLE str 'CONTROL'
PULSE_REG1_STR str 'DDLCVVVV'
PULSE_REG2_STR str 'EPPPNSSS'
PULSE_REG3_STR str 'TTTTTTTT'
PULSE_REG4_STR str 'LLLLLTTT'
TRIANGLE_REG1_STR str 'CRRRRRRR'
TRIANGLE_REG3_STR str 'TTTTTTTT'
TRIANGLE_REG4_STR str 'LLLLLTTT'
NOISE_REG1_STR str '--LCVVVV'
NOISE_REG3_STR str 'L---PPPP'
NOISE_REG4_STR str 'LLLLL---'
APU_STATUS_STR str '---DNT21'
ROW_SPAN equ {8*160}
DrawDynUI
ldx #{18*4}+{ROW_SPAN*5}
ldy #$3333
lda APU_PULSE1_LENGTH_COUNTER
jsr DrawByte
ldx #{18*4}+{ROW_SPAN*6}
ldy #$3333
lda APU_PULSE1_MUTE
jsr DrawByte
ldx #{18*4}+{ROW_SPAN*7}
ldy #$3333
lda APU_PULSE1_ENVELOPE
jsr DrawByte
ldx #{18*4}+{ROW_SPAN*8}
ldy #$3333
lda APU_PULSE1_CURRENT_PERIOD
jsr DrawWord
; Draw stuff that will never be updated
DrawStaticUI
ldx #{6*4}+{ROW_SPAN*3}
ldy #$1111
lda #PULSE1_TITLE
jsr DrawString
ldx #{22*4}+{ROW_SPAN*3}
ldy #$1111
lda #PULSE2_TITLE
jsr DrawString
ldx #{6*4}+{ROW_SPAN*10}
ldy #$1111
lda #TRIANGLE_TITLE
jsr DrawString
ldx #{22*4}+{ROW_SPAN*10}
ldy #$1111
lda #NOISE_TITLE
jsr DrawString
ldx #{22*4}+{ROW_SPAN*16}
ldy #$1111
lda #CONTROL_TITLE
jsr DrawString
DrawUI
jsr DrawPulse1
jsr DrawPulse2
jsr DrawTriangle
jsr DrawNoise
jsr DrawControl
jsr DrawCursor
rts
PULSE1_X equ 1
PULSE1_Y equ 5
DrawPulse1
ldx #{PULSE1_X*4}+{ROW_SPAN*PULSE1_Y}
ldy #$4444
lda #$4000
jsr DrawWord
ldy #PULSE_REG1_STR
lda APU_PULSE1_REG1
ldx #{{PULSE1_X+5}*4}+{ROW_SPAN*PULSE1_Y}
jsr DrawBitsHL
ldx #{PULSE1_X*4}+{ROW_SPAN*{PULSE1_Y+1}}
ldy #$4444
lda #$4001
jsr DrawWord
ldy #PULSE_REG2_STR
lda APU_PULSE1_REG2
ldx #{{PULSE1_X+5}*4}+{ROW_SPAN*{PULSE1_Y+1}}
jsr DrawBitsHL
ldx #{PULSE1_X*4}+{ROW_SPAN*{PULSE1_Y+2}}
ldy #$4444
lda #$4002
jsr DrawWord
ldy #PULSE_REG3_STR
lda APU_PULSE1_REG3
ldx #{{PULSE1_X+5}*4}+{ROW_SPAN*{PULSE1_Y+2}}
jsr DrawBitsHL
ldx #{PULSE1_X*4}+{ROW_SPAN*{PULSE1_Y+3}}
ldy #$4444
lda #$4003
jsr DrawWord
ldy #PULSE_REG4_STR
lda APU_PULSE1_REG4
ldx #{{PULSE1_X+5}*4}+{ROW_SPAN*{PULSE1_Y+3}}
jsr DrawBitsHL
rts
PULSE2_X equ 17
PULSE2_Y equ 5
DrawPulse2
ldx #{PULSE2_X*4}+{ROW_SPAN*PULSE2_Y}
ldy #$4444
lda #$4004
jsr DrawWord
ldy #PULSE_REG1_STR
lda APU_PULSE2_REG1
ldx #{{PULSE2_X+5}*4}+{ROW_SPAN*PULSE2_Y}
jsr DrawBitsHL
ldx #{PULSE2_X*4}+{ROW_SPAN*{PULSE2_Y+1}}
ldy #$4444
lda #$4005
jsr DrawWord
ldy #PULSE_REG2_STR
lda APU_PULSE2_REG2
ldx #{{PULSE2_X+5}*4}+{ROW_SPAN*{PULSE2_Y+1}}
jsr DrawBitsHL
ldx #{PULSE2_X*4}+{ROW_SPAN*{PULSE2_Y+2}}
ldy #$4444
lda #$4006
jsr DrawWord
ldy #PULSE_REG3_STR
lda APU_PULSE2_REG3
ldx #{{PULSE2_X+5}*4}+{ROW_SPAN*{PULSE2_Y+2}}
jsr DrawBitsHL
ldx #{PULSE2_X*4}+{ROW_SPAN*{PULSE2_Y+3}}
ldy #$4444
lda #$4007
jsr DrawWord
ldy #PULSE_REG4_STR
lda APU_PULSE2_REG4
ldx #{{PULSE2_X+5}*4}+{ROW_SPAN*{PULSE2_Y+3}}
jsr DrawBitsHL
rts
TRIANGLE_X equ 1
TRIANGLE_Y equ 12
DrawTriangle
ldx #{TRIANGLE_X*4}+{ROW_SPAN*TRIANGLE_Y}
ldy #$4444
lda #$4008
jsr DrawWord
ldy #TRIANGLE_REG1_STR
lda APU_TRIANGLE_REG1
ldx #{{TRIANGLE_X+5}*4}+{ROW_SPAN*TRIANGLE_Y}
jsr DrawBitsHL
ldx #{TRIANGLE_X*4}+{ROW_SPAN*{TRIANGLE_Y+1}}
ldy #$4444
lda #$400A
jsr DrawWord
ldy #TRIANGLE_REG3_STR
lda APU_TRIANGLE_REG3
ldx #{{TRIANGLE_X+5}*4}+{ROW_SPAN*{TRIANGLE_Y+1}}
jsr DrawBitsHL
ldx #{TRIANGLE_X*4}+{ROW_SPAN*{TRIANGLE_Y+2}}
ldy #$4444
lda #$400B
jsr DrawWord
ldy #TRIANGLE_REG4_STR
lda APU_TRIANGLE_REG4
ldx #{{TRIANGLE_X+5}*4}+{ROW_SPAN*{TRIANGLE_Y+2}}
jsr DrawBitsHL
rts
NOISE_X equ 17
NOISE_Y equ 12
DrawNoise
ldx #{NOISE_X*4}+{ROW_SPAN*NOISE_Y}
ldy #$4444
lda #$400C
jsr DrawWord
ldy #NOISE_REG1_STR
lda APU_NOISE_REG1
ldx #{{NOISE_X+5}*4}+{ROW_SPAN*NOISE_Y}
jsr DrawBitsHL
ldx #{NOISE_X*4}+{ROW_SPAN*{NOISE_Y+1}}
ldy #$4444
lda #$400E
jsr DrawWord
ldy #NOISE_REG3_STR
lda APU_NOISE_REG3
ldx #{{NOISE_X+5}*4}+{ROW_SPAN*{NOISE_Y+1}}
jsr DrawBitsHL
ldx #{NOISE_X*4}+{ROW_SPAN*{NOISE_Y+2}}
ldy #$4444
lda #$400F
jsr DrawWord
ldy #NOISE_REG4_STR
lda APU_NOISE_REG4
ldx #{{NOISE_X+5}*4}+{ROW_SPAN*{NOISE_Y+2}}
jsr DrawBitsHL
rts
; Draw the APU Status byte
CONTROL_X equ 17
CONTROL_Y equ 18
DrawControl
ldx #{CONTROL_X*4}+{ROW_SPAN*CONTROL_Y}
ldy #$4444
lda #$4015
jsr DrawWord
ldy #APU_STATUS_STR
lda APU_STATUS
ldx #{{CONTROL_X+5}*4}+{ROW_SPAN*CONTROL_Y}
jsr DrawBitsHL
rts
DrawCursor
lda CursorRow
asl
tax
lda row2screen,x ; Get the physical position of each logical row
asl
asl
asl
asl
asl
pha
asl
asl
clc
adc 1,s
asl
asl
asl
sta 1,s
lda CursorCol
clc
adc col2screen,x
asl
asl
clc
adc 1,s
tax
pla
lda #'_'
ldy #$FFFF
jsr DrawBottom
rts
row2screen dw 5,6,7,8,12,13,14,0,5,6,7,8,12,13,14,18 ; 16 logical rows, 0-7 are column 1, 8-15 column 2
col2screen dw 6,6,6,6,6, 6, 6, 0,22,22,22,22,22,22,22,22 ;
; Draw a byte as a series of bits using the template strings and
; the bit values to set the color
;
; x = screen coordinates
; y = string template
; a = byte value
DrawBitsHL
and #$00FF
xba
sta Tmp0
iny ; advance past string length byte
sty Tmp1
ldy #0
:loop
phy
lda (Tmp1),y
and #$00FF
ldy #$1111 ; dk. grey
asl Tmp0
bcc *+5
ldy #$FFFF ; white
jsr DrawChar
txa
clc
adc #4
tax
ply
iny
cpy #8
bcc :loop
rts
setborder
php
sep #$20
eorl $E0C034
and #$0F
eorl $E0C034
stal $E0C034
plp
rts
put App.Msg.s
put font.s
put apu.s

18
demos/smb/build-image.bat Normal file
View File

@ -0,0 +1,18 @@
echo off
REM Copy all of the assets into the ProDOS image for emulator testing
REM
REM Pass the path of the Cadius tool as the first argument (%1)
set CADIUS="%1"
set IMAGE="..\\..\\emu\\Target.2mg"
set FOLDER="/GTEDEV/SMB"
REM Cadius does not overwrite files, so clear the root folder first
%CADIUS% DELETEFOLDER %IMAGE% %FOLDER%
%CADIUS% CREATEFOLDER %IMAGE% %FOLDER%
REM Now copy files and folders as needed
%CADIUS% ADDFILE %IMAGE% %FOLDER% .\SuperMarioGS
%CADIUS% ADDFILE %IMAGE% %FOLDER% .\APUSim
%CADIUS% ADDFILE %IMAGE% %FOLDER% ..\..\src\Tool160

569
demos/smb/chr.s Normal file
View File

@ -0,0 +1,569 @@
; 8 * 8 * 2 (2 bits to codify color) = 128 bits = 16 bytes to codify a single tile
;
; Surprisingly, 2 bits of a pixel are not codified in the same byte. A tile is
; described using 16 bytes. And each row is encoded using 2 bytes that stand 8
; bytes apart from each other. To figure out the color index of the top-left pixel,
; we need to read the 7th bit of byte 0x0000 and the 7th bit of byte 0x0008, to get
; the next pixel in the same row we would need to read 6th bits in the same bytes, etc.
;
; Decode the first row which is the back of mario's head
;
; ADDR VAL BITS ADDR VAL BITS
;
; 0x00 $03 00000011 0x08 $00 00000000 00 00 00 00 00 00 01 01 0 0 0 0 0 0 1 1
; 0x01 $0F 00001111 0x09 $00 00000000 00 00 00 00 01 01 01 01 0 0 0 0 1 1 1 1
; 0x02 $1F 00011111 0x0A $00 00000000 00 00 00 01 01 01 01 01 0 0 0 1 1 1 1 1
; 0x03 $1F 00011111 0x0B $00 00000000 = 00 00 00 01 01 01 01 01 = 0 0 0 1 1 1 1 1
; 0x04 $1C 00011100 0x0C $1F 00011111 00 00 00 11 11 11 10 10 0 0 0 3 3 3 2 2
; 0x05 $24 00100100 0x0D $3F 00111111 00 00 11 10 10 11 10 10 0 0 3 2 2 3 2 2
; 0x06 $26 00100110 0x0E $3F 00111111 00 00 11 10 10 11 11 10 0 0 3 2 2 3 3 2
; 0x07 $66 01100110 0x0F $7F 11111111 10 11 11 10 10 11 11 10 2 3 3 2 2 3 3 2
; Begin Bank 0
db $03,$0f,$1f,$1f,$1c,$24,$26,$66,$00,$00,$00,$00,$1f,$3f,$3f,$7f
db $e0,$c0,$80,$fc,$80,$c0,$00,$20,$00,$20,$60,$00,$f0,$fc,$fe,$fe
db $60,$70,$18,$07,$0f,$1f,$3f,$7f,$7f,$7f,$1f,$07,$00,$1e,$3f,$7f
db $fc,$7c,$00,$00,$e0,$f0,$f8,$f8,$fc,$fc,$f8,$c0,$c2,$67,$2f,$37
db $7f,$7f,$ff,$ff,$07,$07,$0f,$0f,$7f,$7e,$fc,$f0,$f8,$f8,$f0,$70
db $fd,$fe,$b4,$f8,$f8,$f9,$fb,$ff,$37,$36,$5c,$00,$00,$01,$03,$1f
db $1f,$3f,$ff,$ff,$fc,$70,$70,$38,$08,$24,$e3,$f0,$f8,$70,$70,$38
db $ff,$ff,$ff,$1f,$00,$00,$00,$00,$1f,$1f,$1f,$1f,$00,$00,$00,$00
db $00,$00,$01,$07,$0f,$0f,$0e,$12,$00,$00,$00,$00,$00,$00,$0f,$1f
db $00,$00,$f0,$e0,$c0,$fe,$40,$60,$00,$00,$00,$10,$30,$00,$f8,$fe
db $13,$33,$30,$18,$04,$0f,$1f,$1f,$1f,$3f,$3f,$1f,$07,$08,$17,$17
db $00,$10,$7e,$3e,$00,$00,$c0,$e0,$ff,$ff,$fe,$fe,$fc,$e0,$40,$a0
db $3f,$3f,$3f,$1f,$1f,$1f,$1f,$1f,$37,$27,$23,$03,$01,$00,$00,$00
db $f0,$f0,$f0,$f8,$f8,$f8,$f8,$f8,$cc,$ff,$ff,$ff,$ff,$70,$00,$08
db $ff,$ff,$ff,$fe,$f0,$c0,$80,$00,$f0,$f0,$f0,$f0,$f0,$c0,$80,$00
db $fc,$fc,$f8,$78,$78,$78,$7e,$7e,$10,$60,$80,$00,$78,$78,$7e,$7e
db $00,$03,$0f,$1f,$1f,$1c,$24,$26,$00,$00,$00,$00,$00,$1f,$3f,$3f
db $00,$e0,$c0,$80,$fc,$80,$c0,$00,$00,$00,$20,$60,$00,$f0,$fc,$fe
db $66,$60,$30,$18,$0f,$1f,$3f,$3f,$7f,$7f,$3f,$1f,$00,$16,$2f,$2f
db $20,$fc,$7c,$00,$00,$e0,$e0,$f0,$fe,$fc,$fc,$f8,$c0,$60,$20,$30
db $3f,$3f,$3f,$3f,$3f,$3f,$3f,$1f,$2f,$2f,$2f,$0f,$07,$03,$00,$00
db $f0,$90,$00,$08,$0c,$1c,$fc,$f8,$10,$f0,$f0,$f0,$f0,$e0,$c0,$e0
db $0f,$0f,$07,$07,$07,$0f,$0f,$03,$01,$03,$01,$04,$07,$0f,$0f,$03
db $f8,$f0,$e0,$f0,$b0,$80,$e0,$e0,$f8,$f0,$e0,$70,$b0,$80,$e0,$e0
db $03,$3f,$7f,$19,$09,$09,$28,$5c,$00,$30,$70,$7f,$ff,$ff,$f7,$f3
db $f8,$e0,$e0,$fc,$26,$30,$80,$10,$00,$18,$10,$00,$f8,$f8,$fe,$ff
db $3e,$1e,$3f,$38,$30,$30,$00,$3a,$e7,$0f,$0f,$1f,$1f,$1f,$0f,$07
db $78,$1e,$80,$fe,$7e,$7e,$7f,$7f,$ff,$fe,$fc,$c6,$8e,$ee,$ff,$ff
db $3c,$3f,$1f,$0f,$07,$3f,$21,$20,$03,$00,$00,$0e,$07,$3f,$3f,$3f
db $ff,$ff,$ff,$fe,$fe,$fe,$fc,$70,$ff,$7f,$3f,$0e,$c0,$c0,$e0,$e0
db $0f,$9f,$cf,$ff,$7f,$3f,$1e,$0e,$00,$80,$c8,$fe,$7f,$3f,$1e,$0e
db $20,$c0,$80,$80,$00,$00,$00,$00,$e0,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$03,$0f,$1f,$1f,$1c,$24,$00,$00,$00,$00,$00,$00,$1f,$3f
db $00,$04,$e6,$e0,$ff,$ff,$8f,$83,$0e,$1f,$1f,$1f,$1f,$03,$ff,$ff
db $26,$26,$60,$78,$18,$0f,$7f,$ff,$3f,$3f,$7f,$7f,$1f,$00,$7e,$ff
db $01,$21,$fe,$7a,$06,$fe,$fc,$fc,$ff,$ff,$fe,$fe,$fe,$de,$5c,$6c
db $ff,$cf,$87,$07,$07,$0f,$1f,$1f,$ff,$ff,$fe,$fc,$f8,$b0,$60,$00
db $f8,$f8,$f0,$b8,$f8,$f9,$fb,$ff,$28,$30,$18,$40,$00,$01,$03,$0f
db $1f,$ff,$ff,$ff,$ff,$fe,$c0,$80,$10,$ec,$e3,$e0,$e0,$e0,$c0,$80
db $ff,$ff,$ff,$3f,$00,$00,$00,$00,$0f,$0f,$0f,$0f,$00,$00,$00,$00
db $13,$33,$30,$18,$04,$0f,$1f,$1f,$1f,$3f,$3f,$1f,$07,$09,$13,$17
db $00,$10,$7e,$30,$e0,$f0,$f0,$e0,$ff,$ff,$fe,$ff,$fe,$fc,$f8,$e0
db $1f,$1f,$0f,$0f,$0f,$1f,$1f,$1f,$17,$17,$03,$00,$00,$00,$00,$00
db $f0,$f0,$f8,$f8,$b8,$f8,$f8,$f8,$d0,$90,$18,$08,$40,$00,$00,$00
db $3f,$ff,$ff,$ff,$f6,$c6,$84,$00,$30,$f0,$f0,$f1,$f6,$c6,$84,$00
db $f0,$e0,$80,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $1f,$1f,$3f,$3f,$1f,$0f,$0f,$1f,$1f,$1f,$3f,$3e,$7c,$78,$f0,$e0
db $f0,$f0,$f8,$f8,$b8,$f8,$f8,$f0,$b0,$90,$18,$08,$40,$00,$00,$00
db $e0,$f0,$f0,$f0,$f0,$f0,$f8,$f0,$c0,$e0,$fc,$fe,$ff,$7f,$03,$00
db $1f,$1f,$1f,$3f,$3e,$3c,$38,$18,$00,$00,$10,$38,$3e,$3c,$38,$18
db $00,$03,$07,$07,$0a,$0b,$0c,$00,$00,$00,$00,$07,$0f,$0f,$0f,$03
db $00,$e0,$fc,$20,$20,$10,$3c,$00,$00,$00,$00,$f0,$fc,$fe,$fc,$f8
db $07,$07,$07,$1f,$1f,$3e,$21,$01,$07,$0f,$1b,$18,$10,$30,$21,$01
db $e0,$e0,$e0,$f0,$f0,$e0,$c0,$e0,$a8,$fc,$f8,$00,$00,$00,$c0,$e0
db $07,$0f,$0e,$14,$16,$18,$00,$3f,$00,$00,$0f,$1f,$1f,$1f,$07,$3c
db $c0,$f8,$40,$40,$20,$78,$00,$c0,$00,$00,$e0,$f8,$fc,$f8,$f0,$c0
db $3f,$0e,$0f,$1f,$3f,$7c,$70,$38,$fc,$ed,$c0,$00,$00,$60,$70,$38
db $f0,$f8,$e4,$fc,$fc,$7c,$00,$00,$7e,$1e,$04,$0c,$0c,$0c,$00,$00
db $07,$0f,$0e,$14,$16,$18,$00,$0f,$00,$00,$0f,$1f,$1f,$1f,$07,$0d
db $1f,$1f,$1f,$1c,$0c,$07,$07,$07,$1e,$1c,$1e,$0f,$07,$00,$07,$07
db $e0,$60,$f0,$70,$e0,$e0,$f0,$80,$60,$90,$00,$80,$00,$e0,$f0,$80
db $07,$1f,$3f,$12,$13,$08,$1f,$31,$00,$10,$3f,$7f,$7f,$3f,$03,$0f
db $c0,$f0,$40,$00,$30,$18,$c0,$f8,$00,$00,$e0,$f8,$fc,$f8,$b0,$38
db $31,$39,$1f,$1f,$0f,$5f,$7e,$3c,$1f,$07,$00,$0e,$0f,$53,$7c,$3c
db $f8,$f8,$f0,$e0,$e0,$c0,$00,$00,$f8,$f8,$f0,$00,$00,$80,$00,$00
db $00,$e0,$fc,$27,$27,$11,$3e,$04,$07,$07,$03,$f7,$ff,$ff,$fe,$fc
db $3f,$7f,$3f,$0f,$1f,$3f,$7f,$4f,$3e,$7f,$ff,$e2,$50,$38,$70,$40
db $f8,$f9,$f9,$b7,$ff,$ff,$e0,$00,$e8,$71,$01,$4b,$03,$03,$00,$00
db $07,$07,$0f,$3f,$3f,$3f,$26,$04,$05,$03,$01,$30,$30,$30,$26,$04
db $f0,$f0,$f0,$e0,$c0,$00,$00,$00,$fe,$fc,$e0,$00,$00,$00,$00,$00
db $07,$07,$0f,$1f,$3f,$0f,$1c,$18,$05,$03,$01,$10,$30,$0c,$1c,$18
db $e0,$e0,$e0,$e0,$c0,$80,$00,$00,$c0,$e0,$f0,$78,$18,$08,$00,$00
db $07,$0f,$1f,$0f,$3f,$0f,$1c,$18,$07,$0f,$3e,$7c,$30,$0c,$1c,$18
db $e0,$e0,$e0,$40,$c0,$80,$00,$00,$60,$60,$60,$80,$00,$00,$00,$00
db $7f,$ff,$ff,$fb,$0f,$0f,$0f,$1f,$73,$f3,$f0,$f4,$f0,$f0,$70,$60
db $3f,$7e,$7c,$7c,$3c,$3c,$fc,$fc,$00,$00,$00,$00,$3c,$3c,$fc,$fc
db $60,$70,$18,$08,$0f,$1f,$3f,$7f,$7f,$7f,$1f,$07,$0b,$1b,$3b,$7b
db $fc,$7c,$00,$20,$f0,$f8,$fc,$fe,$fc,$fc,$f8,$e0,$d0,$d8,$dc,$de
db $0b,$0f,$1f,$1e,$3c,$3c,$3c,$7c,$c4,$e0,$e0,$40,$00,$3c,$3c,$7c
db $1f,$3f,$0d,$07,$0f,$0e,$1c,$3c,$1d,$3c,$3a,$38,$30,$00,$1c,$3c
db $00,$00,$00,$00,$00,$00,$00,$00,$22,$55,$55,$55,$55,$55,$77,$22
db $00,$07,$1f,$ff,$07,$1f,$0f,$06,$00,$00,$00,$00,$00,$00,$00,$00
db $3f,$ff,$ff,$ff,$ff,$ff,$fb,$76,$00,$00,$cf,$07,$7f,$00,$00,$00
db $20,$f8,$ff,$c3,$fd,$fe,$f0,$40,$00,$00,$3c,$fc,$fe,$e0,$00,$00
db $40,$e0,$40,$40,$41,$41,$4f,$47,$40,$e0,$40,$3f,$3e,$3e,$30,$38
db $00,$00,$00,$00,$00,$00,$e0,$c0,$00,$00,$00,$f8,$f8,$f8,$18,$38
db $43,$46,$44,$40,$40,$40,$40,$40,$3c,$39,$3b,$3f,$00,$00,$00,$00
db $80,$c0,$40,$00,$00,$00,$00,$00,$78,$38,$b8,$f8,$00,$00,$00,$00
db $31,$30,$38,$7c,$7f,$ff,$ff,$fb,$3f,$3f,$0f,$77,$77,$f7,$f7,$f7
db $10,$7e,$3e,$00,$1e,$fe,$ff,$ff,$ff,$fe,$fe,$fe,$fa,$fa,$f3,$e7
db $ff,$ff,$e3,$c3,$87,$48,$3c,$fc,$f0,$f8,$fc,$7c,$78,$38,$3c,$fc
db $00,$ff,$c3,$83,$83,$ff,$ff,$ff,$ff,$00,$c3,$81,$81,$c3,$ff,$00
db $1f,$1f,$0f,$07,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $f0,$fb,$ff,$ff,$fe,$3e,$0c,$04,$00,$0b,$1f,$1f,$1e,$3e,$0c,$04
db $1f,$1f,$0f,$0f,$07,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $fb,$ff,$ff,$ff,$ff,$00,$00,$00,$03,$0f,$0f,$0f,$0f,$00,$00,$00
db $00,$18,$3c,$7e,$6e,$df,$df,$df,$00,$18,$3c,$7e,$76,$fb,$fb,$fb
db $00,$18,$18,$3c,$3c,$3c,$3c,$1c,$00,$10,$10,$20,$20,$20,$20,$20
db $00,$08,$08,$08,$08,$08,$08,$00,$00,$08,$08,$08,$08,$08,$08,$08
db $00,$08,$08,$04,$04,$04,$04,$04,$00,$10,$10,$38,$38,$38,$38,$38
db $3c,$7e,$77,$fb,$9f,$5f,$8e,$20,$00,$18,$3c,$0e,$0e,$04,$00,$00
db $5c,$2e,$8f,$3f,$7b,$77,$7e,$3c,$00,$00,$04,$06,$1e,$3c,$18,$00
db $13,$4f,$3f,$bf,$3f,$7a,$f8,$f8,$00,$00,$01,$0a,$17,$0f,$2f,$1f
db $00,$08,$05,$0f,$2f,$1d,$1c,$3c,$00,$00,$00,$00,$05,$07,$0f,$07
db $00,$00,$00,$00,$02,$0b,$07,$0f,$00,$00,$00,$00,$00,$00,$01,$03
db $00,$00,$00,$00,$00,$08,$04,$04,$00,$60,$f0,$f8,$7c,$3e,$7e,$7f
db $02,$02,$02,$05,$71,$7f,$7f,$7f,$3f,$5f,$7f,$3e,$0e,$0a,$51,$20
db $00,$00,$00,$00,$00,$00,$00,$04,$00,$00,$00,$00,$00,$00,$0e,$1f
db $02,$02,$00,$01,$13,$3f,$7f,$7f,$3f,$7f,$7f,$fe,$ec,$ca,$51,$20
db $00,$40,$60,$70,$73,$27,$0f,$1f,$00,$40,$63,$77,$7c,$38,$f8,$e4
db $00,$00,$00,$00,$03,$07,$0f,$1f,$00,$00,$03,$07,$0c,$18,$f8,$e4
db $7f,$7f,$3f,$3f,$1f,$1f,$0f,$07,$03,$44,$28,$10,$08,$04,$03,$04
db $03,$07,$0f,$1f,$3f,$77,$77,$f5,$03,$07,$0f,$1f,$27,$7b,$78,$fb
db $c0,$e0,$f0,$f8,$fc,$ee,$ee,$af,$c0,$e0,$f0,$f8,$e4,$de,$1e,$df
db $f1,$ff,$78,$00,$00,$18,$1c,$0e,$ff,$ff,$7f,$0f,$0f,$07,$03,$00
db $8f,$ff,$1e,$00,$0c,$3e,$7e,$7c,$ff,$ff,$fe,$f0,$f0,$c0,$80,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$18,$24,$24,$18,$00,$00
db $00,$02,$41,$41,$61,$33,$06,$3c,$3c,$7e,$ff,$ff,$ff,$ff,$7e,$3c
db $03,$07,$0f,$1f,$3f,$7f,$7f,$ff,$03,$07,$0f,$1f,$3f,$63,$41,$c1
db $c0,$e0,$f0,$f8,$fc,$fe,$fe,$ff,$c0,$80,$00,$00,$8c,$fe,$fe,$f3
db $ff,$ff,$ff,$78,$00,$00,$00,$00,$c1,$e3,$ff,$47,$0f,$0f,$0f,$07
db $ff,$ff,$ff,$1e,$00,$20,$20,$40,$f1,$f9,$ff,$e2,$f0,$f0,$f0,$e0
db $16,$1f,$3f,$7f,$3d,$1d,$3f,$1f,$16,$1f,$00,$00,$05,$0d,$3f,$1f
db $80,$80,$c0,$e0,$f0,$f0,$f0,$f8,$80,$80,$00,$00,$00,$a0,$a0,$e0
db $3c,$fa,$b1,$72,$f2,$db,$df,$5f,$00,$04,$4e,$8c,$0c,$7f,$ff,$ff
db $00,$00,$00,$01,$01,$01,$06,$1e,$00,$00,$00,$00,$00,$00,$01,$01
db $00,$00,$00,$00,$00,$00,$00,$00,$ff,$7f,$3f,$1f,$0f,$07,$03,$01
db $00,$7c,$d6,$92,$ba,$ee,$fe,$38,$ff,$83,$29,$6d,$45,$11,$01,$c7
db $00,$15,$3f,$62,$5f,$ff,$9f,$7d,$08,$08,$02,$1f,$22,$02,$02,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$08,$08,$08,$08,$08,$08,$08,$08
db $2f,$1e,$2f,$2f,$2f,$15,$0d,$0e,$10,$1e,$10,$50,$10,$08,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$fe,$00,$00,$00,$00
db $1c,$3e,$7f,$ff,$ff,$fe,$7c,$38,$1c,$2a,$77,$ee,$dd,$aa,$74,$28
db $00,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$fe,$fe,$00,$ef,$ef,$ef,$00
db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$fe,$fe,$fe,$00,$ef,$ef,$ef,$00
db $7f,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$00,$7f,$5f,$7f,$7f,$7f,$7f,$7f
db $68,$4e,$e0,$e0,$e0,$f0,$f8,$fc,$b8,$9e,$80,$c0,$e0,$f0,$f8,$7c
db $3f,$5c,$39,$3b,$bb,$f9,$fc,$fe,$00,$23,$57,$4f,$57,$27,$c3,$21
db $c0,$f0,$f0,$f0,$f0,$e0,$c0,$00,$00,$30,$70,$70,$f0,$e0,$c0,$00
db $fe,$fc,$61,$0f,$ff,$fe,$f0,$e0,$13,$0f,$1e,$f0,$fc,$f8,$f0,$e0
db $6e,$40,$e0,$e0,$e0,$e0,$e0,$c0,$be,$90,$80,$c0,$c0,$80,$00,$00
db $01,$01,$03,$03,$07,$7f,$7f,$3f,$01,$01,$03,$03,$07,$7f,$7d,$3d
db $06,$07,$3f,$3c,$19,$7b,$7f,$3f,$06,$04,$30,$23,$06,$64,$60,$00
db $3f,$7f,$7f,$1f,$3f,$3f,$07,$06,$00,$60,$60,$00,$20,$30,$04,$06
db $03,$07,$0f,$0f,$0f,$0f,$07,$03,$00,$01,$01,$00,$00,$00,$00,$00
db $f8,$f8,$f8,$a0,$e1,$ff,$ff,$ff,$fe,$ff,$ff,$40,$01,$03,$03,$03
db $0f,$0f,$0f,$1f,$1f,$1f,$0f,$07,$01,$01,$00,$00,$00,$00,$00,$00
db $e0,$f8,$f8,$f8,$ff,$fe,$f0,$c0,$e0,$fe,$ff,$7f,$03,$02,$00,$00
db $01,$0f,$0f,$1f,$39,$33,$37,$7f,$01,$0d,$08,$00,$36,$2c,$08,$60
db $7f,$3f,$3f,$3f,$1f,$0f,$0f,$01,$60,$00,$20,$30,$00,$08,$0d,$01
db $00,$00,$03,$03,$47,$67,$77,$77,$01,$01,$03,$43,$67,$77,$7b,$78
db $00,$00,$00,$00,$88,$98,$f8,$f0,$00,$00,$80,$84,$cc,$dc,$bc,$3c
db $7e,$7f,$ff,$1f,$07,$30,$1c,$0c,$33,$07,$07,$e3,$38,$3f,$1c,$0c
db $7e,$38,$f6,$ed,$df,$38,$70,$60,$98,$c7,$c8,$92,$30,$f8,$70,$60
db $00,$00,$00,$03,$03,$47,$67,$77,$00,$01,$01,$03,$43,$67,$77,$7b
db $00,$00,$00,$00,$00,$88,$98,$f8,$00,$00,$00,$80,$84,$cc,$dc,$bc
db $77,$7e,$7f,$ff,$1f,$07,$70,$f0,$78,$33,$07,$07,$e3,$38,$7f,$f0
db $f0,$7e,$38,$f6,$ed,$df,$38,$3c,$3c,$98,$c7,$c8,$92,$30,$f8,$3c
db $03,$07,$0a,$1a,$1c,$1e,$0b,$08,$00,$10,$7f,$7f,$7f,$1f,$0f,$0f
db $1c,$3f,$3f,$3d,$3f,$1f,$00,$00,$03,$33,$39,$3a,$38,$18,$00,$00
db $00,$00,$04,$4c,$4e,$4e,$46,$6f,$10,$38,$3c,$74,$76,$76,$7e,$7d
db $00,$1f,$3f,$3f,$4f,$5f,$7f,$7f,$00,$00,$11,$0a,$34,$2a,$51,$20
db $7f,$67,$a3,$b0,$d8,$de,$dc,$c8,$7f,$67,$63,$70,$38,$3e,$7c,$b8
db $7f,$7f,$7f,$1f,$47,$70,$70,$39,$51,$0a,$04,$ea,$79,$7f,$70,$39
db $e8,$e8,$e0,$c0,$10,$70,$e0,$c0,$58,$38,$10,$30,$f0,$f0,$e0,$c0
db $00,$00,$00,$20,$66,$66,$66,$62,$00,$08,$1c,$3c,$7a,$7a,$7a,$7e
db $00,$00,$1f,$3f,$7f,$4f,$5f,$7f,$00,$00,$00,$11,$0a,$34,$2a,$51
db $77,$7f,$3f,$b7,$b3,$db,$da,$d8,$7f,$7d,$3f,$37,$33,$3b,$3a,$78
db $7f,$7f,$7f,$7f,$1f,$07,$70,$f0,$20,$51,$0a,$04,$ea,$39,$7f,$f0
db $cc,$e8,$e8,$e0,$c0,$18,$7c,$3e,$bc,$58,$38,$10,$30,$f8,$fc,$3e
db $03,$0f,$1f,$3f,$3b,$3f,$7f,$7f,$00,$00,$00,$06,$0e,$0c,$00,$00
db $80,$f0,$f8,$fc,$fe,$fe,$ff,$fe,$00,$00,$00,$00,$00,$00,$0f,$18
db $7f,$7f,$7f,$7f,$ff,$0f,$03,$00,$00,$00,$00,$00,$f8,$3e,$3b,$18
db $fe,$fb,$ff,$ff,$f6,$e0,$c0,$00,$10,$14,$10,$10,$38,$78,$f8,$30
db $00,$03,$0f,$1f,$3f,$3b,$3f,$7f,$00,$00,$00,$00,$06,$0e,$0c,$00
db $00,$c0,$f0,$f8,$fc,$fe,$fe,$ff,$00,$00,$00,$00,$00,$00,$00,$0f
db $7f,$7f,$7f,$7f,$7f,$ff,$0f,$03,$00,$00,$00,$00,$00,$f8,$7e,$f3
db $fe,$fe,$fb,$ff,$ff,$f6,$e0,$c0,$18,$10,$14,$10,$10,$38,$7c,$de
db $00,$01,$01,$01,$01,$00,$00,$08,$00,$0d,$1e,$1e,$1e,$1f,$0f,$07
db $78,$f0,$f8,$e4,$c0,$ca,$ca,$c0,$78,$f0,$00,$1a,$3f,$35,$35,$3f
db $0f,$1f,$9f,$ff,$ff,$7f,$74,$20,$00,$00,$80,$e0,$e0,$70,$73,$21
db $e4,$ff,$fe,$fc,$9c,$1e,$00,$00,$1a,$07,$0c,$18,$78,$fe,$fc,$f0
db $00,$01,$03,$03,$07,$03,$01,$00,$00,$01,$02,$00,$38,$7c,$7e,$3f
db $00,$5f,$7f,$7f,$3f,$3f,$14,$00,$3f,$40,$60,$60,$20,$30,$13,$01
db $c0,$e0,$f0,$30,$38,$3c,$3c,$fc,$c0,$e0,$30,$d0,$d0,$d0,$d0,$00
db $07,$0f,$1f,$22,$20,$25,$25,$1f,$07,$0f,$02,$1d,$1f,$1a,$1a,$02
db $fe,$fe,$7e,$3a,$02,$01,$41,$41,$38,$7c,$fc,$fc,$fc,$fe,$be,$be
db $1f,$3f,$7e,$5c,$40,$80,$82,$82,$1c,$3e,$3f,$3f,$3f,$7f,$7d,$7d
db $82,$80,$a0,$44,$43,$40,$21,$1e,$7d,$7f,$5f,$3b,$3c,$3f,$1e,$00
db $1c,$3f,$3e,$3c,$40,$80,$82,$82,$1c,$3e,$3f,$1f,$3f,$7f,$7d,$7d
db $00,$00,$80,$80,$92,$9d,$c7,$ef,$00,$00,$00,$60,$62,$65,$3f,$1f
db $00,$23,$33,$3f,$3f,$7f,$7f,$7f,$70,$3c,$3c,$18,$00,$00,$02,$07
db $fe,$f8,$a0,$00,$00,$00,$80,$80,$cf,$7a,$5a,$10,$00,$00,$c0,$80
db $7e,$7f,$7d,$3f,$1e,$8f,$8f,$19,$85,$84,$86,$c6,$e7,$73,$73,$e1
db $e0,$0e,$73,$f3,$f9,$f9,$f8,$70,$80,$4e,$77,$f3,$fb,$f9,$fa,$78
db $0e,$66,$e2,$f6,$ff,$ff,$1f,$98,$11,$39,$7d,$39,$00,$00,$e0,$e7
db $00,$00,$00,$04,$0f,$0f,$1f,$07,$00,$00,$07,$07,$16,$10,$00,$38
db $f3,$e7,$ee,$ec,$cd,$cf,$cf,$df,$cf,$1f,$17,$10,$33,$30,$30,$20
db $27,$3f,$3f,$78,$3c,$1f,$1f,$73,$38,$30,$40,$c7,$07,$66,$e0,$6c
db $9f,$3e,$7c,$fc,$f8,$f8,$c0,$40,$60,$c0,$80,$04,$9e,$ff,$f0,$f8
db $7f,$7e,$78,$01,$07,$1f,$3c,$7c,$24,$01,$07,$fe,$ff,$7f,$3f,$7f
db $fc,$f8,$a0,$fe,$fc,$f0,$80,$00,$cf,$7a,$0a,$fe,$fc,$00,$00,$00
db $7e,$7f,$7f,$3f,$1f,$8f,$8f,$18,$85,$86,$83,$c3,$e1,$70,$70,$e0
db $9f,$3e,$7c,$f8,$f8,$3c,$18,$f8,$60,$c0,$80,$00,$98,$fc,$fe,$ff
db $7f,$7f,$78,$01,$07,$13,$f1,$03,$24,$00,$07,$fe,$ff,$7f,$ff,$03
db $00,$00,$1c,$1d,$1b,$c3,$e3,$e1,$03,$0f,$23,$62,$64,$3c,$1c,$1e
db $e0,$cd,$1d,$4f,$ee,$ff,$3f,$3f,$1f,$3d,$6d,$4f,$ee,$f3,$20,$03
db $3f,$3f,$00,$00,$70,$b8,$fc,$fc,$07,$07,$1f,$3f,$0f,$47,$03,$00
db $07,$0f,$1f,$3f,$3e,$7c,$78,$78,$00,$00,$03,$07,$0f,$0f,$1f,$1f
db $3f,$5c,$39,$3b,$bf,$ff,$fe,$fe,$00,$23,$57,$4f,$57,$2f,$df,$21
db $c0,$c0,$80,$80,$80,$80,$00,$00,$00,$00,$00,$00,$80,$80,$00,$00
db $fe,$fc,$61,$0f,$7f,$3f,$1f,$1e,$23,$0f,$1e,$f0,$1c,$3f,$1f,$1e
db $f0,$78,$e4,$c8,$cc,$be,$be,$3e,$00,$80,$18,$30,$34,$fe,$fe,$fe
db $00,$01,$00,$07,$07,$07,$07,$1f,$00,$00,$01,$04,$06,$06,$07,$07
db $00,$00,$0f,$3f,$3f,$0f,$00,$00,$0f,$3f,$7f,$f8,$f8,$7f,$3f,$0f
db $78,$7c,$7e,$7f,$3f,$3f,$1b,$09,$1f,$1f,$1f,$0b,$01,$01,$00,$00
db $0c,$00,$00,$00,$07,$7f,$7c,$00,$03,$1f,$3f,$3f,$78,$00,$03,$ff
db $01,$e1,$71,$79,$3d,$3d,$1f,$03,$00,$00,$00,$00,$00,$00,$00,$00
db $3f,$3f,$1f,$1b,$36,$30,$7f,$3f,$23,$27,$1f,$07,$0f,$1f,$7f,$3f
db $f8,$f8,$f8,$b8,$18,$d8,$d8,$b8,$e0,$80,$80,$40,$e0,$e0,$e0,$c0
db $01,$02,$04,$04,$08,$08,$10,$10,$03,$07,$0f,$1f,$3f,$7f,$ff,$1f
db $00,$0f,$13,$0d,$0d,$13,$0c,$20,$1f,$10,$0c,$12,$12,$2c,$3f,$3f
db $00,$24,$00,$24,$00,$04,$00,$00,$37,$36,$36,$36,$16,$16,$12,$02
db $0f,$41,$00,$88,$00,$44,$00,$00,$10,$7e,$ff,$ff,$f6,$76,$3a,$1a
db $38,$7c,$fe,$fe,$3b,$03,$03,$03,$00,$00,$38,$04,$00,$00,$00,$00
db $03,$33,$7b,$7f,$ff,$fb,$03,$03,$00,$00,$00,$38,$40,$00,$00,$00
db $dc,$c0,$e0,$e0,$e0,$e0,$e0,$c0,$fc,$a0,$80,$80,$00,$00,$00,$00
db $3f,$5f,$3f,$3f,$bb,$f8,$fe,$fe,$07,$27,$57,$4f,$57,$27,$c1,$21
db $1f,$0f,$0f,$1f,$1f,$1e,$38,$30,$1d,$0f,$0f,$1f,$1f,$1e,$38,$30
db $00,$20,$60,$60,$70,$f0,$f8,$f8,$00,$00,$38,$10,$4c,$18,$86,$24
db $f8,$fc,$fc,$7e,$7e,$3e,$1f,$07,$00,$42,$0a,$40,$10,$02,$08,$02
db $00,$c0,$70,$b8,$f4,$f2,$f5,$7b,$00,$00,$80,$40,$08,$0c,$0a,$84
db $00,$df,$10,$ff,$df,$ff,$ff,$f9,$00,$00,$cf,$20,$20,$20,$26,$2e
db $1f,$1f,$3e,$fc,$f8,$f0,$c0,$00,$e0,$e0,$c0,$00,$00,$00,$00,$00
db $f8,$fc,$fe,$ff,$ff,$df,$df,$00,$2f,$23,$21,$20,$20,$00,$00,$00
db $c1,$f1,$79,$7d,$3d,$3f,$1f,$03,$c1,$b1,$59,$6d,$35,$3b,$1f,$03
db $02,$06,$0e,$0e,$1e,$1e,$3e,$3e,$00,$02,$00,$08,$02,$00,$28,$00
db $3e,$3e,$3e,$3e,$1e,$1e,$0e,$02,$04,$10,$02,$10,$04,$00,$0a,$00
db $c1,$f1,$79,$7d,$3d,$3f,$1f,$03,$c1,$b1,$59,$6d,$35,$3b,$1f,$03
db $7c,$00,$00,$ff,$c3,$7f,$1f,$03,$00,$0f,$1f,$ff,$fc,$63,$1f,$03
db $ff,$ff,$7c,$00,$00,$7c,$ff,$ff,$00,$00,$fe,$c6,$c6,$fe,$00,$00
db $ff,$ff,$00,$04,$0c,$18,$30,$00,$00,$00,$06,$06,$0c,$18,$70,$60
db $ff,$ff,$00,$04,$04,$04,$08,$08,$00,$00,$06,$06,$04,$04,$08,$08
db $08,$10,$10,$00,$00,$10,$10,$08,$08,$10,$30,$30,$30,$30,$10,$08
db $7f,$3f,$3f,$3e,$1f,$0f,$03,$00,$00,$00,$01,$03,$01,$00,$00,$00
db $03,$0f,$ff,$7f,$7f,$7f,$7f,$7f,$03,$0e,$f8,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$22,$65,$25,$25,$25,$25,$77,$72
db $00,$00,$00,$00,$00,$00,$00,$00,$62,$95,$15,$25,$45,$85,$f7,$f2
db $00,$00,$00,$00,$00,$00,$00,$00,$a2,$a5,$a5,$a5,$f5,$f5,$27,$22
db $00,$00,$00,$00,$00,$00,$00,$00,$f2,$85,$85,$e5,$15,$15,$f7,$e2
db $00,$00,$00,$00,$00,$00,$00,$00,$62,$95,$55,$65,$b5,$95,$97,$62
db $00,$00,$00,$00,$00,$00,$00,$00,$20,$50,$50,$50,$50,$50,$70,$20
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$66,$e6,$66,$66,$66,$67,$f3,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$5e,$59,$59,$59,$5e,$d8,$98,$00
db $00,$00,$00,$00,$00,$7c,$38,$00,$00,$00,$00,$00,$00,$04,$08,$00
; Begin Bank 1
; Tiles 0 - 15
db $38,$4c,$c6,$c6,$c6,$64,$38,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $18,$38,$18,$18,$18,$18,$7e,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $7c,$c6,$0e,$3c,$78,$e0,$fe,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $7e,$0c,$18,$3c,$06,$c6,$7c,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $1c,$3c,$6c,$cc,$fe,$0c,$0c,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $fc,$c0,$fc,$06,$06,$c6,$7c,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $3c,$60,$c0,$fc,$c6,$c6,$7c,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $fe,$c6,$0c,$18,$30,$30,$30,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $7c,$c6,$c6,$7c,$c6,$c6,$7c,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $7c,$c6,$c6,$7e,$06,$0c,$78,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $38,$6c,$c6,$c6,$fe,$c6,$c6,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $fc,$c6,$c6,$fc,$c6,$c6,$fc,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $3c,$66,$c0,$c0,$c0,$66,$3c,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $f8,$cc,$c6,$c6,$c6,$cc,$f8,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $fe,$c0,$c0,$fc,$c0,$c0,$fe,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $fe,$c0,$c0,$fc,$c0,$c0,$c0,$00,$00,$00,$00,$00,$00,$00,$00,$00
; Tiles 16 - 31
db $3e,$60,$c0,$ce,$c6,$66,$3e,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $c6,$c6,$c6,$fe,$c6,$c6,$c6,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $7e,$18,$18,$18,$18,$18,$7e,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $1e,$06,$06,$06,$c6,$c6,$7c,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $c6,$cc,$d8,$f0,$f8,$dc,$ce,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $60,$60,$60,$60,$60,$60,$7e,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $c6,$ee,$fe,$fe,$d6,$c6,$c6,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $c6,$e6,$f6,$fe,$de,$ce,$c6,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $7c,$c6,$c6,$c6,$c6,$c6,$7c,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $fc,$c6,$c6,$c6,$fc,$c0,$c0,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $7c,$c6,$c6,$c6,$de,$cc,$7a,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $fc,$c6,$c6,$ce,$f8,$dc,$ce,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $78,$cc,$c0,$7c,$06,$c6,$7c,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $7e,$18,$18,$18,$18,$18,$18,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $c6,$c6,$c6,$c6,$c6,$c6,$7c,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $c6,$c6,$c6,$ee,$7c,$38,$10,$00,$00,$00,$00,$00,$00,$00,$00,$00
; Tiles 32 - 47
db $c6,$c6,$d6,$fe,$fe,$ee,$c6,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $c6,$ee,$7c,$38,$7c,$ee,$c6,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $66,$66,$66,$3c,$18,$18,$18,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $fe,$0e,$1c,$38,$70,$e0,$fe,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $00,$00,$00,$7e,$7e,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$44,$28,$10,$28,$44,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$7f,$7f,$7f,$7f,$7f,$7f,$7f,$7f
db $18,$3c,$3c,$3c,$18,$18,$00,$18,$00,$00,$00,$00,$00,$00,$00,$00
db $ff,$7f,$7f,$7f,$7f,$ff,$e3,$c1,$ff,$80,$80,$80,$80,$00,$1c,$3e
db $80,$80,$80,$c1,$e3,$ff,$ff,$ff,$7f,$7f,$7f,$3e,$1c,$00,$00,$ff
db $38,$7c,$7c,$7c,$7c,$7c,$38,$00,$08,$04,$04,$04,$04,$04,$08,$00
db $03,$06,$0c,$0c,$08,$08,$04,$03,$03,$05,$0b,$0b,$0f,$0f,$07,$03
; Tiles 48 - 63
db $01,$02,$04,$08,$10,$20,$40,$80,$01,$03,$07,$0f,$1f,$3f,$7f,$ff
db $00,$00,$00,$00,$00,$07,$38,$c0,$00,$00,$00,$00,$00,$07,$3f,$ff
db $00,$00,$00,$00,$00,$e0,$1c,$03,$00,$00,$00,$00,$00,$e0,$fc,$ff
db $80,$40,$20,$10,$08,$04,$02,$01,$80,$c0,$e0,$f0,$f8,$fc,$fe,$ff
db $04,$0e,$0e,$0e,$6e,$64,$60,$60,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $07,$0f,$1f,$1f,$7f,$ff,$ff,$7f,$07,$08,$10,$00,$60,$80,$80,$40
db $03,$07,$1f,$3f,$3f,$3f,$79,$f7,$03,$04,$18,$20,$20,$20,$46,$88
db $c0,$e0,$f0,$f4,$fe,$bf,$df,$ff,$c0,$20,$10,$14,$0a,$41,$21,$01
db $90,$b8,$f8,$fa,$ff,$ff,$ff,$fe,$90,$a8,$48,$0a,$05,$01,$01,$02
db $3b,$1d,$0e,$0f,$07,$00,$00,$00,$24,$12,$09,$08,$07,$00,$00,$00
db $ff,$bf,$1c,$c0,$f3,$ff,$7e,$1c,$00,$40,$e3,$3f,$0c,$81,$62,$1c
db $bf,$7f,$3d,$83,$c7,$ff,$ff,$3c,$40,$80,$c2,$7c,$38,$00,$c3,$3c
db $fc,$fe,$ff,$fe,$fe,$f8,$60,$00,$04,$02,$01,$00,$06,$98,$60,$00
db $c0,$20,$10,$10,$10,$10,$20,$c0,$c0,$e0,$f0,$f0,$f0,$f0,$e0,$c0
db $00,$00,$00,$00,$3f,$7f,$e0,$c0,$00,$00,$00,$00,$00,$00,$1c,$3e
db $88,$9c,$88,$80,$80,$80,$80,$80,$7f,$7f,$7f,$3e,$1c,$00,$00,$00
; Tiles 64 - 79
db $fe,$fe,$fe,$fe,$fe,$fe,$fe,$fe,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $08,$14,$24,$c4,$03,$40,$a1,$26,$00,$08,$18,$38,$fc,$bf,$5e,$d9
db $ff,$ff,$ff,$ff,$7f,$7f,$7f,$7f,$81,$81,$81,$81,$81,$81,$81,$81
db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$01,$01,$01,$01,$01,$01,$01,$01
db $7f,$80,$80,$98,$9c,$8c,$80,$80,$00,$7f,$7f,$67,$67,$7f,$7f,$7f
db $ff,$01,$01,$ff,$10,$10,$10,$ff,$00,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $80,$80,$80,$80,$80,$80,$80,$80,$7f,$7f,$7f,$7f,$7f,$7f,$7f,$7f
db $01,$01,$01,$ff,$10,$10,$10,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $ff,$00,$00,$00,$00,$00,$00,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $fe,$01,$01,$19,$1d,$0d,$01,$01,$00,$ff,$ff,$e7,$e7,$ff,$ff,$ff
db $01,$01,$01,$01,$01,$01,$01,$01,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $3f,$7f,$7f,$ff,$ff,$ff,$ff,$ff,$3f,$60,$40,$c0,$80,$80,$80,$80
db $00,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $ff,$ff,$ff,$ff,$ff,$ff,$7e,$3c,$80,$80,$80,$80,$80,$81,$42,$3c
db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$00,$00,$00,$00,$00,$00,$00
db $ff,$ff,$ff,$ff,$ff,$ff,$fe,$7c,$00,$00,$00,$00,$00,$01,$82,$7c
; Tiles 80 - 95
db $ff,$ff,$ff,$ff,$ff,$ff,$fe,$7c,$00,$00,$00,$00,$00,$01,$83,$ff
db $f8,$fc,$fe,$fe,$ff,$ff,$ff,$ff,$f8,$04,$02,$02,$01,$01,$01,$01
db $ff,$ff,$ff,$ff,$ff,$ff,$7e,$3c,$01,$01,$01,$01,$01,$81,$42,$3c
db $00,$08,$08,$08,$10,$10,$10,$00,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $00,$7f,$7f,$78,$73,$73,$73,$7f,$7f,$80,$a0,$87,$8f,$8e,$8e,$86
db $00,$ff,$ff,$3f,$9f,$9f,$9f,$1f,$fe,$01,$05,$c1,$e1,$71,$71,$f1
db $7e,$7e,$7f,$7e,$7e,$7f,$7f,$ff,$81,$81,$80,$81,$81,$a0,$80,$ff
db $7f,$7f,$ff,$7f,$7f,$ff,$ff,$ff,$f1,$c1,$c1,$81,$c1,$c5,$01,$ff
db $7f,$80,$a0,$80,$80,$80,$80,$80,$7f,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $fe,$01,$05,$01,$01,$01,$01,$01,$fe,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $80,$80,$80,$80,$80,$a0,$80,$7f,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$7f
db $01,$01,$01,$01,$01,$05,$01,$fe,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$fe
db $00,$00,$00,$00,$fc,$fe,$07,$03,$00,$00,$00,$00,$00,$00,$38,$7c
db $11,$39,$11,$01,$01,$01,$01,$01,$fe,$fe,$fe,$7c,$38,$00,$00,$00
db $ef,$28,$28,$28,$28,$28,$ef,$00,$20,$e7,$e7,$e7,$e7,$e7,$ef,$00
db $fe,$82,$82,$82,$82,$82,$fe,$00,$02,$7e,$7e,$7e,$7e,$7e,$fe,$00
; Tiles 96 - 111
db $80,$80,$80,$98,$9c,$8c,$80,$7f,$7f,$7f,$7f,$67,$67,$7f,$7f,$7f
db $ff,$ff,$83,$f3,$f3,$f3,$f3,$f3,$ff,$80,$fc,$8c,$8c,$8c,$8c,$8c
db $ff,$ff,$f0,$f6,$f6,$f6,$f6,$f6,$ff,$00,$0f,$09,$09,$09,$09,$09
db $ff,$ff,$00,$00,$00,$00,$00,$00,$ff,$00,$ff,$ff,$ff,$ff,$ff,$ff
db $ff,$ff,$01,$57,$2f,$57,$2f,$57,$ff,$01,$ff,$a9,$d1,$a9,$d1,$a9
db $f3,$f3,$f3,$f3,$f3,$f3,$ff,$3f,$8c,$8c,$8c,$8c,$8c,$8c,$ff,$3f
db $f6,$f6,$f6,$f6,$f6,$f6,$ff,$ff,$09,$09,$09,$09,$09,$09,$ff,$ff
db $00,$00,$00,$00,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $2f,$57,$2f,$57,$2f,$57,$ff,$fc,$d1,$a9,$d1,$a9,$d1,$a9,$ff,$fc
db $3c,$3c,$3c,$3c,$3c,$3c,$3c,$3c,$23,$23,$23,$23,$23,$23,$23,$23
db $fb,$fb,$fb,$fb,$fb,$fb,$fb,$fb,$04,$04,$04,$04,$04,$04,$04,$04
db $bc,$5c,$bc,$5c,$bc,$5c,$bc,$5c,$44,$a4,$44,$a4,$44,$a4,$44,$a4
db $1f,$20,$40,$40,$80,$80,$80,$81,$1f,$3f,$7f,$7f,$ff,$ff,$ff,$fe
db $ff,$80,$80,$c0,$ff,$ff,$fe,$fe,$ff,$7f,$7f,$3f,$00,$00,$01,$01
db $ff,$7f,$7f,$ff,$ff,$07,$03,$03,$ff,$80,$80,$00,$00,$f8,$fc,$fc
db $ff,$00,$00,$00,$00,$81,$c3,$ff,$ff,$ff,$ff,$ff,$ff,$7e,$3c,$00
; Tiles 112 - 127
db $f8,$fc,$fe,$fe,$e3,$c1,$81,$81,$f8,$04,$02,$02,$1d,$3f,$7f,$7f
db $83,$ff,$ff,$ff,$ff,$ff,$7f,$1f,$fc,$80,$80,$80,$80,$80,$60,$1f
db $fc,$fc,$fc,$fc,$fe,$fe,$ff,$ff,$03,$03,$03,$03,$01,$01,$00,$ff
db $01,$01,$01,$01,$03,$03,$07,$ff,$fe,$fe,$fe,$fe,$fc,$fc,$f8,$ff
db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$00,$00,$00,$00,$00,$00,$00,$ff
db $81,$c1,$e3,$ff,$ff,$ff,$ff,$fe,$7f,$3f,$1d,$01,$01,$01,$03,$fe
db $ff,$ff,$ff,$ff,$ff,$fb,$b5,$ce,$80,$80,$80,$80,$80,$84,$ca,$b1
db $ff,$ff,$ff,$ff,$ff,$df,$ad,$73,$01,$01,$01,$01,$01,$21,$53,$8d
db $77,$77,$77,$77,$77,$77,$77,$77,$00,$00,$00,$00,$77,$ff,$ff,$ff
db $00,$00,$00,$00,$00,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $77,$77,$77,$77,$00,$00,$00,$00,$ff,$ff,$ff,$77,$77,$77,$77,$77
db $01,$01,$01,$19,$1d,$0d,$01,$fe,$ff,$ff,$ff,$e7,$e7,$ff,$ff,$fe
db $20,$78,$7f,$fe,$fe,$fe,$fe,$fe,$00,$21,$21,$41,$41,$41,$41,$41
db $04,$9a,$fa,$fd,$fd,$fd,$fd,$fd,$00,$80,$80,$80,$80,$80,$80,$80
db $7e,$38,$21,$00,$01,$00,$01,$00,$21,$21,$01,$01,$01,$01,$01,$01
db $fa,$8a,$84,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80
; Tiles 128 - 143
db $02,$04,$00,$10,$00,$40,$80,$00,$01,$01,$06,$08,$18,$20,$20,$c0
db $0b,$0b,$3b,$0b,$fb,$0b,$0b,$0a,$04,$04,$c4,$f4,$f4,$04,$04,$05
db $90,$10,$1f,$10,$1f,$10,$10,$90,$70,$f0,$f0,$ff,$ff,$f0,$f0,$70
db $3f,$78,$e7,$cf,$58,$58,$50,$90,$c0,$87,$18,$b0,$e7,$e7,$ef,$ef
db $b0,$fc,$e2,$c1,$c1,$83,$8f,$7e,$6f,$43,$5d,$3f,$3f,$7f,$7f,$ff
db $fe,$03,$0f,$91,$70,$60,$20,$31,$03,$ff,$f1,$6e,$cf,$df,$ff,$ff
db $3f,$3f,$1d,$39,$7b,$f3,$86,$fe,$fd,$fb,$fb,$f7,$f7,$0f,$7f,$ff
db $ff,$ff,$ff,$ff,$ff,$80,$80,$ff,$ff,$80,$80,$80,$80,$ff,$ff,$80
db $fe,$ff,$ff,$ff,$ff,$03,$03,$ff,$fe,$03,$03,$03,$03,$ff,$ff,$03
db $00,$ff,$ff,$ff,$ff,$ff,$00,$00,$00,$ff,$00,$00,$00,$00,$ff,$ff
db $3c,$fc,$fc,$fc,$fc,$fc,$04,$04,$23,$f3,$0b,$0b,$0b,$07,$ff,$ff
db $ff,$ff,$ff,$ff,$80,$ff,$ff,$ff,$80,$80,$80,$80,$ff,$80,$80,$80
db $ff,$ff,$ff,$ff,$03,$ff,$ff,$ff,$03,$03,$03,$03,$ff,$03,$03,$03
db $ff,$ff,$ff,$ff,$ff,$00,$ff,$ff,$00,$00,$00,$00,$00,$ff,$00,$00
db $fc,$fc,$fe,$fe,$fe,$02,$fe,$fe,$07,$07,$03,$03,$03,$ff,$03,$03
db $ff,$80,$80,$80,$80,$80,$80,$80,$80,$ff,$ff,$ff,$ff,$ff,$ff,$ff
; Tiles 144 - 159
db $ff,$03,$03,$03,$03,$03,$03,$03,$03,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $02,$02,$02,$02,$02,$02,$04,$04,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $80,$80,$aa,$d5,$aa,$ff,$ff,$ff,$ff,$ff,$d5,$aa,$d5,$80,$80,$ff
db $03,$03,$ab,$57,$ab,$ff,$ff,$fe,$ff,$ff,$57,$ab,$57,$03,$03,$fe
db $00,$55,$aa,$55,$ff,$ff,$ff,$00,$ff,$aa,$55,$aa,$00,$00,$ff,$00
db $04,$54,$ac,$5c,$fc,$fc,$fc,$3c,$ff,$af,$57,$ab,$0b,$0b,$f3,$23
db $3f,$3f,$3f,$3f,$00,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $7e,$7c,$7c,$78,$00,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $1f,$0f,$0f,$07,$00,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $fe,$fc,$fc,$f8,$00,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $00,$00,$00,$00,$ff,$ff,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $18,$18,$18,$18,$18,$18,$18,$18,$00,$00,$00,$00,$00,$00,$00,$00
db $07,$1f,$3f,$ff,$7f,$7f,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $e1,$f9,$fd,$ff,$fe,$fe,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $f0,$10,$10,$10,$10,$10,$10,$ff,$00,$e0,$e0,$e0,$e0,$e0,$e0,$e0
db $1f,$10,$10,$10,$10,$10,$10,$ff,$00,$0f,$0f,$0f,$0f,$0f,$0f,$0f
; Tiles 160 - 175
db $92,$92,$92,$fe,$fe,$00,$00,$00,$48,$48,$6c,$00,$00,$00,$fe,$00
db $0a,$0a,$3a,$0a,$fb,$0b,$0b,$0b,$05,$05,$c5,$f5,$f4,$04,$04,$04
db $90,$90,$9f,$90,$9f,$90,$90,$90,$70,$70,$70,$7f,$7f,$70,$70,$70
db $01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00
db $80,$80,$80,$80,$80,$80,$80,$80,$00,$00,$00,$00,$00,$00,$00,$00
db $08,$88,$91,$d1,$53,$53,$73,$3f,$ff,$ff,$ff,$ff,$ff,$fe,$be,$ce
db $00,$00,$07,$0f,$0c,$1b,$1b,$1b,$00,$00,$00,$00,$03,$04,$04,$04
db $00,$00,$e0,$f0,$f0,$f8,$f8,$f8,$00,$00,$60,$30,$30,$98,$98,$98
db $1b,$1b,$1b,$1b,$1b,$0f,$0f,$07,$04,$04,$04,$04,$04,$03,$00,$00
db $f8,$f8,$f8,$f8,$f8,$f0,$f0,$e0,$98,$98,$98,$98,$98,$30,$30,$60
db $f1,$11,$11,$1f,$10,$10,$10,$ff,$0f,$ef,$ef,$ef,$ef,$ef,$ef,$e0
db $1f,$10,$10,$f0,$10,$10,$10,$ff,$e0,$ef,$ef,$ef,$ef,$ef,$ef,$0f
; db $7f,$bf,$df,$ef,$f0,$f0,$f0,$f0,$80,$40,$20,$10,$0f,$0f,$0f,$0f
db $f0,$f0,$f0,$f0,$ff,$ff,$ff,$ff,$0f,$0f,$0f,$0f,$1f,$3f,$7f,$ff
db $ff,$ff,$ff,$ff,$0f,$0f,$0f,$0f,$01,$03,$07,$0f,$ff,$ff,$ff,$ff
db $0f,$0f,$0f,$0f,$f7,$fb,$fd,$fe,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
; Tiles 176 - 191
db $00,$00,$00,$00,$00,$00,$18,$18,$00,$00,$00,$00,$00,$00,$00,$00
db $1f,$3f,$7f,$7f,$7f,$ff,$ff,$ff,$1f,$20,$40,$40,$40,$80,$82,$82
db $ff,$ff,$ff,$7f,$7f,$7f,$3f,$1e,$82,$80,$a0,$44,$43,$40,$21,$1e
db $f8,$fc,$fe,$fe,$fe,$ff,$ff,$ff,$f8,$04,$02,$02,$02,$01,$41,$41
db $ff,$ff,$ff,$fe,$fe,$fe,$fc,$78,$41,$01,$05,$22,$c2,$02,$84,$78
db $7f,$80,$80,$80,$80,$80,$80,$80,$80,$7f,$7f,$7f,$7f,$7f,$7f,$7f
db $de,$61,$61,$61,$71,$5e,$7f,$61,$61,$df,$df,$df,$df,$ff,$c1,$df
db $80,$80,$c0,$f0,$bf,$8f,$81,$7e,$7f,$7f,$ff,$3f,$4f,$71,$7f,$ff
db $61,$61,$c1,$c1,$81,$81,$83,$fe,$df,$df,$bf,$bf,$7f,$7f,$7f,$7f
db $00,$00,$03,$0f,$1f,$3f,$7f,$7f,$00,$00,$03,$0c,$10,$20,$40,$40
db $00,$00,$c0,$f0,$f8,$fc,$fe,$fe,$00,$00,$c0,$30,$08,$04,$02,$02
db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$80,$80,$80,$80,$80,$80,$80,$80
db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$01,$01,$01,$01,$01,$01,$01,$01
db $7f,$7f,$7f,$3f,$3f,$1f,$0f,$07,$40,$40,$40,$20,$30,$1c,$0f,$07
db $fe,$fe,$fe,$fc,$fc,$f8,$f0,$f0,$02,$02,$02,$04,$0c,$38,$f0,$f0
db $0f,$0f,$0f,$0f,$0f,$0f,$07,$0f,$08,$08,$08,$08,$08,$0c,$05,$0a
; Tiles 192 - 207
db $f0,$f0,$f0,$f0,$f0,$f0,$e0,$f0,$10,$50,$50,$50,$50,$30,$a0,$50
db $81,$c1,$a3,$a3,$9d,$81,$81,$81,$00,$41,$22,$22,$1c,$00,$00,$00
db $e3,$f7,$c1,$c1,$c1,$c1,$f7,$e3,$e3,$14,$3e,$3e,$3e,$3e,$14,$e3
db $00,$00,$07,$0f,$0c,$1b,$1b,$1b,$ff,$ff,$f8,$f0,$f0,$e0,$e0,$e0
db $00,$00,$e0,$f0,$f0,$f8,$f8,$f8,$ff,$ff,$7f,$3f,$3f,$9f,$9f,$9f
db $1b,$1b,$1b,$1b,$1b,$0f,$0f,$07,$e0,$e0,$e0,$e0,$e0,$f3,$f0,$f8
db $f8,$f8,$f8,$f8,$f8,$f0,$f0,$e0,$9f,$9f,$9f,$9f,$9f,$3f,$3f,$7f
db $e0,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$00,$70,$1f,$10,$70,$7f,$7f,$7f
db $07,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$00,$03,$f8,$00,$03,$fb,$fb,$fb
db $ff,$ff,$ff,$ff,$ff,$fe,$ff,$ef,$7c,$7b,$76,$75,$75,$77,$17,$67
db $ff,$df,$ef,$af,$af,$6f,$ef,$e7,$3b,$fb,$7b,$fb,$fb,$f3,$f8,$f3
db $1f,$1f,$3f,$3f,$70,$63,$e7,$e5,$0f,$0f,$1f,$1f,$3f,$3c,$78,$7a
db $f0,$f0,$f8,$f8,$0c,$c4,$e4,$a6,$f8,$f8,$fc,$fc,$fe,$3e,$1e,$5f
db $e9,$e9,$e9,$ef,$e2,$e3,$f0,$ff,$76,$76,$76,$70,$7d,$7c,$7f,$7f
db $96,$96,$96,$f6,$46,$c6,$0e,$fe,$6f,$6f,$6f,$0f,$bf,$3f,$ff,$ff
db $00,$00,$00,$00,$00,$00,$7e,$3c,$3c,$7e,$7e,$ff,$ff,$ff,$42,$00
; Tiles 208 - 223
db $3c,$42,$99,$a1,$a1,$99,$42,$3c,$00,$00,$00,$00,$00,$00,$00,$00
db $0f,$1f,$1f,$3f,$3f,$7f,$7f,$7f,$f0,$e0,$e0,$c0,$c0,$80,$80,$80
db $f0,$f8,$f8,$fc,$fc,$fe,$fe,$fe,$0f,$07,$07,$03,$03,$01,$01,$01
db $7f,$7f,$3f,$3f,$3f,$3f,$1f,$1f,$80,$80,$c0,$c0,$e0,$f8,$fe,$ff
db $fe,$ff,$ff,$ff,$fc,$fc,$fe,$fe,$ff,$7f,$1f,$07,$03,$03,$01,$81
db $7f,$7f,$7f,$3f,$3f,$3f,$3f,$1f,$80,$80,$80,$c0,$c0,$e0,$e0,$f0
db $fe,$fe,$ff,$ff,$ff,$ff,$ff,$fe,$01,$01,$01,$03,$03,$07,$07,$0f
db $1f,$0f,$0f,$07,$00,$00,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $fe,$fc,$fc,$f8,$00,$00,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $7e,$7e,$7e,$7e,$7f,$7f,$7f,$7f,$81,$81,$81,$81,$81,$81,$81,$81
db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$fe,$01,$01,$01,$03,$03,$07,$07,$0f
db $fe,$fe,$fe,$fe,$ff,$ff,$ff,$ff,$01,$01,$01,$01,$01,$01,$01,$01
db $7f,$7f,$7f,$7f,$7f,$7f,$7f,$7f,$81,$81,$81,$81,$81,$81,$81,$81
db $ff,$ff,$ff,$ff,$fc,$fe,$fe,$7e,$ff,$03,$03,$03,$03,$03,$03,$ff
db $ff,$ff,$ff,$ff,$00,$00,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $7f,$7f,$7f,$7f,$7f,$7f,$7f,$7f,$80,$80,$80,$80,$80,$80,$80,$80
; Tiles 224 - 239
db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$fe,$01,$01,$01,$03,$07,$03,$01,$01
db $7e,$7e,$7f,$7f,$7f,$7f,$7f,$7f,$81,$81,$81,$81,$81,$81,$81,$81
db $3f,$3f,$3f,$3f,$00,$00,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $7e,$7c,$7c,$78,$00,$00,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
db $fe,$fe,$ff,$ff,$7f,$7f,$7f,$7f,$81,$81,$81,$81,$81,$81,$81,$81
db $7f,$7f,$3f,$3f,$3f,$3f,$1f,$1f,$80,$80,$c0,$c0,$e0,$f8,$fe,$ff
db $3f,$bf,$ff,$ff,$fc,$fc,$fe,$fe,$ff,$7f,$1f,$07,$03,$03,$01,$81
db $7f,$7f,$7e,$7e,$7f,$7f,$7f,$7f,$81,$81,$81,$81,$81,$81,$81,$81
db $7e,$7e,$7e,$7e,$7f,$7f,$7f,$7f,$81,$81,$81,$81,$81,$81,$81,$81
db $81,$c3,$c3,$e7,$e7,$ff,$ff,$ff,$7e,$3c,$3c,$18,$18,$00,$00,$00
db $0f,$43,$5b,$53,$31,$19,$0f,$07,$f2,$fe,$fe,$ff,$ff,$ef,$f7,$f8
db $c1,$c3,$c6,$84,$fc,$fc,$0e,$02,$bf,$be,$bd,$7b,$7b,$07,$f3,$fd
db $10,$20,$22,$ba,$e6,$e1,$c0,$c0,$ff,$ff,$ff,$67,$59,$9e,$bf,$bf
db $20,$a6,$54,$26,$20,$c6,$54,$26,$20,$e6,$54,$26,$21,$06,$54,$26
db $20,$85,$01,$44,$20,$86,$54,$48,$20,$9a,$01,$49,$20,$a5,$c9,$46
db $20,$ba,$c9,$4a,$20,$a6,$0a,$d0,$d1,$d8,$d8,$de,$d1,$d0,$da,$de
; Tiles 240 - 255
db $d1,$20,$c6,$0a,$d2,$d3,$db,$db,$db,$d9,$db,$dc,$db,$df,$20,$e6
db $0a,$d4,$d5,$d4,$d9,$db,$e2,$d4,$da,$db,$e0,$21,$06,$0a,$d6,$d7
db $d6,$d7,$e1,$26,$d6,$dd,$e1,$e1,$21,$26,$14,$d0,$e8,$d1,$d0,$d1
db $de,$d1,$d8,$d0,$d1,$26,$de,$d1,$de,$d1,$d0,$d1,$d0,$d1,$26,$21
db $46,$14,$db,$42,$42,$db,$42,$db,$42,$db,$db,$42,$26,$db,$42,$db
db $42,$db,$42,$db,$42,$26,$21,$66,$46,$db,$21,$6c,$0e,$df,$db,$db
db $db,$26,$db,$df,$db,$df,$db,$db,$e4,$e5,$26,$21,$86,$14,$db,$db
db $db,$de,$43,$db,$e0,$db,$db,$db,$26,$db,$e3,$db,$e0,$db,$db,$e6
db $e3,$26,$21,$a6,$14,$db,$db,$db,$db,$42,$db,$db,$db,$d4,$d9,$26
db $db,$d9,$db,$db,$d4,$d9,$d4,$d9,$e7,$21,$c5,$16,$5f,$95,$95,$95
db $95,$95,$95,$95,$95,$97,$98,$78,$95,$96,$95,$95,$97,$98,$97,$98
db $95,$7a,$21,$ed,$0e,$cf,$01,$09,$08,$05,$24,$17,$12,$17,$1d,$0e
db $17,$0d,$18,$22,$4b,$0d,$01,$24,$19,$15,$0a,$22,$0e,$1b,$24,$10
db $0a,$16,$0e,$22,$8b,$0d,$02,$24,$19,$15,$0a,$22,$0e,$1b,$24,$10
db $0a,$16,$0e,$22,$ec,$04,$1d,$18,$19,$28,$22,$f6,$01,$00,$23,$c9
db $56,$55,$23,$e2,$04,$99,$aa,$aa,$aa,$23,$ea,$04,$99,$aa,$aa,$aa
db $7f,$bf,$df,$ef,$f0,$f0,$f0,$f0,$80,$40,$20,$10,$0f,$0f,$0f,$0f

512
demos/smb/chr2.s Normal file
View File

@ -0,0 +1,512 @@
db $03,$0F,$1F,$1F,$1C,$24,$26,$66,$00,$00,$00,$00,$1F,$3F,$3F,$7F
db $E0,$C0,$80,$FC,$80,$C0,$00,$20,$00,$20,$60,$00,$F0,$FC,$FE,$FE
db $60,$70,$18,$07,$0F,$1F,$3F,$7F,$7F,$7F,$1F,$07,$00,$1E,$3F,$7F
db $FC,$7C,$00,$00,$E0,$F0,$F8,$F8,$FC,$FC,$F8,$C0,$C2,$67,$2F,$37
db $7F,$7F,$FF,$FF,$07,$07,$0F,$0F,$7F,$7E,$FC,$F0,$F8,$F8,$F0,$70
db $FD,$FE,$B4,$F8,$F8,$F9,$FB,$FF,$37,$36,$5C,$00,$00,$01,$03,$1F
db $1F,$3F,$FF,$FF,$FC,$70,$70,$38,$08,$24,$E3,$F0,$F8,$70,$70,$38
db $FF,$FF,$FF,$1F,$00,$00,$00,$00,$1F,$1F,$1F,$1F,$00,$00,$00,$00
db $00,$00,$01,$07,$0F,$0F,$0E,$12,$00,$00,$00,$00,$00,$00,$0F,$1F
db $00,$00,$F0,$E0,$C0,$FE,$40,$60,$00,$00,$00,$10,$30,$00,$F8,$FE
db $13,$33,$30,$18,$04,$0F,$1F,$1F,$1F,$3F,$3F,$1F,$07,$08,$17,$17
db $00,$10,$7E,$3E,$00,$00,$C0,$E0,$FF,$FF,$FE,$FE,$FC,$E0,$40,$A0
db $3F,$3F,$3F,$1F,$1F,$1F,$1F,$1F,$37,$27,$23,$03,$01,$00,$00,$00
db $F0,$F0,$F0,$F8,$F8,$F8,$F8,$F8,$CC,$FF,$FF,$FF,$FF,$70,$00,$08
db $FF,$FF,$FF,$FE,$F0,$C0,$80,$00,$F0,$F0,$F0,$F0,$F0,$C0,$80,$00
db $FC,$FC,$F8,$78,$78,$78,$7E,$7E,$10,$60,$80,$00,$78,$78,$7E,$7E
db $00,$03,$0F,$1F,$1F,$1C,$24,$26,$00,$00,$00,$00,$00,$1F,$3F,$3F
db $00,$E0,$C0,$80,$FC,$80,$C0,$00,$00,$00,$20,$60,$00,$F0,$FC,$FE
db $66,$60,$30,$18,$0F,$1F,$3F,$3F,$7F,$7F,$3F,$1F,$00,$16,$2F,$2F
db $20,$FC,$7C,$00,$00,$E0,$E0,$F0,$FE,$FC,$FC,$F8,$C0,$60,$20,$30
db $3F,$3F,$3F,$3F,$3F,$3F,$3F,$1F,$2F,$2F,$2F,$0F,$07,$03,$00,$00
db $F0,$90,$00,$08,$0C,$1C,$FC,$F8,$10,$F0,$F0,$F0,$F0,$E0,$C0,$E0
db $0F,$0F,$07,$07,$07,$0F,$0F,$03,$01,$03,$01,$04,$07,$0F,$0F,$03
db $F8,$F0,$E0,$F0,$B0,$80,$E0,$E0,$F8,$F0,$E0,$70,$B0,$80,$E0,$E0
db $03,$3F,$7F,$19,$09,$09,$28,$5C,$00,$30,$70,$7F,$FF,$FF,$F7,$F3
db $F8,$E0,$E0,$FC,$26,$30,$80,$10,$00,$18,$10,$00,$F8,$F8,$FE,$FF
db $3E,$1E,$3F,$38,$30,$30,$00,$3A,$E7,$0F,$0F,$1F,$1F,$1F,$0F,$07
db $78,$1E,$80,$FE,$7E,$7E,$7F,$7F,$FF,$FE,$FC,$C6,$8E,$EE,$FF,$FF
db $3C,$3F,$1F,$0F,$07,$3F,$21,$20,$03,$00,$00,$0E,$07,$3F,$3F,$3F
db $FF,$FF,$FF,$FE,$FE,$FE,$FC,$70,$FF,$7F,$3F,$0E,$C0,$C0,$E0,$E0
db $0F,$9F,$CF,$FF,$7F,$3F,$1E,$0E,$00,$80,$C8,$FE,$7F,$3F,$1E,$0E
db $20,$C0,$80,$80,$00,$00,$00,$00,$E0,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$03,$0F,$1F,$1F,$1C,$24,$00,$00,$00,$00,$00,$00,$1F,$3F
db $00,$04,$E6,$E0,$FF,$FF,$8F,$83,$0E,$1F,$1F,$1F,$1F,$03,$FF,$FF
db $26,$26,$60,$78,$18,$0F,$7F,$FF,$3F,$3F,$7F,$7F,$1F,$00,$7E,$FF
db $01,$21,$FE,$7A,$06,$FE,$FC,$FC,$FF,$FF,$FE,$FE,$FE,$DE,$5C,$6C
db $FF,$CF,$87,$07,$07,$0F,$1F,$1F,$FF,$FF,$FE,$FC,$F8,$B0,$60,$00
db $F8,$F8,$F0,$B8,$F8,$F9,$FB,$FF,$28,$30,$18,$40,$00,$01,$03,$0F
db $1F,$FF,$FF,$FF,$FF,$FE,$C0,$80,$10,$EC,$E3,$E0,$E0,$E0,$C0,$80
db $FF,$FF,$FF,$3F,$00,$00,$00,$00,$0F,$0F,$0F,$0F,$00,$00,$00,$00
db $13,$33,$30,$18,$04,$0F,$1F,$1F,$1F,$3F,$3F,$1F,$07,$09,$13,$17
db $00,$10,$7E,$30,$E0,$F0,$F0,$E0,$FF,$FF,$FE,$FF,$FE,$FC,$F8,$E0
db $1F,$1F,$0F,$0F,$0F,$1F,$1F,$1F,$17,$17,$03,$00,$00,$00,$00,$00
db $F0,$F0,$F8,$F8,$B8,$F8,$F8,$F8,$D0,$90,$18,$08,$40,$00,$00,$00
db $3F,$FF,$FF,$FF,$F6,$C6,$84,$00,$30,$F0,$F0,$F1,$F6,$C6,$84,$00
db $F0,$E0,$80,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $1F,$1F,$3F,$3F,$1F,$0F,$0F,$1F,$1F,$1F,$3F,$3E,$7C,$78,$F0,$E0
db $F0,$F0,$F8,$F8,$B8,$F8,$F8,$F0,$B0,$90,$18,$08,$40,$00,$00,$00
db $E0,$F0,$F0,$F0,$F0,$F0,$F8,$F0,$C0,$E0,$FC,$FE,$FF,$7F,$03,$00
db $1F,$1F,$1F,$3F,$3E,$3C,$38,$18,$00,$00,$10,$38,$3E,$3C,$38,$18
db $00,$03,$07,$07,$0A,$0B,$0C,$00,$00,$00,$00,$07,$0F,$0F,$0F,$03
db $00,$E0,$FC,$20,$20,$10,$3C,$00,$00,$00,$00,$F0,$FC,$FE,$FC,$F8
db $07,$07,$07,$1F,$1F,$3E,$21,$01,$07,$0F,$1B,$18,$10,$30,$21,$01
db $E0,$E0,$E0,$F0,$F0,$E0,$C0,$E0,$A8,$FC,$F8,$00,$00,$00,$C0,$E0
db $07,$0F,$0E,$14,$16,$18,$00,$3F,$00,$00,$0F,$1F,$1F,$1F,$07,$3C
db $C0,$F8,$40,$40,$20,$78,$00,$C0,$00,$00,$E0,$F8,$FC,$F8,$F0,$C0
db $3F,$0E,$0F,$1F,$3F,$7C,$70,$38,$FC,$ED,$C0,$00,$00,$60,$70,$38
db $F0,$F8,$E4,$FC,$FC,$7C,$00,$00,$7E,$1E,$04,$0C,$0C,$0C,$00,$00
db $07,$0F,$0E,$14,$16,$18,$00,$0F,$00,$00,$0F,$1F,$1F,$1F,$07,$0D
db $1F,$1F,$1F,$1C,$0C,$07,$07,$07,$1E,$1C,$1E,$0F,$07,$00,$07,$07
db $E0,$60,$F0,$70,$E0,$E0,$F0,$80,$60,$90,$00,$80,$00,$E0,$F0,$80
db $07,$1F,$3F,$12,$13,$08,$1F,$31,$00,$10,$3F,$7F,$7F,$3F,$03,$0F
db $C0,$F0,$40,$00,$30,$18,$C0,$F8,$00,$00,$E0,$F8,$FC,$F8,$B0,$38
db $31,$39,$1F,$1F,$0F,$5F,$7E,$3C,$1F,$07,$00,$0E,$0F,$53,$7C,$3C
db $F8,$F8,$F0,$E0,$E0,$C0,$00,$00,$F8,$F8,$F0,$00,$00,$80,$00,$00
db $00,$E0,$FC,$27,$27,$11,$3E,$04,$07,$07,$03,$F7,$FF,$FF,$FE,$FC
db $3F,$7F,$3F,$0F,$1F,$3F,$7F,$4F,$3E,$7F,$FF,$E2,$50,$38,$70,$40
db $F8,$F9,$F9,$B7,$FF,$FF,$E0,$00,$E8,$71,$01,$4B,$03,$03,$00,$00
db $07,$07,$0F,$3F,$3F,$3F,$26,$04,$05,$03,$01,$30,$30,$30,$26,$04
db $F0,$F0,$F0,$E0,$C0,$00,$00,$00,$FE,$FC,$E0,$00,$00,$00,$00,$00
db $07,$07,$0F,$1F,$3F,$0F,$1C,$18,$05,$03,$01,$10,$30,$0C,$1C,$18
db $E0,$E0,$E0,$E0,$C0,$80,$00,$00,$C0,$E0,$F0,$78,$18,$08,$00,$00
db $07,$0F,$1F,$0F,$3F,$0F,$1C,$18,$07,$0F,$3E,$7C,$30,$0C,$1C,$18
db $E0,$E0,$E0,$40,$C0,$80,$00,$00,$60,$60,$60,$80,$00,$00,$00,$00
db $7F,$FF,$FF,$FB,$0F,$0F,$0F,$1F,$73,$F3,$F0,$F4,$F0,$F0,$70,$60
db $3F,$7E,$7C,$7C,$3C,$3C,$FC,$FC,$00,$00,$00,$00,$3C,$3C,$FC,$FC
db $60,$70,$18,$08,$0F,$1F,$3F,$7F,$7F,$7F,$1F,$07,$0B,$1B,$3B,$7B
db $FC,$7C,$00,$20,$F0,$F8,$FC,$FE,$FC,$FC,$F8,$E0,$D0,$D8,$DC,$DE
db $0B,$0F,$1F,$1E,$3C,$3C,$3C,$7C,$C4,$E0,$E0,$40,$00,$3C,$3C,$7C
db $1F,$3F,$0D,$07,$0F,$0E,$1C,$3C,$1D,$3C,$3A,$38,$30,$00,$1C,$3C
db $00,$00,$00,$00,$00,$00,$00,$00,$22,$55,$55,$55,$55,$55,$77,$22
db $00,$07,$1F,$FF,$07,$1F,$0F,$06,$00,$00,$00,$00,$00,$00,$00,$00
db $3F,$FF,$FF,$FF,$FF,$FF,$FB,$76,$00,$00,$CF,$07,$7F,$00,$00,$00
db $20,$F8,$FF,$C3,$FD,$FE,$F0,$40,$00,$00,$3C,$FC,$FE,$E0,$00,$00
db $40,$E0,$40,$40,$41,$41,$4F,$47,$40,$E0,$40,$3F,$3E,$3E,$30,$38
db $00,$00,$00,$00,$00,$00,$E0,$C0,$00,$00,$00,$F8,$F8,$F8,$18,$38
db $43,$46,$44,$40,$40,$40,$40,$40,$3C,$39,$3B,$3F,$00,$00,$00,$00
db $80,$C0,$40,$00,$00,$00,$00,$00,$78,$38,$B8,$F8,$00,$00,$00,$00
db $31,$30,$38,$7C,$7F,$FF,$FF,$FB,$3F,$3F,$0F,$77,$77,$F7,$F7,$F7
db $10,$7E,$3E,$00,$1E,$FE,$FF,$FF,$FF,$FE,$FE,$FE,$FA,$FA,$F3,$E7
db $FF,$FF,$E3,$C3,$87,$48,$3C,$FC,$F0,$F8,$FC,$7C,$78,$38,$3C,$FC
db $00,$FF,$C3,$83,$83,$FF,$FF,$FF,$FF,$00,$C3,$81,$81,$C3,$FF,$00
db $1F,$1F,$0F,$07,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $F0,$FB,$FF,$FF,$FE,$3E,$0C,$04,$00,$0B,$1F,$1F,$1E,$3E,$0C,$04
db $1F,$1F,$0F,$0F,$07,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $FB,$FF,$FF,$FF,$FF,$00,$00,$00,$03,$0F,$0F,$0F,$0F,$00,$00,$00
db $00,$18,$3C,$7E,$6E,$DF,$DF,$DF,$00,$18,$3C,$7E,$76,$FB,$FB,$FB
db $00,$18,$18,$3C,$3C,$3C,$3C,$1C,$00,$10,$10,$20,$20,$20,$20,$20
db $00,$08,$08,$08,$08,$08,$08,$00,$00,$08,$08,$08,$08,$08,$08,$08
db $00,$08,$08,$04,$04,$04,$04,$04,$00,$10,$10,$38,$38,$38,$38,$38
db $3C,$7E,$77,$FB,$9F,$5F,$8E,$20,$00,$18,$3C,$0E,$0E,$04,$00,$00
db $5C,$2E,$8F,$3F,$7B,$77,$7E,$3C,$00,$00,$04,$06,$1E,$3C,$18,$00
db $13,$4F,$3F,$BF,$3F,$7A,$F8,$F8,$00,$00,$01,$0A,$17,$0F,$2F,$1F
db $00,$08,$05,$0F,$2F,$1D,$1C,$3C,$00,$00,$00,$00,$05,$07,$0F,$07
db $00,$00,$00,$00,$02,$0B,$07,$0F,$00,$00,$00,$00,$00,$00,$01,$03
db $00,$00,$00,$00,$00,$08,$04,$04,$00,$60,$F0,$F8,$7C,$3E,$7E,$7F
db $02,$02,$02,$05,$71,$7F,$7F,$7F,$3F,$5F,$7F,$3E,$0E,$0A,$51,$20
db $00,$00,$00,$00,$00,$00,$00,$04,$00,$00,$00,$00,$00,$00,$0E,$1F
db $02,$02,$00,$01,$13,$3F,$7F,$7F,$3F,$7F,$7F,$FE,$EC,$CA,$51,$20
db $00,$40,$60,$70,$73,$27,$0F,$1F,$00,$40,$63,$77,$7C,$38,$F8,$E4
db $00,$00,$00,$00,$03,$07,$0F,$1F,$00,$00,$03,$07,$0C,$18,$F8,$E4
db $7F,$7F,$3F,$3F,$1F,$1F,$0F,$07,$03,$44,$28,$10,$08,$04,$03,$04
db $03,$07,$0F,$1F,$3F,$77,$77,$F5,$03,$07,$0F,$1F,$27,$7B,$78,$FB
db $C0,$E0,$F0,$F8,$FC,$EE,$EE,$AF,$C0,$E0,$F0,$F8,$E4,$DE,$1E,$DF
db $F1,$FF,$78,$00,$00,$18,$1C,$0E,$FF,$FF,$7F,$0F,$0F,$07,$03,$00
db $8F,$FF,$1E,$00,$0C,$3E,$7E,$7C,$FF,$FF,$FE,$F0,$F0,$C0,$80,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$18,$24,$24,$18,$00,$00
db $00,$02,$41,$41,$61,$33,$06,$3C,$3C,$7E,$FF,$FF,$FF,$FF,$7E,$3C
db $03,$07,$0F,$1F,$3F,$7F,$7F,$FF,$03,$07,$0F,$1F,$3F,$63,$41,$C1
db $C0,$E0,$F0,$F8,$FC,$FE,$FE,$FF,$C0,$80,$00,$00,$8C,$FE,$FE,$F3
db $FF,$FF,$FF,$78,$00,$00,$00,$00,$C1,$E3,$FF,$47,$0F,$0F,$0F,$07
db $FF,$FF,$FF,$1E,$00,$20,$20,$40,$F1,$F9,$FF,$E2,$F0,$F0,$F0,$E0
db $16,$1F,$3F,$7F,$3D,$1D,$3F,$1F,$16,$1F,$00,$00,$05,$0D,$3F,$1F
db $80,$80,$C0,$E0,$F0,$F0,$F0,$F8,$80,$80,$00,$00,$00,$A0,$A0,$E0
db $3C,$FA,$B1,$72,$F2,$DB,$DF,$5F,$00,$04,$4E,$8C,$0C,$7F,$FF,$FF
db $00,$00,$00,$01,$01,$01,$06,$1E,$00,$00,$00,$00,$00,$00,$01,$01
db $00,$00,$00,$00,$00,$00,$00,$00,$FF,$7F,$3F,$1F,$0F,$07,$03,$01
db $00,$7C,$D6,$92,$BA,$EE,$FE,$38,$FF,$83,$29,$6D,$45,$11,$01,$C7
db $00,$15,$3F,$62,$5F,$FF,$9F,$7D,$08,$08,$02,$1F,$22,$02,$02,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$08,$08,$08,$08,$08,$08,$08,$08
db $2F,$1E,$2F,$2F,$2F,$15,$0D,$0E,$10,$1E,$10,$50,$10,$08,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$FE,$00,$00,$00,$00
db $1C,$3E,$7F,$FF,$FF,$FE,$7C,$38,$1C,$2A,$77,$EE,$DD,$AA,$74,$28
db $00,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FE,$FE,$00,$EF,$EF,$EF,$00
db $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FE,$FE,$FE,$00,$EF,$EF,$EF,$00
db $7F,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$00,$7F,$5F,$7F,$7F,$7F,$7F,$7F
db $68,$4E,$E0,$E0,$E0,$F0,$F8,$FC,$B8,$9E,$80,$C0,$E0,$F0,$F8,$7C
db $3F,$5C,$39,$3B,$BB,$F9,$FC,$FE,$00,$23,$57,$4F,$57,$27,$C3,$21
db $C0,$F0,$F0,$F0,$F0,$E0,$C0,$00,$00,$30,$70,$70,$F0,$E0,$C0,$00
db $FE,$FC,$61,$0F,$FF,$FE,$F0,$E0,$13,$0F,$1E,$F0,$FC,$F8,$F0,$E0
db $6E,$40,$E0,$E0,$E0,$E0,$E0,$C0,$BE,$90,$80,$C0,$C0,$80,$00,$00
db $01,$01,$03,$03,$07,$7F,$7F,$3F,$01,$01,$03,$03,$07,$7F,$7D,$3D
db $06,$07,$3F,$3C,$19,$7B,$7F,$3F,$06,$04,$30,$23,$06,$64,$60,$00
db $3F,$7F,$7F,$1F,$3F,$3F,$07,$06,$00,$60,$60,$00,$20,$30,$04,$06
db $03,$07,$0F,$0F,$0F,$0F,$07,$03,$00,$01,$01,$00,$00,$00,$00,$00
db $F8,$F8,$F8,$A0,$E1,$FF,$FF,$FF,$FE,$FF,$FF,$40,$01,$03,$03,$03
db $0F,$0F,$0F,$1F,$1F,$1F,$0F,$07,$01,$01,$00,$00,$00,$00,$00,$00
db $E0,$F8,$F8,$F8,$FF,$FE,$F0,$C0,$E0,$FE,$FF,$7F,$03,$02,$00,$00
db $01,$0F,$0F,$1F,$39,$33,$37,$7F,$01,$0D,$08,$00,$36,$2C,$08,$60
db $7F,$3F,$3F,$3F,$1F,$0F,$0F,$01,$60,$00,$20,$30,$00,$08,$0D,$01
db $00,$00,$03,$03,$47,$67,$77,$77,$01,$01,$03,$43,$67,$77,$7B,$78
db $00,$00,$00,$00,$88,$98,$F8,$F0,$00,$00,$80,$84,$CC,$DC,$BC,$3C
db $7E,$7F,$FF,$1F,$07,$30,$1C,$0C,$33,$07,$07,$E3,$38,$3F,$1C,$0C
db $7E,$38,$F6,$ED,$DF,$38,$70,$60,$98,$C7,$C8,$92,$30,$F8,$70,$60
db $00,$00,$00,$03,$03,$47,$67,$77,$00,$01,$01,$03,$43,$67,$77,$7B
db $00,$00,$00,$00,$00,$88,$98,$F8,$00,$00,$00,$80,$84,$CC,$DC,$BC
db $77,$7E,$7F,$FF,$1F,$07,$70,$F0,$78,$33,$07,$07,$E3,$38,$7F,$F0
db $F0,$7E,$38,$F6,$ED,$DF,$38,$3C,$3C,$98,$C7,$C8,$92,$30,$F8,$3C
db $03,$07,$0A,$1A,$1C,$1E,$0B,$08,$00,$10,$7F,$7F,$7F,$1F,$0F,$0F
db $1C,$3F,$3F,$3D,$3F,$1F,$00,$00,$03,$33,$39,$3A,$38,$18,$00,$00
db $00,$00,$04,$4C,$4E,$4E,$46,$6F,$10,$38,$3C,$74,$76,$76,$7E,$7D
db $00,$1F,$3F,$3F,$4F,$5F,$7F,$7F,$00,$00,$11,$0A,$34,$2A,$51,$20
db $7F,$67,$A3,$B0,$D8,$DE,$DC,$C8,$7F,$67,$63,$70,$38,$3E,$7C,$B8
db $7F,$7F,$7F,$1F,$47,$70,$70,$39,$51,$0A,$04,$EA,$79,$7F,$70,$39
db $E8,$E8,$E0,$C0,$10,$70,$E0,$C0,$58,$38,$10,$30,$F0,$F0,$E0,$C0
db $00,$00,$00,$20,$66,$66,$66,$62,$00,$08,$1C,$3C,$7A,$7A,$7A,$7E
db $00,$00,$1F,$3F,$7F,$4F,$5F,$7F,$00,$00,$00,$11,$0A,$34,$2A,$51
db $77,$7F,$3F,$B7,$B3,$DB,$DA,$D8,$7F,$7D,$3F,$37,$33,$3B,$3A,$78
db $7F,$7F,$7F,$7F,$1F,$07,$70,$F0,$20,$51,$0A,$04,$EA,$39,$7F,$F0
db $CC,$E8,$E8,$E0,$C0,$18,$7C,$3E,$BC,$58,$38,$10,$30,$F8,$FC,$3E
db $03,$0F,$1F,$3F,$3B,$3F,$7F,$7F,$00,$00,$00,$06,$0E,$0C,$00,$00
db $80,$F0,$F8,$FC,$FE,$FE,$FF,$FE,$00,$00,$00,$00,$00,$00,$0F,$18
db $7F,$7F,$7F,$7F,$FF,$0F,$03,$00,$00,$00,$00,$00,$F8,$3E,$3B,$18
db $FE,$FB,$FF,$FF,$F6,$E0,$C0,$00,$10,$14,$10,$10,$38,$78,$F8,$30
db $00,$03,$0F,$1F,$3F,$3B,$3F,$7F,$00,$00,$00,$00,$06,$0E,$0C,$00
db $00,$C0,$F0,$F8,$FC,$FE,$FE,$FF,$00,$00,$00,$00,$00,$00,$00,$0F
db $7F,$7F,$7F,$7F,$7F,$FF,$0F,$03,$00,$00,$00,$00,$00,$F8,$7E,$F3
db $FE,$FE,$FB,$FF,$FF,$F6,$E0,$C0,$18,$10,$14,$10,$10,$38,$7C,$DE
db $00,$01,$01,$01,$01,$00,$00,$08,$00,$0D,$1E,$1E,$1E,$1F,$0F,$07
db $78,$F0,$F8,$E4,$C0,$CA,$CA,$C0,$78,$F0,$00,$1A,$3F,$35,$35,$3F
db $0F,$1F,$9F,$FF,$FF,$7F,$74,$20,$00,$00,$80,$E0,$E0,$70,$73,$21
db $E4,$FF,$FE,$FC,$9C,$1E,$00,$00,$1A,$07,$0C,$18,$78,$FE,$FC,$F0
db $00,$01,$03,$03,$07,$03,$01,$00,$00,$01,$02,$00,$38,$7C,$7E,$3F
db $00,$5F,$7F,$7F,$3F,$3F,$14,$00,$3F,$40,$60,$60,$20,$30,$13,$01
db $C0,$E0,$F0,$30,$38,$3C,$3C,$FC,$C0,$E0,$30,$D0,$D0,$D0,$D0,$00
db $07,$0F,$1F,$22,$20,$25,$25,$1F,$07,$0F,$02,$1D,$1F,$1A,$1A,$02
db $FE,$FE,$7E,$3A,$02,$01,$41,$41,$38,$7C,$FC,$FC,$FC,$FE,$BE,$BE
db $1F,$3F,$7E,$5C,$40,$80,$82,$82,$1C,$3E,$3F,$3F,$3F,$7F,$7D,$7D
db $82,$80,$A0,$44,$43,$40,$21,$1E,$7D,$7F,$5F,$3B,$3C,$3F,$1E,$00
db $1C,$3F,$3E,$3C,$40,$80,$82,$82,$1C,$3E,$3F,$1F,$3F,$7F,$7D,$7D
db $00,$00,$80,$80,$92,$9D,$C7,$EF,$00,$00,$00,$60,$62,$65,$3F,$1F
db $00,$23,$33,$3F,$3F,$7F,$7F,$7F,$70,$3C,$3C,$18,$00,$00,$02,$07
db $FE,$F8,$A0,$00,$00,$00,$80,$80,$CF,$7A,$5A,$10,$00,$00,$C0,$80
db $7E,$7F,$7D,$3F,$1E,$8F,$8F,$19,$85,$84,$86,$C6,$E7,$73,$73,$E1
db $E0,$0E,$73,$F3,$F9,$F9,$F8,$70,$80,$4E,$77,$F3,$FB,$F9,$FA,$78
db $0E,$66,$E2,$F6,$FF,$FF,$1F,$98,$11,$39,$7D,$39,$00,$00,$E0,$E7
db $00,$00,$00,$04,$0F,$0F,$1F,$07,$00,$00,$07,$07,$16,$10,$00,$38
db $F3,$E7,$EE,$EC,$CD,$CF,$CF,$DF,$CF,$1F,$17,$10,$33,$30,$30,$20
db $27,$3F,$3F,$78,$3C,$1F,$1F,$73,$38,$30,$40,$C7,$07,$66,$E0,$6C
db $9F,$3E,$7C,$FC,$F8,$F8,$C0,$40,$60,$C0,$80,$04,$9E,$FF,$F0,$F8
db $7F,$7E,$78,$01,$07,$1F,$3C,$7C,$24,$01,$07,$FE,$FF,$7F,$3F,$7F
db $FC,$F8,$A0,$FE,$FC,$F0,$80,$00,$CF,$7A,$0A,$FE,$FC,$00,$00,$00
db $7E,$7F,$7F,$3F,$1F,$8F,$8F,$18,$85,$86,$83,$C3,$E1,$70,$70,$E0
db $9F,$3E,$7C,$F8,$F8,$3C,$18,$F8,$60,$C0,$80,$00,$98,$FC,$FE,$FF
db $7F,$7F,$78,$01,$07,$13,$F1,$03,$24,$00,$07,$FE,$FF,$7F,$FF,$03
db $00,$00,$1C,$1D,$1B,$C3,$E3,$E1,$03,$0F,$23,$62,$64,$3C,$1C,$1E
db $E0,$CD,$1D,$4F,$EE,$FF,$3F,$3F,$1F,$3D,$6D,$4F,$EE,$F3,$20,$03
db $3F,$3F,$00,$00,$70,$B8,$FC,$FC,$07,$07,$1F,$3F,$0F,$47,$03,$00
db $07,$0F,$1F,$3F,$3E,$7C,$78,$78,$00,$00,$03,$07,$0F,$0F,$1F,$1F
db $3F,$5C,$39,$3B,$BF,$FF,$FE,$FE,$00,$23,$57,$4F,$57,$2F,$DF,$21
db $C0,$C0,$80,$80,$80,$80,$00,$00,$00,$00,$00,$00,$80,$80,$00,$00
db $FE,$FC,$61,$0F,$7F,$3F,$1F,$1E,$23,$0F,$1E,$F0,$1C,$3F,$1F,$1E
db $F0,$78,$E4,$C8,$CC,$BE,$BE,$3E,$00,$80,$18,$30,$34,$FE,$FE,$FE
db $00,$01,$00,$07,$07,$07,$07,$1F,$00,$00,$01,$04,$06,$06,$07,$07
db $00,$00,$0F,$3F,$3F,$0F,$00,$00,$0F,$3F,$7F,$F8,$F8,$7F,$3F,$0F
db $78,$7C,$7E,$7F,$3F,$3F,$1B,$09,$1F,$1F,$1F,$0B,$01,$01,$00,$00
db $0C,$00,$00,$00,$07,$7F,$7C,$00,$03,$1F,$3F,$3F,$78,$00,$03,$FF
db $01,$E1,$71,$79,$3D,$3D,$1F,$03,$00,$00,$00,$00,$00,$00,$00,$00
db $3F,$3F,$1F,$1B,$36,$30,$7F,$3F,$23,$27,$1F,$07,$0F,$1F,$7F,$3F
db $F8,$F8,$F8,$B8,$18,$D8,$D8,$B8,$E0,$80,$80,$40,$E0,$E0,$E0,$C0
db $01,$02,$04,$04,$08,$08,$10,$10,$03,$07,$0F,$1F,$3F,$7F,$FF,$1F
db $00,$0F,$13,$0D,$0D,$13,$0C,$20,$1F,$10,$0C,$12,$12,$2C,$3F,$3F
db $00,$24,$00,$24,$00,$04,$00,$00,$37,$36,$36,$36,$16,$16,$12,$02
db $0F,$41,$00,$88,$00,$44,$00,$00,$10,$7E,$FF,$FF,$F6,$76,$3A,$1A
db $38,$7C,$FE,$FE,$3B,$03,$03,$03,$00,$00,$38,$04,$00,$00,$00,$00
db $03,$33,$7B,$7F,$FF,$FB,$03,$03,$00,$00,$00,$38,$40,$00,$00,$00
db $DC,$C0,$E0,$E0,$E0,$E0,$E0,$C0,$FC,$A0,$80,$80,$00,$00,$00,$00
db $3F,$5F,$3F,$3F,$BB,$F8,$FE,$FE,$07,$27,$57,$4F,$57,$27,$C1,$21
db $1F,$0F,$0F,$1F,$1F,$1E,$38,$30,$1D,$0F,$0F,$1F,$1F,$1E,$38,$30
db $00,$20,$60,$60,$70,$F0,$F8,$F8,$00,$00,$38,$10,$4C,$18,$86,$24
db $F8,$FC,$FC,$7E,$7E,$3E,$1F,$07,$00,$42,$0A,$40,$10,$02,$08,$02
db $00,$C0,$70,$B8,$F4,$F2,$F5,$7B,$00,$00,$80,$40,$08,$0C,$0A,$84
db $00,$DF,$10,$FF,$DF,$FF,$FF,$F9,$00,$00,$CF,$20,$20,$20,$26,$2E
db $1F,$1F,$3E,$FC,$F8,$F0,$C0,$00,$E0,$E0,$C0,$00,$00,$00,$00,$00
db $F8,$FC,$FE,$FF,$FF,$DF,$DF,$00,$2F,$23,$21,$20,$20,$00,$00,$00
db $C1,$F1,$79,$7D,$3D,$3F,$1F,$03,$C1,$B1,$59,$6D,$35,$3B,$1F,$03
db $02,$06,$0E,$0E,$1E,$1E,$3E,$3E,$00,$02,$00,$08,$02,$00,$28,$00
db $3E,$3E,$3E,$3E,$1E,$1E,$0E,$02,$04,$10,$02,$10,$04,$00,$0A,$00
db $C1,$F1,$79,$7D,$3D,$3F,$1F,$03,$C1,$B1,$59,$6D,$35,$3B,$1F,$03
db $7C,$00,$00,$FF,$C3,$7F,$1F,$03,$00,$0F,$1F,$FF,$FC,$63,$1F,$03
db $FF,$FF,$7C,$00,$00,$7C,$FF,$FF,$00,$00,$FE,$C6,$C6,$FE,$00,$00
db $FF,$FF,$00,$04,$0C,$18,$30,$00,$00,$00,$06,$06,$0C,$18,$70,$60
db $FF,$FF,$00,$04,$04,$04,$08,$08,$00,$00,$06,$06,$04,$04,$08,$08
db $08,$10,$10,$00,$00,$10,$10,$08,$08,$10,$30,$30,$30,$30,$10,$08
db $7F,$3F,$3F,$3E,$1F,$0F,$03,$00,$00,$00,$01,$03,$01,$00,$00,$00
db $03,$0F,$FF,$7F,$7F,$7F,$7F,$7F,$03,$0E,$F8,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$22,$65,$25,$25,$25,$25,$77,$72
db $00,$00,$00,$00,$00,$00,$00,$00,$62,$95,$15,$25,$45,$85,$F7,$F2
db $00,$00,$00,$00,$00,$00,$00,$00,$A2,$A5,$A5,$A5,$F5,$F5,$27,$22
db $00,$00,$00,$00,$00,$00,$00,$00,$F2,$85,$85,$E5,$15,$15,$F7,$E2
db $00,$00,$00,$00,$00,$00,$00,$00,$62,$95,$55,$65,$B5,$95,$97,$62
db $00,$00,$00,$00,$00,$00,$00,$00,$20,$50,$50,$50,$50,$50,$70,$20
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$66,$E6,$66,$66,$66,$67,$F3,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$5E,$59,$59,$59,$5E,$D8,$98,$00
db $00,$00,$00,$00,$00,$7C,$38,$00,$00,$00,$00,$00,$00,$04,$08,$00
db $38,$4C,$C6,$C6,$C6,$64,$38,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $18,$38,$18,$18,$18,$18,$7E,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $7C,$C6,$0E,$3C,$78,$E0,$FE,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $7E,$0C,$18,$3C,$06,$C6,$7C,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $1C,$3C,$6C,$CC,$FE,$0C,$0C,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $FC,$C0,$FC,$06,$06,$C6,$7C,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $3C,$60,$C0,$FC,$C6,$C6,$7C,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $FE,$C6,$0C,$18,$30,$30,$30,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $7C,$C6,$C6,$7C,$C6,$C6,$7C,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $7C,$C6,$C6,$7E,$06,$0C,$78,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $38,$6C,$C6,$C6,$FE,$C6,$C6,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $FC,$C6,$C6,$FC,$C6,$C6,$FC,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $3C,$66,$C0,$C0,$C0,$66,$3C,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $F8,$CC,$C6,$C6,$C6,$CC,$F8,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $FE,$C0,$C0,$FC,$C0,$C0,$FE,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $FE,$C0,$C0,$FC,$C0,$C0,$C0,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $3E,$60,$C0,$CE,$C6,$66,$3E,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $C6,$C6,$C6,$FE,$C6,$C6,$C6,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $7E,$18,$18,$18,$18,$18,$7E,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $1E,$06,$06,$06,$C6,$C6,$7C,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $C6,$CC,$D8,$F0,$F8,$DC,$CE,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $60,$60,$60,$60,$60,$60,$7E,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $C6,$EE,$FE,$FE,$D6,$C6,$C6,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $C6,$E6,$F6,$FE,$DE,$CE,$C6,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $7C,$C6,$C6,$C6,$C6,$C6,$7C,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $FC,$C6,$C6,$C6,$FC,$C0,$C0,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $7C,$C6,$C6,$C6,$DE,$CC,$7A,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $FC,$C6,$C6,$CE,$F8,$DC,$CE,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $78,$CC,$C0,$7C,$06,$C6,$7C,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $7E,$18,$18,$18,$18,$18,$18,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $C6,$C6,$C6,$C6,$C6,$C6,$7C,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $C6,$C6,$C6,$EE,$7C,$38,$10,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $C6,$C6,$D6,$FE,$FE,$EE,$C6,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $C6,$EE,$7C,$38,$7C,$EE,$C6,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $66,$66,$66,$3C,$18,$18,$18,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $FE,$0E,$1C,$38,$70,$E0,$FE,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$00,$00,$00,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
db $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
db $00,$00,$00,$7E,$7E,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $00,$00,$44,$28,$10,$28,$44,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$7F,$7F,$7F,$7F,$7F,$7F,$7F,$7F
db $18,$3C,$3C,$3C,$18,$18,$00,$18,$00,$00,$00,$00,$00,$00,$00,$00
db $FF,$7F,$7F,$7F,$7F,$FF,$E3,$C1,$FF,$80,$80,$80,$80,$00,$1C,$3E
db $80,$80,$80,$C1,$E3,$FF,$FF,$FF,$7F,$7F,$7F,$3E,$1C,$00,$00,$FF
db $38,$7C,$7C,$7C,$7C,$7C,$38,$00,$08,$04,$04,$04,$04,$04,$08,$00
db $03,$06,$0C,$0C,$08,$08,$04,$03,$03,$05,$0B,$0B,$0F,$0F,$07,$03
db $01,$02,$04,$08,$10,$20,$40,$80,$01,$03,$07,$0F,$1F,$3F,$7F,$FF
db $00,$00,$00,$00,$00,$07,$38,$C0,$00,$00,$00,$00,$00,$07,$3F,$FF
db $00,$00,$00,$00,$00,$E0,$1C,$03,$00,$00,$00,$00,$00,$E0,$FC,$FF
db $80,$40,$20,$10,$08,$04,$02,$01,$80,$C0,$E0,$F0,$F8,$FC,$FE,$FF
db $04,$0E,$0E,$0E,$6E,$64,$60,$60,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
db $07,$0F,$1F,$1F,$7F,$FF,$FF,$7F,$07,$08,$10,$00,$60,$80,$80,$40
db $03,$07,$1F,$3F,$3F,$3F,$79,$F7,$03,$04,$18,$20,$20,$20,$46,$88
db $C0,$E0,$F0,$F4,$FE,$BF,$DF,$FF,$C0,$20,$10,$14,$0A,$41,$21,$01
db $90,$B8,$F8,$FA,$FF,$FF,$FF,$FE,$90,$A8,$48,$0A,$05,$01,$01,$02
db $3B,$1D,$0E,$0F,$07,$00,$00,$00,$24,$12,$09,$08,$07,$00,$00,$00
db $FF,$BF,$1C,$C0,$F3,$FF,$7E,$1C,$00,$40,$E3,$3F,$0C,$81,$62,$1C
db $BF,$7F,$3D,$83,$C7,$FF,$FF,$3C,$40,$80,$C2,$7C,$38,$00,$C3,$3C
db $FC,$FE,$FF,$FE,$FE,$F8,$60,$00,$04,$02,$01,$00,$06,$98,$60,$00
db $C0,$20,$10,$10,$10,$10,$20,$C0,$C0,$E0,$F0,$F0,$F0,$F0,$E0,$C0
db $00,$00,$00,$00,$3F,$7F,$E0,$C0,$00,$00,$00,$00,$00,$00,$1C,$3E
db $88,$9C,$88,$80,$80,$80,$80,$80,$7F,$7F,$7F,$3E,$1C,$00,$00,$00
db $FE,$FE,$FE,$FE,$FE,$FE,$FE,$FE,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
db $08,$14,$24,$C4,$03,$40,$A1,$26,$00,$08,$18,$38,$FC,$BF,$5E,$D9
db $FF,$FF,$FF,$FF,$7F,$7F,$7F,$7F,$81,$81,$81,$81,$81,$81,$81,$81
db $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$01,$01,$01,$01,$01,$01,$01,$01
db $7F,$80,$80,$98,$9C,$8C,$80,$80,$00,$7F,$7F,$67,$67,$7F,$7F,$7F
db $FF,$01,$01,$FF,$10,$10,$10,$FF,$00,$FF,$FF,$FF,$FF,$FF,$FF,$FF
db $80,$80,$80,$80,$80,$80,$80,$80,$7F,$7F,$7F,$7F,$7F,$7F,$7F,$7F
db $01,$01,$01,$FF,$10,$10,$10,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
db $FF,$00,$00,$00,$00,$00,$00,$00,$00,$FF,$FF,$FF,$FF,$FF,$FF,$FF
db $FE,$01,$01,$19,$1D,$0D,$01,$01,$00,$FF,$FF,$E7,$E7,$FF,$FF,$FF
db $01,$01,$01,$01,$01,$01,$01,$01,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
db $3F,$7F,$7F,$FF,$FF,$FF,$FF,$FF,$3F,$60,$40,$C0,$80,$80,$80,$80
db $FF,$FF,$FF,$FF,$FF,$FF,$7E,$3C,$80,$80,$80,$80,$80,$81,$42,$3C
db $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$00,$00,$00,$00,$00,$00,$00
db $FF,$FF,$FF,$FF,$FF,$FF,$FE,$7C,$00,$00,$00,$00,$00,$01,$82,$7C
db $FF,$FF,$FF,$FF,$FF,$FF,$FE,$7C,$00,$00,$00,$00,$00,$01,$83,$FF
db $F8,$FC,$FE,$FE,$FF,$FF,$FF,$FF,$F8,$04,$02,$02,$01,$01,$01,$01
db $FF,$FF,$FF,$FF,$FF,$FF,$7E,$3C,$01,$01,$01,$01,$01,$81,$42,$3C
db $00,$08,$08,$08,$10,$10,$10,$00,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
db $00,$7F,$7F,$78,$73,$73,$73,$7F,$7F,$80,$A0,$87,$8F,$8E,$8E,$86
db $00,$FF,$FF,$3F,$9F,$9F,$9F,$1F,$FE,$01,$05,$C1,$E1,$71,$71,$F1
db $7E,$7E,$7F,$7E,$7E,$7F,$7F,$FF,$81,$81,$80,$81,$81,$A0,$80,$FF
db $7F,$7F,$FF,$7F,$7F,$FF,$FF,$FF,$F1,$C1,$C1,$81,$C1,$C5,$01,$FF
db $7F,$80,$A0,$80,$80,$80,$80,$80,$7F,$FF,$FF,$FF,$FF,$FF,$FF,$FF
db $FE,$01,$05,$01,$01,$01,$01,$01,$FE,$FF,$FF,$FF,$FF,$FF,$FF,$FF
db $80,$80,$80,$80,$80,$A0,$80,$7F,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$7F
db $01,$01,$01,$01,$01,$05,$01,$FE,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FE
db $00,$00,$00,$00,$FC,$FE,$07,$03,$00,$00,$00,$00,$00,$00,$38,$7C
db $11,$39,$11,$01,$01,$01,$01,$01,$FE,$FE,$FE,$7C,$38,$00,$00,$00
db $EF,$28,$28,$28,$28,$28,$EF,$00,$20,$E7,$E7,$E7,$E7,$E7,$EF,$00
db $FE,$82,$82,$82,$82,$82,$FE,$00,$02,$7E,$7E,$7E,$7E,$7E,$FE,$00
db $80,$80,$80,$98,$9C,$8C,$80,$7F,$7F,$7F,$7F,$67,$67,$7F,$7F,$7F
db $FF,$FF,$83,$F3,$F3,$F3,$F3,$F3,$FF,$80,$FC,$8C,$8C,$8C,$8C,$8C
db $FF,$FF,$F0,$F6,$F6,$F6,$F6,$F6,$FF,$00,$0F,$09,$09,$09,$09,$09
db $FF,$FF,$00,$00,$00,$00,$00,$00,$FF,$00,$FF,$FF,$FF,$FF,$FF,$FF
db $FF,$FF,$01,$57,$2F,$57,$2F,$57,$FF,$01,$FF,$A9,$D1,$A9,$D1,$A9
db $F3,$F3,$F3,$F3,$F3,$F3,$FF,$3F,$8C,$8C,$8C,$8C,$8C,$8C,$FF,$3F
db $F6,$F6,$F6,$F6,$F6,$F6,$FF,$FF,$09,$09,$09,$09,$09,$09,$FF,$FF
db $00,$00,$00,$00,$00,$00,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
db $2F,$57,$2F,$57,$2F,$57,$FF,$FC,$D1,$A9,$D1,$A9,$D1,$A9,$FF,$FC
db $3C,$3C,$3C,$3C,$3C,$3C,$3C,$3C,$23,$23,$23,$23,$23,$23,$23,$23
db $FB,$FB,$FB,$FB,$FB,$FB,$FB,$FB,$04,$04,$04,$04,$04,$04,$04,$04
db $BC,$5C,$BC,$5C,$BC,$5C,$BC,$5C,$44,$A4,$44,$A4,$44,$A4,$44,$A4
db $1F,$20,$40,$40,$80,$80,$80,$81,$1F,$3F,$7F,$7F,$FF,$FF,$FF,$FE
db $FF,$80,$80,$C0,$FF,$FF,$FE,$FE,$FF,$7F,$7F,$3F,$00,$00,$01,$01
db $FF,$7F,$7F,$FF,$FF,$07,$03,$03,$FF,$80,$80,$00,$00,$F8,$FC,$FC
db $FF,$00,$00,$00,$00,$81,$C3,$FF,$FF,$FF,$FF,$FF,$FF,$7E,$3C,$00
db $F8,$FC,$FE,$FE,$E3,$C1,$81,$81,$F8,$04,$02,$02,$1D,$3F,$7F,$7F
db $83,$FF,$FF,$FF,$FF,$FF,$7F,$1F,$FC,$80,$80,$80,$80,$80,$60,$1F
db $FC,$FC,$FC,$FC,$FE,$FE,$FF,$FF,$03,$03,$03,$03,$01,$01,$00,$FF
db $01,$01,$01,$01,$03,$03,$07,$FF,$FE,$FE,$FE,$FE,$FC,$FC,$F8,$FF
db $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$00,$00,$00,$00,$00,$00,$00,$FF
db $81,$C1,$E3,$FF,$FF,$FF,$FF,$FE,$7F,$3F,$1D,$01,$01,$01,$03,$FE
db $FF,$FF,$FF,$FF,$FF,$FB,$B5,$CE,$80,$80,$80,$80,$80,$84,$CA,$B1
db $FF,$FF,$FF,$FF,$FF,$DF,$AD,$73,$01,$01,$01,$01,$01,$21,$53,$8D
db $77,$77,$77,$77,$77,$77,$77,$77,$00,$00,$00,$00,$77,$FF,$FF,$FF
db $00,$00,$00,$00,$00,$00,$00,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
db $77,$77,$77,$77,$00,$00,$00,$00,$FF,$FF,$FF,$77,$77,$77,$77,$77
db $01,$01,$01,$19,$1D,$0D,$01,$FE,$FF,$FF,$FF,$E7,$E7,$FF,$FF,$FE
db $20,$78,$7F,$FE,$FE,$FE,$FE,$FE,$00,$21,$21,$41,$41,$41,$41,$41
db $04,$9A,$FA,$FD,$FD,$FD,$FD,$FD,$00,$80,$80,$80,$80,$80,$80,$80
db $7E,$38,$21,$00,$01,$00,$01,$00,$21,$21,$01,$01,$01,$01,$01,$01
db $FA,$8A,$84,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80
db $02,$04,$00,$10,$00,$40,$80,$00,$01,$01,$06,$08,$18,$20,$20,$C0
db $0B,$0B,$3B,$0B,$FB,$0B,$0B,$0A,$04,$04,$C4,$F4,$F4,$04,$04,$05
db $90,$10,$1F,$10,$1F,$10,$10,$90,$70,$F0,$F0,$FF,$FF,$F0,$F0,$70
db $3F,$78,$E7,$CF,$58,$58,$50,$90,$C0,$87,$18,$B0,$E7,$E7,$EF,$EF
db $B0,$FC,$E2,$C1,$C1,$83,$8F,$7E,$6F,$43,$5D,$3F,$3F,$7F,$7F,$FF
db $FE,$03,$0F,$91,$70,$60,$20,$31,$03,$FF,$F1,$6E,$CF,$DF,$FF,$FF
db $3F,$3F,$1D,$39,$7B,$F3,$86,$FE,$FD,$FB,$FB,$F7,$F7,$0F,$7F,$FF
db $FF,$FF,$FF,$FF,$FF,$80,$80,$FF,$FF,$80,$80,$80,$80,$FF,$FF,$80
db $FE,$FF,$FF,$FF,$FF,$03,$03,$FF,$FE,$03,$03,$03,$03,$FF,$FF,$03
db $00,$FF,$FF,$FF,$FF,$FF,$00,$00,$00,$FF,$00,$00,$00,$00,$FF,$FF
db $3C,$FC,$FC,$FC,$FC,$FC,$04,$04,$23,$F3,$0B,$0B,$0B,$07,$FF,$FF
db $FF,$FF,$FF,$FF,$80,$FF,$FF,$FF,$80,$80,$80,$80,$FF,$80,$80,$80
db $FF,$FF,$FF,$FF,$03,$FF,$FF,$FF,$03,$03,$03,$03,$FF,$03,$03,$03
db $FF,$FF,$FF,$FF,$FF,$00,$FF,$FF,$00,$00,$00,$00,$00,$FF,$00,$00
db $FC,$FC,$FE,$FE,$FE,$02,$FE,$FE,$07,$07,$03,$03,$03,$FF,$03,$03
db $FF,$80,$80,$80,$80,$80,$80,$80,$80,$FF,$FF,$FF,$FF,$FF,$FF,$FF
db $FF,$03,$03,$03,$03,$03,$03,$03,$03,$FF,$FF,$FF,$FF,$FF,$FF,$FF
db $02,$02,$02,$02,$02,$02,$04,$04,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
db $80,$80,$AA,$D5,$AA,$FF,$FF,$FF,$FF,$FF,$D5,$AA,$D5,$80,$80,$FF
db $03,$03,$AB,$57,$AB,$FF,$FF,$FE,$FF,$FF,$57,$AB,$57,$03,$03,$FE
db $00,$55,$AA,$55,$FF,$FF,$FF,$00,$FF,$AA,$55,$AA,$00,$00,$FF,$00
db $04,$54,$AC,$5C,$FC,$FC,$FC,$3C,$FF,$AF,$57,$AB,$0B,$0B,$F3,$23
db $3F,$3F,$3F,$3F,$00,$00,$00,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
db $7E,$7C,$7C,$78,$00,$00,$00,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
db $1F,$0F,$0F,$07,$00,$00,$00,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
db $FE,$FC,$FC,$F8,$00,$00,$00,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
db $00,$00,$00,$00,$FF,$FF,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
db $18,$18,$18,$18,$18,$18,$18,$18,$00,$00,$00,$00,$00,$00,$00,$00
db $07,$1F,$3F,$FF,$7F,$7F,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
db $E1,$F9,$FD,$FF,$FE,$FE,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
db $F0,$10,$10,$10,$10,$10,$10,$FF,$00,$E0,$E0,$E0,$E0,$E0,$E0,$E0
db $1F,$10,$10,$10,$10,$10,$10,$FF,$00,$0F,$0F,$0F,$0F,$0F,$0F,$0F
db $92,$92,$92,$FE,$FE,$00,$00,$00,$48,$48,$6C,$00,$00,$00,$FE,$00
db $0A,$0A,$3A,$0A,$FB,$0B,$0B,$0B,$05,$05,$C5,$F5,$F4,$04,$04,$04
db $90,$90,$9F,$90,$9F,$90,$90,$90,$70,$70,$70,$7F,$7F,$70,$70,$70
db $01,$01,$01,$01,$01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00
db $80,$80,$80,$80,$80,$80,$80,$80,$00,$00,$00,$00,$00,$00,$00,$00
db $08,$88,$91,$D1,$53,$53,$73,$3F,$FF,$FF,$FF,$FF,$FF,$FE,$BE,$CE
db $00,$00,$07,$0F,$0C,$1B,$1B,$1B,$00,$00,$00,$00,$03,$04,$04,$04
db $00,$00,$E0,$F0,$F0,$F8,$F8,$F8,$00,$00,$60,$30,$30,$98,$98,$98
db $1B,$1B,$1B,$1B,$1B,$0F,$0F,$07,$04,$04,$04,$04,$04,$03,$00,$00
db $F8,$F8,$F8,$F8,$F8,$F0,$F0,$E0,$98,$98,$98,$98,$98,$30,$30,$60
db $F1,$11,$11,$1F,$10,$10,$10,$FF,$0F,$EF,$EF,$EF,$EF,$EF,$EF,$E0
db $1F,$10,$10,$F0,$10,$10,$10,$FF,$E0,$EF,$EF,$EF,$EF,$EF,$EF,$0F
db $7F,$BF,$DF,$EF,$F0,$F0,$F0,$F0,$80,$40,$20,$10,$0F,$0F,$0F,$0F
db $F0,$F0,$F0,$F0,$FF,$FF,$FF,$FF,$0F,$0F,$0F,$0F,$1F,$3F,$7F,$FF
db $FF,$FF,$FF,$FF,$0F,$0F,$0F,$0F,$01,$03,$07,$0F,$FF,$FF,$FF,$FF
db $0F,$0F,$0F,$0F,$F7,$FB,$FD,$FE,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
db $00,$00,$00,$00,$00,$00,$18,$18,$00,$00,$00,$00,$00,$00,$00,$00
db $1F,$3F,$7F,$7F,$7F,$FF,$FF,$FF,$1F,$20,$40,$40,$40,$80,$82,$82
db $FF,$FF,$FF,$7F,$7F,$7F,$3F,$1E,$82,$80,$A0,$44,$43,$40,$21,$1E
db $F8,$FC,$FE,$FE,$FE,$FF,$FF,$FF,$F8,$04,$02,$02,$02,$01,$41,$41
db $FF,$FF,$FF,$FE,$FE,$FE,$FC,$78,$41,$01,$05,$22,$C2,$02,$84,$78
db $7F,$80,$80,$80,$80,$80,$80,$80,$80,$7F,$7F,$7F,$7F,$7F,$7F,$7F
db $DE,$61,$61,$61,$71,$5E,$7F,$61,$61,$DF,$DF,$DF,$DF,$FF,$C1,$DF
db $80,$80,$C0,$F0,$BF,$8F,$81,$7E,$7F,$7F,$FF,$3F,$4F,$71,$7F,$FF
db $61,$61,$C1,$C1,$81,$81,$83,$FE,$DF,$DF,$BF,$BF,$7F,$7F,$7F,$7F
db $00,$00,$03,$0F,$1F,$3F,$7F,$7F,$00,$00,$03,$0C,$10,$20,$40,$40
db $00,$00,$C0,$F0,$F8,$FC,$FE,$FE,$00,$00,$C0,$30,$08,$04,$02,$02
db $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$80,$80,$80,$80,$80,$80,$80,$80
db $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$01,$01,$01,$01,$01,$01,$01,$01
db $7F,$7F,$7F,$3F,$3F,$1F,$0F,$07,$40,$40,$40,$20,$30,$1C,$0F,$07
db $FE,$FE,$FE,$FC,$FC,$F8,$F0,$F0,$02,$02,$02,$04,$0C,$38,$F0,$F0
db $0F,$0F,$0F,$0F,$0F,$0F,$07,$0F,$08,$08,$08,$08,$08,$0C,$05,$0A
db $F0,$F0,$F0,$F0,$F0,$F0,$E0,$F0,$10,$50,$50,$50,$50,$30,$A0,$50
db $81,$C1,$A3,$A3,$9D,$81,$81,$81,$00,$41,$22,$22,$1C,$00,$00,$00
db $E3,$F7,$C1,$C1,$C1,$C1,$F7,$E3,$E3,$14,$3E,$3E,$3E,$3E,$14,$E3
db $00,$00,$07,$0F,$0C,$1B,$1B,$1B,$FF,$FF,$F8,$F0,$F0,$E0,$E0,$E0
db $00,$00,$E0,$F0,$F0,$F8,$F8,$F8,$FF,$FF,$7F,$3F,$3F,$9F,$9F,$9F
db $1B,$1B,$1B,$1B,$1B,$0F,$0F,$07,$E0,$E0,$E0,$E0,$E0,$F3,$F0,$F8
db $F8,$F8,$F8,$F8,$F8,$F0,$F0,$E0,$9F,$9F,$9F,$9F,$9F,$3F,$3F,$7F
db $E0,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$00,$70,$1F,$10,$70,$7F,$7F,$7F
db $07,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$00,$03,$F8,$00,$03,$FB,$FB,$FB
db $FF,$FF,$FF,$FF,$FF,$FE,$FF,$EF,$7C,$7B,$76,$75,$75,$77,$17,$67
db $FF,$DF,$EF,$AF,$AF,$6F,$EF,$E7,$3B,$FB,$7B,$FB,$FB,$F3,$F8,$F3
db $1F,$1F,$3F,$3F,$70,$63,$E7,$E5,$0F,$0F,$1F,$1F,$3F,$3C,$78,$7A
db $F0,$F0,$F8,$F8,$0C,$C4,$E4,$A6,$F8,$F8,$FC,$FC,$FE,$3E,$1E,$5F
db $E9,$E9,$E9,$EF,$E2,$E3,$F0,$FF,$76,$76,$76,$70,$7D,$7C,$7F,$7F
db $96,$96,$96,$F6,$46,$C6,$0E,$FE,$6F,$6F,$6F,$0F,$BF,$3F,$FF,$FF
db $00,$00,$00,$00,$00,$00,$7E,$3C,$3C,$7E,$7E,$FF,$FF,$FF,$42,$00
db $3C,$42,$99,$A1,$A1,$99,$42,$3C,$00,$00,$00,$00,$00,$00,$00,$00
db $0F,$1F,$1F,$3F,$3F,$7F,$7F,$7F,$F0,$E0,$E0,$C0,$C0,$80,$80,$80
db $F0,$F8,$F8,$FC,$FC,$FE,$FE,$FE,$0F,$07,$07,$03,$03,$01,$01,$01
db $7F,$7F,$3F,$3F,$3F,$3F,$1F,$1F,$80,$80,$C0,$C0,$E0,$F8,$FE,$FF
db $FE,$FF,$FF,$FF,$FC,$FC,$FE,$FE,$FF,$7F,$1F,$07,$03,$03,$01,$81
db $7F,$7F,$7F,$3F,$3F,$3F,$3F,$1F,$80,$80,$80,$C0,$C0,$E0,$E0,$F0
db $FE,$FE,$FF,$FF,$FF,$FF,$FF,$FE,$01,$01,$01,$03,$03,$07,$07,$0F
db $1F,$0F,$0F,$07,$00,$00,$00,$00,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
db $FE,$FC,$FC,$F8,$00,$00,$00,$00,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
db $7E,$7E,$7E,$7E,$7F,$7F,$7F,$7F,$81,$81,$81,$81,$81,$81,$81,$81
db $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FE,$01,$01,$01,$03,$03,$07,$07,$0F
db $FE,$FE,$FE,$FE,$FF,$FF,$FF,$FF,$01,$01,$01,$01,$01,$01,$01,$01
db $7F,$7F,$7F,$7F,$7F,$7F,$7F,$7F,$81,$81,$81,$81,$81,$81,$81,$81
db $FF,$FF,$FF,$FF,$FC,$FE,$FE,$7E,$FF,$03,$03,$03,$03,$03,$03,$FF
db $FF,$FF,$FF,$FF,$00,$00,$00,$00,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
db $7F,$7F,$7F,$7F,$7F,$7F,$7F,$7F,$80,$80,$80,$80,$80,$80,$80,$80
db $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FE,$01,$01,$01,$03,$07,$03,$01,$01
db $7E,$7E,$7F,$7F,$7F,$7F,$7F,$7F,$81,$81,$81,$81,$81,$81,$81,$81
db $3F,$3F,$3F,$3F,$00,$00,$00,$00,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
db $7E,$7C,$7C,$78,$00,$00,$00,$00,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
db $FE,$FE,$FF,$FF,$7F,$7F,$7F,$7F,$81,$81,$81,$81,$81,$81,$81,$81
db $7F,$7F,$3F,$3F,$3F,$3F,$1F,$1F,$80,$80,$C0,$C0,$E0,$F8,$FE,$FF
db $3F,$BF,$FF,$FF,$FC,$FC,$FE,$FE,$FF,$7F,$1F,$07,$03,$03,$01,$81
db $7F,$7F,$7E,$7E,$7F,$7F,$7F,$7F,$81,$81,$81,$81,$81,$81,$81,$81
db $7E,$7E,$7E,$7E,$7F,$7F,$7F,$7F,$81,$81,$81,$81,$81,$81,$81,$81
db $81,$C3,$C3,$E7,$E7,$FF,$FF,$FF,$7E,$3C,$3C,$18,$18,$00,$00,$00
db $0F,$43,$5B,$53,$31,$19,$0F,$07,$F2,$FE,$FE,$FF,$FF,$EF,$F7,$F8
db $C1,$C3,$C6,$84,$FC,$FC,$0E,$02,$BF,$BE,$BD,$7B,$7B,$07,$F3,$FD
db $10,$20,$22,$BA,$E6,$E1,$C0,$C0,$FF,$FF,$FF,$67,$59,$9E,$BF,$BF
db $20,$A6,$54,$26,$20,$C6,$54,$26,$20,$E6,$54,$26,$21,$06,$54,$26
db $20,$85,$01,$44,$20,$86,$54,$48,$20,$9A,$01,$49,$20,$A5,$C9,$46
db $20,$BA,$C9,$4A,$20,$A6,$0A,$D0,$D1,$D8,$D8,$DE,$D1,$D0,$DA,$DE
db $D1,$20,$C6,$0A,$D2,$D3,$DB,$DB,$DB,$D9,$DB,$DC,$DB,$DF,$20,$E6
db $0A,$D4,$D5,$D4,$D9,$DB,$E2,$D4,$DA,$DB,$E0,$21,$06,$0A,$D6,$D7
db $D6,$D7,$E1,$26,$D6,$DD,$E1,$E1,$21,$26,$14,$D0,$E8,$D1,$D0,$D1
db $DE,$D1,$D8,$D0,$D1,$26,$DE,$D1,$DE,$D1,$D0,$D1,$D0,$D1,$26,$21
db $46,$14,$DB,$42,$42,$DB,$42,$DB,$42,$DB,$DB,$42,$26,$DB,$42,$DB
db $42,$DB,$42,$DB,$42,$26,$21,$66,$46,$DB,$21,$6C,$0E,$DF,$DB,$DB
db $DB,$26,$DB,$DF,$DB,$DF,$DB,$DB,$E4,$E5,$26,$21,$86,$14,$DB,$DB
db $DB,$DE,$43,$DB,$E0,$DB,$DB,$DB,$26,$DB,$E3,$DB,$E0,$DB,$DB,$E6
db $E3,$26,$21,$A6,$14,$DB,$DB,$DB,$DB,$42,$DB,$DB,$DB,$D4,$D9,$26
db $DB,$D9,$DB,$DB,$D4,$D9,$D4,$D9,$E7,$21,$C5,$16,$5F,$95,$95,$95
db $95,$95,$95,$95,$95,$97,$98,$78,$95,$96,$95,$95,$97,$98,$97,$98
db $95,$7A,$21,$ED,$0E,$CF,$01,$09,$08,$05,$24,$17,$12,$17,$1D,$0E
db $17,$0D,$18,$22,$4B,$0D,$01,$24,$19,$15,$0A,$22,$0E,$1B,$24,$10
db $0A,$16,$0E,$22,$8B,$0D,$02,$24,$19,$15,$0A,$22,$0E,$1B,$24,$10
db $0A,$16,$0E,$22,$EC,$04,$1D,$18,$19,$28,$22,$F6,$01,$00,$23,$C9
db $56,$55,$23,$E2,$04,$99,$AA,$AA,$AA,$23,$EA,$04,$99,$AA,$AA,$AA
db $00,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF

722
demos/smb/font.s Normal file
View File

@ -0,0 +1,722 @@
****************************************
* FONT ENGINE (v3?) *
* *
* Dagen Brock <dagenbrock@gmail.com> *
* 2013-07-20 *
****************************************
* A= ptr to string preceded by length *
* X= screen location *
****************************************
; each char:
; draw char at loc
; update loc
; see if length hit - no? back to draw char
; rel
mx %00
]F_Length ds 2 ;length of string (only one byte currently used)
]F_CharIdx ds 2 ;index of current character
]F_CurrentPos ds 2 ;current top left char position
]F_StrPtr equ $01 ;pointer to string (including length byte) / DP
]F_StrClr equ $03
;x = TopLeft screen pos
;y = font mask
;a = 8-bit char
DrawBottom
pha ; local variable space
pha
tsc
phd
tcd
sty ]F_StrClr
lda 3,s
sec
sbc #' '
asl ;*2
tay
jsr drawBottom
pld
pla
pla
rts
;x = TopLeft screen pos
;y = font mask
;a = 8-bit char
DrawChar
pha ; local variable space
pha
tsc
phd
tcd
sty ]F_StrClr
lda 3,s
sec
sbc #' '
asl ;*2
tay
jsr drawChar
pld
pla
pla
rts
DrawString
pha ; local variable space
pha
tsc
phd
tcd
; sta ]F_StrPtr ; (done in pha init above) store at dp 0 ($00) for indirect loads
stx ]F_CurrentPos
sty ]F_StrClr
stz ]F_CharIdx
lda (]F_StrPtr)
and #$00ff ;strip off first char (len is only one byte)
sta ]F_Length ;get our length byte
NextChar lda ]F_CharIdx
cmp ]F_Length
bne :notDone
ldy ]F_StrClr ;restore the color pattern
pld
pla
pla
rts ;DONE! Return to caller
:notDone inc ]F_CharIdx
ldy ]F_CharIdx
lda (]F_StrPtr),y ;get next char!
and #$00FF ;mask high byte
sec
sbc #' ' ;our table starts with space ' '
asl ;*2
tay
ldx ]F_CurrentPos
jsr drawChar
inc ]F_CurrentPos ;compare to addition time (?)
inc ]F_CurrentPos
inc ]F_CurrentPos
inc ]F_CurrentPos ;update screen pos (2 words=8 pixels)
bra NextChar
drawBottom lda FontTable,y ;get real address of char data
sec
sbc #FontData ;pivot offset - now a is offset of fontdata
tay ;so we'll index with that
brl bottom
drawChar lda FontTable,y ;get real address of char data
sec
sbc #FontData ;pivot offset - now a is offset of fontdata
tay ;so we'll index with that
lda FontData,y
and ]F_StrClr
stal $E12000,x
lda FontData+2,y
and ]F_StrClr
stal $E12000+2,x
lda FontData+4,y
and ]F_StrClr
stal $E12000+160,x
lda FontData+6,y
and ]F_StrClr
stal $E12000+160+2,x
lda FontData+8,y
and ]F_StrClr
stal {$E12000+160*2},x
lda FontData+10,y
and ]F_StrClr
stal {$E12000+160*2+2},x
lda FontData+12,y
and ]F_StrClr
stal {$E12000+160*3},x
lda FontData+14,y
and ]F_StrClr
stal {$E12000+160*3+2},x
lda FontData+16,y
and ]F_StrClr
stal {$E12000+160*4},x
lda FontData+18,y
and ]F_StrClr
stal {$E12000+160*4+2},x
bottom
lda FontData+20,y
and ]F_StrClr
stal {$E12000+160*5},x
lda FontData+22,y
and ]F_StrClr
stal {$E12000+160*5+2},x
rts
FontTable dw s_Space
dw s_Exclaim
dw s_Quote
dw s_Number
dw s_Dollar
dw s_Percent
dw s_Amper
dw s_Single
dw s_OpenParen
dw s_CloseParen
dw s_Asterix
dw s_Plus
dw s_Comma
dw s_Minus
dw s_Period
dw s_Slash
dw s_N0
dw s_N1
dw s_N2
dw s_N3
dw s_N4
dw s_N5
dw s_N6
dw s_N7
dw s_N8
dw s_N9
dw s_Colon
dw s_Semi
dw s_LAngle
dw s_Equal
dw s_RAngle
dw s_Question
dw s_At
dw s_A
dw s_B
dw s_C
dw s_D
dw s_E
dw s_F
dw s_G
dw s_H
dw s_I
dw s_J
dw s_K
dw s_L
dw s_M
dw s_N
dw s_O
dw s_P
dw s_Q
dw s_R
dw s_S
dw s_T
dw s_U
dw s_V
dw s_W
dw s_X
dw s_Y
dw s_Z
dw s_LBracket
dw s_BackSlash
dw s_RBracket
dw s_Carot
dw s_UnderLine
FontData = *
s_Space hex 00000000
hex 00000000
hex 00000000
hex 00000000
hex 00000000
hex 00000000
s_Exclaim hex 000FF000
hex 000FF000
hex 000FF000
hex 000FF000
hex 00000000
hex 000FF000
s_Quote hex 0FF00FF0
hex 00F000F0
hex 00000000
hex 00000000
hex 00000000
hex 00000000
s_Number hex 00000000
hex 00F00F00
hex 0FFFFFF0
hex 00F00F00
hex 0FFFFFF0
hex 00F00F00
s_Dollar hex 000F0F00
hex 00FFFFF0
hex 0F0F0F00
hex 00FFFF00
hex 000F0FF0
hex 0FFFFF00
s_Percent hex 0FF000F0
hex 00000F00
hex 0000F000
hex 000F0000
hex 00F00000
hex 0F000FF0
s_Amper hex 000FF000
hex 00F00F00
hex 0F00F000
hex 00F000F0
hex 0F0FFF00
hex 00F0F000
s_Single hex 000FF000
hex 0000F000
hex 00000000
hex 00000000
hex 00000000
hex 00000000
s_OpenParen hex 000FF000
hex 00FF0000
hex 0FF00000
hex 0FF00000
hex 00FF0000
hex 000FF000
s_CloseParen hex 000FF000
hex 0000FF00
hex 00000FF0
hex 00000FF0
hex 0000FF00
hex 000FF000
s_Asterix hex 00000000
hex 00F0F0F0
hex 000FFF00
hex 00FFFFF0
hex 000FFF00
hex 00F0F0F0
s_Plus hex 000F0000
hex 000F0000
hex 0FFFFF00
hex 000F0000
hex 000F0000
hex 00000000
s_Comma hex 00000000
hex 00000000
hex 00000000
hex 00000000
hex 0000FF00
hex 0000F000
s_Minus hex 00000000
hex 00000000
hex 0FFFFF00
hex 00000000
hex 00000000
hex 00000000
s_Period hex 00000000
hex 00000000
hex 00000000
hex 00000000
hex 0000FF00
hex 0000FF00
s_Slash hex 000000F0
hex 00000F00
hex 0000F000
hex 000F0000
hex 00F00000
hex 0F000000
s_N0 hex 00FFFF00
hex 0F000FF0
hex 0F00F0F0
hex 0F0F00F0
hex 0FF000F0
hex 00FFFF00
s_N1 hex 000F0000
hex 00FF0000
hex 000F0000
hex 000F0000
hex 000F0000
hex 00FFF000
s_N2 hex 00FFFF00
hex 0F0000F0
hex 00000F00
hex 000FF000
hex 00F00000
hex 0FFFFFF0
s_N3 hex 00FFFF00
hex 000000F0
hex 000FFF00
hex 000000F0
hex 000000F0
hex 00FFFF00
s_N4 hex 0000FF00
hex 000F0F00
hex 00F00F00
hex 0FFFFFF0
hex 00000F00
hex 00000F00
s_N5 hex 0FFFFFF0
hex 0F000000
hex 0FFFFF00
hex 000000F0
hex 0F0000F0
hex 00FFFF00
s_N6 hex 000FFF00
hex 00F00000
hex 0F000000
hex 0FFFFF00
hex 0F0000F0
hex 00FFFFF0
s_N7 hex 0FFFFFF0
hex 000000F0
hex 00000F00
hex 0000F000
hex 000F0000
hex 000F0000
s_N8 hex 00FFFF00
hex 0F0000F0
hex 00FFFF00
hex 0F0000F0
hex 0F0000F0
hex 00FFFF00
s_N9 hex 00FFFF00
hex 0F0000F0
hex 00FFFF00
hex 0000F000
hex 000F0000
hex 00F00000
s_Colon hex 000FF000
hex 000FF000
hex 00000000
hex 000FF000
hex 000FF000
hex 00000000
s_Semi hex 00000000
hex 000FF000
hex 000FF000
hex 00000000
hex 000FF000
hex 000F0000
s_LAngle hex 0000F000
hex 000F0000
hex 00F00000
hex 000F0000
hex 0000F000
hex 00000000
s_Equal hex 00000000
hex 00000000
hex 0FFFFF00
hex 00000000
hex 0FFFFF00
hex 00000000
s_RAngle hex 0000F000
hex 00000F00
hex 000000F0
hex 00000F00
hex 0000F000
hex 00000000
s_Question hex 00FFF000
hex 0F000F00
hex 00000F00
hex 000FF000
hex 00000000
hex 000FF000
s_At hex 00FFFF00
hex 0F0000F0
hex 0F00F0F0
hex 0FFFF0F0
hex 000000F0
hex 0FFFFF00
s_A hex 000FF000
hex 00F00F00
hex 0F0000F0
hex 0FFFFFF0
hex 0F0000F0
hex 0F0000F0
s_B hex 0FFFFF00
hex 0F0000F0
hex 0FFFFF00
hex 0F0000F0
hex 0F0000F0
hex 0FFFFF00
s_C hex 00FFFFF0
hex 0F000000
hex 0F000000
hex 0F000000
hex 0F000000
hex 00FFFFF0
s_D hex 0FFFFF00
hex 0F0000F0
hex 0F0000F0
hex 0F0000F0
hex 0F0000F0
hex 0FFFFF00
s_E hex 0FFFFFF0
hex 0F000000
hex 0FFFF000
hex 0F000000
hex 0F000000
hex 0FFFFFF0
s_F hex 0FFFFFF0
hex 0F000000
hex 0FFFF000
hex 0F000000
hex 0F000000
hex 0F000000
s_G hex 00FFFFF0
hex 0F000000
hex 0F000000
hex 0F00FFF0
hex 0F0000F0
hex 00FFFF00
s_H hex 0F0000F0
hex 0F0000F0
hex 0FFFFFF0
hex 0F0000F0
hex 0F0000F0
hex 0F0000F0
s_I hex 0FFFFF00
hex 000F0000
hex 000F0000
hex 000F0000
hex 000F0000
hex 0FFFFF00
s_J hex 000000F0
hex 000000F0
hex 000000F0
hex 0F0000F0
hex 0F0000F0
hex 00FFFF00
s_K hex 0F000F00
hex 0F00F000
hex 0FFF0000
hex 0F00F000
hex 0F000F00
hex 0F000F00
s_L hex 0F000000
hex 0F000000
hex 0F000000
hex 0F000000
hex 0F000000
hex 0FFFFFF0
s_M hex 0F0000F0
hex 0FF00FF0
hex 0F0FF0F0
hex 0F0000F0
hex 0F0000F0
hex 0F0000F0
s_N hex 0F0000F0
hex 0FF000F0
hex 0F0F00F0
hex 0F00F0F0
hex 0F000FF0
hex 0F0000F0
s_O hex 00FFFF00
hex 0F0000F0
hex 0F0000F0
hex 0F0000F0
hex 0F0000F0
hex 00FFFF00
s_P hex 0FFFFF00
hex 0F0000F0
hex 0FFFFF00
hex 0F000000
hex 0F000000
hex 0F000000
s_Q hex 00FFFF00
hex 0F0000F0
hex 0F0000F0
hex 0F00F0F0
hex 0F000FF0
hex 00FFFFF0
s_R hex 0FFFFF00
hex 0F0000F0
hex 0FFFFF00
hex 0F000F00
hex 0F0000F0
hex 0F0000F0
s_S hex 00FFFFF0
hex 0F000000
hex 00FFFF00
hex 000000F0
hex 000000F0
hex 0FFFFF00
s_T hex 0FFFFF00
hex 000F0000
hex 000F0000
hex 000F0000
hex 000F0000
hex 000F0000
s_U hex 0F0000F0
hex 0F0000F0
hex 0F0000F0
hex 0F0000F0
hex 0F0000F0
hex 00FFFF00
s_V hex 0F0000F0
hex 0F0000F0
hex 0F0000F0
hex 0F0000F0
hex 00F00F00
hex 000FF000
s_W hex 0F0000F0
hex 0F0000F0
hex 0F0000F0
hex 0F0FF0F0
hex 0FF00FF0
hex 0F0000F0
s_X hex 0F0000F0
hex 00F00F00
hex 000FF000
hex 000FF000
hex 00F00F00
hex 0F0000F0
s_Y hex F00000F0
hex 0F000F00
hex 00F0F000
hex 000F0000
hex 000F0000
hex 000F0000
s_Z hex 0FFFFFF0
hex 00000F00
hex 0000F000
hex 000F0000
hex 00F00000
hex 0FFFFFF0
s_LBracket hex 000FFF00
hex 000F0000
hex 000F0000
hex 000F0000
hex 000F0000
hex 000FFF00
s_BackSlash hex 0F000000
hex 00F00000
hex 000F0000
hex 0000F000
hex 00000F00
hex 000000F0
s_RBracket hex 00FFF000
hex 0000F000
hex 0000F000
hex 0000F000
hex 0000F000
hex 00FFF000
s_Carot hex 0000F000
hex 000F0F00
hex 00F000F0
hex 00000000
hex 00000000
hex 00000000
s_UnderLine hex 00000000
hex 00000000
hex 00000000
hex 00000000
hex 00000000
hex FFFFFFF0
s_Template hex 00000000
hex 00000000
hex 00000000
hex 00000000
hex 00000000
hex 00000000

39
demos/smb/mkswizzetbl.sh Normal file
View File

@ -0,0 +1,39 @@
# Area Type $01, Above ground
node swizzle.js AT1_T0 2 3 4
node swizzle.js AT1_T1 5 6 4
node swizzle.js AT1_T2 7 8 4
node swizzle.js AT1_T3 1 6 4
node swizzle.js AT1_S0 14 9 15
node swizzle.js AT1_S1 10 7 9
node swizzle.js AT1_S2 11 7 9
node swizzle.js AT1_S3 4 5 6
# Area Type $02, Underground
node swizzle.js AT2_T0 2 3 4
node swizzle.js AT2_T1 5 6 0
node swizzle.js AT2_T2 7 8 6
node swizzle.js AT2_T3 1 9 6
node swizzle.js AT2_S0 14 10 15
node swizzle.js AT2_S1 6 11 9
node swizzle.js AT2_S2 12 7 10
node swizzle.js AT2_S3 13 5 6
# Area Type $03, Castle
node swizzle.js AT3_T0 2 3 4
node swizzle.js AT3_T1 2 3 4
node swizzle.js AT3_T2 2 5 4
node swizzle.js AT3_T3 1 6 4
node swizzle.js AT3_S0 14 7 15
node swizzle.js AT3_S1 8 9 10
node swizzle.js AT3_S2 5 2 7
node swizzle.js AT3_S3 11 2 3
# Area Type $00, Water
node swizzle.js AT0_T0 2 3 4
node swizzle.js AT0_T1 5 6 7
node swizzle.js AT0_T2 8 9 7
node swizzle.js AT0_T3 1 9 7
node swizzle.js AT0_S0 14 10 15
node swizzle.js AT0_S1 11 8 10
node swizzle.js AT0_S2 12 8 10
node swizzle.js AT0_S3 7 8 11

View File

@ -7,11 +7,23 @@
"merlin32": "C:\\Programs\\IIgsXDev\\bin\\Merlin32-1.1.10.exe",
"cadius": "C:\\Programs\\IIgsXDev\\bin\\Cadius.exe",
"gsport": "C:\\Programs\\gsport\\gsport_0.31\\GSPort.exe",
"macros": "C:\\Programs\\BrutalDeluxe\\Merlin32\\Library",
"crossrunner": "C:\\Programs\\Crossrunner\\Crossrunner.exe"
"macros": "../../macros",
"crossrunner": "C:\\Program Files\\Crossrunner\\Crossrunner.exe"
},
"scripts": {
"build": "%npm_package_config_merlin32% -V %npm_package_config_macros% App.s"
"test": "npm run build && npm run build:image && npm run gsport",
"gsport": "%npm_package_config_gsport%",
"build:rom": "%npm_package_config_merlin32% -V %npm_package_config_macros% RomOnly.s",
"build:sys16": "%npm_package_config_merlin32% -V %npm_package_config_macros% App.s",
"build:sim": "%npm_package_config_merlin32% -V %npm_package_config_macros% Sim.s",
"build": "npm run build:tool && npm run build:sys16",
"build:tool": "%npm_package_config_merlin32% -V %npm_package_config_macros% ../../src/Master.s",
"build:image": "build-image.bat %npm_package_config_cadius%",
"build:swizzle": "./mkswizzetbl.sh > pal_w11.s",
"build:image:sim": "npm run build:sim && npm run build:image",
"run:sim": "npm run build:sim && npm run build:image && npm run gsport",
"debug": "\"%npm_package_config_crossrunner%\" SuperMarioGS -Source SuperMarioGS_S02__Output.txt -Source SuperMarioGS_S03__Output.txt -Debug -CompatibilityLayer"
},
"repository": {
"type": "git",

544
demos/smb/pal_w11.s Normal file
View File

@ -0,0 +1,544 @@
AT1_T0
dw $0000,$0200,$0300,$0400,$2000,$2200,$2300,$2400,$3000,$3200,$3300,$3400,$4000,$4200,$4300,$4400
dw $0002,$0202,$0302,$0402,$2002,$2202,$2302,$2402,$3002,$3202,$3302,$3402,$4002,$4202,$4302,$4402
dw $0003,$0203,$0303,$0403,$2003,$2203,$2303,$2403,$3003,$3203,$3303,$3403,$4003,$4203,$4303,$4403
dw $0004,$0204,$0304,$0404,$2004,$2204,$2304,$2404,$3004,$3204,$3304,$3404,$4004,$4204,$4304,$4404
dw $0020,$0220,$0320,$0420,$2020,$2220,$2320,$2420,$3020,$3220,$3320,$3420,$4020,$4220,$4320,$4420
dw $0022,$0222,$0322,$0422,$2022,$2222,$2322,$2422,$3022,$3222,$3322,$3422,$4022,$4222,$4322,$4422
dw $0023,$0223,$0323,$0423,$2023,$2223,$2323,$2423,$3023,$3223,$3323,$3423,$4023,$4223,$4323,$4423
dw $0024,$0224,$0324,$0424,$2024,$2224,$2324,$2424,$3024,$3224,$3324,$3424,$4024,$4224,$4324,$4424
dw $0030,$0230,$0330,$0430,$2030,$2230,$2330,$2430,$3030,$3230,$3330,$3430,$4030,$4230,$4330,$4430
dw $0032,$0232,$0332,$0432,$2032,$2232,$2332,$2432,$3032,$3232,$3332,$3432,$4032,$4232,$4332,$4432
dw $0033,$0233,$0333,$0433,$2033,$2233,$2333,$2433,$3033,$3233,$3333,$3433,$4033,$4233,$4333,$4433
dw $0034,$0234,$0334,$0434,$2034,$2234,$2334,$2434,$3034,$3234,$3334,$3434,$4034,$4234,$4334,$4434
dw $0040,$0240,$0340,$0440,$2040,$2240,$2340,$2440,$3040,$3240,$3340,$3440,$4040,$4240,$4340,$4440
dw $0042,$0242,$0342,$0442,$2042,$2242,$2342,$2442,$3042,$3242,$3342,$3442,$4042,$4242,$4342,$4442
dw $0043,$0243,$0343,$0443,$2043,$2243,$2343,$2443,$3043,$3243,$3343,$3443,$4043,$4243,$4343,$4443
dw $0044,$0244,$0344,$0444,$2044,$2244,$2344,$2444,$3044,$3244,$3344,$3444,$4044,$4244,$4344,$4444
AT1_T1
dw $0000,$0500,$0600,$0400,$5000,$5500,$5600,$5400,$6000,$6500,$6600,$6400,$4000,$4500,$4600,$4400
dw $0005,$0505,$0605,$0405,$5005,$5505,$5605,$5405,$6005,$6505,$6605,$6405,$4005,$4505,$4605,$4405
dw $0006,$0506,$0606,$0406,$5006,$5506,$5606,$5406,$6006,$6506,$6606,$6406,$4006,$4506,$4606,$4406
dw $0004,$0504,$0604,$0404,$5004,$5504,$5604,$5404,$6004,$6504,$6604,$6404,$4004,$4504,$4604,$4404
dw $0050,$0550,$0650,$0450,$5050,$5550,$5650,$5450,$6050,$6550,$6650,$6450,$4050,$4550,$4650,$4450
dw $0055,$0555,$0655,$0455,$5055,$5555,$5655,$5455,$6055,$6555,$6655,$6455,$4055,$4555,$4655,$4455
dw $0056,$0556,$0656,$0456,$5056,$5556,$5656,$5456,$6056,$6556,$6656,$6456,$4056,$4556,$4656,$4456
dw $0054,$0554,$0654,$0454,$5054,$5554,$5654,$5454,$6054,$6554,$6654,$6454,$4054,$4554,$4654,$4454
dw $0060,$0560,$0660,$0460,$5060,$5560,$5660,$5460,$6060,$6560,$6660,$6460,$4060,$4560,$4660,$4460
dw $0065,$0565,$0665,$0465,$5065,$5565,$5665,$5465,$6065,$6565,$6665,$6465,$4065,$4565,$4665,$4465
dw $0066,$0566,$0666,$0466,$5066,$5566,$5666,$5466,$6066,$6566,$6666,$6466,$4066,$4566,$4666,$4466
dw $0064,$0564,$0664,$0464,$5064,$5564,$5664,$5464,$6064,$6564,$6664,$6464,$4064,$4564,$4664,$4464
dw $0040,$0540,$0640,$0440,$5040,$5540,$5640,$5440,$6040,$6540,$6640,$6440,$4040,$4540,$4640,$4440
dw $0045,$0545,$0645,$0445,$5045,$5545,$5645,$5445,$6045,$6545,$6645,$6445,$4045,$4545,$4645,$4445
dw $0046,$0546,$0646,$0446,$5046,$5546,$5646,$5446,$6046,$6546,$6646,$6446,$4046,$4546,$4646,$4446
dw $0044,$0544,$0644,$0444,$5044,$5544,$5644,$5444,$6044,$6544,$6644,$6444,$4044,$4544,$4644,$4444
AT1_T2
dw $0000,$0700,$0800,$0400,$7000,$7700,$7800,$7400,$8000,$8700,$8800,$8400,$4000,$4700,$4800,$4400
dw $0007,$0707,$0807,$0407,$7007,$7707,$7807,$7407,$8007,$8707,$8807,$8407,$4007,$4707,$4807,$4407
dw $0008,$0708,$0808,$0408,$7008,$7708,$7808,$7408,$8008,$8708,$8808,$8408,$4008,$4708,$4808,$4408
dw $0004,$0704,$0804,$0404,$7004,$7704,$7804,$7404,$8004,$8704,$8804,$8404,$4004,$4704,$4804,$4404
dw $0070,$0770,$0870,$0470,$7070,$7770,$7870,$7470,$8070,$8770,$8870,$8470,$4070,$4770,$4870,$4470
dw $0077,$0777,$0877,$0477,$7077,$7777,$7877,$7477,$8077,$8777,$8877,$8477,$4077,$4777,$4877,$4477
dw $0078,$0778,$0878,$0478,$7078,$7778,$7878,$7478,$8078,$8778,$8878,$8478,$4078,$4778,$4878,$4478
dw $0074,$0774,$0874,$0474,$7074,$7774,$7874,$7474,$8074,$8774,$8874,$8474,$4074,$4774,$4874,$4474
dw $0080,$0780,$0880,$0480,$7080,$7780,$7880,$7480,$8080,$8780,$8880,$8480,$4080,$4780,$4880,$4480
dw $0087,$0787,$0887,$0487,$7087,$7787,$7887,$7487,$8087,$8787,$8887,$8487,$4087,$4787,$4887,$4487
dw $0088,$0788,$0888,$0488,$7088,$7788,$7888,$7488,$8088,$8788,$8888,$8488,$4088,$4788,$4888,$4488
dw $0084,$0784,$0884,$0484,$7084,$7784,$7884,$7484,$8084,$8784,$8884,$8484,$4084,$4784,$4884,$4484
dw $0040,$0740,$0840,$0440,$7040,$7740,$7840,$7440,$8040,$8740,$8840,$8440,$4040,$4740,$4840,$4440
dw $0047,$0747,$0847,$0447,$7047,$7747,$7847,$7447,$8047,$8747,$8847,$8447,$4047,$4747,$4847,$4447
dw $0048,$0748,$0848,$0448,$7048,$7748,$7848,$7448,$8048,$8748,$8848,$8448,$4048,$4748,$4848,$4448
dw $0044,$0744,$0844,$0444,$7044,$7744,$7844,$7444,$8044,$8744,$8844,$8444,$4044,$4744,$4844,$4444
AT1_T3
dw $0000,$0100,$0600,$0400,$1000,$1100,$1600,$1400,$6000,$6100,$6600,$6400,$4000,$4100,$4600,$4400
dw $0001,$0101,$0601,$0401,$1001,$1101,$1601,$1401,$6001,$6101,$6601,$6401,$4001,$4101,$4601,$4401
dw $0006,$0106,$0606,$0406,$1006,$1106,$1606,$1406,$6006,$6106,$6606,$6406,$4006,$4106,$4606,$4406
dw $0004,$0104,$0604,$0404,$1004,$1104,$1604,$1404,$6004,$6104,$6604,$6404,$4004,$4104,$4604,$4404
dw $0010,$0110,$0610,$0410,$1010,$1110,$1610,$1410,$6010,$6110,$6610,$6410,$4010,$4110,$4610,$4410
dw $0011,$0111,$0611,$0411,$1011,$1111,$1611,$1411,$6011,$6111,$6611,$6411,$4011,$4111,$4611,$4411
dw $0016,$0116,$0616,$0416,$1016,$1116,$1616,$1416,$6016,$6116,$6616,$6416,$4016,$4116,$4616,$4416
dw $0014,$0114,$0614,$0414,$1014,$1114,$1614,$1414,$6014,$6114,$6614,$6414,$4014,$4114,$4614,$4414
dw $0060,$0160,$0660,$0460,$1060,$1160,$1660,$1460,$6060,$6160,$6660,$6460,$4060,$4160,$4660,$4460
dw $0061,$0161,$0661,$0461,$1061,$1161,$1661,$1461,$6061,$6161,$6661,$6461,$4061,$4161,$4661,$4461
dw $0066,$0166,$0666,$0466,$1066,$1166,$1666,$1466,$6066,$6166,$6666,$6466,$4066,$4166,$4666,$4466
dw $0064,$0164,$0664,$0464,$1064,$1164,$1664,$1464,$6064,$6164,$6664,$6464,$4064,$4164,$4664,$4464
dw $0040,$0140,$0640,$0440,$1040,$1140,$1640,$1440,$6040,$6140,$6640,$6440,$4040,$4140,$4640,$4440
dw $0041,$0141,$0641,$0441,$1041,$1141,$1641,$1441,$6041,$6141,$6641,$6441,$4041,$4141,$4641,$4441
dw $0046,$0146,$0646,$0446,$1046,$1146,$1646,$1446,$6046,$6146,$6646,$6446,$4046,$4146,$4646,$4446
dw $0044,$0144,$0644,$0444,$1044,$1144,$1644,$1444,$6044,$6144,$6644,$6444,$4044,$4144,$4644,$4444
AT1_S0
dw $0000,$0e00,$0900,$0f00,$e000,$ee00,$e900,$ef00,$9000,$9e00,$9900,$9f00,$f000,$fe00,$f900,$ff00
dw $000e,$0e0e,$090e,$0f0e,$e00e,$ee0e,$e90e,$ef0e,$900e,$9e0e,$990e,$9f0e,$f00e,$fe0e,$f90e,$ff0e
dw $0009,$0e09,$0909,$0f09,$e009,$ee09,$e909,$ef09,$9009,$9e09,$9909,$9f09,$f009,$fe09,$f909,$ff09
dw $000f,$0e0f,$090f,$0f0f,$e00f,$ee0f,$e90f,$ef0f,$900f,$9e0f,$990f,$9f0f,$f00f,$fe0f,$f90f,$ff0f
dw $00e0,$0ee0,$09e0,$0fe0,$e0e0,$eee0,$e9e0,$efe0,$90e0,$9ee0,$99e0,$9fe0,$f0e0,$fee0,$f9e0,$ffe0
dw $00ee,$0eee,$09ee,$0fee,$e0ee,$eeee,$e9ee,$efee,$90ee,$9eee,$99ee,$9fee,$f0ee,$feee,$f9ee,$ffee
dw $00e9,$0ee9,$09e9,$0fe9,$e0e9,$eee9,$e9e9,$efe9,$90e9,$9ee9,$99e9,$9fe9,$f0e9,$fee9,$f9e9,$ffe9
dw $00ef,$0eef,$09ef,$0fef,$e0ef,$eeef,$e9ef,$efef,$90ef,$9eef,$99ef,$9fef,$f0ef,$feef,$f9ef,$ffef
dw $0090,$0e90,$0990,$0f90,$e090,$ee90,$e990,$ef90,$9090,$9e90,$9990,$9f90,$f090,$fe90,$f990,$ff90
dw $009e,$0e9e,$099e,$0f9e,$e09e,$ee9e,$e99e,$ef9e,$909e,$9e9e,$999e,$9f9e,$f09e,$fe9e,$f99e,$ff9e
dw $0099,$0e99,$0999,$0f99,$e099,$ee99,$e999,$ef99,$9099,$9e99,$9999,$9f99,$f099,$fe99,$f999,$ff99
dw $009f,$0e9f,$099f,$0f9f,$e09f,$ee9f,$e99f,$ef9f,$909f,$9e9f,$999f,$9f9f,$f09f,$fe9f,$f99f,$ff9f
dw $00f0,$0ef0,$09f0,$0ff0,$e0f0,$eef0,$e9f0,$eff0,$90f0,$9ef0,$99f0,$9ff0,$f0f0,$fef0,$f9f0,$fff0
dw $00fe,$0efe,$09fe,$0ffe,$e0fe,$eefe,$e9fe,$effe,$90fe,$9efe,$99fe,$9ffe,$f0fe,$fefe,$f9fe,$fffe
dw $00f9,$0ef9,$09f9,$0ff9,$e0f9,$eef9,$e9f9,$eff9,$90f9,$9ef9,$99f9,$9ff9,$f0f9,$fef9,$f9f9,$fff9
dw $00ff,$0eff,$09ff,$0fff,$e0ff,$eeff,$e9ff,$efff,$90ff,$9eff,$99ff,$9fff,$f0ff,$feff,$f9ff,$ffff
AT1_S1
dw $0000,$0a00,$0700,$0900,$a000,$aa00,$a700,$a900,$7000,$7a00,$7700,$7900,$9000,$9a00,$9700,$9900
dw $000a,$0a0a,$070a,$090a,$a00a,$aa0a,$a70a,$a90a,$700a,$7a0a,$770a,$790a,$900a,$9a0a,$970a,$990a
dw $0007,$0a07,$0707,$0907,$a007,$aa07,$a707,$a907,$7007,$7a07,$7707,$7907,$9007,$9a07,$9707,$9907
dw $0009,$0a09,$0709,$0909,$a009,$aa09,$a709,$a909,$7009,$7a09,$7709,$7909,$9009,$9a09,$9709,$9909
dw $00a0,$0aa0,$07a0,$09a0,$a0a0,$aaa0,$a7a0,$a9a0,$70a0,$7aa0,$77a0,$79a0,$90a0,$9aa0,$97a0,$99a0
dw $00aa,$0aaa,$07aa,$09aa,$a0aa,$aaaa,$a7aa,$a9aa,$70aa,$7aaa,$77aa,$79aa,$90aa,$9aaa,$97aa,$99aa
dw $00a7,$0aa7,$07a7,$09a7,$a0a7,$aaa7,$a7a7,$a9a7,$70a7,$7aa7,$77a7,$79a7,$90a7,$9aa7,$97a7,$99a7
dw $00a9,$0aa9,$07a9,$09a9,$a0a9,$aaa9,$a7a9,$a9a9,$70a9,$7aa9,$77a9,$79a9,$90a9,$9aa9,$97a9,$99a9
dw $0070,$0a70,$0770,$0970,$a070,$aa70,$a770,$a970,$7070,$7a70,$7770,$7970,$9070,$9a70,$9770,$9970
dw $007a,$0a7a,$077a,$097a,$a07a,$aa7a,$a77a,$a97a,$707a,$7a7a,$777a,$797a,$907a,$9a7a,$977a,$997a
dw $0077,$0a77,$0777,$0977,$a077,$aa77,$a777,$a977,$7077,$7a77,$7777,$7977,$9077,$9a77,$9777,$9977
dw $0079,$0a79,$0779,$0979,$a079,$aa79,$a779,$a979,$7079,$7a79,$7779,$7979,$9079,$9a79,$9779,$9979
dw $0090,$0a90,$0790,$0990,$a090,$aa90,$a790,$a990,$7090,$7a90,$7790,$7990,$9090,$9a90,$9790,$9990
dw $009a,$0a9a,$079a,$099a,$a09a,$aa9a,$a79a,$a99a,$709a,$7a9a,$779a,$799a,$909a,$9a9a,$979a,$999a
dw $0097,$0a97,$0797,$0997,$a097,$aa97,$a797,$a997,$7097,$7a97,$7797,$7997,$9097,$9a97,$9797,$9997
dw $0099,$0a99,$0799,$0999,$a099,$aa99,$a799,$a999,$7099,$7a99,$7799,$7999,$9099,$9a99,$9799,$9999
AT1_S2
dw $0000,$0b00,$0700,$0900,$b000,$bb00,$b700,$b900,$7000,$7b00,$7700,$7900,$9000,$9b00,$9700,$9900
dw $000b,$0b0b,$070b,$090b,$b00b,$bb0b,$b70b,$b90b,$700b,$7b0b,$770b,$790b,$900b,$9b0b,$970b,$990b
dw $0007,$0b07,$0707,$0907,$b007,$bb07,$b707,$b907,$7007,$7b07,$7707,$7907,$9007,$9b07,$9707,$9907
dw $0009,$0b09,$0709,$0909,$b009,$bb09,$b709,$b909,$7009,$7b09,$7709,$7909,$9009,$9b09,$9709,$9909
dw $00b0,$0bb0,$07b0,$09b0,$b0b0,$bbb0,$b7b0,$b9b0,$70b0,$7bb0,$77b0,$79b0,$90b0,$9bb0,$97b0,$99b0
dw $00bb,$0bbb,$07bb,$09bb,$b0bb,$bbbb,$b7bb,$b9bb,$70bb,$7bbb,$77bb,$79bb,$90bb,$9bbb,$97bb,$99bb
dw $00b7,$0bb7,$07b7,$09b7,$b0b7,$bbb7,$b7b7,$b9b7,$70b7,$7bb7,$77b7,$79b7,$90b7,$9bb7,$97b7,$99b7
dw $00b9,$0bb9,$07b9,$09b9,$b0b9,$bbb9,$b7b9,$b9b9,$70b9,$7bb9,$77b9,$79b9,$90b9,$9bb9,$97b9,$99b9
dw $0070,$0b70,$0770,$0970,$b070,$bb70,$b770,$b970,$7070,$7b70,$7770,$7970,$9070,$9b70,$9770,$9970
dw $007b,$0b7b,$077b,$097b,$b07b,$bb7b,$b77b,$b97b,$707b,$7b7b,$777b,$797b,$907b,$9b7b,$977b,$997b
dw $0077,$0b77,$0777,$0977,$b077,$bb77,$b777,$b977,$7077,$7b77,$7777,$7977,$9077,$9b77,$9777,$9977
dw $0079,$0b79,$0779,$0979,$b079,$bb79,$b779,$b979,$7079,$7b79,$7779,$7979,$9079,$9b79,$9779,$9979
dw $0090,$0b90,$0790,$0990,$b090,$bb90,$b790,$b990,$7090,$7b90,$7790,$7990,$9090,$9b90,$9790,$9990
dw $009b,$0b9b,$079b,$099b,$b09b,$bb9b,$b79b,$b99b,$709b,$7b9b,$779b,$799b,$909b,$9b9b,$979b,$999b
dw $0097,$0b97,$0797,$0997,$b097,$bb97,$b797,$b997,$7097,$7b97,$7797,$7997,$9097,$9b97,$9797,$9997
dw $0099,$0b99,$0799,$0999,$b099,$bb99,$b799,$b999,$7099,$7b99,$7799,$7999,$9099,$9b99,$9799,$9999
AT1_S3
dw $0000,$0400,$0500,$0600,$4000,$4400,$4500,$4600,$5000,$5400,$5500,$5600,$6000,$6400,$6500,$6600
dw $0004,$0404,$0504,$0604,$4004,$4404,$4504,$4604,$5004,$5404,$5504,$5604,$6004,$6404,$6504,$6604
dw $0005,$0405,$0505,$0605,$4005,$4405,$4505,$4605,$5005,$5405,$5505,$5605,$6005,$6405,$6505,$6605
dw $0006,$0406,$0506,$0606,$4006,$4406,$4506,$4606,$5006,$5406,$5506,$5606,$6006,$6406,$6506,$6606
dw $0040,$0440,$0540,$0640,$4040,$4440,$4540,$4640,$5040,$5440,$5540,$5640,$6040,$6440,$6540,$6640
dw $0044,$0444,$0544,$0644,$4044,$4444,$4544,$4644,$5044,$5444,$5544,$5644,$6044,$6444,$6544,$6644
dw $0045,$0445,$0545,$0645,$4045,$4445,$4545,$4645,$5045,$5445,$5545,$5645,$6045,$6445,$6545,$6645
dw $0046,$0446,$0546,$0646,$4046,$4446,$4546,$4646,$5046,$5446,$5546,$5646,$6046,$6446,$6546,$6646
dw $0050,$0450,$0550,$0650,$4050,$4450,$4550,$4650,$5050,$5450,$5550,$5650,$6050,$6450,$6550,$6650
dw $0054,$0454,$0554,$0654,$4054,$4454,$4554,$4654,$5054,$5454,$5554,$5654,$6054,$6454,$6554,$6654
dw $0055,$0455,$0555,$0655,$4055,$4455,$4555,$4655,$5055,$5455,$5555,$5655,$6055,$6455,$6555,$6655
dw $0056,$0456,$0556,$0656,$4056,$4456,$4556,$4656,$5056,$5456,$5556,$5656,$6056,$6456,$6556,$6656
dw $0060,$0460,$0560,$0660,$4060,$4460,$4560,$4660,$5060,$5460,$5560,$5660,$6060,$6460,$6560,$6660
dw $0064,$0464,$0564,$0664,$4064,$4464,$4564,$4664,$5064,$5464,$5564,$5664,$6064,$6464,$6564,$6664
dw $0065,$0465,$0565,$0665,$4065,$4465,$4565,$4665,$5065,$5465,$5565,$5665,$6065,$6465,$6565,$6665
dw $0066,$0466,$0566,$0666,$4066,$4466,$4566,$4666,$5066,$5466,$5566,$5666,$6066,$6466,$6566,$6666
AT2_T0
dw $0000,$0200,$0300,$0400,$2000,$2200,$2300,$2400,$3000,$3200,$3300,$3400,$4000,$4200,$4300,$4400
dw $0002,$0202,$0302,$0402,$2002,$2202,$2302,$2402,$3002,$3202,$3302,$3402,$4002,$4202,$4302,$4402
dw $0003,$0203,$0303,$0403,$2003,$2203,$2303,$2403,$3003,$3203,$3303,$3403,$4003,$4203,$4303,$4403
dw $0004,$0204,$0304,$0404,$2004,$2204,$2304,$2404,$3004,$3204,$3304,$3404,$4004,$4204,$4304,$4404
dw $0020,$0220,$0320,$0420,$2020,$2220,$2320,$2420,$3020,$3220,$3320,$3420,$4020,$4220,$4320,$4420
dw $0022,$0222,$0322,$0422,$2022,$2222,$2322,$2422,$3022,$3222,$3322,$3422,$4022,$4222,$4322,$4422
dw $0023,$0223,$0323,$0423,$2023,$2223,$2323,$2423,$3023,$3223,$3323,$3423,$4023,$4223,$4323,$4423
dw $0024,$0224,$0324,$0424,$2024,$2224,$2324,$2424,$3024,$3224,$3324,$3424,$4024,$4224,$4324,$4424
dw $0030,$0230,$0330,$0430,$2030,$2230,$2330,$2430,$3030,$3230,$3330,$3430,$4030,$4230,$4330,$4430
dw $0032,$0232,$0332,$0432,$2032,$2232,$2332,$2432,$3032,$3232,$3332,$3432,$4032,$4232,$4332,$4432
dw $0033,$0233,$0333,$0433,$2033,$2233,$2333,$2433,$3033,$3233,$3333,$3433,$4033,$4233,$4333,$4433
dw $0034,$0234,$0334,$0434,$2034,$2234,$2334,$2434,$3034,$3234,$3334,$3434,$4034,$4234,$4334,$4434
dw $0040,$0240,$0340,$0440,$2040,$2240,$2340,$2440,$3040,$3240,$3340,$3440,$4040,$4240,$4340,$4440
dw $0042,$0242,$0342,$0442,$2042,$2242,$2342,$2442,$3042,$3242,$3342,$3442,$4042,$4242,$4342,$4442
dw $0043,$0243,$0343,$0443,$2043,$2243,$2343,$2443,$3043,$3243,$3343,$3443,$4043,$4243,$4343,$4443
dw $0044,$0244,$0344,$0444,$2044,$2244,$2344,$2444,$3044,$3244,$3344,$3444,$4044,$4244,$4344,$4444
AT2_T1
dw $0000,$0500,$0600,$0000,$5000,$5500,$5600,$5000,$6000,$6500,$6600,$6000,$0000,$0500,$0600,$0000
dw $0005,$0505,$0605,$0005,$5005,$5505,$5605,$5005,$6005,$6505,$6605,$6005,$0005,$0505,$0605,$0005
dw $0006,$0506,$0606,$0006,$5006,$5506,$5606,$5006,$6006,$6506,$6606,$6006,$0006,$0506,$0606,$0006
dw $0000,$0500,$0600,$0000,$5000,$5500,$5600,$5000,$6000,$6500,$6600,$6000,$0000,$0500,$0600,$0000
dw $0050,$0550,$0650,$0050,$5050,$5550,$5650,$5050,$6050,$6550,$6650,$6050,$0050,$0550,$0650,$0050
dw $0055,$0555,$0655,$0055,$5055,$5555,$5655,$5055,$6055,$6555,$6655,$6055,$0055,$0555,$0655,$0055
dw $0056,$0556,$0656,$0056,$5056,$5556,$5656,$5056,$6056,$6556,$6656,$6056,$0056,$0556,$0656,$0056
dw $0050,$0550,$0650,$0050,$5050,$5550,$5650,$5050,$6050,$6550,$6650,$6050,$0050,$0550,$0650,$0050
dw $0060,$0560,$0660,$0060,$5060,$5560,$5660,$5060,$6060,$6560,$6660,$6060,$0060,$0560,$0660,$0060
dw $0065,$0565,$0665,$0065,$5065,$5565,$5665,$5065,$6065,$6565,$6665,$6065,$0065,$0565,$0665,$0065
dw $0066,$0566,$0666,$0066,$5066,$5566,$5666,$5066,$6066,$6566,$6666,$6066,$0066,$0566,$0666,$0066
dw $0060,$0560,$0660,$0060,$5060,$5560,$5660,$5060,$6060,$6560,$6660,$6060,$0060,$0560,$0660,$0060
dw $0000,$0500,$0600,$0000,$5000,$5500,$5600,$5000,$6000,$6500,$6600,$6000,$0000,$0500,$0600,$0000
dw $0005,$0505,$0605,$0005,$5005,$5505,$5605,$5005,$6005,$6505,$6605,$6005,$0005,$0505,$0605,$0005
dw $0006,$0506,$0606,$0006,$5006,$5506,$5606,$5006,$6006,$6506,$6606,$6006,$0006,$0506,$0606,$0006
dw $0000,$0500,$0600,$0000,$5000,$5500,$5600,$5000,$6000,$6500,$6600,$6000,$0000,$0500,$0600,$0000
AT2_T2
dw $0000,$0700,$0800,$0600,$7000,$7700,$7800,$7600,$8000,$8700,$8800,$8600,$6000,$6700,$6800,$6600
dw $0007,$0707,$0807,$0607,$7007,$7707,$7807,$7607,$8007,$8707,$8807,$8607,$6007,$6707,$6807,$6607
dw $0008,$0708,$0808,$0608,$7008,$7708,$7808,$7608,$8008,$8708,$8808,$8608,$6008,$6708,$6808,$6608
dw $0006,$0706,$0806,$0606,$7006,$7706,$7806,$7606,$8006,$8706,$8806,$8606,$6006,$6706,$6806,$6606
dw $0070,$0770,$0870,$0670,$7070,$7770,$7870,$7670,$8070,$8770,$8870,$8670,$6070,$6770,$6870,$6670
dw $0077,$0777,$0877,$0677,$7077,$7777,$7877,$7677,$8077,$8777,$8877,$8677,$6077,$6777,$6877,$6677
dw $0078,$0778,$0878,$0678,$7078,$7778,$7878,$7678,$8078,$8778,$8878,$8678,$6078,$6778,$6878,$6678
dw $0076,$0776,$0876,$0676,$7076,$7776,$7876,$7676,$8076,$8776,$8876,$8676,$6076,$6776,$6876,$6676
dw $0080,$0780,$0880,$0680,$7080,$7780,$7880,$7680,$8080,$8780,$8880,$8680,$6080,$6780,$6880,$6680
dw $0087,$0787,$0887,$0687,$7087,$7787,$7887,$7687,$8087,$8787,$8887,$8687,$6087,$6787,$6887,$6687
dw $0088,$0788,$0888,$0688,$7088,$7788,$7888,$7688,$8088,$8788,$8888,$8688,$6088,$6788,$6888,$6688
dw $0086,$0786,$0886,$0686,$7086,$7786,$7886,$7686,$8086,$8786,$8886,$8686,$6086,$6786,$6886,$6686
dw $0060,$0760,$0860,$0660,$7060,$7760,$7860,$7660,$8060,$8760,$8860,$8660,$6060,$6760,$6860,$6660
dw $0067,$0767,$0867,$0667,$7067,$7767,$7867,$7667,$8067,$8767,$8867,$8667,$6067,$6767,$6867,$6667
dw $0068,$0768,$0868,$0668,$7068,$7768,$7868,$7668,$8068,$8768,$8868,$8668,$6068,$6768,$6868,$6668
dw $0066,$0766,$0866,$0666,$7066,$7766,$7866,$7666,$8066,$8766,$8866,$8666,$6066,$6766,$6866,$6666
AT2_T3
dw $0000,$0100,$0900,$0600,$1000,$1100,$1900,$1600,$9000,$9100,$9900,$9600,$6000,$6100,$6900,$6600
dw $0001,$0101,$0901,$0601,$1001,$1101,$1901,$1601,$9001,$9101,$9901,$9601,$6001,$6101,$6901,$6601
dw $0009,$0109,$0909,$0609,$1009,$1109,$1909,$1609,$9009,$9109,$9909,$9609,$6009,$6109,$6909,$6609
dw $0006,$0106,$0906,$0606,$1006,$1106,$1906,$1606,$9006,$9106,$9906,$9606,$6006,$6106,$6906,$6606
dw $0010,$0110,$0910,$0610,$1010,$1110,$1910,$1610,$9010,$9110,$9910,$9610,$6010,$6110,$6910,$6610
dw $0011,$0111,$0911,$0611,$1011,$1111,$1911,$1611,$9011,$9111,$9911,$9611,$6011,$6111,$6911,$6611
dw $0019,$0119,$0919,$0619,$1019,$1119,$1919,$1619,$9019,$9119,$9919,$9619,$6019,$6119,$6919,$6619
dw $0016,$0116,$0916,$0616,$1016,$1116,$1916,$1616,$9016,$9116,$9916,$9616,$6016,$6116,$6916,$6616
dw $0090,$0190,$0990,$0690,$1090,$1190,$1990,$1690,$9090,$9190,$9990,$9690,$6090,$6190,$6990,$6690
dw $0091,$0191,$0991,$0691,$1091,$1191,$1991,$1691,$9091,$9191,$9991,$9691,$6091,$6191,$6991,$6691
dw $0099,$0199,$0999,$0699,$1099,$1199,$1999,$1699,$9099,$9199,$9999,$9699,$6099,$6199,$6999,$6699
dw $0096,$0196,$0996,$0696,$1096,$1196,$1996,$1696,$9096,$9196,$9996,$9696,$6096,$6196,$6996,$6696
dw $0060,$0160,$0960,$0660,$1060,$1160,$1960,$1660,$9060,$9160,$9960,$9660,$6060,$6160,$6960,$6660
dw $0061,$0161,$0961,$0661,$1061,$1161,$1961,$1661,$9061,$9161,$9961,$9661,$6061,$6161,$6961,$6661
dw $0069,$0169,$0969,$0669,$1069,$1169,$1969,$1669,$9069,$9169,$9969,$9669,$6069,$6169,$6969,$6669
dw $0066,$0166,$0966,$0666,$1066,$1166,$1966,$1666,$9066,$9166,$9966,$9666,$6066,$6166,$6966,$6666
AT2_S0
dw $0000,$0e00,$0a00,$0f00,$e000,$ee00,$ea00,$ef00,$a000,$ae00,$aa00,$af00,$f000,$fe00,$fa00,$ff00
dw $000e,$0e0e,$0a0e,$0f0e,$e00e,$ee0e,$ea0e,$ef0e,$a00e,$ae0e,$aa0e,$af0e,$f00e,$fe0e,$fa0e,$ff0e
dw $000a,$0e0a,$0a0a,$0f0a,$e00a,$ee0a,$ea0a,$ef0a,$a00a,$ae0a,$aa0a,$af0a,$f00a,$fe0a,$fa0a,$ff0a
dw $000f,$0e0f,$0a0f,$0f0f,$e00f,$ee0f,$ea0f,$ef0f,$a00f,$ae0f,$aa0f,$af0f,$f00f,$fe0f,$fa0f,$ff0f
dw $00e0,$0ee0,$0ae0,$0fe0,$e0e0,$eee0,$eae0,$efe0,$a0e0,$aee0,$aae0,$afe0,$f0e0,$fee0,$fae0,$ffe0
dw $00ee,$0eee,$0aee,$0fee,$e0ee,$eeee,$eaee,$efee,$a0ee,$aeee,$aaee,$afee,$f0ee,$feee,$faee,$ffee
dw $00ea,$0eea,$0aea,$0fea,$e0ea,$eeea,$eaea,$efea,$a0ea,$aeea,$aaea,$afea,$f0ea,$feea,$faea,$ffea
dw $00ef,$0eef,$0aef,$0fef,$e0ef,$eeef,$eaef,$efef,$a0ef,$aeef,$aaef,$afef,$f0ef,$feef,$faef,$ffef
dw $00a0,$0ea0,$0aa0,$0fa0,$e0a0,$eea0,$eaa0,$efa0,$a0a0,$aea0,$aaa0,$afa0,$f0a0,$fea0,$faa0,$ffa0
dw $00ae,$0eae,$0aae,$0fae,$e0ae,$eeae,$eaae,$efae,$a0ae,$aeae,$aaae,$afae,$f0ae,$feae,$faae,$ffae
dw $00aa,$0eaa,$0aaa,$0faa,$e0aa,$eeaa,$eaaa,$efaa,$a0aa,$aeaa,$aaaa,$afaa,$f0aa,$feaa,$faaa,$ffaa
dw $00af,$0eaf,$0aaf,$0faf,$e0af,$eeaf,$eaaf,$efaf,$a0af,$aeaf,$aaaf,$afaf,$f0af,$feaf,$faaf,$ffaf
dw $00f0,$0ef0,$0af0,$0ff0,$e0f0,$eef0,$eaf0,$eff0,$a0f0,$aef0,$aaf0,$aff0,$f0f0,$fef0,$faf0,$fff0
dw $00fe,$0efe,$0afe,$0ffe,$e0fe,$eefe,$eafe,$effe,$a0fe,$aefe,$aafe,$affe,$f0fe,$fefe,$fafe,$fffe
dw $00fa,$0efa,$0afa,$0ffa,$e0fa,$eefa,$eafa,$effa,$a0fa,$aefa,$aafa,$affa,$f0fa,$fefa,$fafa,$fffa
dw $00ff,$0eff,$0aff,$0fff,$e0ff,$eeff,$eaff,$efff,$a0ff,$aeff,$aaff,$afff,$f0ff,$feff,$faff,$ffff
AT2_S1
dw $0000,$0600,$0b00,$0900,$6000,$6600,$6b00,$6900,$b000,$b600,$bb00,$b900,$9000,$9600,$9b00,$9900
dw $0006,$0606,$0b06,$0906,$6006,$6606,$6b06,$6906,$b006,$b606,$bb06,$b906,$9006,$9606,$9b06,$9906
dw $000b,$060b,$0b0b,$090b,$600b,$660b,$6b0b,$690b,$b00b,$b60b,$bb0b,$b90b,$900b,$960b,$9b0b,$990b
dw $0009,$0609,$0b09,$0909,$6009,$6609,$6b09,$6909,$b009,$b609,$bb09,$b909,$9009,$9609,$9b09,$9909
dw $0060,$0660,$0b60,$0960,$6060,$6660,$6b60,$6960,$b060,$b660,$bb60,$b960,$9060,$9660,$9b60,$9960
dw $0066,$0666,$0b66,$0966,$6066,$6666,$6b66,$6966,$b066,$b666,$bb66,$b966,$9066,$9666,$9b66,$9966
dw $006b,$066b,$0b6b,$096b,$606b,$666b,$6b6b,$696b,$b06b,$b66b,$bb6b,$b96b,$906b,$966b,$9b6b,$996b
dw $0069,$0669,$0b69,$0969,$6069,$6669,$6b69,$6969,$b069,$b669,$bb69,$b969,$9069,$9669,$9b69,$9969
dw $00b0,$06b0,$0bb0,$09b0,$60b0,$66b0,$6bb0,$69b0,$b0b0,$b6b0,$bbb0,$b9b0,$90b0,$96b0,$9bb0,$99b0
dw $00b6,$06b6,$0bb6,$09b6,$60b6,$66b6,$6bb6,$69b6,$b0b6,$b6b6,$bbb6,$b9b6,$90b6,$96b6,$9bb6,$99b6
dw $00bb,$06bb,$0bbb,$09bb,$60bb,$66bb,$6bbb,$69bb,$b0bb,$b6bb,$bbbb,$b9bb,$90bb,$96bb,$9bbb,$99bb
dw $00b9,$06b9,$0bb9,$09b9,$60b9,$66b9,$6bb9,$69b9,$b0b9,$b6b9,$bbb9,$b9b9,$90b9,$96b9,$9bb9,$99b9
dw $0090,$0690,$0b90,$0990,$6090,$6690,$6b90,$6990,$b090,$b690,$bb90,$b990,$9090,$9690,$9b90,$9990
dw $0096,$0696,$0b96,$0996,$6096,$6696,$6b96,$6996,$b096,$b696,$bb96,$b996,$9096,$9696,$9b96,$9996
dw $009b,$069b,$0b9b,$099b,$609b,$669b,$6b9b,$699b,$b09b,$b69b,$bb9b,$b99b,$909b,$969b,$9b9b,$999b
dw $0099,$0699,$0b99,$0999,$6099,$6699,$6b99,$6999,$b099,$b699,$bb99,$b999,$9099,$9699,$9b99,$9999
AT2_S2
dw $0000,$0c00,$0700,$0a00,$c000,$cc00,$c700,$ca00,$7000,$7c00,$7700,$7a00,$a000,$ac00,$a700,$aa00
dw $000c,$0c0c,$070c,$0a0c,$c00c,$cc0c,$c70c,$ca0c,$700c,$7c0c,$770c,$7a0c,$a00c,$ac0c,$a70c,$aa0c
dw $0007,$0c07,$0707,$0a07,$c007,$cc07,$c707,$ca07,$7007,$7c07,$7707,$7a07,$a007,$ac07,$a707,$aa07
dw $000a,$0c0a,$070a,$0a0a,$c00a,$cc0a,$c70a,$ca0a,$700a,$7c0a,$770a,$7a0a,$a00a,$ac0a,$a70a,$aa0a
dw $00c0,$0cc0,$07c0,$0ac0,$c0c0,$ccc0,$c7c0,$cac0,$70c0,$7cc0,$77c0,$7ac0,$a0c0,$acc0,$a7c0,$aac0
dw $00cc,$0ccc,$07cc,$0acc,$c0cc,$cccc,$c7cc,$cacc,$70cc,$7ccc,$77cc,$7acc,$a0cc,$accc,$a7cc,$aacc
dw $00c7,$0cc7,$07c7,$0ac7,$c0c7,$ccc7,$c7c7,$cac7,$70c7,$7cc7,$77c7,$7ac7,$a0c7,$acc7,$a7c7,$aac7
dw $00ca,$0cca,$07ca,$0aca,$c0ca,$ccca,$c7ca,$caca,$70ca,$7cca,$77ca,$7aca,$a0ca,$acca,$a7ca,$aaca
dw $0070,$0c70,$0770,$0a70,$c070,$cc70,$c770,$ca70,$7070,$7c70,$7770,$7a70,$a070,$ac70,$a770,$aa70
dw $007c,$0c7c,$077c,$0a7c,$c07c,$cc7c,$c77c,$ca7c,$707c,$7c7c,$777c,$7a7c,$a07c,$ac7c,$a77c,$aa7c
dw $0077,$0c77,$0777,$0a77,$c077,$cc77,$c777,$ca77,$7077,$7c77,$7777,$7a77,$a077,$ac77,$a777,$aa77
dw $007a,$0c7a,$077a,$0a7a,$c07a,$cc7a,$c77a,$ca7a,$707a,$7c7a,$777a,$7a7a,$a07a,$ac7a,$a77a,$aa7a
dw $00a0,$0ca0,$07a0,$0aa0,$c0a0,$cca0,$c7a0,$caa0,$70a0,$7ca0,$77a0,$7aa0,$a0a0,$aca0,$a7a0,$aaa0
dw $00ac,$0cac,$07ac,$0aac,$c0ac,$ccac,$c7ac,$caac,$70ac,$7cac,$77ac,$7aac,$a0ac,$acac,$a7ac,$aaac
dw $00a7,$0ca7,$07a7,$0aa7,$c0a7,$cca7,$c7a7,$caa7,$70a7,$7ca7,$77a7,$7aa7,$a0a7,$aca7,$a7a7,$aaa7
dw $00aa,$0caa,$07aa,$0aaa,$c0aa,$ccaa,$c7aa,$caaa,$70aa,$7caa,$77aa,$7aaa,$a0aa,$acaa,$a7aa,$aaaa
AT2_S3
dw $0000,$0d00,$0500,$0600,$d000,$dd00,$d500,$d600,$5000,$5d00,$5500,$5600,$6000,$6d00,$6500,$6600
dw $000d,$0d0d,$050d,$060d,$d00d,$dd0d,$d50d,$d60d,$500d,$5d0d,$550d,$560d,$600d,$6d0d,$650d,$660d
dw $0005,$0d05,$0505,$0605,$d005,$dd05,$d505,$d605,$5005,$5d05,$5505,$5605,$6005,$6d05,$6505,$6605
dw $0006,$0d06,$0506,$0606,$d006,$dd06,$d506,$d606,$5006,$5d06,$5506,$5606,$6006,$6d06,$6506,$6606
dw $00d0,$0dd0,$05d0,$06d0,$d0d0,$ddd0,$d5d0,$d6d0,$50d0,$5dd0,$55d0,$56d0,$60d0,$6dd0,$65d0,$66d0
dw $00dd,$0ddd,$05dd,$06dd,$d0dd,$dddd,$d5dd,$d6dd,$50dd,$5ddd,$55dd,$56dd,$60dd,$6ddd,$65dd,$66dd
dw $00d5,$0dd5,$05d5,$06d5,$d0d5,$ddd5,$d5d5,$d6d5,$50d5,$5dd5,$55d5,$56d5,$60d5,$6dd5,$65d5,$66d5
dw $00d6,$0dd6,$05d6,$06d6,$d0d6,$ddd6,$d5d6,$d6d6,$50d6,$5dd6,$55d6,$56d6,$60d6,$6dd6,$65d6,$66d6
dw $0050,$0d50,$0550,$0650,$d050,$dd50,$d550,$d650,$5050,$5d50,$5550,$5650,$6050,$6d50,$6550,$6650
dw $005d,$0d5d,$055d,$065d,$d05d,$dd5d,$d55d,$d65d,$505d,$5d5d,$555d,$565d,$605d,$6d5d,$655d,$665d
dw $0055,$0d55,$0555,$0655,$d055,$dd55,$d555,$d655,$5055,$5d55,$5555,$5655,$6055,$6d55,$6555,$6655
dw $0056,$0d56,$0556,$0656,$d056,$dd56,$d556,$d656,$5056,$5d56,$5556,$5656,$6056,$6d56,$6556,$6656
dw $0060,$0d60,$0560,$0660,$d060,$dd60,$d560,$d660,$5060,$5d60,$5560,$5660,$6060,$6d60,$6560,$6660
dw $006d,$0d6d,$056d,$066d,$d06d,$dd6d,$d56d,$d66d,$506d,$5d6d,$556d,$566d,$606d,$6d6d,$656d,$666d
dw $0065,$0d65,$0565,$0665,$d065,$dd65,$d565,$d665,$5065,$5d65,$5565,$5665,$6065,$6d65,$6565,$6665
dw $0066,$0d66,$0566,$0666,$d066,$dd66,$d566,$d666,$5066,$5d66,$5566,$5666,$6066,$6d66,$6566,$6666
AT3_T0
dw $0000,$0200,$0300,$0400,$2000,$2200,$2300,$2400,$3000,$3200,$3300,$3400,$4000,$4200,$4300,$4400
dw $0002,$0202,$0302,$0402,$2002,$2202,$2302,$2402,$3002,$3202,$3302,$3402,$4002,$4202,$4302,$4402
dw $0003,$0203,$0303,$0403,$2003,$2203,$2303,$2403,$3003,$3203,$3303,$3403,$4003,$4203,$4303,$4403
dw $0004,$0204,$0304,$0404,$2004,$2204,$2304,$2404,$3004,$3204,$3304,$3404,$4004,$4204,$4304,$4404
dw $0020,$0220,$0320,$0420,$2020,$2220,$2320,$2420,$3020,$3220,$3320,$3420,$4020,$4220,$4320,$4420
dw $0022,$0222,$0322,$0422,$2022,$2222,$2322,$2422,$3022,$3222,$3322,$3422,$4022,$4222,$4322,$4422
dw $0023,$0223,$0323,$0423,$2023,$2223,$2323,$2423,$3023,$3223,$3323,$3423,$4023,$4223,$4323,$4423
dw $0024,$0224,$0324,$0424,$2024,$2224,$2324,$2424,$3024,$3224,$3324,$3424,$4024,$4224,$4324,$4424
dw $0030,$0230,$0330,$0430,$2030,$2230,$2330,$2430,$3030,$3230,$3330,$3430,$4030,$4230,$4330,$4430
dw $0032,$0232,$0332,$0432,$2032,$2232,$2332,$2432,$3032,$3232,$3332,$3432,$4032,$4232,$4332,$4432
dw $0033,$0233,$0333,$0433,$2033,$2233,$2333,$2433,$3033,$3233,$3333,$3433,$4033,$4233,$4333,$4433
dw $0034,$0234,$0334,$0434,$2034,$2234,$2334,$2434,$3034,$3234,$3334,$3434,$4034,$4234,$4334,$4434
dw $0040,$0240,$0340,$0440,$2040,$2240,$2340,$2440,$3040,$3240,$3340,$3440,$4040,$4240,$4340,$4440
dw $0042,$0242,$0342,$0442,$2042,$2242,$2342,$2442,$3042,$3242,$3342,$3442,$4042,$4242,$4342,$4442
dw $0043,$0243,$0343,$0443,$2043,$2243,$2343,$2443,$3043,$3243,$3343,$3443,$4043,$4243,$4343,$4443
dw $0044,$0244,$0344,$0444,$2044,$2244,$2344,$2444,$3044,$3244,$3344,$3444,$4044,$4244,$4344,$4444
AT3_T1
dw $0000,$0200,$0300,$0400,$2000,$2200,$2300,$2400,$3000,$3200,$3300,$3400,$4000,$4200,$4300,$4400
dw $0002,$0202,$0302,$0402,$2002,$2202,$2302,$2402,$3002,$3202,$3302,$3402,$4002,$4202,$4302,$4402
dw $0003,$0203,$0303,$0403,$2003,$2203,$2303,$2403,$3003,$3203,$3303,$3403,$4003,$4203,$4303,$4403
dw $0004,$0204,$0304,$0404,$2004,$2204,$2304,$2404,$3004,$3204,$3304,$3404,$4004,$4204,$4304,$4404
dw $0020,$0220,$0320,$0420,$2020,$2220,$2320,$2420,$3020,$3220,$3320,$3420,$4020,$4220,$4320,$4420
dw $0022,$0222,$0322,$0422,$2022,$2222,$2322,$2422,$3022,$3222,$3322,$3422,$4022,$4222,$4322,$4422
dw $0023,$0223,$0323,$0423,$2023,$2223,$2323,$2423,$3023,$3223,$3323,$3423,$4023,$4223,$4323,$4423
dw $0024,$0224,$0324,$0424,$2024,$2224,$2324,$2424,$3024,$3224,$3324,$3424,$4024,$4224,$4324,$4424
dw $0030,$0230,$0330,$0430,$2030,$2230,$2330,$2430,$3030,$3230,$3330,$3430,$4030,$4230,$4330,$4430
dw $0032,$0232,$0332,$0432,$2032,$2232,$2332,$2432,$3032,$3232,$3332,$3432,$4032,$4232,$4332,$4432
dw $0033,$0233,$0333,$0433,$2033,$2233,$2333,$2433,$3033,$3233,$3333,$3433,$4033,$4233,$4333,$4433
dw $0034,$0234,$0334,$0434,$2034,$2234,$2334,$2434,$3034,$3234,$3334,$3434,$4034,$4234,$4334,$4434
dw $0040,$0240,$0340,$0440,$2040,$2240,$2340,$2440,$3040,$3240,$3340,$3440,$4040,$4240,$4340,$4440
dw $0042,$0242,$0342,$0442,$2042,$2242,$2342,$2442,$3042,$3242,$3342,$3442,$4042,$4242,$4342,$4442
dw $0043,$0243,$0343,$0443,$2043,$2243,$2343,$2443,$3043,$3243,$3343,$3443,$4043,$4243,$4343,$4443
dw $0044,$0244,$0344,$0444,$2044,$2244,$2344,$2444,$3044,$3244,$3344,$3444,$4044,$4244,$4344,$4444
AT3_T2
dw $0000,$0200,$0500,$0400,$2000,$2200,$2500,$2400,$5000,$5200,$5500,$5400,$4000,$4200,$4500,$4400
dw $0002,$0202,$0502,$0402,$2002,$2202,$2502,$2402,$5002,$5202,$5502,$5402,$4002,$4202,$4502,$4402
dw $0005,$0205,$0505,$0405,$2005,$2205,$2505,$2405,$5005,$5205,$5505,$5405,$4005,$4205,$4505,$4405
dw $0004,$0204,$0504,$0404,$2004,$2204,$2504,$2404,$5004,$5204,$5504,$5404,$4004,$4204,$4504,$4404
dw $0020,$0220,$0520,$0420,$2020,$2220,$2520,$2420,$5020,$5220,$5520,$5420,$4020,$4220,$4520,$4420
dw $0022,$0222,$0522,$0422,$2022,$2222,$2522,$2422,$5022,$5222,$5522,$5422,$4022,$4222,$4522,$4422
dw $0025,$0225,$0525,$0425,$2025,$2225,$2525,$2425,$5025,$5225,$5525,$5425,$4025,$4225,$4525,$4425
dw $0024,$0224,$0524,$0424,$2024,$2224,$2524,$2424,$5024,$5224,$5524,$5424,$4024,$4224,$4524,$4424
dw $0050,$0250,$0550,$0450,$2050,$2250,$2550,$2450,$5050,$5250,$5550,$5450,$4050,$4250,$4550,$4450
dw $0052,$0252,$0552,$0452,$2052,$2252,$2552,$2452,$5052,$5252,$5552,$5452,$4052,$4252,$4552,$4452
dw $0055,$0255,$0555,$0455,$2055,$2255,$2555,$2455,$5055,$5255,$5555,$5455,$4055,$4255,$4555,$4455
dw $0054,$0254,$0554,$0454,$2054,$2254,$2554,$2454,$5054,$5254,$5554,$5454,$4054,$4254,$4554,$4454
dw $0040,$0240,$0540,$0440,$2040,$2240,$2540,$2440,$5040,$5240,$5540,$5440,$4040,$4240,$4540,$4440
dw $0042,$0242,$0542,$0442,$2042,$2242,$2542,$2442,$5042,$5242,$5542,$5442,$4042,$4242,$4542,$4442
dw $0045,$0245,$0545,$0445,$2045,$2245,$2545,$2445,$5045,$5245,$5545,$5445,$4045,$4245,$4545,$4445
dw $0044,$0244,$0544,$0444,$2044,$2244,$2544,$2444,$5044,$5244,$5544,$5444,$4044,$4244,$4544,$4444
AT3_T3
dw $0000,$0100,$0600,$0400,$1000,$1100,$1600,$1400,$6000,$6100,$6600,$6400,$4000,$4100,$4600,$4400
dw $0001,$0101,$0601,$0401,$1001,$1101,$1601,$1401,$6001,$6101,$6601,$6401,$4001,$4101,$4601,$4401
dw $0006,$0106,$0606,$0406,$1006,$1106,$1606,$1406,$6006,$6106,$6606,$6406,$4006,$4106,$4606,$4406
dw $0004,$0104,$0604,$0404,$1004,$1104,$1604,$1404,$6004,$6104,$6604,$6404,$4004,$4104,$4604,$4404
dw $0010,$0110,$0610,$0410,$1010,$1110,$1610,$1410,$6010,$6110,$6610,$6410,$4010,$4110,$4610,$4410
dw $0011,$0111,$0611,$0411,$1011,$1111,$1611,$1411,$6011,$6111,$6611,$6411,$4011,$4111,$4611,$4411
dw $0016,$0116,$0616,$0416,$1016,$1116,$1616,$1416,$6016,$6116,$6616,$6416,$4016,$4116,$4616,$4416
dw $0014,$0114,$0614,$0414,$1014,$1114,$1614,$1414,$6014,$6114,$6614,$6414,$4014,$4114,$4614,$4414
dw $0060,$0160,$0660,$0460,$1060,$1160,$1660,$1460,$6060,$6160,$6660,$6460,$4060,$4160,$4660,$4460
dw $0061,$0161,$0661,$0461,$1061,$1161,$1661,$1461,$6061,$6161,$6661,$6461,$4061,$4161,$4661,$4461
dw $0066,$0166,$0666,$0466,$1066,$1166,$1666,$1466,$6066,$6166,$6666,$6466,$4066,$4166,$4666,$4466
dw $0064,$0164,$0664,$0464,$1064,$1164,$1664,$1464,$6064,$6164,$6664,$6464,$4064,$4164,$4664,$4464
dw $0040,$0140,$0640,$0440,$1040,$1140,$1640,$1440,$6040,$6140,$6640,$6440,$4040,$4140,$4640,$4440
dw $0041,$0141,$0641,$0441,$1041,$1141,$1641,$1441,$6041,$6141,$6641,$6441,$4041,$4141,$4641,$4441
dw $0046,$0146,$0646,$0446,$1046,$1146,$1646,$1446,$6046,$6146,$6646,$6446,$4046,$4146,$4646,$4446
dw $0044,$0144,$0644,$0444,$1044,$1144,$1644,$1444,$6044,$6144,$6644,$6444,$4044,$4144,$4644,$4444
AT3_S0
dw $0000,$0e00,$0700,$0f00,$e000,$ee00,$e700,$ef00,$7000,$7e00,$7700,$7f00,$f000,$fe00,$f700,$ff00
dw $000e,$0e0e,$070e,$0f0e,$e00e,$ee0e,$e70e,$ef0e,$700e,$7e0e,$770e,$7f0e,$f00e,$fe0e,$f70e,$ff0e
dw $0007,$0e07,$0707,$0f07,$e007,$ee07,$e707,$ef07,$7007,$7e07,$7707,$7f07,$f007,$fe07,$f707,$ff07
dw $000f,$0e0f,$070f,$0f0f,$e00f,$ee0f,$e70f,$ef0f,$700f,$7e0f,$770f,$7f0f,$f00f,$fe0f,$f70f,$ff0f
dw $00e0,$0ee0,$07e0,$0fe0,$e0e0,$eee0,$e7e0,$efe0,$70e0,$7ee0,$77e0,$7fe0,$f0e0,$fee0,$f7e0,$ffe0
dw $00ee,$0eee,$07ee,$0fee,$e0ee,$eeee,$e7ee,$efee,$70ee,$7eee,$77ee,$7fee,$f0ee,$feee,$f7ee,$ffee
dw $00e7,$0ee7,$07e7,$0fe7,$e0e7,$eee7,$e7e7,$efe7,$70e7,$7ee7,$77e7,$7fe7,$f0e7,$fee7,$f7e7,$ffe7
dw $00ef,$0eef,$07ef,$0fef,$e0ef,$eeef,$e7ef,$efef,$70ef,$7eef,$77ef,$7fef,$f0ef,$feef,$f7ef,$ffef
dw $0070,$0e70,$0770,$0f70,$e070,$ee70,$e770,$ef70,$7070,$7e70,$7770,$7f70,$f070,$fe70,$f770,$ff70
dw $007e,$0e7e,$077e,$0f7e,$e07e,$ee7e,$e77e,$ef7e,$707e,$7e7e,$777e,$7f7e,$f07e,$fe7e,$f77e,$ff7e
dw $0077,$0e77,$0777,$0f77,$e077,$ee77,$e777,$ef77,$7077,$7e77,$7777,$7f77,$f077,$fe77,$f777,$ff77
dw $007f,$0e7f,$077f,$0f7f,$e07f,$ee7f,$e77f,$ef7f,$707f,$7e7f,$777f,$7f7f,$f07f,$fe7f,$f77f,$ff7f
dw $00f0,$0ef0,$07f0,$0ff0,$e0f0,$eef0,$e7f0,$eff0,$70f0,$7ef0,$77f0,$7ff0,$f0f0,$fef0,$f7f0,$fff0
dw $00fe,$0efe,$07fe,$0ffe,$e0fe,$eefe,$e7fe,$effe,$70fe,$7efe,$77fe,$7ffe,$f0fe,$fefe,$f7fe,$fffe
dw $00f7,$0ef7,$07f7,$0ff7,$e0f7,$eef7,$e7f7,$eff7,$70f7,$7ef7,$77f7,$7ff7,$f0f7,$fef7,$f7f7,$fff7
dw $00ff,$0eff,$07ff,$0fff,$e0ff,$eeff,$e7ff,$efff,$70ff,$7eff,$77ff,$7fff,$f0ff,$feff,$f7ff,$ffff
AT3_S1
dw $0000,$0800,$0900,$0a00,$8000,$8800,$8900,$8a00,$9000,$9800,$9900,$9a00,$a000,$a800,$a900,$aa00
dw $0008,$0808,$0908,$0a08,$8008,$8808,$8908,$8a08,$9008,$9808,$9908,$9a08,$a008,$a808,$a908,$aa08
dw $0009,$0809,$0909,$0a09,$8009,$8809,$8909,$8a09,$9009,$9809,$9909,$9a09,$a009,$a809,$a909,$aa09
dw $000a,$080a,$090a,$0a0a,$800a,$880a,$890a,$8a0a,$900a,$980a,$990a,$9a0a,$a00a,$a80a,$a90a,$aa0a
dw $0080,$0880,$0980,$0a80,$8080,$8880,$8980,$8a80,$9080,$9880,$9980,$9a80,$a080,$a880,$a980,$aa80
dw $0088,$0888,$0988,$0a88,$8088,$8888,$8988,$8a88,$9088,$9888,$9988,$9a88,$a088,$a888,$a988,$aa88
dw $0089,$0889,$0989,$0a89,$8089,$8889,$8989,$8a89,$9089,$9889,$9989,$9a89,$a089,$a889,$a989,$aa89
dw $008a,$088a,$098a,$0a8a,$808a,$888a,$898a,$8a8a,$908a,$988a,$998a,$9a8a,$a08a,$a88a,$a98a,$aa8a
dw $0090,$0890,$0990,$0a90,$8090,$8890,$8990,$8a90,$9090,$9890,$9990,$9a90,$a090,$a890,$a990,$aa90
dw $0098,$0898,$0998,$0a98,$8098,$8898,$8998,$8a98,$9098,$9898,$9998,$9a98,$a098,$a898,$a998,$aa98
dw $0099,$0899,$0999,$0a99,$8099,$8899,$8999,$8a99,$9099,$9899,$9999,$9a99,$a099,$a899,$a999,$aa99
dw $009a,$089a,$099a,$0a9a,$809a,$889a,$899a,$8a9a,$909a,$989a,$999a,$9a9a,$a09a,$a89a,$a99a,$aa9a
dw $00a0,$08a0,$09a0,$0aa0,$80a0,$88a0,$89a0,$8aa0,$90a0,$98a0,$99a0,$9aa0,$a0a0,$a8a0,$a9a0,$aaa0
dw $00a8,$08a8,$09a8,$0aa8,$80a8,$88a8,$89a8,$8aa8,$90a8,$98a8,$99a8,$9aa8,$a0a8,$a8a8,$a9a8,$aaa8
dw $00a9,$08a9,$09a9,$0aa9,$80a9,$88a9,$89a9,$8aa9,$90a9,$98a9,$99a9,$9aa9,$a0a9,$a8a9,$a9a9,$aaa9
dw $00aa,$08aa,$09aa,$0aaa,$80aa,$88aa,$89aa,$8aaa,$90aa,$98aa,$99aa,$9aaa,$a0aa,$a8aa,$a9aa,$aaaa
AT3_S2
dw $0000,$0500,$0200,$0700,$5000,$5500,$5200,$5700,$2000,$2500,$2200,$2700,$7000,$7500,$7200,$7700
dw $0005,$0505,$0205,$0705,$5005,$5505,$5205,$5705,$2005,$2505,$2205,$2705,$7005,$7505,$7205,$7705
dw $0002,$0502,$0202,$0702,$5002,$5502,$5202,$5702,$2002,$2502,$2202,$2702,$7002,$7502,$7202,$7702
dw $0007,$0507,$0207,$0707,$5007,$5507,$5207,$5707,$2007,$2507,$2207,$2707,$7007,$7507,$7207,$7707
dw $0050,$0550,$0250,$0750,$5050,$5550,$5250,$5750,$2050,$2550,$2250,$2750,$7050,$7550,$7250,$7750
dw $0055,$0555,$0255,$0755,$5055,$5555,$5255,$5755,$2055,$2555,$2255,$2755,$7055,$7555,$7255,$7755
dw $0052,$0552,$0252,$0752,$5052,$5552,$5252,$5752,$2052,$2552,$2252,$2752,$7052,$7552,$7252,$7752
dw $0057,$0557,$0257,$0757,$5057,$5557,$5257,$5757,$2057,$2557,$2257,$2757,$7057,$7557,$7257,$7757
dw $0020,$0520,$0220,$0720,$5020,$5520,$5220,$5720,$2020,$2520,$2220,$2720,$7020,$7520,$7220,$7720
dw $0025,$0525,$0225,$0725,$5025,$5525,$5225,$5725,$2025,$2525,$2225,$2725,$7025,$7525,$7225,$7725
dw $0022,$0522,$0222,$0722,$5022,$5522,$5222,$5722,$2022,$2522,$2222,$2722,$7022,$7522,$7222,$7722
dw $0027,$0527,$0227,$0727,$5027,$5527,$5227,$5727,$2027,$2527,$2227,$2727,$7027,$7527,$7227,$7727
dw $0070,$0570,$0270,$0770,$5070,$5570,$5270,$5770,$2070,$2570,$2270,$2770,$7070,$7570,$7270,$7770
dw $0075,$0575,$0275,$0775,$5075,$5575,$5275,$5775,$2075,$2575,$2275,$2775,$7075,$7575,$7275,$7775
dw $0072,$0572,$0272,$0772,$5072,$5572,$5272,$5772,$2072,$2572,$2272,$2772,$7072,$7572,$7272,$7772
dw $0077,$0577,$0277,$0777,$5077,$5577,$5277,$5777,$2077,$2577,$2277,$2777,$7077,$7577,$7277,$7777
AT3_S3
dw $0000,$0b00,$0200,$0300,$b000,$bb00,$b200,$b300,$2000,$2b00,$2200,$2300,$3000,$3b00,$3200,$3300
dw $000b,$0b0b,$020b,$030b,$b00b,$bb0b,$b20b,$b30b,$200b,$2b0b,$220b,$230b,$300b,$3b0b,$320b,$330b
dw $0002,$0b02,$0202,$0302,$b002,$bb02,$b202,$b302,$2002,$2b02,$2202,$2302,$3002,$3b02,$3202,$3302
dw $0003,$0b03,$0203,$0303,$b003,$bb03,$b203,$b303,$2003,$2b03,$2203,$2303,$3003,$3b03,$3203,$3303
dw $00b0,$0bb0,$02b0,$03b0,$b0b0,$bbb0,$b2b0,$b3b0,$20b0,$2bb0,$22b0,$23b0,$30b0,$3bb0,$32b0,$33b0
dw $00bb,$0bbb,$02bb,$03bb,$b0bb,$bbbb,$b2bb,$b3bb,$20bb,$2bbb,$22bb,$23bb,$30bb,$3bbb,$32bb,$33bb
dw $00b2,$0bb2,$02b2,$03b2,$b0b2,$bbb2,$b2b2,$b3b2,$20b2,$2bb2,$22b2,$23b2,$30b2,$3bb2,$32b2,$33b2
dw $00b3,$0bb3,$02b3,$03b3,$b0b3,$bbb3,$b2b3,$b3b3,$20b3,$2bb3,$22b3,$23b3,$30b3,$3bb3,$32b3,$33b3
dw $0020,$0b20,$0220,$0320,$b020,$bb20,$b220,$b320,$2020,$2b20,$2220,$2320,$3020,$3b20,$3220,$3320
dw $002b,$0b2b,$022b,$032b,$b02b,$bb2b,$b22b,$b32b,$202b,$2b2b,$222b,$232b,$302b,$3b2b,$322b,$332b
dw $0022,$0b22,$0222,$0322,$b022,$bb22,$b222,$b322,$2022,$2b22,$2222,$2322,$3022,$3b22,$3222,$3322
dw $0023,$0b23,$0223,$0323,$b023,$bb23,$b223,$b323,$2023,$2b23,$2223,$2323,$3023,$3b23,$3223,$3323
dw $0030,$0b30,$0230,$0330,$b030,$bb30,$b230,$b330,$2030,$2b30,$2230,$2330,$3030,$3b30,$3230,$3330
dw $003b,$0b3b,$023b,$033b,$b03b,$bb3b,$b23b,$b33b,$203b,$2b3b,$223b,$233b,$303b,$3b3b,$323b,$333b
dw $0032,$0b32,$0232,$0332,$b032,$bb32,$b232,$b332,$2032,$2b32,$2232,$2332,$3032,$3b32,$3232,$3332
dw $0033,$0b33,$0233,$0333,$b033,$bb33,$b233,$b333,$2033,$2b33,$2233,$2333,$3033,$3b33,$3233,$3333
AT0_T0
dw $0000,$0200,$0300,$0400,$2000,$2200,$2300,$2400,$3000,$3200,$3300,$3400,$4000,$4200,$4300,$4400
dw $0002,$0202,$0302,$0402,$2002,$2202,$2302,$2402,$3002,$3202,$3302,$3402,$4002,$4202,$4302,$4402
dw $0003,$0203,$0303,$0403,$2003,$2203,$2303,$2403,$3003,$3203,$3303,$3403,$4003,$4203,$4303,$4403
dw $0004,$0204,$0304,$0404,$2004,$2204,$2304,$2404,$3004,$3204,$3304,$3404,$4004,$4204,$4304,$4404
dw $0020,$0220,$0320,$0420,$2020,$2220,$2320,$2420,$3020,$3220,$3320,$3420,$4020,$4220,$4320,$4420
dw $0022,$0222,$0322,$0422,$2022,$2222,$2322,$2422,$3022,$3222,$3322,$3422,$4022,$4222,$4322,$4422
dw $0023,$0223,$0323,$0423,$2023,$2223,$2323,$2423,$3023,$3223,$3323,$3423,$4023,$4223,$4323,$4423
dw $0024,$0224,$0324,$0424,$2024,$2224,$2324,$2424,$3024,$3224,$3324,$3424,$4024,$4224,$4324,$4424
dw $0030,$0230,$0330,$0430,$2030,$2230,$2330,$2430,$3030,$3230,$3330,$3430,$4030,$4230,$4330,$4430
dw $0032,$0232,$0332,$0432,$2032,$2232,$2332,$2432,$3032,$3232,$3332,$3432,$4032,$4232,$4332,$4432
dw $0033,$0233,$0333,$0433,$2033,$2233,$2333,$2433,$3033,$3233,$3333,$3433,$4033,$4233,$4333,$4433
dw $0034,$0234,$0334,$0434,$2034,$2234,$2334,$2434,$3034,$3234,$3334,$3434,$4034,$4234,$4334,$4434
dw $0040,$0240,$0340,$0440,$2040,$2240,$2340,$2440,$3040,$3240,$3340,$3440,$4040,$4240,$4340,$4440
dw $0042,$0242,$0342,$0442,$2042,$2242,$2342,$2442,$3042,$3242,$3342,$3442,$4042,$4242,$4342,$4442
dw $0043,$0243,$0343,$0443,$2043,$2243,$2343,$2443,$3043,$3243,$3343,$3443,$4043,$4243,$4343,$4443
dw $0044,$0244,$0344,$0444,$2044,$2244,$2344,$2444,$3044,$3244,$3344,$3444,$4044,$4244,$4344,$4444
AT0_T1
dw $0000,$0500,$0600,$0700,$5000,$5500,$5600,$5700,$6000,$6500,$6600,$6700,$7000,$7500,$7600,$7700
dw $0005,$0505,$0605,$0705,$5005,$5505,$5605,$5705,$6005,$6505,$6605,$6705,$7005,$7505,$7605,$7705
dw $0006,$0506,$0606,$0706,$5006,$5506,$5606,$5706,$6006,$6506,$6606,$6706,$7006,$7506,$7606,$7706
dw $0007,$0507,$0607,$0707,$5007,$5507,$5607,$5707,$6007,$6507,$6607,$6707,$7007,$7507,$7607,$7707
dw $0050,$0550,$0650,$0750,$5050,$5550,$5650,$5750,$6050,$6550,$6650,$6750,$7050,$7550,$7650,$7750
dw $0055,$0555,$0655,$0755,$5055,$5555,$5655,$5755,$6055,$6555,$6655,$6755,$7055,$7555,$7655,$7755
dw $0056,$0556,$0656,$0756,$5056,$5556,$5656,$5756,$6056,$6556,$6656,$6756,$7056,$7556,$7656,$7756
dw $0057,$0557,$0657,$0757,$5057,$5557,$5657,$5757,$6057,$6557,$6657,$6757,$7057,$7557,$7657,$7757
dw $0060,$0560,$0660,$0760,$5060,$5560,$5660,$5760,$6060,$6560,$6660,$6760,$7060,$7560,$7660,$7760
dw $0065,$0565,$0665,$0765,$5065,$5565,$5665,$5765,$6065,$6565,$6665,$6765,$7065,$7565,$7665,$7765
dw $0066,$0566,$0666,$0766,$5066,$5566,$5666,$5766,$6066,$6566,$6666,$6766,$7066,$7566,$7666,$7766
dw $0067,$0567,$0667,$0767,$5067,$5567,$5667,$5767,$6067,$6567,$6667,$6767,$7067,$7567,$7667,$7767
dw $0070,$0570,$0670,$0770,$5070,$5570,$5670,$5770,$6070,$6570,$6670,$6770,$7070,$7570,$7670,$7770
dw $0075,$0575,$0675,$0775,$5075,$5575,$5675,$5775,$6075,$6575,$6675,$6775,$7075,$7575,$7675,$7775
dw $0076,$0576,$0676,$0776,$5076,$5576,$5676,$5776,$6076,$6576,$6676,$6776,$7076,$7576,$7676,$7776
dw $0077,$0577,$0677,$0777,$5077,$5577,$5677,$5777,$6077,$6577,$6677,$6777,$7077,$7577,$7677,$7777
AT0_T2
dw $0000,$0800,$0900,$0700,$8000,$8800,$8900,$8700,$9000,$9800,$9900,$9700,$7000,$7800,$7900,$7700
dw $0008,$0808,$0908,$0708,$8008,$8808,$8908,$8708,$9008,$9808,$9908,$9708,$7008,$7808,$7908,$7708
dw $0009,$0809,$0909,$0709,$8009,$8809,$8909,$8709,$9009,$9809,$9909,$9709,$7009,$7809,$7909,$7709
dw $0007,$0807,$0907,$0707,$8007,$8807,$8907,$8707,$9007,$9807,$9907,$9707,$7007,$7807,$7907,$7707
dw $0080,$0880,$0980,$0780,$8080,$8880,$8980,$8780,$9080,$9880,$9980,$9780,$7080,$7880,$7980,$7780
dw $0088,$0888,$0988,$0788,$8088,$8888,$8988,$8788,$9088,$9888,$9988,$9788,$7088,$7888,$7988,$7788
dw $0089,$0889,$0989,$0789,$8089,$8889,$8989,$8789,$9089,$9889,$9989,$9789,$7089,$7889,$7989,$7789
dw $0087,$0887,$0987,$0787,$8087,$8887,$8987,$8787,$9087,$9887,$9987,$9787,$7087,$7887,$7987,$7787
dw $0090,$0890,$0990,$0790,$8090,$8890,$8990,$8790,$9090,$9890,$9990,$9790,$7090,$7890,$7990,$7790
dw $0098,$0898,$0998,$0798,$8098,$8898,$8998,$8798,$9098,$9898,$9998,$9798,$7098,$7898,$7998,$7798
dw $0099,$0899,$0999,$0799,$8099,$8899,$8999,$8799,$9099,$9899,$9999,$9799,$7099,$7899,$7999,$7799
dw $0097,$0897,$0997,$0797,$8097,$8897,$8997,$8797,$9097,$9897,$9997,$9797,$7097,$7897,$7997,$7797
dw $0070,$0870,$0970,$0770,$8070,$8870,$8970,$8770,$9070,$9870,$9970,$9770,$7070,$7870,$7970,$7770
dw $0078,$0878,$0978,$0778,$8078,$8878,$8978,$8778,$9078,$9878,$9978,$9778,$7078,$7878,$7978,$7778
dw $0079,$0879,$0979,$0779,$8079,$8879,$8979,$8779,$9079,$9879,$9979,$9779,$7079,$7879,$7979,$7779
dw $0077,$0877,$0977,$0777,$8077,$8877,$8977,$8777,$9077,$9877,$9977,$9777,$7077,$7877,$7977,$7777
AT0_T3
dw $0000,$0100,$0900,$0700,$1000,$1100,$1900,$1700,$9000,$9100,$9900,$9700,$7000,$7100,$7900,$7700
dw $0001,$0101,$0901,$0701,$1001,$1101,$1901,$1701,$9001,$9101,$9901,$9701,$7001,$7101,$7901,$7701
dw $0009,$0109,$0909,$0709,$1009,$1109,$1909,$1709,$9009,$9109,$9909,$9709,$7009,$7109,$7909,$7709
dw $0007,$0107,$0907,$0707,$1007,$1107,$1907,$1707,$9007,$9107,$9907,$9707,$7007,$7107,$7907,$7707
dw $0010,$0110,$0910,$0710,$1010,$1110,$1910,$1710,$9010,$9110,$9910,$9710,$7010,$7110,$7910,$7710
dw $0011,$0111,$0911,$0711,$1011,$1111,$1911,$1711,$9011,$9111,$9911,$9711,$7011,$7111,$7911,$7711
dw $0019,$0119,$0919,$0719,$1019,$1119,$1919,$1719,$9019,$9119,$9919,$9719,$7019,$7119,$7919,$7719
dw $0017,$0117,$0917,$0717,$1017,$1117,$1917,$1717,$9017,$9117,$9917,$9717,$7017,$7117,$7917,$7717
dw $0090,$0190,$0990,$0790,$1090,$1190,$1990,$1790,$9090,$9190,$9990,$9790,$7090,$7190,$7990,$7790
dw $0091,$0191,$0991,$0791,$1091,$1191,$1991,$1791,$9091,$9191,$9991,$9791,$7091,$7191,$7991,$7791
dw $0099,$0199,$0999,$0799,$1099,$1199,$1999,$1799,$9099,$9199,$9999,$9799,$7099,$7199,$7999,$7799
dw $0097,$0197,$0997,$0797,$1097,$1197,$1997,$1797,$9097,$9197,$9997,$9797,$7097,$7197,$7997,$7797
dw $0070,$0170,$0970,$0770,$1070,$1170,$1970,$1770,$9070,$9170,$9970,$9770,$7070,$7170,$7970,$7770
dw $0071,$0171,$0971,$0771,$1071,$1171,$1971,$1771,$9071,$9171,$9971,$9771,$7071,$7171,$7971,$7771
dw $0079,$0179,$0979,$0779,$1079,$1179,$1979,$1779,$9079,$9179,$9979,$9779,$7079,$7179,$7979,$7779
dw $0077,$0177,$0977,$0777,$1077,$1177,$1977,$1777,$9077,$9177,$9977,$9777,$7077,$7177,$7977,$7777
AT0_S0
dw $0000,$0e00,$0a00,$0f00,$e000,$ee00,$ea00,$ef00,$a000,$ae00,$aa00,$af00,$f000,$fe00,$fa00,$ff00
dw $000e,$0e0e,$0a0e,$0f0e,$e00e,$ee0e,$ea0e,$ef0e,$a00e,$ae0e,$aa0e,$af0e,$f00e,$fe0e,$fa0e,$ff0e
dw $000a,$0e0a,$0a0a,$0f0a,$e00a,$ee0a,$ea0a,$ef0a,$a00a,$ae0a,$aa0a,$af0a,$f00a,$fe0a,$fa0a,$ff0a
dw $000f,$0e0f,$0a0f,$0f0f,$e00f,$ee0f,$ea0f,$ef0f,$a00f,$ae0f,$aa0f,$af0f,$f00f,$fe0f,$fa0f,$ff0f
dw $00e0,$0ee0,$0ae0,$0fe0,$e0e0,$eee0,$eae0,$efe0,$a0e0,$aee0,$aae0,$afe0,$f0e0,$fee0,$fae0,$ffe0
dw $00ee,$0eee,$0aee,$0fee,$e0ee,$eeee,$eaee,$efee,$a0ee,$aeee,$aaee,$afee,$f0ee,$feee,$faee,$ffee
dw $00ea,$0eea,$0aea,$0fea,$e0ea,$eeea,$eaea,$efea,$a0ea,$aeea,$aaea,$afea,$f0ea,$feea,$faea,$ffea
dw $00ef,$0eef,$0aef,$0fef,$e0ef,$eeef,$eaef,$efef,$a0ef,$aeef,$aaef,$afef,$f0ef,$feef,$faef,$ffef
dw $00a0,$0ea0,$0aa0,$0fa0,$e0a0,$eea0,$eaa0,$efa0,$a0a0,$aea0,$aaa0,$afa0,$f0a0,$fea0,$faa0,$ffa0
dw $00ae,$0eae,$0aae,$0fae,$e0ae,$eeae,$eaae,$efae,$a0ae,$aeae,$aaae,$afae,$f0ae,$feae,$faae,$ffae
dw $00aa,$0eaa,$0aaa,$0faa,$e0aa,$eeaa,$eaaa,$efaa,$a0aa,$aeaa,$aaaa,$afaa,$f0aa,$feaa,$faaa,$ffaa
dw $00af,$0eaf,$0aaf,$0faf,$e0af,$eeaf,$eaaf,$efaf,$a0af,$aeaf,$aaaf,$afaf,$f0af,$feaf,$faaf,$ffaf
dw $00f0,$0ef0,$0af0,$0ff0,$e0f0,$eef0,$eaf0,$eff0,$a0f0,$aef0,$aaf0,$aff0,$f0f0,$fef0,$faf0,$fff0
dw $00fe,$0efe,$0afe,$0ffe,$e0fe,$eefe,$eafe,$effe,$a0fe,$aefe,$aafe,$affe,$f0fe,$fefe,$fafe,$fffe
dw $00fa,$0efa,$0afa,$0ffa,$e0fa,$eefa,$eafa,$effa,$a0fa,$aefa,$aafa,$affa,$f0fa,$fefa,$fafa,$fffa
dw $00ff,$0eff,$0aff,$0fff,$e0ff,$eeff,$eaff,$efff,$a0ff,$aeff,$aaff,$afff,$f0ff,$feff,$faff,$ffff
AT0_S1
dw $0000,$0b00,$0800,$0a00,$b000,$bb00,$b800,$ba00,$8000,$8b00,$8800,$8a00,$a000,$ab00,$a800,$aa00
dw $000b,$0b0b,$080b,$0a0b,$b00b,$bb0b,$b80b,$ba0b,$800b,$8b0b,$880b,$8a0b,$a00b,$ab0b,$a80b,$aa0b
dw $0008,$0b08,$0808,$0a08,$b008,$bb08,$b808,$ba08,$8008,$8b08,$8808,$8a08,$a008,$ab08,$a808,$aa08
dw $000a,$0b0a,$080a,$0a0a,$b00a,$bb0a,$b80a,$ba0a,$800a,$8b0a,$880a,$8a0a,$a00a,$ab0a,$a80a,$aa0a
dw $00b0,$0bb0,$08b0,$0ab0,$b0b0,$bbb0,$b8b0,$bab0,$80b0,$8bb0,$88b0,$8ab0,$a0b0,$abb0,$a8b0,$aab0
dw $00bb,$0bbb,$08bb,$0abb,$b0bb,$bbbb,$b8bb,$babb,$80bb,$8bbb,$88bb,$8abb,$a0bb,$abbb,$a8bb,$aabb
dw $00b8,$0bb8,$08b8,$0ab8,$b0b8,$bbb8,$b8b8,$bab8,$80b8,$8bb8,$88b8,$8ab8,$a0b8,$abb8,$a8b8,$aab8
dw $00ba,$0bba,$08ba,$0aba,$b0ba,$bbba,$b8ba,$baba,$80ba,$8bba,$88ba,$8aba,$a0ba,$abba,$a8ba,$aaba
dw $0080,$0b80,$0880,$0a80,$b080,$bb80,$b880,$ba80,$8080,$8b80,$8880,$8a80,$a080,$ab80,$a880,$aa80
dw $008b,$0b8b,$088b,$0a8b,$b08b,$bb8b,$b88b,$ba8b,$808b,$8b8b,$888b,$8a8b,$a08b,$ab8b,$a88b,$aa8b
dw $0088,$0b88,$0888,$0a88,$b088,$bb88,$b888,$ba88,$8088,$8b88,$8888,$8a88,$a088,$ab88,$a888,$aa88
dw $008a,$0b8a,$088a,$0a8a,$b08a,$bb8a,$b88a,$ba8a,$808a,$8b8a,$888a,$8a8a,$a08a,$ab8a,$a88a,$aa8a
dw $00a0,$0ba0,$08a0,$0aa0,$b0a0,$bba0,$b8a0,$baa0,$80a0,$8ba0,$88a0,$8aa0,$a0a0,$aba0,$a8a0,$aaa0
dw $00ab,$0bab,$08ab,$0aab,$b0ab,$bbab,$b8ab,$baab,$80ab,$8bab,$88ab,$8aab,$a0ab,$abab,$a8ab,$aaab
dw $00a8,$0ba8,$08a8,$0aa8,$b0a8,$bba8,$b8a8,$baa8,$80a8,$8ba8,$88a8,$8aa8,$a0a8,$aba8,$a8a8,$aaa8
dw $00aa,$0baa,$08aa,$0aaa,$b0aa,$bbaa,$b8aa,$baaa,$80aa,$8baa,$88aa,$8aaa,$a0aa,$abaa,$a8aa,$aaaa
AT0_S2
dw $0000,$0c00,$0800,$0a00,$c000,$cc00,$c800,$ca00,$8000,$8c00,$8800,$8a00,$a000,$ac00,$a800,$aa00
dw $000c,$0c0c,$080c,$0a0c,$c00c,$cc0c,$c80c,$ca0c,$800c,$8c0c,$880c,$8a0c,$a00c,$ac0c,$a80c,$aa0c
dw $0008,$0c08,$0808,$0a08,$c008,$cc08,$c808,$ca08,$8008,$8c08,$8808,$8a08,$a008,$ac08,$a808,$aa08
dw $000a,$0c0a,$080a,$0a0a,$c00a,$cc0a,$c80a,$ca0a,$800a,$8c0a,$880a,$8a0a,$a00a,$ac0a,$a80a,$aa0a
dw $00c0,$0cc0,$08c0,$0ac0,$c0c0,$ccc0,$c8c0,$cac0,$80c0,$8cc0,$88c0,$8ac0,$a0c0,$acc0,$a8c0,$aac0
dw $00cc,$0ccc,$08cc,$0acc,$c0cc,$cccc,$c8cc,$cacc,$80cc,$8ccc,$88cc,$8acc,$a0cc,$accc,$a8cc,$aacc
dw $00c8,$0cc8,$08c8,$0ac8,$c0c8,$ccc8,$c8c8,$cac8,$80c8,$8cc8,$88c8,$8ac8,$a0c8,$acc8,$a8c8,$aac8
dw $00ca,$0cca,$08ca,$0aca,$c0ca,$ccca,$c8ca,$caca,$80ca,$8cca,$88ca,$8aca,$a0ca,$acca,$a8ca,$aaca
dw $0080,$0c80,$0880,$0a80,$c080,$cc80,$c880,$ca80,$8080,$8c80,$8880,$8a80,$a080,$ac80,$a880,$aa80
dw $008c,$0c8c,$088c,$0a8c,$c08c,$cc8c,$c88c,$ca8c,$808c,$8c8c,$888c,$8a8c,$a08c,$ac8c,$a88c,$aa8c
dw $0088,$0c88,$0888,$0a88,$c088,$cc88,$c888,$ca88,$8088,$8c88,$8888,$8a88,$a088,$ac88,$a888,$aa88
dw $008a,$0c8a,$088a,$0a8a,$c08a,$cc8a,$c88a,$ca8a,$808a,$8c8a,$888a,$8a8a,$a08a,$ac8a,$a88a,$aa8a
dw $00a0,$0ca0,$08a0,$0aa0,$c0a0,$cca0,$c8a0,$caa0,$80a0,$8ca0,$88a0,$8aa0,$a0a0,$aca0,$a8a0,$aaa0
dw $00ac,$0cac,$08ac,$0aac,$c0ac,$ccac,$c8ac,$caac,$80ac,$8cac,$88ac,$8aac,$a0ac,$acac,$a8ac,$aaac
dw $00a8,$0ca8,$08a8,$0aa8,$c0a8,$cca8,$c8a8,$caa8,$80a8,$8ca8,$88a8,$8aa8,$a0a8,$aca8,$a8a8,$aaa8
dw $00aa,$0caa,$08aa,$0aaa,$c0aa,$ccaa,$c8aa,$caaa,$80aa,$8caa,$88aa,$8aaa,$a0aa,$acaa,$a8aa,$aaaa
AT0_S3
dw $0000,$0700,$0800,$0b00,$7000,$7700,$7800,$7b00,$8000,$8700,$8800,$8b00,$b000,$b700,$b800,$bb00
dw $0007,$0707,$0807,$0b07,$7007,$7707,$7807,$7b07,$8007,$8707,$8807,$8b07,$b007,$b707,$b807,$bb07
dw $0008,$0708,$0808,$0b08,$7008,$7708,$7808,$7b08,$8008,$8708,$8808,$8b08,$b008,$b708,$b808,$bb08
dw $000b,$070b,$080b,$0b0b,$700b,$770b,$780b,$7b0b,$800b,$870b,$880b,$8b0b,$b00b,$b70b,$b80b,$bb0b
dw $0070,$0770,$0870,$0b70,$7070,$7770,$7870,$7b70,$8070,$8770,$8870,$8b70,$b070,$b770,$b870,$bb70
dw $0077,$0777,$0877,$0b77,$7077,$7777,$7877,$7b77,$8077,$8777,$8877,$8b77,$b077,$b777,$b877,$bb77
dw $0078,$0778,$0878,$0b78,$7078,$7778,$7878,$7b78,$8078,$8778,$8878,$8b78,$b078,$b778,$b878,$bb78
dw $007b,$077b,$087b,$0b7b,$707b,$777b,$787b,$7b7b,$807b,$877b,$887b,$8b7b,$b07b,$b77b,$b87b,$bb7b
dw $0080,$0780,$0880,$0b80,$7080,$7780,$7880,$7b80,$8080,$8780,$8880,$8b80,$b080,$b780,$b880,$bb80
dw $0087,$0787,$0887,$0b87,$7087,$7787,$7887,$7b87,$8087,$8787,$8887,$8b87,$b087,$b787,$b887,$bb87
dw $0088,$0788,$0888,$0b88,$7088,$7788,$7888,$7b88,$8088,$8788,$8888,$8b88,$b088,$b788,$b888,$bb88
dw $008b,$078b,$088b,$0b8b,$708b,$778b,$788b,$7b8b,$808b,$878b,$888b,$8b8b,$b08b,$b78b,$b88b,$bb8b
dw $00b0,$07b0,$08b0,$0bb0,$70b0,$77b0,$78b0,$7bb0,$80b0,$87b0,$88b0,$8bb0,$b0b0,$b7b0,$b8b0,$bbb0
dw $00b7,$07b7,$08b7,$0bb7,$70b7,$77b7,$78b7,$7bb7,$80b7,$87b7,$88b7,$8bb7,$b0b7,$b7b7,$b8b7,$bbb7
dw $00b8,$07b8,$08b8,$0bb8,$70b8,$77b8,$78b8,$7bb8,$80b8,$87b8,$88b8,$8bb8,$b0b8,$b7b8,$b8b8,$bbb8
dw $00bb,$07bb,$08bb,$0bbb,$70bb,$77bb,$78bb,$7bbb,$80bb,$87bb,$88bb,$8bbb,$b0bb,$b7bb,$b8bb,$bbbb

166
demos/smb/palette.s Normal file
View File

@ -0,0 +1,166 @@
; NES Palette (52 entries)
nesPalette
dw $0888
dw $004A
dw $001B
dw $0409
dw $0A06
dw $0C02
dw $0C10
dw $0910
dw $0630
dw $0140
dw $0050
dw $0043
dw $0046
dw $0000
dw $0111
dw $0111
dw $0CCC
dw $007F
dw $025F
dw $083F
dw $0F3B
dw $0F35
dw $0F20
dw $0D30
dw $0C60
dw $0380
dw $0190
dw $0095
dw $00AD
dw $0222
dw $0111
dw $0111
dw $0FFF
dw $01DF
dw $07AF
dw $0D8F
dw $0F4F
dw $0F69
dw $0F93
dw $0F91
dw $0FC2
dw $0AE1
dw $03F3
dw $01FA
dw $00FF
dw $0666
dw $0111
dw $0111
dw $0FFF
dw $0AFF
dw $0BEF
dw $0DAF
dw $0FBF
dw $0FAB
dw $0FDB
dw $0FEA
dw $0FF9
dw $0DE9
dw $0AEB
dw $0AFD
dw $09FF
dw $0EEE
dw $0111
dw $0111
; Swizzle tables based on AreaType
;
; IIgs palette index 0 is always the background color: 'BBB'
; IIgs palette index 0 is always the color cycling color 'RRR'
;
; The rest are remapped.
;
; Underground (AreaType = $02)
;
; T0: $0F $29 $1A $09
; T1: --- $3C $1C $0F
; T2: --- $30 $21 $1C
; T3: --- RRR $17 $1C
; S0: --- --- $27 --- --> $37 $27 $16
; S1: --- $1C $36 $17
; S2: --- $16 $30 $27
; S3: --- $1D $3C $1C --> $0F RR $29 $1A $09 $3C $1C $30 $21 $17 $27 $36 $16 $1D $16 $18: 0 free colors
; --> $00 $01 $02 $03 $04 $05 $06 $07 $08 $09 $0A $0B $0C $0D $0E $0F
;
; Mapped palettes
;
; T0: 0 2 3 4
; T1: 0 5 6 0
; T2: 0 7 8 6
; T3: 0 1 9 6
; S0: 0 E A F
; S1: 0 6 B 9
; S2: 0 C 7 A
; S3: 0 D 5 6
;
; Above Ground (AreaType = $01)
;
; T0: $22 $29 $1A $0F
; T1: --- $36 $17 $0F
; T2: --- $30 $21 $0F
; T3: --- RRR $17 $0F
; S0: --- $16 $27 $18 --> $37 $27 $16
; S1: --- $1A $30 $27
; S2: --- $16 $30 $27 $16 $18
; S3: --- $0F $36 $17 --> $22 RR $29 $1A $0F $36 $17 $30 $21 $27 $1A $16 --- --- SS1 SS2 : 2 free colors
; --> $00 $01 $02 $03 $04 $05 $06 $07 $08 $09 $0A $0B $0C $0D $0E $0F
; Mapped palettes
;
; T0: 0 2 3 4
; T1: 0 5 6 4
; T2: 0 7 8 4
; T3: 0 1 6 4
; S0: 0 E 9 F
; S1: 0 A 7 9
; S2: 0 B 7 9
; S3: 0 4 5 6
;
; Castle (AreaType = $00)
; Bowser changes S1 palette when he loads
;
; T0: $0F $30 $10 $00
; T1: --- $30 $10 $00
; T2: --- $30 $16 $00
; T3: --- RRR $17 $00
; S0: --- SS1 $27 SS2
; S1: --- $1C $36 $17
; S2: --- $16 $30 $27 $16 $18
; S3: --- $1D $30 $10 --> $0F RR $30 $10 $00 $16 $17 $27 $1C $36 $17 $1D --- --- SS1 SS2 : 2 free colors
; --> $00 $01 $02 $03 $04 $05 $06 $07 $08 $09 $0A $0B $0C $0D $0E $0F
; Mapped palettes
;
; T0: 0 2 3 4
; T1: 0 2 3 4
; T2: 0 2 5 4
; T3: 0 1 6 4
; S0: 0 E 7 F
; S1: 0 8 9 A
; S2: 0 5 2 7
; S3: 0 B 2 3
;
; Water
;
; T0: BBB $15 $12 $25
; T1: --- $3A $1A $0F
; T2: --- $30 $12 $0F
; T3: --- RRR $12 $0F
; S0: --- SS1 $27 SS2
; S1: --- $10 $30 $27
; S2: --- $16 $30 $27
; S3: --- $0F $30 $10 --> BBB RRR $15 $12 $25 $3A $1A $0F $30 $12 $27 $10 $16 --- SS1 SS2 : 1 free colors
; --> $00 $01 $02 $03 $04 $05 $06 $07 $08 $09 $0A $0B $0C $0D $0E $0F
; Mapped palettes
;
; T0: 0 2 3 4
; T1: 0 5 6 7
; T2: 0 8 9 7
; T3: 0 1 9 7
; S0: 0 E A F
; S1: 0 B 8 A
; S2: 0 C 8 A
; S3: 0 7 8 B

1611
demos/smb/ppu.s Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

17029
demos/smb/rom2.s Normal file

File diff suppressed because it is too large Load Diff

54
demos/smb/swizzle.js Normal file
View File

@ -0,0 +1,54 @@
// Generate seizzle tables
//
// Maps an 8-bit value of wwxxyyzz to a lookup table that takes each 2-bit
// value to a 16-bit pixel index. Zero always maps to zero. The input
// is three 4-bit values that define the targets for 1, 2, and 3.
// Run as: node swizzle.js label val1 val2 val3
if (process.argv.length !== 6) {
console.log(process.argv);
process.exit(1);
}
const output = process.stdout;
const values = [
0,
Number(process.argv[3]),
Number(process.argv[4]),
Number(process.argv[5]),
];
output.write(process.argv[2] + '\n');
for (let w = 0; w < 4; w++) {
for (let x = 0; x < 4; x++) {
output.write(' dw ');
const row = [];
for (let y = 0; y < 4; y++) {
for (let z = 0; z < 4; z++) {
// Because the NES PPU bits define the pixel order from high bit to low bit, but the
// 65816 is little endian, we need to swap the byte order in the mapping
/*
const target =
(values[w] * 4096) +
(values[x] * 256) +
(values[y] * 16) +
values[z];
*/
const target =
(values[w] * 16) +
(values[x] * 1) +
(values[y] * 4096) +
(values[z] * 256);
row.push(target);
}
}
// Output the values
output.write(row.map(s => '$' + s.toString(16).padStart(4, '0')).join(','));
// Line break
output.write('\n');
}
}

View File

@ -1,34 +1,35 @@
source "https://rubygems.org"
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
# gem "jekyll", "~> 4.2.2"
gem "github-pages", "~> 203", group: :jekyll_plugins
# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "minima", "~> 2.5"
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
# gem "github-pages", group: :jekyll_plugins
# If you have any plugins, put them here!
group :jekyll_plugins do
gem "jekyll-feed", "~> 0.12"
end
# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library.
platforms :mingw, :x64_mingw, :mswin, :jruby do
gem "tzinfo", "~> 1.2"
gem "tzinfo-data"
end
# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]
# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem
# do not have a Java counterpart.
gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]
source "https://rubygems.org"
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
#gem "jekyll", "~> 4.3.2"
gem "github-pages", "~> 223", group: :jekyll_plugins
# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "minima", "~> 2.5"
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
# gem "github-pages", group: :jekyll_plugins
# If you have any plugins, put them here!
group :jekyll_plugins do
gem "jekyll-feed", "~> 0.12"
end
# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library.
platforms :mingw, :x64_mingw, :mswin, :jruby do
gem "tzinfo", "~> 1.2"
gem "tzinfo-data"
end
# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]
# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem
# do not have a Java counterpart.
gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]

View File

@ -7,8 +7,8 @@ GEM
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2, >= 2.2.2)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
addressable (2.8.4)
public_suffix (>= 2.0.2, < 6.0)
coffee-script (2.4.1)
coffee-script-source
execjs
@ -16,107 +16,88 @@ GEM
colorator (1.1.0)
commonmarker (0.17.13)
ruby-enum (~> 0.5)
concurrent-ruby (1.2.0)
dnsruby (1.61.9)
simpleidn (~> 0.1)
concurrent-ruby (1.2.2)
dnsruby (1.70.0)
simpleidn (~> 0.2.1)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
ethon (0.15.0)
ethon (0.16.0)
ffi (>= 1.15.0)
eventmachine (1.2.7)
eventmachine (1.2.7-x64-mingw32)
execjs (2.8.1)
faraday (1.10.0)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
faraday-httpclient (~> 1.0)
faraday-multipart (~> 1.0)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.0)
faraday-patron (~> 1.0)
faraday-rack (~> 1.0)
faraday-retry (~> 1.0)
faraday (2.7.4)
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
faraday-em_http (1.0.0)
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
faraday-multipart (1.0.4)
multipart-post (~> 2)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
faraday-retry (1.0.3)
faraday-net_http (3.0.2)
ffi (1.15.5)
ffi (1.15.5-x64-mingw32)
forwardable-extended (2.6.0)
gemoji (3.0.1)
github-pages (203)
github-pages-health-check (= 1.16.1)
jekyll (= 3.8.5)
github-pages (223)
github-pages-health-check (= 1.17.9)
jekyll (= 3.9.0)
jekyll-avatar (= 0.7.0)
jekyll-coffeescript (= 1.1.1)
jekyll-commonmark-ghpages (= 0.1.6)
jekyll-default-layout (= 0.1.4)
jekyll-feed (= 0.13.0)
jekyll-feed (= 0.15.1)
jekyll-gist (= 1.5.0)
jekyll-github-metadata (= 2.12.1)
jekyll-mentions (= 1.5.1)
jekyll-github-metadata (= 2.13.0)
jekyll-include-cache (= 0.2.1)
jekyll-mentions (= 1.6.0)
jekyll-optional-front-matter (= 0.3.2)
jekyll-paginate (= 1.1.0)
jekyll-readme-index (= 0.3.0)
jekyll-redirect-from (= 0.15.0)
jekyll-redirect-from (= 0.16.0)
jekyll-relative-links (= 0.6.1)
jekyll-remote-theme (= 0.4.1)
jekyll-remote-theme (= 0.4.3)
jekyll-sass-converter (= 1.5.2)
jekyll-seo-tag (= 2.6.1)
jekyll-seo-tag (= 2.7.1)
jekyll-sitemap (= 1.4.0)
jekyll-swiss (= 1.0.0)
jekyll-theme-architect (= 0.1.1)
jekyll-theme-cayman (= 0.1.1)
jekyll-theme-dinky (= 0.1.1)
jekyll-theme-hacker (= 0.1.1)
jekyll-theme-leap-day (= 0.1.1)
jekyll-theme-merlot (= 0.1.1)
jekyll-theme-midnight (= 0.1.1)
jekyll-theme-minimal (= 0.1.1)
jekyll-theme-modernist (= 0.1.1)
jekyll-theme-primer (= 0.5.4)
jekyll-theme-slate (= 0.1.1)
jekyll-theme-tactile (= 0.1.1)
jekyll-theme-time-machine (= 0.1.1)
jekyll-theme-architect (= 0.2.0)
jekyll-theme-cayman (= 0.2.0)
jekyll-theme-dinky (= 0.2.0)
jekyll-theme-hacker (= 0.2.0)
jekyll-theme-leap-day (= 0.2.0)
jekyll-theme-merlot (= 0.2.0)
jekyll-theme-midnight (= 0.2.0)
jekyll-theme-minimal (= 0.2.0)
jekyll-theme-modernist (= 0.2.0)
jekyll-theme-primer (= 0.6.0)
jekyll-theme-slate (= 0.2.0)
jekyll-theme-tactile (= 0.2.0)
jekyll-theme-time-machine (= 0.2.0)
jekyll-titles-from-headings (= 0.5.3)
jemoji (= 0.11.1)
kramdown (= 1.17.0)
jemoji (= 0.12.0)
kramdown (= 2.3.1)
kramdown-parser-gfm (= 1.1.0)
liquid (= 4.0.3)
mercenary (~> 0.3)
minima (= 2.5.1)
nokogiri (>= 1.10.4, < 2.0)
rouge (= 3.13.0)
nokogiri (>= 1.12.5, < 2.0)
rouge (= 3.26.0)
terminal-table (~> 1.4)
github-pages-health-check (1.16.1)
github-pages-health-check (1.17.9)
addressable (~> 2.3)
dnsruby (~> 1.60)
octokit (~> 4.0)
public_suffix (~> 3.0)
public_suffix (>= 3.0, < 5.0)
typhoeus (~> 1.3)
html-pipeline (2.14.1)
html-pipeline (2.14.3)
activesupport (>= 2)
nokogiri (>= 1.4)
http_parser.rb (0.8.0)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
jekyll (3.8.5)
jekyll (3.9.0)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 0.7)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 2.0)
kramdown (~> 1.14)
kramdown (>= 1.17, < 3)
liquid (~> 4.0)
mercenary (~> 0.3.3)
pathutil (~> 0.9)
@ -136,14 +117,16 @@ GEM
rouge (>= 2.0, < 4.0)
jekyll-default-layout (0.1.4)
jekyll (~> 3.0)
jekyll-feed (0.13.0)
jekyll-feed (0.15.1)
jekyll (>= 3.7, < 5.0)
jekyll-gist (1.5.0)
octokit (~> 4.2)
jekyll-github-metadata (2.12.1)
jekyll (~> 3.4)
jekyll-github-metadata (2.13.0)
jekyll (>= 3.4, < 5.0)
octokit (~> 4.0, != 4.4.0)
jekyll-mentions (1.5.1)
jekyll-include-cache (0.2.1)
jekyll (>= 3.7, < 5.0)
jekyll-mentions (1.6.0)
html-pipeline (~> 2.3)
jekyll (>= 3.7, < 5.0)
jekyll-optional-front-matter (0.3.2)
@ -151,96 +134,99 @@ GEM
jekyll-paginate (1.1.0)
jekyll-readme-index (0.3.0)
jekyll (>= 3.0, < 5.0)
jekyll-redirect-from (0.15.0)
jekyll-redirect-from (0.16.0)
jekyll (>= 3.3, < 5.0)
jekyll-relative-links (0.6.1)
jekyll (>= 3.3, < 5.0)
jekyll-remote-theme (0.4.1)
jekyll-remote-theme (0.4.3)
addressable (~> 2.0)
jekyll (>= 3.5, < 5.0)
rubyzip (>= 1.3.0)
jekyll-sass-converter (>= 1.0, <= 3.0.0, != 2.0.0)
rubyzip (>= 1.3.0, < 3.0)
jekyll-sass-converter (1.5.2)
sass (~> 3.4)
jekyll-seo-tag (2.6.1)
jekyll (>= 3.3, < 5.0)
jekyll-seo-tag (2.7.1)
jekyll (>= 3.8, < 5.0)
jekyll-sitemap (1.4.0)
jekyll (>= 3.7, < 5.0)
jekyll-swiss (1.0.0)
jekyll-theme-architect (0.1.1)
jekyll (~> 3.5)
jekyll-theme-architect (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-cayman (0.1.1)
jekyll (~> 3.5)
jekyll-theme-cayman (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-dinky (0.1.1)
jekyll (~> 3.5)
jekyll-theme-dinky (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-hacker (0.1.1)
jekyll (~> 3.5)
jekyll-theme-hacker (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-leap-day (0.1.1)
jekyll (~> 3.5)
jekyll-theme-leap-day (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-merlot (0.1.1)
jekyll (~> 3.5)
jekyll-theme-merlot (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-midnight (0.1.1)
jekyll (~> 3.5)
jekyll-theme-midnight (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-minimal (0.1.1)
jekyll (~> 3.5)
jekyll-theme-minimal (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-modernist (0.1.1)
jekyll (~> 3.5)
jekyll-theme-modernist (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-primer (0.5.4)
jekyll-theme-primer (0.6.0)
jekyll (> 3.5, < 5.0)
jekyll-github-metadata (~> 2.9)
jekyll-seo-tag (~> 2.0)
jekyll-theme-slate (0.1.1)
jekyll (~> 3.5)
jekyll-theme-slate (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-tactile (0.1.1)
jekyll (~> 3.5)
jekyll-theme-tactile (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-theme-time-machine (0.1.1)
jekyll (~> 3.5)
jekyll-theme-time-machine (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-titles-from-headings (0.5.3)
jekyll (>= 3.3, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
jemoji (0.11.1)
jemoji (0.12.0)
gemoji (~> 3.0)
html-pipeline (~> 2.2)
jekyll (>= 3.0, < 5.0)
kramdown (1.17.0)
kramdown (2.3.1)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.3)
listen (3.7.1)
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.3.6)
mini_portile2 (2.8.1)
minima (2.5.1)
jekyll (>= 3.5, < 5.0)
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
minitest (5.17.0)
multipart-post (2.2.0)
nokogiri (1.14.2-x64-mingw32)
minitest (5.18.0)
nokogiri (1.14.3-x86_64-linux)
racc (~> 1.4)
nokogiri (1.14.2-x86_64-linux)
racc (~> 1.4)
octokit (4.24.0)
octokit (4.25.1)
faraday (>= 1, < 3)
sawyer (~> 0.9)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (3.1.1)
public_suffix (4.0.7)
racc (1.6.2)
rb-fsevent (0.11.1)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rouge (3.13.0)
rexml (3.2.5)
rouge (3.26.0)
ruby-enum (0.9.0)
i18n
ruby2_keywords (0.0.5)
@ -261,24 +247,19 @@ GEM
thread_safe (0.3.6)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (1.2.10)
tzinfo (1.2.11)
thread_safe (~> 0.1)
tzinfo-data (1.2022.1)
tzinfo (>= 1.0.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.8.2)
unf_ext (0.0.8.2-x64-mingw32)
unicode-display_width (1.8.0)
wdm (0.1.1)
zeitwerk (2.6.6)
zeitwerk (2.6.7)
PLATFORMS
x64-mingw32
x86_64-linux
DEPENDENCIES
github-pages (~> 203)
github-pages (~> 223)
http_parser.rb (~> 0.6.0)
jekyll-feed (~> 0.12)
minima (~> 2.5)
@ -287,4 +268,4 @@ DEPENDENCIES
wdm (~> 0.1.1)
BUNDLED WITH
2.3.15
2.4.12

View File

@ -30,8 +30,12 @@ github_username: lscharen
# Build settings
theme: minima
plugins:
- jekyll-feed
#plugins:
# - jekyll-feed
markdown: kramdown
highlighter: rogue
input: GFM
# Exclude from processing.
# The following items will not be processed, by default.

View File

@ -3,15 +3,4 @@ layout: page
title: About
---
This is the base Jekyll theme. You can find out more info about customizing your Jekyll theme, as well as basic Jekyll usage documentation at [jekyllrb.com](https://jekyllrb.com/)
You can find the source code for Minima at GitHub:
[jekyll][jekyll-organization] /
[minima](https://github.com/jekyll/minima)
You can find the source code for Jekyll at GitHub:
[jekyll][jekyll-organization] /
[jekyll](https://github.com/jekyll/jekyll)
[jekyll-organization]: https://github.com/jekyll
This is the main documentation page for the Generic Tile Engine project for the Apple IIgs.

View File

@ -0,0 +1,110 @@
---
permalink: /getting-started
layout: page
---
# Getting Started
* Set Up
* Windows
* Linux
* Native
This tutorial page will walk through the process of setting up your computer to build Apple IIgs applications
that leverage the GTE toolset.
## Set Up
### Windows
### Linux
### Native
If you are developing directly on an Apple IIgs machine, dowload the GTE-1.0.shk archive into your GS/OS environment. There
are several ways of getting the file onto your system.
1. Use the [NetDisk](https://sheumann.github.io/NetDisk/) utility to mount to the remote disk image directly from GS/OS and copy the Tool160 file
1. Use [ADTPro](https://adtpro.com/index.html) to transfer the disk image to the apple IIgs and write it onto a physical floppy disk
## Installing GTE
Copy the `Tool160` file into the `System:Tools` folder of your GS/OS boot volume. It is also possible to load the toolset from the application's folder (or any file system location), which will be covered later.
## Your First Program
```c
#include <loader.h>
#include <locator.h>
#include <memory.h>
#include <misctool.h>
#include <gte.h>
/* create two solid tiles */
extern Byte tiles[] = { STATIC_TILE(0x00), STATIC_TILE(0xFF) };
/* define a couple of key codes for the arrow keys */
#define LEFT_ARROW 0x08
#define RIGHT_ARROW 0x15
#define UP_ARROW 0x0B
#define DOWN_ARROW 0x0A
Word userId;
Handle dpHandle;
void startUp(void) {
TLStartUp();
userId = MMStartUp();
MTStartUp();
LoadOneTool(160, 0x0100);
dpHandle = NewHandle(0x200L, userId, attrBank + attrPage + attrFixed + attrLocked + attrNoCross, 0);
GTEStartUp((Word) *dpHandle, (Word) 0, userId);
}
void shutDown(void) {
GTEShutDown();
DisposeHandle(dpHandle);
UnloadOneTool(160);
MTShutDown();
MMShutDown(userId);
TLShutDown();
}
void main(void) {
Word keyPress;
int x, y;
/* Start up GTE and its dependencies */
startUp();
/* Create a 256x160 playfield (128 bytes x 160 lines) */
GTESetScreenMode(128, 160);
/* Load in two tiles */
GTELoadTileSet(0, 2, tiles);
/* Fill the tile store with a checkerboard pattern */
for (y = 0; y < GTE_TILE_STORE_HEIGHT; y++) {
for (x = 0; x < GTE_TILE_STORE_WIDTH; x++) {
GTESetTile(x, y, (x + y) & 1);
}
}
/* Enter into the main loop */
x = y = 0;
do {
keyPress = GTEReadControl() & PAD_KEY_CODE;
if (keyPress == LEFT_ARROW && x > 0) x--;
if (keyPress == RIGHT_ARROW && x < 1000) x++;
if (keyPress == UP_ARROW && y > 0) y--;
if (keyPress == DOWN_ARROW && y < 1000) y++;
/* Position the screen and render */
GTESetBG0Origin(x, y);
GTERender(0);
}
while (keyPress != 'Q' && keyPress != 'q');
shutDown();
}
```

View File

@ -4,3 +4,5 @@
layout: home
---
* [Getting Started]({{ site.baseurl }}/getting-started.html)

17
docs/live.markdown Normal file
View File

@ -0,0 +1,17 @@
---
layout: page
---
<script>
var emulator = new Emulator(document.querySelector("#canvas"),
null,
new MAMELoader(MAMELoader.driver("1943"),
MAMELoader.nativeResolution(224, 256),
MAMELoader.scale(3),
MAMELoader.emulatorJS("emulators/mess1943.js"),
MAMELoader.mountFile("1943.zip",
MAMELoader.fetchFile("Game File",
"examples/1943.zip"))))
emulator.start({ waitAfterDownloading: true });
</script>
<canvas id="canvas" width="800" height="600"></canvas>

View File

@ -0,0 +1,118 @@
---
layout: page
style: sample
---
```c
#include <loader.h>
#include <locator.h>
#include <memory.h>
#include <misctool.h>
#include <types.h>
#include "gte.h"
#include "demo_data.h"
#define TOOLFAIL(string) if (toolerror()) SysFailMgr(toolerror(), "\p" string "\n\r Error Code -> $");
#define SPRITE_START_TILE 2
#define SPRITE_SLOT 0
#define SPRITE_VBUFF (GTE_VBUFF_SPRITE_START+0*GTE_VBUFF_SPRITE_STEP)
int main (void) {
Word controlMask;
Word keyPress;
Word userId;
Handle dpHndl;
Word dpWord;
Word x = 0, y = 0;
Word px = 0, py = 0;
Word sec;
TLStartUp();
TOOLFAIL("Unable to start tool locator");
userId = MMStartUp();
TOOLFAIL("Unable to start memory manager");
MTStartUp();
TOOLFAIL("Unable to start misc tools");
LoadGTEToolSet(userId);
dpHndl = NewHandle(0x0200, userId, 0x4015, 0);
if (dpHndl == NULL) {
TOOLFAIL("Unable to allocate page 0 memory");
}
dpWord = (Word)(*dpHndl);
if ((dpWord & 0x00FF) != 0x0000) {
TOOLFAIL("Allocated page 0 memory is not aligned");
}
GTEStartUp(dpWord, 0x0000, userId);
TOOLFAIL("Unable to start GTE");
GTESetScreenMode(160, 200);
GTELoadTileSet(tiles);
GTESetPalette(0, (Pointer)palette);
GTEFillTileStore(1);
GTECreateSpriteStamp(GTE_SPRITE_8X8 | SPRITE_START_TILE, SPRITE_VBUFF);
GTEAddSprite(SPRITE_SLOT, 0, SPRITE_VBUFF, px, py);
do {
controlMask = GTEReadControl();
keyPress = controlMask & 0x007F;
switch (keyPress) {
case ' ': // Toggle background
sec = GTEGetSeconds();
GTEFillTileStore(1 + (sec & 1));
break;
case 'a': if (x > 0) { x--; }
break;
case 'd': if (x < 1000) { x++; }
break;
case 'w': if (y > 0) { y--; }
break;
case 's': if (y < 1000) { y++; }
break;
case 'j': if (px > 0) { px--; }
break;
case 'l': if (px < 154) { px++; }
break;
case 'i': if (py > 0) { py--; }
break;
case 'k': if (py < 192) { py++; }
break;
}
GTESetBG0Origin(x, y);
GTEMoveSprite(SPRITE_SLOT, px, py);
GTERender(0);
} while (keyPress != 'q' && keyPress != 'Q');
GTEShutDown();
DisposeHandle(dpHndl);
MTShutDown();
TOOLFAIL("Unable to shutdown misc tool");
MMShutDown(userId);
TOOLFAIL("Unable to shutdown memory manager");
TLShutDown();
TOOLFAIL("Unable to shutdown tool locator");
}
```

5
docs/tutorials.markdown Normal file
View File

@ -0,0 +1,5 @@
---
layout: page
title: Examples
---

View File

@ -138,6 +138,12 @@ _GTESetAddress MAC
_GTEUpdateOverlay MAC
UserTool $2F00+GTEToolNum
<<<
_GTEEnableSprites MAC
UserTool $3000+GTEToolNum
<<<
_GTEEnableBackground MAC
UserTool $3100+GTEToolNum
<<<
; EngineMode definitions
; Script definition
@ -175,9 +181,16 @@ OVERLAY_SOLID equ $8000 ; Overlay covers the scan line and is fu
OVERLAY_ABOVE equ $0000 ; Overlay is drawn above scanline sprites
OVERLAY_BELOW equ $4000 ; Overlay is drawn below scanline sprites
; GetAddress table IDs
; GetAddress IDs
scanlineHorzOffset equ $0001
scanlineHorzOffset2 equ $0002
tileStore equ $0003
vblCallback equ $0004
extSpriteRenderer equ $0005
rawDrawTile equ $0006
extBG0TileUpdate equ $0007
userTileCallback equ $0008
liteBlitter equ $0009
; CopyPicToBG1 flags
COPY_PIC_NORMAL equ $0000 ; Copy into BG1 buffer in "normal mode"

View File

@ -18,7 +18,8 @@
"test": "npm run build && build-image.bat %npm_package_config_cadius% && %npm_package_config_gsport%",
"build": "%npm_package_config_merlin32% -V %npm_package_config_macros% ./src/Master.s",
"build:debug": "%npm_package_config_merlin32% -V %npm_package_config_macros% ./src/Debug.s",
"debug": "%npm_package_config_crossrunner% ./src/Debug160 -Source ./src/Debug160_S02__Output.txt -Debug -CompatibilityLayer"
"debug": "%npm_package_config_crossrunner% ./src/Debug160 -Source ./src/Debug160_S02__Output.txt -Debug -CompatibilityLayer",
"install:header": "copy .\\ORCACDefs\\gte.h C:\\ProgramData\\GoldenGate\\Libraries\\ORCACDefs\\gte.h"
},
"repository": {
"type": "git",

View File

@ -166,8 +166,14 @@ OneSecHandler mx %11
; This is OK, it's referenced by a long address
VBLTASK hex 00000000
dw 0
TaskCnt dw 1
hex 5AA5
VblTaskCode mx %11
lda #1
stal TaskCnt ; Reset the task count
_VblTaskPatch jml _TaskStub ; Just something to catch the interrupt
_TaskStub rtl
mx %00
; Reset the engine to a known state
; Blitter initialization
@ -212,8 +218,9 @@ EngineReset
stz TileMapHeight
stz TileMapPtr
stz TileMapPtr+2
stz FringeMapPtr
stz FringeMapPtr+2
; stz FringeMapPtr
; stz FringeMapPtr+2
stz GTEControlBits
stz BG1TileMapWidth
stz BG1TileMapHeight
@ -231,11 +238,25 @@ EngineReset
stz OneSecondCounter
; Fill in the state register values
sep #$20
ldal STATE_REG
and #$CF ; R0W0
sta STATE_REG_OFF ; Put this value in to return to "normal" blitter
ora #$10 ; R0W1
sta STATE_REG_BLIT ; Running the blitter, this is the mode to put us into
rep #$20
lda EngineMode
bit #ENGINE_MODE_TWO_LAYER+ENGINE_MODE_DYN_TILES
beq :lite
lda #13
sta tmp15
stz tmp14
; Rebuild all of the bank blitters
; Rebuild all of the bank blitters if not in fast mode
:loop
ldx #BlitBuff
lda #^BlitBuff
@ -249,16 +270,31 @@ EngineReset
dec tmp15
bne :loop
bra :done
; Set the scanline tables to reasonable default values
; ldx #{416*2}-2
; lda #0
;:sxm_loop
; sta StartXMod164Arr,x
; dex
; dex
; bpl :sxm_loop
; Insert jumps to the interrupt enable code every 16 lines
:lite
lda #12
sta tmp15
ldx #_EXIT_EVEN+{_LINE_SIZE*15}+1 ; Patch the JMP operand here
ldy #_LINE_BASE+_ENTRY_INT+{_LINE_SIZE*16} ; Jump to this address on the next line
:lloop
tya
stal lite_base,x
clc
adc #{_LINE_SIZE*16}
tay
txa
clc
adc #{_LINE_SIZE*16}
tax
dec tmp15
bne :lloop
:done
rts

View File

@ -76,7 +76,8 @@ OldBG1TileOriginY equ 68
TileMapWidth equ 70 ; Pointer to memory holding the tile map for the primary background
TileMapHeight equ 72
TileMapPtr equ 74
FringeMapPtr equ 78
; FringeMapPtr equ 78
GTEControlBits equ 78 ; Enable / disable things
BG1TileMapWidth equ 82
BG1TileMapHeight equ 84
@ -104,6 +105,9 @@ BG1Scaling equ 126
activeSpriteList equ 128 ; 32 bytes for the active sprite list (can persist across frames)
; Free space from 160 to 192
STATE_REG_OFF equ 160
STATE_REG_BLIT equ 161
STK_SAVE equ 162 ; Only used by the lite renderer
blttmp equ 192 ; 32 bytes of local cache/scratch space for blitter
@ -160,6 +164,14 @@ DP2_TILEDATA_AND_TILESTORE_BANKS equ 164
DP2_SPRITEDATA_AND_TILESTORE_BANKS equ 166
DP2_TILEDATA_AND_SPRITEDATA_BANKS equ 168
DP2_BANK01_AND_TILESTORE_BANKS equ 170
DP2_TILEDATA_AND_BANK01_BANKS equ 172
; Tile record passed to user-defined tile callback
USER_TILE_RECORD equ 178
USER_TILE_ID equ 178 ; copy of the tile id in the tile store
USER_TILE_CODE_PTR equ 180 ; pointer to the code bank in which to patch
USER_TILE_ADDR equ 184 ; address in the tile data bank
USER_FREE_SPACE equ 186 ; a few bytes of scratch space
SPRITE_VBUFF_PTR equ 224 ; 32 bytes of adjusted pointers to VBuffArray addresses
; End direct page values
@ -192,6 +204,12 @@ DIRTY_BIT_SPRITE_ARRAY equ $0040
scanlineHorzOffset equ $0001 ; Table of 416 words, a double-array of scanline offset values. Values must be in range [0, 163]
scanlineHorzOffset2 equ $0002 ; Table of 416 words, a double-array of scanline offset values. Values must be in range [0, 163]
tileStore equ $0003
vblCallback equ $0004 ; User routine to be called by VBL interrupt. Set to $000000 to disconnect
extSpriteRenderer equ $0005
rawDrawTile equ $0006
extBG0TileUpdate equ $0007
userTileCallback equ $0008
liteBlitter equ $0009
; CopyPicToBG1 flags
COPY_PIC_NORMAL equ $0000 ; Copy into BG1 buffer in "normal mode" treating the buffer as a 164x208 pixmap with stride of 256
@ -211,6 +229,10 @@ PAD_BUTTON_B equ $0100
PAD_BUTTON_A equ $0200
PAD_KEY_DOWN equ $0400
; GTE Control Bits
CTRL_SPRITE_DISABLE equ $0001
CTRL_BKGND_DISABLE equ $0002
; Tile constants
TILE_DAMAGED_BIT equ $8000 ; Mark a tile as damaged (internal only)
TILE_PRIORITY_BIT equ $4000 ; Put tile on top of sprite (unimplemented)
@ -306,6 +328,21 @@ ObjectList EXT
StartXMod164Tbl EXT
LastOffsetTbl EXT
BG1StartXMod164Tbl EXT
ExtSpriteRenderer EXT
ExtUpdateBG0Tiles EXT
; Tool error codes
NO_TIMERS_AVAILABLE equ 10
; Offsets for the Lite blitter
_ENTRY_1 equ 0
_ENTRY_JMP equ 4
_ENTRY_ODD equ 11
_ENTRY_INT equ 14
_LOOP equ 38
_EXIT_ODD equ 290
_EXIT_EVEN equ 293
_LOW_SAVE equ 296
_LINE_BASE equ 4 ; header size
_LINE_SIZE equ 298 ; number of bytes for each blitter line

View File

@ -12,41 +12,47 @@
; 64KB Tile Memory
ASM static/TileData.s
KND #$1001 ; Type and Attributes ($10=Static,$01=Data)
KND #$1101 ; Type and Attributes ($10=Static,$01=Data)
ALI BANK
SNA TDATA
; 64KB Sprite Plane Data
ASM static/SprData.s
KND #$1001 ; Type and Attributes ($11=Static+Bank Relative,$01=Data)
KND #$1101 ; Type and Attributes ($11=Static+Bank Relative,$01=Data)
ALI BANK
SNA SDATA
; 64KB Sprite Mask Data
ASM static/SprMask.s
KND #$1001 ; Type and Attributes ($11=Static+Bank Relative,$01=Data)
KND #$1101 ; Type and Attributes ($11=Static+Bank Relative,$01=Data)
ALI BANK
SNA SMASK
; 64KB Tile Store
ASM static/TileStore.s
KND #$1001 ; Type and Attributes ($11=Static+Bank Relative,$01=Data)
KND #$1101 ; Type and Attributes ($11=Static+Bank Relative,$01=Data)
ALI BANK
SNA TSTORE
; 64KB Rotation Data Tables
ASM RotData.s
KND #$1001 ; Type and Attributes ($11=Static+Bank Relative,$01=Data)
KND #$1101 ; Type and Attributes ($11=Static+Bank Relative,$01=Data)
ALI BANK
SNA ROTDATA
; GTE "Lite" blitter. One bank of static code, no relocation needed.
ASM blitter/TemplateLite.s
ALI BANK
SNA BLTLITE
; Additional code
; ASM FastCopies.s
; KND #$1001 ; Type and Attributes ($11=Static+Bank Relative,$01=Data)
; KND #$1101 ; Type and Attributes ($11=Static+Bank Relative,$01=Data)
; ALI BANK
; SNA FASTCPY

View File

@ -74,6 +74,15 @@ InitMemory lda EngineMode
sta CompileBank
stz CompileBank0
; If ENGINE_MODE_TWO_LAYER and ENGINE_MODE_DYN_TILES are turned off, then
; we are in "GTE lite" mode and use a blitter template that only requires
; one bank of memory
lda EngineMode
bit #ENGINE_MODE_DYN_TILES+ENGINE_MODE_TWO_LAYER
bne InitFullBlitter
brl InitLiteBlitter
InitFullBlitter
; Allocate the 13 banks of memory we need and store in double-length array
]step equ 0
lup 13
@ -155,6 +164,70 @@ InitMemory lda EngineMode
:exit
rts
InitLiteBlitter
lite_base EXT
; Overwrite the Col2CodeOffset tables. This array needs to hold the offset from the start of the line (BTableLow),
; to each of the PEA words *in logical order*. This means the actual addresses are reversed.
lda #_LOOP
sta Col2CodeOffset-2
ldx #0
lda #_LOOP+{81*PER_TILE_SIZE}
sta Col2CodeOffset+{4*82} ; Store a copy one off the end
:loop0 sta Col2CodeOffset,x
sta Col2CodeOffset+{2*82},x
sec
sbc #PER_TILE_SIZE
inx
inx
cpx #82*2
bcc :loop0
; Fill in the BTable and BRowTable values
ldx #0
ldy #lite_base
:loop1
tya
sta BTableLow,x
sta BTableLow+{208*2},x
clc
adc #_LINE_SIZE
tay
lda #^lite_base
sta BTableHigh,x
sta BTableHigh+{208*2},x
inx
inx
cpx #208*2
bcc :loop1
ldx #0
ldy #lite_base
:loop2
lda BTableHigh ; This is the same value for the lite blitter
sta BRowTableHigh,x
sta BRowTableHigh+{26*2},x
tya
sta BRowTableLow,x
sta BRowTableLow+{26*2},x
clc
adc #{8*_LINE_SIZE}
tay
inx
inx
cpx #26*2
bcc :loop2
rts
; Bank allocator (for one full, fixed bank of memory. Can be immediately deferenced)
AllocOneBank PushLong #0

View File

@ -60,7 +60,7 @@ _Render
jsr _ApplyTiles ; This function actually draws the new tiles into the code field
jsr _ApplyBG0XPos ; Patch the code field instructions with exit BRA opcode
jsr _ApplyBG0XPos ; Patch the code field instructions with exit BRA opcode
lda #RENDER_BG1_ROTATION
bit RenderFlags
@ -153,6 +153,138 @@ _DoOverlay
:disp jsl $000000
rts
; Callback structure with pointers to internal rendering functions
ExtFuncBlock
adrl BltRange
adrl PEISlam
; Special NES renderer that externalizes the sprite rendering in order to exceed the internal limit of 16 sprites
_RenderNES
; jsr _ApplyBG0YPos
; jsr _ApplyBG0XPosPre
jsr _ApplyBG0YPosLite
jsr _ApplyBG0XPosPre
; Callback to update the tilestore with any new tiles
lda ExtUpdateBG0Tiles
ora ExtUpdateBG0Tiles+2
beq :no_tile
lda ExtUpdateBG0Tiles
stal :patch0+1
lda ExtUpdateBG0Tiles+1
stal :patch0+2
:patch0 jsl $000000
:no_tile
jsr _ApplyTiles ; This function actually draws the new tiles into the code field
stz tmp1 ; virt_line_x2
lda #16*2
sta tmp2 ; lines_left_x2
lda #0 ; Xmod164
; jsr _ApplyBG0XPosAlt
jsr _ApplyBG0XPosAltLite
lda tmp4 ; :exit_offset
stal nesTopOffset
lda #16*2
sta tmp1 ; virt_line_x2
lda ScreenHeight
sec
sbc #16
asl
sta tmp2 ; lines_left_x2
lda StartXMod164 ; Xmod164
; jsr _ApplyBG0XPosAlt
jsr _ApplyBG0XPosAltLite
lda tmp4
stal nesBottomOffset
; This is a tricky part. The NES does not keep sprites sorted, so we need an alternative way to figure out
; which lines to shadow and which ones not to. Our compromise is to build a bitmap of lines that the sprite
; occupy and then scan through that quickly.
;
; This is handled by the callback in two phases. We pass pointers to the internal function the callback needs
; access to. If there is no function defined, do nothing
lda GTEControlBits
bit #CTRL_SPRITE_DISABLE
bne :no_render
lda ExtSpriteRenderer
ora ExtSpriteRenderer+2
beq :no_render
lda ExtSpriteRenderer
stal :patch1+1
stal :patch2+1
lda ExtSpriteRenderer+1
stal :patch1+2
stal :patch2+2
; Start the two-phase rendering process. First turn off shading and invoke the callback to
; draw sprite regions
jsr _ShadowOff
lda #0 ; Signal we're in phase 1 (shadowing off)
ldx #^ExtFuncBlock
ldy #ExtFuncBlock
:patch1 jsl $000000
; Now perform the second phase which renders the whole screen and exposes the sprites that were
; drawins in the first phase
jsr _ShadowOn
lda #1 ; Signal we're in phase 2 (shadowing on)
ldx #^ExtFuncBlock
ldy #ExtFuncBlock
:patch2 jsl $000000
:no_render
stz tmp1 ; :virt_line_x2
lda #16*2
sta tmp2 ; :lines_left_x2
ldal nesTopOffset
sta tmp4 ; :exit_offset
; jsr _RestoreBG0OpcodesAlt
jsr _RestoreBG0OpcodesAltLite
lda #16*2
sta tmp1 ; :virt_line_x2
lda ScreenHeight
sec
sbc #16
asl
sta tmp2 ; lines_left_x2
ldal nesBottomOffset
sta tmp4 ; :exit_offset
; jsr _RestoreBG0OpcodesAlt
jsr _RestoreBG0OpcodesAltLite
; lda StartYMod208 ; Restore the fields back to their original state
; ldx ScreenHeight
; jsr _RestoreBG0Opcodes
lda StartY
sta OldStartY
lda StartX
sta OldStartX
lda BG1StartY
sta OldBG1StartY
lda BG1StartX
sta OldBG1StartX
stz DirtyBits
stz LastRender ; Mark that a full render was just performed
rts
nesTopOffset ds 2
nesBottomOffset ds 2
; Use the per-scanline tables to set the screen. This is really meant to be used without the built-in tilemap
; support and is more of a low-level way to control the background rendering
@ -307,7 +439,6 @@ _DrawFinalPass
ldy _Sprites+SPRITE_CLIP_TOP,x ; PEI Slam to the top of the overlay (:bottom is greater than this value)
ldx :cursor
sty :cursor
; brk $44
jsr _PEISlam
lda 3,s ; Retrieve the sprite index
tax
@ -468,9 +599,10 @@ _RenderWithShadowing
; At this point, everything in the background has been rendered into the code field. Next, we need
; to create priority lists of scanline ranges.
jsr _FilterObjectList ; Walk the sorted list and create an array of objects that need to be rendered
jsr _ShadowOff ; Turn off shadowing and draw all the scanlines with sprites on them
jsr _DrawShadowList
jsr _DrawObjShadow ; Draw the background
jsr _DrawDirectSprites ; Draw the sprites directly to the Bank $01 graphics buffer (skipping the render-to-tile step)
jsr _ShadowOn ; Turn shadowing back on
@ -500,25 +632,58 @@ _RenderWithShadowing
:no_removal
rts
; Iterate through the shadow list and call _BltRange on each
_DrawShadowList
ldx #0
bra :start
; Specail mode for rendering in GTE-lite mode. No secondary background is possible
_RenderLite
sta RenderFlags
jsr _DoTimers ; Run any pending timer tasks
:loop
phx ; Save the index
lda _ShadowListTop,x
ldy _ShadowListBottom,x
tax
jsr _BltRange
jsr _ApplyBG0YPosLite ; Set stack addresses for the virtual lines to the physical screen
jsr _ApplyBG0XPosPre ; Lock in certain rendering variables (not lite/non-lite specific)
plx
inx
inx
:start
cpx _ShadowListCount
bcc :loop
jsr _UpdateBG0TileMap ; and the tile maps. These subroutines build up a list of tiles
jsr _ApplyTiles ; This function actually draws the new tiles into the code field
jsr _ApplyBG0XPosLite ; Patch the code field instructions with exit BRA opcode
; At this point, everything in the background has been rendered into the code field. Next, we need
; to create priority lists of scanline ranges.
; jsr _FilterObjectList ; Walk the sorted list and create an array of objects that need to be rendered
;
; jsr _ShadowOff ; Turn off shadowing and draw all the scanlines with sprites on them
; jsr _DrawObjShadow ; Draw the background
; jsr _DrawDirectSprites ; Draw the sprites directly to the Bank $01 graphics buffer (skipping the render-to-tile step)
;
jsr _ShadowOn ; Turn shadowing back on
;
; jsr _DrawFinalPass
ldx #0
ldy ScreenHeight
jsr _BltRange
lda StartYMod208 ; Restore the fields back to their original state
ldx ScreenHeight
jsr _RestoreBG0OpcodesLite
lda StartY
sta OldStartY
lda StartX
sta OldStartX
lda BG1StartY
sta OldBG1StartY
lda BG1StartX
sta OldBG1StartX
stz DirtyBits
stz LastRender ; Mark that a full render was just performed
lda SpriteRemovedFlag ; If any sprite was removed, set the rebuild flag
beq :no_removal
lda #DIRTY_BIT_SPRITE_ARRAY
sta DirtyBits
:no_removal
rts
; Run through the list of sprites that are not OFFSCREEN and not OVERLAYS and draw them directly to the graphics screen. We can use
@ -724,61 +889,8 @@ _DrawObjShadow
;:empty
; rts
; Split
;
; Y = current item
; X = next item
;
; Compares the bottom values of X and Y. If the current item extends past the next item, then this splits off the
; bottom ortion of Y and inserts it into the appropriate position in the linked list
split
:prev equ tmp15
lda ObjectList+OL_SPRITE_BOTTOM,x ; If the next item is fully within the current one, split
cmp ObjectList+OL_SPRITE_BOTTOM,y
bcc :do_split
rts
:do_split
sta ObjectList+OL_SPRITE_TOP,y ; Set the top of the current item past the bottom of the next item
:split_lp
lda ObjectList+OL_NEXT,x ; search to find the spot in the linked list that we should
bmi :insert_after ; move the fragment forward to
stx :prev
tax
lda ObjectList+OL_SPRITE_TOP,y
cmp ObjectList+OL_SPRITE_TOP,x
bcc :insert_before ; If the modified node's top value is <= the node we are inspecting,
beq :insert_before ; then it can be inserted here
bra :split_lp
:insert_before
ldx :prev
lda ObjectList+OL_NEXT,x
; Insert Y node after X node. A = OL_NEXT,x
:insert_after
sta ObjectList+OL_NEXT,y
tya
sta ObjectList+OL_NEXT,x
tyx
rts
; X = top
; A = bottom
; Preserve X, Y
:_BltRange3
phx
phy
tay
jsr _BltRange
ply
plx
rts
; Helper function to only return object from the sorted list if they are relevant for
; display.
_GetNextItem
cpx #EOL ; early out if we're at the end of the list
bne *+3

View File

@ -913,6 +913,10 @@ _CacheSpriteBanks
ora #^tiledata
sta DP2_TILEDATA_AND_SPRITEDATA_BANKS,x
lda #$0100
ora #^tiledata
sta DP2_TILEDATA_AND_BANK01_BANKS,x
lda #>spritedata
and #$FF00
ora #^TileStore

View File

@ -13,6 +13,7 @@ _CompileStamp
:vbuffAddr equ tmp5
:rtnval equ tmp6
LDA_IND_LONG_IDX equ $B7
LDA_IMM_OPCODE equ $A9
LDA_ABS_X_OPCODE equ $BD
AND_IMM_OPCODE equ $29
@ -137,6 +138,288 @@ RTL_OPCODE equ $6B
lda :rtnval ; Address in the compile memory
rts
; 4 palettes for the sprite data. Converts 4 pixels at a time from 0000 0000w wxxy yzz0 -> gggg hhhh iiii jjjj
; each swizzle table is 512 bytes long, 2048 bytes for all four. They need to be prec
; Draw a tile directly to the graphics screen as a sprite
;
; Y = screen address
; X = tile address
; A = $0001 = ignore mask
; = $0080 = vflip
; = $0600 = palette select
_DrawTileToScreenX
rtl
phb
phd ; Save the curren direct page and bank
ldal tool_direct_page ; Can't assume where we are
clc
adc #$100 ; Sprite space is on the second page
tcd
pei DP2_TILEDATA_AND_BANK01_BANKS ; Push the two bank we need
plb ; Pop off the tile data bank
; lda #W11_S0
; stz SwizzlePtr
; lda #^W11_S0
; sta SwizzlePtr+2
]line equ 0
lup 8
ldy tiledata+{]line*4}+2,x ; load the 8-bit NES tile data
; lda [SwizzlePtr],y ; lookup the swizzle value
; db LDA_IND_LONG_IDX,SwizzlePtr
; lda tiledata+{]line*4}+2,x
sta tmp_sprite_data+{]line*4}+2
ldy tiledata+{]line*4},x ; load the 8-bit NES tile data
; lda [SwizzlePtr],y ; lookup the swizzle value
; db LDA_IND_LONG_IDX,SwizzlePtr
; lda tiledata+{]line*4},x
sta tmp_sprite_data+{]line*4}
]line equ ]line+1
--^
plb ; Pop off bank 01
]line equ 0
lup 8
ldal tiledata+{]line*4}+32+2,x
eor #$FFFF
and: {]line*SHR_LINE_WIDTH}+2,y
ora tmp_sprite_data+{]line*4}+2
sta: {]line*SHR_LINE_WIDTH}+2,y
ldal tiledata+{]line*4}+32,x
eor #$FFFF
and: {]line*SHR_LINE_WIDTH},y
ora tmp_sprite_data+{]line*4}
sta: {]line*SHR_LINE_WIDTH},y
]line equ ]line+1
--^
; Restore the direct page and bank
pld
plb
rtl
pal_select dw $3333,$6666,$9999,$CCCC
_DrawTileToScreen
:palette equ 248
phb
pea $0101
plb
plb
bit #$0040
beq :no_prio
bit #$0100
jeq _DrawPriorityToScreen
jmp _DrawPriorityToScreenV
:no_prio
bit #$0100
jne _DrawTileToScreenV
phx
and #$0006
tax
ldal pal_select,x
sta :palette
plx
clc
]line equ 0
lup 8
ldal tiledata+{]line*4}+2,x
adc :palette
eor: {]line*SHR_LINE_WIDTH}+2,y
andl tiledata+{]line*4}+32+2,x
eor: {]line*SHR_LINE_WIDTH}+2,y
sta: {]line*SHR_LINE_WIDTH}+2,y
ldal tiledata+{]line*4},x
adc :palette
eor: {]line*SHR_LINE_WIDTH},y
andl tiledata+{]line*4}+32,x
eor: {]line*SHR_LINE_WIDTH},y
sta: {]line*SHR_LINE_WIDTH},y
]line equ ]line+1
--^
plb
rtl ; special exit
_DrawPriorityToScreen
:palette equ 248
:p_tmp equ 144
phx
and #$0006
tax
ldal pal_select,x
sta :palette
plx
clc
]line equ 0
lup 8
ldal tiledata+{]line*4}+2,x
adc :palette
eor: {]line*SHR_LINE_WIDTH}+2,y
sta :p_tmp
; Convert the screen data to a mask. Zero in screen = zero in mask, else $F
lda: {]line*SHR_LINE_WIDTH}+2,y
bit #$F000
beq *+5
ora #$F000
bit #$0F00
beq *+5
ora #$0F00
bit #$00F0
beq *+5
ora #$00F0
bit #$000F
beq *+5
ora #$000F
eor #$FFFF
and :p_tmp
andl tiledata+{]line*4}+32+2,x
eor: {]line*SHR_LINE_WIDTH}+2,y
sta: {]line*SHR_LINE_WIDTH}+2,y
ldal tiledata+{]line*4},x
adc :palette
eor: {]line*SHR_LINE_WIDTH},y
sta :p_tmp
lda: {]line*SHR_LINE_WIDTH},y
bit #$F000
beq *+5
ora #$F000
bit #$0F00
beq *+5
ora #$0F00
bit #$00F0
beq *+5
ora #$00F0
bit #$000F
beq *+5
ora #$000F
eor #$FFFF
and :p_tmp
andl tiledata+{]line*4}+32,x
eor: {]line*SHR_LINE_WIDTH},y
sta: {]line*SHR_LINE_WIDTH},y
]line equ ]line+1
--^
plb
rtl ; special exit
_DrawTileToScreenV
:palette equ 248
phx
and #$0006
tax
ldal pal_select,x
sta :palette
plx
clc
]line equ 0
lup 8
ldal tiledata+{{7-]line}*4}+2,x
eor :palette
eor: {]line*SHR_LINE_WIDTH}+2,y
andl tiledata+{{7-]line}*4}+32+2,x
eor: {]line*SHR_LINE_WIDTH}+2,y
sta: {]line*SHR_LINE_WIDTH}+2,y
ldal tiledata+{{7-]line}*4},x
eor :palette
eor: {]line*SHR_LINE_WIDTH},y
andl tiledata+{{7-]line}*4}+32,x
eor: {]line*SHR_LINE_WIDTH},y
sta: {]line*SHR_LINE_WIDTH},y
]line equ ]line+1
--^
plb
rtl ; special exit
_DrawPriorityToScreenV
:palette equ 248
:p_tmp equ 144
phx
and #$0006
tax
ldal pal_select,x
sta :palette
plx
clc
]line equ 0
lup 8
ldal tiledata+{{7-]line}*4}+2,x
adc :palette
eor: {]line*SHR_LINE_WIDTH}+2,y
sta :p_tmp
; Convert the screen data to a mask
lda: {]line*SHR_LINE_WIDTH}+2,y
bit #$F000
beq *+5
ora #$F000
bit #$0F00
beq *+5
ora #$0F00
bit #$00F0
beq *+5
ora #$00F0
bit #$000F
beq *+5
ora #$000F
eor #$FFFF
and :p_tmp
andl tiledata+{{7-]line}*4}+32+2,x
eor: {]line*SHR_LINE_WIDTH}+2,y
sta: {]line*SHR_LINE_WIDTH}+2,y
ldal tiledata+{{7-]line}*4},x
adc :palette
eor: {]line*SHR_LINE_WIDTH},y
sta :p_tmp
lda: {]line*SHR_LINE_WIDTH},y
bit #$F000
beq *+5
ora #$F000
bit #$0F00
beq *+5
ora #$0F00
bit #$00F0
beq *+5
ora #$00F0
bit #$000F
beq *+5
ora #$000F
eor #$FFFF
and :p_tmp
andl tiledata+{{7-]line}*4}+32,x
eor: {]line*SHR_LINE_WIDTH},y
sta: {]line*SHR_LINE_WIDTH},y
]line equ ]line+1
--^
plb
rtl ; special exit
; Draw a sprite directly to the graphics screen. If sprite is clipped at all, do not draw.
;
; X = sprite record index

View File

@ -6,7 +6,7 @@
; X = first tile
; Y = last tile
;
; To copy in three tiles starting at tile 5, for example, X = 5 and Y = 9
; To copy in four tiles starting at tile 5, for example, X = 5 and Y = 9
_LoadTileSet
txa
_Mul128 ; Jump to the target location
@ -125,7 +125,8 @@ InitTiles
bra :out
:fast
lda #0 ; Initialize with Tile 0
ldy #FastProcs
; ldy #FastProcs
ldy #LiteProcs
jsr _SetTileProcs
bra :out
@ -275,7 +276,8 @@ _SetNormalTileProcs
; the tile priority bit is set, and whether this is the special tile 0 or not.
:setTileFast
pla ; Throw away tile ID copy
ldy #FastProcs
; ldy #FastProcs
ldy #LiteProcs
pla
jmp _SetTileProcs
@ -367,9 +369,9 @@ _SetTile
tax
lda TileStore+TS_TILE_ID,x
; cmp newTileId ; Lift this up to the caller
; bne :changed
; rts
cmp newTileId ; Lift this up to the caller
bne :changed
rts
:changed sta oldTileId
lda newTileId
@ -404,46 +406,105 @@ _SetTile
jmp _PushDirtyTileX
:set_user_tile
and #$01FF
jsr _GetTileAddr ; The user tile callback needs access to this info, too, but
sta TileStore+TS_TILE_ADDR,x ; we just give the base tile address (hflip bit is ignored)
lda #UserTileDispatch
stal K_TS_BASE_TILE_DISP,x
lda #UserTileDispatch
stal K_TS_SPRITE_TILE_DISP,x
lda #UserTileDispatch
stal K_TS_ONE_SPRITE,x
jmp _PushDirtyTileX
; Trampoline / Dispatch table for user-defined tiles. If the user calls the GTESetCustomTileCallback toolbox routine,
; then this value is patched out. Calling GTESetCustomTileCallback with NULL will disconnect the user's routine.
; Trampoline / Dispatch table for user-defined tiles. If the user calls the GTESetAddress toolbox routine,
; then this value is patched out. Calling GTESetAddress with NULL will disconnect the user's routine.
;
; This hook copies essential information from the TileStore into a local record on the direct page and then
; passes that record to callback function. We are in the second direct page of the GTE bank 0 space.
UserTileDispatch
ldal TileStore+TS_TILE_ID,x ; Replace the tile data address (unset) with the tile id
_UTDPatch jsl UserHook1 ; Call the users code
plb ; Restore the data bank
lda TileStore+TS_TILE_ID,x
sta USER_TILE_ID
lda TileStore+TS_CODE_ADDR_HIGH,x ; load the bank of the target code field line
sta USER_TILE_CODE_PTR+2
lda TileStore+TS_CODE_ADDR_LOW,x
sta USER_TILE_CODE_PTR
lda TileStore+TS_TILE_ADDR,x
sta USER_TILE_ADDR
ldx #USER_TILE_RECORD ; pass the direct page offset to the user
pei DP2_TILEDATA_AND_TILESTORE_BANKS ; set the bank to the tiledata bank
plb
_UTDPatch jsl UserHook1 ; Call the users code
plb ; Restore the curent bank
; When the user's code returns, it can ask GTE to invoke a utility routine to copy data from the
; temporary buffer space into the code field
cmp #0
beq :done
; jmp FastCopyTmpDataA ; Non-zero value to continue additional work
jmp LiteCopyTmpDataA
:done
rts
; Stub to have a valid address for initialization / reset
UserHook1 rtl
; Fast utility function to just copy tile data straight from the tmp_tile_data buffer to the code field. This is only
; used by the user callback, so we can assume knowledge of the values on the direct page.
FastCopyTmpDataA
pei USER_TILE_CODE_PTR+2
ldy USER_TILE_CODE_PTR
plb
]line equ 0
lup 8
lda tmp_tile_data+{]line*4}
sta: $0004+{]line*$1000},y
lda tmp_tile_data+{]line*4}+2
sta: $0001+{]line*$1000},y
]line equ ]line+1
--^
plb
rts
LiteCopyTmpDataA
pei USER_TILE_CODE_PTR+2
ldy USER_TILE_CODE_PTR
plb
]line equ 0
lup 8
lda tmp_tile_data+{]line*4}
sta: $0004+{]line*_LINE_SIZE},y
lda tmp_tile_data+{]line*4}+2
sta: $0001+{]line*_LINE_SIZE},y
]line equ ]line+1
--^
plb
rts
; X = Tile Store offset
; Y = Engine Mode Base Table address
; A = Table proc index
;
; see TileProcTables in static/TileStore.s
tblPtr equ blttmp
_SetTileProcs
:tblPtr equ blttmp
; Multiple the proc index by 6 to get the correct table entry offset
asl
sta tblPtr
sta :tblPtr
asl
adc tblPtr
sta tblPtr
adc :tblPtr
sta :tblPtr
; Add this offset to the base table address
tya
adc tblPtr
sta tblPtr
adc :tblPtr
sta :tblPtr
; Set the pointer to this bank
@ -451,20 +512,20 @@ _SetTileProcs
phk
pla
and #$00FF
sta tblPtr+2
sta :tblPtr+2
; Lookup the tile procedures
ldy #0
lda [tblPtr],y
lda [:tblPtr],y
stal K_TS_BASE_TILE_DISP,x
ldy #2
lda [tblPtr],y
lda [:tblPtr],y
stal K_TS_SPRITE_TILE_DISP,x
ldy #4
lda [tblPtr],y
lda [:tblPtr],y
stal K_TS_ONE_SPRITE,x
rts
@ -502,6 +563,18 @@ FastUnderZV dw ConstTile0Fast,SpriteUnder0Fast,SpriteUnder0Fast
FastUnderNA dw CopyTileAFast,SpriteUnderAFast,OneSpriteFastUnderA
FastUnderNV dw CopyTileVFast,SpriteUnderVFast,OneSpriteFastUnderV
; "Lite" procs. For when the engine is in GTE Lite mode. Different
; stride than the "Fast" procs.
LiteProcs
LiteOverZA dw ConstTile0Lite,SpriteOver0Lite,OneSpriteLiteOver0
LiteOverZV dw ConstTile0Lite,SpriteOver0Lite,OneSpriteLiteOver0
LiteOverNA dw CopyTileALite,SpriteOverALite,OneSpriteLiteOverA
LiteOverNV dw CopyTileVLite,SpriteOverVLite,OneSpriteLiteOverV
LiteUnderZA dw ConstTile0Lite,SpriteUnder0Lite,SpriteUnder0Lite
LiteUnderZV dw ConstTile0Lite,SpriteUnder0Lite,SpriteUnder0Lite
LiteUnderNA dw CopyTileALite,SpriteUnderALite,OneSpriteLiteUnderA
LiteUnderNV dw CopyTileVLite,SpriteUnderVLite,OneSpriteLiteUnderV
; "Slow" procs. These are duplicates of the "Fast" functions, but also
; set the PEA opcode in all cases.
SlowProcs

View File

@ -102,6 +102,9 @@ _CallTable
adrl _TSSetAddress-1
adrl _TSUpdateOverlay-1
adrl _TSEnableSprites-1
adrl _TSEnableBackground-1
_CTEnd
_GTEAddSprite MAC
UserTool $1000+GTEToolNum
@ -116,11 +119,16 @@ _GTERemoveSprite MAC
UserTool $1300+GTEToolNum
<<<
; Helper function to set the data back to the toolset default
_SetDataBank sep #$20
lda #^TileStore
pha
;_SetDataBank sep #$20
; lda #^TileStore
; pha
; plb
; rep #$20
; rts
_SetDataBank pea #>TileStore
plb
plb
rep #$20
rts
; Do nothing when the tool set is installed
@ -144,6 +152,7 @@ zpToUse = userId+4
lda zpToUse,s ; Get the direct page address
phd ; Save the current direct page
tcd ; Set to our working direct page space
stal tool_direct_page ; Stash a copy in memory
txa
and #$00FF ; Get just the tool number
@ -172,6 +181,7 @@ zpToUse = userId+4
pld ; Restore the caller's direct page
:exit
ldx #0 ; No error
ldy #6 ; Remove the 6 input bytes
jml ToStrip
@ -298,6 +308,11 @@ _TSRender
_TSEntry
lda :flags,s
cmp #$FFFF ; Hack! Special mode...
beq :nes
cmp #$FFFE ; Experimental gte-lite mode
beq :lite
bit #RENDER_WITH_SHADOWING
beq :no_shadowing
jsr _RenderWithShadowing
@ -311,6 +326,14 @@ _TSRender
:no_scanline
jsr _Render
bra :done
:nes
jsr _RenderNES
bra :done
:lite
jsr _RenderLite
:done
_TSExit #0;#2
@ -590,7 +613,9 @@ _TSSetBG1Origin
_TSGetTileAt
:y equ FirstParam
:x equ FirstParam+2
:output equ FirstParam+4
:output_id equ FirstParam+4
:output_x equ FirstParam+6
:output_y equ FirstParam+8
_TSEntry
@ -602,16 +627,23 @@ _TSGetTileAt
jsr _GetTileAt
bcc :ok
lda #0
sta :output_x,s
sta :output_y,s
bra :out
:ok
txa
sta :output_x,s
tya
sta :output_y,s
; Load the tile at that tile store location
:ok
jsr _GetTileStoreOffset0 ; Get the address of the X,Y tile position
tax
lda TileStore+TS_TILE_ID,x
:out
sta :output,s
sta :output_id,s
_TSExit #0;#4
@ -746,6 +778,7 @@ _TSSetOverlay
_TSExit #0;#8
; UpdateOverlay(top, bottom, proc)
_TSUpdateOverlay
:proc equ FirstParam+0
:bottom equ FirstParam+4
@ -886,7 +919,7 @@ _TSSetBG1Scale
sta BG1Scaling
_TSExit #0;#2
; Pointer GetAddress(tblId)
; Pointer GetAddress(addrId)
_TSGetAddress
:tblId equ FirstParam+0
:output equ FirstParam+2
@ -914,11 +947,30 @@ _TSGetAddress
lda BG1StartXMod164Tbl+2
sta :output+2,s
bra :out
:next_2
:next_2 cmp #rawDrawTile
bne :next_3
lda #_DrawTileToScreen
sta :output,s
lda #^_DrawTileToScreen
sta :output+2,s
bra :out
:next_3 cmp #liteBlitter
bne :next_4
lda #lite_base
sta :output,s
lda #^lite_base
sta :output+2,s
bra :out
:next_4
:out
_TSExit #0;#2
; SetAddress(tblId, Pointer)
; SetAddress(addrId, Pointer)
_TSSetAddress
:ptr equ FirstParam+0
:tblId equ FirstParam+4
@ -932,7 +984,7 @@ _TSSetAddress
sta StartXMod164Tbl
lda :ptr+2,s
sta StartXMod164Tbl+2
bra :out
brl :out
:next_1
cmp #scanlineHorzOffset2
@ -942,8 +994,67 @@ _TSSetAddress
sta BG1StartXMod164Tbl
lda :ptr+2,s
sta BG1StartXMod164Tbl+2
brl :out
:next_2 cmp #vblCallback
bne :next_3
lda :ptr,s
ora :ptr+2,s
beq :vbl_restore
lda :ptr,s
stal _VblTaskPatch+1 ; long addressing because we're patching code in the K bank
lda :ptr+1,s
stal _VblTaskPatch+2
brl :out
:vbl_restore
lda #_TaskStub
stal _VblTaskPatch+1
lda #>_TaskStub
stal _VblTaskPatch+2
brl :out
:next_3 cmp #extSpriteRenderer
bne :next_4
lda :ptr,s
sta ExtSpriteRenderer
lda :ptr+2,s
sta ExtSpriteRenderer+2
bra :out
:next_2
:next_4 cmp #extBG0TileUpdate
bne :next_5
lda :ptr,s
sta ExtUpdateBG0Tiles
lda :ptr+2,s
sta ExtUpdateBG0Tiles+2
bra :out
:next_5 cmp #userTileCallback
bne :next_6
lda :ptr,s
ora :ptr+2,s
beq :utd_restore
lda :ptr,s
stal _UTDPatch+1 ; long addressing because we're patching code in the K bank
lda :ptr+1,s
stal _UTDPatch+2
brl :out
:utd_restore
lda #UserHook1
stal _UTDPatch+1
lda #>UserHook1
stal _UTDPatch+2
brl :out
:next_6
:out
_TSExit #0;#6
@ -963,6 +1074,42 @@ _TSCompileSpriteStamp
_TSExit #0;#4
; EnableSprites(bool)
_TSEnableSprites
:enable equ FirstParam
_TSEntry
lda :enable
beq :turn_off
lda #CTRL_SPRITE_DISABLE
trb GTEControlBits
bra :done
:turn_off
lda #CTRL_SPRITE_DISABLE
tsb GTEControlBits
:done
_TSExit #0;#2
; EnableBackground(bool)
_TSEnableBackground
:enable equ FirstParam
_TSEntry
lda :enable,s
beq :turn_off
lda #CTRL_BKGND_DISABLE
trb GTEControlBits
bra :done
:turn_off
lda #CTRL_BKGND_DISABLE
tsb GTEControlBits
:done
_TSExit #0;#2
; Insert the GTE code
put Math.s
@ -978,6 +1125,7 @@ _TSCompileSpriteStamp
put SpriteRender.s
put Render.s
put render/Render.s
put render/Lite.s
put render/Fast.s
put render/Slow.s
put render/Dynamic.s
@ -988,11 +1136,14 @@ _TSCompileSpriteStamp
put tiles/DirtyTileQueue.s
put blitter/SCB.s
put blitter/Horz.s
put blitter/HorzLite.s
put blitter/Vert.s
put blitter/VertLite.s
put blitter/BG0.s
put blitter/BG1.s
put blitter/Rotation.s
put blitter/Template.s
put blitter/TemplateUtils.s
put blitter/Blitter.s
put blitter/BlitterLite.s
put blitter/PEISlammer.s

View File

@ -18,8 +18,23 @@ _BltRange
bcc *+3
rts
; If the background is disabled, jump to a specialized BG routine
lda GTEControlBits
bit #CTRL_BKGND_DISABLE
beq :normal
brl DisabledBG
:normal
; If we are in "lite" mode, defer to that implementation
lda EngineMode
bit #ENGINE_MODE_TWO_LAYER+ENGINE_MODE_DYN_TILES
bne :dark
jmp _BltRangeLite
:dark
phb ; preserve the bank register
clc`
clc
dey
tya ; Get the address of the line that we want to return from
@ -63,17 +78,8 @@ _BltRange
bit #ENGINE_MODE_TWO_LAYER
beq :skip_bank
; TODO: Switch to loading the selected BG1 bank. No special "Alt" bank
;
; lda RenderFlags
; bit #RENDER_ALT_BG1
; beq :primary
;
; lda BG1AltBank
; bra :alt
;
;:primary lda BG1DataBank
;:alt
; Load the BG1 data bank
lda BG1DataBank
pha
plb
@ -85,6 +91,7 @@ _BltRange
lda BlitterDP ; Set the direct page to the blitter data
tcd
php ; save the current processor flags
sei ; disable interrupts
_R0W1
tsc ; save the stack pointer
@ -95,9 +102,12 @@ blt_entry jml $000000 ; Jump into the blitter code $XX/YY00
blt_return _R0W0
stk_save lda #0000 ; load the stack
tcs
cli ; re-enable interrupts
plp ; re-enable interrupts (maybe, if interrupts disabled when we are called, they are not re-endabled)
pld ; restore the direct page
:exit_ptr equ tmp0
:jmp_low_save equ tmp2
sep #$20
ldy #CODE_EXIT+1
lda :jmp_low_save
@ -106,3 +116,84 @@ stk_save lda #0000 ; load the stack
plb ; restore the bank
rts
; Specialize routine that just slams a bunch of PHA instructions when background rendering is disabled
DisabledBG
stx tmp15
tya
sec
sbc tmp15
tay ; Put the count in the y register
lda ScreenWidth ; Screen width in bytes (0 - 159)
lsr ; Convert to number of word
eor #$FFFF
adc #:blkend ; subtract from the end of the PHA array
stal :patch+1
lda #8 ; Enable interrups at least this many lines
sta tmp14
txa ; multiply starting line by 2 for indexing
asl
tax
php ; save the current processor flags
sei ; disable interrupts
tsc ; save the stack pointer
sta tmp15
_R0W1
:loop
lda RTable,x ; Load the screen right edge
tcs
lda #0
:patch jmp $0000
lup 80
pha
--^
:blkend
dec tmp14
bmi :enable_int
:next
inx
inx
dey
bne :loop
_R0W0
lda tmp15
tcs
plp
rts
:enable_int
lda #8 ; Reset the counter
sta tmp14
lda tmp15 ; restore the stack
tcs
sep #$30 ; 8-bit mode
lda STATE_REG_OFF ; Could be on the direct page....
stal STATE_REG
cli
sei
lda STATE_REG_BLIT ; External values
stal STATE_REG
rep #$30
bra :next
; External entry point. Can be called directly from another bank
BltRange
phd
phb
ldal tool_direct_page
tcd
jsr _SetDataBank ; only affects accumulator
jsr _BltRange
plb
pld
rtl

83
src/blitter/BlitterLite.s Normal file
View File

@ -0,0 +1,83 @@
; This is the method that is most useful from the high-level code. We want the
; freedom to blit a range of lines. This subroutine can assume that all of the
; data in the code fields is set up properly.
;
; X = first line (inclusive), valid range of 0 to 199
; Y = last line (exclusive), valid range >X up to 200
;
; The lines are based on the appearance of lines in the play field, so blitting lines 0 through
; 19 will draw the first 20 lines on the play field, regardless of where the playfield is physically
; on the SHR screen or the current value of StartY
lite_base EXT
lite_full_return EXT
; This should only be called from _Render when it is determined to be safe
_BltRangeLite
:exit_ptr equ tmp0
:jmp_low_save equ tmp2
phb
clc
dey
tya ; Get the address of the line that we want to return from
adc StartYMod208 ; and create a pointer to it
asl
tay
lda BTableLow,y
sta :exit_ptr
lda BTableHigh,y
sta :exit_ptr+2
txa ; get the first line (0 - 199)
adc StartYMod208 ; add in the virtual offset (0, 207) -- max value of 406
asl
tax ; this is the offset into the blitter table
lda BTableLow,x ; patch in the address
stal blt_entry_lite+1
; The way we patch the exit code is subtle, but very fast. The CODE_EXIT offset points to
; an JMP/JML instruction that transitions to the next line after all of the code has been
; executed.
;
; The trick we use is to patch the low byte to force the code to jump to a special return
; function (jml blt_return) in the *next* code field line.
ldy #_EXIT_EVEN+1 ; this is a JMP instruction that points to the next line.
lda [:exit_ptr],y ; we have to save because not every line points to the same
sta :jmp_low_save ; position in the next code line
lda #lite_full_return ; this is the address of the return code
sta [:exit_ptr],y ; patch out the address of the JMP
php ; save the current processor flags
sep #$20 ; run the lite blitter in 8-bit accumulator mode
lda :exit_ptr+2 ; set the bank to the code field
pha
plb
sei ; disable interrupts
_R0W1
tsx ; save the stack pointer in Y
txy
blt_entry_lite jml lite_base ; Jump into the blitter code $ZZ/YYXX (Does not modify Y or X)
blt_return_lite ENT
_R0W0
tyx
txs ; restore the stack
plp ; re-enable interrupts (maybe, if interrupts disabled when we are called, they are not re-endabled)
:exit_ptr equ tmp0
:jmp_low_save equ tmp2
mx %00
ldy #_EXIT_EVEN+1
lda :jmp_low_save
sta [:exit_ptr],y
plb
rts

View File

@ -153,11 +153,11 @@ _ApplyBG0XPos
; If there are saved opcodes that have not been restored, do not run this routine
lda LastPatchOffset
beq :ok
beq *+3
rts
; This code is fairly succinct. See the corresponding code in Vert.s for more detailed comments.
:ok
lda StartYMod208 ; This is the base line of the virtual screen
asl
sta :virt_line_x2 ; Keep track of it
@ -228,6 +228,7 @@ _ApplyBG0XPos
lda StartXMod164
; Alternate entry point if the virt_line_x2 and lines_left_x2 and XMod164 values are passed in externally
_ApplyBG0XPosAlt
:stk_save equ tmp0
:virt_line_x2 equ tmp1

656
src/blitter/HorzLite.s Normal file
View File

@ -0,0 +1,656 @@
; Subroutines that deal with the horizontal scrolling in the "lite" blitter. The
; advantage of the lite blitter is that the entire code field is in one bank, so
; there is no need to chunk up the updates into 16-line pieces. The entire height
; of the playfield can be done with a single unrolled loop.
;
; A = starting virtual line in the code field (0 - 207)
; X = number of lines to render (0 - 200)
_RestoreBG0OpcodesLite
:virt_line_x2 equ tmp1
:lines_left_x2 equ tmp2
:exit_offset equ tmp4
asl
sta :virt_line_x2 ; Keep track of it
txa
asl
sta :lines_left_x2
lda LastPatchOffset ; If zero, there are no saved opcodes
sta :exit_offset
_RestoreBG0OpcodesAltLite
:virt_line_x2 equ tmp1
:lines_left_x2 equ tmp2
:draw_count_x2 equ tmp3
:exit_offset equ tmp4
:base_address equ tmp5
:exit_address equ tmp6
:draw_count_x6 equ blttmp+10
; We do need to split the update into two parts so that we can handle the wrap-around portion
ldx :lines_left_x2
lda #208*2
sec
sbc :virt_line_x2 ; calculate number of lines to the end of the buffer
cmp :lines_left_x2
bcs :one_pass ; if there's room, do it in one shot
; If the virtual screen wraps around the bank, then we need to split the update up
; into two pieces to efficiently restore the values without having to do the
; virtual_line -> physical_line conversion each time.
tax
jsr :one_pass ; Go through with this draw count
stz :virt_line_x2
lda :lines_left_x2
sec
sbc :draw_count_x2 ; this many left to draw. Fall through to finish up
tax
:one_pass
txa
sta :draw_count_x2 ; this is the number of lines we will do right now
asl
adc :draw_count_x2
sta :draw_count_x6
phb
sep #$20 ; Set the data bank to the code field
lda BTableHigh
pha
plb
rep #$21 ; clear the carry while we're here...
ldx :virt_line_x2
ldal BTableLow,x ; Get the address of the first code field line
sta :base_address
adc #_LOW_SAVE
sta :low_save_addr
lda :base_address
adc :exit_offset ; Add some offsets to get the base address in the code field line
sta :exit_address
sec
CopyXToYPrep :do_restore;:draw_count_x6
ldx :low_save_addr
ldy :exit_address
:do_restore jsr $0000 ; Jump in to do SCREEN_HEIGHT lines
stz LastPatchOffset ; Clear the value once completed
plb
rts
; Based on the current value of StartX in the direct page, patch up the code fields
; to render the correct data. Note that we do *not* do the OpcodeRestore in this
; routine. The reason is that the restore *must* be applied using the (StartX, StartY)
; values from the previous frame, which requires logic that is not relevant to setting
; up the code field.
;
; This function is where the reverse-mapping aspect of the code field is compensated
; for. In the initialize case where X = 0, the exit point is at the *end* of
; the code buffer line
;
; +----+----+ ... +----+----+----+
; | 82 | 80 | | 04 | 02 | 00 |
; +----+----+ ... +----+----+----+
; ^ x=0
;
; As the screen scrolls right-to-left, the exit position moves to earlier memory
; locations until wrapping around from 163 to 0.
;
; The net calculation are
;
; x_exit = (164 - x) % 164
; x_enter = (164 - x - width) % 164
;
_ApplyBG0XPosLite
:virt_line_x2 equ tmp1
:lines_left_x2 equ tmp2
; If there are saved opcodes that have not been restored, do not run this routine
lda LastPatchOffset
beq *+3
rts
; This code is fairly succinct. See the corresponding code in Vert.s for more detailed comments.
lda StartYMod208 ; This is the base line of the virtual screen
asl
sta :virt_line_x2 ; Keep track of it
lda ScreenHeight
asl
sta :lines_left_x2
; Calculate the exit and entry offsets into the code fields. This is a bit tricky, because odd-aligned
; rendering causes the left and right edges to move in a staggered fashion.
;
; ... +----+----+----+----+----+- ... -+----+----+----+----+----+
; | 04 | 06 | 08 | 0A | 0C | | 44 | 46 | 48 | 4A |
; ... +----+----+----+----+----+- ... -+----+----+----+----+----+
; | |
; +---- screen width --------------+
; entry | | exit
;
; Here is an example of a screen 64 bytes wide. When everything is aligned to an even offset
; then the entry point is column $08 and the exit point is column $48
;
; If we move the screen forward one byte (which means the pointers move backwards) then the low-byte
; of column $06 will be on the right edge of the screen and the high-byte of column $46 will left-edge
; of the screen. Since the one-byte edges are handled specially, the exit point shifts one column, but
; the entry point does not.
;
; ... +----+----+----+----+----+- ... -+----+----+----+----+----+
; | 04 | 06 | 08 | 0A | 0C | | 44 | 46 | 48 | 4A |
; ... +----+----+----+----+----+- ... -+----+----+----+----+----+
; | | | |
; +--|------ screen width -------|--+
; entry | | exit
;
; When the screen is moved one more byte forward, then the entry point will move to the
; next column.
;
; ... +----+----+----+----+----+- ... -+----+----+----+----+----+
; | 04 | 06 | 08 | 0A | 0C | | 44 | 46 | 48 | 4A |
; ... +----+----+----+----+----+- ... -+----+----+----+----+----+
; | |
; +------ screen width ------------+
; entry | | exit
;
; So, in short, the entry tile position is rounded up from the x-position and the exit
; tile position is rounded down.
;
; Now, the left edge of the screen is pushed last, so we need to exit one instruction *after*
; the location (163 - StartX % 164)
;
; x = 0
;
; | PEA $0000 |
; +-----------+
; | PEA $0000 |
; +-----------+
; | JMP loop | <-- Exit here
; +-----------+
;
; x = 1 and 2
;
; | PEA $0000 |
; +-----------+
; | PEA $0000 | <-- Exit Here
; +-----------+
; | JMP loop |
; +-----------+
lda StartXMod164
; Alternate entry point if the virt_line_x2 and lines_left_x2 and XMod164 values are passed in externally
_ApplyBG0XPosAltLite
;:stk_save equ tmp0
:virt_line_x2 equ tmp1
:lines_left_x2 equ tmp2
:draw_count_x2 equ tmp3
:exit_offset equ tmp4
:entry_offset equ tmp5
:exit_bra equ tmp6
:exit_address equ tmp7
:base_address equ tmp8
:opcode equ tmp9
:odd_entry_offset equ tmp10
:draw_count_x3 equ blttmp ; steal even mode direct page temp space...
:draw_count_x6 equ blttmp+2
:entry_jmp_addr equ blttmp+4
:low_save_addr equ blttmp+6
:draw_count_x3 equ blttmp+8
:draw_count_x6 equ blttmp+10
:entry_odd_addr equ blttmp+12
:exit_odd_addr equ blttmp+14
bit #$0001
jne :odd_case ; Specialized routines for even/odd cases
; If the exit byte is even, then the left edge is odd-aligned and we exit at this word.
tax
lda CodeFieldEvenBRA-2,x
sta :exit_bra
lda Col2CodeOffset-2,x ; offset from :base that is the exit location
sta :exit_offset
sta LastPatchOffset ; Cache as a flag for later
; Calculate the entry point into the code field by calculating the right edge
txa ; lda StartXMod164
clc
adc ScreenWidth ; move to the right edge
cmp #164 ; Keep the value in range
bcc *+5
sbc #164
; Lookup the relative offset that we will be entering the code field. Need to adjust the Col2CodeOffset
; to account for the position of the BRL instruction
tax
lda Col2CodeOffset-2,x ; offset from base
clc
adc #-{_ENTRY_JMP+3}
sta :opcode
; Now update the code field to get ready to execute. We set the bank register to the code
; field to make updates faster. The primary actions to do are.
;
; 1. Saves the low operand byte in the code field (opcode is always $F4)
; 2. Writes the BRA instruction to exit the code field
; 3. Writes the JMP entry point to enter the code field
;
; We do need to split the update into two parts so that we can handle the wrap-around portion
ldx :lines_left_x2
lda #208*2
sec
sbc :virt_line_x2 ; calculate number of lines to the end of the buffer
cmp :lines_left_x2
bcs :one_pass_even ; if there's room, do it in one shot
; Since the screen height can be up to 200 lines and the virtual buffer size is 208, the common
; case will be that the blit will wrap around the end of the code field
tax
jsr :one_pass_even ; Go through with this draw count
stz :virt_line_x2
lda :lines_left_x2
sec
sbc :draw_count_x2 ; this many left to draw. Fall through to finish up
tax
:one_pass_even
txa
sta :draw_count_x2 ; this is the number of lines we will do right now
asl
adc :draw_count_x2
sta :draw_count_x6
lsr
sta :draw_count_x3
phb ; Save the existing bank
sep #$20 ; Set the data bank to the code field
lda BTableHigh
pha
plb
rep #$21 ; clear the carry while we're here...
ldx :virt_line_x2
ldal BTableLow,x ; Get the address of the code field line
sta :base_address ; Will use this address a few times
adc #_ENTRY_JMP ; Add the offsets in order to get absolute addresses
sta :entry_jmp_addr
adc #{_LOW_SAVE-_ENTRY_JMP}
sta :low_save_addr
lda :base_address
adc :exit_offset ; Add the offset to get the absolute address in the code field line
sta :exit_address
; First step is to set the BRA instruction to exit the code field at the proper location. There
; are two sub-steps to do here; we need to save the 8-bit value that exists at the location+1 and
; then overwrite it with the branch instruction.
sec ; These macros preform subtractions that do not underflow
CopyXToYPrep :do_save_entry_e;:draw_count_x6
LiteSetConstPrep :do_set_bra_e;:draw_count_x3
stal :do_setopcode_e+1
stal :do_set_rel_e+1
sep #$20
ldy :entry_jmp_addr
lda #$82
:do_setopcode_e jsr $0000 ; Copy in the BRL opcode into the entry point
ldx :exit_address
inx
ldy :low_save_addr
iny
:do_save_entry_e jsr $0000 ; Copy a byte from offset x to y
rep #$20
ldy :exit_address
lda :exit_bra
:do_set_bra_e jsr $0000 ; Set the BRA instruction in the code field to exit
ldy :entry_jmp_addr
iny
lda :opcode
:do_set_rel_e jsr $0000 ; Set the relative offset for all BRL instructions
plb
rts
; Odd case if very close to the even case, except that the code is entered a word later. It is still
; exited at the same word. There is extra work done because we have to save the third byte of the
; exit location to fill in the left edge and we have to patch a different BRL to enter the code field
; afte the right-edge byte is pushed onto the screen
:odd_case
dec
tax
lda CodeFieldOddBRA,x
sta :exit_bra
lda Col2CodeOffset,x
sta :exit_offset
sta LastPatchOffset ; Cache as a flag for later
txa ; StartXMod164 - 1
clc
adc ScreenWidth
cmp #164 ; Keep the value in range
bcc *+5
sbc #164
tax
lda Col2CodeOffset,x
clc
adc #-{_ENTRY_JMP+3} ; In this case it gets loaded in the X-register
sta :opcode
lda Col2CodeOffset-2,x
clc
adc #-{_ENTRY_ODD+3}
sta :odd_entry_offset
; Main loop
ldx :lines_left_x2
lda #208*2
sec
sbc :virt_line_x2 ; calculate number of lines to the end of the buffer
cmp :lines_left_x2
bcs :one_pass_odd ; if there's room, do it in one shot
tax
jsr :one_pass_odd
stz :virt_line_x2
lda :lines_left_x2
sec
sbc :draw_count_x2 ; this many left to draw. Fall through to finish up
tax
:one_pass_odd
txa
sta :draw_count_x2 ; this is the number of lines we will do right now
asl
adc :draw_count_x2
sta :draw_count_x6
lsr
sta :draw_count_x3
phb ; Save the existing bank
sep #$20
lda BTableHigh ; Get the bank
pha
plb
rep #$21
ldx :virt_line_x2
ldal BTableLow,x ; Get the address of the first code field line
sta :base_address ; Save it to use as the base address
adc #_ENTRY_JMP ; Add the offsets in order to get absolute addresses
sta :entry_jmp_addr
adc #{_ENTRY_ODD-_ENTRY_JMP}
sta :entry_odd_addr
adc #{_EXIT_ODD-_ENTRY_ODD}
sta :exit_odd_addr
adc #{_LOW_SAVE-_EXIT_ODD}
sta :low_save_addr
lda :base_address
adc :exit_offset ; Add some offsets to get the base address in the code field line
sta :exit_address
; Setup the jumps into the unrolled loops
sec
CopyXToYPrep :do_save_entry_o;:draw_count_x6
stal :do_save_high_byte+1
LiteSetConstPrep :do_set_bra_o;:draw_count_x3
stal :do_setopcode_o+1
stal :do_set_rel_o+1
stal :do_odd_code_entry+1
sep #$20
ldy :entry_jmp_addr
lda #$A2
:do_setopcode_o jsr $0000 ; Copy in the LDX opcode into the entry point
ldx :exit_address
inx
inx
ldy :exit_odd_addr
iny
:do_save_high_byte jsr $0000 ; Copy high byte of the exit location into the odd handling path
ldx :exit_address
inx
ldy :low_save_addr
iny
:do_save_entry_o jsr $0000 ; Save the low byte of the exit operand into a save location for restore later
rep #$20
ldy :exit_address
lda :exit_bra
:do_set_bra_o jsr $0000 ; Insert a BRA instruction over the saved word
ldy :entry_jmp_addr
iny
lda :opcode ; Store the same relative address to use for loading the entry word data
:do_set_rel_o jsr $0000
; The odd case need to do a bit of extra work
ldy :entry_odd_addr
iny
lda :odd_entry_offset
:do_odd_code_entry jsr $0000 ; Fill in the BRL argument for the odd entry
plb
rts
_RestoreScanlineBG0OpcodesLite
:virt_line_x2 equ tmp1
:lines_left_x2 equ tmp2
:exit_offset equ tmp4
; Avoid local var collisions
:virt_line_pos_x2 equ tmp11
:total_left_x2 equ tmp12
:current_count_x2 equ tmp13
:ptr equ tmp14
asl
sta :virt_line_pos_x2
tay
txa
asl
sta :total_left_x2
lda StartXMod164Tbl
sta :ptr
lda StartXMod164Tbl+2
sta :ptr+2
; Patch our the ranges from the StartXMod164Tbl array starting at the first virtual line
:loop
lda [:ptr],y
and #$FF00 ; Determine how many sequential lines to restore
xba
inc
asl
min :total_left_x2 ; Don't draw more than the number of lines that are left to process
sta :current_count_x2 ; Save a copy for later
sta :lines_left_x2 ; Set the parameter
sty :virt_line_x2 ; Set the parameter
lda LastOffsetTbl,y
sta :exit_offset
jsr _RestoreBG0OpcodesAltLite
clc
lda :virt_line_pos_x2
adc :current_count_x2
cmp #208*2 ; Do the modulo check in this loop
bcc *+5
sbc #208*2
sta :virt_line_pos_x2
tay
lda :total_left_x2
sec
sbc :current_count_x2
sta :total_left_x2
bne :loop
rts
; This is a variant of the above routine that allows each x-position to be set independently from a table of value. This is
; quite a bit slower than the other routine since we cannot store constant values for each line.
;
; This routine operates at a higher level and does not try to be super optimized for the case where every line has a different
; set of parameters. Instead, we optimize for the case where there are a few large ranges of the screen moving at different
; rates, e.g. a fixed status bar area on top, a slow-scrolling area in the middle and a fast are in the foreground.
;
; The table that drives this is dense and has the following format for each word
;
; Bits 0 - 7: X mod 164 value
; Bits 8 - 15: Number of scanline to persist this mod value
;
; So, if the first 10 entries has a mod value of 5, they would look like: $0905, $0805, $0705, ... $0105, $0005
;
; This allows the code to start an an arbitrary location and immeditely sync up with the modulo list. It also allows
; the code to easily skip ranges of constant values using the existing _ApplyBG0XPos function as a subroutine.
;
; NOTE: This function is *exactly* the same as _ApplyScanlineBG0XPos with the exception that it calls
; _ApplyBG0XPosAltLite instead of _ApplyBG0XPosAlt. Should unify with an subroutine selector
_ApplyScanlineBG0XPosLite
; Copies of the local variables in _ApplyBG0XPos
:virt_line_x2 equ tmp1
:lines_left_x2 equ tmp2
:exit_offset equ tmp4
; Avoid local var collision with _ApplyBG0XPos
:virt_line_pos_x2 equ tmp11
:total_left_x2 equ tmp12
:current_count_x2 equ tmp13
:ptr equ tmp14
lda StartXMod164Tbl
sta :ptr
lda StartXMod164Tbl+2
sta :ptr+2
ora :ptr
bne *+3 ; null pointer check
rts
lda StartYMod208 ; This is the base line of the virtual screen
asl
sta :virt_line_pos_x2
tay
lda ScreenHeight
asl
sta :total_left_x2
; Patch our the ranges from the StartXMod164Tbl array starting at the first virtual line
:loop
lda [:ptr],y
tax
and #$FF00 ; Determine how many sequential lines have this mod value
xba
inc
asl
min :total_left_x2 ; Don't draw more than the number of lines that are left to process
sta :current_count_x2 ; Save a copy for later
sta :lines_left_x2 ; Set the parameter
sty :virt_line_x2 ; Set the parameter
txa ; Put the X mod 164 value in the accumulator
and #$00FF
jsr _ApplyBG0XPosAltLite
lda :exit_offset ; Get the direct address in the code field that was overwritten
ldy :virt_line_pos_x2
sta LastOffsetTbl,y ; Stash it for use by the per-scanline resotre function
tya
clc
adc :current_count_x2
cmp #208*2 ; Do the modulo check in this loop
bcc *+5
sbc #208*2
sta :virt_line_pos_x2
tay
lda :total_left_x2
sec
sbc :current_count_x2
sta :total_left_x2
bne :loop
rts
; Copy from the offset at X to the offset at Y
;
; Y = code field offset
; X = value
CopyXToYPrep mac
lda #x2y_bottom
sbc ]2 ; count_x6
stal ]1+1 ; A jmp/jsr instruction
<<<
]line equ 199
lup 200
lda: {]line*_LINE_SIZE},x
sta: {]line*_LINE_SIZE},y
]line equ ]line-1
--^
x2y_bottom rts
; Set a constant 8-bit value across the code field
;
; Y = code field offset
LiteSetConstPrep mac
lda #lsc_bottom
sbc ]2 ; count_x3
stal ]1+1 ; A jmp/jsr instruction
<<<
]line equ 199
lup 200
sta: {]line*_LINE_SIZE},y
]line equ ]line-1
--^
lsc_bottom rts

View File

@ -14,17 +14,19 @@
; Y = last line (exclusive), valid range >X up to 200
_PEISlam
cpx #200
bcc *+3
rts
bcc *+4
brk $14
; rts
cpy #201
bcc *+3
rts
bcc *+4
brk $15
; rts
txa
tya ; x must be less than y
stal :screen_width_1
tya
txa
cmpl :screen_width_1
bcs *+3
bcc *+3
rts
@ -77,6 +79,11 @@ _PEISlam
dey ; decrement the total counter, if zero then we're done
beq :exit
cmp #$9D00
bcc *+4
; beq :exit
brk $85 ; Kill if stack is out of range
dex ; decrement the inner counter. Both counters are set
beq :restore ; up so that they fall-through by default to save a cycle
; per loop iteration.
@ -115,3 +122,21 @@ _PEISlam
:stk_save ds 2
:screen_width_1 ds 2
; A stashed memory location just in case we need it. This is filled in the GTEStartUp()
tool_direct_page ds 2
; External entry point. Can be called directly from another bank
PEISlam
phd
phb
ldal tool_direct_page
tcd
jsr _SetDataBank ; only affects accumulator
jsr _PEISlam
plb
pld
rtl

View File

@ -38,7 +38,7 @@ PagePatches da {long_0-base+2}
da {long_2-base+2}
da {long_3-base+2}
; da {long_4-base+2}
da {long_5-base+2}
; da {long_5-base+2}
da {long_6-base+2}
da {odd_entry-base+2}
da {loop_exit_1-base+2}
@ -63,7 +63,7 @@ BankPatches da {long_0-base+3}
da {long_2-base+3}
da {long_3-base+3}
; da {long_4-base+3}
da {long_5-base+3}
; da {long_5-base+3}
da {long_6-base+3}
BankPatchNum equ *-BankPatches
@ -94,13 +94,13 @@ entry_jmp jmp $0100
; update the low-byte of the address, the means it takes only
; an amortized 4-cycles per line to set the entry point break
bit #$000B ; Check the bottom nibble to quickly identify a PEA instruction
bne r_is_not_pea ; This costs 5 cycles in the fast-path
; bit #$000B ; Check the bottom nibble to quickly identify a PEA instruction
; bne r_is_not_pea ; This costs 5 cycles in the fast-path
xba ; fast code for PEA
r_jmp_rtn sep #$20 ; shared return code path by all methods
two_byte_rtn pha
rep #$61 ; Clear Carry, Overflow and M bits #$20
; rep #$61 ; Clear Carry, Overflow and M bits #$20
odd_entry jmp $0100 ; unconditionally jump into the "next" instruction in the
; code field. This is OK, even if the entry point was the
; last instruction, because there is a JMP at the end of
@ -150,17 +150,17 @@ jmp_rtn_1 jmp l_jmp_rtn-base ; Could inline the code and
; 8 or 16 lines in order to give the system time to handle interrupts.
enable_int ldal stk_save+1 ; restore the stack
tcs
sep #$20 ; 8-bit mode
ldal STATE_REG ; Read Bank 0 / Write Bank 0
and #$CF
sep #$30 ; 8-bit mode
ldal STATE_REG
tax ; Save the value
and #$CF ; Read Bank 0 / Write Bank 0
stal STATE_REG
cli
nop ; Give a couple of cycles
sei
ldal STATE_REG
ora #$10 ; Read Bank 0 / Write Bank 1
txa ; Restore the state
stal STATE_REG
rep #$20
rep #$30
bra entry_1
; This is the spot that needs to be page-aligned. In addition to simplifying the entry address
@ -179,9 +179,9 @@ loop_back jmp loop-base ; +252 Ensure execution cont
loop_exit_3 jmp even_exit-base ; +255
odd_exit sep #$21 ; 8-bit mode and set the carry just in case we get to a snippet JMP
long_5 ldal OPCODE_SAVE ; Load the opcode that was saved
bit #$0B
bne :chk_jmp
;long_5 ldal OPCODE_SAVE ; Load the opcode that was saved
; bit #$0B
; bne :chk_jmp
long_6 ldal OPCODE_HIGH_SAVE+1 ; get the high byte of the PEA operand
; Fall-through when we have to push a byte on the left edge. Must be 8-bit on entry. Optimized
@ -240,14 +240,14 @@ epilogue_1 tsc
; its passed state, because having the carry bit clear prevents evaluation of
; the V bit.
;
; Version 2: In order to improve performance, especially for two-layer tiles + sprites, the
; snippet code was revised to have a fixed structure so that the constant DATA and
; MASK values always exist in the same location, regarless of the tile type. The
; tradeoff is that there is a different entry point into the snippet based on the
; tile type, but that is significantly cheaper to lookup and patch into the code
; field JMP instruction than it is to rebuild 20+ bytes of code each time.
; In order to improve performance, especially for two-layer tiles + sprites, the
; snippet code has a fixed structure so that the constant DATA and MASK values
; always exist in the same location, regarless of the tile type. The
; tradeoff is that there is a different entry point into the snippet based on the
; tile type, but that is significantly cheaper to lookup and patch into the code
; field JMP instruction than it is to rebuild 20+ bytes of code each time.
;
; There are different snippet templates + offset tables based on the EngineMode
; There are different snippet templates + offset tables based on the EngineMode
;
; EngineMode
;

229
src/blitter/TemplateLite.s Normal file
View File

@ -0,0 +1,229 @@
; Template and equates for GTE blitter
blt_return_lite EXT
use ../Defs.s ; this causes merlin32 to terminate early with no error output
mx %00
REL_BRA equ $E0 ; pre-calculated branch back from the interrupt enabler
; Return to caller -- this is the target address to patch in the JMP instruction on the last rendered line. We
; put it at the beginning so the rest of the bank can be replicated line templates.
lite_full_return ENT
jml blt_return_lite ; Full exit
; Start of the template code. This code is replicated 208 times in the code field
; bank, which is what is required to render 26 tiles to cover the full screen vertical
; scrolling. The lite blitter is crafted to allow the accumulator to be in 8-bit
; mode and avoid any need for rep/sep instructions to handle the odd-aligned case
lite_base ENT
lite_entry_1 ldx #0000 ; Sets screen address (right edge)
txs
lite_entry_jmp brl $0000 ; If the screen is odd-aligned, then the opcode is set to
; $A2 to convert to a LDX #imm instruction. This puts the
; relative offset of the instruction field in the register
; and falls through to the next instruction.
lda: *+1,x ; Get the low byte and push onto the stack
pha
lite_odd_entry brl $0000 ; unconditionally jump into the "next" instruction in the
; code field. This is OK, even if the entry point was the
; last instruction, because there is a JMP at the end of
; the code field, so the code will simply jump to that
; instruction directly.
;
; As with the original entry point, because all of the
; code field is page-aligned, only the low byte needs to
; be updated when the scroll position changes
; Re-enable interrupts and continue -- the even_exit JMP from the previous line will jump here every
; 8 or 16 lines in order to give the system time to handle interrupts.
lite_enable_int tyx
txs ; restore the stack. No 2-layer support, so B and D are set to GTE data bank
lda STATE_REG_OFF ; we are in 8-bit mode the whole time...
stal STATE_REG
cli
sei
lda STATE_REG_BLIT ; External values
stal STATE_REG
bra lite_entry_1
lite_loop_exit_1 jmp lite_odd_exit ; +0 Alternate exit point depending on whether the left edge is
lite_loop_exit_2 jmp lite_even_exit ; +3 odd-aligned
lite_loop lup 82 ; +6 Set up 82 PEA instructions, which is 328 pixels and consumes 246 bytes
pea $0000 ; This is 41 8x8 tiles in width. Need to have N+1 tiles for screen overlap
--^
lite_loop_back jmp lite_loop ; +252 Ensure execution continues to loop around
lite_loop_exit_3 jmp lite_even_exit ; +255
mx %10
lite_odd_exit lda #0 ; get the high byte of the saved PEA operand (odd-case is already in 8-bit mode)
pha
lite_even_exit jmp *+5 ; Jump to the next line.
dfb $F4,$00 ; low-word of the saved PEA instruction
; Now repeat the code above 207 more times. Loop 206 times and then manually do the last one
]line equ 1 ; start at line 1 (line zero was just done above)
lup 206
ldx #0000
txs
dfb $82,$00,$00
lda: *+1,x
pha
dfb $82,$00,$00
tyx
txs
lda STATE_REG_OFF
stal STATE_REG
cli
sei
lda STATE_REG_BLIT
stal STATE_REG
; bra *-34
dfb $80,REL_BRA
jmp _LINE_BASE+{_LINE_SIZE*]line}+_EXIT_ODD
jmp _LINE_BASE+{_LINE_SIZE*]line}+_EXIT_EVEN
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
pea $0000
jmp _LINE_BASE+{_LINE_SIZE*]line}+_LOOP
jmp _LINE_BASE+{_LINE_SIZE*]line}+_EXIT_EVEN
mx %10
lda #0
pha
jmp *+5
dfb $F4,$00
]line equ ]line+1
--^
:entry_207 ldx #0000
txs
dfb $82,$00,$00 ; brl $0000 starts at the next instruction
lda: *+1,x
sep #$20
pha
dfb $82,$00,$00
tyx
txs
lda STATE_REG_OFF
stal STATE_REG
cli
sei
lda STATE_REG_BLIT
stal STATE_REG
bra :entry_207
jmp :odd_out_207
jmp :exit_207
:loop_207
lup 82
pea $0000
--^
jmp :loop_207
jmp :exit_207
mx %10
:odd_out_207 lda #0
pha
:exit_207 jmp lite_enable_int
dfb $F4,$00
ds 3546 ; pad to the end of the bank to make sure we start at address $0000

View File

@ -5,92 +5,6 @@
; Based on the current value of StartY in the direct page. Set up the dispatch
; information so that the BltRange driver will render the correct code field
; lines in the correct order
_ApplyBG0YPosOld
:rtbl_idx_x2 equ tmp0
:virt_line_x2 equ tmp1
:lines_left_x2 equ tmp2
:draw_count_x2 equ tmp3
:stk_save equ tmp4
; First task is to fill in the STK_ADDR values by copying them from the RTable array. We
; copy from RTable[i] into BlitField[StartY+i]. As with all of this code, the difficult part
; is decomposing the update across banks
stz :rtbl_idx_x2 ; Start copying from the first entry in the table
lda StartY ; This is the base line of the virtual screen
jsr Mod208
sta StartYMod208
asl
sta :virt_line_x2 ; Keep track of it
phb ; Save the current bank
tsc ; we intentionally leak one byte of stack in each loop
sta :stk_save ; iteration, so save the stack to repair at the end
; copy a range of address from the table into the destination bank. If we restrict ourselves to
; rectangular playfields, this can be optimized to just subtracting a constant value. See the
; Templates::SetScreenAddrs subroutine.
lda ScreenHeight
asl
sta :lines_left_x2
; This is the verbose part -- figure out how many lines to draw. We don't want to artificially limit
; the height of the visible screen (for example, doing an animated wipe while scrolling), so the screen
; height could be anything from 1 to 200.
;
; For larger values, we want to break things up on 16-line boundaries based on the virt_line value. So,
;
; draw_count = min(lines_left, (16 - (virt_line % 16))
:loop
ldx :virt_line_x2
ldal BTableLow,x ; Get the address of the first code field line
tay
ldal BTableHigh,x ; Target bank in low byte
pha
txa
and #$001E
eor #$FFFF
sec
adc #32
min :lines_left_x2
sta :draw_count_x2 ; Do this many lines
tax
clc ; pre-advance virt_line_2 because we have the value
adc :virt_line_x2
sta :virt_line_x2
plb
jsr _CopyRTableToStkAddr
; CopyRTableToStkAddr :rtbl_idx_x2 ; X = rtbl_idx_x2 on return
txa ; carry flag is unchanged
adc :draw_count_x2 ; advance the index into the RTable
sta :rtbl_idx_x2
lda :lines_left_x2 ; subtract the number of lines we just completed
sec
sbc :draw_count_x2
sta :lines_left_x2
jne :loop
lda :stk_save
tcs
plb
rts
; This is an optimized version of _ApplyBG0YPos. We pre-compute the breakdown across the bank
; boundries in order to eliminate the the minimum calculation and some loop variable updates
; from the inner loop.
_ApplyBG0YPos

93
src/blitter/VertLite.s Normal file
View File

@ -0,0 +1,93 @@
; Subroutines that deal with the vertical scrolling and rendering. The primary function
; of these routines are to adjust tables and patch in new values into the code field
; when the virtual Y-position of the play field changes.
_ApplyBG0YPosLite
:rtbl_idx_x2 equ tmp0
:virt_line_x2 equ tmp1
:lines_left_x2 equ tmp2
:draw_count_x2 equ tmp3
:stk_save equ tmp4
:line_count equ tmp5
; First task is to fill in the STK_ADDR values by copying them from the RTable array. We
; copy from RTable[i] into BlitField[StartY+i].
stz :rtbl_idx_x2 ; Start copying from the first entry in the table
lda StartY ; This is the base line of the virtual screen
jsr Mod208
sta StartYMod208
asl
sta :virt_line_x2 ; Keep track of it
; copy a range of address from the table into the destination bank. If we restrict ourselves to
; rectangular playfields, this can be optimized to just subtracting a constant value. See the
; Templates::SetScreenAddrs subroutine.
lda ScreenHeight
asl
sta :lines_left_x2
; Check to see if we need to split the update into two parts, e.g. do we wrap around the end
; of the code field?
ldx :lines_left_x2
lda #208*2
sec
sbc :virt_line_x2 ; calculate number of lines to the end of the buffer
cmp :lines_left_x2
bcs :one_pass ; if there's room, do it in one shot
tax ; Only do this many lines right now (saved to draw_count_x2)
jsr :one_pass ; Go through with this draw count
stz :virt_line_x2 ; virtual line is at the top (by construction)
lda :lines_left_x2
sec
sbc :draw_count_x2 ; this many left to draw. Fall through to finish up
tax
; Set up the addresses for filling in the code field
:one_pass
stx :draw_count_x2
phb ; Save the current bank
ldx :virt_line_x2
lda BTableLow,x ; Get the address of the first code field line
tay
iny ; Fill in the first byte (_ENTRY_1 = 0)
sep #$20 ; Set the data bank to the code field
lda BTableHigh
pha
plb
rep #$21 ; clear the carry while we're here...
lda :draw_count_x2 ; Do this many lines
asl ; x4
asl ; x8
asl ; x16
sec
sbc :draw_count_x2 ; x14
lsr ; x7
eor #$FFFF
sec
adc #:bottom
stal :entry+1 ; patch in the dispatch address
; This is an inline, unrolled version of CopyRTableToStkAddr
:entry jmp $0000
]line equ 199
lup 200
ldal RTable+{]line*2},x
sta {]line*_LINE_SIZE},y
]line equ ]line-1
--^
:bottom
plb
rts

View File

@ -286,7 +286,7 @@ DynamicOverTwoLyr
; tile blitter in the TwoLayer function set sees that a tile is marked as DAMAGED, it must
; restore the original code structure before proceeding.
;
; The damages area is not too bad -- just the 10 bytes from [2, 10] are overwritten and must be
; The damaged area is not too bad -- just the 10 bytes from [2, 10] are overwritten and must be
; restored. This is actually less work than a lot of the snippet macros were doing before
; applying the fixed snippet optimization.
DynamicUnderTwoLyr
@ -608,11 +608,11 @@ CopyTileToDyn
tax
tya
and #$001F ; Maximum of 32 dynamic tiles
and #$001F ; Maximum of 32 dynamic tiles
asl
asl ; 4 bytes per page
asl ; 4 bytes per page
adc BlitterDP ; Add to the bank 00 base address
adc #$0100 ; Go to the next page
adc #$0100 ; Go to the next page
tay
jsr CopyTileDToDyn ; Copy the tile data
jmp CopyTileMToDyn ; Copy the tile mask

View File

@ -4,6 +4,12 @@
; not needed to improve rendering speed.
ConstTile0Fast
lda TileStore+TS_CODE_ADDR_HIGH,x ; load the bank of the target code field line
pha ; and put on the stack for later. Has TileStore bank in high byte.
ldy TileStore+TS_CODE_ADDR_LOW,x ; load the address of the code field
; lda TileStore+TS_TILE_ADDR,x ; load the address of this tile's data (pre-calculated)
plb
lda #0
sta: $0001,y
sta: $0004,y
@ -273,6 +279,11 @@ FastCopyTileDataAndMaskV
; This is called via a JMP (abs,x) with an extra byte on the stack that holds the bank
; register value. This must be restored prior to returning
CopyTileAFast
lda TileStore+TS_CODE_ADDR_HIGH,x ; load the bank of the target code field line
pha ; and put on the stack for later. Has TileStore bank in high byte.
ldy TileStore+TS_CODE_ADDR_LOW,x ; load the address of the code field
lda TileStore+TS_TILE_ADDR,x ; load the address of this tile's data (pre-calculated)
plb
tax
_CopyTileAFast
]line equ 0
@ -288,6 +299,12 @@ _CopyTileAFast
CopyTileVFast
lda TileStore+TS_CODE_ADDR_HIGH,x ; load the bank of the target code field line
pha ; and put on the stack for later. Has TileStore bank in high byte.
ldy TileStore+TS_CODE_ADDR_LOW,x ; load the address of the code field
lda TileStore+TS_TILE_ADDR,x ; load the address of this tile's data (pre-calculated)
plb
tax
_CopyTileVFast
]src equ 7

282
src/render/Lite.s Normal file
View File

@ -0,0 +1,282 @@
; Collection of render function used when the engine is in "GTE Lite" mode. In this mode
; there are no dynamic tile or two layer tiles enabled, so all of the tiles are comprised
; of PEA opcodes. These functions take advantage of this and the fact that masks are
; not needed to improve rendering speed.
;
; The GTE Lite mode uses a compact code field that fits in a single bank of memory, so
; all of the rendering routines are basically the same as those in Fast.s, but use a
; different stride.
SpriteUnder0Lite
ConstTile0Lite
lda TileStore+TS_CODE_ADDR_HIGH,x ; load the bank of the target code field line
pha ; and put on the stack for later. Has TileStore bank in high byte.
ldy TileStore+TS_CODE_ADDR_LOW,x ; load the address of the code field
plb
lda #0
]line equ 0
lup 8
sta: {_LINE_SIZE*]line}+$0001,y
sta: {_LINE_SIZE*]line}+$0004,y
]line equ ]line+1
--^
plb
rts
SpriteOverALite
lda TileStore+TS_CODE_ADDR_HIGH,x ; load the bank of the target code field line
pha ; and put on the stack for later. Has TileStore bank in high byte.
ldy TileStore+TS_CODE_ADDR_LOW,x ; load the address of the code field
lda TileStore+TS_TILE_ADDR,x
tax
plb
_SpriteOverALite
]line equ 0
lup 8
ldal tiledata+{]line*4},x
and tmp_sprite_mask+{]line*4}
ora tmp_sprite_data+{]line*4}
sta: $0004+{]line*_LINE_SIZE},y
ldal tiledata+{]line*4}+2,x
and tmp_sprite_mask+{]line*4}+2
ora tmp_sprite_data+{]line*4}+2
sta: $0001+{]line*_LINE_SIZE},y
]line equ ]line+1
--^
plb
rts
SpriteOverVLite
lda TileStore+TS_CODE_ADDR_HIGH,x ; load the bank of the target code field line
pha ; and put on the stack for later. Has TileStore bank in high byte.
ldy TileStore+TS_CODE_ADDR_LOW,x ; load the address of the code field
lda TileStore+TS_TILE_ADDR,x
tax
plb
_SpriteOverVLite
]src equ 7
]dest equ 0
lup 8
ldal tiledata+{]src*4},x
and tmp_sprite_mask+{]dest*4}
ora tmp_sprite_data+{]dest*4}
sta: $0004+{]dest*_LINE_SIZE},y
ldal tiledata+{]src*4}+2,x
and tmp_sprite_mask+{]dest*4}+2
ora tmp_sprite_data+{]dest*4}+2
sta: $0001+{]dest*_LINE_SIZE},y
]src equ ]src-1
]dest equ ]dest+1
--^
plb
rts
SpriteOver0Lite
lda TileStore+TS_CODE_ADDR_HIGH,x ; load the bank of the target code field line
pha ; and put on the stack for later. Has TileStore bank in high byte.
ldy TileStore+TS_CODE_ADDR_LOW,x ; load the address of the code field
plb
_SpriteOver0Lite
]line equ 0
lup 8
lda tmp_sprite_data+{]line*4}
sta: $0004+{]line*_LINE_SIZE},y
lda tmp_sprite_data+{]line*4}+2
sta: $0001+{]line*_LINE_SIZE},y
]line equ ]line+1
--^
plb
rts
SpriteUnderALite
lda TileStore+TS_CODE_ADDR_HIGH,x ; load the bank of the target code field line
pha ; and put on the stack for later. Has TileStore bank in high byte.
ldy TileStore+TS_CODE_ADDR_LOW,x ; load the address of the code field
lda TileStore+TS_TILE_ADDR,x
tax
plb
_SpriteUnderALite
]line equ 0
lup 8
lda tmp_sprite_data+{]line*4}
andl tiledata+{]line*4}+32,x
oral tiledata+{]line*4},x
sta: $0004+{]line*_LINE_SIZE},y
lda tmp_sprite_data+{]line*4}+2
andl tiledata+{]line*4}+32+2,x
oral tiledata+{]line*4}+2,x
sta: $0001+{]line*_LINE_SIZE},y
]line equ ]line+1
--^
plb
rts
SpriteUnderVLite
lda TileStore+TS_CODE_ADDR_HIGH,x ; load the bank of the target code field line
pha ; and put on the stack for later. Has TileStore bank in high byte.
ldy TileStore+TS_CODE_ADDR_LOW,x ; load the address of the code field
lda TileStore+TS_TILE_ADDR,x
tax
plb
_SpriteUnderVLite
]src equ 7
]dest equ 0
lup 8
lda tmp_sprite_data+{]dest*4}
andl tiledata+{]src*4}+32,x
oral tiledata+{]src*4},x
sta: $0004+{]dest*_LINE_SIZE},y
lda tmp_sprite_data+{]dest*4}+2
andl tiledata+{]src*4}+32+2,x
oral tiledata+{]src*4}+2,x
sta: $0001+{]dest*_LINE_SIZE},y
]src equ ]src-1
]dest equ ]dest+1
--^
plb
rts
CopyTileALite
lda TileStore+TS_CODE_ADDR_HIGH,x ; load the bank of the target code field line
pha ; and put on the stack for later. Has TileStore bank in high byte.
ldy TileStore+TS_CODE_ADDR_LOW,x ; load the address of the code field
lda TileStore+TS_TILE_ADDR,x ; load the address of this tile's data (pre-calculated)
plb
tax
; brk $ac
_CopyTileALite
]line equ 0
lup 8
ldal tiledata+{]line*4},x
sta: $0004+{]line*_LINE_SIZE},y
ldal tiledata+{]line*4}+2,x
sta: $0001+{]line*_LINE_SIZE},y
]line equ ]line+1
--^
plb
rts
CopyTileVLite
lda TileStore+TS_CODE_ADDR_HIGH,x ; load the bank of the target code field line
pha ; and put on the stack for later. Has TileStore bank in high byte.
ldy TileStore+TS_CODE_ADDR_LOW,x ; load the address of the code field
lda TileStore+TS_TILE_ADDR,x ; load the address of this tile's data (pre-calculated)
plb
tax
_CopyTileVLite
]src equ 7
]dest equ 0
lup 8
ldal tiledata+{]src*4},x
sta: $0004+{]dest*_LINE_SIZE},y
ldal tiledata+{]src*4}+2,x
sta: $0001+{]dest*_LINE_SIZE},y
]src equ ]src-1
]dest equ ]dest+1
--^
plb
rts
OneSpriteLiteOver0
ldy TileStore+TS_CODE_ADDR_HIGH,x ; load the bank of the target code field line
phy ; and put on the stack for later. Has TileStore bank in high byte.
ldy TileStore+TS_CODE_ADDR_LOW,x ; load the address of the code field
tax ; VBuff address from SpriteBitsToVBuffAddrs macro
plb ; set to the code field bank
_OneSpriteLiteOver0
]line equ 0
lup 8
ldal spritedata+{]line*SPRITE_PLANE_SPAN},x
sta: $0004+{]line*_LINE_SIZE},y
ldal spritedata+{]line*SPRITE_PLANE_SPAN}+2,x
sta: $0001+{]line*_LINE_SIZE},y
]line equ ]line+1
--^
plb ; Restore the TileStore bank
rts
; Next implementation; drawing a sprite onto a regular tile. The 1-sprite dispatch preserves the
; X-register, so it already points to the TileStore
OneSpriteLiteOverV
jsr FastCopyTileDataV
bra _OneSpriteLiteOver
OneSpriteLiteOverA
jsr FastCopyTileDataA
_OneSpriteLiteOver
lda TileStore+TS_CODE_ADDR_HIGH,x ; load the bank of the target code field line
pha ; and put on the stack for later. Has TileStore bank in high byte.
ldy TileStore+TS_CODE_ADDR_LOW,x ; load the address of the code field
ldx sprite_ptr0
plb
_OneSpriteLiteOverA
_OneSpriteLiteOverV
]line equ 0
lup 8
lda tmp_tile_data+{]line*4}
andl spritemask+{]line*SPRITE_PLANE_SPAN},x
oral spritedata+{]line*SPRITE_PLANE_SPAN},x
sta: $0004+{]line*_LINE_SIZE},y
lda tmp_tile_data+{]line*4}+2
andl spritemask+{]line*SPRITE_PLANE_SPAN}+2,x
oral spritedata+{]line*SPRITE_PLANE_SPAN}+2,x
sta: $0001+{]line*_LINE_SIZE},y
]line equ ]line+1
--^
plb
rts
OneSpriteLiteUnderA
jsr FastCopyTileDataAndMaskA
bra _OneSpriteLiteUnder
OneSpriteLiteUnderV
jsr FastCopyTileDataAndMaskV
_OneSpriteLiteUnder
lda TileStore+TS_CODE_ADDR_HIGH,x ; load the bank of the target code field line
pha ; and put on the stack for later. Has TileStore bank in high byte.
ldy TileStore+TS_CODE_ADDR_LOW,x ; load the address of the code field
ldx sprite_ptr0
plb
_OneSpriteLiteUnderA
_OneSpriteLiteUnderV
]line equ 0
lup 8
ldal spritedata+{]line*SPRITE_PLANE_SPAN},x
and tmp_tile_mask+{]line*4}
ora tmp_tile_data+{]line*4}
sta: $0004+{]line*_LINE_SIZE},y
ldal spritedata+{]line*SPRITE_PLANE_SPAN}+2,x
and tmp_tile_mask+{]line*4}+2
ora tmp_tile_data+{]line*4}+2
sta: $0001+{]line*_LINE_SIZE},y
]line equ ]line+1
--^
plb
rts

View File

@ -1,8 +1,8 @@
This folder contains the rendering tuples for the different type of tile rendering modes
that are defined by both the engine mode and the specific tile attributes. There are
a *lot* or variants, so they are cataloged here.
a *lot* of variants, so they are cataloged here.
The top-level TileRender function in the main entry point that defined the overal tile render
The top-level TileRender function in the main entry point that defines the overal tile render
flow as well as the register parameters and calling conventions for each of the modular
components.
@ -50,7 +50,7 @@ There are 5 pluggable functions that make up a rendering mode
4. K_TS_COPY_TILE_DATA & K_TS_APPLY_TILE_DATA
A pair of function that copye tile data (and possible mask information) into a temporary
A pair of function that copy tile data (and possible mask information) into a temporary
direct page space and then render that workspace into the code field.
These functions are used as building blocks by the generic Over/Under multi-sprite

View File

@ -3,8 +3,9 @@
_RenderTile
lda TileStore+TS_SPRITE_FLAG,x ; any sprites on this tile?
bne _HasSprites
jmp (K_TS_BASE_TILE_DISP,x) ; go to the tile copy routine
; Probably best to rework this to just jump to the tile routine directly, event if there
; Probably best to rework this to just jump to the tile routine directly, even if there
; is some boilerplate code because it is useful to be able to access the data bank before
; switching to the code field bank.

View File

@ -102,14 +102,17 @@ TileStoreLookup ENT
;
; Remember, because the data is pushed on to the stack, the last instruction, which is
; in the highest memory location, pushed data that apepars on the left edge of the screen.
;
; This table is overwritten by the "Lite" engine intialization code to provide a different set
; of offsets since the lite blitter has a different offset than the normal one.
]step equ 0
dw CODE_TOP ; There is a spot where we load Col2CodeOffet-2,x
dw CODE_TOP ; There is a spot where we load Col2CodeOffset-2,x
Col2CodeOffset ENT
lup 82
dw CODE_TOP+{{81-]step}*PER_TILE_SIZE}
]step equ ]step+1
--^
]step equ 0
lup 82 ; Make is a double-length table so we can add the ScreenWidth without testing for wrap-around
dw CODE_TOP+{{81-]step}*PER_TILE_SIZE}
]step equ ]step+1
@ -135,7 +138,7 @@ JTableOffset ENT
; physical word index that each instruction is intended to be placed at is in the comment.
bra *-3 ; wrap around
CodeFieldEvenBRA ENT
bra *+6 ; 81 -- need to skip over the JMP loop that passed control back
bra *+6 ; 81 -- need to skip over the JMP loop that passes control back
bra *+9 ; 80
bra *+12 ; 79
bra *+15 ; 78
@ -220,7 +223,7 @@ CodeFieldEvenBRA ENT
bra *-6 ; wrap around
CodeFieldOddBRA ENT
bra *+9 ; 81 -- need to skip over two JMP instructions
bra *+9 ; 81 / 0 -- need to skip over two JMP instructions
bra *+12 ; 80
bra *+15 ; 79
bra *+18 ; 78
@ -230,7 +233,7 @@ CodeFieldOddBRA ENT
bra *+30 ; 74
bra *+33 ; 73
bra *+36 ; 72
bra *+39 ; 71
bra *+39 ; 71 /10
bra *+42 ; 70
bra *+45 ; 69
bra *+48 ; 68
@ -240,7 +243,7 @@ CodeFieldOddBRA ENT
bra *+60 ; 64
bra *+63 ; 64
bra *+66 ; 62
bra *+69 ; 61
bra *+69 ; 61 / 20
bra *+72 ; 60
bra *+75 ; 59
bra *+78 ; 58
@ -250,7 +253,7 @@ CodeFieldOddBRA ENT
bra *+90 ; 54
bra *+93 ; 53
bra *+96 ; 52
bra *+99 ; 51
bra *+99 ; 51 / 30
bra *+102 ; 50
bra *+105 ; 49
bra *+108 ; 48
@ -260,7 +263,7 @@ CodeFieldOddBRA ENT
bra *+120 ; 44
bra *+123 ; 43
bra *+126 ; 42
bra *+129 ; 41
bra *+129 ; 41 / 40
bra *-126 ; 40
bra *-123 ; 39
bra *-120 ; 38
@ -270,7 +273,7 @@ CodeFieldOddBRA ENT
bra *-108 ; 34
bra *-105 ; 33
bra *-102 ; 32
bra *-99 ; 31
bra *-99 ; 31 / 50
bra *-96 ; 30
bra *-93 ; 29
bra *-90 ; 28
@ -280,7 +283,7 @@ CodeFieldOddBRA ENT
bra *-78 ; 24
bra *-75 ; 23
bra *-72 ; 22
bra *-69 ; 21
bra *-69 ; 21 / 60
bra *-66 ; 20
bra *-63 ; 19
bra *-60 ; 18
@ -290,7 +293,7 @@ CodeFieldOddBRA ENT
bra *-48 ; 14
bra *-45 ; 13
bra *-42 ; 12
bra *-39 ; 11
bra *-39 ; 11 / 70
bra *-36 ; 10
bra *-33 ; 9
bra *-30 ; 8
@ -300,7 +303,7 @@ CodeFieldOddBRA ENT
bra *-18 ; 4
bra *-15 ; 3
bra *-12 ; 2
bra *-9 ; 1
bra *-9 ; 1 / 80
bra *-6 ; 0 -- branch back 6 to skip the JMP even path
]step equ $2000
@ -550,7 +553,7 @@ ObjectListCount ENT
ObjectListHead ENT
ds 2
ObjectList ENT
ds {10*{MAX_ELEMENTS+2}} ; Extra space at the end for a sentinel marker
ds {2*{MAX_ELEMENTS+2}} ; Extra space at the end for a sentinel marker
; Steps to the different sprite stamps
@ -560,6 +563,11 @@ _stamp_step ENT
BG1YCache ENT
ds 32
ExtSpriteRenderer ENT
dw 0,0
ExtUpdateBG0Tiles ENT
dw 0,0
; Scaling tables for the BG1 rotation tables.
ScalingTables ENT
dw Scale0,Scale1,Scale2,Scale3

View File

@ -10,17 +10,12 @@ TS_DIRTY equ {TILE_STORE_SIZE*1} ; Flag. Used to prevent a ti
TS_SPRITE_FLAG equ {TILE_STORE_SIZE*2} ; Bitfield of all sprites that intersect this tile. 0 if no sprites.
TS_TILE_ADDR equ {TILE_STORE_SIZE*3} ; cached value, the address of the tiledata for this tile
TS_CODE_ADDR_LOW equ {TILE_STORE_SIZE*4} ; const value, address of this tile in the code fields
TS_CODE_ADDR_HIGH equ {TILE_STORE_SIZE*5}
TS_WORD_OFFSET equ {TILE_STORE_SIZE*6} ; const value, word offset value for this tile if LDA (dp),y instructions re used
TS_CODE_ADDR_HIGH equ {TILE_STORE_SIZE*5} ; the top byte of this address holds the GTE data bank for easy restore
TS_WORD_OFFSET equ {TILE_STORE_SIZE*6} ; const value, word offset value for this tile if LDA (dp),y instructions are used
TS_JMP_ADDR equ {TILE_STORE_SIZE*7} ; const value, address of the 32-byte snippet space for this tile
TS_SCREEN_ADDR equ {TILE_STORE_SIZE*8} ; cached value of on-screen location of tile. Used for DirtyRender.
; TODO: Move these arrays into the K bank to support direct dispatch via jmp (abs,x)
; TS_BASE_TILE_COPY equ {TILE_STORE_SIZE*9} ; derived from TS_TILE_ID to optimize tile copy to support sprite rendering
; TS_BASE_TILE_DISP equ {TILE_STORE_SIZE*10} ; derived from TS_TILE_ID to optimize base (non-sprite) tile dispatch in the Render function
; TS_DIRTY_TILE_DISP equ {TILE_STORE_SIZE*11} ; derived from TS_TILE_ID to optimize dirty tile dispatch in the Render function
TILE_STORE_NUM equ 12 ; Need this many parallel arrays
TILE_STORE_NUM equ 9 ; Need this many parallel arrays
; Sprite data structures. We cache quite a few pieces of information about the sprite
; to make calculations faster, so this is hidden from the caller.
@ -28,15 +23,11 @@ TILE_STORE_NUM equ 12 ; Need this many parallel arra
MAX_SPRITES equ 16
SPRITE_REC_SIZE equ 42
MAX_OVERLAYS equ 2
MAX_OVERLAYS equ 3
MAX_ELEMENTS equ {MAX_SPRITES+MAX_OVERLAYS}
; Object list used in renderer
OL_SPRITE_ID equ 0 ; Usual parallel arrays
OL_SPRITE_TOP equ {2*{MAX_ELEMENTS+1}}
OL_SPRITE_BOTTOM equ {4*{MAX_ELEMENTS+1}}
OL_NEXT equ {6*{MAX_ELEMENTS+1}}
OL_INDEX equ {8*{MAX_ELEMENTS+1}} ; Reference to the index in the _Sprites array
OL_INDEX equ {0*{MAX_ELEMENTS+1}} ; Reference to the index in the _Sprites array
; Mark each sprite as ADDED, UPDATED, MOVED, REMOVED depending on the actions applied to it
; on this frame. Quick note, the same Sprite ID cannot be removed and added in the same frame.