Ver. 32 fix cursor location after sprite copy

This commit is contained in:
Michaelangel007 2017-10-30 09:17:23 -07:00
parent 335fbc1a68
commit ba6b7d0d05
5 changed files with 225 additions and 3 deletions

View File

@ -4,6 +4,7 @@
![dhgr byte inspector screenshot](screenshots/dhgrbyte.png?raw=true) ![dhgr byte inspector screenshot](screenshots/dhgrbyte.png?raw=true)
![view screenshot](screenshots/viewdhgr.png?raw=true) ![view screenshot](screenshots/viewdhgr.png?raw=true)
# Instructions # Instructions
1. Start AppleWin 1. Start AppleWin
@ -11,7 +12,13 @@
3. Open: `hgrbyte.dsk` 3. Open: `hgrbyte.dsk`
4. Select BASIC.SYSTEM 4. Select BASIC.SYSTEM
5. `BLOAD TUT.DHGR` 5. `BLOAD TUT.DHGR`
6. `BRUN DHGR.BYTE` 6. `-DHGR.BYTE`
# History
Ver 32.
- Fixed bug: Restore cursor position after when using sprite copy
Ver 31. Ver 31.
- Added `:` to save a sprite to mem - Added `:` to save a sprite to mem

Binary file not shown.

212
dhgr.symbols Normal file
View File

@ -0,0 +1,212 @@
sym CONFIG_DHGR = 0001 // # 6
sym CH = 0024 // # 83
sym CV = 0025 // # 84
sym CH80 = 057B // # 85
sym BASL = 0028 // # 86
sym GBASL = 0026 // # 88
sym GBASH = 0027 // # 89
sym SCREEN_W = 0080 // # 93
sym SCREEN_H = 0192 // # 96
sym HPOSN = F411 // # 99
sym TABV = FB5B // # 100
sym HOME = FC58 // # 102
sym SETTXT = FB39 // # 103
sym SW_STORE80 = C000 // # 118
sym SW_STORE81 = C001 // # 119
sym SW_SET40COL = C00C // # 121
sym SW_SET80COL = C00D // # 122
sym SW_AUXRDOFF = C002 // # 124
sym SW_AUXWROFF = C004 // # 125
sym SW_ALTCHAR0 = C00E // # 127
sym KEYBOARD = C000 // # 129
sym KEYSTROBE = C010 // # 130
sym SW_TXTCLR = C050 // # 132
sym SW_TXTSET = C051 // # 133
sym MIXCLR = C052 // # 134
sym MIXSET = C053 // # 135
sym PAGE1 = C054 // # 136
sym HIRES = C057 // # 137
sym SW_DHGR = C05E // # 138
sym SW_SHGR = C05F // # 139
sym SQUEEKER = C030 // # 141
sym F8_Wait = FCA8 // # 142
sym cursor_row = 00E2 // # 144
sym SPRITE_BASE = 6000 // # 146
sym zSpritePtr = 00F4 // # 147
sym tempByte = 00F6 // # 148
sym aux_ptr = 00F7 // # 149
sym lastkey = 00F9 // # 150
sym cursor_org = 00FA // # 151
sym cursor_tmp = 00FB // # 152
sym cursor_val = 00FC // # 153
sym INPUT_X = 0002 // # 157
sym INPUT_Y = 0007 // # 158
sym SPRITE_Y = 0001 // # 162
sym SPRITE_W = 0002 // # 163
sym SPRITE_H = 0003 // # 164
sym FLAG_FULL = 0001 // # 166
sym FLAG_REGION_1 = 0002 // # 168
sym FLAG_REGION_2 = 0004 // # 169
sym FLAG_REG_EVEN = 0008 // # 170
sym flags = 00FD // # 171
sym temp = 00FE // # 173
sym cursor_col = 00FF // # 174
sym HGRPAGE = 00E6 // # 175
sym MOV_SRC = 003C // # 178
sym MOV_END = 003E // # 179
sym MOV_DST = 0042 // # 180
sym AUXMOVE = C311 // # 181
sym MOVE = FE2C // # 182
sym DhgrByte = 0900 // # 190
sym GetByte = 0960 // # 247
sym PutByte = 0968 // # 251
sym Status = 096C // # 255
sym BadInput = 0971 // # 258
sym FlashByte = 0974 // # 260
sym GetKey = 0977 // # 262
sym LoadKeys = 0981 // # 267
sym FindKey = 0983 // # 269
sym GotKey = 098B // # 274
sym TogBit = 09CA // # 337
sym PutBits = 09D0 // # 343
sym GotoPutByte = 09D4 // # 345
sym ozunid_1 = 09D8 // # 358
sym Nibble = 09DD // # 364
sym NibbleInput = 09E7 // # 373
sym Digit = 09F5 // # 384
sym OldCursor = 09FA // # 388
sym FLASH_TIME = 0018 // # 393
sym UpdateInputCursor = 09FB // # 395
sym NewCursor = 0A0A // # 402
sym DisplayCursor = 0A17 // # 408
sym DisplayInput = 0A24 // # 414
sym OnGoto = 0A2F // # 423
sym UpdateX = 0A47 // # 439
sym ResetTimer = 0A4A // # 441
sym GotoWaitKey = 0A52 // # 446
sym GotoBadInput = 0A6E // # 464
sym GotoInputNib = 0A74 // # 469
sym GotoInputNextField = 0A89 // # 494
sym GotoFieldY = 0A94 // # 502
sym GotoInputAccept = 0AAB // # 515
sym GotoInputCancel = 0AC3 // # 534
sym OnResetRegion = 0AC5 // # 538
sym RegionTrampoline1 = 0ADA // # 548
sym ZeroRegion = 0ADC // # 551
sym SetSprite1WH = 0ADE // # 553
sym OnMarkRegion = 0AE5 // # 559
sym NoRegion1 = 0AF7 // # 576
sym DoneSprite = 0B06 // # 584
sym NoRegion2 = 0B09 // # 587
sym CalcWidth = 0B18 // # 596
sym SaveWidth = 0B21 // # 602
sym CalcHeight = 0B26 // # 607
sym SaveHeight = 0B2F // # 613
sym SetSpriteBase = 0B36 // # 619
sym OnSaveSprite = 0B3F // # 627
sym ValidDimensions = 0B47 // # 631
sym CopySpriteMeta = 0B58 // # 642
sym SaveRows = 0B63 // # 649
sym SaveCols = 0B6F // # 656
sym InvalidSprite = 0BA9 // # 691
sym OnLoadSprite = 0BAC // # 698
sym LoadRows = 0BD6 // # 721
sym LoadCols = 0BE1 // # 728
sym PutSpriteData = 0C08 // # 749
sym GetSpriteData = 0C0E // # 754
sym IncSpriteData = 0C13 // # 758
sym SamePage = 0C19 // # 762
sym IsHexInput = 0C1B // # 770
sym NotHex = 0C3A // # 787
sym HaveHex = 0C3B // # 789
sym SoftBeep = 0C3D // # 794
sym SoftCycle = 0C3F // # 796
sym DrawStatus = 0C53 // # 811
sym PrintNoRegion1 = 0CB7 // # 863
sym DoneStatusLine1 = 0CBE // # 868
sym PrintSpriteMeta = 0CC4 // # 878
sym PrintSpace = 0CD8 // # 889
sym PrintStatusLine2 = 0CDD // # 894
sym HaveAuxMem = 0CF5 // # 909
sym HaveMainMem = 0CFB // # 913
sym HaveMemType = 0CFF // # 916
sym PrintNoRegion2 = 0D3B // # 949
sym DoneStatusLine3 = 0D42 // # 953
sym PrintStatusLine3 = 0D42 // # 957
sym PrintStatusLine4 = 0D67 // # 980
sym PrintFooter2 = 0D7B // # 994
sym PrintStringZ = 0DC7 // # 1043
sym PrintString2 = 0DCF // # 1047
sym PrintString3 = 0DDA // # 1053
sym ReverseByte = 0DDB // # 1057
sym ReverseBit = 0DE1 // # 1061
sym PrintBitsNormal = 0DEC // # 1071
sym PrintBitsReverse = 0DFB // # 1081
sym PrintBitsReverse1 = 0DFF // # 1084
sym PrintInverseByte = 0E0F // # 1096
sym NibToInvTxt = 0E18 // # 1112
sym PrintSave = 0E22 // # 1118
sym Bit2Asc = 0E26 // # 1124
sym FlipBit = 0E2C // # 1128
sym GetHgrBaseAddr = 0E31 // # 1139
sym GetCursorByte = 0E45 // # 1160
sym GetCursorByteX = 0E47 // # 1169
sym FlashCursorByte = 0E54 // # 1187
sym SetCursorByte = 0E5A // # 1195
sym PutCursorByteX = 0E5D // # 1205
sym ClearText80 = 0E6E // # 1225
sym ClearText40 = 0E77 // # 1229
sym ClearTextPage = 0E7A // # 1232
sym PrintDollar = 0E98 // # 1246
sym PR_HEX = 0E9C // # 1249
sym PRBYTE = 0EA3 // # 1254
sym PR_NIB = 0EAC // # 1262
sym COUT = 0EAF // # 1265
sym Aux = 0EBA // # 1276
sym Main = 0EBD // # 1278
sym NibToAscTxt = 0EC8 // # 1294
sym Init_Exit = 0ED3 // # 1305
sym OnInit = 0EE7 // # 1331
sym OnExit = 0F27 // # 1374
sym DoneCopy = 0F49 // # 1396
sym VTAB_COL0 = 0F5A // # 1418
sym HTAB00 = 0F5D // # 1420
sym HTAB = 0F5F // # 1422
sym SetDst00 = 0F63 // # 1430
sym DoneDst00 = 0F70 // # 1437
sym gState = 0F71 // # 1443
sym gCursor = 0F72 // # 1444
sym gGotoNextX = 0F73 // # 1447
sym gGotoNextY = 0F74 // # 1448
sym gGotoField = 0F75 // # 1449
sym gGotoTimer1 = 0F76 // # 1450
sym gGotoTimer2 = 0F77 // # 1451
sym gKeyGotoNextField = 0F78 // # 1453
sym gKeyGotoCancel = 0F79 // # 1454
sym gKeyGotoAccept = 0F7A // # 1455
sym sTextSprite1 = 0F7B // # 1473
sym sTextSprite2 = 0F87 // # 1476
sym sTextSprite3 = 0F93 // # 1479
sym sTextFooter2 = 0F9F // # 1483
sym sTextFooter3 = 0FA5 // # 1487
sym sMemTypeBeg = 0FBC // # 1498
sym sMemTypeEnd = 0FC0 // # 1502
sym sPixelFooter = 0FC4 // # 1519
sym gSprite1X = 0FE4 // # 1533
sym gSprite1Y = 0FE5 // # 1534
sym gSprite1W = 0FE6 // # 1535
sym gSprite1H = 0FE7 // # 1536
sym gSprite1End = 0FE8 // # 1538
sym gSprite1Len = 0FEA // # 1539
sym gSprite2X = 0FEC // # 1541
sym gSprite2Y = 0FED // # 1542
sym gSpriteX = 0FEE // # 1544
sym gSpriteY = 0FEF // # 1545
sym gSpriteW = 0FF0 // # 1546
sym gSpriteH = 0FF1 // # 1547
sym gSpriteX2 = 0FF2 // # 1548
sym gSpriteY2 = 0FF3 // # 1549
sym aKeys = 0FF4 // # 1554
sym eKeys = 101E // # 1607
sym nKeys = 002E // # 1608
sym aFuncLo = 101E // # 1612

Binary file not shown.

View File

@ -6,7 +6,7 @@ CONFIG_BIOS = 0 ; 1=Use slow ROM for text, 0=Use native code for COUT, HOME
; DHGR Byte Inspector ; DHGR Byte Inspector
; Michael Pohoreski ; Michael Pohoreski
; https://github.com/Michaelangel007/apple2_hgrbyte/ ; https://github.com/Michaelangel007/apple2_hgrbyte/
; Version 31 ; Version 32
; ;
; TL:DR; ; TL:DR;
; IJKL to move ; IJKL to move
@ -189,7 +189,7 @@ __MAIN = $900
ORG __MAIN ORG __MAIN
DhgrByte DhgrByte
LDA #31 ; Version - copy HGR1 to aux, HGR2 to HGR1 LDA #32 ; Version - copy HGR1 to aux, HGR2 to HGR1
JSR Init_Exit ; FEATURE: Set to 00 if you don't want to copy AUX $2000 to MAIN $4000 JSR Init_Exit ; FEATURE: Set to 00 if you don't want to copy AUX $2000 to MAIN $4000
CLC CLC
BCC _Center BCC _Center
@ -716,6 +716,7 @@ OnLoadSprite
LDA cursor_row LDA cursor_row
STA gSpriteY STA gSpriteY
STA temp ; saved cursor_row since HPOSN updates it
LoadRows LoadRows
; Y -> Source Address ; Y -> Source Address
@ -740,6 +741,8 @@ LoadCols
LDA gSpriteH LDA gSpriteH
BNE LoadRows BNE LoadRows
LDA temp ; move cursor back up to the original location
STA cursor_row ; before we were called
JMP GetByte JMP GetByte
; --- Sprite --- ; --- Sprite ---